calendarkit-prov2 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,4661 @@
1
+ import * as React15 from 'react';
2
+ import React15__default, { useState, useRef, useEffect, useCallback, useId, useMemo, useLayoutEffect } from 'react';
3
+ import { createPortal } from 'react-dom';
4
+ import { useDraggable, useSensors, useSensor, PointerSensor, DndContext, DragOverlay, useDroppable } from '@dnd-kit/core';
5
+ import { createSnapModifier, restrictToWindowEdges } from '@dnd-kit/modifiers';
6
+ import { motion, AnimatePresence } from 'framer-motion';
7
+ import { format, differenceInMinutes, subDays, addDays, differenceInMilliseconds, startOfWeek, endOfWeek, eachDayOfInterval, isSameMonth, isToday, isSameDay, startOfDay, addWeeks, addMonths, subWeeks, subMonths, startOfMonth, endOfMonth, isTomorrow } from 'date-fns';
8
+ import { cva } from 'class-variance-authority';
9
+ import { clsx } from 'clsx';
10
+ import { twMerge } from 'tailwind-merge';
11
+ import { Menu, Plus, ChevronLeft, ChevronRight, Globe, ChevronDown, Sun, Moon, CalendarDays, CalendarRange, Calendar, ListTodo, MoreHorizontal, LayoutGrid, X, Clock, Users, Paperclip, Bell, Edit3, Copy, Trash2, Edit2, MapPin, ExternalLink, AlignLeft, File, Download, BellRing, Check, Repeat, Tag } from 'lucide-react';
12
+ import { toZonedTime, fromZonedTime } from 'date-fns-tz';
13
+ import { CSS } from '@dnd-kit/utilities';
14
+ import { RRule } from 'rrule';
15
+
16
+ function cn(...inputs) {
17
+ return twMerge(clsx(inputs));
18
+ }
19
+
20
+ // src/components/ui/button.tsx
21
+ var buttonVariants = cva(
22
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
23
+ {
24
+ variants: {
25
+ variant: {
26
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
27
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
28
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
29
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
30
+ ghost: "hover:bg-accent hover:text-accent-foreground",
31
+ link: "text-primary underline-offset-4 hover:underline"
32
+ },
33
+ size: {
34
+ default: "h-10 px-4 py-2",
35
+ sm: "h-9 rounded-md px-3",
36
+ lg: "h-11 rounded-md px-8",
37
+ icon: "h-10 w-10"
38
+ }
39
+ },
40
+ defaultVariants: {
41
+ variant: "default",
42
+ size: "default"
43
+ }
44
+ }
45
+ );
46
+ var Button = React15.forwardRef(
47
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
48
+ const Comp = "button";
49
+ return /* @__PURE__ */ React15.createElement(
50
+ Comp,
51
+ {
52
+ className: cn(buttonVariants({ variant, size, className })),
53
+ ref,
54
+ ...props
55
+ }
56
+ );
57
+ }
58
+ );
59
+ Button.displayName = "Button";
60
+
61
+ // src/locales/index.ts
62
+ var LANGUAGE_META = {
63
+ tr: { native: "T\xFCrk\xE7e", english: "Turkish", flag: "\u{1F1F9}\u{1F1F7}" },
64
+ en: { native: "English", english: "English", flag: "\u{1F1EC}\u{1F1E7}" },
65
+ fr: { native: "Fran\xE7ais", english: "French", flag: "\u{1F1EB}\u{1F1F7}" },
66
+ de: { native: "Deutsch", english: "German", flag: "\u{1F1E9}\u{1F1EA}" },
67
+ es: { native: "Espa\xF1ol", english: "Spanish", flag: "\u{1F1EA}\u{1F1F8}" },
68
+ it: { native: "Italiano", english: "Italian", flag: "\u{1F1EE}\u{1F1F9}" },
69
+ pt: { native: "Portugu\xEAs", english: "Portuguese", flag: "\u{1F1E7}\u{1F1F7}" },
70
+ ar: { native: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", english: "Arabic", flag: "\u{1F1F8}\u{1F1E6}", rtl: true },
71
+ zh: { native: "\u4E2D\u6587", english: "Chinese", flag: "\u{1F1E8}\u{1F1F3}" },
72
+ ja: { native: "\u65E5\u672C\u8A9E", english: "Japanese", flag: "\u{1F1EF}\u{1F1F5}" },
73
+ ko: { native: "\uD55C\uAD6D\uC5B4", english: "Korean", flag: "\u{1F1F0}\u{1F1F7}" },
74
+ ru: { native: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439", english: "Russian", flag: "\u{1F1F7}\u{1F1FA}" },
75
+ nl: { native: "Nederlands", english: "Dutch", flag: "\u{1F1F3}\u{1F1F1}" },
76
+ pl: { native: "Polski", english: "Polish", flag: "\u{1F1F5}\u{1F1F1}" },
77
+ sv: { native: "Svenska", english: "Swedish", flag: "\u{1F1F8}\u{1F1EA}" }
78
+ };
79
+ var tr = {
80
+ today: "Bug\xFCn",
81
+ month: "Ay",
82
+ week: "Hafta",
83
+ day: "G\xFCn",
84
+ agenda: "Ajanda",
85
+ resource: "Kaynaklar",
86
+ create: "Olu\u015Ftur",
87
+ createEvent: "Etkinlik Olu\u015Ftur",
88
+ editEvent: "Etkinli\u011Fi D\xFCzenle",
89
+ newEvent: "Yeni Etkinlik",
90
+ saveChanges: "De\u011Fi\u015Fiklikleri Kaydet",
91
+ delete: "Sil",
92
+ save: "Kaydet",
93
+ cancel: "\u0130ptal",
94
+ edit: "D\xFCzenle",
95
+ duplicate: "\xC7o\u011Falt",
96
+ close: "Kapat",
97
+ moreOptions: "Daha Fazla Se\xE7enek",
98
+ addAttachment: "Dosya Y\xFCkle",
99
+ addReminder: "Ekle",
100
+ title: "Ba\u015Fl\u0131k Ekle",
101
+ addTitle: "Ba\u015Fl\u0131k Ekle",
102
+ start: "Ba\u015Flang\u0131\xE7",
103
+ end: "Biti\u015F",
104
+ allDay: "T\xFCm G\xFCn",
105
+ description: "A\xE7\u0131klama",
106
+ descriptionAndAttachments: "A\xE7\u0131klama",
107
+ addDescription: "A\xE7\u0131klama veya not ekle...",
108
+ location: "Adres Gir",
109
+ addLocation: "Konum Ekle",
110
+ locationHelpText: 'Harita olu\u015Fturmak i\xE7in fiziksel adres girin (\xF6rn. "Ba\u011Fc\u0131lar Mah. No:1").',
111
+ notes: "Notlar",
112
+ repeat: "Tekrarla",
113
+ noRepeat: "Tekrarlanm\u0131yor",
114
+ doesNotRepeat: "Tekrarlanm\u0131yor",
115
+ daily: "G\xFCnl\xFCk",
116
+ weekly: "Haftal\u0131k",
117
+ monthly: "Ayl\u0131k",
118
+ yearly: "Y\u0131ll\u0131k",
119
+ repeatFor: "Tekrar Say\u0131s\u0131",
120
+ times: "kez",
121
+ until: "\u015Eu tarihe kadar",
122
+ endRepeat: "Tekrar Biti\u015Fi",
123
+ never: "Hi\xE7bir Zaman",
124
+ afterOccurrences: "Tekrardan Sonra",
125
+ onDate: "Tarihte",
126
+ selectCalendar: "Takvim Se\xE7",
127
+ selectType: "T\xFCr Se\xE7",
128
+ calendar: "Takvim",
129
+ calendars: "Takvimler",
130
+ event: "Etkinlik",
131
+ task: "G\xF6rev",
132
+ appointmentSchedule: "Randevu Program\u0131",
133
+ new: "Yeni",
134
+ guests: "Kat\u0131l\u0131mc\u0131lar",
135
+ addGuests: "Kat\u0131l\u0131mc\u0131 Ekle",
136
+ guest: "kat\u0131l\u0131mc\u0131",
137
+ guestCount: "kat\u0131l\u0131mc\u0131",
138
+ guestsCount: "kat\u0131l\u0131mc\u0131",
139
+ guestAdded: "kat\u0131l\u0131mc\u0131 eklendi",
140
+ guestsAdded: "kat\u0131l\u0131mc\u0131 eklendi",
141
+ whosJoining: "Kim kat\u0131l\u0131yor?",
142
+ suggestedTimes: "Misafirler i\xE7in \xF6nerilen saatler",
143
+ viewSuggestions: "\xD6nerileri G\xF6r",
144
+ whereWillItBe: "Nerede olacak?",
145
+ dateAndTime: "Tarih ve Saat",
146
+ reminders: "Hat\u0131rlat\u0131c\u0131lar",
147
+ dragAndDrop: "Dosyalar\u0131 s\xFCr\xFCkle & b\u0131rak ya da",
148
+ attachments: "Ekler",
149
+ reminderAtTime: "Etkinlik saatinde",
150
+ reminder5min: "5 dakika \xF6nce",
151
+ reminder10min: "10 dakika \xF6nce",
152
+ reminder15min: "15 dakika \xF6nce",
153
+ reminder30min: "30 dakika \xF6nce",
154
+ reminder1hour: "1 saat \xF6nce",
155
+ reminder2hours: "2 saat \xF6nce",
156
+ reminder1day: "1 g\xFCn \xF6nce",
157
+ reminder2days: "2 g\xFCn \xF6nce",
158
+ reminder1week: "1 hafta \xF6nce",
159
+ tomorrow: "Yar\u0131n",
160
+ eventCount: "etkinlik",
161
+ eventsCount: "etkinlik",
162
+ timezone: "Zaman Dilimi",
163
+ localTime: "Yerel Saat",
164
+ search: "Etkinlik ara...",
165
+ allTypes: "T\xFCm T\xFCrler",
166
+ noTitle: "(Ba\u015Fl\u0131ks\u0131z)",
167
+ copy: "(Kopya)",
168
+ clickToOpenInMaps: "Haritada a\xE7mak i\xE7in t\u0131klay\u0131n"
169
+ };
170
+ var en = {
171
+ today: "Today",
172
+ month: "Month",
173
+ week: "Week",
174
+ day: "Day",
175
+ agenda: "Agenda",
176
+ resource: "Resources",
177
+ create: "Create",
178
+ createEvent: "Create Event",
179
+ editEvent: "Edit Event",
180
+ newEvent: "New Event",
181
+ saveChanges: "Save Changes",
182
+ delete: "Delete",
183
+ save: "Save",
184
+ cancel: "Cancel",
185
+ edit: "Edit",
186
+ duplicate: "Duplicate",
187
+ close: "Close",
188
+ moreOptions: "More options",
189
+ addAttachment: "Upload files",
190
+ addReminder: "Add",
191
+ title: "Add title",
192
+ addTitle: "Add title",
193
+ start: "Start",
194
+ end: "End",
195
+ allDay: "All Day",
196
+ description: "Description",
197
+ descriptionAndAttachments: "Description",
198
+ addDescription: "Add description or notes...",
199
+ location: "Enter address",
200
+ addLocation: "Add location",
201
+ locationHelpText: 'Enter a physical address (e.g. "123 Main St") to generate the map.',
202
+ notes: "Notes",
203
+ repeat: "Repeat",
204
+ noRepeat: "Does not repeat",
205
+ doesNotRepeat: "Does not repeat",
206
+ daily: "Daily",
207
+ weekly: "Weekly",
208
+ monthly: "Monthly",
209
+ yearly: "Yearly",
210
+ repeatFor: "Repeat for",
211
+ times: "times",
212
+ until: "Until",
213
+ endRepeat: "End repeat",
214
+ never: "Never",
215
+ afterOccurrences: "After occurrences",
216
+ onDate: "On date",
217
+ selectCalendar: "Select Calendar",
218
+ selectType: "Select Type",
219
+ calendar: "Calendar",
220
+ calendars: "Calendars",
221
+ event: "Event",
222
+ task: "Task",
223
+ appointmentSchedule: "Appointment schedule",
224
+ new: "New",
225
+ guests: "Guests",
226
+ addGuests: "Add guests",
227
+ guest: "guest",
228
+ guestCount: "guest",
229
+ guestsCount: "guests",
230
+ guestAdded: "guest added",
231
+ guestsAdded: "guests added",
232
+ whosJoining: "Who's joining?",
233
+ suggestedTimes: "Suggested times for guests",
234
+ viewSuggestions: "View suggestions",
235
+ whereWillItBe: "Where will it be?",
236
+ dateAndTime: "Date & Time",
237
+ reminders: "Reminders",
238
+ dragAndDrop: "Drag & drop files or",
239
+ attachments: "Attachments",
240
+ reminderAtTime: "At time of event",
241
+ reminder5min: "5 minutes before",
242
+ reminder10min: "10 minutes before",
243
+ reminder15min: "15 minutes before",
244
+ reminder30min: "30 minutes before",
245
+ reminder1hour: "1 hour before",
246
+ reminder2hours: "2 hours before",
247
+ reminder1day: "1 day before",
248
+ reminder2days: "2 days before",
249
+ reminder1week: "1 week before",
250
+ tomorrow: "Tomorrow",
251
+ eventCount: "event",
252
+ eventsCount: "events",
253
+ timezone: "Time zone",
254
+ localTime: "Local Time",
255
+ search: "Search events...",
256
+ allTypes: "All Types",
257
+ noTitle: "(No title)",
258
+ copy: "(Copy)",
259
+ clickToOpenInMaps: "Click to open in maps"
260
+ };
261
+ var fr = {
262
+ today: "Aujourd'hui",
263
+ month: "Mois",
264
+ week: "Semaine",
265
+ day: "Jour",
266
+ agenda: "Agenda",
267
+ resource: "Ressources",
268
+ create: "Cr\xE9er",
269
+ createEvent: "Cr\xE9er un \xE9v\xE9nement",
270
+ editEvent: "Modifier l'\xE9v\xE9nement",
271
+ newEvent: "Nouvel \xE9v\xE9nement",
272
+ saveChanges: "Enregistrer les modifications",
273
+ delete: "Supprimer",
274
+ save: "Enregistrer",
275
+ cancel: "Annuler",
276
+ edit: "Modifier",
277
+ duplicate: "Dupliquer",
278
+ close: "Fermer",
279
+ moreOptions: "Plus d'options",
280
+ addAttachment: "T\xE9l\xE9charger des fichiers",
281
+ addReminder: "Ajouter",
282
+ title: "Ajouter un titre",
283
+ addTitle: "Ajouter un titre",
284
+ start: "D\xE9but",
285
+ end: "Fin",
286
+ allDay: "Toute la journ\xE9e",
287
+ description: "Description",
288
+ descriptionAndAttachments: "Description",
289
+ addDescription: "Ajouter une description ou des notes...",
290
+ location: "Entrer une adresse",
291
+ addLocation: "Ajouter un lieu",
292
+ locationHelpText: 'Entrez une adresse physique (ex: "123 Rue Principale") pour g\xE9n\xE9rer la carte.',
293
+ notes: "Notes",
294
+ repeat: "R\xE9p\xE9ter",
295
+ noRepeat: "Ne se r\xE9p\xE8te pas",
296
+ doesNotRepeat: "Ne se r\xE9p\xE8te pas",
297
+ daily: "Quotidien",
298
+ weekly: "Hebdomadaire",
299
+ monthly: "Mensuel",
300
+ yearly: "Annuel",
301
+ repeatFor: "R\xE9p\xE9ter pendant",
302
+ times: "fois",
303
+ until: "Jusqu'au",
304
+ endRepeat: "Fin de r\xE9p\xE9tition",
305
+ never: "Jamais",
306
+ afterOccurrences: "Apr\xE8s occurrences",
307
+ onDate: "\xC0 la date",
308
+ selectCalendar: "S\xE9lectionner un calendrier",
309
+ selectType: "S\xE9lectionner un type",
310
+ calendar: "Calendrier",
311
+ calendars: "Calendriers",
312
+ event: "\xC9v\xE9nement",
313
+ task: "T\xE2che",
314
+ appointmentSchedule: "Planning de rendez-vous",
315
+ new: "Nouveau",
316
+ guests: "Invit\xE9s",
317
+ addGuests: "Ajouter des invit\xE9s",
318
+ guest: "invit\xE9",
319
+ guestCount: "invit\xE9",
320
+ guestsCount: "invit\xE9s",
321
+ guestAdded: "invit\xE9 ajout\xE9",
322
+ guestsAdded: "invit\xE9s ajout\xE9s",
323
+ whosJoining: "Qui participe ?",
324
+ suggestedTimes: "Horaires sugg\xE9r\xE9s pour les invit\xE9s",
325
+ viewSuggestions: "Voir les suggestions",
326
+ whereWillItBe: "O\xF9 aura lieu ?",
327
+ dateAndTime: "Date et heure",
328
+ reminders: "Rappels",
329
+ dragAndDrop: "Glisser-d\xE9poser des fichiers ou",
330
+ attachments: "Pi\xE8ces jointes",
331
+ reminderAtTime: "\xC0 l'heure de l'\xE9v\xE9nement",
332
+ reminder5min: "5 minutes avant",
333
+ reminder10min: "10 minutes avant",
334
+ reminder15min: "15 minutes avant",
335
+ reminder30min: "30 minutes avant",
336
+ reminder1hour: "1 heure avant",
337
+ reminder2hours: "2 heures avant",
338
+ reminder1day: "1 jour avant",
339
+ reminder2days: "2 jours avant",
340
+ reminder1week: "1 semaine avant",
341
+ tomorrow: "Demain",
342
+ eventCount: "\xE9v\xE9nement",
343
+ eventsCount: "\xE9v\xE9nements",
344
+ timezone: "Fuseau horaire",
345
+ localTime: "Heure locale",
346
+ search: "Rechercher des \xE9v\xE9nements...",
347
+ allTypes: "Tous les types",
348
+ noTitle: "(Sans titre)",
349
+ copy: "(Copie)",
350
+ clickToOpenInMaps: "Cliquer pour ouvrir dans la carte"
351
+ };
352
+ var de = {
353
+ today: "Heute",
354
+ month: "Monat",
355
+ week: "Woche",
356
+ day: "Tag",
357
+ agenda: "Agenda",
358
+ resource: "Ressourcen",
359
+ create: "Erstellen",
360
+ createEvent: "Termin erstellen",
361
+ editEvent: "Termin bearbeiten",
362
+ newEvent: "Neuer Termin",
363
+ saveChanges: "\xC4nderungen speichern",
364
+ delete: "L\xF6schen",
365
+ save: "Speichern",
366
+ cancel: "Abbrechen",
367
+ edit: "Bearbeiten",
368
+ duplicate: "Duplizieren",
369
+ close: "Schlie\xDFen",
370
+ moreOptions: "Weitere Optionen",
371
+ addAttachment: "Dateien hochladen",
372
+ addReminder: "Hinzuf\xFCgen",
373
+ title: "Titel hinzuf\xFCgen",
374
+ addTitle: "Titel hinzuf\xFCgen",
375
+ start: "Beginn",
376
+ end: "Ende",
377
+ allDay: "Ganzt\xE4gig",
378
+ description: "Beschreibung",
379
+ descriptionAndAttachments: "Beschreibung",
380
+ addDescription: "Beschreibung oder Notizen hinzuf\xFCgen...",
381
+ location: "Adresse eingeben",
382
+ addLocation: "Ort hinzuf\xFCgen",
383
+ locationHelpText: 'Geben Sie eine physische Adresse ein (z.B. "Musterstra\xDFe 1"), um die Karte zu generieren.',
384
+ notes: "Notizen",
385
+ repeat: "Wiederholen",
386
+ noRepeat: "Wiederholt sich nicht",
387
+ doesNotRepeat: "Wiederholt sich nicht",
388
+ daily: "T\xE4glich",
389
+ weekly: "W\xF6chentlich",
390
+ monthly: "Monatlich",
391
+ yearly: "J\xE4hrlich",
392
+ repeatFor: "Wiederholen f\xFCr",
393
+ times: "Mal",
394
+ until: "Bis",
395
+ endRepeat: "Wiederholung beenden",
396
+ never: "Nie",
397
+ afterOccurrences: "Nach Wiederholungen",
398
+ onDate: "Am Datum",
399
+ selectCalendar: "Kalender ausw\xE4hlen",
400
+ selectType: "Typ ausw\xE4hlen",
401
+ calendar: "Kalender",
402
+ calendars: "Kalender",
403
+ event: "Termin",
404
+ task: "Aufgabe",
405
+ appointmentSchedule: "Terminplan",
406
+ new: "Neu",
407
+ guests: "G\xE4ste",
408
+ addGuests: "G\xE4ste hinzuf\xFCgen",
409
+ guest: "Gast",
410
+ guestCount: "Gast",
411
+ guestsCount: "G\xE4ste",
412
+ guestAdded: "Gast hinzugef\xFCgt",
413
+ guestsAdded: "G\xE4ste hinzugef\xFCgt",
414
+ whosJoining: "Wer nimmt teil?",
415
+ suggestedTimes: "Vorgeschlagene Zeiten f\xFCr G\xE4ste",
416
+ viewSuggestions: "Vorschl\xE4ge anzeigen",
417
+ whereWillItBe: "Wo findet es statt?",
418
+ dateAndTime: "Datum und Uhrzeit",
419
+ reminders: "Erinnerungen",
420
+ dragAndDrop: "Dateien hineinziehen oder",
421
+ attachments: "Anh\xE4nge",
422
+ reminderAtTime: "Zum Zeitpunkt des Termins",
423
+ reminder5min: "5 Minuten vorher",
424
+ reminder10min: "10 Minuten vorher",
425
+ reminder15min: "15 Minuten vorher",
426
+ reminder30min: "30 Minuten vorher",
427
+ reminder1hour: "1 Stunde vorher",
428
+ reminder2hours: "2 Stunden vorher",
429
+ reminder1day: "1 Tag vorher",
430
+ reminder2days: "2 Tage vorher",
431
+ reminder1week: "1 Woche vorher",
432
+ tomorrow: "Morgen",
433
+ eventCount: "Termin",
434
+ eventsCount: "Termine",
435
+ timezone: "Zeitzone",
436
+ localTime: "Ortszeit",
437
+ search: "Termine suchen...",
438
+ allTypes: "Alle Typen",
439
+ noTitle: "(Kein Titel)",
440
+ copy: "(Kopie)",
441
+ clickToOpenInMaps: "Klicken, um in der Karte zu \xF6ffnen"
442
+ };
443
+ var es = {
444
+ today: "Hoy",
445
+ month: "Mes",
446
+ week: "Semana",
447
+ day: "D\xEDa",
448
+ agenda: "Agenda",
449
+ resource: "Recursos",
450
+ create: "Crear",
451
+ createEvent: "Crear evento",
452
+ editEvent: "Editar evento",
453
+ newEvent: "Nuevo evento",
454
+ saveChanges: "Guardar cambios",
455
+ delete: "Eliminar",
456
+ save: "Guardar",
457
+ cancel: "Cancelar",
458
+ edit: "Editar",
459
+ duplicate: "Duplicar",
460
+ close: "Cerrar",
461
+ moreOptions: "M\xE1s opciones",
462
+ addAttachment: "Subir archivos",
463
+ addReminder: "Agregar",
464
+ title: "Agregar t\xEDtulo",
465
+ addTitle: "Agregar t\xEDtulo",
466
+ start: "Inicio",
467
+ end: "Fin",
468
+ allDay: "Todo el d\xEDa",
469
+ description: "Descripci\xF3n",
470
+ descriptionAndAttachments: "Descripci\xF3n",
471
+ addDescription: "Agregar descripci\xF3n o notas...",
472
+ location: "Ingresar direcci\xF3n",
473
+ addLocation: "Agregar ubicaci\xF3n",
474
+ locationHelpText: 'Ingrese una direcci\xF3n f\xEDsica (ej. "Calle Principal 123") para generar el mapa.',
475
+ notes: "Notas",
476
+ repeat: "Repetir",
477
+ noRepeat: "No se repite",
478
+ doesNotRepeat: "No se repite",
479
+ daily: "Diario",
480
+ weekly: "Semanal",
481
+ monthly: "Mensual",
482
+ yearly: "Anual",
483
+ repeatFor: "Repetir por",
484
+ times: "veces",
485
+ until: "Hasta",
486
+ endRepeat: "Fin de repetici\xF3n",
487
+ never: "Nunca",
488
+ afterOccurrences: "Despu\xE9s de ocurrencias",
489
+ onDate: "En fecha",
490
+ selectCalendar: "Seleccionar calendario",
491
+ selectType: "Seleccionar tipo",
492
+ calendar: "Calendario",
493
+ calendars: "Calendarios",
494
+ event: "Evento",
495
+ task: "Tarea",
496
+ appointmentSchedule: "Horario de citas",
497
+ new: "Nuevo",
498
+ guests: "Invitados",
499
+ addGuests: "Agregar invitados",
500
+ guest: "invitado",
501
+ guestCount: "invitado",
502
+ guestsCount: "invitados",
503
+ guestAdded: "invitado agregado",
504
+ guestsAdded: "invitados agregados",
505
+ whosJoining: "\xBFQui\xE9n se une?",
506
+ suggestedTimes: "Horarios sugeridos para invitados",
507
+ viewSuggestions: "Ver sugerencias",
508
+ whereWillItBe: "\xBFD\xF3nde ser\xE1?",
509
+ dateAndTime: "Fecha y hora",
510
+ reminders: "Recordatorios",
511
+ dragAndDrop: "Arrastra y suelta archivos o",
512
+ attachments: "Adjuntos",
513
+ reminderAtTime: "A la hora del evento",
514
+ reminder5min: "5 minutos antes",
515
+ reminder10min: "10 minutos antes",
516
+ reminder15min: "15 minutos antes",
517
+ reminder30min: "30 minutos antes",
518
+ reminder1hour: "1 hora antes",
519
+ reminder2hours: "2 horas antes",
520
+ reminder1day: "1 d\xEDa antes",
521
+ reminder2days: "2 d\xEDas antes",
522
+ reminder1week: "1 semana antes",
523
+ tomorrow: "Ma\xF1ana",
524
+ eventCount: "evento",
525
+ eventsCount: "eventos",
526
+ timezone: "Zona horaria",
527
+ localTime: "Hora local",
528
+ search: "Buscar eventos...",
529
+ allTypes: "Todos los tipos",
530
+ noTitle: "(Sin t\xEDtulo)",
531
+ copy: "(Copia)",
532
+ clickToOpenInMaps: "Haga clic para abrir en el mapa"
533
+ };
534
+ var it = {
535
+ today: "Oggi",
536
+ month: "Mese",
537
+ week: "Settimana",
538
+ day: "Giorno",
539
+ agenda: "Agenda",
540
+ resource: "Risorse",
541
+ create: "Crea",
542
+ createEvent: "Crea evento",
543
+ editEvent: "Modifica evento",
544
+ newEvent: "Nuovo evento",
545
+ saveChanges: "Salva modifiche",
546
+ delete: "Elimina",
547
+ save: "Salva",
548
+ cancel: "Annulla",
549
+ edit: "Modifica",
550
+ duplicate: "Duplica",
551
+ close: "Chiudi",
552
+ moreOptions: "Altre opzioni",
553
+ addAttachment: "Carica file",
554
+ addReminder: "Aggiungi",
555
+ title: "Aggiungi titolo",
556
+ addTitle: "Aggiungi titolo",
557
+ start: "Inizio",
558
+ end: "Fine",
559
+ allDay: "Tutto il giorno",
560
+ description: "Descrizione",
561
+ descriptionAndAttachments: "Descrizione",
562
+ addDescription: "Aggiungi descrizione o note...",
563
+ location: "Inserisci indirizzo",
564
+ addLocation: "Aggiungi luogo",
565
+ locationHelpText: 'Inserire un indirizzo fisico (es. "Via Roma 1") per generare la mappa.',
566
+ notes: "Note",
567
+ repeat: "Ripeti",
568
+ noRepeat: "Non si ripete",
569
+ doesNotRepeat: "Non si ripete",
570
+ daily: "Giornaliero",
571
+ weekly: "Settimanale",
572
+ monthly: "Mensile",
573
+ yearly: "Annuale",
574
+ repeatFor: "Ripeti per",
575
+ times: "volte",
576
+ until: "Fino a",
577
+ endRepeat: "Fine ripetizione",
578
+ never: "Mai",
579
+ afterOccurrences: "Dopo occorrenze",
580
+ onDate: "Alla data",
581
+ selectCalendar: "Seleziona calendario",
582
+ selectType: "Seleziona tipo",
583
+ calendar: "Calendario",
584
+ calendars: "Calendari",
585
+ event: "Evento",
586
+ task: "Attivit\xE0",
587
+ appointmentSchedule: "Programma appuntamenti",
588
+ new: "Nuovo",
589
+ guests: "Ospiti",
590
+ addGuests: "Aggiungi ospiti",
591
+ guest: "ospite",
592
+ guestCount: "ospite",
593
+ guestsCount: "ospiti",
594
+ guestAdded: "ospite aggiunto",
595
+ guestsAdded: "ospiti aggiunti",
596
+ whosJoining: "Chi partecipa?",
597
+ suggestedTimes: "Orari suggeriti per gli ospiti",
598
+ viewSuggestions: "Vedi suggerimenti",
599
+ whereWillItBe: "Dove si terr\xE0?",
600
+ dateAndTime: "Data e ora",
601
+ reminders: "Promemoria",
602
+ dragAndDrop: "Trascina e rilascia i file o",
603
+ attachments: "Allegati",
604
+ reminderAtTime: "All'ora dell'evento",
605
+ reminder5min: "5 minuti prima",
606
+ reminder10min: "10 minuti prima",
607
+ reminder15min: "15 minuti prima",
608
+ reminder30min: "30 minuti prima",
609
+ reminder1hour: "1 ora prima",
610
+ reminder2hours: "2 ore prima",
611
+ reminder1day: "1 giorno prima",
612
+ reminder2days: "2 giorni prima",
613
+ reminder1week: "1 settimana prima",
614
+ tomorrow: "Domani",
615
+ eventCount: "evento",
616
+ eventsCount: "eventi",
617
+ timezone: "Fuso orario",
618
+ localTime: "Ora locale",
619
+ search: "Cerca eventi...",
620
+ allTypes: "Tutti i tipi",
621
+ noTitle: "(Senza titolo)",
622
+ copy: "(Copia)",
623
+ clickToOpenInMaps: "Clicca per aprire nella mappa"
624
+ };
625
+ var pt = {
626
+ today: "Hoje",
627
+ month: "M\xEAs",
628
+ week: "Semana",
629
+ day: "Dia",
630
+ agenda: "Agenda",
631
+ resource: "Recursos",
632
+ create: "Criar",
633
+ createEvent: "Criar evento",
634
+ editEvent: "Editar evento",
635
+ newEvent: "Novo evento",
636
+ saveChanges: "Salvar altera\xE7\xF5es",
637
+ delete: "Excluir",
638
+ save: "Salvar",
639
+ cancel: "Cancelar",
640
+ edit: "Editar",
641
+ duplicate: "Duplicar",
642
+ close: "Fechar",
643
+ moreOptions: "Mais op\xE7\xF5es",
644
+ addAttachment: "Enviar arquivos",
645
+ addReminder: "Adicionar",
646
+ title: "Adicionar t\xEDtulo",
647
+ addTitle: "Adicionar t\xEDtulo",
648
+ start: "In\xEDcio",
649
+ end: "Fim",
650
+ allDay: "Dia inteiro",
651
+ description: "Descri\xE7\xE3o",
652
+ descriptionAndAttachments: "Descri\xE7\xE3o",
653
+ addDescription: "Adicionar descri\xE7\xE3o ou notas...",
654
+ location: "Inserir endere\xE7o",
655
+ addLocation: "Adicionar local",
656
+ locationHelpText: 'Insira um endere\xE7o f\xEDsico (ex. "Rua Principal, 123") para gerar o mapa.',
657
+ notes: "Notas",
658
+ repeat: "Repetir",
659
+ noRepeat: "N\xE3o se repete",
660
+ doesNotRepeat: "N\xE3o se repete",
661
+ daily: "Di\xE1rio",
662
+ weekly: "Semanal",
663
+ monthly: "Mensal",
664
+ yearly: "Anual",
665
+ repeatFor: "Repetir por",
666
+ times: "vezes",
667
+ until: "At\xE9",
668
+ endRepeat: "Fim da repeti\xE7\xE3o",
669
+ never: "Nunca",
670
+ afterOccurrences: "Ap\xF3s ocorr\xEAncias",
671
+ onDate: "Na data",
672
+ selectCalendar: "Selecionar calend\xE1rio",
673
+ selectType: "Selecionar tipo",
674
+ calendar: "Calend\xE1rio",
675
+ calendars: "Calend\xE1rios",
676
+ event: "Evento",
677
+ task: "Tarefa",
678
+ appointmentSchedule: "Agenda de compromissos",
679
+ new: "Novo",
680
+ guests: "Convidados",
681
+ addGuests: "Adicionar convidados",
682
+ guest: "convidado",
683
+ guestCount: "convidado",
684
+ guestsCount: "convidados",
685
+ guestAdded: "convidado adicionado",
686
+ guestsAdded: "convidados adicionados",
687
+ whosJoining: "Quem vai participar?",
688
+ suggestedTimes: "Hor\xE1rios sugeridos para convidados",
689
+ viewSuggestions: "Ver sugest\xF5es",
690
+ whereWillItBe: "Onde ser\xE1?",
691
+ dateAndTime: "Data e hora",
692
+ reminders: "Lembretes",
693
+ dragAndDrop: "Arraste e solte arquivos ou",
694
+ attachments: "Anexos",
695
+ reminderAtTime: "No hor\xE1rio do evento",
696
+ reminder5min: "5 minutos antes",
697
+ reminder10min: "10 minutos antes",
698
+ reminder15min: "15 minutos antes",
699
+ reminder30min: "30 minutos antes",
700
+ reminder1hour: "1 hora antes",
701
+ reminder2hours: "2 horas antes",
702
+ reminder1day: "1 dia antes",
703
+ reminder2days: "2 dias antes",
704
+ reminder1week: "1 semana antes",
705
+ tomorrow: "Amanh\xE3",
706
+ eventCount: "evento",
707
+ eventsCount: "eventos",
708
+ timezone: "Fuso hor\xE1rio",
709
+ localTime: "Hora local",
710
+ search: "Buscar eventos...",
711
+ allTypes: "Todos os tipos",
712
+ noTitle: "(Sem t\xEDtulo)",
713
+ copy: "(C\xF3pia)",
714
+ clickToOpenInMaps: "Clique para abrir no mapa"
715
+ };
716
+ var ar = {
717
+ today: "\u0627\u0644\u064A\u0648\u0645",
718
+ month: "\u0634\u0647\u0631",
719
+ week: "\u0623\u0633\u0628\u0648\u0639",
720
+ day: "\u064A\u0648\u0645",
721
+ agenda: "\u062C\u062F\u0648\u0644 \u0627\u0644\u0623\u0639\u0645\u0627\u0644",
722
+ resource: "\u0627\u0644\u0645\u0648\u0627\u0631\u062F",
723
+ create: "\u0625\u0646\u0634\u0627\u0621",
724
+ createEvent: "\u0625\u0646\u0634\u0627\u0621 \u062D\u062F\u062B",
725
+ editEvent: "\u062A\u0639\u062F\u064A\u0644 \u0627\u0644\u062D\u062F\u062B",
726
+ newEvent: "\u062D\u062F\u062B \u062C\u062F\u064A\u062F",
727
+ saveChanges: "\u062D\u0641\u0638 \u0627\u0644\u062A\u063A\u064A\u064A\u0631\u0627\u062A",
728
+ delete: "\u062D\u0630\u0641",
729
+ save: "\u062D\u0641\u0638",
730
+ cancel: "\u0625\u0644\u063A\u0627\u0621",
731
+ edit: "\u062A\u0639\u062F\u064A\u0644",
732
+ duplicate: "\u062A\u0643\u0631\u0627\u0631",
733
+ close: "\u0625\u063A\u0644\u0627\u0642",
734
+ moreOptions: "\u0627\u0644\u0645\u0632\u064A\u062F \u0645\u0646 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A",
735
+ addAttachment: "\u0631\u0641\u0639 \u0645\u0644\u0641\u0627\u062A",
736
+ addReminder: "\u0625\u0636\u0627\u0641\u0629",
737
+ title: "\u0625\u0636\u0627\u0641\u0629 \u0639\u0646\u0648\u0627\u0646",
738
+ addTitle: "\u0625\u0636\u0627\u0641\u0629 \u0639\u0646\u0648\u0627\u0646",
739
+ start: "\u0627\u0644\u0628\u062F\u0627\u064A\u0629",
740
+ end: "\u0627\u0644\u0646\u0647\u0627\u064A\u0629",
741
+ allDay: "\u0637\u0648\u0627\u0644 \u0627\u0644\u064A\u0648\u0645",
742
+ description: "\u0627\u0644\u0648\u0635\u0641",
743
+ descriptionAndAttachments: "\u0627\u0644\u0648\u0635\u0641",
744
+ addDescription: "\u0625\u0636\u0627\u0641\u0629 \u0648\u0635\u0641 \u0623\u0648 \u0645\u0644\u0627\u062D\u0638\u0627\u062A...",
745
+ location: "\u0625\u062F\u062E\u0627\u0644 \u0627\u0644\u0639\u0646\u0648\u0627\u0646",
746
+ addLocation: "\u0625\u0636\u0627\u0641\u0629 \u0645\u0648\u0642\u0639",
747
+ locationHelpText: '\u0623\u062F\u062E\u0644 \u0639\u0646\u0648\u0627\u0646\u064B\u0627 \u0641\u0639\u0644\u064A\u064B\u0627 (\u0645\u062B\u0644 "\u0634\u0627\u0631\u0639 \u0627\u0644\u0645\u0644\u0643 \u0641\u0647\u062F 1") \u0644\u0625\u0646\u0634\u0627\u0621 \u0627\u0644\u062E\u0631\u064A\u0637\u0629.',
748
+ notes: "\u0645\u0644\u0627\u062D\u0638\u0627\u062A",
749
+ repeat: "\u062A\u0643\u0631\u0627\u0631",
750
+ noRepeat: "\u0644\u0627 \u064A\u062A\u0643\u0631\u0631",
751
+ doesNotRepeat: "\u0644\u0627 \u064A\u062A\u0643\u0631\u0631",
752
+ daily: "\u064A\u0648\u0645\u064A",
753
+ weekly: "\u0623\u0633\u0628\u0648\u0639\u064A",
754
+ monthly: "\u0634\u0647\u0631\u064A",
755
+ yearly: "\u0633\u0646\u0648\u064A",
756
+ repeatFor: "\u062A\u0643\u0631\u0627\u0631 \u0644\u0640",
757
+ times: "\u0645\u0631\u0627\u062A",
758
+ until: "\u062D\u062A\u0649",
759
+ endRepeat: "\u0646\u0647\u0627\u064A\u0629 \u0627\u0644\u062A\u0643\u0631\u0627\u0631",
760
+ never: "\u0623\u0628\u062F\u064B\u0627",
761
+ afterOccurrences: "\u0628\u0639\u062F \u0627\u0644\u062A\u0643\u0631\u0627\u0631\u0627\u062A",
762
+ onDate: "\u0641\u064A \u0627\u0644\u062A\u0627\u0631\u064A\u062E",
763
+ selectCalendar: "\u0627\u062E\u062A\u0631 \u0627\u0644\u062A\u0642\u0648\u064A\u0645",
764
+ selectType: "\u0627\u062E\u062A\u0631 \u0627\u0644\u0646\u0648\u0639",
765
+ calendar: "\u0627\u0644\u062A\u0642\u0648\u064A\u0645",
766
+ calendars: "\u0627\u0644\u062A\u0642\u0627\u0648\u064A\u0645",
767
+ event: "\u062D\u062F\u062B",
768
+ task: "\u0645\u0647\u0645\u0629",
769
+ appointmentSchedule: "\u062C\u062F\u0648\u0644 \u0627\u0644\u0645\u0648\u0627\u0639\u064A\u062F",
770
+ new: "\u062C\u062F\u064A\u062F",
771
+ guests: "\u0627\u0644\u0636\u064A\u0648\u0641",
772
+ addGuests: "\u0625\u0636\u0627\u0641\u0629 \u0636\u064A\u0648\u0641",
773
+ guest: "\u0636\u064A\u0641",
774
+ guestCount: "\u0636\u064A\u0641",
775
+ guestsCount: "\u0636\u064A\u0648\u0641",
776
+ guestAdded: "\u0636\u064A\u0641 \u0645\u0636\u0627\u0641",
777
+ guestsAdded: "\u0636\u064A\u0648\u0641 \u0645\u0636\u0627\u0641\u0648\u0646",
778
+ whosJoining: "\u0645\u0646 \u0633\u064A\u0646\u0636\u0645\u061F",
779
+ suggestedTimes: "\u0627\u0644\u0623\u0648\u0642\u0627\u062A \u0627\u0644\u0645\u0642\u062A\u0631\u062D\u0629 \u0644\u0644\u0636\u064A\u0648\u0641",
780
+ viewSuggestions: "\u0639\u0631\u0636 \u0627\u0644\u0627\u0642\u062A\u0631\u0627\u062D\u0627\u062A",
781
+ whereWillItBe: "\u0623\u064A\u0646 \u0633\u064A\u0643\u0648\u0646\u061F",
782
+ dateAndTime: "\u0627\u0644\u062A\u0627\u0631\u064A\u062E \u0648\u0627\u0644\u0648\u0642\u062A",
783
+ reminders: "\u0627\u0644\u062A\u0630\u0643\u064A\u0631\u0627\u062A",
784
+ dragAndDrop: "\u0627\u0633\u062D\u0628 \u0648\u0623\u0641\u0644\u062A \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0623\u0648",
785
+ attachments: "\u0627\u0644\u0645\u0631\u0641\u0642\u0627\u062A",
786
+ reminderAtTime: "\u0639\u0646\u062F \u0648\u0642\u062A \u0627\u0644\u062D\u062F\u062B",
787
+ reminder5min: "\u0642\u0628\u0644 5 \u062F\u0642\u0627\u0626\u0642",
788
+ reminder10min: "\u0642\u0628\u0644 10 \u062F\u0642\u0627\u0626\u0642",
789
+ reminder15min: "\u0642\u0628\u0644 15 \u062F\u0642\u064A\u0642\u0629",
790
+ reminder30min: "\u0642\u0628\u0644 30 \u062F\u0642\u064A\u0642\u0629",
791
+ reminder1hour: "\u0642\u0628\u0644 \u0633\u0627\u0639\u0629",
792
+ reminder2hours: "\u0642\u0628\u0644 \u0633\u0627\u0639\u062A\u064A\u0646",
793
+ reminder1day: "\u0642\u0628\u0644 \u064A\u0648\u0645",
794
+ reminder2days: "\u0642\u0628\u0644 \u064A\u0648\u0645\u064A\u0646",
795
+ reminder1week: "\u0642\u0628\u0644 \u0623\u0633\u0628\u0648\u0639",
796
+ tomorrow: "\u063A\u062F\u064B\u0627",
797
+ eventCount: "\u062D\u062F\u062B",
798
+ eventsCount: "\u0623\u062D\u062F\u0627\u062B",
799
+ timezone: "\u0627\u0644\u0645\u0646\u0637\u0642\u0629 \u0627\u0644\u0632\u0645\u0646\u064A\u0629",
800
+ localTime: "\u0627\u0644\u062A\u0648\u0642\u064A\u062A \u0627\u0644\u0645\u062D\u0644\u064A",
801
+ search: "\u0627\u0644\u0628\u062D\u062B \u0639\u0646 \u0623\u062D\u062F\u0627\u062B...",
802
+ allTypes: "\u062C\u0645\u064A\u0639 \u0627\u0644\u0623\u0646\u0648\u0627\u0639",
803
+ noTitle: "(\u0628\u062F\u0648\u0646 \u0639\u0646\u0648\u0627\u0646)",
804
+ copy: "(\u0646\u0633\u062E\u0629)",
805
+ clickToOpenInMaps: "\u0627\u0646\u0642\u0631 \u0644\u0644\u0641\u062A\u062D \u0641\u064A \u0627\u0644\u062E\u0631\u064A\u0637\u0629"
806
+ };
807
+ var zh = {
808
+ today: "\u4ECA\u5929",
809
+ month: "\u6708",
810
+ week: "\u5468",
811
+ day: "\u5929",
812
+ agenda: "\u8BAE\u7A0B",
813
+ resource: "\u8D44\u6E90",
814
+ create: "\u521B\u5EFA",
815
+ createEvent: "\u521B\u5EFA\u6D3B\u52A8",
816
+ editEvent: "\u7F16\u8F91\u6D3B\u52A8",
817
+ newEvent: "\u65B0\u6D3B\u52A8",
818
+ saveChanges: "\u4FDD\u5B58\u66F4\u6539",
819
+ delete: "\u5220\u9664",
820
+ save: "\u4FDD\u5B58",
821
+ cancel: "\u53D6\u6D88",
822
+ edit: "\u7F16\u8F91",
823
+ duplicate: "\u590D\u5236",
824
+ close: "\u5173\u95ED",
825
+ moreOptions: "\u66F4\u591A\u9009\u9879",
826
+ addAttachment: "\u4E0A\u4F20\u6587\u4EF6",
827
+ addReminder: "\u6DFB\u52A0",
828
+ title: "\u6DFB\u52A0\u6807\u9898",
829
+ addTitle: "\u6DFB\u52A0\u6807\u9898",
830
+ start: "\u5F00\u59CB",
831
+ end: "\u7ED3\u675F",
832
+ allDay: "\u5168\u5929",
833
+ description: "\u63CF\u8FF0",
834
+ descriptionAndAttachments: "\u63CF\u8FF0",
835
+ addDescription: "\u6DFB\u52A0\u63CF\u8FF0\u6216\u5907\u6CE8...",
836
+ location: "\u8F93\u5165\u5730\u5740",
837
+ addLocation: "\u6DFB\u52A0\u5730\u70B9",
838
+ locationHelpText: '\u8F93\u5165\u5B9E\u9645\u5730\u5740\uFF08\u4F8B\u5982"\u5317\u4EAC\u5E02\u671D\u9633\u533A1\u53F7"\uFF09\u4EE5\u751F\u6210\u5730\u56FE\u3002',
839
+ notes: "\u5907\u6CE8",
840
+ repeat: "\u91CD\u590D",
841
+ noRepeat: "\u4E0D\u91CD\u590D",
842
+ doesNotRepeat: "\u4E0D\u91CD\u590D",
843
+ daily: "\u6BCF\u5929",
844
+ weekly: "\u6BCF\u5468",
845
+ monthly: "\u6BCF\u6708",
846
+ yearly: "\u6BCF\u5E74",
847
+ repeatFor: "\u91CD\u590D",
848
+ times: "\u6B21",
849
+ until: "\u76F4\u5230",
850
+ endRepeat: "\u7ED3\u675F\u91CD\u590D",
851
+ never: "\u6C38\u4E0D",
852
+ afterOccurrences: "\u6B21\u540E",
853
+ onDate: "\u5728\u65E5\u671F",
854
+ selectCalendar: "\u9009\u62E9\u65E5\u5386",
855
+ selectType: "\u9009\u62E9\u7C7B\u578B",
856
+ calendar: "\u65E5\u5386",
857
+ calendars: "\u65E5\u5386",
858
+ event: "\u6D3B\u52A8",
859
+ task: "\u4EFB\u52A1",
860
+ appointmentSchedule: "\u9884\u7EA6\u65E5\u7A0B",
861
+ new: "\u65B0\u5EFA",
862
+ guests: "\u53C2\u4E0E\u8005",
863
+ addGuests: "\u6DFB\u52A0\u53C2\u4E0E\u8005",
864
+ guest: "\u4F4D\u53C2\u4E0E\u8005",
865
+ guestCount: "\u4F4D\u53C2\u4E0E\u8005",
866
+ guestsCount: "\u4F4D\u53C2\u4E0E\u8005",
867
+ guestAdded: "\u4F4D\u53C2\u4E0E\u8005\u5DF2\u6DFB\u52A0",
868
+ guestsAdded: "\u4F4D\u53C2\u4E0E\u8005\u5DF2\u6DFB\u52A0",
869
+ whosJoining: "\u8C01\u8981\u53C2\u52A0\uFF1F",
870
+ suggestedTimes: "\u4E3A\u6765\u5BBE\u63A8\u8350\u7684\u65F6\u95F4",
871
+ viewSuggestions: "\u67E5\u770B\u5EFA\u8BAE",
872
+ whereWillItBe: "\u5728\u54EA\u91CC\u4E3E\u529E\uFF1F",
873
+ dateAndTime: "\u65E5\u671F\u548C\u65F6\u95F4",
874
+ reminders: "\u63D0\u9192",
875
+ dragAndDrop: "\u62D6\u653E\u6587\u4EF6\u6216",
876
+ attachments: "\u9644\u4EF6",
877
+ reminderAtTime: "\u6D3B\u52A8\u65F6\u95F4\u65F6",
878
+ reminder5min: "\u63D0\u524D5\u5206\u949F",
879
+ reminder10min: "\u63D0\u524D10\u5206\u949F",
880
+ reminder15min: "\u63D0\u524D15\u5206\u949F",
881
+ reminder30min: "\u63D0\u524D30\u5206\u949F",
882
+ reminder1hour: "\u63D0\u524D1\u5C0F\u65F6",
883
+ reminder2hours: "\u63D0\u524D2\u5C0F\u65F6",
884
+ reminder1day: "\u63D0\u524D1\u5929",
885
+ reminder2days: "\u63D0\u524D2\u5929",
886
+ reminder1week: "\u63D0\u524D1\u5468",
887
+ tomorrow: "\u660E\u5929",
888
+ eventCount: "\u4E2A\u6D3B\u52A8",
889
+ eventsCount: "\u4E2A\u6D3B\u52A8",
890
+ timezone: "\u65F6\u533A",
891
+ localTime: "\u672C\u5730\u65F6\u95F4",
892
+ search: "\u641C\u7D22\u6D3B\u52A8...",
893
+ allTypes: "\u6240\u6709\u7C7B\u578B",
894
+ noTitle: "\uFF08\u65E0\u6807\u9898\uFF09",
895
+ copy: "\uFF08\u526F\u672C\uFF09",
896
+ clickToOpenInMaps: "\u70B9\u51FB\u5728\u5730\u56FE\u4E2D\u6253\u5F00"
897
+ };
898
+ var ja = {
899
+ today: "\u4ECA\u65E5",
900
+ month: "\u6708",
901
+ week: "\u9031",
902
+ day: "\u65E5",
903
+ agenda: "\u30A2\u30B8\u30A7\u30F3\u30C0",
904
+ resource: "\u30EA\u30BD\u30FC\u30B9",
905
+ create: "\u4F5C\u6210",
906
+ createEvent: "\u30A4\u30D9\u30F3\u30C8\u3092\u4F5C\u6210",
907
+ editEvent: "\u30A4\u30D9\u30F3\u30C8\u3092\u7DE8\u96C6",
908
+ newEvent: "\u65B0\u3057\u3044\u30A4\u30D9\u30F3\u30C8",
909
+ saveChanges: "\u5909\u66F4\u3092\u4FDD\u5B58",
910
+ delete: "\u524A\u9664",
911
+ save: "\u4FDD\u5B58",
912
+ cancel: "\u30AD\u30E3\u30F3\u30BB\u30EB",
913
+ edit: "\u7DE8\u96C6",
914
+ duplicate: "\u8907\u88FD",
915
+ close: "\u9589\u3058\u308B",
916
+ moreOptions: "\u305D\u306E\u4ED6\u306E\u30AA\u30D7\u30B7\u30E7\u30F3",
917
+ addAttachment: "\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
918
+ addReminder: "\u8FFD\u52A0",
919
+ title: "\u30BF\u30A4\u30C8\u30EB\u3092\u8FFD\u52A0",
920
+ addTitle: "\u30BF\u30A4\u30C8\u30EB\u3092\u8FFD\u52A0",
921
+ start: "\u958B\u59CB",
922
+ end: "\u7D42\u4E86",
923
+ allDay: "\u7D42\u65E5",
924
+ description: "\u8AAC\u660E",
925
+ descriptionAndAttachments: "\u8AAC\u660E",
926
+ addDescription: "\u8AAC\u660E\u307E\u305F\u306F\u30E1\u30E2\u3092\u8FFD\u52A0...",
927
+ location: "\u4F4F\u6240\u3092\u5165\u529B",
928
+ addLocation: "\u5834\u6240\u3092\u8FFD\u52A0",
929
+ locationHelpText: "\u5730\u56F3\u3092\u751F\u6210\u3059\u308B\u306B\u306F\u5B9F\u969B\u306E\u4F4F\u6240\uFF08\u4F8B\uFF1A\u300C\u6771\u4EAC\u90FD\u6E0B\u8C37\u533A1-1-1\u300D\uFF09\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
930
+ notes: "\u30E1\u30E2",
931
+ repeat: "\u7E70\u308A\u8FD4\u3057",
932
+ noRepeat: "\u7E70\u308A\u8FD4\u3057\u306A\u3057",
933
+ doesNotRepeat: "\u7E70\u308A\u8FD4\u3057\u306A\u3057",
934
+ daily: "\u6BCE\u65E5",
935
+ weekly: "\u6BCE\u9031",
936
+ monthly: "\u6BCE\u6708",
937
+ yearly: "\u6BCE\u5E74",
938
+ repeatFor: "\u7E70\u308A\u8FD4\u3057\u56DE\u6570",
939
+ times: "\u56DE",
940
+ until: "\u307E\u3067",
941
+ endRepeat: "\u7E70\u308A\u8FD4\u3057\u7D42\u4E86",
942
+ never: "\u306A\u3057",
943
+ afterOccurrences: "\u56DE\u5F8C\u306B\u7D42\u4E86",
944
+ onDate: "\u65E5\u4ED8\u306B",
945
+ selectCalendar: "\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u9078\u629E",
946
+ selectType: "\u30BF\u30A4\u30D7\u3092\u9078\u629E",
947
+ calendar: "\u30AB\u30EC\u30F3\u30C0\u30FC",
948
+ calendars: "\u30AB\u30EC\u30F3\u30C0\u30FC",
949
+ event: "\u30A4\u30D9\u30F3\u30C8",
950
+ task: "\u30BF\u30B9\u30AF",
951
+ appointmentSchedule: "\u4E88\u7D04\u30B9\u30B1\u30B8\u30E5\u30FC\u30EB",
952
+ new: "\u65B0\u898F",
953
+ guests: "\u30B2\u30B9\u30C8",
954
+ addGuests: "\u30B2\u30B9\u30C8\u3092\u8FFD\u52A0",
955
+ guest: "\u4EBA\u306E\u30B2\u30B9\u30C8",
956
+ guestCount: "\u4EBA\u306E\u30B2\u30B9\u30C8",
957
+ guestsCount: "\u4EBA\u306E\u30B2\u30B9\u30C8",
958
+ guestAdded: "\u4EBA\u306E\u30B2\u30B9\u30C8\u3092\u8FFD\u52A0\u3057\u307E\u3057\u305F",
959
+ guestsAdded: "\u4EBA\u306E\u30B2\u30B9\u30C8\u3092\u8FFD\u52A0\u3057\u307E\u3057\u305F",
960
+ whosJoining: "\u8AB0\u304C\u53C2\u52A0\u3057\u307E\u3059\u304B\uFF1F",
961
+ suggestedTimes: "\u30B2\u30B9\u30C8\u3078\u306E\u63D0\u6848\u6642\u9593",
962
+ viewSuggestions: "\u63D0\u6848\u3092\u898B\u308B",
963
+ whereWillItBe: "\u3069\u3053\u3067\u958B\u50AC\u3055\u308C\u307E\u3059\u304B\uFF1F",
964
+ dateAndTime: "\u65E5\u6642",
965
+ reminders: "\u30EA\u30DE\u30A4\u30F3\u30C0\u30FC",
966
+ dragAndDrop: "\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30E9\u30C3\u30B0\uFF06\u30C9\u30ED\u30C3\u30D7\u307E\u305F\u306F",
967
+ attachments: "\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB",
968
+ reminderAtTime: "\u30A4\u30D9\u30F3\u30C8\u6642\u9593\u306B",
969
+ reminder5min: "5\u5206\u524D",
970
+ reminder10min: "10\u5206\u524D",
971
+ reminder15min: "15\u5206\u524D",
972
+ reminder30min: "30\u5206\u524D",
973
+ reminder1hour: "1\u6642\u9593\u524D",
974
+ reminder2hours: "2\u6642\u9593\u524D",
975
+ reminder1day: "1\u65E5\u524D",
976
+ reminder2days: "2\u65E5\u524D",
977
+ reminder1week: "1\u9031\u9593\u524D",
978
+ tomorrow: "\u660E\u65E5",
979
+ eventCount: "\u4EF6\u306E\u30A4\u30D9\u30F3\u30C8",
980
+ eventsCount: "\u4EF6\u306E\u30A4\u30D9\u30F3\u30C8",
981
+ timezone: "\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3",
982
+ localTime: "\u30ED\u30FC\u30AB\u30EB\u6642\u9593",
983
+ search: "\u30A4\u30D9\u30F3\u30C8\u3092\u691C\u7D22...",
984
+ allTypes: "\u3059\u3079\u3066\u306E\u30BF\u30A4\u30D7",
985
+ noTitle: "\uFF08\u30BF\u30A4\u30C8\u30EB\u306A\u3057\uFF09",
986
+ copy: "\uFF08\u30B3\u30D4\u30FC\uFF09",
987
+ clickToOpenInMaps: "\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u5730\u56F3\u3067\u958B\u304F"
988
+ };
989
+ var ko = {
990
+ today: "\uC624\uB298",
991
+ month: "\uC6D4",
992
+ week: "\uC8FC",
993
+ day: "\uC77C",
994
+ agenda: "\uC77C\uC815",
995
+ resource: "\uB9AC\uC18C\uC2A4",
996
+ create: "\uB9CC\uB4E4\uAE30",
997
+ createEvent: "\uC77C\uC815 \uB9CC\uB4E4\uAE30",
998
+ editEvent: "\uC77C\uC815 \uD3B8\uC9D1",
999
+ newEvent: "\uC0C8 \uC77C\uC815",
1000
+ saveChanges: "\uBCC0\uACBD\uC0AC\uD56D \uC800\uC7A5",
1001
+ delete: "\uC0AD\uC81C",
1002
+ save: "\uC800\uC7A5",
1003
+ cancel: "\uCDE8\uC18C",
1004
+ edit: "\uD3B8\uC9D1",
1005
+ duplicate: "\uBCF5\uC81C",
1006
+ close: "\uB2EB\uAE30",
1007
+ moreOptions: "\uB354 \uBCF4\uAE30",
1008
+ addAttachment: "\uD30C\uC77C \uC5C5\uB85C\uB4DC",
1009
+ addReminder: "\uCD94\uAC00",
1010
+ title: "\uC81C\uBAA9 \uCD94\uAC00",
1011
+ addTitle: "\uC81C\uBAA9 \uCD94\uAC00",
1012
+ start: "\uC2DC\uC791",
1013
+ end: "\uC885\uB8CC",
1014
+ allDay: "\uC885\uC77C",
1015
+ description: "\uC124\uBA85",
1016
+ descriptionAndAttachments: "\uC124\uBA85",
1017
+ addDescription: "\uC124\uBA85 \uB610\uB294 \uBA54\uBAA8 \uCD94\uAC00...",
1018
+ location: "\uC8FC\uC18C \uC785\uB825",
1019
+ addLocation: "\uC7A5\uC18C \uCD94\uAC00",
1020
+ locationHelpText: '\uC9C0\uB3C4\uB97C \uC0DD\uC131\uD558\uB824\uBA74 \uC2E4\uC81C \uC8FC\uC18C(\uC608: "\uC11C\uC6B8\uC2DC \uAC15\uB0A8\uAD6C 1\uBC88\uC9C0")\uB97C \uC785\uB825\uD558\uC138\uC694.',
1021
+ notes: "\uBA54\uBAA8",
1022
+ repeat: "\uBC18\uBCF5",
1023
+ noRepeat: "\uBC18\uBCF5 \uC5C6\uC74C",
1024
+ doesNotRepeat: "\uBC18\uBCF5 \uC5C6\uC74C",
1025
+ daily: "\uB9E4\uC77C",
1026
+ weekly: "\uB9E4\uC8FC",
1027
+ monthly: "\uB9E4\uC6D4",
1028
+ yearly: "\uB9E4\uB144",
1029
+ repeatFor: "\uBC18\uBCF5 \uD69F\uC218",
1030
+ times: "\uBC88",
1031
+ until: "\uAE4C\uC9C0",
1032
+ endRepeat: "\uBC18\uBCF5 \uC885\uB8CC",
1033
+ never: "\uC5C6\uC74C",
1034
+ afterOccurrences: "\uBC88 \uD6C4 \uC885\uB8CC",
1035
+ onDate: "\uB0A0\uC9DC\uC5D0",
1036
+ selectCalendar: "\uCE98\uB9B0\uB354 \uC120\uD0DD",
1037
+ selectType: "\uC720\uD615 \uC120\uD0DD",
1038
+ calendar: "\uCE98\uB9B0\uB354",
1039
+ calendars: "\uCE98\uB9B0\uB354",
1040
+ event: "\uC77C\uC815",
1041
+ task: "\uC791\uC5C5",
1042
+ appointmentSchedule: "\uC608\uC57D \uC77C\uC815",
1043
+ new: "\uC0C8\uB85C \uB9CC\uB4E4\uAE30",
1044
+ guests: "\uCC38\uC11D\uC790",
1045
+ addGuests: "\uCC38\uC11D\uC790 \uCD94\uAC00",
1046
+ guest: "\uBA85 \uCC38\uC11D\uC790",
1047
+ guestCount: "\uBA85 \uCC38\uC11D\uC790",
1048
+ guestsCount: "\uBA85 \uCC38\uC11D\uC790",
1049
+ guestAdded: "\uBA85 \uCC38\uC11D\uC790 \uCD94\uAC00\uB428",
1050
+ guestsAdded: "\uBA85 \uCC38\uC11D\uC790 \uCD94\uAC00\uB428",
1051
+ whosJoining: "\uB204\uAC00 \uCC38\uAC00\uD558\uB098\uC694?",
1052
+ suggestedTimes: "\uCC38\uC11D\uC790\uB97C \uC704\uD55C \uCD94\uCC9C \uC2DC\uAC04",
1053
+ viewSuggestions: "\uC81C\uC548 \uBCF4\uAE30",
1054
+ whereWillItBe: "\uC5B4\uB514\uC11C \uC5F4\uB9AC\uB098\uC694?",
1055
+ dateAndTime: "\uB0A0\uC9DC \uBC0F \uC2DC\uAC04",
1056
+ reminders: "\uC54C\uB9BC",
1057
+ dragAndDrop: "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8 \uC564 \uB4DC\uB86D\uD558\uAC70\uB098",
1058
+ attachments: "\uCCA8\uBD80\uD30C\uC77C",
1059
+ reminderAtTime: "\uC77C\uC815 \uC2DC\uAC04\uC5D0",
1060
+ reminder5min: "5\uBD84 \uC804",
1061
+ reminder10min: "10\uBD84 \uC804",
1062
+ reminder15min: "15\uBD84 \uC804",
1063
+ reminder30min: "30\uBD84 \uC804",
1064
+ reminder1hour: "1\uC2DC\uAC04 \uC804",
1065
+ reminder2hours: "2\uC2DC\uAC04 \uC804",
1066
+ reminder1day: "1\uC77C \uC804",
1067
+ reminder2days: "2\uC77C \uC804",
1068
+ reminder1week: "1\uC8FC\uC77C \uC804",
1069
+ tomorrow: "\uB0B4\uC77C",
1070
+ eventCount: "\uAC1C \uC77C\uC815",
1071
+ eventsCount: "\uAC1C \uC77C\uC815",
1072
+ timezone: "\uC2DC\uAC04\uB300",
1073
+ localTime: "\uB85C\uCEEC \uC2DC\uAC04",
1074
+ search: "\uC77C\uC815 \uAC80\uC0C9...",
1075
+ allTypes: "\uBAA8\uB4E0 \uC720\uD615",
1076
+ noTitle: "(\uC81C\uBAA9 \uC5C6\uC74C)",
1077
+ copy: "(\uBCF5\uC0AC)",
1078
+ clickToOpenInMaps: "\uC9C0\uB3C4\uC5D0\uC11C \uC5F4\uB824\uBA74 \uD074\uB9AD\uD558\uC138\uC694"
1079
+ };
1080
+ var ru = {
1081
+ today: "\u0421\u0435\u0433\u043E\u0434\u043D\u044F",
1082
+ month: "\u041C\u0435\u0441\u044F\u0446",
1083
+ week: "\u041D\u0435\u0434\u0435\u043B\u044F",
1084
+ day: "\u0414\u0435\u043D\u044C",
1085
+ agenda: "\u041F\u043E\u0432\u0435\u0441\u0442\u043A\u0430",
1086
+ resource: "\u0420\u0435\u0441\u0443\u0440\u0441\u044B",
1087
+ create: "\u0421\u043E\u0437\u0434\u0430\u0442\u044C",
1088
+ createEvent: "\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0441\u043E\u0431\u044B\u0442\u0438\u0435",
1089
+ editEvent: "\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u043E\u0431\u044B\u0442\u0438\u0435",
1090
+ newEvent: "\u041D\u043E\u0432\u043E\u0435 \u0441\u043E\u0431\u044B\u0442\u0438\u0435",
1091
+ saveChanges: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F",
1092
+ delete: "\u0423\u0434\u0430\u043B\u0438\u0442\u044C",
1093
+ save: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C",
1094
+ cancel: "\u041E\u0442\u043C\u0435\u043D\u0430",
1095
+ edit: "\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C",
1096
+ duplicate: "\u0414\u0443\u0431\u043B\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
1097
+ close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C",
1098
+ moreOptions: "\u0415\u0449\u0451 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B",
1099
+ addAttachment: "\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0444\u0430\u0439\u043B\u044B",
1100
+ addReminder: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C",
1101
+ title: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A",
1102
+ addTitle: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A",
1103
+ start: "\u041D\u0430\u0447\u0430\u043B\u043E",
1104
+ end: "\u041A\u043E\u043D\u0435\u0446",
1105
+ allDay: "\u0412\u0435\u0441\u044C \u0434\u0435\u043D\u044C",
1106
+ description: "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435",
1107
+ descriptionAndAttachments: "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435",
1108
+ addDescription: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0438\u043B\u0438 \u0437\u0430\u043C\u0435\u0442\u043A\u0438...",
1109
+ location: "\u0412\u0432\u0435\u0441\u0442\u0438 \u0430\u0434\u0440\u0435\u0441",
1110
+ addLocation: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043C\u0435\u0441\u0442\u043E",
1111
+ locationHelpText: '\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0430\u0434\u0440\u0435\u0441 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, "\u0443\u043B. \u041B\u0435\u043D\u0438\u043D\u0430, 1") \u0434\u043B\u044F \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u043A\u0430\u0440\u0442\u044B.',
1112
+ notes: "\u0417\u0430\u043C\u0435\u0442\u043A\u0438",
1113
+ repeat: "\u041F\u043E\u0432\u0442\u043E\u0440",
1114
+ noRepeat: "\u0411\u0435\u0437 \u043F\u043E\u0432\u0442\u043E\u0440\u0430",
1115
+ doesNotRepeat: "\u0411\u0435\u0437 \u043F\u043E\u0432\u0442\u043E\u0440\u0430",
1116
+ daily: "\u0415\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u043E",
1117
+ weekly: "\u0415\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u043E",
1118
+ monthly: "\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u043E",
1119
+ yearly: "\u0415\u0436\u0435\u0433\u043E\u0434\u043D\u043E",
1120
+ repeatFor: "\u041F\u043E\u0432\u0442\u043E\u0440\u044F\u0442\u044C",
1121
+ times: "\u0440\u0430\u0437",
1122
+ until: "\u0414\u043E",
1123
+ endRepeat: "\u041A\u043E\u043D\u0435\u0446 \u043F\u043E\u0432\u0442\u043E\u0440\u0430",
1124
+ never: "\u041D\u0438\u043A\u043E\u0433\u0434\u0430",
1125
+ afterOccurrences: "\u041F\u043E\u0441\u043B\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u0435\u043D\u0438\u0439",
1126
+ onDate: "\u041D\u0430 \u0434\u0430\u0442\u0443",
1127
+ selectCalendar: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u043A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C",
1128
+ selectType: "\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0442\u0438\u043F",
1129
+ calendar: "\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C",
1130
+ calendars: "\u041A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u0438",
1131
+ event: "\u0421\u043E\u0431\u044B\u0442\u0438\u0435",
1132
+ task: "\u0417\u0430\u0434\u0430\u0447\u0430",
1133
+ appointmentSchedule: "\u0420\u0430\u0441\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0432\u0441\u0442\u0440\u0435\u0447",
1134
+ new: "\u041D\u043E\u0432\u044B\u0439",
1135
+ guests: "\u0413\u043E\u0441\u0442\u0438",
1136
+ addGuests: "\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0433\u043E\u0441\u0442\u0435\u0439",
1137
+ guest: "\u0433\u043E\u0441\u0442\u044C",
1138
+ guestCount: "\u0433\u043E\u0441\u0442\u044C",
1139
+ guestsCount: "\u0433\u043E\u0441\u0442\u0435\u0439",
1140
+ guestAdded: "\u0433\u043E\u0441\u0442\u044C \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D",
1141
+ guestsAdded: "\u0433\u043E\u0441\u0442\u0435\u0439 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E",
1142
+ whosJoining: "\u041A\u0442\u043E \u043F\u0440\u0438\u0441\u043E\u0435\u0434\u0438\u043D\u0438\u0442\u0441\u044F?",
1143
+ suggestedTimes: "\u041F\u0440\u0435\u0434\u043B\u0430\u0433\u0430\u0435\u043C\u043E\u0435 \u0432\u0440\u0435\u043C\u044F \u0434\u043B\u044F \u0433\u043E\u0441\u0442\u0435\u0439",
1144
+ viewSuggestions: "\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u044F",
1145
+ whereWillItBe: "\u0413\u0434\u0435 \u044D\u0442\u043E \u0431\u0443\u0434\u0435\u0442?",
1146
+ dateAndTime: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",
1147
+ reminders: "\u041D\u0430\u043F\u043E\u043C\u0438\u043D\u0430\u043D\u0438\u044F",
1148
+ dragAndDrop: "\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043B\u044B \u0438\u043B\u0438",
1149
+ attachments: "\u0412\u043B\u043E\u0436\u0435\u043D\u0438\u044F",
1150
+ reminderAtTime: "\u0412\u043E \u0432\u0440\u0435\u043C\u044F \u0441\u043E\u0431\u044B\u0442\u0438\u044F",
1151
+ reminder5min: "\u0417\u0430 5 \u043C\u0438\u043D\u0443\u0442",
1152
+ reminder10min: "\u0417\u0430 10 \u043C\u0438\u043D\u0443\u0442",
1153
+ reminder15min: "\u0417\u0430 15 \u043C\u0438\u043D\u0443\u0442",
1154
+ reminder30min: "\u0417\u0430 30 \u043C\u0438\u043D\u0443\u0442",
1155
+ reminder1hour: "\u0417\u0430 1 \u0447\u0430\u0441",
1156
+ reminder2hours: "\u0417\u0430 2 \u0447\u0430\u0441\u0430",
1157
+ reminder1day: "\u0417\u0430 1 \u0434\u0435\u043D\u044C",
1158
+ reminder2days: "\u0417\u0430 2 \u0434\u043D\u044F",
1159
+ reminder1week: "\u0417\u0430 1 \u043D\u0435\u0434\u0435\u043B\u044E",
1160
+ tomorrow: "\u0417\u0430\u0432\u0442\u0440\u0430",
1161
+ eventCount: "\u0441\u043E\u0431\u044B\u0442\u0438\u0435",
1162
+ eventsCount: "\u0441\u043E\u0431\u044B\u0442\u0438\u0439",
1163
+ timezone: "\u0427\u0430\u0441\u043E\u0432\u043E\u0439 \u043F\u043E\u044F\u0441",
1164
+ localTime: "\u041C\u0435\u0441\u0442\u043D\u043E\u0435 \u0432\u0440\u0435\u043C\u044F",
1165
+ search: "\u041F\u043E\u0438\u0441\u043A \u0441\u043E\u0431\u044B\u0442\u0438\u0439...",
1166
+ allTypes: "\u0412\u0441\u0435 \u0442\u0438\u043F\u044B",
1167
+ noTitle: "(\u0411\u0435\u0437 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430)",
1168
+ copy: "(\u041A\u043E\u043F\u0438\u044F)",
1169
+ clickToOpenInMaps: "\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043D\u0430 \u043A\u0430\u0440\u0442\u0435"
1170
+ };
1171
+ var nl = {
1172
+ today: "Vandaag",
1173
+ month: "Maand",
1174
+ week: "Week",
1175
+ day: "Dag",
1176
+ agenda: "Agenda",
1177
+ resource: "Bronnen",
1178
+ create: "Aanmaken",
1179
+ createEvent: "Evenement aanmaken",
1180
+ editEvent: "Evenement bewerken",
1181
+ newEvent: "Nieuw evenement",
1182
+ saveChanges: "Wijzigingen opslaan",
1183
+ delete: "Verwijderen",
1184
+ save: "Opslaan",
1185
+ cancel: "Annuleren",
1186
+ edit: "Bewerken",
1187
+ duplicate: "Dupliceren",
1188
+ close: "Sluiten",
1189
+ moreOptions: "Meer opties",
1190
+ addAttachment: "Bestanden uploaden",
1191
+ addReminder: "Toevoegen",
1192
+ title: "Titel toevoegen",
1193
+ addTitle: "Titel toevoegen",
1194
+ start: "Begin",
1195
+ end: "Einde",
1196
+ allDay: "De hele dag",
1197
+ description: "Beschrijving",
1198
+ descriptionAndAttachments: "Beschrijving",
1199
+ addDescription: "Beschrijving of notities toevoegen...",
1200
+ location: "Adres invoeren",
1201
+ addLocation: "Locatie toevoegen",
1202
+ locationHelpText: 'Voer een fysiek adres in (bijv. "Hoofdstraat 1") om de kaart te genereren.',
1203
+ notes: "Notities",
1204
+ repeat: "Herhalen",
1205
+ noRepeat: "Geen herhaling",
1206
+ doesNotRepeat: "Geen herhaling",
1207
+ daily: "Dagelijks",
1208
+ weekly: "Wekelijks",
1209
+ monthly: "Maandelijks",
1210
+ yearly: "Jaarlijks",
1211
+ repeatFor: "Herhalen voor",
1212
+ times: "keer",
1213
+ until: "Tot",
1214
+ endRepeat: "Herhaling be\xEBindigen",
1215
+ never: "Nooit",
1216
+ afterOccurrences: "Na herhalingen",
1217
+ onDate: "Op datum",
1218
+ selectCalendar: "Kalender selecteren",
1219
+ selectType: "Type selecteren",
1220
+ calendar: "Kalender",
1221
+ calendars: "Kalenders",
1222
+ event: "Evenement",
1223
+ task: "Taak",
1224
+ appointmentSchedule: "Afspraakschema",
1225
+ new: "Nieuw",
1226
+ guests: "Gasten",
1227
+ addGuests: "Gasten toevoegen",
1228
+ guest: "gast",
1229
+ guestCount: "gast",
1230
+ guestsCount: "gasten",
1231
+ guestAdded: "gast toegevoegd",
1232
+ guestsAdded: "gasten toegevoegd",
1233
+ whosJoining: "Wie doet er mee?",
1234
+ suggestedTimes: "Voorgestelde tijden voor gasten",
1235
+ viewSuggestions: "Suggesties bekijken",
1236
+ whereWillItBe: "Waar zal het zijn?",
1237
+ dateAndTime: "Datum en tijd",
1238
+ reminders: "Herinneringen",
1239
+ dragAndDrop: "Sleep bestanden of",
1240
+ attachments: "Bijlagen",
1241
+ reminderAtTime: "Op het moment van het evenement",
1242
+ reminder5min: "5 minuten van tevoren",
1243
+ reminder10min: "10 minuten van tevoren",
1244
+ reminder15min: "15 minuten van tevoren",
1245
+ reminder30min: "30 minuten van tevoren",
1246
+ reminder1hour: "1 uur van tevoren",
1247
+ reminder2hours: "2 uur van tevoren",
1248
+ reminder1day: "1 dag van tevoren",
1249
+ reminder2days: "2 dagen van tevoren",
1250
+ reminder1week: "1 week van tevoren",
1251
+ tomorrow: "Morgen",
1252
+ eventCount: "evenement",
1253
+ eventsCount: "evenementen",
1254
+ timezone: "Tijdzone",
1255
+ localTime: "Lokale tijd",
1256
+ search: "Evenementen zoeken...",
1257
+ allTypes: "Alle typen",
1258
+ noTitle: "(Geen titel)",
1259
+ copy: "(Kopie)",
1260
+ clickToOpenInMaps: "Klik om op de kaart te openen"
1261
+ };
1262
+ var pl = {
1263
+ today: "Dzi\u015B",
1264
+ month: "Miesi\u0105c",
1265
+ week: "Tydzie\u0144",
1266
+ day: "Dzie\u0144",
1267
+ agenda: "Agenda",
1268
+ resource: "Zasoby",
1269
+ create: "Utw\xF3rz",
1270
+ createEvent: "Utw\xF3rz wydarzenie",
1271
+ editEvent: "Edytuj wydarzenie",
1272
+ newEvent: "Nowe wydarzenie",
1273
+ saveChanges: "Zapisz zmiany",
1274
+ delete: "Usu\u0144",
1275
+ save: "Zapisz",
1276
+ cancel: "Anuluj",
1277
+ edit: "Edytuj",
1278
+ duplicate: "Duplikuj",
1279
+ close: "Zamknij",
1280
+ moreOptions: "Wi\u0119cej opcji",
1281
+ addAttachment: "Prze\u015Blij pliki",
1282
+ addReminder: "Dodaj",
1283
+ title: "Dodaj tytu\u0142",
1284
+ addTitle: "Dodaj tytu\u0142",
1285
+ start: "Pocz\u0105tek",
1286
+ end: "Koniec",
1287
+ allDay: "Ca\u0142y dzie\u0144",
1288
+ description: "Opis",
1289
+ descriptionAndAttachments: "Opis",
1290
+ addDescription: "Dodaj opis lub notatki...",
1291
+ location: "Wprowad\u017A adres",
1292
+ addLocation: "Dodaj lokalizacj\u0119",
1293
+ locationHelpText: 'Wprowad\u017A adres fizyczny (np. "ul. G\u0142\xF3wna 1") aby wygenerowa\u0107 map\u0119.',
1294
+ notes: "Notatki",
1295
+ repeat: "Powtarzaj",
1296
+ noRepeat: "Nie powtarza si\u0119",
1297
+ doesNotRepeat: "Nie powtarza si\u0119",
1298
+ daily: "Codziennie",
1299
+ weekly: "Co tydzie\u0144",
1300
+ monthly: "Co miesi\u0105c",
1301
+ yearly: "Co rok",
1302
+ repeatFor: "Powtarzaj przez",
1303
+ times: "razy",
1304
+ until: "Do",
1305
+ endRepeat: "Koniec powtarzania",
1306
+ never: "Nigdy",
1307
+ afterOccurrences: "Po powt\xF3rzeniach",
1308
+ onDate: "W dniu",
1309
+ selectCalendar: "Wybierz kalendarz",
1310
+ selectType: "Wybierz typ",
1311
+ calendar: "Kalendarz",
1312
+ calendars: "Kalendarze",
1313
+ event: "Wydarzenie",
1314
+ task: "Zadanie",
1315
+ appointmentSchedule: "Harmonogram spotka\u0144",
1316
+ new: "Nowy",
1317
+ guests: "Go\u015Bcie",
1318
+ addGuests: "Dodaj go\u015Bci",
1319
+ guest: "go\u015B\u0107",
1320
+ guestCount: "go\u015B\u0107",
1321
+ guestsCount: "go\u015Bci",
1322
+ guestAdded: "go\u015B\u0107 dodany",
1323
+ guestsAdded: "go\u015Bci dodanych",
1324
+ whosJoining: "Kto do\u0142\u0105cza?",
1325
+ suggestedTimes: "Proponowane godziny dla go\u015Bci",
1326
+ viewSuggestions: "Zobacz sugestie",
1327
+ whereWillItBe: "Gdzie si\u0119 odb\u0119dzie?",
1328
+ dateAndTime: "Data i godzina",
1329
+ reminders: "Przypomnienia",
1330
+ dragAndDrop: "Przeci\u0105gnij i upu\u015B\u0107 pliki lub",
1331
+ attachments: "Za\u0142\u0105czniki",
1332
+ reminderAtTime: "O czasie wydarzenia",
1333
+ reminder5min: "5 minut wcze\u015Bniej",
1334
+ reminder10min: "10 minut wcze\u015Bniej",
1335
+ reminder15min: "15 minut wcze\u015Bniej",
1336
+ reminder30min: "30 minut wcze\u015Bniej",
1337
+ reminder1hour: "1 godzin\u0119 wcze\u015Bniej",
1338
+ reminder2hours: "2 godziny wcze\u015Bniej",
1339
+ reminder1day: "1 dzie\u0144 wcze\u015Bniej",
1340
+ reminder2days: "2 dni wcze\u015Bniej",
1341
+ reminder1week: "1 tydzie\u0144 wcze\u015Bniej",
1342
+ tomorrow: "Jutro",
1343
+ eventCount: "wydarzenie",
1344
+ eventsCount: "wydarze\u0144",
1345
+ timezone: "Strefa czasowa",
1346
+ localTime: "Czas lokalny",
1347
+ search: "Szukaj wydarze\u0144...",
1348
+ allTypes: "Wszystkie typy",
1349
+ noTitle: "(Bez tytu\u0142u)",
1350
+ copy: "(Kopia)",
1351
+ clickToOpenInMaps: "Kliknij, aby otworzy\u0107 na mapie"
1352
+ };
1353
+ var sv = {
1354
+ today: "Idag",
1355
+ month: "M\xE5nad",
1356
+ week: "Vecka",
1357
+ day: "Dag",
1358
+ agenda: "Agenda",
1359
+ resource: "Resurser",
1360
+ create: "Skapa",
1361
+ createEvent: "Skapa h\xE4ndelse",
1362
+ editEvent: "Redigera h\xE4ndelse",
1363
+ newEvent: "Ny h\xE4ndelse",
1364
+ saveChanges: "Spara \xE4ndringar",
1365
+ delete: "Ta bort",
1366
+ save: "Spara",
1367
+ cancel: "Avbryt",
1368
+ edit: "Redigera",
1369
+ duplicate: "Duplicera",
1370
+ close: "St\xE4ng",
1371
+ moreOptions: "Fler alternativ",
1372
+ addAttachment: "Ladda upp filer",
1373
+ addReminder: "L\xE4gg till",
1374
+ title: "L\xE4gg till titel",
1375
+ addTitle: "L\xE4gg till titel",
1376
+ start: "Start",
1377
+ end: "Slut",
1378
+ allDay: "Hela dagen",
1379
+ description: "Beskrivning",
1380
+ descriptionAndAttachments: "Beskrivning",
1381
+ addDescription: "L\xE4gg till beskrivning eller anteckningar...",
1382
+ location: "Ange adress",
1383
+ addLocation: "L\xE4gg till plats",
1384
+ locationHelpText: 'Ange en fysisk adress (t.ex. "Storgatan 1") f\xF6r att generera kartan.',
1385
+ notes: "Anteckningar",
1386
+ repeat: "Upprepa",
1387
+ noRepeat: "Upprepas inte",
1388
+ doesNotRepeat: "Upprepas inte",
1389
+ daily: "Dagligen",
1390
+ weekly: "Varje vecka",
1391
+ monthly: "Varje m\xE5nad",
1392
+ yearly: "Varje \xE5r",
1393
+ repeatFor: "Upprepa",
1394
+ times: "g\xE5nger",
1395
+ until: "Till",
1396
+ endRepeat: "Avsluta upprepning",
1397
+ never: "Aldrig",
1398
+ afterOccurrences: "Efter upprepningar",
1399
+ onDate: "P\xE5 datum",
1400
+ selectCalendar: "V\xE4lj kalender",
1401
+ selectType: "V\xE4lj typ",
1402
+ calendar: "Kalender",
1403
+ calendars: "Kalendrar",
1404
+ event: "H\xE4ndelse",
1405
+ task: "Uppgift",
1406
+ appointmentSchedule: "Bokningsschema",
1407
+ new: "Ny",
1408
+ guests: "G\xE4ster",
1409
+ addGuests: "L\xE4gg till g\xE4ster",
1410
+ guest: "g\xE4st",
1411
+ guestCount: "g\xE4st",
1412
+ guestsCount: "g\xE4ster",
1413
+ guestAdded: "g\xE4st tillagd",
1414
+ guestsAdded: "g\xE4ster tillagda",
1415
+ whosJoining: "Vem deltar?",
1416
+ suggestedTimes: "F\xF6reslagna tider f\xF6r g\xE4ster",
1417
+ viewSuggestions: "Visa f\xF6rslag",
1418
+ whereWillItBe: "Var ska det vara?",
1419
+ dateAndTime: "Datum och tid",
1420
+ reminders: "P\xE5minnelser",
1421
+ dragAndDrop: "Dra och sl\xE4pp filer eller",
1422
+ attachments: "Bilagor",
1423
+ reminderAtTime: "Vid h\xE4ndelsens tid",
1424
+ reminder5min: "5 minuter innan",
1425
+ reminder10min: "10 minuter innan",
1426
+ reminder15min: "15 minuter innan",
1427
+ reminder30min: "30 minuter innan",
1428
+ reminder1hour: "1 timme innan",
1429
+ reminder2hours: "2 timmar innan",
1430
+ reminder1day: "1 dag innan",
1431
+ reminder2days: "2 dagar innan",
1432
+ reminder1week: "1 vecka innan",
1433
+ tomorrow: "Imorgon",
1434
+ eventCount: "h\xE4ndelse",
1435
+ eventsCount: "h\xE4ndelser",
1436
+ timezone: "Tidszon",
1437
+ localTime: "Lokal tid",
1438
+ search: "S\xF6k h\xE4ndelser...",
1439
+ allTypes: "Alla typer",
1440
+ noTitle: "(Ingen titel)",
1441
+ copy: "(Kopia)",
1442
+ clickToOpenInMaps: "Klicka f\xF6r att \xF6ppna i karta"
1443
+ };
1444
+ var LOCALES = {
1445
+ tr,
1446
+ en,
1447
+ fr,
1448
+ de,
1449
+ es,
1450
+ it,
1451
+ pt,
1452
+ ar,
1453
+ zh,
1454
+ ja,
1455
+ ko,
1456
+ ru,
1457
+ nl,
1458
+ pl,
1459
+ sv
1460
+ };
1461
+ function getTranslations(language = "tr", overrides = {}) {
1462
+ return { ...LOCALES[language], ...overrides };
1463
+ }
1464
+
1465
+ // src/components/CalendarHeader.tsx
1466
+ var DROPDOWN_GAP = 8;
1467
+ var VIEWPORT_PADDING = 8;
1468
+ var LANG_DROPDOWN_WIDTH = 208;
1469
+ var CUSTOM_VIEW_DROPDOWN_WIDTH = 160;
1470
+ function getDropdownPosition(triggerRect, dropdownWidth) {
1471
+ let left = triggerRect.left;
1472
+ const top = triggerRect.bottom + DROPDOWN_GAP;
1473
+ if (left + dropdownWidth > window.innerWidth - VIEWPORT_PADDING) {
1474
+ left = triggerRect.right - dropdownWidth;
1475
+ }
1476
+ left = Math.max(VIEWPORT_PADDING, Math.min(left, window.innerWidth - dropdownWidth - VIEWPORT_PADDING));
1477
+ return { top, left };
1478
+ }
1479
+ var CalendarHeader = ({
1480
+ currentDate,
1481
+ onPrev,
1482
+ onNext,
1483
+ onToday,
1484
+ view,
1485
+ onViewChange,
1486
+ onMenuClick,
1487
+ isDarkMode,
1488
+ onThemeToggle,
1489
+ translations,
1490
+ hideViewSwitcher,
1491
+ language = "tr",
1492
+ onLanguageChange,
1493
+ locale,
1494
+ onCreateEvent,
1495
+ customViews,
1496
+ activeCustomViewId,
1497
+ onCustomViewChange
1498
+ }) => {
1499
+ const [isLangOpen, setIsLangOpen] = useState(false);
1500
+ const [isCustomViewOpen, setIsCustomViewOpen] = useState(false);
1501
+ const langButtonRef = useRef(null);
1502
+ const langDropdownRef = useRef(null);
1503
+ const customViewDropdownRef = useRef(null);
1504
+ const customViewButtonRef = useRef(null);
1505
+ const [langPos, setLangPos] = useState(null);
1506
+ const [customViewPos, setCustomViewPos] = useState(null);
1507
+ const updateLangPos = useCallback(() => {
1508
+ const el = langButtonRef.current;
1509
+ if (!el) return;
1510
+ setLangPos(getDropdownPosition(el.getBoundingClientRect(), LANG_DROPDOWN_WIDTH));
1511
+ }, []);
1512
+ const updateCustomViewPos = useCallback(() => {
1513
+ const el = customViewButtonRef.current;
1514
+ if (!el) return;
1515
+ setCustomViewPos(getDropdownPosition(el.getBoundingClientRect(), CUSTOM_VIEW_DROPDOWN_WIDTH));
1516
+ }, []);
1517
+ useLayoutEffect(() => {
1518
+ if (!isLangOpen) return;
1519
+ updateLangPos();
1520
+ }, [isLangOpen, updateLangPos]);
1521
+ useLayoutEffect(() => {
1522
+ if (!isCustomViewOpen) return;
1523
+ updateCustomViewPos();
1524
+ }, [isCustomViewOpen, updateCustomViewPos]);
1525
+ useEffect(() => {
1526
+ if (!isLangOpen) return;
1527
+ const handle = () => updateLangPos();
1528
+ window.addEventListener("resize", handle);
1529
+ window.addEventListener("scroll", handle, true);
1530
+ return () => {
1531
+ window.removeEventListener("resize", handle);
1532
+ window.removeEventListener("scroll", handle, true);
1533
+ };
1534
+ }, [isLangOpen, updateLangPos]);
1535
+ useEffect(() => {
1536
+ if (!isCustomViewOpen) return;
1537
+ const handle = () => updateCustomViewPos();
1538
+ window.addEventListener("resize", handle);
1539
+ window.addEventListener("scroll", handle, true);
1540
+ return () => {
1541
+ window.removeEventListener("resize", handle);
1542
+ window.removeEventListener("scroll", handle, true);
1543
+ };
1544
+ }, [isCustomViewOpen, updateCustomViewPos]);
1545
+ useEffect(() => {
1546
+ const handleClickOutside = (e) => {
1547
+ const target = e.target;
1548
+ const insideButton = langButtonRef.current?.contains(target);
1549
+ const insideDropdown = langDropdownRef.current?.contains(target);
1550
+ if (!insideButton && !insideDropdown) setIsLangOpen(false);
1551
+ };
1552
+ if (isLangOpen) document.addEventListener("mousedown", handleClickOutside);
1553
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1554
+ }, [isLangOpen]);
1555
+ useEffect(() => {
1556
+ const handleClickOutside = (e) => {
1557
+ const target = e.target;
1558
+ const insideButton = customViewButtonRef.current?.contains(target);
1559
+ const insideDropdown = customViewDropdownRef.current?.contains(target);
1560
+ if (!insideButton && !insideDropdown) setIsCustomViewOpen(false);
1561
+ };
1562
+ if (isCustomViewOpen) document.addEventListener("mousedown", handleClickOutside);
1563
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1564
+ }, [isCustomViewOpen]);
1565
+ const viewConfig = [
1566
+ { key: "month", icon: CalendarDays },
1567
+ { key: "week", icon: CalendarRange },
1568
+ { key: "day", icon: Calendar },
1569
+ { key: "agenda", icon: ListTodo }
1570
+ ];
1571
+ const currentLang = LANGUAGE_META[language] ?? LANGUAGE_META["tr"];
1572
+ return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col md:flex-row items-center justify-between px-3 md:px-5 py-3 border-b-[0px] border-border/50 bg-gradient-to-r from-background via-background to-muted/20 gap-3 md:gap-0 min-h-[64px]" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2 w-full md:w-auto justify-between md:justify-start" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2 md:gap-3" }, /* @__PURE__ */ React15__default.createElement(
1573
+ Button,
1574
+ {
1575
+ variant: "ghost",
1576
+ size: "icon",
1577
+ className: "text-muted-foreground hover:text-foreground hover:bg-accent/80 rounded-xl h-10 w-10 transition-all duration-200",
1578
+ onClick: onMenuClick
1579
+ },
1580
+ /* @__PURE__ */ React15__default.createElement(Menu, { className: "h-5 w-5" })
1581
+ ), /* @__PURE__ */ React15__default.createElement(
1582
+ Button,
1583
+ {
1584
+ variant: "outline",
1585
+ onClick: onToday,
1586
+ className: "h-9 px-5 rounded-xl text-sm font-medium hidden sm:inline-flex border-[0.5px] border-border/60 hover:border-primary/40 hover:bg-primary/5 hover:text-primary transition-all duration-200"
1587
+ },
1588
+ translations.today
1589
+ ), onCreateEvent && /* @__PURE__ */ React15__default.createElement(
1590
+ Button,
1591
+ {
1592
+ onClick: onCreateEvent,
1593
+ className: "h-9 px-4 rounded-xl text-sm font-medium hidden sm:inline-flex gap-1.5 shadow-sm shadow-primary/20 transition-all duration-200"
1594
+ },
1595
+ /* @__PURE__ */ React15__default.createElement(Plus, { className: "h-4 w-4" }),
1596
+ /* @__PURE__ */ React15__default.createElement("span", null, translations.createEvent ?? translations.create)
1597
+ ), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center bg-muted/40 rounded-xl p-0.5" }, /* @__PURE__ */ React15__default.createElement(
1598
+ Button,
1599
+ {
1600
+ variant: "ghost",
1601
+ size: "icon",
1602
+ onClick: onPrev,
1603
+ className: "rounded-lg h-8 w-8 hover:bg-background/80 transition-all duration-200"
1604
+ },
1605
+ /* @__PURE__ */ React15__default.createElement(ChevronLeft, { className: "h-4 w-4 text-muted-foreground" })
1606
+ ), /* @__PURE__ */ React15__default.createElement(
1607
+ Button,
1608
+ {
1609
+ variant: "ghost",
1610
+ size: "icon",
1611
+ onClick: onNext,
1612
+ className: "rounded-lg h-8 w-8 hover:bg-background/80 transition-all duration-200"
1613
+ },
1614
+ /* @__PURE__ */ React15__default.createElement(ChevronRight, { className: "h-4 w-4 text-muted-foreground" })
1615
+ )), /* @__PURE__ */ React15__default.createElement("div", { className: "ml-2 md:ml-4 hidden sm:block" }, /* @__PURE__ */ React15__default.createElement("h2", { className: "text-lg md:text-xl font-semibold text-foreground whitespace-nowrap capitalize tracking-tight" }, format(currentDate, "MMMM yyyy", { locale })))), /* @__PURE__ */ React15__default.createElement("div", { className: "sm:hidden" }, /* @__PURE__ */ React15__default.createElement("h2", { className: "text-lg font-semibold text-foreground whitespace-nowrap capitalize tracking-tight" }, format(currentDate, "MMMM yyyy", { locale })))), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2 md:gap-3 w-full md:w-auto justify-end" }, onLanguageChange && /* @__PURE__ */ React15__default.createElement("div", { className: "relative" }, /* @__PURE__ */ React15__default.createElement(
1616
+ "button",
1617
+ {
1618
+ ref: langButtonRef,
1619
+ onClick: () => setIsLangOpen(!isLangOpen),
1620
+ className: cn(
1621
+ "flex items-center gap-1.5 h-9 px-3 rounded-xl text-sm font-medium transition-all duration-200",
1622
+ "text-muted-foreground hover:text-foreground hover:bg-accent/80",
1623
+ isLangOpen && "bg-accent/80 text-foreground"
1624
+ ),
1625
+ title: currentLang.english
1626
+ },
1627
+ /* @__PURE__ */ React15__default.createElement(Globe, { className: "h-3.5 w-3.5" }),
1628
+ /* @__PURE__ */ React15__default.createElement("span", { className: "text-base leading-none" }, currentLang.flag),
1629
+ /* @__PURE__ */ React15__default.createElement("span", { className: "hidden sm:inline text-xs font-semibold uppercase tracking-wider" }, language),
1630
+ /* @__PURE__ */ React15__default.createElement(ChevronDown, { className: cn("h-3.5 w-3.5 transition-transform duration-200", isLangOpen && "rotate-180") })
1631
+ ), isLangOpen && langPos && createPortal(
1632
+ /* @__PURE__ */ React15__default.createElement(
1633
+ "div",
1634
+ {
1635
+ ref: langDropdownRef,
1636
+ className: "fixed w-52 bg-background border border-border/60 rounded-2xl shadow-2xl z-[9999] overflow-hidden py-1.5",
1637
+ style: { top: langPos.top, left: langPos.left, width: LANG_DROPDOWN_WIDTH }
1638
+ },
1639
+ /* @__PURE__ */ React15__default.createElement("div", { className: "px-3 py-2 border-b border-border/40 mb-1" }, /* @__PURE__ */ React15__default.createElement("p", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider" }, "Language / Dil")),
1640
+ /* @__PURE__ */ React15__default.createElement("div", { className: "max-h-72 overflow-y-auto" }, Object.entries(LANGUAGE_META).map(([code, meta]) => /* @__PURE__ */ React15__default.createElement(
1641
+ "button",
1642
+ {
1643
+ key: code,
1644
+ onClick: () => {
1645
+ onLanguageChange(code);
1646
+ setIsLangOpen(false);
1647
+ },
1648
+ className: cn(
1649
+ "w-full flex items-center gap-3 px-3 py-2.5 text-sm transition-all duration-150",
1650
+ "hover:bg-accent/60",
1651
+ language === code ? "bg-primary/10 text-primary font-semibold" : "text-foreground"
1652
+ )
1653
+ },
1654
+ /* @__PURE__ */ React15__default.createElement("span", { className: "text-lg leading-none w-6 text-center" }, meta.flag),
1655
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 text-left" }, /* @__PURE__ */ React15__default.createElement("div", { className: cn("font-medium", meta.rtl && "text-right") }, meta.native), /* @__PURE__ */ React15__default.createElement("div", { className: "text-xs text-muted-foreground" }, meta.english)),
1656
+ language === code && /* @__PURE__ */ React15__default.createElement("div", { className: "w-2 h-2 rounded-full bg-primary shrink-0" })
1657
+ )))
1658
+ ),
1659
+ document.body
1660
+ )), onThemeToggle && /* @__PURE__ */ React15__default.createElement(
1661
+ Button,
1662
+ {
1663
+ variant: "ghost",
1664
+ size: "icon",
1665
+ className: "rounded-xl h-9 w-9 hover:bg-accent/80 transition-all duration-200",
1666
+ onClick: onThemeToggle
1667
+ },
1668
+ isDarkMode ? /* @__PURE__ */ React15__default.createElement(Sun, { className: "h-4 w-4 text-amber-500" }) : /* @__PURE__ */ React15__default.createElement(Moon, { className: "h-4 w-4 text-muted-foreground" })
1669
+ ), !hideViewSwitcher && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center bg-muted/50 backdrop-blur-sm rounded-xl p-1 gap-0.5" }, viewConfig.map(({ key, icon: Icon }) => /* @__PURE__ */ React15__default.createElement(
1670
+ Button,
1671
+ {
1672
+ key,
1673
+ variant: "ghost",
1674
+ size: "sm",
1675
+ onClick: () => {
1676
+ onViewChange(key);
1677
+ onCustomViewChange?.(null);
1678
+ },
1679
+ className: cn(
1680
+ "h-8 px-3 text-xs rounded-lg transition-all duration-200 gap-1.5",
1681
+ view === key && !activeCustomViewId ? "bg-background shadow-sm text-foreground font-medium border-[0.5px] border-border/50" : "text-muted-foreground hover:text-foreground hover:bg-background/50"
1682
+ )
1683
+ },
1684
+ /* @__PURE__ */ React15__default.createElement(Icon, { className: "h-3.5 w-3.5" }),
1685
+ /* @__PURE__ */ React15__default.createElement("span", { className: "hidden sm:inline" }, translations[key])
1686
+ )), customViews && customViews.length > 0 && /* @__PURE__ */ React15__default.createElement(React15__default.Fragment, null, /* @__PURE__ */ React15__default.createElement("div", { className: "w-px h-5 bg-border/60 mx-0.5 shrink-0" }), /* @__PURE__ */ React15__default.createElement("div", { className: "relative" }, /* @__PURE__ */ React15__default.createElement(
1687
+ Button,
1688
+ {
1689
+ ref: customViewButtonRef,
1690
+ variant: "ghost",
1691
+ size: "sm",
1692
+ onClick: () => setIsCustomViewOpen((o) => !o),
1693
+ className: cn(
1694
+ "h-8 px-2.5 text-xs rounded-lg transition-all duration-200 gap-1",
1695
+ activeCustomViewId ? "bg-background shadow-sm text-foreground font-medium border-[0.5px] border-border/50" : "text-muted-foreground hover:text-foreground hover:bg-background/50"
1696
+ ),
1697
+ title: "Daha fazla g\xF6r\xFCn\xFCm"
1698
+ },
1699
+ activeCustomViewId ? customViews.find((cv) => cv.id === activeCustomViewId)?.label : /* @__PURE__ */ React15__default.createElement(MoreHorizontal, { className: "h-3.5 w-3.5" }),
1700
+ /* @__PURE__ */ React15__default.createElement(ChevronDown, { className: cn("h-3 w-3 transition-transform duration-150", isCustomViewOpen && "rotate-180") })
1701
+ ), isCustomViewOpen && customViewPos && createPortal(
1702
+ /* @__PURE__ */ React15__default.createElement(
1703
+ "div",
1704
+ {
1705
+ ref: customViewDropdownRef,
1706
+ className: "fixed min-w-[160px] bg-background border border-border/60 rounded-2xl shadow-2xl z-[9999] overflow-hidden py-1.5",
1707
+ style: { top: customViewPos.top, left: customViewPos.left, minWidth: CUSTOM_VIEW_DROPDOWN_WIDTH }
1708
+ },
1709
+ customViews.map((cv) => /* @__PURE__ */ React15__default.createElement(
1710
+ "button",
1711
+ {
1712
+ key: cv.id,
1713
+ onClick: () => {
1714
+ onCustomViewChange?.(cv.id);
1715
+ setIsCustomViewOpen(false);
1716
+ },
1717
+ className: cn(
1718
+ "w-full flex items-center gap-2.5 px-3 py-2.5 text-sm transition-all duration-150",
1719
+ "hover:bg-accent/60",
1720
+ activeCustomViewId === cv.id ? "bg-primary/10 text-primary font-semibold" : "text-foreground"
1721
+ )
1722
+ },
1723
+ cv.icon && /* @__PURE__ */ React15__default.createElement("span", { className: "w-4 h-4 flex items-center justify-center shrink-0" }, cv.icon),
1724
+ /* @__PURE__ */ React15__default.createElement("span", null, cv.label),
1725
+ activeCustomViewId === cv.id && /* @__PURE__ */ React15__default.createElement("span", { className: "ml-auto w-1.5 h-1.5 rounded-full bg-primary shrink-0" })
1726
+ ))
1727
+ ),
1728
+ document.body
1729
+ ))))));
1730
+ };
1731
+ var getMonthGrid = (date, weekStartOn = 0) => {
1732
+ const monthStart = startOfMonth(date);
1733
+ const monthEnd = endOfMonth(monthStart);
1734
+ const startDate = startOfWeek(monthStart, { weekStartsOn: weekStartOn });
1735
+ const endDate = endOfWeek(monthEnd, { weekStartsOn: weekStartOn });
1736
+ return eachDayOfInterval({
1737
+ start: startDate,
1738
+ end: endDate
1739
+ });
1740
+ };
1741
+ var AMPM_LANGUAGES = /* @__PURE__ */ new Set(["en"]);
1742
+ var uses12Hour = (language) => AMPM_LANGUAGES.has(language);
1743
+ var getTimeFormat = (language) => uses12Hour(language) ? "h a" : "H:mm";
1744
+ var getTimeFormatFull = (language) => uses12Hour(language) ? "h:mm a" : "HH:mm";
1745
+ var MiniCalendar = ({
1746
+ currentDate,
1747
+ onDateChange,
1748
+ onViewChange,
1749
+ className
1750
+ }) => {
1751
+ const [viewDate, setViewDate] = React15__default.useState(currentDate);
1752
+ React15__default.useEffect(() => {
1753
+ setViewDate(currentDate);
1754
+ }, [currentDate]);
1755
+ const days = React15__default.useMemo(() => getMonthGrid(viewDate), [viewDate]);
1756
+ const weekDays = ["S", "M", "T", "W", "T", "F", "S"];
1757
+ const handlePrev = () => {
1758
+ const newDate = subMonths(viewDate, 1);
1759
+ setViewDate(newDate);
1760
+ onDateChange(newDate);
1761
+ if (onViewChange) onViewChange("month");
1762
+ };
1763
+ const handleNext = () => {
1764
+ const newDate = addMonths(viewDate, 1);
1765
+ setViewDate(newDate);
1766
+ onDateChange(newDate);
1767
+ if (onViewChange) onViewChange("month");
1768
+ };
1769
+ const handleDateClick = (day) => {
1770
+ onDateChange(day);
1771
+ if (onViewChange) onViewChange("day");
1772
+ };
1773
+ return /* @__PURE__ */ React15__default.createElement("div", { className: cn("px-4 w-[260px]", className) }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-semibold text-foreground capitalize" }, format(viewDate, "MMMM yyyy")), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center bg-muted/40 rounded-lg p-0.5" }, /* @__PURE__ */ React15__default.createElement(
1774
+ Button,
1775
+ {
1776
+ variant: "ghost",
1777
+ size: "icon",
1778
+ className: "h-7 w-7 rounded-md hover:bg-background/80 transition-all",
1779
+ onClick: handlePrev,
1780
+ "aria-label": "Previous month"
1781
+ },
1782
+ /* @__PURE__ */ React15__default.createElement(ChevronLeft, { className: "h-4 w-4" })
1783
+ ), /* @__PURE__ */ React15__default.createElement(
1784
+ Button,
1785
+ {
1786
+ variant: "ghost",
1787
+ size: "icon",
1788
+ className: "h-7 w-7 rounded-md hover:bg-background/80 transition-all",
1789
+ onClick: handleNext,
1790
+ "aria-label": "Next month"
1791
+ },
1792
+ /* @__PURE__ */ React15__default.createElement(ChevronRight, { className: "h-4 w-4" })
1793
+ ))), /* @__PURE__ */ React15__default.createElement("div", { className: "grid grid-cols-7 gap-y-2 text-center mb-2" }, weekDays.map((day, i) => /* @__PURE__ */ React15__default.createElement("div", { key: `${day}-${i}`, className: "text-[10px] text-muted-foreground/70 font-semibold uppercase" }, day))), /* @__PURE__ */ React15__default.createElement("div", { className: "grid grid-cols-7 gap-y-1 text-center" }, days.map((day) => {
1794
+ const isSelected = isSameDay(day, currentDate);
1795
+ const isCurrentMonth = isSameMonth(day, viewDate);
1796
+ const isTodayDate = isToday(day);
1797
+ return /* @__PURE__ */ React15__default.createElement(
1798
+ "button",
1799
+ {
1800
+ key: day.toISOString(),
1801
+ onClick: () => handleDateClick(day),
1802
+ className: cn(
1803
+ "h-8 w-8 mx-auto flex items-center justify-center text-xs rounded-xl transition-all duration-200 font-medium",
1804
+ !isCurrentMonth && "text-muted-foreground/30",
1805
+ isCurrentMonth && !isSelected && !isTodayDate && "text-foreground hover:bg-accent/80",
1806
+ isSelected && "bg-primary text-primary-foreground shadow-md shadow-primary/30 scale-105",
1807
+ !isSelected && isTodayDate && "bg-primary/10 text-primary ring-1 ring-primary/30"
1808
+ )
1809
+ },
1810
+ format(day, "d")
1811
+ );
1812
+ })));
1813
+ };
1814
+ var Sidebar = ({
1815
+ currentDate,
1816
+ onDateChange,
1817
+ onViewChange,
1818
+ onEventCreate,
1819
+ timezone,
1820
+ onTimezoneChange,
1821
+ className,
1822
+ readOnly,
1823
+ calendars,
1824
+ onCalendarToggle,
1825
+ translations,
1826
+ renderMiniCalendar,
1827
+ sidebarMenus,
1828
+ activeCustomMenu,
1829
+ onCustomMenuChange,
1830
+ reverseTime = false,
1831
+ onReverseTimeChange,
1832
+ customViews,
1833
+ activeCustomViewId,
1834
+ onCustomViewChange
1835
+ }) => {
1836
+ const [calendarsOpen, setCalendarsOpen] = useState(true);
1837
+ const [timezoneOpen, setTimezoneOpen] = useState(false);
1838
+ const [now, setNow] = useState(null);
1839
+ const [hasMounted, setHasMounted] = useState(false);
1840
+ const [menusExpanded, setMenusExpanded] = useState(false);
1841
+ useEffect(() => {
1842
+ setHasMounted(true);
1843
+ setNow(/* @__PURE__ */ new Date());
1844
+ const timer = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
1845
+ return () => clearInterval(timer);
1846
+ }, []);
1847
+ const defaultCalendars = [
1848
+ { id: "1", label: "My Calendar", color: "#3b82f6", active: true },
1849
+ { id: "2", label: "Birthdays", color: "#10b981", active: true },
1850
+ { id: "3", label: "Tasks", color: "#6366f1", active: true }
1851
+ ];
1852
+ const displayCalendars = calendars || defaultCalendars;
1853
+ const getAcronym = (tz) => {
1854
+ if (!tz || !now) return "LOC";
1855
+ try {
1856
+ return new Intl.DateTimeFormat("en-US", { timeZone: tz, timeZoneName: "short" }).formatToParts(now).find((part) => part.type === "timeZoneName")?.value || "";
1857
+ } catch (e) {
1858
+ return "";
1859
+ }
1860
+ };
1861
+ const timezones = [
1862
+ { value: "", label: "Local Time", acronym: "LOC" },
1863
+ { value: "UTC", label: "UTC", acronym: "UTC" },
1864
+ { value: "America/New_York", label: "New York", acronym: "EST" },
1865
+ { value: "America/Chicago", label: "Chicago", acronym: "CST" },
1866
+ { value: "America/Denver", label: "Denver", acronym: "MST" },
1867
+ { value: "America/Los_Angeles", label: "Los Angeles", acronym: "PST" },
1868
+ { value: "Europe/London", label: "London", acronym: "GMT" },
1869
+ { value: "Europe/Paris", label: "Paris", acronym: "CET" },
1870
+ { value: "Europe/Berlin", label: "Berlin", acronym: "CET" },
1871
+ { value: "Asia/Dubai", label: "Dubai", acronym: "GST" },
1872
+ { value: "Asia/Tokyo", label: "Tokyo", acronym: "JST" },
1873
+ { value: "Asia/Singapore", label: "Singapore", acronym: "SGT" },
1874
+ { value: "Australia/Sydney", label: "Sydney", acronym: "AEDT" }
1875
+ ];
1876
+ const formatTzLabel = (tz, showTime = true) => {
1877
+ if (!hasMounted || !now || !showTime) {
1878
+ return /* @__PURE__ */ React15__default.createElement("span", null, tz.label);
1879
+ }
1880
+ let time = "";
1881
+ let acronym = tz.acronym;
1882
+ try {
1883
+ if (!tz.value) {
1884
+ time = format(now, "HH:mm");
1885
+ try {
1886
+ acronym = new Intl.DateTimeFormat("en-US", { timeZoneName: "short" }).formatToParts(now).find((part) => part.type === "timeZoneName")?.value || "LOC";
1887
+ } catch (e) {
1888
+ }
1889
+ } else {
1890
+ const zDate = toZonedTime(now, tz.value);
1891
+ time = format(zDate, "HH:mm");
1892
+ const dynAcronym = getAcronym(tz.value);
1893
+ if (dynAcronym && !dynAcronym.includes("GMT") && !dynAcronym.includes("Time")) {
1894
+ acronym = dynAcronym;
1895
+ }
1896
+ }
1897
+ } catch (e) {
1898
+ return /* @__PURE__ */ React15__default.createElement("span", null, tz.label);
1899
+ }
1900
+ return /* @__PURE__ */ React15__default.createElement("div", { className: "flex justify-between w-full" }, /* @__PURE__ */ React15__default.createElement("span", null, tz.label), /* @__PURE__ */ React15__default.createElement("span", { className: "text-muted-foreground ml-2 tabular-nums" }, time, " ", /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs opacity-75" }, "(", acronym, ")")));
1901
+ };
1902
+ const selectedTzObj = timezones.find((t) => t.value === (timezone || ""));
1903
+ const selectedTimezoneLabel = selectedTzObj ? formatTzLabel(selectedTzObj) : translations?.localTime ?? "Local Time";
1904
+ return /* @__PURE__ */ React15__default.createElement("div", { className: cn("flex flex-col w-[260px] overflow-x-hidden h-full bg-gradient-to-b scrollbar-hide from-background via-background to-muted/10 pt-4 pb-4 overflow-y-auto", className) }, sidebarMenus && sidebarMenus.length > 0 && /* @__PURE__ */ React15__default.createElement("div", { className: "px-4 mb-4" }, !menusExpanded && /* @__PURE__ */ React15__default.createElement(
1905
+ Button,
1906
+ {
1907
+ variant: "outline",
1908
+ className: "w-full rounded-2xl h-11 gap-2.5 justify-start border-[0.5px] border-border/60 hover:border-primary/40 hover:bg-primary/5 hover:text-primary transition-all duration-200 font-medium text-sm",
1909
+ onClick: () => setMenusExpanded(true)
1910
+ },
1911
+ /* @__PURE__ */ React15__default.createElement(LayoutGrid, { className: "w-4 h-4" }),
1912
+ /* @__PURE__ */ React15__default.createElement("span", null, "\u0130\u015Flemler")
1913
+ ), menusExpanded && /* @__PURE__ */ React15__default.createElement("div", { className: "animate-in fade-in slide-in-from-top-2 duration-200" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-between mb-2 px-1" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-semibold text-muted-foreground uppercase tracking-wider" }, "\u0130\u015Flemler"), /* @__PURE__ */ React15__default.createElement(
1914
+ "button",
1915
+ {
1916
+ onClick: () => setMenusExpanded(false),
1917
+ className: "w-6 h-6 rounded-lg flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-accent/60 transition-all duration-150"
1918
+ },
1919
+ /* @__PURE__ */ React15__default.createElement(X, { className: "w-3.5 h-3.5" })
1920
+ )), /* @__PURE__ */ React15__default.createElement("nav", { className: "space-y-0.5" }, /* @__PURE__ */ React15__default.createElement(
1921
+ "button",
1922
+ {
1923
+ onClick: () => {
1924
+ onCustomMenuChange?.(null);
1925
+ setMenusExpanded(false);
1926
+ },
1927
+ className: cn(
1928
+ "w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-sm font-medium transition-all duration-150",
1929
+ activeCustomMenu === null ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent/60 hover:text-foreground"
1930
+ )
1931
+ },
1932
+ /* @__PURE__ */ React15__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React15__default.createElement("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }), /* @__PURE__ */ React15__default.createElement("line", { x1: "16", y1: "2", x2: "16", y2: "6" }), /* @__PURE__ */ React15__default.createElement("line", { x1: "8", y1: "2", x2: "8", y2: "6" }), /* @__PURE__ */ React15__default.createElement("line", { x1: "3", y1: "10", x2: "21", y2: "10" })),
1933
+ /* @__PURE__ */ React15__default.createElement("span", null, "Takvim"),
1934
+ activeCustomMenu === null && /* @__PURE__ */ React15__default.createElement("span", { className: "ml-auto w-1.5 h-1.5 rounded-full bg-primary" })
1935
+ ), sidebarMenus?.map((item) => /* @__PURE__ */ React15__default.createElement(
1936
+ "button",
1937
+ {
1938
+ key: item.id,
1939
+ onClick: () => {
1940
+ onCustomMenuChange?.(item.id);
1941
+ setMenusExpanded(false);
1942
+ },
1943
+ className: cn(
1944
+ "w-full flex items-center gap-3 px-3 py-2.5 rounded-xl text-sm font-medium transition-all duration-150",
1945
+ activeCustomMenu === item.id ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-accent/60 hover:text-foreground"
1946
+ )
1947
+ },
1948
+ item.icon && /* @__PURE__ */ React15__default.createElement("span", { className: "w-4 h-4 shrink-0 flex items-center justify-center" }, item.icon),
1949
+ /* @__PURE__ */ React15__default.createElement("span", { className: "truncate" }, item.label),
1950
+ activeCustomMenu === item.id && /* @__PURE__ */ React15__default.createElement("span", { className: "ml-auto w-1.5 h-1.5 rounded-full bg-primary" })
1951
+ ))))), onEventCreate && /* @__PURE__ */ React15__default.createElement("div", { className: "md:hidden px-4 mb-4" }, /* @__PURE__ */ React15__default.createElement(
1952
+ Button,
1953
+ {
1954
+ onClick: () => {
1955
+ onEventCreate();
1956
+ },
1957
+ className: "w-full rounded-2xl h-11 gap-2.5 justify-center shadow-sm shadow-primary/20 transition-all duration-200 font-medium text-sm"
1958
+ },
1959
+ /* @__PURE__ */ React15__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React15__default.createElement("path", { d: "M5 12h14" }), /* @__PURE__ */ React15__default.createElement("path", { d: "M12 5v14" })),
1960
+ /* @__PURE__ */ React15__default.createElement("span", null, translations?.createEvent ?? "Etkinlik Olu\u015Ftur")
1961
+ )), onReverseTimeChange && /* @__PURE__ */ React15__default.createElement("div", { className: "px-4 mb-4" }, /* @__PURE__ */ React15__default.createElement(
1962
+ "button",
1963
+ {
1964
+ onClick: () => onReverseTimeChange(!reverseTime),
1965
+ className: cn(
1966
+ "w-full flex items-center justify-between px-3 py-2.5 rounded-xl border-[0.5px] transition-all duration-200 group",
1967
+ reverseTime ? "bg-primary/10 border-primary/30 text-primary" : "bg-muted/30 border-border/50 text-muted-foreground hover:border-primary/30 hover:text-foreground"
1968
+ )
1969
+ },
1970
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2.5" }, /* @__PURE__ */ React15__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: "w-4 h-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React15__default.createElement("line", { x1: "12", y1: "19", x2: "12", y2: "5" }), /* @__PURE__ */ React15__default.createElement("polyline", { points: "5 12 12 5 19 12" }), /* @__PURE__ */ React15__default.createElement("line", { x1: "12", y1: "5", x2: "12", y2: "19", className: "opacity-40" }), /* @__PURE__ */ React15__default.createElement("polyline", { points: "5 12 12 19 19 12", className: "opacity-40" })), /* @__PURE__ */ React15__default.createElement("div", { className: "text-left" }, /* @__PURE__ */ React15__default.createElement("div", { className: "text-xs font-semibold leading-tight" }, "Saat Y\xF6n\xFC"), /* @__PURE__ */ React15__default.createElement("div", { className: "text-[10px] leading-tight opacity-70 mt-0.5" }, reverseTime ? "23:00 \u2192 00:00" : "00:00 \u2192 23:00"))),
1971
+ /* @__PURE__ */ React15__default.createElement("div", { className: cn(
1972
+ "relative w-9 h-5 rounded-full transition-colors duration-200 shrink-0",
1973
+ reverseTime ? "bg-primary" : "bg-border"
1974
+ ) }, /* @__PURE__ */ React15__default.createElement("span", { className: cn(
1975
+ "absolute top-0.5 w-4 h-4 bg-white rounded-full shadow-sm transition-all duration-200",
1976
+ reverseTime ? "left-4" : "left-0.5"
1977
+ ) }))
1978
+ )), renderMiniCalendar ? (
1979
+ // Custom mini-calendar: receives the same props as the built-in one
1980
+ renderMiniCalendar({ currentDate, onDateChange, onViewChange })
1981
+ ) : /* @__PURE__ */ React15__default.createElement(MiniCalendar, { currentDate, onDateChange, onViewChange }), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 px-4 space-y-5 mt-5" }, /* @__PURE__ */ React15__default.createElement("div", { className: "bg-muted/20 rounded-2xl p-3 border-[0px] border-border/30" }, /* @__PURE__ */ React15__default.createElement(
1982
+ "div",
1983
+ {
1984
+ className: "flex items-center justify-between cursor-pointer hover:bg-accent/50 p-2 -m-1 rounded-xl mb-2 transition-all duration-200",
1985
+ onClick: () => setCalendarsOpen(!calendarsOpen)
1986
+ },
1987
+ /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-semibold text-foreground" }, translations?.calendars),
1988
+ /* @__PURE__ */ React15__default.createElement(ChevronDown, { className: cn("w-4 h-4 text-muted-foreground transition-transform duration-200", calendarsOpen && "rotate-180") })
1989
+ ), calendarsOpen && /* @__PURE__ */ React15__default.createElement("div", { className: "space-y-1" }, displayCalendars.map((cal) => /* @__PURE__ */ React15__default.createElement(
1990
+ "div",
1991
+ {
1992
+ key: cal.id,
1993
+ className: "flex items-center gap-3 py-2 px-2 hover:bg-accent/60 rounded-xl cursor-pointer group transition-all duration-200",
1994
+ onClick: () => onCalendarToggle?.(cal.id, !(cal.active ?? true))
1995
+ },
1996
+ /* @__PURE__ */ React15__default.createElement("div", { className: "relative flex items-center justify-center" }, /* @__PURE__ */ React15__default.createElement(
1997
+ "input",
1998
+ {
1999
+ type: "checkbox",
2000
+ checked: cal.active ?? true,
2001
+ onChange: (e) => {
2002
+ e.stopPropagation();
2003
+ onCalendarToggle?.(cal.id, e.target.checked);
2004
+ },
2005
+ className: "peer h-5 w-5 rounded-md border-2 border-border/60 cursor-pointer appearance-none checked:border-transparent transition-all duration-200",
2006
+ style: { "--primary-color": cal.color },
2007
+ "data-cal-id": cal.id
2008
+ }
2009
+ ), /* @__PURE__ */ React15__default.createElement("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none opacity-0 peer-checked:opacity-100 transition-opacity" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-3.5 h-3.5 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3 }, /* @__PURE__ */ React15__default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }))), /* @__PURE__ */ React15__default.createElement("style", null, `
2010
+ input[type="checkbox"][data-cal-id="${cal.id}"]:checked {
2011
+ background-color: ${cal.color} !important;
2012
+ border-color: ${cal.color} !important;
2013
+ }
2014
+ input[type="checkbox"][data-cal-id="${cal.id}"]:focus {
2015
+ --tw-ring-color: ${cal.color}40 !important;
2016
+ }
2017
+ `)),
2018
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2 flex-1 min-w-0" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm text-foreground/90 truncate font-medium" }, cal.label)),
2019
+ /* @__PURE__ */ React15__default.createElement(
2020
+ "div",
2021
+ {
2022
+ className: "w-2 h-2 rounded-full opacity-60 group-hover:opacity-100 transition-opacity",
2023
+ style: { backgroundColor: cal.color }
2024
+ }
2025
+ )
2026
+ ))))), /* @__PURE__ */ React15__default.createElement("div", { className: "mt-auto px-4 pt-5" }, /* @__PURE__ */ React15__default.createElement("div", { className: "bg-muted/20 rounded-2xl p-3" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2 mb-3" }, /* @__PURE__ */ React15__default.createElement("div", { className: "p-1.5 bg-primary/10 rounded-lg" }, /* @__PURE__ */ React15__default.createElement(Globe, { className: "w-4 h-4 text-primary" })), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-semibold text-foreground" }, translations?.timezone)), /* @__PURE__ */ React15__default.createElement("div", { className: "relative" }, /* @__PURE__ */ React15__default.createElement(
2027
+ "button",
2028
+ {
2029
+ onClick: () => setTimezoneOpen(!timezoneOpen),
2030
+ className: "w-full flex items-center justify-between bg-blue-200/40 hover:bg-blue-200/80 rounded-xl py-2.5 pl-4 pr-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary/50 transition-all duration-200 text-left"
2031
+ },
2032
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 truncate mr-2 font-medium" }, selectedTimezoneLabel),
2033
+ /* @__PURE__ */ React15__default.createElement(ChevronDown, { className: cn("w-4 h-4 text-muted-foreground transition-transform duration-200", timezoneOpen && "rotate-180") })
2034
+ ), timezoneOpen && /* @__PURE__ */ React15__default.createElement(React15__default.Fragment, null, /* @__PURE__ */ React15__default.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setTimezoneOpen(false) }), /* @__PURE__ */ React15__default.createElement("div", { className: "absolute bottom-full left-0 w-full mb-2 bg-background rounded-xl shadow-2xl z-50 max-h-[260px] overflow-y-auto p-1.5 animate-in fade-in zoom-in-95 duration-200 backdrop-blur-none" }, timezones.map((tz) => /* @__PURE__ */ React15__default.createElement(
2035
+ "div",
2036
+ {
2037
+ key: tz.value,
2038
+ className: cn(
2039
+ "px-3 py-2.5 text-sm rounded-lg cursor-pointer transition-all duration-200",
2040
+ (timezone || "") === tz.value ? "bg-primary text-primary-foreground font-semibold" : "text-foreground hover:bg-accent/80"
2041
+ ),
2042
+ onClick: () => {
2043
+ onTimezoneChange?.(tz.value);
2044
+ setTimezoneOpen(false);
2045
+ }
2046
+ },
2047
+ formatTzLabel(tz)
2048
+ ))))))));
2049
+ };
2050
+ var DraggableEvent = ({ event, children, className, style: propStyle, ...props }) => {
2051
+ const { attributes, listeners, setNodeRef, transform, isDragging } = useDraggable({
2052
+ id: event.id,
2053
+ data: { event }
2054
+ });
2055
+ const style = {
2056
+ ...propStyle,
2057
+ transform: CSS.Translate.toString(transform),
2058
+ zIndex: isDragging ? 100 : propStyle?.zIndex,
2059
+ // When dragging, we want the ORIGINAL element to be almost invisible (or fully invisible)
2060
+ // so that the DragOverlay (the "ghost") is the only thing the user focuses on.
2061
+ // If we set opacity: 0, it disappears. If 0.1, it's a faint placeholder.
2062
+ // The user asked for "Make the entire dragged item transparent".
2063
+ // Usually this means the original item should be faded out while the drag overlay is moving.
2064
+ opacity: isDragging ? 0 : propStyle?.opacity
2065
+ // Hiding original element completely
2066
+ };
2067
+ return /* @__PURE__ */ React15__default.createElement(
2068
+ "div",
2069
+ {
2070
+ ref: setNodeRef,
2071
+ style,
2072
+ ...listeners,
2073
+ ...attributes,
2074
+ ...props,
2075
+ className: cn("touch-none", className)
2076
+ },
2077
+ children
2078
+ );
2079
+ };
2080
+ var DroppableCell = ({ id, date, resourceId, children, className, style, onClick }) => {
2081
+ const { isOver, setNodeRef } = useDroppable({
2082
+ id,
2083
+ data: { date, resourceId }
2084
+ });
2085
+ const minutes = date.getMinutes();
2086
+ const quarterClass = minutes === 0 ? "hover:bg-blue-50/50 dark:hover:bg-blue-900/10" : minutes === 15 ? "hover:bg-blue-50/80 dark:hover:bg-blue-900/20" : minutes === 30 ? "hover:bg-blue-100/50 dark:hover:bg-blue-900/30" : "hover:bg-blue-100/80 dark:hover:bg-blue-900/40";
2087
+ const activeQuarterClass = minutes === 0 ? "bg-blue-50/50 dark:bg-blue-900/10 ring-2 ring-primary ring-inset" : minutes === 15 ? "bg-blue-50/80 dark:bg-blue-900/20 ring-2 ring-primary ring-inset" : minutes === 30 ? "bg-blue-100/50 dark:bg-blue-900/30 ring-2 ring-primary ring-inset" : "bg-blue-100/80 dark:bg-blue-900/40 ring-2 ring-primary ring-inset";
2088
+ return /* @__PURE__ */ React15__default.createElement(
2089
+ "div",
2090
+ {
2091
+ ref: setNodeRef,
2092
+ className: cn(
2093
+ className,
2094
+ quarterClass,
2095
+ isOver && activeQuarterClass
2096
+ ),
2097
+ style,
2098
+ onClick
2099
+ },
2100
+ children
2101
+ );
2102
+ };
2103
+
2104
+ // src/views/MonthView.tsx
2105
+ var EventItem = React15__default.memo(({ event, onEventClick }) => /* @__PURE__ */ React15__default.createElement(DraggableEvent, { event }, /* @__PURE__ */ React15__default.createElement(
2106
+ "div",
2107
+ {
2108
+ className: cn(
2109
+ "text-xs px-2.5 py-1.5 rounded-lg truncate cursor-pointer shadow-sm transition-all duration-200",
2110
+ "hover:shadow-md hover:scale-[1.02] hover:z-10",
2111
+ !event.color && "bg-primary/10 text-primary hover:bg-primary/15 border-[0.5px] border-primary/20"
2112
+ ),
2113
+ style: event.color ? {
2114
+ backgroundColor: `${event.color}20`,
2115
+ color: event.color,
2116
+ borderLeft: `3px solid ${event.color}`
2117
+ } : void 0,
2118
+ onClick: (e) => {
2119
+ e.stopPropagation();
2120
+ onEventClick?.(event);
2121
+ }
2122
+ },
2123
+ /* @__PURE__ */ React15__default.createElement("span", { className: "font-medium" }, event.title)
2124
+ )));
2125
+ EventItem.displayName = "EventItem";
2126
+ var MonthView = ({
2127
+ currentDate,
2128
+ events,
2129
+ onEventClick,
2130
+ onDateClick,
2131
+ timezone,
2132
+ locale
2133
+ }) => {
2134
+ const days = useMemo(() => getMonthGrid(currentDate), [currentDate]);
2135
+ const weekDays = useMemo(() => {
2136
+ const start = startOfWeek(currentDate, { weekStartsOn: 1 });
2137
+ const end = endOfWeek(currentDate, { weekStartsOn: 1 });
2138
+ return eachDayOfInterval({ start, end });
2139
+ }, [currentDate]);
2140
+ const getZonedDate = useCallback((date) => {
2141
+ return timezone ? toZonedTime(date, timezone) : date;
2142
+ }, [timezone]);
2143
+ const eventsByDay = useMemo(() => {
2144
+ const map = /* @__PURE__ */ new Map();
2145
+ events.forEach((event) => {
2146
+ const zonedStart = getZonedDate(event.start);
2147
+ const key = format(zonedStart, "yyyy-MM-dd");
2148
+ if (!map.has(key)) {
2149
+ map.set(key, []);
2150
+ }
2151
+ map.get(key).push(event);
2152
+ });
2153
+ return map;
2154
+ }, [events, getZonedDate]);
2155
+ return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full min-h-0 bg-background border-[0.5px] scrollbar-hide border-border/50 rounded-2xl overflow-hidden min-w-[800px] md:min-w-0 shadow-sm" }, /* @__PURE__ */ React15__default.createElement("div", { className: "overflow-y-auto flex-1 min-h-0 relative" }, /* @__PURE__ */ React15__default.createElement("div", { className: "grid grid-cols-7 border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/30 via-muted/40 to-muted/30 sticky top-0 z-20 backdrop-blur-sm" }, weekDays.map((day) => /* @__PURE__ */ React15__default.createElement(
2156
+ "div",
2157
+ {
2158
+ key: day.toISOString(),
2159
+ className: "py-3 text-center text-xs font-semibold text-muted-foreground border-r-[0.5px] border-border/30 last:border-r-0 uppercase tracking-wider"
2160
+ },
2161
+ format(day, "EEE", { locale })
2162
+ ))), /* @__PURE__ */ React15__default.createElement("div", { className: "grid grid-cols-7", style: { gridAutoRows: "130px" } }, days.map((day) => {
2163
+ const dayKey = format(day, "yyyy-MM-dd");
2164
+ const dayEvents = eventsByDay.get(dayKey) || [];
2165
+ const isCurrentMonth = isSameMonth(day, currentDate);
2166
+ const cellId = day.toISOString();
2167
+ return /* @__PURE__ */ React15__default.createElement(
2168
+ DroppableCell,
2169
+ {
2170
+ key: cellId,
2171
+ id: cellId,
2172
+ date: day,
2173
+ className: cn(
2174
+ "h-[130px] p-2 border-b-[0.5px] border-r-[0.5px] border-border/30 last:border-r-0 relative transition-all duration-200 hover:bg-accent/5 flex flex-col gap-1.5 overflow-hidden group",
2175
+ !isCurrentMonth && "bg-muted/5 text-muted-foreground/60",
2176
+ isToday(day) && "bg-primary/5 ring-1 ring-inset ring-primary/20"
2177
+ ),
2178
+ onClick: () => onDateClick?.(day)
2179
+ },
2180
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex justify-between items-start" }, /* @__PURE__ */ React15__default.createElement("div", { className: cn(
2181
+ "text-sm font-semibold w-7 h-7 flex items-center justify-center rounded-full transition-all duration-200",
2182
+ isToday(day) ? "bg-primary text-primary-foreground shadow-md shadow-primary/30" : "group-hover:bg-accent"
2183
+ ) }, format(day, "d", { locale })), dayEvents.length > 0 && /* @__PURE__ */ React15__default.createElement("div", { className: "text-[10px] font-medium text-muted-foreground/60 bg-muted/50 px-1.5 py-0.5 rounded-full" }, dayEvents.length)),
2184
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 flex flex-col gap-1 scrollbar-hide overflow-y-auto overflow-x-hidden" }, dayEvents.slice(0, 4).map((event) => /* @__PURE__ */ React15__default.createElement(EventItem, { key: `${event.id}-${dayKey}`, event, onEventClick })), dayEvents.length > 4 && /* @__PURE__ */ React15__default.createElement("div", { className: "text-[10px] text-primary font-semibold text-center py-1 px-2 rounded-md bg-primary/5 hover:bg-primary/10 cursor-pointer transition-colors" }, "+", dayEvents.length - 4, " more"))
2185
+ );
2186
+ }))));
2187
+ };
2188
+ var ResizableEvent = ({
2189
+ event,
2190
+ hourHeight,
2191
+ minDuration = 15,
2192
+ onResize,
2193
+ children,
2194
+ className,
2195
+ style,
2196
+ readonly
2197
+ }) => {
2198
+ const [isResizing, setIsResizing] = useState(false);
2199
+ const [resizeHeight, setResizeHeight] = useState(null);
2200
+ const containerRef = useRef(null);
2201
+ const startYRef = useRef(0);
2202
+ const startHeightRef = useRef(0);
2203
+ const handleResizeStart = useCallback((e) => {
2204
+ e.preventDefault();
2205
+ e.stopPropagation();
2206
+ const clientY = "touches" in e ? e.touches[0].clientY : e.clientY;
2207
+ startYRef.current = clientY;
2208
+ startHeightRef.current = containerRef.current?.offsetHeight || 0;
2209
+ setIsResizing(true);
2210
+ const handleMove = (moveEvent) => {
2211
+ const moveClientY = "touches" in moveEvent ? moveEvent.touches[0].clientY : moveEvent.clientY;
2212
+ const deltaY = moveClientY - startYRef.current;
2213
+ const snapInterval = hourHeight / 4;
2214
+ const snappedDelta = Math.round(deltaY / snapInterval) * snapInterval;
2215
+ const newHeight = Math.max(
2216
+ minDuration / 60 * hourHeight,
2217
+ // Minimum height based on minDuration
2218
+ startHeightRef.current + snappedDelta
2219
+ );
2220
+ setResizeHeight(newHeight);
2221
+ };
2222
+ const handleEnd = () => {
2223
+ setIsResizing(false);
2224
+ if (resizeHeight !== null && containerRef.current && onResize) {
2225
+ const originalHeight = startHeightRef.current;
2226
+ const heightDiff = (resizeHeight || originalHeight) - originalHeight;
2227
+ const minutesDiff = heightDiff / hourHeight * 60;
2228
+ const newEnd = new Date(event.end);
2229
+ newEnd.setMinutes(newEnd.getMinutes() + minutesDiff);
2230
+ if (newEnd > event.start) {
2231
+ onResize(event, newEnd);
2232
+ }
2233
+ }
2234
+ setResizeHeight(null);
2235
+ document.removeEventListener("mousemove", handleMove);
2236
+ document.removeEventListener("mouseup", handleEnd);
2237
+ document.removeEventListener("touchmove", handleMove);
2238
+ document.removeEventListener("touchend", handleEnd);
2239
+ };
2240
+ document.addEventListener("mousemove", handleMove);
2241
+ document.addEventListener("mouseup", handleEnd);
2242
+ document.addEventListener("touchmove", handleMove, { passive: false });
2243
+ document.addEventListener("touchend", handleEnd);
2244
+ }, [event, hourHeight, minDuration, onResize, resizeHeight]);
2245
+ return /* @__PURE__ */ React15__default.createElement(
2246
+ "div",
2247
+ {
2248
+ ref: containerRef,
2249
+ className: cn("relative group", className),
2250
+ style: {
2251
+ ...style,
2252
+ height: resizeHeight !== null ? `${resizeHeight}px` : style?.height
2253
+ }
2254
+ },
2255
+ children,
2256
+ /* @__PURE__ */ React15__default.createElement(
2257
+ "div",
2258
+ {
2259
+ className: cn(
2260
+ readonly ? "cursor-default" : "cursor-ns-resize group-hover:opacity-100",
2261
+ "absolute bottom-0 left-0 right-0 h-3 z-20 flex items-center justify-center",
2262
+ "opacity-0 transition-opacity",
2263
+ isResizing && "opacity-100"
2264
+ ),
2265
+ onMouseDown: readonly ? void 0 : handleResizeStart,
2266
+ onTouchStart: readonly ? void 0 : handleResizeStart
2267
+ },
2268
+ /* @__PURE__ */ React15__default.createElement("div", { className: cn(
2269
+ "w-8 h-1 rounded-full transition-all",
2270
+ isResizing ? "bg-primary" : "bg-muted-foreground/30 group-hover:bg-primary/50"
2271
+ ) })
2272
+ ),
2273
+ isResizing && /* @__PURE__ */ React15__default.createElement("div", { className: "absolute inset-0 border-2 border-primary border-dashed rounded-md pointer-events-none bg-primary/5" })
2274
+ );
2275
+ };
2276
+
2277
+ // src/views/WeekView.tsx
2278
+ var WeekView = ({
2279
+ currentDate,
2280
+ events,
2281
+ onEventClick,
2282
+ onTimeSlotClick,
2283
+ onEventResize,
2284
+ timezone,
2285
+ locale,
2286
+ readonly,
2287
+ language = "tr",
2288
+ initialScrollHour = 8,
2289
+ reverseTime = false
2290
+ }) => {
2291
+ const start = startOfWeek(currentDate, { weekStartsOn: 1 });
2292
+ const end = endOfWeek(currentDate, { weekStartsOn: 1 });
2293
+ const weekDays = eachDayOfInterval({ start, end });
2294
+ const hours = reverseTime ? Array.from({ length: 24 }, (_, i) => 23 - i) : Array.from({ length: 24 }, (_, i) => i);
2295
+ const hourHeight = 60;
2296
+ const scrollContainerRef = React15__default.useRef(null);
2297
+ const [now, setNow] = React15__default.useState(/* @__PURE__ */ new Date());
2298
+ React15__default.useEffect(() => {
2299
+ const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
2300
+ return () => clearInterval(interval);
2301
+ }, []);
2302
+ React15__default.useEffect(() => {
2303
+ if (scrollContainerRef.current) {
2304
+ scrollContainerRef.current.scrollTop = reverseTime ? (23 - initialScrollHour) * hourHeight : initialScrollHour * hourHeight;
2305
+ }
2306
+ }, []);
2307
+ const getZonedDate = (date) => {
2308
+ return timezone ? toZonedTime(date, timezone) : date;
2309
+ };
2310
+ const zonedNow = getZonedDate(/* @__PURE__ */ new Date());
2311
+ const getTimezoneDisplay = (tz) => {
2312
+ const date = now;
2313
+ let displayTime = "";
2314
+ let acronym = "";
2315
+ if (!tz) {
2316
+ displayTime = format(date, "HH:mm");
2317
+ try {
2318
+ acronym = new Intl.DateTimeFormat("en-US", { timeZoneName: "short" }).formatToParts(date).find((part) => part.type === "timeZoneName")?.value || "";
2319
+ } catch (e) {
2320
+ acronym = "LOC";
2321
+ }
2322
+ } else {
2323
+ try {
2324
+ const zDate = toZonedTime(date, tz);
2325
+ displayTime = format(zDate, "HH:mm");
2326
+ acronym = new Intl.DateTimeFormat("en-US", { timeZone: tz, timeZoneName: "short" }).formatToParts(date).find((part) => part.type === "timeZoneName")?.value || "";
2327
+ } catch (e) {
2328
+ displayTime = format(date, "HH:mm");
2329
+ acronym = tz;
2330
+ }
2331
+ }
2332
+ return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center justify-center leading-tight" }, /* @__PURE__ */ React15__default.createElement("span", null, displayTime), /* @__PURE__ */ React15__default.createElement("span", { className: "text-[10px] opacity-75" }, "(", acronym, ")"));
2333
+ };
2334
+ const timeFormat = getTimeFormat(language);
2335
+ const eventTimeFormat = getTimeFormatFull(language);
2336
+ const nowFormat = getTimeFormatFull(language);
2337
+ return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full min-h-0 bg-background border-[0.5px] border-border/50 rounded-2xl overflow-hidden min-w-[800px] md:min-w-0 shadow-sm" }, /* @__PURE__ */ React15__default.createElement(
2338
+ "div",
2339
+ {
2340
+ ref: scrollContainerRef,
2341
+ className: "flex-1 min-h-0 overflow-y-auto scrollbar-hide relative bg-background scroll-smooth",
2342
+ style: { scrollbarGutter: "stable" }
2343
+ },
2344
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/20 via-background to-muted/20 z-20 sticky top-0 backdrop-blur-sm" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex-none p-3 text-center text-xs font-semibold text-muted-foreground w-16 flex items-center justify-center border-r-[0.5px] border-border/30 bg-muted/10" }, getTimezoneDisplay(timezone)), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 grid grid-cols-7" }, weekDays.map((day, index) => /* @__PURE__ */ React15__default.createElement("div", { key: day.toISOString(), className: cn("py-3 px-2 text-center", index > 0 && "border-l-[0.5px] border-border/30") }, /* @__PURE__ */ React15__default.createElement("div", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1.5" }, format(day, "EEE", { locale })), /* @__PURE__ */ React15__default.createElement("div", { className: cn(
2345
+ "w-9 h-9 flex items-center justify-center rounded-xl mx-auto text-sm font-semibold transition-all duration-200",
2346
+ isToday(day) ? "bg-primary text-primary-foreground shadow-lg shadow-primary/30 scale-110" : "text-foreground hover:bg-accent/80"
2347
+ ) }, format(day, "d", { locale })))))),
2348
+ /* @__PURE__ */ React15__default.createElement(
2349
+ "div",
2350
+ {
2351
+ className: "flex min-w-full relative",
2352
+ style: { height: hours.length * hourHeight }
2353
+ },
2354
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex-none w-16 border-r-[0.5px] border-border/30 relative bg-muted/5" }, hours.map((hour) => /* @__PURE__ */ React15__default.createElement(
2355
+ "div",
2356
+ {
2357
+ key: hour,
2358
+ className: "relative w-full text-[11px] text-muted-foreground/80 text-right pr-3 font-medium tabular-nums box-border",
2359
+ style: { height: hourHeight }
2360
+ },
2361
+ /* @__PURE__ */ React15__default.createElement("span", { className: "block -translate-y-1/2" }, hour !== 0 && format((/* @__PURE__ */ new Date()).setHours(hour, 0, 0, 0), timeFormat, { locale }))
2362
+ ))),
2363
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 grid grid-cols-7 relative" }, weekDays.map((day, dayIndex) => {
2364
+ const dayEvents = events.filter((e) => {
2365
+ const zonedStart = getZonedDate(e.start);
2366
+ return isSameDay(zonedStart, day);
2367
+ });
2368
+ return /* @__PURE__ */ React15__default.createElement("div", { key: day.toISOString(), className: cn("relative h-full", dayIndex > 0 && "border-l-[0.5px] border-border/30") }, hours.map((hour) => {
2369
+ return /* @__PURE__ */ React15__default.createElement(
2370
+ "div",
2371
+ {
2372
+ key: hour,
2373
+ className: "w-full border-b-[0.5px] border-dashed border-border/20 box-border relative hover:bg-accent/5 transition-colors",
2374
+ style: { height: hourHeight }
2375
+ },
2376
+ [0, 15, 30, 45].map((minute) => {
2377
+ const cellDate = new Date(day);
2378
+ cellDate.setHours(hour, minute, 0, 0);
2379
+ const cellId = cellDate.toISOString();
2380
+ return /* @__PURE__ */ React15__default.createElement(
2381
+ DroppableCell,
2382
+ {
2383
+ key: minute,
2384
+ id: cellId,
2385
+ date: cellDate,
2386
+ className: "w-full absolute left-0 right-0 z-0 transition-colors",
2387
+ style: {
2388
+ height: "25%",
2389
+ top: `${minute / 60 * 100}%`
2390
+ }
2391
+ },
2392
+ /* @__PURE__ */ React15__default.createElement(
2393
+ "div",
2394
+ {
2395
+ className: "w-full h-full bg-transparent cursor-pointer",
2396
+ onClick: () => onTimeSlotClick?.(cellDate)
2397
+ }
2398
+ )
2399
+ );
2400
+ })
2401
+ );
2402
+ }), dayEvents.map((event) => {
2403
+ const overlappingEvents = dayEvents.filter((e) => {
2404
+ if (e.id === event.id) return false;
2405
+ const s1 = getZonedDate(event.start).getTime();
2406
+ const e1 = getZonedDate(event.end).getTime();
2407
+ const s2 = getZonedDate(e.start).getTime();
2408
+ const e2 = getZonedDate(e.end).getTime();
2409
+ return s1 < e2 && e1 > s2;
2410
+ });
2411
+ const group = [event, ...overlappingEvents].sort(
2412
+ (a, b) => getZonedDate(a.start).getTime() - getZonedDate(b.start).getTime() || (a.id > b.id ? 1 : -1)
2413
+ // stable sort
2414
+ );
2415
+ const index = group.findIndex((e) => e.id === event.id);
2416
+ const count = group.length;
2417
+ const widthPercent = 100 / count;
2418
+ const leftPercent = index * widthPercent;
2419
+ const zonedEventStart = getZonedDate(event.start);
2420
+ const zonedEventEnd = getZonedDate(event.end);
2421
+ const startMinutes = zonedEventStart.getHours() * 60 + zonedEventStart.getMinutes();
2422
+ const durationMinutes = differenceInMinutes(zonedEventEnd, zonedEventStart);
2423
+ const height = durationMinutes / 60 * hourHeight;
2424
+ const top = reverseTime ? (1440 - startMinutes - durationMinutes) / 60 * hourHeight : startMinutes / 60 * hourHeight;
2425
+ const isShortEvent = durationMinutes < 60;
2426
+ return /* @__PURE__ */ React15__default.createElement(
2427
+ DraggableEvent,
2428
+ {
2429
+ key: `${event.id}-${day.toISOString()}`,
2430
+ event,
2431
+ className: `absolute z-10 transition-all ${readonly ? "cursor-default" : ""}`,
2432
+ style: {
2433
+ top: `${top}px`,
2434
+ height: `${Math.max(height, 20)}px`,
2435
+ left: `${leftPercent}%`,
2436
+ width: `${widthPercent}%`,
2437
+ // Add minimal spacing between overlapping events
2438
+ paddingRight: count > 1 ? "2px" : "0"
2439
+ }
2440
+ },
2441
+ /* @__PURE__ */ React15__default.createElement(
2442
+ ResizableEvent,
2443
+ {
2444
+ readonly,
2445
+ event,
2446
+ hourHeight,
2447
+ onResize: onEventResize,
2448
+ className: "h-full",
2449
+ style: { height: "100%" }
2450
+ },
2451
+ /* @__PURE__ */ React15__default.createElement(
2452
+ "div",
2453
+ {
2454
+ className: cn(
2455
+ "rounded-md border shadow-sm transition-all hover:shadow-md group overflow-hidden relative",
2456
+ "glass",
2457
+ readonly ? "cursor-default" : "cursor-grab active:cursor-grabbing",
2458
+ !event.color && "border-primary/20 bg-primary/10",
2459
+ isShortEvent ? "px-1 flex items-center justify-center" : "p-2",
2460
+ // Add active border for overlapped events to distinguish them
2461
+ count > 1 && "border-l-4 border-l-primary/50"
2462
+ ),
2463
+ style: {
2464
+ height: "100%",
2465
+ backgroundColor: event.color ? `${event.color}15` : void 0,
2466
+ borderColor: event.color ? `${event.color}40` : void 0,
2467
+ borderLeftWidth: "3px",
2468
+ borderLeftColor: event.color || "var(--primary)"
2469
+ },
2470
+ onClick: (e) => {
2471
+ e.stopPropagation();
2472
+ onEventClick?.(event);
2473
+ },
2474
+ title: count > 1 ? `${event.title} (${index + 1}/${count})` : void 0
2475
+ },
2476
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full overflow-hidden w-full" }, /* @__PURE__ */ React15__default.createElement("div", { className: cn(
2477
+ "font-semibold truncate text-foreground/90 leading-tight",
2478
+ isShortEvent ? "text-xs text-center" : "text-xs"
2479
+ ) }, event.title), !isShortEvent && /* @__PURE__ */ React15__default.createElement(React15__default.Fragment, null, /* @__PURE__ */ React15__default.createElement("div", { className: "text-[10px] text-muted-foreground truncate mt-0.5 font-medium leading-tight" }, format(zonedEventStart, eventTimeFormat, { locale }), " - ", format(zonedEventEnd, eventTimeFormat, { locale })), event.description && height > 50 && /* @__PURE__ */ React15__default.createElement("div", { className: "text-[10px] text-muted-foreground/80 truncate mt-1 leading-tight opacity-80" }, event.description)), count > 1 && !isShortEvent && /* @__PURE__ */ React15__default.createElement("div", { className: "absolute top-1 right-1 bg-background/80 backdrop-blur-sm rounded-full w-4 h-4 flex items-center justify-center text-[9px] font-bold text-muted-foreground border border-border shadow-sm" }, count))
2480
+ )
2481
+ )
2482
+ );
2483
+ }), isToday(day) && /* @__PURE__ */ React15__default.createElement(
2484
+ "div",
2485
+ {
2486
+ className: "absolute left-0 right-0 z-20 pointer-events-none flex items-center",
2487
+ style: {
2488
+ top: reverseTime ? `${(1440 - (zonedNow.getHours() * 60 + zonedNow.getMinutes())) / 60 * hourHeight}px` : `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight}px`
2489
+ }
2490
+ },
2491
+ /* @__PURE__ */ React15__default.createElement("div", { className: "h-[2px] w-full bg-gradient-to-r from-primary via-primary to-primary/50" }),
2492
+ /* @__PURE__ */ React15__default.createElement("div", { className: "absolute -left-1.5 w-3 h-3 bg-primary rounded-full shadow-lg shadow-primary/40 ring-2 ring-background animate-pulse" })
2493
+ ));
2494
+ }))
2495
+ ),
2496
+ /* @__PURE__ */ React15__default.createElement(
2497
+ "div",
2498
+ {
2499
+ className: "absolute left-0 w-16 pointer-events-none z-30 flex justify-end pr-2",
2500
+ style: {
2501
+ top: reverseTime ? `${(1440 - (zonedNow.getHours() * 60 + zonedNow.getMinutes())) / 60 * hourHeight + 80}px` : `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight + 80}px`
2502
+ }
2503
+ },
2504
+ /* @__PURE__ */ React15__default.createElement("span", { className: "text-[10px] font-bold text-primary-foreground bg-primary px-1.5 py-0.5 rounded-md shadow-md -translate-y-1/2 backdrop-blur-none" }, format(zonedNow, nowFormat, { locale }))
2505
+ )
2506
+ ));
2507
+ };
2508
+ var DayView = ({
2509
+ currentDate,
2510
+ events,
2511
+ onEventClick,
2512
+ onTimeSlotClick,
2513
+ onEventResize,
2514
+ timezone,
2515
+ locale,
2516
+ readonly,
2517
+ language = "tr",
2518
+ initialScrollHour = 8,
2519
+ reverseTime = false
2520
+ }) => {
2521
+ const hours = reverseTime ? Array.from({ length: 24 }, (_, i) => 23 - i) : Array.from({ length: 24 }, (_, i) => i);
2522
+ const hourHeight = 80;
2523
+ const scrollContainerRef = React15__default.useRef(null);
2524
+ const [now, setNow] = React15__default.useState(/* @__PURE__ */ new Date());
2525
+ React15__default.useEffect(() => {
2526
+ const interval = setInterval(() => setNow(/* @__PURE__ */ new Date()), 6e4);
2527
+ return () => clearInterval(interval);
2528
+ }, []);
2529
+ React15__default.useEffect(() => {
2530
+ if (scrollContainerRef.current) {
2531
+ scrollContainerRef.current.scrollTop = reverseTime ? (23 - initialScrollHour) * hourHeight : initialScrollHour * hourHeight;
2532
+ }
2533
+ }, []);
2534
+ const getZonedDate = (date) => {
2535
+ return timezone ? toZonedTime(date, timezone) : date;
2536
+ };
2537
+ const zonedNow = getZonedDate(now);
2538
+ const dayEvents = events.filter((e) => {
2539
+ const zonedStart = getZonedDate(e.start);
2540
+ return isSameDay(zonedStart, currentDate);
2541
+ });
2542
+ const timeFormat = getTimeFormat(language);
2543
+ const eventTimeFormat = getTimeFormatFull(language);
2544
+ const nowFormat = getTimeFormatFull(language);
2545
+ return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full min-h-0 bg-background border-[0.5px] border-border/50 rounded-2xl overflow-hidden shadow-sm" }, /* @__PURE__ */ React15__default.createElement("div", { className: "px-6 py-4 border-b-[0.5px] border-border/50 bg-gradient-to-r from-muted/20 via-background to-muted/20 text-center shrink-0" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-center gap-3" }, /* @__PURE__ */ React15__default.createElement("h2", { className: "text-xl font-semibold capitalize text-foreground" }, format(currentDate, "EEEE, MMMM d, yyyy", { locale })), isToday(currentDate) && /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-semibold bg-primary text-primary-foreground px-3 py-1 rounded-full shadow-md shadow-primary/20" }, "Today"))), /* @__PURE__ */ React15__default.createElement("div", { ref: scrollContainerRef, className: "flex-1 min-h-0 overflow-y-auto relative" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex relative", style: { height: hours.length * hourHeight } }, /* @__PURE__ */ React15__default.createElement("div", { className: "w-20 bg-muted/5 border-r-[0.5px] border-border/30 relative" }, hours.map((hour) => /* @__PURE__ */ React15__default.createElement(
2546
+ "div",
2547
+ {
2548
+ key: hour,
2549
+ className: "relative w-full",
2550
+ style: { height: hourHeight }
2551
+ },
2552
+ hour !== 0 && /* @__PURE__ */ React15__default.createElement("span", { className: "absolute w-full text-center -top-3 left-1/2 -translate-x-1/2 text-[11px] text-muted-foreground/80 font-medium tabular-nums bg-background px-1.5 py-0.5 rounded-md" }, format((/* @__PURE__ */ new Date()).setHours(hour, 0, 0, 0), timeFormat, { locale }))
2553
+ )), isToday(currentDate) && /* @__PURE__ */ React15__default.createElement(
2554
+ "div",
2555
+ {
2556
+ className: "absolute left-0 w-full pointer-events-none z-30 flex justify-end pr-2",
2557
+ style: {
2558
+ top: reverseTime ? `${(1440 - (zonedNow.getHours() * 60 + zonedNow.getMinutes())) / 60 * hourHeight}px` : `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight}px`
2559
+ }
2560
+ },
2561
+ /* @__PURE__ */ React15__default.createElement("span", { className: "text-[10px] font-bold text-white bg-primary px-2 py-1 rounded-lg shadow-md shadow-primary/30 -translate-y-1/2" }, format(zonedNow, nowFormat, { locale }))
2562
+ )), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 relative" }, hours.map((hour) => {
2563
+ return /* @__PURE__ */ React15__default.createElement(
2564
+ "div",
2565
+ {
2566
+ key: hour,
2567
+ className: "border-b-[0.5px] border-dashed border-border/20 box-border relative hover:bg-accent/5 transition-colors",
2568
+ style: { height: hourHeight }
2569
+ },
2570
+ [0, 15, 30, 45].map((minute) => {
2571
+ const cellDate = new Date(currentDate);
2572
+ cellDate.setHours(hour, minute, 0, 0);
2573
+ const cellId = cellDate.toISOString();
2574
+ return /* @__PURE__ */ React15__default.createElement(
2575
+ DroppableCell,
2576
+ {
2577
+ key: minute,
2578
+ id: cellId,
2579
+ date: cellDate,
2580
+ className: "w-full absolute left-0 right-0 z-0 transition-colors",
2581
+ style: {
2582
+ height: "25%",
2583
+ top: `${minute / 60 * 100}%`
2584
+ }
2585
+ },
2586
+ /* @__PURE__ */ React15__default.createElement(
2587
+ "div",
2588
+ {
2589
+ className: "h-full w-full bg-transparent cursor-pointer",
2590
+ onClick: () => onTimeSlotClick?.(cellDate)
2591
+ }
2592
+ )
2593
+ );
2594
+ })
2595
+ );
2596
+ }), dayEvents.map((event) => {
2597
+ const overlappingEvents = dayEvents.filter((e) => {
2598
+ if (e.id === event.id) return false;
2599
+ const s1 = getZonedDate(event.start).getTime();
2600
+ const e1 = getZonedDate(event.end).getTime();
2601
+ const s2 = getZonedDate(e.start).getTime();
2602
+ const e2 = getZonedDate(e.end).getTime();
2603
+ return s1 < e2 && e1 > s2;
2604
+ });
2605
+ const group = [event, ...overlappingEvents].sort(
2606
+ (a, b) => getZonedDate(a.start).getTime() - getZonedDate(b.start).getTime() || (a.id > b.id ? 1 : -1)
2607
+ );
2608
+ const index = group.findIndex((e) => e.id === event.id);
2609
+ const count = group.length;
2610
+ const widthPercent = 100 / count;
2611
+ const leftPercent = index * widthPercent;
2612
+ const zonedStart = getZonedDate(event.start);
2613
+ const zonedEnd = getZonedDate(event.end);
2614
+ const startMinutes = zonedStart.getHours() * 60 + zonedStart.getMinutes();
2615
+ const durationMinutes = differenceInMinutes(zonedEnd, zonedStart);
2616
+ const height = durationMinutes / 60 * hourHeight;
2617
+ const top = reverseTime ? (1440 - startMinutes - durationMinutes) / 60 * hourHeight : startMinutes / 60 * hourHeight;
2618
+ const isShortEvent = durationMinutes < 45;
2619
+ return /* @__PURE__ */ React15__default.createElement(
2620
+ DraggableEvent,
2621
+ {
2622
+ key: `${event.id}-${currentDate.toISOString()}`,
2623
+ event,
2624
+ className: `absolute z-10 transition-all ${readonly ? "cursor-default" : ""}`,
2625
+ style: {
2626
+ top: `${top}px`,
2627
+ height: `${Math.max(height, 28)}px`,
2628
+ left: `calc(${leftPercent}% + 4px)`,
2629
+ width: `calc(${widthPercent}% - 8px)`,
2630
+ paddingRight: count > 1 ? "2px" : "0"
2631
+ }
2632
+ },
2633
+ /* @__PURE__ */ React15__default.createElement(
2634
+ ResizableEvent,
2635
+ {
2636
+ readonly,
2637
+ event,
2638
+ hourHeight,
2639
+ onResize: onEventResize,
2640
+ className: "h-full",
2641
+ style: { height: "100%" }
2642
+ },
2643
+ /* @__PURE__ */ React15__default.createElement(
2644
+ "div",
2645
+ {
2646
+ className: cn(
2647
+ "h-full rounded-lg border-[0.5px] shadow-sm overflow-hidden transition-all hover:shadow-lg hover:z-20 group",
2648
+ "glass backdrop-blur-sm",
2649
+ readonly ? "cursor-default" : "cursor-grab active:cursor-grabbing",
2650
+ !event.color && "bg-primary/10 border-primary/20",
2651
+ isShortEvent ? "px-2 flex items-center" : "px-3 py-2",
2652
+ count > 1 && "border-l-4"
2653
+ ),
2654
+ style: {
2655
+ backgroundColor: event.color ? `${event.color}15` : void 0,
2656
+ borderColor: event.color ? `${event.color}30` : void 0,
2657
+ borderLeftColor: event.color || "var(--primary)",
2658
+ borderLeftWidth: count > 1 ? "4px" : "3px"
2659
+ },
2660
+ onClick: (e) => {
2661
+ e.stopPropagation();
2662
+ onEventClick?.(event);
2663
+ },
2664
+ title: count > 1 ? `${event.title} (${index + 1}/${count})` : void 0
2665
+ },
2666
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full overflow-hidden w-full" }, /* @__PURE__ */ React15__default.createElement("div", { className: cn(
2667
+ "font-semibold truncate leading-tight",
2668
+ isShortEvent ? "text-xs" : "text-sm",
2669
+ event.color ? "text-foreground" : "text-foreground/90"
2670
+ ) }, event.title), !isShortEvent && /* @__PURE__ */ React15__default.createElement(React15__default.Fragment, null, /* @__PURE__ */ React15__default.createElement("div", { className: "text-xs text-muted-foreground mt-0.5 font-medium" }, format(zonedStart, eventTimeFormat, { locale }), " - ", format(zonedEnd, eventTimeFormat, { locale })), event.description && height > 60 && /* @__PURE__ */ React15__default.createElement("div", { className: "text-xs text-muted-foreground/80 mt-1 line-clamp-2" }, event.description)), count > 1 && !isShortEvent && /* @__PURE__ */ React15__default.createElement("div", { className: "absolute top-1.5 right-1.5 bg-background/90 backdrop-blur-sm rounded-full w-5 h-5 flex items-center justify-center text-[10px] font-bold text-muted-foreground border border-border shadow-sm" }, count))
2671
+ )
2672
+ )
2673
+ );
2674
+ }), isToday(currentDate) && /* @__PURE__ */ React15__default.createElement(
2675
+ "div",
2676
+ {
2677
+ className: "absolute left-0 right-0 z-20 pointer-events-none flex items-center",
2678
+ style: {
2679
+ top: reverseTime ? `${(1440 - (zonedNow.getHours() * 60 + zonedNow.getMinutes())) / 60 * hourHeight}px` : `${(zonedNow.getHours() * 60 + zonedNow.getMinutes()) / 60 * hourHeight}px`
2680
+ }
2681
+ },
2682
+ /* @__PURE__ */ React15__default.createElement("div", { className: "h-[2px] w-full bg-gradient-to-r from-primary via-primary to-primary/50" }),
2683
+ /* @__PURE__ */ React15__default.createElement("div", { className: "absolute -left-1.5 w-3 h-3 bg-primary rounded-full shadow-lg shadow-primary/40 ring-2 ring-background animate-pulse" })
2684
+ )))));
2685
+ };
2686
+ var AgendaEmptyState = ({ onCreateEvent, translations }) => /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center justify-center h-full min-h-[400px] py-12" }, /* @__PURE__ */ React15__default.createElement("div", { className: "relative mb-8" }, /* @__PURE__ */ React15__default.createElement("div", { className: "p-8 bg-gradient-to-br from-green-50 to-blue-50 dark:from-green-900/10 dark:to-blue-900/10 rounded-3xl border border-border/30" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React15__default.createElement("div", { className: "w-12 h-12 rounded-2xl bg-green-100 dark:bg-green-900/30 flex items-center justify-center" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-6 h-6 text-green-600 dark:text-green-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2 }, /* @__PURE__ */ React15__default.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }))), /* @__PURE__ */ React15__default.createElement("div", { className: "text-left" }, /* @__PURE__ */ React15__default.createElement("div", { className: "font-medium text-foreground" }, "All caught up!"), /* @__PURE__ */ React15__default.createElement("div", { className: "text-sm text-muted-foreground" }, "No events scheduled"))))), /* @__PURE__ */ React15__default.createElement("div", { className: "text-center max-w-sm" }, /* @__PURE__ */ React15__default.createElement("h3", { className: "text-lg font-semibold text-foreground mb-2" }, translations?.noUpcoming || "Your schedule is clear"), /* @__PURE__ */ React15__default.createElement("p", { className: "text-sm text-muted-foreground mb-6" }, "No upcoming events to show. Create a new event to start planning."), onCreateEvent && /* @__PURE__ */ React15__default.createElement(
2687
+ "button",
2688
+ {
2689
+ onClick: onCreateEvent,
2690
+ className: "inline-flex items-center gap-2 px-5 py-2.5 bg-primary text-primary-foreground rounded-xl font-medium text-sm shadow-lg shadow-primary/20 hover:shadow-xl hover:shadow-primary/30 hover:scale-105 active:scale-95 transition-all duration-200"
2691
+ },
2692
+ /* @__PURE__ */ React15__default.createElement(Plus, { className: "w-4 h-4" }),
2693
+ translations?.createEvent || "Create Event"
2694
+ )));
2695
+ var formatDuration = (start, end) => {
2696
+ const minutes = differenceInMinutes(end, start);
2697
+ if (minutes < 60) return `${minutes}m`;
2698
+ const hours = Math.floor(minutes / 60);
2699
+ const remainingMinutes = minutes % 60;
2700
+ if (remainingMinutes === 0) return `${hours}h`;
2701
+ return `${hours}h ${remainingMinutes}m`;
2702
+ };
2703
+ var getDateLabel = (date, todayLabel, tomorrowLabel) => {
2704
+ if (isToday(date)) return todayLabel;
2705
+ if (isTomorrow(date)) return tomorrowLabel;
2706
+ return format(date, "EEEE");
2707
+ };
2708
+ var AgendaView = ({
2709
+ currentDate,
2710
+ events,
2711
+ onEventClick,
2712
+ onCreateEvent,
2713
+ translations,
2714
+ language = "tr",
2715
+ renderEmptyState
2716
+ }) => {
2717
+ const timeFmt = getTimeFormatFull(language);
2718
+ const groupedEvents = useMemo(() => {
2719
+ const startDate = startOfDay(currentDate);
2720
+ const groups = [];
2721
+ const sortedEvents = [...events].sort((a, b) => a.start.getTime() - b.start.getTime());
2722
+ for (let i = 0; i < 30; i++) {
2723
+ const day = addDays(startDate, i);
2724
+ const dayEvents = sortedEvents.filter((event) => isSameDay(event.start, day));
2725
+ if (dayEvents.length > 0) {
2726
+ groups.push({ date: day, events: dayEvents });
2727
+ }
2728
+ }
2729
+ return groups;
2730
+ }, [currentDate, events]);
2731
+ const container = {
2732
+ hidden: { opacity: 0 },
2733
+ show: {
2734
+ opacity: 1,
2735
+ transition: {
2736
+ staggerChildren: 0.05
2737
+ }
2738
+ }
2739
+ };
2740
+ const item = {
2741
+ hidden: { opacity: 0, x: -20 },
2742
+ show: { opacity: 1, x: 0 }
2743
+ };
2744
+ return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full min-h-0 bg-background overflow-y-auto" }, groupedEvents.length === 0 ? renderEmptyState ? renderEmptyState({ view: "agenda", onCreateEvent }) : /* @__PURE__ */ React15__default.createElement(AgendaEmptyState, { onCreateEvent }) : /* @__PURE__ */ React15__default.createElement(
2745
+ motion.div,
2746
+ {
2747
+ className: "max-w-3xl mx-auto w-full pb-10 px-4 md:px-6",
2748
+ variants: container,
2749
+ initial: "hidden",
2750
+ animate: "show"
2751
+ },
2752
+ groupedEvents.map((group, groupIndex) => /* @__PURE__ */ React15__default.createElement(
2753
+ motion.div,
2754
+ {
2755
+ key: group.date.toISOString(),
2756
+ className: "relative",
2757
+ variants: item
2758
+ },
2759
+ /* @__PURE__ */ React15__default.createElement("div", { className: "sticky top-0 bg-background/95 backdrop-blur-md py-4 z-10 border-b border-border/50" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-4" }, /* @__PURE__ */ React15__default.createElement("div", { className: cn(
2760
+ "flex flex-col items-center justify-center w-16 h-16 rounded-2xl transition-all",
2761
+ isToday(group.date) ? "bg-primary text-primary-foreground shadow-lg shadow-primary/30" : "bg-muted/50 text-foreground"
2762
+ ) }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-2xl font-bold leading-none" }, format(group.date, "d")), /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-medium uppercase tracking-wide opacity-80" }, format(group.date, "MMM"))), /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React15__default.createElement("span", { className: cn(
2763
+ "text-lg font-semibold",
2764
+ isToday(group.date) && "text-primary"
2765
+ ) }, getDateLabel(group.date, translations?.today ?? "Today", translations?.tomorrow ?? "Tomorrow")), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm text-muted-foreground" }, group.events.length, " ", group.events.length !== 1 ? translations?.eventsCount ?? "events" : translations?.eventCount ?? "event")))),
2766
+ /* @__PURE__ */ React15__default.createElement("div", { className: "py-4 space-y-3" }, group.events.map((event, eventIndex) => /* @__PURE__ */ React15__default.createElement(
2767
+ motion.div,
2768
+ {
2769
+ key: event.id,
2770
+ onClick: () => onEventClick?.(event),
2771
+ className: cn(
2772
+ "group relative flex gap-4 p-4 rounded-2xl border border-border/40",
2773
+ "hover:border-primary/40 hover:shadow-lg hover:shadow-primary/5",
2774
+ "transition-all duration-200 cursor-pointer",
2775
+ "bg-gradient-to-br from-card via-card to-card/80"
2776
+ ),
2777
+ whileHover: { scale: 1.01, y: -2 },
2778
+ transition: { duration: 0.2 }
2779
+ },
2780
+ /* @__PURE__ */ React15__default.createElement(
2781
+ "div",
2782
+ {
2783
+ className: "absolute left-0 top-3 bottom-3 w-1 rounded-full",
2784
+ style: { backgroundColor: event.color || "var(--primary)" }
2785
+ }
2786
+ ),
2787
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center min-w-[70px] pl-2" }, event.allDay ? /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-semibold text-muted-foreground bg-muted/80 px-2.5 py-1 rounded-full" }, translations?.allDay ?? "All Day")) : /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col items-center" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-base font-semibold text-foreground" }, format(event.start, timeFmt)), /* @__PURE__ */ React15__default.createElement("div", { className: "w-px h-3 bg-border my-1" }), /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs text-muted-foreground/70 font-medium" }, formatDuration(event.start, event.end)))),
2788
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 min-w-0 space-y-2" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-start justify-between gap-2" }, /* @__PURE__ */ React15__default.createElement("h4", { className: "text-base font-semibold text-foreground group-hover:text-primary transition-colors line-clamp-1" }, event.title), /* @__PURE__ */ React15__default.createElement(
2789
+ "div",
2790
+ {
2791
+ className: "w-3 h-3 rounded-full shrink-0 mt-1.5",
2792
+ style: { backgroundColor: event.color || "var(--primary)" }
2793
+ }
2794
+ )), event.description && /* @__PURE__ */ React15__default.createElement("p", { className: "text-sm text-muted-foreground line-clamp-2 leading-relaxed" }, event.description), /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-wrap items-center gap-3 pt-1" }, !event.allDay && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React15__default.createElement(Clock, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React15__default.createElement("span", null, format(event.start, timeFmt), " - ", format(event.end, timeFmt))), event.guests && event.guests.length > 0 && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React15__default.createElement(Users, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React15__default.createElement("span", null, event.guests.length, " ", event.guests.length !== 1 ? translations?.guestsCount ?? "guests" : translations?.guestCount ?? "guest")), event.attachments && event.attachments.length > 0 && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React15__default.createElement(Paperclip, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React15__default.createElement("span", null, event.attachments.length)), event.reminders && event.reminders.length > 0 && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-1.5 text-xs text-muted-foreground" }, /* @__PURE__ */ React15__default.createElement(Bell, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React15__default.createElement("span", null, event.reminders.length)))),
2795
+ /* @__PURE__ */ React15__default.createElement("div", { className: "absolute right-4 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-5 h-5 text-muted-foreground", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ React15__default.createElement("path", { d: "M9 18l6-6-6-6" })))
2796
+ )))
2797
+ ))
2798
+ ));
2799
+ };
2800
+ var ResourceView = ({
2801
+ currentDate,
2802
+ events,
2803
+ resources,
2804
+ onEventClick,
2805
+ onTimeSlotClick,
2806
+ locale,
2807
+ language = "tr"
2808
+ }) => {
2809
+ const containerRef = useRef(null);
2810
+ const hours = Array.from({ length: 24 }, (_, i) => i);
2811
+ const hourWidth = 100;
2812
+ const timeFormat = getTimeFormat(language);
2813
+ const getEventStyle = (event) => {
2814
+ const start = new Date(event.start);
2815
+ const end = new Date(event.end);
2816
+ const dayStart = startOfDay(currentDate);
2817
+ const startMinutes = differenceInMinutes(start, dayStart);
2818
+ const durationMinutes = differenceInMinutes(end, start);
2819
+ const left = startMinutes / 60 * hourWidth;
2820
+ const width = durationMinutes / 60 * hourWidth;
2821
+ return {
2822
+ left: `${left}px`,
2823
+ width: `${Math.max(width, 4)}px`
2824
+ // Min width for visibility
2825
+ };
2826
+ };
2827
+ return /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full min-h-0 bg-background overflow-hidden" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex border-b border-border bg-muted/20" }, /* @__PURE__ */ React15__default.createElement("div", { className: "w-48 shrink-0 border-r border-border p-4 font-semibold text-sm bg-background sticky left-0 z-20" }, "Resources"), /* @__PURE__ */ React15__default.createElement("div", { className: "flex overflow-hidden" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex relative", style: { width: hours.length * hourWidth } }, hours.map((hour) => /* @__PURE__ */ React15__default.createElement(
2828
+ "div",
2829
+ {
2830
+ key: hour,
2831
+ className: "border-r border-border/50 text-xs text-muted-foreground p-2 font-medium shrink-0",
2832
+ style: { width: hourWidth }
2833
+ },
2834
+ format((/* @__PURE__ */ new Date()).setHours(hour, 0, 0, 0), timeFormat, { locale })
2835
+ ))))), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 min-h-0 overflow-auto relative", ref: containerRef }, /* @__PURE__ */ React15__default.createElement("div", { className: "min-w-fit" }, resources.map((resource) => {
2836
+ const resourceEvents = events.filter(
2837
+ (e) => e.resourceId === resource.id && isSameDay(new Date(e.start), currentDate)
2838
+ );
2839
+ return /* @__PURE__ */ React15__default.createElement("div", { key: resource.id, className: "flex border-b border-border min-h-[100px]" }, /* @__PURE__ */ React15__default.createElement("div", { className: "w-48 shrink-0 border-r border-border p-4 bg-background sticky left-0 z-10 flex items-center gap-3" }, resource.avatar ? /* @__PURE__ */ React15__default.createElement("img", { src: resource.avatar, alt: resource.label, className: "w-8 h-8 rounded-full object-cover" }) : /* @__PURE__ */ React15__default.createElement("div", { className: "w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-xs font-bold text-primary" }, resource.label.substring(0, 2).toUpperCase()), /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-medium" }, resource.label), /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs text-muted-foreground" }, "ID: ", resource.id))), /* @__PURE__ */ React15__default.createElement("div", { className: "relative flex", style: { width: hours.length * hourWidth } }, hours.map((hour) => /* @__PURE__ */ React15__default.createElement(
2840
+ "div",
2841
+ {
2842
+ key: hour,
2843
+ className: "flex h-full shrink-0",
2844
+ style: { width: hourWidth }
2845
+ },
2846
+ [0, 15, 30, 45].map((minute) => {
2847
+ const slotDate = new Date(currentDate);
2848
+ slotDate.setHours(hour, minute, 0, 0);
2849
+ const slotId = `${resource.id}-${slotDate.toISOString()}`;
2850
+ return /* @__PURE__ */ React15__default.createElement(
2851
+ DroppableCell,
2852
+ {
2853
+ key: minute,
2854
+ id: slotId,
2855
+ date: slotDate,
2856
+ resourceId: resource.id,
2857
+ className: "h-full flex-1 border-r border-border/10 last:border-border/30 hover:bg-accent/10 transition-colors",
2858
+ onClick: () => {
2859
+ onTimeSlotClick?.(slotDate, resource.id);
2860
+ }
2861
+ }
2862
+ );
2863
+ })
2864
+ )), resourceEvents.map((event) => /* @__PURE__ */ React15__default.createElement(
2865
+ DraggableEvent,
2866
+ {
2867
+ key: event.id,
2868
+ event,
2869
+ onClick: (e) => {
2870
+ e.stopPropagation();
2871
+ onEventClick?.(event);
2872
+ },
2873
+ className: "absolute top-2 bottom-2 rounded-md px-2 py-1 text-xs font-medium border shadow-sm cursor-pointer overflow-hidden hover:brightness-95 transition-all z-10",
2874
+ style: {
2875
+ ...getEventStyle(event),
2876
+ backgroundColor: event.color || resource.color || "var(--primary)",
2877
+ borderColor: "rgba(0,0,0,0.1)",
2878
+ color: "#fff"
2879
+ }
2880
+ },
2881
+ /* @__PURE__ */ React15__default.createElement("div", { className: "truncate" }, event.title)
2882
+ ))));
2883
+ }))));
2884
+ };
2885
+ var Modal = ({
2886
+ isOpen,
2887
+ onClose,
2888
+ title,
2889
+ children,
2890
+ className,
2891
+ hideHeader = false
2892
+ }) => {
2893
+ const overlayRef = useRef(null);
2894
+ useEffect(() => {
2895
+ const handleEscape = (e) => {
2896
+ if (e.key === "Escape") {
2897
+ onClose();
2898
+ }
2899
+ };
2900
+ if (isOpen) {
2901
+ document.addEventListener("keydown", handleEscape);
2902
+ }
2903
+ return () => {
2904
+ document.removeEventListener("keydown", handleEscape);
2905
+ };
2906
+ }, [isOpen, onClose]);
2907
+ if (!isOpen) return null;
2908
+ return /* @__PURE__ */ React15__default.createElement("div", { className: "absolute inset-0 z-50 flex items-center justify-center p-4 bg-black/40 backdrop-blur-md animate-in fade-in duration-300" }, /* @__PURE__ */ React15__default.createElement(
2909
+ "div",
2910
+ {
2911
+ ref: overlayRef,
2912
+ className: "absolute inset-0",
2913
+ onClick: onClose
2914
+ }
2915
+ ), /* @__PURE__ */ React15__default.createElement(
2916
+ "div",
2917
+ {
2918
+ className: cn(
2919
+ "relative bg-background rounded-2xl shadow-2xl w-full max-w-md flex flex-col max-h-[70vh] sm:max-h-[80vh] animate-in zoom-in-95 slide-in-from-bottom-4 duration-300 border border-border/50",
2920
+ className
2921
+ )
2922
+ },
2923
+ !hideHeader && /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-between px-6 py-4 border-b border-border/50 shrink-0 bg-gradient-to-r from-muted/20 to-background" }, /* @__PURE__ */ React15__default.createElement("h3", { className: "text-lg font-semibold text-foreground" }, title), /* @__PURE__ */ React15__default.createElement(
2924
+ Button,
2925
+ {
2926
+ variant: "ghost",
2927
+ size: "sm",
2928
+ onClick: onClose,
2929
+ className: "h-9 w-9 p-0 rounded-xl hover:bg-accent/80 transition-all duration-200"
2930
+ },
2931
+ /* @__PURE__ */ React15__default.createElement(X, { className: "h-4 w-4" }),
2932
+ /* @__PURE__ */ React15__default.createElement("span", { className: "sr-only" }, "Close")
2933
+ )),
2934
+ /* @__PURE__ */ React15__default.createElement("div", { className: cn("overflow-y-auto flex-1", !hideHeader && "p-6") }, children)
2935
+ ));
2936
+ };
2937
+ var COLOR_PALETTE = [
2938
+ "#3b82f6",
2939
+ // Blue
2940
+ "#ef4444",
2941
+ // Red
2942
+ "#10b981",
2943
+ // Emerald
2944
+ "#f59e0b",
2945
+ // Amber
2946
+ "#8b5cf6",
2947
+ // Violet
2948
+ "#ec4899",
2949
+ // Pink
2950
+ "#06b6d4",
2951
+ // Cyan
2952
+ "#84cc16",
2953
+ // Lime
2954
+ "#f97316",
2955
+ // Orange
2956
+ "#6366f1"
2957
+ // Indigo
2958
+ ];
2959
+ var getReminderOptions = (t) => [
2960
+ { value: 0, label: t.reminderAtTime },
2961
+ { value: 5, label: t.reminder5min },
2962
+ { value: 10, label: t.reminder10min },
2963
+ { value: 15, label: t.reminder15min },
2964
+ { value: 30, label: t.reminder30min },
2965
+ { value: 60, label: t.reminder1hour },
2966
+ { value: 120, label: t.reminder2hours },
2967
+ { value: 1440, label: t.reminder1day },
2968
+ { value: 2880, label: t.reminder2days },
2969
+ { value: 10080, label: t.reminder1week }
2970
+ ];
2971
+ var EventModal = ({
2972
+ isOpen,
2973
+ onClose,
2974
+ event,
2975
+ initialDate,
2976
+ onSave,
2977
+ onDelete,
2978
+ calendars,
2979
+ eventTypes,
2980
+ translations,
2981
+ language = "tr"
2982
+ }) => {
2983
+ const timeFmt = getTimeFormatFull(language);
2984
+ const [mode, setMode] = useState("create");
2985
+ const [activeTab, setActiveTab] = useState("details");
2986
+ const [formData, setFormData] = useState({
2987
+ title: "",
2988
+ description: "",
2989
+ location: "",
2990
+ start: /* @__PURE__ */ new Date(),
2991
+ end: /* @__PURE__ */ new Date(),
2992
+ allDay: false,
2993
+ color: "#3b82f6",
2994
+ calendarId: calendars?.[0]?.id,
2995
+ type: void 0,
2996
+ recurrence: void 0,
2997
+ attachments: [],
2998
+ reminders: [{ id: "1", type: "notification", time: 30, label: "30 minutes before" }]
2999
+ });
3000
+ const [isCalendarDropdownOpen, setIsCalendarDropdownOpen] = useState(false);
3001
+ const [isColorPickerOpen, setIsColorPickerOpen] = useState(false);
3002
+ const [isReminderDropdownOpen, setIsReminderDropdownOpen] = useState(false);
3003
+ const [isGuestsDropdownOpen, setIsGuestsDropdownOpen] = useState(false);
3004
+ const fakeGuests = [
3005
+ "alice@example.com",
3006
+ "bob@example.com",
3007
+ "charlie@example.com",
3008
+ "diana@example.com",
3009
+ "evan@example.com"
3010
+ ];
3011
+ useRef(null);
3012
+ const [selectedGuests, setSelectedGuests] = useState([]);
3013
+ useEffect(() => {
3014
+ if (isOpen) {
3015
+ if (event) {
3016
+ setMode("view");
3017
+ setFormData({
3018
+ ...event,
3019
+ start: new Date(event.start),
3020
+ end: new Date(event.end),
3021
+ attachments: event.attachments || [],
3022
+ reminders: event.reminders || [{ id: "1", type: "notification", time: 30, label: "30 minutes before" }]
3023
+ });
3024
+ setSelectedGuests(event.guests || []);
3025
+ } else {
3026
+ setMode("create");
3027
+ const start = initialDate || /* @__PURE__ */ new Date();
3028
+ const end = new Date(start);
3029
+ end.setHours(start.getHours() + 1);
3030
+ setFormData({
3031
+ title: "",
3032
+ description: "",
3033
+ location: "",
3034
+ start,
3035
+ end,
3036
+ allDay: false,
3037
+ color: "#3b82f6",
3038
+ calendarId: calendars?.[0]?.id,
3039
+ attachments: [],
3040
+ reminders: [{ id: "1", type: "notification", time: 30, label: "30 minutes before" }]
3041
+ });
3042
+ setSelectedGuests([]);
3043
+ setActiveTab("details");
3044
+ }
3045
+ }
3046
+ }, [isOpen, event, initialDate, calendars]);
3047
+ const toggleGuest = (email) => {
3048
+ setSelectedGuests((prev) => {
3049
+ const newGuests = prev.includes(email) ? prev.filter((e) => e !== email) : [...prev, email];
3050
+ setFormData((curr) => ({ ...curr, guests: newGuests }));
3051
+ return newGuests;
3052
+ });
3053
+ };
3054
+ const handleSubmit = (e) => {
3055
+ e.preventDefault();
3056
+ let eventColor = formData.color;
3057
+ if (formData.calendarId && calendars) {
3058
+ const selectedCal = calendars.find((c) => c.id === formData.calendarId);
3059
+ if (selectedCal?.color) {
3060
+ eventColor = selectedCal.color;
3061
+ }
3062
+ }
3063
+ onSave({
3064
+ ...formData,
3065
+ color: eventColor,
3066
+ id: event?.id
3067
+ });
3068
+ onClose();
3069
+ };
3070
+ const handleDelete = () => {
3071
+ if (event?.id && onDelete) {
3072
+ onDelete(event.id);
3073
+ onClose();
3074
+ }
3075
+ };
3076
+ const formatDateForInput = (date) => {
3077
+ if (!date) return "";
3078
+ return format(date, "yyyy-MM-dd'T'HH:mm");
3079
+ };
3080
+ const handleDateChange = (field, value) => {
3081
+ const date = new Date(value);
3082
+ if (isNaN(date.getTime())) return;
3083
+ if (field === "start") {
3084
+ const duration = formData.end.getTime() - formData.start.getTime();
3085
+ setFormData((prev) => ({
3086
+ ...prev,
3087
+ start: date,
3088
+ end: new Date(date.getTime() + duration)
3089
+ }));
3090
+ } else {
3091
+ if (date < formData.start) {
3092
+ setFormData((prev) => ({ ...prev, start: date, end: date }));
3093
+ } else {
3094
+ setFormData((prev) => ({ ...prev, end: date }));
3095
+ }
3096
+ }
3097
+ };
3098
+ const addReminder = (minutes, label) => {
3099
+ const newReminder = {
3100
+ id: Math.random().toString(36).substr(2, 9),
3101
+ type: "notification",
3102
+ time: minutes,
3103
+ label
3104
+ };
3105
+ setFormData((prev) => ({
3106
+ ...prev,
3107
+ reminders: [...prev.reminders || [], newReminder]
3108
+ }));
3109
+ setIsReminderDropdownOpen(false);
3110
+ };
3111
+ const removeReminder = (id) => {
3112
+ setFormData((prev) => ({
3113
+ ...prev,
3114
+ reminders: prev.reminders?.filter((r) => r.id !== id)
3115
+ }));
3116
+ };
3117
+ const handleDownload = (attachment) => {
3118
+ const element = document.createElement("a");
3119
+ const file = new Blob(["Dummy content for " + attachment.name], { type: "text/plain" });
3120
+ element.href = URL.createObjectURL(file);
3121
+ element.download = attachment.name;
3122
+ document.body.appendChild(element);
3123
+ element.click();
3124
+ document.body.removeChild(element);
3125
+ };
3126
+ const getDurationText = () => {
3127
+ if (!formData.start || !formData.end) return "";
3128
+ const mins = differenceInMinutes(formData.end, formData.start);
3129
+ if (mins < 60) return `${mins} min`;
3130
+ const hours = Math.floor(mins / 60);
3131
+ const remainingMins = mins % 60;
3132
+ if (remainingMins === 0) return `${hours} hr`;
3133
+ return `${hours} hr ${remainingMins} min`;
3134
+ };
3135
+ const renderViewMode = () => /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col bg-background overflow-hidden w-full max-h-[90vh]" }, /* @__PURE__ */ React15__default.createElement(
3136
+ "div",
3137
+ {
3138
+ className: "relative px-6 pt-6 pb-8",
3139
+ style: {
3140
+ background: `linear-gradient(135deg, ${event?.color || "#3b82f6"}15 0%, transparent 100%)`
3141
+ }
3142
+ },
3143
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-between mb-6" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(
3144
+ "div",
3145
+ {
3146
+ className: "w-3 h-3 rounded-full",
3147
+ style: { backgroundColor: event?.color || "#3b82f6" }
3148
+ }
3149
+ ), /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider" }, calendars?.find((c) => c.id === event?.calendarId)?.label || "Event")), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-1" }, /* @__PURE__ */ React15__default.createElement(
3150
+ "button",
3151
+ {
3152
+ onClick: () => setMode("edit"),
3153
+ className: "p-2 hover:bg-background/80 rounded-lg transition-all text-muted-foreground hover:text-foreground",
3154
+ title: "Edit"
3155
+ },
3156
+ /* @__PURE__ */ React15__default.createElement(Edit2, { className: "w-4 h-4" })
3157
+ ), /* @__PURE__ */ React15__default.createElement(
3158
+ "button",
3159
+ {
3160
+ onClick: handleDelete,
3161
+ className: "p-2 hover:bg-destructive/10 rounded-lg transition-all text-muted-foreground hover:text-destructive",
3162
+ title: "Delete"
3163
+ },
3164
+ /* @__PURE__ */ React15__default.createElement(Trash2, { className: "w-4 h-4" })
3165
+ ), /* @__PURE__ */ React15__default.createElement(
3166
+ "button",
3167
+ {
3168
+ onClick: onClose,
3169
+ className: "p-2 hover:bg-background/80 rounded-lg transition-all text-muted-foreground hover:text-foreground",
3170
+ title: "Close"
3171
+ },
3172
+ /* @__PURE__ */ React15__default.createElement(X, { className: "w-4 h-4" })
3173
+ ))),
3174
+ /* @__PURE__ */ React15__default.createElement("h1", { className: "text-2xl font-bold text-foreground mb-3 leading-tight" }, event?.title || translations.noTitle),
3175
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-3 text-sm" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2 px-3 py-1.5 bg-background/60 backdrop-blur-sm rounded-lg border border-border/30" }, /* @__PURE__ */ React15__default.createElement(Calendar, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15__default.createElement("span", { className: "font-medium" }, event?.start && format(new Date(event.start), "EEE, MMM d"))), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2 px-3 py-1.5 bg-background/60 backdrop-blur-sm rounded-lg border border-border/30" }, /* @__PURE__ */ React15__default.createElement(Clock, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15__default.createElement("span", { className: "font-medium" }, event?.start && format(new Date(event.start), timeFmt), " \u2013 ", event?.end && format(new Date(event.end), timeFmt))))
3176
+ ), /* @__PURE__ */ React15__default.createElement("div", { className: "px-6 pb-6 space-y-4 overflow-y-auto flex-1" }, event?.location && /* @__PURE__ */ React15__default.createElement(
3177
+ motion.div,
3178
+ {
3179
+ initial: { opacity: 0, y: 10 },
3180
+ animate: { opacity: 1, y: 0 },
3181
+ className: "flex items-start gap-3 p-4 rounded-2xl bg-muted/30 border border-border/30 group hover:bg-muted/50 transition-all cursor-pointer"
3182
+ },
3183
+ /* @__PURE__ */ React15__default.createElement("div", { className: "p-2 bg-primary/10 rounded-xl" }, /* @__PURE__ */ React15__default.createElement(MapPin, { className: "w-5 h-5 text-primary" })),
3184
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React15__default.createElement("p", { className: "text-sm font-medium text-foreground" }, event.location), /* @__PURE__ */ React15__default.createElement("p", { className: "text-xs text-muted-foreground mt-0.5" }, translations.clickToOpenInMaps)),
3185
+ /* @__PURE__ */ React15__default.createElement(ExternalLink, { className: "w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
3186
+ ), event?.guests && event.guests.length > 0 && /* @__PURE__ */ React15__default.createElement(
3187
+ motion.div,
3188
+ {
3189
+ initial: { opacity: 0, y: 10 },
3190
+ animate: { opacity: 1, y: 0 },
3191
+ transition: { delay: 0.05 },
3192
+ className: "space-y-3"
3193
+ },
3194
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(Users, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-medium text-foreground" }, event.guests.length, " ", event.guests.length > 1 ? translations.guestsCount : translations.guestCount))),
3195
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-wrap gap-2" }, event.guests.map((email, index) => /* @__PURE__ */ React15__default.createElement(
3196
+ "div",
3197
+ {
3198
+ key: index,
3199
+ className: "flex items-center gap-2 px-3 py-2 rounded-xl bg-muted/30 border border-border/30 hover:bg-muted/50 transition-all cursor-pointer group"
3200
+ },
3201
+ /* @__PURE__ */ React15__default.createElement(
3202
+ "div",
3203
+ {
3204
+ className: "w-8 h-8 rounded-full flex items-center justify-center text-sm font-semibold text-white",
3205
+ style: { backgroundColor: `hsl(${index * 60}, 70%, 50%)` }
3206
+ },
3207
+ email[0].toUpperCase()
3208
+ ),
3209
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React15__default.createElement("p", { className: "text-sm font-medium text-foreground" }, email.split("@")[0]), /* @__PURE__ */ React15__default.createElement("p", { className: "text-xs text-muted-foreground truncate" }, email))
3210
+ )))
3211
+ ), event?.reminders && event.reminders.length > 0 && /* @__PURE__ */ React15__default.createElement(
3212
+ motion.div,
3213
+ {
3214
+ initial: { opacity: 0, y: 10 },
3215
+ animate: { opacity: 1, y: 0 },
3216
+ transition: { delay: 0.1 },
3217
+ className: "flex items-center gap-3"
3218
+ },
3219
+ /* @__PURE__ */ React15__default.createElement("div", { className: "p-2 bg-amber-500/10 rounded-xl" }, /* @__PURE__ */ React15__default.createElement(Bell, { className: "w-4 h-4 text-amber-500" })),
3220
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-wrap gap-2" }, event.reminders.map((reminder) => /* @__PURE__ */ React15__default.createElement(
3221
+ "span",
3222
+ {
3223
+ key: reminder.id,
3224
+ className: "text-xs font-medium px-2.5 py-1 rounded-full bg-amber-500/10 text-amber-600 dark:text-amber-400"
3225
+ },
3226
+ reminder.label || `${reminder.time} min before`
3227
+ )))
3228
+ ), event?.description && /* @__PURE__ */ React15__default.createElement(
3229
+ motion.div,
3230
+ {
3231
+ initial: { opacity: 0, y: 10 },
3232
+ animate: { opacity: 1, y: 0 },
3233
+ transition: { delay: 0.15 },
3234
+ className: "space-y-2"
3235
+ },
3236
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(AlignLeft, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-medium text-foreground" }, translations.notes)),
3237
+ /* @__PURE__ */ React15__default.createElement("div", { className: "text-sm text-foreground/80 whitespace-pre-wrap leading-relaxed pl-6 p-3 rounded-xl bg-muted/20 border border-border/30" }, event.description)
3238
+ ), event?.attachments && event.attachments.length > 0 && /* @__PURE__ */ React15__default.createElement(
3239
+ motion.div,
3240
+ {
3241
+ initial: { opacity: 0, y: 10 },
3242
+ animate: { opacity: 1, y: 0 },
3243
+ transition: { delay: 0.2 },
3244
+ className: "space-y-2"
3245
+ },
3246
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(Paperclip, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-medium text-foreground" }, translations.attachments)),
3247
+ /* @__PURE__ */ React15__default.createElement("div", { className: "grid gap-2" }, event.attachments.map((att) => /* @__PURE__ */ React15__default.createElement(
3248
+ "div",
3249
+ {
3250
+ key: att.id,
3251
+ onClick: () => handleDownload(att),
3252
+ className: "flex items-center gap-3 p-3 rounded-xl border border-border/30 bg-muted/20 hover:bg-muted/40 transition-all cursor-pointer group"
3253
+ },
3254
+ /* @__PURE__ */ React15__default.createElement("div", { className: "p-2 bg-primary/10 rounded-lg" }, /* @__PURE__ */ React15__default.createElement(File, { className: "w-4 h-4 text-primary" })),
3255
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 min-w-0" }, /* @__PURE__ */ React15__default.createElement("p", { className: "text-sm font-medium text-foreground truncate" }, att.name), /* @__PURE__ */ React15__default.createElement("p", { className: "text-xs text-muted-foreground" }, att.size)),
3256
+ /* @__PURE__ */ React15__default.createElement(Download, { className: "w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" })
3257
+ )))
3258
+ )));
3259
+ const renderEditMode = () => /* @__PURE__ */ React15__default.createElement("form", { onSubmit: handleSubmit, className: "flex flex-col bg-background overflow-hidden w-full max-h-[85vh]" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-between px-5 py-4 border-b border-border/50 shrink-0" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React15__default.createElement(
3260
+ "button",
3261
+ {
3262
+ type: "button",
3263
+ onClick: () => setIsColorPickerOpen(!isColorPickerOpen),
3264
+ className: "relative p-1"
3265
+ },
3266
+ /* @__PURE__ */ React15__default.createElement(
3267
+ "div",
3268
+ {
3269
+ className: "w-5 h-5 rounded-full cursor-pointer hover:scale-110 transition-transform",
3270
+ style: {
3271
+ backgroundColor: formData.color,
3272
+ boxShadow: `0 0 0 2px var(--background), 0 0 0 4px ${formData.color}60`
3273
+ }
3274
+ }
3275
+ ),
3276
+ isColorPickerOpen && /* @__PURE__ */ React15__default.createElement("div", { className: "absolute top-full left-0 mt-2 p-2 bg-background border border-border rounded-xl shadow-xl z-50 flex flex-wrap gap-1.5 w-[180px]" }, COLOR_PALETTE.map((color) => /* @__PURE__ */ React15__default.createElement(
3277
+ "button",
3278
+ {
3279
+ key: color,
3280
+ type: "button",
3281
+ onClick: () => {
3282
+ setFormData((prev) => ({ ...prev, color }));
3283
+ setIsColorPickerOpen(false);
3284
+ },
3285
+ className: cn(
3286
+ "w-7 h-7 rounded-full transition-all hover:scale-110",
3287
+ formData.color === color && "ring-2 ring-offset-2 ring-offset-background ring-current"
3288
+ ),
3289
+ style: { backgroundColor: color, color }
3290
+ }
3291
+ )))
3292
+ ), /* @__PURE__ */ React15__default.createElement("h2", { className: "text-lg font-semibold text-foreground" }, mode === "edit" ? translations.editEvent : translations.newEvent)), /* @__PURE__ */ React15__default.createElement(
3293
+ "button",
3294
+ {
3295
+ type: "button",
3296
+ onClick: onClose,
3297
+ className: "p-2 hover:bg-accent rounded-xl transition-all text-muted-foreground hover:text-foreground"
3298
+ },
3299
+ /* @__PURE__ */ React15__default.createElement(X, { className: "w-4 h-4" })
3300
+ )), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 overflow-y-auto" }, /* @__PURE__ */ React15__default.createElement("div", { className: "px-5 py-4 space-y-5" }, /* @__PURE__ */ React15__default.createElement("div", null, /* @__PURE__ */ React15__default.createElement(
3301
+ "input",
3302
+ {
3303
+ type: "text",
3304
+ required: true,
3305
+ autoFocus: true,
3306
+ className: "w-full text-xl font-semibold border-0 border-b-2 border-transparent focus:border-primary bg-transparent px-0 py-2 placeholder-muted-foreground/50 transition-all text-foreground focus:outline-none",
3307
+ value: formData.title,
3308
+ onChange: (e) => setFormData({ ...formData, title: e.target.value }),
3309
+ placeholder: translations.addTitle
3310
+ }
3311
+ )), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-3 p-4 rounded-2xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React15__default.createElement("div", { className: "p-2 bg-primary/10 rounded-xl shrink-0" }, /* @__PURE__ */ React15__default.createElement(Clock, { className: "w-5 h-5 text-primary" })), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 grid grid-cols-2 gap-3" }, /* @__PURE__ */ React15__default.createElement("div", null, /* @__PURE__ */ React15__default.createElement("label", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1 block" }, translations.start), /* @__PURE__ */ React15__default.createElement(
3312
+ "input",
3313
+ {
3314
+ type: "datetime-local",
3315
+ className: "w-full bg-background border border-border/50 rounded-xl px-3 py-2 text-sm font-medium text-foreground focus:border-primary focus:ring-2 focus:ring-primary/20 transition-all",
3316
+ value: formatDateForInput(formData.start),
3317
+ onChange: (e) => handleDateChange("start", e.target.value)
3318
+ }
3319
+ )), /* @__PURE__ */ React15__default.createElement("div", null, /* @__PURE__ */ React15__default.createElement("label", { className: "text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-1 block" }, translations.end), /* @__PURE__ */ React15__default.createElement(
3320
+ "input",
3321
+ {
3322
+ type: "datetime-local",
3323
+ className: "w-full bg-background border border-border/50 rounded-xl px-3 py-2 text-sm font-medium text-foreground focus:border-primary focus:ring-2 focus:ring-primary/20 transition-all",
3324
+ value: formatDateForInput(formData.end),
3325
+ onChange: (e) => handleDateChange("end", e.target.value)
3326
+ }
3327
+ )))), getDurationText() && /* @__PURE__ */ React15__default.createElement("div", { className: "flex justify-center" }, /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-medium px-3 py-1 rounded-full bg-primary/10 text-primary" }, getDurationText())), /* @__PURE__ */ React15__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(Bell, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-medium text-foreground" }, translations.reminders)), /* @__PURE__ */ React15__default.createElement("div", { className: "relative" }, /* @__PURE__ */ React15__default.createElement(
3328
+ "button",
3329
+ {
3330
+ type: "button",
3331
+ onClick: () => setIsReminderDropdownOpen(!isReminderDropdownOpen),
3332
+ className: "flex items-center gap-1 text-xs font-medium text-primary hover:text-primary/80 transition-colors"
3333
+ },
3334
+ /* @__PURE__ */ React15__default.createElement(Plus, { className: "w-3.5 h-3.5" }),
3335
+ translations.addReminder
3336
+ ), isReminderDropdownOpen && /* @__PURE__ */ React15__default.createElement(React15__default.Fragment, null, /* @__PURE__ */ React15__default.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsReminderDropdownOpen(false) }), /* @__PURE__ */ React15__default.createElement("div", { className: "absolute right-0 top-full mt-1 w-48 bg-background border border-border rounded-xl shadow-xl z-50 py-1 max-h-60 overflow-y-auto" }, getReminderOptions(translations).map((option) => /* @__PURE__ */ React15__default.createElement(
3337
+ "button",
3338
+ {
3339
+ key: option.value,
3340
+ type: "button",
3341
+ onClick: () => addReminder(option.value, option.label),
3342
+ className: "w-full px-3 py-2 text-left text-sm hover:bg-accent transition-colors"
3343
+ },
3344
+ option.label
3345
+ )))))), formData.reminders && formData.reminders.length > 0 && /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-wrap gap-2" }, formData.reminders.map((reminder) => /* @__PURE__ */ React15__default.createElement(
3346
+ "div",
3347
+ {
3348
+ key: reminder.id,
3349
+ className: "flex items-center gap-2 px-3 py-1.5 rounded-full bg-amber-500/10 border border-amber-500/20"
3350
+ },
3351
+ /* @__PURE__ */ React15__default.createElement(BellRing, { className: "w-3.5 h-3.5 text-amber-500" }),
3352
+ /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-medium text-amber-600 dark:text-amber-400" }, reminder.label),
3353
+ /* @__PURE__ */ React15__default.createElement(
3354
+ "button",
3355
+ {
3356
+ type: "button",
3357
+ onClick: () => removeReminder(reminder.id),
3358
+ className: "p-0.5 hover:bg-amber-500/20 rounded-full transition-colors"
3359
+ },
3360
+ /* @__PURE__ */ React15__default.createElement(X, { className: "w-3 h-3 text-amber-500" })
3361
+ )
3362
+ )))), /* @__PURE__ */ React15__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(Users, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-medium text-foreground" }, translations.guests)), /* @__PURE__ */ React15__default.createElement("div", { className: "relative" }, /* @__PURE__ */ React15__default.createElement(
3363
+ "button",
3364
+ {
3365
+ type: "button",
3366
+ onClick: () => setIsGuestsDropdownOpen(!isGuestsDropdownOpen),
3367
+ className: "w-full flex items-center justify-between px-4 py-3 bg-muted/20 border border-border/30 rounded-xl text-sm text-left hover:bg-muted/30 transition-all"
3368
+ },
3369
+ /* @__PURE__ */ React15__default.createElement("span", { className: selectedGuests.length > 0 ? "text-foreground font-medium" : "text-muted-foreground" }, selectedGuests.length > 0 ? `${selectedGuests.length} ${selectedGuests.length > 1 ? translations.guestsAdded : translations.guestAdded}` : translations.addGuests),
3370
+ /* @__PURE__ */ React15__default.createElement(ChevronDown, { className: cn("w-4 h-4 text-muted-foreground transition-transform", isGuestsDropdownOpen && "rotate-180") })
3371
+ ), isGuestsDropdownOpen && /* @__PURE__ */ React15__default.createElement(React15__default.Fragment, null, /* @__PURE__ */ React15__default.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsGuestsDropdownOpen(false) }), /* @__PURE__ */ React15__default.createElement("div", { className: "absolute z-50 w-full mt-2 bg-background border border-border rounded-xl shadow-xl max-h-48 overflow-y-auto" }, fakeGuests.map((email) => /* @__PURE__ */ React15__default.createElement(
3372
+ "div",
3373
+ {
3374
+ key: email,
3375
+ className: "px-4 py-3 hover:bg-accent cursor-pointer flex items-center gap-3 transition-colors",
3376
+ onClick: () => toggleGuest(email)
3377
+ },
3378
+ /* @__PURE__ */ React15__default.createElement("div", { className: cn(
3379
+ "w-5 h-5 rounded-md border-2 flex items-center justify-center transition-all",
3380
+ selectedGuests.includes(email) ? "bg-primary border-primary" : "border-border"
3381
+ ) }, selectedGuests.includes(email) && /* @__PURE__ */ React15__default.createElement(Check, { className: "w-3 h-3 text-primary-foreground" })),
3382
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(
3383
+ "div",
3384
+ {
3385
+ className: "w-7 h-7 rounded-full flex items-center justify-center text-xs font-semibold text-white",
3386
+ style: { backgroundColor: `hsl(${fakeGuests.indexOf(email) * 60}, 70%, 50%)` }
3387
+ },
3388
+ email[0].toUpperCase()
3389
+ ), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm" }, email))
3390
+ ))))), selectedGuests.length > 0 && /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-wrap gap-2 mt-2" }, selectedGuests.map((email) => /* @__PURE__ */ React15__default.createElement(
3391
+ "div",
3392
+ {
3393
+ key: email,
3394
+ className: "flex items-center gap-2 pl-1 pr-2 py-1 bg-muted/30 border border-border/30 rounded-full"
3395
+ },
3396
+ /* @__PURE__ */ React15__default.createElement(
3397
+ "div",
3398
+ {
3399
+ className: "w-6 h-6 rounded-full flex items-center justify-center text-xs font-semibold text-white",
3400
+ style: { backgroundColor: `hsl(${fakeGuests.indexOf(email) * 60}, 70%, 50%)` }
3401
+ },
3402
+ email[0].toUpperCase()
3403
+ ),
3404
+ /* @__PURE__ */ React15__default.createElement("span", { className: "text-xs font-medium text-foreground" }, email.split("@")[0]),
3405
+ /* @__PURE__ */ React15__default.createElement(
3406
+ "button",
3407
+ {
3408
+ type: "button",
3409
+ onClick: () => toggleGuest(email),
3410
+ className: "p-0.5 hover:bg-destructive/10 rounded-full transition-colors"
3411
+ },
3412
+ /* @__PURE__ */ React15__default.createElement(X, { className: "w-3 h-3 text-muted-foreground" })
3413
+ )
3414
+ )))), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-3 p-3 rounded-xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React15__default.createElement(MapPin, { className: "w-5 h-5 text-muted-foreground shrink-0" }), /* @__PURE__ */ React15__default.createElement(
3415
+ "input",
3416
+ {
3417
+ type: "text",
3418
+ className: "flex-1 bg-transparent text-sm text-foreground placeholder-muted-foreground focus:outline-none",
3419
+ placeholder: translations.addLocation,
3420
+ value: formData.location || "",
3421
+ onChange: (e) => setFormData({ ...formData, location: e.target.value })
3422
+ }
3423
+ )), /* @__PURE__ */ React15__default.createElement("div", { className: "space-y-2" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(AlignLeft, { className: "w-4 h-4 text-muted-foreground" }), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-medium text-foreground" }, translations.notes)), /* @__PURE__ */ React15__default.createElement(
3424
+ "textarea",
3425
+ {
3426
+ className: "w-full bg-muted/20 border border-border/30 rounded-xl px-4 py-3 text-sm min-h-[100px] resize-none text-foreground placeholder-muted-foreground focus:border-primary focus:ring-2 focus:ring-primary/20 transition-all",
3427
+ placeholder: translations.addDescription,
3428
+ value: formData.description || "",
3429
+ onChange: (e) => setFormData({ ...formData, description: e.target.value })
3430
+ }
3431
+ )), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-3 p-3 rounded-xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React15__default.createElement(Repeat, { className: "w-5 h-5 text-muted-foreground shrink-0" }), /* @__PURE__ */ React15__default.createElement(
3432
+ "select",
3433
+ {
3434
+ className: "flex-1 bg-transparent text-sm text-foreground focus:outline-none cursor-pointer",
3435
+ value: formData.recurrence?.freq || "",
3436
+ onChange: (e) => {
3437
+ if (e.target.value === "") {
3438
+ setFormData({ ...formData, recurrence: void 0 });
3439
+ } else {
3440
+ setFormData({
3441
+ ...formData,
3442
+ recurrence: {
3443
+ freq: e.target.value,
3444
+ interval: 1
3445
+ }
3446
+ });
3447
+ }
3448
+ }
3449
+ },
3450
+ /* @__PURE__ */ React15__default.createElement("option", { value: "" }, translations.doesNotRepeat),
3451
+ /* @__PURE__ */ React15__default.createElement("option", { value: "DAILY" }, translations.daily),
3452
+ /* @__PURE__ */ React15__default.createElement("option", { value: "WEEKLY" }, translations.weekly),
3453
+ /* @__PURE__ */ React15__default.createElement("option", { value: "MONTHLY" }, translations.monthly),
3454
+ /* @__PURE__ */ React15__default.createElement("option", { value: "YEARLY" }, translations.yearly)
3455
+ )), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center justify-between p-3 rounded-xl bg-muted/20 border border-border/30" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(Tag, { className: "w-5 h-5 text-muted-foreground" }), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm text-foreground" }, translations.calendar)), /* @__PURE__ */ React15__default.createElement("div", { className: "relative" }, /* @__PURE__ */ React15__default.createElement(
3456
+ "button",
3457
+ {
3458
+ type: "button",
3459
+ onClick: () => setIsCalendarDropdownOpen(!isCalendarDropdownOpen),
3460
+ className: "flex items-center gap-2 px-3 py-1.5 bg-background border border-border/50 rounded-lg text-sm hover:bg-accent/50 transition-all"
3461
+ },
3462
+ /* @__PURE__ */ React15__default.createElement(
3463
+ "div",
3464
+ {
3465
+ className: "w-3 h-3 rounded-full",
3466
+ style: { backgroundColor: calendars?.find((c) => c.id === formData.calendarId)?.color || "#3b82f6" }
3467
+ }
3468
+ ),
3469
+ /* @__PURE__ */ React15__default.createElement("span", { className: "font-medium" }, calendars?.find((c) => c.id === formData.calendarId)?.label || "Select"),
3470
+ /* @__PURE__ */ React15__default.createElement(ChevronDown, { className: "w-3.5 h-3.5 text-muted-foreground" })
3471
+ ), isCalendarDropdownOpen && /* @__PURE__ */ React15__default.createElement(React15__default.Fragment, null, /* @__PURE__ */ React15__default.createElement("div", { className: "fixed inset-0 z-40", onClick: () => setIsCalendarDropdownOpen(false) }), /* @__PURE__ */ React15__default.createElement("div", { className: "absolute right-0 bottom-full mb-2 w-48 bg-background border border-border rounded-xl shadow-xl z-50 py-1" }, calendars?.map((cal) => /* @__PURE__ */ React15__default.createElement(
3472
+ "button",
3473
+ {
3474
+ key: cal.id,
3475
+ type: "button",
3476
+ className: "w-full flex items-center gap-3 px-3 py-2 hover:bg-accent transition-colors text-left",
3477
+ onClick: () => {
3478
+ setFormData({
3479
+ ...formData,
3480
+ calendarId: cal.id,
3481
+ color: cal.color || formData.color
3482
+ });
3483
+ setIsCalendarDropdownOpen(false);
3484
+ }
3485
+ },
3486
+ /* @__PURE__ */ React15__default.createElement("div", { className: "w-3 h-3 rounded-full", style: { backgroundColor: cal.color } }),
3487
+ /* @__PURE__ */ React15__default.createElement("span", { className: "flex-1 text-sm" }, cal.label),
3488
+ formData.calendarId === cal.id && /* @__PURE__ */ React15__default.createElement(Check, { className: "w-4 h-4 text-primary" })
3489
+ )))))))), /* @__PURE__ */ React15__default.createElement("div", { className: "px-5 py-4 border-t border-border/50 flex items-center justify-between bg-muted/10 shrink-0" }, mode === "edit" && /* @__PURE__ */ React15__default.createElement(
3490
+ "button",
3491
+ {
3492
+ type: "button",
3493
+ onClick: handleDelete,
3494
+ className: "flex items-center gap-2 px-4 py-2 text-destructive hover:bg-destructive/10 rounded-xl transition-all text-sm font-medium"
3495
+ },
3496
+ /* @__PURE__ */ React15__default.createElement(Trash2, { className: "w-4 h-4" }),
3497
+ translations.delete
3498
+ ), mode === "create" && /* @__PURE__ */ React15__default.createElement("div", null), /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(
3499
+ "button",
3500
+ {
3501
+ type: "button",
3502
+ onClick: onClose,
3503
+ className: "px-4 py-2.5 text-muted-foreground hover:text-foreground font-medium text-sm rounded-xl transition-all hover:bg-accent"
3504
+ },
3505
+ translations.cancel
3506
+ ), /* @__PURE__ */ React15__default.createElement(
3507
+ "button",
3508
+ {
3509
+ type: "submit",
3510
+ className: "px-6 py-2.5 bg-primary hover:bg-primary/90 text-primary-foreground font-semibold text-sm rounded-xl shadow-md transition-all hover:shadow-lg hover:shadow-primary/20 active:scale-95"
3511
+ },
3512
+ mode === "edit" ? translations.saveChanges : translations.createEvent
3513
+ ))));
3514
+ return /* @__PURE__ */ React15__default.createElement(Modal, { isOpen, onClose, hideHeader: true, className: "p-0 overflow-hidden max-w-lg rounded-2xl shadow-2xl" }, /* @__PURE__ */ React15__default.createElement(AnimatePresence, { mode: "wait" }, mode === "view" && event ? /* @__PURE__ */ React15__default.createElement(
3515
+ motion.div,
3516
+ {
3517
+ key: "view",
3518
+ initial: { opacity: 0 },
3519
+ animate: { opacity: 1 },
3520
+ exit: { opacity: 0 },
3521
+ transition: { duration: 0.15 }
3522
+ },
3523
+ renderViewMode()
3524
+ ) : /* @__PURE__ */ React15__default.createElement(
3525
+ motion.div,
3526
+ {
3527
+ key: "edit",
3528
+ initial: { opacity: 0 },
3529
+ animate: { opacity: 1 },
3530
+ exit: { opacity: 0 },
3531
+ transition: { duration: 0.15 }
3532
+ },
3533
+ renderEditMode()
3534
+ )));
3535
+ };
3536
+ var Skeleton = ({ className, style }) => /* @__PURE__ */ React15__default.createElement("div", { className: cn("animate-pulse bg-muted/40 rounded", className), style });
3537
+ var MonthViewSkeleton = () => /* @__PURE__ */ React15__default.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden" }, /* @__PURE__ */ React15__default.createElement("div", { className: "grid grid-cols-7 border-b border-border/50 bg-muted/10" }, Array.from({ length: 7 }).map((_, i) => /* @__PURE__ */ React15__default.createElement("div", { key: i, className: "py-3 px-2 text-center border-r border-border/30 last:border-r-0" }, /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-4 w-8 mx-auto" })))), /* @__PURE__ */ React15__default.createElement("div", { className: "grid grid-cols-7 flex-1" }, Array.from({ length: 35 }).map((_, i) => /* @__PURE__ */ React15__default.createElement("div", { key: i, className: "min-h-[120px] border-r border-b border-border/30 p-2" }, /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-4 w-6 mb-2" }), /* @__PURE__ */ React15__default.createElement("div", { className: "space-y-1" }, Math.random() > 0.5 && /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-5 w-full rounded-md" }), Math.random() > 0.7 && /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-5 w-3/4 rounded-md" }))))));
3538
+ var WeekViewSkeleton = () => /* @__PURE__ */ React15__default.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex border-b border-border/50 bg-muted/10" }, /* @__PURE__ */ React15__default.createElement("div", { className: "w-16 p-3 border-r border-border/30" }, /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-8 w-10 mx-auto" })), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 grid grid-cols-7" }, Array.from({ length: 7 }).map((_, i) => /* @__PURE__ */ React15__default.createElement("div", { key: i, className: "py-3 px-2 text-center border-r border-border/30 last:border-r-0" }, /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-3 w-8 mx-auto mb-1" }), /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-8 w-8 mx-auto rounded-xl" }))))), /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-1", style: { height: "600px" } }, /* @__PURE__ */ React15__default.createElement("div", { className: "w-16 border-r border-border/30" }, Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ React15__default.createElement("div", { key: i, className: "h-[60px] relative" }, /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-4 w-10 absolute right-2 -translate-y-1/2" })))), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 grid grid-cols-7 relative" }, Array.from({ length: 7 }).map((_, colIdx) => /* @__PURE__ */ React15__default.createElement("div", { key: colIdx, className: "relative border-r border-border/30 last:border-r-0" }, Array.from({ length: 10 }).map((_2, rowIdx) => /* @__PURE__ */ React15__default.createElement("div", { key: rowIdx, className: "h-[60px] border-b border-dashed border-border/20" })), Math.random() > 0.3 && /* @__PURE__ */ React15__default.createElement(
3539
+ Skeleton,
3540
+ {
3541
+ className: "absolute rounded-md",
3542
+ style: {
3543
+ top: `${Math.floor(Math.random() * 400)}px`,
3544
+ left: "4px",
3545
+ right: "4px",
3546
+ height: `${60 + Math.floor(Math.random() * 120)}px`
3547
+ }
3548
+ }
3549
+ ))))));
3550
+ var DayViewSkeleton = () => /* @__PURE__ */ React15__default.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden" }, /* @__PURE__ */ React15__default.createElement("div", { className: "px-6 py-4 border-b border-border/50 bg-muted/10 text-center" }, /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-7 w-64 mx-auto" })), /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-1", style: { height: "600px" } }, /* @__PURE__ */ React15__default.createElement("div", { className: "w-20 border-r border-border/30 bg-muted/5" }, Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ React15__default.createElement("div", { key: i, className: "h-[80px] relative" }, /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-4 w-12 absolute left-1/2 -translate-x-1/2 -translate-y-1/2" })))), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 relative" }, Array.from({ length: 10 }).map((_, i) => /* @__PURE__ */ React15__default.createElement("div", { key: i, className: "h-[80px] border-b border-dashed border-border/20" })), /* @__PURE__ */ React15__default.createElement(
3551
+ Skeleton,
3552
+ {
3553
+ className: "absolute rounded-lg left-4 right-4",
3554
+ style: { top: "160px", height: "120px" }
3555
+ }
3556
+ ), /* @__PURE__ */ React15__default.createElement(
3557
+ Skeleton,
3558
+ {
3559
+ className: "absolute rounded-lg left-4 right-4",
3560
+ style: { top: "400px", height: "80px" }
3561
+ }
3562
+ ))));
3563
+ var AgendaViewSkeleton = () => /* @__PURE__ */ React15__default.createElement("div", { className: "h-full bg-background border border-border/50 rounded-2xl overflow-hidden p-6" }, /* @__PURE__ */ React15__default.createElement("div", { className: "space-y-6" }, Array.from({ length: 4 }).map((_, dayIdx) => /* @__PURE__ */ React15__default.createElement("div", { key: dayIdx }, /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-5 w-40 mb-4" }), /* @__PURE__ */ React15__default.createElement("div", { className: "space-y-3" }, Array.from({ length: 2 + Math.floor(Math.random() * 3) }).map((_2, eventIdx) => /* @__PURE__ */ React15__default.createElement("div", { key: eventIdx, className: "flex items-center gap-4 p-3 rounded-xl bg-muted/10" }, /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-10 w-10 rounded-lg" }), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 space-y-2" }, /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-4 w-3/4" }), /* @__PURE__ */ React15__default.createElement(Skeleton, { className: "h-3 w-1/2" })))))))));
3564
+ var EventContextMenu = ({
3565
+ event,
3566
+ position,
3567
+ onClose,
3568
+ onEdit,
3569
+ onDelete,
3570
+ onDuplicate,
3571
+ customActions = [],
3572
+ translations
3573
+ }) => {
3574
+ const menuRef = useRef(null);
3575
+ useEffect(() => {
3576
+ const handleKeyDown = (e) => {
3577
+ if (e.key === "Escape") {
3578
+ onClose();
3579
+ }
3580
+ };
3581
+ if (position) {
3582
+ document.addEventListener("keydown", handleKeyDown);
3583
+ return () => document.removeEventListener("keydown", handleKeyDown);
3584
+ }
3585
+ }, [position, onClose]);
3586
+ useEffect(() => {
3587
+ const handleClickOutside = (e) => {
3588
+ if (menuRef.current && !menuRef.current.contains(e.target)) {
3589
+ onClose();
3590
+ }
3591
+ };
3592
+ if (position) {
3593
+ setTimeout(() => {
3594
+ document.addEventListener("mousedown", handleClickOutside);
3595
+ }, 0);
3596
+ return () => document.removeEventListener("mousedown", handleClickOutside);
3597
+ }
3598
+ }, [position, onClose]);
3599
+ if (!event || !position) return null;
3600
+ const actions = [
3601
+ ...onEdit ? [{
3602
+ id: "edit",
3603
+ label: translations?.edit || "Edit",
3604
+ icon: /* @__PURE__ */ React15__default.createElement(Edit3, { className: "w-4 h-4" }),
3605
+ onClick: () => {
3606
+ onEdit(event);
3607
+ onClose();
3608
+ }
3609
+ }] : [],
3610
+ ...onDuplicate ? [{
3611
+ id: "duplicate",
3612
+ label: translations?.duplicate || "Duplicate",
3613
+ icon: /* @__PURE__ */ React15__default.createElement(Copy, { className: "w-4 h-4" }),
3614
+ onClick: () => {
3615
+ onDuplicate(event);
3616
+ onClose();
3617
+ }
3618
+ }] : [],
3619
+ ...customActions,
3620
+ ...onDelete ? [{
3621
+ id: "delete",
3622
+ label: translations?.delete || "Delete",
3623
+ icon: /* @__PURE__ */ React15__default.createElement(Trash2, { className: "w-4 h-4" }),
3624
+ onClick: () => {
3625
+ onDelete(event.id);
3626
+ onClose();
3627
+ },
3628
+ variant: "danger"
3629
+ }] : []
3630
+ ];
3631
+ const adjustedPosition = {
3632
+ x: Math.min(position.x, window.innerWidth - 200),
3633
+ y: Math.min(position.y, window.innerHeight - (actions.length * 44 + 80))
3634
+ };
3635
+ return /* @__PURE__ */ React15__default.createElement(AnimatePresence, null, /* @__PURE__ */ React15__default.createElement(
3636
+ motion.div,
3637
+ {
3638
+ ref: menuRef,
3639
+ initial: { opacity: 0, scale: 0.95, y: -5 },
3640
+ animate: { opacity: 1, scale: 1, y: 0 },
3641
+ exit: { opacity: 0, scale: 0.95, y: -5 },
3642
+ transition: { duration: 0.15, ease: "easeOut" },
3643
+ className: "fixed z-[100] min-w-[180px] bg-background border-[0.5px] border-border rounded-xl shadow-xl overflow-hidden",
3644
+ style: {
3645
+ left: adjustedPosition.x,
3646
+ top: adjustedPosition.y
3647
+ }
3648
+ },
3649
+ /* @__PURE__ */ React15__default.createElement("div", { className: "px-3 py-2 border-b-[0.5px] border-border bg-muted/30" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React15__default.createElement(
3650
+ "div",
3651
+ {
3652
+ className: "w-2.5 h-2.5 rounded-full shrink-0",
3653
+ style: { backgroundColor: event.color || "var(--primary)" }
3654
+ }
3655
+ ), /* @__PURE__ */ React15__default.createElement("span", { className: "text-sm font-medium truncate text-foreground" }, event.title))),
3656
+ /* @__PURE__ */ React15__default.createElement("div", { className: "py-1" }, actions.map((action, index) => /* @__PURE__ */ React15__default.createElement(React15__default.Fragment, { key: action.id }, index > 0 && action.variant === "danger" && /* @__PURE__ */ React15__default.createElement("div", { className: "h-px bg-border my-1" }), /* @__PURE__ */ React15__default.createElement(
3657
+ "button",
3658
+ {
3659
+ onClick: action.onClick,
3660
+ disabled: action.disabled,
3661
+ className: cn(
3662
+ "w-full flex items-center gap-3 px-3 py-2 text-sm transition-colors",
3663
+ action.disabled && "opacity-50 cursor-not-allowed",
3664
+ action.variant === "danger" ? "text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20" : "text-foreground hover:bg-accent"
3665
+ )
3666
+ },
3667
+ action.icon,
3668
+ /* @__PURE__ */ React15__default.createElement("span", null, action.label)
3669
+ ))))
3670
+ ));
3671
+ };
3672
+ var useEventContextMenu = () => {
3673
+ const [contextMenu, setContextMenu] = useState({ event: null, position: null });
3674
+ const openContextMenu = useCallback((event, e) => {
3675
+ e.preventDefault();
3676
+ e.stopPropagation();
3677
+ setContextMenu({
3678
+ event,
3679
+ position: { x: e.clientX, y: e.clientY }
3680
+ });
3681
+ }, []);
3682
+ const closeContextMenu = useCallback(() => {
3683
+ setContextMenu({ event: null, position: null });
3684
+ }, []);
3685
+ return {
3686
+ contextMenuEvent: contextMenu.event,
3687
+ contextMenuPosition: contextMenu.position,
3688
+ openContextMenu,
3689
+ closeContextMenu
3690
+ };
3691
+ };
3692
+
3693
+ // src/lib/theme.ts
3694
+ function colorToHsl(color) {
3695
+ let r = 0, g = 0, b = 0;
3696
+ if (color.startsWith("#") || /^[0-9a-fA-F]{3,6}$/.test(color)) {
3697
+ let c = color.replace(/^#/, "");
3698
+ if (c.length === 3) {
3699
+ c = c.split("").map((char) => char + char).join("");
3700
+ }
3701
+ if (c.length !== 6) return null;
3702
+ r = parseInt(c.substring(0, 2), 16) / 255;
3703
+ g = parseInt(c.substring(2, 4), 16) / 255;
3704
+ b = parseInt(c.substring(4, 6), 16) / 255;
3705
+ } else if (color.startsWith("rgb")) {
3706
+ const match = color.match(/\d+/g);
3707
+ if (!match || match.length < 3) return null;
3708
+ r = parseInt(match[0]) / 255;
3709
+ g = parseInt(match[1]) / 255;
3710
+ b = parseInt(match[2]) / 255;
3711
+ } else {
3712
+ return null;
3713
+ }
3714
+ const max = Math.max(r, g, b);
3715
+ const min = Math.min(r, g, b);
3716
+ let h = 0;
3717
+ let s = 0;
3718
+ let l = (max + min) / 2;
3719
+ if (max !== min) {
3720
+ const d = max - min;
3721
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
3722
+ switch (max) {
3723
+ case r:
3724
+ h = (g - b) / d + (g < b ? 6 : 0);
3725
+ break;
3726
+ case g:
3727
+ h = (b - r) / d + 2;
3728
+ break;
3729
+ case b:
3730
+ h = (r - g) / d + 4;
3731
+ break;
3732
+ }
3733
+ h /= 6;
3734
+ }
3735
+ const hDeg = Math.round(h * 360);
3736
+ const sPct = Math.round(s * 100);
3737
+ const lPct = Math.round(l * 100);
3738
+ return `${hDeg} ${sPct}% ${lPct}%`;
3739
+ }
3740
+ function getThemeStyles(theme) {
3741
+ if (!theme) return {};
3742
+ const styles = {};
3743
+ if (theme.colors) {
3744
+ const mappings = {
3745
+ "--background": "background",
3746
+ "--foreground": "foreground",
3747
+ "--primary": "primary",
3748
+ "--secondary": "secondary",
3749
+ "--muted": "muted",
3750
+ "--accent": "accent",
3751
+ "--border": "border"
3752
+ };
3753
+ Object.entries(mappings).forEach(([cssVar, themeKey]) => {
3754
+ const colorValue = theme.colors?.[themeKey];
3755
+ if (colorValue) {
3756
+ const hsl = colorToHsl(colorValue);
3757
+ if (hsl) {
3758
+ styles[cssVar] = hsl;
3759
+ }
3760
+ }
3761
+ });
3762
+ }
3763
+ if (theme.borderRadius) {
3764
+ styles["--radius"] = theme.borderRadius;
3765
+ }
3766
+ if (theme.fontFamily) {
3767
+ styles["fontFamily"] = theme.fontFamily;
3768
+ }
3769
+ return styles;
3770
+ }
3771
+ var useCalendarLogic = ({
3772
+ events,
3773
+ view: controlledView,
3774
+ onViewChange: controlledOnViewChange,
3775
+ date: controlledDate,
3776
+ onDateChange: controlledOnDateChange,
3777
+ onEventClick,
3778
+ onEventDrop,
3779
+ onEventUpdate,
3780
+ onEventCreate,
3781
+ onEventDelete,
3782
+ readOnly,
3783
+ timezone
3784
+ }) => {
3785
+ const [internalView, setInternalView] = useState("week");
3786
+ const [internalDate, setInternalDate] = useState(/* @__PURE__ */ new Date());
3787
+ const [isSidebarOpen, setIsSidebarOpen] = useState(false);
3788
+ useEffect(() => {
3789
+ if (window.innerWidth >= 768) {
3790
+ setIsSidebarOpen(true);
3791
+ }
3792
+ }, []);
3793
+ const [isModalOpen, setIsModalOpen] = useState(false);
3794
+ const [selectedEvent, setSelectedEvent] = useState(null);
3795
+ const [modalInitialDate, setModalInitialDate] = useState(void 0);
3796
+ const view = controlledView ?? internalView;
3797
+ const currentDate = controlledDate ?? internalDate;
3798
+ const expandedEvents = useMemo(() => {
3799
+ const allEvents = [];
3800
+ const rangeStart = subDays(currentDate, 365);
3801
+ const rangeEnd = addDays(currentDate, 365);
3802
+ events.forEach((event) => {
3803
+ if (event.recurrence) {
3804
+ try {
3805
+ const rule = new RRule({
3806
+ freq: RRule[event.recurrence.freq],
3807
+ interval: event.recurrence.interval || 1,
3808
+ dtstart: new Date(event.start),
3809
+ until: event.recurrence.until ? new Date(event.recurrence.until) : void 0,
3810
+ count: event.recurrence.count
3811
+ });
3812
+ const dates = rule.between(rangeStart, rangeEnd);
3813
+ dates.forEach((date) => {
3814
+ const duration = differenceInMilliseconds(new Date(event.end), new Date(event.start));
3815
+ allEvents.push({
3816
+ ...event,
3817
+ id: `${event.id}-${date.getTime()}`,
3818
+ // Unique ID for each instance
3819
+ originalEventId: event.id,
3820
+ // Reference to original
3821
+ start: date,
3822
+ end: new Date(date.getTime() + duration)
3823
+ });
3824
+ });
3825
+ } catch (e) {
3826
+ console.error("Error parsing recurrence rule", e);
3827
+ allEvents.push(event);
3828
+ }
3829
+ } else {
3830
+ allEvents.push(event);
3831
+ }
3832
+ });
3833
+ return allEvents;
3834
+ }, [events, currentDate]);
3835
+ const handleViewChange = (newView) => {
3836
+ if (controlledOnViewChange) {
3837
+ controlledOnViewChange(newView);
3838
+ } else {
3839
+ setInternalView(newView);
3840
+ }
3841
+ };
3842
+ const handleDateChange = (newDate) => {
3843
+ if (controlledOnDateChange) {
3844
+ controlledOnDateChange(newDate);
3845
+ } else {
3846
+ setInternalDate(newDate);
3847
+ }
3848
+ };
3849
+ const handlePrev = () => {
3850
+ switch (view) {
3851
+ case "month":
3852
+ handleDateChange(subMonths(currentDate, 1));
3853
+ break;
3854
+ case "week":
3855
+ handleDateChange(subWeeks(currentDate, 1));
3856
+ break;
3857
+ case "day":
3858
+ case "resource":
3859
+ handleDateChange(subDays(currentDate, 1));
3860
+ break;
3861
+ case "agenda":
3862
+ handleDateChange(subDays(currentDate, 7));
3863
+ break;
3864
+ }
3865
+ };
3866
+ const handleNext = () => {
3867
+ switch (view) {
3868
+ case "month":
3869
+ handleDateChange(addMonths(currentDate, 1));
3870
+ break;
3871
+ case "week":
3872
+ handleDateChange(addWeeks(currentDate, 1));
3873
+ break;
3874
+ case "day":
3875
+ case "resource":
3876
+ handleDateChange(addDays(currentDate, 1));
3877
+ break;
3878
+ case "agenda":
3879
+ handleDateChange(addDays(currentDate, 7));
3880
+ break;
3881
+ }
3882
+ };
3883
+ const handleToday = () => {
3884
+ handleDateChange(/* @__PURE__ */ new Date());
3885
+ };
3886
+ const handleDateClick = (date) => {
3887
+ handleDateChange(date);
3888
+ handleViewChange("day");
3889
+ };
3890
+ const handleTimeSlotClick = (date) => {
3891
+ if (readOnly) return;
3892
+ setSelectedEvent(null);
3893
+ setModalInitialDate(date);
3894
+ setIsModalOpen(true);
3895
+ };
3896
+ const handleEventClickInternal = (event) => {
3897
+ if (onEventClick) {
3898
+ onEventClick(event);
3899
+ }
3900
+ if (!readOnly) {
3901
+ setSelectedEvent(event);
3902
+ setModalInitialDate(void 0);
3903
+ setIsModalOpen(true);
3904
+ }
3905
+ };
3906
+ const handleCreateEvent = () => {
3907
+ if (readOnly) return;
3908
+ setSelectedEvent(null);
3909
+ setModalInitialDate(/* @__PURE__ */ new Date());
3910
+ setIsModalOpen(true);
3911
+ };
3912
+ const handleModalSave = (eventData) => {
3913
+ let effectiveEventId = selectedEvent?.id;
3914
+ if (selectedEvent?.originalEventId) {
3915
+ effectiveEventId = selectedEvent.originalEventId;
3916
+ }
3917
+ if (effectiveEventId) {
3918
+ if (onEventUpdate) {
3919
+ onEventUpdate({
3920
+ ...eventData,
3921
+ id: effectiveEventId
3922
+ });
3923
+ }
3924
+ } else {
3925
+ if (onEventCreate) {
3926
+ onEventCreate(eventData);
3927
+ }
3928
+ }
3929
+ };
3930
+ const handleModalDelete = (eventId) => {
3931
+ let effectiveEventId = eventId;
3932
+ if (selectedEvent?.originalEventId && selectedEvent.id === eventId) {
3933
+ effectiveEventId = selectedEvent.originalEventId;
3934
+ }
3935
+ if (onEventDelete) {
3936
+ onEventDelete(effectiveEventId);
3937
+ }
3938
+ };
3939
+ const handleDragEnd = (event) => {
3940
+ const { active, over } = event;
3941
+ if (!over) return;
3942
+ const activeEvent = active.data.current?.event;
3943
+ const overDate = over.data.current?.date;
3944
+ if (!activeEvent || !overDate) return;
3945
+ const originalStart = new Date(activeEvent.start);
3946
+ const originalEnd = new Date(activeEvent.end);
3947
+ const duration = differenceInMilliseconds(originalEnd, originalStart);
3948
+ let newStart;
3949
+ if (view === "month") {
3950
+ if (timezone) {
3951
+ const zonedOriginal = toZonedTime(originalStart, timezone);
3952
+ const zonedNew = new Date(overDate);
3953
+ zonedNew.setHours(zonedOriginal.getHours());
3954
+ zonedNew.setMinutes(zonedOriginal.getMinutes());
3955
+ zonedNew.setSeconds(zonedOriginal.getSeconds());
3956
+ zonedNew.setMilliseconds(zonedOriginal.getMilliseconds());
3957
+ newStart = fromZonedTime(zonedNew, timezone);
3958
+ } else {
3959
+ newStart = new Date(overDate);
3960
+ newStart.setHours(originalStart.getHours());
3961
+ newStart.setMinutes(originalStart.getMinutes());
3962
+ newStart.setSeconds(originalStart.getSeconds());
3963
+ newStart.setMilliseconds(originalStart.getMilliseconds());
3964
+ }
3965
+ } else {
3966
+ if (timezone) {
3967
+ newStart = fromZonedTime(overDate, timezone);
3968
+ } else {
3969
+ newStart = new Date(overDate);
3970
+ }
3971
+ newStart.setSeconds(0);
3972
+ newStart.setMilliseconds(0);
3973
+ }
3974
+ const newEnd = new Date(newStart.getTime() + duration);
3975
+ let newResourceId = activeEvent.resourceId;
3976
+ const overResourceId = over.data.current?.resourceId;
3977
+ if (overResourceId) {
3978
+ newResourceId = overResourceId;
3979
+ }
3980
+ if (newStart.getTime() === originalStart.getTime() && newEnd.getTime() === originalEnd.getTime() && newResourceId === activeEvent.resourceId) {
3981
+ return;
3982
+ }
3983
+ if (onEventDrop) {
3984
+ onEventDrop(
3985
+ { ...activeEvent, start: newStart, end: newEnd, resourceId: newResourceId },
3986
+ newStart,
3987
+ newEnd
3988
+ );
3989
+ } else if (onEventUpdate) {
3990
+ onEventUpdate({
3991
+ ...activeEvent,
3992
+ start: newStart,
3993
+ end: newEnd,
3994
+ resourceId: newResourceId
3995
+ });
3996
+ }
3997
+ };
3998
+ return {
3999
+ view,
4000
+ currentDate,
4001
+ isSidebarOpen,
4002
+ setIsSidebarOpen,
4003
+ isModalOpen,
4004
+ setIsModalOpen,
4005
+ selectedEvent,
4006
+ modalInitialDate,
4007
+ expandedEvents,
4008
+ handleViewChange,
4009
+ handleDateChange,
4010
+ handlePrev,
4011
+ handleNext,
4012
+ handleToday,
4013
+ handleDateClick,
4014
+ handleTimeSlotClick,
4015
+ handleEventClickInternal,
4016
+ handleCreateEvent,
4017
+ handleModalSave,
4018
+ handleModalDelete,
4019
+ handleDragEnd
4020
+ };
4021
+ };
4022
+ var useSwipeGesture = (options) => {
4023
+ const {
4024
+ onSwipeLeft,
4025
+ onSwipeRight,
4026
+ onSwipeUp,
4027
+ onSwipeDown,
4028
+ threshold = 100,
4029
+ restraint = 100,
4030
+ allowedTime = 500,
4031
+ enabled = true
4032
+ } = options;
4033
+ const touchInfoRef = useRef(null);
4034
+ const elementRef = useRef(null);
4035
+ const handleTouchStart = useCallback((e) => {
4036
+ if (!enabled) return;
4037
+ const touch = e.touches[0];
4038
+ touchInfoRef.current = {
4039
+ startX: touch.clientX,
4040
+ startY: touch.clientY,
4041
+ startTime: Date.now()
4042
+ };
4043
+ }, [enabled]);
4044
+ const handleTouchEnd = useCallback((e) => {
4045
+ if (!enabled || !touchInfoRef.current) return;
4046
+ const touch = e.changedTouches[0];
4047
+ const { startX, startY, startTime } = touchInfoRef.current;
4048
+ const distX = touch.clientX - startX;
4049
+ const distY = touch.clientY - startY;
4050
+ const elapsedTime = Date.now() - startTime;
4051
+ if (elapsedTime <= allowedTime) {
4052
+ if (Math.abs(distX) >= threshold && Math.abs(distY) <= restraint) {
4053
+ if (distX > 0) {
4054
+ onSwipeRight?.();
4055
+ } else {
4056
+ onSwipeLeft?.();
4057
+ }
4058
+ } else if (Math.abs(distY) >= threshold && Math.abs(distX) <= restraint) {
4059
+ if (distY > 0) {
4060
+ onSwipeDown?.();
4061
+ } else {
4062
+ onSwipeUp?.();
4063
+ }
4064
+ }
4065
+ }
4066
+ touchInfoRef.current = null;
4067
+ }, [enabled, threshold, restraint, allowedTime, onSwipeLeft, onSwipeRight, onSwipeUp, onSwipeDown]);
4068
+ useEffect(() => {
4069
+ const element = elementRef.current;
4070
+ if (!element) return;
4071
+ element.addEventListener("touchstart", handleTouchStart, { passive: true });
4072
+ element.addEventListener("touchend", handleTouchEnd, { passive: true });
4073
+ return () => {
4074
+ element.removeEventListener("touchstart", handleTouchStart);
4075
+ element.removeEventListener("touchend", handleTouchEnd);
4076
+ };
4077
+ }, [handleTouchStart, handleTouchEnd]);
4078
+ return elementRef;
4079
+ };
4080
+ var useViewSwipe = (onPrev, onNext, enabled = true) => {
4081
+ return useSwipeGesture({
4082
+ onSwipeLeft: onNext,
4083
+ onSwipeRight: onPrev,
4084
+ threshold: 50,
4085
+ restraint: 100,
4086
+ allowedTime: 300,
4087
+ enabled
4088
+ });
4089
+ };
4090
+
4091
+ // src/index.tsx
4092
+ var Scheduler = ({
4093
+ events = [],
4094
+ view: controlledView,
4095
+ onViewChange: controlledOnViewChange,
4096
+ date: controlledDate,
4097
+ onDateChange: controlledOnDateChange,
4098
+ onEventClick,
4099
+ onEventDrop,
4100
+ onEventCreate,
4101
+ onEventUpdate,
4102
+ onEventDelete,
4103
+ onEventResize,
4104
+ timezone,
4105
+ onTimezoneChange,
4106
+ className,
4107
+ theme,
4108
+ renderEventForm,
4109
+ renderHeader,
4110
+ renderMiniCalendar,
4111
+ renderEmptyState,
4112
+ readOnly,
4113
+ calendars,
4114
+ resources,
4115
+ eventTypes,
4116
+ onCalendarToggle,
4117
+ isLoading,
4118
+ isDarkMode,
4119
+ onThemeToggle,
4120
+ translations,
4121
+ hideViewSwitcher,
4122
+ initialScrollHour = 8,
4123
+ reverseTime: reverseTimeProp = false,
4124
+ language = "tr",
4125
+ // default language is Turkish
4126
+ onLanguageChange,
4127
+ locale,
4128
+ sidebarMenus,
4129
+ customViews
4130
+ }) => {
4131
+ const [activeCustomMenu, setActiveCustomMenu] = useState(null);
4132
+ const [activeCustomViewId, setActiveCustomViewId] = useState(null);
4133
+ const [reverseTime, setReverseTime] = useState(reverseTimeProp);
4134
+ const [activeDragEvent, setActiveDragEvent] = useState(null);
4135
+ const schedulerRef = useRef(null);
4136
+ const [fabCssVars, setFabCssVars] = useState({});
4137
+ const [isMounted, setIsMounted] = useState(false);
4138
+ const [isMobile, setIsMobile] = useState(false);
4139
+ useEffect(() => {
4140
+ setIsMounted(true);
4141
+ }, []);
4142
+ useEffect(() => {
4143
+ if (!isMounted) return;
4144
+ const mq = window.matchMedia("(max-width: 767px)");
4145
+ const update = () => setIsMobile(mq.matches);
4146
+ update();
4147
+ mq.addEventListener("change", update);
4148
+ return () => mq.removeEventListener("change", update);
4149
+ }, [isMounted]);
4150
+ const syncFabTheme = useCallback(() => {
4151
+ const root = schedulerRef.current;
4152
+ if (!root) return;
4153
+ const cs = getComputedStyle(root);
4154
+ const vars = ["--primary", "--primary-foreground"];
4155
+ const next = {};
4156
+ vars.forEach((name) => {
4157
+ const value = cs.getPropertyValue(name).trim();
4158
+ if (value) next[name] = value;
4159
+ });
4160
+ setFabCssVars(next);
4161
+ }, []);
4162
+ useEffect(() => {
4163
+ if (!isMounted) return;
4164
+ syncFabTheme();
4165
+ }, [isMounted, theme, isDarkMode, syncFabTheme]);
4166
+ const {
4167
+ contextMenuEvent,
4168
+ contextMenuPosition,
4169
+ closeContextMenu
4170
+ } = useEventContextMenu();
4171
+ const {
4172
+ view,
4173
+ currentDate,
4174
+ isSidebarOpen,
4175
+ setIsSidebarOpen,
4176
+ isModalOpen,
4177
+ setIsModalOpen,
4178
+ selectedEvent,
4179
+ modalInitialDate,
4180
+ handleViewChange,
4181
+ handleDateChange,
4182
+ handlePrev,
4183
+ handleNext,
4184
+ handleToday,
4185
+ handleDateClick,
4186
+ handleTimeSlotClick,
4187
+ handleEventClickInternal,
4188
+ handleCreateEvent,
4189
+ handleModalSave,
4190
+ handleModalDelete,
4191
+ handleDragEnd,
4192
+ expandedEvents
4193
+ // New export
4194
+ } = useCalendarLogic({
4195
+ events,
4196
+ view: controlledView,
4197
+ onViewChange: controlledOnViewChange,
4198
+ date: controlledDate,
4199
+ onDateChange: controlledOnDateChange,
4200
+ onEventClick,
4201
+ onEventDrop,
4202
+ onEventUpdate,
4203
+ onEventCreate,
4204
+ onEventDelete,
4205
+ readOnly,
4206
+ timezone
4207
+ });
4208
+ const sensors = useSensors(
4209
+ useSensor(PointerSensor, {
4210
+ activationConstraint: {
4211
+ distance: 8
4212
+ }
4213
+ })
4214
+ );
4215
+ const gridSize = 15;
4216
+ const snapToGrid = createSnapModifier(gridSize);
4217
+ const modifiers = [snapToGrid, restrictToWindowEdges];
4218
+ const dndSensors = readOnly ? [] : sensors;
4219
+ const handleEventResize = (event, newEnd) => {
4220
+ if (readOnly) return;
4221
+ if (onEventResize) {
4222
+ onEventResize(event, event.start, newEnd);
4223
+ }
4224
+ if (onEventUpdate) {
4225
+ onEventUpdate({
4226
+ ...event,
4227
+ end: newEnd
4228
+ });
4229
+ }
4230
+ };
4231
+ const id = useId();
4232
+ const swipeRef = useViewSwipe(handlePrev, handleNext, true);
4233
+ const t = getTranslations(language, translations ?? {});
4234
+ const handleDragStart = (event) => {
4235
+ const { active } = event;
4236
+ const draggedEvent = expandedEvents.find((e) => e.id === active.id);
4237
+ if (draggedEvent) {
4238
+ setActiveDragEvent(draggedEvent);
4239
+ }
4240
+ };
4241
+ const onDragEndWrapper = (event) => {
4242
+ setActiveDragEvent(null);
4243
+ handleDragEnd(event);
4244
+ };
4245
+ const getDragHeight = () => {
4246
+ if (!activeDragEvent) return void 0;
4247
+ if (view === "resource") {
4248
+ return 80;
4249
+ }
4250
+ if (view !== "week" && view !== "day") return void 0;
4251
+ const duration = differenceInMinutes(activeDragEvent.end, activeDragEvent.start);
4252
+ const hourHeight = view === "day" ? 80 : 60;
4253
+ return duration / 60 * hourHeight;
4254
+ };
4255
+ const getDragWidth = () => {
4256
+ if (view === "month") return "100%";
4257
+ if (view === "resource" && activeDragEvent) {
4258
+ const duration = differenceInMinutes(activeDragEvent.end, activeDragEvent.start);
4259
+ const width = duration / 60 * 100;
4260
+ return `${Math.max(width, 4)}px`;
4261
+ }
4262
+ return "150px";
4263
+ };
4264
+ const filteredEvents = useMemo(() => {
4265
+ if (!calendars) return expandedEvents;
4266
+ const activeCalendarIds = calendars.filter((c) => c.active !== false).map((c) => c.id);
4267
+ return expandedEvents.filter((e) => {
4268
+ if (!e.calendarId) return true;
4269
+ return activeCalendarIds.includes(e.calendarId);
4270
+ });
4271
+ }, [expandedEvents, calendars]);
4272
+ return /* @__PURE__ */ React15__default.createElement(React15__default.Fragment, null, /* @__PURE__ */ React15__default.createElement(
4273
+ DndContext,
4274
+ {
4275
+ id,
4276
+ sensors: dndSensors,
4277
+ onDragStart: handleDragStart,
4278
+ onDragEnd: onDragEndWrapper,
4279
+ modifiers
4280
+ },
4281
+ /* @__PURE__ */ React15__default.createElement(
4282
+ "div",
4283
+ {
4284
+ ref: schedulerRef,
4285
+ className: cn("flex flex-col h-full bg-background text-foreground relative", className),
4286
+ style: getThemeStyles(theme)
4287
+ },
4288
+ renderHeader ? (
4289
+ // Custom header: consumer gets full navigation/state props
4290
+ renderHeader({
4291
+ currentDate,
4292
+ view,
4293
+ onPrev: handlePrev,
4294
+ onNext: handleNext,
4295
+ onToday: handleToday,
4296
+ onViewChange: handleViewChange,
4297
+ translations: t,
4298
+ language,
4299
+ onLanguageChange,
4300
+ isDarkMode,
4301
+ onThemeToggle
4302
+ })
4303
+ ) : /* @__PURE__ */ React15__default.createElement(
4304
+ CalendarHeader,
4305
+ {
4306
+ currentDate,
4307
+ onPrev: handlePrev,
4308
+ onNext: handleNext,
4309
+ onToday: handleToday,
4310
+ view,
4311
+ onViewChange: handleViewChange,
4312
+ onMenuClick: () => setIsSidebarOpen(!isSidebarOpen),
4313
+ isDarkMode,
4314
+ onThemeToggle,
4315
+ translations: t,
4316
+ hideViewSwitcher,
4317
+ language,
4318
+ onLanguageChange,
4319
+ locale,
4320
+ onCreateEvent: handleCreateEvent,
4321
+ customViews,
4322
+ activeCustomViewId,
4323
+ onCustomViewChange: (id2) => {
4324
+ setActiveCustomViewId(id2);
4325
+ setActiveCustomMenu(null);
4326
+ }
4327
+ }
4328
+ ),
4329
+ /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-1 overflow-hidden" }, /* @__PURE__ */ React15__default.createElement(
4330
+ motion.div,
4331
+ {
4332
+ className: "hidden md:block overflow-hidden shrink-0",
4333
+ initial: false,
4334
+ animate: {
4335
+ width: isSidebarOpen ? 256 : 0,
4336
+ opacity: isSidebarOpen ? 1 : 0
4337
+ },
4338
+ transition: {
4339
+ duration: 0.3,
4340
+ ease: [0.4, 0, 0.2, 1]
4341
+ }
4342
+ },
4343
+ /* @__PURE__ */ React15__default.createElement(
4344
+ Sidebar,
4345
+ {
4346
+ currentDate,
4347
+ onDateChange: handleDateChange,
4348
+ onViewChange: handleViewChange,
4349
+ onEventCreate: handleCreateEvent,
4350
+ timezone,
4351
+ onTimezoneChange,
4352
+ className: "w-full h-full",
4353
+ readOnly,
4354
+ calendars,
4355
+ onCalendarToggle,
4356
+ translations: t,
4357
+ renderMiniCalendar,
4358
+ sidebarMenus,
4359
+ activeCustomMenu,
4360
+ onCustomMenuChange: (id2) => {
4361
+ setActiveCustomMenu(id2);
4362
+ setActiveCustomViewId(null);
4363
+ },
4364
+ reverseTime,
4365
+ onReverseTimeChange: setReverseTime,
4366
+ customViews,
4367
+ activeCustomViewId,
4368
+ onCustomViewChange: (id2) => {
4369
+ setActiveCustomViewId(id2);
4370
+ setActiveCustomMenu(null);
4371
+ }
4372
+ }
4373
+ )
4374
+ ), /* @__PURE__ */ React15__default.createElement(AnimatePresence, null, isSidebarOpen && /* @__PURE__ */ React15__default.createElement(
4375
+ motion.div,
4376
+ {
4377
+ key: "mobile-sidebar-overlay",
4378
+ className: "md:hidden fixed inset-0 z-[100] flex",
4379
+ initial: { opacity: 0 },
4380
+ animate: { opacity: 1 },
4381
+ exit: { opacity: 0 },
4382
+ transition: { duration: 0.2 }
4383
+ },
4384
+ /* @__PURE__ */ React15__default.createElement(
4385
+ motion.div,
4386
+ {
4387
+ className: "w-[280px] h-full bg-background shadow-2xl overflow-hidden",
4388
+ initial: { x: -280 },
4389
+ animate: { x: 0 },
4390
+ exit: { x: -280 },
4391
+ transition: { duration: 0.25, ease: [0.4, 0, 0.2, 1] }
4392
+ },
4393
+ /* @__PURE__ */ React15__default.createElement(
4394
+ Sidebar,
4395
+ {
4396
+ currentDate,
4397
+ onDateChange: handleDateChange,
4398
+ onViewChange: handleViewChange,
4399
+ onEventCreate: () => {
4400
+ setIsSidebarOpen(false);
4401
+ handleCreateEvent();
4402
+ },
4403
+ timezone,
4404
+ onTimezoneChange,
4405
+ className: "w-full h-full",
4406
+ readOnly,
4407
+ calendars,
4408
+ onCalendarToggle,
4409
+ translations: t,
4410
+ renderMiniCalendar,
4411
+ sidebarMenus,
4412
+ activeCustomMenu,
4413
+ onCustomMenuChange: (id2) => {
4414
+ setActiveCustomMenu(id2);
4415
+ setActiveCustomViewId(null);
4416
+ setIsSidebarOpen(false);
4417
+ },
4418
+ reverseTime,
4419
+ onReverseTimeChange: setReverseTime,
4420
+ customViews,
4421
+ activeCustomViewId,
4422
+ onCustomViewChange: (id2) => {
4423
+ setActiveCustomViewId(id2);
4424
+ setActiveCustomMenu(null);
4425
+ setIsSidebarOpen(false);
4426
+ }
4427
+ }
4428
+ )
4429
+ ),
4430
+ /* @__PURE__ */ React15__default.createElement(
4431
+ motion.div,
4432
+ {
4433
+ className: "flex-1 bg-black/50 backdrop-blur-sm",
4434
+ onClick: () => setIsSidebarOpen(false)
4435
+ }
4436
+ )
4437
+ )), /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 flex flex-col overflow-hidden relative min-h-0" }, activeCustomMenu !== null && sidebarMenus && /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 overflow-y-auto p-4 md:p-6" }, sidebarMenus.find((m) => m.id === activeCustomMenu)?.component), activeCustomViewId !== null && activeCustomMenu === null && customViews && /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 overflow-y-auto p-4 md:p-6" }, customViews.find((v) => v.id === activeCustomViewId)?.component), activeCustomMenu === null && activeCustomViewId === null && (isLoading ? /* @__PURE__ */ React15__default.createElement("div", { className: "flex-1 overflow-auto p-0 md:p-4 min-h-0" }, /* @__PURE__ */ React15__default.createElement("div", { className: "h-full min-w-full" }, view === "month" && /* @__PURE__ */ React15__default.createElement(MonthViewSkeleton, null), view === "week" && /* @__PURE__ */ React15__default.createElement(WeekViewSkeleton, null), view === "day" && /* @__PURE__ */ React15__default.createElement(DayViewSkeleton, null), view === "agenda" && /* @__PURE__ */ React15__default.createElement(AgendaViewSkeleton, null), view === "resource" && /* @__PURE__ */ React15__default.createElement(WeekViewSkeleton, null))) : (
4438
+ /* overflow-hidden here: each view owns its own scroll container */
4439
+ /* @__PURE__ */ React15__default.createElement("div", { ref: swipeRef, className: "flex-1 overflow-hidden p-0 md:p-4 touch-pan-y min-h-0" }, /* @__PURE__ */ React15__default.createElement("div", { className: "flex flex-col h-full min-w-full min-h-0" }, /* @__PURE__ */ React15__default.createElement(AnimatePresence, { mode: "wait", initial: false }, /* @__PURE__ */ React15__default.createElement(
4440
+ motion.div,
4441
+ {
4442
+ key: `${view}-${currentDate.toISOString()}-${timezone || "local"}`,
4443
+ initial: { opacity: 0, y: 8 },
4444
+ animate: {
4445
+ opacity: 1,
4446
+ y: 0,
4447
+ transition: {
4448
+ duration: 0.2,
4449
+ ease: [0.25, 0.1, 0.25, 1]
4450
+ }
4451
+ },
4452
+ exit: {
4453
+ opacity: 0,
4454
+ y: -8,
4455
+ transition: {
4456
+ duration: 0.15,
4457
+ ease: [0.25, 0.1, 0.25, 1]
4458
+ }
4459
+ },
4460
+ className: "flex-1 min-h-0 flex flex-col",
4461
+ style: { height: "100%" }
4462
+ },
4463
+ view === "month" && /* @__PURE__ */ React15__default.createElement(
4464
+ MonthView,
4465
+ {
4466
+ currentDate,
4467
+ events: filteredEvents,
4468
+ onEventClick: handleEventClickInternal,
4469
+ onDateClick: handleDateClick,
4470
+ timezone,
4471
+ locale
4472
+ }
4473
+ ),
4474
+ view === "week" && /* @__PURE__ */ React15__default.createElement(
4475
+ WeekView,
4476
+ {
4477
+ currentDate,
4478
+ events: filteredEvents,
4479
+ onEventClick: handleEventClickInternal,
4480
+ onTimeSlotClick: handleTimeSlotClick,
4481
+ onEventResize: handleEventResize,
4482
+ timezone,
4483
+ locale,
4484
+ readonly: readOnly,
4485
+ language,
4486
+ initialScrollHour,
4487
+ reverseTime
4488
+ }
4489
+ ),
4490
+ view === "day" && /* @__PURE__ */ React15__default.createElement(
4491
+ DayView,
4492
+ {
4493
+ currentDate,
4494
+ events: filteredEvents,
4495
+ onEventClick: handleEventClickInternal,
4496
+ onTimeSlotClick: handleTimeSlotClick,
4497
+ onEventResize: handleEventResize,
4498
+ timezone,
4499
+ locale,
4500
+ readonly: readOnly,
4501
+ language,
4502
+ initialScrollHour,
4503
+ reverseTime
4504
+ }
4505
+ ),
4506
+ view === "agenda" && /* @__PURE__ */ React15__default.createElement(
4507
+ AgendaView,
4508
+ {
4509
+ currentDate,
4510
+ events: filteredEvents,
4511
+ onEventClick: handleEventClickInternal,
4512
+ onCreateEvent: handleCreateEvent,
4513
+ translations: t,
4514
+ language,
4515
+ renderEmptyState
4516
+ }
4517
+ ),
4518
+ view === "resource" && resources && /* @__PURE__ */ React15__default.createElement(
4519
+ ResourceView,
4520
+ {
4521
+ currentDate,
4522
+ events: filteredEvents,
4523
+ resources,
4524
+ onEventClick: handleEventClickInternal,
4525
+ onTimeSlotClick: (date) => {
4526
+ if (readOnly) return;
4527
+ handleTimeSlotClick(date);
4528
+ },
4529
+ locale,
4530
+ language
4531
+ }
4532
+ )
4533
+ ))))
4534
+ )))),
4535
+ renderEventForm ? renderEventForm({
4536
+ isOpen: isModalOpen,
4537
+ onClose: () => setIsModalOpen(false),
4538
+ event: selectedEvent,
4539
+ initialDate: modalInitialDate,
4540
+ onSave: handleModalSave,
4541
+ onDelete: handleModalDelete
4542
+ }) : /* @__PURE__ */ React15__default.createElement(
4543
+ EventModal,
4544
+ {
4545
+ isOpen: isModalOpen,
4546
+ onClose: () => setIsModalOpen(false),
4547
+ event: selectedEvent,
4548
+ initialDate: modalInitialDate,
4549
+ onSave: handleModalSave,
4550
+ onDelete: handleModalDelete,
4551
+ calendars,
4552
+ eventTypes,
4553
+ translations: t,
4554
+ language
4555
+ }
4556
+ ),
4557
+ /* @__PURE__ */ React15__default.createElement(
4558
+ EventContextMenu,
4559
+ {
4560
+ event: contextMenuEvent,
4561
+ position: contextMenuPosition,
4562
+ onClose: closeContextMenu,
4563
+ onEdit: (event) => {
4564
+ handleEventClickInternal(event);
4565
+ closeContextMenu();
4566
+ },
4567
+ onDelete: (eventId) => {
4568
+ onEventDelete?.(eventId);
4569
+ closeContextMenu();
4570
+ },
4571
+ onDuplicate: (event) => {
4572
+ const duplicatedEvent = {
4573
+ ...event,
4574
+ id: `${event.id}-copy-${Date.now()}`,
4575
+ title: `${event.title} ${t.copy}`,
4576
+ start: new Date(event.start.getTime() + 24 * 60 * 60 * 1e3),
4577
+ // +1 day
4578
+ end: new Date(event.end.getTime() + 24 * 60 * 60 * 1e3)
4579
+ };
4580
+ onEventCreate?.(duplicatedEvent);
4581
+ closeContextMenu();
4582
+ },
4583
+ translations: {
4584
+ edit: t.edit,
4585
+ delete: t.delete,
4586
+ duplicate: t.duplicate
4587
+ }
4588
+ }
4589
+ ),
4590
+ /* @__PURE__ */ React15__default.createElement(DragOverlay, { dropAnimation: null }, activeDragEvent ? /* @__PURE__ */ React15__default.createElement(
4591
+ "div",
4592
+ {
4593
+ className: cn(
4594
+ "rounded-lg shadow-2xl border-2 overflow-hidden cursor-grabbing transition-transform",
4595
+ "backdrop-blur-sm",
4596
+ !activeDragEvent.color && "bg-primary/90 border-primary/60 text-primary-foreground"
4597
+ ),
4598
+ style: {
4599
+ backgroundColor: activeDragEvent.color ? `${activeDragEvent.color}e0` : void 0,
4600
+ borderColor: activeDragEvent.color ? `${activeDragEvent.color}80` : void 0,
4601
+ color: activeDragEvent.color ? "#fff" : void 0,
4602
+ width: getDragWidth(),
4603
+ height: getDragHeight() ? `${getDragHeight()}px` : void 0,
4604
+ boxShadow: `0 20px 40px -15px ${activeDragEvent.color || "var(--primary)"}40, 0 10px 20px -10px rgba(0,0,0,0.2)`,
4605
+ transform: "rotate(-2deg) scale(1.02)"
4606
+ }
4607
+ },
4608
+ /* @__PURE__ */ React15__default.createElement("div", { className: "p-2.5 h-full flex flex-col" }, /* @__PURE__ */ React15__default.createElement(
4609
+ "div",
4610
+ {
4611
+ className: "absolute left-0 top-0 bottom-0 w-1 rounded-l-lg",
4612
+ style: { backgroundColor: activeDragEvent.color || "var(--primary)" }
4613
+ }
4614
+ ), /* @__PURE__ */ React15__default.createElement("div", { className: "pl-2" }, /* @__PURE__ */ React15__default.createElement("div", { className: "font-semibold truncate text-sm" }, activeDragEvent.title), (view === "week" || view === "day") && getDragHeight() && getDragHeight() > 40 && /* @__PURE__ */ React15__default.createElement("div", { className: "text-xs opacity-80 mt-0.5 flex items-center gap-1" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-3 h-3", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2" }, /* @__PURE__ */ React15__default.createElement("circle", { cx: "12", cy: "12", r: "10" }), /* @__PURE__ */ React15__default.createElement("path", { d: "M12 6v6l4 2" })), format(activeDragEvent.start, getTimeFormatFull(language)), " - ", format(activeDragEvent.end, getTimeFormatFull(language)))), /* @__PURE__ */ React15__default.createElement("div", { className: "absolute bottom-1.5 right-1.5 opacity-60" }, /* @__PURE__ */ React15__default.createElement("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor" }, /* @__PURE__ */ React15__default.createElement("circle", { cx: "9", cy: "5", r: "1.5" }), /* @__PURE__ */ React15__default.createElement("circle", { cx: "15", cy: "5", r: "1.5" }), /* @__PURE__ */ React15__default.createElement("circle", { cx: "9", cy: "12", r: "1.5" }), /* @__PURE__ */ React15__default.createElement("circle", { cx: "15", cy: "12", r: "1.5" }), /* @__PURE__ */ React15__default.createElement("circle", { cx: "9", cy: "19", r: "1.5" }), /* @__PURE__ */ React15__default.createElement("circle", { cx: "15", cy: "19", r: "1.5" }))))
4615
+ ) : null)
4616
+ )
4617
+ ), isMounted && isMobile && !readOnly && createPortal(
4618
+ /* @__PURE__ */ React15__default.createElement(
4619
+ "div",
4620
+ {
4621
+ style: {
4622
+ position: "fixed",
4623
+ bottom: "max(1.5rem, env(safe-area-inset-bottom, 0px))",
4624
+ right: "max(1.5rem, env(safe-area-inset-right, 0px))",
4625
+ zIndex: 9999,
4626
+ pointerEvents: "none",
4627
+ ...fabCssVars
4628
+ }
4629
+ },
4630
+ /* @__PURE__ */ React15__default.createElement(
4631
+ "button",
4632
+ {
4633
+ type: "button",
4634
+ "aria-label": t.createEvent ?? t.create ?? "Create event",
4635
+ onClick: handleCreateEvent,
4636
+ style: {
4637
+ pointerEvents: "auto",
4638
+ width: 48,
4639
+ height: 48,
4640
+ borderRadius: 9999,
4641
+ display: "flex",
4642
+ alignItems: "center",
4643
+ justifyContent: "center",
4644
+ backgroundColor: "hsl(var(--primary, 221.2 83.2% 53.3%))",
4645
+ color: "hsl(var(--primary-foreground, 210 40% 98%))",
4646
+ border: "none",
4647
+ cursor: "pointer",
4648
+ boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.25)"
4649
+ }
4650
+ },
4651
+ /* @__PURE__ */ React15__default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }, /* @__PURE__ */ React15__default.createElement("path", { d: "M5 12h14" }), /* @__PURE__ */ React15__default.createElement("path", { d: "M12 5v14" }))
4652
+ )
4653
+ ),
4654
+ document.body
4655
+ ));
4656
+ };
4657
+ var ProScheduler = Scheduler;
4658
+
4659
+ export { LANGUAGE_META, LOCALES, ProScheduler, Scheduler, cn, getTranslations };
4660
+ //# sourceMappingURL=index.mjs.map
4661
+ //# sourceMappingURL=index.mjs.map