@tabler/core 1.6.0 → 1.6.1

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.
Files changed (115) hide show
  1. package/dist/css/tabler-flags.css +1 -1
  2. package/dist/css/tabler-flags.css.map +1 -1
  3. package/dist/css/tabler-flags.min.css +1 -1
  4. package/dist/css/tabler-flags.min.css.map +1 -1
  5. package/dist/css/tabler-flags.rtl.css +1 -1
  6. package/dist/css/tabler-flags.rtl.css.map +1 -1
  7. package/dist/css/tabler-flags.rtl.min.css +1 -1
  8. package/dist/css/tabler-flags.rtl.min.css.map +1 -1
  9. package/dist/css/tabler-marketing.css +1 -1
  10. package/dist/css/tabler-marketing.css.map +1 -1
  11. package/dist/css/tabler-marketing.min.css +1 -1
  12. package/dist/css/tabler-marketing.min.css.map +1 -1
  13. package/dist/css/tabler-marketing.rtl.css +1 -1
  14. package/dist/css/tabler-marketing.rtl.css.map +1 -1
  15. package/dist/css/tabler-marketing.rtl.min.css +1 -1
  16. package/dist/css/tabler-marketing.rtl.min.css.map +1 -1
  17. package/dist/css/tabler-payments.css +1 -1
  18. package/dist/css/tabler-payments.css.map +1 -1
  19. package/dist/css/tabler-payments.min.css +1 -1
  20. package/dist/css/tabler-payments.min.css.map +1 -1
  21. package/dist/css/tabler-payments.rtl.css +1 -1
  22. package/dist/css/tabler-payments.rtl.css.map +1 -1
  23. package/dist/css/tabler-payments.rtl.min.css +1 -1
  24. package/dist/css/tabler-payments.rtl.min.css.map +1 -1
  25. package/dist/css/tabler-props.css +1 -1
  26. package/dist/css/tabler-props.css.map +1 -1
  27. package/dist/css/tabler-props.min.css +1 -1
  28. package/dist/css/tabler-props.min.css.map +1 -1
  29. package/dist/css/tabler-props.rtl.css +1 -1
  30. package/dist/css/tabler-props.rtl.css.map +1 -1
  31. package/dist/css/tabler-props.rtl.min.css +1 -1
  32. package/dist/css/tabler-props.rtl.min.css.map +1 -1
  33. package/dist/css/tabler-socials.css +1 -1
  34. package/dist/css/tabler-socials.css.map +1 -1
  35. package/dist/css/tabler-socials.min.css +1 -1
  36. package/dist/css/tabler-socials.min.css.map +1 -1
  37. package/dist/css/tabler-socials.rtl.css +1 -1
  38. package/dist/css/tabler-socials.rtl.css.map +1 -1
  39. package/dist/css/tabler-socials.rtl.min.css +1 -1
  40. package/dist/css/tabler-socials.rtl.min.css.map +1 -1
  41. package/dist/css/tabler-themes.css +1 -1
  42. package/dist/css/tabler-themes.css.map +1 -1
  43. package/dist/css/tabler-themes.min.css +1 -1
  44. package/dist/css/tabler-themes.min.css.map +1 -1
  45. package/dist/css/tabler-themes.rtl.css +1 -1
  46. package/dist/css/tabler-themes.rtl.css.map +1 -1
  47. package/dist/css/tabler-themes.rtl.min.css +1 -1
  48. package/dist/css/tabler-themes.rtl.min.css.map +1 -1
  49. package/dist/css/tabler-vendors.css +1 -1
  50. package/dist/css/tabler-vendors.css.map +1 -1
  51. package/dist/css/tabler-vendors.min.css +1 -1
  52. package/dist/css/tabler-vendors.min.css.map +1 -1
  53. package/dist/css/tabler-vendors.rtl.css +1 -1
  54. package/dist/css/tabler-vendors.rtl.css.map +1 -1
  55. package/dist/css/tabler-vendors.rtl.min.css +1 -1
  56. package/dist/css/tabler-vendors.rtl.min.css.map +1 -1
  57. package/dist/css/tabler.css +12 -2
  58. package/dist/css/tabler.css.map +1 -1
  59. package/dist/css/tabler.min.css +2 -2
  60. package/dist/css/tabler.min.css.map +1 -1
  61. package/dist/css/tabler.rtl.css +12 -2
  62. package/dist/css/tabler.rtl.css.map +1 -1
  63. package/dist/css/tabler.rtl.min.css +2 -2
  64. package/dist/css/tabler.rtl.min.css.map +1 -1
  65. package/dist/js/tabler-theme.esm.js +21 -6
  66. package/dist/js/tabler-theme.esm.js.map +1 -1
  67. package/dist/js/tabler-theme.esm.min.js +2 -2
  68. package/dist/js/tabler-theme.esm.min.js.map +1 -1
  69. package/dist/js/tabler-theme.js +21 -6
  70. package/dist/js/tabler-theme.js.map +1 -1
  71. package/dist/js/tabler-theme.min.js +2 -2
  72. package/dist/js/tabler-theme.min.js.map +1 -1
  73. package/dist/js/tabler.esm.js +332 -131
  74. package/dist/js/tabler.esm.js.map +1 -1
  75. package/dist/js/tabler.esm.min.js +2 -2
  76. package/dist/js/tabler.esm.min.js.map +1 -1
  77. package/dist/js/tabler.js +332 -131
  78. package/dist/js/tabler.js.map +1 -1
  79. package/dist/js/tabler.min.js +2 -2
  80. package/dist/js/tabler.min.js.map +1 -1
  81. package/dist/libs/vanilla-calendar-pro/index.js +2 -2
  82. package/dist/types/src/clipboard.d.ts +3 -0
  83. package/dist/types/src/confetti.d.ts +2 -0
  84. package/dist/types/src/countup.d.ts +2 -0
  85. package/dist/types/src/datepicker.d.ts +24 -6
  86. package/dist/types/src/input-mask.d.ts +2 -1
  87. package/dist/types/src/otp-input.d.ts +6 -2
  88. package/dist/types/src/strength.d.ts +1 -0
  89. package/dist/types/src/switch-icon.d.ts +1 -0
  90. package/js/src/autosize.ts +8 -3
  91. package/js/src/bootstrap/base-component.ts +12 -2
  92. package/js/src/bootstrap/dom/manipulator.ts +1 -1
  93. package/js/src/bootstrap/dropdown.ts +3 -1
  94. package/js/src/bootstrap/util/index.ts +14 -1
  95. package/js/src/clipboard.ts +26 -2
  96. package/js/src/confetti.ts +42 -7
  97. package/js/src/countup.ts +30 -12
  98. package/js/src/datepicker.ts +147 -27
  99. package/js/src/dropdown.ts +12 -5
  100. package/js/src/global.d.ts +4 -2
  101. package/js/src/input-mask.ts +7 -7
  102. package/js/src/otp-input.ts +99 -12
  103. package/js/src/popover.ts +13 -7
  104. package/js/src/sidebar.ts +14 -6
  105. package/js/src/sortable.ts +5 -1
  106. package/js/src/sparkline.ts +15 -6
  107. package/js/src/strength.ts +17 -4
  108. package/js/src/switch-icon.ts +15 -0
  109. package/js/src/tab.ts +17 -7
  110. package/js/src/toast.ts +19 -11
  111. package/js/src/tooltip.ts +16 -7
  112. package/js/tabler-theme.ts +28 -4
  113. package/package.json +2 -2
  114. package/scss/layout/_navbar.scss +1 -2
  115. package/scss/ui/_cards.scss +14 -2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Tabler v1.6.0 (https://tabler.io)
2
+ * Tabler v1.6.1 (https://tabler.io)
3
3
  * Copyright 2018-2026 The Tabler Authors
4
4
  * Copyright 2018-2026 codecalm.net Paweł Kuna
5
5
  * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
@@ -75,11 +75,17 @@ var getTransitionDurationFromElement = (element) => {
75
75
  var triggerTransitionEnd = (element) => {
76
76
  element.dispatchEvent(new Event(TRANSITION_END));
77
77
  };
78
+ var unwrapJQuery = (object) => {
79
+ if (object && typeof object === "object" && typeof object.jquery !== "undefined") return object[0];
80
+ return object;
81
+ };
78
82
  var isElement$1 = (object) => {
83
+ object = unwrapJQuery(object);
79
84
  if (!object || typeof object !== "object") return false;
80
85
  return typeof object.nodeType !== "undefined";
81
86
  };
82
87
  var getElement = (object) => {
88
+ object = unwrapJQuery(object);
83
89
  if (isElement$1(object)) return object;
84
90
  if (typeof object === "string" && object.length > 0) return document.querySelector(parseSelector(object));
85
91
  return null;
@@ -123,7 +129,7 @@ var reflow = (element) => {
123
129
  };
124
130
  var isRTL = () => document.documentElement.dir === "rtl";
125
131
  var getjQuery = () => {
126
- if (window.jQuery && !document.body.hasAttribute("data-bs-no-jquery")) return window.jQuery;
132
+ if (window.jQuery && !document.body.hasAttribute("data-bs-no-jquery") && !document.body.hasAttribute("data-tblr-no-jquery")) return window.jQuery;
127
133
  return null;
128
134
  };
129
135
  var DOMContentLoadedCallbacks = [];
@@ -410,7 +416,7 @@ function normalizeDataKey(key) {
410
416
  var PREFIXES = ["tblr", "bs"];
411
417
  var Manipulator = {
412
418
  setDataAttribute(element, key, value) {
413
- element.setAttribute(`data-tblr-${normalizeDataKey(key)}`, value);
419
+ element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value);
414
420
  },
415
421
  removeDataAttribute(element, key) {
416
422
  for (const prefix of PREFIXES) element.removeAttribute(`data-${prefix}-${normalizeDataKey(key)}`);
@@ -550,12 +556,14 @@ var Config = class {
550
556
  var VERSION = "5.3.8";
551
557
  var BaseComponent = class extends Config {
552
558
  constructor(element, config) {
559
+ var _Data$get;
553
560
  super();
554
561
  const resolved = getElement(element);
555
562
  if (!resolved) return;
563
+ const ctor = this.constructor;
564
+ (_Data$get = Data.get(resolved, ctor.DATA_KEY)) === null || _Data$get === void 0 || _Data$get.dispose();
556
565
  this._element = resolved;
557
566
  this._config = this._getConfig(config);
558
- const ctor = this.constructor;
559
567
  Data.set(this._element, ctor.DATA_KEY, this);
560
568
  }
561
569
  dispose() {
@@ -565,7 +573,9 @@ var BaseComponent = class extends Config {
565
573
  for (const propertyName of Object.getOwnPropertyNames(this)) this[propertyName] = null;
566
574
  }
567
575
  _queueCallback(callback, element, isAnimated = true) {
568
- executeAfterTransition(callback, element, isAnimated);
576
+ executeAfterTransition(() => {
577
+ if (this._element) callback();
578
+ }, element, isAnimated);
569
579
  }
570
580
  _getConfig(config) {
571
581
  config = this._mergeConfigObj(config, this._element);
@@ -767,13 +777,14 @@ var Autosize = class extends BaseComponent {
767
777
  }
768
778
  update() {
769
779
  const element = this._element;
770
- if (!element.isConnected || element.offsetParent === null) return;
780
+ if (!element.isConnected || element.getClientRects().length === 0) return;
771
781
  const { scrollTop } = document.documentElement;
772
782
  const style = getComputedStyle(element);
773
- const border = style.boxSizing === "border-box" ? Number.parseFloat(style.borderTopWidth) + Number.parseFloat(style.borderBottomWidth) : 0;
783
+ const extra = style.boxSizing === "border-box" ? Number.parseFloat(style.borderTopWidth) + Number.parseFloat(style.borderBottomWidth) : -(Number.parseFloat(style.paddingTop) + Number.parseFloat(style.paddingBottom));
774
784
  const before = element.style.height;
785
+ element.style.overflowY = "hidden";
775
786
  element.style.height = "auto";
776
- const height = `${element.scrollHeight + border}px`;
787
+ const height = `${element.scrollHeight + extra}px`;
777
788
  element.style.height = height;
778
789
  element.style.overflowY = element.scrollHeight > element.clientHeight ? "auto" : "hidden";
779
790
  document.documentElement.scrollTop = scrollTop;
@@ -837,6 +848,8 @@ var CLASS_NAME_COPIED = "copied";
837
848
  var SELECTOR_DATA_TOGGLE$11 = `[data-bs-toggle="${NAME$25}"], [data-tblr-toggle="${NAME$25}"]`;
838
849
  var SELECTOR_LABEL = `.${NAME$25}-label`;
839
850
  var SELECTOR_FEEDBACK = `.${NAME$25}-feedback`;
851
+ var ATTRIBUTE_TEXT = "data-bs-text";
852
+ var ATTRIBUTE_TEXT_ALIAS = "data-tblr-text";
840
853
  var Default$22 = {
841
854
  target: null,
842
855
  text: null,
@@ -896,9 +909,10 @@ var Clipboard = class extends BaseComponent {
896
909
  var _source$textContent;
897
910
  const { text, target } = this._config;
898
911
  if (text !== null && text !== "") return String(text);
899
- const source = target ? SelectorEngine.findOne(target) : null;
912
+ const source = target ? getElement(target) : null;
900
913
  if (!source) return "";
901
- return source instanceof HTMLInputElement || source instanceof HTMLTextAreaElement ? source.value : ((_source$textContent = source.textContent) !== null && _source$textContent !== void 0 ? _source$textContent : "").trim();
914
+ if (source instanceof HTMLInputElement || source instanceof HTMLTextAreaElement) return source.value;
915
+ return (source instanceof HTMLElement ? source.innerText : (_source$textContent = source.textContent) !== null && _source$textContent !== void 0 ? _source$textContent : "").trim();
902
916
  }
903
917
  copy() {
904
918
  var _this = this;
@@ -918,10 +932,21 @@ var Clipboard = class extends BaseComponent {
918
932
  EventHandler.trigger(_this._element, EVENT_COPIED);
919
933
  })();
920
934
  }
935
+ /** Ends the copied state, for a `delay` of 0 or an early reset. */
936
+ reset() {
937
+ window.clearTimeout(this._timeout);
938
+ this._toggleCopied(false);
939
+ }
921
940
  dispose() {
922
941
  window.clearTimeout(this._timeout);
923
942
  super.dispose();
924
943
  }
944
+ _mergeConfigObj(config, element) {
945
+ var _element$getAttribute;
946
+ const raw = (_element$getAttribute = element === null || element === void 0 ? void 0 : element.getAttribute(ATTRIBUTE_TEXT)) !== null && _element$getAttribute !== void 0 ? _element$getAttribute : element === null || element === void 0 ? void 0 : element.getAttribute(ATTRIBUTE_TEXT_ALIAS);
947
+ const dataOptions = raw === null || raw === void 0 ? {} : { text: raw };
948
+ return super._mergeConfigObj(_objectSpread2(_objectSpread2({}, dataOptions), config), element);
949
+ }
925
950
  _showCopied() {
926
951
  window.clearTimeout(this._timeout);
927
952
  this._toggleCopied(true);
@@ -1003,12 +1028,14 @@ var stage = {
1003
1028
  frame: 0,
1004
1029
  lastTick: 0,
1005
1030
  add(emitter) {
1006
- this.emitters.push(emitter);
1007
1031
  this._mount();
1032
+ if (!this.context) return false;
1033
+ this.emitters.push(emitter);
1008
1034
  if (!this.frame) {
1009
1035
  this.lastTick = performance.now();
1010
1036
  this.frame = requestAnimationFrame((now) => this._tick(now));
1011
1037
  }
1038
+ return true;
1012
1039
  },
1013
1040
  _mount() {
1014
1041
  if (this.canvas) return;
@@ -1024,9 +1051,11 @@ var stage = {
1024
1051
  pointerEvents: "none",
1025
1052
  display: "block"
1026
1053
  });
1054
+ const context = canvas.getContext("2d");
1055
+ if (!context) return;
1027
1056
  document.body.append(canvas);
1028
1057
  this.canvas = canvas;
1029
- this.context = canvas.getContext("2d");
1058
+ this.context = context;
1030
1059
  this._resize();
1031
1060
  window.addEventListener("resize", this._onResize);
1032
1061
  },
@@ -1047,7 +1076,7 @@ var stage = {
1047
1076
  _resize() {
1048
1077
  if (!this.canvas || !this.context) return;
1049
1078
  const dpr = Math.min(window.devicePixelRatio || 1, MAX_DPR);
1050
- this.canvas.width = window.innerWidth * dpr;
1079
+ this.canvas.width = document.documentElement.clientWidth * dpr;
1051
1080
  this.canvas.height = window.innerHeight * dpr;
1052
1081
  this.context.setTransform(dpr, 0, 0, dpr, 0, 0);
1053
1082
  },
@@ -1131,7 +1160,7 @@ var stage = {
1131
1160
  if (pouring || airborne) continue;
1132
1161
  this.emitters.splice(i, 1);
1133
1162
  emitter.done = true;
1134
- EventHandler.trigger(emitter.element, EVENT_END);
1163
+ if (!emitter.detached) EventHandler.trigger(emitter.element, EVENT_END);
1135
1164
  }
1136
1165
  }
1137
1166
  };
@@ -1171,15 +1200,20 @@ var Confetti = class extends BaseComponent {
1171
1200
  startedAt: performance.now(),
1172
1201
  emitted: 0,
1173
1202
  stopped: false,
1174
- done: false
1203
+ done: false,
1204
+ detached: false
1175
1205
  };
1176
- stage.add(this._emitter);
1206
+ if (!stage.add(this._emitter)) {
1207
+ this._emitter = null;
1208
+ EventHandler.trigger(this._element, EVENT_END);
1209
+ }
1177
1210
  }
1178
1211
  stop() {
1179
1212
  if (this._emitter && !this._emitter.done) this._emitter.stopped = true;
1180
1213
  this._emitter = null;
1181
1214
  }
1182
1215
  dispose() {
1216
+ if (this._emitter) this._emitter.detached = true;
1183
1217
  this.stop();
1184
1218
  super.dispose();
1185
1219
  }
@@ -1204,7 +1238,10 @@ EventHandler.on(document, EVENT_CLICK_DATA_API$8, SELECTOR_DATA_TOGGLE$10, funct
1204
1238
  if (["A", "AREA"].includes(this.tagName)) event.preventDefault();
1205
1239
  if (isDisabled(this)) return;
1206
1240
  const target = SelectorEngine.getElementFromSelector(this) || this;
1207
- Confetti.getOrCreateInstance(target).burst();
1241
+ const config = Manipulator.getDataAttributes(this);
1242
+ const instance = Confetti.getOrCreateInstance(target, config);
1243
+ if (target !== this) instance._config = instance._getConfig(config);
1244
+ instance.burst();
1208
1245
  });
1209
1246
  //#endregion
1210
1247
  //#region js/src/countup.ts
@@ -1294,6 +1331,7 @@ var CountUp = class extends BaseComponent {
1294
1331
  this._elapsed = 0;
1295
1332
  this._running = false;
1296
1333
  this._paused = false;
1334
+ this._started = false;
1297
1335
  if (!this._element) return;
1298
1336
  const value = parseValue((_this$_element$textCo = this._element.textContent) !== null && _this$_element$textCo !== void 0 ? _this$_element$textCo : "", this._config.format);
1299
1337
  if (Number.isNaN(value)) return;
@@ -1308,14 +1346,7 @@ var CountUp = class extends BaseComponent {
1308
1346
  this.start();
1309
1347
  return;
1310
1348
  }
1311
- this._observer = new IntersectionObserver((entries) => {
1312
- if (entries.some((entry) => entry.isIntersecting)) {
1313
- var _this$_observer;
1314
- (_this$_observer = this._observer) === null || _this$_observer === void 0 || _this$_observer.disconnect();
1315
- this._observer = null;
1316
- this.start();
1317
- }
1318
- });
1349
+ this._observer = new IntersectionObserver((entries) => this._observerCallback(entries));
1319
1350
  this._observer.observe(this._element);
1320
1351
  }
1321
1352
  static get Default() {
@@ -1332,6 +1363,7 @@ var CountUp = class extends BaseComponent {
1332
1363
  }
1333
1364
  reset() {
1334
1365
  this._stop();
1366
+ this._started = false;
1335
1367
  this._value = this._config.startVal;
1336
1368
  this._print(this._value);
1337
1369
  }
@@ -1351,9 +1383,9 @@ var CountUp = class extends BaseComponent {
1351
1383
  }
1352
1384
  }
1353
1385
  dispose() {
1354
- var _this$_observer2;
1386
+ var _this$_observer;
1355
1387
  this._stop();
1356
- (_this$_observer2 = this._observer) === null || _this$_observer2 === void 0 || _this$_observer2.disconnect();
1388
+ (_this$_observer = this._observer) === null || _this$_observer === void 0 || _this$_observer.disconnect();
1357
1389
  super.dispose();
1358
1390
  }
1359
1391
  _mergeConfigObj(config, element) {
@@ -1361,12 +1393,22 @@ var CountUp = class extends BaseComponent {
1361
1393
  let dataOptions = {};
1362
1394
  const raw = (_element$getAttribute = element === null || element === void 0 ? void 0 : element.getAttribute(DATA_ATTRIBUTE$1)) !== null && _element$getAttribute !== void 0 ? _element$getAttribute : element === null || element === void 0 ? void 0 : element.getAttribute(DATA_ATTRIBUTE_ALIAS);
1363
1395
  if (raw) try {
1364
- dataOptions = JSON.parse(raw);
1396
+ const parsed = JSON.parse(raw);
1397
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) dataOptions = parsed;
1365
1398
  } catch (_unused) {}
1366
1399
  return super._mergeConfigObj(_objectSpread2(_objectSpread2({}, coerceOptions(dataOptions)), config), element);
1367
1400
  }
1401
+ _observerCallback(entries) {
1402
+ if (entries.some((entry) => entry.isIntersecting)) {
1403
+ var _this$_observer2;
1404
+ (_this$_observer2 = this._observer) === null || _this$_observer2 === void 0 || _this$_observer2.disconnect();
1405
+ this._observer = null;
1406
+ if (!this._started) this.start();
1407
+ }
1408
+ }
1368
1409
  _animate(from, to) {
1369
1410
  this._stop();
1411
+ this._started = true;
1370
1412
  if (from === to || this._config.duration <= 0 || reducedMotion()) {
1371
1413
  this._finish(to);
1372
1414
  return;
@@ -1411,12 +1453,14 @@ var CountUp = class extends BaseComponent {
1411
1453
  const { decimalPlaces, useGrouping, separator, decimal, prefix, suffix, format, formatter } = this._config;
1412
1454
  if (formatter) return formatter(value);
1413
1455
  if (format === "time") {
1414
- const minutes = Math.round(Math.abs(value));
1415
- return `${value < 0 ? "-" : ""}${prefix}${Math.floor(minutes / 60)}:${String(minutes % 60).padStart(2, "0")}${suffix}`;
1456
+ const rounded = Math.sign(value) * Math.round(Math.abs(value));
1457
+ const minutes = Math.abs(rounded);
1458
+ return `${rounded < 0 ? "-" : ""}${prefix}${Math.floor(minutes / 60)}:${String(minutes % 60).padStart(2, "0")}${suffix}`;
1416
1459
  }
1417
- const [integer, fraction] = Math.abs(value).toFixed(decimalPlaces).split(".");
1460
+ const fixed = value.toFixed(decimalPlaces);
1461
+ const [integer, fraction] = fixed.replace("-", "").split(".");
1418
1462
  const grouped = useGrouping ? integer.replace(/\B(?=(\d{3})+(?!\d))/g, separator) : integer;
1419
- return `${value < 0 ? "-" : ""}${prefix}${grouped}${fraction ? decimal + fraction : ""}${suffix}`;
1463
+ return `${Number(fixed) < 0 ? "-" : ""}${prefix}${grouped}${fraction ? decimal + fraction : ""}${suffix}`;
1420
1464
  }
1421
1465
  };
1422
1466
  /**
@@ -1445,6 +1489,14 @@ var SELECTOR_INPUT_WRAPPER = ".input-icon, .input-group";
1445
1489
  var SELECTOR_BOUND_INPUT = "input[type=\"hidden\"], input[name]";
1446
1490
  var HIDE_DELAY = 100;
1447
1491
  var DATE_PATTERN = /^(\d{4})-(\d{2})-(\d{2})$/;
1492
+ var EXTENSION_NAMES = [
1493
+ "annotations",
1494
+ "months",
1495
+ "motion",
1496
+ "time",
1497
+ "weeks"
1498
+ ];
1499
+ var writtenSelections = /* @__PURE__ */ new WeakMap();
1448
1500
  var Default$19 = {
1449
1501
  datepickerTheme: null,
1450
1502
  dateMin: null,
@@ -1463,8 +1515,8 @@ var Default$19 = {
1463
1515
  };
1464
1516
  var DefaultType$19 = {
1465
1517
  datepickerTheme: "(null|string)",
1466
- dateMin: "(null|string|number|object)",
1467
- dateMax: "(null|string|number|object)",
1518
+ dateMin: "(null|string|number|object|date)",
1519
+ dateMax: "(null|string|number|object|date)",
1468
1520
  dateFormat: "(null|object|function)",
1469
1521
  displayElement: "(null|string|element|boolean)",
1470
1522
  displayMonthsCount: "number",
@@ -1498,6 +1550,7 @@ var Datepicker = class extends BaseComponent {
1498
1550
  this._isSilent = false;
1499
1551
  this._skipPluginShow = false;
1500
1552
  this._resolveShown = null;
1553
+ this._hideTimeout = 0;
1501
1554
  this._isInput = false;
1502
1555
  this._isInline = false;
1503
1556
  this._boundInput = null;
@@ -1505,6 +1558,7 @@ var Datepicker = class extends BaseComponent {
1505
1558
  this._displayElement = null;
1506
1559
  this._themeObserver = null;
1507
1560
  this._onFocusIn = null;
1561
+ this._onResize = () => this._alignToPositionElement();
1508
1562
  this._selectedDates = [];
1509
1563
  if (!this._element || !window.VanillaCalendarPro) return;
1510
1564
  this._initCalendar();
@@ -1561,21 +1615,35 @@ var Datepicker = class extends BaseComponent {
1561
1615
  })();
1562
1616
  }
1563
1617
  dispose() {
1564
- var _this$_themeObserver, _this$_calendar;
1618
+ var _this$_themeObserver;
1619
+ window.clearTimeout(this._hideTimeout);
1565
1620
  (_this$_themeObserver = this._themeObserver) === null || _this$_themeObserver === void 0 || _this$_themeObserver.disconnect();
1621
+ window.removeEventListener("resize", this._onResize);
1566
1622
  if (this._onFocusIn) EventHandler.off(document, EVENT_FOCUSIN$3, this._onFocusIn);
1567
- (_this$_calendar = this._calendar) === null || _this$_calendar === void 0 || _this$_calendar.destroy();
1623
+ if (this._calendar) {
1624
+ this._calendar.destroy();
1625
+ const clone = this._calendar.context.mainElement;
1626
+ if (clone && clone !== this._element && clone.isConnected) {
1627
+ if (this._isInput) clone.replaceWith(this._element);
1628
+ else if (this._boundInput) {
1629
+ const copy = SelectorEngine.findOne(SELECTOR_BOUND_INPUT, clone);
1630
+ if (copy) copy.replaceWith(this._boundInput);
1631
+ else clone.append(this._boundInput);
1632
+ }
1633
+ }
1634
+ }
1568
1635
  super.dispose();
1569
1636
  }
1570
1637
  getSelectedDates() {
1571
- var _this$_calendar2;
1572
- const dates = (_this$_calendar2 = this._calendar) === null || _this$_calendar2 === void 0 || (_this$_calendar2 = _this$_calendar2.context) === null || _this$_calendar2 === void 0 ? void 0 : _this$_calendar2.selectedDates;
1638
+ var _this$_calendar;
1639
+ const dates = (_this$_calendar = this._calendar) === null || _this$_calendar === void 0 || (_this$_calendar = _this$_calendar.context) === null || _this$_calendar === void 0 ? void 0 : _this$_calendar.selectedDates;
1573
1640
  return dates && dates.length > 0 ? [...dates] : [...this._selectedDates];
1574
1641
  }
1575
1642
  setSelectedDates(dates) {
1576
- var _this$_calendar3;
1577
- this._selectedDates = dates.map(String);
1578
- (_this$_calendar3 = this._calendar) === null || _this$_calendar3 === void 0 || _this$_calendar3.set({ selectedDates: dates });
1643
+ var _this$_calendar2;
1644
+ this._selectedDates = dates.map((date) => this._toIsoDate(date));
1645
+ (_this$_calendar2 = this._calendar) === null || _this$_calendar2 === void 0 || _this$_calendar2.set(_objectSpread2({ selectedDates: this._selectedDates }, this._monthOf(this._selectedDates[0])));
1646
+ this._writeSelection(this._selectedDates);
1579
1647
  }
1580
1648
  _initCalendar() {
1581
1649
  this._isInput = this._element.tagName === "INPUT";
@@ -1593,31 +1661,36 @@ var Datepicker = class extends BaseComponent {
1593
1661
  this._updateDisplayWithSelectedDates();
1594
1662
  }
1595
1663
  _updateDisplayWithSelectedDates() {
1596
- const { selectedDates } = this._config;
1597
- if (!selectedDates || selectedDates.length === 0) return;
1598
- this._writeSelection(selectedDates);
1664
+ if (this._selectedDates.length === 0) return;
1665
+ this._writeSelection(this._selectedDates);
1599
1666
  }
1600
1667
  _writeSelection(selectedDates) {
1601
1668
  const formattedDate = this._formatDateForInput(selectedDates);
1602
- if (this._isInput) this._element.value = formattedDate;
1669
+ if (this._isInput) {
1670
+ this._element.value = formattedDate;
1671
+ writtenSelections.set(this._element, {
1672
+ text: formattedDate,
1673
+ dates: [...selectedDates]
1674
+ });
1675
+ }
1603
1676
  if (this._boundInput) this._boundInput.value = selectedDates.join(",");
1604
1677
  if (this._displayElement) this._displayElement.textContent = formattedDate;
1605
1678
  }
1606
1679
  _resolvePositionElement() {
1607
1680
  let { positionElement } = this._config;
1608
- if (typeof positionElement === "string") positionElement = SelectorEngine.findOne(positionElement);
1681
+ if (typeof positionElement === "string") positionElement = getElement(positionElement);
1609
1682
  if (!positionElement && this._isInput && !this._isInline) positionElement = this._element.closest(SELECTOR_INPUT_WRAPPER);
1610
1683
  return positionElement || this._element;
1611
1684
  }
1612
1685
  _resolveDisplayElement() {
1613
1686
  const { displayElement } = this._config;
1614
- if (typeof displayElement === "string") return SelectorEngine.findOne(displayElement);
1687
+ if (typeof displayElement === "string") return getElement(displayElement);
1615
1688
  if (displayElement === true || displayElement === null && !this._isInput && !this._isInline) return SelectorEngine.findOne(SELECTOR_DISPLAY, this._element) || this._element;
1616
1689
  return displayElement;
1617
1690
  }
1618
1691
  _alignToPositionElement() {
1619
- var _this$_calendar4;
1620
- const mainElement = (_this$_calendar4 = this._calendar) === null || _this$_calendar4 === void 0 || (_this$_calendar4 = _this$_calendar4.context) === null || _this$_calendar4 === void 0 ? void 0 : _this$_calendar4.mainElement;
1692
+ var _this$_calendar3;
1693
+ const mainElement = (_this$_calendar3 = this._calendar) === null || _this$_calendar3 === void 0 || (_this$_calendar3 = _this$_calendar3.context) === null || _this$_calendar3 === void 0 ? void 0 : _this$_calendar3.mainElement;
1621
1694
  if (!mainElement || this._isInline || !this._positionElement || this._positionElement === this._element) return;
1622
1695
  const anchor = this._positionElement.getBoundingClientRect();
1623
1696
  const popup = mainElement.getBoundingClientRect();
@@ -1645,8 +1718,8 @@ var Datepicker = class extends BaseComponent {
1645
1718
  const ancestor = this._getThemeAncestor();
1646
1719
  if (!ancestor || this._config.datepickerTheme) return;
1647
1720
  this._themeObserver = new MutationObserver(() => {
1648
- var _this$_calendar5;
1649
- this._syncThemeAttribute((_this$_calendar5 = this._calendar) === null || _this$_calendar5 === void 0 || (_this$_calendar5 = _this$_calendar5.context) === null || _this$_calendar5 === void 0 ? void 0 : _this$_calendar5.mainElement);
1721
+ var _this$_calendar4;
1722
+ this._syncThemeAttribute((_this$_calendar4 = this._calendar) === null || _this$_calendar4 === void 0 || (_this$_calendar4 = _this$_calendar4.context) === null || _this$_calendar4 === void 0 ? void 0 : _this$_calendar4.mainElement);
1650
1723
  });
1651
1724
  this._themeObserver.observe(ancestor, {
1652
1725
  attributes: true,
@@ -1656,10 +1729,10 @@ var Datepicker = class extends BaseComponent {
1656
1729
  _setupDismissOnFocus() {
1657
1730
  if (this._isInline) return;
1658
1731
  this._onFocusIn = (event) => {
1659
- var _this$_calendar6;
1732
+ var _this$_calendar5;
1660
1733
  if (!this._isShown) return;
1661
1734
  const { target } = event;
1662
- const mainElement = (_this$_calendar6 = this._calendar) === null || _this$_calendar6 === void 0 || (_this$_calendar6 = _this$_calendar6.context) === null || _this$_calendar6 === void 0 ? void 0 : _this$_calendar6.mainElement;
1735
+ const mainElement = (_this$_calendar5 = this._calendar) === null || _this$_calendar5 === void 0 || (_this$_calendar5 = _this$_calendar5.context) === null || _this$_calendar5 === void 0 ? void 0 : _this$_calendar5.mainElement;
1663
1736
  if (target instanceof Node && (this._element.contains(target) || (mainElement === null || mainElement === void 0 ? void 0 : mainElement.contains(target)))) return;
1664
1737
  this.hide();
1665
1738
  };
@@ -1685,6 +1758,8 @@ var Datepicker = class extends BaseComponent {
1685
1758
  this._isShown = true;
1686
1759
  this._syncThemeAttribute(calendar.context.mainElement);
1687
1760
  this._alignToPositionElement();
1761
+ window.removeEventListener("resize", this._onResize);
1762
+ window.addEventListener("resize", this._onResize);
1688
1763
  if (!wasShown) EventHandler.trigger(this._element, EVENT_SHOWN$7);
1689
1764
  (_this$_resolveShown = this._resolveShown) === null || _this$_resolveShown === void 0 || _this$_resolveShown.call(this);
1690
1765
  }
@@ -1697,12 +1772,26 @@ var Datepicker = class extends BaseComponent {
1697
1772
  return;
1698
1773
  }
1699
1774
  this._isShown = false;
1775
+ window.removeEventListener("resize", this._onResize);
1700
1776
  EventHandler.trigger(this._element, EVENT_HIDDEN$7);
1701
1777
  }
1778
+ /** @internal */
1779
+ _calendarExtensions(own = []) {
1780
+ const library = window.VanillaCalendarPro;
1781
+ const extensions = [...own];
1782
+ for (const name of EXTENSION_NAMES) {
1783
+ const extension = library === null || library === void 0 ? void 0 : library[name];
1784
+ if (extension && typeof extension === "object" && !extensions.includes(extension)) extensions.push(extension);
1785
+ }
1786
+ return extensions;
1787
+ }
1788
+ /** @internal */
1702
1789
  _buildCalendarOptions() {
1703
1790
  const theme = this._getEffectiveTheme();
1704
1791
  const vcpTheme = !theme || theme === "auto" ? "system" : theme;
1705
- const calendarOptions = _objectSpread2(_objectSpread2({}, this._config.vcpOptions), {}, {
1792
+ const vcpOptions = this._config.vcpOptions;
1793
+ const extensions = this._calendarExtensions(vcpOptions.extensions);
1794
+ const calendarOptions = _objectSpread2(_objectSpread2(_objectSpread2({}, vcpOptions), extensions.length > 0 ? { extensions } : {}), {}, {
1706
1795
  inputMode: !this._isInline,
1707
1796
  positionToInput: this._config.placement,
1708
1797
  firstWeekday: this._config.firstWeekday,
@@ -1730,10 +1819,11 @@ var Datepicker = class extends BaseComponent {
1730
1819
  if (this._config.dateMax) calendarOptions.dateMax = this._config.dateMax;
1731
1820
  return calendarOptions;
1732
1821
  }
1822
+ /** @internal */
1733
1823
  _handleDateClick(self, event) {
1734
1824
  const selectedDates = [...self.context.selectedDates];
1735
1825
  this._selectedDates = selectedDates;
1736
- if (selectedDates.length > 0) this._writeSelection(selectedDates);
1826
+ this._writeSelection(selectedDates);
1737
1827
  const args = {
1738
1828
  dates: selectedDates,
1739
1829
  event
@@ -1743,7 +1833,10 @@ var Datepicker = class extends BaseComponent {
1743
1833
  }
1744
1834
  _maybeHideAfterSelection(selectedDates) {
1745
1835
  if (this._isInline) return;
1746
- if (this._config.selectionMode === "single" && selectedDates.length > 0 || this._config.selectionMode === "multiple-ranged" && selectedDates.length >= 2) setTimeout(() => this.hide(), HIDE_DELAY);
1836
+ if (this._config.selectionMode === "single" && selectedDates.length > 0 || this._config.selectionMode === "multiple-ranged" && selectedDates.length >= 2) {
1837
+ window.clearTimeout(this._hideTimeout);
1838
+ this._hideTimeout = window.setTimeout(() => this.hide(), HIDE_DELAY);
1839
+ }
1747
1840
  }
1748
1841
  _parseDate(dateStr) {
1749
1842
  const [year = 0, month = 1, day = 1] = dateStr.split("-").map(Number);
@@ -1767,13 +1860,32 @@ var Datepicker = class extends BaseComponent {
1767
1860
  var _this$_calendar7;
1768
1861
  const value = this._element.value.trim();
1769
1862
  if (!value) return;
1863
+ const written = writtenSelections.get(this._element);
1864
+ if (written && written.text.trim() === value) {
1865
+ var _this$_calendar6;
1866
+ this._selectedDates = [...written.dates];
1867
+ (_this$_calendar6 = this._calendar) === null || _this$_calendar6 === void 0 || _this$_calendar6.set(_objectSpread2({ selectedDates: this._selectedDates }, this._monthOf(this._selectedDates[0])));
1868
+ return;
1869
+ }
1770
1870
  const date = DATE_PATTERN.test(value) ? this._parseDate(value) : new Date(value);
1771
1871
  if (Number.isNaN(date.getTime())) return;
1772
- const year = date.getFullYear();
1773
- const month = String(date.getMonth() + 1).padStart(2, "0");
1774
- const day = String(date.getDate()).padStart(2, "0");
1775
- this._selectedDates = [`${year}-${month}-${day}`];
1776
- (_this$_calendar7 = this._calendar) === null || _this$_calendar7 === void 0 || _this$_calendar7.set({ selectedDates: this._selectedDates });
1872
+ this._selectedDates = [this._toIsoDate(date)];
1873
+ (_this$_calendar7 = this._calendar) === null || _this$_calendar7 === void 0 || _this$_calendar7.set(_objectSpread2({ selectedDates: this._selectedDates }, this._monthOf(this._selectedDates[0])));
1874
+ }
1875
+ _toIsoDate(value) {
1876
+ if (typeof value === "string" && DATE_PATTERN.test(value)) return value;
1877
+ const date = value instanceof Date ? value : typeof value === "string" && DATE_PATTERN.test(value) ? this._parseDate(value) : new Date(value);
1878
+ if (Number.isNaN(date.getTime())) return String(value);
1879
+ return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
1880
+ }
1881
+ /** @internal */
1882
+ _monthOf(value) {
1883
+ if (!value || !DATE_PATTERN.test(value)) return {};
1884
+ const date = this._parseDate(value);
1885
+ return {
1886
+ selectedMonth: date.getMonth(),
1887
+ selectedYear: date.getFullYear()
1888
+ };
1777
1889
  }
1778
1890
  };
1779
1891
  /**
@@ -1812,7 +1924,7 @@ var Default$18 = {
1812
1924
  lazy: true
1813
1925
  };
1814
1926
  var DefaultType$18 = {
1815
- mask: "string",
1927
+ mask: "(string|function|regexp|object|array)",
1816
1928
  lazy: "boolean"
1817
1929
  };
1818
1930
  /**
@@ -1826,10 +1938,7 @@ var InputMask = class extends BaseComponent {
1826
1938
  super(element, config);
1827
1939
  this._mask = null;
1828
1940
  if (!this._element || !this._config.mask || !window.IMask) return;
1829
- this._mask = new window.IMask(this._element, {
1830
- mask: this._config.mask,
1831
- lazy: this._config.lazy
1832
- });
1941
+ this._mask = new window.IMask(this._element, _objectSpread2({}, this._config));
1833
1942
  }
1834
1943
  static get Default() {
1835
1944
  return Default$18;
@@ -1857,7 +1966,7 @@ var InputMask = class extends BaseComponent {
1857
1966
  const dataOptions = {};
1858
1967
  const mask = element === null || element === void 0 ? void 0 : element.getAttribute(ATTRIBUTE_MASK);
1859
1968
  if (mask) dataOptions.mask = mask;
1860
- if (element === null || element === void 0 ? void 0 : element.hasAttribute(ATTRIBUTE_VISIBLE)) dataOptions.lazy = element.getAttribute(ATTRIBUTE_VISIBLE) !== "true";
1969
+ if (element === null || element === void 0 ? void 0 : element.hasAttribute(ATTRIBUTE_VISIBLE)) dataOptions.lazy = element.getAttribute(ATTRIBUTE_VISIBLE) === "false";
1861
1970
  return super._mergeConfigObj(_objectSpread2(_objectSpread2({}, dataOptions), config), element);
1862
1971
  }
1863
1972
  };
@@ -3848,7 +3957,7 @@ var CLASS_NAME_DROPSTART = "dropstart";
3848
3957
  var CLASS_NAME_DROPUP_CENTER = "dropup-center";
3849
3958
  var CLASS_NAME_DROPDOWN_CENTER = "dropdown-center";
3850
3959
  var SELECTOR_DATA_TOGGLE$6 = "[data-bs-toggle=\"dropdown\"]:not(.disabled):not(:disabled), [data-tblr-toggle=\"dropdown\"]:not(.disabled):not(:disabled)";
3851
- var SELECTOR_DATA_TOGGLE_SHOWN = `.${CLASS_NAME_SHOW$6}[data-bs-toggle="dropdown"], .${CLASS_NAME_SHOW$6}[data-tblr-toggle="dropdown"]`;
3960
+ var SELECTOR_DATA_TOGGLE_SHOWN = SELECTOR_DATA_TOGGLE$6.split(", ").map((selector) => `${selector}.${CLASS_NAME_SHOW$6}`).join(", ");
3852
3961
  var SELECTOR_MENU = ".dropdown-menu";
3853
3962
  var SELECTOR_NAVBAR = ".navbar";
3854
3963
  var SELECTOR_NAVBAR_NAV = ".navbar-nav";
@@ -5839,13 +5948,18 @@ var bootstrap = {
5839
5948
  };
5840
5949
  //#endregion
5841
5950
  //#region js/src/dropdown.ts
5842
- [].slice.call(document.querySelectorAll("[data-bs-toggle=\"dropdown\"]")).map(function(dropdownTriggerEl) {
5843
- return new Dropdown(dropdownTriggerEl, { boundary: dropdownTriggerEl.getAttribute("data-bs-boundary") === "viewport" ? document.documentElement : "clippingParents" });
5951
+ onDOMContentLoaded(() => {
5952
+ for (const dropdownTriggerEl of document.querySelectorAll("[data-bs-toggle=\"dropdown\"], [data-tblr-toggle=\"dropdown\"]")) try {
5953
+ const options = { boundary: Manipulator.getDataAttribute(dropdownTriggerEl, "boundary") === "viewport" ? document.documentElement : "clippingParents" };
5954
+ Dropdown.getOrCreateInstance(dropdownTriggerEl, options);
5955
+ } catch (error) {
5956
+ console.error(error);
5957
+ }
5844
5958
  });
5845
5959
  //#endregion
5846
5960
  //#region js/src/sidebar.ts
5847
5961
  var syncSidebarToggles = (folded) => {
5848
- for (const toggle of document.querySelectorAll("[data-bs-toggle=\"sidebar-folded\"]")) toggle.setAttribute("aria-pressed", String(folded));
5962
+ for (const toggle of document.querySelectorAll("[data-bs-toggle=\"sidebar-folded\"], [data-tblr-toggle=\"sidebar-folded\"]")) toggle.setAttribute("aria-pressed", String(folded));
5849
5963
  };
5850
5964
  var sidebarIsFolded = () => {
5851
5965
  var _document$documentEle;
@@ -5860,7 +5974,7 @@ var hideSidebarDropdowns = (except) => {
5860
5974
  document.addEventListener("click", (event) => {
5861
5975
  if (!sidebarIsFolded()) return;
5862
5976
  const target = event.target;
5863
- if (target.closest(".navbar-vertical .dropdown-menu")) return;
5977
+ if (!(target instanceof Element) || target.closest(".navbar-vertical .dropdown-menu")) return;
5864
5978
  hideSidebarDropdowns(target.closest(".navbar-vertical [data-bs-toggle=\"dropdown\"]"));
5865
5979
  });
5866
5980
  document.addEventListener("mouseleave", (event) => {
@@ -5868,7 +5982,7 @@ document.addEventListener("mouseleave", (event) => {
5868
5982
  if (!(target instanceof Element) || !target.matches(".navbar-vertical")) return;
5869
5983
  if (document.documentElement.getAttribute("data-bs-sidebar") === "folded-hover" || target.classList.contains("navbar-folded-hover")) hideSidebarDropdowns();
5870
5984
  }, true);
5871
- document.addEventListener("DOMContentLoaded", () => {
5985
+ onDOMContentLoaded(() => {
5872
5986
  var _document$documentEle2;
5873
5987
  const folded = ((_document$documentEle2 = document.documentElement.getAttribute("data-bs-sidebar")) !== null && _document$documentEle2 !== void 0 ? _document$documentEle2 : "").startsWith("folded");
5874
5988
  syncSidebarToggles(folded);
@@ -5880,41 +5994,51 @@ document.addEventListener("DOMContentLoaded", () => {
5880
5994
  });
5881
5995
  document.addEventListener("click", (event) => {
5882
5996
  var _html$getAttribute;
5883
- if (!event.target.closest("[data-bs-toggle=\"sidebar-folded\"]")) return;
5997
+ if (!(event.target instanceof Element ? event.target.closest("[data-bs-toggle=\"sidebar-folded\"], [data-tblr-toggle=\"sidebar-folded\"]") : null)) return;
5884
5998
  const html = document.documentElement;
5885
5999
  const willFold = !((_html$getAttribute = html.getAttribute("data-bs-sidebar")) !== null && _html$getAttribute !== void 0 ? _html$getAttribute : "").startsWith("folded");
5886
6000
  if (willFold) html.setAttribute("data-bs-sidebar", "folded-hover");
5887
6001
  else html.removeAttribute("data-bs-sidebar");
5888
- localStorage.setItem("tabler-sidebar", willFold ? "folded-hover" : "default");
6002
+ try {
6003
+ localStorage.setItem("tabler-sidebar", willFold ? "folded-hover" : "default");
6004
+ } catch (_unused) {}
5889
6005
  syncSidebarToggles(willFold);
5890
6006
  hideSidebarDropdowns();
5891
6007
  document.dispatchEvent(new CustomEvent("tabler:sidebar-folded", { detail: { folded: willFold } }));
5892
6008
  });
5893
6009
  //#endregion
5894
6010
  //#region js/src/tooltip.ts
5895
- [].slice.call(document.querySelectorAll("[data-bs-toggle=\"tooltip\"]")).map(function(tooltipTriggerEl) {
5896
- var _tooltipTriggerEl$get;
5897
- return new Tooltip(tooltipTriggerEl, {
5898
- delay: {
5899
- show: 50,
5900
- hide: 50
5901
- },
5902
- html: tooltipTriggerEl.getAttribute("data-bs-html") === "true",
5903
- placement: (_tooltipTriggerEl$get = tooltipTriggerEl.getAttribute("data-bs-placement")) !== null && _tooltipTriggerEl$get !== void 0 ? _tooltipTriggerEl$get : "auto"
5904
- });
6011
+ onDOMContentLoaded(() => {
6012
+ for (const tooltipTriggerEl of document.querySelectorAll("[data-bs-toggle=\"tooltip\"], [data-tblr-toggle=\"tooltip\"]")) try {
6013
+ var _Manipulator$getDataA, _Manipulator$getDataA2;
6014
+ const options = {
6015
+ delay: (_Manipulator$getDataA = Manipulator.getDataAttribute(tooltipTriggerEl, "delay")) !== null && _Manipulator$getDataA !== void 0 ? _Manipulator$getDataA : {
6016
+ show: 50,
6017
+ hide: 50
6018
+ },
6019
+ placement: (_Manipulator$getDataA2 = Manipulator.getDataAttribute(tooltipTriggerEl, "placement")) !== null && _Manipulator$getDataA2 !== void 0 ? _Manipulator$getDataA2 : "auto"
6020
+ };
6021
+ Tooltip.getOrCreateInstance(tooltipTriggerEl, options);
6022
+ } catch (error) {
6023
+ console.error(error);
6024
+ }
5905
6025
  });
5906
6026
  //#endregion
5907
6027
  //#region js/src/popover.ts
5908
- [].slice.call(document.querySelectorAll("[data-bs-toggle=\"popover\"]")).map(function(popoverTriggerEl) {
5909
- var _popoverTriggerEl$get;
5910
- return new Popover(popoverTriggerEl, {
5911
- delay: {
5912
- show: 50,
5913
- hide: 50
5914
- },
5915
- html: popoverTriggerEl.getAttribute("data-bs-html") === "true",
5916
- placement: (_popoverTriggerEl$get = popoverTriggerEl.getAttribute("data-bs-placement")) !== null && _popoverTriggerEl$get !== void 0 ? _popoverTriggerEl$get : "auto"
5917
- });
6028
+ onDOMContentLoaded(() => {
6029
+ for (const popoverTriggerEl of document.querySelectorAll("[data-bs-toggle=\"popover\"], [data-tblr-toggle=\"popover\"]")) try {
6030
+ var _Manipulator$getDataA, _Manipulator$getDataA2;
6031
+ const options = {
6032
+ delay: (_Manipulator$getDataA = Manipulator.getDataAttribute(popoverTriggerEl, "delay")) !== null && _Manipulator$getDataA !== void 0 ? _Manipulator$getDataA : {
6033
+ show: 50,
6034
+ hide: 50
6035
+ },
6036
+ placement: (_Manipulator$getDataA2 = Manipulator.getDataAttribute(popoverTriggerEl, "placement")) !== null && _Manipulator$getDataA2 !== void 0 ? _Manipulator$getDataA2 : "auto"
6037
+ };
6038
+ Popover.getOrCreateInstance(popoverTriggerEl, options);
6039
+ } catch (error) {
6040
+ console.error(error);
6041
+ }
5918
6042
  });
5919
6043
  //#endregion
5920
6044
  //#region \0@oxc-project+runtime@0.147.0/helpers/esm/checkPrivateRedeclaration.js
@@ -6028,13 +6152,19 @@ var SwitchIcon = class extends BaseComponent {
6028
6152
  _assertClassBrand(_SwitchIcon_brand, this, _setLoading).call(this, true);
6029
6153
  pending.then(() => _assertClassBrand(_SwitchIcon_brand, this, _setActive).call(this, active), () => void 0).finally(() => _assertClassBrand(_SwitchIcon_brand, this, _setLoading).call(this, false));
6030
6154
  }
6155
+ dispose() {
6156
+ _assertClassBrand(_SwitchIcon_brand, this, _setLoading).call(this, false);
6157
+ super.dispose();
6158
+ }
6031
6159
  };
6032
6160
  function _setActive(active) {
6161
+ if (!this._element) return;
6033
6162
  _classPrivateFieldGet2(_iconElement, this).classList.toggle(CLASS_NAME_ACTIVE$1, active);
6034
6163
  this._element.setAttribute("aria-pressed", String(active));
6035
6164
  EventHandler.trigger(this._element, EVENT_CHANGE$1, { active });
6036
6165
  }
6037
6166
  function _setLoading(loading) {
6167
+ if (!this._element) return;
6038
6168
  _classPrivateFieldGet2(_iconElement, this).classList.toggle(CLASS_NAME_LOADING, loading);
6039
6169
  if (loading) this._element.setAttribute("aria-busy", "true");
6040
6170
  else this._element.removeAttribute("aria-busy");
@@ -6047,20 +6177,30 @@ initAll(SELECTOR_DATA_TOGGLE$2, SwitchIcon);
6047
6177
  //#region js/src/tab.ts
6048
6178
  var EnableActivationTabsFromLocationHash = () => {
6049
6179
  const locationHash = window.location.hash;
6050
- if (locationHash) [].slice.call(document.querySelectorAll("[data-bs-toggle=\"tab\"]")).filter((tab) => tab.hash === locationHash).map((tab) => {
6051
- new Tab(tab).show();
6052
- });
6180
+ if (!locationHash) return;
6181
+ for (const tab of document.querySelectorAll("[data-bs-toggle=\"tab\"], [data-tblr-toggle=\"tab\"]")) {
6182
+ if (tab.hash !== locationHash) continue;
6183
+ try {
6184
+ Tab.getOrCreateInstance(tab).show();
6185
+ } catch (error) {
6186
+ console.error(error);
6187
+ }
6188
+ }
6053
6189
  };
6054
- EnableActivationTabsFromLocationHash();
6190
+ onDOMContentLoaded(EnableActivationTabsFromLocationHash);
6055
6191
  //#endregion
6056
6192
  //#region js/src/toast.ts
6057
- [].slice.call(document.querySelectorAll("[data-bs-toggle=\"toast\"]")).map(function(toastTriggerEl) {
6058
- const target = toastTriggerEl.getAttribute("data-bs-target");
6059
- if (target === null) return;
6060
- const toastEl = new Toast(target);
6061
- toastTriggerEl.addEventListener("click", () => {
6062
- toastEl.show();
6063
- });
6193
+ onDOMContentLoaded(() => {
6194
+ for (const toastTriggerEl of document.querySelectorAll("[data-bs-toggle=\"toast\"], [data-tblr-toggle=\"toast\"]")) try {
6195
+ const toastEl = SelectorEngine.getElementFromSelector(toastTriggerEl);
6196
+ if (!toastEl) continue;
6197
+ const toast = Toast.getOrCreateInstance(toastEl);
6198
+ toastTriggerEl.addEventListener("click", () => {
6199
+ toast.show();
6200
+ });
6201
+ } catch (error) {
6202
+ console.error(error);
6203
+ }
6064
6204
  });
6065
6205
  //#endregion
6066
6206
  //#region js/src/sortable.ts
@@ -6123,7 +6263,8 @@ var Sortable = class extends BaseComponent {
6123
6263
  let dataOptions = {};
6124
6264
  const raw = element === null || element === void 0 ? void 0 : element.getAttribute(DATA_ATTRIBUTE);
6125
6265
  if (raw) try {
6126
- dataOptions = JSON.parse(raw);
6266
+ const parsed = JSON.parse(raw);
6267
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) dataOptions = parsed;
6127
6268
  } catch (_unused) {}
6128
6269
  return super._mergeConfigObj(_objectSpread2(_objectSpread2({}, dataOptions), config), element);
6129
6270
  }
@@ -6161,6 +6302,7 @@ var SYNC_EVENTS = [
6161
6302
  "keyup",
6162
6303
  "select"
6163
6304
  ];
6305
+ var POINTER_END_EVENTS = ["click", "pointercancel"];
6164
6306
  var MASK_CHARACTER = "•";
6165
6307
  var TYPES = {
6166
6308
  numeric: {
@@ -6179,6 +6321,7 @@ var TYPES = {
6179
6321
  filter: /[^A-Za-z]/g
6180
6322
  }
6181
6323
  };
6324
+ var MAX_LENGTH = 32;
6182
6325
  var Default$2 = {
6183
6326
  groups: null,
6184
6327
  length: null,
@@ -6205,14 +6348,29 @@ var OtpInput = class extends BaseComponent {
6205
6348
  var _TYPES$this$_config$t;
6206
6349
  super(element, config);
6207
6350
  this._length = 0;
6351
+ this._wasComplete = false;
6208
6352
  this._slots = [];
6209
6353
  this._slotsContainer = null;
6210
6354
  this._pointerActive = false;
6211
6355
  this._pointerIndex = 0;
6212
- this._onInput = () => this._handleInput();
6356
+ this._composedValue = null;
6357
+ this._onInput = (event) => {
6358
+ if (event.isComposing) return;
6359
+ const composed = this._composedValue;
6360
+ this._composedValue = null;
6361
+ if (composed !== null && composed === this._input.value) return;
6362
+ this._handleInput();
6363
+ };
6364
+ this._onCompositionEnd = () => {
6365
+ this._handleInput();
6366
+ this._composedValue = this._input.value;
6367
+ };
6213
6368
  this._onBeforeInput = (event) => this._handleBeforeInput(event);
6214
6369
  this._onFocus = () => this._handleFocus();
6215
6370
  this._onPointerDown = (event) => this._handlePointerDown(event);
6371
+ this._onPointerEnd = () => {
6372
+ this._pointerActive = false;
6373
+ };
6216
6374
  this._onSync = () => this._render();
6217
6375
  this._onSelectionChange = () => {
6218
6376
  if (document.activeElement === this._input) this._render();
@@ -6227,6 +6385,7 @@ var OtpInput = class extends BaseComponent {
6227
6385
  this._renderSlots();
6228
6386
  this._addEventListeners();
6229
6387
  this._render();
6388
+ this._wasComplete = this._input.value.length === this._length;
6230
6389
  }
6231
6390
  static get Default() {
6232
6391
  return Default$2;
@@ -6251,6 +6410,7 @@ var OtpInput = class extends BaseComponent {
6251
6410
  this._input.focus();
6252
6411
  }
6253
6412
  focus() {
6413
+ this._pointerActive = false;
6254
6414
  this._input.focus();
6255
6415
  this._selectSlot(this._firstEmptyIndex());
6256
6416
  this._render();
@@ -6265,6 +6425,8 @@ var OtpInput = class extends BaseComponent {
6265
6425
  this._input.removeEventListener("beforeinput", this._onBeforeInput);
6266
6426
  this._input.removeEventListener("focus", this._onFocus);
6267
6427
  this._input.removeEventListener("pointerdown", this._onPointerDown);
6428
+ this._input.removeEventListener("compositionend", this._onCompositionEnd);
6429
+ for (const type of POINTER_END_EVENTS) this._input.removeEventListener(type, this._onPointerEnd);
6268
6430
  for (const type of SYNC_EVENTS) this._input.removeEventListener(type, this._onSync);
6269
6431
  document.removeEventListener("selectionchange", this._onSelectionChange);
6270
6432
  (_this$_slotsContainer = this._slotsContainer) === null || _this$_slotsContainer === void 0 || _this$_slotsContainer.remove();
@@ -6273,13 +6435,15 @@ var OtpInput = class extends BaseComponent {
6273
6435
  }
6274
6436
  _resolveLength() {
6275
6437
  var _this$_input$getAttri;
6276
- if (this._config.length) return this._config.length;
6277
- const maxLength = Number.parseInt((_this$_input$getAttri = this._input.getAttribute("maxlength")) !== null && _this$_input$getAttri !== void 0 ? _this$_input$getAttri : "", 10);
6278
- return Number.isNaN(maxLength) || maxLength < 1 ? 6 : maxLength;
6438
+ const candidates = [this._config.length, Number.parseInt((_this$_input$getAttri = this._input.getAttribute("maxlength")) !== null && _this$_input$getAttri !== void 0 ? _this$_input$getAttri : "", 10)];
6439
+ const { groups } = this._config;
6440
+ if (Array.isArray(groups) && groups.length > 0) candidates.push(groups.reduce((sum, group) => sum + Number(group), 0));
6441
+ for (const candidate of candidates) if (typeof candidate === "number" && Number.isInteger(candidate) && candidate > 0) return Math.min(candidate, MAX_LENGTH);
6442
+ return 6;
6279
6443
  }
6280
6444
  _setupInput() {
6281
6445
  const input = this._input;
6282
- if (input.type === "number" || input.type === "password") input.type = "text";
6446
+ if (input.type !== "text" && input.type !== "tel") input.type = "text";
6283
6447
  input.classList.add(CLASS_NAME_INPUT);
6284
6448
  input.setAttribute("maxlength", String(this._length));
6285
6449
  input.setAttribute("inputmode", this._type.inputmode);
@@ -6320,6 +6484,8 @@ var OtpInput = class extends BaseComponent {
6320
6484
  this._input.addEventListener("beforeinput", this._onBeforeInput);
6321
6485
  this._input.addEventListener("focus", this._onFocus);
6322
6486
  this._input.addEventListener("pointerdown", this._onPointerDown);
6487
+ this._input.addEventListener("compositionend", this._onCompositionEnd);
6488
+ for (const type of POINTER_END_EVENTS) this._input.addEventListener(type, this._onPointerEnd);
6323
6489
  document.addEventListener("selectionchange", this._onSelectionChange);
6324
6490
  for (const type of SYNC_EVENTS) this._input.addEventListener(type, this._onSync);
6325
6491
  }
@@ -6342,23 +6508,25 @@ var OtpInput = class extends BaseComponent {
6342
6508
  _handleBeforeInput(event) {
6343
6509
  const { inputType, data } = event;
6344
6510
  if (inputType === "insertText" && data && data.length === 1) {
6345
- var _this$_input$selectio;
6511
+ var _this$_input$selectio, _this$_input$selectio2;
6346
6512
  event.preventDefault();
6347
6513
  const char = this._sanitize(data);
6348
6514
  if (!char) return;
6349
6515
  const index = Math.min((_this$_input$selectio = this._input.selectionStart) !== null && _this$_input$selectio !== void 0 ? _this$_input$selectio : 0, this._length - 1);
6516
+ const end = Math.max((_this$_input$selectio2 = this._input.selectionEnd) !== null && _this$_input$selectio2 !== void 0 ? _this$_input$selectio2 : index, index + 1);
6350
6517
  const chars = [...this._input.value];
6351
- chars[index] = char;
6518
+ chars.splice(index, end - index, char);
6352
6519
  this._input.value = chars.join("").slice(0, this._length);
6353
6520
  this._selectSlot(index + 1);
6354
6521
  this._afterValueChange();
6355
6522
  return;
6356
6523
  }
6357
6524
  if (inputType === "deleteContentBackward") {
6358
- var _this$_input$selectio2, _this$_input$selectio3;
6525
+ var _this$_input$selectio3, _this$_input$selectio4;
6359
6526
  event.preventDefault();
6360
- const start = (_this$_input$selectio2 = this._input.selectionStart) !== null && _this$_input$selectio2 !== void 0 ? _this$_input$selectio2 : 0;
6361
- const end = (_this$_input$selectio3 = this._input.selectionEnd) !== null && _this$_input$selectio3 !== void 0 ? _this$_input$selectio3 : start;
6527
+ const before = this._input.value;
6528
+ const start = (_this$_input$selectio3 = this._input.selectionStart) !== null && _this$_input$selectio3 !== void 0 ? _this$_input$selectio3 : 0;
6529
+ const end = (_this$_input$selectio4 = this._input.selectionEnd) !== null && _this$_input$selectio4 !== void 0 ? _this$_input$selectio4 : start;
6362
6530
  const chars = [...this._input.value];
6363
6531
  if (end > start) {
6364
6532
  chars.splice(start, end - start);
@@ -6369,7 +6537,25 @@ var OtpInput = class extends BaseComponent {
6369
6537
  this._input.value = chars.join("");
6370
6538
  this._selectSlot(start - 1);
6371
6539
  }
6372
- this._afterValueChange();
6540
+ this._afterValueChange(before);
6541
+ return;
6542
+ }
6543
+ if (inputType === "deleteContentForward") {
6544
+ var _this$_input$selectio5, _this$_input$selectio6;
6545
+ event.preventDefault();
6546
+ const before = this._input.value;
6547
+ const start = (_this$_input$selectio5 = this._input.selectionStart) !== null && _this$_input$selectio5 !== void 0 ? _this$_input$selectio5 : 0;
6548
+ const end = (_this$_input$selectio6 = this._input.selectionEnd) !== null && _this$_input$selectio6 !== void 0 ? _this$_input$selectio6 : start;
6549
+ const chars = [...this._input.value];
6550
+ if (end > start) {
6551
+ chars.splice(start, end - start);
6552
+ this._input.value = chars.join("");
6553
+ } else if (start < chars.length) {
6554
+ chars.splice(start, 1);
6555
+ this._input.value = chars.join("");
6556
+ }
6557
+ this._selectSlot(start);
6558
+ this._afterValueChange(before);
6373
6559
  }
6374
6560
  }
6375
6561
  _handlePointerDown(event) {
@@ -6393,8 +6579,9 @@ var OtpInput = class extends BaseComponent {
6393
6579
  }
6394
6580
  return null;
6395
6581
  }
6396
- _afterValueChange() {
6582
+ _afterValueChange(before) {
6397
6583
  this._render();
6584
+ if (before !== void 0 && before === this._input.value) return;
6398
6585
  EventHandler.trigger(this._element, EVENT_INPUT, { value: this._input.value });
6399
6586
  this._checkComplete();
6400
6587
  }
@@ -6410,10 +6597,10 @@ var OtpInput = class extends BaseComponent {
6410
6597
  return value.replace(this._type.filter, "").slice(0, this._length);
6411
6598
  }
6412
6599
  _render() {
6413
- var _this$_input$selectio4;
6600
+ var _this$_input$selectio7;
6414
6601
  const { value } = this._input;
6415
6602
  const isFocused = document.activeElement === this._input;
6416
- const caret = Math.min((_this$_input$selectio4 = this._input.selectionStart) !== null && _this$_input$selectio4 !== void 0 ? _this$_input$selectio4 : value.length, this._length - 1);
6603
+ const caret = Math.min((_this$_input$selectio7 = this._input.selectionStart) !== null && _this$_input$selectio7 !== void 0 ? _this$_input$selectio7 : value.length, this._length - 1);
6417
6604
  for (const [index, slot] of this._slots.entries()) {
6418
6605
  var _value$index;
6419
6606
  const char = (_value$index = value[index]) !== null && _value$index !== void 0 ? _value$index : "";
@@ -6424,7 +6611,9 @@ var OtpInput = class extends BaseComponent {
6424
6611
  }
6425
6612
  _checkComplete() {
6426
6613
  const { value } = this._input;
6427
- if (value.length === this._length) EventHandler.trigger(this._element, EVENT_COMPLETE, { value });
6614
+ const complete = value.length === this._length;
6615
+ if (complete && !this._wasComplete) EventHandler.trigger(this._element, EVENT_COMPLETE, { value });
6616
+ this._wasComplete = complete;
6428
6617
  }
6429
6618
  };
6430
6619
  /**
@@ -6587,7 +6776,9 @@ var Sparkline = class extends BaseComponent {
6587
6776
  const previous = this._element.querySelector("svg");
6588
6777
  (_this$_element$queryS = this._element.querySelector(`.${CLASS_NAME_LABEL}`)) === null || _this$_element$queryS === void 0 || _this$_element$queryS.remove();
6589
6778
  if (this._config.values.length === 0) {
6590
- this._element.innerHTML = "";
6779
+ cancelAnimationFrame(this._frame);
6780
+ previous === null || previous === void 0 || previous.remove();
6781
+ EventHandler.trigger(this._element, EVENT_RENDERED);
6591
6782
  return;
6592
6783
  }
6593
6784
  let svg;
@@ -6619,8 +6810,10 @@ var Sparkline = class extends BaseComponent {
6619
6810
  EventHandler.trigger(this._element, EVENT_RENDERED);
6620
6811
  }
6621
6812
  dispose() {
6813
+ var _this$_element$queryS2, _this$_element$queryS3;
6622
6814
  cancelAnimationFrame(this._frame);
6623
- this._element.innerHTML = "";
6815
+ (_this$_element$queryS2 = this._element.querySelector("svg")) === null || _this$_element$queryS2 === void 0 || _this$_element$queryS2.remove();
6816
+ (_this$_element$queryS3 = this._element.querySelector(`.${CLASS_NAME_LABEL}`)) === null || _this$_element$queryS3 === void 0 || _this$_element$queryS3.remove();
6624
6817
  super.dispose();
6625
6818
  }
6626
6819
  _configAfterMerge(config) {
@@ -6652,6 +6845,7 @@ var Sparkline = class extends BaseComponent {
6652
6845
  const pairs = Array.from(to.children).map((target, i) => {
6653
6846
  const source = from.children[i];
6654
6847
  const tweens = [];
6848
+ for (const { name } of Array.from(source.attributes)) if (!target.hasAttribute(name)) source.removeAttribute(name);
6655
6849
  for (const { name, value } of Array.from(target.attributes)) {
6656
6850
  const start = source.getAttribute(name);
6657
6851
  if (start === null || start === value) source.setAttribute(name, value);
@@ -6707,8 +6901,8 @@ var Sparkline = class extends BaseComponent {
6707
6901
  const svg = this._createSvg();
6708
6902
  const { min, span } = rangeOf(cfg.values, cfg.min, cfg.max, ...cfg.threshold === null ? [] : [cfg.threshold]);
6709
6903
  const yOf = (value) => cfg.pad + (1 - (value - min) / span) * (cfg.height - cfg.pad * 2);
6710
- const ys = cfg.values.map(yOf);
6711
- const step = ys.length > 1 ? cfg.width / (ys.length - 1) : cfg.width;
6904
+ const ys = cfg.values.length === 1 ? [yOf(cfg.values[0]), yOf(cfg.values[0])] : cfg.values.map(yOf);
6905
+ const step = cfg.width / (ys.length - 1);
6712
6906
  if (cfg.threshold !== null) this._hairline(svg, yOf(cfg.threshold), "threshold", true);
6713
6907
  if (cfg.fill === "auto") {
6714
6908
  const area = svgEl("path");
@@ -6733,7 +6927,7 @@ var Sparkline = class extends BaseComponent {
6733
6927
  if (spotIndex >= 0) {
6734
6928
  const spot = svgEl("circle");
6735
6929
  setAttr(spot, {
6736
- cx: spotIndex * step,
6930
+ cx: cfg.values.length === 1 ? cfg.width / 2 : spotIndex * step,
6737
6931
  cy: ys[spotIndex],
6738
6932
  r: getCssNumber(this._element, "spot-size", 2),
6739
6933
  fill: cssVar("spot")
@@ -6811,7 +7005,7 @@ var Sparkline = class extends BaseComponent {
6811
7005
  _renderCircle() {
6812
7006
  const cfg = this._config;
6813
7007
  const svg = this._createSvg();
6814
- const strokeWidth = getCssNumber(this._element, "stroke-width", 3);
7008
+ const strokeWidth = getCssNumber(this._element, "stroke-width", 2);
6815
7009
  const radius = Math.max(0, Math.min(cfg.width, cfg.height) / 2 - strokeWidth / 2);
6816
7010
  const cx = cfg.width / 2;
6817
7011
  const cy = cfg.height / 2;
@@ -6963,13 +7157,20 @@ var Strength = class extends BaseComponent {
6963
7157
  (_this$_input = this._input) === null || _this$_input === void 0 || _this$_input.removeEventListener("input", this._onInput);
6964
7158
  super.dispose();
6965
7159
  }
7160
+ _configAfterMerge(config) {
7161
+ return _objectSpread2(_objectSpread2({}, config), {}, {
7162
+ messages: _objectSpread2(_objectSpread2({}, Default.messages), config.messages),
7163
+ weights: _objectSpread2(_objectSpread2({}, Default.weights), config.weights)
7164
+ });
7165
+ }
6966
7166
  _getInput() {
6967
- var _fields;
7167
+ var _ref, _precedingFields;
6968
7168
  const { input } = this._config;
6969
- if (input) return SelectorEngine.findOne(input);
7169
+ if (input) return getElement(input);
6970
7170
  const parent = this._element.parentElement;
6971
7171
  const fields = parent ? SelectorEngine.find(SELECTOR_PASSWORD, parent) : [];
6972
- return (_fields = fields[fields.length - 1]) !== null && _fields !== void 0 ? _fields : null;
7172
+ const precedingFields = fields.filter((field) => Boolean(field.compareDocumentPosition(this._element) & Node.DOCUMENT_POSITION_FOLLOWING));
7173
+ return (_ref = (_precedingFields = precedingFields[precedingFields.length - 1]) !== null && _precedingFields !== void 0 ? _precedingFields : fields[0]) !== null && _ref !== void 0 ? _ref : null;
6973
7174
  }
6974
7175
  _getText() {
6975
7176
  const parent = this._element.parentElement;