UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,678 lines 2.33 MB
var ab = Object.defineProperty; var ib = (e, t, n) => t in e ? ab(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var G = (e, t, n) => ib(e, typeof t != "symbol" ? t + "" : t, n); import { ref as h, computed as D, watch as K, onUnmounted as Et, defineComponent as ne, provide as bt, createVNode as s, inject as ie, onMounted as ue, Fragment as Ke, reactive as mt, createApp as Aa, Transition as xa, mergeProps as Pt, resolveComponent as Ot, createTextVNode as te, isVNode as ao, nextTick as Ue, onBeforeMount as bn, Teleport as sa, shallowRef as ha, render as Ds, h as lb, cloneVNode as sb, withModifiers as ct, withDirectives as it, vModelText as yn, resolveDirective as Pn, getCurrentInstance as eu, onBeforeUnmount as ra, vShow as Bn, watchEffect as Qf, Comment as rb, toRaw as ub, vModelCheckbox as Zf, toRefs as wi, triggerRef as cb, toRef as db, onUpdated as Jf } from "vue"; import { cloneDeep as Me, isPlainObject as xd, isUndefined as On, flatten as fb, isNaN as pb, throttle as ep, isEmpty as Bs, merge as fo, debounce as mb, findIndex as Td, mergeWith as kd } from "lodash-es"; import at from "bignumber.js"; import { useResizeObserver as Si } from "@vueuse/core"; const Ta = {}, tp = {}; function tu(e) { const { properties: t, title: n, ignore: o } = e, a = o && Array.isArray(o), i = Object.keys(t).reduce((l, r) => ((!a || !o.find((c) => c === r)) && (l[r] = t[r].type === "object" && t[r].properties ? tu(t[r]) : Me(t[r].default)), l), {}); if (n && (!a || !o.find((l) => l === "id"))) { const l = n.toLowerCase().replace(/-/g, "_"); i.id = `${l}_${Math.random().toString().slice(2, 6)}`; } return i; } function vb(e) { const { properties: t, title: n, required: o } = e; if (o && Array.isArray(o)) { const a = o.reduce((i, l) => (i[l] = t[l].type === "object" && t[l].properties ? tu(t[l]) : Me(t[l].default), i), {}); if (n && o.find((i) => i === "id")) { const i = n.toLowerCase().replace(/-/g, "_"); a.id = `${i}_${Math.random().toString().slice(2, 6)}`; } return a; } return { type: n }; } function on(e, t = {}, n) { const o = Ta[e]; if (o) { let a = vb(o); const i = tp[e]; return a = i ? i({ getSchemaByType: on }, a, t, n) : a, a; } return null; } function Cr(e, t) { const n = tu(t); return Object.keys(n).reduce((o, a) => (Object.prototype.hasOwnProperty.call(e, a) && (o[a] && xd(o[a]) && xd(e[a] || !e[a]) ? Object.assign(o[a], e[a] || {}) : o[a] = e[a]), o), n), n; } function np(e, t) { return Object.keys(e).filter((o) => e[o] != null).reduce((o, a) => { if (t.has(a)) { const i = t.get(a); if (typeof i == "string") o[i] = e[a]; else { const l = i(a, e[a], e); Object.assign(o, l); } } else o[a] = e[a]; return o; }, {}); } function gb(e, t, n = /* @__PURE__ */ new Map()) { const o = Cr(e, t); return np(o, n); } function op(e) { var n; const t = e.type; if (t) { const o = Ta[t]; if (!o) return e; const a = Cr(e, o), i = ((n = e.editor) == null ? void 0 : n.type) || ""; if (i) { const l = Ta[i], r = Cr(e.editor, l); a.editor = r; } return a; } return e; } function hb(e = {}) { function t(u, f, d, m) { if (typeof d == "number") return m[u].length === d; if (typeof d == "object") { const v = Object.keys(d)[0], p = d[v]; if (v === "not") return Number(m[u].length) !== Number(p); if (v === "moreThan") return Number(m[u].length) >= Number(p); if (v === "lessThan") return Number(m[u].length) <= Number(p); } return !1; } function n(u, f, d, m) { return m[u] && m[u].propertyValue && String(m[u].propertyValue.value) === String(d); } const o = /* @__PURE__ */ new Map([ ["length", t], ["getProperty", n] ]); Object.keys(e).reduce((u, f) => (u.set(f, e[f]), u), o); function a(u, f) { const d = u; return typeof f == "number" ? [{ target: d, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: d, operator: "getProperty", param: u, value: !!f }] : typeof f == "object" ? Object.keys(f).map((m) => { if (m === "length") return { target: d, operator: "length", param: null, value: f[m] }; const v = m, p = f[m]; return { target: d, operator: "getProperty", param: v, value: p }; }) : []; } function i(u) { return Object.keys(u).reduce((d, m) => { const v = a(m, u[m]); return d.push(...v), d; }, []); } function l(u, f) { if (o.has(u.operator)) { const d = o.get(u.operator); return d && d(u.target, u.param, u.value, f) || !1; } return !1; } function r(u, f) { return i(u).reduce((v, p) => v && l(p, f), !0); } function c(u, f) { const d = Object.keys(u), m = d.includes("allOf"), v = d.includes("anyOf"), p = m || v, C = (p ? u[p ? m ? "allOf" : "anyOf" : "allOf"] : [u]).map((S) => r(S, f)); return m ? !C.includes(!1) : C.includes(!0); } return { parseValueSchema: c }; } const yb = { convertTo: (e, t, n, o) => { e.appearance || (e.appearance = {}), e.appearance[t] = n; }, convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t] }, bb = { convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无" }, Cb = { convertTo: (e, t, n, o) => { e.editor && (e.editor[t] = n); }, convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t] }, we = { 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: "标签页工具栏按钮" }, "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: "标签页工具栏" }, 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: "列表导航" }, "filter-bar": { type: "filter-bar", name: "筛选条" } }, wb = { convertFrom: (e, t, n) => { var a; const o = e.editor && e.editor[t] ? e.editor[t] : e[t]; return ((a = we[o]) == null ? void 0 : a.name) || o; } }, Sb = { convertTo: (e, t, n, o) => { e[t] = e[t]; }, convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : "" }, xb = { convertFrom: (e, t) => e.binding ? e.binding.path : "", convertTo: (e, t, n) => { if (n && n.length > 0) { const o = n[0]; e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = o.bindingField, e.binding.field = o.id, e.binding.fullPath = o.path, e.path = o.bindingPath; } } }, Tb = { convertTo: (e, t, n, o) => { e.pagination || (e.pagination = {}), e.pagination[t] = n; }, convertFrom: (e, t, n) => e.pagination ? e.pagination[t] : e[t] }, kb = { convertTo: (e, t, n, o) => { e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n; }, convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t] }, Fb = { convertTo: (e, t, n, o) => { e.selection || (e.selection = {}), e.selection[t] = n; }, convertFrom: (e, t, n) => e.selection ? e.selection[t] : e[t] }, Ib = { convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : "" }, Mb = { convertFrom: (e, t) => e[t] || "", convertTo: (e, t, n) => { e[t] = n; } }, ql = {}, wr = /* @__PURE__ */ new Map([ ["/converter/appearance.converter", yb], ["/converter/buttons.converter", bb], ["/converter/property-editor.converter", Cb], ["/converter/items-count.converter", Ib], ["/converter/type.converter", wb], ["/converter/change-editor.converter", Sb], ["/converter/form-group-label.converter", Mb], ["/converter/field-selector.converter", xb], ["/converter/pagination.converter", Tb], ["/converter/row-number.converter", kb], ["/converter/grid-selection.converter", Fb] ]), Pb = {}, Eb = /* @__PURE__ */ new Map([ ["string", { type: "input-group", enableClear: !1 }], ["boolean", { type: "combo-list", textField: "name", valueField: "value", idField: "value", enableClear: !1, editable: !1, maxHeight: 64, data: [ { value: !0, name: "是" }, { value: !1, name: "否" } ] }], ["enum", { type: "combo-list", maxHeight: 350, enableClear: !1, editable: !1 }], ["array", { type: "button-edit" }], ["number", { type: "number-spinner", placeholder: "" }], ["events-editor", { type: "events-editor", hide: !0 }] ]), Ob = hb(); function ap(e, t) { return () => Ob.parseValueSchema(e, t); } function Db(e, t, n) { return e.includes("visible") && t.visible !== void 0 ? typeof t.visible == "boolean" ? () => !!t.visible : t.visible === void 0 ? !0 : ap(t.visible, n) : () => !0; } function Bb(e, t, n) { return e.includes("readonly") && t.readonly !== void 0 ? typeof t.readonly == "boolean" ? () => !!t.readonly : ap(t.readonly, n) : () => !1; } function Ab(e, t) { const n = e.$converter || t; return typeof n == "string" && n && wr.has(n) ? wr.get(n) || null : n || null; } function nu(e, t, n, o, a, i = "", l = "") { return Object.keys(e).map((c) => { const u = h(1), f = c, d = e[c], m = Object.keys(d), v = d.title, p = d.type, g = Eb.get(p) || { type: "input-group", enableClear: !1 }, y = d.editor ? Object.assign({}, g, d.editor) : Object.assign({}, g), C = Db(m, d, t), b = Bb(m, d, t); y.readonly = y.readonly === void 0 ? b() : y.readonly; const S = d.type === "cascade" ? nu(d.properties, t, n, o, a, i, l) : [], k = !0; let x = Ab(d, l); const w = D({ get() { if (u.value) { if (["class", "style"].find((R) => R === f) && !x && (x = wr.get("/converter/appearance.converter") || null), x && x.convertFrom) return x.convertFrom(n, c, a, i); const P = n[c]; return Object.prototype.hasOwnProperty.call(d, "defaultValue") && (P === void 0 || typeof P == "string" && P === "") ? d.defaultValue : P; } return null; }, set(P) { u.value += 1, x && x.convertTo ? (x.convertTo(o, c, P, a, i), x.convertTo(n, c, P, a, i)) : (o[c] = P, n[c] = P); } }), { refreshPanelAfterChanged: T, description: F, isExpand: I } = d, E = { propertyID: f, propertyName: v, propertyType: p, propertyValue: w, editor: y, visible: C, readonly: b, cascadeConfig: S, hideCascadeTitle: k, refreshPanelAfterChanged: T, description: F, isExpand: I }; return t[f] = E, E; }); } function Rb(e, t, n, o, a = "") { const i = t.$ref.schema, l = t.$ref.converter, r = n[i], c = r.type, u = op(r), f = {}, d = ql[c]; if (d && d.categories) { const m = d.categories[e], v = m == null ? void 0 : m.title; l && Object.keys(m.properties).forEach((y) => { m.properties[y].$converter = l; }); const p = (m == null ? void 0 : m.properties) || {}, g = nu(p, f, u, r, o, a); return { categoryId: e, categoryName: v, properties: g }; } return { categoryId: e, categoryName: "", properties: [] }; } function As(e, t, n, o, a) { const i = e.type, l = op(e), r = {}; let c = a || ql[i]; if (c && Object.keys(c).length === 0 && n && n.getPropConfig && (c = n.getPropConfig(o)), c && c.categories) { const u = []; return Object.keys(c.categories).map((f) => { const d = c.categories[f]; if (d.$ref) { u.push(Rb(f, d, e, t, o)); return; } const m = d == null ? void 0 : d.title, v = d == null ? void 0 : d.tabId, p = d == null ? void 0 : d.tabName, g = d == null ? void 0 : d.hide, y = d == null ? void 0 : d.hideTitle, C = nu(d.properties || {}, r, l, e, t, o, d.$converter), { setPropertyRelates: b } = d; u.push({ categoryId: f, categoryName: m, tabId: v, tabName: p, hide: g, properties: C, hideTitle: y, setPropertyRelates: b }); }), u; } return []; } function Pe(e, t, n = /* @__PURE__ */ new Map(), o = (l, r, c, u) => r, a = {}, i = (l) => l) { return Ta[t.title] = t, tp[t.title] = o, ql[t.title] = a, Pb[t.title] = i, (l = {}, r = !0) => { if (!r) return np(l, n); const c = gb(l, t, n), u = Object.keys(e).reduce((f, d) => (f[d] = e[d].default, f), {}); return Object.assign(u, c); }; } function je(e, t) { return { customClass: t.class, customStyle: t.style }; } function Vb(e, t) { var o, a; const n = {}; if (t != null && t.buttons) { const i = []; (o = t == null ? void 0 : t.buttons) == null || o.map((l) => { const r = {}; Object.keys(l).map((c) => { var u; c === "appearance" ? r.class = ((u = l[c]) == null ? void 0 : u.class) || "" : r[c] = l[c]; }), i.push(r); }), n.buttons = i; } return (a = t == null ? void 0 : t.appearance) != null && a.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 $b() { function e(t, n) { const { id: o } = t || {}, { field: a } = t.binding || {}; return { modelValue: n.getValue(o), "onUpdate:modelValue": (i) => { n.setValue(o, a, i); } }; } return { resolve: e }; } function Nb() { function e(t, n) { const { id: o } = t || {}, { dataSource: a } = t || {}; return a === void 0 ? {} : { data: n.getValue(o), "onUpdate:data": (...i) => { } }; } return { resolve: e }; } function Lb() { function e(t, n) { const { dataSource: o } = t || {}; return o === void 0 ? {} : {}; } return { resolve: e }; } function qY() { function e(t, n) { const { path: o } = t.binding || {}; return o ? { "onUpdate:dataMapping": (...a) => { } } : {}; } return { resolve: e }; } function jb() { return (e, t, n) => { const o = t.id, { type: a } = t, i = e.emits; return i ? i.filter((l) => l !== "update:modelValue").reduce((l, r) => { const c = `on${r.charAt(0).toUpperCase()}${r.slice(1)}`; return l[c] = (...u) => { n.dispatch(o, r, a, u); }, l; }, {}) : {}; }; } function _b() { function e(t, n) { return t.selectItemById(n); } return { selectItemById: e }; } function Hb() { function e(t, n) { return t.selectItemById(n); } return { selectItemById: e }; } function Wb() { function e(t) { return t.editor; } return { resolve: e }; } function UY() { function e(t) { return Object.prototype.hasOwnProperty.call(t, "visible") ? t.visible : null; } return { resolve: e }; } function Ul(e, t) { if (!e || e.length < 1) return null; for (const n of e) { if (n.id === t) return n; if (n.children) { const o = n.children.find((a) => a.id === t); if (o) return o; } } return null; } function GY() { function e(t, n) { const { name: o } = n; return t[`on${o.charAt(0).toUpperCase()}${o.slice(1)}`] || t[o]; } return { resolve: e }; } function zb() { function e(t, n) { var r; const o = (r = t.toolbar) == null ? void 0 : r.buttons; if (!o || o.length < 1) return null; const [a, i] = n.payloads, l = Ul(o, i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function qb() { function e(t, n) { const { name: o } = n, [a, i] = n.payloads; if (o === "tabChange" || o === "tabRemove") return t[`on${o.charAt(0).toUpperCase()}${o.slice(1)}`]; const l = t.contents; if (!l || l.length < 1) return null; const r = l.reduce((u, f) => { const d = f.toolbar && f.toolbar.buttons || []; return u.push(...d), u; }, []); if (!r || r.length < 1) return; const c = Ul(r, i); return c ? c.onClick || c.click : null; } return { resolve: e }; } function Ub() { function e(t, n) { const o = t.buttons; if (!o || o.length < 1) return null; const [a, i] = n.payloads, l = Ul(o, i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function Gb() { function e(t, n) { var r; const o = (r = t.toolbar) == null ? void 0 : r.buttons; if (!o || o.length < 1) return null; const [a, i] = n.payloads, l = Ul(o, i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function ip() { function e(t, n) { const { columns: o } = n; return t.updateColumns(o); } return { updateColumns: e }; } const lp = /* @__PURE__ */ new Map([ ["appearance", je], ["size", (e, t) => { const n = {}; return t.width && (n.width = Number(t.width)), t.height && (n.height = Number(t.height)), n; }] ]), Yb = "https://json-schema.org/draft/2020-12/schema", Xb = "https://farris-design.gitee.io/accordion.schema.json", Kb = "accordion", Qb = "A Farris Container Component", Zb = "object", Jb = { 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 } }, eC = [ "id", "type", "contents" ], tC = { $schema: Yb, $id: Xb, title: Kb, description: Qb, type: Zb, properties: Jb, required: eC }; function nC(e, t, n) { return t; } const oC = "accordion", aC = "A Farris Component", iC = "object", lC = { basic: { description: "Basic Infomation", title: "基本信息", properties: { id: { description: "组件标识", title: "标识", type: "string", readonly: !0 }, type: { description: "组件类型", title: "控件类型", type: "select", editor: { type: "waiting for modification", enum: [] } } } } }, sC = { title: oC, description: aC, type: iC, categories: lC }, ou = { customClass: { type: String, default: "" }, enableFold: { type: Boolean, default: !0 }, expanded: { type: Boolean, default: !1 }, height: { type: Number }, width: { type: Number } }, sp = Pe(ou, tC, lp, nC, sC); function rp(e) { const t = e.nativeElement ? e.nativeElement : e; return t.classList !== void 0 && t.classList !== null ? t : null; } function up(e, t) { if (t === void 0) return; const n = rp(e); n && n.classList.remove(t); } function Sr(e, t) { if (t === void 0) return; const n = rp(e); n && n.classList.add(t); } const Rs = [ { size: "sm", width: 576 }, { size: "md", width: 768 }, // { size: 'lg', width: 888 }, 输入控件有此处断点,但没有此处样式 { size: "xl", width: 1200 }, { size: "el", width: 1690 } ]; function cp(e) { e.resizeObserver && (e.resizeObserver.disconnect(), e.sharedObject = null); } function dp(e, t, n = 0) { const o = []; if (!t) return; const a = n || t.getBoundingClientRect().width, i = parseFloat(a); for (let l = 0; l < Rs.length; l++) Rs[l].width <= i && o.push(Rs[l].size); if (e.className.join(",") !== o.join(",")) { if (e.className.length - o.length > 0) for (let r = o.length; r < e.className.length; r++) up(t, "f-area-response--" + e.className[r]); else for (let r = e.className.length; r < o.length; r++) Sr(t, "f-area-response--" + o[r]); e.className = [...o]; } } function rC(e, t) { e.enable && e.autoWidth ? e.resizeObserver || (e.resizeObserver = new ResizeObserver((n) => { if (!n || n.length < 1 || !n[0].contentRect) return; const o = n[0].contentRect; Math.abs(parseInt(o.width + "") - e.width) > e.threshold && (dp(e, t, o.width), e.width = parseInt(o.width + "")); }), e.resizeObserver.observe(t)) : cp(e); } function Fd(e, t) { if (e.enable) Sr(t, "f-area-response"), dp(e, t); else { up(t, "f-area-response"); for (let n = e.className.length; n > 0; n--) Sr(t, "f-area-response--" + e.className[n]); e.className = []; } rC(e, t); } function Id(e, t) { 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); } const ti = { // 在绑定元素的父组件 // 及他自己的所有子节点都挂载完成后调用 mounted: (e, t, n) => { n.sharedObject = { className: [], resizeObserver: null, enable: !0, autoWidth: !0, threshold: 10, width: 0 }, Id(n.sharedObject, t), Fd(n.sharedObject, e); }, // 在绑定元素的父组件 // 及他自己的所有子节点都更新后调用 updated: function(e, t, n, o) { n.sharedObject = o.sharedObject, Id(n.sharedObject, t), Fd(n.sharedObject, e); }, // 绑定元素的父组件卸载前调用 beforeUnmount(e, t, n) { cp(n.sharedObject); } }; function fp(e, t, n, o, a) { const i = h(e.disabled), l = h(!1), r = h("text"), c = h(e.showBorder), u = h(e.textAlign), f = h(e.updateOn), d = h(!1), m = D(() => e.editable || !e.readonly), v = D(() => e.editable && !e.disabled && !e.readonly), p = D(() => !e.disabled && l.value), g = D(() => n.value === "" || n.value === null || n.value === void 0), y = D(() => (e.disabled || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), C = D(() => e.readonly || !e.editable), b = D(() => e.enableTitle ? n.value : ""), S = D(() => ({ "form-control": !0, "f-utils-fill": !0, "text-left": u.value === "left", "text-center": u.value === "center", "text-right": u.value === "right" })), k = D(() => { const B = { "f-cmp-inputgroup": !0, "input-group": !0, "f-state-disabled": i.value, "f-state-editable": v.value, "f-state-readonly": C.value, "f-state-focus": p.value, "input-group--has-clear": e.enableClear && d.value }; return (e.customClass || "").split(" ").reduce((N, V) => (N[V] = !0, N), B), B; }), x = D(() => c.value ? "" : "border-width : 0 "); function w(B, A = !0) { n.value = B, o.value !== B && (o.value = B), A && t.emit("change", B), t.emit("update:modelValue", B), t.emit("update:value", B); } K( () => e.modelValue, (B, A) => { B !== A && (n.value = B, o.value = B); } ), K(() => e.disabled, (B, A) => { B !== A && (i.value = B); }); function T(B) { return B.stopPropagation(), l.value = !1, t.emit("blur", B), B.target.tagName === "TEXTAREA" && (t.emit("update:modelValue", B.target.value), t.emit("update:value", B.target.value), t.emit("change", B.target.value)), !1; } function F(B) { t.emit("click", B); } function I(B) { e.disabled || (c.value && (l.value = !0), m.value && t.emit("focus", B)); } function E(B) { t.emit("input", B.target.value); const A = B.target.value; o.value = A, f.value === "change" && (t.emit("update:modelValue", A), t.emit("update:value", A), t.emit("change", A)); } function P(B) { t.emit("keydown", B); } function R(B) { t.emit("keyup", B); } function $(B) { const A = B.target; A.tagName !== "INPUT" && A.tagName !== "TEXTAREA" && B.preventDefault(), B.stopPropagation(), t.emit("mousedownEvent", B); } function M(B) { t.emit("mouseupEvent", B); } function O(B) { if (f.value === "blur") { const A = B.target.value; B.stopPropagation(), w(A); } } return { changeTextBoxValue: w, disabled: i, displayText: o, editable: v, hasFocused: p, inputGroupClass: k, inputType: r, isEmpty: g, modelValue: n, readonly: C, onBlur: T, hasClearClass: d, onClick: F, onFocus: I, onInput: E, onKeydown: P, onKeyup: R, onMousedown: $, onMouseup: M, onTextBoxValueChange: O, placeholder: y, textBoxClass: S, textBoxTitle: b, inputGroupStyle: x }; } function uC(e, t, n, o) { const a = h(e.disabled), i = h(!1), l = h("text"), r = h(e.showBorder), c = h(e.textAlign); D(() => e.editable || !e.readonly); const u = D(() => e.editable && !e.disabled && !e.readonly), f = D(() => !e.disabled && i.value), d = D(() => n.value === "" || n.value === null || n.value === void 0), m = D(() => e.placeholder), v = D(() => e.readonly || !e.editable), p = D(() => e.enableTitle ? n.value : ""), g = D(() => ({ "form-control": !0, // 'f-utils-fill': true, "text-left": c.value === "left", "text-center": c.value === "center", "text-right": c.value === "right" })), y = D(() => ({ "f-cmp-inputgroup": !0, "input-group": !0, "f-state-disabled": !0, "f-state-editable": !1, "f-state-readonly": !0 // 'f-state-focus': hasFocused.value })), C = D(() => r.value ? "" : "border-width : 0 "); function b(S, k = !0) { } return { changeTextBoxValue: b, disabled: a, displayText: o, editable: u, hasFocused: f, inputGroupClass: y, inputType: l, isEmpty: d, modelValue: n, readonly: v, // onBlur, // onClick, // onFocus, // onInput, // onKeydown, // onKeyup, // onMousedown, // onTextBoxValueChange, placeholder: m, textBoxClass: g, textBoxTitle: p, inputGroupStyle: C }; } function au(e, t, n) { const o = h(!1), a = D(() => e.enableClear && !e.readonly && !e.disabled), { changeTextBoxValue: i, displayText: l, hasFocused: r, modelValue: c, isEmpty: u, hasClearClass: f } = n; function d(C) { o.value = C, f && (f.value = o.value); } K(l, () => { r != null && r.value ? d(!!(l != null && l.value)) : d(!1); }); const m = D(() => ({ "input-group-text": !0, "input-group-clear": !0 })), v = D(() => ({ width: "24px", display: o.value ? "flex" : "none" })); function p(C) { C.stopPropagation(), a.value && (i("", !0), d(!o.value), t.emit("clear")); } function g(C) { var x, w; const b = ((x = C.target.querySelector("input")) == null ? void 0 : x.value) || "", S = ((w = C.target.querySelector("textarea")) == null ? void 0 : w.value) || "", k = b || S; k !== c.value && (c.value = k), a.value && d(!!k); } function y(C) { a.value && d(!1); } return { clearButtonClass: m, clearButtonStyle: v, hasShownClearButton: o, onClearValue: p, onMouseEnter: g, onMouseLeave: y, shouldShowClearButton: a }; } const cC = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, dC = { sun: 0, mon: 1, tue: 2, wed: 3, thu: 4, fri: 5, sat: 6 }; class pp { constructor() { G(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" }); G(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"), o = ("" + t[2]).padStart(2, "0"), a = t[5], i = t[3], l = t[4], r = a + "-" + n + "-" + o + "T" + i + l; return isNaN(r) ? !1 : r; } ], // @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 o = t[1]; if (o) { if (n = this.create(o), isNaN(n)) return !1; } else n = /* @__PURE__ */ new Date(), n.setMilliseconds(0); const a = t[2], i = t[3], l = t[4], r = t[5]; return n.setHours(parseFloat(a), parseFloat(i), parseFloat(l || 0)), r && n.setMilliseconds(+String(r).slice(0, 3)), n; } ], // 12-hour time [ "12_hour", this.makePattern("^(?:(.+) )?(_H12_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)? ?(_AMPM_)$"), (t) => { let n; const o = t[1]; if (o) { if (n = this.create(o), isNaN(n)) return !1; } else n = /* @__PURE__ */ new Date(), n.setMilliseconds(0); let a = parseFloat(t[2]); a = t[5].toLowerCase() === "am" ? a === 12 ? 0 : a : a === 12 ? 12 : a + 12; const i = t[3], l = t[4]; return n.setHours(a, parseFloat(i || 0), parseFloat(l || 0)), n; } ] ]); } makePattern(t) { return t = t.replace(/_([A-Z][A-Z0-9]+)_/g, (n, o) => this.regexes[o]), new RegExp(t, "i"); } getMonthByName(t) { return cC[String(t).slice(0, 3).toLowerCase()]; } getWeekdayByName(t) { return dC[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 o = this.patterns[n]; let a, i; typeof o[0] == "string" ? (i = o[1], a = o[2]) : (i = o[0], a = o[1]); const l = t.match(i); if (!l) { n++; continue; } if (typeof a == "function") { const r = a(l); if (r instanceof Date) return r; } else { const r = Date.parse(t.replace(i, a)); if (!isNaN(r)) return new Date(r); } n++; } return NaN; } create(t) { return t == null ? Date.now() : t instanceof Date ? t : this.parse(t); } } function Jt(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 Rt(e, t) { return e instanceof Date ? new e.constructor(t) : new Date(t); } function mp(e, t) { const n = Jt(e); return isNaN(t) ? Rt(e, NaN) : (t && n.setDate(n.getDate() + t), n); } const vp = 6048e5, fC = 864e5, iu = 6e4, lu = 36e5, pC = 1e3; let mC = {}; function Ra() { return mC; } function Do(e, t) { var r, c, u, f; const n = Ra(), o = (t == null ? void 0 : t.weekStartsOn) ?? ((c = (r = t == null ? void 0 : t.locale) == null ? void 0 : r.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((f = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : f.weekStartsOn) ?? 0, a = Jt(e), i = a.getDay(), l = (i < o ? 7 : 0) + i - o; return a.setDate(a.getDate() - l), a.setHours(0, 0, 0, 0), a; } function ka(e) { return Do(e, { weekStartsOn: 1 }); } function gp(e) { const t = Jt(e), n = t.getFullYear(), o = Rt(e, 0); o.setFullYear(n + 1, 0, 4), o.setHours(0, 0, 0, 0); const a = ka(o), i = Rt(e, 0); i.setFullYear(n, 0, 4), i.setHours(0, 0, 0, 0); const l = ka(i); return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= l.getTime() ? n : n - 1; } function Md(e) { const t = Jt(e); return t.setHours(0, 0, 0, 0), t; } function il(e) { const t = Jt(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 vC(e, t) { const n = Md(e), o = Md(t), a = +n - il(n), i = +o - il(o); return Math.round((a - i) / fC); } function gC(e) { const t = gp(e), n = Rt(e, 0); return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), ka(n); } function hC(e) { return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]"; } function Gl(e) { if (!hC(e) && typeof e != "number") return !1; const t = Jt(e); return !isNaN(Number(t)); } function yC(e) { const t = Jt(e), n = Rt(e, 0); return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n; } const bC = { 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" } }, CC = (e, t, n) => { let o; const a = bC[e]; return typeof a == "string" ? o = a : t === 1 ? o = a.one : o = a.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + o : o + " ago" : o; }; function Vs(e) { return (t = {}) => { const n = t.width ? String(t.width) : e.defaultWidth; return e.formats[n] || e.formats[e.defaultWidth]; }; } const wC = { full: "EEEE, MMMM do, y", long: "MMMM do, y", medium: "MMM d, y", short: "MM/dd/yyyy" }, SC = { full: "h:mm:ss a zzzz", long: "h:mm:ss a z", medium: "h:mm:ss a", short: "h:mm a" }, xC = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: "{{date}}, {{time}}", short: "{{date}}, {{time}}" }, TC = { date: Vs({ formats: wC, defaultWidth: "full" }), time: Vs({ formats: SC, defaultWidth: "full" }), dateTime: Vs({ formats: xC, defaultWidth: "full" }) }, kC = { lastWeek: "'last' eeee 'at' p", yesterday: "'yesterday at' p", today: "'today at' p", tomorrow: "'tomorrow at' p", nextWeek: "eeee 'at' p", other: "P" }, FC = (e, t, n, o) => kC[e]; function Ga(e) { return (t, n) => { const o = n != null && n.context ? String(n.context) : "standalone"; let a; if (o === "formatting" && e.formattingValues) { const l = e.defaultFormattingWidth || e.defaultWidth, r = n != null && n.width ? String(n.width) : l; a = e.formattingValues[r] || e.formattingValues[l]; } else { const l = e.defaultWidth, r = n != null && n.width ? String(n.width) : e.defaultWidth; a = e.values[r] || e.values[l]; } const i = e.argumentCallback ? e.argumentCallback(t) : t; return a[i]; }; } const IC = { narrow: ["B", "A"], abbreviated: ["BC", "AD"], wide: ["Before Christ", "Anno Domini"] }, MC = { narrow: ["1", "2", "3", "4"], abbreviated: ["Q1", "Q2", "Q3", "Q4"], wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] }, PC = { 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" ] }, EC = { 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" ] }, OC = { 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" } }, DC = { 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" } }, BC = (e, t) => { const n = Number(e), o = n % 100; if (o > 20 || o < 10) switch (o % 10) { case 1: return n + "st"; case 2: return n + "nd"; case 3: return n + "rd"; } return n + "th"; }, AC = { ordinalNumber: BC, era: Ga({ values: IC, defaultWidth: "wide" }), quarter: Ga({ values: MC, defaultWidth: "wide", argumentCallback: (e) => e - 1 }), month: Ga({ values: PC, defaultWidth: "wide" }), day: Ga({ values: EC, defaultWidth: "wide" }), dayPeriod: Ga({ values: OC, defaultWidth: "wide", formattingValues: DC, defaultFormattingWidth: "wide" }) }; function Ya(e) { return (t, n = {}) => { const o = n.width, a = o && e.matchPatterns[o] || e.matchPatterns[e.defaultMatchWidth], i = t.match(a); if (!i) return null; const l = i[0], r = o && e.parsePatterns[o] || e.parsePatterns[e.defaultParseWidth], c = Array.isArray(r) ? VC(r, (d) => d.test(l)) : ( // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type RC(r, (d) => d.test(l)) ); let u; u = e.valueCallback ? e.valueCallback(c) : c, u = n.valueCallback ? ( // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type n.valueCallback(u) ) : u; const f = t.slice(l.length); return { value: u, rest: f }; }; } function RC(e, t) { for (const n in e) if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n])) return n; } function VC(e, t) { for (let n = 0; n < e.length; n++) if (t(e[n])) return n; } function $C(e) { return (t, n = {}) => { const o = t.match(e.matchPattern); if (!o) return null; const a = o[0], i = t.match(e.parsePattern); if (!i) return null; let l = e.valueCallback ? e.valueCallback(i[0]) : i[0]; l = n.valueCallback ? n.valueCallback(l) : l; const r = t.slice(a.length); return { value: l, rest: r }; }; } const NC = /^(\d+)(th|st|nd|rd)?/i, LC = /\d+/i, jC = { 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 }, _C = { any: [/^b/i, /^(a|c)/i] }, HC = { narrow: /^[1234]/i, abbreviated: /^q[1234]/i, wide: /^[1234](th|st|nd|rd)? quarter/i }, WC = { any: [/1/i, /2/i, /3/i, /4/i] }, zC = { 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 }, qC = { 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 ] }, UC = { 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 }, GC = { 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] }, YC = { 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 }, XC = { 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 } }, KC = { ordinalNumber: $C({ matchPattern: NC, parsePattern: LC, valueCallback: (e) => parseInt(e, 10) }), era: Ya({ matchPatterns: jC, defaultMatchWidth: "wide", parsePatterns: _C, defaultParseWidth: "any" }), quarter: Ya({ matchPatterns: HC, defaultMatchWidth: "wide", parsePatterns: WC, defaultParseWidth: "any", valueCallback: (e) => e + 1 }), month: Ya({ matchPatterns: zC, defaultMatchWidth: "wide", parsePatterns: qC, defaultParseWidth: "any" }), day: Ya({ matchPatterns: UC, defaultMatchWidth: "wide", parsePatterns: GC, defaultParseWidth: "any" }), dayPeriod: Ya({ matchPatterns: YC, defaultMatchWidth: "any", parsePatterns: XC, defaultParseWidth: "any" }) }, hp = { code: "en-US", formatDistance: CC, formatLong: TC, formatRelative: FC, localize: AC, match: KC, options: { weekStartsOn: 0, firstWeekContainsDate: 1 } }; function QC(e) { const t = Jt(e); return vC(t, yC(t)) + 1; } function yp(e) { const t = Jt(e), n = +ka(t) - +gC(t); return Math.round(n / vp) + 1; } function su(e, t) { var f, d, m, v; const n = Jt(e), o = n.getFullYear(), a = Ra(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((d = (f = t == null ? void 0 : t.locale) == null ? void 0 : f.options) == null ? void 0 : d.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((v = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : v.firstWeekContainsDate) ?? 1, l = Rt(e, 0); l.setFullYear(o + 1, 0, i), l.setHours(0, 0, 0, 0); const r = Do(l, t), c = Rt(e, 0); c.setFullYear(o, 0, i), c.setHours(0, 0, 0, 0); const u = Do(c, t); return n.getTime() >= r.getTime() ? o + 1 : n.getTime() >= u.getTime() ? o : o - 1; } function ZC(e, t) { var r, c, u, f; const n = Ra(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((c = (r = t == null ? void 0 : t.locale) == null ? void 0 : r.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((f = (u = n.locale) == null ? void 0 : u.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, a = su(e, t), i = Rt(e, 0); return i.setFullYear(a, 0, o), i.setHours(0, 0, 0, 0), Do(i, t); } function bp(e, t) { const n = Jt(e), o = +Do(n, t) - +ZC(n, t); return Math.round(o / vp) + 1; } function wt(e, t) { const n = e < 0 ? "-" : "", o = Math.abs(e).toString().padStart(t, "0"); return n + o; } const xo = { // Year y(e, t) { const n = e.getFullYear(), o = n > 0 ? n : 1 - n; return wt(t === "yy" ? o % 100 : o, t.length); }, // Month M(e, t) { const n = e.getMonth(); return t === "M" ? String(n + 1) : wt(n + 1, 2); }, // Day of the month d(e, t) { return wt(e.getDate(), t.length); }, // AM or PM a(e, t) { const n = e.getHours() / 12 >= 1 ? "pm" : "am"; switch (t) { case "a": case "aa": return n.toUpperCase(); case "aaa": return n; case "aaaaa": return n[0]; case "aaaa": default: return n === "am" ? "a.m." : "p.m."; } }, // Hour [1-12] h(e, t) { return wt(e.getHours() % 12 || 12, t.length); }, // Hour [0-23] H(e, t) { return wt(e.getHours(), t.length); }, // Minute m(e, t) { return wt(e.getMinutes(), t.length); }, // Second s(e, t) { return wt(e.getSeconds(), t.length); }, // Fraction of second S(e, t) { const n = t.length, o = e.getMilliseconds(), a = Math.trunc( o * Math.pow(10, n - 3) ); return wt(a, t.length); } }, fa = { am: "am", pm: "pm", midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, Pd = { // Era G: function(e, t, n) { const o = e.getFullYear() > 0 ? 1 : 0; switch (t) { case "G": case "GG": case "GGG": return n.era(o, { width: "abbreviated" }); case "GGGGG": return n.era(o, { width: "narrow" }); case "GGGG": default: return n.era(o, { width: "wide" }); } }, // Year y: function(e, t, n) { if (t === "yo") { const o = e.getFullYear(), a = o > 0 ? o : 1 - o; return n.ordinalNumber(a, { unit: "year" }); } return xo.y(e, t); }, // Local week-numbering year Y: function(e, t, n, o) { const a = su(e, o), i = a > 0 ? a : 1 - a; if (t === "YY") { const l = i % 100; return wt(l, 2); } return t === "Yo" ? n.ordinalNumber(i, { unit: "year" }) : wt(i, t.length); }, // ISO week-numbering year R: function(e, t) { const n = gp(e); return wt(n, t.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, t) { const n = e.getFullYear(); return wt(n, t.length); }, // Quarter Q: function(e, t, n) { const o = Math.ceil((e.getMonth() + 1) / 3); switch (t) { case "Q": return Stri