UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,476 lines 3.04 MB
var gx = Object.defineProperty; var hx = (e, t, n) => t in e ? gx(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var J = (e, t, n) => hx(e, typeof t != "symbol" ? t + "" : t, n); import { ref as C, computed as N, watch as Z, onUnmounted as Kt, defineComponent as ie, provide as Pt, createVNode as r, inject as le, onMounted as Me, Fragment as ut, reactive as Dt, createApp as Ui, Transition as Hl, mergeProps as Zt, nextTick as rt, Teleport as Io, withDirectives as Ot, vShow as Fa, resolveComponent as Kn, isVNode as Nn, onBeforeMount as $n, watchEffect as Yd, shallowRef as bo, render as ic, h as yx, cloneVNode as bx, createTextVNode as ne, onUpdated as Qd, onBeforeUnmount as ui, getCurrentInstance as Us, withModifiers as _t, vModelText as wa, resolveDirective as Rn, Comment as Tg, toRefs as Gi, vModelCheckbox as Ii, toRaw as Cx, triggerRef as wx } from "vue"; import { isPlainObject as jm, cloneDeep as Be, isUndefined as fa, debounce as Yi, isFunction as lc, mergeWith as Xd, merge as Ja, isNil as Sx, trim as xx, isNaN as Tx, flatten as kx, throttle as Yc, get as Xo, isEmpty as Fx, findIndex as _m } from "lodash-es"; import Et from "bignumber.js"; import { createI18n as Mx, useI18n as Px } from "vue-i18n"; import { useResizeObserver as tr } from "@vueuse/core"; function kg(e, t) { let n; function a(c) { const { properties: m, title: p, ignore: v } = c, g = v && Array.isArray(v), h = Object.keys(m).reduce((b, y) => ((!g || !v.find((S) => S === y)) && (b[y] = m[y].type === "object" && m[y].properties ? a(m[y]) : Be(m[y].default)), b), {}); if (p && (!g || !v.find((b) => b === "id"))) { const b = p.toLowerCase().replace(/-/g, "_"); h.id = `${b}_${Math.random().toString().slice(2, 6)}`; } return h; } function o(c) { const { properties: m, title: p, required: v } = c; if (v && Array.isArray(v)) { const g = v.reduce((h, b) => (h[b] = m[b].type === "object" && m[b].properties ? a(m[b]) : Be(m[b].default), h), {}); if (p && v.find((h) => h === "id")) { const h = p.toLowerCase().replace(/-/g, "_"); g.id = `${h}_${Math.random().toString().slice(2, 6)}`; } return g; } return { type: p }; } function i(c, m = {}, p) { const v = e[c]; if (v) { let g = o(v); const h = t[c]; return g = h ? h({ getSchemaByType: i }, g, m, p) : g, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(g), g; } return null; } function l(c, m) { const p = a(m); return Object.keys(p).reduce((v, g) => (Object.prototype.hasOwnProperty.call(c, g) && (v[g] && jm(v[g]) && jm(c[g] || !c[g]) ? Object.assign(v[g], c[g] || {}) : v[g] = c[g]), v), p), p; } function s(c, m) { return Object.keys(c).filter((v) => c[v] != null).reduce((v, g) => { if (m.has(g)) { const h = m.get(g); if (typeof h == "string") v[h] = c[g]; else { const b = h(g, c[g], c); Object.assign(v, b); } } else v[g] = c[g]; return v; }, {}); } function u(c, m, p = /* @__PURE__ */ new Map()) { const v = l(c, m); return s(v, p); } function f(c) { var p; const m = c.type; if (m) { const v = e[m]; if (!v) return c; const g = l(c, v), h = ((p = c.editor) == null ? void 0 : p.type) || ""; if (h) { const b = e[h], y = l(c.editor, b); g.editor = y; } return g; } return c; } function d(c) { n = c; } return { getSchemaByType: i, resolveSchemaWithDefaultValue: f, resolveSchemaToProps: u, mappingSchemaToProps: s, setDesignerContext: d }; } const ci = {}, Kd = {}, { getSchemaByType: ya, resolveSchemaWithDefaultValue: Ix, resolveSchemaToProps: Fg, mappingSchemaToProps: Mg, setDesignerContext: Ex } = kg(ci, Kd); function Ox(e = {}) { function t(f, d, c, m) { if (typeof c == "number") return m[f].length === c; if (typeof c == "object") { const p = Object.keys(c)[0], v = c[p]; if (p === "not") return Number(m[f].length) !== Number(v); if (p === "moreThan") return Number(m[f].length) >= Number(v); if (p === "lessThan") return Number(m[f].length) <= Number(v); } return !1; } function n(f, d, c, m) { return m[f] && m[f].propertyValue && String(m[f].propertyValue.value) === String(c); } const a = /* @__PURE__ */ new Map([ ["length", t], ["getProperty", n] ]); Object.keys(e).reduce((f, d) => (f.set(d, e[d]), f), a); function o(f, d) { const c = f; return typeof d == "number" ? [{ target: c, operator: "length", param: null, value: Number(d) }] : typeof d == "boolean" ? [{ target: c, operator: "getProperty", param: f, value: !!d }] : typeof d == "object" ? Object.keys(d).map((m) => { if (m === "length") return { target: c, operator: "length", param: null, value: d[m] }; const p = m, v = d[m]; return { target: c, operator: "getProperty", param: p, value: v }; }) : []; } function i(f) { return Object.keys(f).reduce((c, m) => { const p = o(m, f[m]); return c.push(...p), c; }, []); } function l(f, d) { if (a.has(f.operator)) { const c = a.get(f.operator); return c && c(f.target, f.param, f.value, d) || !1; } return !1; } function s(f, d) { return i(f).reduce((p, v) => p && l(v, d), !0); } function u(f, d) { const c = Object.keys(f), m = c.includes("allOf"), p = c.includes("anyOf"), v = m || p, b = (v ? f[v ? m ? "allOf" : "anyOf" : "allOf"] : [f]).map((S) => s(S, d)); return m ? !b.includes(!1) : b.includes(!0); } return { parseValueSchema: u }; } const Bx = { convertTo: (e, t, n, a) => { e.appearance || (e.appearance = {}), e.appearance[t] = n; }, convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t] }, Dx = { convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无" }, Vx = { convertTo: (e, t, n, a) => { e.editor && (e.editor[t] = n); }, convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t] }, Ce = { button: { type: "button", name: "按钮" }, "response-toolbar": { type: "response-toolbar", name: "工具栏" }, "response-toolbar-item": { type: "response-toolbar-item", name: "按钮" }, "content-container": { type: "content-container", name: "容器" }, "input-group": { type: "input-group", name: "文本" }, textarea: { type: "textarea", name: "多行文本" }, lookup: { type: "lookup", name: "帮助" }, "number-spinner": { type: "number-spinner", name: "数值" }, "date-picker": { type: "date-picker", name: "日期" }, switch: { type: "switch", name: "开关" }, "radio-group": { type: "radio-group", name: "单选组" }, "check-box": { type: "check-box", name: "复选框" }, "check-group": { type: "check-group", name: "复选框组" }, "combo-list": { type: "combo-list", name: "下拉列表" }, "response-form": { type: "response-form", name: "卡片面板" }, "response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" }, "response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" }, "tree-grid": { type: "tree-grid", name: "树表格" }, "tree-grid-column": { type: "tree-grid-column", name: "树表格列" }, "data-grid": { type: "data-grid", name: "表格" }, "data-grid-column": { type: "data-grid-column", name: "表格列" }, module: { type: "Module", name: "模块" }, component: { type: "component", name: "组件" }, tabs: { type: "tabs", name: "标签页" }, "tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" }, "tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" }, "drawer-toolbar-item": { type: "drawer-toolbar-item", name: "抽屉工具栏按钮" }, "html-template": { type: "html-template", name: "模板容器" }, "time-picker": { type: "time-picker", name: "时间选择" }, section: { type: "section", name: "分组面板" }, "section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" }, "section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" }, splitter: { type: "splitter", name: "分栏面板" }, "splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" }, "component-ref": { type: "component-ref", name: "组件引用节点" }, uploader: { type: "uploader", name: "附件上传" }, "page-header": { type: "page-header", name: "页头" }, "page-footer": { type: "page-footer", name: "页脚" }, "tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" }, "drawer-toolbar": { type: "drawer-toolbar", name: "抽屉工具栏" }, fieldset: { type: "fieldset", name: "分组" }, "query-solution": { type: "query-solution", name: "筛选方案" }, drawer: { type: "drawer", name: "抽屉" }, "external-container": { type: "external-container", name: "外部容器", icon: "content-container" }, "list-nav": { type: "list-nav", name: "列表导航" }, "list-view": { type: "list-view", name: "列表" }, "filter-bar": { type: "filter-bar", name: "筛选条" }, "language-textbox": { type: "language-textbox", name: "多语输入框" }, image: { type: "image", name: "图像" }, "discussion-editor": { type: "discussion-editor", name: "评论编辑区" }, "discussion-list": { type: "discussion-list", name: "评论列表" }, comment: { type: "comment", name: "评论区" }, "rich-text-editor": { type: "rich-text-editor", name: "富文本", icon: "rich-text-box" }, calendar: { type: "calendar", name: "日历", icon: "date-picker" }, wizard: { type: "wizard", name: "向导", icon: "wizard" }, "wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" }, "wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" }, step: { type: "step", name: "步骤条", icon: "step" }, "dynamic-form": { type: "dynamic-form", name: "动态表单" } }, Ax = { convertFrom: (e, t, n) => { var o; const a = e.editor && e.editor[t] ? e.editor[t] : e[t]; return ((o = Ce[a]) == null ? void 0 : o.name) || a; } }, Rx = { convertTo: (e, t, n, a) => { e[t] = e[t]; }, convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : "" }, Nx = { convertTo: (e, t, n, a) => { (e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = { [t]: n }); }, convertFrom: (e, t, n) => { if (e.formatter) { if (t === "trueText") return e.formatter.trueText; if (t === "falseText") return e.formatter.falseText; if (t === "prefix") return e.formatter.prefix; if (t === "suffix") return e.formatter.suffix; if (t === "precision") return e.formatter.precision; if (t === "decimal") return e.formatter.decimal; if (t === "thousand") return e.formatter.thousand; if (t === "dateFormat") return e.formatter.dateFormat || "yyyy-MM-dd"; if (t === "customFormat") return e.formatter.customFormat; if (t === "type") return e.formatter.type || "none"; if (t === "customFormat") return e.formmater.customFormat; } return "none"; } }, $x = { convertTo: (e, t, n, a) => { e.command ? e.command[t] = n : e.command = { [t]: n }, t === "enableType" && n === "default" && (e.command.enable = !0, e.command.commands = [ { text: "编辑", type: "primary", command: "edit" }, { text: "删除", type: "danger", command: "remove" } ]), t === "enableType" && n === "custom" && (e.command.enable = !0, e.command.commands = [ { value: "add", text: "增加", type: "link" }, { value: "edit", text: "编辑", type: "danger" }, { value: "remove", text: "删除", type: "remove" } ]), t === "enableType" && n === "unable" && (e.command.enable = !1); }, convertFrom: (e, t, n) => { var a, o; if (e.command) { if (t === "enableType") { const i = (o = (a = e.command) == null ? void 0 : a.commands) == null ? void 0 : o.find((l) => l.command === "edit" && l.type === "primary"); return e.command.enable ? i ? "default" : "custom" : "unable"; } if (t === "commands") return e.command.enableType === "custom" ? e.command.commands : []; if (t === "formatter") return e.command.formatter; if (t === "count") return e.command.count; if (t === "columnWidth") return e.command.columnWidth || 200; } return ""; } }, Lx = { convertTo: (e, t, n, a) => { e.column ? e.column[t] = n : e.column = { [t]: n }, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average")); }, convertFrom: (e, t, n) => { if (e.column) { if (t === "fitColumns") return e.column.fitColumns; if (t === "fitMode") return e.column.fitMode; } return ""; } }, jx = { convertTo: (e, t, n, a) => { e.summary ? e.summary[t] = n : e.summary = { [t]: n }, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = { enable: n, groupFields: [] }); }, convertFrom: (e, t, n) => { var a, o; return t === "customSummaryStyle" ? e.summary.customSummaryStyle : t === "position" ? ((a = e.summary) == null ? void 0 : a[t]) || "bottom" : t === "customRender" ? ((o = e.summary) == null ? void 0 : o[t]) || "" : e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : ""; } }, _x = { convertTo: (e, t, n, a) => { e.group ? e.group[t] = n : e.group = { [t]: n }, t === "enable" && n && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = { enable: n, groupFields: [], showSummary: !1, customRender: "" }); }, convertFrom: (e, t, n) => { if (e.group) { if (t === "enable") return e.group.enable; if (t === "showSummary") return e.group.showSummary; if (t === "customRender") return e.group.customRender; if (t === "groupFields") return e.group.groupFields; } } }, Hx = { convertFrom: (e, t) => e.binding ? e.binding.path : "", convertTo: (e, t, n) => { if (n && n.length > 0) { const a = n[0]; e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = a.bindingField, e.binding.field = a.id, e.binding.fullPath = a.path, e.path = a.bindingPath; } } }, Wx = { convertTo: (e, t, n, a) => { e.pagination || (e.pagination = {}), t === "sizeLimits" ? e.pagination.sizeLimits = n.split(",") : e.pagination[t] = n; }, convertFrom: (e, t, n) => e.pagination ? t === "sizeLimits" ? e.pagination.sizeLimits.join(",") : e.pagination[t] : e[t] }, zx = { convertTo: (e, t, n, a) => { e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n; }, convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t] }, qx = { convertTo: (e, t, n, a) => { e.selection || (e.selection = {}), e.selection[t] = n; }, convertFrom: (e, t, n) => { var a, o; return t === "showCheckbox" ? (a = e.selection) != null && a.multiSelect ? !0 : (o = e.selection) == null ? void 0 : o.showCheckbox : e.selection ? e.selection[t] : e[t]; } }, Ux = { convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : "" }, Gx = { convertFrom: (e, t) => e[t] || "", convertTo: (e, t, n) => { e[t] = n; } }, Yx = { convertTo: (e, t, n, a) => { e.size || (e.size = {}), e.size[t] = n; }, convertFrom: (e, t, n) => e.size ? e.size[t] : e[t] }, Qx = { convertFrom: (e, t, n) => { var a, o; return (a = e.formatter) != null && a.data && t === "formatterEnumData" && !e.formatterEnumData ? (o = e.formatter) == null ? void 0 : o.data : e.formatterEnumData; } }, Xx = { convertTo: (e, t, n, a) => { e.sort || (e.sort = {}), e.sort[t] = n; }, convertFrom: (e, t, n) => { var a, o; if (t === "mode") return ((a = e.sort) == null ? void 0 : a.mode) || "client"; if (t === "multiSort") return !!((o = e.sort) != null && o.multiSort); } }, Kx = { convertTo: (e, t, n, a) => { e.filter || (e.filter = {}), e.filter[t] = n; }, convertFrom: (e, t, n) => { var a; if (t === "mode") return ((a = e.filter) == null ? void 0 : a.mode) || "client"; } }, Jx = { convertTo: (e, t, n, a) => { e.rowOption ? e.rowOption[t] = n : e.rowOption = { [t]: n }; }, convertFrom: (e, t, n) => { if (e.rowOption) { if (t === "customRowStyle") return e.rowOption.customRowStyle; if (t === "customCellStyle") return e.rowOption.customCellStyle; if (t === "height") return e.rowOption.height; } return ""; } }, Zx = { convertTo: (e, t, n, a) => { (e.type === "data-grid-column" || e.type === "tree-grid-column") && (e[t] = n, t === "columnTemplateType" && n === "hyperlink" && (e.onClickLinkCommand ? e.columnTemplate = ` <span class="f-pretend-link f-cursor-pointer" @click="(ctx)=>viewModel.current.${e.onClickLinkCommand || ""}({id: rowData.id,context: ctx})"> {{rowData.${e.field}}} </span>` : e.columnTemplate = ` <span class="f-pretend-link f-cursor-pointer"> {{rowData.${e.field}}} </span>`), t === "columnTemplateType" && n === "default" && (e.columnTemplate = ""), t === "columnTemplateType" && n === "custom" && (e.columnTemplate = "")); }, convertFrom: (e, t, n) => t === "columnTemplate" ? e.columnTemplate : t === "columnTemplateType" ? e.columnTemplateType ? e.columnTemplateType || "default" : e.columnTemplate && !e.onClickLinkCommand ? "custom" : e.columnTemplate && e.onClickLinkCommand ? "hyperlink" : "default" : "" }; function Pg(e, t, n) { const a = /* @__PURE__ */ new Map([ ["/converter/appearance.converter", Bx], ["/converter/buttons.converter", Dx], ["/converter/property-editor.converter", Vx], ["/converter/items-count.converter", Ux], ["/converter/type.converter", Ax], ["/converter/change-editor.converter", Rx], ["/converter/change-formatter.converter", Nx], ["/converter/column-command.converter", $x], ["/converter/column-option.converter", Lx], ["/converter/summary.converter", jx], ["/converter/group.converter", _x], ["/converter/form-group-label.converter", Gx], ["/converter/field-selector.converter", Hx], ["/converter/pagination.converter", Wx], ["/converter/row-number.converter", zx], ["/converter/grid-selection.converter", qx], ["/converter/size.converter", Yx], ["/converter/change-formatter-enum.converter", Qx], ["/converter/grid-sort.converter", Xx], ["/converter/grid-filter.converter", Kx], ["/converter/row-option.converter", Jx], ["/converter/change-formatter-type.converter", Zx] ]), o = /* @__PURE__ */ new Map([ ["string", { type: "input-group", enableClear: !1 }], ["boolean", { type: "combo-list", textField: "name", valueField: "value", idField: "value", enableClear: !1, editable: !1, data: [ { value: !0, name: "是" }, { value: !1, name: "否" } ] }], ["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }], ["array", { type: "button-edit" }], ["number", { type: "number-spinner", placeholder: "" }], ["events-editor", { type: "events-editor", hide: !0 }], ["multiLanguage", { type: "language-textbox" }] ]), i = Ox(); function l(v, g) { return () => i.parseValueSchema(v, g); } function s(v, g, h) { return v.includes("visible") && g.visible !== void 0 ? typeof g.visible == "boolean" ? () => !!g.visible : g.visible === void 0 ? !0 : l(g.visible, h) : () => !0; } function u(v, g, h) { return v.includes("readonly") && g.readonly !== void 0 ? typeof g.readonly == "boolean" ? () => !!g.readonly : l(g.readonly, h) : () => !1; } function f(v, g) { const h = v.$converter || g; return typeof h == "string" && h && a.has(h) ? a.get(h) || null : h || null; } function d(v, g, h, b, y, S = "", w = "") { return Object.keys(v).map((M) => { const k = C(1), T = M, P = v[M], F = Object.keys(P), O = P.title, I = P.type, B = o.get(I) || { type: "input-group", enableClear: !1 }, V = P.editor ? Object.assign({}, B, P.editor) : Object.assign({}, B), A = s(F, P, g), E = u(F, P, g); V.readonly = V.readonly === void 0 ? E() : V.readonly; const D = P.type === "cascade" ? d(P.properties, g, h, b, y, S, w) : [], $ = !0; let R = f(P, w); const j = N({ get() { if (k.value) { if (["class", "style"].find((K) => K === T) && !R && (R = a.get("/converter/appearance.converter") || null), R && R.convertFrom) return R.convertFrom(h, M, y, S); const X = h[M]; return Object.prototype.hasOwnProperty.call(P, "defaultValue") && (X === void 0 || typeof X == "string" && X === "") ? P.type === "boolean" ? P.defaultValue : P.defaultValue || "" : X; } return null; }, set(X) { k.value += 1, R && R.convertTo ? (R.convertTo(b, M, X, y, S), R.convertTo(h, M, X, y, S)) : (b[M] = X, h[M] = X); } }), { refreshPanelAfterChanged: L, description: _, isExpand: W, parentPropertyID: q } = P, Y = { propertyID: T, propertyName: O, propertyType: I, propertyValue: j, editor: V, visible: A, readonly: E, cascadeConfig: D, hideCascadeTitle: $, refreshPanelAfterChanged: L, description: _, isExpand: W, parentPropertyID: q }; return g[T] = Y, Y; }); } function c(v, g, h = {}) { const b = {}, y = e[v]; return y && y.categories ? Object.keys(y.categories).map((w) => { const x = y.categories[w], M = x == null ? void 0 : x.title, k = d(x.properties || {}, b, {}, h, g); return { categoryId: w, categoryName: M, properties: k }; }) : []; } function m(v, g, h, b, y = "") { const S = g.$ref.schema, w = g.$ref.converter, x = h[S], M = x.type, k = n(x), T = {}, P = e[M]; if (P && P.categories) { const F = P.categories[v], O = F == null ? void 0 : F.title; w && Object.keys(F.properties).forEach((V) => { F.properties[V].$converter = w; }); const I = (F == null ? void 0 : F.properties) || {}, B = d(I, T, k, x, b, y); return { categoryId: v, categoryName: O, properties: B }; } return { categoryId: v, categoryName: "", properties: [] }; } function p(v, g, h, b, y) { const S = v.type, w = n(v), x = {}; let M = y || e[S]; if (!(M && Object.keys(M).length > 0) && h && h.getPropConfig && (M = h.getPropConfig(b)), M && M.categories) { const T = []; return Object.keys(M.categories).map((P) => { const F = M.categories[P]; if (F.$ref) { T.push(m(P, F, v, g, b)); return; } const O = F == null ? void 0 : F.title, I = F == null ? void 0 : F.tabId, B = F == null ? void 0 : F.tabName, V = F == null ? void 0 : F.hide, A = F == null ? void 0 : F.hideTitle, E = d(F.properties || {}, x, w, v, g, b, F.$converter), { setPropertyRelates: D } = F, $ = F == null ? void 0 : F.parentPropertyID; T.push({ categoryId: P, categoryName: O, tabId: I, tabName: B, hide: V, properties: E, hideTitle: A, setPropertyRelates: D, parentPropertyID: $ }); }), T; } return []; } return { getPropertyConfigBySchema: p, getPropertyConfigByType: c, propertyConverterMap: a }; } const Jd = {}, Zd = {}; Pg(Jd, Zd, Ix); const Gs = {}, Ys = {}, { getSchemaByType: nr, resolveSchemaWithDefaultValue: eT, resolveSchemaToProps: Xte, mappingSchemaToProps: Kte, setDesignerContext: tT } = kg(Gs, Ys), ar = {}, Qs = {}, { getPropertyConfigBySchema: rc } = Pg(ar, Qs, eT); function Ue(e, t, n = /* @__PURE__ */ new Map(), a = (l, s, u, f) => s, o = {}, i = (l) => l) { return ci[t.title] = t, Kd[t.title] = a, Jd[t.title] = o, Zd[t.title] = i, Gs[t.title] = t, Ys[t.title] = a, ar[t.title] = o, Qs[t.title] = i, (l = {}, s = !0) => { if (!s) return Mg(l, n); const u = Fg(l, t, n), f = Object.keys(e).reduce((d, c) => (d[c] = e[c].default, d), {}); return Object.assign(f, u); }; } function nT(e, t, n, a, o) { const { schemaMap: i, schemaResolverMap: l, propertyConfigSchemaMap: s, propertyEffectMap: u } = o; i[e.title] = e, l[e.title] = t, s[e.title] = n, u[e.title] = a; } function cn(e, t, n = /* @__PURE__ */ new Map(), a = (l, s, u, f) => s, o = {}, i = (l) => l) { return (l) => (nT(t, a, o, i, l), (s = {}, u = !0) => { if (!u) return Mg(s, n); const f = Fg(s, t, n), d = Object.keys(e).reduce((c, m) => (c[m] = e[m].default, c), {}); return Object.assign(d, f); }); } function ht(e, t) { return { customClass: t.class, customStyle: t.style }; } function aT(e, t) { var a, o; const n = {}; if (t != null && t.buttons) { const i = []; (a = t == null ? void 0 : t.buttons) == null || a.map((l) => { const s = {}; Object.keys(l).map((u) => { var f; u === "appearance" ? s.class = ((f = l[u]) == null ? void 0 : f.class) || "" : s[u] = l[u]; }), i.push(s); }), n.buttons = i; } return (o = t == null ? void 0 : t.appearance) != null && o.class && (n.buttonClass = t.appearance.class || "col-6"), t != null && t.id && (n.toolbarId = t.id), t && Object.prototype.hasOwnProperty.call(t, "visible") && (n.buttonsVisible = t.visible), n; } function oT() { function e(t, n) { const { id: a } = t || {}; if (t.binding === void 0 || typeof t.binding != "object") return {}; const { field: o } = t.binding || {}; return { modelValue: n.getValue(a), "onUpdate:modelValue": (i) => { n.setValue(a, o, i); } }; } return { resolve: e }; } function Ig() { function e(t, n) { const { id: a } = t || {}, { dataSource: o } = t || {}; return o === void 0 ? {} : { data: n.getValue(a), "onUpdate:data": (...i) => { } }; } return { resolve: e }; } function iT() { function e(t, n) { const { id: a } = t || {}, { dataSource: o } = t || {}; return o === void 0 ? {} : {}; } return { resolve: e }; } function Jte() { function e(t, n) { const { path: a } = t.binding || {}; return a ? { "onUpdate:dataMapping": (...o) => { } } : {}; } return { resolve: e }; } function lT() { function e(t, n) { const { id: a } = t || {}, { dataSource: o } = t || {}; return o === void 0 ? {} : { events: n.getValue(a) }; } return { resolve: e }; } function Eg() { return (e, t, n) => { const a = t.id, { type: o } = t, i = e.emits; return i ? i.filter((l) => l !== "update:modelValue").reduce((l, s) => { const u = `on${s.charAt(0).toUpperCase()}${s.slice(1)}`; return l[u] = (...f) => { n.dispatch(a, s, o, f); }, l; }, {}) : {}; }; } function rT() { function e(t, n) { return t.selectItemById(n); } return { selectItemById: e }; } function sT() { function e(t, n) { return t.selectItemById(n); } return { selectItemById: e }; } function uT() { function e(t) { return t.editor; } return { resolve: e }; } function Zte() { function e(t) { return Object.prototype.hasOwnProperty.call(t, "visible") ? t.visible : null; } return { resolve: e }; } function Qi(e, t) { if (!e || e.length < 1) return null; for (const n of e) { if (n.id === t) return n; if (n.children) { const a = n.children.find((o) => o.id === t); if (a) return a; } } return null; } function ene() { function e(t, n) { const { name: a } = n; return t[`on${a.charAt(0).toUpperCase()}${a.slice(1)}`] || t[a]; } return { resolve: e }; } function cT() { function e(t, n) { var s; const a = (s = t.toolbar) == null ? void 0 : s.buttons; if (!a || a.length < 1) return null; const [o, i] = n.payloads, l = Qi(a, i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function dT() { function e(t, n) { const { name: a } = n, [o, i] = n.payloads; if (a === "tabChange" || a === "tabRemove") return t[`on${a.charAt(0).toUpperCase()}${a.slice(1)}`]; const l = t.contents; if (!l || l.length < 1) return null; const s = l.reduce((f, d) => { const c = d.toolbar && d.toolbar.buttons || []; return f.push(...c), f; }, []); if (!s || s.length < 1) return; const u = Qi(s, i); return u ? u.onClick || u.click : null; } return { resolve: e }; } function fT() { function e(t, n) { const a = t.buttons; if (!a || a.length < 1) return null; const [o, i] = n.payloads, l = Qi(a, i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function pT() { function e(t, n) { var s; const a = (s = t.toolbar) == null ? void 0 : s.buttons; if (!a || a.length < 1) return null; const [o, i] = n.payloads, l = Qi(a, i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function mT() { function e(t, n) { const { footerToolbar: a, headerToolbar: o } = t, i = ((a == null ? void 0 : a.buttons) || []).concat((o == null ? void 0 : o.buttons) || []); if (!i || i.length < 1) return null; const [l, s] = n.payloads, u = Qi(i, s); return u ? u.onClick || u.click : null; } return { resolve: e }; } function vT() { function e(t, n) { const { name: a } = n; if (a !== "fieldsClick") return t[`on${a.charAt(0).toUpperCase()}${a.slice(1)}`] || t[a]; const o = t.cardToolbar; if (!o || o.length < 1) return null; const [i, l] = n.payloads, s = Qi(o, l); return s ? s.onClick || s.click : null; } return { resolve: e }; } function Og() { function e(t, n) { const { columns: a } = n; return t.updateColumns(a); } return { updateColumns: e }; } const Bg = /* @__PURE__ */ new Map([ ["appearance", ht], ["size", (e, t) => { const n = {}; return t.width && (n.width = Number(t.width)), t.height && (n.height = Number(t.height)), n; }] ]), gT = "https://json-schema.org/draft/2020-12/schema", hT = "https://farris-design.gitee.io/accordion.schema.json", yT = "accordion", bT = "A Farris Container Component", CT = "object", wT = { id: { description: "The unique identifier for a Accordion", type: "string" }, type: { description: "The type string of Accordion component", type: "string", default: "accordion" }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} }, contents: { description: "", type: "array", default: [] }, customClass: { description: "", type: "string", default: "" }, size: { description: "", type: "object", properties: { width: { type: "number" }, height: { type: "number" } }, default: null }, enableFold: { description: "", type: "boolean", default: !0 }, expanded: { description: "", type: "boolean", default: !1 } }, ST = [ "id", "type", "contents" ], xT = { $schema: gT, $id: hT, title: yT, description: bT, type: CT, properties: wT, required: ST }; function TT(e, t, n) { return t; } const kT = "accordion", FT = "A Farris Component", MT = "object", PT = { basic: { description: "Basic Infomation", title: "基本信息", properties: { id: { description: "组件标识", title: "标识", type: "string", readonly: !0 }, type: { description: "组件类型", title: "控件类型", type: "select", editor: { type: "waiting for modification", enum: [] } } } } }, IT = { title: kT, description: FT, type: MT, categories: PT }, ef = { customClass: { type: String, default: "" }, enableFold: { type: Boolean, default: !0 }, expanded: { type: Boolean, default: !1 }, height: { type: Number }, width: { type: Number } }, Dg = Ue(ef, xT, Bg, TT, IT); function Vg(e) { const t = e.nativeElement ? e.nativeElement : e; return t.classList !== void 0 && t.classList !== null ? t : null; } function Ag(e, t) { if (t === void 0) return; const n = Vg(e); n && n.classList.remove(t); } function Qc(e, t) { if (t === void 0) return; const n = Vg(e); n && n.classList.add(t); } const ET = [ { size: "sm", width: 576, pattern: /\b(col-|col-sm-)\d+\b/ }, { size: "md", width: 768, pattern: /\bcol-md-\d+\b/ }, { size: "lg", width: 888, pattern: /\bcol-lg-\d+\b/ }, { size: "xl", width: 1200, pattern: /\bcol-xl-\d+\b/ }, { size: "el", width: 1690, pattern: /\bcol-el-\d+\b/ } ]; function Rg(e) { e != null && e.resizeObserver && (e.resizeObserver.disconnect(), e.sharedObject = null); } function Ng(e, t, n = 0) { const a = []; if (!t) return; const o = n || t.getBoundingClientRect().width, i = parseFloat(o), l = e.breakPoints; for (let s = 0; s < l.length; s++) l[s].width <= i && a.push(l[s].size); if (e.className.join(",") !== a.join(",")) { if (e.className.length - a.length > 0) for (let u = a.length; u < e.className.length; u++) Ag(t, "f-area-response--" + e.className[u]); else for (let u = e.className.length; u < a.length; u++) Qc(t, "f-area-response--" + a[u]); e.className = [...a]; } } function OT(e, t) { e.enable && e.autoWidth ? e.resizeObserver || (e.resizeObserver = new ResizeObserver((n) => { if (!n || n.length < 1 || !n[0].contentRect) return; const a = n[0].contentRect; Math.abs(parseInt(a.width + "") - e.width) > e.threshold && (Ng(e, t, a.width), e.width = parseInt(a.width + "")); }), e.resizeObserver.observe(t)) : Rg(e); } function Hm(e, t) { if (e.enable) Qc(t, "f-area-response"), Ng(e, t); else { Ag(t, "f-area-response"); for (let n = e.className.length; n > 0; n--) Qc(t, "f-area-response--" + e.className[n]); e.className = []; } OT(e, t); } function BT(e) { const t = []; return ET.map((n) => { const a = "col-" + n.size + "-"; if (e.querySelectorAll('[class*="' + a + '"]').length > 0) t.push({ size: n.size, width: n.width }); else if (n.size === "sm") { const i = e.querySelectorAll('[class*="col-"]'); Array.from(i).some((s) => s.className.match(n.pattern)) && t.push({ size: n.size, width: n.width }); } }), t; } function Wm(e, t, n) { t.value && Object.prototype.hasOwnProperty.call(t.value, "enable") && (e.enable = t.value.enable), t.value && Object.prototype.hasOwnProperty.call(t.value, "autoWidth") && (e.autoWidth = t.value.autoWidth), e.breakPoints = BT(n); } const Dl = { // 在绑定元素的父组件 // 及他自己的所有子节点都挂载完成后调用 mounted: (e, t, n) => { n.sharedObject = { className: [], resizeObserver: null, enable: !0, autoWidth: !0, threshold: 10, width: 0, breakPoints: [] }, Wm(n.sharedObject, t, e), Hm(n.sharedObject, e); }, // 在绑定元素的父组件 // 及他自己的所有子节点都更新后调用 updated: function(e, t, n, a) { n.sharedObject = a.sharedObject, Wm(n.sharedObject, t, e), Hm(n.sharedObject, e); }, // 绑定元素的父组件卸载前调用 beforeUnmount(e, t, n) { n.sharedObject && Rg(n.sharedObject); } }, DT = { created(e, t) { e.setAttribute("title", e.textContent || t.value || ""); }, mounted(e, t) { const n = t.value || e.textContent || ""; e.setAttribute("title", n); }, updated(e, t) { const n = t.value || e.textContent || ""; e.setAttribute("title", n); }, beforeUpdate(e, t) { const n = t.value || e.textContent || ""; e.setAttribute("title", n); } }; function $g(e, t, n, a, o) { const i = C(e.disabled), l = C(!1), s = C(e.showBorder), u = C(e.textAlign), f = C(e.updateOn), d = C(!1), c = N(() => e.editable || !e.readonly && !e.disabled), m = N(() => e.editable && !e.disabled && !e.readonly), p = N(() => !e.disabled && !e.readonly && l.value), v = N(() => n.value === "" || n.value === null || n.value === void 0), g = N(() => (e.disabled || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), h = N(() => e.readonly || !e.editable), b = N(() => e.enableTitle ? n.value : ""), y = N(() => ({ "form-control": !0, "f-utils-fill": !0, "text-left": u.value === "left", "text-center": u.value === "center", "text-right": u.value === "right" })), S = N(() => { const D = { "f-cmp-inputgroup": !0, "input-group": !0, "f-state-disabled": i.value, "f-state-editable": m.value, "f-state-readonly": h.value, "f-state-focus": p.value, "input-group--has-clear": e.enableClear && d.value }; return (e.customClass || "").split(" ").reduce((R, j) => (R[j] = !0, R), D), D; }), w = N(() => s.value ? "" : "border-width : 0 "); function x() { return e.type && e.type !== "text" ? e.type : e.showType || "text"; } const M = C(x()); function k(D, $ = !0) { n.value = D, a.value !== D && (a.value = D), $ && t.emit("change", D), t.emit("update:modelValue", D), t.emit("update:value", D); } Z( () => e.modelValue, (D, $) => { D !== $ && (n.value = D, a.value = D); } ), Z(() => e.disabled, (D, $) => { D !== $ && (i.value = D); }), Z(() => e.showType, (D) => { D && (M.value = D); }), Z(() => e.type, (D) => { M.value = D; }); function T(D) { return D.stopPropagation(), l.value = !1, t.emit("blur", D), D.target.tagName === "TEXTAREA" && (t.emit("update:modelValue", D.target.value), t.emit("update:value", D.target.value), t.emit("change", D.target.value)), !1; } function P(D) { t.emit("click", D); } function F(D) { i.value || h.value || (s.value && (l.value = !0), c.value && t.emit("focus", D)); } function O(D) { t.emit("input", D.target.value, D); const $ = D.target.value; a.value = $, f.value === "change" && (t.emit("update:modelValue", $), t.emit("update:value", $), t.emit("change", $)); } function I(D) { t.emit("keydown", D); } function B(D) { t.emit("keyup", D); } function V(D) { const $ = D.target; $.tagName !== "INPUT" && $.tagName !== "TEXTAREA" && D.preventDefault(), D.stopPropagation(), t.emit("mousedownEvent", D); } function A(D) { t.emit("mouseupEvent", D); } function E(D) { if (f.value === "blur") { const $ = D.target.value; D.stopPropagation(), k($); } } return { changeTextBoxValue: k, disabled: i, displayText: a, editable: m, hasFocused: p, inputGroupClass: S, inputType: M, isEmpty: v, modelValue: n, readonly: h, onBlur: T, hasClearClass: d, onClick: P, onFocus: F, onInput: O, onKeydown: I, onKeyup: B, onMousedown: V, onMouseup: A, onTextBoxValueChange: E, placeholder: g, textBoxClass: y, textBoxTitle: b, inputGroupStyle: w }; } function VT(e, t, n, a) { const o = C(e.disabled), i = C(!1), l = C("text"), s = C(e.showBorder), u = C(e.textAlign); N(() => e.editable || !e.readonly); const f = N(() => e.editable && !e.disabled && !e.readonly), d = N(() => !e.disabled && i.value), c = N(() => n.value === "" || n.value === null || n.value === void 0), m = N(() => e.placeholder), p = N(() => e.readonly || !e.editable), v = N(() => e.enableTitle ? n.value : ""), g = N(() => ({ "form-control": !0, // 'f-utils-fill': true, "text-left": u.value === "left", "text-center": u.value === "center", "text-right": u.value === "right" })), h = N(() => ({ "f-cmp-inputgroup": !0, "input-group": !0, "f-state-disabled": !0, "f-state-editable": !1, "f-state-readonly": !0 // 'f-state-focus': hasFocused.value })), b = N(() => s.value ? "" : "border-width : 0 "); function y(S, w = !0) { } return { changeTextBoxValue: y, disabled: o, displayText: a, editable: f, hasFocused: d, inputGroupClass: h, inputType: l, isEmpty: c, modelValue: n, readonly: p, // onBlur, // onClick, // onFocus, // onInput, // onKeydown, // onKeyup, // onMousedown, // onTextBoxValueChange, placeholder: m, textBoxClass: g, textBoxTitle: v, inputGroupStyle: b }; } function Lg(e, t, n) { const a = C(!1), o = N(() => e.enableClear && !e.readonly && !e.disabled), { changeTextBoxValue: i, displayText: l, hasFocused: s, modelValue: u, isEmpty: f, hasClearClass: d } = n; function c(b) { a.value = b, d && (d.value = a.value); } Z(l, () => { s != null && s.value ? c(!!(l != null && l.value)) : c(!1); }); const m = N(() => ({ "input-group-text": !0, "input-group-clear": !0 })), p = N(() => ({ width: "24px", display: a.value ? "flex" : "none" })); function v(b) { b.stopPropagation(), o.value && (i("", !0), c(!a.value), t.emit("clear")); } function g(b) { var x, M; const y = ((x = b.target.querySelector("input")) == null ? void 0 : x.value) || "", S = ((M = b.target.querySelector("textarea")) == null ? void 0 : M.value) || "", w = y || S; w !== u.value && (u.value = w), o.value && c(!!w); } function h(b) { o.value && c(!1); } return { clearButtonClass: m, clearButtonStyle: p, hasShownClearButton: a, onClearValue: v, onMouseEnter: g, onMouseLeave: h, shouldShowClearButton: o }; } const AT = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, RT = { sun: 0, mon: 1, tue: 2, wed: 3, thu: 4, fri: 5, sat: 6 }; class jg { constructor() { J(this, "regexes", { YEAR: "[1-9]\\d{3}", MONTH: "1[0-2]|0?[1-9]", MONTH2: "1[0-2]|0[1-9]", MONTHNAME: "jan|january|feb|february|mar|march|apr|april|may|jun|june|jul|july|aug|august|sep|september|oct|october|nov|november|dec|december", DAYNAME: "mon|monday|tue|tuesday|wed|wednesday|thu|thursday|fri|friday|sat|saturday|sun|sunday", DAY: "3[01]|[12]\\d|0?[1-9]", DAY2: "3[01]|[12]\\d|0[1-9]", TIMEZONE: "[+-][01]\\d\\:?[0-5]\\d", H24: "[01]\\d|2[0-3]", MIN: "[0-5]\\d", SEC: "[0-5]\\d", MS: "\\d{3,}", H12: "0?[1-9]|1[012]", AMPM: "am|pm", UNIT: "year|month|week|day|hour|minute|second|millisecond" }); J(this, "patterns", [ // 2010-03-15 ["iso_8601", this.makePattern("^(_YEAR_)-(_MONTH_)-(_DAY_)$"), "$2/$3/$1"], // 3-15-2010 ["us", this.makePattern("^(_MONTH_)([\\/-])(_DAY_)\\2(_YEAR_)$"), "$1/$3/$4"], // 15.03.2010 ["world", this.makePattern("^(_DAY_)([\\/\\.])(_MONTH_)\\2(_YEAR_)$"), "$3/$1/$4"], // 15-Mar-2010, 8 Dec 2011, "Thu, 8 Dec 2011" ["chicago", this.makePattern("^(?:(?:_DAYNAME_),? )?(_DAY_)([ -])(_MONTHNAME_)\\2(_YEAR_)$"), "$3 $1, $4"], // "March 4, 2012", "Mar 4 2012", "Sun Mar 4 2012" ["conversational", this.makePattern("^(?:(?:_DAYNAME_),? )?(_MONTHNAME_) (_DAY_),? (_YEAR_)$"), "$1 $2, $3"], // Tue Jun 22 17:47:27 +0000 2010 [ "month_day_time_year", this.makePattern("^(?:_DAYNAME_) (_MONTHNAME_) (_DAY_) ((?:_H24_)\\:(?:_MIN_)(?:\\:_SEC_)?) (_TIMEZONE_) (_YEAR_)$"), (t) => { const n = ("" + this.getMonthByName(t[1])).padStart(2, "0"), a = ("" + t[2]).padStart(2, "0"), o = t[5], i = t[3], l = t[4], s = o + "-" + n + "-" + a + "T" + i + l; return isNaN(s) ? !1 : s; } ], // @123456789 [ "unix", /^@(-?\d+)$/, (t) => this.create(parseInt(t[1], 10) * 1e3) ], // 24-hour time (This will help catch Date objects that are casted to a string) [ "24_hour", this.makePattern("^(?:(.+?)(?: |T))?(_H24_)\\:(_MIN_)(?:\\:(_SEC_)(?:\\.(_MS_))?)? ?(?:GMT)?(_TIMEZONE_)?(?: \\([A-Z]+\\))?$"), (t) => { let n; const a = t[1]; if (a) { if (n = this.create(a), isNaN(n)) return !1; } else n = /* @__PURE__ */ new Date(), n.setMilliseconds(0); const o = t[2], i = t[3], l = t[4], s = t[5]; return n.setHours(parseFloat(o), parseFloat(i), parseFloat(l || 0)), s && n.setMilliseconds(+String(s).slice(0, 3)), n; } ], // 12-hour time [ "12_hour", this.makePattern("^(?:(.+) )?(_H12_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)? ?(_AMPM_)$"), (t) => { let n; const a = t[1]; if (a) { if (n = this.create(a), isNaN(n)) return !1; } else n = /* @__PURE__ */ new Date(), n.setMilliseconds(0); let o = parseFloat(t[2]); o = t[5].toLowerCase() === "am" ? o === 12 ? 0 : o : o === 12 ? 12 : o + 12; const i = t[3], l = t[4]; return n.setHours(o, parseFloat(i || 0), parseFloat(l || 0)), n; } ] ]); } makePattern(t) { return t = t.replace(/_([A-Z][A-Z0-9]+)_/g, (n, a) => this.regexes[a]), new RegExp(t, "i"); } getMonthByName(t) { return AT[String(t).slice(0, 3).toLowerCase()]; } getWeekdayByName(t) { return RT[String(t).slice(0, 3).toLowerCase()]; } parse(t) { if (!isNaN(Number(t))) return new Date(t); if (t = String(t).replace(/^\s*(.*)\s*$/, "$1"), t = t.replace(/\s{2,}/g, " "), t === "") return Date.now(); let n = 0; for (; n < this.patterns.length; ) { const a = this.patterns[n]; let o, i; typeof a[0] == "string" ? (i = a[1], o = a[2]) : (i = a[0], o = a[1]); const l = t.match(i); if (!l) { n++; continue; } if (typeof o == "function") { const s = o(l); if (s instanceof Date) return s; } else { const s = Date.parse(t.replace(i, o)); if (!isNaN(s)) return new Date(s); } n++; } return NaN; } create(t) { return t == null ? Date.now() : t instanceof Date ? t : this.parse(t); } } function sn(e) { const t = Object.prototype.toString.call(e); return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN); } function fn(e, t) { return e instanceof Date ? new e.constructor(t) : new Date(t); } function vo(e, t) { const n = sn(e); return isNaN(t) ? fn(e, NaN) : (t && n.setDate(n.getDate() + t), n); } function tf(e, t) { const n = sn(e); if (isNaN(t)) return fn(e, NaN); if (!t) return n; const a = n.getDate(), o = fn(e, n.getTime()); o.setMonth(n.getMonth() + t + 1, 0); const i = o.getDate(); return a >= i ? o : (n.setFullYear( o.getFullYear(), o.getMonth(), a ), n); } const _g = 6048e5, NT = 864e5, nf = 6e4, af = 36e5, $T = 1e3; let LT = {}; function di() { return LT; } function Ea(e, t) { var s, u, f, d; const n = di(), a = (t == null ? void 0 : t.weekStartsOn) ?? ((u = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : u.weekStartsOn) ?? n.weekStartsOn ?? ((d = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : d.weekStartsOn) ?? 0, o = sn(e), i = o.getDay(), l = (i < a ? 7 : 0) + i - a; return o.setDate(o.getDate() - l), o.setHours(0, 0, 0, 0), o; } function Ai(e) { return Ea(e, { weekStartsOn: 1 }); } function Hg(e) { const t = sn(e), n = t.getFullYear(), a = fn(e, 0); a.setFullYear(n + 1, 0, 4), a.setHours(0, 0, 0, 0); const o = Ai(a), i = fn(e, 0); i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0); const l = Ai(i); return t.getTime() >= o.getTime() ? n + 1 : t.getTime() >= l.getTime() ? n : n - 1; } function Xc(e) { const t = sn(e); return t.setHours(0, 0, 0, 0), t; } function ts(e) { const t = sn(e), n = new Date( Date.UTC( t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds() ) ); return n.setUTCFullYear(t.getFullYear()), +e - +n; } function jT(e, t) { const n = Xc(e), a = Xc(t), o = +n - ts(n), i = +a - ts(a); return Math.round((o - i) / NT); } function _T(e) { const t = Hg(e), n = fn(e, 0); return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), Ai(n); } function HT(e, t) { const n = t * 3; return tf(e, n); } function Kc(e, t) { return tf(e, t * 12); } function WT(e) { return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]"; } function or(e) { if (!WT(e) && typeof e != "number") return !1; const t = sn(e); return !isNaN(Number(t)); } function sc(e) { const t = sn(e), n = t.getMonth(); return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t; } function uc(e) { const t = sn(e), n = t.getMonth(), a = n - n % 3; return t.setMonth(a, 1), t.setHours(0, 0, 0, 0), t; } function cc(e) { const t = sn(e); return t.setDate(1), t.setHours(0, 0, 0, 0), t; } function Rr(e) { const t = sn(e), n = t.getFullYear(); return t.setFullYear(n + 1, 0, 0), t.setHours(23, 59, 59, 999), t; } function Il(e) { const t = sn(e), n = fn(e, 0); return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n; } function zm(e, t) { var s, u, f, d; const n = di(), a = (t == null ? void 0 : t.weekStartsOn) ?? ((u = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : u.weekStartsOn) ?? n.weekStartsOn ?? ((d = (f = n.locale) == null ? void 0 : f.options