@vuu-ui/vuu-utils 0.8.32 → 0.8.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DataWindow.js +71 -0
- package/cjs/DataWindow.js.map +1 -0
- package/cjs/ThemeProvider.js +85 -0
- package/cjs/ThemeProvider.js.map +1 -0
- package/cjs/array-utils.js +87 -0
- package/cjs/array-utils.js.map +1 -0
- package/cjs/box-utils.js +10 -0
- package/cjs/box-utils.js.map +1 -0
- package/cjs/column-utils.js +810 -0
- package/cjs/column-utils.js.map +1 -0
- package/cjs/common-types.js +15 -0
- package/cjs/common-types.js.map +1 -0
- package/cjs/component-registry.js +111 -0
- package/cjs/component-registry.js.map +1 -0
- package/cjs/cookie-utils.js +10 -0
- package/cjs/cookie-utils.js.map +1 -0
- package/cjs/data-utils.js +58 -0
- package/cjs/data-utils.js.map +1 -0
- package/cjs/datasource-action-utils.js +14 -0
- package/cjs/datasource-action-utils.js.map +1 -0
- package/cjs/datasource-utils.js +178 -0
- package/cjs/datasource-utils.js.map +1 -0
- package/cjs/date/dateTimePattern.js +25 -0
- package/cjs/date/dateTimePattern.js.map +1 -0
- package/cjs/date/formatter.js +66 -0
- package/cjs/date/formatter.js.map +1 -0
- package/cjs/date/types.js +23 -0
- package/cjs/date/types.js.map +1 -0
- package/cjs/date/utils.js +10 -0
- package/cjs/date/utils.js.map +1 -0
- package/cjs/debug-utils.js +31 -0
- package/cjs/debug-utils.js.map +1 -0
- package/cjs/event-emitter.js +119 -0
- package/cjs/event-emitter.js.map +1 -0
- package/cjs/filters/filterAsQuery.js +76 -0
- package/cjs/filters/filterAsQuery.js.map +1 -0
- package/cjs/filters/utils.js +89 -0
- package/cjs/filters/utils.js.map +1 -0
- package/cjs/formatting-utils.js +66 -0
- package/cjs/formatting-utils.js.map +1 -0
- package/cjs/getUniqueId.js +6 -0
- package/cjs/getUniqueId.js.map +1 -0
- package/cjs/group-utils.js +12 -0
- package/cjs/group-utils.js.map +1 -0
- package/cjs/html-utils.js +124 -0
- package/cjs/html-utils.js.map +1 -0
- package/cjs/index.js +282 -8
- package/cjs/index.js.map +1 -7
- package/cjs/input-utils.js +10 -0
- package/cjs/input-utils.js.map +1 -0
- package/cjs/invariant.js +13 -0
- package/cjs/invariant.js.map +1 -0
- package/cjs/itemToString.js +23 -0
- package/cjs/itemToString.js.map +1 -0
- package/cjs/json-utils.js +92 -0
- package/cjs/json-utils.js.map +1 -0
- package/cjs/keyboard-utils.js +28 -0
- package/cjs/keyboard-utils.js.map +1 -0
- package/cjs/keyset.js +68 -0
- package/cjs/keyset.js.map +1 -0
- package/cjs/logging-utils.js +61 -0
- package/cjs/logging-utils.js.map +1 -0
- package/cjs/menu-utils.js +6 -0
- package/cjs/menu-utils.js.map +1 -0
- package/cjs/module-utils.js +12 -0
- package/cjs/module-utils.js.map +1 -0
- package/cjs/nanoid/index.js +22 -0
- package/cjs/nanoid/index.js.map +1 -0
- package/cjs/perf-utils.js +35 -0
- package/cjs/perf-utils.js.map +1 -0
- package/cjs/range-utils.js +74 -0
- package/cjs/range-utils.js.map +1 -0
- package/cjs/react-utils.js +21 -0
- package/cjs/react-utils.js.map +1 -0
- package/cjs/round-decimal.js +86 -0
- package/cjs/round-decimal.js.map +1 -0
- package/cjs/row-utils.js +84 -0
- package/cjs/row-utils.js.map +1 -0
- package/cjs/selection-utils.js +236 -0
- package/cjs/selection-utils.js.map +1 -0
- package/cjs/sort-utils.js +61 -0
- package/cjs/sort-utils.js.map +1 -0
- package/cjs/text-utils.js +21 -0
- package/cjs/text-utils.js.map +1 -0
- package/cjs/ts-utils.js +8 -0
- package/cjs/ts-utils.js.map +1 -0
- package/cjs/url-utils.js +21 -0
- package/cjs/url-utils.js.map +1 -0
- package/cjs/useId.js +9 -0
- package/cjs/useId.js.map +1 -0
- package/cjs/useLayoutEffectSkipFirst.js +17 -0
- package/cjs/useLayoutEffectSkipFirst.js.map +1 -0
- package/esm/DataWindow.js +69 -0
- package/esm/DataWindow.js.map +1 -0
- package/esm/ThemeProvider.js +78 -0
- package/esm/ThemeProvider.js.map +1 -0
- package/esm/array-utils.js +79 -0
- package/esm/array-utils.js.map +1 -0
- package/esm/box-utils.js +8 -0
- package/esm/box-utils.js.map +1 -0
- package/esm/column-utils.js +738 -0
- package/esm/column-utils.js.map +1 -0
- package/esm/common-types.js +13 -0
- package/esm/common-types.js.map +1 -0
- package/esm/component-registry.js +99 -0
- package/esm/component-registry.js.map +1 -0
- package/esm/cookie-utils.js +8 -0
- package/esm/cookie-utils.js.map +1 -0
- package/esm/data-utils.js +50 -0
- package/esm/data-utils.js.map +1 -0
- package/esm/datasource-action-utils.js +8 -0
- package/esm/datasource-action-utils.js.map +1 -0
- package/esm/datasource-utils.js +158 -0
- package/esm/datasource-utils.js.map +1 -0
- package/esm/date/dateTimePattern.js +21 -0
- package/esm/date/dateTimePattern.js.map +1 -0
- package/esm/date/formatter.js +63 -0
- package/esm/date/formatter.js.map +1 -0
- package/esm/date/types.js +20 -0
- package/esm/date/types.js.map +1 -0
- package/esm/date/utils.js +8 -0
- package/esm/date/utils.js.map +1 -0
- package/esm/debug-utils.js +29 -0
- package/esm/debug-utils.js.map +1 -0
- package/esm/event-emitter.js +117 -0
- package/esm/event-emitter.js.map +1 -0
- package/esm/filters/filterAsQuery.js +72 -0
- package/esm/filters/filterAsQuery.js.map +1 -0
- package/esm/filters/utils.js +74 -0
- package/esm/filters/utils.js.map +1 -0
- package/esm/formatting-utils.js +62 -0
- package/esm/formatting-utils.js.map +1 -0
- package/esm/getUniqueId.js +4 -0
- package/esm/getUniqueId.js.map +1 -0
- package/esm/group-utils.js +10 -0
- package/esm/group-utils.js.map +1 -0
- package/esm/html-utils.js +111 -0
- package/esm/html-utils.js.map +1 -0
- package/esm/index.js +45 -8
- package/esm/index.js.map +1 -7
- package/esm/input-utils.js +7 -0
- package/esm/input-utils.js.map +1 -0
- package/esm/invariant.js +11 -0
- package/esm/invariant.js.map +1 -0
- package/esm/itemToString.js +21 -0
- package/esm/itemToString.js.map +1 -0
- package/esm/json-utils.js +90 -0
- package/esm/json-utils.js.map +1 -0
- package/esm/keyboard-utils.js +15 -0
- package/esm/keyboard-utils.js.map +1 -0
- package/esm/keyset.js +66 -0
- package/esm/keyset.js.map +1 -0
- package/esm/logging-utils.js +58 -0
- package/esm/logging-utils.js.map +1 -0
- package/esm/menu-utils.js +4 -0
- package/esm/menu-utils.js.map +1 -0
- package/esm/module-utils.js +9 -0
- package/esm/module-utils.js.map +1 -0
- package/esm/nanoid/index.js +20 -0
- package/esm/nanoid/index.js.map +1 -0
- package/esm/perf-utils.js +32 -0
- package/esm/perf-utils.js.map +1 -0
- package/esm/range-utils.js +66 -0
- package/esm/range-utils.js.map +1 -0
- package/esm/react-utils.js +19 -0
- package/esm/react-utils.js.map +1 -0
- package/esm/round-decimal.js +84 -0
- package/esm/round-decimal.js.map +1 -0
- package/esm/row-utils.js +78 -0
- package/esm/row-utils.js.map +1 -0
- package/esm/selection-utils.js +227 -0
- package/esm/selection-utils.js.map +1 -0
- package/esm/sort-utils.js +57 -0
- package/esm/sort-utils.js.map +1 -0
- package/esm/text-utils.js +18 -0
- package/esm/text-utils.js.map +1 -0
- package/esm/ts-utils.js +6 -0
- package/esm/ts-utils.js.map +1 -0
- package/esm/url-utils.js +18 -0
- package/esm/url-utils.js.map +1 -0
- package/esm/useId.js +7 -0
- package/esm/useId.js.map +1 -0
- package/esm/useLayoutEffectSkipFirst.js +15 -0
- package/esm/useLayoutEffectSkipFirst.js.map +1 -0
- package/package.json +12 -9
- package/types/column-utils.d.ts +1 -43
- package/types/filters/filterAsQuery.d.ts +2 -0
- package/types/filters/index.d.ts +1 -1
- package/types/filters/utils.d.ts +44 -2
- package/types/index.d.ts +0 -1
- package/LICENSE +0 -201
- package/types/local-config.d.ts +0 -3
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const createEl = (elementType, className, textContent) => {
|
|
2
|
+
const el = document.createElement(elementType);
|
|
3
|
+
if (className) {
|
|
4
|
+
el.className = className;
|
|
5
|
+
}
|
|
6
|
+
if (textContent) {
|
|
7
|
+
el.textContent = textContent;
|
|
8
|
+
}
|
|
9
|
+
return el;
|
|
10
|
+
};
|
|
11
|
+
const getFocusableElement = (el, tabIndex) => {
|
|
12
|
+
if (el) {
|
|
13
|
+
if (el.hasAttribute("tabindex")) {
|
|
14
|
+
const rootTabIndex = parseInt(el.getAttribute("tabindex"));
|
|
15
|
+
if (!isNaN(rootTabIndex) && (tabIndex === void 0 || rootTabIndex === tabIndex)) {
|
|
16
|
+
return el;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const focusableEl = typeof tabIndex === "number" ? el.querySelector(`[tabindex="${tabIndex}"]`) : el.querySelector("[tabindex]");
|
|
20
|
+
if (focusableEl) {
|
|
21
|
+
return focusableEl;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const getElementDataIndex = (el) => {
|
|
26
|
+
if (el) {
|
|
27
|
+
const index = parseInt(el.dataset.index || "");
|
|
28
|
+
if (!isNaN(index)) {
|
|
29
|
+
return index;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return -1;
|
|
33
|
+
};
|
|
34
|
+
const queryClosest = (el, cssQueryString) => el === null ? null : el.closest(cssQueryString);
|
|
35
|
+
const getClosest = (el, dataProperty) => queryClosest(el, `[data-${dataProperty}]`);
|
|
36
|
+
const getClosestIndexItem = (el) => getClosest(el, "index");
|
|
37
|
+
function getElementByDataIndex(container, index, throwIfNotFound = false) {
|
|
38
|
+
if (container === null && throwIfNotFound) {
|
|
39
|
+
throw Error("html-utils getElementByDataIndex, container is null");
|
|
40
|
+
}
|
|
41
|
+
const element = container?.querySelector(
|
|
42
|
+
`[data-index="${index}"]`
|
|
43
|
+
);
|
|
44
|
+
if (element) {
|
|
45
|
+
return element;
|
|
46
|
+
} else if (throwIfNotFound) {
|
|
47
|
+
throw Error(
|
|
48
|
+
"html-utils getElementByDataIndex, Item not found with data-index='${index}'"
|
|
49
|
+
);
|
|
50
|
+
} else {
|
|
51
|
+
return void 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const focusFirstFocusableElement = (el, tabIndex) => {
|
|
55
|
+
requestAnimationFrame(() => {
|
|
56
|
+
const focusableElement = getFocusableElement(el, tabIndex);
|
|
57
|
+
if (focusableElement) {
|
|
58
|
+
focusableElement.focus();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
const isSelectableElement = (el) => {
|
|
63
|
+
const item = el?.closest("[data-index]");
|
|
64
|
+
if (!item || item.ariaDisabled || item.dataset.selectable === "false" || item.querySelector('[data-selectable="false"],[aria-disabled="true"]')) {
|
|
65
|
+
return false;
|
|
66
|
+
} else {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
let size;
|
|
71
|
+
function getScrollbarSize() {
|
|
72
|
+
if (size === void 0) {
|
|
73
|
+
let outer = document.createElement("div");
|
|
74
|
+
outer.className = "scrollable-content";
|
|
75
|
+
outer.style.width = "50px";
|
|
76
|
+
outer.style.height = "50px";
|
|
77
|
+
outer.style.overflowY = "scroll";
|
|
78
|
+
outer.style.position = "absolute";
|
|
79
|
+
outer.style.top = "-200px";
|
|
80
|
+
outer.style.left = "-200px";
|
|
81
|
+
const inner = document.createElement("div");
|
|
82
|
+
inner.style.height = "100px";
|
|
83
|
+
inner.style.width = "100%";
|
|
84
|
+
outer.appendChild(inner);
|
|
85
|
+
document.body.appendChild(outer);
|
|
86
|
+
const outerWidth = outer.offsetWidth;
|
|
87
|
+
const innerWidth = inner.offsetWidth;
|
|
88
|
+
document.body.removeChild(outer);
|
|
89
|
+
size = outerWidth - innerWidth;
|
|
90
|
+
outer = null;
|
|
91
|
+
}
|
|
92
|
+
return size;
|
|
93
|
+
}
|
|
94
|
+
const dispatchMouseEvent = (el, type) => {
|
|
95
|
+
const evt = new MouseEvent(type, {
|
|
96
|
+
view: window,
|
|
97
|
+
bubbles: true,
|
|
98
|
+
cancelable: true
|
|
99
|
+
});
|
|
100
|
+
el.dispatchEvent(evt);
|
|
101
|
+
};
|
|
102
|
+
const dispatchCustomEvent = (el, type) => {
|
|
103
|
+
const evt = new Event(type, {
|
|
104
|
+
bubbles: true,
|
|
105
|
+
cancelable: true
|
|
106
|
+
});
|
|
107
|
+
el.dispatchEvent(evt);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export { createEl, dispatchCustomEvent, dispatchMouseEvent, focusFirstFocusableElement, getClosest, getClosestIndexItem, getElementByDataIndex, getElementDataIndex, getFocusableElement, getScrollbarSize, isSelectableElement, queryClosest };
|
|
111
|
+
//# sourceMappingURL=html-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-utils.js","sources":["../src/html-utils.ts"],"sourcesContent":["export const createEl = (\n elementType: \"div\" | \"p\" | \"span\",\n className?: string,\n textContent?: string\n): HTMLElement => {\n const el = document.createElement(elementType);\n if (className) {\n el.className = className;\n }\n if (textContent) {\n el.textContent = textContent;\n }\n return el;\n};\n\nexport const getFocusableElement = (\n el: HTMLElement | null,\n tabIndex?: number\n) => {\n if (el) {\n if (el.hasAttribute(\"tabindex\")) {\n const rootTabIndex = parseInt(el.getAttribute(\"tabindex\") as string);\n if (\n !isNaN(rootTabIndex) &&\n (tabIndex === undefined || rootTabIndex === tabIndex)\n ) {\n return el;\n }\n }\n const focusableEl =\n typeof tabIndex === \"number\"\n ? (el.querySelector(`[tabindex=\"${tabIndex}\"]`) as HTMLElement)\n : (el.querySelector(\"[tabindex]\") as HTMLElement);\n if (focusableEl) {\n return focusableEl as HTMLElement;\n }\n }\n};\n\nexport const getElementDataIndex = (el: HTMLElement | null) => {\n if (el) {\n const index = parseInt(el.dataset.index || \"\");\n if (!isNaN(index)) {\n return index;\n }\n }\n return -1;\n};\n\nexport const queryClosest = <T extends HTMLElement = HTMLElement>(\n el: HTMLElement | EventTarget | null,\n cssQueryString: string\n) => (el === null ? null : ((el as HTMLElement).closest(cssQueryString) as T));\n\nexport const getClosest = (el: HTMLElement, dataProperty: string) =>\n queryClosest(el, `[data-${dataProperty}]`);\n\nexport const getClosestIndexItem = (el: HTMLElement) => getClosest(el, \"index\");\n\nexport function getElementByDataIndex(\n c: HTMLElement | null,\n i: number | string,\n throwIfNotFound: true\n): HTMLElement;\nexport function getElementByDataIndex(\n c: HTMLElement | null,\n i: number | string,\n throwIfNotFound?: false\n): HTMLElement | undefined;\nexport function getElementByDataIndex(\n container: HTMLElement | null,\n index: number | string,\n throwIfNotFound = false\n) {\n if (container === null && throwIfNotFound) {\n throw Error(\"html-utils getElementByDataIndex, container is null\");\n }\n const element = container?.querySelector(\n `[data-index=\"${index}\"]`\n ) as HTMLElement;\n if (element) {\n return element;\n } else if (throwIfNotFound) {\n throw Error(\n \"html-utils getElementByDataIndex, Item not found with data-index='${index}'\"\n );\n } else {\n return undefined;\n }\n}\n\nexport const focusFirstFocusableElement = (\n el: HTMLElement | null,\n tabIndex?: number\n) => {\n // TODO test el for focusable\n requestAnimationFrame(() => {\n const focusableElement = getFocusableElement(el, tabIndex);\n if (focusableElement) {\n focusableElement.focus();\n }\n });\n};\n\nexport const isSelectableElement = (el?: HTMLElement | null) => {\n const item = el?.closest(\"[data-index]\") as HTMLElement;\n if (\n !item ||\n item.ariaDisabled ||\n item.dataset.selectable === \"false\" ||\n item.querySelector('[data-selectable=\"false\"],[aria-disabled=\"true\"]')\n ) {\n return false;\n } else {\n return true;\n }\n};\n\nlet size: number;\n\nexport function getScrollbarSize() {\n if (size === undefined) {\n let outer: HTMLElement | null = document.createElement(\"div\");\n outer.className = \"scrollable-content\";\n outer.style.width = \"50px\";\n outer.style.height = \"50px\";\n outer.style.overflowY = \"scroll\";\n outer.style.position = \"absolute\";\n outer.style.top = \"-200px\";\n outer.style.left = \"-200px\";\n const inner = document.createElement(\"div\");\n inner.style.height = \"100px\";\n inner.style.width = \"100%\";\n outer.appendChild(inner);\n document.body.appendChild(outer);\n const outerWidth = outer.offsetWidth;\n const innerWidth = inner.offsetWidth;\n document.body.removeChild(outer);\n size = outerWidth - innerWidth;\n outer = null;\n }\n\n return size;\n}\n\nexport type MouseEventTypes = \"dblclick\" | \"click\";\n\nexport const dispatchMouseEvent = (el: HTMLElement, type: MouseEventTypes) => {\n const evt = new MouseEvent(type, {\n view: window,\n bubbles: true,\n cancelable: true,\n });\n el.dispatchEvent(evt);\n};\n\nexport type VuuDomEventType = \"vuu-commit\" | \"vuu-dropped\";\n\nexport const dispatchCustomEvent = (el: HTMLElement, type: VuuDomEventType) => {\n const evt = new Event(type, {\n bubbles: true,\n cancelable: true,\n });\n el.dispatchEvent(evt);\n};\n"],"names":[],"mappings":"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"}
|
package/esm/index.js
CHANGED
|
@@ -1,9 +1,46 @@
|
|
|
1
|
-
var Ut=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var x=(e,t,n)=>(Ut(e,t,"read from private field"),n?n.call(e):t.get(e)),Me=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)};function wo(e,t,n=[],r=[]){for(let o=0,i=e.length;o<i;o++)(t(e[o],o)?n:r).push(e[o]);return[n,r]}function Ro(e,t,n){return e.length!==t.length?!0:n===void 0?!e.every(r=>t.includes(r)):e.some(r=>t.findIndex(o=>o[n]===r[n])===-1)}function So(e,t,n){return e.length!==t.length?!0:n===void 0?e.some((r,o)=>t[o]!==r):e.some((r,o)=>t[o][n]!==r[n])}var vo=(e,t,n)=>{let r=e.indexOf(t);if(r===n)return e;let o=e.slice();if(r===-1)throw Error("moveItem, item to be moved not found");if(o.splice(r,1),n===-1)o.push(t);else{let i=(n>r,0);o.splice(n+i,0,t)}return o},we=(e,t,n)=>{if(t===n)return e;{let r=e.slice(),[o]=r.splice(t,1);if(n===-1)return r.concat(o);{let i=(n>t,0);return r.splice(n+i,0,o),r}}},Ao=(e,t)=>{let n=r=>!(e!=null&&e.includes(r));return e===void 0?t:t.some(n)?t.filter(n):[]},Io=(e,t,n)=>t.filter(r=>e.findIndex(o=>n(o)===r)===-1);function Fo(e,t,n){if(e)return t>=e.left&&t<e.right&&n>=e.top&&n<e.bottom}var Wt=e=>typeof e=="string"?`"${e}"`:e,Nt=e=>typeof e=="string"?`"${e}"`:e,Ht=e=>e.replace(/^\((.*)\)$/,"$1"),O=(e,t)=>Ht(k(e,t)),k=(e,t)=>L(e)?`(${e.filters.map(r=>k(r,t)).join(` ${e.op} `)})`:K(e)?`${e.column} ${e.op} [${e.values.map(Nt).join(",")}]`:Bt(e,t);function Bt(e,t){var r;let n=(r=t==null?void 0:t.columnsByName)==null?void 0:r[e.column];return n&&_(n)?Gt(e):Se(e)}var Re=1e3*60*60*24;function Gt(e){switch(e.op){case"=":{let t=[{op:">=",column:e.column,value:e.value},{op:"<",column:e.column,value:e.value+Re}];return k({op:"and",filters:t})}case"!=":{let t=[{op:"<",column:e.column,value:e.value},{op:">=",column:e.column,value:e.value+Re}];return k({op:"or",filters:t})}default:return Se(e)}}var Se=e=>`${e.column} ${e.op} ${Wt(e.value)}`;var ve=new Set(["=","!=",">",">=","<","<=","starts","ends"]),Uo=e=>e==="in"||ve.has(e),Wo=e=>e!==void 0&&e.name!==void 0,Ae=e=>e!==void 0&&ve.has(e.op),Ie=e=>e!==void 0&&(Ae(e)||K(e)),K=e=>e!==void 0&&e.op==="in",No=e=>e.op==="in",Ho=e=>e.op==="and",Bo=e=>e.op==="or",Go=e=>Ae(e)&&e.column!==void 0&&e.op!==void 0&&e.value!==void 0;function L(e){return e!==void 0&&(e.op==="and"||e.op==="or")}var Yo=(e,t)=>{if(L(t)){let[n,r]=t.filters;if(n.column===e.name)return[r,O(r)];if(r.column===e.name)return[n,O(n)]}return[void 0,""]};var Yt="asc",Le=[],Jt=100,jt=250,Qt=50,qo={Average:2,Count:3,Distinct:6,Sum:1,High:4,Low:5};function Ko(e,t,n=0){return e.map(r=>{if(typeof r=="string")return[t[r]+n,"asc"];if(Array.isArray(r)){let[o,i]=r;return[t[o]+n,i||Yt]}else throw Error("columnUtils.mapSortCriteria invalid input")})}var qt=["int","long","double"],Zo=e=>e===void 0?"left":qt.includes(e)?"right":"left",Kt=e=>e==="left"||e==="right",Xo=e=>Kt(e)||e==="floating"||e==="",Zt=["long","double","int","string","char","boolean"],zo=e=>Zt.includes(e),ei=e=>{switch(e){case"double":case"int":case"long":return"number";case"boolean":return"boolean";default:return"string"}},ti=({serverDataType:e,type:t})=>e==="int"||e==="long"||e==="double"?!0:typeof t=="string"?t==="number":typeof(t==null?void 0:t.name)=="string"?(t==null?void 0:t.name)==="number":!1,_=e=>(T(e.type)?e.type.name:e.type)==="date/time",ni=e=>typeof e.pin=="string",Xt=e=>Array.isArray(e.heading)&&e.heading.length>0,ri=e=>e.resizing,oi=({serverDataType:e})=>e===void 0?!1:e==="char"||e==="string",ii=e=>({name:e}),T=e=>typeof e<"u"&&typeof e!="string",zt={},z=e=>typeof(e==null?void 0:e.name)<"u",ai=e=>typeof(e==null?void 0:e.name)<"u"&&"lookup"in e,si=e=>typeof(e==null?void 0:e.name)<"u"&&Array.isArray(e.values),ui=e=>T(e)&&z(e.renderer)&&Array.isArray(e.renderer.rules)&&e.renderer.rules.length>0,Ve=e=>e!==void 0&&typeof(e==null?void 0:e.map)<"u";function li(e){let t=E.count;return e?e.reduce((n,r,o)=>(typeof r=="string"?n[r]=t+o:n[r.name]=t+o,n),{}):zt}function ci(e){let t=[],n=E.count-2;for(let r=0;r<e.length;r+=3)t[r]=e[r]+n,t[r+1]=e[r+1],t[r+2]=e[r+2];return t}var Z=6,E={IDX:0,RENDER_IDX:1,IS_LEAF:2,IS_EXPANDED:3,DEPTH:4,COUNT:5,KEY:Z,SELECTED:7,count:8,PARENT_IDX:"parent_idx",IDX_POINTER:"idx_pointer",FILTER_COUNT:"filter_count",NEXT_FILTER_IDX:"next_filter_idx"},en=(e,t)=>{let{originalIdx:n}=t;if(typeof n=="number")for(let r=0;r<e.length;r++){let{originalIdx:o=-1}=e[r];if(o>n)return e.splice(r,0,t),e}return e.push(t),e},X=e=>{var t;if((t=e[0])!=null&&t.isGroup){let[n,...r]=e;return n.columns.forEach(o=>{en(r,o)}),r}else return e};function tn(e,t,n=!0){if(t&&t.length>0){let r=X(e),[o,i]=r.reduce((l,f,g)=>{let[p,d]=l;return t.includes(f.name)?p.push({...f,originalIdx:g}):d.push(f),l},[[],[]]);if(o.length!==t.length)throw Error(`extractGroupColumn: no column definition found for all groupBy cols ${JSON.stringify(t)} `);let a=t.length,s=t.map((l,f)=>({...o.find(p=>p.name===l),groupLevel:a-f}));return[{name:"group-col",heading:["group-col"],isGroup:!0,columns:s,groupConfirmed:n,width:s.map(l=>l.width).reduce((l,f)=>l+f)+100},i]}return[null,X(e)]}var nn=e=>e.isGroup===!0,rn=e=>typeof e=="string"&&e.endsWith("+"),fi=(e,t,n)=>{var r;return((r=e.type)==null?void 0:r.name)==="json"&&rn(t[n[e.name]])},mi=e=>{var t;return((t=e.type)==null?void 0:t.name)==="json"},di=e=>{let t=[],n=[],r=[],o=4;for(let a of e)switch(a.pin){case"left":t.push({...a,endPin:void 0,pinnedOffset:o}),o+=a.width;break;case"right":n.unshift(a);break;default:r.push(a)}t.length&&t.push({...t.pop(),endPin:!0});let i=t.length?t.concat(r):r;if(n.length){let a=[],s=0;for(let u of n)a.unshift({...u,pinnedOffset:s}),s+=u.width;return a[0].endPin=!0,i.concat(a)}else return i},pi=(e,t)=>{let n=0,r=0,o=0;for(let i of e){let{hidden:a,pin:s,width:u}=i,l=a?0:u;s==="left"?n+=l:s==="right"?r+=l:o+=l}return{pinnedWidthLeft:n+t,pinnedWidthRight:r+t,unpinnedWidth:o}},hi=e=>{if(e.some(Xt)){let t=e.reduce((i,{heading:a})=>{var s;return Math.max(i,(s=a==null?void 0:a.length)!=null?s:0)},0),n,r=[],o;for(let i=0;i<t;i++)o=[],e.forEach(({heading:a=Le,width:s})=>{var l;let u=(l=a[i])!=null?l:"";n&&n.label===u?n.width+=s:(n={label:u,width:s},o.push(n))}),r.push(o);return r}return Le},gi=({pin:e,pinnedOffset:t=e==="left"?0:4,width:n})=>e==="left"?{left:t,width:n,"--pin-width":`${t+n-3}px`}:e==="right"?{right:t,width:n,"--pin-width":`${t+n}px`}:{width:n},yi=(e,t,n)=>e.filter(r=>r.column!==t.name).concat({column:t.name,aggType:n}),ke=(e,t)=>{if(L(e))return on(e,t);if(Ie(e))return e.column===t?e:void 0},on=(e,t)=>{let{filters:n,op:r}=e,o=[];if(n.forEach(i=>{let a=ke(i,t);a&&o.push(a)}),o.length!==0)return o.length===1?o[0]:{op:r,filters:o}},Ci=(e,t,n=!0)=>{var r;if(t.length){let[o,i]=tn(e,t,n);if(o)return[o].concat(i)}else if((r=e[0])!=null&&r.isGroup)return X(e);return e},Di=(e,t)=>e.map(n=>{let r=an(n,t);return r!==void 0?{...n,sorted:r}:n.sorted?{...n,sorted:void 0}:n}),$i=e=>e.map(t=>t.sorted?{...t,sorted:void 0}:t),xi=e=>e.some(t=>t.sorted),bi=(e,{filterStruct:t})=>e.map(n=>{let r=ke(t,n.name);return r!==void 0?{...n,filter:r}:n.filter?{...n,filter:void 0}:n}),Ti=e=>e.filter!==void 0,Ei=e=>e.map(t=>{let{filter:n,...r}=t;return n?r:t}),an=(e,{sortDefs:t})=>{let n=t.find(r=>r.column===e.name);if(n)return t.length>1?(t.indexOf(n)+1)*(n.sortType==="A"?1:-1):n.sortType},Mi=e=>{let t=e.indexOf(":");return t===-1?e:e.slice(0,t)},wi=e=>e.label?e.label:_e(e.name)?fn(e):e.name,sn=(e,t)=>{let n=e.find(r=>r.name===t);if(n)return n;{let r=e.find(o=>o.isGroup);if(r)return sn(r.columns,t)}};function Ri(e,t,n){let r=typeof t=="string"?e.find(o=>o.name===t):t;if(r){let o=n?{...r,...n}:r;return e.map(i=>i.name===o.name?o:i)}else throw Error("column-utils.replaceColun, column not found")}var Si=e=>e.name,vi=(e,t)=>Object.entries(t).reduce((n,[r,o])=>(n[r]=e[o],n),{}),Ai=e=>nn(e[0])&&e[0].groupConfirmed===!1,Ii=(e,t,n)=>{var a;let r=[],o=0,i=!1;for(let s=0,u=0;u<e.length;u++){let l=e[u];l.hidden||(i?l.pin==="right"&&r.push(l):s+l.width<t?l.pin==="left"||s+l.width+((a=e[u+1])==null?void 0:a.width)>t?r.push(l):o+=l.width:s>n?i=!0:r.push(l),s+=l.width)}return[r,o]},Fe=e=>e.hidden!==!0,Li=(e,t)=>e.every(Fe)?e[t]:e.filter(Fe).at(t),{DEPTH:un,IS_LEAF:ln}=E,Fi=(e,t,n)=>{let{[un]:r,[ln]:o}=t;if(o||r>e.length)return[null,r===null?0:Math.max(0,r-1)];if(r===0)return["$root",0];{let{name:i,valueFormatter:a}=e[r-1];return[a(t[n[i]]),r-1]}},Oe=e=>{switch(e){case"int":case"long":case"double":return"number";case"boolean":return"boolean";default:return"string"}},Pi=(e,t)=>{let{serverDataType:n,type:r=Oe(n)}=e;return T(r)?{...e,type:{...r,formatting:t}}:{...e,type:{name:r,formatting:t}}};function Vi(e,t){return T(e.type)?{...e,type:{...e.type,name:t}}:{...e,type:t}}var ki=(e,t)=>{let{serverDataType:n,type:r=Oe(n)}=e;return T(r)?{...e,type:{...r,renderer:t}}:{...e,type:{name:r,renderer:t}}},Pe={},Oi=e=>{var t;return T(e.type)&&(t=e.type.formatting)!=null?t:Pe},_i=e=>t=>e==null?void 0:e.includes(t.name),Ui=(e,t,n)=>{let r=(s=n)=>u=>u.name===s;if(e.findIndex(r())!==-1)throw Error(`column-utils, addColumnToSubscribedColumns column ${n} is already subscribed`);let o=t.findIndex(r());if(o===-1)throw Error(`column-utils, addColumnToSubscribedColumns column ${n} is not available`);let i={...t[o]},a=-1;for(let s=o-1;s>=0;s--){let{name:u}=t[s];if(a=e.findIndex(r(u)),a!==-1)break}if(a===-1)return[i].concat(e);{let s=[];for(let u=0;u<e.length;u++)s.push(e[u]),u===a&&(s.push(i),a=Number.MAX_SAFE_INTEGER);return s}},cn=/.*:.*:.*/,_e=e=>e!==void 0&&cn.test(e),ee=e=>{if(_e(e.name))return e.name.split(/:=?/);throw Error(`column-utils, getCalculatedColumnDetails column name ${e.name} is not valid calculated column`)},fn=e=>ee(e)[0],Wi=e=>ee(e)[1],Ni=e=>ee(e)[2],Hi=(e,t)=>{let[,n,r]=e.name.split(":");return{...e,name:`${t}:${n}:${r}`}},Bi=(e,t)=>{let[n,,r]=e.name.split(":");return{...e,name:`${n}:${t}:${r}`}},Gi=(e,t)=>{let[n,r]=e.name.split(":");return{...e,name:`${n}:${r}:=${t}`}},Yi=(e,t,n)=>{let r=e.findIndex(o=>o.name===t.name);return we(e,r,n)};function Ji(e,t){return e.map(n=>n.name===t.name?t:n)}var ji=({columns:e,table:t},n)=>typeof n=="function"?e.map(r=>{let o=n(t.table,r.name);return o?{...r,...o}:r}):e,Qi=(e,t)=>{if(t!==void 0){let n=e.columns.find(r=>r.name===t);if(n)return n;throw Error(`getColumnByName no column '${t}' in schema for ${e.table.table}`)}};function qi(e,t){let{availableWidth:n=0,columnLayout:r="Static",defaultWidth:o=Jt,defaultMinWidth:i=Qt,defaultMaxWidth:a=jt}=t;if(r==="Static")return e.map(s=>typeof s.width=="number"?s:{...s,width:o});if(r==="Fit"){let{totalMinWidth:s,totalMaxWidth:u,totalWidth:l,flexCount:f}=e.reduce((g,p)=>{let{totalMinWidth:d,totalMaxWidth:y,totalWidth:D,flexCount:$}=g,{minWidth:c=i,maxWidth:h=a,width:M=o,flex:w=0}=p;return{totalMinWidth:d+c,totalMaxWidth:y+h,totalWidth:D+M,flexCount:$+w}},{totalMinWidth:0,totalMaxWidth:0,totalWidth:0,flexCount:0});if(s>n||u<n)return e;if(l>n){let g=l-n,p=f>0,d=g/(f||e.length),y=e.length,D=0,$=e.map(c=>{let{minWidth:h=i,width:M=o,flex:w=0}=c;if(p&&w===0)return c;let v=M-d;return v<h?(y-=1,D+=h-v,{...c,width:h}):{...c,width:v}});return D===0||(d=D/y,$=$.map(c=>{let h=c.width-d;return c.width!==c.minWidth?{...c,width:h}:c})),$}else if(l<n){let g=n-l,p=f>0,d=g/(f||e.length),y=e.map(c=>{let{maxWidth:h=a,width:M=o,flex:w=0}=c;if(p&&w===0)return c;let v=M+d;return v>h?{...c,width:h}:{...c,width:v,canStretch:!0}}),D=g-y.reduce((c,h)=>c+h.width,0),$=y.filter(c=>c.canStretch).length;return D>$&&(d=D/$,y=y.map(c=>{if(c.canStretch){let h=Math.min(c.width+d);return{...c,width:h}}else return c})),y.map(({canStretch:c,...h})=>h)}}return e}var Ki=(e,t)=>e.column===t.column&&e.column.valueFormatter(e.row[e.columnMap[e.column.name]])===t.column.valueFormatter(t.row[t.columnMap[t.column.name]]),Zi=(e,t)=>e.column===t.column&&e.row[Z]===t.row[Z]&&e.column.valueFormatter(e.row[e.columnMap[e.column.name]])===t.column.valueFormatter(t.row[t.columnMap[t.column.name]]);var Ue=e=>{var t,n;if(((t=globalThis.document)==null?void 0:t.cookie)!==void 0)return(n=globalThis.document.cookie.split("; ").find(r=>r.startsWith(`${e}=`)))==null?void 0:n.split("=")[1]};var F=new Map,U=new Map,We=new Map,Ne=new Map,He=new Map,te=new Map,Be=new Map,mn=(e,t)=>e===void 0||e==="private"?!0:Array.isArray(e)?e.includes(t):e===t,dn=(e,t)=>t!==void 0&&e==="cell-renderer",pn=(e,t)=>e==="column-header-content-renderer",hn=(e,t)=>e==="column-header-label-renderer",gn=(e,t)=>e==="cell-config-panel",yn=(e,t)=>e==="data-edit-validator",Cn=(e,t)=>e==="row-class-generator";function na(e,t,n="cell-renderer",r){dn(n,t)?F.set(e,t):pn(n,t)||hn(n,t)?U.set(e,t):gn(n,t)?Ne.set(e,t):yn(n,t)?He.set(e,t):Cn(n,t)&&(console.log(`register ${e}`),Be.set(e,t)),r&&te.set(e,r)}var ra=(e,t)=>{We.set(e,t)},oa=e=>{let n=Array.from(F.keys()).map(r=>({name:r,...te.get(r)})).filter(({userCanAssign:r})=>r!==!1);return e?n.filter(r=>mn(r.serverDataType,e)):n},ia=e=>te.get(e);function aa(e){return Dn(e)}function sa(e){if(e.colHeaderContentRenderer)return U.get(e.colHeaderContentRenderer)}function ua(e){if(e.colHeaderLabelRenderer)return U.get(e.colHeaderLabelRenderer)}var la=e=>Be.get(e);function Dn(e){if(T(e.type)){let{renderer:t}=e.type;if(z(t))return F.get(t.name)}else{if(e.serverDataType==="boolean")return F.get("checkbox-cell");if(e.editable)return F.get("input-cell")}}function ca(e=""){return We.get(e)}function fa(e){return Ne.get(e)}function ma(e){return He.get(e)}var pa={from:0,to:0},ha=(e,t)=>(e==null?void 0:e.from)===(t==null?void 0:t.from)&&(e==null?void 0:e.to)===(t==null?void 0:t.to);function ga({from:e,to:t},n=0,r=Number.MAX_SAFE_INTEGER){if(e===0&&t===0)return{from:e,to:t};if(n===0)return r<e?{from:0,to:0}:{from:e,to:Math.min(t,r)};if(e===0)return{from:e,to:Math.min(t+n,r)};{let o=e-n<0,i=r-(t+n)<0;return o&&i?{from:0,to:r}:o?{from:0,to:t+n}:i?{from:Math.max(0,e-n),to:r}:{from:e-n,to:t+n}}}function ya({from:e,to:t,bufferSize:n=0}){return{from:0,to:t-e,bufferSize:n,reset:!0}}var $n=(e,{from:t,to:n})=>e>=t&&e<n,Ca=({from:e,to:t},n)=>{let{from:r,to:o}=n,i=r>=t||o<=e,a=r<e&&o>t;return i||a?n:o>t?{from:t,to:o}:{from:r,to:e}},W=class e{constructor(t,n){this.from=t,this.to=n}isWithin(t){return $n(t,this)}overlap(t,n){return t>=this.to||n<this.from?[0,0]:[Math.max(t,this.from),Math.min(n,this.to)]}copy(){return new e(this.from,this.to)}};var{KEY:xn}=E,Ge=class{constructor({from:t,to:n}){this.rowCount=0;this.setRowCount=t=>{t<this.data.length&&(this.data.length=t),this.rowCount=t};this.range=new W(t,n),this.data=new Array(n-t)}add(t){let[n]=t;if(this.isWithinRange(n)){let r=n-this.range.from,o=this.data[r]!==void 0;return this.data[r]=t,o}else return!1}getAtIndex(t){return this.range.isWithin(t)&&this.data[t-this.range.from]!=null?this.data[t-this.range.from]:void 0}getByKey(t){return this.data.find(n=>n[xn]===t)}isWithinRange(t){return this.range.isWithin(t)&&t<=this.rowCount}setRange(t,n){if(t!==this.range.from||n!==this.range.to){let[r,o]=this.range.overlap(t,n),i=new Array(n-t);for(let a=r;a<o;a++){let s=this.getAtIndex(a);if(s){let u=a-t;i[u]=s}}this.data=i,this.range.from=t,this.range.to=n}}hasData(t,n){let r=this.range.from,o=t-r,i=Math.min(n-r-1,this.rowCount-1);return this.data[o]!==void 0&&this.data[i]!==void 0}getData(t,n){var a;let{from:r}=this.range,o=Math.max(0,t-r),i=Math.min(n-r,(a=this.rowCount)!=null?a:n);return this.data.slice(o,i)}};var Ta={horizontal:{positionProp:"left",sizeProp:"width"},vertical:{positionProp:"top",sizeProp:"height"}};var ne="up1",re="up2",oe="down1",ie="down2",Ma=e=>typeof e=="number"&&isFinite(e),Ye={},wa=(e=Ye,t=Ye)=>{let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(o=>e[o]===t[o])};function Ra(e,t,n,r){if(e===void 0||!isFinite(e)||n===void 0||t===void 0)return"";{let o=e-n;return o&&typeof r=="number"&&(o=+e.toFixed(r)-+n.toFixed(r)),o?t===""?o<0?oe:ne:o>0?t===oe||t===ie||t===re?ne:re:t===ne||t===re||t===ie?oe:ie:""}}var bn=e=>e.type==="vuu-links",va=e=>e.type==="vuu-link-created",Aa=e=>e.type==="vuu-link-removed",Tn=e=>e.type==="vuu-menu",Ia=e=>Tn(e)||bn(e);var En={filter:""},Mn={sortDefs:[]},Fa={aggregations:[],columns:[],filter:En,groupBy:[],sort:Mn},wn=({aggregations:e},{aggregations:t})=>e===void 0&&(t==null?void 0:t.length)===0||t===void 0&&(e==null?void 0:e.length)===0,Rn=({columns:e},{columns:t})=>e===void 0&&(t==null?void 0:t.length)===0||t===void 0&&(e==null?void 0:e.length)===0,Sn=({filter:e},{filter:t})=>e===void 0&&(t==null?void 0:t.filter)===""||t===void 0&&(e==null?void 0:e.filter)==="",vn=({groupBy:e},{groupBy:t})=>e===void 0&&(t==null?void 0:t.length)===0||t===void 0&&(e==null?void 0:e.length)===0,An=({sort:e},{sort:t})=>e===void 0&&(t==null?void 0:t.sortDefs.length)===0||t===void 0&&(e==null?void 0:e.sortDefs.length)===0,P=(e,t)=>e===t?!0:e===void 0&&t===void 0,In=(e,t)=>{let{aggregations:n}=e,{aggregations:r}=t;return P(n,r)||wn(e,t)?!1:n===void 0||r===void 0||n.length!==r.length?!0:n.some(({column:o,aggType:i},a)=>o!==r[a].column||i!==r[a].aggType)},Ln=(e,t)=>{let{columns:n}=e,{columns:r}=t;return P(n,r)||Rn(e,t)?!1:n===void 0||r===void 0||(n==null?void 0:n.length)!==(r==null?void 0:r.length)?!0:n.some((o,i)=>o!==(r==null?void 0:r[i]))},Fn=(e,t)=>{var n,r;return Sn(e,t)?!1:((n=e.filter)==null?void 0:n.filter)!==((r=t.filter)==null?void 0:r.filter)},Pn=(e,t)=>{let{groupBy:n}=e,{groupBy:r}=t;return P(n,r)||vn(e,t)?!1:n===void 0||r===void 0||(n==null?void 0:n.length)!==(r==null?void 0:r.length)?!0:n.some((o,i)=>o!==(r==null?void 0:r[i]))},Vn=(e,t)=>{let{sort:n}=e,{sort:r}=t;return P(n,r)||An(e,t)?!1:n===void 0||r===void 0||(n==null?void 0:n.sortDefs.length)!==(r==null?void 0:r.sortDefs.length)?!0:n.sortDefs.some(({column:o,sortType:i},a)=>o!==r.sortDefs[a].column||i!==r.sortDefs[a].sortType)},kn=()=>!1,Je={aggregationsChanged:!1,columnsChanged:!1,filterChanged:!1,groupByChanged:!1,noChanges:!0,sortChanged:!1,visualLinkChanged:!1},je=(e,t)=>{if(P(e,t)||e===void 0&&t==null)return Je;if(e===void 0)return je({},t);if(t===void 0)return je(e,{});let n=In(e,t),r=Ln(e,t),o=Fn(e,t),i=Pn(e,t),a=Vn(e,t),s=kn(e,t);return{aggregationsChanged:n,columnsChanged:r,filterChanged:o,groupByChanged:i,noChanges:!(n||r||o||i||a||s),sortChanged:a,visualLinkChanged:s}},Pa=e=>e!==void 0&&e.groupBy!==void 0&&e.groupBy.length>0,Va=e=>(e==null?void 0:e.filter)!==void 0&&e.filter.filter.length>0,ka=e=>{var t;return(e==null?void 0:e.sort)!==void 0&&Array.isArray((t=e.sort)==null?void 0:t.sortDefs)&&e.sort.sortDefs.length>0},Oa=e=>typeof e.getTypeaheadSuggestions=="function",_a=e=>e.type==="TABLE_META_RESP",Ua=e=>e.type==="connection-status",Wa=e=>e.type==="connection-metrics",Na=e=>typeof e.result<"u",Ha=e=>e!==void 0&&"error"in e,Ba=e=>e!=null&&"action"in e,Ga=e=>"viewport"in e,Ya=e=>{if(e.aggregations&&e.columns&&e.filter&&e.groupBy&&e.sort)return e;{let{aggregations:t=[],columns:n=[],filter:r={filter:""},groupBy:o=[],sort:i={sortDefs:[]},visualLink:a}=e;return{aggregations:t,columns:n,filter:r,groupBy:o,sort:i,visualLink:a}}};function Qe(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ae(e,t,n){Qe(e,t),t.set(e,n)}function se(e,t){return e-t*Math.floor(e/t)}var et=1721426;function N(e,t,n,r){t=he(e,t);let o=t-1,i=-2;return n<=2?i=0:B(t)&&(i=-1),et-1+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)}function B(e){return e%4===0&&(e%100!==0||e%400===0)}function he(e,t){return e==="BC"?1-t:t}function On(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}var _n={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},A=class{fromJulianDay(t){let n=t,r=n-et,o=Math.floor(r/146097),i=se(r,146097),a=Math.floor(i/36524),s=se(i,36524),u=Math.floor(s/1461),l=se(s,1461),f=Math.floor(l/365),g=o*400+a*100+u*4+f+(a!==4&&f!==4?1:0),[p,d]=On(g),y=n-N(p,d,1,1),D=2;n<N(p,d,3,1)?D=0:B(d)&&(D=1);let $=Math.floor(((y+D)*12+373)/367),c=n-N(p,d,$,1)+1;return new V(p,d,$,c)}toJulianDay(t){return N(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return _n[B(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return B(t.year)?366:365}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}};function tt(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function Un(e,t){return qe(e)-qe(t)}function qe(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}var ue=null;function nt(){return ue==null&&(ue=new Intl.DateTimeFormat().resolvedOptions().timeZone),ue}function Ke(e){e=ge(e,new A);let t=he(e.era,e.year);return rt(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function rt(e,t,n,r,o,i,a){let s=new Date;return s.setUTCHours(r,o,i,a),s.setUTCFullYear(e,t-1,n),s.getTime()}function Ze(e,t){if(t==="UTC")return 0;if(e>0&&t===nt())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:r,day:o,hour:i,minute:a,second:s}=ot(e,t);return rt(n,r,o,i,a,s,0)-Math.floor(e/1e3)*1e3}var Xe=new Map;function ot(e,t){let n=Xe.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Xe.set(t,n));let r=n.formatToParts(new Date(e)),o={};for(let i of r)i.type!=="literal"&&(o[i.type]=i.value);return{year:o.era==="BC"||o.era==="B"?-o.year+1:+o.year,month:+o.month,day:+o.day,hour:o.hour==="24"?0:+o.hour,minute:+o.minute,second:+o.second}}var ze=864e5;function Wn(e,t,n,r){return(n===r?[n]:[n,r]).filter(i=>Nn(e,t,i))}function Nn(e,t,n){let r=ot(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}function Hn(e,t,n="compatible"){let r=at(e);if(t==="UTC")return Ke(r);if(t===nt()&&n==="compatible"){r=ge(r,new A);let u=new Date,l=he(r.era,r.year);return u.setFullYear(l,r.month-1,r.day),u.setHours(r.hour,r.minute,r.second,r.millisecond),u.getTime()}let o=Ke(r),i=Ze(o-ze,t),a=Ze(o+ze,t),s=Wn(r,t,o-i,o-a);if(s.length===1)return s[0];if(s.length>1)switch(n){case"compatible":case"earlier":return s[0];case"later":return s[s.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(o-i,o-a);case"compatible":case"later":return Math.max(o-i,o-a);case"reject":throw new RangeError("No such absolute time found")}}function it(e,t,n="compatible"){return new Date(Hn(e,t,n))}function at(e,t){let n=0,r=0,o=0,i=0;if("timeZone"in e)({hour:n,minute:r,second:o,millisecond:i}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:r,second:o,millisecond:i}=t),new pe(e.calendar,e.era,e.year,e.month,e.day,n,r,o,i)}function ge(e,t){if(e.calendar.identifier===t.identifier)return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,I(r),r}function ye(e,t){let n=e.copy(),r="hour"in n?Qn(n,t):0;me(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,de(n),st(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=r,Bn(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let o=n.calendar.getYearsInEra(n);if(n.year>o){var i,a;let u=(a=(i=n.calendar).isInverseEra)===null||a===void 0?void 0:a.call(i,n);n.year=o,n.month=u?1:n.calendar.getMonthsInYear(n),n.day=u?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let s=n.calendar.getMonthsInYear(n);return n.month>s&&(n.month=s,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function me(e,t){var n,r;!((r=(n=e.calendar).isInverseEra)===null||r===void 0)&&r.call(n,e)&&(t=-t),e.year+=t}function de(e){for(;e.month<1;)me(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,me(e,1)}function Bn(e){for(;e.day<1;)e.month--,de(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,de(e)}function st(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function I(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),st(e)}function Gn(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function ut(e,t){return ye(e,Gn(t))}function lt(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),I(n),n}function Yn(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),jn(n),n}function Jn(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=H(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=H(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=H(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=H(e.hour,24),t}function jn(e){e.millisecond=Math.max(0,Math.min(e.millisecond,1e3)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function H(e,t){let n=e%t;return n<0&&(n+=t),n}function Qn(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,Jn(e)}function ct(e,t,n,r){let o=e.copy();switch(t){case"era":{let s=e.calendar.getEras(),u=s.indexOf(e.era);if(u<0)throw new Error("Invalid era: "+e.era);u=R(u,n,0,s.length-1,r==null?void 0:r.round),o.era=s[u],I(o);break}case"year":var i,a;!((a=(i=o.calendar).isInverseEra)===null||a===void 0)&&a.call(i,o)&&(n=-n),o.year=R(e.year,n,-1/0,9999,r==null?void 0:r.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=R(e.month,n,1,e.calendar.getMonthsInYear(e),r==null?void 0:r.round);break;case"day":o.day=R(e.day,n,1,e.calendar.getDaysInMonth(e),r==null?void 0:r.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),I(o),o}function qn(e,t,n,r){let o=e.copy();switch(t){case"hour":{let i=e.hour,a=0,s=23;if((r==null?void 0:r.hourCycle)===12){let u=i>=12;a=u?12:0,s=u?23:11}o.hour=R(i,n,a,s,r==null?void 0:r.round);break}case"minute":o.minute=R(e.minute,n,0,59,r==null?void 0:r.round);break;case"second":o.second=R(e.second,n,0,59,r==null?void 0:r.round);break;case"millisecond":o.millisecond=R(e.millisecond,n,0,999,r==null?void 0:r.round);break;default:throw new Error("Unsupported field "+t)}return o}function R(e,t,n,r,o=!1){if(o){e+=Math.sign(t),e<n&&(e=r);let i=Math.abs(t);t>0?e=Math.ceil(e/i)*i:e=Math.floor(e/i)*i,e>r&&(e=n)}else e+=t,e<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e}var Kn=["hours","minutes","seconds"],Za=["years","months","weeks","days",...Kn];function Zn(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function ft(e){let t=ge(e,new A);return`${String(t.year).padStart(4,"0")}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Xn(e){return`${ft(e)}T${Zn(e)}`}function mt(e){let t=typeof e[0]=="object"?e.shift():new A,n;if(typeof e[0]=="string")n=e.shift();else{let a=t.getEras();n=a[a.length-1]}let r=e.shift(),o=e.shift(),i=e.shift();return[t,n,r,o,i]}var zn=new WeakMap,V=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day):new e(this.calendar,this.year,this.month,this.day)}add(t){return ye(this,t)}subtract(t){return ut(this,t)}set(t){return lt(this,t)}cycle(t,n,r){return ct(this,t,n,r)}toDate(t){return it(this,t)}toString(){return ft(this)}compare(t){return tt(this,t)}constructor(...t){ae(this,zn,{writable:!0,value:void 0});let[n,r,o,i,a]=mt(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=a,I(this)}};var er=new WeakMap,pe=class e{copy(){return this.era?new e(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new e(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return ye(this,t)}subtract(t){return ut(this,t)}set(t){return lt(Yn(this,t),t)}cycle(t,n,r){switch(t){case"era":case"year":case"month":case"day":return ct(this,t,n,r);default:return qn(this,t,n,r)}}toDate(t,n){return it(this,t,n)}toString(){return Xn(this)}compare(t){let n=tt(this,t);return n===0?Un(this,at(t)):n}constructor(...t){ae(this,er,{writable:!0,value:void 0});let[n,r,o,i,a]=mt(t);this.calendar=n,this.era=r,this.year=o,this.month=i,this.day=a,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,I(this)}};var dt=1080,tr=24*dt,nr=29,rr=12*dt+793,Xa=nr*tr+rr;var le=new Map,G=class{format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} \u2013 ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let r=this.formatter.formatToParts(t),o=this.formatter.formatToParts(n);return[...r.map(i=>({...i,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...o.map(i=>({...i,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return ar()&&(this.resolvedHourCycle||(this.resolvedHourCycle=sr(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}constructor(t,n={}){this.formatter=pt(t,n),this.options=n}},or={true:{ja:"h11"},false:{}};function pt(e,t={}){if(typeof t.hour12=="boolean"&&ir()){t={...t};let o=or[String(t.hour12)][e.split("-")[0]],i=t.hour12?"h12":"h23";t.hourCycle=o!=null?o:i,delete t.hour12}let n=e+(t?Object.entries(t).sort((o,i)=>o[0]<i[0]?-1:1).join():"");if(le.has(n))return le.get(n);let r=new Intl.DateTimeFormat(e,t);return le.set(n,r),r}var ce=null;function ir(){return ce==null&&(ce=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),ce}var fe=null;function ar(){return fe==null&&(fe=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),fe}function sr(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=pt(e,{...t,timeZone:void 0}),r=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(i=>i.type==="hour").value,10),o=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(i=>i.type==="hour").value,10);if(r===0&&o===23)return"h23";if(r===24&&o===23)return"h24";if(r===0&&o===11)return"h11";if(r===12&&o===11)return"h12";throw new Error("Unexpected hour cycle result")}function ht(e){return e!=null}var gt={hour:"2-digit",minute:"2-digit",second:"2-digit"},ur={"hh:mm:ss":{locale:"en-GB",options:{...gt,hour12:!1}},"hh:mm:ss a":{locale:"en-GB",options:{...gt,hour12:!0}}},S={day:"2-digit",month:"2-digit",year:"numeric"},lr={"dd.mm.yyyy":{locale:"de-De",options:{...S}},"dd/mm/yyyy":{locale:"en-GB",options:{...S}},"dd MMM yyyy":{locale:"en-GB",options:{...S,month:"short"}},"dd MMMM yyyy":{locale:"en-GB",options:{...S,month:"long"}},"mm/dd/yyyy":{locale:"en-US",options:{...S}},"MMM dd, yyyy":{locale:"en-US",options:{...S,month:"short"}},"MMMM dd, yyyy":{locale:"en-US",options:{...S,month:"long"}}};function cr(e){return[e.date?lr[e.date]:null,e.time?ur[e.time]:null]}function yt(e){let t=cr(e).filter(ht).map(n=>fr(n.locale,n.options));return n=>t.map(r=>r.format(n)).join(" ")}function fr(e,t){return new G(e,t)}var Ct=["dd.mm.yyyy","dd/mm/yyyy","dd MMM yyyy","dd MMMM yyyy","mm/dd/yyyy","MMM dd, yyyy","MMMM dd, yyyy"],Dt=["hh:mm:ss","hh:mm:ss a"],mr={date:Ct,time:Dt},dr=e=>Ct.includes(e),pr=e=>Dt.includes(e),Ce=e=>dr(e==null?void 0:e.date)||pr(e==null?void 0:e.time);function hr(e){return new V(e.getFullYear(),e.getMonth()+1,e.getDate())}var $t={time:"hh:mm:ss",date:"dd.mm.yyyy"},xt={date:$t.date};function De(e){return T(e)&&e.formatting&&Ce(e.formatting.pattern)?e.formatting.pattern:xt}var gr=["error","warn","info","debug"],yr=e=>typeof e=="string"&&gr.includes(e),Cr="error",Y=()=>{},Dr="error",{loggingLevel:J=Dr}=$r(),bt=e=>{let t=J==="debug",n=t||J==="info",r=n||J==="warn",o=r||J==="error",i=n?l=>console.info(`[${e}] ${l}`):Y,a=r?l=>console.warn(`[${e}] ${l}`):Y,s=t?l=>console.debug(`[${e}] ${l}`):Y;return{errorEnabled:o,error:o?l=>console.error(`[${e}] ${l}`):Y}};function $r(){return typeof loggingSettings<"u"?loggingSettings:{loggingLevel:Tt()}}function Tt(){let e=Ue("vuu-logging-level");return yr(e)?e:Cr}var ys=()=>`const loggingSettings = { loggingLevel: "${Tt()}"};`;var{debug:xr,debugEnabled:br}=bt("range-monitor"),Et=class{constructor(t){this.source=t;this.range={from:0,to:0};this.timestamp=0}isSet(){return this.timestamp!==0}set({from:t,to:n}){let{timestamp:r}=this;if(this.range.from=t,this.range.to=n,this.timestamp=performance.now(),r)br&&xr(`<${this.source}> [${t}-${n}], ${(this.timestamp-r).toFixed(0)} ms elapsed`);else return 0}};var Es=(e,t,n)=>{let r=document.createElement(e);return t&&(r.className=t),n&&(r.textContent=n),r},Tr=(e,t)=>{if(e){if(e.hasAttribute("tabindex")){let r=parseInt(e.getAttribute("tabindex"));if(!isNaN(r)&&(t===void 0||r===t))return e}let n=typeof t=="number"?e.querySelector(`[tabindex="${t}"]`):e.querySelector("[tabindex]");if(n)return n}},Ms=e=>{if(e){let t=parseInt(e.dataset.index||"");if(!isNaN(t))return t}return-1},Er=(e,t)=>e===null?null:e.closest(t),Mr=(e,t)=>Er(e,`[data-${t}]`),ws=e=>Mr(e,"index");function Rs(e,t,n=!1){if(e===null&&n)throw Error("html-utils getElementByDataIndex, container is null");let r=e==null?void 0:e.querySelector(`[data-index="${t}"]`);if(r)return r;if(n)throw Error("html-utils getElementByDataIndex, Item not found with data-index='${index}'")}var Ss=(e,t)=>{requestAnimationFrame(()=>{let n=Tr(e,t);n&&n.focus()})},vs=e=>{let t=e==null?void 0:e.closest("[data-index]");return!(!t||t.ariaDisabled||t.dataset.selectable==="false"||t.querySelector('[data-selectable="false"],[aria-disabled="true"]'))},$e;function As(){if($e===void 0){let e=document.createElement("div");e.className="scrollable-content",e.style.width="50px",e.style.height="50px",e.style.overflowY="scroll",e.style.position="absolute",e.style.top="-200px",e.style.left="-200px";let t=document.createElement("div");t.style.height="100px",t.style.width="100%",e.appendChild(t),document.body.appendChild(e);let n=e.offsetWidth,r=t.offsetWidth;document.body.removeChild(e),$e=n-r,e=null}return $e}var Is=(e,t)=>{let n=new MouseEvent(t,{view:window,bubbles:!0,cancelable:!0});e.dispatchEvent(n)},Ls=(e,t)=>{let n=new Event(t,{bubbles:!0,cancelable:!0});e.dispatchEvent(n)};function Mt(e){return Array.isArray(e)}function wr(e){return!Array.isArray(e)}var C,wt=class{constructor(){Me(this,C,new Map)}addListener(t,n){let r=x(this,C).get(t);r?Mt(r)?r.push(n):wr(r)&&x(this,C).set(t,[r,n]):x(this,C).set(t,n)}removeListener(t,n){if(!x(this,C).has(t))return;let r=x(this,C).get(t),o=-1;if(r===n)x(this,C).delete(t);else if(Array.isArray(r)){for(let i=length;i-- >0;)if(r[i]===n){o=i;break}if(o<0)return;r.length===1?(r.length=0,x(this,C).delete(t)):r.splice(o,1)}}removeAllListeners(t){t&&x(this,C).has(t)?x(this,C).delete(t):t===void 0&&x(this,C).clear()}emit(t,...n){if(x(this,C)){let r=x(this,C).get(t);r&&this.invokeHandler(r,n)}}once(t,n){let r=(...o)=>{this.removeListener(t,r),n(...o)};this.on(t,r)}on(t,n){this.addListener(t,n)}hasListener(t,n){let r=x(this,C).get(t);return Array.isArray(r)?r.includes(n):r===n}invokeHandler(t,n){if(Mt(t))t.slice().forEach(r=>this.invokeHandler(r,n));else switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;default:t.call(null,...n)}}};C=new WeakMap;var j="\u2008",m="\u2007";var Rt={DIGIT:m,TWO_DIGITS:m+m,THREE_DIGITS:m+m+m,FULL_PADDING:[null,j+m,j+m+m,j+m+m+m,j+m+m+m+m]},Rr={DIGIT:"0",TWO_DIGITS:"00",THREE_DIGITS:"000",FULL_PADDING:[null,"0","00","000","0000"]};function Sr(e,t=6){return(vr+e).slice(-t)}var vr=m+m+m+m+m+m+m+m+m,xe={Right:"right",Center:"center",Left:"left"};function St(e,t,n){let r=e.length,o=t-r;if(o>0)o===1?e=e+n.DIGIT:o===2?e=e+n.TWO_DIGITS:o===3&&(e=e+n.THREE_DIGITS);else if(o<0&&(e=e.slice(0,t),r=t),n===Rt&&e.charAt(r-1)==="0")return e=e.replace(/0+$/,""),St(e,t,n);return e}function vt(e,t=xe.Right,n=4,r,o){if(e===void 0||typeof e!="number"||isNaN(e))return"";let i,a,s,[u,l=""]=e.toString().split("."),f=l.length;return i=parseFloat(u).toLocaleString(),t===xe.Left&&o&&(i=Sr(i)),n===-1||f===n?a=l:f>n?a=parseFloat("0."+l).toFixed(n).slice(2):(s=r?Rr:o&&t!==xe.Left?Rt:null)?f===0?a=s.FULL_PADDING[n]:a=St(l,n,s):a=l,i+(a?"."+a:"")}var Ar={},At=e=>e==null?"":typeof e=="string"?e:e.toString(),Ir=e=>{let t=De(e.type),n=yt(t);return r=>typeof r=="number"&&r!==0?n(new Date(r)):""},Lr=({align:e="right",type:t})=>{var n;if(t===void 0||typeof t=="string")return At;{let{alignOnDecimals:r=!1,decimals:o,zeroPad:i=!1}=(n=t.formatting)!=null?n:Ar;return a=>{if(typeof a=="string"&&(a.startsWith("\u03A3")||a.startsWith("[")))return a;let s=typeof a=="number"?a:typeof a=="string"?parseFloat(a):void 0;return vt(s,e,o,i,r)}}},Fr=e=>t=>{var n;return(n=e[t])!=null?n:""},Ws=(e,t=e.serverDataType)=>{if(_(e))return Ir(e);let{type:n}=e;return T(n)&&Ve(n==null?void 0:n.renderer)?Fr(n.renderer.map):t==="string"||t==="char"?r=>r:t==="double"?Lr(e):At};var Hs=()=>`hw-${Math.round(Math.random()*1e5)}`;function Gs(e,t){return e?e.concat(t.name):[t.name]}var Js=e=>e.length===1,js=e=>e.key==='"'||e.key==="'";function qs(e,t){if(!e){let n=new Error(t);throw n.name="Invariant Violation",n.framesToPop=1,n}}var Pr=e=>Object.prototype.toString.call(e)==="[object Object]";function Zs(e){return typeof e=="string"?e:Pr(e)?Object.prototype.hasOwnProperty.call(e,"label")?String(e.label):(console.warn(["itemToString: you've likely forgotten to set the label prop on the item object.","You can also provide your own `itemToString` implementation."].join(`
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export { getAddedItems, getMissingItems, itemsChanged, itemsOrOrderChanged, moveItem, moveItemDeprecated, partition } from './array-utils.js';
|
|
2
|
+
export { boxContainsPoint } from './box-utils.js';
|
|
3
|
+
export { AggregationType, addColumnToSubscribedColumns, applyDefaultColumnConfig, applyGroupByToColumns, applySortToColumns, applyWidthToColumns, buildColumnMap, dataAndColumnUnchanged, dataColumnAndKeyUnchanged, existingSort, extractGroupColumn, findColumn, flattenColumnGroup, fromServerDataType, getCalculatedColumnDetails, getCalculatedColumnExpression, getCalculatedColumnName, getCalculatedColumnType, getColumnByName, getColumnLabel, getColumnName, getColumnStyle, getColumnsInViewport, getDefaultAlignment, getDefaultColumnType, getGroupValueAndOffset, getRowRecord, getTableHeadings, getTypeFormattingFromColumn, hasHeadings, hasValidationRules, isCalculatedColumn, isColumnTypeRenderer, isDataLoading, isDateTimeColumn, isGroupColumn, isJsonAttribute, isJsonColumn, isJsonGroup, isLookupRenderer, isMappedValueTypeRenderer, isNotHidden, isNumericColumn, isPinned, isResizing, isTextColumn, isTypeDescriptor, isValidColumnAlignment, isValidPinLocation, isValueListRenderer, isVuuColumnDataType, mapSortCriteria, measurePinnedColumns, metadataKeys, moveColumnTo, projectUpdates, removeSort, replaceColumn, setAggregations, setCalculatedColumnExpression, setCalculatedColumnName, setCalculatedColumnType, sortPinnedColumns, subscribedOnly, toColumnDescriptor, toDataSourceColumns, updateColumn, updateColumnFormatting, updateColumnRenderProps, updateColumnType, visibleColumnAtIndex } from './column-utils.js';
|
|
4
|
+
export { getCookieValue } from './cookie-utils.js';
|
|
5
|
+
export { getCellConfigPanelRenderer, getCellRenderer, getCellRendererOptions, getColumnHeaderContentRenderer, getColumnHeaderLabelRenderer, getConfigurationEditor, getEditRuleValidator, getRegisteredCellRenderers, getRowClassNameGenerator, registerComponent, registerConfigurationEditor } from './component-registry.js';
|
|
6
|
+
export { DataWindow } from './DataWindow.js';
|
|
7
|
+
export { MEASURES } from './common-types.js';
|
|
8
|
+
export { DOWN1, DOWN2, UP1, UP2, getMovingValueDirection, isValidNumber, shallowEquals } from './data-utils.js';
|
|
9
|
+
export { isViewportMenusAction, isVisualLinkCreatedAction, isVisualLinkRemovedAction, isVisualLinksAction, isVuuFeatureAction } from './datasource-action-utils.js';
|
|
10
|
+
export { NO_CONFIG_CHANGES, NoFilter, NoSort, hasAction, hasFilter, hasGroupBy, hasSort, isConfigChanged, isConnectionQualityMetrics, isConnectionStatusMessage, isErrorResponse, isFilterChanged, isGroupByChanged, isTableSchema, isTypeaheadSuggestionProvider, isViewporttMessage, messageHasResult, vanillaConfig, withConfigDefaults } from './datasource-utils.js';
|
|
11
|
+
export { formatDate, getDateFormatter } from './date/formatter.js';
|
|
12
|
+
export { isDateTimePattern, supportedDateTimePatterns } from './date/types.js';
|
|
13
|
+
export { toCalendarDate } from './date/utils.js';
|
|
14
|
+
export { dateTimePattern, defaultPatternsByType, fallbackDateTimePattern } from './date/dateTimePattern.js';
|
|
15
|
+
export { RangeMonitor } from './debug-utils.js';
|
|
16
|
+
export { applyFilterToColumns, extractFilterForColumn, isAndFilter, isCompleteFilter, isFilterClause, isFilteredColumn, isInFilter, isMultiClauseFilter, isMultiValueFilter, isNamedFilter, isOrFilter, isSingleValueFilter, isValidFilterClauseOp, stripFilterFromColumns } from './filters/utils.js';
|
|
17
|
+
export { dateFilterAsQuery, filterAsQuery, removeColumnFromFilter } from './filters/filterAsQuery.js';
|
|
18
|
+
export { createEl, dispatchCustomEvent, dispatchMouseEvent, focusFirstFocusableElement, getClosest, getClosestIndexItem, getElementByDataIndex, getElementDataIndex, getFocusableElement, getScrollbarSize, isSelectableElement, queryClosest } from './html-utils.js';
|
|
19
|
+
export { EventEmitter } from './event-emitter.js';
|
|
20
|
+
export { defaultValueFormatter, getValueFormatter, numericFormatter } from './formatting-utils.js';
|
|
21
|
+
export { getUniqueId } from './getUniqueId.js';
|
|
22
|
+
export { addGroupColumn } from './group-utils.js';
|
|
23
|
+
export { isCharacterKey, isQuoteKey } from './input-utils.js';
|
|
24
|
+
export { invariant } from './invariant.js';
|
|
25
|
+
export { itemToString } from './itemToString.js';
|
|
26
|
+
export { jsonToDataSourceRows } from './json-utils.js';
|
|
27
|
+
export { ArrowDown, ArrowLeft, ArrowRight, ArrowUp, End, Enter, Escape, Home, PageDown, PageUp, Space, Tab } from './keyboard-utils.js';
|
|
28
|
+
export { KeySet } from './keyset.js';
|
|
29
|
+
export { getLoggingConfigForWorker, logger } from './logging-utils.js';
|
|
30
|
+
export { isGroupMenuItemDescriptor } from './menu-utils.js';
|
|
31
|
+
export { assertModuleExportsAtLeastOneComponent, isModule } from './module-utils.js';
|
|
32
|
+
export { uuid } from './nanoid/index.js';
|
|
33
|
+
export { asReactElements } from './react-utils.js';
|
|
34
|
+
export { roundDecimal } from './round-decimal.js';
|
|
35
|
+
export { debounce, throttle } from './perf-utils.js';
|
|
36
|
+
export { NULL_RANGE, WindowRange, getFullRange, rangeNewItems, rangesAreSame, resetRange, withinRange } from './range-utils.js';
|
|
37
|
+
export { actualRowPositioning, asDataSourceRowObject, getIndexFromRowElement, getRowElementAtIndex, virtualRowPositioning } from './row-utils.js';
|
|
38
|
+
export { RowSelected, deselectItem, expandSelection, getSelectionStatus, isRowSelected, isRowSelectedLast, isSelected, selectItem } from './selection-utils.js';
|
|
39
|
+
export { addSortColumn, setSortColumn, toggleOrApplySort } from './sort-utils.js';
|
|
40
|
+
export { lastWord, wordify } from './text-utils.js';
|
|
41
|
+
export { DEFAULT_DENSITY, DEFAULT_THEME, DEFAULT_THEME_MODE, ThemeContext, ThemeProvider, useThemeAttributes } from './ThemeProvider.js';
|
|
42
|
+
export { isNotNullOrUndefined } from './ts-utils.js';
|
|
43
|
+
export { getUrlParameter, hasUrlParameter } from './url-utils.js';
|
|
44
|
+
export { useId } from './useId.js';
|
|
45
|
+
export { useLayoutEffectSkipFirst } from './useLayoutEffectSkipFirst.js';
|
|
9
46
|
//# sourceMappingURL=index.js.map
|