kodama-ui
Version:
Kodama UI is a Vue 3 component library that provides a set of components & funcionality to build your application.
46,600 lines • 1.64 MB
JavaScript
import { effectScope as jb, ref as re, markRaw as gr, getCurrentInstance as Fo, inject as pi, toRaw as wn, watch as Ct, reactive as Qt, isRef as Bt, isReactive as Vs, toRef as So, nextTick as Vn, computed as L, unref as W, getCurrentScope as Ub, onScopeDispose as Wb, toRefs as Gh, defineComponent as be, onMounted as st, h as jt, shallowRef as Yb, onUnmounted as jo, isVNode as ip, createApp as Tl, onBeforeUnmount as qi, resolveComponent as he, openBlock as C, createBlock as oe, createElementBlock as P, createElementVNode as U, toDisplayString as Se, createVNode as J, createTextVNode as Oe, withCtx as ne, createCommentVNode as F, shallowReactive as C6, provide as ci, watchEffect as ga, normalizeClass as se, renderSlot as X, Fragment as Ee, renderList as nt, normalizeStyle as Xe, mergeProps as dt, cloneVNode as O6, useSlots as op, createSlots as kn, normalizeProps as At, guardReactiveProps as hn, Teleport as Kb, withKeys as He, withModifiers as et, Transition as zn, resolveDynamicComponent as Eo, withDirectives as Qe, vShow as xn, onBeforeUpdate as A6, vModelText as ap, pushScopeId as Gb, popScopeId as Jb, customRef as M6, resolveDirective as Xb, onBeforeMount as D6, createStaticVNode as Qb } from "vue";
var Zb = !1;
function _u(t, e, n) {
return Array.isArray(t) ? (t.length = Math.max(t.length, e), t.splice(e, 1, n), n) : (t[e] = n, n);
}
function Ed(t, e) {
if (Array.isArray(t)) {
t.splice(e, 1);
return;
}
delete t[e];
}
function $6() {
return ev().__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
function ev() {
return typeof navigator < "u" && typeof window < "u" ? window : typeof global < "u" ? global : {};
}
const N6 = typeof Proxy == "function", P6 = "devtools-plugin:setup", I6 = "plugin:settings:set";
let Ko, $f;
function L6() {
var t;
return Ko !== void 0 || (typeof window < "u" && window.performance ? (Ko = !0, $f = window.performance) : typeof global < "u" && (!((t = global.perf_hooks) === null || t === void 0) && t.performance) ? (Ko = !0, $f = global.perf_hooks.performance) : Ko = !1), Ko;
}
function R6() {
return L6() ? $f.now() : Date.now();
}
class B6 {
constructor(e, n) {
this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = e, this.hook = n;
const r = {};
if (e.settings)
for (const a in e.settings) {
const s = e.settings[a];
r[a] = s.defaultValue;
}
const i = `__vue-devtools-plugin-settings__${e.id}`;
let o = Object.assign({}, r);
try {
const a = localStorage.getItem(i), s = JSON.parse(a);
Object.assign(o, s);
} catch {
}
this.fallbacks = {
getSettings() {
return o;
},
setSettings(a) {
try {
localStorage.setItem(i, JSON.stringify(a));
} catch {
}
o = a;
},
now() {
return R6();
}
}, n && n.on(I6, (a, s) => {
a === this.plugin.id && this.fallbacks.setSettings(s);
}), this.proxiedOn = new Proxy({}, {
get: (a, s) => this.target ? this.target.on[s] : (...u) => {
this.onQueue.push({
method: s,
args: u
});
}
}), this.proxiedTarget = new Proxy({}, {
get: (a, s) => this.target ? this.target[s] : s === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(s) ? (...u) => (this.targetQueue.push({
method: s,
args: u,
resolve: () => {
}
}), this.fallbacks[s](...u)) : (...u) => new Promise((l) => {
this.targetQueue.push({
method: s,
args: u,
resolve: l
});
})
});
}
async setRealTarget(e) {
this.target = e;
for (const n of this.onQueue)
this.target.on[n.method](...n.args);
for (const n of this.targetQueue)
n.resolve(await this.target[n.method](...n.args));
}
}
function sp(t, e) {
const n = t, r = ev(), i = $6(), o = N6 && n.enableEarlyProxy;
if (i && (r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !o))
i.emit(P6, t, e);
else {
const a = o ? new B6(n, i) : null;
(r.__VUE_DEVTOOLS_PLUGINS__ = r.__VUE_DEVTOOLS_PLUGINS__ || []).push({
pluginDescriptor: n,
setupFn: e,
proxy: a
}), a && e(a.proxiedTarget);
}
}
/*!
* pinia v2.0.35
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/
let ds;
const zs = (t) => ds = t, tv = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
/* istanbul ignore next */
Symbol()
);
function Io(t) {
return t && typeof t == "object" && Object.prototype.toString.call(t) === "[object Object]" && typeof t.toJSON != "function";
}
var Br;
(function(t) {
t.direct = "direct", t.patchObject = "patch object", t.patchFunction = "patch function";
})(Br || (Br = {}));
const Rc = typeof window < "u", bs = (process.env.NODE_ENV !== "production" || !1) && process.env.NODE_ENV !== "test" && Rc, Jh = /* @__PURE__ */ (() => typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof global == "object" && global.global === global ? global : typeof globalThis == "object" ? globalThis : { HTMLElement: null })();
function V6(t, { autoBom: e = !1 } = {}) {
return e && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type) ? new Blob([String.fromCharCode(65279), t], { type: t.type }) : t;
}
function up(t, e, n) {
const r = new XMLHttpRequest();
r.open("GET", t), r.responseType = "blob", r.onload = function() {
iv(r.response, e, n);
}, r.onerror = function() {
console.error("could not download file");
}, r.send();
}
function nv(t) {
const e = new XMLHttpRequest();
e.open("HEAD", t, !1);
try {
e.send();
} catch {
}
return e.status >= 200 && e.status <= 299;
}
function ol(t) {
try {
t.dispatchEvent(new MouseEvent("click"));
} catch {
const n = document.createEvent("MouseEvents");
n.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), t.dispatchEvent(n);
}
}
const al = typeof navigator == "object" ? navigator : { userAgent: "" }, rv = /* @__PURE__ */ (() => /Macintosh/.test(al.userAgent) && /AppleWebKit/.test(al.userAgent) && !/Safari/.test(al.userAgent))(), iv = Rc ? (
// Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype && !rv ? z6 : (
// Use msSaveOrOpenBlob as a second approach
"msSaveOrOpenBlob" in al ? H6 : (
// Fallback to using FileReader and a popup
q6
)
)
) : () => {
};
function z6(t, e = "download", n) {
const r = document.createElement("a");
r.download = e, r.rel = "noopener", typeof t == "string" ? (r.href = t, r.origin !== location.origin ? nv(r.href) ? up(t, e, n) : (r.target = "_blank", ol(r)) : ol(r)) : (r.href = URL.createObjectURL(t), setTimeout(function() {
URL.revokeObjectURL(r.href);
}, 4e4), setTimeout(function() {
ol(r);
}, 0));
}
function H6(t, e = "download", n) {
if (typeof t == "string")
if (nv(t))
up(t, e, n);
else {
const r = document.createElement("a");
r.href = t, r.target = "_blank", setTimeout(function() {
ol(r);
});
}
else
navigator.msSaveOrOpenBlob(V6(t, n), e);
}
function q6(t, e, n, r) {
if (r = r || open("", "_blank"), r && (r.document.title = r.document.body.innerText = "downloading..."), typeof t == "string")
return up(t, e, n);
const i = t.type === "application/octet-stream", o = /constructor/i.test(String(Jh.HTMLElement)) || "safari" in Jh, a = /CriOS\/[\d]+/.test(navigator.userAgent);
if ((a || i && o || rv) && typeof FileReader < "u") {
const s = new FileReader();
s.onloadend = function() {
let u = s.result;
if (typeof u != "string")
throw r = null, new Error("Wrong reader.result type");
u = a ? u : u.replace(/^data:[^;]*;/, "data:attachment/file;"), r ? r.location.href = u : location.assign(u), r = null;
}, s.readAsDataURL(t);
} else {
const s = URL.createObjectURL(t);
r ? r.location.assign(s) : location.href = s, r = null, setTimeout(function() {
URL.revokeObjectURL(s);
}, 4e4);
}
}
function Kt(t, e) {
const n = "🍍 " + t;
typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(n, e) : e === "error" ? console.error(n) : e === "warn" ? console.warn(n) : console.log(n);
}
function lp(t) {
return "_a" in t && "install" in t;
}
function ov() {
if (!("clipboard" in navigator))
return Kt("Your browser doesn't support the Clipboard API", "error"), !0;
}
function av(t) {
return t instanceof Error && t.message.toLowerCase().includes("document is not focused") ? (Kt('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn"), !0) : !1;
}
async function F6(t) {
if (!ov())
try {
await navigator.clipboard.writeText(JSON.stringify(t.state.value)), Kt("Global state copied to clipboard.");
} catch (e) {
if (av(e))
return;
Kt("Failed to serialize the state. Check the console for more details.", "error"), console.error(e);
}
}
async function j6(t) {
if (!ov())
try {
t.state.value = JSON.parse(await navigator.clipboard.readText()), Kt("Global state pasted from clipboard.");
} catch (e) {
if (av(e))
return;
Kt("Failed to deserialize the state from clipboard. Check the console for more details.", "error"), console.error(e);
}
}
async function U6(t) {
try {
iv(new Blob([JSON.stringify(t.state.value)], {
type: "text/plain;charset=utf-8"
}), "pinia-state.json");
} catch (e) {
Kt("Failed to export the state as JSON. Check the console for more details.", "error"), console.error(e);
}
}
let Zr;
function W6() {
Zr || (Zr = document.createElement("input"), Zr.type = "file", Zr.accept = ".json");
function t() {
return new Promise((e, n) => {
Zr.onchange = async () => {
const r = Zr.files;
if (!r)
return e(null);
const i = r.item(0);
return e(i ? { text: await i.text(), file: i } : null);
}, Zr.oncancel = () => e(null), Zr.onerror = n, Zr.click();
});
}
return t;
}
async function Y6(t) {
try {
const n = await (await W6())();
if (!n)
return;
const { text: r, file: i } = n;
t.state.value = JSON.parse(r), Kt(`Global state imported from "${i.name}".`);
} catch (e) {
Kt("Failed to export the state as JSON. Check the console for more details.", "error"), console.error(e);
}
}
function mr(t) {
return {
_custom: {
display: t
}
};
}
const sv = "🍍 Pinia (root)", Nf = "_root";
function K6(t) {
return lp(t) ? {
id: Nf,
label: sv
} : {
id: t.$id,
label: t.$id
};
}
function G6(t) {
if (lp(t)) {
const n = Array.from(t._s.keys()), r = t._s;
return {
state: n.map((o) => ({
editable: !0,
key: o,
value: t.state.value[o]
})),
getters: n.filter((o) => r.get(o)._getters).map((o) => {
const a = r.get(o);
return {
editable: !1,
key: o,
value: a._getters.reduce((s, u) => (s[u] = a[u], s), {})
};
})
};
}
const e = {
state: Object.keys(t.$state).map((n) => ({
editable: !0,
key: n,
value: t.$state[n]
}))
};
return t._getters && t._getters.length && (e.getters = t._getters.map((n) => ({
editable: !1,
key: n,
value: t[n]
}))), t._customProperties.size && (e.customProperties = Array.from(t._customProperties).map((n) => ({
editable: !0,
key: n,
value: t[n]
}))), e;
}
function J6(t) {
return t ? Array.isArray(t) ? t.reduce((e, n) => (e.keys.push(n.key), e.operations.push(n.type), e.oldValue[n.key] = n.oldValue, e.newValue[n.key] = n.newValue, e), {
oldValue: {},
keys: [],
operations: [],
newValue: {}
}) : {
operation: mr(t.type),
key: mr(t.key),
oldValue: t.oldValue,
newValue: t.newValue
} : {};
}
function X6(t) {
switch (t) {
case Br.direct:
return "mutation";
case Br.patchFunction:
return "$patch";
case Br.patchObject:
return "$patch";
default:
return "unknown";
}
}
let ua = !0;
const sl = [], io = "pinia:mutations", dn = "pinia", { assign: Q6 } = Object, Cl = (t) => "🍍 " + t;
function Z6(t, e) {
sp({
id: "dev.esm.pinia",
label: "Pinia 🍍",
logo: "https://pinia.vuejs.org/logo.svg",
packageName: "pinia",
homepage: "https://pinia.vuejs.org",
componentStateTypes: sl,
app: t
}, (n) => {
typeof n.now != "function" && Kt("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), n.addTimelineLayer({
id: io,
label: "Pinia 🍍",
color: 15064968
}), n.addInspector({
id: dn,
label: "Pinia 🍍",
icon: "storage",
treeFilterPlaceholder: "Search stores",
actions: [
{
icon: "content_copy",
action: () => {
F6(e);
},
tooltip: "Serialize and copy the state"
},
{
icon: "content_paste",
action: async () => {
await j6(e), n.sendInspectorTree(dn), n.sendInspectorState(dn);
},
tooltip: "Replace the state with the content of your clipboard"
},
{
icon: "save",
action: () => {
U6(e);
},
tooltip: "Save the state as a JSON file"
},
{
icon: "folder_open",
action: async () => {
await Y6(e), n.sendInspectorTree(dn), n.sendInspectorState(dn);
},
tooltip: "Import the state from a JSON file"
}
],
nodeActions: [
{
icon: "restore",
tooltip: "Reset the state (option store only)",
action: (r) => {
const i = e._s.get(r);
i ? i._isOptionsAPI ? (i.$reset(), Kt(`Store "${r}" reset.`)) : Kt(`Cannot reset "${r}" store because it's a setup store.`, "warn") : Kt(`Cannot reset "${r}" store because it wasn't found.`, "warn");
}
}
]
}), n.on.inspectComponent((r, i) => {
const o = r.componentInstance && r.componentInstance.proxy;
if (o && o._pStores) {
const a = r.componentInstance.proxy._pStores;
Object.values(a).forEach((s) => {
r.instanceData.state.push({
type: Cl(s.$id),
key: "state",
editable: !0,
value: s._isOptionsAPI ? {
_custom: {
value: wn(s.$state),
actions: [
{
icon: "restore",
tooltip: "Reset the state of this store",
action: () => s.$reset()
}
]
}
} : (
// NOTE: workaround to unwrap transferred refs
Object.keys(s.$state).reduce((u, l) => (u[l] = s.$state[l], u), {})
)
}), s._getters && s._getters.length && r.instanceData.state.push({
type: Cl(s.$id),
key: "getters",
editable: !1,
value: s._getters.reduce((u, l) => {
try {
u[l] = s[l];
} catch (c) {
u[l] = c;
}
return u;
}, {})
});
});
}
}), n.on.getInspectorTree((r) => {
if (r.app === t && r.inspectorId === dn) {
let i = [e];
i = i.concat(Array.from(e._s.values())), r.rootNodes = (r.filter ? i.filter((o) => "$id" in o ? o.$id.toLowerCase().includes(r.filter.toLowerCase()) : sv.toLowerCase().includes(r.filter.toLowerCase())) : i).map(K6);
}
}), n.on.getInspectorState((r) => {
if (r.app === t && r.inspectorId === dn) {
const i = r.nodeId === Nf ? e : e._s.get(r.nodeId);
if (!i)
return;
i && (r.state = G6(i));
}
}), n.on.editInspectorState((r, i) => {
if (r.app === t && r.inspectorId === dn) {
const o = r.nodeId === Nf ? e : e._s.get(r.nodeId);
if (!o)
return Kt(`store "${r.nodeId}" not found`, "error");
const { path: a } = r;
lp(o) ? a.unshift("state") : (a.length !== 1 || !o._customProperties.has(a[0]) || a[0] in o.$state) && a.unshift("$state"), ua = !1, r.set(o, a, r.state.value), ua = !0;
}
}), n.on.editComponentState((r) => {
if (r.type.startsWith("🍍")) {
const i = r.type.replace(/^🍍\s*/, ""), o = e._s.get(i);
if (!o)
return Kt(`store "${i}" not found`, "error");
const { path: a } = r;
if (a[0] !== "state")
return Kt(`Invalid path for store "${i}":
${a}
Only state can be modified.`);
a[0] = "$state", ua = !1, r.set(o, a, r.state.value), ua = !0;
}
});
});
}
function e4(t, e) {
sl.includes(Cl(e.$id)) || sl.push(Cl(e.$id)), sp({
id: "dev.esm.pinia",
label: "Pinia 🍍",
logo: "https://pinia.vuejs.org/logo.svg",
packageName: "pinia",
homepage: "https://pinia.vuejs.org",
componentStateTypes: sl,
app: t,
settings: {
logStoreChanges: {
label: "Notify about new/deleted stores",
type: "boolean",
defaultValue: !0
}
// useEmojis: {
// label: 'Use emojis in messages ⚡️',
// type: 'boolean',
// defaultValue: true,
// },
}
}, (n) => {
const r = typeof n.now == "function" ? n.now.bind(n) : Date.now;
e.$onAction(({ after: a, onError: s, name: u, args: l }) => {
const c = uv++;
n.addTimelineEvent({
layerId: io,
event: {
time: r(),
title: "🛫 " + u,
subtitle: "start",
data: {
store: mr(e.$id),
action: mr(u),
args: l
},
groupId: c
}
}), a((f) => {
lo = void 0, n.addTimelineEvent({
layerId: io,
event: {
time: r(),
title: "🛬 " + u,
subtitle: "end",
data: {
store: mr(e.$id),
action: mr(u),
args: l,
result: f
},
groupId: c
}
});
}), s((f) => {
lo = void 0, n.addTimelineEvent({
layerId: io,
event: {
time: r(),
logType: "error",
title: "💥 " + u,
subtitle: "end",
data: {
store: mr(e.$id),
action: mr(u),
args: l,
error: f
},
groupId: c
}
});
});
}, !0), e._customProperties.forEach((a) => {
Ct(() => W(e[a]), (s, u) => {
n.notifyComponentUpdate(), n.sendInspectorState(dn), ua && n.addTimelineEvent({
layerId: io,
event: {
time: r(),
title: "Change",
subtitle: a,
data: {
newValue: s,
oldValue: u
},
groupId: lo
}
});
}, { deep: !0 });
}), e.$subscribe(({ events: a, type: s }, u) => {
if (n.notifyComponentUpdate(), n.sendInspectorState(dn), !ua)
return;
const l = {
time: r(),
title: X6(s),
data: Q6({ store: mr(e.$id) }, J6(a)),
groupId: lo
};
lo = void 0, s === Br.patchFunction ? l.subtitle = "⤵️" : s === Br.patchObject ? l.subtitle = "🧩" : a && !Array.isArray(a) && (l.subtitle = a.type), a && (l.data["rawEvent(s)"] = {
_custom: {
display: "DebuggerEvent",
type: "object",
tooltip: "raw DebuggerEvent[]",
value: a
}
}), n.addTimelineEvent({
layerId: io,
event: l
});
}, { detached: !0, flush: "sync" });
const i = e._hotUpdate;
e._hotUpdate = gr((a) => {
i(a), n.addTimelineEvent({
layerId: io,
event: {
time: r(),
title: "🔥 " + e.$id,
subtitle: "HMR update",
data: {
store: mr(e.$id),
info: mr("HMR update")
}
}
}), n.notifyComponentUpdate(), n.sendInspectorTree(dn), n.sendInspectorState(dn);
});
const { $dispose: o } = e;
e.$dispose = () => {
o(), n.notifyComponentUpdate(), n.sendInspectorTree(dn), n.sendInspectorState(dn), n.getSettings().logStoreChanges && Kt(`Disposed "${e.$id}" store 🗑`);
}, n.notifyComponentUpdate(), n.sendInspectorTree(dn), n.sendInspectorState(dn), n.getSettings().logStoreChanges && Kt(`"${e.$id}" store installed 🆕`);
});
}
let uv = 0, lo;
function Xh(t, e) {
const n = e.reduce((r, i) => (r[i] = wn(t)[i], r), {});
for (const r in n)
t[r] = function() {
const i = uv, o = new Proxy(t, {
get(...a) {
return lo = i, Reflect.get(...a);
},
set(...a) {
return lo = i, Reflect.set(...a);
}
});
return n[r].apply(o, arguments);
};
}
function t4({ app: t, store: e, options: n }) {
if (!e.$id.startsWith("__hot:")) {
if (n.state && (e._isOptionsAPI = !0), typeof n.state == "function") {
Xh(
// @ts-expect-error: can cast the store...
e,
Object.keys(n.actions)
);
const r = e._hotUpdate;
wn(e)._hotUpdate = function(i) {
r.apply(this, arguments), Xh(e, Object.keys(i._hmrPayload.actions));
};
}
e4(
t,
// FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
e
);
}
}
function n4() {
const t = jb(!0), e = t.run(() => re({}));
let n = [], r = [];
const i = gr({
install(o) {
zs(i), i._a = o, o.provide(tv, i), o.config.globalProperties.$pinia = i, bs && Z6(o, i), r.forEach((a) => n.push(a)), r = [];
},
use(o) {
return !this._a && !Zb ? r.push(o) : n.push(o), this;
},
_p: n,
// it's actually undefined here
// @ts-expect-error
_a: null,
_e: t,
_s: /* @__PURE__ */ new Map(),
state: e
});
return bs && typeof Proxy < "u" && i.use(t4), i;
}
function lv(t, e) {
for (const n in e) {
const r = e[n];
if (!(n in t))
continue;
const i = t[n];
Io(i) && Io(r) && !Bt(r) && !Vs(r) ? t[n] = lv(i, r) : t[n] = r;
}
return t;
}
const cv = () => {
};
function Qh(t, e, n, r = cv) {
t.push(e);
const i = () => {
const o = t.indexOf(e);
o > -1 && (t.splice(o, 1), r());
};
return !n && Ub() && Wb(i), i;
}
function Go(t, ...e) {
t.slice().forEach((n) => {
n(...e);
});
}
function Pf(t, e) {
t instanceof Map && e instanceof Map && e.forEach((n, r) => t.set(r, n)), t instanceof Set && e instanceof Set && e.forEach(t.add, t);
for (const n in e) {
if (!e.hasOwnProperty(n))
continue;
const r = e[n], i = t[n];
Io(i) && Io(r) && t.hasOwnProperty(n) && !Bt(r) && !Vs(r) ? t[n] = Pf(i, r) : t[n] = r;
}
return t;
}
const r4 = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
/* istanbul ignore next */
Symbol()
);
function i4(t) {
return !Io(t) || !t.hasOwnProperty(r4);
}
const { assign: ir } = Object;
function Zh(t) {
return !!(Bt(t) && t.effect);
}
function em(t, e, n, r) {
const { state: i, actions: o, getters: a } = e, s = n.state.value[t];
let u;
function l() {
!s && (process.env.NODE_ENV === "production" || !r) && (n.state.value[t] = i ? i() : {});
const c = process.env.NODE_ENV !== "production" && r ? (
// use ref() to unwrap refs inside state TODO: check if this is still necessary
Gh(re(i ? i() : {}).value)
) : Gh(n.state.value[t]);
return ir(c, o, Object.keys(a || {}).reduce((f, d) => (process.env.NODE_ENV !== "production" && d in c && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${d}" in store "${t}".`), f[d] = gr(L(() => {
zs(n);
const p = n._s.get(t);
return a[d].call(p, p);
})), f), {}));
}
return u = If(t, l, e, n, r, !0), u;
}
function If(t, e, n = {}, r, i, o) {
let a;
const s = ir({ actions: {} }, n);
if (process.env.NODE_ENV !== "production" && !r._e.active)
throw new Error("Pinia destroyed");
const u = {
deep: !0
// flush: 'post',
};
process.env.NODE_ENV !== "production" && !Zb && (u.onTrigger = (N) => {
l ? p = N : l == !1 && !S._hotUpdating && (Array.isArray(p) ? p.push(N) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
});
let l, c, f = gr([]), d = gr([]), p;
const h = r.state.value[t];
!o && !h && (process.env.NODE_ENV === "production" || !i) && (r.state.value[t] = {});
const m = re({});
let v;
function y(N) {
let R;
l = c = !1, process.env.NODE_ENV !== "production" && (p = []), typeof N == "function" ? (N(r.state.value[t]), R = {
type: Br.patchFunction,
storeId: t,
events: p
}) : (Pf(r.state.value[t], N), R = {
type: Br.patchObject,
payload: N,
storeId: t,
events: p
});
const w = v = Symbol();
Vn().then(() => {
v === w && (l = !0);
}), c = !0, Go(f, R, r.state.value[t]);
}
const k = o ? function() {
const { state: R } = n, w = R ? R() : {};
this.$patch((A) => {
ir(A, w);
});
} : (
/* istanbul ignore next */
process.env.NODE_ENV !== "production" ? () => {
throw new Error(`🍍: Store "${t}" is built using the setup syntax and does not implement $reset().`);
} : cv
);
function T() {
a.stop(), f = [], d = [], r._s.delete(t);
}
function b(N, R) {
return function() {
zs(r);
const w = Array.from(arguments), A = [], $ = [];
function I(g) {
A.push(g);
}
function E(g) {
$.push(g);
}
Go(d, {
args: w,
name: N,
store: S,
after: I,
onError: E
});
let O;
try {
O = R.apply(this && this.$id === t ? this : S, w);
} catch (g) {
throw Go($, g), g;
}
return O instanceof Promise ? O.then((g) => (Go(A, g), g)).catch((g) => (Go($, g), Promise.reject(g))) : (Go(A, O), O);
};
}
const D = /* @__PURE__ */ gr({
actions: {},
getters: {},
state: [],
hotState: m
}), x = {
_p: r,
// _s: scope,
$id: t,
$onAction: Qh.bind(null, d),
$patch: y,
$reset: k,
$subscribe(N, R = {}) {
const w = Qh(f, N, R.detached, () => A()), A = a.run(() => Ct(() => r.state.value[t], ($) => {
(R.flush === "sync" ? c : l) && N({
storeId: t,
type: Br.direct,
events: p
}, $);
}, ir({}, u, R)));
return w;
},
$dispose: T
}, S = Qt(process.env.NODE_ENV !== "production" || bs ? ir(
{
_hmrPayload: D,
_customProperties: gr(/* @__PURE__ */ new Set())
// devtools custom properties
},
x
// must be added later
// setupStore
) : x);
r._s.set(t, S);
const _ = r._e.run(() => (a = jb(), a.run(() => e())));
for (const N in _) {
const R = _[N];
if (Bt(R) && !Zh(R) || Vs(R))
process.env.NODE_ENV !== "production" && i ? _u(m.value, N, So(_, N)) : o || (h && i4(R) && (Bt(R) ? R.value = h[N] : Pf(R, h[N])), r.state.value[t][N] = R), process.env.NODE_ENV !== "production" && D.state.push(N);
else if (typeof R == "function") {
const w = process.env.NODE_ENV !== "production" && i ? R : b(N, R);
_[N] = w, process.env.NODE_ENV !== "production" && (D.actions[N] = R), s.actions[N] = R;
} else
process.env.NODE_ENV !== "production" && Zh(R) && (D.getters[N] = o ? (
// @ts-expect-error
n.getters[N]
) : R, Rc && (_._getters || // @ts-expect-error: same
(_._getters = gr([]))).push(N));
}
if (ir(S, _), ir(wn(S), _), Object.defineProperty(S, "$state", {
get: () => process.env.NODE_ENV !== "production" && i ? m.value : r.state.value[t],
set: (N) => {
if (process.env.NODE_ENV !== "production" && i)
throw new Error("cannot set hotState");
y((R) => {
ir(R, N);
});
}
}), process.env.NODE_ENV !== "production" && (S._hotUpdate = gr((N) => {
S._hotUpdating = !0, N._hmrPayload.state.forEach((R) => {
if (R in S.$state) {
const w = N.$state[R], A = S.$state[R];
typeof w == "object" && Io(w) && Io(A) ? lv(w, A) : N.$state[R] = A;
}
_u(S, R, So(N.$state, R));
}), Object.keys(S.$state).forEach((R) => {
R in N.$state || Ed(S, R);
}), l = !1, c = !1, r.state.value[t] = So(N._hmrPayload, "hotState"), c = !0, Vn().then(() => {
l = !0;
});
for (const R in N._hmrPayload.actions) {
const w = N[R];
_u(S, R, b(R, w));
}
for (const R in N._hmrPayload.getters) {
const w = N._hmrPayload.getters[R], A = o ? (
// special handling of options api
L(() => (zs(r), w.call(S, S)))
) : w;
_u(S, R, A);
}
Object.keys(S._hmrPayload.getters).forEach((R) => {
R in N._hmrPayload.getters || Ed(S, R);
}), Object.keys(S._hmrPayload.actions).forEach((R) => {
R in N._hmrPayload.actions || Ed(S, R);
}), S._hmrPayload = N._hmrPayload, S._getters = N._getters, S._hotUpdating = !1;
})), bs) {
const N = {
writable: !0,
configurable: !0,
// avoid warning on devtools trying to display this property
enumerable: !1
};
["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((R) => {
Object.defineProperty(S, R, ir({ value: S[R] }, N));
});
}
return r._p.forEach((N) => {
if (bs) {
const R = a.run(() => N({
store: S,
app: r._a,
pinia: r,
options: s
}));
Object.keys(R || {}).forEach((w) => S._customProperties.add(w)), ir(S, R);
} else
ir(S, a.run(() => N({
store: S,
app: r._a,
pinia: r,
options: s
})));
}), process.env.NODE_ENV !== "production" && S.$state && typeof S.$state == "object" && typeof S.$state.constructor == "function" && !S.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
state: () => new MyClass()
Found in store "${S.$id}".`), h && o && n.hydrate && n.hydrate(S.$state, h), l = !0, c = !0, S;
}
function dv(t, e, n) {
let r, i;
const o = typeof e == "function";
typeof t == "string" ? (r = t, i = o ? n : e) : (i = t, r = t.id);
function a(s, u) {
const l = Fo();
if (s = // in test mode, ignore the argument provided as we can always retrieve a
// pinia instance with getActivePinia()
(process.env.NODE_ENV === "test" && ds && ds._testing ? null : s) || l && pi(tv, null), s && zs(s), process.env.NODE_ENV !== "production" && !ds)
throw new Error(`[🍍]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
const pinia = createPinia()
app.use(pinia)
This will fail in production.`);
s = ds, s._s.has(r) || (o ? If(r, e, i, s) : em(r, i, s), process.env.NODE_ENV !== "production" && (a._pinia = s));
const c = s._s.get(r);
if (process.env.NODE_ENV !== "production" && u) {
const f = "__hot:" + r, d = o ? If(f, e, i, s, !0) : em(f, ir({}, i), s, !0);
u._hotUpdate(d), delete s.state.value[f], s._s.delete(f);
}
if (process.env.NODE_ENV !== "production" && Rc && l && l.proxy && // avoid adding stores that are just built for hot module replacement
!u) {
const f = l.proxy, d = "_pStores" in f ? f._pStores : f._pStores = {};
d[r] = c;
}
return c;
}
return a.$id = r, a;
}
/*!
* vue-tippy v6.6.0
* (c) 2024
* @license MIT
*/
var Nn = "top", cr = "bottom", dr = "right", Pn = "left", cp = "auto", fu = [Nn, cr, dr, Pn], Sa = "start", Hs = "end", o4 = "clippingParents", fv = "viewport", Za = "popper", a4 = "reference", tm = /* @__PURE__ */ fu.reduce(function(t, e) {
return t.concat([e + "-" + Sa, e + "-" + Hs]);
}, []), pv = /* @__PURE__ */ [].concat(fu, [cp]).reduce(function(t, e) {
return t.concat([e, e + "-" + Sa, e + "-" + Hs]);
}, []), s4 = "beforeRead", u4 = "read", l4 = "afterRead", c4 = "beforeMain", d4 = "main", f4 = "afterMain", p4 = "beforeWrite", h4 = "write", m4 = "afterWrite", g4 = [s4, u4, l4, c4, d4, f4, p4, h4, m4];
function Fr(t) {
return t ? (t.nodeName || "").toLowerCase() : null;
}
function Sr(t) {
if (t == null)
return window;
if (t.toString() !== "[object Window]") {
var e = t.ownerDocument;
return e && e.defaultView || window;
}
return t;
}
function Ea(t) {
var e = Sr(t).Element;
return t instanceof e || t instanceof Element;
}
function sr(t) {
var e = Sr(t).HTMLElement;
return t instanceof e || t instanceof HTMLElement;
}
function hv(t) {
if (typeof ShadowRoot > "u")
return !1;
var e = Sr(t).ShadowRoot;
return t instanceof e || t instanceof ShadowRoot;
}
function b4(t) {
var e = t.state;
Object.keys(e.elements).forEach(function(n) {
var r = e.styles[n] || {}, i = e.attributes[n] || {}, o = e.elements[n];
!sr(o) || !Fr(o) || (Object.assign(o.style, r), Object.keys(i).forEach(function(a) {
var s = i[a];
s === !1 ? o.removeAttribute(a) : o.setAttribute(a, s === !0 ? "" : s);
}));
});
}
function v4(t) {
var e = t.state, n = {
popper: {
position: e.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
return Object.assign(e.elements.popper.style, n.popper), e.styles = n, e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow), function() {
Object.keys(e.elements).forEach(function(r) {
var i = e.elements[r], o = e.attributes[r] || {}, a = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : n[r]), s = a.reduce(function(u, l) {
return u[l] = "", u;
}, {});
!sr(i) || !Fr(i) || (Object.assign(i.style, s), Object.keys(o).forEach(function(u) {
i.removeAttribute(u);
}));
});
};
}
var mv = {
name: "applyStyles",
enabled: !0,
phase: "write",
fn: b4,
effect: v4,
requires: ["computeStyles"]
};
function Vr(t) {
return t.split("-")[0];
}
var _o = Math.max, Ol = Math.min, _a = Math.round;
function Ta(t, e) {
e === void 0 && (e = !1);
var n = t.getBoundingClientRect(), r = 1, i = 1;
if (sr(t) && e) {
var o = t.offsetHeight, a = t.offsetWidth;
a > 0 && (r = _a(n.width) / a || 1), o > 0 && (i = _a(n.height) / o || 1);
}
return {
width: n.width / r,
height: n.height / i,
top: n.top / i,
right: n.right / r,
bottom: n.bottom / i,
left: n.left / r,
x: n.left / r,
y: n.top / i
};
}
function dp(t) {
var e = Ta(t), n = t.offsetWidth, r = t.offsetHeight;
return Math.abs(e.width - n) <= 1 && (n = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), {
x: t.offsetLeft,
y: t.offsetTop,
width: n,
height: r
};
}
function gv(t, e) {
var n = e.getRootNode && e.getRootNode();
if (t.contains(e))
return !0;
if (n && hv(n)) {
var r = e;
do {
if (r && t.isSameNode(r))
return !0;
r = r.parentNode || r.host;
} while (r);
}
return !1;
}
function jr(t) {
return Sr(t).getComputedStyle(t);
}
function y4(t) {
return ["table", "td", "th"].indexOf(Fr(t)) >= 0;
}
function Fi(t) {
return ((Ea(t) ? t.ownerDocument : (
// $FlowFixMe[prop-missing]
t.document
)) || window.document).documentElement;
}
function Bc(t) {
return Fr(t) === "html" ? t : (
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
t.assignedSlot || // step into the shadow DOM of the parent of a slotted node
t.parentNode || // DOM Element detected
(hv(t) ? t.host : null) || // ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
Fi(t)
);
}
function nm(t) {
return !sr(t) || // https://github.com/popperjs/popper-core/issues/837
jr(t).position === "fixed" ? null : t.offsetParent;
}
function w4(t) {
var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, n = navigator.userAgent.indexOf("Trident") !== -1;
if (n && sr(t)) {
var r = jr(t);
if (r.position === "fixed")
return null;
}
for (var i = Bc(t); sr(i) && ["html", "body"].indexOf(Fr(i)) < 0; ) {
var o = jr(i);
if (o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].indexOf(o.willChange) !== -1 || e && o.willChange === "filter" || e && o.filter && o.filter !== "none")
return i;
i = i.parentNode;
}
return null;
}
function pu(t) {
for (var e = Sr(t), n = nm(t); n && y4(n) && jr(n).position === "static"; )
n = nm(n);
return n && (Fr(n) === "html" || Fr(n) === "body" && jr(n).position === "static") ? e : n || w4(t) || e;
}
function fp(t) {
return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
}
function vs(t, e, n) {
return _o(t, Ol(e, n));
}
function k4(t, e, n) {
var r = vs(t, e, n);
return r > n ? n : r;
}
function bv() {
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};
}
function vv(t) {
return Object.assign({}, bv(), t);
}
function yv(t, e) {
return e.reduce(function(n, r) {
return n[r] = t, n;
}, {});
}
var x4 = function(e, n) {
return e = typeof e == "function" ? e(Object.assign({}, n.rects, {
placement: n.placement
})) : e, vv(typeof e != "number" ? e : yv(e, fu));
};
function S4(t) {
var e, n = t.state, r = t.name, i = t.options, o = n.elements.arrow, a = n.modifiersData.popperOffsets, s = Vr(n.placement), u = fp(s), l = [Pn, dr].indexOf(s) >= 0, c = l ? "height" : "width";
if (!(!o || !a)) {
var f = x4(i.padding, n), d = dp(o), p = u === "y" ? Nn : Pn, h = u === "y" ? cr : dr, m = n.rects.reference[c] + n.rects.reference[u] - a[u] - n.rects.popper[c], v = a[u] - n.rects.reference[u], y = pu(o), k = y ? u === "y" ? y.clientHeight || 0 : y.clientWidth || 0 : 0, T = m / 2 - v / 2, b = f[p], D = k - d[c] - f[h], x = k / 2 - d[c] / 2 + T, S = vs(b, x, D), _ = u;
n.modifiersData[r] = (e = {}, e[_] = S, e.centerOffset = S - x, e);
}
}
function E4(t) {
var e = t.state, n = t.options, r = n.element, i = r === void 0 ? "[data-popper-arrow]" : r;
i != null && (typeof i == "string" && (i = e.elements.popper.querySelector(i), !i) || gv(e.elements.popper, i) && (e.elements.arrow = i));
}
var _4 = {
name: "arrow",
enabled: !0,
phase: "main",
fn: S4,
effect: E4,
requires: ["popperOffsets"],
requiresIfExists: ["preventOverflow"]
};
function Ca(t) {
return t.split("-")[1];
}
var T4 = {
top: "auto",
right: "auto",
bottom: "auto",
left: "auto"
};
function C4(t) {
var e = t.x, n = t.y, r = window, i = r.devicePixelRatio || 1;
return {
x: _a(e * i) / i || 0,
y: _a(n * i) / i || 0
};
}
function rm(t) {
var e, n = t.popper, r = t.popperRect, i = t.placement, o = t.variation, a = t.offsets, s = t.position, u = t.gpuAcceleration, l = t.adaptive, c = t.roundOffsets, f = t.isFixed, d = c === !0 ? C4(a) : typeof c == "function" ? c(a) : a, p = d.x, h = p === void 0 ? 0 : p, m = d.y, v = m === void 0 ? 0 : m, y = a.hasOwnProperty("x"), k = a.hasOwnProperty("y"), T = Pn, b = Nn, D = window;
if (l) {
var x = pu(n), S = "clientHeight", _ = "clientWidth";
if (x === Sr(n) && (x = Fi(n), jr(x).position !== "static" && s === "absolute" && (S = "scrollHeight", _ = "scrollWidth")), x = x, i === Nn || (i === Pn || i === dr) && o === Hs) {
b = cr;
var N = f && D.visualViewport ? D.visualViewport.height : (
// $FlowFixMe[prop-missing]
x[S]
);
v -= N - r.height, v *= u ? 1 : -1;
}
if (i === Pn || (i === Nn || i === cr) && o === Hs) {
T = dr;
var R = f && D.visualViewport ? D.visualViewport.width : (
// $FlowFixMe[prop-missing]
x[_]
);
h -= R - r.width, h *= u ? 1 : -1;
}
}
var w = Object.assign({
position: s
}, l && T4);
if (u) {
var A;
return Object.assign({}, w, (A = {}, A[b] = k ? "0" : "", A[T] = y ? "0" : "", A.transform = (D.devicePixelRatio || 1) <= 1 ? "translate(" + h + "px, " + v + "px)" : "translate3d(" + h + "px, " + v + "px, 0)", A));
}
return Object.assign({}, w, (e = {}, e[b] = k ? v + "px" : "", e[T] = y ? h + "px" : "", e.transform = "", e));
}
function O4(t) {
var e = t.state, n = t.options, r = n.gpuAcceleration, i = r === void 0 ? !0 : r, o = n.adaptive, a = o === void 0 ? !0 : o, s = n.roundOffsets, u = s === void 0 ? !0 : s, l = {
placement: Vr(e.placement),
variation: Ca(e.placement),
popper: e.elements.popper,
popperRect: e.rects.popper,
gpuAcceleration: i,
isFixed: e.options.strategy === "fixed"
};
e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, rm(Object.assign({}, l, {
offsets: e.modifiersData.popperOffsets,
position: e.options.strategy,
adaptive: a,
roundOffsets: u
})))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, rm(Object.assign({}, l, {
offsets: e.modifiersData.arrow,
position: "absolute",
adaptive: !1,
roundOffsets: u
})))), e.attributes.popper = Object.assign({}, e.attributes.popper, {
"data-popper-placement": e.placement
});
}
var A4 = {
name: "computeStyles",
enabled: !0,
phase: "beforeWrite",
fn: O4,
data: {}
}, Tu = {
passive: !0
};
function M4(t) {
var e = t.state, n = t.instance, r = t.options, i = r.scroll, o = i === void 0 ? !0 : i, a = r.resize, s = a === void 0 ? !0 : a, u = Sr(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper);
return o && l.forEach(function(c) {
c.addEventListener("scroll", n.update, Tu);
}), s && u.addEventListener("resize", n.update, Tu), function() {
o && l.forEach(function(c) {
c.removeEventListener("scroll", n.update, Tu);
}), s && u.removeEventListener("resize", n.update, Tu);
};
}
var D4 = {
name: "eventListeners",
enabled: !0,
phase: "write",
fn: function() {
},
effect: M4,
data: {}
}, $4 = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function ul(t) {
return t.replace(/left|right|bottom|top/g, function(e) {
return $4[e];
});
}
var N4 = {
start: "end",
end: "start"
};
function im(t) {
return t.replace(/start|end/g, function(e) {
return N4[e];
});
}
function pp(t) {
var e = Sr(t), n = e.pageXOffset, r = e.pageYOffset;
return {
scrollLeft: n,
scrollTop: r
};
}
function hp(t) {
return Ta(Fi(t)).left + pp(t).scrollLeft;
}
function P4(t) {
var e = Sr(t), n = Fi(t), r = e.visualViewport, i = n.clientWidth, o = n.clientHeight, a = 0, s = 0;
return r && (i = r.width, o = r.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a = r.offsetLeft, s = r.offsetTop)), {
width: i,
height: o,
x: a + hp(t),
y: s
};
}
function I4(t) {
var e, n = Fi(t), r = pp(t), i = (e = t.ownerDocument) == null ? void 0 : e.body, o = _o(n.scrollWidth, n.clientWidth, i ? i.scrollWidth : 0, i ? i.clientWidth : 0), a = _o(n.scrollHeight, n.clientHeight, i ? i.scrollHeight : 0, i ? i.clientHeight : 0), s = -r.scrollLeft + hp(t), u = -r.scrollTop;
return jr(i || n).direction === "rtl" && (s += _o(n.clientWidth, i ? i.clientWidth : 0) - o), {
width: o,
height: a,
x: s,
y: u
};
}
function mp(t) {
var e = jr(t), n = e.overflow, r = e.overflowX, i = e.overflowY;
return /auto|scroll|overlay|hidden/.test(n + i + r);
}
function wv(t) {
return ["html", "body", "#document"].indexOf(Fr(t)) >= 0 ? t.ownerDocument.body : sr(t) && mp(t) ? t : wv(Bc(t));
}
function ys(t, e) {
var n;
e === void 0 && (e = []);
var r = wv(t), i = r === ((n = t.ownerDocument) == null ? void 0 : n.body), o = Sr(r), a = i ? [o].concat(o.visualViewport || [], mp(r) ? r : []) : r, s = e.concat(a);
return i ? s : (
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
s.concat(ys(Bc(a)))
);
}
function Lf(t) {
return Object.assign({}, t, {
left: t.x,
top: t.y,
right: t.x + t.width,
bottom: t.y + t.height
});
}
function L4(t) {
var e = Ta(t);
return e.top = e.top + t.clientTop, e.left = e.left + t.clientLeft, e.bottom = e.top + t.clientHeight, e.right = e.left + t.clientWidth, e.width = t.clientWidth, e.height = t.clientHeight, e.x = e.left, e.y = e.top, e;
}
function om(t, e) {
return e === fv ? Lf(P4(t)) : Ea(e) ? L4(e) : Lf(I4(Fi(t)));
}
function R4(t) {
var e = ys(Bc(t)), n = ["absolute", "fixed"].indexOf(jr(t).position) >= 0, r = n && sr(t) ? pu(t) : t;
return Ea(r) ? e.filter(function(i) {
return Ea(i) && gv(i, r) && Fr(i) !== "body" && (n ? jr(i).position !== "static" : !0);
}) : [];
}
function B4(t, e, n) {
var r = e === "clippingParents" ? R4(t) : [].concat(e), i = [].concat(r, [n]), o = i[0], a = i.reduce(function(s, u) {
var l = om(t, u);
return s.top = _o(l.top, s.top), s.right = Ol(l.right, s.right), s.bottom = Ol(l.bottom, s.bottom), s.left = _o(l.left, s.left), s;
}, om(t, o));
return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
}
function kv(t) {
var e = t.reference, n = t.element, r = t.placement, i = r ? Vr(r) : null, o = r ? Ca(r) : null, a = e.x + e.width / 2 - n.width / 2, s = e.y + e.height / 2 - n.height / 2, u;
switch (i) {
case Nn:
u = {
x: a,
y: e.y - n.height
};
break;
case cr:
u = {
x: a,
y: e.y + e.height
};
break;
case dr:
u = {
x: e.x + e.width,
y: s
};
break;
case Pn:
u = {
x: e.x - n.width,
y: s
};
break;
default:
u = {
x: e.x,
y: e.y
};
}
var l = i ? fp(i) : null;
if (l != null) {
var c = l === "y" ? "height" : "width";
switch (o) {
case Sa:
u[l] = u[l] - (e[c] / 2 - n[c] / 2);
break;
case Hs:
u[l] = u[l] + (e[c] / 2 - n[c] / 2);
break;
}
}
return u;
}
function qs(t, e) {
e === void 0 && (e = {});
var n = e, r = n.placement, i = r === void 0 ? t.placement : r, o = n.boundary, a = o === void 0 ? o4 : o, s = n.rootBoundary, u = s === void 0 ? fv : s, l = n.elementContext, c = l === void 0 ? Za : l, f = n.altBoundary, d = f === void 0 ? !1 : f, p = n.padding, h = p === void 0 ? 0 : p, m = vv(typeof h != "number" ? h : yv(h, fu)), v = c === Za ? a4 : Za, y = t.rects.popper, k = t.elements[d ? v : c], T = B4(Ea(k) ? k : k.contextElement || Fi(t.elements.popper), a, u), b = Ta(t.elements.reference), D = kv({
reference: b,
element: y,
strategy: "absolute",
placement: i
}), x = Lf(Object.assign({}, y, D)), S = c === Za ? x : b, _ = {
top: T.top - S.top + m.top,
bottom: S.bottom - T.bottom + m.bottom,
left: T.left - S.left + m.left,
right: S.right - T.right + m.right
}, N = t.modifiersData.offset;
if (c === Za && N) {
var R = N[i];
Object.keys(_).forEach(function(w) {
var A = [dr, cr].indexOf(w) >= 0 ? 1 : -1, $ = [Nn, cr].indexOf(w) >= 0 ? "y" : "x";
_[w] += R[$] * A;
});
}
return _;
}
function V4(t, e) {
e === void 0 && (e = {});
var n = e, r = n.placement, i = n.boundary, o = n.rootBoundary, a = n.padding, s = n.flipVariations, u = n.allowedAutoPlacements, l = u === void 0 ? pv : u, c = Ca(r), f = c ? s ? tm : tm.filter(function(h) {
return Ca(h) === c;
}) : fu, d = f.filter(function(h) {
return l.indexOf(h) >= 0;
});
d.length === 0 && (d = f);
var p = d.reduce(function(h, m) {
return h[m] = qs(t, {
placement: m,
boundary: i,
rootBoundary: o,
padding: a
})[Vr(m)], h;
}, {});
return Object.keys(p).sort(function(h, m) {
return p[h] - p[m];
});
}
function z4(t) {
if (Vr(t) === cp)
return [];
var e = ul(t);
return [im(t), e, im(e)];
}
function H4(t) {
var e = t.state, n = t.options, r = t.name;
if (!e.modifiersData[r]._skip) {
for (var i = n.mainAxis, o = i === void 0 ? !0 : i, a = n.altAxis, s = a === void 0 ? !0 : a, u = n.fallbackPlacements, l = n.padding, c = n.boundary, f = n.rootBoundary, d = n.altBoundary, p = n.flipVariations, h = p === void 0 ? !0 : p, m = n.allowedAutoPlacements, v = e.options.placement, y = Vr(v), k = y === v, T = u || (k || !h ? [ul(v)] : z4(v)), b = [v].concat(T).reduce(function(q, V) {
return q.concat(Vr(V) === cp ? V4(e, {
placement: V,
boundary: c,
rootBoundary: f,
padding: l,
flipVariations: h,
allowedAutoPlacements: m
}) : V);
}, []), D = e.rects.reference, x = e.rects.popper, S = /* @__PURE__ */ new Map(), _ = !0, N = b[0], R = 0; R < b.length; R++) {
var w = b[R], A = Vr(w), $ = Ca(w) === Sa, I = [Nn, cr].indexOf(A) >= 0, E = I ? "width" : "height", O = qs(e, {
placement: w,
boundary: c,
rootBoundary: f,
altBoundary: d,
padding: l
}), g = I ? $ ? dr : Pn : $ ? cr : Nn;
D[E] > x[E] && (g = ul(g));
var M = ul(g), H = [];
if (o && H.push(O[A] <= 0), s && H.push(O[g] <= 0, O[M] <= 0), H.every(function(q) {
return q;
})) {
N = w, _ = !1;
break;
}
S.set(w, H);
}
if (_)
for (var z = h ? 3 : 1, Y = function(V) {
var te = b.find(function(K) {
var Q = S.get(K);
if (Q)
return Q.slice(0, V).every(function(Z) {
return Z;
});
});
if (te)
return N = te, "break";
}, ee = z; ee > 0; ee--) {
var ce = Y(ee);
if (ce === "break")
break;
}
e.placement !== N && (e.modifiersData[r]._skip = !0, e.placement = N, e.reset = !0);
}
}
var q4 = {
name: "flip",
enabled: !0,
phase: "main",
fn: H4,
requiresIfExists: ["offset"],
data: {
_skip: !1
}
};
function am(t, e, n) {
return n === void 0 && (n = {
x: 0,
y: 0
}), {
top: t.top - e.height - n.y,
right: t.right - e.width + n.x,
bottom: t.bottom - e.height + n.y,
left: t.left - e.width - n.x
};
}
function sm(t) {
return [Nn, dr, cr, Pn].some(function(e) {
return t[e] >= 0;
});
}
function F4(t) {
var e = t.state, n = t.name, r = e.rects.reference, i = e.rects.popper, o = e.modifiersData.preventOverflow, a = qs(e, {
elementContext: "reference"
}), s = qs(e, {
altBoundary: !0
}), u = am(a, r), l = am(s, i, o), c = sm(u), f = sm(l);
e.modifiersData[n] = {
referenceClippingOffsets: u,
popperEscapeOffsets: l,
isReferenceHidden: c,
hasPopperEscaped: f
}, e.attributes.popper = Object.assign({}, e.attributes.popper, {
"data-popper-reference-hidden": c,
"data-popper-escaped": f
});
}
var j4 = {
name: "hide",
enabled: !0,
phase: "main",
requiresIfExists: ["preventOverflow"],
fn: F4
};
function U4(t, e, n) {
var r = Vr(t), i = [Pn, Nn].indexOf(r) >= 0 ? -1 : 1, o = typeof n == "function" ? n(Object.assign({}, e, {
placement: t
})) : n, a = o[0], s = o[1];
return a = a || 0, s = (s || 0) * i, [Pn, dr].indexOf(r) >= 0 ? {
x: s,
y: a
} : {
x: a,
y: s
};
}
function W4(t) {
var e = t.state, n = t.options, r = t.name, i = n.offset, o = i === void 0 ? [0, 0] : i, a = pv.reduce(function(c, f) {
return c[f] = U4(f, e.rects, o), c;
}, {}), s = a[e.placement], u = s.x, l = s.y;
e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += u, e.modifiersData.popperOffsets.y += l), e.modifiersData[r] = a;
}
var Y4 = {
name: "offset",
enabled: !0,
phase: "main",
requires: ["popperOffsets"],
fn: W4
};
function K4(t) {
var e = t.state, n = t.name;
e.modifiersData[n] = kv({
reference: e.rects.reference,
element: e.rects.popper,
strategy: "absolute",
placement: e.placement
});
}
var G4 = {
name: "popperOffsets",
enabled: !0,
phase: "read",
fn: K4,
data: {}
};
function J4(t) {
return t === "x" ? "y" : "x";
}
function X4(t) {
var e = t.state, n = t.options, r = t.name, i = n.mainAxis, o = i === void 0 ? !0 : i, a = n.altAxis, s = a === void 0 ? !1 : a, u = n.boundary, l = n.rootBoundary, c = n.altBoundary, f = n.padding, d = n.tether, p = d === void 0 ? !0 : d, h = n.tetherOffset, m = h === void 0 ? 0 : h, v = qs(e, {
boundary: u,
rootBoundary: l,
padding: f,
altBoundary: c
}), y = Vr(e.placement), k = Ca(e.placement), T = !k, b = fp(y), D = J4(b), x = e.modifiersData.popperOffsets, S = e.rects.reference, _ = e.rects.popper, N = typeof m == "function" ? m(Object.assign({}, e.rects, {
placement: e.placement
})) : m, R = typeof N == "number" ? {
mainAxis: N,
altAxis: N
} : Object.assign({
mainAxis: 0,
altAxis: 0
}, N), w = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, A = {
x: 0,
y: 0
};
if (x) {
if (o) {
var $, I = b === "y" ? Nn : Pn, E = b === "y" ? cr : dr, O = b === "y" ? "height" : "width", g = x[b], M = g + v[I], H = g - v[E], z = p ? -_[O] / 2 : 0, Y = k === Sa ? S[O] : _[O], ee = k === Sa ? -_[O] : -S[O], ce = e.elements.arrow, q = p && ce ? dp(ce) : {
width: 0,
height: 0
}, V = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : bv(), te = V[I], K = V[E], Q = vs(0, S[O], q[O]), Z = T ? S[O] / 2 - z - Q - te - R.mainAxis : Y - Q - te - R.mainAxis, ae = T ? -S[O] / 2 + z + Q + K + R.mainAxis : ee + Q + K + R.mainAxis, ke = e.elements.arrow && pu(e.elements.arrow), ge = ke ? b === "y" ? ke.clientTop || 0 : ke.clientLeft || 0 : 0, de = ($ = w == null ? void 0 : w[b]) != null ? $ : 0, ye = g + Z - de - ge, xe = g + ae - de, ct = vs(p ? Ol(M, ye) : M, g, p ? _o(H, xe) : H);
x[b] = ct, A[b] = ct - g;
}
if (s) {
var le, je = b === "x" ? Nn : Pn, We = b === "x" ? cr : dr, Ke = x[D], ot = D === "y" ? "height" : "width", Rt = Ke + v[je], xt = Ke - v[We], qt = [Nn, Pn].indexOf(y) !== -1, Ut = (le = w == null ? void 0 : w[D]) != null ? le : 0, Hn = qt ? Rt : Ke - S[ot] - _[ot] - Ut + R.altAxis, qn = qt ? Ke + S[ot] + _[ot] - Ut - R.altAxis : xt, An = p && qt ? k4(Hn, Ke, qn) : vs(p ? Hn : Rt, Ke, p ? qn : xt);
x[D] = An, A[D] = An - Ke;
}
e.modifiersData[r] = A;
}
}
var Q4 = {
name: "preventOverflow",
enabled: !0,
phase: "main",
fn: X4,
requiresIfExists: ["offset"]
};
function Z4(t) {
return {
scrollLeft: t.scrollLeft,
scrollTop: t.scrollTop
};
}
function ek(t) {
return t === Sr(t) || !sr(t) ? pp(t) : Z4(t);
}
function tk(t) {
var e = t.getBoundingClientRect(), n = _a(e.width) / t.offsetWidth || 1, r = _a(e.height) / t.offsetHeight || 1;
return n !== 1 || r !== 1;
}
function nk(t, e, n) {
n === void 0 && (n = !1);
var r = sr(e), i = sr(e) && tk(e), o = Fi(e), a = Ta(t, i), s = {
scrollLeft: 0,
scrollTop: 0
}, u = {
x: 0,
y: 0
};
return (r || !r && !n) && ((Fr(e) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
mp(o)) && (s = ek(e)), sr(e) ? (u = Ta(e, !0), u.x += e.clientLeft, u.y += e.clientTop) : o && (u.x = hp(o))), {
x: a.left + s.scrollLeft - u.x,
y: a.top + s.scrollTop - u.y,
width: a.width,
height: a.height
};
}
function rk(t) {
var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = [];
t.forEach(function(o) {
e.set(o.name, o);
});
function i(o) {
n.add(o.name);
var a = [].concat(o.requires || [], o.requiresIfExists || []);
a.forEach(function(s) {
if (!n.has(s)) {
var u = e.get(s);
u && i(u);
}
}), r.push(o);
}
return t.forEach(function(o) {
n.has(o.name) || i(o);
}), r;
}
function ik(t) {
var e = rk(t);
return g4.reduce(function(n, r) {
return n.concat(e.filter(function(i) {
return i.phase === r;
}));
}, []);
}
function ok(t) {
var e;
return function() {
return e || (e = new Promise(function(n) {
Promise.resolve().then(function() {
e = void 0, n(t());
});
})), e;
};
}
function ak(t) {
var e = t.reduce(function(n, r) {
var i = n[r.name];
return n[r.name] = i ? Object.assign({}, i, r, {
options: Object.assign({}, i.options, r.options),
data: Object.assign({}, i.data, r.data)
}) : r, n;
}, {});
return Object.keys(e).map(function(n) {
return e[n];
});
}
var um = {
placement: "bottom",
modifiers: [],
strategy: "absolute"
};
function lm() {
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
e[n] = arguments[n];
return !e.some(function(r) {
return !(r && typeof r.getBoundingClientRect == "function");
});
}
function sk(t) {
t === void 0 && (t = {});
var e = t, n = e.defaultModifiers, r = n === void 0 ? [] : n, i = e.defaultOptions, o = i === void 0 ? um : i;
return function(s, u, l) {
l === void 0 && (l = o);
var c = {
placement: "bottom",
orderedModifiers: [],
options: Object.assign({}, um, o),
modifiersData: {},
elements: {
reference: s,
popper: u
},
attributes: {},
styles: {}
}, f = [], d = !1, p = {
state: c,
setOptions: function(y) {
var k = typeof y == "function" ? y(c.options) : y;
m(), c.options = Object.assign({}, o, c.options, k), c.scrollParents = {
reference: Ea(s) ? ys(s) : s.contextElement ? ys(s.contextElement) : [],
popper: ys(u)
};
var T = ik(ak([].concat(r, c.options.modifiers)));
return c.orderedModifiers = T.filter(function(b) {
return b.enabled;
}), h(), p.update();
},
// Sync update – it will always be executed, even if not necessary. This
// is useful for low frequency updates where sync behavior simplifies the
// logic.
// For high frequency updates (e.g. `resize` and `scroll` events), always
// prefer the async Popper#update method
forceUpdate: function() {
if (!d) {
var y = c.elements, k = y.reference, T = y.popper;
if (lm(k, T)) {
c.rects = {
reference: nk(k, pu(T), c.options.strategy === "fixed"),
popper: dp(T)
}, c.reset = !1, c.placement = c.options.placement, c.orderedModifiers.forEach(function(R) {
return c.modifiersData[R.name] = Object.assign({}, R.data);
});
for (var b = 0; b < c.orderedModifiers.length; b++) {
if (c.reset === !0) {
c.reset = !1, b = -1;
continue;
}
var D = c.orderedModifiers[b], x = D.fn, S = D.options, _ = S === void 0 ? {} : S, N = D.name;
typeof x == "function" && (c = x({
state: c,
options: _,
name: N,
instance: p
}) || c);
}
}
}
},
// Async and optimistically optimized update – it will not be executed if
// not necessary (debounced to run at most once-per-tick)
update: ok(function() {
return new Promise(function(v) {
p.forceUpdate(), v(c);
});
}),
destroy: function() {
m(), d = !0;
}
};
if (!lm(s, u))
return p;
p.setOptions(l).then(function(v) {
!d && l.onFirstUpdate && l.onFirstUpdate(v);
});
function h() {
c.orderedModifiers.forEach(function(v) {
var y = v.name, k = v.options, T = k === void 0 ? {} : k, b = v.effect;
if (typeof b == "function") {
var D = b({
state: c,
name: y,
instance: p,
options: T
}), x = function() {
};
f.push(D || x);
}
});
}
function m() {
f.forEach(function(v) {
return v();
}), f = [];
}
return p;
};
}
var uk = [D4, G4, A4, mv, Y4, q4, Q4, _4, j4], lk = /* @__PURE__ */ sk({
defaultModifiers: uk
}), ck = "tippy-box", xv = "tippy-content", Sv = "tippy-backdrop", Ev = "tippy-arrow", _v = "tippy-svg-arrow", oo = {
passive: !0,
capture: !0
}, Tv = function() {
return document.body;
};
function _d(t, e, n) {
if (Array.isArray(t)) {
var r = t[e];
return r ?? (Array.isArray(n) ? n[e] : n);
}
return t;
}
function gp(t, e) {
var n = {}.toString.call(t);
return n.indexOf("[object") === 0 && n.indexOf(e + "]") > -1;
}
function Cv(t, e) {
return typeof t == "function" ? t.apply(void 0, e) : t;
}
function cm(t, e) {
if (e === 0)
return t;
var n;
return function(r) {
clearTimeout(n), n = setTimeout(function() {
t(r);
}, e);
};
}
function dk(t, e) {
var n = Object.assign({}, t);
return e.forEach(function(r) {
delete n[r];
}), n;
}
function fk(t) {
return t.split(/\s+/).filter(Boolean);
}
function co(t) {
return [].concat(t);
}
function dm(t, e) {
t.indexOf(e) === -1 && t.push(e);
}
function pk(t) {
return t.filter(function(e, n) {
return t.indexOf(e) === n;
});
}
function Ov(t) {
return t.split("-")[0];
}
function Oa(t) {
return [].slice.call(t);
}
function fm(t) {
return Object.keys(t).reduce(function(e, n) {
return t[n] !== void 0 && (e[n] = t[n]), e;
}, {});
}
function To() {
return document.createElement("div");
}
function Vc(t) {
return ["Element", "Fragment"].some(function(e) {
return gp(t, e);
});
}
function hk(t) {
return gp(t, "NodeList");
}
function bp(t) {
return gp(t, "MouseEvent");
}
function mk(t) {
return !!(t && t._tippy && t._tippy.reference === t);
}
function gk(t) {
return Vc(t) ? [t] : hk(t) ? Oa(t) : Array.isArray(t) ? t : Oa(document.querySelectorAll(t));
}
function Td(t, e) {
t.forEach(function(n) {
n && (n.style.transitionDuration = e + "ms");
});
}
function Fs(t, e) {
t.forEach(function(n) {
n && n.setAttribute("data-state", e);
});
}
function Av(t) {
var e, n = co(t), r = n[0];
return r != null && (e = r.ownerDocument) != null && e.body ? r.ownerDocument : document;
}
function bk(t, e) {
var n = e.clientX, r = e.clientY;
return t.every(function(i) {
var o = i.popperRect, a = i.popperState, s = i.props, u = s.interactiveBorder, l = Ov(a.placement), c = a.modifiersData.offset;
if (!c)
return !0;
var f = l === "bottom" ? c.top.y : 0, d = l === "top" ? c.bottom.y : 0, p = l === "right" ? c.left.x : 0, h = l === "left" ? c.right.x : 0, m = o.top - r + f > u, v = r - o.bottom - d > u, y = o.left - n + p > u, k = n - o.right - h > u;
return m || v || y || k;
});
}
function Cd(t, e, n) {
var r = e + "EventListener";
["transitionend", "webkitTransitionEnd"].forEach(function(i) {
t[r](i, n);
});
}
function pm(t, e) {
for (var n = e; n; ) {
var r;
if (t.contains(n))
return !0;
n = n.getRootNode == null || (r = n.getRootNode()) == null ? void 0 : r.host;
}
return !1;
}
var Mr = {
isTouch: !1
}, hm = 0;
function vk() {
Mr.isTouch || (Mr.isTouch = !0, window.performance && document.addEventListener("mousemove", Mv));
}
function Mv() {
var t = performance.now();
t - hm < 20 && (Mr.isTouch = !1, document.removeEventListener("mousemove", Mv)), hm = t;
}
function yk() {
var t = document.activeElement;
if (mk(t)) {
var e = t._tippy;
t.blur && !e.state.isVisible && t.blur();
}
}
function wk() {
document.addEventListener("touchstart", vk, oo), window.addEventListener("blur", yk);
}
var kk = typeof window < "u" && typeof document < "u", xk = kk ? (
// @ts-ignore
!!window.msCrypto
) : !1, Sk = {
animateFill: !1,
followCursor: !1,
inlinePositioning: !1,
sticky: !1
}, Ek = {
allowHTML: !1,
animation: "fade",
arrow: !0,
content: "",
inertia: !1,
maxWidth: 350,
role: "tooltip",
theme: "",
zIndex: 9999
}, yr = Object.assign({
appendTo: Tv,
aria: {
content: "auto",
expanded: "auto"
},
delay: 0,
duration: [300, 250],
getReferenceClientRect: null,
hideOnClick: !0,
ignoreAttributes: !1,
interactive: !1,
interactiveBorder: 2,
interactiveDebounce: 0,
moveTransition: "",
offset: [0, 10],
onAfterUpdate: function() {
},
onBeforeUpdate: function() {
},
onCreate: function() {
},
onDestroy: function() {
},
onHidden: function() {
},
onHide: function() {
},
onMount: function() {
},
onShow: function() {
},
onShown: function() {
},
onTrigger: function() {
},
onUntrigger: function() {
},
onClickOutside: function() {
},
placement: "top",
plugins: [],
popperOptions: {},
render: null,
showOnCreate: !1,
touch: !0,
trigger: "mouseenter focus",
triggerTarget: null
}, Sk, Ek), _k = Object.keys(yr), Tk = function(e) {
var n = Object.keys(e);
n.forEach(function(r) {
yr[r] = e[r];
});
};
function Dv(t) {
var e = t.plugins || [], n = e.reduce(function(r, i) {
var o = i.name, a = i.defaultValue;
if (o) {
var s;
r[o] = t[o] !== void 0 ? t[o] : (s = yr[o]) != null ? s : a;
}
return r;
}, {});
return Object.assign({}, t, n);
}
function Ck(t, e) {
var n = e ? Object.keys(Dv(Object.assign({}, yr, {
plugins: e
}))) : _k, r = n.reduce(function(i, o) {
var a = (t.getAttribute("data-tippy-" + o) || "").trim();
if (!a)
return i;
if (o === "content")
i[o] = a;
else
try {
i[o] = JSON.parse(a);
} catch {
i[o] = a;
}
return i;
}, {});
return r;
}
function mm(t, e) {
var n = Object.assign({}, e, {
content: Cv(e.content, [t])
}, e.ignoreAttributes ? {} : Ck(t, e.plugins));
return n.aria = Object.assign({}, yr.aria, n.aria), n.aria = {
expanded: n.aria.expanded === "auto" ? e.interactive : n.aria.expanded,
content: n.aria.content === "auto" ? e.interactive ? null : "describedby" : n.aria.content
}, n;
}
var Ok = function() {
return "innerHTML";
};
function Rf(t, e) {
t[Ok()] = e;
}
function gm(t) {
var e = To();
return t === !0 ? e.className = Ev : (e.className = _v, Vc(t) ? e.appendChild(t) : Rf(e, t)), e;
}
function bm(t, e) {
Vc(e.content) ? (Rf(t, ""), t.appendChild(e.content)) : typeof e.content != "function" && (e.allowHTML ? Rf(t, e.content) : t.textContent = e.content);
}
function Al(t) {
var e = t.firstElementChild, n = Oa(e.children);
return {
box: e,
content: n.find(function(r) {
return r.classList.contains(xv);
}),
arrow: n.find(function(r) {
return r.classList.contains(Ev) || r.classList.contains(_v);
}),
backdrop: n.find(function(r) {
return r.classList.contains(Sv);
})
};
}
function $v(t) {
var e = To(), n = To();
n.className = ck, n.setAttribute("data-state", "hidden"), n.setAttribute("tabindex", "-1");
var r = To();
r.className = xv, r.setAttribute("data-state", "hidden"), bm(r, t.props), e.appendChild(n), n.appendChild(r), i(t.props, t.props);
function i(o, a) {
var s = Al(e), u = s.box, l = s.content, c = s.arrow;
a.theme ? u.setAttribute("data-theme", a.theme) : u.removeAttribute("data-theme"), typeof a.animation == "string" ? u.setAttribute("data-animation", a.animation) : u.removeAttribute("data-animation"), a.inertia ? u.setAttribute("data-inertia", "") : u.removeAttribute("data-inertia"), u.style.maxWidth = typeof a.maxWidth == "number" ? a.maxWidth + "px" : a.maxWidth, a.role ? u.setAttribute("role", a.role) : u.removeAttribute("role"), (o.content !== a.content || o.allowHTML !== a.allowHTML) && bm(l, t.props), a.arrow ? c ? o.arrow !== a.arrow && (u.removeChild(c), u.appendChild(gm(a.arrow))) : u.appendChild(gm(a.arrow)) : c && u.removeChild(c);
}
return {
popper: e,
onUpdate: i
};
}
$v.$$tippy = !0;
var Ak = 1, Cu = [], Od = [];
function Mk(t, e) {
var n = mm(t, Object.assign({}, yr, Dv(fm(e)))), r, i, o, a = !1, s = !1, u = !1, l = !1, c, f, d, p = [], h = cm(ye, n.interactiveDebounce), m, v = Ak++, y = null, k = pk(n.plugins), T = {
// Is the instance currently enabled?
isEnabled: !0,
// Is the tippy currently showing and not transitioning out?
isVisible: !1,
// Has the instance been destroyed?
isDestroyed: !1,
// Is the tippy currently mounted to the DOM?
isMounted: !1,
// Has the tippy finished transitioning in?
isShown: !1
}, b = {
// properties
id: v,
reference: t,
popper: To(),
popperInstance: y,
props: n,
state: T,
plugins: k,
// methods
clearDelayTimeouts: Hn,
setProps: qn,
setContent: An,
show: G,
hide: fe,
hideWithInteractivity: Ne,
enable: qt,
disable: Ut,
unmount: Be,
destroy: ht
};
if (!n.render)
return b;
var D = n.render(b), x = D.popper, S = D.onUpdate;
x.setAttribute("data-tippy-root", ""), x.id = "tippy-" + b.id, b.popper = x, t._tippy = b, x._tippy = b;
var _ = k.map(function(B) {
return B.fn(b);
}), N = t.hasAttribute("aria-expanded");
return ke(), z(), g(), M("onCreate", [b]), n.showOnCreate && Rt(), x.addEventListener("mouseenter", function() {
b.props.interactive && b.state.isVisible && b.clearDelayTimeouts();
}), x.addEventListener("mouseleave", function() {
b.props.interactive && b.props.trigger.indexOf("mouseenter") >= 0 && I().addEventListener("mousemove", h);
}), b;
function R() {
var B = b.props.touch;
return Array.isArray(B) ? B : [B, 0];
}
function w() {
return R()[0] === "hold";
}
function A() {
var B;
return !!((B = b.props.render) != null && B.$$tippy);
}
function $() {
return m || t;
}
function I() {
var B = $().parentNode;
return B ? Av(B) : document;
}
function E() {
return Al(x);
}
function O(B) {
return b.state.isMounted && !b.state.isVisible || Mr.isTouch || c && c.type === "focus" ? 0 : _d(b.props.delay, B ? 0 : 1, yr.delay);
}
function g(B) {
B === void 0 && (B = !1), x.style.pointerEvents = b.props.interactive && !B ? "" : "none", x.style.zIndex = "" + b.props.zIndex;
}
function M(B, ie, j) {
if (j === void 0 && (j = !0), _.forEach(function(we) {
we[B] && we[B].apply(we, ie);
}), j) {
var ue;
(ue = b.props)[B].apply(ue, ie);
}
}
function H() {
var B = b.props.aria;
if (B.content) {
var ie = "aria-" + B.content, j = x.id, ue = co(b.props.triggerTarget || t);
ue.forEach(function(we) {
var Ue = we.getAttribute(ie);
if (b.state.isVisible)
we.setAttribute(ie, Ue ? Ue + " " + j : j);
else {
var mt = Ue && Ue.replace(j, "").trim();
mt ? we.setAttribute(ie, mt) : we.removeAttribute(ie);
}
});
}
}
function z() {
if (!(N || !b.props.aria.expanded)) {
var B = co(b.props.triggerTarget || t);
B.forEach(function(ie) {
b.props.interactive ? ie.setAttribute("aria-expanded", b.state.isVisible && ie === $() ? "true" : "false") : ie.removeAttribute("aria-expanded");
});
}
}
function Y() {
I().removeEventListener("mousemove", h), Cu = Cu.filter(function(B) {
return B !== h;
});
}
function ee(B) {
if (!(Mr.isTouch && (u || B.type === "mousedown"))) {
var ie = B.composedPath && B.composedPath()[0] || B.target;
if (!(b.props.interactive && pm(x, ie))) {
if (co(b.props.triggerTarget || t).some(function(j) {
return pm(j, ie);
})) {
if (Mr.isTouch || b.state.isVisible && b.props.trigger.indexOf("click") >= 0)
return;
} else
M("onClickOutside", [b, B]);
b.props.hideOnClick === !0 && (b.clearDelayTimeouts(), b.hide(), s = !0, setTimeout(function() {
s = !1;
}), b.state.isMounted || te());
}
}
}
function ce() {
u = !0;
}
function q() {
u = !1;
}
function V() {
var B = I();
B.addEventListener("mousedown", ee, !0), B.addEventListener("touchend", ee, oo), B.addEventListener("touchstart", q, oo), B.addEventListener("touchmove", ce, oo);
}
function te() {
var B = I();
B.removeEventListener("mousedown", ee, !0), B.removeEventListener("touchend", ee, oo), B.removeEventListener("touchstart", q, oo), B.removeEventListener("touchmove", ce, oo);
}
function K(B, ie) {
Z(B, function() {
!b.state.isVisible && x.parentNode && x.parentNode.contains(x) && ie();
});
}
function Q(B, ie) {
Z(B, ie);
}
function Z(B, ie) {
var j = E().box;
function ue(we) {
we.target === j && (Cd(j, "remove", ue), ie());
}
if (B === 0)
return ie();
Cd(j, "remove", f), Cd(j, "add", ue), f = ue;
}
function ae(B, ie, j) {
j === void 0 && (j = !1);
var ue = co(b.props.triggerTarget || t);
ue.forEach(function(we) {
we.addEventListener(B, ie, j), p.push({
node: we,
eventType: B,
handler: ie,
options: j
});
});
}
function ke() {
w() && (ae("touchstart", de, {
passive: !0
}), ae("touchend", xe, {
passive: !0
})), fk(b.props.trigger).forEach(function(B) {
if (B !== "manual")
switch (ae(B, de), B) {
case "mouseenter":
ae("mouseleave", xe);
break;
case "focus":
ae(xk ? "focusout" : "blur", ct);
break;
case "focusin":
ae("focusout", ct);
break;
}
});
}
function ge() {
p.forEach(function(B) {
var ie = B.node, j = B.eventType, ue = B.handler, we = B.options;
ie.removeEventListener(j, ue, we);
}), p = [];
}
function de(B) {
var ie, j = !1;
if (!(!b.state.isEnabled || le(B) || s)) {
var ue = ((ie = c) == null ? void 0 : ie.type) === "focus";
c = B, m = B.currentTarget, z(), !b.state.isVisible && bp(B) && Cu.forEach(function(we) {
return we(B);
}), B.type === "click" && (b.props.trigger.indexOf("mouseenter") < 0 || a) && b.props.hideOnClick !== !1 && b.state.isVisible ? j = !0 : Rt(B), B.type === "click" && (a = !j), j && !ue && xt(B);
}
}
function ye(B) {
var ie = B.target, j = $().contains(ie) || x.contains(ie);
if (!(B.type === "mousemove" && j)) {
var ue = ot().concat(x).map(function(we) {
var Ue, mt = we._tippy, Ae = (Ue = mt.popperInstance) == null ? void 0 : Ue.state;
return Ae ? {
popperRect: we.getBoundingClientRect(),
popperState: Ae,
props: n
} : null;
}).filter(Boolean);
bk(ue, B) && (Y(), xt(B));
}
}
function xe(B) {
var ie = le(B) || b.props.trigger.indexOf("click") >= 0 && a;
if (!ie) {
if (b.props.interactive) {
b.hideWithInteractivity(B);
return;
}
xt(B);
}
}
function ct(B) {
b.props.trigger.indexOf("focusin") < 0 && B.target !== $() || b.props.interactive && B.relatedTarget && x.contains(B.relatedTarget) || xt(B);
}
function le(B) {
return Mr.isTouch ? w() !== B.type.indexOf("touch") >= 0 : !1;
}
function je() {
We();
var B = b.props, ie = B.popperOptions, j = B.placement, ue = B.offset, we = B.getReferenceClientRect, Ue = B.moveTransition, mt = A() ? Al(x).arrow : null, Ae = we ? {
getBoundingClientRect: we,
contextElement: we.contextElement || $()
} : t, tr = {
name: "$$tippy",
enabled: !0,
phase: "beforeWrite",
requires: ["computeStyles"],
fn: function(Fn) {
var jn = Fn.state;
if (A()) {
var Sd = E(), eo = Sd.box;
["placement", "reference-hidden", "escaped"].forEach(function(Qr) {
Qr === "placement" ? eo.setAttribute("data-placement", jn.placement) : jn.attributes.popper["data-popper-" + Qr] ? eo.setAttribute("data-" + Qr, "") : eo.removeAttribute("data-" + Qr);
}), jn.attributes.popper = {};
}
}
}, ze = [{
name: "offset",
options: {
offset: ue
}
}, {
name: "preventOverflow",
options: {
padding: {
top: 2,
bottom: 2,
left: 5,
right: 5
}
}
}, {
name: "flip",
options: {
padding: 5
}
}, {
name: "computeStyles",
options: {
adaptive: !Ue
}
}, tr];
A() && mt && ze.push({
name: "arrow",
options: {
element: mt,
padding: 3
}
}), ze.push.apply(ze, (ie == null ? void 0 : ie.modifiers) || []), b.popperInstance = lk(Ae, x, Object.assign({}, ie, {
placement: j,
onFirstUpdate: d,
modifiers: ze
}));
}
function We() {
b.popperInstance && (b.popperInstance.destroy(), b.popperInstance = null);
}
function Ke() {
var B = b.props.appendTo, ie, j = $();
b.props.interactive && B === Tv || B === "parent" ? ie = j.parentNode : ie = Cv(B, [j]), ie.contains(x) || ie.appendChild(x), b.state.isMounted = !0, je();
}
function ot() {
return Oa(x.querySelectorAll("[data-tippy-root]"));
}
function Rt(B) {
b.clearDelayTimeouts(), B && M("onTrigger", [b, B]), V();
var ie = O(!0), j = R(), ue = j[0], we = j[1];
Mr.isTouch && ue === "hold" && we && (ie = we), ie ? r = setTimeout(function() {
b.show();
}, ie) : b.show();
}
function xt(B) {
if (b.clearDelayTimeouts(), M("onUntrigger", [b, B]), !b.state.isVisible) {
te();
return;
}
if (!(b.props.trigger.indexOf("mouseenter") >= 0 && b.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(B.type) >= 0 && a)) {
var ie = O(!1);
ie ? i = setTimeout(function() {
b.state.isVisible && b.hide();
}, ie) : o = requestAnimationFrame(function() {
b.hide();
});
}
}
function qt() {
b.state.isEnabled = !0;
}
function Ut() {
b.hide(), b.state.isEnabled = !1;
}
function Hn() {
clearTimeout(r), clearTimeout(i), cancelAnimationFrame(o);
}
function qn(B) {
if (!b.state.isDestroyed) {
M("onBeforeUpdate", [b, B]), ge();
var ie = b.props, j = mm(t, Object.assign({}, ie, fm(B), {
ignoreAttributes: !0
}));
b.props = j, ke(), ie.interactiveDebounce !== j.interactiveDebounce && (Y(), h = cm(ye, j.interactiveDebounce)), ie.triggerTarget && !j.triggerTarget ? co(ie.triggerTarget).forEach(function(ue) {
ue.removeAttribute("aria-expanded");
}) : j.triggerTarget && t.removeAttribute("aria-expanded"), z(), g(), S && S(ie, j), b.popperInstance && (je(), ot().forEach(function(ue) {
requestAnimationFrame(ue._tippy.popperInstance.forceUpdate);
})), M("onAfterUpdate", [b, B]);
}
}
function An(B) {
b.setProps({
content: B
});
}
function G() {
var B = b.state.isVisible, ie = b.state.isDestroyed, j = !b.state.isEnabled, ue = Mr.isTouch && !b.props.touch, we = _d(b.props.duration, 0, yr.duration);
if (!(B || ie || j || ue) && !$().hasAttribute("disabled") && (M("onShow", [b], !1), b.props.onShow(b) !== !1)) {
if (b.state.isVisible = !0, A() && (x.style.visibility = "visible"), g(), V(), b.state.isMounted || (x.style.transition = "none"), A()) {
var Ue = E(), mt = Ue.box, Ae = Ue.content;
Td([mt, Ae], 0);
}
d = function() {
var ze;
if (!(!b.state.isVisible || l)) {
if (l = !0, x.offsetHeight, x.style.transition = b.props.moveTransition, A() && b.props.animation) {
var Xr = E(), Fn = Xr.box, jn = Xr.content;
Td([Fn, jn], we), Fs([Fn, jn], "visible");
}
H(), z(), dm(Od, b), (ze = b.popperInstance) == null || ze.forceUpdate(), M("onMount", [b]), b.props.animation && A() && Q(we, function() {
b.state.isShown = !0, M("onShown", [b]);
});
}
}, Ke();
}
}
function fe() {
var B = !b.state.isVisible, ie = b.state.isDestroyed, j = !b.state.isEnabled, ue = _d(b.props.duration, 1, yr.duration);
if (!(B || ie || j) && (M("onHide", [b], !1), b.props.onHide(b) !== !1)) {
if (b.state.isVisible = !1, b.state.isShown = !1, l = !1, a = !1, A() && (x.style.visibility = "hidden"), Y(), te(), g(!0), A()) {
var we = E(), Ue = we.box, mt = we.content;
b.props.animation && (Td([Ue, mt], ue), Fs([Ue, mt], "hidden"));
}
H(), z(), b.props.animation ? A() && K(ue, b.unmount) : b.unmount();
}
}
function Ne(B) {
I().addEventListener("mousemove", h), dm(Cu, h), h(B);
}
function Be() {
b.state.isVisible && b.hide(), b.state.isMounted && (We(), ot().forEach(function(B) {
B._tippy.unmount();
}), x.parentNode && x.parentNode.removeChild(x), Od = Od.filter(function(B) {
return B !== b;
}), b.state.isMounted = !1, M("onHidden", [b]));
}
function ht() {
b.state.isDestroyed || (b.clearDelayTimeouts(), b.unmount(), ge(), delete t._tippy, b.state.isDestroyed = !0, M("onDestroy", [b]));
}
}
function Ie(t, e) {
e === void 0 && (e = {});
var n = yr.plugins.concat(e.plugins || []);
wk();
var r = Object.assign({}, e, {
plugins: n
}), i = gk(t), o = i.reduce(function(a, s) {
var u = s && Mk(s, r);
return u && a.push(u), a;
}, []);
return Vc(t) ? o[0] : o;
}
Ie.defaultProps = yr;
Ie.setDefaultProps = Tk;
Ie.currentInput = Mr;
var Dk = Object.assign({}, mv, {
effect: function(e) {
var n = e.state, r = {
popper: {
position: n.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
Object.assign(n.elements.popper.style, r.popper), n.styles = r, n.elements.arrow && Object.assign(n.elements.arrow.style, r.arrow);
}
}), $k = function(e, n) {
var r;
n === void 0 && (n = {});
var i = e, o = [], a = [], s, u = n.overrides, l = [], c = !1;
function f() {
a = i.map(function(b) {
return co(b.props.triggerTarget || b.reference);
}).reduce(function(b, D) {
return b.concat(D);
}, []);
}
function d() {
o = i.map(function(b) {
return b.reference;
});
}
function p(b) {
i.forEach(function(D) {
b ? D.enable() : D.disable();
});
}
function h(b) {
return i.map(function(D) {
var x = D.setProps;
return D.setProps = function(S) {
x(S), D.reference === s && b.setProps(S);
}, function() {
D.setProps = x;
};
});
}
function m(b, D) {
var x = a.indexOf(D);
if (D !== s) {
s = D;
var S = (u || []).concat("content").reduce(function(_, N) {
return _[N] = i[x].props[N], _;
}, {});
b.setProps(Object.assign({}, S, {
getReferenceClientRect: typeof S.getReferenceClientRect == "function" ? S.getReferenceClientRect : function() {
var _;
return (_ = o[x]) == null ? void 0 : _.getBoundingClientRect();
}
}));
}
}
p(!1), d(), f();
var v = {
fn: function() {
return {
onDestroy: function() {
p(!0);
},
onHidden: function() {
s = null;
},
onClickOutside: function(x) {
x.props.showOnCreate && !c && (c = !0, s = null);
},
onShow: function(x) {
x.props.showOnCreate && !c && (c = !0, m(x, o[0]));
},
onTrigger: function(x, S) {
m(x, S.currentTarget);
}
};
}
}, y = Ie(To(), Object.assign({}, dk(n, ["overrides"]), {
plugins: [v].concat(n.plugins || []),
triggerTarget: a,
popperOptions: Object.assign({}, n.popperOptions, {
modifiers: [].concat(((r = n.popperOptions) == null ? void 0 : r.modifiers) || [], [Dk])
})
})), k = y.show;
y.show = function(b) {
if (k(), !s && b == null)
return m(y, o[0]);
if (!(s && b == null)) {
if (typeof b == "number")
return o[b] && m(y, o[b]);
if (i.indexOf(b) >= 0) {
var D = b.reference;
return m(y, D);
}
if (o.indexOf(b) >= 0)
return m(y, b);
}
}, y.showNext = function() {
var b = o[0];
if (!s)
return y.show(0);
var D = o.indexOf(s);
y.show(o[D + 1] || b);
}, y.showPrevious = function() {
var b = o[o.length - 1];
if (!s)
return y.show(b);
var D = o.indexOf(s), x = o[D - 1] || b;
y.show(x);
};
var T = y.setProps;
return y.setProps = function(b) {
u = b.overrides || u, T(b);
}, y.setInstances = function(b) {
p(!0), l.forEach(function(D) {
return D();
}), i = b, p(!1), d(), f(), l = h(y), y.setProps({
triggerTarget: a
});
}, l = h(y), y;
}, Nk = {
name: "animateFill",
defaultValue: !1,
fn: function(e) {
var n;
if (!((n = e.props.render) != null && n.$$tippy))
return {};
var r = Al(e.popper), i = r.box, o = r.content, a = e.props.animateFill ? Pk() : null;
return {
onCreate: function() {
a && (i.insertBefore(a, i.firstElementChild), i.setAttribute("data-animatefill", ""), i.style.overflow = "hidden", e.setProps({
arrow: !1,
animation: "shift-away"
}));
},
onMount: function() {
if (a) {
var u = i.style.transitionDuration, l = Number(u.replace("ms", ""));
o.style.transitionDelay = Math.round(l / 10) + "ms", a.style.transitionDuration = u, Fs([a], "visible");
}
},
onShow: function() {
a && (a.style.transitionDuration = "0ms");
},
onHide: function() {
a && Fs([a], "hidden");
}
};
}
};
function Pk() {
var t = To();
return t.className = Sv, Fs([t], "hidden"), t;
}
var Bf = {
clientX: 0,
clientY: 0
}, Ou = [];
function Nv(t) {
var e = t.clientX, n = t.clientY;
Bf = {
clientX: e,
clientY: n
};
}
function Ik(t) {
t.addEventListener("mousemove", Nv);
}
function Lk(t) {
t.removeEventListener("mousemove", Nv);
}
var Rk = {
name: "followCursor",
defaultValue: !1,
fn: function(e) {
var n = e.reference, r = Av(e.props.triggerTarget || n), i = !1, o = !1, a = !0, s = e.props;
function u() {
return e.props.followCursor === "initial" && e.state.isVisible;
}
function l() {
r.addEventListener("mousemove", d);
}
function c() {
r.removeEventListener("mousemove", d);
}
function f() {
i = !0, e.setProps({
getReferenceClientRect: null
}), i = !1;
}
function d(m) {
var v = m.target ? n.contains(m.target) : !0, y = e.props.followCursor, k = m.clientX, T = m.clientY, b = n.getBoundingClientRect(), D = k - b.left, x = T - b.top;
(v || !e.props.interactive) && e.setProps({
// @ts-ignore - unneeded DOMRect properties
getReferenceClientRect: function() {
var _ = n.getBoundingClientRect(), N = k, R = T;
y === "initial" && (N = _.left + D, R = _.top + x);
var w = y === "horizontal" ? _.top : R, A = y === "vertical" ? _.right : N, $ = y === "horizontal" ? _.bottom : R, I = y === "vertical" ? _.left : N;
return {
width: A - I,
height: $ - w,
top: w,
right: A,
bottom: $,
left: I
};
}
});
}
function p() {
e.props.followCursor && (Ou.push({
instance: e,
doc: r
}), Ik(r));
}
function h() {
Ou = Ou.filter(function(m) {
return m.instance !== e;
}), Ou.filter(function(m) {
return m.doc === r;
}).length === 0 && Lk(r);
}
return {
onCreate: p,
onDestroy: h,
onBeforeUpdate: function() {
s = e.props;
},
onAfterUpdate: function(v, y) {
var k = y.followCursor;
i || k !== void 0 && s.followCursor !== k && (h(), k ? (p(), e.state.isMounted && !o && !u() && l()) : (c(), f()));
},
onMount: function() {
e.props.followCursor && !o && (a && (d(Bf), a = !1), u() || l());
},
onTrigger: function(v, y) {
bp(y) && (Bf = {
clientX: y.clientX,
clientY: y.clientY
}), o = y.type === "focus";
},
onHidden: function() {
e.props.followCursor && (f(), c(), a = !0);
}
};
}
};
function Bk(t, e) {
var n;
return {
popperOptions: Object.assign({}, t.popperOptions, {
modifiers: [].concat((((n = t.popperOptions) == null ? void 0 : n.modifiers) || []).filter(function(r) {
var i = r.name;
return i !== e.name;
}), [e])
})
};
}
var Vk = {
name: "inlinePositioning",
defaultValue: !1,
fn: function(e) {
var n = e.reference;
function r() {
return !!e.props.inlinePositioning;
}
var i, o = -1, a = !1, s = [], u = {
name: "tippyInlinePositioning",
enabled: !0,
phase: "afterWrite",
fn: function(p) {
var h = p.state;
r() && (s.indexOf(h.placement) !== -1 && (s = []), i !== h.placement && s.indexOf(h.placement) === -1 && (s.push(h.placement), e.setProps({
// @ts-ignore - unneeded DOMRect properties
getReferenceClientRect: function() {
return l(h.placement);
}
})), i = h.placement);
}
};
function l(d) {
return zk(Ov(d), n.getBoundingClientRect(), Oa(n.getClientRects()), o);
}
function c(d) {
a = !0, e.setProps(d), a = !1;
}
function f() {
a || c(Bk(e.props, u));
}
return {
onCreate: f,
onAfterUpdate: f,
onTrigger: function(p, h) {
if (bp(h)) {
var m = Oa(e.reference.getClientRects()), v = m.find(function(k) {
return k.left - 2 <= h.clientX && k.right + 2 >= h.clientX && k.top - 2 <= h.clientY && k.bottom + 2 >= h.clientY;
}), y = m.indexOf(v);
o = y > -1 ? y : o;
}
},
onHidden: function() {
o = -1;
}
};
}
};
function zk(t, e, n, r) {
if (n.length < 2 || t === null)
return e;
if (n.length === 2 && r >= 0 && n[0].left > n[1].right)
return n[r] || e;
switch (t) {
case "top":
case "bottom": {
var i = n[0], o = n[n.length - 1], a = t === "top", s = i.top, u = o.bottom, l = a ? i.left : o.left, c = a ? i.right : o.right, f = c - l, d = u - s;
return {
top: s,
bottom: u,
left: l,
right: c,
width: f,
height: d
};
}
case "left":
case "right": {
var p = Math.min.apply(Math, n.map(function(x) {
return x.left;
})), h = Math.max.apply(Math, n.map(function(x) {
return x.right;
})), m = n.filter(function(x) {
return t === "left" ? x.left === p : x.right === h;
}), v = m[0].top, y = m[m.length - 1].bottom, k = p, T = h, b = T - k, D = y - v;
return {
top: v,
bottom: y,
left: k,
right: T,
width: b,
height: D
};
}
default:
return e;
}
}
var Hk = {
name: "sticky",
defaultValue: !1,
fn: function(e) {
var n = e.reference, r = e.popper;
function i() {
return e.popperInstance ? e.popperInstance.state.elements.reference : n;
}
function o(l) {
return e.props.sticky === !0 || e.props.sticky === l;
}
var a = null, s = null;
function u() {
var l = o("reference") ? i().getBoundingClientRect() : null, c = o("popper") ? r.getBoundingClientRect() : null;
(l && vm(a, l) || c && vm(s, c)) && e.popperInstance && e.popperInstance.update(), a = l, s = c, e.state.isMounted && requestAnimationFrame(u);
}
return {
onMount: function() {
e.props.sticky && u();
}
};
}
};
function vm(t, e) {
return t && e ? t.top !== e.top || t.right !== e.right || t.bottom !== e.bottom || t.left !== e.left : !0;
}
Ie.setDefaultProps({
render: $v
});
Ie.setDefaultProps({
//@ts-ignore
onShow: (t) => {
if (!t.props.content)
return !1;
}
});
function Pv(t, e = {}, n = { mount: !0, appName: "Tippy" }) {
n = Object.assign({ mount: !0, appName: "Tippy" }, n);
const r = Fo(), i = re(), o = re({
isEnabled: !1,
isVisible: !1,
isDestroyed: !1,
isMounted: !1,
isShown: !1
}), a = Yb();
let s = null;
const u = () => s || (s = document.createDocumentFragment(), s), l = (S) => {
let _, N = Bt(S) ? S.value : S;
return ip(N) ? (a.value || (a.value = Tl({
name: n.appName,
setup: () => () => Bt(S) ? S.value : S
}), r && Object.assign(a.value._context, r.appContext), a.value.mount(u())), _ = () => u()) : typeof N == "object" ? (a.value || (a.value = Tl({
name: n.appName,
setup: () => () => jt(Bt(S) ? S.value : S)
}), r && Object.assign(a.value._context, r.appContext), a.value.mount(u())), _ = () => u()) : _ = N, _;
}, c = (S) => {
let _ = {};
return Bt(S) ? _ = S.value || {} : Vs(S) ? _ = { ...S } : _ = { ...S }, _.content && (_.content = l(_.content)), _.triggerTarget && (_.triggerTarget = Bt(_.triggerTarget) ? _.triggerTarget.value : _.triggerTarget), (!_.plugins || !Array.isArray(_.plugins)) && (_.plugins = []), _.plugins = _.plugins.filter((N) => N.name !== "vueTippyReactiveState"), _.plugins.push({
name: "vueTippyReactiveState",
fn: () => ({
onCreate() {
o.value.isEnabled = !0;
},
onMount() {
o.value.isMounted = !0;
},
onShow() {
o.value.isMounted = !0, o.value.isVisible = !0;
},
onShown() {
o.value.isShown = !0;
},
onHide() {
o.value.isMounted = !1, o.value.isVisible = !1;
},
onHidden() {
o.value.isShown = !1;
},
onUnmounted() {
o.value.isMounted = !1;
},
onDestroy() {
o.value.isDestroyed = !0;
}
})
}), _;
}, f = () => {
i.value && i.value.setProps(c(e));
}, d = () => {
!i.value || !e.content || i.value.setContent(l(e.content));
}, p = (S) => {
var _;
(_ = i.value) === null || _ === void 0 || _.setContent(l(S));
}, h = (S) => {
var _;
(_ = i.value) === null || _ === void 0 || _.setProps(c(S));
}, m = () => {
var S;
i.value && (i.value.destroy(), i.value = void 0), s = null, (S = a.value) === null || S === void 0 || S.unmount(), a.value = void 0;
}, v = () => {
var S;
(S = i.value) === null || S === void 0 || S.show();
}, y = () => {
var S;
(S = i.value) === null || S === void 0 || S.hide();
}, k = () => {
var S;
(S = i.value) === null || S === void 0 || S.disable(), o.value.isEnabled = !1;
}, T = () => {
var S;
(S = i.value) === null || S === void 0 || S.enable(), o.value.isEnabled = !0;
}, b = () => {
var S;
(S = i.value) === null || S === void 0 || S.unmount();
}, D = () => {
if (!t)
return;
let S = Bt(t) ? t.value : t;
typeof S == "function" && (S = S()), S && (i.value = Ie(S, c(e)), S.$tippy = x);
}, x = {
tippy: i,
refresh: f,
refreshContent: d,
setContent: p,
setProps: h,
destroy: m,
hide: y,
show: v,
disable: k,
enable: T,
unmount: b,
mount: D,
state: o
};
return n.mount && (r ? r.isMounted ? D() : st(D) : D()), r && jo(() => {
m();
}), Bt(e) || Vs(e) ? Ct(e, f, { immediate: !1 }) : Bt(e.content) && Ct(e.content, d, { immediate: !1 }), x;
}
function qk(t, e) {
const n = re();
return st(() => {
const i = (Array.isArray(t) ? t.map((o) => o.value) : typeof t == "function" ? t() : t.value).map((o) => o instanceof Element ? o._tippy : o).filter(Boolean);
n.value = $k(i, e ? { allowHTML: !0, ...e } : { allowHTML: !0 });
}), {
singleton: n
};
}
function Fk(t) {
return typeof t == "function" ? t() : W(t);
}
function jk(t) {
var e, n;
const r = Fk(t);
return (n = (e = r) === null || e === void 0 ? void 0 : e.$el) !== null && n !== void 0 ? n : r;
}
const Uk = be({
props: {
to: {
type: [String, Function]
},
tag: {
type: [String, Object],
default: "span"
},
contentTag: {
type: [String, Object],
default: "span"
},
contentClass: {
type: String,
default: null
},
appendTo: { default: () => Ie.defaultProps.appendTo },
aria: { default: () => Ie.defaultProps.aria },
delay: { default: () => Ie.defaultProps.delay },
duration: { default: () => Ie.defaultProps.duration },
getReferenceClientRect: { default: () => Ie.defaultProps.getReferenceClientRect },
hideOnClick: { type: [Boolean, String], default: () => Ie.defaultProps.hideOnClick },
ignoreAttributes: { type: Boolean, default: () => Ie.defaultProps.ignoreAttributes },
interactive: { type: Boolean, default: () => Ie.defaultProps.interactive },
interactiveBorder: { default: () => Ie.defaultProps.interactiveBorder },
interactiveDebounce: { default: () => Ie.defaultProps.interactiveDebounce },
moveTransition: { default: () => Ie.defaultProps.moveTransition },
offset: { default: () => Ie.defaultProps.offset },
onAfterUpdate: { default: () => Ie.defaultProps.onAfterUpdate },
onBeforeUpdate: { default: () => Ie.defaultProps.onBeforeUpdate },
onCreate: { default: () => Ie.defaultProps.onCreate },
onDestroy: { default: () => Ie.defaultProps.onDestroy },
onHidden: { default: () => Ie.defaultProps.onHidden },
onHide: { default: () => Ie.defaultProps.onHide },
onMount: { default: () => Ie.defaultProps.onMount },
onShow: { default: () => Ie.defaultProps.onShow },
onShown: { default: () => Ie.defaultProps.onShown },
onTrigger: { default: () => Ie.defaultProps.onTrigger },
onUntrigger: { default: () => Ie.defaultProps.onUntrigger },
onClickOutside: { default: () => Ie.defaultProps.onClickOutside },
placement: { default: () => Ie.defaultProps.placement },
plugins: { default: () => Ie.defaultProps.plugins },
popperOptions: { default: () => Ie.defaultProps.popperOptions },
render: { default: () => Ie.defaultProps.render },
showOnCreate: { type: Boolean, default: () => Ie.defaultProps.showOnCreate },
touch: { type: [Boolean, String, Array], default: () => Ie.defaultProps.touch },
trigger: { default: () => Ie.defaultProps.trigger },
triggerTarget: { default: () => Ie.defaultProps.triggerTarget },
animateFill: { type: Boolean, default: () => Ie.defaultProps.animateFill },
followCursor: { type: [Boolean, String], default: () => Ie.defaultProps.followCursor },
inlinePositioning: { type: Boolean, default: () => Ie.defaultProps.inlinePositioning },
sticky: { type: [Boolean, String], default: () => Ie.defaultProps.sticky },
allowHTML: { type: Boolean, default: () => Ie.defaultProps.allowHTML },
animation: { default: () => Ie.defaultProps.animation },
arrow: { default: () => Ie.defaultProps.arrow },
content: { default: () => Ie.defaultProps.content },
inertia: { default: () => Ie.defaultProps.inertia },
maxWidth: { default: () => Ie.defaultProps.maxWidth },
role: { default: () => Ie.defaultProps.role },
theme: { default: () => Ie.defaultProps.theme },
zIndex: { default: () => Ie.defaultProps.zIndex }
},
emits: ["state"],
setup(t, { slots: e, emit: n, expose: r }) {
const i = re(), o = re(), a = re(), s = re(!1), u = () => {
let p = { ...t };
for (const h of ["to", "tag", "contentTag", "contentClass"])
p.hasOwnProperty(h) && delete p[h];
return p;
};
let l = () => jk(i);
t.to && (typeof Element < "u" && t.to instanceof Element ? l = () => t.to : t.to === "parent" ? l = () => {
let p = i.value;
return p || (p = i.value = o.value.parentElement), p;
} : (typeof t.to == "string" || t.to instanceof String) && (l = () => document.querySelector(t.to)));
const c = Pv(l, u());
let f = e.content;
!f && t.to === "parent" && (f = e.default), st(() => {
s.value = !0, Vn(() => {
f && c.setContent(() => a.value);
});
}), Ct(c.state, () => {
n("state", W(c.state));
}, { immediate: !0, deep: !0 }), Ct(() => t, () => {
c.setProps(u()), f && c.setContent(() => a.value);
}, { deep: !0 });
let d = Qt({
elem: i,
contentElem: a,
mounted: s,
...c
});
return r(d), () => {
const p = (typeof t.contentTag == "string", t.contentTag), h = f ? jt(p, {
ref: a,
style: { display: s.value ? "inherit" : "none" },
class: t.contentClass
}, f(d)) : null;
if (t.to === "parent") {
const y = [];
if (!i.value) {
const k = jt("span", {
ref: o,
"data-v-tippy": "",
style: { display: "none" }
});
y.push(k);
}
return h && y.push(h), y;
}
const m = e.default ? e.default(d) : [];
if (!t.tag) {
const y = jt(m[0], {
ref: i,
"data-v-tippy": ""
});
return h ? [y, h] : y;
}
const v = (typeof t.tag == "string", t.tag);
return jt(v, { ref: i, "data-v-tippy": "" }, h ? [m, h] : m);
};
}
}), Wk = [
"a11y",
"allowHTML",
"arrow",
"flip",
"flipOnUpdate",
"hideOnClick",
"ignoreAttributes",
"inertia",
"interactive",
"lazy",
"multiple",
"showOnInit",
"touch",
"touchHold"
];
let Vf = {};
Object.keys(Ie.defaultProps).forEach((t) => {
Wk.includes(t) ? Vf[t] = {
type: Boolean,
default: function() {
return Ie.defaultProps[t];
}
} : Vf[t] = {
default: function() {
return Ie.defaultProps[t];
}
};
});
const Yk = be({
props: Vf,
setup(t) {
const e = re([]), { singleton: n } = qk(e, t);
return { instances: e, singleton: n };
},
mounted() {
var t;
const n = this.$el.parentElement.querySelectorAll("[data-v-tippy]");
this.instances = Array.from(n).map((r) => r._tippy).filter(Boolean), (t = this.singleton) === null || t === void 0 || t.setInstances(this.instances);
},
render() {
let t = this.$slots.default ? this.$slots.default() : [];
return jt(() => t);
}
}), Kk = {
mounted(t, e, n) {
const r = typeof e.value == "string" ? { content: e.value } : e.value || {}, i = Object.keys(e.modifiers || {}), o = i.find((s) => s !== "arrow"), a = i.findIndex((s) => s === "arrow") !== -1;
o && (r.placement = r.placement || o), a && (r.arrow = r.arrow !== void 0 ? r.arrow : !0), n.props && n.props.onTippyShow && (r.onShow = function(...s) {
var u;
return (u = n.props) === null || u === void 0 ? void 0 : u.onTippyShow(...s);
}), n.props && n.props.onTippyShown && (r.onShown = function(...s) {
var u;
return (u = n.props) === null || u === void 0 ? void 0 : u.onTippyShown(...s);
}), n.props && n.props.onTippyHidden && (r.onHidden = function(...s) {
var u;
return (u = n.props) === null || u === void 0 ? void 0 : u.onTippyHidden(...s);
}), n.props && n.props.onTippyHide && (r.onHide = function(...s) {
var u;
return (u = n.props) === null || u === void 0 ? void 0 : u.onTippyHide(...s);
}), n.props && n.props.onTippyMount && (r.onMount = function(...s) {
var u;
return (u = n.props) === null || u === void 0 ? void 0 : u.onTippyMount(...s);
}), t.getAttribute("title") && !r.content && (r.content = t.getAttribute("title"), t.removeAttribute("title")), t.getAttribute("content") && !r.content && (r.content = t.getAttribute("content")), Pv(t, r);
},
unmounted(t) {
t.$tippy ? t.$tippy.destroy() : t._tippy && t._tippy.destroy();
},
updated(t, e) {
const n = typeof e.value == "string" ? { content: e.value } : e.value || {};
t.getAttribute("title") && !n.content && (n.content = t.getAttribute("title"), t.removeAttribute("title")), t.getAttribute("content") && !n.content && (n.content = t.getAttribute("content")), t.$tippy ? t.$tippy.setProps(n || {}) : t._tippy && t._tippy.setProps(n || {});
}
}, Gk = {
install(t, e = {}) {
Ie.setDefaultProps(e.defaultProps || {}), t.directive(e.directive || "tippy", Kk), t.component(e.component || "tippy", Uk), t.component(e.componentSingleton || "tippy-singleton", Yk);
}
}, Jk = Ie.setDefaultProps;
Jk({
ignoreAttributes: !0,
plugins: [Hk, Vk, Rk, Nk]
});
const Xk = Gk;
function Qk(t) {
return typeof t == "object" && t !== null;
}
function ym(t, e) {
return t = Qk(t) ? t : /* @__PURE__ */ Object.create(null), new Proxy(t, {
get(n, r, i) {
return r === "key" ? Reflect.get(n, r, i) : Reflect.get(n, r, i) || Reflect.get(e, r, i);
}
});
}
function Zk(t, e) {
return e.reduce((n, r) => n == null ? void 0 : n[r], t);
}
function ex(t, e, n) {
return e.slice(0, -1).reduce((r, i) => /^(__proto__)$/.test(i) ? {} : r[i] = r[i] || {}, t)[e[e.length - 1]] = n, t;
}
function tx(t, e) {
return e.reduce((n, r) => {
const i = r.split(".");
return ex(n, i, Zk(t, i));
}, {});
}
function wm(t, { storage: e, serializer: n, key: r, debug: i }) {
try {
const o = e == null ? void 0 : e.getItem(r);
o && t.$patch(n == null ? void 0 : n.deserialize(o));
} catch (o) {
i && console.error(o);
}
}
function km(t, { storage: e, serializer: n, key: r, paths: i, debug: o }) {
try {
const a = Array.isArray(i) ? tx(t, i) : t;
e.setItem(r, n.serialize(a));
} catch (a) {
o && console.error(a);
}
}
function nx(t = {}) {
return (e) => {
const { auto: n = !1 } = t, {
options: { persist: r = n },
store: i,
pinia: o
} = e;
if (!r)
return;
if (!(i.$id in o.state.value)) {
const s = o._s.get(i.$id.replace("__hot:", ""));
s && Promise.resolve().then(() => s.$persist());
return;
}
const a = (Array.isArray(r) ? r.map((s) => ym(s, t)) : [ym(r, t)]).map(
({
storage: s = localStorage,
beforeRestore: u = null,
afterRestore: l = null,
serializer: c = {
serialize: JSON.stringify,
deserialize: JSON.parse
},
key: f = i.$id,
paths: d = null,
debug: p = !1
}) => {
var h;
return {
storage: s,
beforeRestore: u,
afterRestore: l,
serializer: c,
key: ((h = t.key) != null ? h : (m) => m)(typeof f == "string" ? f : f(i.$id)),
paths: d,
debug: p
};
}
);
i.$persist = () => {
a.forEach((s) => {
km(i.$state, s);
});
}, i.$hydrate = ({ runHooks: s = !0 } = {}) => {
a.forEach((u) => {
const { beforeRestore: l, afterRestore: c } = u;
s && (l == null || l(e)), wm(i, u), s && (c == null || c(e));
});
}, a.forEach((s) => {
const { beforeRestore: u, afterRestore: l } = s;
u == null || u(e), wm(i, s), l == null || l(e), i.$subscribe(
(c, f) => {
km(f, s);
},
{
detached: !0
}
);
});
};
}
var rx = nx(), In = "top", fr = "bottom", pr = "right", Ln = "left", vp = "auto", hu = [In, fr, pr, Ln], Aa = "start", js = "end", ix = "clippingParents", Iv = "viewport", es = "popper", ox = "reference", xm = /* @__PURE__ */ hu.reduce(function(t, e) {
return t.concat([e + "-" + Aa, e + "-" + js]);
}, []), Lv = /* @__PURE__ */ [].concat(hu, [vp]).reduce(function(t, e) {
return t.concat([e, e + "-" + Aa, e + "-" + js]);
}, []), ax = "beforeRead", sx = "read", ux = "afterRead", lx = "beforeMain", cx = "main", dx = "afterMain", fx = "beforeWrite", px = "write", hx = "afterWrite", mx = [ax, sx, ux, lx, cx, dx, fx, px, hx];
function Ur(t) {
return t ? (t.nodeName || "").toLowerCase() : null;
}
function Xn(t) {
if (t == null)
return window;
if (t.toString() !== "[object Window]") {
var e = t.ownerDocument;
return e && e.defaultView || window;
}
return t;
}
function Lo(t) {
var e = Xn(t).Element;
return t instanceof e || t instanceof Element;
}
function ur(t) {
var e = Xn(t).HTMLElement;
return t instanceof e || t instanceof HTMLElement;
}
function yp(t) {
if (typeof ShadowRoot > "u")
return !1;
var e = Xn(t).ShadowRoot;
return t instanceof e || t instanceof ShadowRoot;
}
function gx(t) {
var e = t.state;
Object.keys(e.elements).forEach(function(n) {
var r = e.styles[n] || {}, i = e.attributes[n] || {}, o = e.elements[n];
!ur(o) || !Ur(o) || (Object.assign(o.style, r), Object.keys(i).forEach(function(a) {
var s = i[a];
s === !1 ? o.removeAttribute(a) : o.setAttribute(a, s === !0 ? "" : s);
}));
});
}
function bx(t) {
var e = t.state, n = {
popper: {
position: e.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
return Object.assign(e.elements.popper.style, n.popper), e.styles = n, e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow), function() {
Object.keys(e.elements).forEach(function(r) {
var i = e.elements[r], o = e.attributes[r] || {}, a = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : n[r]), s = a.reduce(function(u, l) {
return u[l] = "", u;
}, {});
!ur(i) || !Ur(i) || (Object.assign(i.style, s), Object.keys(o).forEach(function(u) {
i.removeAttribute(u);
}));
});
};
}
const Rv = {
name: "applyStyles",
enabled: !0,
phase: "write",
fn: gx,
effect: bx,
requires: ["computeStyles"]
};
function zr(t) {
return t.split("-")[0];
}
var Co = Math.max, Ml = Math.min, Ma = Math.round;
function zf() {
var t = navigator.userAgentData;
return t != null && t.brands && Array.isArray(t.brands) ? t.brands.map(function(e) {
return e.brand + "/" + e.version;
}).join(" ") : navigator.userAgent;
}
function Bv() {
return !/^((?!chrome|android).)*safari/i.test(zf());
}
function Da(t, e, n) {
e === void 0 && (e = !1), n === void 0 && (n = !1);
var r = t.getBoundingClientRect(), i = 1, o = 1;
e && ur(t) && (i = t.offsetWidth > 0 && Ma(r.width) / t.offsetWidth || 1, o = t.offsetHeight > 0 && Ma(r.height) / t.offsetHeight || 1);
var a = Lo(t) ? Xn(t) : window, s = a.visualViewport, u = !Bv() && n, l = (r.left + (u && s ? s.offsetLeft : 0)) / i, c = (r.top + (u && s ? s.offsetTop : 0)) / o, f = r.width / i, d = r.height / o;
return {
width: f,
height: d,
top: c,
right: l + f,
bottom: c + d,
left: l,
x: l,
y: c
};
}
function wp(t) {
var e = Da(t), n = t.offsetWidth, r = t.offsetHeight;
return Math.abs(e.width - n) <= 1 && (n = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), {
x: t.offsetLeft,
y: t.offsetTop,
width: n,
height: r
};
}
function Vv(t, e) {
var n = e.getRootNode && e.getRootNode();
if (t.contains(e))
return !0;
if (n && yp(n)) {
var r = e;
do {
if (r && t.isSameNode(r))
return !0;
r = r.parentNode || r.host;
} while (r);
}
return !1;
}
function hi(t) {
return Xn(t).getComputedStyle(t);
}
function vx(t) {
return ["table", "td", "th"].indexOf(Ur(t)) >= 0;
}
function ji(t) {
return ((Lo(t) ? t.ownerDocument : (
// $FlowFixMe[prop-missing]
t.document
)) || window.document).documentElement;
}
function zc(t) {
return Ur(t) === "html" ? t : (
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
t.assignedSlot || // step into the shadow DOM of the parent of a slotted node
t.parentNode || // DOM Element detected
(yp(t) ? t.host : null) || // ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
ji(t)
);
}
function Sm(t) {
return !ur(t) || // https://github.com/popperjs/popper-core/issues/837
hi(t).position === "fixed" ? null : t.offsetParent;
}
function yx(t) {
var e = /firefox/i.test(zf()), n = /Trident/i.test(zf());
if (n && ur(t)) {
var r = hi(t);
if (r.position === "fixed")
return null;
}
var i = zc(t);
for (yp(i) && (i = i.host); ur(i) && ["html", "body"].indexOf(Ur(i)) < 0; ) {
var o = hi(i);
if (o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].indexOf(o.willChange) !== -1 || e && o.willChange === "filter" || e && o.filter && o.filter !== "none")
return i;
i = i.parentNode;
}
return null;
}
function mu(t) {
for (var e = Xn(t), n = Sm(t); n && vx(n) && hi(n).position === "static"; )
n = Sm(n);
return n && (Ur(n) === "html" || Ur(n) === "body" && hi(n).position === "static") ? e : n || yx(t) || e;
}
function kp(t) {
return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
}
function ws(t, e, n) {
return Co(t, Ml(e, n));
}
function wx(t, e, n) {
var r = ws(t, e, n);
return r > n ? n : r;
}
function zv() {
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};
}
function Hv(t) {
return Object.assign({}, zv(), t);
}
function qv(t, e) {
return e.reduce(function(n, r) {
return n[r] = t, n;
}, {});
}
var kx = function(e, n) {
return e = typeof e == "function" ? e(Object.assign({}, n.rects, {
placement: n.placement
})) : e, Hv(typeof e != "number" ? e : qv(e, hu));
};
function xx(t) {
var e, n = t.state, r = t.name, i = t.options, o = n.elements.arrow, a = n.modifiersData.popperOffsets, s = zr(n.placement), u = kp(s), l = [Ln, pr].indexOf(s) >= 0, c = l ? "height" : "width";
if (!(!o || !a)) {
var f = kx(i.padding, n), d = wp(o), p = u === "y" ? In : Ln, h = u === "y" ? fr : pr, m = n.rects.reference[c] + n.rects.reference[u] - a[u] - n.rects.popper[c], v = a[u] - n.rects.reference[u], y = mu(o), k = y ? u === "y" ? y.clientHeight || 0 : y.clientWidth || 0 : 0, T = m / 2 - v / 2, b = f[p], D = k - d[c] - f[h], x = k / 2 - d[c] / 2 + T, S = ws(b, x, D), _ = u;
n.modifiersData[r] = (e = {}, e[_] = S, e.centerOffset = S - x, e);
}
}
function Sx(t) {
var e = t.state, n = t.options, r = n.element, i = r === void 0 ? "[data-popper-arrow]" : r;
i != null && (typeof i == "string" && (i = e.elements.popper.querySelector(i), !i) || Vv(e.elements.popper, i) && (e.elements.arrow = i));
}
const Ex = {
name: "arrow",
enabled: !0,
phase: "main",
fn: xx,
effect: Sx,
requires: ["popperOffsets"],
requiresIfExists: ["preventOverflow"]
};
function $a(t) {
return t.split("-")[1];
}
var _x = {
top: "auto",
right: "auto",
bottom: "auto",
left: "auto"
};
function Tx(t, e) {
var n = t.x, r = t.y, i = e.devicePixelRatio || 1;
return {
x: Ma(n * i) / i || 0,
y: Ma(r * i) / i || 0
};
}
function Em(t) {
var e, n = t.popper, r = t.popperRect, i = t.placement, o = t.variation, a = t.offsets, s = t.position, u = t.gpuAcceleration, l = t.adaptive, c = t.roundOffsets, f = t.isFixed, d = a.x, p = d === void 0 ? 0 : d, h = a.y, m = h === void 0 ? 0 : h, v = typeof c == "function" ? c({
x: p,
y: m
}) : {
x: p,
y: m
};
p = v.x, m = v.y;
var y = a.hasOwnProperty("x"), k = a.hasOwnProperty("y"), T = Ln, b = In, D = window;
if (l) {
var x = mu(n), S = "clientHeight", _ = "clientWidth";
if (x === Xn(n) && (x = ji(n), hi(x).position !== "static" && s === "absolute" && (S = "scrollHeight", _ = "scrollWidth")), x = x, i === In || (i === Ln || i === pr) && o === js) {
b = fr;
var N = f && x === D && D.visualViewport ? D.visualViewport.height : (
// $FlowFixMe[prop-missing]
x[S]
);
m -= N - r.height, m *= u ? 1 : -1;
}
if (i === Ln || (i === In || i === fr) && o === js) {
T = pr;
var R = f && x === D && D.visualViewport ? D.visualViewport.width : (
// $FlowFixMe[prop-missing]
x[_]
);
p -= R - r.width, p *= u ? 1 : -1;
}
}
var w = Object.assign({
position: s
}, l && _x), A = c === !0 ? Tx({
x: p,
y: m
}, Xn(n)) : {
x: p,
y: m
};
if (p = A.x, m = A.y, u) {
var $;
return Object.assign({}, w, ($ = {}, $[b] = k ? "0" : "", $[T] = y ? "0" : "", $.transform = (D.devicePixelRatio || 1) <= 1 ? "translate(" + p + "px, " + m + "px)" : "translate3d(" + p + "px, " + m + "px, 0)", $));
}
return Object.assign({}, w, (e = {}, e[b] = k ? m + "px" : "", e[T] = y ? p + "px" : "", e.transform = "", e));
}
function Cx(t) {
var e = t.state, n = t.options, r = n.gpuAcceleration, i = r === void 0 ? !0 : r, o = n.adaptive, a = o === void 0 ? !0 : o, s = n.roundOffsets, u = s === void 0 ? !0 : s, l = {
placement: zr(e.placement),
variation: $a(e.placement),
popper: e.elements.popper,
popperRect: e.rects.popper,
gpuAcceleration: i,
isFixed: e.options.strategy === "fixed"
};
e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, Em(Object.assign({}, l, {
offsets: e.modifiersData.popperOffsets,
position: e.options.strategy,
adaptive: a,
roundOffsets: u
})))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, Em(Object.assign({}, l, {
offsets: e.modifiersData.arrow,
position: "absolute",
adaptive: !1,
roundOffsets: u
})))), e.attributes.popper = Object.assign({}, e.attributes.popper, {
"data-popper-placement": e.placement
});
}
const Ox = {
name: "computeStyles",
enabled: !0,
phase: "beforeWrite",
fn: Cx,
data: {}
};
var Au = {
passive: !0
};
function Ax(t) {
var e = t.state, n = t.instance, r = t.options, i = r.scroll, o = i === void 0 ? !0 : i, a = r.resize, s = a === void 0 ? !0 : a, u = Xn(e.elements.popper), l = [].concat(e.scrollParents.reference, e.scrollParents.popper);
return o && l.forEach(function(c) {
c.addEventListener("scroll", n.update, Au);
}), s && u.addEventListener("resize", n.update, Au), function() {
o && l.forEach(function(c) {
c.removeEventListener("scroll", n.update, Au);
}), s && u.removeEventListener("resize", n.update, Au);
};
}
const Mx = {
name: "eventListeners",
enabled: !0,
phase: "write",
fn: function() {
},
effect: Ax,
data: {}
};
var Dx = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function ll(t) {
return t.replace(/left|right|bottom|top/g, function(e) {
return Dx[e];
});
}
var $x = {
start: "end",
end: "start"
};
function _m(t) {
return t.replace(/start|end/g, function(e) {
return $x[e];
});
}
function xp(t) {
var e = Xn(t), n = e.pageXOffset, r = e.pageYOffset;
return {
scrollLeft: n,
scrollTop: r
};
}
function Sp(t) {
return Da(ji(t)).left + xp(t).scrollLeft;
}
function Nx(t, e) {
var n = Xn(t), r = ji(t), i = n.visualViewport, o = r.clientWidth, a = r.clientHeight, s = 0, u = 0;
if (i) {
o = i.width, a = i.height;
var l = Bv();
(l || !l && e === "fixed") && (s = i.offsetLeft, u = i.offsetTop);
}
return {
width: o,
height: a,
x: s + Sp(t),
y: u
};
}
function Px(t) {
var e, n = ji(t), r = xp(t), i = (e = t.ownerDocument) == null ? void 0 : e.body, o = Co(n.scrollWidth, n.clientWidth, i ? i.scrollWidth : 0, i ? i.clientWidth : 0), a = Co(n.scrollHeight, n.clientHeight, i ? i.scrollHeight : 0, i ? i.clientHeight : 0), s = -r.scrollLeft + Sp(t), u = -r.scrollTop;
return hi(i || n).direction === "rtl" && (s += Co(n.clientWidth, i ? i.clientWidth : 0) - o), {
width: o,
height: a,
x: s,
y: u
};
}
function Ep(t) {
var e = hi(t), n = e.overflow, r = e.overflowX, i = e.overflowY;
return /auto|scroll|overlay|hidden/.test(n + i + r);
}
function Fv(t) {
return ["html", "body", "#document"].indexOf(Ur(t)) >= 0 ? t.ownerDocument.body : ur(t) && Ep(t) ? t : Fv(zc(t));
}
function ks(t, e) {
var n;
e === void 0 && (e = []);
var r = Fv(t), i = r === ((n = t.ownerDocument) == null ? void 0 : n.body), o = Xn(r), a = i ? [o].concat(o.visualViewport || [], Ep(r) ? r : []) : r, s = e.concat(a);
return i ? s : (
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
s.concat(ks(zc(a)))
);
}
function Hf(t) {
return Object.assign({}, t, {
left: t.x,
top: t.y,
right: t.x + t.width,
bottom: t.y + t.height
});
}
function Ix(t, e) {
var n = Da(t, !1, e === "fixed");
return n.top = n.top + t.clientTop, n.left = n.left + t.clientLeft, n.bottom = n.top + t.clientHeight, n.right = n.left + t.clientWidth, n.width = t.clientWidth, n.height = t.clientHeight, n.x = n.left, n.y = n.top, n;
}
function Tm(t, e, n) {
return e === Iv ? Hf(Nx(t, n)) : Lo(e) ? Ix(e, n) : Hf(Px(ji(t)));
}
function Lx(t) {
var e = ks(zc(t)), n = ["absolute", "fixed"].indexOf(hi(t).position) >= 0, r = n && ur(t) ? mu(t) : t;
return Lo(r) ? e.filter(function(i) {
return Lo(i) && Vv(i, r) && Ur(i) !== "body";
}) : [];
}
function Rx(t, e, n, r) {
var i = e === "clippingParents" ? Lx(t) : [].concat(e), o = [].concat(i, [n]), a = o[0], s = o.reduce(function(u, l) {
var c = Tm(t, l, r);
return u.top = Co(c.top, u.top), u.right = Ml(c.right, u.right), u.bottom = Ml(c.bottom, u.bottom), u.left = Co(c.left, u.left), u;
}, Tm(t, a, r));
return s.width = s.right - s.left, s.height = s.bottom - s.top, s.x = s.left, s.y = s.top, s;
}
function jv(t) {
var e = t.reference, n = t.element, r = t.placement, i = r ? zr(r) : null, o = r ? $a(r) : null, a = e.x + e.width / 2 - n.width / 2, s = e.y + e.height / 2 - n.height / 2, u;
switch (i) {
case In:
u = {
x: a,
y: e.y - n.height
};
break;
case fr:
u = {
x: a,
y: e.y + e.height
};
break;
case pr:
u = {
x: e.x + e.width,
y: s
};
break;
case Ln:
u = {
x: e.x - n.width,
y: s
};
break;
default:
u = {
x: e.x,
y: e.y
};
}
var l = i ? kp(i) : null;
if (l != null) {
var c = l === "y" ? "height" : "width";
switch (o) {
case Aa:
u[l] = u[l] - (e[c] / 2 - n[c] / 2);
break;
case js:
u[l] = u[l] + (e[c] / 2 - n[c] / 2);
break;
}
}
return u;
}
function Us(t, e) {
e === void 0 && (e = {});
var n = e, r = n.placement, i = r === void 0 ? t.placement : r, o = n.strategy, a = o === void 0 ? t.strategy : o, s = n.boundary, u = s === void 0 ? ix : s, l = n.rootBoundary, c = l === void 0 ? Iv : l, f = n.elementContext, d = f === void 0 ? es : f, p = n.altBoundary, h = p === void 0 ? !1 : p, m = n.padding, v = m === void 0 ? 0 : m, y = Hv(typeof v != "number" ? v : qv(v, hu)), k = d === es ? ox : es, T = t.rects.popper, b = t.elements[h ? k : d], D = Rx(Lo(b) ? b : b.contextElement || ji(t.elements.popper), u, c, a), x = Da(t.elements.reference), S = jv({
reference: x,
element: T,
strategy: "absolute",
placement: i
}), _ = Hf(Object.assign({}, T, S)), N = d === es ? _ : x, R = {
top: D.top - N.top + y.top,
bottom: N.bottom - D.bottom + y.bottom,
left: D.left - N.left + y.left,
right: N.right - D.right + y.right
}, w = t.modifiersData.offset;
if (d === es && w) {
var A = w[i];
Object.keys(R).forEach(function($) {
var I = [pr, fr].indexOf($) >= 0 ? 1 : -1, E = [In, fr].indexOf($) >= 0 ? "y" : "x";
R[$] += A[E] * I;
});
}
return R;
}
function Bx(t, e) {
e === void 0 && (e = {});
var n = e, r = n.placement, i = n.boundary, o = n.rootBoundary, a = n.padding, s = n.flipVariations, u = n.allowedAutoPlacements, l = u === void 0 ? Lv : u, c = $a(r), f = c ? s ? xm : xm.filter(function(h) {
return $a(h) === c;
}) : hu, d = f.filter(function(h) {
return l.indexOf(h) >= 0;
});
d.length === 0 && (d = f);
var p = d.reduce(function(h, m) {
return h[m] = Us(t, {
placement: m,
boundary: i,
rootBoundary: o,
padding: a
})[zr(m)], h;
}, {});
return Object.keys(p).sort(function(h, m) {
return p[h] - p[m];
});
}
function Vx(t) {
if (zr(t) === vp)
return [];
var e = ll(t);
return [_m(t), e, _m(e)];
}
function zx(t) {
var e = t.state, n = t.options, r = t.name;
if (!e.modifiersData[r]._skip) {
for (var i = n.mainAxis, o = i === void 0 ? !0 : i, a = n.altAxis, s = a === void 0 ? !0 : a, u = n.fallbackPlacements, l = n.padding, c = n.boundary, f = n.rootBoundary, d = n.altBoundary, p = n.flipVariations, h = p === void 0 ? !0 : p, m = n.allowedAutoPlacements, v = e.options.placement, y = zr(v), k = y === v, T = u || (k || !h ? [ll(v)] : Vx(v)), b = [v].concat(T).reduce(function(q, V) {
return q.concat(zr(V) === vp ? Bx(e, {
placement: V,
boundary: c,
rootBoundary: f,
padding: l,
flipVariations: h,
allowedAutoPlacements: m
}) : V);
}, []), D = e.rects.reference, x = e.rects.popper, S = /* @__PURE__ */ new Map(), _ = !0, N = b[0], R = 0; R < b.length; R++) {
var w = b[R], A = zr(w), $ = $a(w) === Aa, I = [In, fr].indexOf(A) >= 0, E = I ? "width" : "height", O = Us(e, {
placement: w,
boundary: c,
rootBoundary: f,
altBoundary: d,
padding: l
}), g = I ? $ ? pr : Ln : $ ? fr : In;
D[E] > x[E] && (g = ll(g));
var M = ll(g), H = [];
if (o && H.push(O[A] <= 0), s && H.push(O[g] <= 0, O[M] <= 0), H.every(function(q) {
return q;
})) {
N = w, _ = !1;
break;
}
S.set(w, H);
}
if (_)
for (var z = h ? 3 : 1, Y = function(V) {
var te = b.find(function(K) {
var Q = S.get(K);
if (Q)
return Q.slice(0, V).every(function(Z) {
return Z;
});
});
if (te)
return N = te, "break";
}, ee = z; ee > 0; ee--) {
var ce = Y(ee);
if (ce === "break")
break;
}
e.placement !== N && (e.modifiersData[r]._skip = !0, e.placement = N, e.reset = !0);
}
}
const Hx = {
name: "flip",
enabled: !0,
phase: "main",
fn: zx,
requiresIfExists: ["offset"],
data: {
_skip: !1
}
};
function Cm(t, e, n) {
return n === void 0 && (n = {
x: 0,
y: 0
}), {
top: t.top - e.height - n.y,
right: t.right - e.width + n.x,
bottom: t.bottom - e.height + n.y,
left: t.left - e.width - n.x
};
}
function Om(t) {
return [In, pr, fr, Ln].some(function(e) {
return t[e] >= 0;
});
}
function qx(t) {
var e = t.state, n = t.name, r = e.rects.reference, i = e.rects.popper, o = e.modifiersData.preventOverflow, a = Us(e, {
elementContext: "reference"
}), s = Us(e, {
altBoundary: !0
}), u = Cm(a, r), l = Cm(s, i, o), c = Om(u), f = Om(l);
e.modifiersData[n] = {
referenceClippingOffsets: u,
popperEscapeOffsets: l,
isReferenceHidden: c,
hasPopperEscaped: f
}, e.attributes.popper = Object.assign({}, e.attributes.popper, {
"data-popper-reference-hidden": c,
"data-popper-escaped": f
});
}
const Fx = {
name: "hide",
enabled: !0,
phase: "main",
requiresIfExists: ["preventOverflow"],
fn: qx
};
function jx(t, e, n) {
var r = zr(t), i = [Ln, In].indexOf(r) >= 0 ? -1 : 1, o = typeof n == "function" ? n(Object.assign({}, e, {
placement: t
})) : n, a = o[0], s = o[1];
return a = a || 0, s = (s || 0) * i, [Ln, pr].indexOf(r) >= 0 ? {
x: s,
y: a
} : {
x: a,
y: s
};
}
function Ux(t) {
var e = t.state, n = t.options, r = t.name, i = n.offset, o = i === void 0 ? [0, 0] : i, a = Lv.reduce(function(c, f) {
return c[f] = jx(f, e.rects, o), c;
}, {}), s = a[e.placement], u = s.x, l = s.y;
e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += u, e.modifiersData.popperOffsets.y += l), e.modifiersData[r] = a;
}
const Wx = {
name: "offset",
enabled: !0,
phase: "main",
requires: ["popperOffsets"],
fn: Ux
};
function Yx(t) {
var e = t.state, n = t.name;
e.modifiersData[n] = jv({
reference: e.rects.reference,
element: e.rects.popper,
strategy: "absolute",
placement: e.placement
});
}
const Kx = {
name: "popperOffsets",
enabled: !0,
phase: "read",
fn: Yx,
data: {}
};
function Gx(t) {
return t === "x" ? "y" : "x";
}
function Jx(t) {
var e = t.state, n = t.options, r = t.name, i = n.mainAxis, o = i === void 0 ? !0 : i, a = n.altAxis, s = a === void 0 ? !1 : a, u = n.boundary, l = n.rootBoundary, c = n.altBoundary, f = n.padding, d = n.tether, p = d === void 0 ? !0 : d, h = n.tetherOffset, m = h === void 0 ? 0 : h, v = Us(e, {
boundary: u,
rootBoundary: l,
padding: f,
altBoundary: c
}), y = zr(e.placement), k = $a(e.placement), T = !k, b = kp(y), D = Gx(b), x = e.modifiersData.popperOffsets, S = e.rects.reference, _ = e.rects.popper, N = typeof m == "function" ? m(Object.assign({}, e.rects, {
placement: e.placement
})) : m, R = typeof N == "number" ? {
mainAxis: N,
altAxis: N
} : Object.assign({
mainAxis: 0,
altAxis: 0
}, N), w = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, A = {
x: 0,
y: 0
};
if (x) {
if (o) {
var $, I = b === "y" ? In : Ln, E = b === "y" ? fr : pr, O = b === "y" ? "height" : "width", g = x[b], M = g + v[I], H = g - v[E], z = p ? -_[O] / 2 : 0, Y = k === Aa ? S[O] : _[O], ee = k === Aa ? -_[O] : -S[O], ce = e.elements.arrow, q = p && ce ? wp(ce) : {
width: 0,
height: 0
}, V = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : zv(), te = V[I], K = V[E], Q = ws(0, S[O], q[O]), Z = T ? S[O] / 2 - z - Q - te - R.mainAxis : Y - Q - te - R.mainAxis, ae = T ? -S[O] / 2 + z + Q + K + R.mainAxis : ee + Q + K + R.mainAxis, ke = e.elements.arrow && mu(e.elements.arrow), ge = ke ? b === "y" ? ke.clientTop || 0 : ke.clientLeft || 0 : 0, de = ($ = w == null ? void 0 : w[b]) != null ? $ : 0, ye = g + Z - de - ge, xe = g + ae - de, ct = ws(p ? Ml(M, ye) : M, g, p ? Co(H, xe) : H);
x[b] = ct, A[b] = ct - g;
}
if (s) {
var le, je = b === "x" ? In : Ln, We = b === "x" ? fr : pr, Ke = x[D], ot = D === "y" ? "height" : "width", Rt = Ke + v[je], xt = Ke - v[We], qt = [In, Ln].indexOf(y) !== -1, Ut = (le = w == null ? void 0 : w[D]) != null ? le : 0, Hn = qt ? Rt : Ke - S[ot] - _[ot] - Ut + R.altAxis, qn = qt ? Ke + S[ot] + _[ot] - Ut - R.altAxis : xt, An = p && qt ? wx(Hn, Ke, qn) : ws(p ? Hn : Rt, Ke, p ? qn : xt);
x[D] = An, A[D] = An - Ke;
}
e.modifiersData[r] = A;
}
}
const Xx = {
name: "preventOverflow",
enabled: !0,
phase: "main",
fn: Jx,
requiresIfExists: ["offset"]
};
function Qx(t) {
return {
scrollLeft: t.scrollLeft,
scrollTop: t.scrollTop
};
}
function Zx(t) {
return t === Xn(t) || !ur(t) ? xp(t) : Qx(t);
}
function e8(t) {
var e = t.getBoundingClientRect(), n = Ma(e.width) / t.offsetWidth || 1, r = Ma(e.height) / t.offsetHeight || 1;
return n !== 1 || r !== 1;
}
function t8(t, e, n) {
n === void 0 && (n = !1);
var r = ur(e), i = ur(e) && e8(e), o = ji(e), a = Da(t, i, n), s = {
scrollLeft: 0,
scrollTop: 0
}, u = {
x: 0,
y: 0
};
return (r || !r && !n) && ((Ur(e) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
Ep(o)) && (s = Zx(e)), ur(e) ? (u = Da(e, !0), u.x += e.clientLeft, u.y += e.clientTop) : o && (u.x = Sp(o))), {
x: a.left + s.scrollLeft - u.x,
y: a.top + s.scrollTop - u.y,
width: a.width,
height: a.height
};
}
function n8(t) {
var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = [];
t.forEach(function(o) {
e.set(o.name, o);
});
function i(o) {
n.add(o.name);
var a = [].concat(o.requires || [], o.requiresIfExists || []);
a.forEach(function(s) {
if (!n.has(s)) {
var u = e.get(s);
u && i(u);
}
}), r.push(o);
}
return t.forEach(function(o) {
n.has(o.name) || i(o);
}), r;
}
function r8(t) {
var e = n8(t);
return mx.reduce(function(n, r) {
return n.concat(e.filter(function(i) {
return i.phase === r;
}));
}, []);
}
function i8(t) {
var e;
return function() {
return e || (e = new Promise(function(n) {
Promise.resolve().then(function() {
e = void 0, n(t());
});
})), e;
};
}
function o8(t) {
var e = t.reduce(function(n, r) {
var i = n[r.name];
return n[r.name] = i ? Object.assign({}, i, r, {
options: Object.assign({}, i.options, r.options),
data: Object.assign({}, i.data, r.data)
}) : r, n;
}, {});
return Object.keys(e).map(function(n) {
return e[n];
});
}
var Am = {
placement: "bottom",
modifiers: [],
strategy: "absolute"
};
function Mm() {
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
e[n] = arguments[n];
return !e.some(function(r) {
return !(r && typeof r.getBoundingClientRect == "function");
});
}
function a8(t) {
t === void 0 && (t = {});
var e = t, n = e.defaultModifiers, r = n === void 0 ? [] : n, i = e.defaultOptions, o = i === void 0 ? Am : i;
return function(s, u, l) {
l === void 0 && (l = o);
var c = {
placement: "bottom",
orderedModifiers: [],
options: Object.assign({}, Am, o),
modifiersData: {},
elements: {
reference: s,
popper: u
},
attributes: {},
styles: {}
}, f = [], d = !1, p = {
state: c,
setOptions: function(y) {
var k = typeof y == "function" ? y(c.options) : y;
m(), c.options = Object.assign({}, o, c.options, k), c.scrollParents = {
reference: Lo(s) ? ks(s) : s.contextElement ? ks(s.contextElement) : [],
popper: ks(u)
};
var T = r8(o8([].concat(r, c.options.modifiers)));
return c.orderedModifiers = T.filter(function(b) {
return b.enabled;
}), h(), p.update();
},
// Sync update – it will always be executed, even if not necessary. This
// is useful for low frequency updates where sync behavior simplifies the
// logic.
// For high frequency updates (e.g. `resize` and `scroll` events), always
// prefer the async Popper#update method
forceUpdate: function() {
if (!d) {
var y = c.elements, k = y.reference, T = y.popper;
if (Mm(k, T)) {
c.rects = {
reference: t8(k, mu(T), c.options.strategy === "fixed"),
popper: wp(T)
}, c.reset = !1, c.placement = c.options.placement, c.orderedModifiers.forEach(function(R) {
return c.modifiersData[R.name] = Object.assign({}, R.data);
});
for (var b = 0; b < c.orderedModifiers.length; b++) {
if (c.reset === !0) {
c.reset = !1, b = -1;
continue;
}
var D = c.orderedModifiers[b], x = D.fn, S = D.options, _ = S === void 0 ? {} : S, N = D.name;
typeof x == "function" && (c = x({
state: c,
options: _,
name: N,
instance: p
}) || c);
}
}
}
},
// Async and optimistically optimized update – it will not be executed if
// not necessary (debounced to run at most once-per-tick)
update: i8(function() {
return new Promise(function(v) {
p.forceUpdate(), v(c);
});
}),
destroy: function() {
m(), d = !0;
}
};
if (!Mm(s, u))
return p;
p.setOptions(l).then(function(v) {
!d && l.onFirstUpdate && l.onFirstUpdate(v);
});
function h() {
c.orderedModifiers.forEach(function(v) {
var y = v.name, k = v.options, T = k === void 0 ? {} : k, b = v.effect;
if (typeof b == "function") {
var D = b({
state: c,
name: y,
instance: p,
options: T
}), x = function() {
};
f.push(D || x);
}
});
}
function m() {
f.forEach(function(v) {
return v();
}), f = [];
}
return p;
};
}
var s8 = [Mx, Kx, Ox, Rv, Wx, Hx, Xx, Ex, Fx], Hc = /* @__PURE__ */ a8({
defaultModifiers: s8
}), u8 = "tippy-box", Uv = "tippy-content", l8 = "tippy-backdrop", Wv = "tippy-arrow", Yv = "tippy-svg-arrow", ao = {
passive: !0,
capture: !0
}, Kv = function() {
return document.body;
};
function c8(t, e) {
return {}.hasOwnProperty.call(t, e);
}
function Ad(t, e, n) {
if (Array.isArray(t)) {
var r = t[e];
return r ?? (Array.isArray(n) ? n[e] : n);
}
return t;
}
function _p(t, e) {
var n = {}.toString.call(t);
return n.indexOf("[object") === 0 && n.indexOf(e + "]") > -1;
}
function Gv(t, e) {
return typeof t == "function" ? t.apply(void 0, e) : t;
}
function Dm(t, e) {
if (e === 0)
return t;
var n;
return function(r) {
clearTimeout(n), n = setTimeout(function() {
t(r);
}, e);
};
}
function d8(t, e) {
var n = Object.assign({}, t);
return e.forEach(function(r) {
delete n[r];
}), n;
}
function f8(t) {
return t.split(/\s+/).filter(Boolean);
}
function ia(t) {
return [].concat(t);
}
function $m(t, e) {
t.indexOf(e) === -1 && t.push(e);
}
function p8(t) {
return t.filter(function(e, n) {
return t.indexOf(e) === n;
});
}
function h8(t) {
return t.split("-")[0];
}
function Dl(t) {
return [].slice.call(t);
}
function Nm(t) {
return Object.keys(t).reduce(function(e, n) {
return t[n] !== void 0 && (e[n] = t[n]), e;
}, {});
}
function xs() {
return document.createElement("div");
}
function Ws(t) {
return ["Element", "Fragment"].some(function(e) {
return _p(t, e);
});
}
function m8(t) {
return _p(t, "NodeList");
}
function g8(t) {
return _p(t, "MouseEvent");
}
function b8(t) {
return !!(t && t._tippy && t._tippy.reference === t);
}
function v8(t) {
return Ws(t) ? [t] : m8(t) ? Dl(t) : Array.isArray(t) ? t : Dl(document.querySelectorAll(t));
}
function Md(t, e) {
t.forEach(function(n) {
n && (n.style.transitionDuration = e + "ms");
});
}
function Pm(t, e) {
t.forEach(function(n) {
n && n.setAttribute("data-state", e);
});
}
function y8(t) {
var e, n = ia(t), r = n[0];
return r != null && (e = r.ownerDocument) != null && e.body ? r.ownerDocument : document;
}
function w8(t, e) {
var n = e.clientX, r = e.clientY;
return t.every(function(i) {
var o = i.popperRect, a = i.popperState, s = i.props, u = s.interactiveBorder, l = h8(a.placement), c = a.modifiersData.offset;
if (!c)
return !0;
var f = l === "bottom" ? c.top.y : 0, d = l === "top" ? c.bottom.y : 0, p = l === "right" ? c.left.x : 0, h = l === "left" ? c.right.x : 0, m = o.top - r + f > u, v = r - o.bottom - d > u, y = o.left - n + p > u, k = n - o.right - h > u;
return m || v || y || k;
});
}
function Dd(t, e, n) {
var r = e + "EventListener";
["transitionend", "webkitTransitionEnd"].forEach(function(i) {
t[r](i, n);
});
}
function Im(t, e) {
for (var n = e; n; ) {
var r;
if (t.contains(n))
return !0;
n = n.getRootNode == null || (r = n.getRootNode()) == null ? void 0 : r.host;
}
return !1;
}
var Dr = {
isTouch: !1
}, Lm = 0;
function k8() {
Dr.isTouch || (Dr.isTouch = !0, window.performance && document.addEventListener("mousemove", Jv));
}
function Jv() {
var t = performance.now();
t - Lm < 20 && (Dr.isTouch = !1, document.removeEventListener("mousemove", Jv)), Lm = t;
}
function x8() {
var t = document.activeElement;
if (b8(t)) {
var e = t._tippy;
t.blur && !e.state.isVisible && t.blur();
}
}
function S8() {
document.addEventListener("touchstart", k8, ao), window.addEventListener("blur", x8);
}
var E8 = typeof window < "u" && typeof document < "u", _8 = E8 ? (
// @ts-ignore
!!window.msCrypto
) : !1;
function Jo(t) {
var e = t === "destroy" ? "n already-" : " ";
return [t + "() was called on a" + e + "destroyed instance. This is a no-op but", "indicates a potential memory leak."].join(" ");
}
function Rm(t) {
var e = /[ \t]{2,}/g, n = /^[ \t]*/gm;
return t.replace(e, " ").replace(n, "").trim();
}
function T8(t) {
return Rm(`
%ctippy.js
%c` + Rm(t) + `
%c👷 This is a development-only message. It will be removed in production.
`);
}
function Xv(t) {
return [
T8(t),
// title
"color: #00C584; font-size: 1.3em; font-weight: bold;",
// message
"line-height: 1.5",
// footer
"color: #a6a095;"
];
}
var Ys;
process.env.NODE_ENV !== "production" && C8();
function C8() {
Ys = /* @__PURE__ */ new Set();
}
function oi(t, e) {
if (t && !Ys.has(e)) {
var n;
Ys.add(e), (n = console).warn.apply(n, Xv(e));
}
}
function qf(t, e) {
if (t && !Ys.has(e)) {
var n;
Ys.add(e), (n = console).error.apply(n, Xv(e));
}
}
function O8(t) {
var e = !t, n = Object.prototype.toString.call(t) === "[object Object]" && !t.addEventListener;
qf(e, ["tippy() was passed", "`" + String(t) + "`", "as its targets (first) argument. Valid types are: String, Element,", "Element[], or NodeList."].join(" ")), qf(n, ["tippy() was passed a plain object which is not supported as an argument", "for virtual positioning. Use props.getReferenceClientRect instead."].join(" "));
}
var Qv = {
animateFill: !1,
followCursor: !1,
inlinePositioning: !1,
sticky: !1
}, A8 = {
allowHTML: !1,
animation: "fade",
arrow: !0,
content: "",
inertia: !1,
maxWidth: 350,
role: "tooltip",
theme: "",
zIndex: 9999
}, Wn = Object.assign({
appendTo: Kv,
aria: {
content: "auto",
expanded: "auto"
},
delay: 0,
duration: [300, 250],
getReferenceClientRect: null,
hideOnClick: !0,
ignoreAttributes: !1,
interactive: !1,
interactiveBorder: 2,
interactiveDebounce: 0,
moveTransition: "",
offset: [0, 10],
onAfterUpdate: function() {
},
onBeforeUpdate: function() {
},
onCreate: function() {
},
onDestroy: function() {
},
onHidden: function() {
},
onHide: function() {
},
onMount: function() {
},
onShow: function() {
},
onShown: function() {
},
onTrigger: function() {
},
onUntrigger: function() {
},
onClickOutside: function() {
},
placement: "top",
plugins: [],
popperOptions: {},
render: null,
showOnCreate: !1,
touch: !0,
trigger: "mouseenter focus",
triggerTarget: null
}, Qv, A8), M8 = Object.keys(Wn), D8 = function(e) {
process.env.NODE_ENV !== "production" && ey(e, []);
var n = Object.keys(e);
n.forEach(function(r) {
Wn[r] = e[r];
});
};
function Zv(t) {
var e = t.plugins || [], n = e.reduce(function(r, i) {
var o = i.name, a = i.defaultValue;
if (o) {
var s;
r[o] = t[o] !== void 0 ? t[o] : (s = Wn[o]) != null ? s : a;
}
return r;
}, {});
return Object.assign({}, t, n);
}
function $8(t, e) {
var n = e ? Object.keys(Zv(Object.assign({}, Wn, {
plugins: e
}))) : M8, r = n.reduce(function(i, o) {
var a = (t.getAttribute("data-tippy-" + o) || "").trim();
if (!a)
return i;
if (o === "content")
i[o] = a;
else
try {
i[o] = JSON.parse(a);
} catch {
i[o] = a;
}
return i;
}, {});
return r;
}
function Bm(t, e) {
var n = Object.assign({}, e, {
content: Gv(e.content, [t])
}, e.ignoreAttributes ? {} : $8(t, e.plugins));
return n.aria = Object.assign({}, Wn.aria, n.aria), n.aria = {
expanded: n.aria.expanded === "auto" ? e.interactive : n.aria.expanded,
content: n.aria.content === "auto" ? e.interactive ? null : "describedby" : n.aria.content
}, n;
}
function ey(t, e) {
t === void 0 && (t = {}), e === void 0 && (e = []);
var n = Object.keys(t);
n.forEach(function(r) {
var i = d8(Wn, Object.keys(Qv)), o = !c8(i, r);
o && (o = e.filter(function(a) {
return a.name === r;
}).length === 0), oi(o, ["`" + r + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", "a plugin, forgot to pass it in an array as props.plugins.", `
`, `All props: https://atomiks.github.io/tippyjs/v6/all-props/
`, "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "));
});
}
var N8 = function() {
return "innerHTML";
};
function Ff(t, e) {
t[N8()] = e;
}
function Vm(t) {
var e = xs();
return t === !0 ? e.className = Wv : (e.className = Yv, Ws(t) ? e.appendChild(t) : Ff(e, t)), e;
}
function zm(t, e) {
Ws(e.content) ? (Ff(t, ""), t.appendChild(e.content)) : typeof e.content != "function" && (e.allowHTML ? Ff(t, e.content) : t.textContent = e.content);
}
function jf(t) {
var e = t.firstElementChild, n = Dl(e.children);
return {
box: e,
content: n.find(function(r) {
return r.classList.contains(Uv);
}),
arrow: n.find(function(r) {
return r.classList.contains(Wv) || r.classList.contains(Yv);
}),
backdrop: n.find(function(r) {
return r.classList.contains(l8);
})
};
}
function ty(t) {
var e = xs(), n = xs();
n.className = u8, n.setAttribute("data-state", "hidden"), n.setAttribute("tabindex", "-1");
var r = xs();
r.className = Uv, r.setAttribute("data-state", "hidden"), zm(r, t.props), e.appendChild(n), n.appendChild(r), i(t.props, t.props);
function i(o, a) {
var s = jf(e), u = s.box, l = s.content, c = s.arrow;
a.theme ? u.setAttribute("data-theme", a.theme) : u.removeAttribute("data-theme"), typeof a.animation == "string" ? u.setAttribute("data-animation", a.animation) : u.removeAttribute("data-animation"), a.inertia ? u.setAttribute("data-inertia", "") : u.removeAttribute("data-inertia"), u.style.maxWidth = typeof a.maxWidth == "number" ? a.maxWidth + "px" : a.maxWidth, a.role ? u.setAttribute("role", a.role) : u.removeAttribute("role"), (o.content !== a.content || o.allowHTML !== a.allowHTML) && zm(l, t.props), a.arrow ? c ? o.arrow !== a.arrow && (u.removeChild(c), u.appendChild(Vm(a.arrow))) : u.appendChild(Vm(a.arrow)) : c && u.removeChild(c);
}
return {
popper: e,
onUpdate: i
};
}
ty.$$tippy = !0;
var P8 = 1, Mu = [], $d = [];
function I8(t, e) {
var n = Bm(t, Object.assign({}, Wn, Zv(Nm(e)))), r, i, o, a = !1, s = !1, u = !1, l = !1, c, f, d, p = [], h = Dm(ye, n.interactiveDebounce), m, v = P8++, y = null, k = p8(n.plugins), T = {
// Is the instance currently enabled?
isEnabled: !0,
// Is the tippy currently showing and not transitioning out?
isVisible: !1,
// Has the instance been destroyed?
isDestroyed: !1,
// Is the tippy currently mounted to the DOM?
isMounted: !1,
// Has the tippy finished transitioning in?
isShown: !1
}, b = {
// properties
id: v,
reference: t,
popper: xs(),
popperInstance: y,
props: n,
state: T,
plugins: k,
// methods
clearDelayTimeouts: Hn,
setProps: qn,
setContent: An,
show: G,
hide: fe,
hideWithInteractivity: Ne,
enable: qt,
disable: Ut,
unmount: Be,
destroy: ht
};
if (!n.render)
return process.env.NODE_ENV !== "production" && qf(!0, "render() function has not been supplied."), b;
var D = n.render(b), x = D.popper, S = D.onUpdate;
x.setAttribute("data-tippy-root", ""), x.id = "tippy-" + b.id, b.popper = x, t._tippy = b, x._tippy = b;
var _ = k.map(function(B) {
return B.fn(b);
}), N = t.hasAttribute("aria-expanded");
return ke(), z(), g(), M("onCreate", [b]), n.showOnCreate && Rt(), x.addEventListener("mouseenter", function() {
b.props.interactive && b.state.isVisible && b.clearDelayTimeouts();
}), x.addEventListener("mouseleave", function() {
b.props.interactive && b.props.trigger.indexOf("mouseenter") >= 0 && I().addEventListener("mousemove", h);
}), b;
function R() {
var B = b.props.touch;
return Array.isArray(B) ? B : [B, 0];
}
function w() {
return R()[0] === "hold";
}
function A() {
var B;
return !!((B = b.props.render) != null && B.$$tippy);
}
function $() {
return m || t;
}
function I() {
var B = $().parentNode;
return B ? y8(B) : document;
}
function E() {
return jf(x);
}
function O(B) {
return b.state.isMounted && !b.state.isVisible || Dr.isTouch || c && c.type === "focus" ? 0 : Ad(b.props.delay, B ? 0 : 1, Wn.delay);
}
function g(B) {
B === void 0 && (B = !1), x.style.pointerEvents = b.props.interactive && !B ? "" : "none", x.style.zIndex = "" + b.props.zIndex;
}
function M(B, ie, j) {
if (j === void 0 && (j = !0), _.forEach(function(we) {
we[B] && we[B].apply(we, ie);
}), j) {
var ue;
(ue = b.props)[B].apply(ue, ie);
}
}
function H() {
var B = b.props.aria;
if (B.content) {
var ie = "aria-" + B.content, j = x.id, ue = ia(b.props.triggerTarget || t);
ue.forEach(function(we) {
var Ue = we.getAttribute(ie);
if (b.state.isVisible)
we.setAttribute(ie, Ue ? Ue + " " + j : j);
else {
var mt = Ue && Ue.replace(j, "").trim();
mt ? we.setAttribute(ie, mt) : we.removeAttribute(ie);
}
});
}
}
function z() {
if (!(N || !b.props.aria.expanded)) {
var B = ia(b.props.triggerTarget || t);
B.forEach(function(ie) {
b.props.interactive ? ie.setAttribute("aria-expanded", b.state.isVisible && ie === $() ? "true" : "false") : ie.removeAttribute("aria-expanded");
});
}
}
function Y() {
I().removeEventListener("mousemove", h), Mu = Mu.filter(function(B) {
return B !== h;
});
}
function ee(B) {
if (!(Dr.isTouch && (u || B.type === "mousedown"))) {
var ie = B.composedPath && B.composedPath()[0] || B.target;
if (!(b.props.interactive && Im(x, ie))) {
if (ia(b.props.triggerTarget || t).some(function(j) {
return Im(j, ie);
})) {
if (Dr.isTouch || b.state.isVisible && b.props.trigger.indexOf("click") >= 0)
return;
} else
M("onClickOutside", [b, B]);
b.props.hideOnClick === !0 && (b.clearDelayTimeouts(), b.hide(), s = !0, setTimeout(function() {
s = !1;
}), b.state.isMounted || te());
}
}
}
function ce() {
u = !0;
}
function q() {
u = !1;
}
function V() {
var B = I();
B.addEventListener("mousedown", ee, !0), B.addEventListener("touchend", ee, ao), B.addEventListener("touchstart", q, ao), B.addEventListener("touchmove", ce, ao);
}
function te() {
var B = I();
B.removeEventListener("mousedown", ee, !0), B.removeEventListener("touchend", ee, ao), B.removeEventListener("touchstart", q, ao), B.removeEventListener("touchmove", ce, ao);
}
function K(B, ie) {
Z(B, function() {
!b.state.isVisible && x.parentNode && x.parentNode.contains(x) && ie();
});
}
function Q(B, ie) {
Z(B, ie);
}
function Z(B, ie) {
var j = E().box;
function ue(we) {
we.target === j && (Dd(j, "remove", ue), ie());
}
if (B === 0)
return ie();
Dd(j, "remove", f), Dd(j, "add", ue), f = ue;
}
function ae(B, ie, j) {
j === void 0 && (j = !1);
var ue = ia(b.props.triggerTarget || t);
ue.forEach(function(we) {
we.addEventListener(B, ie, j), p.push({
node: we,
eventType: B,
handler: ie,
options: j
});
});
}
function ke() {
w() && (ae("touchstart", de, {
passive: !0
}), ae("touchend", xe, {
passive: !0
})), f8(b.props.trigger).forEach(function(B) {
if (B !== "manual")
switch (ae(B, de), B) {
case "mouseenter":
ae("mouseleave", xe);
break;
case "focus":
ae(_8 ? "focusout" : "blur", ct);
break;
case "focusin":
ae("focusout", ct);
break;
}
});
}
function ge() {
p.forEach(function(B) {
var ie = B.node, j = B.eventType, ue = B.handler, we = B.options;
ie.removeEventListener(j, ue, we);
}), p = [];
}
function de(B) {
var ie, j = !1;
if (!(!b.state.isEnabled || le(B) || s)) {
var ue = ((ie = c) == null ? void 0 : ie.type) === "focus";
c = B, m = B.currentTarget, z(), !b.state.isVisible && g8(B) && Mu.forEach(function(we) {
return we(B);
}), B.type === "click" && (b.props.trigger.indexOf("mouseenter") < 0 || a) && b.props.hideOnClick !== !1 && b.state.isVisible ? j = !0 : Rt(B), B.type === "click" && (a = !j), j && !ue && xt(B);
}
}
function ye(B) {
var ie = B.target, j = $().contains(ie) || x.contains(ie);
if (!(B.type === "mousemove" && j)) {
var ue = ot().concat(x).map(function(we) {
var Ue, mt = we._tippy, Ae = (Ue = mt.popperInstance) == null ? void 0 : Ue.state;
return Ae ? {
popperRect: we.getBoundingClientRect(),
popperState: Ae,
props: n
} : null;
}).filter(Boolean);
w8(ue, B) && (Y(), xt(B));
}
}
function xe(B) {
var ie = le(B) || b.props.trigger.indexOf("click") >= 0 && a;
if (!ie) {
if (b.props.interactive) {
b.hideWithInteractivity(B);
return;
}
xt(B);
}
}
function ct(B) {
b.props.trigger.indexOf("focusin") < 0 && B.target !== $() || b.props.interactive && B.relatedTarget && x.contains(B.relatedTarget) || xt(B);
}
function le(B) {
return Dr.isTouch ? w() !== B.type.indexOf("touch") >= 0 : !1;
}
function je() {
We();
var B = b.props, ie = B.popperOptions, j = B.placement, ue = B.offset, we = B.getReferenceClientRect, Ue = B.moveTransition, mt = A() ? jf(x).arrow : null, Ae = we ? {
getBoundingClientRect: we,
contextElement: we.contextElement || $()
} : t, tr = {
name: "$$tippy",
enabled: !0,
phase: "beforeWrite",
requires: ["computeStyles"],
fn: function(Fn) {
var jn = Fn.state;
if (A()) {
var Sd = E(), eo = Sd.box;
["placement", "reference-hidden", "escaped"].forEach(function(Qr) {
Qr === "placement" ? eo.setAttribute("data-placement", jn.placement) : jn.attributes.popper["data-popper-" + Qr] ? eo.setAttribute("data-" + Qr, "") : eo.removeAttribute("data-" + Qr);
}), jn.attributes.popper = {};
}
}
}, ze = [{
name: "offset",
options: {
offset: ue
}
}, {
name: "preventOverflow",
options: {
padding: {
top: 2,
bottom: 2,
left: 5,
right: 5
}
}
}, {
name: "flip",
options: {
padding: 5
}
}, {
name: "computeStyles",
options: {
adaptive: !Ue
}
}, tr];
A() && mt && ze.push({
name: "arrow",
options: {
element: mt,
padding: 3
}
}), ze.push.apply(ze, (ie == null ? void 0 : ie.modifiers) || []), b.popperInstance = Hc(Ae, x, Object.assign({}, ie, {
placement: j,
onFirstUpdate: d,
modifiers: ze
}));
}
function We() {
b.popperInstance && (b.popperInstance.destroy(), b.popperInstance = null);
}
function Ke() {
var B = b.props.appendTo, ie, j = $();
b.props.interactive && B === Kv || B === "parent" ? ie = j.parentNode : ie = Gv(B, [j]), ie.contains(x) || ie.appendChild(x), b.state.isMounted = !0, je(), process.env.NODE_ENV !== "production" && oi(b.props.interactive && B === Wn.appendTo && j.nextElementSibling !== x, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", `
`, "Using a wrapper <div> or <span> tag around the reference element", "solves this by creating a new parentNode context.", `
`, "Specifying `appendTo: document.body` silences this warning, but it", "assumes you are using a focus management solution to handle", "keyboard navigation.", `
`, "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "));
}
function ot() {
return Dl(x.querySelectorAll("[data-tippy-root]"));
}
function Rt(B) {
b.clearDelayTimeouts(), B && M("onTrigger", [b, B]), V();
var ie = O(!0), j = R(), ue = j[0], we = j[1];
Dr.isTouch && ue === "hold" && we && (ie = we), ie ? r = setTimeout(function() {
b.show();
}, ie) : b.show();
}
function xt(B) {
if (b.clearDelayTimeouts(), M("onUntrigger", [b, B]), !b.state.isVisible) {
te();
return;
}
if (!(b.props.trigger.indexOf("mouseenter") >= 0 && b.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(B.type) >= 0 && a)) {
var ie = O(!1);
ie ? i = setTimeout(function() {
b.state.isVisible && b.hide();
}, ie) : o = requestAnimationFrame(function() {
b.hide();
});
}
}
function qt() {
b.state.isEnabled = !0;
}
function Ut() {
b.hide(), b.state.isEnabled = !1;
}
function Hn() {
clearTimeout(r), clearTimeout(i), cancelAnimationFrame(o);
}
function qn(B) {
if (process.env.NODE_ENV !== "production" && oi(b.state.isDestroyed, Jo("setProps")), !b.state.isDestroyed) {
M("onBeforeUpdate", [b, B]), ge();
var ie = b.props, j = Bm(t, Object.assign({}, ie, Nm(B), {
ignoreAttributes: !0
}));
b.props = j, ke(), ie.interactiveDebounce !== j.interactiveDebounce && (Y(), h = Dm(ye, j.interactiveDebounce)), ie.triggerTarget && !j.triggerTarget ? ia(ie.triggerTarget).forEach(function(ue) {
ue.removeAttribute("aria-expanded");
}) : j.triggerTarget && t.removeAttribute("aria-expanded"), z(), g(), S && S(ie, j), b.popperInstance && (je(), ot().forEach(function(ue) {
requestAnimationFrame(ue._tippy.popperInstance.forceUpdate);
})), M("onAfterUpdate", [b, B]);
}
}
function An(B) {
b.setProps({
content: B
});
}
function G() {
process.env.NODE_ENV !== "production" && oi(b.state.isDestroyed, Jo("show"));
var B = b.state.isVisible, ie = b.state.isDestroyed, j = !b.state.isEnabled, ue = Dr.isTouch && !b.props.touch, we = Ad(b.props.duration, 0, Wn.duration);
if (!(B || ie || j || ue) && !$().hasAttribute("disabled") && (M("onShow", [b], !1), b.props.onShow(b) !== !1)) {
if (b.state.isVisible = !0, A() && (x.style.visibility = "visible"), g(), V(), b.state.isMounted || (x.style.transition = "none"), A()) {
var Ue = E(), mt = Ue.box, Ae = Ue.content;
Md([mt, Ae], 0);
}
d = function() {
var ze;
if (!(!b.state.isVisible || l)) {
if (l = !0, x.offsetHeight, x.style.transition = b.props.moveTransition, A() && b.props.animation) {
var Xr = E(), Fn = Xr.box, jn = Xr.content;
Md([Fn, jn], we), Pm([Fn, jn], "visible");
}
H(), z(), $m($d, b), (ze = b.popperInstance) == null || ze.forceUpdate(), M("onMount", [b]), b.props.animation && A() && Q(we, function() {
b.state.isShown = !0, M("onShown", [b]);
});
}
}, Ke();
}
}
function fe() {
process.env.NODE_ENV !== "production" && oi(b.state.isDestroyed, Jo("hide"));
var B = !b.state.isVisible, ie = b.state.isDestroyed, j = !b.state.isEnabled, ue = Ad(b.props.duration, 1, Wn.duration);
if (!(B || ie || j) && (M("onHide", [b], !1), b.props.onHide(b) !== !1)) {
if (b.state.isVisible = !1, b.state.isShown = !1, l = !1, a = !1, A() && (x.style.visibility = "hidden"), Y(), te(), g(!0), A()) {
var we = E(), Ue = we.box, mt = we.content;
b.props.animation && (Md([Ue, mt], ue), Pm([Ue, mt], "hidden"));
}
H(), z(), b.props.animation ? A() && K(ue, b.unmount) : b.unmount();
}
}
function Ne(B) {
process.env.NODE_ENV !== "production" && oi(b.state.isDestroyed, Jo("hideWithInteractivity")), I().addEventListener("mousemove", h), $m(Mu, h), h(B);
}
function Be() {
process.env.NODE_ENV !== "production" && oi(b.state.isDestroyed, Jo("unmount")), b.state.isVisible && b.hide(), b.state.isMounted && (We(), ot().forEach(function(B) {
B._tippy.unmount();
}), x.parentNode && x.parentNode.removeChild(x), $d = $d.filter(function(B) {
return B !== b;
}), b.state.isMounted = !1, M("onHidden", [b]));
}
function ht() {
process.env.NODE_ENV !== "production" && oi(b.state.isDestroyed, Jo("destroy")), !b.state.isDestroyed && (b.clearDelayTimeouts(), b.unmount(), ge(), delete t._tippy, b.state.isDestroyed = !0, M("onDestroy", [b]));
}
}
function Uo(t, e) {
e === void 0 && (e = {});
var n = Wn.plugins.concat(e.plugins || []);
process.env.NODE_ENV !== "production" && (O8(t), ey(e, n)), S8();
var r = Object.assign({}, e, {
plugins: n
}), i = v8(t);
if (process.env.NODE_ENV !== "production") {
var o = Ws(r.content), a = i.length > 1;
oi(o && a, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", `
`, "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", `
`, `1) content: element.innerHTML
`, "2) content: () => element.cloneNode(true)"].join(" "));
}
var s = i.reduce(function(u, l) {
var c = l && I8(l, r);
return c && u.push(c), u;
}, []);
return Ws(t) ? s[0] : s;
}
Uo.defaultProps = Wn;
Uo.setDefaultProps = D8;
Uo.currentInput = Dr;
Object.assign({}, Rv, {
effect: function(e) {
var n = e.state, r = {
popper: {
position: n.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
Object.assign(n.elements.popper.style, r.popper), n.styles = r, n.elements.arrow && Object.assign(n.elements.arrow.style, r.arrow);
}
});
Uo.setDefaultProps({
render: ty
});
var De = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Ui(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function L8(t) {
if (t.__esModule)
return t;
var e = t.default;
if (typeof e == "function") {
var n = function r() {
return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
};
n.prototype = e.prototype;
} else
n = {};
return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(t).forEach(function(r) {
var i = Object.getOwnPropertyDescriptor(t, r);
Object.defineProperty(n, r, i.get ? i : {
enumerable: !0,
get: function() {
return t[r];
}
});
}), n;
}
var ny = { exports: {} };
(function(t) {
(function(e, n) {
t.exports = n();
})(De, function() {
var e = Object.prototype.toString;
function n(f, d) {
return f == null ? !1 : Object.prototype.hasOwnProperty.call(f, d);
}
function r(f) {
if (!f || a(f) && f.length === 0)
return !0;
if (typeof f != "string") {
for (var d in f)
if (n(f, d))
return !1;
return !0;
}
return !1;
}
function i(f) {
return e.call(f);
}
function o(f) {
return typeof f == "object" && i(f) === "[object Object]";
}
var a = Array.isArray || function(f) {
return e.call(f) === "[object Array]";
};
function s(f) {
return typeof f == "boolean" || i(f) === "[object Boolean]";
}
function u(f) {
var d = parseInt(f);
return d.toString() === f ? d : f;
}
function l(f) {
f = f || {};
var d = function(y) {
return Object.keys(d).reduce(function(k, T) {
return T === "create" || typeof d[T] == "function" && (k[T] = d[T].bind(d, y)), k;
}, {});
}, p;
f.includeInheritedProps ? p = function() {
return !0;
} : p = function(y, k) {
return typeof k == "number" && Array.isArray(y) || n(y, k);
};
function h(y, k) {
if (p(y, k))
return y[k];
}
var m;
f.includeInheritedProps ? m = function(y, k) {
typeof k != "string" && typeof k != "number" && (k = String(k));
var T = h(y, k);
if (k === "__proto__" || k === "prototype" || k === "constructor" && typeof T == "function")
throw new Error("For security reasons, object's magic properties cannot be set");
return T;
} : m = function(y, k) {
return h(y, k);
};
function v(y, k, T, b) {
if (typeof k == "number" && (k = [k]), !k || k.length === 0)
return y;
if (typeof k == "string")
return v(y, k.split(".").map(u), T, b);
var D = k[0], x = m(y, D);
return k.length === 1 ? ((x === void 0 || !b) && (y[D] = T), x) : (x === void 0 && (typeof k[1] == "number" ? y[D] = [] : y[D] = {}), v(y[D], k.slice(1), T, b));
}
return d.has = function(y, k) {
if (typeof k == "number" ? k = [k] : typeof k == "string" && (k = k.split(".")), !k || k.length === 0)
return !!y;
for (var T = 0; T < k.length; T++) {
var b = u(k[T]);
if (typeof b == "number" && a(y) && b < y.length || (f.includeInheritedProps ? b in Object(y) : n(y, b)))
y = y[b];
else
return !1;
}
return !0;
}, d.ensureExists = function(y, k, T) {
return v(y, k, T, !0);
}, d.set = function(y, k, T, b) {
return v(y, k, T, b);
}, d.insert = function(y, k, T, b) {
var D = d.get(y, k);
b = ~~b, a(D) || (D = [], d.set(y, k, D)), D.splice(b, 0, T);
}, d.empty = function(y, k) {
if (!r(k) && y != null) {
var T, b;
if (T = d.get(y, k)) {
if (typeof T == "string")
return d.set(y, k, "");
if (s(T))
return d.set(y, k, !1);
if (typeof T == "number")
return d.set(y, k, 0);
if (a(T))
T.length = 0;
else if (o(T))
for (b in T)
p(T, b) && delete T[b];
else
return d.set(y, k, null);
}
}
}, d.push = function(y, k) {
var T = d.get(y, k);
a(T) || (T = [], d.set(y, k, T)), T.push.apply(T, Array.prototype.slice.call(arguments, 2));
}, d.coalesce = function(y, k, T) {
for (var b, D = 0, x = k.length; D < x; D++)
if ((b = d.get(y, k[D])) !== void 0)
return b;
return T;
}, d.get = function(y, k, T) {
if (typeof k == "number" && (k = [k]), !k || k.length === 0)
return y;
if (y == null)
return T;
if (typeof k == "string")
return d.get(y, k.split("."), T);
var b = u(k[0]), D = m(y, b);
return D === void 0 ? T : k.length === 1 ? D : d.get(y[b], k.slice(1), T);
}, d.del = function(k, T) {
if (typeof T == "number" && (T = [T]), k == null || r(T))
return k;
if (typeof T == "string")
return d.del(k, T.split("."));
var b = u(T[0]);
if (m(k, b), !p(k, b))
return k;
if (T.length === 1)
a(k) ? k.splice(b, 1) : delete k[b];
else
return d.del(k[b], T.slice(1));
return k;
}, d;
}
var c = l();
return c.create = l, c.withInheritedProps = l({ includeInheritedProps: !0 }), c;
});
})(ny);
var R8 = ny.exports;
const Nd = /* @__PURE__ */ Ui(R8);
var B8 = /* @__PURE__ */ ((t) => (t.AdventurerNeutral = "adventurer-neutral", t.AvataaarsNeutral = "avataaars-neutral", t.BigEarsNeutral = "big-ears-neutral", t.BigSmile = "big-smile", t.BotttsNeutral = "bottts-neutral", t.Croodles = "croodles", t.CroodlesNeutral = "croodles-neutral", t.Initials = "initials", t.Lorelei = "lorelei", t.LoreleiNeutral = "lorelei-neutral", t.Micah = "micah", t.Miniavs = "miniavs", t.Notionists = "notionists", t.NotionistsNeutral = "notionists-neutral", t.OpenPeeps = "open-peeps", t.Thumbs = "thumbs", t))(B8 || {});
const Hm = {
// General
name: "Kodama",
version: "0.1.0",
///////////////
// Branding
///////////////
darkMode: !1,
logo: {
favicon: "https://kodamaui.s3.eu-west-1.amazonaws.com/logos/favicon.png",
dark: "https://kodamaui.s3.eu-west-1.amazonaws.com/logos/logo-dark.png",
light: "https://kodamaui.s3.eu-west-1.amazonaws.com/logos/logo.png",
side_dark: "https://kodamaui.s3.eu-west-1.amazonaws.com/logos/sidelogo-dark.png",
side_light: "https://kodamaui.s3.eu-west-1.amazonaws.com/logos/sidelogo.png"
},
copyright: {
text: "Kodama UI",
link: "https://calltek.es"
},
avatarType: "notionists-neutral",
///////////////
// Router
///////////////
routes: {
homepage: "/",
profile: "",
configuration: ""
},
///////////////
// Auth
///////////////
auth: {
background: "",
signup: !1
},
///////////////
// Views
///////////////
changelog: !1,
///////////////
// Responsive
///////////////
isMobileView: !1,
isTabletView: !1,
///////////////
// Layout
///////////////
aside: {
collapsed: !0
},
menuType: "default",
///////////////
// Vendor
///////////////
vendor: {
fontAwesomeKit: "",
sentryDSN: ""
},
///////////////
// Locale
///////////////
locale: {
current: "es",
fallback: "es",
available: ["es"]
},
///////////////
// Developer
///////////////
debug: !1
}, Ht = dv("config", {
persist: !0,
state: () => ({
initialized: !1,
data: structuredClone(Hm)
}),
actions: {
init() {
this.initialized || (this.reset(), this.initialized = !0);
},
get(t, e) {
return t ? Nd.get(this.data, t, e) : this.data;
},
set(t, e) {
Nd.set(this.data, t, e);
},
reset() {
const e = Fo().proxy.settings || {};
Nd.set(this, "data", {
...structuredClone(Hm),
...structuredClone(e)
});
}
}
}), V8 = {
queries: {}
}, to = dv("query", {
persist: !0,
state: () => V8,
getters: {
get: (t) => (e) => t.queries[e] ? t.queries[e] : {
filter: null,
limit: 20,
order: null,
strict: !0
}
},
actions: {
clean() {
this.queries = {};
},
init(t, e) {
this.queries[t] = {
filter: (e == null ? void 0 : e.filter) || null,
limit: (e == null ? void 0 : e.limit) || 20,
order: (e == null ? void 0 : e.order) || null,
strict: (e == null ? void 0 : e.strict) || !0
};
},
order(t) {
const e = this;
return {
set(n, r) {
e.queries[t] === void 0 && e.init(t), e.queries[t].order ? e.queries[t].order[n] = r : e.queries[t].order = { [n]: r };
},
delete(n) {
return e.queries[t] !== void 0 && e.queries[t].order && e.queries[t].order[n] ? (delete e.queries[t].order[n], !0) : !1;
}
};
},
limit(t) {
const e = this;
return {
set(n) {
e.queries[t] === void 0 && e.init(t), e.queries[t].limit = n;
}
};
},
strict(t) {
const e = this;
return {
set(n) {
e.queries[t] === void 0 && e.init(t), e.queries[t].strict = n;
}
};
},
filter(t) {
const e = this;
return {
reset() {
e.init(t);
},
set(n, r) {
e.queries[t] === void 0 && e.init(t), e.queries[t].filter === null ? e.queries[t].filter = { [n]: r } : e.queries[t].filter[n] === void 0 && (e.queries[t].filter[n] = r);
},
delete(n) {
e.queries[t] !== void 0 && e.queries[t].filter[n] !== void 0 && delete e.queries[t].filter[n];
}
};
}
}
});
L(() => Ht().get());
L(() => Ht().get("name"));
const kW = L(() => Ht().get("version")), z8 = L(() => Ht().get("routes.homepage")), xW = L(() => Ht().get("routes")), H8 = L(() => Ht().get("logo")), q8 = L(() => Ht().get("copyright")), F8 = L(() => Ht().get("darkMode")), SW = L(() => F8.value ? "#1F2937" : "#F3F4F6"), EW = L(() => Ht().get("auth.background"));
L(() => Ht().get("auth.signup") === !0);
const j8 = L(() => Ht().get("changelog") === !0);
L(() => Ht().get("aside.collapsed") === !0);
const U8 = L(
() => Ht().get("vendor.fontAwesomeKit")
);
L(() => Ht().get("vendor.sentryDSN"));
L(() => Ht().get("debug"));
const W8 = be({
name: "KodamaUI",
setup() {
var f;
const t = Ht();
st(() => {
r(!0), window.addEventListener("resize", e);
}), qi(() => {
window.removeEventListener("resize", e);
});
const e = () => {
r(!1);
}, n = (d = !1, p = !1) => {
t.set("isMobileView", d), t.set("isTabletView", p);
}, r = (d = !0) => {
const p = t.get("isMobileView", !1), h = t.get("isTabletView", !1), m = window.innerWidth, v = {
next: {
mobile: m < 768,
tablet: m < 992,
desktop: !(m < 768) && !(m < 992)
},
prev: {
mobile: p,
tablet: h,
desktop: !p && !h
}
};
v.next.desktop && (v.next.desktop !== v.prev.desktop || d) && n(!1, !1), v.next.tablet && !v.next.mobile && (v.next.tablet !== v.prev.tablet || d) && n(!1, !0), v.next.mobile && (v.next.mobile !== v.prev.mobile || d) && n(!0, !1);
}, i = () => {
var d = document.querySelector('link[rel~="icon"]');
d || (d = document.createElement("link"), d.rel = "icon", document.getElementsByTagName("head")[0].appendChild(d)), d.href = H8.value.favicon;
}, o = () => {
const d = U8;
if (d) {
const p = document.createElement("script");
p.src = d.value, p.crossOrigin = "anonymous", document.head.prepend(p);
}
}, a = () => {
const d = document.createElement("link");
d.rel = "stylesheet", d.href = "https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&family=Rubik:wght@400;500;600;700&display=swap", document.head.prepend(d);
};
t.get("darkMode") && ((f = document.querySelector("html")) == null || f.classList.add("dark"));
const u = t.get("fontSize") || "medium", l = document.documentElement, c = {
small: ".8rem",
medium: ".9rem",
large: "1rem"
};
l.style.setProperty("--font-size-base", c[u]), st(() => {
t.init(), i(), o(), a(), Uo("[tooltip]");
const d = document.querySelector("html"), p = (d == null ? void 0 : d.getAttribute("data-storybook")) === "true";
d && p && new MutationObserver(
(m) => {
for (const v of m) {
const k = v.target.getAttribute(
v.attributeName
);
Vn(() => {
k === "dark" ? t.set("darkMode", !0) : t.set("darkMode", !1);
});
}
}
).observe(d, {
attributes: !0,
attributeOldValue: !0,
attributeFilter: ["class"]
});
});
}
});
const $e = (t, e) => {
const n = t.__vccOpts || t;
for (const [r, i] of e)
n[r] = i;
return n;
};
function Y8(t, e, n, r, i, o) {
const a = he("router-view");
return C(), oe(a);
}
const K8 = /* @__PURE__ */ $e(W8, [["render", Y8]]), G8 = be({
name: "KTFooter",
setup() {
return {
changelogEnabled: j8,
copyright: q8
};
}
}), J8 = {
id: "k-footer",
class: "p-4 dark:bg-gray-800 bg-white hidden sm:flex"
}, X8 = { class: "flex flex-col md:flex-row items-center justify-between text-sm w-full text-gray-800 dark:text-gray-200" }, Q8 = { class: "order-2 md:order-1" }, Z8 = /* @__PURE__ */ U("span", { class: "font-bold mr-1" }, "© 2023 - ", -1), e5 = ["href"], t5 = { class: "font-semibold order-1 flex flex-row gap-4 select-none" }, n5 = { class: "whitespace-nowrap" }, r5 = {
class: "cursor-pointer",
href: "https://calltek.es/soporte",
target: "_blank"
}, i5 = { class: "whitespace-nowrap" }, o5 = {
href: "https://calltek.es/blog",
target: "_blank"
}, a5 = {
key: 0,
class: "menu-item"
};
function s5(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("router-link");
return C(), P("div", J8, [
U("div", X8, [
U("div", Q8, [
Z8,
U("a", {
href: t.copyright.link,
target: "_blank",
class: "uppercase text-hover-primary font-semibold"
}, Se(t.copyright.text), 9, e5)
]),
U("ul", t5, [
U("li", n5, [
U("a", r5, [
J(a, {
icon: "life-ring",
class: "mr-1"
}),
Oe(" Soporte ")
])
]),
U("li", i5, [
U("a", o5, [
J(a, {
icon: "blog",
class: "mr-1"
}),
Oe(" Noticias ")
])
]),
t.changelogEnabled ? (C(), P("li", a5, [
J(s, {
to: { name: "changelog" },
class: "menu-link px-2"
}, {
default: ne(() => [
J(a, {
icon: "cat-space",
class: "mr-1"
}),
Oe(" Registro de cambios ")
]),
_: 1
})
])) : F("", !0)
])
])
]);
}
const u5 = /* @__PURE__ */ $e(G8, [["render", s5]]);
/*!
* vue-router v4.2.5
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/
const si = typeof window < "u";
function l5(t) {
return t.__esModule || t[Symbol.toStringTag] === "Module";
}
const ft = Object.assign;
function Pd(t, e) {
const n = {};
for (const r in e) {
const i = e[r];
n[r] = Qn(i) ? i.map(t) : t(i);
}
return n;
}
const Ss = () => {
}, Qn = Array.isArray;
function tt(t) {
const e = Array.from(arguments).slice(1);
console.warn.apply(console, ["[Vue Router warn]: " + t].concat(e));
}
const c5 = /\/$/, d5 = (t) => t.replace(c5, "");
function Id(t, e, n = "/") {
let r, i = {}, o = "", a = "";
const s = e.indexOf("#");
let u = e.indexOf("?");
return s < u && s >= 0 && (u = -1), u > -1 && (r = e.slice(0, u), o = e.slice(u + 1, s > -1 ? s : e.length), i = t(o)), s > -1 && (r = r || e.slice(0, s), a = e.slice(s, e.length)), r = h5(r ?? e, n), {
fullPath: r + (o && "?") + o + a,
path: r,
query: i,
hash: a
};
}
function f5(t, e) {
const n = e.query ? t(e.query) : "";
return e.path + (n && "?") + n + (e.hash || "");
}
function qm(t, e) {
return !e || !t.toLowerCase().startsWith(e.toLowerCase()) ? t : t.slice(e.length) || "/";
}
function Fm(t, e, n) {
const r = e.matched.length - 1, i = n.matched.length - 1;
return r > -1 && r === i && Vi(e.matched[r], n.matched[i]) && ry(e.params, n.params) && t(e.query) === t(n.query) && e.hash === n.hash;
}
function Vi(t, e) {
return (t.aliasOf || t) === (e.aliasOf || e);
}
function ry(t, e) {
if (Object.keys(t).length !== Object.keys(e).length)
return !1;
for (const n in t)
if (!p5(t[n], e[n]))
return !1;
return !0;
}
function p5(t, e) {
return Qn(t) ? jm(t, e) : Qn(e) ? jm(e, t) : t === e;
}
function jm(t, e) {
return Qn(e) ? t.length === e.length && t.every((n, r) => n === e[r]) : t.length === 1 && t[0] === e;
}
function h5(t, e) {
if (t.startsWith("/"))
return t;
if (process.env.NODE_ENV !== "production" && !e.startsWith("/"))
return tt(`Cannot resolve a relative location without an absolute path. Trying to resolve "${t}" from "${e}". It should look like "/${e}".`), t;
if (!t)
return e;
const n = e.split("/"), r = t.split("/"), i = r[r.length - 1];
(i === ".." || i === ".") && r.push("");
let o = n.length - 1, a, s;
for (a = 0; a < r.length; a++)
if (s = r[a], s !== ".")
if (s === "..")
o > 1 && o--;
else
break;
return n.slice(0, o).join("/") + "/" + r.slice(a - (a === r.length ? 1 : 0)).join("/");
}
var Na;
(function(t) {
t.pop = "pop", t.push = "push";
})(Na || (Na = {}));
var Oo;
(function(t) {
t.back = "back", t.forward = "forward", t.unknown = "";
})(Oo || (Oo = {}));
const Ld = "";
function iy(t) {
if (!t)
if (si) {
const e = document.querySelector("base");
t = e && e.getAttribute("href") || "/", t = t.replace(/^\w+:\/\/[^\/]+/, "");
} else
t = "/";
return t[0] !== "/" && t[0] !== "#" && (t = "/" + t), d5(t);
}
const m5 = /^[^#]+#/;
function oy(t, e) {
return t.replace(m5, "#") + e;
}
function g5(t, e) {
const n = document.documentElement.getBoundingClientRect(), r = t.getBoundingClientRect();
return {
behavior: e.behavior,
left: r.left - n.left - (e.left || 0),
top: r.top - n.top - (e.top || 0)
};
}
const qc = () => ({
left: window.pageXOffset,
top: window.pageYOffset
});
function b5(t) {
let e;
if ("el" in t) {
const n = t.el, r = typeof n == "string" && n.startsWith("#");
if (process.env.NODE_ENV !== "production" && typeof t.el == "string" && (!r || !document.getElementById(t.el.slice(1))))
try {
const o = document.querySelector(t.el);
if (r && o) {
tt(`The selector "${t.el}" should be passed as "el: document.querySelector('${t.el}')" because it starts with "#".`);
return;
}
} catch {
tt(`The selector "${t.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);
return;
}
const i = typeof n == "string" ? r ? document.getElementById(n.slice(1)) : document.querySelector(n) : n;
if (!i) {
process.env.NODE_ENV !== "production" && tt(`Couldn't find element using selector "${t.el}" returned by scrollBehavior.`);
return;
}
e = g5(i, t);
} else
e = t;
"scrollBehavior" in document.documentElement.style ? window.scrollTo(e) : window.scrollTo(e.left != null ? e.left : window.pageXOffset, e.top != null ? e.top : window.pageYOffset);
}
function Um(t, e) {
return (history.state ? history.state.position - e : -1) + t;
}
const Uf = /* @__PURE__ */ new Map();
function v5(t, e) {
Uf.set(t, e);
}
function y5(t) {
const e = Uf.get(t);
return Uf.delete(t), e;
}
let w5 = () => location.protocol + "//" + location.host;
function ay(t, e) {
const { pathname: n, search: r, hash: i } = e, o = t.indexOf("#");
if (o > -1) {
let s = i.includes(t.slice(o)) ? t.slice(o).length : 1, u = i.slice(s);
return u[0] !== "/" && (u = "/" + u), qm(u, "");
}
return qm(n, t) + r + i;
}
function k5(t, e, n, r) {
let i = [], o = [], a = null;
const s = ({ state: d }) => {
const p = ay(t, location), h = n.value, m = e.value;
let v = 0;
if (d) {
if (n.value = p, e.value = d, a && a === h) {
a = null;
return;
}
v = m ? d.position - m.position : 0;
} else
r(p);
i.forEach((y) => {
y(n.value, h, {
delta: v,
type: Na.pop,
direction: v ? v > 0 ? Oo.forward : Oo.back : Oo.unknown
});
});
};
function u() {
a = n.value;
}
function l(d) {
i.push(d);
const p = () => {
const h = i.indexOf(d);
h > -1 && i.splice(h, 1);
};
return o.push(p), p;
}
function c() {
const { history: d } = window;
d.state && d.replaceState(ft({}, d.state, { scroll: qc() }), "");
}
function f() {
for (const d of o)
d();
o = [], window.removeEventListener("popstate", s), window.removeEventListener("beforeunload", c);
}
return window.addEventListener("popstate", s), window.addEventListener("beforeunload", c, {
passive: !0
}), {
pauseListeners: u,
listen: l,
destroy: f
};
}
function Wm(t, e, n, r = !1, i = !1) {
return {
back: t,
current: e,
forward: n,
replaced: r,
position: window.history.length,
scroll: i ? qc() : null
};
}
function x5(t) {
const { history: e, location: n } = window, r = {
value: ay(t, n)
}, i = { value: e.state };
i.value || o(r.value, {
back: null,
current: r.value,
forward: null,
// the length is off by one, we need to decrease it
position: e.length - 1,
replaced: !0,
// don't add a scroll as the user may have an anchor, and we want
// scrollBehavior to be triggered without a saved position
scroll: null
}, !0);
function o(u, l, c) {
const f = t.indexOf("#"), d = f > -1 ? (n.host && document.querySelector("base") ? t : t.slice(f)) + u : w5() + t + u;
try {
e[c ? "replaceState" : "pushState"](l, "", d), i.value = l;
} catch (p) {
process.env.NODE_ENV !== "production" ? tt("Error with push/replace State", p) : console.error(p), n[c ? "replace" : "assign"](d);
}
}
function a(u, l) {
const c = ft({}, e.state, Wm(
i.value.back,
// keep back and forward entries but override current position
u,
i.value.forward,
!0
), l, { position: i.value.position });
o(u, c, !0), r.value = u;
}
function s(u, l) {
const c = ft(
{},
// use current history state to gracefully handle a wrong call to
// history.replaceState
// https://github.com/vuejs/router/issues/366
i.value,
e.state,
{
forward: u,
scroll: qc()
}
);
process.env.NODE_ENV !== "production" && !e.state && tt(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:
history.replaceState(history.state, '', url)
You can find more information at https://next.router.vuejs.org/guide/migration/#usage-of-history-state.`), o(c.current, c, !0);
const f = ft({}, Wm(r.value, u, null), { position: c.position + 1 }, l);
o(u, f, !1), r.value = u;
}
return {
location: r,
state: i,
push: s,
replace: a
};
}
function sy(t) {
t = iy(t);
const e = x5(t), n = k5(t, e.state, e.location, e.replace);
function r(o, a = !0) {
a || n.pauseListeners(), history.go(o);
}
const i = ft({
// it's overridden right after
location: "",
base: t,
go: r,
createHref: oy.bind(null, t)
}, e, n);
return Object.defineProperty(i, "location", {
enumerable: !0,
get: () => e.location.value
}), Object.defineProperty(i, "state", {
enumerable: !0,
get: () => e.state.value
}), i;
}
function S5(t = "") {
let e = [], n = [Ld], r = 0;
t = iy(t);
function i(s) {
r++, r !== n.length && n.splice(r), n.push(s);
}
function o(s, u, { direction: l, delta: c }) {
const f = {
direction: l,
delta: c,
type: Na.pop
};
for (const d of e)
d(s, u, f);
}
const a = {
// rewritten by Object.defineProperty
location: Ld,
// TODO: should be kept in queue
state: {},
base: t,
createHref: oy.bind(null, t),
replace(s) {
n.splice(r--, 1), i(s);
},
push(s, u) {
i(s);
},
listen(s) {
return e.push(s), () => {
const u = e.indexOf(s);
u > -1 && e.splice(u, 1);
};
},
destroy() {
e = [], n = [Ld], r = 0;
},
go(s, u = !0) {
const l = this.location, c = (
// we are considering delta === 0 going forward, but in abstract mode
// using 0 for the delta doesn't make sense like it does in html5 where
// it reloads the page
s < 0 ? Oo.back : Oo.forward
);
r = Math.max(0, Math.min(r + s, n.length - 1)), u && o(this.location, l, {
direction: c,
delta: s
});
}
};
return Object.defineProperty(a, "location", {
enumerable: !0,
get: () => n[r]
}), a;
}
function E5(t) {
return t = location.host ? t || location.pathname + location.search : "", t.includes("#") || (t += "#"), process.env.NODE_ENV !== "production" && !t.endsWith("#/") && !t.endsWith("#") && tt(`A hash base must end with a "#":
"${t}" should be "${t.replace(/#.*$/, "#")}".`), sy(t);
}
function _5(t) {
return typeof t == "string" || t && typeof t == "object";
}
function uy(t) {
return typeof t == "string" || typeof t == "symbol";
}
const bi = {
path: "/",
name: void 0,
params: {},
query: {},
hash: "",
fullPath: "/",
matched: [],
meta: {},
redirectedFrom: void 0
}, Wf = Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
var Ym;
(function(t) {
t[t.aborted = 4] = "aborted", t[t.cancelled = 8] = "cancelled", t[t.duplicated = 16] = "duplicated";
})(Ym || (Ym = {}));
const T5 = {
1({ location: t, currentLocation: e }) {
return `No match for
${JSON.stringify(t)}${e ? `
while being at
` + JSON.stringify(e) : ""}`;
},
2({ from: t, to: e }) {
return `Redirected from "${t.fullPath}" to "${O5(e)}" via a navigation guard.`;
},
4({ from: t, to: e }) {
return `Navigation aborted from "${t.fullPath}" to "${e.fullPath}" via a navigation guard.`;
},
8({ from: t, to: e }) {
return `Navigation cancelled from "${t.fullPath}" to "${e.fullPath}" with a new navigation.`;
},
16({ from: t, to: e }) {
return `Avoided redundant navigation to current location: "${t.fullPath}".`;
}
};
function Pa(t, e) {
return process.env.NODE_ENV !== "production" ? ft(new Error(T5[t](e)), {
type: t,
[Wf]: !0
}, e) : ft(new Error(), {
type: t,
[Wf]: !0
}, e);
}
function ei(t, e) {
return t instanceof Error && Wf in t && (e == null || !!(t.type & e));
}
const C5 = ["params", "query", "hash"];
function O5(t) {
if (typeof t == "string")
return t;
if ("path" in t)
return t.path;
const e = {};
for (const n of C5)
n in t && (e[n] = t[n]);
return JSON.stringify(e, null, 2);
}
const Km = "[^/]+?", A5 = {
sensitive: !1,
strict: !1,
start: !0,
end: !0
}, M5 = /[.+*?^${}()[\]/\\]/g;
function D5(t, e) {
const n = ft({}, A5, e), r = [];
let i = n.start ? "^" : "";
const o = [];
for (const l of t) {
const c = l.length ? [] : [
90
/* PathScore.Root */
];
n.strict && !l.length && (i += "/");
for (let f = 0; f < l.length; f++) {
const d = l[f];
let p = 40 + (n.sensitive ? 0.25 : 0);
if (d.type === 0)
f || (i += "/"), i += d.value.replace(M5, "\\$&"), p += 40;
else if (d.type === 1) {
const { value: h, repeatable: m, optional: v, regexp: y } = d;
o.push({
name: h,
repeatable: m,
optional: v
});
const k = y || Km;
if (k !== Km) {
p += 10;
try {
new RegExp(`(${k})`);
} catch (b) {
throw new Error(`Invalid custom RegExp for param "${h}" (${k}): ` + b.message);
}
}
let T = m ? `((?:${k})(?:/(?:${k}))*)` : `(${k})`;
f || (T = // avoid an optional / if there are more segments e.g. /:p?-static
// or /:p?-:p2
v && l.length < 2 ? `(?:/${T})` : "/" + T), v && (T += "?"), i += T, p += 20, v && (p += -8), m && (p += -20), k === ".*" && (p += -50);
}
c.push(p);
}
r.push(c);
}
if (n.strict && n.end) {
const l = r.length - 1;
r[l][r[l].length - 1] += 0.7000000000000001;
}
n.strict || (i += "/?"), n.end ? i += "$" : n.strict && (i += "(?:/|$)");
const a = new RegExp(i, n.sensitive ? "" : "i");
function s(l) {
const c = l.match(a), f = {};
if (!c)
return null;
for (let d = 1; d < c.length; d++) {
const p = c[d] || "", h = o[d - 1];
f[h.name] = p && h.repeatable ? p.split("/") : p;
}
return f;
}
function u(l) {
let c = "", f = !1;
for (const d of t) {
(!f || !c.endsWith("/")) && (c += "/"), f = !1;
for (const p of d)
if (p.type === 0)
c += p.value;
else if (p.type === 1) {
const { value: h, repeatable: m, optional: v } = p, y = h in l ? l[h] : "";
if (Qn(y) && !m)
throw new Error(`Provided param "${h}" is an array but it is not repeatable (* or + modifiers)`);
const k = Qn(y) ? y.join("/") : y;
if (!k)
if (v)
d.length < 2 && (c.endsWith("/") ? c = c.slice(0, -1) : f = !0);
else
throw new Error(`Missing required param "${h}"`);
c += k;
}
}
return c || "/";
}
return {
re: a,
score: r,
keys: o,
parse: s,
stringify: u
};
}
function $5(t, e) {
let n = 0;
for (; n < t.length && n < e.length; ) {
const r = e[n] - t[n];
if (r)
return r;
n++;
}
return t.length < e.length ? t.length === 1 && t[0] === 40 + 40 ? -1 : 1 : t.length > e.length ? e.length === 1 && e[0] === 40 + 40 ? 1 : -1 : 0;
}
function N5(t, e) {
let n = 0;
const r = t.score, i = e.score;
for (; n < r.length && n < i.length; ) {
const o = $5(r[n], i[n]);
if (o)
return o;
n++;
}
if (Math.abs(i.length - r.length) === 1) {
if (Gm(r))
return 1;
if (Gm(i))
return -1;
}
return i.length - r.length;
}
function Gm(t) {
const e = t[t.length - 1];
return t.length > 0 && e[e.length - 1] < 0;
}
const P5 = {
type: 0,
value: ""
}, I5 = /[a-zA-Z0-9_]/;
function L5(t) {
if (!t)
return [[]];
if (t === "/")
return [[P5]];
if (!t.startsWith("/"))
throw new Error(process.env.NODE_ENV !== "production" ? `Route paths should start with a "/": "${t}" should be "/${t}".` : `Invalid path "${t}"`);
function e(p) {
throw new Error(`ERR (${n})/"${l}": ${p}`);
}
let n = 0, r = n;
const i = [];
let o;
function a() {
o && i.push(o), o = [];
}
let s = 0, u, l = "", c = "";
function f() {
l && (n === 0 ? o.push({
type: 0,
value: l
}) : n === 1 || n === 2 || n === 3 ? (o.length > 1 && (u === "*" || u === "+") && e(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`), o.push({
type: 1,
value: l,
regexp: c,
repeatable: u === "*" || u === "+",
optional: u === "*" || u === "?"
})) : e("Invalid state to consume buffer"), l = "");
}
function d() {
l += u;
}
for (; s < t.length; ) {
if (u = t[s++], u === "\\" && n !== 2) {
r = n, n = 4;
continue;
}
switch (n) {
case 0:
u === "/" ? (l && f(), a()) : u === ":" ? (f(), n = 1) : d();
break;
case 4:
d(), n = r;
break;
case 1:
u === "(" ? n = 2 : I5.test(u) ? d() : (f(), n = 0, u !== "*" && u !== "?" && u !== "+" && s--);
break;
case 2:
u === ")" ? c[c.length - 1] == "\\" ? c = c.slice(0, -1) + u : n = 3 : c += u;
break;
case 3:
f(), n = 0, u !== "*" && u !== "?" && u !== "+" && s--, c = "";
break;
default:
e("Unknown state");
break;
}
}
return n === 2 && e(`Unfinished custom RegExp for param "${l}"`), f(), a(), i;
}
function R5(t, e, n) {
const r = D5(L5(t.path), n);
if (process.env.NODE_ENV !== "production") {
const o = /* @__PURE__ */ new Set();
for (const a of r.keys)
o.has(a.name) && tt(`Found duplicated params with name "${a.name}" for path "${t.path}". Only the last one will be available on "$route.params".`), o.add(a.name);
}
const i = ft(r, {
record: t,
parent: e,
// these needs to be populated by the parent
children: [],
alias: []
});
return e && !i.record.aliasOf == !e.record.aliasOf && e.children.push(i), i;
}
function B5(t, e) {
const n = [], r = /* @__PURE__ */ new Map();
e = Qm({ strict: !1, end: !0, sensitive: !1 }, e);
function i(c) {
return r.get(c);
}
function o(c, f, d) {
const p = !d, h = V5(c);
process.env.NODE_ENV !== "production" && F5(h, f), h.aliasOf = d && d.record;
const m = Qm(e, c), v = [
h
];
if ("alias" in c) {
const T = typeof c.alias == "string" ? [c.alias] : c.alias;
for (const b of T)
v.push(ft({}, h, {
// this allows us to hold a copy of the `components` option
// so that async components cache is hold on the original record
components: d ? d.record.components : h.components,
path: b,
// we might be the child of an alias
aliasOf: d ? d.record : h
// the aliases are always of the same kind as the original since they
// are defined on the same record
}));
}
let y, k;
for (const T of v) {
const { path: b } = T;
if (f && b[0] !== "/") {
const D = f.record.path, x = D[D.length - 1] === "/" ? "" : "/";
T.path = f.record.path + (b && x + b);
}
if (process.env.NODE_ENV !== "production" && T.path === "*")
throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
See more at https://next.router.vuejs.org/guide/migration/#removed-star-or-catch-all-routes.`);
if (y = R5(T, f, m), process.env.NODE_ENV !== "production" && f && b[0] === "/" && j5(y, f), d ? (d.alias.push(y), process.env.NODE_ENV !== "production" && q5(d, y)) : (k = k || y, k !== y && k.alias.push(y), p && c.name && !Xm(y) && a(c.name)), h.children) {
const D = h.children;
for (let x = 0; x < D.length; x++)
o(D[x], y, d && d.children[x]);
}
d = d || y, (y.record.components && Object.keys(y.record.components).length || y.record.name || y.record.redirect) && u(y);
}
return k ? () => {
a(k);
} : Ss;
}
function a(c) {
if (uy(c)) {
const f = r.get(c);
f && (r.delete(c), n.splice(n.indexOf(f), 1), f.children.forEach(a), f.alias.forEach(a));
} else {
const f = n.indexOf(c);
f > -1 && (n.splice(f, 1), c.record.name && r.delete(c.record.name), c.children.forEach(a), c.alias.forEach(a));
}
}
function s() {
return n;
}
function u(c) {
let f = 0;
for (; f < n.length && N5(c, n[f]) >= 0 && // Adding children with empty path should still appear before the parent
// https://github.com/vuejs/router/issues/1124
(c.record.path !== n[f].record.path || !ly(c, n[f])); )
f++;
n.splice(f, 0, c), c.record.name && !Xm(c) && r.set(c.record.name, c);
}
function l(c, f) {
let d, p = {}, h, m;
if ("name" in c && c.name) {
if (d = r.get(c.name), !d)
throw Pa(1, {
location: c
});
if (process.env.NODE_ENV !== "production") {
const k = Object.keys(c.params || {}).filter((T) => !d.keys.find((b) => b.name === T));
k.length && tt(`Discarded invalid param(s) "${k.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
}
m = d.record.name, p = ft(
// paramsFromLocation is a new object
Jm(
f.params,
// only keep params that exist in the resolved location
// TODO: only keep optional params coming from a parent record
d.keys.filter((k) => !k.optional).map((k) => k.name)
),
// discard any existing params in the current location that do not exist here
// #1497 this ensures better active/exact matching
c.params && Jm(c.params, d.keys.map((k) => k.name))
), h = d.stringify(p);
} else if ("path" in c)
h = c.path, process.env.NODE_ENV !== "production" && !h.startsWith("/") && tt(`The Matcher cannot resolve relative paths but received "${h}". Unless you directly called \`matcher.resolve("${h}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`), d = n.find((k) => k.re.test(h)), d && (p = d.parse(h), m = d.record.name);
else {
if (d = f.name ? r.get(f.name) : n.find((k) => k.re.test(f.path)), !d)
throw Pa(1, {
location: c,
currentLocation: f
});
m = d.record.name, p = ft({}, f.params, c.params), h = d.stringify(p);
}
const v = [];
let y = d;
for (; y; )
v.unshift(y.record), y = y.parent;
return {
name: m,
path: h,
params: p,
matched: v,
meta: H5(v)
};
}
return t.forEach((c) => o(c)), { addRoute: o, resolve: l, removeRoute: a, getRoutes: s, getRecordMatcher: i };
}
function Jm(t, e) {
const n = {};
for (const r of e)
r in t && (n[r] = t[r]);
return n;
}
function V5(t) {
return {
path: t.path,
redirect: t.redirect,
name: t.name,
meta: t.meta || {},
aliasOf: void 0,
beforeEnter: t.beforeEnter,
props: z5(t),
children: t.children || [],
instances: {},
leaveGuards: /* @__PURE__ */ new Set(),
updateGuards: /* @__PURE__ */ new Set(),
enterCallbacks: {},
components: "components" in t ? t.components || null : t.component && { default: t.component }
};
}
function z5(t) {
const e = {}, n = t.props || !1;
if ("component" in t)
e.default = n;
else
for (const r in t.components)
e[r] = typeof n == "object" ? n[r] : n;
return e;
}
function Xm(t) {
for (; t; ) {
if (t.record.aliasOf)
return !0;
t = t.parent;
}
return !1;
}
function H5(t) {
return t.reduce((e, n) => ft(e, n.meta), {});
}
function Qm(t, e) {
const n = {};
for (const r in t)
n[r] = r in e ? e[r] : t[r];
return n;
}
function Yf(t, e) {
return t.name === e.name && t.optional === e.optional && t.repeatable === e.repeatable;
}
function q5(t, e) {
for (const n of t.keys)
if (!n.optional && !e.keys.find(Yf.bind(null, n)))
return tt(`Alias "${e.record.path}" and the original record: "${t.record.path}" must have the exact same param named "${n.name}"`);
for (const n of e.keys)
if (!n.optional && !t.keys.find(Yf.bind(null, n)))
return tt(`Alias "${e.record.path}" and the original record: "${t.record.path}" must have the exact same param named "${n.name}"`);
}
function F5(t, e) {
e && e.record.name && !t.name && !t.path && tt(`The route named "${String(e.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`);
}
function j5(t, e) {
for (const n of e.keys)
if (!t.keys.find(Yf.bind(null, n)))
return tt(`Absolute path "${t.record.path}" must have the exact same param named "${n.name}" as its parent "${e.record.path}".`);
}
function ly(t, e) {
return e.children.some((n) => n === t || ly(t, n));
}
const cy = /#/g, U5 = /&/g, W5 = /\//g, Y5 = /=/g, K5 = /\?/g, dy = /\+/g, G5 = /%5B/g, J5 = /%5D/g, fy = /%5E/g, X5 = /%60/g, py = /%7B/g, Q5 = /%7C/g, hy = /%7D/g, Z5 = /%20/g;
function Tp(t) {
return encodeURI("" + t).replace(Q5, "|").replace(G5, "[").replace(J5, "]");
}
function eS(t) {
return Tp(t).replace(py, "{").replace(hy, "}").replace(fy, "^");
}
function Kf(t) {
return Tp(t).replace(dy, "%2B").replace(Z5, "+").replace(cy, "%23").replace(U5, "%26").replace(X5, "`").replace(py, "{").replace(hy, "}").replace(fy, "^");
}
function tS(t) {
return Kf(t).replace(Y5, "%3D");
}
function nS(t) {
return Tp(t).replace(cy, "%23").replace(K5, "%3F");
}
function rS(t) {
return t == null ? "" : nS(t).replace(W5, "%2F");
}
function Ks(t) {
try {
return decodeURIComponent("" + t);
} catch {
process.env.NODE_ENV !== "production" && tt(`Error decoding "${t}". Using original value`);
}
return "" + t;
}
function iS(t) {
const e = {};
if (t === "" || t === "?")
return e;
const r = (t[0] === "?" ? t.slice(1) : t).split("&");
for (let i = 0; i < r.length; ++i) {
const o = r[i].replace(dy, " "), a = o.indexOf("="), s = Ks(a < 0 ? o : o.slice(0, a)), u = a < 0 ? null : Ks(o.slice(a + 1));
if (s in e) {
let l = e[s];
Qn(l) || (l = e[s] = [l]), l.push(u);
} else
e[s] = u;
}
return e;
}
function Zm(t) {
let e = "";
for (let n in t) {
const r = t[n];
if (n = tS(n), r == null) {
r !== void 0 && (e += (e.length ? "&" : "") + n);
continue;
}
(Qn(r) ? r.map((o) => o && Kf(o)) : [r && Kf(r)]).forEach((o) => {
o !== void 0 && (e += (e.length ? "&" : "") + n, o != null && (e += "=" + o));
});
}
return e;
}
function oS(t) {
const e = {};
for (const n in t) {
const r = t[n];
r !== void 0 && (e[n] = Qn(r) ? r.map((i) => i == null ? null : "" + i) : r == null ? r : "" + r);
}
return e;
}
const aS = Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : ""), e1 = Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : ""), Fc = Symbol(process.env.NODE_ENV !== "production" ? "router" : ""), Cp = Symbol(process.env.NODE_ENV !== "production" ? "route location" : ""), Gf = Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
function ts() {
let t = [];
function e(r) {
return t.push(r), () => {
const i = t.indexOf(r);
i > -1 && t.splice(i, 1);
};
}
function n() {
t = [];
}
return {
add: e,
list: () => t.slice(),
reset: n
};
}
function ki(t, e, n, r, i) {
const o = r && // name is defined if record is because of the function overload
(r.enterCallbacks[i] = r.enterCallbacks[i] || []);
return () => new Promise((a, s) => {
const u = (f) => {
f === !1 ? s(Pa(4, {
from: n,
to: e
})) : f instanceof Error ? s(f) : _5(f) ? s(Pa(2, {
from: e,
to: f
})) : (o && // since enterCallbackArray is truthy, both record and name also are
r.enterCallbacks[i] === o && typeof f == "function" && o.push(f), a());
}, l = t.call(r && r.instances[i], e, n, process.env.NODE_ENV !== "production" ? sS(u, e, n) : u);
let c = Promise.resolve(l);
if (t.length < 3 && (c = c.then(u)), process.env.NODE_ENV !== "production" && t.length > 2) {
const f = `The "next" callback was never called inside of ${t.name ? '"' + t.name + '"' : ""}:
${t.toString()}
. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;
if (typeof l == "object" && "then" in l)
c = c.then((d) => u._called ? d : (tt(f), Promise.reject(new Error("Invalid navigation guard"))));
else if (l !== void 0 && !u._called) {
tt(f), s(new Error("Invalid navigation guard"));
return;
}
}
c.catch((f) => s(f));
});
}
function sS(t, e, n) {
let r = 0;
return function() {
r++ === 1 && tt(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${e.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`), t._called = !0, r === 1 && t.apply(null, arguments);
};
}
function Rd(t, e, n, r) {
const i = [];
for (const o of t) {
process.env.NODE_ENV !== "production" && !o.components && !o.children.length && tt(`Record with path "${o.path}" is either missing a "component(s)" or "children" property.`);
for (const a in o.components) {
let s = o.components[a];
if (process.env.NODE_ENV !== "production") {
if (!s || typeof s != "object" && typeof s != "function")
throw tt(`Component "${a}" in record with path "${o.path}" is not a valid component. Received "${String(s)}".`), new Error("Invalid route component");
if ("then" in s) {
tt(`Component "${a}" in record with path "${o.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);
const u = s;
s = () => u;
} else
s.__asyncLoader && // warn only once per component
!s.__warnedDefineAsync && (s.__warnedDefineAsync = !0, tt(`Component "${a}" in record with path "${o.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`));
}
if (!(e !== "beforeRouteEnter" && !o.instances[a]))
if (uS(s)) {
const l = (s.__vccOpts || s)[e];
l && i.push(ki(l, n, r, o, a));
} else {
let u = s();
process.env.NODE_ENV !== "production" && !("catch" in u) && (tt(`Component "${a}" in record with path "${o.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`), u = Promise.resolve(u)), i.push(() => u.then((l) => {
if (!l)
return Promise.reject(new Error(`Couldn't resolve component "${a}" at "${o.path}"`));
const c = l5(l) ? l.default : l;
o.components[a] = c;
const d = (c.__vccOpts || c)[e];
return d && ki(d, n, r, o, a)();
}));
}
}
}
return i;
}
function uS(t) {
return typeof t == "object" || "displayName" in t || "props" in t || "__vccOpts" in t;
}
function t1(t) {
const e = pi(Fc), n = pi(Cp), r = L(() => e.resolve(W(t.to))), i = L(() => {
const { matched: u } = r.value, { length: l } = u, c = u[l - 1], f = n.matched;
if (!c || !f.length)
return -1;
const d = f.findIndex(Vi.bind(null, c));
if (d > -1)
return d;
const p = n1(u[l - 2]);
return (
// we are dealing with nested routes
l > 1 && // if the parent and matched route have the same path, this link is
// referring to the empty child. Or we currently are on a different
// child of the same parent
n1(c) === p && // avoid comparing the child with its parent
f[f.length - 1].path !== p ? f.findIndex(Vi.bind(null, u[l - 2])) : d
);
}), o = L(() => i.value > -1 && fS(n.params, r.value.params)), a = L(() => i.value > -1 && i.value === n.matched.length - 1 && ry(n.params, r.value.params));
function s(u = {}) {
return dS(u) ? e[W(t.replace) ? "replace" : "push"](
W(t.to)
// avoid uncaught errors are they are logged anyway
).catch(Ss) : Promise.resolve();
}
if (process.env.NODE_ENV !== "production" && si) {
const u = Fo();
if (u) {
const l = {
route: r.value,
isActive: o.value,
isExactActive: a.value
};
u.__vrl_devtools = u.__vrl_devtools || [], u.__vrl_devtools.push(l), ga(() => {
l.route = r.value, l.isActive = o.value, l.isExactActive = a.value;
}, { flush: "post" });
}
}
return {
route: r,
href: L(() => r.value.href),
isActive: o,
isExactActive: a,
navigate: s
};
}
const lS = /* @__PURE__ */ be({
name: "RouterLink",
compatConfig: { MODE: 3 },
props: {
to: {
type: [String, Object],
required: !0
},
replace: Boolean,
activeClass: String,
// inactiveClass: String,
exactActiveClass: String,
custom: Boolean,
ariaCurrentValue: {
type: String,
default: "page"
}
},
useLink: t1,
setup(t, { slots: e }) {
const n = Qt(t1(t)), { options: r } = pi(Fc), i = L(() => ({
[r1(t.activeClass, r.linkActiveClass, "router-link-active")]: n.isActive,
// [getLinkClass(
// props.inactiveClass,
// options.linkInactiveClass,
// 'router-link-inactive'
// )]: !link.isExactActive,
[r1(t.exactActiveClass, r.linkExactActiveClass, "router-link-exact-active")]: n.isExactActive
}));
return () => {
const o = e.default && e.default(n);
return t.custom ? o : jt("a", {
"aria-current": n.isExactActive ? t.ariaCurrentValue : null,
href: n.href,
// this would override user added attrs but Vue will still add
// the listener, so we end up triggering both
onClick: n.navigate,
class: i.value
}, o);
};
}
}), cS = lS;
function dS(t) {
if (!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey) && !t.defaultPrevented && !(t.button !== void 0 && t.button !== 0)) {
if (t.currentTarget && t.currentTarget.getAttribute) {
const e = t.currentTarget.getAttribute("target");
if (/\b_blank\b/i.test(e))
return;
}
return t.preventDefault && t.preventDefault(), !0;
}
}
function fS(t, e) {
for (const n in e) {
const r = e[n], i = t[n];
if (typeof r == "string") {
if (r !== i)
return !1;
} else if (!Qn(i) || i.length !== r.length || r.some((o, a) => o !== i[a]))
return !1;
}
return !0;
}
function n1(t) {
return t ? t.aliasOf ? t.aliasOf.path : t.path : "";
}
const r1 = (t, e, n) => t ?? e ?? n, pS = /* @__PURE__ */ be({
name: "RouterView",
// #674 we manually inherit them
inheritAttrs: !1,
props: {
name: {
type: String,
default: "default"
},
route: Object
},
// Better compat for @vue/compat users
// https://github.com/vuejs/router/issues/1315
compatConfig: { MODE: 3 },
setup(t, { attrs: e, slots: n }) {
process.env.NODE_ENV !== "production" && mS();
const r = pi(Gf), i = L(() => t.route || r.value), o = pi(e1, 0), a = L(() => {
let l = W(o);
const { matched: c } = i.value;
let f;
for (; (f = c[l]) && !f.components; )
l++;
return l;
}), s = L(() => i.value.matched[a.value]);
ci(e1, L(() => a.value + 1)), ci(aS, s), ci(Gf, i);
const u = re();
return Ct(() => [u.value, s.value, t.name], ([l, c, f], [d, p, h]) => {
c && (c.instances[f] = l, p && p !== c && l && l === d && (c.leaveGuards.size || (c.leaveGuards = p.leaveGuards), c.updateGuards.size || (c.updateGuards = p.updateGuards))), l && c && // if there is no instance but to and from are the same this might be
// the first visit
(!p || !Vi(c, p) || !d) && (c.enterCallbacks[f] || []).forEach((m) => m(l));
}, { flush: "post" }), () => {
const l = i.value, c = t.name, f = s.value, d = f && f.components[c];
if (!d)
return i1(n.default, { Component: d, route: l });
const p = f.props[c], h = p ? p === !0 ? l.params : typeof p == "function" ? p(l) : p : null, v = jt(d, ft({}, h, e, {
onVnodeUnmounted: (y) => {
y.component.isUnmounted && (f.instances[c] = null);
},
ref: u
}));
if (process.env.NODE_ENV !== "production" && si && v.ref) {
const y = {
depth: a.value,
name: f.name,
path: f.path,
meta: f.meta
};
(Qn(v.ref) ? v.ref.map((T) => T.i) : [v.ref.i]).forEach((T) => {
T.__vrv_devtools = y;
});
}
return (
// pass the vnode to the slot as a prop.
// h and <component :is="..."> both accept vnodes
i1(n.default, { Component: v, route: l }) || v
);
};
}
});
function i1(t, e) {
if (!t)
return null;
const n = t(e);
return n.length === 1 ? n[0] : n;
}
const hS = pS;
function mS() {
const t = Fo(), e = t.parent && t.parent.type.name, n = t.parent && t.parent.subTree && t.parent.subTree.type;
if (e && (e === "KeepAlive" || e.includes("Transition")) && typeof n == "object" && n.name === "RouterView") {
const r = e === "KeepAlive" ? "keep-alive" : "transition";
tt(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
Use slot props instead:
<router-view v-slot="{ Component }">
<${r}>
<component :is="Component" />
</${r}>
</router-view>`);
}
}
function ns(t, e) {
const n = ft({}, t, {
// remove variables that can contain vue instances
matched: t.matched.map((r) => ES(r, ["instances", "children", "aliasOf"]))
});
return {
_custom: {
type: null,
readOnly: !0,
display: t.fullPath,
tooltip: e,
value: n
}
};
}
function Du(t) {
return {
_custom: {
display: t
}
};
}
let gS = 0;
function bS(t, e, n) {
if (e.__hasDevtools)
return;
e.__hasDevtools = !0;
const r = gS++;
sp({
id: "org.vuejs.router" + (r ? "." + r : ""),
label: "Vue Router",
packageName: "vue-router",
homepage: "https://router.vuejs.org",
logo: "https://router.vuejs.org/logo.png",
componentStateTypes: ["Routing"],
app: t
}, (i) => {
typeof i.now != "function" && console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), i.on.inspectComponent((c, f) => {
c.instanceData && c.instanceData.state.push({
type: "Routing",
key: "$route",
editable: !1,
value: ns(e.currentRoute.value, "Current Route")
});
}), i.on.visitComponentTree(({ treeNode: c, componentInstance: f }) => {
if (f.__vrv_devtools) {
const d = f.__vrv_devtools;
c.tags.push({
label: (d.name ? `${d.name.toString()}: ` : "") + d.path,
textColor: 0,
tooltip: "This component is rendered by <router-view>",
backgroundColor: my
});
}
Qn(f.__vrl_devtools) && (f.__devtoolsApi = i, f.__vrl_devtools.forEach((d) => {
let p = vy, h = "";
d.isExactActive ? (p = by, h = "This is exactly active") : d.isActive && (p = gy, h = "This link is active"), c.tags.push({
label: d.route.path,
textColor: 0,
tooltip: h,
backgroundColor: p
});
}));
}), Ct(e.currentRoute, () => {
u(), i.notifyComponentUpdate(), i.sendInspectorTree(s), i.sendInspectorState(s);
});
const o = "router:navigations:" + r;
i.addTimelineLayer({
id: o,
label: `Router${r ? " " + r : ""} Navigations`,
color: 4237508
}), e.onError((c, f) => {
i.addTimelineEvent({
layerId: o,
event: {
title: "Error during Navigation",
subtitle: f.fullPath,
logType: "error",
time: i.now(),
data: { error: c },
groupId: f.meta.__navigationId
}
});
});
let a = 0;
e.beforeEach((c, f) => {
const d = {
guard: Du("beforeEach"),
from: ns(f, "Current Location during this navigation"),
to: ns(c, "Target location")
};
Object.defineProperty(c.meta, "__navigationId", {
value: a++
}), i.addTimelineEvent({
layerId: o,
event: {
time: i.now(),
title: "Start of navigation",
subtitle: c.fullPath,
data: d,
groupId: c.meta.__navigationId
}
});
}), e.afterEach((c, f, d) => {
const p = {
guard: Du("afterEach")
};
d ? (p.failure = {
_custom: {
type: Error,
readOnly: !0,
display: d ? d.message : "",
tooltip: "Navigation Failure",
value: d
}
}, p.status = Du("❌")) : p.status = Du("✅"), p.from = ns(f, "Current Location during this navigation"), p.to = ns(c, "Target location"), i.addTimelineEvent({
layerId: o,
event: {
title: "End of navigation",
subtitle: c.fullPath,
time: i.now(),
data: p,
logType: d ? "warning" : "default",
groupId: c.meta.__navigationId
}
});
});
const s = "router-inspector:" + r;
i.addInspector({
id: s,
label: "Routes" + (r ? " " + r : ""),
icon: "book",
treeFilterPlaceholder: "Search routes"
});
function u() {
if (!l)
return;
const c = l;
let f = n.getRoutes().filter((d) => !d.parent || // these routes have a parent with no component which will not appear in the view
// therefore we still need to include them
!d.parent.record.components);
f.forEach(ky), c.filter && (f = f.filter((d) => (
// save matches state based on the payload
Jf(d, c.filter.toLowerCase())
))), f.forEach((d) => wy(d, e.currentRoute.value)), c.rootNodes = f.map(yy);
}
let l;
i.on.getInspectorTree((c) => {
l = c, c.app === t && c.inspectorId === s && u();
}), i.on.getInspectorState((c) => {
if (c.app === t && c.inspectorId === s) {
const d = n.getRoutes().find((p) => p.record.__vd_id === c.nodeId);
d && (c.state = {
options: yS(d)
});
}
}), i.sendInspectorTree(s), i.sendInspectorState(s);
});
}
function vS(t) {
return t.optional ? t.repeatable ? "*" : "?" : t.repeatable ? "+" : "";
}
function yS(t) {
const { record: e } = t, n = [
{ editable: !1, key: "path", value: e.path }
];
return e.name != null && n.push({
editable: !1,
key: "name",
value: e.name
}), n.push({ editable: !1, key: "regexp", value: t.re }), t.keys.length && n.push({
editable: !1,
key: "keys",
value: {
_custom: {
type: null,
readOnly: !0,
display: t.keys.map((r) => `${r.name}${vS(r)}`).join(" "),
tooltip: "Param keys",
value: t.keys
}
}
}), e.redirect != null && n.push({
editable: !1,
key: "redirect",
value: e.redirect
}), t.alias.length && n.push({
editable: !1,
key: "aliases",
value: t.alias.map((r) => r.record.path)
}), Object.keys(t.record.meta).length && n.push({
editable: !1,
key: "meta",
value: t.record.meta
}), n.push({
key: "score",
editable: !1,
value: {
_custom: {
type: null,
readOnly: !0,
display: t.score.map((r) => r.join(", ")).join(" | "),
tooltip: "Score used to sort routes",
value: t.score
}
}
}), n;
}
const my = 15485081, gy = 2450411, by = 8702998, wS = 2282478, vy = 16486972, kS = 6710886;
function yy(t) {
const e = [], { record: n } = t;
n.name != null && e.push({
label: String(n.name),
textColor: 0,
backgroundColor: wS
}), n.aliasOf && e.push({
label: "alias",
textColor: 0,
backgroundColor: vy
}), t.__vd_match && e.push({
label: "matches",
textColor: 0,
backgroundColor: my
}), t.__vd_exactActive && e.push({
label: "exact",
textColor: 0,
backgroundColor: by
}), t.__vd_active && e.push({
label: "active",
textColor: 0,
backgroundColor: gy
}), n.redirect && e.push({
label: typeof n.redirect == "string" ? `redirect: ${n.redirect}` : "redirects",
textColor: 16777215,
backgroundColor: kS
});
let r = n.__vd_id;
return r == null && (r = String(xS++), n.__vd_id = r), {
id: r,
label: n.path,
tags: e,
children: t.children.map(yy)
};
}
let xS = 0;
const SS = /^\/(.*)\/([a-z]*)$/;
function wy(t, e) {
const n = e.matched.length && Vi(e.matched[e.matched.length - 1], t.record);
t.__vd_exactActive = t.__vd_active = n, n || (t.__vd_active = e.matched.some((r) => Vi(r, t.record))), t.children.forEach((r) => wy(r, e));
}
function ky(t) {
t.__vd_match = !1, t.children.forEach(ky);
}
function Jf(t, e) {
const n = String(t.re).match(SS);
if (t.__vd_match = !1, !n || n.length < 3)
return !1;
if (new RegExp(n[1].replace(/\$$/, ""), n[2]).test(e))
return t.children.forEach((a) => Jf(a, e)), t.record.path !== "/" || e === "/" ? (t.__vd_match = t.re.test(e), !0) : !1;
const i = t.record.path.toLowerCase(), o = Ks(i);
return !e.startsWith("/") && (o.includes(e) || i.includes(e)) || o.startsWith(e) || i.startsWith(e) || t.record.name && String(t.record.name).includes(e) ? !0 : t.children.some((a) => Jf(a, e));
}
function ES(t, e) {
const n = {};
for (const r in t)
e.includes(r) || (n[r] = t[r]);
return n;
}
function _S(t) {
const e = B5(t.routes, t), n = t.parseQuery || iS, r = t.stringifyQuery || Zm, i = t.history;
if (process.env.NODE_ENV !== "production" && !i)
throw new Error('Provide the "history" option when calling "createRouter()": https://next.router.vuejs.org/api/#history.');
const o = ts(), a = ts(), s = ts(), u = Yb(bi);
let l = bi;
si && t.scrollBehavior && "scrollRestoration" in history && (history.scrollRestoration = "manual");
const c = Pd.bind(null, (K) => "" + K), f = Pd.bind(null, rS), d = (
// @ts-expect-error: intentionally avoid the type check
Pd.bind(null, Ks)
);
function p(K, Q) {
let Z, ae;
return uy(K) ? (Z = e.getRecordMatcher(K), ae = Q) : ae = K, e.addRoute(ae, Z);
}
function h(K) {
const Q = e.getRecordMatcher(K);
Q ? e.removeRoute(Q) : process.env.NODE_ENV !== "production" && tt(`Cannot remove non-existent route "${String(K)}"`);
}
function m() {
return e.getRoutes().map((K) => K.record);
}
function v(K) {
return !!e.getRecordMatcher(K);
}
function y(K, Q) {
if (Q = ft({}, Q || u.value), typeof K == "string") {
const ye = Id(n, K, Q.path), xe = e.resolve({ path: ye.path }, Q), ct = i.createHref(ye.fullPath);
return process.env.NODE_ENV !== "production" && (ct.startsWith("//") ? tt(`Location "${K}" resolved to "${ct}". A resolved location cannot start with multiple slashes.`) : xe.matched.length || tt(`No match found for location with path "${K}"`)), ft(ye, xe, {
params: d(xe.params),
hash: Ks(ye.hash),
redirectedFrom: void 0,
href: ct
});
}
let Z;
if ("path" in K)
process.env.NODE_ENV !== "production" && "params" in K && !("name" in K) && // @ts-expect-error: the type is never
Object.keys(K.params).length && tt(`Path "${K.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`), Z = ft({}, K, {
path: Id(n, K.path, Q.path).path
});
else {
const ye = ft({}, K.params);
for (const xe in ye)
ye[xe] == null && delete ye[xe];
Z = ft({}, K, {
params: f(ye)
}), Q.params = f(Q.params);
}
const ae = e.resolve(Z, Q), ke = K.hash || "";
process.env.NODE_ENV !== "production" && ke && !ke.startsWith("#") && tt(`A \`hash\` should always start with the character "#". Replace "${ke}" with "#${ke}".`), ae.params = c(d(ae.params));
const ge = f5(r, ft({}, K, {
hash: eS(ke),
path: ae.path
})), de = i.createHref(ge);
return process.env.NODE_ENV !== "production" && (de.startsWith("//") ? tt(`Location "${K}" resolved to "${de}". A resolved location cannot start with multiple slashes.`) : ae.matched.length || tt(`No match found for location with path "${"path" in K ? K.path : K}"`)), ft({
fullPath: ge,
// keep the hash encoded so fullPath is effectively path + encodedQuery +
// hash
hash: ke,
query: (
// if the user is using a custom query lib like qs, we might have
// nested objects, so we keep the query as is, meaning it can contain
// numbers at `$route.query`, but at the point, the user will have to
// use their own type anyway.
// https://github.com/vuejs/router/issues/328#issuecomment-649481567
r === Zm ? oS(K.query) : K.query || {}
)
}, ae, {
redirectedFrom: void 0,
href: de
});
}
function k(K) {
return typeof K == "string" ? Id(n, K, u.value.path) : ft({}, K);
}
function T(K, Q) {
if (l !== K)
return Pa(8, {
from: Q,
to: K
});
}
function b(K) {
return S(K);
}
function D(K) {
return b(ft(k(K), { replace: !0 }));
}
function x(K) {
const Q = K.matched[K.matched.length - 1];
if (Q && Q.redirect) {
const { redirect: Z } = Q;
let ae = typeof Z == "function" ? Z(K) : Z;
if (typeof ae == "string" && (ae = ae.includes("?") || ae.includes("#") ? ae = k(ae) : (
// force empty params
{ path: ae }
), ae.params = {}), process.env.NODE_ENV !== "production" && !("path" in ae) && !("name" in ae))
throw tt(`Invalid redirect found:
${JSON.stringify(ae, null, 2)}
when navigating to "${K.fullPath}". A redirect must contain a name or path. This will break in production.`), new Error("Invalid redirect");
return ft({
query: K.query,
hash: K.hash,
// avoid transferring params if the redirect has a path
params: "path" in ae ? {} : K.params
}, ae);
}
}
function S(K, Q) {
const Z = l = y(K), ae = u.value, ke = K.state, ge = K.force, de = K.replace === !0, ye = x(Z);
if (ye)
return S(
ft(k(ye), {
state: typeof ye == "object" ? ft({}, ke, ye.state) : ke,
force: ge,
replace: de
}),
// keep original redirectedFrom if it exists
Q || Z
);
const xe = Z;
xe.redirectedFrom = Q;
let ct;
return !ge && Fm(r, ae, Z) && (ct = Pa(16, { to: xe, from: ae }), Y(
ae,
ae,
// this is a push, the only way for it to be triggered from a
// history.listen is with a redirect, which makes it become a push
!0,
// This cannot be the first navigation because the initial location
// cannot be manually navigated to
!1
)), (ct ? Promise.resolve(ct) : R(xe, ae)).catch((le) => ei(le) ? (
// navigation redirects still mark the router as ready
ei(
le,
2
/* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
) ? le : z(le)
) : (
// reject any unknown error
M(le, xe, ae)
)).then((le) => {
if (le) {
if (ei(
le,
2
/* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
))
return process.env.NODE_ENV !== "production" && // we are redirecting to the same location we were already at
Fm(r, y(le.to), xe) && // and we have done it a couple of times
Q && // @ts-expect-error: added only in dev
(Q._count = Q._count ? (
// @ts-expect-error
Q._count + 1
) : 1) > 30 ? (tt(`Detected a possibly infinite redirection in a navigation guard when going from "${ae.fullPath}" to "${xe.fullPath}". Aborting to avoid a Stack Overflow.
Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`), Promise.reject(new Error("Infinite redirect in navigation guard"))) : S(
// keep options
ft({
// preserve an existing replacement but allow the redirect to override it
replace: de
}, k(le.to), {
state: typeof le.to == "object" ? ft({}, ke, le.to.state) : ke,
force: ge
}),
// preserve the original redirectedFrom if any
Q || xe
);
} else
le = A(xe, ae, !0, de, ke);
return w(xe, ae, le), le;
});
}
function _(K, Q) {
const Z = T(K, Q);
return Z ? Promise.reject(Z) : Promise.resolve();
}
function N(K) {
const Q = q.values().next().value;
return Q && typeof Q.runWithContext == "function" ? Q.runWithContext(K) : K();
}
function R(K, Q) {
let Z;
const [ae, ke, ge] = TS(K, Q);
Z = Rd(ae.reverse(), "beforeRouteLeave", K, Q);
for (const ye of ae)
ye.leaveGuards.forEach((xe) => {
Z.push(ki(xe, K, Q));
});
const de = _.bind(null, K, Q);
return Z.push(de), te(Z).then(() => {
Z = [];
for (const ye of o.list())
Z.push(ki(ye, K, Q));
return Z.push(de), te(Z);
}).then(() => {
Z = Rd(ke, "beforeRouteUpdate", K, Q);
for (const ye of ke)
ye.updateGuards.forEach((xe) => {
Z.push(ki(xe, K, Q));
});
return Z.push(de), te(Z);
}).then(() => {
Z = [];
for (const ye of ge)
if (ye.beforeEnter)
if (Qn(ye.beforeEnter))
for (const xe of ye.beforeEnter)
Z.push(ki(xe, K, Q));
else
Z.push(ki(ye.beforeEnter, K, Q));
return Z.push(de), te(Z);
}).then(() => (K.matched.forEach((ye) => ye.enterCallbacks = {}), Z = Rd(ge, "beforeRouteEnter", K, Q), Z.push(de), te(Z))).then(() => {
Z = [];
for (const ye of a.list())
Z.push(ki(ye, K, Q));
return Z.push(de), te(Z);
}).catch((ye) => ei(
ye,
8
/* ErrorTypes.NAVIGATION_CANCELLED */
) ? ye : Promise.reject(ye));
}
function w(K, Q, Z) {
s.list().forEach((ae) => N(() => ae(K, Q, Z)));
}
function A(K, Q, Z, ae, ke) {
const ge = T(K, Q);
if (ge)
return ge;
const de = Q === bi, ye = si ? history.state : {};
Z && (ae || de ? i.replace(K.fullPath, ft({
scroll: de && ye && ye.scroll
}, ke)) : i.push(K.fullPath, ke)), u.value = K, Y(K, Q, Z, de), z();
}
let $;
function I() {
$ || ($ = i.listen((K, Q, Z) => {
if (!V.listening)
return;
const ae = y(K), ke = x(ae);
if (ke) {
S(ft(ke, { replace: !0 }), ae).catch(Ss);
return;
}
l = ae;
const ge = u.value;
si && v5(Um(ge.fullPath, Z.delta), qc()), R(ae, ge).catch((de) => ei(
de,
12
/* ErrorTypes.NAVIGATION_CANCELLED */
) ? de : ei(
de,
2
/* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
) ? (S(
de.to,
ae
// avoid an uncaught rejection, let push call triggerError
).then((ye) => {
ei(
ye,
20
/* ErrorTypes.NAVIGATION_DUPLICATED */
) && !Z.delta && Z.type === Na.pop && i.go(-1, !1);
}).catch(Ss), Promise.reject()) : (Z.delta && i.go(-Z.delta, !1), M(de, ae, ge))).then((de) => {
de = de || A(
// after navigation, all matched components are resolved
ae,
ge,
!1
), de && (Z.delta && // a new navigation has been triggered, so we do not want to revert, that will change the current history
// entry while a different route is displayed
!ei(
de,
8
/* ErrorTypes.NAVIGATION_CANCELLED */
) ? i.go(-Z.delta, !1) : Z.type === Na.pop && ei(
de,
20
/* ErrorTypes.NAVIGATION_DUPLICATED */
) && i.go(-1, !1)), w(ae, ge, de);
}).catch(Ss);
}));
}
let E = ts(), O = ts(), g;
function M(K, Q, Z) {
z(K);
const ae = O.list();
return ae.length ? ae.forEach((ke) => ke(K, Q, Z)) : (process.env.NODE_ENV !== "production" && tt("uncaught error during route navigation:"), console.error(K)), Promise.reject(K);
}
function H() {
return g && u.value !== bi ? Promise.resolve() : new Promise((K, Q) => {
E.add([K, Q]);
});
}
function z(K) {
return g || (g = !K, I(), E.list().forEach(([Q, Z]) => K ? Z(K) : Q()), E.reset()), K;
}
function Y(K, Q, Z, ae) {
const { scrollBehavior: ke } = t;
if (!si || !ke)
return Promise.resolve();
const ge = !Z && y5(Um(K.fullPath, 0)) || (ae || !Z) && history.state && history.state.scroll || null;
return Vn().then(() => ke(K, Q, ge)).then((de) => de && b5(de)).catch((de) => M(de, K, Q));
}
const ee = (K) => i.go(K);
let ce;
const q = /* @__PURE__ */ new Set(), V = {
currentRoute: u,
listening: !0,
addRoute: p,
removeRoute: h,
hasRoute: v,
getRoutes: m,
resolve: y,
options: t,
push: b,
replace: D,
go: ee,
back: () => ee(-1),
forward: () => ee(1),
beforeEach: o.add,
beforeResolve: a.add,
afterEach: s.add,
onError: O.add,
isReady: H,
install(K) {
const Q = this;
K.component("RouterLink", cS), K.component("RouterView", hS), K.config.globalProperties.$router = Q, Object.defineProperty(K.config.globalProperties, "$route", {
enumerable: !0,
get: () => W(u)
}), si && // used for the initial navigation client side to avoid pushing
// multiple times when the router is used in multiple apps
!ce && u.value === bi && (ce = !0, b(i.location).catch((ke) => {
process.env.NODE_ENV !== "production" && tt("Unexpected error when starting the router:", ke);
}));
const Z = {};
for (const ke in bi)
Object.defineProperty(Z, ke, {
get: () => u.value[ke],
enumerable: !0
});
K.provide(Fc, Q), K.provide(Cp, C6(Z)), K.provide(Gf, u);
const ae = K.unmount;
q.add(K), K.unmount = function() {
q.delete(K), q.size < 1 && (l = bi, $ && $(), $ = null, u.value = bi, ce = !1, g = !1), ae();
}, process.env.NODE_ENV !== "production" && si && bS(K, Q, e);
}
};
function te(K) {
return K.reduce((Q, Z) => Q.then(() => N(Z)), Promise.resolve());
}
return V;
}
function TS(t, e) {
const n = [], r = [], i = [], o = Math.max(e.matched.length, t.matched.length);
for (let a = 0; a < o; a++) {
const s = e.matched[a];
s && (t.matched.find((l) => Vi(l, s)) ? r.push(s) : n.push(s));
const u = t.matched[a];
u && (e.matched.find((l) => Vi(l, u)) || i.push(u));
}
return [n, r, i];
}
function Op() {
return pi(Fc);
}
function xy() {
return pi(Cp);
}
const CS = be({
name: "KLayout",
autoload: !0,
components: {
KFooter: u5
},
props: {
title: {
type: String,
required: !0
},
breads: {
type: [Array, Boolean],
default: !1
},
loading: {
type: Boolean,
default: !1
},
loadingFullpage: {
type: Boolean,
default: !1
},
sticky: {
type: Boolean,
default: !1
}
},
setup(t, e) {
const n = xy(), r = (a) => !!e.slots[a], i = L(() => t.title || n.meta.title || ""), o = L(() => t.breads && Array.isArray(t.breads) ? t.breads.map((a) => ({
title: a.title,
route: a.route
})).filter((a) => a.title && a.route) : []);
return {
pageTitle: i,
parsedBreads: o,
homepage: z8,
hasSlot: r
};
}
});
const OS = { id: "k-layout-wrapper" }, AS = { id: "k-layout-leftbar" }, MS = {
key: 0,
id: "k-layout-breads"
}, DS = { class: "k-layout-separator" }, $S = { class: "k-layout-separator" }, NS = { id: "k-layout-topbar" }, PS = { id: "k-layout-topbar-mobile" }, IS = { id: "k-layout-content" }, LS = { class: "flex flex-1" }, RS = { class: "mt-4 -mb-5 -mx-5" };
function BS(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-title"), u = he("router-link"), l = he("k-footer"), c = he("k-loading");
return C(), oe(c, {
active: t.loading,
fullpage: t.loadingFullpage,
"overlay-classes": "rounded-tl-3xl",
class: "flex-1 flex flex-col"
}, {
default: ne(() => [
U("div", {
id: "k-layout-header",
class: se({ "k-layout-sticky ": t.sticky })
}, [
U("div", OS, [
U("div", AS, [
X(t.$slots, "title", {}, () => [
t.breads || t.parsedBreads.length > 0 ? (C(), P("div", MS, [
J(u, { to: t.homepage }, {
default: ne(() => [
J(s, {
size: 5,
class: "k-layout-bread"
}, {
default: ne(() => [
J(a, { icon: "home" })
]),
_: 1
})
]),
_: 1
}, 8, ["to"]),
U("div", DS, [
J(a, { icon: "chevron-right" })
]),
(C(!0), P(Ee, null, nt(t.parsedBreads, (f, d) => (C(), P(Ee, { key: d }, [
J(u, {
to: f.route
}, {
default: ne(() => [
J(s, {
size: 5,
class: "k-layout-bread"
}, {
default: ne(() => [
Oe(Se(f.title), 1)
]),
_: 2
}, 1024)
]),
_: 2
}, 1032, ["to"]),
U("div", $S, [
J(a, { icon: "chevron-right" })
])
], 64))), 128))
])) : F("", !0),
J(s, {
size: 5,
class: "k-layout-title"
}, {
default: ne(() => [
Oe(Se(t.pageTitle), 1)
]),
_: 1
})
], !0)
]),
U("div", NS, [
X(t.$slots, "topbar", {}, void 0, !0)
]),
U("div", PS, [
X(t.$slots, "topbar-mobile", {}, void 0, !0)
])
])
], 2),
U("div", IS, [
U("div", LS, [
X(t.$slots, "default", {}, void 0, !0)
]),
U("div", RS, [
t.hasSlot("footer") ? X(t.$slots, "footer", { key: 0 }, void 0, !0) : (C(), oe(l, { key: 1 }))
])
])
]),
_: 3
}, 8, ["active", "fullpage"]);
}
const VS = /* @__PURE__ */ $e(CS, [["render", BS], ["__scopeId", "data-v-1a0d687c"]]), on = () => (Date.now() + Math.random()).toString(36).replace(".", ""), Wr = [
"gray",
"primary",
"secondary",
"success",
"warning",
"danger",
"info"
];
function zS(t, e) {
let n;
return function(...r) {
clearTimeout(n), n = setTimeout(() => {
t.apply(this, r);
}, e);
};
}
const HS = {
id: {
type: String,
default: () => on(),
description: "ID único"
},
submit: {
type: Boolean,
default: !1,
description: "Habilita el modo `submit`"
},
// States
loading: {
type: Boolean,
default: !1,
description: "Habilita el modo `loading` y deshabilita el botón"
},
disabled: {
type: Boolean,
default: !1,
description: "Deshabilita el botón"
},
size: {
type: String,
control: { type: "inline-radio" },
options: ["xs", "sm", "md", "lg", "xl"],
validator: (t) => ["xs", "sm", "md", "lg", "xl"].includes(t),
default: "md",
description: "Tamaño del botón"
},
// Misc
color: {
type: String,
control: { type: "inline-radio" },
options: Wr,
validator: (t) => Wr.includes(t),
default: "primary",
description: "Color del botón"
},
link: {
type: Boolean,
default: !1,
description: "Establece el diseño `link` del botón"
},
neon: {
type: Boolean,
default: !1,
description: "Establece el diseño `neón` del botón"
},
uppercase: {
type: Boolean,
default: !1,
description: "Establece el texto en mayúsculas"
},
outline: {
type: Boolean,
default: !1,
description: "Elimina el fondo del botón y establece un borde"
},
zoom: {
type: Boolean,
default: !1,
description: "Aumenta el tamaño del botón al pasar por encima"
},
icon: {
type: [Array, String],
default: "",
description: 'Renderiza un icono de <a href="https://fontawesome.com/search?q=" target="_blank" title="Ir a FontAwesome"><b>Fontawesome</b></a>.<br /> Ejemplo: <small>["fas","home"]</small> o <small>home</small>'
},
iconType: {
type: String,
control: { type: "inline-radio" },
options: ["fas", "far", "fal", "fad", "fab"],
validator: (t) => ["fas", "far", "fal", "fad", "fab"].includes(t),
default: "fad",
description: "Tipo de icono"
},
to: {
type: [Object, String],
default: "",
description: "Ruta de redirección"
}
}, qS = (t, e) => {
const n = (v) => !!e[v], r = ["k-button"], i = t.outline, o = t.color, a = t.icon, s = t.link, u = t.disabled, l = t.zoom, c = t.neon, f = t.size, d = t.uppercase, p = t.loading, h = a && !n("default") ? "icon" : "text";
let m = [];
return p && m.push("cursor-progress"), f === "xs" ? m.push("k-button-xs") : f === "sm" ? m.push("k-button-sm") : f === "md" ? m.push("k-button-md") : f === "lg" ? m.push("k-button-lg") : f === "xl" && m.push("k-button-xl"), h === "icon" && (m.push("k-button-icon"), f === "xs" ? m.push("k-button-icon-xs") : f === "sm" ? m.push("k-button-icon-sm") : f === "md" ? m.push("k-button-icon-md") : f === "lg" ? m.push("k-button-icon-lg") : f === "xl" && m.push("k-button-icon-xl")), s ? (m.push(
"bg-transparent border-transparent text-opacity-80 hover:text-opacity-100 outline-none"
), o === "gray" ? m.push("text-gray-400 dark:text-gray-600") : o === "primary" ? m.push("text-primary") : o === "secondary" ? m.push("text-secondary") : o === "success" ? m.push("text-success") : o === "warning" ? m.push("text-warning") : o === "danger" ? m.push("text-danger") : o === "info" && m.push("text-info")) : i ? (m.push("border"), o === "gray" ? m.push(
"border-gray-400 text-gray-400 hover:bg-gray-400 hover:text-white dark:border-gray-600 dark:text-gray-600 dark:hover:bg-gray-600 dark:hover:text-white"
) : o === "primary" ? m.push(
"border-primary text-primary hover:bg-primary hover:text-white"
) : o === "secondary" ? m.push(
"border-secondary text-secondary hover:bg-secondary hover:text-white"
) : o === "success" ? m.push(
"border-success text-success hover:bg-success hover:text-white"
) : o === "warning" ? m.push(
"border-warning text-warning hover:bg-warning hover:text-white"
) : o === "danger" ? m.push(
"border-danger text-danger hover:bg-danger hover:text-white"
) : o === "info" && m.push(
"border-info text-info hover:bg-info hover:text-white"
)) : (c ? m.push(
"border bg-opacity-20 hover:bg-opacity-100 border-opacity-0 hover:border-opacity-100 dark:bg-opacity-10 dark:hover:bg-opacity-100 dark:border-opacity-0 dark:hover:border-opacity-100"
) : m.push(
"border bg-opacity-80 hover:bg-opacity-100 dark:bg-opacity-80 dark:hover:bg-opacity-100"
), o === "gray" ? (m.push(
"border-gray-400 bg-gray-400 dark:border-gray-600 dark:bg-gray-600"
), m.push(
c ? "text-gray-300 hover:text-white dark:text-gray-600 dark:hover:text-white" : "text-white"
)) : o === "primary" ? (m.push("border-primary bg-primary"), m.push(
c ? "text-primary hover:text-white" : "text-white"
)) : o === "secondary" ? (m.push("border-secondary bg-secondary"), m.push(
c ? "text-secondary hover:text-white" : "text-white"
)) : o === "success" ? (m.push("border-success bg-success"), m.push(
c ? "text-success hover:text-white" : "text-white"
)) : o === "warning" ? (m.push("border-warning bg-warning"), m.push(
c ? "text-warning hover:text-white" : "text-white"
)) : o === "danger" ? (m.push("border-danger bg-danger"), m.push(
c ? "text-danger hover:text-white" : "text-white"
)) : o === "info" && (m.push("border-info bg-info"), m.push(
c ? "text-info hover:text-white" : "text-white"
))), d && m.push("uppercase"), l && m.push("k-button-zoom"), u && (m = m.join(" ").split(" ").filter((v) => !v.includes("hover:")), m.push("opacity-40")), t.loading ? m.push("cursor-pointer") : u ? m.push("cursor-not-allowed") : m.push("cursor-pointer"), r.concat(m);
}, FS = be({
name: "KButton",
autoload: !0,
props: HS,
emits: ["click"],
summary: "Botón",
setup(t, e) {
const n = (s) => !!e.slots[s], r = L(
() => qS(t, e.slots)
), i = Op(), o = L(() => t.submit ? "submit" : "button");
return {
buttonClasses: r,
type: o,
hasSlot: n,
click: (s) => {
if (t.disabled === !1 && t.loading === !1) {
if (t.to) {
i.push(t.to);
return;
}
e.emit("click");
} else
s.preventDefault();
}
};
}
});
const jS = ["id", "type"], US = { key: 0 }, WS = { key: 1 };
function YS(t, e, n, r, i, o) {
const a = he("k-icon");
return C(), P("button", {
id: t.id,
class: se(t.buttonClasses),
type: t.type,
onClick: e[0] || (e[0] = (...s) => t.click && t.click(...s))
}, [
t.loading ? (C(), P(Ee, { key: 0 }, [
J(a, {
class: se(["p-0", { "mr-3": t.hasSlot("default") }]),
icon: "spinner-third",
spin: ""
}, null, 8, ["class"]),
t.hasSlot("default") ? (C(), P("span", US, " Cargando... ")) : F("", !0)
], 64)) : (C(), P(Ee, { key: 1 }, [
t.icon ? (C(), oe(a, {
key: 0,
icon: t.icon,
type: t.iconType,
class: se({ "mr-2": t.hasSlot("default") })
}, null, 8, ["icon", "type", "class"])) : F("", !0),
t.hasSlot("default") ? (C(), P("span", WS, [
X(t.$slots, "default")
])) : F("", !0)
], 64))
], 10, jS);
}
const KS = /* @__PURE__ */ $e(FS, [["render", YS]]), GS = be({
name: "KIcon",
autoload: !0,
props: {
icon: {
type: String,
required: !0,
description: "Icono"
},
type: {
type: String,
default: "fad",
options: ["fas", "fal", "fad", "far"],
control: { type: "inline-radio" },
description: "Tipo de icono"
},
size: {
type: Number,
default: 0,
description: "Tamaño del icono"
},
spin: {
type: Boolean,
default: !1,
description: "Animación de rotación"
},
color: {
type: String,
control: { type: "inline-radio" },
options: Wr,
validator: (t) => Wr.includes(t) || t === "",
default: "",
description: "Color del icono"
}
},
setup(t) {
const e = L(() => {
const r = {};
return t.size > 0 && (r["font-size"] = t.size + "px"), r;
});
return { classes: L(() => {
let r = ["k-icon"];
return r.push(t.type), r.push(`fa-${t.icon}`), t.spin && r.push("fa-spin"), t.color === "white" ? r.push("text-white") : t.color === "black" ? r.push("text-black") : t.color === "gray" ? r.push("text-gray-300 ") : t.color === "primary" ? r.push("text-primary") : t.color === "secondary" ? r.push("text-secondary") : t.color === "success" ? r.push("text-success") : t.color === "warning" ? r.push("text-warning ") : t.color === "danger" ? r.push("text-danger ") : t.color === "info" && r.push("text-info"), r;
}), style: e };
}
});
function JS(t, e, n, r, i, o) {
return C(), P("i", {
class: se(t.classes),
style: Xe(t.style)
}, null, 6);
}
const XS = /* @__PURE__ */ $e(GS, [["render", JS]]), QS = be({
name: "KTitle",
autoload: !0,
props: {
size: {
type: Number,
default: 1,
description: "Define el tamaño del titulo.",
options: [1, 2, 3, 4, 5, 6],
control: { type: "inline-radio" }
},
uppercase: {
type: Boolean,
default: !1,
description: "Define si el titulo debe ser en mayusculas."
},
bold: {
type: Boolean,
default: !1,
description: "Define si el titulo debe ser en negrita."
},
bolder: {
type: Boolean,
default: !1,
description: "Define si el titulo debe ser en negrita."
},
center: {
type: Boolean,
default: !1,
description: "Define si el titulo debe ser centrado."
}
},
setup(t, { slots: e }) {
const n = (o) => !!e[o], r = L(() => {
if (n("subtitle")) {
const o = ["opacity-50"];
return t.size === 1 ? o.push("text-3xl") : t.size === 2 ? o.push("text-2xl") : t.size === 3 ? o.push("text-xl") : t.size === 4 ? o.push("text-lg") : t.size === 5 ? o.push("text-base") : t.size === 6 && o.push("text-sm"), t.center && o.push("text-center"), t.bolder ? o.push("font-bold") : t.bold && o.push("font-semibold"), o;
} else
return [];
});
return { dinamicClasses: L(() => {
const o = ["title"];
return t.size === 1 ? o.push("text-5xl") : t.size === 2 ? o.push("text-4xl") : t.size === 3 ? o.push("text-3xl") : t.size === 4 ? o.push("text-2xl") : t.size === 5 ? o.push("text-xl") : t.size === 6 && o.push("text-lg"), t.uppercase && o.push("uppercase"), t.center && o.push("text-center"), t.bolder ? o.push("font-bold") : t.bold && o.push("font-semibold"), o;
}), dinamicSubtitleClasses: r };
}
});
const ZS = { class: "k-title" };
function eE(t, e, n, r, i, o) {
return C(), P("div", ZS, [
t.size === 1 ? (C(), P("h1", {
key: 0,
class: se(t.dinamicClasses)
}, [
X(t.$slots, "default", {}, void 0, !0)
], 2)) : F("", !0),
t.size === 2 ? (C(), P("h2", {
key: 1,
class: se(t.dinamicClasses)
}, [
X(t.$slots, "default", {}, void 0, !0)
], 2)) : F("", !0),
t.size === 3 ? (C(), P("h3", {
key: 2,
class: se(t.dinamicClasses)
}, [
X(t.$slots, "default", {}, void 0, !0)
], 2)) : F("", !0),
t.size === 4 ? (C(), P("h4", {
key: 3,
class: se(t.dinamicClasses)
}, [
X(t.$slots, "default", {}, void 0, !0)
], 2)) : F("", !0),
t.size === 5 ? (C(), P("h5", {
key: 4,
class: se(t.dinamicClasses)
}, [
X(t.$slots, "default", {}, void 0, !0)
], 2)) : F("", !0),
t.size === 6 ? (C(), P("h6", {
key: 5,
class: se(t.dinamicClasses)
}, [
X(t.$slots, "default", {}, void 0, !0)
], 2)) : F("", !0),
t.dinamicSubtitleClasses.length > 0 ? (C(), P("div", {
key: 6,
class: se(t.dinamicSubtitleClasses)
}, [
X(t.$slots, "subtitle", {}, void 0, !0)
], 2)) : F("", !0)
]);
}
const tE = /* @__PURE__ */ $e(QS, [["render", eE], ["__scopeId", "data-v-1d186476"]]), nE = be({
name: "KInput",
props: {
modelValue: {
type: [String, Number],
required: !1,
default: "",
description: "Valor del componente"
},
id: {
type: String,
required: !1,
default: "",
description: "ID único"
},
maxlength: {
type: Number,
required: !1,
default: 0,
description: "Longitud máxima"
},
placeholder: {
type: String,
required: !1,
default: "",
description: "Texto explicativo"
},
required: {
type: Boolean,
default: !1,
description: "Indica si el campo es requerido"
},
label: {
type: String,
required: !1,
default: "",
description: "Etiqueta de definición"
},
size: {
type: String,
default: "md",
options: ["xs", "sm", "md", "lg"]
},
float: {
type: Boolean,
default: !1,
description: "Indica si el input tiene estilo flotante"
},
fieldset: {
type: Boolean,
default: !1,
description: "Indica si el input tiene estilo fieldset"
},
errors: {
type: Array,
required: !1,
default: () => [],
description: "Errores de validación"
},
status: {
type: String,
default: "",
options: ["warning", "success", "danger"],
description: "Color de estado del input"
},
type: {
type: String,
default: "text",
options: ["text", "password", "number", "email"]
},
width: {
type: Number,
default: 0,
description: "Ancho del input"
},
min: {
type: Number,
required: !1,
description: "Valor mínimo si el input es `number`"
},
max: {
type: Number,
required: !1,
description: "Valor máximo si el input es `number`"
},
autofocus: {
type: Boolean,
default: !1,
description: "Indica si el input se enfoca automáticamente"
},
disabled: {
type: Boolean,
default: !1,
description: "Indica si el input está deshabilitado"
},
autocomplete: {
type: String,
default: "off",
description: "Indica si el input tiene autocompletado"
},
step: {
type: [String, Number],
default: 1,
description: "Incremento o decremento del input"
}
},
emits: ["update:modelValue"],
setup(t, e) {
const n = t.maxlength > 0 ? t.maxlength : void 0, r = t.id || on(), i = (m) => !!e.slots[m], o = L({
get() {
return t.modelValue;
},
set(m) {
e.emit("update:modelValue", m);
}
}), a = L(() => {
const m = ["k-input-text", `k-input-text-${t.size}`];
return t.float ? m.push("k-input-text-floating") : t.fieldset && m.push("k-input-text-fieldset"), t.type === "number" && m.push("k-input-number"), t.errors.length > 0 ? m.push("k-input-text-danger") : t.status && m.push(`k-input-text-${t.status}`), m;
}), s = L(() => {
const m = {};
return t.width > 0 && (m.width = t.width + "px"), m;
}), u = L(() => t.label || i("default")), l = L(() => {
var m, v;
return t.float ? t.placeholder || t.label || ((v = (m = e.slots).default) == null ? void 0 : v.call(m).toString()) : t.placeholder;
}), c = (m) => {
o.value = m.target.value;
}, f = () => {
let m = o.value;
t.type === "number" && (m = Number(m), t.min !== void 0 && m < t.min && (m = t.min), t.max !== void 0 && m > t.max && (m = t.max), o.value = m);
}, d = L(() => (t.errors.length > 0 ? t.errors[0].$message : "").toString());
return {
maxLength: n,
uuid: r,
classes: a,
change: c,
firstError: d,
hasSlot: i,
hasLabel: u,
placeholderText: l,
sum: () => {
if (t.disabled)
return;
const v = (parseInt(t.modelValue.toString()) || 0) + 1;
t.max !== void 0 && v <= t.max ? o.value = v : t.max !== void 0 && v > t.max ? o.value = t.max : o.value = v;
},
subtract: () => {
if (t.disabled)
return;
const v = (parseInt(t.modelValue.toString()) || 0) - 1;
t.min !== void 0 && v >= t.min ? o.value = v : t.min !== void 0 && v < t.min ? o.value = t.min : o.value = v;
},
style: s,
model: o,
validate: f
};
}
});
const rE = ["for"], iE = {
key: 2,
class: "font-bold text-danger ml-1"
}, oE = ["id", "type", "maxlength", "placeholder", "required", "value", "min", "max", "step", "autofocus", "disabled", "autocomplete"], aE = ["for"], sE = {
key: 2,
class: "font-bold text-danger ml-1"
};
function uE(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip");
return C(), P("div", {
class: se([t.classes])
}, [
t.hasLabel && !t.float ? (C(), P("label", {
key: 0,
for: t.uuid
}, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label), 1)
], 64)),
t.required ? (C(), P("span", iE, "*")) : F("", !0),
t.firstError ? (C(), oe(s, {
key: 3,
content: t.firstError
}, {
default: ne(() => [
J(a, {
icon: "triangle-exclamation",
class: "ml-2"
})
]),
_: 1
}, 8, ["content"])) : F("", !0)
], 8, rE)) : F("", !0),
U("input", {
id: t.uuid,
type: t.type,
maxlength: t.maxLength,
placeholder: t.placeholderText,
required: t.required,
value: t.model,
min: t.min,
max: t.max,
step: t.step,
style: Xe(t.style),
autofocus: t.autofocus,
disabled: t.disabled,
autocomplete: t.autocomplete,
onInput: e[0] || (e[0] = (...u) => t.change && t.change(...u)),
onBlur: e[1] || (e[1] = (...u) => t.validate && t.validate(...u))
}, null, 44, oE),
t.type === "number" ? (C(), P("div", {
key: 1,
class: se(["k-input-control", t.disabled ? "disabled" : ""])
}, [
U("div", {
onClick: e[2] || (e[2] = (u) => t.sum())
}, [
J(a, {
icon: "plus",
type: "fas",
class: "k-input-icon",
size: 12
})
]),
U("div", {
onClick: e[3] || (e[3] = (u) => t.subtract())
}, [
J(a, {
icon: "minus",
type: "fas",
class: "k-input-icon",
size: 12
})
])
], 2)) : F("", !0),
t.hasLabel && t.float ? (C(), P("label", {
key: 2,
for: t.uuid
}, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label || t.placeholder), 1)
], 64)),
t.required ? (C(), P("span", sE, "*")) : F("", !0),
t.firstError ? (C(), oe(s, {
key: 3,
hover: "",
content: t.firstError
}, {
default: ne(() => [
J(a, {
icon: "triangle-exclamation",
class: "ml-2"
})
]),
_: 1
}, 8, ["content"])) : F("", !0)
], 8, aE)) : F("", !0)
], 2);
}
const lE = /* @__PURE__ */ $e(nE, [["render", uE]]);
var Sy = { exports: {} };
(function(t, e) {
(function(n, r) {
t.exports = r();
})(De, function() {
var n = 1e3, r = 6e4, i = 36e5, o = "millisecond", a = "second", s = "minute", u = "hour", l = "day", c = "week", f = "month", d = "quarter", p = "year", h = "date", m = "Invalid Date", v = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, k = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(I) {
var E = ["th", "st", "nd", "rd"], O = I % 100;
return "[" + I + (E[(O - 20) % 10] || E[O] || E[0]) + "]";
} }, T = function(I, E, O) {
var g = String(I);
return !g || g.length >= E ? I : "" + Array(E + 1 - g.length).join(O) + I;
}, b = { s: T, z: function(I) {
var E = -I.utcOffset(), O = Math.abs(E), g = Math.floor(O / 60), M = O % 60;
return (E <= 0 ? "+" : "-") + T(g, 2, "0") + ":" + T(M, 2, "0");
}, m: function I(E, O) {
if (E.date() < O.date())
return -I(O, E);
var g = 12 * (O.year() - E.year()) + (O.month() - E.month()), M = E.clone().add(g, f), H = O - M < 0, z = E.clone().add(g + (H ? -1 : 1), f);
return +(-(g + (O - M) / (H ? M - z : z - M)) || 0);
}, a: function(I) {
return I < 0 ? Math.ceil(I) || 0 : Math.floor(I);
}, p: function(I) {
return { M: f, y: p, w: c, d: l, D: h, h: u, m: s, s: a, ms: o, Q: d }[I] || String(I || "").toLowerCase().replace(/s$/, "");
}, u: function(I) {
return I === void 0;
} }, D = "en", x = {};
x[D] = k;
var S = "$isDayjsObject", _ = function(I) {
return I instanceof A || !(!I || !I[S]);
}, N = function I(E, O, g) {
var M;
if (!E)
return D;
if (typeof E == "string") {
var H = E.toLowerCase();
x[H] && (M = H), O && (x[H] = O, M = H);
var z = E.split("-");
if (!M && z.length > 1)
return I(z[0]);
} else {
var Y = E.name;
x[Y] = E, M = Y;
}
return !g && M && (D = M), M || !g && D;
}, R = function(I, E) {
if (_(I))
return I.clone();
var O = typeof E == "object" ? E : {};
return O.date = I, O.args = arguments, new A(O);
}, w = b;
w.l = N, w.i = _, w.w = function(I, E) {
return R(I, { locale: E.$L, utc: E.$u, x: E.$x, $offset: E.$offset });
};
var A = function() {
function I(O) {
this.$L = N(O.locale, null, !0), this.parse(O), this.$x = this.$x || O.x || {}, this[S] = !0;
}
var E = I.prototype;
return E.parse = function(O) {
this.$d = function(g) {
var M = g.date, H = g.utc;
if (M === null)
return /* @__PURE__ */ new Date(NaN);
if (w.u(M))
return /* @__PURE__ */ new Date();
if (M instanceof Date)
return new Date(M);
if (typeof M == "string" && !/Z$/i.test(M)) {
var z = M.match(v);
if (z) {
var Y = z[2] - 1 || 0, ee = (z[7] || "0").substring(0, 3);
return H ? new Date(Date.UTC(z[1], Y, z[3] || 1, z[4] || 0, z[5] || 0, z[6] || 0, ee)) : new Date(z[1], Y, z[3] || 1, z[4] || 0, z[5] || 0, z[6] || 0, ee);
}
}
return new Date(M);
}(O), this.init();
}, E.init = function() {
var O = this.$d;
this.$y = O.getFullYear(), this.$M = O.getMonth(), this.$D = O.getDate(), this.$W = O.getDay(), this.$H = O.getHours(), this.$m = O.getMinutes(), this.$s = O.getSeconds(), this.$ms = O.getMilliseconds();
}, E.$utils = function() {
return w;
}, E.isValid = function() {
return this.$d.toString() !== m;
}, E.isSame = function(O, g) {
var M = R(O);
return this.startOf(g) <= M && M <= this.endOf(g);
}, E.isAfter = function(O, g) {
return R(O) < this.startOf(g);
}, E.isBefore = function(O, g) {
return this.endOf(g) < R(O);
}, E.$g = function(O, g, M) {
return w.u(O) ? this[g] : this.set(M, O);
}, E.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, E.valueOf = function() {
return this.$d.getTime();
}, E.startOf = function(O, g) {
var M = this, H = !!w.u(g) || g, z = w.p(O), Y = function(Z, ae) {
var ke = w.w(M.$u ? Date.UTC(M.$y, ae, Z) : new Date(M.$y, ae, Z), M);
return H ? ke : ke.endOf(l);
}, ee = function(Z, ae) {
return w.w(M.toDate()[Z].apply(M.toDate("s"), (H ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ae)), M);
}, ce = this.$W, q = this.$M, V = this.$D, te = "set" + (this.$u ? "UTC" : "");
switch (z) {
case p:
return H ? Y(1, 0) : Y(31, 11);
case f:
return H ? Y(1, q) : Y(0, q + 1);
case c:
var K = this.$locale().weekStart || 0, Q = (ce < K ? ce + 7 : ce) - K;
return Y(H ? V - Q : V + (6 - Q), q);
case l:
case h:
return ee(te + "Hours", 0);
case u:
return ee(te + "Minutes", 1);
case s:
return ee(te + "Seconds", 2);
case a:
return ee(te + "Milliseconds", 3);
default:
return this.clone();
}
}, E.endOf = function(O) {
return this.startOf(O, !1);
}, E.$set = function(O, g) {
var M, H = w.p(O), z = "set" + (this.$u ? "UTC" : ""), Y = (M = {}, M[l] = z + "Date", M[h] = z + "Date", M[f] = z + "Month", M[p] = z + "FullYear", M[u] = z + "Hours", M[s] = z + "Minutes", M[a] = z + "Seconds", M[o] = z + "Milliseconds", M)[H], ee = H === l ? this.$D + (g - this.$W) : g;
if (H === f || H === p) {
var ce = this.clone().set(h, 1);
ce.$d[Y](ee), ce.init(), this.$d = ce.set(h, Math.min(this.$D, ce.daysInMonth())).$d;
} else
Y && this.$d[Y](ee);
return this.init(), this;
}, E.set = function(O, g) {
return this.clone().$set(O, g);
}, E.get = function(O) {
return this[w.p(O)]();
}, E.add = function(O, g) {
var M, H = this;
O = Number(O);
var z = w.p(g), Y = function(q) {
var V = R(H);
return w.w(V.date(V.date() + Math.round(q * O)), H);
};
if (z === f)
return this.set(f, this.$M + O);
if (z === p)
return this.set(p, this.$y + O);
if (z === l)
return Y(1);
if (z === c)
return Y(7);
var ee = (M = {}, M[s] = r, M[u] = i, M[a] = n, M)[z] || 1, ce = this.$d.getTime() + O * ee;
return w.w(ce, this);
}, E.subtract = function(O, g) {
return this.add(-1 * O, g);
}, E.format = function(O) {
var g = this, M = this.$locale();
if (!this.isValid())
return M.invalidDate || m;
var H = O || "YYYY-MM-DDTHH:mm:ssZ", z = w.z(this), Y = this.$H, ee = this.$m, ce = this.$M, q = M.weekdays, V = M.months, te = M.meridiem, K = function(ae, ke, ge, de) {
return ae && (ae[ke] || ae(g, H)) || ge[ke].slice(0, de);
}, Q = function(ae) {
return w.s(Y % 12 || 12, ae, "0");
}, Z = te || function(ae, ke, ge) {
var de = ae < 12 ? "AM" : "PM";
return ge ? de.toLowerCase() : de;
};
return H.replace(y, function(ae, ke) {
return ke || function(ge) {
switch (ge) {
case "YY":
return String(g.$y).slice(-2);
case "YYYY":
return w.s(g.$y, 4, "0");
case "M":
return ce + 1;
case "MM":
return w.s(ce + 1, 2, "0");
case "MMM":
return K(M.monthsShort, ce, V, 3);
case "MMMM":
return K(V, ce);
case "D":
return g.$D;
case "DD":
return w.s(g.$D, 2, "0");
case "d":
return String(g.$W);
case "dd":
return K(M.weekdaysMin, g.$W, q, 2);
case "ddd":
return K(M.weekdaysShort, g.$W, q, 3);
case "dddd":
return q[g.$W];
case "H":
return String(Y);
case "HH":
return w.s(Y, 2, "0");
case "h":
return Q(1);
case "hh":
return Q(2);
case "a":
return Z(Y, ee, !0);
case "A":
return Z(Y, ee, !1);
case "m":
return String(ee);
case "mm":
return w.s(ee, 2, "0");
case "s":
return String(g.$s);
case "ss":
return w.s(g.$s, 2, "0");
case "SSS":
return w.s(g.$ms, 3, "0");
case "Z":
return z;
}
return null;
}(ae) || z.replace(":", "");
});
}, E.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, E.diff = function(O, g, M) {
var H, z = this, Y = w.p(g), ee = R(O), ce = (ee.utcOffset() - this.utcOffset()) * r, q = this - ee, V = function() {
return w.m(z, ee);
};
switch (Y) {
case p:
H = V() / 12;
break;
case f:
H = V();
break;
case d:
H = V() / 3;
break;
case c:
H = (q - ce) / 6048e5;
break;
case l:
H = (q - ce) / 864e5;
break;
case u:
H = q / i;
break;
case s:
H = q / r;
break;
case a:
H = q / n;
break;
default:
H = q;
}
return M ? H : w.a(H);
}, E.daysInMonth = function() {
return this.endOf(f).$D;
}, E.$locale = function() {
return x[this.$L];
}, E.locale = function(O, g) {
if (!O)
return this.$L;
var M = this.clone(), H = N(O, g, !0);
return H && (M.$L = H), M;
}, E.clone = function() {
return w.w(this.$d, this);
}, E.toDate = function() {
return new Date(this.valueOf());
}, E.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, E.toISOString = function() {
return this.$d.toISOString();
}, E.toString = function() {
return this.$d.toUTCString();
}, I;
}(), $ = A.prototype;
return R.prototype = $, [["$ms", o], ["$s", a], ["$m", s], ["$H", u], ["$W", l], ["$M", f], ["$y", p], ["$D", h]].forEach(function(I) {
$[I[1]] = function(E) {
return this.$g(E, I[0], I[1]);
};
}), R.extend = function(I, E) {
return I.$i || (I(E, A, R), I.$i = !0), R;
}, R.locale = N, R.isDayjs = _, R.unix = function(I) {
return R(1e3 * I);
}, R.en = x[D], R.Ls = x, R.p = {}, R;
});
})(Sy);
var Ey = Sy.exports;
const at = /* @__PURE__ */ Ui(Ey);
var _y = { exports: {} };
(function(t, e) {
(function(n, r) {
t.exports = r();
})(De, function() {
return function(n, r, i) {
n = n || {};
var o = r.prototype, a = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
function s(l, c, f, d) {
return o.fromToBase(l, c, f, d);
}
i.en.relativeTime = a, o.fromToBase = function(l, c, f, d, p) {
for (var h, m, v, y = f.$locale().relativeTime || a, k = n.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], T = k.length, b = 0; b < T; b += 1) {
var D = k[b];
D.d && (h = d ? i(l).diff(f, D.d, !0) : f.diff(l, D.d, !0));
var x = (n.rounding || Math.round)(Math.abs(h));
if (v = h > 0, x <= D.r || !D.r) {
x <= 1 && b > 0 && (D = k[b - 1]);
var S = y[D.l];
p && (x = p("" + x)), m = typeof S == "string" ? S.replace("%d", x) : S(x, c, D.l, v);
break;
}
}
if (c)
return m;
var _ = v ? y.future : y.past;
return typeof _ == "function" ? _(m) : _.replace("%s", m);
}, o.to = function(l, c) {
return s(l, c, this, !0);
}, o.from = function(l, c) {
return s(l, c, this);
};
var u = function(l) {
return l.$u ? i.utc() : i();
};
o.toNow = function(l) {
return this.to(u(this), l);
}, o.fromNow = function(l) {
return this.from(u(this), l);
};
};
});
})(_y);
var cE = _y.exports;
const dE = /* @__PURE__ */ Ui(cE);
var Ty = { exports: {} };
(function(t, e) {
(function(n, r) {
t.exports = r();
})(De, function() {
return function(n, r, i) {
r.prototype.isBetween = function(o, a, s, u) {
var l = i(o), c = i(a), f = (u = u || "()")[0] === "(", d = u[1] === ")";
return (f ? this.isAfter(l, s) : !this.isBefore(l, s)) && (d ? this.isBefore(c, s) : !this.isAfter(c, s)) || (f ? this.isBefore(l, s) : !this.isAfter(l, s)) && (d ? this.isAfter(c, s) : !this.isBefore(c, s));
};
};
});
})(Ty);
var fE = Ty.exports;
const pE = /* @__PURE__ */ Ui(fE);
var Cy = { exports: {} };
(function(t, e) {
(function(n, r) {
t.exports = r();
})(De, function() {
var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
return function(r, i, o) {
var a = i.prototype, s = a.format;
o.en.formats = n, a.format = function(u) {
u === void 0 && (u = "YYYY-MM-DDTHH:mm:ssZ");
var l = this.$locale().formats, c = function(f, d) {
return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(p, h, m) {
var v = m && m.toUpperCase();
return h || d[m] || n[m] || d[v].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(y, k, T) {
return k || T.slice(1);
});
});
}(u, l === void 0 ? {} : l);
return s.call(this, c);
};
};
});
})(Cy);
var hE = Cy.exports;
const mE = /* @__PURE__ */ Ui(hE);
var Oy = { exports: {} };
(function(t, e) {
(function(n, r) {
t.exports = r();
})(De, function() {
var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, r = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, i = /\d\d/, o = /\d\d?/, a = /\d*[^-_:/,()\s\d]+/, s = {}, u = function(m) {
return (m = +m) + (m > 68 ? 1900 : 2e3);
}, l = function(m) {
return function(v) {
this[m] = +v;
};
}, c = [/[+-]\d\d:?(\d\d)?|Z/, function(m) {
(this.zone || (this.zone = {})).offset = function(v) {
if (!v || v === "Z")
return 0;
var y = v.match(/([+-]|\d\d)/g), k = 60 * y[1] + (+y[2] || 0);
return k === 0 ? 0 : y[0] === "+" ? -k : k;
}(m);
}], f = function(m) {
var v = s[m];
return v && (v.indexOf ? v : v.s.concat(v.f));
}, d = function(m, v) {
var y, k = s.meridiem;
if (k) {
for (var T = 1; T <= 24; T += 1)
if (m.indexOf(k(T, 0, v)) > -1) {
y = T > 12;
break;
}
} else
y = m === (v ? "pm" : "PM");
return y;
}, p = { A: [a, function(m) {
this.afternoon = d(m, !1);
}], a: [a, function(m) {
this.afternoon = d(m, !0);
}], S: [/\d/, function(m) {
this.milliseconds = 100 * +m;
}], SS: [i, function(m) {
this.milliseconds = 10 * +m;
}], SSS: [/\d{3}/, function(m) {
this.milliseconds = +m;
}], s: [o, l("seconds")], ss: [o, l("seconds")], m: [o, l("minutes")], mm: [o, l("minutes")], H: [o, l("hours")], h: [o, l("hours")], HH: [o, l("hours")], hh: [o, l("hours")], D: [o, l("day")], DD: [i, l("day")], Do: [a, function(m) {
var v = s.ordinal, y = m.match(/\d+/);
if (this.day = y[0], v)
for (var k = 1; k <= 31; k += 1)
v(k).replace(/\[|\]/g, "") === m && (this.day = k);
}], M: [o, l("month")], MM: [i, l("month")], MMM: [a, function(m) {
var v = f("months"), y = (f("monthsShort") || v.map(function(k) {
return k.slice(0, 3);
})).indexOf(m) + 1;
if (y < 1)
throw new Error();
this.month = y % 12 || y;
}], MMMM: [a, function(m) {
var v = f("months").indexOf(m) + 1;
if (v < 1)
throw new Error();
this.month = v % 12 || v;
}], Y: [/[+-]?\d+/, l("year")], YY: [i, function(m) {
this.year = u(m);
}], YYYY: [/\d{4}/, l("year")], Z: c, ZZ: c };
function h(m) {
var v, y;
v = m, y = s && s.formats;
for (var k = (m = v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(N, R, w) {
var A = w && w.toUpperCase();
return R || y[w] || n[w] || y[A].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function($, I, E) {
return I || E.slice(1);
});
})).match(r), T = k.length, b = 0; b < T; b += 1) {
var D = k[b], x = p[D], S = x && x[0], _ = x && x[1];
k[b] = _ ? { regex: S, parser: _ } : D.replace(/^\[|\]$/g, "");
}
return function(N) {
for (var R = {}, w = 0, A = 0; w < T; w += 1) {
var $ = k[w];
if (typeof $ == "string")
A += $.length;
else {
var I = $.regex, E = $.parser, O = N.slice(A), g = I.exec(O)[0];
E.call(R, g), N = N.replace(g, "");
}
}
return function(M) {
var H = M.afternoon;
if (H !== void 0) {
var z = M.hours;
H ? z < 12 && (M.hours += 12) : z === 12 && (M.hours = 0), delete M.afternoon;
}
}(R), R;
};
}
return function(m, v, y) {
y.p.customParseFormat = !0, m && m.parseTwoDigitYear && (u = m.parseTwoDigitYear);
var k = v.prototype, T = k.parse;
k.parse = function(b) {
var D = b.date, x = b.utc, S = b.args;
this.$u = x;
var _ = S[1];
if (typeof _ == "string") {
var N = S[2] === !0, R = S[3] === !0, w = N || R, A = S[2];
R && (A = S[2]), s = this.$locale(), !N && A && (s = y.Ls[A]), this.$d = function(O, g, M) {
try {
if (["x", "X"].indexOf(g) > -1)
return new Date((g === "X" ? 1e3 : 1) * O);
var H = h(g)(O), z = H.year, Y = H.month, ee = H.day, ce = H.hours, q = H.minutes, V = H.seconds, te = H.milliseconds, K = H.zone, Q = /* @__PURE__ */ new Date(), Z = ee || (z || Y ? 1 : Q.getDate()), ae = z || Q.getFullYear(), ke = 0;
z && !Y || (ke = Y > 0 ? Y - 1 : Q.getMonth());
var ge = ce || 0, de = q || 0, ye = V || 0, xe = te || 0;
return K ? new Date(Date.UTC(ae, ke, Z, ge, de, ye, xe + 60 * K.offset * 1e3)) : M ? new Date(Date.UTC(ae, ke, Z, ge, de, ye, xe)) : new Date(ae, ke, Z, ge, de, ye, xe);
} catch {
return /* @__PURE__ */ new Date("");
}
}(D, _, x), this.init(), A && A !== !0 && (this.$L = this.locale(A).$L), w && D != this.format(_) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
} else if (_ instanceof Array)
for (var $ = _.length, I = 1; I <= $; I += 1) {
S[1] = _[I - 1];
var E = y.apply(this, S);
if (E.isValid()) {
this.$d = E.$d, this.$L = E.$L, this.init();
break;
}
I === $ && (this.$d = /* @__PURE__ */ new Date(""));
}
else
T.call(this, b);
};
};
});
})(Oy);
var gE = Oy.exports;
const bE = /* @__PURE__ */ Ui(gE);
var Ay = { exports: {} };
(function(t, e) {
(function(n, r) {
t.exports = r();
})(De, function() {
var n = "minute", r = /[+-]\d\d(?::?\d\d)?/g, i = /([+-]|\d\d)/g;
return function(o, a, s) {
var u = a.prototype;
s.utc = function(m) {
var v = { date: m, utc: !0, args: arguments };
return new a(v);
}, u.utc = function(m) {
var v = s(this.toDate(), { locale: this.$L, utc: !0 });
return m ? v.add(this.utcOffset(), n) : v;
}, u.local = function() {
return s(this.toDate(), { locale: this.$L, utc: !1 });
};
var l = u.parse;
u.parse = function(m) {
m.utc && (this.$u = !0), this.$utils().u(m.$offset) || (this.$offset = m.$offset), l.call(this, m);
};
var c = u.init;
u.init = function() {
if (this.$u) {
var m = this.$d;
this.$y = m.getUTCFullYear(), this.$M = m.getUTCMonth(), this.$D = m.getUTCDate(), this.$W = m.getUTCDay(), this.$H = m.getUTCHours(), this.$m = m.getUTCMinutes(), this.$s = m.getUTCSeconds(), this.$ms = m.getUTCMilliseconds();
} else
c.call(this);
};
var f = u.utcOffset;
u.utcOffset = function(m, v) {
var y = this.$utils().u;
if (y(m))
return this.$u ? 0 : y(this.$offset) ? f.call(this) : this.$offset;
if (typeof m == "string" && (m = function(D) {
D === void 0 && (D = "");
var x = D.match(r);
if (!x)
return null;
var S = ("" + x[0]).match(i) || ["-", 0, 0], _ = S[0], N = 60 * +S[1] + +S[2];
return N === 0 ? 0 : _ === "+" ? N : -N;
}(m), m === null))
return this;
var k = Math.abs(m) <= 16 ? 60 * m : m, T = this;
if (v)
return T.$offset = k, T.$u = m === 0, T;
if (m !== 0) {
var b = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
(T = this.local().add(k + b, n)).$offset = k, T.$x.$localOffset = b;
} else
T = this.utc();
return T;
};
var d = u.format;
u.format = function(m) {
var v = m || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
return d.call(this, v);
}, u.valueOf = function() {
var m = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
return this.$d.valueOf() - 6e4 * m;
}, u.isUTC = function() {
return !!this.$u;
}, u.toISOString = function() {
return this.toDate().toISOString();
}, u.toString = function() {
return this.toDate().toUTCString();
};
var p = u.toDate;
u.toDate = function(m) {
return m === "s" && this.$offset ? s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : p.call(this);
};
var h = u.diff;
u.diff = function(m, v, y) {
if (m && this.$u === m.$u)
return h.call(this, m, v, y);
var k = this.local(), T = s(m).local();
return h.call(k, T, v, y);
};
};
});
})(Ay);
var vE = Ay.exports;
const yE = /* @__PURE__ */ Ui(vE);
var wE = { exports: {} };
(function(t, e) {
(function(n, r) {
t.exports = r(Ey);
})(De, function(n) {
function r(a) {
return a && typeof a == "object" && "default" in a ? a : { default: a };
}
var i = r(n), o = { name: "es", monthsShort: "ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"), weekdays: "domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"), weekdaysShort: "dom._lun._mar._mié._jue._vie._sáb.".split("_"), weekdaysMin: "do_lu_ma_mi_ju_vi_sá".split("_"), months: "enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"), weekStart: 1, formats: { LT: "H:mm", LTS: "H:mm:ss", L: "DD/MM/YYYY", LL: "D [de] MMMM [de] YYYY", LLL: "D [de] MMMM [de] YYYY H:mm", LLLL: "dddd, D [de] MMMM [de] YYYY H:mm" }, relativeTime: { future: "en %s", past: "hace %s", s: "unos segundos", m: "un minuto", mm: "%d minutos", h: "una hora", hh: "%d horas", d: "un día", dd: "%d días", M: "un mes", MM: "%d meses", y: "un año", yy: "%d años" }, ordinal: function(a) {
return a + "º";
} };
return i.default.locale(o, null, !0), o;
});
})(wE);
at.extend(dE);
at.extend(pE);
at.extend(mE);
at.extend(bE);
at.extend(yE);
at.locale("es");
const kE = {
ucfirst(t) {
return t.charAt(0).toUpperCase() + t.slice(1);
}
}, gu = {
TOP_LEFT: "top-left",
TOP_RIGHT: "top-right",
TOP_CENTER: "top-center",
BOTTOM_LEFT: "bottom-left",
BOTTOM_RIGHT: "bottom-right",
BOTTOM_CENTER: "bottom-center"
}, Ia = {
LIGHT: "light",
DARK: "dark",
COLORED: "colored",
AUTO: "auto"
}, _n = {
INFO: "info",
SUCCESS: "success",
WARNING: "warning",
ERROR: "error",
DEFAULT: "default"
}, xE = {
BOUNCE: "bounce",
SLIDE: "slide",
FLIP: "flip",
ZOOM: "zoom"
}, My = {
dangerouslyHTMLString: !1,
multiple: !0,
position: gu.TOP_RIGHT,
autoClose: 5e3,
transition: "bounce",
hideProgressBar: !1,
pauseOnHover: !0,
pauseOnFocusLoss: !0,
closeOnClick: !0,
className: "",
bodyClassName: "",
style: {},
progressClassName: "",
progressStyle: {},
role: "alert",
theme: "light"
}, SE = {
rtl: !1,
newestOnTop: !1,
toastClassName: ""
}, Dy = {
...My,
...SE
};
({
...My,
type: _n.DEFAULT
});
var gt = /* @__PURE__ */ ((t) => (t[t.COLLAPSE_DURATION = 300] = "COLLAPSE_DURATION", t[t.DEBOUNCE_DURATION = 50] = "DEBOUNCE_DURATION", t.CSS_NAMESPACE = "Toastify", t))(gt || {}), Xf = /* @__PURE__ */ ((t) => (t.ENTRANCE_ANIMATION_END = "d", t))(Xf || {});
const EE = {
enter: "Toastify--animate Toastify__bounce-enter",
exit: "Toastify--animate Toastify__bounce-exit",
appendPosition: !0
}, _E = {
enter: "Toastify--animate Toastify__slide-enter",
exit: "Toastify--animate Toastify__slide-exit",
appendPosition: !0
}, TE = {
enter: "Toastify--animate Toastify__zoom-enter",
exit: "Toastify--animate Toastify__zoom-exit"
}, CE = {
enter: "Toastify--animate Toastify__flip-enter",
exit: "Toastify--animate Toastify__flip-exit"
};
function $y(t) {
let e = EE;
if (!t || typeof t == "string")
switch (t) {
case "flip":
e = CE;
break;
case "zoom":
e = TE;
break;
case "slide":
e = _E;
break;
}
else
e = t;
return e;
}
function OE(t) {
return t.containerId || String(t.position);
}
const jc = "will-unmount";
function AE(t = gu.TOP_RIGHT) {
return !!document.querySelector(".".concat(gt.CSS_NAMESPACE, "__toast-container--").concat(t));
}
function ME(t = gu.TOP_RIGHT) {
return "".concat(gt.CSS_NAMESPACE, "__toast-container--").concat(t);
}
function DE(t, e, n = !1) {
const r = [
"".concat(gt.CSS_NAMESPACE, "__toast-container"),
"".concat(gt.CSS_NAMESPACE, "__toast-container--").concat(t),
n ? "".concat(gt.CSS_NAMESPACE, "__toast-container--rtl") : null
].filter(Boolean).join(" ");
return ba(e) ? e({
position: t,
rtl: n,
defaultClassName: r
}) : "".concat(r, " ").concat(e || "");
}
function $E(t) {
var e;
const { position: n, containerClassName: r, rtl: i = !1, style: o = {} } = t, a = gt.CSS_NAMESPACE, s = ME(n), u = document.querySelector(".".concat(a)), l = document.querySelector(".".concat(s)), c = !!l && !((e = l.className) != null && e.includes(jc)), f = u || document.createElement("div"), d = document.createElement("div");
d.className = DE(
n,
r,
i
), d.dataset.testid = "".concat(gt.CSS_NAMESPACE, "__toast-container--").concat(n), d.id = OE(t);
for (const p in o)
if (Object.prototype.hasOwnProperty.call(o, p)) {
const h = o[p];
d.style[p] = h;
}
return u || (f.className = gt.CSS_NAMESPACE, document.body.appendChild(f)), c || f.appendChild(d), d;
}
function Qf(t) {
var e, n, r;
const i = typeof t == "string" ? t : ((e = t.currentTarget) == null ? void 0 : e.id) || ((n = t.target) == null ? void 0 : n.id), o = document.getElementById(i);
o && o.removeEventListener("animationend", Qf, !1);
try {
Gs[i].unmount(), (r = document.getElementById(i)) == null || r.remove(), delete Gs[i], delete tn[i];
} catch {
}
}
const Gs = Qt({});
function NE(t, e) {
const n = document.getElementById(String(e));
n && (Gs[n.id] = t);
}
function Zf(t, e = !0) {
const n = String(t);
if (!Gs[n])
return;
const r = document.getElementById(n);
r && r.classList.add(jc), e ? (IE(t), r && r.addEventListener("animationend", Qf, !1)) : Qf(n), Yr.items = Yr.items.filter((i) => i.containerId !== t);
}
function PE(t) {
for (const e in Gs)
Zf(e, t);
Yr.items = [];
}
function Ny(t, e) {
const n = document.getElementById(t.toastId);
if (n) {
let r = t;
r = {
...r,
...$y(r.transition)
};
const i = r.appendPosition ? "".concat(r.exit, "--").concat(r.position) : r.exit;
n.className += " ".concat(i), e && e(n);
}
}
function IE(t) {
for (const e in tn)
if (e === t)
for (const n of tn[e] || [])
Ny(n);
}
function LE(t) {
const e = bu().find((n) => n.toastId === t);
return e == null ? void 0 : e.containerId;
}
function Ap(t) {
return document.getElementById(t);
}
function RE(t) {
const e = Ap(t.containerId);
return e && e.classList.contains(jc);
}
function o1(t) {
var e;
const n = ip(t.content) ? wn(t.content.props) : null;
return n ?? wn((e = t.data) != null ? e : {});
}
function BE(t) {
return t ? Yr.items.filter((e) => e.containerId === t).length > 0 : Yr.items.length > 0;
}
function VE() {
if (Yr.items.length > 0) {
const t = Yr.items.shift();
cl(t == null ? void 0 : t.toastContent, t == null ? void 0 : t.toastProps);
}
}
const tn = Qt({}), Yr = Qt({
items: []
});
function bu() {
const t = wn(tn);
return Object.values(t).reduce((e, n) => [...e, ...n], []);
}
function zE(t) {
return bu().find((e) => e.toastId === t);
}
function cl(t, e = {}) {
if (RE(e)) {
const n = Ap(e.containerId);
n && n.addEventListener("animationend", e0.bind(null, t, e), !1);
} else
e0(t, e);
}
function e0(t, e = {}) {
const n = Ap(e.containerId);
n && n.removeEventListener("animationend", e0.bind(null, t, e), !1);
const r = tn[e.containerId] || [], i = r.length > 0;
if (!i && !AE(e.position)) {
const o = $E(e), a = Tl(o_, e);
a.mount(o), NE(a, o.id);
}
i && (e.position = r[0].position), Vn(() => {
e.updateId ? Hr.update(e) : Hr.add(t, e);
});
}
const Hr = {
/**
* add a toast
* @param _ ..
* @param opts toast props
*/
add(t, e) {
const { containerId: n = "" } = e;
n && (tn[n] = tn[n] || [], tn[n].find((r) => r.toastId === e.toastId) || setTimeout(() => {
var r, i;
e.newestOnTop ? (r = tn[n]) == null || r.unshift(e) : (i = tn[n]) == null || i.push(e), e.onOpen && e.onOpen(o1(e));
}, e.delay || 0));
},
/**
* remove a toast
* @param id toastId
*/
remove(t) {
if (t) {
const e = LE(t);
if (e) {
const n = tn[e];
let r = n.find((i) => i.toastId === t);
tn[e] = n.filter((i) => i.toastId !== t), !tn[e].length && !BE(e) && Zf(e, !1), VE(), Vn(() => {
r != null && r.onClose && (r.onClose(o1(r)), r = void 0);
});
}
}
},
/**
* update the toast
* @param opts toast props
*/
update(t = {}) {
const { containerId: e = "" } = t;
if (e && t.updateId) {
tn[e] = tn[e] || [];
const n = tn[e].find((r) => r.toastId === t.toastId);
n && setTimeout(() => {
for (const r in t)
if (Object.prototype.hasOwnProperty.call(t, r)) {
const i = t[r];
n[r] = i;
}
}, t.delay || 0);
}
},
/**
* clear all toasts in container.
* @param containerId container id
*/
clear(t, e = !0) {
t ? Zf(t, e) : PE(e);
},
dismissCallback(t) {
var e;
const n = (e = t.currentTarget) == null ? void 0 : e.id, r = document.getElementById(n);
r && (r.removeEventListener("animationend", Hr.dismissCallback, !1), setTimeout(() => {
Hr.remove(n);
}));
},
dismiss(t) {
if (t) {
const e = bu();
for (const n of e)
if (n.toastId === t) {
Ny(n, (r) => {
r.addEventListener("animationend", Hr.dismissCallback, !1);
});
break;
}
}
}
}, Py = Qt({}), $l = Qt({});
function Iy() {
return Math.random().toString(36).substring(2, 9);
}
function HE(t) {
return typeof t == "number" && !isNaN(t);
}
function t0(t) {
return typeof t == "string";
}
function ba(t) {
return typeof t == "function";
}
function Uc(...t) {
return dt(...t);
}
function dl(t) {
return typeof t == "object" && (!!(t != null && t.render) || !!(t != null && t.setup) || typeof (t == null ? void 0 : t.type) == "object");
}
function qE(t = {}) {
Py["".concat(gt.CSS_NAMESPACE, "-default-options")] = t;
}
function FE() {
return Py["".concat(gt.CSS_NAMESPACE, "-default-options")] || Dy;
}
function jE() {
return document.documentElement.classList.contains("dark") ? "dark" : "light";
}
var fl = /* @__PURE__ */ ((t) => (t[t.Enter = 0] = "Enter", t[t.Exit = 1] = "Exit", t))(fl || {});
const Ly = {
containerId: {
type: [String, Number],
required: !1,
default: ""
},
clearOnUrlChange: {
type: Boolean,
required: !1,
default: !0
},
dangerouslyHTMLString: {
type: Boolean,
required: !1,
default: !1
},
multiple: {
type: Boolean,
required: !1,
default: !0
},
limit: {
type: Number,
required: !1,
default: void 0
},
position: {
type: String,
required: !1,
default: gu.TOP_LEFT
},
bodyClassName: {
type: String,
required: !1,
default: ""
},
autoClose: {
type: [Number, Boolean],
required: !1,
default: !1
},
closeButton: {
type: [Boolean, Function, Object],
required: !1,
default: void 0
},
transition: {
type: [String, Object],
required: !1,
default: "bounce"
},
hideProgressBar: {
type: Boolean,
required: !1,
default: !1
},
pauseOnHover: {
type: Boolean,
required: !1,
default: !0
},
pauseOnFocusLoss: {
type: Boolean,
required: !1,
default: !0
},
closeOnClick: {
type: Boolean,
required: !1,
default: !0
},
progress: {
type: Number,
required: !1,
default: void 0
},
progressClassName: {
type: String,
required: !1,
default: ""
},
toastStyle: {
type: Object,
required: !1,
default() {
return {};
}
},
progressStyle: {
type: Object,
required: !1,
default() {
return {};
}
},
role: {
type: String,
required: !1,
default: "alert"
},
theme: {
type: String,
required: !1,
default: Ia.AUTO
},
content: {
type: [String, Object, Function],
required: !1,
default: ""
},
toastId: {
type: [String, Number],
required: !1,
default: ""
},
data: {
type: [Object, String],
required: !1,
default() {
return {};
}
},
type: {
type: String,
required: !1,
default: _n.DEFAULT
},
icon: {
type: [Boolean, String, Number, Object, Function],
required: !1,
default: void 0
},
delay: {
type: Number,
required: !1,
default: void 0
},
onOpen: {
type: Function,
required: !1,
default: void 0
},
onClose: {
type: Function,
required: !1,
default: void 0
},
onClick: {
type: Function,
required: !1,
default: void 0
},
isLoading: {
type: Boolean,
required: !1,
default: void 0
},
rtl: {
type: Boolean,
required: !1,
default: !1
},
toastClassName: {
type: String,
required: !1,
default: ""
},
updateId: {
type: [String, Number],
required: !1,
default: ""
}
}, UE = {
autoClose: {
type: [Number, Boolean],
required: !0
},
isRunning: {
type: Boolean,
required: !1,
default: void 0
},
type: {
type: String,
required: !1,
default: _n.DEFAULT
},
theme: {
type: String,
required: !1,
default: Ia.AUTO
},
hide: {
type: Boolean,
required: !1,
default: void 0
},
className: {
type: [String, Function],
required: !1,
default: ""
},
controlledProgress: {
type: Boolean,
required: !1,
default: void 0
},
rtl: {
type: Boolean,
required: !1,
default: void 0
},
isIn: {
type: Boolean,
required: !1,
default: void 0
},
progress: {
type: Number,
required: !1,
default: void 0
},
closeToast: {
type: Function,
required: !1,
default: void 0
}
}, WE = /* @__PURE__ */ be({
name: "ProgressBar",
props: UE,
// @ts-ignore
setup(t, {
attrs: e
}) {
const n = re(), r = L(() => t.hide ? "true" : "false"), i = L(() => ({
...e.style || {},
animationDuration: "".concat(t.autoClose === !0 ? 5e3 : t.autoClose, "ms"),
animationPlayState: t.isRunning ? "running" : "paused",
opacity: t.hide ? 0 : 1,
transform: t.controlledProgress ? "scaleX(".concat(t.progress, ")") : "none"
})), o = L(() => ["".concat(gt.CSS_NAMESPACE, "__progress-bar"), t.controlledProgress ? "".concat(gt.CSS_NAMESPACE, "__progress-bar--controlled") : "".concat(gt.CSS_NAMESPACE, "__progress-bar--animated"), "".concat(gt.CSS_NAMESPACE, "__progress-bar-theme--").concat(t.theme), "".concat(gt.CSS_NAMESPACE, "__progress-bar--").concat(t.type), t.rtl ? "".concat(gt.CSS_NAMESPACE, "__progress-bar--rtl") : null].filter(Boolean).join(" ")), a = L(() => "".concat(o.value, " ").concat((e == null ? void 0 : e.class) || "")), s = () => {
n.value && (n.value.onanimationend = null, n.value.ontransitionend = null);
}, u = () => {
t.isIn && t.closeToast && t.autoClose !== !1 && (t.closeToast(), s());
}, l = L(() => t.controlledProgress ? null : u), c = L(() => t.controlledProgress ? u : null);
return ga(() => {
n.value && (s(), n.value.onanimationend = l.value, n.value.ontransitionend = c.value);
}), () => J("div", {
ref: n,
role: "progressbar",
"aria-hidden": r.value,
"aria-label": "notification timer",
class: a.value,
style: i.value
}, null);
}
}), YE = /* @__PURE__ */ be({
name: "CloseButton",
inheritAttrs: !1,
props: {
theme: {
type: String,
required: !1,
default: Ia.AUTO
},
type: {
type: String,
required: !1,
default: Ia.LIGHT
},
ariaLabel: {
type: String,
required: !1,
default: "close"
},
closeToast: {
type: Function,
required: !1,
default: void 0
}
},
setup(t) {
return () => J("button", {
class: "".concat(gt.CSS_NAMESPACE, "__close-button ").concat(gt.CSS_NAMESPACE, "__close-button--").concat(t.theme),
type: "button",
onClick: (e) => {
e.stopPropagation(), t.closeToast && t.closeToast(e);
},
"aria-label": t.ariaLabel
}, [J("svg", {
"aria-hidden": "true",
viewBox: "0 0 14 16"
}, [J("path", {
"fill-rule": "evenodd",
d: "M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"
}, null)])]);
}
}), Wc = ({
theme: t,
type: e,
path: n,
...r
}) => J("svg", dt({
viewBox: "0 0 24 24",
width: "100%",
height: "100%",
fill: t === "colored" ? "currentColor" : "var(--toastify-icon-color-".concat(e, ")")
}, r), [J("path", {
d: n
}, null)]);
function KE(t) {
return J(Wc, dt(t, {
path: "M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"
}), null);
}
function GE(t) {
return J(Wc, dt(t, {
path: "M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"
}), null);
}
function JE(t) {
return J(Wc, dt(t, {
path: "M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"
}), null);
}
function XE(t) {
return J(Wc, dt(t, {
path: "M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"
}), null);
}
function QE() {
return J("div", {
class: "".concat(gt.CSS_NAMESPACE, "__spinner")
}, null);
}
const n0 = {
info: GE,
warning: KE,
success: JE,
error: XE,
spinner: QE
}, ZE = (t) => t in n0;
function e_({
theme: t,
type: e,
isLoading: n,
icon: r
}) {
let i;
const o = {
theme: t,
type: e
};
return n ? i = n0.spinner() : r === !1 ? i = void 0 : dl(r) ? i = wn(r) : ba(r) ? i = r(o) : ip(r) ? i = O6(r, o) : t0(r) || HE(r) ? i = r : ZE(e) && (i = n0[e](o)), i;
}
const t_ = () => {
};
function n_(t, e, n = gt.COLLAPSE_DURATION) {
const { scrollHeight: r, style: i } = t, o = n;
requestAnimationFrame(() => {
i.minHeight = "initial", i.height = r + "px", i.transition = "all ".concat(o, "ms"), requestAnimationFrame(() => {
i.height = "0", i.padding = "0", i.margin = "0", setTimeout(e, o);
});
});
}
function r_(t) {
const e = re(!1), n = re(!1), r = re(!1), i = re(fl.Enter), o = Qt({
...t,
appendPosition: t.appendPosition || !1,
collapse: typeof t.collapse > "u" ? !0 : t.collapse,
collapseDuration: t.collapseDuration || gt.COLLAPSE_DURATION
}), a = o.done || t_, s = L(() => o.appendPosition ? "".concat(o.enter, "--").concat(o.position) : o.enter), u = L(() => o.appendPosition ? "".concat(o.exit, "--").concat(o.position) : o.exit), l = L(() => t.pauseOnHover ? {
onMouseenter: v,
onMouseleave: m
} : {});
function c() {
const k = s.value.split(" ");
d().addEventListener(
Xf.ENTRANCE_ANIMATION_END,
m,
{ once: !0 }
);
const T = (D) => {
const x = d();
D.target === x && (x.dispatchEvent(new Event(Xf.ENTRANCE_ANIMATION_END)), x.removeEventListener("animationend", T), x.removeEventListener("animationcancel", T), i.value === fl.Enter && D.type !== "animationcancel" && x.classList.remove(...k));
}, b = () => {
const D = d();
D.classList.add(...k), D.addEventListener("animationend", T), D.addEventListener("animationcancel", T);
};
t.pauseOnFocusLoss && p(), b();
}
function f() {
if (!d())
return;
const k = () => {
const b = d();
b.removeEventListener("animationend", k), o.collapse ? n_(b, a, o.collapseDuration) : a();
}, T = () => {
const b = d();
i.value = fl.Exit, b && (b.className += " ".concat(u.value), b.addEventListener("animationend", k));
};
n.value || (r.value ? k() : setTimeout(T));
}
function d() {
return t.toastRef.value;
}
function p() {
document.hasFocus() || v(), window.addEventListener("focus", m), window.addEventListener("blur", v);
}
function h() {
window.removeEventListener("focus", m), window.removeEventListener("blur", v);
}
function m() {
(!t.loading.value || t.isLoading === void 0) && (e.value = !0);
}
function v() {
e.value = !1;
}
function y(k) {
k && (k.stopPropagation(), k.preventDefault()), n.value = !1;
}
return ga(f), ga(() => {
const k = bu();
n.value = k.findIndex((T) => T.toastId === o.toastId) > -1;
}), ga(() => {
t.isLoading !== void 0 && (t.loading.value ? v() : m());
}), st(c), jo(() => {
t.pauseOnFocusLoss && h();
}), {
isIn: n,
isRunning: e,
hideToast: y,
eventHandlers: l
};
}
const i_ = /* @__PURE__ */ be({
name: "ToastItem",
inheritAttrs: !1,
props: Ly,
// @ts-ignore
setup(t) {
const e = re(), n = L(() => !!t.isLoading), r = L(() => t.progress !== void 0 && t.progress !== null), i = L(() => e_(t)), o = L(() => ["".concat(gt.CSS_NAMESPACE, "__toast"), "".concat(gt.CSS_NAMESPACE, "__toast-theme--").concat(t.theme), "".concat(gt.CSS_NAMESPACE, "__toast--").concat(t.type), t.rtl ? "".concat(gt.CSS_NAMESPACE, "__toast--rtl") : void 0, t.toastClassName || ""].filter(Boolean).join(" ")), {
isRunning: a,
isIn: s,
hideToast: u,
eventHandlers: l
} = r_({
toastRef: e,
loading: n,
done: () => {
Hr.remove(t.toastId);
},
...$y(t.transition),
...t
});
return () => J("div", dt({
id: t.toastId,
class: o.value,
style: t.toastStyle || {},
ref: e,
"data-testid": "toast-item-".concat(t.toastId),
onClick: (c) => {
t.closeOnClick && u(), t.onClick && t.onClick(c);
}
}, l.value), [J("div", {
role: t.role,
"data-testid": "toast-body",
class: "".concat(gt.CSS_NAMESPACE, "__toast-body ").concat(t.bodyClassName || "")
}, [i.value != null && J("div", {
"data-testid": "toast-icon-".concat(t.type),
class: ["".concat(gt.CSS_NAMESPACE, "__toast-icon"), t.isLoading ? "" : "".concat(gt.CSS_NAMESPACE, "--animate-icon ").concat(gt.CSS_NAMESPACE, "__zoom-enter")].join(" ")
}, [dl(i.value) ? jt(wn(i.value), {
theme: t.theme,
type: t.type
}) : ba(i.value) ? i.value({
theme: t.theme,
type: t.type
}) : i.value]), J("div", {
"data-testid": "toast-content"
}, [dl(t.content) ? jt(wn(t.content), {
toastProps: wn(t),
closeToast: u,
data: t.data
}) : ba(t.content) ? t.content({
toastProps: wn(t),
closeToast: u,
data: t.data
}) : t.dangerouslyHTMLString ? jt("div", {
innerHTML: t.content
}) : t.content])]), (t.closeButton === void 0 || t.closeButton === !0) && J(YE, {
theme: t.theme,
closeToast: (c) => {
c.stopPropagation(), c.preventDefault(), u();
}
}, null), dl(t.closeButton) ? jt(wn(t.closeButton), {
closeToast: u,
type: t.type,
theme: t.theme
}) : ba(t.closeButton) ? t.closeButton({
closeToast: u,
type: t.type,
theme: t.theme
}) : null, J(WE, {
className: t.progressClassName,
style: t.progressStyle,
rtl: t.rtl,
theme: t.theme,
isIn: s.value,
type: t.type,
hide: t.hideProgressBar,
isRunning: a.value,
autoClose: t.autoClose,
controlledProgress: r.value,
progress: t.progress,
closeToast: t.isLoading ? void 0 : u
}, null)]);
}
});
let Es = 0;
function Ry() {
typeof window > "u" || (Es && window.cancelAnimationFrame(Es), Es = window.requestAnimationFrame(Ry), $l.lastUrl !== window.location.href && ($l.lastUrl = window.location.href, Hr.clear()));
}
const o_ = /* @__PURE__ */ be({
name: "ToastifyContainer",
inheritAttrs: !1,
props: Ly,
// @ts-ignore
setup(t) {
const e = L(() => t.containerId), n = L(() => tn[e.value] || []), r = L(() => n.value.filter((i) => i.position === t.position));
return st(() => {
typeof window < "u" && t.clearOnUrlChange && window.requestAnimationFrame(Ry);
}), jo(() => {
typeof window < "u" && Es && (window.cancelAnimationFrame(Es), $l.lastUrl = "");
}), () => J(Ee, null, [r.value.map((i) => {
const {
toastId: o = ""
} = i;
return J(i_, dt({
key: o
}, i), null);
})]);
}
});
let Bd = !1;
function By() {
const t = [];
return bu().forEach((e) => {
const n = document.getElementById(e.containerId);
n && !n.classList.contains(jc) && t.push(e);
}), t;
}
function a_(t) {
const e = By().length, n = t ?? 0;
return n > 0 && e + Yr.items.length >= n;
}
function s_(t) {
a_(t.limit) && !t.updateId && Yr.items.push({
toastId: t.toastId,
containerId: t.containerId,
toastContent: t.content,
toastProps: t
});
}
function Wi(t, e, n = {}) {
if (Bd)
return;
n = Uc(FE(), {
type: e
}, wn(n)), (!n.toastId || typeof n.toastId != "string" && typeof n.toastId != "number") && (n.toastId = Iy()), n = {
...n,
content: t,
containerId: n.containerId || String(n.position)
};
const r = Number(n == null ? void 0 : n.progress);
return r < 0 && (n.progress = 0), r > 1 && (n.progress = 1), n.theme === "auto" && (n.theme = jE()), s_(n), $l.lastUrl = window.location.href, n.multiple ? Yr.items.length ? n.updateId && cl(t, n) : cl(t, n) : (Bd = !0, bt.clearAll(void 0, !1), setTimeout(() => {
cl(t, n);
}, 0), setTimeout(() => {
Bd = !1;
}, 390)), n.toastId;
}
const bt = (t, e) => Wi(t, _n.DEFAULT, e);
bt.info = (t, e) => Wi(t, _n.DEFAULT, {
...e,
type: _n.INFO
});
bt.error = (t, e) => Wi(t, _n.DEFAULT, {
...e,
type: _n.ERROR
});
bt.warning = (t, e) => Wi(t, _n.DEFAULT, {
...e,
type: _n.WARNING
});
bt.warn = bt.warning;
bt.success = (t, e) => Wi(t, _n.DEFAULT, {
...e,
type: _n.SUCCESS
});
bt.loading = (t, e) => Wi(t, _n.DEFAULT, Uc(e, {
isLoading: !0,
autoClose: !1,
closeOnClick: !1,
closeButton: !1,
draggable: !1
}));
bt.dark = (t, e) => Wi(t, _n.DEFAULT, Uc(e, {
theme: Ia.DARK
}));
bt.remove = (t) => {
t ? Hr.dismiss(t) : Hr.clear();
};
bt.clearAll = (t, e) => {
Hr.clear(t, e);
};
bt.isActive = (t) => {
let e = !1;
return e = By().findIndex((n) => n.toastId === t) > -1, e;
};
bt.update = (t, e = {}) => {
setTimeout(() => {
const n = zE(t);
if (n) {
const r = wn(n), {
content: i
} = r, o = {
...r,
...e,
toastId: e.toastId || t,
updateId: Iy()
}, a = o.render || i;
delete o.render, Wi(a, o.type, o);
}
}, 0);
};
bt.done = (t) => {
bt.update(t, {
isLoading: !1,
progress: 1
});
};
bt.promise = u_;
function u_(t, {
pending: e,
error: n,
success: r
}, i) {
var o, a, s;
let u;
const l = {
...i || {},
autoClose: !1
};
e && (u = t0(e) ? bt.loading(e, l) : bt.loading(e.render, {
...l,
...e
}));
const c = {
autoClose: (o = i == null ? void 0 : i.autoClose) != null ? o : !0,
closeOnClick: (a = i == null ? void 0 : i.closeOnClick) != null ? a : !0,
closeButton: (s = i == null ? void 0 : i.autoClose) != null ? s : null,
isLoading: void 0,
draggable: null,
delay: 100
}, f = (p, h, m) => {
if (h == null) {
bt.remove(u);
return;
}
const v = {
type: p,
...c,
...i,
data: m
}, y = t0(h) ? {
render: h
} : h;
return u ? bt.update(u, {
...v,
...y,
isLoading: !1
}) : bt(y.render, {
...v,
...y,
isLoading: !1
}), m;
}, d = ba(t) ? t() : t;
return d.then((p) => {
f("success", r, p);
}).catch((p) => {
f("error", n, p);
}), d;
}
bt.POSITION = gu;
bt.THEME = Ia;
bt.TYPE = _n;
bt.TRANSITIONS = xE;
const l_ = {
install(t, e = {}) {
c_(e);
}
};
typeof window < "u" && (window.Vue3Toastify = l_);
function c_(t = {}) {
const e = Uc(Dy, t);
qE(e);
}
const d_ = {
info(t, e) {
return bt.info(t, e);
},
success(t, e) {
return bt.success(t, e);
},
error(t, e) {
return bt.error(t, e);
},
warning(t, e) {
return bt.warn(t, e);
},
loading(t, e) {
return bt.loading(t, e);
}
};
function f_(t) {
return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, n) {
var r = t.get(e);
r ? r.push(n) : t.set(e, [n]);
}, off: function(e, n) {
var r = t.get(e);
r && (n ? r.splice(r.indexOf(n) >>> 0, 1) : t.set(e, []));
}, emit: function(e, n) {
var r = t.get(e);
r && r.slice().map(function(i) {
i(n);
}), (r = t.get("*")) && r.slice().map(function(i) {
i(e, n);
});
} };
}
const nr = f_();
function _W() {
return Op();
}
function TW() {
return xy();
}
function hr(t) {
"@babel/helpers - typeof";
return hr = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
return typeof e;
} : function(e) {
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, hr(t);
}
function qe(t) {
if (t === null || t === !0 || t === !1)
return NaN;
var e = Number(t);
return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e);
}
function Le(t, e) {
if (e.length < t)
throw new TypeError(t + " argument" + (t > 1 ? "s" : "") + " required, but only " + e.length + " present");
}
function Fe(t) {
Le(1, arguments);
var e = Object.prototype.toString.call(t);
return t instanceof Date || hr(t) === "object" && e === "[object Date]" ? new Date(t.getTime()) : typeof t == "number" || e === "[object Number]" ? new Date(t) : ((typeof t == "string" || e === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
}
function Pi(t, e) {
Le(2, arguments);
var n = Fe(t), r = qe(e);
return isNaN(r) ? /* @__PURE__ */ new Date(NaN) : (r && n.setDate(n.getDate() + r), n);
}
function Ir(t, e) {
Le(2, arguments);
var n = Fe(t), r = qe(e);
if (isNaN(r))
return /* @__PURE__ */ new Date(NaN);
if (!r)
return n;
var i = n.getDate(), o = new Date(n.getTime());
o.setMonth(n.getMonth() + r + 1, 0);
var a = o.getDate();
return i >= a ? o : (n.setFullYear(o.getFullYear(), o.getMonth(), i), n);
}
function Vy(t, e) {
if (Le(2, arguments), !e || hr(e) !== "object")
return /* @__PURE__ */ new Date(NaN);
var n = e.years ? qe(e.years) : 0, r = e.months ? qe(e.months) : 0, i = e.weeks ? qe(e.weeks) : 0, o = e.days ? qe(e.days) : 0, a = e.hours ? qe(e.hours) : 0, s = e.minutes ? qe(e.minutes) : 0, u = e.seconds ? qe(e.seconds) : 0, l = Fe(t), c = r || n ? Ir(l, r + n * 12) : l, f = o || i ? Pi(c, o + i * 7) : c, d = s + a * 60, p = u + d * 60, h = p * 1e3, m = new Date(f.getTime() + h);
return m;
}
function p_(t, e) {
Le(2, arguments);
var n = Fe(t).getTime(), r = qe(e);
return new Date(n + r);
}
var h_ = {};
function Yi() {
return h_;
}
function r0(t, e) {
var n, r, i, o, a, s, u, l;
Le(1, arguments);
var c = Yi(), f = qe((n = (r = (i = (o = e == null ? void 0 : e.weekStartsOn) !== null && o !== void 0 ? o : e == null || (a = e.locale) === null || a === void 0 || (s = a.options) === null || s === void 0 ? void 0 : s.weekStartsOn) !== null && i !== void 0 ? i : c.weekStartsOn) !== null && r !== void 0 ? r : (u = c.locale) === null || u === void 0 || (l = u.options) === null || l === void 0 ? void 0 : l.weekStartsOn) !== null && n !== void 0 ? n : 0);
if (!(f >= 0 && f <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
var d = Fe(t), p = d.getDay(), h = (p < f ? 7 : 0) + p - f;
return d.setDate(d.getDate() - h), d.setHours(0, 0, 0, 0), d;
}
function Nl(t) {
return Le(1, arguments), r0(t, {
weekStartsOn: 1
});
}
function m_(t) {
Le(1, arguments);
var e = Fe(t), n = e.getFullYear(), r = /* @__PURE__ */ new Date(0);
r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
var i = Nl(r), o = /* @__PURE__ */ new Date(0);
o.setFullYear(n, 0, 4), o.setHours(0, 0, 0, 0);
var a = Nl(o);
return e.getTime() >= i.getTime() ? n + 1 : e.getTime() >= a.getTime() ? n : n - 1;
}
function g_(t) {
Le(1, arguments);
var e = m_(t), n = /* @__PURE__ */ new Date(0);
n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0);
var r = Nl(n);
return r;
}
function Pl(t) {
var e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds()));
return e.setUTCFullYear(t.getFullYear()), t.getTime() - e.getTime();
}
function a1(t) {
Le(1, arguments);
var e = Fe(t);
return e.setHours(0, 0, 0, 0), e;
}
var b_ = 864e5;
function v_(t, e) {
Le(2, arguments);
var n = a1(t), r = a1(e), i = n.getTime() - Pl(n), o = r.getTime() - Pl(r);
return Math.round((i - o) / b_);
}
function zy(t, e) {
Le(2, arguments);
var n = qe(e);
return Ir(t, n * 12);
}
var Mp = 6e4, Dp = 36e5, y_ = 1e3;
function Hy(t) {
return Le(1, arguments), t instanceof Date || hr(t) === "object" && Object.prototype.toString.call(t) === "[object Date]";
}
function _s(t) {
if (Le(1, arguments), !Hy(t) && typeof t != "number")
return !1;
var e = Fe(t);
return !isNaN(Number(e));
}
function s1(t, e) {
var n;
Le(1, arguments);
var r = t || {}, i = Fe(r.start), o = Fe(r.end), a = o.getTime();
if (!(i.getTime() <= a))
throw new RangeError("Invalid interval");
var s = [], u = i;
u.setHours(0, 0, 0, 0);
var l = Number((n = e == null ? void 0 : e.step) !== null && n !== void 0 ? n : 1);
if (l < 1 || isNaN(l))
throw new RangeError("`options.step` must be a number greater than 1");
for (; u.getTime() <= a; )
s.push(Fe(u)), u.setDate(u.getDate() + l), u.setHours(0, 0, 0, 0);
return s;
}
function w_(t, e) {
var n, r, i, o, a, s, u, l;
Le(1, arguments);
var c = Yi(), f = qe((n = (r = (i = (o = e == null ? void 0 : e.weekStartsOn) !== null && o !== void 0 ? o : e == null || (a = e.locale) === null || a === void 0 || (s = a.options) === null || s === void 0 ? void 0 : s.weekStartsOn) !== null && i !== void 0 ? i : c.weekStartsOn) !== null && r !== void 0 ? r : (u = c.locale) === null || u === void 0 || (l = u.options) === null || l === void 0 ? void 0 : l.weekStartsOn) !== null && n !== void 0 ? n : 0);
if (!(f >= 0 && f <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
var d = Fe(t), p = d.getDay(), h = (p < f ? -7 : 0) + 6 - (p - f);
return d.setDate(d.getDate() + h), d.setHours(23, 59, 59, 999), d;
}
function qy(t, e) {
Le(2, arguments);
var n = qe(e);
return p_(t, -n);
}
var k_ = 864e5;
function x_(t) {
Le(1, arguments);
var e = Fe(t), n = e.getTime();
e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
var r = e.getTime(), i = n - r;
return Math.floor(i / k_) + 1;
}
function La(t) {
Le(1, arguments);
var e = 1, n = Fe(t), r = n.getUTCDay(), i = (r < e ? 7 : 0) + r - e;
return n.setUTCDate(n.getUTCDate() - i), n.setUTCHours(0, 0, 0, 0), n;
}
function Fy(t) {
Le(1, arguments);
var e = Fe(t), n = e.getUTCFullYear(), r = /* @__PURE__ */ new Date(0);
r.setUTCFullYear(n + 1, 0, 4), r.setUTCHours(0, 0, 0, 0);
var i = La(r), o = /* @__PURE__ */ new Date(0);
o.setUTCFullYear(n, 0, 4), o.setUTCHours(0, 0, 0, 0);
var a = La(o);
return e.getTime() >= i.getTime() ? n + 1 : e.getTime() >= a.getTime() ? n : n - 1;
}
function S_(t) {
Le(1, arguments);
var e = Fy(t), n = /* @__PURE__ */ new Date(0);
n.setUTCFullYear(e, 0, 4), n.setUTCHours(0, 0, 0, 0);
var r = La(n);
return r;
}
var E_ = 6048e5;
function jy(t) {
Le(1, arguments);
var e = Fe(t), n = La(e).getTime() - S_(e).getTime();
return Math.round(n / E_) + 1;
}
function Ro(t, e) {
var n, r, i, o, a, s, u, l;
Le(1, arguments);
var c = Yi(), f = qe((n = (r = (i = (o = e == null ? void 0 : e.weekStartsOn) !== null && o !== void 0 ? o : e == null || (a = e.locale) === null || a === void 0 || (s = a.options) === null || s === void 0 ? void 0 : s.weekStartsOn) !== null && i !== void 0 ? i : c.weekStartsOn) !== null && r !== void 0 ? r : (u = c.locale) === null || u === void 0 || (l = u.options) === null || l === void 0 ? void 0 : l.weekStartsOn) !== null && n !== void 0 ? n : 0);
if (!(f >= 0 && f <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
var d = Fe(t), p = d.getUTCDay(), h = (p < f ? 7 : 0) + p - f;
return d.setUTCDate(d.getUTCDate() - h), d.setUTCHours(0, 0, 0, 0), d;
}
function $p(t, e) {
var n, r, i, o, a, s, u, l;
Le(1, arguments);
var c = Fe(t), f = c.getUTCFullYear(), d = Yi(), p = qe((n = (r = (i = (o = e == null ? void 0 : e.firstWeekContainsDate) !== null && o !== void 0 ? o : e == null || (a = e.locale) === null || a === void 0 || (s = a.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && i !== void 0 ? i : d.firstWeekContainsDate) !== null && r !== void 0 ? r : (u = d.locale) === null || u === void 0 || (l = u.options) === null || l === void 0 ? void 0 : l.firstWeekContainsDate) !== null && n !== void 0 ? n : 1);
if (!(p >= 1 && p <= 7))
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
var h = /* @__PURE__ */ new Date(0);
h.setUTCFullYear(f + 1, 0, p), h.setUTCHours(0, 0, 0, 0);
var m = Ro(h, e), v = /* @__PURE__ */ new Date(0);
v.setUTCFullYear(f, 0, p), v.setUTCHours(0, 0, 0, 0);
var y = Ro(v, e);
return c.getTime() >= m.getTime() ? f + 1 : c.getTime() >= y.getTime() ? f : f - 1;
}
function __(t, e) {
var n, r, i, o, a, s, u, l;
Le(1, arguments);
var c = Yi(), f = qe((n = (r = (i = (o = e == null ? void 0 : e.firstWeekContainsDate) !== null && o !== void 0 ? o : e == null || (a = e.locale) === null || a === void 0 || (s = a.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && i !== void 0 ? i : c.firstWeekContainsDate) !== null && r !== void 0 ? r : (u = c.locale) === null || u === void 0 || (l = u.options) === null || l === void 0 ? void 0 : l.firstWeekContainsDate) !== null && n !== void 0 ? n : 1), d = $p(t, e), p = /* @__PURE__ */ new Date(0);
p.setUTCFullYear(d, 0, f), p.setUTCHours(0, 0, 0, 0);
var h = Ro(p, e);
return h;
}
var T_ = 6048e5;
function Uy(t, e) {
Le(1, arguments);
var n = Fe(t), r = Ro(n, e).getTime() - __(n, e).getTime();
return Math.round(r / T_) + 1;
}
function vt(t, e) {
for (var n = t < 0 ? "-" : "", r = Math.abs(t).toString(); r.length < e; )
r = "0" + r;
return n + r;
}
var C_ = {
// Year
y: function(e, n) {
var r = e.getUTCFullYear(), i = r > 0 ? r : 1 - r;
return vt(n === "yy" ? i % 100 : i, n.length);
},
// Month
M: function(e, n) {
var r = e.getUTCMonth();
return n === "M" ? String(r + 1) : vt(r + 1, 2);
},
// Day of the month
d: function(e, n) {
return vt(e.getUTCDate(), n.length);
},
// AM or PM
a: function(e, n) {
var r = e.getUTCHours() / 12 >= 1 ? "pm" : "am";
switch (n) {
case "a":
case "aa":
return r.toUpperCase();
case "aaa":
return r;
case "aaaaa":
return r[0];
case "aaaa":
default:
return r === "am" ? "a.m." : "p.m.";
}
},
// Hour [1-12]
h: function(e, n) {
return vt(e.getUTCHours() % 12 || 12, n.length);
},
// Hour [0-23]
H: function(e, n) {
return vt(e.getUTCHours(), n.length);
},
// Minute
m: function(e, n) {
return vt(e.getUTCMinutes(), n.length);
},
// Second
s: function(e, n) {
return vt(e.getUTCSeconds(), n.length);
},
// Fraction of second
S: function(e, n) {
var r = n.length, i = e.getUTCMilliseconds(), o = Math.floor(i * Math.pow(10, r - 3));
return vt(o, n.length);
}
};
const vi = C_;
var Xo = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}, O_ = {
// Era
G: function(e, n, r) {
var i = e.getUTCFullYear() > 0 ? 1 : 0;
switch (n) {
case "G":
case "GG":
case "GGG":
return r.era(i, {
width: "abbreviated"
});
case "GGGGG":
return r.era(i, {
width: "narrow"
});
case "GGGG":
default:
return r.era(i, {
width: "wide"
});
}
},
// Year
y: function(e, n, r) {
if (n === "yo") {
var i = e.getUTCFullYear(), o = i > 0 ? i : 1 - i;
return r.ordinalNumber(o, {
unit: "year"
});
}
return vi.y(e, n);
},
// Local week-numbering year
Y: function(e, n, r, i) {
var o = $p(e, i), a = o > 0 ? o : 1 - o;
if (n === "YY") {
var s = a % 100;
return vt(s, 2);
}
return n === "Yo" ? r.ordinalNumber(a, {
unit: "year"
}) : vt(a, n.length);
},
// ISO week-numbering year
R: function(e, n) {
var r = Fy(e);
return vt(r, n.length);
},
// Extended year. This is a single number designating the year of this calendar system.
// The main difference between `y` and `u` localizers are B.C. years:
// | Year | `y` | `u` |
// |------|-----|-----|
// | AC 1 | 1 | 1 |
// | BC 1 | 1 | 0 |
// | BC 2 | 2 | -1 |
// Also `yy` always returns the last two digits of a year,
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
u: function(e, n) {
var r = e.getUTCFullYear();
return vt(r, n.length);
},
// Quarter
Q: function(e, n, r) {
var i = Math.ceil((e.getUTCMonth() + 1) / 3);
switch (n) {
case "Q":
return String(i);
case "QQ":
return vt(i, 2);
case "Qo":
return r.ordinalNumber(i, {
unit: "quarter"
});
case "QQQ":
return r.quarter(i, {
width: "abbreviated",
context: "formatting"
});
case "QQQQQ":
return r.quarter(i, {
width: "narrow",
context: "formatting"
});
case "QQQQ":
default:
return r.quarter(i, {
width: "wide",
context: "formatting"
});
}
},
// Stand-alone quarter
q: function(e, n, r) {
var i = Math.ceil((e.getUTCMonth() + 1) / 3);
switch (n) {
case "q":
return String(i);
case "qq":
return vt(i, 2);
case "qo":
return r.ordinalNumber(i, {
unit: "quarter"
});
case "qqq":
return r.quarter(i, {
width: "abbreviated",
context: "standalone"
});
case "qqqqq":
return r.quarter(i, {
width: "narrow",
context: "standalone"
});
case "qqqq":
default:
return r.quarter(i, {
width: "wide",
context: "standalone"
});
}
},
// Month
M: function(e, n, r) {
var i = e.getUTCMonth();
switch (n) {
case "M":
case "MM":
return vi.M(e, n);
case "Mo":
return r.ordinalNumber(i + 1, {
unit: "month"
});
case "MMM":
return r.month(i, {
width: "abbreviated",
context: "formatting"
});
case "MMMMM":
return r.month(i, {
width: "narrow",
context: "formatting"
});
case "MMMM":
default:
return r.month(i, {
width: "wide",
context: "formatting"
});
}
},
// Stand-alone month
L: function(e, n, r) {
var i = e.getUTCMonth();
switch (n) {
case "L":
return String(i + 1);
case "LL":
return vt(i + 1, 2);
case "Lo":
return r.ordinalNumber(i + 1, {
unit: "month"
});
case "LLL":
return r.month(i, {
width: "abbreviated",
context: "standalone"
});
case "LLLLL":
return r.month(i, {
width: "narrow",
context: "standalone"
});
case "LLLL":
default:
return r.month(i, {
width: "wide",
context: "standalone"
});
}
},
// Local week of year
w: function(e, n, r, i) {
var o = Uy(e, i);
return n === "wo" ? r.ordinalNumber(o, {
unit: "week"
}) : vt(o, n.length);
},
// ISO week of year
I: function(e, n, r) {
var i = jy(e);
return n === "Io" ? r.ordinalNumber(i, {
unit: "week"
}) : vt(i, n.length);
},
// Day of the month
d: function(e, n, r) {
return n === "do" ? r.ordinalNumber(e.getUTCDate(), {
unit: "date"
}) : vi.d(e, n);
},
// Day of year
D: function(e, n, r) {
var i = x_(e);
return n === "Do" ? r.ordinalNumber(i, {
unit: "dayOfYear"
}) : vt(i, n.length);
},
// Day of week
E: function(e, n, r) {
var i = e.getUTCDay();
switch (n) {
case "E":
case "EE":
case "EEE":
return r.day(i, {
width: "abbreviated",
context: "formatting"
});
case "EEEEE":
return r.day(i, {
width: "narrow",
context: "formatting"
});
case "EEEEEE":
return r.day(i, {
width: "short",
context: "formatting"
});
case "EEEE":
default:
return r.day(i, {
width: "wide",
context: "formatting"
});
}
},
// Local day of week
e: function(e, n, r, i) {
var o = e.getUTCDay(), a = (o - i.weekStartsOn + 8) % 7 || 7;
switch (n) {
case "e":
return String(a);
case "ee":
return vt(a, 2);
case "eo":
return r.ordinalNumber(a, {
unit: "day"
});
case "eee":
return r.day(o, {
width: "abbreviated",
context: "formatting"
});
case "eeeee":
return r.day(o, {
width: "narrow",
context: "formatting"
});
case "eeeeee":
return r.day(o, {
width: "short",
context: "formatting"
});
case "eeee":
default:
return r.day(o, {
width: "wide",
context: "formatting"
});
}
},
// Stand-alone local day of week
c: function(e, n, r, i) {
var o = e.getUTCDay(), a = (o - i.weekStartsOn + 8) % 7 || 7;
switch (n) {
case "c":
return String(a);
case "cc":
return vt(a, n.length);
case "co":
return r.ordinalNumber(a, {
unit: "day"
});
case "ccc":
return r.day(o, {
width: "abbreviated",
context: "standalone"
});
case "ccccc":
return r.day(o, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return r.day(o, {
width: "short",
context: "standalone"
});
case "cccc":
default:
return r.day(o, {
width: "wide",
context: "standalone"
});
}
},
// ISO day of week
i: function(e, n, r) {
var i = e.getUTCDay(), o = i === 0 ? 7 : i;
switch (n) {
case "i":
return String(o);
case "ii":
return vt(o, n.length);
case "io":
return r.ordinalNumber(o, {
unit: "day"
});
case "iii":
return r.day(i, {
width: "abbreviated",
context: "formatting"
});
case "iiiii":
return r.day(i, {
width: "narrow",
context: "formatting"
});
case "iiiiii":
return r.day(i, {
width: "short",
context: "formatting"
});
case "iiii":
default:
return r.day(i, {
width: "wide",
context: "formatting"
});
}
},
// AM or PM
a: function(e, n, r) {
var i = e.getUTCHours(), o = i / 12 >= 1 ? "pm" : "am";
switch (n) {
case "a":
case "aa":
return r.dayPeriod(o, {
width: "abbreviated",
context: "formatting"
});
case "aaa":
return r.dayPeriod(o, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "aaaaa":
return r.dayPeriod(o, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return r.dayPeriod(o, {
width: "wide",
context: "formatting"
});
}
},
// AM, PM, midnight, noon
b: function(e, n, r) {
var i = e.getUTCHours(), o;
switch (i === 12 ? o = Xo.noon : i === 0 ? o = Xo.midnight : o = i / 12 >= 1 ? "pm" : "am", n) {
case "b":
case "bb":
return r.dayPeriod(o, {
width: "abbreviated",
context: "formatting"
});
case "bbb":
return r.dayPeriod(o, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "bbbbb":
return r.dayPeriod(o, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return r.dayPeriod(o, {
width: "wide",
context: "formatting"
});
}
},
// in the morning, in the afternoon, in the evening, at night
B: function(e, n, r) {
var i = e.getUTCHours(), o;
switch (i >= 17 ? o = Xo.evening : i >= 12 ? o = Xo.afternoon : i >= 4 ? o = Xo.morning : o = Xo.night, n) {
case "B":
case "BB":
case "BBB":
return r.dayPeriod(o, {
width: "abbreviated",
context: "formatting"
});
case "BBBBB":
return r.dayPeriod(o, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return r.dayPeriod(o, {
width: "wide",
context: "formatting"
});
}
},
// Hour [1-12]
h: function(e, n, r) {
if (n === "ho") {
var i = e.getUTCHours() % 12;
return i === 0 && (i = 12), r.ordinalNumber(i, {
unit: "hour"
});
}
return vi.h(e, n);
},
// Hour [0-23]
H: function(e, n, r) {
return n === "Ho" ? r.ordinalNumber(e.getUTCHours(), {
unit: "hour"
}) : vi.H(e, n);
},
// Hour [0-11]
K: function(e, n, r) {
var i = e.getUTCHours() % 12;
return n === "Ko" ? r.ordinalNumber(i, {
unit: "hour"
}) : vt(i, n.length);
},
// Hour [1-24]
k: function(e, n, r) {
var i = e.getUTCHours();
return i === 0 && (i = 24), n === "ko" ? r.ordinalNumber(i, {
unit: "hour"
}) : vt(i, n.length);
},
// Minute
m: function(e, n, r) {
return n === "mo" ? r.ordinalNumber(e.getUTCMinutes(), {
unit: "minute"
}) : vi.m(e, n);
},
// Second
s: function(e, n, r) {
return n === "so" ? r.ordinalNumber(e.getUTCSeconds(), {
unit: "second"
}) : vi.s(e, n);
},
// Fraction of second
S: function(e, n) {
return vi.S(e, n);
},
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
X: function(e, n, r, i) {
var o = i._originalDate || e, a = o.getTimezoneOffset();
if (a === 0)
return "Z";
switch (n) {
case "X":
return l1(a);
case "XXXX":
case "XX":
return so(a);
case "XXXXX":
case "XXX":
default:
return so(a, ":");
}
},
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
x: function(e, n, r, i) {
var o = i._originalDate || e, a = o.getTimezoneOffset();
switch (n) {
case "x":
return l1(a);
case "xxxx":
case "xx":
return so(a);
case "xxxxx":
case "xxx":
default:
return so(a, ":");
}
},
// Timezone (GMT)
O: function(e, n, r, i) {
var o = i._originalDate || e, a = o.getTimezoneOffset();
switch (n) {
case "O":
case "OO":
case "OOO":
return "GMT" + u1(a, ":");
case "OOOO":
default:
return "GMT" + so(a, ":");
}
},
// Timezone (specific non-location)
z: function(e, n, r, i) {
var o = i._originalDate || e, a = o.getTimezoneOffset();
switch (n) {
case "z":
case "zz":
case "zzz":
return "GMT" + u1(a, ":");
case "zzzz":
default:
return "GMT" + so(a, ":");
}
},
// Seconds timestamp
t: function(e, n, r, i) {
var o = i._originalDate || e, a = Math.floor(o.getTime() / 1e3);
return vt(a, n.length);
},
// Milliseconds timestamp
T: function(e, n, r, i) {
var o = i._originalDate || e, a = o.getTime();
return vt(a, n.length);
}
};
function u1(t, e) {
var n = t > 0 ? "-" : "+", r = Math.abs(t), i = Math.floor(r / 60), o = r % 60;
if (o === 0)
return n + String(i);
var a = e || "";
return n + String(i) + a + vt(o, 2);
}
function l1(t, e) {
if (t % 60 === 0) {
var n = t > 0 ? "-" : "+";
return n + vt(Math.abs(t) / 60, 2);
}
return so(t, e);
}
function so(t, e) {
var n = e || "", r = t > 0 ? "-" : "+", i = Math.abs(t), o = vt(Math.floor(i / 60), 2), a = vt(i % 60, 2);
return r + o + n + a;
}
const A_ = O_;
var c1 = function(e, n) {
switch (e) {
case "P":
return n.date({
width: "short"
});
case "PP":
return n.date({
width: "medium"
});
case "PPP":
return n.date({
width: "long"
});
case "PPPP":
default:
return n.date({
width: "full"
});
}
}, Wy = function(e, n) {
switch (e) {
case "p":
return n.time({
width: "short"
});
case "pp":
return n.time({
width: "medium"
});
case "ppp":
return n.time({
width: "long"
});
case "pppp":
default:
return n.time({
width: "full"
});
}
}, M_ = function(e, n) {
var r = e.match(/(P+)(p+)?/) || [], i = r[1], o = r[2];
if (!o)
return c1(e, n);
var a;
switch (i) {
case "P":
a = n.dateTime({
width: "short"
});
break;
case "PP":
a = n.dateTime({
width: "medium"
});
break;
case "PPP":
a = n.dateTime({
width: "long"
});
break;
case "PPPP":
default:
a = n.dateTime({
width: "full"
});
break;
}
return a.replace("{{date}}", c1(i, n)).replace("{{time}}", Wy(o, n));
}, D_ = {
p: Wy,
P: M_
};
const i0 = D_;
var $_ = ["D", "DD"], N_ = ["YY", "YYYY"];
function Yy(t) {
return $_.indexOf(t) !== -1;
}
function Ky(t) {
return N_.indexOf(t) !== -1;
}
function Il(t, e, n) {
if (t === "YYYY")
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e, "`) for formatting years to the input `").concat(n, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
if (t === "YY")
throw new RangeError("Use `yy` instead of `YY` (in `".concat(e, "`) for formatting years to the input `").concat(n, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
if (t === "D")
throw new RangeError("Use `d` instead of `D` (in `".concat(e, "`) for formatting days of the month to the input `").concat(n, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
if (t === "DD")
throw new RangeError("Use `dd` instead of `DD` (in `".concat(e, "`) for formatting days of the month to the input `").concat(n, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
}
var P_ = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds"
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds"
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours"
},
xHours: {
one: "1 hour",
other: "{{count}} hours"
},
xDays: {
one: "1 day",
other: "{{count}} days"
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks"
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks"
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months"
},
xMonths: {
one: "1 month",
other: "{{count}} months"
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years"
},
xYears: {
one: "1 year",
other: "{{count}} years"
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years"
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years"
}
}, I_ = function(e, n, r) {
var i, o = P_[e];
return typeof o == "string" ? i = o : n === 1 ? i = o.one : i = o.other.replace("{{count}}", n.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + i : i + " ago" : i;
};
const L_ = I_;
function Vd(t) {
return function() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = e.width ? String(e.width) : t.defaultWidth, r = t.formats[n] || t.formats[t.defaultWidth];
return r;
};
}
var R_ = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy"
}, B_ = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
}, V_ = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
}, z_ = {
date: Vd({
formats: R_,
defaultWidth: "full"
}),
time: Vd({
formats: B_,
defaultWidth: "full"
}),
dateTime: Vd({
formats: V_,
defaultWidth: "full"
})
};
const H_ = z_;
var q_ = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
}, F_ = function(e, n, r, i) {
return q_[e];
};
const j_ = F_;
function rs(t) {
return function(e, n) {
var r = n != null && n.context ? String(n.context) : "standalone", i;
if (r === "formatting" && t.formattingValues) {
var o = t.defaultFormattingWidth || t.defaultWidth, a = n != null && n.width ? String(n.width) : o;
i = t.formattingValues[a] || t.formattingValues[o];
} else {
var s = t.defaultWidth, u = n != null && n.width ? String(n.width) : t.defaultWidth;
i = t.values[u] || t.values[s];
}
var l = t.argumentCallback ? t.argumentCallback(e) : e;
return i[l];
};
}
var U_ = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
}, W_ = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, Y_ = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
}, K_ = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
}, G_ = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
}, J_ = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
}
}, X_ = function(e, n) {
var r = Number(e), i = r % 100;
if (i > 20 || i < 10)
switch (i % 10) {
case 1:
return r + "st";
case 2:
return r + "nd";
case 3:
return r + "rd";
}
return r + "th";
}, Q_ = {
ordinalNumber: X_,
era: rs({
values: U_,
defaultWidth: "wide"
}),
quarter: rs({
values: W_,
defaultWidth: "wide",
argumentCallback: function(e) {
return e - 1;
}
}),
month: rs({
values: Y_,
defaultWidth: "wide"
}),
day: rs({
values: K_,
defaultWidth: "wide"
}),
dayPeriod: rs({
values: G_,
defaultWidth: "wide",
formattingValues: J_,
defaultFormattingWidth: "wide"
})
};
const Z_ = Q_;
function is(t) {
return function(e) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = n.width, i = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], o = e.match(i);
if (!o)
return null;
var a = o[0], s = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], u = Array.isArray(s) ? tT(s, function(f) {
return f.test(a);
}) : eT(s, function(f) {
return f.test(a);
}), l;
l = t.valueCallback ? t.valueCallback(u) : u, l = n.valueCallback ? n.valueCallback(l) : l;
var c = e.slice(a.length);
return {
value: l,
rest: c
};
};
}
function eT(t, e) {
for (var n in t)
if (t.hasOwnProperty(n) && e(t[n]))
return n;
}
function tT(t, e) {
for (var n = 0; n < t.length; n++)
if (e(t[n]))
return n;
}
function nT(t) {
return function(e) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = e.match(t.matchPattern);
if (!r)
return null;
var i = r[0], o = e.match(t.parsePattern);
if (!o)
return null;
var a = t.valueCallback ? t.valueCallback(o[0]) : o[0];
a = n.valueCallback ? n.valueCallback(a) : a;
var s = e.slice(i.length);
return {
value: a,
rest: s
};
};
}
var rT = /^(\d+)(th|st|nd|rd)?/i, iT = /\d+/i, oT = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i
}, aT = {
any: [/^b/i, /^(a|c)/i]
}, sT = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
}, uT = {
any: [/1/i, /2/i, /3/i, /4/i]
}, lT = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
}, cT = {
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
}, dT = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
}, fT = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
}, pT = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
}, hT = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
}, mT = {
ordinalNumber: nT({
matchPattern: rT,
parsePattern: iT,
valueCallback: function(e) {
return parseInt(e, 10);
}
}),
era: is({
matchPatterns: oT,
defaultMatchWidth: "wide",
parsePatterns: aT,
defaultParseWidth: "any"
}),
quarter: is({
matchPatterns: sT,
defaultMatchWidth: "wide",
parsePatterns: uT,
defaultParseWidth: "any",
valueCallback: function(e) {
return e + 1;
}
}),
month: is({
matchPatterns: lT,
defaultMatchWidth: "wide",
parsePatterns: cT,
defaultParseWidth: "any"
}),
day: is({
matchPatterns: dT,
defaultMatchWidth: "wide",
parsePatterns: fT,
defaultParseWidth: "any"
}),
dayPeriod: is({
matchPatterns: pT,
defaultMatchWidth: "any",
parsePatterns: hT,
defaultParseWidth: "any"
})
};
const gT = mT;
var bT = {
code: "en-US",
formatDistance: L_,
formatLong: H_,
formatRelative: j_,
localize: Z_,
match: gT,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
const Gy = bT;
var vT = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, yT = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, wT = /^'([^]*?)'?$/, kT = /''/g, xT = /[a-zA-Z]/;
function Ts(t, e, n) {
var r, i, o, a, s, u, l, c, f, d, p, h, m, v, y, k, T, b;
Le(2, arguments);
var D = String(e), x = Yi(), S = (r = (i = n == null ? void 0 : n.locale) !== null && i !== void 0 ? i : x.locale) !== null && r !== void 0 ? r : Gy, _ = qe((o = (a = (s = (u = n == null ? void 0 : n.firstWeekContainsDate) !== null && u !== void 0 ? u : n == null || (l = n.locale) === null || l === void 0 || (c = l.options) === null || c === void 0 ? void 0 : c.firstWeekContainsDate) !== null && s !== void 0 ? s : x.firstWeekContainsDate) !== null && a !== void 0 ? a : (f = x.locale) === null || f === void 0 || (d = f.options) === null || d === void 0 ? void 0 : d.firstWeekContainsDate) !== null && o !== void 0 ? o : 1);
if (!(_ >= 1 && _ <= 7))
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
var N = qe((p = (h = (m = (v = n == null ? void 0 : n.weekStartsOn) !== null && v !== void 0 ? v : n == null || (y = n.locale) === null || y === void 0 || (k = y.options) === null || k === void 0 ? void 0 : k.weekStartsOn) !== null && m !== void 0 ? m : x.weekStartsOn) !== null && h !== void 0 ? h : (T = x.locale) === null || T === void 0 || (b = T.options) === null || b === void 0 ? void 0 : b.weekStartsOn) !== null && p !== void 0 ? p : 0);
if (!(N >= 0 && N <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
if (!S.localize)
throw new RangeError("locale must contain localize property");
if (!S.formatLong)
throw new RangeError("locale must contain formatLong property");
var R = Fe(t);
if (!_s(R))
throw new RangeError("Invalid time value");
var w = Pl(R), A = qy(R, w), $ = {
firstWeekContainsDate: _,
weekStartsOn: N,
locale: S,
_originalDate: R
}, I = D.match(yT).map(function(E) {
var O = E[0];
if (O === "p" || O === "P") {
var g = i0[O];
return g(E, S.formatLong);
}
return E;
}).join("").match(vT).map(function(E) {
if (E === "''")
return "'";
var O = E[0];
if (O === "'")
return ST(E);
var g = A_[O];
if (g)
return !(n != null && n.useAdditionalWeekYearTokens) && Ky(E) && Il(E, e, String(t)), !(n != null && n.useAdditionalDayOfYearTokens) && Yy(E) && Il(E, e, String(t)), g(A, E, S.localize, $);
if (O.match(xT))
throw new RangeError("Format string contains an unescaped latin alphabet character `" + O + "`");
return E;
}).join("");
return I;
}
function ST(t) {
var e = t.match(wT);
return e ? e[1].replace(kT, "'") : t;
}
function ET(t, e) {
if (t == null)
throw new TypeError("assign requires that input parameter not be null or undefined");
for (var n in e)
Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
return t;
}
function _T(t) {
Le(1, arguments);
var e = Fe(t), n = e.getDay();
return n;
}
function TT(t) {
Le(1, arguments);
var e = Fe(t), n = e.getFullYear(), r = e.getMonth(), i = /* @__PURE__ */ new Date(0);
return i.setFullYear(n, r + 1, 0), i.setHours(0, 0, 0, 0), i.getDate();
}
function ui(t) {
Le(1, arguments);
var e = Fe(t), n = e.getHours();
return n;
}
var CT = 6048e5;
function OT(t) {
Le(1, arguments);
var e = Fe(t), n = Nl(e).getTime() - g_(e).getTime();
return Math.round(n / CT) + 1;
}
function li(t) {
Le(1, arguments);
var e = Fe(t), n = e.getMinutes();
return n;
}
function _t(t) {
Le(1, arguments);
var e = Fe(t), n = e.getMonth();
return n;
}
function Ra(t) {
Le(1, arguments);
var e = Fe(t), n = e.getSeconds();
return n;
}
function Tt(t) {
return Le(1, arguments), Fe(t).getFullYear();
}
function Np(t, e) {
Le(2, arguments);
var n = Fe(t), r = Fe(e);
return n.getTime() > r.getTime();
}
function Pp(t, e) {
Le(2, arguments);
var n = Fe(t), r = Fe(e);
return n.getTime() < r.getTime();
}
function Jy(t, e) {
Le(2, arguments);
var n = Fe(t), r = Fe(e);
return n.getTime() === r.getTime();
}
function d1(t, e) {
(e == null || e > t.length) && (e = t.length);
for (var n = 0, r = new Array(e); n < e; n++)
r[n] = t[n];
return r;
}
function AT(t, e) {
if (t) {
if (typeof t == "string")
return d1(t, e);
var n = Object.prototype.toString.call(t).slice(8, -1);
if (n === "Object" && t.constructor && (n = t.constructor.name), n === "Map" || n === "Set")
return Array.from(t);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
return d1(t, e);
}
}
function f1(t, e) {
var n = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
if (!n) {
if (Array.isArray(t) || (n = AT(t)) || e && t && typeof t.length == "number") {
n && (t = n);
var r = 0, i = function() {
};
return {
s: i,
n: function() {
return r >= t.length ? {
done: !0
} : {
done: !1,
value: t[r++]
};
},
e: function(l) {
throw l;
},
f: i
};
}
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var o = !0, a = !1, s;
return {
s: function() {
n = n.call(t);
},
n: function() {
var l = n.next();
return o = l.done, l;
},
e: function(l) {
a = !0, s = l;
},
f: function() {
try {
!o && n.return != null && n.return();
} finally {
if (a)
throw s;
}
}
};
}
function Ce(t) {
if (t === void 0)
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return t;
}
function o0(t, e) {
return o0 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, i) {
return r.__proto__ = i, r;
}, o0(t, e);
}
function ut(t, e) {
if (typeof e != "function" && e !== null)
throw new TypeError("Super expression must either be null or a function");
t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
writable: !0,
configurable: !0
}
}), Object.defineProperty(t, "prototype", {
writable: !1
}), e && o0(t, e);
}
function Ll(t) {
return Ll = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
return n.__proto__ || Object.getPrototypeOf(n);
}, Ll(t);
}
function MT() {
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
return !1;
if (typeof Proxy == "function")
return !0;
try {
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
})), !0;
} catch {
return !1;
}
}
function DT(t, e) {
if (e && (hr(e) === "object" || typeof e == "function"))
return e;
if (e !== void 0)
throw new TypeError("Derived constructors may only return object or undefined");
return Ce(t);
}
function lt(t) {
var e = MT();
return function() {
var r = Ll(t), i;
if (e) {
var o = Ll(this).constructor;
i = Reflect.construct(r, arguments, o);
} else
i = r.apply(this, arguments);
return DT(this, i);
};
}
function rt(t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function");
}
function $T(t, e) {
if (hr(t) !== "object" || t === null)
return t;
var n = t[Symbol.toPrimitive];
if (n !== void 0) {
var r = n.call(t, e || "default");
if (hr(r) !== "object")
return r;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (e === "string" ? String : Number)(t);
}
function Xy(t) {
var e = $T(t, "string");
return hr(e) === "symbol" ? e : String(e);
}
function p1(t, e) {
for (var n = 0; n < e.length; n++) {
var r = e[n];
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, Xy(r.key), r);
}
}
function it(t, e, n) {
return e && p1(t.prototype, e), n && p1(t, n), Object.defineProperty(t, "prototype", {
writable: !1
}), t;
}
function _e(t, e, n) {
return e = Xy(e), e in t ? Object.defineProperty(t, e, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : t[e] = n, t;
}
var NT = 10, Qy = /* @__PURE__ */ function() {
function t() {
rt(this, t), _e(this, "priority", void 0), _e(this, "subPriority", 0);
}
return it(t, [{
key: "validate",
value: function(n, r) {
return !0;
}
}]), t;
}(), PT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n(r, i, o, a, s) {
var u;
return rt(this, n), u = e.call(this), u.value = r, u.validateValue = i, u.setValue = o, u.priority = a, s && (u.subPriority = s), u;
}
return it(n, [{
key: "validate",
value: function(i, o) {
return this.validateValue(i, this.value, o);
}
}, {
key: "set",
value: function(i, o, a) {
return this.setValue(i, o, this.value, a);
}
}]), n;
}(Qy), IT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", NT), _e(Ce(r), "subPriority", -1), r;
}
return it(n, [{
key: "set",
value: function(i, o) {
if (o.timestampIsSet)
return i;
var a = /* @__PURE__ */ new Date(0);
return a.setFullYear(i.getUTCFullYear(), i.getUTCMonth(), i.getUTCDate()), a.setHours(i.getUTCHours(), i.getUTCMinutes(), i.getUTCSeconds(), i.getUTCMilliseconds()), a;
}
}]), n;
}(Qy), pt = /* @__PURE__ */ function() {
function t() {
rt(this, t), _e(this, "incompatibleTokens", void 0), _e(this, "priority", void 0), _e(this, "subPriority", void 0);
}
return it(t, [{
key: "run",
value: function(n, r, i, o) {
var a = this.parse(n, r, i, o);
return a ? {
setter: new PT(a.value, this.validate, this.set, this.priority, this.subPriority),
rest: a.rest
} : null;
}
}, {
key: "validate",
value: function(n, r, i) {
return !0;
}
}]), t;
}(), LT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 140), _e(Ce(r), "incompatibleTokens", ["R", "u", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "G":
case "GG":
case "GGG":
return a.era(i, {
width: "abbreviated"
}) || a.era(i, {
width: "narrow"
});
case "GGGGG":
return a.era(i, {
width: "narrow"
});
case "GGGG":
default:
return a.era(i, {
width: "wide"
}) || a.era(i, {
width: "abbreviated"
}) || a.era(i, {
width: "narrow"
});
}
}
}, {
key: "set",
value: function(i, o, a) {
return o.era = a, i.setUTCFullYear(a, 0, 1), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt), It = {
month: /^(1[0-2]|0?\d)/,
// 0 to 12
date: /^(3[0-1]|[0-2]?\d)/,
// 0 to 31
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
// 0 to 366
week: /^(5[0-3]|[0-4]?\d)/,
// 0 to 53
hour23h: /^(2[0-3]|[0-1]?\d)/,
// 0 to 23
hour24h: /^(2[0-4]|[0-1]?\d)/,
// 0 to 24
hour11h: /^(1[0-1]|0?\d)/,
// 0 to 11
hour12h: /^(1[0-2]|0?\d)/,
// 0 to 12
minute: /^[0-5]?\d/,
// 0 to 59
second: /^[0-5]?\d/,
// 0 to 59
singleDigit: /^\d/,
// 0 to 9
twoDigits: /^\d{1,2}/,
// 0 to 99
threeDigits: /^\d{1,3}/,
// 0 to 999
fourDigits: /^\d{1,4}/,
// 0 to 9999
anyDigitsSigned: /^-?\d+/,
singleDigitSigned: /^-?\d/,
// 0 to 9, -0 to -9
twoDigitsSigned: /^-?\d{1,2}/,
// 0 to 99, -0 to -99
threeDigitsSigned: /^-?\d{1,3}/,
// 0 to 999, -0 to -999
fourDigitsSigned: /^-?\d{1,4}/
// 0 to 9999, -0 to -9999
}, $r = {
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
basic: /^([+-])(\d{2})(\d{2})|Z/,
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
extended: /^([+-])(\d{2}):(\d{2})|Z/,
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
};
function Lt(t, e) {
return t && {
value: e(t.value),
rest: t.rest
};
}
function Dt(t, e) {
var n = e.match(t);
return n ? {
value: parseInt(n[0], 10),
rest: e.slice(n[0].length)
} : null;
}
function Nr(t, e) {
var n = e.match(t);
if (!n)
return null;
if (n[0] === "Z")
return {
value: 0,
rest: e.slice(1)
};
var r = n[1] === "+" ? 1 : -1, i = n[2] ? parseInt(n[2], 10) : 0, o = n[3] ? parseInt(n[3], 10) : 0, a = n[5] ? parseInt(n[5], 10) : 0;
return {
value: r * (i * Dp + o * Mp + a * y_),
rest: e.slice(n[0].length)
};
}
function Zy(t) {
return Dt(It.anyDigitsSigned, t);
}
function Nt(t, e) {
switch (t) {
case 1:
return Dt(It.singleDigit, e);
case 2:
return Dt(It.twoDigits, e);
case 3:
return Dt(It.threeDigits, e);
case 4:
return Dt(It.fourDigits, e);
default:
return Dt(new RegExp("^\\d{1," + t + "}"), e);
}
}
function Rl(t, e) {
switch (t) {
case 1:
return Dt(It.singleDigitSigned, e);
case 2:
return Dt(It.twoDigitsSigned, e);
case 3:
return Dt(It.threeDigitsSigned, e);
case 4:
return Dt(It.fourDigitsSigned, e);
default:
return Dt(new RegExp("^-?\\d{1," + t + "}"), e);
}
}
function Ip(t) {
switch (t) {
case "morning":
return 4;
case "evening":
return 17;
case "pm":
case "noon":
case "afternoon":
return 12;
case "am":
case "midnight":
case "night":
default:
return 0;
}
}
function e2(t, e) {
var n = e > 0, r = n ? e : 1 - e, i;
if (r <= 50)
i = t || 100;
else {
var o = r + 50, a = Math.floor(o / 100) * 100, s = t >= o % 100;
i = t + a - (s ? 100 : 0);
}
return n ? i : 1 - i;
}
function t2(t) {
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
}
var RT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 130), _e(Ce(r), "incompatibleTokens", ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
var s = function(l) {
return {
year: l,
isTwoDigitYear: o === "yy"
};
};
switch (o) {
case "y":
return Lt(Nt(4, i), s);
case "yo":
return Lt(a.ordinalNumber(i, {
unit: "year"
}), s);
default:
return Lt(Nt(o.length, i), s);
}
}
}, {
key: "validate",
value: function(i, o) {
return o.isTwoDigitYear || o.year > 0;
}
}, {
key: "set",
value: function(i, o, a) {
var s = i.getUTCFullYear();
if (a.isTwoDigitYear) {
var u = e2(a.year, s);
return i.setUTCFullYear(u, 0, 1), i.setUTCHours(0, 0, 0, 0), i;
}
var l = !("era" in o) || o.era === 1 ? a.year : 1 - a.year;
return i.setUTCFullYear(l, 0, 1), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt), BT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 130), _e(Ce(r), "incompatibleTokens", ["y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
var s = function(l) {
return {
year: l,
isTwoDigitYear: o === "YY"
};
};
switch (o) {
case "Y":
return Lt(Nt(4, i), s);
case "Yo":
return Lt(a.ordinalNumber(i, {
unit: "year"
}), s);
default:
return Lt(Nt(o.length, i), s);
}
}
}, {
key: "validate",
value: function(i, o) {
return o.isTwoDigitYear || o.year > 0;
}
}, {
key: "set",
value: function(i, o, a, s) {
var u = $p(i, s);
if (a.isTwoDigitYear) {
var l = e2(a.year, u);
return i.setUTCFullYear(l, 0, s.firstWeekContainsDate), i.setUTCHours(0, 0, 0, 0), Ro(i, s);
}
var c = !("era" in o) || o.era === 1 ? a.year : 1 - a.year;
return i.setUTCFullYear(c, 0, s.firstWeekContainsDate), i.setUTCHours(0, 0, 0, 0), Ro(i, s);
}
}]), n;
}(pt), VT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 130), _e(Ce(r), "incompatibleTokens", ["G", "y", "Y", "u", "Q", "q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o) {
return Rl(o === "R" ? 4 : o.length, i);
}
}, {
key: "set",
value: function(i, o, a) {
var s = /* @__PURE__ */ new Date(0);
return s.setUTCFullYear(a, 0, 4), s.setUTCHours(0, 0, 0, 0), La(s);
}
}]), n;
}(pt), zT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 130), _e(Ce(r), "incompatibleTokens", ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o) {
return Rl(o === "u" ? 4 : o.length, i);
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCFullYear(a, 0, 1), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt), HT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 120), _e(Ce(r), "incompatibleTokens", ["Y", "R", "q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "Q":
case "QQ":
return Nt(o.length, i);
case "Qo":
return a.ordinalNumber(i, {
unit: "quarter"
});
case "QQQ":
return a.quarter(i, {
width: "abbreviated",
context: "formatting"
}) || a.quarter(i, {
width: "narrow",
context: "formatting"
});
case "QQQQQ":
return a.quarter(i, {
width: "narrow",
context: "formatting"
});
case "QQQQ":
default:
return a.quarter(i, {
width: "wide",
context: "formatting"
}) || a.quarter(i, {
width: "abbreviated",
context: "formatting"
}) || a.quarter(i, {
width: "narrow",
context: "formatting"
});
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 1 && o <= 4;
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCMonth((a - 1) * 3, 1), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt), qT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 120), _e(Ce(r), "incompatibleTokens", ["Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "q":
case "qq":
return Nt(o.length, i);
case "qo":
return a.ordinalNumber(i, {
unit: "quarter"
});
case "qqq":
return a.quarter(i, {
width: "abbreviated",
context: "standalone"
}) || a.quarter(i, {
width: "narrow",
context: "standalone"
});
case "qqqqq":
return a.quarter(i, {
width: "narrow",
context: "standalone"
});
case "qqqq":
default:
return a.quarter(i, {
width: "wide",
context: "standalone"
}) || a.quarter(i, {
width: "abbreviated",
context: "standalone"
}) || a.quarter(i, {
width: "narrow",
context: "standalone"
});
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 1 && o <= 4;
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCMonth((a - 1) * 3, 1), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt), FT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "incompatibleTokens", ["Y", "R", "q", "Q", "L", "w", "I", "D", "i", "e", "c", "t", "T"]), _e(Ce(r), "priority", 110), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
var s = function(l) {
return l - 1;
};
switch (o) {
case "M":
return Lt(Dt(It.month, i), s);
case "MM":
return Lt(Nt(2, i), s);
case "Mo":
return Lt(a.ordinalNumber(i, {
unit: "month"
}), s);
case "MMM":
return a.month(i, {
width: "abbreviated",
context: "formatting"
}) || a.month(i, {
width: "narrow",
context: "formatting"
});
case "MMMMM":
return a.month(i, {
width: "narrow",
context: "formatting"
});
case "MMMM":
default:
return a.month(i, {
width: "wide",
context: "formatting"
}) || a.month(i, {
width: "abbreviated",
context: "formatting"
}) || a.month(i, {
width: "narrow",
context: "formatting"
});
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 0 && o <= 11;
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCMonth(a, 1), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt), jT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 110), _e(Ce(r), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "w", "I", "D", "i", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
var s = function(l) {
return l - 1;
};
switch (o) {
case "L":
return Lt(Dt(It.month, i), s);
case "LL":
return Lt(Nt(2, i), s);
case "Lo":
return Lt(a.ordinalNumber(i, {
unit: "month"
}), s);
case "LLL":
return a.month(i, {
width: "abbreviated",
context: "standalone"
}) || a.month(i, {
width: "narrow",
context: "standalone"
});
case "LLLLL":
return a.month(i, {
width: "narrow",
context: "standalone"
});
case "LLLL":
default:
return a.month(i, {
width: "wide",
context: "standalone"
}) || a.month(i, {
width: "abbreviated",
context: "standalone"
}) || a.month(i, {
width: "narrow",
context: "standalone"
});
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 0 && o <= 11;
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCMonth(a, 1), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt);
function UT(t, e, n) {
Le(2, arguments);
var r = Fe(t), i = qe(e), o = Uy(r, n) - i;
return r.setUTCDate(r.getUTCDate() - o * 7), r;
}
var WT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 100), _e(Ce(r), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "i", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "w":
return Dt(It.week, i);
case "wo":
return a.ordinalNumber(i, {
unit: "week"
});
default:
return Nt(o.length, i);
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 1 && o <= 53;
}
}, {
key: "set",
value: function(i, o, a, s) {
return Ro(UT(i, a, s), s);
}
}]), n;
}(pt);
function YT(t, e) {
Le(2, arguments);
var n = Fe(t), r = qe(e), i = jy(n) - r;
return n.setUTCDate(n.getUTCDate() - i * 7), n;
}
var KT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 100), _e(Ce(r), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "I":
return Dt(It.week, i);
case "Io":
return a.ordinalNumber(i, {
unit: "week"
});
default:
return Nt(o.length, i);
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 1 && o <= 53;
}
}, {
key: "set",
value: function(i, o, a) {
return La(YT(i, a));
}
}]), n;
}(pt), GT = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], JT = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], XT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 90), _e(Ce(r), "subPriority", 1), _e(Ce(r), "incompatibleTokens", ["Y", "R", "q", "Q", "w", "I", "D", "i", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "d":
return Dt(It.date, i);
case "do":
return a.ordinalNumber(i, {
unit: "date"
});
default:
return Nt(o.length, i);
}
}
}, {
key: "validate",
value: function(i, o) {
var a = i.getUTCFullYear(), s = t2(a), u = i.getUTCMonth();
return s ? o >= 1 && o <= JT[u] : o >= 1 && o <= GT[u];
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCDate(a), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt), QT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 90), _e(Ce(r), "subpriority", 1), _e(Ce(r), "incompatibleTokens", ["Y", "R", "q", "Q", "M", "L", "w", "I", "d", "E", "i", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "D":
case "DD":
return Dt(It.dayOfYear, i);
case "Do":
return a.ordinalNumber(i, {
unit: "date"
});
default:
return Nt(o.length, i);
}
}
}, {
key: "validate",
value: function(i, o) {
var a = i.getUTCFullYear(), s = t2(a);
return s ? o >= 1 && o <= 366 : o >= 1 && o <= 365;
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCMonth(0, a), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt);
function Lp(t, e, n) {
var r, i, o, a, s, u, l, c;
Le(2, arguments);
var f = Yi(), d = qe((r = (i = (o = (a = n == null ? void 0 : n.weekStartsOn) !== null && a !== void 0 ? a : n == null || (s = n.locale) === null || s === void 0 || (u = s.options) === null || u === void 0 ? void 0 : u.weekStartsOn) !== null && o !== void 0 ? o : f.weekStartsOn) !== null && i !== void 0 ? i : (l = f.locale) === null || l === void 0 || (c = l.options) === null || c === void 0 ? void 0 : c.weekStartsOn) !== null && r !== void 0 ? r : 0);
if (!(d >= 0 && d <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
var p = Fe(t), h = qe(e), m = p.getUTCDay(), v = h % 7, y = (v + 7) % 7, k = (y < d ? 7 : 0) + h - m;
return p.setUTCDate(p.getUTCDate() + k), p;
}
var ZT = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 90), _e(Ce(r), "incompatibleTokens", ["D", "i", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "E":
case "EE":
case "EEE":
return a.day(i, {
width: "abbreviated",
context: "formatting"
}) || a.day(i, {
width: "short",
context: "formatting"
}) || a.day(i, {
width: "narrow",
context: "formatting"
});
case "EEEEE":
return a.day(i, {
width: "narrow",
context: "formatting"
});
case "EEEEEE":
return a.day(i, {
width: "short",
context: "formatting"
}) || a.day(i, {
width: "narrow",
context: "formatting"
});
case "EEEE":
default:
return a.day(i, {
width: "wide",
context: "formatting"
}) || a.day(i, {
width: "abbreviated",
context: "formatting"
}) || a.day(i, {
width: "short",
context: "formatting"
}) || a.day(i, {
width: "narrow",
context: "formatting"
});
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 0 && o <= 6;
}
}, {
key: "set",
value: function(i, o, a, s) {
return i = Lp(i, a, s), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt), eC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 90), _e(Ce(r), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a, s) {
var u = function(c) {
var f = Math.floor((c - 1) / 7) * 7;
return (c + s.weekStartsOn + 6) % 7 + f;
};
switch (o) {
case "e":
case "ee":
return Lt(Nt(o.length, i), u);
case "eo":
return Lt(a.ordinalNumber(i, {
unit: "day"
}), u);
case "eee":
return a.day(i, {
width: "abbreviated",
context: "formatting"
}) || a.day(i, {
width: "short",
context: "formatting"
}) || a.day(i, {
width: "narrow",
context: "formatting"
});
case "eeeee":
return a.day(i, {
width: "narrow",
context: "formatting"
});
case "eeeeee":
return a.day(i, {
width: "short",
context: "formatting"
}) || a.day(i, {
width: "narrow",
context: "formatting"
});
case "eeee":
default:
return a.day(i, {
width: "wide",
context: "formatting"
}) || a.day(i, {
width: "abbreviated",
context: "formatting"
}) || a.day(i, {
width: "short",
context: "formatting"
}) || a.day(i, {
width: "narrow",
context: "formatting"
});
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 0 && o <= 6;
}
}, {
key: "set",
value: function(i, o, a, s) {
return i = Lp(i, a, s), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt), tC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 90), _e(Ce(r), "incompatibleTokens", ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "e", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a, s) {
var u = function(c) {
var f = Math.floor((c - 1) / 7) * 7;
return (c + s.weekStartsOn + 6) % 7 + f;
};
switch (o) {
case "c":
case "cc":
return Lt(Nt(o.length, i), u);
case "co":
return Lt(a.ordinalNumber(i, {
unit: "day"
}), u);
case "ccc":
return a.day(i, {
width: "abbreviated",
context: "standalone"
}) || a.day(i, {
width: "short",
context: "standalone"
}) || a.day(i, {
width: "narrow",
context: "standalone"
});
case "ccccc":
return a.day(i, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return a.day(i, {
width: "short",
context: "standalone"
}) || a.day(i, {
width: "narrow",
context: "standalone"
});
case "cccc":
default:
return a.day(i, {
width: "wide",
context: "standalone"
}) || a.day(i, {
width: "abbreviated",
context: "standalone"
}) || a.day(i, {
width: "short",
context: "standalone"
}) || a.day(i, {
width: "narrow",
context: "standalone"
});
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 0 && o <= 6;
}
}, {
key: "set",
value: function(i, o, a, s) {
return i = Lp(i, a, s), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt);
function nC(t, e) {
Le(2, arguments);
var n = qe(e);
n % 7 === 0 && (n = n - 7);
var r = 1, i = Fe(t), o = i.getUTCDay(), a = n % 7, s = (a + 7) % 7, u = (s < r ? 7 : 0) + n - o;
return i.setUTCDate(i.getUTCDate() + u), i;
}
var rC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 90), _e(Ce(r), "incompatibleTokens", ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "E", "e", "c", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
var s = function(l) {
return l === 0 ? 7 : l;
};
switch (o) {
case "i":
case "ii":
return Nt(o.length, i);
case "io":
return a.ordinalNumber(i, {
unit: "day"
});
case "iii":
return Lt(a.day(i, {
width: "abbreviated",
context: "formatting"
}) || a.day(i, {
width: "short",
context: "formatting"
}) || a.day(i, {
width: "narrow",
context: "formatting"
}), s);
case "iiiii":
return Lt(a.day(i, {
width: "narrow",
context: "formatting"
}), s);
case "iiiiii":
return Lt(a.day(i, {
width: "short",
context: "formatting"
}) || a.day(i, {
width: "narrow",
context: "formatting"
}), s);
case "iiii":
default:
return Lt(a.day(i, {
width: "wide",
context: "formatting"
}) || a.day(i, {
width: "abbreviated",
context: "formatting"
}) || a.day(i, {
width: "short",
context: "formatting"
}) || a.day(i, {
width: "narrow",
context: "formatting"
}), s);
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 1 && o <= 7;
}
}, {
key: "set",
value: function(i, o, a) {
return i = nC(i, a), i.setUTCHours(0, 0, 0, 0), i;
}
}]), n;
}(pt), iC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 80), _e(Ce(r), "incompatibleTokens", ["b", "B", "H", "k", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "a":
case "aa":
case "aaa":
return a.dayPeriod(i, {
width: "abbreviated",
context: "formatting"
}) || a.dayPeriod(i, {
width: "narrow",
context: "formatting"
});
case "aaaaa":
return a.dayPeriod(i, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return a.dayPeriod(i, {
width: "wide",
context: "formatting"
}) || a.dayPeriod(i, {
width: "abbreviated",
context: "formatting"
}) || a.dayPeriod(i, {
width: "narrow",
context: "formatting"
});
}
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCHours(Ip(a), 0, 0, 0), i;
}
}]), n;
}(pt), oC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 80), _e(Ce(r), "incompatibleTokens", ["a", "B", "H", "k", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "b":
case "bb":
case "bbb":
return a.dayPeriod(i, {
width: "abbreviated",
context: "formatting"
}) || a.dayPeriod(i, {
width: "narrow",
context: "formatting"
});
case "bbbbb":
return a.dayPeriod(i, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return a.dayPeriod(i, {
width: "wide",
context: "formatting"
}) || a.dayPeriod(i, {
width: "abbreviated",
context: "formatting"
}) || a.dayPeriod(i, {
width: "narrow",
context: "formatting"
});
}
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCHours(Ip(a), 0, 0, 0), i;
}
}]), n;
}(pt), aC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 80), _e(Ce(r), "incompatibleTokens", ["a", "b", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "B":
case "BB":
case "BBB":
return a.dayPeriod(i, {
width: "abbreviated",
context: "formatting"
}) || a.dayPeriod(i, {
width: "narrow",
context: "formatting"
});
case "BBBBB":
return a.dayPeriod(i, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return a.dayPeriod(i, {
width: "wide",
context: "formatting"
}) || a.dayPeriod(i, {
width: "abbreviated",
context: "formatting"
}) || a.dayPeriod(i, {
width: "narrow",
context: "formatting"
});
}
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCHours(Ip(a), 0, 0, 0), i;
}
}]), n;
}(pt), sC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 70), _e(Ce(r), "incompatibleTokens", ["H", "K", "k", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "h":
return Dt(It.hour12h, i);
case "ho":
return a.ordinalNumber(i, {
unit: "hour"
});
default:
return Nt(o.length, i);
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 1 && o <= 12;
}
}, {
key: "set",
value: function(i, o, a) {
var s = i.getUTCHours() >= 12;
return s && a < 12 ? i.setUTCHours(a + 12, 0, 0, 0) : !s && a === 12 ? i.setUTCHours(0, 0, 0, 0) : i.setUTCHours(a, 0, 0, 0), i;
}
}]), n;
}(pt), uC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 70), _e(Ce(r), "incompatibleTokens", ["a", "b", "h", "K", "k", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "H":
return Dt(It.hour23h, i);
case "Ho":
return a.ordinalNumber(i, {
unit: "hour"
});
default:
return Nt(o.length, i);
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 0 && o <= 23;
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCHours(a, 0, 0, 0), i;
}
}]), n;
}(pt), lC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 70), _e(Ce(r), "incompatibleTokens", ["h", "H", "k", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "K":
return Dt(It.hour11h, i);
case "Ko":
return a.ordinalNumber(i, {
unit: "hour"
});
default:
return Nt(o.length, i);
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 0 && o <= 11;
}
}, {
key: "set",
value: function(i, o, a) {
var s = i.getUTCHours() >= 12;
return s && a < 12 ? i.setUTCHours(a + 12, 0, 0, 0) : i.setUTCHours(a, 0, 0, 0), i;
}
}]), n;
}(pt), cC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 70), _e(Ce(r), "incompatibleTokens", ["a", "b", "h", "H", "K", "t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "k":
return Dt(It.hour24h, i);
case "ko":
return a.ordinalNumber(i, {
unit: "hour"
});
default:
return Nt(o.length, i);
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 1 && o <= 24;
}
}, {
key: "set",
value: function(i, o, a) {
var s = a <= 24 ? a % 24 : a;
return i.setUTCHours(s, 0, 0, 0), i;
}
}]), n;
}(pt), dC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 60), _e(Ce(r), "incompatibleTokens", ["t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "m":
return Dt(It.minute, i);
case "mo":
return a.ordinalNumber(i, {
unit: "minute"
});
default:
return Nt(o.length, i);
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 0 && o <= 59;
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCMinutes(a, 0, 0), i;
}
}]), n;
}(pt), fC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 50), _e(Ce(r), "incompatibleTokens", ["t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o, a) {
switch (o) {
case "s":
return Dt(It.second, i);
case "so":
return a.ordinalNumber(i, {
unit: "second"
});
default:
return Nt(o.length, i);
}
}
}, {
key: "validate",
value: function(i, o) {
return o >= 0 && o <= 59;
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCSeconds(a, 0), i;
}
}]), n;
}(pt), pC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 30), _e(Ce(r), "incompatibleTokens", ["t", "T"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o) {
var a = function(u) {
return Math.floor(u * Math.pow(10, -o.length + 3));
};
return Lt(Nt(o.length, i), a);
}
}, {
key: "set",
value: function(i, o, a) {
return i.setUTCMilliseconds(a), i;
}
}]), n;
}(pt), hC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 10), _e(Ce(r), "incompatibleTokens", ["t", "T", "x"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o) {
switch (o) {
case "X":
return Nr($r.basicOptionalMinutes, i);
case "XX":
return Nr($r.basic, i);
case "XXXX":
return Nr($r.basicOptionalSeconds, i);
case "XXXXX":
return Nr($r.extendedOptionalSeconds, i);
case "XXX":
default:
return Nr($r.extended, i);
}
}
}, {
key: "set",
value: function(i, o, a) {
return o.timestampIsSet ? i : new Date(i.getTime() - a);
}
}]), n;
}(pt), mC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 10), _e(Ce(r), "incompatibleTokens", ["t", "T", "X"]), r;
}
return it(n, [{
key: "parse",
value: function(i, o) {
switch (o) {
case "x":
return Nr($r.basicOptionalMinutes, i);
case "xx":
return Nr($r.basic, i);
case "xxxx":
return Nr($r.basicOptionalSeconds, i);
case "xxxxx":
return Nr($r.extendedOptionalSeconds, i);
case "xxx":
default:
return Nr($r.extended, i);
}
}
}, {
key: "set",
value: function(i, o, a) {
return o.timestampIsSet ? i : new Date(i.getTime() - a);
}
}]), n;
}(pt), gC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 40), _e(Ce(r), "incompatibleTokens", "*"), r;
}
return it(n, [{
key: "parse",
value: function(i) {
return Zy(i);
}
}, {
key: "set",
value: function(i, o, a) {
return [new Date(a * 1e3), {
timestampIsSet: !0
}];
}
}]), n;
}(pt), bC = /* @__PURE__ */ function(t) {
ut(n, t);
var e = lt(n);
function n() {
var r;
rt(this, n);
for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
o[a] = arguments[a];
return r = e.call.apply(e, [this].concat(o)), _e(Ce(r), "priority", 20), _e(Ce(r), "incompatibleTokens", "*"), r;
}
return it(n, [{
key: "parse",
value: function(i) {
return Zy(i);
}
}, {
key: "set",
value: function(i, o, a) {
return [new Date(a), {
timestampIsSet: !0
}];
}
}]), n;
}(pt), vC = {
G: new LT(),
y: new RT(),
Y: new BT(),
R: new VT(),
u: new zT(),
Q: new HT(),
q: new qT(),
M: new FT(),
L: new jT(),
w: new WT(),
I: new KT(),
d: new XT(),
D: new QT(),
E: new ZT(),
e: new eC(),
c: new tC(),
i: new rC(),
a: new iC(),
b: new oC(),
B: new aC(),
h: new sC(),
H: new uC(),
K: new lC(),
k: new cC(),
m: new dC(),
s: new fC(),
S: new pC(),
X: new hC(),
x: new mC(),
t: new gC(),
T: new bC()
}, yC = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, wC = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, kC = /^'([^]*?)'?$/, xC = /''/g, SC = /\S/, EC = /[a-zA-Z]/;
function a0(t, e, n, r) {
var i, o, a, s, u, l, c, f, d, p, h, m, v, y, k, T, b, D;
Le(3, arguments);
var x = String(t), S = String(e), _ = Yi(), N = (i = (o = r == null ? void 0 : r.locale) !== null && o !== void 0 ? o : _.locale) !== null && i !== void 0 ? i : Gy;
if (!N.match)
throw new RangeError("locale must contain match property");
var R = qe((a = (s = (u = (l = r == null ? void 0 : r.firstWeekContainsDate) !== null && l !== void 0 ? l : r == null || (c = r.locale) === null || c === void 0 || (f = c.options) === null || f === void 0 ? void 0 : f.firstWeekContainsDate) !== null && u !== void 0 ? u : _.firstWeekContainsDate) !== null && s !== void 0 ? s : (d = _.locale) === null || d === void 0 || (p = d.options) === null || p === void 0 ? void 0 : p.firstWeekContainsDate) !== null && a !== void 0 ? a : 1);
if (!(R >= 1 && R <= 7))
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
var w = qe((h = (m = (v = (y = r == null ? void 0 : r.weekStartsOn) !== null && y !== void 0 ? y : r == null || (k = r.locale) === null || k === void 0 || (T = k.options) === null || T === void 0 ? void 0 : T.weekStartsOn) !== null && v !== void 0 ? v : _.weekStartsOn) !== null && m !== void 0 ? m : (b = _.locale) === null || b === void 0 || (D = b.options) === null || D === void 0 ? void 0 : D.weekStartsOn) !== null && h !== void 0 ? h : 0);
if (!(w >= 0 && w <= 6))
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
if (S === "")
return x === "" ? Fe(n) : /* @__PURE__ */ new Date(NaN);
var A = {
firstWeekContainsDate: R,
weekStartsOn: w,
locale: N
}, $ = [new IT()], I = S.match(wC).map(function(Q) {
var Z = Q[0];
if (Z in i0) {
var ae = i0[Z];
return ae(Q, N.formatLong);
}
return Q;
}).join("").match(yC), E = [], O = f1(I), g;
try {
var M = function() {
var Z = g.value;
!(r != null && r.useAdditionalWeekYearTokens) && Ky(Z) && Il(Z, S, t), !(r != null && r.useAdditionalDayOfYearTokens) && Yy(Z) && Il(Z, S, t);
var ae = Z[0], ke = vC[ae];
if (ke) {
var ge = ke.incompatibleTokens;
if (Array.isArray(ge)) {
var de = E.find(function(xe) {
return ge.includes(xe.token) || xe.token === ae;
});
if (de)
throw new RangeError("The format string mustn't contain `".concat(de.fullToken, "` and `").concat(Z, "` at the same time"));
} else if (ke.incompatibleTokens === "*" && E.length > 0)
throw new RangeError("The format string mustn't contain `".concat(Z, "` and any other token at the same time"));
E.push({
token: ae,
fullToken: Z
});
var ye = ke.run(x, Z, N.match, A);
if (!ye)
return {
v: /* @__PURE__ */ new Date(NaN)
};
$.push(ye.setter), x = ye.rest;
} else {
if (ae.match(EC))
throw new RangeError("Format string contains an unescaped latin alphabet character `" + ae + "`");
if (Z === "''" ? Z = "'" : ae === "'" && (Z = _C(Z)), x.indexOf(Z) === 0)
x = x.slice(Z.length);
else
return {
v: /* @__PURE__ */ new Date(NaN)
};
}
};
for (O.s(); !(g = O.n()).done; ) {
var H = M();
if (hr(H) === "object")
return H.v;
}
} catch (Q) {
O.e(Q);
} finally {
O.f();
}
if (x.length > 0 && SC.test(x))
return /* @__PURE__ */ new Date(NaN);
var z = $.map(function(Q) {
return Q.priority;
}).sort(function(Q, Z) {
return Z - Q;
}).filter(function(Q, Z, ae) {
return ae.indexOf(Q) === Z;
}).map(function(Q) {
return $.filter(function(Z) {
return Z.priority === Q;
}).sort(function(Z, ae) {
return ae.subPriority - Z.subPriority;
});
}).map(function(Q) {
return Q[0];
}), Y = Fe(n);
if (isNaN(Y.getTime()))
return /* @__PURE__ */ new Date(NaN);
var ee = qy(Y, Pl(Y)), ce = {}, q = f1(z), V;
try {
for (q.s(); !(V = q.n()).done; ) {
var te = V.value;
if (!te.validate(ee, A))
return /* @__PURE__ */ new Date(NaN);
var K = te.set(ee, ce, A);
Array.isArray(K) ? (ee = K[0], ET(ce, K[1])) : ee = K;
}
} catch (Q) {
q.e(Q);
} finally {
q.f();
}
return ee;
}
function _C(t) {
return t.match(kC)[1].replace(xC, "'");
}
function TC(t, e) {
Le(2, arguments);
var n = qe(e);
return Pi(t, -n);
}
function CC(t, e) {
var n;
Le(1, arguments);
var r = qe((n = e == null ? void 0 : e.additionalDigits) !== null && n !== void 0 ? n : 2);
if (r !== 2 && r !== 1 && r !== 0)
throw new RangeError("additionalDigits must be 0, 1 or 2");
if (!(typeof t == "string" || Object.prototype.toString.call(t) === "[object String]"))
return /* @__PURE__ */ new Date(NaN);
var i = DC(t), o;
if (i.date) {
var a = $C(i.date, r);
o = NC(a.restDateString, a.year);
}
if (!o || isNaN(o.getTime()))
return /* @__PURE__ */ new Date(NaN);
var s = o.getTime(), u = 0, l;
if (i.time && (u = PC(i.time), isNaN(u)))
return /* @__PURE__ */ new Date(NaN);
if (i.timezone) {
if (l = IC(i.timezone), isNaN(l))
return /* @__PURE__ */ new Date(NaN);
} else {
var c = new Date(s + u), f = /* @__PURE__ */ new Date(0);
return f.setFullYear(c.getUTCFullYear(), c.getUTCMonth(), c.getUTCDate()), f.setHours(c.getUTCHours(), c.getUTCMinutes(), c.getUTCSeconds(), c.getUTCMilliseconds()), f;
}
return new Date(s + u + l);
}
var $u = {
dateTimeDelimiter: /[T ]/,
timeZoneDelimiter: /[Z ]/i,
timezone: /([Z+-].*)$/
}, OC = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, AC = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, MC = /^([+-])(\d{2})(?::?(\d{2}))?$/;
function DC(t) {
var e = {}, n = t.split($u.dateTimeDelimiter), r;
if (n.length > 2)
return e;
if (/:/.test(n[0]) ? r = n[0] : (e.date = n[0], r = n[1], $u.timeZoneDelimiter.test(e.date) && (e.date = t.split($u.timeZoneDelimiter)[0], r = t.substr(e.date.length, t.length))), r) {
var i = $u.timezone.exec(r);
i ? (e.time = r.replace(i[1], ""), e.timezone = i[1]) : e.time = r;
}
return e;
}
function $C(t, e) {
var n = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"), r = t.match(n);
if (!r)
return {
year: NaN,
restDateString: ""
};
var i = r[1] ? parseInt(r[1]) : null, o = r[2] ? parseInt(r[2]) : null;
return {
year: o === null ? i : o * 100,
restDateString: t.slice((r[1] || r[2]).length)
};
}
function NC(t, e) {
if (e === null)
return /* @__PURE__ */ new Date(NaN);
var n = t.match(OC);
if (!n)
return /* @__PURE__ */ new Date(NaN);
var r = !!n[4], i = as(n[1]), o = as(n[2]) - 1, a = as(n[3]), s = as(n[4]), u = as(n[5]) - 1;
if (r)
return zC(e, s, u) ? LC(e, s, u) : /* @__PURE__ */ new Date(NaN);
var l = /* @__PURE__ */ new Date(0);
return !BC(e, o, a) || !VC(e, i) ? /* @__PURE__ */ new Date(NaN) : (l.setUTCFullYear(e, o, Math.max(i, a)), l);
}
function as(t) {
return t ? parseInt(t) : 1;
}
function PC(t) {
var e = t.match(AC);
if (!e)
return NaN;
var n = zd(e[1]), r = zd(e[2]), i = zd(e[3]);
return HC(n, r, i) ? n * Dp + r * Mp + i * 1e3 : NaN;
}
function zd(t) {
return t && parseFloat(t.replace(",", ".")) || 0;
}
function IC(t) {
if (t === "Z")
return 0;
var e = t.match(MC);
if (!e)
return 0;
var n = e[1] === "+" ? -1 : 1, r = parseInt(e[2]), i = e[3] && parseInt(e[3]) || 0;
return qC(r, i) ? n * (r * Dp + i * Mp) : NaN;
}
function LC(t, e, n) {
var r = /* @__PURE__ */ new Date(0);
r.setUTCFullYear(t, 0, 4);
var i = r.getUTCDay() || 7, o = (e - 1) * 7 + n + 1 - i;
return r.setUTCDate(r.getUTCDate() + o), r;
}
var RC = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function n2(t) {
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
}
function BC(t, e, n) {
return e >= 0 && e <= 11 && n >= 1 && n <= (RC[e] || (n2(t) ? 29 : 28));
}
function VC(t, e) {
return e >= 1 && e <= (n2(t) ? 366 : 365);
}
function zC(t, e, n) {
return e >= 1 && e <= 53 && n >= 0 && n <= 6;
}
function HC(t, e, n) {
return t === 24 ? e === 0 && n === 0 : n >= 0 && n < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
}
function qC(t, e) {
return e >= 0 && e <= 59;
}
function Cs(t, e) {
Le(2, arguments);
var n = Fe(t), r = qe(e), i = n.getFullYear(), o = n.getDate(), a = /* @__PURE__ */ new Date(0);
a.setFullYear(i, r, 15), a.setHours(0, 0, 0, 0);
var s = TT(a);
return n.setMonth(r, Math.min(o, s)), n;
}
function bn(t, e) {
if (Le(2, arguments), hr(e) !== "object" || e === null)
throw new RangeError("values parameter must be an object");
var n = Fe(t);
return isNaN(n.getTime()) ? /* @__PURE__ */ new Date(NaN) : (e.year != null && n.setFullYear(e.year), e.month != null && (n = Cs(n, e.month)), e.date != null && n.setDate(qe(e.date)), e.hours != null && n.setHours(qe(e.hours)), e.minutes != null && n.setMinutes(qe(e.minutes)), e.seconds != null && n.setSeconds(qe(e.seconds)), e.milliseconds != null && n.setMilliseconds(qe(e.milliseconds)), n);
}
function r2(t, e) {
Le(2, arguments);
var n = Fe(t), r = qe(e);
return n.setHours(r), n;
}
function Rp(t, e) {
Le(2, arguments);
var n = Fe(t), r = qe(e);
return n.setMilliseconds(r), n;
}
function i2(t, e) {
Le(2, arguments);
var n = Fe(t), r = qe(e);
return n.setMinutes(r), n;
}
function o2(t, e) {
Le(2, arguments);
var n = Fe(t), r = qe(e);
return n.setSeconds(r), n;
}
function Ao(t, e) {
Le(2, arguments);
var n = Fe(t), r = qe(e);
return isNaN(n.getTime()) ? /* @__PURE__ */ new Date(NaN) : (n.setFullYear(r), n);
}
function va(t, e) {
Le(2, arguments);
var n = qe(e);
return Ir(t, -n);
}
function FC(t, e) {
if (Le(2, arguments), !e || hr(e) !== "object")
return /* @__PURE__ */ new Date(NaN);
var n = e.years ? qe(e.years) : 0, r = e.months ? qe(e.months) : 0, i = e.weeks ? qe(e.weeks) : 0, o = e.days ? qe(e.days) : 0, a = e.hours ? qe(e.hours) : 0, s = e.minutes ? qe(e.minutes) : 0, u = e.seconds ? qe(e.seconds) : 0, l = va(t, r + n * 12), c = TC(l, o + i * 7), f = s + a * 60, d = u + f * 60, p = d * 1e3, h = new Date(c.getTime() - p);
return h;
}
function jC(t, e) {
Le(2, arguments);
var n = qe(e);
return zy(t, -n);
}
const Wo = (t, e) => {
const n = t.__vccOpts || t;
for (const [r, i] of e)
n[r] = i;
return n;
}, UC = {}, WC = {
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
width: "32",
height: "32",
viewBox: "0 0 32 32",
class: "dp__icon"
}, YC = /* @__PURE__ */ U("path", { d: "M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z" }, null, -1), KC = /* @__PURE__ */ U("path", { d: "M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z" }, null, -1), GC = /* @__PURE__ */ U("path", { d: "M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z" }, null, -1), JC = /* @__PURE__ */ U("path", { d: "M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z" }, null, -1), XC = [
YC,
KC,
GC,
JC
];
function QC(t, e) {
return C(), P("svg", WC, XC);
}
const Yc = /* @__PURE__ */ Wo(UC, [["render", QC]]), ZC = {}, eO = {
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
width: "32",
height: "32",
viewBox: "0 0 32 32",
class: "dp__icon"
}, tO = /* @__PURE__ */ U("path", { d: "M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z" }, null, -1), nO = /* @__PURE__ */ U("path", { d: "M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z" }, null, -1), rO = [
tO,
nO
];
function iO(t, e) {
return C(), P("svg", eO, rO);
}
const oO = /* @__PURE__ */ Wo(ZC, [["render", iO]]), aO = {}, sO = {
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
width: "32",
height: "32",
viewBox: "0 0 32 32",
class: "dp__icon"
}, uO = /* @__PURE__ */ U("path", { d: "M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z" }, null, -1), lO = [
uO
];
function cO(t, e) {
return C(), P("svg", sO, lO);
}
const h1 = /* @__PURE__ */ Wo(aO, [["render", cO]]), dO = {}, fO = {
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
width: "32",
height: "32",
viewBox: "0 0 32 32",
class: "dp__icon"
}, pO = /* @__PURE__ */ U("path", { d: "M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z" }, null, -1), hO = [
pO
];
function mO(t, e) {
return C(), P("svg", fO, hO);
}
const m1 = /* @__PURE__ */ Wo(dO, [["render", mO]]), gO = {}, bO = {
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
width: "32",
height: "32",
viewBox: "0 0 32 32",
class: "dp__icon"
}, vO = /* @__PURE__ */ U("path", { d: "M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z" }, null, -1), yO = /* @__PURE__ */ U("path", { d: "M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z" }, null, -1), wO = [
vO,
yO
];
function kO(t, e) {
return C(), P("svg", bO, wO);
}
const a2 = /* @__PURE__ */ Wo(gO, [["render", kO]]), xO = {}, SO = {
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
width: "32",
height: "32",
viewBox: "0 0 32 32",
class: "dp__icon"
}, EO = /* @__PURE__ */ U("path", { d: "M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z" }, null, -1), _O = [
EO
];
function TO(t, e) {
return C(), P("svg", SO, _O);
}
const s2 = /* @__PURE__ */ Wo(xO, [["render", TO]]), CO = {}, OO = {
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
width: "32",
height: "32",
viewBox: "0 0 32 32",
class: "dp__icon"
}, AO = /* @__PURE__ */ U("path", { d: "M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z" }, null, -1), MO = [
AO
];
function DO(t, e) {
return C(), P("svg", OO, MO);
}
const u2 = /* @__PURE__ */ Wo(CO, [["render", DO]]), g1 = (t, e) => {
const n = a0(t, e.slice(0, t.length), /* @__PURE__ */ new Date());
return _s(n) && Hy(n) ? n : null;
}, $O = (t, e) => {
if (typeof e == "string")
return g1(t, e);
if (Array.isArray(e)) {
let n = null;
for (const r of e)
if (n = g1(t, r), n)
break;
return n;
}
return typeof e == "function" ? e(t) : null;
}, pe = (t) => t ? new Date(t) : /* @__PURE__ */ new Date(), NO = (t, e) => {
if (e) {
const r = (t.getMonth() + 1).toString().padStart(2, "0"), i = t.getDate().toString().padStart(2, "0"), o = t.getHours().toString().padStart(2, "0"), a = t.getMinutes().toString().padStart(2, "0");
return `${t.getFullYear()}-${r}-${i}T${o}:${a}:00.000Z`;
}
const n = Date.UTC(
t.getUTCFullYear(),
t.getUTCMonth(),
t.getUTCDate(),
t.getUTCHours(),
t.getUTCMinutes(),
t.getUTCSeconds()
);
return new Date(n).toISOString();
}, Kr = (t) => {
let e = pe(JSON.parse(JSON.stringify(t)));
return e = r2(e, 0), e = i2(e, 0), e = o2(e, 0), e = Rp(e, 0), e;
}, or = (t, e, n, r) => {
let i = t ? pe(t) : pe();
return (e || e === 0) && (i = r2(i, +e)), (n || n === 0) && (i = i2(i, +n)), (r || r === 0) && (i = o2(i, +r)), Rp(i, 0);
}, fn = (t, e) => !t || !e ? !1 : Pp(Kr(t), Kr(e)), Ot = (t, e) => !t || !e ? !1 : Jy(Kr(t), Kr(e)), En = (t, e) => !t || !e ? !1 : Np(Kr(t), Kr(e)), l2 = (t, e, n) => t && t[0] && t[1] ? En(n, t[0]) && fn(n, t[1]) : t && t[0] && e ? En(n, t[0]) && fn(n, e) || fn(n, t[0]) && En(n, e) : !1, ss = Qt({
menuFocused: !1,
shiftKeyInMenu: !1
}), c2 = () => {
const t = (n) => {
ss.menuFocused = n;
}, e = (n) => {
ss.shiftKeyInMenu !== n && (ss.shiftKeyInMenu = n);
};
return {
control: L(() => ({ shiftKeyInMenu: ss.shiftKeyInMenu, menuFocused: ss.menuFocused })),
setMenuFocused: t,
setShiftKey: e
};
};
function Bp(t) {
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
var Bl = {}, PO = {
get exports() {
return Bl;
},
set exports(t) {
Bl = t;
}
};
(function(t, e) {
Object.defineProperty(e, "__esModule", {
value: !0
}), e.default = n;
function n(r) {
if (r === null || r === !0 || r === !1)
return NaN;
var i = Number(r);
return isNaN(i) ? i : i < 0 ? Math.ceil(i) : Math.floor(i);
}
t.exports = e.default;
})(PO, Bl);
const IO = /* @__PURE__ */ Bp(Bl);
var Vl = {}, LO = {
get exports() {
return Vl;
},
set exports(t) {
Vl = t;
}
};
(function(t, e) {
Object.defineProperty(e, "__esModule", {
value: !0
}), e.default = n;
function n(r) {
var i = new Date(Date.UTC(r.getFullYear(), r.getMonth(), r.getDate(), r.getHours(), r.getMinutes(), r.getSeconds(), r.getMilliseconds()));
return i.setUTCFullYear(r.getFullYear()), r.getTime() - i.getTime();
}
t.exports = e.default;
})(LO, Vl);
const b1 = /* @__PURE__ */ Bp(Vl);
function RO(t, e) {
var n = HO(e);
return n.formatToParts ? VO(n, t) : zO(n, t);
}
var BO = {
year: 0,
month: 1,
day: 2,
hour: 3,
minute: 4,
second: 5
};
function VO(t, e) {
try {
for (var n = t.formatToParts(e), r = [], i = 0; i < n.length; i++) {
var o = BO[n[i].type];
o >= 0 && (r[o] = parseInt(n[i].value, 10));
}
return r;
} catch (a) {
if (a instanceof RangeError)
return [NaN];
throw a;
}
}
function zO(t, e) {
var n = t.format(e).replace(/\u200E/g, ""), r = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);
return [r[3], r[1], r[2], r[4], r[5], r[6]];
}
var Hd = {};
function HO(t) {
if (!Hd[t]) {
var e = new Intl.DateTimeFormat("en-US", {
hour12: !1,
timeZone: "America/New_York",
year: "numeric",
month: "numeric",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), n = e === "06/25/2014, 00:00:00" || e === "06/25/2014 00:00:00";
Hd[t] = n ? new Intl.DateTimeFormat("en-US", {
hour12: !1,
timeZone: t,
year: "numeric",
month: "numeric",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
}) : new Intl.DateTimeFormat("en-US", {
hourCycle: "h23",
timeZone: t,
year: "numeric",
month: "numeric",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
});
}
return Hd[t];
}
function Vp(t, e, n, r, i, o, a) {
var s = /* @__PURE__ */ new Date(0);
return s.setUTCFullYear(t, e, n), s.setUTCHours(r, i, o, a), s;
}
var v1 = 36e5, qO = 6e4, qd = {
timezone: /([Z+-].*)$/,
timezoneZ: /^(Z)$/,
timezoneHH: /^([+-]\d{2})$/,
timezoneHHMM: /^([+-]\d{2}):?(\d{2})$/
};
function zp(t, e, n) {
var r, i;
if (!t || (r = qd.timezoneZ.exec(t), r))
return 0;
var o;
if (r = qd.timezoneHH.exec(t), r)
return o = parseInt(r[1], 10), y1(o) ? -(o * v1) : NaN;
if (r = qd.timezoneHHMM.exec(t), r) {
o = parseInt(r[1], 10);
var a = parseInt(r[2], 10);
return y1(o, a) ? (i = Math.abs(o) * v1 + a * qO, o > 0 ? -i : i) : NaN;
}
if (UO(t)) {
e = new Date(e || Date.now());
var s = n ? e : FO(e), u = s0(s, t), l = n ? u : jO(e, u, t);
return -l;
}
return NaN;
}
function FO(t) {
return Vp(
t.getFullYear(),
t.getMonth(),
t.getDate(),
t.getHours(),
t.getMinutes(),
t.getSeconds(),
t.getMilliseconds()
);
}
function s0(t, e) {
var n = RO(t, e), r = Vp(
n[0],
n[1] - 1,
n[2],
n[3] % 24,
n[4],
n[5],
0
).getTime(), i = t.getTime(), o = i % 1e3;
return i -= o >= 0 ? o : 1e3 + o, r - i;
}
function jO(t, e, n) {
var r = t.getTime(), i = r - e, o = s0(new Date(i), n);
if (e === o)
return e;
i -= o - e;
var a = s0(new Date(i), n);
return o === a ? o : Math.max(o, a);
}
function y1(t, e) {
return -23 <= t && t <= 23 && (e == null || 0 <= e && e <= 59);
}
var w1 = {};
function UO(t) {
if (w1[t])
return !0;
try {
return new Intl.DateTimeFormat(void 0, { timeZone: t }), w1[t] = !0, !0;
} catch {
return !1;
}
}
var WO = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;
const d2 = WO;
var Fd = 36e5, k1 = 6e4, YO = 2, Sn = {
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
datePattern: /^([0-9W+-]+)(.*)/,
plainTime: /:/,
// year tokens
YY: /^(\d{2})$/,
YYY: [
/^([+-]\d{2})$/,
// 0 additional digits
/^([+-]\d{3})$/,
// 1 additional digit
/^([+-]\d{4})$/
// 2 additional digits
],
YYYY: /^(\d{4})/,
YYYYY: [
/^([+-]\d{4})/,
// 0 additional digits
/^([+-]\d{5})/,
// 1 additional digit
/^([+-]\d{6})/
// 2 additional digits
],
// date tokens
MM: /^-(\d{2})$/,
DDD: /^-?(\d{3})$/,
MMDD: /^-?(\d{2})-?(\d{2})$/,
Www: /^-?W(\d{2})$/,
WwwD: /^-?W(\d{2})-?(\d{1})$/,
HH: /^(\d{2}([.,]\d*)?)$/,
HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
// time zone tokens (to identify the presence of a tz)
timeZone: d2
};
function u0(t, e) {
if (arguments.length < 1)
throw new TypeError("1 argument required, but only " + arguments.length + " present");
if (t === null)
return /* @__PURE__ */ new Date(NaN);
var n = e || {}, r = n.additionalDigits == null ? YO : IO(n.additionalDigits);
if (r !== 2 && r !== 1 && r !== 0)
throw new RangeError("additionalDigits must be 0, 1 or 2");
if (t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]")
return new Date(t.getTime());
if (typeof t == "number" || Object.prototype.toString.call(t) === "[object Number]")
return new Date(t);
if (!(typeof t == "string" || Object.prototype.toString.call(t) === "[object String]"))
return /* @__PURE__ */ new Date(NaN);
var i = KO(t), o = GO(i.date, r), a = o.year, s = o.restDateString, u = JO(s, a);
if (isNaN(u))
return /* @__PURE__ */ new Date(NaN);
if (u) {
var l = u.getTime(), c = 0, f;
if (i.time && (c = XO(i.time), isNaN(c)))
return /* @__PURE__ */ new Date(NaN);
if (i.timeZone || n.timeZone) {
if (f = zp(i.timeZone || n.timeZone, new Date(l + c)), isNaN(f))
return /* @__PURE__ */ new Date(NaN);
} else
f = b1(new Date(l + c)), f = b1(new Date(l + c + f));
return new Date(l + c + f);
} else
return /* @__PURE__ */ new Date(NaN);
}
function KO(t) {
var e = {}, n = Sn.dateTimePattern.exec(t), r;
if (n ? (e.date = n[1], r = n[3]) : (n = Sn.datePattern.exec(t), n ? (e.date = n[1], r = n[2]) : (e.date = null, r = t)), r) {
var i = Sn.timeZone.exec(r);
i ? (e.time = r.replace(i[1], ""), e.timeZone = i[1].trim()) : e.time = r;
}
return e;
}
function GO(t, e) {
var n = Sn.YYY[e], r = Sn.YYYYY[e], i;
if (i = Sn.YYYY.exec(t) || r.exec(t), i) {
var o = i[1];
return {
year: parseInt(o, 10),
restDateString: t.slice(o.length)
};
}
if (i = Sn.YY.exec(t) || n.exec(t), i) {
var a = i[1];
return {
year: parseInt(a, 10) * 100,
restDateString: t.slice(a.length)
};
}
return {
year: null
};
}
function JO(t, e) {
if (e === null)
return null;
var n, r, i, o;
if (t.length === 0)
return r = /* @__PURE__ */ new Date(0), r.setUTCFullYear(e), r;
if (n = Sn.MM.exec(t), n)
return r = /* @__PURE__ */ new Date(0), i = parseInt(n[1], 10) - 1, S1(e, i) ? (r.setUTCFullYear(e, i), r) : /* @__PURE__ */ new Date(NaN);
if (n = Sn.DDD.exec(t), n) {
r = /* @__PURE__ */ new Date(0);
var a = parseInt(n[1], 10);
return eA(e, a) ? (r.setUTCFullYear(e, 0, a), r) : /* @__PURE__ */ new Date(NaN);
}
if (n = Sn.MMDD.exec(t), n) {
r = /* @__PURE__ */ new Date(0), i = parseInt(n[1], 10) - 1;
var s = parseInt(n[2], 10);
return S1(e, i, s) ? (r.setUTCFullYear(e, i, s), r) : /* @__PURE__ */ new Date(NaN);
}
if (n = Sn.Www.exec(t), n)
return o = parseInt(n[1], 10) - 1, E1(e, o) ? x1(e, o) : /* @__PURE__ */ new Date(NaN);
if (n = Sn.WwwD.exec(t), n) {
o = parseInt(n[1], 10) - 1;
var u = parseInt(n[2], 10) - 1;
return E1(e, o, u) ? x1(e, o, u) : /* @__PURE__ */ new Date(NaN);
}
return null;
}
function XO(t) {
var e, n, r;
if (e = Sn.HH.exec(t), e)
return n = parseFloat(e[1].replace(",", ".")), jd(n) ? n % 24 * Fd : NaN;
if (e = Sn.HHMM.exec(t), e)
return n = parseInt(e[1], 10), r = parseFloat(e[2].replace(",", ".")), jd(n, r) ? n % 24 * Fd + r * k1 : NaN;
if (e = Sn.HHMMSS.exec(t), e) {
n = parseInt(e[1], 10), r = parseInt(e[2], 10);
var i = parseFloat(e[3].replace(",", "."));
return jd(n, r, i) ? n % 24 * Fd + r * k1 + i * 1e3 : NaN;
}
return null;
}
function x1(t, e, n) {
e = e || 0, n = n || 0;
var r = /* @__PURE__ */ new Date(0);
r.setUTCFullYear(t, 0, 4);
var i = r.getUTCDay() || 7, o = e * 7 + n + 1 - i;
return r.setUTCDate(r.getUTCDate() + o), r;
}
var QO = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], ZO = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function f2(t) {
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
}
function S1(t, e, n) {
if (e < 0 || e > 11)
return !1;
if (n != null) {
if (n < 1)
return !1;
var r = f2(t);
if (r && n > ZO[e] || !r && n > QO[e])
return !1;
}
return !0;
}
function eA(t, e) {
if (e < 1)
return !1;
var n = f2(t);
return !(n && e > 366 || !n && e > 365);
}
function E1(t, e, n) {
return !(e < 0 || e > 52 || n != null && (n < 0 || n > 6));
}
function jd(t, e, n) {
return !(t != null && (t < 0 || t >= 25) || e != null && (e < 0 || e >= 60) || n != null && (n < 0 || n >= 60));
}
var zl = {}, tA = {
get exports() {
return zl;
},
set exports(t) {
zl = t;
}
}, Hl = {}, nA = {
get exports() {
return Hl;
},
set exports(t) {
Hl = t;
}
};
(function(t, e) {
Object.defineProperty(e, "__esModule", {
value: !0
}), e.default = n;
function n(r, i) {
if (r == null)
throw new TypeError("assign requires that input parameter not be null or undefined");
for (var o in i)
Object.prototype.hasOwnProperty.call(i, o) && (r[o] = i[o]);
return r;
}
t.exports = e.default;
})(nA, Hl);
(function(t, e) {
Object.defineProperty(e, "__esModule", {
value: !0
}), e.default = i;
var n = r(Hl);
function r(o) {
return o && o.__esModule ? o : { default: o };
}
function i(o) {
return (0, n.default)({}, o);
}
t.exports = e.default;
})(tA, zl);
const rA = /* @__PURE__ */ Bp(zl);
function iA(t, e, n) {
var r = u0(t, n), i = zp(e, r, !0), o = new Date(r.getTime() - i), a = /* @__PURE__ */ new Date(0);
return a.setFullYear(o.getUTCFullYear(), o.getUTCMonth(), o.getUTCDate()), a.setHours(o.getUTCHours(), o.getUTCMinutes(), o.getUTCSeconds(), o.getUTCMilliseconds()), a;
}
function oA(t, e, n) {
if (typeof t == "string" && !t.match(d2)) {
var r = rA(n);
return r.timeZone = e, u0(t, r);
}
var i = u0(t, n), o = Vp(
i.getFullYear(),
i.getMonth(),
i.getDate(),
i.getHours(),
i.getMinutes(),
i.getSeconds(),
i.getMilliseconds()
).getTime(), a = zp(e, new Date(o));
return new Date(o + a);
}
const aA = (t, e = 3) => {
const n = [];
for (let r = 0; r < t.length; r += e)
n.push([t[r], t[r + 1], t[r + 2]]);
return n;
}, sA = (t, e) => {
const n = [1, 2, 3, 4, 5, 6, 7].map((o) => new Intl.DateTimeFormat(t, { weekday: "short", timeZone: "UTC" }).format(/* @__PURE__ */ new Date(`2017-01-0${o}T00:00:00+00:00`)).slice(0, 2)), r = n.slice(0, e), i = n.slice(e + 1, n.length);
return [n[e]].concat(...i).concat(...r);
}, uA = (t) => {
const e = [];
for (let n = +t[0]; n <= +t[1]; n++)
e.push({ value: +n, text: `${n}` });
return e;
}, lA = (t, e) => {
const n = new Intl.DateTimeFormat(t, { month: e, timeZone: "UTC" });
return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map((r) => {
const i = r < 10 ? `0${r}` : r;
return /* @__PURE__ */ new Date(`2017-${i}-01T00:00:00+00:00`);
}).map((r, i) => ({
text: n.format(r),
value: i
}));
}, cA = (t) => [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11][t], Ft = (t) => {
const e = W(t);
return e != null && e.$el ? e == null ? void 0 : e.$el : e;
}, dA = (t) => Object.assign({ type: "dot" }, t), p2 = (t) => Array.isArray(t) ? !!t[0] && !!t[1] : !1, ql = {
prop: (t) => `"${t}" prop must be enabled!`,
dateArr: (t) => `You need to use array as "model-value" binding in order to support "${t}"`
}, ln = (t) => t, _1 = (t) => t === 0 ? t : !t || isNaN(+t) ? null : +t, T1 = (t) => Object.assign(
{
menuAppear: "dp-menu-appear",
open: "dp-slide-down",
close: "dp-slide-up",
next: "calendar-next",
previous: "calendar-prev",
vNext: "dp-slide-up",
vPrevious: "dp-slide-down"
},
t
), fA = (t) => Object.assign(
{
toggleOverlay: "Toggle overlay",
menu: "Datepicker menu",
input: "Datepicker input",
calendarWrap: "Calendar wrapper",
calendarDays: "Calendar days",
openTimePicker: "Open time picker",
closeTimePicker: "Close time Picker",
incrementValue: (e) => `Increment ${e}`,
decrementValue: (e) => `Decrement ${e}`,
openTpOverlay: (e) => `Open ${e} overlay`,
amPmButton: "Switch AM/PM mode",
openYearsOverlay: "Open years overlay",
openMonthsOverlay: "Open months overlay",
nextMonth: "Next month",
prevMonth: "Previous month",
day: () => ""
},
t
), pA = (t) => t === null ? 0 : typeof t == "boolean" ? t ? 2 : 0 : +t >= 2 ? +t : 2, hA = (t, e, n) => t || (typeof n == "string" ? n : e), mA = (t) => typeof t == "boolean" ? t ? T1({}) : !1 : T1(t), gA = () => ({
enterSubmit: !0,
tabSubmit: !0,
openMenu: !0,
rangeSeparator: " - "
}), bA = (t) => Object.assign({ months: [], years: [], times: { hours: [], minutes: [], seconds: [] } }, t), Zn = (t) => {
const e = () => {
if (t.partialRange)
return null;
throw new Error(ql.prop("partial-range"));
}, n = L(() => ({
ariaLabels: fA(t.ariaLabels),
textInputOptions: Object.assign(gA(), t.textInputOptions),
multiCalendars: pA(t.multiCalendars),
previewFormat: hA(t.previewFormat, t.format, o()),
filters: bA(t.filters),
transitions: mA(t.transitions),
startTime: d()
})), r = (g) => {
if (t.range)
return g();
throw new Error(ql.prop("range"));
}, i = () => {
const g = t.enableSeconds ? ":ss" : "";
return t.is24 ? `HH:mm${g}` : `hh:mm${g} aa`;
}, o = () => t.format ? t.format : t.monthPicker ? "MM/yyyy" : t.timePicker ? i() : t.weekPicker ? "MM/dd/yyyy" : t.yearPicker ? "yyyy" : t.enableTimePicker ? `MM/dd/yyyy, ${i()}` : "MM/dd/yyyy", a = (g, M) => {
if (typeof t.format == "function")
return t.format(g);
const H = M || o(), z = t.formatLocale ? { locale: t.formatLocale } : void 0;
return Array.isArray(g) ? `${Ts(g[0], H, z)} ${t.modelAuto && !g[1] ? "" : n.value.textInputOptions.rangeSeparator || "-"} ${g[1] ? Ts(g[1], H, z) : ""}` : Ts(g, H, z);
}, s = (g) => t.timezone ? iA(g, t.timezone) : g, u = (g) => t.timezone ? oA(g, t.timezone) : g, l = L(() => (g) => {
var M;
return (M = t.hideNavigation) == null ? void 0 : M.includes(g);
}), c = (g) => {
const M = t.maxDate ? En(s(g), s(pe(t.maxDate))) : !1, H = t.minDate ? fn(s(g), s(pe(t.minDate))) : !1, z = y(g, t.disabledDates), Y = n.value.filters.months.map((te) => +te).includes(_t(g)), ee = t.disabledWeekDays.length ? t.disabledWeekDays.some((te) => +te === _T(g)) : !1, ce = t.allowedDates.length ? !t.allowedDates.some((te) => Ot(s(pe(te)), s(g))) : !1, q = Tt(g), V = q < +t.yearRange[0] || q > +t.yearRange[1];
return !(M || H || z || Y || V || ee || ce);
}, f = (g) => {
const M = {
hours: ui(pe()),
minutes: li(pe()),
seconds: Ra(pe())
};
return Object.assign(M, g);
}, d = () => t.range ? t.startTime && Array.isArray(t.startTime) ? [f(t.startTime[0]), f(t.startTime[1])] : null : t.startTime && !Array.isArray(t.startTime) ? f(t.startTime) : null, p = (g) => !c(g), h = (g) => Array.isArray(g) ? _s(g[0]) && (g[1] ? _s(g[1]) : !0) : g ? _s(g) : !1, m = (g) => g instanceof Date ? g : CC(g), v = (g) => {
const M = r0(s(g), { weekStartsOn: +t.weekStart }), H = w_(s(g), { weekStartsOn: +t.weekStart });
return [M, H];
}, y = (g, M) => Array.isArray(M) ? M.some((H) => Ot(s(pe(H)), s(g))) : M(g), k = (g, M, H) => {
let z = g ? pe(g) : pe();
return (M || M === 0) && (z = Cs(z, M)), H && (z = Ao(z, H)), z;
}, T = (g) => bn(pe(), { hours: ui(g), minutes: li(g), seconds: Ra(g) }), b = (g) => bn(pe(), {
hours: +g.hours || 0,
minutes: +g.minutes || 0,
seconds: +g.seconds || 0
}), D = (g, M, H, z) => {
if (!g)
return !0;
if (z) {
const Y = H === "max" ? Pp(g, M) : Np(g, M), ee = { seconds: 0, milliseconds: 0 };
return Y || Jy(bn(g, ee), bn(M, ee));
}
return H === "max" ? g.getTime() <= M.getTime() : g.getTime() >= M.getTime();
}, x = () => !t.enableTimePicker || t.monthPicker || t.yearPicker || t.ignoreTimeValidation, S = (g) => Array.isArray(g) ? [g[0] ? T(g[0]) : null, g[1] ? T(g[1]) : null] : T(g), _ = (g) => {
const M = t.maxTime ? b(t.maxTime) : pe(t.maxDate);
return Array.isArray(g) ? D(g[0], M, "max", !!t.maxDate) && D(g[1], M, "max", !!t.maxDate) : D(g, M, "max", !!t.maxDate);
}, N = (g, M) => {
const H = t.minTime ? b(t.minTime) : pe(t.minDate);
return Array.isArray(g) ? D(g[0], H, "min", !!t.minDate) && D(g[1], H, "min", !!t.minDate) && M : D(g, H, "min", !!t.minDate) && M;
}, R = (g) => {
let M = !0;
if (!g || x())
return !0;
const H = !t.minDate && !t.maxDate ? S(g) : g;
return (t.maxTime || t.maxDate) && (M = _(ln(H))), (t.minTime || t.minDate) && (M = N(ln(H), M)), M;
}, w = (g, M) => {
const H = pe(JSON.parse(JSON.stringify(g))), z = [];
for (let Y = 0; Y < 7; Y++) {
const ee = Pi(H, Y), ce = _t(ee) !== M;
z.push({
text: t.hideOffsetDates && ce ? "" : ee.getDate(),
value: ee,
current: !ce,
classData: {}
});
}
return z;
}, A = (g, M) => {
const H = [], z = pe(s(new Date(M, g))), Y = pe(s(new Date(M, g + 1, 0))), ee = r0(z, { weekStartsOn: t.weekStart }), ce = (q) => {
const V = w(q, g);
if (H.push({ days: V }), !H[H.length - 1].days.some(
(te) => Ot(Kr(te.value), Kr(Y))
)) {
const te = Pi(q, 7);
ce(te);
}
};
if (ce(ee), t.sixWeeks && H.length < 6) {
const q = 6 - H.length;
for (let V = 1; V <= q; V++) {
const te = H[H.length - 1], K = te.days[te.days.length - 1], Q = w(Pi(K.value, 1), _t(z));
H.push({ days: Q });
}
}
return H;
}, $ = (g, M, H) => [bn(pe(g), { date: 1 }), bn(pe(), { month: M, year: H, date: 1 })], I = (g, M) => fn(...$(t.minDate, g, M)) || Ot(...$(t.minDate, g, M)), E = (g, M) => En(...$(t.maxDate, g, M)) || Ot(...$(t.maxDate, g, M)), O = (g, M, H) => {
let z = !1;
return t.maxDate && H && E(g, M) && (z = !0), t.minDate && !H && I(g, M) && (z = !0), z;
};
return {
checkPartialRangeValue: e,
checkRangeEnabled: r,
getZonedDate: s,
getZonedToUtc: u,
formatDate: a,
getDefaultPattern: o,
validateDate: c,
getDefaultStartTime: d,
isDisabled: p,
isValidDate: h,
sanitizeDate: m,
getWeekFromDate: v,
matchDate: y,
setDateMonthOrYear: k,
isValidTime: R,
getCalendarDays: A,
validateMonthYearInRange: (g, M, H, z) => {
let Y = !1;
return z ? t.minDate && t.maxDate ? Y = O(g, M, H) : (t.minDate && I(g, M) || t.maxDate && E(g, M)) && (Y = !0) : Y = !0, Y;
},
validateMaxDate: E,
validateMinDate: I,
defaults: n,
hideNavigationButtons: l
};
}, St = Qt({
monthYear: [],
calendar: [],
time: [],
actionRow: [],
selectionGrid: [],
timePicker: {
0: [],
1: []
},
monthPicker: []
}), Ud = re(null), Nu = re(!1), Wd = re(!1), Yd = re(!1), Kd = re(!1), gn = re(0), Zt = re(0), Ki = () => {
const t = L(() => Nu.value ? [...St.selectionGrid, St.actionRow].filter((f) => f.length) : Wd.value ? [
...St.timePicker[0],
...St.timePicker[1],
Kd.value ? [] : [Ud.value],
St.actionRow
].filter((f) => f.length) : Yd.value ? [...St.monthPicker, St.actionRow] : [St.monthYear, ...St.calendar, St.time, St.actionRow].filter((f) => f.length)), e = (f) => {
gn.value = f ? gn.value + 1 : gn.value - 1;
let d = null;
t.value[Zt.value] && (d = t.value[Zt.value][gn.value]), d || (gn.value = f ? gn.value - 1 : gn.value + 1);
}, n = (f) => {
Zt.value === 0 && !f || Zt.value === t.value.length && f || (Zt.value = f ? Zt.value + 1 : Zt.value - 1, t.value[Zt.value] ? t.value[Zt.value] && !t.value[Zt.value][gn.value] && gn.value !== 0 && (gn.value = t.value[Zt.value].length - 1) : Zt.value = f ? Zt.value - 1 : Zt.value + 1);
}, r = (f) => {
let d = null;
t.value[Zt.value] && (d = t.value[Zt.value][gn.value]), d ? d.focus({ preventScroll: !Nu.value }) : gn.value = f ? gn.value - 1 : gn.value + 1;
}, i = () => {
e(!0), r(!0);
}, o = () => {
e(!1), r(!1);
}, a = () => {
n(!1), r(!0);
}, s = () => {
n(!0), r(!0);
}, u = (f, d) => {
St[d] = f;
}, l = (f, d) => {
St[d] = f;
}, c = () => {
gn.value = 0, Zt.value = 0;
};
return {
buildMatrix: u,
buildMultiLevelMatrix: l,
setTimePickerBackRef: (f) => {
Ud.value = f;
},
setSelectionGrid: (f) => {
Nu.value = f, c(), f || (St.selectionGrid = []);
},
setTimePicker: (f, d = !1) => {
Wd.value = f, Kd.value = d, c(), f || (St.timePicker[0] = [], St.timePicker[1] = []);
},
setTimePickerElements: (f, d = 0) => {
St.timePicker[d] = f;
},
arrowRight: i,
arrowLeft: o,
arrowUp: a,
arrowDown: s,
clearArrowNav: () => {
St.monthYear = [], St.calendar = [], St.time = [], St.actionRow = [], St.selectionGrid = [], St.timePicker[0] = [], St.timePicker[1] = [], Nu.value = !1, Wd.value = !1, Kd.value = !1, Yd.value = !1, c(), Ud.value = null;
},
setMonthPicker: (f) => {
Yd.value = f, c();
},
refSets: St
// exposed for testing
};
}, C1 = (t) => Array.isArray(t), no = (t) => Array.isArray(t), O1 = (t) => Array.isArray(t) && t.length === 2, vA = (t, e, n, r, i) => {
const {
getDefaultStartTime: o,
isDisabled: a,
sanitizeDate: s,
getWeekFromDate: u,
setDateMonthOrYear: l,
validateMonthYearInRange: c,
defaults: f
} = Zn(t), d = L({
get: () => t.internalModelValue,
set: (G) => {
!t.readonly && !t.disabled && e("update:internal-model-value", G);
}
}), p = re([]);
Ct(d, () => {
t.multiCalendars || D();
});
const h = re([{ month: _t(pe()), year: Tt(pe()) }]), m = Qt({
hours: t.range ? [ui(pe()), ui(pe())] : ui(pe()),
minutes: t.range ? [li(pe()), li(pe())] : li(pe()),
seconds: t.range ? [0, 0] : 0
}), v = L(
() => (G) => h.value[G] ? h.value[G].month : 0
), y = L(
() => (G) => h.value[G] ? h.value[G].year : 0
), k = L(() => t.flow && t.flow.length ? i.value === t.flow.length : !0), T = (G, fe, Ne) => {
var Be, ht;
h.value[G] || (h.value[G] = { month: 0, year: 0 }), h.value[G].month = fe === null ? (Be = h.value[G]) == null ? void 0 : Be.month : fe, h.value[G].year = Ne === null ? (ht = h.value[G]) == null ? void 0 : ht.year : Ne;
}, b = (G, fe) => {
m[G] = fe;
};
st(() => {
d.value || (t.startDate && (T(0, _t(pe(t.startDate)), Tt(pe(t.startDate))), f.value.multiCalendars && je(0)), f.value.startTime && E()), D(!0);
});
const D = (G = !1) => {
if (d.value)
return Array.isArray(d.value) ? (p.value = d.value, R(G)) : S(d.value);
if (t.timePicker)
return w();
if (t.monthPicker && !t.range)
return A();
if (t.yearPicker && !t.range)
return $();
if (f.value.multiCalendars && G && !t.startDate)
return x(pe(), G);
}, x = (G, fe = !1) => {
if ((!f.value.multiCalendars || !t.multiStatic || fe) && T(0, _t(G), Tt(G)), f.value.multiCalendars)
for (let Ne = 1; Ne < f.value.multiCalendars; Ne++) {
const Be = bn(pe(), { month: v.value(Ne - 1), year: y.value(Ne - 1) }), ht = Vy(Be, { months: 1 });
h.value[Ne] = { month: _t(ht), year: Tt(ht) };
}
}, S = (G) => {
x(G), b("hours", ui(G)), b("minutes", li(G)), b("seconds", Ra(G));
}, _ = (G, fe) => {
x(G[0], fe);
const Ne = (Be, ht) => [
Be(G[0]),
G[1] ? Be(G[1]) : m[ht][1]
];
b("hours", Ne(ui, "hours")), b("minutes", Ne(li, "minutes")), b("seconds", Ne(Ra, "seconds"));
}, N = (G, fe) => {
if ((t.range || t.weekPicker) && !t.multiDates)
return _(G, fe);
if (t.multiDates) {
const Ne = G[G.length - 1];
return S(Ne);
}
}, R = (G) => {
const fe = d.value;
N(fe, G), f.value.multiCalendars && t.multiCalendarsSolo && g();
}, w = () => {
if (E(), !t.range)
d.value = or(pe(), m.hours, m.minutes, I());
else {
const G = m.hours, fe = m.minutes;
d.value = [
or(pe(), G[0], fe[0], I()),
or(pe(), G[1], fe[1], I(!1))
];
}
}, A = () => {
d.value = l(pe(), v.value(0), y.value(0));
}, $ = () => {
d.value = pe();
}, I = (G = !0) => t.enableSeconds ? Array.isArray(m.seconds) ? G ? m.seconds[0] : m.seconds[1] : m.seconds : 0, E = () => {
const G = o();
if (G) {
const fe = Array.isArray(G), Ne = fe ? [+G[0].hours, +G[1].hours] : +G.hours, Be = fe ? [+G[0].minutes, +G[1].minutes] : +G.minutes, ht = fe ? [+G[0].seconds, +G[1].seconds] : +G.seconds;
b("hours", Ne), b("minutes", Be), t.enableSeconds && b("seconds", ht);
}
}, O = () => Array.isArray(d.value) && d.value.length ? d.value[d.value.length - 1] : null, g = () => {
if (Array.isArray(d.value) && d.value.length === 2) {
const G = pe(
pe(d.value[1] ? d.value[1] : Ir(d.value[0], 1))
), [fe, Ne] = [_t(d.value[0]), Tt(d.value[0])], [Be, ht] = [_t(d.value[1]), Tt(d.value[1])];
(fe !== Be || fe === Be && Ne !== ht) && t.multiCalendarsSolo && T(1, _t(G), Tt(G));
}
}, M = (G) => {
const fe = Ir(G, 1);
return { month: _t(fe), year: Tt(fe) };
}, H = (G) => {
const fe = _t(pe(G)), Ne = Tt(pe(G));
if (T(0, fe, Ne), f.value.multiCalendars > 0)
for (let Be = 1; Be < f.value.multiCalendars; Be++) {
const ht = M(
bn(pe(G), { year: v.value(Be - 1), month: y.value(Be - 1) })
);
T(Be, ht.month, ht.year);
}
}, z = (G) => {
if (d.value && Array.isArray(d.value))
if (d.value.some((fe) => Ot(G, fe))) {
const fe = d.value.filter((Ne) => !Ot(Ne, G));
d.value = fe.length ? fe : null;
} else
(t.multiDatesLimit && +t.multiDatesLimit > d.value.length || !t.multiDatesLimit) && d.value.push(G);
else
d.value = [G];
}, Y = (G, fe) => {
const Ne = En(G, fe) ? fe : G, Be = En(fe, G) ? fe : G;
return s1({ start: Ne, end: Be });
}, ee = (G) => {
if (Array.isArray(d.value) && d.value[0]) {
const fe = v_(G, d.value[0]), Ne = Y(d.value[0], G), Be = Ne.length === 1 ? 0 : Ne.filter((B) => a(B)).length, ht = Math.abs(fe) - Be;
if (t.minRange && t.maxRange)
return ht >= +t.minRange && ht <= +t.maxRange;
if (t.minRange)
return ht >= +t.minRange;
if (t.maxRange)
return ht <= +t.maxRange;
}
return !0;
}, ce = (G) => Array.isArray(d.value) && d.value.length === 2 ? t.fixedStart && (En(G, d.value[0]) || Ot(G, d.value[0])) ? [d.value[0], G] : t.fixedEnd && (fn(G, d.value[1]) || Ot(G, d.value[1])) ? [G, d.value[1]] : (e("invalid-fixed-range", G), d.value) : [], q = () => {
t.autoApply && k.value && e("auto-apply");
}, V = () => {
t.autoApply && e("select-date");
}, te = (G) => !s1({ start: G[0], end: G[1] }).some((fe) => a(fe)), K = (G) => (d.value = u(pe(G.value)), q()), Q = (G) => {
const fe = or(pe(G.value), m.hours, m.minutes, I());
t.multiDates ? z(fe) : d.value = fe, n(), q();
}, Z = () => {
p.value = d.value ? d.value.slice() : [], p.value.length === 2 && !(t.fixedStart || t.fixedEnd) && (p.value = []);
}, ae = (G, fe) => {
const Ne = [pe(G.value), Pi(pe(G.value), +t.autoRange)];
te(Ne) && (fe && H(G.value), p.value = Ne);
}, ke = (G) => {
ge(G.value) || (p.value = ce(pe(G.value)));
}, ge = (G) => t.noDisabledRange ? Y(p.value[0], G).some((fe) => a(fe)) : !1, de = (G, fe) => {
if (Z(), t.autoRange)
return ae(G, fe);
if (t.fixedStart || t.fixedEnd)
return ke(G);
p.value[0] ? ee(pe(G.value)) && !ge(G.value) && (fn(pe(G.value), pe(p.value[0])) ? p.value.unshift(pe(G.value)) : p.value[1] = pe(G.value)) : p.value[0] = pe(G.value);
}, ye = (G) => {
p.value[G] = or(
p.value[G],
m.hours[G],
m.minutes[G],
I(G !== 1)
);
}, xe = () => {
p.value.length && (p.value[0] && !p.value[1] ? ye(0) : (ye(0), ye(1), n()), d.value = p.value.slice(), p.value[0] && p.value[1] && t.autoApply && e("auto-apply"), p.value[0] && !p.value[1] && t.modelAuto && t.autoApply && e("auto-apply"));
}, ct = (G, fe = !1) => {
if (!(a(G.value) || !G.current && t.hideOffsetDates)) {
if (t.weekPicker)
return K(G);
if (!t.range)
return Q(G);
no(m.hours) && no(m.minutes) && !t.multiDates && (de(G, fe), xe());
}
}, le = (G) => {
const fe = G.find((Ne) => Ne.current);
return fe ? OT(fe.value) : "";
}, je = (G) => {
for (let fe = G - 1; fe >= 0; fe--) {
const Ne = va(bn(pe(), { month: v.value(fe + 1), year: y.value(fe + 1) }), 1);
T(fe, _t(Ne), Tt(Ne));
}
for (let fe = G + 1; fe <= f.value.multiCalendars - 1; fe++) {
const Ne = Ir(bn(pe(), { month: v.value(fe - 1), year: y.value(fe - 1) }), 1);
T(fe, _t(Ne), Tt(Ne));
}
}, We = (G) => l(pe(), v.value(G), y.value(G)), Ke = (G) => or(G, m.hours, m.minutes, I()), ot = (G, fe) => {
const Ne = t.monthPicker ? v.value(G) !== fe.month || !fe.fromNav : y.value(G) !== fe.year;
if (T(G, fe.month, fe.year), f.value.multiCalendars && !t.multiCalendarsSolo && je(G), t.monthPicker || t.yearPicker)
if (t.range) {
if (Ne) {
let Be = d.value ? d.value.slice() : [];
Be.length === 2 && Be[1] !== null && (Be = []), Be.length ? fn(We(G), Be[0]) ? Be.unshift(We(G)) : Be[1] = We(G) : Be = [We(G)], d.value = Be;
}
} else
d.value = We(G);
e("update-month-year", { instance: G, month: fe.month, year: fe.year }), r(t.multiCalendarsSolo ? G : void 0);
}, Rt = async (G = !1) => {
if (t.autoApply && (t.monthPicker || t.yearPicker)) {
await Vn();
const fe = t.monthPicker ? G : !1;
t.range ? e("auto-apply", fe || !d.value || d.value.length === 1) : e("auto-apply", fe);
}
n();
}, xt = (G, fe) => {
const Ne = bn(pe(), { month: v.value(fe), year: y.value(fe) }), Be = G < 0 ? Ir(Ne, 1) : va(Ne, 1);
c(_t(Be), Tt(Be), G < 0, t.preventMinMaxNavigation) && (T(fe, _t(Be), Tt(Be)), f.value.multiCalendars && !t.multiCalendarsSolo && je(fe), e("update-month-year", { instance: fe, month: _t(Be), year: Tt(Be) }), r());
}, qt = (G) => {
C1(G) && C1(d.value) && no(m.hours) && no(m.minutes) ? (G[0] && d.value[0] && (d.value[0] = or(G[0], m.hours[0], m.minutes[0], I())), G[1] && d.value[1] && (d.value[1] = or(G[1], m.hours[1], m.minutes[1], I(!1)))) : t.multiDates && Array.isArray(d.value) ? d.value[d.value.length - 1] = Ke(G) : !t.range && !O1(G) && (d.value = Ke(G)), e("time-update");
}, Ut = (G, fe = !0, Ne = !1) => {
const Be = fe ? G : m.hours, ht = !fe && !Ne ? G : m.minutes, B = Ne ? G : m.seconds;
if (t.range && O1(d.value) && no(Be) && no(ht) && no(B) && !t.disableTimeRangeValidation) {
const ie = (ue) => or(d.value[ue], Be[ue], ht[ue], B[ue]), j = (ue) => Rp(d.value[ue], 0);
if (Ot(d.value[0], d.value[1]) && (Np(ie(0), j(1)) || Pp(ie(1), j(0))))
return;
}
if (b("hours", Be), b("minutes", ht), b("seconds", B), d.value)
if (t.multiDates) {
const ie = O();
ie && qt(ie);
} else
qt(d.value);
else
t.timePicker && qt(t.range ? [pe(), pe()] : pe());
n();
}, Hn = (G, fe) => {
t.monthChangeOnScroll && xt(t.monthChangeOnScroll !== "inverse" ? -G.deltaY : G.deltaY, fe);
}, qn = (G, fe, Ne = !1) => {
t.monthChangeOnArrows && t.vertical === Ne && An(G, fe);
}, An = (G, fe) => {
xt(G === "right" ? -1 : 1, fe);
};
return {
time: m,
month: v,
year: y,
modelValue: d,
calendars: h,
monthYearSelect: Rt,
isDisabled: a,
updateTime: Ut,
getWeekNum: le,
selectDate: ct,
updateMonthYear: ot,
handleScroll: Hn,
getMarker: (G) => t.markers.find((fe) => Ot(s(G.value), s(fe.date))),
handleArrow: qn,
handleSwipe: An,
selectCurrentDate: () => {
t.range ? d.value && Array.isArray(d.value) && d.value[0] ? d.value = fn(pe(), d.value[0]) ? [pe(), d.value[0]] : [d.value[0], pe()] : d.value = [pe()] : d.value = pe(), V();
},
presetDateRange: (G, fe) => {
fe || G.length && G.length <= 2 && t.range && (d.value = G.map((Ne) => pe(Ne)), V(), t.multiCalendars && Vn().then(() => D(!0)));
}
};
}, yA = (t, e, n) => {
const r = re(), {
getZonedToUtc: i,
getZonedDate: o,
formatDate: a,
getDefaultPattern: s,
checkRangeEnabled: u,
checkPartialRangeValue: l,
isValidDate: c,
setDateMonthOrYear: f,
defaults: d
} = Zn(e), p = re(""), h = So(e, "format");
Ct(r, () => {
t("internal-model-change", r.value);
}), Ct(h, () => {
M();
});
const m = (q) => {
const V = q || pe();
return e.modelType ? z(V) : {
hours: ui(V),
minutes: li(V),
seconds: e.enableSeconds ? Ra(V) : 0
};
}, v = (q) => e.modelType ? z(q) : { month: _t(q), year: Tt(q) }, y = (q) => Array.isArray(q) ? u(() => [
Ao(pe(), q[0]),
q[1] ? Ao(pe(), q[1]) : l()
]) : Ao(pe(), +q), k = (q, V) => (typeof q == "string" || typeof q == "number") && e.modelType ? H(q) : V, T = (q) => Array.isArray(q) ? [
k(
q[0],
or(null, +q[0].hours, +q[0].minutes, q[0].seconds)
),
k(
q[1],
or(null, +q[1].hours, +q[1].minutes, q[1].seconds)
)
] : k(q, or(null, q.hours, q.minutes, q.seconds)), b = (q) => Array.isArray(q) ? u(() => [
k(q[0], f(null, +q[0].month, +q[0].year)),
k(
q[1],
q[1] ? f(null, +q[1].month, +q[1].year) : l()
)
]) : k(q, f(null, +q.month, +q.year)), D = (q) => {
if (Array.isArray(q))
return q.map((V) => H(V));
throw new Error(ql.dateArr("multi-dates"));
}, x = (q) => {
if (Array.isArray(q))
return [pe(q[0]), pe(q[1])];
throw new Error(ql.dateArr("week-picker"));
}, S = (q) => e.modelAuto ? Array.isArray(q) ? [H(q[0]), H(q[1])] : e.autoApply ? [H(q)] : [H(q), null] : Array.isArray(q) ? u(() => [
H(q[0]),
q[1] ? H(q[1]) : l()
]) : H(q), _ = () => {
Array.isArray(r.value) && e.range && r.value.length === 1 && r.value.push(l());
}, N = () => {
const q = r.value;
return [
z(q[0]),
q[1] ? z(q[1]) : l()
];
}, R = () => r.value[1] ? N() : z(ln(r.value[0])), w = () => (r.value || []).map((q) => z(q)), A = () => (_(), e.modelAuto ? R() : e.multiDates ? w() : Array.isArray(r.value) ? u(() => N()) : z(ln(r.value))), $ = (q) => q ? e.timePicker ? T(ln(q)) : e.monthPicker ? b(ln(q)) : e.yearPicker ? y(ln(q)) : e.multiDates ? D(ln(q)) : e.weekPicker ? x(ln(q)) : S(ln(q)) : null, I = (q) => {
const V = $(q);
c(ln(V)) ? (r.value = ln(V), M()) : (r.value = null, p.value = "");
}, E = () => {
var q;
const V = (te) => {
var K;
return Ts(te, (K = d.value.textInputOptions) == null ? void 0 : K.format);
};
return `${V(r.value[0])} ${(q = d.value.textInputOptions) == null ? void 0 : q.rangeSeparator} ${r.value[1] ? V(r.value[1]) : ""}`;
}, O = () => {
var q;
return n.value && r.value ? Array.isArray(r.value) ? E() : Ts(r.value, (q = d.value.textInputOptions) == null ? void 0 : q.format) : a(r.value);
}, g = () => {
var q;
return r.value ? e.multiDates ? r.value.map((V) => a(V)).join("; ") : e.textInput && typeof ((q = d.value.textInputOptions) == null ? void 0 : q.format) == "string" ? O() : a(r.value) : "";
}, M = () => {
!e.format || typeof e.format == "string" ? p.value = g() : p.value = e.format(r.value);
}, H = (q) => {
if (e.utc) {
const V = new Date(q);
return e.utc === "preserve" ? new Date(V.getTime() + V.getTimezoneOffset() * 6e4) : V;
}
return e.modelType ? e.modelType === "date" || e.modelType === "timestamp" ? o(new Date(q)) : e.modelType === "format" && (typeof e.format == "string" || !e.format) ? a0(q, s(), /* @__PURE__ */ new Date()) : o(a0(q, e.modelType, /* @__PURE__ */ new Date())) : o(new Date(q));
}, z = (q) => e.utc ? NO(q, e.utc === "preserve") : e.modelType ? e.modelType === "timestamp" ? +i(q) : e.modelType === "format" && (typeof e.format == "string" || !e.format) ? a(i(q)) : a(i(q), e.modelType) : i(q), Y = (q) => {
t("update:model-value", q);
}, ee = (q) => Array.isArray(r.value) ? [
q(r.value[0]),
r.value[1] ? q(r.value[1]) : l()
] : q(ln(r.value)), ce = (q) => Y(ln(ee(q)));
return {
inputValue: p,
internalModelValue: r,
checkBeforeEmit: () => r.value ? e.range ? e.partialRange ? r.value.length >= 1 : r.value.length === 2 : !!r.value : !1,
parseExternalModelValue: I,
formatInputValue: M,
emitModelValue: () => (M(), e.monthPicker ? ce(v) : e.timePicker ? ce(m) : e.yearPicker ? ce(Tt) : e.weekPicker ? Y(r.value) : Y(A()))
};
}, wA = (t, e) => {
const { validateMonthYearInRange: n, validateMaxDate: r, validateMinDate: i, defaults: o } = Zn(t), a = (f, d) => {
let p = f;
return o.value.filters.months.includes(_t(p)) ? (p = d ? Ir(f, 1) : va(f, 1), a(p, d)) : p;
}, s = (f, d) => {
let p = f;
return o.value.filters.years.includes(Tt(p)) ? (p = d ? zy(f, 1) : jC(f, 1), s(p, d)) : p;
}, u = (f) => {
const d = bn(/* @__PURE__ */ new Date(), { month: t.month, year: t.year });
let p = f ? Ir(d, 1) : va(d, 1), h = _t(p), m = Tt(p);
o.value.filters.months.includes(h) && (p = a(p, f), h = _t(p), m = Tt(p)), o.value.filters.years.includes(m) && (p = s(p, f), m = Tt(p)), n(h, m, f, t.preventMinMaxNavigation) && l(h, m);
}, l = (f, d) => {
e("update-month-year", { month: f, year: d });
}, c = L(() => (f) => {
if (!t.preventMinMaxNavigation || f && !t.maxDate || !f && !t.minDate)
return !1;
const d = bn(/* @__PURE__ */ new Date(), { month: t.month, year: t.year }), p = f ? Ir(d, 1) : va(d, 1), h = [_t(p), Tt(p)];
return f ? !r(...h) : !i(...h);
});
return { handleMonthYearChange: u, isDisabled: c, updateMonthYear: l };
};
var pl = /* @__PURE__ */ ((t) => (t.center = "center", t.left = "left", t.right = "right", t))(pl || {});
const kA = (t, e, n, r) => {
const i = re({
top: "0",
left: "0",
transform: "none"
}), o = re(!1), a = So(r, "teleportCenter");
Ct(a, () => {
v();
});
const s = (S) => {
const _ = S.getBoundingClientRect();
return {
left: _.left + window.scrollX,
top: _.top + window.scrollY
};
}, u = (S) => {
const _ = S.getBoundingClientRect();
let N = 0, R = 0;
for (; S && !isNaN(S.offsetLeft) && !isNaN(S.offsetTop); )
N += S.offsetLeft - S.scrollLeft, R = _.top + S.scrollTop, S = S.offsetParent;
return { top: R, left: N };
}, l = (S, _) => {
i.value.left = `${S + _}px`, i.value.transform = "translateX(-100%)";
}, c = (S) => {
i.value.left = `${S}px`, i.value.transform = "translateX(0)";
}, f = (S, _, N = !1) => {
r.position === pl.left && c(S), r.position === pl.right && l(S, _), r.position === pl.center && (i.value.left = `${S + _ / 2}px`, i.value.transform = N ? "translate(-50%, -50%)" : "translateX(-50%)");
}, d = (S) => {
const { width: _, height: N } = S.getBoundingClientRect(), { top: R, left: w } = r.altPosition ? u(S) : s(S);
return { top: R, left: w, width: _, height: N };
}, p = () => {
const S = Ft(e);
if (S) {
const { top: _, left: N, width: R, height: w } = d(S);
i.value.top = `${_ + w / 2}px`, i.value.transform = "translateY(-50%)", f(N, R, !0);
}
}, h = () => {
i.value.left = "50%", i.value.top = "50%", i.value.transform = "translate(-50%, -50%)", i.value.position = "fixed";
}, m = () => {
const S = Ft(e);
i.value = r.altPosition(S);
}, v = (S = !0) => {
if (!r.inline)
return a.value ? h() : r.altPosition && typeof r.altPosition != "boolean" ? m() : (S && n("recalculate-position"), x());
}, y = ({
inputEl: S,
menuEl: _,
left: N,
width: R
}) => {
window.screen.width > 768 && f(N, R), b(S, _);
}, k = (S, _) => {
const { top: N, left: R, height: w, width: A } = d(S);
i.value.top = `${w + N + +r.offset}px`, y({ inputEl: S, menuEl: _, left: R, width: A }), o.value = !1;
}, T = (S, _) => {
const { top: N, left: R, width: w } = d(S), { height: A } = _.getBoundingClientRect();
i.value.top = `${N - A - +r.offset}px`, y({ inputEl: S, menuEl: _, left: R, width: w }), o.value = !0;
}, b = (S, _) => {
if (r.autoPosition) {
const { left: N, width: R } = d(S), { left: w, right: A } = _.getBoundingClientRect();
if (w < 0)
return c(N);
if (A > document.documentElement.clientWidth)
return l(N, R);
}
}, D = (S, _) => {
const { height: N } = _.getBoundingClientRect(), { top: R, height: w } = S.getBoundingClientRect(), A = window.innerHeight - R - w, $ = R;
return N <= A ? k(S, _) : N > A && N <= $ ? T(S, _) : A >= $ ? k(S, _) : T(S, _);
}, x = () => {
const S = Ft(e), _ = Ft(t);
if (S && _)
return r.autoPosition ? D(S, _) : k(S, _);
};
return { openOnTop: o, menuPosition: i, setMenuPosition: v, setInitialPosition: p };
}, Qo = [
{ name: "clock-icon", use: ["time", "calendar"] },
{ name: "arrow-left", use: ["month-year", "calendar"] },
{ name: "arrow-right", use: ["month-year", "calendar"] },
{ name: "arrow-up", use: ["time", "calendar"] },
{ name: "arrow-down", use: ["time", "calendar"] },
{ name: "calendar-icon", use: ["month-year", "time", "calendar"] },
{ name: "day", use: ["calendar"] },
{ name: "month-overlay-value", use: ["calendar", "month-year"] },
{ name: "year-overlay-value", use: ["calendar", "month-year"] },
{ name: "year-overlay", use: ["month-year"] },
{ name: "month-overlay", use: ["month-year"] },
{ name: "month-overlay-header", use: ["month-year"] },
{ name: "year-overlay-header", use: ["month-year"] },
{ name: "hours-overlay-value", use: ["calendar", "time"] },
{ name: "minutes-overlay-value", use: ["calendar", "time"] },
{ name: "seconds-overlay-value", use: ["calendar", "time"] },
{ name: "hours", use: ["calendar", "time"] },
{ name: "minutes", use: ["calendar", "time"] },
{ name: "month", use: ["calendar", "month-year"] },
{ name: "year", use: ["calendar", "month-year"] },
{ name: "action-select", use: ["action"] },
{ name: "action-preview", use: ["action"] },
{ name: "calendar-header", use: ["calendar"] },
{ name: "marker-tooltip", use: ["calendar"] },
{ name: "now-button", use: [] },
{ name: "time-picker-overlay", use: ["calendar", "time"] },
{ name: "am-pm-button", use: ["calendar", "time"] },
{ name: "left-sidebar", use: ["menu"] },
{ name: "right-sidebar", use: ["menu"] },
{ name: "month-year", use: ["month-year"] },
{ name: "time-picker", use: ["menu"] },
{ name: "action-row", use: ["action"] }
], xA = [{ name: "trigger" }, { name: "input-icon" }, { name: "clear-icon" }, { name: "dp-input" }], SA = {
all: () => Qo,
monthYear: () => Qo.filter((t) => t.use.includes("month-year")),
input: () => xA,
timePicker: () => Qo.filter((t) => t.use.includes("time")),
action: () => Qo.filter((t) => t.use.includes("action")),
calendar: () => Qo.filter((t) => t.use.includes("calendar")),
menu: () => Qo.filter((t) => t.use.includes("menu"))
}, yo = (t, e, n) => {
const r = [];
return SA[e]().forEach((i) => {
t[i.name] && r.push(i.name);
}), n && n.length && n.forEach((i) => {
i.slot && r.push(i.slot);
}), r;
}, Kc = (t) => ({ transitionName: L(() => (e) => t && typeof t != "boolean" ? e ? t.open : t.close : ""), showTransition: !!t }), Gi = {
multiCalendars: { type: [Boolean, Number, String], default: null },
modelValue: { type: [String, Date, Array, Object, Number], default: null },
modelType: { type: String, default: null },
position: { type: String, default: "center" },
dark: { type: Boolean, default: !1 },
format: {
type: [String, Function],
default: () => null
},
closeOnScroll: { type: Boolean, default: !1 },
autoPosition: { type: Boolean, default: !0 },
closeOnAutoApply: { type: Boolean, default: !0 },
teleport: { type: [String, Object], default: "body" },
altPosition: { type: [Boolean, Function], default: !1 },
transitions: { type: [Boolean, Object], default: !0 },
formatLocale: { type: Object, default: null },
utc: { type: [Boolean, String], default: !1 },
ariaLabels: { type: Object, default: () => ({}) },
offset: { type: [Number, String], default: 10 },
hideNavigation: { type: Array, default: () => [] },
timezone: { type: String, default: null },
vertical: { type: Boolean, default: !1 },
disableMonthYearSelect: { type: Boolean, default: !1 },
menuClassName: { type: String, default: null },
dayClass: { type: Function, default: null },
yearRange: { type: Array, default: () => [1900, 2100] },
multiCalendarsSolo: { type: Boolean, default: !1 },
calendarCellClassName: { type: String, default: null },
enableTimePicker: { type: Boolean, default: !0 },
autoApply: { type: Boolean, default: !1 },
disabledDates: { type: [Array, Function], default: () => [] },
monthNameFormat: { type: String, default: "short" },
startDate: { type: [Date, String], default: null },
startTime: { type: [Object, Array], default: null },
monthYearComponent: { type: Object, default: null },
timePickerComponent: { type: Object, default: null },
actionRowComponent: { type: Object, default: null },
hideOffsetDates: { type: Boolean, default: !1 },
autoRange: { type: [Number, String], default: null },
noToday: { type: Boolean, default: !1 },
disabledWeekDays: { type: Array, default: () => [] },
allowedDates: { type: Array, default: () => [] },
showNowButton: { type: Boolean, default: !1 },
nowButtonLabel: { type: String, default: "Now" },
markers: { type: Array, default: () => [] },
modeHeight: { type: [Number, String], default: 255 },
escClose: { type: Boolean, default: !0 },
spaceConfirm: { type: Boolean, default: !0 },
monthChangeOnArrows: { type: Boolean, default: !0 },
presetRanges: { type: Array, default: () => [] },
flow: { type: Array, default: () => [] },
preventMinMaxNavigation: { type: Boolean, default: !1 },
minRange: { type: [Number, String], default: null },
maxRange: { type: [Number, String], default: null },
multiDatesLimit: { type: [Number, String], default: null },
reverseYears: { type: Boolean, default: !1 },
keepActionRow: { type: Boolean, default: !1 },
weekPicker: { type: Boolean, default: !1 },
filters: { type: Object, default: () => ({}) },
arrowNavigation: { type: Boolean, default: !1 },
multiStatic: { type: Boolean, default: !0 },
disableTimeRangeValidation: { type: Boolean, default: !1 },
highlight: {
type: [Array, Function],
default: null
},
highlightWeekDays: {
type: Array,
default: null
},
highlightDisabledDays: { type: Boolean, default: !1 },
teleportCenter: { type: Boolean, default: !1 },
locale: { type: String, default: "en-Us" },
weekNumName: { type: String, default: "W" },
weekStart: { type: [Number, String], default: 1 },
weekNumbers: { type: Boolean, default: !1 },
calendarClassName: { type: String, default: null },
noSwipe: { type: Boolean, default: !1 },
monthChangeOnScroll: { type: [Boolean, String], default: !0 },
dayNames: {
type: [Function, Array],
default: null
},
monthPicker: { type: Boolean, default: !1 },
customProps: { type: Object, default: null },
yearPicker: { type: Boolean, default: !1 },
modelAuto: { type: Boolean, default: !1 },
selectText: { type: String, default: "Select" },
cancelText: { type: String, default: "Cancel" },
previewFormat: {
type: [String, Function],
default: () => ""
},
multiDates: { type: Boolean, default: !1 },
partialRange: { type: Boolean, default: !0 },
ignoreTimeValidation: { type: Boolean, default: !1 },
minDate: { type: [Date, String], default: null },
maxDate: { type: [Date, String], default: null },
minTime: { type: Object, default: null },
maxTime: { type: Object, default: null },
name: { type: String, default: null },
placeholder: { type: String, default: "" },
hideInputIcon: { type: Boolean, default: !1 },
clearable: { type: Boolean, default: !0 },
state: { type: Boolean, default: null },
required: { type: Boolean, default: !1 },
autocomplete: { type: String, default: "off" },
inputClassName: { type: String, default: null },
inlineWithInput: { type: Boolean, default: !1 },
textInputOptions: { type: Object, default: () => null },
fixedStart: { type: Boolean, default: !1 },
fixedEnd: { type: Boolean, default: !1 },
timePicker: { type: Boolean, default: !1 },
enableSeconds: { type: Boolean, default: !1 },
is24: { type: Boolean, default: !0 },
noHoursOverlay: { type: Boolean, default: !1 },
noMinutesOverlay: { type: Boolean, default: !1 },
noSecondsOverlay: { type: Boolean, default: !1 },
hoursGridIncrement: { type: [String, Number], default: 1 },
minutesGridIncrement: { type: [String, Number], default: 5 },
secondsGridIncrement: { type: [String, Number], default: 5 },
hoursIncrement: { type: [Number, String], default: 1 },
minutesIncrement: { type: [Number, String], default: 1 },
secondsIncrement: { type: [Number, String], default: 1 },
range: { type: Boolean, default: !1 },
uid: { type: String, default: null },
disabled: { type: Boolean, default: !1 },
readonly: { type: Boolean, default: !1 },
inline: { type: Boolean, default: !1 },
textInput: { type: Boolean, default: !1 },
onClickOutside: { type: Function, default: null },
noDisabledRange: { type: Boolean, default: !1 },
sixWeeks: { type: Boolean, default: !1 }
}, EA = ["aria-label", "aria-disabled", "aria-readonly"], _A = {
key: 1,
class: "dp__input_wrap"
}, TA = ["id", "name", "inputmode", "placeholder", "disabled", "readonly", "required", "value", "autocomplete", "onKeydown"], CA = {
key: 2,
class: "dp__input_icon"
}, OA = {
key: 4,
class: "dp__clear_icon"
}, AA = /* @__PURE__ */ be({
__name: "DatepickerInput",
props: {
isMenuOpen: { type: Boolean, default: !1 },
inputValue: { type: String, default: "" },
...Gi
},
emits: [
"clear",
"open",
"update:input-value",
"set-input-date",
"close",
"select-date",
"set-empty-date",
"toggle",
"focus-prev",
"focus",
"blur"
],
setup(t, { expose: e, emit: n }) {
const r = t, { getDefaultPattern: i, isValidDate: o, defaults: a } = Zn(r), s = re(), u = re(null), l = re(!1), c = L(
() => ({
dp__pointer: !r.disabled && !r.readonly && !r.textInput,
dp__disabled: r.disabled,
dp__input_readonly: !r.textInput,
dp__input: !0,
dp__input_icon_pad: !r.hideInputIcon,
dp__input_valid: r.state,
dp__input_invalid: r.state === !1,
dp__input_focus: l.value || r.isMenuOpen,
dp__input_reg: !r.textInput,
[r.inputClassName]: !!r.inputClassName
})
), f = () => {
n("set-input-date", null), r.autoApply && (n("set-empty-date"), s.value = null);
}, d = (S) => {
var _;
return $O(S, ((_ = a.value.textInputOptions) == null ? void 0 : _.format) || i());
}, p = (S) => {
const { rangeSeparator: _ } = a.value.textInputOptions, [N, R] = S.split(`${_}`);
if (N) {
const w = d(N.trim()), A = R ? d(R.trim()) : null, $ = w && A ? [w, A] : [w];
s.value = w ? $ : null;
}
}, h = (S) => {
if (r.range)
p(S);
else if (r.multiDates) {
const _ = S.split(";");
s.value = _.map((N) => d(N.trim())).filter((N) => N);
} else
s.value = d(S);
}, m = (S) => {
var _;
const { value: N } = S.target;
N !== "" ? ((_ = a.value.textInputOptions) != null && _.openMenu && !r.isMenuOpen && n("open"), h(N), n("set-input-date", s.value)) : f(), n("update:input-value", N);
}, v = () => {
var S, _;
(S = a.value.textInputOptions) != null && S.enterSubmit && o(s.value) && r.inputValue !== "" ? (n("set-input-date", s.value, !0), s.value = null) : (_ = a.value.textInputOptions) != null && _.enterSubmit && r.inputValue === "" && (s.value = null, n("clear"));
}, y = () => {
var S, _;
(S = a.value.textInputOptions) != null && S.tabSubmit && o(s.value) && r.inputValue !== "" ? (n("set-input-date", s.value, !0), s.value = null) : (_ = a.value.textInputOptions) != null && _.tabSubmit && r.inputValue === "" && (s.value = null, n("clear"));
}, k = () => {
l.value = !0, n("focus");
}, T = (S) => {
var _;
S.preventDefault(), S.stopImmediatePropagation(), S.stopPropagation(), r.textInput && (_ = a.value.textInputOptions) != null && _.openMenu && !r.inlineWithInput ? r.isMenuOpen ? a.value.textInputOptions.enterSubmit && n("select-date") : n("open") : r.textInput || n("toggle");
}, b = () => {
l.value = !1, r.isMenuOpen || n("blur"), r.autoApply && r.textInput && s.value && (n("set-input-date", s.value), n("select-date"), s.value = null);
}, D = () => {
n("clear");
}, x = (S) => {
r.textInput || S.preventDefault();
};
return e({
focusInput: () => {
u.value && u.value.focus({ preventScroll: !0 });
}
}), (S, _) => {
var N;
return C(), P("div", {
onClick: T,
"aria-label": (N = W(a).ariaLabels) == null ? void 0 : N.input,
role: "textbox",
"aria-multiline": "false",
"aria-disabled": S.disabled,
"aria-readonly": S.readonly
}, [
S.$slots.trigger && !S.$slots["dp-input"] && !S.inline ? X(S.$slots, "trigger", { key: 0 }) : F("", !0),
!S.$slots.trigger && (!S.inline || S.inlineWithInput) ? (C(), P("div", _A, [
S.$slots["dp-input"] && !S.$slots.trigger && !S.inline ? X(S.$slots, "dp-input", {
key: 0,
value: t.inputValue,
onInput: m,
onEnter: v,
onTab: y,
onClear: D
}) : F("", !0),
S.$slots["dp-input"] ? F("", !0) : (C(), P("input", {
key: 1,
ref_key: "inputRef",
ref: u,
id: S.uid ? `dp-input-${S.uid}` : void 0,
name: S.name,
class: se(W(c)),
inputmode: S.textInput ? "text" : "none",
placeholder: S.placeholder,
disabled: S.disabled,
readonly: S.readonly,
required: S.required,
value: t.inputValue,
autocomplete: S.autocomplete,
onInput: m,
onKeydown: [
He(T, ["enter"]),
He(y, ["tab"])
],
onBlur: b,
onFocus: k,
onKeypress: x
}, null, 42, TA)),
S.$slots["input-icon"] && !S.hideInputIcon ? (C(), P("span", CA, [
X(S.$slots, "input-icon")
])) : F("", !0),
!S.$slots["input-icon"] && !S.hideInputIcon && !S.$slots["dp-input"] ? (C(), oe(W(Yc), {
key: 3,
class: "dp__input_icon dp__input_icons"
})) : F("", !0),
S.$slots["clear-icon"] && t.inputValue && S.clearable && !S.disabled && !S.readonly ? (C(), P("span", OA, [
X(S.$slots, "clear-icon", { clear: D })
])) : F("", !0),
S.clearable && !S.$slots["clear-icon"] && t.inputValue && !S.disabled && !S.readonly ? (C(), oe(W(oO), {
key: 5,
class: "dp__clear_icon dp__input_icons",
"data-test": "clear-icon",
onClick: et(D, ["stop", "prevent"])
}, null, 8, ["onClick"])) : F("", !0)
])) : F("", !0)
], 8, EA);
};
}
}), MA = { class: "dp__selection_preview" }, DA = { class: "dp__action_buttons" }, $A = ["onKeydown"], NA = /* @__PURE__ */ be({
__name: "ActionRow",
props: {
calendarWidth: { type: Number, default: 0 },
menuMount: { type: Boolean, default: !1 },
internalModelValue: { type: [Date, Array], default: null },
...Gi
},
emits: ["close-picker", "select-date", "invalid-select"],
setup(t, { emit: e }) {
const n = t, { formatDate: r, isValidTime: i, defaults: o } = Zn(n), { buildMatrix: a } = Ki(), s = re(null), u = re(null);
st(() => {
n.arrowNavigation && a([Ft(s), Ft(u)], "actionRow");
});
const l = L(() => n.range && !n.partialRange && n.internalModelValue ? n.internalModelValue.length === 2 : !0), c = L(() => !d.value || !p.value || !l.value), f = L(() => ({
dp__action: !0,
dp__select: !0,
dp__action_disabled: c.value
})), d = L(() => !n.enableTimePicker || n.ignoreTimeValidation ? !0 : i(n.internalModelValue)), p = L(() => n.monthPicker ? y(n.internalModelValue) : !0), h = () => {
const T = o.value.previewFormat;
return n.timePicker || n.monthPicker, T(ln(n.internalModelValue));
}, m = () => {
const T = n.internalModelValue;
return o.value.multiCalendars > 0 ? `${r(T[0])} - ${r(T[1])}` : [r(T[0]), r(T[1])];
}, v = L(() => !n.internalModelValue || !n.menuMount ? "" : typeof o.value.previewFormat == "string" ? Array.isArray(n.internalModelValue) ? n.internalModelValue.length === 2 && n.internalModelValue[1] ? m() : n.multiDates ? n.internalModelValue.map((T) => `${r(T)}`) : n.modelAuto ? `${r(n.internalModelValue[0])}` : `${r(n.internalModelValue[0])} -` : r(n.internalModelValue) : h()), y = (T) => {
if (!n.monthPicker)
return !0;
let b = !0;
return n.minDate && n.maxDate ? En(pe(T), pe(n.minDate)) && fn(pe(T), pe(n.maxDate)) : (n.minDate && (b = En(pe(T), pe(n.minDate))), n.maxDate && (b = fn(pe(T), pe(n.maxDate))), b);
}, k = () => {
d.value && p.value && l.value ? e("select-date") : e("invalid-select");
};
return (T, b) => (C(), P("div", {
class: "dp__action_row",
style: Xe(t.calendarWidth ? { width: `${t.calendarWidth}px` } : {})
}, [
T.$slots["action-row"] ? X(T.$slots, "action-row", At(dt({ key: 0 }, {
internalModelValue: t.internalModelValue,
disabled: W(c),
selectDate: () => T.$emit("select-date"),
closePicker: () => T.$emit("close-picker")
}))) : (C(), P(Ee, { key: 1 }, [
U("div", MA, [
T.$slots["action-preview"] ? X(T.$slots, "action-preview", {
key: 0,
value: t.internalModelValue
}) : F("", !0),
T.$slots["action-preview"] ? F("", !0) : (C(), P(Ee, { key: 1 }, [
Array.isArray(W(v)) ? F("", !0) : (C(), P(Ee, { key: 0 }, [
Oe(Se(W(v)), 1)
], 64)),
Array.isArray(W(v)) ? (C(!0), P(Ee, { key: 1 }, nt(W(v), (D, x) => (C(), P("div", { key: x }, Se(D), 1))), 128)) : F("", !0)
], 64))
]),
U("div", DA, [
T.$slots["action-select"] ? X(T.$slots, "action-select", {
key: 0,
value: t.internalModelValue
}) : F("", !0),
T.$slots["action-select"] ? F("", !0) : (C(), P(Ee, { key: 1 }, [
T.inline ? F("", !0) : (C(), P("span", {
key: 0,
class: "dp__action dp__cancel",
ref_key: "cancelButtonRef",
ref: s,
tabindex: "0",
onClick: b[0] || (b[0] = (D) => T.$emit("close-picker")),
onKeydown: [
b[1] || (b[1] = He((D) => T.$emit("close-picker"), ["enter"])),
b[2] || (b[2] = He((D) => T.$emit("close-picker"), ["space"]))
]
}, Se(T.cancelText), 545)),
U("span", {
class: se(W(f)),
tabindex: "0",
onKeydown: [
He(k, ["enter"]),
He(k, ["space"])
],
onClick: k,
"data-test": "select-button",
ref_key: "selectButtonRef",
ref: u
}, Se(T.selectText), 43, $A)
], 64))
])
], 64))
], 4));
}
}), PA = ["aria-label"], IA = {
class: "dp__calendar_header",
role: "row"
}, LA = {
key: 0,
class: "dp__calendar_header_item",
role: "gridcell"
}, RA = /* @__PURE__ */ U("div", { class: "dp__calendar_header_separator" }, null, -1), BA = ["aria-label"], VA = {
key: 0,
role: "gridcell",
class: "dp__calendar_item dp__week_num"
}, zA = { class: "dp__cell_inner" }, HA = ["aria-selected", "aria-disabled", "aria-label", "data-test", "onClick", "onKeydown", "onMouseenter", "onMouseleave"], qA = /* @__PURE__ */ U("div", { class: "dp__arrow_bottom_tp" }, null, -1), FA = /* @__PURE__ */ be({
__name: "Calendar",
props: {
mappedDates: { type: Array, default: () => [] },
getWeekNum: {
type: Function,
default: () => ""
},
specificMode: { type: Boolean, default: !1 },
instance: { type: Number, default: 0 },
month: { type: Number, default: 0 },
year: { type: Number, default: 0 },
...Gi
},
emits: [
"select-date",
"set-hover-date",
"handle-scroll",
"mount",
"handle-swipe",
"handle-space",
"tooltip-open",
"tooltip-close"
],
setup(t, { expose: e, emit: n }) {
const r = t, { buildMultiLevelMatrix: i } = Ki(), { setDateMonthOrYear: o, defaults: a } = Zn(r), s = re(null), u = re({ bottom: "", left: "", transform: "" }), l = re([]), c = re(null), f = re(!0), d = re(""), p = re({ startX: 0, endX: 0, startY: 0, endY: 0 }), h = L(() => r.dayNames ? Array.isArray(r.dayNames) ? r.dayNames : r.dayNames(r.locale, +r.weekStart) : sA(r.locale, +r.weekStart));
st(() => {
n("mount", { cmp: "calendar", refs: l }), r.noSwipe || c.value && (c.value.addEventListener("touchstart", N, { passive: !1 }), c.value.addEventListener("touchend", R, { passive: !1 }), c.value.addEventListener("touchmove", w, { passive: !1 })), r.monthChangeOnScroll && c.value && c.value.addEventListener("wheel", I, { passive: !1 });
});
const m = (E) => E ? r.vertical ? "vNext" : "next" : r.vertical ? "vPrevious" : "previous", v = (E, O) => {
if (r.transitions) {
const g = Kr(o(pe(), r.month, r.year));
d.value = En(Kr(o(pe(), E, O)), g) ? a.value.transitions[m(!0)] : a.value.transitions[m(!1)], f.value = !1, Vn(() => {
f.value = !0;
});
}
}, y = L(
() => ({
dp__calendar_wrap: !0,
[r.calendarClassName]: !!r.calendarClassName
})
), k = L(() => (E) => {
const O = dA(E);
return {
dp__marker_dot: O.type === "dot",
dp__marker_line: O.type === "line"
};
}), T = L(() => (E) => Ot(E, s.value)), b = L(() => ({
dp__calendar: !0,
dp__calendar_next: a.value.multiCalendars > 0 && r.instance !== 0
})), D = L(() => (E) => r.hideOffsetDates ? E.current : !0), x = L(() => r.specificMode ? { height: `${r.modeHeight}px` } : void 0), S = (E, O, g) => {
var M, H;
if (n("set-hover-date", E), (H = (M = E.marker) == null ? void 0 : M.tooltip) != null && H.length) {
const z = Ft(l.value[O][g]);
if (z) {
const { width: Y, height: ee } = z.getBoundingClientRect();
u.value = {
bottom: `${ee}px`,
left: `${Y / 2}px`,
transform: "translateX(-50%)"
}, s.value = E.value, n("tooltip-open", E.value);
}
}
}, _ = (E) => {
s.value && (s.value = null, n("tooltip-close", E.value));
}, N = (E) => {
p.value.startX = E.changedTouches[0].screenX, p.value.startY = E.changedTouches[0].screenY;
}, R = (E) => {
p.value.endX = E.changedTouches[0].screenX, p.value.endY = E.changedTouches[0].screenY, A();
}, w = (E) => {
r.vertical && !r.inline && E.preventDefault();
}, A = () => {
const E = r.vertical ? "Y" : "X";
Math.abs(p.value[`start${E}`] - p.value[`end${E}`]) > 10 && n("handle-swipe", p.value[`start${E}`] > p.value[`end${E}`] ? "right" : "left");
}, $ = (E, O, g) => {
E && (Array.isArray(l.value[O]) ? l.value[O][g] = E : l.value[O] = [E]), r.arrowNavigation && i(l.value, "calendar");
}, I = (E) => {
r.monthChangeOnScroll && (E.preventDefault(), n("handle-scroll", E));
};
return e({ triggerTransition: v }), (E, O) => {
var g;
return C(), P("div", {
class: se(W(b))
}, [
U("div", {
style: Xe(W(x))
}, [
t.specificMode ? F("", !0) : (C(), P("div", {
key: 0,
ref_key: "calendarWrapRef",
ref: c,
class: se(W(y)),
role: "grid",
"aria-label": (g = W(a).ariaLabels) == null ? void 0 : g.calendarWrap
}, [
U("div", IA, [
E.weekNumbers ? (C(), P("div", LA, Se(E.weekNumName), 1)) : F("", !0),
(C(!0), P(Ee, null, nt(W(h), (M, H) => (C(), P("div", {
class: "dp__calendar_header_item",
role: "gridcell",
key: H,
"data-test": "calendar-header"
}, [
E.$slots["calendar-header"] ? X(E.$slots, "calendar-header", {
key: 0,
day: M,
index: H
}) : F("", !0),
E.$slots["calendar-header"] ? F("", !0) : (C(), P(Ee, { key: 1 }, [
Oe(Se(M), 1)
], 64))
]))), 128))
]),
RA,
J(zn, {
name: d.value,
css: !!E.transitions
}, {
default: ne(() => {
var M;
return [
f.value ? (C(), P("div", {
key: 0,
class: "dp__calendar",
role: "grid",
"aria-label": (M = W(a).ariaLabels) == null ? void 0 : M.calendarDays
}, [
(C(!0), P(Ee, null, nt(t.mappedDates, (H, z) => (C(), P("div", {
class: "dp__calendar_row",
role: "row",
key: z
}, [
E.weekNumbers ? (C(), P("div", VA, [
U("div", zA, Se(t.getWeekNum(H.days)), 1)
])) : F("", !0),
(C(!0), P(Ee, null, nt(H.days, (Y, ee) => {
var ce, q, V;
return C(), P("div", {
role: "gridcell",
class: "dp__calendar_item",
ref_for: !0,
ref: (te) => $(te, z, ee),
key: ee + z,
"aria-selected": Y.classData.dp__active_date || Y.classData.dp__range_start || Y.classData.dp__range_start,
"aria-disabled": Y.classData.dp__cell_disabled,
"aria-label": (q = (ce = W(a).ariaLabels) == null ? void 0 : ce.day) == null ? void 0 : q.call(ce, Y),
tabindex: "0",
"data-test": Y.value,
onClick: et((te) => E.$emit("select-date", Y), ["stop", "prevent"]),
onKeydown: [
He((te) => E.$emit("select-date", Y), ["enter"]),
He((te) => E.$emit("handle-space", Y), ["space"])
],
onMouseenter: (te) => S(Y, z, ee),
onMouseleave: (te) => _(Y)
}, [
U("div", {
class: se(["dp__cell_inner", Y.classData])
}, [
E.$slots.day && W(D)(Y) ? X(E.$slots, "day", {
key: 0,
day: +Y.text,
date: Y.value
}) : F("", !0),
E.$slots.day ? F("", !0) : (C(), P(Ee, { key: 1 }, [
Oe(Se(Y.text), 1)
], 64)),
Y.marker && W(D)(Y) ? (C(), P("div", {
key: 2,
class: se(W(k)(Y.marker)),
style: Xe(Y.marker.color ? { backgroundColor: Y.marker.color } : {})
}, null, 6)) : F("", !0),
W(T)(Y.value) ? (C(), P("div", {
key: 3,
class: "dp__marker_tooltip",
style: Xe(u.value)
}, [
(V = Y.marker) != null && V.tooltip ? (C(), P("div", {
key: 0,
class: "dp__tooltip_content",
onClick: O[0] || (O[0] = et(() => {
}, ["stop"]))
}, [
(C(!0), P(Ee, null, nt(Y.marker.tooltip, (te, K) => (C(), P("div", {
key: K,
class: "dp__tooltip_text"
}, [
E.$slots["marker-tooltip"] ? X(E.$slots, "marker-tooltip", {
key: 0,
tooltip: te,
day: Y.value
}) : F("", !0),
E.$slots["marker-tooltip"] ? F("", !0) : (C(), P(Ee, { key: 1 }, [
U("div", {
class: "dp__tooltip_mark",
style: Xe(te.color ? { backgroundColor: te.color } : {})
}, null, 4),
U("div", null, Se(te.text), 1)
], 64))
]))), 128)),
qA
])) : F("", !0)
], 4)) : F("", !0)
], 2)
], 40, HA);
}), 128))
]))), 128))
], 8, BA)) : F("", !0)
];
}),
_: 3
}, 8, ["name", "css"])
], 10, PA))
], 4)
], 2);
};
}
}), jA = ["aria-label", "aria-disabled"], Gd = /* @__PURE__ */ be({
__name: "ActionIcon",
props: {
ariaLabel: { type: String, default: "" },
disabled: { type: Boolean, default: !1 }
},
emits: ["activate", "set-ref"],
setup(t, { emit: e }) {
const n = re(null);
return st(() => e("set-ref", n)), (r, i) => (C(), P("div", {
class: "dp__month_year_col_nav",
onClick: i[0] || (i[0] = (o) => r.$emit("activate")),
onKeydown: [
i[1] || (i[1] = He((o) => r.$emit("activate"), ["enter"])),
i[2] || (i[2] = He((o) => r.$emit("activate"), ["space"]))
],
tabindex: "0",
role: "button",
"aria-label": t.ariaLabel,
"aria-disabled": t.disabled,
ref_key: "elRef",
ref: n
}, [
U("div", {
class: se(["dp__inner_nav", { dp__inner_nav_disabled: t.disabled }])
}, [
X(r.$slots, "default")
], 2)
], 40, jA));
}
}), UA = ["onKeydown"], WA = { class: "dp__selection_grid_header" }, YA = ["aria-selected", "aria-disabled", "data-test", "onClick", "onKeydown", "onMouseover"], KA = ["aria-label", "onKeydown"], Os = /* @__PURE__ */ be({
__name: "SelectionGrid",
props: {
items: { type: Array, default: () => [] },
modelValue: { type: [String, Number], default: null },
multiModelValue: { type: Array, default: () => [] },
disabledValues: { type: Array, default: () => [] },
minValue: { type: [Number, String], default: null },
maxValue: { type: [Number, String], default: null },
year: { type: Number, default: 0 },
skipActive: { type: Boolean, default: !1 },
headerRefs: { type: Array, default: () => [] },
skipButtonRef: { type: Boolean, default: !1 },
monthPicker: { type: Boolean, default: !1 },
yearPicker: { type: Boolean, default: !1 },
escClose: { type: Boolean, default: !0 },
type: { type: String, default: null },
arrowNavigation: { type: Boolean, default: !1 },
autoApply: { type: Boolean, default: !1 },
textInput: { type: Boolean, default: !1 },
ariaLabels: { type: Object, default: () => ({}) },
hideNavigation: { type: Array, default: () => [] }
},
emits: ["update:model-value", "selected", "toggle", "reset-flow"],
setup(t, { expose: e, emit: n }) {
const r = t, { setSelectionGrid: i, buildMultiLevelMatrix: o, setMonthPicker: a } = Ki(), { hideNavigationButtons: s } = Zn(r), u = re(!1), l = re(null), c = re(null), f = re([]), d = re(), p = re(null), h = re(0), m = re(null);
A6(() => {
l.value = null;
}), st(() => {
Vn().then(() => N()), y(), v(!0);
}), jo(() => v(!1));
const v = (O) => {
var g;
r.arrowNavigation && ((g = r.headerRefs) != null && g.length ? a(O) : i(O));
}, y = () => {
const O = Ft(c);
O && (r.textInput || O.focus({ preventScroll: !0 }), u.value = O.clientHeight < O.scrollHeight);
}, k = L(
() => ({
dp__overlay: !0
})
), T = L(() => ({
dp__overlay_col: !0
})), b = (O) => r.skipActive ? !1 : O.value === r.modelValue, D = L(() => r.items.map((O) => O.filter((g) => g).map((g) => {
var M, H, z;
const Y = r.disabledValues.some((ce) => ce === g.value) || _(g.value), ee = (M = r.multiModelValue) != null && M.length ? (H = r.multiModelValue) == null ? void 0 : H.some(
(ce) => Ot(
ce,
Ao(
r.monthPicker ? Cs(/* @__PURE__ */ new Date(), g.value) : /* @__PURE__ */ new Date(),
r.monthPicker ? r.year : g.value
)
)
) : b(g);
return {
...g,
className: {
dp__overlay_cell_active: ee,
dp__overlay_cell: !ee,
dp__overlay_cell_disabled: Y,
dp__overlay_cell_active_disabled: Y && ee,
dp__overlay_cell_pad: !0,
dp__cell_in_between: (z = r.multiModelValue) != null && z.length ? w(g.value) : !1
}
};
}))), x = L(
() => ({
dp__button: !0,
dp__overlay_action: !0,
dp__over_action_scroll: u.value,
dp__button_bottom: r.autoApply
})
), S = L(() => {
var O, g;
return {
dp__overlay_container: !0,
dp__container_flex: ((O = r.items) == null ? void 0 : O.length) <= 6,
dp__container_block: ((g = r.items) == null ? void 0 : g.length) > 6
};
}), _ = (O) => {
const g = r.maxValue || r.maxValue === 0, M = r.minValue || r.minValue === 0;
return !g && !M ? !1 : g && M ? +O > +r.maxValue || +O < +r.minValue : g ? +O > +r.maxValue : M ? +O < +r.minValue : !1;
}, N = () => {
const O = Ft(l), g = Ft(c), M = Ft(p), H = Ft(m), z = M ? M.getBoundingClientRect().height : 0;
g && (h.value = g.getBoundingClientRect().height - z), O && H && (H.scrollTop = O.offsetTop - H.offsetTop - (h.value / 2 - O.getBoundingClientRect().height) - z);
}, R = (O) => {
!r.disabledValues.some((g) => g === O) && !_(O) && (n("update:model-value", O), n("selected"));
}, w = (O) => {
const g = r.monthPicker ? r.year : O;
return l2(
r.multiModelValue,
Ao(
r.monthPicker ? Cs(/* @__PURE__ */ new Date(), d.value || 0) : /* @__PURE__ */ new Date(),
r.monthPicker ? g : d.value || g
),
Ao(r.monthPicker ? Cs(/* @__PURE__ */ new Date(), O) : /* @__PURE__ */ new Date(), g)
);
}, A = () => {
n("toggle"), n("reset-flow");
}, $ = () => {
r.escClose && A();
}, I = (O, g, M, H) => {
O && (g.value === +r.modelValue && !r.disabledValues.includes(g.value) && (l.value = O), r.arrowNavigation && (Array.isArray(f.value[M]) ? f.value[M][H] = O : f.value[M] = [O], E()));
}, E = () => {
var O, g;
const M = (O = r.headerRefs) != null && O.length ? [r.headerRefs].concat(f.value) : f.value.concat([r.skipButtonRef ? [] : [p.value]]);
o(ln(M), (g = r.headerRefs) != null && g.length ? "monthPicker" : "selectionGrid");
};
return e({ focusGrid: y }), (O, g) => {
var M;
return C(), P("div", {
ref_key: "gridWrapRef",
ref: c,
class: se(W(k)),
role: "dialog",
tabindex: "0",
onKeydown: He($, ["esc"])
}, [
U("div", {
class: se(W(S)),
ref_key: "containerRef",
ref: m,
role: "grid",
style: Xe({ height: `${h.value}px` })
}, [
U("div", WA, [
X(O.$slots, "header")
]),
O.$slots.overlay ? X(O.$slots, "overlay", { key: 0 }) : (C(!0), P(Ee, { key: 1 }, nt(W(D), (H, z) => (C(), P("div", {
class: "dp__overlay_row",
key: z,
role: "row"
}, [
(C(!0), P(Ee, null, nt(H, (Y, ee) => (C(), P("div", {
role: "gridcell",
class: se(W(T)),
key: Y.value,
"aria-selected": Y.value === t.modelValue && !t.disabledValues.includes(Y.value),
"aria-disabled": Y.className.dp__overlay_cell_disabled,
ref_for: !0,
ref: (ce) => I(ce, Y, z, ee),
tabindex: "0",
"data-test": Y.text,
onClick: (ce) => R(Y.value),
onKeydown: [
He((ce) => R(Y.value), ["enter"]),
He((ce) => R(Y.value), ["space"])
],
onMouseover: (ce) => d.value = Y.value
}, [
U("div", {
class: se(Y.className)
}, [
O.$slots.item ? X(O.$slots, "item", {
key: 0,
item: Y
}) : F("", !0),
O.$slots.item ? F("", !0) : (C(), P(Ee, { key: 1 }, [
Oe(Se(Y.text), 1)
], 64))
], 2)
], 42, YA))), 128))
]))), 128))
], 6),
O.$slots["button-icon"] ? Qe((C(), P("div", {
key: 0,
role: "button",
"aria-label": (M = t.ariaLabels) == null ? void 0 : M.toggleOverlay,
class: se(W(x)),
tabindex: "0",
ref_key: "toggleButton",
ref: p,
onClick: A,
onKeydown: He(A, ["enter"])
}, [
X(O.$slots, "button-icon")
], 42, KA)), [
[xn, !W(s)(t.type)]
]) : F("", !0)
], 42, UA);
};
}
}), GA = ["aria-label"], A1 = /* @__PURE__ */ be({
__name: "RegularPicker",
props: {
ariaLabel: { type: String, default: "" },
showSelectionGrid: { type: Boolean, default: !1 },
modelValue: { type: Number, default: null },
items: { type: Array, default: () => [] },
disabledValues: { type: Array, default: () => [] },
minValue: { type: Number, default: null },
maxValue: { type: Number, default: null },
slotName: { type: String, default: "" },
overlaySlot: { type: String, default: "" },
headerRefs: { type: Array, default: () => [] },
escClose: { type: Boolean, default: !0 },
type: { type: String, default: null },
transitions: { type: [Object, Boolean], default: !1 },
arrowNavigation: { type: Boolean, default: !1 },
autoApply: { type: Boolean, default: !1 },
textInput: { type: Boolean, default: !1 },
ariaLabels: { type: Object, default: () => ({}) },
hideNavigation: { type: Array, default: () => [] }
},
emits: ["update:model-value", "toggle", "set-ref"],
setup(t, { emit: e }) {
const n = t, { transitionName: r, showTransition: i } = Kc(n.transitions), o = re(null);
return st(() => e("set-ref", o)), (a, s) => (C(), P(Ee, null, [
U("div", {
class: "dp__month_year_select",
onClick: s[0] || (s[0] = (u) => a.$emit("toggle")),
onKeydown: [
s[1] || (s[1] = He((u) => a.$emit("toggle"), ["enter"])),
s[2] || (s[2] = He((u) => a.$emit("toggle"), ["space"]))
],
role: "button",
"aria-label": t.ariaLabel,
tabindex: "0",
ref_key: "elRef",
ref: o
}, [
X(a.$slots, "default")
], 40, GA),
J(zn, {
name: W(r)(t.showSelectionGrid),
css: W(i)
}, {
default: ne(() => [
t.showSelectionGrid ? (C(), oe(Os, dt({ key: 0 }, {
modelValue: t.modelValue,
items: t.items,
disabledValues: t.disabledValues,
minValue: t.minValue,
maxValue: t.maxValue,
escClose: t.escClose,
type: t.type,
arrowNavigation: t.arrowNavigation,
textInput: t.textInput,
autoApply: t.autoApply,
ariaLabels: t.ariaLabels,
hideNavigation: t.hideNavigation
}, {
"header-refs": [],
"onUpdate:modelValue": s[3] || (s[3] = (u) => a.$emit("update:model-value", u)),
onToggle: s[4] || (s[4] = (u) => a.$emit("toggle"))
}), kn({
"button-icon": ne(() => [
a.$slots["calendar-icon"] ? X(a.$slots, "calendar-icon", { key: 0 }) : F("", !0),
a.$slots["calendar-icon"] ? F("", !0) : (C(), oe(W(Yc), { key: 1 }))
]),
_: 2
}, [
a.$slots[t.slotName] ? {
name: "item",
fn: ne(({ item: u }) => [
X(a.$slots, t.slotName, { item: u })
]),
key: "0"
} : void 0,
a.$slots[t.overlaySlot] ? {
name: "overlay",
fn: ne(() => [
X(a.$slots, t.overlaySlot)
]),
key: "1"
} : void 0,
a.$slots[`${t.overlaySlot}-header`] ? {
name: "header",
fn: ne(() => [
X(a.$slots, `${t.overlaySlot}-header`)
]),
key: "2"
} : void 0
]), 1040)) : F("", !0)
]),
_: 3
}, 8, ["name", "css"])
], 64));
}
}), JA = { class: "dp__month_year_row" }, XA = { class: "dp__month_year_wrap" }, QA = { class: "dp__month_picker_header" }, ZA = ["aria-label"], e9 = ["aria-label"], t9 = ["aria-label"], n9 = /* @__PURE__ */ be({
__name: "MonthYearPicker",
props: {
month: { type: Number, default: 0 },
year: { type: Number, default: 0 },
instance: { type: Number, default: 0 },
years: { type: Array, default: () => [] },
months: { type: Array, default: () => [] },
internalModelValue: { type: [Date, Array], default: null },
...Gi
},
emits: ["update-month-year", "month-year-select", "mount", "reset-flow", "overlay-closed"],
setup(t, { expose: e, emit: n }) {
const r = t, { defaults: i } = Zn(r), { transitionName: o, showTransition: a } = Kc(i.value.transitions), { buildMatrix: s } = Ki(), { handleMonthYearChange: u, isDisabled: l, updateMonthYear: c } = wA(r, n), f = re(!1), d = re(!1), p = re([null, null, null, null]), h = re(null), m = re(null), v = re(null);
st(() => {
n("mount");
});
const y = (V) => ({
get: () => r[V],
set: (te) => {
const K = V === "month" ? "year" : "month";
n("update-month-year", { [V]: te, [K]: r[K] }), n("month-year-select", V === "year"), V === "month" ? z(!0) : Y(!0);
}
}), k = L(y("month")), T = L(y("year")), b = (V) => {
const te = Tt(pe(V));
return r.year === te;
}, D = L(() => r.monthPicker ? Array.isArray(r.disabledDates) ? r.disabledDates.map((V) => pe(V)).filter((V) => b(V)).map((V) => _t(V)) : [] : []), x = L(() => (V) => {
const te = V === "month";
return {
showSelectionGrid: (te ? f : d).value,
items: (te ? O : g).value,
disabledValues: i.value.filters[te ? "months" : "years"].concat(D.value),
minValue: (te ? R : _).value,
maxValue: (te ? w : N).value,
headerRefs: te && r.monthPicker ? [h.value, m.value, v.value] : [],
escClose: r.escClose,
transitions: i.value.transitions,
ariaLabels: i.value.ariaLabels,
textInput: r.textInput,
autoApply: r.autoApply,
arrowNavigation: r.arrowNavigation,
hideNavigation: r.hideNavigation
};
}), S = L(() => (V) => ({
month: r.month,
year: r.year,
items: V === "month" ? r.months : r.years,
instance: r.instance,
updateMonthYear: c,
toggle: V === "month" ? z : Y
})), _ = L(() => r.minDate ? Tt(pe(r.minDate)) : null), N = L(() => r.maxDate ? Tt(pe(r.maxDate)) : null), R = L(() => {
if (r.minDate && _.value) {
if (_.value > r.year)
return 12;
if (_.value === r.year)
return _t(pe(r.minDate));
}
return null;
}), w = L(() => r.maxDate && N.value ? N.value < r.year ? -1 : N.value === r.year ? _t(pe(r.maxDate)) : null : null), A = L(() => r.range && r.internalModelValue && (r.monthPicker || r.yearPicker) ? r.internalModelValue : []), $ = (V) => V.reverse(), I = (V, te = !1) => {
const K = [], Q = (Z) => te ? $(Z) : Z;
for (let Z = 0; Z < V.length; Z += 3) {
const ae = [V[Z], V[Z + 1], V[Z + 2]];
K.push(Q(ae));
}
return te ? K.reverse() : K;
}, E = L(() => r.months.find((te) => te.value === r.month) || { text: "", value: 0 }), O = L(() => I(r.months)), g = L(() => I(r.years, r.reverseYears)), M = L(() => i.value.multiCalendars ? r.multiCalendarsSolo ? !0 : r.instance === 0 : !0), H = L(() => i.value.multiCalendars ? r.multiCalendarsSolo ? !0 : r.instance === i.value.multiCalendars - 1 : !0), z = (V = !1) => {
ee(V), f.value = !f.value, f.value || n("overlay-closed");
}, Y = (V = !1) => {
ee(V), d.value = !d.value, d.value || n("overlay-closed");
}, ee = (V) => {
V || n("reset-flow");
}, ce = (V = !1) => {
l.value(V) || n("update-month-year", {
year: V ? r.year + 1 : r.year - 1,
month: r.month,
fromNav: !0
});
}, q = (V, te) => {
r.arrowNavigation && (p.value[te] = Ft(V), s(p.value, "monthYear"));
};
return e({
toggleMonthPicker: z,
toggleYearPicker: Y
}), (V, te) => {
var K, Q, Z, ae, ke;
return C(), P("div", JA, [
V.$slots["month-year"] ? X(V.$slots, "month-year", At(dt({ key: 0 }, { month: t.month, year: t.year, months: t.months, years: t.years, updateMonthYear: W(c), handleMonthYearChange: W(u), instance: t.instance }))) : (C(), P(Ee, { key: 1 }, [
!V.monthPicker && !V.yearPicker ? (C(), P(Ee, { key: 0 }, [
W(M) && !V.vertical ? (C(), oe(Gd, {
key: 0,
"aria-label": (K = W(i).ariaLabels) == null ? void 0 : K.prevMonth,
disabled: W(l)(!1),
onActivate: te[0] || (te[0] = (ge) => W(u)(!1)),
onSetRef: te[1] || (te[1] = (ge) => q(ge, 0))
}, {
default: ne(() => [
V.$slots["arrow-left"] ? X(V.$slots, "arrow-left", { key: 0 }) : F("", !0),
V.$slots["arrow-left"] ? F("", !0) : (C(), oe(W(h1), { key: 1 }))
]),
_: 3
}, 8, ["aria-label", "disabled"])) : F("", !0),
U("div", XA, [
J(A1, dt({
type: "month",
"slot-name": "month-overlay-val",
"overlay-slot": "overlay-month",
"aria-label": (Q = W(i).ariaLabels) == null ? void 0 : Q.openMonthsOverlay,
modelValue: W(k),
"onUpdate:modelValue": te[2] || (te[2] = (ge) => Bt(k) ? k.value = ge : null)
}, W(x)("month"), {
onToggle: z,
onSetRef: te[3] || (te[3] = (ge) => q(ge, 1))
}), kn({
default: ne(() => [
V.$slots.month ? X(V.$slots, "month", At(dt({ key: 0 }, W(E)))) : F("", !0),
V.$slots.month ? F("", !0) : (C(), P(Ee, { key: 1 }, [
Oe(Se(W(E).text), 1)
], 64))
]),
_: 2
}, [
V.$slots["calendar-icon"] ? {
name: "calendar-icon",
fn: ne(() => [
X(V.$slots, "calendar-icon")
]),
key: "0"
} : void 0,
V.$slots["month-overlay-value"] ? {
name: "month-overlay-val",
fn: ne(({ item: ge }) => [
X(V.$slots, "month-overlay-value", {
text: ge.text,
value: ge.value
})
]),
key: "1"
} : void 0,
V.$slots["month-overlay"] ? {
name: "overlay-month",
fn: ne(() => [
X(V.$slots, "month-overlay", At(hn(W(S)("month"))))
]),
key: "2"
} : void 0,
V.$slots["month-overlay-header"] ? {
name: "overlay-month-header",
fn: ne(() => [
X(V.$slots, "month-overlay-header", { toggle: z })
]),
key: "3"
} : void 0
]), 1040, ["aria-label", "modelValue"]),
J(A1, dt({
type: "year",
"slot-name": "year-overlay-val",
"overlay-slot": "overlay-year",
"aria-label": (Z = W(i).ariaLabels) == null ? void 0 : Z.openYearsOverlay,
modelValue: W(T),
"onUpdate:modelValue": te[4] || (te[4] = (ge) => Bt(T) ? T.value = ge : null)
}, W(x)("year"), {
onToggle: Y,
onSetRef: te[5] || (te[5] = (ge) => q(ge, 2))
}), kn({
default: ne(() => [
V.$slots.year ? X(V.$slots, "year", {
key: 0,
year: t.year
}) : F("", !0),
V.$slots.year ? F("", !0) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.year), 1)
], 64))
]),
_: 2
}, [
V.$slots["calendar-icon"] ? {
name: "calendar-icon",
fn: ne(() => [
X(V.$slots, "calendar-icon")
]),
key: "0"
} : void 0,
V.$slots["year-overlay-value"] ? {
name: "year-overlay-val",
fn: ne(({ item: ge }) => [
X(V.$slots, "year-overlay-value", {
text: ge.text,
value: ge.value
})
]),
key: "1"
} : void 0,
V.$slots["year-overlay"] ? {
name: "overlay-year",
fn: ne(() => [
X(V.$slots, "year-overlay", At(hn(W(S)("year"))))
]),
key: "2"
} : void 0,
V.$slots["year-overlay-header"] ? {
name: "overlay-year-header",
fn: ne(() => [
X(V.$slots, "year-overlay-header", { toggle: Y })
]),
key: "3"
} : void 0
]), 1040, ["aria-label", "modelValue"])
]),
W(M) && V.vertical ? (C(), oe(Gd, {
key: 1,
"aria-label": (ae = W(i).ariaLabels) == null ? void 0 : ae.prevMonth,
disabled: W(l)(!1),
onActivate: te[6] || (te[6] = (ge) => W(u)(!1))
}, {
default: ne(() => [
V.$slots["arrow-up"] ? X(V.$slots, "arrow-up", { key: 0 }) : F("", !0),
V.$slots["arrow-up"] ? F("", !0) : (C(), oe(W(s2), { key: 1 }))
]),
_: 3
}, 8, ["aria-label", "disabled"])) : F("", !0),
W(H) ? (C(), oe(Gd, {
key: 2,
ref: "rightIcon",
disabled: W(l)(!0),
"aria-label": (ke = W(i).ariaLabels) == null ? void 0 : ke.nextMonth,
onActivate: te[7] || (te[7] = (ge) => W(u)(!0)),
onSetRef: te[8] || (te[8] = (ge) => q(ge, 3))
}, {
default: ne(() => [
V.$slots[V.vertical ? "arrow-down" : "arrow-right"] ? X(V.$slots, V.vertical ? "arrow-down" : "arrow-right", { key: 0 }) : F("", !0),
V.$slots[V.vertical ? "arrow-down" : "arrow-right"] ? F("", !0) : (C(), oe(Eo(V.vertical ? W(u2) : W(m1)), { key: 1 }))
]),
_: 3
}, 8, ["disabled", "aria-label"])) : F("", !0)
], 64)) : F("", !0),
V.monthPicker ? (C(), oe(Os, dt({ key: 1 }, W(x)("month"), {
"skip-active": V.range,
year: t.year,
"multi-model-value": W(A),
"month-picker": "",
modelValue: W(k),
"onUpdate:modelValue": te[17] || (te[17] = (ge) => Bt(k) ? k.value = ge : null),
onToggle: z,
onSelected: te[18] || (te[18] = (ge) => V.$emit("overlay-closed"))
}), kn({
header: ne(() => {
var ge, de, ye;
return [
U("div", QA, [
U("div", {
class: "dp__month_year_col_nav",
tabindex: "0",
ref_key: "mpPrevIconRef",
ref: h,
onClick: te[9] || (te[9] = (xe) => ce(!1)),
onKeydown: te[10] || (te[10] = He((xe) => ce(!1), ["enter"]))
}, [
U("div", {
class: se(["dp__inner_nav", { dp__inner_nav_disabled: W(l)(!1) }]),
role: "button",
"aria-label": (ge = W(i).ariaLabels) == null ? void 0 : ge.prevMonth
}, [
V.$slots["arrow-left"] ? X(V.$slots, "arrow-left", { key: 0 }) : F("", !0),
V.$slots["arrow-left"] ? F("", !0) : (C(), oe(W(h1), { key: 1 }))
], 10, ZA)
], 544),
U("div", {
class: "dp__pointer",
role: "button",
ref_key: "mpYearButtonRef",
ref: m,
"aria-label": (de = W(i).ariaLabels) == null ? void 0 : de.openYearsOverlay,
tabindex: "0",
onClick: te[11] || (te[11] = () => Y(!1)),
onKeydown: te[12] || (te[12] = He(() => Y(!1), ["enter"]))
}, [
V.$slots.year ? X(V.$slots, "year", {
key: 0,
year: t.year
}) : F("", !0),
V.$slots.year ? F("", !0) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.year), 1)
], 64))
], 40, e9),
U("div", {
class: "dp__month_year_col_nav",
tabindex: "0",
ref_key: "mpNextIconRef",
ref: v,
onClick: te[13] || (te[13] = (xe) => ce(!0)),
onKeydown: te[14] || (te[14] = He((xe) => ce(!0), ["enter"]))
}, [
U("div", {
class: se(["dp__inner_nav", { dp__inner_nav_disabled: W(l)(!0) }]),
role: "button",
"aria-label": (ye = W(i).ariaLabels) == null ? void 0 : ye.nextMonth
}, [
V.$slots["arrow-right"] ? X(V.$slots, "arrow-right", { key: 0 }) : F("", !0),
V.$slots["arrow-right"] ? F("", !0) : (C(), oe(W(m1), { key: 1 }))
], 10, t9)
], 544)
]),
J(zn, {
name: W(o)(d.value),
css: W(a)
}, {
default: ne(() => [
d.value ? (C(), oe(Os, dt({ key: 0 }, W(x)("year"), {
modelValue: W(T),
"onUpdate:modelValue": te[15] || (te[15] = (xe) => Bt(T) ? T.value = xe : null),
onToggle: Y,
onSelected: te[16] || (te[16] = (xe) => V.$emit("overlay-closed"))
}), kn({
"button-icon": ne(() => [
V.$slots["calendar-icon"] ? X(V.$slots, "calendar-icon", { key: 0 }) : F("", !0),
V.$slots["calendar-icon"] ? F("", !0) : (C(), oe(W(Yc), { key: 1 }))
]),
_: 2
}, [
V.$slots["year-overlay-value"] ? {
name: "item",
fn: ne(({ item: xe }) => [
X(V.$slots, "year-overlay-value", {
text: xe.text,
value: xe.value
})
]),
key: "0"
} : void 0
]), 1040, ["modelValue"])) : F("", !0)
]),
_: 3
}, 8, ["name", "css"])
];
}),
_: 2
}, [
V.$slots["month-overlay-value"] ? {
name: "item",
fn: ne(({ item: ge }) => [
X(V.$slots, "month-overlay-value", {
text: ge.text,
value: ge.value
})
]),
key: "0"
} : void 0
]), 1040, ["skip-active", "year", "multi-model-value", "modelValue"])) : F("", !0),
V.yearPicker ? (C(), oe(Os, dt({ key: 2 }, W(x)("year"), {
modelValue: W(T),
"onUpdate:modelValue": te[19] || (te[19] = (ge) => Bt(T) ? T.value = ge : null),
"multi-model-value": W(A),
"skip-active": V.range,
"skip-button-ref": "",
"year-picker": "",
onToggle: Y,
onSelected: te[20] || (te[20] = (ge) => V.$emit("overlay-closed"))
}), kn({ _: 2 }, [
V.$slots["year-overlay-value"] ? {
name: "item",
fn: ne(({ item: ge }) => [
X(V.$slots, "year-overlay-value", {
text: ge.text,
value: ge.value
})
]),
key: "0"
} : void 0
]), 1040, ["modelValue", "multi-model-value", "skip-active"])) : F("", !0)
], 64))
]);
};
}
}), r9 = {
key: 0,
class: "dp__time_input"
}, i9 = ["aria-label", "onKeydown", "onClick"], o9 = ["aria-label", "data-test", "onKeydown", "onClick"], a9 = ["aria-label", "onKeydown", "onClick"], s9 = { key: 0 }, u9 = ["aria-label", "onKeydown"], l9 = /* @__PURE__ */ be({
__name: "TimeInput",
props: {
hours: { type: Number, default: 0 },
minutes: { type: Number, default: 0 },
seconds: { type: Number, default: 0 },
closeTimePickerBtn: { type: Object, default: null },
order: { type: Number, default: 0 },
...Gi
},
emits: [
"set-hours",
"set-minutes",
"update:hours",
"update:minutes",
"update:seconds",
"reset-flow",
"mounted",
"overlay-closed"
],
setup(t, { expose: e, emit: n }) {
const r = t, { setTimePickerElements: i, setTimePickerBackRef: o } = Ki(), { defaults: a } = Zn(r), { transitionName: s, showTransition: u } = Kc(a.value.transitions), l = Qt({
hours: !1,
minutes: !1,
seconds: !1
}), c = re("AM"), f = re(null), d = re([]);
st(() => {
n("mounted");
});
const p = L(() => (g) => !!(r.maxTime && r.maxTime[g] && r.maxTime[g] < r[g] + +r[`${g}Increment`])), h = L(() => (g) => !!(r.minTime && r.minTime[g] && r.minTime[g] > r[g] - +r[`${g}Increment`])), m = (g, M) => Vy(bn(pe(), g), M), v = (g, M) => FC(bn(pe(), g), M), y = L(
() => ({
dp__time_col: !0,
dp__time_col_reg: !r.enableSeconds && r.is24,
dp__time_col_reg_with_button: !r.enableSeconds && !r.is24,
dp__time_col_sec: r.enableSeconds && r.is24,
dp__time_col_sec_with_button: r.enableSeconds && !r.is24
})
), k = L(() => {
const g = [{ type: "hours" }, { type: "", separator: !0 }, { type: "minutes" }];
return r.enableSeconds ? g.concat([{ type: "", separator: !0 }, { type: "seconds" }]) : g;
}), T = L(() => k.value.filter((g) => !g.separator)), b = L(() => (g) => {
if (g === "hours") {
const M = A(r.hours);
return { text: M < 10 ? `0${M}` : `${M}`, value: M };
}
return { text: r[g] < 10 ? `0${r[g]}` : `${r[g]}`, value: r[g] };
}), D = (g) => {
const M = r.is24 ? 24 : 12, H = g === "hours" ? M : 60, z = +r[`${g}GridIncrement`], Y = g === "hours" && !r.is24 ? z : 0, ee = [];
for (let ce = Y; ce < H; ce += z)
ee.push({ value: ce, text: ce < 10 ? `0${ce}` : `${ce}` });
return g === "hours" && !r.is24 && ee.push({ value: 0, text: "12" }), aA(ee);
}, x = (g, M) => {
const H = r.minTime && r.minTime[M], z = r.maxTime && r.maxTime[M];
return H && z ? g < H || g > z : H ? g < H : z ? g > z : !1;
}, S = L(() => (g) => D(g).flat().map((M) => M.value).filter((M) => x(M, g))), _ = (g) => r[`no${g[0].toUpperCase() + g.slice(1)}Overlay`], N = (g) => {
_(g) || (l[g] = !l[g], l[g] || n("overlay-closed"));
}, R = (g) => g === "hours" ? ui : g === "minutes" ? li : Ra, w = (g, M = !0) => {
const H = M ? m : v;
(M ? p.value(g) : h.value(g)) || n(
`update:${g}`,
R(g)(H({ [g]: +r[g] }, { [g]: +r[`${g}Increment`] }))
);
}, A = (g) => r.is24 ? g : (g >= 12 ? c.value = "PM" : c.value = "AM", cA(g)), $ = () => {
c.value === "PM" ? (c.value = "AM", n("update:hours", r.hours - 12)) : (c.value = "PM", n("update:hours", r.hours + 12));
}, I = (g) => {
l[g] = !0;
}, E = (g, M, H) => {
if (g && r.arrowNavigation) {
Array.isArray(d.value[M]) ? d.value[M][H] = g : d.value[M] = [g];
const z = d.value.reduce(
(Y, ee) => ee.map((ce, q) => [...Y[q] || [], ee[q]]),
[]
);
o(r.closeTimePickerBtn), f.value && (z[1] = z[1].concat(f.value)), i(z, r.order);
}
}, O = (g, M) => g === "hours" && !r.is24 ? n(`update:${g}`, c.value === "PM" ? M + 12 : M) : n(`update:${g}`, M);
return e({ openChildCmp: I }), (g, M) => {
var H;
return g.disabled ? F("", !0) : (C(), P("div", r9, [
(C(!0), P(Ee, null, nt(W(k), (z, Y) => {
var ee, ce, q;
return C(), P("div", {
key: Y,
class: se(W(y))
}, [
z.separator ? (C(), P(Ee, { key: 0 }, [
Oe(" : ")
], 64)) : (C(), P(Ee, { key: 1 }, [
U("div", {
class: se({
dp__inc_dec_button: !0,
dp__inc_dec_button_disabled: W(p)(z.type)
}),
role: "button",
"data-test": "time-inc-btn",
"aria-label": (ee = W(a).ariaLabels) == null ? void 0 : ee.incrementValue(z.type),
tabindex: "0",
onKeydown: [
He((V) => w(z.type), ["enter"]),
He((V) => w(z.type), ["space"])
],
onClick: (V) => w(z.type),
ref_for: !0,
ref: (V) => E(V, Y, 0)
}, [
g.$slots["arrow-up"] ? X(g.$slots, "arrow-up", { key: 0 }) : F("", !0),
g.$slots["arrow-up"] ? F("", !0) : (C(), oe(W(s2), { key: 1 }))
], 42, i9),
U("div", {
role: "button",
"aria-label": (ce = W(a).ariaLabels) == null ? void 0 : ce.openTpOverlay(z.type),
class: se(_(z.type) ? "" : "dp__time_display"),
tabindex: "0",
"data-test": `${z.type}-toggle-overlay-btn`,
onKeydown: [
He((V) => N(z.type), ["enter"]),
He((V) => N(z.type), ["space"])
],
onClick: (V) => N(z.type),
ref_for: !0,
ref: (V) => E(V, Y, 1)
}, [
g.$slots[z.type] ? X(g.$slots, z.type, {
key: 0,
text: W(b)(z.type).text,
value: W(b)(z.type).value
}) : F("", !0),
g.$slots[z.type] ? F("", !0) : (C(), P(Ee, { key: 1 }, [
Oe(Se(W(b)(z.type).text), 1)
], 64))
], 42, o9),
U("div", {
class: se({
dp__inc_dec_button: !0,
dp__inc_dec_button_disabled: W(h)(z.type)
}),
role: "button",
"data-test": "time-dec-btn",
"aria-label": (q = W(a).ariaLabels) == null ? void 0 : q.decrementValue(z.type),
tabindex: "0",
onKeydown: [
He((V) => w(z.type, !1), ["enter"]),
He((V) => w(z.type, !1), ["space"])
],
onClick: (V) => w(z.type, !1),
ref_for: !0,
ref: (V) => E(V, Y, 2)
}, [
g.$slots["arrow-down"] ? X(g.$slots, "arrow-down", { key: 0 }) : F("", !0),
g.$slots["arrow-down"] ? F("", !0) : (C(), oe(W(u2), { key: 1 }))
], 42, a9)
], 64))
], 2);
}), 128)),
g.is24 ? F("", !0) : (C(), P("div", s9, [
g.$slots["am-pm-button"] ? X(g.$slots, "am-pm-button", {
key: 0,
toggle: $,
value: c.value
}) : F("", !0),
g.$slots["am-pm-button"] ? F("", !0) : (C(), P("button", {
key: 1,
ref_key: "amPmButton",
ref: f,
type: "button",
class: "dp__pm_am_button",
role: "button",
"aria-label": (H = W(a).ariaLabels) == null ? void 0 : H.amPmButton,
tabindex: "0",
onClick: $,
onKeydown: [
He(et($, ["prevent"]), ["enter"]),
He(et($, ["prevent"]), ["space"])
]
}, Se(c.value), 41, u9))
])),
(C(!0), P(Ee, null, nt(W(T), (z, Y) => (C(), oe(zn, {
key: Y,
name: W(s)(l[z.type]),
css: W(u)
}, {
default: ne(() => [
l[z.type] ? (C(), oe(Os, {
key: 0,
items: D(z.type),
"disabled-values": W(a).filters.times[z.type].concat(W(S)(z.type)),
"esc-close": g.escClose,
"aria-labels": W(a).ariaLabels,
"hide-navigation": g.hideNavigation,
"onUpdate:modelValue": (ee) => O(z.type, ee),
onSelected: (ee) => N(z.type),
onToggle: (ee) => N(z.type),
onResetFlow: M[0] || (M[0] = (ee) => g.$emit("reset-flow")),
type: z.type
}, kn({
"button-icon": ne(() => [
g.$slots["clock-icon"] ? X(g.$slots, "clock-icon", { key: 0 }) : F("", !0),
g.$slots["clock-icon"] ? F("", !0) : (C(), oe(W(a2), { key: 1 }))
]),
_: 2
}, [
g.$slots[`${z.type}-overlay-value`] ? {
name: "item",
fn: ne(({ item: ee }) => [
X(g.$slots, `${z.type}-overlay-value`, {
text: ee.text,
value: ee.value
})
]),
key: "0"
} : void 0
]), 1032, ["items", "disabled-values", "esc-close", "aria-labels", "hide-navigation", "onUpdate:modelValue", "onSelected", "onToggle", "type"])) : F("", !0)
]),
_: 2
}, 1032, ["name", "css"]))), 128))
]));
};
}
}), c9 = ["aria-label"], d9 = { class: "dp__overlay_container dp__container_flex dp__time_picker_overlay_container" }, f9 = {
key: 1,
class: "dp__overlay_row"
}, p9 = ["aria-label"], h9 = /* @__PURE__ */ be({
__name: "TimePicker",
props: {
hours: { type: [Number, Array], default: 0 },
minutes: { type: [Number, Array], default: 0 },
seconds: { type: [Number, Array], default: 0 },
internalModelValue: { type: [Date, Array], default: null },
...Gi
},
emits: [
"update:hours",
"update:minutes",
"update:seconds",
"mount",
"reset-flow",
"overlay-closed"
],
setup(t, { expose: e, emit: n }) {
const r = t, { buildMatrix: i, setTimePicker: o } = Ki(), a = op(), { hideNavigationButtons: s, defaults: u } = Zn(r), { transitionName: l, showTransition: c } = Kc(u.value.transitions), f = re(null), d = re(null), p = re([]), h = re(null);
st(() => {
n("mount"), !r.timePicker && r.arrowNavigation ? i([Ft(f.value)], "time") : o(!0, r.timePicker);
});
const m = L(() => r.range && r.modelAuto ? p2(r.internalModelValue) : !0), v = re(!1), y = (w) => ({
hours: Array.isArray(r.hours) ? r.hours[w] : r.hours,
minutes: Array.isArray(r.minutes) ? r.minutes[w] : r.minutes,
seconds: Array.isArray(r.seconds) ? r.seconds[w] : r.seconds
}), k = L(() => {
const w = [];
if (r.range)
for (let A = 0; A < 2; A++)
w.push(y(A));
else
w.push(y(0));
return w;
}), T = (w, A = !1, $ = "") => {
A || n("reset-flow"), v.value = w, r.arrowNavigation && (o(w), w || n("overlay-closed")), Vn(() => {
$ !== "" && p.value[0] && p.value[0].openChildCmp($);
});
}, b = L(() => ({
dp__button: !0,
dp__button_bottom: r.autoApply
})), D = yo(a, "timePicker"), x = (w, A, $) => r.range ? A === 0 ? [w, k.value[1][$]] : [k.value[0][$], w] : w, S = (w) => {
n("update:hours", w);
}, _ = (w) => {
n("update:minutes", w);
}, N = (w) => {
n("update:seconds", w);
}, R = () => {
h.value && r.arrowNavigation && h.value.focus({ preventScroll: !0 });
};
return e({ toggleTimePicker: T }), (w, A) => {
var $;
return C(), P("div", null, [
w.timePicker ? F("", !0) : Qe((C(), P("div", {
key: 0,
class: se(W(b)),
role: "button",
"aria-label": ($ = W(u).ariaLabels) == null ? void 0 : $.openTimePicker,
tabindex: "0",
"data-test": "open-time-picker-btn",
ref_key: "openTimePickerBtn",
ref: f,
onKeydown: [
A[0] || (A[0] = He((I) => T(!0), ["enter"])),
A[1] || (A[1] = He((I) => T(!0), ["space"]))
],
onClick: A[2] || (A[2] = (I) => T(!0))
}, [
w.$slots["clock-icon"] ? X(w.$slots, "clock-icon", { key: 0 }) : F("", !0),
w.$slots["clock-icon"] ? F("", !0) : (C(), oe(W(a2), { key: 1 }))
], 42, c9)), [
[xn, !W(s)("time")]
]),
J(zn, {
name: W(l)(v.value),
css: W(c)
}, {
default: ne(() => {
var I;
return [
v.value || w.timePicker ? (C(), P("div", {
key: 0,
class: "dp__overlay",
ref_key: "overlayRef",
ref: h,
tabindex: "0"
}, [
U("div", d9, [
w.$slots["time-picker-overlay"] ? X(w.$slots, "time-picker-overlay", {
key: 0,
hours: t.hours,
minutes: t.minutes,
seconds: t.seconds,
setHours: S,
setMinutes: _,
setSeconds: N
}) : F("", !0),
w.$slots["time-picker-overlay"] ? F("", !0) : (C(), P("div", f9, [
(C(!0), P(Ee, null, nt(W(k), (E, O) => Qe((C(), oe(l9, dt({ key: O }, {
...w.$props,
order: O,
hours: E.hours,
minutes: E.minutes,
seconds: E.seconds,
closeTimePickerBtn: d.value,
disabled: O === 0 ? w.fixedStart : w.fixedEnd
}, {
ref_for: !0,
ref_key: "timeInputRefs",
ref: p,
"onUpdate:hours": (g) => S(x(g, O, "hours")),
"onUpdate:minutes": (g) => _(x(g, O, "minutes")),
"onUpdate:seconds": (g) => N(x(g, O, "seconds")),
onMounted: R,
onOverlayClosed: R
}), kn({ _: 2 }, [
nt(W(D), (g, M) => ({
name: g,
fn: ne((H) => [
X(w.$slots, g, At(hn(H)))
])
}))
]), 1040, ["onUpdate:hours", "onUpdate:minutes", "onUpdate:seconds"])), [
[xn, O === 0 ? !0 : W(m)]
])), 128))
])),
w.timePicker ? F("", !0) : Qe((C(), P("div", {
key: 2,
ref_key: "closeTimePickerBtn",
ref: d,
class: se(W(b)),
role: "button",
"aria-label": (I = W(u).ariaLabels) == null ? void 0 : I.closeTimePicker,
tabindex: "0",
onKeydown: [
A[3] || (A[3] = He((E) => T(!1), ["enter"])),
A[4] || (A[4] = He((E) => T(!1), ["space"]))
],
onClick: A[5] || (A[5] = (E) => T(!1))
}, [
w.$slots["calendar-icon"] ? X(w.$slots, "calendar-icon", { key: 0 }) : F("", !0),
w.$slots["calendar-icon"] ? F("", !0) : (C(), oe(W(Yc), { key: 1 }))
], 42, p9)), [
[xn, !W(s)("time")]
])
])
], 512)) : F("", !0)
];
}),
_: 3
}, 8, ["name", "css"])
]);
};
}
}), m9 = (t, e) => {
const { isDisabled: n, matchDate: r, getWeekFromDate: i } = Zn(e), o = re(null), a = re(pe()), s = (g) => {
!g.current && e.hideOffsetDates || (o.value = g.value);
}, u = () => {
o.value = null;
}, l = (g) => Array.isArray(t.value) && e.range && t.value[0] && o.value ? g ? En(o.value, t.value[0]) : fn(o.value, t.value[0]) : !0, c = (g, M) => {
const H = () => t.value ? M ? t.value[0] || null : t.value[1] : null, z = t.value && Array.isArray(t.value) ? H() : null;
return Ot(pe(g.value), z);
}, f = (g) => {
const M = Array.isArray(t.value) ? t.value[0] : null;
return g ? !fn(o.value || null, M) : !0;
}, d = (g, M = !0) => (e.range || e.weekPicker) && Array.isArray(t.value) ? e.hideOffsetDates && !g.current ? !1 : Ot(pe(g.value), t.value[M ? 0 : 1]) : e.range ? c(g, M) && f(M) || Ot(g.value, Array.isArray(t.value) ? t.value[0] : null) && l(M) : !1, p = (g, M, H) => Array.isArray(t.value) && t.value[0] && t.value.length === 1 ? g ? !1 : H ? En(t.value[0], M.value) : fn(t.value[0], M.value) : !1, h = (g) => !t.value || e.hideOffsetDates && !g.current ? !1 : e.range ? e.modelAuto && Array.isArray(t.value) ? Ot(g.value, t.value[0] ? t.value[0] : a.value) : !1 : e.multiDates && Array.isArray(t.value) ? t.value.some((M) => Ot(M, g.value)) : Ot(g.value, t.value ? t.value : a.value), m = (g) => {
if (e.autoRange || e.weekPicker) {
if (o.value) {
if (e.hideOffsetDates && !g.current)
return !1;
const M = Pi(o.value, +e.autoRange), H = i(pe(o.value));
return e.weekPicker ? Ot(H[1], pe(g.value)) : Ot(M, pe(g.value));
}
return !1;
}
return !1;
}, v = (g) => {
if (e.autoRange || e.weekPicker) {
if (o.value) {
const M = Pi(o.value, +e.autoRange);
if (e.hideOffsetDates && !g.current)
return !1;
const H = i(pe(o.value));
return e.weekPicker ? En(g.value, H[0]) && fn(g.value, H[1]) : En(g.value, o.value) && fn(g.value, M);
}
return !1;
}
return !1;
}, y = (g) => {
if (e.autoRange || e.weekPicker) {
if (o.value) {
if (e.hideOffsetDates && !g.current)
return !1;
const M = i(pe(o.value));
return e.weekPicker ? Ot(M[0], g.value) : Ot(o.value, g.value);
}
return !1;
}
return !1;
}, k = (g) => l2(t.value, o.value, g.value), T = () => e.modelAuto && Array.isArray(e.internalModelValue) ? !!e.internalModelValue[0] : !1, b = () => e.modelAuto ? p2(e.internalModelValue) : !0, D = (g) => {
if (Array.isArray(t.value) && t.value.length || e.weekPicker)
return !1;
const M = e.range ? !d(g) && !d(g, !1) : !0;
return !n(g.value) && !h(g) && !(!g.current && e.hideOffsetDates) && M;
}, x = (g) => e.range ? e.modelAuto ? T() && h(g) : !1 : h(g), S = (g) => e.highlight ? r(g.value, e.highlight) : !1, _ = (g) => n(g.value) && e.highlightDisabledDays === !1, N = (g) => e.highlightWeekDays && e.highlightWeekDays.includes(g.value.getDay()), R = (g) => (e.range || e.weekPicker) && (!(e.multiCalendars > 0) || g.current) && b() && !(!g.current && e.hideOffsetDates) && !h(g) ? k(g) : !1, w = (g) => ({
dp__cell_offset: !g.current,
dp__pointer: !e.disabled && !(!g.current && e.hideOffsetDates) && !n(g.value),
dp__cell_disabled: n(g.value),
dp__cell_highlight: !_(g) && (S(g) || N(g)) && !x(g),
dp__cell_highlight_active: !_(g) && (S(g) || N(g)) && x(g),
dp__today: !e.noToday && Ot(g.value, a.value) && g.current
}), A = (g) => ({
dp__active_date: x(g),
dp__date_hover: D(g)
}), $ = (g) => ({
...I(g),
...E(g),
dp__range_between_week: R(g) && e.weekPicker
}), I = (g) => ({
dp__range_start: e.multiCalendars > 0 ? g.current && d(g) && b() : d(g) && b(),
dp__range_end: e.multiCalendars > 0 ? g.current && d(g, !1) && b() : d(g, !1) && b(),
dp__range_between: R(g) && !e.weekPicker,
dp__date_hover_start: p(D(g), g, !0),
dp__date_hover_end: p(D(g), g, !1)
}), E = (g) => ({
...I(g),
dp__cell_auto_range: v(g),
dp__cell_auto_range_start: y(g),
dp__cell_auto_range_end: m(g)
}), O = (g) => e.range ? e.autoRange ? E(g) : e.modelAuto ? { ...A(g), ...I(g) } : I(g) : e.weekPicker ? $(g) : A(g);
return {
setHoverDate: s,
clearHoverDate: u,
getDayClassData: (g) => ({
...w(g),
...O(g),
[e.dayClass ? e.dayClass(g.value) : ""]: !0,
[e.calendarCellClassName]: !!e.calendarCellClassName
})
};
}, g9 = ["id", "onKeydown"], b9 = {
key: 0,
class: "dp__sidebar_left"
}, v9 = {
key: 1,
class: "dp__preset_ranges"
}, y9 = ["onClick"], w9 = {
key: 2,
class: "dp__sidebar_right"
}, k9 = {
key: 3,
class: "dp__now_wrap"
}, x9 = /* @__PURE__ */ be({
__name: "DatepickerMenu",
props: {
openOnTop: { type: Boolean, default: !1 },
internalModelValue: { type: [Date, Array], default: null },
...Gi
},
emits: [
"close-picker",
"select-date",
"auto-apply",
"time-update",
"flow-step",
"update-month-year",
"invalid-select",
"update:internal-model-value",
"recalculate-position",
"invalid-fixed-range",
"tooltip-open",
"tooltip-close"
],
setup(t, { expose: e, emit: n }) {
const r = t, { setMenuFocused: i, setShiftKey: o, control: a } = c2(), { getCalendarDays: s, defaults: u } = Zn(r), l = op(), c = re(null), f = Qt({
timePicker: !!(!r.enableTimePicker || r.timePicker || r.monthPicker),
monthYearInput: !!r.timePicker,
calendar: !1
}), d = re([]), p = re([]), h = re(null), m = re(null), v = re(0), y = re(!1), k = re(0);
st(() => {
var j;
y.value = !0, !((j = r.presetRanges) != null && j.length) && !l["left-sidebar"] && !l["right-sidebar"] && le();
const ue = Ft(m);
if (ue && !r.textInput && !r.inline && (i(!0), _()), ue) {
const we = (Ue) => {
!r.monthYearComponent && !r.timePickerComponent && !Object.keys(l).length && Ue.preventDefault(), Ue.stopImmediatePropagation(), Ue.stopPropagation();
};
ue.addEventListener("pointerdown", we), ue.addEventListener("mousedown", we);
}
window.addEventListener("resize", le);
}), jo(() => {
window.removeEventListener("resize", le);
});
const { arrowRight: T, arrowLeft: b, arrowDown: D, arrowUp: x } = Ki(), S = (j) => {
j || j === 0 ? p.value[j].triggerTransition(
$.value(j),
I.value(j)
) : p.value.forEach(
(ue, we) => ue.triggerTransition($.value(we), I.value(we))
);
}, _ = () => {
const j = Ft(m);
j && j.focus({ preventScroll: !0 });
}, N = () => {
var j;
(j = r.flow) != null && j.length && k.value !== -1 && (k.value += 1, n("flow-step", k.value), ht());
}, R = () => {
k.value = -1;
}, {
calendars: w,
modelValue: A,
month: $,
year: I,
time: E,
updateTime: O,
updateMonthYear: g,
selectDate: M,
getWeekNum: H,
monthYearSelect: z,
handleScroll: Y,
handleArrow: ee,
handleSwipe: ce,
getMarker: q,
selectCurrentDate: V,
presetDateRange: te
} = vA(r, n, N, S, k), { setHoverDate: K, clearHoverDate: Q, getDayClassData: Z } = m9(A, r);
Ct(
w,
() => {
r.openOnTop && setTimeout(() => {
n("recalculate-position");
}, 0);
},
{ deep: !0 }
);
const ae = yo(l, "calendar"), ke = yo(l, "action"), ge = yo(l, "timePicker"), de = yo(l, "monthYear"), ye = L(() => r.openOnTop ? "dp__arrow_bottom" : "dp__arrow_top"), xe = L(() => uA(r.yearRange)), ct = L(() => lA(r.locale, r.monthNameFormat)), le = () => {
const j = Ft(c);
j && (v.value = j.getBoundingClientRect().width);
}, je = L(() => (j) => s($.value(j), I.value(j))), We = L(
() => u.value.multiCalendars > 0 && r.range ? [...Array(u.value.multiCalendars).keys()] : [0]
), Ke = L(
() => (j) => j === 1
), ot = L(() => r.monthPicker || r.timePicker || r.yearPicker), Rt = L(
() => ({
dp__flex_display: u.value.multiCalendars > 0
})
), xt = L(() => ({
dp__instance_calendar: u.value.multiCalendars > 0
})), qt = L(() => ({
dp__menu_disabled: r.disabled,
dp__menu_readonly: r.readonly
})), Ut = L(
() => (j) => qn(je, j)
), Hn = L(
() => ({
dp__menu: !0,
dp__menu_index: !r.inline,
dp__relative: r.inline,
[r.menuClassName]: !!r.menuClassName
})
), qn = (j, ue) => j.value(ue).map((we) => ({
...we,
days: we.days.map((Ue) => (Ue.marker = q(Ue), Ue.classData = Z(Ue), Ue))
})), An = (j) => {
j.stopPropagation(), j.stopImmediatePropagation();
}, G = () => {
r.escClose && n("close-picker");
}, fe = (j, ue = !1) => {
M(j, ue), r.spaceConfirm && n("select-date");
}, Ne = (j) => {
var ue;
(ue = r.flow) != null && ue.length && (f[j] = !0, Object.keys(f).filter((we) => !f[we]).length || ht());
}, Be = (j, ue, we, Ue, ...mt) => {
if (r.flow[k.value] === j) {
const Ae = Ue ? ue.value[0] : ue.value;
Ae && Ae[we](...mt);
}
}, ht = () => {
Be("month", d, "toggleMonthPicker", !0, !0), Be("year", d, "toggleYearPicker", !0, !0), Be("calendar", h, "toggleTimePicker", !1, !1, !0), Be("time", h, "toggleTimePicker", !1, !0, !0);
const j = r.flow[k.value];
(j === "hours" || j === "minutes" || j === "seconds") && Be(j, h, "toggleTimePicker", !1, !0, !0, j);
}, B = (j) => {
if (r.arrowNavigation) {
if (j === "up")
return x();
if (j === "down")
return D();
if (j === "left")
return b();
if (j === "right")
return T();
} else
j === "left" || j === "up" ? ee("left", 0, j === "up") : ee("right", 0, j === "down");
}, ie = (j) => {
o(j.shiftKey), !r.disableMonthYearSelect && j.code === "Tab" && j.target.classList.contains("dp__menu") && a.value.shiftKeyInMenu && (j.preventDefault(), j.stopImmediatePropagation(), n("close-picker"));
};
return e({
updateMonthYear: g
}), (j, ue) => {
var we;
return C(), oe(zn, {
appear: "",
name: (we = W(u).transitions) == null ? void 0 : we.menuAppear,
mode: "out-in",
css: !!j.transitions
}, {
default: ne(() => {
var Ue, mt;
return [
U("div", {
id: j.uid ? `dp-menu-${j.uid}` : void 0,
tabindex: "0",
ref_key: "dpMenuRef",
ref: m,
role: "dialog",
class: se(W(Hn)),
onMouseleave: ue[14] || (ue[14] = //@ts-ignore
(...Ae) => W(Q) && W(Q)(...Ae)),
onClick: An,
onKeydown: [
He(G, ["esc"]),
ue[15] || (ue[15] = He(et((Ae) => B("left"), ["prevent"]), ["left"])),
ue[16] || (ue[16] = He(et((Ae) => B("up"), ["prevent"]), ["up"])),
ue[17] || (ue[17] = He(et((Ae) => B("down"), ["prevent"]), ["down"])),
ue[18] || (ue[18] = He(et((Ae) => B("right"), ["prevent"]), ["right"])),
ie
]
}, [
(j.disabled || j.readonly) && j.inline ? (C(), P("div", {
key: 0,
class: se(W(qt))
}, null, 2)) : F("", !0),
!j.inline && !j.teleportCenter ? (C(), P("div", {
key: 1,
class: se(W(ye))
}, null, 2)) : F("", !0),
U("div", {
class: se({
dp__menu_content_wrapper: ((Ue = j.presetRanges) == null ? void 0 : Ue.length) || !!j.$slots["left-sidebar"] || !!j.$slots["right-sidebar"]
})
}, [
j.$slots["left-sidebar"] ? (C(), P("div", b9, [
X(j.$slots, "left-sidebar")
])) : F("", !0),
(mt = j.presetRanges) != null && mt.length ? (C(), P("div", v9, [
(C(!0), P(Ee, null, nt(j.presetRanges, (Ae, tr) => (C(), P("div", {
key: tr,
style: Xe(Ae.style || {}),
class: "dp__preset_range",
onClick: (ze) => W(te)(Ae.range, !!Ae.slot)
}, [
Ae.slot ? X(j.$slots, Ae.slot, {
key: 0,
presetDateRange: W(te),
label: Ae.label,
range: Ae.range
}) : (C(), P(Ee, { key: 1 }, [
Oe(Se(Ae.label), 1)
], 64))
], 12, y9))), 128))
])) : F("", !0),
U("div", {
class: "dp__instance_calendar",
ref_key: "calendarWrapperRef",
ref: c,
role: "document"
}, [
U("div", {
class: se(W(Rt))
}, [
(C(!0), P(Ee, null, nt(W(We), (Ae, tr) => (C(), P("div", {
key: Ae,
class: se(W(xt))
}, [
!j.disableMonthYearSelect && !j.timePicker ? (C(), oe(Eo(j.monthYearComponent ? j.monthYearComponent : n9), dt({
key: 0,
ref_for: !0,
ref: (ze) => {
ze && (d.value[tr] = ze);
},
months: W(ct),
years: W(xe),
month: W($)(Ae),
year: W(I)(Ae),
instance: Ae,
"internal-model-value": t.internalModelValue
}, j.$props, {
onMount: ue[0] || (ue[0] = (ze) => Ne("monthYearInput")),
onResetFlow: R,
onUpdateMonthYear: (ze) => W(g)(Ae, ze),
onMonthYearSelect: W(z),
onOverlayClosed: _
}), kn({ _: 2 }, [
nt(W(de), (ze, Xr) => ({
name: ze,
fn: ne((Fn) => [
X(j.$slots, ze, At(hn(Fn)))
])
}))
]), 1040, ["months", "years", "month", "year", "instance", "internal-model-value", "onUpdateMonthYear", "onMonthYearSelect"])) : F("", !0),
J(FA, dt({
ref_for: !0,
ref: (ze) => {
ze && (p.value[tr] = ze);
},
"specific-mode": W(ot),
"get-week-num": W(H),
instance: Ae,
"mapped-dates": W(Ut)(Ae),
month: W($)(Ae),
year: W(I)(Ae)
}, j.$props, {
"flow-step": k.value,
"onUpdate:flowStep": ue[1] || (ue[1] = (ze) => k.value = ze),
onSelectDate: (ze) => W(M)(ze, !W(Ke)(Ae)),
onHandleSpace: (ze) => fe(ze, !W(Ke)(Ae)),
onSetHoverDate: ue[2] || (ue[2] = (ze) => W(K)(ze)),
onHandleScroll: (ze) => W(Y)(ze, Ae),
onHandleSwipe: (ze) => W(ce)(ze, Ae),
onMount: ue[3] || (ue[3] = (ze) => Ne("calendar")),
onResetFlow: R,
onTooltipOpen: ue[4] || (ue[4] = (ze) => j.$emit("tooltip-open", ze)),
onTooltipClose: ue[5] || (ue[5] = (ze) => j.$emit("tooltip-close", ze))
}), kn({ _: 2 }, [
nt(W(ae), (ze, Xr) => ({
name: ze,
fn: ne((Fn) => [
X(j.$slots, ze, At(hn({ ...Fn })))
])
}))
]), 1040, ["specific-mode", "get-week-num", "instance", "mapped-dates", "month", "year", "flow-step", "onSelectDate", "onHandleSpace", "onHandleScroll", "onHandleSwipe"])
], 2))), 128))
], 2),
U("div", null, [
j.$slots["time-picker"] ? X(j.$slots, "time-picker", At(dt({ key: 0 }, { time: W(E), updateTime: W(O) }))) : (C(), P(Ee, { key: 1 }, [
j.enableTimePicker && !j.monthPicker && !j.weekPicker ? (C(), oe(Eo(j.timePickerComponent ? j.timePickerComponent : h9), dt({
key: 0,
ref_key: "timePickerRef",
ref: h,
hours: W(E).hours,
minutes: W(E).minutes,
seconds: W(E).seconds,
"internal-model-value": t.internalModelValue
}, j.$props, {
onMount: ue[6] || (ue[6] = (Ae) => Ne("timePicker")),
"onUpdate:hours": ue[7] || (ue[7] = (Ae) => W(O)(Ae)),
"onUpdate:minutes": ue[8] || (ue[8] = (Ae) => W(O)(Ae, !1)),
"onUpdate:seconds": ue[9] || (ue[9] = (Ae) => W(O)(Ae, !1, !0)),
onResetFlow: R,
onOverlayClosed: _
}), kn({ _: 2 }, [
nt(W(ge), (Ae, tr) => ({
name: Ae,
fn: ne((ze) => [
X(j.$slots, Ae, At(hn(ze)))
])
}))
]), 1040, ["hours", "minutes", "seconds", "internal-model-value"])) : F("", !0)
], 64))
])
], 512),
j.$slots["right-sidebar"] ? (C(), P("div", w9, [
X(j.$slots, "right-sidebar")
])) : F("", !0),
j.showNowButton ? (C(), P("div", k9, [
j.$slots["now-button"] ? X(j.$slots, "now-button", {
key: 0,
selectCurrentDate: W(V)
}) : F("", !0),
j.$slots["now-button"] ? F("", !0) : (C(), P("button", {
key: 1,
type: "button",
role: "button",
class: "dp__now_button",
onClick: ue[10] || (ue[10] = //@ts-ignore
(...Ae) => W(V) && W(V)(...Ae))
}, Se(j.nowButtonLabel), 1))
])) : F("", !0)
], 2),
!j.autoApply || j.keepActionRow ? (C(), oe(Eo(j.actionRowComponent ? j.actionRowComponent : NA), dt({
key: 2,
"menu-mount": y.value,
"calendar-width": v.value,
"internal-model-value": t.internalModelValue
}, j.$props, {
onClosePicker: ue[11] || (ue[11] = (Ae) => j.$emit("close-picker")),
onSelectDate: ue[12] || (ue[12] = (Ae) => j.$emit("select-date")),
onInvalidSelect: ue[13] || (ue[13] = (Ae) => j.$emit("invalid-select"))
}), kn({ _: 2 }, [
nt(W(ke), (Ae, tr) => ({
name: Ae,
fn: ne((ze) => [
X(j.$slots, Ae, At(hn({ ...ze })))
])
}))
]), 1040, ["menu-mount", "calendar-width", "internal-model-value"])) : F("", !0)
], 42, g9)
];
}),
_: 3
}, 8, ["name", "css"]);
};
}
}), S9 = typeof window < "u" ? window : void 0, Jd = () => {
}, E9 = (t) => Ub() ? (Wb(t), !0) : !1, _9 = (t, e, n, r) => {
if (!t)
return Jd;
let i = Jd;
const o = Ct(
() => W(t),
(s) => {
i(), s && (s.addEventListener(e, n, r), i = () => {
s.removeEventListener(e, n, r), i = Jd;
});
},
{ immediate: !0, flush: "post" }
), a = () => {
o(), i();
};
return E9(a), a;
}, T9 = (t, e, n, r = {}) => {
const { window: i = S9, event: o = "pointerdown" } = r;
return i ? _9(i, o, (a) => {
const s = Ft(t), u = Ft(e);
!s || !u || s === a.target || a.composedPath().includes(s) || a.composedPath().includes(u) || n(a);
}, { passive: !0 }) : void 0;
}, C9 = /* @__PURE__ */ be({
__name: "VueDatePicker",
props: {
...Gi
},
emits: [
"update:model-value",
"text-submit",
"closed",
"cleared",
"open",
"focus",
"blur",
"internal-model-change",
"recalculate-position",
"flow-step",
"update-month-year",
"invalid-select",
"invalid-fixed-range",
"tooltip-open",
"tooltip-close"
],
setup(t, { expose: e, emit: n }) {
const r = t, i = op(), o = re(!1), a = So(r, "modelValue"), s = So(r, "timezone"), u = re(null), l = re(null), c = re(!1), { setMenuFocused: f, setShiftKey: d } = c2(), { clearArrowNav: p } = Ki(), { validateDate: h, isValidTime: m, defaults: v } = Zn(r);
st(() => {
N(r.modelValue), r.inline || (window.addEventListener("scroll", E), window.addEventListener("resize", O)), r.inline && (o.value = !0);
}), jo(() => {
r.inline || (window.removeEventListener("scroll", E), window.removeEventListener("resize", O));
});
const y = yo(i, "all", r.presetRanges), k = yo(i, "input");
Ct(
[a, s],
() => {
N(a.value);
},
{ deep: !0 }
);
const { openOnTop: T, menuPosition: b, setMenuPosition: D, setInitialPosition: x } = kA(
u,
l,
n,
r
), {
inputValue: S,
internalModelValue: _,
parseExternalModelValue: N,
emitModelValue: R,
formatInputValue: w,
checkBeforeEmit: A
} = yA(n, r, c), $ = L(
() => ({
dp__main: !0,
dp__theme_dark: r.dark,
dp__theme_light: !r.dark,
dp__flex_display: r.inline,
dp__flex_display_with_input: r.inlineWithInput
})
), I = L(() => r.dark ? "dp__theme_dark" : "dp__theme_light"), E = () => {
o.value && (r.closeOnScroll ? q() : r.autoPosition && D());
}, O = () => {
o.value && D();
}, g = () => {
!r.disabled && !r.readonly && (x(), o.value = !0, Vn().then(() => {
D(), o.value && n("open");
}), o.value || ce(), N(r.modelValue));
}, M = () => {
S.value = "", ce(), n("update:model-value", null), n("cleared"), q();
}, H = () => {
const de = _.value;
return !de || !Array.isArray(de) && h(de) ? !0 : Array.isArray(de) ? de.length === 2 && h(de[0]) && h(de[1]) ? !0 : h(de[0]) : !1;
}, z = () => {
A() && H() ? (R(), q()) : n("invalid-select", _.value);
}, Y = (de) => {
R(), r.closeOnAutoApply && !de && q();
}, ee = (de = !1) => {
r.autoApply && m(_.value) && H() && (r.range && Array.isArray(_.value) ? (r.partialRange || _.value.length === 2) && Y(de) : Y(de));
}, ce = () => {
r.textInput || (_.value = null);
}, q = () => {
r.inline || (o.value && (o.value = !1, f(!1), d(!1), p(), n("closed"), x(), S.value && N(a.value)), ce(), l.value && l.value.focusInput());
}, V = (de, ye) => {
if (!de) {
_.value = null;
return;
}
_.value = de, ye && (z(), n("text-submit"));
}, te = () => {
r.autoApply && m(_.value) && R();
}, K = () => o.value ? q() : g(), Q = (de) => {
_.value = de;
}, Z = L(() => r.textInput && v.value.textInputOptions.format), ae = () => {
Z.value && (c.value = !0, w()), n("focus");
}, ke = () => {
Z.value && (c.value = !1, w()), n("blur");
}, ge = (de) => {
u.value && u.value.updateMonthYear(0, {
month: _1(de.month),
year: _1(de.year)
});
};
return T9(
u,
l,
r.onClickOutside ? () => r.onClickOutside(H) : q
), e({
closeMenu: q,
selectDate: z,
clearValue: M,
openMenu: g,
onScroll: E,
formatInputValue: w,
// exposed for testing purposes
updateInternalModelValue: Q,
// modify internal modelValue
setMonthYear: ge
}), (de, ye) => (C(), P("div", {
class: se(W($))
}, [
J(AA, dt({
ref_key: "inputRef",
ref: l,
"is-menu-open": o.value,
"input-value": W(S),
"onUpdate:inputValue": ye[0] || (ye[0] = (xe) => Bt(S) ? S.value = xe : null)
}, de.$props, {
onClear: M,
onOpen: g,
onSetInputDate: V,
onSetEmptyDate: W(R),
onSelectDate: z,
onToggle: K,
onClose: q,
onFocus: ae,
onBlur: ke
}), kn({ _: 2 }, [
nt(W(k), (xe, ct) => ({
name: xe,
fn: ne((le) => [
X(de.$slots, xe, At(hn(le)))
])
}))
]), 1040, ["is-menu-open", "input-value", "onSetEmptyDate"]),
o.value ? (C(), oe(Kb, {
key: 0,
to: de.teleport,
disabled: de.inline
}, [
o.value ? (C(), oe(x9, dt({
key: 0,
ref_key: "dpMenuRef",
ref: u,
class: W(I),
style: W(b),
"open-on-top": W(T)
}, de.$props, {
"internal-model-value": W(_),
"onUpdate:internalModelValue": ye[1] || (ye[1] = (xe) => Bt(_) ? _.value = xe : null),
onClosePicker: q,
onSelectDate: z,
onAutoApply: ee,
onTimeUpdate: te,
onFlowStep: ye[2] || (ye[2] = (xe) => de.$emit("flow-step", xe)),
onUpdateMonthYear: ye[3] || (ye[3] = (xe) => de.$emit("update-month-year", xe)),
onInvalidSelect: ye[4] || (ye[4] = (xe) => de.$emit("invalid-select", W(_))),
onInvalidFixedRange: ye[5] || (ye[5] = (xe) => de.$emit("invalid-fixed-range", xe)),
onRecalculatePosition: W(D),
onTooltipOpen: ye[6] || (ye[6] = (xe) => de.$emit("tooltip-open", xe)),
onTooltipClose: ye[7] || (ye[7] = (xe) => de.$emit("tooltip-close", xe))
}), kn({ _: 2 }, [
nt(W(y), (xe, ct) => ({
name: xe,
fn: ne((le) => [
X(de.$slots, xe, At(hn({ ...le })))
])
}))
]), 1040, ["class", "style", "open-on-top", "internal-model-value", "onRecalculatePosition"])) : F("", !0)
], 8, ["to", "disabled"])) : F("", !0)
], 2));
}
}), Hp = /* @__PURE__ */ (() => {
const t = C9;
return t.install = (e) => {
e.component("Vue3DatePicker", t);
}, t;
})(), O9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: Hp
}, Symbol.toStringTag, { value: "Module" }));
Object.entries(O9).forEach(([t, e]) => {
t !== "default" && (Hp[t] = e);
});
const M1 = ["day", "month", "year", "auto"], A9 = {
modelValue: {
type: [Array, String, Object, Date],
required: !1,
description: "Valor del componente"
},
value: {
type: [Array, String, Object, Date],
required: !1,
description: "Valor del componente"
},
disabled: {
type: Boolean,
default: !1,
description: "Desactiva el componente"
},
disabledDates: {
type: Array,
required: !1,
default: () => [],
description: "Desactiva las fechas que se pasan como argumento"
},
readonly: {
type: Boolean,
default: !1,
description: "Desactiva la interacción con el componente"
},
clearable: {
type: Boolean,
default: !1,
description: "Define si el componente es se puede resetear"
},
required: {
type: Boolean,
default: !1,
description: "Indica si el campo es requerido"
},
errors: {
type: Array,
required: !1,
default: () => [],
description: "Errores de validación"
},
format: {
type: String,
default: "yyyy-MM-dd",
description: "Formato de fecha"
},
/////////////////
// MISC
////////////////
multi: {
type: Boolean,
default: !1,
description: "Si se establece a `true`, aparecerán dos calendarios"
},
height: {
type: Number,
default: 255,
description: "Si usas el modo `time`,`month` o `year`, establece la altura del componente"
},
label: {
type: String,
required: !1,
default: "",
description: "Etiqueta de definición"
},
placeholder: {
type: String,
default: "Selecciona una fecha",
description: "Texto de ayuda"
},
inline: {
type: Boolean,
default: !1,
description: "Elimina el input y muestra el calendario en línea"
},
status: {
type: String,
default: "",
options: ["warning", "success", "danger"],
description: "Color de estado del input"
},
mode: {
type: String,
default: "auto",
options: M1,
validator: (t) => M1.includes(t),
description: "Modo de visualización del calendario"
},
/////////////////
// INPUT STYLE
////////////////
fieldset: {
type: Boolean,
default: !1,
description: "Aplica el estilo fieldset al input"
},
size: {
type: String,
options: ["xs", "sm", "md", "lg"],
validator: (t) => ["xs", "sm", "md", "lg"].includes(t),
default: "md",
description: "Tamaño del input"
},
/////////////////
// TIME
////////////////
time: {
type: Boolean,
default: !1,
description: "Muestra el selector de hora"
},
/////////////////
// RANGES
////////////////
presets: {
type: [Boolean, Object],
default: !0
},
range: {
type: [Boolean, Number, String],
default: !1
},
minRange: {
type: Number,
default: null,
description: "Mínimo de días que se pueden seleccionar"
},
maxRange: {
type: Number,
default: null,
description: "Máximo de días que se pueden seleccionar"
},
fixedStart: {
type: Boolean,
default: !1
},
fixedEnd: {
type: Boolean,
default: !1
},
/////////////////
// VALIDATIONS
////////////////
minDate: {
type: String,
default: null
},
maxDate: {
type: String,
default: null
}
}, M9 = (t) => {
const e = ["k-datepicker", `k-datepicker-${t.size}`];
return t.fieldset && e.push("k-datepicker-fieldset"), t.errors.length > 0 ? e.push("k-datepicker-danger") : t.status && e.push(`k-datepicker-${t.status}`), e;
}, D9 = be({
name: "KDatepicker",
components: {
Datepicker: Hp
},
autoload: !0,
props: A9,
emits: ["change", "update:modelValue"],
setup(t, e) {
const n = re(), r = re(t.value), i = (m) => !!e.slots[m], o = L({
get() {
return t.modelValue || r.value || "";
},
set(m) {
s(m);
}
}), a = L(() => t.label || i("default")), s = (m) => {
r.value = m, e.emit("update:modelValue", m), e.emit("change", m);
}, u = () => {
n.value.selectDate();
}, l = () => {
r.value = "", s("");
}, c = L(() => typeof t.range == "boolean"), f = L(() => typeof t.range == "number"), d = M9(t), p = L(() => {
const m = {
format: t.format,
modelType: "format",
modeHeight: t.height,
selectText: "Aceptar",
cancelText: "Cancelar",
clearable: t.clearable,
//enableSeconds: true,
locale: "es-ES",
multiCalendars: t.multi,
// MISC
placeholder: t.placeholder,
disabled: t.disabled,
readonly: t.readonly,
required: t.required,
inline: t.inline,
// RANGES
fixedStart: t.fixedStart,
fixedEnd: t.fixedEnd,
minRange: t.range && t.minRange ? t.minRange : void 0,
maxRange: t.range && t.maxRange ? t.maxRange : void 0,
// TIME
enableTimePicker: t.time,
is24: !0,
// VALIDATIONS
minDate: t.minDate,
maxDate: t.maxDate
};
return Array.isArray(t.presets) && t.presets.length === 0 || t.presets === !0 ? m.presetRanges = [
{
label: "Ayer",
range: [
at().subtract(1, "days"),
at().subtract(1, "days")
]
},
{
label: "Hoy",
range: [at(), at()]
},
{
label: "Esta semana",
range: [at().startOf("week"), at()]
},
{
label: "Semana anterior",
range: [
at().subtract(1, "week").startOf("week"),
at().subtract(1, "week").endOf("week")
]
},
{
label: "Este mes",
range: [at().startOf("month"), at()]
},
{
label: "Mes anterior",
range: [
at().subtract(1, "month").startOf("month"),
at().subtract(1, "month").endOf("month")
]
},
{
label: "Este año",
range: [at().startOf("year"), at()]
},
{
label: "Año anterior",
range: [
at().subtract(1, "year").startOf("year"),
at().subtract(1, "year").endOf("year")
]
}
] : t.presets !== !1 && (m.presetRanges = t.presets), c.value ? m.range = t.range : f.value ? (m.range = !0, m.autoRange = t.range) : t.range === "week" && (m.weekPicker = !0), t.mode === "time" ? (m.presetRanges = [], m.timePicker = !0) : t.mode === "month" ? (m.presetRanges = [], m.monthPicker = !0) : t.mode === "year" && (m.presetRanges = [], m.yearPicker = !0), m;
}), h = L(() => (t.errors.length > 0 ? t.errors[0].$message : "").toString());
return {
dp: n,
args: p,
onChange: s,
selectDate: u,
resetDate: l,
value: r,
wrapperClasses: d,
hasSlot: i,
hasLabel: a,
firstError: h,
model: o
};
}
});
const $9 = { key: 0 }, N9 = {
key: 2,
class: "font-bold text-danger ml-1"
}, P9 = { class: "flex flex-row justify-end" };
function I9(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip"), u = he("k-date"), l = he("k-button"), c = he("Datepicker");
return C(), P("div", {
class: se(t.wrapperClasses)
}, [
t.hasLabel ? (C(), P("label", $9, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label), 1)
], 64)),
t.required ? (C(), P("span", N9, "*")) : F("", !0),
t.firstError ? (C(), oe(s, {
key: 3,
content: t.firstError
}, {
default: ne(() => [
J(a, {
icon: "triangle-exclamation",
class: "ml-2"
})
]),
_: 1
}, 8, ["content"])) : F("", !0)
])) : F("", !0),
J(c, dt(t.args, {
ref: "dp",
modelValue: t.model,
"onUpdate:modelValue": e[0] || (e[0] = (f) => t.model = f),
"menu-class-name": "k-datepicker-menu",
"disabled-dates": t.disabledDates
}), {
"input-icon": ne(() => [
J(a, { icon: "calendar" })
]),
"clear-icon": ne(({ clear: f }) => [
J(a, {
icon: "times",
color: "danger",
size: 2,
class: "mt-1",
onClick: f
}, null, 8, ["onClick"])
]),
"clock-icon": ne(() => [
J(a, { icon: "clock" })
]),
"arrow-left": ne(() => [
J(a, { icon: "arrow-left" })
]),
"arrow-right": ne(() => [
J(a, { icon: "arrow-right" })
]),
"arrow-up": ne(() => [
J(a, { icon: "chevron-up" })
]),
"arrow-down": ne(() => [
J(a, { icon: "chevron-down" })
]),
"calendar-icon": ne(() => [
J(a, { icon: "calendar" })
]),
"action-preview": ne(({ value: f }) => [
t.hasSlot("action-preview") ? X(t.$slots, "action-preview", At(dt({ key: 0 }, f))) : (C(), oe(u, {
key: 1,
value: f
}, null, 8, ["value"]))
]),
"action-select": ne(() => [
U("div", P9, [
t.clearable ? (C(), oe(l, {
key: 0,
color: "danger",
icon: "brush",
size: "sm",
title: "Resetear",
class: "ml-2",
onClick: t.resetDate
}, null, 8, ["onClick"])) : F("", !0),
J(l, {
color: "success",
icon: "check",
size: "sm",
title: "Aceptar",
class: "ml-2",
onClick: t.selectDate
}, null, 8, ["onClick"])
])
]),
_: 3
}, 16, ["modelValue", "disabled-dates"])
], 2);
}
const L9 = /* @__PURE__ */ $e(D9, [["render", I9]]), R9 = be({
name: "KSwitch",
autoload: !0,
props: {
modelValue: {
type: Boolean,
default: !1,
description: "Valor del switch"
},
checked: {
type: Boolean,
default: !1,
description: "Valor del switch"
},
disabled: {
type: Boolean,
default: !1,
description: "Desactiva el switch"
},
color: {
type: String,
control: { type: "inline-radio" },
options: Wr,
validator: (t) => Wr.includes(t),
default: "primary",
description: "Color del switch"
},
size: {
type: String,
control: { type: "inline-radio" },
options: ["xs", "sm", "md", "lg", "xl"],
validator: (t) => ["xs", "sm", "md", "lg", "xl"].includes(t),
default: "md",
description: "Tamaño del switch"
}
},
emits: ["update:modelValue", "change"],
setup(t, e) {
const n = (a) => !!e.slots[a], r = (a) => {
e.emit("update:modelValue", a.target.checked), e.emit("change", a.target.checked);
}, i = L({
get() {
return t.modelValue || t.checked;
},
set(a) {
e.emit("update:modelValue", a), e.emit("change", a);
}
}), o = L(() => {
let a = ["v-switch"];
return t.color === "white" || t.color === "black" ? a.push(
"dark:after:bg-gray-300 dark:peer-checked:bg-white dark:peer-focus:ring-white after:bg-white peer-checked:bg-black peer-focus:ring-black"
) : t.color === "gray" ? a.push(
"after:bg-white peer-checked:bg-gray-300 peer-focus:ring-gray-300"
) : t.color === "primary" ? a.push(
"after:bg-white peer-checked:bg-primary peer-focus:ring-primary"
) : t.color === "secondary" ? a.push(
"after:bg-white peer-checked:bg-secondary peer-focus:ring-secondary"
) : t.color === "success" ? a.push(
"after:bg-white peer-checked:bg-success peer-focus:ring-success"
) : t.color === "warning" ? a.push(
"after:bg-white peer-checked:bg-warning peer-focus:ring-warning"
) : t.color === "danger" ? a.push(
"after:bg-white peer-checked:bg-danger peer-focus:ring-danger"
) : t.color === "info" && a.push(
"after:bg-white peer-checked:bg-info peer-focus:ring-info"
), t.size === "xs" ? a.push(
"w-7 h-4 after:h-3 after:w-3 after:top-[4px] after:left-[2px]"
) : t.size === "sm" ? a.push(
"w-9 h-5 after:h-4 after:w-4 after:top-[2px] after:left-[2px] "
) : t.size === "md" ? a.push(
"w-11 h-6 after:h-5 after:w-5 after:top-[2px] after:left-[2px]"
) : t.size === "lg" ? a.push(
"w-14 h-7 after:h-6 after:w-6 after:top-[2px] after:left-[5px]"
) : t.size === "xl" && a.push(
"w-16 h-8 after:h-7 after:w-7 after:top-0.5 after:left-[5px] "
), a;
});
return { hasSlot: n, onChange: r, classes: o, model: i };
}
}), B9 = { class: "flex items-center" }, V9 = ["checked", "disabled"];
function z9(t, e, n, r, i, o) {
return C(), P("div", B9, [
U("label", {
class: se(["relative inline-flex items-center select-none", {
"cursor-pointer": !t.disabled,
"cursor-not-allowed": t.disabled
}])
}, [
U("input", {
type: "checkbox",
value: "",
class: "sr-only peer",
checked: t.model,
disabled: t.disabled,
onChange: e[0] || (e[0] = (...a) => t.onChange && t.onChange(...a))
}, null, 40, V9),
U("div", {
class: se(["bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:border-gray-300 after:border after:rounded-full after:transition-all dark:border-gray-600", t.classes])
}, null, 2),
t.hasSlot("default") ? (C(), P("span", {
key: 0,
class: se(["ml-3 text-sm font-medium text-gray-900 dark:text-gray-300 whitespace-nowrap", { "opacity-60": t.disabled }])
}, [
X(t.$slots, "default")
], 2)) : F("", !0)
], 2)
]);
}
const H9 = /* @__PURE__ */ $e(R9, [["render", z9]]), q9 = be({
name: "KInput",
props: {
modelValue: {
type: [String, Number],
required: !1,
default: "",
description: "Valor del input"
},
id: {
type: String,
required: !1,
default: "",
description: "ID único"
},
maxlength: {
type: Number,
required: !1,
default: 0,
description: "Longitud máxima"
},
placeholder: {
type: String,
required: !1,
default: "",
description: "Texto explicativo"
},
required: {
type: Boolean,
default: !1,
description: "Indica si el campo es requerido"
},
label: {
type: String,
required: !1,
default: "",
description: "Etiqueta de definición"
},
size: {
type: String,
default: "md",
options: ["xs", "sm", "md", "lg"]
},
errors: {
type: Array,
required: !1,
default: () => [],
description: "Errores de validación"
},
status: {
type: String,
default: "",
options: ["warning", "success", "danger"],
description: "Color de estado del input"
},
disabled: {
type: Boolean,
default: !1,
description: "Indica si el control está deshabilitado"
},
width: {
type: Number,
default: 0,
description: "Ancho del control"
},
minHeight: {
type: Number,
default: 0,
description: "Altura mínima del control"
},
autocomplete: {
type: String,
default: "off",
description: "Indica si el input tiene autocompletado"
}
},
emits: ["update:modelValue"],
setup(t, e) {
const n = t.maxlength > 0 ? t.maxlength : void 0, r = t.id || on(), i = (f) => !!e.slots[f], o = L({
get() {
return t.modelValue;
},
set(f) {
e.emit("update:modelValue", f);
}
}), a = L(() => {
const f = [
"k-input-textarea",
`k-input-textarea-${t.size}`
];
return t.errors.length > 0 ? f.push("k-input-textarea-danger") : t.status && f.push(`k-input-textarea-${t.status}`), f;
}), s = L(() => {
const f = {};
return t.width > 0 && (f.width = `${t.width}px`), t.minHeight > 0 && (f.minHeight = `${t.minHeight}px`), f;
}), u = L(() => t.label || i("default")), l = (f) => {
o.value = f.target.value;
}, c = L(() => (t.errors.length > 0 ? t.errors[0].$message : "").toString());
return {
maxLength: n,
uuid: r,
classes: a,
change: l,
firstError: c,
hasSlot: i,
hasLabel: u,
model: o,
style: s
};
}
});
const F9 = ["for"], j9 = {
key: 2,
class: "font-bold text-danger ml-1"
}, U9 = ["disabled", "maxlength", "placeholder", "required", "autocomplete"];
function W9(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip");
return C(), P("div", {
class: se(t.classes)
}, [
t.hasLabel ? (C(), P("label", {
key: 0,
for: t.uuid
}, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label), 1)
], 64)),
t.required ? (C(), P("span", j9, "*")) : F("", !0),
t.firstError ? (C(), oe(s, {
key: 3,
hover: "",
content: t.firstError
}, {
default: ne(() => [
J(a, {
icon: "triangle-exclamation",
class: "ml-2"
})
]),
_: 1
}, 8, ["content"])) : F("", !0)
], 8, F9)) : F("", !0),
Qe(U("textarea", {
"onUpdate:modelValue": e[0] || (e[0] = (u) => t.model = u),
disabled: t.disabled,
maxlength: t.maxLength,
placeholder: t.placeholder,
required: t.required,
style: Xe(t.style),
autocomplete: t.autocomplete
}, `
`, 12, U9), [
[ap, t.model]
])
], 2);
}
const Y9 = /* @__PURE__ */ $e(q9, [["render", W9]]), K9 = be({
name: "KCheckbox",
props: {
modelValue: {
type: [String, Number, Boolean, Object, Array, Symbol],
default: !1
},
value: {
type: [String, Number, Boolean, Object, Array, Symbol],
default: !0
},
unckeckedValue: {
type: [String, Number, Boolean, Object, Array, Symbol],
default: !1
},
label: {
type: String,
default: ""
},
color: {
type: String,
control: { type: "inline-radio" },
options: Wr,
validator: (t) => Wr.includes(t),
default: "primary",
description: "Color del botón"
},
required: {
type: Boolean,
default: !1
}
},
emits: ["update:modelValue"],
setup(t, e) {
const n = on(), r = (s) => !!e.slots[s], i = L(() => {
let s = [];
return t.color === "white" || t.color === "black" ? s.push(
"text-black focus:ring-black dark:focus:ring-white dark:text-black k-checkbox-inverse"
) : t.color === "gray" ? s.push(
"text-gray-300 focus:ring-gray-300 dark:focus:ring-gray-300"
) : t.color === "primary" ? s.push(
"text-primary focus:ring-primary dark:focus:ring-primary"
) : t.color === "secondary" ? s.push(
"text-secondary focus:ring-secondary dark:focus:ring-secondary"
) : t.color === "success" ? s.push(
"text-success focus:ring-success dark:focus:ring-success"
) : t.color === "warning" ? s.push(
"text-warning focus:ring-warning dark:focus:ring-warning"
) : t.color === "danger" ? s.push(
"text-danger focus:ring-danger dark:focus:ring-danger"
) : t.color === "info" && s.push(
"text-info focus:ring-info dark:focus:ring-info"
), s;
}), o = (s) => {
a.value = s.target.checked ? t.value : t.unckeckedValue;
}, a = L({
get() {
return t.modelValue;
},
set(s) {
e.emit("update:modelValue", s);
}
});
return { model: a, hasSlot: r, inputId: n, classes: i, change: o };
}
});
const G9 = { class: "flex items-center" }, J9 = ["id", "checked", "required", "value"], X9 = ["for"];
function Q9(t, e, n, r, i, o) {
return C(), P("div", G9, [
U("input", {
id: t.inputId,
checked: t.model === t.value,
required: t.required,
value: t.value,
type: "checkbox",
class: se(["k-checkbox w-4 h-4 border-gray-300 rounded dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600", t.classes]),
onChange: e[0] || (e[0] = (...a) => t.change && t.change(...a))
}, null, 42, J9),
t.label || t.hasSlot("default") ? (C(), P("label", {
key: 0,
for: t.inputId,
class: "ml-2 text-sm font-medium text-gray-900 dark:text-gray-300 select-none"
}, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }, void 0, !0) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label), 1)
], 64))
], 8, X9)) : F("", !0)
]);
}
const Z9 = /* @__PURE__ */ $e(K9, [["render", Q9], ["__scopeId", "data-v-e3d49020"]]), eM = {
modelValue: {
type: String,
default: ""
},
id: {
type: [Number, String],
default: ""
},
maxSize: {
type: Number,
default: 5
},
accept: {
type: Array,
default: () => ["jpg", "jpeg", "png", "gif", "webp", "pdf"]
},
removable: {
type: Boolean,
default: !0
},
loading: {
type: Boolean,
default: !1
},
disabled: {
type: Boolean,
default: !1
},
required: {
type: Boolean,
default: !1
},
label: {
type: String,
default: ""
},
size: {
type: String,
default: "md",
options: ["xs", "sm", "md", "lg"]
}
}, tM = be({
name: "KDropzone",
props: eM,
emits: ["delete", "upload", "update:modelValue"],
setup(t, e) {
const n = on(), r = (k) => !!e.slots[k], i = re([]), o = re(!1), a = re({
name: "",
size: 0,
type: "",
fileExtention: "",
url: "",
isImage: !1
}), s = re(!1), u = L(() => t.accept.map((k) => "." + k.toLowerCase()).join(",")), l = L(() => t.accept.map((k) => k.toLowerCase()).join(", ")), c = L(() => {
if (!t.modelValue)
return !1;
const k = (t.modelValue.split(".").pop() || "").split("?")[0], T = [
"jpg",
"jpeg",
"png",
"gif",
"webp",
"svg"
], b = T.includes(
a.value.fileExtention
), D = T.includes(k);
return b || D;
}), f = (k) => {
if (k.target.files && k.target.files[0]) {
i.value = [];
const T = k.target.files[0];
if (m(T)) {
o.value = !0;
const b = Math.round(T.size / 1024 / 1024 * 100) / 100, D = T.name.split(".").pop(), x = T.name.split(".").shift(), S = [
"jpg",
"jpeg",
"png",
"gif",
"webp",
"svg"
].includes(D);
let _ = new FileReader();
_.readAsDataURL(T), _.onload = function() {
a.value = {
name: x,
size: b,
type: T.type,
fileExtention: D,
isImage: S,
url: _.result ? _.result.toString() : ""
}, e.emit("update:modelValue", a.value.url), e.emit("upload", T), o.value = !1;
};
} else
d(!1, !1);
}
}, d = (k = !1, T = !1) => {
const b = structuredClone(t.modelValue);
a.value = {
name: "",
size: 0,
type: "",
fileExtention: "",
url: "",
isImage: !1
}, e.emit("update:modelValue", ""), T && e.emit("delete", b), k && (i.value = []), setTimeout(() => {
s.value = !1;
}, 300);
}, p = (k) => {
k > t.maxSize && i.value.push(
`El fichero debe pesar menos de ${t.maxSize} MB`
);
}, h = (k) => {
t.accept.map((T) => T.toLowerCase()).includes(k.toLowerCase()) || i.value.push(
`Extensión inválida. Los ficheros soportados son: ${t.accept}`
);
}, m = (k) => (p(
Math.round(k.size / 1024 / 1024 * 100) / 100
), h(k.name.split(".").pop() || ""), i.value.length === 0), v = L(() => o.value || t.loading), y = L(() => t.label || r("default"));
return Ct(
() => t.id,
() => {
a.value.name = "";
}
), {
id: n,
file: a,
hasSlot: r,
validExtensions: u,
textensions: l,
onFileChange: f,
errors: i,
onFileReset: d,
isModelValueImage: c,
hasLabel: y,
locked: s,
isLoading: v
};
}
});
const nM = (t) => (Gb("data-v-b697fe62"), t = t(), Jb(), t), rM = { class: "k-dropzone" }, iM = {
key: 0,
class: "k-dropzone-label"
}, oM = {
key: 2,
class: "font-bold text-danger ml-1"
}, aM = ["for"], sM = {
key: 0,
class: "flex flex-col max-w-full items-center justify-center pt-5 pb-6"
}, uM = {
key: 1,
class: "absolute top-0 left-0 h-full w-full bg-opacity-60 bg-gray-900 z-20 flex items-center justify-center text-white"
}, lM = {
key: 0,
class: "text-sm flex text-center flex-col px-5 whitespace-nowrap w-full"
}, cM = { class: "uppercase text-ellipsis overflow-hidden text-gray-800 dark:text-gray-100 px-3" }, dM = { class: "font-semibold text-gray-700 dark:text-gray-300" }, fM = {
key: 1,
class: "flex flex-col items-center justify-center pt-5 pb-6"
}, pM = { class: "text-center" }, hM = { class: "mb-2 text-sm text-gray-500 dark:text-gray-400 text-center" }, mM = /* @__PURE__ */ nM(() => /* @__PURE__ */ U("span", { class: "font-semibold" }, "Haz click", -1)), gM = { class: "text-xs text-gray-500 dark:text-gray-400" }, bM = {
key: 1,
class: "flex text-center flex-col"
}, vM = { class: "uppercase" }, yM = { class: "font-semibold" }, wM = ["id", "accept", "disabled"];
function kM(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip"), u = he("k-button");
return C(), P("div", rM, [
U("div", {
class: se(["k-dropzone-wrapper", {
"k-dropzone--loading": t.loading,
"k-dropzone--error": t.errors.length > 0,
"k-dropzone--disabled": t.disabled,
[`k-dropzone-${t.size}`]: !0
}])
}, [
t.hasLabel ? (C(), P("label", iM, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }, void 0, !0) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label), 1)
], 64)),
t.required ? (C(), P("span", oM, "*")) : F("", !0),
t.errors.length > 0 ? (C(), oe(s, {
key: 3,
content: t.errors[0]
}, {
default: ne(() => [
J(a, {
icon: "triangle-exclamation",
class: "ml-2"
})
]),
_: 1
}, 8, ["content"])) : F("", !0)
])) : F("", !0),
U("label", {
for: t.locked ? "" : t.id,
class: se(["k-dropzone-input", {
"k-dropzone--loading": t.isLoading,
"k-dropzone--error": t.errors.length > 0,
"k-dropzone--disabled": t.disabled
}]),
style: Xe({
background: t.isModelValueImage ? `url('${t.modelValue}') no-repeat center center` : "",
"background-size": "cover"
})
}, [
t.modelValue || t.isLoading ? (C(), P("div", sM, [
t.isLoading ? F("", !0) : (C(), oe(u, {
key: 0,
size: "xs",
icon: "times",
color: "gray",
class: "absolute top-0 right-0 m-2 z-20",
onClick: e[0] || (e[0] = (l) => t.onFileReset(!0, !0)),
onMouseover: e[1] || (e[1] = (l) => t.locked = !0),
onMouseout: e[2] || (e[2] = (l) => t.locked = !1)
})),
t.isLoading ? (C(), P("div", uM, [
J(a, {
icon: "spinner-third",
type: "fas",
size: 30,
spin: ""
})
])) : F("", !0),
U("div", {
class: se(["text-sm flex justify-center max-w-full flex-col font-semibold text-center uppercase z-10 absolute top-0 left-0 w-full h-full transition-all", {
"opacity-0 hover:opacity-100 hover:bg-opacity-50 hover:dark:bg-opacity-50 hover:bg-gray-100 hover:dark:bg-gray-900": t.isModelValueImage,
"bg-gray-200 dark:bg-gray-700 ": !t.isModelValueImage
}])
}, [
X(t.$slots, "selectedFile", At(hn({ name: t.file.name, size: t.file.size })), () => [
J(a, {
icon: "file",
type: "far",
size: 60,
class: "mb-3 text-gray-800 dark:text-gray-100"
}),
t.file.name ? (C(), P("div", lM, [
U("span", cM, Se(t.file.name), 1),
U("span", dM, Se(t.file.size) + "MB ", 1)
])) : F("", !0)
], !0)
], 2)
])) : (C(), P("div", fM, [
t.errors.length > 0 ? (C(), oe(s, { key: 0 }, {
content: ne(() => [
U("div", pM, Se(t.errors[0]), 1)
]),
default: ne(() => [
J(a, {
icon: "triangle-exclamation",
type: "far",
size: 30,
class: "text-danger mb-3"
})
]),
_: 1
})) : (C(), oe(a, {
key: 1,
icon: "upload",
type: "far",
size: 30,
class: "text-gray-400 mb-3"
})),
U("p", hM, [
X(t.$slots, "placeholder", {}, () => [
mM,
Oe(" o arrastra tus ficheros ")
], !0)
]),
U("p", gM, [
t.hasSlot("maxSize") ? X(t.$slots, "maxSize", { key: 0 }, () => [
Oe(Se(t.maxSize) + " MB ", 1)
], !0) : (C(), P("div", bM, [
U("div", vM, Se(t.textensions), 1),
U("div", yM, " (" + Se(t.maxSize) + "MB MAX) ", 1)
]))
])
])),
U("input", {
id: t.id,
type: "file",
class: "hidden",
accept: t.validExtensions,
disabled: t.disabled,
onclick: "this.value=null;",
onChange: e[3] || (e[3] = (l) => t.onFileChange(l))
}, null, 40, wM)
], 14, aM)
], 2)
]);
}
const xM = /* @__PURE__ */ $e(tM, [["render", kM], ["__scopeId", "data-v-b697fe62"]]);
function Xd(t) {
return t === 0 ? !1 : Array.isArray(t) && t.length === 0 ? !0 : !t;
}
function SM(t) {
return (...e) => !t(...e);
}
function EM(t, e) {
return t === void 0 && (t = "undefined"), t === null && (t = "null"), t === !1 && (t = "false"), t.toString().toLowerCase().indexOf(e.trim()) !== -1;
}
function h2(t, e, n, r) {
return e ? t.filter((i) => EM(r(i, n), e)).sort((i, o) => r(i, n).length - r(o, n).length) : t;
}
function _M(t) {
return t.filter((e) => !e.$isLabel);
}
function Qd(t, e) {
return (n) => n.reduce((r, i) => i[t] && i[t].length ? (r.push({
$groupLabel: i[e],
$isLabel: !0
}), r.concat(i[t])) : r, []);
}
function TM(t, e, n, r, i) {
return (o) => o.map((a) => {
if (!a[n])
return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."), [];
const s = h2(a[n], t, e, i);
return s.length ? {
[r]: a[r],
[n]: s
} : [];
});
}
const D1 = (...t) => (e) => t.reduce((n, r) => r(n), e);
var CM = {
data() {
return {
search: "",
isOpen: !1,
preferredOpenDirection: "below",
optimizedHeight: this.maxHeight
};
},
props: {
/**
* Decide whether to filter the results based on search query.
* Useful for async filtering, where we search through more complex data.
* @type {Boolean}
*/
internalSearch: {
type: Boolean,
default: !0
},
/**
* Array of available options: Objects, Strings or Integers.
* If array of objects, visible label will default to option.label.
* If `labal` prop is passed, label will equal option['label']
* @type {Array}
*/
options: {
type: Array,
required: !0
},
/**
* Equivalent to the `multiple` attribute on a `<select>` input.
* @default false
* @type {Boolean}
*/
multiple: {
type: Boolean,
default: !1
},
/**
* Key to compare objects
* @default 'id'
* @type {String}
*/
trackBy: {
type: String
},
/**
* Label to look for in option Object
* @default 'label'
* @type {String}
*/
label: {
type: String
},
/**
* Enable/disable search in options
* @default true
* @type {Boolean}
*/
searchable: {
type: Boolean,
default: !0
},
/**
* Clear the search input after `)
* @default true
* @type {Boolean}
*/
clearOnSelect: {
type: Boolean,
default: !0
},
/**
* Hide already selected options
* @default false
* @type {Boolean}
*/
hideSelected: {
type: Boolean,
default: !1
},
/**
* Equivalent to the `placeholder` attribute on a `<select>` input.
* @default 'Select option'
* @type {String}
*/
placeholder: {
type: String,
default: "Select option"
},
/**
* Allow to remove all selected values
* @default true
* @type {Boolean}
*/
allowEmpty: {
type: Boolean,
default: !0
},
/**
* Reset this.internalValue, this.search after this.internalValue changes.
* Useful if want to create a stateless dropdown.
* @default false
* @type {Boolean}
*/
resetAfter: {
type: Boolean,
default: !1
},
/**
* Enable/disable closing after selecting an option
* @default true
* @type {Boolean}
*/
closeOnSelect: {
type: Boolean,
default: !0
},
/**
* Function to interpolate the custom label
* @default false
* @type {Function}
*/
customLabel: {
type: Function,
default(t, e) {
return Xd(t) ? "" : e ? t[e] : t;
}
},
/**
* Disable / Enable tagging
* @default false
* @type {Boolean}
*/
taggable: {
type: Boolean,
default: !1
},
/**
* String to show when highlighting a potential tag
* @default 'Press enter to create a tag'
* @type {String}
*/
tagPlaceholder: {
type: String,
default: "Press enter to create a tag"
},
/**
* By default new tags will appear above the search results.
* Changing to 'bottom' will revert this behaviour
* and will proritize the search results
* @default 'top'
* @type {String}
*/
tagPosition: {
type: String,
default: "top"
},
/**
* Number of allowed selected options. No limit if 0.
* @default 0
* @type {Number}
*/
max: {
type: [Number, Boolean],
default: !1
},
/**
* Will be passed with all events as second param.
* Useful for identifying events origin.
* @default null
* @type {String|Integer}
*/
id: {
default: null
},
/**
* Limits the options displayed in the dropdown
* to the first X options.
* @default 1000
* @type {Integer}
*/
optionsLimit: {
type: Number,
default: 1e3
},
/**
* Name of the property containing
* the group values
* @default 1000
* @type {String}
*/
groupValues: {
type: String
},
/**
* Name of the property containing
* the group label
* @default 1000
* @type {String}
*/
groupLabel: {
type: String
},
/**
* Allow to select all group values
* by selecting the group label
* @default false
* @type {Boolean}
*/
groupSelect: {
type: Boolean,
default: !1
},
/**
* Array of keyboard keys to block
* when selecting
* @default 1000
* @type {String}
*/
blockKeys: {
type: Array,
default() {
return [];
}
},
/**
* Prevent from wiping up the search value
* @default false
* @type {Boolean}
*/
preserveSearch: {
type: Boolean,
default: !1
},
/**
* Select 1st options if value is empty
* @default false
* @type {Boolean}
*/
preselectFirst: {
type: Boolean,
default: !1
},
/**
* Prevent autofocus
* @default false
* @type {Boolean}
*/
preventAutofocus: {
type: Boolean,
default: !1
}
},
mounted() {
!this.multiple && this.max && console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false."), this.preselectFirst && !this.internalValue.length && this.options.length && this.select(this.filteredOptions[0]);
},
computed: {
internalValue() {
return this.modelValue || this.modelValue === 0 ? Array.isArray(this.modelValue) ? this.modelValue : [this.modelValue] : [];
},
filteredOptions() {
const t = this.search || "", e = t.toLowerCase().trim();
let n = this.options.concat();
return this.internalSearch ? n = this.groupValues ? this.filterAndFlat(n, e, this.label) : h2(n, e, this.label, this.customLabel) : n = this.groupValues ? Qd(this.groupValues, this.groupLabel)(n) : n, n = this.hideSelected ? n.filter(SM(this.isSelected)) : n, this.taggable && e.length && !this.isExistingOption(e) && (this.tagPosition === "bottom" ? n.push({ isTag: !0, label: t }) : n.unshift({ isTag: !0, label: t })), n.slice(0, this.optionsLimit);
},
valueKeys() {
return this.trackBy ? this.internalValue.map((t) => t[this.trackBy]) : this.internalValue;
},
optionKeys() {
return (this.groupValues ? this.flatAndStrip(this.options) : this.options).map((e) => this.customLabel(e, this.label).toString().toLowerCase());
},
currentOptionLabel() {
return this.multiple ? this.searchable ? "" : this.placeholder : this.internalValue.length ? this.getOptionLabel(this.internalValue[0]) : this.searchable ? "" : this.placeholder;
}
},
watch: {
internalValue: {
handler() {
this.resetAfter && this.internalValue.length && (this.search = "", this.$emit("update:modelValue", this.multiple ? [] : null));
},
deep: !0
},
search() {
this.$emit("search-change", this.search);
}
},
emits: ["open", "search-change", "close", "select", "update:modelValue", "remove", "tag"],
methods: {
/**
* Returns the internalValue in a way it can be emited to the parent
* @returns {Object||Array||String||Integer}
*/
getValue() {
return this.multiple ? this.internalValue : this.internalValue.length === 0 ? null : this.internalValue[0];
},
/**
* Filters and then flattens the options list
* @param {Array}
* @return {Array} returns a filtered and flat options list
*/
filterAndFlat(t, e, n) {
return D1(
TM(e, n, this.groupValues, this.groupLabel, this.customLabel),
Qd(this.groupValues, this.groupLabel)
)(t);
},
/**
* Flattens and then strips the group labels from the options list
* @param {Array}
* @return {Array} returns a flat options list without group labels
*/
flatAndStrip(t) {
return D1(
Qd(this.groupValues, this.groupLabel),
_M
)(t);
},
/**
* Updates the search value
* @param {String}
*/
updateSearch(t) {
this.search = t;
},
/**
* Finds out if the given query is already present
* in the available options
* @param {String}
* @return {Boolean} returns true if element is available
*/
isExistingOption(t) {
return this.options ? this.optionKeys.indexOf(t) > -1 : !1;
},
/**
* Finds out if the given element is already present
* in the result value
* @param {Object||String||Integer} option passed element to check
* @returns {Boolean} returns true if element is selected
*/
isSelected(t) {
const e = this.trackBy ? t[this.trackBy] : t;
return this.valueKeys.indexOf(e) > -1;
},
/**
* Finds out if the given option is disabled
* @param {Object||String||Integer} option passed element to check
* @returns {Boolean} returns true if element is disabled
*/
isOptionDisabled(t) {
return !!t.$isDisabled;
},
/**
* Returns empty string when options is null/undefined
* Returns tag query if option is tag.
* Returns the customLabel() results and casts it to string.
*
* @param {Object||String||Integer} Passed option
* @returns {Object||String}
*/
getOptionLabel(t) {
if (Xd(t))
return "";
if (t.isTag)
return t.label;
if (t.$isLabel)
return t.$groupLabel;
const e = this.customLabel(t, this.label);
return Xd(e) ? "" : e;
},
/**
* Add the given option to the list of selected options
* or sets the option as the selected option.
* If option is already selected -> remove it from the results.
*
* @param {Object||String||Integer} option to select/deselect
* @param {Boolean} block removing
*/
select(t, e) {
if (t.$isLabel && this.groupSelect) {
this.selectGroup(t);
return;
}
if (!(this.blockKeys.indexOf(e) !== -1 || this.disabled || t.$isDisabled || t.$isLabel) && !(this.max && this.multiple && this.internalValue.length === this.max) && !(e === "Tab" && !this.pointerDirty)) {
if (t.isTag)
this.$emit("tag", t.label, this.id), this.search = "", this.closeOnSelect && !this.multiple && this.deactivate();
else {
if (this.isSelected(t)) {
e !== "Tab" && this.removeElement(t);
return;
}
this.multiple ? this.$emit("update:modelValue", this.internalValue.concat([t])) : this.$emit("update:modelValue", t), this.$emit("select", t, this.id), this.clearOnSelect && (this.search = "");
}
this.closeOnSelect && this.deactivate();
}
},
/**
* Add the given group options to the list of selected options
* If all group optiona are already selected -> remove it from the results.
*
* @param {Object||String||Integer} group to select/deselect
*/
selectGroup(t) {
const e = this.options.find((n) => n[this.groupLabel] === t.$groupLabel);
if (e) {
if (this.wholeGroupSelected(e)) {
this.$emit("remove", e[this.groupValues], this.id);
const n = this.internalValue.filter(
(r) => e[this.groupValues].indexOf(r) === -1
);
this.$emit("update:modelValue", n);
} else {
let n = e[this.groupValues].filter(
(r) => !(this.isOptionDisabled(r) || this.isSelected(r))
);
this.max && n.splice(this.max - this.internalValue.length), this.$emit("select", n, this.id), this.$emit(
"update:modelValue",
this.internalValue.concat(n)
);
}
this.closeOnSelect && this.deactivate();
}
},
/**
* Helper to identify if all values in a group are selected
*
* @param {Object} group to validated selected values against
*/
wholeGroupSelected(t) {
return t[this.groupValues].every(
(e) => this.isSelected(e) || this.isOptionDisabled(e)
);
},
/**
* Helper to identify if all values in a group are disabled
*
* @param {Object} group to check for disabled values
*/
wholeGroupDisabled(t) {
return t[this.groupValues].every(this.isOptionDisabled);
},
/**
* Removes the given option from the selected options.
* Additionally checks this.allowEmpty prop if option can be removed when
* it is the last selected option.
*
* @param {type} option description
* @return {type} description
*/
removeElement(t, e = !0) {
if (this.disabled || t.$isDisabled)
return;
if (!this.allowEmpty && this.internalValue.length <= 1) {
this.deactivate();
return;
}
const n = typeof t == "object" ? this.valueKeys.indexOf(t[this.trackBy]) : this.valueKeys.indexOf(t);
if (this.multiple) {
const r = this.internalValue.slice(0, n).concat(this.internalValue.slice(n + 1));
this.$emit("update:modelValue", r);
} else
this.$emit("update:modelValue", null);
this.$emit("remove", t, this.id), this.closeOnSelect && e && this.deactivate();
},
/**
* Calls this.removeElement() with the last element
* from this.internalValue (selected element Array)
*
* @fires this#removeElement
*/
removeLastElement() {
this.blockKeys.indexOf("Delete") === -1 && this.search.length === 0 && Array.isArray(this.internalValue) && this.internalValue.length && this.removeElement(this.internalValue[this.internalValue.length - 1], !1);
},
/**
* Opens the multiselect’s dropdown.
* Sets this.isOpen to TRUE
*/
activate() {
this.isOpen || this.disabled || (this.adjustPosition(), this.groupValues && this.pointer === 0 && this.filteredOptions.length && (this.pointer = 1), this.isOpen = !0, this.searchable ? (this.preserveSearch || (this.search = ""), this.preventAutofocus || this.$nextTick(() => this.$refs.search && this.$refs.search.focus())) : this.preventAutofocus || typeof this.$el < "u" && this.$el.focus(), this.$emit("open", this.id));
},
/**
* Closes the multiselect’s dropdown.
* Sets this.isOpen to FALSE
*/
deactivate() {
this.isOpen && (this.isOpen = !1, this.searchable ? typeof this.$refs.search < "u" && this.$refs.search.blur() : typeof this.$el < "u" && this.$el.blur(), this.preserveSearch || (this.search = ""), this.$emit("close", this.getValue(), this.id));
},
/**
* Call this.activate() or this.deactivate()
* depending on this.isOpen value.
*
* @fires this#activate || this#deactivate
* @property {Boolean} isOpen indicates if dropdown is open
*/
toggle() {
this.isOpen ? this.deactivate() : this.activate();
},
/**
* Updates the hasEnoughSpace variable used for
* detecting where to expand the dropdown
*/
adjustPosition() {
if (typeof window > "u")
return;
const t = this.$el.getBoundingClientRect().top, e = window.innerHeight - this.$el.getBoundingClientRect().bottom;
e > this.maxHeight || e > t || this.openDirection === "below" || this.openDirection === "bottom" ? (this.preferredOpenDirection = "below", this.optimizedHeight = Math.min(e - 40, this.maxHeight)) : (this.preferredOpenDirection = "above", this.optimizedHeight = Math.min(t - 40, this.maxHeight));
}
}
}, OM = {
data() {
return {
pointer: 0,
pointerDirty: !1
};
},
props: {
/**
* Enable/disable highlighting of the pointed value.
* @type {Boolean}
* @default true
*/
showPointer: {
type: Boolean,
default: !0
},
optionHeight: {
type: Number,
default: 40
}
},
computed: {
pointerPosition() {
return this.pointer * this.optionHeight;
},
visibleElements() {
return this.optimizedHeight / this.optionHeight;
}
},
watch: {
filteredOptions() {
this.pointerAdjust();
},
isOpen() {
this.pointerDirty = !1;
},
pointer() {
this.$refs.search && this.$refs.search.setAttribute("aria-activedescendant", this.id + "-" + this.pointer.toString());
}
},
methods: {
optionHighlight(t, e) {
return {
"multiselect__option--highlight": t === this.pointer && this.showPointer,
"multiselect__option--selected": this.isSelected(e)
};
},
groupHighlight(t, e) {
if (!this.groupSelect)
return [
"multiselect__option--disabled",
{ "multiselect__option--group": e.$isLabel }
];
const n = this.options.find((r) => r[this.groupLabel] === e.$groupLabel);
return n && !this.wholeGroupDisabled(n) ? [
"multiselect__option--group",
{ "multiselect__option--highlight": t === this.pointer && this.showPointer },
{ "multiselect__option--group-selected": this.wholeGroupSelected(n) }
] : "multiselect__option--disabled";
},
addPointerElement({ key: t } = "Enter") {
this.filteredOptions.length > 0 && this.select(this.filteredOptions[this.pointer], t), this.pointerReset();
},
pointerForward() {
this.pointer < this.filteredOptions.length - 1 && (this.pointer++, this.$refs.list.scrollTop <= this.pointerPosition - (this.visibleElements - 1) * this.optionHeight && (this.$refs.list.scrollTop = this.pointerPosition - (this.visibleElements - 1) * this.optionHeight), this.filteredOptions[this.pointer] && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerForward()), this.pointerDirty = !0;
},
pointerBackward() {
this.pointer > 0 ? (this.pointer--, this.$refs.list.scrollTop >= this.pointerPosition && (this.$refs.list.scrollTop = this.pointerPosition), this.filteredOptions[this.pointer] && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerBackward()) : this.filteredOptions[this.pointer] && this.filteredOptions[0].$isLabel && !this.groupSelect && this.pointerForward(), this.pointerDirty = !0;
},
pointerReset() {
this.closeOnSelect && (this.pointer = 0, this.$refs.list && (this.$refs.list.scrollTop = 0));
},
pointerAdjust() {
this.pointer >= this.filteredOptions.length - 1 && (this.pointer = this.filteredOptions.length ? this.filteredOptions.length - 1 : 0), this.filteredOptions.length > 0 && this.filteredOptions[this.pointer].$isLabel && !this.groupSelect && this.pointerForward();
},
pointerSet(t) {
this.pointer = t, this.pointerDirty = !0;
}
}
}, m2 = {
name: "vue-multiselect",
mixins: [CM, OM],
compatConfig: {
MODE: 3,
ATTR_ENUMERATED_COERCION: !1
},
props: {
/**
* name attribute to match optional label element
* @default ''
* @type {String}
*/
name: {
type: String,
default: ""
},
/**
* Presets the selected options value.
* @type {Object||Array||String||Integer}
*/
modelValue: {
type: null,
default() {
return [];
}
},
/**
* String to show when pointing to an option
* @default 'Press enter to select'
* @type {String}
*/
selectLabel: {
type: String,
default: "Press enter to select"
},
/**
* String to show when pointing to an option
* @default 'Press enter to select'
* @type {String}
*/
selectGroupLabel: {
type: String,
default: "Press enter to select group"
},
/**
* String to show next to selected option
* @default 'Selected'
* @type {String}
*/
selectedLabel: {
type: String,
default: "Selected"
},
/**
* String to show when pointing to an already selected option
* @default 'Press enter to remove'
* @type {String}
*/
deselectLabel: {
type: String,
default: "Press enter to remove"
},
/**
* String to show when pointing to an already selected option
* @default 'Press enter to remove'
* @type {String}
*/
deselectGroupLabel: {
type: String,
default: "Press enter to deselect group"
},
/**
* Decide whether to show pointer labels
* @default true
* @type {Boolean}
*/
showLabels: {
type: Boolean,
default: !0
},
/**
* Limit the display of selected options. The rest will be hidden within the limitText string.
* @default 99999
* @type {Integer}
*/
limit: {
type: Number,
default: 99999
},
/**
* Sets maxHeight style value of the dropdown
* @default 300
* @type {Integer}
*/
maxHeight: {
type: Number,
default: 300
},
/**
* Function that process the message shown when selected
* elements pass the defined limit.
* @default 'and * more'
* @param {Int} count Number of elements more than limit
* @type {Function}
*/
limitText: {
type: Function,
default: (t) => `and ${t} more`
},
/**
* Set true to trigger the loading spinner.
* @default False
* @type {Boolean}
*/
loading: {
type: Boolean,
default: !1
},
/**
* Disables the multiselect if true.
* @default false
* @type {Boolean}
*/
disabled: {
type: Boolean,
default: !1
},
/**
* Fixed opening direction
* @default ''
* @type {String}
*/
openDirection: {
type: String,
default: ""
},
/**
* Shows slot with message about empty options
* @default true
* @type {Boolean}
*/
showNoOptions: {
type: Boolean,
default: !0
},
showNoResults: {
type: Boolean,
default: !0
},
tabindex: {
type: Number,
default: 0
}
},
computed: {
hasOptionGroup() {
return this.groupValues && this.groupLabel && this.groupSelect;
},
isSingleLabelVisible() {
return (this.singleValue || this.singleValue === 0) && (!this.isOpen || !this.searchable) && !this.visibleValues.length;
},
isPlaceholderVisible() {
return !this.internalValue.length && (!this.searchable || !this.isOpen);
},
visibleValues() {
return this.multiple ? this.internalValue.slice(0, this.limit) : [];
},
singleValue() {
return this.internalValue[0];
},
deselectLabelText() {
return this.showLabels ? this.deselectLabel : "";
},
deselectGroupLabelText() {
return this.showLabels ? this.deselectGroupLabel : "";
},
selectLabelText() {
return this.showLabels ? this.selectLabel : "";
},
selectGroupLabelText() {
return this.showLabels ? this.selectGroupLabel : "";
},
selectedLabelText() {
return this.showLabels ? this.selectedLabel : "";
},
inputStyle() {
return this.searchable || this.multiple && this.modelValue && this.modelValue.length ? this.isOpen ? { width: "100%" } : { width: "0", position: "absolute", padding: "0" } : "";
},
contentStyle() {
return this.options.length ? { display: "inline-block" } : { display: "block" };
},
isAbove() {
return this.openDirection === "above" || this.openDirection === "top" ? !0 : this.openDirection === "below" || this.openDirection === "bottom" ? !1 : this.preferredOpenDirection === "above";
},
showSearchInput() {
return this.searchable && (this.hasSingleSelectedSlot && (this.visibleSingleValue || this.visibleSingleValue === 0) ? this.isOpen : !0);
}
}
};
const AM = {
ref: "tags",
class: "multiselect__tags"
}, MM = { class: "multiselect__tags-wrap" }, DM = { class: "multiselect__spinner" }, $M = { key: 0 }, NM = { class: "multiselect__option" }, PM = { class: "multiselect__option" }, IM = /* @__PURE__ */ Oe("No elements found. Consider changing the search query."), LM = { class: "multiselect__option" }, RM = /* @__PURE__ */ Oe("List is empty.");
function BM(t, e, n, r, i, o) {
return C(), oe("div", {
tabindex: t.searchable ? -1 : n.tabindex,
class: [{ "multiselect--active": t.isOpen, "multiselect--disabled": n.disabled, "multiselect--above": o.isAbove, "multiselect--has-options-group": o.hasOptionGroup }, "multiselect"],
onFocus: e[14] || (e[14] = (a) => t.activate()),
onBlur: e[15] || (e[15] = (a) => t.searchable ? !1 : t.deactivate()),
onKeydown: [
e[16] || (e[16] = He(et((a) => t.pointerForward(), ["self", "prevent"]), ["down"])),
e[17] || (e[17] = He(et((a) => t.pointerBackward(), ["self", "prevent"]), ["up"]))
],
onKeypress: e[18] || (e[18] = He(et((a) => t.addPointerElement(a), ["stop", "self"]), ["enter", "tab"])),
onKeyup: e[19] || (e[19] = He((a) => t.deactivate(), ["esc"])),
role: "combobox",
"aria-owns": "listbox-" + t.id
}, [
X(t.$slots, "caret", { toggle: t.toggle }, () => [
J(
"div",
{
onMousedown: e[1] || (e[1] = et((a) => t.toggle(), ["prevent", "stop"])),
class: "multiselect__select"
},
null,
32
/* HYDRATE_EVENTS */
)
]),
X(t.$slots, "clear", { search: t.search }),
J(
"div",
AM,
[
X(t.$slots, "selection", {
search: t.search,
remove: t.removeElement,
values: o.visibleValues,
isOpen: t.isOpen
}, () => [
Qe(J(
"div",
MM,
[
(C(!0), oe(
Ee,
null,
nt(o.visibleValues, (a, s) => X(t.$slots, "tag", {
option: a,
search: t.search,
remove: t.removeElement
}, () => [
(C(), oe("span", {
class: "multiselect__tag",
key: s
}, [
J("span", {
textContent: Se(t.getOptionLabel(a))
}, null, 8, ["textContent"]),
J("i", {
tabindex: "1",
onKeypress: He(et((u) => t.removeElement(a), ["prevent"]), ["enter"]),
onMousedown: et((u) => t.removeElement(a), ["prevent"]),
class: "multiselect__tag-icon"
}, null, 40, ["onKeypress", "onMousedown"])
]))
])),
256
/* UNKEYED_FRAGMENT */
))
],
512
/* NEED_PATCH */
), [
[xn, o.visibleValues.length > 0]
]),
t.internalValue && t.internalValue.length > n.limit ? X(t.$slots, "limit", { key: 0 }, () => [
J("strong", {
class: "multiselect__strong",
textContent: Se(n.limitText(t.internalValue.length - n.limit))
}, null, 8, ["textContent"])
]) : F("v-if", !0)
]),
J(zn, { name: "multiselect__loading" }, {
default: ne(() => [
X(t.$slots, "loading", {}, () => [
Qe(J(
"div",
DM,
null,
512
/* NEED_PATCH */
), [
[xn, n.loading]
])
])
]),
_: 3
/* FORWARDED */
}),
t.searchable ? (C(), oe("input", {
key: 0,
ref: "search",
name: n.name,
id: t.id,
type: "text",
autocomplete: "off",
spellcheck: "false",
placeholder: t.placeholder,
style: o.inputStyle,
value: t.search,
disabled: n.disabled,
tabindex: n.tabindex,
onInput: e[2] || (e[2] = (a) => t.updateSearch(a.target.value)),
onFocus: e[3] || (e[3] = et((a) => t.activate(), ["prevent"])),
onBlur: e[4] || (e[4] = et((a) => t.deactivate(), ["prevent"])),
onKeyup: e[5] || (e[5] = He((a) => t.deactivate(), ["esc"])),
onKeydown: [
e[6] || (e[6] = He(et((a) => t.pointerForward(), ["prevent"]), ["down"])),
e[7] || (e[7] = He(et((a) => t.pointerBackward(), ["prevent"]), ["up"])),
e[9] || (e[9] = He(et((a) => t.removeLastElement(), ["stop"]), ["delete"]))
],
onKeypress: e[8] || (e[8] = He(et((a) => t.addPointerElement(a), ["prevent", "stop", "self"]), ["enter"])),
class: "multiselect__input",
"aria-controls": "listbox-" + t.id
}, null, 44, ["name", "id", "placeholder", "value", "disabled", "tabindex", "aria-controls"])) : F("v-if", !0),
o.isSingleLabelVisible ? (C(), oe(
"span",
{
key: 1,
class: "multiselect__single",
onMousedown: e[10] || (e[10] = et((...a) => t.toggle && t.toggle(...a), ["prevent"]))
},
[
X(t.$slots, "singleLabel", { option: o.singleValue }, () => [
Oe(
Se(t.currentOptionLabel),
1
/* TEXT */
)
])
],
32
/* HYDRATE_EVENTS */
)) : F("v-if", !0),
o.isPlaceholderVisible ? (C(), oe(
"span",
{
key: 2,
class: "multiselect__placeholder",
onMousedown: e[11] || (e[11] = et((...a) => t.toggle && t.toggle(...a), ["prevent"]))
},
[
X(t.$slots, "placeholder", {}, () => [
Oe(
Se(t.placeholder),
1
/* TEXT */
)
])
],
32
/* HYDRATE_EVENTS */
)) : F("v-if", !0)
],
512
/* NEED_PATCH */
),
J(zn, { name: "multiselect" }, {
default: ne(() => [
Qe(J(
"div",
{
class: "multiselect__content-wrapper",
onFocus: e[12] || (e[12] = (...a) => t.activate && t.activate(...a)),
tabindex: "-1",
onMousedown: e[13] || (e[13] = et(() => {
}, ["prevent"])),
style: { maxHeight: t.optimizedHeight + "px" },
ref: "list"
},
[
J("ul", {
class: "multiselect__content",
style: o.contentStyle,
role: "listbox",
id: "listbox-" + t.id
}, [
X(t.$slots, "beforeList"),
t.multiple && t.max === t.internalValue.length ? (C(), oe("li", $M, [
J("span", NM, [
X(t.$slots, "maxElements", {}, () => [
Oe(
"Maximum of " + Se(t.max) + " options selected. First remove a selected option to select another.",
1
/* TEXT */
)
])
])
])) : F("v-if", !0),
!t.max || t.internalValue.length < t.max ? (C(!0), oe(
Ee,
{ key: 1 },
nt(t.filteredOptions, (a, s) => (C(), oe("li", {
class: "multiselect__element",
key: s,
id: t.id + "-" + s,
role: a && (a.$isLabel || a.$isDisabled) ? null : "option"
}, [
a && (a.$isLabel || a.$isDisabled) ? F("v-if", !0) : (C(), oe("span", {
key: 0,
class: [t.optionHighlight(s, a), "multiselect__option"],
onClick: et((u) => t.select(a), ["stop"]),
onMouseenter: et((u) => t.pointerSet(s), ["self"]),
"data-select": a && a.isTag ? t.tagPlaceholder : o.selectLabelText,
"data-selected": o.selectedLabelText,
"data-deselect": o.deselectLabelText
}, [
X(t.$slots, "option", {
option: a,
search: t.search,
index: s
}, () => [
J(
"span",
null,
Se(t.getOptionLabel(a)),
1
/* TEXT */
)
])
], 42, ["onClick", "onMouseenter", "data-select", "data-selected", "data-deselect"])),
a && (a.$isLabel || a.$isDisabled) ? (C(), oe("span", {
key: 1,
"data-select": t.groupSelect && o.selectGroupLabelText,
"data-deselect": t.groupSelect && o.deselectGroupLabelText,
class: [t.groupHighlight(s, a), "multiselect__option"],
onMouseenter: et((u) => t.groupSelect && t.pointerSet(s), ["self"]),
onMousedown: et((u) => t.selectGroup(a), ["prevent"])
}, [
X(t.$slots, "option", {
option: a,
search: t.search,
index: s
}, () => [
J(
"span",
null,
Se(t.getOptionLabel(a)),
1
/* TEXT */
)
])
], 42, ["data-select", "data-deselect", "onMouseenter", "onMousedown"])) : F("v-if", !0)
], 8, ["id", "role"]))),
128
/* KEYED_FRAGMENT */
)) : F("v-if", !0),
Qe(J(
"li",
null,
[
J("span", PM, [
X(t.$slots, "noResult", { search: t.search }, () => [
IM
])
])
],
512
/* NEED_PATCH */
), [
[xn, n.showNoResults && t.filteredOptions.length === 0 && t.search && !n.loading]
]),
Qe(J(
"li",
null,
[
J("span", LM, [
X(t.$slots, "noOptions", {}, () => [
RM
])
])
],
512
/* NEED_PATCH */
), [
[xn, n.showNoOptions && (t.options.length === 0 || o.hasOptionGroup === !0 && t.filteredOptions.length === 0) && !t.search && !n.loading]
]),
X(t.$slots, "afterList")
], 12, ["id"])
],
36
/* STYLE, HYDRATE_EVENTS */
), [
[xn, t.isOpen]
])
]),
_: 3
/* FORWARDED */
})
], 42, ["tabindex", "aria-owns"]);
}
m2.render = BM;
const VM = {
modelValue: {
type: [Array, String, Number],
default: () => [],
description: "Valor del componente"
},
options: {
type: Array,
default: () => [],
description: "Array de opciones a seleccionar"
},
placeholder: {
type: String,
default: "Selecciona una opción",
description: "Placeholder del input"
},
closeOnSelect: {
type: [String, Boolean],
default: "auto"
},
label: {
type: String,
default: ""
},
searchable: {
type: Boolean,
default: !0
},
hideSelected: {
type: Boolean,
default: !1
},
trackBy: {
type: String,
default: "value"
},
labelBy: {
type: String,
default: "label"
},
errors: {
type: Array,
required: !1,
default: () => [],
description: "Errores de validación"
},
status: {
type: String,
default: "",
options: ["warning", "success", "danger"],
description: "Color de estado del input"
},
size: {
type: String,
default: "md",
options: ["xs", "sm", "md", "lg"],
description: "Tamaño del input",
control: {
type: "select"
}
},
required: {
type: Boolean,
default: !1
},
id: {
type: String,
default: ""
},
width: {
type: Number,
default: 0,
description: "Ancho del input"
},
disabled: {
type: Boolean,
default: !1
},
multiple: {
type: Boolean,
default: !1
},
clearOnSelect: {
type: Boolean,
default: !0
},
max: {
type: Number,
default: 0
},
loading: {
type: Boolean,
default: !1
},
limit: {
type: Number,
default: 0
},
maxHeight: {
type: Number,
default: 0
},
show404: {
type: Boolean,
default: !0
},
ajax: {
type: Boolean,
default: !1
},
free: {
type: Boolean,
default: !1
},
showNoOptions: {
type: Boolean,
default: !0
},
tagPlaceholder: {
type: String,
default: "Presiona ENTER para añadir"
}
}, zM = be({
name: "KSelect",
components: {
Multiselect: m2
},
props: VM,
emits: [
"update:modelValue",
"open",
"close",
"select",
"remove",
"fetch",
"tag"
],
setup(t, e) {
const n = t.id || on(), r = (h) => !!e.slots[h], i = re(!1), o = L({
get() {
if (t.modelValue && typeof t.modelValue == "object")
return Array.isArray(t.modelValue) ? t.modelValue.map((h) => {
if (h && typeof h == "object")
return {
label: h[t.labelBy],
value: h[t.trackBy]
};
{
const m = t.options.find(
(v) => v[t.trackBy].toString() === h.toString()
);
return m ? {
label: m[t.labelBy],
value: h
} : {
label: h,
value: h
};
}
}) : {
label: t.modelValue[t.labelBy],
value: t.modelValue[t.trackBy]
};
if (t.modelValue) {
const h = t.options.find(
(m) => m[t.trackBy].toString() === t.modelValue.toString()
);
return h ? {
label: h[t.labelBy],
value: t.modelValue
} : {
label: t.modelValue,
value: t.modelValue
};
} else
return null;
},
set(h) {
h && typeof h == "object" ? Array.isArray(h) ? h.length > 0 ? a(
h.map((m) => m && typeof m == "object" ? m[t.trackBy] : m)
) : a(null) : Object.keys(h).length > 0 ? a(
h[t.trackBy]
) : a(null) : a(h);
}
}), a = (h) => {
i.value = !0, e.emit("update:modelValue", h), setTimeout(() => {
i.value = !1;
}, 1e3);
}, s = L(() => {
const h = ["k-select", `k-select-${t.size}`];
return t.errors.length > 0 ? h.push("k-select-danger") : t.status && h.push(`k-select-${t.status}`), h;
}), u = L(() => t.closeOnSelect === "auto" ? !t.multiple : t.closeOnSelect), l = L(() => {
const h = {};
return t.width > 0 && (h.width = t.width + "px"), h;
}), c = L(() => t.label || r("default")), f = L(() => (t.errors.length > 0 ? t.errors[0].$message : "").toString()), d = zS((h) => {
i.value || e.emit("fetch", h);
}, 500);
return {
model: o,
classes: s,
hasLabel: c,
firstError: f,
uuid: n,
hasSlot: r,
style: l,
fCloseOnSelect: u,
addTag: (h) => {
const m = {};
m[t.trackBy] = h, m[t.labelBy] = h, Array.isArray(o.value) ? o.value = [...o.value, m] : o.value = m, e.emit("tag", h);
},
fetch: d
};
}
});
const HM = { key: 0 }, qM = {
key: 2,
class: "font-bold text-danger ml-1"
};
function FM(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip"), u = he("multiselect");
return C(), P("div", {
class: se([t.classes])
}, [
t.hasLabel ? (C(), P("label", HM, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label), 1)
], 64)),
t.required ? (C(), P("span", qM, "*")) : F("", !0),
t.firstError ? (C(), oe(s, {
key: 3,
content: t.firstError
}, {
default: ne(() => [
J(a, {
icon: "triangle-exclamation",
class: "ml-2"
})
]),
_: 1
}, 8, ["content"])) : F("", !0)
])) : F("", !0),
J(u, {
id: t.uuid,
modelValue: t.model,
"onUpdate:modelValue": e[0] || (e[0] = (l) => t.model = l),
options: t.options,
"close-on-select": t.fCloseOnSelect,
placeholder: t.placeholder,
label: t.labelBy,
searchable: t.searchable,
"hide-selected": t.hideSelected,
"allow-empty": !t.required,
"show-labels": !1,
style: Xe(t.style),
disabled: t.disabled,
multiple: t.multiple,
"track-by": t.trackBy,
"clear-on-select": t.clearOnSelect,
max: t.max > 0 ? t.max : void 0,
loading: t.loading,
"max-height": t.maxHeight > 0 ? t.maxHeight : void 0,
"show-no-results": t.show404,
"internal-search": !t.ajax,
limit: t.limit > 0 ? t.limit : void 0,
"tag-placeholder": t.tagPlaceholder,
taggable: t.free,
"show-no-options": t.showNoOptions,
onOpen: e[1] || (e[1] = (l) => t.$emit("open")),
onClose: e[2] || (e[2] = (l) => t.$emit("close")),
onSelect: e[3] || (e[3] = (l) => t.$emit("select", l)),
onRemove: e[4] || (e[4] = (l) => t.$emit("remove", l)),
onSearchChange: t.fetch,
onTag: e[5] || (e[5] = (l) => t.addTag(l))
}, {
singleLabel: ne(({ option: l }) => [
X(t.$slots, "singleLabel", At(hn({ option: l })))
]),
option: ne(({ option: l, search: c }) => [
X(t.$slots, "option", At(hn({ option: l, search: c })))
]),
maxElements: ne(() => [
Oe(" Se alcanzó el nº máximo de elementos seleccionados ")
]),
noResult: ne(() => [
Oe(" Sin resultados ")
]),
noOptions: ne(() => [
Oe(" No hay opciones disponibles ")
]),
beforeList: ne(() => [
X(t.$slots, "beforeList")
]),
afterList: ne(() => [
X(t.$slots, "afterList")
]),
caret: ne(({ toggle: l }) => [
X(t.$slots, "caret", At(hn({ toggle: l })))
]),
placeholder: ne(() => [
X(t.$slots, "placeholder")
]),
tag: ne(({ option: l, remove: c }) => [
X(t.$slots, "tag", At(hn({ option: l, remove: c })))
]),
_: 3
}, 8, ["id", "modelValue", "options", "close-on-select", "placeholder", "label", "searchable", "hide-selected", "allow-empty", "style", "disabled", "multiple", "track-by", "clear-on-select", "max", "loading", "max-height", "show-no-results", "internal-search", "limit", "tag-placeholder", "taggable", "show-no-options", "onSearchChange"])
], 2);
}
const jM = /* @__PURE__ */ $e(zM, [["render", FM]]), UM = be({
name: "KInputInline",
props: {
modelValue: {
type: [String, Number],
default: ""
},
placeholder: {
type: String,
default: "Escribe algo"
},
disabled: {
type: Boolean,
default: !1
},
readonly: {
type: Boolean,
default: !1
},
maxlength: {
type: Number,
default: 0
},
width: {
type: Number,
default: 40
},
fluid: {
type: Boolean,
default: !1
},
size: {
type: String,
default: "md",
options: ["xs", "sm", "md", "lg"],
validator: (t) => ["xs", "sm", "md", "lg"].includes(t)
}
},
emits: ["update:modelValue", "input"],
setup(t, e) {
const n = re(!0), r = re(), i = re(), o = L({
get() {
return t.modelValue.toString();
},
set(l) {
e.emit("update:modelValue", l);
}
}), a = L(() => {
const l = [];
return t.size === "xs" && l.push("k-input-inline--xs"), t.size === "sm" && l.push("k-input-inline--sm"), t.size === "md" && l.push("k-input-inline--md"), t.size === "lg" && l.push("k-input-inline--lg"), l;
}), s = L(() => t.fluid ? "100%" : `${t.width}px`), u = () => {
r.value && i.value && (r.value.style.width = i.value.offsetWidth + "px");
};
return st(() => {
t.fluid || new ResizeObserver(u).observe(i.value);
}), {
editMode: n,
input: r,
span: i,
model: o,
classes: a,
parsedWidth: s
};
}
});
const WM = ["placeholder", "disabled", "readonly", "maxlength"];
function YM(t, e, n, r, i, o) {
return C(), P("div", {
id: "uid",
class: se(["k-input-inline", t.classes])
}, [
Qe(U("input", {
ref: "input",
"onUpdate:modelValue": e[0] || (e[0] = (a) => t.model = a),
type: "text",
placeholder: t.placeholder,
disabled: t.disabled,
readonly: t.readonly,
maxlength: t.maxlength > 0 ? t.maxlength : void 0,
style: Xe({ width: t.parsedWidth })
}, null, 12, WM), [
[ap, t.model]
]),
U("span", {
ref: "span",
style: Xe({ minWidth: t.parsedWidth })
}, Se(t.model || t.placeholder), 5)
], 2);
}
const KM = /* @__PURE__ */ $e(UM, [["render", YM], ["__scopeId", "data-v-0151aa44"]]), GM = be({
name: "KInlineEditor",
props: {
modelValue: {
type: [String, Number],
default: ""
},
size: {
type: String,
default: "sm",
options: ["sm", "md", "lg"],
validator: (t) => ["sm", "md", "lg"].includes(t)
},
tooltip: {
type: String,
default: ""
}
},
emits: ["update:modelValue", "input"],
setup(t, e) {
const n = re(!0), r = re(), i = L({
get() {
return t.modelValue.toString();
},
set(u) {
e.emit("update:modelValue", u);
}
}), o = L(() => {
const u = ["inline-flex"];
return t.size === "sm" && u.push("text-sm"), t.size === "md" && u.push("text-base"), t.size === "lg" && u.push("text-lg"), u;
}), a = L(() => {
const u = [];
return t.size === "sm" && u.push("text-sm"), t.size === "md" && u.push("text-base"), t.size === "lg" && u.push("text-lg"), u;
});
return {
editMode: n,
toggleEdit: () => {
n.value = !n.value, setTimeout(() => {
n.value && r.value.focus();
}, 100);
},
input: r,
model: i,
inputClasses: a,
textClasses: o
};
}
}), JM = { class: "inline-flex" }, XM = { class: "inline-flex" }, QM = ["placeholder", "size"];
function ZM(t, e, n, r, i, o) {
return C(), P("div", JM, [
U("div", XM, [
Qe(U("input", {
ref: "input",
"onUpdate:modelValue": e[0] || (e[0] = (a) => t.model = a),
placeholder: t.model,
type: "text",
class: se(["p-0 outline-none focus:ring-0 border-0 bg-transparent", t.inputClasses]),
size: t.model.length - 1,
onBlur: e[1] || (e[1] = (...a) => t.toggleEdit && t.toggleEdit(...a))
}, null, 42, QM), [
[ap, t.model]
])
])
]);
}
const eD = /* @__PURE__ */ $e(GM, [["render", ZM]]);
var g2 = {}, Js = {}, qp = {}, Fp = {}, jp = {};
Object.defineProperty(jp, "__esModule", { value: !0 });
jp.default = new Uint16Array(
// prettier-ignore
'ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(function(t) {
return t.charCodeAt(0);
})
);
var Up = {};
Object.defineProperty(Up, "__esModule", { value: !0 });
Up.default = new Uint16Array(
// prettier-ignore
"Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(t) {
return t.charCodeAt(0);
})
);
var l0 = {};
(function(t) {
var e;
Object.defineProperty(t, "__esModule", { value: !0 }), t.replaceCodePoint = t.fromCodePoint = void 0;
var n = /* @__PURE__ */ new Map([
[0, 65533],
// C1 Unicode control character reference replacements
[128, 8364],
[130, 8218],
[131, 402],
[132, 8222],
[133, 8230],
[134, 8224],
[135, 8225],
[136, 710],
[137, 8240],
[138, 352],
[139, 8249],
[140, 338],
[142, 381],
[145, 8216],
[146, 8217],
[147, 8220],
[148, 8221],
[149, 8226],
[150, 8211],
[151, 8212],
[152, 732],
[153, 8482],
[154, 353],
[155, 8250],
[156, 339],
[158, 382],
[159, 376]
]);
t.fromCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
(e = String.fromCodePoint) !== null && e !== void 0 ? e : function(o) {
var a = "";
return o > 65535 && (o -= 65536, a += String.fromCharCode(o >>> 10 & 1023 | 55296), o = 56320 | o & 1023), a += String.fromCharCode(o), a;
};
function r(o) {
var a;
return o >= 55296 && o <= 57343 || o > 1114111 ? 65533 : (a = n.get(o)) !== null && a !== void 0 ? a : o;
}
t.replaceCodePoint = r;
function i(o) {
return (0, t.fromCodePoint)(r(o));
}
t.default = i;
})(l0);
(function(t) {
var e = De && De.__createBinding || (Object.create ? function(w, A, $, I) {
I === void 0 && (I = $);
var E = Object.getOwnPropertyDescriptor(A, $);
(!E || ("get" in E ? !A.__esModule : E.writable || E.configurable)) && (E = { enumerable: !0, get: function() {
return A[$];
} }), Object.defineProperty(w, I, E);
} : function(w, A, $, I) {
I === void 0 && (I = $), w[I] = A[$];
}), n = De && De.__setModuleDefault || (Object.create ? function(w, A) {
Object.defineProperty(w, "default", { enumerable: !0, value: A });
} : function(w, A) {
w.default = A;
}), r = De && De.__importStar || function(w) {
if (w && w.__esModule)
return w;
var A = {};
if (w != null)
for (var $ in w)
$ !== "default" && Object.prototype.hasOwnProperty.call(w, $) && e(A, w, $);
return n(A, w), A;
}, i = De && De.__importDefault || function(w) {
return w && w.__esModule ? w : { default: w };
};
Object.defineProperty(t, "__esModule", { value: !0 }), t.decodeXML = t.decodeHTMLStrict = t.decodeHTMLAttribute = t.decodeHTML = t.determineBranch = t.EntityDecoder = t.DecodingMode = t.BinTrieFlags = t.fromCodePoint = t.replaceCodePoint = t.decodeCodePoint = t.xmlDecodeTree = t.htmlDecodeTree = void 0;
var o = i(jp);
t.htmlDecodeTree = o.default;
var a = i(Up);
t.xmlDecodeTree = a.default;
var s = r(l0);
t.decodeCodePoint = s.default;
var u = l0;
Object.defineProperty(t, "replaceCodePoint", { enumerable: !0, get: function() {
return u.replaceCodePoint;
} }), Object.defineProperty(t, "fromCodePoint", { enumerable: !0, get: function() {
return u.fromCodePoint;
} });
var l;
(function(w) {
w[w.NUM = 35] = "NUM", w[w.SEMI = 59] = "SEMI", w[w.EQUALS = 61] = "EQUALS", w[w.ZERO = 48] = "ZERO", w[w.NINE = 57] = "NINE", w[w.LOWER_A = 97] = "LOWER_A", w[w.LOWER_F = 102] = "LOWER_F", w[w.LOWER_X = 120] = "LOWER_X", w[w.LOWER_Z = 122] = "LOWER_Z", w[w.UPPER_A = 65] = "UPPER_A", w[w.UPPER_F = 70] = "UPPER_F", w[w.UPPER_Z = 90] = "UPPER_Z";
})(l || (l = {}));
var c = 32, f;
(function(w) {
w[w.VALUE_LENGTH = 49152] = "VALUE_LENGTH", w[w.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", w[w.JUMP_TABLE = 127] = "JUMP_TABLE";
})(f = t.BinTrieFlags || (t.BinTrieFlags = {}));
function d(w) {
return w >= l.ZERO && w <= l.NINE;
}
function p(w) {
return w >= l.UPPER_A && w <= l.UPPER_F || w >= l.LOWER_A && w <= l.LOWER_F;
}
function h(w) {
return w >= l.UPPER_A && w <= l.UPPER_Z || w >= l.LOWER_A && w <= l.LOWER_Z || d(w);
}
function m(w) {
return w === l.EQUALS || h(w);
}
var v;
(function(w) {
w[w.EntityStart = 0] = "EntityStart", w[w.NumericStart = 1] = "NumericStart", w[w.NumericDecimal = 2] = "NumericDecimal", w[w.NumericHex = 3] = "NumericHex", w[w.NamedEntity = 4] = "NamedEntity";
})(v || (v = {}));
var y;
(function(w) {
w[w.Legacy = 0] = "Legacy", w[w.Strict = 1] = "Strict", w[w.Attribute = 2] = "Attribute";
})(y = t.DecodingMode || (t.DecodingMode = {}));
var k = (
/** @class */
function() {
function w(A, $, I) {
this.decodeTree = A, this.emitCodePoint = $, this.errors = I, this.state = v.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = y.Strict;
}
return w.prototype.startEntity = function(A) {
this.decodeMode = A, this.state = v.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
}, w.prototype.write = function(A, $) {
switch (this.state) {
case v.EntityStart:
return A.charCodeAt($) === l.NUM ? (this.state = v.NumericStart, this.consumed += 1, this.stateNumericStart(A, $ + 1)) : (this.state = v.NamedEntity, this.stateNamedEntity(A, $));
case v.NumericStart:
return this.stateNumericStart(A, $);
case v.NumericDecimal:
return this.stateNumericDecimal(A, $);
case v.NumericHex:
return this.stateNumericHex(A, $);
case v.NamedEntity:
return this.stateNamedEntity(A, $);
}
}, w.prototype.stateNumericStart = function(A, $) {
return $ >= A.length ? -1 : (A.charCodeAt($) | c) === l.LOWER_X ? (this.state = v.NumericHex, this.consumed += 1, this.stateNumericHex(A, $ + 1)) : (this.state = v.NumericDecimal, this.stateNumericDecimal(A, $));
}, w.prototype.addToNumericResult = function(A, $, I, E) {
if ($ !== I) {
var O = I - $;
this.result = this.result * Math.pow(E, O) + parseInt(A.substr($, O), E), this.consumed += O;
}
}, w.prototype.stateNumericHex = function(A, $) {
for (var I = $; $ < A.length; ) {
var E = A.charCodeAt($);
if (d(E) || p(E))
$ += 1;
else
return this.addToNumericResult(A, I, $, 16), this.emitNumericEntity(E, 3);
}
return this.addToNumericResult(A, I, $, 16), -1;
}, w.prototype.stateNumericDecimal = function(A, $) {
for (var I = $; $ < A.length; ) {
var E = A.charCodeAt($);
if (d(E))
$ += 1;
else
return this.addToNumericResult(A, I, $, 10), this.emitNumericEntity(E, 2);
}
return this.addToNumericResult(A, I, $, 10), -1;
}, w.prototype.emitNumericEntity = function(A, $) {
var I;
if (this.consumed <= $)
return (I = this.errors) === null || I === void 0 || I.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
if (A === l.SEMI)
this.consumed += 1;
else if (this.decodeMode === y.Strict)
return 0;
return this.emitCodePoint((0, s.replaceCodePoint)(this.result), this.consumed), this.errors && (A !== l.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
}, w.prototype.stateNamedEntity = function(A, $) {
for (var I = this.decodeTree, E = I[this.treeIndex], O = (E & f.VALUE_LENGTH) >> 14; $ < A.length; $++, this.excess++) {
var g = A.charCodeAt($);
if (this.treeIndex = b(I, E, this.treeIndex + Math.max(1, O), g), this.treeIndex < 0)
return this.result === 0 || // If we are parsing an attribute
this.decodeMode === y.Attribute && // We shouldn't have consumed any characters after the entity,
(O === 0 || // And there should be no invalid characters.
m(g)) ? 0 : this.emitNotTerminatedNamedEntity();
if (E = I[this.treeIndex], O = (E & f.VALUE_LENGTH) >> 14, O !== 0) {
if (g === l.SEMI)
return this.emitNamedEntityData(this.treeIndex, O, this.consumed + this.excess);
this.decodeMode !== y.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
}
}
return -1;
}, w.prototype.emitNotTerminatedNamedEntity = function() {
var A, $ = this, I = $.result, E = $.decodeTree, O = (E[I] & f.VALUE_LENGTH) >> 14;
return this.emitNamedEntityData(I, O, this.consumed), (A = this.errors) === null || A === void 0 || A.missingSemicolonAfterCharacterReference(), this.consumed;
}, w.prototype.emitNamedEntityData = function(A, $, I) {
var E = this.decodeTree;
return this.emitCodePoint($ === 1 ? E[A] & ~f.VALUE_LENGTH : E[A + 1], I), $ === 3 && this.emitCodePoint(E[A + 2], I), I;
}, w.prototype.end = function() {
var A;
switch (this.state) {
case v.NamedEntity:
return this.result !== 0 && (this.decodeMode !== y.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
case v.NumericDecimal:
return this.emitNumericEntity(0, 2);
case v.NumericHex:
return this.emitNumericEntity(0, 3);
case v.NumericStart:
return (A = this.errors) === null || A === void 0 || A.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
case v.EntityStart:
return 0;
}
}, w;
}()
);
t.EntityDecoder = k;
function T(w) {
var A = "", $ = new k(w, function(I) {
return A += (0, s.fromCodePoint)(I);
});
return function(E, O) {
for (var g = 0, M = 0; (M = E.indexOf("&", M)) >= 0; ) {
A += E.slice(g, M), $.startEntity(O);
var H = $.write(
E,
// Skip the "&"
M + 1
);
if (H < 0) {
g = M + $.end();
break;
}
g = M + H, M = H === 0 ? g + 1 : g;
}
var z = A + E.slice(g);
return A = "", z;
};
}
function b(w, A, $, I) {
var E = (A & f.BRANCH_LENGTH) >> 7, O = A & f.JUMP_TABLE;
if (E === 0)
return O !== 0 && I === O ? $ : -1;
if (O) {
var g = I - O;
return g < 0 || g >= E ? -1 : w[$ + g] - 1;
}
for (var M = $, H = M + E - 1; M <= H; ) {
var z = M + H >>> 1, Y = w[z];
if (Y < I)
M = z + 1;
else if (Y > I)
H = z - 1;
else
return w[z + E];
}
return -1;
}
t.determineBranch = b;
var D = T(o.default), x = T(a.default);
function S(w, A) {
return A === void 0 && (A = y.Legacy), D(w, A);
}
t.decodeHTML = S;
function _(w) {
return D(w, y.Attribute);
}
t.decodeHTMLAttribute = _;
function N(w) {
return D(w, y.Strict);
}
t.decodeHTMLStrict = N;
function R(w) {
return x(w, y.Strict);
}
t.decodeXML = R;
})(Fp);
(function(t) {
Object.defineProperty(t, "__esModule", { value: !0 }), t.QuoteType = void 0;
var e = Fp, n;
(function(d) {
d[d.Tab = 9] = "Tab", d[d.NewLine = 10] = "NewLine", d[d.FormFeed = 12] = "FormFeed", d[d.CarriageReturn = 13] = "CarriageReturn", d[d.Space = 32] = "Space", d[d.ExclamationMark = 33] = "ExclamationMark", d[d.Number = 35] = "Number", d[d.Amp = 38] = "Amp", d[d.SingleQuote = 39] = "SingleQuote", d[d.DoubleQuote = 34] = "DoubleQuote", d[d.Dash = 45] = "Dash", d[d.Slash = 47] = "Slash", d[d.Zero = 48] = "Zero", d[d.Nine = 57] = "Nine", d[d.Semi = 59] = "Semi", d[d.Lt = 60] = "Lt", d[d.Eq = 61] = "Eq", d[d.Gt = 62] = "Gt", d[d.Questionmark = 63] = "Questionmark", d[d.UpperA = 65] = "UpperA", d[d.LowerA = 97] = "LowerA", d[d.UpperF = 70] = "UpperF", d[d.LowerF = 102] = "LowerF", d[d.UpperZ = 90] = "UpperZ", d[d.LowerZ = 122] = "LowerZ", d[d.LowerX = 120] = "LowerX", d[d.OpeningSquareBracket = 91] = "OpeningSquareBracket";
})(n || (n = {}));
var r;
(function(d) {
d[d.Text = 1] = "Text", d[d.BeforeTagName = 2] = "BeforeTagName", d[d.InTagName = 3] = "InTagName", d[d.InSelfClosingTag = 4] = "InSelfClosingTag", d[d.BeforeClosingTagName = 5] = "BeforeClosingTagName", d[d.InClosingTagName = 6] = "InClosingTagName", d[d.AfterClosingTagName = 7] = "AfterClosingTagName", d[d.BeforeAttributeName = 8] = "BeforeAttributeName", d[d.InAttributeName = 9] = "InAttributeName", d[d.AfterAttributeName = 10] = "AfterAttributeName", d[d.BeforeAttributeValue = 11] = "BeforeAttributeValue", d[d.InAttributeValueDq = 12] = "InAttributeValueDq", d[d.InAttributeValueSq = 13] = "InAttributeValueSq", d[d.InAttributeValueNq = 14] = "InAttributeValueNq", d[d.BeforeDeclaration = 15] = "BeforeDeclaration", d[d.InDeclaration = 16] = "InDeclaration", d[d.InProcessingInstruction = 17] = "InProcessingInstruction", d[d.BeforeComment = 18] = "BeforeComment", d[d.CDATASequence = 19] = "CDATASequence", d[d.InSpecialComment = 20] = "InSpecialComment", d[d.InCommentLike = 21] = "InCommentLike", d[d.BeforeSpecialS = 22] = "BeforeSpecialS", d[d.SpecialStartSequence = 23] = "SpecialStartSequence", d[d.InSpecialTag = 24] = "InSpecialTag", d[d.BeforeEntity = 25] = "BeforeEntity", d[d.BeforeNumericEntity = 26] = "BeforeNumericEntity", d[d.InNamedEntity = 27] = "InNamedEntity", d[d.InNumericEntity = 28] = "InNumericEntity", d[d.InHexEntity = 29] = "InHexEntity";
})(r || (r = {}));
function i(d) {
return d === n.Space || d === n.NewLine || d === n.Tab || d === n.FormFeed || d === n.CarriageReturn;
}
function o(d) {
return d === n.Slash || d === n.Gt || i(d);
}
function a(d) {
return d >= n.Zero && d <= n.Nine;
}
function s(d) {
return d >= n.LowerA && d <= n.LowerZ || d >= n.UpperA && d <= n.UpperZ;
}
function u(d) {
return d >= n.UpperA && d <= n.UpperF || d >= n.LowerA && d <= n.LowerF;
}
var l;
(function(d) {
d[d.NoValue = 0] = "NoValue", d[d.Unquoted = 1] = "Unquoted", d[d.Single = 2] = "Single", d[d.Double = 3] = "Double";
})(l = t.QuoteType || (t.QuoteType = {}));
var c = {
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
CdataEnd: new Uint8Array([93, 93, 62]),
CommentEnd: new Uint8Array([45, 45, 62]),
ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101])
// `</title`
}, f = (
/** @class */
function() {
function d(p, h) {
var m = p.xmlMode, v = m === void 0 ? !1 : m, y = p.decodeEntities, k = y === void 0 ? !0 : y;
this.cbs = h, this.state = r.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = r.Text, this.isSpecial = !1, this.running = !0, this.offset = 0, this.currentSequence = void 0, this.sequenceIndex = 0, this.trieIndex = 0, this.trieCurrent = 0, this.entityResult = 0, this.entityExcess = 0, this.xmlMode = v, this.decodeEntities = k, this.entityTrie = v ? e.xmlDecodeTree : e.htmlDecodeTree;
}
return d.prototype.reset = function() {
this.state = r.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = r.Text, this.currentSequence = void 0, this.running = !0, this.offset = 0;
}, d.prototype.write = function(p) {
this.offset += this.buffer.length, this.buffer = p, this.parse();
}, d.prototype.end = function() {
this.running && this.finish();
}, d.prototype.pause = function() {
this.running = !1;
}, d.prototype.resume = function() {
this.running = !0, this.index < this.buffer.length + this.offset && this.parse();
}, d.prototype.getIndex = function() {
return this.index;
}, d.prototype.getSectionStart = function() {
return this.sectionStart;
}, d.prototype.stateText = function(p) {
p === n.Lt || !this.decodeEntities && this.fastForwardTo(n.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = r.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && p === n.Amp && (this.state = r.BeforeEntity);
}, d.prototype.stateSpecialStartSequence = function(p) {
var h = this.sequenceIndex === this.currentSequence.length, m = h ? (
// If we are at the end of the sequence, make sure the tag name has ended
o(p)
) : (
// Otherwise, do a case-insensitive comparison
(p | 32) === this.currentSequence[this.sequenceIndex]
);
if (!m)
this.isSpecial = !1;
else if (!h) {
this.sequenceIndex++;
return;
}
this.sequenceIndex = 0, this.state = r.InTagName, this.stateInTagName(p);
}, d.prototype.stateInSpecialTag = function(p) {
if (this.sequenceIndex === this.currentSequence.length) {
if (p === n.Gt || i(p)) {
var h = this.index - this.currentSequence.length;
if (this.sectionStart < h) {
var m = this.index;
this.index = h, this.cbs.ontext(this.sectionStart, h), this.index = m;
}
this.isSpecial = !1, this.sectionStart = h + 2, this.stateInClosingTagName(p);
return;
}
this.sequenceIndex = 0;
}
(p | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === c.TitleEnd ? this.decodeEntities && p === n.Amp && (this.state = r.BeforeEntity) : this.fastForwardTo(n.Lt) && (this.sequenceIndex = 1) : this.sequenceIndex = +(p === n.Lt);
}, d.prototype.stateCDATASequence = function(p) {
p === c.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === c.Cdata.length && (this.state = r.InCommentLike, this.currentSequence = c.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = r.InDeclaration, this.stateInDeclaration(p));
}, d.prototype.fastForwardTo = function(p) {
for (; ++this.index < this.buffer.length + this.offset; )
if (this.buffer.charCodeAt(this.index - this.offset) === p)
return !0;
return this.index = this.buffer.length + this.offset - 1, !1;
}, d.prototype.stateInCommentLike = function(p) {
p === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === c.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index, 2) : this.cbs.oncomment(this.sectionStart, this.index, 2), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = r.Text) : this.sequenceIndex === 0 ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : p !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0);
}, d.prototype.isTagStartChar = function(p) {
return this.xmlMode ? !o(p) : s(p);
}, d.prototype.startSpecial = function(p, h) {
this.isSpecial = !0, this.currentSequence = p, this.sequenceIndex = h, this.state = r.SpecialStartSequence;
}, d.prototype.stateBeforeTagName = function(p) {
if (p === n.ExclamationMark)
this.state = r.BeforeDeclaration, this.sectionStart = this.index + 1;
else if (p === n.Questionmark)
this.state = r.InProcessingInstruction, this.sectionStart = this.index + 1;
else if (this.isTagStartChar(p)) {
var h = p | 32;
this.sectionStart = this.index, !this.xmlMode && h === c.TitleEnd[2] ? this.startSpecial(c.TitleEnd, 3) : this.state = !this.xmlMode && h === c.ScriptEnd[2] ? r.BeforeSpecialS : r.InTagName;
} else
p === n.Slash ? this.state = r.BeforeClosingTagName : (this.state = r.Text, this.stateText(p));
}, d.prototype.stateInTagName = function(p) {
o(p) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = r.BeforeAttributeName, this.stateBeforeAttributeName(p));
}, d.prototype.stateBeforeClosingTagName = function(p) {
i(p) || (p === n.Gt ? this.state = r.Text : (this.state = this.isTagStartChar(p) ? r.InClosingTagName : r.InSpecialComment, this.sectionStart = this.index));
}, d.prototype.stateInClosingTagName = function(p) {
(p === n.Gt || i(p)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = r.AfterClosingTagName, this.stateAfterClosingTagName(p));
}, d.prototype.stateAfterClosingTagName = function(p) {
(p === n.Gt || this.fastForwardTo(n.Gt)) && (this.state = r.Text, this.baseState = r.Text, this.sectionStart = this.index + 1);
}, d.prototype.stateBeforeAttributeName = function(p) {
p === n.Gt ? (this.cbs.onopentagend(this.index), this.isSpecial ? (this.state = r.InSpecialTag, this.sequenceIndex = 0) : this.state = r.Text, this.baseState = this.state, this.sectionStart = this.index + 1) : p === n.Slash ? this.state = r.InSelfClosingTag : i(p) || (this.state = r.InAttributeName, this.sectionStart = this.index);
}, d.prototype.stateInSelfClosingTag = function(p) {
p === n.Gt ? (this.cbs.onselfclosingtag(this.index), this.state = r.Text, this.baseState = r.Text, this.sectionStart = this.index + 1, this.isSpecial = !1) : i(p) || (this.state = r.BeforeAttributeName, this.stateBeforeAttributeName(p));
}, d.prototype.stateInAttributeName = function(p) {
(p === n.Eq || o(p)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = -1, this.state = r.AfterAttributeName, this.stateAfterAttributeName(p));
}, d.prototype.stateAfterAttributeName = function(p) {
p === n.Eq ? this.state = r.BeforeAttributeValue : p === n.Slash || p === n.Gt ? (this.cbs.onattribend(l.NoValue, this.index), this.state = r.BeforeAttributeName, this.stateBeforeAttributeName(p)) : i(p) || (this.cbs.onattribend(l.NoValue, this.index), this.state = r.InAttributeName, this.sectionStart = this.index);
}, d.prototype.stateBeforeAttributeValue = function(p) {
p === n.DoubleQuote ? (this.state = r.InAttributeValueDq, this.sectionStart = this.index + 1) : p === n.SingleQuote ? (this.state = r.InAttributeValueSq, this.sectionStart = this.index + 1) : i(p) || (this.sectionStart = this.index, this.state = r.InAttributeValueNq, this.stateInAttributeValueNoQuotes(p));
}, d.prototype.handleInAttributeValue = function(p, h) {
p === h || !this.decodeEntities && this.fastForwardTo(h) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(h === n.DoubleQuote ? l.Double : l.Single, this.index), this.state = r.BeforeAttributeName) : this.decodeEntities && p === n.Amp && (this.baseState = this.state, this.state = r.BeforeEntity);
}, d.prototype.stateInAttributeValueDoubleQuotes = function(p) {
this.handleInAttributeValue(p, n.DoubleQuote);
}, d.prototype.stateInAttributeValueSingleQuotes = function(p) {
this.handleInAttributeValue(p, n.SingleQuote);
}, d.prototype.stateInAttributeValueNoQuotes = function(p) {
i(p) || p === n.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(l.Unquoted, this.index), this.state = r.BeforeAttributeName, this.stateBeforeAttributeName(p)) : this.decodeEntities && p === n.Amp && (this.baseState = this.state, this.state = r.BeforeEntity);
}, d.prototype.stateBeforeDeclaration = function(p) {
p === n.OpeningSquareBracket ? (this.state = r.CDATASequence, this.sequenceIndex = 0) : this.state = p === n.Dash ? r.BeforeComment : r.InDeclaration;
}, d.prototype.stateInDeclaration = function(p) {
(p === n.Gt || this.fastForwardTo(n.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = r.Text, this.sectionStart = this.index + 1);
}, d.prototype.stateInProcessingInstruction = function(p) {
(p === n.Gt || this.fastForwardTo(n.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = r.Text, this.sectionStart = this.index + 1);
}, d.prototype.stateBeforeComment = function(p) {
p === n.Dash ? (this.state = r.InCommentLike, this.currentSequence = c.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = r.InDeclaration;
}, d.prototype.stateInSpecialComment = function(p) {
(p === n.Gt || this.fastForwardTo(n.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = r.Text, this.sectionStart = this.index + 1);
}, d.prototype.stateBeforeSpecialS = function(p) {
var h = p | 32;
h === c.ScriptEnd[3] ? this.startSpecial(c.ScriptEnd, 4) : h === c.StyleEnd[3] ? this.startSpecial(c.StyleEnd, 4) : (this.state = r.InTagName, this.stateInTagName(p));
}, d.prototype.stateBeforeEntity = function(p) {
this.entityExcess = 1, this.entityResult = 0, p === n.Number ? this.state = r.BeforeNumericEntity : p === n.Amp || (this.trieIndex = 0, this.trieCurrent = this.entityTrie[0], this.state = r.InNamedEntity, this.stateInNamedEntity(p));
}, d.prototype.stateInNamedEntity = function(p) {
if (this.entityExcess += 1, this.trieIndex = (0, e.determineBranch)(this.entityTrie, this.trieCurrent, this.trieIndex + 1, p), this.trieIndex < 0) {
this.emitNamedEntity(), this.index--;
return;
}
this.trieCurrent = this.entityTrie[this.trieIndex];
var h = this.trieCurrent & e.BinTrieFlags.VALUE_LENGTH;
if (h) {
var m = (h >> 14) - 1;
if (!this.allowLegacyEntity() && p !== n.Semi)
this.trieIndex += m;
else {
var v = this.index - this.entityExcess + 1;
v > this.sectionStart && this.emitPartial(this.sectionStart, v), this.entityResult = this.trieIndex, this.trieIndex += m, this.entityExcess = 0, this.sectionStart = this.index + 1, m === 0 && this.emitNamedEntity();
}
}
}, d.prototype.emitNamedEntity = function() {
if (this.state = this.baseState, this.entityResult !== 0) {
var p = (this.entityTrie[this.entityResult] & e.BinTrieFlags.VALUE_LENGTH) >> 14;
switch (p) {
case 1: {
this.emitCodePoint(this.entityTrie[this.entityResult] & ~e.BinTrieFlags.VALUE_LENGTH);
break;
}
case 2: {
this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
break;
}
case 3:
this.emitCodePoint(this.entityTrie[this.entityResult + 1]), this.emitCodePoint(this.entityTrie[this.entityResult + 2]);
}
}
}, d.prototype.stateBeforeNumericEntity = function(p) {
(p | 32) === n.LowerX ? (this.entityExcess++, this.state = r.InHexEntity) : (this.state = r.InNumericEntity, this.stateInNumericEntity(p));
}, d.prototype.emitNumericEntity = function(p) {
var h = this.index - this.entityExcess - 1, m = h + 2 + +(this.state === r.InHexEntity);
m !== this.index && (h > this.sectionStart && this.emitPartial(this.sectionStart, h), this.sectionStart = this.index + Number(p), this.emitCodePoint((0, e.replaceCodePoint)(this.entityResult))), this.state = this.baseState;
}, d.prototype.stateInNumericEntity = function(p) {
p === n.Semi ? this.emitNumericEntity(!0) : a(p) ? (this.entityResult = this.entityResult * 10 + (p - n.Zero), this.entityExcess++) : (this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state = this.baseState, this.index--);
}, d.prototype.stateInHexEntity = function(p) {
p === n.Semi ? this.emitNumericEntity(!0) : a(p) ? (this.entityResult = this.entityResult * 16 + (p - n.Zero), this.entityExcess++) : u(p) ? (this.entityResult = this.entityResult * 16 + ((p | 32) - n.LowerA + 10), this.entityExcess++) : (this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state = this.baseState, this.index--);
}, d.prototype.allowLegacyEntity = function() {
return !this.xmlMode && (this.baseState === r.Text || this.baseState === r.InSpecialTag);
}, d.prototype.cleanup = function() {
this.running && this.sectionStart !== this.index && (this.state === r.Text || this.state === r.InSpecialTag && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === r.InAttributeValueDq || this.state === r.InAttributeValueSq || this.state === r.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index));
}, d.prototype.shouldContinue = function() {
return this.index < this.buffer.length + this.offset && this.running;
}, d.prototype.parse = function() {
for (; this.shouldContinue(); ) {
var p = this.buffer.charCodeAt(this.index - this.offset);
switch (this.state) {
case r.Text: {
this.stateText(p);
break;
}
case r.SpecialStartSequence: {
this.stateSpecialStartSequence(p);
break;
}
case r.InSpecialTag: {
this.stateInSpecialTag(p);
break;
}
case r.CDATASequence: {
this.stateCDATASequence(p);
break;
}
case r.InAttributeValueDq: {
this.stateInAttributeValueDoubleQuotes(p);
break;
}
case r.InAttributeName: {
this.stateInAttributeName(p);
break;
}
case r.InCommentLike: {
this.stateInCommentLike(p);
break;
}
case r.InSpecialComment: {
this.stateInSpecialComment(p);
break;
}
case r.BeforeAttributeName: {
this.stateBeforeAttributeName(p);
break;
}
case r.InTagName: {
this.stateInTagName(p);
break;
}
case r.InClosingTagName: {
this.stateInClosingTagName(p);
break;
}
case r.BeforeTagName: {
this.stateBeforeTagName(p);
break;
}
case r.AfterAttributeName: {
this.stateAfterAttributeName(p);
break;
}
case r.InAttributeValueSq: {
this.stateInAttributeValueSingleQuotes(p);
break;
}
case r.BeforeAttributeValue: {
this.stateBeforeAttributeValue(p);
break;
}
case r.BeforeClosingTagName: {
this.stateBeforeClosingTagName(p);
break;
}
case r.AfterClosingTagName: {
this.stateAfterClosingTagName(p);
break;
}
case r.BeforeSpecialS: {
this.stateBeforeSpecialS(p);
break;
}
case r.InAttributeValueNq: {
this.stateInAttributeValueNoQuotes(p);
break;
}
case r.InSelfClosingTag: {
this.stateInSelfClosingTag(p);
break;
}
case r.InDeclaration: {
this.stateInDeclaration(p);
break;
}
case r.BeforeDeclaration: {
this.stateBeforeDeclaration(p);
break;
}
case r.BeforeComment: {
this.stateBeforeComment(p);
break;
}
case r.InProcessingInstruction: {
this.stateInProcessingInstruction(p);
break;
}
case r.InNamedEntity: {
this.stateInNamedEntity(p);
break;
}
case r.BeforeEntity: {
this.stateBeforeEntity(p);
break;
}
case r.InHexEntity: {
this.stateInHexEntity(p);
break;
}
case r.InNumericEntity: {
this.stateInNumericEntity(p);
break;
}
default:
this.stateBeforeNumericEntity(p);
}
this.index++;
}
this.cleanup();
}, d.prototype.finish = function() {
this.state === r.InNamedEntity && this.emitNamedEntity(), this.sectionStart < this.index && this.handleTrailingData(), this.cbs.onend();
}, d.prototype.handleTrailingData = function() {
var p = this.buffer.length + this.offset;
this.state === r.InCommentLike ? this.currentSequence === c.CdataEnd ? this.cbs.oncdata(this.sectionStart, p, 0) : this.cbs.oncomment(this.sectionStart, p, 0) : this.state === r.InNumericEntity && this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state === r.InHexEntity && this.allowLegacyEntity() ? this.emitNumericEntity(!1) : this.state === r.InTagName || this.state === r.BeforeAttributeName || this.state === r.BeforeAttributeValue || this.state === r.AfterAttributeName || this.state === r.InAttributeName || this.state === r.InAttributeValueSq || this.state === r.InAttributeValueDq || this.state === r.InAttributeValueNq || this.state === r.InClosingTagName || this.cbs.ontext(this.sectionStart, p);
}, d.prototype.emitPartial = function(p, h) {
this.baseState !== r.Text && this.baseState !== r.InSpecialTag ? this.cbs.onattribdata(p, h) : this.cbs.ontext(p, h);
}, d.prototype.emitCodePoint = function(p) {
this.baseState !== r.Text && this.baseState !== r.InSpecialTag ? this.cbs.onattribentity(p) : this.cbs.ontextentity(p);
}, d;
}()
);
t.default = f;
})(qp);
var tD = De && De.__createBinding || (Object.create ? function(t, e, n, r) {
r === void 0 && (r = n);
var i = Object.getOwnPropertyDescriptor(e, n);
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: function() {
return e[n];
} }), Object.defineProperty(t, r, i);
} : function(t, e, n, r) {
r === void 0 && (r = n), t[r] = e[n];
}), nD = De && De.__setModuleDefault || (Object.create ? function(t, e) {
Object.defineProperty(t, "default", { enumerable: !0, value: e });
} : function(t, e) {
t.default = e;
}), rD = De && De.__importStar || function(t) {
if (t && t.__esModule)
return t;
var e = {};
if (t != null)
for (var n in t)
n !== "default" && Object.prototype.hasOwnProperty.call(t, n) && tD(e, t, n);
return nD(e, t), e;
};
Object.defineProperty(Js, "__esModule", { value: !0 });
Js.Parser = void 0;
var Pu = rD(qp), $1 = Fp, Zo = /* @__PURE__ */ new Set([
"input",
"option",
"optgroup",
"select",
"button",
"datalist",
"textarea"
]), wt = /* @__PURE__ */ new Set(["p"]), N1 = /* @__PURE__ */ new Set(["thead", "tbody"]), P1 = /* @__PURE__ */ new Set(["dd", "dt"]), I1 = /* @__PURE__ */ new Set(["rt", "rp"]), iD = /* @__PURE__ */ new Map([
["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
["th", /* @__PURE__ */ new Set(["th"])],
["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
["body", /* @__PURE__ */ new Set(["head", "link", "script"])],
["li", /* @__PURE__ */ new Set(["li"])],
["p", wt],
["h1", wt],
["h2", wt],
["h3", wt],
["h4", wt],
["h5", wt],
["h6", wt],
["select", Zo],
["input", Zo],
["output", Zo],
["button", Zo],
["datalist", Zo],
["textarea", Zo],
["option", /* @__PURE__ */ new Set(["option"])],
["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
["dd", P1],
["dt", P1],
["address", wt],
["article", wt],
["aside", wt],
["blockquote", wt],
["details", wt],
["div", wt],
["dl", wt],
["fieldset", wt],
["figcaption", wt],
["figure", wt],
["footer", wt],
["form", wt],
["header", wt],
["hr", wt],
["main", wt],
["nav", wt],
["ol", wt],
["pre", wt],
["section", wt],
["table", wt],
["ul", wt],
["rt", I1],
["rp", I1],
["tbody", N1],
["tfoot", N1]
]), oD = /* @__PURE__ */ new Set([
"area",
"base",
"basefont",
"br",
"col",
"command",
"embed",
"frame",
"hr",
"img",
"input",
"isindex",
"keygen",
"link",
"meta",
"param",
"source",
"track",
"wbr"
]), L1 = /* @__PURE__ */ new Set(["math", "svg"]), R1 = /* @__PURE__ */ new Set([
"mi",
"mo",
"mn",
"ms",
"mtext",
"annotation-xml",
"foreignobject",
"desc",
"title"
]), aD = /\s|\//, sD = (
/** @class */
function() {
function t(e, n) {
n === void 0 && (n = {});
var r, i, o, a, s;
this.options = n, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.foreignContext = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = e ?? {}, this.lowerCaseTagNames = (r = n.lowerCaseTags) !== null && r !== void 0 ? r : !n.xmlMode, this.lowerCaseAttributeNames = (i = n.lowerCaseAttributeNames) !== null && i !== void 0 ? i : !n.xmlMode, this.tokenizer = new ((o = n.Tokenizer) !== null && o !== void 0 ? o : Pu.default)(this.options, this), (s = (a = this.cbs).onparserinit) === null || s === void 0 || s.call(a, this);
}
return t.prototype.ontext = function(e, n) {
var r, i, o = this.getSlice(e, n);
this.endIndex = n - 1, (i = (r = this.cbs).ontext) === null || i === void 0 || i.call(r, o), this.startIndex = n;
}, t.prototype.ontextentity = function(e) {
var n, r, i = this.tokenizer.getSectionStart();
this.endIndex = i - 1, (r = (n = this.cbs).ontext) === null || r === void 0 || r.call(n, (0, $1.fromCodePoint)(e)), this.startIndex = i;
}, t.prototype.isVoidElement = function(e) {
return !this.options.xmlMode && oD.has(e);
}, t.prototype.onopentagname = function(e, n) {
this.endIndex = n;
var r = this.getSlice(e, n);
this.lowerCaseTagNames && (r = r.toLowerCase()), this.emitOpenTag(r);
}, t.prototype.emitOpenTag = function(e) {
var n, r, i, o;
this.openTagStart = this.startIndex, this.tagname = e;
var a = !this.options.xmlMode && iD.get(e);
if (a)
for (; this.stack.length > 0 && a.has(this.stack[this.stack.length - 1]); ) {
var s = this.stack.pop();
(r = (n = this.cbs).onclosetag) === null || r === void 0 || r.call(n, s, !0);
}
this.isVoidElement(e) || (this.stack.push(e), L1.has(e) ? this.foreignContext.push(!0) : R1.has(e) && this.foreignContext.push(!1)), (o = (i = this.cbs).onopentagname) === null || o === void 0 || o.call(i, e), this.cbs.onopentag && (this.attribs = {});
}, t.prototype.endOpenTag = function(e) {
var n, r;
this.startIndex = this.openTagStart, this.attribs && ((r = (n = this.cbs).onopentag) === null || r === void 0 || r.call(n, this.tagname, this.attribs, e), this.attribs = null), this.cbs.onclosetag && this.isVoidElement(this.tagname) && this.cbs.onclosetag(this.tagname, !0), this.tagname = "";
}, t.prototype.onopentagend = function(e) {
this.endIndex = e, this.endOpenTag(!1), this.startIndex = e + 1;
}, t.prototype.onclosetag = function(e, n) {
var r, i, o, a, s, u;
this.endIndex = n;
var l = this.getSlice(e, n);
if (this.lowerCaseTagNames && (l = l.toLowerCase()), (L1.has(l) || R1.has(l)) && this.foreignContext.pop(), this.isVoidElement(l))
!this.options.xmlMode && l === "br" && ((i = (r = this.cbs).onopentagname) === null || i === void 0 || i.call(r, "br"), (a = (o = this.cbs).onopentag) === null || a === void 0 || a.call(o, "br", {}, !0), (u = (s = this.cbs).onclosetag) === null || u === void 0 || u.call(s, "br", !1));
else {
var c = this.stack.lastIndexOf(l);
if (c !== -1)
if (this.cbs.onclosetag)
for (var f = this.stack.length - c; f--; )
this.cbs.onclosetag(this.stack.pop(), f !== 0);
else
this.stack.length = c;
else
!this.options.xmlMode && l === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
}
this.startIndex = n + 1;
}, t.prototype.onselfclosingtag = function(e) {
this.endIndex = e, this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1] ? (this.closeCurrentTag(!1), this.startIndex = e + 1) : this.onopentagend(e);
}, t.prototype.closeCurrentTag = function(e) {
var n, r, i = this.tagname;
this.endOpenTag(e), this.stack[this.stack.length - 1] === i && ((r = (n = this.cbs).onclosetag) === null || r === void 0 || r.call(n, i, !e), this.stack.pop());
}, t.prototype.onattribname = function(e, n) {
this.startIndex = e;
var r = this.getSlice(e, n);
this.attribname = this.lowerCaseAttributeNames ? r.toLowerCase() : r;
}, t.prototype.onattribdata = function(e, n) {
this.attribvalue += this.getSlice(e, n);
}, t.prototype.onattribentity = function(e) {
this.attribvalue += (0, $1.fromCodePoint)(e);
}, t.prototype.onattribend = function(e, n) {
var r, i;
this.endIndex = n, (i = (r = this.cbs).onattribute) === null || i === void 0 || i.call(r, this.attribname, this.attribvalue, e === Pu.QuoteType.Double ? '"' : e === Pu.QuoteType.Single ? "'" : e === Pu.QuoteType.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
}, t.prototype.getInstructionName = function(e) {
var n = e.search(aD), r = n < 0 ? e : e.substr(0, n);
return this.lowerCaseTagNames && (r = r.toLowerCase()), r;
}, t.prototype.ondeclaration = function(e, n) {
this.endIndex = n;
var r = this.getSlice(e, n);
if (this.cbs.onprocessinginstruction) {
var i = this.getInstructionName(r);
this.cbs.onprocessinginstruction("!".concat(i), "!".concat(r));
}
this.startIndex = n + 1;
}, t.prototype.onprocessinginstruction = function(e, n) {
this.endIndex = n;
var r = this.getSlice(e, n);
if (this.cbs.onprocessinginstruction) {
var i = this.getInstructionName(r);
this.cbs.onprocessinginstruction("?".concat(i), "?".concat(r));
}
this.startIndex = n + 1;
}, t.prototype.oncomment = function(e, n, r) {
var i, o, a, s;
this.endIndex = n, (o = (i = this.cbs).oncomment) === null || o === void 0 || o.call(i, this.getSlice(e, n - r)), (s = (a = this.cbs).oncommentend) === null || s === void 0 || s.call(a), this.startIndex = n + 1;
}, t.prototype.oncdata = function(e, n, r) {
var i, o, a, s, u, l, c, f, d, p;
this.endIndex = n;
var h = this.getSlice(e, n - r);
this.options.xmlMode || this.options.recognizeCDATA ? ((o = (i = this.cbs).oncdatastart) === null || o === void 0 || o.call(i), (s = (a = this.cbs).ontext) === null || s === void 0 || s.call(a, h), (l = (u = this.cbs).oncdataend) === null || l === void 0 || l.call(u)) : ((f = (c = this.cbs).oncomment) === null || f === void 0 || f.call(c, "[CDATA[".concat(h, "]]")), (p = (d = this.cbs).oncommentend) === null || p === void 0 || p.call(d)), this.startIndex = n + 1;
}, t.prototype.onend = function() {
var e, n;
if (this.cbs.onclosetag) {
this.endIndex = this.startIndex;
for (var r = this.stack.length; r > 0; this.cbs.onclosetag(this.stack[--r], !0))
;
}
(n = (e = this.cbs).onend) === null || n === void 0 || n.call(e);
}, t.prototype.reset = function() {
var e, n, r, i;
(n = (e = this.cbs).onreset) === null || n === void 0 || n.call(e), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, (i = (r = this.cbs).onparserinit) === null || i === void 0 || i.call(r, this), this.buffers.length = 0, this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1;
}, t.prototype.parseComplete = function(e) {
this.reset(), this.end(e);
}, t.prototype.getSlice = function(e, n) {
for (; e - this.bufferOffset >= this.buffers[0].length; )
this.shiftBuffer();
for (var r = this.buffers[0].slice(e - this.bufferOffset, n - this.bufferOffset); n - this.bufferOffset > this.buffers[0].length; )
this.shiftBuffer(), r += this.buffers[0].slice(0, n - this.bufferOffset);
return r;
}, t.prototype.shiftBuffer = function() {
this.bufferOffset += this.buffers[0].length, this.writeIndex--, this.buffers.shift();
}, t.prototype.write = function(e) {
var n, r;
if (this.ended) {
(r = (n = this.cbs).onerror) === null || r === void 0 || r.call(n, new Error(".write() after done!"));
return;
}
this.buffers.push(e), this.tokenizer.running && (this.tokenizer.write(e), this.writeIndex++);
}, t.prototype.end = function(e) {
var n, r;
if (this.ended) {
(r = (n = this.cbs).onerror) === null || r === void 0 || r.call(n, new Error(".end() after done!"));
return;
}
e && this.write(e), this.ended = !0, this.tokenizer.end();
}, t.prototype.pause = function() {
this.tokenizer.pause();
}, t.prototype.resume = function() {
for (this.tokenizer.resume(); this.tokenizer.running && this.writeIndex < this.buffers.length; )
this.tokenizer.write(this.buffers[this.writeIndex++]);
this.ended && this.tokenizer.end();
}, t.prototype.parseChunk = function(e) {
this.write(e);
}, t.prototype.done = function(e) {
this.end(e);
}, t;
}()
);
Js.Parser = sD;
var mi = {}, Xa = {};
(function(t) {
Object.defineProperty(t, "__esModule", { value: !0 }), t.Doctype = t.CDATA = t.Tag = t.Style = t.Script = t.Comment = t.Directive = t.Text = t.Root = t.isTag = t.ElementType = void 0;
var e;
(function(r) {
r.Root = "root", r.Text = "text", r.Directive = "directive", r.Comment = "comment", r.Script = "script", r.Style = "style", r.Tag = "tag", r.CDATA = "cdata", r.Doctype = "doctype";
})(e = t.ElementType || (t.ElementType = {}));
function n(r) {
return r.type === e.Tag || r.type === e.Script || r.type === e.Style;
}
t.isTag = n, t.Root = e.Root, t.Text = e.Text, t.Directive = e.Directive, t.Comment = e.Comment, t.Script = e.Script, t.Style = e.Style, t.Tag = e.Tag, t.CDATA = e.CDATA, t.Doctype = e.Doctype;
})(Xa);
var Ze = {}, Ji = De && De.__extends || function() {
var t = function(e, n) {
return t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, i) {
r.__proto__ = i;
} || function(r, i) {
for (var o in i)
Object.prototype.hasOwnProperty.call(i, o) && (r[o] = i[o]);
}, t(e, n);
};
return function(e, n) {
if (typeof n != "function" && n !== null)
throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
t(e, n);
function r() {
this.constructor = e;
}
e.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype, new r());
};
}(), As = De && De.__assign || function() {
return As = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, As.apply(this, arguments);
};
Object.defineProperty(Ze, "__esModule", { value: !0 });
Ze.cloneNode = Ze.hasChildren = Ze.isDocument = Ze.isDirective = Ze.isComment = Ze.isText = Ze.isCDATA = Ze.isTag = Ze.Element = Ze.Document = Ze.CDATA = Ze.NodeWithChildren = Ze.ProcessingInstruction = Ze.Comment = Ze.Text = Ze.DataNode = Ze.Node = void 0;
var Rn = Xa, Wp = (
/** @class */
function() {
function t() {
this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null;
}
return Object.defineProperty(t.prototype, "parentNode", {
// Read-write aliases for properties
/**
* Same as {@link parent}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function() {
return this.parent;
},
set: function(e) {
this.parent = e;
},
enumerable: !1,
configurable: !0
}), Object.defineProperty(t.prototype, "previousSibling", {
/**
* Same as {@link prev}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function() {
return this.prev;
},
set: function(e) {
this.prev = e;
},
enumerable: !1,
configurable: !0
}), Object.defineProperty(t.prototype, "nextSibling", {
/**
* Same as {@link next}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function() {
return this.next;
},
set: function(e) {
this.next = e;
},
enumerable: !1,
configurable: !0
}), t.prototype.cloneNode = function(e) {
return e === void 0 && (e = !1), Yp(this, e);
}, t;
}()
);
Ze.Node = Wp;
var Gc = (
/** @class */
function(t) {
Ji(e, t);
function e(n) {
var r = t.call(this) || this;
return r.data = n, r;
}
return Object.defineProperty(e.prototype, "nodeValue", {
/**
* Same as {@link data}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function() {
return this.data;
},
set: function(n) {
this.data = n;
},
enumerable: !1,
configurable: !0
}), e;
}(Wp)
);
Ze.DataNode = Gc;
var b2 = (
/** @class */
function(t) {
Ji(e, t);
function e() {
var n = t !== null && t.apply(this, arguments) || this;
return n.type = Rn.ElementType.Text, n;
}
return Object.defineProperty(e.prototype, "nodeType", {
get: function() {
return 3;
},
enumerable: !1,
configurable: !0
}), e;
}(Gc)
);
Ze.Text = b2;
var v2 = (
/** @class */
function(t) {
Ji(e, t);
function e() {
var n = t !== null && t.apply(this, arguments) || this;
return n.type = Rn.ElementType.Comment, n;
}
return Object.defineProperty(e.prototype, "nodeType", {
get: function() {
return 8;
},
enumerable: !1,
configurable: !0
}), e;
}(Gc)
);
Ze.Comment = v2;
var y2 = (
/** @class */
function(t) {
Ji(e, t);
function e(n, r) {
var i = t.call(this, r) || this;
return i.name = n, i.type = Rn.ElementType.Directive, i;
}
return Object.defineProperty(e.prototype, "nodeType", {
get: function() {
return 1;
},
enumerable: !1,
configurable: !0
}), e;
}(Gc)
);
Ze.ProcessingInstruction = y2;
var Jc = (
/** @class */
function(t) {
Ji(e, t);
function e(n) {
var r = t.call(this) || this;
return r.children = n, r;
}
return Object.defineProperty(e.prototype, "firstChild", {
// Aliases
/** First child of the node. */
get: function() {
var n;
return (n = this.children[0]) !== null && n !== void 0 ? n : null;
},
enumerable: !1,
configurable: !0
}), Object.defineProperty(e.prototype, "lastChild", {
/** Last child of the node. */
get: function() {
return this.children.length > 0 ? this.children[this.children.length - 1] : null;
},
enumerable: !1,
configurable: !0
}), Object.defineProperty(e.prototype, "childNodes", {
/**
* Same as {@link children}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function() {
return this.children;
},
set: function(n) {
this.children = n;
},
enumerable: !1,
configurable: !0
}), e;
}(Wp)
);
Ze.NodeWithChildren = Jc;
var w2 = (
/** @class */
function(t) {
Ji(e, t);
function e() {
var n = t !== null && t.apply(this, arguments) || this;
return n.type = Rn.ElementType.CDATA, n;
}
return Object.defineProperty(e.prototype, "nodeType", {
get: function() {
return 4;
},
enumerable: !1,
configurable: !0
}), e;
}(Jc)
);
Ze.CDATA = w2;
var k2 = (
/** @class */
function(t) {
Ji(e, t);
function e() {
var n = t !== null && t.apply(this, arguments) || this;
return n.type = Rn.ElementType.Root, n;
}
return Object.defineProperty(e.prototype, "nodeType", {
get: function() {
return 9;
},
enumerable: !1,
configurable: !0
}), e;
}(Jc)
);
Ze.Document = k2;
var x2 = (
/** @class */
function(t) {
Ji(e, t);
function e(n, r, i, o) {
i === void 0 && (i = []), o === void 0 && (o = n === "script" ? Rn.ElementType.Script : n === "style" ? Rn.ElementType.Style : Rn.ElementType.Tag);
var a = t.call(this, i) || this;
return a.name = n, a.attribs = r, a.type = o, a;
}
return Object.defineProperty(e.prototype, "nodeType", {
get: function() {
return 1;
},
enumerable: !1,
configurable: !0
}), Object.defineProperty(e.prototype, "tagName", {
// DOM Level 1 aliases
/**
* Same as {@link name}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get: function() {
return this.name;
},
set: function(n) {
this.name = n;
},
enumerable: !1,
configurable: !0
}), Object.defineProperty(e.prototype, "attributes", {
get: function() {
var n = this;
return Object.keys(this.attribs).map(function(r) {
var i, o;
return {
name: r,
value: n.attribs[r],
namespace: (i = n["x-attribsNamespace"]) === null || i === void 0 ? void 0 : i[r],
prefix: (o = n["x-attribsPrefix"]) === null || o === void 0 ? void 0 : o[r]
};
});
},
enumerable: !1,
configurable: !0
}), e;
}(Jc)
);
Ze.Element = x2;
function S2(t) {
return (0, Rn.isTag)(t);
}
Ze.isTag = S2;
function E2(t) {
return t.type === Rn.ElementType.CDATA;
}
Ze.isCDATA = E2;
function _2(t) {
return t.type === Rn.ElementType.Text;
}
Ze.isText = _2;
function T2(t) {
return t.type === Rn.ElementType.Comment;
}
Ze.isComment = T2;
function C2(t) {
return t.type === Rn.ElementType.Directive;
}
Ze.isDirective = C2;
function O2(t) {
return t.type === Rn.ElementType.Root;
}
Ze.isDocument = O2;
function uD(t) {
return Object.prototype.hasOwnProperty.call(t, "children");
}
Ze.hasChildren = uD;
function Yp(t, e) {
e === void 0 && (e = !1);
var n;
if (_2(t))
n = new b2(t.data);
else if (T2(t))
n = new v2(t.data);
else if (S2(t)) {
var r = e ? Zd(t.children) : [], i = new x2(t.name, As({}, t.attribs), r);
r.forEach(function(u) {
return u.parent = i;
}), t.namespace != null && (i.namespace = t.namespace), t["x-attribsNamespace"] && (i["x-attribsNamespace"] = As({}, t["x-attribsNamespace"])), t["x-attribsPrefix"] && (i["x-attribsPrefix"] = As({}, t["x-attribsPrefix"])), n = i;
} else if (E2(t)) {
var r = e ? Zd(t.children) : [], o = new w2(r);
r.forEach(function(l) {
return l.parent = o;
}), n = o;
} else if (O2(t)) {
var r = e ? Zd(t.children) : [], a = new k2(r);
r.forEach(function(l) {
return l.parent = a;
}), t["x-mode"] && (a["x-mode"] = t["x-mode"]), n = a;
} else if (C2(t)) {
var s = new y2(t.name, t.data);
t["x-name"] != null && (s["x-name"] = t["x-name"], s["x-publicId"] = t["x-publicId"], s["x-systemId"] = t["x-systemId"]), n = s;
} else
throw new Error("Not implemented yet: ".concat(t.type));
return n.startIndex = t.startIndex, n.endIndex = t.endIndex, t.sourceCodeLocation != null && (n.sourceCodeLocation = t.sourceCodeLocation), n;
}
Ze.cloneNode = Yp;
function Zd(t) {
for (var e = t.map(function(r) {
return Yp(r, !0);
}), n = 1; n < e.length; n++)
e[n].prev = e[n - 1], e[n - 1].next = e[n];
return e;
}
(function(t) {
var e = De && De.__createBinding || (Object.create ? function(s, u, l, c) {
c === void 0 && (c = l);
var f = Object.getOwnPropertyDescriptor(u, l);
(!f || ("get" in f ? !u.__esModule : f.writable || f.configurable)) && (f = { enumerable: !0, get: function() {
return u[l];
} }), Object.defineProperty(s, c, f);
} : function(s, u, l, c) {
c === void 0 && (c = l), s[c] = u[l];
}), n = De && De.__exportStar || function(s, u) {
for (var l in s)
l !== "default" && !Object.prototype.hasOwnProperty.call(u, l) && e(u, s, l);
};
Object.defineProperty(t, "__esModule", { value: !0 }), t.DomHandler = void 0;
var r = Xa, i = Ze;
n(Ze, t);
var o = {
withStartIndices: !1,
withEndIndices: !1,
xmlMode: !1
}, a = (
/** @class */
function() {
function s(u, l, c) {
this.dom = [], this.root = new i.Document(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null, typeof l == "function" && (c = l, l = o), typeof u == "object" && (l = u, u = void 0), this.callback = u ?? null, this.options = l ?? o, this.elementCB = c ?? null;
}
return s.prototype.onparserinit = function(u) {
this.parser = u;
}, s.prototype.onreset = function() {
this.dom = [], this.root = new i.Document(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null;
}, s.prototype.onend = function() {
this.done || (this.done = !0, this.parser = null, this.handleCallback(null));
}, s.prototype.onerror = function(u) {
this.handleCallback(u);
}, s.prototype.onclosetag = function() {
this.lastNode = null;
var u = this.tagStack.pop();
this.options.withEndIndices && (u.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(u);
}, s.prototype.onopentag = function(u, l) {
var c = this.options.xmlMode ? r.ElementType.Tag : void 0, f = new i.Element(u, l, void 0, c);
this.addNode(f), this.tagStack.push(f);
}, s.prototype.ontext = function(u) {
var l = this.lastNode;
if (l && l.type === r.ElementType.Text)
l.data += u, this.options.withEndIndices && (l.endIndex = this.parser.endIndex);
else {
var c = new i.Text(u);
this.addNode(c), this.lastNode = c;
}
}, s.prototype.oncomment = function(u) {
if (this.lastNode && this.lastNode.type === r.ElementType.Comment) {
this.lastNode.data += u;
return;
}
var l = new i.Comment(u);
this.addNode(l), this.lastNode = l;
}, s.prototype.oncommentend = function() {
this.lastNode = null;
}, s.prototype.oncdatastart = function() {
var u = new i.Text(""), l = new i.CDATA([u]);
this.addNode(l), u.parent = l, this.lastNode = u;
}, s.prototype.oncdataend = function() {
this.lastNode = null;
}, s.prototype.onprocessinginstruction = function(u, l) {
var c = new i.ProcessingInstruction(u, l);
this.addNode(c);
}, s.prototype.handleCallback = function(u) {
if (typeof this.callback == "function")
this.callback(u, this.dom);
else if (u)
throw u;
}, s.prototype.addNode = function(u) {
var l = this.tagStack[this.tagStack.length - 1], c = l.children[l.children.length - 1];
this.options.withStartIndices && (u.startIndex = this.parser.startIndex), this.options.withEndIndices && (u.endIndex = this.parser.endIndex), l.children.push(u), c && (u.prev = c, c.next = u), u.parent = l, this.lastNode = null;
}, s;
}()
);
t.DomHandler = a, t.default = a;
})(mi);
var hl = {}, Yn = {}, vu = {}, A2 = {}, c0 = {}, Kp = {};
Object.defineProperty(Kp, "__esModule", { value: !0 });
Kp.default = new Uint16Array(
// prettier-ignore
'ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(function(t) {
return t.charCodeAt(0);
})
);
var Gp = {};
Object.defineProperty(Gp, "__esModule", { value: !0 });
Gp.default = new Uint16Array(
// prettier-ignore
"Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(t) {
return t.charCodeAt(0);
})
);
var d0 = {};
(function(t) {
var e;
Object.defineProperty(t, "__esModule", { value: !0 }), t.replaceCodePoint = t.fromCodePoint = void 0;
var n = /* @__PURE__ */ new Map([
[0, 65533],
// C1 Unicode control character reference replacements
[128, 8364],
[130, 8218],
[131, 402],
[132, 8222],
[133, 8230],
[134, 8224],
[135, 8225],
[136, 710],
[137, 8240],
[138, 352],
[139, 8249],
[140, 338],
[142, 381],
[145, 8216],
[146, 8217],
[147, 8220],
[148, 8221],
[149, 8226],
[150, 8211],
[151, 8212],
[152, 732],
[153, 8482],
[154, 353],
[155, 8250],
[156, 339],
[158, 382],
[159, 376]
]);
t.fromCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
(e = String.fromCodePoint) !== null && e !== void 0 ? e : function(o) {
var a = "";
return o > 65535 && (o -= 65536, a += String.fromCharCode(o >>> 10 & 1023 | 55296), o = 56320 | o & 1023), a += String.fromCharCode(o), a;
};
function r(o) {
var a;
return o >= 55296 && o <= 57343 || o > 1114111 ? 65533 : (a = n.get(o)) !== null && a !== void 0 ? a : o;
}
t.replaceCodePoint = r;
function i(o) {
return (0, t.fromCodePoint)(r(o));
}
t.default = i;
})(d0);
(function(t) {
var e = De && De.__createBinding || (Object.create ? function(w, A, $, I) {
I === void 0 && (I = $);
var E = Object.getOwnPropertyDescriptor(A, $);
(!E || ("get" in E ? !A.__esModule : E.writable || E.configurable)) && (E = { enumerable: !0, get: function() {
return A[$];
} }), Object.defineProperty(w, I, E);
} : function(w, A, $, I) {
I === void 0 && (I = $), w[I] = A[$];
}), n = De && De.__setModuleDefault || (Object.create ? function(w, A) {
Object.defineProperty(w, "default", { enumerable: !0, value: A });
} : function(w, A) {
w.default = A;
}), r = De && De.__importStar || function(w) {
if (w && w.__esModule)
return w;
var A = {};
if (w != null)
for (var $ in w)
$ !== "default" && Object.prototype.hasOwnProperty.call(w, $) && e(A, w, $);
return n(A, w), A;
}, i = De && De.__importDefault || function(w) {
return w && w.__esModule ? w : { default: w };
};
Object.defineProperty(t, "__esModule", { value: !0 }), t.decodeXML = t.decodeHTMLStrict = t.decodeHTMLAttribute = t.decodeHTML = t.determineBranch = t.EntityDecoder = t.DecodingMode = t.BinTrieFlags = t.fromCodePoint = t.replaceCodePoint = t.decodeCodePoint = t.xmlDecodeTree = t.htmlDecodeTree = void 0;
var o = i(Kp);
t.htmlDecodeTree = o.default;
var a = i(Gp);
t.xmlDecodeTree = a.default;
var s = r(d0);
t.decodeCodePoint = s.default;
var u = d0;
Object.defineProperty(t, "replaceCodePoint", { enumerable: !0, get: function() {
return u.replaceCodePoint;
} }), Object.defineProperty(t, "fromCodePoint", { enumerable: !0, get: function() {
return u.fromCodePoint;
} });
var l;
(function(w) {
w[w.NUM = 35] = "NUM", w[w.SEMI = 59] = "SEMI", w[w.EQUALS = 61] = "EQUALS", w[w.ZERO = 48] = "ZERO", w[w.NINE = 57] = "NINE", w[w.LOWER_A = 97] = "LOWER_A", w[w.LOWER_F = 102] = "LOWER_F", w[w.LOWER_X = 120] = "LOWER_X", w[w.LOWER_Z = 122] = "LOWER_Z", w[w.UPPER_A = 65] = "UPPER_A", w[w.UPPER_F = 70] = "UPPER_F", w[w.UPPER_Z = 90] = "UPPER_Z";
})(l || (l = {}));
var c = 32, f;
(function(w) {
w[w.VALUE_LENGTH = 49152] = "VALUE_LENGTH", w[w.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", w[w.JUMP_TABLE = 127] = "JUMP_TABLE";
})(f = t.BinTrieFlags || (t.BinTrieFlags = {}));
function d(w) {
return w >= l.ZERO && w <= l.NINE;
}
function p(w) {
return w >= l.UPPER_A && w <= l.UPPER_F || w >= l.LOWER_A && w <= l.LOWER_F;
}
function h(w) {
return w >= l.UPPER_A && w <= l.UPPER_Z || w >= l.LOWER_A && w <= l.LOWER_Z || d(w);
}
function m(w) {
return w === l.EQUALS || h(w);
}
var v;
(function(w) {
w[w.EntityStart = 0] = "EntityStart", w[w.NumericStart = 1] = "NumericStart", w[w.NumericDecimal = 2] = "NumericDecimal", w[w.NumericHex = 3] = "NumericHex", w[w.NamedEntity = 4] = "NamedEntity";
})(v || (v = {}));
var y;
(function(w) {
w[w.Legacy = 0] = "Legacy", w[w.Strict = 1] = "Strict", w[w.Attribute = 2] = "Attribute";
})(y = t.DecodingMode || (t.DecodingMode = {}));
var k = (
/** @class */
function() {
function w(A, $, I) {
this.decodeTree = A, this.emitCodePoint = $, this.errors = I, this.state = v.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = y.Strict;
}
return w.prototype.startEntity = function(A) {
this.decodeMode = A, this.state = v.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
}, w.prototype.write = function(A, $) {
switch (this.state) {
case v.EntityStart:
return A.charCodeAt($) === l.NUM ? (this.state = v.NumericStart, this.consumed += 1, this.stateNumericStart(A, $ + 1)) : (this.state = v.NamedEntity, this.stateNamedEntity(A, $));
case v.NumericStart:
return this.stateNumericStart(A, $);
case v.NumericDecimal:
return this.stateNumericDecimal(A, $);
case v.NumericHex:
return this.stateNumericHex(A, $);
case v.NamedEntity:
return this.stateNamedEntity(A, $);
}
}, w.prototype.stateNumericStart = function(A, $) {
return $ >= A.length ? -1 : (A.charCodeAt($) | c) === l.LOWER_X ? (this.state = v.NumericHex, this.consumed += 1, this.stateNumericHex(A, $ + 1)) : (this.state = v.NumericDecimal, this.stateNumericDecimal(A, $));
}, w.prototype.addToNumericResult = function(A, $, I, E) {
if ($ !== I) {
var O = I - $;
this.result = this.result * Math.pow(E, O) + parseInt(A.substr($, O), E), this.consumed += O;
}
}, w.prototype.stateNumericHex = function(A, $) {
for (var I = $; $ < A.length; ) {
var E = A.charCodeAt($);
if (d(E) || p(E))
$ += 1;
else
return this.addToNumericResult(A, I, $, 16), this.emitNumericEntity(E, 3);
}
return this.addToNumericResult(A, I, $, 16), -1;
}, w.prototype.stateNumericDecimal = function(A, $) {
for (var I = $; $ < A.length; ) {
var E = A.charCodeAt($);
if (d(E))
$ += 1;
else
return this.addToNumericResult(A, I, $, 10), this.emitNumericEntity(E, 2);
}
return this.addToNumericResult(A, I, $, 10), -1;
}, w.prototype.emitNumericEntity = function(A, $) {
var I;
if (this.consumed <= $)
return (I = this.errors) === null || I === void 0 || I.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
if (A === l.SEMI)
this.consumed += 1;
else if (this.decodeMode === y.Strict)
return 0;
return this.emitCodePoint((0, s.replaceCodePoint)(this.result), this.consumed), this.errors && (A !== l.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
}, w.prototype.stateNamedEntity = function(A, $) {
for (var I = this.decodeTree, E = I[this.treeIndex], O = (E & f.VALUE_LENGTH) >> 14; $ < A.length; $++, this.excess++) {
var g = A.charCodeAt($);
if (this.treeIndex = b(I, E, this.treeIndex + Math.max(1, O), g), this.treeIndex < 0)
return this.result === 0 || // If we are parsing an attribute
this.decodeMode === y.Attribute && // We shouldn't have consumed any characters after the entity,
(O === 0 || // And there should be no invalid characters.
m(g)) ? 0 : this.emitNotTerminatedNamedEntity();
if (E = I[this.treeIndex], O = (E & f.VALUE_LENGTH) >> 14, O !== 0) {
if (g === l.SEMI)
return this.emitNamedEntityData(this.treeIndex, O, this.consumed + this.excess);
this.decodeMode !== y.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
}
}
return -1;
}, w.prototype.emitNotTerminatedNamedEntity = function() {
var A, $ = this, I = $.result, E = $.decodeTree, O = (E[I] & f.VALUE_LENGTH) >> 14;
return this.emitNamedEntityData(I, O, this.consumed), (A = this.errors) === null || A === void 0 || A.missingSemicolonAfterCharacterReference(), this.consumed;
}, w.prototype.emitNamedEntityData = function(A, $, I) {
var E = this.decodeTree;
return this.emitCodePoint($ === 1 ? E[A] & ~f.VALUE_LENGTH : E[A + 1], I), $ === 3 && this.emitCodePoint(E[A + 2], I), I;
}, w.prototype.end = function() {
var A;
switch (this.state) {
case v.NamedEntity:
return this.result !== 0 && (this.decodeMode !== y.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
case v.NumericDecimal:
return this.emitNumericEntity(0, 2);
case v.NumericHex:
return this.emitNumericEntity(0, 3);
case v.NumericStart:
return (A = this.errors) === null || A === void 0 || A.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
case v.EntityStart:
return 0;
}
}, w;
}()
);
t.EntityDecoder = k;
function T(w) {
var A = "", $ = new k(w, function(I) {
return A += (0, s.fromCodePoint)(I);
});
return function(E, O) {
for (var g = 0, M = 0; (M = E.indexOf("&", M)) >= 0; ) {
A += E.slice(g, M), $.startEntity(O);
var H = $.write(
E,
// Skip the "&"
M + 1
);
if (H < 0) {
g = M + $.end();
break;
}
g = M + H, M = H === 0 ? g + 1 : g;
}
var z = A + E.slice(g);
return A = "", z;
};
}
function b(w, A, $, I) {
var E = (A & f.BRANCH_LENGTH) >> 7, O = A & f.JUMP_TABLE;
if (E === 0)
return O !== 0 && I === O ? $ : -1;
if (O) {
var g = I - O;
return g < 0 || g >= E ? -1 : w[$ + g] - 1;
}
for (var M = $, H = M + E - 1; M <= H; ) {
var z = M + H >>> 1, Y = w[z];
if (Y < I)
M = z + 1;
else if (Y > I)
H = z - 1;
else
return w[z + E];
}
return -1;
}
t.determineBranch = b;
var D = T(o.default), x = T(a.default);
function S(w, A) {
return A === void 0 && (A = y.Legacy), D(w, A);
}
t.decodeHTML = S;
function _(w) {
return D(w, y.Attribute);
}
t.decodeHTMLAttribute = _;
function N(w) {
return D(w, y.Strict);
}
t.decodeHTMLStrict = N;
function R(w) {
return x(w, y.Strict);
}
t.decodeXML = R;
})(c0);
var Bo = {}, Jp = {};
Object.defineProperty(Jp, "__esModule", { value: !0 });
function Iu(t) {
for (var e = 1; e < t.length; e++)
t[e][0] += t[e - 1][0] + 1;
return t;
}
Jp.default = new Map(/* @__PURE__ */ Iu([[9, "	"], [0, "
"], [22, "!"], [0, """], [0, "#"], [0, "$"], [0, "%"], [0, "&"], [0, "'"], [0, "("], [0, ")"], [0, "*"], [0, "+"], [0, ","], [1, "."], [0, "/"], [10, ":"], [0, ";"], [0, { v: "<", n: 8402, o: "<⃒" }], [0, { v: "=", n: 8421, o: "=⃥" }], [0, { v: ">", n: 8402, o: ">⃒" }], [0, "?"], [0, "@"], [26, "["], [0, "\"], [0, "]"], [0, "^"], [0, "_"], [0, "`"], [5, { n: 106, o: "fj" }], [20, "{"], [0, "|"], [0, "}"], [34, " "], [0, "¡"], [0, "¢"], [0, "£"], [0, "¤"], [0, "¥"], [0, "¦"], [0, "§"], [0, "¨"], [0, "©"], [0, "ª"], [0, "«"], [0, "¬"], [0, "­"], [0, "®"], [0, "¯"], [0, "°"], [0, "±"], [0, "²"], [0, "³"], [0, "´"], [0, "µ"], [0, "¶"], [0, "·"], [0, "¸"], [0, "¹"], [0, "º"], [0, "»"], [0, "¼"], [0, "½"], [0, "¾"], [0, "¿"], [0, "À"], [0, "Á"], [0, "Â"], [0, "Ã"], [0, "Ä"], [0, "Å"], [0, "Æ"], [0, "Ç"], [0, "È"], [0, "É"], [0, "Ê"], [0, "Ë"], [0, "Ì"], [0, "Í"], [0, "Î"], [0, "Ï"], [0, "Ð"], [0, "Ñ"], [0, "Ò"], [0, "Ó"], [0, "Ô"], [0, "Õ"], [0, "Ö"], [0, "×"], [0, "Ø"], [0, "Ù"], [0, "Ú"], [0, "Û"], [0, "Ü"], [0, "Ý"], [0, "Þ"], [0, "ß"], [0, "à"], [0, "á"], [0, "â"], [0, "ã"], [0, "ä"], [0, "å"], [0, "æ"], [0, "ç"], [0, "è"], [0, "é"], [0, "ê"], [0, "ë"], [0, "ì"], [0, "í"], [0, "î"], [0, "ï"], [0, "ð"], [0, "ñ"], [0, "ò"], [0, "ó"], [0, "ô"], [0, "õ"], [0, "ö"], [0, "÷"], [0, "ø"], [0, "ù"], [0, "ú"], [0, "û"], [0, "ü"], [0, "ý"], [0, "þ"], [0, "ÿ"], [0, "Ā"], [0, "ā"], [0, "Ă"], [0, "ă"], [0, "Ą"], [0, "ą"], [0, "Ć"], [0, "ć"], [0, "Ĉ"], [0, "ĉ"], [0, "Ċ"], [0, "ċ"], [0, "Č"], [0, "č"], [0, "Ď"], [0, "ď"], [0, "Đ"], [0, "đ"], [0, "Ē"], [0, "ē"], [2, "Ė"], [0, "ė"], [0, "Ę"], [0, "ę"], [0, "Ě"], [0, "ě"], [0, "Ĝ"], [0, "ĝ"], [0, "Ğ"], [0, "ğ"], [0, "Ġ"], [0, "ġ"], [0, "Ģ"], [1, "Ĥ"], [0, "ĥ"], [0, "Ħ"], [0, "ħ"], [0, "Ĩ"], [0, "ĩ"], [0, "Ī"], [0, "ī"], [2, "Į"], [0, "į"], [0, "İ"], [0, "ı"], [0, "IJ"], [0, "ij"], [0, "Ĵ"], [0, "ĵ"], [0, "Ķ"], [0, "ķ"], [0, "ĸ"], [0, "Ĺ"], [0, "ĺ"], [0, "Ļ"], [0, "ļ"], [0, "Ľ"], [0, "ľ"], [0, "Ŀ"], [0, "ŀ"], [0, "Ł"], [0, "ł"], [0, "Ń"], [0, "ń"], [0, "Ņ"], [0, "ņ"], [0, "Ň"], [0, "ň"], [0, "ʼn"], [0, "Ŋ"], [0, "ŋ"], [0, "Ō"], [0, "ō"], [2, "Ő"], [0, "ő"], [0, "Œ"], [0, "œ"], [0, "Ŕ"], [0, "ŕ"], [0, "Ŗ"], [0, "ŗ"], [0, "Ř"], [0, "ř"], [0, "Ś"], [0, "ś"], [0, "Ŝ"], [0, "ŝ"], [0, "Ş"], [0, "ş"], [0, "Š"], [0, "š"], [0, "Ţ"], [0, "ţ"], [0, "Ť"], [0, "ť"], [0, "Ŧ"], [0, "ŧ"], [0, "Ũ"], [0, "ũ"], [0, "Ū"], [0, "ū"], [0, "Ŭ"], [0, "ŭ"], [0, "Ů"], [0, "ů"], [0, "Ű"], [0, "ű"], [0, "Ų"], [0, "ų"], [0, "Ŵ"], [0, "ŵ"], [0, "Ŷ"], [0, "ŷ"], [0, "Ÿ"], [0, "Ź"], [0, "ź"], [0, "Ż"], [0, "ż"], [0, "Ž"], [0, "ž"], [19, "ƒ"], [34, "Ƶ"], [63, "ǵ"], [65, "ȷ"], [142, "ˆ"], [0, "ˇ"], [16, "˘"], [0, "˙"], [0, "˚"], [0, "˛"], [0, "˜"], [0, "˝"], [51, "̑"], [127, "Α"], [0, "Β"], [0, "Γ"], [0, "Δ"], [0, "Ε"], [0, "Ζ"], [0, "Η"], [0, "Θ"], [0, "Ι"], [0, "Κ"], [0, "Λ"], [0, "Μ"], [0, "Ν"], [0, "Ξ"], [0, "Ο"], [0, "Π"], [0, "Ρ"], [1, "Σ"], [0, "Τ"], [0, "Υ"], [0, "Φ"], [0, "Χ"], [0, "Ψ"], [0, "Ω"], [7, "α"], [0, "β"], [0, "γ"], [0, "δ"], [0, "ε"], [0, "ζ"], [0, "η"], [0, "θ"], [0, "ι"], [0, "κ"], [0, "λ"], [0, "μ"], [0, "ν"], [0, "ξ"], [0, "ο"], [0, "π"], [0, "ρ"], [0, "ς"], [0, "σ"], [0, "τ"], [0, "υ"], [0, "φ"], [0, "χ"], [0, "ψ"], [0, "ω"], [7, "ϑ"], [0, "ϒ"], [2, "ϕ"], [0, "ϖ"], [5, "Ϝ"], [0, "ϝ"], [18, "ϰ"], [0, "ϱ"], [3, "ϵ"], [0, "϶"], [10, "Ё"], [0, "Ђ"], [0, "Ѓ"], [0, "Є"], [0, "Ѕ"], [0, "І"], [0, "Ї"], [0, "Ј"], [0, "Љ"], [0, "Њ"], [0, "Ћ"], [0, "Ќ"], [1, "Ў"], [0, "Џ"], [0, "А"], [0, "Б"], [0, "В"], [0, "Г"], [0, "Д"], [0, "Е"], [0, "Ж"], [0, "З"], [0, "И"], [0, "Й"], [0, "К"], [0, "Л"], [0, "М"], [0, "Н"], [0, "О"], [0, "П"], [0, "Р"], [0, "С"], [0, "Т"], [0, "У"], [0, "Ф"], [0, "Х"], [0, "Ц"], [0, "Ч"], [0, "Ш"], [0, "Щ"], [0, "Ъ"], [0, "Ы"], [0, "Ь"], [0, "Э"], [0, "Ю"], [0, "Я"], [0, "а"], [0, "б"], [0, "в"], [0, "г"], [0, "д"], [0, "е"], [0, "ж"], [0, "з"], [0, "и"], [0, "й"], [0, "к"], [0, "л"], [0, "м"], [0, "н"], [0, "о"], [0, "п"], [0, "р"], [0, "с"], [0, "т"], [0, "у"], [0, "ф"], [0, "х"], [0, "ц"], [0, "ч"], [0, "ш"], [0, "щ"], [0, "ъ"], [0, "ы"], [0, "ь"], [0, "э"], [0, "ю"], [0, "я"], [1, "ё"], [0, "ђ"], [0, "ѓ"], [0, "є"], [0, "ѕ"], [0, "і"], [0, "ї"], [0, "ј"], [0, "љ"], [0, "њ"], [0, "ћ"], [0, "ќ"], [1, "ў"], [0, "џ"], [7074, " "], [0, " "], [0, " "], [0, " "], [1, " "], [0, " "], [0, " "], [0, " "], [0, "​"], [0, "‌"], [0, "‍"], [0, "‎"], [0, "‏"], [0, "‐"], [2, "–"], [0, "—"], [0, "―"], [0, "‖"], [1, "‘"], [0, "’"], [0, "‚"], [1, "“"], [0, "”"], [0, "„"], [1, "†"], [0, "‡"], [0, "•"], [2, "‥"], [0, "…"], [9, "‰"], [0, "‱"], [0, "′"], [0, "″"], [0, "‴"], [0, "‵"], [3, "‹"], [0, "›"], [3, "‾"], [2, "⁁"], [1, "⁃"], [0, "⁄"], [10, "⁏"], [7, "⁗"], [7, { v: " ", n: 8202, o: "  " }], [0, "⁠"], [0, "⁡"], [0, "⁢"], [0, "⁣"], [72, "€"], [46, "⃛"], [0, "⃜"], [37, "ℂ"], [2, "℅"], [4, "ℊ"], [0, "ℋ"], [0, "ℌ"], [0, "ℍ"], [0, "ℎ"], [0, "ℏ"], [0, "ℐ"], [0, "ℑ"], [0, "ℒ"], [0, "ℓ"], [1, "ℕ"], [0, "№"], [0, "℗"], [0, "℘"], [0, "ℙ"], [0, "ℚ"], [0, "ℛ"], [0, "ℜ"], [0, "ℝ"], [0, "℞"], [3, "™"], [1, "ℤ"], [2, "℧"], [0, "ℨ"], [0, "℩"], [2, "ℬ"], [0, "ℭ"], [1, "ℯ"], [0, "ℰ"], [0, "ℱ"], [1, "ℳ"], [0, "ℴ"], [0, "ℵ"], [0, "ℶ"], [0, "ℷ"], [0, "ℸ"], [12, "ⅅ"], [0, "ⅆ"], [0, "ⅇ"], [0, "ⅈ"], [10, "⅓"], [0, "⅔"], [0, "⅕"], [0, "⅖"], [0, "⅗"], [0, "⅘"], [0, "⅙"], [0, "⅚"], [0, "⅛"], [0, "⅜"], [0, "⅝"], [0, "⅞"], [49, "←"], [0, "↑"], [0, "→"], [0, "↓"], [0, "↔"], [0, "↕"], [0, "↖"], [0, "↗"], [0, "↘"], [0, "↙"], [0, "↚"], [0, "↛"], [1, { v: "↝", n: 824, o: "↝̸" }], [0, "↞"], [0, "↟"], [0, "↠"], [0, "↡"], [0, "↢"], [0, "↣"], [0, "↤"], [0, "↥"], [0, "↦"], [0, "↧"], [1, "↩"], [0, "↪"], [0, "↫"], [0, "↬"], [0, "↭"], [0, "↮"], [1, "↰"], [0, "↱"], [0, "↲"], [0, "↳"], [1, "↵"], [0, "↶"], [0, "↷"], [2, "↺"], [0, "↻"], [0, "↼"], [0, "↽"], [0, "↾"], [0, "↿"], [0, "⇀"], [0, "⇁"], [0, "⇂"], [0, "⇃"], [0, "⇄"], [0, "⇅"], [0, "⇆"], [0, "⇇"], [0, "⇈"], [0, "⇉"], [0, "⇊"], [0, "⇋"], [0, "⇌"], [0, "⇍"], [0, "⇎"], [0, "⇏"], [0, "⇐"], [0, "⇑"], [0, "⇒"], [0, "⇓"], [0, "⇔"], [0, "⇕"], [0, "⇖"], [0, "⇗"], [0, "⇘"], [0, "⇙"], [0, "⇚"], [0, "⇛"], [1, "⇝"], [6, "⇤"], [0, "⇥"], [15, "⇵"], [7, "⇽"], [0, "⇾"], [0, "⇿"], [0, "∀"], [0, "∁"], [0, { v: "∂", n: 824, o: "∂̸" }], [0, "∃"], [0, "∄"], [0, "∅"], [1, "∇"], [0, "∈"], [0, "∉"], [1, "∋"], [0, "∌"], [2, "∏"], [0, "∐"], [0, "∑"], [0, "−"], [0, "∓"], [0, "∔"], [1, "∖"], [0, "∗"], [0, "∘"], [1, "√"], [2, "∝"], [0, "∞"], [0, "∟"], [0, { v: "∠", n: 8402, o: "∠⃒" }], [0, "∡"], [0, "∢"], [0, "∣"], [0, "∤"], [0, "∥"], [0, "∦"], [0, "∧"], [0, "∨"], [0, { v: "∩", n: 65024, o: "∩︀" }], [0, { v: "∪", n: 65024, o: "∪︀" }], [0, "∫"], [0, "∬"], [0, "∭"], [0, "∮"], [0, "∯"], [0, "∰"], [0, "∱"], [0, "∲"], [0, "∳"], [0, "∴"], [0, "∵"], [0, "∶"], [0, "∷"], [0, "∸"], [1, "∺"], [0, "∻"], [0, { v: "∼", n: 8402, o: "∼⃒" }], [0, { v: "∽", n: 817, o: "∽̱" }], [0, { v: "∾", n: 819, o: "∾̳" }], [0, "∿"], [0, "≀"], [0, "≁"], [0, { v: "≂", n: 824, o: "≂̸" }], [0, "≃"], [0, "≄"], [0, "≅"], [0, "≆"], [0, "≇"], [0, "≈"], [0, "≉"], [0, "≊"], [0, { v: "≋", n: 824, o: "≋̸" }], [0, "≌"], [0, { v: "≍", n: 8402, o: "≍⃒" }], [0, { v: "≎", n: 824, o: "≎̸" }], [0, { v: "≏", n: 824, o: "≏̸" }], [0, { v: "≐", n: 824, o: "≐̸" }], [0, "≑"], [0, "≒"], [0, "≓"], [0, "≔"], [0, "≕"], [0, "≖"], [0, "≗"], [1, "≙"], [0, "≚"], [1, "≜"], [2, "≟"], [0, "≠"], [0, { v: "≡", n: 8421, o: "≡⃥" }], [0, "≢"], [1, { v: "≤", n: 8402, o: "≤⃒" }], [0, { v: "≥", n: 8402, o: "≥⃒" }], [0, { v: "≦", n: 824, o: "≦̸" }], [0, { v: "≧", n: 824, o: "≧̸" }], [0, { v: "≨", n: 65024, o: "≨︀" }], [0, { v: "≩", n: 65024, o: "≩︀" }], [0, { v: "≪", n: new Map(/* @__PURE__ */ Iu([[824, "≪̸"], [7577, "≪⃒"]])) }], [0, { v: "≫", n: new Map(/* @__PURE__ */ Iu([[824, "≫̸"], [7577, "≫⃒"]])) }], [0, "≬"], [0, "≭"], [0, "≮"], [0, "≯"], [0, "≰"], [0, "≱"], [0, "≲"], [0, "≳"], [0, "≴"], [0, "≵"], [0, "≶"], [0, "≷"], [0, "≸"], [0, "≹"], [0, "≺"], [0, "≻"], [0, "≼"], [0, "≽"], [0, "≾"], [0, { v: "≿", n: 824, o: "≿̸" }], [0, "⊀"], [0, "⊁"], [0, { v: "⊂", n: 8402, o: "⊂⃒" }], [0, { v: "⊃", n: 8402, o: "⊃⃒" }], [0, "⊄"], [0, "⊅"], [0, "⊆"], [0, "⊇"], [0, "⊈"], [0, "⊉"], [0, { v: "⊊", n: 65024, o: "⊊︀" }], [0, { v: "⊋", n: 65024, o: "⊋︀" }], [1, "⊍"], [0, "⊎"], [0, { v: "⊏", n: 824, o: "⊏̸" }], [0, { v: "⊐", n: 824, o: "⊐̸" }], [0, "⊑"], [0, "⊒"], [0, { v: "⊓", n: 65024, o: "⊓︀" }], [0, { v: "⊔", n: 65024, o: "⊔︀" }], [0, "⊕"], [0, "⊖"], [0, "⊗"], [0, "⊘"], [0, "⊙"], [0, "⊚"], [0, "⊛"], [1, "⊝"], [0, "⊞"], [0, "⊟"], [0, "⊠"], [0, "⊡"], [0, "⊢"], [0, "⊣"], [0, "⊤"], [0, "⊥"], [1, "⊧"], [0, "⊨"], [0, "⊩"], [0, "⊪"], [0, "⊫"], [0, "⊬"], [0, "⊭"], [0, "⊮"], [0, "⊯"], [0, "⊰"], [1, "⊲"], [0, "⊳"], [0, { v: "⊴", n: 8402, o: "⊴⃒" }], [0, { v: "⊵", n: 8402, o: "⊵⃒" }], [0, "⊶"], [0, "⊷"], [0, "⊸"], [0, "⊹"], [0, "⊺"], [0, "⊻"], [1, "⊽"], [0, "⊾"], [0, "⊿"], [0, "⋀"], [0, "⋁"], [0, "⋂"], [0, "⋃"], [0, "⋄"], [0, "⋅"], [0, "⋆"], [0, "⋇"], [0, "⋈"], [0, "⋉"], [0, "⋊"], [0, "⋋"], [0, "⋌"], [0, "⋍"], [0, "⋎"], [0, "⋏"], [0, "⋐"], [0, "⋑"], [0, "⋒"], [0, "⋓"], [0, "⋔"], [0, "⋕"], [0, "⋖"], [0, "⋗"], [0, { v: "⋘", n: 824, o: "⋘̸" }], [0, { v: "⋙", n: 824, o: "⋙̸" }], [0, { v: "⋚", n: 65024, o: "⋚︀" }], [0, { v: "⋛", n: 65024, o: "⋛︀" }], [2, "⋞"], [0, "⋟"], [0, "⋠"], [0, "⋡"], [0, "⋢"], [0, "⋣"], [2, "⋦"], [0, "⋧"], [0, "⋨"], [0, "⋩"], [0, "⋪"], [0, "⋫"], [0, "⋬"], [0, "⋭"], [0, "⋮"], [0, "⋯"], [0, "⋰"], [0, "⋱"], [0, "⋲"], [0, "⋳"], [0, "⋴"], [0, { v: "⋵", n: 824, o: "⋵̸" }], [0, "⋶"], [0, "⋷"], [1, { v: "⋹", n: 824, o: "⋹̸" }], [0, "⋺"], [0, "⋻"], [0, "⋼"], [0, "⋽"], [0, "⋾"], [6, "⌅"], [0, "⌆"], [1, "⌈"], [0, "⌉"], [0, "⌊"], [0, "⌋"], [0, "⌌"], [0, "⌍"], [0, "⌎"], [0, "⌏"], [0, "⌐"], [1, "⌒"], [0, "⌓"], [1, "⌕"], [0, "⌖"], [5, "⌜"], [0, "⌝"], [0, "⌞"], [0, "⌟"], [2, "⌢"], [0, "⌣"], [9, "⌭"], [0, "⌮"], [7, "⌶"], [6, "⌽"], [1, "⌿"], [60, "⍼"], [51, "⎰"], [0, "⎱"], [2, "⎴"], [0, "⎵"], [0, "⎶"], [37, "⏜"], [0, "⏝"], [0, "⏞"], [0, "⏟"], [2, "⏢"], [4, "⏧"], [59, "␣"], [164, "Ⓢ"], [55, "─"], [1, "│"], [9, "┌"], [3, "┐"], [3, "└"], [3, "┘"], [3, "├"], [7, "┤"], [7, "┬"], [7, "┴"], [7, "┼"], [19, "═"], [0, "║"], [0, "╒"], [0, "╓"], [0, "╔"], [0, "╕"], [0, "╖"], [0, "╗"], [0, "╘"], [0, "╙"], [0, "╚"], [0, "╛"], [0, "╜"], [0, "╝"], [0, "╞"], [0, "╟"], [0, "╠"], [0, "╡"], [0, "╢"], [0, "╣"], [0, "╤"], [0, "╥"], [0, "╦"], [0, "╧"], [0, "╨"], [0, "╩"], [0, "╪"], [0, "╫"], [0, "╬"], [19, "▀"], [3, "▄"], [3, "█"], [8, "░"], [0, "▒"], [0, "▓"], [13, "□"], [8, "▪"], [0, "▫"], [1, "▭"], [0, "▮"], [2, "▱"], [1, "△"], [0, "▴"], [0, "▵"], [2, "▸"], [0, "▹"], [3, "▽"], [0, "▾"], [0, "▿"], [2, "◂"], [0, "◃"], [6, "◊"], [0, "○"], [32, "◬"], [2, "◯"], [8, "◸"], [0, "◹"], [0, "◺"], [0, "◻"], [0, "◼"], [8, "★"], [0, "☆"], [7, "☎"], [49, "♀"], [1, "♂"], [29, "♠"], [2, "♣"], [1, "♥"], [0, "♦"], [3, "♪"], [2, "♭"], [0, "♮"], [0, "♯"], [163, "✓"], [3, "✗"], [8, "✠"], [21, "✶"], [33, "❘"], [25, "❲"], [0, "❳"], [84, "⟈"], [0, "⟉"], [28, "⟦"], [0, "⟧"], [0, "⟨"], [0, "⟩"], [0, "⟪"], [0, "⟫"], [0, "⟬"], [0, "⟭"], [7, "⟵"], [0, "⟶"], [0, "⟷"], [0, "⟸"], [0, "⟹"], [0, "⟺"], [1, "⟼"], [2, "⟿"], [258, "⤂"], [0, "⤃"], [0, "⤄"], [0, "⤅"], [6, "⤌"], [0, "⤍"], [0, "⤎"], [0, "⤏"], [0, "⤐"], [0, "⤑"], [0, "⤒"], [0, "⤓"], [2, "⤖"], [2, "⤙"], [0, "⤚"], [0, "⤛"], [0, "⤜"], [0, "⤝"], [0, "⤞"], [0, "⤟"], [0, "⤠"], [2, "⤣"], [0, "⤤"], [0, "⤥"], [0, "⤦"], [0, "⤧"], [0, "⤨"], [0, "⤩"], [0, "⤪"], [8, { v: "⤳", n: 824, o: "⤳̸" }], [1, "⤵"], [0, "⤶"], [0, "⤷"], [0, "⤸"], [0, "⤹"], [2, "⤼"], [0, "⤽"], [7, "⥅"], [2, "⥈"], [0, "⥉"], [0, "⥊"], [0, "⥋"], [2, "⥎"], [0, "⥏"], [0, "⥐"], [0, "⥑"], [0, "⥒"], [0, "⥓"], [0, "⥔"], [0, "⥕"], [0, "⥖"], [0, "⥗"], [0, "⥘"], [0, "⥙"], [0, "⥚"], [0, "⥛"], [0, "⥜"], [0, "⥝"], [0, "⥞"], [0, "⥟"], [0, "⥠"], [0, "⥡"], [0, "⥢"], [0, "⥣"], [0, "⥤"], [0, "⥥"], [0, "⥦"], [0, "⥧"], [0, "⥨"], [0, "⥩"], [0, "⥪"], [0, "⥫"], [0, "⥬"], [0, "⥭"], [0, "⥮"], [0, "⥯"], [0, "⥰"], [0, "⥱"], [0, "⥲"], [0, "⥳"], [0, "⥴"], [0, "⥵"], [0, "⥶"], [1, "⥸"], [0, "⥹"], [1, "⥻"], [0, "⥼"], [0, "⥽"], [0, "⥾"], [0, "⥿"], [5, "⦅"], [0, "⦆"], [4, "⦋"], [0, "⦌"], [0, "⦍"], [0, "⦎"], [0, "⦏"], [0, "⦐"], [0, "⦑"], [0, "⦒"], [0, "⦓"], [0, "⦔"], [0, "⦕"], [0, "⦖"], [3, "⦚"], [1, "⦜"], [0, "⦝"], [6, "⦤"], [0, "⦥"], [0, "⦦"], [0, "⦧"], [0, "⦨"], [0, "⦩"], [0, "⦪"], [0, "⦫"], [0, "⦬"], [0, "⦭"], [0, "⦮"], [0, "⦯"], [0, "⦰"], [0, "⦱"], [0, "⦲"], [0, "⦳"], [0, "⦴"], [0, "⦵"], [0, "⦶"], [0, "⦷"], [1, "⦹"], [1, "⦻"], [0, "⦼"], [1, "⦾"], [0, "⦿"], [0, "⧀"], [0, "⧁"], [0, "⧂"], [0, "⧃"], [0, "⧄"], [0, "⧅"], [3, "⧉"], [3, "⧍"], [0, "⧎"], [0, { v: "⧏", n: 824, o: "⧏̸" }], [0, { v: "⧐", n: 824, o: "⧐̸" }], [11, "⧜"], [0, "⧝"], [0, "⧞"], [4, "⧣"], [0, "⧤"], [0, "⧥"], [5, "⧫"], [8, "⧴"], [1, "⧶"], [9, "⨀"], [0, "⨁"], [0, "⨂"], [1, "⨄"], [1, "⨆"], [5, "⨌"], [0, "⨍"], [2, "⨐"], [0, "⨑"], [0, "⨒"], [0, "⨓"], [0, "⨔"], [0, "⨕"], [0, "⨖"], [0, "⨗"], [10, "⨢"], [0, "⨣"], [0, "⨤"], [0, "⨥"], [0, "⨦"], [0, "⨧"], [1, "⨩"], [0, "⨪"], [2, "⨭"], [0, "⨮"], [0, "⨯"], [0, "⨰"], [0, "⨱"], [1, "⨳"], [0, "⨴"], [0, "⨵"], [0, "⨶"], [0, "⨷"], [0, "⨸"], [0, "⨹"], [0, "⨺"], [0, "⨻"], [0, "⨼"], [2, "⨿"], [0, "⩀"], [1, "⩂"], [0, "⩃"], [0, "⩄"], [0, "⩅"], [0, "⩆"], [0, "⩇"], [0, "⩈"], [0, "⩉"], [0, "⩊"], [0, "⩋"], [0, "⩌"], [0, "⩍"], [2, "⩐"], [2, "⩓"], [0, "⩔"], [0, "⩕"], [0, "⩖"], [0, "⩗"], [0, "⩘"], [1, "⩚"], [0, "⩛"], [0, "⩜"], [0, "⩝"], [1, "⩟"], [6, "⩦"], [3, "⩪"], [2, { v: "⩭", n: 824, o: "⩭̸" }], [0, "⩮"], [0, "⩯"], [0, { v: "⩰", n: 824, o: "⩰̸" }], [0, "⩱"], [0, "⩲"], [0, "⩳"], [0, "⩴"], [0, "⩵"], [1, "⩷"], [0, "⩸"], [0, "⩹"], [0, "⩺"], [0, "⩻"], [0, "⩼"], [0, { v: "⩽", n: 824, o: "⩽̸" }], [0, { v: "⩾", n: 824, o: "⩾̸" }], [0, "⩿"], [0, "⪀"], [0, "⪁"], [0, "⪂"], [0, "⪃"], [0, "⪄"], [0, "⪅"], [0, "⪆"], [0, "⪇"], [0, "⪈"], [0, "⪉"], [0, "⪊"], [0, "⪋"], [0, "⪌"], [0, "⪍"], [0, "⪎"], [0, "⪏"], [0, "⪐"], [0, "⪑"], [0, "⪒"], [0, "⪓"], [0, "⪔"], [0, "⪕"], [0, "⪖"], [0, "⪗"], [0, "⪘"], [0, "⪙"], [0, "⪚"], [2, "⪝"], [0, "⪞"], [0, "⪟"], [0, "⪠"], [0, { v: "⪡", n: 824, o: "⪡̸" }], [0, { v: "⪢", n: 824, o: "⪢̸" }], [1, "⪤"], [0, "⪥"], [0, "⪦"], [0, "⪧"], [0, "⪨"], [0, "⪩"], [0, "⪪"], [0, "⪫"], [0, { v: "⪬", n: 65024, o: "⪬︀" }], [0, { v: "⪭", n: 65024, o: "⪭︀" }], [0, "⪮"], [0, { v: "⪯", n: 824, o: "⪯̸" }], [0, { v: "⪰", n: 824, o: "⪰̸" }], [2, "⪳"], [0, "⪴"], [0, "⪵"], [0, "⪶"], [0, "⪷"], [0, "⪸"], [0, "⪹"], [0, "⪺"], [0, "⪻"], [0, "⪼"], [0, "⪽"], [0, "⪾"], [0, "⪿"], [0, "⫀"], [0, "⫁"], [0, "⫂"], [0, "⫃"], [0, "⫄"], [0, { v: "⫅", n: 824, o: "⫅̸" }], [0, { v: "⫆", n: 824, o: "⫆̸" }], [0, "⫇"], [0, "⫈"], [2, { v: "⫋", n: 65024, o: "⫋︀" }], [0, { v: "⫌", n: 65024, o: "⫌︀" }], [2, "⫏"], [0, "⫐"], [0, "⫑"], [0, "⫒"], [0, "⫓"], [0, "⫔"], [0, "⫕"], [0, "⫖"], [0, "⫗"], [0, "⫘"], [0, "⫙"], [0, "⫚"], [0, "⫛"], [8, "⫤"], [1, "⫦"], [0, "⫧"], [0, "⫨"], [0, "⫩"], [1, "⫫"], [0, "⫬"], [0, "⫭"], [0, "⫮"], [0, "⫯"], [0, "⫰"], [0, "⫱"], [0, "⫲"], [0, "⫳"], [9, { v: "⫽", n: 8421, o: "⫽⃥" }], [44343, { n: new Map(/* @__PURE__ */ Iu([[56476, "𝒜"], [1, "𝒞"], [0, "𝒟"], [2, "𝒢"], [2, "𝒥"], [0, "𝒦"], [2, "𝒩"], [0, "𝒪"], [0, "𝒫"], [0, "𝒬"], [1, "𝒮"], [0, "𝒯"], [0, "𝒰"], [0, "𝒱"], [0, "𝒲"], [0, "𝒳"], [0, "𝒴"], [0, "𝒵"], [0, "𝒶"], [0, "𝒷"], [0, "𝒸"], [0, "𝒹"], [1, "𝒻"], [1, "𝒽"], [0, "𝒾"], [0, "𝒿"], [0, "𝓀"], [0, "𝓁"], [0, "𝓂"], [0, "𝓃"], [1, "𝓅"], [0, "𝓆"], [0, "𝓇"], [0, "𝓈"], [0, "𝓉"], [0, "𝓊"], [0, "𝓋"], [0, "𝓌"], [0, "𝓍"], [0, "𝓎"], [0, "𝓏"], [52, "𝔄"], [0, "𝔅"], [1, "𝔇"], [0, "𝔈"], [0, "𝔉"], [0, "𝔊"], [2, "𝔍"], [0, "𝔎"], [0, "𝔏"], [0, "𝔐"], [0, "𝔑"], [0, "𝔒"], [0, "𝔓"], [0, "𝔔"], [1, "𝔖"], [0, "𝔗"], [0, "𝔘"], [0, "𝔙"], [0, "𝔚"], [0, "𝔛"], [0, "𝔜"], [1, "𝔞"], [0, "𝔟"], [0, "𝔠"], [0, "𝔡"], [0, "𝔢"], [0, "𝔣"], [0, "𝔤"], [0, "𝔥"], [0, "𝔦"], [0, "𝔧"], [0, "𝔨"], [0, "𝔩"], [0, "𝔪"], [0, "𝔫"], [0, "𝔬"], [0, "𝔭"], [0, "𝔮"], [0, "𝔯"], [0, "𝔰"], [0, "𝔱"], [0, "𝔲"], [0, "𝔳"], [0, "𝔴"], [0, "𝔵"], [0, "𝔶"], [0, "𝔷"], [0, "𝔸"], [0, "𝔹"], [1, "𝔻"], [0, "𝔼"], [0, "𝔽"], [0, "𝔾"], [1, "𝕀"], [0, "𝕁"], [0, "𝕂"], [0, "𝕃"], [0, "𝕄"], [1, "𝕆"], [3, "𝕊"], [0, "𝕋"], [0, "𝕌"], [0, "𝕍"], [0, "𝕎"], [0, "𝕏"], [0, "𝕐"], [1, "𝕒"], [0, "𝕓"], [0, "𝕔"], [0, "𝕕"], [0, "𝕖"], [0, "𝕗"], [0, "𝕘"], [0, "𝕙"], [0, "𝕚"], [0, "𝕛"], [0, "𝕜"], [0, "𝕝"], [0, "𝕞"], [0, "𝕟"], [0, "𝕠"], [0, "𝕡"], [0, "𝕢"], [0, "𝕣"], [0, "𝕤"], [0, "𝕥"], [0, "𝕦"], [0, "𝕧"], [0, "𝕨"], [0, "𝕩"], [0, "𝕪"], [0, "𝕫"]])) }], [8906, "ff"], [0, "fi"], [0, "fl"], [0, "ffi"], [0, "ffl"]]));
var Fl = {};
(function(t) {
Object.defineProperty(t, "__esModule", { value: !0 }), t.escapeText = t.escapeAttribute = t.escapeUTF8 = t.escape = t.encodeXML = t.getCodePoint = t.xmlReplacer = void 0, t.xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
var e = /* @__PURE__ */ new Map([
[34, """],
[38, "&"],
[39, "'"],
[60, "<"],
[62, ">"]
]);
t.getCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
String.prototype.codePointAt != null ? function(i, o) {
return i.codePointAt(o);
} : (
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
function(i, o) {
return (i.charCodeAt(o) & 64512) === 55296 ? (i.charCodeAt(o) - 55296) * 1024 + i.charCodeAt(o + 1) - 56320 + 65536 : i.charCodeAt(o);
}
);
function n(i) {
for (var o = "", a = 0, s; (s = t.xmlReplacer.exec(i)) !== null; ) {
var u = s.index, l = i.charCodeAt(u), c = e.get(l);
c !== void 0 ? (o += i.substring(a, u) + c, a = u + 1) : (o += "".concat(i.substring(a, u), "&#x").concat((0, t.getCodePoint)(i, u).toString(16), ";"), a = t.xmlReplacer.lastIndex += +((l & 64512) === 55296));
}
return o + i.substr(a);
}
t.encodeXML = n, t.escape = n;
function r(i, o) {
return function(s) {
for (var u, l = 0, c = ""; u = i.exec(s); )
l !== u.index && (c += s.substring(l, u.index)), c += o.get(u[0].charCodeAt(0)), l = u.index + 1;
return c + s.substring(l);
};
}
t.escapeUTF8 = r(/[&<>'"]/g, e), t.escapeAttribute = r(/["&\u00A0]/g, /* @__PURE__ */ new Map([
[34, """],
[38, "&"],
[160, " "]
])), t.escapeText = r(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
[38, "&"],
[60, "<"],
[62, ">"],
[160, " "]
]));
})(Fl);
var lD = De && De.__importDefault || function(t) {
return t && t.__esModule ? t : { default: t };
};
Object.defineProperty(Bo, "__esModule", { value: !0 });
Bo.encodeNonAsciiHTML = Bo.encodeHTML = void 0;
var cD = lD(Jp), M2 = Fl, dD = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;
function fD(t) {
return D2(dD, t);
}
Bo.encodeHTML = fD;
function pD(t) {
return D2(M2.xmlReplacer, t);
}
Bo.encodeNonAsciiHTML = pD;
function D2(t, e) {
for (var n = "", r = 0, i; (i = t.exec(e)) !== null; ) {
var o = i.index;
n += e.substring(r, o);
var a = e.charCodeAt(o), s = cD.default.get(a);
if (typeof s == "object") {
if (o + 1 < e.length) {
var u = e.charCodeAt(o + 1), l = typeof s.n == "number" ? s.n === u ? s.o : void 0 : s.n.get(u);
if (l !== void 0) {
n += l, r = t.lastIndex += 1;
continue;
}
}
s = s.v;
}
if (s !== void 0)
n += s, r = o + 1;
else {
var c = (0, M2.getCodePoint)(e, o);
n += "&#x".concat(c.toString(16), ";"), r = t.lastIndex += +(c !== a);
}
}
return n + e.substr(r);
}
(function(t) {
Object.defineProperty(t, "__esModule", { value: !0 }), t.decodeXMLStrict = t.decodeHTML5Strict = t.decodeHTML4Strict = t.decodeHTML5 = t.decodeHTML4 = t.decodeHTMLAttribute = t.decodeHTMLStrict = t.decodeHTML = t.decodeXML = t.DecodingMode = t.EntityDecoder = t.encodeHTML5 = t.encodeHTML4 = t.encodeNonAsciiHTML = t.encodeHTML = t.escapeText = t.escapeAttribute = t.escapeUTF8 = t.escape = t.encodeXML = t.encode = t.decodeStrict = t.decode = t.EncodingMode = t.EntityLevel = void 0;
var e = c0, n = Bo, r = Fl, i;
(function(d) {
d[d.XML = 0] = "XML", d[d.HTML = 1] = "HTML";
})(i = t.EntityLevel || (t.EntityLevel = {}));
var o;
(function(d) {
d[d.UTF8 = 0] = "UTF8", d[d.ASCII = 1] = "ASCII", d[d.Extensive = 2] = "Extensive", d[d.Attribute = 3] = "Attribute", d[d.Text = 4] = "Text";
})(o = t.EncodingMode || (t.EncodingMode = {}));
function a(d, p) {
p === void 0 && (p = i.XML);
var h = typeof p == "number" ? p : p.level;
if (h === i.HTML) {
var m = typeof p == "object" ? p.mode : void 0;
return (0, e.decodeHTML)(d, m);
}
return (0, e.decodeXML)(d);
}
t.decode = a;
function s(d, p) {
var h;
p === void 0 && (p = i.XML);
var m = typeof p == "number" ? { level: p } : p;
return (h = m.mode) !== null && h !== void 0 || (m.mode = e.DecodingMode.Strict), a(d, m);
}
t.decodeStrict = s;
function u(d, p) {
p === void 0 && (p = i.XML);
var h = typeof p == "number" ? { level: p } : p;
return h.mode === o.UTF8 ? (0, r.escapeUTF8)(d) : h.mode === o.Attribute ? (0, r.escapeAttribute)(d) : h.mode === o.Text ? (0, r.escapeText)(d) : h.level === i.HTML ? h.mode === o.ASCII ? (0, n.encodeNonAsciiHTML)(d) : (0, n.encodeHTML)(d) : (0, r.encodeXML)(d);
}
t.encode = u;
var l = Fl;
Object.defineProperty(t, "encodeXML", { enumerable: !0, get: function() {
return l.encodeXML;
} }), Object.defineProperty(t, "escape", { enumerable: !0, get: function() {
return l.escape;
} }), Object.defineProperty(t, "escapeUTF8", { enumerable: !0, get: function() {
return l.escapeUTF8;
} }), Object.defineProperty(t, "escapeAttribute", { enumerable: !0, get: function() {
return l.escapeAttribute;
} }), Object.defineProperty(t, "escapeText", { enumerable: !0, get: function() {
return l.escapeText;
} });
var c = Bo;
Object.defineProperty(t, "encodeHTML", { enumerable: !0, get: function() {
return c.encodeHTML;
} }), Object.defineProperty(t, "encodeNonAsciiHTML", { enumerable: !0, get: function() {
return c.encodeNonAsciiHTML;
} }), Object.defineProperty(t, "encodeHTML4", { enumerable: !0, get: function() {
return c.encodeHTML;
} }), Object.defineProperty(t, "encodeHTML5", { enumerable: !0, get: function() {
return c.encodeHTML;
} });
var f = c0;
Object.defineProperty(t, "EntityDecoder", { enumerable: !0, get: function() {
return f.EntityDecoder;
} }), Object.defineProperty(t, "DecodingMode", { enumerable: !0, get: function() {
return f.DecodingMode;
} }), Object.defineProperty(t, "decodeXML", { enumerable: !0, get: function() {
return f.decodeXML;
} }), Object.defineProperty(t, "decodeHTML", { enumerable: !0, get: function() {
return f.decodeHTML;
} }), Object.defineProperty(t, "decodeHTMLStrict", { enumerable: !0, get: function() {
return f.decodeHTMLStrict;
} }), Object.defineProperty(t, "decodeHTMLAttribute", { enumerable: !0, get: function() {
return f.decodeHTMLAttribute;
} }), Object.defineProperty(t, "decodeHTML4", { enumerable: !0, get: function() {
return f.decodeHTML;
} }), Object.defineProperty(t, "decodeHTML5", { enumerable: !0, get: function() {
return f.decodeHTML;
} }), Object.defineProperty(t, "decodeHTML4Strict", { enumerable: !0, get: function() {
return f.decodeHTMLStrict;
} }), Object.defineProperty(t, "decodeHTML5Strict", { enumerable: !0, get: function() {
return f.decodeHTMLStrict;
} }), Object.defineProperty(t, "decodeXMLStrict", { enumerable: !0, get: function() {
return f.decodeXML;
} });
})(A2);
var Ba = {};
Object.defineProperty(Ba, "__esModule", { value: !0 });
Ba.attributeNames = Ba.elementNames = void 0;
Ba.elementNames = new Map([
"altGlyph",
"altGlyphDef",
"altGlyphItem",
"animateColor",
"animateMotion",
"animateTransform",
"clipPath",
"feBlend",
"feColorMatrix",
"feComponentTransfer",
"feComposite",
"feConvolveMatrix",
"feDiffuseLighting",
"feDisplacementMap",
"feDistantLight",
"feDropShadow",
"feFlood",
"feFuncA",
"feFuncB",
"feFuncG",
"feFuncR",
"feGaussianBlur",
"feImage",
"feMerge",
"feMergeNode",
"feMorphology",
"feOffset",
"fePointLight",
"feSpecularLighting",
"feSpotLight",
"feTile",
"feTurbulence",
"foreignObject",
"glyphRef",
"linearGradient",
"radialGradient",
"textPath"
].map(function(t) {
return [t.toLowerCase(), t];
}));
Ba.attributeNames = new Map([
"definitionURL",
"attributeName",
"attributeType",
"baseFrequency",
"baseProfile",
"calcMode",
"clipPathUnits",
"diffuseConstant",
"edgeMode",
"filterUnits",
"glyphRef",
"gradientTransform",
"gradientUnits",
"kernelMatrix",
"kernelUnitLength",
"keyPoints",
"keySplines",
"keyTimes",
"lengthAdjust",
"limitingConeAngle",
"markerHeight",
"markerUnits",
"markerWidth",
"maskContentUnits",
"maskUnits",
"numOctaves",
"pathLength",
"patternContentUnits",
"patternTransform",
"patternUnits",
"pointsAtX",
"pointsAtY",
"pointsAtZ",
"preserveAlpha",
"preserveAspectRatio",
"primitiveUnits",
"refX",
"refY",
"repeatCount",
"repeatDur",
"requiredExtensions",
"requiredFeatures",
"specularConstant",
"specularExponent",
"spreadMethod",
"startOffset",
"stdDeviation",
"stitchTiles",
"surfaceScale",
"systemLanguage",
"tableValues",
"targetX",
"targetY",
"textLength",
"viewBox",
"viewTarget",
"xChannelSelector",
"yChannelSelector",
"zoomAndPan"
].map(function(t) {
return [t.toLowerCase(), t];
}));
var la = De && De.__assign || function() {
return la = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, la.apply(this, arguments);
}, hD = De && De.__createBinding || (Object.create ? function(t, e, n, r) {
r === void 0 && (r = n);
var i = Object.getOwnPropertyDescriptor(e, n);
(!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = { enumerable: !0, get: function() {
return e[n];
} }), Object.defineProperty(t, r, i);
} : function(t, e, n, r) {
r === void 0 && (r = n), t[r] = e[n];
}), mD = De && De.__setModuleDefault || (Object.create ? function(t, e) {
Object.defineProperty(t, "default", { enumerable: !0, value: e });
} : function(t, e) {
t.default = e;
}), gD = De && De.__importStar || function(t) {
if (t && t.__esModule)
return t;
var e = {};
if (t != null)
for (var n in t)
n !== "default" && Object.prototype.hasOwnProperty.call(t, n) && hD(e, t, n);
return mD(e, t), e;
};
Object.defineProperty(vu, "__esModule", { value: !0 });
vu.render = void 0;
var ti = gD(Xa), jl = A2, $2 = Ba, bD = /* @__PURE__ */ new Set([
"style",
"script",
"xmp",
"iframe",
"noembed",
"noframes",
"plaintext",
"noscript"
]);
function vD(t) {
return t.replace(/"/g, """);
}
function yD(t, e) {
var n;
if (t) {
var r = ((n = e.encodeEntities) !== null && n !== void 0 ? n : e.decodeEntities) === !1 ? vD : e.xmlMode || e.encodeEntities !== "utf8" ? jl.encodeXML : jl.escapeAttribute;
return Object.keys(t).map(function(i) {
var o, a, s = (o = t[i]) !== null && o !== void 0 ? o : "";
return e.xmlMode === "foreign" && (i = (a = $2.attributeNames.get(i)) !== null && a !== void 0 ? a : i), !e.emptyAttrs && !e.xmlMode && s === "" ? i : "".concat(i, '="').concat(r(s), '"');
}).join(" ");
}
}
var B1 = /* @__PURE__ */ new Set([
"area",
"base",
"basefont",
"br",
"col",
"command",
"embed",
"frame",
"hr",
"img",
"input",
"isindex",
"keygen",
"link",
"meta",
"param",
"source",
"track",
"wbr"
]);
function Xc(t, e) {
e === void 0 && (e = {});
for (var n = ("length" in t) ? t : [t], r = "", i = 0; i < n.length; i++)
r += wD(n[i], e);
return r;
}
vu.render = Xc;
vu.default = Xc;
function wD(t, e) {
switch (t.type) {
case ti.Root:
return Xc(t.children, e);
case ti.Doctype:
case ti.Directive:
return ED(t);
case ti.Comment:
return CD(t);
case ti.CDATA:
return TD(t);
case ti.Script:
case ti.Style:
case ti.Tag:
return SD(t, e);
case ti.Text:
return _D(t, e);
}
}
var kD = /* @__PURE__ */ new Set([
"mi",
"mo",
"mn",
"ms",
"mtext",
"annotation-xml",
"foreignObject",
"desc",
"title"
]), xD = /* @__PURE__ */ new Set(["svg", "math"]);
function SD(t, e) {
var n;
e.xmlMode === "foreign" && (t.name = (n = $2.elementNames.get(t.name)) !== null && n !== void 0 ? n : t.name, t.parent && kD.has(t.parent.name) && (e = la(la({}, e), { xmlMode: !1 }))), !e.xmlMode && xD.has(t.name) && (e = la(la({}, e), { xmlMode: "foreign" }));
var r = "<".concat(t.name), i = yD(t.attribs, e);
return i && (r += " ".concat(i)), t.children.length === 0 && (e.xmlMode ? (
// In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
e.selfClosingTags !== !1
) : (
// User explicitly asked for self-closing tags, even in HTML mode
e.selfClosingTags && B1.has(t.name)
)) ? (e.xmlMode || (r += " "), r += "/>") : (r += ">", t.children.length > 0 && (r += Xc(t.children, e)), (e.xmlMode || !B1.has(t.name)) && (r += "</".concat(t.name, ">"))), r;
}
function ED(t) {
return "<".concat(t.data, ">");
}
function _D(t, e) {
var n, r = t.data || "";
return ((n = e.encodeEntities) !== null && n !== void 0 ? n : e.decodeEntities) !== !1 && !(!e.xmlMode && t.parent && bD.has(t.parent.name)) && (r = e.xmlMode || e.encodeEntities !== "utf8" ? (0, jl.encodeXML)(r) : (0, jl.escapeText)(r)), r;
}
function TD(t) {
return "<![CDATA[".concat(t.children[0].data, "]]>");
}
function CD(t) {
return "<!--".concat(t.data, "-->");
}
var OD = De && De.__importDefault || function(t) {
return t && t.__esModule ? t : { default: t };
};
Object.defineProperty(Yn, "__esModule", { value: !0 });
Yn.innerText = Yn.textContent = Yn.getText = Yn.getInnerHTML = Yn.getOuterHTML = void 0;
var qr = mi, AD = OD(vu), MD = Xa;
function N2(t, e) {
return (0, AD.default)(t, e);
}
Yn.getOuterHTML = N2;
function DD(t, e) {
return (0, qr.hasChildren)(t) ? t.children.map(function(n) {
return N2(n, e);
}).join("") : "";
}
Yn.getInnerHTML = DD;
function ml(t) {
return Array.isArray(t) ? t.map(ml).join("") : (0, qr.isTag)(t) ? t.name === "br" ? `
` : ml(t.children) : (0, qr.isCDATA)(t) ? ml(t.children) : (0, qr.isText)(t) ? t.data : "";
}
Yn.getText = ml;
function f0(t) {
return Array.isArray(t) ? t.map(f0).join("") : (0, qr.hasChildren)(t) && !(0, qr.isComment)(t) ? f0(t.children) : (0, qr.isText)(t) ? t.data : "";
}
Yn.textContent = f0;
function p0(t) {
return Array.isArray(t) ? t.map(p0).join("") : (0, qr.hasChildren)(t) && (t.type === MD.ElementType.Tag || (0, qr.isCDATA)(t)) ? p0(t.children) : (0, qr.isText)(t) ? t.data : "";
}
Yn.innerText = p0;
var Yt = {};
Object.defineProperty(Yt, "__esModule", { value: !0 });
Yt.prevElementSibling = Yt.nextElementSibling = Yt.getName = Yt.hasAttrib = Yt.getAttributeValue = Yt.getSiblings = Yt.getParent = Yt.getChildren = void 0;
var Xp = mi;
function P2(t) {
return (0, Xp.hasChildren)(t) ? t.children : [];
}
Yt.getChildren = P2;
function I2(t) {
return t.parent || null;
}
Yt.getParent = I2;
function $D(t) {
var e, n, r = I2(t);
if (r != null)
return P2(r);
for (var i = [t], o = t.prev, a = t.next; o != null; )
i.unshift(o), e = o, o = e.prev;
for (; a != null; )
i.push(a), n = a, a = n.next;
return i;
}
Yt.getSiblings = $D;
function ND(t, e) {
var n;
return (n = t.attribs) === null || n === void 0 ? void 0 : n[e];
}
Yt.getAttributeValue = ND;
function PD(t, e) {
return t.attribs != null && Object.prototype.hasOwnProperty.call(t.attribs, e) && t.attribs[e] != null;
}
Yt.hasAttrib = PD;
function ID(t) {
return t.name;
}
Yt.getName = ID;
function LD(t) {
for (var e, n = t.next; n !== null && !(0, Xp.isTag)(n); )
e = n, n = e.next;
return n;
}
Yt.nextElementSibling = LD;
function RD(t) {
for (var e, n = t.prev; n !== null && !(0, Xp.isTag)(n); )
e = n, n = e.prev;
return n;
}
Yt.prevElementSibling = RD;
var Dn = {};
Object.defineProperty(Dn, "__esModule", { value: !0 });
Dn.prepend = Dn.prependChild = Dn.append = Dn.appendChild = Dn.replaceElement = Dn.removeElement = void 0;
function yu(t) {
if (t.prev && (t.prev.next = t.next), t.next && (t.next.prev = t.prev), t.parent) {
var e = t.parent.children, n = e.lastIndexOf(t);
n >= 0 && e.splice(n, 1);
}
t.next = null, t.prev = null, t.parent = null;
}
Dn.removeElement = yu;
function BD(t, e) {
var n = e.prev = t.prev;
n && (n.next = e);
var r = e.next = t.next;
r && (r.prev = e);
var i = e.parent = t.parent;
if (i) {
var o = i.children;
o[o.lastIndexOf(t)] = e, t.parent = null;
}
}
Dn.replaceElement = BD;
function VD(t, e) {
if (yu(e), e.next = null, e.parent = t, t.children.push(e) > 1) {
var n = t.children[t.children.length - 2];
n.next = e, e.prev = n;
} else
e.prev = null;
}
Dn.appendChild = VD;
function zD(t, e) {
yu(e);
var n = t.parent, r = t.next;
if (e.next = r, e.prev = t, t.next = e, e.parent = n, r) {
if (r.prev = e, n) {
var i = n.children;
i.splice(i.lastIndexOf(r), 0, e);
}
} else
n && n.children.push(e);
}
Dn.append = zD;
function HD(t, e) {
if (yu(e), e.parent = t, e.prev = null, t.children.unshift(e) !== 1) {
var n = t.children[1];
n.prev = e, e.next = n;
} else
e.next = null;
}
Dn.prependChild = HD;
function qD(t, e) {
yu(e);
var n = t.parent;
if (n) {
var r = n.children;
r.splice(r.indexOf(t), 0, e);
}
t.prev && (t.prev.next = e), e.parent = n, e.prev = t.prev, e.next = t, t.prev = e;
}
Dn.prepend = qD;
var vn = {};
Object.defineProperty(vn, "__esModule", { value: !0 });
vn.findAll = vn.existsOne = vn.findOne = vn.findOneChild = vn.find = vn.filter = void 0;
var Qc = mi;
function FD(t, e, n, r) {
return n === void 0 && (n = !0), r === void 0 && (r = 1 / 0), L2(t, Array.isArray(e) ? e : [e], n, r);
}
vn.filter = FD;
function L2(t, e, n, r) {
for (var i = [], o = [e], a = [0]; ; ) {
if (a[0] >= o[0].length) {
if (a.length === 1)
return i;
o.shift(), a.shift();
continue;
}
var s = o[0][a[0]++];
if (t(s) && (i.push(s), --r <= 0))
return i;
n && (0, Qc.hasChildren)(s) && s.children.length > 0 && (a.unshift(0), o.unshift(s.children));
}
}
vn.find = L2;
function jD(t, e) {
return e.find(t);
}
vn.findOneChild = jD;
function R2(t, e, n) {
n === void 0 && (n = !0);
for (var r = null, i = 0; i < e.length && !r; i++) {
var o = e[i];
if ((0, Qc.isTag)(o))
t(o) ? r = o : n && o.children.length > 0 && (r = R2(t, o.children, !0));
else
continue;
}
return r;
}
vn.findOne = R2;
function B2(t, e) {
return e.some(function(n) {
return (0, Qc.isTag)(n) && (t(n) || B2(t, n.children));
});
}
vn.existsOne = B2;
function UD(t, e) {
for (var n = [], r = [e], i = [0]; ; ) {
if (i[0] >= r[0].length) {
if (r.length === 1)
return n;
r.shift(), i.shift();
continue;
}
var o = r[0][i[0]++];
(0, Qc.isTag)(o) && (t(o) && n.push(o), o.children.length > 0 && (i.unshift(0), r.unshift(o.children)));
}
}
vn.findAll = UD;
var Kn = {};
Object.defineProperty(Kn, "__esModule", { value: !0 });
Kn.getElementsByTagType = Kn.getElementsByTagName = Kn.getElementById = Kn.getElements = Kn.testElement = void 0;
var fo = mi, Zc = vn, Ul = {
tag_name: function(t) {
return typeof t == "function" ? function(e) {
return (0, fo.isTag)(e) && t(e.name);
} : t === "*" ? fo.isTag : function(e) {
return (0, fo.isTag)(e) && e.name === t;
};
},
tag_type: function(t) {
return typeof t == "function" ? function(e) {
return t(e.type);
} : function(e) {
return e.type === t;
};
},
tag_contains: function(t) {
return typeof t == "function" ? function(e) {
return (0, fo.isText)(e) && t(e.data);
} : function(e) {
return (0, fo.isText)(e) && e.data === t;
};
}
};
function V2(t, e) {
return typeof e == "function" ? function(n) {
return (0, fo.isTag)(n) && e(n.attribs[t]);
} : function(n) {
return (0, fo.isTag)(n) && n.attribs[t] === e;
};
}
function WD(t, e) {
return function(n) {
return t(n) || e(n);
};
}
function z2(t) {
var e = Object.keys(t).map(function(n) {
var r = t[n];
return Object.prototype.hasOwnProperty.call(Ul, n) ? Ul[n](r) : V2(n, r);
});
return e.length === 0 ? null : e.reduce(WD);
}
function YD(t, e) {
var n = z2(t);
return n ? n(e) : !0;
}
Kn.testElement = YD;
function KD(t, e, n, r) {
r === void 0 && (r = 1 / 0);
var i = z2(t);
return i ? (0, Zc.filter)(i, e, n, r) : [];
}
Kn.getElements = KD;
function GD(t, e, n) {
return n === void 0 && (n = !0), Array.isArray(e) || (e = [e]), (0, Zc.findOne)(V2("id", t), e, n);
}
Kn.getElementById = GD;
function JD(t, e, n, r) {
return n === void 0 && (n = !0), r === void 0 && (r = 1 / 0), (0, Zc.filter)(Ul.tag_name(t), e, n, r);
}
Kn.getElementsByTagName = JD;
function XD(t, e, n, r) {
return n === void 0 && (n = !0), r === void 0 && (r = 1 / 0), (0, Zc.filter)(Ul.tag_type(t), e, n, r);
}
Kn.getElementsByTagType = XD;
var H2 = {};
(function(t) {
Object.defineProperty(t, "__esModule", { value: !0 }), t.uniqueSort = t.compareDocumentPosition = t.DocumentPosition = t.removeSubsets = void 0;
var e = mi;
function n(a) {
for (var s = a.length; --s >= 0; ) {
var u = a[s];
if (s > 0 && a.lastIndexOf(u, s - 1) >= 0) {
a.splice(s, 1);
continue;
}
for (var l = u.parent; l; l = l.parent)
if (a.includes(l)) {
a.splice(s, 1);
break;
}
}
return a;
}
t.removeSubsets = n;
var r;
(function(a) {
a[a.DISCONNECTED = 1] = "DISCONNECTED", a[a.PRECEDING = 2] = "PRECEDING", a[a.FOLLOWING = 4] = "FOLLOWING", a[a.CONTAINS = 8] = "CONTAINS", a[a.CONTAINED_BY = 16] = "CONTAINED_BY";
})(r = t.DocumentPosition || (t.DocumentPosition = {}));
function i(a, s) {
var u = [], l = [];
if (a === s)
return 0;
for (var c = (0, e.hasChildren)(a) ? a : a.parent; c; )
u.unshift(c), c = c.parent;
for (c = (0, e.hasChildren)(s) ? s : s.parent; c; )
l.unshift(c), c = c.parent;
for (var f = Math.min(u.length, l.length), d = 0; d < f && u[d] === l[d]; )
d++;
if (d === 0)
return r.DISCONNECTED;
var p = u[d - 1], h = p.children, m = u[d], v = l[d];
return h.indexOf(m) > h.indexOf(v) ? p === s ? r.FOLLOWING | r.CONTAINED_BY : r.FOLLOWING : p === a ? r.PRECEDING | r.CONTAINS : r.PRECEDING;
}
t.compareDocumentPosition = i;
function o(a) {
return a = a.filter(function(s, u, l) {
return !l.includes(s, u + 1);
}), a.sort(function(s, u) {
var l = i(s, u);
return l & r.PRECEDING ? -1 : l & r.FOLLOWING ? 1 : 0;
}), a;
}
t.uniqueSort = o;
})(H2);
var ed = {};
Object.defineProperty(ed, "__esModule", { value: !0 });
ed.getFeed = void 0;
var QD = Yn, wu = Kn;
function ZD(t) {
var e = Wl(i7, t);
return e ? e.name === "feed" ? e7(e) : t7(e) : null;
}
ed.getFeed = ZD;
function e7(t) {
var e, n = t.children, r = {
type: "atom",
items: (0, wu.getElementsByTagName)("entry", n).map(function(a) {
var s, u = a.children, l = { media: q2(u) };
Mn(l, "id", "id", u), Mn(l, "title", "title", u);
var c = (s = Wl("link", u)) === null || s === void 0 ? void 0 : s.attribs.href;
c && (l.link = c);
var f = Mi("summary", u) || Mi("content", u);
f && (l.description = f);
var d = Mi("updated", u);
return d && (l.pubDate = new Date(d)), l;
})
};
Mn(r, "id", "id", n), Mn(r, "title", "title", n);
var i = (e = Wl("link", n)) === null || e === void 0 ? void 0 : e.attribs.href;
i && (r.link = i), Mn(r, "description", "subtitle", n);
var o = Mi("updated", n);
return o && (r.updated = new Date(o)), Mn(r, "author", "email", n, !0), r;
}
function t7(t) {
var e, n, r = (n = (e = Wl("channel", t.children)) === null || e === void 0 ? void 0 : e.children) !== null && n !== void 0 ? n : [], i = {
type: t.name.substr(0, 3),
id: "",
items: (0, wu.getElementsByTagName)("item", t.children).map(function(a) {
var s = a.children, u = { media: q2(s) };
Mn(u, "id", "guid", s), Mn(u, "title", "title", s), Mn(u, "link", "link", s), Mn(u, "description", "description", s);
var l = Mi("pubDate", s) || Mi("dc:date", s);
return l && (u.pubDate = new Date(l)), u;
})
};
Mn(i, "title", "title", r), Mn(i, "link", "link", r), Mn(i, "description", "description", r);
var o = Mi("lastBuildDate", r);
return o && (i.updated = new Date(o)), Mn(i, "author", "managingEditor", r, !0), i;
}
var n7 = ["url", "type", "lang"], r7 = [
"fileSize",
"bitrate",
"framerate",
"samplingrate",
"channels",
"duration",
"height",
"width"
];
function q2(t) {
return (0, wu.getElementsByTagName)("media:content", t).map(function(e) {
for (var n = e.attribs, r = {
medium: n.medium,
isDefault: !!n.isDefault
}, i = 0, o = n7; i < o.length; i++) {
var a = o[i];
n[a] && (r[a] = n[a]);
}
for (var s = 0, u = r7; s < u.length; s++) {
var a = u[s];
n[a] && (r[a] = parseInt(n[a], 10));
}
return n.expression && (r.expression = n.expression), r;
});
}
function Wl(t, e) {
return (0, wu.getElementsByTagName)(t, e, !0, 1)[0];
}
function Mi(t, e, n) {
return n === void 0 && (n = !1), (0, QD.textContent)((0, wu.getElementsByTagName)(t, e, n, 1)).trim();
}
function Mn(t, e, n, r, i) {
i === void 0 && (i = !1);
var o = Mi(n, r, i);
o && (t[e] = o);
}
function i7(t) {
return t === "rss" || t === "feed" || t === "rdf:RDF";
}
(function(t) {
var e = De && De.__createBinding || (Object.create ? function(i, o, a, s) {
s === void 0 && (s = a);
var u = Object.getOwnPropertyDescriptor(o, a);
(!u || ("get" in u ? !o.__esModule : u.writable || u.configurable)) && (u = { enumerable: !0, get: function() {
return o[a];
} }), Object.defineProperty(i, s, u);
} : function(i, o, a, s) {
s === void 0 && (s = a), i[s] = o[a];
}), n = De && De.__exportStar || function(i, o) {
for (var a in i)
a !== "default" && !Object.prototype.hasOwnProperty.call(o, a) && e(o, i, a);
};
Object.defineProperty(t, "__esModule", { value: !0 }), t.hasChildren = t.isDocument = t.isComment = t.isText = t.isCDATA = t.isTag = void 0, n(Yn, t), n(Yt, t), n(Dn, t), n(vn, t), n(Kn, t), n(H2, t), n(ed, t);
var r = mi;
Object.defineProperty(t, "isTag", { enumerable: !0, get: function() {
return r.isTag;
} }), Object.defineProperty(t, "isCDATA", { enumerable: !0, get: function() {
return r.isCDATA;
} }), Object.defineProperty(t, "isText", { enumerable: !0, get: function() {
return r.isText;
} }), Object.defineProperty(t, "isComment", { enumerable: !0, get: function() {
return r.isComment;
} }), Object.defineProperty(t, "isDocument", { enumerable: !0, get: function() {
return r.isDocument;
} }), Object.defineProperty(t, "hasChildren", { enumerable: !0, get: function() {
return r.hasChildren;
} });
})(hl);
(function(t) {
var e = De && De.__createBinding || (Object.create ? function(y, k, T, b) {
b === void 0 && (b = T);
var D = Object.getOwnPropertyDescriptor(k, T);
(!D || ("get" in D ? !k.__esModule : D.writable || D.configurable)) && (D = { enumerable: !0, get: function() {
return k[T];
} }), Object.defineProperty(y, b, D);
} : function(y, k, T, b) {
b === void 0 && (b = T), y[b] = k[T];
}), n = De && De.__setModuleDefault || (Object.create ? function(y, k) {
Object.defineProperty(y, "default", { enumerable: !0, value: k });
} : function(y, k) {
y.default = k;
}), r = De && De.__importStar || function(y) {
if (y && y.__esModule)
return y;
var k = {};
if (y != null)
for (var T in y)
T !== "default" && Object.prototype.hasOwnProperty.call(y, T) && e(k, y, T);
return n(k, y), k;
}, i = De && De.__importDefault || function(y) {
return y && y.__esModule ? y : { default: y };
};
Object.defineProperty(t, "__esModule", { value: !0 }), t.DomUtils = t.parseFeed = t.getFeed = t.ElementType = t.Tokenizer = t.createDomStream = t.parseDOM = t.parseDocument = t.DefaultHandler = t.DomHandler = t.Parser = void 0;
var o = Js, a = Js;
Object.defineProperty(t, "Parser", { enumerable: !0, get: function() {
return a.Parser;
} });
var s = mi, u = mi;
Object.defineProperty(t, "DomHandler", { enumerable: !0, get: function() {
return u.DomHandler;
} }), Object.defineProperty(t, "DefaultHandler", { enumerable: !0, get: function() {
return u.DomHandler;
} });
function l(y, k) {
var T = new s.DomHandler(void 0, k);
return new o.Parser(T, k).end(y), T.root;
}
t.parseDocument = l;
function c(y, k) {
return l(y, k).children;
}
t.parseDOM = c;
function f(y, k, T) {
var b = new s.DomHandler(y, k, T);
return new o.Parser(b, k);
}
t.createDomStream = f;
var d = qp;
Object.defineProperty(t, "Tokenizer", { enumerable: !0, get: function() {
return i(d).default;
} }), t.ElementType = r(Xa);
var p = hl, h = hl;
Object.defineProperty(t, "getFeed", { enumerable: !0, get: function() {
return h.getFeed;
} });
var m = { xmlMode: !0 };
function v(y, k) {
return k === void 0 && (k = m), (0, p.getFeed)(c(y, k));
}
t.parseFeed = v, t.DomUtils = r(hl);
})(g2);
var o7 = (t) => {
if (typeof t != "string")
throw new TypeError("Expected a string");
return t.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
}, Qp = {};
Object.defineProperty(Qp, "__esModule", { value: !0 });
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function V1(t) {
return Object.prototype.toString.call(t) === "[object Object]";
}
function a7(t) {
var e, n;
return V1(t) === !1 ? !1 : (e = t.constructor, e === void 0 ? !0 : (n = e.prototype, !(V1(n) === !1 || n.hasOwnProperty("isPrototypeOf") === !1)));
}
Qp.isPlainObject = a7;
var s7 = function(e) {
return u7(e) && !l7(e);
};
function u7(t) {
return !!t && typeof t == "object";
}
function l7(t) {
var e = Object.prototype.toString.call(t);
return e === "[object RegExp]" || e === "[object Date]" || f7(t);
}
var c7 = typeof Symbol == "function" && Symbol.for, d7 = c7 ? Symbol.for("react.element") : 60103;
function f7(t) {
return t.$$typeof === d7;
}
function p7(t) {
return Array.isArray(t) ? [] : {};
}
function Xs(t, e) {
return e.clone !== !1 && e.isMergeableObject(t) ? Va(p7(t), t, e) : t;
}
function h7(t, e, n) {
return t.concat(e).map(function(r) {
return Xs(r, n);
});
}
function m7(t, e) {
if (!e.customMerge)
return Va;
var n = e.customMerge(t);
return typeof n == "function" ? n : Va;
}
function g7(t) {
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(e) {
return Object.propertyIsEnumerable.call(t, e);
}) : [];
}
function z1(t) {
return Object.keys(t).concat(g7(t));
}
function F2(t, e) {
try {
return e in t;
} catch {
return !1;
}
}
function b7(t, e) {
return F2(t, e) && !(Object.hasOwnProperty.call(t, e) && Object.propertyIsEnumerable.call(t, e));
}
function v7(t, e, n) {
var r = {};
return n.isMergeableObject(t) && z1(t).forEach(function(i) {
r[i] = Xs(t[i], n);
}), z1(e).forEach(function(i) {
b7(t, i) || (F2(t, i) && n.isMergeableObject(e[i]) ? r[i] = m7(i, n)(t[i], e[i], n) : r[i] = Xs(e[i], n));
}), r;
}
function Va(t, e, n) {
n = n || {}, n.arrayMerge = n.arrayMerge || h7, n.isMergeableObject = n.isMergeableObject || s7, n.cloneUnlessOtherwiseSpecified = Xs;
var r = Array.isArray(e), i = Array.isArray(t), o = r === i;
return o ? r ? n.arrayMerge(t, e, n) : v7(t, e, n) : Xs(e, n);
}
Va.all = function(e, n) {
if (!Array.isArray(e))
throw new Error("first argument should be an array");
return e.reduce(function(r, i) {
return Va(r, i, n);
}, {});
};
var y7 = Va, w7 = y7, j2 = { exports: {} };
(function(t) {
(function(e, n) {
t.exports ? t.exports = n() : e.parseSrcset = n();
})(De, function() {
return function(e) {
function n(b) {
return b === " " || // space
b === " " || // horizontal tab
b === `
` || // new line
b === "\f" || // form feed
b === "\r";
}
function r(b) {
var D, x = b.exec(e.substring(v));
if (x)
return D = x[0], v += D.length, D;
}
for (var i = e.length, o = /^[ \t\n\r\u000c]+/, a = /^[, \t\n\r\u000c]+/, s = /^[^ \t\n\r\u000c]+/, u = /[,]+$/, l = /^\d+$/, c = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/, f, d, p, h, m, v = 0, y = []; ; ) {
if (r(a), v >= i)
return y;
f = r(s), d = [], f.slice(-1) === "," ? (f = f.replace(u, ""), T()) : k();
}
function k() {
for (r(o), p = "", h = "in descriptor"; ; ) {
if (m = e.charAt(v), h === "in descriptor")
if (n(m))
p && (d.push(p), p = "", h = "after descriptor");
else if (m === ",") {
v += 1, p && d.push(p), T();
return;
} else if (m === "(")
p = p + m, h = "in parens";
else if (m === "") {
p && d.push(p), T();
return;
} else
p = p + m;
else if (h === "in parens")
if (m === ")")
p = p + m, h = "in descriptor";
else if (m === "") {
d.push(p), T();
return;
} else
p = p + m;
else if (h === "after descriptor" && !n(m))
if (m === "") {
T();
return;
} else
h = "in descriptor", v -= 1;
v += 1;
}
}
function T() {
var b = !1, D, x, S, _, N = {}, R, w, A, $, I;
for (_ = 0; _ < d.length; _++)
R = d[_], w = R[R.length - 1], A = R.substring(0, R.length - 1), $ = parseInt(A, 10), I = parseFloat(A), l.test(A) && w === "w" ? ((D || x) && (b = !0), $ === 0 ? b = !0 : D = $) : c.test(A) && w === "x" ? ((D || x || S) && (b = !0), I < 0 ? b = !0 : x = I) : l.test(A) && w === "h" ? ((S || x) && (b = !0), $ === 0 ? b = !0 : S = $) : b = !0;
b ? console && console.log && console.log("Invalid srcset descriptor found in '" + e + "' at '" + R + "'.") : (N.url = f, D && (N.w = D), x && (N.d = x), S && (N.h = S), y.push(N));
}
};
});
})(j2);
var k7 = j2.exports, Zp = { exports: {} }, Et = String, U2 = function() {
return { isColorSupported: !1, reset: Et, bold: Et, dim: Et, italic: Et, underline: Et, inverse: Et, hidden: Et, strikethrough: Et, black: Et, red: Et, green: Et, yellow: Et, blue: Et, magenta: Et, cyan: Et, white: Et, gray: Et, bgBlack: Et, bgRed: Et, bgGreen: Et, bgYellow: Et, bgBlue: Et, bgMagenta: Et, bgCyan: Et, bgWhite: Et };
};
Zp.exports = U2();
Zp.exports.createColors = U2;
var x7 = Zp.exports;
const S7 = {}, E7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: S7
}, Symbol.toStringTag, { value: "Module" })), Er = /* @__PURE__ */ L8(E7);
let H1 = x7, q1 = Er, h0 = class W2 extends Error {
constructor(e, n, r, i, o, a) {
super(e), this.name = "CssSyntaxError", this.reason = e, o && (this.file = o), i && (this.source = i), a && (this.plugin = a), typeof n < "u" && typeof r < "u" && (typeof n == "number" ? (this.line = n, this.column = r) : (this.line = n.line, this.column = n.column, this.endLine = r.line, this.endColumn = r.column)), this.setMessage(), Error.captureStackTrace && Error.captureStackTrace(this, W2);
}
setMessage() {
this.message = this.plugin ? this.plugin + ": " : "", this.message += this.file ? this.file : "<css input>", typeof this.line < "u" && (this.message += ":" + this.line + ":" + this.column), this.message += ": " + this.reason;
}
showSourceCode(e) {
if (!this.source)
return "";
let n = this.source;
e == null && (e = H1.isColorSupported), q1 && e && (n = q1(n));
let r = n.split(/\r?\n/), i = Math.max(this.line - 3, 0), o = Math.min(this.line + 2, r.length), a = String(o).length, s, u;
if (e) {
let { bold: l, gray: c, red: f } = H1.createColors(!0);
s = (d) => l(f(d)), u = (d) => c(d);
} else
s = u = (l) => l;
return r.slice(i, o).map((l, c) => {
let f = i + 1 + c, d = " " + (" " + f).slice(-a) + " | ";
if (f === this.line) {
let p = u(d.replace(/\d/g, " ")) + l.slice(0, this.column - 1).replace(/[^\t]/g, " ");
return s(">") + u(d) + l + `
` + p + s("^");
}
return " " + u(d) + l;
}).join(`
`);
}
toString() {
let e = this.showSourceCode();
return e && (e = `
` + e + `
`), this.name + ": " + this.message + e;
}
};
var eh = h0;
h0.default = h0;
var ku = {};
ku.isClean = Symbol("isClean");
ku.my = Symbol("my");
const F1 = {
after: `
`,
beforeClose: `
`,
beforeComment: `
`,
beforeDecl: `
`,
beforeOpen: " ",
beforeRule: `
`,
colon: ": ",
commentLeft: " ",
commentRight: " ",
emptyBody: "",
indent: " ",
semicolon: !1
};
function _7(t) {
return t[0].toUpperCase() + t.slice(1);
}
let m0 = class {
constructor(e) {
this.builder = e;
}
atrule(e, n) {
let r = "@" + e.name, i = e.params ? this.rawValue(e, "params") : "";
if (typeof e.raws.afterName < "u" ? r += e.raws.afterName : i && (r += " "), e.nodes)
this.block(e, r + i);
else {
let o = (e.raws.between || "") + (n ? ";" : "");
this.builder(r + i + o, e);
}
}
beforeAfter(e, n) {
let r;
e.type === "decl" ? r = this.raw(e, null, "beforeDecl") : e.type === "comment" ? r = this.raw(e, null, "beforeComment") : n === "before" ? r = this.raw(e, null, "beforeRule") : r = this.raw(e, null, "beforeClose");
let i = e.parent, o = 0;
for (; i && i.type !== "root"; )
o += 1, i = i.parent;
if (r.includes(`
`)) {
let a = this.raw(e, null, "indent");
if (a.length)
for (let s = 0; s < o; s++)
r += a;
}
return r;
}
block(e, n) {
let r = this.raw(e, "between", "beforeOpen");
this.builder(n + r + "{", e, "start");
let i;
e.nodes && e.nodes.length ? (this.body(e), i = this.raw(e, "after")) : i = this.raw(e, "after", "emptyBody"), i && this.builder(i), this.builder("}", e, "end");
}
body(e) {
let n = e.nodes.length - 1;
for (; n > 0 && e.nodes[n].type === "comment"; )
n -= 1;
let r = this.raw(e, "semicolon");
for (let i = 0; i < e.nodes.length; i++) {
let o = e.nodes[i], a = this.raw(o, "before");
a && this.builder(a), this.stringify(o, n !== i || r);
}
}
comment(e) {
let n = this.raw(e, "left", "commentLeft"), r = this.raw(e, "right", "commentRight");
this.builder("/*" + n + e.text + r + "*/", e);
}
decl(e, n) {
let r = this.raw(e, "between", "colon"), i = e.prop + r + this.rawValue(e, "value");
e.important && (i += e.raws.important || " !important"), n && (i += ";"), this.builder(i, e);
}
document(e) {
this.body(e);
}
raw(e, n, r) {
let i;
if (r || (r = n), n && (i = e.raws[n], typeof i < "u"))
return i;
let o = e.parent;
if (r === "before" && (!o || o.type === "root" && o.first === e || o && o.type === "document"))
return "";
if (!o)
return F1[r];
let a = e.root();
if (a.rawCache || (a.rawCache = {}), typeof a.rawCache[r] < "u")
return a.rawCache[r];
if (r === "before" || r === "after")
return this.beforeAfter(e, r);
{
let s = "raw" + _7(r);
this[s] ? i = this[s](a, e) : a.walk((u) => {
if (i = u.raws[n], typeof i < "u")
return !1;
});
}
return typeof i > "u" && (i = F1[r]), a.rawCache[r] = i, i;
}
rawBeforeClose(e) {
let n;
return e.walk((r) => {
if (r.nodes && r.nodes.length > 0 && typeof r.raws.after < "u")
return n = r.raws.after, n.includes(`
`) && (n = n.replace(/[^\n]+$/, "")), !1;
}), n && (n = n.replace(/\S/g, "")), n;
}
rawBeforeComment(e, n) {
let r;
return e.walkComments((i) => {
if (typeof i.raws.before < "u")
return r = i.raws.before, r.includes(`
`) && (r = r.replace(/[^\n]+$/, "")), !1;
}), typeof r > "u" ? r = this.raw(n, null, "beforeDecl") : r && (r = r.replace(/\S/g, "")), r;
}
rawBeforeDecl(e, n) {
let r;
return e.walkDecls((i) => {
if (typeof i.raws.before < "u")
return r = i.raws.before, r.includes(`
`) && (r = r.replace(/[^\n]+$/, "")), !1;
}), typeof r > "u" ? r = this.raw(n, null, "beforeRule") : r && (r = r.replace(/\S/g, "")), r;
}
rawBeforeOpen(e) {
let n;
return e.walk((r) => {
if (r.type !== "decl" && (n = r.raws.between, typeof n < "u"))
return !1;
}), n;
}
rawBeforeRule(e) {
let n;
return e.walk((r) => {
if (r.nodes && (r.parent !== e || e.first !== r) && typeof r.raws.before < "u")
return n = r.raws.before, n.includes(`
`) && (n = n.replace(/[^\n]+$/, "")), !1;
}), n && (n = n.replace(/\S/g, "")), n;
}
rawColon(e) {
let n;
return e.walkDecls((r) => {
if (typeof r.raws.between < "u")
return n = r.raws.between.replace(/[^\s:]/g, ""), !1;
}), n;
}
rawEmptyBody(e) {
let n;
return e.walk((r) => {
if (r.nodes && r.nodes.length === 0 && (n = r.raws.after, typeof n < "u"))
return !1;
}), n;
}
rawIndent(e) {
if (e.raws.indent)
return e.raws.indent;
let n;
return e.walk((r) => {
let i = r.parent;
if (i && i !== e && i.parent && i.parent === e && typeof r.raws.before < "u") {
let o = r.raws.before.split(`
`);
return n = o[o.length - 1], n = n.replace(/\S/g, ""), !1;
}
}), n;
}
rawSemicolon(e) {
let n;
return e.walk((r) => {
if (r.nodes && r.nodes.length && r.last.type === "decl" && (n = r.raws.semicolon, typeof n < "u"))
return !1;
}), n;
}
rawValue(e, n) {
let r = e[n], i = e.raws[n];
return i && i.value === r ? i.raw : r;
}
root(e) {
this.body(e), e.raws.after && this.builder(e.raws.after);
}
rule(e) {
this.block(e, this.rawValue(e, "selector")), e.raws.ownSemicolon && this.builder(e.raws.ownSemicolon, e, "end");
}
stringify(e, n) {
if (!this[e.type])
throw new Error(
"Unknown AST node type " + e.type + ". Maybe you need to change PostCSS stringifier."
);
this[e.type](e, n);
}
};
var Y2 = m0;
m0.default = m0;
let T7 = Y2;
function g0(t, e) {
new T7(e).stringify(t);
}
var td = g0;
g0.default = g0;
let { isClean: Lu, my: C7 } = ku, O7 = eh, A7 = Y2, M7 = td;
function b0(t, e) {
let n = new t.constructor();
for (let r in t) {
if (!Object.prototype.hasOwnProperty.call(t, r) || r === "proxyCache")
continue;
let i = t[r], o = typeof i;
r === "parent" && o === "object" ? e && (n[r] = e) : r === "source" ? n[r] = i : Array.isArray(i) ? n[r] = i.map((a) => b0(a, n)) : (o === "object" && i !== null && (i = b0(i)), n[r] = i);
}
return n;
}
let v0 = class {
constructor(e = {}) {
this.raws = {}, this[Lu] = !1, this[C7] = !0;
for (let n in e)
if (n === "nodes") {
this.nodes = [];
for (let r of e[n])
typeof r.clone == "function" ? this.append(r.clone()) : this.append(r);
} else
this[n] = e[n];
}
addToError(e) {
if (e.postcssNode = this, e.stack && this.source && /\n\s{4}at /.test(e.stack)) {
let n = this.source;
e.stack = e.stack.replace(
/\n\s{4}at /,
`$&${n.input.from}:${n.start.line}:${n.start.column}$&`
);
}
return e;
}
after(e) {
return this.parent.insertAfter(this, e), this;
}
assign(e = {}) {
for (let n in e)
this[n] = e[n];
return this;
}
before(e) {
return this.parent.insertBefore(this, e), this;
}
cleanRaws(e) {
delete this.raws.before, delete this.raws.after, e || delete this.raws.between;
}
clone(e = {}) {
let n = b0(this);
for (let r in e)
n[r] = e[r];
return n;
}
cloneAfter(e = {}) {
let n = this.clone(e);
return this.parent.insertAfter(this, n), n;
}
cloneBefore(e = {}) {
let n = this.clone(e);
return this.parent.insertBefore(this, n), n;
}
error(e, n = {}) {
if (this.source) {
let { end: r, start: i } = this.rangeBy(n);
return this.source.input.error(
e,
{ column: i.column, line: i.line },
{ column: r.column, line: r.line },
n
);
}
return new O7(e);
}
getProxyProcessor() {
return {
get(e, n) {
return n === "proxyOf" ? e : n === "root" ? () => e.root().toProxy() : e[n];
},
set(e, n, r) {
return e[n] === r || (e[n] = r, (n === "prop" || n === "value" || n === "name" || n === "params" || n === "important" || /* c8 ignore next */
n === "text") && e.markDirty()), !0;
}
};
}
markDirty() {
if (this[Lu]) {
this[Lu] = !1;
let e = this;
for (; e = e.parent; )
e[Lu] = !1;
}
}
next() {
if (!this.parent)
return;
let e = this.parent.index(this);
return this.parent.nodes[e + 1];
}
positionBy(e, n) {
let r = this.source.start;
if (e.index)
r = this.positionInside(e.index, n);
else if (e.word) {
n = this.toString();
let i = n.indexOf(e.word);
i !== -1 && (r = this.positionInside(i, n));
}
return r;
}
positionInside(e, n) {
let r = n || this.toString(), i = this.source.start.column, o = this.source.start.line;
for (let a = 0; a < e; a++)
r[a] === `
` ? (i = 1, o += 1) : i += 1;
return { column: i, line: o };
}
prev() {
if (!this.parent)
return;
let e = this.parent.index(this);
return this.parent.nodes[e - 1];
}
rangeBy(e) {
let n = {
column: this.source.start.column,
line: this.source.start.line
}, r = this.source.end ? {
column: this.source.end.column + 1,
line: this.source.end.line
} : {
column: n.column + 1,
line: n.line
};
if (e.word) {
let i = this.toString(), o = i.indexOf(e.word);
o !== -1 && (n = this.positionInside(o, i), r = this.positionInside(o + e.word.length, i));
} else
e.start ? n = {
column: e.start.column,
line: e.start.line
} : e.index && (n = this.positionInside(e.index)), e.end ? r = {
column: e.end.column,
line: e.end.line
} : e.endIndex ? r = this.positionInside(e.endIndex) : e.index && (r = this.positionInside(e.index + 1));
return (r.line < n.line || r.line === n.line && r.column <= n.column) && (r = { column: n.column + 1, line: n.line }), { end: r, start: n };
}
raw(e, n) {
return new A7().raw(this, e, n);
}
remove() {
return this.parent && this.parent.removeChild(this), this.parent = void 0, this;
}
replaceWith(...e) {
if (this.parent) {
let n = this, r = !1;
for (let i of e)
i === this ? r = !0 : r ? (this.parent.insertAfter(n, i), n = i) : this.parent.insertBefore(n, i);
r || this.remove();
}
return this;
}
root() {
let e = this;
for (; e.parent && e.parent.type !== "document"; )
e = e.parent;
return e;
}
toJSON(e, n) {
let r = {}, i = n == null;
n = n || /* @__PURE__ */ new Map();
let o = 0;
for (let a in this) {
if (!Object.prototype.hasOwnProperty.call(this, a) || a === "parent" || a === "proxyCache")
continue;
let s = this[a];
if (Array.isArray(s))
r[a] = s.map((u) => typeof u == "object" && u.toJSON ? u.toJSON(null, n) : u);
else if (typeof s == "object" && s.toJSON)
r[a] = s.toJSON(null, n);
else if (a === "source") {
let u = n.get(s.input);
u == null && (u = o, n.set(s.input, o), o++), r[a] = {
end: s.end,
inputId: u,
start: s.start
};
} else
r[a] = s;
}
return i && (r.inputs = [...n.keys()].map((a) => a.toJSON())), r;
}
toProxy() {
return this.proxyCache || (this.proxyCache = new Proxy(this, this.getProxyProcessor())), this.proxyCache;
}
toString(e = M7) {
e.stringify && (e = e.stringify);
let n = "";
return e(this, (r) => {
n += r;
}), n;
}
warn(e, n, r) {
let i = { node: this };
for (let o in r)
i[o] = r[o];
return e.warn(n, i);
}
get proxyOf() {
return this;
}
};
var nd = v0;
v0.default = v0;
let D7 = nd, y0 = class extends D7 {
constructor(e) {
e && typeof e.value < "u" && typeof e.value != "string" && (e = { ...e, value: String(e.value) }), super(e), this.type = "decl";
}
get variable() {
return this.prop.startsWith("--") || this.prop[0] === "$";
}
};
var rd = y0;
y0.default = y0;
let $7 = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", N7 = (t, e = 21) => (n = e) => {
let r = "", i = n;
for (; i--; )
r += t[Math.random() * t.length | 0];
return r;
}, P7 = (t = 21) => {
let e = "", n = t;
for (; n--; )
e += $7[Math.random() * 64 | 0];
return e;
};
var I7 = { nanoid: P7, customAlphabet: N7 };
let { SourceMapConsumer: j1, SourceMapGenerator: U1 } = Er, { existsSync: L7, readFileSync: R7 } = Er, { dirname: ef, join: B7 } = Er;
function V7(t) {
return Buffer ? Buffer.from(t, "base64").toString() : window.atob(t);
}
let w0 = class {
constructor(e, n) {
if (n.map === !1)
return;
this.loadAnnotation(e), this.inline = this.startWith(this.annotation, "data:");
let r = n.map ? n.map.prev : void 0, i = this.loadMap(n.from, r);
!this.mapFile && n.from && (this.mapFile = n.from), this.mapFile && (this.root = ef(this.mapFile)), i && (this.text = i);
}
consumer() {
return this.consumerCache || (this.consumerCache = new j1(this.text)), this.consumerCache;
}
decodeInline(e) {
let n = /^data:application\/json;charset=utf-?8;base64,/, r = /^data:application\/json;base64,/, i = /^data:application\/json;charset=utf-?8,/, o = /^data:application\/json,/;
if (i.test(e) || o.test(e))
return decodeURIComponent(e.substr(RegExp.lastMatch.length));
if (n.test(e) || r.test(e))
return V7(e.substr(RegExp.lastMatch.length));
let a = e.match(/data:application\/json;([^,]+),/)[1];
throw new Error("Unsupported source map encoding " + a);
}
getAnnotationURL(e) {
return e.replace(/^\/\*\s*# sourceMappingURL=/, "").trim();
}
isMap(e) {
return typeof e != "object" ? !1 : typeof e.mappings == "string" || typeof e._mappings == "string" || Array.isArray(e.sections);
}
loadAnnotation(e) {
let n = e.match(/\/\*\s*# sourceMappingURL=/gm);
if (!n)
return;
let r = e.lastIndexOf(n.pop()), i = e.indexOf("*/", r);
r > -1 && i > -1 && (this.annotation = this.getAnnotationURL(e.substring(r, i)));
}
loadFile(e) {
if (this.root = ef(e), L7(e))
return this.mapFile = e, R7(e, "utf-8").toString().trim();
}
loadMap(e, n) {
if (n === !1)
return !1;
if (n) {
if (typeof n == "string")
return n;
if (typeof n == "function") {
let r = n(e);
if (r) {
let i = this.loadFile(r);
if (!i)
throw new Error(
"Unable to load previous source map: " + r.toString()
);
return i;
}
} else {
if (n instanceof j1)
return U1.fromSourceMap(n).toString();
if (n instanceof U1)
return n.toString();
if (this.isMap(n))
return JSON.stringify(n);
throw new Error(
"Unsupported previous source map format: " + n.toString()
);
}
} else {
if (this.inline)
return this.decodeInline(this.annotation);
if (this.annotation) {
let r = this.annotation;
return e && (r = B7(ef(e), r)), this.loadFile(r);
}
}
}
startWith(e, n) {
return e ? e.substr(0, n.length) === n : !1;
}
withContent() {
return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);
}
};
var K2 = w0;
w0.default = w0;
let { SourceMapConsumer: z7, SourceMapGenerator: H7 } = Er, { fileURLToPath: W1, pathToFileURL: Ru } = Er, { isAbsolute: k0, resolve: x0 } = Er, { nanoid: q7 } = I7, tf = Er, Y1 = eh, F7 = K2, nf = Symbol("fromOffsetCache"), j7 = !!(z7 && H7), K1 = !!(x0 && k0), Yl = class {
constructor(e, n = {}) {
if (e === null || typeof e > "u" || typeof e == "object" && !e.toString)
throw new Error(`PostCSS received ${e} instead of CSS string`);
if (this.css = e.toString(), this.css[0] === "\uFEFF" || this.css[0] === "" ? (this.hasBOM = !0, this.css = this.css.slice(1)) : this.hasBOM = !1, n.from && (!K1 || /^\w+:\/\//.test(n.from) || k0(n.from) ? this.file = n.from : this.file = x0(n.from)), K1 && j7) {
let r = new F7(this.css, n);
if (r.text) {
this.map = r;
let i = r.consumer().file;
!this.file && i && (this.file = this.mapResolve(i));
}
}
this.file || (this.id = "<input css " + q7(6) + ">"), this.map && (this.map.file = this.from);
}
error(e, n, r, i = {}) {
let o, a, s;
if (n && typeof n == "object") {
let l = n, c = r;
if (typeof l.offset == "number") {
let f = this.fromOffset(l.offset);
n = f.line, r = f.col;
} else
n = l.line, r = l.column;
if (typeof c.offset == "number") {
let f = this.fromOffset(c.offset);
a = f.line, s = f.col;
} else
a = c.line, s = c.column;
} else if (!r) {
let l = this.fromOffset(n);
n = l.line, r = l.col;
}
let u = this.origin(n, r, a, s);
return u ? o = new Y1(
e,
u.endLine === void 0 ? u.line : { column: u.column, line: u.line },
u.endLine === void 0 ? u.column : { column: u.endColumn, line: u.endLine },
u.source,
u.file,
i.plugin
) : o = new Y1(
e,
a === void 0 ? n : { column: r, line: n },
a === void 0 ? r : { column: s, line: a },
this.css,
this.file,
i.plugin
), o.input = { column: r, endColumn: s, endLine: a, line: n, source: this.css }, this.file && (Ru && (o.input.url = Ru(this.file).toString()), o.input.file = this.file), o;
}
fromOffset(e) {
let n, r;
if (this[nf])
r = this[nf];
else {
let o = this.css.split(`
`);
r = new Array(o.length);
let a = 0;
for (let s = 0, u = o.length; s < u; s++)
r[s] = a, a += o[s].length + 1;
this[nf] = r;
}
n = r[r.length - 1];
let i = 0;
if (e >= n)
i = r.length - 1;
else {
let o = r.length - 2, a;
for (; i < o; )
if (a = i + (o - i >> 1), e < r[a])
o = a - 1;
else if (e >= r[a + 1])
i = a + 1;
else {
i = a;
break;
}
}
return {
col: e - r[i] + 1,
line: i + 1
};
}
mapResolve(e) {
return /^\w+:\/\//.test(e) ? e : x0(this.map.consumer().sourceRoot || this.map.root || ".", e);
}
origin(e, n, r, i) {
if (!this.map)
return !1;
let o = this.map.consumer(), a = o.originalPositionFor({ column: n, line: e });
if (!a.source)
return !1;
let s;
typeof r == "number" && (s = o.originalPositionFor({ column: i, line: r }));
let u;
k0(a.source) ? u = Ru(a.source) : u = new URL(
a.source,
this.map.consumer().sourceRoot || Ru(this.map.mapFile)
);
let l = {
column: a.column,
endColumn: s && s.column,
endLine: s && s.line,
line: a.line,
url: u.toString()
};
if (u.protocol === "file:")
if (W1)
l.file = W1(u);
else
throw new Error("file: protocol is not available in this PostCSS build");
let c = o.sourceContentFor(a.source);
return c && (l.source = c), l;
}
toJSON() {
let e = {};
for (let n of ["hasBOM", "css", "file", "id"])
this[n] != null && (e[n] = this[n]);
return this.map && (e.map = { ...this.map }, e.map.consumerCache && (e.map.consumerCache = void 0)), e;
}
get from() {
return this.file || this.id;
}
};
var id = Yl;
Yl.default = Yl;
tf && tf.registerInput && tf.registerInput(Yl);
let { SourceMapConsumer: G2, SourceMapGenerator: gl } = Er, { dirname: bl, relative: J2, resolve: X2, sep: Q2 } = Er, { pathToFileURL: G1 } = Er, U7 = id, W7 = !!(G2 && gl), Y7 = !!(bl && X2 && J2 && Q2), K7 = class {
constructor(e, n, r, i) {
this.stringify = e, this.mapOpts = r.map || {}, this.root = n, this.opts = r, this.css = i, this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute, this.memoizedFileURLs = /* @__PURE__ */ new Map(), this.memoizedPaths = /* @__PURE__ */ new Map(), this.memoizedURLs = /* @__PURE__ */ new Map();
}
addAnnotation() {
let e;
this.isInline() ? e = "data:application/json;base64," + this.toBase64(this.map.toString()) : typeof this.mapOpts.annotation == "string" ? e = this.mapOpts.annotation : typeof this.mapOpts.annotation == "function" ? e = this.mapOpts.annotation(this.opts.to, this.root) : e = this.outputFile() + ".map";
let n = `
`;
this.css.includes(`\r
`) && (n = `\r
`), this.css += n + "/*# sourceMappingURL=" + e + " */";
}
applyPrevMaps() {
for (let e of this.previous()) {
let n = this.toUrl(this.path(e.file)), r = e.root || bl(e.file), i;
this.mapOpts.sourcesContent === !1 ? (i = new G2(e.text), i.sourcesContent && (i.sourcesContent = i.sourcesContent.map(() => null))) : i = e.consumer(), this.map.applySourceMap(i, n, this.toUrl(this.path(r)));
}
}
clearAnnotation() {
if (this.mapOpts.annotation !== !1)
if (this.root) {
let e;
for (let n = this.root.nodes.length - 1; n >= 0; n--)
e = this.root.nodes[n], e.type === "comment" && e.text.indexOf("# sourceMappingURL=") === 0 && this.root.removeChild(n);
} else
this.css && (this.css = this.css.replace(/(\n)?\/\*#[\S\s]*?\*\/$/gm, ""));
}
generate() {
if (this.clearAnnotation(), Y7 && W7 && this.isMap())
return this.generateMap();
{
let e = "";
return this.stringify(this.root, (n) => {
e += n;
}), [e];
}
}
generateMap() {
if (this.root)
this.generateString();
else if (this.previous().length === 1) {
let e = this.previous()[0].consumer();
e.file = this.outputFile(), this.map = gl.fromSourceMap(e);
} else
this.map = new gl({ file: this.outputFile() }), this.map.addMapping({
generated: { column: 0, line: 1 },
original: { column: 0, line: 1 },
source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : "<no source>"
});
return this.isSourcesContent() && this.setSourcesContent(), this.root && this.previous().length > 0 && this.applyPrevMaps(), this.isAnnotation() && this.addAnnotation(), this.isInline() ? [this.css] : [this.css, this.map];
}
generateString() {
this.css = "", this.map = new gl({ file: this.outputFile() });
let e = 1, n = 1, r = "<no source>", i = {
generated: { column: 0, line: 0 },
original: { column: 0, line: 0 },
source: ""
}, o, a;
this.stringify(this.root, (s, u, l) => {
if (this.css += s, u && l !== "end" && (i.generated.line = e, i.generated.column = n - 1, u.source && u.source.start ? (i.source = this.sourcePath(u), i.original.line = u.source.start.line, i.original.column = u.source.start.column - 1, this.map.addMapping(i)) : (i.source = r, i.original.line = 1, i.original.column = 0, this.map.addMapping(i))), o = s.match(/\n/g), o ? (e += o.length, a = s.lastIndexOf(`
`), n = s.length - a) : n += s.length, u && l !== "start") {
let c = u.parent || { raws: {} };
(!(u.type === "decl" || u.type === "atrule" && !u.nodes) || u !== c.last || c.raws.semicolon) && (u.source && u.source.end ? (i.source = this.sourcePath(u), i.original.line = u.source.end.line, i.original.column = u.source.end.column - 1, i.generated.line = e, i.generated.column = n - 2, this.map.addMapping(i)) : (i.source = r, i.original.line = 1, i.original.column = 0, i.generated.line = e, i.generated.column = n - 1, this.map.addMapping(i)));
}
});
}
isAnnotation() {
return this.isInline() ? !0 : typeof this.mapOpts.annotation < "u" ? this.mapOpts.annotation : this.previous().length ? this.previous().some((e) => e.annotation) : !0;
}
isInline() {
if (typeof this.mapOpts.inline < "u")
return this.mapOpts.inline;
let e = this.mapOpts.annotation;
return typeof e < "u" && e !== !0 ? !1 : this.previous().length ? this.previous().some((n) => n.inline) : !0;
}
isMap() {
return typeof this.opts.map < "u" ? !!this.opts.map : this.previous().length > 0;
}
isSourcesContent() {
return typeof this.mapOpts.sourcesContent < "u" ? this.mapOpts.sourcesContent : this.previous().length ? this.previous().some((e) => e.withContent()) : !0;
}
outputFile() {
return this.opts.to ? this.path(this.opts.to) : this.opts.from ? this.path(this.opts.from) : "to.css";
}
path(e) {
if (this.mapOpts.absolute || e.charCodeAt(0) === 60 || /^\w+:\/\//.test(e))
return e;
let n = this.memoizedPaths.get(e);
if (n)
return n;
let r = this.opts.to ? bl(this.opts.to) : ".";
typeof this.mapOpts.annotation == "string" && (r = bl(X2(r, this.mapOpts.annotation)));
let i = J2(r, e);
return this.memoizedPaths.set(e, i), i;
}
previous() {
if (!this.previousMaps)
if (this.previousMaps = [], this.root)
this.root.walk((e) => {
if (e.source && e.source.input.map) {
let n = e.source.input.map;
this.previousMaps.includes(n) || this.previousMaps.push(n);
}
});
else {
let e = new U7(this.css, this.opts);
e.map && this.previousMaps.push(e.map);
}
return this.previousMaps;
}
setSourcesContent() {
let e = {};
if (this.root)
this.root.walk((n) => {
if (n.source) {
let r = n.source.input.from;
if (r && !e[r]) {
e[r] = !0;
let i = this.usesFileUrls ? this.toFileUrl(r) : this.toUrl(this.path(r));
this.map.setSourceContent(i, n.source.input.css);
}
}
});
else if (this.css) {
let n = this.opts.from ? this.toUrl(this.path(this.opts.from)) : "<no source>";
this.map.setSourceContent(n, this.css);
}
}
sourcePath(e) {
return this.mapOpts.from ? this.toUrl(this.mapOpts.from) : this.usesFileUrls ? this.toFileUrl(e.source.input.from) : this.toUrl(this.path(e.source.input.from));
}
toBase64(e) {
return Buffer ? Buffer.from(e).toString("base64") : window.btoa(unescape(encodeURIComponent(e)));
}
toFileUrl(e) {
let n = this.memoizedFileURLs.get(e);
if (n)
return n;
if (G1) {
let r = G1(e).toString();
return this.memoizedFileURLs.set(e, r), r;
} else
throw new Error(
"`map.absolute` option is not available in this PostCSS build"
);
}
toUrl(e) {
let n = this.memoizedURLs.get(e);
if (n)
return n;
Q2 === "\\" && (e = e.replace(/\\/g, "/"));
let r = encodeURI(e).replace(/[#?]/g, encodeURIComponent);
return this.memoizedURLs.set(e, r), r;
}
};
var Z2 = K7;
let G7 = nd, S0 = class extends G7 {
constructor(e) {
super(e), this.type = "comment";
}
};
var od = S0;
S0.default = S0;
let { isClean: e3, my: t3 } = ku, n3 = rd, r3 = od, J7 = nd, i3, th, nh, o3;
function a3(t) {
return t.map((e) => (e.nodes && (e.nodes = a3(e.nodes)), delete e.source, e));
}
function s3(t) {
if (t[e3] = !1, t.proxyOf.nodes)
for (let e of t.proxyOf.nodes)
s3(e);
}
let gi = class u3 extends J7 {
append(...e) {
for (let n of e) {
let r = this.normalize(n, this.last);
for (let i of r)
this.proxyOf.nodes.push(i);
}
return this.markDirty(), this;
}
cleanRaws(e) {
if (super.cleanRaws(e), this.nodes)
for (let n of this.nodes)
n.cleanRaws(e);
}
each(e) {
if (!this.proxyOf.nodes)
return;
let n = this.getIterator(), r, i;
for (; this.indexes[n] < this.proxyOf.nodes.length && (r = this.indexes[n], i = e(this.proxyOf.nodes[r], r), i !== !1); )
this.indexes[n] += 1;
return delete this.indexes[n], i;
}
every(e) {
return this.nodes.every(e);
}
getIterator() {
this.lastEach || (this.lastEach = 0), this.indexes || (this.indexes = {}), this.lastEach += 1;
let e = this.lastEach;
return this.indexes[e] = 0, e;
}
getProxyProcessor() {
return {
get(e, n) {
return n === "proxyOf" ? e : e[n] ? n === "each" || typeof n == "string" && n.startsWith("walk") ? (...r) => e[n](
...r.map((i) => typeof i == "function" ? (o, a) => i(o.toProxy(), a) : i)
) : n === "every" || n === "some" ? (r) => e[n](
(i, ...o) => r(i.toProxy(), ...o)
) : n === "root" ? () => e.root().toProxy() : n === "nodes" ? e.nodes.map((r) => r.toProxy()) : n === "first" || n === "last" ? e[n].toProxy() : e[n] : e[n];
},
set(e, n, r) {
return e[n] === r || (e[n] = r, (n === "name" || n === "params" || n === "selector") && e.markDirty()), !0;
}
};
}
index(e) {
return typeof e == "number" ? e : (e.proxyOf && (e = e.proxyOf), this.proxyOf.nodes.indexOf(e));
}
insertAfter(e, n) {
let r = this.index(e), i = this.normalize(n, this.proxyOf.nodes[r]).reverse();
r = this.index(e);
for (let a of i)
this.proxyOf.nodes.splice(r + 1, 0, a);
let o;
for (let a in this.indexes)
o = this.indexes[a], r < o && (this.indexes[a] = o + i.length);
return this.markDirty(), this;
}
insertBefore(e, n) {
let r = this.index(e), i = r === 0 ? "prepend" : !1, o = this.normalize(n, this.proxyOf.nodes[r], i).reverse();
r = this.index(e);
for (let s of o)
this.proxyOf.nodes.splice(r, 0, s);
let a;
for (let s in this.indexes)
a = this.indexes[s], r <= a && (this.indexes[s] = a + o.length);
return this.markDirty(), this;
}
normalize(e, n) {
if (typeof e == "string")
e = a3(i3(e).nodes);
else if (Array.isArray(e)) {
e = e.slice(0);
for (let i of e)
i.parent && i.parent.removeChild(i, "ignore");
} else if (e.type === "root" && this.type !== "document") {
e = e.nodes.slice(0);
for (let i of e)
i.parent && i.parent.removeChild(i, "ignore");
} else if (e.type)
e = [e];
else if (e.prop) {
if (typeof e.value > "u")
throw new Error("Value field is missed in node creation");
typeof e.value != "string" && (e.value = String(e.value)), e = [new n3(e)];
} else if (e.selector)
e = [new th(e)];
else if (e.name)
e = [new nh(e)];
else if (e.text)
e = [new r3(e)];
else
throw new Error("Unknown node type in node creation");
return e.map((i) => (i[t3] || u3.rebuild(i), i = i.proxyOf, i.parent && i.parent.removeChild(i), i[e3] && s3(i), typeof i.raws.before > "u" && n && typeof n.raws.before < "u" && (i.raws.before = n.raws.before.replace(/\S/g, "")), i.parent = this.proxyOf, i));
}
prepend(...e) {
e = e.reverse();
for (let n of e) {
let r = this.normalize(n, this.first, "prepend").reverse();
for (let i of r)
this.proxyOf.nodes.unshift(i);
for (let i in this.indexes)
this.indexes[i] = this.indexes[i] + r.length;
}
return this.markDirty(), this;
}
push(e) {
return e.parent = this, this.proxyOf.nodes.push(e), this;
}
removeAll() {
for (let e of this.proxyOf.nodes)
e.parent = void 0;
return this.proxyOf.nodes = [], this.markDirty(), this;
}
removeChild(e) {
e = this.index(e), this.proxyOf.nodes[e].parent = void 0, this.proxyOf.nodes.splice(e, 1);
let n;
for (let r in this.indexes)
n = this.indexes[r], n >= e && (this.indexes[r] = n - 1);
return this.markDirty(), this;
}
replaceValues(e, n, r) {
return r || (r = n, n = {}), this.walkDecls((i) => {
n.props && !n.props.includes(i.prop) || n.fast && !i.value.includes(n.fast) || (i.value = i.value.replace(e, r));
}), this.markDirty(), this;
}
some(e) {
return this.nodes.some(e);
}
walk(e) {
return this.each((n, r) => {
let i;
try {
i = e(n, r);
} catch (o) {
throw n.addToError(o);
}
return i !== !1 && n.walk && (i = n.walk(e)), i;
});
}
walkAtRules(e, n) {
return n ? e instanceof RegExp ? this.walk((r, i) => {
if (r.type === "atrule" && e.test(r.name))
return n(r, i);
}) : this.walk((r, i) => {
if (r.type === "atrule" && r.name === e)
return n(r, i);
}) : (n = e, this.walk((r, i) => {
if (r.type === "atrule")
return n(r, i);
}));
}
walkComments(e) {
return this.walk((n, r) => {
if (n.type === "comment")
return e(n, r);
});
}
walkDecls(e, n) {
return n ? e instanceof RegExp ? this.walk((r, i) => {
if (r.type === "decl" && e.test(r.prop))
return n(r, i);
}) : this.walk((r, i) => {
if (r.type === "decl" && r.prop === e)
return n(r, i);
}) : (n = e, this.walk((r, i) => {
if (r.type === "decl")
return n(r, i);
}));
}
walkRules(e, n) {
return n ? e instanceof RegExp ? this.walk((r, i) => {
if (r.type === "rule" && e.test(r.selector))
return n(r, i);
}) : this.walk((r, i) => {
if (r.type === "rule" && r.selector === e)
return n(r, i);
}) : (n = e, this.walk((r, i) => {
if (r.type === "rule")
return n(r, i);
}));
}
get first() {
if (this.proxyOf.nodes)
return this.proxyOf.nodes[0];
}
get last() {
if (this.proxyOf.nodes)
return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
}
};
gi.registerParse = (t) => {
i3 = t;
};
gi.registerRule = (t) => {
th = t;
};
gi.registerAtRule = (t) => {
nh = t;
};
gi.registerRoot = (t) => {
o3 = t;
};
var Yo = gi;
gi.default = gi;
gi.rebuild = (t) => {
t.type === "atrule" ? Object.setPrototypeOf(t, nh.prototype) : t.type === "rule" ? Object.setPrototypeOf(t, th.prototype) : t.type === "decl" ? Object.setPrototypeOf(t, n3.prototype) : t.type === "comment" ? Object.setPrototypeOf(t, r3.prototype) : t.type === "root" && Object.setPrototypeOf(t, o3.prototype), t[t3] = !0, t.nodes && t.nodes.forEach((e) => {
gi.rebuild(e);
});
};
let X7 = Yo, l3, c3, Qs = class extends X7 {
constructor(e) {
super({ type: "document", ...e }), this.nodes || (this.nodes = []);
}
toResult(e = {}) {
return new l3(new c3(), this, e).stringify();
}
};
Qs.registerLazyResult = (t) => {
l3 = t;
};
Qs.registerProcessor = (t) => {
c3 = t;
};
var rh = Qs;
Qs.default = Qs;
let J1 = {};
var d3 = function(e) {
J1[e] || (J1[e] = !0, typeof console < "u" && console.warn && console.warn(e));
};
let E0 = class {
constructor(e, n = {}) {
if (this.type = "warning", this.text = e, n.node && n.node.source) {
let r = n.node.rangeBy(n);
this.line = r.start.line, this.column = r.start.column, this.endLine = r.end.line, this.endColumn = r.end.column;
}
for (let r in n)
this[r] = n[r];
}
toString() {
return this.node ? this.node.error(this.text, {
index: this.index,
plugin: this.plugin,
word: this.word
}).message : this.plugin ? this.plugin + ": " + this.text : this.text;
}
};
var f3 = E0;
E0.default = E0;
let Q7 = f3, _0 = class {
constructor(e, n, r) {
this.processor = e, this.messages = [], this.root = n, this.opts = r, this.css = void 0, this.map = void 0;
}
toString() {
return this.css;
}
warn(e, n = {}) {
n.plugin || this.lastPlugin && this.lastPlugin.postcssPlugin && (n.plugin = this.lastPlugin.postcssPlugin);
let r = new Q7(e, n);
return this.messages.push(r), r;
}
warnings() {
return this.messages.filter((e) => e.type === "warning");
}
get content() {
return this.css;
}
};
var ih = _0;
_0.default = _0;
const rf = "'".charCodeAt(0), X1 = '"'.charCodeAt(0), Bu = "\\".charCodeAt(0), Q1 = "/".charCodeAt(0), Vu = `
`.charCodeAt(0), us = " ".charCodeAt(0), zu = "\f".charCodeAt(0), Hu = " ".charCodeAt(0), qu = "\r".charCodeAt(0), Z7 = "[".charCodeAt(0), e$ = "]".charCodeAt(0), t$ = "(".charCodeAt(0), n$ = ")".charCodeAt(0), r$ = "{".charCodeAt(0), i$ = "}".charCodeAt(0), o$ = ";".charCodeAt(0), a$ = "*".charCodeAt(0), s$ = ":".charCodeAt(0), u$ = "@".charCodeAt(0), Fu = /[\t\n\f\r "#'()/;[\\\]{}]/g, ju = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g, l$ = /.[\r\n"'(/\\]/, Z1 = /[\da-f]/i;
var c$ = function(e, n = {}) {
let r = e.css.valueOf(), i = n.ignoreErrors, o, a, s, u, l, c, f, d, p, h, m = r.length, v = 0, y = [], k = [];
function T() {
return v;
}
function b(_) {
throw e.error("Unclosed " + _, v);
}
function D() {
return k.length === 0 && v >= m;
}
function x(_) {
if (k.length)
return k.pop();
if (v >= m)
return;
let N = _ ? _.ignoreUnclosed : !1;
switch (o = r.charCodeAt(v), o) {
case Vu:
case us:
case Hu:
case qu:
case zu: {
a = v;
do
a += 1, o = r.charCodeAt(a);
while (o === us || o === Vu || o === Hu || o === qu || o === zu);
h = ["space", r.slice(v, a)], v = a - 1;
break;
}
case Z7:
case e$:
case r$:
case i$:
case s$:
case o$:
case n$: {
let R = String.fromCharCode(o);
h = [R, R, v];
break;
}
case t$: {
if (d = y.length ? y.pop()[1] : "", p = r.charCodeAt(v + 1), d === "url" && p !== rf && p !== X1 && p !== us && p !== Vu && p !== Hu && p !== zu && p !== qu) {
a = v;
do {
if (c = !1, a = r.indexOf(")", a + 1), a === -1)
if (i || N) {
a = v;
break;
} else
b("bracket");
for (f = a; r.charCodeAt(f - 1) === Bu; )
f -= 1, c = !c;
} while (c);
h = ["brackets", r.slice(v, a + 1), v, a], v = a;
} else
a = r.indexOf(")", v + 1), u = r.slice(v, a + 1), a === -1 || l$.test(u) ? h = ["(", "(", v] : (h = ["brackets", u, v, a], v = a);
break;
}
case rf:
case X1: {
s = o === rf ? "'" : '"', a = v;
do {
if (c = !1, a = r.indexOf(s, a + 1), a === -1)
if (i || N) {
a = v + 1;
break;
} else
b("string");
for (f = a; r.charCodeAt(f - 1) === Bu; )
f -= 1, c = !c;
} while (c);
h = ["string", r.slice(v, a + 1), v, a], v = a;
break;
}
case u$: {
Fu.lastIndex = v + 1, Fu.test(r), Fu.lastIndex === 0 ? a = r.length - 1 : a = Fu.lastIndex - 2, h = ["at-word", r.slice(v, a + 1), v, a], v = a;
break;
}
case Bu: {
for (a = v, l = !0; r.charCodeAt(a + 1) === Bu; )
a += 1, l = !l;
if (o = r.charCodeAt(a + 1), l && o !== Q1 && o !== us && o !== Vu && o !== Hu && o !== qu && o !== zu && (a += 1, Z1.test(r.charAt(a)))) {
for (; Z1.test(r.charAt(a + 1)); )
a += 1;
r.charCodeAt(a + 1) === us && (a += 1);
}
h = ["word", r.slice(v, a + 1), v, a], v = a;
break;
}
default: {
o === Q1 && r.charCodeAt(v + 1) === a$ ? (a = r.indexOf("*/", v + 2) + 1, a === 0 && (i || N ? a = r.length : b("comment")), h = ["comment", r.slice(v, a + 1), v, a], v = a) : (ju.lastIndex = v + 1, ju.test(r), ju.lastIndex === 0 ? a = r.length - 1 : a = ju.lastIndex - 2, h = ["word", r.slice(v, a + 1), v, a], y.push(h), v = a);
break;
}
}
return v++, h;
}
function S(_) {
k.push(_);
}
return {
back: S,
endOfFile: D,
nextToken: x,
position: T
};
};
let p3 = Yo, Kl = class extends p3 {
constructor(e) {
super(e), this.type = "atrule";
}
append(...e) {
return this.proxyOf.nodes || (this.nodes = []), super.append(...e);
}
prepend(...e) {
return this.proxyOf.nodes || (this.nodes = []), super.prepend(...e);
}
};
var oh = Kl;
Kl.default = Kl;
p3.registerAtRule(Kl);
let h3 = Yo, m3, g3, za = class extends h3 {
constructor(e) {
super(e), this.type = "root", this.nodes || (this.nodes = []);
}
normalize(e, n, r) {
let i = super.normalize(e);
if (n) {
if (r === "prepend")
this.nodes.length > 1 ? n.raws.before = this.nodes[1].raws.before : delete n.raws.before;
else if (this.first !== n)
for (let o of i)
o.raws.before = n.raws.before;
}
return i;
}
removeChild(e, n) {
let r = this.index(e);
return !n && r === 0 && this.nodes.length > 1 && (this.nodes[1].raws.before = this.nodes[r].raws.before), super.removeChild(e);
}
toResult(e = {}) {
return new m3(new g3(), this, e).stringify();
}
};
za.registerLazyResult = (t) => {
m3 = t;
};
za.registerProcessor = (t) => {
g3 = t;
};
var xu = za;
za.default = za;
h3.registerRoot(za);
let Zs = {
comma(t) {
return Zs.split(t, [","], !0);
},
space(t) {
let e = [" ", `
`, " "];
return Zs.split(t, e);
},
split(t, e, n) {
let r = [], i = "", o = !1, a = 0, s = !1, u = "", l = !1;
for (let c of t)
l ? l = !1 : c === "\\" ? l = !0 : s ? c === u && (s = !1) : c === '"' || c === "'" ? (s = !0, u = c) : c === "(" ? a += 1 : c === ")" ? a > 0 && (a -= 1) : a === 0 && e.includes(c) && (o = !0), o ? (i !== "" && r.push(i.trim()), i = "", o = !1) : i += c;
return (n || i !== "") && r.push(i.trim()), r;
}
};
var b3 = Zs;
Zs.default = Zs;
let v3 = Yo, d$ = b3, Gl = class extends v3 {
constructor(e) {
super(e), this.type = "rule", this.nodes || (this.nodes = []);
}
get selectors() {
return d$.comma(this.selector);
}
set selectors(e) {
let n = this.selector ? this.selector.match(/,\s*/) : null, r = n ? n[0] : "," + this.raw("between", "beforeOpen");
this.selector = e.join(r);
}
};
var ah = Gl;
Gl.default = Gl;
v3.registerRule(Gl);
let f$ = rd, p$ = c$, h$ = od, m$ = oh, g$ = xu, eg = ah;
const tg = {
empty: !0,
space: !0
};
function b$(t) {
for (let e = t.length - 1; e >= 0; e--) {
let n = t[e], r = n[3] || n[2];
if (r)
return r;
}
}
let v$ = class {
constructor(e) {
this.input = e, this.root = new g$(), this.current = this.root, this.spaces = "", this.semicolon = !1, this.customProperty = !1, this.createTokenizer(), this.root.source = { input: e, start: { column: 1, line: 1, offset: 0 } };
}
atrule(e) {
let n = new m$();
n.name = e[1].slice(1), n.name === "" && this.unnamedAtrule(n, e), this.init(n, e[2]);
let r, i, o, a = !1, s = !1, u = [], l = [];
for (; !this.tokenizer.endOfFile(); ) {
if (e = this.tokenizer.nextToken(), r = e[0], r === "(" || r === "[" ? l.push(r === "(" ? ")" : "]") : r === "{" && l.length > 0 ? l.push("}") : r === l[l.length - 1] && l.pop(), l.length === 0)
if (r === ";") {
n.source.end = this.getPosition(e[2]), n.source.end.offset++, this.semicolon = !0;
break;
} else if (r === "{") {
s = !0;
break;
} else if (r === "}") {
if (u.length > 0) {
for (o = u.length - 1, i = u[o]; i && i[0] === "space"; )
i = u[--o];
i && (n.source.end = this.getPosition(i[3] || i[2]), n.source.end.offset++);
}
this.end(e);
break;
} else
u.push(e);
else
u.push(e);
if (this.tokenizer.endOfFile()) {
a = !0;
break;
}
}
n.raws.between = this.spacesAndCommentsFromEnd(u), u.length ? (n.raws.afterName = this.spacesAndCommentsFromStart(u), this.raw(n, "params", u), a && (e = u[u.length - 1], n.source.end = this.getPosition(e[3] || e[2]), n.source.end.offset++, this.spaces = n.raws.between, n.raws.between = "")) : (n.raws.afterName = "", n.params = ""), s && (n.nodes = [], this.current = n);
}
checkMissedSemicolon(e) {
let n = this.colon(e);
if (n === !1)
return;
let r = 0, i;
for (let o = n - 1; o >= 0 && (i = e[o], !(i[0] !== "space" && (r += 1, r === 2))); o--)
;
throw this.input.error(
"Missed semicolon",
i[0] === "word" ? i[3] + 1 : i[2]
);
}
colon(e) {
let n = 0, r, i, o;
for (let [a, s] of e.entries()) {
if (r = s, i = r[0], i === "(" && (n += 1), i === ")" && (n -= 1), n === 0 && i === ":")
if (!o)
this.doubleColon(r);
else {
if (o[0] === "word" && o[1] === "progid")
continue;
return a;
}
o = r;
}
return !1;
}
comment(e) {
let n = new h$();
this.init(n, e[2]), n.source.end = this.getPosition(e[3] || e[2]), n.source.end.offset++;
let r = e[1].slice(2, -2);
if (/^\s*$/.test(r))
n.text = "", n.raws.left = r, n.raws.right = "";
else {
let i = r.match(/^(\s*)([^]*\S)(\s*)$/);
n.text = i[2], n.raws.left = i[1], n.raws.right = i[3];
}
}
createTokenizer() {
this.tokenizer = p$(this.input);
}
decl(e, n) {
let r = new f$();
this.init(r, e[0][2]);
let i = e[e.length - 1];
for (i[0] === ";" && (this.semicolon = !0, e.pop()), r.source.end = this.getPosition(
i[3] || i[2] || b$(e)
), r.source.end.offset++; e[0][0] !== "word"; )
e.length === 1 && this.unknownWord(e), r.raws.before += e.shift()[1];
for (r.source.start = this.getPosition(e[0][2]), r.prop = ""; e.length; ) {
let l = e[0][0];
if (l === ":" || l === "space" || l === "comment")
break;
r.prop += e.shift()[1];
}
r.raws.between = "";
let o;
for (; e.length; )
if (o = e.shift(), o[0] === ":") {
r.raws.between += o[1];
break;
} else
o[0] === "word" && /\w/.test(o[1]) && this.unknownWord([o]), r.raws.between += o[1];
(r.prop[0] === "_" || r.prop[0] === "*") && (r.raws.before += r.prop[0], r.prop = r.prop.slice(1));
let a = [], s;
for (; e.length && (s = e[0][0], !(s !== "space" && s !== "comment")); )
a.push(e.shift());
this.precheckMissedSemicolon(e);
for (let l = e.length - 1; l >= 0; l--) {
if (o = e[l], o[1].toLowerCase() === "!important") {
r.important = !0;
let c = this.stringFrom(e, l);
c = this.spacesFromEnd(e) + c, c !== " !important" && (r.raws.important = c);
break;
} else if (o[1].toLowerCase() === "important") {
let c = e.slice(0), f = "";
for (let d = l; d > 0; d--) {
let p = c[d][0];
if (f.trim().indexOf("!") === 0 && p !== "space")
break;
f = c.pop()[1] + f;
}
f.trim().indexOf("!") === 0 && (r.important = !0, r.raws.important = f, e = c);
}
if (o[0] !== "space" && o[0] !== "comment")
break;
}
e.some((l) => l[0] !== "space" && l[0] !== "comment") && (r.raws.between += a.map((l) => l[1]).join(""), a = []), this.raw(r, "value", a.concat(e), n), r.value.includes(":") && !n && this.checkMissedSemicolon(e);
}
doubleColon(e) {
throw this.input.error(
"Double colon",
{ offset: e[2] },
{ offset: e[2] + e[1].length }
);
}
emptyRule(e) {
let n = new eg();
this.init(n, e[2]), n.selector = "", n.raws.between = "", this.current = n;
}
end(e) {
this.current.nodes && this.current.nodes.length && (this.current.raws.semicolon = this.semicolon), this.semicolon = !1, this.current.raws.after = (this.current.raws.after || "") + this.spaces, this.spaces = "", this.current.parent ? (this.current.source.end = this.getPosition(e[2]), this.current.source.end.offset++, this.current = this.current.parent) : this.unexpectedClose(e);
}
endFile() {
this.current.parent && this.unclosedBlock(), this.current.nodes && this.current.nodes.length && (this.current.raws.semicolon = this.semicolon), this.current.raws.after = (this.current.raws.after || "") + this.spaces, this.root.source.end = this.getPosition(this.tokenizer.position());
}
freeSemicolon(e) {
if (this.spaces += e[1], this.current.nodes) {
let n = this.current.nodes[this.current.nodes.length - 1];
n && n.type === "rule" && !n.raws.ownSemicolon && (n.raws.ownSemicolon = this.spaces, this.spaces = "");
}
}
// Helpers
getPosition(e) {
let n = this.input.fromOffset(e);
return {
column: n.col,
line: n.line,
offset: e
};
}
init(e, n) {
this.current.push(e), e.source = {
input: this.input,
start: this.getPosition(n)
}, e.raws.before = this.spaces, this.spaces = "", e.type !== "comment" && (this.semicolon = !1);
}
other(e) {
let n = !1, r = null, i = !1, o = null, a = [], s = e[1].startsWith("--"), u = [], l = e;
for (; l; ) {
if (r = l[0], u.push(l), r === "(" || r === "[")
o || (o = l), a.push(r === "(" ? ")" : "]");
else if (s && i && r === "{")
o || (o = l), a.push("}");
else if (a.length === 0)
if (r === ";")
if (i) {
this.decl(u, s);
return;
} else
break;
else if (r === "{") {
this.rule(u);
return;
} else if (r === "}") {
this.tokenizer.back(u.pop()), n = !0;
break;
} else
r === ":" && (i = !0);
else
r === a[a.length - 1] && (a.pop(), a.length === 0 && (o = null));
l = this.tokenizer.nextToken();
}
if (this.tokenizer.endOfFile() && (n = !0), a.length > 0 && this.unclosedBracket(o), n && i) {
if (!s)
for (; u.length && (l = u[u.length - 1][0], !(l !== "space" && l !== "comment")); )
this.tokenizer.back(u.pop());
this.decl(u, s);
} else
this.unknownWord(u);
}
parse() {
let e;
for (; !this.tokenizer.endOfFile(); )
switch (e = this.tokenizer.nextToken(), e[0]) {
case "space":
this.spaces += e[1];
break;
case ";":
this.freeSemicolon(e);
break;
case "}":
this.end(e);
break;
case "comment":
this.comment(e);
break;
case "at-word":
this.atrule(e);
break;
case "{":
this.emptyRule(e);
break;
default:
this.other(e);
break;
}
this.endFile();
}
precheckMissedSemicolon() {
}
raw(e, n, r, i) {
let o, a, s = r.length, u = "", l = !0, c, f;
for (let d = 0; d < s; d += 1)
o = r[d], a = o[0], a === "space" && d === s - 1 && !i ? l = !1 : a === "comment" ? (f = r[d - 1] ? r[d - 1][0] : "empty", c = r[d + 1] ? r[d + 1][0] : "empty", !tg[f] && !tg[c] ? u.slice(-1) === "," ? l = !1 : u += o[1] : l = !1) : u += o[1];
if (!l) {
let d = r.reduce((p, h) => p + h[1], "");
e.raws[n] = { raw: d, value: u };
}
e[n] = u;
}
rule(e) {
e.pop();
let n = new eg();
this.init(n, e[0][2]), n.raws.between = this.spacesAndCommentsFromEnd(e), this.raw(n, "selector", e), this.current = n;
}
spacesAndCommentsFromEnd(e) {
let n, r = "";
for (; e.length && (n = e[e.length - 1][0], !(n !== "space" && n !== "comment")); )
r = e.pop()[1] + r;
return r;
}
// Errors
spacesAndCommentsFromStart(e) {
let n, r = "";
for (; e.length && (n = e[0][0], !(n !== "space" && n !== "comment")); )
r += e.shift()[1];
return r;
}
spacesFromEnd(e) {
let n, r = "";
for (; e.length && (n = e[e.length - 1][0], n === "space"); )
r = e.pop()[1] + r;
return r;
}
stringFrom(e, n) {
let r = "";
for (let i = n; i < e.length; i++)
r += e[i][1];
return e.splice(n, e.length - n), r;
}
unclosedBlock() {
let e = this.current.source.start;
throw this.input.error("Unclosed block", e.line, e.column);
}
unclosedBracket(e) {
throw this.input.error(
"Unclosed bracket",
{ offset: e[2] },
{ offset: e[2] + 1 }
);
}
unexpectedClose(e) {
throw this.input.error(
"Unexpected }",
{ offset: e[2] },
{ offset: e[2] + 1 }
);
}
unknownWord(e) {
throw this.input.error(
"Unknown word",
{ offset: e[0][2] },
{ offset: e[0][2] + e[0][1].length }
);
}
unnamedAtrule(e, n) {
throw this.input.error(
"At-rule without name",
{ offset: n[2] },
{ offset: n[2] + n[1].length }
);
}
};
var y$ = v$;
let w$ = Yo, k$ = y$, x$ = id;
function Jl(t, e) {
let n = new x$(t, e), r = new k$(n);
try {
r.parse();
} catch (i) {
throw process.env.NODE_ENV !== "production" && i.name === "CssSyntaxError" && e && e.from && (/\.scss$/i.test(e.from) ? i.message += `
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser` : /\.sass/i.test(e.from) ? i.message += `
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser` : /\.less$/i.test(e.from) && (i.message += `
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)), i;
}
return r.root;
}
var sh = Jl;
Jl.default = Jl;
w$.registerParse(Jl);
let { isClean: _r, my: S$ } = ku, E$ = Z2, _$ = td, T$ = Yo, C$ = rh, O$ = d3, ng = ih, A$ = sh, M$ = xu;
const D$ = {
atrule: "AtRule",
comment: "Comment",
decl: "Declaration",
document: "Document",
root: "Root",
rule: "Rule"
}, $$ = {
AtRule: !0,
AtRuleExit: !0,
Comment: !0,
CommentExit: !0,
Declaration: !0,
DeclarationExit: !0,
Document: !0,
DocumentExit: !0,
Once: !0,
OnceExit: !0,
postcssPlugin: !0,
prepare: !0,
Root: !0,
RootExit: !0,
Rule: !0,
RuleExit: !0
}, N$ = {
Once: !0,
postcssPlugin: !0,
prepare: !0
}, Ha = 0;
function ls(t) {
return typeof t == "object" && typeof t.then == "function";
}
function y3(t) {
let e = !1, n = D$[t.type];
return t.type === "decl" ? e = t.prop.toLowerCase() : t.type === "atrule" && (e = t.name.toLowerCase()), e && t.append ? [
n,
n + "-" + e,
Ha,
n + "Exit",
n + "Exit-" + e
] : e ? [n, n + "-" + e, n + "Exit", n + "Exit-" + e] : t.append ? [n, Ha, n + "Exit"] : [n, n + "Exit"];
}
function rg(t) {
let e;
return t.type === "document" ? e = ["Document", Ha, "DocumentExit"] : t.type === "root" ? e = ["Root", Ha, "RootExit"] : e = y3(t), {
eventIndex: 0,
events: e,
iterator: 0,
node: t,
visitorIndex: 0,
visitors: []
};
}
function T0(t) {
return t[_r] = !1, t.nodes && t.nodes.forEach((e) => T0(e)), t;
}
let C0 = {}, qa = class w3 {
constructor(e, n, r) {
this.stringified = !1, this.processed = !1;
let i;
if (typeof n == "object" && n !== null && (n.type === "root" || n.type === "document"))
i = T0(n);
else if (n instanceof w3 || n instanceof ng)
i = T0(n.root), n.map && (typeof r.map > "u" && (r.map = {}), r.map.inline || (r.map.inline = !1), r.map.prev = n.map);
else {
let o = A$;
r.syntax && (o = r.syntax.parse), r.parser && (o = r.parser), o.parse && (o = o.parse);
try {
i = o(n, r);
} catch (a) {
this.processed = !0, this.error = a;
}
i && !i[S$] && T$.rebuild(i);
}
this.result = new ng(e, i, r), this.helpers = { ...C0, postcss: C0, result: this.result }, this.plugins = this.processor.plugins.map((o) => typeof o == "object" && o.prepare ? { ...o, ...o.prepare(this.result) } : o);
}
async() {
return this.error ? Promise.reject(this.error) : this.processed ? Promise.resolve(this.result) : (this.processing || (this.processing = this.runAsync()), this.processing);
}
catch(e) {
return this.async().catch(e);
}
finally(e) {
return this.async().then(e, e);
}
getAsyncError() {
throw new Error("Use process(css).then(cb) to work with async plugins");
}
handleError(e, n) {
let r = this.result.lastPlugin;
try {
if (n && n.addToError(e), this.error = e, e.name === "CssSyntaxError" && !e.plugin)
e.plugin = r.postcssPlugin, e.setMessage();
else if (r.postcssVersion && process.env.NODE_ENV !== "production") {
let i = r.postcssPlugin, o = r.postcssVersion, a = this.result.processor.version, s = o.split("."), u = a.split(".");
(s[0] !== u[0] || parseInt(s[1]) > parseInt(u[1])) && console.error(
"Unknown error from PostCSS plugin. Your current PostCSS version is " + a + ", but " + i + " uses " + o + ". Perhaps this is the source of the error below."
);
}
} catch (i) {
console && console.error && console.error(i);
}
return e;
}
prepareVisitors() {
this.listeners = {};
let e = (n, r, i) => {
this.listeners[r] || (this.listeners[r] = []), this.listeners[r].push([n, i]);
};
for (let n of this.plugins)
if (typeof n == "object")
for (let r in n) {
if (!$$[r] && /^[A-Z]/.test(r))
throw new Error(
`Unknown event ${r} in ${n.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`
);
if (!N$[r])
if (typeof n[r] == "object")
for (let i in n[r])
i === "*" ? e(n, r, n[r][i]) : e(
n,
r + "-" + i.toLowerCase(),
n[r][i]
);
else
typeof n[r] == "function" && e(n, r, n[r]);
}
this.hasListener = Object.keys(this.listeners).length > 0;
}
async runAsync() {
this.plugin = 0;
for (let e = 0; e < this.plugins.length; e++) {
let n = this.plugins[e], r = this.runOnRoot(n);
if (ls(r))
try {
await r;
} catch (i) {
throw this.handleError(i);
}
}
if (this.prepareVisitors(), this.hasListener) {
let e = this.result.root;
for (; !e[_r]; ) {
e[_r] = !0;
let n = [rg(e)];
for (; n.length > 0; ) {
let r = this.visitTick(n);
if (ls(r))
try {
await r;
} catch (i) {
let o = n[n.length - 1].node;
throw this.handleError(i, o);
}
}
}
if (this.listeners.OnceExit)
for (let [n, r] of this.listeners.OnceExit) {
this.result.lastPlugin = n;
try {
if (e.type === "document") {
let i = e.nodes.map(
(o) => r(o, this.helpers)
);
await Promise.all(i);
} else
await r(e, this.helpers);
} catch (i) {
throw this.handleError(i);
}
}
}
return this.processed = !0, this.stringify();
}
runOnRoot(e) {
this.result.lastPlugin = e;
try {
if (typeof e == "object" && e.Once) {
if (this.result.root.type === "document") {
let n = this.result.root.nodes.map(
(r) => e.Once(r, this.helpers)
);
return ls(n[0]) ? Promise.all(n) : n;
}
return e.Once(this.result.root, this.helpers);
} else if (typeof e == "function")
return e(this.result.root, this.result);
} catch (n) {
throw this.handleError(n);
}
}
stringify() {
if (this.error)
throw this.error;
if (this.stringified)
return this.result;
this.stringified = !0, this.sync();
let e = this.result.opts, n = _$;
e.syntax && (n = e.syntax.stringify), e.stringifier && (n = e.stringifier), n.stringify && (n = n.stringify);
let i = new E$(n, this.result.root, this.result.opts).generate();
return this.result.css = i[0], this.result.map = i[1], this.result;
}
sync() {
if (this.error)
throw this.error;
if (this.processed)
return this.result;
if (this.processed = !0, this.processing)
throw this.getAsyncError();
for (let e of this.plugins) {
let n = this.runOnRoot(e);
if (ls(n))
throw this.getAsyncError();
}
if (this.prepareVisitors(), this.hasListener) {
let e = this.result.root;
for (; !e[_r]; )
e[_r] = !0, this.walkSync(e);
if (this.listeners.OnceExit)
if (e.type === "document")
for (let n of e.nodes)
this.visitSync(this.listeners.OnceExit, n);
else
this.visitSync(this.listeners.OnceExit, e);
}
return this.result;
}
then(e, n) {
return process.env.NODE_ENV !== "production" && ("from" in this.opts || O$(
"Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."
)), this.async().then(e, n);
}
toString() {
return this.css;
}
visitSync(e, n) {
for (let [r, i] of e) {
this.result.lastPlugin = r;
let o;
try {
o = i(n, this.helpers);
} catch (a) {
throw this.handleError(a, n.proxyOf);
}
if (n.type !== "root" && n.type !== "document" && !n.parent)
return !0;
if (ls(o))
throw this.getAsyncError();
}
}
visitTick(e) {
let n = e[e.length - 1], { node: r, visitors: i } = n;
if (r.type !== "root" && r.type !== "document" && !r.parent) {
e.pop();
return;
}
if (i.length > 0 && n.visitorIndex < i.length) {
let [a, s] = i[n.visitorIndex];
n.visitorIndex += 1, n.visitorIndex === i.length && (n.visitors = [], n.visitorIndex = 0), this.result.lastPlugin = a;
try {
return s(r.toProxy(), this.helpers);
} catch (u) {
throw this.handleError(u, r);
}
}
if (n.iterator !== 0) {
let a = n.iterator, s;
for (; s = r.nodes[r.indexes[a]]; )
if (r.indexes[a] += 1, !s[_r]) {
s[_r] = !0, e.push(rg(s));
return;
}
n.iterator = 0, delete r.indexes[a];
}
let o = n.events;
for (; n.eventIndex < o.length; ) {
let a = o[n.eventIndex];
if (n.eventIndex += 1, a === Ha) {
r.nodes && r.nodes.length && (r[_r] = !0, n.iterator = r.getIterator());
return;
} else if (this.listeners[a]) {
n.visitors = this.listeners[a];
return;
}
}
e.pop();
}
walkSync(e) {
e[_r] = !0;
let n = y3(e);
for (let r of n)
if (r === Ha)
e.nodes && e.each((i) => {
i[_r] || this.walkSync(i);
});
else {
let i = this.listeners[r];
if (i && this.visitSync(i, e.toProxy()))
return;
}
}
warnings() {
return this.sync().warnings();
}
get content() {
return this.stringify().content;
}
get css() {
return this.stringify().css;
}
get map() {
return this.stringify().map;
}
get messages() {
return this.sync().messages;
}
get opts() {
return this.result.opts;
}
get processor() {
return this.result.processor;
}
get root() {
return this.sync().root;
}
get [Symbol.toStringTag]() {
return "LazyResult";
}
};
qa.registerPostcss = (t) => {
C0 = t;
};
var k3 = qa;
qa.default = qa;
M$.registerLazyResult(qa);
C$.registerLazyResult(qa);
let P$ = Z2, I$ = td, L$ = d3, R$ = sh;
const B$ = ih;
let O0 = class {
constructor(e, n, r) {
n = n.toString(), this.stringified = !1, this._processor = e, this._css = n, this._opts = r, this._map = void 0;
let i, o = I$;
this.result = new B$(this._processor, i, this._opts), this.result.css = n;
let a = this;
Object.defineProperty(this.result, "root", {
get() {
return a.root;
}
});
let s = new P$(o, i, this._opts, n);
if (s.isMap()) {
let [u, l] = s.generate();
u && (this.result.css = u), l && (this.result.map = l);
}
}
async() {
return this.error ? Promise.reject(this.error) : Promise.resolve(this.result);
}
catch(e) {
return this.async().catch(e);
}
finally(e) {
return this.async().then(e, e);
}
sync() {
if (this.error)
throw this.error;
return this.result;
}
then(e, n) {
return process.env.NODE_ENV !== "production" && ("from" in this._opts || L$(
"Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning."
)), this.async().then(e, n);
}
toString() {
return this._css;
}
warnings() {
return [];
}
get content() {
return this.result.css;
}
get css() {
return this.result.css;
}
get map() {
return this.result.map;
}
get messages() {
return [];
}
get opts() {
return this.result.opts;
}
get processor() {
return this.result.processor;
}
get root() {
if (this._root)
return this._root;
let e, n = R$;
try {
e = n(this._css, this._opts);
} catch (r) {
this.error = r;
}
if (this.error)
throw this.error;
return this._root = e, e;
}
get [Symbol.toStringTag]() {
return "NoWorkResult";
}
};
var V$ = O0;
O0.default = O0;
let z$ = V$, H$ = k3, q$ = rh, F$ = xu, eu = class {
constructor(e = []) {
this.version = "8.4.31", this.plugins = this.normalize(e);
}
normalize(e) {
let n = [];
for (let r of e)
if (r.postcss === !0 ? r = r() : r.postcss && (r = r.postcss), typeof r == "object" && Array.isArray(r.plugins))
n = n.concat(r.plugins);
else if (typeof r == "object" && r.postcssPlugin)
n.push(r);
else if (typeof r == "function")
n.push(r);
else if (typeof r == "object" && (r.parse || r.stringify)) {
if (process.env.NODE_ENV !== "production")
throw new Error(
"PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation."
);
} else
throw new Error(r + " is not a PostCSS plugin");
return n;
}
process(e, n = {}) {
return this.plugins.length === 0 && typeof n.parser > "u" && typeof n.stringifier > "u" && typeof n.syntax > "u" ? new z$(this, e, n) : new H$(this, e, n);
}
use(e) {
return this.plugins = this.plugins.concat(this.normalize([e])), this;
}
};
var j$ = eu;
eu.default = eu;
F$.registerProcessor(eu);
q$.registerProcessor(eu);
let U$ = rd, W$ = K2, Y$ = od, K$ = oh, G$ = id, J$ = xu, X$ = ah;
function tu(t, e) {
if (Array.isArray(t))
return t.map((i) => tu(i));
let { inputs: n, ...r } = t;
if (n) {
e = [];
for (let i of n) {
let o = { ...i, __proto__: G$.prototype };
o.map && (o.map = {
...o.map,
__proto__: W$.prototype
}), e.push(o);
}
}
if (r.nodes && (r.nodes = t.nodes.map((i) => tu(i, e))), r.source) {
let { inputId: i, ...o } = r.source;
r.source = o, i != null && (r.source.input = e[i]);
}
if (r.type === "root")
return new J$(r);
if (r.type === "decl")
return new U$(r);
if (r.type === "rule")
return new X$(r);
if (r.type === "comment")
return new Y$(r);
if (r.type === "atrule")
return new K$(r);
throw new Error("Unknown node type: " + t.type);
}
var Q$ = tu;
tu.default = tu;
let Z$ = eh, x3 = rd, eN = k3, tN = Yo, uh = j$, nN = td, rN = Q$, S3 = rh, iN = f3, E3 = od, _3 = oh, oN = ih, aN = id, sN = sh, uN = b3, T3 = ah, C3 = xu, lN = nd;
function yt(...t) {
return t.length === 1 && Array.isArray(t[0]) && (t = t[0]), new uh(t);
}
yt.plugin = function(e, n) {
let r = !1;
function i(...a) {
console && console.warn && !r && (r = !0, console.warn(
e + `: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration`
), process.env.LANG && process.env.LANG.startsWith("cn") && console.warn(
e + `: 里面 postcss.plugin 被弃用. 迁移指南:
https://www.w3ctech.com/topic/2226`
));
let s = n(...a);
return s.postcssPlugin = e, s.postcssVersion = new uh().version, s;
}
let o;
return Object.defineProperty(i, "postcss", {
get() {
return o || (o = i()), o;
}
}), i.process = function(a, s, u) {
return yt([i(u)]).process(a, s);
}, i;
};
yt.stringify = nN;
yt.parse = sN;
yt.fromJSON = rN;
yt.list = uN;
yt.comment = (t) => new E3(t);
yt.atRule = (t) => new _3(t);
yt.decl = (t) => new x3(t);
yt.rule = (t) => new T3(t);
yt.root = (t) => new C3(t);
yt.document = (t) => new S3(t);
yt.CssSyntaxError = Z$;
yt.Declaration = x3;
yt.Container = tN;
yt.Processor = uh;
yt.Document = S3;
yt.Comment = E3;
yt.Warning = iN;
yt.AtRule = _3;
yt.Result = oN;
yt.Input = aN;
yt.Rule = T3;
yt.Root = C3;
yt.Node = lN;
eN.registerPostcss(yt);
var cN = yt;
yt.default = yt;
const dN = g2, ig = o7, { isPlainObject: fN } = Qp, og = w7, pN = k7, { parse: hN } = cN, mN = [
"img",
"audio",
"video",
"picture",
"svg",
"object",
"map",
"iframe",
"embed"
], gN = ["script", "style"];
function fs(t, e) {
t && Object.keys(t).forEach(function(n) {
e(t[n], n);
});
}
function ri(t, e) {
return {}.hasOwnProperty.call(t, e);
}
function ag(t, e) {
const n = [];
return fs(t, function(r) {
e(r) && n.push(r);
}), n;
}
function bN(t) {
for (const e in t)
if (ri(t, e))
return !1;
return !0;
}
function vN(t) {
return t.map(function(e) {
if (!e.url)
throw new Error("URL missing");
return e.url + (e.w ? ` ${e.w}w` : "") + (e.h ? ` ${e.h}h` : "") + (e.d ? ` ${e.d}x` : "");
}).join(", ");
}
var yN = nu;
const wN = /^[^\0\t\n\f\r /<=>]+$/;
function nu(t, e, n) {
if (t == null)
return "";
typeof t == "number" && (t = t.toString());
let r = "", i = "";
function o(E, O) {
const g = this;
this.tag = E, this.attribs = O || {}, this.tagPosition = r.length, this.text = "", this.mediaChildren = [], this.updateParentNodeText = function() {
if (v.length) {
const M = v[v.length - 1];
M.text += g.text;
}
}, this.updateParentNodeMediaChildren = function() {
v.length && mN.includes(this.tag) && v[v.length - 1].mediaChildren.push(this.tag);
};
}
e = Object.assign({}, nu.defaults, e), e.parser = Object.assign({}, kN, e.parser);
const a = function(E) {
return e.allowedTags === !1 || (e.allowedTags || []).indexOf(E) > -1;
};
gN.forEach(function(E) {
a(E) && !e.allowVulnerableTags && console.warn(`
⚠️ Your \`allowedTags\` option includes, \`${E}\`, which is inherently
vulnerable to XSS attacks. Please remove it from \`allowedTags\`.
Or, to disable this warning, add the \`allowVulnerableTags\` option
and ensure you are accounting for this risk.
`);
});
const s = e.nonTextTags || [
"script",
"style",
"textarea",
"option"
];
let u, l;
e.allowedAttributes && (u = {}, l = {}, fs(e.allowedAttributes, function(E, O) {
u[O] = [];
const g = [];
E.forEach(function(M) {
typeof M == "string" && M.indexOf("*") >= 0 ? g.push(ig(M).replace(/\\\*/g, ".*")) : u[O].push(M);
}), g.length && (l[O] = new RegExp("^(" + g.join("|") + ")$"));
}));
const c = {}, f = {}, d = {};
fs(e.allowedClasses, function(E, O) {
if (u && (ri(u, O) || (u[O] = []), u[O].push("class")), c[O] = E, Array.isArray(E)) {
const g = [];
c[O] = [], d[O] = [], E.forEach(function(M) {
typeof M == "string" && M.indexOf("*") >= 0 ? g.push(ig(M).replace(/\\\*/g, ".*")) : M instanceof RegExp ? d[O].push(M) : c[O].push(M);
}), g.length && (f[O] = new RegExp("^(" + g.join("|") + ")$"));
}
});
const p = {};
let h;
fs(e.transformTags, function(E, O) {
let g;
typeof E == "function" ? g = E : typeof E == "string" && (g = nu.simpleTransform(E)), O === "*" ? h = g : p[O] = g;
});
let m, v, y, k, T, b, D = !1;
S();
const x = new dN.Parser({
onopentag: function(E, O) {
if (e.enforceHtmlBoundary && E === "html" && S(), T) {
b++;
return;
}
const g = new o(E, O);
v.push(g);
let M = !1;
const H = !!g.text;
let z;
if (ri(p, E) && (z = p[E](E, O), g.attribs = O = z.attribs, z.text !== void 0 && (g.innerText = z.text), E !== z.tagName && (g.name = E = z.tagName, k[m] = z.tagName)), h && (z = h(E, O), g.attribs = O = z.attribs, E !== z.tagName && (g.name = E = z.tagName, k[m] = z.tagName)), (!a(E) || e.disallowedTagsMode === "recursiveEscape" && !bN(y) || e.nestingLimit != null && m >= e.nestingLimit) && (M = !0, y[m] = !0, e.disallowedTagsMode === "discard" && s.indexOf(E) !== -1 && (T = !0, b = 1), y[m] = !0), m++, M) {
if (e.disallowedTagsMode === "discard")
return;
i = r, r = "";
}
r += "<" + E, E === "script" && (e.allowedScriptHostnames || e.allowedScriptDomains) && (g.innerText = ""), (!u || ri(u, E) || u["*"]) && fs(O, function(Y, ee) {
if (!wN.test(ee)) {
delete g.attribs[ee];
return;
}
if (Y === "" && (e.nonBooleanAttributes.includes(ee) || e.nonBooleanAttributes.includes("*"))) {
delete g.attribs[ee];
return;
}
let ce = !1;
if (!u || ri(u, E) && u[E].indexOf(ee) !== -1 || u["*"] && u["*"].indexOf(ee) !== -1 || ri(l, E) && l[E].test(ee) || l["*"] && l["*"].test(ee))
ce = !0;
else if (u && u[E]) {
for (const q of u[E])
if (fN(q) && q.name && q.name === ee) {
ce = !0;
let V = "";
if (q.multiple === !0) {
const te = Y.split(" ");
for (const K of te)
q.values.indexOf(K) !== -1 && (V === "" ? V = K : V += " " + K);
} else
q.values.indexOf(Y) >= 0 && (V = Y);
Y = V;
}
}
if (ce) {
if (e.allowedSchemesAppliedToAttributes.indexOf(ee) !== -1 && N(E, Y)) {
delete g.attribs[ee];
return;
}
if (E === "script" && ee === "src") {
let q = !0;
try {
const V = R(Y);
if (e.allowedScriptHostnames || e.allowedScriptDomains) {
const te = (e.allowedScriptHostnames || []).find(function(Q) {
return Q === V.url.hostname;
}), K = (e.allowedScriptDomains || []).find(function(Q) {
return V.url.hostname === Q || V.url.hostname.endsWith(`.${Q}`);
});
q = te || K;
}
} catch {
q = !1;
}
if (!q) {
delete g.attribs[ee];
return;
}
}
if (E === "iframe" && ee === "src") {
let q = !0;
try {
const V = R(Y);
if (V.isRelativeUrl)
q = ri(e, "allowIframeRelativeUrls") ? e.allowIframeRelativeUrls : !e.allowedIframeHostnames && !e.allowedIframeDomains;
else if (e.allowedIframeHostnames || e.allowedIframeDomains) {
const te = (e.allowedIframeHostnames || []).find(function(Q) {
return Q === V.url.hostname;
}), K = (e.allowedIframeDomains || []).find(function(Q) {
return V.url.hostname === Q || V.url.hostname.endsWith(`.${Q}`);
});
q = te || K;
}
} catch {
q = !1;
}
if (!q) {
delete g.attribs[ee];
return;
}
}
if (ee === "srcset")
try {
let q = pN(Y);
if (q.forEach(function(V) {
N("srcset", V.url) && (V.evil = !0);
}), q = ag(q, function(V) {
return !V.evil;
}), q.length)
Y = vN(ag(q, function(V) {
return !V.evil;
})), g.attribs[ee] = Y;
else {
delete g.attribs[ee];
return;
}
} catch {
delete g.attribs[ee];
return;
}
if (ee === "class") {
const q = c[E], V = c["*"], te = f[E], K = d[E], Q = f["*"], Z = [
te,
Q
].concat(K).filter(function(ae) {
return ae;
});
if (q && V ? Y = I(Y, og(q, V), Z) : Y = I(Y, q || V, Z), !Y.length) {
delete g.attribs[ee];
return;
}
}
if (ee === "style") {
if (e.parseStyleAttributes)
try {
const q = hN(E + " {" + Y + "}"), V = w(q, e.allowedStyles);
if (Y = A(V), Y.length === 0) {
delete g.attribs[ee];
return;
}
} catch {
typeof window < "u" && console.warn('Failed to parse "' + E + " {" + Y + `}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`), delete g.attribs[ee];
return;
}
else if (e.allowedStyles)
throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.");
}
r += " " + ee, Y && Y.length && (r += '="' + _(Y, !0) + '"');
} else
delete g.attribs[ee];
}), e.selfClosing.indexOf(E) !== -1 ? r += " />" : (r += ">", g.innerText && !H && !e.textFilter && (r += _(g.innerText), D = !0)), M && (r = i + _(r), i = "");
},
ontext: function(E) {
if (T)
return;
const O = v[v.length - 1];
let g;
if (O && (g = O.tag, E = O.innerText !== void 0 ? O.innerText : E), e.disallowedTagsMode === "discard" && (g === "script" || g === "style"))
r += E;
else {
const M = _(E, !1);
e.textFilter && !D ? r += e.textFilter(M, g) : D || (r += M);
}
if (v.length) {
const M = v[v.length - 1];
M.text += E;
}
},
onclosetag: function(E, O) {
if (T)
if (b--, !b)
T = !1;
else
return;
const g = v.pop();
if (!g)
return;
if (g.tag !== E) {
v.push(g);
return;
}
T = e.enforceHtmlBoundary ? E === "html" : !1, m--;
const M = y[m];
if (M) {
if (delete y[m], e.disallowedTagsMode === "discard") {
g.updateParentNodeText();
return;
}
i = r, r = "";
}
if (k[m] && (E = k[m], delete k[m]), e.exclusiveFilter && e.exclusiveFilter(g)) {
r = r.substr(0, g.tagPosition);
return;
}
if (g.updateParentNodeMediaChildren(), g.updateParentNodeText(), // Already output />
e.selfClosing.indexOf(E) !== -1 || // Escaped tag, closing tag is implied
O && !a(E) && ["escape", "recursiveEscape"].indexOf(e.disallowedTagsMode) >= 0) {
M && (r = i, i = "");
return;
}
r += "</" + E + ">", M && (r = i + _(r), i = ""), D = !1;
}
}, e.parser);
return x.write(t), x.end(), r;
function S() {
r = "", m = 0, v = [], y = {}, k = {}, T = !1, b = 0;
}
function _(E, O) {
return typeof E != "string" && (E = E + ""), e.parser.decodeEntities && (E = E.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), O && (E = E.replace(/"/g, """))), E = E.replace(/&(?![a-zA-Z0-9#]{1,20};)/g, "&").replace(/</g, "<").replace(/>/g, ">"), O && (E = E.replace(/"/g, """)), E;
}
function N(E, O) {
for (O = O.replace(/[\x00-\x20]+/g, ""); ; ) {
const H = O.indexOf("<!--");
if (H === -1)
break;
const z = O.indexOf("-->", H + 4);
if (z === -1)
break;
O = O.substring(0, H) + O.substring(z + 3);
}
const g = O.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);
if (!g)
return O.match(/^[/\\]{2}/) ? !e.allowProtocolRelative : !1;
const M = g[1].toLowerCase();
return ri(e.allowedSchemesByTag, E) ? e.allowedSchemesByTag[E].indexOf(M) === -1 : !e.allowedSchemes || e.allowedSchemes.indexOf(M) === -1;
}
function R(E) {
if (E = E.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/, "$1//"), E.startsWith("relative:"))
throw new Error("relative: exploit attempt");
let O = "relative://relative-site";
for (let H = 0; H < 100; H++)
O += `/${H}`;
const g = new URL(E, O);
return {
isRelativeUrl: g && g.hostname === "relative-site" && g.protocol === "relative:",
url: g
};
}
function w(E, O) {
if (!O)
return E;
const g = E.nodes[0];
let M;
return O[g.selector] && O["*"] ? M = og(
O[g.selector],
O["*"]
) : M = O[g.selector] || O["*"], M && (E.nodes[0].nodes = g.nodes.reduce($(M), [])), E;
}
function A(E) {
return E.nodes[0].nodes.reduce(function(O, g) {
return O.push(
`${g.prop}:${g.value}${g.important ? " !important" : ""}`
), O;
}, []).join(";");
}
function $(E) {
return function(O, g) {
return ri(E, g.prop) && E[g.prop].some(function(H) {
return H.test(g.value);
}) && O.push(g), O;
};
}
function I(E, O, g) {
return O ? (E = E.split(/\s+/), E.filter(function(M) {
return O.indexOf(M) !== -1 || g.some(function(H) {
return H.test(M);
});
}).join(" ")) : E;
}
}
const kN = {
decodeEntities: !0
};
nu.defaults = {
allowedTags: [
// Sections derived from MDN element categories and limited to the more
// benign categories.
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element
// Content sectioning
"address",
"article",
"aside",
"footer",
"header",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"hgroup",
"main",
"nav",
"section",
// Text content
"blockquote",
"dd",
"div",
"dl",
"dt",
"figcaption",
"figure",
"hr",
"li",
"main",
"ol",
"p",
"pre",
"ul",
// Inline text semantics
"a",
"abbr",
"b",
"bdi",
"bdo",
"br",
"cite",
"code",
"data",
"dfn",
"em",
"i",
"kbd",
"mark",
"q",
"rb",
"rp",
"rt",
"rtc",
"ruby",
"s",
"samp",
"small",
"span",
"strong",
"sub",
"sup",
"time",
"u",
"var",
"wbr",
// Table content
"caption",
"col",
"colgroup",
"table",
"tbody",
"td",
"tfoot",
"th",
"thead",
"tr"
],
// Tags that cannot be boolean
nonBooleanAttributes: [
"abbr",
"accept",
"accept-charset",
"accesskey",
"action",
"allow",
"alt",
"as",
"autocapitalize",
"autocomplete",
"blocking",
"charset",
"cite",
"class",
"color",
"cols",
"colspan",
"content",
"contenteditable",
"coords",
"crossorigin",
"data",
"datetime",
"decoding",
"dir",
"dirname",
"download",
"draggable",
"enctype",
"enterkeyhint",
"fetchpriority",
"for",
"form",
"formaction",
"formenctype",
"formmethod",
"formtarget",
"headers",
"height",
"hidden",
"high",
"href",
"hreflang",
"http-equiv",
"id",
"imagesizes",
"imagesrcset",
"inputmode",
"integrity",
"is",
"itemid",
"itemprop",
"itemref",
"itemtype",
"kind",
"label",
"lang",
"list",
"loading",
"low",
"max",
"maxlength",
"media",
"method",
"min",
"minlength",
"name",
"nonce",
"optimum",
"pattern",
"ping",
"placeholder",
"popover",
"popovertarget",
"popovertargetaction",
"poster",
"preload",
"referrerpolicy",
"rel",
"rows",
"rowspan",
"sandbox",
"scope",
"shape",
"size",
"sizes",
"slot",
"span",
"spellcheck",
"src",
"srcdoc",
"srclang",
"srcset",
"start",
"step",
"style",
"tabindex",
"target",
"title",
"translate",
"type",
"usemap",
"value",
"width",
"wrap",
// Event handlers
"onauxclick",
"onafterprint",
"onbeforematch",
"onbeforeprint",
"onbeforeunload",
"onbeforetoggle",
"onblur",
"oncancel",
"oncanplay",
"oncanplaythrough",
"onchange",
"onclick",
"onclose",
"oncontextlost",
"oncontextmenu",
"oncontextrestored",
"oncopy",
"oncuechange",
"oncut",
"ondblclick",
"ondrag",
"ondragend",
"ondragenter",
"ondragleave",
"ondragover",
"ondragstart",
"ondrop",
"ondurationchange",
"onemptied",
"onended",
"onerror",
"onfocus",
"onformdata",
"onhashchange",
"oninput",
"oninvalid",
"onkeydown",
"onkeypress",
"onkeyup",
"onlanguagechange",
"onload",
"onloadeddata",
"onloadedmetadata",
"onloadstart",
"onmessage",
"onmessageerror",
"onmousedown",
"onmouseenter",
"onmouseleave",
"onmousemove",
"onmouseout",
"onmouseover",
"onmouseup",
"onoffline",
"ononline",
"onpagehide",
"onpageshow",
"onpaste",
"onpause",
"onplay",
"onplaying",
"onpopstate",
"onprogress",
"onratechange",
"onreset",
"onresize",
"onrejectionhandled",
"onscroll",
"onscrollend",
"onsecuritypolicyviolation",
"onseeked",
"onseeking",
"onselect",
"onslotchange",
"onstalled",
"onstorage",
"onsubmit",
"onsuspend",
"ontimeupdate",
"ontoggle",
"onunhandledrejection",
"onunload",
"onvolumechange",
"onwaiting",
"onwheel"
],
disallowedTagsMode: "discard",
allowedAttributes: {
a: ["href", "name", "target"],
// We don't currently allow img itself by default, but
// these attributes would make sense if we did.
img: ["src", "srcset", "alt", "title", "width", "height", "loading"]
},
// Lots of these won't come up by default because we don't allow them
selfClosing: ["img", "br", "hr", "area", "base", "basefont", "input", "link", "meta"],
// URL schemes we permit
allowedSchemes: ["http", "https", "ftp", "mailto", "tel"],
allowedSchemesByTag: {},
allowedSchemesAppliedToAttributes: ["href", "src", "cite"],
allowProtocolRelative: !0,
enforceHtmlBoundary: !1,
parseStyleAttributes: !0
};
nu.simpleTransform = function(t, e, n) {
return n = n === void 0 ? !0 : n, e = e || {}, function(r, i) {
let o;
if (n)
for (o in e)
i[o] = e[o];
else
i = e;
return {
tagName: t,
attribs: i
};
};
};
const xN = /* @__PURE__ */ Ui(yN);
function en(t) {
this.content = t;
}
en.prototype = {
constructor: en,
find: function(t) {
for (var e = 0; e < this.content.length; e += 2)
if (this.content[e] === t)
return e;
return -1;
},
// :: (string) → ?any
// Retrieve the value stored under `key`, or return undefined when
// no such key exists.
get: function(t) {
var e = this.find(t);
return e == -1 ? void 0 : this.content[e + 1];
},
// :: (string, any, ?string) → OrderedMap
// Create a new map by replacing the value of `key` with a new
// value, or adding a binding to the end of the map. If `newKey` is
// given, the key of the binding will be replaced with that key.
update: function(t, e, n) {
var r = n && n != t ? this.remove(n) : this, i = r.find(t), o = r.content.slice();
return i == -1 ? o.push(n || t, e) : (o[i + 1] = e, n && (o[i] = n)), new en(o);
},
// :: (string) → OrderedMap
// Return a map with the given key removed, if it existed.
remove: function(t) {
var e = this.find(t);
if (e == -1)
return this;
var n = this.content.slice();
return n.splice(e, 2), new en(n);
},
// :: (string, any) → OrderedMap
// Add a new key to the start of the map.
addToStart: function(t, e) {
return new en([t, e].concat(this.remove(t).content));
},
// :: (string, any) → OrderedMap
// Add a new key to the end of the map.
addToEnd: function(t, e) {
var n = this.remove(t).content.slice();
return n.push(t, e), new en(n);
},
// :: (string, string, any) → OrderedMap
// Add a key after the given key. If `place` is not found, the new
// key is added to the end.
addBefore: function(t, e, n) {
var r = this.remove(e), i = r.content.slice(), o = r.find(t);
return i.splice(o == -1 ? i.length : o, 0, e, n), new en(i);
},
// :: ((key: string, value: any))
// Call the given function for each key/value pair in the map, in
// order.
forEach: function(t) {
for (var e = 0; e < this.content.length; e += 2)
t(this.content[e], this.content[e + 1]);
},
// :: (union<Object, OrderedMap>) → OrderedMap
// Create a new map by prepending the keys in this map that don't
// appear in `map` before the keys in `map`.
prepend: function(t) {
return t = en.from(t), t.size ? new en(t.content.concat(this.subtract(t).content)) : this;
},
// :: (union<Object, OrderedMap>) → OrderedMap
// Create a new map by appending the keys in this map that don't
// appear in `map` after the keys in `map`.
append: function(t) {
return t = en.from(t), t.size ? new en(this.subtract(t).content.concat(t.content)) : this;
},
// :: (union<Object, OrderedMap>) → OrderedMap
// Create a map containing all the keys in this map that don't
// appear in `map`.
subtract: function(t) {
var e = this;
t = en.from(t);
for (var n = 0; n < t.content.length; n += 2)
e = e.remove(t.content[n]);
return e;
},
// :: () → Object
// Turn ordered map into a plain object.
toObject: function() {
var t = {};
return this.forEach(function(e, n) {
t[e] = n;
}), t;
},
// :: number
// The amount of keys in this map.
get size() {
return this.content.length >> 1;
}
};
en.from = function(t) {
if (t instanceof en)
return t;
var e = [];
if (t)
for (var n in t)
e.push(n, t[n]);
return new en(e);
};
function O3(t, e, n) {
for (let r = 0; ; r++) {
if (r == t.childCount || r == e.childCount)
return t.childCount == e.childCount ? null : n;
let i = t.child(r), o = e.child(r);
if (i == o) {
n += i.nodeSize;
continue;
}
if (!i.sameMarkup(o))
return n;
if (i.isText && i.text != o.text) {
for (let a = 0; i.text[a] == o.text[a]; a++)
n++;
return n;
}
if (i.content.size || o.content.size) {
let a = O3(i.content, o.content, n + 1);
if (a != null)
return a;
}
n += i.nodeSize;
}
}
function A3(t, e, n, r) {
for (let i = t.childCount, o = e.childCount; ; ) {
if (i == 0 || o == 0)
return i == o ? null : { a: n, b: r };
let a = t.child(--i), s = e.child(--o), u = a.nodeSize;
if (a == s) {
n -= u, r -= u;
continue;
}
if (!a.sameMarkup(s))
return { a: n, b: r };
if (a.isText && a.text != s.text) {
let l = 0, c = Math.min(a.text.length, s.text.length);
for (; l < c && a.text[a.text.length - l - 1] == s.text[s.text.length - l - 1]; )
l++, n--, r--;
return { a: n, b: r };
}
if (a.content.size || s.content.size) {
let l = A3(a.content, s.content, n - 1, r - 1);
if (l)
return l;
}
n -= u, r -= u;
}
}
class me {
/**
@internal
*/
constructor(e, n) {
if (this.content = e, this.size = n || 0, n == null)
for (let r = 0; r < e.length; r++)
this.size += e[r].nodeSize;
}
/**
Invoke a callback for all descendant nodes between the given two
positions (relative to start of this fragment). Doesn't descend
into a node when the callback returns `false`.
*/
nodesBetween(e, n, r, i = 0, o) {
for (let a = 0, s = 0; s < n; a++) {
let u = this.content[a], l = s + u.nodeSize;
if (l > e && r(u, i + s, o || null, a) !== !1 && u.content.size) {
let c = s + 1;
u.nodesBetween(Math.max(0, e - c), Math.min(u.content.size, n - c), r, i + c);
}
s = l;
}
}
/**
Call the given callback for every descendant node. `pos` will be
relative to the start of the fragment. The callback may return
`false` to prevent traversal of a given node's children.
*/
descendants(e) {
this.nodesBetween(0, this.size, e);
}
/**
Extract the text between `from` and `to`. See the same method on
[`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).
*/
textBetween(e, n, r, i) {
let o = "", a = !0;
return this.nodesBetween(e, n, (s, u) => {
s.isText ? (o += s.text.slice(Math.max(e, u) - u, n - u), a = !r) : s.isLeaf ? (i ? o += typeof i == "function" ? i(s) : i : s.type.spec.leafText && (o += s.type.spec.leafText(s)), a = !r) : !a && s.isBlock && (o += r, a = !0);
}, 0), o;
}
/**
Create a new fragment containing the combined content of this
fragment and the other.
*/
append(e) {
if (!e.size)
return this;
if (!this.size)
return e;
let n = this.lastChild, r = e.firstChild, i = this.content.slice(), o = 0;
for (n.isText && n.sameMarkup(r) && (i[i.length - 1] = n.withText(n.text + r.text), o = 1); o < e.content.length; o++)
i.push(e.content[o]);
return new me(i, this.size + e.size);
}
/**
Cut out the sub-fragment between the two given positions.
*/
cut(e, n = this.size) {
if (e == 0 && n == this.size)
return this;
let r = [], i = 0;
if (n > e)
for (let o = 0, a = 0; a < n; o++) {
let s = this.content[o], u = a + s.nodeSize;
u > e && ((a < e || u > n) && (s.isText ? s = s.cut(Math.max(0, e - a), Math.min(s.text.length, n - a)) : s = s.cut(Math.max(0, e - a - 1), Math.min(s.content.size, n - a - 1))), r.push(s), i += s.nodeSize), a = u;
}
return new me(r, i);
}
/**
@internal
*/
cutByIndex(e, n) {
return e == n ? me.empty : e == 0 && n == this.content.length ? this : new me(this.content.slice(e, n));
}
/**
Create a new fragment in which the node at the given index is
replaced by the given node.
*/
replaceChild(e, n) {
let r = this.content[e];
if (r == n)
return this;
let i = this.content.slice(), o = this.size + n.nodeSize - r.nodeSize;
return i[e] = n, new me(i, o);
}
/**
Create a new fragment by prepending the given node to this
fragment.
*/
addToStart(e) {
return new me([e].concat(this.content), this.size + e.nodeSize);
}
/**
Create a new fragment by appending the given node to this
fragment.
*/
addToEnd(e) {
return new me(this.content.concat(e), this.size + e.nodeSize);
}
/**
Compare this fragment to another one.
*/
eq(e) {
if (this.content.length != e.content.length)
return !1;
for (let n = 0; n < this.content.length; n++)
if (!this.content[n].eq(e.content[n]))
return !1;
return !0;
}
/**
The first child of the fragment, or `null` if it is empty.
*/
get firstChild() {
return this.content.length ? this.content[0] : null;
}
/**
The last child of the fragment, or `null` if it is empty.
*/
get lastChild() {
return this.content.length ? this.content[this.content.length - 1] : null;
}
/**
The number of child nodes in this fragment.
*/
get childCount() {
return this.content.length;
}
/**
Get the child node at the given index. Raise an error when the
index is out of range.
*/
child(e) {
let n = this.content[e];
if (!n)
throw new RangeError("Index " + e + " out of range for " + this);
return n;
}
/**
Get the child node at the given index, if it exists.
*/
maybeChild(e) {
return this.content[e] || null;
}
/**
Call `f` for every child node, passing the node, its offset
into this parent node, and its index.
*/
forEach(e) {
for (let n = 0, r = 0; n < this.content.length; n++) {
let i = this.content[n];
e(i, r, n), r += i.nodeSize;
}
}
/**
Find the first position at which this fragment and another
fragment differ, or `null` if they are the same.
*/
findDiffStart(e, n = 0) {
return O3(this, e, n);
}
/**
Find the first position, searching from the end, at which this
fragment and the given fragment differ, or `null` if they are
the same. Since this position will not be the same in both
nodes, an object with two separate positions is returned.
*/
findDiffEnd(e, n = this.size, r = e.size) {
return A3(this, e, n, r);
}
/**
Find the index and inner offset corresponding to a given relative
position in this fragment. The result object will be reused
(overwritten) the next time the function is called. (Not public.)
*/
findIndex(e, n = -1) {
if (e == 0)
return Uu(0, e);
if (e == this.size)
return Uu(this.content.length, e);
if (e > this.size || e < 0)
throw new RangeError(`Position ${e} outside of fragment (${this})`);
for (let r = 0, i = 0; ; r++) {
let o = this.child(r), a = i + o.nodeSize;
if (a >= e)
return a == e || n > 0 ? Uu(r + 1, a) : Uu(r, i);
i = a;
}
}
/**
Return a debugging string that describes this fragment.
*/
toString() {
return "<" + this.toStringInner() + ">";
}
/**
@internal
*/
toStringInner() {
return this.content.join(", ");
}
/**
Create a JSON-serializeable representation of this fragment.
*/
toJSON() {
return this.content.length ? this.content.map((e) => e.toJSON()) : null;
}
/**
Deserialize a fragment from its JSON representation.
*/
static fromJSON(e, n) {
if (!n)
return me.empty;
if (!Array.isArray(n))
throw new RangeError("Invalid input for Fragment.fromJSON");
return new me(n.map(e.nodeFromJSON));
}
/**
Build a fragment from an array of nodes. Ensures that adjacent
text nodes with the same marks are joined together.
*/
static fromArray(e) {
if (!e.length)
return me.empty;
let n, r = 0;
for (let i = 0; i < e.length; i++) {
let o = e[i];
r += o.nodeSize, i && o.isText && e[i - 1].sameMarkup(o) ? (n || (n = e.slice(0, i)), n[n.length - 1] = o.withText(n[n.length - 1].text + o.text)) : n && n.push(o);
}
return new me(n || e, r);
}
/**
Create a fragment from something that can be interpreted as a
set of nodes. For `null`, it returns the empty fragment. For a
fragment, the fragment itself. For a node or array of nodes, a
fragment containing those nodes.
*/
static from(e) {
if (!e)
return me.empty;
if (e instanceof me)
return e;
if (Array.isArray(e))
return this.fromArray(e);
if (e.attrs)
return new me([e], e.nodeSize);
throw new RangeError("Can not convert " + e + " to a Fragment" + (e.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
}
}
me.empty = new me([], 0);
const of = { index: 0, offset: 0 };
function Uu(t, e) {
return of.index = t, of.offset = e, of;
}
function Xl(t, e) {
if (t === e)
return !0;
if (!(t && typeof t == "object") || !(e && typeof e == "object"))
return !1;
let n = Array.isArray(t);
if (Array.isArray(e) != n)
return !1;
if (n) {
if (t.length != e.length)
return !1;
for (let r = 0; r < t.length; r++)
if (!Xl(t[r], e[r]))
return !1;
} else {
for (let r in t)
if (!(r in e) || !Xl(t[r], e[r]))
return !1;
for (let r in e)
if (!(r in t))
return !1;
}
return !0;
}
let kt = class A0 {
/**
@internal
*/
constructor(e, n) {
this.type = e, this.attrs = n;
}
/**
Given a set of marks, create a new set which contains this one as
well, in the right position. If this mark is already in the set,
the set itself is returned. If any marks that are set to be
[exclusive](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) with this mark are present,
those are replaced by this one.
*/
addToSet(e) {
let n, r = !1;
for (let i = 0; i < e.length; i++) {
let o = e[i];
if (this.eq(o))
return e;
if (this.type.excludes(o.type))
n || (n = e.slice(0, i));
else {
if (o.type.excludes(this.type))
return e;
!r && o.type.rank > this.type.rank && (n || (n = e.slice(0, i)), n.push(this), r = !0), n && n.push(o);
}
}
return n || (n = e.slice()), r || n.push(this), n;
}
/**
Remove this mark from the given set, returning a new set. If this
mark is not in the set, the set itself is returned.
*/
removeFromSet(e) {
for (let n = 0; n < e.length; n++)
if (this.eq(e[n]))
return e.slice(0, n).concat(e.slice(n + 1));
return e;
}
/**
Test whether this mark is in the given set of marks.
*/
isInSet(e) {
for (let n = 0; n < e.length; n++)
if (this.eq(e[n]))
return !0;
return !1;
}
/**
Test whether this mark has the same type and attributes as
another mark.
*/
eq(e) {
return this == e || this.type == e.type && Xl(this.attrs, e.attrs);
}
/**
Convert this mark to a JSON-serializeable representation.
*/
toJSON() {
let e = { type: this.type.name };
for (let n in this.attrs) {
e.attrs = this.attrs;
break;
}
return e;
}
/**
Deserialize a mark from JSON.
*/
static fromJSON(e, n) {
if (!n)
throw new RangeError("Invalid input for Mark.fromJSON");
let r = e.marks[n.type];
if (!r)
throw new RangeError(`There is no mark type ${n.type} in this schema`);
return r.create(n.attrs);
}
/**
Test whether two sets of marks are identical.
*/
static sameSet(e, n) {
if (e == n)
return !0;
if (e.length != n.length)
return !1;
for (let r = 0; r < e.length; r++)
if (!e[r].eq(n[r]))
return !1;
return !0;
}
/**
Create a properly sorted mark set from null, a single mark, or an
unsorted array of marks.
*/
static setFrom(e) {
if (!e || Array.isArray(e) && e.length == 0)
return A0.none;
if (e instanceof A0)
return [e];
let n = e.slice();
return n.sort((r, i) => r.type.rank - i.type.rank), n;
}
};
kt.none = [];
class Ql extends Error {
}
class Te {
/**
Create a slice. When specifying a non-zero open depth, you must
make sure that there are nodes of at least that depth at the
appropriate side of the fragment—i.e. if the fragment is an
empty paragraph node, `openStart` and `openEnd` can't be greater
than 1.
It is not necessary for the content of open nodes to conform to
the schema's content constraints, though it should be a valid
start/end/middle for such a node, depending on which sides are
open.
*/
constructor(e, n, r) {
this.content = e, this.openStart = n, this.openEnd = r;
}
/**
The size this slice would add when inserted into a document.
*/
get size() {
return this.content.size - this.openStart - this.openEnd;
}
/**
@internal
*/
insertAt(e, n) {
let r = D3(this.content, e + this.openStart, n);
return r && new Te(r, this.openStart, this.openEnd);
}
/**
@internal
*/
removeBetween(e, n) {
return new Te(M3(this.content, e + this.openStart, n + this.openStart), this.openStart, this.openEnd);
}
/**
Tests whether this slice is equal to another slice.
*/
eq(e) {
return this.content.eq(e.content) && this.openStart == e.openStart && this.openEnd == e.openEnd;
}
/**
@internal
*/
toString() {
return this.content + "(" + this.openStart + "," + this.openEnd + ")";
}
/**
Convert a slice to a JSON-serializable representation.
*/
toJSON() {
if (!this.content.size)
return null;
let e = { content: this.content.toJSON() };
return this.openStart > 0 && (e.openStart = this.openStart), this.openEnd > 0 && (e.openEnd = this.openEnd), e;
}
/**
Deserialize a slice from its JSON representation.
*/
static fromJSON(e, n) {
if (!n)
return Te.empty;
let r = n.openStart || 0, i = n.openEnd || 0;
if (typeof r != "number" || typeof i != "number")
throw new RangeError("Invalid input for Slice.fromJSON");
return new Te(me.fromJSON(e, n.content), r, i);
}
/**
Create a slice from a fragment by taking the maximum possible
open value on both side of the fragment.
*/
static maxOpen(e, n = !0) {
let r = 0, i = 0;
for (let o = e.firstChild; o && !o.isLeaf && (n || !o.type.spec.isolating); o = o.firstChild)
r++;
for (let o = e.lastChild; o && !o.isLeaf && (n || !o.type.spec.isolating); o = o.lastChild)
i++;
return new Te(e, r, i);
}
}
Te.empty = new Te(me.empty, 0, 0);
function M3(t, e, n) {
let { index: r, offset: i } = t.findIndex(e), o = t.maybeChild(r), { index: a, offset: s } = t.findIndex(n);
if (i == e || o.isText) {
if (s != n && !t.child(a).isText)
throw new RangeError("Removing non-flat range");
return t.cut(0, e).append(t.cut(n));
}
if (r != a)
throw new RangeError("Removing non-flat range");
return t.replaceChild(r, o.copy(M3(o.content, e - i - 1, n - i - 1)));
}
function D3(t, e, n, r) {
let { index: i, offset: o } = t.findIndex(e), a = t.maybeChild(i);
if (o == e || a.isText)
return r && !r.canReplace(i, i, n) ? null : t.cut(0, e).append(n).append(t.cut(e));
let s = D3(a.content, e - o - 1, n);
return s && t.replaceChild(i, a.copy(s));
}
function SN(t, e, n) {
if (n.openStart > t.depth)
throw new Ql("Inserted content deeper than insertion position");
if (t.depth - n.openStart != e.depth - n.openEnd)
throw new Ql("Inconsistent open depths");
return $3(t, e, n, 0);
}
function $3(t, e, n, r) {
let i = t.index(r), o = t.node(r);
if (i == e.index(r) && r < t.depth - n.openStart) {
let a = $3(t, e, n, r + 1);
return o.copy(o.content.replaceChild(i, a));
} else if (n.content.size)
if (!n.openStart && !n.openEnd && t.depth == r && e.depth == r) {
let a = t.parent, s = a.content;
return Do(a, s.cut(0, t.parentOffset).append(n.content).append(s.cut(e.parentOffset)));
} else {
let { start: a, end: s } = EN(n, t);
return Do(o, P3(t, a, s, e, r));
}
else
return Do(o, Zl(t, e, r));
}
function N3(t, e) {
if (!e.type.compatibleContent(t.type))
throw new Ql("Cannot join " + e.type.name + " onto " + t.type.name);
}
function M0(t, e, n) {
let r = t.node(n);
return N3(r, e.node(n)), r;
}
function Mo(t, e) {
let n = e.length - 1;
n >= 0 && t.isText && t.sameMarkup(e[n]) ? e[n] = t.withText(e[n].text + t.text) : e.push(t);
}
function Ms(t, e, n, r) {
let i = (e || t).node(n), o = 0, a = e ? e.index(n) : i.childCount;
t && (o = t.index(n), t.depth > n ? o++ : t.textOffset && (Mo(t.nodeAfter, r), o++));
for (let s = o; s < a; s++)
Mo(i.child(s), r);
e && e.depth == n && e.textOffset && Mo(e.nodeBefore, r);
}
function Do(t, e) {
return t.type.checkContent(e), t.copy(e);
}
function P3(t, e, n, r, i) {
let o = t.depth > i && M0(t, e, i + 1), a = r.depth > i && M0(n, r, i + 1), s = [];
return Ms(null, t, i, s), o && a && e.index(i) == n.index(i) ? (N3(o, a), Mo(Do(o, P3(t, e, n, r, i + 1)), s)) : (o && Mo(Do(o, Zl(t, e, i + 1)), s), Ms(e, n, i, s), a && Mo(Do(a, Zl(n, r, i + 1)), s)), Ms(r, null, i, s), new me(s);
}
function Zl(t, e, n) {
let r = [];
if (Ms(null, t, n, r), t.depth > n) {
let i = M0(t, e, n + 1);
Mo(Do(i, Zl(t, e, n + 1)), r);
}
return Ms(e, null, n, r), new me(r);
}
function EN(t, e) {
let n = e.depth - t.openStart, i = e.node(n).copy(t.content);
for (let o = n - 1; o >= 0; o--)
i = e.node(o).copy(me.from(i));
return {
start: i.resolveNoCache(t.openStart + n),
end: i.resolveNoCache(i.content.size - t.openEnd - n)
};
}
class ru {
/**
@internal
*/
constructor(e, n, r) {
this.pos = e, this.path = n, this.parentOffset = r, this.depth = n.length / 3 - 1;
}
/**
@internal
*/
resolveDepth(e) {
return e == null ? this.depth : e < 0 ? this.depth + e : e;
}
/**
The parent node that the position points into. Note that even if
a position points into a text node, that node is not considered
the parent—text nodes are ‘flat’ in this model, and have no content.
*/
get parent() {
return this.node(this.depth);
}
/**
The root node in which the position was resolved.
*/
get doc() {
return this.node(0);
}
/**
The ancestor node at the given level. `p.node(p.depth)` is the
same as `p.parent`.
*/
node(e) {
return this.path[this.resolveDepth(e) * 3];
}
/**
The index into the ancestor at the given level. If this points
at the 3rd node in the 2nd paragraph on the top level, for
example, `p.index(0)` is 1 and `p.index(1)` is 2.
*/
index(e) {
return this.path[this.resolveDepth(e) * 3 + 1];
}
/**
The index pointing after this position into the ancestor at the
given level.
*/
indexAfter(e) {
return e = this.resolveDepth(e), this.index(e) + (e == this.depth && !this.textOffset ? 0 : 1);
}
/**
The (absolute) position at the start of the node at the given
level.
*/
start(e) {
return e = this.resolveDepth(e), e == 0 ? 0 : this.path[e * 3 - 1] + 1;
}
/**
The (absolute) position at the end of the node at the given
level.
*/
end(e) {
return e = this.resolveDepth(e), this.start(e) + this.node(e).content.size;
}
/**
The (absolute) position directly before the wrapping node at the
given level, or, when `depth` is `this.depth + 1`, the original
position.
*/
before(e) {
if (e = this.resolveDepth(e), !e)
throw new RangeError("There is no position before the top-level node");
return e == this.depth + 1 ? this.pos : this.path[e * 3 - 1];
}
/**
The (absolute) position directly after the wrapping node at the
given level, or the original position when `depth` is `this.depth + 1`.
*/
after(e) {
if (e = this.resolveDepth(e), !e)
throw new RangeError("There is no position after the top-level node");
return e == this.depth + 1 ? this.pos : this.path[e * 3 - 1] + this.path[e * 3].nodeSize;
}
/**
When this position points into a text node, this returns the
distance between the position and the start of the text node.
Will be zero for positions that point between nodes.
*/
get textOffset() {
return this.pos - this.path[this.path.length - 1];
}
/**
Get the node directly after the position, if any. If the position
points into a text node, only the part of that node after the
position is returned.
*/
get nodeAfter() {
let e = this.parent, n = this.index(this.depth);
if (n == e.childCount)
return null;
let r = this.pos - this.path[this.path.length - 1], i = e.child(n);
return r ? e.child(n).cut(r) : i;
}
/**
Get the node directly before the position, if any. If the
position points into a text node, only the part of that node
before the position is returned.
*/
get nodeBefore() {
let e = this.index(this.depth), n = this.pos - this.path[this.path.length - 1];
return n ? this.parent.child(e).cut(0, n) : e == 0 ? null : this.parent.child(e - 1);
}
/**
Get the position at the given index in the parent node at the
given depth (which defaults to `this.depth`).
*/
posAtIndex(e, n) {
n = this.resolveDepth(n);
let r = this.path[n * 3], i = n == 0 ? 0 : this.path[n * 3 - 1] + 1;
for (let o = 0; o < e; o++)
i += r.child(o).nodeSize;
return i;
}
/**
Get the marks at this position, factoring in the surrounding
marks' [`inclusive`](https://prosemirror.net/docs/ref/#model.MarkSpec.inclusive) property. If the
position is at the start of a non-empty node, the marks of the
node after it (if any) are returned.
*/
marks() {
let e = this.parent, n = this.index();
if (e.content.size == 0)
return kt.none;
if (this.textOffset)
return e.child(n).marks;
let r = e.maybeChild(n - 1), i = e.maybeChild(n);
if (!r) {
let s = r;
r = i, i = s;
}
let o = r.marks;
for (var a = 0; a < o.length; a++)
o[a].type.spec.inclusive === !1 && (!i || !o[a].isInSet(i.marks)) && (o = o[a--].removeFromSet(o));
return o;
}
/**
Get the marks after the current position, if any, except those
that are non-inclusive and not present at position `$end`. This
is mostly useful for getting the set of marks to preserve after a
deletion. Will return `null` if this position is at the end of
its parent node or its parent node isn't a textblock (in which
case no marks should be preserved).
*/
marksAcross(e) {
let n = this.parent.maybeChild(this.index());
if (!n || !n.isInline)
return null;
let r = n.marks, i = e.parent.maybeChild(e.index());
for (var o = 0; o < r.length; o++)
r[o].type.spec.inclusive === !1 && (!i || !r[o].isInSet(i.marks)) && (r = r[o--].removeFromSet(r));
return r;
}
/**
The depth up to which this position and the given (non-resolved)
position share the same parent nodes.
*/
sharedDepth(e) {
for (let n = this.depth; n > 0; n--)
if (this.start(n) <= e && this.end(n) >= e)
return n;
return 0;
}
/**
Returns a range based on the place where this position and the
given position diverge around block content. If both point into
the same textblock, for example, a range around that textblock
will be returned. If they point into different blocks, the range
around those blocks in their shared ancestor is returned. You can
pass in an optional predicate that will be called with a parent
node to see if a range into that parent is acceptable.
*/
blockRange(e = this, n) {
if (e.pos < this.pos)
return e.blockRange(this);
for (let r = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); r >= 0; r--)
if (e.pos <= this.end(r) && (!n || n(this.node(r))))
return new ec(this, e, r);
return null;
}
/**
Query whether the given position shares the same parent node.
*/
sameParent(e) {
return this.pos - this.parentOffset == e.pos - e.parentOffset;
}
/**
Return the greater of this and the given position.
*/
max(e) {
return e.pos > this.pos ? e : this;
}
/**
Return the smaller of this and the given position.
*/
min(e) {
return e.pos < this.pos ? e : this;
}
/**
@internal
*/
toString() {
let e = "";
for (let n = 1; n <= this.depth; n++)
e += (e ? "/" : "") + this.node(n).type.name + "_" + this.index(n - 1);
return e + ":" + this.parentOffset;
}
/**
@internal
*/
static resolve(e, n) {
if (!(n >= 0 && n <= e.content.size))
throw new RangeError("Position " + n + " out of range");
let r = [], i = 0, o = n;
for (let a = e; ; ) {
let { index: s, offset: u } = a.content.findIndex(o), l = o - u;
if (r.push(a, s, i + u), !l || (a = a.child(s), a.isText))
break;
o = l - 1, i += u + 1;
}
return new ru(n, r, o);
}
/**
@internal
*/
static resolveCached(e, n) {
for (let i = 0; i < af.length; i++) {
let o = af[i];
if (o.pos == n && o.doc == e)
return o;
}
let r = af[sf] = ru.resolve(e, n);
return sf = (sf + 1) % _N, r;
}
}
let af = [], sf = 0, _N = 12;
class ec {
/**
Construct a node range. `$from` and `$to` should point into the
same node until at least the given `depth`, since a node range
denotes an adjacent set of nodes in a single parent node.
*/
constructor(e, n, r) {
this.$from = e, this.$to = n, this.depth = r;
}
/**
The position at the start of the range.
*/
get start() {
return this.$from.before(this.depth + 1);
}
/**
The position at the end of the range.
*/
get end() {
return this.$to.after(this.depth + 1);
}
/**
The parent node that the range points into.
*/
get parent() {
return this.$from.node(this.depth);
}
/**
The start index of the range in the parent node.
*/
get startIndex() {
return this.$from.index(this.depth);
}
/**
The end index of the range in the parent node.
*/
get endIndex() {
return this.$to.indexAfter(this.depth);
}
}
const TN = /* @__PURE__ */ Object.create(null);
let $o = class D0 {
/**
@internal
*/
constructor(e, n, r, i = kt.none) {
this.type = e, this.attrs = n, this.marks = i, this.content = r || me.empty;
}
/**
The size of this node, as defined by the integer-based [indexing
scheme](/docs/guide/#doc.indexing). For text nodes, this is the
amount of characters. For other leaf nodes, it is one. For
non-leaf nodes, it is the size of the content plus two (the
start and end token).
*/
get nodeSize() {
return this.isLeaf ? 1 : 2 + this.content.size;
}
/**
The number of children that the node has.
*/
get childCount() {
return this.content.childCount;
}
/**
Get the child node at the given index. Raises an error when the
index is out of range.
*/
child(e) {
return this.content.child(e);
}
/**
Get the child node at the given index, if it exists.
*/
maybeChild(e) {
return this.content.maybeChild(e);
}
/**
Call `f` for every child node, passing the node, its offset
into this parent node, and its index.
*/
forEach(e) {
this.content.forEach(e);
}
/**
Invoke a callback for all descendant nodes recursively between
the given two positions that are relative to start of this
node's content. The callback is invoked with the node, its
position relative to the original node (method receiver),
its parent node, and its child index. When the callback returns
false for a given node, that node's children will not be
recursed over. The last parameter can be used to specify a
starting position to count from.
*/
nodesBetween(e, n, r, i = 0) {
this.content.nodesBetween(e, n, r, i, this);
}
/**
Call the given callback for every descendant node. Doesn't
descend into a node when the callback returns `false`.
*/
descendants(e) {
this.nodesBetween(0, this.content.size, e);
}
/**
Concatenates all the text nodes found in this fragment and its
children.
*/
get textContent() {
return this.isLeaf && this.type.spec.leafText ? this.type.spec.leafText(this) : this.textBetween(0, this.content.size, "");
}
/**
Get all text between positions `from` and `to`. When
`blockSeparator` is given, it will be inserted to separate text
from different block nodes. If `leafText` is given, it'll be
inserted for every non-text leaf node encountered, otherwise
[`leafText`](https://prosemirror.net/docs/ref/#model.NodeSpec^leafText) will be used.
*/
textBetween(e, n, r, i) {
return this.content.textBetween(e, n, r, i);
}
/**
Returns this node's first child, or `null` if there are no
children.
*/
get firstChild() {
return this.content.firstChild;
}
/**
Returns this node's last child, or `null` if there are no
children.
*/
get lastChild() {
return this.content.lastChild;
}
/**
Test whether two nodes represent the same piece of document.
*/
eq(e) {
return this == e || this.sameMarkup(e) && this.content.eq(e.content);
}
/**
Compare the markup (type, attributes, and marks) of this node to
those of another. Returns `true` if both have the same markup.
*/
sameMarkup(e) {
return this.hasMarkup(e.type, e.attrs, e.marks);
}
/**
Check whether this node's markup correspond to the given type,
attributes, and marks.
*/
hasMarkup(e, n, r) {
return this.type == e && Xl(this.attrs, n || e.defaultAttrs || TN) && kt.sameSet(this.marks, r || kt.none);
}
/**
Create a new node with the same markup as this node, containing
the given content (or empty, if no content is given).
*/
copy(e = null) {
return e == this.content ? this : new D0(this.type, this.attrs, e, this.marks);
}
/**
Create a copy of this node, with the given set of marks instead
of the node's own marks.
*/
mark(e) {
return e == this.marks ? this : new D0(this.type, this.attrs, this.content, e);
}
/**
Create a copy of this node with only the content between the
given positions. If `to` is not given, it defaults to the end of
the node.
*/
cut(e, n = this.content.size) {
return e == 0 && n == this.content.size ? this : this.copy(this.content.cut(e, n));
}
/**
Cut out the part of the document between the given positions, and
return it as a `Slice` object.
*/
slice(e, n = this.content.size, r = !1) {
if (e == n)
return Te.empty;
let i = this.resolve(e), o = this.resolve(n), a = r ? 0 : i.sharedDepth(n), s = i.start(a), l = i.node(a).content.cut(i.pos - s, o.pos - s);
return new Te(l, i.depth - a, o.depth - a);
}
/**
Replace the part of the document between the given positions with
the given slice. The slice must 'fit', meaning its open sides
must be able to connect to the surrounding content, and its
content nodes must be valid children for the node they are placed
into. If any of this is violated, an error of type
[`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
*/
replace(e, n, r) {
return SN(this.resolve(e), this.resolve(n), r);
}
/**
Find the node directly after the given position.
*/
nodeAt(e) {
for (let n = this; ; ) {
let { index: r, offset: i } = n.content.findIndex(e);
if (n = n.maybeChild(r), !n)
return null;
if (i == e || n.isText)
return n;
e -= i + 1;
}
}
/**
Find the (direct) child node after the given offset, if any,
and return it along with its index and offset relative to this
node.
*/
childAfter(e) {
let { index: n, offset: r } = this.content.findIndex(e);
return { node: this.content.maybeChild(n), index: n, offset: r };
}
/**
Find the (direct) child node before the given offset, if any,
and return it along with its index and offset relative to this
node.
*/
childBefore(e) {
if (e == 0)
return { node: null, index: 0, offset: 0 };
let { index: n, offset: r } = this.content.findIndex(e);
if (r < e)
return { node: this.content.child(n), index: n, offset: r };
let i = this.content.child(n - 1);
return { node: i, index: n - 1, offset: r - i.nodeSize };
}
/**
Resolve the given position in the document, returning an
[object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.
*/
resolve(e) {
return ru.resolveCached(this, e);
}
/**
@internal
*/
resolveNoCache(e) {
return ru.resolve(this, e);
}
/**
Test whether a given mark or mark type occurs in this document
between the two given positions.
*/
rangeHasMark(e, n, r) {
let i = !1;
return n > e && this.nodesBetween(e, n, (o) => (r.isInSet(o.marks) && (i = !0), !i)), i;
}
/**
True when this is a block (non-inline node)
*/
get isBlock() {
return this.type.isBlock;
}
/**
True when this is a textblock node, a block node with inline
content.
*/
get isTextblock() {
return this.type.isTextblock;
}
/**
True when this node allows inline content.
*/
get inlineContent() {
return this.type.inlineContent;
}
/**
True when this is an inline node (a text node or a node that can
appear among text).
*/
get isInline() {
return this.type.isInline;
}
/**
True when this is a text node.
*/
get isText() {
return this.type.isText;
}
/**
True when this is a leaf node.
*/
get isLeaf() {
return this.type.isLeaf;
}
/**
True when this is an atom, i.e. when it does not have directly
editable content. This is usually the same as `isLeaf`, but can
be configured with the [`atom` property](https://prosemirror.net/docs/ref/#model.NodeSpec.atom)
on a node's spec (typically used when the node is displayed as
an uneditable [node view](https://prosemirror.net/docs/ref/#view.NodeView)).
*/
get isAtom() {
return this.type.isAtom;
}
/**
Return a string representation of this node for debugging
purposes.
*/
toString() {
if (this.type.spec.toDebugString)
return this.type.spec.toDebugString(this);
let e = this.type.name;
return this.content.size && (e += "(" + this.content.toStringInner() + ")"), I3(this.marks, e);
}
/**
Get the content match in this node at the given index.
*/
contentMatchAt(e) {
let n = this.type.contentMatch.matchFragment(this.content, 0, e);
if (!n)
throw new Error("Called contentMatchAt on a node with invalid content");
return n;
}
/**
Test whether replacing the range between `from` and `to` (by
child index) with the given replacement fragment (which defaults
to the empty fragment) would leave the node's content valid. You
can optionally pass `start` and `end` indices into the
replacement fragment.
*/
canReplace(e, n, r = me.empty, i = 0, o = r.childCount) {
let a = this.contentMatchAt(e).matchFragment(r, i, o), s = a && a.matchFragment(this.content, n);
if (!s || !s.validEnd)
return !1;
for (let u = i; u < o; u++)
if (!this.type.allowsMarks(r.child(u).marks))
return !1;
return !0;
}
/**
Test whether replacing the range `from` to `to` (by index) with
a node of the given type would leave the node's content valid.
*/
canReplaceWith(e, n, r, i) {
if (i && !this.type.allowsMarks(i))
return !1;
let o = this.contentMatchAt(e).matchType(r), a = o && o.matchFragment(this.content, n);
return a ? a.validEnd : !1;
}
/**
Test whether the given node's content could be appended to this
node. If that node is empty, this will only return true if there
is at least one node type that can appear in both nodes (to avoid
merging completely incompatible nodes).
*/
canAppend(e) {
return e.content.size ? this.canReplace(this.childCount, this.childCount, e.content) : this.type.compatibleContent(e.type);
}
/**
Check whether this node and its descendants conform to the
schema, and raise error when they do not.
*/
check() {
this.type.checkContent(this.content);
let e = kt.none;
for (let n = 0; n < this.marks.length; n++)
e = this.marks[n].addToSet(e);
if (!kt.sameSet(e, this.marks))
throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((n) => n.type.name)}`);
this.content.forEach((n) => n.check());
}
/**
Return a JSON-serializeable representation of this node.
*/
toJSON() {
let e = { type: this.type.name };
for (let n in this.attrs) {
e.attrs = this.attrs;
break;
}
return this.content.size && (e.content = this.content.toJSON()), this.marks.length && (e.marks = this.marks.map((n) => n.toJSON())), e;
}
/**
Deserialize a node from its JSON representation.
*/
static fromJSON(e, n) {
if (!n)
throw new RangeError("Invalid input for Node.fromJSON");
let r = null;
if (n.marks) {
if (!Array.isArray(n.marks))
throw new RangeError("Invalid mark data for Node.fromJSON");
r = n.marks.map(e.markFromJSON);
}
if (n.type == "text") {
if (typeof n.text != "string")
throw new RangeError("Invalid text node in JSON");
return e.text(n.text, r);
}
let i = me.fromJSON(e, n.content);
return e.nodeType(n.type).create(n.attrs, i, r);
}
};
$o.prototype.text = void 0;
class tc extends $o {
/**
@internal
*/
constructor(e, n, r, i) {
if (super(e, n, null, i), !r)
throw new RangeError("Empty text nodes are not allowed");
this.text = r;
}
toString() {
return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) : I3(this.marks, JSON.stringify(this.text));
}
get textContent() {
return this.text;
}
textBetween(e, n) {
return this.text.slice(e, n);
}
get nodeSize() {
return this.text.length;
}
mark(e) {
return e == this.marks ? this : new tc(this.type, this.attrs, this.text, e);
}
withText(e) {
return e == this.text ? this : new tc(this.type, this.attrs, e, this.marks);
}
cut(e = 0, n = this.text.length) {
return e == 0 && n == this.text.length ? this : this.withText(this.text.slice(e, n));
}
eq(e) {
return this.sameMarkup(e) && this.text == e.text;
}
toJSON() {
let e = super.toJSON();
return e.text = this.text, e;
}
}
function I3(t, e) {
for (let n = t.length - 1; n >= 0; n--)
e = t[n].type.name + "(" + e + ")";
return e;
}
class Vo {
/**
@internal
*/
constructor(e) {
this.validEnd = e, this.next = [], this.wrapCache = [];
}
/**
@internal
*/
static parse(e, n) {
let r = new CN(e, n);
if (r.next == null)
return Vo.empty;
let i = L3(r);
r.next && r.err("Unexpected trailing text");
let o = PN(NN(i));
return IN(o, r), o;
}
/**
Match a node type, returning a match after that node if
successful.
*/
matchType(e) {
for (let n = 0; n < this.next.length; n++)
if (this.next[n].type == e)
return this.next[n].next;
return null;
}
/**
Try to match a fragment. Returns the resulting match when
successful.
*/
matchFragment(e, n = 0, r = e.childCount) {
let i = this;
for (let o = n; i && o < r; o++)
i = i.matchType(e.child(o).type);
return i;
}
/**
@internal
*/
get inlineContent() {
return this.next.length != 0 && this.next[0].type.isInline;
}
/**
Get the first matching node type at this match position that can
be generated.
*/
get defaultType() {
for (let e = 0; e < this.next.length; e++) {
let { type: n } = this.next[e];
if (!(n.isText || n.hasRequiredAttrs()))
return n;
}
return null;
}
/**
@internal
*/
compatible(e) {
for (let n = 0; n < this.next.length; n++)
for (let r = 0; r < e.next.length; r++)
if (this.next[n].type == e.next[r].type)
return !0;
return !1;
}
/**
Try to match the given fragment, and if that fails, see if it can
be made to match by inserting nodes in front of it. When
successful, return a fragment of inserted nodes (which may be
empty if nothing had to be inserted). When `toEnd` is true, only
return a fragment if the resulting match goes to the end of the
content expression.
*/
fillBefore(e, n = !1, r = 0) {
let i = [this];
function o(a, s) {
let u = a.matchFragment(e, r);
if (u && (!n || u.validEnd))
return me.from(s.map((l) => l.createAndFill()));
for (let l = 0; l < a.next.length; l++) {
let { type: c, next: f } = a.next[l];
if (!(c.isText || c.hasRequiredAttrs()) && i.indexOf(f) == -1) {
i.push(f);
let d = o(f, s.concat(c));
if (d)
return d;
}
}
return null;
}
return o(this, []);
}
/**
Find a set of wrapping node types that would allow a node of the
given type to appear at this position. The result may be empty
(when it fits directly) and will be null when no such wrapping
exists.
*/
findWrapping(e) {
for (let r = 0; r < this.wrapCache.length; r += 2)
if (this.wrapCache[r] == e)
return this.wrapCache[r + 1];
let n = this.computeWrapping(e);
return this.wrapCache.push(e, n), n;
}
/**
@internal
*/
computeWrapping(e) {
let n = /* @__PURE__ */ Object.create(null), r = [{ match: this, type: null, via: null }];
for (; r.length; ) {
let i = r.shift(), o = i.match;
if (o.matchType(e)) {
let a = [];
for (let s = i; s.type; s = s.via)
a.push(s.type);
return a.reverse();
}
for (let a = 0; a < o.next.length; a++) {
let { type: s, next: u } = o.next[a];
!s.isLeaf && !s.hasRequiredAttrs() && !(s.name in n) && (!i.type || u.validEnd) && (r.push({ match: s.contentMatch, type: s, via: i }), n[s.name] = !0);
}
}
return null;
}
/**
The number of outgoing edges this node has in the finite
automaton that describes the content expression.
*/
get edgeCount() {
return this.next.length;
}
/**
Get the _n_th outgoing edge from this node in the finite
automaton that describes the content expression.
*/
edge(e) {
if (e >= this.next.length)
throw new RangeError(`There's no ${e}th edge in this content match`);
return this.next[e];
}
/**
@internal
*/
toString() {
let e = [];
function n(r) {
e.push(r);
for (let i = 0; i < r.next.length; i++)
e.indexOf(r.next[i].next) == -1 && n(r.next[i].next);
}
return n(this), e.map((r, i) => {
let o = i + (r.validEnd ? "*" : " ") + " ";
for (let a = 0; a < r.next.length; a++)
o += (a ? ", " : "") + r.next[a].type.name + "->" + e.indexOf(r.next[a].next);
return o;
}).join(`
`);
}
}
Vo.empty = new Vo(!0);
class CN {
constructor(e, n) {
this.string = e, this.nodeTypes = n, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
}
get next() {
return this.tokens[this.pos];
}
eat(e) {
return this.next == e && (this.pos++ || !0);
}
err(e) {
throw new SyntaxError(e + " (in content expression '" + this.string + "')");
}
}
function L3(t) {
let e = [];
do
e.push(ON(t));
while (t.eat("|"));
return e.length == 1 ? e[0] : { type: "choice", exprs: e };
}
function ON(t) {
let e = [];
do
e.push(AN(t));
while (t.next && t.next != ")" && t.next != "|");
return e.length == 1 ? e[0] : { type: "seq", exprs: e };
}
function AN(t) {
let e = $N(t);
for (; ; )
if (t.eat("+"))
e = { type: "plus", expr: e };
else if (t.eat("*"))
e = { type: "star", expr: e };
else if (t.eat("?"))
e = { type: "opt", expr: e };
else if (t.eat("{"))
e = MN(t, e);
else
break;
return e;
}
function sg(t) {
/\D/.test(t.next) && t.err("Expected number, got '" + t.next + "'");
let e = Number(t.next);
return t.pos++, e;
}
function MN(t, e) {
let n = sg(t), r = n;
return t.eat(",") && (t.next != "}" ? r = sg(t) : r = -1), t.eat("}") || t.err("Unclosed braced range"), { type: "range", min: n, max: r, expr: e };
}
function DN(t, e) {
let n = t.nodeTypes, r = n[e];
if (r)
return [r];
let i = [];
for (let o in n) {
let a = n[o];
a.groups.indexOf(e) > -1 && i.push(a);
}
return i.length == 0 && t.err("No node type or group '" + e + "' found"), i;
}
function $N(t) {
if (t.eat("(")) {
let e = L3(t);
return t.eat(")") || t.err("Missing closing paren"), e;
} else if (/\W/.test(t.next))
t.err("Unexpected token '" + t.next + "'");
else {
let e = DN(t, t.next).map((n) => (t.inline == null ? t.inline = n.isInline : t.inline != n.isInline && t.err("Mixing inline and block content"), { type: "name", value: n }));
return t.pos++, e.length == 1 ? e[0] : { type: "choice", exprs: e };
}
}
function NN(t) {
let e = [[]];
return i(o(t, 0), n()), e;
function n() {
return e.push([]) - 1;
}
function r(a, s, u) {
let l = { term: u, to: s };
return e[a].push(l), l;
}
function i(a, s) {
a.forEach((u) => u.to = s);
}
function o(a, s) {
if (a.type == "choice")
return a.exprs.reduce((u, l) => u.concat(o(l, s)), []);
if (a.type == "seq")
for (let u = 0; ; u++) {
let l = o(a.exprs[u], s);
if (u == a.exprs.length - 1)
return l;
i(l, s = n());
}
else if (a.type == "star") {
let u = n();
return r(s, u), i(o(a.expr, u), u), [r(u)];
} else if (a.type == "plus") {
let u = n();
return i(o(a.expr, s), u), i(o(a.expr, u), u), [r(u)];
} else {
if (a.type == "opt")
return [r(s)].concat(o(a.expr, s));
if (a.type == "range") {
let u = s;
for (let l = 0; l < a.min; l++) {
let c = n();
i(o(a.expr, u), c), u = c;
}
if (a.max == -1)
i(o(a.expr, u), u);
else
for (let l = a.min; l < a.max; l++) {
let c = n();
r(u, c), i(o(a.expr, u), c), u = c;
}
return [r(u)];
} else {
if (a.type == "name")
return [r(s, void 0, a.value)];
throw new Error("Unknown expr type");
}
}
}
}
function R3(t, e) {
return e - t;
}
function ug(t, e) {
let n = [];
return r(e), n.sort(R3);
function r(i) {
let o = t[i];
if (o.length == 1 && !o[0].term)
return r(o[0].to);
n.push(i);
for (let a = 0; a < o.length; a++) {
let { term: s, to: u } = o[a];
!s && n.indexOf(u) == -1 && r(u);
}
}
}
function PN(t) {
let e = /* @__PURE__ */ Object.create(null);
return n(ug(t, 0));
function n(r) {
let i = [];
r.forEach((a) => {
t[a].forEach(({ term: s, to: u }) => {
if (!s)
return;
let l;
for (let c = 0; c < i.length; c++)
i[c][0] == s && (l = i[c][1]);
ug(t, u).forEach((c) => {
l || i.push([s, l = []]), l.indexOf(c) == -1 && l.push(c);
});
});
});
let o = e[r.join(",")] = new Vo(r.indexOf(t.length - 1) > -1);
for (let a = 0; a < i.length; a++) {
let s = i[a][1].sort(R3);
o.next.push({ type: i[a][0], next: e[s.join(",")] || n(s) });
}
return o;
}
}
function IN(t, e) {
for (let n = 0, r = [t]; n < r.length; n++) {
let i = r[n], o = !i.validEnd, a = [];
for (let s = 0; s < i.next.length; s++) {
let { type: u, next: l } = i.next[s];
a.push(u.name), o && !(u.isText || u.hasRequiredAttrs()) && (o = !1), r.indexOf(l) == -1 && r.push(l);
}
o && e.err("Only non-generatable nodes (" + a.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
}
}
function B3(t) {
let e = /* @__PURE__ */ Object.create(null);
for (let n in t) {
let r = t[n];
if (!r.hasDefault)
return null;
e[n] = r.default;
}
return e;
}
function V3(t, e) {
let n = /* @__PURE__ */ Object.create(null);
for (let r in t) {
let i = e && e[r];
if (i === void 0) {
let o = t[r];
if (o.hasDefault)
i = o.default;
else
throw new RangeError("No value supplied for attribute " + r);
}
n[r] = i;
}
return n;
}
function z3(t) {
let e = /* @__PURE__ */ Object.create(null);
if (t)
for (let n in t)
e[n] = new LN(t[n]);
return e;
}
let lg = class H3 {
/**
@internal
*/
constructor(e, n, r) {
this.name = e, this.schema = n, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs = z3(r.attrs), this.defaultAttrs = B3(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(r.inline || e == "text"), this.isText = e == "text";
}
/**
True if this is an inline type.
*/
get isInline() {
return !this.isBlock;
}
/**
True if this is a textblock type, a block that contains inline
content.
*/
get isTextblock() {
return this.isBlock && this.inlineContent;
}
/**
True for node types that allow no content.
*/
get isLeaf() {
return this.contentMatch == Vo.empty;
}
/**
True when this node is an atom, i.e. when it does not have
directly editable content.
*/
get isAtom() {
return this.isLeaf || !!this.spec.atom;
}
/**
The node type's [whitespace](https://prosemirror.net/docs/ref/#model.NodeSpec.whitespace) option.
*/
get whitespace() {
return this.spec.whitespace || (this.spec.code ? "pre" : "normal");
}
/**
Tells you whether this node type has any required attributes.
*/
hasRequiredAttrs() {
for (let e in this.attrs)
if (this.attrs[e].isRequired)
return !0;
return !1;
}
/**
Indicates whether this node allows some of the same content as
the given node type.
*/
compatibleContent(e) {
return this == e || this.contentMatch.compatible(e.contentMatch);
}
/**
@internal
*/
computeAttrs(e) {
return !e && this.defaultAttrs ? this.defaultAttrs : V3(this.attrs, e);
}
/**
Create a `Node` of this type. The given attributes are
checked and defaulted (you can pass `null` to use the type's
defaults entirely, if no required attributes exist). `content`
may be a `Fragment`, a node, an array of nodes, or
`null`. Similarly `marks` may be `null` to default to the empty
set of marks.
*/
create(e = null, n, r) {
if (this.isText)
throw new Error("NodeType.create can't construct text nodes");
return new $o(this, this.computeAttrs(e), me.from(n), kt.setFrom(r));
}
/**
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
against the node type's content restrictions, and throw an error
if it doesn't match.
*/
createChecked(e = null, n, r) {
return n = me.from(n), this.checkContent(n), new $o(this, this.computeAttrs(e), n, kt.setFrom(r));
}
/**
Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
necessary to add nodes to the start or end of the given fragment
to make it fit the node. If no fitting wrapping can be found,
return null. Note that, due to the fact that required nodes can
always be created, this will always succeed if you pass null or
`Fragment.empty` as content.
*/
createAndFill(e = null, n, r) {
if (e = this.computeAttrs(e), n = me.from(n), n.size) {
let a = this.contentMatch.fillBefore(n);
if (!a)
return null;
n = a.append(n);
}
let i = this.contentMatch.matchFragment(n), o = i && i.fillBefore(me.empty, !0);
return o ? new $o(this, e, n.append(o), kt.setFrom(r)) : null;
}
/**
Returns true if the given fragment is valid content for this node
type with the given attributes.
*/
validContent(e) {
let n = this.contentMatch.matchFragment(e);
if (!n || !n.validEnd)
return !1;
for (let r = 0; r < e.childCount; r++)
if (!this.allowsMarks(e.child(r).marks))
return !1;
return !0;
}
/**
Throws a RangeError if the given fragment is not valid content for this
node type.
@internal
*/
checkContent(e) {
if (!this.validContent(e))
throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0, 50)}`);
}
/**
Check whether the given mark type is allowed in this node.
*/
allowsMarkType(e) {
return this.markSet == null || this.markSet.indexOf(e) > -1;
}
/**
Test whether the given set of marks are allowed in this node.
*/
allowsMarks(e) {
if (this.markSet == null)
return !0;
for (let n = 0; n < e.length; n++)
if (!this.allowsMarkType(e[n].type))
return !1;
return !0;
}
/**
Removes the marks that are not allowed in this node from the given set.
*/
allowedMarks(e) {
if (this.markSet == null)
return e;
let n;
for (let r = 0; r < e.length; r++)
this.allowsMarkType(e[r].type) ? n && n.push(e[r]) : n || (n = e.slice(0, r));
return n ? n.length ? n : kt.none : e;
}
/**
@internal
*/
static compile(e, n) {
let r = /* @__PURE__ */ Object.create(null);
e.forEach((o, a) => r[o] = new H3(o, n, a));
let i = n.spec.topNode || "doc";
if (!r[i])
throw new RangeError("Schema is missing its top node type ('" + i + "')");
if (!r.text)
throw new RangeError("Every schema needs a 'text' type");
for (let o in r.text.attrs)
throw new RangeError("The text node type should not have attributes");
return r;
}
};
class LN {
constructor(e) {
this.hasDefault = Object.prototype.hasOwnProperty.call(e, "default"), this.default = e.default;
}
get isRequired() {
return !this.hasDefault;
}
}
class ad {
/**
@internal
*/
constructor(e, n, r, i) {
this.name = e, this.rank = n, this.schema = r, this.spec = i, this.attrs = z3(i.attrs), this.excluded = null;
let o = B3(this.attrs);
this.instance = o ? new kt(this, o) : null;
}
/**
Create a mark of this type. `attrs` may be `null` or an object
containing only some of the mark's attributes. The others, if
they have defaults, will be added.
*/
create(e = null) {
return !e && this.instance ? this.instance : new kt(this, V3(this.attrs, e));
}
/**
@internal
*/
static compile(e, n) {
let r = /* @__PURE__ */ Object.create(null), i = 0;
return e.forEach((o, a) => r[o] = new ad(o, i++, n, a)), r;
}
/**
When there is a mark of this type in the given set, a new set
without it is returned. Otherwise, the input set is returned.
*/
removeFromSet(e) {
for (var n = 0; n < e.length; n++)
e[n].type == this && (e = e.slice(0, n).concat(e.slice(n + 1)), n--);
return e;
}
/**
Tests whether there is a mark of this type in the given set.
*/
isInSet(e) {
for (let n = 0; n < e.length; n++)
if (e[n].type == this)
return e[n];
}
/**
Queries whether a given mark type is
[excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.
*/
excludes(e) {
return this.excluded.indexOf(e) > -1;
}
}
class RN {
/**
Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
*/
constructor(e) {
this.cached = /* @__PURE__ */ Object.create(null);
let n = this.spec = {};
for (let i in e)
n[i] = e[i];
n.nodes = en.from(e.nodes), n.marks = en.from(e.marks || {}), this.nodes = lg.compile(this.spec.nodes, this), this.marks = ad.compile(this.spec.marks, this);
let r = /* @__PURE__ */ Object.create(null);
for (let i in this.nodes) {
if (i in this.marks)
throw new RangeError(i + " can not be both a node and a mark");
let o = this.nodes[i], a = o.spec.content || "", s = o.spec.marks;
o.contentMatch = r[a] || (r[a] = Vo.parse(a, this.nodes)), o.inlineContent = o.contentMatch.inlineContent, o.markSet = s == "_" ? null : s ? cg(this, s.split(" ")) : s == "" || !o.inlineContent ? [] : null;
}
for (let i in this.marks) {
let o = this.marks[i], a = o.spec.excludes;
o.excluded = a == null ? [o] : a == "" ? [] : cg(this, a.split(" "));
}
this.nodeFromJSON = this.nodeFromJSON.bind(this), this.markFromJSON = this.markFromJSON.bind(this), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);
}
/**
Create a node in this schema. The `type` may be a string or a
`NodeType` instance. Attributes will be extended with defaults,
`content` may be a `Fragment`, `null`, a `Node`, or an array of
nodes.
*/
node(e, n = null, r, i) {
if (typeof e == "string")
e = this.nodeType(e);
else if (e instanceof lg) {
if (e.schema != this)
throw new RangeError("Node type from different schema used (" + e.name + ")");
} else
throw new RangeError("Invalid node type: " + e);
return e.createChecked(n, r, i);
}
/**
Create a text node in the schema. Empty text nodes are not
allowed.
*/
text(e, n) {
let r = this.nodes.text;
return new tc(r, r.defaultAttrs, e, kt.setFrom(n));
}
/**
Create a mark with the given type and attributes.
*/
mark(e, n) {
return typeof e == "string" && (e = this.marks[e]), e.create(n);
}
/**
Deserialize a node from its JSON representation. This method is
bound.
*/
nodeFromJSON(e) {
return $o.fromJSON(this, e);
}
/**
Deserialize a mark from its JSON representation. This method is
bound.
*/
markFromJSON(e) {
return kt.fromJSON(this, e);
}
/**
@internal
*/
nodeType(e) {
let n = this.nodes[e];
if (!n)
throw new RangeError("Unknown node type: " + e);
return n;
}
}
function cg(t, e) {
let n = [];
for (let r = 0; r < e.length; r++) {
let i = e[r], o = t.marks[i], a = o;
if (o)
n.push(o);
else
for (let s in t.marks) {
let u = t.marks[s];
(i == "_" || u.spec.group && u.spec.group.split(" ").indexOf(i) > -1) && n.push(a = u);
}
if (!a)
throw new SyntaxError("Unknown mark type: '" + e[r] + "'");
}
return n;
}
class Fa {
/**
Create a parser that targets the given schema, using the given
parsing rules.
*/
constructor(e, n) {
this.schema = e, this.rules = n, this.tags = [], this.styles = [], n.forEach((r) => {
r.tag ? this.tags.push(r) : r.style && this.styles.push(r);
}), this.normalizeLists = !this.tags.some((r) => {
if (!/^(ul|ol)\b/.test(r.tag) || !r.node)
return !1;
let i = e.nodes[r.node];
return i.contentMatch.matchType(i);
});
}
/**
Parse a document from the content of a DOM node.
*/
parse(e, n = {}) {
let r = new fg(this, n, !1);
return r.addAll(e, n.from, n.to), r.finish();
}
/**
Parses the content of the given DOM node, like
[`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of
options. But unlike that method, which produces a whole node,
this one returns a slice that is open at the sides, meaning that
the schema constraints aren't applied to the start of nodes to
the left of the input and the end of nodes at the end.
*/
parseSlice(e, n = {}) {
let r = new fg(this, n, !0);
return r.addAll(e, n.from, n.to), Te.maxOpen(r.finish());
}
/**
@internal
*/
matchTag(e, n, r) {
for (let i = r ? this.tags.indexOf(r) + 1 : 0; i < this.tags.length; i++) {
let o = this.tags[i];
if (zN(e, o.tag) && (o.namespace === void 0 || e.namespaceURI == o.namespace) && (!o.context || n.matchesContext(o.context))) {
if (o.getAttrs) {
let a = o.getAttrs(e);
if (a === !1)
continue;
o.attrs = a || void 0;
}
return o;
}
}
}
/**
@internal
*/
matchStyle(e, n, r, i) {
for (let o = i ? this.styles.indexOf(i) + 1 : 0; o < this.styles.length; o++) {
let a = this.styles[o], s = a.style;
if (!(s.indexOf(e) != 0 || a.context && !r.matchesContext(a.context) || // Test that the style string either precisely matches the prop,
// or has an '=' sign after the prop, followed by the given
// value.
s.length > e.length && (s.charCodeAt(e.length) != 61 || s.slice(e.length + 1) != n))) {
if (a.getAttrs) {
let u = a.getAttrs(n);
if (u === !1)
continue;
a.attrs = u || void 0;
}
return a;
}
}
}
/**
@internal
*/
static schemaRules(e) {
let n = [];
function r(i) {
let o = i.priority == null ? 50 : i.priority, a = 0;
for (; a < n.length; a++) {
let s = n[a];
if ((s.priority == null ? 50 : s.priority) < o)
break;
}
n.splice(a, 0, i);
}
for (let i in e.marks) {
let o = e.marks[i].spec.parseDOM;
o && o.forEach((a) => {
r(a = pg(a)), a.mark || a.ignore || a.clearMark || (a.mark = i);
});
}
for (let i in e.nodes) {
let o = e.nodes[i].spec.parseDOM;
o && o.forEach((a) => {
r(a = pg(a)), a.node || a.ignore || a.mark || (a.node = i);
});
}
return n;
}
/**
Construct a DOM parser using the parsing rules listed in a
schema's [node specs](https://prosemirror.net/docs/ref/#model.NodeSpec.parseDOM), reordered by
[priority](https://prosemirror.net/docs/ref/#model.ParseRule.priority).
*/
static fromSchema(e) {
return e.cached.domParser || (e.cached.domParser = new Fa(e, Fa.schemaRules(e)));
}
}
const q3 = {
address: !0,
article: !0,
aside: !0,
blockquote: !0,
canvas: !0,
dd: !0,
div: !0,
dl: !0,
fieldset: !0,
figcaption: !0,
figure: !0,
footer: !0,
form: !0,
h1: !0,
h2: !0,
h3: !0,
h4: !0,
h5: !0,
h6: !0,
header: !0,
hgroup: !0,
hr: !0,
li: !0,
noscript: !0,
ol: !0,
output: !0,
p: !0,
pre: !0,
section: !0,
table: !0,
tfoot: !0,
ul: !0
}, BN = {
head: !0,
noscript: !0,
object: !0,
script: !0,
style: !0,
title: !0
}, F3 = { ol: !0, ul: !0 }, nc = 1, rc = 2, Ds = 4;
function dg(t, e, n) {
return e != null ? (e ? nc : 0) | (e === "full" ? rc : 0) : t && t.whitespace == "pre" ? nc | rc : n & ~Ds;
}
class Wu {
constructor(e, n, r, i, o, a, s) {
this.type = e, this.attrs = n, this.marks = r, this.pendingMarks = i, this.solid = o, this.options = s, this.content = [], this.activeMarks = kt.none, this.stashMarks = [], this.match = a || (s & Ds ? null : e.contentMatch);
}
findWrapping(e) {
if (!this.match) {
if (!this.type)
return [];
let n = this.type.contentMatch.fillBefore(me.from(e));
if (n)
this.match = this.type.contentMatch.matchFragment(n);
else {
let r = this.type.contentMatch, i;
return (i = r.findWrapping(e.type)) ? (this.match = r, i) : null;
}
}
return this.match.findWrapping(e.type);
}
finish(e) {
if (!(this.options & nc)) {
let r = this.content[this.content.length - 1], i;
if (r && r.isText && (i = /[ \t\r\n\u000c]+$/.exec(r.text))) {
let o = r;
r.text.length == i[0].length ? this.content.pop() : this.content[this.content.length - 1] = o.withText(o.text.slice(0, o.text.length - i[0].length));
}
}
let n = me.from(this.content);
return !e && this.match && (n = n.append(this.match.fillBefore(me.empty, !0))), this.type ? this.type.create(this.attrs, n, this.marks) : n;
}
popFromStashMark(e) {
for (let n = this.stashMarks.length - 1; n >= 0; n--)
if (e.eq(this.stashMarks[n]))
return this.stashMarks.splice(n, 1)[0];
}
applyPending(e) {
for (let n = 0, r = this.pendingMarks; n < r.length; n++) {
let i = r[n];
(this.type ? this.type.allowsMarkType(i.type) : qN(i.type, e)) && !i.isInSet(this.activeMarks) && (this.activeMarks = i.addToSet(this.activeMarks), this.pendingMarks = i.removeFromSet(this.pendingMarks));
}
}
inlineContext(e) {
return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !q3.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
}
}
class fg {
constructor(e, n, r) {
this.parser = e, this.options = n, this.isOpen = r, this.open = 0;
let i = n.topNode, o, a = dg(null, n.preserveWhitespace, 0) | (r ? Ds : 0);
i ? o = new Wu(i.type, i.attrs, kt.none, kt.none, !0, n.topMatch || i.type.contentMatch, a) : r ? o = new Wu(null, null, kt.none, kt.none, !0, null, a) : o = new Wu(e.schema.topNodeType, null, kt.none, kt.none, !0, null, a), this.nodes = [o], this.find = n.findPositions, this.needsBlock = !1;
}
get top() {
return this.nodes[this.open];
}
// Add a DOM node to the content. Text is inserted as text node,
// otherwise, the node is passed to `addElement` or, if it has a
// `style` attribute, `addElementWithStyles`.
addDOM(e) {
e.nodeType == 3 ? this.addTextNode(e) : e.nodeType == 1 && this.addElement(e);
}
withStyleRules(e, n) {
let r = e.getAttribute("style");
if (!r)
return n();
let i = this.readStyles(HN(r));
if (!i)
return;
let [o, a] = i, s = this.top;
for (let u = 0; u < a.length; u++)
this.removePendingMark(a[u], s);
for (let u = 0; u < o.length; u++)
this.addPendingMark(o[u]);
n();
for (let u = 0; u < o.length; u++)
this.removePendingMark(o[u], s);
for (let u = 0; u < a.length; u++)
this.addPendingMark(a[u]);
}
addTextNode(e) {
let n = e.nodeValue, r = this.top;
if (r.options & rc || r.inlineContext(e) || /[^ \t\r\n\u000c]/.test(n)) {
if (r.options & nc)
r.options & rc ? n = n.replace(/\r\n?/g, `
`) : n = n.replace(/\r?\n|\r/g, " ");
else if (n = n.replace(/[ \t\r\n\u000c]+/g, " "), /^[ \t\r\n\u000c]/.test(n) && this.open == this.nodes.length - 1) {
let i = r.content[r.content.length - 1], o = e.previousSibling;
(!i || o && o.nodeName == "BR" || i.isText && /[ \t\r\n\u000c]$/.test(i.text)) && (n = n.slice(1));
}
n && this.insertNode(this.parser.schema.text(n)), this.findInText(e);
} else
this.findInside(e);
}
// Try to find a handler for the given tag and use that to parse. If
// none is found, the element's content nodes are added directly.
addElement(e, n) {
let r = e.nodeName.toLowerCase(), i;
F3.hasOwnProperty(r) && this.parser.normalizeLists && VN(e);
let o = this.options.ruleFromNode && this.options.ruleFromNode(e) || (i = this.parser.matchTag(e, this, n));
if (o ? o.ignore : BN.hasOwnProperty(r))
this.findInside(e), this.ignoreFallback(e);
else if (!o || o.skip || o.closeParent) {
o && o.closeParent ? this.open = Math.max(0, this.open - 1) : o && o.skip.nodeType && (e = o.skip);
let a, s = this.top, u = this.needsBlock;
if (q3.hasOwnProperty(r))
s.content.length && s.content[0].isInline && this.open && (this.open--, s = this.top), a = !0, s.type || (this.needsBlock = !0);
else if (!e.firstChild) {
this.leafFallback(e);
return;
}
o && o.skip ? this.addAll(e) : this.withStyleRules(e, () => this.addAll(e)), a && this.sync(s), this.needsBlock = u;
} else
this.withStyleRules(e, () => {
this.addElementByRule(e, o, o.consuming === !1 ? i : void 0);
});
}
// Called for leaf DOM nodes that would otherwise be ignored
leafFallback(e) {
e.nodeName == "BR" && this.top.type && this.top.type.inlineContent && this.addTextNode(e.ownerDocument.createTextNode(`
`));
}
// Called for ignored nodes
ignoreFallback(e) {
e.nodeName == "BR" && (!this.top.type || !this.top.type.inlineContent) && this.findPlace(this.parser.schema.text("-"));
}
// Run any style parser associated with the node's styles. Either
// return an array of marks, or null to indicate some of the styles
// had a rule with `ignore` set.
readStyles(e) {
let n = kt.none, r = kt.none;
for (let i = 0; i < e.length; i += 2)
for (let o = void 0; ; ) {
let a = this.parser.matchStyle(e[i], e[i + 1], this, o);
if (!a)
break;
if (a.ignore)
return null;
if (a.clearMark ? this.top.pendingMarks.concat(this.top.activeMarks).forEach((s) => {
a.clearMark(s) && (r = s.addToSet(r));
}) : n = this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n), a.consuming === !1)
o = a;
else
break;
}
return [n, r];
}
// Look up a handler for the given node. If none are found, return
// false. Otherwise, apply it, use its return value to drive the way
// the node's content is wrapped, and return true.
addElementByRule(e, n, r) {
let i, o, a;
n.node ? (o = this.parser.schema.nodes[n.node], o.isLeaf ? this.insertNode(o.create(n.attrs)) || this.leafFallback(e) : i = this.enter(o, n.attrs || null, n.preserveWhitespace)) : (a = this.parser.schema.marks[n.mark].create(n.attrs), this.addPendingMark(a));
let s = this.top;
if (o && o.isLeaf)
this.findInside(e);
else if (r)
this.addElement(e, r);
else if (n.getContent)
this.findInside(e), n.getContent(e, this.parser.schema).forEach((u) => this.insertNode(u));
else {
let u = e;
typeof n.contentElement == "string" ? u = e.querySelector(n.contentElement) : typeof n.contentElement == "function" ? u = n.contentElement(e) : n.contentElement && (u = n.contentElement), this.findAround(e, u, !0), this.addAll(u);
}
i && this.sync(s) && this.open--, a && this.removePendingMark(a, s);
}
// Add all child nodes between `startIndex` and `endIndex` (or the
// whole node, if not given). If `sync` is passed, use it to
// synchronize after every block element.
addAll(e, n, r) {
let i = n || 0;
for (let o = n ? e.childNodes[n] : e.firstChild, a = r == null ? null : e.childNodes[r]; o != a; o = o.nextSibling, ++i)
this.findAtPoint(e, i), this.addDOM(o);
this.findAtPoint(e, i);
}
// Try to find a way to fit the given node type into the current
// context. May add intermediate wrappers and/or leave non-solid
// nodes that we're in.
findPlace(e) {
let n, r;
for (let i = this.open; i >= 0; i--) {
let o = this.nodes[i], a = o.findWrapping(e);
if (a && (!n || n.length > a.length) && (n = a, r = o, !a.length) || o.solid)
break;
}
if (!n)
return !1;
this.sync(r);
for (let i = 0; i < n.length; i++)
this.enterInner(n[i], null, !1);
return !0;
}
// Try to insert the given node, adjusting the context when needed.
insertNode(e) {
if (e.isInline && this.needsBlock && !this.top.type) {
let n = this.textblockFromContext();
n && this.enterInner(n);
}
if (this.findPlace(e)) {
this.closeExtra();
let n = this.top;
n.applyPending(e.type), n.match && (n.match = n.match.matchType(e.type));
let r = n.activeMarks;
for (let i = 0; i < e.marks.length; i++)
(!n.type || n.type.allowsMarkType(e.marks[i].type)) && (r = e.marks[i].addToSet(r));
return n.content.push(e.mark(r)), !0;
}
return !1;
}
// Try to start a node of the given type, adjusting the context when
// necessary.
enter(e, n, r) {
let i = this.findPlace(e.create(n));
return i && this.enterInner(e, n, !0, r), i;
}
// Open a node of the given type
enterInner(e, n = null, r = !1, i) {
this.closeExtra();
let o = this.top;
o.applyPending(e), o.match = o.match && o.match.matchType(e);
let a = dg(e, i, o.options);
o.options & Ds && o.content.length == 0 && (a |= Ds), this.nodes.push(new Wu(e, n, o.activeMarks, o.pendingMarks, r, null, a)), this.open++;
}
// Make sure all nodes above this.open are finished and added to
// their parents
closeExtra(e = !1) {
let n = this.nodes.length - 1;
if (n > this.open) {
for (; n > this.open; n--)
this.nodes[n - 1].content.push(this.nodes[n].finish(e));
this.nodes.length = this.open + 1;
}
}
finish() {
return this.open = 0, this.closeExtra(this.isOpen), this.nodes[0].finish(this.isOpen || this.options.topOpen);
}
sync(e) {
for (let n = this.open; n >= 0; n--)
if (this.nodes[n] == e)
return this.open = n, !0;
return !1;
}
get currentPos() {
this.closeExtra();
let e = 0;
for (let n = this.open; n >= 0; n--) {
let r = this.nodes[n].content;
for (let i = r.length - 1; i >= 0; i--)
e += r[i].nodeSize;
n && e++;
}
return e;
}
findAtPoint(e, n) {
if (this.find)
for (let r = 0; r < this.find.length; r++)
this.find[r].node == e && this.find[r].offset == n && (this.find[r].pos = this.currentPos);
}
findInside(e) {
if (this.find)
for (let n = 0; n < this.find.length; n++)
this.find[n].pos == null && e.nodeType == 1 && e.contains(this.find[n].node) && (this.find[n].pos = this.currentPos);
}
findAround(e, n, r) {
if (e != n && this.find)
for (let i = 0; i < this.find.length; i++)
this.find[i].pos == null && e.nodeType == 1 && e.contains(this.find[i].node) && n.compareDocumentPosition(this.find[i].node) & (r ? 2 : 4) && (this.find[i].pos = this.currentPos);
}
findInText(e) {
if (this.find)
for (let n = 0; n < this.find.length; n++)
this.find[n].node == e && (this.find[n].pos = this.currentPos - (e.nodeValue.length - this.find[n].offset));
}
// Determines whether the given context string matches this context.
matchesContext(e) {
if (e.indexOf("|") > -1)
return e.split(/\s*\|\s*/).some(this.matchesContext, this);
let n = e.split("/"), r = this.options.context, i = !this.isOpen && (!r || r.parent.type == this.nodes[0].type), o = -(r ? r.depth + 1 : 0) + (i ? 0 : 1), a = (s, u) => {
for (; s >= 0; s--) {
let l = n[s];
if (l == "") {
if (s == n.length - 1 || s == 0)
continue;
for (; u >= o; u--)
if (a(s - 1, u))
return !0;
return !1;
} else {
let c = u > 0 || u == 0 && i ? this.nodes[u].type : r && u >= o ? r.node(u - o).type : null;
if (!c || c.name != l && c.groups.indexOf(l) == -1)
return !1;
u--;
}
}
return !0;
};
return a(n.length - 1, this.open);
}
textblockFromContext() {
let e = this.options.context;
if (e)
for (let n = e.depth; n >= 0; n--) {
let r = e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;
if (r && r.isTextblock && r.defaultAttrs)
return r;
}
for (let n in this.parser.schema.nodes) {
let r = this.parser.schema.nodes[n];
if (r.isTextblock && r.defaultAttrs)
return r;
}
}
addPendingMark(e) {
let n = FN(e, this.top.pendingMarks);
n && this.top.stashMarks.push(n), this.top.pendingMarks = e.addToSet(this.top.pendingMarks);
}
removePendingMark(e, n) {
for (let r = this.open; r >= 0; r--) {
let i = this.nodes[r];
if (i.pendingMarks.lastIndexOf(e) > -1)
i.pendingMarks = e.removeFromSet(i.pendingMarks);
else {
i.activeMarks = e.removeFromSet(i.activeMarks);
let a = i.popFromStashMark(e);
a && i.type && i.type.allowsMarkType(a.type) && (i.activeMarks = a.addToSet(i.activeMarks));
}
if (i == n)
break;
}
}
}
function VN(t) {
for (let e = t.firstChild, n = null; e; e = e.nextSibling) {
let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
r && F3.hasOwnProperty(r) && n ? (n.appendChild(e), e = n) : r == "li" ? n = e : r && (n = null);
}
}
function zN(t, e) {
return (t.matches || t.msMatchesSelector || t.webkitMatchesSelector || t.mozMatchesSelector).call(t, e);
}
function HN(t) {
let e = /\s*([\w-]+)\s*:\s*([^;]+)/g, n, r = [];
for (; n = e.exec(t); )
r.push(n[1], n[2].trim());
return r;
}
function pg(t) {
let e = {};
for (let n in t)
e[n] = t[n];
return e;
}
function qN(t, e) {
let n = e.schema.nodes;
for (let r in n) {
let i = n[r];
if (!i.allowsMarkType(t))
continue;
let o = [], a = (s) => {
o.push(s);
for (let u = 0; u < s.edgeCount; u++) {
let { type: l, next: c } = s.edge(u);
if (l == e || o.indexOf(c) < 0 && a(c))
return !0;
}
};
if (a(i.contentMatch))
return !0;
}
}
function FN(t, e) {
for (let n = 0; n < e.length; n++)
if (t.eq(e[n]))
return e[n];
}
class Lr {
/**
Create a serializer. `nodes` should map node names to functions
that take a node and return a description of the corresponding
DOM. `marks` does the same for mark names, but also gets an
argument that tells it whether the mark's content is block or
inline content (for typical use, it'll always be inline). A mark
serializer may be `null` to indicate that marks of that type
should not be serialized.
*/
constructor(e, n) {
this.nodes = e, this.marks = n;
}
/**
Serialize the content of this fragment to a DOM fragment. When
not in the browser, the `document` option, containing a DOM
document, should be passed so that the serializer can create
nodes.
*/
serializeFragment(e, n = {}, r) {
r || (r = uf(n).createDocumentFragment());
let i = r, o = [];
return e.forEach((a) => {
if (o.length || a.marks.length) {
let s = 0, u = 0;
for (; s < o.length && u < a.marks.length; ) {
let l = a.marks[u];
if (!this.marks[l.type.name]) {
u++;
continue;
}
if (!l.eq(o[s][0]) || l.type.spec.spanning === !1)
break;
s++, u++;
}
for (; s < o.length; )
i = o.pop()[1];
for (; u < a.marks.length; ) {
let l = a.marks[u++], c = this.serializeMark(l, a.isInline, n);
c && (o.push([l, i]), i.appendChild(c.dom), i = c.contentDOM || c.dom);
}
}
i.appendChild(this.serializeNodeInner(a, n));
}), r;
}
/**
@internal
*/
serializeNodeInner(e, n) {
let { dom: r, contentDOM: i } = Lr.renderSpec(uf(n), this.nodes[e.type.name](e));
if (i) {
if (e.isLeaf)
throw new RangeError("Content hole not allowed in a leaf node spec");
this.serializeFragment(e.content, n, i);
}
return r;
}
/**
Serialize this node to a DOM node. This can be useful when you
need to serialize a part of a document, as opposed to the whole
document. To serialize a whole document, use
[`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on
its [content](https://prosemirror.net/docs/ref/#model.Node.content).
*/
serializeNode(e, n = {}) {
let r = this.serializeNodeInner(e, n);
for (let i = e.marks.length - 1; i >= 0; i--) {
let o = this.serializeMark(e.marks[i], e.isInline, n);
o && ((o.contentDOM || o.dom).appendChild(r), r = o.dom);
}
return r;
}
/**
@internal
*/
serializeMark(e, n, r = {}) {
let i = this.marks[e.type.name];
return i && Lr.renderSpec(uf(r), i(e, n));
}
/**
Render an [output spec](https://prosemirror.net/docs/ref/#model.DOMOutputSpec) to a DOM node. If
the spec has a hole (zero) in it, `contentDOM` will point at the
node with the hole.
*/
static renderSpec(e, n, r = null) {
if (typeof n == "string")
return { dom: e.createTextNode(n) };
if (n.nodeType != null)
return { dom: n };
if (n.dom && n.dom.nodeType != null)
return n;
let i = n[0], o = i.indexOf(" ");
o > 0 && (r = i.slice(0, o), i = i.slice(o + 1));
let a, s = r ? e.createElementNS(r, i) : e.createElement(i), u = n[1], l = 1;
if (u && typeof u == "object" && u.nodeType == null && !Array.isArray(u)) {
l = 2;
for (let c in u)
if (u[c] != null) {
let f = c.indexOf(" ");
f > 0 ? s.setAttributeNS(c.slice(0, f), c.slice(f + 1), u[c]) : s.setAttribute(c, u[c]);
}
}
for (let c = l; c < n.length; c++) {
let f = n[c];
if (f === 0) {
if (c < n.length - 1 || c > l)
throw new RangeError("Content hole must be the only child of its parent node");
return { dom: s, contentDOM: s };
} else {
let { dom: d, contentDOM: p } = Lr.renderSpec(e, f, r);
if (s.appendChild(d), p) {
if (a)
throw new RangeError("Multiple content holes");
a = p;
}
}
}
return { dom: s, contentDOM: a };
}
/**
Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
properties in a schema's node and mark specs.
*/
static fromSchema(e) {
return e.cached.domSerializer || (e.cached.domSerializer = new Lr(this.nodesFromSchema(e), this.marksFromSchema(e)));
}
/**
Gather the serializers in a schema's node specs into an object.
This can be useful as a base to build a custom serializer from.
*/
static nodesFromSchema(e) {
let n = hg(e.nodes);
return n.text || (n.text = (r) => r.text), n;
}
/**
Gather the serializers in a schema's mark specs into an object.
*/
static marksFromSchema(e) {
return hg(e.marks);
}
}
function hg(t) {
let e = {};
for (let n in t) {
let r = t[n].spec.toDOM;
r && (e[n] = r);
}
return e;
}
function uf(t) {
return t.document || window.document;
}
const j3 = 65535, U3 = Math.pow(2, 16);
function jN(t, e) {
return t + e * U3;
}
function mg(t) {
return t & j3;
}
function UN(t) {
return (t - (t & j3)) / U3;
}
const W3 = 1, Y3 = 2, vl = 4, K3 = 8;
class $0 {
/**
@internal
*/
constructor(e, n, r) {
this.pos = e, this.delInfo = n, this.recover = r;
}
/**
Tells you whether the position was deleted, that is, whether the
step removed the token on the side queried (via the `assoc`)
argument from the document.
*/
get deleted() {
return (this.delInfo & K3) > 0;
}
/**
Tells you whether the token before the mapped position was deleted.
*/
get deletedBefore() {
return (this.delInfo & (W3 | vl)) > 0;
}
/**
True when the token after the mapped position was deleted.
*/
get deletedAfter() {
return (this.delInfo & (Y3 | vl)) > 0;
}
/**
Tells whether any of the steps mapped through deletes across the
position (including both the token before and after the
position).
*/
get deletedAcross() {
return (this.delInfo & vl) > 0;
}
}
class Gn {
/**
Create a position map. The modifications to the document are
represented as an array of numbers, in which each group of three
represents a modified chunk as `[start, oldSize, newSize]`.
*/
constructor(e, n = !1) {
if (this.ranges = e, this.inverted = n, !e.length && Gn.empty)
return Gn.empty;
}
/**
@internal
*/
recover(e) {
let n = 0, r = mg(e);
if (!this.inverted)
for (let i = 0; i < r; i++)
n += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
return this.ranges[r * 3] + n + UN(e);
}
mapResult(e, n = 1) {
return this._map(e, n, !1);
}
map(e, n = 1) {
return this._map(e, n, !0);
}
/**
@internal
*/
_map(e, n, r) {
let i = 0, o = this.inverted ? 2 : 1, a = this.inverted ? 1 : 2;
for (let s = 0; s < this.ranges.length; s += 3) {
let u = this.ranges[s] - (this.inverted ? i : 0);
if (u > e)
break;
let l = this.ranges[s + o], c = this.ranges[s + a], f = u + l;
if (e <= f) {
let d = l ? e == u ? -1 : e == f ? 1 : n : n, p = u + i + (d < 0 ? 0 : c);
if (r)
return p;
let h = e == (n < 0 ? u : f) ? null : jN(s / 3, e - u), m = e == u ? Y3 : e == f ? W3 : vl;
return (n < 0 ? e != u : e != f) && (m |= K3), new $0(p, m, h);
}
i += c - l;
}
return r ? e + i : new $0(e + i, 0, null);
}
/**
@internal
*/
touches(e, n) {
let r = 0, i = mg(n), o = this.inverted ? 2 : 1, a = this.inverted ? 1 : 2;
for (let s = 0; s < this.ranges.length; s += 3) {
let u = this.ranges[s] - (this.inverted ? r : 0);
if (u > e)
break;
let l = this.ranges[s + o], c = u + l;
if (e <= c && s == i * 3)
return !0;
r += this.ranges[s + a] - l;
}
return !1;
}
/**
Calls the given function on each of the changed ranges included in
this map.
*/
forEach(e) {
let n = this.inverted ? 2 : 1, r = this.inverted ? 1 : 2;
for (let i = 0, o = 0; i < this.ranges.length; i += 3) {
let a = this.ranges[i], s = a - (this.inverted ? o : 0), u = a + (this.inverted ? 0 : o), l = this.ranges[i + n], c = this.ranges[i + r];
e(s, s + l, u, u + c), o += c - l;
}
}
/**
Create an inverted version of this map. The result can be used to
map positions in the post-step document to the pre-step document.
*/
invert() {
return new Gn(this.ranges, !this.inverted);
}
/**
@internal
*/
toString() {
return (this.inverted ? "-" : "") + JSON.stringify(this.ranges);
}
/**
Create a map that moves all positions by offset `n` (which may be
negative). This can be useful when applying steps meant for a
sub-document to a larger document, or vice-versa.
*/
static offset(e) {
return e == 0 ? Gn.empty : new Gn(e < 0 ? [0, -e, 0] : [0, 0, e]);
}
}
Gn.empty = new Gn([]);
class ya {
/**
Create a new mapping with the given position maps.
*/
constructor(e = [], n, r = 0, i = e.length) {
this.maps = e, this.mirror = n, this.from = r, this.to = i;
}
/**
Create a mapping that maps only through a part of this one.
*/
slice(e = 0, n = this.maps.length) {
return new ya(this.maps, this.mirror, e, n);
}
/**
@internal
*/
copy() {
return new ya(this.maps.slice(), this.mirror && this.mirror.slice(), this.from, this.to);
}
/**
Add a step map to the end of this mapping. If `mirrors` is
given, it should be the index of the step map that is the mirror
image of this one.
*/
appendMap(e, n) {
this.to = this.maps.push(e), n != null && this.setMirror(this.maps.length - 1, n);
}
/**
Add all the step maps in a given mapping to this one (preserving
mirroring information).
*/
appendMapping(e) {
for (let n = 0, r = this.maps.length; n < e.maps.length; n++) {
let i = e.getMirror(n);
this.appendMap(e.maps[n], i != null && i < n ? r + i : void 0);
}
}
/**
Finds the offset of the step map that mirrors the map at the
given offset, in this mapping (as per the second argument to
`appendMap`).
*/
getMirror(e) {
if (this.mirror) {
for (let n = 0; n < this.mirror.length; n++)
if (this.mirror[n] == e)
return this.mirror[n + (n % 2 ? -1 : 1)];
}
}
/**
@internal
*/
setMirror(e, n) {
this.mirror || (this.mirror = []), this.mirror.push(e, n);
}
/**
Append the inverse of the given mapping to this one.
*/
appendMappingInverted(e) {
for (let n = e.maps.length - 1, r = this.maps.length + e.maps.length; n >= 0; n--) {
let i = e.getMirror(n);
this.appendMap(e.maps[n].invert(), i != null && i > n ? r - i - 1 : void 0);
}
}
/**
Create an inverted version of this mapping.
*/
invert() {
let e = new ya();
return e.appendMappingInverted(this), e;
}
/**
Map a position through this mapping.
*/
map(e, n = 1) {
if (this.mirror)
return this._map(e, n, !0);
for (let r = this.from; r < this.to; r++)
e = this.maps[r].map(e, n);
return e;
}
/**
Map a position through this mapping, returning a mapping
result.
*/
mapResult(e, n = 1) {
return this._map(e, n, !1);
}
/**
@internal
*/
_map(e, n, r) {
let i = 0;
for (let o = this.from; o < this.to; o++) {
let a = this.maps[o], s = a.mapResult(e, n);
if (s.recover != null) {
let u = this.getMirror(o);
if (u != null && u > o && u < this.to) {
o = u, e = this.maps[u].recover(s.recover);
continue;
}
}
i |= s.delInfo, e = s.pos;
}
return r ? e : new $0(e, i, null);
}
}
const lf = /* @__PURE__ */ Object.create(null);
class mn {
/**
Get the step map that represents the changes made by this step,
and which can be used to transform between positions in the old
and the new document.
*/
getMap() {
return Gn.empty;
}
/**
Try to merge this step with another one, to be applied directly
after it. Returns the merged step when possible, null if the
steps can't be merged.
*/
merge(e) {
return null;
}
/**
Deserialize a step from its JSON representation. Will call
through to the step class' own implementation of this method.
*/
static fromJSON(e, n) {
if (!n || !n.stepType)
throw new RangeError("Invalid input for Step.fromJSON");
let r = lf[n.stepType];
if (!r)
throw new RangeError(`No step type ${n.stepType} defined`);
return r.fromJSON(e, n);
}
/**
To be able to serialize steps to JSON, each step needs a string
ID to attach to its JSON representation. Use this method to
register an ID for your step classes. Try to pick something
that's unlikely to clash with steps from other modules.
*/
static jsonID(e, n) {
if (e in lf)
throw new RangeError("Duplicate use of step JSON ID " + e);
return lf[e] = n, n.prototype.jsonID = e, n;
}
}
class zt {
/**
@internal
*/
constructor(e, n) {
this.doc = e, this.failed = n;
}
/**
Create a successful step result.
*/
static ok(e) {
return new zt(e, null);
}
/**
Create a failed step result.
*/
static fail(e) {
return new zt(null, e);
}
/**
Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given
arguments. Create a successful result if it succeeds, and a
failed one if it throws a `ReplaceError`.
*/
static fromReplace(e, n, r, i) {
try {
return zt.ok(e.replace(n, r, i));
} catch (o) {
if (o instanceof Ql)
return zt.fail(o.message);
throw o;
}
}
}
function lh(t, e, n) {
let r = [];
for (let i = 0; i < t.childCount; i++) {
let o = t.child(i);
o.content.size && (o = o.copy(lh(o.content, e, o))), o.isInline && (o = e(o, n, i)), r.push(o);
}
return me.fromArray(r);
}
class Di extends mn {
/**
Create a mark step.
*/
constructor(e, n, r) {
super(), this.from = e, this.to = n, this.mark = r;
}
apply(e) {
let n = e.slice(this.from, this.to), r = e.resolve(this.from), i = r.node(r.sharedDepth(this.to)), o = new Te(lh(n.content, (a, s) => !a.isAtom || !s.type.allowsMarkType(this.mark.type) ? a : a.mark(this.mark.addToSet(a.marks)), i), n.openStart, n.openEnd);
return zt.fromReplace(e, this.from, this.to, o);
}
invert() {
return new Rr(this.from, this.to, this.mark);
}
map(e) {
let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
return n.deleted && r.deleted || n.pos >= r.pos ? null : new Di(n.pos, r.pos, this.mark);
}
merge(e) {
return e instanceof Di && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new Di(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
}
toJSON() {
return {
stepType: "addMark",
mark: this.mark.toJSON(),
from: this.from,
to: this.to
};
}
/**
@internal
*/
static fromJSON(e, n) {
if (typeof n.from != "number" || typeof n.to != "number")
throw new RangeError("Invalid input for AddMarkStep.fromJSON");
return new Di(n.from, n.to, e.markFromJSON(n.mark));
}
}
mn.jsonID("addMark", Di);
class Rr extends mn {
/**
Create a mark-removing step.
*/
constructor(e, n, r) {
super(), this.from = e, this.to = n, this.mark = r;
}
apply(e) {
let n = e.slice(this.from, this.to), r = new Te(lh(n.content, (i) => i.mark(this.mark.removeFromSet(i.marks)), e), n.openStart, n.openEnd);
return zt.fromReplace(e, this.from, this.to, r);
}
invert() {
return new Di(this.from, this.to, this.mark);
}
map(e) {
let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
return n.deleted && r.deleted || n.pos >= r.pos ? null : new Rr(n.pos, r.pos, this.mark);
}
merge(e) {
return e instanceof Rr && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new Rr(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
}
toJSON() {
return {
stepType: "removeMark",
mark: this.mark.toJSON(),
from: this.from,
to: this.to
};
}
/**
@internal
*/
static fromJSON(e, n) {
if (typeof n.from != "number" || typeof n.to != "number")
throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");
return new Rr(n.from, n.to, e.markFromJSON(n.mark));
}
}
mn.jsonID("removeMark", Rr);
class $i extends mn {
/**
Create a node mark step.
*/
constructor(e, n) {
super(), this.pos = e, this.mark = n;
}
apply(e) {
let n = e.nodeAt(this.pos);
if (!n)
return zt.fail("No node at mark step's position");
let r = n.type.create(n.attrs, null, this.mark.addToSet(n.marks));
return zt.fromReplace(e, this.pos, this.pos + 1, new Te(me.from(r), 0, n.isLeaf ? 0 : 1));
}
invert(e) {
let n = e.nodeAt(this.pos);
if (n) {
let r = this.mark.addToSet(n.marks);
if (r.length == n.marks.length) {
for (let i = 0; i < n.marks.length; i++)
if (!n.marks[i].isInSet(r))
return new $i(this.pos, n.marks[i]);
return new $i(this.pos, this.mark);
}
}
return new ja(this.pos, this.mark);
}
map(e) {
let n = e.mapResult(this.pos, 1);
return n.deletedAfter ? null : new $i(n.pos, this.mark);
}
toJSON() {
return { stepType: "addNodeMark", pos: this.pos, mark: this.mark.toJSON() };
}
/**
@internal
*/
static fromJSON(e, n) {
if (typeof n.pos != "number")
throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");
return new $i(n.pos, e.markFromJSON(n.mark));
}
}
mn.jsonID("addNodeMark", $i);
class ja extends mn {
/**
Create a mark-removing step.
*/
constructor(e, n) {
super(), this.pos = e, this.mark = n;
}
apply(e) {
let n = e.nodeAt(this.pos);
if (!n)
return zt.fail("No node at mark step's position");
let r = n.type.create(n.attrs, null, this.mark.removeFromSet(n.marks));
return zt.fromReplace(e, this.pos, this.pos + 1, new Te(me.from(r), 0, n.isLeaf ? 0 : 1));
}
invert(e) {
let n = e.nodeAt(this.pos);
return !n || !this.mark.isInSet(n.marks) ? this : new $i(this.pos, this.mark);
}
map(e) {
let n = e.mapResult(this.pos, 1);
return n.deletedAfter ? null : new ja(n.pos, this.mark);
}
toJSON() {
return { stepType: "removeNodeMark", pos: this.pos, mark: this.mark.toJSON() };
}
/**
@internal
*/
static fromJSON(e, n) {
if (typeof n.pos != "number")
throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");
return new ja(n.pos, e.markFromJSON(n.mark));
}
}
mn.jsonID("removeNodeMark", ja);
class nn extends mn {
/**
The given `slice` should fit the 'gap' between `from` and
`to`—the depths must line up, and the surrounding nodes must be
able to be joined with the open sides of the slice. When
`structure` is true, the step will fail if the content between
from and to is not just a sequence of closing and then opening
tokens (this is to guard against rebased replace steps
overwriting something they weren't supposed to).
*/
constructor(e, n, r, i = !1) {
super(), this.from = e, this.to = n, this.slice = r, this.structure = i;
}
apply(e) {
return this.structure && N0(e, this.from, this.to) ? zt.fail("Structure replace would overwrite content") : zt.fromReplace(e, this.from, this.to, this.slice);
}
getMap() {
return new Gn([this.from, this.to - this.from, this.slice.size]);
}
invert(e) {
return new nn(this.from, this.from + this.slice.size, e.slice(this.from, this.to));
}
map(e) {
let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
return n.deletedAcross && r.deletedAcross ? null : new nn(n.pos, Math.max(n.pos, r.pos), this.slice);
}
merge(e) {
if (!(e instanceof nn) || e.structure || this.structure)
return null;
if (this.from + this.slice.size == e.from && !this.slice.openEnd && !e.slice.openStart) {
let n = this.slice.size + e.slice.size == 0 ? Te.empty : new Te(this.slice.content.append(e.slice.content), this.slice.openStart, e.slice.openEnd);
return new nn(this.from, this.to + (e.to - e.from), n, this.structure);
} else if (e.to == this.from && !this.slice.openStart && !e.slice.openEnd) {
let n = this.slice.size + e.slice.size == 0 ? Te.empty : new Te(e.slice.content.append(this.slice.content), e.slice.openStart, this.slice.openEnd);
return new nn(e.from, this.to, n, this.structure);
} else
return null;
}
toJSON() {
let e = { stepType: "replace", from: this.from, to: this.to };
return this.slice.size && (e.slice = this.slice.toJSON()), this.structure && (e.structure = !0), e;
}
/**
@internal
*/
static fromJSON(e, n) {
if (typeof n.from != "number" || typeof n.to != "number")
throw new RangeError("Invalid input for ReplaceStep.fromJSON");
return new nn(n.from, n.to, Te.fromJSON(e, n.slice), !!n.structure);
}
}
mn.jsonID("replace", nn);
class Gt extends mn {
/**
Create a replace-around step with the given range and gap.
`insert` should be the point in the slice into which the content
of the gap should be moved. `structure` has the same meaning as
it has in the [`ReplaceStep`](https://prosemirror.net/docs/ref/#transform.ReplaceStep) class.
*/
constructor(e, n, r, i, o, a, s = !1) {
super(), this.from = e, this.to = n, this.gapFrom = r, this.gapTo = i, this.slice = o, this.insert = a, this.structure = s;
}
apply(e) {
if (this.structure && (N0(e, this.from, this.gapFrom) || N0(e, this.gapTo, this.to)))
return zt.fail("Structure gap-replace would overwrite content");
let n = e.slice(this.gapFrom, this.gapTo);
if (n.openStart || n.openEnd)
return zt.fail("Gap is not a flat range");
let r = this.slice.insertAt(this.insert, n.content);
return r ? zt.fromReplace(e, this.from, this.to, r) : zt.fail("Content does not fit in gap");
}
getMap() {
return new Gn([
this.from,
this.gapFrom - this.from,
this.insert,
this.gapTo,
this.to - this.gapTo,
this.slice.size - this.insert
]);
}
invert(e) {
let n = this.gapTo - this.gapFrom;
return new Gt(this.from, this.from + this.slice.size + n, this.from + this.insert, this.from + this.insert + n, e.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
}
map(e) {
let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1), i = e.map(this.gapFrom, -1), o = e.map(this.gapTo, 1);
return n.deletedAcross && r.deletedAcross || i < n.pos || o > r.pos ? null : new Gt(n.pos, r.pos, i, o, this.slice, this.insert, this.structure);
}
toJSON() {
let e = {
stepType: "replaceAround",
from: this.from,
to: this.to,
gapFrom: this.gapFrom,
gapTo: this.gapTo,
insert: this.insert
};
return this.slice.size && (e.slice = this.slice.toJSON()), this.structure && (e.structure = !0), e;
}
/**
@internal
*/
static fromJSON(e, n) {
if (typeof n.from != "number" || typeof n.to != "number" || typeof n.gapFrom != "number" || typeof n.gapTo != "number" || typeof n.insert != "number")
throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
return new Gt(n.from, n.to, n.gapFrom, n.gapTo, Te.fromJSON(e, n.slice), n.insert, !!n.structure);
}
}
mn.jsonID("replaceAround", Gt);
function N0(t, e, n) {
let r = t.resolve(e), i = n - e, o = r.depth;
for (; i > 0 && o > 0 && r.indexAfter(o) == r.node(o).childCount; )
o--, i--;
if (i > 0) {
let a = r.node(o).maybeChild(r.indexAfter(o));
for (; i > 0; ) {
if (!a || a.isLeaf)
return !0;
a = a.firstChild, i--;
}
}
return !1;
}
function WN(t, e, n, r) {
let i = [], o = [], a, s;
t.doc.nodesBetween(e, n, (u, l, c) => {
if (!u.isInline)
return;
let f = u.marks;
if (!r.isInSet(f) && c.type.allowsMarkType(r.type)) {
let d = Math.max(l, e), p = Math.min(l + u.nodeSize, n), h = r.addToSet(f);
for (let m = 0; m < f.length; m++)
f[m].isInSet(h) || (a && a.to == d && a.mark.eq(f[m]) ? a.to = p : i.push(a = new Rr(d, p, f[m])));
s && s.to == d ? s.to = p : o.push(s = new Di(d, p, r));
}
}), i.forEach((u) => t.step(u)), o.forEach((u) => t.step(u));
}
function YN(t, e, n, r) {
let i = [], o = 0;
t.doc.nodesBetween(e, n, (a, s) => {
if (!a.isInline)
return;
o++;
let u = null;
if (r instanceof ad) {
let l = a.marks, c;
for (; c = r.isInSet(l); )
(u || (u = [])).push(c), l = c.removeFromSet(l);
} else
r ? r.isInSet(a.marks) && (u = [r]) : u = a.marks;
if (u && u.length) {
let l = Math.min(s + a.nodeSize, n);
for (let c = 0; c < u.length; c++) {
let f = u[c], d;
for (let p = 0; p < i.length; p++) {
let h = i[p];
h.step == o - 1 && f.eq(i[p].style) && (d = h);
}
d ? (d.to = l, d.step = o) : i.push({ style: f, from: Math.max(s, e), to: l, step: o });
}
}
}), i.forEach((a) => t.step(new Rr(a.from, a.to, a.style)));
}
function KN(t, e, n, r = n.contentMatch) {
let i = t.doc.nodeAt(e), o = [], a = e + 1;
for (let s = 0; s < i.childCount; s++) {
let u = i.child(s), l = a + u.nodeSize, c = r.matchType(u.type);
if (!c)
o.push(new nn(a, l, Te.empty));
else {
r = c;
for (let f = 0; f < u.marks.length; f++)
n.allowsMarkType(u.marks[f].type) || t.step(new Rr(a, l, u.marks[f]));
if (u.isText && !n.spec.code) {
let f, d = /\r?\n|\r/g, p;
for (; f = d.exec(u.text); )
p || (p = new Te(me.from(n.schema.text(" ", n.allowedMarks(u.marks))), 0, 0)), o.push(new nn(a + f.index, a + f.index + f[0].length, p));
}
}
a = l;
}
if (!r.validEnd) {
let s = r.fillBefore(me.empty, !0);
t.replace(a, a, new Te(s, 0, 0));
}
for (let s = o.length - 1; s >= 0; s--)
t.step(o[s]);
}
function GN(t, e, n) {
return (e == 0 || t.canReplace(e, t.childCount)) && (n == t.childCount || t.canReplace(0, n));
}
function Qa(t) {
let n = t.parent.content.cutByIndex(t.startIndex, t.endIndex);
for (let r = t.depth; ; --r) {
let i = t.$from.node(r), o = t.$from.index(r), a = t.$to.indexAfter(r);
if (r < t.depth && i.canReplace(o, a, n))
return r;
if (r == 0 || i.type.spec.isolating || !GN(i, o, a))
break;
}
return null;
}
function JN(t, e, n) {
let { $from: r, $to: i, depth: o } = e, a = r.before(o + 1), s = i.after(o + 1), u = a, l = s, c = me.empty, f = 0;
for (let h = o, m = !1; h > n; h--)
m || r.index(h) > 0 ? (m = !0, c = me.from(r.node(h).copy(c)), f++) : u--;
let d = me.empty, p = 0;
for (let h = o, m = !1; h > n; h--)
m || i.after(h + 1) < i.end(h) ? (m = !0, d = me.from(i.node(h).copy(d)), p++) : l++;
t.step(new Gt(u, l, a, s, new Te(c.append(d), f, p), c.size - f, !0));
}
function ch(t, e, n = null, r = t) {
let i = XN(t, e), o = i && QN(r, e);
return o ? i.map(gg).concat({ type: e, attrs: n }).concat(o.map(gg)) : null;
}
function gg(t) {
return { type: t, attrs: null };
}
function XN(t, e) {
let { parent: n, startIndex: r, endIndex: i } = t, o = n.contentMatchAt(r).findWrapping(e);
if (!o)
return null;
let a = o.length ? o[0] : e;
return n.canReplaceWith(r, i, a) ? o : null;
}
function QN(t, e) {
let { parent: n, startIndex: r, endIndex: i } = t, o = n.child(r), a = e.contentMatch.findWrapping(o.type);
if (!a)
return null;
let u = (a.length ? a[a.length - 1] : e).contentMatch;
for (let l = r; u && l < i; l++)
u = u.matchType(n.child(l).type);
return !u || !u.validEnd ? null : a;
}
function ZN(t, e, n) {
let r = me.empty;
for (let a = n.length - 1; a >= 0; a--) {
if (r.size) {
let s = n[a].type.contentMatch.matchFragment(r);
if (!s || !s.validEnd)
throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
}
r = me.from(n[a].type.create(n[a].attrs, r));
}
let i = e.start, o = e.end;
t.step(new Gt(i, o, i, o, new Te(r, 0, 0), n.length, !0));
}
function eP(t, e, n, r, i) {
if (!r.isTextblock)
throw new RangeError("Type given to setBlockType should be a textblock");
let o = t.steps.length;
t.doc.nodesBetween(e, n, (a, s) => {
if (a.isTextblock && !a.hasMarkup(r, i) && tP(t.doc, t.mapping.slice(o).map(s), r)) {
t.clearIncompatible(t.mapping.slice(o).map(s, 1), r);
let u = t.mapping.slice(o), l = u.map(s, 1), c = u.map(s + a.nodeSize, 1);
return t.step(new Gt(l, c, l + 1, c - 1, new Te(me.from(r.create(i, null, a.marks)), 0, 0), 1, !0)), !1;
}
});
}
function tP(t, e, n) {
let r = t.resolve(e), i = r.index();
return r.parent.canReplaceWith(i, i + 1, n);
}
function nP(t, e, n, r, i) {
let o = t.doc.nodeAt(e);
if (!o)
throw new RangeError("No node at given position");
n || (n = o.type);
let a = n.create(r, null, i || o.marks);
if (o.isLeaf)
return t.replaceWith(e, e + o.nodeSize, a);
if (!n.validContent(o.content))
throw new RangeError("Invalid content for node type " + n.name);
t.step(new Gt(e, e + o.nodeSize, e + 1, e + o.nodeSize - 1, new Te(me.from(a), 0, 0), 1, !0));
}
function wa(t, e, n = 1, r) {
let i = t.resolve(e), o = i.depth - n, a = r && r[r.length - 1] || i.parent;
if (o < 0 || i.parent.type.spec.isolating || !i.parent.canReplace(i.index(), i.parent.childCount) || !a.type.validContent(i.parent.content.cutByIndex(i.index(), i.parent.childCount)))
return !1;
for (let l = i.depth - 1, c = n - 2; l > o; l--, c--) {
let f = i.node(l), d = i.index(l);
if (f.type.spec.isolating)
return !1;
let p = f.content.cutByIndex(d, f.childCount), h = r && r[c + 1];
h && (p = p.replaceChild(0, h.type.create(h.attrs)));
let m = r && r[c] || f;
if (!f.canReplace(d + 1, f.childCount) || !m.type.validContent(p))
return !1;
}
let s = i.indexAfter(o), u = r && r[0];
return i.node(o).canReplaceWith(s, s, u ? u.type : i.node(o + 1).type);
}
function rP(t, e, n = 1, r) {
let i = t.doc.resolve(e), o = me.empty, a = me.empty;
for (let s = i.depth, u = i.depth - n, l = n - 1; s > u; s--, l--) {
o = me.from(i.node(s).copy(o));
let c = r && r[l];
a = me.from(c ? c.type.create(c.attrs, a) : i.node(s).copy(a));
}
t.step(new nn(e, e, new Te(o.append(a), n, n), !0));
}
function Xi(t, e) {
let n = t.resolve(e), r = n.index();
return G3(n.nodeBefore, n.nodeAfter) && n.parent.canReplace(r, r + 1);
}
function G3(t, e) {
return !!(t && e && !t.isLeaf && t.canAppend(e));
}
function sd(t, e, n = -1) {
let r = t.resolve(e);
for (let i = r.depth; ; i--) {
let o, a, s = r.index(i);
if (i == r.depth ? (o = r.nodeBefore, a = r.nodeAfter) : n > 0 ? (o = r.node(i + 1), s++, a = r.node(i).maybeChild(s)) : (o = r.node(i).maybeChild(s - 1), a = r.node(i + 1)), o && !o.isTextblock && G3(o, a) && r.node(i).canReplace(s, s + 1))
return e;
if (i == 0)
break;
e = n < 0 ? r.before(i) : r.after(i);
}
}
function iP(t, e, n) {
let r = new nn(e - n, e + n, Te.empty, !0);
t.step(r);
}
function oP(t, e, n) {
let r = t.resolve(e);
if (r.parent.canReplaceWith(r.index(), r.index(), n))
return e;
if (r.parentOffset == 0)
for (let i = r.depth - 1; i >= 0; i--) {
let o = r.index(i);
if (r.node(i).canReplaceWith(o, o, n))
return r.before(i + 1);
if (o > 0)
return null;
}
if (r.parentOffset == r.parent.content.size)
for (let i = r.depth - 1; i >= 0; i--) {
let o = r.indexAfter(i);
if (r.node(i).canReplaceWith(o, o, n))
return r.after(i + 1);
if (o < r.node(i).childCount)
return null;
}
return null;
}
function J3(t, e, n) {
let r = t.resolve(e);
if (!n.content.size)
return e;
let i = n.content;
for (let o = 0; o < n.openStart; o++)
i = i.firstChild.content;
for (let o = 1; o <= (n.openStart == 0 && n.size ? 2 : 1); o++)
for (let a = r.depth; a >= 0; a--) {
let s = a == r.depth ? 0 : r.pos <= (r.start(a + 1) + r.end(a + 1)) / 2 ? -1 : 1, u = r.index(a) + (s > 0 ? 1 : 0), l = r.node(a), c = !1;
if (o == 1)
c = l.canReplace(u, u, i);
else {
let f = l.contentMatchAt(u).findWrapping(i.firstChild.type);
c = f && l.canReplaceWith(u, u, f[0]);
}
if (c)
return s == 0 ? r.pos : s < 0 ? r.before(a + 1) : r.after(a + 1);
}
return null;
}
function dh(t, e, n = e, r = Te.empty) {
if (e == n && !r.size)
return null;
let i = t.resolve(e), o = t.resolve(n);
return X3(i, o, r) ? new nn(e, n, r) : new aP(i, o, r).fit();
}
function X3(t, e, n) {
return !n.openStart && !n.openEnd && t.start() == e.start() && t.parent.canReplace(t.index(), e.index(), n.content);
}
class aP {
constructor(e, n, r) {
this.$from = e, this.$to = n, this.unplaced = r, this.frontier = [], this.placed = me.empty;
for (let i = 0; i <= e.depth; i++) {
let o = e.node(i);
this.frontier.push({
type: o.type,
match: o.contentMatchAt(e.indexAfter(i))
});
}
for (let i = e.depth; i > 0; i--)
this.placed = me.from(e.node(i).copy(this.placed));
}
get depth() {
return this.frontier.length - 1;
}
fit() {
for (; this.unplaced.size; ) {
let l = this.findFittable();
l ? this.placeNodes(l) : this.openMore() || this.dropNode();
}
let e = this.mustMoveInline(), n = this.placed.size - this.depth - this.$from.depth, r = this.$from, i = this.close(e < 0 ? this.$to : r.doc.resolve(e));
if (!i)
return null;
let o = this.placed, a = r.depth, s = i.depth;
for (; a && s && o.childCount == 1; )
o = o.firstChild.content, a--, s--;
let u = new Te(o, a, s);
return e > -1 ? new Gt(r.pos, e, this.$to.pos, this.$to.end(), u, n) : u.size || r.pos != this.$to.pos ? new nn(r.pos, i.pos, u) : null;
}
// Find a position on the start spine of `this.unplaced` that has
// content that can be moved somewhere on the frontier. Returns two
// depths, one for the slice and one for the frontier.
findFittable() {
let e = this.unplaced.openStart;
for (let n = this.unplaced.content, r = 0, i = this.unplaced.openEnd; r < e; r++) {
let o = n.firstChild;
if (n.childCount > 1 && (i = 0), o.type.spec.isolating && i <= r) {
e = r;
break;
}
n = o.content;
}
for (let n = 1; n <= 2; n++)
for (let r = n == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
let i, o = null;
r ? (o = cf(this.unplaced.content, r - 1).firstChild, i = o.content) : i = this.unplaced.content;
let a = i.firstChild;
for (let s = this.depth; s >= 0; s--) {
let { type: u, match: l } = this.frontier[s], c, f = null;
if (n == 1 && (a ? l.matchType(a.type) || (f = l.fillBefore(me.from(a), !1)) : o && u.compatibleContent(o.type)))
return { sliceDepth: r, frontierDepth: s, parent: o, inject: f };
if (n == 2 && a && (c = l.findWrapping(a.type)))
return { sliceDepth: r, frontierDepth: s, parent: o, wrap: c };
if (o && l.matchType(o.type))
break;
}
}
}
openMore() {
let { content: e, openStart: n, openEnd: r } = this.unplaced, i = cf(e, n);
return !i.childCount || i.firstChild.isLeaf ? !1 : (this.unplaced = new Te(e, n + 1, Math.max(r, i.size + n >= e.size - r ? n + 1 : 0)), !0);
}
dropNode() {
let { content: e, openStart: n, openEnd: r } = this.unplaced, i = cf(e, n);
if (i.childCount <= 1 && n > 0) {
let o = e.size - n <= n + i.size;
this.unplaced = new Te(ps(e, n - 1, 1), n - 1, o ? n - 1 : r);
} else
this.unplaced = new Te(ps(e, n, 1), n, r);
}
// Move content from the unplaced slice at `sliceDepth` to the
// frontier node at `frontierDepth`. Close that frontier node when
// applicable.
placeNodes({ sliceDepth: e, frontierDepth: n, parent: r, inject: i, wrap: o }) {
for (; this.depth > n; )
this.closeFrontierNode();
if (o)
for (let m = 0; m < o.length; m++)
this.openFrontierNode(o[m]);
let a = this.unplaced, s = r ? r.content : a.content, u = a.openStart - e, l = 0, c = [], { match: f, type: d } = this.frontier[n];
if (i) {
for (let m = 0; m < i.childCount; m++)
c.push(i.child(m));
f = f.matchFragment(i);
}
let p = s.size + e - (a.content.size - a.openEnd);
for (; l < s.childCount; ) {
let m = s.child(l), v = f.matchType(m.type);
if (!v)
break;
l++, (l > 1 || u == 0 || m.content.size) && (f = v, c.push(Q3(m.mark(d.allowedMarks(m.marks)), l == 1 ? u : 0, l == s.childCount ? p : -1)));
}
let h = l == s.childCount;
h || (p = -1), this.placed = hs(this.placed, n, me.from(c)), this.frontier[n].match = f, h && p < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
for (let m = 0, v = s; m < p; m++) {
let y = v.lastChild;
this.frontier.push({ type: y.type, match: y.contentMatchAt(y.childCount) }), v = y.content;
}
this.unplaced = h ? e == 0 ? Te.empty : new Te(ps(a.content, e - 1, 1), e - 1, p < 0 ? a.openEnd : e - 1) : new Te(ps(a.content, e, l), a.openStart, a.openEnd);
}
mustMoveInline() {
if (!this.$to.parent.isTextblock)
return -1;
let e = this.frontier[this.depth], n;
if (!e.type.isTextblock || !df(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (n = this.findCloseLevel(this.$to)) && n.depth == this.depth)
return -1;
let { depth: r } = this.$to, i = this.$to.after(r);
for (; r > 1 && i == this.$to.end(--r); )
++i;
return i;
}
findCloseLevel(e) {
e:
for (let n = Math.min(this.depth, e.depth); n >= 0; n--) {
let { match: r, type: i } = this.frontier[n], o = n < e.depth && e.end(n + 1) == e.pos + (e.depth - (n + 1)), a = df(e, n, i, r, o);
if (a) {
for (let s = n - 1; s >= 0; s--) {
let { match: u, type: l } = this.frontier[s], c = df(e, s, l, u, !0);
if (!c || c.childCount)
continue e;
}
return { depth: n, fit: a, move: o ? e.doc.resolve(e.after(n + 1)) : e };
}
}
}
close(e) {
let n = this.findCloseLevel(e);
if (!n)
return null;
for (; this.depth > n.depth; )
this.closeFrontierNode();
n.fit.childCount && (this.placed = hs(this.placed, n.depth, n.fit)), e = n.move;
for (let r = n.depth + 1; r <= e.depth; r++) {
let i = e.node(r), o = i.type.contentMatch.fillBefore(i.content, !0, e.index(r));
this.openFrontierNode(i.type, i.attrs, o);
}
return e;
}
openFrontierNode(e, n = null, r) {
let i = this.frontier[this.depth];
i.match = i.match.matchType(e), this.placed = hs(this.placed, this.depth, me.from(e.create(n, r))), this.frontier.push({ type: e, match: e.contentMatch });
}
closeFrontierNode() {
let n = this.frontier.pop().match.fillBefore(me.empty, !0);
n.childCount && (this.placed = hs(this.placed, this.frontier.length, n));
}
}
function ps(t, e, n) {
return e == 0 ? t.cutByIndex(n, t.childCount) : t.replaceChild(0, t.firstChild.copy(ps(t.firstChild.content, e - 1, n)));
}
function hs(t, e, n) {
return e == 0 ? t.append(n) : t.replaceChild(t.childCount - 1, t.lastChild.copy(hs(t.lastChild.content, e - 1, n)));
}
function cf(t, e) {
for (let n = 0; n < e; n++)
t = t.firstChild.content;
return t;
}
function Q3(t, e, n) {
if (e <= 0)
return t;
let r = t.content;
return e > 1 && (r = r.replaceChild(0, Q3(r.firstChild, e - 1, r.childCount == 1 ? n - 1 : 0))), e > 0 && (r = t.type.contentMatch.fillBefore(r).append(r), n <= 0 && (r = r.append(t.type.contentMatch.matchFragment(r).fillBefore(me.empty, !0)))), t.copy(r);
}
function df(t, e, n, r, i) {
let o = t.node(e), a = i ? t.indexAfter(e) : t.index(e);
if (a == o.childCount && !n.compatibleContent(o.type))
return null;
let s = r.fillBefore(o.content, !0, a);
return s && !sP(n, o.content, a) ? s : null;
}
function sP(t, e, n) {
for (let r = n; r < e.childCount; r++)
if (!t.allowsMarks(e.child(r).marks))
return !0;
return !1;
}
function uP(t) {
return t.spec.defining || t.spec.definingForContent;
}
function lP(t, e, n, r) {
if (!r.size)
return t.deleteRange(e, n);
let i = t.doc.resolve(e), o = t.doc.resolve(n);
if (X3(i, o, r))
return t.step(new nn(e, n, r));
let a = ew(i, t.doc.resolve(n));
a[a.length - 1] == 0 && a.pop();
let s = -(i.depth + 1);
a.unshift(s);
for (let d = i.depth, p = i.pos - 1; d > 0; d--, p--) {
let h = i.node(d).type.spec;
if (h.defining || h.definingAsContext || h.isolating)
break;
a.indexOf(d) > -1 ? s = d : i.before(d) == p && a.splice(1, 0, -d);
}
let u = a.indexOf(s), l = [], c = r.openStart;
for (let d = r.content, p = 0; ; p++) {
let h = d.firstChild;
if (l.push(h), p == r.openStart)
break;
d = h.content;
}
for (let d = c - 1; d >= 0; d--) {
let p = l[d], h = uP(p.type);
if (h && !p.sameMarkup(i.node(Math.abs(s) - 1)))
c = d;
else if (h || !p.type.isTextblock)
break;
}
for (let d = r.openStart; d >= 0; d--) {
let p = (d + c + 1) % (r.openStart + 1), h = l[p];
if (h)
for (let m = 0; m < a.length; m++) {
let v = a[(m + u) % a.length], y = !0;
v < 0 && (y = !1, v = -v);
let k = i.node(v - 1), T = i.index(v - 1);
if (k.canReplaceWith(T, T, h.type, h.marks))
return t.replace(i.before(v), y ? o.after(v) : n, new Te(Z3(r.content, 0, r.openStart, p), p, r.openEnd));
}
}
let f = t.steps.length;
for (let d = a.length - 1; d >= 0 && (t.replace(e, n, r), !(t.steps.length > f)); d--) {
let p = a[d];
p < 0 || (e = i.before(p), n = o.after(p));
}
}
function Z3(t, e, n, r, i) {
if (e < n) {
let o = t.firstChild;
t = t.replaceChild(0, o.copy(Z3(o.content, e + 1, n, r, o)));
}
if (e > r) {
let o = i.contentMatchAt(0), a = o.fillBefore(t).append(t);
t = a.append(o.matchFragment(a).fillBefore(me.empty, !0));
}
return t;
}
function cP(t, e, n, r) {
if (!r.isInline && e == n && t.doc.resolve(e).parent.content.size) {
let i = oP(t.doc, e, r.type);
i != null && (e = n = i);
}
t.replaceRange(e, n, new Te(me.from(r), 0, 0));
}
function dP(t, e, n) {
let r = t.doc.resolve(e), i = t.doc.resolve(n), o = ew(r, i);
for (let a = 0; a < o.length; a++) {
let s = o[a], u = a == o.length - 1;
if (u && s == 0 || r.node(s).type.contentMatch.validEnd)
return t.delete(r.start(s), i.end(s));
if (s > 0 && (u || r.node(s - 1).canReplace(r.index(s - 1), i.indexAfter(s - 1))))
return t.delete(r.before(s), i.after(s));
}
for (let a = 1; a <= r.depth && a <= i.depth; a++)
if (e - r.start(a) == r.depth - a && n > r.end(a) && i.end(a) - n != i.depth - a)
return t.delete(r.before(a), n);
t.delete(e, n);
}
function ew(t, e) {
let n = [], r = Math.min(t.depth, e.depth);
for (let i = r; i >= 0; i--) {
let o = t.start(i);
if (o < t.pos - (t.depth - i) || e.end(i) > e.pos + (e.depth - i) || t.node(i).type.spec.isolating || e.node(i).type.spec.isolating)
break;
(o == e.start(i) || i == t.depth && i == e.depth && t.parent.inlineContent && e.parent.inlineContent && i && e.start(i - 1) == o - 1) && n.push(i);
}
return n;
}
class ka extends mn {
/**
Construct an attribute step.
*/
constructor(e, n, r) {
super(), this.pos = e, this.attr = n, this.value = r;
}
apply(e) {
let n = e.nodeAt(this.pos);
if (!n)
return zt.fail("No node at attribute step's position");
let r = /* @__PURE__ */ Object.create(null);
for (let o in n.attrs)
r[o] = n.attrs[o];
r[this.attr] = this.value;
let i = n.type.create(r, null, n.marks);
return zt.fromReplace(e, this.pos, this.pos + 1, new Te(me.from(i), 0, n.isLeaf ? 0 : 1));
}
getMap() {
return Gn.empty;
}
invert(e) {
return new ka(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
}
map(e) {
let n = e.mapResult(this.pos, 1);
return n.deletedAfter ? null : new ka(n.pos, this.attr, this.value);
}
toJSON() {
return { stepType: "attr", pos: this.pos, attr: this.attr, value: this.value };
}
static fromJSON(e, n) {
if (typeof n.pos != "number" || typeof n.attr != "string")
throw new RangeError("Invalid input for AttrStep.fromJSON");
return new ka(n.pos, n.attr, n.value);
}
}
mn.jsonID("attr", ka);
class iu extends mn {
/**
Construct an attribute step.
*/
constructor(e, n) {
super(), this.attr = e, this.value = n;
}
apply(e) {
let n = /* @__PURE__ */ Object.create(null);
for (let i in e.attrs)
n[i] = e.attrs[i];
n[this.attr] = this.value;
let r = e.type.create(n, e.content, e.marks);
return zt.ok(r);
}
getMap() {
return Gn.empty;
}
invert(e) {
return new iu(this.attr, e.attrs[this.attr]);
}
map(e) {
return this;
}
toJSON() {
return { stepType: "docAttr", attr: this.attr, value: this.value };
}
static fromJSON(e, n) {
if (typeof n.attr != "string")
throw new RangeError("Invalid input for DocAttrStep.fromJSON");
return new iu(n.attr, n.value);
}
}
mn.jsonID("docAttr", iu);
let Ua = class extends Error {
};
Ua = function t(e) {
let n = Error.call(this, e);
return n.__proto__ = t.prototype, n;
};
Ua.prototype = Object.create(Error.prototype);
Ua.prototype.constructor = Ua;
Ua.prototype.name = "TransformError";
class tw {
/**
Create a transform that starts with the given document.
*/
constructor(e) {
this.doc = e, this.steps = [], this.docs = [], this.mapping = new ya();
}
/**
The starting document.
*/
get before() {
return this.docs.length ? this.docs[0] : this.doc;
}
/**
Apply a new step in this transform, saving the result. Throws an
error when the step fails.
*/
step(e) {
let n = this.maybeStep(e);
if (n.failed)
throw new Ua(n.failed);
return this;
}
/**
Try to apply a step in this transformation, ignoring it if it
fails. Returns the step result.
*/
maybeStep(e) {
let n = e.apply(this.doc);
return n.failed || this.addStep(e, n.doc), n;
}
/**
True when the document has been changed (when there are any
steps).
*/
get docChanged() {
return this.steps.length > 0;
}
/**
@internal
*/
addStep(e, n) {
this.docs.push(this.doc), this.steps.push(e), this.mapping.appendMap(e.getMap()), this.doc = n;
}
/**
Replace the part of the document between `from` and `to` with the
given `slice`.
*/
replace(e, n = e, r = Te.empty) {
let i = dh(this.doc, e, n, r);
return i && this.step(i), this;
}
/**
Replace the given range with the given content, which may be a
fragment, node, or array of nodes.
*/
replaceWith(e, n, r) {
return this.replace(e, n, new Te(me.from(r), 0, 0));
}
/**
Delete the content between the given positions.
*/
delete(e, n) {
return this.replace(e, n, Te.empty);
}
/**
Insert the given content at the given position.
*/
insert(e, n) {
return this.replaceWith(e, e, n);
}
/**
Replace a range of the document with a given slice, using
`from`, `to`, and the slice's
[`openStart`](https://prosemirror.net/docs/ref/#model.Slice.openStart) property as hints, rather
than fixed start and end points. This method may grow the
replaced area or close open nodes in the slice in order to get a
fit that is more in line with WYSIWYG expectations, by dropping
fully covered parent nodes of the replaced region when they are
marked [non-defining as
context](https://prosemirror.net/docs/ref/#model.NodeSpec.definingAsContext), or including an
open parent node from the slice that _is_ marked as [defining
its content](https://prosemirror.net/docs/ref/#model.NodeSpec.definingForContent).
This is the method, for example, to handle paste. The similar
[`replace`](https://prosemirror.net/docs/ref/#transform.Transform.replace) method is a more
primitive tool which will _not_ move the start and end of its given
range, and is useful in situations where you need more precise
control over what happens.
*/
replaceRange(e, n, r) {
return lP(this, e, n, r), this;
}
/**
Replace the given range with a node, but use `from` and `to` as
hints, rather than precise positions. When from and to are the same
and are at the start or end of a parent node in which the given
node doesn't fit, this method may _move_ them out towards a parent
that does allow the given node to be placed. When the given range
completely covers a parent node, this method may completely replace
that parent node.
*/
replaceRangeWith(e, n, r) {
return cP(this, e, n, r), this;
}
/**
Delete the given range, expanding it to cover fully covered
parent nodes until a valid replace is found.
*/
deleteRange(e, n) {
return dP(this, e, n), this;
}
/**
Split the content in the given range off from its parent, if there
is sibling content before or after it, and move it up the tree to
the depth specified by `target`. You'll probably want to use
[`liftTarget`](https://prosemirror.net/docs/ref/#transform.liftTarget) to compute `target`, to make
sure the lift is valid.
*/
lift(e, n) {
return JN(this, e, n), this;
}
/**
Join the blocks around the given position. If depth is 2, their
last and first siblings are also joined, and so on.
*/
join(e, n = 1) {
return iP(this, e, n), this;
}
/**
Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
The wrappers are assumed to be valid in this position, and should
probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
*/
wrap(e, n) {
return ZN(this, e, n), this;
}
/**
Set the type of all textblocks (partly) between `from` and `to` to
the given node type with the given attributes.
*/
setBlockType(e, n = e, r, i = null) {
return eP(this, e, n, r, i), this;
}
/**
Change the type, attributes, and/or marks of the node at `pos`.
When `type` isn't given, the existing node type is preserved,
*/
setNodeMarkup(e, n, r = null, i) {
return nP(this, e, n, r, i), this;
}
/**
Set a single attribute on a given node to a new value.
The `pos` addresses the document content. Use `setDocAttribute`
to set attributes on the document itself.
*/
setNodeAttribute(e, n, r) {
return this.step(new ka(e, n, r)), this;
}
/**
Set a single attribute on the document to a new value.
*/
setDocAttribute(e, n) {
return this.step(new iu(e, n)), this;
}
/**
Add a mark to the node at position `pos`.
*/
addNodeMark(e, n) {
return this.step(new $i(e, n)), this;
}
/**
Remove a mark (or a mark of the given type) from the node at
position `pos`.
*/
removeNodeMark(e, n) {
if (!(n instanceof kt)) {
let r = this.doc.nodeAt(e);
if (!r)
throw new RangeError("No node at position " + e);
if (n = n.isInSet(r.marks), !n)
return this;
}
return this.step(new ja(e, n)), this;
}
/**
Split the node at the given position, and optionally, if `depth` is
greater than one, any number of nodes above that. By default, the
parts split off will inherit the node type of the original node.
This can be changed by passing an array of types and attributes to
use after the split.
*/
split(e, n = 1, r) {
return rP(this, e, n, r), this;
}
/**
Add the given mark to the inline content between `from` and `to`.
*/
addMark(e, n, r) {
return WN(this, e, n, r), this;
}
/**
Remove marks from inline nodes between `from` and `to`. When
`mark` is a single mark, remove precisely that mark. When it is
a mark type, remove all marks of that type. When it is null,
remove all marks of any type.
*/
removeMark(e, n, r) {
return YN(this, e, n, r), this;
}
/**
Removes all marks and nodes from the content of the node at
`pos` that don't match the given new parent node type. Accepts
an optional starting [content match](https://prosemirror.net/docs/ref/#model.ContentMatch) as
third argument.
*/
clearIncompatible(e, n, r) {
return KN(this, e, n, r), this;
}
}
const ff = /* @__PURE__ */ Object.create(null);
class Je {
/**
Initialize a selection with the head and anchor and ranges. If no
ranges are given, constructs a single range across `$anchor` and
`$head`.
*/
constructor(e, n, r) {
this.$anchor = e, this.$head = n, this.ranges = r || [new fP(e.min(n), e.max(n))];
}
/**
The selection's anchor, as an unresolved position.
*/
get anchor() {
return this.$anchor.pos;
}
/**
The selection's head.
*/
get head() {
return this.$head.pos;
}
/**
The lower bound of the selection's main range.
*/
get from() {
return this.$from.pos;
}
/**
The upper bound of the selection's main range.
*/
get to() {
return this.$to.pos;
}
/**
The resolved lower bound of the selection's main range.
*/
get $from() {
return this.ranges[0].$from;
}
/**
The resolved upper bound of the selection's main range.
*/
get $to() {
return this.ranges[0].$to;
}
/**
Indicates whether the selection contains any content.
*/
get empty() {
let e = this.ranges;
for (let n = 0; n < e.length; n++)
if (e[n].$from.pos != e[n].$to.pos)
return !1;
return !0;
}
/**
Get the content of this selection as a slice.
*/
content() {
return this.$from.doc.slice(this.from, this.to, !0);
}
/**
Replace the selection with a slice or, if no slice is given,
delete the selection. Will append to the given transaction.
*/
replace(e, n = Te.empty) {
let r = n.content.lastChild, i = null;
for (let s = 0; s < n.openEnd; s++)
i = r, r = r.lastChild;
let o = e.steps.length, a = this.ranges;
for (let s = 0; s < a.length; s++) {
let { $from: u, $to: l } = a[s], c = e.mapping.slice(o);
e.replaceRange(c.map(u.pos), c.map(l.pos), s ? Te.empty : n), s == 0 && yg(e, o, (r ? r.isInline : i && i.isTextblock) ? -1 : 1);
}
}
/**
Replace the selection with the given node, appending the changes
to the given transaction.
*/
replaceWith(e, n) {
let r = e.steps.length, i = this.ranges;
for (let o = 0; o < i.length; o++) {
let { $from: a, $to: s } = i[o], u = e.mapping.slice(r), l = u.map(a.pos), c = u.map(s.pos);
o ? e.deleteRange(l, c) : (e.replaceRangeWith(l, c, n), yg(e, r, n.isInline ? -1 : 1));
}
}
/**
Find a valid cursor or leaf node selection starting at the given
position and searching back if `dir` is negative, and forward if
positive. When `textOnly` is true, only consider cursor
selections. Will return null when no valid selection position is
found.
*/
static findFrom(e, n, r = !1) {
let i = e.parent.inlineContent ? new Ye(e) : oa(e.node(0), e.parent, e.pos, e.index(), n, r);
if (i)
return i;
for (let o = e.depth - 1; o >= 0; o--) {
let a = n < 0 ? oa(e.node(0), e.node(o), e.before(o + 1), e.index(o), n, r) : oa(e.node(0), e.node(o), e.after(o + 1), e.index(o) + 1, n, r);
if (a)
return a;
}
return null;
}
/**
Find a valid cursor or leaf node selection near the given
position. Searches forward first by default, but if `bias` is
negative, it will search backwards first.
*/
static near(e, n = 1) {
return this.findFrom(e, n) || this.findFrom(e, -n) || new wr(e.node(0));
}
/**
Find the cursor or leaf node selection closest to the start of
the given document. Will return an
[`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position
exists.
*/
static atStart(e) {
return oa(e, e, 0, 0, 1) || new wr(e);
}
/**
Find the cursor or leaf node selection closest to the end of the
given document.
*/
static atEnd(e) {
return oa(e, e, e.content.size, e.childCount, -1) || new wr(e);
}
/**
Deserialize the JSON representation of a selection. Must be
implemented for custom classes (as a static class method).
*/
static fromJSON(e, n) {
if (!n || !n.type)
throw new RangeError("Invalid input for Selection.fromJSON");
let r = ff[n.type];
if (!r)
throw new RangeError(`No selection type ${n.type} defined`);
return r.fromJSON(e, n);
}
/**
To be able to deserialize selections from JSON, custom selection
classes must register themselves with an ID string, so that they
can be disambiguated. Try to pick something that's unlikely to
clash with classes from other modules.
*/
static jsonID(e, n) {
if (e in ff)
throw new RangeError("Duplicate use of selection JSON ID " + e);
return ff[e] = n, n.prototype.jsonID = e, n;
}
/**
Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
which is a value that can be mapped without having access to a
current document, and later resolved to a real selection for a
given document again. (This is used mostly by the history to
track and restore old selections.) The default implementation of
this method just converts the selection to a text selection and
returns the bookmark for that.
*/
getBookmark() {
return Ye.between(this.$anchor, this.$head).getBookmark();
}
}
Je.prototype.visible = !0;
class fP {
/**
Create a range.
*/
constructor(e, n) {
this.$from = e, this.$to = n;
}
}
let bg = !1;
function vg(t) {
!bg && !t.parent.inlineContent && (bg = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + t.parent.type.name + ")"));
}
class Ye extends Je {
/**
Construct a text selection between the given points.
*/
constructor(e, n = e) {
vg(e), vg(n), super(e, n);
}
/**
Returns a resolved position if this is a cursor selection (an
empty text selection), and null otherwise.
*/
get $cursor() {
return this.$anchor.pos == this.$head.pos ? this.$head : null;
}
map(e, n) {
let r = e.resolve(n.map(this.head));
if (!r.parent.inlineContent)
return Je.near(r);
let i = e.resolve(n.map(this.anchor));
return new Ye(i.parent.inlineContent ? i : r, r);
}
replace(e, n = Te.empty) {
if (super.replace(e, n), n == Te.empty) {
let r = this.$from.marksAcross(this.$to);
r && e.ensureMarks(r);
}
}
eq(e) {
return e instanceof Ye && e.anchor == this.anchor && e.head == this.head;
}
getBookmark() {
return new ud(this.anchor, this.head);
}
toJSON() {
return { type: "text", anchor: this.anchor, head: this.head };
}
/**
@internal
*/
static fromJSON(e, n) {
if (typeof n.anchor != "number" || typeof n.head != "number")
throw new RangeError("Invalid input for TextSelection.fromJSON");
return new Ye(e.resolve(n.anchor), e.resolve(n.head));
}
/**
Create a text selection from non-resolved positions.
*/
static create(e, n, r = n) {
let i = e.resolve(n);
return new this(i, r == n ? i : e.resolve(r));
}
/**
Return a text selection that spans the given positions or, if
they aren't text positions, find a text selection near them.
`bias` determines whether the method searches forward (default)
or backwards (negative number) first. Will fall back to calling
[`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document
doesn't contain a valid text position.
*/
static between(e, n, r) {
let i = e.pos - n.pos;
if ((!r || i) && (r = i >= 0 ? 1 : -1), !n.parent.inlineContent) {
let o = Je.findFrom(n, r, !0) || Je.findFrom(n, -r, !0);
if (o)
n = o.$head;
else
return Je.near(n, r);
}
return e.parent.inlineContent || (i == 0 ? e = n : (e = (Je.findFrom(e, -r, !0) || Je.findFrom(e, r, !0)).$anchor, e.pos < n.pos != i < 0 && (e = n))), new Ye(e, n);
}
}
Je.jsonID("text", Ye);
class ud {
constructor(e, n) {
this.anchor = e, this.head = n;
}
map(e) {
return new ud(e.map(this.anchor), e.map(this.head));
}
resolve(e) {
return Ye.between(e.resolve(this.anchor), e.resolve(this.head));
}
}
class Ve extends Je {
/**
Create a node selection. Does not verify the validity of its
argument.
*/
constructor(e) {
let n = e.nodeAfter, r = e.node(0).resolve(e.pos + n.nodeSize);
super(e, r), this.node = n;
}
map(e, n) {
let { deleted: r, pos: i } = n.mapResult(this.anchor), o = e.resolve(i);
return r ? Je.near(o) : new Ve(o);
}
content() {
return new Te(me.from(this.node), 0, 0);
}
eq(e) {
return e instanceof Ve && e.anchor == this.anchor;
}
toJSON() {
return { type: "node", anchor: this.anchor };
}
getBookmark() {
return new fh(this.anchor);
}
/**
@internal
*/
static fromJSON(e, n) {
if (typeof n.anchor != "number")
throw new RangeError("Invalid input for NodeSelection.fromJSON");
return new Ve(e.resolve(n.anchor));
}
/**
Create a node selection from non-resolved positions.
*/
static create(e, n) {
return new Ve(e.resolve(n));
}
/**
Determines whether the given node may be selected as a node
selection.
*/
static isSelectable(e) {
return !e.isText && e.type.spec.selectable !== !1;
}
}
Ve.prototype.visible = !1;
Je.jsonID("node", Ve);
class fh {
constructor(e) {
this.anchor = e;
}
map(e) {
let { deleted: n, pos: r } = e.mapResult(this.anchor);
return n ? new ud(r, r) : new fh(r);
}
resolve(e) {
let n = e.resolve(this.anchor), r = n.nodeAfter;
return r && Ve.isSelectable(r) ? new Ve(n) : Je.near(n);
}
}
class wr extends Je {
/**
Create an all-selection over the given document.
*/
constructor(e) {
super(e.resolve(0), e.resolve(e.content.size));
}
replace(e, n = Te.empty) {
if (n == Te.empty) {
e.delete(0, e.doc.content.size);
let r = Je.atStart(e.doc);
r.eq(e.selection) || e.setSelection(r);
} else
super.replace(e, n);
}
toJSON() {
return { type: "all" };
}
/**
@internal
*/
static fromJSON(e) {
return new wr(e);
}
map(e) {
return new wr(e);
}
eq(e) {
return e instanceof wr;
}
getBookmark() {
return pP;
}
}
Je.jsonID("all", wr);
const pP = {
map() {
return this;
},
resolve(t) {
return new wr(t);
}
};
function oa(t, e, n, r, i, o = !1) {
if (e.inlineContent)
return Ye.create(t, n);
for (let a = r - (i > 0 ? 0 : 1); i > 0 ? a < e.childCount : a >= 0; a += i) {
let s = e.child(a);
if (s.isAtom) {
if (!o && Ve.isSelectable(s))
return Ve.create(t, n - (i < 0 ? s.nodeSize : 0));
} else {
let u = oa(t, s, n + i, i < 0 ? s.childCount : 0, i, o);
if (u)
return u;
}
n += s.nodeSize * i;
}
return null;
}
function yg(t, e, n) {
let r = t.steps.length - 1;
if (r < e)
return;
let i = t.steps[r];
if (!(i instanceof nn || i instanceof Gt))
return;
let o = t.mapping.maps[r], a;
o.forEach((s, u, l, c) => {
a == null && (a = c);
}), t.setSelection(Je.near(t.doc.resolve(a), n));
}
const wg = 1, Yu = 2, kg = 4;
class hP extends tw {
/**
@internal
*/
constructor(e) {
super(e.doc), this.curSelectionFor = 0, this.updated = 0, this.meta = /* @__PURE__ */ Object.create(null), this.time = Date.now(), this.curSelection = e.selection, this.storedMarks = e.storedMarks;
}
/**
The transaction's current selection. This defaults to the editor
selection [mapped](https://prosemirror.net/docs/ref/#state.Selection.map) through the steps in the
transaction, but can be overwritten with
[`setSelection`](https://prosemirror.net/docs/ref/#state.Transaction.setSelection).
*/
get selection() {
return this.curSelectionFor < this.steps.length && (this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor)), this.curSelectionFor = this.steps.length), this.curSelection;
}
/**
Update the transaction's current selection. Will determine the
selection that the editor gets when the transaction is applied.
*/
setSelection(e) {
if (e.$from.doc != this.doc)
throw new RangeError("Selection passed to setSelection must point at the current document");
return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | wg) & ~Yu, this.storedMarks = null, this;
}
/**
Whether the selection was explicitly updated by this transaction.
*/
get selectionSet() {
return (this.updated & wg) > 0;
}
/**
Set the current stored marks.
*/
setStoredMarks(e) {
return this.storedMarks = e, this.updated |= Yu, this;
}
/**
Make sure the current stored marks or, if that is null, the marks
at the selection, match the given set of marks. Does nothing if
this is already the case.
*/
ensureMarks(e) {
return kt.sameSet(this.storedMarks || this.selection.$from.marks(), e) || this.setStoredMarks(e), this;
}
/**
Add a mark to the set of stored marks.
*/
addStoredMark(e) {
return this.ensureMarks(e.addToSet(this.storedMarks || this.selection.$head.marks()));
}
/**
Remove a mark or mark type from the set of stored marks.
*/
removeStoredMark(e) {
return this.ensureMarks(e.removeFromSet(this.storedMarks || this.selection.$head.marks()));
}
/**
Whether the stored marks were explicitly set for this transaction.
*/
get storedMarksSet() {
return (this.updated & Yu) > 0;
}
/**
@internal
*/
addStep(e, n) {
super.addStep(e, n), this.updated = this.updated & ~Yu, this.storedMarks = null;
}
/**
Update the timestamp for the transaction.
*/
setTime(e) {
return this.time = e, this;
}
/**
Replace the current selection with the given slice.
*/
replaceSelection(e) {
return this.selection.replace(this, e), this;
}
/**
Replace the selection with the given node. When `inheritMarks` is
true and the content is inline, it inherits the marks from the
place where it is inserted.
*/
replaceSelectionWith(e, n = !0) {
let r = this.selection;
return n && (e = e.mark(this.storedMarks || (r.empty ? r.$from.marks() : r.$from.marksAcross(r.$to) || kt.none))), r.replaceWith(this, e), this;
}
/**
Delete the selection.
*/
deleteSelection() {
return this.selection.replace(this), this;
}
/**
Replace the given range, or the selection if no range is given,
with a text node containing the given string.
*/
insertText(e, n, r) {
let i = this.doc.type.schema;
if (n == null)
return e ? this.replaceSelectionWith(i.text(e), !0) : this.deleteSelection();
{
if (r == null && (r = n), r = r ?? n, !e)
return this.deleteRange(n, r);
let o = this.storedMarks;
if (!o) {
let a = this.doc.resolve(n);
o = r == n ? a.marks() : a.marksAcross(this.doc.resolve(r));
}
return this.replaceRangeWith(n, r, i.text(e, o)), this.selection.empty || this.setSelection(Je.near(this.selection.$to)), this;
}
}
/**
Store a metadata property in this transaction, keyed either by
name or by plugin.
*/
setMeta(e, n) {
return this.meta[typeof e == "string" ? e : e.key] = n, this;
}
/**
Retrieve a metadata property for a given name or plugin.
*/
getMeta(e) {
return this.meta[typeof e == "string" ? e : e.key];
}
/**
Returns true if this transaction doesn't contain any metadata,
and can thus safely be extended.
*/
get isGeneric() {
for (let e in this.meta)
return !1;
return !0;
}
/**
Indicate that the editor should scroll the selection into view
when updated to the state produced by this transaction.
*/
scrollIntoView() {
return this.updated |= kg, this;
}
/**
True when this transaction has had `scrollIntoView` called on it.
*/
get scrolledIntoView() {
return (this.updated & kg) > 0;
}
}
function xg(t, e) {
return !e || !t ? t : t.bind(e);
}
class ms {
constructor(e, n, r) {
this.name = e, this.init = xg(n.init, r), this.apply = xg(n.apply, r);
}
}
const mP = [
new ms("doc", {
init(t) {
return t.doc || t.schema.topNodeType.createAndFill();
},
apply(t) {
return t.doc;
}
}),
new ms("selection", {
init(t, e) {
return t.selection || Je.atStart(e.doc);
},
apply(t) {
return t.selection;
}
}),
new ms("storedMarks", {
init(t) {
return t.storedMarks || null;
},
apply(t, e, n, r) {
return r.selection.$cursor ? t.storedMarks : null;
}
}),
new ms("scrollToSelection", {
init() {
return 0;
},
apply(t, e) {
return t.scrolledIntoView ? e + 1 : e;
}
})
];
class pf {
constructor(e, n) {
this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = mP.slice(), n && n.forEach((r) => {
if (this.pluginsByKey[r.key])
throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new ms(r.key, r.spec.state, r));
});
}
}
class ca {
/**
@internal
*/
constructor(e) {
this.config = e;
}
/**
The schema of the state's document.
*/
get schema() {
return this.config.schema;
}
/**
The plugins that are active in this state.
*/
get plugins() {
return this.config.plugins;
}
/**
Apply the given transaction to produce a new state.
*/
apply(e) {
return this.applyTransaction(e).state;
}
/**
@internal
*/
filterTransaction(e, n = -1) {
for (let r = 0; r < this.config.plugins.length; r++)
if (r != n) {
let i = this.config.plugins[r];
if (i.spec.filterTransaction && !i.spec.filterTransaction.call(i, e, this))
return !1;
}
return !0;
}
/**
Verbose variant of [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) that
returns the precise transactions that were applied (which might
be influenced by the [transaction
hooks](https://prosemirror.net/docs/ref/#state.PluginSpec.filterTransaction) of
plugins) along with the new state.
*/
applyTransaction(e) {
if (!this.filterTransaction(e))
return { state: this, transactions: [] };
let n = [e], r = this.applyInner(e), i = null;
for (; ; ) {
let o = !1;
for (let a = 0; a < this.config.plugins.length; a++) {
let s = this.config.plugins[a];
if (s.spec.appendTransaction) {
let u = i ? i[a].n : 0, l = i ? i[a].state : this, c = u < n.length && s.spec.appendTransaction.call(s, u ? n.slice(u) : n, l, r);
if (c && r.filterTransaction(c, a)) {
if (c.setMeta("appendedTransaction", e), !i) {
i = [];
for (let f = 0; f < this.config.plugins.length; f++)
i.push(f < a ? { state: r, n: n.length } : { state: this, n: 0 });
}
n.push(c), r = r.applyInner(c), o = !0;
}
i && (i[a] = { state: r, n: n.length });
}
}
if (!o)
return { state: r, transactions: n };
}
}
/**
@internal
*/
applyInner(e) {
if (!e.before.eq(this.doc))
throw new RangeError("Applying a mismatched transaction");
let n = new ca(this.config), r = this.config.fields;
for (let i = 0; i < r.length; i++) {
let o = r[i];
n[o.name] = o.apply(e, this[o.name], this, n);
}
return n;
}
/**
Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
*/
get tr() {
return new hP(this);
}
/**
Create a new state.
*/
static create(e) {
let n = new pf(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new ca(n);
for (let i = 0; i < n.fields.length; i++)
r[n.fields[i].name] = n.fields[i].init(e, r);
return r;
}
/**
Create a new state based on this one, but with an adjusted set
of active plugins. State fields that exist in both sets of
plugins are kept unchanged. Those that no longer exist are
dropped, and those that are new are initialized using their
[`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new
configuration object..
*/
reconfigure(e) {
let n = new pf(this.schema, e.plugins), r = n.fields, i = new ca(n);
for (let o = 0; o < r.length; o++) {
let a = r[o].name;
i[a] = this.hasOwnProperty(a) ? this[a] : r[o].init(e, i);
}
return i;
}
/**
Serialize this state to JSON. If you want to serialize the state
of plugins, pass an object mapping property names to use in the
resulting JSON object to plugin objects. The argument may also be
a string or number, in which case it is ignored, to support the
way `JSON.stringify` calls `toString` methods.
*/
toJSON(e) {
let n = { doc: this.doc.toJSON(), selection: this.selection.toJSON() };
if (this.storedMarks && (n.storedMarks = this.storedMarks.map((r) => r.toJSON())), e && typeof e == "object")
for (let r in e) {
if (r == "doc" || r == "selection")
throw new RangeError("The JSON fields `doc` and `selection` are reserved");
let i = e[r], o = i.spec.state;
o && o.toJSON && (n[r] = o.toJSON.call(i, this[i.key]));
}
return n;
}
/**
Deserialize a JSON representation of a state. `config` should
have at least a `schema` field, and should contain array of
plugins to initialize the state with. `pluginFields` can be used
to deserialize the state of plugins, by associating plugin
instances with the property names they use in the JSON object.
*/
static fromJSON(e, n, r) {
if (!n)
throw new RangeError("Invalid input for EditorState.fromJSON");
if (!e.schema)
throw new RangeError("Required config field 'schema' missing");
let i = new pf(e.schema, e.plugins), o = new ca(i);
return i.fields.forEach((a) => {
if (a.name == "doc")
o.doc = $o.fromJSON(e.schema, n.doc);
else if (a.name == "selection")
o.selection = Je.fromJSON(o.doc, n.selection);
else if (a.name == "storedMarks")
n.storedMarks && (o.storedMarks = n.storedMarks.map(e.schema.markFromJSON));
else {
if (r)
for (let s in r) {
let u = r[s], l = u.spec.state;
if (u.key == a.name && l && l.fromJSON && Object.prototype.hasOwnProperty.call(n, s)) {
o[a.name] = l.fromJSON.call(u, e, n[s], o);
return;
}
}
o[a.name] = a.init(e, o);
}
}), o;
}
}
function nw(t, e, n) {
for (let r in t) {
let i = t[r];
i instanceof Function ? i = i.bind(e) : r == "handleDOMEvents" && (i = nw(i, e, {})), n[r] = i;
}
return n;
}
class un {
/**
Create a plugin.
*/
constructor(e) {
this.spec = e, this.props = {}, e.props && nw(e.props, this, this.props), this.key = e.key ? e.key.key : rw("plugin");
}
/**
Extract the plugin's state field from an editor state.
*/
getState(e) {
return e[this.key];
}
}
const hf = /* @__PURE__ */ Object.create(null);
function rw(t) {
return t in hf ? t + "$" + ++hf[t] : (hf[t] = 0, t + "$");
}
class er {
/**
Create a plugin key.
*/
constructor(e = "key") {
this.key = rw(e);
}
/**
Get the active plugin with this key, if any, from an editor
state.
*/
get(e) {
return e.config.pluginsByKey[this.key];
}
/**
Get the plugin's state from an editor state.
*/
getState(e) {
return e[this.key];
}
}
const yn = function(t) {
for (var e = 0; ; e++)
if (t = t.previousSibling, !t)
return e;
}, ou = function(t) {
let e = t.assignedSlot || t.parentNode;
return e && e.nodeType == 11 ? e.host : e;
};
let Sg = null;
const ai = function(t, e, n) {
let r = Sg || (Sg = document.createRange());
return r.setEnd(t, n ?? t.nodeValue.length), r.setStart(t, e || 0), r;
}, zo = function(t, e, n, r) {
return n && (Eg(t, e, n, r, -1) || Eg(t, e, n, r, 1));
}, gP = /^(img|br|input|textarea|hr)$/i;
function Eg(t, e, n, r, i) {
for (; ; ) {
if (t == n && e == r)
return !0;
if (e == (i < 0 ? 0 : Pr(t))) {
let o = t.parentNode;
if (!o || o.nodeType != 1 || ph(t) || gP.test(t.nodeName) || t.contentEditable == "false")
return !1;
e = yn(t) + (i < 0 ? 0 : 1), t = o;
} else if (t.nodeType == 1) {
if (t = t.childNodes[e + (i < 0 ? -1 : 0)], t.contentEditable == "false")
return !1;
e = i < 0 ? Pr(t) : 0;
} else
return !1;
}
}
function Pr(t) {
return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
}
function bP(t, e, n) {
for (let r = e == 0, i = e == Pr(t); r || i; ) {
if (t == n)
return !0;
let o = yn(t);
if (t = t.parentNode, !t)
return !1;
r = r && o == 0, i = i && o == Pr(t);
}
}
function ph(t) {
let e;
for (let n = t; n && !(e = n.pmViewDesc); n = n.parentNode)
;
return e && e.node && e.node.isBlock && (e.dom == t || e.contentDOM == t);
}
const ld = function(t) {
return t.focusNode && zo(t.focusNode, t.focusOffset, t.anchorNode, t.anchorOffset);
};
function po(t, e) {
let n = document.createEvent("Event");
return n.initEvent("keydown", !0, !0), n.keyCode = t, n.key = n.code = e, n;
}
function vP(t) {
let e = t.activeElement;
for (; e && e.shadowRoot; )
e = e.shadowRoot.activeElement;
return e;
}
function yP(t, e, n) {
if (t.caretPositionFromPoint)
try {
let r = t.caretPositionFromPoint(e, n);
if (r)
return { node: r.offsetNode, offset: r.offset };
} catch {
}
if (t.caretRangeFromPoint) {
let r = t.caretRangeFromPoint(e, n);
if (r)
return { node: r.startContainer, offset: r.startOffset };
}
}
const Gr = typeof navigator < "u" ? navigator : null, _g = typeof document < "u" ? document : null, Qi = Gr && Gr.userAgent || "", P0 = /Edge\/(\d+)/.exec(Qi), iw = /MSIE \d/.exec(Qi), I0 = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qi), Bn = !!(iw || I0 || P0), Ii = iw ? document.documentMode : I0 ? +I0[1] : P0 ? +P0[1] : 0, kr = !Bn && /gecko\/(\d+)/i.test(Qi);
kr && +(/Firefox\/(\d+)/.exec(Qi) || [0, 0])[1];
const L0 = !Bn && /Chrome\/(\d+)/.exec(Qi), pn = !!L0, wP = L0 ? +L0[1] : 0, Tn = !Bn && !!Gr && /Apple Computer/.test(Gr.vendor), Wa = Tn && (/Mobile\/\w+/.test(Qi) || !!Gr && Gr.maxTouchPoints > 2), ar = Wa || (Gr ? /Mac/.test(Gr.platform) : !1), kP = Gr ? /Win/.test(Gr.platform) : !1, br = /Android \d/.test(Qi), Su = !!_g && "webkitFontSmoothing" in _g.documentElement.style, xP = Su ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
function SP(t) {
return {
left: 0,
right: t.documentElement.clientWidth,
top: 0,
bottom: t.documentElement.clientHeight
};
}
function ni(t, e) {
return typeof t == "number" ? t : t[e];
}
function EP(t) {
let e = t.getBoundingClientRect(), n = e.width / t.offsetWidth || 1, r = e.height / t.offsetHeight || 1;
return {
left: e.left,
right: e.left + t.clientWidth * n,
top: e.top,
bottom: e.top + t.clientHeight * r
};
}
function Tg(t, e, n) {
let r = t.someProp("scrollThreshold") || 0, i = t.someProp("scrollMargin") || 5, o = t.dom.ownerDocument;
for (let a = n || t.dom; a; a = ou(a)) {
if (a.nodeType != 1)
continue;
let s = a, u = s == o.body, l = u ? SP(o) : EP(s), c = 0, f = 0;
if (e.top < l.top + ni(r, "top") ? f = -(l.top - e.top + ni(i, "top")) : e.bottom > l.bottom - ni(r, "bottom") && (f = e.bottom - e.top > l.bottom - l.top ? e.top + ni(i, "top") - l.top : e.bottom - l.bottom + ni(i, "bottom")), e.left < l.left + ni(r, "left") ? c = -(l.left - e.left + ni(i, "left")) : e.right > l.right - ni(r, "right") && (c = e.right - l.right + ni(i, "right")), c || f)
if (u)
o.defaultView.scrollBy(c, f);
else {
let d = s.scrollLeft, p = s.scrollTop;
f && (s.scrollTop += f), c && (s.scrollLeft += c);
let h = s.scrollLeft - d, m = s.scrollTop - p;
e = { left: e.left - h, top: e.top - m, right: e.right - h, bottom: e.bottom - m };
}
if (u || /^(fixed|sticky)$/.test(getComputedStyle(a).position))
break;
}
}
function _P(t) {
let e = t.dom.getBoundingClientRect(), n = Math.max(0, e.top), r, i;
for (let o = (e.left + e.right) / 2, a = n + 1; a < Math.min(innerHeight, e.bottom); a += 5) {
let s = t.root.elementFromPoint(o, a);
if (!s || s == t.dom || !t.dom.contains(s))
continue;
let u = s.getBoundingClientRect();
if (u.top >= n - 20) {
r = s, i = u.top;
break;
}
}
return { refDOM: r, refTop: i, stack: ow(t.dom) };
}
function ow(t) {
let e = [], n = t.ownerDocument;
for (let r = t; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), t != n); r = ou(r))
;
return e;
}
function TP({ refDOM: t, refTop: e, stack: n }) {
let r = t ? t.getBoundingClientRect().top : 0;
aw(n, r == 0 ? 0 : r - e);
}
function aw(t, e) {
for (let n = 0; n < t.length; n++) {
let { dom: r, top: i, left: o } = t[n];
r.scrollTop != i + e && (r.scrollTop = i + e), r.scrollLeft != o && (r.scrollLeft = o);
}
}
let ea = null;
function CP(t) {
if (t.setActive)
return t.setActive();
if (ea)
return t.focus(ea);
let e = ow(t);
t.focus(ea == null ? {
get preventScroll() {
return ea = { preventScroll: !0 }, !0;
}
} : void 0), ea || (ea = !1, aw(e, 0));
}
function sw(t, e) {
let n, r = 2e8, i, o = 0, a = e.top, s = e.top, u, l;
for (let c = t.firstChild, f = 0; c; c = c.nextSibling, f++) {
let d;
if (c.nodeType == 1)
d = c.getClientRects();
else if (c.nodeType == 3)
d = ai(c).getClientRects();
else
continue;
for (let p = 0; p < d.length; p++) {
let h = d[p];
if (h.top <= a && h.bottom >= s) {
a = Math.max(h.bottom, a), s = Math.min(h.top, s);
let m = h.left > e.left ? h.left - e.left : h.right < e.left ? e.left - h.right : 0;
if (m < r) {
n = c, r = m, i = m && n.nodeType == 3 ? {
left: h.right < e.left ? h.right : h.left,
top: e.top
} : e, c.nodeType == 1 && m && (o = f + (e.left >= (h.left + h.right) / 2 ? 1 : 0));
continue;
}
} else
h.top > e.top && !u && h.left <= e.left && h.right >= e.left && (u = c, l = { left: Math.max(h.left, Math.min(h.right, e.left)), top: h.top });
!n && (e.left >= h.right && e.top >= h.top || e.left >= h.left && e.top >= h.bottom) && (o = f + 1);
}
}
return !n && u && (n = u, i = l, r = 0), n && n.nodeType == 3 ? OP(n, i) : !n || r && n.nodeType == 1 ? { node: t, offset: o } : sw(n, i);
}
function OP(t, e) {
let n = t.nodeValue.length, r = document.createRange();
for (let i = 0; i < n; i++) {
r.setEnd(t, i + 1), r.setStart(t, i);
let o = wi(r, 1);
if (o.top != o.bottom && hh(e, o))
return { node: t, offset: i + (e.left >= (o.left + o.right) / 2 ? 1 : 0) };
}
return { node: t, offset: 0 };
}
function hh(t, e) {
return t.left >= e.left - 1 && t.left <= e.right + 1 && t.top >= e.top - 1 && t.top <= e.bottom + 1;
}
function AP(t, e) {
let n = t.parentNode;
return n && /^li$/i.test(n.nodeName) && e.left < t.getBoundingClientRect().left ? n : t;
}
function MP(t, e, n) {
let { node: r, offset: i } = sw(e, n), o = -1;
if (r.nodeType == 1 && !r.firstChild) {
let a = r.getBoundingClientRect();
o = a.left != a.right && n.left > (a.left + a.right) / 2 ? 1 : -1;
}
return t.docView.posFromDOM(r, i, o);
}
function DP(t, e, n, r) {
let i = -1;
for (let o = e, a = !1; o != t.dom; ) {
let s = t.docView.nearestDesc(o, !0);
if (!s)
return null;
if (s.dom.nodeType == 1 && (s.node.isBlock && s.parent && !a || !s.contentDOM)) {
let u = s.dom.getBoundingClientRect();
if (s.node.isBlock && s.parent && !a && (a = !0, u.left > r.left || u.top > r.top ? i = s.posBefore : (u.right < r.left || u.bottom < r.top) && (i = s.posAfter)), !s.contentDOM && i < 0 && !s.node.isText)
return (s.node.isBlock ? r.top < (u.top + u.bottom) / 2 : r.left < (u.left + u.right) / 2) ? s.posBefore : s.posAfter;
}
o = s.dom.parentNode;
}
return i > -1 ? i : t.docView.posFromDOM(e, n, -1);
}
function uw(t, e, n) {
let r = t.childNodes.length;
if (r && n.top < n.bottom)
for (let i = Math.max(0, Math.min(r - 1, Math.floor(r * (e.top - n.top) / (n.bottom - n.top)) - 2)), o = i; ; ) {
let a = t.childNodes[o];
if (a.nodeType == 1) {
let s = a.getClientRects();
for (let u = 0; u < s.length; u++) {
let l = s[u];
if (hh(e, l))
return uw(a, e, l);
}
}
if ((o = (o + 1) % r) == i)
break;
}
return t;
}
function $P(t, e) {
let n = t.dom.ownerDocument, r, i = 0, o = yP(n, e.left, e.top);
o && ({ node: r, offset: i } = o);
let a = (t.root.elementFromPoint ? t.root : n).elementFromPoint(e.left, e.top), s;
if (!a || !t.dom.contains(a.nodeType != 1 ? a.parentNode : a)) {
let l = t.dom.getBoundingClientRect();
if (!hh(e, l) || (a = uw(t.dom, e, l), !a))
return null;
}
if (Tn)
for (let l = a; r && l; l = ou(l))
l.draggable && (r = void 0);
if (a = AP(a, e), r) {
if (kr && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
let c = r.childNodes[i], f;
c.nodeName == "IMG" && (f = c.getBoundingClientRect()).right <= e.left && f.bottom > e.top && i++;
}
let l;
Su && i && r.nodeType == 1 && (l = r.childNodes[i - 1]).nodeType == 1 && l.contentEditable == "false" && l.getBoundingClientRect().top >= e.top && i--, r == t.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? s = t.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (s = DP(t, r, i, e));
}
s == null && (s = MP(t, a, e));
let u = t.docView.nearestDesc(a, !0);
return { pos: s, inside: u ? u.posAtStart - u.border : -1 };
}
function Cg(t) {
return t.top < t.bottom || t.left < t.right;
}
function wi(t, e) {
let n = t.getClientRects();
if (n.length) {
let r = n[e < 0 ? 0 : n.length - 1];
if (Cg(r))
return r;
}
return Array.prototype.find.call(n, Cg) || t.getBoundingClientRect();
}
const NP = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
function lw(t, e, n) {
let { node: r, offset: i, atom: o } = t.docView.domFromPos(e, n < 0 ? -1 : 1), a = Su || kr;
if (r.nodeType == 3)
if (a && (NP.test(r.nodeValue) || (n < 0 ? !i : i == r.nodeValue.length))) {
let u = wi(ai(r, i, i), n);
if (kr && i && /\s/.test(r.nodeValue[i - 1]) && i < r.nodeValue.length) {
let l = wi(ai(r, i - 1, i - 1), -1);
if (l.top == u.top) {
let c = wi(ai(r, i, i + 1), -1);
if (c.top != u.top)
return cs(c, c.left < l.left);
}
}
return u;
} else {
let u = i, l = i, c = n < 0 ? 1 : -1;
return n < 0 && !i ? (l++, c = -1) : n >= 0 && i == r.nodeValue.length ? (u--, c = 1) : n < 0 ? u-- : l++, cs(wi(ai(r, u, l), c), c < 0);
}
if (!t.state.doc.resolve(e - (o || 0)).parent.inlineContent) {
if (o == null && i && (n < 0 || i == Pr(r))) {
let u = r.childNodes[i - 1];
if (u.nodeType == 1)
return mf(u.getBoundingClientRect(), !1);
}
if (o == null && i < Pr(r)) {
let u = r.childNodes[i];
if (u.nodeType == 1)
return mf(u.getBoundingClientRect(), !0);
}
return mf(r.getBoundingClientRect(), n >= 0);
}
if (o == null && i && (n < 0 || i == Pr(r))) {
let u = r.childNodes[i - 1], l = u.nodeType == 3 ? ai(u, Pr(u) - (a ? 0 : 1)) : u.nodeType == 1 && (u.nodeName != "BR" || !u.nextSibling) ? u : null;
if (l)
return cs(wi(l, 1), !1);
}
if (o == null && i < Pr(r)) {
let u = r.childNodes[i];
for (; u.pmViewDesc && u.pmViewDesc.ignoreForCoords; )
u = u.nextSibling;
let l = u ? u.nodeType == 3 ? ai(u, 0, a ? 0 : 1) : u.nodeType == 1 ? u : null : null;
if (l)
return cs(wi(l, -1), !0);
}
return cs(wi(r.nodeType == 3 ? ai(r) : r, -n), n >= 0);
}
function cs(t, e) {
if (t.width == 0)
return t;
let n = e ? t.left : t.right;
return { top: t.top, bottom: t.bottom, left: n, right: n };
}
function mf(t, e) {
if (t.height == 0)
return t;
let n = e ? t.top : t.bottom;
return { top: n, bottom: n, left: t.left, right: t.right };
}
function cw(t, e, n) {
let r = t.state, i = t.root.activeElement;
r != e && t.updateState(e), i != t.dom && t.focus();
try {
return n();
} finally {
r != e && t.updateState(r), i != t.dom && i && i.focus();
}
}
function PP(t, e, n) {
let r = e.selection, i = n == "up" ? r.$from : r.$to;
return cw(t, e, () => {
let { node: o } = t.docView.domFromPos(i.pos, n == "up" ? -1 : 1);
for (; ; ) {
let s = t.docView.nearestDesc(o, !0);
if (!s)
break;
if (s.node.isBlock) {
o = s.contentDOM || s.dom;
break;
}
o = s.dom.parentNode;
}
let a = lw(t, i.pos, 1);
for (let s = o.firstChild; s; s = s.nextSibling) {
let u;
if (s.nodeType == 1)
u = s.getClientRects();
else if (s.nodeType == 3)
u = ai(s, 0, s.nodeValue.length).getClientRects();
else
continue;
for (let l = 0; l < u.length; l++) {
let c = u[l];
if (c.bottom > c.top + 1 && (n == "up" ? a.top - c.top > (c.bottom - a.top) * 2 : c.bottom - a.bottom > (a.bottom - c.top) * 2))
return !1;
}
}
return !0;
});
}
const IP = /[\u0590-\u08ac]/;
function LP(t, e, n) {
let { $head: r } = e.selection;
if (!r.parent.isTextblock)
return !1;
let i = r.parentOffset, o = !i, a = i == r.parent.content.size, s = t.domSelection();
return !IP.test(r.parent.textContent) || !s.modify ? n == "left" || n == "backward" ? o : a : cw(t, e, () => {
let { focusNode: u, focusOffset: l, anchorNode: c, anchorOffset: f } = t.domSelectionRange(), d = s.caretBidiLevel;
s.modify("move", n, "character");
let p = r.depth ? t.docView.domAfterPos(r.before()) : t.dom, { focusNode: h, focusOffset: m } = t.domSelectionRange(), v = h && !p.contains(h.nodeType == 1 ? h : h.parentNode) || u == h && l == m;
try {
s.collapse(c, f), u && (u != c || l != f) && s.extend && s.extend(u, l);
} catch {
}
return d != null && (s.caretBidiLevel = d), v;
});
}
let Og = null, Ag = null, Mg = !1;
function RP(t, e, n) {
return Og == e && Ag == n ? Mg : (Og = e, Ag = n, Mg = n == "up" || n == "down" ? PP(t, e, n) : LP(t, e, n));
}
const lr = 0, Dg = 1, wo = 2, Jr = 3;
class Eu {
constructor(e, n, r, i) {
this.parent = e, this.children = n, this.dom = r, this.contentDOM = i, this.dirty = lr, r.pmViewDesc = this;
}
// Used to check whether a given description corresponds to a
// widget/mark/node.
matchesWidget(e) {
return !1;
}
matchesMark(e) {
return !1;
}
matchesNode(e, n, r) {
return !1;
}
matchesHack(e) {
return !1;
}
// When parsing in-editor content (in domchange.js), we allow
// descriptions to determine the parse rules that should be used to
// parse them.
parseRule() {
return null;
}
// Used by the editor's event handler to ignore events that come
// from certain descs.
stopEvent(e) {
return !1;
}
// The size of the content represented by this desc.
get size() {
let e = 0;
for (let n = 0; n < this.children.length; n++)
e += this.children[n].size;
return e;
}
// For block nodes, this represents the space taken up by their
// start/end tokens.
get border() {
return 0;
}
destroy() {
this.parent = void 0, this.dom.pmViewDesc == this && (this.dom.pmViewDesc = void 0);
for (let e = 0; e < this.children.length; e++)
this.children[e].destroy();
}
posBeforeChild(e) {
for (let n = 0, r = this.posAtStart; ; n++) {
let i = this.children[n];
if (i == e)
return r;
r += i.size;
}
}
get posBefore() {
return this.parent.posBeforeChild(this);
}
get posAtStart() {
return this.parent ? this.parent.posBeforeChild(this) + this.border : 0;
}
get posAfter() {
return this.posBefore + this.size;
}
get posAtEnd() {
return this.posAtStart + this.size - 2 * this.border;
}
localPosFromDOM(e, n, r) {
if (this.contentDOM && this.contentDOM.contains(e.nodeType == 1 ? e : e.parentNode))
if (r < 0) {
let o, a;
if (e == this.contentDOM)
o = e.childNodes[n - 1];
else {
for (; e.parentNode != this.contentDOM; )
e = e.parentNode;
o = e.previousSibling;
}
for (; o && !((a = o.pmViewDesc) && a.parent == this); )
o = o.previousSibling;
return o ? this.posBeforeChild(a) + a.size : this.posAtStart;
} else {
let o, a;
if (e == this.contentDOM)
o = e.childNodes[n];
else {
for (; e.parentNode != this.contentDOM; )
e = e.parentNode;
o = e.nextSibling;
}
for (; o && !((a = o.pmViewDesc) && a.parent == this); )
o = o.nextSibling;
return o ? this.posBeforeChild(a) : this.posAtEnd;
}
let i;
if (e == this.dom && this.contentDOM)
i = n > yn(this.contentDOM);
else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM))
i = e.compareDocumentPosition(this.contentDOM) & 2;
else if (this.dom.firstChild) {
if (n == 0)
for (let o = e; ; o = o.parentNode) {
if (o == this.dom) {
i = !1;
break;
}
if (o.previousSibling)
break;
}
if (i == null && n == e.childNodes.length)
for (let o = e; ; o = o.parentNode) {
if (o == this.dom) {
i = !0;
break;
}
if (o.nextSibling)
break;
}
}
return i ?? r > 0 ? this.posAtEnd : this.posAtStart;
}
nearestDesc(e, n = !1) {
for (let r = !0, i = e; i; i = i.parentNode) {
let o = this.getDesc(i), a;
if (o && (!n || o.node))
if (r && (a = o.nodeDOM) && !(a.nodeType == 1 ? a.contains(e.nodeType == 1 ? e : e.parentNode) : a == e))
r = !1;
else
return o;
}
}
getDesc(e) {
let n = e.pmViewDesc;
for (let r = n; r; r = r.parent)
if (r == this)
return n;
}
posFromDOM(e, n, r) {
for (let i = e; i; i = i.parentNode) {
let o = this.getDesc(i);
if (o)
return o.localPosFromDOM(e, n, r);
}
return -1;
}
// Find the desc for the node after the given pos, if any. (When a
// parent node overrode rendering, there might not be one.)
descAt(e) {
for (let n = 0, r = 0; n < this.children.length; n++) {
let i = this.children[n], o = r + i.size;
if (r == e && o != r) {
for (; !i.border && i.children.length; )
i = i.children[0];
return i;
}
if (e < o)
return i.descAt(e - r - i.border);
r = o;
}
}
domFromPos(e, n) {
if (!this.contentDOM)
return { node: this.dom, offset: 0, atom: e + 1 };
let r = 0, i = 0;
for (let o = 0; r < this.children.length; r++) {
let a = this.children[r], s = o + a.size;
if (s > e || a instanceof fw) {
i = e - o;
break;
}
o = s;
}
if (i)
return this.children[r].domFromPos(i - this.children[r].border, n);
for (let o; r && !(o = this.children[r - 1]).size && o instanceof dw && o.side >= 0; r--)
;
if (n <= 0) {
let o, a = !0;
for (; o = r ? this.children[r - 1] : null, !(!o || o.dom.parentNode == this.contentDOM); r--, a = !1)
;
return o && n && a && !o.border && !o.domAtom ? o.domFromPos(o.size, n) : { node: this.contentDOM, offset: o ? yn(o.dom) + 1 : 0 };
} else {
let o, a = !0;
for (; o = r < this.children.length ? this.children[r] : null, !(!o || o.dom.parentNode == this.contentDOM); r++, a = !1)
;
return o && a && !o.border && !o.domAtom ? o.domFromPos(0, n) : { node: this.contentDOM, offset: o ? yn(o.dom) : this.contentDOM.childNodes.length };
}
}
// Used to find a DOM range in a single parent for a given changed
// range.
parseRange(e, n, r = 0) {
if (this.children.length == 0)
return { node: this.contentDOM, from: e, to: n, fromOffset: 0, toOffset: this.contentDOM.childNodes.length };
let i = -1, o = -1;
for (let a = r, s = 0; ; s++) {
let u = this.children[s], l = a + u.size;
if (i == -1 && e <= l) {
let c = a + u.border;
if (e >= c && n <= l - u.border && u.node && u.contentDOM && this.contentDOM.contains(u.contentDOM))
return u.parseRange(e, n, c);
e = a;
for (let f = s; f > 0; f--) {
let d = this.children[f - 1];
if (d.size && d.dom.parentNode == this.contentDOM && !d.emptyChildAt(1)) {
i = yn(d.dom) + 1;
break;
}
e -= d.size;
}
i == -1 && (i = 0);
}
if (i > -1 && (l > n || s == this.children.length - 1)) {
n = l;
for (let c = s + 1; c < this.children.length; c++) {
let f = this.children[c];
if (f.size && f.dom.parentNode == this.contentDOM && !f.emptyChildAt(-1)) {
o = yn(f.dom);
break;
}
n += f.size;
}
o == -1 && (o = this.contentDOM.childNodes.length);
break;
}
a = l;
}
return { node: this.contentDOM, from: e, to: n, fromOffset: i, toOffset: o };
}
emptyChildAt(e) {
if (this.border || !this.contentDOM || !this.children.length)
return !1;
let n = this.children[e < 0 ? 0 : this.children.length - 1];
return n.size == 0 || n.emptyChildAt(e);
}
domAfterPos(e) {
let { node: n, offset: r } = this.domFromPos(e, 0);
if (n.nodeType != 1 || r == n.childNodes.length)
throw new RangeError("No node after pos " + e);
return n.childNodes[r];
}
// View descs are responsible for setting any selection that falls
// entirely inside of them, so that custom implementations can do
// custom things with the selection. Note that this falls apart when
// a selection starts in such a node and ends in another, in which
// case we just use whatever domFromPos produces as a best effort.
setSelection(e, n, r, i = !1) {
let o = Math.min(e, n), a = Math.max(e, n);
for (let d = 0, p = 0; d < this.children.length; d++) {
let h = this.children[d], m = p + h.size;
if (o > p && a < m)
return h.setSelection(e - p - h.border, n - p - h.border, r, i);
p = m;
}
let s = this.domFromPos(e, e ? -1 : 1), u = n == e ? s : this.domFromPos(n, n ? -1 : 1), l = r.getSelection(), c = !1;
if ((kr || Tn) && e == n) {
let { node: d, offset: p } = s;
if (d.nodeType == 3) {
if (c = !!(p && d.nodeValue[p - 1] == `
`), c && p == d.nodeValue.length)
for (let h = d, m; h; h = h.parentNode) {
if (m = h.nextSibling) {
m.nodeName == "BR" && (s = u = { node: m.parentNode, offset: yn(m) + 1 });
break;
}
let v = h.pmViewDesc;
if (v && v.node && v.node.isBlock)
break;
}
} else {
let h = d.childNodes[p - 1];
c = h && (h.nodeName == "BR" || h.contentEditable == "false");
}
}
if (kr && l.focusNode && l.focusNode != u.node && l.focusNode.nodeType == 1) {
let d = l.focusNode.childNodes[l.focusOffset];
d && d.contentEditable == "false" && (i = !0);
}
if (!(i || c && Tn) && zo(s.node, s.offset, l.anchorNode, l.anchorOffset) && zo(u.node, u.offset, l.focusNode, l.focusOffset))
return;
let f = !1;
if ((l.extend || e == n) && !c) {
l.collapse(s.node, s.offset);
try {
e != n && l.extend(u.node, u.offset), f = !0;
} catch {
}
}
if (!f) {
if (e > n) {
let p = s;
s = u, u = p;
}
let d = document.createRange();
d.setEnd(u.node, u.offset), d.setStart(s.node, s.offset), l.removeAllRanges(), l.addRange(d);
}
}
ignoreMutation(e) {
return !this.contentDOM && e.type != "selection";
}
get contentLost() {
return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM);
}
// Remove a subtree of the element tree that has been touched
// by a DOM change, so that the next update will redraw it.
markDirty(e, n) {
for (let r = 0, i = 0; i < this.children.length; i++) {
let o = this.children[i], a = r + o.size;
if (r == a ? e <= a && n >= r : e < a && n > r) {
let s = r + o.border, u = a - o.border;
if (e >= s && n <= u) {
this.dirty = e == r || n == a ? wo : Dg, e == s && n == u && (o.contentLost || o.dom.parentNode != this.contentDOM) ? o.dirty = Jr : o.markDirty(e - s, n - s);
return;
} else
o.dirty = o.dom == o.contentDOM && o.dom.parentNode == this.contentDOM && !o.children.length ? wo : Jr;
}
r = a;
}
this.dirty = wo;
}
markParentsDirty() {
let e = 1;
for (let n = this.parent; n; n = n.parent, e++) {
let r = e == 1 ? wo : Dg;
n.dirty < r && (n.dirty = r);
}
}
get domAtom() {
return !1;
}
get ignoreForCoords() {
return !1;
}
}
class dw extends Eu {
constructor(e, n, r, i) {
let o, a = n.type.toDOM;
if (typeof a == "function" && (a = a(r, () => {
if (!o)
return i;
if (o.parent)
return o.parent.posBeforeChild(o);
})), !n.type.spec.raw) {
if (a.nodeType != 1) {
let s = document.createElement("span");
s.appendChild(a), a = s;
}
a.contentEditable = "false", a.classList.add("ProseMirror-widget");
}
super(e, [], a, null), this.widget = n, this.widget = n, o = this;
}
matchesWidget(e) {
return this.dirty == lr && e.type.eq(this.widget.type);
}
parseRule() {
return { ignore: !0 };
}
stopEvent(e) {
let n = this.widget.spec.stopEvent;
return n ? n(e) : !1;
}
ignoreMutation(e) {
return e.type != "selection" || this.widget.spec.ignoreSelection;
}
destroy() {
this.widget.type.destroy(this.dom), super.destroy();
}
get domAtom() {
return !0;
}
get side() {
return this.widget.type.side;
}
}
class BP extends Eu {
constructor(e, n, r, i) {
super(e, [], n, null), this.textDOM = r, this.text = i;
}
get size() {
return this.text.length;
}
localPosFromDOM(e, n) {
return e != this.textDOM ? this.posAtStart + (n ? this.size : 0) : this.posAtStart + n;
}
domFromPos(e) {
return { node: this.textDOM, offset: e };
}
ignoreMutation(e) {
return e.type === "characterData" && e.target.nodeValue == e.oldValue;
}
}
class Ho extends Eu {
constructor(e, n, r, i) {
super(e, [], r, i), this.mark = n;
}
static create(e, n, r, i) {
let o = i.nodeViews[n.type.name], a = o && o(n, i, r);
return (!a || !a.dom) && (a = Lr.renderSpec(document, n.type.spec.toDOM(n, r))), new Ho(e, n, a.dom, a.contentDOM || a.dom);
}
parseRule() {
return this.dirty & Jr || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
}
matchesMark(e) {
return this.dirty != Jr && this.mark.eq(e);
}
markDirty(e, n) {
if (super.markDirty(e, n), this.dirty != lr) {
let r = this.parent;
for (; !r.node; )
r = r.parent;
r.dirty < this.dirty && (r.dirty = this.dirty), this.dirty = lr;
}
}
slice(e, n, r) {
let i = Ho.create(this.parent, this.mark, !0, r), o = this.children, a = this.size;
n < a && (o = V0(o, n, a, r)), e > 0 && (o = V0(o, 0, e, r));
for (let s = 0; s < o.length; s++)
o[s].parent = i;
return i.children = o, i;
}
}
class Li extends Eu {
constructor(e, n, r, i, o, a, s, u, l) {
super(e, [], o, a), this.node = n, this.outerDeco = r, this.innerDeco = i, this.nodeDOM = s;
}
// By default, a node is rendered using the `toDOM` method from the
// node type spec. But client code can use the `nodeViews` spec to
// supply a custom node view, which can influence various aspects of
// the way the node works.
//
// (Using subclassing for this was intentionally decided against,
// since it'd require exposing a whole slew of finicky
// implementation details to the user code that they probably will
// never need.)
static create(e, n, r, i, o, a) {
let s = o.nodeViews[n.type.name], u, l = s && s(n, o, () => {
if (!u)
return a;
if (u.parent)
return u.parent.posBeforeChild(u);
}, r, i), c = l && l.dom, f = l && l.contentDOM;
if (n.isText) {
if (!c)
c = document.createTextNode(n.text);
else if (c.nodeType != 3)
throw new RangeError("Text must be rendered as a DOM text node");
} else
c || ({ dom: c, contentDOM: f } = Lr.renderSpec(document, n.type.spec.toDOM(n)));
!f && !n.isText && c.nodeName != "BR" && (c.hasAttribute("contenteditable") || (c.contentEditable = "false"), n.type.spec.draggable && (c.draggable = !0));
let d = c;
return c = mw(c, r, n), l ? u = new VP(e, n, r, i, c, f || null, d, l, o, a + 1) : n.isText ? new cd(e, n, r, i, c, d, o) : new Li(e, n, r, i, c, f || null, d, o, a + 1);
}
parseRule() {
if (this.node.type.spec.reparseInView)
return null;
let e = { node: this.node.type.name, attrs: this.node.attrs };
if (this.node.type.whitespace == "pre" && (e.preserveWhitespace = "full"), !this.contentDOM)
e.getContent = () => this.node.content;
else if (!this.contentLost)
e.contentElement = this.contentDOM;
else {
for (let n = this.children.length - 1; n >= 0; n--) {
let r = this.children[n];
if (this.dom.contains(r.dom.parentNode)) {
e.contentElement = r.dom.parentNode;
break;
}
}
e.contentElement || (e.getContent = () => me.empty);
}
return e;
}
matchesNode(e, n, r) {
return this.dirty == lr && e.eq(this.node) && B0(n, this.outerDeco) && r.eq(this.innerDeco);
}
get size() {
return this.node.nodeSize;
}
get border() {
return this.node.isLeaf ? 0 : 1;
}
// Syncs `this.children` to match `this.node.content` and the local
// decorations, possibly introducing nesting for marks. Then, in a
// separate step, syncs the DOM inside `this.contentDOM` to
// `this.children`.
updateChildren(e, n) {
let r = this.node.inlineContent, i = n, o = e.composing ? this.localCompositionInfo(e, n) : null, a = o && o.pos > -1 ? o : null, s = o && o.pos < 0, u = new HP(this, a && a.node, e);
jP(this.node, this.innerDeco, (l, c, f) => {
l.spec.marks ? u.syncToMarks(l.spec.marks, r, e) : l.type.side >= 0 && !f && u.syncToMarks(c == this.node.childCount ? kt.none : this.node.child(c).marks, r, e), u.placeWidget(l, e, i);
}, (l, c, f, d) => {
u.syncToMarks(l.marks, r, e);
let p;
u.findNodeMatch(l, c, f, d) || s && e.state.selection.from > i && e.state.selection.to < i + l.nodeSize && (p = u.findIndexWithChild(o.node)) > -1 && u.updateNodeAt(l, c, f, p, e) || u.updateNextNode(l, c, f, e, d, i) || u.addNode(l, c, f, e, i), i += l.nodeSize;
}), u.syncToMarks([], r, e), this.node.isTextblock && u.addTextblockHacks(), u.destroyRest(), (u.changed || this.dirty == wo) && (a && this.protectLocalComposition(e, a), pw(this.contentDOM, this.children, e), Wa && UP(this.dom));
}
localCompositionInfo(e, n) {
let { from: r, to: i } = e.state.selection;
if (!(e.state.selection instanceof Ye) || r < n || i > n + this.node.content.size)
return null;
let o = e.domSelectionRange(), a = WP(o.focusNode, o.focusOffset);
if (!a || !this.dom.contains(a.parentNode))
return null;
if (this.node.inlineContent) {
let s = a.nodeValue, u = YP(this.node.content, s, r - n, i - n);
return u < 0 ? null : { node: a, pos: u, text: s };
} else
return { node: a, pos: -1, text: "" };
}
protectLocalComposition(e, { node: n, pos: r, text: i }) {
if (this.getDesc(n))
return;
let o = n;
for (; o.parentNode != this.contentDOM; o = o.parentNode) {
for (; o.previousSibling; )
o.parentNode.removeChild(o.previousSibling);
for (; o.nextSibling; )
o.parentNode.removeChild(o.nextSibling);
o.pmViewDesc && (o.pmViewDesc = void 0);
}
let a = new BP(this, o, n, i);
e.input.compositionNodes.push(a), this.children = V0(this.children, r, r + i.length, e, a);
}
// If this desc must be updated to match the given node decoration,
// do so and return true.
update(e, n, r, i) {
return this.dirty == Jr || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, n, r, i), !0);
}
updateInner(e, n, r, i) {
this.updateOuterDeco(n), this.node = e, this.innerDeco = r, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = lr;
}
updateOuterDeco(e) {
if (B0(e, this.outerDeco))
return;
let n = this.nodeDOM.nodeType != 1, r = this.dom;
this.dom = hw(this.dom, this.nodeDOM, R0(this.outerDeco, this.node, n), R0(e, this.node, n)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
}
// Mark this node as being the selected node.
selectNode() {
this.nodeDOM.nodeType == 1 && this.nodeDOM.classList.add("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && (this.dom.draggable = !0);
}
// Remove selected node marking from this node.
deselectNode() {
this.nodeDOM.nodeType == 1 && this.nodeDOM.classList.remove("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && this.dom.removeAttribute("draggable");
}
get domAtom() {
return this.node.isAtom;
}
}
function $g(t, e, n, r, i) {
mw(r, e, t);
let o = new Li(void 0, t, e, n, r, r, r, i, 0);
return o.contentDOM && o.updateChildren(i, 0), o;
}
class cd extends Li {
constructor(e, n, r, i, o, a, s) {
super(e, n, r, i, o, null, a, s, 0);
}
parseRule() {
let e = this.nodeDOM.parentNode;
for (; e && e != this.dom && !e.pmIsDeco; )
e = e.parentNode;
return { skip: e || !0 };
}
update(e, n, r, i) {
return this.dirty == Jr || this.dirty != lr && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(n), (this.dirty != lr || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, i.trackWrites == this.nodeDOM && (i.trackWrites = null)), this.node = e, this.dirty = lr, !0);
}
inParent() {
let e = this.parent.contentDOM;
for (let n = this.nodeDOM; n; n = n.parentNode)
if (n == e)
return !0;
return !1;
}
domFromPos(e) {
return { node: this.nodeDOM, offset: e };
}
localPosFromDOM(e, n, r) {
return e == this.nodeDOM ? this.posAtStart + Math.min(n, this.node.text.length) : super.localPosFromDOM(e, n, r);
}
ignoreMutation(e) {
return e.type != "characterData" && e.type != "selection";
}
slice(e, n, r) {
let i = this.node.cut(e, n), o = document.createTextNode(i.text);
return new cd(this.parent, i, this.outerDeco, this.innerDeco, o, o, r);
}
markDirty(e, n) {
super.markDirty(e, n), this.dom != this.nodeDOM && (e == 0 || n == this.nodeDOM.nodeValue.length) && (this.dirty = Jr);
}
get domAtom() {
return !1;
}
}
class fw extends Eu {
parseRule() {
return { ignore: !0 };
}
matchesHack(e) {
return this.dirty == lr && this.dom.nodeName == e;
}
get domAtom() {
return !0;
}
get ignoreForCoords() {
return this.dom.nodeName == "IMG";
}
}
class VP extends Li {
constructor(e, n, r, i, o, a, s, u, l, c) {
super(e, n, r, i, o, a, s, l, c), this.spec = u;
}
// A custom `update` method gets to decide whether the update goes
// through. If it does, and there's a `contentDOM` node, our logic
// updates the children.
update(e, n, r, i) {
if (this.dirty == Jr)
return !1;
if (this.spec.update) {
let o = this.spec.update(e, n, r);
return o && this.updateInner(e, n, r, i), o;
} else
return !this.contentDOM && !e.isLeaf ? !1 : super.update(e, n, r, i);
}
selectNode() {
this.spec.selectNode ? this.spec.selectNode() : super.selectNode();
}
deselectNode() {
this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();
}
setSelection(e, n, r, i) {
this.spec.setSelection ? this.spec.setSelection(e, n, r) : super.setSelection(e, n, r, i);
}
destroy() {
this.spec.destroy && this.spec.destroy(), super.destroy();
}
stopEvent(e) {
return this.spec.stopEvent ? this.spec.stopEvent(e) : !1;
}
ignoreMutation(e) {
return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
}
}
function pw(t, e, n) {
let r = t.firstChild, i = !1;
for (let o = 0; o < e.length; o++) {
let a = e[o], s = a.dom;
if (s.parentNode == t) {
for (; s != r; )
r = Ng(r), i = !0;
r = r.nextSibling;
} else
i = !0, t.insertBefore(s, r);
if (a instanceof Ho) {
let u = r ? r.previousSibling : t.lastChild;
pw(a.contentDOM, a.children, n), r = u ? u.nextSibling : t.firstChild;
}
}
for (; r; )
r = Ng(r), i = !0;
i && n.trackWrites == t && (n.trackWrites = null);
}
const $s = function(t) {
t && (this.nodeName = t);
};
$s.prototype = /* @__PURE__ */ Object.create(null);
const ko = [new $s()];
function R0(t, e, n) {
if (t.length == 0)
return ko;
let r = n ? ko[0] : new $s(), i = [r];
for (let o = 0; o < t.length; o++) {
let a = t[o].type.attrs;
if (a) {
a.nodeName && i.push(r = new $s(a.nodeName));
for (let s in a) {
let u = a[s];
u != null && (n && i.length == 1 && i.push(r = new $s(e.isInline ? "span" : "div")), s == "class" ? r.class = (r.class ? r.class + " " : "") + u : s == "style" ? r.style = (r.style ? r.style + ";" : "") + u : s != "nodeName" && (r[s] = u));
}
}
}
return i;
}
function hw(t, e, n, r) {
if (n == ko && r == ko)
return e;
let i = e;
for (let o = 0; o < r.length; o++) {
let a = r[o], s = n[o];
if (o) {
let u;
s && s.nodeName == a.nodeName && i != t && (u = i.parentNode) && u.nodeName.toLowerCase() == a.nodeName || (u = document.createElement(a.nodeName), u.pmIsDeco = !0, u.appendChild(i), s = ko[0]), i = u;
}
zP(i, s || ko[0], a);
}
return i;
}
function zP(t, e, n) {
for (let r in e)
r != "class" && r != "style" && r != "nodeName" && !(r in n) && t.removeAttribute(r);
for (let r in n)
r != "class" && r != "style" && r != "nodeName" && n[r] != e[r] && t.setAttribute(r, n[r]);
if (e.class != n.class) {
let r = e.class ? e.class.split(" ").filter(Boolean) : [], i = n.class ? n.class.split(" ").filter(Boolean) : [];
for (let o = 0; o < r.length; o++)
i.indexOf(r[o]) == -1 && t.classList.remove(r[o]);
for (let o = 0; o < i.length; o++)
r.indexOf(i[o]) == -1 && t.classList.add(i[o]);
t.classList.length == 0 && t.removeAttribute("class");
}
if (e.style != n.style) {
if (e.style) {
let r = /\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g, i;
for (; i = r.exec(e.style); )
t.style.removeProperty(i[1]);
}
n.style && (t.style.cssText += n.style);
}
}
function mw(t, e, n) {
return hw(t, t, ko, R0(e, n, t.nodeType != 1));
}
function B0(t, e) {
if (t.length != e.length)
return !1;
for (let n = 0; n < t.length; n++)
if (!t[n].type.eq(e[n].type))
return !1;
return !0;
}
function Ng(t) {
let e = t.nextSibling;
return t.parentNode.removeChild(t), e;
}
class HP {
constructor(e, n, r) {
this.lock = n, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = qP(e.node.content, e);
}
// Destroy and remove the children between the given indices in
// `this.top`.
destroyBetween(e, n) {
if (e != n) {
for (let r = e; r < n; r++)
this.top.children[r].destroy();
this.top.children.splice(e, n - e), this.changed = !0;
}
}
// Destroy all remaining children in `this.top`.
destroyRest() {
this.destroyBetween(this.index, this.top.children.length);
}
// Sync the current stack of mark descs with the given array of
// marks, reusing existing mark descs when possible.
syncToMarks(e, n, r) {
let i = 0, o = this.stack.length >> 1, a = Math.min(o, e.length);
for (; i < a && (i == o - 1 ? this.top : this.stack[i + 1 << 1]).matchesMark(e[i]) && e[i].type.spec.spanning !== !1; )
i++;
for (; i < o; )
this.destroyRest(), this.top.dirty = lr, this.index = this.stack.pop(), this.top = this.stack.pop(), o--;
for (; o < e.length; ) {
this.stack.push(this.top, this.index + 1);
let s = -1;
for (let u = this.index; u < Math.min(this.index + 3, this.top.children.length); u++) {
let l = this.top.children[u];
if (l.matchesMark(e[o]) && !this.isLocked(l.dom)) {
s = u;
break;
}
}
if (s > -1)
s > this.index && (this.changed = !0, this.destroyBetween(this.index, s)), this.top = this.top.children[this.index];
else {
let u = Ho.create(this.top, e[o], n, r);
this.top.children.splice(this.index, 0, u), this.top = u, this.changed = !0;
}
this.index = 0, o++;
}
}
// Try to find a node desc matching the given data. Skip over it and
// return true when successful.
findNodeMatch(e, n, r, i) {
let o = -1, a;
if (i >= this.preMatch.index && (a = this.preMatch.matches[i - this.preMatch.index]).parent == this.top && a.matchesNode(e, n, r))
o = this.top.children.indexOf(a, this.index);
else
for (let s = this.index, u = Math.min(this.top.children.length, s + 5); s < u; s++) {
let l = this.top.children[s];
if (l.matchesNode(e, n, r) && !this.preMatch.matched.has(l)) {
o = s;
break;
}
}
return o < 0 ? !1 : (this.destroyBetween(this.index, o), this.index++, !0);
}
updateNodeAt(e, n, r, i, o) {
let a = this.top.children[i];
return a.dirty == Jr && a.dom == a.contentDOM && (a.dirty = wo), a.update(e, n, r, o) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
}
findIndexWithChild(e) {
for (; ; ) {
let n = e.parentNode;
if (!n)
return -1;
if (n == this.top.contentDOM) {
let r = e.pmViewDesc;
if (r) {
for (let i = this.index; i < this.top.children.length; i++)
if (this.top.children[i] == r)
return i;
}
return -1;
}
e = n;
}
}
// Try to update the next node, if any, to the given data. Checks
// pre-matches to avoid overwriting nodes that could still be used.
updateNextNode(e, n, r, i, o, a) {
for (let s = this.index; s < this.top.children.length; s++) {
let u = this.top.children[s];
if (u instanceof Li) {
let l = this.preMatch.matched.get(u);
if (l != null && l != o)
return !1;
let c = u.dom, f, d = this.isLocked(c) && !(e.isText && u.node && u.node.isText && u.nodeDOM.nodeValue == e.text && u.dirty != Jr && B0(n, u.outerDeco));
if (!d && u.update(e, n, r, i))
return this.destroyBetween(this.index, s), u.dom != c && (this.changed = !0), this.index++, !0;
if (!d && (f = this.recreateWrapper(u, e, n, r, i, a)))
return this.top.children[this.index] = f, f.contentDOM && (f.dirty = wo, f.updateChildren(i, a + 1), f.dirty = lr), this.changed = !0, this.index++, !0;
break;
}
}
return !1;
}
// When a node with content is replaced by a different node with
// identical content, move over its children.
recreateWrapper(e, n, r, i, o, a) {
if (e.dirty || n.isAtom || !e.children.length || !e.node.content.eq(n.content))
return null;
let s = Li.create(this.top, n, r, i, o, a);
if (s.contentDOM) {
s.children = e.children, e.children = [];
for (let u of s.children)
u.parent = s;
}
return e.destroy(), s;
}
// Insert the node as a newly created node desc.
addNode(e, n, r, i, o) {
let a = Li.create(this.top, e, n, r, i, o);
a.contentDOM && a.updateChildren(i, o + 1), this.top.children.splice(this.index++, 0, a), this.changed = !0;
}
placeWidget(e, n, r) {
let i = this.index < this.top.children.length ? this.top.children[this.index] : null;
if (i && i.matchesWidget(e) && (e == i.widget || !i.widget.type.toDOM.parentNode))
this.index++;
else {
let o = new dw(this.top, e, n, r);
this.top.children.splice(this.index++, 0, o), this.changed = !0;
}
}
// Make sure a textblock looks and behaves correctly in
// contentEditable.
addTextblockHacks() {
let e = this.top.children[this.index - 1], n = this.top;
for (; e instanceof Ho; )
n = e, e = n.children[n.children.length - 1];
(!e || // Empty textblock
!(e instanceof cd) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((Tn || pn) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", n), this.addHackNode("BR", this.top));
}
addHackNode(e, n) {
if (n == this.top && this.index < n.children.length && n.children[this.index].matchesHack(e))
this.index++;
else {
let r = document.createElement(e);
e == "IMG" && (r.className = "ProseMirror-separator", r.alt = ""), e == "BR" && (r.className = "ProseMirror-trailingBreak");
let i = new fw(this.top, [], r, null);
n != this.top ? n.children.push(i) : n.children.splice(this.index++, 0, i), this.changed = !0;
}
}
isLocked(e) {
return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
}
}
function qP(t, e) {
let n = e, r = n.children.length, i = t.childCount, o = /* @__PURE__ */ new Map(), a = [];
e:
for (; i > 0; ) {
let s;
for (; ; )
if (r) {
let l = n.children[r - 1];
if (l instanceof Ho)
n = l, r = l.children.length;
else {
s = l, r--;
break;
}
} else {
if (n == e)
break e;
r = n.parent.children.indexOf(n), n = n.parent;
}
let u = s.node;
if (u) {
if (u != t.child(i - 1))
break;
--i, o.set(s, i), a.push(s);
}
}
return { index: i, matched: o, matches: a.reverse() };
}
function FP(t, e) {
return t.type.side - e.type.side;
}
function jP(t, e, n, r) {
let i = e.locals(t), o = 0;
if (i.length == 0) {
for (let l = 0; l < t.childCount; l++) {
let c = t.child(l);
r(c, i, e.forChild(o, c), l), o += c.nodeSize;
}
return;
}
let a = 0, s = [], u = null;
for (let l = 0; ; ) {
let c, f;
for (; a < i.length && i[a].to == o; ) {
let v = i[a++];
v.widget && (c ? (f || (f = [c])).push(v) : c = v);
}
if (c)
if (f) {
f.sort(FP);
for (let v = 0; v < f.length; v++)
n(f[v], l, !!u);
} else
n(c, l, !!u);
let d, p;
if (u)
p = -1, d = u, u = null;
else if (l < t.childCount)
p = l, d = t.child(l++);
else
break;
for (let v = 0; v < s.length; v++)
s[v].to <= o && s.splice(v--, 1);
for (; a < i.length && i[a].from <= o && i[a].to > o; )
s.push(i[a++]);
let h = o + d.nodeSize;
if (d.isText) {
let v = h;
a < i.length && i[a].from < v && (v = i[a].from);
for (let y = 0; y < s.length; y++)
s[y].to < v && (v = s[y].to);
v < h && (u = d.cut(v - o), d = d.cut(0, v - o), h = v, p = -1);
}
let m = d.isInline && !d.isLeaf ? s.filter((v) => !v.inline) : s.slice();
r(d, m, e.forChild(o, d), p), o = h;
}
}
function UP(t) {
if (t.nodeName == "UL" || t.nodeName == "OL") {
let e = t.style.cssText;
t.style.cssText = e + "; list-style: square !important", window.getComputedStyle(t).listStyle, t.style.cssText = e;
}
}
function WP(t, e) {
for (; ; ) {
if (t.nodeType == 3)
return t;
if (t.nodeType == 1 && e > 0) {
if (t.childNodes.length > e && t.childNodes[e].nodeType == 3)
return t.childNodes[e];
t = t.childNodes[e - 1], e = Pr(t);
} else if (t.nodeType == 1 && e < t.childNodes.length)
t = t.childNodes[e], e = 0;
else
return null;
}
}
function YP(t, e, n, r) {
for (let i = 0, o = 0; i < t.childCount && o <= r; ) {
let a = t.child(i++), s = o;
if (o += a.nodeSize, !a.isText)
continue;
let u = a.text;
for (; i < t.childCount; ) {
let l = t.child(i++);
if (o += l.nodeSize, !l.isText)
break;
u += l.text;
}
if (o >= n) {
if (o >= r && u.slice(r - e.length - s, r - s) == e)
return r - e.length;
let l = s < r ? u.lastIndexOf(e, r - s - 1) : -1;
if (l >= 0 && l + e.length + s >= n)
return s + l;
if (n == r && u.length >= r + e.length - s && u.slice(r - s, r - s + e.length) == e)
return r;
}
}
return -1;
}
function V0(t, e, n, r, i) {
let o = [];
for (let a = 0, s = 0; a < t.length; a++) {
let u = t[a], l = s, c = s += u.size;
l >= n || c <= e ? o.push(u) : (l < e && o.push(u.slice(0, e - l, r)), i && (o.push(i), i = void 0), c > n && o.push(u.slice(n - l, u.size, r)));
}
return o;
}
function mh(t, e = null) {
let n = t.domSelectionRange(), r = t.state.doc;
if (!n.focusNode)
return null;
let i = t.docView.nearestDesc(n.focusNode), o = i && i.size == 0, a = t.docView.posFromDOM(n.focusNode, n.focusOffset, 1);
if (a < 0)
return null;
let s = r.resolve(a), u, l;
if (ld(n)) {
for (u = s; i && !i.node; )
i = i.parent;
let c = i.node;
if (i && c.isAtom && Ve.isSelectable(c) && i.parent && !(c.isInline && bP(n.focusNode, n.focusOffset, i.dom))) {
let f = i.posBefore;
l = new Ve(a == f ? s : r.resolve(f));
}
} else {
let c = t.docView.posFromDOM(n.anchorNode, n.anchorOffset, 1);
if (c < 0)
return null;
u = r.resolve(c);
}
if (!l) {
let c = e == "pointer" || t.state.selection.head < s.pos && !o ? 1 : -1;
l = gh(t, u, s, c);
}
return l;
}
function gw(t) {
return t.editable ? t.hasFocus() : vw(t) && document.activeElement && document.activeElement.contains(t.dom);
}
function fi(t, e = !1) {
let n = t.state.selection;
if (bw(t, n), !!gw(t)) {
if (!e && t.input.mouseDown && t.input.mouseDown.allowDefault && pn) {
let r = t.domSelectionRange(), i = t.domObserver.currentSelection;
if (r.anchorNode && i.anchorNode && zo(r.anchorNode, r.anchorOffset, i.anchorNode, i.anchorOffset)) {
t.input.mouseDown.delayedSelectionSync = !0, t.domObserver.setCurSelection();
return;
}
}
if (t.domObserver.disconnectSelection(), t.cursorWrapper)
GP(t);
else {
let { anchor: r, head: i } = n, o, a;
Pg && !(n instanceof Ye) && (n.$from.parent.inlineContent || (o = Ig(t, n.from)), !n.empty && !n.$from.parent.inlineContent && (a = Ig(t, n.to))), t.docView.setSelection(r, i, t.root, e), Pg && (o && Lg(o), a && Lg(a)), n.visible ? t.dom.classList.remove("ProseMirror-hideselection") : (t.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && KP(t));
}
t.domObserver.setCurSelection(), t.domObserver.connectSelection();
}
}
const Pg = Tn || pn && wP < 63;
function Ig(t, e) {
let { node: n, offset: r } = t.docView.domFromPos(e, 0), i = r < n.childNodes.length ? n.childNodes[r] : null, o = r ? n.childNodes[r - 1] : null;
if (Tn && i && i.contentEditable == "false")
return gf(i);
if ((!i || i.contentEditable == "false") && (!o || o.contentEditable == "false")) {
if (i)
return gf(i);
if (o)
return gf(o);
}
}
function gf(t) {
return t.contentEditable = "true", Tn && t.draggable && (t.draggable = !1, t.wasDraggable = !0), t;
}
function Lg(t) {
t.contentEditable = "false", t.wasDraggable && (t.draggable = !0, t.wasDraggable = null);
}
function KP(t) {
let e = t.dom.ownerDocument;
e.removeEventListener("selectionchange", t.input.hideSelectionGuard);
let n = t.domSelectionRange(), r = n.anchorNode, i = n.anchorOffset;
e.addEventListener("selectionchange", t.input.hideSelectionGuard = () => {
(n.anchorNode != r || n.anchorOffset != i) && (e.removeEventListener("selectionchange", t.input.hideSelectionGuard), setTimeout(() => {
(!gw(t) || t.state.selection.visible) && t.dom.classList.remove("ProseMirror-hideselection");
}, 20));
});
}
function GP(t) {
let e = t.domSelection(), n = document.createRange(), r = t.cursorWrapper.dom, i = r.nodeName == "IMG";
i ? n.setEnd(r.parentNode, yn(r) + 1) : n.setEnd(r, 0), n.collapse(!1), e.removeAllRanges(), e.addRange(n), !i && !t.state.selection.visible && Bn && Ii <= 11 && (r.disabled = !0, r.disabled = !1);
}
function bw(t, e) {
if (e instanceof Ve) {
let n = t.docView.descAt(e.from);
n != t.lastSelectedViewDesc && (Rg(t), n && n.selectNode(), t.lastSelectedViewDesc = n);
} else
Rg(t);
}
function Rg(t) {
t.lastSelectedViewDesc && (t.lastSelectedViewDesc.parent && t.lastSelectedViewDesc.deselectNode(), t.lastSelectedViewDesc = void 0);
}
function gh(t, e, n, r) {
return t.someProp("createSelectionBetween", (i) => i(t, e, n)) || Ye.between(e, n, r);
}
function Bg(t) {
return t.editable && !t.hasFocus() ? !1 : vw(t);
}
function vw(t) {
let e = t.domSelectionRange();
if (!e.anchorNode)
return !1;
try {
return t.dom.contains(e.anchorNode.nodeType == 3 ? e.anchorNode.parentNode : e.anchorNode) && (t.editable || t.dom.contains(e.focusNode.nodeType == 3 ? e.focusNode.parentNode : e.focusNode));
} catch {
return !1;
}
}
function JP(t) {
let e = t.docView.domFromPos(t.state.selection.anchor, 0), n = t.domSelectionRange();
return zo(e.node, e.offset, n.anchorNode, n.anchorOffset);
}
function z0(t, e) {
let { $anchor: n, $head: r } = t.selection, i = e > 0 ? n.max(r) : n.min(r), o = i.parent.inlineContent ? i.depth ? t.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
return o && Je.findFrom(o, e);
}
function ho(t, e) {
return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()), !0;
}
function Vg(t, e, n) {
let r = t.state.selection;
if (r instanceof Ye) {
if (!r.empty || n.indexOf("s") > -1)
return !1;
if (t.endOfTextblock(e > 0 ? "forward" : "backward")) {
let i = z0(t.state, e);
return i && i instanceof Ve ? ho(t, i) : !1;
} else if (!(ar && n.indexOf("m") > -1)) {
let i = r.$head, o = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, a;
if (!o || o.isText)
return !1;
let s = e < 0 ? i.pos - o.nodeSize : i.pos;
return o.isAtom || (a = t.docView.descAt(s)) && !a.contentDOM ? Ve.isSelectable(o) ? ho(t, new Ve(e < 0 ? t.state.doc.resolve(i.pos - o.nodeSize) : i)) : Su ? ho(t, new Ye(t.state.doc.resolve(e < 0 ? s : s + o.nodeSize))) : !1 : !1;
}
} else {
if (r instanceof Ve && r.node.isInline)
return ho(t, new Ye(e > 0 ? r.$to : r.$from));
{
let i = z0(t.state, e);
return i ? ho(t, i) : !1;
}
}
}
function ic(t) {
return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
}
function Ns(t, e) {
if (t.contentEditable == "false")
return !0;
let n = t.pmViewDesc;
return n && n.size == 0 && (e < 0 || t.nextSibling || t.nodeName != "BR");
}
function ta(t, e) {
return e < 0 ? XP(t) : QP(t);
}
function XP(t) {
let e = t.domSelectionRange(), n = e.focusNode, r = e.focusOffset;
if (!n)
return;
let i, o, a = !1;
for (kr && n.nodeType == 1 && r < ic(n) && Ns(n.childNodes[r], -1) && (a = !0); ; )
if (r > 0) {
if (n.nodeType != 1)
break;
{
let s = n.childNodes[r - 1];
if (Ns(s, -1))
i = n, o = --r;
else if (s.nodeType == 3)
n = s, r = n.nodeValue.length;
else
break;
}
} else {
if (yw(n))
break;
{
let s = n.previousSibling;
for (; s && Ns(s, -1); )
i = n.parentNode, o = yn(s), s = s.previousSibling;
if (s)
n = s, r = ic(n);
else {
if (n = n.parentNode, n == t.dom)
break;
r = 0;
}
}
}
a ? H0(t, n, r) : i && H0(t, i, o);
}
function QP(t) {
let e = t.domSelectionRange(), n = e.focusNode, r = e.focusOffset;
if (!n)
return;
let i = ic(n), o, a;
for (; ; )
if (r < i) {
if (n.nodeType != 1)
break;
let s = n.childNodes[r];
if (Ns(s, 1))
o = n, a = ++r;
else
break;
} else {
if (yw(n))
break;
{
let s = n.nextSibling;
for (; s && Ns(s, 1); )
o = s.parentNode, a = yn(s) + 1, s = s.nextSibling;
if (s)
n = s, r = 0, i = ic(n);
else {
if (n = n.parentNode, n == t.dom)
break;
r = i = 0;
}
}
}
o && H0(t, o, a);
}
function yw(t) {
let e = t.pmViewDesc;
return e && e.node && e.node.isBlock;
}
function ZP(t, e) {
for (; t && e == t.childNodes.length && !ph(t); )
e = yn(t) + 1, t = t.parentNode;
for (; t && e < t.childNodes.length; ) {
let n = t.childNodes[e];
if (n.nodeType == 3)
return n;
if (n.nodeType == 1 && n.contentEditable == "false")
break;
t = n, e = 0;
}
}
function eI(t, e) {
for (; t && !e && !ph(t); )
e = yn(t), t = t.parentNode;
for (; t && e; ) {
let n = t.childNodes[e - 1];
if (n.nodeType == 3)
return n;
if (n.nodeType == 1 && n.contentEditable == "false")
break;
t = n, e = t.childNodes.length;
}
}
function H0(t, e, n) {
if (e.nodeType != 3) {
let o, a;
(a = ZP(e, n)) ? (e = a, n = 0) : (o = eI(e, n)) && (e = o, n = o.nodeValue.length);
}
let r = t.domSelection();
if (ld(r)) {
let o = document.createRange();
o.setEnd(e, n), o.setStart(e, n), r.removeAllRanges(), r.addRange(o);
} else
r.extend && r.extend(e, n);
t.domObserver.setCurSelection();
let { state: i } = t;
setTimeout(() => {
t.state == i && fi(t);
}, 50);
}
function zg(t, e) {
let n = t.state.doc.resolve(e);
if (!(pn || kP) && n.parent.inlineContent) {
let i = t.coordsAtPos(e);
if (e > n.start()) {
let o = t.coordsAtPos(e - 1), a = (o.top + o.bottom) / 2;
if (a > i.top && a < i.bottom && Math.abs(o.left - i.left) > 1)
return o.left < i.left ? "ltr" : "rtl";
}
if (e < n.end()) {
let o = t.coordsAtPos(e + 1), a = (o.top + o.bottom) / 2;
if (a > i.top && a < i.bottom && Math.abs(o.left - i.left) > 1)
return o.left > i.left ? "ltr" : "rtl";
}
}
return getComputedStyle(t.dom).direction == "rtl" ? "rtl" : "ltr";
}
function Hg(t, e, n) {
let r = t.state.selection;
if (r instanceof Ye && !r.empty || n.indexOf("s") > -1 || ar && n.indexOf("m") > -1)
return !1;
let { $from: i, $to: o } = r;
if (!i.parent.inlineContent || t.endOfTextblock(e < 0 ? "up" : "down")) {
let a = z0(t.state, e);
if (a && a instanceof Ve)
return ho(t, a);
}
if (!i.parent.inlineContent) {
let a = e < 0 ? i : o, s = r instanceof wr ? Je.near(a, e) : Je.findFrom(a, e);
return s ? ho(t, s) : !1;
}
return !1;
}
function qg(t, e) {
if (!(t.state.selection instanceof Ye))
return !0;
let { $head: n, $anchor: r, empty: i } = t.state.selection;
if (!n.sameParent(r))
return !0;
if (!i)
return !1;
if (t.endOfTextblock(e > 0 ? "forward" : "backward"))
return !0;
let o = !n.textOffset && (e < 0 ? n.nodeBefore : n.nodeAfter);
if (o && !o.isText) {
let a = t.state.tr;
return e < 0 ? a.delete(n.pos - o.nodeSize, n.pos) : a.delete(n.pos, n.pos + o.nodeSize), t.dispatch(a), !0;
}
return !1;
}
function Fg(t, e, n) {
t.domObserver.stop(), e.contentEditable = n, t.domObserver.start();
}
function tI(t) {
if (!Tn || t.state.selection.$head.parentOffset > 0)
return !1;
let { focusNode: e, focusOffset: n } = t.domSelectionRange();
if (e && e.nodeType == 1 && n == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
let r = e.firstChild;
Fg(t, r, "true"), setTimeout(() => Fg(t, r, "false"), 20);
}
return !1;
}
function nI(t) {
let e = "";
return t.ctrlKey && (e += "c"), t.metaKey && (e += "m"), t.altKey && (e += "a"), t.shiftKey && (e += "s"), e;
}
function rI(t, e) {
let n = e.keyCode, r = nI(e);
if (n == 8 || ar && n == 72 && r == "c")
return qg(t, -1) || ta(t, -1);
if (n == 46 && !e.shiftKey || ar && n == 68 && r == "c")
return qg(t, 1) || ta(t, 1);
if (n == 13 || n == 27)
return !0;
if (n == 37 || ar && n == 66 && r == "c") {
let i = n == 37 ? zg(t, t.state.selection.from) == "ltr" ? -1 : 1 : -1;
return Vg(t, i, r) || ta(t, i);
} else if (n == 39 || ar && n == 70 && r == "c") {
let i = n == 39 ? zg(t, t.state.selection.from) == "ltr" ? 1 : -1 : 1;
return Vg(t, i, r) || ta(t, i);
} else {
if (n == 38 || ar && n == 80 && r == "c")
return Hg(t, -1, r) || ta(t, -1);
if (n == 40 || ar && n == 78 && r == "c")
return tI(t) || Hg(t, 1, r) || ta(t, 1);
if (r == (ar ? "m" : "c") && (n == 66 || n == 73 || n == 89 || n == 90))
return !0;
}
return !1;
}
function ww(t, e) {
t.someProp("transformCopied", (p) => {
e = p(e, t);
});
let n = [], { content: r, openStart: i, openEnd: o } = e;
for (; i > 1 && o > 1 && r.childCount == 1 && r.firstChild.childCount == 1; ) {
i--, o--;
let p = r.firstChild;
n.push(p.type.name, p.attrs != p.type.defaultAttrs ? p.attrs : null), r = p.content;
}
let a = t.someProp("clipboardSerializer") || Lr.fromSchema(t.state.schema), s = Tw(), u = s.createElement("div");
u.appendChild(a.serializeFragment(r, { document: s }));
let l = u.firstChild, c, f = 0;
for (; l && l.nodeType == 1 && (c = _w[l.nodeName.toLowerCase()]); ) {
for (let p = c.length - 1; p >= 0; p--) {
let h = s.createElement(c[p]);
for (; u.firstChild; )
h.appendChild(u.firstChild);
u.appendChild(h), f++;
}
l = u.firstChild;
}
l && l.nodeType == 1 && l.setAttribute("data-pm-slice", `${i} ${o}${f ? ` -${f}` : ""} ${JSON.stringify(n)}`);
let d = t.someProp("clipboardTextSerializer", (p) => p(e, t)) || e.content.textBetween(0, e.content.size, `
`);
return { dom: u, text: d };
}
function kw(t, e, n, r, i) {
let o = i.parent.type.spec.code, a, s;
if (!n && !e)
return null;
let u = e && (r || o || !n);
if (u) {
if (t.someProp("transformPastedText", (d) => {
e = d(e, o || r, t);
}), o)
return e ? new Te(me.from(t.state.schema.text(e.replace(/\r\n?/g, `
`))), 0, 0) : Te.empty;
let f = t.someProp("clipboardTextParser", (d) => d(e, i, r, t));
if (f)
s = f;
else {
let d = i.marks(), { schema: p } = t.state, h = Lr.fromSchema(p);
a = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((m) => {
let v = a.appendChild(document.createElement("p"));
m && v.appendChild(h.serializeNode(p.text(m, d)));
});
}
} else
t.someProp("transformPastedHTML", (f) => {
n = f(n, t);
}), a = aI(n), Su && sI(a);
let l = a && a.querySelector("[data-pm-slice]"), c = l && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute("data-pm-slice") || "");
if (c && c[3])
for (let f = +c[3]; f > 0; f--) {
let d = a.firstChild;
for (; d && d.nodeType != 1; )
d = d.nextSibling;
if (!d)
break;
a = d;
}
if (s || (s = (t.someProp("clipboardParser") || t.someProp("domParser") || Fa.fromSchema(t.state.schema)).parseSlice(a, {
preserveWhitespace: !!(u || c),
context: i,
ruleFromNode(d) {
return d.nodeName == "BR" && !d.nextSibling && d.parentNode && !iI.test(d.parentNode.nodeName) ? { ignore: !0 } : null;
}
})), c)
s = uI(jg(s, +c[1], +c[2]), c[4]);
else if (s = Te.maxOpen(oI(s.content, i), !0), s.openStart || s.openEnd) {
let f = 0, d = 0;
for (let p = s.content.firstChild; f < s.openStart && !p.type.spec.isolating; f++, p = p.firstChild)
;
for (let p = s.content.lastChild; d < s.openEnd && !p.type.spec.isolating; d++, p = p.lastChild)
;
s = jg(s, f, d);
}
return t.someProp("transformPasted", (f) => {
s = f(s, t);
}), s;
}
const iI = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
function oI(t, e) {
if (t.childCount < 2)
return t;
for (let n = e.depth; n >= 0; n--) {
let i = e.node(n).contentMatchAt(e.index(n)), o, a = [];
if (t.forEach((s) => {
if (!a)
return;
let u = i.findWrapping(s.type), l;
if (!u)
return a = null;
if (l = a.length && o.length && Sw(u, o, s, a[a.length - 1], 0))
a[a.length - 1] = l;
else {
a.length && (a[a.length - 1] = Ew(a[a.length - 1], o.length));
let c = xw(s, u);
a.push(c), i = i.matchType(c.type), o = u;
}
}), a)
return me.from(a);
}
return t;
}
function xw(t, e, n = 0) {
for (let r = e.length - 1; r >= n; r--)
t = e[r].create(null, me.from(t));
return t;
}
function Sw(t, e, n, r, i) {
if (i < t.length && i < e.length && t[i] == e[i]) {
let o = Sw(t, e, n, r.lastChild, i + 1);
if (o)
return r.copy(r.content.replaceChild(r.childCount - 1, o));
if (r.contentMatchAt(r.childCount).matchType(i == t.length - 1 ? n.type : t[i + 1]))
return r.copy(r.content.append(me.from(xw(n, t, i + 1))));
}
}
function Ew(t, e) {
if (e == 0)
return t;
let n = t.content.replaceChild(t.childCount - 1, Ew(t.lastChild, e - 1)), r = t.contentMatchAt(t.childCount).fillBefore(me.empty, !0);
return t.copy(n.append(r));
}
function q0(t, e, n, r, i, o) {
let a = e < 0 ? t.firstChild : t.lastChild, s = a.content;
return t.childCount > 1 && (o = 0), i < r - 1 && (s = q0(s, e, n, r, i + 1, o)), i >= n && (s = e < 0 ? a.contentMatchAt(0).fillBefore(s, o <= i).append(s) : s.append(a.contentMatchAt(a.childCount).fillBefore(me.empty, !0))), t.replaceChild(e < 0 ? 0 : t.childCount - 1, a.copy(s));
}
function jg(t, e, n) {
return e < t.openStart && (t = new Te(q0(t.content, -1, e, t.openStart, 0, t.openEnd), e, t.openEnd)), n < t.openEnd && (t = new Te(q0(t.content, 1, n, t.openEnd, 0, 0), t.openStart, n)), t;
}
const _w = {
thead: ["table"],
tbody: ["table"],
tfoot: ["table"],
caption: ["table"],
colgroup: ["table"],
col: ["table", "colgroup"],
tr: ["table", "tbody"],
td: ["table", "tbody", "tr"],
th: ["table", "tbody", "tr"]
};
let Ug = null;
function Tw() {
return Ug || (Ug = document.implementation.createHTMLDocument("title"));
}
function aI(t) {
let e = /^(\s*<meta [^>]*>)*/.exec(t);
e && (t = t.slice(e[0].length));
let n = Tw().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(t), i;
if ((i = r && _w[r[1].toLowerCase()]) && (t = i.map((o) => "<" + o + ">").join("") + t + i.map((o) => "</" + o + ">").reverse().join("")), n.innerHTML = t, i)
for (let o = 0; o < i.length; o++)
n = n.querySelector(i[o]) || n;
return n;
}
function sI(t) {
let e = t.querySelectorAll(pn ? "span:not([class]):not([style])" : "span.Apple-converted-space");
for (let n = 0; n < e.length; n++) {
let r = e[n];
r.childNodes.length == 1 && r.textContent == " " && r.parentNode && r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "), r);
}
}
function uI(t, e) {
if (!t.size)
return t;
let n = t.content.firstChild.type.schema, r;
try {
r = JSON.parse(e);
} catch {
return t;
}
let { content: i, openStart: o, openEnd: a } = t;
for (let s = r.length - 2; s >= 0; s -= 2) {
let u = n.nodes[r[s]];
if (!u || u.hasRequiredAttrs())
break;
i = me.from(u.create(r[s + 1], i)), o++, a++;
}
return new Te(i, o, a);
}
const Cn = {}, On = {}, lI = { touchstart: !0, touchmove: !0 };
class cI {
constructor() {
this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastAndroidDelete = 0, this.composing = !1, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
}
}
function dI(t) {
for (let e in Cn) {
let n = Cn[e];
t.dom.addEventListener(e, t.input.eventHandlers[e] = (r) => {
pI(t, r) && !bh(t, r) && (t.editable || !(r.type in On)) && n(t, r);
}, lI[e] ? { passive: !0 } : void 0);
}
Tn && t.dom.addEventListener("input", () => null), F0(t);
}
function Ni(t, e) {
t.input.lastSelectionOrigin = e, t.input.lastSelectionTime = Date.now();
}
function fI(t) {
t.domObserver.stop();
for (let e in t.input.eventHandlers)
t.dom.removeEventListener(e, t.input.eventHandlers[e]);
clearTimeout(t.input.composingTimeout), clearTimeout(t.input.lastIOSEnterFallbackTimeout);
}
function F0(t) {
t.someProp("handleDOMEvents", (e) => {
for (let n in e)
t.input.eventHandlers[n] || t.dom.addEventListener(n, t.input.eventHandlers[n] = (r) => bh(t, r));
});
}
function bh(t, e) {
return t.someProp("handleDOMEvents", (n) => {
let r = n[e.type];
return r ? r(t, e) || e.defaultPrevented : !1;
});
}
function pI(t, e) {
if (!e.bubbles)
return !0;
if (e.defaultPrevented)
return !1;
for (let n = e.target; n != t.dom; n = n.parentNode)
if (!n || n.nodeType == 11 || n.pmViewDesc && n.pmViewDesc.stopEvent(e))
return !1;
return !0;
}
function hI(t, e) {
!bh(t, e) && Cn[e.type] && (t.editable || !(e.type in On)) && Cn[e.type](t, e);
}
On.keydown = (t, e) => {
let n = e;
if (t.input.shiftKey = n.keyCode == 16 || n.shiftKey, !Ow(t, n) && (t.input.lastKeyCode = n.keyCode, t.input.lastKeyCodeTime = Date.now(), !(br && pn && n.keyCode == 13)))
if (n.keyCode != 229 && t.domObserver.forceFlush(), Wa && n.keyCode == 13 && !n.ctrlKey && !n.altKey && !n.metaKey) {
let r = Date.now();
t.input.lastIOSEnter = r, t.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
t.input.lastIOSEnter == r && (t.someProp("handleKeyDown", (i) => i(t, po(13, "Enter"))), t.input.lastIOSEnter = 0);
}, 200);
} else
t.someProp("handleKeyDown", (r) => r(t, n)) || rI(t, n) ? n.preventDefault() : Ni(t, "key");
};
On.keyup = (t, e) => {
e.keyCode == 16 && (t.input.shiftKey = !1);
};
On.keypress = (t, e) => {
let n = e;
if (Ow(t, n) || !n.charCode || n.ctrlKey && !n.altKey || ar && n.metaKey)
return;
if (t.someProp("handleKeyPress", (i) => i(t, n))) {
n.preventDefault();
return;
}
let r = t.state.selection;
if (!(r instanceof Ye) || !r.$from.sameParent(r.$to)) {
let i = String.fromCharCode(n.charCode);
!/[\r\n]/.test(i) && !t.someProp("handleTextInput", (o) => o(t, r.$from.pos, r.$to.pos, i)) && t.dispatch(t.state.tr.insertText(i).scrollIntoView()), n.preventDefault();
}
};
function dd(t) {
return { left: t.clientX, top: t.clientY };
}
function mI(t, e) {
let n = e.x - t.clientX, r = e.y - t.clientY;
return n * n + r * r < 100;
}
function vh(t, e, n, r, i) {
if (r == -1)
return !1;
let o = t.state.doc.resolve(r);
for (let a = o.depth + 1; a > 0; a--)
if (t.someProp(e, (s) => a > o.depth ? s(t, n, o.nodeAfter, o.before(a), i, !0) : s(t, n, o.node(a), o.before(a), i, !1)))
return !0;
return !1;
}
function xa(t, e, n) {
t.focused || t.focus();
let r = t.state.tr.setSelection(e);
n == "pointer" && r.setMeta("pointer", !0), t.dispatch(r);
}
function gI(t, e) {
if (e == -1)
return !1;
let n = t.state.doc.resolve(e), r = n.nodeAfter;
return r && r.isAtom && Ve.isSelectable(r) ? (xa(t, new Ve(n), "pointer"), !0) : !1;
}
function bI(t, e) {
if (e == -1)
return !1;
let n = t.state.selection, r, i;
n instanceof Ve && (r = n.node);
let o = t.state.doc.resolve(e);
for (let a = o.depth + 1; a > 0; a--) {
let s = a > o.depth ? o.nodeAfter : o.node(a);
if (Ve.isSelectable(s)) {
r && n.$from.depth > 0 && a >= n.$from.depth && o.before(n.$from.depth + 1) == n.$from.pos ? i = o.before(n.$from.depth) : i = o.before(a);
break;
}
}
return i != null ? (xa(t, Ve.create(t.state.doc, i), "pointer"), !0) : !1;
}
function vI(t, e, n, r, i) {
return vh(t, "handleClickOn", e, n, r) || t.someProp("handleClick", (o) => o(t, e, r)) || (i ? bI(t, n) : gI(t, n));
}
function yI(t, e, n, r) {
return vh(t, "handleDoubleClickOn", e, n, r) || t.someProp("handleDoubleClick", (i) => i(t, e, r));
}
function wI(t, e, n, r) {
return vh(t, "handleTripleClickOn", e, n, r) || t.someProp("handleTripleClick", (i) => i(t, e, r)) || kI(t, n, r);
}
function kI(t, e, n) {
if (n.button != 0)
return !1;
let r = t.state.doc;
if (e == -1)
return r.inlineContent ? (xa(t, Ye.create(r, 0, r.content.size), "pointer"), !0) : !1;
let i = r.resolve(e);
for (let o = i.depth + 1; o > 0; o--) {
let a = o > i.depth ? i.nodeAfter : i.node(o), s = i.before(o);
if (a.inlineContent)
xa(t, Ye.create(r, s + 1, s + 1 + a.content.size), "pointer");
else if (Ve.isSelectable(a))
xa(t, Ve.create(r, s), "pointer");
else
continue;
return !0;
}
}
function yh(t) {
return oc(t);
}
const Cw = ar ? "metaKey" : "ctrlKey";
Cn.mousedown = (t, e) => {
let n = e;
t.input.shiftKey = n.shiftKey;
let r = yh(t), i = Date.now(), o = "singleClick";
i - t.input.lastClick.time < 500 && mI(n, t.input.lastClick) && !n[Cw] && (t.input.lastClick.type == "singleClick" ? o = "doubleClick" : t.input.lastClick.type == "doubleClick" && (o = "tripleClick")), t.input.lastClick = { time: i, x: n.clientX, y: n.clientY, type: o };
let a = t.posAtCoords(dd(n));
a && (o == "singleClick" ? (t.input.mouseDown && t.input.mouseDown.done(), t.input.mouseDown = new xI(t, a, n, !!r)) : (o == "doubleClick" ? yI : wI)(t, a.pos, a.inside, n) ? n.preventDefault() : Ni(t, "pointer"));
};
class xI {
constructor(e, n, r, i) {
this.view = e, this.pos = n, this.event = r, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[Cw], this.allowDefault = r.shiftKey;
let o, a;
if (n.inside > -1)
o = e.state.doc.nodeAt(n.inside), a = n.inside;
else {
let c = e.state.doc.resolve(n.pos);
o = c.parent, a = c.depth ? c.before() : 0;
}
const s = i ? null : r.target, u = s ? e.docView.nearestDesc(s, !0) : null;
this.target = u ? u.dom : null;
let { selection: l } = e.state;
(r.button == 0 && o.type.spec.draggable && o.type.spec.selectable !== !1 || l instanceof Ve && l.from <= a && l.to > a) && (this.mightDrag = {
node: o,
pos: a,
addAttr: !!(this.target && !this.target.draggable),
setUneditable: !!(this.target && kr && !this.target.hasAttribute("contentEditable"))
}), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
}, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)), Ni(e, "pointer");
}
done() {
this.view.root.removeEventListener("mouseup", this.up), this.view.root.removeEventListener("mousemove", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() => fi(this.view)), this.view.input.mouseDown = null;
}
up(e) {
if (this.done(), !this.view.dom.contains(e.target))
return;
let n = this.pos;
this.view.state.doc != this.startDoc && (n = this.view.posAtCoords(dd(e))), this.updateAllowDefault(e), this.allowDefault || !n ? Ni(this.view, "pointer") : vI(this.view, n.pos, n.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
Tn && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
// cursor, but still report that the node is selected
// when asked through getSelection. You'll then get a
// situation where clicking at the point where that
// (hidden) cursor is doesn't change the selection, and
// thus doesn't get a reaction from ProseMirror. This
// works around that.
pn && !this.view.state.selection.visible && Math.min(Math.abs(n.pos - this.view.state.selection.from), Math.abs(n.pos - this.view.state.selection.to)) <= 2) ? (xa(this.view, Je.near(this.view.state.doc.resolve(n.pos)), "pointer"), e.preventDefault()) : Ni(this.view, "pointer");
}
move(e) {
this.updateAllowDefault(e), Ni(this.view, "pointer"), e.buttons == 0 && this.done();
}
updateAllowDefault(e) {
!this.allowDefault && (Math.abs(this.event.x - e.clientX) > 4 || Math.abs(this.event.y - e.clientY) > 4) && (this.allowDefault = !0);
}
}
Cn.touchstart = (t) => {
t.input.lastTouch = Date.now(), yh(t), Ni(t, "pointer");
};
Cn.touchmove = (t) => {
t.input.lastTouch = Date.now(), Ni(t, "pointer");
};
Cn.contextmenu = (t) => yh(t);
function Ow(t, e) {
return t.composing ? !0 : Tn && Math.abs(e.timeStamp - t.input.compositionEndedAt) < 500 ? (t.input.compositionEndedAt = -2e8, !0) : !1;
}
const SI = br ? 5e3 : -1;
On.compositionstart = On.compositionupdate = (t) => {
if (!t.composing) {
t.domObserver.flush();
let { state: e } = t, n = e.selection.$from;
if (e.selection.empty && (e.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1)))
t.markCursor = t.state.storedMarks || n.marks(), oc(t, !0), t.markCursor = null;
else if (oc(t), kr && e.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
let r = t.domSelectionRange();
for (let i = r.focusNode, o = r.focusOffset; i && i.nodeType == 1 && o != 0; ) {
let a = o < 0 ? i.lastChild : i.childNodes[o - 1];
if (!a)
break;
if (a.nodeType == 3) {
t.domSelection().collapse(a, a.nodeValue.length);
break;
} else
i = a, o = -1;
}
}
t.input.composing = !0;
}
Aw(t, SI);
};
On.compositionend = (t, e) => {
t.composing && (t.input.composing = !1, t.input.compositionEndedAt = e.timeStamp, t.input.compositionPendingChanges = t.domObserver.pendingRecords().length ? t.input.compositionID : 0, t.input.compositionPendingChanges && Promise.resolve().then(() => t.domObserver.flush()), t.input.compositionID++, Aw(t, 20));
};
function Aw(t, e) {
clearTimeout(t.input.composingTimeout), e > -1 && (t.input.composingTimeout = setTimeout(() => oc(t), e));
}
function Mw(t) {
for (t.composing && (t.input.composing = !1, t.input.compositionEndedAt = EI()); t.input.compositionNodes.length > 0; )
t.input.compositionNodes.pop().markParentsDirty();
}
function EI() {
let t = document.createEvent("Event");
return t.initEvent("event", !0, !0), t.timeStamp;
}
function oc(t, e = !1) {
if (!(br && t.domObserver.flushingSoon >= 0)) {
if (t.domObserver.forceFlush(), Mw(t), e || t.docView && t.docView.dirty) {
let n = mh(t);
return n && !n.eq(t.state.selection) ? t.dispatch(t.state.tr.setSelection(n)) : t.updateState(t.state), !0;
}
return !1;
}
}
function _I(t, e) {
if (!t.dom.parentNode)
return;
let n = t.dom.parentNode.appendChild(document.createElement("div"));
n.appendChild(e), n.style.cssText = "position: fixed; left: -10000px; top: 10px";
let r = getSelection(), i = document.createRange();
i.selectNodeContents(e), t.dom.blur(), r.removeAllRanges(), r.addRange(i), setTimeout(() => {
n.parentNode && n.parentNode.removeChild(n), t.focus();
}, 50);
}
const Ya = Bn && Ii < 15 || Wa && xP < 604;
Cn.copy = On.cut = (t, e) => {
let n = e, r = t.state.selection, i = n.type == "cut";
if (r.empty)
return;
let o = Ya ? null : n.clipboardData, a = r.content(), { dom: s, text: u } = ww(t, a);
o ? (n.preventDefault(), o.clearData(), o.setData("text/html", s.innerHTML), o.setData("text/plain", u)) : _I(t, s), i && t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
};
function TI(t) {
return t.openStart == 0 && t.openEnd == 0 && t.content.childCount == 1 ? t.content.firstChild : null;
}
function CI(t, e) {
if (!t.dom.parentNode)
return;
let n = t.input.shiftKey || t.state.selection.$from.parent.type.spec.code, r = t.dom.parentNode.appendChild(document.createElement(n ? "textarea" : "div"));
n || (r.contentEditable = "true"), r.style.cssText = "position: fixed; left: -10000px; top: 10px", r.focus();
let i = t.input.shiftKey && t.input.lastKeyCode != 45;
setTimeout(() => {
t.focus(), r.parentNode && r.parentNode.removeChild(r), n ? au(t, r.value, null, i, e) : au(t, r.textContent, r.innerHTML, i, e);
}, 50);
}
function au(t, e, n, r, i) {
let o = kw(t, e, n, r, t.state.selection.$from);
if (t.someProp("handlePaste", (u) => u(t, i, o || Te.empty)))
return !0;
if (!o)
return !1;
let a = TI(o), s = a ? t.state.tr.replaceSelectionWith(a, r) : t.state.tr.replaceSelection(o);
return t.dispatch(s.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
}
On.paste = (t, e) => {
let n = e;
if (t.composing && !br)
return;
let r = Ya ? null : n.clipboardData, i = t.input.shiftKey && t.input.lastKeyCode != 45;
r && au(t, r.getData("text/plain"), r.getData("text/html"), i, n) ? n.preventDefault() : CI(t, n);
};
class OI {
constructor(e, n) {
this.slice = e, this.move = n;
}
}
const Dw = ar ? "altKey" : "ctrlKey";
Cn.dragstart = (t, e) => {
let n = e, r = t.input.mouseDown;
if (r && r.done(), !n.dataTransfer)
return;
let i = t.state.selection, o = i.empty ? null : t.posAtCoords(dd(n));
if (!(o && o.pos >= i.from && o.pos <= (i instanceof Ve ? i.to - 1 : i.to))) {
if (r && r.mightDrag)
t.dispatch(t.state.tr.setSelection(Ve.create(t.state.doc, r.mightDrag.pos)));
else if (n.target && n.target.nodeType == 1) {
let l = t.docView.nearestDesc(n.target, !0);
l && l.node.type.spec.draggable && l != t.docView && t.dispatch(t.state.tr.setSelection(Ve.create(t.state.doc, l.posBefore)));
}
}
let a = t.state.selection.content(), { dom: s, text: u } = ww(t, a);
n.dataTransfer.clearData(), n.dataTransfer.setData(Ya ? "Text" : "text/html", s.innerHTML), n.dataTransfer.effectAllowed = "copyMove", Ya || n.dataTransfer.setData("text/plain", u), t.dragging = new OI(a, !n[Dw]);
};
Cn.dragend = (t) => {
let e = t.dragging;
window.setTimeout(() => {
t.dragging == e && (t.dragging = null);
}, 50);
};
On.dragover = On.dragenter = (t, e) => e.preventDefault();
On.drop = (t, e) => {
let n = e, r = t.dragging;
if (t.dragging = null, !n.dataTransfer)
return;
let i = t.posAtCoords(dd(n));
if (!i)
return;
let o = t.state.doc.resolve(i.pos), a = r && r.slice;
a ? t.someProp("transformPasted", (h) => {
a = h(a, t);
}) : a = kw(t, n.dataTransfer.getData(Ya ? "Text" : "text/plain"), Ya ? null : n.dataTransfer.getData("text/html"), !1, o);
let s = !!(r && !n[Dw]);
if (t.someProp("handleDrop", (h) => h(t, n, a || Te.empty, s))) {
n.preventDefault();
return;
}
if (!a)
return;
n.preventDefault();
let u = a ? J3(t.state.doc, o.pos, a) : o.pos;
u == null && (u = o.pos);
let l = t.state.tr;
s && l.deleteSelection();
let c = l.mapping.map(u), f = a.openStart == 0 && a.openEnd == 0 && a.content.childCount == 1, d = l.doc;
if (f ? l.replaceRangeWith(c, c, a.content.firstChild) : l.replaceRange(c, c, a), l.doc.eq(d))
return;
let p = l.doc.resolve(c);
if (f && Ve.isSelectable(a.content.firstChild) && p.nodeAfter && p.nodeAfter.sameMarkup(a.content.firstChild))
l.setSelection(new Ve(p));
else {
let h = l.mapping.map(u);
l.mapping.maps[l.mapping.maps.length - 1].forEach((m, v, y, k) => h = k), l.setSelection(gh(t, p, l.doc.resolve(h)));
}
t.focus(), t.dispatch(l.setMeta("uiEvent", "drop"));
};
Cn.focus = (t) => {
t.input.lastFocus = Date.now(), t.focused || (t.domObserver.stop(), t.dom.classList.add("ProseMirror-focused"), t.domObserver.start(), t.focused = !0, setTimeout(() => {
t.docView && t.hasFocus() && !t.domObserver.currentSelection.eq(t.domSelectionRange()) && fi(t);
}, 20));
};
Cn.blur = (t, e) => {
let n = e;
t.focused && (t.domObserver.stop(), t.dom.classList.remove("ProseMirror-focused"), t.domObserver.start(), n.relatedTarget && t.dom.contains(n.relatedTarget) && t.domObserver.currentSelection.clear(), t.focused = !1);
};
Cn.beforeinput = (t, e) => {
if (pn && br && e.inputType == "deleteContentBackward") {
t.domObserver.flushSoon();
let { domChangeCount: r } = t.input;
setTimeout(() => {
if (t.input.domChangeCount != r || (t.dom.blur(), t.focus(), t.someProp("handleKeyDown", (o) => o(t, po(8, "Backspace")))))
return;
let { $cursor: i } = t.state.selection;
i && i.pos > 0 && t.dispatch(t.state.tr.delete(i.pos - 1, i.pos).scrollIntoView());
}, 50);
}
};
for (let t in On)
Cn[t] = On[t];
function su(t, e) {
if (t == e)
return !0;
for (let n in t)
if (t[n] !== e[n])
return !1;
for (let n in e)
if (!(n in t))
return !1;
return !0;
}
class ac {
constructor(e, n) {
this.toDOM = e, this.spec = n || No, this.side = this.spec.side || 0;
}
map(e, n, r, i) {
let { pos: o, deleted: a } = e.mapResult(n.from + i, this.side < 0 ? -1 : 1);
return a ? null : new Jn(o - r, o - r, this);
}
valid() {
return !0;
}
eq(e) {
return this == e || e instanceof ac && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && su(this.spec, e.spec));
}
destroy(e) {
this.spec.destroy && this.spec.destroy(e);
}
}
class Ri {
constructor(e, n) {
this.attrs = e, this.spec = n || No;
}
map(e, n, r, i) {
let o = e.map(n.from + i, this.spec.inclusiveStart ? -1 : 1) - r, a = e.map(n.to + i, this.spec.inclusiveEnd ? 1 : -1) - r;
return o >= a ? null : new Jn(o, a, this);
}
valid(e, n) {
return n.from < n.to;
}
eq(e) {
return this == e || e instanceof Ri && su(this.attrs, e.attrs) && su(this.spec, e.spec);
}
static is(e) {
return e.type instanceof Ri;
}
destroy() {
}
}
class wh {
constructor(e, n) {
this.attrs = e, this.spec = n || No;
}
map(e, n, r, i) {
let o = e.mapResult(n.from + i, 1);
if (o.deleted)
return null;
let a = e.mapResult(n.to + i, -1);
return a.deleted || a.pos <= o.pos ? null : new Jn(o.pos - r, a.pos - r, this);
}
valid(e, n) {
let { index: r, offset: i } = e.content.findIndex(n.from), o;
return i == n.from && !(o = e.child(r)).isText && i + o.nodeSize == n.to;
}
eq(e) {
return this == e || e instanceof wh && su(this.attrs, e.attrs) && su(this.spec, e.spec);
}
destroy() {
}
}
class Jn {
/**
@internal
*/
constructor(e, n, r) {
this.from = e, this.to = n, this.type = r;
}
/**
@internal
*/
copy(e, n) {
return new Jn(e, n, this.type);
}
/**
@internal
*/
eq(e, n = 0) {
return this.type.eq(e.type) && this.from + n == e.from && this.to + n == e.to;
}
/**
@internal
*/
map(e, n, r) {
return this.type.map(e, this, n, r);
}
/**
Creates a widget decoration, which is a DOM node that's shown in
the document at the given position. It is recommended that you
delay rendering the widget by passing a function that will be
called when the widget is actually drawn in a view, but you can
also directly pass a DOM node. `getPos` can be used to find the
widget's current document position.
*/
static widget(e, n, r) {
return new Jn(e, e, new ac(n, r));
}
/**
Creates an inline decoration, which adds the given attributes to
each inline node between `from` and `to`.
*/
static inline(e, n, r, i) {
return new Jn(e, n, new Ri(r, i));
}
/**
Creates a node decoration. `from` and `to` should point precisely
before and after a node in the document. That node, and only that
node, will receive the given attributes.
*/
static node(e, n, r, i) {
return new Jn(e, n, new wh(r, i));
}
/**
The spec provided when creating this decoration. Can be useful
if you've stored extra information in that object.
*/
get spec() {
return this.type.spec;
}
/**
@internal
*/
get inline() {
return this.type instanceof Ri;
}
/**
@internal
*/
get widget() {
return this.type instanceof ac;
}
}
const aa = [], No = {};
class Vt {
/**
@internal
*/
constructor(e, n) {
this.local = e.length ? e : aa, this.children = n.length ? n : aa;
}
/**
Create a set of decorations, using the structure of the given
document. This will consume (modify) the `decorations` array, so
you must make a copy if you want need to preserve that.
*/
static create(e, n) {
return n.length ? sc(n, e, 0, No) : cn;
}
/**
Find all decorations in this set which touch the given range
(including decorations that start or end directly at the
boundaries) and match the given predicate on their spec. When
`start` and `end` are omitted, all decorations in the set are
considered. When `predicate` isn't given, all decorations are
assumed to match.
*/
find(e, n, r) {
let i = [];
return this.findInner(e ?? 0, n ?? 1e9, i, 0, r), i;
}
findInner(e, n, r, i, o) {
for (let a = 0; a < this.local.length; a++) {
let s = this.local[a];
s.from <= n && s.to >= e && (!o || o(s.spec)) && r.push(s.copy(s.from + i, s.to + i));
}
for (let a = 0; a < this.children.length; a += 3)
if (this.children[a] < n && this.children[a + 1] > e) {
let s = this.children[a] + 1;
this.children[a + 2].findInner(e - s, n - s, r, i + s, o);
}
}
/**
Map the set of decorations in response to a change in the
document.
*/
map(e, n, r) {
return this == cn || e.maps.length == 0 ? this : this.mapInner(e, n, 0, 0, r || No);
}
/**
@internal
*/
mapInner(e, n, r, i, o) {
let a;
for (let s = 0; s < this.local.length; s++) {
let u = this.local[s].map(e, r, i);
u && u.type.valid(n, u) ? (a || (a = [])).push(u) : o.onRemove && o.onRemove(this.local[s].spec);
}
return this.children.length ? AI(this.children, a || [], e, n, r, i, o) : a ? new Vt(a.sort(Po), aa) : cn;
}
/**
Add the given array of decorations to the ones in the set,
producing a new set. Consumes the `decorations` array. Needs
access to the current document to create the appropriate tree
structure.
*/
add(e, n) {
return n.length ? this == cn ? Vt.create(e, n) : this.addInner(e, n, 0) : this;
}
addInner(e, n, r) {
let i, o = 0;
e.forEach((s, u) => {
let l = u + r, c;
if (c = Nw(n, s, l)) {
for (i || (i = this.children.slice()); o < i.length && i[o] < u; )
o += 3;
i[o] == u ? i[o + 2] = i[o + 2].addInner(s, c, l + 1) : i.splice(o, 0, u, u + s.nodeSize, sc(c, s, l + 1, No)), o += 3;
}
});
let a = $w(o ? Pw(n) : n, -r);
for (let s = 0; s < a.length; s++)
a[s].type.valid(e, a[s]) || a.splice(s--, 1);
return new Vt(a.length ? this.local.concat(a).sort(Po) : this.local, i || this.children);
}
/**
Create a new set that contains the decorations in this set, minus
the ones in the given array.
*/
remove(e) {
return e.length == 0 || this == cn ? this : this.removeInner(e, 0);
}
removeInner(e, n) {
let r = this.children, i = this.local;
for (let o = 0; o < r.length; o += 3) {
let a, s = r[o] + n, u = r[o + 1] + n;
for (let c = 0, f; c < e.length; c++)
(f = e[c]) && f.from > s && f.to < u && (e[c] = null, (a || (a = [])).push(f));
if (!a)
continue;
r == this.children && (r = this.children.slice());
let l = r[o + 2].removeInner(a, s + 1);
l != cn ? r[o + 2] = l : (r.splice(o, 3), o -= 3);
}
if (i.length) {
for (let o = 0, a; o < e.length; o++)
if (a = e[o])
for (let s = 0; s < i.length; s++)
i[s].eq(a, n) && (i == this.local && (i = this.local.slice()), i.splice(s--, 1));
}
return r == this.children && i == this.local ? this : i.length || r.length ? new Vt(i, r) : cn;
}
/**
@internal
*/
forChild(e, n) {
if (this == cn)
return this;
if (n.isLeaf)
return Vt.empty;
let r, i;
for (let s = 0; s < this.children.length; s += 3)
if (this.children[s] >= e) {
this.children[s] == e && (r = this.children[s + 2]);
break;
}
let o = e + 1, a = o + n.content.size;
for (let s = 0; s < this.local.length; s++) {
let u = this.local[s];
if (u.from < a && u.to > o && u.type instanceof Ri) {
let l = Math.max(o, u.from) - o, c = Math.min(a, u.to) - o;
l < c && (i || (i = [])).push(u.copy(l, c));
}
}
if (i) {
let s = new Vt(i.sort(Po), aa);
return r ? new Oi([s, r]) : s;
}
return r || cn;
}
/**
@internal
*/
eq(e) {
if (this == e)
return !0;
if (!(e instanceof Vt) || this.local.length != e.local.length || this.children.length != e.children.length)
return !1;
for (let n = 0; n < this.local.length; n++)
if (!this.local[n].eq(e.local[n]))
return !1;
for (let n = 0; n < this.children.length; n += 3)
if (this.children[n] != e.children[n] || this.children[n + 1] != e.children[n + 1] || !this.children[n + 2].eq(e.children[n + 2]))
return !1;
return !0;
}
/**
@internal
*/
locals(e) {
return kh(this.localsInner(e));
}
/**
@internal
*/
localsInner(e) {
if (this == cn)
return aa;
if (e.inlineContent || !this.local.some(Ri.is))
return this.local;
let n = [];
for (let r = 0; r < this.local.length; r++)
this.local[r].type instanceof Ri || n.push(this.local[r]);
return n;
}
}
Vt.empty = new Vt([], []);
Vt.removeOverlap = kh;
const cn = Vt.empty;
class Oi {
constructor(e) {
this.members = e;
}
map(e, n) {
const r = this.members.map((i) => i.map(e, n, No));
return Oi.from(r);
}
forChild(e, n) {
if (n.isLeaf)
return Vt.empty;
let r = [];
for (let i = 0; i < this.members.length; i++) {
let o = this.members[i].forChild(e, n);
o != cn && (o instanceof Oi ? r = r.concat(o.members) : r.push(o));
}
return Oi.from(r);
}
eq(e) {
if (!(e instanceof Oi) || e.members.length != this.members.length)
return !1;
for (let n = 0; n < this.members.length; n++)
if (!this.members[n].eq(e.members[n]))
return !1;
return !0;
}
locals(e) {
let n, r = !0;
for (let i = 0; i < this.members.length; i++) {
let o = this.members[i].localsInner(e);
if (o.length)
if (!n)
n = o;
else {
r && (n = n.slice(), r = !1);
for (let a = 0; a < o.length; a++)
n.push(o[a]);
}
}
return n ? kh(r ? n : n.sort(Po)) : aa;
}
// Create a group for the given array of decoration sets, or return
// a single set when possible.
static from(e) {
switch (e.length) {
case 0:
return cn;
case 1:
return e[0];
default:
return new Oi(e.every((n) => n instanceof Vt) ? e : e.reduce((n, r) => n.concat(r instanceof Vt ? r : r.members), []));
}
}
}
function AI(t, e, n, r, i, o, a) {
let s = t.slice();
for (let l = 0, c = o; l < n.maps.length; l++) {
let f = 0;
n.maps[l].forEach((d, p, h, m) => {
let v = m - h - (p - d);
for (let y = 0; y < s.length; y += 3) {
let k = s[y + 1];
if (k < 0 || d > k + c - f)
continue;
let T = s[y] + c - f;
p >= T ? s[y + 1] = d <= T ? -2 : -1 : h >= i && v && (s[y] += v, s[y + 1] += v);
}
f += v;
}), c = n.maps[l].map(c, -1);
}
let u = !1;
for (let l = 0; l < s.length; l += 3)
if (s[l + 1] < 0) {
if (s[l + 1] == -2) {
u = !0, s[l + 1] = -1;
continue;
}
let c = n.map(t[l] + o), f = c - i;
if (f < 0 || f >= r.content.size) {
u = !0;
continue;
}
let d = n.map(t[l + 1] + o, -1), p = d - i, { index: h, offset: m } = r.content.findIndex(f), v = r.maybeChild(h);
if (v && m == f && m + v.nodeSize == p) {
let y = s[l + 2].mapInner(n, v, c + 1, t[l] + o + 1, a);
y != cn ? (s[l] = f, s[l + 1] = p, s[l + 2] = y) : (s[l + 1] = -2, u = !0);
} else
u = !0;
}
if (u) {
let l = MI(s, t, e, n, i, o, a), c = sc(l, r, 0, a);
e = c.local;
for (let f = 0; f < s.length; f += 3)
s[f + 1] < 0 && (s.splice(f, 3), f -= 3);
for (let f = 0, d = 0; f < c.children.length; f += 3) {
let p = c.children[f];
for (; d < s.length && s[d] < p; )
d += 3;
s.splice(d, 0, c.children[f], c.children[f + 1], c.children[f + 2]);
}
}
return new Vt(e.sort(Po), s);
}
function $w(t, e) {
if (!e || !t.length)
return t;
let n = [];
for (let r = 0; r < t.length; r++) {
let i = t[r];
n.push(new Jn(i.from + e, i.to + e, i.type));
}
return n;
}
function MI(t, e, n, r, i, o, a) {
function s(u, l) {
for (let c = 0; c < u.local.length; c++) {
let f = u.local[c].map(r, i, l);
f ? n.push(f) : a.onRemove && a.onRemove(u.local[c].spec);
}
for (let c = 0; c < u.children.length; c += 3)
s(u.children[c + 2], u.children[c] + l + 1);
}
for (let u = 0; u < t.length; u += 3)
t[u + 1] == -1 && s(t[u + 2], e[u] + o + 1);
return n;
}
function Nw(t, e, n) {
if (e.isLeaf)
return null;
let r = n + e.nodeSize, i = null;
for (let o = 0, a; o < t.length; o++)
(a = t[o]) && a.from > n && a.to < r && ((i || (i = [])).push(a), t[o] = null);
return i;
}
function Pw(t) {
let e = [];
for (let n = 0; n < t.length; n++)
t[n] != null && e.push(t[n]);
return e;
}
function sc(t, e, n, r) {
let i = [], o = !1;
e.forEach((s, u) => {
let l = Nw(t, s, u + n);
if (l) {
o = !0;
let c = sc(l, s, n + u + 1, r);
c != cn && i.push(u, u + s.nodeSize, c);
}
});
let a = $w(o ? Pw(t) : t, -n).sort(Po);
for (let s = 0; s < a.length; s++)
a[s].type.valid(e, a[s]) || (r.onRemove && r.onRemove(a[s].spec), a.splice(s--, 1));
return a.length || i.length ? new Vt(a, i) : cn;
}
function Po(t, e) {
return t.from - e.from || t.to - e.to;
}
function kh(t) {
let e = t;
for (let n = 0; n < e.length - 1; n++) {
let r = e[n];
if (r.from != r.to)
for (let i = n + 1; i < e.length; i++) {
let o = e[i];
if (o.from == r.from) {
o.to != r.to && (e == t && (e = t.slice()), e[i] = o.copy(o.from, r.to), Wg(e, i + 1, o.copy(r.to, o.to)));
continue;
} else {
o.from < r.to && (e == t && (e = t.slice()), e[n] = r.copy(r.from, o.from), Wg(e, i, r.copy(o.from, r.to)));
break;
}
}
}
return e;
}
function Wg(t, e, n) {
for (; e < t.length && Po(n, t[e]) > 0; )
e++;
t.splice(e, 0, n);
}
function bf(t) {
let e = [];
return t.someProp("decorations", (n) => {
let r = n(t.state);
r && r != cn && e.push(r);
}), t.cursorWrapper && e.push(Vt.create(t.state.doc, [t.cursorWrapper.deco])), Oi.from(e);
}
const DI = {
childList: !0,
characterData: !0,
characterDataOldValue: !0,
attributes: !0,
attributeOldValue: !0,
subtree: !0
}, $I = Bn && Ii <= 11;
class NI {
constructor() {
this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
}
set(e) {
this.anchorNode = e.anchorNode, this.anchorOffset = e.anchorOffset, this.focusNode = e.focusNode, this.focusOffset = e.focusOffset;
}
clear() {
this.anchorNode = this.focusNode = null;
}
eq(e) {
return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
}
}
class PI {
constructor(e, n) {
this.view = e, this.handleDOMChange = n, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new NI(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
for (let i = 0; i < r.length; i++)
this.queue.push(r[i]);
Bn && Ii <= 11 && r.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
}), $I && (this.onCharData = (r) => {
this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
}), this.onSelectionChange = this.onSelectionChange.bind(this);
}
flushSoon() {
this.flushingSoon < 0 && (this.flushingSoon = window.setTimeout(() => {
this.flushingSoon = -1, this.flush();
}, 20));
}
forceFlush() {
this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
}
start() {
this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, DI)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
}
stop() {
if (this.observer) {
let e = this.observer.takeRecords();
if (e.length) {
for (let n = 0; n < e.length; n++)
this.queue.push(e[n]);
window.setTimeout(() => this.flush(), 20);
}
this.observer.disconnect();
}
this.onCharData && this.view.dom.removeEventListener("DOMCharacterDataModified", this.onCharData), this.disconnectSelection();
}
connectSelection() {
this.view.dom.ownerDocument.addEventListener("selectionchange", this.onSelectionChange);
}
disconnectSelection() {
this.view.dom.ownerDocument.removeEventListener("selectionchange", this.onSelectionChange);
}
suppressSelectionUpdates() {
this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);
}
onSelectionChange() {
if (Bg(this.view)) {
if (this.suppressingSelectionUpdates)
return fi(this.view);
if (Bn && Ii <= 11 && !this.view.state.selection.empty) {
let e = this.view.domSelectionRange();
if (e.focusNode && zo(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
return this.flushSoon();
}
this.flush();
}
}
setCurSelection() {
this.currentSelection.set(this.view.domSelectionRange());
}
ignoreSelectionChange(e) {
if (!e.focusNode)
return !0;
let n = /* @__PURE__ */ new Set(), r;
for (let o = e.focusNode; o; o = ou(o))
n.add(o);
for (let o = e.anchorNode; o; o = ou(o))
if (n.has(o)) {
r = o;
break;
}
let i = r && this.view.docView.nearestDesc(r);
if (i && i.ignoreMutation({
type: "selection",
target: r.nodeType == 3 ? r.parentNode : r
}))
return this.setCurSelection(), !0;
}
pendingRecords() {
if (this.observer)
for (let e of this.observer.takeRecords())
this.queue.push(e);
return this.queue;
}
flush() {
let { view: e } = this;
if (!e.docView || this.flushingSoon > -1)
return;
let n = this.pendingRecords();
n.length && (this.queue = []);
let r = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) && Bg(e) && !this.ignoreSelectionChange(r), o = -1, a = -1, s = !1, u = [];
if (e.editable)
for (let c = 0; c < n.length; c++) {
let f = this.registerMutation(n[c], u);
f && (o = o < 0 ? f.from : Math.min(f.from, o), a = a < 0 ? f.to : Math.max(f.to, a), f.typeOver && (s = !0));
}
if (kr && u.length > 1) {
let c = u.filter((f) => f.nodeName == "BR");
if (c.length == 2) {
let f = c[0], d = c[1];
f.parentNode && f.parentNode.parentNode == d.parentNode ? d.remove() : f.remove();
}
}
let l = null;
o < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && ld(r) && (l = mh(e)) && l.eq(Je.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, fi(e), this.currentSelection.set(r), e.scrollToSelection()) : (o > -1 || i) && (o > -1 && (e.docView.markDirty(o, a), II(e)), this.handleDOMChange(o, a, s, u), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || fi(e), this.currentSelection.set(r));
}
registerMutation(e, n) {
if (n.indexOf(e.target) > -1)
return null;
let r = this.view.docView.nearestDesc(e.target);
if (e.type == "attributes" && (r == this.view.docView || e.attributeName == "contenteditable" || // Firefox sometimes fires spurious events for null/empty styles
e.attributeName == "style" && !e.oldValue && !e.target.getAttribute("style")) || !r || r.ignoreMutation(e))
return null;
if (e.type == "childList") {
for (let c = 0; c < e.addedNodes.length; c++)
n.push(e.addedNodes[c]);
if (r.contentDOM && r.contentDOM != r.dom && !r.contentDOM.contains(e.target))
return { from: r.posBefore, to: r.posAfter };
let i = e.previousSibling, o = e.nextSibling;
if (Bn && Ii <= 11 && e.addedNodes.length)
for (let c = 0; c < e.addedNodes.length; c++) {
let { previousSibling: f, nextSibling: d } = e.addedNodes[c];
(!f || Array.prototype.indexOf.call(e.addedNodes, f) < 0) && (i = f), (!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (o = d);
}
let a = i && i.parentNode == e.target ? yn(i) + 1 : 0, s = r.localPosFromDOM(e.target, a, -1), u = o && o.parentNode == e.target ? yn(o) : e.target.childNodes.length, l = r.localPosFromDOM(e.target, u, 1);
return { from: s, to: l };
} else
return e.type == "attributes" ? { from: r.posAtStart - r.border, to: r.posAtEnd + r.border } : {
from: r.posAtStart,
to: r.posAtEnd,
// An event was generated for a text change that didn't change
// any text. Mark the dom change to fall back to assuming the
// selection was typed over with an identical value if it can't
// find another change.
typeOver: e.target.nodeValue == e.oldValue
};
}
}
let Yg = /* @__PURE__ */ new WeakMap(), Kg = !1;
function II(t) {
if (!Yg.has(t) && (Yg.set(t, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace) !== -1)) {
if (t.requiresGeckoHackNode = kr, Kg)
return;
console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), Kg = !0;
}
}
function LI(t) {
let e;
function n(u) {
u.preventDefault(), u.stopImmediatePropagation(), e = u.getTargetRanges()[0];
}
t.dom.addEventListener("beforeinput", n, !0), document.execCommand("indent"), t.dom.removeEventListener("beforeinput", n, !0);
let r = e.startContainer, i = e.startOffset, o = e.endContainer, a = e.endOffset, s = t.domAtPos(t.state.selection.anchor);
return zo(s.node, s.offset, o, a) && ([r, i, o, a] = [o, a, r, i]), { anchorNode: r, anchorOffset: i, focusNode: o, focusOffset: a };
}
function RI(t, e, n) {
let { node: r, fromOffset: i, toOffset: o, from: a, to: s } = t.docView.parseRange(e, n), u = t.domSelectionRange(), l, c = u.anchorNode;
if (c && t.dom.contains(c.nodeType == 1 ? c : c.parentNode) && (l = [{ node: c, offset: u.anchorOffset }], ld(u) || l.push({ node: u.focusNode, offset: u.focusOffset })), pn && t.input.lastKeyCode === 8)
for (let v = o; v > i; v--) {
let y = r.childNodes[v - 1], k = y.pmViewDesc;
if (y.nodeName == "BR" && !k) {
o = v;
break;
}
if (!k || k.size)
break;
}
let f = t.state.doc, d = t.someProp("domParser") || Fa.fromSchema(t.state.schema), p = f.resolve(a), h = null, m = d.parse(r, {
topNode: p.parent,
topMatch: p.parent.contentMatchAt(p.index()),
topOpen: !0,
from: i,
to: o,
preserveWhitespace: p.parent.type.whitespace == "pre" ? "full" : !0,
findPositions: l,
ruleFromNode: BI,
context: p
});
if (l && l[0].pos != null) {
let v = l[0].pos, y = l[1] && l[1].pos;
y == null && (y = v), h = { anchor: v + a, head: y + a };
}
return { doc: m, sel: h, from: a, to: s };
}
function BI(t) {
let e = t.pmViewDesc;
if (e)
return e.parseRule();
if (t.nodeName == "BR" && t.parentNode) {
if (Tn && /^(ul|ol)$/i.test(t.parentNode.nodeName)) {
let n = document.createElement("div");
return n.appendChild(document.createElement("li")), { skip: n };
} else if (t.parentNode.lastChild == t || Tn && /^(tr|table)$/i.test(t.parentNode.nodeName))
return { ignore: !0 };
} else if (t.nodeName == "IMG" && t.getAttribute("mark-placeholder"))
return { ignore: !0 };
return null;
}
const VI = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
function zI(t, e, n, r, i) {
let o = t.input.compositionPendingChanges || (t.composing ? t.input.compositionID : 0);
if (t.input.compositionPendingChanges = 0, e < 0) {
let N = t.input.lastSelectionTime > Date.now() - 50 ? t.input.lastSelectionOrigin : null, R = mh(t, N);
if (R && !t.state.selection.eq(R)) {
if (pn && br && t.input.lastKeyCode === 13 && Date.now() - 100 < t.input.lastKeyCodeTime && t.someProp("handleKeyDown", (A) => A(t, po(13, "Enter"))))
return;
let w = t.state.tr.setSelection(R);
N == "pointer" ? w.setMeta("pointer", !0) : N == "key" && w.scrollIntoView(), o && w.setMeta("composition", o), t.dispatch(w);
}
return;
}
let a = t.state.doc.resolve(e), s = a.sharedDepth(n);
e = a.before(s + 1), n = t.state.doc.resolve(n).after(s + 1);
let u = t.state.selection, l = RI(t, e, n), c = t.state.doc, f = c.slice(l.from, l.to), d, p;
t.input.lastKeyCode === 8 && Date.now() - 100 < t.input.lastKeyCodeTime ? (d = t.state.selection.to, p = "end") : (d = t.state.selection.from, p = "start"), t.input.lastKeyCode = null;
let h = FI(f.content, l.doc.content, l.from, d, p);
if ((Wa && t.input.lastIOSEnter > Date.now() - 225 || br) && i.some((N) => N.nodeType == 1 && !VI.test(N.nodeName)) && (!h || h.endA >= h.endB) && t.someProp("handleKeyDown", (N) => N(t, po(13, "Enter")))) {
t.input.lastIOSEnter = 0;
return;
}
if (!h)
if (r && u instanceof Ye && !u.empty && u.$head.sameParent(u.$anchor) && !t.composing && !(l.sel && l.sel.anchor != l.sel.head))
h = { start: u.from, endA: u.to, endB: u.to };
else {
if (l.sel) {
let N = Gg(t, t.state.doc, l.sel);
if (N && !N.eq(t.state.selection)) {
let R = t.state.tr.setSelection(N);
o && R.setMeta("composition", o), t.dispatch(R);
}
}
return;
}
if (pn && t.cursorWrapper && l.sel && l.sel.anchor == t.cursorWrapper.deco.from && l.sel.head == l.sel.anchor) {
let N = h.endB - h.start;
l.sel = { anchor: l.sel.anchor + N, head: l.sel.anchor + N };
}
t.input.domChangeCount++, t.state.selection.from < t.state.selection.to && h.start == h.endB && t.state.selection instanceof Ye && (h.start > t.state.selection.from && h.start <= t.state.selection.from + 2 && t.state.selection.from >= l.from ? h.start = t.state.selection.from : h.endA < t.state.selection.to && h.endA >= t.state.selection.to - 2 && t.state.selection.to <= l.to && (h.endB += t.state.selection.to - h.endA, h.endA = t.state.selection.to)), Bn && Ii <= 11 && h.endB == h.start + 1 && h.endA == h.start && h.start > l.from && l.doc.textBetween(h.start - l.from - 1, h.start - l.from + 1) == " " && (h.start--, h.endA--, h.endB--);
let m = l.doc.resolveNoCache(h.start - l.from), v = l.doc.resolveNoCache(h.endB - l.from), y = c.resolve(h.start), k = m.sameParent(v) && m.parent.inlineContent && y.end() >= h.endA, T;
if ((Wa && t.input.lastIOSEnter > Date.now() - 225 && (!k || i.some((N) => N.nodeName == "DIV" || N.nodeName == "P")) || !k && m.pos < l.doc.content.size && !m.sameParent(v) && (T = Je.findFrom(l.doc.resolve(m.pos + 1), 1, !0)) && T.head == v.pos) && t.someProp("handleKeyDown", (N) => N(t, po(13, "Enter")))) {
t.input.lastIOSEnter = 0;
return;
}
if (t.state.selection.anchor > h.start && qI(c, h.start, h.endA, m, v) && t.someProp("handleKeyDown", (N) => N(t, po(8, "Backspace")))) {
br && pn && t.domObserver.suppressSelectionUpdates();
return;
}
pn && br && h.endB == h.start && (t.input.lastAndroidDelete = Date.now()), br && !k && m.start() != v.start() && v.parentOffset == 0 && m.depth == v.depth && l.sel && l.sel.anchor == l.sel.head && l.sel.head == h.endA && (h.endB -= 2, v = l.doc.resolveNoCache(h.endB - l.from), setTimeout(() => {
t.someProp("handleKeyDown", function(N) {
return N(t, po(13, "Enter"));
});
}, 20));
let b = h.start, D = h.endA, x, S, _;
if (k) {
if (m.pos == v.pos)
Bn && Ii <= 11 && m.parentOffset == 0 && (t.domObserver.suppressSelectionUpdates(), setTimeout(() => fi(t), 20)), x = t.state.tr.delete(b, D), S = c.resolve(h.start).marksAcross(c.resolve(h.endA));
else if (
// Adding or removing a mark
h.endA == h.endB && (_ = HI(m.parent.content.cut(m.parentOffset, v.parentOffset), y.parent.content.cut(y.parentOffset, h.endA - y.start())))
)
x = t.state.tr, _.type == "add" ? x.addMark(b, D, _.mark) : x.removeMark(b, D, _.mark);
else if (m.parent.child(m.index()).isText && m.index() == v.index() - (v.textOffset ? 0 : 1)) {
let N = m.parent.textBetween(m.parentOffset, v.parentOffset);
if (t.someProp("handleTextInput", (R) => R(t, b, D, N)))
return;
x = t.state.tr.insertText(N, b, D);
}
}
if (x || (x = t.state.tr.replace(b, D, l.doc.slice(h.start - l.from, h.endB - l.from))), l.sel) {
let N = Gg(t, x.doc, l.sel);
N && !(pn && br && t.composing && N.empty && (h.start != h.endB || t.input.lastAndroidDelete < Date.now() - 100) && (N.head == b || N.head == x.mapping.map(D) - 1) || Bn && N.empty && N.head == b) && x.setSelection(N);
}
S && x.ensureMarks(S), o && x.setMeta("composition", o), t.dispatch(x.scrollIntoView());
}
function Gg(t, e, n) {
return Math.max(n.anchor, n.head) > e.content.size ? null : gh(t, e.resolve(n.anchor), e.resolve(n.head));
}
function HI(t, e) {
let n = t.firstChild.marks, r = e.firstChild.marks, i = n, o = r, a, s, u;
for (let c = 0; c < r.length; c++)
i = r[c].removeFromSet(i);
for (let c = 0; c < n.length; c++)
o = n[c].removeFromSet(o);
if (i.length == 1 && o.length == 0)
s = i[0], a = "add", u = (c) => c.mark(s.addToSet(c.marks));
else if (i.length == 0 && o.length == 1)
s = o[0], a = "remove", u = (c) => c.mark(s.removeFromSet(c.marks));
else
return null;
let l = [];
for (let c = 0; c < e.childCount; c++)
l.push(u(e.child(c)));
if (me.from(l).eq(t))
return { mark: s, type: a };
}
function qI(t, e, n, r, i) {
if (!r.parent.isTextblock || // The content must have shrunk
n - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
vf(r, !0, !1) < i.pos)
return !1;
let o = t.resolve(e);
if (o.parentOffset < o.parent.content.size || !o.parent.isTextblock)
return !1;
let a = t.resolve(vf(o, !0, !0));
return !a.parent.isTextblock || a.pos > n || vf(a, !0, !1) < n ? !1 : r.parent.content.cut(r.parentOffset).eq(a.parent.content);
}
function vf(t, e, n) {
let r = t.depth, i = e ? t.end() : t.pos;
for (; r > 0 && (e || t.indexAfter(r) == t.node(r).childCount); )
r--, i++, e = !1;
if (n) {
let o = t.node(r).maybeChild(t.indexAfter(r));
for (; o && !o.isLeaf; )
o = o.firstChild, i++;
}
return i;
}
function FI(t, e, n, r, i) {
let o = t.findDiffStart(e, n);
if (o == null)
return null;
let { a, b: s } = t.findDiffEnd(e, n + t.size, n + e.size);
if (i == "end") {
let u = Math.max(0, o - Math.min(a, s));
r -= a + u - o;
}
if (a < o && t.size < e.size) {
let u = r <= o && r >= a ? o - r : 0;
o -= u, s = o + (s - a), a = o;
} else if (s < o) {
let u = r <= o && r >= s ? o - r : 0;
o -= u, a = o + (a - s), s = o;
}
return { start: o, endA: a, endB: s };
}
class jI {
/**
Create a view. `place` may be a DOM node that the editor should
be appended to, a function that will place it into the document,
or an object whose `mount` property holds the node to use as the
document container. If it is `null`, the editor will not be
added to the document.
*/
constructor(e, n) {
this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new cI(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = n, this.state = n.state, this.directPlugins = n.plugins || [], this.directPlugins.forEach(eb), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = Qg(this), Xg(this), this.nodeViews = Zg(this), this.docView = $g(this.state.doc, Jg(this), bf(this), this.dom, this), this.domObserver = new PI(this, (r, i, o, a) => zI(this, r, i, o, a)), this.domObserver.start(), dI(this), this.updatePluginViews();
}
/**
Holds `true` when a
[composition](https://w3c.github.io/uievents/#events-compositionevents)
is active.
*/
get composing() {
return this.input.composing;
}
/**
The view's current [props](https://prosemirror.net/docs/ref/#view.EditorProps).
*/
get props() {
if (this._props.state != this.state) {
let e = this._props;
this._props = {};
for (let n in e)
this._props[n] = e[n];
this._props.state = this.state;
}
return this._props;
}
/**
Update the view's props. Will immediately cause an update to
the DOM.
*/
update(e) {
e.handleDOMEvents != this._props.handleDOMEvents && F0(this);
let n = this._props;
this._props = e, e.plugins && (e.plugins.forEach(eb), this.directPlugins = e.plugins), this.updateStateInner(e.state, n);
}
/**
Update the view by updating existing props object with the object
given as argument. Equivalent to `view.update(Object.assign({},
view.props, props))`.
*/
setProps(e) {
let n = {};
for (let r in this._props)
n[r] = this._props[r];
n.state = this.state;
for (let r in e)
n[r] = e[r];
this.update(n);
}
/**
Update the editor's `state` prop, without touching any of the
other props.
*/
updateState(e) {
this.updateStateInner(e, this._props);
}
updateStateInner(e, n) {
let r = this.state, i = !1, o = !1;
e.storedMarks && this.composing && (Mw(this), o = !0), this.state = e;
let a = r.plugins != e.plugins || this._props.plugins != n.plugins;
if (a || this._props.plugins != n.plugins || this._props.nodeViews != n.nodeViews) {
let d = Zg(this);
WI(d, this.nodeViews) && (this.nodeViews = d, i = !0);
}
(a || n.handleDOMEvents != this._props.handleDOMEvents) && F0(this), this.editable = Qg(this), Xg(this);
let s = bf(this), u = Jg(this), l = r.plugins != e.plugins && !r.doc.eq(e.doc) ? "reset" : e.scrollToSelection > r.scrollToSelection ? "to selection" : "preserve", c = i || !this.docView.matchesNode(e.doc, u, s);
(c || !e.selection.eq(r.selection)) && (o = !0);
let f = l == "preserve" && o && this.dom.style.overflowAnchor == null && _P(this);
if (o) {
this.domObserver.stop();
let d = c && (Bn || pn) && !this.composing && !r.selection.empty && !e.selection.empty && UI(r.selection, e.selection);
if (c) {
let p = pn ? this.trackWrites = this.domSelectionRange().focusNode : null;
(i || !this.docView.update(e.doc, u, s, this)) && (this.docView.updateOuterDeco([]), this.docView.destroy(), this.docView = $g(e.doc, u, s, this.dom, this)), p && !this.trackWrites && (d = !0);
}
d || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && JP(this)) ? fi(this, d) : (bw(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
}
this.updatePluginViews(r), l == "reset" ? this.dom.scrollTop = 0 : l == "to selection" ? this.scrollToSelection() : f && TP(f);
}
/**
@internal
*/
scrollToSelection() {
let e = this.domSelectionRange().focusNode;
if (!this.someProp("handleScrollToSelection", (n) => n(this)))
if (this.state.selection instanceof Ve) {
let n = this.docView.domAfterPos(this.state.selection.from);
n.nodeType == 1 && Tg(this, n.getBoundingClientRect(), e);
} else
Tg(this, this.coordsAtPos(this.state.selection.head, 1), e);
}
destroyPluginViews() {
let e;
for (; e = this.pluginViews.pop(); )
e.destroy && e.destroy();
}
updatePluginViews(e) {
if (!e || e.plugins != this.state.plugins || this.directPlugins != this.prevDirectPlugins) {
this.prevDirectPlugins = this.directPlugins, this.destroyPluginViews();
for (let n = 0; n < this.directPlugins.length; n++) {
let r = this.directPlugins[n];
r.spec.view && this.pluginViews.push(r.spec.view(this));
}
for (let n = 0; n < this.state.plugins.length; n++) {
let r = this.state.plugins[n];
r.spec.view && this.pluginViews.push(r.spec.view(this));
}
} else
for (let n = 0; n < this.pluginViews.length; n++) {
let r = this.pluginViews[n];
r.update && r.update(this, e);
}
}
someProp(e, n) {
let r = this._props && this._props[e], i;
if (r != null && (i = n ? n(r) : r))
return i;
for (let a = 0; a < this.directPlugins.length; a++) {
let s = this.directPlugins[a].props[e];
if (s != null && (i = n ? n(s) : s))
return i;
}
let o = this.state.plugins;
if (o)
for (let a = 0; a < o.length; a++) {
let s = o[a].props[e];
if (s != null && (i = n ? n(s) : s))
return i;
}
}
/**
Query whether the view has focus.
*/
hasFocus() {
if (Bn) {
let e = this.root.activeElement;
if (e == this.dom)
return !0;
if (!e || !this.dom.contains(e))
return !1;
for (; e && this.dom != e && this.dom.contains(e); ) {
if (e.contentEditable == "false")
return !1;
e = e.parentElement;
}
return !0;
}
return this.root.activeElement == this.dom;
}
/**
Focus the editor.
*/
focus() {
this.domObserver.stop(), this.editable && CP(this.dom), fi(this), this.domObserver.start();
}
/**
Get the document root in which the editor exists. This will
usually be the top-level `document`, but might be a [shadow
DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)
root if the editor is inside one.
*/
get root() {
let e = this._root;
if (e == null) {
for (let n = this.dom.parentNode; n; n = n.parentNode)
if (n.nodeType == 9 || n.nodeType == 11 && n.host)
return n.getSelection || (Object.getPrototypeOf(n).getSelection = () => n.ownerDocument.getSelection()), this._root = n;
}
return e || document;
}
/**
When an existing editor view is moved to a new document or
shadow tree, call this to make it recompute its root.
*/
updateRoot() {
this._root = null;
}
/**
Given a pair of viewport coordinates, return the document
position that corresponds to them. May return null if the given
coordinates aren't inside of the editor. When an object is
returned, its `pos` property is the position nearest to the
coordinates, and its `inside` property holds the position of the
inner node that the position falls inside of, or -1 if it is at
the top level, not in any node.
*/
posAtCoords(e) {
return $P(this, e);
}
/**
Returns the viewport rectangle at a given document position.
`left` and `right` will be the same number, as this returns a
flat cursor-ish rectangle. If the position is between two things
that aren't directly adjacent, `side` determines which element
is used. When < 0, the element before the position is used,
otherwise the element after.
*/
coordsAtPos(e, n = 1) {
return lw(this, e, n);
}
/**
Find the DOM position that corresponds to the given document
position. When `side` is negative, find the position as close as
possible to the content before the position. When positive,
prefer positions close to the content after the position. When
zero, prefer as shallow a position as possible.
Note that you should **not** mutate the editor's internal DOM,
only inspect it (and even that is usually not necessary).
*/
domAtPos(e, n = 0) {
return this.docView.domFromPos(e, n);
}
/**
Find the DOM node that represents the document node after the
given position. May return `null` when the position doesn't point
in front of a node or if the node is inside an opaque node view.
This is intended to be able to call things like
`getBoundingClientRect` on that DOM node. Do **not** mutate the
editor DOM directly, or add styling this way, since that will be
immediately overriden by the editor as it redraws the node.
*/
nodeDOM(e) {
let n = this.docView.descAt(e);
return n ? n.nodeDOM : null;
}
/**
Find the document position that corresponds to a given DOM
position. (Whenever possible, it is preferable to inspect the
document structure directly, rather than poking around in the
DOM, but sometimes—for example when interpreting an event
target—you don't have a choice.)
The `bias` parameter can be used to influence which side of a DOM
node to use when the position is inside a leaf node.
*/
posAtDOM(e, n, r = -1) {
let i = this.docView.posFromDOM(e, n, r);
if (i == null)
throw new RangeError("DOM position not inside the editor");
return i;
}
/**
Find out whether the selection is at the end of a textblock when
moving in a given direction. When, for example, given `"left"`,
it will return true if moving left from the current cursor
position would leave that position's parent textblock. Will apply
to the view's current state by default, but it is possible to
pass a different state.
*/
endOfTextblock(e, n) {
return RP(this, n || this.state, e);
}
/**
Run the editor's paste logic with the given HTML string. The
`event`, if given, will be passed to the
[`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
*/
pasteHTML(e, n) {
return au(this, "", e, !1, n || new ClipboardEvent("paste"));
}
/**
Run the editor's paste logic with the given plain-text input.
*/
pasteText(e, n) {
return au(this, e, null, !0, n || new ClipboardEvent("paste"));
}
/**
Removes the editor from the DOM and destroys all [node
views](https://prosemirror.net/docs/ref/#view.NodeView).
*/
destroy() {
this.docView && (fI(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], bf(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null);
}
/**
This is true when the view has been
[destroyed](https://prosemirror.net/docs/ref/#view.EditorView.destroy) (and thus should not be
used anymore).
*/
get isDestroyed() {
return this.docView == null;
}
/**
Used for testing.
*/
dispatchEvent(e) {
return hI(this, e);
}
/**
Dispatch a transaction. Will call
[`dispatchTransaction`](https://prosemirror.net/docs/ref/#view.DirectEditorProps.dispatchTransaction)
when given, and otherwise defaults to applying the transaction to
the current state and calling
[`updateState`](https://prosemirror.net/docs/ref/#view.EditorView.updateState) with the result.
This method is bound to the view instance, so that it can be
easily passed around.
*/
dispatch(e) {
let n = this._props.dispatchTransaction;
n ? n.call(this, e) : this.updateState(this.state.apply(e));
}
/**
@internal
*/
domSelectionRange() {
return Tn && this.root.nodeType === 11 && vP(this.dom.ownerDocument) == this.dom ? LI(this) : this.domSelection();
}
/**
@internal
*/
domSelection() {
return this.root.getSelection();
}
}
function Jg(t) {
let e = /* @__PURE__ */ Object.create(null);
return e.class = "ProseMirror", e.contenteditable = String(t.editable), t.someProp("attributes", (n) => {
if (typeof n == "function" && (n = n(t.state)), n)
for (let r in n)
r == "class" ? e.class += " " + n[r] : r == "style" ? e.style = (e.style ? e.style + ";" : "") + n[r] : !e[r] && r != "contenteditable" && r != "nodeName" && (e[r] = String(n[r]));
}), e.translate || (e.translate = "no"), [Jn.node(0, t.state.doc.content.size, e)];
}
function Xg(t) {
if (t.markCursor) {
let e = document.createElement("img");
e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), t.cursorWrapper = { dom: e, deco: Jn.widget(t.state.selection.head, e, { raw: !0, marks: t.markCursor }) };
} else
t.cursorWrapper = null;
}
function Qg(t) {
return !t.someProp("editable", (e) => e(t.state) === !1);
}
function UI(t, e) {
let n = Math.min(t.$anchor.sharedDepth(t.head), e.$anchor.sharedDepth(e.head));
return t.$anchor.start(n) != e.$anchor.start(n);
}
function Zg(t) {
let e = /* @__PURE__ */ Object.create(null);
function n(r) {
for (let i in r)
Object.prototype.hasOwnProperty.call(e, i) || (e[i] = r[i]);
}
return t.someProp("nodeViews", n), t.someProp("markViews", n), e;
}
function WI(t, e) {
let n = 0, r = 0;
for (let i in t) {
if (t[i] != e[i])
return !0;
n++;
}
for (let i in e)
r++;
return n != r;
}
function eb(t) {
if (t.spec.state || t.spec.filterTransaction || t.spec.appendTransaction)
throw new RangeError("Plugins passed directly to the view must not have a state component");
}
var zi = {
8: "Backspace",
9: "Tab",
10: "Enter",
12: "NumLock",
13: "Enter",
16: "Shift",
17: "Control",
18: "Alt",
20: "CapsLock",
27: "Escape",
32: " ",
33: "PageUp",
34: "PageDown",
35: "End",
36: "Home",
37: "ArrowLeft",
38: "ArrowUp",
39: "ArrowRight",
40: "ArrowDown",
44: "PrintScreen",
45: "Insert",
46: "Delete",
59: ";",
61: "=",
91: "Meta",
92: "Meta",
106: "*",
107: "+",
108: ",",
109: "-",
110: ".",
111: "/",
144: "NumLock",
145: "ScrollLock",
160: "Shift",
161: "Shift",
162: "Control",
163: "Control",
164: "Alt",
165: "Alt",
173: "-",
186: ";",
187: "=",
188: ",",
189: "-",
190: ".",
191: "/",
192: "`",
219: "[",
220: "\\",
221: "]",
222: "'"
}, uc = {
48: ")",
49: "!",
50: "@",
51: "#",
52: "$",
53: "%",
54: "^",
55: "&",
56: "*",
57: "(",
59: ":",
61: "+",
173: "_",
186: ":",
187: "+",
188: "<",
189: "_",
190: ">",
191: "?",
192: "~",
219: "{",
220: "|",
221: "}",
222: '"'
}, YI = typeof navigator < "u" && /Mac/.test(navigator.platform), KI = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
for (var rn = 0; rn < 10; rn++)
zi[48 + rn] = zi[96 + rn] = String(rn);
for (var rn = 1; rn <= 24; rn++)
zi[rn + 111] = "F" + rn;
for (var rn = 65; rn <= 90; rn++)
zi[rn] = String.fromCharCode(rn + 32), uc[rn] = String.fromCharCode(rn);
for (var yf in zi)
uc.hasOwnProperty(yf) || (uc[yf] = zi[yf]);
function GI(t) {
var e = YI && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || KI && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? uc : zi)[t.keyCode] || t.key || "Unidentified";
return n == "Esc" && (n = "Escape"), n == "Del" && (n = "Delete"), n == "Left" && (n = "ArrowLeft"), n == "Up" && (n = "ArrowUp"), n == "Right" && (n = "ArrowRight"), n == "Down" && (n = "ArrowDown"), n;
}
const JI = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
function XI(t) {
let e = t.split(/-(?!$)/), n = e[e.length - 1];
n == "Space" && (n = " ");
let r, i, o, a;
for (let s = 0; s < e.length - 1; s++) {
let u = e[s];
if (/^(cmd|meta|m)$/i.test(u))
a = !0;
else if (/^a(lt)?$/i.test(u))
r = !0;
else if (/^(c|ctrl|control)$/i.test(u))
i = !0;
else if (/^s(hift)?$/i.test(u))
o = !0;
else if (/^mod$/i.test(u))
JI ? a = !0 : i = !0;
else
throw new Error("Unrecognized modifier name: " + u);
}
return r && (n = "Alt-" + n), i && (n = "Ctrl-" + n), a && (n = "Meta-" + n), o && (n = "Shift-" + n), n;
}
function QI(t) {
let e = /* @__PURE__ */ Object.create(null);
for (let n in t)
e[XI(n)] = t[n];
return e;
}
function wf(t, e, n = !0) {
return e.altKey && (t = "Alt-" + t), e.ctrlKey && (t = "Ctrl-" + t), e.metaKey && (t = "Meta-" + t), n && e.shiftKey && (t = "Shift-" + t), t;
}
function ZI(t) {
return new un({ props: { handleKeyDown: Iw(t) } });
}
function Iw(t) {
let e = QI(t);
return function(n, r) {
let i = GI(r), o, a = e[wf(i, r)];
if (a && a(n.state, n.dispatch, n))
return !0;
if (i.length == 1 && i != " ") {
if (r.shiftKey) {
let s = e[wf(i, r, !1)];
if (s && s(n.state, n.dispatch, n))
return !0;
}
if ((r.shiftKey || r.altKey || r.metaKey || i.charCodeAt(0) > 127) && (o = zi[r.keyCode]) && o != i) {
let s = e[wf(o, r)];
if (s && s(n.state, n.dispatch, n))
return !0;
}
}
return !1;
};
}
const eL = (t, e) => t.selection.empty ? !1 : (e && e(t.tr.deleteSelection().scrollIntoView()), !0);
function tL(t, e) {
let { $cursor: n } = t.selection;
return !n || (e ? !e.endOfTextblock("backward", t) : n.parentOffset > 0) ? null : n;
}
const nL = (t, e, n) => {
let r = tL(t, n);
if (!r)
return !1;
let i = Lw(r);
if (!i) {
let a = r.blockRange(), s = a && Qa(a);
return s == null ? !1 : (e && e(t.tr.lift(a, s).scrollIntoView()), !0);
}
let o = i.nodeBefore;
if (!o.type.spec.isolating && Vw(t, i, e))
return !0;
if (r.parent.content.size == 0 && (Ka(o, "end") || Ve.isSelectable(o))) {
let a = dh(t.doc, r.before(), r.after(), Te.empty);
if (a && a.slice.size < a.to - a.from) {
if (e) {
let s = t.tr.step(a);
s.setSelection(Ka(o, "end") ? Je.findFrom(s.doc.resolve(s.mapping.map(i.pos, -1)), -1) : Ve.create(s.doc, i.pos - o.nodeSize)), e(s.scrollIntoView());
}
return !0;
}
}
return o.isAtom && i.depth == r.depth - 1 ? (e && e(t.tr.delete(i.pos - o.nodeSize, i.pos).scrollIntoView()), !0) : !1;
};
function Ka(t, e, n = !1) {
for (let r = t; r; r = e == "start" ? r.firstChild : r.lastChild) {
if (r.isTextblock)
return !0;
if (n && r.childCount != 1)
return !1;
}
return !1;
}
const rL = (t, e, n) => {
let { $head: r, empty: i } = t.selection, o = r;
if (!i)
return !1;
if (r.parent.isTextblock) {
if (n ? !n.endOfTextblock("backward", t) : r.parentOffset > 0)
return !1;
o = Lw(r);
}
let a = o && o.nodeBefore;
return !a || !Ve.isSelectable(a) ? !1 : (e && e(t.tr.setSelection(Ve.create(t.doc, o.pos - a.nodeSize)).scrollIntoView()), !0);
};
function Lw(t) {
if (!t.parent.type.spec.isolating)
for (let e = t.depth - 1; e >= 0; e--) {
if (t.index(e) > 0)
return t.doc.resolve(t.before(e + 1));
if (t.node(e).type.spec.isolating)
break;
}
return null;
}
function iL(t, e) {
let { $cursor: n } = t.selection;
return !n || (e ? !e.endOfTextblock("forward", t) : n.parentOffset < n.parent.content.size) ? null : n;
}
const oL = (t, e, n) => {
let r = iL(t, n);
if (!r)
return !1;
let i = Rw(r);
if (!i)
return !1;
let o = i.nodeAfter;
if (Vw(t, i, e))
return !0;
if (r.parent.content.size == 0 && (Ka(o, "start") || Ve.isSelectable(o))) {
let a = dh(t.doc, r.before(), r.after(), Te.empty);
if (a && a.slice.size < a.to - a.from) {
if (e) {
let s = t.tr.step(a);
s.setSelection(Ka(o, "start") ? Je.findFrom(s.doc.resolve(s.mapping.map(i.pos)), 1) : Ve.create(s.doc, s.mapping.map(i.pos))), e(s.scrollIntoView());
}
return !0;
}
}
return o.isAtom && i.depth == r.depth - 1 ? (e && e(t.tr.delete(i.pos, i.pos + o.nodeSize).scrollIntoView()), !0) : !1;
}, aL = (t, e, n) => {
let { $head: r, empty: i } = t.selection, o = r;
if (!i)
return !1;
if (r.parent.isTextblock) {
if (n ? !n.endOfTextblock("forward", t) : r.parentOffset < r.parent.content.size)
return !1;
o = Rw(r);
}
let a = o && o.nodeAfter;
return !a || !Ve.isSelectable(a) ? !1 : (e && e(t.tr.setSelection(Ve.create(t.doc, o.pos)).scrollIntoView()), !0);
};
function Rw(t) {
if (!t.parent.type.spec.isolating)
for (let e = t.depth - 1; e >= 0; e--) {
let n = t.node(e);
if (t.index(e) + 1 < n.childCount)
return t.doc.resolve(t.after(e + 1));
if (n.type.spec.isolating)
break;
}
return null;
}
const sL = (t, e) => {
let n = t.selection, r = n instanceof Ve, i;
if (r) {
if (n.node.isTextblock || !Xi(t.doc, n.from))
return !1;
i = n.from;
} else if (i = sd(t.doc, n.from, -1), i == null)
return !1;
if (e) {
let o = t.tr.join(i);
r && o.setSelection(Ve.create(o.doc, i - t.doc.resolve(i).nodeBefore.nodeSize)), e(o.scrollIntoView());
}
return !0;
}, uL = (t, e) => {
let n = t.selection, r;
if (n instanceof Ve) {
if (n.node.isTextblock || !Xi(t.doc, n.to))
return !1;
r = n.to;
} else if (r = sd(t.doc, n.to, 1), r == null)
return !1;
return e && e(t.tr.join(r).scrollIntoView()), !0;
}, lL = (t, e) => {
let { $from: n, $to: r } = t.selection, i = n.blockRange(r), o = i && Qa(i);
return o == null ? !1 : (e && e(t.tr.lift(i, o).scrollIntoView()), !0);
}, cL = (t, e) => {
let { $head: n, $anchor: r } = t.selection;
return !n.parent.type.spec.code || !n.sameParent(r) ? !1 : (e && e(t.tr.insertText(`
`).scrollIntoView()), !0);
};
function Bw(t) {
for (let e = 0; e < t.edgeCount; e++) {
let { type: n } = t.edge(e);
if (n.isTextblock && !n.hasRequiredAttrs())
return n;
}
return null;
}
const dL = (t, e) => {
let { $head: n, $anchor: r } = t.selection;
if (!n.parent.type.spec.code || !n.sameParent(r))
return !1;
let i = n.node(-1), o = n.indexAfter(-1), a = Bw(i.contentMatchAt(o));
if (!a || !i.canReplaceWith(o, o, a))
return !1;
if (e) {
let s = n.after(), u = t.tr.replaceWith(s, s, a.createAndFill());
u.setSelection(Je.near(u.doc.resolve(s), 1)), e(u.scrollIntoView());
}
return !0;
}, fL = (t, e) => {
let n = t.selection, { $from: r, $to: i } = n;
if (n instanceof wr || r.parent.inlineContent || i.parent.inlineContent)
return !1;
let o = Bw(i.parent.contentMatchAt(i.indexAfter()));
if (!o || !o.isTextblock)
return !1;
if (e) {
let a = (!r.parentOffset && i.index() < i.parent.childCount ? r : i).pos, s = t.tr.insert(a, o.createAndFill());
s.setSelection(Ye.create(s.doc, a + 1)), e(s.scrollIntoView());
}
return !0;
}, pL = (t, e) => {
let { $cursor: n } = t.selection;
if (!n || n.parent.content.size)
return !1;
if (n.depth > 1 && n.after() != n.end(-1)) {
let o = n.before();
if (wa(t.doc, o))
return e && e(t.tr.split(o).scrollIntoView()), !0;
}
let r = n.blockRange(), i = r && Qa(r);
return i == null ? !1 : (e && e(t.tr.lift(r, i).scrollIntoView()), !0);
}, hL = (t, e) => {
let { $from: n, to: r } = t.selection, i, o = n.sharedDepth(r);
return o == 0 ? !1 : (i = n.before(o), e && e(t.tr.setSelection(Ve.create(t.doc, i))), !0);
};
function mL(t, e, n) {
let r = e.nodeBefore, i = e.nodeAfter, o = e.index();
return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && e.parent.canReplace(o - 1, o) ? (n && n(t.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(o, o + 1) || !(i.isTextblock || Xi(t.doc, e.pos)) ? !1 : (n && n(t.tr.clearIncompatible(e.pos, r.type, r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()), !0);
}
function Vw(t, e, n) {
let r = e.nodeBefore, i = e.nodeAfter, o, a;
if (r.type.spec.isolating || i.type.spec.isolating)
return !1;
if (mL(t, e, n))
return !0;
let s = e.parent.canReplace(e.index(), e.index() + 1);
if (s && (o = (a = r.contentMatchAt(r.childCount)).findWrapping(i.type)) && a.matchType(o[0] || i.type).validEnd) {
if (n) {
let f = e.pos + i.nodeSize, d = me.empty;
for (let m = o.length - 1; m >= 0; m--)
d = me.from(o[m].create(null, d));
d = me.from(r.copy(d));
let p = t.tr.step(new Gt(e.pos - 1, f, e.pos, f, new Te(d, 1, 0), o.length, !0)), h = f + 2 * o.length;
Xi(p.doc, h) && p.join(h), n(p.scrollIntoView());
}
return !0;
}
let u = Je.findFrom(e, 1), l = u && u.$from.blockRange(u.$to), c = l && Qa(l);
if (c != null && c >= e.depth)
return n && n(t.tr.lift(l, c).scrollIntoView()), !0;
if (s && Ka(i, "start", !0) && Ka(r, "end")) {
let f = r, d = [];
for (; d.push(f), !f.isTextblock; )
f = f.lastChild;
let p = i, h = 1;
for (; !p.isTextblock; p = p.firstChild)
h++;
if (f.canReplace(f.childCount, f.childCount, p.content)) {
if (n) {
let m = me.empty;
for (let y = d.length - 1; y >= 0; y--)
m = me.from(d[y].copy(m));
let v = t.tr.step(new Gt(e.pos - d.length, e.pos + i.nodeSize, e.pos + h, e.pos + i.nodeSize - h, new Te(m, d.length, 0), 0, !0));
n(v.scrollIntoView());
}
return !0;
}
}
return !1;
}
function zw(t) {
return function(e, n) {
let r = e.selection, i = t < 0 ? r.$from : r.$to, o = i.depth;
for (; i.node(o).isInline; ) {
if (!o)
return !1;
o--;
}
return i.node(o).isTextblock ? (n && n(e.tr.setSelection(Ye.create(e.doc, t < 0 ? i.start(o) : i.end(o)))), !0) : !1;
};
}
const gL = zw(-1), bL = zw(1);
function vL(t, e = null) {
return function(n, r) {
let { $from: i, $to: o } = n.selection, a = i.blockRange(o), s = a && ch(a, t, e);
return s ? (r && r(n.tr.wrap(a, s).scrollIntoView()), !0) : !1;
};
}
function tb(t, e = null) {
return function(n, r) {
let i = !1;
for (let o = 0; o < n.selection.ranges.length && !i; o++) {
let { $from: { pos: a }, $to: { pos: s } } = n.selection.ranges[o];
n.doc.nodesBetween(a, s, (u, l) => {
if (i)
return !1;
if (!(!u.isTextblock || u.hasMarkup(t, e)))
if (u.type == t)
i = !0;
else {
let c = n.doc.resolve(l), f = c.index();
i = c.parent.canReplaceWith(f, f + 1, t);
}
});
}
if (!i)
return !1;
if (r) {
let o = n.tr;
for (let a = 0; a < n.selection.ranges.length; a++) {
let { $from: { pos: s }, $to: { pos: u } } = n.selection.ranges[a];
o.setBlockType(s, u, t, e);
}
r(o.scrollIntoView());
}
return !0;
};
}
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
function yL(t, e = null) {
return function(n, r) {
let { $from: i, $to: o } = n.selection, a = i.blockRange(o), s = !1, u = a;
if (!a)
return !1;
if (a.depth >= 2 && i.node(a.depth - 1).type.compatibleContent(t) && a.startIndex == 0) {
if (i.index(a.depth - 1) == 0)
return !1;
let c = n.doc.resolve(a.start - 2);
u = new ec(c, c, a.depth), a.endIndex < a.parent.childCount && (a = new ec(i, n.doc.resolve(o.end(a.depth)), a.depth)), s = !0;
}
let l = ch(u, t, e, a);
return l ? (r && r(wL(n.tr, a, l, s, t).scrollIntoView()), !0) : !1;
};
}
function wL(t, e, n, r, i) {
let o = me.empty;
for (let c = n.length - 1; c >= 0; c--)
o = me.from(n[c].type.create(n[c].attrs, o));
t.step(new Gt(e.start - (r ? 2 : 0), e.end, e.start, e.end, new Te(o, 0, 0), n.length, !0));
let a = 0;
for (let c = 0; c < n.length; c++)
n[c].type == i && (a = c + 1);
let s = n.length - a, u = e.start + n.length - (r ? 2 : 0), l = e.parent;
for (let c = e.startIndex, f = e.endIndex, d = !0; c < f; c++, d = !1)
!d && wa(t.doc, u, s) && (t.split(u, s), u += 2 * s), u += l.child(c).nodeSize;
return t;
}
function kL(t) {
return function(e, n) {
let { $from: r, $to: i } = e.selection, o = r.blockRange(i, (a) => a.childCount > 0 && a.firstChild.type == t);
return o ? n ? r.node(o.depth - 1).type == t ? xL(e, n, t, o) : SL(e, n, o) : !0 : !1;
};
}
function xL(t, e, n, r) {
let i = t.tr, o = r.end, a = r.$to.end(r.depth);
o < a && (i.step(new Gt(o - 1, a, o, a, new Te(me.from(n.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new ec(i.doc.resolve(r.$from.pos), i.doc.resolve(a), r.depth));
const s = Qa(r);
if (s == null)
return !1;
i.lift(r, s);
let u = i.mapping.map(o, -1) - 1;
return Xi(i.doc, u) && i.join(u), e(i.scrollIntoView()), !0;
}
function SL(t, e, n) {
let r = t.tr, i = n.parent;
for (let p = n.end, h = n.endIndex - 1, m = n.startIndex; h > m; h--)
p -= i.child(h).nodeSize, r.delete(p - 1, p + 1);
let o = r.doc.resolve(n.start), a = o.nodeAfter;
if (r.mapping.map(n.end) != n.start + o.nodeAfter.nodeSize)
return !1;
let s = n.startIndex == 0, u = n.endIndex == i.childCount, l = o.node(-1), c = o.index(-1);
if (!l.canReplace(c + (s ? 0 : 1), c + 1, a.content.append(u ? me.empty : me.from(i))))
return !1;
let f = o.pos, d = f + a.nodeSize;
return r.step(new Gt(f - (s ? 1 : 0), d + (u ? 1 : 0), f + 1, d - 1, new Te((s ? me.empty : me.from(i.copy(me.empty))).append(u ? me.empty : me.from(i.copy(me.empty))), s ? 0 : 1, u ? 0 : 1), s ? 0 : 1)), e(r.scrollIntoView()), !0;
}
function EL(t) {
return function(e, n) {
let { $from: r, $to: i } = e.selection, o = r.blockRange(i, (l) => l.childCount > 0 && l.firstChild.type == t);
if (!o)
return !1;
let a = o.startIndex;
if (a == 0)
return !1;
let s = o.parent, u = s.child(a - 1);
if (u.type != t)
return !1;
if (n) {
let l = u.lastChild && u.lastChild.type == s.type, c = me.from(l ? t.create() : null), f = new Te(me.from(t.create(null, me.from(s.type.create(null, c)))), l ? 3 : 1, 0), d = o.start, p = o.end;
n(e.tr.step(new Gt(d - (l ? 3 : 1), p, d, p, f, 1, !0)).scrollIntoView());
}
return !0;
};
}
function fd(t) {
const { state: e, transaction: n } = t;
let { selection: r } = n, { doc: i } = n, { storedMarks: o } = n;
return {
...e,
apply: e.apply.bind(e),
applyTransaction: e.applyTransaction.bind(e),
filterTransaction: e.filterTransaction,
plugins: e.plugins,
schema: e.schema,
reconfigure: e.reconfigure.bind(e),
toJSON: e.toJSON.bind(e),
get storedMarks() {
return o;
},
get selection() {
return r;
},
get doc() {
return i;
},
get tr() {
return r = n.selection, i = n.doc, o = n.storedMarks, n;
}
};
}
class pd {
constructor(e) {
this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
}
get hasCustomState() {
return !!this.customState;
}
get state() {
return this.customState || this.editor.state;
}
get commands() {
const { rawCommands: e, editor: n, state: r } = this, { view: i } = n, { tr: o } = r, a = this.buildProps(o);
return Object.fromEntries(Object.entries(e).map(([s, u]) => [s, (...c) => {
const f = u(...c)(a);
return !o.getMeta("preventDispatch") && !this.hasCustomState && i.dispatch(o), f;
}]));
}
get chain() {
return () => this.createChain();
}
get can() {
return () => this.createCan();
}
createChain(e, n = !0) {
const { rawCommands: r, editor: i, state: o } = this, { view: a } = i, s = [], u = !!e, l = e || o.tr, c = () => (!u && n && !l.getMeta("preventDispatch") && !this.hasCustomState && a.dispatch(l), s.every((d) => d === !0)), f = {
...Object.fromEntries(Object.entries(r).map(([d, p]) => [d, (...m) => {
const v = this.buildProps(l, n), y = p(...m)(v);
return s.push(y), f;
}])),
run: c
};
return f;
}
createCan(e) {
const { rawCommands: n, state: r } = this, i = !1, o = e || r.tr, a = this.buildProps(o, i);
return {
...Object.fromEntries(Object.entries(n).map(([u, l]) => [u, (...c) => l(...c)({ ...a, dispatch: void 0 })])),
chain: () => this.createChain(o, i)
};
}
buildProps(e, n = !0) {
const { rawCommands: r, editor: i, state: o } = this, { view: a } = i, s = {
tr: e,
editor: i,
view: a,
state: fd({
state: o,
transaction: e
}),
dispatch: n ? () => {
} : void 0,
chain: () => this.createChain(e, n),
can: () => this.createCan(e),
get commands() {
return Object.fromEntries(Object.entries(r).map(([u, l]) => [u, (...c) => l(...c)(s)]));
}
};
return s;
}
}
class _L {
constructor() {
this.callbacks = {};
}
on(e, n) {
return this.callbacks[e] || (this.callbacks[e] = []), this.callbacks[e].push(n), this;
}
emit(e, ...n) {
const r = this.callbacks[e];
return r && r.forEach((i) => i.apply(this, n)), this;
}
off(e, n) {
const r = this.callbacks[e];
return r && (n ? this.callbacks[e] = r.filter((i) => i !== n) : delete this.callbacks[e]), this;
}
removeAllListeners() {
this.callbacks = {};
}
}
function Me(t, e, n) {
return t.config[e] === void 0 && t.parent ? Me(t.parent, e, n) : typeof t.config[e] == "function" ? t.config[e].bind({
...n,
parent: t.parent ? Me(t.parent, e, n) : null
}) : t.config[e];
}
function hd(t) {
const e = t.filter((i) => i.type === "extension"), n = t.filter((i) => i.type === "node"), r = t.filter((i) => i.type === "mark");
return {
baseExtensions: e,
nodeExtensions: n,
markExtensions: r
};
}
function Hw(t) {
const e = [], { nodeExtensions: n, markExtensions: r } = hd(t), i = [...n, ...r], o = {
default: null,
rendered: !0,
renderHTML: null,
parseHTML: null,
keepOnSplit: !0,
isRequired: !1
};
return t.forEach((a) => {
const s = {
name: a.name,
options: a.options,
storage: a.storage
}, u = Me(a, "addGlobalAttributes", s);
if (!u)
return;
u().forEach((c) => {
c.types.forEach((f) => {
Object.entries(c.attributes).forEach(([d, p]) => {
e.push({
type: f,
name: d,
attribute: {
...o,
...p
}
});
});
});
});
}), i.forEach((a) => {
const s = {
name: a.name,
options: a.options,
storage: a.storage
}, u = Me(a, "addAttributes", s);
if (!u)
return;
const l = u();
Object.entries(l).forEach(([c, f]) => {
const d = {
...o,
...f
};
typeof (d == null ? void 0 : d.default) == "function" && (d.default = d.default()), d != null && d.isRequired && (d == null ? void 0 : d.default) === void 0 && delete d.default, e.push({
type: a.name,
name: c,
attribute: d
});
});
}), e;
}
function Xt(t, e) {
if (typeof t == "string") {
if (!e.nodes[t])
throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);
return e.nodes[t];
}
return t;
}
function Pt(...t) {
return t.filter((e) => !!e).reduce((e, n) => {
const r = { ...e };
return Object.entries(n).forEach(([i, o]) => {
if (!r[i]) {
r[i] = o;
return;
}
if (i === "class") {
const s = o ? o.split(" ") : [], u = r[i] ? r[i].split(" ") : [], l = s.filter((c) => !u.includes(c));
r[i] = [...u, ...l].join(" ");
} else
i === "style" ? r[i] = [r[i], o].join("; ") : r[i] = o;
}), r;
}, {});
}
function j0(t, e) {
return e.filter((n) => n.attribute.rendered).map((n) => n.attribute.renderHTML ? n.attribute.renderHTML(t.attrs) || {} : {
[n.name]: t.attrs[n.name]
}).reduce((n, r) => Pt(n, r), {});
}
function qw(t) {
return typeof t == "function";
}
function Ge(t, e = void 0, ...n) {
return qw(t) ? e ? t.bind(e)(...n) : t(...n) : t;
}
function TL(t = {}) {
return Object.keys(t).length === 0 && t.constructor === Object;
}
function CL(t) {
return typeof t != "string" ? t : t.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(t) : t === "true" ? !0 : t === "false" ? !1 : t;
}
function nb(t, e) {
return t.style ? t : {
...t,
getAttrs: (n) => {
const r = t.getAttrs ? t.getAttrs(n) : t.attrs;
if (r === !1)
return !1;
const i = e.reduce((o, a) => {
const s = a.attribute.parseHTML ? a.attribute.parseHTML(n) : CL(n.getAttribute(a.name));
return s == null ? o : {
...o,
[a.name]: s
};
}, {});
return { ...r, ...i };
}
};
}
function rb(t) {
return Object.fromEntries(
// @ts-ignore
Object.entries(t).filter(([e, n]) => e === "attrs" && TL(n) ? !1 : n != null)
);
}
function OL(t, e) {
var n;
const r = Hw(t), { nodeExtensions: i, markExtensions: o } = hd(t), a = (n = i.find((l) => Me(l, "topNode"))) === null || n === void 0 ? void 0 : n.name, s = Object.fromEntries(i.map((l) => {
const c = r.filter((y) => y.type === l.name), f = {
name: l.name,
options: l.options,
storage: l.storage,
editor: e
}, d = t.reduce((y, k) => {
const T = Me(k, "extendNodeSchema", f);
return {
...y,
...T ? T(l) : {}
};
}, {}), p = rb({
...d,
content: Ge(Me(l, "content", f)),
marks: Ge(Me(l, "marks", f)),
group: Ge(Me(l, "group", f)),
inline: Ge(Me(l, "inline", f)),
atom: Ge(Me(l, "atom", f)),
selectable: Ge(Me(l, "selectable", f)),
draggable: Ge(Me(l, "draggable", f)),
code: Ge(Me(l, "code", f)),
defining: Ge(Me(l, "defining", f)),
isolating: Ge(Me(l, "isolating", f)),
attrs: Object.fromEntries(c.map((y) => {
var k;
return [y.name, { default: (k = y == null ? void 0 : y.attribute) === null || k === void 0 ? void 0 : k.default }];
}))
}), h = Ge(Me(l, "parseHTML", f));
h && (p.parseDOM = h.map((y) => nb(y, c)));
const m = Me(l, "renderHTML", f);
m && (p.toDOM = (y) => m({
node: y,
HTMLAttributes: j0(y, c)
}));
const v = Me(l, "renderText", f);
return v && (p.toText = v), [l.name, p];
})), u = Object.fromEntries(o.map((l) => {
const c = r.filter((v) => v.type === l.name), f = {
name: l.name,
options: l.options,
storage: l.storage,
editor: e
}, d = t.reduce((v, y) => {
const k = Me(y, "extendMarkSchema", f);
return {
...v,
...k ? k(l) : {}
};
}, {}), p = rb({
...d,
inclusive: Ge(Me(l, "inclusive", f)),
excludes: Ge(Me(l, "excludes", f)),
group: Ge(Me(l, "group", f)),
spanning: Ge(Me(l, "spanning", f)),
code: Ge(Me(l, "code", f)),
attrs: Object.fromEntries(c.map((v) => {
var y;
return [v.name, { default: (y = v == null ? void 0 : v.attribute) === null || y === void 0 ? void 0 : y.default }];
}))
}), h = Ge(Me(l, "parseHTML", f));
h && (p.parseDOM = h.map((v) => nb(v, c)));
const m = Me(l, "renderHTML", f);
return m && (p.toDOM = (v) => m({
mark: v,
HTMLAttributes: j0(v, c)
})), [l.name, p];
}));
return new RN({
topNode: a,
nodes: s,
marks: u
});
}
function kf(t, e) {
return e.nodes[t] || e.marks[t] || null;
}
function ib(t, e) {
return Array.isArray(e) ? e.some((n) => (typeof n == "string" ? n : n.name) === t.name) : e;
}
const AL = (t, e = 500) => {
let n = "";
const r = t.parentOffset;
return t.parent.nodesBetween(Math.max(0, r - e), r, (i, o, a, s) => {
var u, l;
const c = ((l = (u = i.type.spec).toText) === null || l === void 0 ? void 0 : l.call(u, {
node: i,
pos: o,
parent: a,
index: s
})) || i.textContent || "%leaf%";
n += c.slice(0, Math.max(0, r - o));
}), n;
};
function xh(t) {
return Object.prototype.toString.call(t) === "[object RegExp]";
}
class md {
constructor(e) {
this.find = e.find, this.handler = e.handler;
}
}
const ML = (t, e) => {
if (xh(e))
return e.exec(t);
const n = e(t);
if (!n)
return null;
const r = [n.text];
return r.index = n.index, r.input = t, r.data = n.data, n.replaceWith && (n.text.includes(n.replaceWith) || console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'), r.push(n.replaceWith)), r;
};
function xf(t) {
var e;
const { editor: n, from: r, to: i, text: o, rules: a, plugin: s } = t, { view: u } = n;
if (u.composing)
return !1;
const l = u.state.doc.resolve(r);
if (
// check for code node
l.parent.type.spec.code || !((e = l.nodeBefore || l.nodeAfter) === null || e === void 0) && e.marks.find((d) => d.type.spec.code)
)
return !1;
let c = !1;
const f = AL(l) + o;
return a.forEach((d) => {
if (c)
return;
const p = ML(f, d.find);
if (!p)
return;
const h = u.state.tr, m = fd({
state: u.state,
transaction: h
}), v = {
from: r - (p[0].length - o.length),
to: i
}, { commands: y, chain: k, can: T } = new pd({
editor: n,
state: m
});
d.handler({
state: m,
range: v,
match: p,
commands: y,
chain: k,
can: T
}) === null || !h.steps.length || (h.setMeta(s, {
transform: h,
from: r,
to: i,
text: o
}), u.dispatch(h), c = !0);
}), c;
}
function DL(t) {
const { editor: e, rules: n } = t, r = new un({
state: {
init() {
return null;
},
apply(i, o) {
const a = i.getMeta(r);
return a || (i.selectionSet || i.docChanged ? null : o);
}
},
props: {
handleTextInput(i, o, a, s) {
return xf({
editor: e,
from: o,
to: a,
text: s,
rules: n,
plugin: r
});
},
handleDOMEvents: {
compositionend: (i) => (setTimeout(() => {
const { $cursor: o } = i.state.selection;
o && xf({
editor: e,
from: o.pos,
to: o.pos,
text: "",
rules: n,
plugin: r
});
}), !1)
},
// add support for input rules to trigger on enter
// this is useful for example for code blocks
handleKeyDown(i, o) {
if (o.key !== "Enter")
return !1;
const { $cursor: a } = i.state.selection;
return a ? xf({
editor: e,
from: a.pos,
to: a.pos,
text: `
`,
rules: n,
plugin: r
}) : !1;
}
},
// @ts-ignore
isInputRules: !0
});
return r;
}
function $L(t) {
return typeof t == "number";
}
class NL {
constructor(e) {
this.find = e.find, this.handler = e.handler;
}
}
const PL = (t, e) => {
if (xh(e))
return [...t.matchAll(e)];
const n = e(t);
return n ? n.map((r) => {
const i = [r.text];
return i.index = r.index, i.input = t, i.data = r.data, r.replaceWith && (r.text.includes(r.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), i.push(r.replaceWith)), i;
}) : [];
};
function IL(t) {
const { editor: e, state: n, from: r, to: i, rule: o, pasteEvent: a, dropEvent: s } = t, { commands: u, chain: l, can: c } = new pd({
editor: e,
state: n
}), f = [];
return n.doc.nodesBetween(r, i, (p, h) => {
if (!p.isTextblock || p.type.spec.code)
return;
const m = Math.max(r, h), v = Math.min(i, h + p.content.size), y = p.textBetween(m - h, v - h, void 0, "");
PL(y, o.find).forEach((T) => {
if (T.index === void 0)
return;
const b = m + T.index + 1, D = b + T[0].length, x = {
from: n.tr.mapping.map(b),
to: n.tr.mapping.map(D)
}, S = o.handler({
state: n,
range: x,
match: T,
commands: u,
chain: l,
can: c,
pasteEvent: a,
dropEvent: s
});
f.push(S);
});
}), f.every((p) => p !== null);
}
function LL(t) {
const { editor: e, rules: n } = t;
let r = null, i = !1, o = !1, a = new ClipboardEvent("paste"), s = new DragEvent("drop");
return n.map((l) => new un({
// we register a global drag handler to track the current drag source element
view(c) {
const f = (d) => {
var p;
r = !((p = c.dom.parentElement) === null || p === void 0) && p.contains(d.target) ? c.dom.parentElement : null;
};
return window.addEventListener("dragstart", f), {
destroy() {
window.removeEventListener("dragstart", f);
}
};
},
props: {
handleDOMEvents: {
drop: (c, f) => (o = r === c.dom.parentElement, s = f, !1),
paste: (c, f) => {
var d;
const p = (d = f.clipboardData) === null || d === void 0 ? void 0 : d.getData("text/html");
return a = f, i = !!(p != null && p.includes("data-pm-slice")), !1;
}
}
},
appendTransaction: (c, f, d) => {
const p = c[0], h = p.getMeta("uiEvent") === "paste" && !i, m = p.getMeta("uiEvent") === "drop" && !o;
if (!h && !m)
return;
const v = f.doc.content.findDiffStart(d.doc.content), y = f.doc.content.findDiffEnd(d.doc.content);
if (!$L(v) || !y || v === y.b)
return;
const k = d.tr, T = fd({
state: d,
transaction: k
});
if (!(!IL({
editor: e,
state: T,
from: Math.max(v - 1, 0),
to: y.b - 1,
rule: l,
pasteEvent: a,
dropEvent: s
}) || !k.steps.length))
return s = new DragEvent("drop"), a = new ClipboardEvent("paste"), k;
}
}));
}
function RL(t) {
const e = t.filter((n, r) => t.indexOf(n) !== r);
return [...new Set(e)];
}
class da {
constructor(e, n) {
this.splittableMarks = [], this.editor = n, this.extensions = da.resolve(e), this.schema = OL(this.extensions, n), this.extensions.forEach((r) => {
var i;
this.editor.extensionStorage[r.name] = r.storage;
const o = {
name: r.name,
options: r.options,
storage: r.storage,
editor: this.editor,
type: kf(r.name, this.schema)
};
r.type === "mark" && (!((i = Ge(Me(r, "keepOnSplit", o))) !== null && i !== void 0) || i) && this.splittableMarks.push(r.name);
const a = Me(r, "onBeforeCreate", o);
a && this.editor.on("beforeCreate", a);
const s = Me(r, "onCreate", o);
s && this.editor.on("create", s);
const u = Me(r, "onUpdate", o);
u && this.editor.on("update", u);
const l = Me(r, "onSelectionUpdate", o);
l && this.editor.on("selectionUpdate", l);
const c = Me(r, "onTransaction", o);
c && this.editor.on("transaction", c);
const f = Me(r, "onFocus", o);
f && this.editor.on("focus", f);
const d = Me(r, "onBlur", o);
d && this.editor.on("blur", d);
const p = Me(r, "onDestroy", o);
p && this.editor.on("destroy", p);
});
}
static resolve(e) {
const n = da.sort(da.flatten(e)), r = RL(n.map((i) => i.name));
return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((i) => `'${i}'`).join(", ")}]. This can lead to issues.`), n;
}
static flatten(e) {
return e.map((n) => {
const r = {
name: n.name,
options: n.options,
storage: n.storage
}, i = Me(n, "addExtensions", r);
return i ? [n, ...this.flatten(i())] : n;
}).flat(10);
}
static sort(e) {
return e.sort((r, i) => {
const o = Me(r, "priority") || 100, a = Me(i, "priority") || 100;
return o > a ? -1 : o < a ? 1 : 0;
});
}
get commands() {
return this.extensions.reduce((e, n) => {
const r = {
name: n.name,
options: n.options,
storage: n.storage,
editor: this.editor,
type: kf(n.name, this.schema)
}, i = Me(n, "addCommands", r);
return i ? {
...e,
...i()
} : e;
}, {});
}
get plugins() {
const { editor: e } = this, n = da.sort([...this.extensions].reverse()), r = [], i = [], o = n.map((a) => {
const s = {
name: a.name,
options: a.options,
storage: a.storage,
editor: e,
type: kf(a.name, this.schema)
}, u = [], l = Me(a, "addKeyboardShortcuts", s);
let c = {};
if (a.type === "mark" && a.config.exitable && (c.ArrowRight = () => xr.handleExit({ editor: e, mark: a })), l) {
const m = Object.fromEntries(Object.entries(l()).map(([v, y]) => [v, () => y({ editor: e })]));
c = { ...c, ...m };
}
const f = ZI(c);
u.push(f);
const d = Me(a, "addInputRules", s);
ib(a, e.options.enableInputRules) && d && r.push(...d());
const p = Me(a, "addPasteRules", s);
ib(a, e.options.enablePasteRules) && p && i.push(...p());
const h = Me(a, "addProseMirrorPlugins", s);
if (h) {
const m = h();
u.push(...m);
}
return u;
}).flat();
return [
DL({
editor: e,
rules: r
}),
...LL({
editor: e,
rules: i
}),
...o
];
}
get attributes() {
return Hw(this.extensions);
}
get nodeViews() {
const { editor: e } = this, { nodeExtensions: n } = hd(this.extensions);
return Object.fromEntries(n.filter((r) => !!Me(r, "addNodeView")).map((r) => {
const i = this.attributes.filter((u) => u.type === r.name), o = {
name: r.name,
options: r.options,
storage: r.storage,
editor: e,
type: Xt(r.name, this.schema)
}, a = Me(r, "addNodeView", o);
if (!a)
return [];
const s = (u, l, c, f) => {
const d = j0(u, i);
return a()({
editor: e,
node: u,
getPos: c,
decorations: f,
HTMLAttributes: d,
extension: r
});
};
return [r.name, s];
}));
}
}
function BL(t) {
return Object.prototype.toString.call(t).slice(8, -1);
}
function Sf(t) {
return BL(t) !== "Object" ? !1 : t.constructor === Object && Object.getPrototypeOf(t) === Object.prototype;
}
function gd(t, e) {
const n = { ...t };
return Sf(t) && Sf(e) && Object.keys(e).forEach((r) => {
Sf(e[r]) ? r in t ? n[r] = gd(t[r], e[r]) : Object.assign(n, { [r]: e[r] }) : Object.assign(n, { [r]: e[r] });
}), n;
}
class an {
constructor(e = {}) {
this.type = "extension", this.name = "extension", this.parent = null, this.child = null, this.config = {
name: this.name,
defaultOptions: {}
}, this.config = {
...this.config,
...e
}, this.name = this.config.name, e.defaultOptions && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = Ge(Me(this, "addOptions", {
name: this.name
}))), this.storage = Ge(Me(this, "addStorage", {
name: this.name,
options: this.options
})) || {};
}
static create(e = {}) {
return new an(e);
}
configure(e = {}) {
const n = this.extend();
return n.options = gd(this.options, e), n.storage = Ge(Me(n, "addStorage", {
name: n.name,
options: n.options
})), n;
}
extend(e = {}) {
const n = new an(e);
return n.parent = this, this.child = n, n.name = e.name ? e.name : n.parent.name, e.defaultOptions && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = Ge(Me(n, "addOptions", {
name: n.name
})), n.storage = Ge(Me(n, "addStorage", {
name: n.name,
options: n.options
})), n;
}
}
function Fw(t, e, n) {
const { from: r, to: i } = e, { blockSeparator: o = `
`, textSerializers: a = {} } = n || {};
let s = "", u = !0;
return t.nodesBetween(r, i, (l, c, f, d) => {
var p;
const h = a == null ? void 0 : a[l.type.name];
h ? (l.isBlock && !u && (s += o, u = !0), f && (s += h({
node: l,
pos: c,
parent: f,
index: d,
range: e
}))) : l.isText ? (s += (p = l == null ? void 0 : l.text) === null || p === void 0 ? void 0 : p.slice(Math.max(r, c) - c, i - c), u = !1) : l.isBlock && !u && (s += o, u = !0);
}), s;
}
function jw(t) {
return Object.fromEntries(Object.entries(t.nodes).filter(([, e]) => e.spec.toText).map(([e, n]) => [e, n.spec.toText]));
}
const VL = an.create({
name: "clipboardTextSerializer",
addProseMirrorPlugins() {
return [
new un({
key: new er("clipboardTextSerializer"),
props: {
clipboardTextSerializer: () => {
const { editor: t } = this, { state: e, schema: n } = t, { doc: r, selection: i } = e, { ranges: o } = i, a = Math.min(...o.map((c) => c.$from.pos)), s = Math.max(...o.map((c) => c.$to.pos)), u = jw(n);
return Fw(r, { from: a, to: s }, {
textSerializers: u
});
}
}
})
];
}
}), zL = () => ({ editor: t, view: e }) => (requestAnimationFrame(() => {
var n;
t.isDestroyed || (e.dom.blur(), (n = window == null ? void 0 : window.getSelection()) === null || n === void 0 || n.removeAllRanges());
}), !0), HL = (t = !1) => ({ commands: e }) => e.setContent("", t), qL = () => ({ state: t, tr: e, dispatch: n }) => {
const { selection: r } = e, { ranges: i } = r;
return n && i.forEach(({ $from: o, $to: a }) => {
t.doc.nodesBetween(o.pos, a.pos, (s, u) => {
if (s.type.isText)
return;
const { doc: l, mapping: c } = e, f = l.resolve(c.map(u)), d = l.resolve(c.map(u + s.nodeSize)), p = f.blockRange(d);
if (!p)
return;
const h = Qa(p);
if (s.type.isTextblock) {
const { defaultType: m } = f.parent.contentMatchAt(f.index());
e.setNodeMarkup(p.start, m);
}
(h || h === 0) && e.lift(p, h);
});
}), !0;
}, FL = (t) => (e) => t(e), jL = () => ({ state: t, dispatch: e }) => fL(t, e), UL = (t, e) => ({ editor: n, tr: r }) => {
const { state: i } = n, o = i.doc.slice(t.from, t.to);
r.deleteRange(t.from, t.to);
const a = r.mapping.map(e);
return r.insert(a, o.content), r.setSelection(new Ye(r.doc.resolve(a - 1))), !0;
}, WL = () => ({ tr: t, dispatch: e }) => {
const { selection: n } = t, r = n.$anchor.node();
if (r.content.size > 0)
return !1;
const i = t.selection.$anchor;
for (let o = i.depth; o > 0; o -= 1)
if (i.node(o).type === r.type) {
if (e) {
const s = i.before(o), u = i.after(o);
t.delete(s, u).scrollIntoView();
}
return !0;
}
return !1;
}, YL = (t) => ({ tr: e, state: n, dispatch: r }) => {
const i = Xt(t, n.schema), o = e.selection.$anchor;
for (let a = o.depth; a > 0; a -= 1)
if (o.node(a).type === i) {
if (r) {
const u = o.before(a), l = o.after(a);
e.delete(u, l).scrollIntoView();
}
return !0;
}
return !1;
}, KL = (t) => ({ tr: e, dispatch: n }) => {
const { from: r, to: i } = t;
return n && e.delete(r, i), !0;
}, GL = () => ({ state: t, dispatch: e }) => eL(t, e), JL = () => ({ commands: t }) => t.keyboardShortcut("Enter"), XL = () => ({ state: t, dispatch: e }) => dL(t, e);
function lc(t, e, n = { strict: !0 }) {
const r = Object.keys(e);
return r.length ? r.every((i) => n.strict ? e[i] === t[i] : xh(e[i]) ? e[i].test(t[i]) : e[i] === t[i]) : !0;
}
function U0(t, e, n = {}) {
return t.find((r) => r.type === e && lc(r.attrs, n));
}
function QL(t, e, n = {}) {
return !!U0(t, e, n);
}
function Sh(t, e, n = {}) {
if (!t || !e)
return;
let r = t.parent.childAfter(t.parentOffset);
if (t.parentOffset === r.offset && r.offset !== 0 && (r = t.parent.childBefore(t.parentOffset)), !r.node)
return;
const i = U0([...r.node.marks], e, n);
if (!i)
return;
let o = r.index, a = t.start() + r.offset, s = o + 1, u = a + r.node.nodeSize;
for (U0([...r.node.marks], e, n); o > 0 && i.isInSet(t.parent.child(o - 1).marks); )
o -= 1, a -= t.parent.child(o).nodeSize;
for (; s < t.parent.childCount && QL([...t.parent.child(s).marks], e, n); )
u += t.parent.child(s).nodeSize, s += 1;
return {
from: a,
to: u
};
}
function Zi(t, e) {
if (typeof t == "string") {
if (!e.marks[t])
throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);
return e.marks[t];
}
return t;
}
const ZL = (t, e = {}) => ({ tr: n, state: r, dispatch: i }) => {
const o = Zi(t, r.schema), { doc: a, selection: s } = n, { $from: u, from: l, to: c } = s;
if (i) {
const f = Sh(u, o, e);
if (f && f.from <= l && f.to >= c) {
const d = Ye.create(a, f.from, f.to);
n.setSelection(d);
}
}
return !0;
}, eR = (t) => (e) => {
const n = typeof t == "function" ? t(e) : t;
for (let r = 0; r < n.length; r += 1)
if (n[r](e))
return !0;
return !1;
};
function Eh(t) {
return t instanceof Ye;
}
function di(t = 0, e = 0, n = 0) {
return Math.min(Math.max(t, e), n);
}
function Uw(t, e = null) {
if (!e)
return null;
const n = Je.atStart(t), r = Je.atEnd(t);
if (e === "start" || e === !0)
return n;
if (e === "end")
return r;
const i = n.from, o = r.to;
return e === "all" ? Ye.create(t, di(0, i, o), di(t.content.size, i, o)) : Ye.create(t, di(e, i, o), di(e, i, o));
}
function bd() {
return [
"iPad Simulator",
"iPhone Simulator",
"iPod Simulator",
"iPad",
"iPhone",
"iPod"
].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
}
const tR = (t = null, e = {}) => ({ editor: n, view: r, tr: i, dispatch: o }) => {
e = {
scrollIntoView: !0,
...e
};
const a = () => {
bd() && r.dom.focus(), requestAnimationFrame(() => {
n.isDestroyed || (r.focus(), e != null && e.scrollIntoView && n.commands.scrollIntoView());
});
};
if (r.hasFocus() && t === null || t === !1)
return !0;
if (o && t === null && !Eh(n.state.selection))
return a(), !0;
const s = Uw(i.doc, t) || n.state.selection, u = n.state.selection.eq(s);
return o && (u || i.setSelection(s), u && i.storedMarks && i.setStoredMarks(i.storedMarks), a()), !0;
}, nR = (t, e) => (n) => t.every((r, i) => e(r, { ...n, index: i })), rR = (t, e) => ({ tr: n, commands: r }) => r.insertContentAt({ from: n.selection.from, to: n.selection.to }, t, e);
function ob(t) {
const e = `<body>${t}</body>`;
return new window.DOMParser().parseFromString(e, "text/html").body;
}
function cc(t, e, n) {
if (n = {
slice: !0,
parseOptions: {},
...n
}, typeof t == "object" && t !== null)
try {
return Array.isArray(t) && t.length > 0 ? me.fromArray(t.map((r) => e.nodeFromJSON(r))) : e.nodeFromJSON(t);
} catch (r) {
return console.warn("[tiptap warn]: Invalid content.", "Passed value:", t, "Error:", r), cc("", e, n);
}
if (typeof t == "string") {
const r = Fa.fromSchema(e);
return n.slice ? r.parseSlice(ob(t), n.parseOptions).content : r.parse(ob(t), n.parseOptions);
}
return cc("", e, n);
}
function iR(t, e, n) {
const r = t.steps.length - 1;
if (r < e)
return;
const i = t.steps[r];
if (!(i instanceof nn || i instanceof Gt))
return;
const o = t.mapping.maps[r];
let a = 0;
o.forEach((s, u, l, c) => {
a === 0 && (a = c);
}), t.setSelection(Je.near(t.doc.resolve(a), n));
}
const oR = (t) => t.toString().startsWith("<"), aR = (t, e, n) => ({ tr: r, dispatch: i, editor: o }) => {
if (i) {
n = {
parseOptions: {},
updateSelection: !0,
...n
};
const a = cc(e, o.schema, {
parseOptions: {
preserveWhitespace: "full",
...n.parseOptions
}
});
if (a.toString() === "<>")
return !0;
let { from: s, to: u } = typeof t == "number" ? { from: t, to: t } : { from: t.from, to: t.to }, l = !0, c = !0;
if ((oR(a) ? a : [a]).forEach((d) => {
d.check(), l = l ? d.isText && d.marks.length === 0 : !1, c = c ? d.isBlock : !1;
}), s === u && c) {
const { parent: d } = r.doc.resolve(s);
d.isTextblock && !d.type.spec.code && !d.childCount && (s -= 1, u += 1);
}
l ? Array.isArray(e) ? r.insertText(e.map((d) => d.text || "").join(""), s, u) : typeof e == "object" && e && e.text ? r.insertText(e.text, s, u) : r.insertText(e, s, u) : r.replaceWith(s, u, a), n.updateSelection && iR(r, r.steps.length - 1, -1);
}
return !0;
}, sR = () => ({ state: t, dispatch: e }) => sL(t, e), uR = () => ({ state: t, dispatch: e }) => uL(t, e), lR = () => ({ state: t, dispatch: e }) => nL(t, e), cR = () => ({ state: t, dispatch: e }) => oL(t, e), dR = () => ({ tr: t, state: e, dispatch: n }) => {
try {
const r = sd(e.doc, e.selection.$from.pos, -1);
return r == null ? !1 : (t.join(r, 2), n && n(t), !0);
} catch {
return !1;
}
}, fR = () => ({ state: t, dispatch: e, tr: n }) => {
try {
const r = sd(t.doc, t.selection.$from.pos, 1);
return r == null ? !1 : (n.join(r, 2), e && e(n), !0);
} catch {
return !1;
}
};
function _h() {
return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
}
function pR(t) {
const e = t.split(/-(?!$)/);
let n = e[e.length - 1];
n === "Space" && (n = " ");
let r, i, o, a;
for (let s = 0; s < e.length - 1; s += 1) {
const u = e[s];
if (/^(cmd|meta|m)$/i.test(u))
a = !0;
else if (/^a(lt)?$/i.test(u))
r = !0;
else if (/^(c|ctrl|control)$/i.test(u))
i = !0;
else if (/^s(hift)?$/i.test(u))
o = !0;
else if (/^mod$/i.test(u))
bd() || _h() ? a = !0 : i = !0;
else
throw new Error(`Unrecognized modifier name: ${u}`);
}
return r && (n = `Alt-${n}`), i && (n = `Ctrl-${n}`), a && (n = `Meta-${n}`), o && (n = `Shift-${n}`), n;
}
const hR = (t) => ({ editor: e, view: n, tr: r, dispatch: i }) => {
const o = pR(t).split(/-(?!$)/), a = o.find((l) => !["Alt", "Ctrl", "Meta", "Shift"].includes(l)), s = new KeyboardEvent("keydown", {
key: a === "Space" ? " " : a,
altKey: o.includes("Alt"),
ctrlKey: o.includes("Ctrl"),
metaKey: o.includes("Meta"),
shiftKey: o.includes("Shift"),
bubbles: !0,
cancelable: !0
}), u = e.captureTransaction(() => {
n.someProp("handleKeyDown", (l) => l(n, s));
});
return u == null || u.steps.forEach((l) => {
const c = l.map(r.mapping);
c && i && r.maybeStep(c);
}), !0;
};
function uu(t, e, n = {}) {
const { from: r, to: i, empty: o } = t.selection, a = e ? Xt(e, t.schema) : null, s = [];
t.doc.nodesBetween(r, i, (f, d) => {
if (f.isText)
return;
const p = Math.max(r, d), h = Math.min(i, d + f.nodeSize);
s.push({
node: f,
from: p,
to: h
});
});
const u = i - r, l = s.filter((f) => a ? a.name === f.node.type.name : !0).filter((f) => lc(f.node.attrs, n, { strict: !1 }));
return o ? !!l.length : l.reduce((f, d) => f + d.to - d.from, 0) >= u;
}
const mR = (t, e = {}) => ({ state: n, dispatch: r }) => {
const i = Xt(t, n.schema);
return uu(n, i, e) ? lL(n, r) : !1;
}, gR = () => ({ state: t, dispatch: e }) => pL(t, e), bR = (t) => ({ state: e, dispatch: n }) => {
const r = Xt(t, e.schema);
return kL(r)(e, n);
}, vR = () => ({ state: t, dispatch: e }) => cL(t, e);
function vd(t, e) {
return e.nodes[t] ? "node" : e.marks[t] ? "mark" : null;
}
function ab(t, e) {
const n = typeof e == "string" ? [e] : e;
return Object.keys(t).reduce((r, i) => (n.includes(i) || (r[i] = t[i]), r), {});
}
const yR = (t, e) => ({ tr: n, state: r, dispatch: i }) => {
let o = null, a = null;
const s = vd(typeof t == "string" ? t : t.name, r.schema);
return s ? (s === "node" && (o = Xt(t, r.schema)), s === "mark" && (a = Zi(t, r.schema)), i && n.selection.ranges.forEach((u) => {
r.doc.nodesBetween(u.$from.pos, u.$to.pos, (l, c) => {
o && o === l.type && n.setNodeMarkup(c, void 0, ab(l.attrs, e)), a && l.marks.length && l.marks.forEach((f) => {
a === f.type && n.addMark(c, c + l.nodeSize, a.create(ab(f.attrs, e)));
});
});
}), !0) : !1;
}, wR = () => ({ tr: t, dispatch: e }) => (e && t.scrollIntoView(), !0), kR = () => ({ tr: t, commands: e }) => e.setTextSelection({
from: 0,
to: t.doc.content.size
}), xR = () => ({ state: t, dispatch: e }) => rL(t, e), SR = () => ({ state: t, dispatch: e }) => aL(t, e), ER = () => ({ state: t, dispatch: e }) => hL(t, e), _R = () => ({ state: t, dispatch: e }) => bL(t, e), TR = () => ({ state: t, dispatch: e }) => gL(t, e);
function Ww(t, e, n = {}) {
return cc(t, e, { slice: !1, parseOptions: n });
}
const CR = (t, e = !1, n = {}) => ({ tr: r, editor: i, dispatch: o }) => {
const { doc: a } = r, s = Ww(t, i.schema, n);
return o && r.replaceWith(0, a.content.size, s).setMeta("preventUpdate", !e), !0;
};
function yd(t, e) {
const n = Zi(e, t.schema), { from: r, to: i, empty: o } = t.selection, a = [];
o ? (t.storedMarks && a.push(...t.storedMarks), a.push(...t.selection.$head.marks())) : t.doc.nodesBetween(r, i, (u) => {
a.push(...u.marks);
});
const s = a.find((u) => u.type.name === n.name);
return s ? { ...s.attrs } : {};
}
function OR(t, e) {
const n = new tw(t);
return e.forEach((r) => {
r.steps.forEach((i) => {
n.step(i);
});
}), n;
}
function AR(t) {
for (let e = 0; e < t.edgeCount; e += 1) {
const { type: n } = t.edge(e);
if (n.isTextblock && !n.hasRequiredAttrs())
return n;
}
return null;
}
function MR(t, e, n) {
const r = [];
return t.nodesBetween(e.from, e.to, (i, o) => {
n(i) && r.push({
node: i,
pos: o
});
}), r;
}
function DR(t, e) {
for (let n = t.depth; n > 0; n -= 1) {
const r = t.node(n);
if (e(r))
return {
pos: n > 0 ? t.before(n) : 0,
start: t.start(n),
depth: n,
node: r
};
}
}
function Th(t) {
return (e) => DR(e.$from, t);
}
function $R(t, e) {
const n = Lr.fromSchema(e).serializeFragment(t), i = document.implementation.createHTMLDocument().createElement("div");
return i.appendChild(n), i.innerHTML;
}
function NR(t, e) {
const n = {
from: 0,
to: t.content.size
};
return Fw(t, n, e);
}
function PR(t, e) {
const n = Xt(e, t.schema), { from: r, to: i } = t.selection, o = [];
t.doc.nodesBetween(r, i, (s) => {
o.push(s);
});
const a = o.reverse().find((s) => s.type.name === n.name);
return a ? { ...a.attrs } : {};
}
function Yw(t, e) {
const n = vd(typeof e == "string" ? e : e.name, t.schema);
return n === "node" ? PR(t, e) : n === "mark" ? yd(t, e) : {};
}
function IR(t, e = JSON.stringify) {
const n = {};
return t.filter((r) => {
const i = e(r);
return Object.prototype.hasOwnProperty.call(n, i) ? !1 : n[i] = !0;
});
}
function LR(t) {
const e = IR(t);
return e.length === 1 ? e : e.filter((n, r) => !e.filter((o, a) => a !== r).some((o) => n.oldRange.from >= o.oldRange.from && n.oldRange.to <= o.oldRange.to && n.newRange.from >= o.newRange.from && n.newRange.to <= o.newRange.to));
}
function RR(t) {
const { mapping: e, steps: n } = t, r = [];
return e.maps.forEach((i, o) => {
const a = [];
if (i.ranges.length)
i.forEach((s, u) => {
a.push({ from: s, to: u });
});
else {
const { from: s, to: u } = n[o];
if (s === void 0 || u === void 0)
return;
a.push({ from: s, to: u });
}
a.forEach(({ from: s, to: u }) => {
const l = e.slice(o).map(s, -1), c = e.slice(o).map(u), f = e.invert().map(l, -1), d = e.invert().map(c);
r.push({
oldRange: {
from: f,
to: d
},
newRange: {
from: l,
to: c
}
});
});
}), LR(r);
}
function Ch(t, e, n) {
const r = [];
return t === e ? n.resolve(t).marks().forEach((i) => {
const o = n.resolve(t - 1), a = Sh(o, i.type);
a && r.push({
mark: i,
...a
});
}) : n.nodesBetween(t, e, (i, o) => {
r.push(...i.marks.map((a) => ({
from: o,
to: o + i.nodeSize,
mark: a
})));
}), r;
}
function yl(t, e, n) {
return Object.fromEntries(Object.entries(n).filter(([r]) => {
const i = t.find((o) => o.type === e && o.name === r);
return i ? i.attribute.keepOnSplit : !1;
}));
}
function W0(t, e, n = {}) {
const { empty: r, ranges: i } = t.selection, o = e ? Zi(e, t.schema) : null;
if (r)
return !!(t.storedMarks || t.selection.$from.marks()).filter((f) => o ? o.name === f.type.name : !0).find((f) => lc(f.attrs, n, { strict: !1 }));
let a = 0;
const s = [];
if (i.forEach(({ $from: f, $to: d }) => {
const p = f.pos, h = d.pos;
t.doc.nodesBetween(p, h, (m, v) => {
if (!m.isText && !m.marks.length)
return;
const y = Math.max(p, v), k = Math.min(h, v + m.nodeSize), T = k - y;
a += T, s.push(...m.marks.map((b) => ({
mark: b,
from: y,
to: k
})));
});
}), a === 0)
return !1;
const u = s.filter((f) => o ? o.name === f.mark.type.name : !0).filter((f) => lc(f.mark.attrs, n, { strict: !1 })).reduce((f, d) => f + d.to - d.from, 0), l = s.filter((f) => o ? f.mark.type !== o && f.mark.type.excludes(o) : !0).reduce((f, d) => f + d.to - d.from, 0);
return (u > 0 ? u + l : u) >= a;
}
function BR(t, e, n = {}) {
if (!e)
return uu(t, null, n) || W0(t, null, n);
const r = vd(e, t.schema);
return r === "node" ? uu(t, e, n) : r === "mark" ? W0(t, e, n) : !1;
}
function sb(t, e) {
const { nodeExtensions: n } = hd(e), r = n.find((a) => a.name === t);
if (!r)
return !1;
const i = {
name: r.name,
options: r.options,
storage: r.storage
}, o = Ge(Me(r, "group", i));
return typeof o != "string" ? !1 : o.split(" ").includes("list");
}
function VR(t) {
var e;
const n = (e = t.type.createAndFill()) === null || e === void 0 ? void 0 : e.toJSON(), r = t.toJSON();
return JSON.stringify(n) === JSON.stringify(r);
}
function zR(t) {
return t instanceof Ve;
}
function Kw(t, e, n) {
const i = t.state.doc.content.size, o = di(e, 0, i), a = di(n, 0, i), s = t.coordsAtPos(o), u = t.coordsAtPos(a, -1), l = Math.min(s.top, u.top), c = Math.max(s.bottom, u.bottom), f = Math.min(s.left, u.left), d = Math.max(s.right, u.right), p = d - f, h = c - l, y = {
top: l,
bottom: c,
left: f,
right: d,
width: p,
height: h,
x: f,
y: l
};
return {
...y,
toJSON: () => y
};
}
function HR(t, e, n) {
var r;
const { selection: i } = e;
let o = null;
if (Eh(i) && (o = i.$cursor), o) {
const s = (r = t.storedMarks) !== null && r !== void 0 ? r : o.marks();
return !!n.isInSet(s) || !s.some((u) => u.type.excludes(n));
}
const { ranges: a } = i;
return a.some(({ $from: s, $to: u }) => {
let l = s.depth === 0 ? t.doc.inlineContent && t.doc.type.allowsMarkType(n) : !1;
return t.doc.nodesBetween(s.pos, u.pos, (c, f, d) => {
if (l)
return !1;
if (c.isInline) {
const p = !d || d.type.allowsMarkType(n), h = !!n.isInSet(c.marks) || !c.marks.some((m) => m.type.excludes(n));
l = p && h;
}
return !l;
}), l;
});
}
const qR = (t, e = {}) => ({ tr: n, state: r, dispatch: i }) => {
const { selection: o } = n, { empty: a, ranges: s } = o, u = Zi(t, r.schema);
if (i)
if (a) {
const l = yd(r, u);
n.addStoredMark(u.create({
...l,
...e
}));
} else
s.forEach((l) => {
const c = l.$from.pos, f = l.$to.pos;
r.doc.nodesBetween(c, f, (d, p) => {
const h = Math.max(p, c), m = Math.min(p + d.nodeSize, f);
d.marks.find((y) => y.type === u) ? d.marks.forEach((y) => {
u === y.type && n.addMark(h, m, u.create({
...y.attrs,
...e
}));
}) : n.addMark(h, m, u.create(e));
});
});
return HR(r, n, u);
}, FR = (t, e) => ({ tr: n }) => (n.setMeta(t, e), !0), jR = (t, e = {}) => ({ state: n, dispatch: r, chain: i }) => {
const o = Xt(t, n.schema);
return o.isTextblock ? i().command(({ commands: a }) => tb(o, e)(n) ? !0 : a.clearNodes()).command(({ state: a }) => tb(o, e)(a, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
}, UR = (t) => ({ tr: e, dispatch: n }) => {
if (n) {
const { doc: r } = e, i = di(t, 0, r.content.size), o = Ve.create(r, i);
e.setSelection(o);
}
return !0;
}, WR = (t) => ({ tr: e, dispatch: n }) => {
if (n) {
const { doc: r } = e, { from: i, to: o } = typeof t == "number" ? { from: t, to: t } : t, a = Ye.atStart(r).from, s = Ye.atEnd(r).to, u = di(i, a, s), l = di(o, a, s), c = Ye.create(r, u, l);
e.setSelection(c);
}
return !0;
}, YR = (t) => ({ state: e, dispatch: n }) => {
const r = Xt(t, e.schema);
return EL(r)(e, n);
};
function ub(t, e) {
const n = t.storedMarks || t.selection.$to.parentOffset && t.selection.$from.marks();
if (n) {
const r = n.filter((i) => e == null ? void 0 : e.includes(i.type.name));
t.tr.ensureMarks(r);
}
}
const KR = ({ keepMarks: t = !0 } = {}) => ({ tr: e, state: n, dispatch: r, editor: i }) => {
const { selection: o, doc: a } = e, { $from: s, $to: u } = o, l = i.extensionManager.attributes, c = yl(l, s.node().type.name, s.node().attrs);
if (o instanceof Ve && o.node.isBlock)
return !s.parentOffset || !wa(a, s.pos) ? !1 : (r && (t && ub(n, i.extensionManager.splittableMarks), e.split(s.pos).scrollIntoView()), !0);
if (!s.parent.isBlock)
return !1;
if (r) {
const f = u.parentOffset === u.parent.content.size;
o instanceof Ye && e.deleteSelection();
const d = s.depth === 0 ? void 0 : AR(s.node(-1).contentMatchAt(s.indexAfter(-1)));
let p = f && d ? [
{
type: d,
attrs: c
}
] : void 0, h = wa(e.doc, e.mapping.map(s.pos), 1, p);
if (!p && !h && wa(e.doc, e.mapping.map(s.pos), 1, d ? [{ type: d }] : void 0) && (h = !0, p = d ? [
{
type: d,
attrs: c
}
] : void 0), h && (e.split(e.mapping.map(s.pos), 1, p), d && !f && !s.parentOffset && s.parent.type !== d)) {
const m = e.mapping.map(s.before()), v = e.doc.resolve(m);
s.node(-1).canReplaceWith(v.index(), v.index() + 1, d) && e.setNodeMarkup(e.mapping.map(s.before()), d);
}
t && ub(n, i.extensionManager.splittableMarks), e.scrollIntoView();
}
return !0;
}, GR = (t) => ({ tr: e, state: n, dispatch: r, editor: i }) => {
var o;
const a = Xt(t, n.schema), { $from: s, $to: u } = n.selection, l = n.selection.node;
if (l && l.isBlock || s.depth < 2 || !s.sameParent(u))
return !1;
const c = s.node(-1);
if (c.type !== a)
return !1;
const f = i.extensionManager.attributes;
if (s.parent.content.size === 0 && s.node(-1).childCount === s.indexAfter(-1)) {
if (s.depth === 2 || s.node(-3).type !== a || s.index(-2) !== s.node(-2).childCount - 1)
return !1;
if (r) {
let v = me.empty;
const y = s.index(-1) ? 1 : s.index(-2) ? 2 : 3;
for (let S = s.depth - y; S >= s.depth - 3; S -= 1)
v = me.from(s.node(S).copy(v));
const k = s.indexAfter(-1) < s.node(-2).childCount ? 1 : s.indexAfter(-2) < s.node(-3).childCount ? 2 : 3, T = yl(f, s.node().type.name, s.node().attrs), b = ((o = a.contentMatch.defaultType) === null || o === void 0 ? void 0 : o.createAndFill(T)) || void 0;
v = v.append(me.from(a.createAndFill(null, b) || void 0));
const D = s.before(s.depth - (y - 1));
e.replace(D, s.after(-k), new Te(v, 4 - y, 0));
let x = -1;
e.doc.nodesBetween(D, e.doc.content.size, (S, _) => {
if (x > -1)
return !1;
S.isTextblock && S.content.size === 0 && (x = _ + 1);
}), x > -1 && e.setSelection(Ye.near(e.doc.resolve(x))), e.scrollIntoView();
}
return !0;
}
const d = u.pos === s.end() ? c.contentMatchAt(0).defaultType : null, p = yl(f, c.type.name, c.attrs), h = yl(f, s.node().type.name, s.node().attrs);
e.delete(s.pos, u.pos);
const m = d ? [
{ type: a, attrs: p },
{ type: d, attrs: h }
] : [{ type: a, attrs: p }];
if (!wa(e.doc, s.pos, 2))
return !1;
if (r) {
const { selection: v, storedMarks: y } = n, { splittableMarks: k } = i.extensionManager, T = y || v.$to.parentOffset && v.$from.marks();
if (e.split(s.pos, 2, m).scrollIntoView(), !T || !r)
return !0;
const b = T.filter((D) => k.includes(D.type.name));
e.ensureMarks(b);
}
return !0;
}, Ef = (t, e) => {
const n = Th((a) => a.type === e)(t.selection);
if (!n)
return !0;
const r = t.doc.resolve(Math.max(0, n.pos - 1)).before(n.depth);
if (r === void 0)
return !0;
const i = t.doc.nodeAt(r);
return n.node.type === (i == null ? void 0 : i.type) && Xi(t.doc, n.pos) && t.join(n.pos), !0;
}, _f = (t, e) => {
const n = Th((a) => a.type === e)(t.selection);
if (!n)
return !0;
const r = t.doc.resolve(n.start).after(n.depth);
if (r === void 0)
return !0;
const i = t.doc.nodeAt(r);
return n.node.type === (i == null ? void 0 : i.type) && Xi(t.doc, r) && t.join(r), !0;
}, JR = (t, e, n, r = {}) => ({ editor: i, tr: o, state: a, dispatch: s, chain: u, commands: l, can: c }) => {
const { extensions: f, splittableMarks: d } = i.extensionManager, p = Xt(t, a.schema), h = Xt(e, a.schema), { selection: m, storedMarks: v } = a, { $from: y, $to: k } = m, T = y.blockRange(k), b = v || m.$to.parentOffset && m.$from.marks();
if (!T)
return !1;
const D = Th((x) => sb(x.type.name, f))(m);
if (T.depth >= 1 && D && T.depth - D.depth <= 1) {
if (D.node.type === p)
return l.liftListItem(h);
if (sb(D.node.type.name, f) && p.validContent(D.node.content) && s)
return u().command(() => (o.setNodeMarkup(D.pos, p), !0)).command(() => Ef(o, p)).command(() => _f(o, p)).run();
}
return !n || !b || !s ? u().command(() => c().wrapInList(p, r) ? !0 : l.clearNodes()).wrapInList(p, r).command(() => Ef(o, p)).command(() => _f(o, p)).run() : u().command(() => {
const x = c().wrapInList(p, r), S = b.filter((_) => d.includes(_.type.name));
return o.ensureMarks(S), x ? !0 : l.clearNodes();
}).wrapInList(p, r).command(() => Ef(o, p)).command(() => _f(o, p)).run();
}, XR = (t, e = {}, n = {}) => ({ state: r, commands: i }) => {
const { extendEmptyMarkRange: o = !1 } = n, a = Zi(t, r.schema);
return W0(r, a, e) ? i.unsetMark(a, { extendEmptyMarkRange: o }) : i.setMark(a, e);
}, QR = (t, e, n = {}) => ({ state: r, commands: i }) => {
const o = Xt(t, r.schema), a = Xt(e, r.schema);
return uu(r, o, n) ? i.setNode(a) : i.setNode(o, n);
}, ZR = (t, e = {}) => ({ state: n, commands: r }) => {
const i = Xt(t, n.schema);
return uu(n, i, e) ? r.lift(i) : r.wrapIn(i, e);
}, eB = () => ({ state: t, dispatch: e }) => {
const n = t.plugins;
for (let r = 0; r < n.length; r += 1) {
const i = n[r];
let o;
if (i.spec.isInputRules && (o = i.getState(t))) {
if (e) {
const a = t.tr, s = o.transform;
for (let u = s.steps.length - 1; u >= 0; u -= 1)
a.step(s.steps[u].invert(s.docs[u]));
if (o.text) {
const u = a.doc.resolve(o.from).marks();
a.replaceWith(o.from, o.to, t.schema.text(o.text, u));
} else
a.delete(o.from, o.to);
}
return !0;
}
}
return !1;
}, tB = () => ({ tr: t, dispatch: e }) => {
const { selection: n } = t, { empty: r, ranges: i } = n;
return r || e && i.forEach((o) => {
t.removeMark(o.$from.pos, o.$to.pos);
}), !0;
}, nB = (t, e = {}) => ({ tr: n, state: r, dispatch: i }) => {
var o;
const { extendEmptyMarkRange: a = !1 } = e, { selection: s } = n, u = Zi(t, r.schema), { $from: l, empty: c, ranges: f } = s;
if (!i)
return !0;
if (c && a) {
let { from: d, to: p } = s;
const h = (o = l.marks().find((v) => v.type === u)) === null || o === void 0 ? void 0 : o.attrs, m = Sh(l, u, h);
m && (d = m.from, p = m.to), n.removeMark(d, p, u);
} else
f.forEach((d) => {
n.removeMark(d.$from.pos, d.$to.pos, u);
});
return n.removeStoredMark(u), !0;
}, rB = (t, e = {}) => ({ tr: n, state: r, dispatch: i }) => {
let o = null, a = null;
const s = vd(typeof t == "string" ? t : t.name, r.schema);
return s ? (s === "node" && (o = Xt(t, r.schema)), s === "mark" && (a = Zi(t, r.schema)), i && n.selection.ranges.forEach((u) => {
const l = u.$from.pos, c = u.$to.pos;
r.doc.nodesBetween(l, c, (f, d) => {
o && o === f.type && n.setNodeMarkup(d, void 0, {
...f.attrs,
...e
}), a && f.marks.length && f.marks.forEach((p) => {
if (a === p.type) {
const h = Math.max(d, l), m = Math.min(d + f.nodeSize, c);
n.addMark(h, m, a.create({
...p.attrs,
...e
}));
}
});
});
}), !0) : !1;
}, iB = (t, e = {}) => ({ state: n, dispatch: r }) => {
const i = Xt(t, n.schema);
return vL(i, e)(n, r);
}, oB = (t, e = {}) => ({ state: n, dispatch: r }) => {
const i = Xt(t, n.schema);
return yL(i, e)(n, r);
};
var aB = /* @__PURE__ */ Object.freeze({
__proto__: null,
blur: zL,
clearContent: HL,
clearNodes: qL,
command: FL,
createParagraphNear: jL,
cut: UL,
deleteCurrentNode: WL,
deleteNode: YL,
deleteRange: KL,
deleteSelection: GL,
enter: JL,
exitCode: XL,
extendMarkRange: ZL,
first: eR,
focus: tR,
forEach: nR,
insertContent: rR,
insertContentAt: aR,
joinUp: sR,
joinDown: uR,
joinBackward: lR,
joinForward: cR,
joinItemBackward: dR,
joinItemForward: fR,
keyboardShortcut: hR,
lift: mR,
liftEmptyBlock: gR,
liftListItem: bR,
newlineInCode: vR,
resetAttributes: yR,
scrollIntoView: wR,
selectAll: kR,
selectNodeBackward: xR,
selectNodeForward: SR,
selectParentNode: ER,
selectTextblockEnd: _R,
selectTextblockStart: TR,
setContent: CR,
setMark: qR,
setMeta: FR,
setNode: jR,
setNodeSelection: UR,
setTextSelection: WR,
sinkListItem: YR,
splitBlock: KR,
splitListItem: GR,
toggleList: JR,
toggleMark: XR,
toggleNode: QR,
toggleWrap: ZR,
undoInputRule: eB,
unsetAllMarks: tB,
unsetMark: nB,
updateAttributes: rB,
wrapIn: iB,
wrapInList: oB
});
const sB = an.create({
name: "commands",
addCommands() {
return {
...aB
};
}
}), uB = an.create({
name: "editable",
addProseMirrorPlugins() {
return [
new un({
key: new er("editable"),
props: {
editable: () => this.editor.options.editable
}
})
];
}
}), lB = an.create({
name: "focusEvents",
addProseMirrorPlugins() {
const { editor: t } = this;
return [
new un({
key: new er("focusEvents"),
props: {
handleDOMEvents: {
focus: (e, n) => {
t.isFocused = !0;
const r = t.state.tr.setMeta("focus", { event: n }).setMeta("addToHistory", !1);
return e.dispatch(r), !1;
},
blur: (e, n) => {
t.isFocused = !1;
const r = t.state.tr.setMeta("blur", { event: n }).setMeta("addToHistory", !1);
return e.dispatch(r), !1;
}
}
}
})
];
}
}), cB = an.create({
name: "keymap",
addKeyboardShortcuts() {
const t = () => this.editor.commands.first(({ commands: a }) => [
() => a.undoInputRule(),
// maybe convert first text block node to default node
() => a.command(({ tr: s }) => {
const { selection: u, doc: l } = s, { empty: c, $anchor: f } = u, { pos: d, parent: p } = f, h = f.parent.isTextblock ? s.doc.resolve(d - 1) : f, m = h.parent.type.spec.isolating, v = f.pos - f.parentOffset, y = m && h.parent.childCount === 1 ? v === f.pos : Je.atStart(l).from === d;
return !c || !y || !p.type.isTextblock || p.textContent.length ? !1 : a.clearNodes();
}),
() => a.deleteSelection(),
() => a.joinBackward(),
() => a.selectNodeBackward()
]), e = () => this.editor.commands.first(({ commands: a }) => [
() => a.deleteSelection(),
() => a.deleteCurrentNode(),
() => a.joinForward(),
() => a.selectNodeForward()
]), r = {
Enter: () => this.editor.commands.first(({ commands: a }) => [
() => a.newlineInCode(),
() => a.createParagraphNear(),
() => a.liftEmptyBlock(),
() => a.splitBlock()
]),
"Mod-Enter": () => this.editor.commands.exitCode(),
Backspace: t,
"Mod-Backspace": t,
"Shift-Backspace": t,
Delete: e,
"Mod-Delete": e,
"Mod-a": () => this.editor.commands.selectAll()
}, i = {
...r
}, o = {
...r,
"Ctrl-h": t,
"Alt-Backspace": t,
"Ctrl-d": e,
"Ctrl-Alt-Backspace": e,
"Alt-Delete": e,
"Alt-d": e,
"Ctrl-a": () => this.editor.commands.selectTextblockStart(),
"Ctrl-e": () => this.editor.commands.selectTextblockEnd()
};
return bd() || _h() ? o : i;
},
addProseMirrorPlugins() {
return [
// With this plugin we check if the whole document was selected and deleted.
// In this case we will additionally call `clearNodes()` to convert e.g. a heading
// to a paragraph if necessary.
// This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
// with many other commands.
new un({
key: new er("clearDocument"),
appendTransaction: (t, e, n) => {
if (!(t.some((h) => h.docChanged) && !e.doc.eq(n.doc)))
return;
const { empty: i, from: o, to: a } = e.selection, s = Je.atStart(e.doc).from, u = Je.atEnd(e.doc).to;
if (i || !(o === s && a === u) || !(n.doc.textBetween(0, n.doc.content.size, " ", " ").length === 0))
return;
const f = n.tr, d = fd({
state: n,
transaction: f
}), { commands: p } = new pd({
editor: this.editor,
state: d
});
if (p.clearNodes(), !!f.steps.length)
return f;
}
})
];
}
}), dB = an.create({
name: "tabindex",
addProseMirrorPlugins() {
return [
new un({
key: new er("tabindex"),
props: {
attributes: this.editor.isEditable ? { tabindex: "0" } : {}
}
})
];
}
});
var fB = /* @__PURE__ */ Object.freeze({
__proto__: null,
ClipboardTextSerializer: VL,
Commands: sB,
Editable: uB,
FocusEvents: lB,
Keymap: cB,
Tabindex: dB
});
const pB = `.ProseMirror {
position: relative;
}
.ProseMirror {
word-wrap: break-word;
white-space: pre-wrap;
white-space: break-spaces;
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}
.ProseMirror [contenteditable="false"] {
white-space: normal;
}
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
white-space: pre-wrap;
}
.ProseMirror pre {
white-space: pre-wrap;
}
img.ProseMirror-separator {
display: inline !important;
border: none !important;
margin: 0 !important;
width: 1px !important;
height: 1px !important;
}
.ProseMirror-gapcursor {
display: none;
pointer-events: none;
position: absolute;
margin: 0;
}
.ProseMirror-gapcursor:after {
content: "";
display: block;
position: absolute;
top: -2px;
width: 20px;
border-top: 1px solid black;
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}
@keyframes ProseMirror-cursor-blink {
to {
visibility: hidden;
}
}
.ProseMirror-hideselection *::selection {
background: transparent;
}
.ProseMirror-hideselection *::-moz-selection {
background: transparent;
}
.ProseMirror-hideselection * {
caret-color: transparent;
}
.ProseMirror-focused .ProseMirror-gapcursor {
display: block;
}
.tippy-box[data-animation=fade][data-state=hidden] {
opacity: 0
}`;
function hB(t, e, n) {
const r = document.querySelector(`style[data-tiptap-style${n ? `-${n}` : ""}]`);
if (r !== null)
return r;
const i = document.createElement("style");
return e && i.setAttribute("nonce", e), i.setAttribute(`data-tiptap-style${n ? `-${n}` : ""}`, ""), i.innerHTML = t, document.getElementsByTagName("head")[0].appendChild(i), i;
}
let mB = class extends _L {
constructor(e = {}) {
super(), this.isFocused = !1, this.extensionStorage = {}, this.options = {
element: document.createElement("div"),
content: "",
injectCSS: !0,
injectNonce: void 0,
extensions: [],
autofocus: !1,
editable: !0,
editorProps: {},
parseOptions: {},
enableInputRules: !0,
enablePasteRules: !0,
enableCoreExtensions: !0,
onBeforeCreate: () => null,
onCreate: () => null,
onUpdate: () => null,
onSelectionUpdate: () => null,
onTransaction: () => null,
onFocus: () => null,
onBlur: () => null,
onDestroy: () => null
}, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.setOptions(e), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.createView(), this.injectCSS(), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), window.setTimeout(() => {
this.isDestroyed || (this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }));
}, 0);
}
/**
* Returns the editor storage.
*/
get storage() {
return this.extensionStorage;
}
/**
* An object of all registered commands.
*/
get commands() {
return this.commandManager.commands;
}
/**
* Create a command chain to call multiple commands at once.
*/
chain() {
return this.commandManager.chain();
}
/**
* Check if a command or a command chain can be executed. Without executing it.
*/
can() {
return this.commandManager.can();
}
/**
* Inject CSS styles.
*/
injectCSS() {
this.options.injectCSS && document && (this.css = hB(pB, this.options.injectNonce));
}
/**
* Update editor options.
*
* @param options A list of options
*/
setOptions(e = {}) {
this.options = {
...this.options,
...e
}, !(!this.view || !this.state || this.isDestroyed) && (this.options.editorProps && this.view.setProps(this.options.editorProps), this.view.updateState(this.state));
}
/**
* Update editable state of the editor.
*/
setEditable(e, n = !0) {
this.setOptions({ editable: e }), n && this.emit("update", { editor: this, transaction: this.state.tr });
}
/**
* Returns whether the editor is editable.
*/
get isEditable() {
return this.options.editable && this.view && this.view.editable;
}
/**
* Returns the editor state.
*/
get state() {
return this.view.state;
}
/**
* Register a ProseMirror plugin.
*
* @param plugin A ProseMirror plugin
* @param handlePlugins Control how to merge the plugin into the existing plugins.
*/
registerPlugin(e, n) {
const r = qw(n) ? n(e, [...this.state.plugins]) : [...this.state.plugins, e], i = this.state.reconfigure({ plugins: r });
this.view.updateState(i);
}
/**
* Unregister a ProseMirror plugin.
*
* @param nameOrPluginKey The plugins name
*/
unregisterPlugin(e) {
if (this.isDestroyed)
return;
const n = typeof e == "string" ? `${e}$` : e.key, r = this.state.reconfigure({
// @ts-ignore
plugins: this.state.plugins.filter((i) => !i.key.startsWith(n))
});
this.view.updateState(r);
}
/**
* Creates an extension manager.
*/
createExtensionManager() {
const n = [...this.options.enableCoreExtensions ? Object.values(fB) : [], ...this.options.extensions].filter((r) => ["extension", "node", "mark"].includes(r == null ? void 0 : r.type));
this.extensionManager = new da(n, this);
}
/**
* Creates an command manager.
*/
createCommandManager() {
this.commandManager = new pd({
editor: this
});
}
/**
* Creates a ProseMirror schema.
*/
createSchema() {
this.schema = this.extensionManager.schema;
}
/**
* Creates a ProseMirror view.
*/
createView() {
const e = Ww(this.options.content, this.schema, this.options.parseOptions), n = Uw(e, this.options.autofocus);
this.view = new jI(this.options.element, {
...this.options.editorProps,
dispatchTransaction: this.dispatchTransaction.bind(this),
state: ca.create({
doc: e,
selection: n || void 0
})
});
const r = this.state.reconfigure({
plugins: this.extensionManager.plugins
});
this.view.updateState(r), this.createNodeViews(), this.prependClass();
const i = this.view.dom;
i.editor = this;
}
/**
* Creates all node views.
*/
createNodeViews() {
this.view.setProps({
nodeViews: this.extensionManager.nodeViews
});
}
/**
* Prepend class name to element.
*/
prependClass() {
this.view.dom.className = `tiptap ${this.view.dom.className}`;
}
captureTransaction(e) {
this.isCapturingTransaction = !0, e(), this.isCapturingTransaction = !1;
const n = this.capturedTransaction;
return this.capturedTransaction = null, n;
}
/**
* The callback over which to send transactions (state updates) produced by the view.
*
* @param transaction An editor state transaction
*/
dispatchTransaction(e) {
if (this.view.isDestroyed)
return;
if (this.isCapturingTransaction) {
if (!this.capturedTransaction) {
this.capturedTransaction = e;
return;
}
e.steps.forEach((a) => {
var s;
return (s = this.capturedTransaction) === null || s === void 0 ? void 0 : s.step(a);
});
return;
}
const n = this.state.apply(e), r = !this.state.selection.eq(n.selection);
this.view.updateState(n), this.emit("transaction", {
editor: this,
transaction: e
}), r && this.emit("selectionUpdate", {
editor: this,
transaction: e
});
const i = e.getMeta("focus"), o = e.getMeta("blur");
i && this.emit("focus", {
editor: this,
event: i.event,
transaction: e
}), o && this.emit("blur", {
editor: this,
event: o.event,
transaction: e
}), !(!e.docChanged || e.getMeta("preventUpdate")) && this.emit("update", {
editor: this,
transaction: e
});
}
/**
* Get attributes of the currently selected node or mark.
*/
getAttributes(e) {
return Yw(this.state, e);
}
isActive(e, n) {
const r = typeof e == "string" ? e : null, i = typeof e == "string" ? n : e;
return BR(this.state, r, i);
}
/**
* Get the document as JSON.
*/
getJSON() {
return this.state.doc.toJSON();
}
/**
* Get the document as HTML.
*/
getHTML() {
return $R(this.state.doc.content, this.schema);
}
/**
* Get the document as text.
*/
getText(e) {
const { blockSeparator: n = `
`, textSerializers: r = {} } = e || {};
return NR(this.state.doc, {
blockSeparator: n,
textSerializers: {
...jw(this.schema),
...r
}
});
}
/**
* Check if there is no content.
*/
get isEmpty() {
return VR(this.state.doc);
}
/**
* Get the number of characters for the current document.
*
* @deprecated
*/
getCharacterCount() {
return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'), this.state.doc.content.size - 2;
}
/**
* Destroy the editor.
*/
destroy() {
this.emit("destroy"), this.view && this.view.destroy(), this.removeAllListeners();
}
/**
* Check if the editor is already destroyed.
*/
get isDestroyed() {
var e;
return !(!((e = this.view) === null || e === void 0) && e.docView);
}
};
function Ga(t) {
return new md({
find: t.find,
handler: ({ state: e, range: n, match: r }) => {
const i = Ge(t.getAttributes, void 0, r);
if (i === !1 || i === null)
return null;
const { tr: o } = e, a = r[r.length - 1], s = r[0];
if (a) {
const u = s.search(/\S/), l = n.from + s.indexOf(a), c = l + a.length;
if (Ch(n.from, n.to, e.doc).filter((p) => p.mark.type.excluded.find((m) => m === t.type && m !== p.mark.type)).filter((p) => p.to > l).length)
return null;
c < n.to && o.delete(c, n.to), l > n.from && o.delete(n.from + u, l);
const d = n.from + u + a.length;
o.addMark(n.from + u, d, t.type.create(i || {})), o.removeStoredMark(t.type);
}
}
});
}
function Y0(t) {
return new md({
find: t.find,
handler: ({ state: e, range: n, match: r }) => {
const i = Ge(t.getAttributes, void 0, r) || {}, { tr: o } = e, a = n.from;
let s = n.to;
const u = t.type.create(i);
if (r[1]) {
const l = r[0].lastIndexOf(r[1]);
let c = a + l;
c > s ? c = s : s = c + r[1].length;
const f = r[0][r[0].length - 1];
o.insertText(f, a + r[0].length - 1), o.replaceWith(c, s, u);
} else
r[0] && o.insert(a - 1, t.type.create(i)).delete(o.mapping.map(a), o.mapping.map(s));
o.scrollIntoView();
}
});
}
function K0(t) {
return new md({
find: t.find,
handler: ({ state: e, range: n, match: r }) => {
const i = e.doc.resolve(n.from), o = Ge(t.getAttributes, void 0, r) || {};
if (!i.node(-1).canReplaceWith(i.index(-1), i.indexAfter(-1), t.type))
return null;
e.tr.delete(n.from, n.to).setBlockType(n.from, n.from, t.type, o);
}
});
}
function lu(t) {
return new md({
find: t.find,
handler: ({ state: e, range: n, match: r, chain: i }) => {
const o = Ge(t.getAttributes, void 0, r) || {}, a = e.tr.delete(n.from, n.to), u = a.doc.resolve(n.from).blockRange(), l = u && ch(u, t.type, o);
if (!l)
return null;
if (a.wrap(u, l), t.keepMarks && t.editor) {
const { selection: f, storedMarks: d } = e, { splittableMarks: p } = t.editor.extensionManager, h = d || f.$to.parentOffset && f.$from.marks();
if (h) {
const m = h.filter((v) => p.includes(v.type.name));
a.ensureMarks(m);
}
}
if (t.keepAttributes) {
const f = t.type.name === "bulletList" || t.type.name === "orderedList" ? "listItem" : "taskList";
i().updateAttributes(f, o).run();
}
const c = a.doc.resolve(n.from - 1).nodeBefore;
c && c.type === t.type && Xi(a.doc, n.from - 1) && (!t.joinPredicate || t.joinPredicate(r, c)) && a.join(n.from - 1);
}
});
}
class xr {
constructor(e = {}) {
this.type = "mark", this.name = "mark", this.parent = null, this.child = null, this.config = {
name: this.name,
defaultOptions: {}
}, this.config = {
...this.config,
...e
}, this.name = this.config.name, e.defaultOptions && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = Ge(Me(this, "addOptions", {
name: this.name
}))), this.storage = Ge(Me(this, "addStorage", {
name: this.name,
options: this.options
})) || {};
}
static create(e = {}) {
return new xr(e);
}
configure(e = {}) {
const n = this.extend();
return n.options = gd(this.options, e), n.storage = Ge(Me(n, "addStorage", {
name: n.name,
options: n.options
})), n;
}
extend(e = {}) {
const n = new xr(e);
return n.parent = this, this.child = n, n.name = e.name ? e.name : n.parent.name, e.defaultOptions && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = Ge(Me(n, "addOptions", {
name: n.name
})), n.storage = Ge(Me(n, "addStorage", {
name: n.name,
options: n.options
})), n;
}
static handleExit({ editor: e, mark: n }) {
const { tr: r } = e.state, i = e.state.selection.$from;
if (i.pos === i.end()) {
const a = i.marks();
if (!!!a.find((l) => (l == null ? void 0 : l.type.name) === n.name))
return !1;
const u = a.find((l) => (l == null ? void 0 : l.type.name) === n.name);
return u && r.removeStoredMark(u), r.insertText(" ", i.pos), e.view.dispatch(r), !0;
}
return !1;
}
}
class sn {
constructor(e = {}) {
this.type = "node", this.name = "node", this.parent = null, this.child = null, this.config = {
name: this.name,
defaultOptions: {}
}, this.config = {
...this.config,
...e
}, this.name = this.config.name, e.defaultOptions && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = Ge(Me(this, "addOptions", {
name: this.name
}))), this.storage = Ge(Me(this, "addStorage", {
name: this.name,
options: this.options
})) || {};
}
static create(e = {}) {
return new sn(e);
}
configure(e = {}) {
const n = this.extend();
return n.options = gd(this.options, e), n.storage = Ge(Me(n, "addStorage", {
name: n.name,
options: n.options
})), n;
}
extend(e = {}) {
const n = new sn(e);
return n.parent = this, this.child = n, n.name = e.name ? e.name : n.parent.name, e.defaultOptions && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = Ge(Me(n, "addOptions", {
name: n.name
})), n.storage = Ge(Me(n, "addStorage", {
name: n.name,
options: n.options
})), n;
}
}
function gB() {
return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
}
class bB {
constructor(e, n, r) {
this.isDragging = !1, this.component = e, this.editor = n.editor, this.options = {
stopEvent: null,
ignoreMutation: null,
...r
}, this.extension = n.extension, this.node = n.node, this.decorations = n.decorations, this.getPos = n.getPos, this.mount();
}
mount() {
}
get dom() {
return this.editor.view.dom;
}
get contentDOM() {
return null;
}
onDragStart(e) {
var n, r, i, o, a, s, u;
const { view: l } = this.editor, c = e.target, f = c.nodeType === 3 ? (n = c.parentElement) === null || n === void 0 ? void 0 : n.closest("[data-drag-handle]") : c.closest("[data-drag-handle]");
if (!this.dom || !((r = this.contentDOM) === null || r === void 0) && r.contains(c) || !f)
return;
let d = 0, p = 0;
if (this.dom !== f) {
const v = this.dom.getBoundingClientRect(), y = f.getBoundingClientRect(), k = (i = e.offsetX) !== null && i !== void 0 ? i : (o = e.nativeEvent) === null || o === void 0 ? void 0 : o.offsetX, T = (a = e.offsetY) !== null && a !== void 0 ? a : (s = e.nativeEvent) === null || s === void 0 ? void 0 : s.offsetY;
d = y.x - v.x + k, p = y.y - v.y + T;
}
(u = e.dataTransfer) === null || u === void 0 || u.setDragImage(this.dom, d, p);
const h = Ve.create(l.state.doc, this.getPos()), m = l.state.tr.setSelection(h);
l.dispatch(m);
}
stopEvent(e) {
var n;
if (!this.dom)
return !1;
if (typeof this.options.stopEvent == "function")
return this.options.stopEvent({ event: e });
const r = e.target;
if (!(this.dom.contains(r) && !(!((n = this.contentDOM) === null || n === void 0) && n.contains(r))))
return !1;
const o = e.type.startsWith("drag"), a = e.type === "drop";
if ((["INPUT", "BUTTON", "SELECT", "TEXTAREA"].includes(r.tagName) || r.isContentEditable) && !a && !o)
return !0;
const { isEditable: u } = this.editor, { isDragging: l } = this, c = !!this.node.type.spec.draggable, f = Ve.isSelectable(this.node), d = e.type === "copy", p = e.type === "paste", h = e.type === "cut", m = e.type === "mousedown";
if (!c && f && o && e.preventDefault(), c && o && !l)
return e.preventDefault(), !1;
if (c && u && !l && m) {
const v = r.closest("[data-drag-handle]");
v && (this.dom === v || this.dom.contains(v)) && (this.isDragging = !0, document.addEventListener("dragend", () => {
this.isDragging = !1;
}, { once: !0 }), document.addEventListener("drop", () => {
this.isDragging = !1;
}, { once: !0 }), document.addEventListener("mouseup", () => {
this.isDragging = !1;
}, { once: !0 }));
}
return !(l || a || d || p || h || m && f);
}
ignoreMutation(e) {
return !this.dom || !this.contentDOM ? !0 : typeof this.options.ignoreMutation == "function" ? this.options.ignoreMutation({ mutation: e }) : this.node.isLeaf || this.node.isAtom ? !0 : e.type === "selection" || this.dom.contains(e.target) && e.type === "childList" && (bd() || gB()) && this.editor.isFocused && [
...Array.from(e.addedNodes),
...Array.from(e.removedNodes)
].every((r) => r.isContentEditable) ? !1 : this.contentDOM === e.target && e.type === "attributes" ? !0 : !this.contentDOM.contains(e.target);
}
updateAttributes(e) {
this.editor.commands.command(({ tr: n }) => {
const r = this.getPos();
return n.setNodeMarkup(r, void 0, {
...this.node.attrs,
...e
}), !0;
});
}
deleteNode() {
const e = this.getPos(), n = e + this.node.nodeSize;
this.editor.commands.deleteRange({ from: e, to: n });
}
}
function qo(t) {
return new NL({
find: t.find,
handler: ({ state: e, range: n, match: r, pasteEvent: i }) => {
const o = Ge(t.getAttributes, void 0, r, i);
if (o === !1 || o === null)
return null;
const { tr: a } = e, s = r[r.length - 1], u = r[0];
let l = n.to;
if (s) {
const c = u.search(/\S/), f = n.from + u.indexOf(s), d = f + s.length;
if (Ch(n.from, n.to, e.doc).filter((h) => h.mark.type.excluded.find((v) => v === t.type && v !== h.mark.type)).filter((h) => h.to > f).length)
return null;
d < n.to && a.delete(d, n.to), f > n.from && a.delete(n.from + c, f), l = n.from + c + s.length, a.addMark(n.from + c, l, t.type.create(o || {})), a.removeStoredMark(t.type);
}
}
});
}
class vB {
constructor({ editor: e, element: n, view: r, tippyOptions: i = {}, updateDelay: o = 250, shouldShow: a }) {
this.preventHide = !1, this.shouldShow = ({ view: s, state: u, from: l, to: c }) => {
const { doc: f, selection: d } = u, { empty: p } = d, h = !f.textBetween(l, c).length && Eh(u.selection), m = this.element.contains(document.activeElement);
return !(!(s.hasFocus() || m) || p || h || !this.editor.isEditable);
}, this.mousedownHandler = () => {
this.preventHide = !0;
}, this.dragstartHandler = () => {
this.hide();
}, this.focusHandler = () => {
setTimeout(() => this.update(this.editor.view));
}, this.blurHandler = ({ event: s }) => {
var u;
if (this.preventHide) {
this.preventHide = !1;
return;
}
s != null && s.relatedTarget && (!((u = this.element.parentNode) === null || u === void 0) && u.contains(s.relatedTarget)) || this.hide();
}, this.tippyBlurHandler = (s) => {
this.blurHandler({ event: s });
}, this.handleDebouncedUpdate = (s, u) => {
const l = !(u != null && u.selection.eq(s.state.selection)), c = !(u != null && u.doc.eq(s.state.doc));
!l && !c || (this.updateDebounceTimer && clearTimeout(this.updateDebounceTimer), this.updateDebounceTimer = window.setTimeout(() => {
this.updateHandler(s, l, c, u);
}, this.updateDelay));
}, this.updateHandler = (s, u, l, c) => {
var f, d, p;
const { state: h, composing: m } = s, { selection: v } = h;
if (m || !u && !l)
return;
this.createTooltip();
const { ranges: k } = v, T = Math.min(...k.map((x) => x.$from.pos)), b = Math.max(...k.map((x) => x.$to.pos));
if (!((f = this.shouldShow) === null || f === void 0 ? void 0 : f.call(this, {
editor: this.editor,
view: s,
state: h,
oldState: c,
from: T,
to: b
}))) {
this.hide();
return;
}
(d = this.tippy) === null || d === void 0 || d.setProps({
getReferenceClientRect: ((p = this.tippyOptions) === null || p === void 0 ? void 0 : p.getReferenceClientRect) || (() => {
if (zR(h.selection)) {
let x = s.nodeDOM(T);
const S = x.dataset.nodeViewWrapper ? x : x.querySelector("[data-node-view-wrapper]");
if (S && (x = S.firstChild), x)
return x.getBoundingClientRect();
}
return Kw(s, T, b);
})
}), this.show();
}, this.editor = e, this.element = n, this.view = r, this.updateDelay = o, a && (this.shouldShow = a), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.tippyOptions = i, this.element.remove(), this.element.style.visibility = "visible";
}
createTooltip() {
const { element: e } = this.editor.options, n = !!e.parentElement;
this.tippy || !n || (this.tippy = Uo(e, {
duration: 0,
getReferenceClientRect: null,
content: this.element,
interactive: !0,
trigger: "manual",
placement: "top",
hideOnClick: "toggle",
...this.tippyOptions
}), this.tippy.popper.firstChild && this.tippy.popper.firstChild.addEventListener("blur", this.tippyBlurHandler));
}
update(e, n) {
const { state: r } = e, i = r.selection.$from.pos !== r.selection.$to.pos;
if (this.updateDelay > 0 && i) {
this.handleDebouncedUpdate(e, n);
return;
}
const o = !(n != null && n.selection.eq(e.state.selection)), a = !(n != null && n.doc.eq(e.state.doc));
this.updateHandler(e, o, a, n);
}
show() {
var e;
(e = this.tippy) === null || e === void 0 || e.show();
}
hide() {
var e;
(e = this.tippy) === null || e === void 0 || e.hide();
}
destroy() {
var e, n;
!((e = this.tippy) === null || e === void 0) && e.popper.firstChild && this.tippy.popper.firstChild.removeEventListener("blur", this.tippyBlurHandler), (n = this.tippy) === null || n === void 0 || n.destroy(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler);
}
}
const Gw = (t) => new un({
key: typeof t.pluginKey == "string" ? new er(t.pluginKey) : t.pluginKey,
view: (e) => new vB({ view: e, ...t })
});
an.create({
name: "bubbleMenu",
addOptions() {
return {
element: null,
tippyOptions: {},
pluginKey: "bubbleMenu",
updateDelay: void 0,
shouldShow: null
};
},
addProseMirrorPlugins() {
return this.options.element ? [
Gw({
pluginKey: this.options.pluginKey,
editor: this.editor,
element: this.options.element,
tippyOptions: this.options.tippyOptions,
updateDelay: this.options.updateDelay,
shouldShow: this.options.shouldShow
})
] : [];
}
});
class yB {
constructor({ editor: e, element: n, view: r, tippyOptions: i = {}, shouldShow: o }) {
this.preventHide = !1, this.shouldShow = ({ view: a, state: s }) => {
const { selection: u } = s, { $anchor: l, empty: c } = u, f = l.depth === 1, d = l.parent.isTextblock && !l.parent.type.spec.code && !l.parent.textContent;
return !(!a.hasFocus() || !c || !f || !d || !this.editor.isEditable);
}, this.mousedownHandler = () => {
this.preventHide = !0;
}, this.focusHandler = () => {
setTimeout(() => this.update(this.editor.view));
}, this.blurHandler = ({ event: a }) => {
var s;
if (this.preventHide) {
this.preventHide = !1;
return;
}
a != null && a.relatedTarget && (!((s = this.element.parentNode) === null || s === void 0) && s.contains(a.relatedTarget)) || this.hide();
}, this.tippyBlurHandler = (a) => {
this.blurHandler({ event: a });
}, this.editor = e, this.element = n, this.view = r, o && (this.shouldShow = o), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.tippyOptions = i, this.element.remove(), this.element.style.visibility = "visible";
}
createTooltip() {
const { element: e } = this.editor.options, n = !!e.parentElement;
this.tippy || !n || (this.tippy = Uo(e, {
duration: 0,
getReferenceClientRect: null,
content: this.element,
interactive: !0,
trigger: "manual",
placement: "right",
hideOnClick: "toggle",
...this.tippyOptions
}), this.tippy.popper.firstChild && this.tippy.popper.firstChild.addEventListener("blur", this.tippyBlurHandler));
}
update(e, n) {
var r, i, o;
const { state: a } = e, { doc: s, selection: u } = a, { from: l, to: c } = u;
if (n && n.doc.eq(s) && n.selection.eq(u))
return;
if (this.createTooltip(), !((r = this.shouldShow) === null || r === void 0 ? void 0 : r.call(this, {
editor: this.editor,
view: e,
state: a,
oldState: n
}))) {
this.hide();
return;
}
(i = this.tippy) === null || i === void 0 || i.setProps({
getReferenceClientRect: ((o = this.tippyOptions) === null || o === void 0 ? void 0 : o.getReferenceClientRect) || (() => Kw(e, l, c))
}), this.show();
}
show() {
var e;
(e = this.tippy) === null || e === void 0 || e.show();
}
hide() {
var e;
(e = this.tippy) === null || e === void 0 || e.hide();
}
destroy() {
var e, n;
!((e = this.tippy) === null || e === void 0) && e.popper.firstChild && this.tippy.popper.firstChild.removeEventListener("blur", this.tippyBlurHandler), (n = this.tippy) === null || n === void 0 || n.destroy(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler);
}
}
const Jw = (t) => new un({
key: typeof t.pluginKey == "string" ? new er(t.pluginKey) : t.pluginKey,
view: (e) => new yB({ view: e, ...t })
});
an.create({
name: "floatingMenu",
addOptions() {
return {
element: null,
tippyOptions: {},
pluginKey: "floatingMenu",
shouldShow: null
};
},
addProseMirrorPlugins() {
return this.options.element ? [
Jw({
pluginKey: this.options.pluginKey,
editor: this.editor,
element: this.options.element,
tippyOptions: this.options.tippyOptions,
shouldShow: this.options.shouldShow
})
] : [];
}
});
const wB = be({
name: "BubbleMenu",
props: {
pluginKey: {
type: [String, Object],
default: "bubbleMenu"
},
editor: {
type: Object,
required: !0
},
updateDelay: {
type: Number,
default: void 0
},
tippyOptions: {
type: Object,
default: () => ({})
},
shouldShow: {
type: Function,
default: null
}
},
setup(t, { slots: e }) {
const n = re(null);
return st(() => {
const { updateDelay: r, editor: i, pluginKey: o, shouldShow: a, tippyOptions: s } = t;
i.registerPlugin(Gw({
updateDelay: r,
editor: i,
element: n.value,
pluginKey: o,
shouldShow: a,
tippyOptions: s
}));
}), qi(() => {
const { pluginKey: r, editor: i } = t;
i.unregisterPlugin(r);
}), () => {
var r;
return jt("div", { ref: n }, (r = e.default) === null || r === void 0 ? void 0 : r.call(e));
};
}
});
function lb(t) {
return M6((e, n) => ({
get() {
return e(), t;
},
set(r) {
t = r, requestAnimationFrame(() => {
requestAnimationFrame(() => {
n();
});
});
}
}));
}
class kB extends mB {
constructor(e = {}) {
return super(e), this.vueRenderers = Qt(/* @__PURE__ */ new Map()), this.contentComponent = null, this.reactiveState = lb(this.view.state), this.reactiveExtensionStorage = lb(this.extensionStorage), this.on("transaction", () => {
this.reactiveState.value = this.view.state, this.reactiveExtensionStorage.value = this.extensionStorage;
}), gr(this);
}
get state() {
return this.reactiveState ? this.reactiveState.value : this.view.state;
}
get storage() {
return this.reactiveExtensionStorage ? this.reactiveExtensionStorage.value : super.storage;
}
/**
* Register a ProseMirror plugin.
*/
registerPlugin(e, n) {
super.registerPlugin(e, n), this.reactiveState.value = this.view.state;
}
/**
* Unregister a ProseMirror plugin.
*/
unregisterPlugin(e) {
super.unregisterPlugin(e), this.reactiveState.value = this.view.state;
}
}
const xB = be({
name: "EditorContent",
props: {
editor: {
default: null,
type: Object
}
},
setup(t) {
const e = re(), n = Fo();
return ga(() => {
const r = t.editor;
r && r.options.element && e.value && Vn(() => {
if (!e.value || !r.options.element.firstChild)
return;
const i = W(e.value);
e.value.append(...r.options.element.childNodes), r.contentComponent = n.ctx._, r.setOptions({
element: i
}), r.createNodeViews();
});
}), qi(() => {
const r = t.editor;
if (!r || (r.isDestroyed || r.view.setProps({
nodeViews: {}
}), r.contentComponent = null, !r.options.element.firstChild))
return;
const i = document.createElement("div");
i.append(...r.options.element.childNodes), r.setOptions({
element: i
});
}), { rootEl: e };
},
render() {
const t = [];
return this.editor && this.editor.vueRenderers.forEach((e) => {
const n = jt(Kb, {
to: e.teleportElement,
key: e.id
}, jt(e.component, {
ref: e.id,
...e.props
}));
t.push(n);
}), jt("div", {
ref: (e) => {
this.rootEl = e;
}
}, ...t);
}
});
be({
name: "FloatingMenu",
props: {
pluginKey: {
// TODO: TypeScript breaks :(
// type: [String, Object as PropType<Exclude<FloatingMenuPluginProps['pluginKey'], string>>],
type: null,
default: "floatingMenu"
},
editor: {
type: Object,
required: !0
},
tippyOptions: {
type: Object,
default: () => ({})
},
shouldShow: {
type: Function,
default: null
}
},
setup(t, { slots: e }) {
const n = re(null);
return st(() => {
const { pluginKey: r, editor: i, tippyOptions: o, shouldShow: a } = t;
i.registerPlugin(Jw({
pluginKey: r,
editor: i,
element: n.value,
tippyOptions: o,
shouldShow: a
}));
}), qi(() => {
const { pluginKey: r, editor: i } = t;
i.unregisterPlugin(r);
}), () => {
var r;
return jt("div", { ref: n }, (r = e.default) === null || r === void 0 ? void 0 : r.call(e));
};
}
});
be({
name: "NodeViewContent",
props: {
as: {
type: String,
default: "div"
}
},
render() {
return jt(this.as, {
style: {
whiteSpace: "pre-wrap"
},
"data-node-view-content": ""
});
}
});
const SB = be({
name: "NodeViewWrapper",
props: {
as: {
type: String,
default: "div"
}
},
inject: ["onDragStart", "decorationClasses"],
render() {
var t, e;
return jt(this.as, {
// @ts-ignore
class: this.decorationClasses,
style: {
whiteSpace: "normal"
},
"data-node-view-wrapper": "",
// @ts-ignore (https://github.com/vuejs/vue-next/issues/3031)
onDragstart: this.onDragStart
}, (e = (t = this.$slots).default) === null || e === void 0 ? void 0 : e.call(t));
}
});
class EB {
constructor(e, { props: n = {}, editor: r }) {
if (this.id = Math.floor(Math.random() * 4294967295).toString(), this.editor = r, this.component = gr(e), this.teleportElement = document.createElement("div"), this.element = this.teleportElement, this.props = Qt(n), this.editor.vueRenderers.set(this.id, this), this.editor.contentComponent) {
if (this.editor.contentComponent.update(), this.teleportElement.children.length !== 1)
throw Error("VueRenderer doesn’t support multiple child elements.");
this.element = this.teleportElement.firstElementChild;
}
}
get ref() {
var e;
return (e = this.editor.contentComponent) === null || e === void 0 ? void 0 : e.refs[this.id];
}
updateProps(e = {}) {
Object.entries(e).forEach(([n, r]) => {
this.props[n] = r;
});
}
destroy() {
this.editor.vueRenderers.delete(this.id);
}
}
class _B extends bB {
mount() {
const e = {
editor: this.editor,
node: this.node,
decorations: this.decorations,
selected: !1,
extension: this.extension,
getPos: () => this.getPos(),
updateAttributes: (i = {}) => this.updateAttributes(i),
deleteNode: () => this.deleteNode()
}, n = this.onDragStart.bind(this);
this.decorationClasses = re(this.getDecorationClasses());
const r = be({
extends: { ...this.component },
props: Object.keys(e),
template: this.component.template,
setup: (i) => {
var o, a;
return ci("onDragStart", n), ci("decorationClasses", this.decorationClasses), (a = (o = this.component).setup) === null || a === void 0 ? void 0 : a.call(o, i, {
expose: () => {
}
});
},
// add support for scoped styles
// @ts-ignore
// eslint-disable-next-line
__scopeId: this.component.__scopeId,
// add support for CSS Modules
// @ts-ignore
// eslint-disable-next-line
__cssModules: this.component.__cssModules,
// add support for vue devtools
// @ts-ignore
// eslint-disable-next-line
__name: this.component.__name,
// @ts-ignore
// eslint-disable-next-line
__file: this.component.__file
});
this.renderer = new EB(r, {
editor: this.editor,
props: e
});
}
get dom() {
if (!this.renderer.element.hasAttribute("data-node-view-wrapper"))
throw Error("Please use the NodeViewWrapper component for your node view.");
return this.renderer.element;
}
get contentDOM() {
return this.node.isLeaf ? null : this.dom.querySelector("[data-node-view-content]") || this.dom;
}
update(e, n) {
const r = (i) => {
this.decorationClasses.value = this.getDecorationClasses(), this.renderer.updateProps(i);
};
if (typeof this.options.update == "function") {
const i = this.node, o = this.decorations;
return this.node = e, this.decorations = n, this.options.update({
oldNode: i,
oldDecorations: o,
newNode: e,
newDecorations: n,
updateProps: () => r({ node: e, decorations: n })
});
}
return e.type !== this.node.type ? !1 : (e === this.node && this.decorations === n || (this.node = e, this.decorations = n, r({ node: e, decorations: n })), !0);
}
selectNode() {
this.renderer.updateProps({
selected: !0
}), this.renderer.element.classList.add("ProseMirror-selectednode");
}
deselectNode() {
this.renderer.updateProps({
selected: !1
}), this.renderer.element.classList.remove("ProseMirror-selectednode");
}
getDecorationClasses() {
return this.decorations.map((e) => e.type.attrs.class).flat().join(" ");
}
destroy() {
this.renderer.destroy();
}
}
function TB(t, e) {
return (n) => n.editor.contentComponent ? new _B(t, n, e) : {};
}
const CB = /^\s*>\s$/, OB = sn.create({
name: "blockquote",
addOptions() {
return {
HTMLAttributes: {}
};
},
content: "block+",
group: "block",
defining: !0,
parseHTML() {
return [
{ tag: "blockquote" }
];
},
renderHTML({ HTMLAttributes: t }) {
return ["blockquote", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setBlockquote: () => ({ commands: t }) => t.wrapIn(this.name),
toggleBlockquote: () => ({ commands: t }) => t.toggleWrap(this.name),
unsetBlockquote: () => ({ commands: t }) => t.lift(this.name)
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-b": () => this.editor.commands.toggleBlockquote()
};
},
addInputRules() {
return [
lu({
find: CB,
type: this.type
})
];
}
}), AB = /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/, MB = /(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g, DB = /(?:^|\s)((?:__)((?:[^__]+))(?:__))$/, $B = /(?:^|\s)((?:__)((?:[^__]+))(?:__))/g, NB = xr.create({
name: "bold",
addOptions() {
return {
HTMLAttributes: {}
};
},
parseHTML() {
return [
{
tag: "strong"
},
{
tag: "b",
getAttrs: (t) => t.style.fontWeight !== "normal" && null
},
{
style: "font-weight",
getAttrs: (t) => /^(bold(er)?|[5-9]\d{2,})$/.test(t) && null
}
];
},
renderHTML({ HTMLAttributes: t }) {
return ["strong", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setBold: () => ({ commands: t }) => t.setMark(this.name),
toggleBold: () => ({ commands: t }) => t.toggleMark(this.name),
unsetBold: () => ({ commands: t }) => t.unsetMark(this.name)
};
},
addKeyboardShortcuts() {
return {
"Mod-b": () => this.editor.commands.toggleBold(),
"Mod-B": () => this.editor.commands.toggleBold()
};
},
addInputRules() {
return [
Ga({
find: AB,
type: this.type
}),
Ga({
find: DB,
type: this.type
})
];
},
addPasteRules() {
return [
qo({
find: MB,
type: this.type
}),
qo({
find: $B,
type: this.type
})
];
}
}), PB = sn.create({
name: "listItem",
addOptions() {
return {
HTMLAttributes: {},
bulletListTypeName: "bulletList",
orderedListTypeName: "orderedList"
};
},
content: "paragraph block*",
defining: !0,
parseHTML() {
return [
{
tag: "li"
}
];
},
renderHTML({ HTMLAttributes: t }) {
return ["li", Pt(this.options.HTMLAttributes, t), 0];
},
addKeyboardShortcuts() {
return {
Enter: () => this.editor.commands.splitListItem(this.name),
Tab: () => this.editor.commands.sinkListItem(this.name),
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
};
}
}), cb = xr.create({
name: "textStyle",
addOptions() {
return {
HTMLAttributes: {}
};
},
parseHTML() {
return [
{
tag: "span",
getAttrs: (t) => t.hasAttribute("style") ? {} : !1
}
];
},
renderHTML({ HTMLAttributes: t }) {
return ["span", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
removeEmptyTextStyle: () => ({ state: t, commands: e }) => {
const n = yd(t, this.type);
return Object.entries(n).some(([, i]) => !!i) ? !0 : e.unsetMark(this.name);
}
};
}
}), db = /^\s*([-+*])\s$/, IB = sn.create({
name: "bulletList",
addOptions() {
return {
itemTypeName: "listItem",
HTMLAttributes: {},
keepMarks: !1,
keepAttributes: !1
};
},
group: "block list",
content() {
return `${this.options.itemTypeName}+`;
},
parseHTML() {
return [
{ tag: "ul" }
];
},
renderHTML({ HTMLAttributes: t }) {
return ["ul", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
toggleBulletList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(PB.name, this.editor.getAttributes(cb.name)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-8": () => this.editor.commands.toggleBulletList()
};
},
addInputRules() {
let t = lu({
find: db,
type: this.type
});
return (this.options.keepMarks || this.options.keepAttributes) && (t = lu({
find: db,
type: this.type,
keepMarks: this.options.keepMarks,
keepAttributes: this.options.keepAttributes,
getAttributes: () => this.editor.getAttributes(cb.name),
editor: this.editor
})), [
t
];
}
}), LB = /(?:^|\s)((?:`)((?:[^`]+))(?:`))$/, RB = /(?:^|\s)((?:`)((?:[^`]+))(?:`))/g, BB = xr.create({
name: "code",
addOptions() {
return {
HTMLAttributes: {}
};
},
excludes: "_",
code: !0,
exitable: !0,
parseHTML() {
return [
{ tag: "code" }
];
},
renderHTML({ HTMLAttributes: t }) {
return ["code", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setCode: () => ({ commands: t }) => t.setMark(this.name),
toggleCode: () => ({ commands: t }) => t.toggleMark(this.name),
unsetCode: () => ({ commands: t }) => t.unsetMark(this.name)
};
},
addKeyboardShortcuts() {
return {
"Mod-e": () => this.editor.commands.toggleCode()
};
},
addInputRules() {
return [
Ga({
find: LB,
type: this.type
})
];
},
addPasteRules() {
return [
qo({
find: RB,
type: this.type
})
];
}
}), VB = /^```([a-z]+)?[\s\n]$/, zB = /^~~~([a-z]+)?[\s\n]$/, HB = sn.create({
name: "codeBlock",
addOptions() {
return {
languageClassPrefix: "language-",
exitOnTripleEnter: !0,
exitOnArrowDown: !0,
HTMLAttributes: {}
};
},
content: "text*",
marks: "",
group: "block",
code: !0,
defining: !0,
addAttributes() {
return {
language: {
default: null,
parseHTML: (t) => {
var e;
const { languageClassPrefix: n } = this.options, o = [...((e = t.firstElementChild) === null || e === void 0 ? void 0 : e.classList) || []].filter((a) => a.startsWith(n)).map((a) => a.replace(n, ""))[0];
return o || null;
},
rendered: !1
}
};
},
parseHTML() {
return [
{
tag: "pre",
preserveWhitespace: "full"
}
];
},
renderHTML({ node: t, HTMLAttributes: e }) {
return [
"pre",
Pt(this.options.HTMLAttributes, e),
[
"code",
{
class: t.attrs.language ? this.options.languageClassPrefix + t.attrs.language : null
},
0
]
];
},
addCommands() {
return {
setCodeBlock: (t) => ({ commands: e }) => e.setNode(this.name, t),
toggleCodeBlock: (t) => ({ commands: e }) => e.toggleNode(this.name, "paragraph", t)
};
},
addKeyboardShortcuts() {
return {
"Mod-Alt-c": () => this.editor.commands.toggleCodeBlock(),
// remove code block when at start of document or code block is empty
Backspace: () => {
const { empty: t, $anchor: e } = this.editor.state.selection, n = e.pos === 1;
return !t || e.parent.type.name !== this.name ? !1 : n || !e.parent.textContent.length ? this.editor.commands.clearNodes() : !1;
},
// exit node on triple enter
Enter: ({ editor: t }) => {
if (!this.options.exitOnTripleEnter)
return !1;
const { state: e } = t, { selection: n } = e, { $from: r, empty: i } = n;
if (!i || r.parent.type !== this.type)
return !1;
const o = r.parentOffset === r.parent.nodeSize - 2, a = r.parent.textContent.endsWith(`
`);
return !o || !a ? !1 : t.chain().command(({ tr: s }) => (s.delete(r.pos - 2, r.pos), !0)).exitCode().run();
},
// exit node on arrow down
ArrowDown: ({ editor: t }) => {
if (!this.options.exitOnArrowDown)
return !1;
const { state: e } = t, { selection: n, doc: r } = e, { $from: i, empty: o } = n;
if (!o || i.parent.type !== this.type || !(i.parentOffset === i.parent.nodeSize - 2))
return !1;
const s = i.after();
return s === void 0 || r.nodeAt(s) ? !1 : t.commands.exitCode();
}
};
},
addInputRules() {
return [
K0({
find: VB,
type: this.type,
getAttributes: (t) => ({
language: t[1]
})
}),
K0({
find: zB,
type: this.type,
getAttributes: (t) => ({
language: t[1]
})
})
];
},
addProseMirrorPlugins() {
return [
// this plugin creates a code block for pasted content from VS Code
// we can also detect the copied code language
new un({
key: new er("codeBlockVSCodeHandler"),
props: {
handlePaste: (t, e) => {
if (!e.clipboardData || this.editor.isActive(this.type.name))
return !1;
const n = e.clipboardData.getData("text/plain"), r = e.clipboardData.getData("vscode-editor-data"), i = r ? JSON.parse(r) : void 0, o = i == null ? void 0 : i.mode;
if (!n || !o)
return !1;
const { tr: a } = t.state;
return a.replaceSelectionWith(this.type.create({ language: o })), a.setSelection(Ye.near(a.doc.resolve(Math.max(0, a.selection.from - 2)))), a.insertText(n.replace(/\r\n?/g, `
`)), a.setMeta("paste", !0), t.dispatch(a), !0;
}
}
})
];
}
}), qB = sn.create({
name: "doc",
topNode: !0,
content: "block+"
});
function FB(t = {}) {
return new un({
view(e) {
return new jB(e, t);
}
});
}
class jB {
constructor(e, n) {
var r;
this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = (r = n.width) !== null && r !== void 0 ? r : 1, this.color = n.color === !1 ? void 0 : n.color || "black", this.class = n.class, this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((i) => {
let o = (a) => {
this[i](a);
};
return e.dom.addEventListener(i, o), { name: i, handler: o };
});
}
destroy() {
this.handlers.forEach(({ name: e, handler: n }) => this.editorView.dom.removeEventListener(e, n));
}
update(e, n) {
this.cursorPos != null && n.doc != e.state.doc && (this.cursorPos > e.state.doc.content.size ? this.setCursor(null) : this.updateOverlay());
}
setCursor(e) {
e != this.cursorPos && (this.cursorPos = e, e == null ? (this.element.parentNode.removeChild(this.element), this.element = null) : this.updateOverlay());
}
updateOverlay() {
let e = this.editorView.state.doc.resolve(this.cursorPos), n = !e.parent.inlineContent, r;
if (n) {
let s = e.nodeBefore, u = e.nodeAfter;
if (s || u) {
let l = this.editorView.nodeDOM(this.cursorPos - (s ? s.nodeSize : 0));
if (l) {
let c = l.getBoundingClientRect(), f = s ? c.bottom : c.top;
s && u && (f = (f + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2), r = { left: c.left, right: c.right, top: f - this.width / 2, bottom: f + this.width / 2 };
}
}
}
if (!r) {
let s = this.editorView.coordsAtPos(this.cursorPos);
r = { left: s.left - this.width / 2, right: s.left + this.width / 2, top: s.top, bottom: s.bottom };
}
let i = this.editorView.dom.offsetParent;
this.element || (this.element = i.appendChild(document.createElement("div")), this.class && (this.element.className = this.class), this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none;", this.color && (this.element.style.backgroundColor = this.color)), this.element.classList.toggle("prosemirror-dropcursor-block", n), this.element.classList.toggle("prosemirror-dropcursor-inline", !n);
let o, a;
if (!i || i == document.body && getComputedStyle(i).position == "static")
o = -pageXOffset, a = -pageYOffset;
else {
let s = i.getBoundingClientRect();
o = s.left - i.scrollLeft, a = s.top - i.scrollTop;
}
this.element.style.left = r.left - o + "px", this.element.style.top = r.top - a + "px", this.element.style.width = r.right - r.left + "px", this.element.style.height = r.bottom - r.top + "px";
}
scheduleRemoval(e) {
clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(null), e);
}
dragover(e) {
if (!this.editorView.editable)
return;
let n = this.editorView.posAtCoords({ left: e.clientX, top: e.clientY }), r = n && n.inside >= 0 && this.editorView.state.doc.nodeAt(n.inside), i = r && r.type.spec.disableDropCursor, o = typeof i == "function" ? i(this.editorView, n, e) : i;
if (n && !o) {
let a = n.pos;
if (this.editorView.dragging && this.editorView.dragging.slice) {
let s = J3(this.editorView.state.doc, a, this.editorView.dragging.slice);
s != null && (a = s);
}
this.setCursor(a), this.scheduleRemoval(5e3);
}
}
dragend() {
this.scheduleRemoval(20);
}
drop() {
this.scheduleRemoval(20);
}
dragleave(e) {
(e.target == this.editorView.dom || !this.editorView.dom.contains(e.relatedTarget)) && this.setCursor(null);
}
}
const UB = an.create({
name: "dropCursor",
addOptions() {
return {
color: "currentColor",
width: 1,
class: void 0
};
},
addProseMirrorPlugins() {
return [
FB(this.options)
];
}
});
class $t extends Je {
/**
Create a gap cursor.
*/
constructor(e) {
super(e, e);
}
map(e, n) {
let r = e.resolve(n.map(this.head));
return $t.valid(r) ? new $t(r) : Je.near(r);
}
content() {
return Te.empty;
}
eq(e) {
return e instanceof $t && e.head == this.head;
}
toJSON() {
return { type: "gapcursor", pos: this.head };
}
/**
@internal
*/
static fromJSON(e, n) {
if (typeof n.pos != "number")
throw new RangeError("Invalid input for GapCursor.fromJSON");
return new $t(e.resolve(n.pos));
}
/**
@internal
*/
getBookmark() {
return new Oh(this.anchor);
}
/**
@internal
*/
static valid(e) {
let n = e.parent;
if (n.isTextblock || !WB(e) || !YB(e))
return !1;
let r = n.type.spec.allowGapCursor;
if (r != null)
return r;
let i = n.contentMatchAt(e.index()).defaultType;
return i && i.isTextblock;
}
/**
@internal
*/
static findGapCursorFrom(e, n, r = !1) {
e:
for (; ; ) {
if (!r && $t.valid(e))
return e;
let i = e.pos, o = null;
for (let a = e.depth; ; a--) {
let s = e.node(a);
if (n > 0 ? e.indexAfter(a) < s.childCount : e.index(a) > 0) {
o = s.child(n > 0 ? e.indexAfter(a) : e.index(a) - 1);
break;
} else if (a == 0)
return null;
i += n;
let u = e.doc.resolve(i);
if ($t.valid(u))
return u;
}
for (; ; ) {
let a = n > 0 ? o.firstChild : o.lastChild;
if (!a) {
if (o.isAtom && !o.isText && !Ve.isSelectable(o)) {
e = e.doc.resolve(i + o.nodeSize * n), r = !1;
continue e;
}
break;
}
o = a, i += n;
let s = e.doc.resolve(i);
if ($t.valid(s))
return s;
}
return null;
}
}
}
$t.prototype.visible = !1;
$t.findFrom = $t.findGapCursorFrom;
Je.jsonID("gapcursor", $t);
class Oh {
constructor(e) {
this.pos = e;
}
map(e) {
return new Oh(e.map(this.pos));
}
resolve(e) {
let n = e.resolve(this.pos);
return $t.valid(n) ? new $t(n) : Je.near(n);
}
}
function WB(t) {
for (let e = t.depth; e >= 0; e--) {
let n = t.index(e), r = t.node(e);
if (n == 0) {
if (r.type.spec.isolating)
return !0;
continue;
}
for (let i = r.child(n - 1); ; i = i.lastChild) {
if (i.childCount == 0 && !i.inlineContent || i.isAtom || i.type.spec.isolating)
return !0;
if (i.inlineContent)
return !1;
}
}
return !0;
}
function YB(t) {
for (let e = t.depth; e >= 0; e--) {
let n = t.indexAfter(e), r = t.node(e);
if (n == r.childCount) {
if (r.type.spec.isolating)
return !0;
continue;
}
for (let i = r.child(n); ; i = i.firstChild) {
if (i.childCount == 0 && !i.inlineContent || i.isAtom || i.type.spec.isolating)
return !0;
if (i.inlineContent)
return !1;
}
}
return !0;
}
function KB() {
return new un({
props: {
decorations: QB,
createSelectionBetween(t, e, n) {
return e.pos == n.pos && $t.valid(n) ? new $t(n) : null;
},
handleClick: JB,
handleKeyDown: GB,
handleDOMEvents: { beforeinput: XB }
}
});
}
const GB = Iw({
ArrowLeft: Ku("horiz", -1),
ArrowRight: Ku("horiz", 1),
ArrowUp: Ku("vert", -1),
ArrowDown: Ku("vert", 1)
});
function Ku(t, e) {
const n = t == "vert" ? e > 0 ? "down" : "up" : e > 0 ? "right" : "left";
return function(r, i, o) {
let a = r.selection, s = e > 0 ? a.$to : a.$from, u = a.empty;
if (a instanceof Ye) {
if (!o.endOfTextblock(n) || s.depth == 0)
return !1;
u = !1, s = r.doc.resolve(e > 0 ? s.after() : s.before());
}
let l = $t.findGapCursorFrom(s, e, u);
return l ? (i && i(r.tr.setSelection(new $t(l))), !0) : !1;
};
}
function JB(t, e, n) {
if (!t || !t.editable)
return !1;
let r = t.state.doc.resolve(e);
if (!$t.valid(r))
return !1;
let i = t.posAtCoords({ left: n.clientX, top: n.clientY });
return i && i.inside > -1 && Ve.isSelectable(t.state.doc.nodeAt(i.inside)) ? !1 : (t.dispatch(t.state.tr.setSelection(new $t(r))), !0);
}
function XB(t, e) {
if (e.inputType != "insertCompositionText" || !(t.state.selection instanceof $t))
return !1;
let { $from: n } = t.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);
if (!r)
return !1;
let i = me.empty;
for (let a = r.length - 1; a >= 0; a--)
i = me.from(r[a].createAndFill(null, i));
let o = t.state.tr.replace(n.pos, n.pos, new Te(i, 0, 0));
return o.setSelection(Ye.near(o.doc.resolve(n.pos + 1))), t.dispatch(o), !1;
}
function QB(t) {
if (!(t.selection instanceof $t))
return null;
let e = document.createElement("div");
return e.className = "ProseMirror-gapcursor", Vt.create(t.doc, [Jn.widget(t.selection.head, e, { key: "gapcursor" })]);
}
const ZB = an.create({
name: "gapCursor",
addProseMirrorPlugins() {
return [
KB()
];
},
extendNodeSchema(t) {
var e;
const n = {
name: t.name,
options: t.options,
storage: t.storage
};
return {
allowGapCursor: (e = Ge(Me(t, "allowGapCursor", n))) !== null && e !== void 0 ? e : null
};
}
}), eV = sn.create({
name: "hardBreak",
addOptions() {
return {
keepMarks: !0,
HTMLAttributes: {}
};
},
inline: !0,
group: "inline",
selectable: !1,
parseHTML() {
return [
{ tag: "br" }
];
},
renderHTML({ HTMLAttributes: t }) {
return ["br", Pt(this.options.HTMLAttributes, t)];
},
renderText() {
return `
`;
},
addCommands() {
return {
setHardBreak: () => ({ commands: t, chain: e, state: n, editor: r }) => t.first([
() => t.exitCode(),
() => t.command(() => {
const { selection: i, storedMarks: o } = n;
if (i.$from.parent.type.spec.isolating)
return !1;
const { keepMarks: a } = this.options, { splittableMarks: s } = r.extensionManager, u = o || i.$to.parentOffset && i.$from.marks();
return e().insertContent({ type: this.name }).command(({ tr: l, dispatch: c }) => {
if (c && u && a) {
const f = u.filter((d) => s.includes(d.type.name));
l.ensureMarks(f);
}
return !0;
}).run();
})
])
};
},
addKeyboardShortcuts() {
return {
"Mod-Enter": () => this.editor.commands.setHardBreak(),
"Shift-Enter": () => this.editor.commands.setHardBreak()
};
}
}), tV = sn.create({
name: "heading",
addOptions() {
return {
levels: [1, 2, 3, 4, 5, 6],
HTMLAttributes: {}
};
},
content: "inline*",
group: "block",
defining: !0,
addAttributes() {
return {
level: {
default: 1,
rendered: !1
}
};
},
parseHTML() {
return this.options.levels.map((t) => ({
tag: `h${t}`,
attrs: { level: t }
}));
},
renderHTML({ node: t, HTMLAttributes: e }) {
return [`h${this.options.levels.includes(t.attrs.level) ? t.attrs.level : this.options.levels[0]}`, Pt(this.options.HTMLAttributes, e), 0];
},
addCommands() {
return {
setHeading: (t) => ({ commands: e }) => this.options.levels.includes(t.level) ? e.setNode(this.name, t) : !1,
toggleHeading: (t) => ({ commands: e }) => this.options.levels.includes(t.level) ? e.toggleNode(this.name, "paragraph", t) : !1
};
},
addKeyboardShortcuts() {
return this.options.levels.reduce((t, e) => ({
...t,
[`Mod-Alt-${e}`]: () => this.editor.commands.toggleHeading({ level: e })
}), {});
},
addInputRules() {
return this.options.levels.map((t) => K0({
find: new RegExp(`^(#{1,${t}})\\s$`),
type: this.type,
getAttributes: {
level: t
}
}));
}
});
var dc = 200, Jt = function() {
};
Jt.prototype.append = function(e) {
return e.length ? (e = Jt.from(e), !this.length && e || e.length < dc && this.leafAppend(e) || this.length < dc && e.leafPrepend(this) || this.appendInner(e)) : this;
};
Jt.prototype.prepend = function(e) {
return e.length ? Jt.from(e).append(this) : this;
};
Jt.prototype.appendInner = function(e) {
return new nV(this, e);
};
Jt.prototype.slice = function(e, n) {
return e === void 0 && (e = 0), n === void 0 && (n = this.length), e >= n ? Jt.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, n));
};
Jt.prototype.get = function(e) {
if (!(e < 0 || e >= this.length))
return this.getInner(e);
};
Jt.prototype.forEach = function(e, n, r) {
n === void 0 && (n = 0), r === void 0 && (r = this.length), n <= r ? this.forEachInner(e, n, r, 0) : this.forEachInvertedInner(e, n, r, 0);
};
Jt.prototype.map = function(e, n, r) {
n === void 0 && (n = 0), r === void 0 && (r = this.length);
var i = [];
return this.forEach(function(o, a) {
return i.push(e(o, a));
}, n, r), i;
};
Jt.from = function(e) {
return e instanceof Jt ? e : e && e.length ? new Xw(e) : Jt.empty;
};
var Xw = /* @__PURE__ */ function(t) {
function e(r) {
t.call(this), this.values = r;
}
t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e;
var n = { length: { configurable: !0 }, depth: { configurable: !0 } };
return e.prototype.flatten = function() {
return this.values;
}, e.prototype.sliceInner = function(i, o) {
return i == 0 && o == this.length ? this : new e(this.values.slice(i, o));
}, e.prototype.getInner = function(i) {
return this.values[i];
}, e.prototype.forEachInner = function(i, o, a, s) {
for (var u = o; u < a; u++)
if (i(this.values[u], s + u) === !1)
return !1;
}, e.prototype.forEachInvertedInner = function(i, o, a, s) {
for (var u = o - 1; u >= a; u--)
if (i(this.values[u], s + u) === !1)
return !1;
}, e.prototype.leafAppend = function(i) {
if (this.length + i.length <= dc)
return new e(this.values.concat(i.flatten()));
}, e.prototype.leafPrepend = function(i) {
if (this.length + i.length <= dc)
return new e(i.flatten().concat(this.values));
}, n.length.get = function() {
return this.values.length;
}, n.depth.get = function() {
return 0;
}, Object.defineProperties(e.prototype, n), e;
}(Jt);
Jt.empty = new Xw([]);
var nV = /* @__PURE__ */ function(t) {
function e(n, r) {
t.call(this), this.left = n, this.right = r, this.length = n.length + r.length, this.depth = Math.max(n.depth, r.depth) + 1;
}
return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.flatten = function() {
return this.left.flatten().concat(this.right.flatten());
}, e.prototype.getInner = function(r) {
return r < this.left.length ? this.left.get(r) : this.right.get(r - this.left.length);
}, e.prototype.forEachInner = function(r, i, o, a) {
var s = this.left.length;
if (i < s && this.left.forEachInner(r, i, Math.min(o, s), a) === !1 || o > s && this.right.forEachInner(r, Math.max(i - s, 0), Math.min(this.length, o) - s, a + s) === !1)
return !1;
}, e.prototype.forEachInvertedInner = function(r, i, o, a) {
var s = this.left.length;
if (i > s && this.right.forEachInvertedInner(r, i - s, Math.max(o, s) - s, a + s) === !1 || o < s && this.left.forEachInvertedInner(r, Math.min(i, s), o, a) === !1)
return !1;
}, e.prototype.sliceInner = function(r, i) {
if (r == 0 && i == this.length)
return this;
var o = this.left.length;
return i <= o ? this.left.slice(r, i) : r >= o ? this.right.slice(r - o, i - o) : this.left.slice(r, o).append(this.right.slice(0, i - o));
}, e.prototype.leafAppend = function(r) {
var i = this.right.leafAppend(r);
if (i)
return new e(this.left, i);
}, e.prototype.leafPrepend = function(r) {
var i = this.left.leafPrepend(r);
if (i)
return new e(i, this.right);
}, e.prototype.appendInner = function(r) {
return this.left.depth >= Math.max(this.right.depth, r.depth) + 1 ? new e(this.left, new e(this.right, r)) : new e(this, r);
}, e;
}(Jt);
const rV = 500;
class vr {
constructor(e, n) {
this.items = e, this.eventCount = n;
}
// Pop the latest event off the branch's history and apply it
// to a document transform.
popEvent(e, n) {
if (this.eventCount == 0)
return null;
let r = this.items.length;
for (; ; r--)
if (this.items.get(r - 1).selection) {
--r;
break;
}
let i, o;
n && (i = this.remapping(r, this.items.length), o = i.maps.length);
let a = e.tr, s, u, l = [], c = [];
return this.items.forEach((f, d) => {
if (!f.step) {
i || (i = this.remapping(r, d + 1), o = i.maps.length), o--, c.push(f);
return;
}
if (i) {
c.push(new Tr(f.map));
let p = f.step.map(i.slice(o)), h;
p && a.maybeStep(p).doc && (h = a.mapping.maps[a.mapping.maps.length - 1], l.push(new Tr(h, void 0, void 0, l.length + c.length))), o--, h && i.appendMap(h, o);
} else
a.maybeStep(f.step);
if (f.selection)
return s = i ? f.selection.map(i.slice(o)) : f.selection, u = new vr(this.items.slice(0, r).append(c.reverse().concat(l)), this.eventCount - 1), !1;
}, this.items.length, 0), { remaining: u, transform: a, selection: s };
}
// Create a new branch with the given transform added.
addTransform(e, n, r, i) {
let o = [], a = this.eventCount, s = this.items, u = !i && s.length ? s.get(s.length - 1) : null;
for (let c = 0; c < e.steps.length; c++) {
let f = e.steps[c].invert(e.docs[c]), d = new Tr(e.mapping.maps[c], f, n), p;
(p = u && u.merge(d)) && (d = p, c ? o.pop() : s = s.slice(0, s.length - 1)), o.push(d), n && (a++, n = void 0), i || (u = d);
}
let l = a - r.depth;
return l > oV && (s = iV(s, l), a -= l), new vr(s.append(o), a);
}
remapping(e, n) {
let r = new ya();
return this.items.forEach((i, o) => {
let a = i.mirrorOffset != null && o - i.mirrorOffset >= e ? r.maps.length - i.mirrorOffset : void 0;
r.appendMap(i.map, a);
}, e, n), r;
}
addMaps(e) {
return this.eventCount == 0 ? this : new vr(this.items.append(e.map((n) => new Tr(n))), this.eventCount);
}
// When the collab module receives remote changes, the history has
// to know about those, so that it can adjust the steps that were
// rebased on top of the remote changes, and include the position
// maps for the remote changes in its array of items.
rebased(e, n) {
if (!this.eventCount)
return this;
let r = [], i = Math.max(0, this.items.length - n), o = e.mapping, a = e.steps.length, s = this.eventCount;
this.items.forEach((d) => {
d.selection && s--;
}, i);
let u = n;
this.items.forEach((d) => {
let p = o.getMirror(--u);
if (p == null)
return;
a = Math.min(a, p);
let h = o.maps[p];
if (d.step) {
let m = e.steps[p].invert(e.docs[p]), v = d.selection && d.selection.map(o.slice(u + 1, p));
v && s++, r.push(new Tr(h, m, v));
} else
r.push(new Tr(h));
}, i);
let l = [];
for (let d = n; d < a; d++)
l.push(new Tr(o.maps[d]));
let c = this.items.slice(0, i).append(l).append(r), f = new vr(c, s);
return f.emptyItemCount() > rV && (f = f.compress(this.items.length - r.length)), f;
}
emptyItemCount() {
let e = 0;
return this.items.forEach((n) => {
n.step || e++;
}), e;
}
// Compressing a branch means rewriting it to push the air (map-only
// items) out. During collaboration, these naturally accumulate
// because each remote change adds one. The `upto` argument is used
// to ensure that only the items below a given level are compressed,
// because `rebased` relies on a clean, untouched set of items in
// order to associate old items with rebased steps.
compress(e = this.items.length) {
let n = this.remapping(0, e), r = n.maps.length, i = [], o = 0;
return this.items.forEach((a, s) => {
if (s >= e)
i.push(a), a.selection && o++;
else if (a.step) {
let u = a.step.map(n.slice(r)), l = u && u.getMap();
if (r--, l && n.appendMap(l, r), u) {
let c = a.selection && a.selection.map(n.slice(r));
c && o++;
let f = new Tr(l.invert(), u, c), d, p = i.length - 1;
(d = i.length && i[p].merge(f)) ? i[p] = d : i.push(f);
}
} else
a.map && r--;
}, this.items.length, 0), new vr(Jt.from(i.reverse()), o);
}
}
vr.empty = new vr(Jt.empty, 0);
function iV(t, e) {
let n;
return t.forEach((r, i) => {
if (r.selection && e-- == 0)
return n = i, !1;
}), t.slice(n);
}
class Tr {
constructor(e, n, r, i) {
this.map = e, this.step = n, this.selection = r, this.mirrorOffset = i;
}
merge(e) {
if (this.step && e.step && !e.selection) {
let n = e.step.merge(this.step);
if (n)
return new Tr(n.getMap().invert(), n, this.selection);
}
}
}
class xi {
constructor(e, n, r, i, o) {
this.done = e, this.undone = n, this.prevRanges = r, this.prevTime = i, this.prevComposition = o;
}
}
const oV = 20;
function aV(t, e, n, r) {
let i = n.getMeta(Bi), o;
if (i)
return i.historyState;
n.getMeta(uV) && (t = new xi(t.done, t.undone, null, 0, -1));
let a = n.getMeta("appendedTransaction");
if (n.steps.length == 0)
return t;
if (a && a.getMeta(Bi))
return a.getMeta(Bi).redo ? new xi(t.done.addTransform(n, void 0, r, wl(e)), t.undone, fb(n.mapping.maps[n.steps.length - 1]), t.prevTime, t.prevComposition) : new xi(t.done, t.undone.addTransform(n, void 0, r, wl(e)), null, t.prevTime, t.prevComposition);
if (n.getMeta("addToHistory") !== !1 && !(a && a.getMeta("addToHistory") === !1)) {
let s = n.getMeta("composition"), u = t.prevTime == 0 || !a && t.prevComposition != s && (t.prevTime < (n.time || 0) - r.newGroupDelay || !sV(n, t.prevRanges)), l = a ? Tf(t.prevRanges, n.mapping) : fb(n.mapping.maps[n.steps.length - 1]);
return new xi(t.done.addTransform(n, u ? e.selection.getBookmark() : void 0, r, wl(e)), vr.empty, l, n.time, s ?? t.prevComposition);
} else
return (o = n.getMeta("rebased")) ? new xi(t.done.rebased(n, o), t.undone.rebased(n, o), Tf(t.prevRanges, n.mapping), t.prevTime, t.prevComposition) : new xi(t.done.addMaps(n.mapping.maps), t.undone.addMaps(n.mapping.maps), Tf(t.prevRanges, n.mapping), t.prevTime, t.prevComposition);
}
function sV(t, e) {
if (!e)
return !1;
if (!t.docChanged)
return !0;
let n = !1;
return t.mapping.maps[0].forEach((r, i) => {
for (let o = 0; o < e.length; o += 2)
r <= e[o + 1] && i >= e[o] && (n = !0);
}), n;
}
function fb(t) {
let e = [];
return t.forEach((n, r, i, o) => e.push(i, o)), e;
}
function Tf(t, e) {
if (!t)
return null;
let n = [];
for (let r = 0; r < t.length; r += 2) {
let i = e.map(t[r], 1), o = e.map(t[r + 1], -1);
i <= o && n.push(i, o);
}
return n;
}
function Qw(t, e, n, r) {
let i = wl(e), o = Bi.get(e).spec.config, a = (r ? t.undone : t.done).popEvent(e, i);
if (!a)
return;
let s = a.selection.resolve(a.transform.doc), u = (r ? t.done : t.undone).addTransform(a.transform, e.selection.getBookmark(), o, i), l = new xi(r ? u : a.remaining, r ? a.remaining : u, null, 0, -1);
n(a.transform.setSelection(s).setMeta(Bi, { redo: r, historyState: l }).scrollIntoView());
}
let Cf = !1, pb = null;
function wl(t) {
let e = t.plugins;
if (pb != e) {
Cf = !1, pb = e;
for (let n = 0; n < e.length; n++)
if (e[n].spec.historyPreserveItems) {
Cf = !0;
break;
}
}
return Cf;
}
const Bi = new er("history"), uV = new er("closeHistory");
function lV(t = {}) {
return t = {
depth: t.depth || 100,
newGroupDelay: t.newGroupDelay || 500
}, new un({
key: Bi,
state: {
init() {
return new xi(vr.empty, vr.empty, null, 0, -1);
},
apply(e, n, r) {
return aV(n, r, e, t);
}
},
config: t,
props: {
handleDOMEvents: {
beforeinput(e, n) {
let r = n.inputType, i = r == "historyUndo" ? Zw : r == "historyRedo" ? e6 : null;
return i ? (n.preventDefault(), i(e.state, e.dispatch)) : !1;
}
}
}
});
}
const Zw = (t, e) => {
let n = Bi.getState(t);
return !n || n.done.eventCount == 0 ? !1 : (e && Qw(n, t, e, !1), !0);
}, e6 = (t, e) => {
let n = Bi.getState(t);
return !n || n.undone.eventCount == 0 ? !1 : (e && Qw(n, t, e, !0), !0);
}, cV = an.create({
name: "history",
addOptions() {
return {
depth: 100,
newGroupDelay: 500
};
},
addCommands() {
return {
undo: () => ({ state: t, dispatch: e }) => Zw(t, e),
redo: () => ({ state: t, dispatch: e }) => e6(t, e)
};
},
addProseMirrorPlugins() {
return [
lV(this.options)
];
},
addKeyboardShortcuts() {
return {
"Mod-z": () => this.editor.commands.undo(),
"Mod-Z": () => this.editor.commands.undo(),
"Mod-y": () => this.editor.commands.redo(),
"Mod-Y": () => this.editor.commands.redo(),
"Shift-Mod-z": () => this.editor.commands.redo(),
"Shift-Mod-Z": () => this.editor.commands.redo(),
// Russian keyboard layouts
"Mod-я": () => this.editor.commands.undo(),
"Shift-Mod-я": () => this.editor.commands.redo()
};
}
}), dV = sn.create({
name: "horizontalRule",
addOptions() {
return {
HTMLAttributes: {}
};
},
group: "block",
parseHTML() {
return [{ tag: "hr" }];
},
renderHTML({ HTMLAttributes: t }) {
return ["hr", Pt(this.options.HTMLAttributes, t)];
},
addCommands() {
return {
setHorizontalRule: () => ({ chain: t, state: e }) => {
const { $to: n } = e.selection, r = t();
return n.parentOffset === 0 ? r.insertContentAt(Math.max(n.pos - 2, 0), { type: this.name }) : r.insertContent({ type: this.name }), r.command(({ tr: i, dispatch: o }) => {
var a;
if (o) {
const { $to: s } = i.selection, u = s.end();
if (s.nodeAfter)
s.nodeAfter.isTextblock ? i.setSelection(Ye.create(i.doc, s.pos + 1)) : s.nodeAfter.isBlock ? i.setSelection(Ve.create(i.doc, s.pos)) : i.setSelection(Ye.create(i.doc, s.pos));
else {
const l = (a = s.parent.type.contentMatch.defaultType) === null || a === void 0 ? void 0 : a.create();
l && (i.insert(u, l), i.setSelection(Ye.create(i.doc, u + 1)));
}
i.scrollIntoView();
}
return !0;
}).run();
}
};
},
addInputRules() {
return [
Y0({
find: /^(?:---|—-|___\s|\*\*\*\s)$/,
type: this.type
})
];
}
}), fV = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/, pV = /(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g, hV = /(?:^|\s)((?:_)((?:[^_]+))(?:_))$/, mV = /(?:^|\s)((?:_)((?:[^_]+))(?:_))/g, gV = xr.create({
name: "italic",
addOptions() {
return {
HTMLAttributes: {}
};
},
parseHTML() {
return [
{
tag: "em"
},
{
tag: "i",
getAttrs: (t) => t.style.fontStyle !== "normal" && null
},
{
style: "font-style=italic"
}
];
},
renderHTML({ HTMLAttributes: t }) {
return ["em", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setItalic: () => ({ commands: t }) => t.setMark(this.name),
toggleItalic: () => ({ commands: t }) => t.toggleMark(this.name),
unsetItalic: () => ({ commands: t }) => t.unsetMark(this.name)
};
},
addKeyboardShortcuts() {
return {
"Mod-i": () => this.editor.commands.toggleItalic(),
"Mod-I": () => this.editor.commands.toggleItalic()
};
},
addInputRules() {
return [
Ga({
find: fV,
type: this.type
}),
Ga({
find: hV,
type: this.type
})
];
},
addPasteRules() {
return [
qo({
find: pV,
type: this.type
}),
qo({
find: mV,
type: this.type
})
];
}
}), bV = sn.create({
name: "listItem",
addOptions() {
return {
HTMLAttributes: {},
bulletListTypeName: "bulletList",
orderedListTypeName: "orderedList"
};
},
content: "paragraph block*",
defining: !0,
parseHTML() {
return [
{
tag: "li"
}
];
},
renderHTML({ HTMLAttributes: t }) {
return ["li", Pt(this.options.HTMLAttributes, t), 0];
},
addKeyboardShortcuts() {
return {
Enter: () => this.editor.commands.splitListItem(this.name),
Tab: () => this.editor.commands.sinkListItem(this.name),
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
};
}
}), vV = sn.create({
name: "listItem",
addOptions() {
return {
HTMLAttributes: {},
bulletListTypeName: "bulletList",
orderedListTypeName: "orderedList"
};
},
content: "paragraph block*",
defining: !0,
parseHTML() {
return [
{
tag: "li"
}
];
},
renderHTML({ HTMLAttributes: t }) {
return ["li", Pt(this.options.HTMLAttributes, t), 0];
},
addKeyboardShortcuts() {
return {
Enter: () => this.editor.commands.splitListItem(this.name),
Tab: () => this.editor.commands.sinkListItem(this.name),
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
};
}
}), hb = xr.create({
name: "textStyle",
addOptions() {
return {
HTMLAttributes: {}
};
},
parseHTML() {
return [
{
tag: "span",
getAttrs: (t) => t.hasAttribute("style") ? {} : !1
}
];
},
renderHTML({ HTMLAttributes: t }) {
return ["span", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
removeEmptyTextStyle: () => ({ state: t, commands: e }) => {
const n = yd(t, this.type);
return Object.entries(n).some(([, i]) => !!i) ? !0 : e.unsetMark(this.name);
}
};
}
}), mb = /^(\d+)\.\s$/, yV = sn.create({
name: "orderedList",
addOptions() {
return {
itemTypeName: "listItem",
HTMLAttributes: {},
keepMarks: !1,
keepAttributes: !1
};
},
group: "block list",
content() {
return `${this.options.itemTypeName}+`;
},
addAttributes() {
return {
start: {
default: 1,
parseHTML: (t) => t.hasAttribute("start") ? parseInt(t.getAttribute("start") || "", 10) : 1
}
};
},
parseHTML() {
return [
{
tag: "ol"
}
];
},
renderHTML({ HTMLAttributes: t }) {
const { start: e, ...n } = t;
return e === 1 ? ["ol", Pt(this.options.HTMLAttributes, n), 0] : ["ol", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
toggleOrderedList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(vV.name, this.editor.getAttributes(hb.name)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-7": () => this.editor.commands.toggleOrderedList()
};
},
addInputRules() {
let t = lu({
find: mb,
type: this.type,
getAttributes: (e) => ({ start: +e[1] }),
joinPredicate: (e, n) => n.childCount + n.attrs.start === +e[1]
});
return (this.options.keepMarks || this.options.keepAttributes) && (t = lu({
find: mb,
type: this.type,
keepMarks: this.options.keepMarks,
keepAttributes: this.options.keepAttributes,
getAttributes: (e) => ({ start: +e[1], ...this.editor.getAttributes(hb.name) }),
joinPredicate: (e, n) => n.childCount + n.attrs.start === +e[1],
editor: this.editor
})), [
t
];
}
}), wV = sn.create({
name: "paragraph",
priority: 1e3,
addOptions() {
return {
HTMLAttributes: {}
};
},
group: "block",
content: "inline*",
parseHTML() {
return [
{ tag: "p" }
];
},
renderHTML({ HTMLAttributes: t }) {
return ["p", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setParagraph: () => ({ commands: t }) => t.setNode(this.name)
};
},
addKeyboardShortcuts() {
return {
"Mod-Alt-0": () => this.editor.commands.setParagraph()
};
}
}), kV = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/, xV = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g, SV = xr.create({
name: "strike",
addOptions() {
return {
HTMLAttributes: {}
};
},
parseHTML() {
return [
{
tag: "s"
},
{
tag: "del"
},
{
tag: "strike"
},
{
style: "text-decoration",
consuming: !1,
getAttrs: (t) => t.includes("line-through") ? {} : !1
}
];
},
renderHTML({ HTMLAttributes: t }) {
return ["s", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setStrike: () => ({ commands: t }) => t.setMark(this.name),
toggleStrike: () => ({ commands: t }) => t.toggleMark(this.name),
unsetStrike: () => ({ commands: t }) => t.unsetMark(this.name)
};
},
addKeyboardShortcuts() {
const t = {};
return _h() ? t["Mod-Shift-s"] = () => this.editor.commands.toggleStrike() : t["Ctrl-Shift-s"] = () => this.editor.commands.toggleStrike(), t;
},
addInputRules() {
return [
Ga({
find: kV,
type: this.type
})
];
},
addPasteRules() {
return [
qo({
find: xV,
type: this.type
})
];
}
}), EV = sn.create({
name: "text",
group: "inline"
}), _V = an.create({
name: "starterKit",
addExtensions() {
var t, e, n, r, i, o, a, s, u, l, c, f, d, p, h, m, v, y;
const k = [];
return this.options.blockquote !== !1 && k.push(OB.configure((t = this.options) === null || t === void 0 ? void 0 : t.blockquote)), this.options.bold !== !1 && k.push(NB.configure((e = this.options) === null || e === void 0 ? void 0 : e.bold)), this.options.bulletList !== !1 && k.push(IB.configure((n = this.options) === null || n === void 0 ? void 0 : n.bulletList)), this.options.code !== !1 && k.push(BB.configure((r = this.options) === null || r === void 0 ? void 0 : r.code)), this.options.codeBlock !== !1 && k.push(HB.configure((i = this.options) === null || i === void 0 ? void 0 : i.codeBlock)), this.options.document !== !1 && k.push(qB.configure((o = this.options) === null || o === void 0 ? void 0 : o.document)), this.options.dropcursor !== !1 && k.push(UB.configure((a = this.options) === null || a === void 0 ? void 0 : a.dropcursor)), this.options.gapcursor !== !1 && k.push(ZB.configure((s = this.options) === null || s === void 0 ? void 0 : s.gapcursor)), this.options.hardBreak !== !1 && k.push(eV.configure((u = this.options) === null || u === void 0 ? void 0 : u.hardBreak)), this.options.heading !== !1 && k.push(tV.configure((l = this.options) === null || l === void 0 ? void 0 : l.heading)), this.options.history !== !1 && k.push(cV.configure((c = this.options) === null || c === void 0 ? void 0 : c.history)), this.options.horizontalRule !== !1 && k.push(dV.configure((f = this.options) === null || f === void 0 ? void 0 : f.horizontalRule)), this.options.italic !== !1 && k.push(gV.configure((d = this.options) === null || d === void 0 ? void 0 : d.italic)), this.options.listItem !== !1 && k.push(bV.configure((p = this.options) === null || p === void 0 ? void 0 : p.listItem)), this.options.orderedList !== !1 && k.push(yV.configure((h = this.options) === null || h === void 0 ? void 0 : h.orderedList)), this.options.paragraph !== !1 && k.push(wV.configure((m = this.options) === null || m === void 0 ? void 0 : m.paragraph)), this.options.strike !== !1 && k.push(SV.configure((v = this.options) === null || v === void 0 ? void 0 : v.strike)), this.options.text !== !1 && k.push(EV.configure((y = this.options) === null || y === void 0 ? void 0 : y.text)), k;
}
}), TV = "aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", CV = "ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2", Ja = (t, e) => {
for (const n in e)
t[n] = e[n];
return t;
}, G0 = "numeric", J0 = "ascii", X0 = "alpha", kl = "asciinumeric", Gu = "alphanumeric", Q0 = "domain", t6 = "emoji", OV = "scheme", AV = "slashscheme", gb = "whitespace";
function MV(t, e) {
return t in e || (e[t] = []), e[t];
}
function xo(t, e, n) {
e[G0] && (e[kl] = !0, e[Gu] = !0), e[J0] && (e[kl] = !0, e[X0] = !0), e[kl] && (e[Gu] = !0), e[X0] && (e[Gu] = !0), e[Gu] && (e[Q0] = !0), e[t6] && (e[Q0] = !0);
for (const r in e) {
const i = MV(r, n);
i.indexOf(t) < 0 && i.push(t);
}
}
function DV(t, e) {
const n = {};
for (const r in e)
e[r].indexOf(t) >= 0 && (n[r] = !0);
return n;
}
function $n(t) {
t === void 0 && (t = null), this.j = {}, this.jr = [], this.jd = null, this.t = t;
}
$n.groups = {};
$n.prototype = {
accepts() {
return !!this.t;
},
/**
* Follow an existing transition from the given input to the next state.
* Does not mutate.
* @param {string} input character or token type to transition on
* @returns {?State<T>} the next state, if any
*/
go(t) {
const e = this, n = e.j[t];
if (n)
return n;
for (let r = 0; r < e.jr.length; r++) {
const i = e.jr[r][0], o = e.jr[r][1];
if (o && i.test(t))
return o;
}
return e.jd;
},
/**
* Whether the state has a transition for the given input. Set the second
* argument to true to only look for an exact match (and not a default or
* regular-expression-based transition)
* @param {string} input
* @param {boolean} exactOnly
*/
has(t, e) {
return e === void 0 && (e = !1), e ? t in this.j : !!this.go(t);
},
/**
* Short for "transition all"; create a transition from the array of items
* in the given list to the same final resulting state.
* @param {string | string[]} inputs Group of inputs to transition on
* @param {Transition<T> | State<T>} [next] Transition options
* @param {Flags} [flags] Collections flags to add token to
* @param {Collections<T>} [groups] Master list of token groups
*/
ta(t, e, n, r) {
for (let i = 0; i < t.length; i++)
this.tt(t[i], e, n, r);
},
/**
* Short for "take regexp transition"; defines a transition for this state
* when it encounters a token which matches the given regular expression
* @param {RegExp} regexp Regular expression transition (populate first)
* @param {T | State<T>} [next] Transition options
* @param {Flags} [flags] Collections flags to add token to
* @param {Collections<T>} [groups] Master list of token groups
* @returns {State<T>} taken after the given input
*/
tr(t, e, n, r) {
r = r || $n.groups;
let i;
return e && e.j ? i = e : (i = new $n(e), n && r && xo(e, n, r)), this.jr.push([t, i]), i;
},
/**
* Short for "take transitions", will take as many sequential transitions as
* the length of the given input and returns the
* resulting final state.
* @param {string | string[]} input
* @param {T | State<T>} [next] Transition options
* @param {Flags} [flags] Collections flags to add token to
* @param {Collections<T>} [groups] Master list of token groups
* @returns {State<T>} taken after the given input
*/
ts(t, e, n, r) {
let i = this;
const o = t.length;
if (!o)
return i;
for (let a = 0; a < o - 1; a++)
i = i.tt(t[a]);
return i.tt(t[o - 1], e, n, r);
},
/**
* Short for "take transition", this is a method for building/working with
* state machines.
*
* If a state already exists for the given input, returns it.
*
* If a token is specified, that state will emit that token when reached by
* the linkify engine.
*
* If no state exists, it will be initialized with some default transitions
* that resemble existing default transitions.
*
* If a state is given for the second argument, that state will be
* transitioned to on the given input regardless of what that input
* previously did.
*
* Specify a token group flags to define groups that this token belongs to.
* The token will be added to corresponding entires in the given groups
* object.
*
* @param {string} input character, token type to transition on
* @param {T | State<T>} [next] Transition options
* @param {Flags} [flags] Collections flags to add token to
* @param {Collections<T>} [groups] Master list of groups
* @returns {State<T>} taken after the given input
*/
tt(t, e, n, r) {
r = r || $n.groups;
const i = this;
if (e && e.j)
return i.j[t] = e, e;
const o = e;
let a, s = i.go(t);
if (s ? (a = new $n(), Ja(a.j, s.j), a.jr.push.apply(a.jr, s.jr), a.jd = s.jd, a.t = s.t) : a = new $n(), o) {
if (r)
if (a.t && typeof a.t == "string") {
const u = Ja(DV(a.t, r), n);
xo(o, u, r);
} else
n && xo(o, n, r);
a.t = o;
}
return i.j[t] = a, a;
}
};
const Pe = (t, e, n, r, i) => t.ta(e, n, r, i), rr = (t, e, n, r, i) => t.tr(e, n, r, i), bb = (t, e, n, r, i) => t.ts(e, n, r, i), ve = (t, e, n, r, i) => t.tt(e, n, r, i), ii = "WORD", Z0 = "UWORD", cu = "LOCALHOST", ep = "TLD", tp = "UTLD", xl = "SCHEME", sa = "SLASH_SCHEME", Ah = "NUM", n6 = "WS", Mh = "NL", fa = "OPENBRACE", Ps = "OPENBRACKET", Is = "OPENANGLEBRACKET", Ls = "OPENPAREN", mo = "CLOSEBRACE", pa = "CLOSEBRACKET", ha = "CLOSEANGLEBRACKET", go = "CLOSEPAREN", fc = "AMPERSAND", pc = "APOSTROPHE", hc = "ASTERISK", Si = "AT", mc = "BACKSLASH", gc = "BACKTICK", bc = "CARET", Ai = "COLON", Dh = "COMMA", vc = "DOLLAR", Cr = "DOT", yc = "EQUALS", $h = "EXCLAMATION", Or = "HYPHEN", wc = "PERCENT", kc = "PIPE", xc = "PLUS", Sc = "POUND", Ec = "QUERY", Nh = "QUOTE", Ph = "SEMI", Ar = "SLASH", Rs = "TILDE", _c = "UNDERSCORE", r6 = "EMOJI", Tc = "SYM";
var i6 = /* @__PURE__ */ Object.freeze({
__proto__: null,
WORD: ii,
UWORD: Z0,
LOCALHOST: cu,
TLD: ep,
UTLD: tp,
SCHEME: xl,
SLASH_SCHEME: sa,
NUM: Ah,
WS: n6,
NL: Mh,
OPENBRACE: fa,
OPENBRACKET: Ps,
OPENANGLEBRACKET: Is,
OPENPAREN: Ls,
CLOSEBRACE: mo,
CLOSEBRACKET: pa,
CLOSEANGLEBRACKET: ha,
CLOSEPAREN: go,
AMPERSAND: fc,
APOSTROPHE: pc,
ASTERISK: hc,
AT: Si,
BACKSLASH: mc,
BACKTICK: gc,
CARET: bc,
COLON: Ai,
COMMA: Dh,
DOLLAR: vc,
DOT: Cr,
EQUALS: yc,
EXCLAMATION: $h,
HYPHEN: Or,
PERCENT: wc,
PIPE: kc,
PLUS: xc,
POUND: Sc,
QUERY: Ec,
QUOTE: Nh,
SEMI: Ph,
SLASH: Ar,
TILDE: Rs,
UNDERSCORE: _c,
EMOJI: r6,
SYM: Tc
});
const na = /[a-z]/, Of = /\p{L}/u, Af = /\p{Emoji}/u, Mf = /\d/, vb = /\s/, yb = `
`, $V = "️", NV = "";
let Ju = null, Xu = null;
function PV(t) {
t === void 0 && (t = []);
const e = {};
$n.groups = e;
const n = new $n();
Ju == null && (Ju = wb(TV)), Xu == null && (Xu = wb(CV)), ve(n, "'", pc), ve(n, "{", fa), ve(n, "[", Ps), ve(n, "<", Is), ve(n, "(", Ls), ve(n, "}", mo), ve(n, "]", pa), ve(n, ">", ha), ve(n, ")", go), ve(n, "&", fc), ve(n, "*", hc), ve(n, "@", Si), ve(n, "`", gc), ve(n, "^", bc), ve(n, ":", Ai), ve(n, ",", Dh), ve(n, "$", vc), ve(n, ".", Cr), ve(n, "=", yc), ve(n, "!", $h), ve(n, "-", Or), ve(n, "%", wc), ve(n, "|", kc), ve(n, "+", xc), ve(n, "#", Sc), ve(n, "?", Ec), ve(n, '"', Nh), ve(n, "/", Ar), ve(n, ";", Ph), ve(n, "~", Rs), ve(n, "_", _c), ve(n, "\\", mc);
const r = rr(n, Mf, Ah, {
[G0]: !0
});
rr(r, Mf, r);
const i = rr(n, na, ii, {
[J0]: !0
});
rr(i, na, i);
const o = rr(n, Of, Z0, {
[X0]: !0
});
rr(o, na), rr(o, Of, o);
const a = rr(n, vb, n6, {
[gb]: !0
});
ve(n, yb, Mh, {
[gb]: !0
}), ve(a, yb), rr(a, vb, a);
const s = rr(n, Af, r6, {
[t6]: !0
});
rr(s, Af, s), ve(s, $V, s);
const u = ve(s, NV);
rr(u, Af, s);
const l = [[na, i]], c = [[na, null], [Of, o]];
for (let f = 0; f < Ju.length; f++)
yi(n, Ju[f], ep, ii, l);
for (let f = 0; f < Xu.length; f++)
yi(n, Xu[f], tp, Z0, c);
xo(ep, {
tld: !0,
ascii: !0
}, e), xo(tp, {
utld: !0,
alpha: !0
}, e), yi(n, "file", xl, ii, l), yi(n, "mailto", xl, ii, l), yi(n, "http", sa, ii, l), yi(n, "https", sa, ii, l), yi(n, "ftp", sa, ii, l), yi(n, "ftps", sa, ii, l), xo(xl, {
scheme: !0,
ascii: !0
}, e), xo(sa, {
slashscheme: !0,
ascii: !0
}, e), t = t.sort((f, d) => f[0] > d[0] ? 1 : -1);
for (let f = 0; f < t.length; f++) {
const d = t[f][0], h = t[f][1] ? {
[OV]: !0
} : {
[AV]: !0
};
d.indexOf("-") >= 0 ? h[Q0] = !0 : na.test(d) ? Mf.test(d) ? h[kl] = !0 : h[J0] = !0 : h[G0] = !0, bb(n, d, d, h);
}
return bb(n, "localhost", cu, {
ascii: !0
}), n.jd = new $n(Tc), {
start: n,
tokens: Ja({
groups: e
}, i6)
};
}
function IV(t, e) {
const n = LV(e.replace(/[A-Z]/g, (s) => s.toLowerCase())), r = n.length, i = [];
let o = 0, a = 0;
for (; a < r; ) {
let s = t, u = null, l = 0, c = null, f = -1, d = -1;
for (; a < r && (u = s.go(n[a])); )
s = u, s.accepts() ? (f = 0, d = 0, c = s) : f >= 0 && (f += n[a].length, d++), l += n[a].length, o += n[a].length, a++;
o -= f, a -= d, l -= f, i.push({
t: c.t,
// token type/name
v: e.slice(o - l, o),
// string value
s: o - l,
// start index
e: o
// end index (excluding)
});
}
return i;
}
function LV(t) {
const e = [], n = t.length;
let r = 0;
for (; r < n; ) {
let i = t.charCodeAt(r), o, a = i < 55296 || i > 56319 || r + 1 === n || (o = t.charCodeAt(r + 1)) < 56320 || o > 57343 ? t[r] : t.slice(r, r + 2);
e.push(a), r += a.length;
}
return e;
}
function yi(t, e, n, r, i) {
let o;
const a = e.length;
for (let s = 0; s < a - 1; s++) {
const u = e[s];
t.j[u] ? o = t.j[u] : (o = new $n(r), o.jr = i.slice(), t.j[u] = o), t = o;
}
return o = new $n(n), o.jr = i.slice(), t.j[e[a - 1]] = o, o;
}
function wb(t) {
const e = [], n = [];
let r = 0, i = "0123456789";
for (; r < t.length; ) {
let o = 0;
for (; i.indexOf(t[r + o]) >= 0; )
o++;
if (o > 0) {
e.push(n.join(""));
for (let a = parseInt(t.substring(r, r + o), 10); a > 0; a--)
n.pop();
r += o;
} else
n.push(t[r]), r++;
}
return e;
}
const du = {
defaultProtocol: "http",
events: null,
format: kb,
formatHref: kb,
nl2br: !1,
tagName: "a",
target: null,
rel: null,
validate: !0,
truncate: 1 / 0,
className: null,
attributes: null,
ignoreTags: [],
render: null
};
function Ih(t, e) {
e === void 0 && (e = null);
let n = Ja({}, du);
t && (n = Ja(n, t instanceof Ih ? t.o : t));
const r = n.ignoreTags, i = [];
for (let o = 0; o < r.length; o++)
i.push(r[o].toUpperCase());
this.o = n, e && (this.defaultRender = e), this.ignoreTags = i;
}
Ih.prototype = {
o: du,
/**
* @type string[]
*/
ignoreTags: [],
/**
* @param {IntermediateRepresentation} ir
* @returns {any}
*/
defaultRender(t) {
return t;
},
/**
* Returns true or false based on whether a token should be displayed as a
* link based on the user options.
* @param {MultiToken} token
* @returns {boolean}
*/
check(t) {
return this.get("validate", t.toString(), t);
},
// Private methods
/**
* Resolve an option's value based on the value of the option and the given
* params. If operator and token are specified and the target option is
* callable, automatically calls the function with the given argument.
* @template {keyof Opts} K
* @param {K} key Name of option to use
* @param {string} [operator] will be passed to the target option if it's a
* function. If not specified, RAW function value gets returned
* @param {MultiToken} [token] The token from linkify.tokenize
* @returns {Opts[K] | any}
*/
get(t, e, n) {
const r = e != null;
let i = this.o[t];
return i && (typeof i == "object" ? (i = n.t in i ? i[n.t] : du[t], typeof i == "function" && r && (i = i(e, n))) : typeof i == "function" && r && (i = i(e, n.t, n)), i);
},
/**
* @template {keyof Opts} L
* @param {L} key Name of options object to use
* @param {string} [operator]
* @param {MultiToken} [token]
* @returns {Opts[L] | any}
*/
getObj(t, e, n) {
let r = this.o[t];
return typeof r == "function" && e != null && (r = r(e, n.t, n)), r;
},
/**
* Convert the given token to a rendered element that may be added to the
* calling-interface's DOM
* @param {MultiToken} token Token to render to an HTML element
* @returns {any} Render result; e.g., HTML string, DOM element, React
* Component, etc.
*/
render(t) {
const e = t.render(this);
return (this.get("render", null, t) || this.defaultRender)(e, t.t, t);
}
};
function kb(t) {
return t;
}
function o6(t, e) {
this.t = "token", this.v = t, this.tk = e;
}
o6.prototype = {
isLink: !1,
/**
* Return the string this token represents.
* @return {string}
*/
toString() {
return this.v;
},
/**
* What should the value for this token be in the `href` HTML attribute?
* Returns the `.toString` value by default.
* @param {string} [scheme]
* @return {string}
*/
toHref(t) {
return this.toString();
},
/**
* @param {Options} options Formatting options
* @returns {string}
*/
toFormattedString(t) {
const e = this.toString(), n = t.get("truncate", e, this), r = t.get("format", e, this);
return n && r.length > n ? r.substring(0, n) + "…" : r;
},
/**
*
* @param {Options} options
* @returns {string}
*/
toFormattedHref(t) {
return t.get("formatHref", this.toHref(t.get("defaultProtocol")), this);
},
/**
* The start index of this token in the original input string
* @returns {number}
*/
startIndex() {
return this.tk[0].s;
},
/**
* The end index of this token in the original input string (up to this
* index but not including it)
* @returns {number}
*/
endIndex() {
return this.tk[this.tk.length - 1].e;
},
/**
Returns an object of relevant values for this token, which includes keys
* type - Kind of token ('url', 'email', etc.)
* value - Original text
* href - The value that should be added to the anchor tag's href
attribute
@method toObject
@param {string} [protocol] `'http'` by default
*/
toObject(t) {
return t === void 0 && (t = du.defaultProtocol), {
type: this.t,
value: this.toString(),
isLink: this.isLink,
href: this.toHref(t),
start: this.startIndex(),
end: this.endIndex()
};
},
/**
*
* @param {Options} options Formatting option
*/
toFormattedObject(t) {
return {
type: this.t,
value: this.toFormattedString(t),
isLink: this.isLink,
href: this.toFormattedHref(t),
start: this.startIndex(),
end: this.endIndex()
};
},
/**
* Whether this token should be rendered as a link according to the given options
* @param {Options} options
* @returns {boolean}
*/
validate(t) {
return t.get("validate", this.toString(), this);
},
/**
* Return an object that represents how this link should be rendered.
* @param {Options} options Formattinng options
*/
render(t) {
const e = this, n = this.toHref(t.get("defaultProtocol")), r = t.get("formatHref", n, this), i = t.get("tagName", n, e), o = this.toFormattedString(t), a = {}, s = t.get("className", n, e), u = t.get("target", n, e), l = t.get("rel", n, e), c = t.getObj("attributes", n, e), f = t.getObj("events", n, e);
return a.href = r, s && (a.class = s), u && (a.target = u), l && (a.rel = l), c && Ja(a, c), {
tagName: i,
attributes: a,
content: o,
eventListeners: f
};
}
};
function wd(t, e) {
class n extends o6 {
constructor(i, o) {
super(i, o), this.t = t;
}
}
for (const r in e)
n.prototype[r] = e[r];
return n.t = t, n;
}
const xb = wd("email", {
isLink: !0,
toHref() {
return "mailto:" + this.toString();
}
}), Sb = wd("text"), RV = wd("nl"), ro = wd("url", {
isLink: !0,
/**
Lowercases relevant parts of the domain and adds the protocol if
required. Note that this will not escape unsafe HTML characters in the
URL.
@param {string} [scheme] default scheme (e.g., 'https')
@return {string} the full href
*/
toHref(t) {
return t === void 0 && (t = du.defaultProtocol), this.hasProtocol() ? this.v : `${t}://${this.v}`;
},
/**
* Check whether this URL token has a protocol
* @return {boolean}
*/
hasProtocol() {
const t = this.tk;
return t.length >= 2 && t[0].t !== cu && t[1].t === Ai;
}
}), Wt = (t) => new $n(t);
function BV(t) {
let {
groups: e
} = t;
const n = e.domain.concat([fc, hc, Si, mc, gc, bc, vc, yc, Or, Ah, wc, kc, xc, Sc, Ar, Tc, Rs, _c]), r = [pc, ha, mo, pa, go, Ai, Dh, Cr, $h, Is, fa, Ps, Ls, Ec, Nh, Ph], i = [fc, pc, hc, mc, gc, bc, mo, vc, yc, Or, fa, wc, kc, xc, Sc, Ec, Ar, Tc, Rs, _c], o = Wt(), a = ve(o, Rs);
Pe(a, i, a), Pe(a, e.domain, a);
const s = Wt(), u = Wt(), l = Wt();
Pe(o, e.domain, s), Pe(o, e.scheme, u), Pe(o, e.slashscheme, l), Pe(s, i, a), Pe(s, e.domain, s);
const c = ve(s, Si);
ve(a, Si, c), ve(u, Si, c), ve(l, Si, c);
const f = ve(a, Cr);
Pe(f, i, a), Pe(f, e.domain, a);
const d = Wt();
Pe(c, e.domain, d), Pe(d, e.domain, d);
const p = ve(d, Cr);
Pe(p, e.domain, d);
const h = Wt(xb);
Pe(p, e.tld, h), Pe(p, e.utld, h), ve(c, cu, h);
const m = ve(d, Or);
Pe(m, e.domain, d), Pe(h, e.domain, d), ve(h, Cr, p), ve(h, Or, m);
const v = ve(h, Ai);
Pe(v, e.numeric, xb);
const y = ve(s, Or), k = ve(s, Cr);
Pe(y, e.domain, s), Pe(k, i, a), Pe(k, e.domain, s);
const T = Wt(ro);
Pe(k, e.tld, T), Pe(k, e.utld, T), Pe(T, e.domain, s), Pe(T, i, a), ve(T, Cr, k), ve(T, Or, y), ve(T, Si, c);
const b = ve(T, Ai), D = Wt(ro);
Pe(b, e.numeric, D);
const x = Wt(ro), S = Wt();
Pe(x, n, x), Pe(x, r, S), Pe(S, n, x), Pe(S, r, S), ve(T, Ar, x), ve(D, Ar, x);
const _ = ve(u, Ai), N = ve(l, Ai), R = ve(N, Ar), w = ve(R, Ar);
Pe(u, e.domain, s), ve(u, Cr, k), ve(u, Or, y), Pe(l, e.domain, s), ve(l, Cr, k), ve(l, Or, y), Pe(_, e.domain, x), ve(_, Ar, x), Pe(w, e.domain, x), Pe(w, n, x), ve(w, Ar, x);
const A = ve(x, fa), $ = ve(x, Ps), I = ve(x, Is), E = ve(x, Ls);
ve(S, fa, A), ve(S, Ps, $), ve(S, Is, I), ve(S, Ls, E), ve(A, mo, x), ve($, pa, x), ve(I, ha, x), ve(E, go, x), ve(A, mo, x);
const O = Wt(ro), g = Wt(ro), M = Wt(ro), H = Wt(ro);
Pe(A, n, O), Pe($, n, g), Pe(I, n, M), Pe(E, n, H);
const z = Wt(), Y = Wt(), ee = Wt(), ce = Wt();
return Pe(A, r), Pe($, r), Pe(I, r), Pe(E, r), Pe(O, n, O), Pe(g, n, g), Pe(M, n, M), Pe(H, n, H), Pe(O, r, O), Pe(g, r, g), Pe(M, r, M), Pe(H, r, H), Pe(z, n, z), Pe(Y, n, g), Pe(ee, n, M), Pe(ce, n, H), Pe(z, r, z), Pe(Y, r, Y), Pe(ee, r, ee), Pe(ce, r, ce), ve(g, pa, x), ve(M, ha, x), ve(H, go, x), ve(O, mo, x), ve(Y, pa, x), ve(ee, ha, x), ve(ce, go, x), ve(z, go, x), ve(o, cu, T), ve(o, Mh, RV), {
start: o,
tokens: i6
};
}
function VV(t, e, n) {
let r = n.length, i = 0, o = [], a = [];
for (; i < r; ) {
let s = t, u = null, l = null, c = 0, f = null, d = -1;
for (; i < r && !(u = s.go(n[i].t)); )
a.push(n[i++]);
for (; i < r && (l = u || s.go(n[i].t)); )
u = null, s = l, s.accepts() ? (d = 0, f = s) : d >= 0 && d++, i++, c++;
if (d < 0)
i -= c, i < r && (a.push(n[i]), i++);
else {
a.length > 0 && (o.push(Df(Sb, e, a)), a = []), i -= d, c -= d;
const p = f.t, h = n.slice(i - c, i);
o.push(Df(p, e, h));
}
}
return a.length > 0 && o.push(Df(Sb, e, a)), o;
}
function Df(t, e, n) {
const r = n[0].s, i = n[n.length - 1].e, o = e.slice(r, i);
return new t(o, n);
}
const zV = typeof console < "u" && console && console.warn || (() => {
}), HV = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.", Mt = {
scanner: null,
parser: null,
tokenQueue: [],
pluginQueue: [],
customSchemes: [],
initialized: !1
};
function qV() {
$n.groups = {}, Mt.scanner = null, Mt.parser = null, Mt.tokenQueue = [], Mt.pluginQueue = [], Mt.customSchemes = [], Mt.initialized = !1;
}
function Eb(t, e) {
if (e === void 0 && (e = !1), Mt.initialized && zV(`linkifyjs: already initialized - will not register custom scheme "${t}" ${HV}`), !/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))
throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);
Mt.customSchemes.push([t, e]);
}
function FV() {
Mt.scanner = PV(Mt.customSchemes);
for (let t = 0; t < Mt.tokenQueue.length; t++)
Mt.tokenQueue[t][1]({
scanner: Mt.scanner
});
Mt.parser = BV(Mt.scanner.tokens);
for (let t = 0; t < Mt.pluginQueue.length; t++)
Mt.pluginQueue[t][1]({
scanner: Mt.scanner,
parser: Mt.parser
});
Mt.initialized = !0;
}
function jV(t) {
return Mt.initialized || FV(), VV(Mt.parser.start, t, IV(Mt.scanner.start, t));
}
function a6(t, e, n) {
if (e === void 0 && (e = null), n === void 0 && (n = null), e && typeof e == "object") {
if (n)
throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);
n = e, e = null;
}
const r = new Ih(n), i = jV(t), o = [];
for (let a = 0; a < i.length; a++) {
const s = i[a];
s.isLink && (!e || s.t === e) && o.push(s.toFormattedObject(r));
}
return o;
}
function UV(t) {
return new un({
key: new er("autolink"),
appendTransaction: (e, n, r) => {
const i = e.some((l) => l.docChanged) && !n.doc.eq(r.doc), o = e.some((l) => l.getMeta("preventAutolink"));
if (!i || o)
return;
const { tr: a } = r, s = OR(n.doc, [...e]);
if (RR(s).forEach(({ newRange: l }) => {
const c = MR(r.doc, l, (p) => p.isTextblock);
let f, d;
if (c.length > 1 ? (f = c[0], d = r.doc.textBetween(f.pos, f.pos + f.node.nodeSize, void 0, " ")) : c.length && r.doc.textBetween(l.from, l.to, " ", " ").endsWith(" ") && (f = c[0], d = r.doc.textBetween(f.pos, l.to, void 0, " ")), f && d) {
const p = d.split(" ").filter((v) => v !== "");
if (p.length <= 0)
return !1;
const h = p[p.length - 1], m = f.pos + d.lastIndexOf(h);
if (!h)
return !1;
a6(h).filter((v) => v.isLink).map((v) => ({
...v,
from: m + v.start + 1,
to: m + v.end + 1
})).filter((v) => r.schema.marks.code ? !r.doc.rangeHasMark(v.from, v.to, r.schema.marks.code) : !0).filter((v) => t.validate ? t.validate(v.value) : !0).forEach((v) => {
Ch(v.from, v.to, r.doc).some((y) => y.mark.type === t.type) || a.addMark(v.from, v.to, t.type.create({
href: v.href
}));
});
}
}), !!a.steps.length)
return a;
}
});
}
function WV(t) {
return new un({
key: new er("handleClickLink"),
props: {
handleClick: (e, n, r) => {
var i, o;
if (r.button !== 0 || r.target.nodeName !== "A")
return !1;
const s = Yw(e.state, t.type.name), u = r.target, l = (i = u == null ? void 0 : u.href) !== null && i !== void 0 ? i : s.href, c = (o = u == null ? void 0 : u.target) !== null && o !== void 0 ? o : s.target;
return u && l ? (e.editable && window.open(l, c), !0) : !1;
}
}
});
}
const YV = xr.create({
name: "link",
priority: 1e3,
keepOnSplit: !1,
onCreate() {
this.options.protocols.forEach((t) => {
if (typeof t == "string") {
Eb(t);
return;
}
Eb(t.scheme, t.optionalSlashes);
});
},
onDestroy() {
qV();
},
inclusive() {
return this.options.autolink;
},
addOptions() {
return {
openOnClick: !0,
linkOnPaste: !0,
autolink: !0,
protocols: [],
HTMLAttributes: {
target: "_blank",
rel: "noopener noreferrer nofollow",
class: null
},
validate: void 0
};
},
addAttributes() {
return {
href: {
default: null
},
target: {
default: this.options.HTMLAttributes.target
},
rel: {
default: this.options.HTMLAttributes.rel
},
class: {
default: this.options.HTMLAttributes.class
}
};
},
parseHTML() {
return [{ tag: 'a[href]:not([href *= "javascript:" i])' }];
},
renderHTML({ HTMLAttributes: t }) {
return ["a", Pt(this.options.HTMLAttributes, t), 0];
},
addCommands() {
return {
setLink: (t) => ({ chain: e }) => e().setMark(this.name, t).setMeta("preventAutolink", !0).run(),
toggleLink: (t) => ({ chain: e }) => e().toggleMark(this.name, t, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run(),
unsetLink: () => ({ chain: t }) => t().unsetMark(this.name, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run()
};
},
addPasteRules() {
return [
qo({
find: (t) => a6(t).filter((e) => this.options.validate ? this.options.validate(e.value) : !0).filter((e) => e.isLink).map((e) => ({
text: e.value,
index: e.start,
data: e
})),
type: this.type,
getAttributes: (t, e) => {
var n, r;
const i = (n = e.clipboardData) === null || n === void 0 ? void 0 : n.getData("text/html"), o = /href="([^"]*)"/, a = i == null ? void 0 : i.match(o);
return a ? {
href: a[1]
} : {
href: (r = t.data) === null || r === void 0 ? void 0 : r.href
};
}
})
];
},
addProseMirrorPlugins() {
const t = [];
return this.options.autolink && t.push(UV({
type: this.type,
validate: this.options.validate
})), this.options.openOnClick && t.push(WV({
type: this.type
})), t;
}
}), KV = an.create({
name: "textAlign",
addOptions() {
return {
types: [],
alignments: ["left", "center", "right", "justify"],
defaultAlignment: "left"
};
},
addGlobalAttributes() {
return [
{
types: this.options.types,
attributes: {
textAlign: {
default: this.options.defaultAlignment,
parseHTML: (t) => t.style.textAlign || this.options.defaultAlignment,
renderHTML: (t) => t.textAlign === this.options.defaultAlignment ? {} : { style: `text-align: ${t.textAlign}` }
}
}
}
];
},
addCommands() {
return {
setTextAlign: (t) => ({ commands: e }) => this.options.alignments.includes(t) ? this.options.types.every((n) => e.updateAttributes(n, { textAlign: t })) : !1,
unsetTextAlign: () => ({ commands: t }) => this.options.types.every((e) => t.resetAttributes(e, "textAlign"))
};
},
addKeyboardShortcuts() {
return {
"Mod-Shift-l": () => this.editor.commands.setTextAlign("left"),
"Mod-Shift-e": () => this.editor.commands.setTextAlign("center"),
"Mod-Shift-r": () => this.editor.commands.setTextAlign("right"),
"Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
};
}
}), GV = an.create({
name: "placeholder",
addOptions() {
return {
emptyEditorClass: "is-editor-empty",
emptyNodeClass: "is-empty",
placeholder: "Write something …",
showOnlyWhenEditable: !0,
showOnlyCurrent: !0,
includeChildren: !1
};
},
addProseMirrorPlugins() {
return [
new un({
key: new er("placeholder"),
props: {
decorations: ({ doc: t, selection: e }) => {
const n = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: r } = e, i = [];
if (!n)
return null;
const o = t.type.createAndFill(), a = (o == null ? void 0 : o.sameMarkup(t)) && o.content.findDiffStart(t.content) === null;
return t.descendants((s, u) => {
const l = r >= u && r <= u + s.nodeSize, c = !s.isLeaf && !s.childCount;
if ((l || !this.options.showOnlyCurrent) && c) {
const f = [this.options.emptyNodeClass];
a && f.push(this.options.emptyEditorClass);
const d = Jn.node(u, u + s.nodeSize, {
class: f.join(" "),
"data-placeholder": typeof this.options.placeholder == "function" ? this.options.placeholder({
editor: this.editor,
node: s,
pos: u,
hasAnchor: l
}) : this.options.placeholder
});
i.push(d);
}
return this.options.includeChildren;
}), Vt.create(t, i);
}
}
})
];
}
}), JV = {
modelValue: {
type: String,
default: "",
description: "Valor del componente"
},
mandatory: {
type: String,
default: "",
description: "Contenido html obligatorio"
},
placeholder: {
type: String,
default: "Escribe algo...",
description: "Texto de ayuda"
},
maxHeight: {
type: Number,
default: 600,
description: "Altura máxima"
},
minHeight: {
type: Number,
default: 200,
description: "Altura mínima"
},
label: {
type: String,
default: "",
description: "Etiqueta"
},
required: {
type: Boolean,
default: !1,
description: "Indica si es obligatorio"
},
errors: {
type: Array,
required: !1,
default: () => [],
description: "Errores de validación"
},
status: {
type: String,
default: "",
control: { type: "inline-radio" },
options: ["warning", "success", "danger"],
description: "Color de estado del input"
},
//////////////////////////
// Control Options
//////////////////////////
title: {
type: Boolean,
default: !0,
description: "Indica si se debe mostrar los controles de título"
},
list: {
type: Boolean,
default: !0,
description: "Indica si se debe mostrar los controles de lista"
},
quote: {
type: Boolean,
default: !1,
description: "Indica si se debe mostrar el control de cita"
},
code: {
type: Boolean,
default: !1,
description: "Indica si se debe mostrar el control de código"
},
history: {
type: Boolean,
default: !1,
description: "Indica si se debe mostrar los botones `deshacer` y `rehacer`"
},
zenmode: {
type: Boolean,
default: !0,
description: "Opción para maximizar a pantalla completa"
}
}, XV = { class: "media-node-view inline-block" }, QV = ["src"], ZV = /* @__PURE__ */ be({
__name: "ResizableMediaNodeView",
props: {
editor: {},
node: {},
decorations: {},
selected: { type: Boolean },
extension: {},
getPos: { type: Function },
updateAttributes: { type: Function },
deleteNode: { type: Function }
},
setup(t) {
const e = t, n = L(
() => e.node.attrs["media-type"]
), r = re(null), i = re(0), o = re(0), a = () => {
const b = document.querySelector(".ProseMirror");
b && (o.value = b == null ? void 0 : b.clientWidth), r.value && (n.value === "video" ? setTimeout(() => {
i.value = r.value.videoWidth / r.value.videoHeight, d("left", 0);
}, 200) : (i.value = r.value.naturalWidth / r.value.naturalHeight, d("left", 0), r.value.onload = () => {
i.value = r.value.naturalWidth / r.value.naturalHeight, d("left", 0);
}));
};
st(() => setTimeout(() => a(), 1e3));
const s = re(!1), u = re(-1), l = ({
width: b,
height: D
}) => b < 100 || D < 100, c = (b) => {
s.value = !0, u.value = b.clientX, document.addEventListener("mousemove", p), document.addEventListener("mouseup", f);
}, f = () => {
s.value = !1, u.value = -1, document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", f);
}, d = (b, D) => {
var _, N;
if (!r.value) {
console.error("Media ref is undefined|null", {
resizableImg: r.value
});
return;
}
const x = {
width: (_ = r.value) == null ? void 0 : _.width,
height: (N = r.value) == null ? void 0 : N.height
}, S = {
width: -1,
height: -1
};
b === "left" ? S.width = x.width - Math.abs(D) : S.width = x.width + Math.abs(D), S.width > o.value && (S.width = o.value), S.height = S.width / i.value, !l(S) && e.updateAttributes(S);
}, p = (b) => {
if (!s.value)
return;
const { clientX: D } = b, x = u.value - D;
if (u.value = D, x === 0)
return;
const S = x > 0 ? "left" : "right";
d(S, Math.abs(x));
}, h = re(!1), m = re(-1), v = (b) => {
h.value = !0, m.value = b.clientY, document.addEventListener("mousemove", k), document.addEventListener("mouseup", y);
}, y = () => {
h.value = !1, m.value = -1, document.removeEventListener("mousemove", k), document.removeEventListener("mouseup", y);
}, k = (b) => {
var R, w;
if (!h.value)
return;
const { clientY: D } = b, x = m.value - D;
if (m.value = D, x === 0)
return;
const S = x > 0 ? "up" : "down";
if (!r.value) {
console.error("Media ref is undefined|null", {
resizableImg: r.value
});
return;
}
const _ = {
width: (R = r.value) == null ? void 0 : R.width,
height: (w = r.value) == null ? void 0 : w.height
}, N = {
width: -1,
height: -1
};
S === "up" ? N.height = _.height - Math.abs(x) : N.height = _.height + Math.abs(x), N.width = N.height * i.value, N.width > o.value && (N.width = o.value, N.height = N.width / i.value), !l(N) && e.updateAttributes(N);
}, T = L(() => !!e.node.attrs.dataAlign);
return (b, D) => (C(), oe(W(SB), {
as: "div",
class: ""
}, {
default: ne(() => [
U("div", XV, [
n.value === "img" ? (C(), P("img", dt({ key: 0 }, b.node.attrs, {
ref_key: "resizableImg",
ref: r,
class: [
`${T.value && `align-${e.node.attrs.dataAlign}` || ""}`
],
draggable: "true"
}), null, 16)) : n.value === "video" ? (C(), P("video", dt({ key: 1 }, b.node.attrs, {
ref_key: "resizableImg",
ref: r,
class: [
`${T.value && `align-${e.node.attrs.dataAlign}` || ""}`
],
draggable: "true",
controls: "true"
}), [
U("source", {
src: b.node.attrs.src
}, null, 8, QV)
], 16)) : F("", !0),
U("div", {
class: se(["horizontal-resize-handle", {
"horizontal-resize-active": s.value
}]),
title: "Resize",
onMousedown: c,
onMouseup: f
}, null, 34),
U("div", {
class: se(["vertical-resize-handle", {
"vertical-resize-active": h.value
}]),
title: "Resize",
onMousedown: v,
onMouseup: y
}, null, 34)
])
]),
_: 1
}));
}
});
const ez = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, tz = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/, nz = sn.create({
name: "resizableMedia",
addOptions() {
return {
inline: !0,
allowBase64: !1,
HTMLAttributes: {}
};
},
inline: !0,
group: "inline",
draggable: !0,
addAttributes() {
return {
src: {
default: null
},
"media-type": {
default: null
},
alt: {
default: null
},
title: {
default: null
},
width: {
default: "100%"
},
height: {
default: "auto"
},
dataAlign: {
default: "left"
// 'left' | 'center' | 'right'
},
style: {
default: null
// 'left' | 'right'
}
};
},
selectable: !0,
parseHTML() {
return [
{
tag: 'img[src]:not([src^="data:"])',
getAttrs: (t) => ({
src: t.getAttribute("src"),
"media-type": "img"
})
},
{
tag: "video",
getAttrs: (t) => ({
src: t.getAttribute("src"),
"media-type": "video"
})
}
];
},
renderHTML({ HTMLAttributes: t }) {
const { "media-type": e } = t;
return e === "img" ? [
"img",
Pt(this.options.HTMLAttributes, t)
] : e === "video" ? [
"video",
{ controls: "true", style: "width: 100%", ...t },
["source", t]
] : (e || console.error(
"TiptapMediaExtension-renderHTML method: Media Type not set, going default with image"
), [
"img",
Pt(this.options.HTMLAttributes, t)
]);
},
addCommands() {
return {
setMedia: (t) => ({ commands: e }) => {
const { "media-type": n } = t;
return n === "img" ? e.insertContent({
type: this.name,
attrs: t
}) : n === "video" ? e.insertContent({
type: this.name,
attrs: {
...t,
controls: "true"
}
}) : (n || console.error(
"TiptapMediaExtension-setMedia: Media Type not set, going default with image"
), e.insertContent({
type: this.name,
attrs: t
}));
}
};
},
addNodeView() {
return TB(ZV);
},
addInputRules() {
return [
Y0({
find: ez,
type: this.type,
getAttributes: (t) => {
const [, , e, n, r] = t;
return {
src: n,
alt: e,
title: r,
"media-type": "img"
};
}
}),
Y0({
find: tz,
type: this.type,
getAttributes: (t) => {
const [, , e] = t;
return {
src: e,
"media-type": "video"
};
}
})
];
}
}), rz = be({
name: "AEditor",
components: {
EditorContent: xB,
BubbleMenu: wB
},
props: JV,
emits: ["update:modelValue"],
setup(t, e) {
const n = re(), r = re(t.modelValue), i = (p) => !!e.slots[p], o = re(!1), a = re(!1), s = L(() => t.mandatory ? xN(t.mandatory, {
allowedTags: [
"a",
"b",
"i",
"em",
"pre",
"code",
"strong",
"br",
"div",
"center"
],
allowedAttributes: {
a: ["href", "title", "style"]
}
}) : ""), u = () => {
var h;
const p = window.prompt("URL");
p && ((h = n.value) == null || h.commands.setMedia({
src: p,
"media-type": "img",
width: "200",
height: "200"
}));
}, l = L(() => (t.errors.length > 0 ? t.errors[0].$message : "").toString()), c = L(() => {
const p = ["k-editor"];
return t.errors.length > 0 ? p.push("k-editor-danger") : t.status && p.push(`k-editor-${t.status}`), a.value && p.push("k-editor-fullpage"), p;
}), f = L(() => t.label || i("default")), d = () => {
o.value = !o.value;
};
return st(() => {
var p;
n.value = new kB({
content: r.value,
extensions: [
_V.configure({
heading: {
levels: [1, 2, 3, 4, 5, 6]
}
}),
YV.configure({
protocols: ["tel", "mailto"]
}),
KV.configure({
types: ["heading", "paragraph", "image"]
}),
GV.configure({
placeholder: t.placeholder
}),
nz
],
editorProps: {
attributes: {
style: `min-height: calc(${t.minHeight}px - 40px - 52px);`
}
},
onUpdate: () => {
var h;
r.value = ((h = n.value) == null ? void 0 : h.getHTML()) || "", e.emit(
"update:modelValue",
r.value + t.mandatory
);
}
}), r.value = ((p = n.value) == null ? void 0 : p.getHTML()) || "", e.emit("update:modelValue", r.value + t.mandatory);
}), qi(() => {
var p;
(p = n.value) == null || p.destroy();
}), Ct(
() => t.modelValue,
(p) => {
var h;
p !== r.value && (r.value = p, (h = n.value) == null || h.commands.setContent(p));
}
), {
//Variables
editor: n,
mandatoryHtml: s,
firstError: l,
classes: c,
hasLabel: f,
fullpage: a,
showCode: o,
html: r,
// Methods
addImage: u,
hasSlot: i,
toggleCode: d
};
}
});
const iz = {
key: 0,
class: "font-semibold text-gray-500 dark:text-white select-none mb-2 flex flex-row"
}, oz = {
key: 2,
class: "font-bold text-danger ml-1"
}, az = { class: "k-editor-content" }, sz = { key: 1 }, uz = ["innerHTML"], lz = { class: "k-editor-bubble" }, cz = { class: "k-editor-menu" }, dz = /* @__PURE__ */ U("div", { class: "ml-auto" }, null, -1), fz = /* @__PURE__ */ U("div", { class: "ml-auto" }, null, -1);
function pz(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip"), u = he("editor-content"), l = he("k-button"), c = he("BubbleMenu"), f = Xb("tooltip");
return C(), P("div", {
class: se([t.classes])
}, [
t.hasLabel ? (C(), P("label", iz, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label), 1)
], 64)),
t.required ? (C(), P("span", oz, "*")) : F("", !0),
t.firstError ? (C(), oe(s, {
key: 3,
content: t.firstError
}, {
default: ne(() => [
J(a, {
icon: "triangle-exclamation",
class: "ml-2"
})
]),
_: 1
}, 8, ["content"])) : F("", !0)
])) : F("", !0),
t.editor ? (C(), P("div", {
key: 1,
class: "k-editor-wrapper",
style: Xe({
maxHeight: t.fullpage ? void 0 : `${t.maxHeight}px`
})
}, [
U("div", az, [
t.showCode ? (C(), P("div", sz, [
U("div", {
class: "tiptap ProseMirror",
contenteditable: "true",
tabindex: "0",
translate: "no",
style: Xe({
minHeight: `calc(${t.minHeight}px - 40px - 52px)`
})
}, Se(t.html), 5)
])) : (C(), oe(u, {
key: 0,
editor: t.editor
}, null, 8, ["editor"])),
t.mandatory ? (C(), P("div", {
key: 2,
class: "k-editor-mandatory",
innerHTML: t.mandatoryHtml
}, null, 8, uz)) : F("", !0)
]),
J(c, {
editor: t.editor,
"keep-in-bounds": !0
}, {
default: ne(() => [
U("div", lz, [
J(l, {
link: "",
size: "sm",
icon: "user",
class: se({ active: t.editor.isActive("bold") }),
onClick: e[0] || (e[0] = (d) => t.editor.chain().focus().toggleBold().run())
}, null, 8, ["class"]),
J(l, {
link: "",
size: "sm",
icon: "italic",
class: se({ active: t.editor.isActive("italic") }),
onClick: e[1] || (e[1] = (d) => t.editor.chain().focus().toggleItalic().run())
}, null, 8, ["class"]),
J(l, {
link: "",
size: "sm",
icon: "highlighter",
class: se({ active: t.editor.isActive("code") }),
onClick: e[2] || (e[2] = (d) => t.editor.chain().focus().toggleCode().run())
}, null, 8, ["class"])
])
]),
_: 1
}, 8, ["editor"]),
U("div", cz, [
Qe(J(l, {
color: "primary",
size: "sm",
icon: "bold",
class: se({ active: t.editor.isActive("bold") }),
onClick: e[3] || (e[3] = (d) => t.editor.chain().focus().toggleBold().run())
}, null, 8, ["class"]), [
[f, { content: "Negrita", placement: "bottom" }]
]),
Qe(J(l, {
color: "primary",
size: "sm",
icon: "italic",
class: se({ active: t.editor.isActive("italic") }),
onClick: e[4] || (e[4] = (d) => t.editor.chain().focus().toggleItalic().run())
}, null, 8, ["class"]), [
[f, { content: "Cursiva", placement: "bottom" }]
]),
Qe(J(l, {
color: "primary",
size: "sm",
icon: "highlighter",
class: se({ active: t.editor.isActive("code") }),
onClick: e[5] || (e[5] = (d) => t.editor.chain().focus().toggleCode().run())
}, null, 8, ["class"]), [
[f, { content: "Destacado", placement: "bottom" }]
]),
t.title ? Qe((C(), oe(l, {
key: 0,
color: "primary",
size: "sm",
class: se({
active: t.editor.isActive("heading", { level: 1 })
}),
onClick: e[6] || (e[6] = (d) => t.editor.chain().focus().setHeading({ level: 1 }).run())
}, {
default: ne(() => [
Oe(" H1 ")
]),
_: 1
}, 8, ["class"])), [
[f, { content: "Título 1", placement: "bottom" }]
]) : F("", !0),
t.title ? Qe((C(), oe(l, {
key: 1,
color: "primary",
size: "sm",
class: se({
active: t.editor.isActive("heading", { level: 2 })
}),
onClick: e[7] || (e[7] = (d) => t.editor.chain().focus().setHeading({ level: 2 }).run())
}, {
default: ne(() => [
Oe(" H2 ")
]),
_: 1
}, 8, ["class"])), [
[f, { content: "Título 2", placement: "bottom" }]
]) : F("", !0),
t.title ? Qe((C(), oe(l, {
key: 2,
color: "primary",
size: "sm",
class: se({
active: t.editor.isActive("heading", { level: 3 })
}),
onClick: e[8] || (e[8] = (d) => t.editor.chain().focus().setHeading({ level: 3 }).run())
}, {
default: ne(() => [
Oe(" H3 ")
]),
_: 1
}, 8, ["class"])), [
[f, { content: "Título 3", placement: "bottom" }]
]) : F("", !0),
t.list ? Qe((C(), oe(l, {
key: 3,
color: "primary",
size: "sm",
icon: "list-ul",
class: se({ active: t.editor.isActive("bulletList") }),
onClick: e[9] || (e[9] = (d) => t.editor.chain().focus().toggleBulletList().run())
}, null, 8, ["class"])), [
[f, { content: "Lista (ord)", placement: "bottom" }]
]) : F("", !0),
t.list ? Qe((C(), oe(l, {
key: 4,
color: "primary",
size: "sm",
icon: "list-ol",
class: se({ active: t.editor.isActive("orderedList") }),
onClick: e[10] || (e[10] = (d) => t.editor.chain().focus().toggleOrderedList().run())
}, null, 8, ["class"])), [
[f, { content: "Lista (num)", placement: "bottom" }]
]) : F("", !0),
t.quote ? Qe((C(), oe(l, {
key: 5,
color: "primary",
size: "sm",
icon: "quote-right",
class: se({ active: t.editor.isActive("blockquote") }),
onClick: e[11] || (e[11] = (d) => t.editor.chain().focus().toggleBlockquote().run())
}, null, 8, ["class"])), [
[f, { content: "Cita", placement: "bottom" }]
]) : F("", !0),
t.code ? Qe((C(), oe(l, {
key: 6,
color: "primary",
size: "sm",
icon: "code",
class: se({ active: t.editor.isActive("codeBlock") }),
onClick: e[12] || (e[12] = (d) => t.editor.chain().focus().toggleCodeBlock().run())
}, null, 8, ["class"])), [
[f, { content: "Código", placement: "bottom" }]
]) : F("", !0),
Qe(J(l, {
color: "primary",
size: "sm",
icon: "arrows-alt-h",
onClick: e[13] || (e[13] = (d) => t.editor.chain().focus().setHorizontalRule().run())
}, null, 512), [
[f, { content: "Divisor", placement: "bottom" }]
]),
Qe(J(l, {
color: "primary",
size: "sm",
icon: "images",
onClick: t.addImage
}, null, 8, ["onClick"]), [
[f, {
content: "Imagen externa",
placement: "bottom"
}]
]),
dz,
Qe(J(l, {
color: "primary",
size: "sm",
icon: "align-left",
class: se({ active: t.editor.isActive({ textAlign: "left" }) }),
onClick: e[14] || (e[14] = (d) => t.editor.chain().focus().setTextAlign("left").run())
}, null, 8, ["class"]), [
[f, {
content: "Alinear a la izquierda",
placement: "bottom"
}]
]),
Qe(J(l, {
color: "primary",
size: "sm",
icon: "align-center",
class: se({
active: t.editor.isActive({ textAlign: "center" })
}),
onClick: e[15] || (e[15] = (d) => t.editor.chain().focus().setTextAlign("center").run())
}, null, 8, ["class"]), [
[f, {
content: "Alinear al centro",
placement: "bottom"
}]
]),
Qe(J(l, {
color: "primary",
size: "sm",
icon: "align-right",
class: se({ active: t.editor.isActive({ textAlign: "right" }) }),
onClick: e[16] || (e[16] = (d) => t.editor.chain().focus().setTextAlign("right").run())
}, null, 8, ["class"]), [
[f, {
content: "Alinear a la derecha",
placement: "bottom"
}]
]),
Qe(J(l, {
color: "primary",
size: "sm",
icon: "align-justify",
class: se({
active: t.editor.isActive({ textAlign: "justify" })
}),
onClick: e[17] || (e[17] = (d) => t.editor.chain().focus().setTextAlign("justify").run())
}, null, 8, ["class"]), [
[f, { content: "Justificar", placement: "bottom" }]
]),
fz,
t.history ? Qe((C(), oe(l, {
key: 7,
color: "primary",
size: "sm",
icon: "undo",
onClick: t.editor.commands.undo
}, null, 8, ["onClick"])), [
[f, { content: "Deshacer", placement: "bottom" }]
]) : F("", !0),
t.history ? Qe((C(), oe(l, {
key: 8,
color: "primary",
size: "sm",
icon: "redo",
onClick: t.editor.commands.redo
}, null, 8, ["onClick"])), [
[f, { content: "Rehacer", placement: "bottom" }]
]) : F("", !0),
Qe(J(l, {
color: "primary",
size: "sm",
icon: "code",
onClick: t.toggleCode
}, null, 8, ["onClick"]), [
[f, {
content: "Mostrar código",
placement: "bottom"
}]
]),
t.zenmode ? Qe((C(), oe(l, {
key: 9,
color: "primary",
size: "sm",
icon: "maximize",
class: se({
active: t.fullpage
}),
onClick: e[18] || (e[18] = (d) => t.fullpage = !t.fullpage)
}, null, 8, ["class"])), [
[f, { content: "Modo zen", placement: "bottom" }]
]) : F("", !0)
])
], 4)) : F("", !0)
], 2);
}
const hz = /* @__PURE__ */ $e(rz, [["render", pz]]), mz = be({
name: "KRadio",
props: {
modelValue: {
type: [String, Number, Boolean, Object, Array, Symbol],
default: !1
},
name: {
type: String,
required: !0
},
value: {
type: [String, Number, Boolean, Object, Array, Symbol],
default: ""
},
label: {
type: String,
default: ""
},
color: {
type: String,
control: { type: "inline-radio" },
options: Wr,
validator: (t) => Wr.includes(t),
default: "primary",
description: "Color del botón"
}
},
emits: ["update:modelValue"],
setup(t, e) {
const n = on(), r = (s) => !!e.slots[s], i = L(() => {
let s = [];
return t.color === "white" || t.color === "black" ? s.push(
"text-black focus:ring-black dark:focus:ring-white dark:text-black k-checkbox-inverse"
) : t.color === "gray" ? s.push(
"text-gray-300 focus:ring-gray-300 dark:focus:ring-gray-300"
) : t.color === "primary" ? s.push(
"text-primary focus:ring-primary dark:focus:ring-primary"
) : t.color === "secondary" ? s.push(
"text-secondary focus:ring-secondary dark:focus:ring-secondary"
) : t.color === "success" ? s.push(
"text-success focus:ring-success dark:focus:ring-success"
) : t.color === "warning" ? s.push(
"text-warning focus:ring-warning dark:focus:ring-warning"
) : t.color === "danger" ? s.push(
"text-danger focus:ring-danger dark:focus:ring-danger"
) : t.color === "info" && s.push(
"text-info focus:ring-info dark:focus:ring-info"
), s;
}), o = (s) => {
a.value = s.target.value;
}, a = L({
get() {
return t.modelValue;
},
set(s) {
e.emit("update:modelValue", s);
}
});
return { model: a, hasSlot: r, inputId: n, classes: i, change: o };
}
});
const gz = { class: "flex items-center" }, bz = ["id", "value", "name", "checked"], vz = ["for"];
function yz(t, e, n, r, i, o) {
return C(), P("div", gz, [
U("input", {
id: t.inputId,
type: "radio",
value: t.value,
name: t.name,
class: se(["w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600", t.classes]),
checked: t.model === t.value,
onChange: e[0] || (e[0] = (...a) => t.change && t.change(...a))
}, null, 42, bz),
t.label || t.hasSlot("default") ? (C(), P("label", {
key: 0,
for: t.inputId,
class: "ml-2 text-sm font-medium text-gray-900 dark:text-gray-300 select-none"
}, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }, void 0, !0) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label), 1)
], 64))
], 8, vz)) : F("", !0)
]);
}
const wz = /* @__PURE__ */ $e(mz, [["render", yz], ["__scopeId", "data-v-5c7a3fb7"]]), _b = {
colors: [
"#1FBC9C",
"#1CA085",
"#2ECC70",
"#27AF60",
"#3398DB",
"#2980B9",
"#A463BF",
"#8E43AD",
"#3D556E",
"#222F3D",
"#F2C511",
"#F39C19",
"#E84B3C",
"#C0382B",
"#DDE6E8",
"#BDC3C8"
],
rowLength: 4
}, Tb = {
colors: [
"#CC0001",
"#E36101",
"#FFCC00",
"#009900",
"#0066CB",
"#000000",
"#FFFFFF"
],
showBorder: !0
}, Cb = {
colors: [
[
"#000000",
"#434343",
"#666666",
"#999999",
"#b7b7b7",
"#cccccc",
"#d9d9d9",
"#efefef",
"#f3f3f3",
"#ffffff"
],
[
"#980000",
"#ff0000",
"#ff9900",
"#ffff00",
"#00ff00",
"#00ffff",
"#4a86e8",
"#0000ff",
"#9900ff",
"#ff00ff"
],
[
"#e6b8af",
"#f4cccc",
"#fce5cd",
"#fff2cc",
"#d9ead3",
"#d0e0e3",
"#c9daf8",
"#cfe2f3",
"#d9d2e9",
"#ead1dc"
],
[
"#dd7e6b",
"#ea9999",
"#f9cb9c",
"#ffe599",
"#b6d7a8",
"#a2c4c9",
"#a4c2f4",
"#9fc5e8",
"#b4a7d6",
"#d5a6bd"
],
[
"#cc4125",
"#e06666",
"#f6b26b",
"#ffd966",
"#93c47d",
"#76a5af",
"#6d9eeb",
"#6fa8dc",
"#8e7cc3",
"#c27ba0"
],
[
"#a61c00",
"#cc0000",
"#e69138",
"#f1c232",
"#6aa84f",
"#45818e",
"#3c78d8",
"#3d85c6",
"#674ea7",
"#a64d79"
],
[
"#85200c",
"#990000",
"#b45f06",
"#bf9000",
"#38761d",
"#134f5c",
"#1155cc",
"#0b5394",
"#351c75",
"#741b47"
],
[
"#5b0f00",
"#660000",
"#783f04",
"#7f6000",
"#274e13",
"#0c343d",
"#1c4587",
"#073763",
"#20124d",
"#4c1130"
]
],
borderRadius: "0",
rowLength: 10,
swatchSize: 24,
spacingSize: 0
}, kz = (t, e) => {
const n = t.__vccOpts || t;
for (const [r, i] of e)
n[r] = i;
return n;
}, xz = {}, Sz = { class: "vue-swatches__check__wrapper vue-swatches--has-children-centered" }, Ez = /* @__PURE__ */ U("div", { class: "vue-swatches__check__circle vue-swatches--has-children-centered" }, [
/* @__PURE__ */ U("svg", {
version: "1.1",
role: "presentation",
width: "12",
height: "12",
viewBox: "0 0 1792 1792",
class: "check"
}, [
/* @__PURE__ */ U("path", {
class: "vue-swatches__check__path",
d: "M1671 566q0 40-28 68l-724 724-136 136q-28 28-68 28t-68-28l-136-136-362-362q-28-28-28-68t28-68l136-136q28-28 68-28t68 28l294 295 656-657q28-28 68-28t68 28l136 136q28 28 28 68z"
})
])
], -1), _z = [
Ez
];
function Tz(t, e) {
return C(), P("div", Sz, _z);
}
const Cz = /* @__PURE__ */ kz(xz, [["render", Tz]]), Oz = ["aria-label"], Az = {
key: 0,
class: "vue-swatches__diagonal__wrapper vue-swatches--has-children-centered"
}, Mz = /* @__PURE__ */ U("div", { class: "vue-swatches__diagonal" }, null, -1), Dz = [
Mz
], Ob = /* @__PURE__ */ be({
__name: "VSwatch",
props: {
borderRadius: null,
isLast: { type: Boolean, default: !1 },
rowLengthSetted: { type: Boolean, default: !1 },
disabled: { type: Boolean },
inline: { type: Boolean },
selected: { type: Boolean, default: !1 },
showCheckbox: { type: Boolean },
showBorder: { type: Boolean },
showLabels: { type: Boolean },
spacingSize: { default: 42 },
swatchColor: { default: "" },
swatchLabel: null,
swatchAlt: null,
swatchSize: null,
swatchStyle: null
},
setup(t) {
const e = t, n = L(() => ({
bottom: `-${8 + Math.floor(e.spacingSize / 5) * 3}px`
})), r = L(() => {
const s = {
width: `${e.swatchSize}px`,
height: `${e.swatchSize}px`,
borderRadius: e.borderRadius,
backgroundColor: e.swatchColor !== "" ? e.swatchColor : "#FFFFFF",
cursor: i.value
};
return (!e.inline || !e.isLast) && (s.marginRight = `${e.spacingSize}px`), e.inline && !e.rowLengthSetted ? s : {
...s,
marginBottom: `${e.spacingSize}px`
};
}), i = L(() => e.disabled ? "not-allowed" : "pointer"), o = L(() => [n.value]), a = L(() => [r.value, e.swatchStyle]);
return (s, u) => (C(), P("div", {
class: se(["vue-swatches__swatch", {
"vue-swatches__swatch--border": t.showBorder,
"vue-swatches__swatch--selected": t.selected,
"vue-swatches__swatch--is-disabled": t.disabled
}]),
style: Xe(W(a)),
"aria-label": t.swatchAlt,
role: "button",
tabindex: "0",
onKeyup: u[0] || (u[0] = He((l) => s.$emit("click", t.swatchColor), ["enter"])),
onBlur: u[1] || (u[1] = (l) => s.$emit("blur", l.relatedTarget))
}, [
t.swatchColor === "" ? (C(), P("div", Az, Dz)) : F("", !0),
Qe(J(Cz, null, null, 512), [
[xn, t.showCheckbox && t.selected]
]),
t.showLabels ? (C(), P("div", {
key: 1,
class: "vue-swatches__swatch__label",
style: Xe(W(o))
}, Se(t.swatchLabel), 5)) : F("", !0)
], 46, Oz));
}
}), $z = { class: "vue-swatches__diagonal__wrapper vue-swatches--has-children-centered" }, Nz = /* @__PURE__ */ U("div", { class: "vue-swatches__diagonal" }, null, -1), Pz = [
Nz
], Iz = { class: "vue-swatches__fallback__input--wrapper" }, Lz = ["value", "type"], Rz = ["onClick"], s6 = /* @__PURE__ */ be({
__name: "VSwatches",
props: {
backgroundColor: { default: "#ffffff" },
closeOnSelect: { type: Boolean, default: !0 },
swatches: { default: () => "basic" },
disabled: { type: Boolean, default: !1 },
fallbackInputClass: { default: null },
fallbackInputType: { default: () => "text" },
fallbackOkClass: { default: null },
fallbackOkText: { default: "Ok" },
inline: { type: Boolean, default: !1 },
shapes: { default: "squares" },
popoverX: { default: "right" },
popoverY: { default: "bottom" },
rowLength: { default: null },
showBorder: { type: [Boolean, null], default: null },
showFallback: { type: Boolean, default: !1 },
showCheckbox: { type: Boolean, default: !0 },
showLabels: { type: Boolean, default: !1 },
spacingSize: { default: null },
swatchSize: { default: null },
swatchStyle: null,
triggerStyle: null,
wrapperStyle: null,
modelValue: { default: "" }
},
emits: ["close", "open", "update:modelValue"],
setup(t, { emit: e }) {
const n = t, r = re(null), i = re(null), o = re(null), a = "10px", s = 4, u = 5, l = 42, c = !1, f = (le, je, We) => typeof le != "string" ? null : le === "text-basic" ? Tb[je] === void 0 ? null : Tb[je] : le === "text-advanced" ? Cb[je] === void 0 ? null : Cb[je] : le === "basic" || We ? _b[je] === void 0 ? null : _b[je] : null, d = re({}), p = re(!1), h = re(n.modelValue), m = re(!1);
st(() => {
p.value = !0;
});
const v = L(() => !!(_.value && _.value.length && _.value[0] instanceof Array)), y = L(() => n.inline ? !1 : m.value), k = L(() => q("", n.modelValue)), T = L(() => f(n.swatches, "borderRadius")), b = L(() => f(n.swatches, "rowLength")), D = L(() => f(n.swatches, "showBorder")), x = L(() => f(n.swatches, "swatchSize")), S = L(() => f(n.swatches, "spacingSize")), _ = L(() => n.swatches instanceof Array ? n.swatches : typeof n.swatches == "string" ? f(n.swatches, "colors", !0) : []), N = L(() => T.value !== null ? T.value : E.value), R = L(() => n.rowLength !== null ? Number(n.rowLength) : b.value !== null ? b.value : _.value.length < s && !v.value ? _.value.length : s), w = L(() => n.swatchSize !== null ? Number(n.swatchSize) : x.value !== null ? x.value : l), A = L(() => n.spacingSize !== null ? n.spacingSize : S.value !== null ? S.value : Math.round(w.value * 0.25)), $ = L(() => n.showBorder !== null ? n.showBorder : D.value !== null ? D.value : c), I = L(() => !n.inline), E = L(() => n.shapes === "squares" ? `${Math.round(w.value * 0.25)}px` : n.shapes === "circles" ? "50%" : ""), O = L(() => R.value * (w.value + A.value)), g = L(() => ({
width: "42px",
height: "42px",
backgroundColor: n.modelValue ? n.modelValue : "#ffffff",
borderRadius: n.shapes === "circles" ? "50%" : a
})), M = L(() => [g.value, n.triggerStyle]), H = L(() => {
const le = [
{
backgroundColor: n.backgroundColor
},
d.value
];
return n.inline ? le : [
...le,
{
padding: "5px",
marginBottom: "5px"
}
];
}), z = L(() => n.inline ? {} : {
paddingTop: `${A.value}px`,
paddingLeft: `${A.value}px`,
width: `${O.value}px`
}), Y = L(() => [z.value, n.wrapperStyle]), ee = L(() => {
const le = {
marginLeft: `${A.value}px`,
paddingBottom: `${A.value}px`
};
return n.inline ? le : {
...le,
width: `${O.value - A.value}px`
};
}), ce = L(() => [ee.value]);
Ct(() => n.modelValue, (le) => {
h.value = le;
});
function q(le, je) {
return !le && le !== "" || !je && je !== "" ? !1 : le.toUpperCase() === je.toUpperCase();
}
function V() {
var le;
m.value = !1, (le = r.value) == null || le.blur(), e("close", h.value);
}
function te() {
const le = {}, je = i.value, We = o.value;
if (!p.value || n.inline || !je || !window || !document)
return le;
const Ke = je.getBoundingClientRect(), ot = 5, Rt = (document.documentElement.clientWidth || window.innerWidth) - 5, xt = 5, qt = (document.documentElement.clientHeight || window.innerHeight) - 5;
We.style.visibility = "hidden", We.style.display = "block";
const Ut = We.getBoundingClientRect();
return We.style.display = "none", We.style.visibility = "visible", n.popoverY === "top" ? Ke.top - Ut.height < xt ? (le.top = `${Ke.height + u}px`, le.bottom = "auto") : (le.bottom = `${Ke.height + u}px`, le.top = "auto") : n.popoverY === "bottom" && (Ke.bottom + Ut.height > qt ? (le.bottom = `${Ke.height + u}px`, le.top = "auto") : (le.top = `${Ke.height + u}px`, le.bottom = "auto")), n.popoverX === "left" ? Ke.right - Ut.width < ot ? (le.left = 0, le.right = "auto") : (le.right = 0, le.left = "auto") : n.popoverX === "right" && (Ke.left + Ut.width > Rt ? (le.right = 0, le.left = "auto") : (le.left = 0, le.right = "auto")), le;
}
function K(le) {
if (typeof le == "string")
return $.value;
if (typeof le == "object")
return le.showBorder !== void 0 ? le.showBorder : $.value;
}
function Q(le) {
if (typeof le == "string")
return le;
if (typeof le == "object")
return le.color;
}
function Z(le) {
if (typeof le == "string")
return n.disabled;
if (typeof le == "object")
return le.disabled !== void 0 ? le.disabled : n.disabled;
}
function ae(le) {
if (typeof le == "string")
return le;
if (typeof le == "object")
return le.label || le.color;
}
function ke(le) {
if (typeof le == "string")
return le;
if (typeof le == "object")
return le.alt || ae(le);
}
function ge(le) {
var je;
!y.value || le !== null && ((je = r.value) != null && je.contains(le)) || (m.value = !1, e("close", h.value));
}
function de() {
V();
}
function ye() {
var le;
y.value || n.inline || n.disabled || (d.value = te(), m.value = !0, (le = r.value) == null || le.focus(), e("open"));
}
function xe() {
y.value ? V() : ye();
}
function ct(le, { fromFallbackInput: je } = {}) {
if (Z(le))
return;
const We = Q(le);
h.value = We, e("update:modelValue", We), n.closeOnSelect && !n.inline && !je && V();
}
return (le, je) => (C(), P("div", {
class: "vue-swatches",
tabindex: "-1",
ref_key: "main",
ref: r,
onBlur: je[3] || (je[3] = (We) => ge(We.relatedTarget))
}, [
t.inline ? F("", !0) : (C(), P("div", {
key: 0,
ref_key: "triggerWrapper",
ref: i,
class: "vue-swatches__trigger__wrapper",
onClick: xe
}, [
X(le.$slots, "trigger", {}, () => [
U("div", {
class: se(["vue-swatches__trigger", {
"vue-swatches--is-empty": !t.modelValue,
"vue-swatches--is-disabled": t.disabled
}]),
style: Xe(W(M))
}, [
Qe(U("div", $z, Pz, 512), [
[xn, W(k)]
])
], 6)
])
], 512)),
J(zn, { name: "vue-swatches-show-hide" }, {
default: ne(() => [
Qe(U("div", {
ref_key: "containerWrapper",
ref: o,
class: se(["vue-swatches__container", { "vue-swatches--inline": t.inline }]),
style: Xe(W(H))
}, [
U("div", {
class: "vue-swatches__wrapper",
style: Xe(W(Y))
}, [
W(v) ? (C(!0), P(Ee, { key: 0 }, nt(W(_), (We, Ke) => (C(), P("div", {
key: Ke,
class: "vue-swatches__row"
}, [
(C(!0), P(Ee, null, nt(We, (ot, Rt) => (C(), oe(Ob, {
key: Rt,
"is-last": Ke === W(_).length - 1 && Rt === We.length,
"row-length-setted": t.rowLength !== null || W(b) !== null,
"border-radius": W(N),
disabled: Z(ot),
inline: t.inline,
selected: q(Q(ot), t.modelValue),
"swatch-size": W(w),
"spacing-size": W(A),
"show-border": K(ot),
"show-checkbox": t.showCheckbox,
"show-labels": t.showLabels,
"swatch-color": Q(ot),
"swatch-label": ae(ot),
"swatch-alt": ke(ot),
"swatch-style": t.swatchStyle,
onBlur: je[0] || (je[0] = (xt) => ge(xt)),
onClick: (xt) => ct(ot)
}, null, 8, ["is-last", "row-length-setted", "border-radius", "disabled", "inline", "selected", "swatch-size", "spacing-size", "show-border", "show-checkbox", "show-labels", "swatch-color", "swatch-label", "swatch-alt", "swatch-style", "onClick"]))), 128))
]))), 128)) : (C(!0), P(Ee, { key: 1 }, nt(W(_), (We, Ke) => (C(), oe(Ob, {
key: Ke,
"is-last": Ke === W(_).length - 1,
"row-length-setted": t.rowLength !== null || W(b) !== null,
"border-radius": W(N),
disabled: Z(We),
inline: t.inline,
selected: q(Q(We), t.modelValue),
"swatch-size": W(w),
"spacing-size": W(A),
"show-border": K(We),
"show-checkbox": t.showCheckbox,
"show-labels": t.showLabels,
"swatch-color": Q(We),
"swatch-label": ae(We),
"swatch-alt": ke(We),
"swatch-style": t.swatchStyle,
onBlur: je[1] || (je[1] = (ot) => ge(ot)),
onClick: (ot) => ct(We)
}, null, 8, ["is-last", "row-length-setted", "border-radius", "disabled", "inline", "selected", "swatch-size", "spacing-size", "show-border", "show-checkbox", "show-labels", "swatch-color", "swatch-label", "swatch-alt", "swatch-style", "onClick"]))), 128))
], 4),
t.showFallback ? (C(), P("div", {
key: 0,
class: "vue-swatches__fallback__wrapper",
style: Xe(W(ce))
}, [
U("span", Iz, [
U("input", {
ref: "fallbackInput",
class: se(["vue-swatches__fallback__input", t.fallbackInputClass]),
value: h.value,
type: t.fallbackInputType,
onInput: je[2] || (je[2] = (We) => ct(We.target.value, { fromFallbackInput: !0 }))
}, null, 42, Lz)
]),
W(I) ? (C(), P("button", {
key: 0,
class: se(["vue-swatches__fallback__button", t.fallbackOkClass]),
onClick: et(de, ["prevent"])
}, Se(t.fallbackOkText), 11, Rz)) : F("", !0)
], 4)) : F("", !0)
], 6), [
[xn, t.inline || W(y)]
])
]),
_: 1
})
], 544));
}
});
const Bz = be({
name: "KColor",
components: { VSwatches: s6 },
props: {
modelValue: {
type: String,
default: ""
},
square: {
type: Boolean,
default: !0,
description: "Define un estilo cuadrado"
},
circle: {
type: Boolean,
default: !1,
description: "Define un estilo circular"
},
options: {
type: Array,
default: () => []
},
closeOnSelect: {
type: Boolean,
default: !0
},
disabled: {
type: Boolean,
default: !1
},
readonly: {
type: Boolean,
default: !1
},
inline: {
type: Boolean,
default: !1
},
fallback: {
type: String,
default: "color"
},
rowLength: {
type: Number,
default: 4
},
size: {
type: String,
default: "md",
options: ["xs", "sm", "md", "lg"]
}
},
emits: ["update:modelValue"],
setup(t, e) {
const n = L({
get() {
return t.modelValue;
},
set(a) {
e.emit("update:modelValue", a);
}
}), r = L(() => t.square ? "squares" : t.circle ? "circles" : "squares"), i = L(() => {
switch (t.size) {
case "xs":
return "2.25rem";
case "sm":
return "2.5rem";
case "md":
return "3rem";
case "lg":
return "3.5rem";
default:
return "3rem";
}
}), o = L(() => t.disabled ? "not-allowed" : t.readonly ? "initial" : "pointer");
return { model: n, shape: r, triggerSize: i, cursor: o };
}
});
const Vz = { class: "k-color" };
function zz(t, e, n, r, i, o) {
const a = he("v-swatches");
return C(), P("div", Vz, [
J(a, {
modelValue: t.model,
"onUpdate:modelValue": e[0] || (e[0] = (s) => t.model = s),
shape: t.shape,
swatches: t.options.length > 0 ? t.options : void 0,
"close-on-select": t.closeOnSelect,
disabled: t.disabled || t.readonly,
inline: t.inline,
"fallback-input-type": t.fallback,
"row-length": t.rowLength,
"show-fallback": t.fallback !== "none",
"trigger-style": {
width: t.triggerSize,
height: t.triggerSize,
cursor: t.cursor
}
}, {
trigger: ne(() => [
X(t.$slots, "default", At(hn({ model: t.model })))
]),
_: 3
}, 8, ["modelValue", "shape", "swatches", "close-on-select", "disabled", "inline", "fallback-input-type", "row-length", "show-fallback", "trigger-style"])
]);
}
const Hz = /* @__PURE__ */ $e(Bz, [["render", zz]]), qz = be({
name: "KInputColor",
components: { VSwatches: s6 },
props: {
id: {
type: String,
default: ""
},
modelValue: {
type: String,
default: ""
},
options: {
type: Array,
default: () => []
},
closeOnSelect: {
type: Boolean,
default: !0
},
autofocus: {
type: Boolean,
default: !1
},
required: {
type: Boolean,
default: !1
},
disabled: {
type: Boolean,
default: !1
},
readonly: {
type: Boolean,
default: !1
},
fallback: {
type: String,
default: "color"
},
rowLength: {
type: Number,
default: 4
},
size: {
type: String,
default: "md",
options: ["xs", "sm", "md", "lg"]
},
placeholder: {
type: String,
default: ""
},
width: {
type: Number,
default: 0,
description: "Ancho del input"
},
status: {
type: String,
default: "",
options: ["warning", "success", "danger"],
description: "Color de estado del input"
},
float: {
type: Boolean,
default: !1,
description: "Indica si el input tiene estilo flotante"
},
fieldset: {
type: Boolean,
default: !1,
description: "Indica si el input tiene estilo fieldset"
},
label: {
type: String,
required: !1,
default: "",
description: "Etiqueta de definición"
},
errors: {
type: Array,
required: !1,
default: () => [],
description: "Errores de validación"
}
},
emits: ["update:modelValue"],
setup(t, e) {
const n = t.id || on(), r = (f) => !!e.slots[f], i = L({
get() {
return t.modelValue;
},
set(f) {
e.emit("update:modelValue", f);
}
}), o = L(() => t.disabled ? "not-allowed" : t.readonly ? "initial" : "pointer"), a = L(() => {
const f = {};
return t.width > 0 && (f.width = t.width + "px"), f;
}), s = L(() => t.label || r("default")), u = L(() => {
var f, d;
return t.float ? t.placeholder || t.label || ((d = (f = e.slots).default) == null ? void 0 : d.call(f).toString()) : t.placeholder;
}), l = L(() => {
const f = ["k-input-text", `k-input-text-${t.size}`];
return t.float ? f.push("k-input-text-floating") : t.fieldset && f.push("k-input-text-fieldset"), t.errors.length > 0 ? f.push("k-input-text-danger") : t.status && f.push(`k-input-text-${t.status}`), f;
}), c = L(() => (t.errors.length > 0 ? t.errors[0].$message : "").toString());
return {
model: i,
cursor: o,
uuid: n,
style: a,
hasLabel: s,
placeholderText: u,
classes: l,
firstError: c,
hasSlot: r
};
}
});
const Fz = ["for"], jz = {
key: 2,
class: "font-bold text-danger ml-1"
}, Uz = ["id", "placeholder", "required", "value", "autofocus", "disabled"], Wz = ["for"], Yz = {
key: 2,
class: "font-bold text-danger ml-1"
};
function Kz(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip"), u = he("v-swatches");
return C(), oe(u, {
modelValue: t.model,
"onUpdate:modelValue": e[0] || (e[0] = (l) => t.model = l),
class: "k-input-color",
swatches: t.options.length > 0 ? t.options : void 0,
"close-on-select": t.closeOnSelect,
disabled: t.disabled || t.readonly,
"fallback-input-type": t.fallback,
"row-length": t.rowLength,
"show-fallback": t.fallback !== "none",
"trigger-style": {
cursor: t.cursor
}
}, {
trigger: ne(() => [
U("div", {
class: se([t.classes])
}, [
t.hasLabel ? (C(), P("label", {
key: 0,
for: t.uuid
}, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label), 1)
], 64)),
t.required ? (C(), P("span", jz, " * ")) : F("", !0),
t.firstError ? (C(), oe(s, {
key: 3,
content: t.firstError
}, {
default: ne(() => [
J(a, {
icon: "triangle-exclamation",
class: "ml-2"
})
]),
_: 1
}, 8, ["content"])) : F("", !0)
], 8, Fz)) : F("", !0),
U("input", {
id: t.uuid,
type: "text",
placeholder: t.placeholder,
required: t.required,
value: t.model,
style: Xe(t.style),
autofocus: t.autofocus,
disabled: t.disabled,
readonly: ""
}, null, 12, Uz),
t.hasLabel && t.float ? (C(), P("label", {
key: 1,
for: t.uuid
}, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.label || t.placeholder), 1)
], 64)),
t.required ? (C(), P("span", Yz, "*")) : F("", !0),
t.firstError ? (C(), oe(s, {
key: 3,
hover: "",
content: t.firstError
}, {
default: ne(() => [
J(a, {
icon: "triangle-exclamation",
class: "ml-2"
})
]),
_: 1
}, 8, ["content"])) : F("", !0)
], 8, Wz)) : F("", !0)
], 2)
]),
_: 3
}, 8, ["modelValue", "swatches", "close-on-select", "disabled", "fallback-input-type", "row-length", "show-fallback", "trigger-style"]);
}
const Gz = /* @__PURE__ */ $e(qz, [["render", Kz]]), Jz = ["accept", "multiple", "disabled"], Xz = /* @__PURE__ */ be({
__name: "k-file",
props: {
accept: {
type: String,
default: "*"
},
multiple: {
type: Boolean,
default: !1
},
disabled: {
type: Boolean,
default: !1
}
},
emits: ["upload"],
setup(t, { emit: e }) {
const n = re(), r = () => {
n.value.click();
}, i = (o) => {
const a = o.target.files;
a.length && (e("upload", [...a]), o.target.value = null);
};
return (o, a) => (C(), P("div", { onClick: r }, [
X(o.$slots, "default"),
U("input", {
ref_key: "fileInput",
ref: n,
type: "file",
class: "hidden",
accept: t.accept,
multiple: t.multiple,
disabled: t.disabled,
onChange: i
}, null, 40, Jz)
]));
}
}), Qz = be({
name: "KAvatar",
autoload: !0,
props: {
name: {
type: String,
default: "???",
required: !0,
description: "Nombre del avatar"
},
size: {
type: Number,
default: 120,
description: "Tamaño del avatar",
control: { type: "range", min: 40, max: 200 }
},
square: {
type: Boolean,
default: !0,
description: "Define un estilo cuadrado"
},
circle: {
type: Boolean,
default: !1,
description: "Define un estilo circular"
},
bgColor: {
default: "",
type: String,
description: "Color de fondo del avatar",
control: { type: "color" }
},
tooltip: {
type: Boolean,
default: !0,
description: "Define si se muestra el tooltip"
},
tag: {
type: String,
default: "span",
description: "Define el tag del componente"
},
type: {
type: String,
default: "auto",
description: "Define el tipo de avatar",
options: [
"auto",
"adventurer-neutral",
"avataaars-neutral",
"big-ears-neutral",
"big-smile",
"bottts-neutral",
"croodles",
"croodles-neutral",
"initials",
"lorelei",
"lorelei-neutral",
"micah",
"miniavs",
"notionists",
"notionists-neutral",
"open-peeps",
"thumbs"
],
control: { type: "select" }
}
},
setup(t) {
const e = Ht(), n = L(() => t.circle ? "circle" : "square"), r = L(() => {
let i = t.type;
return t.type === "auto" && (i = e.get("avatarType")), `https://avatar.gestios.es/6.x/${i}/svg?seed=${t.name}`;
});
return { geo: n, src: r };
}
}), Zz = ["src", "width", "height"];
function eH(t, e, n, r, i, o) {
const a = Xb("tooltip");
return Qe((C(), P("img", {
src: t.src,
width: t.size,
height: t.size,
class: se({
"rounded-xl overflow-hidden": t.geo === "square",
"rounded-full overflow-hidden": t.geo === "circle"
}),
style: Xe({
backgroundColor: t.bgColor || void 0
})
}, null, 14, Zz)), [
[a, { content: t.tooltip ? t.name : void 0, placement: "top" }]
]);
}
const tH = /* @__PURE__ */ $e(Qz, [["render", eH]]), Ab = [
"gray",
"primary",
"secondary",
"success",
"warning",
"danger",
"info"
], nH = {
id: {
type: String,
default: () => on(),
description: "ID del badge"
},
size: {
type: String,
control: { type: "inline-radio" },
options: ["xs", "sm", "md", "lg"],
validator: (t) => ["xs", "sm", "md", "lg"].includes(t),
default: "md",
description: "Tamaño del badge"
},
// Misc
color: {
type: String,
control: { type: "select" },
options: Ab,
validator: (t) => Ab.includes(t),
default: "gray",
description: "Color del badge"
},
neon: {
type: Boolean,
default: !1,
description: "Establece el diseño `neón` del botón"
}
}, rH = (t) => {
const e = [
"text-center font-semibold rounded-lg transition-all h-max whitespace-nowrap inline-flex items-center"
], n = t.neon, r = t.color, i = t.size;
return i === "xs" ? e.push("py-1 px-3 text-xs") : i === "sm" ? e.push("py-1 px-4 text-sm") : i === "md" ? e.push("py-1.5 px-4 text-sm") : i === "lg" && e.push("py-2 px-5 text-base"), n ? e.push(
"border bg-opacity-20 border-opacity-0 dark:bg-opacity-10 dark:border-opacity-0"
) : e.push("border"), r === "gray" ? (e.push("border-gray-300 bg-gray-300"), e.push(n ? "text-gray-300 dark:text-white" : "text-gray-700")) : r === "primary" ? (e.push("border-primary bg-primary"), e.push(n ? "text-primary" : "text-white")) : r === "secondary" ? (e.push("border-secondary bg-secondary"), e.push(n ? "text-secondary" : "text-white")) : r === "success" ? (e.push("border-success bg-success"), e.push(n ? "text-success" : "text-white")) : r === "warning" ? (e.push("border-warning bg-warning"), e.push(n ? "text-warning" : "text-white")) : r === "danger" ? (e.push("border-danger bg-danger"), e.push(n ? "text-danger" : "text-white")) : r === "info" && (e.push("border-info bg-info"), e.push(n ? "text-info" : "text-white")), e;
}, iH = be({
name: "KBadge",
autoload: !0,
props: nH,
setup(t) {
return { badgeClasses: L(() => rH(t)) };
}
}), oH = ["id"];
function aH(t, e, n, r, i, o) {
return C(), P("span", {
id: t.id,
class: se(t.badgeClasses)
}, [
X(t.$slots, "default")
], 10, oH);
}
const u6 = /* @__PURE__ */ $e(iH, [["render", aH]]), Mb = [
"white",
"black",
"gray",
"primary",
"secondary",
"success",
"warning",
"danger",
"info"
], sH = {
value: {
type: [Number, String],
default: 0,
required: !0,
description: "Valor"
},
square: {
type: Boolean,
default: !0,
description: "Define un estilo cuadrado"
},
circle: {
type: Boolean,
default: !1,
description: "Define un estilo circular"
},
offsetX: {
type: Number,
default: 0,
description: "Desplazamiento horizontal"
},
offsetY: {
type: Number,
default: 0,
description: "Desplazamiento vertical"
},
size: {
type: String,
options: ["xs", "sm", "md", "lg"],
validator: (t) => ["xs", "sm", "md", "lg"].includes(t),
default: "md",
description: "Tamaño del componente"
},
color: {
type: String,
options: Mb,
validator: (t) => Mb.includes(t),
default: "danger",
description: "Color"
},
neon: {
type: Boolean,
default: !1,
description: "Establece el diseño `neón` del botón"
},
tag: {
type: String,
default: "span"
}
}, uH = (t, e) => {
const n = (l) => !!e[l], r = [
"text-center font-medium transition-all flex items-center justify-center whitespace-nowrap"
], i = t.neon, o = t.color, a = t.size, s = t.circle, u = t.square;
return a === "xs" ? (r.push("h-5 w-5 text-xxxs"), s ? r.push("rounded-full") : u && r.push("rounded-md"), n("default") && r.push("-translate-y-3.5 -translate-x-2.5")) : a === "sm" ? (r.push("h-6 w-6 text-xxs"), s ? r.push("rounded-full") : u && r.push("rounded-md"), n("default") && r.push("-translate-y-4 -translate-x-3")) : a === "md" ? (r.push("h-7 w-7 text-xs"), s ? r.push("rounded-full") : u && r.push("rounded-lg"), n("default") && r.push("-translate-y-5 -translate-x-3.5")) : a === "lg" && (r.push("h-8 w-8 text-sm"), s ? r.push("rounded-full") : u && r.push("rounded-lg"), n("default") && r.push("-translate-y-6 -translate-x-4")), i ? r.push(
"border bg-opacity-20 border-opacity-0 dark:bg-opacity-10 dark:border-opacity-0"
) : r.push("border"), o === "black" || o === "white" ? (r.push("border-black bg-black dark:bg-white dark:border-white"), r.push(
i ? "text-black dark:text-white" : "text-white dark:text-black"
)) : o === "gray" ? (r.push("border-gray-300 bg-gray-300"), r.push(i ? "text-gray-300" : "text-gray-700")) : o === "primary" ? (r.push("border-primary bg-primary"), r.push(i ? "text-primary" : "text-white")) : o === "secondary" ? (r.push("border-secondary bg-secondary"), r.push(i ? "text-secondary" : "text-white")) : o === "success" ? (r.push("border-success bg-success"), r.push(i ? "text-success" : "text-white")) : o === "warning" ? (r.push("border-warning bg-warning"), r.push(i ? "text-warning" : "text-white")) : o === "danger" ? (r.push("border-danger bg-danger"), r.push(i ? "text-danger" : "text-white")) : o === "info" && (r.push("border-info bg-info"), r.push(i ? "text-info" : "text-white")), n("default") && r.push("absolute top-0 left-full"), r;
}, lH = (t, e) => {
const n = (i) => !!e[i], r = {};
if (n("default")) {
const i = t.offsetX, o = t.offsetY;
i !== 0 && (r["margin-left"] = `${i}px`), o !== 0 && (r["margin-top"] = `${o}px`);
}
return r;
}, cH = be({
name: "KCount",
autoload: !0,
props: sH,
setup(t, { slots: e }) {
const n = (a) => !!e[a], r = L(() => uH(t, e)), i = L(() => lH(t, e)), o = L(() => t.value > 99 ? "+99" : t.value);
return { hasSlot: n, badgeClasses: r, badgeStyles: i, text: o };
}
});
function dH(t, e, n, r, i, o) {
return t.hasSlot("default") ? (C(), oe(Eo(t.tag), {
key: 0,
class: "relative -translate-y-3.5 h-7 text-xs",
title: t.value.toString()
}, {
default: ne(() => [
X(t.$slots, "default", {}, void 0, !0),
U("span", {
class: se(t.badgeClasses),
style: Xe(t.badgeStyles)
}, Se(t.text), 7)
]),
_: 3
}, 8, ["title"])) : (C(), oe(Eo(t.tag), {
key: 1,
class: se(t.badgeClasses),
style: Xe(t.badgeStyles),
title: t.value.toString()
}, {
default: ne(() => [
Oe(Se(t.text), 1)
]),
_: 1
}, 8, ["class", "style", "title"]));
}
const fH = /* @__PURE__ */ $e(cH, [["render", dH], ["__scopeId", "data-v-9292bef1"]]);
/*! medium-zoom 1.0.8 | MIT License | https://github.com/francoischalifour/medium-zoom */
var uo = Object.assign || function(t) {
for (var e = 1; e < arguments.length; e++) {
var n = arguments[e];
for (var r in n)
Object.prototype.hasOwnProperty.call(n, r) && (t[r] = n[r]);
}
return t;
}, Qu = function(e) {
return e.tagName === "IMG";
}, pH = function(e) {
return NodeList.prototype.isPrototypeOf(e);
}, Sl = function(e) {
return e && e.nodeType === 1;
}, Db = function(e) {
var n = e.currentSrc || e.src;
return n.substr(-4).toLowerCase() === ".svg";
}, $b = function(e) {
try {
return Array.isArray(e) ? e.filter(Qu) : pH(e) ? [].slice.call(e).filter(Qu) : Sl(e) ? [e].filter(Qu) : typeof e == "string" ? [].slice.call(document.querySelectorAll(e)).filter(Qu) : [];
} catch {
throw new TypeError(`The provided selector is invalid.
Expects a CSS selector, a Node element, a NodeList or an array.
See: https://github.com/francoischalifour/medium-zoom`);
}
}, hH = function(e) {
var n = document.createElement("div");
return n.classList.add("medium-zoom-overlay"), n.style.background = e, n;
}, mH = function(e) {
var n = e.getBoundingClientRect(), r = n.top, i = n.left, o = n.width, a = n.height, s = e.cloneNode(), u = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, l = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
return s.removeAttribute("id"), s.style.position = "absolute", s.style.top = r + u + "px", s.style.left = i + l + "px", s.style.width = o + "px", s.style.height = a + "px", s.style.transform = "", s;
}, ra = function(e, n) {
var r = uo({
bubbles: !1,
cancelable: !1,
detail: void 0
}, n);
if (typeof window.CustomEvent == "function")
return new CustomEvent(e, r);
var i = document.createEvent("CustomEvent");
return i.initCustomEvent(e, r.bubbles, r.cancelable, r.detail), i;
}, gH = function t(e) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = window.Promise || function(A) {
function $() {
}
A($, $);
}, i = function(A) {
var $ = A.target;
if ($ === N) {
h();
return;
}
T.indexOf($) !== -1 && m({ target: $ });
}, o = function() {
if (!(D || !_.original)) {
var A = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
Math.abs(x - A) > S.scrollOffset && setTimeout(h, 150);
}
}, a = function(A) {
var $ = A.key || A.keyCode;
($ === "Escape" || $ === "Esc" || $ === 27) && h();
}, s = function() {
var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, $ = A;
if (A.background && (N.style.background = A.background), A.container && A.container instanceof Object && ($.container = uo({}, S.container, A.container)), A.template) {
var I = Sl(A.template) ? A.template : document.querySelector(A.template);
$.template = I;
}
return S = uo({}, S, $), T.forEach(function(E) {
E.dispatchEvent(ra("medium-zoom:update", {
detail: { zoom: R }
}));
}), R;
}, u = function() {
var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
return t(uo({}, S, A));
}, l = function() {
for (var A = arguments.length, $ = Array(A), I = 0; I < A; I++)
$[I] = arguments[I];
var E = $.reduce(function(O, g) {
return [].concat(O, $b(g));
}, []);
return E.filter(function(O) {
return T.indexOf(O) === -1;
}).forEach(function(O) {
T.push(O), O.classList.add("medium-zoom-image");
}), b.forEach(function(O) {
var g = O.type, M = O.listener, H = O.options;
E.forEach(function(z) {
z.addEventListener(g, M, H);
});
}), R;
}, c = function() {
for (var A = arguments.length, $ = Array(A), I = 0; I < A; I++)
$[I] = arguments[I];
_.zoomed && h();
var E = $.length > 0 ? $.reduce(function(O, g) {
return [].concat(O, $b(g));
}, []) : T;
return E.forEach(function(O) {
O.classList.remove("medium-zoom-image"), O.dispatchEvent(ra("medium-zoom:detach", {
detail: { zoom: R }
}));
}), T = T.filter(function(O) {
return E.indexOf(O) === -1;
}), R;
}, f = function(A, $) {
var I = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
return T.forEach(function(E) {
E.addEventListener("medium-zoom:" + A, $, I);
}), b.push({ type: "medium-zoom:" + A, listener: $, options: I }), R;
}, d = function(A, $) {
var I = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
return T.forEach(function(E) {
E.removeEventListener("medium-zoom:" + A, $, I);
}), b = b.filter(function(E) {
return !(E.type === "medium-zoom:" + A && E.listener.toString() === $.toString());
}), R;
}, p = function() {
var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, $ = A.target, I = function() {
var O = {
width: document.documentElement.clientWidth,
height: document.documentElement.clientHeight,
left: 0,
top: 0,
right: 0,
bottom: 0
}, g = void 0, M = void 0;
if (S.container)
if (S.container instanceof Object)
O = uo({}, O, S.container), g = O.width - O.left - O.right - S.margin * 2, M = O.height - O.top - O.bottom - S.margin * 2;
else {
var H = Sl(S.container) ? S.container : document.querySelector(S.container), z = H.getBoundingClientRect(), Y = z.width, ee = z.height, ce = z.left, q = z.top;
O = uo({}, O, {
width: Y,
height: ee,
left: ce,
top: q
});
}
g = g || O.width - S.margin * 2, M = M || O.height - S.margin * 2;
var V = _.zoomedHd || _.original, te = Db(V) ? g : V.naturalWidth || g, K = Db(V) ? M : V.naturalHeight || M, Q = V.getBoundingClientRect(), Z = Q.top, ae = Q.left, ke = Q.width, ge = Q.height, de = Math.min(Math.max(ke, te), g) / ke, ye = Math.min(Math.max(ge, K), M) / ge, xe = Math.min(de, ye), ct = (-ae + (g - ke) / 2 + S.margin + O.left) / xe, le = (-Z + (M - ge) / 2 + S.margin + O.top) / xe, je = "scale(" + xe + ") translate3d(" + ct + "px, " + le + "px, 0)";
_.zoomed.style.transform = je, _.zoomedHd && (_.zoomedHd.style.transform = je);
};
return new r(function(E) {
if ($ && T.indexOf($) === -1) {
E(R);
return;
}
var O = function Y() {
D = !1, _.zoomed.removeEventListener("transitionend", Y), _.original.dispatchEvent(ra("medium-zoom:opened", {
detail: { zoom: R }
})), E(R);
};
if (_.zoomed) {
E(R);
return;
}
if ($)
_.original = $;
else if (T.length > 0) {
var g = T;
_.original = g[0];
} else {
E(R);
return;
}
if (_.original.dispatchEvent(ra("medium-zoom:open", {
detail: { zoom: R }
})), x = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, D = !0, _.zoomed = mH(_.original), document.body.appendChild(N), S.template) {
var M = Sl(S.template) ? S.template : document.querySelector(S.template);
_.template = document.createElement("div"), _.template.appendChild(M.content.cloneNode(!0)), document.body.appendChild(_.template);
}
if (_.original.parentElement && _.original.parentElement.tagName === "PICTURE" && _.original.currentSrc && (_.zoomed.src = _.original.currentSrc), document.body.appendChild(_.zoomed), window.requestAnimationFrame(function() {
document.body.classList.add("medium-zoom--opened");
}), _.original.classList.add("medium-zoom-image--hidden"), _.zoomed.classList.add("medium-zoom-image--opened"), _.zoomed.addEventListener("click", h), _.zoomed.addEventListener("transitionend", O), _.original.getAttribute("data-zoom-src")) {
_.zoomedHd = _.zoomed.cloneNode(), _.zoomedHd.removeAttribute("srcset"), _.zoomedHd.removeAttribute("sizes"), _.zoomedHd.removeAttribute("loading"), _.zoomedHd.src = _.zoomed.getAttribute("data-zoom-src"), _.zoomedHd.onerror = function() {
clearInterval(H), console.warn("Unable to reach the zoom image target " + _.zoomedHd.src), _.zoomedHd = null, I();
};
var H = setInterval(function() {
_.zoomedHd.complete && (clearInterval(H), _.zoomedHd.classList.add("medium-zoom-image--opened"), _.zoomedHd.addEventListener("click", h), document.body.appendChild(_.zoomedHd), I());
}, 10);
} else if (_.original.hasAttribute("srcset")) {
_.zoomedHd = _.zoomed.cloneNode(), _.zoomedHd.removeAttribute("sizes"), _.zoomedHd.removeAttribute("loading");
var z = _.zoomedHd.addEventListener("load", function() {
_.zoomedHd.removeEventListener("load", z), _.zoomedHd.classList.add("medium-zoom-image--opened"), _.zoomedHd.addEventListener("click", h), document.body.appendChild(_.zoomedHd), I();
});
} else
I();
});
}, h = function() {
return new r(function(A) {
if (D || !_.original) {
A(R);
return;
}
var $ = function I() {
_.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(_.zoomed), _.zoomedHd && document.body.removeChild(_.zoomedHd), document.body.removeChild(N), _.zoomed.classList.remove("medium-zoom-image--opened"), _.template && document.body.removeChild(_.template), D = !1, _.zoomed.removeEventListener("transitionend", I), _.original.dispatchEvent(ra("medium-zoom:closed", {
detail: { zoom: R }
})), _.original = null, _.zoomed = null, _.zoomedHd = null, _.template = null, A(R);
};
D = !0, document.body.classList.remove("medium-zoom--opened"), _.zoomed.style.transform = "", _.zoomedHd && (_.zoomedHd.style.transform = ""), _.template && (_.template.style.transition = "opacity 150ms", _.template.style.opacity = 0), _.original.dispatchEvent(ra("medium-zoom:close", {
detail: { zoom: R }
})), _.zoomed.addEventListener("transitionend", $);
});
}, m = function() {
var A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, $ = A.target;
return _.original ? h() : p({ target: $ });
}, v = function() {
return S;
}, y = function() {
return T;
}, k = function() {
return _.original;
}, T = [], b = [], D = !1, x = 0, S = n, _ = {
original: null,
zoomed: null,
zoomedHd: null,
template: null
// If the selector is omitted, it's replaced by the options
};
Object.prototype.toString.call(e) === "[object Object]" ? S = e : (e || typeof e == "string") && l(e), S = uo({
margin: 0,
background: "#fff",
scrollOffset: 40,
container: null,
template: null
}, S);
var N = hH(S.background);
document.addEventListener("click", i), document.addEventListener("keyup", a), document.addEventListener("scroll", o), window.addEventListener("resize", h);
var R = {
open: p,
close: h,
toggle: m,
update: s,
clone: u,
attach: l,
detach: c,
on: f,
off: d,
getOptions: v,
getImages: y,
getZoomedImage: k
};
return R;
};
function bH(t, e) {
e === void 0 && (e = {});
var n = e.insertAt;
if (!(!t || typeof document > "u")) {
var r = document.head || document.getElementsByTagName("head")[0], i = document.createElement("style");
i.type = "text/css", n === "top" && r.firstChild ? r.insertBefore(i, r.firstChild) : r.appendChild(i), i.styleSheet ? i.styleSheet.cssText = t : i.appendChild(document.createTextNode(t));
}
}
var vH = ".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";
bH(vH);
const l6 = gH, yH = be({
name: "KImage",
autoload: !0,
props: {
thumbnail: {
type: String,
default: "",
description: "Thumbnail de la imagen"
},
src: {
type: String,
default: "",
description: "Url de la imagen"
},
size: {
type: Number,
default: 80,
description: "Tamaño en px"
},
zoom: {
type: Boolean,
default: !0,
description: "Zoom"
},
square: {
type: Boolean,
default: !0,
description: "Define un estilo cuadrado"
},
circle: {
type: Boolean,
default: !1,
description: "Define un estilo circular"
}
},
setup(t) {
const e = re(), n = L(() => t.thumbnail ? t.thumbnail : t.src), r = L(() => {
const i = {};
return i.height = `${t.size}px`, i.width = `${t.size}px`, i;
});
return st(() => {
if (t.zoom) {
const i = l6(e.value, {
background: "rgba(0, 0, 0, 0.8)"
});
i.on("open", (o) => {
o.target.style.height = "auto", o.target.style.width = "auto";
}), i.on("opened", (o) => {
o.target.style.height = `${t.size}px`, o.target.style.width = `${t.size}px`;
});
}
}), { img: e, style: r, thumb: n };
}
});
const wH = ["src", "data-zoom-src"];
function kH(t, e, n, r, i, o) {
return C(), P("div", {
class: se(["k-image", { "k-image-zoom": t.zoom, "k-image-circle": t.circle }]),
style: Xe(t.style)
}, [
U("img", {
ref: "img",
src: t.thumb,
"data-zoom": "",
"data-zoom-src": t.src,
style: Xe(t.style),
class: "object-cover"
}, null, 12, wH)
], 6);
}
const xH = /* @__PURE__ */ $e(yH, [["render", kH]]), SH = be({
name: "KLogo",
autoload: !0,
props: {
dark: {
type: Boolean,
default: !1,
description: "Define el modo oscuro"
},
light: {
type: Boolean,
default: !1,
description: "Define el modo claro"
},
side: {
type: Boolean,
default: !1,
description: "Degine el modo alargado"
},
height: {
type: Number,
default: 40,
description: "Altura especificada"
}
},
setup(t) {
const e = Ht(), n = L(() => e.get("darkMode"));
return { src: L(() => {
const i = e.get("logo.dark"), o = e.get("logo.light"), a = e.get("logo.side_dark"), s = e.get("logo.side_light");
return t.dark ? t.side ? a : i : t.light ? t.side ? s : o : n.value ? t.side ? a : i : t.side ? s : o;
}) };
}
}), EH = "_logo_24cy6_1", _H = {
logo: EH
}, TH = ["src"];
function CH(t, e, n, r, i, o) {
return C(), P("img", {
src: t.src,
style: Xe({ height: `${t.height}px` }),
class: se(t.$style.logo)
}, null, 14, TH);
}
const OH = {
$style: _H
}, AH = /* @__PURE__ */ $e(SH, [["render", CH], ["__cssModules", OH]]), MH = {
index: {
type: String,
required: !0,
description: "Clave primaria de la tabla"
},
store: {
type: String,
required: !1,
description: "Nombre único para almacenamiento en cache"
},
columns: {
type: Array,
required: !0,
description: "Array con las columnas a mostrar"
},
data: {
type: Array,
default: () => [],
description: "Array con los datos a mostrar"
},
total: {
type: Number,
default: () => 0,
description: "Numero total de registros para la paginación"
},
loading: {
type: Boolean,
default: !1,
description: "Indica si se estan cargando los datos"
},
selected: {
type: Array,
required: !1,
description: "Indica si se muestra la columna de checkbox y que items estan seleccionados"
},
header: {
type: Boolean,
default: !0,
description: "Muestra u oculta la cabecera de la tabla"
},
clean: {
type: Boolean,
default: !1,
description: "Elimina los estilos por defecto del componente"
},
requiredFilters: {
type: Object,
default: null,
description: "Filtros requeridos para la consulta. No se pueden eliminar"
},
card: {
type: [Boolean, String],
default: !1,
description: "Muestra los datos en forma de tarjetas"
},
cardTag: {
type: String,
default: "div"
},
cardClasses: {
type: [String, Array],
default: () => []
},
pagination: {
type: String,
default: "infinite"
},
show404: {
type: Boolean,
default: !0
},
disabledRows: {
type: Array,
default: () => []
}
};
function DH(t, e) {
const n = L(() => {
const i = t.columns, o = [];
return i == null || i.forEach((a) => {
let s = a.width || void 0;
a.slot === "_image" && (s = "5rem"), a.slot && ["header", "footer", "content"].includes(a.slot) && (a.slot = "");
const u = {
title: a.title,
index: a.index || "",
order: a.order || !1,
nowrap: a.nowrap || !0,
width: s,
align: a.align || "left",
slot: a.slot || "",
makeup: a.makeup || void 0,
filter: a.filter,
style: { position: "relative" },
url: a.url || void 0
};
u.nowrap && (u.style["white-space"] = "nowrap"), u.align && (u.style["text-align"] = u.align), u.width && (u.style.width = u.width), a.style && (u.style = { ...u.style, ...a.style }), o.push(u);
}), o;
}), r = L(() => {
let i = 1;
return t.selected !== void 0 && i++, i += n.value.length, i;
});
return { cols: n, colLength: r };
}
function $H(t) {
const e = (u) => {
if (t.selected) {
const l = t.index || "id", c = t.selected.findIndex(
(f) => f[l] === t.data[u][l]
);
c > -1 ? t.selected.splice(c, 1) : t.selected.push(t.data[u]);
}
}, n = L(() => {
const u = t.index || "id";
return t.data.map((l) => !!(t.selected && t.selected.findIndex(
(f) => f[u] === l[u]
) > -1));
}), r = L(() => {
const u = t.index || "id";
return t.data.map((l) => !!(t.disabledRows && t.disabledRows.includes(l[u])));
}), i = () => {
if (t.selected) {
const u = t.selected, l = t.data.filter((c) => {
const f = t.index || "id";
return !t.disabledRows.includes(c[f]);
});
if (u.length >= l.length)
t.selected.splice(0, t.selected.length);
else {
t.selected.splice(0, t.selected.length);
for (let c = 0; c < t.data.length; c++)
r.value[c] || t.selected.push(t.data[c]);
}
}
}, o = () => {
if (t.selected)
for (let u = 0; u < t.selected.length; u++) {
const l = t.selected[u];
t.disabledRows.findIndex(
(f) => f === l[t.index || "id"]
) > -1 && t.selected.splice(u, 1);
}
}, a = () => {
if (t.selected) {
const u = t.index || "id";
for (let l = 0; l < t.selected.length; l++) {
const c = t.selected[l], f = t.data.findIndex(
(d) => d[u] === c[l][u]
);
f === -1 && t.selected.splice(f, 1);
}
}
}, s = L(() => {
if (t.selected) {
const u = t.selected, l = t.data.filter((c) => {
const f = t.index || "id";
return !t.disabledRows.includes(c[f]);
});
if (u.length >= l.length)
return !0;
}
return !1;
});
return {
toggleCheck: e,
isRowChecked: n,
isRowDisabled: r,
toggleGlobalCheck: i,
populateChecks: a,
isCheckedAll: s,
uncheckDisabledRows: o
};
}
function NH(t) {
const e = re([]);
return {
isRowOpen: L(() => t.data.map((i, o) => e.value.includes(o))),
toggleRow: (i) => {
e.value.includes(i) ? e.value = e.value.filter((o) => o !== i) : e.value.push(i);
}
};
}
const Re = Qt({
page: 1,
order: null,
filter: null,
search: "",
limit: 20,
reset: !0,
strict: !0
});
function c6(t, e) {
const n = (d, p = null) => {
const h = to();
e.store && (p ? h.order(e.store).set(d, p) : h.order(e.store).delete(d)), p ? Re.order ? Re.order[d] = p : Re.order = { [d]: p } : Re.order && Re.order[d] && delete Re.order[d], Re.reset = !0, Re.page = 1, t.emit("fetch", u.value);
}, r = (d) => {
const p = to();
e.store && p.limit(e.store).set(d), Re.limit = d, Re.reset = !0, Re.page = 1, t.emit("fetch", u.value);
}, i = (d, p) => {
const h = to();
e.store && (p !== null ? h.filter(e.store).set(d, p) : h.filter(e.store).delete(d)), p !== null ? Re.filter === null ? Re.filter = { [d]: p } : Re.filter[d] = p : p === null && Re.filter && Re.filter[d] && delete Re.filter[d], Re.reset = !0, Re.page = 1, t.emit("fetch", u.value);
}, o = (d) => {
const p = to();
e.store && p.strict(e.store).set(d), Re.strict = d, t.emit("fetch", u.value);
}, a = () => {
const d = to();
e.store && d.filter(e.store).reset(), Re.page = 1, Re.order = null, Re.filter = null, Re.reset = !0, Re.strict = !0, t.emit("fetch", u.value);
}, s = () => {
const d = to();
e.store && d.filter(e.store).reset(), Re.page = 1, Re.order = null, Re.filter = null, Re.reset = !0, Re.strict = !0;
}, u = L(() => {
let d = null;
if (e.requiredFilters) {
const p = structuredClone(e.requiredFilters);
d = f(
p,
Re.filter,
Re.strict
);
} else
d = f(null, Re.filter, Re.strict);
return {
page: Re.page,
limit: Re.limit,
order: Re.order,
filter: d,
reset: Re.reset
};
}), l = () => {
const d = to();
if (e.store) {
const p = d.get(e.store);
p && (Re.order = p.order, Re.limit = p.limit, Re.filter = p.filter, Re.strict = p.strict);
}
}, c = (d) => {
let p = [];
return Array.isArray(d) ? d.forEach((h) => {
p = p.concat(c(h));
}) : typeof d == "object" && Object.keys(d).forEach((h) => {
const m = d[h];
m && (h === "$and" || h === "$or" ? p = p.concat(
c(m)
) : p.push({
field: h,
value: m
}));
}), p;
}, f = (d = null, p = null, h = !0) => {
if (!d && !p)
return null;
if (d && !p)
return d;
if (!d && p)
return { [h ? "$and" : "$or"]: [p] };
if (d && p) {
["$and", "$or"].includes(Object.keys(d)[0]) || (d = { $and: [d] });
const m = c(d), v = [];
return Object.keys(p).forEach((y) => {
m.find((T) => T.field === y) || v.push({ [y]: p[y] });
}), d && v.length > 0 && (d.$and ? h ? d.$and.push({ $and: v }) : d.$and.push({ $or: v }) : d.$or && (h ? d.$or.push({ $and: v }) : d.$or.push({ $or: v }))), d;
}
};
return {
order: n,
loadStoreParams: l,
limit: r,
filter: i,
query: u,
resetFilters: a,
strict: o,
cleanTableFilters: s
};
}
const Nb = re(!1);
function PH(t, e) {
const { query: n } = c6(t, e), r = L(() => e.data.length < e.total), i = (f) => {
r.value && (Re.page += 1, Re.reset = f, t.emit("fetch", n.value));
}, o = (f) => {
r.value && Re.page > 1 && (Re.page -= 1, Re.reset = f, t.emit("fetch", n.value));
}, a = () => {
Re.page = 1, Re.reset = !0, t.emit("fetch", n.value);
}, s = () => {
Re.page = Math.ceil(e.total / e.data.length), Re.reset = !0, t.emit("fetch", n.value);
}, u = L(() => !!(e.loading || e.data.length >= e.total)), l = L(() => e.data);
return {
isMore: r,
loadMore: i,
loadLess: o,
busy: u,
data: l,
refresh: () => {
Re.page = 1, Re.reset = !0, t.emit("fetch", n.value);
},
loadFirst: a,
loadLast: s
};
}
const IH = be({
name: "KTableDate",
props: {
value: {
type: String,
default: ""
}
},
setup(t) {
const e = L(() => at(t.value).format("LL")), n = L(() => kE.ucfirst(at(t.value).fromNow()));
return { props: t, text: e, from: n };
}
});
function LH(t, e, n, r, i, o) {
const a = he("k-date");
return C(), oe(a, {
simple: "",
value: t.value
}, null, 8, ["value"]);
}
const RH = /* @__PURE__ */ $e(IH, [["render", LH]]), BH = be({
name: "KTableImage",
props: {
value: {
type: String,
default: ""
}
},
setup(t) {
const e = re();
return st(() => {
l6(e.value);
}), { props: t, img: e };
}
}), VH = "_image_1skvg_1", zH = {
image: VH
}, HH = ["src"];
function qH(t, e, n, r, i, o) {
return C(), P("div", {
class: se(["rounded-4", t.$style.image])
}, [
U("img", {
ref: "img",
src: t.value,
"data-zoom": ""
}, null, 8, HH)
], 2);
}
const FH = {
$style: zH
}, jH = /* @__PURE__ */ $e(BH, [["render", qH], ["__cssModules", FH]]), UH = be({
name: "KTableStatus",
props: {
value: {
type: [String, Boolean, Number],
default: ""
}
},
setup(t) {
const e = L(() => typeof t.value == "string" ? t.value !== "0" : typeof t.value == "boolean" ? t.value : typeof t.value == "number" ? !!t.value : !1);
return { props: t, status: e };
}
}), WH = { class: "badge badge-success" };
function YH(t, e, n, r, i, o) {
return C(), P("span", WH, [
U("i", {
class: se(["fad me-2", [t.status ? "fa-check" : "fa-times"]])
}, null, 2),
Oe(" " + Se(t.status ? "Activo" : "Inactivo"), 1)
]);
}
const KH = /* @__PURE__ */ $e(UH, [["render", YH]]), GH = be({
name: "KTablePrice",
props: {
value: {
type: [String, Number],
default: ""
}
},
setup() {
return {};
}
});
function JH(t, e, n, r, i, o) {
const a = he("k-price");
return C(), oe(a, { value: t.value }, null, 8, ["value"]);
}
const XH = /* @__PURE__ */ $e(GH, [["render", JH]]), QH = be({
name: "KTableCode",
components: {
KBadge: u6
},
props: {
value: {
type: [String, Number],
default: ""
}
},
setup() {
return {};
}
});
function ZH(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-badge");
return C(), oe(s, { size: "xs" }, {
default: ne(() => [
J(a, {
icon: "qrcode",
class: "mr-2"
}),
Oe(" " + Se(t.value), 1)
]),
_: 1
});
}
const eq = /* @__PURE__ */ $e(QH, [["render", ZH]]), tq = be({
name: "KTableOrderFilter",
props: {
value: {
type: [String, null],
default: null
}
},
emits: ["order"],
setup(t, e) {
return { order: (r = null) => {
e.emit("order", r);
} };
}
}), nq = { class: "inline-block" }, rq = { class: "inline-block" }, iq = { class: "inline-block" };
function oq(t, e, n, r, i, o) {
const a = he("k-button");
return t.value && t.value === "asc" ? (C(), P("span", {
key: 0,
class: "cursor-pointer",
onClick: e[0] || (e[0] = (s) => t.order(null))
}, [
X(t.$slots, "default"),
U("div", nq, [
J(a, {
size: "sm",
icon: "sort-up",
link: "",
color: "primary"
})
])
])) : t.value && t.value === "desc" ? (C(), P("span", {
key: 1,
class: "cursor-pointer",
onClick: e[1] || (e[1] = (s) => t.order("asc"))
}, [
X(t.$slots, "default"),
U("div", rq, [
J(a, {
size: "sm",
icon: "sort-down",
link: "",
color: "primary"
})
])
])) : (C(), P("span", {
key: 2,
class: "cursor-pointer",
onClick: e[2] || (e[2] = (s) => t.order("desc"))
}, [
X(t.$slots, "default"),
U("div", iq, [
J(a, {
size: "sm",
icon: "sort",
link: "",
color: "gray"
})
])
]));
}
const aq = /* @__PURE__ */ $e(tq, [["render", oq]]), sq = be({
name: "KTableLimit",
props: {
value: {
type: Number,
default: 20
},
loading: {
type: Boolean,
default: !1
},
type: {
type: String,
default: "infinite"
},
page: {
type: Number,
required: !0
},
total: {
type: Number,
required: !0
}
},
emits: ["limit", "loadMore", "next", "prev"],
setup(t, e) {
const n = re(!1), r = (o) => {
e.emit("limit", o);
}, i = L(() => t.page * t.value >= t.total);
return { limit: r, visible: n, isLastPage: i };
}
});
const uq = { class: "flex flex-row justify-center gap-4" }, lq = { key: 1 };
function cq(t, e, n, r, i, o) {
const a = he("k-button"), s = he("k-icon"), u = he("k-dropdown-menu"), l = he("k-dropdown");
return C(), P("div", uq, [
t.type === "infinite" ? (C(), oe(a, {
key: 0,
loading: t.loading,
disabled: t.loading,
onClick: e[0] || (e[0] = (c) => t.$emit("loadMore"))
}, {
default: ne(() => [
Oe(" Cargar más ")
]),
_: 1
}, 8, ["loading", "disabled"])) : F("", !0),
t.type === "manual" ? (C(), oe(a, {
key: 1,
icon: "chevrons-left",
disabled: t.loading || t.page <= 1,
onClick: e[1] || (e[1] = (c) => t.$emit("prev")),
color: "gray"
}, null, 8, ["disabled"])) : F("", !0),
J(l, { placement: "top" }, {
content: ne(() => [
J(u, {
selected: t.value === 10
}, {
default: ne(() => [
U("a", {
class: se(["dropdown-item p-3 cursor-pointer", { active: t.value === 10 }]),
onClick: e[2] || (e[2] = (c) => t.limit(10))
}, " 10 ", 2)
]),
_: 1
}, 8, ["selected"]),
J(u, {
selected: t.value === 20
}, {
default: ne(() => [
U("a", {
class: se(["dropdown-item p-3 cursor-pointer", { active: t.value === 20 }]),
onClick: e[3] || (e[3] = (c) => t.limit(20))
}, " 20 ", 2)
]),
_: 1
}, 8, ["selected"]),
J(u, {
selected: t.value === 30
}, {
default: ne(() => [
U("a", {
class: se(["dropdown-item p-3 cursor-pointer", { active: t.value === 30 }]),
onClick: e[4] || (e[4] = (c) => t.limit(30))
}, " 30 ", 2)
]),
_: 1
}, 8, ["selected"]),
J(u, {
selected: t.value === 50
}, {
default: ne(() => [
U("a", {
class: se(["dropdown-item p-3 cursor-pointer", { active: t.value === 50 }]),
onClick: e[5] || (e[5] = (c) => t.limit(50))
}, " 50 ", 2)
]),
_: 1
}, 8, ["selected"]),
J(u, {
selected: t.value === 100
}, {
default: ne(() => [
U("a", {
class: se(["dropdown-item p-3 cursor-pointer", { active: t.value === 100 }]),
onClick: e[6] || (e[6] = (c) => t.limit(100))
}, " 100 ", 2)
]),
_: 1
}, 8, ["selected"])
]),
default: ne(() => [
J(a, null, {
default: ne(() => [
t.type === "infinite" ? (C(), oe(s, {
key: 0,
icon: "ellipsis"
})) : (C(), P("span", lq, Se(t.page), 1))
]),
_: 1
})
]),
_: 1
}),
t.type === "manual" ? (C(), oe(a, {
key: 2,
icon: "chevrons-right",
color: "gray",
disabled: t.loading || t.isLastPage,
onClick: e[7] || (e[7] = (c) => t.$emit("next"))
}, null, 8, ["disabled"])) : F("", !0)
]);
}
const dq = /* @__PURE__ */ $e(sq, [["render", cq], ["__scopeId", "data-v-31d61f0d"]]), fq = be({
name: "KTableFilterSelect",
props: {
options: {
type: Object,
required: !0
},
value: {
type: Object,
default: null
},
modal: {
type: Boolean,
default: !1
}
},
emits: ["filter"],
setup(t, e) {
const n = re(), r = (c, f) => {
e.emit("filter", f === null ? null : { [c]: f });
}, i = () => {
var c;
e.emit("filter", null), (c = n.value) == null || c.hide();
}, o = (c) => {
if (typeof c == "string") {
const f = c.trim();
if (f === "true")
return !0;
if (f === "false")
return !1;
const d = Number(f);
return !isNaN(d) && f !== "" ? d : f;
}
return c;
}, a = (c, f) => {
const d = o(c), p = o(f);
return d === p;
}, s = L(() => {
var d;
const c = (d = t.value) == null ? void 0 : d.$in;
let f = [];
return typeof c == "string" ? f = c.split(",").map((p) => p.trim()).filter((p) => p !== "") : Array.isArray(c) ? f = c : c != null && (f = [c]), f.map((p) => {
const h = t.options.find((m) => a(m.value, p));
return h == null ? void 0 : h.value;
}).filter((p) => p !== void 0);
});
return { tooltip: n, filter: r, reset: i, active: s, isActive: (c) => s.value.some((f) => a(f, c)), toggleFilter: (c) => {
const f = [...s.value], d = f.findIndex((h) => a(h, c));
if (d === -1 ? f.push(c) : f.splice(d, 1), f.length === 0) {
r("$in", null);
return;
}
const p = f.map((h) => o(h));
if (p.length === 1) {
r("$in", p[0]);
return;
}
r("$in", p);
} };
}
}), pq = { class: "inline-block" }, hq = ["onClick"];
function mq(t, e, n, r, i, o) {
const a = he("k-button"), s = he("k-icon"), u = he("k-dropdown-menu"), l = he("k-dropdown"), c = he("k-select");
return t.modal ? (C(), oe(c, {
key: 1,
size: "sm",
option: t.options,
"close-on-select": !1,
"track-by": "value",
"label-by": "title"
}, {
option: ne(({ option: f }) => [
U("div", {
onClick: et((d) => t.toggleFilter(f.value), ["stop"])
}, [
f.icon ? (C(), oe(s, {
key: 0,
class: "mr-2",
icon: f.icon
}, null, 8, ["icon"])) : F("", !0),
Oe(" " + Se(f.title), 1)
], 8, hq)
]),
_: 1
}, 8, ["option"])) : (C(), oe(l, {
key: 0,
ref: "tooltip",
placement: "bottom",
"max-height": 200,
tag: "span",
"hide-on-click": ""
}, {
content: ne(() => [
J(u, {
onClick: e[0] || (e[0] = (f) => t.reset())
}, {
default: ne(() => [
J(s, {
class: "mr-2",
icon: "list"
}),
Oe(" Todo ")
]),
_: 1
}),
(C(!0), P(Ee, null, nt(t.options, (f, d) => (C(), oe(u, {
key: d,
selected: t.isActive(f.value),
onClick: et((p) => t.toggleFilter(f.value), ["stop"])
}, {
default: ne(() => [
f.icon ? (C(), oe(s, {
key: 0,
class: "mr-2",
icon: f.icon
}, null, 8, ["icon"])) : F("", !0),
Oe(" " + Se(f.title), 1)
]),
_: 2
}, 1032, ["selected", "onClick"]))), 128))
]),
default: ne(() => [
U("div", pq, [
J(a, {
size: "sm",
icon: "filter",
link: "",
color: t.active && t.active.length > 0 ? "primary" : "gray"
}, null, 8, ["color"])
])
]),
_: 1
}, 512));
}
const gq = /* @__PURE__ */ $e(fq, [["render", mq]]), bq = be({
name: "KTableFilterDate",
props: {
value: {
type: Object,
default: null
},
min: {
type: String,
default: ""
},
max: {
type: String,
default: at().format("YYYY-MM-DD")
},
modal: {
type: Boolean,
default: !1
}
},
emits: ["filter"],
setup(t, e) {
const n = re(), r = L(() => t.value && t.value.$gte && t.value.$lte ? [t.value.$gte, t.value.$lte] : "");
return { filter: (o) => {
var a;
if (!o || !o[0] || !o[1])
e.emit("filter", null);
else {
const s = {
$gte: `${o[0]} 00:00:00`,
$lte: `${o[1]} 23:59:59`
};
e.emit("filter", s), (a = n.value) == null || a.hide();
}
}, defaultValue: r, tooltip: n };
}
}), vq = { class: "inline-block" };
function yq(t, e, n, r, i, o) {
const a = he("k-button"), s = he("k-datepicker"), u = he("k-tooltip");
return t.modal ? (C(), oe(s, {
key: 1,
"min-date": t.min,
"max-date": t.max,
range: !0,
time: !1,
clearable: !0,
value: t.defaultValue,
size: "sm",
onChange: t.filter
}, null, 8, ["min-date", "max-date", "value", "onChange"])) : (C(), oe(u, {
key: 0,
ref: "tooltip",
interactive: "",
trigger: "click",
theme: "transparent",
arrow: !1,
"hide-on-click": "",
placement: "bottom",
"max-width": 400
}, {
content: ne(() => [
J(s, {
"min-date": t.min,
"max-date": t.max,
range: !0,
time: !1,
clearable: !0,
value: t.defaultValue,
inline: "",
onChange: t.filter
}, null, 8, ["min-date", "max-date", "value", "onChange"])
]),
default: ne(() => [
U("div", vq, [
J(a, {
size: "sm",
icon: "calendar",
link: "",
color: t.defaultValue ? "primary" : "gray"
}, null, 8, ["color"])
])
]),
_: 1
}, 512));
}
const wq = /* @__PURE__ */ $e(bq, [["render", yq]]), kq = be({
name: "KTableFilterRange",
props: {
value: {
type: Object,
default: null
},
min: {
type: Number,
default: 0
},
max: {
type: Number,
default: 100
}
},
emits: ["filter"],
setup(t, e) {
const n = on(), r = re("dropdown"), i = re([0, 0]), o = re(), a = () => {
const c = document.querySelector(`#${n}`);
c && (c.innerHTML = "");
};
st(() => {
a();
});
const s = L(() => t.value && t.value.$gte && t.value.$lte ? [t.value.$gte, t.value.$lte] : "");
return { id: n, dropdown: r, filter: () => {
const c = {
$gte: i.value[0],
$lte: i.value[1]
};
o.value.hide(), e.emit("filter", c);
}, defaultValue: s, reset: () => {
o.value.hide(), e.emit("filter", null);
} };
}
}), xq = { class: "flex items-center px-6 py-4" }, Sq = ["id"], Eq = { class: "ms-10 flex align-items-center" };
function _q(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip");
return C(), oe(s, null, {
content: ne(() => [
U("div", xq, [
U("div", {
id: `${t.id}`,
class: "noUi-target noUi-target-primary w-150px w-xxl-200px noUi-sm"
}, null, 8, Sq),
U("div", Eq, [
U("a", {
class: "text-danger cursor-pointer me-2 d-inline-flex",
onClick: e[0] || (e[0] = (...u) => t.reset && t.reset(...u))
}, [
J(a, {
icon: "square-xmark",
size: 1
})
]),
U("a", {
class: "text-success cursor-pointer d-inline-flex",
onClick: e[1] || (e[1] = (...u) => t.filter && t.filter(...u))
}, [
J(a, {
icon: "square-check",
size: 1
})
])
])
])
]),
default: ne(() => [
J(a, {
icon: "filter",
class: se([{ "text-primary": t.defaultValue }, "ml-2"])
}, null, 8, ["class"])
]),
_: 1
});
}
const Tq = /* @__PURE__ */ $e(kq, [["render", _q]]), Cq = be({
name: "KTableFilterText",
props: {
value: {
type: Object,
default: null
},
min: {
type: Number,
default: 0
},
max: {
type: Number,
default: 100
},
modal: {
type: Boolean,
default: !1
}
},
emits: ["filter"],
setup(t, e) {
const n = re(), r = re(""), i = re(!1), o = L(() => t.value && t.value.$like ? t.value.$like : "");
return st(() => {
t.value && t.value.$like && (r.value = t.value.$like);
}), { visible: i, tooltip: n, filter: () => {
var l;
const u = {
$like: r.value
};
e.emit("filter", u), (l = n.value) == null || l.hide();
}, defaultValue: o, reset: () => {
var u;
r.value = "", e.emit("filter", null), (u = n.value) == null || u.hide();
}, inputText: r };
}
}), Oq = { class: "inline-block" }, Aq = { class: "flex items-center" }, Mq = { class: "ml-4 flex items-center" }, Dq = {
key: 1,
class: "flex items-center"
}, $q = { class: "ml-4 flex items-center" };
function Nq(t, e, n, r, i, o) {
const a = he("k-button"), s = he("k-input"), u = he("k-tooltip");
return t.modal ? (C(), P("div", Dq, [
J(s, {
modelValue: t.inputText,
"onUpdate:modelValue": e[1] || (e[1] = (l) => t.inputText = l),
type: "text",
size: "sm",
width: 150,
placeholder: "Lorem ipsum",
onKeyup: He(t.filter, ["enter"])
}, null, 8, ["modelValue", "onKeyup"]),
U("div", $q, [
J(a, {
icon: "xmark",
color: "danger",
size: "sm",
title: "Resetear",
class: "mr-2",
onClick: t.reset
}, null, 8, ["onClick"]),
J(a, {
icon: "check",
color: "success",
size: "sm",
title: "Aplicar",
onClick: t.filter
}, null, 8, ["onClick"])
])
])) : (C(), oe(u, {
key: 0,
ref: "tooltip",
interactive: "",
trigger: "click",
theme: "filter",
arrow: !1,
"hide-on-click": "",
placement: "bottom",
"max-width": 400
}, {
content: ne(() => [
U("div", Aq, [
J(s, {
modelValue: t.inputText,
"onUpdate:modelValue": e[0] || (e[0] = (l) => t.inputText = l),
type: "text",
size: "sm",
width: 150,
placeholder: "Lorem ipsum",
onKeyup: He(t.filter, ["enter"])
}, null, 8, ["modelValue", "onKeyup"]),
U("div", Mq, [
J(a, {
icon: "xmark",
color: "danger",
size: "sm",
title: "Resetear",
class: "mr-2",
onClick: t.reset
}, null, 8, ["onClick"]),
J(a, {
icon: "check",
color: "success",
size: "sm",
title: "Aplicar",
onClick: t.filter
}, null, 8, ["onClick"])
])
])
]),
default: ne(() => [
U("div", Oq, [
J(a, {
size: "sm",
icon: "filter",
link: "",
color: t.defaultValue ? "primary" : "gray"
}, null, 8, ["color"])
])
]),
_: 1
}, 512));
}
const Pq = /* @__PURE__ */ $e(Cq, [["render", Nq]]), Iq = be({
name: "KTableFilterNumber",
props: {
value: {
type: Object,
default: null
},
min: {
type: Number,
default: 0
},
max: {
type: Number,
default: 0
},
modal: {
type: Boolean,
default: !1
}
},
emits: ["filter"],
setup(t, e) {
const n = on(), r = re(), i = re(), o = L(() => t.value && t.value.$eq ? t.value.$eq : "");
return st(() => {
t.value && t.value.$eq && (i.value = t.value.$eq);
}), {
id: n,
filter: () => {
var l;
const u = {
$eq: i.value
};
e.emit("filter", u), (l = r.value) == null || l.hide();
},
defaultValue: o,
reset: () => {
var u;
i.value = void 0, e.emit("filter", null), (u = r.value) == null || u.hide();
},
inputText: i,
tooltip: r
};
}
}), Lq = { class: "inline-block" }, Rq = { class: "flex items-center" }, Bq = { class: "ml-4 flex align-items-center" }, Vq = {
key: 1,
class: "flex items-center"
}, zq = { class: "ml-4 flex align-items-center" };
function Hq(t, e, n, r, i, o) {
const a = he("k-button"), s = he("k-input"), u = he("k-tooltip");
return t.modal ? (C(), P("div", Vq, [
J(s, {
modelValue: t.inputText,
"onUpdate:modelValue": e[1] || (e[1] = (l) => t.inputText = l),
type: "number",
size: "sm",
width: 90,
min: t.min,
max: t.max || void 0,
placeholder: "0",
onKeyup: He(t.filter, ["enter"])
}, null, 8, ["modelValue", "min", "max", "onKeyup"]),
U("div", zq, [
J(a, {
icon: "xmark",
color: "danger",
size: "sm",
title: "Resetear",
class: "mr-2",
onClick: t.reset
}, null, 8, ["onClick"]),
J(a, {
icon: "check",
color: "success",
size: "sm",
title: "Aplicar",
onClick: t.filter
}, null, 8, ["onClick"])
])
])) : (C(), oe(u, {
key: 0,
ref: "tooltip",
interactive: "",
trigger: "click",
theme: "filter",
arrow: !1,
"hide-on-click": "",
placement: "bottom"
}, {
content: ne(() => [
U("div", Rq, [
J(s, {
modelValue: t.inputText,
"onUpdate:modelValue": e[0] || (e[0] = (l) => t.inputText = l),
type: "number",
size: "sm",
width: 90,
min: t.min,
max: t.max || void 0,
placeholder: "0",
onKeyup: He(t.filter, ["enter"])
}, null, 8, ["modelValue", "min", "max", "onKeyup"]),
U("div", Bq, [
J(a, {
icon: "xmark",
color: "danger",
size: "sm",
title: "Resetear",
class: "mr-2",
onClick: t.reset
}, null, 8, ["onClick"]),
J(a, {
icon: "check",
color: "success",
size: "sm",
title: "Aplicar",
onClick: t.filter
}, null, 8, ["onClick"])
])
])
]),
default: ne(() => [
U("div", Lq, [
J(a, {
size: "sm",
icon: "filter",
link: "",
color: t.defaultValue ? "primary" : "gray"
}, null, 8, ["color"])
])
]),
_: 1
}, 512));
}
const qq = /* @__PURE__ */ $e(Iq, [["render", Hq]]), Fq = be({
name: "KTable",
autoload: !0,
components: {
KTableDate: RH,
KTableImage: jH,
KTableStatus: KH,
KTablePrice: XH,
KTableCode: eq,
KTableOrder: aq,
KTableLimit: dq,
KTableFilterSelect: gq,
KTableFilterDate: wq,
KTableFilterRange: Tq,
KTableFilterText: Pq,
KTableFilterNumber: qq
},
props: MH,
emits: ["fetch", "filter", "cleanFilters"],
setup(t, e) {
const n = (ce) => !!e.slots[ce], r = on(), i = Ht(), o = Op(), a = re(!1), { isRowOpen: s, toggleRow: u } = NH(t), { cols: l, colLength: c } = DH(t, e.slots), {
toggleCheck: f,
isRowChecked: d,
isRowDisabled: p,
toggleGlobalCheck: h,
populateChecks: m,
uncheckDisabledRows: v,
isCheckedAll: y
} = $H(t), {
isMore: k,
loadMore: T,
loadLess: b,
loadFirst: D,
loadLast: x,
busy: S,
data: _,
refresh: N
} = PH(e, t), {
order: R,
loadStoreParams: w,
limit: A,
filter: $,
query: I,
resetFilters: E,
strict: O,
cleanTableFilters: g
} = c6(e, t);
Ct(_, m, { deep: !0 }), Ct(p, v, { deep: !0 }), m(), w();
const M = L(() => {
const ce = i.get("isMobileView", !1), q = i.get("isTabletView", !1);
return !!(ce || q);
}), H = L(() => t.card === !0 || t.card === "auto" && M.value), z = () => {
E(), a.value = !1;
}, Y = (ce, q) => {
ce.url && o.push({
name: ce.url.name,
params: { id: q[ce.url.id] }
});
}, ee = () => {
e.emit("cleanFilters"), E();
};
return st(() => {
Nb.value = !0, e.emit("fetch", I.value), nr.on(`ktable_${t.store}_fetch`, () => {
e.emit("fetch", I.value);
}), nr.on(`ktable_${t.store}_next`, () => {
t.pagination === "infinite" ? T(!1) : T(!0);
}), nr.on(`ktable_${t.store}_prev`, () => {
t.pagination === "infinite" ? b(!1) : b(!0);
}), nr.on(`ktable_${t.store}_first`, () => {
D();
}), nr.on(`ktable_${t.store}_last`, () => {
x();
}), nr.on(`ktable_${t.store}_clean`, () => {
g();
});
}), jo(() => {
nr.off(`ktable_${t.store}_fetch`), nr.off(`ktable_${t.store}_next`), nr.off(`ktable_${t.store}_prev`), nr.off(`ktable_${t.store}_first`), nr.off(`ktable_${t.store}_last`), nr.off(`ktable_${t.store}_clean`);
}), {
hasSlot: n,
cols: l,
id: r,
refresh: N,
colLength: c,
toggleCheck: f,
isRowChecked: d,
isRowDisabled: p,
toggleGlobalCheck: h,
busy: S,
enable404: Nb,
isCheckedAll: y,
isMore: k,
loadMore: T,
loadLess: b,
isRowOpen: s,
toggleRow: u,
params: Re,
loadStoreParams: w,
order: R,
limit: A,
filter: $,
resetFilters: E,
strict: O,
query: I,
isMobile: M,
modalOpened: a,
cardMode: H,
resetAndClose: z,
goToUrl: Y,
resetTheFilters: ee
};
}
});
const kd = (t) => (Gb("data-v-755534d0"), t = t(), Jb(), t), jq = ["id"], Uq = { class: "k-table-header-left" }, Wq = { class: "whitespace-nowrap font-normal" }, Yq = { class: "k-table-header-toolbar" }, Kq = /* @__PURE__ */ kd(() => /* @__PURE__ */ U("div", { class: "mx-2" }, null, -1)), Gq = {
key: 0,
class: "flex z-40 absolute top-0 left-0 w-full h-full items-center justify-center bg-white bg-opacity-80 dark:bg-gray-900 dark:bg-opacity-80 cursor-progress"
}, Jq = { class: "k-table-content" }, Xq = { class: "k-table-tr k-table-head" }, Qq = {
key: 0,
class: "k-table-td"
}, Zq = { class: "k-checkbox-label" }, eF = ["checked"], tF = /* @__PURE__ */ kd(() => /* @__PURE__ */ U("div", { class: "check" }, [
/* @__PURE__ */ U("div", { class: "inside" })
], -1)), nF = { class: "k-table-tr" }, rF = {
key: 0,
class: "k-table-td w-6"
}, iF = { class: "k-checkbox-label" }, oF = ["checked", "disabled", "onChange"], aF = /* @__PURE__ */ kd(() => /* @__PURE__ */ U("div", { class: "check" }, [
/* @__PURE__ */ U("div", { class: "inside" })
], -1)), sF = { key: 6 }, uF = ["onClick"], lF = {
key: 1,
class: "k-table-td",
align: "right"
}, cF = ["onClick"], dF = {
key: 0,
class: "k-table-tr"
}, fF = ["colspan"], pF = {
key: 0,
class: "k-table-404"
}, hF = {
key: 3,
class: "card-footer text-center border-0 mt-8"
}, mF = /* @__PURE__ */ kd(() => /* @__PURE__ */ U("div", { class: "ml-auto" }, null, -1)), gF = { class: "flex flex-col -m-5" }, bF = {
key: 0,
class: "text-base border-b border-b-gray-100 dark:border-b-gray-700 last:border-0 uppercase font-bold p-5 flex flex-row justify-between items-center"
};
function vF(t, e, n, r, i, o) {
const a = he("k-title"), s = he("k-button"), u = he("k-icon"), l = he("k-table-order"), c = he("k-table-filter-select"), f = he("k-table-filter-date"), d = he("k-table-filter-range"), p = he("k-table-filter-text"), h = he("k-table-filter-number"), m = he("k-table-date"), v = he("k-table-image"), y = he("k-table-status"), k = he("k-table-price"), T = he("k-table-code"), b = he("k-table-limit"), D = he("k-drawer");
return C(), P("div", {
id: t.id,
class: se(["k-table", {
"k-table-infinite": t.pagination === "infinite"
}])
}, [
t.header ? (C(), P("div", {
key: 0,
class: se(["k-table-header", { "k-table-header-clean": t.clean }])
}, [
X(t.$slots, "header-left", {}, () => [
U("h3", Uq, [
J(a, {
size: 5,
bold: ""
}, {
subtitle: ne(() => [
X(t.$slots, "subtitle", {
selected: t.selected,
query: t.query
}, () => [
U("span", Wq, Se(t.total) + " registros ", 1)
], !0)
]),
default: ne(() => [
X(t.$slots, "title", {
selected: t.selected,
query: t.query
}, () => [
Oe(" Listado ")
], !0)
]),
_: 3
})
])
], !0),
U("div", Yq, [
X(t.$slots, "header-right", {
selected: t.selected,
query: t.query
}, void 0, !0),
Kq,
t.cardMode ? (C(), oe(s, {
key: 0,
icon: "filter",
color: t.query.filter ? "primary" : "gray",
title: "Filtrar",
loading: t.loading,
class: "mr-2",
onClick: e[0] || (e[0] = (x) => t.modalOpened = !0)
}, null, 8, ["color", "loading"])) : (C(), oe(s, {
key: 1,
icon: "filter-slash",
color: "gray",
title: "Limpiar filtros",
loading: t.loading,
class: "mr-2",
onClick: t.resetTheFilters
}, null, 8, ["loading", "onClick"])),
t.params.strict ? (C(), oe(s, {
key: 2,
icon: "object-intersect",
color: "gray",
title: "Filtro estricto",
loading: t.loading,
class: "mr-2",
onClick: e[1] || (e[1] = (x) => t.strict(!1))
}, null, 8, ["loading"])) : (C(), oe(s, {
key: 3,
icon: "object-union",
color: "gray",
title: "Filtro flexible",
loading: t.loading,
class: "mr-2",
onClick: e[2] || (e[2] = (x) => t.strict(!0))
}, null, 8, ["loading"])),
J(s, {
icon: "rotate",
color: "primary",
light: "",
title: "Refrescar",
loading: t.loading,
onClick: t.refresh
}, null, 8, ["loading", "onClick"])
])
], 2)) : F("", !0),
t.cardMode ? (C(), oe(Eo(t.cardTag), {
key: 1,
class: se(t.cardClasses)
}, {
default: ne(() => [
(C(!0), P(Ee, null, nt(t.data, (x, S) => X(t.$slots, "card", At(dt({ key: S }, {
row: x,
query: t.query,
index: S
})), void 0, !0)), 128))
]),
_: 3
}, 8, ["class"])) : (C(), P("div", {
key: 2,
class: se(["k-table-body", { "k-table-body-clean": t.clean }])
}, [
J(zn, {
name: "animated_fade",
"enter-active-class": "animate__animated animate__faster animate__fadeIn",
"leave-active-class": "animate__animated animate__faster animate__fadeOut"
}, {
default: ne(() => [
t.loading ? (C(), P("div", Gq, [
J(u, {
icon: "spinner-third",
spin: "",
class: "text-primary",
size: 40
})
])) : F("", !0)
]),
_: 1
}),
U("div", Jq, [
U("div", Xq, [
t.selected ? (C(), P("div", Qq, [
U("label", Zq, [
U("input", {
type: "checkbox",
class: "k-checkbox",
checked: t.isCheckedAll,
onChange: e[3] || (e[3] = (...x) => t.toggleGlobalCheck && t.toggleGlobalCheck(...x))
}, null, 40, eF),
tF
])
])) : F("", !0),
(C(!0), P(Ee, null, nt(t.cols, (x, S) => (C(), P("div", {
key: S,
style: Xe(x.style),
class: "k-table-td"
}, [
x.order && x.index ? (C(), oe(l, {
key: 0,
value: t.params.order && t.params.order[x.index] || null,
class: "-mr-3",
onOrder: (_) => t.order(x.index, _)
}, {
default: ne(() => [
Oe(Se(x.title), 1)
]),
_: 2
}, 1032, ["value", "onOrder"])) : (C(), P(Ee, { key: 1 }, [
Oe(Se(x.title), 1)
], 64)),
x.filter && x.index ? (C(), P(Ee, { key: 2 }, [
x.filter.type === "select" && x.filter.options.length > 0 ? (C(), oe(c, {
key: 0,
options: x.filter.options,
value: t.params.filter && t.params.filter[x.index] ? t.params.filter[x.index] : null,
onFilter: (_) => t.filter(x.index, _)
}, null, 8, ["options", "value", "onFilter"])) : x.filter.type === "date" ? (C(), oe(f, {
key: 1,
min: x.filter.min,
max: x.filter.max,
value: t.params.filter && t.params.filter[x.index] ? t.params.filter[x.index] : null,
onFilter: (_) => t.filter(x.index, _)
}, null, 8, ["min", "max", "value", "onFilter"])) : x.filter.type === "range" ? (C(), oe(d, {
key: 2,
min: x.filter.min,
max: x.filter.max,
value: t.params.filter && t.params.filter[x.index] ? t.params.filter[x.index] : null,
onFilter: (_) => t.filter(x.index, _)
}, null, 8, ["min", "max", "value", "onFilter"])) : x.filter.type === "text" ? (C(), oe(p, {
key: 3,
value: t.params.filter && t.params.filter[x.index] ? t.params.filter[x.index] : null,
onFilter: (_) => t.filter(x.index, _)
}, null, 8, ["value", "onFilter"])) : x.filter.type === "number" ? (C(), oe(h, {
key: 4,
min: x.filter.min,
max: x.filter.max,
value: t.params.filter && t.params.filter[x.index] ? t.params.filter[x.index] : null,
onFilter: (_) => t.filter(x.index, _)
}, null, 8, ["min", "max", "value", "onFilter"])) : F("", !0)
], 64)) : F("", !0)
], 4))), 128))
]),
(C(!0), P(Ee, null, nt(t.data, (x, S) => (C(), P(Ee, { key: S }, [
U("div", nF, [
t.selected ? (C(), P("div", rF, [
U("label", iF, [
U("input", {
type: "checkbox",
class: "k-checkbox",
checked: t.isRowChecked[S],
disabled: t.isRowDisabled[S],
onChange: (_) => t.toggleCheck(S)
}, null, 40, oF),
aF
])
])) : F("", !0),
(C(!0), P(Ee, null, nt(t.cols, (_, N) => (C(), P("div", {
key: N,
style: Xe(_.style),
class: "k-table-td"
}, [
_.makeup === "date" ? (C(), oe(m, {
key: 0,
value: x[_.index],
class: se({ "cursor-pointer": _.url }),
onClick: (R) => t.goToUrl(_, x)
}, null, 8, ["value", "class", "onClick"])) : _.makeup === "image" ? (C(), oe(v, {
key: 1,
value: x[_.index]
}, null, 8, ["value"])) : _.makeup === "status" ? (C(), oe(y, {
key: 2,
value: x[_.index],
class: se({ "cursor-pointer": _.url }),
onClick: (R) => t.goToUrl(_, x)
}, null, 8, ["value", "class", "onClick"])) : _.makeup === "price" ? (C(), oe(k, {
key: 3,
value: x[_.index],
class: se({ "cursor-pointer": _.url }),
onClick: (R) => t.goToUrl(_, x)
}, null, 8, ["value", "class", "onClick"])) : _.makeup === "code" ? (C(), oe(T, {
key: 4,
value: x[_.index],
class: se({ "cursor-pointer": _.url }),
onClick: (R) => t.goToUrl(_, x)
}, null, 8, ["value", "class", "onClick"])) : _.slot ? X(t.$slots, _.slot, At(dt({ key: 5 }, {
row: x,
value: x[_.index],
query: t.query,
index: S
})), void 0, !0) : (C(), P("div", sF, [
U("span", {
class: se({ "cursor-pointer": _.url }),
onClick: (R) => t.goToUrl(_, x)
}, Se(x[_.index]), 11, uF)
]))
], 4))), 128)),
t.hasSlot("content") ? (C(), P("div", lF, [
U("a", {
class: "btn btn-icon btn-gray-300 cursor-pointer",
onClick: (_) => t.toggleRow(S)
}, [
U("i", {
class: se([
t.isRowOpen[S] ? "fa-chevron-up" : "fa-chevron-down",
"fas"
])
}, null, 2)
], 8, cF)
])) : F("", !0)
]),
t.hasSlot("content") ? Qe((C(), P("tr", dF, [
U("td", { colspan: t.colLength }, [
X(t.$slots, "content", {
row: x,
query: t.query,
index: S
}, void 0, !0)
], 8, fF)
], 512)), [
[xn, t.isRowOpen[S]]
]) : F("", !0)
], 64))), 128))
]),
t.enable404 && !t.loading && t.data.length <= 0 ? (C(), P("div", pF, [
J(u, {
icon: "binary-slash",
type: "fad",
class: "mb-6 text-6xl"
}),
J(a, {
tag: "h3",
size: 4,
bold: "",
center: "",
class: "text-gray-600"
}, {
default: ne(() => [
Oe(" Sin resultados ")
]),
_: 1
}),
J(a, {
tag: "h4",
size: 6,
center: "",
class: "text-gray-600"
}, {
default: ne(() => [
Oe(" Prueba con una consulta diferente ")
]),
_: 1
})
])) : F("", !0)
], 2)),
t.isMore ? (C(), P("div", hF, [
J(b, {
loading: t.loading,
value: t.params.limit,
type: t.pagination,
page: t.params.page,
total: t.total,
onLimit: t.limit,
onLoadMore: e[4] || (e[4] = (x) => t.loadMore(!1)),
onNext: e[5] || (e[5] = (x) => t.loadMore(!0)),
onPrev: e[6] || (e[6] = (x) => t.loadLess(!0))
}, null, 8, ["loading", "value", "type", "page", "total", "onLimit"])
])) : F("", !0),
J(D, {
modelValue: t.modalOpened,
"onUpdate:modelValue": e[8] || (e[8] = (x) => t.modalOpened = x),
title: "Filtros",
width: 400
}, {
footer: ne(() => [
mF,
J(s, {
icon: "filter-slash",
color: "danger",
class: "mr-2",
onClick: t.resetAndClose
}, {
default: ne(() => [
Oe(" Resetear ")
]),
_: 1
}, 8, ["onClick"]),
J(s, {
icon: "filter",
color: "primary",
onClick: e[7] || (e[7] = (x) => t.modalOpened = !1)
}, {
default: ne(() => [
Oe(" Guardar ")
]),
_: 1
})
]),
default: ne(() => [
U("div", gF, [
(C(!0), P(Ee, null, nt(t.cols, (x, S) => (C(), P(Ee, { key: S }, [
x.order || x.filter ? (C(), P("div", bF, [
x.order && x.index ? (C(), oe(l, {
key: 0,
value: t.params.order && t.params.order[x.index] || null,
onOrder: (_) => t.order(x.index, _)
}, {
default: ne(() => [
Oe(Se(x.title), 1)
]),
_: 2
}, 1032, ["value", "onOrder"])) : (C(), P(Ee, { key: 1 }, [
Oe(Se(x.title), 1)
], 64)),
x.filter && x.index ? (C(), P(Ee, { key: 2 }, [
x.filter.type === "select" && x.filter.options.length > 0 ? (C(), oe(c, {
key: 0,
options: x.filter.options,
value: t.params.filter && t.params.filter[x.index] ? t.params.filter[x.index] : null,
modal: "",
onFilter: (_) => t.filter(x.index, _)
}, null, 8, ["options", "value", "onFilter"])) : x.filter.type === "date" ? (C(), oe(f, {
key: 1,
min: x.filter.min,
max: x.filter.max,
value: t.params.filter && t.params.filter[x.index] ? t.params.filter[x.index] : null,
modal: "",
onFilter: (_) => t.filter(x.index, _)
}, null, 8, ["min", "max", "value", "onFilter"])) : x.filter.type === "range" ? (C(), oe(d, {
key: 2,
min: x.filter.min,
max: x.filter.max,
value: t.params.filter && t.params.filter[x.index] ? t.params.filter[x.index] : null,
modal: "",
onFilter: (_) => t.filter(x.index, _)
}, null, 8, ["min", "max", "value", "onFilter"])) : x.filter.type === "text" ? (C(), oe(p, {
key: 3,
value: t.params.filter && t.params.filter[x.index] ? t.params.filter[x.index] : null,
modal: "",
onFilter: (_) => t.filter(x.index, _)
}, null, 8, ["value", "onFilter"])) : x.filter.type === "number" ? (C(), oe(h, {
key: 4,
min: x.filter.min,
max: x.filter.max,
value: t.params.filter && t.params.filter[x.index] ? t.params.filter[x.index] : null,
modal: "",
onFilter: (_) => t.filter(x.index, _)
}, null, 8, ["min", "max", "value", "onFilter"])) : F("", !0)
], 64)) : F("", !0)
])) : F("", !0)
], 64))), 128))
])
]),
_: 1
}, 8, ["modelValue"])
], 10, jq);
}
const yF = /* @__PURE__ */ $e(Fq, [["render", vF], ["__scopeId", "data-v-755534d0"]]), wF = be({
name: "KDate",
autoload: !0,
props: {
value: {
type: [Array, String],
default: "",
description: "Valor del campo"
},
simple: {
type: Boolean,
default: !1,
description: "Arroja menos datos"
}
},
setup(t) {
const e = L(() => !!Array.isArray(t.value)), n = L(() => e.value ? at(t.value[0]).format("LL") : at(t.value.toString()).format("LL")), r = L(() => e.value ? at(t.value[1]).format("LL") : at(t.value.toString()).fromNow()), i = L(() => Array.isArray(t.value) ? at(t.value[0]).format("YYYY-MM-DD HH:mm:ss") + " - " + at(t.value[1]).format("YYYY-MM-DD HH:mm:ss") : at(t.value).format("YYYY-MM-DD HH:mm:ss"));
return { props: t, text: n, from: r, isMultiple: e, tippyText: i };
}
}), kF = { class: "flex flex-row items-center" }, xF = {
key: 0,
class: "text-left flex flex-col"
}, SF = {
key: 0,
class: "opacity-40"
}, EF = {
key: 1,
class: "text-left flex flex-col"
}, _F = {
key: 0,
class: "opacity-40"
}, TF = {
key: 1,
class: "text-left flex flex-col"
}, CF = {
key: 0,
class: "opacity-40"
};
function OF(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip"), u = he("k-badge");
return C(), oe(u, {
size: "xs",
color: "primary"
}, {
default: ne(() => [
J(s, { content: t.tippyText }, {
default: ne(() => [
U("div", kF, [
J(a, {
icon: "clock",
class: se(t.simple ? "text-xs mr-2" : "text-xl mr-4")
}, null, 8, ["class"]),
t.value ? (C(), P(Ee, { key: 0 }, [
t.isMultiple ? (C(), P("div", xF, [
Oe(Se(t.text) + " ", 1),
t.simple ? F("", !0) : (C(), P("span", SF, Se(t.from), 1))
])) : (C(), P("div", EF, [
Oe(Se(t.text) + " ", 1),
t.simple ? F("", !0) : (C(), P("span", _F, Se(t.from), 1))
]))
], 64)) : (C(), P("div", TF, [
Oe(" Sin definir "),
t.simple ? F("", !0) : (C(), P("span", CF, " ??? "))
]))
])
]),
_: 1
}, 8, ["content"])
]),
_: 1
});
}
const AF = /* @__PURE__ */ $e(wF, [["render", OF]]), MF = be({
name: "KCard",
props: {
bordered: {
type: Boolean,
default: !1
},
shadow: {
type: Boolean,
default: !0
},
loading: {
type: Boolean,
default: !1
}
},
setup(t, { slots: e }) {
const n = (i) => !!e[i], r = L(() => {
let i = ["k-card"];
return t.bordered && i.push("border border-gray-200"), t.shadow && i.push("shadow-xl"), i;
});
return { hasSlot: n, classes: r };
}
});
const DF = {
key: 0,
class: "flex z-50 absolute top-0 left-0 w-full h-full items-center justify-center bg-white bg-opacity-80 dark:bg-gray-900 dark:bg-opacity-80 cursor-progress"
}, $F = {
key: 0,
class: "k-card-header"
}, NF = { class: "k-card-body" }, PF = {
key: 1,
class: "k-card-footer"
};
function IF(t, e, n, r, i, o) {
const a = he("k-icon");
return C(), P("div", {
class: se(t.classes)
}, [
J(zn, {
name: "animated_fade",
"enter-active-class": "animate__animated animate__faster animate__fadeIn",
"leave-active-class": "animate__animated animate__faster animate__fadeOut"
}, {
default: ne(() => [
t.loading ? (C(), P("div", DF, [
J(a, {
icon: "spinner-third",
spin: "",
class: "text-primary",
size: 40
})
])) : F("", !0)
]),
_: 1
}),
t.hasSlot("header") ? (C(), P("div", $F, [
X(t.$slots, "header", {}, void 0, !0)
])) : F("", !0),
U("div", NF, [
X(t.$slots, "default", {}, void 0, !0)
]),
t.hasSlot("footer") ? (C(), P("div", PF, [
X(t.$slots, "footer", {}, void 0, !0)
])) : F("", !0)
], 2);
}
const LF = /* @__PURE__ */ $e(MF, [["render", IF], ["__scopeId", "data-v-b12f1b87"]]);
process.env.NODE_ENV !== "production" && Object.freeze({});
process.env.NODE_ENV !== "production" && Object.freeze([]);
const RF = () => {
}, d6 = Object.assign, BF = Array.isArray, VF = (t) => typeof t == "function", zF = (t) => typeof t == "symbol";
let HF;
function qF(t, e = HF) {
e && e.active && e.effects.push(t);
}
const Pb = (t) => {
const e = new Set(t);
return e.w = 0, e.n = 0, e;
}, f6 = (t) => (t.w & Hi) > 0, p6 = (t) => (t.n & Hi) > 0, FF = ({ deps: t }) => {
if (t.length)
for (let e = 0; e < t.length; e++)
t[e].w |= Hi;
}, jF = (t) => {
const { deps: e } = t;
if (e.length) {
let n = 0;
for (let r = 0; r < e.length; r++) {
const i = e[r];
f6(i) && !p6(i) ? i.delete(t) : e[n++] = i, i.w &= ~Hi, i.n &= ~Hi;
}
e.length = n;
}
};
let gs = 0, Hi = 1;
const np = 30;
let Un;
Symbol(process.env.NODE_ENV !== "production" ? "iterate" : "");
Symbol(process.env.NODE_ENV !== "production" ? "Map key iterate" : "");
class UF {
constructor(e, n = null, r) {
this.fn = e, this.scheduler = n, this.active = !0, this.deps = [], this.parent = void 0, qF(this, r);
}
run() {
if (!this.active)
return this.fn();
let e = Un, n = El;
for (; e; ) {
if (e === this)
return;
e = e.parent;
}
try {
return this.parent = Un, Un = this, El = !0, Hi = 1 << ++gs, gs <= np ? FF(this) : Ib(this), this.fn();
} finally {
gs <= np && jF(this), Hi = 1 << --gs, Un = this.parent, El = n, this.parent = void 0, this.deferStop && this.stop();
}
}
stop() {
Un === this ? this.deferStop = !0 : this.active && (Ib(this), this.onStop && this.onStop(), this.active = !1);
}
}
function Ib(t) {
const { deps: e } = t;
if (e.length) {
for (let n = 0; n < e.length; n++)
e[n].delete(t);
e.length = 0;
}
}
let El = !0;
function Lb(t, e) {
let n = !1;
gs <= np ? p6(t) || (t.n |= Hi, n = !f6(t)) : n = !t.has(Un), n && (t.add(Un), Un.deps.push(t), process.env.NODE_ENV !== "production" && Un.onTrack && Un.onTrack(
d6(
{
effect: Un
},
e
)
));
}
function Rb(t, e) {
const n = BF(t) ? t : [...t];
for (const r of n)
r.computed && Bb(r, e);
for (const r of n)
r.computed || Bb(r, e);
}
function Bb(t, e) {
(t !== Un || t.allowRecurse) && (process.env.NODE_ENV !== "production" && t.onTrigger && t.onTrigger(d6({ effect: t }, e)), t.scheduler ? t.scheduler() : t.run());
}
new Set(
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((t) => t !== "arguments" && t !== "caller").map((t) => Symbol[t]).filter(zF)
);
function xd(t) {
const e = t && t.__v_raw;
return e ? xd(e) : t;
}
function WF(t) {
El && Un && (t = xd(t), process.env.NODE_ENV !== "production" ? Lb(t.dep || (t.dep = Pb()), {
target: t,
type: "get",
key: "value"
}) : Lb(t.dep || (t.dep = Pb())));
}
function YF(t, e) {
t = xd(t);
const n = t.dep;
n && (process.env.NODE_ENV !== "production" ? Rb(n, {
target: t,
type: "set",
key: "value",
newValue: e
}) : Rb(n));
}
class KF {
constructor(e, n, r, i) {
this._setter = n, this.dep = void 0, this.__v_isRef = !0, this.__v_isReadonly = !1, this._dirty = !0, this.effect = new UF(e, () => {
this._dirty || (this._dirty = !0, YF(this));
}), this.effect.computed = this, this.effect.active = this._cacheable = !i, this.__v_isReadonly = r;
}
get value() {
const e = xd(this);
return WF(e), (e._dirty || !e._cacheable) && (e._dirty = !1, e._value = e.effect.run()), e._value;
}
set value(e) {
this._setter(e);
}
}
function Vb(t, e, n = !1) {
let r, i;
const o = VF(t);
o ? (r = t, i = process.env.NODE_ENV !== "production" ? () => {
console.warn("Write operation failed: computed value is readonly");
} : RF) : (r = t.get, i = t.set);
const a = new KF(r, i, o || !i, n);
return process.env.NODE_ENV !== "production" && e && !n && (a.effect.onTrack = e.onTrack, a.effect.onTrigger = e.onTrigger), a;
}
var GF = (
/** @class */
function() {
function t(e, n) {
n === void 0 && (n = []), this._eventType = e, this._eventFunctions = n;
}
return t.prototype.init = function() {
var e = this;
this._eventFunctions.forEach(function(n) {
typeof window < "u" && window.addEventListener(e._eventType, n);
});
}, t;
}()
), Cc = globalThis && globalThis.__assign || function() {
return Cc = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Cc.apply(this, arguments);
}, Oc = {
alwaysOpen: !1,
activeClasses: "bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",
inactiveClasses: "text-gray-500 dark:text-gray-400",
onOpen: function() {
},
onClose: function() {
},
onToggle: function() {
}
}, Lh = (
/** @class */
function() {
function t(e, n) {
e === void 0 && (e = []), n === void 0 && (n = Oc), this._items = e, this._options = Cc(Cc({}, Oc), n), this._init();
}
return t.prototype._init = function() {
var e = this;
this._items.length && this._items.map(function(n) {
n.active && e.open(n.id), n.triggerEl.addEventListener("click", function() {
e.toggle(n.id);
});
});
}, t.prototype.getItem = function(e) {
return this._items.filter(function(n) {
return n.id === e;
})[0];
}, t.prototype.open = function(e) {
var n, r, i = this, o = this.getItem(e);
this._options.alwaysOpen || this._items.map(function(a) {
var s, u;
a !== o && ((s = a.triggerEl.classList).remove.apply(s, i._options.activeClasses.split(" ")), (u = a.triggerEl.classList).add.apply(u, i._options.inactiveClasses.split(" ")), a.targetEl.classList.add("hidden"), a.triggerEl.setAttribute("aria-expanded", "false"), a.active = !1, a.iconEl && a.iconEl.classList.remove("rotate-180"));
}), (n = o.triggerEl.classList).add.apply(n, this._options.activeClasses.split(" ")), (r = o.triggerEl.classList).remove.apply(r, this._options.inactiveClasses.split(" ")), o.triggerEl.setAttribute("aria-expanded", "true"), o.targetEl.classList.remove("hidden"), o.active = !0, o.iconEl && o.iconEl.classList.add("rotate-180"), this._options.onOpen(this, o);
}, t.prototype.toggle = function(e) {
var n = this.getItem(e);
n.active ? this.close(e) : this.open(e), this._options.onToggle(this, n);
}, t.prototype.close = function(e) {
var n, r, i = this.getItem(e);
(n = i.triggerEl.classList).remove.apply(n, this._options.activeClasses.split(" ")), (r = i.triggerEl.classList).add.apply(r, this._options.inactiveClasses.split(" ")), i.targetEl.classList.add("hidden"), i.triggerEl.setAttribute("aria-expanded", "false"), i.active = !1, i.iconEl && i.iconEl.classList.remove("rotate-180"), this._options.onClose(this, i);
}, t;
}()
);
function Rh() {
document.querySelectorAll("[data-accordion]").forEach(function(t) {
var e = t.getAttribute("data-accordion"), n = t.getAttribute("data-active-classes"), r = t.getAttribute("data-inactive-classes"), i = [];
t.querySelectorAll("[data-accordion-target]").forEach(function(o) {
if (o.closest("[data-accordion]") === t) {
var a = {
id: o.getAttribute("data-accordion-target"),
triggerEl: o,
targetEl: document.querySelector(o.getAttribute("data-accordion-target")),
iconEl: o.querySelector("[data-accordion-icon]"),
active: o.getAttribute("aria-expanded") === "true"
};
i.push(a);
}
}), new Lh(i, {
alwaysOpen: e === "open",
activeClasses: n || Oc.activeClasses,
inactiveClasses: r || Oc.inactiveClasses
});
});
}
typeof window < "u" && (window.Accordion = Lh, window.initAccordions = Rh);
var Ac = globalThis && globalThis.__assign || function() {
return Ac = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Ac.apply(this, arguments);
}, zb = {
onCollapse: function() {
},
onExpand: function() {
},
onToggle: function() {
}
}, h6 = (
/** @class */
function() {
function t(e, n, r) {
e === void 0 && (e = null), n === void 0 && (n = null), r === void 0 && (r = zb), this._targetEl = e, this._triggerEl = n, this._options = Ac(Ac({}, zb), r), this._visible = !1, this._init();
}
return t.prototype._init = function() {
var e = this;
this._triggerEl && (this._triggerEl.hasAttribute("aria-expanded") ? this._visible = this._triggerEl.getAttribute("aria-expanded") === "true" : this._visible = !this._targetEl.classList.contains("hidden"), this._triggerEl.addEventListener("click", function() {
e.toggle();
}));
}, t.prototype.collapse = function() {
this._targetEl.classList.add("hidden"), this._triggerEl && this._triggerEl.setAttribute("aria-expanded", "false"), this._visible = !1, this._options.onCollapse(this);
}, t.prototype.expand = function() {
this._targetEl.classList.remove("hidden"), this._triggerEl && this._triggerEl.setAttribute("aria-expanded", "true"), this._visible = !0, this._options.onExpand(this);
}, t.prototype.toggle = function() {
this._visible ? this.collapse() : this.expand(), this._options.onToggle(this);
}, t;
}()
);
function Bh() {
document.querySelectorAll("[data-collapse-toggle]").forEach(function(t) {
var e = t.getAttribute("data-collapse-toggle"), n = document.getElementById(e);
n ? new h6(n, t) : console.error('The target element with id "'.concat(e, '" does not exist. Please check the data-collapse-toggle attribute.'));
});
}
typeof window < "u" && (window.Collapse = h6, window.initCollapses = Bh);
var bo = globalThis && globalThis.__assign || function() {
return bo = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, bo.apply(this, arguments);
}, _l = {
defaultPosition: 0,
indicators: {
items: [],
activeClasses: "bg-white dark:bg-gray-800",
inactiveClasses: "bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800"
},
interval: 3e3,
onNext: function() {
},
onPrev: function() {
},
onChange: function() {
}
}, m6 = (
/** @class */
function() {
function t(e, n) {
e === void 0 && (e = []), n === void 0 && (n = _l), this._items = e, this._options = bo(bo(bo({}, _l), n), { indicators: bo(bo({}, _l.indicators), n.indicators) }), this._activeItem = this.getItem(this._options.defaultPosition), this._indicators = this._options.indicators.items, this._intervalDuration = this._options.interval, this._intervalInstance = null, this._init();
}
return t.prototype._init = function() {
var e = this;
this._items.map(function(n) {
n.el.classList.add("absolute", "inset-0", "transition-transform", "transform");
}), this._getActiveItem() ? this.slideTo(this._getActiveItem().position) : this.slideTo(0), this._indicators.map(function(n, r) {
n.el.addEventListener("click", function() {
e.slideTo(r);
});
});
}, t.prototype.getItem = function(e) {
return this._items[e];
}, t.prototype.slideTo = function(e) {
var n = this._items[e], r = {
left: n.position === 0 ? this._items[this._items.length - 1] : this._items[n.position - 1],
middle: n,
right: n.position === this._items.length - 1 ? this._items[0] : this._items[n.position + 1]
};
this._rotate(r), this._setActiveItem(n), this._intervalInstance && (this.pause(), this.cycle()), this._options.onChange(this);
}, t.prototype.next = function() {
var e = this._getActiveItem(), n = null;
e.position === this._items.length - 1 ? n = this._items[0] : n = this._items[e.position + 1], this.slideTo(n.position), this._options.onNext(this);
}, t.prototype.prev = function() {
var e = this._getActiveItem(), n = null;
e.position === 0 ? n = this._items[this._items.length - 1] : n = this._items[e.position - 1], this.slideTo(n.position), this._options.onPrev(this);
}, t.prototype._rotate = function(e) {
this._items.map(function(n) {
n.el.classList.add("hidden");
}), e.left.el.classList.remove("-translate-x-full", "translate-x-full", "translate-x-0", "hidden", "z-20"), e.left.el.classList.add("-translate-x-full", "z-10"), e.middle.el.classList.remove("-translate-x-full", "translate-x-full", "translate-x-0", "hidden", "z-10"), e.middle.el.classList.add("translate-x-0", "z-20"), e.right.el.classList.remove("-translate-x-full", "translate-x-full", "translate-x-0", "hidden", "z-20"), e.right.el.classList.add("translate-x-full", "z-10");
}, t.prototype.cycle = function() {
var e = this;
typeof window < "u" && (this._intervalInstance = window.setInterval(function() {
e.next();
}, this._intervalDuration));
}, t.prototype.pause = function() {
clearInterval(this._intervalInstance);
}, t.prototype._getActiveItem = function() {
return this._activeItem;
}, t.prototype._setActiveItem = function(e) {
var n, r, i = this;
this._activeItem = e;
var o = e.position;
this._indicators.length && (this._indicators.map(function(a) {
var s, u;
a.el.setAttribute("aria-current", "false"), (s = a.el.classList).remove.apply(s, i._options.indicators.activeClasses.split(" ")), (u = a.el.classList).add.apply(u, i._options.indicators.inactiveClasses.split(" "));
}), (n = this._indicators[o].el.classList).add.apply(n, this._options.indicators.activeClasses.split(" ")), (r = this._indicators[o].el.classList).remove.apply(r, this._options.indicators.inactiveClasses.split(" ")), this._indicators[o].el.setAttribute("aria-current", "true"));
}, t;
}()
);
function Vh() {
document.querySelectorAll("[data-carousel]").forEach(function(t) {
var e = t.getAttribute("data-carousel-interval"), n = t.getAttribute("data-carousel") === "slide", r = [], i = 0;
t.querySelectorAll("[data-carousel-item]").length && Array.from(t.querySelectorAll("[data-carousel-item]")).map(function(l, c) {
r.push({
position: c,
el: l
}), l.getAttribute("data-carousel-item") === "active" && (i = c);
});
var o = [];
t.querySelectorAll("[data-carousel-slide-to]").length && Array.from(t.querySelectorAll("[data-carousel-slide-to]")).map(function(l) {
o.push({
position: parseInt(l.getAttribute("data-carousel-slide-to")),
el: l
});
});
var a = new m6(r, {
defaultPosition: i,
indicators: {
items: o
},
interval: e || _l.interval
});
n && a.cycle();
var s = t.querySelector("[data-carousel-next]"), u = t.querySelector("[data-carousel-prev]");
s && s.addEventListener("click", function() {
a.next();
}), u && u.addEventListener("click", function() {
a.prev();
});
});
}
typeof window < "u" && (window.Carousel = m6, window.initCarousels = Vh);
var Mc = globalThis && globalThis.__assign || function() {
return Mc = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Mc.apply(this, arguments);
}, Hb = {
transition: "transition-opacity",
duration: 300,
timing: "ease-out",
onHide: function() {
}
}, g6 = (
/** @class */
function() {
function t(e, n, r) {
e === void 0 && (e = null), n === void 0 && (n = null), r === void 0 && (r = Hb), this._targetEl = e, this._triggerEl = n, this._options = Mc(Mc({}, Hb), r), this._init();
}
return t.prototype._init = function() {
var e = this;
this._triggerEl && this._triggerEl.addEventListener("click", function() {
e.hide();
});
}, t.prototype.hide = function() {
var e = this;
this._targetEl.classList.add(this._options.transition, "duration-".concat(this._options.duration), this._options.timing, "opacity-0"), setTimeout(function() {
e._targetEl.classList.add("hidden");
}, this._options.duration), this._options.onHide(this, this._targetEl);
}, t;
}()
);
function zh() {
document.querySelectorAll("[data-dismiss-target]").forEach(function(t) {
var e = t.getAttribute("data-dismiss-target"), n = document.querySelector(e);
n ? new g6(n, t) : console.error('The dismiss element with id "'.concat(e, '" does not exist. Please check the data-dismiss-target attribute.'));
});
}
typeof window < "u" && (window.Dismiss = g6, window.initDismisses = zh);
var Ei = globalThis && globalThis.__assign || function() {
return Ei = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Ei.apply(this, arguments);
}, Zu = globalThis && globalThis.__spreadArray || function(t, e, n) {
if (n || arguments.length === 2)
for (var r = 0, i = e.length, o; r < i; r++)
(o || !(r in e)) && (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
return t.concat(o || Array.prototype.slice.call(e));
}, _i = {
placement: "bottom",
triggerType: "click",
offsetSkidding: 0,
offsetDistance: 10,
delay: 300,
ignoreClickOutsideClass: !1,
onShow: function() {
},
onHide: function() {
},
onToggle: function() {
}
}, b6 = (
/** @class */
function() {
function t(e, n, r) {
e === void 0 && (e = null), n === void 0 && (n = null), r === void 0 && (r = _i), this._targetEl = e, this._triggerEl = n, this._options = Ei(Ei({}, _i), r), this._popperInstance = this._createPopperInstance(), this._visible = !1, this._init();
}
return t.prototype._init = function() {
this._triggerEl && this._setupEventListeners();
}, t.prototype._setupEventListeners = function() {
var e = this, n = this._getTriggerEvents();
this._options.triggerType === "click" && n.showEvents.forEach(function(r) {
e._triggerEl.addEventListener(r, function() {
e.toggle();
});
}), this._options.triggerType === "hover" && (n.showEvents.forEach(function(r) {
e._triggerEl.addEventListener(r, function() {
r === "click" ? e.toggle() : setTimeout(function() {
e.show();
}, e._options.delay);
}), e._targetEl.addEventListener(r, function() {
e.show();
});
}), n.hideEvents.forEach(function(r) {
e._triggerEl.addEventListener(r, function() {
setTimeout(function() {
e._targetEl.matches(":hover") || e.hide();
}, e._options.delay);
}), e._targetEl.addEventListener(r, function() {
setTimeout(function() {
e._triggerEl.matches(":hover") || e.hide();
}, e._options.delay);
});
}));
}, t.prototype._createPopperInstance = function() {
return Hc(this._triggerEl, this._targetEl, {
placement: this._options.placement,
modifiers: [
{
name: "offset",
options: {
offset: [
this._options.offsetSkidding,
this._options.offsetDistance
]
}
}
]
});
}, t.prototype._setupClickOutsideListener = function() {
var e = this;
this._clickOutsideEventListener = function(n) {
e._handleClickOutside(n, e._targetEl);
}, document.body.addEventListener("click", this._clickOutsideEventListener, !0);
}, t.prototype._removeClickOutsideListener = function() {
document.body.removeEventListener("click", this._clickOutsideEventListener, !0);
}, t.prototype._handleClickOutside = function(e, n) {
var r = e.target, i = this._options.ignoreClickOutsideClass, o = !1;
if (i) {
var a = document.querySelectorAll(".".concat(i));
a.forEach(function(s) {
if (s.contains(r)) {
o = !0;
return;
}
});
}
r !== n && !n.contains(r) && !this._triggerEl.contains(r) && !o && this.isVisible() && this.hide();
}, t.prototype._getTriggerEvents = function() {
switch (this._options.triggerType) {
case "hover":
return {
showEvents: ["mouseenter", "click"],
hideEvents: ["mouseleave"]
};
case "click":
return {
showEvents: ["click"],
hideEvents: []
};
case "none":
return {
showEvents: [],
hideEvents: []
};
default:
return {
showEvents: ["click"],
hideEvents: []
};
}
}, t.prototype.toggle = function() {
this.isVisible() ? this.hide() : this.show(), this._options.onToggle(this);
}, t.prototype.isVisible = function() {
return this._visible;
}, t.prototype.show = function() {
this._targetEl.classList.remove("hidden"), this._targetEl.classList.add("block"), this._popperInstance.setOptions(function(e) {
return Ei(Ei({}, e), { modifiers: Zu(Zu([], e.modifiers, !0), [
{ name: "eventListeners", enabled: !0 }
], !1) });
}), this._setupClickOutsideListener(), this._popperInstance.update(), this._visible = !0, this._options.onShow(this);
}, t.prototype.hide = function() {
this._targetEl.classList.remove("block"), this._targetEl.classList.add("hidden"), this._popperInstance.setOptions(function(e) {
return Ei(Ei({}, e), { modifiers: Zu(Zu([], e.modifiers, !0), [
{ name: "eventListeners", enabled: !1 }
], !1) });
}), this._visible = !1, this._removeClickOutsideListener(), this._options.onHide(this);
}, t;
}()
);
function Hh() {
document.querySelectorAll("[data-dropdown-toggle]").forEach(function(t) {
var e = t.getAttribute("data-dropdown-toggle"), n = document.getElementById(e);
if (n) {
var r = t.getAttribute("data-dropdown-placement"), i = t.getAttribute("data-dropdown-offset-skidding"), o = t.getAttribute("data-dropdown-offset-distance"), a = t.getAttribute("data-dropdown-trigger"), s = t.getAttribute("data-dropdown-delay"), u = t.getAttribute("data-dropdown-ignore-click-outside-class");
new b6(n, t, {
placement: r || _i.placement,
triggerType: a || _i.triggerType,
offsetSkidding: i ? parseInt(i) : _i.offsetSkidding,
offsetDistance: o ? parseInt(o) : _i.offsetDistance,
delay: s ? parseInt(s) : _i.delay,
ignoreClickOutsideClass: u || _i.ignoreClickOutsideClass
});
} else
console.error('The dropdown element with id "'.concat(e, '" does not exist. Please check the data-dropdown-toggle attribute.'));
});
}
typeof window < "u" && (window.Dropdown = b6, window.initDropdowns = Hh);
var Dc = globalThis && globalThis.__assign || function() {
return Dc = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Dc.apply(this, arguments);
}, ma = {
placement: "center",
backdropClasses: "bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40",
backdrop: "dynamic",
closable: !0,
onHide: function() {
},
onShow: function() {
},
onToggle: function() {
}
}, $c = (
/** @class */
function() {
function t(e, n) {
e === void 0 && (e = null), n === void 0 && (n = ma), this._targetEl = e, this._options = Dc(Dc({}, ma), n), this._isHidden = !0, this._backdropEl = null, this._init();
}
return t.prototype._init = function() {
var e = this;
this._targetEl && this._getPlacementClasses().map(function(n) {
e._targetEl.classList.add(n);
});
}, t.prototype._createBackdrop = function() {
var e;
if (this._isHidden) {
var n = document.createElement("div");
n.setAttribute("modal-backdrop", ""), (e = n.classList).add.apply(e, this._options.backdropClasses.split(" ")), document.querySelector("body").append(n), this._backdropEl = n;
}
}, t.prototype._destroyBackdropEl = function() {
this._isHidden || document.querySelector("[modal-backdrop]").remove();
}, t.prototype._setupModalCloseEventListeners = function() {
var e = this;
this._options.backdrop === "dynamic" && (this._clickOutsideEventListener = function(n) {
e._handleOutsideClick(n.target);
}, this._targetEl.addEventListener("click", this._clickOutsideEventListener, !0)), this._keydownEventListener = function(n) {
n.key === "Escape" && e.hide();
}, document.body.addEventListener("keydown", this._keydownEventListener, !0);
}, t.prototype._removeModalCloseEventListeners = function() {
this._options.backdrop === "dynamic" && this._targetEl.removeEventListener("click", this._clickOutsideEventListener, !0), document.body.removeEventListener("keydown", this._keydownEventListener, !0);
}, t.prototype._handleOutsideClick = function(e) {
(e === this._targetEl || e === this._backdropEl && this.isVisible()) && this.hide();
}, t.prototype._getPlacementClasses = function() {
switch (this._options.placement) {
case "top-left":
return ["justify-start", "items-start"];
case "top-center":
return ["justify-center", "items-start"];
case "top-right":
return ["justify-end", "items-start"];
case "center-left":
return ["justify-start", "items-center"];
case "center":
return ["justify-center", "items-center"];
case "center-right":
return ["justify-end", "items-center"];
case "bottom-left":
return ["justify-start", "items-end"];
case "bottom-center":
return ["justify-center", "items-end"];
case "bottom-right":
return ["justify-end", "items-end"];
default:
return ["justify-center", "items-center"];
}
}, t.prototype.toggle = function() {
this._isHidden ? this.show() : this.hide(), this._options.onToggle(this);
}, t.prototype.show = function() {
this.isHidden && (this._targetEl.classList.add("flex"), this._targetEl.classList.remove("hidden"), this._targetEl.setAttribute("aria-modal", "true"), this._targetEl.setAttribute("role", "dialog"), this._targetEl.removeAttribute("aria-hidden"), this._createBackdrop(), this._isHidden = !1, document.body.classList.add("overflow-hidden"), this._options.closable && this._setupModalCloseEventListeners(), this._options.onShow(this));
}, t.prototype.hide = function() {
this.isVisible && (this._targetEl.classList.add("hidden"), this._targetEl.classList.remove("flex"), this._targetEl.setAttribute("aria-hidden", "true"), this._targetEl.removeAttribute("aria-modal"), this._targetEl.removeAttribute("role"), this._destroyBackdropEl(), this._isHidden = !0, document.body.classList.remove("overflow-hidden"), this._options.closable && this._removeModalCloseEventListeners(), this._options.onHide(this));
}, t.prototype.isVisible = function() {
return !this._isHidden;
}, t.prototype.isHidden = function() {
return this._isHidden;
}, t;
}()
), el = function(t, e) {
return e.some(function(n) {
return n.id === t;
}) ? e.find(function(n) {
return n.id === t;
}) : null;
};
function qh() {
var t = [];
document.querySelectorAll("[data-modal-target]").forEach(function(e) {
var n = e.getAttribute("data-modal-target"), r = document.getElementById(n);
if (r) {
var i = r.getAttribute("data-modal-placement"), o = r.getAttribute("data-modal-backdrop");
el(n, t) || t.push({
id: n,
object: new $c(r, {
placement: i || ma.placement,
backdrop: o || ma.backdrop
})
});
} else
console.error("Modal with id ".concat(n, " does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?."));
}), document.querySelectorAll("[data-modal-toggle]").forEach(function(e) {
var n = e.getAttribute("data-modal-toggle"), r = document.getElementById(n);
if (r) {
var i = r.getAttribute("data-modal-placement"), o = r.getAttribute("data-modal-backdrop"), a = el(n, t);
a || (a = {
id: n,
object: new $c(r, {
placement: i || ma.placement,
backdrop: o || ma.backdrop
})
}, t.push(a)), e.addEventListener("click", function() {
a.object.toggle();
});
} else
console.error("Modal with id ".concat(n, " does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?"));
}), document.querySelectorAll("[data-modal-show]").forEach(function(e) {
var n = e.getAttribute("data-modal-show"), r = document.getElementById(n);
if (r) {
var i = el(n, t);
i ? e.addEventListener("click", function() {
i.object.isHidden && i.object.show();
}) : console.error("Modal with id ".concat(n, " has not been initialized. Please initialize it using the data-modal-target attribute."));
} else
console.error("Modal with id ".concat(n, " does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?"));
}), document.querySelectorAll("[data-modal-hide]").forEach(function(e) {
var n = e.getAttribute("data-modal-hide"), r = document.getElementById(n);
if (r) {
var i = el(n, t);
i ? e.addEventListener("click", function() {
i.object.isVisible && i.object.hide();
}) : console.error("Modal with id ".concat(n, " has not been initialized. Please initialize it using the data-modal-target attribute."));
} else
console.error("Modal with id ".concat(n, " does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?"));
});
}
typeof window < "u" && (window.Modal = $c, window.initModals = qh);
var Nc = globalThis && globalThis.__assign || function() {
return Nc = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Nc.apply(this, arguments);
}, vo = {
placement: "left",
bodyScrolling: !1,
backdrop: !0,
edge: !1,
edgeOffset: "bottom-[60px]",
backdropClasses: "bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30",
onShow: function() {
},
onHide: function() {
},
onToggle: function() {
}
}, Fh = (
/** @class */
function() {
function t(e, n) {
e === void 0 && (e = null), n === void 0 && (n = vo), this._targetEl = e, this._options = Nc(Nc({}, vo), n), this._visible = !1, this._init();
}
return t.prototype._init = function() {
var e = this;
this._targetEl && (this._targetEl.setAttribute("aria-hidden", "true"), this._targetEl.classList.add("transition-transform")), this._getPlacementClasses(this._options.placement).base.map(function(n) {
e._targetEl.classList.add(n);
}), document.addEventListener("keydown", function(n) {
n.key === "Escape" && e.isVisible() && e.hide();
});
}, t.prototype.hide = function() {
var e = this;
this._options.edge ? (this._getPlacementClasses(this._options.placement + "-edge").active.map(function(n) {
e._targetEl.classList.remove(n);
}), this._getPlacementClasses(this._options.placement + "-edge").inactive.map(function(n) {
e._targetEl.classList.add(n);
})) : (this._getPlacementClasses(this._options.placement).active.map(function(n) {
e._targetEl.classList.remove(n);
}), this._getPlacementClasses(this._options.placement).inactive.map(function(n) {
e._targetEl.classList.add(n);
})), this._targetEl.setAttribute("aria-hidden", "true"), this._targetEl.removeAttribute("aria-modal"), this._targetEl.removeAttribute("role"), this._options.bodyScrolling || document.body.classList.remove("overflow-hidden"), this._options.backdrop && this._destroyBackdropEl(), this._visible = !1, this._options.onHide(this);
}, t.prototype.show = function() {
var e = this;
this._options.edge ? (this._getPlacementClasses(this._options.placement + "-edge").active.map(function(n) {
e._targetEl.classList.add(n);
}), this._getPlacementClasses(this._options.placement + "-edge").inactive.map(function(n) {
e._targetEl.classList.remove(n);
})) : (this._getPlacementClasses(this._options.placement).active.map(function(n) {
e._targetEl.classList.add(n);
}), this._getPlacementClasses(this._options.placement).inactive.map(function(n) {
e._targetEl.classList.remove(n);
})), this._targetEl.setAttribute("aria-modal", "true"), this._targetEl.setAttribute("role", "dialog"), this._targetEl.removeAttribute("aria-hidden"), this._options.bodyScrolling || document.body.classList.add("overflow-hidden"), this._options.backdrop && this._createBackdrop(), this._visible = !0, this._options.onShow(this);
}, t.prototype.toggle = function() {
this.isVisible() ? this.hide() : this.show();
}, t.prototype._createBackdrop = function() {
var e, n = this;
if (!this._visible) {
var r = document.createElement("div");
r.setAttribute("drawer-backdrop", ""), (e = r.classList).add.apply(e, this._options.backdropClasses.split(" ")), document.querySelector("body").append(r), r.addEventListener("click", function() {
n.hide();
});
}
}, t.prototype._destroyBackdropEl = function() {
this._visible && document.querySelector("[drawer-backdrop]").remove();
}, t.prototype._getPlacementClasses = function(e) {
switch (e) {
case "top":
return {
base: ["top-0", "left-0", "right-0"],
active: ["transform-none"],
inactive: ["-translate-y-full"]
};
case "right":
return {
base: ["right-0", "top-0"],
active: ["transform-none"],
inactive: ["translate-x-full"]
};
case "bottom":
return {
base: ["bottom-0", "left-0", "right-0"],
active: ["transform-none"],
inactive: ["translate-y-full"]
};
case "left":
return {
base: ["left-0", "top-0"],
active: ["transform-none"],
inactive: ["-translate-x-full"]
};
case "bottom-edge":
return {
base: ["left-0", "top-0"],
active: ["transform-none"],
inactive: ["translate-y-full", this._options.edgeOffset]
};
default:
return {
base: ["left-0", "top-0"],
active: ["transform-none"],
inactive: ["-translate-x-full"]
};
}
}, t.prototype.isHidden = function() {
return !this._visible;
}, t.prototype.isVisible = function() {
return this._visible;
}, t;
}()
), tl = function(t, e) {
if (e.some(function(n) {
return n.id === t;
}))
return e.find(function(n) {
return n.id === t;
});
};
function jh() {
var t = [];
document.querySelectorAll("[data-drawer-target]").forEach(function(e) {
var n = e.getAttribute("data-drawer-target"), r = document.getElementById(n);
if (r) {
var i = e.getAttribute("data-drawer-placement"), o = e.getAttribute("data-drawer-body-scrolling"), a = e.getAttribute("data-drawer-backdrop"), s = e.getAttribute("data-drawer-edge"), u = e.getAttribute("data-drawer-edge-offset");
tl(n, t) || t.push({
id: n,
object: new Fh(r, {
placement: i || vo.placement,
bodyScrolling: o ? o === "true" : vo.bodyScrolling,
backdrop: a ? a === "true" : vo.backdrop,
edge: s ? s === "true" : vo.edge,
edgeOffset: u || vo.edgeOffset
})
});
} else
console.error("Drawer with id ".concat(n, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"));
}), document.querySelectorAll("[data-drawer-toggle]").forEach(function(e) {
var n = e.getAttribute("data-drawer-toggle"), r = document.getElementById(n);
if (r) {
var i = tl(n, t);
i ? e.addEventListener("click", function() {
i.object.toggle();
}) : console.error("Drawer with id ".concat(n, " has not been initialized. Please initialize it using the data-drawer-target attribute."));
} else
console.error("Drawer with id ".concat(n, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"));
}), document.querySelectorAll("[data-drawer-dismiss], [data-drawer-hide]").forEach(function(e) {
var n = e.getAttribute("data-drawer-dismiss") ? e.getAttribute("data-drawer-dismiss") : e.getAttribute("data-drawer-hide"), r = document.getElementById(n);
if (r) {
var i = tl(n, t);
i ? e.addEventListener("click", function() {
i.object.hide();
}) : console.error("Drawer with id ".concat(n, " has not been initialized. Please initialize it using the data-drawer-target attribute."));
} else
console.error("Drawer with id ".concat(n, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id"));
}), document.querySelectorAll("[data-drawer-show]").forEach(function(e) {
var n = e.getAttribute("data-drawer-show"), r = document.getElementById(n);
if (r) {
var i = tl(n, t);
i ? e.addEventListener("click", function() {
i.object.show();
}) : console.error("Drawer with id ".concat(n, " has not been initialized. Please initialize it using the data-drawer-target attribute."));
} else
console.error("Drawer with id ".concat(n, " not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"));
});
}
typeof window < "u" && (window.Drawer = Fh, window.initDrawers = jh);
var Pc = globalThis && globalThis.__assign || function() {
return Pc = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Pc.apply(this, arguments);
}, qb = {
defaultTabId: null,
activeClasses: "text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500",
inactiveClasses: "dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300",
onShow: function() {
}
}, v6 = (
/** @class */
function() {
function t(e, n) {
e === void 0 && (e = []), n === void 0 && (n = qb), this._items = e, this._activeTab = n ? this.getTab(n.defaultTabId) : null, this._options = Pc(Pc({}, qb), n), this._init();
}
return t.prototype._init = function() {
var e = this;
this._items.length && (this._activeTab || this._setActiveTab(this._items[0]), this.show(this._activeTab.id, !0), this._items.map(function(n) {
n.triggerEl.addEventListener("click", function() {
e.show(n.id);
});
}));
}, t.prototype.getActiveTab = function() {
return this._activeTab;
}, t.prototype._setActiveTab = function(e) {
this._activeTab = e;
}, t.prototype.getTab = function(e) {
return this._items.filter(function(n) {
return n.id === e;
})[0];
}, t.prototype.show = function(e, n) {
var r, i, o = this;
n === void 0 && (n = !1);
var a = this.getTab(e);
a === this._activeTab && !n || (this._items.map(function(s) {
var u, l;
s !== a && ((u = s.triggerEl.classList).remove.apply(u, o._options.activeClasses.split(" ")), (l = s.triggerEl.classList).add.apply(l, o._options.inactiveClasses.split(" ")), s.targetEl.classList.add("hidden"), s.triggerEl.setAttribute("aria-selected", "false"));
}), (r = a.triggerEl.classList).add.apply(r, this._options.activeClasses.split(" ")), (i = a.triggerEl.classList).remove.apply(i, this._options.inactiveClasses.split(" ")), a.triggerEl.setAttribute("aria-selected", "true"), a.targetEl.classList.remove("hidden"), this._setActiveTab(a), this._options.onShow(this, a));
}, t;
}()
);
function Uh() {
document.querySelectorAll("[data-tabs-toggle]").forEach(function(t) {
var e = [], n = null;
t.querySelectorAll('[role="tab"]').forEach(function(r) {
var i = r.getAttribute("aria-selected") === "true", o = {
id: r.getAttribute("data-tabs-target"),
triggerEl: r,
targetEl: document.querySelector(r.getAttribute("data-tabs-target"))
};
e.push(o), i && (n = o.id);
}), new v6(e, {
defaultTabId: n
});
});
}
typeof window < "u" && (window.Tabs = v6, window.initTabs = Uh);
var Ti = globalThis && globalThis.__assign || function() {
return Ti = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Ti.apply(this, arguments);
}, nl = globalThis && globalThis.__spreadArray || function(t, e, n) {
if (n || arguments.length === 2)
for (var r = 0, i = e.length, o; r < i; r++)
(o || !(r in e)) && (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
return t.concat(o || Array.prototype.slice.call(e));
}, Ic = {
placement: "top",
triggerType: "hover",
onShow: function() {
},
onHide: function() {
},
onToggle: function() {
}
}, y6 = (
/** @class */
function() {
function t(e, n, r) {
e === void 0 && (e = null), n === void 0 && (n = null), r === void 0 && (r = Ic), this._targetEl = e, this._triggerEl = n, this._options = Ti(Ti({}, Ic), r), this._popperInstance = this._createPopperInstance(), this._visible = !1, this._init();
}
return t.prototype._init = function() {
this._triggerEl && this._setupEventListeners();
}, t.prototype._setupEventListeners = function() {
var e = this, n = this._getTriggerEvents();
n.showEvents.forEach(function(r) {
e._triggerEl.addEventListener(r, function() {
e.show();
});
}), n.hideEvents.forEach(function(r) {
e._triggerEl.addEventListener(r, function() {
e.hide();
});
});
}, t.prototype._createPopperInstance = function() {
return Hc(this._triggerEl, this._targetEl, {
placement: this._options.placement,
modifiers: [
{
name: "offset",
options: {
offset: [0, 8]
}
}
]
});
}, t.prototype._getTriggerEvents = function() {
switch (this._options.triggerType) {
case "hover":
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
case "click":
return {
showEvents: ["click", "focus"],
hideEvents: ["focusout", "blur"]
};
case "none":
return {
showEvents: [],
hideEvents: []
};
default:
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
}
}, t.prototype._setupKeydownListener = function() {
var e = this;
this._keydownEventListener = function(n) {
n.key === "Escape" && e.hide();
}, document.body.addEventListener("keydown", this._keydownEventListener, !0);
}, t.prototype._removeKeydownListener = function() {
document.body.removeEventListener("keydown", this._keydownEventListener, !0);
}, t.prototype._setupClickOutsideListener = function() {
var e = this;
this._clickOutsideEventListener = function(n) {
e._handleClickOutside(n, e._targetEl);
}, document.body.addEventListener("click", this._clickOutsideEventListener, !0);
}, t.prototype._removeClickOutsideListener = function() {
document.body.removeEventListener("click", this._clickOutsideEventListener, !0);
}, t.prototype._handleClickOutside = function(e, n) {
var r = e.target;
r !== n && !n.contains(r) && !this._triggerEl.contains(r) && this.isVisible() && this.hide();
}, t.prototype.isVisible = function() {
return this._visible;
}, t.prototype.toggle = function() {
this.isVisible() ? this.hide() : this.show();
}, t.prototype.show = function() {
this._targetEl.classList.remove("opacity-0", "invisible"), this._targetEl.classList.add("opacity-100", "visible"), this._popperInstance.setOptions(function(e) {
return Ti(Ti({}, e), { modifiers: nl(nl([], e.modifiers, !0), [
{ name: "eventListeners", enabled: !0 }
], !1) });
}), this._setupClickOutsideListener(), this._setupKeydownListener(), this._popperInstance.update(), this._visible = !0, this._options.onShow(this);
}, t.prototype.hide = function() {
this._targetEl.classList.remove("opacity-100", "visible"), this._targetEl.classList.add("opacity-0", "invisible"), this._popperInstance.setOptions(function(e) {
return Ti(Ti({}, e), { modifiers: nl(nl([], e.modifiers, !0), [
{ name: "eventListeners", enabled: !1 }
], !1) });
}), this._removeClickOutsideListener(), this._removeKeydownListener(), this._visible = !1, this._options.onHide(this);
}, t;
}()
);
function Wh() {
document.querySelectorAll("[data-tooltip-target]").forEach(function(t) {
var e = t.getAttribute("data-tooltip-target"), n = document.getElementById(e);
if (n) {
var r = t.getAttribute("data-tooltip-trigger"), i = t.getAttribute("data-tooltip-placement");
new y6(n, t, {
placement: i || Ic.placement,
triggerType: r || Ic.triggerType
});
} else
console.error('The tooltip element with id "'.concat(e, '" does not exist. Please check the data-tooltip-target attribute.'));
});
}
typeof window < "u" && (window.Tooltip = y6, window.initTooltips = Wh);
var Ci = globalThis && globalThis.__assign || function() {
return Ci = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Ci.apply(this, arguments);
}, rl = globalThis && globalThis.__spreadArray || function(t, e, n) {
if (n || arguments.length === 2)
for (var r = 0, i = e.length, o; r < i; r++)
(o || !(r in e)) && (o || (o = Array.prototype.slice.call(e, 0, r)), o[r] = e[r]);
return t.concat(o || Array.prototype.slice.call(e));
}, Bs = {
placement: "top",
offset: 10,
triggerType: "hover",
onShow: function() {
},
onHide: function() {
},
onToggle: function() {
}
}, w6 = (
/** @class */
function() {
function t(e, n, r) {
e === void 0 && (e = null), n === void 0 && (n = null), r === void 0 && (r = Bs), this._targetEl = e, this._triggerEl = n, this._options = Ci(Ci({}, Bs), r), this._popperInstance = this._createPopperInstance(), this._visible = !1, this._init();
}
return t.prototype._init = function() {
this._triggerEl && this._setupEventListeners();
}, t.prototype._setupEventListeners = function() {
var e = this, n = this._getTriggerEvents();
n.showEvents.forEach(function(r) {
e._triggerEl.addEventListener(r, function() {
e.show();
}), e._targetEl.addEventListener(r, function() {
e.show();
});
}), n.hideEvents.forEach(function(r) {
e._triggerEl.addEventListener(r, function() {
setTimeout(function() {
e._targetEl.matches(":hover") || e.hide();
}, 100);
}), e._targetEl.addEventListener(r, function() {
setTimeout(function() {
e._triggerEl.matches(":hover") || e.hide();
}, 100);
});
});
}, t.prototype._createPopperInstance = function() {
return Hc(this._triggerEl, this._targetEl, {
placement: this._options.placement,
modifiers: [
{
name: "offset",
options: {
offset: [0, this._options.offset]
}
}
]
});
}, t.prototype._getTriggerEvents = function() {
switch (this._options.triggerType) {
case "hover":
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
case "click":
return {
showEvents: ["click", "focus"],
hideEvents: ["focusout", "blur"]
};
case "none":
return {
showEvents: [],
hideEvents: []
};
default:
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
}
}, t.prototype._setupKeydownListener = function() {
var e = this;
this._keydownEventListener = function(n) {
n.key === "Escape" && e.hide();
}, document.body.addEventListener("keydown", this._keydownEventListener, !0);
}, t.prototype._removeKeydownListener = function() {
document.body.removeEventListener("keydown", this._keydownEventListener, !0);
}, t.prototype._setupClickOutsideListener = function() {
var e = this;
this._clickOutsideEventListener = function(n) {
e._handleClickOutside(n, e._targetEl);
}, document.body.addEventListener("click", this._clickOutsideEventListener, !0);
}, t.prototype._removeClickOutsideListener = function() {
document.body.removeEventListener("click", this._clickOutsideEventListener, !0);
}, t.prototype._handleClickOutside = function(e, n) {
var r = e.target;
r !== n && !n.contains(r) && !this._triggerEl.contains(r) && this.isVisible() && this.hide();
}, t.prototype.isVisible = function() {
return this._visible;
}, t.prototype.toggle = function() {
this.isVisible() ? this.hide() : this.show(), this._options.onToggle(this);
}, t.prototype.show = function() {
this._targetEl.classList.remove("opacity-0", "invisible"), this._targetEl.classList.add("opacity-100", "visible"), this._popperInstance.setOptions(function(e) {
return Ci(Ci({}, e), { modifiers: rl(rl([], e.modifiers, !0), [
{ name: "eventListeners", enabled: !0 }
], !1) });
}), this._setupClickOutsideListener(), this._setupKeydownListener(), this._popperInstance.update(), this._visible = !0, this._options.onShow(this);
}, t.prototype.hide = function() {
this._targetEl.classList.remove("opacity-100", "visible"), this._targetEl.classList.add("opacity-0", "invisible"), this._popperInstance.setOptions(function(e) {
return Ci(Ci({}, e), { modifiers: rl(rl([], e.modifiers, !0), [
{ name: "eventListeners", enabled: !1 }
], !1) });
}), this._removeClickOutsideListener(), this._removeKeydownListener(), this._visible = !1, this._options.onHide(this);
}, t;
}()
);
function Yh() {
document.querySelectorAll("[data-popover-target]").forEach(function(t) {
var e = t.getAttribute("data-popover-target"), n = document.getElementById(e);
if (n) {
var r = t.getAttribute("data-popover-trigger"), i = t.getAttribute("data-popover-placement"), o = t.getAttribute("data-popover-offset");
new w6(n, t, {
placement: i || Bs.placement,
offset: o ? parseInt(o) : Bs.offset,
triggerType: r || Bs.triggerType
});
} else
console.error('The popover element with id "'.concat(e, '" does not exist. Please check the data-popover-target attribute.'));
});
}
typeof window < "u" && (window.Popover = w6, window.initPopovers = Yh);
var Lc = globalThis && globalThis.__assign || function() {
return Lc = Object.assign || function(t) {
for (var e, n = 1, r = arguments.length; n < r; n++) {
e = arguments[n];
for (var i in e)
Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
}
return t;
}, Lc.apply(this, arguments);
}, rp = {
triggerType: "hover",
onShow: function() {
},
onHide: function() {
},
onToggle: function() {
}
}, k6 = (
/** @class */
function() {
function t(e, n, r, i) {
e === void 0 && (e = null), n === void 0 && (n = null), r === void 0 && (r = null), i === void 0 && (i = rp), this._parentEl = e, this._triggerEl = n, this._targetEl = r, this._options = Lc(Lc({}, rp), i), this._visible = !1, this._init();
}
return t.prototype._init = function() {
var e = this;
if (this._triggerEl) {
var n = this._getTriggerEventTypes(this._options.triggerType);
n.showEvents.forEach(function(r) {
e._triggerEl.addEventListener(r, function() {
e.show();
}), e._targetEl.addEventListener(r, function() {
e.show();
});
}), n.hideEvents.forEach(function(r) {
e._parentEl.addEventListener(r, function() {
e._parentEl.matches(":hover") || e.hide();
});
});
}
}, t.prototype.hide = function() {
this._targetEl.classList.add("hidden"), this._triggerEl && this._triggerEl.setAttribute("aria-expanded", "false"), this._visible = !1, this._options.onHide(this);
}, t.prototype.show = function() {
this._targetEl.classList.remove("hidden"), this._triggerEl && this._triggerEl.setAttribute("aria-expanded", "true"), this._visible = !0, this._options.onShow(this);
}, t.prototype.toggle = function() {
this._visible ? this.hide() : this.show();
}, t.prototype.isHidden = function() {
return !this._visible;
}, t.prototype.isVisible = function() {
return this._visible;
}, t.prototype._getTriggerEventTypes = function(e) {
switch (e) {
case "hover":
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
case "click":
return {
showEvents: ["click", "focus"],
hideEvents: ["focusout", "blur"]
};
case "none":
return {
showEvents: [],
hideEvents: []
};
default:
return {
showEvents: ["mouseenter", "focus"],
hideEvents: ["mouseleave", "blur"]
};
}
}, t;
}()
);
function Kh() {
document.querySelectorAll("[data-dial-init]").forEach(function(t) {
var e = t.querySelector("[data-dial-toggle]");
if (e) {
var n = e.getAttribute("data-dial-toggle"), r = document.getElementById(n);
if (r) {
var i = e.getAttribute("data-dial-trigger");
new k6(t, e, r, {
triggerType: i || rp.triggerType
});
} else
console.error("Dial with id ".concat(n, " does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?"));
} else
console.error("Dial with id ".concat(t.id, " does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?"));
});
}
typeof window < "u" && (window.Dial = k6, window.initDials = Kh);
function JF() {
Rh(), Bh(), Vh(), zh(), Hh(), qh(), jh(), Uh(), Wh(), Yh(), Kh();
}
typeof window < "u" && (window.initFlowbite = JF);
var XF = new GF("load", [
Rh,
Bh,
Vh,
zh,
Hh,
qh,
jh,
Uh,
Wh,
Yh,
Kh
]);
XF.init();
const QF = be({
name: "KDrawer",
props: {
modelValue: {
type: Boolean,
default: !1
},
title: {
type: String,
default: "Drawer"
},
placement: {
type: String,
default: "right",
options: ["right", "left", "top", "bottom"]
},
backdrop: {
type: Boolean,
default: !0
},
width: {
type: Number,
default: 360,
description: "Ancho del drawer en `px`"
},
loading: {
type: Boolean,
default: !1
}
},
emits: ["update:modelValue"],
setup(t, e) {
const n = on(), r = re(null);
let i = null;
const o = (c) => !!e.slots[c], a = {
placement: t.placement,
backdrop: t.backdrop,
bodyScrolling: !1,
edge: !1,
edgeOffset: "",
backdropClasses: "bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-30",
onShow: () => {
e.emit("update:modelValue", !0);
},
onHide: () => {
e.emit("update:modelValue", !1);
}
}, s = Vb(() => {
if (t.placement === "right")
return "top-0 right-0 h-screen overflow-y-auto translate-x-full";
if (t.placement === "left")
return "top-0 left-0 h-screen overflow-y-auto -translate-x-full";
if (t.placement === "top")
return "top-0 left-0 right-0 w-full -translate-y-full ";
if (t.placement === "bottom")
return "bottom-0 left-0 right-0 w-full overflow-y-auto transform-none";
}), u = Vb(() => t.placement === "right" || t.placement === "left" ? {
width: `${t.width}px`
} : {}), l = () => {
e.emit("update:modelValue", !1);
};
return st(() => {
var f;
const c = document.getElementById(n);
if (c) {
const d = c.parentNode;
if (d) {
d.removeChild(c), document.getElementsByTagName("body")[0].appendChild(c);
const p = document.addEventListener;
document.addEventListener = function(h, m, v) {
return h === "keydown" && (i = m), p.call(this, h, m, v);
}, r.value = new Fh(c, a), document.addEventListener = p, t.modelValue && ((f = r.value) == null || f.show());
}
}
}), Ct(
() => t.modelValue,
(c) => {
var f, d;
c ? (f = r.value) == null || f.show() : (d = r.value) == null || d.hide(), e.emit("update:modelValue", c);
}
), qi(() => {
var c, f;
(c = r.value) == null || c.hide(), i && (document.removeEventListener("keydown", i), i = null), r.value = null, (f = document.getElementById(n)) == null || f.remove();
}), { drawerId: n, hide: l, hasSlot: o, classes: s, styles: u };
}
}), ZF = ["id"], ej = { class: "flex flex-col h-full" }, tj = { class: "flex flex-row items-center border-b dark:border-gray-600 mb-4 pb-4 justify-between -mx-4 px-4" }, nj = { class: "flex-1 -m-4 relative" }, rj = {
key: 0,
class: "flex z-50 absolute top-0 left-0 w-full h-full items-center justify-center bg-white bg-opacity-80 dark:bg-gray-900 dark:bg-opacity-80 cursor-progress"
}, ij = { class: "p-4" }, oj = {
key: 0,
class: "flex flex-row items-center border-t dark:border-gray-600 justify-between px-4 pt-4 pb-0 -mx-4 mt-auto"
};
function aj(t, e, n, r, i, o) {
const a = he("k-title"), s = he("k-button"), u = he("k-icon");
return C(), P("div", {
id: t.drawerId,
class: se(["fixed z-40 max-w-full p-4 transition-transform bg-white dark:bg-gray-800", t.classes]),
tabindex: "-1",
style: Xe(t.styles)
}, [
U("div", ej, [
U("div", tj, [
t.hasSlot("header") ? X(t.$slots, "header", { key: 0 }) : (C(), oe(a, {
key: 1,
size: 5,
class: "font-semibold text-gray-800 dark:text-gray-400 overflow-hidden"
}, {
default: ne(() => [
Oe(Se(t.title) + " ", 1)
]),
_: 1
})),
J(s, {
icon: "times",
color: "gray",
neon: "",
size: "md",
onClick: t.hide
}, null, 8, ["onClick"])
]),
U("div", nj, [
J(zn, {
name: "animated_fade",
"enter-active-class": "animate__animated animate__faster animate__fadeIn",
"leave-active-class": "animate__animated animate__faster animate__fadeOut"
}, {
default: ne(() => [
t.loading ? (C(), P("div", rj, [
J(u, {
icon: "spinner-third",
spin: "",
class: "text-primary",
size: 40
})
])) : F("", !0)
]),
_: 1
}),
U("div", ij, [
X(t.$slots, "default")
])
]),
t.hasSlot("footer") ? (C(), P("div", oj, [
X(t.$slots, "footer")
])) : F("", !0)
])
], 14, ZF);
}
const sj = /* @__PURE__ */ $e(QF, [["render", aj]]), uj = be({
name: "KAccordion",
props: {
classes: {
type: String,
default: ""
},
activeClasses: {
type: String,
default: "bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white"
},
inactiveClasses: {
type: String,
default: "text-gray-500 dark:text-gray-400"
},
alwaysOpen: {
type: Boolean,
default: !1
}
},
setup(t) {
const e = on(), n = () => {
const r = re(null), i = () => {
const s = [];
return document.querySelectorAll(
`#${e} [data-accordion-trigger]`
).forEach((l) => {
const c = l.getAttribute("id"), f = l.getAttribute(
"data-accordion-scope"
);
if (c && f) {
const d = document.getElementById(c), p = document.getElementById(f), h = l.getAttribute("data-accordion-open") === "true";
d && p && s.push({
id: c,
triggerEl: d,
targetEl: p,
active: h
});
}
}), s;
}, o = {
alwaysOpen: !1,
activeClasses: `${t.activeClasses}`,
inactiveClasses: `${t.inactiveClasses}`
// onOpen: (item) => {
// console.log('accordion item has been shown')
// console.log(item)
// },
// onClose: (item) => {
// console.log('accordion item has been hidden')
// console.log(item)
// },
// onToggle: (item) => {
// console.log('accordion item has been toggled')
// console.log(item)
// }
}, a = i();
r.value = new Lh(a, o);
};
return st(() => {
n();
}), { accordionId: e };
}
}), lj = ["id"];
function cj(t, e, n, r, i, o) {
return C(), P("div", {
id: t.accordionId,
class: "k-accordion"
}, [
X(t.$slots, "default")
], 8, lj);
}
const dj = /* @__PURE__ */ $e(uj, [["render", cj]]), fj = be({
name: "KAccordionItem",
props: {
open: {
type: Boolean,
default: !1
}
},
setup() {
var i, o;
const t = on(), e = on(), n = Fo(), r = ((o = (i = n == null ? void 0 : n.parent) == null ? void 0 : i.props) == null ? void 0 : o.classes) || "";
return { accordionTarget: t, accordionTrigger: e, parentClasses: r };
}
}), pj = ["id", "data-accordion-scope", "data-accordion-open"], hj = ["id"];
function mj(t, e, n, r, i, o) {
return C(), P(Ee, null, [
U("div", {
id: t.accordionTrigger,
"data-accordion-scope": t.accordionTarget,
"data-accordion-trigger": "",
"data-accordion-open": t.open,
class: se(t.parentClasses)
}, [
X(t.$slots, "header")
], 10, pj),
U("div", {
id: t.accordionTarget,
class: se({ hidden: !t.open })
}, [
X(t.$slots, "content")
], 10, hj)
], 64);
}
const gj = /* @__PURE__ */ $e(fj, [["render", mj]]), bj = be({
name: "KPrice",
props: {
value: {
type: [String, Number],
default: ""
},
decimals: {
type: Number,
default: 2
},
currency: {
type: String,
default: "€"
},
size: {
type: String,
default: "xs"
}
},
setup(t) {
return { price: L(() => {
let n = t.value;
return typeof n == "string" && (n = parseFloat(n)), n.toFixed(t.decimals).replace(".", ",");
}) };
}
});
function vj(t, e, n, r, i, o) {
const a = he("k-badge");
return C(), oe(a, {
size: t.size,
color: "gray",
class: "font-consola text-gray-900",
neon: ""
}, {
default: ne(() => [
Oe(Se(t.price) + Se(t.currency), 1)
]),
_: 1
}, 8, ["size"]);
}
const yj = /* @__PURE__ */ $e(bj, [["render", vj]]), wj = {
columns: {
type: Array,
required: !0,
description: "Array con las columnas a mostrar"
},
data: {
type: Array,
default: () => [],
description: "Array con los datos a mostrar"
},
loading: {
type: Boolean,
default: !1,
description: "Indica si se estan cargando los datos"
},
maxHeight: {
type: [String, Number],
default: "auto"
}
};
function kj(t) {
const e = L(() => {
const r = t.columns, i = [];
return r == null || r.forEach((o) => {
let a = o.width || void 0;
o.slot === "_image" && (a = "5rem"), o.slot && ["header", "footer", "content"].includes(o.slot) && (o.slot = "");
const s = {
title: o.title,
index: o.index || "",
nowrap: o.nowrap || !0,
width: a,
align: o.align || "left",
slot: o.slot || "",
style: { position: "relative" },
url: o.url || void 0
};
s.nowrap && (s.style["white-space"] = "nowrap"), s.align && (s.style["text-align"] = s.align), s.width && (s.style.width = s.width), o.style && (s.style = { ...s.style, ...o.style }), i.push(s);
}), i;
}), n = L(() => {
let r = 1;
return r += e.value.length, r;
});
return { cols: e, colLength: n };
}
const xj = be({
name: "KSimpleTable",
autoload: !0,
props: wj,
emits: ["fetch", "filter"],
setup(t, e) {
const n = (o) => !!e.slots[o], { cols: r, colLength: i } = kj(t);
return {
hasSlot: n,
cols: r,
colLength: i
};
}
});
const Sj = { class: "k-simple-table" }, Ej = {
key: 0,
class: "flex z-40 absolute top-0 left-0 w-full h-full items-center justify-center bg-white bg-opacity-80 dark:bg-gray-900 dark:bg-opacity-80 cursor-progress"
}, _j = { class: "k-simple-table-content" }, Tj = { class: "k-simple-table-tr k-simple-table-head" }, Cj = { key: 1 };
function Oj(t, e, n, r, i, o) {
const a = he("k-icon");
return C(), P("div", Sj, [
U("div", {
class: "k-simple-table-body",
style: Xe({ maxHeight: t.maxHeight })
}, [
J(zn, {
name: "animated_fade",
"enter-active-class": "animate__animated animate__faster animate__fadeIn",
"leave-active-class": "animate__animated animate__faster animate__fadeOut"
}, {
default: ne(() => [
t.loading ? (C(), P("div", Ej, [
J(a, {
icon: "spinner-third",
spin: "",
class: "text-primary",
size: 40
})
])) : F("", !0)
]),
_: 1
}),
U("div", _j, [
U("div", Tj, [
(C(!0), P(Ee, null, nt(t.cols, (s, u) => (C(), P("div", {
key: u,
style: Xe(s.style),
class: "k-simple-table-td"
}, Se(s.title), 5))), 128))
]),
(C(!0), P(Ee, null, nt(t.data, (s, u) => (C(), P("div", {
key: u,
class: "k-simple-table-tr"
}, [
(C(!0), P(Ee, null, nt(t.cols, (l, c) => (C(), P("div", {
key: c,
style: Xe(l.style),
class: "k-simple-table-td"
}, [
l.slot ? X(t.$slots, l.slot, At(dt({ key: 0 }, {
row: s,
value: s[l.index],
index: u
})), void 0, !0) : (C(), P("div", Cj, Se(s[l.index]), 1))
], 4))), 128))
]))), 128))
])
], 4)
]);
}
const Aj = /* @__PURE__ */ $e(xj, [["render", Oj], ["__scopeId", "data-v-ddf873af"]]), x6 = Symbol("addTab"), S6 = Symbol("updateTab"), E6 = Symbol("deleteTab"), _6 = Symbol("tabsProvider"), Mj = be({
name: "KTabs",
props: {
modelValue: {
type: [String, Number],
default: 0
},
classes: {
type: String,
default: ""
},
shadow: {
type: Boolean,
default: !0
}
},
emits: ["changed", "clicked"],
setup(t, { emit: e }) {
const n = Qt({
activeTabHash: "",
lastActiveTabHash: "",
tabs: []
});
ci(_6, n), ci(x6, (o) => {
n.tabs.push(o);
}), ci(S6, (o, a) => {
const s = n.tabs.findIndex(
(u) => u.computedId === o
);
a.isActive = n.tabs[s].isActive, n.tabs[s] = a;
}), ci(E6, (o) => {
const a = n.tabs.findIndex(
(s) => s.computedId === o
);
n.tabs.splice(a, 1);
});
const r = (o, a) => {
a && a.preventDefault();
const s = i(o);
if (s) {
if (a && s.isDisabled) {
a.preventDefault();
return;
}
if (n.lastActiveTabHash === s.hash) {
e("clicked", { tab: s });
return;
}
n.tabs.forEach((u) => {
u.isActive = u.hash === s.hash;
}), e("changed", { tab: s }), n.lastActiveTabHash = n.activeTabHash = s.hash;
}
}, i = (o) => n.tabs.find((a) => a.hash === o);
return st(() => {
if (n.tabs.length) {
if (window.addEventListener(
"hashchange",
() => r(window.location.hash)
), i(window.location.hash)) {
r(window.location.hash);
return;
}
r(n.tabs[0].hash);
}
}), { state: n, selectTab: r, findTab: i };
}
});
const Dj = {
role: "tablist",
class: "k-tab-list"
}, $j = ["onClick"], Nj = ["aria-controls", "aria-selected", "href", "innerHTML"], Pj = { class: "k-tab-pane" };
function Ij(t, e, n, r, i, o) {
return C(), P("div", {
class: se(["k-tabs", [t.classes, t.shadow ? "k-tab-shadow" : ""]])
}, [
U("ul", Dj, [
(C(!0), P(Ee, null, nt(t.state.tabs, (a, s) => (C(), P("li", {
key: s,
class: se(["k-tab-item", {
"k-tab-active": a.isActive,
"k-tab-disabled": a.isDisabled
}]),
role: "presentation",
onClick: (u) => t.selectTab(a.hash, u)
}, [
U("a", {
role: "tab",
"aria-controls": a.paneId,
"aria-selected": a.isActive,
href: a.hash,
innerHTML: a.header
}, null, 8, Nj)
], 10, $j))), 128))
]),
U("div", Pj, [
X(t.$slots, "default", {}, void 0, !0)
])
], 2);
}
const Lj = /* @__PURE__ */ $e(Mj, [["render", Ij], ["__scopeId", "data-v-2fc63239"]]);
function il(t, e) {
const n = pi(t, e);
if (typeof n > "u")
throw new Error(`Could not resolve ${t.description}`);
return n;
}
const Rj = be({
name: "KTab",
props: {
id: {
type: String,
default: null
},
classes: {
type: String,
default: ""
},
title: {
type: String,
required: !0
},
disabled: {
type: Boolean,
default: !1
}
},
setup(t) {
const e = re(!1), n = il(_6), r = il(x6), i = il(S6), o = il(E6), a = t.id ? t.id : t.title.toLowerCase().replace(/ /g, "-"), s = L(() => t.title), u = a + "-pane", l = L(
() => "#" + (t.disabled ? "" : a)
);
return Ct(
() => n.activeTabHash,
() => {
e.value = l.value === n.activeTabHash;
}
), Ct(
() => Object.assign({}, t),
() => {
i(a, {
name: t.title,
header: s.value,
isDisabled: t.disabled,
hash: l.value,
index: n.tabs.length,
computedId: a,
paneId: u
});
}
), D6(() => {
r({
name: t.title,
header: s.value,
isDisabled: t.disabled,
hash: l.value,
index: n.tabs.length,
computedId: a,
paneId: u
});
}), qi(() => {
o(a);
}), { header: s.value, computedId: a, paneId: u, hash: l, isActive: e };
}
}), Bj = ["id", "data-tab-id", "aria-hidden"];
function Vj(t, e, n, r, i, o) {
return Qe((C(), P("section", {
id: t.paneId,
ref: "tab",
"data-tab-id": t.computedId,
"aria-hidden": !t.isActive,
class: se(t.classes),
role: "tabpanel"
}, [
X(t.$slots, "default")
], 10, Bj)), [
[xn, t.isActive]
]);
}
const zj = /* @__PURE__ */ $e(Rj, [["render", Vj]]), Hj = ["onDragenter", "onDragover", "onDragleave", "onDrop"], qj = /* @__PURE__ */ be({
__name: "k-drag",
emits: ["drop"],
setup(t, { emit: e }) {
let n = re(!1), r = null;
function i() {
n.value = !0, clearTimeout(r);
}
function o() {
r = setTimeout(() => {
n.value = !1;
}, 50);
}
function a(s) {
o(), e("drop", [...s.dataTransfer.files]);
}
return (s, u) => (C(), P("div", {
onDragenter: et(i, ["prevent"]),
onDragover: et(i, ["prevent"]),
onDragleave: et(o, ["prevent"]),
onDrop: et(a, ["prevent"])
}, [
X(s.$slots, "dropzone", At(hn({ active: W(n) })))
], 40, Hj));
}
}), Fj = be({
name: "KModal",
props: {
modelValue: {
type: Boolean,
default: !1,
description: "Controla la apertura del modal"
},
title: {
type: String,
default: "",
description: "Título del modal"
},
placement: {
type: String,
default: "top",
options: [
"top-left",
"top-center",
"top-right",
"center-left",
"center-center",
"center-right",
"bottom-left",
"bottom-center",
"bottom-right"
],
description: "Posición del modal"
},
header: {
type: Boolean,
default: !0,
description: "Permite mostrar u ocultar el header del modal"
},
closable: {
type: Boolean,
default: !0,
description: "Permite cerrar el modal desde el backdrop o clicando en el botón de cerrar"
},
backdropClose: {
type: Boolean,
default: !0,
description: "Permite cerrar el modal desde el backdrop"
},
size: {
type: String,
default: "lg",
options: ["sm", "md", "lg", "xl"],
description: "Tamaño del modal"
},
zIndex: {
type: Number,
default: 40,
description: "Indica el z-index del modal"
}
},
emits: ["update:modelValue", "show", "hide", "toggle"],
setup(t, e) {
const n = on(), r = re(null), i = (f) => !!e.slots[f], o = () => ({
placement: t.placement,
backdrop: t.backdropClose ? "dynamic" : "static",
backdropClasses: l.value,
closable: t.closable,
onHide: () => {
e.emit("update:modelValue", !1), e.emit("hide");
},
onShow: () => {
e.emit("update:modelValue", !0), e.emit("show");
},
onToggle: () => {
e.emit("toggle");
}
}), a = () => {
const f = document.getElementById(n);
if (f) {
const d = f.parentNode;
if (d) {
d.removeChild(f), document.getElementsByTagName("body")[0].appendChild(f);
const p = o();
r.value = new $c(f, p), t.modelValue ? r.value.show() : r.value.hide();
}
}
}, s = () => {
e.emit("update:modelValue", !1);
};
Ct(
() => t.modelValue,
(f) => {
var d, p;
f ? (d = r.value) == null || d.show() : (p = r.value) == null || p.hide(), e.emit("update:modelValue", f);
}
), Ct(
() => t.placement,
(f) => {
const d = document.getElementById(n);
d && (d.className = u.value), a();
}
);
const u = L(() => {
const f = [
"fixed top-0 left-0 right-0 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] md:h-full"
];
return t.zIndex === 50 ? f.push("z-50") : t.zIndex === 40 ? f.push("z-40") : t.zIndex === 30 ? f.push("z-30") : t.zIndex === 20 ? f.push("z-20") : t.zIndex === 10 ? f.push("z-10") : f.push("z-50"), f.join(" ");
}), l = L(() => {
const f = [
"bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0"
];
return t.zIndex === 50 ? f.push("z-40") : t.zIndex === 40 ? f.push("z-30") : t.zIndex === 30 ? f.push("z-20") : t.zIndex === 20 ? f.push("z-10") : t.zIndex === 10 ? f.push("z-0") : f.push("z-40"), f.join(" ");
}), c = L(() => {
const f = [];
return t.size === "xs" ? f.push("max-w-md") : t.size === "sm" ? f.push("max-w-xl") : t.size === "md" ? f.push("max-w-2xl") : t.size === "lg" ? f.push("max-w-4xl") : t.size === "xl" && f.push("max-w-5xl"), f;
});
return st(() => {
a();
}), qi(() => {
var f, d;
(f = r.value) == null || f.hide(), r.value = null, (d = document.getElementById(n)) == null || d.remove();
}), {
modalId: n,
hasSlot: i,
hide: s,
defaultModalClasses: u,
contentClasses: c
};
}
}), jj = ["id"], Uj = { class: "relative bg-white rounded-lg shadow dark:bg-gray-700" }, Wj = {
key: 0,
class: "flex items-center px-6 py-5 border-b rounded-t dark:border-gray-600"
}, Yj = /* @__PURE__ */ U("span", { class: "sr-only" }, "Close menu", -1), Kj = { class: "p-6" }, Gj = {
key: 1,
class: "flex items-center px-6 py-5 border-t border-gray-200 rounded-b dark:border-gray-600"
};
function Jj(t, e, n, r, i, o) {
const a = he("k-title"), s = he("k-icon");
return C(), P("div", {
id: t.modalId,
tabindex: "-1",
"aria-hidden": "true",
class: se(t.defaultModalClasses)
}, [
U("div", {
class: se(["relative w-full h-full md:h-auto", t.contentClasses])
}, [
U("div", Uj, [
t.header && (t.title || t.hasSlot("header")) ? (C(), P("div", Wj, [
t.hasSlot("header") ? X(t.$slots, "header", { key: 0 }) : (C(), oe(a, {
key: 1,
size: 5,
class: "font-semibold"
}, {
default: ne(() => [
Oe(Se(t.title), 1)
]),
_: 1
})),
t.closable ? (C(), P("button", {
key: 2,
type: "button",
class: "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg w-8 h-8 text-sm flex items-center justify-center dark:hover:bg-gray-600 dark:hover:text-white ml-auto",
onClick: e[0] || (e[0] = (...u) => t.hide && t.hide(...u))
}, [
J(s, { icon: "times" }),
Yj
])) : F("", !0)
])) : F("", !0),
U("div", Kj, [
X(t.$slots, "default")
]),
t.hasSlot("footer") ? (C(), P("div", Gj, [
X(t.$slots, "footer")
])) : F("", !0)
])
], 2)
], 10, jj);
}
const Xj = /* @__PURE__ */ $e(Fj, [["render", Jj]]), Qj = be({
name: "KConfirm",
autoload: !0,
props: {
icon: {
type: String,
default: "question-circle"
},
title: {
type: String,
default: "¿Estás seguro de realizar esta acción?",
description: "Pregunta de confirmación"
},
okText: {
type: String,
default: "Aceptar"
},
koText: {
type: String,
default: "Cancelar"
},
disabled: {
type: Boolean,
default: !1
},
unlocked: {
type: Boolean,
default: !1
}
},
emits: ["ok", "ko"],
setup(t, e) {
const n = re(!1), r = L({
get() {
return n.value === !0 && !t.disabled;
},
set(s) {
n.value = s;
}
}), i = () => {
e.emit("ok"), n.value = !1;
};
return { showModal: n, ok: i, ko: () => {
e.emit("ko"), n.value = !1;
}, open: () => {
t.disabled || (t.unlocked ? i() : n.value = !0);
}, model: r };
}
}), Zj = "_KConfirm_1xpqm_1", eU = "_btn_1xpqm_1", tU = "_icon_1xpqm_6", nU = {
KConfirm: Zj,
btn: eU,
icon: tU
}, rU = { class: "mb-4 text-gray-700 dark:text-gray-200 font-semibold text-xl text-center" };
function iU(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-button"), u = he("k-modal");
return C(), P(Ee, null, [
J(u, {
modelValue: t.model,
"onUpdate:modelValue": e[0] || (e[0] = (l) => t.model = l),
size: "xs",
"z-index": 50
}, {
default: ne(() => [
U("div", {
class: se(["flex flex-col items-center", t.$style.KConfirm])
}, [
J(a, {
icon: t.icon,
type: "far",
class: "text-gray-300 mb-6",
size: 60
}, null, 8, ["icon"]),
U("div", rU, Se(t.title), 1),
U("div", null, [
J(s, {
color: "success",
class: "mr-2 cursor-pointer",
onClick: t.ok
}, {
default: ne(() => [
Oe(Se(t.okText), 1)
]),
_: 1
}, 8, ["onClick"]),
J(s, {
color: "danger",
class: "cursor-pointer",
outline: "",
onClick: t.ko
}, {
default: ne(() => [
Oe(Se(t.koText), 1)
]),
_: 1
}, 8, ["onClick"])
])
], 2)
]),
_: 1
}, 8, ["modelValue"]),
U("span", {
onClick: e[1] || (e[1] = et((l) => t.open(), ["stop"]))
}, [
X(t.$slots, "default")
])
], 64);
}
const oU = {
$style: nU
}, aU = /* @__PURE__ */ $e(Qj, [["render", iU], ["__cssModules", oU]]), sU = be({
name: "KEmpty",
autoload: !0,
props: {
title: {
type: String,
default: "No se encontraron resultados",
description: "Título"
},
subtitle: {
type: String,
default: "",
description: "Subtítulo"
},
image: {
type: String,
default: "",
description: "Url de la imagen"
}
},
setup(t, { slots: e }) {
const n = (i) => !!e[i], r = L(() => t.image ? t.image : "https://kodamaui.s3.eu-west-1.amazonaws.com/errors/404/frontend/404-1.svg");
return { hasSlot: n, img404: r };
}
}), uU = { class: "max-w-md overflow-hidden" }, lU = ["src"], cU = { class: "mb-6 text-center whitespace-normal" }, dU = { class: "flex justify-center" };
function fU(t, e, n, r, i, o) {
const a = he("k-title");
return C(), P("div", uU, [
U("img", {
src: t.img404,
class: "mb-4 w-full"
}, null, 8, lU),
U("div", cU, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 1 }) : (C(), oe(a, {
key: 0,
size: 3,
bolder: "",
uppercase: "",
class: "text-gray-900 dark:text-white"
}, kn({
default: ne(() => [
Oe(Se(t.title) + " ", 1)
]),
_: 2
}, [
t.subtitle ? {
name: "subtitle",
fn: ne(() => [
Oe(Se(t.subtitle), 1)
]),
key: "0"
} : void 0
]), 1024)),
t.hasSlot("subtitle") ? X(t.$slots, "subtitle", { key: 2 }) : F("", !0)
]),
U("div", dU, [
X(t.$slots, "action")
])
]);
}
const pU = /* @__PURE__ */ $e(sU, [["render", fU]]), hU = be({
name: "KLoading",
// components: { Loading },
autoload: !0,
props: {
active: {
type: Boolean,
default: !1,
description: "Show or hide the loader"
},
type: {
type: String,
default: "bars",
description: "Type of loader",
options: ["spinner", "bars", "dots"],
validator: (t) => ["spinner", "bars", "dots"].includes(t),
control: "inline-radio"
},
fullpage: {
type: Boolean,
default: !1,
description: "Show the loader as full page"
},
overlayClasses: {
type: String,
default: ""
}
},
setup() {
const t = Ht();
return { backgroundColor: L(() => t.get("darkMode").value ? "#1f2937" : "#F3F4F6") };
}
}), mU = { class: "relative" };
function gU(t, e, n, r, i, o) {
const a = he("k-icon");
return C(), P("div", mU, [
J(zn, {
name: "animated_fade",
"enter-active-class": "animate__animated animate__faster animate__fadeIn",
"leave-active-class": "animate__animated animate__faster animate__fadeOut"
}, {
default: ne(() => [
t.active ? (C(), P("div", {
key: 0,
class: se(["flex z-50 top-0 left-0 w-full h-full items-center justify-center bg-white bg-opacity-80 dark:bg-gray-900 dark:bg-opacity-80 cursor-progress", [
{
fixed: t.fullpage,
absolute: !t.fullpage,
[t.overlayClasses]: !0
}
]])
}, [
J(a, {
icon: "spinner-third",
spin: "",
class: "text-primary",
size: 40
})
], 2)) : F("", !0)
]),
_: 1
}),
X(t.$slots, "default")
]);
}
const bU = /* @__PURE__ */ $e(hU, [["render", gU]]), vU = be({
name: "KHelp",
autoload: !0,
props: {
text: {
type: String,
default: "",
description: "Texto de la ayuda"
},
icon: {
type: String,
default: "seal-question",
description: "Icono"
}
},
setup(t, { slots: e }) {
return { hasSlot: (r) => !!e[r] };
}
}), yU = { class: "flex flex-col text-sm" }, wU = /* @__PURE__ */ U("div", { class: "border-b border-b-gray-600 px-4 py-1 text-center uppercase font-bold flex justify-center" }, [
/* @__PURE__ */ U("span", null, "Ayuda")
], -1), kU = { class: "px-4 py-2" };
function xU(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip");
return C(), oe(s, { content: t.text }, {
content: ne(() => [
U("div", yU, [
wU,
U("div", kU, [
t.hasSlot("default") ? X(t.$slots, "default", { key: 0 }) : (C(), P(Ee, { key: 1 }, [
Oe(Se(t.text), 1)
], 64))
])
])
]),
default: ne(() => [
J(a, {
type: "fad",
icon: t.icon,
class: "dark:text-white text-gray-200"
}, null, 8, ["icon"])
]),
_: 3
}, 8, ["content"]);
}
const SU = /* @__PURE__ */ $e(vU, [["render", xU]]), EU = be({
name: "KAlert",
autoload: !0,
props: {
title: {
type: String,
default: "",
description: "Texto de la ayuda"
},
icon: {
type: String,
default: "seal-question",
description: "Icono"
},
iconType: {
type: String,
default: "fad",
description: "Icono"
},
iconSize: {
type: Number,
default: 0,
description: "Tamaño del icono"
},
type: {
type: String,
default: "primary",
options: ["primary", "success", "warning", "danger"],
description: "Tipo de alerta"
},
outline: {
type: Boolean,
default: !1,
description: "Aplica el estilo `outline`"
},
neon: {
type: Boolean,
default: !1,
description: "Aplica el estilo `neon`"
},
closable: {
type: Boolean,
default: !1,
description: "Permite cerrar la alerta"
}
},
setup(t, e) {
const n = re(!1), r = (a) => !!e.slots[a], i = L(() => {
const a = ["k-alert"];
return t.type && a.push(`k-alert-${t.type}`), t.outline ? a.push("k-alert-outline") : t.neon && a.push("k-alert-neon"), a;
});
return {
closed: n,
classes: i,
close: () => {
n.value = !0, e.emit("close");
},
hasSlot: r
};
}
});
const _U = { class: "w-full" }, TU = {
key: 0,
class: "font-bold"
};
function CU(t, e, n, r, i, o) {
const a = he("k-icon");
return Qe((C(), P("div", {
class: se(t.classes)
}, [
J(a, {
icon: t.icon,
type: t.iconType,
size: t.iconSize,
class: "mr-2"
}, null, 8, ["icon", "type", "size"]),
U("div", _U, [
t.title ? (C(), P("div", TU, Se(t.title), 1)) : F("", !0),
X(t.$slots, "default")
]),
t.hasSlot("close") ? X(t.$slots, "close", { key: 0 }) : t.closable ? (C(), P("div", {
key: 1,
class: "ml-auto cursor-pointer self-start",
onClick: e[1] || (e[1] = (s) => t.$emit("close"))
}, [
U("button", {
type: "button",
class: "ml-4 -mx-1.5 -my-1.5 rounded-lg p-1.5 inline-flex h-8 w-8 hover:bg-gray-200 hover:bg-opacity-20 justify-center items-center",
onClick: e[0] || (e[0] = (...s) => t.close && t.close(...s))
}, [
J(a, {
icon: "times",
type: "fas"
})
])
])) : F("", !0)
], 2)), [
[xn, !t.closed]
]);
}
const OU = /* @__PURE__ */ $e(EU, [["render", CU]]), AU = be({
name: "KSkeleton",
props: {
type: {
type: String,
default: "text",
options: ["text", "card"],
description: "Tipo de skeleton a mostrar",
validator: (t) => ["text", "card"].includes(t)
},
animated: {
type: Boolean,
default: !1,
description: "Especifica si el skeleton estará animado"
}
},
setup(t) {
return { classes: L(() => ({
"animate-pulse": t.animated
})) };
}
}), MU = /* @__PURE__ */ Qb('<div class="flex items-center w-full space-x-2"><div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-32"></div><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24"></div><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-full"></div></div><div class="flex items-center w-full space-x-2 max-w-[480px]"><div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-full"></div><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-full"></div><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24"></div></div><div class="flex items-center w-full space-x-2 max-w-[400px]"><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-full"></div><div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-80"></div><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-full"></div></div><div class="flex items-center w-full space-x-2 max-w-[480px]"><div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-full"></div><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-full"></div><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24"></div></div><div class="flex items-center w-full space-x-2 max-w-[440px]"><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-32"></div><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24"></div><div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-full"></div></div><div class="flex items-center w-full space-x-2 max-w-[360px]"><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-full"></div><div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-80"></div><div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-full"></div></div><span class="sr-only">Loading...</span>', 7), DU = [
MU
], $U = /* @__PURE__ */ Qb('<div class="flex items-center justify-center h-48 mb-4 bg-gray-300 rounded dark:bg-gray-700"><svg class="w-12 h-12 text-gray-200 dark:text-gray-600" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" viewBox="0 0 640 512"><path d="M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"></path></svg></div><div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-48 mb-4"></div><div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 mb-2.5"></div><div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 mb-2.5"></div><div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div><div class="flex items-center mt-4 space-x-3"><svg class="text-gray-200 w-14 h-14 dark:text-gray-700" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-6-3a2 2 0 11-4 0 2 2 0 014 0zm-2 4a5 5 0 00-4.546 2.916A5.986 5.986 0 0010 16a5.986 5.986 0 004.546-2.084A5 5 0 0010 11z" clip-rule="evenodd"></path></svg><div><div class="h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 w-32 mb-2"></div><div class="w-48 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div></div></div><span class="sr-only">Loading...</span>', 7), NU = [
$U
], PU = /* @__PURE__ */ U("div", { class: "flex items-center justify-center h-48 w-48 bg-gray-300 rounded dark:bg-gray-700" }, [
/* @__PURE__ */ U("svg", {
class: "w-12 h-12 text-gray-200 dark:text-gray-600",
xmlns: "http://www.w3.org/2000/svg",
"aria-hidden": "true",
fill: "currentColor",
viewBox: "0 0 640 512"
}, [
/* @__PURE__ */ U("path", { d: "M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z" })
])
], -1), IU = [
PU
];
function LU(t, e, n, r, i, o) {
return C(), P("div", null, [
t.type === "text" ? (C(), P("div", {
key: 0,
role: "status",
class: se(["space-y-2.5 max-w-lg", t.classes])
}, DU, 2)) : F("", !0),
t.type === "card" ? (C(), P("div", {
key: 1,
role: "status",
class: se(["max-w-sm p-4 border border-gray-200 rounded shadow md:p-6 dark:border-gray-700", t.classes])
}, NU, 2)) : F("", !0),
t.type === "image" ? (C(), P("div", {
key: 2,
role: "status",
class: se(["max-w-sm p-4 border border-gray-200 rounded shadow md:p-6 dark:border-gray-700", t.classes])
}, IU, 2)) : F("", !0)
]);
}
const RU = /* @__PURE__ */ $e(AU, [["render", LU]]), T6 = [
"top",
"top-start",
"top-end",
"right",
"right-start",
"right-end",
"bottom",
"bottom-start",
"bottom-end",
"left",
"left-start",
"left-end",
"auto",
"auto-start",
"auto-end"
], BU = be({
name: "KDropdown",
autoload: !0,
props: {
placement: {
type: String,
default: "bottom-end",
options: T6
},
trigger: {
type: String,
default: "focusin",
options: ["click", "mouseenter", "focus", "manual", "focusin"]
},
tag: {
type: String,
default: "button"
},
maxHeight: {
type: Number,
default: 0
},
minWidth: {
type: Number,
default: 0
},
maxWidth: {
type: Number,
default: 0
}
},
setup(t, { slots: e }) {
const n = re(), r = (s) => !!e[s], i = () => {
n.value && n.value.hide();
}, o = () => {
n.value && n.value.show();
}, a = L(() => ({
maxHeight: t.maxHeight ? `${t.maxHeight}px` : "auto",
overflowY: "auto"
}));
return { hasSlot: r, ulStyle: a, tooltip: n, hide: i, show: o };
}
}), VU = ["onClick"];
function zU(t, e, n, r, i, o) {
const a = he("k-dropdown-menu"), s = he("k-tooltip");
return C(), oe(s, {
ref: "tooltip",
arrow: "",
interactive: "",
"hide-on-click": !1,
trigger: t.trigger,
placement: t.placement,
theme: "dropdown",
tag: t.tag,
class: "select-none"
}, {
default: ne(() => [
X(t.$slots, "default")
]),
content: ne(({ hide: u }) => [
U("ul", {
class: "k-dropdown-items text-base text-gray-700 dark:text-gray-200 text-left bg-white dark:bg-gray-800",
style: Xe(t.ulStyle),
onClick: u
}, [
t.hasSlot("header") ? (C(), oe(a, {
key: 0,
class: "px-4 py-3 text-gray-900 dark:text-white"
}, {
default: ne(() => [
X(t.$slots, "header")
]),
_: 3
})) : F("", !0),
X(t.$slots, "content"),
t.hasSlot("footer") ? (C(), oe(a, {
key: 1,
class: "px-4 py-3 text-gray-900 dark:text-white"
}, {
default: ne(() => [
X(t.$slots, "footer")
]),
_: 3
})) : F("", !0)
], 12, VU)
]),
_: 3
}, 8, ["trigger", "placement", "tag"]);
}
const HU = /* @__PURE__ */ $e(BU, [["render", zU]]), qU = be({
name: "KDropdownMenu",
props: {
selected: {
type: Boolean,
default: !1
}
},
setup() {
return {};
}
});
function FU(t, e, n, r, i, o) {
return C(), P("li", {
class: se({ selected: t.selected })
}, [
X(t.$slots, "default")
], 2);
}
const jU = /* @__PURE__ */ $e(qU, [["render", FU]]), UU = be({
name: "KDropdownSubmenu",
props: {
placement: {
type: String,
default: "right-start",
options: T6
},
trigger: {
type: String,
default: "focusin",
options: ["click", "mouseenter", "focus", "manual", "focusin"]
},
tag: {
type: String,
default: "div"
},
maxHeight: {
type: Number,
default: 0
},
minWidth: {
type: Number,
default: 0
},
maxWidth: {
type: Number,
default: 0
}
},
setup(t) {
return { ulStyle: L(() => ({
maxHeight: t.maxHeight ? `${t.maxHeight}px` : "auto",
overflowY: t.maxHeight ? "auto" : "visible"
})) };
}
}), WU = { class: "flex flex-row items-center" }, YU = /* @__PURE__ */ U("div", { class: "ml-auto" }, null, -1), KU = ["onClick"];
function GU(t, e, n, r, i, o) {
const a = he("k-icon"), s = he("k-tooltip");
return C(), oe(s, {
arrow: "",
interactive: "",
"hide-on-click": !1,
trigger: "mouseenter",
theme: "dropdown",
tag: "li",
placement: t.placement
}, {
default: ne(() => [
U("div", WU, [
X(t.$slots, "default"),
YU,
J(a, {
icon: "chevron-right",
class: "ml-2",
type: "fas",
size: 12
})
])
]),
content: ne(({ hide: u }) => [
U("ul", {
class: "k-dropdown-items text-base text-gray-700 dark:text-gray-200 text-left",
style: Xe(t.ulStyle),
onClick: u
}, [
X(t.$slots, "content")
], 12, KU)
]),
_: 3
}, 8, ["placement"]);
}
const JU = /* @__PURE__ */ $e(UU, [["render", GU]]), XU = be({
name: "KDropdownDivider",
autoload: !0,
setup() {
return {};
}
}), QU = { class: "separator my-3" };
function ZU(t, e, n, r, i, o) {
return C(), P("div", QU);
}
const eW = /* @__PURE__ */ $e(XU, [["render", ZU]]), tW = be({
name: "KBubble1",
props: {
color: {
type: String,
default: "#f7f9fd"
}
},
setup() {
return {};
}
}), nW = /* @__PURE__ */ U("pattern", {
id: "img1",
patternUnits: "userSpaceOnUse",
width: "100%",
height: "100%",
"data-stylerecorder": "true",
style: { "text-align": "inherit", "line-height": "22px", "letter-spacing": "0px", "font-weight": "400", "font-size": "16px" }
}, [
/* @__PURE__ */ U("image", {
href: "",
x: "0",
y: "0",
width: "100%",
height: "100%",
"data-stylerecorder": "true",
style: { "text-align": "inherit", "line-height": "22px", "letter-spacing": "0px", "font-weight": "400", "font-size": "16px" }
})
], -1), rW = /* @__PURE__ */ U("path", {
d: "",
"data-stylerecorder": "true",
style: { "text-align": "inherit", "line-height": "22px", "letter-spacing": "0px", "font-weight": "400", "font-size": "16px" }
}, [
/* @__PURE__ */ U("animate", {
repeatCount: "indefinite",
attributeName: "d",
dur: "10s",
values: `
M6.5,39.4C7.9,62.9,6,81.5,3.8,94.8c-2.9,17.7-7.2,30.9,0.4,41.9c5.9,8.5,15.7,11,17.6,11.5
c17.9,4.5,26.2-9.4,64-27c25.6-11.9,39.7-13.9,45.3-28c3.1-7.9,1.9-15.3,1.5-17.3c-2.7-12.7-14.2-21.9-28.5-30.4
c-20-12-39.7-48.3-72-45.2C29.1,0.5,21.6,1.3,15.3,7C3.2,17.7,6,36.7,6.5,39.4z;
M6.5,39.4C7.9,62.9,6,81.5,3.8,94.8c-4.1,24.8-5.6,33.6,0.4,41.9c10.6,14.8,41.6,17.2,56,4.3
c11.2-9.9,4.2-21.5,15.8-31c13.8-11.4,29.9,0.5,45-12.3c9-7.6,11.1-18.4,11.7-21.9c2.5-17.1-9-30.9-16.7-40.1
C92.4,7.4,57-3,32.2,0.2C25,1.1,19.7,3.1,15.3,7C3.2,17.7,6,36.7,6.5,39.4z;
M6.5,39.4C4.9,52.6,3.2,71.6,3.8,94.8c1,39.1,7.2,45.3,10.4,47.7c9.5,7.1,18.1-0.1,46-1.5
c38.4-1.9,56.7,10.1,63.5,0.8c6.6-9.2-9.5-22.7-2.8-44c3.6-11.4,9.7-11.7,11.7-21.9c3.5-17.9-11.9-34.9-16.7-40.1
C91.8,9,56.5,9.9,47.7,10.2c-11.3,0.3-25.1,0.9-34,11.3C8.4,27.6,7,34.8,6.5,39.4z;
M6.5,39.4C7.9,62.9,6,81.5,3.8,94.8c-2.9,17.7-7.2,30.9,0.4,41.9c5.9,8.5,15.7,11,17.6,11.5
c17.9,4.5,26.2-9.4,64-27c25.6-11.9,39.7-13.9,45.3-28c3.1-7.9,1.9-15.3,1.5-17.3c-2.7-12.7-14.2-21.9-28.5-30.4
c-20-12-39.7-48.3-72-45.2C29.1,0.5,21.6,1.3,15.3,7C3.2,17.7,6,36.7,6.5,39.4z `,
"data-stylerecorder": "true",
style: { "text-align": "inherit", "line-height": "22px", "letter-spacing": "0px", "font-weight": "400", "font-size": "16px" }
})
], -1), iW = [
nW,
rW
];
function oW(t, e, n, r, i, o) {
return C(), P("svg", {
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
x: "0px",
y: "0px",
viewBox: "0 0 180 180",
style: Xe([{ transform: "rotate(60deg)", "text-align": "inherit", "line-height": "22px", "letter-spacing": "0px", "font-weight": "400", "font-size": "16px" }, { fill: t.color }]),
"data-stylerecorder": "true"
}, iW, 4);
}
const aW = /* @__PURE__ */ $e(tW, [["render", oW]]), sW = be({
name: "KBubble1",
props: {
color: {
type: String,
default: "#f7f9fd"
}
},
setup() {
return {};
}
}), uW = /* @__PURE__ */ U("path", { d: "" }, [
/* @__PURE__ */ U("animate", {
repeatCount: "indefinite",
attributeName: "d",
dur: "10s",
values: `
M161.5,95.7c-0.6-1.5-1.2-2.9-1.9-4.3c-4.1-8.1-4.7-17.5-2.1-26.6c3.8-13.2,1.3-20.5,0.1-25.1
c-3.2-12.6-12.8-20.4-15.4-22.4C126.5,5,105.2,5.7,90.9,11.8c-0.2,0.1-0.1,0-0.5,0.2c-12.2,5.3-25,9.3-38,11.1
c-6.4,0.9-12.8,2.9-18.9,6.3C10.4,41.9-0.2,68.5,8.9,90.6c6,14.4,18.7,23.8,33.4,26.8c11.1,2.3,20.3,9,24.8,18.7
c0.1,0.3,0.3,0.6,0.4,0.9c11.6,24,42.7,32.7,68.6,19C158.9,144,169.9,117.9,161.5,95.7z;
M163.7,95.5c0.2-2,0.3-4,0.3-4c0.5-7.2,1.2-15.6,0.3-24.7c-1.1-12-4.4-21.6-6.6-27.1c-2.4-5.8-4-9.7-7.1-13.8
C138.2,9.3,113.4,3.8,95.3,8.2c-2.5,0.6-1.8,0.6-6.7,2c-16.3,4.5-23.5,3.9-32.3,6.3c0,0-12.6,3.5-23,12.9
c-17.4,16-26.2,47.3-14.7,63.4c8.4,11.8,20.7,5.7,29,19.7c3.5,5.9,5.8,14.5,15.3,24.7c0,0,1.4,1.5,3,3c9.4,8.8,52.1,35.9,76.3,19.3 C158.7,148.2,161.3,120.5,163.7,95.5z;
M161.5,95.7c-0.3-0.7-0.8-2.2-1.9-4.3c-4.1-8.1-4.7-17.5-2.1-26.6c3.8-13.2,1.3-20.5,0.1-25.1
c-3.2-12.6-12.8-20.4-15.4-22.4c-15.7-12.3-37-11.6-51.3-5.5c-0.2,0.1-0.1,0-0.5,0.2c-12.2,5.3-25,9.3-38,11.1
C46,24,39.6,26,33.5,29.4C14,40.3-1,72.5,8.9,90.6c11.4,21,51.5,14.4,57.8,36.1c1.1,3.9,0.8,7.3,0.4,9.4c0.1,0.3,0.3,0.6,0.4,0.9
c12.2,24.8,41.2,35.8,65.5,26.3C166.2,150.1,167.2,107.6,161.5,95.7z;
M161.5,95.7c-0.6-1.5-1.2-2.9-1.9-4.3c-4.1-8.1-4.7-17.5-2.1-26.6c3.8-13.2,1.3-20.5,0.1-25.1
c-3.2-12.6-12.8-20.4-15.4-22.4C126.5,5,105.2,5.7,90.9,11.8c-0.2,0.1-0.1,0-0.5,0.2c-12.2,5.3-25,9.3-38,11.1
c-6.4,0.9-12.8,2.9-18.9,6.3C10.4,41.9-0.2,68.5,8.9,90.6c6,14.4,18.7,23.8,33.4,26.8c11.1,2.3,20.3,9,24.8,18.7
c0.1,0.3,0.3,0.6,0.4,0.9c11.6,24,42.7,32.7,68.6,19C158.9,144,169.9,117.9,161.5,95.7z`
})
], -1), lW = [
uW
];
function cW(t, e, n, r, i, o) {
return C(), P("svg", {
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
style: Xe({ fill: t.color }),
x: "0px",
y: "0px",
viewBox: "0 0 180 180"
}, lW, 4);
}
const dW = /* @__PURE__ */ $e(sW, [["render", cW]]), fW = be({
name: "KBubbles",
autoload: !0,
components: {
"k-bubble-1": aW,
"k-bubble-2": dW
},
props: {
type: {
type: Number,
default: 1
},
color: {
type: String,
default: "#ececec"
},
width: {
type: Number,
default: 300
},
zIndex: {
type: Number,
default: 0
},
top: {
type: [Number, String],
default: ""
},
left: {
type: [Number, String],
default: ""
},
bottom: {
type: [Number, String],
default: ""
},
right: {
type: [Number, String],
default: ""
},
rotate: {
type: Number,
default: 0
}
},
setup(t) {
return { style: L(() => {
const n = {};
return n.width = `${t.width}px`, n["z-index"] = t.zIndex, t.top !== "" && (n.top = `${t.top}px`), t.left !== "" && (n.left = `${t.left}px`), t.bottom !== "" && (n.bottom = `${t.bottom}px`), t.right !== "" && (n.right = `${t.right}px`), t.rotate !== 0 && (n.transform = `rotate(${t.rotate}deg)`), n;
}) };
}
}), pW = "_morph_1jdyo_1", hW = {
morph: pW
};
function mW(t, e, n, r, i, o) {
const a = he("k-bubble-1"), s = he("k-bubble-2");
return C(), P("div", {
style: Xe(t.style),
class: se(t.$style.morph)
}, [
t.type === 1 ? (C(), oe(a, {
key: 0,
color: t.color
}, null, 8, ["color"])) : t.type === 2 ? (C(), oe(s, {
key: 1,
color: t.color
}, null, 8, ["color"])) : F("", !0)
], 6);
}
const gW = {
$style: hW
}, bW = /* @__PURE__ */ $e(fW, [["render", mW], ["__cssModules", gW]]), vW = (t, e) => {
t.component("KLayout", VS), t.component("KButton", KS), t.component("KIcon", XS), t.component("KTitle", tE), t.component("KInput", lE), t.component("KDatepicker", L9), t.component("KSwitch", H9), t.component("KTextarea", Y9), t.component("KCheckbox", Z9), t.component("KDropzone", xM), t.component("KSelect", jM), t.component("KInputInline", KM), t.component("KInlineEditor", eD), t.component("KEditor", hz), t.component("KRadio", wz), t.component("KColor", Hz), t.component("KInputColor", Gz), t.component("KFile", Xz), t.component("KAvatar", tH), t.component("KBadge", u6), t.component("KCount", fH), t.component("KImage", xH), t.component("KLogo", AH), t.component("KTable", yF), t.component("KDate", AF), t.component("KCard", LF), t.component("KDrawer", sj), t.component("KAccordion", dj), t.component("KAccordionItem", gj), t.component("KPrice", yj), t.component("KSimpleTable", Aj), t.component("KTabs", Lj), t.component("KTab", zj), t.component("KDrag", qj), t.component("KModal", Xj), t.component("KEmpty", pU), t.component("KConfirm", aU), t.component("KLoading", bU), t.component("KHelp", SU), t.component("KAlert", OU), t.component("KSkeleton", RU), t.component("KDropdown", HU), t.component("KDropdownMenu", jU), t.component("KDropdownSubmenu", JU), t.component("KDropdownDivider", eW), t.component("KBubbles", bW), e && Object.entries(e).forEach(([n, r]) => {
var s;
const i = (s = n.split("/").pop()) == null ? void 0 : s.replace(/\.\w+$/, ""), o = r.default, a = o.name || i;
a ? t.component(a, o) : console.error(
`No se ha podido cargar el componente ${i} ya que no dispone de nombre`
);
});
}, Fb = {
price(t) {
return typeof t == "string" && (t = parseFloat(t)), t.toFixed(2) + " €";
},
float(t, e = 2) {
return typeof t == "string" && (t = parseFloat(t)), t.toFixed(e);
},
uid() {
return (Date.now() + Math.random()).toString(36).replace(".", "");
}
}, yW = (t, e, n, r = "hash", i = "/404") => {
const o = [
{
path: "/changelog",
name: "changelog",
component: () => import("./changelog-b4e9786c.mjs"),
meta: {
title: "Últimas novedades",
auth: !0
}
}
], a = [
{
path: "/",
redirect: "/dashboard",
component: () => import("./main-e41e5fb4.mjs"),
children: e.concat(o)
},
{
path: "/",
component: () => import("./auth-0615b8fc.mjs"),
children: [
{
path: "/login",
name: "login",
component: () => import("./login-fb37a5b1.mjs"),
meta: {
title: "Iniciar sesión",
public: !0
}
},
{
path: "/register",
name: "register",
component: () => import("./register-f452c5a9.mjs"),
meta: {
title: "Nueva cuenta",
public: !0
}
},
{
path: "/forgot-password",
name: "forgotPassword",
component: () => import("./forgot-c781ac51.mjs"),
meta: {
title: "Restablecimiento de clave",
public: !0
}
}
]
},
{
// the 404 route, when none of the above matches
path: "/404",
name: "404",
component: () => import("./404-31123e61.mjs"),
meta: {
title: "Página no encontrada",
public: !0
}
},
{
// the 404 route, when none of the above matches
path: "/403",
name: "403",
component: () => import("./403-c88de389.mjs"),
meta: {
title: "Página no encontrada",
public: !0
}
},
{
// the 404 route, when none of the above matches
path: "/500",
name: "500",
component: () => import("./500-b7455a71.mjs"),
meta: {
title: "Error interno",
public: !0
}
}
];
typeof i == "string" && a.push({
path: "/:pathMatch(.*)*",
redirect: i
});
const s = _S({
history: r === "hash" ? E5() : r === "memory" ? S5() : sy(),
routes: a
});
return n && s.beforeEach(n), t.use(s), s;
};
function jW(t, e) {
e === void 0 && (e = Tl(K8));
const n = n4();
return n.use(rx), e.use(n), e.use(
Xk,
// optional
{
directive: "tooltip",
component: "k-tooltip",
componentSingleton: "k-tooltip-singleton",
defaultProps: {
placement: "auto-end",
theme: "kodama",
allowHTML: !1,
animation: "scale",
arrow: !0,
hideOnClick: !1,
appendTo: () => document.body
}
// => Global default options * see all props
}
), yW(
e,
t.router.routes,
t.router.beforeEach,
t.router.mode,
t.router.route404
), vW(e, t.components), e.config.globalProperties.settings = t.settings, e.config.globalProperties.$filters = Fb, e.config.globalProperties.$dayjs = at, e.provide("toast", d_), e.provide("dayjs", at), e.provide("$menu", t.menu), e.provide("$auth", t.auth), e.provide("$settings", t.settings), e.provide("$filters", Fb), e;
}
export {
Lh as A,
$e as _,
Ht as a,
EW as b,
F8 as c,
xW as d,
SW as e,
to as f,
_W as g,
z8 as h,
jW as i,
TW as j,
at as k,
nr as l,
B8 as m,
d_ as t,
xy as u,
kW as v
};