@keenmate/web-grid 1.0.0-rc05 → 1.0.0-rc06

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/dist/web-grid.js CHANGED
@@ -27,11 +27,15 @@ class je {
27
27
  w(this, "_invalidCells", []);
28
28
  w(this, "_showRowToolbar", !1);
29
29
  w(this, "_rowToolbar", ["add", "delete", "duplicate"]);
30
- w(this, "_toolbarAlign", "center");
31
- w(this, "_toolbarTopPosition", "center");
30
+ w(this, "_toolbarVerticalAlign", "bottom");
31
+ w(this, "_toolbarHorizontalAlign", "center");
32
32
  w(this, "_toolbarTrigger", "hover");
33
33
  w(this, "_toolbarPosition", "auto");
34
34
  w(this, "_contextMenu");
35
+ w(this, "_rowShortcuts");
36
+ w(this, "_showShortcutsHelp", !1);
37
+ w(this, "_shortcutsHelpPosition", "top-right");
38
+ w(this, "_shortcutsHelpContentCallback");
35
39
  // ==========================================================================
36
40
  // Callbacks
37
41
  // ==========================================================================
@@ -245,17 +249,30 @@ class je {
245
249
  set rowToolbar(e) {
246
250
  this._rowToolbar = e, this.requestUpdate();
247
251
  }
252
+ get toolbarVerticalAlign() {
253
+ return this._toolbarVerticalAlign;
254
+ }
255
+ set toolbarVerticalAlign(e) {
256
+ this._toolbarVerticalAlign = e, this.requestUpdate();
257
+ }
258
+ get toolbarHorizontalAlign() {
259
+ return this._toolbarHorizontalAlign;
260
+ }
261
+ set toolbarHorizontalAlign(e) {
262
+ this._toolbarHorizontalAlign = e, this.requestUpdate();
263
+ }
264
+ // Deprecated aliases
248
265
  get toolbarAlign() {
249
- return this._toolbarAlign;
266
+ return this._toolbarVerticalAlign;
250
267
  }
251
268
  set toolbarAlign(e) {
252
- this._toolbarAlign = e, this.requestUpdate();
269
+ this.toolbarVerticalAlign = e;
253
270
  }
254
271
  get toolbarTopPosition() {
255
- return this._toolbarTopPosition;
272
+ return this._toolbarHorizontalAlign;
256
273
  }
257
274
  set toolbarTopPosition(e) {
258
- this._toolbarTopPosition = e, this.requestUpdate();
275
+ this.toolbarHorizontalAlign = e;
259
276
  }
260
277
  get toolbarTrigger() {
261
278
  return this._toolbarTrigger;
@@ -275,6 +292,31 @@ class je {
275
292
  set contextMenu(e) {
276
293
  this._contextMenu = e, this.requestUpdate();
277
294
  }
295
+ // Row keyboard shortcuts
296
+ get rowShortcuts() {
297
+ return this._rowShortcuts;
298
+ }
299
+ set rowShortcuts(e) {
300
+ this._rowShortcuts = e, this.requestUpdate();
301
+ }
302
+ get showShortcutsHelp() {
303
+ return this._showShortcutsHelp;
304
+ }
305
+ set showShortcutsHelp(e) {
306
+ this._showShortcutsHelp = e, this.requestUpdate();
307
+ }
308
+ get shortcutsHelpPosition() {
309
+ return this._shortcutsHelpPosition;
310
+ }
311
+ set shortcutsHelpPosition(e) {
312
+ this._shortcutsHelpPosition = e, this.requestUpdate();
313
+ }
314
+ get shortcutsHelpContentCallback() {
315
+ return this._shortcutsHelpContentCallback;
316
+ }
317
+ set shortcutsHelpContentCallback(e) {
318
+ this._shortcutsHelpContentCallback = e, this.requestUpdate();
319
+ }
278
320
  // Sorting (multi-column)
279
321
  get sort() {
280
322
  return this._sort;
@@ -659,7 +701,7 @@ class je {
659
701
  * Commit edit with validation
660
702
  */
661
703
  async commitEdit(e, o, i) {
662
- var g, h;
704
+ var l, h;
663
705
  const r = this._columns.find((u) => String(u.field) === o);
664
706
  if (!r) return;
665
707
  const s = this.displayItems[e];
@@ -685,15 +727,15 @@ class je {
685
727
  c = !1, a = u instanceof Error ? u.message : "Validation failed";
686
728
  }
687
729
  this._isValidating = !1;
688
- let l = this._draftRows.get(e);
689
- l || (l = { ...s }, this._draftRows.set(e, l)), l[o] = d, c ? (this.removeInvalidCell(e, o), this._currentCellError = null) : (this.addInvalidCell(e, o, a || "Invalid value"), this._currentCellError = a, (g = this._onvalidationerror) == null || g.call(this, {
730
+ let g = this._draftRows.get(e);
731
+ g || (g = { ...s }, this._draftRows.set(e, g)), g[o] = d, c ? (this.removeInvalidCell(e, o), this._currentCellError = null) : (this.addInvalidCell(e, o, a || "Invalid value"), this._currentCellError = a, (l = this._onvalidationerror) == null || l.call(this, {
690
732
  row: s,
691
733
  rowIndex: e,
692
734
  field: o,
693
735
  error: a || "Invalid value"
694
736
  })), (h = this._onrowchange) == null || h.call(this, {
695
737
  row: s,
696
- draftRow: l,
738
+ draftRow: g,
697
739
  rowIndex: e,
698
740
  field: o,
699
741
  oldValue: n,
@@ -748,7 +790,7 @@ class je {
748
790
  this._focusedCell = null;
749
791
  }
750
792
  }
751
- const Be = ':host{--wg-rem: 10px;font-family:var(--wg-font-family, var(--base-font-family, system-ui, -apple-system, sans-serif));display:block;--wg-accent-color: var(--base-accent-color, #0078d4);--wg-accent-color-hover: var(--base-accent-color-hover, #106ebe);--wg-accent-color-active: var(--base-accent-color-active, #005a9e);--wg-accent-color-light: var(--base-accent-color-light, #e6f2ff);--wg-text-color-1: var(--base-text-color-1, #242424);--wg-text-color-2: var(--base-text-color-2, #424242);--wg-text-color-3: var(--base-text-color-3, #707070);--wg-text-on-accent: var(--base-text-color-on-accent, #ffffff);--wg-surface-1: var(--base-main-bg, #ffffff);--wg-surface-2: var(--base-elevated-bg, #f5f5f5);--wg-surface-3: var(--base-hover-bg, #ebebeb);--wg-surface-floating: var(--base-dropdown-bg, var(--base-main-bg, #ffffff));--wg-border-color: var(--base-border-color, #e0e0e0);--wg-border-color-hover: var(--base-border-color, #d1d1d1);--wg-input-bg: var(--base-input-bg, #ffffff);--wg-input-color: var(--base-input-color, var(--wg-text-color-1));--wg-input-border: var(--base-input-border, 1px solid #d1d1d1);--wg-input-border-hover: var(--base-input-border-hover, 1px solid #0078d4);--wg-input-border-focus: var(--base-input-border-focus, 1px solid #0078d4);--wg-input-placeholder-color: var(--base-input-placeholder-color, #707070);--wg-danger-color: var(--base-danger-color, #d13438);--wg-danger-bg-light: var(--base-danger-bg-light, #fde7e9);--wg-hover-bg: var(--base-hover-bg, #f0f0f0);--wg-active-bg: var(--base-hover-bg, #e0e0e0);--wg-font-size-base: calc(var(--base-font-size-base, 1.4) * var(--wg-rem));--wg-font-size-sm: calc(var(--base-font-size-sm, 1.2) * var(--wg-rem));--wg-font-size-xs: calc(var(--base-font-size-xs, 1.1) * var(--wg-rem));--wg-font-size-lg: calc(var(--base-font-size-lg, 1.6) * var(--wg-rem));--wg-line-height-base: calc(var(--base-line-height-normal, 2) * var(--wg-rem));--wg-font-weight-normal: var(--base-font-weight-normal, 400);--wg-font-weight-semibold: var(--base-font-weight-semibold, 600);--wg-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--wg-rem));--wg-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--wg-rem));--wg-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--wg-rem));--wg-spacing-xs: calc(.4 * var(--wg-rem));--wg-spacing-sm: calc(.8 * var(--wg-rem));--wg-spacing-md: calc(1.2 * var(--wg-rem));--wg-spacing-lg: calc(1.6 * var(--wg-rem));--wg-spacing-xl: calc(2.4 * var(--wg-rem));--wg-table-bg: var(--wg-surface-1);--wg-table-border: 1px solid var(--wg-border-color);--wg-header-bg: var(--wg-surface-2);--wg-header-bg-hover: var(--wg-surface-3);--wg-header-bg-sorted: var(--wg-surface-3);--wg-header-color: var(--wg-text-color-1);--wg-header-border: 2px solid var(--wg-border-color);--wg-header-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-header-font-weight: var(--wg-font-weight-semibold);--wg-cell-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-cell-color: var(--wg-text-color-1);--wg-cell-border: 1px solid var(--wg-border-color);--wg-cell-bg-hover: var(--wg-hover-bg);--wg-cell-bg-editing: var(--wg-surface-1);--wg-cell-readonly-bg: var(--base-disabled-bg, var(--wg-surface-2));--wg-row-border: 1px solid var(--wg-border-color);--wg-row-bg-even: var(--wg-surface-2);--wg-row-bg-hover: var(--wg-surface-3);--wg-filter-bg: var(--wg-surface-1);--wg-filter-border: 1px solid var(--wg-border-color);--wg-filter-padding: var(--wg-spacing-xs) var(--wg-spacing-sm);--wg-filter-input-padding: calc(.4 * var(--wg-rem)) calc(.8 * var(--wg-rem));--wg-filter-input-bg: var(--wg-input-bg);--wg-filter-input-border: var(--wg-input-border);--wg-filter-input-border-focus: var(--wg-input-border-focus);--wg-filter-input-border-radius: var(--wg-border-radius-sm);--wg-filter-input-font-size: var(--wg-font-size-sm);--wg-sort-indicator-size: calc(1.4 * var(--wg-rem));--wg-sort-indicator-opacity: .9;--wg-sort-placeholder-opacity: .3;--wg-sort-priority-size: calc(1.1 * var(--wg-rem));--wg-pagination-padding: var(--wg-spacing-md);--wg-pagination-gap: calc(1.6 * var(--wg-rem));--wg-pagination-bg: var(--wg-surface-1);--wg-pagination-border: 1px solid var(--wg-border-color);--wg-pagination-btn-padding: calc(.6 * var(--wg-rem)) calc(1.6 * var(--wg-rem));--wg-pagination-btn-bg: var(--wg-surface-1);--wg-pagination-btn-bg-hover: var(--wg-surface-2);--wg-pagination-btn-bg-active: var(--wg-surface-3);--wg-pagination-btn-border: 1px solid var(--wg-border-color);--wg-pagination-btn-border-hover: 1px solid var(--wg-border-color-hover);--wg-pagination-btn-border-radius: var(--wg-border-radius-sm);--wg-pagination-btn-disabled-opacity: .4;--wg-empty-padding: var(--wg-spacing-xl);--wg-empty-color: var(--wg-text-color-3);--wg-error-cell-bg: var(--wg-danger-bg-light);--wg-error-cell-border: 1px solid var(--wg-danger-color);--wg-error-message-color: var(--wg-danger-color);--wg-error-message-font-size: var(--wg-font-size-xs);--wg-error-indicator-color: var(--wg-danger-color);--wg-editor-bg: var(--wg-surface-1);--wg-editor-outline: 2px solid var(--wg-accent-color);--wg-editor-outline-offset: -2px;--wg-editor-validating-opacity: .7;--wg-dropdown-toggle-right: var(--wg-spacing-md);--wg-dropdown-toggle-size: calc(1.2 * var(--wg-rem));--wg-dropdown-toggle-hitbox: calc(2.4 * var(--wg-rem));--wg-toolbar-bg: var(--wg-surface-floating);--wg-toolbar-border: 1px solid var(--wg-border-color);--wg-toolbar-border-radius: var(--wg-border-radius-sm);--wg-toolbar-shadow: var(--base-dropdown-box-shadow, 0 2px 8px rgba(0, 0, 0, .15));--wg-toolbar-divider-color: var(--wg-border-color);--wg-toolbar-btn-min-width: calc(2.4 * var(--wg-rem));--wg-toolbar-btn-padding: 0 calc(.4 * var(--wg-rem));--wg-toolbar-btn-border-radius: var(--wg-border-radius-sm);--wg-toolbar-btn-bg-hover: var(--wg-hover-bg);--wg-toolbar-btn-bg-active: var(--wg-active-bg);--wg-toolbar-btn-color: var(--wg-text-color-1);--wg-toolbar-trigger-color: var(--wg-text-color-3);--wg-toolbar-trigger-color-hover: var(--wg-text-color-1);--wg-toolbar-trigger-bg-hover: var(--wg-hover-bg);--wg-tooltip-bg: var(--base-tooltip-bg, #333);--wg-context-menu-z-index: 1001;--wg-context-menu-min-width: calc(16 * var(--wg-rem));--wg-focus-outline: 2px solid var(--wg-accent-color);--wg-focus-outline-offset: -2px;--wg-focus-bg: var(--wg-hover-bg);--wg-transition-fast: .1s ease;--wg-transition-normal: .15s ease;--wg-z-dropdown: 9999;--wg-z-toolbar: 1000;--wg-z-context-menu: 1001}web-grid:not(:defined){display:block;min-height:calc(10 * var(--wg-rem));color:transparent!important;background:transparent}.wg{position:relative;width:100%;max-height:inherit;overflow:auto;overscroll-behavior:contain;border:var(--wg-table-border)}.wg__table{width:max-content;min-width:100%;border-collapse:collapse;table-layout:fixed;background:var(--wg-table-bg);font-size:var(--wg-font-size-base);line-height:var(--wg-line-height-base)}.wg__table tbody tr{border-bottom:var(--wg-row-border)}.wg__row-number-header,.wg__row-number{width:40px;min-width:40px;max-width:40px;text-align:center;color:var(--wg-text-color-secondary);background:var(--wg-header-bg);-webkit-user-select:none;user-select:none;font-size:var(--wg-font-size-sm)}.wg__row-number{border-right:var(--wg-cell-border)}.wg__actions-column{width:32px;min-width:32px;max-width:32px;padding:0!important;text-align:center}thead .wg__actions-column{background:var(--wg-header-bg);border-bottom:var(--wg-header-border)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__header{position:sticky;top:0;z-index:1;background:var(--wg-header-bg);color:var(--wg-header-color);font-weight:var(--wg-header-font-weight);padding:var(--wg-header-padding);border-bottom:var(--wg-header-border);text-align:left;-webkit-user-select:none;user-select:none}.wg__header--sortable{cursor:pointer}.wg__header--sortable:hover{background:var(--wg-header-bg-hover)}.wg__header--sorted{background:var(--wg-header-bg-sorted)}.wg__header-content{display:flex;align-items:center;gap:4px;justify-content:space-between}.wg__header-title{flex:1}.wg__sort-indicator{font-size:var(--wg-sort-indicator-size);opacity:var(--wg-sort-indicator-opacity);min-width:16px;text-align:center;display:inline-flex;align-items:center}.wg__sort-placeholder{opacity:var(--wg-sort-placeholder-opacity)}.wg__sort-priority{font-size:var(--wg-sort-priority-size);font-weight:600;margin-left:2px;vertical-align:super;line-height:1}.wg__header-info{display:inline-flex;align-items:center;color:var(--wg-accent-color);cursor:help;opacity:.7;margin-left:4px;vertical-align:middle}.wg__header-info:hover{opacity:1}.wg__filter-row th{padding:var(--wg-filter-padding);background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__filter-input{width:100%;padding:var(--wg-filter-input-padding);border:var(--wg-filter-input-border);border-radius:var(--wg-filter-input-border-radius);background:var(--wg-surface-1);color:var(--wg-text-color-1);font-size:var(--wg-filter-input-font-size);box-sizing:border-box}.wg__filter-input:focus{outline:none;border:var(--wg-filter-input-border-focus);box-shadow:0 0 0 1px var(--wg-accent-color)}.wg__cell{padding:var(--wg-cell-padding);color:var(--wg-cell-color);scroll-margin-top:3rem;scroll-margin-bottom:.5rem}.wg__cell-text{-webkit-user-select:none;user-select:none}.wg__cell--ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__cell--editable{cursor:pointer;position:relative}.wg__cell--editable:hover{background:var(--wg-cell-bg-hover)}.wg__cell--editable:hover:after{content:"";position:absolute;top:2px;right:2px;bottom:2px;left:2px;border:1px dashed var(--wg-border-color);border-radius:2px;pointer-events:none}.wg__cell--editing{position:relative;background:var(--wg-surface-1);outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__cell--editing:after{display:none}.wg__cell--invalid{background:var(--wg-danger-bg-light, #fee);box-shadow:inset 0 0 0 2px var(--wg-danger-color, #c00)}.wg--navigate-mode .wg__cell:not(.wg__cell--editable){background:var(--wg-cell-readonly-bg, #f5f5f5)}.wg__editor{position:absolute;top:0;left:0;right:0;width:100%;padding:var(--wg-cell-padding);border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:inherit;box-sizing:border-box}.wg__editor:focus,.wg__editor:focus-visible{outline:none;box-shadow:none}.wg__editor--text{text-align:inherit}.wg__editor--number{text-align:right}.wg__editor--date{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg)}.wg__date-input{flex:1;min-width:0;height:100%;border:none;background:transparent;font:inherit;padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);outline:none;color:inherit}.wg__date-trigger{width:var(--wg-date-trigger-size, 28px);height:100%;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--wg-text-secondary, #666);cursor:pointer;padding:0;flex-shrink:0}.wg__date-trigger:hover{color:var(--wg-accent-color, #0078d4);background:var(--wg-hover-bg, rgba(0, 0, 0, .05))}.wg__editor--checkbox{width:auto;height:auto;margin:0 auto}.wg__editor--custom{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg);padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);cursor:pointer}.wg__editor--custom:focus{outline:none}.wg__custom-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;cursor:pointer}.wg__editor--combobox,.wg__editor--autocomplete{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;padding:var(--wg-cell-padding);padding-right:0;background:transparent;box-sizing:border-box}.wg__combobox-input,.wg__autocomplete-input{flex:1;width:100%;height:100%;padding:0 24px 0 0;border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base);outline:none;box-sizing:border-box;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wg__combobox-input:focus,.wg__autocomplete-input:focus{outline:none}.wg__combobox-toggle{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:var(--wg-dropdown-toggle-size);color:var(--wg-text-color-2);pointer-events:auto;cursor:pointer}.wg__combobox-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__loading-indicator{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:12px;animation:wg-pulse 1s infinite}@keyframes wg-pulse{0%,to{opacity:1}50%{opacity:.4}}.wg__select-trigger{display:flex;align-items:center;justify-content:space-between;cursor:pointer;background:transparent}.wg__select-trigger:focus,.wg__select-trigger:focus-visible{outline:none;box-shadow:none}.wg__select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__select-toggle{position:relative;font-size:var(--wg-dropdown-toggle-size);opacity:.6;margin-left:4px;flex-shrink:0;pointer-events:auto;cursor:pointer}.wg__select-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-dropdown-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:0}.wg__cell:hover .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle,.wg__cell--focused .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:.6}.wg__cell-date-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-date-display .wg__date-trigger{position:relative;background:none;border:none;padding:0;margin:0;cursor:pointer;opacity:.6;display:flex;align-items:center;justify-content:center;color:inherit}.wg__cell-date-display .wg__date-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:0}.wg__cell:hover .wg__cell-date-display--toggle-on-focus .wg__date-trigger,.wg__cell--focused .wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:.6}.wg__dropdown{background:var(--wg-surface-floating, #fff);border:1px solid var(--wg-border-color, #d1d1d1);border-radius:4px;box-shadow:var(--wg-toolbar-shadow);max-height:200px;overflow-y:auto;font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base)}.wg__dropdown-option{display:flex;align-items:center;gap:var(--wg-spacing-sm);padding:6px 12px;cursor:pointer;color:var(--wg-text-color-1)}.wg__dropdown-option:hover,.wg__dropdown-option--highlighted{background:var(--wg-hover-bg, #f0f0f0)}.wg__dropdown-option--selected{background:var(--wg-accent-color-light, #e6f2ff)}.wg__dropdown-option--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.wg__dropdown-option-icon{flex-shrink:0;width:1.5em;text-align:center}.wg__dropdown-option-content{flex:1;min-width:0;overflow:hidden}.wg__dropdown-option-label{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-option-subtitle{display:block;font-size:var(--wg-font-size-sm);color:var(--wg-text-color-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-empty{padding:8px 12px;color:var(--wg-text-color-2);font-style:italic;text-align:center}.wg--navigate-mode .wg__cell{cursor:cell}.wg--navigate-mode .wg__cell:focus{outline:none}.wg--navigate-mode .wg__cell.wg__cell--focused{outline:2px solid var(--wg-focus-border-color, #217346);outline-offset:-2px}.wg__cell--focused:after{display:none}.wg__pagination{display:flex;align-items:center;justify-content:center;gap:var(--wg-pagination-gap);padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__pagination-btn{padding:var(--wg-pagination-btn-padding);background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-size:var(--wg-font-size-base);cursor:pointer;transition:all var(--wg-transition-fast)}.wg__pagination-btn:hover:not(:disabled){background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-btn:active:not(:disabled){background:var(--wg-pagination-btn-bg-active)}.wg__pagination-btn:disabled{opacity:var(--wg-pagination-btn-disabled-opacity);cursor:not-allowed}.wg__pagination-info{font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__pagination-count{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3);margin-left:4px}.wg__pagination-pagesize{display:flex;align-items:center;gap:6px}.wg__pagination-select{padding:4px 8px;background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-size:var(--wg-font-size-base);cursor:pointer}.wg__pagination-select:hover{background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-select:focus{outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__pagination-label{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3)}.wg__pagination--left{justify-content:flex-start}.wg__pagination--right{justify-content:flex-end}.wg__pagination--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__summary{display:flex;align-items:center;padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg);font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__summary--left{justify-content:flex-start}.wg__summary--right{justify-content:flex-end}.wg__summary--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer{display:flex;align-items:center;justify-content:space-between;border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__footer--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer .wg__summary,.wg__footer .wg__pagination{border:none}.wg__footer .wg__summary{flex:0 0 auto}.wg__footer .wg__pagination{flex:0 0 auto;margin-left:auto}.wg__toolbar-container{position:fixed;z-index:var(--wg-z-toolbar, 1000)}.wg__toolbar{display:flex;flex-direction:column-reverse;gap:0;padding:0;background:var(--wg-toolbar-bg);border:var(--wg-toolbar-border);border-radius:var(--wg-toolbar-border-radius);box-shadow:var(--wg-toolbar-shadow)}.wg__toolbar-row{display:flex;gap:2px;align-items:center;height:calc(var(--wg-design-unit, 4) * 4px + 21px);padding:0 4px}.wg__toolbar-row+.wg__toolbar-row{border-top:1px solid var(--wg-toolbar-divider-color)}.wg__toolbar-divider{width:1px;height:16px;background:var(--wg-toolbar-divider-color);margin:0 4px;flex-shrink:0}.wg__toolbar-btn{min-width:var(--wg-toolbar-btn-min-width);height:100%;border:none;border-radius:var(--wg-toolbar-btn-border-radius);background:transparent;color:var(--wg-toolbar-btn-color);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:4px;font-size:var(--wg-font-size-base);font-weight:500;padding:var(--wg-toolbar-btn-padding);transition:background .1s ease}.wg__toolbar-btn:hover{background:var(--wg-toolbar-btn-bg-hover)}.wg__toolbar-btn:active{background:var(--wg-toolbar-btn-bg-active)}.wg__toolbar-btn:disabled{opacity:.5;cursor:not-allowed}.wg__toolbar-btn:disabled:hover{background:transparent}.wg__toolbar-btn--danger:hover{background:var(--wg-danger-bg-light);color:var(--wg-danger-color)}.wg__toolbar-label{font-size:12px;white-space:nowrap}.wg__actions-column{width:24px;min-width:24px;max-width:24px;padding:0!important;text-align:center}.wg__header .wg__actions-column{background:var(--wg-header-bg)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg)}.wg__toolbar-trigger{position:relative;padding:0;background:transparent;border:none;border-radius:var(--wg-border-radius-sm);cursor:pointer;font-size:var(--wg-font-size-base);line-height:1;color:var(--wg-toolbar-trigger-color)}.wg__toolbar-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__toolbar-trigger:hover,.wg__toolbar-trigger--active{color:var(--wg-toolbar-trigger-color-hover);background:var(--wg-toolbar-trigger-bg-hover)}.wg--striped tbody tr:nth-child(2n){background:var(--wg-row-bg-even)}.wg--hoverable tbody tr:hover{background:var(--wg-row-bg-hover)}.wg__empty{text-align:center;padding:var(--wg-empty-padding);color:var(--wg-empty-color);font-style:italic}.wg__loading-more{text-align:center;padding:var(--wg-cell-padding);color:var(--wg-text-color-2);font-size:var(--wg-font-size-sm)}.wg__tooltip{position:fixed;z-index:var(--wg-z-tooltip, 10000);max-width:300px;padding:6px 10px;background:var(--wg-tooltip-bg, #333);color:var(--wg-tooltip-color, #fff);font-size:var(--wg-font-size-sm);line-height:1.4;border-radius:var(--wg-border-radius-sm);box-shadow:0 2px 8px #0003;pointer-events:none;opacity:0;transition:opacity var(--wg-transition-fast)}.wg__tooltip--visible{opacity:1}.wg__tooltip-arrow{position:absolute;width:8px;height:8px;background:var(--wg-tooltip-bg, #333);transform:rotate(45deg)}.wg__tooltip[data-placement^=top] .wg__tooltip-arrow{bottom:-4px}.wg__tooltip[data-placement^=bottom] .wg__tooltip-arrow{top:-4px}.wg__tooltip[data-placement^=left] .wg__tooltip-arrow{right:-4px}.wg__tooltip[data-placement^=right] .wg__tooltip-arrow{left:-4px}.wg__goto-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.wg__goto-dialog{background:var(--wg-surface-1);border-radius:var(--wg-border-radius);padding:var(--wg-spacing-lg);box-shadow:0 4px 20px #00000026;min-width:250px}.wg__goto-label{display:block;margin-bottom:var(--wg-spacing-sm);font-size:var(--wg-font-size-base);color:var(--wg-text-color-1)}.wg__goto-input{width:100%;padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-size:var(--wg-font-size-base);margin-bottom:var(--wg-spacing-md);box-sizing:border-box}.wg__goto-input:focus{outline:none;border-color:var(--wg-accent-color);box-shadow:0 0 0 2px #0078d433}.wg__goto-buttons{display:flex;gap:var(--wg-spacing-sm);justify-content:flex-end}.wg__goto-btn{padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-size:var(--wg-font-size-sm);cursor:pointer;background:var(--wg-surface-1);color:var(--wg-text-color-1)}.wg__goto-btn:hover{background:var(--wg-surface-2)}.wg__goto-btn--go{background:var(--wg-accent-color);border-color:var(--wg-accent-color);color:#fff}.wg__goto-btn--go:hover{background:var(--wg-accent-color-hover, #106ebe)}.wg__spacer-top td,.wg__spacer-bottom td{padding:0;border:none;background:transparent;height:inherit;line-height:0}@media (prefers-color-scheme: dark){:host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}}:host([data-theme="dark"]),[data-theme=dark] :host,:host([data-bs-theme="dark"]),[data-bs-theme=dark] :host,.dark :host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}';
793
+ const Be = ':host{--wg-rem: 10px;font-family:var(--wg-font-family, var(--base-font-family, inherit));display:block;--wg-accent-color: var(--base-accent-color, #0078d4);--wg-accent-color-hover: var(--base-accent-color-hover, #106ebe);--wg-accent-color-active: var(--base-accent-color-active, #005a9e);--wg-accent-color-light: var(--base-accent-color-light, #e6f2ff);--wg-text-color-1: var(--base-text-color-1, #242424);--wg-text-color-2: var(--base-text-color-2, #424242);--wg-text-color-3: var(--base-text-color-3, #707070);--wg-text-on-accent: var(--base-text-color-on-accent, #ffffff);--wg-surface-1: var(--base-main-bg, #ffffff);--wg-surface-2: var(--base-elevated-bg, #f5f5f5);--wg-surface-3: var(--base-hover-bg, #ebebeb);--wg-surface-floating: var(--base-dropdown-bg, var(--base-main-bg, #ffffff));--wg-border-color: var(--base-border-color, #e0e0e0);--wg-border-color-hover: var(--base-border-color, #d1d1d1);--wg-input-bg: var(--base-input-bg, #ffffff);--wg-input-color: var(--base-input-color, var(--wg-text-color-1));--wg-input-border: var(--base-input-border, 1px solid #d1d1d1);--wg-input-border-hover: var(--base-input-border-hover, 1px solid #0078d4);--wg-input-border-focus: var(--base-input-border-focus, 1px solid #0078d4);--wg-input-placeholder-color: var(--base-input-placeholder-color, #707070);--wg-danger-color: var(--base-danger-color, #d13438);--wg-danger-bg-light: var(--base-danger-bg-light, #fde7e9);--wg-hover-bg: var(--base-hover-bg, #f0f0f0);--wg-active-bg: var(--base-hover-bg, #e0e0e0);--wg-font-size-base: calc(var(--base-font-size-sm, 1.4) * var(--wg-rem));--wg-font-size-sm: calc(var(--base-font-size-xs, 1.2) * var(--wg-rem));--wg-font-size-xs: calc(var(--base-font-size-2xs, 1.1) * var(--wg-rem));--wg-font-size-lg: calc(var(--base-font-size-base, 1.6) * var(--wg-rem));--wg-line-height-base: var(--base-line-height-normal, 1.5);--wg-font-weight-normal: var(--base-font-weight-normal, 400);--wg-font-weight-semibold: var(--base-font-weight-semibold, 600);--wg-border-radius-sm: calc(var(--base-border-radius-sm, .4) * var(--wg-rem));--wg-border-radius-md: calc(var(--base-border-radius-md, .6) * var(--wg-rem));--wg-border-radius-lg: calc(var(--base-border-radius-lg, .8) * var(--wg-rem));--wg-spacing-xs: calc(.4 * var(--wg-rem));--wg-spacing-sm: calc(.8 * var(--wg-rem));--wg-spacing-md: calc(1.2 * var(--wg-rem));--wg-spacing-lg: calc(1.6 * var(--wg-rem));--wg-spacing-xl: calc(2.4 * var(--wg-rem));--wg-table-bg: var(--wg-surface-1);--wg-table-border: 1px solid var(--wg-border-color);--wg-header-bg: var(--wg-surface-2);--wg-header-bg-hover: var(--wg-surface-3);--wg-header-bg-sorted: var(--wg-surface-3);--wg-header-color: var(--wg-text-color-1);--wg-header-border: 2px solid var(--wg-border-color);--wg-header-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-header-font-weight: var(--wg-font-weight-semibold);--wg-cell-padding: var(--wg-spacing-sm) var(--wg-spacing-md);--wg-cell-color: var(--wg-text-color-1);--wg-cell-border: 1px solid var(--wg-border-color);--wg-cell-bg-hover: var(--wg-hover-bg);--wg-cell-bg-editing: var(--wg-surface-1);--wg-cell-readonly-bg: var(--base-disabled-bg, var(--wg-surface-2));--wg-row-border: 1px solid var(--wg-border-color);--wg-row-bg-even: var(--wg-surface-2);--wg-row-bg-hover: var(--wg-surface-3);--wg-filter-bg: var(--wg-surface-1);--wg-filter-border: 1px solid var(--wg-border-color);--wg-filter-padding: var(--wg-spacing-xs) var(--wg-spacing-sm);--wg-filter-input-padding: calc(.4 * var(--wg-rem)) calc(.8 * var(--wg-rem));--wg-filter-input-bg: var(--wg-input-bg);--wg-filter-input-border: var(--wg-input-border);--wg-filter-input-border-focus: var(--wg-input-border-focus);--wg-filter-input-border-radius: var(--wg-border-radius-sm);--wg-filter-input-font-size: var(--wg-font-size-sm);--wg-sort-indicator-size: calc(1.4 * var(--wg-rem));--wg-sort-indicator-opacity: .9;--wg-sort-placeholder-opacity: .3;--wg-sort-priority-size: calc(1.1 * var(--wg-rem));--wg-pagination-padding: var(--wg-spacing-md);--wg-pagination-gap: calc(1.6 * var(--wg-rem));--wg-pagination-bg: var(--wg-surface-1);--wg-pagination-border: 1px solid var(--wg-border-color);--wg-pagination-btn-padding: calc(.6 * var(--wg-rem)) calc(1.6 * var(--wg-rem));--wg-pagination-btn-bg: var(--wg-surface-1);--wg-pagination-btn-bg-hover: var(--wg-surface-2);--wg-pagination-btn-bg-active: var(--wg-surface-3);--wg-pagination-btn-border: 1px solid var(--wg-border-color);--wg-pagination-btn-border-hover: 1px solid var(--wg-border-color-hover);--wg-pagination-btn-border-radius: var(--wg-border-radius-sm);--wg-pagination-btn-disabled-opacity: .4;--wg-empty-padding: var(--wg-spacing-xl);--wg-empty-color: var(--wg-text-color-3);--wg-error-cell-bg: var(--wg-danger-bg-light);--wg-error-cell-border: 1px solid var(--wg-danger-color);--wg-error-message-color: var(--wg-danger-color);--wg-error-message-font-size: var(--wg-font-size-xs);--wg-error-indicator-color: var(--wg-danger-color);--wg-editor-bg: var(--wg-surface-1);--wg-editor-outline: 2px solid var(--wg-accent-color);--wg-editor-outline-offset: -2px;--wg-editor-validating-opacity: .7;--wg-dropdown-toggle-right: var(--wg-spacing-md);--wg-dropdown-toggle-size: calc(1.2 * var(--wg-rem));--wg-dropdown-toggle-hitbox: calc(2.4 * var(--wg-rem));--wg-toolbar-bg: var(--wg-surface-floating);--wg-toolbar-border: 1px solid var(--wg-border-color);--wg-toolbar-border-radius: var(--wg-border-radius-sm);--wg-toolbar-shadow: var(--base-dropdown-box-shadow, 0 2px 8px rgba(0, 0, 0, .15));--wg-toolbar-divider-color: var(--wg-border-color);--wg-toolbar-btn-min-width: calc(2.4 * var(--wg-rem));--wg-toolbar-btn-padding: 0 calc(.4 * var(--wg-rem));--wg-toolbar-btn-border-radius: var(--wg-border-radius-sm);--wg-toolbar-btn-bg-hover: var(--wg-hover-bg);--wg-toolbar-btn-bg-active: var(--wg-active-bg);--wg-toolbar-btn-color: var(--wg-text-color-1);--wg-toolbar-trigger-color: var(--wg-text-color-3);--wg-toolbar-trigger-color-hover: var(--wg-text-color-1);--wg-toolbar-trigger-bg-hover: var(--wg-hover-bg);--wg-tooltip-bg: var(--base-tooltip-bg, #333);--wg-context-menu-z-index: 1001;--wg-context-menu-min-width: calc(16 * var(--wg-rem));--wg-focus-outline: 2px solid var(--wg-accent-color);--wg-focus-outline-offset: -2px;--wg-focus-bg: var(--wg-hover-bg);--wg-transition-fast: .1s ease;--wg-transition-normal: .15s ease;--wg-z-dropdown: 9999;--wg-z-toolbar: 1000;--wg-z-context-menu: 1001}web-grid:not(:defined){display:block;min-height:calc(10 * var(--wg-rem));color:transparent!important;background:transparent}.wg{position:relative;width:100%;max-height:inherit;overflow:auto;overscroll-behavior:contain;border:var(--wg-table-border)}.wg__table{width:max-content;min-width:100%;border-collapse:collapse;table-layout:fixed;background:var(--wg-table-bg);font-size:var(--wg-font-size-base);line-height:var(--wg-line-height-base)}.wg__table tbody tr{border-bottom:var(--wg-row-border)}.wg__row-number-header,.wg__row-number{width:40px;min-width:40px;max-width:40px;text-align:center;color:var(--wg-text-color-secondary);background:var(--wg-header-bg);-webkit-user-select:none;user-select:none;font-size:var(--wg-font-size-sm)}.wg__row-number{border-right:var(--wg-cell-border)}.wg__actions-column{width:32px;min-width:32px;max-width:32px;padding:0!important;text-align:center}thead .wg__actions-column{background:var(--wg-header-bg);border-bottom:var(--wg-header-border)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__header{position:sticky;top:0;z-index:1;background:var(--wg-header-bg);color:var(--wg-header-color);font-weight:var(--wg-header-font-weight);padding:var(--wg-header-padding);border-bottom:var(--wg-header-border);text-align:left;-webkit-user-select:none;user-select:none}.wg__header--sortable{cursor:pointer}.wg__header--sortable:hover{background:var(--wg-header-bg-hover)}.wg__header--sorted{background:var(--wg-header-bg-sorted)}.wg__header-content{display:flex;align-items:center;gap:4px;justify-content:space-between}.wg__header-title{flex:1}.wg__sort-indicator{font-size:var(--wg-sort-indicator-size);opacity:var(--wg-sort-indicator-opacity);min-width:16px;text-align:center;display:inline-flex;align-items:center}.wg__sort-placeholder{opacity:var(--wg-sort-placeholder-opacity)}.wg__sort-priority{font-size:var(--wg-sort-priority-size);font-weight:600;margin-left:2px;vertical-align:super;line-height:1}.wg__header-info{display:inline-flex;align-items:center;color:var(--wg-accent-color);cursor:help;opacity:.7;margin-left:4px;vertical-align:middle}.wg__header-info:hover{opacity:1}.wg__filter-row th{padding:var(--wg-filter-padding);background:var(--wg-filter-bg);border-bottom:var(--wg-filter-border)}.wg__filter-input{width:100%;padding:var(--wg-filter-input-padding);border:var(--wg-filter-input-border);border-radius:var(--wg-filter-input-border-radius);background:var(--wg-surface-1);color:var(--wg-text-color-1);font-family:inherit;font-size:var(--wg-filter-input-font-size);box-sizing:border-box}.wg__filter-input:focus{outline:none;border:var(--wg-filter-input-border-focus);box-shadow:0 0 0 1px var(--wg-accent-color)}.wg__cell{padding:var(--wg-cell-padding);color:var(--wg-cell-color);scroll-margin-top:3rem;scroll-margin-bottom:.5rem}.wg__cell-text{-webkit-user-select:none;user-select:none}.wg__cell--ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__cell--editable{cursor:pointer;position:relative}.wg__cell--editable:hover{background:var(--wg-cell-bg-hover)}.wg__cell--editable:hover:after{content:"";position:absolute;top:2px;right:2px;bottom:2px;left:2px;border:1px dashed var(--wg-border-color);border-radius:2px;pointer-events:none}.wg__cell--editing{position:relative;background:var(--wg-surface-1);outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__cell--editing:after{display:none}.wg__cell--invalid{background:var(--wg-danger-bg-light, #fee);box-shadow:inset 0 0 0 2px var(--wg-danger-color, #c00)}.wg--navigate-mode .wg__cell:not(.wg__cell--editable){background:var(--wg-cell-readonly-bg, #f5f5f5)}.wg__editor{position:absolute;top:0;left:0;right:0;width:100%;padding:var(--wg-cell-padding);border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:inherit;box-sizing:border-box}.wg__editor:focus,.wg__editor:focus-visible{outline:none;box-shadow:none}.wg__editor--text{text-align:inherit}.wg__editor--number{text-align:right}.wg__editor--date{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg)}.wg__date-input{flex:1;min-width:0;height:100%;border:none;background:transparent;font:inherit;padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);outline:none;color:inherit}.wg__date-trigger{width:var(--wg-date-trigger-size, 28px);height:100%;display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--wg-text-secondary, #666);cursor:pointer;padding:0;flex-shrink:0}.wg__date-trigger:hover{color:var(--wg-accent-color, #0078d4);background:var(--wg-hover-bg, rgba(0, 0, 0, .05))}.wg__editor--checkbox{width:auto;height:auto;margin:0 auto}.wg__editor--custom{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;background:var(--wg-editor-bg);padding:var(--wg-cell-padding-block) var(--wg-cell-padding-inline);cursor:pointer}.wg__editor--custom:focus{outline:none}.wg__custom-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;cursor:pointer}.wg__editor--combobox,.wg__editor--autocomplete{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;padding:var(--wg-cell-padding);padding-right:0;background:transparent;box-sizing:border-box}.wg__combobox-input,.wg__autocomplete-input{flex:1;width:100%;height:100%;padding:0 24px 0 0;border:none;background:transparent;color:var(--wg-text-color-1);font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base);outline:none;box-sizing:border-box;margin:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.wg__combobox-input:focus,.wg__autocomplete-input:focus{outline:none}.wg__combobox-toggle{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:var(--wg-dropdown-toggle-size);color:var(--wg-text-color-2);pointer-events:auto;cursor:pointer}.wg__combobox-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__loading-indicator{position:absolute;right:var(--wg-dropdown-toggle-right);top:50%;transform:translateY(-50%);font-size:12px;animation:wg-pulse 1s infinite}@keyframes wg-pulse{0%,to{opacity:1}50%{opacity:.4}}.wg__select-trigger{display:flex;align-items:center;justify-content:space-between;cursor:pointer;background:transparent}.wg__select-trigger:focus,.wg__select-trigger:focus-visible{outline:none;box-shadow:none}.wg__select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wg__select-toggle{position:relative;font-size:var(--wg-dropdown-toggle-size);opacity:.6;margin-left:4px;flex-shrink:0;pointer-events:auto;cursor:pointer}.wg__select-toggle:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-dropdown-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:0}.wg__cell:hover .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle,.wg__cell--focused .wg__cell-dropdown-display--toggle-on-focus .wg__select-toggle{opacity:.6}.wg__cell-date-display{display:flex;align-items:center;justify-content:space-between;width:100%;cursor:pointer}.wg__cell-date-display .wg__date-trigger{position:relative;background:none;border:none;padding:0;margin:0;cursor:pointer;opacity:.6;display:flex;align-items:center;justify-content:center;color:inherit}.wg__cell-date-display .wg__date-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:0}.wg__cell:hover .wg__cell-date-display--toggle-on-focus .wg__date-trigger,.wg__cell--focused .wg__cell-date-display--toggle-on-focus .wg__date-trigger{opacity:.6}.wg__dropdown{background:var(--wg-surface-floating, #fff);border:1px solid var(--wg-border-color, #d1d1d1);border-radius:4px;box-shadow:var(--wg-toolbar-shadow);max-height:200px;overflow-y:auto;font-size:var(--wg-font-size-base);font-family:inherit;line-height:var(--wg-line-height-base)}.wg__dropdown-option{display:flex;align-items:center;gap:var(--wg-spacing-sm);padding:6px 12px;cursor:pointer;color:var(--wg-text-color-1)}.wg__dropdown-option:hover,.wg__dropdown-option--highlighted{background:var(--wg-hover-bg, #f0f0f0)}.wg__dropdown-option--selected{background:var(--wg-accent-color-light, #e6f2ff)}.wg__dropdown-option--disabled{opacity:.5;cursor:not-allowed;pointer-events:none}.wg__dropdown-option-icon{flex-shrink:0;width:1.5em;text-align:center}.wg__dropdown-option-content{flex:1;min-width:0;overflow:hidden}.wg__dropdown-option-label{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-option-subtitle{display:block;font-size:var(--wg-font-size-sm);color:var(--wg-text-color-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.wg__dropdown-empty{padding:8px 12px;color:var(--wg-text-color-2);font-style:italic;text-align:center}.wg--navigate-mode .wg__cell{cursor:cell}.wg--navigate-mode .wg__cell:focus{outline:none}.wg--navigate-mode .wg__cell.wg__cell--focused{outline:2px solid var(--wg-focus-border-color, #217346);outline-offset:-2px}.wg__cell--focused:after{display:none}.wg__pagination{display:flex;align-items:center;justify-content:center;gap:var(--wg-pagination-gap);padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__pagination-btn{padding:var(--wg-pagination-btn-padding);background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-family:inherit;font-size:var(--wg-font-size-base);cursor:pointer;transition:all var(--wg-transition-fast)}.wg__pagination-btn:hover:not(:disabled){background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-btn:active:not(:disabled){background:var(--wg-pagination-btn-bg-active)}.wg__pagination-btn:disabled{opacity:var(--wg-pagination-btn-disabled-opacity);cursor:not-allowed}.wg__pagination-info{font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__pagination-count{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3);margin-left:4px}.wg__pagination-pagesize{display:flex;align-items:center;gap:6px}.wg__pagination-select{padding:4px 8px;background:var(--wg-pagination-btn-bg);border:var(--wg-pagination-btn-border);border-radius:var(--wg-pagination-btn-border-radius);color:var(--wg-cell-color);font-family:inherit;font-size:var(--wg-font-size-base);cursor:pointer}.wg__pagination-select:hover{background:var(--wg-pagination-btn-bg-hover);border:var(--wg-pagination-btn-border-hover)}.wg__pagination-select:focus{outline:2px solid var(--wg-accent-color);outline-offset:-2px}.wg__pagination-label{font-size:var(--wg-font-size-sm);color:var(--wg-text-color-3)}.wg__pagination--left{justify-content:flex-start}.wg__pagination--right{justify-content:flex-end}.wg__pagination--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__summary{display:flex;align-items:center;padding:var(--wg-pagination-padding);border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg);font-size:var(--wg-font-size-base);color:var(--wg-cell-color)}.wg__summary--left{justify-content:flex-start}.wg__summary--right{justify-content:flex-end}.wg__summary--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer{display:flex;align-items:center;justify-content:space-between;border-top:var(--wg-pagination-border);background:var(--wg-pagination-bg)}.wg__footer--top{border-top:none;border-bottom:var(--wg-pagination-border)}.wg__footer .wg__summary,.wg__footer .wg__pagination{border:none}.wg__footer .wg__summary{flex:0 0 auto}.wg__footer .wg__pagination{flex:0 0 auto;margin-left:auto}.wg__toolbar-container{position:fixed;z-index:var(--wg-z-toolbar, 1000)}.wg__toolbar{display:flex;flex-direction:column-reverse;gap:0;padding:0;background:var(--wg-toolbar-bg);border:var(--wg-toolbar-border);border-radius:var(--wg-toolbar-border-radius);box-shadow:var(--wg-toolbar-shadow)}.wg__toolbar-row{display:flex;gap:2px;align-items:center;height:calc(var(--wg-design-unit, 4) * 4px + 21px);padding:0 4px}.wg__toolbar-row+.wg__toolbar-row{border-top:1px solid var(--wg-toolbar-divider-color)}.wg__toolbar-divider{width:1px;height:16px;background:var(--wg-toolbar-divider-color);margin:0 4px;flex-shrink:0}.wg__toolbar-btn{min-width:var(--wg-toolbar-btn-min-width);height:100%;border:none;border-radius:var(--wg-toolbar-btn-border-radius);background:transparent;color:var(--wg-toolbar-btn-color);cursor:pointer;display:flex;align-items:center;justify-content:center;gap:4px;font-family:inherit;font-size:var(--wg-font-size-base);font-weight:500;padding:var(--wg-toolbar-btn-padding);transition:background .1s ease}.wg__toolbar-btn:hover{background:var(--wg-toolbar-btn-bg-hover)}.wg__toolbar-btn:active{background:var(--wg-toolbar-btn-bg-active)}.wg__toolbar-btn:disabled{opacity:.5;cursor:not-allowed}.wg__toolbar-btn:disabled:hover{background:transparent}.wg__toolbar-btn--danger:hover{background:var(--wg-danger-bg-light);color:var(--wg-danger-color)}.wg__toolbar-label{font-size:12px;white-space:nowrap}.wg__actions-column{width:24px;min-width:24px;max-width:24px;padding:0!important;text-align:center}.wg__header .wg__actions-column{background:var(--wg-header-bg)}.wg__filter-row .wg__actions-column{background:var(--wg-filter-bg)}.wg__toolbar-trigger{position:relative;padding:0;background:transparent;border:none;border-radius:var(--wg-border-radius-sm);cursor:pointer;font-size:var(--wg-font-size-base);line-height:1;color:var(--wg-toolbar-trigger-color)}.wg__toolbar-trigger:before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:var(--wg-dropdown-toggle-hitbox);height:48px}.wg__toolbar-trigger:hover,.wg__toolbar-trigger--active{color:var(--wg-toolbar-trigger-color-hover);background:var(--wg-toolbar-trigger-bg-hover)}.wg__shortcuts-help{position:absolute;top:var(--wg-spacing-xs);right:var(--wg-spacing-sm);z-index:5}.wg__shortcuts-help--left{right:auto;left:var(--wg-spacing-sm)}.wg__shortcuts-help-icon{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:50%;background:var(--wg-layer-01);color:var(--wg-text-color-2);cursor:pointer;opacity:.7}.wg__shortcuts-help-icon:hover{opacity:1;background:var(--wg-layer-02)}.wg__shortcuts-help-icon svg{width:16px;height:16px}.wg__shortcuts-help-overlay{display:none;position:absolute;top:100%;right:0;margin-top:var(--wg-spacing-xs);padding:var(--wg-spacing-md);background:var(--wg-layer-01);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-md);box-shadow:0 4px 16px #00000026;min-width:200px;max-width:300px;z-index:100}.wg__shortcuts-help--left .wg__shortcuts-help-overlay{right:auto;left:0}.wg__shortcuts-help:hover .wg__shortcuts-help-overlay,.wg__shortcuts-help:focus-within .wg__shortcuts-help-overlay{display:block}.wg__shortcuts-help-title{font-weight:var(--wg-font-weight-semibold);font-size:var(--wg-font-size-base);color:var(--wg-text-color-1);margin-bottom:var(--wg-spacing-sm);padding-bottom:var(--wg-spacing-xs);border-bottom:1px solid var(--wg-border-color)}.wg__shortcuts-help-custom{margin-bottom:var(--wg-spacing-sm);padding-bottom:var(--wg-spacing-sm);border-bottom:1px solid var(--wg-border-color);font-size:var(--wg-font-size-sm);color:var(--wg-text-color-2)}.wg__shortcuts-help-list{display:flex;flex-direction:column;gap:var(--wg-spacing-xs)}.wg__shortcuts-help-item{display:flex;align-items:center;gap:var(--wg-spacing-md)}.wg__shortcuts-help-key{display:inline-flex;align-items:center;justify-content:center;min-width:28px;padding:2px 6px;font-family:var(--wg-font-family-mono, ui-monospace, monospace);font-size:var(--wg-font-size-xs);font-weight:var(--wg-font-weight-medium);color:var(--wg-text-color-1);background:var(--wg-layer-02);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm)}.wg__shortcuts-help-label{flex:1;font-size:var(--wg-font-size-sm);color:var(--wg-text-color-2)}.wg--striped tbody tr:nth-child(2n){background:var(--wg-row-bg-even)}.wg--hoverable tbody tr:hover{background:var(--wg-row-bg-hover)}.wg__empty{text-align:center;padding:var(--wg-empty-padding);color:var(--wg-empty-color);font-style:italic}.wg__loading-more{text-align:center;padding:var(--wg-cell-padding);color:var(--wg-text-color-2);font-size:var(--wg-font-size-sm)}.wg__tooltip{position:fixed;z-index:var(--wg-z-tooltip, 10000);max-width:300px;padding:6px 10px;background:var(--wg-tooltip-bg, #333);color:var(--wg-tooltip-color, #fff);font-size:var(--wg-font-size-sm);line-height:1.4;border-radius:var(--wg-border-radius-sm);box-shadow:0 2px 8px #0003;pointer-events:none;opacity:0;transition:opacity var(--wg-transition-fast)}.wg__tooltip--visible{opacity:1}.wg__tooltip-arrow{position:absolute;width:8px;height:8px;background:var(--wg-tooltip-bg, #333);transform:rotate(45deg)}.wg__tooltip[data-placement^=top] .wg__tooltip-arrow{bottom:-4px}.wg__tooltip[data-placement^=bottom] .wg__tooltip-arrow{top:-4px}.wg__tooltip[data-placement^=left] .wg__tooltip-arrow{right:-4px}.wg__tooltip[data-placement^=right] .wg__tooltip-arrow{left:-4px}.wg__goto-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:1000}.wg__goto-dialog{background:var(--wg-surface-1);border-radius:var(--wg-border-radius);padding:var(--wg-spacing-lg);box-shadow:0 4px 20px #00000026;min-width:250px}.wg__goto-label{display:block;margin-bottom:var(--wg-spacing-sm);font-size:var(--wg-font-size-base);color:var(--wg-text-color-1)}.wg__goto-input{width:100%;padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-family:inherit;font-size:var(--wg-font-size-base);margin-bottom:var(--wg-spacing-md);box-sizing:border-box}.wg__goto-input:focus{outline:none;border-color:var(--wg-accent-color);box-shadow:0 0 0 2px #0078d433}.wg__goto-buttons{display:flex;gap:var(--wg-spacing-sm);justify-content:flex-end}.wg__goto-btn{padding:var(--wg-spacing-sm) var(--wg-spacing-md);border:1px solid var(--wg-border-color);border-radius:var(--wg-border-radius-sm);font-family:inherit;font-size:var(--wg-font-size-sm);cursor:pointer;background:var(--wg-surface-1);color:var(--wg-text-color-1)}.wg__goto-btn:hover{background:var(--wg-surface-2)}.wg__goto-btn--go{background:var(--wg-accent-color);border-color:var(--wg-accent-color);color:#fff}.wg__goto-btn--go:hover{background:var(--wg-accent-color-hover, #106ebe)}.wg__spacer-top td,.wg__spacer-bottom td{padding:0;border:none;background:transparent;height:inherit;line-height:0}@media (prefers-color-scheme: dark){:host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}}:host([data-theme="dark"]),[data-theme=dark] :host,:host([data-bs-theme="dark"]),[data-bs-theme=dark] :host,.dark :host{--wg-surface-1: #1f1f1f;--wg-surface-2: #2b2b2b;--wg-surface-3: #333333;--wg-surface-floating: #2b2b2b;--wg-text-color-1: #e0e0e0;--wg-text-color-2: #c0c0c0;--wg-text-color-3: #a0a0a0;--wg-border-color: #3d3d3d;--wg-border-color-hover: #5a5a5a;--wg-input-bg: #1f1f1f;--wg-input-border: 1px solid #5a5a5a;--wg-hover-bg: #3a3a3a;--wg-active-bg: #4a4a4a;--wg-danger-bg-light: #442726;--wg-danger-color: #f87c86}';
752
794
  function Jt(t, e, o) {
753
795
  const i = o.valueMember || "value", r = o.displayMember || "label", s = e.find((n) => n[i] === t);
754
796
  return s ? String(s[r] ?? "") : t != null ? String(t) : "";
@@ -769,7 +811,7 @@ function Ke(t, e) {
769
811
  function We(t, e) {
770
812
  return e.getSubtitleCallback ? e.getSubtitleCallback(t) : e.subtitleMember && t[e.subtitleMember] || null;
771
813
  }
772
- function mt(t, e) {
814
+ function bt(t, e) {
773
815
  return e.getDisabledCallback ? e.getDisabledCallback(t) : e.disabledMember ? !!t[e.disabledMember] : !1;
774
816
  }
775
817
  const it = Math.min, N = Math.max, Tt = Math.round, Dt = Math.floor, G = (t) => ({
@@ -787,13 +829,13 @@ const it = Math.min, N = Math.max, Tt = Math.round, Dt = Math.floor, G = (t) =>
787
829
  function Ut(t, e, o) {
788
830
  return N(t, it(e, o));
789
831
  }
790
- function pt(t, e) {
832
+ function ft(t, e) {
791
833
  return typeof t == "function" ? t(e) : t;
792
834
  }
793
835
  function rt(t) {
794
836
  return t.split("-")[0];
795
837
  }
796
- function ft(t) {
838
+ function wt(t) {
797
839
  return t.split("-")[1];
798
840
  }
799
841
  function ke(t) {
@@ -811,7 +853,7 @@ function te(t) {
811
853
  }
812
854
  function Je(t, e, o) {
813
855
  o === void 0 && (o = !1);
814
- const i = ft(t), r = te(t), s = Zt(r);
856
+ const i = wt(t), r = te(t), s = Zt(r);
815
857
  let n = r === "x" ? i === (o ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
816
858
  return e.reference[s] > e.floating[s] && (n = Et(n)), [n, Et(n)];
817
859
  }
@@ -836,7 +878,7 @@ function oo(t, e, o) {
836
878
  }
837
879
  }
838
880
  function io(t, e, o, i) {
839
- const r = ft(t);
881
+ const r = wt(t);
840
882
  let s = oo(rt(t), o === "start", i);
841
883
  return r && (s = s.map((n) => n + "-" + r), e && (s = s.concat(s.map(jt)))), s;
842
884
  }
@@ -883,31 +925,31 @@ function ce(t, e, o) {
883
925
  reference: i,
884
926
  floating: r
885
927
  } = t;
886
- const s = tt(e), n = te(e), d = Zt(n), a = rt(e), c = s === "y", l = i.x + i.width / 2 - r.width / 2, g = i.y + i.height / 2 - r.height / 2, h = i[d] / 2 - r[d] / 2;
928
+ const s = tt(e), n = te(e), d = Zt(n), a = rt(e), c = s === "y", g = i.x + i.width / 2 - r.width / 2, l = i.y + i.height / 2 - r.height / 2, h = i[d] / 2 - r[d] / 2;
887
929
  let u;
888
930
  switch (a) {
889
931
  case "top":
890
932
  u = {
891
- x: l,
933
+ x: g,
892
934
  y: i.y - r.height
893
935
  };
894
936
  break;
895
937
  case "bottom":
896
938
  u = {
897
- x: l,
939
+ x: g,
898
940
  y: i.y + i.height
899
941
  };
900
942
  break;
901
943
  case "right":
902
944
  u = {
903
945
  x: i.x + i.width,
904
- y: g
946
+ y: l
905
947
  };
906
948
  break;
907
949
  case "left":
908
950
  u = {
909
951
  x: i.x - r.width,
910
- y: g
952
+ y: l
911
953
  };
912
954
  break;
913
955
  default:
@@ -916,7 +958,7 @@ function ce(t, e, o) {
916
958
  y: i.y
917
959
  };
918
960
  }
919
- switch (ft(e)) {
961
+ switch (wt(e)) {
920
962
  case "start":
921
963
  u[n] -= h * (o && c ? -1 : 1);
922
964
  break;
@@ -938,21 +980,21 @@ const no = async (t, e, o) => {
938
980
  floating: e,
939
981
  strategy: r
940
982
  }), {
941
- x: l,
942
- y: g
983
+ x: g,
984
+ y: l
943
985
  } = ce(c, i, a), h = i, u = {}, p = 0;
944
986
  for (let m = 0; m < d.length; m++) {
945
987
  const {
946
- name: f,
947
- fn: b
988
+ name: b,
989
+ fn: f
948
990
  } = d[m], {
949
- x: v,
950
- y: _,
991
+ x: _,
992
+ y: v,
951
993
  data: S,
952
- reset: y
953
- } = await b({
954
- x: l,
955
- y: g,
994
+ reset: C
995
+ } = await f({
996
+ x: g,
997
+ y: l,
956
998
  initialPlacement: i,
957
999
  placement: h,
958
1000
  strategy: r,
@@ -964,24 +1006,24 @@ const no = async (t, e, o) => {
964
1006
  floating: e
965
1007
  }
966
1008
  });
967
- l = v ?? l, g = _ ?? g, u = {
1009
+ g = _ ?? g, l = v ?? l, u = {
968
1010
  ...u,
969
- [f]: {
970
- ...u[f],
1011
+ [b]: {
1012
+ ...u[b],
971
1013
  ...S
972
1014
  }
973
- }, y && p <= 50 && (p++, typeof y == "object" && (y.placement && (h = y.placement), y.rects && (c = y.rects === !0 ? await n.getElementRects({
1015
+ }, C && p <= 50 && (p++, typeof C == "object" && (C.placement && (h = C.placement), C.rects && (c = C.rects === !0 ? await n.getElementRects({
974
1016
  reference: t,
975
1017
  floating: e,
976
1018
  strategy: r
977
- }) : y.rects), {
978
- x: l,
979
- y: g
1019
+ }) : C.rects), {
1020
+ x: g,
1021
+ y: l
980
1022
  } = ce(c, h, a)), m = -1);
981
1023
  }
982
1024
  return {
983
- x: l,
984
- y: g,
1025
+ x: g,
1026
+ y: l,
985
1027
  placement: h,
986
1028
  strategy: r,
987
1029
  middlewareData: u
@@ -999,37 +1041,37 @@ async function ee(t, e) {
999
1041
  strategy: a
1000
1042
  } = t, {
1001
1043
  boundary: c = "clippingAncestors",
1002
- rootBoundary: l = "viewport",
1003
- elementContext: g = "floating",
1044
+ rootBoundary: g = "viewport",
1045
+ elementContext: l = "floating",
1004
1046
  altBoundary: h = !1,
1005
1047
  padding: u = 0
1006
- } = pt(e, t), p = De(u), f = d[h ? g === "floating" ? "reference" : "floating" : g], b = $t(await s.getClippingRect({
1007
- element: (o = await (s.isElement == null ? void 0 : s.isElement(f))) == null || o ? f : f.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(d.floating)),
1048
+ } = ft(e, t), p = De(u), b = d[h ? l === "floating" ? "reference" : "floating" : l], f = $t(await s.getClippingRect({
1049
+ element: (o = await (s.isElement == null ? void 0 : s.isElement(b))) == null || o ? b : b.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(d.floating)),
1008
1050
  boundary: c,
1009
- rootBoundary: l,
1051
+ rootBoundary: g,
1010
1052
  strategy: a
1011
- })), v = g === "floating" ? {
1053
+ })), _ = l === "floating" ? {
1012
1054
  x: i,
1013
1055
  y: r,
1014
1056
  width: n.floating.width,
1015
1057
  height: n.floating.height
1016
- } : n.reference, _ = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(d.floating)), S = await (s.isElement == null ? void 0 : s.isElement(_)) ? await (s.getScale == null ? void 0 : s.getScale(_)) || {
1058
+ } : n.reference, v = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(d.floating)), S = await (s.isElement == null ? void 0 : s.isElement(v)) ? await (s.getScale == null ? void 0 : s.getScale(v)) || {
1017
1059
  x: 1,
1018
1060
  y: 1
1019
1061
  } : {
1020
1062
  x: 1,
1021
1063
  y: 1
1022
- }, y = $t(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
1064
+ }, C = $t(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
1023
1065
  elements: d,
1024
- rect: v,
1025
- offsetParent: _,
1066
+ rect: _,
1067
+ offsetParent: v,
1026
1068
  strategy: a
1027
- }) : v);
1069
+ }) : _);
1028
1070
  return {
1029
- top: (b.top - y.top + p.top) / S.y,
1030
- bottom: (y.bottom - b.bottom + p.bottom) / S.y,
1031
- left: (b.left - y.left + p.left) / S.x,
1032
- right: (y.right - b.right + p.right) / S.x
1071
+ top: (f.top - C.top + p.top) / S.y,
1072
+ bottom: (C.bottom - f.bottom + p.bottom) / S.y,
1073
+ left: (f.left - C.left + p.left) / S.x,
1074
+ right: (C.right - f.right + p.right) / S.x
1033
1075
  };
1034
1076
  }
1035
1077
  const so = (t) => ({
@@ -1046,24 +1088,24 @@ const so = (t) => ({
1046
1088
  middlewareData: a
1047
1089
  } = e, {
1048
1090
  element: c,
1049
- padding: l = 0
1050
- } = pt(t, e) || {};
1091
+ padding: g = 0
1092
+ } = ft(t, e) || {};
1051
1093
  if (c == null)
1052
1094
  return {};
1053
- const g = De(l), h = {
1095
+ const l = De(g), h = {
1054
1096
  x: o,
1055
1097
  y: i
1056
- }, u = te(r), p = Zt(u), m = await n.getDimensions(c), f = u === "y", b = f ? "top" : "left", v = f ? "bottom" : "right", _ = f ? "clientHeight" : "clientWidth", S = s.reference[p] + s.reference[u] - h[u] - s.floating[p], y = h[u] - s.reference[u], D = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(c));
1057
- let x = D ? D[_] : 0;
1058
- (!x || !await (n.isElement == null ? void 0 : n.isElement(D))) && (x = d.floating[_] || s.floating[p]);
1059
- const C = S / 2 - y / 2, T = x / 2 - m[p] / 2 - 1, k = it(g[b], T), E = it(g[v], T), A = k, H = x - m[p] - E, O = x / 2 - m[p] / 2 + C, R = Ut(A, O, H), z = !a.arrow && ft(r) != null && O !== R && s.reference[p] / 2 - (O < A ? k : E) - m[p] / 2 < 0, F = z ? O < A ? O - A : O - H : 0;
1098
+ }, u = te(r), p = Zt(u), m = await n.getDimensions(c), b = u === "y", f = b ? "top" : "left", _ = b ? "bottom" : "right", v = b ? "clientHeight" : "clientWidth", S = s.reference[p] + s.reference[u] - h[u] - s.floating[p], C = h[u] - s.reference[u], x = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(c));
1099
+ let D = x ? x[v] : 0;
1100
+ (!D || !await (n.isElement == null ? void 0 : n.isElement(x))) && (D = d.floating[v] || s.floating[p]);
1101
+ const y = S / 2 - C / 2, T = D / 2 - m[p] / 2 - 1, k = it(l[f], T), E = it(l[_], T), A = k, I = D - m[p] - E, O = D / 2 - m[p] / 2 + y, H = Ut(A, O, I), z = !a.arrow && wt(r) != null && O !== H && s.reference[p] / 2 - (O < A ? k : E) - m[p] / 2 < 0, V = z ? O < A ? O - A : O - I : 0;
1060
1102
  return {
1061
- [u]: h[u] + F,
1103
+ [u]: h[u] + V,
1062
1104
  data: {
1063
- [u]: R,
1064
- centerOffset: O - R - F,
1105
+ [u]: H,
1106
+ centerOffset: O - H - V,
1065
1107
  ...z && {
1066
- alignmentOffset: F
1108
+ alignmentOffset: V
1067
1109
  }
1068
1110
  },
1069
1111
  reset: z
@@ -1083,57 +1125,57 @@ const so = (t) => ({
1083
1125
  platform: a,
1084
1126
  elements: c
1085
1127
  } = e, {
1086
- mainAxis: l = !0,
1087
- crossAxis: g = !0,
1128
+ mainAxis: g = !0,
1129
+ crossAxis: l = !0,
1088
1130
  fallbackPlacements: h,
1089
1131
  fallbackStrategy: u = "bestFit",
1090
1132
  fallbackAxisSideDirection: p = "none",
1091
1133
  flipAlignment: m = !0,
1092
- ...f
1093
- } = pt(t, e);
1134
+ ...b
1135
+ } = ft(t, e);
1094
1136
  if ((o = s.arrow) != null && o.alignmentOffset)
1095
1137
  return {};
1096
- const b = rt(r), v = tt(d), _ = rt(d) === d, S = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), y = h || (_ || !m ? [Et(d)] : Ze(d)), D = p !== "none";
1097
- !h && D && y.push(...io(d, m, p, S));
1098
- const x = [d, ...y], C = await ee(e, f), T = [];
1138
+ const f = rt(r), _ = tt(d), v = rt(d) === d, S = await (a.isRTL == null ? void 0 : a.isRTL(c.floating)), C = h || (v || !m ? [Et(d)] : Ze(d)), x = p !== "none";
1139
+ !h && x && C.push(...io(d, m, p, S));
1140
+ const D = [d, ...C], y = await ee(e, b), T = [];
1099
1141
  let k = ((i = s.flip) == null ? void 0 : i.overflows) || [];
1100
- if (l && T.push(C[b]), g) {
1142
+ if (g && T.push(y[f]), l) {
1101
1143
  const O = Je(r, n, S);
1102
- T.push(C[O[0]], C[O[1]]);
1144
+ T.push(y[O[0]], y[O[1]]);
1103
1145
  }
1104
1146
  if (k = [...k, {
1105
1147
  placement: r,
1106
1148
  overflows: T
1107
1149
  }], !T.every((O) => O <= 0)) {
1108
1150
  var E, A;
1109
- const O = (((E = s.flip) == null ? void 0 : E.index) || 0) + 1, R = x[O];
1110
- if (R && (!(g === "alignment" ? v !== tt(R) : !1) || // We leave the current main axis only if every placement on that axis
1151
+ const O = (((E = s.flip) == null ? void 0 : E.index) || 0) + 1, H = D[O];
1152
+ if (H && (!(l === "alignment" ? _ !== tt(H) : !1) || // We leave the current main axis only if every placement on that axis
1111
1153
  // overflows the main axis.
1112
- k.every((V) => tt(V.placement) === v ? V.overflows[0] > 0 : !0)))
1154
+ k.every((F) => tt(F.placement) === _ ? F.overflows[0] > 0 : !0)))
1113
1155
  return {
1114
1156
  data: {
1115
1157
  index: O,
1116
1158
  overflows: k
1117
1159
  },
1118
1160
  reset: {
1119
- placement: R
1161
+ placement: H
1120
1162
  }
1121
1163
  };
1122
- let z = (A = k.filter((F) => F.overflows[0] <= 0).sort((F, V) => F.overflows[1] - V.overflows[1])[0]) == null ? void 0 : A.placement;
1164
+ let z = (A = k.filter((V) => V.overflows[0] <= 0).sort((V, F) => V.overflows[1] - F.overflows[1])[0]) == null ? void 0 : A.placement;
1123
1165
  if (!z)
1124
1166
  switch (u) {
1125
1167
  case "bestFit": {
1126
- var H;
1127
- const F = (H = k.filter((V) => {
1128
- if (D) {
1129
- const P = tt(V.placement);
1130
- return P === v || // Create a bias to the `y` side axis due to horizontal
1168
+ var I;
1169
+ const V = (I = k.filter((F) => {
1170
+ if (x) {
1171
+ const R = tt(F.placement);
1172
+ return R === _ || // Create a bias to the `y` side axis due to horizontal
1131
1173
  // reading directions favoring greater width.
1132
- P === "y";
1174
+ R === "y";
1133
1175
  }
1134
1176
  return !0;
1135
- }).map((V) => [V.placement, V.overflows.filter((P) => P > 0).reduce((P, q) => P + q, 0)]).sort((V, P) => V[1] - P[1])[0]) == null ? void 0 : H[0];
1136
- F && (z = F);
1177
+ }).map((F) => [F.placement, F.overflows.filter((R) => R > 0).reduce((R, q) => R + q, 0)]).sort((F, R) => F[1] - R[1])[0]) == null ? void 0 : I[0];
1178
+ V && (z = V);
1137
1179
  break;
1138
1180
  }
1139
1181
  case "initialPlacement":
@@ -1156,26 +1198,26 @@ async function co(t, e) {
1156
1198
  placement: o,
1157
1199
  platform: i,
1158
1200
  elements: r
1159
- } = t, s = await (i.isRTL == null ? void 0 : i.isRTL(r.floating)), n = rt(o), d = ft(o), a = tt(o) === "y", c = lo.has(n) ? -1 : 1, l = s && a ? -1 : 1, g = pt(e, t);
1201
+ } = t, s = await (i.isRTL == null ? void 0 : i.isRTL(r.floating)), n = rt(o), d = wt(o), a = tt(o) === "y", c = lo.has(n) ? -1 : 1, g = s && a ? -1 : 1, l = ft(e, t);
1160
1202
  let {
1161
1203
  mainAxis: h,
1162
1204
  crossAxis: u,
1163
1205
  alignmentAxis: p
1164
- } = typeof g == "number" ? {
1165
- mainAxis: g,
1206
+ } = typeof l == "number" ? {
1207
+ mainAxis: l,
1166
1208
  crossAxis: 0,
1167
1209
  alignmentAxis: null
1168
1210
  } : {
1169
- mainAxis: g.mainAxis || 0,
1170
- crossAxis: g.crossAxis || 0,
1171
- alignmentAxis: g.alignmentAxis
1211
+ mainAxis: l.mainAxis || 0,
1212
+ crossAxis: l.crossAxis || 0,
1213
+ alignmentAxis: l.alignmentAxis
1172
1214
  };
1173
1215
  return d && typeof p == "number" && (u = d === "end" ? p * -1 : p), a ? {
1174
- x: u * l,
1216
+ x: u * g,
1175
1217
  y: h * c
1176
1218
  } : {
1177
1219
  x: h * c,
1178
- y: u * l
1220
+ y: u * g
1179
1221
  };
1180
1222
  }
1181
1223
  const go = function(t) {
@@ -1213,35 +1255,35 @@ const go = function(t) {
1213
1255
  mainAxis: s = !0,
1214
1256
  crossAxis: n = !1,
1215
1257
  limiter: d = {
1216
- fn: (f) => {
1258
+ fn: (b) => {
1217
1259
  let {
1218
- x: b,
1219
- y: v
1220
- } = f;
1260
+ x: f,
1261
+ y: _
1262
+ } = b;
1221
1263
  return {
1222
- x: b,
1223
- y: v
1264
+ x: f,
1265
+ y: _
1224
1266
  };
1225
1267
  }
1226
1268
  },
1227
1269
  ...a
1228
- } = pt(t, e), c = {
1270
+ } = ft(t, e), c = {
1229
1271
  x: o,
1230
1272
  y: i
1231
- }, l = await ee(e, a), g = tt(rt(r)), h = ke(g);
1232
- let u = c[h], p = c[g];
1273
+ }, g = await ee(e, a), l = tt(rt(r)), h = ke(l);
1274
+ let u = c[h], p = c[l];
1233
1275
  if (s) {
1234
- const f = h === "y" ? "top" : "left", b = h === "y" ? "bottom" : "right", v = u + l[f], _ = u - l[b];
1235
- u = Ut(v, u, _);
1276
+ const b = h === "y" ? "top" : "left", f = h === "y" ? "bottom" : "right", _ = u + g[b], v = u - g[f];
1277
+ u = Ut(_, u, v);
1236
1278
  }
1237
1279
  if (n) {
1238
- const f = g === "y" ? "top" : "left", b = g === "y" ? "bottom" : "right", v = p + l[f], _ = p - l[b];
1239
- p = Ut(v, p, _);
1280
+ const b = l === "y" ? "top" : "left", f = l === "y" ? "bottom" : "right", _ = p + g[b], v = p - g[f];
1281
+ p = Ut(_, p, v);
1240
1282
  }
1241
1283
  const m = d.fn({
1242
1284
  ...e,
1243
1285
  [h]: u,
1244
- [g]: p
1286
+ [l]: p
1245
1287
  });
1246
1288
  return {
1247
1289
  ...m,
@@ -1250,7 +1292,7 @@ const go = function(t) {
1250
1292
  y: m.y - i,
1251
1293
  enabled: {
1252
1294
  [h]: s,
1253
- [g]: n
1295
+ [l]: n
1254
1296
  }
1255
1297
  }
1256
1298
  };
@@ -1271,22 +1313,22 @@ const go = function(t) {
1271
1313
  apply: a = () => {
1272
1314
  },
1273
1315
  ...c
1274
- } = pt(t, e), l = await ee(e, c), g = rt(r), h = ft(r), u = tt(r) === "y", {
1316
+ } = ft(t, e), g = await ee(e, c), l = rt(r), h = wt(r), u = tt(r) === "y", {
1275
1317
  width: p,
1276
1318
  height: m
1277
1319
  } = s.floating;
1278
- let f, b;
1279
- g === "top" || g === "bottom" ? (f = g, b = h === (await (n.isRTL == null ? void 0 : n.isRTL(d.floating)) ? "start" : "end") ? "left" : "right") : (b = g, f = h === "end" ? "top" : "bottom");
1280
- const v = m - l.top - l.bottom, _ = p - l.left - l.right, S = it(m - l[f], v), y = it(p - l[b], _), D = !e.middlewareData.shift;
1281
- let x = S, C = y;
1282
- if ((o = e.middlewareData.shift) != null && o.enabled.x && (C = _), (i = e.middlewareData.shift) != null && i.enabled.y && (x = v), D && !h) {
1283
- const k = N(l.left, 0), E = N(l.right, 0), A = N(l.top, 0), H = N(l.bottom, 0);
1284
- u ? C = p - 2 * (k !== 0 || E !== 0 ? k + E : N(l.left, l.right)) : x = m - 2 * (A !== 0 || H !== 0 ? A + H : N(l.top, l.bottom));
1320
+ let b, f;
1321
+ l === "top" || l === "bottom" ? (b = l, f = h === (await (n.isRTL == null ? void 0 : n.isRTL(d.floating)) ? "start" : "end") ? "left" : "right") : (f = l, b = h === "end" ? "top" : "bottom");
1322
+ const _ = m - g.top - g.bottom, v = p - g.left - g.right, S = it(m - g[b], _), C = it(p - g[f], v), x = !e.middlewareData.shift;
1323
+ let D = S, y = C;
1324
+ if ((o = e.middlewareData.shift) != null && o.enabled.x && (y = v), (i = e.middlewareData.shift) != null && i.enabled.y && (D = _), x && !h) {
1325
+ const k = N(g.left, 0), E = N(g.right, 0), A = N(g.top, 0), I = N(g.bottom, 0);
1326
+ u ? y = p - 2 * (k !== 0 || E !== 0 ? k + E : N(g.left, g.right)) : D = m - 2 * (A !== 0 || I !== 0 ? A + I : N(g.top, g.bottom));
1285
1327
  }
1286
1328
  await a({
1287
1329
  ...e,
1288
- availableWidth: C,
1289
- availableHeight: x
1330
+ availableWidth: y,
1331
+ availableHeight: D
1290
1332
  });
1291
1333
  const T = await n.getDimensions(d.floating);
1292
1334
  return p !== T.width || m !== T.height ? {
@@ -1300,7 +1342,7 @@ const go = function(t) {
1300
1342
  function Ot() {
1301
1343
  return typeof window < "u";
1302
1344
  }
1303
- function wt(t) {
1345
+ function mt(t) {
1304
1346
  return Te(t) ? (t.nodeName || "").toLowerCase() : "#document";
1305
1347
  }
1306
1348
  function U(t) {
@@ -1335,10 +1377,10 @@ function St(t) {
1335
1377
  }
1336
1378
  const fo = /* @__PURE__ */ new Set(["table", "td", "th"]);
1337
1379
  function wo(t) {
1338
- return fo.has(wt(t));
1380
+ return fo.has(mt(t));
1339
1381
  }
1340
1382
  const mo = [":popover-open", ":modal"];
1341
- function Rt(t) {
1383
+ function Ht(t) {
1342
1384
  return mo.some((e) => {
1343
1385
  try {
1344
1386
  return t.matches(e);
@@ -1354,10 +1396,10 @@ function oe(t) {
1354
1396
  }
1355
1397
  function yo(t) {
1356
1398
  let e = nt(t);
1357
- for (; J(e) && !ht(e); ) {
1399
+ for (; J(e) && !pt(e); ) {
1358
1400
  if (oe(e))
1359
1401
  return e;
1360
- if (Rt(e))
1402
+ if (Ht(e))
1361
1403
  return null;
1362
1404
  e = nt(e);
1363
1405
  }
@@ -1367,13 +1409,13 @@ function ie() {
1367
1409
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1368
1410
  }
1369
1411
  const Co = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1370
- function ht(t) {
1371
- return Co.has(wt(t));
1412
+ function pt(t) {
1413
+ return Co.has(mt(t));
1372
1414
  }
1373
1415
  function Q(t) {
1374
1416
  return U(t).getComputedStyle(t);
1375
1417
  }
1376
- function Pt(t) {
1418
+ function Rt(t) {
1377
1419
  return X(t) ? {
1378
1420
  scrollLeft: t.scrollLeft,
1379
1421
  scrollTop: t.scrollTop
@@ -1383,7 +1425,7 @@ function Pt(t) {
1383
1425
  };
1384
1426
  }
1385
1427
  function nt(t) {
1386
- if (wt(t) === "html")
1428
+ if (mt(t) === "html")
1387
1429
  return t;
1388
1430
  const e = (
1389
1431
  // Step into the shadow DOM of the parent of a slotted node.
@@ -1396,7 +1438,7 @@ function nt(t) {
1396
1438
  }
1397
1439
  function Ee(t) {
1398
1440
  const e = nt(t);
1399
- return ht(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : J(e) && St(e) ? e : Ee(e);
1441
+ return pt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : J(e) && St(e) ? e : Ee(e);
1400
1442
  }
1401
1443
  function _t(t, e, o) {
1402
1444
  var i;
@@ -1456,28 +1498,28 @@ function lt(t, e, o, i) {
1456
1498
  let n = G(1);
1457
1499
  e && (i ? X(i) && (n = ut(i)) : n = ut(t));
1458
1500
  const d = xo(s, o, i) ? Me(s) : G(0);
1459
- let a = (r.left + d.x) / n.x, c = (r.top + d.y) / n.y, l = r.width / n.x, g = r.height / n.y;
1501
+ let a = (r.left + d.x) / n.x, c = (r.top + d.y) / n.y, g = r.width / n.x, l = r.height / n.y;
1460
1502
  if (s) {
1461
1503
  const h = U(s), u = i && X(i) ? U(i) : i;
1462
1504
  let p = h, m = Bt(p);
1463
1505
  for (; m && i && u !== p; ) {
1464
- const f = ut(m), b = m.getBoundingClientRect(), v = Q(m), _ = b.left + (m.clientLeft + parseFloat(v.paddingLeft)) * f.x, S = b.top + (m.clientTop + parseFloat(v.paddingTop)) * f.y;
1465
- a *= f.x, c *= f.y, l *= f.x, g *= f.y, a += _, c += S, p = U(m), m = Bt(p);
1506
+ const b = ut(m), f = m.getBoundingClientRect(), _ = Q(m), v = f.left + (m.clientLeft + parseFloat(_.paddingLeft)) * b.x, S = f.top + (m.clientTop + parseFloat(_.paddingTop)) * b.y;
1507
+ a *= b.x, c *= b.y, g *= b.x, l *= b.y, a += v, c += S, p = U(m), m = Bt(p);
1466
1508
  }
1467
1509
  }
1468
1510
  return $t({
1469
- width: l,
1470
- height: g,
1511
+ width: g,
1512
+ height: l,
1471
1513
  x: a,
1472
1514
  y: c
1473
1515
  });
1474
1516
  }
1475
- function It(t, e) {
1476
- const o = Pt(t).scrollLeft;
1517
+ function Pt(t, e) {
1518
+ const o = Rt(t).scrollLeft;
1477
1519
  return e ? e.left + o : lt(Z(t)).left + o;
1478
1520
  }
1479
1521
  function Ae(t, e) {
1480
- const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft - It(t, o), r = o.top + e.scrollTop;
1522
+ const o = t.getBoundingClientRect(), i = o.left + e.scrollLeft - Pt(t, o), r = o.top + e.scrollTop;
1481
1523
  return {
1482
1524
  x: i,
1483
1525
  y: r
@@ -1490,32 +1532,32 @@ function ko(t) {
1490
1532
  offsetParent: i,
1491
1533
  strategy: r
1492
1534
  } = t;
1493
- const s = r === "fixed", n = Z(i), d = e ? Rt(e.floating) : !1;
1535
+ const s = r === "fixed", n = Z(i), d = e ? Ht(e.floating) : !1;
1494
1536
  if (i === n || d && s)
1495
1537
  return o;
1496
1538
  let a = {
1497
1539
  scrollLeft: 0,
1498
1540
  scrollTop: 0
1499
1541
  }, c = G(1);
1500
- const l = G(0), g = J(i);
1501
- if ((g || !g && !s) && ((wt(i) !== "body" || St(n)) && (a = Pt(i)), J(i))) {
1542
+ const g = G(0), l = J(i);
1543
+ if ((l || !l && !s) && ((mt(i) !== "body" || St(n)) && (a = Rt(i)), J(i))) {
1502
1544
  const u = lt(i);
1503
- c = ut(i), l.x = u.x + i.clientLeft, l.y = u.y + i.clientTop;
1545
+ c = ut(i), g.x = u.x + i.clientLeft, g.y = u.y + i.clientTop;
1504
1546
  }
1505
- const h = n && !g && !s ? Ae(n, a) : G(0);
1547
+ const h = n && !l && !s ? Ae(n, a) : G(0);
1506
1548
  return {
1507
1549
  width: o.width * c.x,
1508
1550
  height: o.height * c.y,
1509
- x: o.x * c.x - a.scrollLeft * c.x + l.x + h.x,
1510
- y: o.y * c.y - a.scrollTop * c.y + l.y + h.y
1551
+ x: o.x * c.x - a.scrollLeft * c.x + g.x + h.x,
1552
+ y: o.y * c.y - a.scrollTop * c.y + g.y + h.y
1511
1553
  };
1512
1554
  }
1513
1555
  function Do(t) {
1514
1556
  return Array.from(t.getClientRects());
1515
1557
  }
1516
1558
  function To(t) {
1517
- const e = Z(t), o = Pt(t), i = t.ownerDocument.body, r = N(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), s = N(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
1518
- let n = -o.scrollLeft + It(t);
1559
+ const e = Z(t), o = Rt(t), i = t.ownerDocument.body, r = N(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), s = N(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
1560
+ let n = -o.scrollLeft + Pt(t);
1519
1561
  const d = -o.scrollTop;
1520
1562
  return Q(i).direction === "rtl" && (n += N(e.clientWidth, i.clientWidth) - r), {
1521
1563
  width: r,
@@ -1530,12 +1572,12 @@ function Eo(t, e) {
1530
1572
  let s = i.clientWidth, n = i.clientHeight, d = 0, a = 0;
1531
1573
  if (r) {
1532
1574
  s = r.width, n = r.height;
1533
- const l = ie();
1534
- (!l || l && e === "fixed") && (d = r.offsetLeft, a = r.offsetTop);
1575
+ const g = ie();
1576
+ (!g || g && e === "fixed") && (d = r.offsetLeft, a = r.offsetTop);
1535
1577
  }
1536
- const c = It(i);
1578
+ const c = Pt(i);
1537
1579
  if (c <= 0) {
1538
- const l = i.ownerDocument, g = l.body, h = getComputedStyle(g), u = l.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, p = Math.abs(i.clientWidth - g.clientWidth - u);
1580
+ const g = i.ownerDocument, l = g.body, h = getComputedStyle(l), u = g.compatMode === "CSS1Compat" && parseFloat(h.marginLeft) + parseFloat(h.marginRight) || 0, p = Math.abs(i.clientWidth - l.clientWidth - u);
1539
1581
  p <= ue && (s -= p);
1540
1582
  } else c <= ue && (s += c);
1541
1583
  return {
@@ -1576,18 +1618,18 @@ function he(t, e, o) {
1576
1618
  }
1577
1619
  function Oe(t, e) {
1578
1620
  const o = nt(t);
1579
- return o === e || !X(o) || ht(o) ? !1 : Q(o).position === "fixed" || Oe(o, e);
1621
+ return o === e || !X(o) || pt(o) ? !1 : Q(o).position === "fixed" || Oe(o, e);
1580
1622
  }
1581
1623
  function Ao(t, e) {
1582
1624
  const o = e.get(t);
1583
1625
  if (o)
1584
1626
  return o;
1585
- let i = _t(t, [], !1).filter((d) => X(d) && wt(d) !== "body"), r = null;
1627
+ let i = _t(t, [], !1).filter((d) => X(d) && mt(d) !== "body"), r = null;
1586
1628
  const s = Q(t).position === "fixed";
1587
1629
  let n = s ? nt(t) : t;
1588
- for (; X(n) && !ht(n); ) {
1630
+ for (; X(n) && !pt(n); ) {
1589
1631
  const d = Q(n), a = oe(n);
1590
- !a && d.position === "fixed" && (r = null), (s ? !a && !r : !a && d.position === "static" && !!r && $o.has(r.position) || St(n) && !a && Oe(t, n)) ? i = i.filter((l) => l !== n) : r = d, n = nt(n);
1632
+ !a && d.position === "fixed" && (r = null), (s ? !a && !r : !a && d.position === "static" && !!r && $o.has(r.position) || St(n) && !a && Oe(t, n)) ? i = i.filter((g) => g !== n) : r = d, n = nt(n);
1591
1633
  }
1592
1634
  return e.set(t, i), i;
1593
1635
  }
@@ -1598,9 +1640,9 @@ function Oo(t) {
1598
1640
  rootBoundary: i,
1599
1641
  strategy: r
1600
1642
  } = t;
1601
- const n = [...o === "clippingAncestors" ? Rt(e) ? [] : Ao(e, this._c) : [].concat(o), i], d = n[0], a = n.reduce((c, l) => {
1602
- const g = he(e, l, r);
1603
- return c.top = N(g.top, c.top), c.right = it(g.right, c.right), c.bottom = it(g.bottom, c.bottom), c.left = N(g.left, c.left), c;
1643
+ const n = [...o === "clippingAncestors" ? Ht(e) ? [] : Ao(e, this._c) : [].concat(o), i], d = n[0], a = n.reduce((c, g) => {
1644
+ const l = he(e, g, r);
1645
+ return c.top = N(l.top, c.top), c.right = it(l.right, c.right), c.bottom = it(l.bottom, c.bottom), c.left = N(l.left, c.left), c;
1604
1646
  }, he(e, d, r));
1605
1647
  return {
1606
1648
  width: a.right - a.left,
@@ -1609,7 +1651,7 @@ function Oo(t) {
1609
1651
  y: a.top
1610
1652
  };
1611
1653
  }
1612
- function Ro(t) {
1654
+ function Ho(t) {
1613
1655
  const {
1614
1656
  width: e,
1615
1657
  height: o
@@ -1619,7 +1661,7 @@ function Ro(t) {
1619
1661
  height: o
1620
1662
  };
1621
1663
  }
1622
- function Po(t, e, o) {
1664
+ function Ro(t, e, o) {
1623
1665
  const i = J(e), r = Z(e), s = o === "fixed", n = lt(t, !0, s, e);
1624
1666
  let d = {
1625
1667
  scrollLeft: 0,
@@ -1627,23 +1669,23 @@ function Po(t, e, o) {
1627
1669
  };
1628
1670
  const a = G(0);
1629
1671
  function c() {
1630
- a.x = It(r);
1672
+ a.x = Pt(r);
1631
1673
  }
1632
1674
  if (i || !i && !s)
1633
- if ((wt(e) !== "body" || St(r)) && (d = Pt(e)), i) {
1675
+ if ((mt(e) !== "body" || St(r)) && (d = Rt(e)), i) {
1634
1676
  const u = lt(e, !0, s, e);
1635
1677
  a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
1636
1678
  } else r && c();
1637
1679
  s && !i && r && c();
1638
- const l = r && !i && !s ? Ae(r, d) : G(0), g = n.left + d.scrollLeft - a.x - l.x, h = n.top + d.scrollTop - a.y - l.y;
1680
+ const g = r && !i && !s ? Ae(r, d) : G(0), l = n.left + d.scrollLeft - a.x - g.x, h = n.top + d.scrollTop - a.y - g.y;
1639
1681
  return {
1640
- x: g,
1682
+ x: l,
1641
1683
  y: h,
1642
1684
  width: n.width,
1643
1685
  height: n.height
1644
1686
  };
1645
1687
  }
1646
- function Ht(t) {
1688
+ function It(t) {
1647
1689
  return Q(t).position === "static";
1648
1690
  }
1649
1691
  function pe(t, e) {
@@ -1654,28 +1696,28 @@ function pe(t, e) {
1654
1696
  let o = t.offsetParent;
1655
1697
  return Z(t) === o && (o = o.ownerDocument.body), o;
1656
1698
  }
1657
- function Re(t, e) {
1699
+ function He(t, e) {
1658
1700
  const o = U(t);
1659
- if (Rt(t))
1701
+ if (Ht(t))
1660
1702
  return o;
1661
1703
  if (!J(t)) {
1662
1704
  let r = nt(t);
1663
- for (; r && !ht(r); ) {
1664
- if (X(r) && !Ht(r))
1705
+ for (; r && !pt(r); ) {
1706
+ if (X(r) && !It(r))
1665
1707
  return r;
1666
1708
  r = nt(r);
1667
1709
  }
1668
1710
  return o;
1669
1711
  }
1670
1712
  let i = pe(t, e);
1671
- for (; i && wo(i) && Ht(i); )
1713
+ for (; i && wo(i) && It(i); )
1672
1714
  i = pe(i, e);
1673
- return i && ht(i) && Ht(i) && !oe(i) ? o : i || yo(t) || o;
1715
+ return i && pt(i) && It(i) && !oe(i) ? o : i || yo(t) || o;
1674
1716
  }
1675
- const Io = async function(t) {
1676
- const e = this.getOffsetParent || Re, o = this.getDimensions, i = await o(t.floating);
1717
+ const Po = async function(t) {
1718
+ const e = this.getOffsetParent || He, o = this.getDimensions, i = await o(t.floating);
1677
1719
  return {
1678
- reference: Po(t.reference, await e(t.floating), t.strategy),
1720
+ reference: Ro(t.reference, await e(t.floating), t.strategy),
1679
1721
  floating: {
1680
1722
  x: 0,
1681
1723
  y: 0,
@@ -1687,19 +1729,19 @@ const Io = async function(t) {
1687
1729
  function Lo(t) {
1688
1730
  return Q(t).direction === "rtl";
1689
1731
  }
1690
- const Ho = {
1732
+ const Io = {
1691
1733
  convertOffsetParentRelativeRectToViewportRelativeRect: ko,
1692
1734
  getDocumentElement: Z,
1693
1735
  getClippingRect: Oo,
1694
- getOffsetParent: Re,
1695
- getElementRects: Io,
1736
+ getOffsetParent: He,
1737
+ getElementRects: Po,
1696
1738
  getClientRects: Do,
1697
- getDimensions: Ro,
1739
+ getDimensions: Ho,
1698
1740
  getScale: ut,
1699
1741
  isElement: X,
1700
1742
  isRTL: Lo
1701
1743
  };
1702
- function Pe(t, e) {
1744
+ function Re(t, e) {
1703
1745
  return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1704
1746
  }
1705
1747
  function zo(t, e) {
@@ -1712,43 +1754,43 @@ function zo(t, e) {
1712
1754
  function n(d, a) {
1713
1755
  d === void 0 && (d = !1), a === void 0 && (a = 1), s();
1714
1756
  const c = t.getBoundingClientRect(), {
1715
- left: l,
1716
- top: g,
1757
+ left: g,
1758
+ top: l,
1717
1759
  width: h,
1718
1760
  height: u
1719
1761
  } = c;
1720
1762
  if (d || e(), !h || !u)
1721
1763
  return;
1722
- const p = Dt(g), m = Dt(r.clientWidth - (l + h)), f = Dt(r.clientHeight - (g + u)), b = Dt(l), _ = {
1723
- rootMargin: -p + "px " + -m + "px " + -f + "px " + -b + "px",
1764
+ const p = Dt(l), m = Dt(r.clientWidth - (g + h)), b = Dt(r.clientHeight - (l + u)), f = Dt(g), v = {
1765
+ rootMargin: -p + "px " + -m + "px " + -b + "px " + -f + "px",
1724
1766
  threshold: N(0, it(1, a)) || 1
1725
1767
  };
1726
1768
  let S = !0;
1727
- function y(D) {
1728
- const x = D[0].intersectionRatio;
1729
- if (x !== a) {
1769
+ function C(x) {
1770
+ const D = x[0].intersectionRatio;
1771
+ if (D !== a) {
1730
1772
  if (!S)
1731
1773
  return n();
1732
- x ? n(!1, x) : i = setTimeout(() => {
1774
+ D ? n(!1, D) : i = setTimeout(() => {
1733
1775
  n(!1, 1e-7);
1734
1776
  }, 1e3);
1735
1777
  }
1736
- x === 1 && !Pe(c, t.getBoundingClientRect()) && n(), S = !1;
1778
+ D === 1 && !Re(c, t.getBoundingClientRect()) && n(), S = !1;
1737
1779
  }
1738
1780
  try {
1739
- o = new IntersectionObserver(y, {
1740
- ..._,
1781
+ o = new IntersectionObserver(C, {
1782
+ ...v,
1741
1783
  // Handle <iframe>s
1742
1784
  root: r.ownerDocument
1743
1785
  });
1744
1786
  } catch {
1745
- o = new IntersectionObserver(y, _);
1787
+ o = new IntersectionObserver(C, v);
1746
1788
  }
1747
1789
  o.observe(t);
1748
1790
  }
1749
1791
  return n(!0), s;
1750
1792
  }
1751
- function Fo(t, e, o, i) {
1793
+ function Vo(t, e, o, i) {
1752
1794
  i === void 0 && (i = {});
1753
1795
  const {
1754
1796
  ancestorScroll: r = !0,
@@ -1756,37 +1798,37 @@ function Fo(t, e, o, i) {
1756
1798
  elementResize: n = typeof ResizeObserver == "function",
1757
1799
  layoutShift: d = typeof IntersectionObserver == "function",
1758
1800
  animationFrame: a = !1
1759
- } = i, c = re(t), l = r || s ? [...c ? _t(c) : [], ..._t(e)] : [];
1760
- l.forEach((b) => {
1761
- r && b.addEventListener("scroll", o, {
1801
+ } = i, c = re(t), g = r || s ? [...c ? _t(c) : [], ..._t(e)] : [];
1802
+ g.forEach((f) => {
1803
+ r && f.addEventListener("scroll", o, {
1762
1804
  passive: !0
1763
- }), s && b.addEventListener("resize", o);
1805
+ }), s && f.addEventListener("resize", o);
1764
1806
  });
1765
- const g = c && d ? zo(c, o) : null;
1807
+ const l = c && d ? zo(c, o) : null;
1766
1808
  let h = -1, u = null;
1767
- n && (u = new ResizeObserver((b) => {
1768
- let [v] = b;
1769
- v && v.target === c && u && (u.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
1770
- var _;
1771
- (_ = u) == null || _.observe(e);
1809
+ n && (u = new ResizeObserver((f) => {
1810
+ let [_] = f;
1811
+ _ && _.target === c && u && (u.unobserve(e), cancelAnimationFrame(h), h = requestAnimationFrame(() => {
1812
+ var v;
1813
+ (v = u) == null || v.observe(e);
1772
1814
  })), o();
1773
1815
  }), c && !a && u.observe(c), u.observe(e));
1774
1816
  let p, m = a ? lt(t) : null;
1775
- a && f();
1776
- function f() {
1777
- const b = lt(t);
1778
- m && !Pe(m, b) && o(), m = b, p = requestAnimationFrame(f);
1817
+ a && b();
1818
+ function b() {
1819
+ const f = lt(t);
1820
+ m && !Re(m, f) && o(), m = f, p = requestAnimationFrame(b);
1779
1821
  }
1780
1822
  return o(), () => {
1781
- var b;
1782
- l.forEach((v) => {
1783
- r && v.removeEventListener("scroll", o), s && v.removeEventListener("resize", o);
1784
- }), g == null || g(), (b = u) == null || b.disconnect(), u = null, a && cancelAnimationFrame(p);
1823
+ var f;
1824
+ g.forEach((_) => {
1825
+ r && _.removeEventListener("scroll", o), s && _.removeEventListener("resize", o);
1826
+ }), l == null || l(), (f = u) == null || f.disconnect(), u = null, a && cancelAnimationFrame(p);
1785
1827
  };
1786
1828
  }
1787
- const Lt = go, ne = uo, xt = ao, Vo = ho, qo = so, kt = (t, e, o) => {
1829
+ const Lt = go, ne = uo, xt = ao, Fo = ho, qo = so, kt = (t, e, o) => {
1788
1830
  const i = /* @__PURE__ */ new Map(), r = {
1789
- platform: Ho,
1831
+ platform: Io,
1790
1832
  ...o
1791
1833
  }, s = {
1792
1834
  ...r.platform,
@@ -1813,19 +1855,19 @@ function dt(t, e, o, i) {
1813
1855
  else {
1814
1856
  const n = t.grid.editingCell, d = n ? (s = t.grid.displayItems[n.rowIndex]) == null ? void 0 : s[n.field] : void 0;
1815
1857
  r.innerHTML = o.map((a, c) => {
1816
- const l = c === t.highlightedIndex, g = at(a, i) === d, h = mt(a, i);
1858
+ const g = c === t.highlightedIndex, l = at(a, i) === d, h = bt(a, i);
1817
1859
  if (i.renderOptionCallback) {
1818
- const _ = { index: c, isHighlighted: l, isSelected: g, isDisabled: h };
1819
- return i.renderOptionCallback(a, _);
1860
+ const v = { index: c, isHighlighted: g, isSelected: l, isDisabled: h };
1861
+ return i.renderOptionCallback(a, v);
1820
1862
  }
1821
- const u = Ct(a, i), p = Ke(a, i), m = We(a, i), f = ["wg__dropdown-option"];
1822
- l && f.push("wg__dropdown-option--highlighted"), g && f.push("wg__dropdown-option--selected"), h && f.push("wg__dropdown-option--disabled");
1823
- const b = p ? `<span class="wg__dropdown-option-icon">${t.escapeHtml(p)}</span>` : "", v = m ? `<span class="wg__dropdown-option-subtitle">${t.escapeHtml(m)}</span>` : "";
1824
- return `<div class="${f.join(" ")}" data-index="${c}" ${h ? 'data-disabled="true"' : ""}>
1825
- ${b}
1863
+ const u = Ct(a, i), p = Ke(a, i), m = We(a, i), b = ["wg__dropdown-option"];
1864
+ g && b.push("wg__dropdown-option--highlighted"), l && b.push("wg__dropdown-option--selected"), h && b.push("wg__dropdown-option--disabled");
1865
+ const f = p ? `<span class="wg__dropdown-option-icon">${t.escapeHtml(p)}</span>` : "", _ = m ? `<span class="wg__dropdown-option-subtitle">${t.escapeHtml(m)}</span>` : "";
1866
+ return `<div class="${b.join(" ")}" data-index="${c}" ${h ? 'data-disabled="true"' : ""}>
1867
+ ${f}
1826
1868
  <div class="wg__dropdown-option-content">
1827
1869
  <span class="wg__dropdown-option-label">${t.escapeHtml(u)}</span>
1828
- ${v}
1870
+ ${_}
1829
1871
  </div>
1830
1872
  </div>`;
1831
1873
  }).join("");
@@ -1837,7 +1879,7 @@ function dt(t, e, o, i) {
1837
1879
  // Add 1px gap to prevent sub-pixel overlap with cell border
1838
1880
  Lt(1),
1839
1881
  xt({ fallbackPlacements: ["top-start"] }),
1840
- Vo({
1882
+ Fo({
1841
1883
  apply({ rects: n }) {
1842
1884
  Object.assign(r.style, {
1843
1885
  width: `${n.reference.width}px`
@@ -1856,13 +1898,13 @@ function L(t) {
1856
1898
  const e = t.shadow.querySelector(".wg__dropdown");
1857
1899
  e == null || e.remove(), t.dropdownOpen = !1, t.highlightedIndex = -1, t.filterText = "";
1858
1900
  }
1859
- function Ie(t, e, o = !0) {
1901
+ function Pe(t, e, o = !0) {
1860
1902
  const i = t.dropdownOptions[e];
1861
1903
  if (!i) return;
1862
1904
  const r = t.grid.editingCell;
1863
1905
  if (!r) return;
1864
1906
  const s = t.getCurrentEditorOptions();
1865
- if (mt(i, s)) return;
1907
+ if (bt(i, s)) return;
1866
1908
  const n = at(i, s), d = t.grid.columns.findIndex((c) => String(c.field) === r.field), a = t.grid.displayItems[r.rowIndex];
1867
1909
  if (s.onselect && a && s.onselect(i, a), t.justSelected = !0, t.isCommittingFromKeyboard = !0, L(t), t.grid.commitEdit(r.rowIndex, r.field, n), o)
1868
1910
  t.moveFocusAfterCommit(r.rowIndex, r.field, "down");
@@ -1908,10 +1950,10 @@ function W(t) {
1908
1950
  t.dropdownOptions = n;
1909
1951
  const d = t.grid.editingCell;
1910
1952
  if (d) {
1911
- const a = t.grid.displayItems[d.rowIndex], c = a ? a[d.field] : void 0, l = t.dropdownOptions.findIndex(
1912
- (g) => at(g, o) === c
1953
+ const a = t.grid.displayItems[d.rowIndex], c = a ? a[d.field] : void 0, g = t.dropdownOptions.findIndex(
1954
+ (l) => at(l, o) === c
1913
1955
  );
1914
- r = l >= 0 ? l : 0;
1956
+ r = g >= 0 ? g : 0;
1915
1957
  } else
1916
1958
  r = t.dropdownOptions.length > 0 ? 0 : -1;
1917
1959
  }
@@ -1919,22 +1961,22 @@ function W(t) {
1919
1961
  const n = i === "autocomplete" ? o.initialOptions || o.options || [] : o.options || [], d = t.grid.editingCell;
1920
1962
  let a;
1921
1963
  if (d) {
1922
- const l = t.grid.displayItems[d.rowIndex];
1923
- a = l ? l[d.field] : void 0;
1964
+ const g = t.grid.displayItems[d.rowIndex];
1965
+ a = g ? g[d.field] : void 0;
1924
1966
  }
1925
1967
  const c = n.findIndex(
1926
- (l) => at(l, o) === a
1968
+ (g) => at(g, o) === a
1927
1969
  );
1928
1970
  if (c >= 0)
1929
1971
  t.dropdownOptions = n, r = c;
1930
1972
  else if (a != null && a !== "") {
1931
- const l = o.valueMember || "value", g = o.displayMember || "label", h = String(a), u = {
1973
+ const g = o.valueMember || "value", l = o.displayMember || "label", h = String(a), u = {
1932
1974
  // Required base properties
1933
1975
  value: a,
1934
1976
  label: h,
1935
1977
  // Custom member properties (may override above if different)
1936
- [l]: a,
1937
- [g]: h
1978
+ [g]: a,
1979
+ [l]: h
1938
1980
  };
1939
1981
  t.dropdownOptions = [u, ...n], r = 0;
1940
1982
  } else
@@ -1946,8 +1988,8 @@ function W(t) {
1946
1988
  t.isOpeningDropdown = !0;
1947
1989
  const d = dt(t, s, t.dropdownOptions, o);
1948
1990
  ct(t, d), t.filterText = n, t.highlightedIndex = r, et(t);
1949
- const a = t.shadow.querySelector(".wg__select-trigger"), c = t.shadow.querySelector(".wg__combobox-input, .wg__autocomplete-input"), l = a || c;
1950
- l && l.focus(), requestAnimationFrame(() => {
1991
+ const a = t.shadow.querySelector(".wg__select-trigger"), c = t.shadow.querySelector(".wg__combobox-input, .wg__autocomplete-input"), g = a || c;
1992
+ g && g.focus(), requestAnimationFrame(() => {
1951
1993
  t.isOpeningDropdown = !1;
1952
1994
  });
1953
1995
  }
@@ -1961,7 +2003,7 @@ function ct(t, e) {
1961
2003
  const i = o.target.closest(".wg__dropdown-option");
1962
2004
  if (i && !i.hasAttribute("data-disabled")) {
1963
2005
  const r = parseInt(i.getAttribute("data-index") || "0", 10);
1964
- Ie(t, r, !1);
2006
+ Pe(t, r, !1);
1965
2007
  }
1966
2008
  }), e.addEventListener("mouseover", (o) => {
1967
2009
  const i = o.target.closest(".wg__dropdown-option");
@@ -2083,9 +2125,9 @@ function Bo(t, e, o, i) {
2083
2125
  xt({ fallbackPlacements: ["bottom", "left", "right"] }),
2084
2126
  qo({ element: n })
2085
2127
  ]
2086
- }).then(({ x: a, y: c, placement: l, middlewareData: g }) => {
2087
- if (r.style.left = `${a}px`, r.style.top = `${c}px`, r.setAttribute("data-placement", l), g.arrow) {
2088
- const { x: h, y: u } = g.arrow;
2128
+ }).then(({ x: a, y: c, placement: g, middlewareData: l }) => {
2129
+ if (r.style.left = `${a}px`, r.style.top = `${c}px`, r.setAttribute("data-placement", g), l.arrow) {
2130
+ const { x: h, y: u } = l.arrow;
2089
2131
  h != null && (n.style.left = `${h}px`), u != null && (n.style.top = `${u}px`);
2090
2132
  }
2091
2133
  requestAnimationFrame(() => {
@@ -2119,8 +2161,8 @@ function Ko(t, e, o) {
2119
2161
  function Wo(t, e) {
2120
2162
  const o = t.shadow.querySelector(".wg");
2121
2163
  if (!o) return;
2122
- const i = t.grid.virtualScrollRowHeight, r = o.scrollTop, s = o.clientHeight, n = t.shadow.querySelector(".wg__header"), d = (n == null ? void 0 : n.offsetHeight) || 0, a = e * i, c = a + i, l = r + d, g = r + s;
2123
- a < l ? o.scrollTop = a - d : c > g && (o.scrollTop = c - s);
2164
+ const i = t.grid.virtualScrollRowHeight, r = o.scrollTop, s = o.clientHeight, n = t.shadow.querySelector(".wg__header"), d = (n == null ? void 0 : n.offsetHeight) || 0, a = e * i, c = a + i, g = r + d, l = r + s;
2165
+ a < g ? o.scrollTop = a - d : c > l && (o.scrollTop = c - s);
2124
2166
  }
2125
2167
  function st(t, e) {
2126
2168
  const o = t.shadow.querySelector(".wg");
@@ -2181,13 +2223,13 @@ function zt(t, e) {
2181
2223
  let a = 0, c = i.length;
2182
2224
  try {
2183
2225
  for (; a < c; ) {
2184
- const l = Math.floor((a + c) / 2);
2185
- d.setStart(n, 0), d.setEnd(n, l), d.getBoundingClientRect().right < r ? a = l + 1 : c = l;
2226
+ const g = Math.floor((a + c) / 2);
2227
+ d.setStart(n, 0), d.setEnd(n, g), d.getBoundingClientRect().right < r ? a = g + 1 : c = g;
2186
2228
  }
2187
2229
  if (a > 0 && a < i.length) {
2188
2230
  d.setStart(n, a - 1), d.setEnd(n, a);
2189
- const l = d.getBoundingClientRect(), g = l.left + l.width / 2;
2190
- r < g && a--;
2231
+ const g = d.getBoundingClientRect(), l = g.left + g.width / 2;
2232
+ r < l && a--;
2191
2233
  }
2192
2234
  } catch {
2193
2235
  return i.length;
@@ -2234,17 +2276,17 @@ function Zo(t, e, o) {
2234
2276
  if (!i) return;
2235
2277
  const r = String(i.field), s = t.grid.displayItems[e];
2236
2278
  if (!s) return;
2237
- const n = i.editorOptions || {}, d = n.trueValue ?? !0, a = n.falseValue ?? !1, l = s[r] === d ? a : d;
2238
- t.grid.commitEdit(e, r, l);
2239
- const g = t.grid.displayItems;
2240
- e < g.length - 1 && requestAnimationFrame(() => {
2279
+ const n = i.editorOptions || {}, d = n.trueValue ?? !0, a = n.falseValue ?? !1, g = s[r] === d ? a : d;
2280
+ t.grid.commitEdit(e, r, g);
2281
+ const l = t.grid.displayItems;
2282
+ e < l.length - 1 && requestAnimationFrame(() => {
2241
2283
  $(t, e + 1, o);
2242
2284
  });
2243
2285
  }
2244
2286
  function ti(t, e) {
2245
2287
  t.isCommittingFromKeyboard || t.grid.editingCell && Mt(t, e);
2246
2288
  }
2247
- function Ft(t, e, o, i) {
2289
+ function Vt(t, e, o, i) {
2248
2290
  const s = t.grid.columns.findIndex((c) => String(c.field) === o), n = t.grid.displayItems;
2249
2291
  let d = e, a = s;
2250
2292
  if (i === "down")
@@ -2252,8 +2294,8 @@ function Ft(t, e, o, i) {
2252
2294
  else if (i === "up")
2253
2295
  d = Math.max(e - 1, 0);
2254
2296
  else {
2255
- const c = t.grid.getEditableColumns(), l = c.findIndex((g) => g.index === s);
2256
- i === "next" ? l >= 0 && l < c.length - 1 ? a = c[l + 1].index : e < n.length - 1 && (d = e + 1, a = c[0].index) : l > 0 ? a = c[l - 1].index : e > 0 && (d = e - 1, a = c[c.length - 1].index);
2297
+ const c = t.grid.getEditableColumns(), g = c.findIndex((l) => l.index === s);
2298
+ i === "next" ? g >= 0 && g < c.length - 1 ? a = c[g + 1].index : e < n.length - 1 && (d = e + 1, a = c[0].index) : g > 0 ? a = c[g - 1].index : e > 0 && (d = e - 1, a = c[c.length - 1].index);
2257
2299
  }
2258
2300
  requestAnimationFrame(() => {
2259
2301
  $(t, d, a), t.isCommittingFromKeyboard = !1;
@@ -2320,7 +2362,7 @@ function ii(t, e, o, i, r) {
2320
2362
  }
2321
2363
  function ri(t, e, o, i, r) {
2322
2364
  var c;
2323
- const s = r.editorOptions || {}, n = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery, d = Vt(i), a = n !== void 0 ? n : ni(i, s.dateFormat);
2365
+ const s = r.editorOptions || {}, n = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery, d = Ft(i), a = n !== void 0 ? n : ni(i, s.dateFormat);
2324
2366
  return `
2325
2367
  <div class="wg__editor wg__editor--date" data-row="${e}" data-field="${o}">
2326
2368
  <input
@@ -2332,8 +2374,8 @@ function ri(t, e, o, i, r) {
2332
2374
  data-date-value="${d}"
2333
2375
  data-output-format="${s.outputFormat || "iso"}"
2334
2376
  data-date-format="${s.dateFormat || "YYYY-MM-DD"}"
2335
- ${s.minDate ? `data-min-date="${Vt(s.minDate)}"` : ""}
2336
- ${s.maxDate ? `data-max-date="${Vt(s.maxDate)}"` : ""}
2377
+ ${s.minDate ? `data-min-date="${Ft(s.minDate)}"` : ""}
2378
+ ${s.maxDate ? `data-max-date="${Ft(s.maxDate)}"` : ""}
2337
2379
  placeholder="${t.escapeHtml(s.dateFormat || "YYYY-MM-DD")}"
2338
2380
  />
2339
2381
  <button type="button" class="wg__date-trigger" tabindex="-1">
@@ -2349,7 +2391,7 @@ function ni(t, e) {
2349
2391
  const i = e || "YYYY-MM-DD", r = o.getFullYear(), s = String(o.getMonth() + 1).padStart(2, "0"), n = String(o.getDate()).padStart(2, "0");
2350
2392
  return i.replace("YYYY", String(r)).replace("YY", String(r).slice(-2)).replace("MM", s).replace("DD", n);
2351
2393
  }
2352
- function Vt(t) {
2394
+ function Ft(t) {
2353
2395
  if (!t) return "";
2354
2396
  let e = null;
2355
2397
  if (t instanceof Date ? e = t : typeof t == "number" ? e = new Date(t) : typeof t == "string" && (e = new Date(t)), !e || isNaN(e.getTime())) return "";
@@ -2373,7 +2415,7 @@ function si(t, e, o, i, r) {
2373
2415
  function ai(t, e, o, i, r) {
2374
2416
  var c;
2375
2417
  const s = r.editorOptions || {}, n = s.options || [], d = Jt(i, n, s), a = (c = t.grid.editingCell) == null ? void 0 : c.initialSearchQuery;
2376
- return t.dropdownOptions = n, t.filterText = a || "", t.highlightedIndex = n.findIndex((l) => at(l, s) === i), t.highlightedIndex < 0 && n.length > 0 && (t.highlightedIndex = 0), `
2418
+ return t.dropdownOptions = n, t.filterText = a || "", t.highlightedIndex = n.findIndex((g) => at(g, s) === i), t.highlightedIndex < 0 && n.length > 0 && (t.highlightedIndex = 0), `
2377
2419
  <div
2378
2420
  class="wg__editor wg__editor--select wg__select-trigger"
2379
2421
  tabindex="0"
@@ -2388,8 +2430,8 @@ function ai(t, e, o, i, r) {
2388
2430
  `;
2389
2431
  }
2390
2432
  function li(t, e, o, i, r) {
2391
- var l;
2392
- const s = r.editorOptions || {}, n = s.options || [], d = Jt(i, n, s), a = (l = t.grid.editingCell) == null ? void 0 : l.initialSearchQuery, c = a !== void 0 ? a : d;
2433
+ var g;
2434
+ const s = r.editorOptions || {}, n = s.options || [], d = Jt(i, n, s), a = (g = t.grid.editingCell) == null ? void 0 : g.initialSearchQuery, c = a !== void 0 ? a : d;
2393
2435
  return t.dropdownOptions = n, t.filterText = c, t.highlightedIndex = n.length > 0 ? 0 : -1, `
2394
2436
  <div class="wg__editor wg__editor--combobox" data-row="${e}" data-field="${o}">
2395
2437
  <input
@@ -2404,8 +2446,8 @@ function li(t, e, o, i, r) {
2404
2446
  `;
2405
2447
  }
2406
2448
  function di(t, e, o, i, r) {
2407
- var l;
2408
- const s = r.editorOptions || {}, n = s.initialOptions || s.options || [], d = Jt(i, n, s), a = (l = t.grid.editingCell) == null ? void 0 : l.initialSearchQuery, c = a !== void 0 ? a : d;
2449
+ var g;
2450
+ const s = r.editorOptions || {}, n = s.initialOptions || s.options || [], d = Jt(i, n, s), a = (g = t.grid.editingCell) == null ? void 0 : g.initialSearchQuery, c = a !== void 0 ? a : d;
2409
2451
  return t.dropdownOptions = n, t.filterText = c, t.highlightedIndex = n.length > 0 ? 0 : -1, `
2410
2452
  <div class="wg__editor wg__editor--autocomplete" data-row="${e}" data-field="${o}">
2411
2453
  <input
@@ -2434,7 +2476,7 @@ function ci(t, e, o, i, r) {
2434
2476
  </div>
2435
2477
  `;
2436
2478
  }
2437
- function He(t, e, o, i, r, s) {
2479
+ function Ie(t, e, o, i, r, s) {
2438
2480
  const n = i.editor === "select" || i.editor === "combobox" || i.editor === "autocomplete", d = i.editor === "date", a = String(i.field);
2439
2481
  return n ? `
2440
2482
  <div class="wg__cell-dropdown-display ${t.grid.getEffectiveToggleVisibility(i) === "on-focus" ? "wg__cell-dropdown-display--toggle-on-focus" : ""}" data-row="${e}" data-field="${a}">
@@ -2450,7 +2492,7 @@ function He(t, e, o, i, r, s) {
2450
2492
  </div>
2451
2493
  ` : i.templateCallback ? `<span class="wg__cell-text">${r}</span>` : `<span class="wg__cell-text">${t.escapeHtml(r)}</span>`;
2452
2494
  }
2453
- let I = {
2495
+ let P = {
2454
2496
  path: null,
2455
2497
  arrowPos: null,
2456
2498
  arrowDir: "right"
@@ -2514,100 +2556,102 @@ function hi(t) {
2514
2556
  }
2515
2557
  return o;
2516
2558
  }
2517
- function pi(t, e, o) {
2518
- return `<div class="wg__toolbar">${hi(t).map(({ groups: s }) => `<div class="wg__toolbar-row">${s.map(({ items: d }, a) => {
2519
- const c = a > 0 ? '<div class="wg__toolbar-divider"></div>' : "", l = d.map((g) => {
2520
- const h = typeof g.disabled == "function" ? g.disabled(e, o) : g.disabled, u = [
2559
+ function pi(t, e, o, i = !1) {
2560
+ let r = hi(t);
2561
+ return i && (r = r.reverse()), `<div class="wg__toolbar">${r.map(({ groups: n }) => `<div class="wg__toolbar-row">${n.map(({ items: a }, c) => {
2562
+ const g = c > 0 ? '<div class="wg__toolbar-divider"></div>' : "", l = a.map((h) => {
2563
+ const u = typeof h.disabled == "function" ? h.disabled(e, o) : h.disabled, p = [
2521
2564
  "wg__toolbar-btn",
2522
- g.danger ? "wg__toolbar-btn--danger" : ""
2523
- ].filter(Boolean).join(" "), p = g.label ? `<span class="wg__toolbar-label">${g.label}</span>` : "";
2565
+ h.danger ? "wg__toolbar-btn--danger" : ""
2566
+ ].filter(Boolean).join(" "), m = h.label ? `<span class="wg__toolbar-label">${h.label}</span>` : "";
2524
2567
  return `<button
2525
- class="${u}"
2526
- data-toolbar-item="${g.id}"
2527
- title="${g.title}"
2528
- ${h ? "disabled" : ""}
2529
- >${g.icon}${p}</button>`;
2568
+ class="${p}"
2569
+ data-toolbar-item="${h.id}"
2570
+ title="${h.title}"
2571
+ ${u ? "disabled" : ""}
2572
+ >${h.icon}${m}</button>`;
2530
2573
  }).join("");
2531
- return c + l;
2574
+ return g + l;
2532
2575
  }).join("")}</div>`).join("")}</div>`;
2533
2576
  }
2534
2577
  let M = null;
2535
2578
  function fi(t, e, o, i, r, s, n) {
2536
2579
  At();
2537
- const d = pi(i, r, o), a = document.createElement("div");
2538
- a.className = "wg__toolbar-container", a.innerHTML = d, t.shadow.appendChild(a);
2539
- const c = a.querySelector(".wg__toolbar");
2580
+ const d = t.grid.toolbarVerticalAlign !== "top", a = pi(i, r, o, d), c = document.createElement("div");
2581
+ c.className = "wg__toolbar-container", c.innerHTML = a, t.shadow.appendChild(c);
2582
+ const g = c.querySelector(".wg__toolbar");
2540
2583
  let l = "left";
2541
- c.style.position = "fixed", c.style.visibility = "hidden", requestAnimationFrame(() => {
2542
- const h = t.shadow.querySelector(`tr[data-row-index="${o}"]`);
2543
- if (!h) {
2584
+ g.style.position = "fixed", g.style.visibility = "hidden", requestAnimationFrame(() => {
2585
+ const u = t.shadow.querySelector(`tr[data-row-index="${o}"]`);
2586
+ if (!u) {
2544
2587
  At();
2545
2588
  return;
2546
2589
  }
2547
- const u = t.grid.toolbarPosition, p = t.grid.toolbarAlign, m = t.grid.toolbarTopPosition;
2548
- let f, b;
2549
- const v = p === "top" ? "-start" : "", _ = () => m === "start" ? "top-start" : m === "end" ? "top-end" : "top";
2550
- u === "left" ? (f = `left${v}`, b = [`right${v}`, _()]) : u === "right" ? (f = `right${v}`, b = [`left${v}`, _()]) : u === "top" ? (f = _(), b = [`left${v}`, `right${v}`]) : (f = `left${v}`, b = [`right${v}`, _()]);
2551
- let S = h;
2552
- if (m === "cursor" && n !== void 0 && u === "top") {
2553
- const y = h.getBoundingClientRect();
2554
- S = {
2590
+ const p = t.grid.toolbarPosition, m = t.grid.toolbarVerticalAlign, b = t.grid.toolbarHorizontalAlign;
2591
+ let f, _, v = "";
2592
+ m === "top" ? v = "-end" : m === "bottom" && (v = "-start");
2593
+ const S = () => b === "start" ? "top-start" : b === "end" ? "top-end" : "top";
2594
+ p === "left" ? (f = `left${v}`, _ = [`right${v}`, S()]) : p === "right" ? (f = `right${v}`, _ = [`left${v}`, S()]) : p === "top" ? (f = S(), _ = [`left${v}`, `right${v}`]) : (f = `left${v}`, _ = [`right${v}`, S()]);
2595
+ let C = u;
2596
+ if (b === "cursor" && n !== void 0 && p === "top") {
2597
+ const x = u.getBoundingClientRect();
2598
+ C = {
2555
2599
  getBoundingClientRect: () => ({
2556
2600
  x: n,
2557
- y: y.top,
2558
- top: y.top,
2601
+ y: x.top,
2602
+ top: x.top,
2559
2603
  left: n,
2560
- bottom: y.bottom,
2604
+ bottom: x.bottom,
2561
2605
  right: n,
2562
2606
  width: 0,
2563
- height: y.height,
2607
+ height: x.height,
2564
2608
  toJSON: () => ({})
2565
2609
  })
2566
2610
  };
2567
2611
  }
2568
- kt(S, c, {
2612
+ kt(C, g, {
2569
2613
  strategy: "fixed",
2570
2614
  placement: f,
2571
2615
  middleware: [
2572
- xt({ fallbackPlacements: b }),
2616
+ xt({ fallbackPlacements: _ }),
2573
2617
  ne({ padding: 8 })
2574
2618
  // Keep within viewport
2575
2619
  ]
2576
- }).then(({ x: y, y: D, placement: x }) => {
2577
- Object.assign(c.style, {
2578
- left: `${y}px`,
2620
+ }).then(({ x, y: D, placement: y }) => {
2621
+ Object.assign(g.style, {
2622
+ left: `${x}px`,
2579
2623
  top: `${D}px`,
2580
2624
  visibility: "visible"
2581
2625
  // Show now that it's positioned
2582
- }), l = x.split("-")[0], M && (M.position = l);
2626
+ }), l = y.split("-")[0], M && (M.position = l);
2583
2627
  }).catch(() => {
2584
- c.style.visibility = "visible";
2628
+ g.style.visibility = "visible";
2585
2629
  });
2586
2630
  });
2587
- const g = (h) => {
2588
- const u = h.target.closest(".wg__toolbar-btn");
2589
- if (u && !u.disabled) {
2590
- const p = u.dataset.toolbarItem || "", m = i.find((f) => f.id === p);
2591
- m && s(m);
2631
+ const h = (u) => {
2632
+ const p = u.target.closest(".wg__toolbar-btn");
2633
+ if (p && !p.disabled) {
2634
+ const m = p.dataset.toolbarItem || "", b = i.find((f) => f.id === m);
2635
+ b && s(b);
2592
2636
  }
2593
2637
  };
2594
- a.addEventListener("click", g), M = {
2595
- container: a,
2596
- toolbar: c,
2638
+ c.addEventListener("click", h), M = {
2639
+ container: c,
2640
+ toolbar: g,
2597
2641
  rowIndex: o,
2598
2642
  rowItem: r,
2599
2643
  position: l,
2600
2644
  hasRowMoved: !1,
2601
2645
  cursorX: n,
2602
2646
  cleanup: () => {
2603
- a.removeEventListener("click", g), a.remove();
2647
+ c.removeEventListener("click", h), c.remove();
2604
2648
  }
2605
- }, I = { path: null, arrowPos: null, arrowDir: "right" };
2649
+ }, P = { path: null, arrowPos: null, arrowDir: "right" };
2606
2650
  }
2607
2651
  function At() {
2608
- M && (M.cleanup(), M = null), I = { path: null, arrowPos: null, arrowDir: "right" };
2652
+ M && (M.cleanup(), M = null), P = { path: null, arrowPos: null, arrowDir: "right" };
2609
2653
  }
2610
- function bt() {
2654
+ function vt() {
2611
2655
  return (M == null ? void 0 : M.rowIndex) ?? null;
2612
2656
  }
2613
2657
  function wi(t) {
@@ -2617,69 +2661,69 @@ function qt(t) {
2617
2661
  return (M == null ? void 0 : M.rowIndex) === t;
2618
2662
  }
2619
2663
  function mi() {
2620
- return I;
2664
+ return P;
2621
2665
  }
2622
2666
  function _e(t, e) {
2623
2667
  if (!M) {
2624
- I = { path: null, arrowPos: null, arrowDir: "right" };
2668
+ P = { path: null, arrowPos: null, arrowDir: "right" };
2625
2669
  return;
2626
2670
  }
2627
- const { toolbar: o, rowItem: i, position: r } = M, s = e.findIndex((y) => y === i);
2671
+ const { toolbar: o, rowItem: i, position: r } = M, s = e.findIndex((C) => C === i);
2628
2672
  if (s === -1) {
2629
- I = { path: null, arrowPos: null, arrowDir: "right" };
2673
+ P = { path: null, arrowPos: null, arrowDir: "right" };
2630
2674
  return;
2631
2675
  }
2632
2676
  const n = t.shadow.querySelector(`tr[data-row-index="${s}"]`);
2633
2677
  if (!n) {
2634
- I = { path: null, arrowPos: null, arrowDir: "right" };
2678
+ P = { path: null, arrowPos: null, arrowDir: "right" };
2635
2679
  return;
2636
2680
  }
2637
2681
  if (s === M.rowIndex || (M.hasRowMoved = !0), !M.hasRowMoved) {
2638
- I = { path: null, arrowPos: null, arrowDir: "right" };
2682
+ P = { path: null, arrowPos: null, arrowDir: "right" };
2639
2683
  return;
2640
2684
  }
2641
- const a = o.getBoundingClientRect(), c = n.getBoundingClientRect(), l = t.shadow.querySelector(".wg__table"), g = l == null ? void 0 : l.getBoundingClientRect(), h = t.shadow.querySelector(".wg"), u = h == null ? void 0 : h.getBoundingClientRect();
2642
- if (!g || !u) {
2643
- I = { path: null, arrowPos: null, arrowDir: "right" };
2685
+ const a = o.getBoundingClientRect(), c = n.getBoundingClientRect(), g = t.shadow.querySelector(".wg__table"), l = g == null ? void 0 : g.getBoundingClientRect(), h = t.shadow.querySelector(".wg"), u = h == null ? void 0 : h.getBoundingClientRect();
2686
+ if (!l || !u) {
2687
+ P = { path: null, arrowPos: null, arrowDir: "right" };
2644
2688
  return;
2645
2689
  }
2646
- const p = document.dir === "rtl" || document.documentElement.dir === "rtl", m = c.top + c.height / 2, f = c.bottom <= u.top, b = c.top >= u.bottom, v = !f && !b;
2647
- let _, S = "right";
2648
- if (f ? (_ = u.top + 8, S = "up") : b ? (_ = u.bottom - 8, S = "down") : _ = m, r === "left") {
2649
- const y = a.right, D = a.top + a.height / 2, x = p ? u.right + 15 : u.left - 15;
2650
- if (!v) {
2651
- I = { path: `M ${y} ${D} H ${x} V ${_}`, arrowPos: { x, y: _ }, arrowDir: S };
2690
+ const p = document.dir === "rtl" || document.documentElement.dir === "rtl", m = c.top + c.height / 2, b = c.bottom <= u.top, f = c.top >= u.bottom, _ = !b && !f;
2691
+ let v, S = "right";
2692
+ if (b ? (v = u.top + 8, S = "up") : f ? (v = u.bottom - 8, S = "down") : v = m, r === "left") {
2693
+ const C = a.right, x = a.top + a.height / 2, D = p ? u.right + 15 : u.left - 15;
2694
+ if (!_) {
2695
+ P = { path: `M ${C} ${x} H ${D} V ${v}`, arrowPos: { x: D, y: v }, arrowDir: S };
2652
2696
  return;
2653
2697
  }
2654
- const C = p ? u.right - 8 : u.left + 8;
2655
- S = p ? "left" : "right", I = { path: `M ${y} ${D} H ${x} V ${_} H ${C}`, arrowPos: { x: C, y: _ }, arrowDir: S };
2698
+ const y = p ? u.right - 8 : u.left + 8;
2699
+ S = p ? "left" : "right", P = { path: `M ${C} ${x} H ${D} V ${v} H ${y}`, arrowPos: { x: y, y: v }, arrowDir: S };
2656
2700
  return;
2657
2701
  } else if (r === "right") {
2658
- const y = a.left, D = a.top + a.height / 2, x = p ? u.left - 15 : u.right + 15;
2659
- if (!v) {
2660
- I = { path: `M ${y} ${D} H ${x} V ${_}`, arrowPos: { x, y: _ }, arrowDir: S };
2702
+ const C = a.left, x = a.top + a.height / 2, D = p ? u.left - 15 : u.right + 15;
2703
+ if (!_) {
2704
+ P = { path: `M ${C} ${x} H ${D} V ${v}`, arrowPos: { x: D, y: v }, arrowDir: S };
2661
2705
  return;
2662
2706
  }
2663
- const C = p ? u.left + 8 : u.right - 8;
2664
- S = p ? "right" : "left", I = { path: `M ${y} ${D} H ${x} V ${_} H ${C}`, arrowPos: { x: C, y: _ }, arrowDir: S };
2707
+ const y = p ? u.left + 8 : u.right - 8;
2708
+ S = p ? "right" : "left", P = { path: `M ${C} ${x} H ${D} V ${v} H ${y}`, arrowPos: { x: y, y: v }, arrowDir: S };
2665
2709
  return;
2666
2710
  } else {
2667
- const D = a.right, x = a.top + a.height / 2, C = D + 48, T = s - M.rowIndex, k = 8;
2711
+ const x = a.right, D = a.top + a.height / 2, y = x + 48, T = s - M.rowIndex, k = 8;
2668
2712
  if (T === 0) {
2669
2713
  let E = c.top - k;
2670
- b && (E = u.bottom - k), I = { path: `M ${D} ${x} H ${C} V ${E}`, arrowPos: { x: C, y: E }, arrowDir: "down" };
2714
+ f && (E = u.bottom - k), P = { path: `M ${x} ${D} H ${y} V ${E}`, arrowPos: { x: y, y: E }, arrowDir: "down" };
2671
2715
  return;
2672
2716
  } else if (T === -1) {
2673
- const A = a.top + a.height * 0.25, H = a.top + a.height * 0.75, O = a.right + 24, R = a.right + k;
2674
- I = { path: `M ${a.right} ${A} H ${O} V ${H} H ${R}`, arrowPos: { x: R, y: H }, arrowDir: "left" };
2717
+ const A = a.top + a.height * 0.25, I = a.top + a.height * 0.75, O = a.right + 24, H = a.right + k;
2718
+ P = { path: `M ${a.right} ${A} H ${O} V ${I} H ${H}`, arrowPos: { x: H, y: I }, arrowDir: "left" };
2675
2719
  return;
2676
2720
  } else if (T < 0) {
2677
2721
  let E = c.bottom + k;
2678
- f && (E = u.top + k), I = { path: `M ${D} ${x} H ${C} V ${E}`, arrowPos: { x: C, y: E }, arrowDir: "up" };
2722
+ b && (E = u.top + k), P = { path: `M ${x} ${D} H ${y} V ${E}`, arrowPos: { x: y, y: E }, arrowDir: "up" };
2679
2723
  return;
2680
2724
  } else {
2681
2725
  let E = c.top - k;
2682
- b && (E = u.bottom - k), I = { path: `M ${D} ${x} H ${C} V ${E}`, arrowPos: { x: C, y: E }, arrowDir: "down" };
2726
+ f && (E = u.bottom - k), P = { path: `M ${x} ${D} H ${y} V ${E}`, arrowPos: { x: y, y: E }, arrowDir: "down" };
2683
2727
  return;
2684
2728
  }
2685
2729
  }
@@ -2699,27 +2743,27 @@ function vi(t) {
2699
2743
  const e = t.grid.columns;
2700
2744
  if (e.length === 0) return "";
2701
2745
  const o = t.grid.showRowNumbers ? '<th class="wg__header wg__row-number-header">#</th>' : "", r = t.grid.showRowToolbar && t.grid.toolbarTrigger === "button" ? '<th class="wg__header wg__actions-column"></th>' : "", s = e.map((n) => {
2702
- const d = String(n.field), a = n.sortable !== !1 && t.grid.sortMode !== "none", c = t.grid.getColumnSortState(d), l = t.grid.getColumnSortPriority(d), g = c !== void 0, h = ["wg__header"];
2703
- a && h.push("wg__header--sortable"), g && h.push("wg__header--sorted");
2746
+ const d = String(n.field), a = n.sortable !== !1 && t.grid.sortMode !== "none", c = t.grid.getColumnSortState(d), g = t.grid.getColumnSortPriority(d), l = c !== void 0, h = ["wg__header"];
2747
+ a && h.push("wg__header--sortable"), l && h.push("wg__header--sorted");
2704
2748
  const u = n.width || n.maxWidth, m = `style="${[
2705
2749
  u ? `width: ${u}` : "",
2706
2750
  n.minWidth ? `min-width: ${n.minWidth}` : "",
2707
2751
  `text-align: ${n.align || "left"}`
2708
2752
  ].filter(Boolean).join("; ")}"`;
2709
- let f = "";
2753
+ let b = "";
2710
2754
  if (a)
2711
- if (g) {
2712
- const v = c.direction === "asc" ? "▲" : "▼", _ = t.grid.sort.length > 1 ? `<sup class="wg__sort-priority">${l}</sup>` : "";
2713
- f = `<span class="wg__sort-indicator">${v}${_}</span>`;
2755
+ if (l) {
2756
+ const _ = c.direction === "asc" ? "▲" : "▼", v = t.grid.sort.length > 1 ? `<sup class="wg__sort-priority">${g}</sup>` : "";
2757
+ b = `<span class="wg__sort-indicator">${_}${v}</span>`;
2714
2758
  } else
2715
- f = '<span class="wg__sort-indicator wg__sort-placeholder">⬍</span>';
2716
- let b = "";
2717
- return n.headerInfo && (b = `<span class="wg__header-info" data-tooltip="${t.escapeHtml(n.headerInfo)}"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg></span>`), `
2759
+ b = '<span class="wg__sort-indicator wg__sort-placeholder">⬍</span>';
2760
+ let f = "";
2761
+ return n.headerInfo && (f = `<span class="wg__header-info" data-tooltip="${t.escapeHtml(n.headerInfo)}"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg></span>`), `
2718
2762
  <th class="${h.join(" ")}" ${m} data-field="${d}">
2719
2763
  <div class="wg__header-content">
2720
2764
  <span class="wg__header-title">${t.escapeHtml(n.title)}</span>
2721
- ${b}
2722
2765
  ${f}
2766
+ ${b}
2723
2767
  </div>
2724
2768
  </th>
2725
2769
  `;
@@ -2736,36 +2780,36 @@ function _i(t) {
2736
2780
  </td>
2737
2781
  </tr>
2738
2782
  `;
2739
- const n = bt();
2783
+ const n = vt();
2740
2784
  return e.map((d, a) => {
2741
2785
  const c = i ? `<td class="wg__cell wg__row-number">${a + 1}</td>` : "";
2742
- let l = "";
2743
- r && (l = `
2786
+ let g = "";
2787
+ r && (g = `
2744
2788
  <td class="wg__cell wg__actions-column">
2745
2789
  ${ze(a, n === a)}
2746
2790
  </td>
2747
2791
  `);
2748
- const g = o.map((u, p) => {
2749
- const m = String(u.field), f = t.grid.getCellValue(d, u, a), b = u.align || "left", v = t.grid.isCellEditable(u), _ = t.grid.isCellFocused(a, p), S = ["wg__cell"], y = t.grid.isEditing(a, m);
2750
- if (v && S.push("wg__cell--editable"), _ && !y && S.push("wg__cell--focused"), u.textOverflow === "ellipsis" && S.push("wg__cell--ellipsis"), y && S.push("wg__cell--editing"), t.grid.isCellInvalid(a, m) && S.push("wg__cell--invalid"), u.cellClass && S.push(u.cellClass), u.cellClassCallback) {
2792
+ const l = o.map((u, p) => {
2793
+ const m = String(u.field), b = t.grid.getCellValue(d, u, a), f = u.align || "left", _ = t.grid.isCellEditable(u), v = t.grid.isCellFocused(a, p), S = ["wg__cell"], C = t.grid.isEditing(a, m);
2794
+ if (_ && S.push("wg__cell--editable"), v && !C && S.push("wg__cell--focused"), u.textOverflow === "ellipsis" && S.push("wg__cell--ellipsis"), C && S.push("wg__cell--editing"), t.grid.isCellInvalid(a, m) && S.push("wg__cell--invalid"), u.cellClass && S.push(u.cellClass), u.cellClassCallback) {
2751
2795
  const T = t.grid.getCellRawValue(d, a, m), k = u.cellClassCallback(T, d);
2752
2796
  k && S.push(k);
2753
2797
  }
2754
- const D = [
2755
- `text-align: ${b}`,
2798
+ const x = [
2799
+ `text-align: ${f}`,
2756
2800
  u.width ? `width: ${u.width}` : "",
2757
2801
  u.minWidth ? `min-width: ${u.minWidth}` : "",
2758
2802
  u.maxWidth ? `max-width: ${u.maxWidth}` : ""
2759
- ].filter(Boolean).join("; "), x = t.grid.isNavigateMode ? 'tabindex="0"' : "";
2760
- let C = "";
2803
+ ].filter(Boolean).join("; "), D = t.grid.isNavigateMode ? 'tabindex="0"' : "";
2804
+ let y = "";
2761
2805
  if (u.tooltipCallback) {
2762
2806
  const T = t.grid.getCellRawValue(d, a, m), k = u.tooltipCallback(T, d);
2763
- k && (C = `data-tooltip="${t.escapeHtml(k)}"`);
2807
+ k && (y = `data-tooltip="${t.escapeHtml(k)}"`);
2764
2808
  } else if (u.tooltipMember) {
2765
2809
  const T = d[u.tooltipMember];
2766
- T && typeof T == "string" && (C = `data-tooltip="${t.escapeHtml(T)}"`);
2810
+ T && typeof T == "string" && (y = `data-tooltip="${t.escapeHtml(T)}"`);
2767
2811
  }
2768
- if (!C && t.grid.isCellInvalid(a, m)) {
2812
+ if (!y && t.grid.isCellInvalid(a, m)) {
2769
2813
  const T = t.grid.getCellValidationError(a, m);
2770
2814
  if (T) {
2771
2815
  const k = u.validationTooltipCallback || t.grid.validationTooltipCallback;
@@ -2777,22 +2821,22 @@ function _i(t) {
2777
2821
  row: d,
2778
2822
  rowIndex: a
2779
2823
  });
2780
- A && (C = `data-tooltip-html="${t.escapeHtml(A)}"`);
2824
+ A && (y = `data-tooltip-html="${t.escapeHtml(A)}"`);
2781
2825
  }
2782
- C || (C = `data-tooltip="${t.escapeHtml(T)}"`);
2826
+ y || (y = `data-tooltip="${t.escapeHtml(T)}"`);
2783
2827
  }
2784
2828
  }
2785
2829
  return `
2786
2830
  <td
2787
2831
  class="${S.join(" ")}"
2788
- style="${D}"
2832
+ style="${x}"
2789
2833
  data-row="${a}"
2790
2834
  data-col="${p}"
2791
2835
  data-field="${m}"
2792
- ${x}
2793
- ${C}
2836
+ ${D}
2837
+ ${y}
2794
2838
  >
2795
- ${t.grid.isEditing(a, m) ? Le(t, a, p, u) : He(t, a, p, u, f)}
2839
+ ${t.grid.isEditing(a, m) ? Le(t, a, p, u) : Ie(t, a, p, u, b)}
2796
2840
  </td>
2797
2841
  `;
2798
2842
  }).join(""), h = ["wg__row"];
@@ -2800,87 +2844,87 @@ function _i(t) {
2800
2844
  const u = t.grid.rowClassCallback(d, a);
2801
2845
  u && h.push(u);
2802
2846
  }
2803
- return `<tr class="${h.join(" ")}" data-row-index="${a}">${c}${l}${g}</tr>`;
2847
+ return `<tr class="${h.join(" ")}" data-row-index="${a}">${c}${g}${l}</tr>`;
2804
2848
  }).join("");
2805
2849
  }
2806
2850
  function ye(t, e) {
2807
- const o = t.grid.displayItems, i = t.grid.columns, { startIndex: r, endIndex: s, rowHeight: n, totalItems: d } = e, a = t.grid.showRowNumbers, c = t.grid.showRowToolbar && t.grid.toolbarTrigger === "button", l = i.length + (c ? 1 : 0) + (a ? 1 : 0);
2851
+ const o = t.grid.displayItems, i = t.grid.columns, { startIndex: r, endIndex: s, rowHeight: n, totalItems: d } = e, a = t.grid.showRowNumbers, c = t.grid.showRowToolbar && t.grid.toolbarTrigger === "button", g = i.length + (c ? 1 : 0) + (a ? 1 : 0);
2808
2852
  if (o.length === 0)
2809
2853
  return `
2810
2854
  <tr>
2811
- <td class="wg__empty" colspan="${l}">
2855
+ <td class="wg__empty" colspan="${g}">
2812
2856
  No items to display
2813
2857
  </td>
2814
2858
  </tr>
2815
2859
  `;
2816
- const g = bt(), h = r * n, u = (d - s) * n, p = h > 0 ? `<tr class="wg__spacer-top"><td colspan="${l}" style="height: ${h}px"></td></tr>` : "", m = [];
2817
- for (let b = r; b < s && b < o.length; b++) {
2818
- const v = o[b], _ = b, S = a ? `<td class="wg__cell wg__row-number">${_ + 1}</td>` : "";
2819
- let y = "";
2820
- c && (y = `
2860
+ const l = vt(), h = r * n, u = (d - s) * n, p = h > 0 ? `<tr class="wg__spacer-top"><td colspan="${g}" style="height: ${h}px"></td></tr>` : "", m = [];
2861
+ for (let f = r; f < s && f < o.length; f++) {
2862
+ const _ = o[f], v = f, S = a ? `<td class="wg__cell wg__row-number">${v + 1}</td>` : "";
2863
+ let C = "";
2864
+ c && (C = `
2821
2865
  <td class="wg__cell wg__actions-column">
2822
- ${ze(_, g === _)}
2866
+ ${ze(v, l === v)}
2823
2867
  </td>
2824
2868
  `);
2825
- const D = i.map((C, T) => {
2826
- const k = String(C.field), E = t.grid.getCellValue(v, C, _), A = C.align || "left", H = t.grid.isCellEditable(C), O = t.grid.isCellFocused(_, T), R = ["wg__cell"], z = t.grid.isEditing(_, k);
2827
- if (H && R.push("wg__cell--editable"), O && !z && R.push("wg__cell--focused"), C.textOverflow === "ellipsis" && R.push("wg__cell--ellipsis"), z && R.push("wg__cell--editing"), t.grid.isCellInvalid(_, k) && R.push("wg__cell--invalid"), C.cellClass && R.push(C.cellClass), C.cellClassCallback) {
2828
- const q = t.grid.getCellRawValue(v, _, k), ot = C.cellClassCallback(q, v);
2829
- ot && R.push(ot);
2869
+ const x = i.map((y, T) => {
2870
+ const k = String(y.field), E = t.grid.getCellValue(_, y, v), A = y.align || "left", I = t.grid.isCellEditable(y), O = t.grid.isCellFocused(v, T), H = ["wg__cell"], z = t.grid.isEditing(v, k);
2871
+ if (I && H.push("wg__cell--editable"), O && !z && H.push("wg__cell--focused"), y.textOverflow === "ellipsis" && H.push("wg__cell--ellipsis"), z && H.push("wg__cell--editing"), t.grid.isCellInvalid(v, k) && H.push("wg__cell--invalid"), y.cellClass && H.push(y.cellClass), y.cellClassCallback) {
2872
+ const q = t.grid.getCellRawValue(_, v, k), ot = y.cellClassCallback(q, _);
2873
+ ot && H.push(ot);
2830
2874
  }
2831
- const F = [
2875
+ const V = [
2832
2876
  `text-align: ${A}`,
2833
- C.width ? `width: ${C.width}` : "",
2834
- C.minWidth ? `min-width: ${C.minWidth}` : "",
2835
- C.maxWidth ? `max-width: ${C.maxWidth}` : ""
2836
- ].filter(Boolean).join("; "), V = t.grid.isNavigateMode ? 'tabindex="0"' : "";
2837
- let P = "";
2838
- if (C.tooltipCallback) {
2839
- const q = t.grid.getCellRawValue(v, _, k), ot = C.tooltipCallback(q, v);
2840
- ot && (P = `data-tooltip="${t.escapeHtml(ot)}"`);
2841
- } else if (C.tooltipMember) {
2842
- const q = v[C.tooltipMember];
2843
- q && typeof q == "string" && (P = `data-tooltip="${t.escapeHtml(q)}"`);
2877
+ y.width ? `width: ${y.width}` : "",
2878
+ y.minWidth ? `min-width: ${y.minWidth}` : "",
2879
+ y.maxWidth ? `max-width: ${y.maxWidth}` : ""
2880
+ ].filter(Boolean).join("; "), F = t.grid.isNavigateMode ? 'tabindex="0"' : "";
2881
+ let R = "";
2882
+ if (y.tooltipCallback) {
2883
+ const q = t.grid.getCellRawValue(_, v, k), ot = y.tooltipCallback(q, _);
2884
+ ot && (R = `data-tooltip="${t.escapeHtml(ot)}"`);
2885
+ } else if (y.tooltipMember) {
2886
+ const q = _[y.tooltipMember];
2887
+ q && typeof q == "string" && (R = `data-tooltip="${t.escapeHtml(q)}"`);
2844
2888
  }
2845
- if (!P && t.grid.isCellInvalid(_, k)) {
2846
- const q = t.grid.getCellValidationError(_, k);
2889
+ if (!R && t.grid.isCellInvalid(v, k)) {
2890
+ const q = t.grid.getCellValidationError(v, k);
2847
2891
  if (q) {
2848
- const ot = C.validationTooltipCallback || t.grid.validationTooltipCallback;
2892
+ const ot = y.validationTooltipCallback || t.grid.validationTooltipCallback;
2849
2893
  if (ot) {
2850
- const Ye = t.grid.getCellRawValue(v, _, k), ae = ot({
2894
+ const Ye = t.grid.getCellRawValue(_, v, k), ae = ot({
2851
2895
  field: k,
2852
2896
  error: q,
2853
2897
  value: Ye,
2854
- row: v,
2855
- rowIndex: _
2898
+ row: _,
2899
+ rowIndex: v
2856
2900
  });
2857
- ae && (P = `data-tooltip-html="${t.escapeHtml(ae)}"`);
2901
+ ae && (R = `data-tooltip-html="${t.escapeHtml(ae)}"`);
2858
2902
  }
2859
- P || (P = `data-tooltip="${t.escapeHtml(q)}"`);
2903
+ R || (R = `data-tooltip="${t.escapeHtml(q)}"`);
2860
2904
  }
2861
2905
  }
2862
2906
  return `
2863
2907
  <td
2864
- class="${R.join(" ")}"
2865
- style="${F}"
2866
- data-row="${_}"
2908
+ class="${H.join(" ")}"
2909
+ style="${V}"
2910
+ data-row="${v}"
2867
2911
  data-col="${T}"
2868
2912
  data-field="${k}"
2869
- ${V}
2870
- ${P}
2913
+ ${F}
2914
+ ${R}
2871
2915
  >
2872
- ${t.grid.isEditing(_, k) ? Le(t, _, T, C) : He(t, _, T, C, E)}
2916
+ ${t.grid.isEditing(v, k) ? Le(t, v, T, y) : Ie(t, v, T, y, E)}
2873
2917
  </td>
2874
2918
  `;
2875
- }).join(""), x = ["wg__row"];
2919
+ }).join(""), D = ["wg__row"];
2876
2920
  if (t.grid.rowClassCallback) {
2877
- const C = t.grid.rowClassCallback(v, _);
2878
- C && x.push(C);
2921
+ const y = t.grid.rowClassCallback(_, v);
2922
+ y && D.push(y);
2879
2923
  }
2880
- m.push(`<tr class="${x.join(" ")}" data-row-index="${_}">${S}${y}${D}</tr>`);
2924
+ m.push(`<tr class="${D.join(" ")}" data-row-index="${v}">${S}${C}${x}</tr>`);
2881
2925
  }
2882
- const f = u > 0 ? `<tr class="wg__spacer-bottom"><td colspan="${l}" style="height: ${u}px"></td></tr>` : "";
2883
- return p + m.join("") + f;
2926
+ const b = u > 0 ? `<tr class="wg__spacer-bottom"><td colspan="${g}" style="height: ${u}px"></td></tr>` : "";
2927
+ return p + m.join("") + b;
2884
2928
  }
2885
2929
  function Yt(t, e = "bottom-center") {
2886
2930
  const o = t.grid.showPagination;
@@ -2893,47 +2937,47 @@ function Yt(t, e = "bottom-center") {
2893
2937
  pageInfo: `Page ${i} of ${r}`,
2894
2938
  itemCount: `(${d} item${d !== 1 ? "s" : ""})`,
2895
2939
  perPage: "per page"
2896
- }, c = t.grid.paginationLabelsCallback, l = c ? c({ currentPage: i, totalPages: r, totalItems: d, pageSize: s }) : {}, g = { ...a, ...l }, h = e.startsWith("top-"), u = e.replace("top-", "").replace("bottom-", ""), p = ["wg__pagination"];
2940
+ }, c = t.grid.paginationLabelsCallback, g = c ? c({ currentPage: i, totalPages: r, totalItems: d, pageSize: s }) : {}, l = { ...a, ...g }, h = e.startsWith("top-"), u = e.replace("top-", "").replace("bottom-", ""), p = ["wg__pagination"];
2897
2941
  u === "left" ? p.push("wg__pagination--left") : u === "right" && p.push("wg__pagination--right"), h && p.push("wg__pagination--top");
2898
2942
  const m = {
2899
2943
  first: `
2900
2944
  <button class="wg__pagination-btn" data-action="first" ${i === 1 ? "disabled" : ""}>
2901
- ${g.first}
2945
+ ${l.first}
2902
2946
  </button>
2903
2947
  `,
2904
2948
  previous: `
2905
2949
  <button class="wg__pagination-btn" data-action="prev" ${i === 1 ? "disabled" : ""}>
2906
- ${g.previous}
2950
+ ${l.previous}
2907
2951
  </button>
2908
2952
  `,
2909
2953
  next: `
2910
2954
  <button class="wg__pagination-btn" data-action="next" ${i === r ? "disabled" : ""}>
2911
- ${g.next}
2955
+ ${l.next}
2912
2956
  </button>
2913
2957
  `,
2914
2958
  last: `
2915
2959
  <button class="wg__pagination-btn" data-action="last" ${i === r ? "disabled" : ""}>
2916
- ${g.last}
2960
+ ${l.last}
2917
2961
  </button>
2918
2962
  `,
2919
2963
  pageInfo: `
2920
2964
  <div class="wg__pagination-info">
2921
- ${g.pageInfo}
2922
- <span class="wg__pagination-count">${g.itemCount}</span>
2965
+ ${l.pageInfo}
2966
+ <span class="wg__pagination-count">${l.itemCount}</span>
2923
2967
  </div>
2924
2968
  `,
2925
2969
  pageSize: n.length > 0 ? `
2926
2970
  <div class="wg__pagination-pagesize">
2927
2971
  <select class="wg__pagination-select" data-action="pagesize">
2928
2972
  ${n.map(
2929
- (v) => `<option value="${v}" ${v === s ? "selected" : ""}>${v}</option>`
2973
+ (_) => `<option value="${_}" ${_ === s ? "selected" : ""}>${_}</option>`
2930
2974
  ).join("")}
2931
2975
  </select>
2932
- <span class="wg__pagination-label">${g.perPage}</span>
2976
+ <span class="wg__pagination-label">${l.perPage}</span>
2933
2977
  </div>
2934
2978
  ` : ""
2935
- }, b = t.grid.paginationLayout.split("|").map((v) => v.trim()).map((v) => m[v] || "").join("");
2936
- return `<div class="${p.join(" ")}">${b}</div>`;
2979
+ }, f = t.grid.paginationLayout.split("|").map((_) => _.trim()).map((_) => m[_] || "").join("");
2980
+ return `<div class="${p.join(" ")}">${f}</div>`;
2937
2981
  }
2938
2982
  function Nt(t, e) {
2939
2983
  const o = t.grid.summaryContentCallback;
@@ -2945,10 +2989,10 @@ function Nt(t, e) {
2945
2989
  currentPage: i,
2946
2990
  pageSize: r,
2947
2991
  metadata: t.grid.summaryMetadata
2948
- }), c = e.startsWith("top-"), l = e.replace("top-", "").replace("bottom-", ""), g = ["wg__summary"];
2949
- return l === "left" ? g.push("wg__summary--left") : l === "right" && g.push("wg__summary--right"), c && g.push("wg__summary--top"), `<div class="${g.join(" ")}">${a}</div>`;
2992
+ }), c = e.startsWith("top-"), g = e.replace("top-", "").replace("bottom-", ""), l = ["wg__summary"];
2993
+ return g === "left" ? l.push("wg__summary--left") : g === "right" && l.push("wg__summary--right"), c && l.push("wg__summary--top"), `<div class="${l.join(" ")}">${a}</div>`;
2950
2994
  }
2951
- const Fe = {
2995
+ const Ve = {
2952
2996
  today: "Today",
2953
2997
  clear: "Clear",
2954
2998
  monthNames: [
@@ -3002,7 +3046,7 @@ function Kt(t) {
3002
3046
  maxLength: t.length
3003
3047
  };
3004
3048
  }
3005
- function Ve(t, e) {
3049
+ function Fe(t, e) {
3006
3050
  if (!t || isNaN(t.getTime())) return "";
3007
3051
  const o = t.getFullYear(), i = String(t.getMonth() + 1).padStart(2, "0"), r = String(t.getDate()).padStart(2, "0"), { separator: s, parts: n } = e, d = [];
3008
3052
  for (let a = 0; a < 3; a++)
@@ -3013,17 +3057,17 @@ function yi(t, e) {
3013
3057
  if (!t) return null;
3014
3058
  const { separator: o, parts: i } = e, r = t.split(o);
3015
3059
  let s = null, n = null, d = null;
3016
- if (r.forEach((c, l) => {
3060
+ if (r.forEach((c, g) => {
3017
3061
  if (c) {
3018
- if (i.year && i.year.index === l) {
3019
- const g = parseInt(c, 10);
3020
- i.year.length === 4 && c.length === 4 ? s = g : i.year.length === 2 && c.length === 2 && (s = g < 100 ? g + 2e3 : g);
3021
- } else if (i.month && i.month.index === l) {
3022
- const g = parseInt(c, 10);
3023
- c.length === 2 && g >= 1 && g <= 12 && (n = g);
3024
- } else if (i.day && i.day.index === l) {
3025
- const g = parseInt(c, 10);
3026
- c.length === 2 && g >= 1 && g <= 31 && (d = g);
3062
+ if (i.year && i.year.index === g) {
3063
+ const l = parseInt(c, 10);
3064
+ i.year.length === 4 && c.length === 4 ? s = l : i.year.length === 2 && c.length === 2 && (s = l < 100 ? l + 2e3 : l);
3065
+ } else if (i.month && i.month.index === g) {
3066
+ const l = parseInt(c, 10);
3067
+ c.length === 2 && l >= 1 && l <= 12 && (n = l);
3068
+ } else if (i.day && i.day.index === g) {
3069
+ const l = parseInt(c, 10);
3070
+ c.length === 2 && l >= 1 && l <= 31 && (d = l);
3027
3071
  }
3028
3072
  }
3029
3073
  }), s === null || n === null || d === null)
@@ -3067,7 +3111,7 @@ function xi(t, e) {
3067
3111
  const o = parseInt(t, 10);
3068
3112
  return { min: o, max: o };
3069
3113
  }
3070
- function ki(t, e, o = Fe) {
3114
+ function ki(t, e, o = Ve) {
3071
3115
  const i = Di(t, o), r = Ti(t, e, o), s = Ei(t, e, o), n = e.showTodayButton !== !1 ? Ai(o) : "";
3072
3116
  return `
3073
3117
  <div class="wg-datepicker">
@@ -3135,34 +3179,34 @@ function $i(t) {
3135
3179
  return t.weekdayNamesShort.map((e) => `<div class="wg-datepicker__weekday">${e}</div>`).join("");
3136
3180
  }
3137
3181
  function qe(t, e) {
3138
- const { viewYear: o, viewMonth: i, selectedDate: r, focusedDate: s } = t, n = e.minDate ? j(e.minDate) : null, d = e.maxDate ? j(e.maxDate) : null, a = Si(o, i), c = gt(o, i), l = gt(o, i - 1), g = new Date(o, i - 1, 1), h = g.getFullYear(), u = g.getMonth(), p = new Date(o, i + 1, 1), m = p.getFullYear(), f = p.getMonth(), b = [];
3139
- for (let y = a - 1; y >= 0; y--) {
3140
- const D = l - y;
3141
- b.push({
3142
- date: new Date(h, u, D),
3143
- day: D,
3182
+ const { viewYear: o, viewMonth: i, selectedDate: r, focusedDate: s } = t, n = e.minDate ? j(e.minDate) : null, d = e.maxDate ? j(e.maxDate) : null, a = Si(o, i), c = gt(o, i), g = gt(o, i - 1), l = new Date(o, i - 1, 1), h = l.getFullYear(), u = l.getMonth(), p = new Date(o, i + 1, 1), m = p.getFullYear(), b = p.getMonth(), f = [];
3183
+ for (let C = a - 1; C >= 0; C--) {
3184
+ const x = g - C;
3185
+ f.push({
3186
+ date: new Date(h, u, x),
3187
+ day: x,
3144
3188
  isOtherMonth: !0
3145
3189
  });
3146
3190
  }
3147
- for (let y = 1; y <= c; y++)
3148
- b.push({
3149
- date: new Date(o, i, y),
3150
- day: y,
3191
+ for (let C = 1; C <= c; C++)
3192
+ f.push({
3193
+ date: new Date(o, i, C),
3194
+ day: C,
3151
3195
  isOtherMonth: !1
3152
3196
  });
3153
- const _ = Math.ceil((a + c) / 7) * 7 - b.length;
3154
- for (let y = 1; y <= _; y++)
3155
- b.push({
3156
- date: new Date(m, f, y),
3157
- day: y,
3197
+ const v = Math.ceil((a + c) / 7) * 7 - f.length;
3198
+ for (let C = 1; C <= v; C++)
3199
+ f.push({
3200
+ date: new Date(m, b, C),
3201
+ day: C,
3158
3202
  isOtherMonth: !0
3159
3203
  });
3160
3204
  let S = "";
3161
- for (const y of b) {
3162
- const D = ["wg-datepicker__day"];
3163
- y.isOtherMonth && D.push("wg-datepicker__day--other-month"), Mi(y.date, n, d) && D.push("wg-datepicker__day--disabled"), Ci(y.date) && D.push("wg-datepicker__day--today"), yt(y.date, r) && D.push("wg-datepicker__day--selected"), yt(y.date, s) && D.push("wg-datepicker__day--focused");
3164
- const C = Wt(y.date);
3165
- S += `<div class="${D.join(" ")}" data-date="${C}">${y.day}</div>`;
3205
+ for (const C of f) {
3206
+ const x = ["wg-datepicker__day"];
3207
+ C.isOtherMonth && x.push("wg-datepicker__day--other-month"), Mi(C.date, n, d) && x.push("wg-datepicker__day--disabled"), Ci(C.date) && x.push("wg-datepicker__day--today"), yt(C.date, r) && x.push("wg-datepicker__day--selected"), yt(C.date, s) && x.push("wg-datepicker__day--focused");
3208
+ const y = Wt(C.date);
3209
+ S += `<div class="${x.join(" ")}" data-date="${y}">${C.day}</div>`;
3166
3210
  }
3167
3211
  return S;
3168
3212
  }
@@ -3182,18 +3226,18 @@ function Oi(t, e, o) {
3182
3226
  const i = t.querySelector(".wg-datepicker__days");
3183
3227
  i && (i.innerHTML = qe(e, o));
3184
3228
  }
3185
- function Ri(t, e, o) {
3229
+ function Hi(t, e, o) {
3186
3230
  const i = t.querySelector(".wg-datepicker__month-year");
3187
3231
  if (i) {
3188
3232
  const r = o.monthNames[e.viewMonth];
3189
3233
  i.textContent = `${r} ${e.viewYear}`;
3190
3234
  }
3191
3235
  }
3192
- function Pi(t, e) {
3236
+ function Ri(t, e) {
3193
3237
  const o = t.querySelector(".wg-datepicker__rolling-selector"), i = t.querySelector(".wg-datepicker__calendar");
3194
3238
  o && o.classList.toggle("wg-datepicker__rolling-selector--visible", e), i && i.classList.toggle("wg-datepicker__calendar--hidden", e);
3195
3239
  }
3196
- function Ii(t, e) {
3240
+ function Pi(t, e) {
3197
3241
  t.querySelectorAll("[data-year]").forEach((r) => {
3198
3242
  const s = parseInt(r.dataset.year || "0", 10);
3199
3243
  r.classList.toggle("wg-datepicker__rolling-item--selected", s === e.viewYear);
@@ -3240,18 +3284,18 @@ function Li(t, e, o, i) {
3240
3284
  return !0;
3241
3285
  }
3242
3286
  if (["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(r))
3243
- return t.preventDefault(), Hi(e, r, o), !0;
3287
+ return t.preventDefault(), Ii(e, r, o), !0;
3244
3288
  if (r === "Enter")
3245
- return t.preventDefault(), e.focusedDate && ((n = i.onSelect) == null || n.call(i, e.focusedDate, "down")), !0;
3289
+ return t.preventDefault(), t.stopPropagation(), e.focusedDate && ((n = i.onSelect) == null || n.call(i, e.focusedDate, "down")), !0;
3246
3290
  if (r === "Tab")
3247
3291
  return e.focusedDate ? (d = i.onSelect) == null || d.call(i, e.focusedDate, "next") : (a = i.onClose) == null || a.call(i), !1;
3248
3292
  if (r === "Home") {
3249
3293
  if (t.preventDefault(), t.ctrlKey || t.metaKey) {
3250
3294
  let c = e.viewYear;
3251
- const l = new Date(c, 0, 1);
3252
- if (e.focusedDate && yt(e.focusedDate, l) && c--, o.minDate) {
3253
- const g = j(o.minDate);
3254
- g && c < g.getFullYear() && (c = g.getFullYear());
3295
+ const g = new Date(c, 0, 1);
3296
+ if (e.focusedDate && yt(e.focusedDate, g) && c--, o.minDate) {
3297
+ const l = j(o.minDate);
3298
+ l && c < l.getFullYear() && (c = l.getFullYear());
3255
3299
  }
3256
3300
  e.viewMonth = 0, e.viewYear = c, e.focusedDate = new Date(c, 0, 1);
3257
3301
  } else
@@ -3261,10 +3305,10 @@ function Li(t, e, o, i) {
3261
3305
  if (r === "End") {
3262
3306
  if (t.preventDefault(), t.ctrlKey || t.metaKey) {
3263
3307
  let c = e.viewYear;
3264
- const l = new Date(c, 11, 31);
3265
- if (e.focusedDate && yt(e.focusedDate, l) && c++, o.maxDate) {
3266
- const g = j(o.maxDate);
3267
- g && c > g.getFullYear() && (c = g.getFullYear());
3308
+ const g = new Date(c, 11, 31);
3309
+ if (e.focusedDate && yt(e.focusedDate, g) && c++, o.maxDate) {
3310
+ const l = j(o.maxDate);
3311
+ l && c > l.getFullYear() && (c = l.getFullYear());
3268
3312
  }
3269
3313
  e.viewMonth = 11, e.viewYear = c, e.focusedDate = new Date(c, 11, 31);
3270
3314
  } else {
@@ -3289,7 +3333,7 @@ function Li(t, e, o, i) {
3289
3333
  }
3290
3334
  return !1;
3291
3335
  }
3292
- function Hi(t, e, o) {
3336
+ function Ii(t, e, o) {
3293
3337
  if (!t.focusedDate) {
3294
3338
  t.focusedDate = t.selectedDate ? new Date(t.selectedDate) : new Date(t.viewYear, t.viewMonth, 1);
3295
3339
  return;
@@ -3325,7 +3369,7 @@ function zi(t, e) {
3325
3369
  }
3326
3370
  return o === "ArrowLeft" || o === "ArrowRight" ? (t.preventDefault(), e.rollingSelectorMode = e.rollingSelectorMode === "month" ? "year" : "month", !0) : o === "Enter" || o === "Escape" ? (t.preventDefault(), e.rollingSelectorOpen = !1, !0) : !1;
3327
3371
  }
3328
- function Fi(t) {
3372
+ function Vi(t) {
3329
3373
  if (t.selectedDate)
3330
3374
  t.focusedDate = new Date(t.selectedDate), t.viewYear = t.selectedDate.getFullYear(), t.viewMonth = t.selectedDate.getMonth();
3331
3375
  else {
@@ -3333,7 +3377,7 @@ function Fi(t) {
3333
3377
  t.focusedDate = new Date(t.viewYear, t.viewMonth, e.getDate());
3334
3378
  }
3335
3379
  }
3336
- function Vi(t, e, o) {
3380
+ function Fi(t, e, o) {
3337
3381
  const i = t.dataset.date;
3338
3382
  if (!i || t.classList.contains("wg-datepicker__day--disabled"))
3339
3383
  return null;
@@ -3355,17 +3399,17 @@ function Ni(t, e) {
3355
3399
  o !== void 0 && (e.viewYear = parseInt(o, 10));
3356
3400
  }
3357
3401
  function Gt(t, e) {
3358
- var g, h, u, p;
3359
- const { separator: o, parts: i, maxLength: r } = e, s = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = t.replace(new RegExp(s, "g"), ""), d = ((g = i.year) == null ? void 0 : g.length) ?? 4, a = [
3402
+ var l, h, u, p;
3403
+ const { separator: o, parts: i, maxLength: r } = e, s = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = t.replace(new RegExp(s, "g"), ""), d = ((l = i.year) == null ? void 0 : l.length) ?? 4, a = [
3360
3404
  { type: "year", pos: ((h = i.year) == null ? void 0 : h.index) ?? 0, length: d },
3361
3405
  { type: "month", pos: ((u = i.month) == null ? void 0 : u.index) ?? 1, length: 2 },
3362
3406
  { type: "day", pos: ((p = i.day) == null ? void 0 : p.index) ?? 2, length: 2 }
3363
- ].sort((m, f) => m.pos - f.pos);
3364
- let c = "", l = 0;
3407
+ ].sort((m, b) => m.pos - b.pos);
3408
+ let c = "", g = 0;
3365
3409
  for (let m = 0; m < a.length; m++) {
3366
- const f = a[m], b = n.substring(l, l + f.length);
3367
- if (!b) break;
3368
- c += b, l += b.length, m < a.length - 1 && b.length === f.length && (c += o);
3410
+ const b = a[m], f = n.substring(g, g + b.length);
3411
+ if (!f) break;
3412
+ c += f, g += f.length, m < a.length - 1 && f.length === b.length && (c += o);
3369
3413
  }
3370
3414
  return c.substring(0, r);
3371
3415
  }
@@ -3373,16 +3417,16 @@ function Ui(t, e, o) {
3373
3417
  const i = t.value, r = t.selectionStart || 0, s = i.length < o.length, { separator: n } = e, d = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), a = i.replace(new RegExp(`[^0-9${d}]`, "g"), ""), c = Gt(a, e);
3374
3418
  if (c !== i) {
3375
3419
  t.value = c;
3376
- let l = r;
3420
+ let g = r;
3377
3421
  if (s)
3378
- l = r;
3422
+ g = r;
3379
3423
  else if (c.length > i.length && c[r] === n)
3380
- l = r + 1;
3424
+ g = r + 1;
3381
3425
  else if (c.length > i.length) {
3382
- const g = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), h = (i.substring(0, r).match(new RegExp(g, "g")) || []).length, p = (c.substring(0, r).match(new RegExp(g, "g")) || []).length - h;
3383
- l = r + p;
3426
+ const l = n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), h = (i.substring(0, r).match(new RegExp(l, "g")) || []).length, p = (c.substring(0, r).match(new RegExp(l, "g")) || []).length - h;
3427
+ g = r + p;
3384
3428
  }
3385
- t.setSelectionRange(l, l);
3429
+ t.setSelectionRange(g, g);
3386
3430
  }
3387
3431
  return c;
3388
3432
  }
@@ -3404,18 +3448,18 @@ function ji(t, e) {
3404
3448
  return !1;
3405
3449
  if (o === s) {
3406
3450
  const d = t.target, a = d.selectionStart || 0, c = d.value;
3407
- let l = 0;
3451
+ let g = 0;
3408
3452
  for (let h = a - 1; h >= 0; h--)
3409
3453
  if (c[h] === s) {
3410
- l = h + 1;
3454
+ g = h + 1;
3411
3455
  break;
3412
3456
  }
3413
- const g = c.substring(l, a);
3414
- if (/^\d$/.test(g)) {
3457
+ const l = c.substring(g, a);
3458
+ if (/^\d$/.test(l)) {
3415
3459
  t.preventDefault();
3416
- const h = c.substring(0, l) + "0" + g + s + c.substring(a);
3460
+ const h = c.substring(0, g) + "0" + l + s + c.substring(a);
3417
3461
  d.value = h;
3418
- const u = l + 2 + s.length;
3462
+ const u = g + 2 + s.length;
3419
3463
  return d.setSelectionRange(u, u), !0;
3420
3464
  }
3421
3465
  }
@@ -3424,8 +3468,8 @@ function ji(t, e) {
3424
3468
  function Bi(t, e, o) {
3425
3469
  var u;
3426
3470
  t.preventDefault();
3427
- const i = ((u = t.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: r } = o, s = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = i.replace(new RegExp(`[^0-9${s}]`, "g"), ""), d = Gt(n, o), a = e.selectionStart || 0, c = e.selectionEnd || 0, l = e.value, g = l.substring(0, a) + d + l.substring(c);
3428
- e.value = Gt(g, o);
3471
+ const i = ((u = t.clipboardData) == null ? void 0 : u.getData("text")) || "", { separator: r } = o, s = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), n = i.replace(new RegExp(`[^0-9${s}]`, "g"), ""), d = Gt(n, o), a = e.selectionStart || 0, c = e.selectionEnd || 0, g = e.value, l = g.substring(0, a) + d + g.substring(c);
3472
+ e.value = Gt(l, o);
3429
3473
  const h = a + d.length;
3430
3474
  e.setSelectionRange(h, h);
3431
3475
  }
@@ -3443,31 +3487,31 @@ const Wi = `
3443
3487
  z-index: var(--wg-dp-z-index, 9999);
3444
3488
 
3445
3489
  /* Colors */
3446
- --wg-dp-background: var(--base-layer-01, #fff);
3447
- --wg-dp-border-color: var(--base-stroke-default, #e0e0e0);
3448
- --wg-dp-text-color: var(--base-text-color-primary, #1a1a1a);
3449
- --wg-dp-text-secondary: var(--base-text-color-secondary, #666);
3450
- --wg-dp-text-muted: var(--base-text-color-muted, #ccc);
3451
- --wg-dp-text-disabled: var(--base-text-color-disabled, #999);
3490
+ --wg-dp-background: var(--base-main-bg, #fff);
3491
+ --wg-dp-border-color: var(--base-border-color, #e0e0e0);
3492
+ --wg-dp-text-color: var(--base-text-color-1, #1a1a1a);
3493
+ --wg-dp-text-secondary: var(--base-text-color-3, #666);
3494
+ --wg-dp-text-muted: var(--base-text-color-4, #ccc);
3495
+ --wg-dp-text-disabled: var(--base-text-color-4, #999);
3452
3496
  --wg-dp-accent-color: var(--base-accent-color, #0078d4);
3453
3497
  --wg-dp-accent-hover: var(--base-accent-color-hover, #006cbd);
3454
- --wg-dp-hover-bg: var(--base-layer-hover, #f5f5f5);
3455
- --wg-dp-hover-border: var(--base-stroke-hover, #ccc);
3456
- --wg-dp-selected-text: var(--base-text-on-accent, #fff);
3498
+ --wg-dp-hover-bg: var(--base-hover-bg, #f5f5f5);
3499
+ --wg-dp-hover-border: var(--base-border-color, #ccc);
3500
+ --wg-dp-selected-text: var(--base-text-color-on-accent, #fff);
3457
3501
 
3458
3502
  /* Typography */
3459
- --wg-dp-font-family: var(--base-font-family, inherit);
3460
- --wg-dp-font-size: var(--base-font-size-sm, 13px);
3461
- --wg-dp-font-size-sm: var(--base-font-size-xs, 12px);
3462
- --wg-dp-font-size-xs: 10px;
3463
- --wg-dp-font-weight-normal: var(--base-font-weight-normal, 400);
3464
- --wg-dp-font-weight-medium: var(--base-font-weight-medium, 500);
3465
- --wg-dp-font-weight-semibold: var(--base-font-weight-semibold, 600);
3503
+ --wg-dp-font-family: var(--wg-font-family, var(--base-font-family, inherit));
3504
+ --wg-dp-font-size: var(--wg-font-size-base, 14px);
3505
+ --wg-dp-font-size-sm: var(--wg-font-size-sm, 12px);
3506
+ --wg-dp-font-size-xs: var(--wg-font-size-xs, 11px);
3507
+ --wg-dp-font-weight-normal: var(--wg-font-weight-normal, 400);
3508
+ --wg-dp-font-weight-medium: 500;
3509
+ --wg-dp-font-weight-semibold: var(--wg-font-weight-semibold, 600);
3466
3510
 
3467
3511
  /* Sizing */
3468
3512
  --wg-dp-padding: 8px;
3469
3513
  --wg-dp-min-width: 220px;
3470
- --wg-dp-border-radius: var(--base-border-radius-sm, 4px);
3514
+ --wg-dp-border-radius: var(--wg-border-radius-sm, 4px);
3471
3515
  --wg-dp-nav-size: 24px;
3472
3516
  --wg-dp-nav-icon-size: 14px;
3473
3517
  --wg-dp-rolling-list-height: 180px;
@@ -3478,7 +3522,7 @@ const Wi = `
3478
3522
  --wg-dp-gap-xs: 1px;
3479
3523
 
3480
3524
  /* Shadow */
3481
- --wg-dp-shadow: var(--base-shadow-lg, 0 4px 16px rgba(0, 0, 0, 0.15));
3525
+ --wg-dp-shadow: var(--wg-shadow-lg, 0 4px 16px rgba(0, 0, 0, 0.15));
3482
3526
  }
3483
3527
 
3484
3528
  .wg-datepicker {
@@ -3725,16 +3769,16 @@ class se {
3725
3769
  const o = e || navigator.language || "en";
3726
3770
  try {
3727
3771
  const i = new Intl.DateTimeFormat(o, { month: "long" }), r = new Intl.DateTimeFormat(o, { month: "short" }), s = new Intl.DateTimeFormat(o, { weekday: "long" }), n = new Intl.DateTimeFormat(o, { weekday: "short" }), d = [], a = [];
3728
- for (let g = 0; g < 12; g++) {
3729
- const h = new Date(2024, g, 1);
3772
+ for (let l = 0; l < 12; l++) {
3773
+ const h = new Date(2024, l, 1);
3730
3774
  d.push(i.format(h)), a.push(r.format(h));
3731
3775
  }
3732
- const c = [], l = [];
3733
- for (let g = 0; g < 7; g++) {
3734
- const h = new Date(2024, 0, 7 + g);
3776
+ const c = [], g = [];
3777
+ for (let l = 0; l < 7; l++) {
3778
+ const h = new Date(2024, 0, 7 + l);
3735
3779
  c.push(s.format(h));
3736
3780
  const u = n.format(h);
3737
- l.push(u.substring(0, 2));
3781
+ g.push(u.substring(0, 2));
3738
3782
  }
3739
3783
  return {
3740
3784
  today: "Today",
@@ -3743,10 +3787,10 @@ class se {
3743
3787
  monthNames: d,
3744
3788
  monthNamesShort: a,
3745
3789
  weekdayNames: c,
3746
- weekdayNamesShort: l
3790
+ weekdayNamesShort: g
3747
3791
  };
3748
3792
  } catch {
3749
- return Fe;
3793
+ return Ve;
3750
3794
  }
3751
3795
  }
3752
3796
  /**
@@ -3769,7 +3813,7 @@ class se {
3769
3813
  const r = /* @__PURE__ */ new Date();
3770
3814
  this.state.viewYear = r.getFullYear(), this.state.viewMonth = r.getMonth();
3771
3815
  }
3772
- Fi(this.state), this.element = document.createElement("div"), this.element.className = "wg-datepicker-container", this.element.innerHTML = ki(this.state, this.options, this.localeStrings), document.body.appendChild(this.element), this.position(), this.attachListeners(), this.state.isOpen = !0, this.state.rollingSelectorOpen && Ce(this.element);
3816
+ Vi(this.state), this.element = document.createElement("div"), this.element.className = "wg-datepicker-container", this.element.innerHTML = ki(this.state, this.options, this.localeStrings), document.body.appendChild(this.element), this.position(), this.attachListeners(), this.state.isOpen = !0, this.state.rollingSelectorOpen && Ce(this.element);
3773
3817
  }
3774
3818
  /**
3775
3819
  * Close the date picker
@@ -3795,7 +3839,7 @@ class se {
3795
3839
  * Get formatted value
3796
3840
  */
3797
3841
  getFormattedValue() {
3798
- return Ve(this.state.selectedDate, this.formatInfo);
3842
+ return Fe(this.state.selectedDate, this.formatInfo);
3799
3843
  }
3800
3844
  /**
3801
3845
  * Position the picker using Floating UI
@@ -3803,7 +3847,7 @@ class se {
3803
3847
  position() {
3804
3848
  if (!this.element || !this.anchor) return;
3805
3849
  const e = this.element.querySelector(".wg-datepicker");
3806
- e && (this.cleanupAutoUpdate = Fo(this.anchor, e, () => {
3850
+ e && (this.cleanupAutoUpdate = Vo(this.anchor, e, () => {
3807
3851
  kt(this.anchor, e, {
3808
3852
  placement: "bottom-start",
3809
3853
  middleware: [
@@ -3854,7 +3898,7 @@ class se {
3854
3898
  const r = o.closest(".wg-datepicker__day");
3855
3899
  if (r) {
3856
3900
  e.preventDefault();
3857
- const a = Vi(r, this.state, this.options);
3901
+ const a = Fi(r, this.state, this.options);
3858
3902
  a && this.selectDate(a);
3859
3903
  return;
3860
3904
  }
@@ -3899,7 +3943,7 @@ class se {
3899
3943
  render() {
3900
3944
  if (!this.element) return;
3901
3945
  const e = this.element.querySelector(".wg-datepicker");
3902
- e && (Ri(e, this.state, this.localeStrings), Pi(e, this.state.rollingSelectorOpen), this.state.rollingSelectorOpen ? Ii(e, this.state) : Oi(e, this.state, this.options));
3946
+ e && (Hi(e, this.state, this.localeStrings), Ri(e, this.state.rollingSelectorOpen), this.state.rollingSelectorOpen ? Pi(e, this.state) : Oi(e, this.state, this.options));
3903
3947
  }
3904
3948
  /**
3905
3949
  * Connect an input field for masked input
@@ -3999,6 +4043,13 @@ const Xi = `
3999
4043
  flex: 1;
4000
4044
  }
4001
4045
 
4046
+ .wg-context-menu__shortcut {
4047
+ margin-left: auto;
4048
+ padding-left: 16px;
4049
+ color: var(--wg-cm-text-secondary);
4050
+ font-size: 0.9em;
4051
+ }
4052
+
4002
4053
  .wg-context-menu__divider {
4003
4054
  height: 1px;
4004
4055
  background: var(--wg-cm-border-color);
@@ -4014,12 +4065,12 @@ function Qi() {
4014
4065
  function Gi(t, e) {
4015
4066
  const o = t.filter((r) => r.visible === void 0 ? !0 : typeof r.visible == "function" ? r.visible(e) : r.visible);
4016
4067
  return o.length === 0 ? "" : `<div class="wg-context-menu">${o.map((r, s) => {
4017
- const n = typeof r.label == "function" ? r.label(e) : r.label, d = typeof r.icon == "function" ? r.icon(e) : r.icon, a = typeof r.disabled == "function" ? r.disabled(e) : r.disabled, c = r.danger === !0, l = [
4068
+ const n = typeof r.label == "function" ? r.label(e) : r.label, d = typeof r.icon == "function" ? r.icon(e) : r.icon, a = r.shortcut, c = typeof r.disabled == "function" ? r.disabled(e) : r.disabled, g = r.danger === !0, l = [
4018
4069
  "wg-context-menu__item",
4019
- a ? "wg-context-menu__item--disabled" : "",
4020
- c ? "wg-context-menu__item--danger" : ""
4021
- ].filter(Boolean).join(" "), g = r.dividerBefore && s > 0 ? '<div class="wg-context-menu__divider"></div>' : "", h = d ? `<span class="wg-context-menu__icon">${d}</span>` : "";
4022
- return `${g}<div class="${l}" data-item-id="${r.id}" data-disabled="${a ? "true" : "false"}">${h}<span class="wg-context-menu__label">${n}</span></div>`;
4070
+ c ? "wg-context-menu__item--disabled" : "",
4071
+ g ? "wg-context-menu__item--danger" : ""
4072
+ ].filter(Boolean).join(" "), h = r.dividerBefore && s > 0 ? '<div class="wg-context-menu__divider"></div>' : "", u = d ? `<span class="wg-context-menu__icon">${d}</span>` : "", p = a ? `<span class="wg-context-menu__shortcut">${a}</span>` : "";
4073
+ return `${h}<div class="${l}" data-item-id="${r.id}" data-disabled="${c ? "true" : "false"}" data-shortcut="${a || ""}">${u}<span class="wg-context-menu__label">${n}</span>${p}</div>`;
4023
4074
  }).join("")}</div>`;
4024
4075
  }
4025
4076
  function Ji(t, e, o, i, r, s, n) {
@@ -4059,21 +4110,60 @@ function Ji(t, e, o, i, r, s, n) {
4059
4110
  s(m);
4060
4111
  }
4061
4112
  });
4062
- const g = (u) => {
4063
- a.contains(u.target) || (vt(a, g, h), n());
4113
+ const l = (u) => {
4114
+ a.contains(u.target) || (ht(a, l, h), n());
4064
4115
  }, h = (u) => {
4065
- u.key === "Escape" && (u.preventDefault(), vt(a, g, h), n());
4116
+ if (u.key === "Escape") {
4117
+ u.preventDefault(), ht(a, l, h), n();
4118
+ return;
4119
+ }
4120
+ const p = u.key.toLowerCase(), m = a.querySelectorAll(".wg-context-menu__item");
4121
+ for (const b of m) {
4122
+ const f = b.dataset.shortcut;
4123
+ if (b.dataset.disabled === "true" || !f) continue;
4124
+ if (f.toLowerCase() === p || f === u.key) {
4125
+ u.preventDefault();
4126
+ const S = b.dataset.itemId || "";
4127
+ s(S), ht(a, l, h), n();
4128
+ return;
4129
+ }
4130
+ }
4066
4131
  };
4067
4132
  return setTimeout(() => {
4068
- document.addEventListener("mousedown", g), document.addEventListener("keydown", h);
4069
- }, 0), a._cleanup = { handleOutsideClick: g, handleKeyDown: h }, a;
4133
+ document.addEventListener("mousedown", l), document.addEventListener("keydown", h);
4134
+ }, 0), a._cleanup = { handleOutsideClick: l, handleKeyDown: h }, a;
4070
4135
  }
4071
- function vt(t, e, o) {
4136
+ function ht(t, e, o) {
4072
4137
  e && document.removeEventListener("mousedown", e), o && document.removeEventListener("keydown", o);
4073
4138
  const i = t._cleanup;
4074
4139
  i && (i.handleOutsideClick && document.removeEventListener("mousedown", i.handleOutsideClick), i.handleKeyDown && document.removeEventListener("keydown", i.handleKeyDown)), t.remove();
4075
4140
  }
4076
- class Zi extends HTMLElement {
4141
+ function Zi(t) {
4142
+ const e = t.split("+").map((i) => i.trim()), o = {
4143
+ key: "",
4144
+ ctrl: !1,
4145
+ shift: !1,
4146
+ alt: !1,
4147
+ meta: !1
4148
+ };
4149
+ for (const i of e) {
4150
+ const r = i.toLowerCase();
4151
+ r === "ctrl" || r === "control" ? o.ctrl = !0 : r === "shift" ? o.shift = !0 : r === "alt" ? o.alt = !0 : r === "meta" || r === "cmd" || r === "command" ? o.meta = !0 : o.key = i;
4152
+ }
4153
+ return o;
4154
+ }
4155
+ function tr(t, e) {
4156
+ if (e.ctrl !== t.ctrlKey || e.shift !== t.shiftKey || e.alt !== t.altKey || e.meta !== t.metaKey) return !1;
4157
+ const o = t.key.toLowerCase(), i = e.key.toLowerCase();
4158
+ return o === i;
4159
+ }
4160
+ function er(t) {
4161
+ return t.split("+").map((e) => {
4162
+ const o = e.trim();
4163
+ return ["ctrl", "control", "shift", "alt", "meta", "cmd", "command"].includes(o.toLowerCase()) ? o.charAt(0).toUpperCase() + o.slice(1).toLowerCase() : o;
4164
+ }).join("+");
4165
+ }
4166
+ class or extends HTMLElement {
4077
4167
  constructor() {
4078
4168
  super();
4079
4169
  // Core grid logic (composition)
@@ -4144,8 +4234,8 @@ class Zi extends HTMLElement {
4144
4234
  o.preventDefault();
4145
4235
  let d = ((c = o.clipboardData) == null ? void 0 : c.getData("text")) || "";
4146
4236
  if (s.beforePasteCallback) {
4147
- const l = s.beforePasteCallback(d, n);
4148
- d = l != null ? String(l) : "";
4237
+ const g = s.beforePasteCallback(d, n);
4238
+ d = g != null ? String(g) : "";
4149
4239
  }
4150
4240
  const a = String(s.field);
4151
4241
  this.grid.commitEdit(i, a, d), this.render();
@@ -4171,7 +4261,7 @@ class Zi extends HTMLElement {
4171
4261
  this.render(), this.addEventListener("paste", this.handlePaste);
4172
4262
  }
4173
4263
  disconnectedCallback() {
4174
- this.removeEventListener("paste", this.handlePaste), this.datepicker && (this.datepicker.destroy(), this.datepicker = null), this.contextMenuElement && (vt(this.contextMenuElement), this.contextMenuElement = null), At();
4264
+ this.removeEventListener("paste", this.handlePaste), this.datepicker && (this.datepicker.destroy(), this.datepicker = null), this.contextMenuElement && (ht(this.contextMenuElement), this.contextMenuElement = null), At();
4175
4265
  }
4176
4266
  // ==========================================================================
4177
4267
  // Public API - Proxy to WebGrid
@@ -4302,17 +4392,30 @@ class Zi extends HTMLElement {
4302
4392
  set rowToolbar(o) {
4303
4393
  this.grid.rowToolbar = o;
4304
4394
  }
4395
+ get toolbarVerticalAlign() {
4396
+ return this.grid.toolbarVerticalAlign;
4397
+ }
4398
+ set toolbarVerticalAlign(o) {
4399
+ this.grid.toolbarVerticalAlign = o;
4400
+ }
4401
+ get toolbarHorizontalAlign() {
4402
+ return this.grid.toolbarHorizontalAlign;
4403
+ }
4404
+ set toolbarHorizontalAlign(o) {
4405
+ this.grid.toolbarHorizontalAlign = o;
4406
+ }
4407
+ // Deprecated aliases
4305
4408
  get toolbarAlign() {
4306
- return this.grid.toolbarAlign;
4409
+ return this.grid.toolbarVerticalAlign;
4307
4410
  }
4308
4411
  set toolbarAlign(o) {
4309
- this.grid.toolbarAlign = o;
4412
+ this.grid.toolbarVerticalAlign = o;
4310
4413
  }
4311
4414
  get toolbarTopPosition() {
4312
- return this.grid.toolbarTopPosition;
4415
+ return this.grid.toolbarHorizontalAlign;
4313
4416
  }
4314
4417
  set toolbarTopPosition(o) {
4315
- this.grid.toolbarTopPosition = o;
4418
+ this.grid.toolbarHorizontalAlign = o;
4316
4419
  }
4317
4420
  get toolbarTrigger() {
4318
4421
  return this.grid.toolbarTrigger;
@@ -4332,6 +4435,31 @@ class Zi extends HTMLElement {
4332
4435
  set contextMenu(o) {
4333
4436
  this.grid.contextMenu = o;
4334
4437
  }
4438
+ // Row keyboard shortcuts
4439
+ get rowShortcuts() {
4440
+ return this.grid.rowShortcuts;
4441
+ }
4442
+ set rowShortcuts(o) {
4443
+ this.grid.rowShortcuts = o;
4444
+ }
4445
+ get showShortcutsHelp() {
4446
+ return this.grid.showShortcutsHelp;
4447
+ }
4448
+ set showShortcutsHelp(o) {
4449
+ this.grid.showShortcutsHelp = o;
4450
+ }
4451
+ get shortcutsHelpPosition() {
4452
+ return this.grid.shortcutsHelpPosition;
4453
+ }
4454
+ set shortcutsHelpPosition(o) {
4455
+ this.grid.shortcutsHelpPosition = o;
4456
+ }
4457
+ get shortcutsHelpContentCallback() {
4458
+ return this.grid.shortcutsHelpContentCallback;
4459
+ }
4460
+ set shortcutsHelpContentCallback(o) {
4461
+ this.grid.shortcutsHelpContentCallback = o;
4462
+ }
4335
4463
  // Legacy aliases
4336
4464
  get showRowActions() {
4337
4465
  return this.grid.showRowActions;
@@ -4547,6 +4675,26 @@ class Zi extends HTMLElement {
4547
4675
  getCellValidationError(o, i) {
4548
4676
  return this.grid.getCellValidationError(o, i);
4549
4677
  }
4678
+ // Public methods for focus and editing
4679
+ /**
4680
+ * Programmatically focus a cell. Updates state and focuses the DOM element.
4681
+ * State is updated immediately so pending renders use the correct position.
4682
+ */
4683
+ focusCell(o, i) {
4684
+ const r = this.grid.columns, s = this.grid.displayItems;
4685
+ o < 0 || o >= s.length || i < 0 || i >= r.length || (this.grid.setFocusedCell(o, i), requestAnimationFrame(() => {
4686
+ $(this, o, i);
4687
+ }));
4688
+ }
4689
+ /**
4690
+ * Programmatically start editing a cell.
4691
+ */
4692
+ startEditing(o, i) {
4693
+ const r = this.grid.columns;
4694
+ if (i < 0 || i >= r.length) return;
4695
+ const s = r[i], n = String(s.field);
4696
+ this.grid.startEdit(o, n);
4697
+ }
4550
4698
  // ==========================================================================
4551
4699
  // GridContext Implementation - Required by module functions
4552
4700
  // ==========================================================================
@@ -4564,7 +4712,7 @@ class Zi extends HTMLElement {
4564
4712
  }
4565
4713
  // Delegate to module function - needed for lifecycle module
4566
4714
  moveFocusAfterCommit(o, i, r) {
4567
- Ft(this, o, i, r);
4715
+ Vt(this, o, i, r);
4568
4716
  }
4569
4717
  // ==========================================================================
4570
4718
  // Update Mechanism
@@ -4591,20 +4739,41 @@ class Zi extends HTMLElement {
4591
4739
  * Handle keyboard navigation in cells
4592
4740
  */
4593
4741
  handleCellKeyDown(o, i, r) {
4594
- var c;
4742
+ var g;
4595
4743
  if (!this.grid.isNavigateMode)
4596
4744
  return;
4597
4745
  const s = this.grid.columns, n = this.grid.displayItems, d = this.grid.getEditableColumns(), a = d.findIndex((l) => l.index === r);
4598
4746
  if ((o.ctrlKey || o.metaKey) && o.key === "c") {
4599
- const l = s[r], g = n[i];
4600
- if (l && g) {
4601
- let h = this.grid.getCellRawValue(g, i, String(l.field));
4602
- l.beforeCopyCallback && (h = l.beforeCopyCallback(h, g));
4603
- const u = h != null ? String(h) : "";
4604
- navigator.clipboard.writeText(u);
4747
+ const l = s[r], h = n[i];
4748
+ if (l && h) {
4749
+ let u = this.grid.getCellRawValue(h, i, String(l.field));
4750
+ l.beforeCopyCallback && (u = l.beforeCopyCallback(u, h));
4751
+ const p = u != null ? String(u) : "";
4752
+ navigator.clipboard.writeText(p);
4605
4753
  }
4606
4754
  return;
4607
4755
  }
4756
+ const c = this.grid.rowShortcuts;
4757
+ if (c && c.length > 0) {
4758
+ const l = s[r], h = n[i];
4759
+ if (l && h)
4760
+ for (const u of c) {
4761
+ const p = Zi(u.key);
4762
+ if (tr(o, p)) {
4763
+ const m = {
4764
+ row: h,
4765
+ rowIndex: i,
4766
+ colIndex: r,
4767
+ column: l,
4768
+ cellValue: this.grid.getCellRawValue(h, i, String(l.field))
4769
+ };
4770
+ if (!(typeof u.disabled == "function" ? u.disabled(m) : u.disabled === !0)) {
4771
+ o.preventDefault(), u.action(m);
4772
+ return;
4773
+ }
4774
+ }
4775
+ }
4776
+ }
4608
4777
  switch (o.key) {
4609
4778
  case "ArrowUp":
4610
4779
  o.preventDefault(), i > 0 && $(this, i - 1, r);
@@ -4642,8 +4811,8 @@ class Zi extends HTMLElement {
4642
4811
  if (this.grid.shouldUseVirtualScroll()) {
4643
4812
  const l = this.grid.focusedCell;
4644
4813
  this.grid.setFocusedCell(0, 0), st(this, 0);
4645
- const g = this.shadow.querySelector('td[data-row="0"][data-col="0"]');
4646
- g && (g.focus({ preventScroll: !0 }), K(this, l, { rowIndex: 0, colIndex: 0 }));
4814
+ const h = this.shadow.querySelector('td[data-row="0"][data-col="0"]');
4815
+ h && (h.focus({ preventScroll: !0 }), K(this, l, { rowIndex: 0, colIndex: 0 }));
4647
4816
  } else
4648
4817
  $(this, 0, 0);
4649
4818
  else
@@ -4651,14 +4820,14 @@ class Zi extends HTMLElement {
4651
4820
  break;
4652
4821
  case "End":
4653
4822
  if (o.preventDefault(), o.ctrlKey) {
4654
- const l = n.length - 1, g = s.length - 1;
4823
+ const l = n.length - 1, h = s.length - 1;
4655
4824
  if (this.grid.shouldUseVirtualScroll()) {
4656
- const h = this.grid.focusedCell;
4657
- this.grid.setFocusedCell(l, g), st(this, l);
4658
- const u = this.shadow.querySelector(`td[data-row="${l}"][data-col="${g}"]`);
4659
- u && (u.focus({ preventScroll: !0 }), K(this, h, { rowIndex: l, colIndex: g }));
4825
+ const u = this.grid.focusedCell;
4826
+ this.grid.setFocusedCell(l, h), st(this, l);
4827
+ const p = this.shadow.querySelector(`td[data-row="${l}"][data-col="${h}"]`);
4828
+ p && (p.focus({ preventScroll: !0 }), K(this, u, { rowIndex: l, colIndex: h }));
4660
4829
  } else
4661
- $(this, l, g);
4830
+ $(this, l, h);
4662
4831
  } else
4663
4832
  $(this, i, s.length - 1);
4664
4833
  break;
@@ -4667,17 +4836,17 @@ class Zi extends HTMLElement {
4667
4836
  if (this.grid.shouldUseVirtualScroll()) {
4668
4837
  const l = this.grid.focusedCell;
4669
4838
  this.grid.setFocusedCell(0, r), st(this, 0);
4670
- const g = this.shadow.querySelector(`td[data-row="0"][data-col="${r}"]`);
4671
- g && (g.focus({ preventScroll: !0 }), K(this, l, { rowIndex: 0, colIndex: r }));
4839
+ const h = this.shadow.querySelector(`td[data-row="0"][data-col="${r}"]`);
4840
+ h && (h.focus({ preventScroll: !0 }), K(this, l, { rowIndex: 0, colIndex: r }));
4672
4841
  } else
4673
4842
  $(this, 0, r);
4674
4843
  else {
4675
4844
  const l = Math.max(0, i - 10);
4676
4845
  if (this.grid.shouldUseVirtualScroll()) {
4677
- const g = this.grid.focusedCell;
4846
+ const h = this.grid.focusedCell;
4678
4847
  this.grid.setFocusedCell(l, r), st(this, l);
4679
- const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4680
- h && (h.focus({ preventScroll: !0 }), K(this, g, { rowIndex: l, colIndex: r }));
4848
+ const u = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4849
+ u && (u.focus({ preventScroll: !0 }), K(this, h, { rowIndex: l, colIndex: r }));
4681
4850
  } else
4682
4851
  $(this, l, r);
4683
4852
  }
@@ -4686,19 +4855,19 @@ class Zi extends HTMLElement {
4686
4855
  if (o.preventDefault(), o.ctrlKey) {
4687
4856
  const l = n.length - 1;
4688
4857
  if (this.grid.shouldUseVirtualScroll()) {
4689
- const g = this.grid.focusedCell;
4858
+ const h = this.grid.focusedCell;
4690
4859
  this.grid.setFocusedCell(l, r), st(this, l);
4691
- const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4692
- h && (h.focus({ preventScroll: !0 }), K(this, g, { rowIndex: l, colIndex: r }));
4860
+ const u = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4861
+ u && (u.focus({ preventScroll: !0 }), K(this, h, { rowIndex: l, colIndex: r }));
4693
4862
  } else
4694
4863
  $(this, l, r);
4695
4864
  } else {
4696
4865
  const l = Math.min(n.length - 1, i + 10);
4697
4866
  if (this.grid.shouldUseVirtualScroll()) {
4698
- const g = this.grid.focusedCell;
4867
+ const h = this.grid.focusedCell;
4699
4868
  this.grid.setFocusedCell(l, r), st(this, l);
4700
- const h = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4701
- h && (h.focus({ preventScroll: !0 }), K(this, g, { rowIndex: l, colIndex: r }));
4869
+ const u = this.shadow.querySelector(`td[data-row="${l}"][data-col="${r}"]`);
4870
+ u && (u.focus({ preventScroll: !0 }), K(this, h, { rowIndex: l, colIndex: r }));
4702
4871
  } else
4703
4872
  $(this, l, r);
4704
4873
  }
@@ -4717,26 +4886,26 @@ class Zi extends HTMLElement {
4717
4886
  }
4718
4887
  case "F2": {
4719
4888
  o.preventDefault();
4720
- const l = s[r], g = (l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete", h = (l == null ? void 0 : l.editor) === "custom";
4721
- B(this, i, r), g ? requestAnimationFrame(() => {
4889
+ const l = s[r], h = (l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete", u = (l == null ? void 0 : l.editor) === "custom";
4890
+ B(this, i, r), h ? requestAnimationFrame(() => {
4722
4891
  this.dropdownOpen || W(this);
4723
- }) : h && requestAnimationFrame(() => {
4892
+ }) : u && requestAnimationFrame(() => {
4724
4893
  this.openCustomEditor(i, r);
4725
4894
  });
4726
4895
  break;
4727
4896
  }
4728
4897
  case " ": {
4729
4898
  o.preventDefault();
4730
- const l = s[r], g = (l == null ? void 0 : l.editor) === "checkbox", h = (l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete", u = (l == null ? void 0 : l.editor) === "date", p = (l == null ? void 0 : l.editor) === "custom";
4731
- g ? Zo(this, i, r) : h ? (B(this, i, r), requestAnimationFrame(() => {
4899
+ const l = s[r], h = (l == null ? void 0 : l.editor) === "checkbox", u = (l == null ? void 0 : l.editor) === "select" || (l == null ? void 0 : l.editor) === "combobox" || (l == null ? void 0 : l.editor) === "autocomplete", p = (l == null ? void 0 : l.editor) === "date", m = (l == null ? void 0 : l.editor) === "custom";
4900
+ h ? Zo(this, i, r) : u ? (B(this, i, r), requestAnimationFrame(() => {
4732
4901
  this.dropdownOpen || W(this);
4733
- })) : u ? (B(this, i, r), requestAnimationFrame(() => {
4902
+ })) : p ? (B(this, i, r), requestAnimationFrame(() => {
4734
4903
  var v;
4735
- const m = (v = this.shadowRoot) == null ? void 0 : v.querySelector(
4904
+ const b = (v = this.shadowRoot) == null ? void 0 : v.querySelector(
4736
4905
  `.wg__cell[data-row="${i}"][data-col="${r}"]`
4737
- ), f = m == null ? void 0 : m.querySelector(".wg__date-input"), b = m == null ? void 0 : m.querySelector(".wg__editor--date");
4738
- f && b && this.openDatePicker(f, b);
4739
- })) : p && (B(this, i, r), requestAnimationFrame(() => {
4906
+ ), f = b == null ? void 0 : b.querySelector(".wg__date-input"), _ = b == null ? void 0 : b.querySelector(".wg__editor--date");
4907
+ f && _ && this.openDatePicker(f, _);
4908
+ })) : m && (B(this, i, r), requestAnimationFrame(() => {
4740
4909
  this.openCustomEditor(i, r);
4741
4910
  }));
4742
4911
  break;
@@ -4746,23 +4915,23 @@ class Zi extends HTMLElement {
4746
4915
  Y(this), this.grid.cancelEdit();
4747
4916
  else {
4748
4917
  const l = this.grid.focusedCell;
4749
- this.grid.clearFocusedCell(), K(this, l, null), (c = o.target) == null || c.blur();
4918
+ this.grid.clearFocusedCell(), K(this, l, null), (g = o.target) == null || g.blur();
4750
4919
  }
4751
4920
  break;
4752
4921
  case "Delete": {
4753
4922
  o.preventDefault();
4754
- const l = s[r], g = n[i];
4923
+ const l = s[r], h = n[i];
4755
4924
  if (o.ctrlKey) {
4756
- if (g) {
4757
- const h = { rowIndex: i, row: g };
4758
- this.grid.onrowdelete && this.grid.onrowdelete(h), this.dispatchEvent(new CustomEvent("rowdelete", { detail: h }));
4925
+ if (h) {
4926
+ const u = { rowIndex: i, row: h };
4927
+ this.grid.onrowdelete && this.grid.onrowdelete(u), this.dispatchEvent(new CustomEvent("rowdelete", { detail: u }));
4759
4928
  }
4760
4929
  } else
4761
4930
  l && this.grid.isCellEditable(l) && (this.grid.commitEdit(i, String(l.field), null), this.render(), requestAnimationFrame(() => {
4762
- const h = this.shadow.querySelector(
4931
+ const u = this.shadow.querySelector(
4763
4932
  `td[data-row="${i}"][data-col="${r}"]`
4764
4933
  );
4765
- h == null || h.focus();
4934
+ u == null || u.focus();
4766
4935
  }));
4767
4936
  break;
4768
4937
  }
@@ -4783,38 +4952,38 @@ class Zi extends HTMLElement {
4783
4952
  * Handle keydown in editor inputs
4784
4953
  */
4785
4954
  handleEditorKeyDown(o, i) {
4786
- const r = parseInt(i.dataset.row || "0", 10), s = i.dataset.field || "", n = this.grid.columns.find((l) => l.field === s), d = (n == null ? void 0 : n.editor) || "text", a = d === "select" || d === "combobox" || d === "autocomplete", c = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End"];
4955
+ const r = parseInt(i.dataset.row || "0", 10), s = i.dataset.field || "", n = this.grid.columns.find((g) => g.field === s), d = (n == null ? void 0 : n.editor) || "text", a = d === "select" || d === "combobox" || d === "autocomplete", c = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown", "Home", "End"];
4787
4956
  if (a && !this.dropdownOpen && c.includes(o.key)) {
4788
4957
  o.preventDefault(), o.stopPropagation();
4789
- const l = this.grid.columns.findIndex((b) => b.field === s), g = this.grid.columns.map((b, v) => ({ index: v, column: b })).filter((b) => b.column.editable !== !1), h = g.findIndex((b) => b.index === l), u = this.grid.displayItems;
4790
- let p = r, m = l, f = !1;
4958
+ const g = this.grid.columns.findIndex((f) => f.field === s), l = this.grid.columns.map((f, _) => ({ index: _, column: f })).filter((f) => f.column.editable !== !1), h = l.findIndex((f) => f.index === g), u = this.grid.displayItems;
4959
+ let p = r, m = g, b = !1;
4791
4960
  switch (o.key) {
4792
4961
  case "ArrowUp":
4793
- r > 0 && (p = r - 1, f = !0);
4962
+ r > 0 && (p = r - 1, b = !0);
4794
4963
  break;
4795
4964
  case "ArrowDown":
4796
- r < u.length - 1 && (p = r + 1, f = !0);
4965
+ r < u.length - 1 && (p = r + 1, b = !0);
4797
4966
  break;
4798
4967
  case "ArrowLeft":
4799
- h > 0 && (m = g[h - 1].index, f = !0);
4968
+ h > 0 && (m = l[h - 1].index, b = !0);
4800
4969
  break;
4801
4970
  case "ArrowRight":
4802
- h < g.length - 1 && (m = g[h + 1].index, f = !0);
4971
+ h < l.length - 1 && (m = l[h + 1].index, b = !0);
4803
4972
  break;
4804
4973
  case "PageUp":
4805
- p = Math.max(0, r - 10), f = !0;
4974
+ p = Math.max(0, r - 10), b = !0;
4806
4975
  break;
4807
4976
  case "PageDown":
4808
- p = Math.min(u.length - 1, r + 10), f = !0;
4977
+ p = Math.min(u.length - 1, r + 10), b = !0;
4809
4978
  break;
4810
4979
  case "Home":
4811
- o.ctrlKey && (p = 0), m = 0, f = !0;
4980
+ o.ctrlKey && (p = 0), m = 0, b = !0;
4812
4981
  break;
4813
4982
  case "End":
4814
- o.ctrlKey ? (p = u.length - 1, m = this.grid.columns.length - 1) : m = this.grid.columns.length - 1, f = !0;
4983
+ o.ctrlKey ? (p = u.length - 1, m = this.grid.columns.length - 1) : m = this.grid.columns.length - 1, b = !0;
4815
4984
  break;
4816
4985
  }
4817
- f && (Y(this), this.grid.cancelEdit(), queueMicrotask(() => {
4986
+ b && (Y(this), this.grid.cancelEdit(), queueMicrotask(() => {
4818
4987
  $(this, p, m);
4819
4988
  }));
4820
4989
  return;
@@ -4823,41 +4992,41 @@ class Zi extends HTMLElement {
4823
4992
  case "ArrowDown":
4824
4993
  if (this.dropdownOpen) {
4825
4994
  o.preventDefault(), o.stopPropagation();
4826
- const l = this.getCurrentEditorOptions();
4827
- let g = this.highlightedIndex + 1;
4828
- for (; g < this.dropdownOptions.length && mt(this.dropdownOptions[g], l); )
4829
- g++;
4830
- g < this.dropdownOptions.length && (this.highlightedIndex = g, et(this), fe(this));
4995
+ const g = this.getCurrentEditorOptions();
4996
+ let l = this.highlightedIndex + 1;
4997
+ for (; l < this.dropdownOptions.length && bt(this.dropdownOptions[l], g); )
4998
+ l++;
4999
+ l < this.dropdownOptions.length && (this.highlightedIndex = l, et(this), fe(this));
4831
5000
  }
4832
5001
  break;
4833
5002
  case "ArrowUp":
4834
5003
  if (this.dropdownOpen) {
4835
5004
  o.preventDefault(), o.stopPropagation();
4836
- const l = this.getCurrentEditorOptions();
4837
- let g = this.highlightedIndex - 1;
4838
- for (; g >= 0 && mt(this.dropdownOptions[g], l); )
4839
- g--;
4840
- g >= 0 && (this.highlightedIndex = g, et(this), fe(this));
5005
+ const g = this.getCurrentEditorOptions();
5006
+ let l = this.highlightedIndex - 1;
5007
+ for (; l >= 0 && bt(this.dropdownOptions[l], g); )
5008
+ l--;
5009
+ l >= 0 && (this.highlightedIndex = l, et(this), fe(this));
4841
5010
  }
4842
5011
  break;
4843
5012
  case "Enter":
4844
5013
  if (this.datepicker)
4845
5014
  return;
4846
- o.preventDefault(), o.stopPropagation(), this.dropdownOpen && this.highlightedIndex >= 0 ? Ie(this, this.highlightedIndex) : a && !this.dropdownOpen ? W(this) : (this.isCommittingFromKeyboard = !0, L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : Mt(this, i), Ft(this, r, s, "down"));
5015
+ o.preventDefault(), o.stopPropagation(), this.dropdownOpen && this.highlightedIndex >= 0 ? Pe(this, this.highlightedIndex) : a && !this.dropdownOpen ? W(this) : (this.isCommittingFromKeyboard = !0, L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : Mt(this, i), Vt(this, r, s, "down"));
4847
5016
  break;
4848
5017
  case "Tab":
4849
5018
  if (this.datepicker)
4850
5019
  return;
4851
5020
  if (o.preventDefault(), o.stopPropagation(), this.isCommittingFromKeyboard = !0, this.dropdownOpen && this.highlightedIndex >= 0 && a) {
4852
- const l = this.dropdownOptions[this.highlightedIndex], g = this.getCurrentEditorOptions();
4853
- if (l && !mt(l, g)) {
4854
- const h = at(l, g);
5021
+ const g = this.dropdownOptions[this.highlightedIndex], l = this.getCurrentEditorOptions();
5022
+ if (g && !bt(g, l)) {
5023
+ const h = at(g, l);
4855
5024
  this.grid.commitEdit(r, s, h);
4856
5025
  }
4857
5026
  L(this);
4858
5027
  } else
4859
5028
  L(this), d === "date" && i instanceof HTMLInputElement ? this.commitDateEditor(i) : a || Mt(this, i);
4860
- Ft(this, r, s, o.shiftKey ? "prev" : "next");
5029
+ Vt(this, r, s, o.shiftKey ? "prev" : "next");
4861
5030
  break;
4862
5031
  case "Escape":
4863
5032
  o.preventDefault(), o.stopPropagation(), this.dropdownOpen && L(this), this.datepicker && (this.datepicker.close(!0), this.datepicker = null), this.isCommittingFromKeyboard = !0, Y(this), this.grid.cancelEdit(), ei(this, r, s);
@@ -4887,8 +5056,8 @@ class Zi extends HTMLElement {
4887
5056
  Xo(this, a, c);
4888
5057
  }
4889
5058
  if (n.matches(".wg__select-trigger, .wg__combobox-input, .wg__autocomplete-input") && !this.justSelected && !this.dropdownOpen) {
4890
- const a = n.dataset.field || "", c = this.grid.columns.find((h) => h.field === a), l = (c == null ? void 0 : c.editorOptions) || {};
4891
- (((d = this.grid.editingCell) == null ? void 0 : d.initialSearchQuery) !== void 0 || l.showOnFocus !== !1) && W(this);
5059
+ const a = n.dataset.field || "", c = this.grid.columns.find((h) => h.field === a), g = (c == null ? void 0 : c.editorOptions) || {};
5060
+ (((d = this.grid.editingCell) == null ? void 0 : d.initialSearchQuery) !== void 0 || g.showOnFocus !== !1) && W(this);
4892
5061
  }
4893
5062
  }, !0), o.addEventListener("keydown", (s) => {
4894
5063
  const n = s.target;
@@ -4906,13 +5075,13 @@ class Zi extends HTMLElement {
4906
5075
  s.preventDefault();
4907
5076
  const d = s.target.closest(".wg__cell");
4908
5077
  if (d) {
4909
- const a = parseInt(d.dataset.row || "0", 10), c = parseInt(d.dataset.col || "0", 10), l = this.grid.columns[c];
4910
- if (l) {
4911
- const g = l.editTrigger || this.grid.editTrigger;
4912
- if (g === "dblclick" || g === "navigate") {
5078
+ const a = parseInt(d.dataset.row || "0", 10), c = parseInt(d.dataset.col || "0", 10), g = this.grid.columns[c];
5079
+ if (g) {
5080
+ const l = g.editTrigger || this.grid.editTrigger;
5081
+ if (l === "dblclick" || l === "navigate") {
4913
5082
  const h = zt(s, d);
4914
5083
  B(this, a, c, { cursorPosition: h ?? void 0 });
4915
- const u = l.editor;
5084
+ const u = g.editor;
4916
5085
  u === "select" || u === "combobox" || u === "autocomplete" ? requestAnimationFrame(() => {
4917
5086
  this.dropdownOpen || W(this);
4918
5087
  }) : u === "custom" && requestAnimationFrame(() => {
@@ -4924,12 +5093,12 @@ class Zi extends HTMLElement {
4924
5093
  }), o.addEventListener("click", (s) => {
4925
5094
  const d = s.target.closest(".wg__cell");
4926
5095
  if (d && !d.classList.contains("wg__cell--editing")) {
4927
- const a = parseInt(d.dataset.row || "0", 10), c = parseInt(d.dataset.col || "0", 10), l = this.grid.columns[c];
4928
- if (l && (l.editTrigger || this.grid.editTrigger) === "click") {
5096
+ const a = parseInt(d.dataset.row || "0", 10), c = parseInt(d.dataset.col || "0", 10), g = this.grid.columns[c];
5097
+ if (g && (g.editTrigger || this.grid.editTrigger) === "click") {
4929
5098
  s.preventDefault();
4930
5099
  const h = zt(s, d);
4931
5100
  B(this, a, c, { cursorPosition: h ?? void 0 });
4932
- const u = l.editor;
5101
+ const u = g.editor;
4933
5102
  u === "select" || u === "combobox" || u === "autocomplete" ? requestAnimationFrame(() => {
4934
5103
  this.dropdownOpen || W(this);
4935
5104
  }) : u === "custom" && requestAnimationFrame(() => {
@@ -4943,15 +5112,15 @@ class Zi extends HTMLElement {
4943
5112
  s.preventDefault(), s.stopPropagation();
4944
5113
  const a = n.closest(".wg__cell-date-display"), c = n.closest(".wg__editor--date");
4945
5114
  if (c) {
4946
- const l = c.querySelector(".wg__date-input");
4947
- l && this.openDatePicker(l, c);
5115
+ const g = c.querySelector(".wg__date-input");
5116
+ g && this.openDatePicker(g, c);
4948
5117
  } else if (a) {
4949
- const l = parseInt(a.dataset.row || "0", 10), g = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === g);
4950
- h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, l, h), requestAnimationFrame(() => {
4951
- var f;
5118
+ const g = parseInt(a.dataset.row || "0", 10), l = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === l);
5119
+ h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, g, h), requestAnimationFrame(() => {
5120
+ var b;
4952
5121
  this.isTransitioningCells = !1;
4953
- const u = (f = this.shadowRoot) == null ? void 0 : f.querySelector(
4954
- `.wg__cell[data-row="${l}"][data-field="${g}"]`
5122
+ const u = (b = this.shadowRoot) == null ? void 0 : b.querySelector(
5123
+ `.wg__cell[data-row="${g}"][data-field="${l}"]`
4955
5124
  ), p = u == null ? void 0 : u.querySelector(".wg__date-input"), m = u == null ? void 0 : u.querySelector(".wg__editor--date");
4956
5125
  p && m && this.openDatePicker(p, m);
4957
5126
  }));
@@ -4961,20 +5130,20 @@ class Zi extends HTMLElement {
4961
5130
  if (this.dropdownOpen || this.grid.editingCell) {
4962
5131
  const a = n.closest(".wg__cell");
4963
5132
  if (a && !n.closest(".wg__editor--select, .wg__editor--combobox, .wg__editor--autocomplete, .wg__editor--date")) {
4964
- const c = parseInt(a.dataset.row || "0", 10), l = parseInt(a.dataset.col || "0", 10), g = this.grid.editingCell, h = n.matches(".wg__combobox-toggle, .wg__select-toggle, .wg__date-trigger");
4965
- if (g && !h) {
4966
- const u = this.grid.columns.findIndex((p) => String(p.field) === g.field);
4967
- if (c !== g.rowIndex || l !== u) {
5133
+ const c = parseInt(a.dataset.row || "0", 10), g = parseInt(a.dataset.col || "0", 10), l = this.grid.editingCell, h = n.matches(".wg__combobox-toggle, .wg__select-toggle, .wg__date-trigger");
5134
+ if (l && !h) {
5135
+ const u = this.grid.columns.findIndex((p) => String(p.field) === l.field);
5136
+ if (c !== l.rowIndex || g !== u) {
4968
5137
  s.preventDefault(), this.isTransitioningCells = !0, L(this), Y(this), this.grid.cancelEdit();
4969
- const p = this.grid.columns[l], m = (p == null ? void 0 : p.editTrigger) || this.grid.editTrigger, b = s.clientX;
5138
+ const p = this.grid.columns[g], m = (p == null ? void 0 : p.editTrigger) || this.grid.editTrigger, f = s.clientX;
4970
5139
  requestAnimationFrame(() => {
4971
5140
  if (this.isTransitioningCells = !1, m === "click" && p && this.grid.isCellEditable(p)) {
4972
- const v = this.shadow.querySelector(
4973
- `td[data-row="${c}"][data-col="${l}"]`
4974
- ), _ = v ? zt({ clientX: b }, v) : void 0;
4975
- B(this, c, l, { cursorPosition: _ ?? void 0 });
5141
+ const _ = this.shadow.querySelector(
5142
+ `td[data-row="${c}"][data-col="${g}"]`
5143
+ ), v = _ ? zt({ clientX: f }, _) : void 0;
5144
+ B(this, c, g, { cursorPosition: v ?? void 0 });
4976
5145
  } else
4977
- $(this, c, l);
5146
+ $(this, c, g);
4978
5147
  });
4979
5148
  return;
4980
5149
  }
@@ -4987,8 +5156,8 @@ class Zi extends HTMLElement {
4987
5156
  if (n.closest(".wg__editor--select, .wg__editor--combobox, .wg__editor--autocomplete"))
4988
5157
  me(this);
4989
5158
  else if (a) {
4990
- const l = parseInt(a.dataset.row || "0", 10), g = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === g);
4991
- h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, l, h), requestAnimationFrame(() => {
5159
+ const g = parseInt(a.dataset.row || "0", 10), l = a.dataset.field || "", h = this.grid.columns.findIndex((u) => String(u.field) === l);
5160
+ h >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, g, h), requestAnimationFrame(() => {
4992
5161
  this.isTransitioningCells = !1, this.dropdownOpen || W(this);
4993
5162
  }));
4994
5163
  }
@@ -4997,8 +5166,8 @@ class Zi extends HTMLElement {
4997
5166
  s.preventDefault(), s.stopPropagation();
4998
5167
  const a = n.closest(".wg__cell-dropdown-display");
4999
5168
  if (a) {
5000
- const c = parseInt(a.dataset.row || "0", 10), l = a.dataset.field || "", g = this.grid.columns.findIndex((h) => String(h.field) === l);
5001
- g >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, c, g), requestAnimationFrame(() => {
5169
+ const c = parseInt(a.dataset.row || "0", 10), g = a.dataset.field || "", l = this.grid.columns.findIndex((h) => String(h.field) === g);
5170
+ l >= 0 && (this.isTransitioningCells = !0, this.grid.editingCell && (L(this), Y(this), this.grid.cancelEdit()), B(this, c, l), requestAnimationFrame(() => {
5002
5171
  this.isTransitioningCells = !1, this.dropdownOpen || W(this);
5003
5172
  }));
5004
5173
  }
@@ -5010,8 +5179,8 @@ class Zi extends HTMLElement {
5010
5179
  if (a) {
5011
5180
  const c = a.dataset.field;
5012
5181
  if (!c) return;
5013
- const l = [...this.grid.sort], g = l.findIndex((u) => u.column === c);
5014
- (n.ctrlKey || n.metaKey) && this.grid.sortMode === "multi" ? g >= 0 ? l[g].direction === "asc" ? l[g] = { column: c, direction: "desc" } : l.splice(g, 1) : l.push({ column: c, direction: "asc" }) : g >= 0 && l.length === 1 ? l[0].direction === "asc" ? l[0] = { column: c, direction: "desc" } : l.length = 0 : (l.length = 0, l.push({ column: c, direction: "asc" })), this.grid.sort = l, this.grid.pageable && (this.grid.currentPage = 1), this.grid.fireDataRequest("sort"), this.render();
5182
+ const g = [...this.grid.sort], l = g.findIndex((u) => u.column === c);
5183
+ (n.ctrlKey || n.metaKey) && this.grid.sortMode === "multi" ? l >= 0 ? g[l].direction === "asc" ? g[l] = { column: c, direction: "desc" } : g.splice(l, 1) : g.push({ column: c, direction: "asc" }) : l >= 0 && g.length === 1 ? g[0].direction === "asc" ? g[0] = { column: c, direction: "desc" } : g.length = 0 : (g.length = 0, g.push({ column: c, direction: "asc" })), this.grid.sort = g, this.grid.pageable && (this.grid.currentPage = 1), this.grid.fireDataRequest("sort"), this.render();
5015
5184
  }
5016
5185
  }), o.addEventListener("contextmenu", (s) => {
5017
5186
  this.handleContextMenu(s);
@@ -5029,17 +5198,17 @@ class Zi extends HTMLElement {
5029
5198
  if (L(this), this.grid.editingCell) {
5030
5199
  const d = n, a = this.getCurrentEditingColumn();
5031
5200
  if (a) {
5032
- const c = a.editorOptions || {}, g = (c.options || c.initialOptions || []).find(
5201
+ const c = a.editorOptions || {}, l = (c.options || c.initialOptions || []).find(
5033
5202
  (h) => Ct(h, c).toLowerCase() === d.value.toLowerCase()
5034
5203
  );
5035
- g ? this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field, at(g, c)) : this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field, d.value);
5204
+ l ? this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field, at(l, c)) : this.grid.commitEdit(this.grid.editingCell.rowIndex, this.grid.editingCell.field, d.value);
5036
5205
  }
5037
5206
  }
5038
5207
  }
5039
5208
  }, !0);
5040
5209
  const i = this.shadow.querySelector(".wg");
5041
5210
  i && i.addEventListener("scroll", () => {
5042
- this.dropdownOpen && !this.isTransitioningCells && !this.isOpeningDropdown && (L(this), Y(this), this.grid.cancelEdit()), this.grid.shouldUseVirtualScroll() && this.handleVirtualScroll(i), this.grid.infiniteScroll && this.grid.hasMoreItems && !this.isLoadingMoreItems && this.handleInfiniteScroll(i), bt() !== null && (_e(this, this.grid.displayItems), this.renderConnector());
5211
+ this.dropdownOpen && !this.isTransitioningCells && !this.isOpeningDropdown && (L(this), Y(this), this.grid.cancelEdit()), this.grid.shouldUseVirtualScroll() && this.handleVirtualScroll(i), this.grid.infiniteScroll && this.grid.hasMoreItems && !this.isLoadingMoreItems && this.handleInfiniteScroll(i), vt() !== null && (_e(this, this.grid.displayItems), this.renderConnector());
5043
5212
  }), this.wheelListenerAdded || (this.wheelListenerAdded = !0, window.addEventListener("scroll", () => {
5044
5213
  this.dropdownOpen && !this.isTransitioningCells && (L(this), Y(this), this.grid.cancelEdit());
5045
5214
  }, { passive: !0, capture: !0 })), o.addEventListener("mouseenter", (s) => {
@@ -5077,8 +5246,8 @@ class Zi extends HTMLElement {
5077
5246
  if (s.target.closest(".wg__row")) {
5078
5247
  if (this.toolbarMoveInProgress) return;
5079
5248
  this.toolbarHideTimeout && clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = setTimeout(() => {
5080
- const c = this.shadow.querySelector(".wg__toolbar-container"), l = c == null ? void 0 : c.matches(":hover"), g = o.matches(":hover");
5081
- !l && !g && (this.closeToolbarAndReset(), this.grid.editingCell || this.render());
5249
+ const c = this.shadow.querySelector(".wg__toolbar-container"), g = c == null ? void 0 : c.matches(":hover"), l = o.matches(":hover");
5250
+ !g && !l && (this.closeToolbarAndReset(), this.grid.editingCell || this.render());
5082
5251
  }, 150);
5083
5252
  }
5084
5253
  }, !0), o.addEventListener("click", (s) => {
@@ -5091,23 +5260,23 @@ class Zi extends HTMLElement {
5091
5260
  }), this.toolbarOutsideClickAdded || (this.toolbarOutsideClickAdded = !0, document.addEventListener("click", (s) => {
5092
5261
  if (!wi(this.shadow))
5093
5262
  return;
5094
- const n = s.composedPath(), d = n.some((l) => {
5095
- var g;
5096
- return (g = l.classList) == null ? void 0 : g.contains("wg__toolbar-container");
5097
- }), a = n.some((l) => {
5098
- var g;
5099
- return (g = l.classList) == null ? void 0 : g.contains("wg__toolbar-trigger");
5263
+ const n = s.composedPath(), d = n.some((g) => {
5264
+ var l;
5265
+ return (l = g.classList) == null ? void 0 : l.contains("wg__toolbar-container");
5266
+ }), a = n.some((g) => {
5267
+ var l;
5268
+ return (l = g.classList) == null ? void 0 : l.contains("wg__toolbar-trigger");
5100
5269
  });
5101
- d || a || n.includes(this) && (this.grid.toolbarTrigger === "hover" || this.grid.toolbarTrigger === "click") || bt() !== null && (this.closeToolbarAndReset(), this.render());
5270
+ d || a || n.includes(this) && (this.grid.toolbarTrigger === "hover" || this.grid.toolbarTrigger === "click") || vt() !== null && (this.closeToolbarAndReset(), this.render());
5102
5271
  })), this.toolbarScrollListenerAdded || (this.toolbarScrollListenerAdded = !0, window.addEventListener("scroll", () => {
5103
- bt() !== null && (this.closeToolbarAndReset(), this.render());
5272
+ vt() !== null && (this.closeToolbarAndReset(), this.render());
5104
5273
  }, !0)), this.shadow.querySelectorAll(".wg__pagination").forEach((s) => {
5105
5274
  s.addEventListener("click", (d) => {
5106
5275
  const c = d.target.closest(".wg__pagination-btn");
5107
5276
  if (!c || c.hasAttribute("disabled")) return;
5108
- const l = c.dataset.action;
5109
- let g = !1;
5110
- l === "first" && this.grid.currentPage !== 1 ? (this.grid.currentPage = 1, g = !0) : l === "prev" && this.grid.currentPage > 1 ? (this.grid.currentPage--, g = !0) : l === "next" && this.grid.currentPage < this.grid.totalPages ? (this.grid.currentPage++, g = !0) : l === "last" && this.grid.currentPage !== this.grid.totalPages && (this.grid.currentPage = this.grid.totalPages, g = !0), g && (this.grid.fireDataRequest("page"), this.render());
5277
+ const g = c.dataset.action;
5278
+ let l = !1;
5279
+ g === "first" && this.grid.currentPage !== 1 ? (this.grid.currentPage = 1, l = !0) : g === "prev" && this.grid.currentPage > 1 ? (this.grid.currentPage--, l = !0) : g === "next" && this.grid.currentPage < this.grid.totalPages ? (this.grid.currentPage++, l = !0) : g === "last" && this.grid.currentPage !== this.grid.totalPages && (this.grid.currentPage = this.grid.totalPages, l = !0), l && (this.grid.fireDataRequest("page"), this.render());
5111
5280
  });
5112
5281
  const n = s.querySelector(".wg__pagination-select");
5113
5282
  n && n.addEventListener("change", () => {
@@ -5126,13 +5295,13 @@ class Zi extends HTMLElement {
5126
5295
  const i = this.grid.displayItems, r = this.grid.virtualScrollRowHeight, s = this.grid.virtualScrollBuffer, n = o.scrollTop, d = o.clientHeight;
5127
5296
  let a = Math.max(0, Math.floor(n / r) - s);
5128
5297
  const c = Math.ceil(d / r) + s * 2;
5129
- let l = Math.min(i.length, a + c);
5130
- const g = this.grid.editingCell;
5131
- if (g) {
5132
- const h = g.rowIndex;
5133
- h < a && (a = h), h >= l && (l = h + 1);
5298
+ let g = Math.min(i.length, a + c);
5299
+ const l = this.grid.editingCell;
5300
+ if (l) {
5301
+ const h = l.rowIndex;
5302
+ h < a && (a = h), h >= g && (g = h + 1);
5134
5303
  }
5135
- (a !== this.virtualScrollStart || l !== this.virtualScrollEnd) && (this.virtualScrollStart = a, this.virtualScrollEnd = l, this.renderVirtualRows(o));
5304
+ (a !== this.virtualScrollStart || g !== this.virtualScrollEnd) && (this.virtualScrollStart = a, this.virtualScrollEnd = g, this.renderVirtualRows(o));
5136
5305
  }
5137
5306
  /**
5138
5307
  * Render only the tbody with virtual rows (fast update, no full re-render)
@@ -5165,45 +5334,76 @@ class Zi extends HTMLElement {
5165
5334
  // ==========================================================================
5166
5335
  // Rendering
5167
5336
  // ==========================================================================
5337
+ /**
5338
+ * Render the shortcuts help icon and overlay
5339
+ */
5340
+ renderShortcutsHelpIcon() {
5341
+ var n, d, a;
5342
+ if (!this.grid.showShortcutsHelp || !((n = this.grid.rowShortcuts) != null && n.length))
5343
+ return "";
5344
+ const i = this.grid.shortcutsHelpPosition === "top-left" ? "wg__shortcuts-help--left" : "", r = this.grid.rowShortcuts.map((c) => `<div class="wg__shortcuts-help-item">
5345
+ <span class="wg__shortcuts-help-key">${er(c.key)}</span>
5346
+ <span class="wg__shortcuts-help-label">${c.label}</span>
5347
+ </div>`).join(""), s = ((a = (d = this.grid).shortcutsHelpContentCallback) == null ? void 0 : a.call(d)) || "";
5348
+ return `
5349
+ <div class="wg__shortcuts-help ${i}">
5350
+ <button class="wg__shortcuts-help-icon" type="button" title="Keyboard shortcuts">
5351
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
5352
+ <circle cx="12" cy="12" r="10"></circle>
5353
+ <path d="M12 16v-4"></path>
5354
+ <path d="M12 8h.01"></path>
5355
+ </svg>
5356
+ </button>
5357
+ <div class="wg__shortcuts-help-overlay">
5358
+ ${s ? `<div class="wg__shortcuts-help-custom">${s}</div>` : ""}
5359
+ <div class="wg__shortcuts-help-title">Keyboard Shortcuts</div>
5360
+ <div class="wg__shortcuts-help-list">
5361
+ ${r}
5362
+ </div>
5363
+ </div>
5364
+ </div>
5365
+ `;
5366
+ }
5168
5367
  render() {
5169
- var m;
5368
+ var b;
5170
5369
  const o = this.shadow.querySelector(".wg"), i = (o == null ? void 0 : o.scrollTop) || 0, r = (o == null ? void 0 : o.scrollLeft) || 0, s = this.grid.focusedCell;
5171
5370
  o && o.remove();
5172
5371
  const n = document.createElement("div");
5173
5372
  n.className = bi(this);
5174
- const d = this.grid.paginationPosition.split("|").map((f) => f.trim()), a = this.grid.summaryPosition ? this.grid.summaryPosition.split("|").map((f) => f.trim()) : [], c = (f, b) => {
5373
+ const d = this.grid.paginationPosition.split("|").map((f) => f.trim()), a = this.grid.summaryPosition ? this.grid.summaryPosition.split("|").map((f) => f.trim()) : [], c = (f, _) => {
5175
5374
  const v = d.filter(
5176
- (x) => b ? x.startsWith("top-") : x.startsWith("bottom-")
5177
- ), _ = a.filter(
5178
- (x) => b ? x.startsWith("top-") : x.startsWith("bottom-")
5179
- ), S = v.length > 0, y = _.length > 0;
5180
- return !S && !y ? "" : y && S && this.grid.summaryInline ? `<div class="wg__footer${b ? " wg__footer--top" : ""}">
5181
- ${Nt(this, _[0])}
5375
+ (y) => _ ? y.startsWith("top-") : y.startsWith("bottom-")
5376
+ ), S = a.filter(
5377
+ (y) => _ ? y.startsWith("top-") : y.startsWith("bottom-")
5378
+ ), C = v.length > 0, x = S.length > 0;
5379
+ return !C && !x ? "" : x && C && this.grid.summaryInline ? `<div class="wg__footer${_ ? " wg__footer--top" : ""}">
5380
+ ${Nt(this, S[0])}
5182
5381
  ${Yt(this, v[0])}
5183
- </div>` : [.../* @__PURE__ */ new Set([...v, ..._])].map((x) => {
5184
- const C = v.includes(x), T = _.includes(x);
5185
- return T && C ? `<div class="wg__footer${b ? " wg__footer--top" : ""}">
5186
- ${Nt(this, x)}
5187
- ${Yt(this, x)}
5188
- </div>` : T ? Nt(this, x) : Yt(this, x);
5382
+ </div>` : [.../* @__PURE__ */ new Set([...v, ...S])].map((y) => {
5383
+ const T = v.includes(y), k = S.includes(y);
5384
+ return k && T ? `<div class="wg__footer${_ ? " wg__footer--top" : ""}">
5385
+ ${Nt(this, y)}
5386
+ ${Yt(this, y)}
5387
+ </div>` : k ? Nt(this, y) : Yt(this, y);
5189
5388
  }).join("");
5190
- }, l = c(d, !0), g = c(d, !1), h = this.grid.shouldUseVirtualScroll();
5389
+ }, g = c(d, !0), l = c(d, !1), h = this.grid.shouldUseVirtualScroll();
5191
5390
  let u;
5192
5391
  if (h) {
5193
- const f = this.grid.displayItems, b = this.grid.virtualScrollRowHeight, v = this.grid.virtualScrollBuffer, _ = (o == null ? void 0 : o.clientHeight) || 400, S = Math.max(0, Math.floor(i / b) - v), y = Math.ceil(_ / b) + v * 2, D = Math.min(f.length, S + y);
5194
- this.virtualScrollStart = S, this.virtualScrollEnd = D;
5195
- const x = {
5196
- startIndex: S,
5392
+ const f = this.grid.displayItems, _ = this.grid.virtualScrollRowHeight, v = this.grid.virtualScrollBuffer, S = (o == null ? void 0 : o.clientHeight) || 400, C = Math.max(0, Math.floor(i / _) - v), x = Math.ceil(S / _) + v * 2, D = Math.min(f.length, C + x);
5393
+ this.virtualScrollStart = C, this.virtualScrollEnd = D;
5394
+ const y = {
5395
+ startIndex: C,
5197
5396
  endIndex: D,
5198
- rowHeight: b,
5397
+ rowHeight: _,
5199
5398
  totalItems: f.length
5200
5399
  };
5201
- u = ye(this, x);
5400
+ u = ye(this, y);
5202
5401
  } else
5203
5402
  u = _i(this);
5204
5403
  h && n.classList.add("wg--virtual-scroll");
5205
- const p = `
5206
- ${l}
5404
+ const m = `
5405
+ ${this.renderShortcutsHelpIcon()}
5406
+ ${g}
5207
5407
  <table class="wg__table">
5208
5408
  <thead>
5209
5409
  ${vi(this)}
@@ -5212,9 +5412,9 @@ class Zi extends HTMLElement {
5212
5412
  ${u}
5213
5413
  </tbody>
5214
5414
  </table>
5215
- ${g}
5415
+ ${l}
5216
5416
  `;
5217
- if (n.innerHTML = p, this.shadow.appendChild(n), h) {
5417
+ if (n.innerHTML = m, this.shadow.appendChild(n), h) {
5218
5418
  const f = Math.max(0, this.grid.displayItems.length * this.grid.virtualScrollRowHeight - n.clientHeight);
5219
5419
  n.scrollTop = Math.min(i, f);
5220
5420
  } else
@@ -5222,16 +5422,16 @@ class Zi extends HTMLElement {
5222
5422
  if (n.scrollLeft = r, this.attachEventListeners(), this.grid.editingCell) {
5223
5423
  let f = this.shadow.querySelector(".wg__combobox-input, .wg__autocomplete-input, .wg__select-trigger, .wg__date-input");
5224
5424
  if (f || (f = this.shadow.querySelector(".wg__editor")), f && (f.focus(), f instanceof HTMLInputElement && f.type === "text")) {
5225
- const b = this.grid.editingCell.cursorPosition, v = this.getCurrentEditingColumn(), _ = ((m = v == null ? void 0 : v.editorOptions) == null ? void 0 : m.editStartSelection) || this.grid.editStartSelection;
5425
+ const _ = this.grid.editingCell.cursorPosition, v = this.getCurrentEditingColumn(), S = ((b = v == null ? void 0 : v.editorOptions) == null ? void 0 : b.editStartSelection) || this.grid.editStartSelection;
5226
5426
  if (this.grid.editingCell.initialSearchQuery !== void 0) {
5227
- const S = f.value.length;
5228
- f.setSelectionRange(S, S);
5427
+ const C = f.value.length;
5428
+ f.setSelectionRange(C, C);
5229
5429
  } else
5230
- switch (_) {
5430
+ switch (S) {
5231
5431
  case "mousePosition":
5232
- if (b !== void 0) {
5233
- const S = Math.min(b, f.value.length);
5234
- f.setSelectionRange(S, S);
5432
+ if (_ !== void 0) {
5433
+ const C = Math.min(_, f.value.length);
5434
+ f.setSelectionRange(C, C);
5235
5435
  } else
5236
5436
  f.setSelectionRange(f.value.length, f.value.length);
5237
5437
  break;
@@ -5298,7 +5498,7 @@ class Zi extends HTMLElement {
5298
5498
  */
5299
5499
  handleDatePickerSelect(o, i, r) {
5300
5500
  const s = o.dataset.dateFormat || "YYYY-MM-DD", n = Kt(s);
5301
- o.value = Ve(i, n), o.dataset.dateValue = Wt(i), this.isCommittingFromKeyboard = !0, this.commitDateEditor(o);
5501
+ o.value = Fe(i, n), o.dataset.dateValue = Wt(i), this.datepicker = null, this.isCommittingFromKeyboard = !0, this.commitDateEditor(o);
5302
5502
  const d = parseInt(o.dataset.row || "0", 10), a = o.dataset.field || "";
5303
5503
  this.moveFocusAfterCommit(d, a, r || "down");
5304
5504
  }
@@ -5331,11 +5531,11 @@ class Zi extends HTMLElement {
5331
5531
  if (!o) return null;
5332
5532
  const r = o.split(i.separator);
5333
5533
  let s = null, n = null, d = null;
5334
- if (r.forEach((c, l) => {
5534
+ if (r.forEach((c, g) => {
5335
5535
  var h, u, p;
5336
5536
  if (!c) return;
5337
- const g = parseInt(c, 10);
5338
- ((h = i.parts.year) == null ? void 0 : h.index) === l ? s = g < 100 ? g + 2e3 : g : ((u = i.parts.month) == null ? void 0 : u.index) === l ? n = g : ((p = i.parts.day) == null ? void 0 : p.index) === l && (d = g);
5537
+ const l = parseInt(c, 10);
5538
+ ((h = i.parts.year) == null ? void 0 : h.index) === g ? s = l < 100 ? l + 2e3 : l : ((u = i.parts.month) == null ? void 0 : u.index) === g ? n = l : ((p = i.parts.day) == null ? void 0 : p.index) === g && (d = l);
5339
5539
  }), s === null || n === null || d === null) return null;
5340
5540
  const a = new Date(s, n - 1, d);
5341
5541
  return a.getMonth() !== n - 1 || a.getDate() !== d ? null : a;
@@ -5360,33 +5560,33 @@ class Zi extends HTMLElement {
5360
5560
  const s = r.querySelector(".wg__goto-input"), n = r.querySelector(".wg__goto-btn--go"), d = r.querySelector(".wg__goto-btn--cancel"), a = () => {
5361
5561
  r.remove();
5362
5562
  }, c = () => {
5363
- const l = parseInt(s.value, 10);
5364
- if (isNaN(l) || l < 1 || l > i.length) {
5563
+ const g = parseInt(s.value, 10);
5564
+ if (isNaN(g) || g < 1 || g > i.length) {
5365
5565
  s.focus(), s.select();
5366
5566
  return;
5367
5567
  }
5368
5568
  a();
5369
- const g = l - 1, h = this.grid.focusedCell;
5370
- if (this.grid.setFocusedCell(g, o), this.grid.shouldUseVirtualScroll())
5371
- st(this, g), requestAnimationFrame(() => {
5569
+ const l = g - 1, h = this.grid.focusedCell;
5570
+ if (this.grid.setFocusedCell(l, o), this.grid.shouldUseVirtualScroll())
5571
+ st(this, l), requestAnimationFrame(() => {
5372
5572
  requestAnimationFrame(() => {
5373
5573
  const u = this.shadow.querySelector(
5374
- `td[data-row="${g}"][data-col="${o}"]`
5574
+ `td[data-row="${l}"][data-col="${o}"]`
5375
5575
  );
5376
5576
  u == null || u.focus();
5377
5577
  });
5378
5578
  });
5379
5579
  else {
5380
5580
  const u = this.shadow.querySelector(
5381
- `td[data-row="${g}"][data-col="${o}"]`
5581
+ `td[data-row="${l}"][data-col="${o}"]`
5382
5582
  );
5383
- u && (u.scrollIntoView({ block: "nearest", behavior: "auto" }), u.focus(), K(this, h, { rowIndex: g, colIndex: o }));
5583
+ u && (u.scrollIntoView({ block: "nearest", behavior: "auto" }), u.focus(), K(this, h, { rowIndex: l, colIndex: o }));
5384
5584
  }
5385
5585
  };
5386
- n.addEventListener("click", c), d.addEventListener("click", a), r.addEventListener("click", (l) => {
5387
- l.target === r && a();
5388
- }), s.addEventListener("keydown", (l) => {
5389
- l.key === "Enter" ? (l.preventDefault(), c()) : l.key === "Escape" && (l.preventDefault(), a());
5586
+ n.addEventListener("click", c), d.addEventListener("click", a), r.addEventListener("click", (g) => {
5587
+ g.target === r && a();
5588
+ }), s.addEventListener("keydown", (g) => {
5589
+ g.key === "Enter" ? (g.preventDefault(), c()) : g.key === "Escape" && (g.preventDefault(), a());
5390
5590
  }), this.shadow.appendChild(r), s.focus(), s.select();
5391
5591
  }
5392
5592
  /**
@@ -5426,17 +5626,17 @@ class Zi extends HTMLElement {
5426
5626
  const s = o.target.closest(".wg__cell");
5427
5627
  if (!s)
5428
5628
  return;
5429
- o.preventDefault(), this.contextMenuElement && (vt(this.contextMenuElement), this.contextMenuElement = null);
5629
+ o.preventDefault(), this.contextMenuElement && (ht(this.contextMenuElement), this.contextMenuElement = null);
5430
5630
  const n = parseInt(s.dataset.row || "0", 10), d = parseInt(s.dataset.col || "0", 10), a = this.grid.columns[d];
5431
5631
  if (!a) return;
5432
5632
  const c = this.grid.displayItems[n];
5433
5633
  if (!c) return;
5434
- const l = String(a.field), g = this.grid.getCellRawValue(c, n, l), h = {
5634
+ const g = String(a.field), l = this.grid.getCellRawValue(c, n, g), h = {
5435
5635
  row: c,
5436
5636
  rowIndex: n,
5437
5637
  colIndex: d,
5438
5638
  column: a,
5439
- cellValue: g
5639
+ cellValue: l
5440
5640
  };
5441
5641
  this.grid.oncontextmenuopen && this.grid.oncontextmenuopen(h), this.contextMenuElement = Ji(
5442
5642
  this,
@@ -5446,7 +5646,7 @@ class Zi extends HTMLElement {
5446
5646
  h,
5447
5647
  (u) => {
5448
5648
  const p = i.find((m) => m.id === u);
5449
- p != null && p.onclick && p.onclick(h), this.contextMenuElement && (vt(this.contextMenuElement), this.contextMenuElement = null);
5649
+ p != null && p.onclick && p.onclick(h), this.contextMenuElement && (ht(this.contextMenuElement), this.contextMenuElement = null);
5450
5650
  },
5451
5651
  () => {
5452
5652
  this.contextMenuElement = null;
@@ -5478,8 +5678,8 @@ class Zi extends HTMLElement {
5478
5678
  this.toolbarHovered = !0, this.toolbarHideTimeout && (clearTimeout(this.toolbarHideTimeout), this.toolbarHideTimeout = null);
5479
5679
  }), a.addEventListener("mouseleave", () => {
5480
5680
  this.toolbarHovered = !1, !this.toolbarMoveInProgress && (this.toolbarHideTimeout = setTimeout(() => {
5481
- const c = this.shadow.querySelector(".wg__table"), l = c == null ? void 0 : c.matches(":hover"), g = a.matches(":hover");
5482
- !l && !g && (this.closeToolbarAndReset(), this.render());
5681
+ const c = this.shadow.querySelector(".wg__table"), g = c == null ? void 0 : c.matches(":hover"), l = a.matches(":hover");
5682
+ !g && !l && (this.closeToolbarAndReset(), this.render());
5483
5683
  }, 150));
5484
5684
  }));
5485
5685
  }
@@ -5515,9 +5715,9 @@ class Zi extends HTMLElement {
5515
5715
  n ? (this.render(), _e(this, this.grid.displayItems), this.renderConnector()) : this.render();
5516
5716
  }
5517
5717
  }
5518
- typeof customElements < "u" && !customElements.get("web-grid") && customElements.define("web-grid", Zi);
5718
+ typeof customElements < "u" && !customElements.get("web-grid") && customElements.define("web-grid", or);
5519
5719
  export {
5520
- Zi as GridElement,
5720
+ or as GridElement,
5521
5721
  je as WebGrid,
5522
- Zi as default
5722
+ or as default
5523
5723
  };