UNPKG

@xpytest/gantt-core

Version:

A powerful and flexible Gantt chart component library for modern web applications with TypeScript support

1,560 lines 212 kB
var _t = Object.defineProperty; var Ht = (g, t, e) => t in g ? _t(g, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : g[t] = e; var r = (g, t, e) => Ht(g, typeof t != "symbol" ? t + "" : t, e); import D from "dayjs"; import { default as Ue } from "dayjs"; import { merge as q, isArray as N, isString as F, isFunction as z, cloneDeep as B, isObject as gt, isNumber as At, omit as rt, throttle as ht, isBoolean as V } from "lodash-es"; import S from "konva"; const mt = "0.0.3"; function It() { const g = "#eca710", t = "#ffffff", e = "#e7209e", i = "#ffffff", s = "#1c42e8"; [ " __ __ _____ _____ _____ _____ _____ ", "| | || __|| _ || | ||_ _||_ _|", "|- -|| | || || | | | | | | | ", "|__|__||_____||__|__||_|___| |_| |_| " ].forEach((o) => { console.log( `%c${o}`, `color: ${g}; font-weight: bold; font-family: monospace;` ); }), console.log( `%c 🚀 欢迎使用 XGantt %c Version: ${mt} `, `background-color: ${e}; color: ${t}; padding: 2px 4px; border-radius: 6px 0 0 6px; font-weight: bold; margin: 4px 0;`, `background-color: ${s}; color: ${i}; padding: 2px 4px; border-radius: 0 6px 6px 0; font-weight: normal; margin: 4px 0;` ); } const I = class I { /** * 设置日志配置 * @param options - 新的日志配置 */ static setOptions(t) { I.options = { ...I.options, ...t }; } /** * 获取当前日志级别 * @returns 当前设置的日志级别 */ static getLevel() { return I.options.level; } /** * 输出 DEBUG 级别的日志 * 仅当当前日志级别 <= DEBUG 时输出 * @param args - 需要打印的参数 */ static debug(...t) { I.logWithLevel(1, console.debug, ...t); } /** * 输出 INFO 级别的日志 * 仅当当前日志级别 <= INFO 时输出 * @param args - 需要打印的参数 */ static info(...t) { I.logWithLevel(2, console.info, ...t); } /** * 输出 WARN 级别的日志 * 仅当当前日志级别 <= WARN 时输出 * @param args - 需要打印的参数 */ static warn(...t) { I.logWithLevel(3, console.warn, ...t); } /** * 输出 ERROR 级别的日志 * 仅当当前日志级别 <= ERROR 时输出 * @param args - 需要打印的参数 */ static error(...t) { I.logWithLevel(4, console.error, ...t); } /** * 断言方法 * 如果条件为 false,则输出 ERROR 级别的日志 * @param condition - 断言条件 * @param args - 断言失败时需要打印的参数 */ static assert(t, ...e) { if (!t && I.options.level <= 4) { const i = I.formatArgs("Assertion failed:", ...e); console.error(...i); } } /** * 返回日志信息 */ static getMessage(...t) { return I.formatArgs(...t).join(""); } /** * 抛出异常 */ static exception(...t) { return new Error(I.getMessage(...t)); } /** * 根据级别输出日志的核心方法 * @param level - 当前尝试输出的日志级别 * @param logFn - 使用的 console 方法 (console.log, console.warn, etc.) * @param args - 需要打印的参数 */ static logWithLevel(t, e, ...i) { if (I.options.level <= t) { const s = I.formatArgs(...i); e(...s); } } /** * 格式化日志参数,添加前缀和可选的时间戳 * @param args - 原始日志参数 * @returns 格式化后的日志参数数组 */ static formatArgs(...t) { const e = [I.Prefix]; return I.options.showTimestamp && e.unshift(`[${D().format("YYYY-MM-DD HH:mm:ss.SSS")}]`), [e.join(""), ...t]; } }; r(I, "Prefix", "[XGantt]"), r(I, "options", { // 默认级别,INFO 及以上会被打印 level: 2, // 默认不显示时间戳 showTimestamp: !1 }); let O = I; const tt = () => ({ data: [], links: { show: !1, key: "id", data: [], distance: 20, dash: [6, 3], width: 1, gap: 5, arrow: { width: 6, height: 8 }, radius: 3, create: { enabled: !1, mode: "hover", radius: 3, width: 2, from: !0, to: !0 } }, fields: { id: "id", startTime: "startTime", endTime: "endTime", name: "name", progress: "progress", children: "children" }, selection: { enabled: !1, includeSelf: !0 }, expand: { show: !0, enabled: !0 }, dateFormat: "YYYY-MM-DD HH:mm:ss", locale: "en", unit: "day", table: { width: 100, ellipsis: !0, align: "center", headerAlign: "center", emptyText: "-" }, chart: { autoCellWidth: !1, cellWidth: "normal" }, primaryColor: "#eca710", border: { color: "#e5e5e5" }, header: { height: 80, color: "#000", fontSize: 14, fontWeight: 600, fontFamily: "Arial" }, row: { height: 30, indent: 16, hover: { backgroundColor: "#000", opacity: 0.05 }, select: { backgroundColor: "#000", opacity: 0.1 } }, bar: { height: 20, move: { byUnit: !1, link: { child: "none", parent: "none" } } }, today: { show: !0, type: "line", backgroundColor: "lightblue", opacity: 1, width: 1 }, weekend: { show: !0, backgroundColor: "#c9c9c9", opacity: 0.1 }, holiday: { opacity: 0.1 } }); class Wt { constructor() { r(this, "options", tt()); } getOptions() { return this.options; } setOptions(t, e = { merge: !0 }) { var i; this.options = e.merge ? q(tt(), this.options, t) : q(tt(), t), N((i = t.links) == null ? void 0 : i.data) && (this.options.links.data = t.links.data); } update(t) { this.setOptions(t); } getRowBackgroundColor(t) { var s; let e = ""; const i = (s = this.options.row) == null ? void 0 : s.backgroundColor; return F(i) ? e = i : N(i) && i.length > 0 ? e = i[t.level] : z(i) && (e = i(t.getEmitData())), e; } } class $t { constructor() { r(this, "events", /* @__PURE__ */ new Map()); } /** * 注册事件监听器 * @param event 事件名称 * @param callback 回调函数 */ on(t, e) { var i; this.events.has(t) || this.events.set(t, []), (i = this.events.get(t)) == null || i.push(e); } /** * 触发事件 * @param event 事件名称 * @param args 参数列表 */ emit(t, ...e) { var i; this.events.has(t) && ((i = this.events.get(t)) == null || i.forEach((s) => s(...e))); } /** * 移除特定事件的特定监听器 * @param event 事件名称 * @param callback 要移除的回调函数 */ off(t, e) { var i; this.events.has(t) && this.events.set( t, ((i = this.events.get(t)) == null ? void 0 : i.filter((s) => s !== e)) || [] ); } /** * 移除所有事件监听器 */ offAll() { this.events.clear(); } } var v = /* @__PURE__ */ ((g) => (g.COLUMN_WIDTH_CHANGE = "column-width-change", g.MOVE_GUIDELINE = "move-guideline", g.SHOW_GUIDELINE = "show-guideline", g.HIDE_GUIDELINE = "hide-guideline", g.SCROLL = "scroll", g.CHART_OFFSET_CHANGE = "chart_offset_change", g.DATA_UPDATE = "data-update", g.VIEW_UPDATE = "view-update", g.UPDATE_TABLE_HEADER = "update_table_header", g.UPDATE_TABLE_BODY = "update_table_body", g.UPDATE_CHART_HEADER = "update_chart_header", g.UPDATE_TASK = "update_task", g.UPDATE_LINK = "update_link", g.CREATE_LINK = "create_link", g.TASK_SELECTED = "task_selected", g.TASK_UNSELECTED = "task_unselected", g.SELECT_LINK = "select_link", g.CHECK_TASK = "check_task", g.ROW_CLICK = "row-click", g.ROW_DBL_CLICK = "row-dbl-click", g.ROW_CONTEXTMENU = "row-contextmenu", g.SLIDER_CLICK = "slider-click", g.SLIDER_DBL_CLICK = "slider-dbl-click", g.SLIDER_CONTEXTMENU = "slider-contextmenu", g.ROW_HIGHLIGHT = "row-highlight", g.ROW_UNHIGHLIGHT = "row-unhighlight", g.TASK_DRAG_START = "task-drag-start", g.TASK_DRAG_MOVE = "task-drag-move", g.TASK_DRAG_END = "task-drag-end", g.ERROR = "error", g))(v || {}), X = /* @__PURE__ */ ((g) => (g.LINK_NOT_ALLOWED = "link:not-allowed", g.LINK_SAME = "link:same", g))(X || {}); function Z() { return Math.random().toString(36).substring(2, 15); } class K { constructor(t, e, i, s, n) { /** * 任务ID * 如果没有提供,则会自动生成一个唯一ID */ r(this, "id"); /** * 任务名称 */ r(this, "name"); /** * 任务开始时间 * 如果没有提供,则默认为 undefined */ r(this, "startTime"); /** * 任务结束时间 * 如果没有提供,则默认为 undefined */ r(this, "endTime"); /** * 任务进度 */ r(this, "progress"); /** * 是否展开 * 如果没有提供,则默认为 true */ r(this, "expanded"); /** * 子任务列表 * 如果没有子任务,则默认为空数组 */ r(this, "children"); /** * 父任务 * 如果没有父任务,则默认为 undefined */ r(this, "parent"); /** * 任务层级,从0开始 */ r(this, "level"); /** * 在扁平化列表中的索引位置,从0开始 */ r(this, "flatIndex"); /** * 原始数据 */ r(this, "data"); r(this, "fields"); this.store = t, this.event = e, this.fields = this.store.getOptionManager().getOptions().fields, this.id = n || i[this.fields.id] || Z(), this.data = i, this.name = i[this.fields.name] || ""; const o = i[this.fields.startTime]; this.startTime = o ? D(o) : void 0; const h = i[this.fields.endTime]; this.endTime = h ? D(h) : void 0, this.progress = i[this.fields.progress], this.expanded = this.store.getOptionManager().getOptions().expand.show ? this.store.getOptionManager().getOptions().expand.enabled : !0, this.children = [], this.level = s && s.level !== void 0 ? s.level + 1 : 0, this.parent = s, this.flatIndex = 0, Array.isArray(i[this.fields.children]) && (this.children = i[this.fields.children].map( (a) => this.addChild(a) )), this.store.updateTime(this.startTime, this.endTime); } addChild(t) { const e = t instanceof K ? t : new K(this.store, this.event, t, this); return e.parent = this, e.level = this.level !== void 0 ? this.level + 1 : 0, e; } getField(t) { if (!t || F(t) && t.trim() === "") return; if (!t.includes(".")) return this.data[t]; const e = t.split("."); let i = this.data; for (let s = 0; s < e.length; s++) { const n = e[s]; if (i == null || typeof i != "object" || !(n in i)) return; i = i[n]; } return gt(i) ? B(i) : i; } updateTime(t, e) { var s, n; this.startTime = t, this.endTime = e; const i = (n = (s = this.store) == null ? void 0 : s.getOptionManager().getOptions()) == null ? void 0 : n.dateFormat; this.data[this.fields.startTime || "startTime"] = this.startTime.format(i), this.data[this.fields.endTime || "endTime"] = this.endTime.format(i), this.event.emit(v.UPDATE_TASK, this); } clone() { return new K( this.store, this.event, B(this.data), this.parent, this.id ); } getEmitData() { return { data: this.data, $index: this.flatIndex, level: this.level + 1 }; } getAllChildren() { const t = [], e = (i) => { i.forEach((s) => { t.push(s), N(s.children) && s.children.length > 0 && e(s.children); }); }; return e(this.children), t; } } class Rt { constructor(t, e) { /** * 原始数据 */ r(this, "rawData", []); /** * 任务列表。树形结构 */ r(this, "tasks", []); /** * 任务映射,使用ID作为键,便于快速查找 */ r(this, "taskMap", /* @__PURE__ */ new Map()); /** * 缓存扁平化的可视任务列表 * 用于提高性能,避免每次都遍历树形结构 */ r(this, "visibleTasksCache", []); /** 标记缓存是否需要更新 */ r(this, "isDirty", !0); /** 存储当前选中的任务ID */ r(this, "selectedTaskId", null); /** 选中列表 */ r(this, "checkedList", []); /** 是否为多层结构 */ r(this, "isMultiLevel", !1); this.store = t, this.event = e; } /** * 设置源数据并初始化任务 */ setData(t) { this.rawData = t, this.initTasks(), this.invalidateCache(), this.event.emit(v.DATA_UPDATE); } /** * 初始化任务 */ initTasks() { this.tasks = [], this.taskMap.clear(), this.isMultiLevel = !1, this.rawData.forEach((t) => { const e = new K(this.store, this.event, t); this.tasks.push(e), this.registerTaskInMap(e); }); } /** * 在映射中注册任务及其子任务 */ registerTaskInMap(t) { this.taskMap.set(t.id, t), t.children && t.children.length > 0 && (t.children.forEach((e) => { this.registerTaskInMap(e); }), this.isMultiLevel = !0); } /** * 获取源数据 */ getData() { return this.rawData; } /** * 获取所有任务 */ getTasks(t = !0) { return t ? this.tasks : Array.from(this.taskMap.values()); } /** * 通过 ID 获取任务 */ getTaskById(t) { return this.taskMap.get(t); } /** * 移动任务位置 */ // moveTask( // id: string, // targetParentId?: string, // index?: number // ): Task | undefined { // const task = this.getTaskById(id); // if (!task) { // return undefined; // } // // 从原位置移除 // if (task.parent && task.parent.children) { // task.parent.children = task.parent.children.filter( // child => child.id !== id // ); // } else { // this.tasks = this.tasks.filter(t => t.id !== id); // } // // 移动到新位置 // let targetTasks: Task[]; // let targetParent: Task | undefined; // if (targetParentId) { // targetParent = this.getTaskById(targetParentId); // if (!targetParent) { // return undefined; // } // targetTasks = targetParent.children || []; // targetParent.children = targetTasks; // } else { // targetTasks = this.tasks; // } // // 更新任务的父任务和层级 // task.parent = targetParent; // task.level = targetParent // ? targetParent.level !== undefined // ? targetParent.level + 1 // : 0 // : 0; // // 更新子任务的层级 // if (task.children && task.children.length > 0) { // this.updateChildrenLevel(task); // } // // 插入到目标位置 // if (index !== undefined && index >= 0 && index <= targetTasks.length) { // targetTasks.splice(index, 0, task); // } else { // targetTasks.push(task); // } // this.invalidateCache(); // 移动任务后,缓存失效 // this.event.emit(EventName.VIEW_UPDATE); // return task; // } /** * 展开任务 */ expandTask(t, e = !1) { const i = this.getTaskById(t); return i ? (i.expanded = !i.expanded, e && i.children && i.children.length > 0 && i.children.forEach((s) => { this.expandTask(s.id, e); }), this.invalidateCache(), this.event.emit(v.VIEW_UPDATE), !0) : !1; } /** * 按条件筛选任务 */ // filterTasks(criteria: (task: Task) => boolean): Task[] { // return Array.from(this.taskMap.values()).filter(criteria); // } /** * 排序任务 */ // sortTasks( // compareFn: (a: Task, b: Task) => number, // parentId?: string // ): Task[] { // let tasksToSort: Task[]; // if (parentId) { // const parent = this.getTaskById(parentId); // if (!parent || !parent.children) { // return []; // } // tasksToSort = parent.children; // } else { // tasksToSort = this.tasks; // } // tasksToSort.sort(compareFn); // this.invalidateCache(); // 排序后,缓存失效 // // this.emit("tasks:sorted", { parentId, tasks: tasksToSort }); // return tasksToSort; // } /** * 获取扁平化的任务列表,包括已展开的子任务 * 使用缓存提高性能,只有在必要时才会重建列表 */ getVisibleTasks() { if (!this.isDirty && this.visibleTasksCache.length > 0) return this.visibleTasksCache; const t = []; let e = 0; const i = (s, n) => { s.flatIndex = e++, t.push(s), s.expanded && s.children && s.children.length > 0 && s.children.forEach((o) => i(o)); }; return this.tasks.forEach((s) => i(s)), this.visibleTasksCache = t, this.isDirty = !1, t; } /** * 获取可展示任务数量 */ getVisibleSize() { return this.getVisibleTasks().length; } /** 检查任务是否可见 */ isTaskVisible(t) { return this.getVisibleTasks().some((e) => e.id === t.id); } /** * 清空所有数据 */ clear() { this.rawData = [], this.tasks = [], this.taskMap.clear(), this.visibleTasksCache = [], this.isDirty = !0, this.event.emit(v.DATA_UPDATE); } /** * 更新子任务的层级 */ // private updateChildrenLevel(task: Task): void { // if (!task.children || task.children.length === 0) { // return; // } // const parentLevel = task.level !== undefined ? task.level : 0; // task.children.forEach(child => { // child.level = parentLevel + 1; // this.updateChildrenLevel(child); // }); // } /** * 使缓存失效,标记需要重新生成扁平化任务列表 */ invalidateCache() { this.isDirty = !0; } /** * 选择任务 * @param taskId 任务ID * @returns 是否选择成功 */ selectTask(t) { const e = this.getTaskById(t); return e ? (this.selectedTaskId === t || (this.unselectTask(), this.selectedTaskId = t, this.event.emit(v.TASK_SELECTED, e)), !0) : !1; } /** * 取消任务选择 */ unselectTask() { if (this.selectedTaskId) { const t = this.selectedTaskId; this.selectedTaskId = null, this.event.emit(v.TASK_UNSELECTED, t); } } /** * 检查任务是否被选中 * @param taskId 任务ID * @returns 是否被选中 */ isTaskSelected(t) { return this.selectedTaskId === t; } /** * 获取当前选中的任务 * @returns 选中的任务,如果没有则返回undefined */ getSelectedTask() { return this.selectedTaskId ? this.getTaskById(this.selectedTaskId) : void 0; } getCheckedList() { return this.checkedList; } updateCheckedList(t, e) { const i = this.checkedList.findIndex((s) => s.id === e.id); t ? i === -1 ? this.checkedList.push(e) : this.checkedList.splice(i, 1, e) : i !== -1 && this.checkedList.splice(i, 1); } toggleAllChecked(t) { t ? this.checkedList = this.getVisibleTasks().slice() : this.checkedList = []; } isTaskChecked(t) { return this.checkedList.findIndex((e) => e.id === t.id) !== -1; } updateTaskTime(t, e, i, s, n = []) { let o = e, h = i; const a = this.store.getOptionManager().getOptions().bar.move.link.child, d = this.store.getOptionManager().getOptions().bar.move.link.parent, u = this.store.getTimeAxis().getCellUnit(); let l = t.parent; for (; d !== "none" && l; ) { if (d === "expand") { let p = l.startTime || o, f = l.endTime || h; (!l.startTime || o.isBefore(l.startTime)) && (p = o), (!l.endTime || h.isAfter(l.endTime)) && (f = h), (l.startTime === void 0 || l.endTime === void 0 || !p.isSame(l.startTime) || !f.isSame(l.endTime)) && (n.findIndex((m) => m.id === l.id) === -1 && n.push(l.clone()), l.updateTime(p, f)); } else d === "strict" && (l.startTime && o.isBefore(l.startTime) && (o = l.startTime, h.isSameOrBefore(o) && (h = o.add(1, u))), l.endTime && h.isAfter(l.endTime) && (h = l.endTime, o.isAfter(h) && (o = h.subtract(1, u)))); l = l.parent; } let c = t.children || []; for (; a !== "none" && c.length > 0; ) { const p = []; c.forEach((f) => { let m = f.startTime || o, x = f.endTime || h, b = o.diff(t.startTime), T = h.diff(t.endTime); a === "scale" ? s === "both" ? (n.findIndex((w) => w.id === f.id) === -1 && n.push(f.clone()), f.updateTime(m.add(b), x.add(T))) : s === "left" ? (m = m.add(b), m.isSameOrAfter(x.subtract(1, u)) && (x.isBefore(t.endTime) ? x = m.add(1, u) : m = x.subtract(1, u), m.isSameOrBefore(o) && (o = m)), n.findIndex((w) => w.id === f.id) === -1 && n.push(f.clone()), f.updateTime(m, x)) : s === "right" && (x = x.add(T), x.isSameOrBefore(m.add(1, u)) && (m.isAfter(t.startTime) ? m = x.subtract(1, u) : x = m.add(1, u)), x.isSameOrAfter(h) && (h = x), n.findIndex((w) => w.id === f.id) === -1 && n.push(f.clone()), f.updateTime(m, x)) : a === "fixed" && (s === "both" ? (n.findIndex((w) => w.id === f.id) === -1 && n.push(f.clone()), f.updateTime(m.add(b), x.add(T))) : s === "left" ? m.isSameOrBefore(o) && (m = o, m.isSameOrAfter(x.subtract(1, u)) && (x.isBefore(t.endTime) ? x = m.add(1, u) : m = x.subtract(1, u), m.isSameOrBefore(o) && (o = m)), n.findIndex((w) => w.id === f.id) === -1 && n.push(f.clone()), f.updateTime(m, x)) : s === "right" && x.isSameOrAfter(h) && (x = h, x.isSameOrBefore(m.add(1, u)) && (m.isAfter(t.startTime) ? m = x.subtract(1, u) : x = m.add(1, u)), x.isSameOrAfter(h) && (h = x), n.findIndex((w) => w.id === f.id) === -1 && n.push(f.clone()), f.updateTime(m, x))), f.children && f.children.length > 0 && p.push(...f.children); }), c = p; } n.findIndex((p) => p.id === t.id) === -1 && n.push(t.clone()), t.updateTime(o, h); } } function H(g, t, e) { if (!Number.isFinite(g) || !Number.isFinite(t) || !Number.isFinite(e)) return Number.isFinite(t) ? t : 0; const i = Math.min(t, e), s = Math.max(t, e); return Math.min(Math.max(i, g), s); } function at(g, t) { let e = g; return F(e) && (/%$/.test(e) ? e = t * parseFloat(e) / 100 : e = parseFloat(e)), isNaN(e) ? 0 : e; } function lt(g, t) { if (t === 0) throw new Error("基准值不能为0"); if (Math.abs(g) <= t / 2) return 0; const e = Math.floor(g / t), i = Math.ceil(g / t), s = e * t, n = i * t, o = Math.abs(g - s), h = Math.abs(g - n); return o <= h ? s : n; } function et(g, t = 4) { return typeof g == "number" ? [g, g, g, g] : Array.isArray(g) ? [ g[0] ?? t, g[1] ?? t, g[2] ?? t, g[3] ?? t ] : [t, t, t, t]; } function Gt(g, t = 100) { if (!Number.isFinite(g) || !Number.isFinite(t) || t === 0 || g < 0) return 0; const e = g / Math.abs(t); return Math.min(e, 1); } function Yt(g, t = 2, e = !1) { const i = g.toFixed(t); return e ? i : i.replace(/\.?0+$/, ""); } function Pt(g) { var s; if (typeof g == "object" && g !== null) return { r: H(g.r ?? 0, 0, 255), g: H(g.g ?? 0, 0, 255), b: H(g.b ?? 0, 0, 255), a: H(g.a ?? 1, 0, 1) }; if (typeof g != "string") return O.warn(`Invalid color value type: ${typeof g}`), null; let t = g.trim(); const e = (s = document == null ? void 0 : document.createElement("canvas")) == null ? void 0 : s.getContext("2d"); if (e && (e.fillStyle = t, t = e.fillStyle), t.startsWith("#")) { const n = t.slice(1); let o, h, a, d, u = 1; try { o = parseInt(n, 16); } catch { return O.warn(`Invalid hex color: ${g}`), null; } if (n.length === 3) h = (o >> 8 & 15) * 17, a = (o >> 4 & 15) * 17, d = (o & 15) * 17; else if (n.length === 6) h = o >> 16 & 255, a = o >> 8 & 255, d = o & 255; else if (n.length === 8) h = o >> 24 & 255, a = o >> 16 & 255, d = o >> 8 & 255, u = (o & 255) / 255; else return O.warn(`Invalid hex color length: ${g}`), null; return { r: h, g: a, b: d, a: u }; } let i = t.match( /rgba?\(\s*(\d+%?)\s*,\s*(\d+%?)\s*,\s*(\d+%?)\s*(?:,\s*([\d.]+)\s*)?\)/i ); if (i) { const n = (o) => o.endsWith("%") ? H(parseFloat(o) / 100 * 255, 0, 255) : H(parseInt(o, 10), 0, 255); return { r: n(i[1]), g: n(i[2]), b: n(i[3]), a: i[4] !== void 0 ? H(parseFloat(i[4]), 0, 1) : 1 }; } return O.warn(`Could not parse color: ${g}`), null; } function zt(g, t, e, i, s = !1, n = !1) { const o = (c) => { const p = Math.round(H(c, 0, 255)).toString(16); return p.length === 1 ? "0" + p : p; }, h = o(g), a = o(t), d = o(e), u = o(i * 255); if (s && h[0] === h[1] && a[0] === a[1] && d[0] === d[1] && i === 1 && // Alpha 必须为 1 才能缩写 !n) return `#${h[0]}${a[0]}${d[0]}`; const l = `#${h}${a}${d}`; return n || i < 1 ? `${l}${u}` : l; } class j { /** * 创建一个新的 Colorjs 实例。 * 推荐使用 colorjs(value) 工厂函数来创建。 * @param value - 颜色值 (字符串, 如 '#rgb', '#rrggbb', 'rgb()', 'rgba()', 颜色名; 或对象 {r, g, b, a}) * @throws {Error} 如果颜色值无法解析 */ constructor(t) { // 使用 private 属性,强制通过方法访问和修改 r(this, "_r"); r(this, "_g"); r(this, "_b"); r(this, "_a"); const e = Pt(t); e === null ? (O.error(`Failed to parse color: ${t}. Using default black.`), this._r = 0, this._g = 0, this._b = 0, this._a = 1) : (this._r = Math.round(e.r), this._g = Math.round(e.g), this._b = Math.round(e.b), this._a = e.a); } // --- Getters --- /** 获取 Red 通道值 (0-255) */ get R() { return this._r; } /** 获取 Green 通道值 (0-255) */ get G() { return this._g; } /** 获取 Blue 通道值 (0-255) */ get B() { return this._b; } /** 获取 Alpha 通道值 (0-1) */ get A() { return this._a; } red(t) { return t === void 0 ? this._r : (this._r = Math.round(H(t, 0, 255)), this); } green(t) { return t === void 0 ? this._g : (this._g = Math.round(H(t, 0, 255)), this); } blue(t) { return t === void 0 ? this._b : (this._b = Math.round(H(t, 0, 255)), this); } alpha(t) { return t === void 0 ? this._a : (this._a = H(t, 0, 1), this); } // --- 输出方法 --- /** * 输出为 Hex (#RRGGBB) 或 HexA (#RRGGBBAA) 格式字符串。 * @param allow3Char - 是否允许输出 #RGB 简写格式 (如果可能, 默认 false)。 * @param forceAlpha - 是否强制输出 Alpha 通道 (即使 a=1, 默认 false)。 * @returns Hex/HexA 字符串。 */ toHex(t = !1, e = !1) { return zt( this._r, this._g, this._b, this._a, t, e ); } /** * 输出为 rgb() 或 rgba() 格式字符串。 * @returns 'rgb(r, g, b)' 或 'rgba(r, g, b, a)' 格式字符串。 */ toRgb() { const t = Math.round(this._r), e = Math.round(this._g), i = Math.round(this._b); if (this._a === 1) return `rgb(${t}, ${e}, ${i})`; { const s = parseFloat(this._a.toFixed(2)); return `rgba(${t}, ${e}, ${i}, ${s})`; } } /** * 输出为包含 r, g, b, a 的对象。 * @returns RGBA 对象 { r, g, b, a }。 */ toObject() { return { r: this._r, g: this._g, b: this._b, a: this._a }; } /** * 默认字符串表示形式,输出为 rgba 格式。 * @returns rgba 格式字符串。 */ toString() { return this.toRgb(); } // --- 操作方法 (返回 this 以支持链式调用) --- /** * 增加颜色亮度。 * @param amount - 增加的百分比 (0-100),默认为 10。 * @returns 当前 Colorjs 实例。 */ brighten(t = 10) { if (t < 0) return this.darken(-t); const e = H(t, 0, 100) / 100; return this._r = Math.round(H(this._r + (255 - this._r) * e, 0, 255)), this._g = Math.round(H(this._g + (255 - this._g) * e, 0, 255)), this._b = Math.round(H(this._b + (255 - this._b) * e, 0, 255)), this; } /** * 降低颜色亮度 (变暗)。 * @param amount - 降低的百分比 (0-100),默认为 10。 * @returns 当前 Colorjs 实例。 */ darken(t = 10) { if (t < 0) return this.brighten(-t); const e = H(t, 0, 100) / 100; return this._r = Math.round(H(this._r * (1 - e), 0, 255)), this._g = Math.round(H(this._g * (1 - e), 0, 255)), this._b = Math.round(H(this._b * (1 - e), 0, 255)), this; } /** * 判断颜色是否偏亮。 * 使用标准的亮度计算公式。 * @returns 如果颜色偏亮则返回 true,否则返回 false。 */ isLight() { return (this._r * 299 + this._g * 587 + this._b * 114) / 1e3 > 128; } /** * 判断颜色是否偏暗。 * @returns 如果颜色偏暗则返回 true,否则返回 false。 */ isDark() { return !this.isLight(); } /** * 混合当前颜色与指定颜色。 * @param colorToMix - 要混合的颜色 (Colorjs 实例或可被 colorjs() 解析的颜色值)。 * @param amount - 混合的比例 (0-100),表示 `colorToMix` 所占的权重,默认为 50 (各占一半)。 * @returns 当前 Colorjs 实例。 */ mix(t, e = 50) { const i = H(e, 0, 100) / 100, s = W(t); return this._r = Math.round( H(this._r * (1 - i) + s.R * i, 0, 255) ), this._g = Math.round( H(this._g * (1 - i) + s.G * i, 0, 255) ), this._b = Math.round( H(this._b * (1 - i) + s.B * i, 0, 255) ), this._a = H(this._a * (1 - i) + s.A * i, 0, 1), this; } /** * 创建当前颜色对象的副本。 * @returns 一个新的 Colorjs 实例,具有相同的颜色值。 */ clone() { return new j({ r: this._r, g: this._g, b: this._b, a: this._a }); } // --- 静态方法 --- /** * 扩展 Colorjs 功能的插件机制。 * @param plugin - 插件函数。 * @param option - 传递给插件的选项 (可选)。 */ static extend(t, e) { typeof t == "function" ? t(e, j, W) : O.warn( "Invalid plugin provided to Colorjs.extend. Expected a function." ); } } const W = (g) => g instanceof j ? g : new j(g); class ft { constructor(t, e, i) { r(this, "element"); r(this, "iconElement"); r(this, "_state", 0); r(this, "options"); var o; this.context = t, this.container = e, this.task = i; const n = (this.task ? this.context.store.getDataManager().isTaskChecked(this.task) : !1) ? 1 : 0; this.options = { initialState: n, size: 14 }, this.element = document.createElement("div"), this.iconElement = document.createElement("div"), this._state = this.options.initialState, this.createElement(), this.updateIcon(), this.bindEvents(), this.registerEvents(), (o = this.container) == null || o.appendChild(this.element); } createElement() { this.element.className = "x-gantt-checkbox", this.element.style.width = `${this.options.size}px`, this.element.style.height = `${this.options.size}px`, this.element.style.setProperty( "border", `1px solid ${this.context.store.getOptionManager().getOptions().border.color}`, "important" ), this.iconElement.className = "x-gantt-checkbox__icon", this.iconElement.style.cssText = ` display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #ffffff; font-size: ${Math.floor(this.options.size * 0.75)}px; line-height: 1; `, this.element.appendChild(this.iconElement), this.element.addEventListener("mouseenter", () => { this._state === 0 && this.element.classList.add("hover"); }), this.element.addEventListener("mouseleave", () => { this._state === 0 && this.element.classList.remove("hover"); }); } updateIcon() { const t = this.context.store.getOptionManager().getOptions().primaryColor; this.iconElement.innerHTML = ""; let e = "#ffffff", i = W(t).alpha(0.5).toHex(); switch (this._state) { case 0: e = "#ffffff", i = i; break; case 1: e = t, i = t, this.iconElement.innerHTML = ` <svg width="12" height="9" viewBox="0 0 12 9" fill="none"> <path d="M10.5 1.5L4.5 7.5L1.5 4.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> </svg> `; break; case 2: e = t, i = t, this.iconElement.innerHTML = ` <svg width="8" height="2" viewBox="0 0 8 2" fill="none"> <rect width="8" height="2" fill="currentColor" rx="1"/> </svg> `; break; } this.iconElement.style.setProperty( "background-color", e, "important" ), this.iconElement.style.setProperty( "border-color", i, "important" ); } bindEvents() { this.element.addEventListener("click", (t) => { if (t.preventDefault(), t.stopPropagation(), this.task) { const e = this.context.store.getDataManager().isTaskChecked(this.task); e ? (this.context.store.getDataManager().updateCheckedList(!1, this.task), this.setState( 0 /* UNCHECKED */ )) : (this.context.store.getDataManager().updateCheckedList(!0, this.task), this.setState( 1 /* CHECKED */ )), this.context.event.emit(v.CHECK_TASK, [this.task], !e); } else { const e = this.context.store.getDataManager().getCheckedList().length === this.context.store.getDataManager().getVisibleSize(); this.setState( e ? 1 : 0 /* UNCHECKED */ ), this.context.store.getDataManager().toggleAllChecked(!e), this.context.event.emit( v.CHECK_TASK, this.context.store.getDataManager().getVisibleTasks(), !e ); } }), this.element.addEventListener("contextmenu", (t) => { if (t.preventDefault(), t.stopPropagation(), this.task) { const e = this.task.getAllChildren(); if (e.length === 0) return; this.context.store.getOptionManager().getOptions().selection.includeSelf && e.unshift(this.task); const i = e.every( (s) => this.context.store.getDataManager().isTaskChecked(s) ); i ? (e.forEach((s) => { this.context.store.getDataManager().updateCheckedList(!1, s); }), this.setState( 0 /* UNCHECKED */ )) : (e.forEach((s) => { this.context.store.getDataManager().updateCheckedList(!0, s); }), this.setState( 1 /* CHECKED */ )), this.context.event.emit(v.CHECK_TASK, e, !i); } else { const e = this.context.store.getDataManager().getCheckedList().length === this.context.store.getDataManager().getVisibleSize(); this.setState( e ? 1 : 0 /* UNCHECKED */ ), this.context.store.getDataManager().toggleAllChecked(!e), this.context.event.emit( v.CHECK_TASK, this.context.store.getDataManager().getVisibleTasks(), !e ); } }); } registerEvents() { this.context.event.on(v.CHECK_TASK, this.updateState.bind(this)); } /** 获取元素 */ getElement() { return this.element; } /** * 设置状态 */ setState(t) { this._state !== t && (this._state = t, this.updateIcon()); } /** * 更新状态 */ updateState() { if (this.task) { const t = this.context.store.getDataManager().isTaskChecked(this.task); this.setState( t ? 1 : 0 /* UNCHECKED */ ); } else { const t = this.context.store.getDataManager().getCheckedList().length === this.context.store.getDataManager().getVisibleSize(); this.setState( t ? 1 : 0 /* UNCHECKED */ ); } } /** * 销毁组件 */ destroy() { this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element); } } const ct = "handler_column"; class Ft { constructor(t) { /** 源列数据 */ r(this, "sourceColumns", []); /** 处理后的所有列数据 */ r(this, "columns", []); /** 叶子列数据,只包含最终显示的列 */ r(this, "leafColumns", []); /** 临时叶子列数据,用于更新源数据,读取宽度等原信息 */ r(this, "temporaryLeafColumns", []); /** * 保存所有行列合并的信息 * * Map<task_id, Map<col_index, object>> */ r(this, "mergeInfo", /* @__PURE__ */ new Map()); this.context = t; } /** * 初始化列数据 */ init(t) { t != null && t.length && (this.sourceColumns = t), this.columns = [], this.leafColumns = [], this.processColumns(this.sourceColumns, this.columns); } /** * 处理列数据,将源数据转换为内部数据结构 */ processColumns(t, e = [], i, s = 1) { t.forEach((n, o) => { var f; const h = "children" in n && Array.isArray(n.children) && n.children.length > 0, a = !h; let d = ""; h ? d = `group-${o}` : d = `field-${n.field}`; const u = [...(i == null ? void 0 : i.path) || [], d]; d = "column-" + o + "-" + u.join("-"); const l = n.label || (a ? n.field : ""), c = a ? ((f = this.temporaryLeafColumns.find((m) => m.key === d)) == null ? void 0 : f.width) || n.width || 100 : "auto", p = { label: l, level: s, maxLevel: s, column: n, children: [], path: u, key: d, isLeaf: a, width: c }; if (e.push(p), a) this.leafColumns.push(p); else if (h) { const m = n.children; this.processColumns( m, p.children, p, s + 1 ), p.maxLevel = Math.max( p.maxLevel, p.children.reduce((x, b) => Math.max(x, b.maxLevel), 0) ); } }), this.temporaryLeafColumns = B(this.leafColumns); } /** * 根据 key 查找列 */ findColumnByKey(t) { return this.columns.find((e) => e.key === t); } update(t) { this.init(t); } getColumns() { return this.columns; } getColumn(t) { return this.leafColumns.find((e) => e.key === t); } getLeafColumns() { return this.leafColumns; } getTotalWidth() { return this.leafColumns.reduce((t, e) => t + e.width, this.getHandlerColumn().width); } getColumnWidth(t) { if (t === ct) return this.getHandlerColumn().width; const e = this.leafColumns.find((i) => i.key === t); return typeof (e == null ? void 0 : e.width) == "number" ? e.width : 0; } setColumnWidth(t, e) { const i = this.leafColumns.find((s) => s.key === t); i && (i.width = e), this.context.event.emit(v.COLUMN_WIDTH_CHANGE, t, e); } isLastColumn(t) { return this.leafColumns.findIndex((i) => i.key === t) === this.leafColumns.length - 1; } addMergeInfo(t, e, i) { this.mergeInfo.has(t) || this.mergeInfo.set(t, /* @__PURE__ */ new Map()), this.mergeInfo.get(t).set(e, i); } getMergeInfo(t, e) { var i; return (i = this.mergeInfo.get(t)) == null ? void 0 : i.get(e); } clearMergeInfo() { this.mergeInfo.clear(); } getHandlerColumn() { let t = 0; return this.context.store.getOptionManager().getOptions().selection.enabled && (t += 40), this.context.store.getDataManager().isMultiLevel && this.context.store.getOptionManager().getOptions().expand.show && (t += 40), { label: "", level: 1, maxLevel: 1, column: { field: "", resizable: !1, align: "left", headerAlign: "left", customStyle: { paddingLeft: this.context.store.getOptionManager().getOptions().expand.show ? "8px" : 0 }, headerRender: () => this.context.store.getOptionManager().getOptions().selection.enabled ? new ft(this.context).getElement() : null, ellipsis: !1 }, children: [], path: [], key: ct, isLeaf: !0, width: t }; } isMultiHeader() { return this.columns.some((t) => t.maxLevel > 1); } } var R = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}; function Y(g) { return g && g.__esModule && Object.prototype.hasOwnProperty.call(g, "default") ? g.default : g; } var pt = { exports: {} }; (function(g, t) { (function(e, i) { g.exports = i(); })(R, function() { var e, i, s = 1e3, n = 6e4, o = 36e5, h = 864e5, a = /\[([^\]]+)]|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, d = 31536e6, u = 2628e6, l = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, c = { years: d, months: u, days: h, hours: o, minutes: n, seconds: s, milliseconds: 1, weeks: 6048e5 }, p = function(L) { return L instanceof k; }, f = function(L, E, y) { return new k(L, y, E.$l); }, m = function(L) { return i.p(L) + "s"; }, x = function(L) { return L < 0; }, b = function(L) { return x(L) ? Math.ceil(L) : Math.floor(L); }, T = function(L) { return Math.abs(L); }, w = function(L, E) { return L ? x(L) ? { negative: !0, format: "" + T(L) + E } : { negative: !1, format: "" + L + E } : { negative: !1, format: "" }; }, k = function() { function L(y, C, _) { var A = this; if (this.$d = {}, this.$l = _, y === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), C) return f(y * c[m(C)], this); if (typeof y == "number") return this.$ms = y, this.parseFromMilliseconds(), this; if (typeof y == "object") return Object.keys(y).forEach(function(P) { A.$d[m(P)] = y[P]; }), this.calMilliseconds(), this; if (typeof y == "string") { var $ = y.match(l); if ($) { var G = $.slice(2).map(function(P) { return P != null ? Number(P) : 0; }); return this.$d.years = G[0], this.$d.months = G[1], this.$d.weeks = G[2], this.$d.days = G[3], this.$d.hours = G[4], this.$d.minutes = G[5], this.$d.seconds = G[6], this.calMilliseconds(), this; } } return this; } var E = L.prototype; return E.calMilliseconds = function() { var y = this; this.$ms = Object.keys(this.$d).reduce(function(C, _) { return C + (y.$d[_] || 0) * c[_]; }, 0); }, E.parseFromMilliseconds = function() { var y = this.$ms; this.$d.years = b(y / d), y %= d, this.$d.months = b(y / u), y %= u, this.$d.days = b(y / h), y %= h, this.$d.hours = b(y / o), y %= o, this.$d.minutes = b(y / n), y %= n, this.$d.seconds = b(y / s), y %= s, this.$d.milliseconds = y; }, E.toISOString = function() { var y = w(this.$d.years, "Y"), C = w(this.$d.months, "M"), _ = +this.$d.days || 0; this.$d.weeks && (_ += 7 * this.$d.weeks); var A = w(_, "D"), $ = w(this.$d.hours, "H"), G = w(this.$d.minutes, "M"), P = this.$d.seconds || 0; this.$d.milliseconds && (P += this.$d.milliseconds / 1e3, P = Math.round(1e3 * P) / 1e3); var J = w(P, "S"), Ot = y.negative || C.negative || A.negative || $.negative || G.negative || J.negative, Dt = $.format || G.format || J.format ? "T" : "", Q = (Ot ? "-" : "") + "P" + y.format + C.format + A.format + Dt + $.format + G.format + J.format; return Q === "P" || Q === "-P" ? "P0D" : Q; }, E.toJSON = function() { return this.toISOString(); }, E.format = function(y) { var C = y || "YYYY-MM-DDTHH:mm:ss", _ = { Y: this.$d.years, YY: i.s(this.$d.years, 2, "0"), YYYY: i.s(this.$d.years, 4, "0"), M: this.$d.months, MM: i.s(this.$d.months, 2, "0"), D: this.$d.days, DD: i.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: i.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: i.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: i.s(this.$d.seconds, 2, "0"), SSS: i.s(this.$d.milliseconds, 3, "0") }; return C.replace(a, function(A, $) { return $ || String(_[A]); }); }, E.as = function(y) { return this.$ms / c[m(y)]; }, E.get = function(y) { var C = this.$ms, _ = m(y); return _ === "milliseconds" ? C %= 1e3 : C = _ === "weeks" ? b(C / c[_]) : this.$d[_], C || 0; }, E.add = function(y, C, _) { var A; return A = C ? y * c[m(C)] : p(y) ? y.$ms : f(y, this).$ms, f(this.$ms + A * (_ ? -1 : 1), this); }, E.subtract = function(y, C) { return this.add(y, C, !0); }, E.locale = function(y) { var C = this.clone(); return C.$l = y, C; }, E.clone = function() { return f(this.$ms, this); }, E.humanize = function(y) { return e().add(this.$ms, "ms").locale(this.$l).fromNow(!y); }, E.valueOf = function() { return this.asMilliseconds(); }, E.milliseconds = function() { return this.get("milliseconds"); }, E.asMilliseconds = function() { return this.as("milliseconds"); }, E.seconds = function() { return this.get("seconds"); }, E.asSeconds = function() { return this.as("seconds"); }, E.minutes = function() { return this.get("minutes"); }, E.asMinutes = function() { return this.as("minutes"); }, E.hours = function() { return this.get("hours"); }, E.asHours = function() { return this.as("hours"); }, E.days = function() { return this.get("days"); }, E.asDays = function() { return this.as("days"); }, E.weeks = function() { return this.get("weeks"); }, E.asWeeks = function() { return this.as("weeks"); }, E.months = function() { return this.get("months"); }, E.asMonths = function() { return this.as("months"); }, E.years = function() { return this.get("years"); }, E.asYears = function() { return this.as("years"); }, L; }(), M = function(L, E, y) { return L.add(E.years() * y, "y").add(E.months() * y, "M").add(E.days() * y, "d").add(E.hours() * y, "h").add(E.minutes() * y, "m").add(E.seconds() * y, "s").add(E.milliseconds() * y, "ms"); }; return function(L, E, y) { e = y, i = y().$utils(), y.duration = function(A, $) { var G = y.locale(); return f(A, { $l: G }, $); }, y.isDuration = p; var C = E.prototype.add, _ = E.prototype.subtract; E.prototype.add = function(A, $) { return p(A) ? M(this, A, 1) : C.bind(this)(A, $); }, E.prototype.subtract = function(A, $) { return p(A) ? M(this, A, -1) : _.bind(this)(A, $); }; }; }); })(pt); var Nt = pt.exports; const Ut = /* @__PURE__ */ Y(Nt); var xt = { exports: {} }; (function(g, t) { (function(e, i) { g.exports = i(); })(R, function() { return function(e, i, s) { i.prototype.isBetween = function(n, o, h, a) { var d = s(n), u = s(o), l = (a = a || "()")[0] === "(", c = a[1] === ")"; return (l ? this.isAfter(d, h) : !this.isBefore(d, h)) && (c ? this.isBefore(u, h) : !this.isAfter(u, h)) || (l ? this.isBefore(d, h) : !this.isAfter(d, h)) && (c ? this.isAfter(u, h) : !this.isBefore(u, h)); }; }; }); })(xt); var Bt = xt.exports; const Xt = /* @__PURE__ */ Y(Bt); var yt = { exports: {} }; (function(g, t) { (function(e, i) { g.exports = i(); })(R, function() { return function(e, i) { i.prototype.isSameOrBefore = function(s, n) { return this.isSame(s, n) || this.isBefore(s, n); }; }; }); })(yt); var Vt = yt.exports; const Kt = /* @__PURE__ */ Y(Vt); var wt = { exports: {} }; (function(g, t) { (function(e, i) { g.exports = i(); })(R, function() { return function(e, i) { i.prototype.isSameOrAfter = function(s, n) { return this.isSame(s, n) || this.isAfter(s, n); }; }; }); })(wt); var jt = wt.exports; const qt = /* @__PURE__ */ Y(jt); var bt = { exports: {} }; (function(g, t) { (function(e, i) { g.exports = i(); })(R, function() { return function(e, i, s) { var n = i.prototype, o = function(l) { return l && (l.indexOf ? l : l.s); }, h = function(l, c, p, f, m) { var x = l.name ? l : l.$locale(), b = o(x[c]), T = o(x[p]), w = b || T.map(function(M) { return M.slice(0, f); }); if (!m) return w; var k = x.weekStart; return w.map(function(M, L) { return w[(L + (k || 0)) % 7]; }); }, a = function() { return s.Ls[s.locale()]; }, d = function(l, c) { return l.formats[c] || function(p) { return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(f, m, x) { return m || x.slice(1); }); }(l.formats[c.toUpperCase()]); }, u = function() { var l = this; return { months: function(c) { return c ? c.format("MMMM") : h(l, "months"); }, monthsShort: function(c) { return c ? c.format("MMM") : h(l, "monthsShort", "months", 3); }, firstDayOfWeek: function() { return l.$locale().weekStart || 0; }, weekdays: function(c) { return c ? c.format("dddd") : h(l, "weekdays"); }, weekdaysMin: function(c) { return c ? c.format("dd") : h(l, "weekdaysMin", "weekdays", 2); }, weekdaysShort: function(c) { return c ? c.format("ddd") : h(l, "weekdaysShort", "weekdays", 3); }, longDateFormat: function(c) { return d(l.$locale(), c); }, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal }; }; n.localeData = function() { return u.bind(this)(); }, s.localeData = function() { var l = a(); return { firstDayOfWeek: function() { return l.weekStart || 0; }, weekdays: function() { return s.weekdays(); }, weekdaysShort: function() { return s.weekdaysShort(); }, weekdaysMin: function() { return s.weekdaysMin(); }, months: function() { return s.months(); }, monthsShort: function() { return s.monthsShort(); }, longDateFormat: function(c) { return d(l, c); }, meridiem: l.meridiem, ordinal: l.ordinal }; }, s.months = function() { return h(a(), "months"); }, s.monthsShort = function() { return h(a(), "monthsShort", "months", 3); }, s.weekdays = function(l) { return h(a(), "weekdays", null, null, l); }, s.weekdaysShort = function(l) { return h(a(), "weekdaysShort", "weekdays", 3, l); }, s.weekdaysMin = function(l) { return h(a(), "weekdaysMin", "weekdays", 2, l); }; }; }); })(bt); var Zt = bt.exports; const Jt = /* @__PURE__ */ Y(Zt); var vt = { exports: {} }; (function(g, t) { (function(e, i) { g.exports = i(); })(R, function() { var e = "week", i = "year"; return function(s, n, o) { var h = n.prototype; h.week = function(a) { if (a === void 0 && (a = null), a !== null) return this.add(7 * (a - this.week()), "day"); var d = this.$locale().yearStart || 1; if (this.month() === 11 && this.date() > 25) { var u = o(this).startOf(i).add(1, i).date(d), l = o(this).endOf(e); if (u.isBefore(l)) return 1; } var c = o(this).startOf(i).date(d).startOf(e).subtract(1, "millisecond"), p = this.diff(c, e, !0); return p < 0 ? o(this).startOf("week").week() : Math.ceil(p); }, h.weeks = function(a) { return a === void 0 && (a = null), this.week(a); }; }; }); })(vt); var Qt = vt.exports; const te = /* @__PURE__ */ Y(Qt); var Tt = { exports: {} }; (function(g, t) { (function(e, i) { g.exports = i(); })(R, function() { return function(e, i) { i.prototype.weekYear = function() { var s = this.month(), n = this.week(), o = this.year(); return n === 1 && s === 11 ? o + 1 : s === 0 && n >= 52 ? o - 1 : o; }; }; }); })(Tt); var ee = Tt.exports; const ie = /* @__PURE__ */ Y(ee); var St = { exports: {} }; (function(g, t) { (function(e, i) { g.exports = i(); })(R, function() { return function(e, i) { var s = i.prototype, n = s.format; s.format = function(o) { var h = this, a = this.$locale(); if (!this.isValid()) return n.bind(this)(o); var d = this.$utils(), u = (o || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(l) { switch (l) { case "Q": return Math.ceil((h.$M + 1) / 3); case "Do": return a.ordinal(h.$D); case "gggg": return h.weekYear(); case "GGGG": return h.isoWeekYear(); case "wo": return a.ordinal(h.week(), "W"); case "w": case "ww": return d.s(h.week(), l === "w" ? 1 : 2, "0"); case "W": case "WW": return d.s(h.is