@weekwise/react 0.1.1 → 0.1.2

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/index.js CHANGED
@@ -392,32 +392,38 @@ function pt(e, t, n = !0) {
392
392
  ]);
393
393
  }
394
394
  // src/hooks/useToday.ts
395
- function mt() {
396
- let { getToday: e, addDays: t, toMillis: n, fromMillis: r } = K(), [a, o] = d(() => n(e()));
395
+ var mt = (e) => e.toMillis(e.getToday());
396
+ function ht() {
397
+ let e = K(), [t, n] = d(() => ({
398
+ dateUtils: e,
399
+ today: mt(e)
400
+ })), r = t;
401
+ t.dateUtils !== e && (r = {
402
+ dateUtils: e,
403
+ today: mt(e)
404
+ }, n(r));
405
+ let { today: a } = r;
397
406
  return i(() => {
398
- let i = n(t(r(a), 1)), s = Math.max(i - Date.now(), 0) + 1e3, c = setTimeout(() => o(n(e())), s);
399
- return () => clearTimeout(c);
400
- }, [
401
- t,
402
- r,
403
- e,
404
- n,
405
- a
406
- ]), a;
407
+ let t = e.toMillis(e.addDays(e.fromMillis(a), 1)), r = Math.max(t - Date.now(), 0) + 1e3, i = setTimeout(() => n({
408
+ dateUtils: e,
409
+ today: mt(e)
410
+ }), r);
411
+ return () => clearTimeout(i);
412
+ }, [e, a]), a;
407
413
  }
408
414
  // src/contexts/CalendarContext.ts
409
- var ht = e(void 0);
410
- U && (ht.displayName = "CalendarContext");
415
+ var gt = e(void 0);
416
+ U && (gt.displayName = "CalendarContext");
411
417
  function J() {
412
- let e = r(ht);
418
+ let e = r(gt);
413
419
  if (!e) throw Error("CalendarContext is required");
414
420
  return e;
415
421
  }
416
422
  // src/contexts/ThemeSourceContext.ts
417
- var gt = e(null);
418
- U && (gt.displayName = "ThemeSourceContext");
423
+ var _t = e(null);
424
+ U && (_t.displayName = "ThemeSourceContext");
419
425
  // src/hooks/useCalendarValue.ts
