@forcecalendar/interface 1.0.9 → 1.0.11

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.
@@ -1,6 +1,6 @@
1
- var H = Object.defineProperty;
2
- var P = (u, e, t) => e in u ? H(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
3
- var M = (u, e, t) => P(u, typeof e != "symbol" ? e + "" : e, t);
1
+ var B = Object.defineProperty;
2
+ var U = (u, e, t) => e in u ? B(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
3
+ var M = (u, e, t) => U(u, typeof e != "symbol" ? e + "" : e, t);
4
4
  class T extends HTMLElement {
5
5
  constructor() {
6
6
  super(), this.attachShadow({ mode: "open" }), this._listeners = [], this._state = null, this._props = /* @__PURE__ */ new Map(), this._initialized = !1;
@@ -108,7 +108,7 @@ class T extends HTMLElement {
108
108
  this.setProp(e, s), this._initialized && this.render();
109
109
  }
110
110
  }
111
- class U {
111
+ class P {
112
112
  constructor() {
113
113
  this.timezones = {
114
114
  // UTC
@@ -372,7 +372,7 @@ class U {
372
372
  }
373
373
  class S {
374
374
  constructor() {
375
- this.database = new U(), this.offsetCache = /* @__PURE__ */ new Map(), this.dstCache = /* @__PURE__ */ new Map(), this.maxCacheSize = 1e3, this.cacheHits = 0, this.cacheMisses = 0;
375
+ this.database = new P(), this.offsetCache = /* @__PURE__ */ new Map(), this.dstCache = /* @__PURE__ */ new Map(), this.maxCacheSize = 1e3, this.cacheHits = 0, this.cacheMisses = 0;
376
376
  }
377
377
  /**
378
378
  * Convert date from one timezone to another
@@ -643,7 +643,7 @@ class S {
643
643
  }
644
644
  }
645
645
  }
646
- class x {
646
+ class E {
647
647
  /**
648
648
  * Normalize event data
649
649
  * @param {import('../../types.js').EventData} data - Raw event data
@@ -708,25 +708,25 @@ class x {
708
708
  borderColor: l = null,
709
709
  textColor: d = null,
710
710
  recurring: h = !1,
711
- recurrenceRule: y = null,
712
- timeZone: b = null,
713
- endTimeZone: D = null,
714
- status: k = "confirmed",
715
- visibility: E = "public",
711
+ recurrenceRule: p = null,
712
+ timeZone: v = null,
713
+ endTimeZone: w = null,
714
+ status: x = "confirmed",
715
+ visibility: k = "public",
716
716
  organizer: A = null,
717
717
  attendees: $ = [],
718
718
  reminders: z = [],
719
719
  category: _,
720
720
  // Support singular category (no default)
721
- categories: F,
721
+ categories: L,
722
722
  // Support plural categories (no default)
723
- attachments: L = [],
723
+ attachments: F = [],
724
724
  conferenceData: O = null,
725
725
  metadata: R = {},
726
- ...B
726
+ ...H
727
727
  // Capture any extra properties
728
728
  }) {
729
- const g = x.normalize({
729
+ const g = E.normalize({
730
730
  id: e,
731
731
  title: t,
732
732
  start: s,
@@ -739,25 +739,25 @@ class x {
739
739
  borderColor: l,
740
740
  textColor: d,
741
741
  recurring: h,
742
- recurrenceRule: y,
743
- timeZone: b,
744
- endTimeZone: D,
745
- status: k,
746
- visibility: E,
742
+ recurrenceRule: p,
743
+ timeZone: v,
744
+ endTimeZone: w,
745
+ status: x,
746
+ visibility: k,
747
747
  organizer: A,
748
748
  attendees: $,
749
749
  reminders: z,
750
750
  category: _,
751
751
  // Pass category to normalize
752
- categories: F,
752
+ categories: L,
753
753
  // Pass categories to normalize
754
- attachments: L,
754
+ attachments: F,
755
755
  conferenceData: O,
756
756
  metadata: R,
757
- ...B
757
+ ...H
758
758
  // Pass any extra properties
759
759
  });
760
- x.validate(g), this.id = g.id, this.title = g.title, this._timezoneManager = new S(), this.timeZone = g.timeZone || this._timezoneManager.getSystemTimezone(), this.endTimeZone = g.endTimeZone || this.timeZone, this.start = g.start, this.end = g.end, this.startUTC = this._timezoneManager.toUTC(this.start, this.timeZone), this.endUTC = this._timezoneManager.toUTC(this.end, this.endTimeZone), this.allDay = g.allDay, this.description = g.description, this.location = g.location, this.color = g.color, this.backgroundColor = g.backgroundColor, this.borderColor = g.borderColor, this.textColor = g.textColor, this.recurring = g.recurring, this.recurrenceRule = g.recurrenceRule, this._originalTimeZone = g.timeZone || null, this.status = g.status, this.visibility = g.visibility, this.organizer = g.organizer, this.attendees = [...g.attendees], this.reminders = [...g.reminders], this.categories = g.categories ? [...g.categories] : [], this.attachments = [...g.attachments], this.conferenceData = g.conferenceData, this.metadata = { ...g.metadata }, this._cache = {}, this._validateAttendees(), this._validateReminders();
760
+ E.validate(g), this.id = g.id, this.title = g.title, this._timezoneManager = new S(), this.timeZone = g.timeZone || this._timezoneManager.getSystemTimezone(), this.endTimeZone = g.endTimeZone || this.timeZone, this.start = g.start, this.end = g.end, this.startUTC = this._timezoneManager.toUTC(this.start, this.timeZone), this.endUTC = this._timezoneManager.toUTC(this.end, this.endTimeZone), this.allDay = g.allDay, this.description = g.description, this.location = g.location, this.color = g.color, this.backgroundColor = g.backgroundColor, this.borderColor = g.borderColor, this.textColor = g.textColor, this.recurring = g.recurring, this.recurrenceRule = g.recurrenceRule, this._originalTimeZone = g.timeZone || null, this.status = g.status, this.visibility = g.visibility, this.organizer = g.organizer, this.attendees = [...g.attendees], this.reminders = [...g.reminders], this.categories = g.categories ? [...g.categories] : [], this.attachments = [...g.attachments], this.conferenceData = g.conferenceData, this.metadata = { ...g.metadata }, this._cache = {}, this._validateAttendees(), this._validateReminders();
761
761
  }
762
762
  /**
763
763
  * Get event duration in milliseconds
@@ -847,7 +847,7 @@ class x {
847
847
  * @throws {Error} If otherEvent is not an Event instance or doesn't have start/end
848
848
  */
849
849
  overlaps(e) {
850
- if (e instanceof x)
850
+ if (e instanceof E)
851
851
  return !(this.end <= e.start || this.start >= e.end);
852
852
  if (e && e.start && e.end)
853
853
  return !(this.end <= e.start || this.start >= e.end);
@@ -867,7 +867,7 @@ class x {
867
867
  * @returns {Event} New Event instance with updated properties
868
868
  */
869
869
  clone(e = {}) {
870
- return new x({
870
+ return new E({
871
871
  id: this.id,
872
872
  title: this.title,
873
873
  start: new Date(this.start),
@@ -931,7 +931,7 @@ class x {
931
931
  * @returns {Event} New Event instance
932
932
  */
933
933
  static fromObject(e) {
934
- return new x(e);
934
+ return new E(e);
935
935
  }
936
936
  /**
937
937
  * Compare events for equality
@@ -939,7 +939,7 @@ class x {
939
939
  * @returns {boolean} True if events are equal
940
940
  */
941
941
  equals(e) {
942
- return e instanceof x ? this.id === e.id && this.title === e.title && this.start.getTime() === e.start.getTime() && this.end.getTime() === e.end.getTime() && this.allDay === e.allDay && this.description === e.description && this.location === e.location && this.recurring === e.recurring && this.recurrenceRule === e.recurrenceRule && this.status === e.status : !1;
942
+ return e instanceof E ? this.id === e.id && this.title === e.title && this.start.getTime() === e.start.getTime() && this.end.getTime() === e.end.getTime() && this.allDay === e.allDay && this.description === e.description && this.location === e.location && this.recurring === e.recurring && this.recurrenceRule === e.recurrenceRule && this.status === e.status : !1;
943
943
  }
944
944
  // ============ Attendee Management Methods ============
945
945
  /**
@@ -1202,7 +1202,7 @@ class x {
1202
1202
  return this.conferenceData !== null;
1203
1203
  }
1204
1204
  }
1205
- let f = class w {
1205
+ let f = class D {
1206
1206
  /**
1207
1207
  * Get the start of a day
1208
1208
  * @param {Date} date - The date
@@ -1238,7 +1238,7 @@ let f = class w {
1238
1238
  * @returns {Date}
1239
1239
  */
1240
1240
  static endOfWeek(e, t = 0) {
1241
- const s = w.startOfWeek(e, t);
1241
+ const s = D.startOfWeek(e, t);
1242
1242
  return s.setTime(s.getTime() + 6 * 24 * 60 * 60 * 1e3), s.setHours(23, 59, 59, 999), s;
1243
1243
  }
1244
1244
  /**
@@ -1290,7 +1290,7 @@ let f = class w {
1290
1290
  * @returns {Date}
1291
1291
  */
1292
1292
  static addWeeks(e, t) {
1293
- return w.addDays(e, t * 7);
1293
+ return D.addDays(e, t * 7);
1294
1294
  }
1295
1295
  /**
1296
1296
  * Add months to a date
@@ -1372,7 +1372,7 @@ let f = class w {
1372
1372
  * @returns {boolean}
1373
1373
  */
1374
1374
  static isSameWeek(e, t, s = 0) {
1375
- const i = w.startOfWeek(e, s), a = w.startOfWeek(t, s);
1375
+ const i = D.startOfWeek(e, s), a = D.startOfWeek(t, s);
1376
1376
  return i.toDateString() === a.toDateString();
1377
1377
  }
1378
1378
  /**
@@ -1410,7 +1410,7 @@ let f = class w {
1410
1410
  * @returns {number}
1411
1411
  */
1412
1412
  static differenceInWeeks(e, t) {
1413
- return Math.floor(w.differenceInDays(e, t) / 7);
1413
+ return Math.floor(D.differenceInDays(e, t) / 7);
1414
1414
  }
1415
1415
  /**
1416
1416
  * Get the difference in months between two dates
@@ -1466,7 +1466,7 @@ let f = class w {
1466
1466
  * @returns {string}
1467
1467
  */
1468
1468
  static getMonthName(e, t = "en-US", s = "long") {
1469
- return w.format(e, t, { month: s });
1469
+ return D.format(e, t, { month: s });
1470
1470
  }
1471
1471
  /**
1472
1472
  * Get day name
@@ -1476,7 +1476,7 @@ let f = class w {
1476
1476
  * @returns {string}
1477
1477
  */
1478
1478
  static getDayName(e, t = "en-US", s = "long") {
1479
- return w.format(e, t, { weekday: s });
1479
+ return D.format(e, t, { weekday: s });
1480
1480
  }
1481
1481
  /**
1482
1482
  * Format time
@@ -1486,7 +1486,7 @@ let f = class w {
1486
1486
  * @returns {string}
1487
1487
  */
1488
1488
  static formatTime(e, t = "en-US", s = !1) {
1489
- return w.format(e, t, {
1489
+ return D.format(e, t, {
1490
1490
  hour: "numeric",
1491
1491
  minute: "2-digit",
1492
1492
  hour12: !s
@@ -1508,7 +1508,7 @@ let f = class w {
1508
1508
  * @returns {Date}
1509
1509
  */
1510
1510
  static setTime(e, t) {
1511
- const s = new Date(e), { hours: i, minutes: a } = w.parseTime(t);
1511
+ const s = new Date(e), { hours: i, minutes: a } = D.parseTime(t);
1512
1512
  return s.setHours(i, a, 0, 0), s;
1513
1513
  }
1514
1514
  /**
@@ -1587,7 +1587,7 @@ let f = class w {
1587
1587
  * @returns {boolean}
1588
1588
  */
1589
1589
  static isDST(e, t) {
1590
- const s = new Date(e.getFullYear(), 0, 1), i = new Date(e.getFullYear(), 6, 1), a = w.getTimezoneOffset(s, t), n = w.getTimezoneOffset(i, t), r = w.getTimezoneOffset(e, t);
1590
+ const s = new Date(e.getFullYear(), 0, 1), i = new Date(e.getFullYear(), 6, 1), a = D.getTimezoneOffset(s, t), n = D.getTimezoneOffset(i, t), r = D.getTimezoneOffset(e, t);
1591
1591
  return Math.max(a, n) === r;
1592
1592
  }
1593
1593
  /**
@@ -1598,9 +1598,9 @@ let f = class w {
1598
1598
  * @returns {Date}
1599
1599
  */
1600
1600
  static addHoursWithDST(e, t, s) {
1601
- const i = new Date(e), a = w.getTimezoneOffset(e, s);
1601
+ const i = new Date(e), a = D.getTimezoneOffset(e, s);
1602
1602
  i.setTime(i.getTime() + t * 60 * 60 * 1e3);
1603
- const n = w.getTimezoneOffset(i, s);
1603
+ const n = D.getTimezoneOffset(i, s);
1604
1604
  if (a !== n) {
1605
1605
  const r = (n - a) * 6e4;
1606
1606
  i.setTime(i.getTime() + r);
@@ -1619,11 +1619,11 @@ let f = class w {
1619
1619
  * @returns {Date}
1620
1620
  */
1621
1621
  static createInTimeZone(e, t, s, i = 0, a = 0, n = 0, r) {
1622
- const o = `${e}-${String(t + 1).padStart(2, "0")}-${String(s).padStart(2, "0")}`, c = `${String(i).padStart(2, "0")}:${String(a).padStart(2, "0")}:${String(n).padStart(2, "0")}`, l = /* @__PURE__ */ new Date(`${o}T${c}`), d = w.getTimezoneOffset(l, r), h = l.getTime() + d * 6e4;
1622
+ const o = `${e}-${String(t + 1).padStart(2, "0")}-${String(s).padStart(2, "0")}`, c = `${String(i).padStart(2, "0")}:${String(a).padStart(2, "0")}:${String(n).padStart(2, "0")}`, l = /* @__PURE__ */ new Date(`${o}T${c}`), d = D.getTimezoneOffset(l, r), h = l.getTime() + d * 6e4;
1623
1623
  return new Date(h);
1624
1624
  }
1625
1625
  };
1626
- class Y {
1626
+ class V {
1627
1627
  /**
1628
1628
  * Parse an RRULE string into a structured rule object
1629
1629
  * @param {string|Object} rrule - RRULE string or rule object
@@ -1859,7 +1859,7 @@ class Y {
1859
1859
  return e.count ? a += `, ${e.count} time${e.count > 1 ? "s" : ""}` : e.until && (a += `, until ${e.until.toLocaleDateString()}`), a;
1860
1860
  }
1861
1861
  }
1862
- class N {
1862
+ class Y {
1863
1863
  /**
1864
1864
  * Expand a recurring event into individual occurrences
1865
1865
  * @param {import('./Event.js').Event} event - The recurring event
@@ -1875,17 +1875,17 @@ class N {
1875
1875
  const n = this.parseRule(e.recurrenceRule), r = [], o = e.end - e.start, c = a || e.timeZone || "UTC", l = new S();
1876
1876
  let d = new Date(e.start), h = 0;
1877
1877
  n.until && n.until < s && (s = n.until);
1878
- let y = l.getTimezoneOffset(d, c);
1878
+ let p = l.getTimezoneOffset(d, c);
1879
1879
  for (; d <= s && h < i; ) {
1880
1880
  if (d >= t) {
1881
- const b = new Date(d), D = new Date(d.getTime() + o), k = l.getTimezoneOffset(b, c);
1882
- if (k !== y) {
1883
- const E = y - k;
1884
- b.setMinutes(b.getMinutes() + E), D.setMinutes(D.getMinutes() + E);
1881
+ const v = new Date(d), w = new Date(d.getTime() + o), x = l.getTimezoneOffset(v, c);
1882
+ if (x !== p) {
1883
+ const k = p - x;
1884
+ v.setMinutes(v.getMinutes() + k), w.setMinutes(w.getMinutes() + k);
1885
1885
  }
1886
- y = k, this.isException(b, n, e.id) || r.push({
1887
- start: b,
1888
- end: D,
1886
+ p = x, this.isException(v, n, e.id) || r.push({
1887
+ start: v,
1888
+ end: w,
1889
1889
  recurringEventId: e.id,
1890
1890
  timezone: c,
1891
1891
  originalStart: e.start
@@ -1902,7 +1902,7 @@ class N {
1902
1902
  * @returns {import('../../types.js').RecurrenceRule} Parsed rule object
1903
1903
  */
1904
1904
  static parseRule(e) {
1905
- return Y.parse(e);
1905
+ return V.parse(e);
1906
1906
  }
1907
1907
  /**
1908
1908
  * Calculate the next occurrence based on the rule
@@ -2176,7 +2176,7 @@ class I {
2176
2176
  return this.cache.size;
2177
2177
  }
2178
2178
  }
2179
- class V {
2179
+ class N {
2180
2180
  constructor(e = {}) {
2181
2181
  this.config = {
2182
2182
  checkInterval: 3e4,
@@ -2408,7 +2408,7 @@ class W {
2408
2408
  enableAdaptiveMemory: !0,
2409
2409
  // Enable adaptive memory management
2410
2410
  ...e
2411
- }, this.eventCache = new I(this.config.cacheCapacity), this.queryCache = new I(Math.floor(this.config.cacheCapacity / 2)), this.dateRangeCache = new I(Math.floor(this.config.cacheCapacity / 4)), this.config.enableAdaptiveMemory && (this.memoryManager = new V({
2411
+ }, this.eventCache = new I(this.config.cacheCapacity), this.queryCache = new I(Math.floor(this.config.cacheCapacity / 2)), this.dateRangeCache = new I(Math.floor(this.config.cacheCapacity / 4)), this.config.enableAdaptiveMemory && (this.memoryManager = new N({
2412
2412
  checkInterval: 3e4,
2413
2413
  memoryThreshold: 0.75,
2414
2414
  criticalThreshold: 0.9
@@ -3020,7 +3020,7 @@ class Z {
3020
3020
  */
3021
3021
  addEvent(e) {
3022
3022
  return this.optimizer.measure("addEvent", () => {
3023
- if (e instanceof x || (e = new x(e)), this.events.has(e.id))
3023
+ if (e instanceof E || (e = new E(e)), this.events.has(e.id))
3024
3024
  throw new Error(`Event with id ${e.id} already exists`);
3025
3025
  return this.events.set(e.id, e), this.optimizer.cache(e.id, e, "event"), this._indexEvent(e), this.isBatchMode ? this.batchNotifications.push({
3026
3026
  type: "add",
@@ -3135,8 +3135,8 @@ class Z {
3135
3135
  for (let l = -1; l <= 1; l++) {
3136
3136
  const d = new Date(i);
3137
3137
  d.setDate(d.getDate() + l);
3138
- const h = f.getLocalDateString(d), y = this.indices.byDate.get(h);
3139
- y && y.forEach((b) => s.add(b));
3138
+ const h = f.getLocalDateString(d), p = this.indices.byDate.get(h);
3139
+ p && p.forEach((v) => s.add(v));
3140
3140
  }
3141
3141
  const a = `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}`, n = this.indices.byMonth.get(a);
3142
3142
  n && n.forEach((l) => s.add(l));
@@ -3147,13 +3147,13 @@ class Z {
3147
3147
  for (const l of s) {
3148
3148
  const d = this.events.get(l);
3149
3149
  if (d) {
3150
- const h = d.getStartInTimezone(t), y = d.getEndInTimezone(t);
3151
- h <= c && y >= o && r.push(d);
3150
+ const h = d.getStartInTimezone(t), p = d.getEndInTimezone(t);
3151
+ h <= c && p >= o && r.push(d);
3152
3152
  }
3153
3153
  }
3154
3154
  return r.sort((l, d) => {
3155
- const h = l.getStartInTimezone(t), y = d.getStartInTimezone(t), b = h - y;
3156
- return b !== 0 ? b : d.duration - l.duration;
3155
+ const h = l.getStartInTimezone(t), p = d.getStartInTimezone(t), v = h - p;
3156
+ return v !== 0 ? v : d.duration - l.duration;
3157
3157
  });
3158
3158
  }
3159
3159
  /**
@@ -3170,8 +3170,8 @@ class Z {
3170
3170
  (this.indices.byDate.get(l) || /* @__PURE__ */ new Set()).forEach((h) => {
3171
3171
  if (!o.has(h) && h !== s) {
3172
3172
  o.add(h);
3173
- const y = this.events.get(h);
3174
- y && y.overlaps({ start: e, end: t }) && i.push(y);
3173
+ const p = this.events.get(h);
3174
+ p && p.overlaps({ start: e, end: t }) && i.push(p);
3175
3175
  }
3176
3176
  });
3177
3177
  }), i.sort((c, l) => c.start - l.start);
@@ -3281,7 +3281,7 @@ class Z {
3281
3281
  return [e];
3282
3282
  i = i || this.defaultTimezone;
3283
3283
  const a = e.timeZone || i;
3284
- return N.expandEvent(e, t, s).map((r, o) => e.clone({
3284
+ return Y.expandEvent(e, t, s).map((r, o) => e.clone({
3285
3285
  id: `${e.id}_occurrence_${o}`,
3286
3286
  start: r.start,
3287
3287
  end: r.end,
@@ -4142,7 +4142,7 @@ class K {
4142
4142
  * @returns {import('../events/Event.js').Event} The added event
4143
4143
  */
4144
4144
  addEvent(e) {
4145
- !(e instanceof x) && !e.timeZone && (e = { ...e, timeZone: this.config.timeZone });
4145
+ !(e instanceof E) && !e.timeZone && (e = { ...e, timeZone: this.config.timeZone });
4146
4146
  const t = this.eventStore.addEvent(e);
4147
4147
  return this._emit("eventAdd", { event: t }), t;
4148
4148
  }
@@ -4348,22 +4348,22 @@ class K {
4348
4348
  let l = new Date(o);
4349
4349
  const d = a ? 6 : Math.ceil((r.getDate() + f.getDayOfWeek(n, i)) / 7);
4350
4350
  for (let h = 0; h < d; h++) {
4351
- const y = {
4351
+ const p = {
4352
4352
  weekNumber: f.getWeekNumber(l),
4353
4353
  days: []
4354
4354
  };
4355
- for (let b = 0; b < 7; b++) {
4356
- const D = new Date(l), k = D.getMonth() === s, E = f.isToday(D), A = D.getDay() === 0 || D.getDay() === 6;
4357
- y.days.push({
4358
- date: D,
4359
- dayOfMonth: D.getDate(),
4360
- isCurrentMonth: k,
4361
- isToday: E,
4355
+ for (let v = 0; v < 7; v++) {
4356
+ const w = new Date(l), x = w.getMonth() === s, k = f.isToday(w), A = w.getDay() === 0 || w.getDay() === 6;
4357
+ p.days.push({
4358
+ date: w,
4359
+ dayOfMonth: w.getDate(),
4360
+ isCurrentMonth: x,
4361
+ isToday: k,
4362
4362
  isWeekend: A,
4363
- events: this.getEventsForDate(D)
4363
+ events: this.getEventsForDate(w)
4364
4364
  }), l = f.addDays(l, 1);
4365
4365
  }
4366
- c.push(y);
4366
+ c.push(p);
4367
4367
  }
4368
4368
  return {
4369
4369
  type: "month",
@@ -4848,7 +4848,7 @@ class Q {
4848
4848
  this.subscribers.clear(), this.state = null, this.calendar = null;
4849
4849
  }
4850
4850
  }
4851
- class v extends f {
4851
+ class b extends f {
4852
4852
  /**
4853
4853
  * Format date for display
4854
4854
  */
@@ -5157,7 +5157,7 @@ class C {
5157
5157
  return e.addEventListener("keydown", a), s == null || s.focus(), () => e.removeEventListener("keydown", a);
5158
5158
  }
5159
5159
  }
5160
- class p {
5160
+ class y {
5161
5161
  /**
5162
5162
  * Get CSS variable value
5163
5163
  */
@@ -5494,7 +5494,7 @@ class p {
5494
5494
  /**
5495
5495
  * Default theme colors
5496
5496
  */
5497
- M(p, "colors", {
5497
+ M(y, "colors", {
5498
5498
  primary: "#3B82F6",
5499
5499
  // Modern Blue
5500
5500
  secondary: "#64748B",
@@ -5527,7 +5527,7 @@ M(p, "colors", {
5527
5527
  }), /**
5528
5528
  * Common CSS variables
5529
5529
  */
5530
- M(p, "cssVariables", {
5530
+ M(y, "cssVariables", {
5531
5531
  // "Pro" Palette - Functional & Sharp
5532
5532
  "--fc-primary-color": "#2563EB",
5533
5533
  // International Blue (Focus)
@@ -5595,7 +5595,7 @@ M(p, "cssVariables", {
5595
5595
  }), /**
5596
5596
  * Get responsive breakpoints
5597
5597
  */
5598
- M(p, "breakpoints", {
5598
+ M(y, "breakpoints", {
5599
5599
  xs: "320px",
5600
5600
  sm: "576px",
5601
5601
  md: "768px",
@@ -5948,7 +5948,7 @@ class J extends T {
5948
5948
  renderHeader() {
5949
5949
  const { config: e } = this.stateManager.getState(), t = [], s = e.weekStartsOn || 0;
5950
5950
  for (let i = 0; i < 7; i++) {
5951
- const a = (s + i) % 7, n = v.getDayAbbreviation(a, e.locale);
5951
+ const a = (s + i) % 7, n = b.getDayAbbreviation(a, e.locale);
5952
5952
  t.push(`<div class="month-header-cell">${n}</div>`);
5953
5953
  }
5954
5954
  return `
@@ -5983,7 +5983,7 @@ class J extends T {
5983
5983
  renderDay(e) {
5984
5984
  const { date: t, dayOfMonth: s, isOtherMonth: i, isToday: a, isSelected: n, isWeekend: r, events: o = [] } = e, c = s, l = ["month-day"];
5985
5985
  i && l.push("other-month"), a && l.push("today"), n && l.push("selected"), r && l.push("weekend");
5986
- const d = o.slice(0, this.config.maxEventsToShow), h = o.length - this.config.maxEventsToShow, y = d.map((D) => this.renderEvent(D)).join(""), b = h > 0 ? `<div class="more-events">+${h} more</div>` : "";
5986
+ const d = o.slice(0, this.config.maxEventsToShow), h = o.length - this.config.maxEventsToShow, p = d.map((w) => this.renderEvent(w)).join(""), v = h > 0 ? `<div class="more-events">+${h} more</div>` : "";
5987
5987
  return `
5988
5988
  <div class="${l.join(" ")}"
5989
5989
  data-date="${t.toISOString()}"
@@ -5992,8 +5992,8 @@ class J extends T {
5992
5992
  <span class="day-number">${c}</span>
5993
5993
  </div>
5994
5994
  <div class="day-events">
5995
- ${y}
5996
- ${b}
5995
+ ${p}
5996
+ ${v}
5997
5997
  </div>
5998
5998
  </div>
5999
5999
  `;
@@ -6002,11 +6002,11 @@ class J extends T {
6002
6002
  const { title: t, start: s, allDay: i, backgroundColor: a, textColor: n } = e;
6003
6003
  let r = "";
6004
6004
  if (a) {
6005
- const l = p.sanitizeColor(a), d = p.sanitizeColor(n, "white");
6005
+ const l = y.sanitizeColor(a), d = y.sanitizeColor(n, "white");
6006
6006
  r += `background-color: ${l}; color: ${d};`;
6007
6007
  }
6008
6008
  let o = "";
6009
- !i && s && (o = v.formatTime(new Date(s), !1, !1));
6009
+ !i && s && (o = b.formatTime(new Date(s), !1, !1));
6010
6010
  const c = ["event-item"];
6011
6011
  return i && c.push("all-day"), `
6012
6012
  <div class="${c.join(" ")}"
@@ -6112,7 +6112,7 @@ class X extends T {
6112
6112
  return {
6113
6113
  ...s,
6114
6114
  date: i,
6115
- isToday: v.isToday(i),
6115
+ isToday: b.isToday(i),
6116
6116
  timedEvents: (s.events || []).filter((a) => !a.allDay),
6117
6117
  allDayEvents: (s.events || []).filter((a) => a.allDay)
6118
6118
  };
@@ -6309,7 +6309,7 @@ class X extends T {
6309
6309
  <div class="time-gutter-header"></div>
6310
6310
  ${this.viewData.days.map((e) => `
6311
6311
  <div class="day-column-header ${e.isToday ? "is-today" : ""}">
6312
- <span class="day-name">${v.getDayAbbreviation(e.date.getDay())}</span>
6312
+ <span class="day-name">${b.getDayAbbreviation(e.date.getDay())}</span>
6313
6313
  <span class="day-number">${e.date.getDate()}</span>
6314
6314
  </div>
6315
6315
  `).join("")}
@@ -6332,7 +6332,7 @@ class X extends T {
6332
6332
  <div class="time-gutter">
6333
6333
  ${this.hours.map((e) => `
6334
6334
  <div class="time-slot-label">
6335
- ${e === 0 ? "" : v.formatTime((/* @__PURE__ */ new Date()).setHours(e, 0), !1)}
6335
+ ${e === 0 ? "" : b.formatTime((/* @__PURE__ */ new Date()).setHours(e, 0), !1)}
6336
6336
  </div>
6337
6337
  `).join("")}
6338
6338
  </div>
@@ -6348,18 +6348,18 @@ class X extends T {
6348
6348
  ` : '<div class="week-view">Loading...</div>';
6349
6349
  }
6350
6350
  renderTimedEvent(e) {
6351
- const t = new Date(e.start), s = new Date(e.end), i = t.getHours() * 60 + t.getMinutes(), a = (s - t) / (1e3 * 60), n = i, r = Math.max(a, 20), o = p.sanitizeColor(e.backgroundColor), c = p.sanitizeColor(p.getContrastColor(o), "white");
6351
+ const t = new Date(e.start), s = new Date(e.end), i = t.getHours() * 60 + t.getMinutes(), a = (s - t) / (1e3 * 60), n = i, r = Math.max(a, 20), o = y.sanitizeColor(e.backgroundColor), c = y.sanitizeColor(y.getContrastColor(o), "white");
6352
6352
  return `
6353
6353
  <div class="event-container"
6354
6354
  style="top: ${n}px; height: ${r}px; background-color: ${o}; color: ${c};"
6355
6355
  data-event-id="${e.id}">
6356
6356
  <span class="event-title">${C.escapeHTML(e.title)}</span>
6357
- <span class="event-time">${v.formatTime(t)}</span>
6357
+ <span class="event-time">${b.formatTime(t)}</span>
6358
6358
  </div>
6359
6359
  `;
6360
6360
  }
6361
6361
  renderAllDayEvent(e) {
6362
- const t = p.sanitizeColor(e.backgroundColor), s = p.sanitizeColor(p.getContrastColor(t), "white");
6362
+ const t = y.sanitizeColor(e.backgroundColor), s = y.sanitizeColor(y.getContrastColor(t), "white");
6363
6363
  return `
6364
6364
  <div class="event-item"
6365
6365
  style="background-color: ${t}; color: ${s}; font-size: 10px; padding: 2px 4px; border-radius: 2px; cursor: pointer; margin-bottom: 2px;"
@@ -6435,7 +6435,7 @@ class ee extends T {
6435
6435
  updateSelection(e, t) {
6436
6436
  const s = this.shadowRoot.querySelector(".day-column");
6437
6437
  if (!s) return;
6438
- ((a) => a && v.isSameDay(a, new Date(s.dataset.date)))(e) ? s.classList.add("selected") : s.classList.remove("selected");
6438
+ ((a) => a && b.isSameDay(a, new Date(s.dataset.date)))(e) ? s.classList.add("selected") : s.classList.remove("selected");
6439
6439
  }
6440
6440
  loadViewData() {
6441
6441
  if (!this.stateManager) return;
@@ -6448,10 +6448,10 @@ class ee extends T {
6448
6448
  let t = null;
6449
6449
  const s = (n = this.stateManager) == null ? void 0 : n.getState(), i = (s == null ? void 0 : s.currentDate) || /* @__PURE__ */ new Date();
6450
6450
  if (e.days && Array.isArray(e.days) && e.days.length > 0)
6451
- t = e.days.find((r) => v.isSameDay(new Date(r.date), i)) || e.days[0];
6451
+ t = e.days.find((r) => b.isSameDay(new Date(r.date), i)) || e.days[0];
6452
6452
  else if (e.weeks && Array.isArray(e.weeks) && e.weeks.length > 0) {
6453
6453
  const r = e.weeks.flatMap((o) => o.days || []);
6454
- t = r.find((o) => v.isSameDay(new Date(o.date), i)) || r[0];
6454
+ t = r.find((o) => b.isSameDay(new Date(o.date), i)) || r[0];
6455
6455
  } else e.date && (t = e);
6456
6456
  if (!t) return null;
6457
6457
  const a = new Date(t.date);
@@ -6460,7 +6460,7 @@ class ee extends T {
6460
6460
  day: {
6461
6461
  ...t,
6462
6462
  date: a,
6463
- isToday: v.isToday(a),
6463
+ isToday: b.isToday(a),
6464
6464
  timedEvents: (t.events || []).filter((r) => !r.allDay),
6465
6465
  allDayEvents: (t.events || []).filter((r) => r.allDay)
6466
6466
  }
@@ -6638,7 +6638,7 @@ class ee extends T {
6638
6638
  var i, a, n;
6639
6639
  if (!this.viewData || !this.viewData.day)
6640
6640
  return '<div class="day-view" style="padding: 20px; color: var(--fc-text-light);">No data available.</div>';
6641
- const { day: e } = this.viewData, t = ((n = (a = (i = this.stateManager) == null ? void 0 : i.state) == null ? void 0 : a.config) == null ? void 0 : n.locale) || "en-US", s = v.formatDate(e.date, "day", t).split(" ")[0];
6641
+ const { day: e } = this.viewData, t = ((n = (a = (i = this.stateManager) == null ? void 0 : i.state) == null ? void 0 : a.config) == null ? void 0 : n.locale) || "en-US", s = b.formatDate(e.date, "day", t).split(" ")[0];
6642
6642
  return `
6643
6643
  <div class="day-view">
6644
6644
  <div class="day-header">
@@ -6664,7 +6664,7 @@ class ee extends T {
6664
6664
  <div class="time-gutter">
6665
6665
  ${this.hours.map((r) => `
6666
6666
  <div class="time-slot-label">
6667
- ${r === 0 ? "" : v.formatTime((/* @__PURE__ */ new Date()).setHours(r, 0), !1)}
6667
+ ${r === 0 ? "" : b.formatTime((/* @__PURE__ */ new Date()).setHours(r, 0), !1)}
6668
6668
  </div>
6669
6669
  `).join("")}
6670
6670
  </div>
@@ -6678,18 +6678,18 @@ class ee extends T {
6678
6678
  `;
6679
6679
  }
6680
6680
  renderTimedEvent(e) {
6681
- const t = new Date(e.start), s = new Date(e.end), i = t.getHours() * 60 + t.getMinutes(), a = (s - t) / (1e3 * 60), n = i, r = Math.max(a, 30), o = p.sanitizeColor(e.backgroundColor), c = p.sanitizeColor(p.getContrastColor(o), "white");
6681
+ const t = new Date(e.start), s = new Date(e.end), i = t.getHours() * 60 + t.getMinutes(), a = (s - t) / (1e3 * 60), n = i, r = Math.max(a, 30), o = y.sanitizeColor(e.backgroundColor), c = y.sanitizeColor(y.getContrastColor(o), "white");
6682
6682
  return `
6683
6683
  <div class="event-container"
6684
6684
  style="top: ${n}px; height: ${r}px; background-color: ${o}; color: ${c};"
6685
6685
  data-event-id="${e.id}">
6686
6686
  <span class="event-title">${C.escapeHTML(e.title)}</span>
6687
- <span class="event-time">${v.formatTime(t)} - ${v.formatTime(s)}</span>
6687
+ <span class="event-time">${b.formatTime(t)} - ${b.formatTime(s)}</span>
6688
6688
  </div>
6689
6689
  `;
6690
6690
  }
6691
6691
  renderAllDayEvent(e) {
6692
- const t = p.sanitizeColor(e.backgroundColor), s = p.sanitizeColor(p.getContrastColor(t), "white");
6692
+ const t = y.sanitizeColor(e.backgroundColor), s = y.sanitizeColor(y.getContrastColor(t), "white");
6693
6693
  return `
6694
6694
  <div class="event-item"
6695
6695
  style="background-color: ${t}; color: ${s}; font-size: 12px; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-weight: 500; margin-bottom: 2px;"
@@ -6751,8 +6751,8 @@ class te extends T {
6751
6751
  }
6752
6752
  getStyles() {
6753
6753
  return `
6754
- ${p.getBaseStyles()}
6755
- ${p.getButtonStyles()}
6754
+ ${y.getBaseStyles()}
6755
+ ${y.getButtonStyles()}
6756
6756
 
6757
6757
  :host {
6758
6758
  display: none;
@@ -7068,10 +7068,10 @@ class se extends T {
7068
7068
  getStyles() {
7069
7069
  const e = this.getAttribute("height") || "800px";
7070
7070
  return `
7071
- ${p.getBaseStyles()}
7072
- ${p.getButtonStyles()}
7073
- ${p.getGridStyles()}
7074
- ${p.getAnimations()}
7071
+ ${y.getBaseStyles()}
7072
+ ${y.getButtonStyles()}
7073
+ ${y.getGridStyles()}
7074
+ ${y.getAnimations()}
7075
7075
 
7076
7076
  :host {
7077
7077
  --calendar-height: ${e};
@@ -7234,10 +7234,15 @@ class se extends T {
7234
7234
  flex-direction: column;
7235
7235
  }
7236
7236
 
7237
- /* Ensure view components have proper dimensions */
7238
- forcecal-month,
7239
- forcecal-week,
7240
- forcecal-day {
7237
+ /* Ensure view container has proper dimensions */
7238
+ #calendar-view-container {
7239
+ display: block;
7240
+ width: 100%;
7241
+ height: 100%;
7242
+ flex: 1;
7243
+ }
7244
+
7245
+ #calendar-view-container > * {
7241
7246
  display: block;
7242
7247
  width: 100%;
7243
7248
  height: 100%;
@@ -7306,11 +7311,147 @@ class se extends T {
7306
7311
  justify-content: space-between;
7307
7312
  width: 100%;
7308
7313
  }
7309
-
7314
+
7310
7315
  #create-event-btn {
7311
7316
  flex: 1;
7312
7317
  }
7313
7318
  }
7319
+
7320
+ /* Month View Styles (inline rendering for Locker Service compatibility) */
7321
+ .fc-month-view {
7322
+ display: flex;
7323
+ flex-direction: column;
7324
+ height: 100%;
7325
+ background: var(--fc-background);
7326
+ }
7327
+
7328
+ .fc-month-header {
7329
+ display: grid;
7330
+ grid-template-columns: repeat(7, 1fr);
7331
+ border-bottom: 1px solid var(--fc-border-color);
7332
+ background: var(--fc-background-alt);
7333
+ }
7334
+
7335
+ .fc-month-header-cell {
7336
+ padding: 12px 8px;
7337
+ text-align: center;
7338
+ font-size: 11px;
7339
+ font-weight: 600;
7340
+ color: var(--fc-text-light);
7341
+ text-transform: uppercase;
7342
+ letter-spacing: 0.05em;
7343
+ }
7344
+
7345
+ .fc-month-body {
7346
+ display: flex;
7347
+ flex-direction: column;
7348
+ flex: 1;
7349
+ }
7350
+
7351
+ .fc-month-week {
7352
+ display: grid;
7353
+ grid-template-columns: repeat(7, 1fr);
7354
+ flex: 1;
7355
+ min-height: 100px;
7356
+ }
7357
+
7358
+ .fc-month-day {
7359
+ background: var(--fc-background);
7360
+ border-right: 1px solid var(--fc-border-color);
7361
+ border-bottom: 1px solid var(--fc-border-color);
7362
+ padding: 4px;
7363
+ min-height: 80px;
7364
+ cursor: pointer;
7365
+ transition: background-color 0.15s ease;
7366
+ display: flex;
7367
+ flex-direction: column;
7368
+ }
7369
+
7370
+ .fc-month-day:hover {
7371
+ background: var(--fc-background-hover);
7372
+ }
7373
+
7374
+ .fc-month-day:last-child {
7375
+ border-right: none;
7376
+ }
7377
+
7378
+ .fc-month-day.other-month {
7379
+ background: var(--fc-background-alt);
7380
+ }
7381
+
7382
+ .fc-month-day.other-month .fc-day-number {
7383
+ color: var(--fc-text-light);
7384
+ }
7385
+
7386
+ .fc-month-day.today {
7387
+ background: rgba(37, 99, 235, 0.05);
7388
+ }
7389
+
7390
+ .fc-month-day.today .fc-day-number {
7391
+ background: var(--fc-primary-color);
7392
+ color: white;
7393
+ border-radius: 50%;
7394
+ width: 24px;
7395
+ height: 24px;
7396
+ display: flex;
7397
+ align-items: center;
7398
+ justify-content: center;
7399
+ }
7400
+
7401
+ .fc-day-number {
7402
+ font-size: 13px;
7403
+ font-weight: 500;
7404
+ color: var(--fc-text-color);
7405
+ padding: 2px 4px;
7406
+ margin-bottom: 4px;
7407
+ }
7408
+
7409
+ .fc-day-events {
7410
+ display: flex;
7411
+ flex-direction: column;
7412
+ gap: 2px;
7413
+ flex: 1;
7414
+ overflow: hidden;
7415
+ }
7416
+
7417
+ .fc-event {
7418
+ font-size: 11px;
7419
+ padding: 2px 6px;
7420
+ border-radius: 3px;
7421
+ color: white;
7422
+ white-space: nowrap;
7423
+ overflow: hidden;
7424
+ text-overflow: ellipsis;
7425
+ cursor: pointer;
7426
+ transition: transform 0.1s ease;
7427
+ }
7428
+
7429
+ .fc-event:hover {
7430
+ transform: scale(1.02);
7431
+ }
7432
+
7433
+ .fc-more-events {
7434
+ font-size: 10px;
7435
+ color: var(--fc-text-light);
7436
+ padding: 2px 4px;
7437
+ font-weight: 500;
7438
+ }
7439
+
7440
+ /* Week View Styles (inline rendering for Locker Service compatibility) */
7441
+ .fc-week-view {
7442
+ display: flex;
7443
+ flex-direction: column;
7444
+ height: 100%;
7445
+ background: var(--fc-background);
7446
+ }
7447
+
7448
+ /* Day View Styles (inline rendering for Locker Service compatibility) */
7449
+ .fc-day-view {
7450
+ display: flex;
7451
+ flex-direction: column;
7452
+ height: 100%;
7453
+ background: var(--fc-background);
7454
+ }
7314
7455
  `;
7315
7456
  }
7316
7457
  template() {
@@ -7376,38 +7517,118 @@ class se extends T {
7376
7517
  `;
7377
7518
  }
7378
7519
  renderView() {
7379
- if (!this.currentView)
7380
- return "<div>Loading view...</div>";
7381
- const e = `forcecal-${this.currentView}`;
7382
- return `<${e} id="calendar-view"></${e}>`;
7520
+ return '<div id="calendar-view-container"></div>';
7383
7521
  }
7384
7522
  afterRender() {
7385
- var i;
7386
- const e = this.$("#calendar-view");
7387
- if (console.log("[ForceCalendar] afterRender - viewElement:", e), console.log("[ForceCalendar] afterRender - stateManager:", !!this.stateManager), e && this.stateManager) {
7388
- console.log("[ForceCalendar] viewElement.constructor.name:", (i = e.constructor) == null ? void 0 : i.name), console.log("[ForceCalendar] viewElement methods:", Object.getOwnPropertyNames(Object.getPrototypeOf(e))), typeof customElements < "u" && customElements.upgrade && (console.log("[ForceCalendar] Forcing custom element upgrade"), customElements.upgrade(e));
7389
- const a = this._registryId || (this._registryId = "fc-" + Math.random().toString(36).substr(2, 9));
7390
- window.__forceCalendarRegistry = window.__forceCalendarRegistry || {}, window.__forceCalendarRegistry[a] = this.stateManager, e.setAttribute("data-state-registry", a), console.log("[ForceCalendar] Set registry ID:", a), e._checkRegistry ? (console.log("[ForceCalendar] Calling _checkRegistry directly"), e._checkRegistry()) : e.setStateManager && (console.log("[ForceCalendar] Calling setStateManager directly"), e.setStateManager(this.stateManager));
7391
- } else
7392
- console.log("[ForceCalendar] Could not set stateManager - viewElement:", !!e, "stateManager:", !!this.stateManager);
7393
- this.$$("[data-action]").forEach((a) => {
7394
- this.addListener(a, "click", this.handleNavigation);
7395
- }), this.$$("[data-view]").forEach((a) => {
7396
- this.addListener(a, "click", this.handleViewChange);
7523
+ const e = this.$("#calendar-view-container");
7524
+ if (console.log("[ForceCalendar] afterRender - container:", !!e, "stateManager:", !!this.stateManager, "currentView:", this.currentView), e && this.stateManager && this.currentView) {
7525
+ if (this._currentViewInstance && this._currentViewInstance._viewType === this.currentView && e.children.length > 0) {
7526
+ console.log("[ForceCalendar] View already exists with content, skipping creation");
7527
+ return;
7528
+ }
7529
+ this._currentViewInstance && (this._currentViewInstance.cleanup && this._currentViewInstance.cleanup(), this._viewUnsubscribe && (this._viewUnsubscribe(), this._viewUnsubscribe = null)), console.log("[ForceCalendar] Creating view for:", this.currentView);
7530
+ try {
7531
+ const i = this._createViewRenderer(this.currentView);
7532
+ i && (i._viewType = this.currentView, this._currentViewInstance = i, i.stateManager = this.stateManager, i.container = e, console.log("[ForceCalendar] Calling viewRenderer.render()"), i.render(), console.log("[ForceCalendar] viewRenderer.render() completed"), this._viewUnsubscribe = this.stateManager.subscribe((a, n) => {
7533
+ (a.events !== (n == null ? void 0 : n.events) || a.currentDate !== (n == null ? void 0 : n.currentDate)) && i && i.render && i.render();
7534
+ }));
7535
+ } catch (i) {
7536
+ console.error("[ForceCalendar] Error creating/rendering view:", i);
7537
+ }
7538
+ }
7539
+ this.$$("[data-action]").forEach((i) => {
7540
+ this.addListener(i, "click", this.handleNavigation);
7541
+ }), this.$$("[data-view]").forEach((i) => {
7542
+ this.addListener(i, "click", this.handleViewChange);
7397
7543
  });
7398
7544
  const t = this.$("#event-modal"), s = this.$("#create-event-btn");
7399
7545
  s && t && this.addListener(s, "click", () => {
7400
7546
  t.open(/* @__PURE__ */ new Date());
7401
- }), this.addListener(this.shadowRoot, "day-click", (a) => {
7402
- t && t.open(a.detail.date);
7403
- }), t && this.addListener(t, "save", (a) => {
7404
- const n = a.detail, r = window.crypto && typeof window.crypto.randomUUID == "function" ? window.crypto.randomUUID() : Math.random().toString(36).substring(2, 15);
7547
+ }), this.addListener(this.shadowRoot, "day-click", (i) => {
7548
+ t && t.open(i.detail.date);
7549
+ }), t && this.addListener(t, "save", (i) => {
7550
+ const a = i.detail, n = window.crypto && typeof window.crypto.randomUUID == "function" ? window.crypto.randomUUID() : Math.random().toString(36).substring(2, 15);
7405
7551
  this.stateManager.addEvent({
7406
- id: r,
7407
- ...n
7552
+ id: n,
7553
+ ...a
7408
7554
  });
7409
7555
  });
7410
7556
  }
7557
+ _createViewRenderer(e) {
7558
+ return {
7559
+ stateManager: null,
7560
+ container: null,
7561
+ _listeners: [],
7562
+ cleanup() {
7563
+ this._listeners.forEach(({ element: t, event: s, handler: i }) => {
7564
+ t.removeEventListener(s, i);
7565
+ }), this._listeners = [];
7566
+ },
7567
+ addListener(t, s, i) {
7568
+ t.addEventListener(s, i), this._listeners.push({ element: t, event: s, handler: i });
7569
+ },
7570
+ render() {
7571
+ if (console.log("[ViewRenderer] render called, container:", !!this.container, "stateManager:", !!this.stateManager), !this.container || !this.stateManager) return;
7572
+ const t = this.stateManager.getViewData();
7573
+ if (console.log("[ViewRenderer] viewData:", t), console.log("[ViewRenderer] viewData.weeks:", t == null ? void 0 : t.weeks), !t || !t.weeks) {
7574
+ this.container.innerHTML = '<div style="padding: 20px; text-align: center; background: #fee; color: #c00;">No viewData.weeks available. viewData keys: ' + (t ? Object.keys(t).join(", ") : "null") + "</div>";
7575
+ return;
7576
+ }
7577
+ this.cleanup();
7578
+ const s = this.stateManager.getState().config;
7579
+ console.log("[ViewRenderer] Rendering month view with", t.weeks.length, "weeks");
7580
+ const i = this._renderMonthView(t, s);
7581
+ console.log("[ViewRenderer] HTML length:", i.length), this.container.innerHTML = i, console.log("[ViewRenderer] innerHTML set, container children:", this.container.children.length), this._attachEventHandlers();
7582
+ },
7583
+ _renderMonthView(t, s) {
7584
+ const i = s.weekStartsOn || 0, a = [];
7585
+ for (let r = 0; r < 7; r++) {
7586
+ const o = (i + r) % 7;
7587
+ a.push(["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"][o]);
7588
+ }
7589
+ let n = `
7590
+ <div class="fc-month-view" style="display: flex; flex-direction: column; height: 100%; min-height: 400px; background: #fff; border: 1px solid #e5e7eb;">
7591
+ <div class="fc-month-header" style="display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid #e5e7eb; background: #f9fafb;">
7592
+ ${a.map((r) => `<div class="fc-month-header-cell" style="padding: 12px 8px; text-align: center; font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase;">${r}</div>`).join("")}
7593
+ </div>
7594
+ <div class="fc-month-body" style="display: flex; flex-direction: column; flex: 1;">
7595
+ `;
7596
+ return t.weeks.forEach((r) => {
7597
+ n += '<div class="fc-month-week" style="display: grid; grid-template-columns: repeat(7, 1fr); flex: 1; min-height: 80px;">', r.days.forEach((o) => {
7598
+ const c = !o.isCurrentMonth, l = o.isToday, d = c ? "#f3f4f6" : "#fff", h = c ? "#9ca3af" : "#111827", p = l ? "background: #2563eb; color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;" : "", v = o.events || [], w = v.slice(0, 3), x = v.length - 3;
7599
+ n += `
7600
+ <div class="fc-month-day" data-date="${o.date}" style="background: ${d}; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; padding: 4px; min-height: 80px; cursor: pointer;">
7601
+ <div class="fc-day-number" style="font-size: 13px; font-weight: 500; color: ${h}; padding: 2px 4px; margin-bottom: 4px; ${p}">${o.dayOfMonth}</div>
7602
+ <div class="fc-day-events" style="display: flex; flex-direction: column; gap: 2px;">
7603
+ ${w.map((k) => `
7604
+ <div class="fc-event" data-event-id="${k.id}" style="background-color: ${k.backgroundColor || "#2563eb"}; font-size: 11px; padding: 2px 6px; border-radius: 3px; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;">
7605
+ ${k.title}
7606
+ </div>
7607
+ `).join("")}
7608
+ ${x > 0 ? `<div class="fc-more-events" style="font-size: 10px; color: #6b7280; padding: 2px 4px; font-weight: 500;">+${x} more</div>` : ""}
7609
+ </div>
7610
+ </div>
7611
+ `;
7612
+ }), n += "</div>";
7613
+ }), n += "</div></div>", n;
7614
+ },
7615
+ _attachEventHandlers() {
7616
+ const t = this.stateManager;
7617
+ this.container.querySelectorAll(".fc-month-day").forEach((s) => {
7618
+ this.addListener(s, "click", (i) => {
7619
+ const a = new Date(s.dataset.date);
7620
+ t.selectDate(a);
7621
+ });
7622
+ }), this.container.querySelectorAll(".fc-event").forEach((s) => {
7623
+ this.addListener(s, "click", (i) => {
7624
+ i.stopPropagation();
7625
+ const a = s.dataset.eventId, n = t.getEvents().find((r) => r.id === a);
7626
+ n && t.selectEvent(n);
7627
+ });
7628
+ });
7629
+ }
7630
+ };
7631
+ }
7411
7632
  handleNavigation(e) {
7412
7633
  switch (e.currentTarget.dataset.action) {
7413
7634
  case "today":
@@ -7429,14 +7650,14 @@ class se extends T {
7429
7650
  const s = this.stateManager.state.config.locale;
7430
7651
  switch (t) {
7431
7652
  case "month":
7432
- return v.formatDate(e, "month", s);
7653
+ return b.formatDate(e, "month", s);
7433
7654
  case "week":
7434
- const i = v.startOfWeek(e), a = v.endOfWeek(e);
7435
- return v.formatDateRange(i, a, s);
7655
+ const i = b.startOfWeek(e), a = b.endOfWeek(e);
7656
+ return b.formatDateRange(i, a, s);
7436
7657
  case "day":
7437
- return v.formatDate(e, "long", s);
7658
+ return b.formatDate(e, "long", s);
7438
7659
  default:
7439
- return v.formatDate(e, "month", s);
7660
+ return b.formatDate(e, "month", s);
7440
7661
  }
7441
7662
  }
7442
7663
  getIcon(e) {
@@ -7495,13 +7716,13 @@ typeof window < "u" && typeof customElements < "u" && console.log("Force Calenda
7495
7716
  export {
7496
7717
  T as BaseComponent,
7497
7718
  C as DOMUtils,
7498
- v as DateUtils,
7719
+ b as DateUtils,
7499
7720
  ee as DayView,
7500
7721
  G as EventBus,
7501
7722
  se as ForceCalendar,
7502
7723
  J as MonthView,
7503
7724
  Q as StateManager,
7504
- p as StyleUtils,
7725
+ y as StyleUtils,
7505
7726
  X as WeekView,
7506
7727
  m as eventBus
7507
7728
  };