@forcecalendar/interface 1.0.10 → 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
1
  var B = Object.defineProperty;
2
- var P = (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) => P(u, typeof e != "symbol" ? e + "" : e, t);
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,11 +708,11 @@ class x {
708
708
  borderColor: l = null,
709
709
  textColor: d = null,
710
710
  recurring: h = !1,
711
- recurrenceRule: m = null,
712
- timeZone: b = null,
713
- endTimeZone: D = null,
714
- status: k = "confirmed",
715
- visibility: C = "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 = [],
@@ -726,7 +726,7 @@ class x {
726
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,11 +739,11 @@ class x {
739
739
  borderColor: l,
740
740
  textColor: d,
741
741
  recurring: h,
742
- recurrenceRule: m,
743
- timeZone: b,
744
- endTimeZone: D,
745
- status: k,
746
- visibility: C,
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,
@@ -757,7 +757,7 @@ class x {
757
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 V {
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 V {
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 m = 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 !== m) {
1883
- const C = m - k;
1884
- b.setMinutes(b.getMinutes() + C), D.setMinutes(D.getMinutes() + C);
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
- m = 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 V {
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
@@ -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), m = this.indices.byDate.get(h);
3139
- m && m.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), m = d.getEndInTimezone(t);
3151
- h <= c && m >= 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), m = d.getStartInTimezone(t), b = h - m;
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 m = this.events.get(h);
3174
- m && m.overlaps({ start: e, end: t }) && i.push(m);
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 V.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 m = {
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, C = f.isToday(D), A = D.getDay() === 0 || D.getDay() === 6;
4357
- m.days.push({
4358
- date: D,
4359
- dayOfMonth: D.getDate(),
4360
- isCurrentMonth: k,
4361
- isToday: C,
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(m);
4366
+ c.push(p);
4367
4367
  }
4368
4368
  return {
4369
4369
  type: "month",
@@ -4653,7 +4653,7 @@ class G {
4653
4653
  return this.events.has(e) ? this.events.get(e).length : 0;
4654
4654
  }
4655
4655
  }
4656
- const p = new G();
4656
+ const m = new G();
4657
4657
  class Q {
4658
4658
  constructor(e = {}) {
4659
4659
  this.calendar = new K({
@@ -4702,62 +4702,62 @@ class Q {
4702
4702
  (i) => e[i] !== t[i]
4703
4703
  );
4704
4704
  s.forEach((i) => {
4705
- p.emit(`state:${i}:changed`, {
4705
+ m.emit(`state:${i}:changed`, {
4706
4706
  oldValue: e[i],
4707
4707
  newValue: t[i],
4708
4708
  state: t
4709
4709
  });
4710
- }), s.length > 0 && p.emit("state:changed", { oldState: e, newState: t, changedKeys: s });
4710
+ }), s.length > 0 && m.emit("state:changed", { oldState: e, newState: t, changedKeys: s });
4711
4711
  }
4712
4712
  // Calendar operations
4713
4713
  setView(e) {
4714
- this.calendar.setView(e), this.setState({ view: e }), p.emit("view:changed", { view: e });
4714
+ this.calendar.setView(e), this.setState({ view: e }), m.emit("view:changed", { view: e });
4715
4715
  }
4716
4716
  getView() {
4717
4717
  return this.state.view;
4718
4718
  }
4719
4719
  setDate(e) {
4720
- this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }), p.emit("date:changed", { date: this.state.currentDate });
4720
+ this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }), m.emit("date:changed", { date: this.state.currentDate });
4721
4721
  }
4722
4722
  getCurrentDate() {
4723
4723
  return this.state.currentDate;
4724
4724
  }
4725
4725
  // Navigation
4726
4726
  next() {
4727
- this.calendar.next(), this.setState({ currentDate: this.calendar.getCurrentDate() }), p.emit("navigation:next", { date: this.state.currentDate });
4727
+ this.calendar.next(), this.setState({ currentDate: this.calendar.getCurrentDate() }), m.emit("navigation:next", { date: this.state.currentDate });
4728
4728
  }
4729
4729
  previous() {
4730
- this.calendar.previous(), this.setState({ currentDate: this.calendar.getCurrentDate() }), p.emit("navigation:previous", { date: this.state.currentDate });
4730
+ this.calendar.previous(), this.setState({ currentDate: this.calendar.getCurrentDate() }), m.emit("navigation:previous", { date: this.state.currentDate });
4731
4731
  }
4732
4732
  today() {
4733
- this.calendar.today(), this.setState({ currentDate: this.calendar.getCurrentDate() }), p.emit("navigation:today", { date: this.state.currentDate });
4733
+ this.calendar.today(), this.setState({ currentDate: this.calendar.getCurrentDate() }), m.emit("navigation:today", { date: this.state.currentDate });
4734
4734
  }
4735
4735
  goToDate(e) {
4736
- this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }), p.emit("navigation:goto", { date: this.state.currentDate });
4736
+ this.calendar.goToDate(e), this.setState({ currentDate: this.calendar.getCurrentDate() }), m.emit("navigation:goto", { date: this.state.currentDate });
4737
4737
  }
4738
4738
  // Event management
4739
4739
  addEvent(e) {
4740
4740
  const t = this.calendar.addEvent(e);
4741
4741
  if (!t)
4742
- return console.error("Failed to add event to calendar"), p.emit("event:error", { action: "add", event: e, error: "Failed to add event" }), null;
4742
+ return console.error("Failed to add event to calendar"), m.emit("event:error", { action: "add", event: e, error: "Failed to add event" }), null;
4743
4743
  const s = [...this.state.events, t];
4744
- return this.setState({ events: s }), p.emit("event:added", { event: t }), t;
4744
+ return this.setState({ events: s }), m.emit("event:added", { event: t }), t;
4745
4745
  }
4746
4746
  updateEvent(e, t) {
4747
4747
  const s = this.calendar.updateEvent(e, t);
4748
4748
  if (!s)
4749
- return console.error(`Failed to update event: ${e}`), p.emit("event:error", { action: "update", eventId: e, updates: t, error: "Event not found in calendar" }), null;
4749
+ return console.error(`Failed to update event: ${e}`), m.emit("event:error", { action: "update", eventId: e, updates: t, error: "Event not found in calendar" }), null;
4750
4750
  const i = this.state.events.findIndex((n) => n.id === e);
4751
4751
  if (i === -1)
4752
- return console.error(`Event ${e} not found in state`), p.emit("event:error", { action: "update", eventId: e, error: "Event not found in state" }), null;
4752
+ return console.error(`Event ${e} not found in state`), m.emit("event:error", { action: "update", eventId: e, error: "Event not found in state" }), null;
4753
4753
  const a = [...this.state.events];
4754
- return a[i] = s, this.setState({ events: a }), p.emit("event:updated", { event: s }), s;
4754
+ return a[i] = s, this.setState({ events: a }), m.emit("event:updated", { event: s }), s;
4755
4755
  }
4756
4756
  deleteEvent(e) {
4757
4757
  if (!this.calendar.removeEvent(e))
4758
- return console.error(`Failed to delete event: ${e}`), p.emit("event:error", { action: "delete", eventId: e, error: "Event not found" }), !1;
4758
+ return console.error(`Failed to delete event: ${e}`), m.emit("event:error", { action: "delete", eventId: e, error: "Event not found" }), !1;
4759
4759
  const s = this.state.events.filter((i) => i.id !== e);
4760
- return this.setState({ events: s }), p.emit("event:deleted", { eventId: e }), !0;
4760
+ return this.setState({ events: s }), m.emit("event:deleted", { eventId: e }), !0;
4761
4761
  }
4762
4762
  getEvents() {
4763
4763
  return this.calendar.getEvents();
@@ -4801,20 +4801,20 @@ class Q {
4801
4801
  }
4802
4802
  // Selection management
4803
4803
  selectEvent(e) {
4804
- this.setState({ selectedEvent: e }), p.emit("event:selected", { event: e });
4804
+ this.setState({ selectedEvent: e }), m.emit("event:selected", { event: e });
4805
4805
  }
4806
4806
  selectEventById(e) {
4807
4807
  const t = this.state.events.find((s) => s.id === e);
4808
4808
  t && this.selectEvent(t);
4809
4809
  }
4810
4810
  deselectEvent() {
4811
- this.setState({ selectedEvent: null }), p.emit("event:deselected", {});
4811
+ this.setState({ selectedEvent: null }), m.emit("event:deselected", {});
4812
4812
  }
4813
4813
  selectDate(e) {
4814
- this.setState({ selectedDate: e }), p.emit("date:selected", { date: e });
4814
+ this.setState({ selectedDate: e }), m.emit("date:selected", { date: e });
4815
4815
  }
4816
4816
  deselectDate() {
4817
- this.setState({ selectedDate: null }), p.emit("date:deselected", {});
4817
+ this.setState({ selectedDate: null }), m.emit("date:deselected", {});
4818
4818
  }
4819
4819
  // Utility methods
4820
4820
  isToday(e) {
@@ -4834,7 +4834,7 @@ class Q {
4834
4834
  }
4835
4835
  // Error handling
4836
4836
  setError(e) {
4837
- this.setState({ error: e }), e && p.emit("error", { error: e });
4837
+ this.setState({ error: e }), e && m.emit("error", { error: e });
4838
4838
  }
4839
4839
  clearError() {
4840
4840
  this.setState({ error: null });
@@ -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
  */
@@ -4962,7 +4962,7 @@ class v extends f {
4962
4962
  return a && (a.toLowerCase() === "pm" && n < 12 ? o = n + 12 : a.toLowerCase() === "am" && n === 12 && (o = 0)), s.setHours(o, r || 0, 0, 0), s;
4963
4963
  }
4964
4964
  }
4965
- class E {
4965
+ class C {
4966
4966
  /**
4967
4967
  * Create element with attributes and children
4968
4968
  */
@@ -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, m = 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
- ${m}
5996
- ${b}
5995
+ ${p}
5996
+ ${v}
5997
5997
  </div>
5998
5998
  </div>
5999
5999
  `;
@@ -6006,15 +6006,15 @@ class J extends T {
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(" ")}"
6013
6013
  style="${r}"
6014
6014
  data-event-id="${e.id}"
6015
- title="${E.escapeHTML(t)}">
6015
+ title="${C.escapeHTML(t)}">
6016
6016
  ${o ? `<span class="event-time">${o}</span>` : ""}
6017
- <span class="event-title">${E.escapeHTML(t)}</span>
6017
+ <span class="event-title">${C.escapeHTML(t)}</span>
6018
6018
  </div>
6019
6019
  `;
6020
6020
  }
@@ -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>
@@ -6353,8 +6353,8 @@ class X extends T {
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
- <span class="event-title">${E.escapeHTML(e.title)}</span>
6357
- <span class="event-time">${v.formatTime(t)}</span>
6356
+ <span class="event-title">${C.escapeHTML(e.title)}</span>
6357
+ <span class="event-time">${b.formatTime(t)}</span>
6358
6358
  </div>
6359
6359
  `;
6360
6360
  }
@@ -6364,7 +6364,7 @@ class X extends T {
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;"
6366
6366
  data-event-id="${e.id}">
6367
- ${E.escapeHTML(e.title)}
6367
+ ${C.escapeHTML(e.title)}
6368
6368
  </div>
6369
6369
  `;
6370
6370
  }
@@ -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>
@@ -6683,8 +6683,8 @@ class ee extends T {
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
- <span class="event-title">${E.escapeHTML(e.title)}</span>
6687
- <span class="event-time">${v.formatTime(t)} - ${v.formatTime(s)}</span>
6686
+ <span class="event-title">${C.escapeHTML(e.title)}</span>
6687
+ <span class="event-time">${b.formatTime(t)} - ${b.formatTime(s)}</span>
6688
6688
  </div>
6689
6689
  `;
6690
6690
  }
@@ -6694,7 +6694,7 @@ class ee extends T {
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;"
6696
6696
  data-event-id="${e.id}">
6697
- ${E.escapeHTML(e.title)}
6697
+ ${C.escapeHTML(e.title)}
6698
6698
  </div>
6699
6699
  `;
6700
6700
  }
@@ -6995,7 +6995,7 @@ class te extends T {
6995
6995
  });
6996
6996
  }
6997
6997
  open(e = /* @__PURE__ */ new Date()) {
6998
- this.hasAttribute("open") || this.setAttribute("open", ""), this.titleGroup.classList.remove("has-error"), this.endGroup.classList.remove("has-error"), this._formData.start = e, this._formData.end = new Date(e.getTime() + this.config.defaultDuration * 60 * 1e3), this._formData.title = "", this._formData.color = this.config.colors[0].color, this.startInput && (this.titleInput.value = "", this.startInput.value = this.formatDateForInput(this._formData.start), this.endInput.value = this.formatDateForInput(this._formData.end), this.updateColorSelection(), this._cleanupFocusTrap = E.trapFocus(this.modalContent));
6998
+ this.hasAttribute("open") || this.setAttribute("open", ""), this.titleGroup.classList.remove("has-error"), this.endGroup.classList.remove("has-error"), this._formData.start = e, this._formData.end = new Date(e.getTime() + this.config.defaultDuration * 60 * 1e3), this._formData.title = "", this._formData.color = this.config.colors[0].color, this.startInput && (this.titleInput.value = "", this.startInput.value = this.formatDateForInput(this._formData.start), this.endInput.value = this.formatDateForInput(this._formData.end), this.updateColorSelection(), this._cleanupFocusTrap = C.trapFocus(this.modalContent));
6999
6999
  }
7000
7000
  close() {
7001
7001
  this.removeAttribute("open"), this._cleanupFocusTrap && (this._cleanupFocusTrap(), this._cleanupFocusTrap = null);
@@ -7046,13 +7046,13 @@ class se extends T {
7046
7046
  this.stateManager = new Q(e), this.stateManager.subscribe(this.handleStateChange.bind(this)), this.setupEventListeners();
7047
7047
  }
7048
7048
  setupEventListeners() {
7049
- p.on("navigation:*", (e, t) => {
7049
+ m.on("navigation:*", (e, t) => {
7050
7050
  this.emit("calendar-navigate", { action: t.split(":")[1], ...e });
7051
- }), p.on("view:changed", (e) => {
7051
+ }), m.on("view:changed", (e) => {
7052
7052
  this.emit("calendar-view-change", e);
7053
- }), p.on("event:*", (e, t) => {
7053
+ }), m.on("event:*", (e, t) => {
7054
7054
  this.emit(`calendar-event-${t.split(":")[1]}`, e);
7055
- }), p.on("date:selected", (e) => {
7055
+ }), m.on("date:selected", (e) => {
7056
7056
  this.emit("calendar-date-select", e);
7057
7057
  });
7058
7058
  }
@@ -7311,11 +7311,147 @@ class se extends T {
7311
7311
  justify-content: space-between;
7312
7312
  width: 100%;
7313
7313
  }
7314
-
7314
+
7315
7315
  #create-event-btn {
7316
7316
  flex: 1;
7317
7317
  }
7318
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
+ }
7319
7455
  `;
7320
7456
  }
7321
7457
  template() {
@@ -7386,11 +7522,19 @@ class se extends T {
7386
7522
  afterRender() {
7387
7523
  const e = this.$("#calendar-view-container");
7388
7524
  if (console.log("[ForceCalendar] afterRender - container:", !!e, "stateManager:", !!this.stateManager, "currentView:", this.currentView), e && this.stateManager && this.currentView) {
7389
- this._currentViewInstance && this._currentViewInstance.cleanup && this._currentViewInstance.cleanup(), console.log("[ForceCalendar] Creating view for:", this.currentView);
7390
- const i = this._createViewRenderer(this.currentView);
7391
- i && (this._currentViewInstance = i, i.stateManager = this.stateManager, i.container = e, i.render(), this.stateManager.subscribe((a, n) => {
7392
- i && i.render && i.render();
7393
- }));
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
+ }
7394
7538
  }
7395
7539
  this.$$("[data-action]").forEach((i) => {
7396
7540
  this.addListener(i, "click", this.handleNavigation);
@@ -7424,15 +7568,17 @@ class se extends T {
7424
7568
  t.addEventListener(s, i), this._listeners.push({ element: t, event: s, handler: i });
7425
7569
  },
7426
7570
  render() {
7427
- if (!this.container || !this.stateManager) return;
7571
+ if (console.log("[ViewRenderer] render called, container:", !!this.container, "stateManager:", !!this.stateManager), !this.container || !this.stateManager) return;
7428
7572
  const t = this.stateManager.getViewData();
7429
- if (!t || !t.weeks) {
7430
- this.container.innerHTML = '<div style="padding: 20px; text-align: center;">Loading calendar...</div>';
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>";
7431
7575
  return;
7432
7576
  }
7433
7577
  this.cleanup();
7434
- const s = this.stateManager.getState().config, i = this._renderMonthView(t, s);
7435
- this.container.innerHTML = i, this._attachEventHandlers();
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();
7436
7582
  },
7437
7583
  _renderMonthView(t, s) {
7438
7584
  const i = s.weekStartsOn || 0, a = [];
@@ -7441,47 +7587,25 @@ class se extends T {
7441
7587
  a.push(["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"][o]);
7442
7588
  }
7443
7589
  let n = `
7444
- <style>
7445
- .fc-month-view { display: flex; flex-direction: column; height: 100%; background: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; }
7446
- .fc-month-header { display: grid; grid-template-columns: repeat(7, 1fr); background: #fafafa; border-bottom: 1px solid #e5e7eb; }
7447
- .fc-month-header-cell { padding: 8px; text-align: left; font-weight: 600; font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
7448
- .fc-month-body { flex: 1; display: flex; flex-direction: column; }
7449
- .fc-month-week { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid #e5e7eb; }
7450
- .fc-month-week:last-child { border-bottom: none; }
7451
- .fc-month-day { background: #fff; padding: 4px; position: relative; border-right: 1px solid #e5e7eb; min-height: 80px; cursor: pointer; }
7452
- .fc-month-day:last-child { border-right: none; }
7453
- .fc-month-day:hover { background: #f9fafb; }
7454
- .fc-month-day.other-month { background: #f9fafb; }
7455
- .fc-month-day.other-month .fc-day-number { color: #d1d5db; }
7456
- .fc-month-day.today .fc-day-number { background: #ef4444; color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
7457
- .fc-day-number { font-size: 12px; font-weight: 500; color: #111827; padding: 4px; }
7458
- .fc-day-events { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
7459
- .fc-event { font-size: 11px; padding: 2px 6px; border-radius: 2px; background: #2563eb; color: white; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
7460
- .fc-event:hover { opacity: 0.9; }
7461
- .fc-more-events { font-size: 10px; color: #6b7280; padding: 2px 4px; cursor: pointer; }
7462
- .fc-more-events:hover { color: #111827; text-decoration: underline; }
7463
- </style>
7464
- <div class="fc-month-view">
7465
- <div class="fc-month-header">
7466
- ${a.map((r) => `<div class="fc-month-header-cell">${r}</div>`).join("")}
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("")}
7467
7593
  </div>
7468
- <div class="fc-month-body">
7594
+ <div class="fc-month-body" style="display: flex; flex-direction: column; flex: 1;">
7469
7595
  `;
7470
7596
  return t.weeks.forEach((r) => {
7471
- n += '<div class="fc-month-week">', r.days.forEach((o) => {
7472
- const c = ["fc-month-day"];
7473
- o.isCurrentMonth || c.push("other-month"), o.isToday && c.push("today");
7474
- const l = o.events || [], d = l.slice(0, 3), h = l.length - 3;
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;
7475
7599
  n += `
7476
- <div class="${c.join(" ")}" data-date="${o.date}">
7477
- <div class="fc-day-number">${o.dayOfMonth}</div>
7478
- <div class="fc-day-events">
7479
- ${d.map((m) => `
7480
- <div class="fc-event" data-event-id="${m.id}" style="background-color: ${m.backgroundColor || "#2563eb"}">
7481
- ${m.title}
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}
7482
7606
  </div>
7483
7607
  `).join("")}
7484
- ${h > 0 ? `<div class="fc-more-events">+${h} more</div>` : ""}
7608
+ ${x > 0 ? `<div class="fc-more-events" style="font-size: 10px; color: #6b7280; padding: 2px 4px; font-weight: 500;">+${x} more</div>` : ""}
7485
7609
  </div>
7486
7610
  </div>
7487
7611
  `;
@@ -7526,14 +7650,14 @@ class se extends T {
7526
7650
  const s = this.stateManager.state.config.locale;
7527
7651
  switch (t) {
7528
7652
  case "month":
7529
- return v.formatDate(e, "month", s);
7653
+ return b.formatDate(e, "month", s);
7530
7654
  case "week":
7531
- const i = v.startOfWeek(e), a = v.endOfWeek(e);
7532
- return v.formatDateRange(i, a, s);
7655
+ const i = b.startOfWeek(e), a = b.endOfWeek(e);
7656
+ return b.formatDateRange(i, a, s);
7533
7657
  case "day":
7534
- return v.formatDate(e, "long", s);
7658
+ return b.formatDate(e, "long", s);
7535
7659
  default:
7536
- return v.formatDate(e, "month", s);
7660
+ return b.formatDate(e, "month", s);
7537
7661
  }
7538
7662
  }
7539
7663
  getIcon(e) {
@@ -7584,15 +7708,15 @@ class se extends T {
7584
7708
  this.stateManager.today();
7585
7709
  }
7586
7710
  destroy() {
7587
- this.stateManager && this.stateManager.destroy(), p.clear(), super.cleanup();
7711
+ this.stateManager && this.stateManager.destroy(), m.clear(), super.cleanup();
7588
7712
  }
7589
7713
  }
7590
7714
  customElements.get("forcecal-main") || customElements.define("forcecal-main", se);
7591
7715
  typeof window < "u" && typeof customElements < "u" && console.log("Force Calendar Interface loading...");
7592
7716
  export {
7593
7717
  T as BaseComponent,
7594
- E as DOMUtils,
7595
- v as DateUtils,
7718
+ C as DOMUtils,
7719
+ b as DateUtils,
7596
7720
  ee as DayView,
7597
7721
  G as EventBus,
7598
7722
  se as ForceCalendar,
@@ -7600,6 +7724,6 @@ export {
7600
7724
  Q as StateManager,
7601
7725
  y as StyleUtils,
7602
7726
  X as WeekView,
7603
- p as eventBus
7727
+ m as eventBus
7604
7728
  };
7605
7729
  //# sourceMappingURL=force-calendar-interface.esm.js.map