420
- function _t(e) {
426
+ function vt(e) {
421
427
  let { view: t, defaultView: r, startWeek: a, viewValue: o, defaultViewValue: s, dateUtils: c, onChangeView: l, onChangeViewValue: d } = e, [f, p] = $e({
422
428
  controlled: t,
423
429
  default: r,
@@ -451,7 +457,7 @@ function _t(e) {
451
457
  };
452
458
  }
453
459
  // src/hooks/useNavigation.ts
454
- function vt(e) {
460
+ function yt(e) {
455
461
  let { dateUtils: t, view: n, viewValue: r, changeViewValue: i, startWeek: a } = e, o = (e, r) => () => i(z(t, n, e, r, a), n);
456
462
  return {
457
463
  goForward: q(o(r, 1)),
@@ -460,7 +466,7 @@ function vt(e) {
460
466
  };
461
467
  }
462
468
  // src/icons/chevron.tsx
463
- function yt(e) {
469
+ function bt(e) {
464
470
  return /* @__PURE__ */ W("svg", {
465
471
  xmlns: "http://www.w3.org/2000/svg",
466
472
  fill: "none",
@@ -475,11 +481,11 @@ function yt(e) {
475
481
  });
476
482
  }
477
483
  // src/portal/Portal.tsx
478
- var bt = () => () => {}, xt = () => !0, St = () => !1;
479
- function Ct() {
480
- return f(bt, xt, St);
484
+ var xt = () => () => {}, St = () => !0, Ct = () => !1;
485
+ function wt() {
486
+ return f(xt, St, Ct);
481
487
  }
482
- function wt(e) {
488
+ function Tt(e) {
483
489
  let t = { display: "contents" };
484
490
  if (!e) return t;
485
491
  let n = getComputedStyle(e);
@@ -489,10 +495,10 @@ function wt(e) {
489
495
  }
490
496
  return t;
491
497
  }
492
- function Tt({ children: e, container: t }) {
493
- let n = Ct(), i = r(gt);
498
+ function Et({ children: e, container: t }) {
499
+ let n = wt(), i = r(_t);
494
500
  return n ? t ? Be(e, t) : Be(/* @__PURE__ */ W("div", {
495
- style: wt(i?.current),
501
+ style: Tt(i?.current),
496
502
  children: e
497
503
  }), document.body) : null;
498
504
  }
@@ -517,7 +523,7 @@ var Y = {
517
523
  popover__day_today: "_popover__day_today_1aojr_162"
518
524
  };
519
525
  // src/components/date-navigator/DateNavigator.tsx
520
- function Et({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, className: a, ...o }) {
526
+ function Dt({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, className: a, ...o }) {
521
527
  let { view: s, viewValue: l, changeViewValue: f, startWeek: p } = J(), m = K(), h = Ge(), { getStartOfWeek: g, getStartOfMonth: _, addMonths: v } = m, [y, b] = d(!1), [x, S] = d(() => _(l)), C = u(null), { refs: w, floatingStyles: T } = Re({
522
528
  placement: "bottom",
523
529
  middleware: [
@@ -574,8 +580,8 @@ function Et({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, cl
574
580
  children: [/* @__PURE__ */ W("span", {
575
581
  className: Y.root__toggleLabel,
576
582
  children: E
577
- }), /* @__PURE__ */ W(yt, { className: D(Y.root__toggleIcon, { [Y.root__toggleIcon_open]: y }) })]
578
- }), y && /* @__PURE__ */ W(Tt, { children: /* @__PURE__ */ G("div", {
583
+ }), /* @__PURE__ */ W(bt, { className: D(Y.root__toggleIcon, { [Y.root__toggleIcon_open]: y }) })]
584
+ }), y && /* @__PURE__ */ W(Et, { children: /* @__PURE__ */ G("div", {
579
585
  ref: w.setFloating,
580
586
  style: T,
581
587
  role: "dialog",
@@ -588,7 +594,7 @@ function Et({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, cl
588
594
  type: "button",
589
595
  "aria-label": h.previousMonth,
590
596
  onClick: () => S((e) => v(e, -1)),
591
- children: /* @__PURE__ */ W(yt, { className: Y.popover__navBackward })
597
+ children: /* @__PURE__ */ W(bt, { className: Y.popover__navBackward })
592
598
  }),
593
599
  /* @__PURE__ */ W("div", {
594
600
  className: Y.popover__title,
@@ -598,7 +604,7 @@ function Et({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, cl
598
604
  type: "button",
599
605
  "aria-label": h.nextMonth,
600
606
  onClick: () => S((e) => v(e, 1)),
601
- children: /* @__PURE__ */ W(yt, { className: Y.popover__navForward })
607
+ children: /* @__PURE__ */ W(bt, { className: Y.popover__navForward })
602
608
  })
603
609
  ]
604
610
  }), /* @__PURE__ */ G("div", {
@@ -625,14 +631,14 @@ function Et({ renderHeading: e, type: t = "button", onClick: n, onKeyDown: r, cl
625
631
  }) })]
626
632
  });
627
633
  }
628
- var Dt = {
634
+ var Ot = {
629
635
  root: "_root_l1csz_1",
630
636
  root__icon: "_root__icon_l1csz_21",
631
637
  root__icon_forward: "_root__icon_forward_l1csz_25",
632
638
  root__icon_backward: "_root__icon_backward_l1csz_29"
633
639
  };
634
640
  // src/components/nav-btn/NavBtn.tsx
635
- function Ot({ direction: e = "forward", type: t = "button", onClick: n, className: r, children: i, ...a }) {
641
+ function kt({ direction: e = "forward", type: t = "button", onClick: n, className: r, children: i, ...a }) {
636
642
  let { goForward: o, goBackward: s } = J(), c = Ge(), l = q(ve(n, () => {
637
643
  e === "forward" ? o() : e === "backward" && s();
638
644
  }));
@@ -641,14 +647,14 @@ function Ot({ direction: e = "forward", type: t = "button", onClick: n, classNam
641
647
  "aria-label": e === "forward" ? c.next : c.previous,
642
648
  ...a,
643
649
  onClick: l,
644
- className: D(r, Dt.root),
645
- children: i ?? /* @__PURE__ */ W(yt, { className: D(Dt.root__icon, {
646
- [Dt.root__icon_backward]: e === "backward",
647
- [Dt.root__icon_forward]: e === "forward"
650
+ className: D(r, Ot.root),
651
+ children: i ?? /* @__PURE__ */ W(bt, { className: D(Ot.root__icon, {
652
+ [Ot.root__icon_backward]: e === "backward",
653
+ [Ot.root__icon_forward]: e === "forward"
648
654
  }) })
649
655
  });
650
656
  }
651
- var kt = {
657
+ var At = {
652
658
  root: "_root_1n590_1",
653
659
  root__icon: "_root__icon_1n590_25",
654
660
  root__icon_open: "_root__icon_open_1n590_32",
@@ -656,12 +662,12 @@ var kt = {
656
662
  list__option: "_list__option_1n590_48",
657
663
  list__option_active: "_list__option_active_1n590_67",
658
664
  list__check: "_list__check_1n590_75"
659
- }, At = [
665
+ }, jt = [
660
666
  "day",
661
667
  "week",
662
668
  "month"
663
669
  ];
664
- function jt({ className: e }) {
670
+ function Mt({ className: e }) {
665
671
  let { view: t, changeView: n } = J(), r = Ge(), { addGlobalListener: o, removeGlobalListener: s } = it(), c = a(), [l, f] = d(!1), [p, m] = d(t), h = u(/* @__PURE__ */ new Map()), { refs: g, floatingStyles: _ } = Re({
666
672
  placement: "bottom-end",
667
673
  middleware: [
@@ -698,14 +704,14 @@ function jt({ className: e }) {
698
704
  let x = (e) => {
699
705
  (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), y());
700
706
  }, S = (e) => {
701
- let t = At.indexOf(p), n = (t) => {
702
- e.preventDefault(), m(At[(t + At.length) % At.length] ?? p);
707
+ let t = jt.indexOf(p), n = (t) => {
708
+ e.preventDefault(), m(jt[(t + jt.length) % jt.length] ?? p);
703
709
  };
704
710
  switch (e.key) {
705
711
  case "ArrowDown": return n(t + 1);
706
712
  case "ArrowUp": return n(t - 1);
707
713
  case "Home": return n(0);
708
- case "End": return n(At.length - 1);
714
+ case "End": return n(jt.length - 1);
709
715
  case "Enter":
710
716
  case " ": return e.preventDefault(), b(p);
711
717
  case "Escape": return e.preventDefault(), v(!0);
@@ -719,22 +725,22 @@ function jt({ className: e }) {
719
725
  "aria-expanded": l,
720
726
  "aria-controls": l ? C : void 0,
721
727
  "aria-label": `${r.chooseView}: ${r[t]}`,
722
- className: D(e, kt.root),
728
+ className: D(e, At.root),
723
729
  onClick: () => l ? v(!1) : y(),
724
730
  onKeyDown: x,
725
- children: [r[t], /* @__PURE__ */ W(yt, {
731
+ children: [r[t], /* @__PURE__ */ W(bt, {
726
732
  "aria-hidden": "true",
727
- className: D(kt.root__icon, { [kt.root__icon_open]: l })
733
+ className: D(At.root__icon, { [At.root__icon_open]: l })
728
734
  })]
729
- }), l && /* @__PURE__ */ W(Tt, { children: /* @__PURE__ */ W("div", {
735
+ }), l && /* @__PURE__ */ W(Et, { children: /* @__PURE__ */ W("div", {
730
736
  ref: g.setFloating,
731
737
  id: C,
732
738
  role: "listbox",
733
739
  "aria-label": r.chooseView,
734
740
  style: _,
735
- className: kt.list,
741
+ className: At.list,
736
742
  onKeyDown: S,
737
- children: At.map((e) => /* @__PURE__ */ G("div", {
743
+ children: jt.map((e) => /* @__PURE__ */ G("div", {
738
744
  ref: (t) => {
739
745
  t ? h.current.set(e, t) : h.current.delete(e);
740
746
  },
@@ -742,12 +748,12 @@ function jt({ className: e }) {
742
748
  role: "option",
743
749
  tabIndex: -1,
744
750
  "aria-selected": e === t,
745
- className: D(kt.list__option, { [kt.list__option_active]: e === p }),
751
+ className: D(At.list__option, { [At.list__option_active]: e === p }),
746
752
  onClick: () => b(e),
747
753
  onPointerMove: () => m(e),
748
754
  children: [r[e], e === t && /* @__PURE__ */ W("svg", {
749
755
  "aria-hidden": "true",
750
- className: kt.list__check,
756
+ className: At.list__check,
751
757
  viewBox: "0 0 16 16",
752
758
  width: "14",
753
759
  height: "14",
@@ -774,7 +780,7 @@ var X = {
774
780
  root__viewSelect: "_root__viewSelect_1lvdm_89"
775
781
  };
776
782
  // src/components/calendar-toolbar/CalendarToolbar.tsx
777
- function Mt(e) {
783
+ function Nt(e) {
778
784
  let { goToday: t, changeView: n, view: r } = J(), i = Ge(), a = e, o = {
779
785
  day: {
780
786
  type: "button",
@@ -807,14 +813,14 @@ function Mt(e) {
807
813
  ...a,
808
814
  className: D(a.className, X.root),
809
815
  children: [
810
- /* @__PURE__ */ W(Et, {}),
816
+ /* @__PURE__ */ W(Dt, {}),
811
817
  /* @__PURE__ */ G("div", {
812
818
  className: X.root__navigationPane,
813
819
  role: "group",
814
820
  children: [
815
- /* @__PURE__ */ W(Ot, { direction: "backward" }),
821
+ /* @__PURE__ */ W(kt, { direction: "backward" }),
816
822
  /* @__PURE__ */ W("button", { ...s }),
817
- /* @__PURE__ */ W(Ot, { direction: "forward" })
823
+ /* @__PURE__ */ W(kt, { direction: "forward" })
818
824
  ]
819
825
  }),
820
826
  /* @__PURE__ */ G("div", {
@@ -827,26 +833,26 @@ function Mt(e) {
827
833
  }),
828
834
  /* @__PURE__ */ W("div", {
829
835
  className: X.root__viewSelect,
830
- children: /* @__PURE__ */ W(jt, {})
836
+ children: /* @__PURE__ */ W(Mt, {})
831
837
  })
832
838
  ]
833
839
  });
834
840
  }
835
841
  // src/contexts/CalendarViewportContext.ts
836
- var Nt = e(void 0);
837
- U && (Nt.displayName = "CalendarViewportContext");
838
- function Pt() {
839
- let e = r(Nt);
842
+ var Pt = e(void 0);
843
+ U && (Pt.displayName = "CalendarViewportContext");
844
+ function Ft() {
845
+ let e = r(Pt);
840
846
  if (!e) throw Error("CalendarViewportContext is required");
841
847
  return e;
842
848
  }
843
- var Ft = { root: "_root_i43d6_1" };
849
+ var It = { root: "_root_i43d6_1" };
844
850
  // src/components/pointer-popover/PointerPopover.tsx
845
- function It({ coordinates: e, className: t, style: n, ...r }) {
851
+ function Lt({ coordinates: e, className: t, style: n, ...r }) {
846
852
  return /* @__PURE__ */ W("span", {
847
853
  tabIndex: -1,
848
854
  ...r,
849
- className: D(t, Ft.root),
855
+ className: D(t, It.root),
850
856
  style: {
851
857
  ...n,
852
858
  ...e ? {
@@ -856,18 +862,18 @@ function It({ coordinates: e, className: t, style: n, ...r }) {
856
862
  }
857
863
  });
858
864
  }
859
- var Lt = {
865
+ var Rt = {
860
866
  root: "_root_mqfwg_1",
861
867
  root_isDragging: "_root_isDragging_mqfwg_11",
862
868
  root_isReturning: "_root_isReturning_mqfwg_20",
863
869
  "ww-drag-return": "_ww-drag-return_mqfwg_36",
864
870
  root_isBlocked: "_root_isBlocked_mqfwg_33"
865
- }, Rt = {
871
+ }, zt = {
866
872
  isStart: !0,
867
873
  isEnd: !0
868
874
  };
869
- function zt({ showPreview: e = !0, pxPerMinute: t = 1, ...n }) {
870
- let { eventMap: r, eventRenderer: i, pointerPreviewRenderer: a, view: o } = J(), { viewportRef: s } = Pt(), { isDragging: l, canDrop: f, dropData: p, eventItem: m, source: h, x: g, y: _, ...v } = Ne(({ draggable: e, overlay: t, droppable: n, canDrop: r }) => {
875
+ function Bt({ showPreview: e = !0, pxPerMinute: t = 1, ...n }) {
876
+ let { eventMap: r, eventRenderer: i, pointerPreviewRenderer: a, view: o } = J(), { viewportRef: s } = Ft(), { isDragging: l, canDrop: f, dropData: p, eventItem: m, source: h, x: g, y: _, ...v } = Ne(({ draggable: e, overlay: t, droppable: n, canDrop: r }) => {
871
877
  let i = [...n.dropTargets.values()].shift(), a = [...e.dragTargets.values()].shift();
872
878
  return {
873
879
  ...t.transform,
@@ -906,27 +912,27 @@ function zt({ showPreview: e = !0, pxPerMinute: t = 1, ...n }) {
906
912
  }
907
913
  });
908
914
  }), !l) return null;
909
- if (!p) return x ? /* @__PURE__ */ W(Tt, {
915
+ if (!p) return x ? /* @__PURE__ */ W(Et, {
910
916
  container: x.container,
911
917
  children: /* @__PURE__ */ W("div", {
912
918
  ...n,
913
- className: D(n.className, Lt.root, Lt.root_isReturning),
919
+ className: D(n.className, Rt.root, Rt.root_isReturning),
914
920
  style: x.style,
915
- children: y == null ? null : i.current?.(y, o, Rt)
921
+ children: y == null ? null : i.current?.(y, o, zt)
916
922
  })
917
923
  }) : null;
918
924
  let C = !f;
919
- return /* @__PURE__ */ G(Tt, {
925
+ return /* @__PURE__ */ G(Et, {
920
926
  container: s.current,
921
927
  children: [/* @__PURE__ */ W("div", {
922
928
  ...n,
923
- className: D(n.className, Lt.root, {
924
- [Lt.root_isDragging]: l,
925
- [Lt.root_isBlocked]: C
929
+ className: D(n.className, Rt.root, {
930
+ [Rt.root_isDragging]: l,
931
+ [Rt.root_isBlocked]: C
926
932
  }),
927
933
  style: { ...v },
928
- children: y == null ? null : i.current?.(y, o, Rt)
929
- }), e && !C && /* @__PURE__ */ W(It, {
934
+ children: y == null ? null : i.current?.(y, o, zt)
935
+ }), e && !C && /* @__PURE__ */ W(Lt, {
930
936
  coordinates: {
931
937
  x: g,
932
938
  y: _
@@ -936,16 +942,16 @@ function zt({ showPreview: e = !0, pxPerMinute: t = 1, ...n }) {
936
942
  });
937
943
  }
938
944
  // src/components/month-view/MonthView.utils.ts
939
- function Bt(e, t) {
945
+ function Vt(e, t) {
940
946
  return {
941
947
  ...t,
942
948
  ...e
943
949
  };
944
950
  }
945
- function Vt(e) {
951
+ function Ht(e) {
946
952
  return Array.from({ length: Math.ceil(e.length / 7) }, (t, n) => e.slice(n * 7, n * 7 + 7));
947
953
  }
948
- function Ht(e, t, n) {
954
+ function Ut(e, t, n) {
949
955
  let r = e?.querySelectorAll("[data-day-index]") ?? [], i = -1, a = 1e400;
950
956
  for (let e of r) {
951
957
  let r = e.getBoundingClientRect(), o = t < r.left ? r.left - t : t >= r.right ? t - r.right : 0, s = n < r.top ? r.top - n : n >= r.bottom ? n - r.bottom : 0, c = Math.hypot(o, s);
@@ -978,7 +984,7 @@ var Z = {
978
984
  root__more: "_root__more_diwsf_228"
979
985
  };
980
986
  // src/components/month-view/MonthViewDay.tsx
981
- function Ut(e) {
987
+ function Wt(e) {
982
988
  let { ref: t, targetDate: n, children: r, onDoubleClick: a, ...o } = e, { onEventChange: s, onEventCreate: c, getIsDayDisabled: l, disabled: d, eventMap: f } = J(), p = K(), { getHours: m, getMinutes: h, getNow: g } = p, _ = u(null), { register: v, isOver: y } = Ne(({ registerDropTarget: e, isOver: t }) => ({
983
989
  register: e,
984
990
  isOver: t(_.current)
@@ -1029,7 +1035,7 @@ function Ut(e) {
1029
1035
  });
1030
1036
  }
1031
1037
  // src/hooks/useInterval.ts
1032
- function Wt() {
1038
+ function Gt() {
1033
1039
  let e = u(null);
1034
1040
  return [n((t, n) => {
1035
1041
  e.current = setInterval(t, n);
@@ -1038,7 +1044,7 @@ function Wt() {
1038
1044
  }, [])];
1039
1045
  }
1040
1046
  // src/hooks/useScrollIntent.ts
1041
- var Gt = {
1047
+ var Kt = {
1042
1048
  x: {
1043
1049
  [-1]: !1,
1044
1050
  1: !1
@@ -1048,10 +1054,10 @@ var Gt = {
1048
1054
  1: !1
1049
1055
  }
1050
1056
  };
1051
- function Kt({ delta: e, disabled: t }) {
1057
+ function qt({ delta: e, disabled: t }) {
1052
1058
  let n = lt(e);
1053
1059
  return Xe((r) => {
1054
- if (t || !n || !r) return Gt;
1060
+ if (t || !n || !r) return Kt;
1055
1061
  let i = {
1056
1062
  x: Math.sign(e.x - n.x),
1057
1063
  y: Math.sign(e.y - n.y)
@@ -1073,8 +1079,8 @@ function Kt({ delta: e, disabled: t }) {
1073
1079
  ]);
1074
1080
  }
1075
1081
  // src/hooks/useAutoScroller.ts
1076
- function qt(e) {
1077
- let { acceleration: t, activator: r = 0, canScroll: a, enabled: o, interval: s = 5, pointerCoordinates: l, order: d = 0, delta: f, threshold: p, activeNodeRect: m, scrollableAncestors: h, scrollableAncestorsRects: g } = e, [_, v] = Wt(), y = Kt({
1082
+ function Jt(e) {
1083
+ let { acceleration: t, activator: r = 0, canScroll: a, enabled: o, interval: s = 5, pointerCoordinates: l, order: d = 0, delta: f, threshold: p, activeNodeRect: m, scrollableAncestors: h, scrollableAncestorsRects: g } = e, [_, v] = Gt(), y = qt({
1078
1084
  delta: f,
1079
1085
  disabled: !o
1080
1086
  }), b = u({
@@ -1148,7 +1154,7 @@ function qt(e) {
1148
1154
  ]);
1149
1155
  }
1150
1156
  // src/hooks/useMutationObserver.ts
1151
- function Jt(e, t = !1) {
1157
+ function Yt(e, t = !1) {
1152
1158
  let n = u(e);
1153
1159
  n.current = e;
1154
1160
  let r = c(() => {
@@ -1159,8 +1165,8 @@ function Jt(e, t = !1) {
1159
1165
  return i(() => () => r?.disconnect(), [r]), r;
1160
1166
  }
1161
1167
  // src/hooks/useRect.ts
1162
- function Yt(e, t = P, n) {
1163
- let [r, i] = l(s, null), a = Jt((t) => {
1168
+ function Xt(e, t = P, n) {
1169
+ let [r, i] = l(s, null), a = Yt((t) => {
1164
1170
  if (e) for (let n of t) {
1165
1171
  let { type: t, target: r } = n;
1166
1172
  if (t === "childList" && pe(r) && r.contains(e)) {
@@ -1187,18 +1193,18 @@ function Yt(e, t = P, n) {
1187
1193
  }
1188
1194
  }
1189
1195
  // src/hooks/useScrollableAncestors.ts
1190
- var Xt = [];
1191
- function Zt(e, t) {
1192
- let n = u(e), r = c(() => e ? re(e, t) : Xt, [e, t]);
1196
+ var Zt = [];
1197
+ function Qt(e, t) {
1198
+ let n = u(e), r = c(() => e ? re(e, t) : Zt, [e, t]);
1193
1199
  return i(() => {
1194
1200
  n.current = e;
1195
1201
  }, [e]), r;
1196
1202
  }
1197
1203
  // src/hooks/useScrollableAncestorsRects.ts
1198
- var Qt = [];
1199
- function $t(e, t = P) {
1200
- let [n, r] = l(a, Qt), i = qe(r);
1201
- return e.length > 0 && n === Qt && r(), Ke(() => {
1204
+ var $t = [];
1205
+ function en(e, t = P) {
1206
+ let [n, r] = l(a, $t), i = qe(r);
1207
+ return e.length > 0 && n === $t && r(), Ke(() => {
1202
1208
  e.length ? e.forEach((e) => i?.observe(e)) : (i?.disconnect(), r());
1203
1209
  }, [e, i]), n;
1204
1210
  function a() {
@@ -1215,11 +1221,11 @@ function $t(e, t = P) {
1215
1221
  };
1216
1222
  }
1217
1223
  return new h(t(e), e);
1218
- }) : Qt;
1224
+ }) : $t;
1219
1225
  }
1220
1226
  }
1221
1227
  // src/hooks/useScrollOffsets.ts
1222
- function en(e) {
1228
+ function tn(e) {
1223
1229
  let [t, r] = d(null), a = u(e), o = n((e) => {
1224
1230
  let t = ie(e.target);
1225
1231
  t && r((e) => e ? (e.set(t, V(t)), new Map(e)) : null);
@@ -1246,7 +1252,7 @@ function en(e) {
1246
1252
  }, [o, e]), c(() => e.length ? t ? Array.from(t.values()).reduce((e, t) => _(e, t), O) : H(e) : O, [e, t]);
1247
1253
  }
1248
1254
  // src/hooks/useScrollOffsetsDelta.ts
1249
- function tn(e, t = k) {
1255
+ function nn(e, t = k) {
1250
1256
  let n = u(null);
1251
1257
  return i(() => {
1252
1258
  n.current = null;
@@ -1256,11 +1262,11 @@ function tn(e, t = k) {
1256
1262
  }, [e]), n.current ? Oe(e, n.current) : O;
1257
1263
  }
1258
1264
  // src/hooks/useMoveTransform.ts
1259
- var nn = {
1265
+ var rn = {
1260
1266
  Start: "start",
1261
1267
  Move: "move",
1262
1268
  Stop: "stop"
1263
- }, rn = {
1269
+ }, an = {
1264
1270
  isActive: !1,
1265
1271
  initialTranslate: {
1266
1272
  x: 0,
@@ -1276,8 +1282,8 @@ var nn = {
1276
1282
  },
1277
1283
  context: null
1278
1284
  };
1279
- function an({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null, containerNode: r = null }) {
1280
- let [i, a] = l(on, rn), o = typeof n == "function" ? n(i.context) : n, s = typeof r == "function" ? r(i.context) : r, u = Yt(i.isActive ? o : null), d = Yt(i.isActive ? s : null), f = Zt(i.isActive ? o : null), p = $t(f), m = tn(en(f)), h = c(() => {
1285
+ function on({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null, containerNode: r = null }) {
1286
+ let [i, a] = l(sn, an), o = typeof n == "function" ? n(i.context) : n, s = typeof r == "function" ? r(i.context) : r, u = Xt(i.isActive ? o : null), d = Xt(i.isActive ? s : null), f = Qt(i.isActive ? o : null), p = en(f), m = nn(tn(f)), h = c(() => {
1281
1287
  let e = (e) => (t, n) => {
1282
1288
  a({
1283
1289
  type: e,
@@ -1286,12 +1292,12 @@ function an({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null
1286
1292
  });
1287
1293
  };
1288
1294
  return {
1289
- start: e(nn.Start),
1290
- move: e(nn.Move),
1291
- stop: e(nn.Stop)
1295
+ start: e(rn.Start),
1296
+ move: e(rn.Move),
1297
+ stop: e(rn.Stop)
1292
1298
  };
1293
1299
  }, []), g = _(i.initialTranslate, i.translate);
1294
- qt({
1300
+ Jt({
1295
1301
  delta: i.translate,
1296
1302
  enabled: e && i.isActive,
1297
1303
  activeNodeRect: u,
@@ -1333,18 +1339,18 @@ function an({ autoScrollEnabled: e = !0, modifiers: t = [], activeNode: n = null
1333
1339
  }
1334
1340
  ];
1335
1341
  }
1336
- function on(e, t) {
1342
+ function sn(e, t) {
1337
1343
  let n = {
1338
- [nn.Start]: (e, { coordinates: t, context: n }) => ({
1344
+ [rn.Start]: (e, { coordinates: t, context: n }) => ({
1339
1345
  ...e,
1340
1346
  isActive: !0,
1341
- currentAction: nn.Start,
1347
+ currentAction: rn.Start,
1342
1348
  initialTranslate: { ...t },
1343
1349
  context: n
1344
1350
  }),
1345
- [nn.Move]: (e, { coordinates: t }) => ({
1351
+ [rn.Move]: (e, { coordinates: t }) => ({
1346
1352
  ...e,
1347
- currentAction: nn.Move,
1353
+ currentAction: rn.Move,
1348
1354
  translate: {
1349
1355
  x: t.x - e.initialTranslate.x,
1350
1356
  y: t.y - e.initialTranslate.y
@@ -1354,17 +1360,17 @@ function on(e, t) {
1354
1360
  y: t.y - (e.translate.y + e.initialTranslate.y)
1355
1361
  }
1356
1362
  }),
1357
- [nn.Stop]: () => ({
1358
- ...rn,
1359
- currentAction: nn.Stop
1363
+ [rn.Stop]: () => ({
1364
+ ...an,
1365
+ currentAction: rn.Stop
1360
1366
  })
1361
1367
  };
1362
1368
  return _e(t.type, n, e, t);
1363
1369
  }
1364
1370
  // src/components/month-view/MonthViewEvent.tsx
1365
- var sn = 6;
1366
- function cn(e) {
1367
- let { ref: t, eventData: n, weekDays: r, resizable: a = !1, resize: o, isResizeSource: s = !1, isAnyResizing: c = !1, children: l, ...d } = e, { disabled: f } = J(), m = K(), { viewportRef: h } = Pt(), g = u(null), _ = u(null), { attributes: v, isDragging: y, overElement: b, register: x, setOverlayTransform: S } = Ne(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
1371
+ var cn = 6;
1372
+ function ln(e) {
1373
+ let { ref: t, eventData: n, weekDays: r, resizable: a = !1, resize: o, isResizeSource: s = !1, isAnyResizing: c = !1, children: l, ...d } = e, { disabled: f } = J(), m = K(), { viewportRef: h } = Ft(), g = u(null), _ = u(null), { attributes: v, isDragging: y, overElement: b, register: x, setOverlayTransform: S } = Ne(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
1368
1374
  let a = i(g.current), [o] = a ? [...n.dropTargets].pop() ?? [null] : [null];
1369
1375
  return {
1370
1376
  attributes: t.attributes,
@@ -1373,13 +1379,13 @@ function cn(e) {
1373
1379
  register: e,
1374
1380
  setOverlayTransform: r
1375
1381
  };
1376
- }), C = Yt(y ? b : null), [{ transform: w, context: T }, E] = an({
1382
+ }), C = Xt(y ? b : null), [{ transform: w, context: T }, E] = on({
1377
1383
  autoScrollEnabled: !1,
1378
1384
  activeNode: () => g.current,
1379
1385
  containerNode: () => h.current,
1380
1386
  modifiers: [function({ activeNodeRect: e, containerNodeRect: t, transform: n, translate: r, initialTranslate: i }) {
1381
1387
  if (!t || !e || !C) return n;
1382
- n.x = r.x + i.x - t.left, n.y = r.y + i.y - t.top, n.left = C.left - t.left + sn, n.width = C.width - 12, n.height = e.height;
1388
+ n.x = r.x + i.x - t.left, n.y = r.y + i.y - t.top, n.left = C.left - t.left + cn, n.width = C.width - 12, n.height = e.height;
1383
1389
  let a = e.top + r.y, o = C.top + p.header, s = C.top + C.height - e.height;
1384
1390
  return n.top = Math.max(o, Math.min(a, s)) - t.top, n;
1385
1391
  }]
@@ -1438,7 +1444,7 @@ function cn(e) {
1438
1444
  onMoveStart: () => (o?.start(n.key, e), !0),
1439
1445
  onMove: (e) => o?.move(e.clientX, e.clientY),
1440
1446
  onMoveEnd: () => o?.end()
1441
- }), { listeners: j } = ct(A("start")), { listeners: M } = ct(A("end")), N = st(g, t), P = n.span > 1 || !n.isStart || !n.isEnd, F = Bt({
1447
+ }), { listeners: j } = ct(A("start")), { listeners: M } = ct(A("end")), N = st(g, t), P = n.span > 1 || !n.isStart || !n.isEnd, F = Vt({
1442
1448
  "--ww-column": n.column + 1,
1443
1449
  "--ww-span": n.span,
1444
1450
  "--ww-row": n.lane + 2
@@ -1476,7 +1482,7 @@ function cn(e) {
1476
1482
  });
1477
1483
  }
1478
1484
  // src/components/month-view/MonthViewEventPreview.tsx
1479
- function ln({ bar: e, children: t }) {
1485
+ function un({ bar: e, children: t }) {
1480
1486
  return /* @__PURE__ */ W("div", {
1481
1487
  "aria-hidden": "true",
1482
1488
  "data-key": String(e.key),
@@ -1487,7 +1493,7 @@ function ln({ bar: e, children: t }) {
1487
1493
  [Z.root__event_continuesBefore]: !e.isStart,
1488
1494
  [Z.root__event_continuesAfter]: !e.isEnd
1489
1495
  }),
1490
- style: Bt({
1496
+ style: Vt({
1491
1497
  "--ww-column": e.column + 1,
1492
1498
  "--ww-span": e.span,
1493
1499
  "--ww-row": e.lane + 2
@@ -1496,11 +1502,11 @@ function ln({ bar: e, children: t }) {
1496
1502
  });
1497
1503
  }
1498
1504
  // src/components/month-view/MonthViewWeek.tsx
1499
- function un(e) {
1505
+ function dn(e) {
1500
1506
  let { days: t, firstDayIndex: n, layout: r, sourceBars: i, lanes: a, resizingKey: o, resize: s } = e, { viewValue: c, eventRenderer: l, view: u, disabled: d } = J(), { getMonthDay: f, isSameMonth: p, isToday: m, toMillis: h } = K(), g = Ge(), _ = o !== void 0, v = (e) => l.current?.(e.value, u, {
1501
1507
  isStart: e.isStart,
1502
1508
  isEnd: e.isEnd
1503
- }), y = (e, n = !1) => /* @__PURE__ */ W(cn, {
1509
+ }), y = (e, n = !1) => /* @__PURE__ */ W(ln, {
1504
1510
  eventData: e,
1505
1511
  weekDays: t,
1506
1512
  resizable: !d,
@@ -1512,24 +1518,24 @@ function un(e) {
1512
1518
  return /* @__PURE__ */ G("div", {
1513
1519
  className: Z.root__week,
1514
1520
  children: [
1515
- t.map((e, t) => /* @__PURE__ */ W(Ut, {
1521
+ t.map((e, t) => /* @__PURE__ */ W(Wt, {
1516
1522
  targetDate: e,
1517
1523
  "data-day-index": n + t,
1518
1524
  "data-is-outside": !p(e, c) || void 0,
1519
1525
  "data-is-today": m(e) ? !0 : void 0,
1520
- style: Bt({ "--ww-column": t + 1 }),
1526
+ style: Vt({ "--ww-column": t + 1 }),
1521
1527
  children: /* @__PURE__ */ W("span", {
1522
1528
  className: Z.root__dayNumber,
1523
1529
  children: f(e)
1524
1530
  })
1525
1531
  }, h(e))),
1526
- [...r.bars.map((e) => e.key === o ? /* @__PURE__ */ W(ln, {
1532
+ [...r.bars.map((e) => e.key === o ? /* @__PURE__ */ W(un, {
1527
1533
  bar: e,
1528
1534
  children: v(e)
1529
1535
  }, `preview-${e.key}`) : y(e)), ...i.map((e) => y(e, !0))],
1530
1536
  t.map((e, t) => r.hidden[t] > 0 && /* @__PURE__ */ W("span", {
1531
1537
  className: Z.root__more,
1532
- style: Bt({
1538
+ style: Vt({
1533
1539
  "--ww-column": t + 1,
1534
1540
  "--ww-row": a + 2
1535
1541
  }),
@@ -1539,7 +1545,7 @@ function un(e) {
1539
1545
  });
1540
1546
  }
1541
1547
  // src/components/month-view/useMonthLanes.ts
1542
- function dn(e, t) {
1548
+ function fn(e, t) {
1543
1549
  let [n, r] = d(t), i = () => {
1544
1550
  let n = e.current?.firstElementChild;
1545
1551
  n?.clientHeight && r(R(n.clientHeight, t));
@@ -1553,7 +1559,7 @@ function dn(e, t) {
1553
1559
  }, [a, t]), n;
1554
1560
  }
1555
1561
  // src/components/month-view/useMonthResize.ts
1556
- function fn(e) {
1562
+ function pn(e) {
1557
1563
  let { days: t, viewportRef: n, dateUtils: r, eventMap: i, disabled: a, getIsDayDisabled: o, onEventChange: s } = e, [l, u, d] = ft(null), { addGlobalListener: f, removeAllGlobalListeners: p } = it(), m = q((e = !0) => {
1558
1564
  let t = d.current;
1559
1565
  t && (p(), u(null), e && t.result && s(t.key, t.result.date, t.result.info));
@@ -1566,7 +1572,7 @@ function fn(e) {
1566
1572
  result: null
1567
1573
  }), f(document, "keydown", h, !0));
1568
1574
  }), _ = q((e, a) => {
1569
- let s = d.current, c = s && i.get(s.key), l = t[Ht(n.current, e, a)];
1575
+ let s = d.current, c = s && i.get(s.key), l = t[Ut(n.current, e, a)];
1570
1576
  s && c && l && !o?.(l) && u({
1571
1577
  ...s,
1572
1578
  result: xe(r, c, s.edge, l)
@@ -1600,15 +1606,15 @@ function fn(e) {
1600
1606
  };
1601
1607
  }
1602
1608
  // src/components/month-view/MonthView.tsx
1603
- var pn = [];
1604
- function mn(e) {
1609
+ var mn = [];
1610
+ function hn(e) {
1605
1611
  let { className: t, style: n, ...r } = e, { viewValue: i, eventMap: a, startWeek: o, disabled: s, getIsDayDisabled: l, onEventChange: d } = J(), f = K();
1606
- mt();
1612
+ ht();
1607
1613
  let p = u(null), m = c(() => L(f, i, o), [
1608
1614
  f,
1609
1615
  o,
1610
1616
  i
1611
- ]), h = c(() => Vt(m), [m]), g = c(() => de(f, o), [f, o]), _ = fn({
1617
+ ]), h = c(() => Ht(m), [m]), g = c(() => de(f, o), [f, o]), _ = pn({
1612
1618
  days: m,
1613
1619
  viewportRef: p,
1614
1620
  dateUtils: f,
@@ -1616,7 +1622,7 @@ function mn(e) {
1616
1622
  disabled: s,
1617
1623
  getIsDayDisabled: l,
1618
1624
  onEventChange: d
1619
- }), v = dn(p, 3), y = c(() => h.map((e) => x(a, f, e, v)), [
1625
+ }), v = fn(p, 3), y = c(() => h.map((e) => x(a, f, e, v)), [
1620
1626
  f,
1621
1627
  a,
1622
1628
  v,
@@ -1629,12 +1635,12 @@ function mn(e) {
1629
1635
  _.eventMap,
1630
1636
  h
1631
1637
  ]), S = c(() => ({ viewportRef: p }), []);
1632
- return /* @__PURE__ */ G(Nt.Provider, {
1638
+ return /* @__PURE__ */ G(Pt.Provider, {
1633
1639
  value: S,
1634
1640
  children: [/* @__PURE__ */ G("div", {
1635
1641
  ...r,
1636
1642
  className: D(t, Z.root, { [Z.root_isResizing]: _.resizingKey !== void 0 }),
1637
- style: Bt({ "--ww-month-lanes": v }, n),
1643
+ style: Vt({ "--ww-month-lanes": v }, n),
1638
1644
  children: [/* @__PURE__ */ W("div", {
1639
1645
  className: Z.root__head,
1640
1646
  children: g.map((e) => /* @__PURE__ */ W("div", {
@@ -1646,29 +1652,29 @@ function mn(e) {
1646
1652
  children: /* @__PURE__ */ W("div", {
1647
1653
  ref: p,
1648
1654
  className: Z.root__viewport,
1649
- children: h.map((e, t) => /* @__PURE__ */ W(un, {
1655
+ children: h.map((e, t) => /* @__PURE__ */ W(dn, {
1650
1656
  days: e,
1651
1657
  firstDayIndex: t * 7,
1652
1658
  layout: b[t],
1653
- sourceBars: _.resizingKey === void 0 ? pn : y[t].bars.filter((e) => e.key === _.resizingKey),
1659
+ sourceBars: _.resizingKey === void 0 ? mn : y[t].bars.filter((e) => e.key === _.resizingKey),
1654
1660
  lanes: v,
1655
1661
  resizingKey: _.resizingKey,
1656
1662
  resize: _.actions
1657
1663
  }, f.toMillis(e[0])))
1658
1664
  })
1659
1665
  })]
1660
- }), /* @__PURE__ */ W(zt, {
1666
+ }), /* @__PURE__ */ W(Bt, {
1661
1667
  className: Z.root__dragOverlay,
1662
1668
  showPreview: !1
1663
1669
  })]
1664
1670
  });
1665
1671
  }
1666
1672
  // src/hooks/useEventResize.ts
1667
- var hn = 1440;
1668
- function gn(e) {
1673
+ var gn = 1440;
1674
+ function _n(e) {
1669
1675
  let { days: t, viewportRef: r, dateUtils: a, bounds: o, timeStep: s, preventOutBoundsChanges: l } = e, [f, p] = d(null), m = u(null), h = u(e);
1670
1676
  h.current = e;
1671
- let g = o.hideMinMaxTime ? o.hourMin * 60 : 0, _ = o.hideMinMaxTime ? (o.hourMax - o.hourMin) * 60 : hn, v = n((e, n) => {
1677
+ let g = o.hideMinMaxTime ? o.hourMin * 60 : 0, _ = o.hideMinMaxTime ? (o.hourMax - o.hourMin) * 60 : gn, v = n((e, n) => {
1672
1678
  let i = m.current, c = r.current;
1673
1679
  if (!i || !c) return;
1674
1680
  i.x = e, i.y = n;
@@ -1733,9 +1739,9 @@ function gn(e) {
1733
1739
  if (m.current = null, p(null), !e) return;
1734
1740
  let [n, r] = e.range;
1735
1741
  if (n === e.original[0] && r === e.original[1]) return;
1736
- let i = Math.floor(n / hn);
1737
- h.current.onEventChange(e.key, M(a, t[0], i * hn), {
1738
- from: n - i * hn,
1742
+ let i = Math.floor(n / gn);
1743
+ h.current.onEventChange(e.key, M(a, t[0], i * gn), {
1744
+ from: n - i * gn,
1739
1745
  duration: r - n
1740
1746
  });
1741
1747
  }
@@ -1756,48 +1762,54 @@ function gn(e) {
1756
1762
  state: f,
1757
1763
  actions: y,
1758
1764
  previewOf: (e) => {
1759
- let n = Math.floor(e[0] / hn);
1765
+ let n = Math.floor(e[0] / gn);
1760
1766
  return {
1761
- date: M(a, t[0], n * hn),
1762
- top: e[0] - n * hn - g,
1767
+ date: M(a, t[0], n * gn),
1768
+ top: e[0] - n * gn - g,
1763
1769
  duration: e[1] - e[0]
1764
1770
  };
1765
1771
  }
1766
1772
  };
1767
1773
  }
1768
1774
  // src/contexts/DayWeekViewContext.ts
1769
- var _n = e(void 0);
1770
- U && (_n.displayName = "DayWeekViewContext");
1771
- function vn() {
1772
- let e = r(_n);
1775
+ var vn = e(void 0);
1776
+ U && (vn.displayName = "DayWeekViewContext");
1777
+ function yn() {
1778
+ let e = r(vn);
1773
1779
  if (!e) throw Error("DayWeekViewContext is required");
1774
1780
  return e;
1775
1781
  }
1776
1782
  // src/hooks/useTimeOffset.ts
1777
- function yn(e = !0, t = 6e4) {
1778
- let { hideMinMaxTime: n, hourMin: r, hourMax: i } = J(), a = K(), o = () => B(a, {
1783
+ function bn(e = !0, t = 6e4) {
1784
+ let { hideMinMaxTime: n, hourMin: r, hourMax: i } = J(), a = K(), [o, s] = d(null);
1785
+ return pt(() => s(Date.now()), t, e), c(() => o === null ? [0, !0] : B(a, {
1779
1786
  hourMin: r,
1780
1787
  hourMax: i,
1781
1788
  hideMinMaxTime: n
1782
- }), [s, c] = d([0, !0]);
1783
- return pt(() => c(o()), t, e), s;
1784
- }
1785
- var bn = {
1786
- root: "_root_6z2c5_1",
1787
- root_timeLimit: "_root_timeLimit_6z2c5_8",
1788
- root_isToday: "_root_isToday_6z2c5_8",
1789
- root_isPast: "_root_isPast_6z2c5_18",
1790
- root__container: "_root__container_6z2c5_36",
1791
- root__spotlight: "_root__spotlight_6z2c5_57",
1792
- root__timeLine: "_root__timeLine_6z2c5_67",
1793
- root_offLimits: "_root_offLimits_6z2c5_119"
1789
+ }), [
1790
+ o,
1791
+ a,
1792
+ r,
1793
+ i,
1794
+ n
1795
+ ]);
1796
+ }
1797
+ var xn = {
1798
+ root: "_root_1l2ji_1",
1799
+ root_timeLimit: "_root_timeLimit_1l2ji_8",
1800
+ root_isToday: "_root_isToday_1l2ji_8",
1801
+ root_isPast: "_root_isPast_1l2ji_18",
1802
+ root__container: "_root__container_1l2ji_36",
1803
+ root__spotlight: "_root__spotlight_1l2ji_57",
1804
+ root__timeLine: "_root__timeLine_1l2ji_67",
1805
+ root_offLimits: "_root_offLimits_1l2ji_121"
1794
1806
  };
1795
1807
  // src/components/day-week-drawer/DayWeekDrawer.tsx
1796
- function xn(e) {
1797
- let { ref: t, targetDate: n, children: r, ...a } = e, { onEventChange: o, onEventCreate: s, getIsDayDisabled: l, pointerPreviewRenderer: d, eventMap: f, ...p } = J(), { viewportRef: m, getTimeFrame: h, pxPerMinute: g } = vn(), { hideMinMaxTime: _, preventOutBoundsChanges: v, timeStep: y, hourMin: b, hourMax: x, disabled: S } = p, w = K(), { isBefore: T, isToday: E } = w, O = y * g, k = (e) => Sn(e, g, y), ee = (e) => h(e).map((e) => e * g), j = u(null), M = u(null), { register: N, getTransform: P } = Ne(({ registerDropTarget: e, getTransform: t }) => ({
1808
+ function Sn(e) {
1809
+ let { ref: t, targetDate: n, children: r, ...a } = e, { onEventChange: o, onEventCreate: s, getIsDayDisabled: l, pointerPreviewRenderer: d, eventMap: f, ...p } = J(), { viewportRef: m, getTimeFrame: h, pxPerMinute: g } = yn(), { hideMinMaxTime: _, preventOutBoundsChanges: v, timeStep: y, hourMin: b, hourMax: x, disabled: S } = p, w = K(), { isBefore: T, isToday: E } = w, O = y * g, k = (e) => Cn(e, g, y), ee = (e) => h(e).map((e) => e * g), j = u(null), M = u(null), { register: N, getTransform: P } = Ne(({ registerDropTarget: e, getTransform: t }) => ({
1798
1810
  register: e,
1799
1811
  getTransform: t
1800
- })), F = mt(), I = c(() => {
1812
+ })), F = ht(), I = c(() => {
1801
1813
  let e = E(n);
1802
1814
  return {
1803
1815
  isToday: e,
@@ -1808,7 +1820,7 @@ function xn(e) {
1808
1820
  E,
1809
1821
  n,
1810
1822
  F
1811
- ]), [{ isActive: L, transform: R }, z, { scrollAdjustmentActiveNodeRect: B }] = an({
1823
+ ]), [{ isActive: L, transform: R }, z, { scrollAdjustmentActiveNodeRect: B }] = on({
1812
1824
  activeNode: j.current,
1813
1825
  containerNode: j.current?.parentElement,
1814
1826
  modifiers: [
@@ -1827,7 +1839,7 @@ function xn(e) {
1827
1839
  C,
1828
1840
  oe(O)
1829
1841
  ]
1830
- }), [te, V] = yn(I.isToday);
1842
+ }), [te, V] = bn(I.isToday);
1831
1843
  i(() => {
1832
1844
  let e = j.current;
1833
1845
  if (e) return N(e, {
@@ -1836,7 +1848,7 @@ function xn(e) {
1836
1848
  let [t] = await Promise.all(e.items.filter((e) => e.kind === "text" && e.types.has("event") && "getText" in e).map(async (e) => {
1837
1849
  let t = await e.getText("event");
1838
1850
  return JSON.parse(t);
1839
- })), r = P(), i = Sn(r.top, g, y), a = Sn(r.height, g, y), s = _ ? b * 60 : 0, c = f.get(t.key), l = c ? ke(w, c.date, c.date) : 0;
1851
+ })), r = P(), i = Cn(r.top, g, y), a = Cn(r.height, g, y), s = _ ? b * 60 : 0, c = f.get(t.key), l = c ? ke(w, c.date, c.date) : 0;
1840
1852
  if (c && l + c.duration > 1440) {
1841
1853
  if (v && (b > 0 || x < 24)) {
1842
1854
  z.stop({
@@ -1948,35 +1960,35 @@ function xn(e) {
1948
1960
  ...a,
1949
1961
  ...ne,
1950
1962
  ref: H,
1951
- className: D(a.className, bn.root, {
1952
- [bn.root_timeLimit]: v,
1953
- [bn.root_isToday]: I.isToday,
1954
- [bn.root_isPast]: I.isPast,
1955
- [bn.root_offLimits]: V
1963
+ className: D(a.className, xn.root, {
1964
+ [xn.root_timeLimit]: v,
1965
+ [xn.root_isToday]: I.isToday,
1966
+ [xn.root_isPast]: I.isPast,
1967
+ [xn.root_offLimits]: V
1956
1968
  }),
1957
1969
  style: {
1958
1970
  ...a.style,
1959
- "--offset": te
1971
+ "--offset": te * g
1960
1972
  },
1961
1973
  children: [
1962
- I.isToday && !V && /* @__PURE__ */ W(Tt, {
1974
+ I.isToday && !V && /* @__PURE__ */ W(Et, {
1963
1975
  container: m.current,
1964
1976
  children: /* @__PURE__ */ W("span", {
1965
1977
  tabIndex: -1,
1966
- className: bn.root__timeLine,
1978
+ className: xn.root__timeLine,
1967
1979
  "data-now": re,
1968
- style: { "--offset": te }
1980
+ style: { "--offset": te * g }
1969
1981
  })
1970
1982
  }),
1971
1983
  /* @__PURE__ */ W("div", {
1972
1984
  ref: M,
1973
- className: bn.root__container,
1985
+ className: xn.root__container,
1974
1986
  children: r
1975
1987
  }),
1976
1988
  L && /* @__PURE__ */ G(ze, { children: [/* @__PURE__ */ W("div", {
1977
- className: bn.root__spotlight,
1989
+ className: xn.root__spotlight,
1978
1990
  style: R ? { ...R } : void 0
1979
- }), /* @__PURE__ */ W(It, {
1991
+ }), /* @__PURE__ */ W(Lt, {
1980
1992
  coordinates: {
1981
1993
  x: R.x,
1982
1994
  y: R.y
@@ -1986,11 +1998,11 @@ function xn(e) {
1986
1998
  ]
1987
1999
  });
1988
2000
  }
1989
- function Sn(e, t, n) {
2001
+ function Cn(e, t, n) {
1990
2002
  return Math.round(e / t / n) * n;
1991
2003
  }
1992
2004
  // src/hooks/useAbsEventRect.ts
1993
- function Cn(e, t) {
2005
+ function wn(e, t) {
1994
2006
  let [n, r] = d(null);
1995
2007
  return Ke(() => {
1996
2008
  let n = e.current, i = e.current?.parentElement;
@@ -2006,8 +2018,8 @@ function Cn(e, t) {
2006
2018
  }, [e, ...Object.values(t)]), n;
2007
2019
  }
2008
2020
  // src/hooks/useCanResizeEvent.ts
2009
- function wn(e, t) {
2010
- let [n, r] = d(!0), { preventOutBoundsChanges: i } = J(), { isBefore: a, isToday: o } = K(), { getTimeFrame: s } = vn();
2021
+ function Tn(e, t) {
2022
+ let [n, r] = d(!0), { preventOutBoundsChanges: i } = J(), { isBefore: a, isToday: o } = K(), { getTimeFrame: s } = yn();
2011
2023
  return Ke(() => {
2012
2024
  if (t && i) {
2013
2025
  if (a(e) && !o(e)) r(!1);
@@ -2038,8 +2050,8 @@ var Q = {
2038
2050
  root_isResizeSource: "_root_isResizeSource_1qnpq_108"
2039
2051
  };
2040
2052
  // src/components/day-week-event/DayWeekEvent.tsx
2041
- function Tn(e) {
2042
- let { ref: t, eventData: n, children: r, ...a } = e, { eventMap: o, ...s } = J(), c = K(), { timeStep: l, preventOutBoundsChanges: d, disabled: f } = s, p = u(null), m = u(null), h = u(null), { viewportRef: g, getTimeFrame: _, pxPerMinute: v, resize: y, resizing: b } = vn(), x = l * v, S = Cn(p, n.rect), C = wn(o.get(n.key)?.date ?? n.date, S), { attributes: w, isDragging: T, overElement: E, overData: O, register: k, setOverlayTransform: ee } = Ne(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
2053
+ function En(e) {
2054
+ let { ref: t, eventData: n, children: r, ...a } = e, { eventMap: o, ...s } = J(), c = K(), { timeStep: l, preventOutBoundsChanges: d, disabled: f } = s, p = u(null), m = u(null), h = u(null), { viewportRef: g, getTimeFrame: _, pxPerMinute: v, resize: y, resizing: b } = yn(), x = l * v, S = wn(p, n.rect), C = Tn(o.get(n.key)?.date ?? n.date, S), { attributes: w, isDragging: T, overElement: E, overData: O, register: k, setOverlayTransform: ee } = Ne(({ registerDragSource: e, draggable: t, droppable: n, setTransform: r, isActive: i }) => {
2043
2055
  let a = i(p.current), [o, s] = a ? [...n.dropTargets].pop() ?? [null, null] : [null, null];
2044
2056
  return {
2045
2057
  attributes: t.attributes,
@@ -2049,7 +2061,7 @@ function Tn(e) {
2049
2061
  register: e,
2050
2062
  setOverlayTransform: r
2051
2063
  };
2052
- }), A = Yt(T ? E : null), [{ isActive: j, transform: M, context: N }, P] = an({
2064
+ }), A = Xt(T ? E : null), [{ isActive: j, transform: M, context: N }, P] = on({
2053
2065
  autoScrollEnabled: !T,
2054
2066
  activeNode: (e) => e === "overlay" ? p.current : e === "top" ? m.current : h.current,
2055
2067
  containerNode: (e) => e === "overlay" ? g.current : p.current?.parentElement?.parentElement ?? null,
@@ -2065,7 +2077,7 @@ function Tn(e) {
2065
2077
  let [n, r] = _(O.date).map((e) => Math.ceil(e / l) * x);
2066
2078
  return e.top < n && (e.top = n), e.top + e.height > r && (e.top = r - e.height), e;
2067
2079
  },
2068
- En(x)
2080
+ Dn(x)
2069
2081
  ]
2070
2082
  }), F = ve(() => y.end(), (e) => {
2071
2083
  P.stop({
@@ -2166,14 +2178,14 @@ function Tn(e) {
2166
2178
  ]
2167
2179
  }) });
2168
2180
  }
2169
- function En(e) {
2181
+ function Dn(e) {
2170
2182
  return (t) => {
2171
2183
  let n = [oe(e)];
2172
2184
  return t.context === "overlay" && n.push(S), y(n, t);
2173
2185
  };
2174
2186
  }
2175
2187
  // src/components/day-week-event/DayWeekEventPreview.tsx
2176
- function Dn({ part: e, timelineMinutes: t, children: n }) {
2188
+ function On({ part: e, timelineMinutes: t, children: n }) {
2177
2189
  let r = (e) => `${e / t * 100}%`;
2178
2190
  return /* @__PURE__ */ W("div", {
2179
2191
  "aria-hidden": "true",
@@ -2193,29 +2205,29 @@ function Dn({ part: e, timelineMinutes: t, children: n }) {
2193
2205
  });
2194
2206
  }
2195
2207
  var $ = {
2196
- root: "_root_1140w_1",
2197
- root_scrollable: "_root_scrollable_1140w_10",
2198
- root__body: "_root__body_1140w_10",
2199
- root__head: "_root__head_1140w_14",
2200
- root__main: "_root__main_1140w_29",
2201
- root__viewport: "_root__viewport_1140w_43",
2202
- root__column: "_root__column_1140w_51",
2203
- root__headerCell: "_root__headerCell_1140w_76",
2204
- root__headerCellDay: "_root__headerCellDay_1140w_103",
2205
- root__headerCellLabel: "_root__headerCellLabel_1140w_110",
2206
- root__headerCellName: "_root__headerCellName_1140w_117",
2207
- root__headerCellToday: "_root__headerCellToday_1140w_124",
2208
- root__row: "_root__row_1140w_139",
2209
- root__timeStep: "_root__timeStep_1140w_161",
2210
- root__timeStep_overTime: "_root__timeStep_overTime_1140w_173",
2211
- root__rowHeadTime: "_root__rowHeadTime_1140w_177",
2212
- root__hiddenEventsLayer: "_root__hiddenEventsLayer_1140w_191",
2213
- root__hiddenEventsColumn: "_root__hiddenEventsColumn_1140w_204",
2214
- root__hiddenEvents: "_root__hiddenEvents_1140w_191",
2215
- root__hiddenEventsIcon: "_root__hiddenEventsIcon_1140w_251"
2208
+ root: "_root_1cr8n_1",
2209
+ root_scrollable: "_root_scrollable_1cr8n_10",
2210
+ root__body: "_root__body_1cr8n_10",
2211
+ root__head: "_root__head_1cr8n_14",
2212
+ root__main: "_root__main_1cr8n_29",
2213
+ root__viewport: "_root__viewport_1cr8n_43",
2214
+ root__column: "_root__column_1cr8n_51",
2215
+ root__headerCell: "_root__headerCell_1cr8n_76",
2216
+ root__headerCellDay: "_root__headerCellDay_1cr8n_103",
2217
+ root__headerCellLabel: "_root__headerCellLabel_1cr8n_110",
2218
+ root__headerCellName: "_root__headerCellName_1cr8n_117",
2219
+ root__headerCellToday: "_root__headerCellToday_1cr8n_124",
2220
+ root__row: "_root__row_1cr8n_139",
2221
+ root__timeStep: "_root__timeStep_1cr8n_161",
2222
+ root__timeStep_overTime: "_root__timeStep_overTime_1cr8n_173",
2223
+ root__rowHeadTime: "_root__rowHeadTime_1cr8n_177",
2224
+ root__hiddenEventsLayer: "_root__hiddenEventsLayer_1cr8n_192",
2225
+ root__hiddenEventsColumn: "_root__hiddenEventsColumn_1cr8n_205",
2226
+ root__hiddenEvents: "_root__hiddenEvents_1cr8n_192",
2227
+ root__hiddenEventsIcon: "_root__hiddenEventsIcon_1cr8n_252"
2216
2228
  };
2217
2229
  // src/components/day-week-view/HiddenEvents.tsx
2218
- function On({ scrollerRef: e, columns: t, rowHeight: n }) {
2230
+ function kn({ scrollerRef: e, columns: t, rowHeight: n }) {
2219
2231
  let { hourMin: r, hideMinMaxTime: a, size: o } = J(), s = K(), l = Ge(), { addGlobalListener: u, removeGlobalListener: f } = it(), [p, m] = d(null), h = n / 60, g = q(() => {
2220
2232
  let t = e.current;
2221
2233
  if (!t) return;
@@ -2263,7 +2275,7 @@ function On({ scrollerRef: e, columns: t, rowHeight: n }) {
2263
2275
  "data-direction": t,
2264
2276
  "aria-label": t === "above" ? l.earlier(e.length) : l.later(e.length),
2265
2277
  onClick: () => y(n),
2266
- children: [/* @__PURE__ */ W(yt, {
2278
+ children: [/* @__PURE__ */ W(bt, {
2267
2279
  "aria-hidden": "true",
2268
2280
  className: $.root__hiddenEventsIcon
2269
2281
  }), i]
@@ -2278,7 +2290,7 @@ function On({ scrollerRef: e, columns: t, rowHeight: n }) {
2278
2290
  });
2279
2291
  }
2280
2292
  // src/components/day-week-view/useTimeColumnWidth.ts
2281
- function kn(e, t, n) {
2293
+ function An(e, t, n) {
2282
2294
  let [r, i] = d();
2283
2295
  return Ke(() => {
2284
2296
  let t = !1, r = () => {
@@ -2304,13 +2316,13 @@ function kn(e, t, n) {
2304
2316
  ]), r;
2305
2317
  }
2306
2318
  // src/components/day-week-view/DayWeekView.tsx
2307
- var An = {
2319
+ var jn = {
2308
2320
  regular: 64,
2309
2321
  compact: 44,
2310
2322
  narrow: 40
2311
2323
  };
2312
- function jn({ rowHeight: e, ...t }) {
2313
- let { viewValue: r, hourMin: i, hourMax: a, view: o, eventMap: s, preventOutBoundsChanges: l, eventRenderer: d, timeStep: f, scrollable: p, size: h, hideMinMaxTime: g, disabled: _, getIsDayDisabled: v, onEventChange: y, pointerPreviewRenderer: x } = J(), S = K(), C = Ge(), { getMonthDay: w, getWeekDay: E, isToday: O, weekDayShortName: k } = S, ee = mt(), A = e ?? m[h], j = u(null), M = u(null), N = c(() => T(S, f, {
2324
+ function Mn({ rowHeight: e, ...t }) {
2325
+ let { viewValue: r, hourMin: i, hourMax: a, view: o, eventMap: s, preventOutBoundsChanges: l, eventRenderer: d, timeStep: f, scrollable: p, size: h, hideMinMaxTime: g, disabled: _, getIsDayDisabled: v, onEventChange: y, pointerPreviewRenderer: x } = J(), S = K(), C = Ge(), { getMonthDay: w, getWeekDay: E, isToday: O, weekDayShortName: k } = S, ee = ht(), A = e ?? m[h], j = u(null), M = u(null), N = c(() => T(S, f, {
2314
2326
  hourMin: i,
2315
2327
  hourMax: a,
2316
2328
  hideMinMaxTime: g
@@ -2321,7 +2333,7 @@ function jn({ rowHeight: e, ...t }) {
2321
2333
  a,
2322
2334
  g,
2323
2335
  l
2324
- ]), P = kn(j, c(() => N.map(({ time: e }) => e), [N]), An[h]), F = c(() => ue(S, o, r), [
2336
+ ]), P = An(j, c(() => N.map(({ time: e }) => e), [N]), jn[h]), F = c(() => ue(S, o, r), [
2325
2337
  S,
2326
2338
  o,
2327
2339
  r
@@ -2339,7 +2351,7 @@ function jn({ rowHeight: e, ...t }) {
2339
2351
  N.length,
2340
2352
  F,
2341
2353
  I
2342
- ]), R = c(() => L.map(({ events: e }) => e), [L]), { state: z, actions: B, previewOf: te } = gn({
2354
+ ]), R = c(() => L.map(({ events: e }) => e), [L]), { state: z, actions: B, previewOf: te } = _n({
2343
2355
  days: F,
2344
2356
  viewportRef: j,
2345
2357
  dateUtils: S,
@@ -2395,7 +2407,7 @@ function jn({ rowHeight: e, ...t }) {
2395
2407
  A,
2396
2408
  B,
2397
2409
  z
2398
- ]), ve = c(() => ({ viewportRef: j }), [j]), ye = (e, t) => /* @__PURE__ */ W(Tn, {
2410
+ ]), ve = c(() => ({ viewportRef: j }), [j]), ye = (e, t) => /* @__PURE__ */ W(En, {
2399
2411
  "data-idx": t,
2400
2412
  eventData: e,
2401
2413
  children: d.current?.(e.value, o, {
@@ -2403,9 +2415,9 @@ function jn({ rowHeight: e, ...t }) {
2403
2415
  isEnd: e.isEnd
2404
2416
  })
2405
2417
  }, e.key);
2406
- return /* @__PURE__ */ W(_n.Provider, {
2418
+ return /* @__PURE__ */ W(vn.Provider, {
2407
2419
  value: _e,
2408
- children: /* @__PURE__ */ W(Nt.Provider, {
2420
+ children: /* @__PURE__ */ W(Pt.Provider, {
2409
2421
  value: ve,
2410
2422
  children: /* @__PURE__ */ G(ze, { children: [
2411
2423
  /* @__PURE__ */ G("div", {
@@ -2464,10 +2476,10 @@ function jn({ rowHeight: e, ...t }) {
2464
2476
  className: de,
2465
2477
  "data-day-index": t,
2466
2478
  ...e.attributes,
2467
- children: /* @__PURE__ */ G(xn, {
2479
+ children: /* @__PURE__ */ G(Sn, {
2468
2480
  id: `${e.weekDayNumber}`,
2469
2481
  targetDate: e.targetDate,
2470
- children: [e.events.map((e, t) => ye(e, t)), V.filter((e) => e.dayIndex === t).map((e) => /* @__PURE__ */ W(Dn, {
2482
+ children: [e.events.map((e, t) => ye(e, t)), V.filter((e) => e.dayIndex === t).map((e) => /* @__PURE__ */ W(On, {
2471
2483
  part: e,
2472
2484
  timelineMinutes: N.length * 60,
2473
2485
  children: ne === void 0 ? null : d.current?.(ne, o, {
@@ -2478,15 +2490,15 @@ function jn({ rowHeight: e, ...t }) {
2478
2490
  })
2479
2491
  }, e.weekDayNumber))]
2480
2492
  })
2481
- }), p && /* @__PURE__ */ W(On, {
2493
+ }), p && /* @__PURE__ */ W(kn, {
2482
2494
  scrollerRef: M,
2483
2495
  columns: R,
2484
2496
  rowHeight: A
2485
2497
  })]
2486
2498
  })]
2487
2499
  }),
2488
- /* @__PURE__ */ W(zt, { pxPerMinute: A / 60 }),
2489
- z && !z.blocked && /* @__PURE__ */ W(It, {
2500
+ /* @__PURE__ */ W(Bt, { pxPerMinute: A / 60 }),
2501
+ z && !z.blocked && /* @__PURE__ */ W(Lt, {
2490
2502
  coordinates: {
2491
2503
  x: z.x,
2492
2504
  y: z.y
@@ -2500,14 +2512,14 @@ function jn({ rowHeight: e, ...t }) {
2500
2512
  })
2501
2513
  });
2502
2514
  }
2503
- var Mn = {
2515
+ var Nn = {
2504
2516
  root: "_root_1jr3p_2",
2505
2517
  root__head: "_root__head_1jr3p_22",
2506
2518
  root__body: "_root__body_1jr3p_26",
2507
2519
  root__body_readonly: "_root__body_readonly_1jr3p_35"
2508
2520
  };
2509
2521
  // src/Calendar.tsx
2510
- function Nn(e) {
2522
+ function Pn(e) {
2511
2523
  let { ref: t, disabled: n = !1, children: r, hideMinMaxTime: a = !1, timeFrame: o, startWeek: s, timeStep: l = 15, items: d, onEventCreate: f, onEventChange: p, onEventDelete: m, onEventEdit: h, eventTimeFrameResolver: g, eventKeyResolver: _, getIsDayDisabled: v, pointerPreviewFormat: y, scrollable: b = !1, view: x, defaultView: S, viewValue: C, defaultViewValue: T, onChangeView: E, onChangeViewValue: O, ...k } = e, { hourMax: ee, hourMin: A } = {
2512
2524
  hourMin: 0,
2513
2525
  hourMax: 24,
@@ -2515,7 +2527,7 @@ function Nn(e) {
2515
2527
  }, M = Ye({
2516
2528
  eventTimeFrameResolver: g,
2517
2529
  eventKeyResolver: _
2518
- }), N = K(), P = s ?? N.weekStartsOn, I = u(null), L = st(I, t), { viewValue: R, changeViewValue: z, view: B, changeView: te } = _t({
2530
+ }), N = K(), P = s ?? N.weekStartsOn, I = u(null), L = st(I, t), { viewValue: R, changeViewValue: z, view: B, changeView: te } = vt({
2519
2531
  view: x,
2520
2532
  defaultView: S,
2521
2533
  viewValue: C,
@@ -2533,7 +2545,7 @@ function Nn(e) {
2533
2545
  A,
2534
2546
  d,
2535
2547
  M
2536
- ]), { goBackward: re, goForward: ie, goToday: ae } = vt({
2548
+ ]), { goBackward: re, goForward: ie, goToday: ae } = yt({
2537
2549
  changeViewValue: z,
2538
2550
  dateUtils: N,
2539
2551
  startWeek: P,
@@ -2615,26 +2627,26 @@ function Nn(e) {
2615
2627
  ]);
2616
2628
  return /* @__PURE__ */ W("div", {
2617
2629
  ...U,
2618
- className: D(U.className, Mn.root),
2630
+ className: D(U.className, Nn.root),
2619
2631
  "data-ww-size": V === "regular" ? void 0 : V,
2620
- children: /* @__PURE__ */ W(ht.Provider, {
2632
+ children: /* @__PURE__ */ W(gt.Provider, {
2621
2633
  value: pe,
2622
2634
  children: /* @__PURE__ */ W(Me.Provider, {
2623
2635
  value: ne,
2624
- children: /* @__PURE__ */ G(gt.Provider, {
2636
+ children: /* @__PURE__ */ G(_t.Provider, {
2625
2637
  value: I,
2626
2638
  children: [/* @__PURE__ */ W("div", {
2627
- className: Mn.root__head,
2628
- children: /* @__PURE__ */ W(Mt, {})
2639
+ className: Nn.root__head,
2640
+ children: /* @__PURE__ */ W(Nt, {})
2629
2641
  }), /* @__PURE__ */ W("div", {
2630
- className: Mn.root__body,
2631
- children: W(B === "month" ? mn : jn, {})
2642
+ className: Nn.root__body,
2643
+ children: W(B === "month" ? hn : Mn, {})
2632
2644
  })]
2633
2645
  })
2634
2646
  })
2635
2647
  })
2636
2648
  });
2637
2649
  }
2638
- export { Nn as Calendar, Nn as default, Ve as DateLocalizationContext, We as DateLocalizationProvider, Ue as MessagesContext, E as builtInMessages, Ce as resolveMessages, He as useDateUtils, Ge as useMessages };
2650
+ export { Pn as Calendar, Pn as default, Ve as DateLocalizationContext, We as DateLocalizationProvider, Ue as MessagesContext, E as builtInMessages, Ce as resolveMessages, He as useDateUtils, Ge as useMessages };
2639
2651
 
2640
2652
  //# sourceMappingURL=index.js.map