", h;
}
e.render_view_data = function() {
@@ -6505,32 +6522,32 @@ const gn = { active_links: function(e) {
if (!l._timed)
if (this.config.all_timed != "short" || i(l)) {
var h = this._safe_copy(l);
- l._virtual ? h._first_chunk = !1 : h._first_chunk = !0, h._drag_resize = !1, h._virtual = !0, h.start_date = new Date(h.start_date), c(l) ? (h.end_date = p(h.start_date), this.config.last_hour != 24 && (h.end_date = m(h.start_date, this.config.last_hour))) : h.end_date = new Date(l.end_date);
- var v = !1;
- h.start_date < this._max_date && h.end_date > this._min_date && h.start_date < h.end_date && (_[o] = h, v = !0);
- var u = this._safe_copy(l);
- if (u._virtual = !0, u.end_date = new Date(u.end_date), u.start_date < this._min_date ? u.start_date = m(this._min_date, this.config.first_hour) : u.start_date = m(p(l.start_date), this.config.first_hour), u.start_date < this._max_date && u.start_date < u.end_date) {
- if (!v) {
- _[o--] = u;
+ l._virtual ? h._first_chunk = !1 : h._first_chunk = !0, h._drag_resize = !1, h._virtual = !0, h.start_date = new Date(h.start_date), c(l) ? (h.end_date = f(h.start_date), this.config.last_hour != 24 && (h.end_date = p(h.start_date, this.config.last_hour))) : h.end_date = new Date(l.end_date);
+ var m = !1;
+ h.start_date < this._max_date && h.end_date > this._min_date && h.start_date < h.end_date && (_[o] = h, m = !0);
+ var v = this._safe_copy(l);
+ if (v._virtual = !0, v.end_date = new Date(v.end_date), v.start_date < this._min_date ? v.start_date = p(this._min_date, this.config.first_hour) : v.start_date = p(f(l.start_date), this.config.first_hour), v.start_date < this._max_date && v.start_date < v.end_date) {
+ if (!m) {
+ _[o--] = v;
continue;
}
- _.splice(o + 1, 0, u), u._last_chunk = !1;
+ _.splice(o + 1, 0, v), v._last_chunk = !1;
} else
h._last_chunk = !0, h._drag_resize = !0;
} else
this._mode != "month" && _.splice(o--, 1);
}
- var f = this._drag_mode != "move" && a;
- return d.call(this, _, f);
+ var u = this._drag_mode != "move" && a;
+ return d.call(this, _, u);
function c(g) {
- var y = p(g.start_date);
+ var y = f(g.start_date);
return +g.end_date > +y;
}
- function p(g) {
+ function f(g) {
var y = e.date.add(g, 1, "day");
return y = e.date.date_part(y);
}
- function m(g, y) {
+ function p(g, y) {
var x = e.date.date_part(new Date(g));
return x.setHours(y), x;
}
@@ -6590,28 +6607,28 @@ const gn = { active_links: function(e) {
else {
n = e.getEvents(d.start_date, d.end_date);
for (var h = 0; h < n.length; h++) {
- var v = n[h];
- if (v.id == d.id || v.event_length && [v.event_pid, v.event_length].join("#") == d.id) {
+ var m = n[h];
+ if (m.id == d.id || m.event_length && [m.event_pid, m.event_length].join("#") == d.id) {
n.splice(h, 1);
break;
}
- if (v.recurring_event_id && [v.recurring_event_id, v._pid_time].join("#") == d.id) {
+ if (m.recurring_event_id && [m.recurring_event_id, m._pid_time].join("#") == d.id) {
n.splice(h, 1);
break;
}
}
}
- var u = e._get_section_view(), f = e._get_section_property(), c = !0;
- if (u) {
- var p = 0;
+ var v = e._get_section_view(), u = e._get_section_property(), c = !0;
+ if (v) {
+ var f = 0;
for (h = 0; h < n.length; h++)
- n[h].id != d.id && this._check_sections_collision(n[h], d) && p++;
- p >= s && (c = !1);
+ n[h].id != d.id && this._check_sections_collision(n[h], d) && f++;
+ f >= s && (c = !1);
} else
n.length >= s && (c = !1);
if (!c) {
- var m = !e.callEvent("onEventCollision", [d, n]);
- return m || (d[f] = i || d[f]), m;
+ var p = !e.callEvent("onEventCollision", [d, n]);
+ return p || (d[u] = i || d[u]), p;
}
return c;
};
@@ -6621,32 +6638,32 @@ const gn = { active_links: function(e) {
e._pre_render_events = function(l, h) {
if (!e.config.container_autoresize || !t)
return i.apply(this, arguments);
- var v = this.xy.bar_height, u = this._colsS.heights, f = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0], c = this._els.dhx_cal_data[0];
+ var m = this.xy.bar_height, v = this._colsS.heights, u = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0], c = this._els.dhx_cal_data[0];
if (l = this._table_view ? this._pre_render_events_table(l, h) : this._pre_render_events_line(l, h), this._table_view)
if (h)
- this._colsS.heights = u;
+ this._colsS.heights = v;
else {
- var p = c.firstChild;
- const E = p.querySelectorAll(".dhx_cal_month_row");
- if (E && E.length) {
- for (var m = 0; m < E.length; m++) {
- if (f[m]++, f[m] * v > this._colsS.height - this.xy.month_head_height) {
- var g = E[m].querySelectorAll(".dhx_cal_month_cell"), y = this._colsS.height - this.xy.month_head_height;
- 1 * this.config.max_month_events !== this.config.max_month_events || f[m] <= this.config.max_month_events ? y = f[m] * v : (this.config.max_month_events + 1) * v > this._colsS.height - this.xy.month_head_height && (y = (this.config.max_month_events + 1) * v), E[m].style.height = y + this.xy.month_head_height + "px";
+ var f = c.firstChild;
+ const w = f.querySelectorAll(".dhx_cal_month_row");
+ if (w && w.length) {
+ for (var p = 0; p < w.length; p++) {
+ if (u[p]++, u[p] * m > this._colsS.height - this.xy.month_head_height) {
+ var g = w[p].querySelectorAll(".dhx_cal_month_cell"), y = this._colsS.height - this.xy.month_head_height;
+ 1 * this.config.max_month_events !== this.config.max_month_events || u[p] <= this.config.max_month_events ? y = u[p] * m : (this.config.max_month_events + 1) * m > this._colsS.height - this.xy.month_head_height && (y = (this.config.max_month_events + 1) * m), w[p].style.height = y + this.xy.month_head_height + "px";
for (var x = 0; x < g.length; x++)
g[x].childNodes[1].style.height = y + "px";
- f[m] = (f[m - 1] || 0) + g[0].offsetHeight;
+ u[p] = (u[p - 1] || 0) + g[0].offsetHeight;
}
- f[m] = (f[m - 1] || 0) + E[m].querySelectorAll(".dhx_cal_month_cell")[0].offsetHeight;
+ u[p] = (u[p - 1] || 0) + w[p].querySelectorAll(".dhx_cal_month_cell")[0].offsetHeight;
}
- f.unshift(0), p.parentNode.offsetHeight < p.parentNode.scrollHeight && p._h_fix;
- } else if (l.length || this._els.dhx_multi_day[0].style.visibility != "visible" || (f[0] = -1), l.length || f[0] == -1) {
- var b = (f[0] + 1) * v + 1;
+ u.unshift(0), f.parentNode.offsetHeight < f.parentNode.scrollHeight && f._h_fix;
+ } else if (l.length || this._els.dhx_multi_day[0].style.visibility != "visible" || (u[0] = -1), l.length || u[0] == -1) {
+ var b = (u[0] + 1) * m + 1;
d != b + 1 && (this._obj.style.height = r - d + b - 1 + "px"), b += "px";
- const D = this._els.dhx_cal_navline[0].offsetHeight, w = this._els.dhx_cal_header[0].offsetHeight;
- c.style.height = this._obj.offsetHeight - D - w - (this.xy.margin_top || 0) + "px";
+ const D = this._els.dhx_cal_navline[0].offsetHeight, E = this._els.dhx_cal_header[0].offsetHeight;
+ c.style.height = this._obj.offsetHeight - D - E - (this.xy.margin_top || 0) + "px";
var k = this._els.dhx_multi_day[0];
- k.style.height = b, k.style.visibility = f[0] == -1 ? "hidden" : "visible", k.style.display = f[0] == -1 ? "none" : "", (k = this._els.dhx_multi_day[1]).style.height = b, k.style.visibility = f[0] == -1 ? "hidden" : "visible", k.style.display = f[0] == -1 ? "none" : "", k.className = f[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small", this._dy_shift = (f[0] + 1) * v, f[0] = 0;
+ k.style.height = b, k.style.visibility = u[0] == -1 ? "hidden" : "visible", k.style.display = u[0] == -1 ? "none" : "", (k = this._els.dhx_multi_day[1]).style.height = b, k.style.visibility = u[0] == -1 ? "hidden" : "visible", k.style.display = u[0] == -1 ? "none" : "", k.className = u[0] ? "dhx_multi_day_icon" : "dhx_multi_day_icon_small", this._dy_shift = (u[0] + 1) * m, u[0] = 0;
}
}
return l;
@@ -6654,68 +6671,68 @@ const gn = { active_links: function(e) {
var n = ["dhx_cal_navline", "dhx_cal_header", "dhx_multi_day", "dhx_cal_data"], s = function(l) {
r = 0;
for (var h = 0; h < n.length; h++) {
- var v = n[h], u = e._els[v] ? e._els[v][0] : null, f = 0;
- switch (v) {
+ var m = n[h], v = e._els[m] ? e._els[m][0] : null, u = 0;
+ switch (m) {
case "dhx_cal_navline":
case "dhx_cal_header":
- f = u.offsetHeight;
+ u = v.offsetHeight;
break;
case "dhx_multi_day":
- f = u ? u.offsetHeight - 1 : 0, d = f;
+ u = v ? v.offsetHeight - 1 : 0, d = u;
break;
case "dhx_cal_data":
var c = e.getState().mode;
- if (u.childNodes[1] && c != "month") {
+ if (v.childNodes[1] && c != "month") {
let M = 0;
- for (let A = 0; A < u.childNodes.length; A++)
- u.childNodes[A].offsetHeight > M && (M = u.childNodes[A].offsetHeight);
- f = M;
+ for (let T = 0; T < v.childNodes.length; T++)
+ v.childNodes[T].offsetHeight > M && (M = v.childNodes[T].offsetHeight);
+ u = M;
} else
- f = Math.max(u.offsetHeight - 1, u.scrollHeight);
+ u = Math.max(v.offsetHeight - 1, v.scrollHeight);
if (c == "month")
- e.config.month_day_min_height && !l && (f = u.querySelectorAll(".dhx_cal_month_row").length * e.config.month_day_min_height), l && (u.style.height = f + "px");
+ e.config.month_day_min_height && !l && (u = v.querySelectorAll(".dhx_cal_month_row").length * e.config.month_day_min_height), l && (v.style.height = u + "px");
else if (c == "year")
- f = 190 * e.config.year_y;
+ u = 190 * e.config.year_y;
else if (c == "agenda") {
- if (f = 0, u.childNodes && u.childNodes.length)
- for (var p = 0; p < u.childNodes.length; p++)
- f += u.childNodes[p].offsetHeight;
- f + 2 < e.config.min_grid_size ? f = e.config.min_grid_size : f += 2;
+ if (u = 0, v.childNodes && v.childNodes.length)
+ for (var f = 0; f < v.childNodes.length; f++)
+ u += v.childNodes[f].offsetHeight;
+ u + 2 < e.config.min_grid_size ? u = e.config.min_grid_size : u += 2;
} else if (c == "week_agenda") {
- for (var m, g, y = e.xy.week_agenda_scale_height + e.config.min_grid_size, x = 0; x < u.childNodes.length; x++)
- for (g = u.childNodes[x], p = 0; p < g.childNodes.length; p++) {
- for (var b = 0, k = g.childNodes[p].childNodes[1], E = 0; E < k.childNodes.length; E++)
- b += k.childNodes[E].offsetHeight;
- m = b + e.xy.week_agenda_scale_height, (m = x != 1 || p != 2 && p != 3 ? m : 2 * m) > y && (y = m);
+ for (var p, g, y = e.xy.week_agenda_scale_height + e.config.min_grid_size, x = 0; x < v.childNodes.length; x++)
+ for (g = v.childNodes[x], f = 0; f < g.childNodes.length; f++) {
+ for (var b = 0, k = g.childNodes[f].childNodes[1], w = 0; w < k.childNodes.length; w++)
+ b += k.childNodes[w].offsetHeight;
+ p = b + e.xy.week_agenda_scale_height, (p = x != 1 || f != 2 && f != 3 ? p : 2 * p) > y && (y = p);
}
- f = 3 * y;
+ u = 3 * y;
} else if (c == "map") {
- f = 0;
- var D = u.querySelectorAll(".dhx_map_line");
- for (p = 0; p < D.length; p++)
- f += D[p].offsetHeight;
- f + 2 < e.config.min_map_size ? f = e.config.min_map_size : f += 2;
+ u = 0;
+ var D = v.querySelectorAll(".dhx_map_line");
+ for (f = 0; f < D.length; f++)
+ u += D[f].offsetHeight;
+ u + 2 < e.config.min_map_size ? u = e.config.min_map_size : u += 2;
} else if (e._gridView)
- if (f = 0, u.childNodes[1].childNodes[0].childNodes && u.childNodes[1].childNodes[0].childNodes.length) {
- for (D = u.childNodes[1].childNodes[0].childNodes[0].childNodes, p = 0; p < D.length; p++)
- f += D[p].offsetHeight;
- (f += 2) < e.config.min_grid_size && (f = e.config.min_grid_size);
+ if (u = 0, v.childNodes[1].childNodes[0].childNodes && v.childNodes[1].childNodes[0].childNodes.length) {
+ for (D = v.childNodes[1].childNodes[0].childNodes[0].childNodes, f = 0; f < D.length; f++)
+ u += D[f].offsetHeight;
+ (u += 2) < e.config.min_grid_size && (u = e.config.min_grid_size);
} else
- f = e.config.min_grid_size;
+ u = e.config.min_grid_size;
if (e.matrix && e.matrix[c]) {
if (l)
- f += 0, u.style.height = f + "px";
+ u += 0, v.style.height = u + "px";
else {
- f = 0;
- for (var w = e.matrix[c], S = w.y_unit, N = 0; N < S.length; N++)
- f += w.getSectionHeight(S[N].key);
- e.$container.clientWidth != e.$container.scrollWidth && (f += o());
+ u = 0;
+ for (var E = e.matrix[c], S = E.y_unit, N = 0; N < S.length; N++)
+ u += E.getSectionHeight(S[N].key);
+ e.$container.clientWidth != e.$container.scrollWidth && (u += o());
}
- f -= 1;
+ u -= 1;
}
- (c == "day" || c == "week" || e._props && e._props[c]) && (f += 2);
+ (c == "day" || c == "week" || e._props && e._props[c]) && (u += 2);
}
- r += f += 1;
+ r += u += 1;
}
e._obj.style.height = r + "px", l || e.updateView();
};
@@ -6728,11 +6745,11 @@ const gn = { active_links: function(e) {
var l = e.getState().mode;
if (!l)
return !0;
- var h = window.requestAnimationFrame || window.setTimeout, v = document.documentElement.scrollTop;
+ var h = window.requestAnimationFrame || window.setTimeout, m = document.documentElement.scrollTop;
h(function() {
!e.$destroyed && e.$initialized && s();
}), e.matrix && e.matrix[l] || l == "month" ? h(function() {
- !e.$destroyed && e.$initialized && (s(!0), document.documentElement.scrollTop = v, _());
+ !e.$destroyed && e.$initialized && (s(!0), document.documentElement.scrollTop = m, _());
}, 1) : _();
};
function o() {
@@ -6745,8 +6762,8 @@ const gn = { active_links: function(e) {
var l = e.config.container_autoresize;
if (e.xy.$original_scroll_width || (e.xy.$original_scroll_width = e.xy.scroll_width), e.xy.scroll_width = l ? 0 : e.xy.$original_scroll_width, e.matrix)
for (var h in e.matrix) {
- var v = e.matrix[h];
- v.$original_section_autoheight || (v.$original_section_autoheight = v.section_autoheight), v.section_autoheight = !l && v.$original_section_autoheight;
+ var m = e.matrix[h];
+ m.$original_section_autoheight || (m.$original_section_autoheight = m.section_autoheight), m.section_autoheight = !l && m.$original_section_autoheight;
}
return !0;
}), e.attachEvent("onViewChange", a), e.attachEvent("onXLE", a), e.attachEvent("onEventChanged", a), e.attachEvent("onEventCreated", a), e.attachEvent("onEventAdded", a), e.attachEvent("onEventDeleted", a), e.attachEvent("onAfterSchedulerResize", a), e.attachEvent("onClearAll", a), e.attachEvent("onBeforeExpand", function() {
@@ -6767,14 +6784,14 @@ const gn = { active_links: function(e) {
var o = i(e);
if (t) {
t = !1;
- var l = function(v) {
- var u = v + "=";
+ var l = function(m) {
+ var v = m + "=";
if (document.cookie.length > 0) {
- var f = document.cookie.indexOf(u);
- if (f != -1) {
- f += u.length;
- var c = document.cookie.indexOf(";", f);
- return c == -1 && (c = document.cookie.length), document.cookie.substring(f, c);
+ var u = document.cookie.indexOf(v);
+ if (u != -1) {
+ u += v.length;
+ var c = document.cookie.indexOf(";", u);
+ return c == -1 && (c = document.cookie.length), document.cookie.substring(u, c);
}
}
return "";
@@ -6815,28 +6832,28 @@ const gn = { active_links: function(e) {
return t += "
";
}, set_value: function(i, t, r, d) {
(function() {
- u();
- var v = e.attachEvent("onAfterLightbox", function() {
- u(), e.detachEvent(v);
+ v();
+ var m = e.attachEvent("onAfterLightbox", function() {
+ v(), e.detachEvent(m);
});
- function u() {
+ function v() {
if (i._combo && i._combo.DOMParent) {
- var f = i._combo;
- f.unload ? f.unload() : f.destructor && f.destructor(), f.DOMParent = f.DOMelem = null;
+ var u = i._combo;
+ u.unload ? u.unload() : u.destructor && u.destructor(), u.DOMParent = u.DOMelem = null;
}
}
})(), window.dhx_globalImgPath = d.image_path || "/", i._combo = new dhtmlXCombo(i, d.name, i.offsetWidth - 8), d.onchange && i._combo.attachEvent("onChange", d.onchange), d.options_height && i._combo.setOptionHeight(d.options_height);
var n = i._combo;
if (n.enableFilteringMode(d.filtering, d.script_path || null, !!d.cache), d.script_path) {
var s = r[d.map_to];
- s ? d.cached_options[s] ? (n.addOption(s, d.cached_options[s]), n.disable(1), n.selectOption(0), n.disable(0)) : e.ajax.get(d.script_path + "?id=" + s + "&uid=" + e.uid(), function(v) {
- var u, f = v.xmlDoc.responseText;
+ s ? d.cached_options[s] ? (n.addOption(s, d.cached_options[s]), n.disable(1), n.selectOption(0), n.disable(0)) : e.ajax.get(d.script_path + "?id=" + s + "&uid=" + e.uid(), function(m) {
+ var v, u = m.xmlDoc.responseText;
try {
- u = JSON.parse(f).options[0].text;
+ v = JSON.parse(u).options[0].text;
} catch {
- u = e.ajax.xpath("//option", v.xmlDoc)[0].childNodes[0].nodeValue;
+ v = e.ajax.xpath("//option", m.xmlDoc)[0].childNodes[0].nodeValue;
}
- d.cached_options[s] = u, n.addOption(s, u), n.disable(1), n.selectOption(0), n.disable(0);
+ d.cached_options[s] = v, n.addOption(s, v), n.disable(1), n.selectOption(0), n.disable(0);
}) : n.setComboValue("");
} else {
for (var _ = [], a = 0; a < d.options.length; a++) {
@@ -6999,23 +7016,23 @@ const gn = { active_links: function(e) {
return this._hidden_export_form;
}, r._get_export_size = function(n, s, _, a, o, l, h) {
a = parseInt(a) / 25.4 || 4;
- var v = { A5: { x: 148, y: 210 }, A4: { x: 210, y: 297 }, A3: { x: 297, y: 420 }, A2: { x: 420, y: 594 }, A1: { x: 594, y: 841 }, A0: { x: 841, y: 1189 } }, u = t("dhx_cal_data", this).x, f = { y: t("dhx_cal_data", this).y + t("dhx_cal_header", this).y + t("dhx_multi_day", this).y };
- return f.x = n === "full" ? u : Math.floor((s === "landscape" ? v[n].y : v[n].x) * a), h && (f.x *= parseFloat(h.x) || 1, f.y *= parseFloat(h.y) || 1), f;
+ var m = { A5: { x: 148, y: 210 }, A4: { x: 210, y: 297 }, A3: { x: 297, y: 420 }, A2: { x: 420, y: 594 }, A1: { x: 594, y: 841 }, A0: { x: 841, y: 1189 } }, v = t("dhx_cal_data", this).x, u = { y: t("dhx_cal_data", this).y + t("dhx_cal_header", this).y + t("dhx_multi_day", this).y };
+ return u.x = n === "full" ? v : Math.floor((s === "landscape" ? m[n].y : m[n].x) * a), h && (u.x *= parseFloat(h.x) || 1, u.y *= parseFloat(h.y) || 1), u;
}, r._export_html = function(n) {
var s, _, a, o = (s = void 0, _ = void 0, (a = d()) && (_ = a.scrollable, s = a.smart_rendering), { nav_height: r.xy.nav_height, scroll_width: r.xy.scroll_width, style_width: r._obj.style.width, style_height: r._obj.style.height, timeline_scrollable: _, timeline_smart_rendering: s }), l = r._get_export_size(n.format, n.orientation, n.zoom, n.dpi, n.header, n.footer, n.scales), h = "";
try {
- (function(v, u) {
- r._obj.style.width = v.x + "px", r._obj.style.height = v.y + "px", r.xy.nav_height = 0, r.xy.scroll_width = 0;
- var f = d();
- (u.timeline_scrollable || u.timeline_smart_rendering) && (f.scrollable = !1, f.smart_rendering = !1);
+ (function(m, v) {
+ r._obj.style.width = m.x + "px", r._obj.style.height = m.y + "px", r.xy.nav_height = 0, r.xy.scroll_width = 0;
+ var u = d();
+ (v.timeline_scrollable || v.timeline_smart_rendering) && (u.scrollable = !1, u.smart_rendering = !1);
})(l, o), r.setCurrentView(), h = r._obj.innerHTML;
- } catch (v) {
- console.error(v);
+ } catch (m) {
+ console.error(m);
} finally {
- (function(v) {
- r.xy.scroll_width = v.scroll_width, r.xy.nav_height = v.nav_height, r._obj.style.width = v.style_width, r._obj.style.height = v.style_height;
- var u = d();
- (v.timeline_scrollable || v.timeline_smart_rendering) && (u.scrollable = v.timeline_scrollable, u.smart_rendering = v.timeline_smart_rendering);
+ (function(m) {
+ r.xy.scroll_width = m.scroll_width, r.xy.nav_height = m.nav_height, r._obj.style.width = m.style_width, r._obj.style.height = m.style_height;
+ var v = d();
+ (m.timeline_scrollable || m.timeline_smart_rendering) && (v.scrollable = m.timeline_scrollable, v.smart_rendering = m.timeline_smart_rendering);
})(o), r.setCurrentView();
}
return h;
@@ -7184,11 +7201,11 @@ const gn = { active_links: function(e) {
var _ = "", a = t.getState().mode, o = !1;
if (_ += t.templates.day_date(d), t.date.day_start(new Date(d)).valueOf() != d.valueOf() && (_ += " " + t.templates.hour_scale(d), o = !0), t.date.day_start(new Date(d)).valueOf() != t.date.day_start(new Date(n)).valueOf() && (_ += " - " + t.templates.day_date(n), (o || t.date.day_start(new Date(n)).valueOf() != n.valueOf()) && (_ += " " + t.templates.hour_scale(n))), s) {
if (t.matrix && t.matrix[a]) {
- const h = t.matrix[a], v = h.y_unit[h.order[s]];
- _ += ", " + t.templates[a + "_scale_label"](v.key, v.label, v);
+ const h = t.matrix[a], m = h.y_unit[h.order[s]];
+ _ += ", " + t.templates[a + "_scale_label"](m.key, m.label, m);
} else if (t._props && t._props[a]) {
- const h = t._props[a], v = h.options[h.order[s]];
- _ += ", " + t.templates[a + "_scale_text"](v.key, v.label, v);
+ const h = t._props[a], m = h.options[h.order[s]];
+ _ += ", " + t.templates[a + "_scale_text"](m.key, m.label, m);
}
}
for (var l = 0; l < r.length; l++)
@@ -7218,26 +7235,26 @@ const gn = { active_links: function(e) {
;
if (h == s._trace_x.length)
return a;
- var v = _[n];
+ var m = _[n];
if (!(o < d && l > r))
return a;
- var u = this.createElement();
- let f, c;
- function p(b, k) {
+ var v = this.createElement();
+ let u, c;
+ function f(b, k) {
k.setDate(1), k.setFullYear(b.getFullYear()), k.setMonth(b.getMonth()), k.setDate(b.getDate());
}
if (t.getView().days) {
const b = new Date(r);
- p(t._min_date, b);
+ f(t._min_date, b);
const k = new Date(d);
- p(t._min_date, k), f = t._timeline_getX({ start_date: b }, !1, s), c = t._timeline_getX({ start_date: k }, !1, s);
+ f(t._min_date, k), u = t._timeline_getX({ start_date: b }, !1, s), c = t._timeline_getX({ start_date: k }, !1, s);
} else
- f = t._timeline_getX({ start_date: r }, !1, s), c = t._timeline_getX({ start_date: d }, !1, s);
- var m = s._section_height[n] - 1 || s.dy - 1, g = 0;
- t._isRender("cell") && (g = v.offsetTop, f += s.dx, c += s.dx, v = t.$container.querySelector(".dhx_cal_data"));
- var y = Math.max(1, c - f - 1);
+ u = t._timeline_getX({ start_date: r }, !1, s), c = t._timeline_getX({ start_date: d }, !1, s);
+ var p = s._section_height[n] - 1 || s.dy - 1, g = 0;
+ t._isRender("cell") && (g = m.offsetTop, u += s.dx, c += s.dx, m = t.$container.querySelector(".dhx_cal_data"));
+ var y = Math.max(1, c - u - 1);
let x = "left";
- return t.config.rtl && (x = "right"), u.style.cssText = `height:${m}px; ${x}:${f}px; width:${y}px; top:${g}px;`, v && (v.appendChild(u), a.push(u)), a;
+ return t.config.rtl && (x = "right"), v.style.cssText = `height:${p}px; ${x}:${u}px; width:${y}px; top:${g}px;`, m && (m.appendChild(v), a.push(v)), a;
}, renderMonthCell: function(r) {
for (var d = t.$container.querySelectorAll(".dhx_month_head"), n = [], s = 0; s < d.length; s++)
n.push(d[s].parentNode);
@@ -7246,10 +7263,10 @@ const gn = { active_links: function(e) {
l = t.date.add(l, 1, "day");
if (_ == -1)
return [];
- var v = t._colsS[o], u = t._colsS.heights[a], f = this.createElement();
- f.style.top = u + "px", f.style.left = v + "px", f.style.width = t._cols[o] + "px", f.style.height = (t._colsS.heights[a + 1] - u || t._colsS.height) + "px";
- var c = t.$container.querySelector(".dhx_cal_data"), p = c.querySelector(".dhx_cal_month_table");
- return p.nextSibling ? c.insertBefore(f, p.nextSibling) : c.appendChild(f), f;
+ var m = t._colsS[o], v = t._colsS.heights[a], u = this.createElement();
+ u.style.top = v + "px", u.style.left = m + "px", u.style.width = t._cols[o] + "px", u.style.height = (t._colsS.heights[a + 1] - v || t._colsS.height) + "px";
+ var c = t.$container.querySelector(".dhx_cal_data"), f = c.querySelector(".dhx_cal_month_table");
+ return f.nextSibling ? c.insertBefore(u, f.nextSibling) : c.appendChild(u), u;
}, renderMonthMarker: function(r, d) {
for (var n = [], s = r; s.valueOf() < d.valueOf(); )
n.push(this.renderMonthCell(s)), s = t.date.add(s, 1, "day");
@@ -7266,11 +7283,11 @@ const gn = { active_links: function(e) {
}
if (!(a = t.locate_holder(s)) || a.querySelector(".dhx_scale_hour"))
return document.createElement("div");
- var v = Math.max(60 * r.getHours() + r.getMinutes(), 60 * o.first_hour), u = Math.min(60 * d.getHours() + d.getMinutes(), 60 * o.last_hour);
- if (!u && t.date.day_start(new Date(d)).valueOf() > t.date.day_start(new Date(r)).valueOf() && (u = 60 * o.last_hour), u <= v)
+ var m = Math.max(60 * r.getHours() + r.getMinutes(), 60 * o.first_hour), v = Math.min(60 * d.getHours() + d.getMinutes(), 60 * o.last_hour);
+ if (!v && t.date.day_start(new Date(d)).valueOf() > t.date.day_start(new Date(r)).valueOf() && (v = 60 * o.last_hour), v <= m)
return [];
- var f = this.createElement(), c = t.config.hour_size_px * o.last_hour + 1, p = 36e5;
- return f.style.top = Math.round((60 * v * 1e3 - t.config.first_hour * p) * t.config.hour_size_px / p) % c + "px", f.style.lineHeight = f.style.height = Math.max(Math.round(60 * (u - v) * 1e3 * t.config.hour_size_px / p) % c, 1) + "px", f.style.width = "100%", a.appendChild(f), _.push(f), _[0];
+ var u = this.createElement(), c = t.config.hour_size_px * o.last_hour + 1, f = 36e5;
+ return u.style.top = Math.round((60 * m * 1e3 - t.config.first_hour * f) * t.config.hour_size_px / f) % c + "px", u.style.lineHeight = u.style.height = Math.max(Math.round(60 * (v - m) * 1e3 * t.config.hour_size_px / f) % c, 1) + "px", u.style.width = "100%", a.appendChild(u), _.push(u), _[0];
} };
}(e), function(t) {
t.$keyboardNavigation.SchedulerNode = function() {
@@ -7618,8 +7635,8 @@ const gn = { active_links: function(e) {
break;
case "down":
s = t.date.add(o, a, "minute");
- var v = n ? s : t.date.add(s, a, "minute");
- this.isInVisibleDayTime(v, !1) || n && !this.isInVisibleDayTime(l, !1) || (n ? (h = !0, t.date.date_part(new Date(l)).valueOf() == l.valueOf() && (h = !1), h && (s = this.findVisibleColumn(t.date.add(r.start_date, 1, "day"), 1)), s.setHours(t.config.first_hour), s.setMinutes(0), s = t.date.add(s, a, "minute")) : ((s = this.findVisibleColumn(t.date.add(r.start_date, 1, "day"), 1)).setHours(t.config.first_hour), s.setMinutes(0))), _ = t.date.add(s, a, "minute");
+ var m = n ? s : t.date.add(s, a, "minute");
+ this.isInVisibleDayTime(m, !1) || n && !this.isInVisibleDayTime(l, !1) || (n ? (h = !0, t.date.date_part(new Date(l)).valueOf() == l.valueOf() && (h = !1), h && (s = this.findVisibleColumn(t.date.add(r.start_date, 1, "day"), 1)), s.setHours(t.config.first_hour), s.setMinutes(0), s = t.date.add(s, a, "minute")) : ((s = this.findVisibleColumn(t.date.add(r.start_date, 1, "day"), 1)).setHours(t.config.first_hour), s.setMinutes(0))), _ = t.date.add(s, a, "minute");
break;
case "left":
s = this._moveDate(r.start_date, -1), _ = this._moveDate(r.end_date, -1);
@@ -7937,61 +7954,61 @@ const gn = { active_links: function(e) {
return a === o;
}, _.$keyboardNavigation.patchMinicalendar = function() {
var a = _.$keyboardNavigation.dispatcher;
- function o(u) {
- var f = u.target;
- a.enable(), a.setActiveNode(new _.$keyboardNavigation.MinicalButton(f, 0));
+ function o(v) {
+ var u = v.target;
+ a.enable(), a.setActiveNode(new _.$keyboardNavigation.MinicalButton(u, 0));
}
- function l(u) {
- var f = u.target || u.srcElement, c = _.utils.dom.locateCss(u, "dhx_cal_prev_button", !1), p = _.utils.dom.locateCss(u, "dhx_cal_next_button", !1), m = _.utils.dom.locateCss(u, "dhx_year_body", !1), g = 0, y = 0;
- if (m) {
- for (var x, b, k = f; k && k.tagName.toLowerCase() != "td"; )
+ function l(v) {
+ var u = v.target || v.srcElement, c = _.utils.dom.locateCss(v, "dhx_cal_prev_button", !1), f = _.utils.dom.locateCss(v, "dhx_cal_next_button", !1), p = _.utils.dom.locateCss(v, "dhx_year_body", !1), g = 0, y = 0;
+ if (p) {
+ for (var x, b, k = u; k && k.tagName.toLowerCase() != "td"; )
k = k.parentNode;
if (k && (x = (b = k).parentNode), x && b) {
- for (var E = x.parentNode.querySelectorAll("tr"), D = 0; D < E.length; D++)
- if (E[D] == x) {
+ for (var w = x.parentNode.querySelectorAll("tr"), D = 0; D < w.length; D++)
+ if (w[D] == x) {
g = D;
break;
}
- var w = x.querySelectorAll("td");
- for (D = 0; D < w.length; D++)
- if (w[D] == b) {
+ var E = x.querySelectorAll("td");
+ for (D = 0; D < E.length; D++)
+ if (E[D] == b) {
y = D;
break;
}
}
}
- var S = u.currentTarget;
+ var S = v.currentTarget;
a.delay(function() {
var N;
- (c || p || m) && (c ? (N = new _.$keyboardNavigation.MinicalButton(S, 0), a.setActiveNode(new _.$keyboardNavigation.MinicalButton(S, 0))) : p ? N = new _.$keyboardNavigation.MinicalButton(S, 1) : m && (N = new _.$keyboardNavigation.MinicalCell(S, g, y)), N && (a.enable(), N.isValid() && (a.activeNode = null, a.setActiveNode(N))));
+ (c || f || p) && (c ? (N = new _.$keyboardNavigation.MinicalButton(S, 0), a.setActiveNode(new _.$keyboardNavigation.MinicalButton(S, 0))) : f ? N = new _.$keyboardNavigation.MinicalButton(S, 1) : p && (N = new _.$keyboardNavigation.MinicalCell(S, g, y)), N && (a.enable(), N.isValid() && (a.activeNode = null, a.setActiveNode(N))));
});
}
if (_.renderCalendar) {
var h = _.renderCalendar;
_.renderCalendar = function() {
- var u = h.apply(this, arguments), f = _.$keyboardNavigation._minicalendars;
- _.eventRemove(u, "click", l), _.event(u, "click", l), _.eventRemove(u, "focus", o), _.event(u, "focus", o);
- for (var c = !1, p = 0; p < f.length; p++)
- if (f[p] == u) {
+ var v = h.apply(this, arguments), u = _.$keyboardNavigation._minicalendars;
+ _.eventRemove(v, "click", l), _.event(v, "click", l), _.eventRemove(v, "focus", o), _.event(v, "focus", o);
+ for (var c = !1, f = 0; f < u.length; f++)
+ if (u[f] == v) {
c = !0;
break;
}
- if (c || f.push(u), a.isEnabled()) {
- var m = a.getActiveNode();
- m && m.container == u ? a.focusNode(m) : u.setAttribute("tabindex", "0");
+ if (c || u.push(v), a.isEnabled()) {
+ var p = a.getActiveNode();
+ p && p.container == v ? a.focusNode(p) : v.setAttribute("tabindex", "0");
} else
- u.setAttribute("tabindex", "0");
- return u;
+ v.setAttribute("tabindex", "0");
+ return v;
};
}
if (_.destroyCalendar) {
- var v = _.destroyCalendar;
- _.destroyCalendar = function(u, f) {
- u = u || (_._def_count ? _._def_count.firstChild : null);
- var c = v.apply(this, arguments);
- if (!u || !u.parentNode)
- for (var p = _.$keyboardNavigation._minicalendars, m = 0; m < p.length; m++)
- p[m] == u && (_.eventRemove(p[m], "focus", o), p.splice(m, 1), m--);
+ var m = _.destroyCalendar;
+ _.destroyCalendar = function(v, u) {
+ v = v || (_._def_count ? _._def_count.firstChild : null);
+ var c = m.apply(this, arguments);
+ if (!v || !v.parentNode)
+ for (var f = _.$keyboardNavigation._minicalendars, p = 0; p < f.length; p++)
+ f[p] == v && (_.eventRemove(f[p], "focus", o), f.splice(p, 1), p--);
return c;
};
}
@@ -8145,10 +8162,10 @@ const gn = { active_links: function(e) {
}, e._render_v_bar = function(t, r, d, n, s, _, a, o, l) {
var h = t.id;
a.indexOf("
', v.innerHTML = k, v.style.zIndex = 100, v.firstChild;
+ var m = document.createElement("div"), v = "dhx_cal_event", u = e.templates["event_class_" + t.layer] ? e.templates["event_class_" + t.layer](t.start_date, t.end_date, t) : e.templates.event_class(t.start_date, t.end_date, t);
+ u && (v = v + " " + u);
+ var c = e._border_box_events(), f = n - 2, p = c ? f : n - 4, g = c ? f : n - 6, y = c ? f : n - 14, x = c ? f - 2 : n - 8, b = c ? s - this.xy.event_header_height : s - 30 + 1, k = '
', m.innerHTML = k, m.style.zIndex = 100, m.firstChild;
}, e.render_event_bar = function(t) {
var r = this._els.dhx_cal_data[0], d = this._colsS[t._sday], n = this._colsS[t._eday];
n == d && (n = this._colsS[t._eday + 1]);
@@ -8166,24 +8183,24 @@ const gn = { active_links: function(e) {
var h = this._render_v_bar(t.id, r + l, _, o, a, t._text_style, e.templates.event_header(t.start_date, t.end_date, t), e.templates.event_text(t.start_date, t.end_date, t));
if (this._rendered.push(h), d.appendChild(h), l = l + parseInt(d.style.left, 10) + r, _ += this._dy_shift, h.style.zIndex = this._layers_zindex[t.layer], this._edit_id == t.id) {
h.style.zIndex = parseInt(h.style.zIndex) + 1;
- var v = h.style.zIndex;
- o = Math.max(o - 4, e.xy.editor_width), (h = document.createElement("div")).setAttribute("event_id", t.id), h.setAttribute(this.config.event_attribute, t.id), this.set_xy(h, o, a - 20, l, _ + 14), h.className = "dhx_cal_editor", h.style.zIndex = v;
- var u = document.createElement("div");
- this.set_xy(u, o - 6, a - 26), u.style.cssText += ";margin:2px 2px 2px 2px;overflow:hidden;", u.style.zIndex = v, h.appendChild(u), this._els.dhx_cal_data[0].appendChild(h), this._rendered.push(h), u.innerHTML = "
", this._editor = u.firstChild, this._editor.addEventListener("keypress", function(g) {
+ var m = h.style.zIndex;
+ o = Math.max(o - 4, e.xy.editor_width), (h = document.createElement("div")).setAttribute("event_id", t.id), h.setAttribute(this.config.event_attribute, t.id), this.set_xy(h, o, a - 20, l, _ + 14), h.className = "dhx_cal_editor", h.style.zIndex = m;
+ var v = document.createElement("div");
+ this.set_xy(v, o - 6, a - 26), v.style.cssText += ";margin:2px 2px 2px 2px;overflow:hidden;", v.style.zIndex = m, h.appendChild(v), this._els.dhx_cal_data[0].appendChild(h), this._rendered.push(h), v.innerHTML = "
", this._editor = v.firstChild, this._editor.addEventListener("keypress", function(g) {
if (g.shiftKey)
return !0;
var y = g.keyCode;
y == e.keys.edit_save && e.editStop(!0), y == e.keys.edit_cancel && e.editStop(!1);
}), this._editor.addEventListener("selectstart", function(g) {
return g.cancelBubble = !0, !0;
- }), u.firstChild.focus(), this._els.dhx_cal_data[0].scrollLeft = 0, u.firstChild.select();
+ }), v.firstChild.focus(), this._els.dhx_cal_data[0].scrollLeft = 0, v.firstChild.select();
}
if (this._select_id == t.id) {
h.style.zIndex = parseInt(h.style.zIndex) + 1;
- for (var f = this.config["icons_" + (this._edit_id == t.id ? "edit" : "select")], c = "", p = 0; p < f.length; p++)
- c += "";
- var m = this._render_v_bar(t.id, l - r + 1, _, r, 20 * f.length + 26, "", "", c, !0);
- m.style.left = l - r + 1, m.style.zIndex = h.style.zIndex, this._els.dhx_cal_data[0].appendChild(m), this._rendered.push(m);
+ for (var u = this.config["icons_" + (this._edit_id == t.id ? "edit" : "select")], c = "", f = 0; f < u.length; f++)
+ c += "";
+ var p = this._render_v_bar(t.id, l - r + 1, _, r, 20 * u.length + 26, "", "", c, !0);
+ p.style.left = l - r + 1, p.style.zIndex = h.style.zIndex, this._els.dhx_cal_data[0].appendChild(p), this._rendered.push(p);
}
}
}
@@ -8269,14 +8286,14 @@ const gn = { active_links: function(e) {
let l = e.getEvent(_);
return l && l.event_location != a.event_location && (e._eventLocationChanged = !0), !0;
}), e.attachEvent("onEventChanged", (_, a) => {
- const { start_date: o, end_date: l } = a, { min_date: h, max_date: v } = e.getState();
- return o.valueOf() < v.valueOf() && l.valueOf() > h.valueOf() && i && (e.config.map_settings.resolve_event_location && a.event_location && !e._latLngUpdate ? n(a, i) : i.updateEventMarker(a)), e._latLngUpdate = !1, !0;
+ const { start_date: o, end_date: l } = a, { min_date: h, max_date: m } = e.getState();
+ return o.valueOf() < m.valueOf() && l.valueOf() > h.valueOf() && i && (e.config.map_settings.resolve_event_location && a.event_location && !e._latLngUpdate ? n(a, i) : i.updateEventMarker(a)), e._latLngUpdate = !1, !0;
}), e.attachEvent("onEventIdChange", function(_, a) {
let o = e.getEvent(a);
i == null || i.removeEventMarker(_), i == null || i.addEventMarker(o);
}), e.attachEvent("onEventAdded", (_, a) => {
- const { start_date: o, end_date: l } = a, { min_date: h, max_date: v } = e.getState();
- o.valueOf() < v.valueOf() && l.valueOf() > h.valueOf() && i && (e.config.map_settings.resolve_event_location && a.event_location && e._eventLocationChanged ? (n(a, i), e._eventLocationChanged = !1) : (i.addEventMarker(a), i.onEventClick(a)));
+ const { start_date: o, end_date: l } = a, { min_date: h, max_date: m } = e.getState();
+ o.valueOf() < m.valueOf() && l.valueOf() > h.valueOf() && i && (e.config.map_settings.resolve_event_location && a.event_location && e._eventLocationChanged ? (n(a, i), e._eventLocationChanged = !1) : (i.addEventMarker(a), i.onEventClick(a)));
}), e.attachEvent("onClick", function(_, a) {
const o = e.getEvent(_);
return i && o && i.onEventClick(o), !1;
@@ -8320,51 +8337,51 @@ const gn = { active_links: function(e) {
const _ = e.render_data;
function a() {
let l = e.get_visible_events();
- l.sort(function(f, c) {
- return f.start_date.valueOf() == c.start_date.valueOf() ? f.id > c.id ? 1 : -1 : f.start_date > c.start_date ? 1 : -1;
+ l.sort(function(u, c) {
+ return u.start_date.valueOf() == c.start_date.valueOf() ? u.id > c.id ? 1 : -1 : u.start_date > c.start_date ? 1 : -1;
});
let h = "
";
- for (let f = 0; f < l.length; f++) {
- let c = l[f], p = c.id == e._selected_event_id ? "dhx_map_line highlight" : "dhx_map_line", m = c.color ? "--dhx-scheduler-event-background:" + c.color + ";" : "", g = c.textColor ? "--dhx-scheduler-event-color:" + c.textColor + ";" : "", y = e._waiAria.mapRowAttrString(c), x = e._waiAria.mapDetailsBtnString();
- h += "
" + e.templates.map_time(c.start_date, c.end_date, c) + "
", h += `
+ for (let u = 0; u < l.length; u++) {
+ let c = l[u], f = c.id == e._selected_event_id ? "dhx_map_line highlight" : "dhx_map_line", p = c.color ? "--dhx-scheduler-event-background:" + c.color + ";" : "", g = c.textColor ? "--dhx-scheduler-event-color:" + c.textColor + ";" : "", y = e._waiAria.mapRowAttrString(c), x = e._waiAria.mapDetailsBtnString();
+ h += "" + e.templates.map_time(c.start_date, c.end_date, c) + "
", h += `
`, h += "
" + e.templates.map_text(c.start_date, c.end_date, c) + "
";
}
h += "
", e._els.dhx_cal_data[0].scrollTop = 0, e._els.dhx_cal_data[0].innerHTML = h;
- let v = e._els.dhx_cal_data[0].firstChild.childNodes, u = e._getNavDateElement();
- u && (u.innerHTML = e.templates[e._mode + "_date"](e._min_date, e._max_date, e._mode)), e._rendered = [];
- for (let f = 0; f < v.length - 2; f++)
- e._rendered[f] = v[f];
+ let m = e._els.dhx_cal_data[0].firstChild.childNodes, v = e._getNavDateElement();
+ v && (v.innerHTML = e.templates[e._mode + "_date"](e._min_date, e._max_date, e._mode)), e._rendered = [];
+ for (let u = 0; u < m.length - 2; u++)
+ e._rendered[u] = m[u];
}
e.render_data = function(l, h) {
if (this._mode != "map")
return _.apply(this, arguments);
{
a();
- let v = e.get_visible_events();
- i && (i.clearEventMarkers(), v.forEach((u) => i == null ? void 0 : i.addEventMarker(u)));
+ let m = e.get_visible_events();
+ i && (i.clearEventMarkers(), m.forEach((v) => i == null ? void 0 : i.addEventMarker(v)));
}
}, e.map_view = function(l) {
- e._els.dhx_cal_data[0].style.width = e.xy.map_date_width + e.xy.map_description_width + 1 + "px", e._min_date = e.config.map_start || e._currentDate(), e._max_date = e.config.map_end || e.date.add(e._currentDate(), 1, "year"), e._table_view = !0, function(f) {
- if (f) {
+ e._els.dhx_cal_data[0].style.width = e.xy.map_date_width + e.xy.map_description_width + 1 + "px", e._min_date = e.config.map_start || e._currentDate(), e._max_date = e.config.map_end || e.date.add(e._currentDate(), 1, "year"), e._table_view = !0, function(u) {
+ if (u) {
const c = e.locale.labels;
e._els.dhx_cal_header[0].innerHTML = "
" + c.date + "
" + c.description + "
", e._table_view = !0, e.set_sizes();
}
}(l);
let h = document.getElementById("mapContainer");
- var v, u;
- (function(f) {
- let c = document.getElementById(f);
+ var m, v;
+ (function(u) {
+ let c = document.getElementById(u);
if (c) {
- const p = e.$container.querySelector(".dhx_cal_navline").offsetHeight;
- let m = e.$container.querySelector(".dhx_cal_data").offsetHeight + e.$container.querySelector(".dhx_cal_header").offsetHeight;
- m < 0 && (m = 0);
+ const f = e.$container.querySelector(".dhx_cal_navline").offsetHeight;
+ let p = e.$container.querySelector(".dhx_cal_data").offsetHeight + e.$container.querySelector(".dhx_cal_header").offsetHeight;
+ p < 0 && (p = 0);
let g = e._x - e.xy.map_date_width - e.xy.map_description_width - 1;
- g < 0 && (g = 0), c.style.height = m + "px", c.style.width = g + "px", c.style.position = "absolute", c.style.top = p + "px", e.config.rtl ? c.style.marginRight = e.xy.map_date_width + e.xy.map_description_width + 1 + "px" : c.style.marginLeft = e.xy.map_date_width + e.xy.map_description_width + 1 + "px", c.style.marginTop = e.xy.nav_height + 2 + "px";
+ g < 0 && (g = 0), c.style.height = p + "px", c.style.width = g + "px", c.style.position = "absolute", c.style.top = f + "px", e.config.rtl ? c.style.marginRight = e.xy.map_date_width + e.xy.map_description_width + 1 + "px" : c.style.marginLeft = e.xy.map_date_width + e.xy.map_description_width + 1 + "px", c.style.marginTop = e.xy.nav_height + 2 + "px";
}
- })("mapContainer"), l && h ? (s.style.display = "block", a(), e.config.map_view_provider == e.ext.mapView.currentAdapter ? (i == null || i.destroy(h), d(e), i == null || i.initialize(h, e.config.map_settings)) : (i == null || i.destroy(h), d(e), i == null || i.initialize(h, e.config.map_settings), e.ext.mapView.currentAdapter = e.config.map_view_provider), i && (v = e.config.map_settings, u = i, v.resolve_user_location ? navigator.geolocation && navigator.geolocation.getCurrentPosition(function(f) {
- u.setView(f.coords.latitude, f.coords.longitude, v.zoom_after_resolve || v.initial_zoom);
- }) : u.setView(v.initial_position.lat, v.initial_position.lng, v.initial_zoom))) : (s.style.display = "none", e._els.dhx_cal_data[0].style.width = "100%", i && h && (i.destroy(h), i = null, e.ext.mapView.currentAdapter = e.config.map_view_provider), t.forEach((f) => e.detachEvent(f)), t = []);
+ })("mapContainer"), l && h ? (s.style.display = "block", a(), e.config.map_view_provider == e.ext.mapView.currentAdapter ? (i == null || i.destroy(h), d(e), i == null || i.initialize(h, e.config.map_settings)) : (i == null || i.destroy(h), d(e), i == null || i.initialize(h, e.config.map_settings), e.ext.mapView.currentAdapter = e.config.map_view_provider), i && (m = e.config.map_settings, v = i, m.resolve_user_location ? navigator.geolocation && navigator.geolocation.getCurrentPosition(function(u) {
+ v.setView(u.coords.latitude, u.coords.longitude, m.zoom_after_resolve || m.initial_zoom);
+ }) : v.setView(m.initial_position.lat, m.initial_position.lng, m.initial_zoom))) : (s.style.display = "none", e._els.dhx_cal_data[0].style.width = "100%", i && h && (i.destroy(h), i = null, e.ext.mapView.currentAdapter = e.config.map_view_provider), t.forEach((u) => e.detachEvent(u)), t = []);
}, e.attachEvent("onLocationError", function(l) {
return alert("Location can't be found"), google.maps.LatLng(51.47784, -1492e-6);
});
@@ -8375,13 +8392,13 @@ const gn = { active_links: function(e) {
}
};
e._event_resolve_delay = 1500, e.attachEvent("onEventLoading", function(l) {
- return l.lat && l.lng && (l.lat = +l.lat, l.lng = +l.lng), e.config.map_settings.resolve_event_location && l.event_location && !l.lat && !l.lng && (e._event_resolve_delay += 1500, function(h, v, u, f) {
+ return l.lat && l.lng && (l.lat = +l.lat, l.lng = +l.lng), e.config.map_settings.resolve_event_location && l.event_location && !l.lat && !l.lng && (e._event_resolve_delay += 1500, function(h, m, v, u) {
setTimeout(function() {
if (e.$destroyed)
return !0;
- let c = h.apply(v, u);
- return h = v = u = null, c;
- }, f || 1);
+ let c = h.apply(m, v);
+ return h = m = v = null, c;
+ }, u || 1);
}(o, this, [l], e._event_resolve_delay)), !0;
});
});
@@ -8406,11 +8423,11 @@ const gn = { active_links: function(e) {
}).bind(n)));
}
if (e.config.minicalendar.mark_events)
- for (var l = e.date.month_start(s), h = e.date.add(l, 1, "month"), v = this.getEvents(l, h), u = this["filter_" + this._mode], f = {}, c = 0; c < v.length; c++) {
- var p = v[c];
- if (!u || u(p.id, p)) {
- var m = p.start_date;
- for (m.valueOf() < l.valueOf() && (m = l), m = e.date.date_part(new Date(m.valueOf())); m < p.end_date && (f[+m] || (f[+m] = !0, this.markCalendar(n, m, "dhx_year_event")), !((m = this.date.add(m, 1, "day")).valueOf() >= h.valueOf())); )
+ for (var l = e.date.month_start(s), h = e.date.add(l, 1, "month"), m = this.getEvents(l, h), v = this["filter_" + this._mode], u = {}, c = 0; c < m.length; c++) {
+ var f = m[c];
+ if (!v || v(f.id, f)) {
+ var p = f.start_date;
+ for (p.valueOf() < l.valueOf() && (p = l), p = e.date.date_part(new Date(p.valueOf())); p < f.end_date && (u[+p] || (u[+p] = !0, this.markCalendar(n, p, "dhx_year_event")), !((p = this.date.add(p, 1, "day")).valueOf() >= h.valueOf())); )
;
}
}
@@ -8450,16 +8467,16 @@ const gn = { active_links: function(e) {
this._mode = "calendar";
var o = this._colsS;
this._colsS = { height: 0 };
- var l = new Date(this._min_date), h = new Date(this._max_date), v = new Date(e._date), u = s.month_day, f = this._ignores_detected;
+ var l = new Date(this._min_date), h = new Date(this._max_date), m = new Date(e._date), v = s.month_day, u = this._ignores_detected;
this._ignores_detected = 0, s.month_day = s.calendar_date, r = this.date.month_start(r);
- var c, p = this._week_template(t.offsetWidth - 1 - this.config.minicalendar.padding);
- n ? c = n : (c = document.createElement("div")).className = "dhx_cal_container dhx_mini_calendar", c.setAttribute("date", this._helpers.formatDate(r)), c.innerHTML = "
" : "'>") + "
" + (p ? p.innerHTML : "") + "
";
- var m = c.querySelector(".dhx_year_month"), g = c.querySelector(".dhx_year_week"), y = c.querySelector(".dhx_year_body");
- if (m.innerHTML = this.templates.calendar_month(r), d.navigation)
+ var c, f = this._week_template(t.offsetWidth - 1 - this.config.minicalendar.padding);
+ n ? c = n : (c = document.createElement("div")).className = "dhx_cal_container dhx_mini_calendar", c.setAttribute("date", this._helpers.formatDate(r)), c.innerHTML = "
" : "'>") + "
" + (f ? f.innerHTML : "") + "
";
+ var p = c.querySelector(".dhx_year_month"), g = c.querySelector(".dhx_year_week"), y = c.querySelector(".dhx_year_body");
+ if (p.innerHTML = this.templates.calendar_month(r), d.navigation)
for (var x = function(z, W) {
var Y = e.date.add(z._date, W, "month");
e.updateCalendar(z, Y), e._date.getMonth() == z._date.getMonth() && e._date.getFullYear() == z._date.getFullYear() && e._markCalendarCurrentDate(z);
- }, b = ["dhx_cal_prev_button", "dhx_cal_next_button"], k = ["left:1px;top:4px;position:absolute;", "left:auto; right:1px;top:4px;position:absolute;"], E = [-1, 1], D = function(z) {
+ }, b = ["dhx_cal_prev_button", "dhx_cal_next_button"], k = ["left:1px;top:4px;position:absolute;", "left:auto; right:1px;top:4px;position:absolute;"], w = [-1, 1], D = function(z) {
return function() {
if (d.sync)
for (var W = e._synced_minicalendars, Y = 0; Y < W.length; Y++)
@@ -8467,21 +8484,21 @@ const gn = { active_links: function(e) {
else
e.config.rtl && (z = -z), x(c, z);
};
- }, w = [e.locale.labels.prev, e.locale.labels.next], S = 0; S < 2; S++) {
+ }, E = [e.locale.labels.prev, e.locale.labels.next], S = 0; S < 2; S++) {
var N = document.createElement("div");
- N.className = b[S], e._waiAria.headerButtonsAttributes(N, w[S]), N.style.cssText = k[S], N.innerHTML = this._mini_cal_arrows[S], m.appendChild(N), i.attach(N, "click", D(E[S]));
+ N.className = b[S], e._waiAria.headerButtonsAttributes(N, E[S]), N.style.cssText = k[S], N.innerHTML = this._mini_cal_arrows[S], p.appendChild(N), i.attach(N, "click", D(w[S]));
}
c._date = new Date(r), c.week_start = (r.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;
var M = c._min_date = this.date.week_start(r);
c._max_date = this.date.add(c._min_date, 6, "week"), this._reset_month_scale(y, r, M, 6), n || t.appendChild(c), g.style.height = g.childNodes[0].offsetHeight - 1 + "px";
- var A = e.uid();
- e._waiAria.minicalHeader(m, A), e._waiAria.minicalGrid(c.querySelector(".dhx_year_grid"), A), e._waiAria.minicalRow(g);
- for (var T = g.querySelectorAll(".dhx_scale_bar"), H = 0; H < T.length; H++)
- e._waiAria.minicalHeadCell(T[H]);
+ var T = e.uid();
+ e._waiAria.minicalHeader(p, T), e._waiAria.minicalGrid(c.querySelector(".dhx_year_grid"), T), e._waiAria.minicalRow(g);
+ for (var A = g.querySelectorAll(".dhx_scale_bar"), H = 0; H < A.length; H++)
+ e._waiAria.minicalHeadCell(A[H]);
var $ = y.querySelectorAll(".dhx_cal_month_cell"), j = new Date(M);
for (H = 0; H < $.length; H++)
e._waiAria.minicalDayCell($[H], new Date(j)), j = e.date.add(j, 1, "day");
- return e._waiAria.minicalHeader(m, A), this._cols = _, this._mode = a, this._colsS = o, this._min_date = l, this._max_date = h, e._date = v, s.month_day = u, this._ignores_detected = f, c;
+ return e._waiAria.minicalHeader(p, T), this._cols = _, this._mode = a, this._colsS = o, this._min_date = l, this._max_date = h, e._date = m, s.month_day = v, this._ignores_detected = u, c;
}, e.destroyCalendar = function(t, r) {
!t && this._def_count && this._def_count.firstChild && (r || (/* @__PURE__ */ new Date()).valueOf() - this._def_count._created.valueOf() > 500) && (t = this._def_count.firstChild), t && (i.detachAll(), t.innerHTML = "", t.parentNode && t.parentNode.removeChild(t), this._def_count && (this._def_count.style.top = "-1000px"), t.conf && t.conf._on_xle_handler && e.detachEvent(t.conf._on_xle_handler));
}, e.isCalendarVisible = function() {
@@ -8497,10 +8514,10 @@ const gn = { active_links: function(e) {
r += "
" + this.templates.time_picker(n) + " ", t._time_values.push(a), n = this.date.add(n, this.config.time_step, "minute");
return "
" + (r += "") + " – " + r + "
";
}, set_value: function(t, r, d, n) {
- var s, _, a = t.getElementsByTagName("input"), o = t.getElementsByTagName("select"), l = function(m, g, y) {
- e.event(m, "click", function() {
- e.destroyCalendar(null, !0), e.renderCalendar({ position: m, date: new Date(this._date), navigation: !0, handler: function(x) {
- m.value = e.templates.calendar_time(x), m._date = new Date(x), e.destroyCalendar(), e.config.event_duration && e.config.auto_end_date && y === 0 && f();
+ var s, _, a = t.getElementsByTagName("input"), o = t.getElementsByTagName("select"), l = function(p, g, y) {
+ e.event(p, "click", function() {
+ e.destroyCalendar(null, !0), e.renderCalendar({ position: p, date: new Date(this._date), navigation: !0, handler: function(x) {
+ p.value = e.templates.calendar_time(x), p._date = new Date(x), e.destroyCalendar(), e.config.event_duration && e.config.auto_end_date && y === 0 && u();
} });
});
};
@@ -8509,38 +8526,39 @@ const gn = { active_links: function(e) {
var h = "
" + e.locale.labels.full_day + " ";
e.config.wide_form || (h = t.previousSibling.innerHTML + h), t.previousSibling.innerHTML = h, t._full_day = !0;
}
- var v = t.previousSibling.getElementsByTagName("input")[0], u = e.date.time_part(d.start_date) === 0 && e.date.time_part(d.end_date) === 0;
- v.checked = u, o[0].disabled = v.checked, o[1].disabled = v.checked, v.$_eventAttached || (v.$_eventAttached = !0, e.event(v, "click", function() {
- if (v.checked === !0) {
- var m = {};
- e.form_blocks.calendar_time.get_value(t, m), s = e.date.date_part(m.start_date), (+(_ = e.date.date_part(m.end_date)) == +s || +_ >= +s && (d.end_date.getHours() !== 0 || d.end_date.getMinutes() !== 0)) && (_ = e.date.add(_, 1, "day"));
- }
+ var m = t.previousSibling.getElementsByTagName("input")[0], v = e.date.time_part(d.start_date) === 0 && e.date.time_part(d.end_date) === 0;
+ m.checked = v, o[0].disabled = m.checked, o[1].disabled = m.checked, m.$_eventAttached || (m.$_eventAttached = !0, e.event(m, "click", function() {
+ if (m.checked === !0) {
+ var p = {};
+ e.form_blocks.calendar_time.get_value(t, p), s = e.date.date_part(p.start_date), (+(_ = e.date.date_part(p.end_date)) == +s || +_ >= +s && (d.end_date.getHours() !== 0 || d.end_date.getMinutes() !== 0)) && (_ = e.date.add(_, 1, "day"));
+ } else
+ s = null, _ = null;
var g = s || d.start_date, y = _ || d.end_date;
- c(a[0], g), c(a[1], y), o[0].value = 60 * g.getHours() + g.getMinutes(), o[1].value = 60 * y.getHours() + y.getMinutes(), o[0].disabled = v.checked, o[1].disabled = v.checked;
+ c(a[0], g), c(a[1], y), o[0].value = 60 * g.getHours() + g.getMinutes(), o[1].value = 60 * y.getHours() + y.getMinutes(), o[0].disabled = m.checked, o[1].disabled = m.checked;
}));
}
if (e.config.event_duration && e.config.auto_end_date) {
- var f = function() {
+ var u = function() {
e.config.auto_end_date && e.config.event_duration && (s = e.date.add(a[0]._date, o[0].value, "minute"), _ = new Date(s.getTime() + 60 * e.config.event_duration * 1e3), a[1].value = e.templates.calendar_time(_), a[1]._date = e.date.date_part(new Date(_)), o[1].value = 60 * _.getHours() + _.getMinutes());
};
- o[0].$_eventAttached || o[0].addEventListener("change", f);
+ o[0].$_eventAttached || o[0].addEventListener("change", u);
}
- function c(m, g, y) {
- l(m, g, y), m.value = e.templates.calendar_time(g), m._date = e.date.date_part(new Date(g));
+ function c(p, g, y) {
+ l(p, g, y), p.value = e.templates.calendar_time(g), p._date = e.date.date_part(new Date(g));
}
- function p(m) {
- for (var g = n._time_values, y = 60 * m.getHours() + m.getMinutes(), x = y, b = !1, k = 0; k < g.length; k++) {
- var E = g[k];
- if (E === y) {
+ function f(p) {
+ for (var g = n._time_values, y = 60 * p.getHours() + p.getMinutes(), x = y, b = !1, k = 0; k < g.length; k++) {
+ var w = g[k];
+ if (w === y) {
b = !0;
break;
}
- E < y && (x = E);
+ w < y && (x = w);
}
return b || x ? b ? y : x : -1;
}
c(a[0], d.start_date, 0), c(a[1], d.end_date, 1), l = function() {
- }, o[0].value = p(d.start_date), o[1].value = p(d.end_date);
+ }, o[0].value = f(d.start_date), o[1].value = f(d.end_date);
}, get_value: function(t, r) {
var d = t.getElementsByTagName("input"), n = t.getElementsByTagName("select");
return r.start_date = e.date.add(d[0]._date, n[0].value, "minute"), r.end_date = e.date.add(d[1]._date, n[1].value, "minute"), r.end_date <= r.start_date && (r.end_date = e.date.add(r.start_date, e.config.time_step, "minute")), { start_date: new Date(r.start_date), end_date: new Date(r.end_date) };
@@ -8589,9 +8607,9 @@ const gn = { active_links: function(e) {
}, set_value: function(i, t, r, d) {
for (var n = i.getElementsByTagName("input"), s = 0; s < n.length; s++)
n[s].checked = !1;
- function _(v) {
- for (var u = i.getElementsByTagName("input"), f = 0; f < u.length; f++)
- u[f].checked = !!v[u[f].value];
+ function _(m) {
+ for (var v = i.getElementsByTagName("input"), u = 0; u < v.length; u++)
+ v[u].checked = !!m[v[u].value];
}
var a = {};
if (r[d.map_to]) {
@@ -8605,23 +8623,23 @@ const gn = { active_links: function(e) {
var l = document.createElement("div");
l.className = "dhx_loading", l.style.cssText = "position: absolute; top: 40%; left: 40%;", i.appendChild(l);
var h = [d.script_url, d.script_url.indexOf("?") == -1 ? "?" : "&", "dhx_crosslink_" + d.map_to + "=" + r.id + "&uid=" + e.uid()].join("");
- e.ajax.get(h, function(v) {
- var u = function(f, c) {
+ e.ajax.get(h, function(m) {
+ var v = function(u, c) {
try {
- for (var p = JSON.parse(f.xmlDoc.responseText), m = {}, g = 0; g < p.length; g++) {
- var y = p[g];
- m[y.value || y.key || y.id] = !0;
+ for (var f = JSON.parse(u.xmlDoc.responseText), p = {}, g = 0; g < f.length; g++) {
+ var y = f[g];
+ p[y.value || y.key || y.id] = !0;
}
- return m;
+ return p;
} catch {
return null;
}
- }(v);
- u || (u = function(f, c) {
- for (var p = e.ajax.xpath("//data/item", f.xmlDoc), m = {}, g = 0; g < p.length; g++)
- m[p[g].getAttribute(c.map_to)] = !0;
- return m;
- }(v, d)), _(u), i.removeChild(l);
+ }(m);
+ v || (v = function(u, c) {
+ for (var f = e.ajax.xpath("//data/item", u.xmlDoc), p = {}, g = 0; g < f.length; g++)
+ p[f[g].getAttribute(c.map_to)] = !0;
+ return p;
+ }(m, d)), _(v), i.removeChild(l);
});
}
}, get_value: function(i, t, r) {
@@ -8659,15 +8677,15 @@ const gn = { active_links: function(e) {
}
e.backbone = function(s, _) {
_ && (t = _), s.bind("change", function(l, h) {
- var v = n(l), u = e._events[v] = l.toJSON();
- u.id = v, e._init_event(u), clearTimeout(i), i = setTimeout(function() {
+ var m = n(l), v = e._events[m] = l.toJSON();
+ v.id = m, e._init_event(v), clearTimeout(i), i = setTimeout(function() {
if (e.$destroyed)
return !0;
e.updateView();
}, 1);
}), s.bind("remove", function(l, h) {
- var v = n(l);
- e._events[v] && e.deleteEvent(v);
+ var m = n(l);
+ e._events[m] && e.deleteEvent(m);
});
var a = [];
function o() {
@@ -8676,10 +8694,10 @@ const gn = { active_links: function(e) {
a.length && (e.parse(a, "json"), a = []);
}
s.bind("add", function(l, h) {
- var v = n(l);
- if (!e._events[v]) {
- var u = l.toJSON();
- u.id = v, e._init_event(u), a.push(u), a.length == 1 && setTimeout(o, 1);
+ var m = n(l);
+ if (!e._events[m]) {
+ var v = l.toJSON();
+ v.id = m, e._init_event(v), a.push(v), a.length == 1 && setTimeout(o, 1);
}
}), s.bind("request", function(l) {
var h;
@@ -8693,13 +8711,13 @@ const gn = { active_links: function(e) {
return e._events[l] = h.toJSON(), e._events[l].id = l, !0;
}), e.attachEvent("onEventAdded", function(l) {
if (!s.get(l)) {
- var h = r(e.getEvent(l)), v = new s.model(h), u = n(v);
- u != l && this.changeEventId(l, u), s.add(v), s.trigger("scheduler:add", v);
+ var h = r(e.getEvent(l)), m = new s.model(h), v = n(m);
+ v != l && this.changeEventId(l, v), s.add(m), s.trigger("scheduler:add", m);
}
return !0;
}), e.attachEvent("onEventChanged", function(l) {
- var h = s.get(l), v = r(e.getEvent(l));
- return h.set(v), s.trigger("scheduler:change", h), !0;
+ var h = s.get(l), m = r(e.getEvent(l));
+ return h.set(m), s.trigger("scheduler:change", h), !0;
}), e.attachEvent("onEventDeleted", function(l) {
var h = s.get(l);
return h && (s.trigger("scheduler:remove", h), s.remove(l)), !0;
@@ -8710,14 +8728,14 @@ const gn = { active_links: function(e) {
var i, t = new dhtmlDragAndDropObject(), r = t.stopDrag;
function d(n, s, _, a) {
if (!e.checkEvent("onBeforeExternalDragIn") || e.callEvent("onBeforeExternalDragIn", [n, s, _, a, i])) {
- var o = e.attachEvent("onEventCreated", function(f) {
- e.callEvent("onExternalDragIn", [f, n, i]) || (this._drag_mode = this._drag_id = null, this.deleteEvent(f));
+ var o = e.attachEvent("onEventCreated", function(u) {
+ e.callEvent("onExternalDragIn", [u, n, i]) || (this._drag_mode = this._drag_id = null, this.deleteEvent(u));
}), l = e.getActionData(i), h = { start_date: new Date(l.date) };
if (e.matrix && e.matrix[e._mode]) {
- var v = e.matrix[e._mode];
- h[v.y_property] = l.section;
- var u = e._locate_cell_timeline(i);
- h.start_date = v._trace_x[u.x], h.end_date = e.date.add(h.start_date, v.x_step, v.x_unit);
+ var m = e.matrix[e._mode];
+ h[m.y_property] = l.section;
+ var v = e._locate_cell_timeline(i);
+ h.start_date = m._trace_x[v.x], h.end_date = e.date.add(h.start_date, m.x_step, m.x_unit);
}
e._props && e._props[e._mode] && (h[e._props[e._mode].map_to] = l.section), e.addEventNow(h), e.detachEvent(o);
}
@@ -8745,22 +8763,22 @@ const gn = { active_links: function(e) {
}
function s(b, k) {
b = parseFloat(b), k = parseFloat(k), isNaN(k) || (b -= k);
- var E = a(b);
- return b = b - E.width + E.cols * i, isNaN(b) ? "auto" : 100 * b / i;
+ var w = a(b);
+ return b = b - w.width + w.cols * i, isNaN(b) ? "auto" : 100 * b / i;
}
- function _(b, k, E) {
- b = parseFloat(b), k = parseFloat(k), !isNaN(k) && E && (b -= k);
+ function _(b, k, w) {
+ b = parseFloat(b), k = parseFloat(k), !isNaN(k) && w && (b -= k);
var D = a(b);
return b = b - D.width + D.cols * i, isNaN(b) ? "auto" : 100 * b / (i - (isNaN(k) ? 0 : k));
}
function a(b) {
- for (var k = 0, E = e._els.dhx_cal_header[0].childNodes, D = E[1] ? E[1].childNodes : E[0].childNodes, w = 0; w < D.length; w++) {
- var S = D[w].style ? D[w] : D[w].parentNode, N = parseFloat(S.style.width);
+ for (var k = 0, w = e._els.dhx_cal_header[0].childNodes, D = w[1] ? w[1].childNodes : w[0].childNodes, E = 0; E < D.length; E++) {
+ var S = D[E].style ? D[E] : D[E].parentNode, N = parseFloat(S.style.width);
if (!(b > N))
break;
b -= N + 1, k += N + 1;
}
- return { width: k, cols: w };
+ return { width: k, cols: E };
}
function o(b) {
return b = parseFloat(b), isNaN(b) ? "auto" : 100 * b / t;
@@ -8769,161 +8787,161 @@ const gn = { active_links: function(e) {
return (window.getComputedStyle ? window.getComputedStyle(b, null)[k] : b.currentStyle ? b.currentStyle[k] : null) || "";
}
function h(b, k) {
- for (var E = parseInt(b.style.left, 10), D = 0; D < e._cols.length; D++)
- if ((E -= e._cols[D]) < 0)
+ for (var w = parseInt(b.style.left, 10), D = 0; D < e._cols.length; D++)
+ if ((w -= e._cols[D]) < 0)
return D;
return k;
}
- function v(b, k) {
- for (var E = parseInt(b.style.top, 10), D = 0; D < e._colsS.heights.length; D++)
- if (e._colsS.heights[D] > E)
+ function m(b, k) {
+ for (var w = parseInt(b.style.top, 10), D = 0; D < e._colsS.heights.length; D++)
+ if (e._colsS.heights[D] > w)
return D;
return k;
}
- function u(b) {
+ function v(b) {
return b ? "" + b + ">" : "";
}
- function f(b, k, E, D) {
- var w = "<" + b + " profile='" + k + "'";
- return E && (w += " header='" + E + "'"), D && (w += " footer='" + D + "'"), w += ">";
+ function u(b, k, w, D) {
+ var E = "<" + b + " profile='" + k + "'";
+ return w && (E += " header='" + w + "'"), D && (E += " footer='" + D + "'"), E += ">";
}
function c() {
var b = "", k = e._mode;
if (e.matrix && e.matrix[e._mode] && (k = e.matrix[e._mode].render == "cell" ? "matrix" : "timeline"), b += "
", e._mode == "week_agenda")
- for (var E = e._els.dhx_cal_data[0].getElementsByTagName("DIV"), D = 0; D < E.length; D++)
- E[D].className == "dhx_wa_scale_bar" && (b += "" + n(E[D].innerHTML) + " ");
+ for (var w = e._els.dhx_cal_data[0].getElementsByTagName("DIV"), D = 0; D < w.length; D++)
+ w[D].className == "dhx_wa_scale_bar" && (b += "" + n(w[D].innerHTML) + " ");
else if (e._mode == "agenda" || e._mode == "map")
- b += "" + n((E = e._els.dhx_cal_header[0].childNodes[0].childNodes)[0].innerHTML) + " " + n(E[1].innerHTML) + " ";
+ b += "" + n((w = e._els.dhx_cal_header[0].childNodes[0].childNodes)[0].innerHTML) + " " + n(w[1].innerHTML) + " ";
else if (e._mode == "year")
- for (E = e._els.dhx_cal_data[0].childNodes, D = 0; D < E.length; D++)
- b += "", b += m(E[D].querySelector(".dhx_year_week").childNodes), b += p(E[D].querySelector(".dhx_year_body")), b += " ";
+ for (w = e._els.dhx_cal_data[0].childNodes, D = 0; D < w.length; D++)
+ b += "", b += p(w[D].querySelector(".dhx_year_week").childNodes), b += f(w[D].querySelector(".dhx_year_body")), b += " ";
else {
- b += "", b += m(E = e._els.dhx_cal_header[0].childNodes), b += " ";
- var w = e._els.dhx_cal_data[0];
+ b += "", b += p(w = e._els.dhx_cal_header[0].childNodes), b += " ";
+ var E = e._els.dhx_cal_data[0];
if (e.matrix && e.matrix[e._mode]) {
- for (b += "", D = 0; D < w.firstChild.rows.length; D++)
- b += "
";
- b += " ", t = w.firstChild.rows[0].cells[0].offsetHeight;
- } else if (w.firstChild.tagName == "TABLE")
- b += p(w);
+ for (b += "", D = 0; D < E.firstChild.rows.length; D++)
+ b += "
";
+ b += " ", t = E.firstChild.rows[0].cells[0].offsetHeight;
+ } else if (E.firstChild.tagName == "TABLE")
+ b += f(E);
else {
- for (w = w.childNodes[w.childNodes.length - 1]; w.className.indexOf("dhx_scale_holder") == -1; )
- w = w.previousSibling;
- for (w = w.childNodes, b += "", D = 0; D < w.length; D++)
+ for (E = E.childNodes[E.childNodes.length - 1]; E.className.indexOf("dhx_scale_holder") == -1; )
+ E = E.previousSibling;
+ for (E = E.childNodes, b += "", D = 0; D < E.length; D++)
b += `
-
";
- b += " ", t = w[0].offsetHeight;
+
";
+ b += " ", t = E[0].offsetHeight;
}
}
return b += " ";
}
- function p(b) {
- for (var k = "", E = b.querySelectorAll("tr"), D = 0; D < E.length; D++) {
- for (var w = [], S = E[D].querySelectorAll("td"), N = 0; N < S.length; N++)
- w.push(S[N].querySelector(".dhx_month_head").innerHTML);
+ function f(b) {
+ for (var k = "", w = b.querySelectorAll("tr"), D = 0; D < w.length; D++) {
+ for (var E = [], S = w[D].querySelectorAll("td"), N = 0; N < S.length; N++)
+ E.push(S[N].querySelector(".dhx_month_head").innerHTML);
k += `
-
|
", t = S[0].offsetHeight;
+
|
", t = S[0].offsetHeight;
}
return k;
}
- function m(b) {
- var k, E = "";
+ function p(b) {
+ var k, w = "";
e.matrix && e.matrix[e._mode] && (e.matrix[e._mode].second_scale && (k = b[1].childNodes), b = b[0].childNodes);
for (var D = 0; D < b.length; D++)
- E += `
+ w += `
";
if (i = b[0].offsetWidth, k) {
- var w = 0, S = b[0].offsetWidth, N = 1;
+ var E = 0, S = b[0].offsetWidth, N = 1;
for (D = 0; D < k.length; D++)
- E += `
-
", (w += k[D].offsetWidth) >= S && (S += b[N] ? b[N].offsetWidth : 0, N++), i = k[0].offsetWidth;
+ w += `
+
", (E += k[D].offsetWidth) >= S && (S += b[N] ? b[N].offsetWidth : 0, N++), i = k[0].offsetWidth;
}
- return E;
+ return w;
}
function g(b) {
- var k = "", E = e._rendered, D = e.matrix && e.matrix[e._mode];
+ var k = "", w = e._rendered, D = e.matrix && e.matrix[e._mode];
if (e._mode == "agenda" || e._mode == "map")
- for (var w = 0; w < E.length; w++)
- k += "
";
+ for (var E = 0; E < w.length; E++)
+ k += "
";
else if (e._mode == "week_agenda")
- for (w = 0; w < E.length; w++)
- k += "
" + n(E[w].innerHTML) + " ";
+ for (E = 0; E < w.length; E++)
+ k += "
" + n(w[E].innerHTML) + " ";
else if (e._mode == "year")
- for (E = e.get_visible_events(), w = 0; w < E.length; w++) {
- var S = E[w].start_date;
- for (S.valueOf() < e._min_date.valueOf() && (S = e._min_date); S < E[w].end_date; ) {
- var N = S.getMonth() + 12 * (S.getFullYear() - e._min_date.getFullYear()) - e.week_starts._month, M = e.week_starts[N] + S.getDate() - 1, A = b ? l(e._get_year_cell(S), "color") : "", T = b ? l(e._get_year_cell(S), "backgroundColor") : "";
- if (k += "
", (S = e.date.add(S, 1, "day")).valueOf() >= e._max_date.valueOf())
+ for (w = e.get_visible_events(), E = 0; E < w.length; E++) {
+ var S = w[E].start_date;
+ for (S.valueOf() < e._min_date.valueOf() && (S = e._min_date); S < w[E].end_date; ) {
+ var N = S.getMonth() + 12 * (S.getFullYear() - e._min_date.getFullYear()) - e.week_starts._month, M = e.week_starts[N] + S.getDate() - 1, T = b ? l(e._get_year_cell(S), "color") : "", A = b ? l(e._get_year_cell(S), "backgroundColor") : "";
+ if (k += "
", (S = e.date.add(S, 1, "day")).valueOf() >= e._max_date.valueOf())
break;
}
}
else if (D && D.render == "cell")
- for (E = e._els.dhx_cal_data[0].getElementsByTagName("TD"), w = 0; w < E.length; w++)
- A = b ? l(E[w], "color") : "", k += `
-
";
+ for (w = e._els.dhx_cal_data[0].getElementsByTagName("TD"), E = 0; E < w.length; E++)
+ T = b ? l(w[E], "color") : "", k += `
+
";
else
- for (w = 0; w < E.length; w++) {
+ for (E = 0; E < w.length; E++) {
var H, $;
if (e.matrix && e.matrix[e._mode])
- H = s(E[w].style.left), $ = s(E[w].offsetWidth) - 1;
+ H = s(w[E].style.left), $ = s(w[E].offsetWidth) - 1;
else {
var j = e.config.use_select_menu_space ? 0 : 26;
- H = _(E[w].style.left, j, !0), $ = _(E[w].style.width, j) - 1;
+ H = _(w[E].style.left, j, !0), $ = _(w[E].style.width, j) - 1;
}
if (!isNaN(1 * $)) {
- var z = o(E[w].style.top), W = o(E[w].style.height), Y = E[w].className.split(" ")[0].replace("dhx_cal_", "");
+ var z = o(w[E].style.top), W = o(w[E].style.height), Y = w[E].className.split(" ")[0].replace("dhx_cal_", "");
if (Y !== "dhx_tooltip_line") {
- var q = e.getEvent(E[w].getAttribute(e.config.event_attribute));
+ var q = e.getEvent(w[E].getAttribute(e.config.event_attribute));
if (q) {
M = q._sday;
var V = q._sweek, ve = q._length || 0;
if (e._mode == "month")
- W = parseInt(E[w].offsetHeight, 10), z = parseInt(E[w].style.top, 10) - e.xy.month_head_height, M = h(E[w], M), V = v(E[w], V);
+ W = parseInt(w[E].offsetHeight, 10), z = parseInt(w[E].style.top, 10) - e.xy.month_head_height, M = h(w[E], M), V = m(w[E], V);
else if (e.matrix && e.matrix[e._mode]) {
- M = 0, V = E[w].parentNode.parentNode.parentNode.rowIndex;
+ M = 0, V = w[E].parentNode.parentNode.parentNode.rowIndex;
var Ne = t;
- t = E[w].parentNode.offsetHeight, z = o(E[w].style.top), z -= 0.2 * z, t = Ne;
+ t = w[E].parentNode.offsetHeight, z = o(w[E].style.top), z -= 0.2 * z, t = Ne;
} else {
- if (E[w].parentNode == e._els.dhx_cal_data[0])
+ if (w[E].parentNode == e._els.dhx_cal_data[0])
continue;
var xe = e._els.dhx_cal_data[0].childNodes[0], St = parseFloat(xe.className.indexOf("dhx_scale_holder") != -1 ? xe.style.left : 0);
- H += s(E[w].parentNode.style.left, St);
+ H += s(w[E].parentNode.style.left, St);
}
k += `
-
", Y == "event" ? (k += "", A = b ? l(E[w].childNodes[2], "color") : "", k += "") : (A = b ? l(E[w], "color") : "", k += ""), k += " ";
+
", Y == "event" ? (k += "", T = b ? l(w[E].childNodes[2], "color") : "", k += "") : (T = b ? l(w[E], "color") : "", k += ""), k += " ";
}
}
}
}
return k;
}
- function y(b, k, E, D, w, S) {
+ function y(b, k, w, D, E, S) {
var N = !1;
D == "fullcolor" && (N = !0, D = "color"), D = D || "color";
- var M, A = "";
+ var M, T = "";
if (b) {
- var T = e._date, H = e._mode;
- k = e.date[E + "_start"](k), k = e.date["get_" + E + "_end"] ? e.date["get_" + E + "_end"](k) : e.date.add(k, 1, E), A = f("pages", D, w, S);
- for (var $ = new Date(b); +$ < +k; $ = this.date.add($, 1, E))
- this.setCurrentView($, E), A += ((M = "page") ? "<" + M + ">" : "") + c().replace("–", "-") + g(N) + u("page");
- A += u("pages"), this.setCurrentView(T, H);
+ var A = e._date, H = e._mode;
+ k = e.date[w + "_start"](k), k = e.date["get_" + w + "_end"] ? e.date["get_" + w + "_end"](k) : e.date.add(k, 1, w), T = u("pages", D, E, S);
+ for (var $ = new Date(b); +$ < +k; $ = this.date.add($, 1, w))
+ this.setCurrentView($, w), T += ((M = "page") ? "<" + M + ">" : "") + c().replace("–", "-") + g(N) + v("page");
+ T += v("pages"), this.setCurrentView(A, H);
} else
- A = f("data", D, w, S) + c().replace("–", "-") + g(N) + u("data");
- return A;
- }
- function x(b, k, E, D, w, S, N) {
- (function(M, A) {
- var T = e.uid(), H = document.createElement("div");
- H.style.display = "none", document.body.appendChild(H), H.innerHTML = '
', document.getElementById(T).firstChild.value = encodeURIComponent(M), document.getElementById(T).submit(), H.parentNode.removeChild(H);
- })(typeof w == "object" ? function(M) {
- for (var A = "
", T = 0; T < M.length; T++)
- A += M[T].source.getPDFData(M[T].start, M[T].end, M[T].view, M[T].mode, M[T].header, M[T].footer);
- return A += " ", A;
- }(w) : y.apply(this, [b, k, E, w, S, N]), D);
- }
- e.getPDFData = y, e.toPDF = function(b, k, E, D) {
- return x.apply(this, [null, null, null, b, k, E, D]);
- }, e.toPDFRange = function(b, k, E, D, w, S, N) {
+ T = u("data", D, E, S) + c().replace("–", "-") + g(N) + v("data");
+ return T;
+ }
+ function x(b, k, w, D, E, S, N) {
+ (function(M, T) {
+ var A = e.uid(), H = document.createElement("div");
+ H.style.display = "none", document.body.appendChild(H), H.innerHTML = '
', document.getElementById(A).firstChild.value = encodeURIComponent(M), document.getElementById(A).submit(), H.parentNode.removeChild(H);
+ })(typeof E == "object" ? function(M) {
+ for (var T = "
", A = 0; A < M.length; A++)
+ T += M[A].source.getPDFData(M[A].start, M[A].end, M[A].view, M[A].mode, M[A].header, M[A].footer);
+ return T += " ", T;
+ }(E) : y.apply(this, [b, k, w, E, S, N]), D);
+ }
+ e.getPDFData = y, e.toPDF = function(b, k, w, D) {
+ return x.apply(this, [null, null, null, b, k, w, D]);
+ }, e.toPDFRange = function(b, k, w, D, E, S, N) {
return typeof b == "string" && (b = e.templates.api_date(b), k = e.templates.api_date(k)), x.apply(this, arguments);
};
}, quick_info: function(e) {
@@ -9083,10 +9101,10 @@ const gn = { active_links: function(e) {
e.form_blocks.recurring && (i = e.form_blocks.recurring.set_value);
var t = e.config.buttons_left.slice(), r = e.config.buttons_right.slice();
function d(_, a, o, l) {
- for (var h = a.getElementsByTagName(_), v = o.getElementsByTagName(_), u = v.length - 1; u >= 0; u--)
- if (o = v[u], l) {
- var f = document.createElement("span");
- f.className = "dhx_text_disabled", f.innerHTML = l(h[u]), o.parentNode.insertBefore(f, o), o.parentNode.removeChild(o);
+ for (var h = a.getElementsByTagName(_), m = o.getElementsByTagName(_), v = m.length - 1; v >= 0; v--)
+ if (o = m[v], l) {
+ var u = document.createElement("span");
+ u.className = "dhx_text_disabled", u.innerHTML = l(h[v]), o.parentNode.insertBefore(u, o), o.parentNode.removeChild(o);
} else
o.disabled = !0, a.checked && (o.checked = !0);
}
@@ -9095,19 +9113,19 @@ const gn = { active_links: function(e) {
var a = this.config.lightbox.sections;
if (this.config.readonly_active) {
for (var o = 0; o < a.length; o++)
- a[o].type == "recurring" && this.config.readonly_active && e.form_blocks.recurring && (e.form_blocks.recurring.set_value = function(m, g, y) {
- var x = e.$domHelpers.closest(m, ".dhx_wrap_section"), b = "none";
+ a[o].type == "recurring" && this.config.readonly_active && e.form_blocks.recurring && (e.form_blocks.recurring.set_value = function(p, g, y) {
+ var x = e.$domHelpers.closest(p, ".dhx_wrap_section"), b = "none";
x.querySelector(".dhx_cal_lsection").display = b, x.querySelector(".dhx_form_repeat").display = b, x.style.display = b, e.setLightboxSize();
});
var l = ["dhx_delete_btn", "dhx_save_btn"], h = [e.config.buttons_left, e.config.buttons_right];
for (o = 0; o < l.length; o++)
- for (var v = l[o], u = 0; u < h.length; u++) {
- for (var f = h[u], c = -1, p = 0; p < f.length; p++)
- if (f[p] == v) {
- c = p;
+ for (var m = l[o], v = 0; v < h.length; v++) {
+ for (var u = h[v], c = -1, f = 0; f < u.length; f++)
+ if (u[f] == m) {
+ c = f;
break;
}
- c != -1 && f.splice(c, 1);
+ c != -1 && u.splice(c, 1);
}
}
return this.resetLightbox(), !0;
@@ -9139,106 +9157,109 @@ const gn = { active_links: function(e) {
function t(u) {
return !!u.rrule && !u.recurring_event_id;
}
- var r;
- function d() {
+ function r(u) {
+ return new Date(Date.UTC(u.getFullYear(), u.getMonth(), u.getDate(), u.getHours(), u.getMinutes(), u.getSeconds()));
+ }
+ var d;
+ function n() {
const u = {};
- for (const f in e._events) {
- const c = e._events[f];
- c.recurring_event_id && (u[c.recurring_event_id] || (u[c.recurring_event_id] = {}), u[c.recurring_event_id][c.original_start.valueOf()] = c);
+ for (const c in e._events) {
+ const f = e._events[c];
+ f.recurring_event_id && (u[f.recurring_event_id] || (u[f.recurring_event_id] = {}), u[f.recurring_event_id][f.original_start.valueOf()] = f);
}
return u;
}
- e._rec_temp = [], e._rec_markers_pull = {}, e._rec_markers = {}, e._add_rec_marker = function(u, f) {
- u._pid_time = f, this._rec_markers[u.id] = u, this._rec_markers_pull[u.event_pid] || (this._rec_markers_pull[u.event_pid] = {}), this._rec_markers_pull[u.event_pid][f] = u;
- }, e._get_rec_marker = function(u, f) {
- let c = this._rec_markers_pull[f];
- return c ? c[u] : null;
+ e._rec_temp = [], e._rec_markers_pull = {}, e._rec_markers = {}, e._add_rec_marker = function(u, c) {
+ u._pid_time = c, this._rec_markers[u.id] = u, this._rec_markers_pull[u.event_pid] || (this._rec_markers_pull[u.event_pid] = {}), this._rec_markers_pull[u.event_pid][c] = u;
+ }, e._get_rec_marker = function(u, c) {
+ let f = this._rec_markers_pull[c];
+ return f ? f[u] : null;
}, e._get_rec_markers = function(u) {
return this._rec_markers_pull[u] || [];
- }, r = e.addEvent, e.addEvent = function(u, f, c, p, m) {
- var g = r.apply(this, arguments);
- if (g && e.getEvent(g)) {
- var y = e.getEvent(g);
- y.start_date && (y.start_date = i(y.start_date)), y.end_date && (y.end_date = i(y.end_date));
+ }, d = e.addEvent, e.addEvent = function(u, c, f, p, g) {
+ var y = d.apply(this, arguments);
+ if (y && e.getEvent(y)) {
+ var x = e.getEvent(y);
+ x.start_date && (x.start_date = i(x.start_date)), x.end_date && (x.end_date = i(x.end_date));
}
- return g;
+ return y;
}, e.attachEvent("onEventLoading", function(u) {
return u.original_start && (u.original_start = e.templates.parse_date(u.original_start)), !0;
- }), e.attachEvent("onEventIdChange", function(u, f) {
+ }), e.attachEvent("onEventIdChange", function(u, c) {
if (!this._ignore_call) {
- this._ignore_call = !0, e._rec_markers[u] && (e._rec_markers[f] = e._rec_markers[u], delete e._rec_markers[u]), e._rec_markers_pull[u] && (e._rec_markers_pull[f] = e._rec_markers_pull[u], delete e._rec_markers_pull[u]);
- for (var c = 0; c < this._rec_temp.length; c++)
- (p = this._rec_temp[c]).recurring_event_id == u && (p.recurring_event_id = f, this.changeEventId(p.id, f + "#" + p.id.split("#")[1]));
- for (var c in this._rec_markers) {
+ this._ignore_call = !0, e._rec_markers[u] && (e._rec_markers[c] = e._rec_markers[u], delete e._rec_markers[u]), e._rec_markers_pull[u] && (e._rec_markers_pull[c] = e._rec_markers_pull[u], delete e._rec_markers_pull[u]);
+ for (var f = 0; f < this._rec_temp.length; f++)
+ (p = this._rec_temp[f]).recurring_event_id == u && (p.recurring_event_id = c, this.changeEventId(p.id, c + "#" + p.id.split("#")[1]));
+ for (var f in this._rec_markers) {
var p;
- (p = this._rec_markers[c]).recurring_event_id == u && (p.recurring_event_id = f, p._pid_changed = !0);
+ (p = this._rec_markers[f]).recurring_event_id == u && (p.recurring_event_id = c, p._pid_changed = !0);
}
- var m = e._rec_markers[f];
- m && m._pid_changed && (delete m._pid_changed, setTimeout(function() {
+ var g = e._rec_markers[c];
+ g && g._pid_changed && (delete g._pid_changed, setTimeout(function() {
if (e.$destroyed)
return !0;
- e.callEvent("onEventChanged", [f, e.getEvent(f)]);
+ e.callEvent("onEventChanged", [c, e.getEvent(c)]);
}, 1)), delete this._ignore_call;
}
}), e.attachEvent("onConfirmedBeforeEventDelete", function(u) {
- var f = this.getEvent(u);
- if (this._is_virtual_event(u) || this._is_modified_occurence(f) && !function(m) {
- return !!m.deleted;
- }(f))
- (function(m, g) {
- m = m.split("#");
- let y = e.uid(), x = m[1] ? m[1] : g._pid_time, b = e._copy_event(g);
- b.id = y, b.recurring_event_id = g.recurring_event_id || m[0], b.original_start = new Date(Number(x)), b.deleted = !0, e.addEvent(b);
- })(u, f);
+ var c = this.getEvent(u);
+ if (this._is_virtual_event(u) || this._is_modified_occurence(c) && !function(g) {
+ return !!g.deleted;
+ }(c))
+ (function(g, y) {
+ g = g.split("#");
+ let x = e.uid(), b = g[1] ? g[1] : y._pid_time, k = e._copy_event(y);
+ k.id = x, k.recurring_event_id = y.recurring_event_id || g[0], k.original_start = new Date(Number(b)), k.deleted = !0, e.addEvent(k);
+ })(u, c);
else {
- t(f) && this._lightbox_id && this._roll_back_dates(f);
- var c = this._get_rec_markers(u);
- for (var p in c)
- c.hasOwnProperty(p) && (u = c[p].id, this.getEvent(u) && this.deleteEvent(u, !0));
+ t(c) && this._lightbox_id && this._roll_back_dates(c);
+ var f = this._get_rec_markers(u);
+ for (var p in f)
+ f.hasOwnProperty(p) && (u = f[p].id, this.getEvent(u) && this.deleteEvent(u, !0));
}
return !0;
- }), e.attachEvent("onEventDeleted", function(u, f) {
- !this._is_virtual_event(u) && this._is_modified_occurence(f) && (e._events[u] || (f.deleted = !0, this.setEvent(u, f)));
- }), e.attachEvent("onEventChanged", function(u, f) {
+ }), e.attachEvent("onEventDeleted", function(u, c) {
+ !this._is_virtual_event(u) && this._is_modified_occurence(c) && (e._events[u] || (c.deleted = !0, this.setEvent(u, c)));
+ }), e.attachEvent("onEventChanged", function(u, c) {
if (this._loading)
return !0;
- var c = this.getEvent(u);
+ var f = this.getEvent(u);
if (this._is_virtual_event(u))
- (function(x) {
- let b = x.id.split("#"), k = e.uid();
+ (function(b) {
+ let k = b.id.split("#"), w = e.uid();
e._not_render = !0;
- let E = e._copy_event(x);
- E.id = k, E.recurring_event_id = b[0];
- let D = b[1];
- E.original_start = new Date(Number(D)), e._add_rec_marker(E, D), e.addEvent(E), e._not_render = !1;
- })(c);
+ let D = e._copy_event(b);
+ D.id = w, D.recurring_event_id = k[0];
+ let E = k[1];
+ D.original_start = new Date(Number(E)), e._add_rec_marker(D, E), e.addEvent(D), e._not_render = !1;
+ })(f);
else {
- c.start_date && (c.start_date = i(c.start_date)), c.end_date && (c.end_date = i(c.end_date)), t(c) && this._lightbox_id && this._roll_back_dates(c);
+ f.start_date && (f.start_date = i(f.start_date)), f.end_date && (f.end_date = i(f.end_date)), t(f) && this._lightbox_id && this._roll_back_dates(f);
var p = this._get_rec_markers(u);
- for (var m in p)
- p.hasOwnProperty(m) && (delete this._rec_markers[p[m].id], this.deleteEvent(p[m].id, !0));
+ for (var g in p)
+ p.hasOwnProperty(g) && (delete this._rec_markers[p[g].id], this.deleteEvent(p[g].id, !0));
delete this._rec_markers_pull[u];
- for (var g = !1, y = 0; y < this._rendered.length; y++)
- this._rendered[y].getAttribute(this.config.event_attribute) == u && (g = !0);
- g || (this._select_id = null);
+ for (var y = !1, x = 0; x < this._rendered.length; x++)
+ this._rendered[x].getAttribute(this.config.event_attribute) == u && (y = !0);
+ y || (this._select_id = null);
}
return !0;
}), e.attachEvent("onEventAdded", function(u) {
if (!this._loading) {
- var f = this.getEvent(u);
- t(f) && this._roll_back_dates(f);
+ var c = this.getEvent(u);
+ t(c) && this._roll_back_dates(c);
}
return !0;
- }), e.attachEvent("onEventSave", function(u, f, c) {
+ }), e.attachEvent("onEventSave", function(u, c, f) {
return t(this.getEvent(u)) && (this._select_id = null), !0;
}), e.attachEvent("onEventCreated", function(u) {
- var f = this.getEvent(u);
- return t(f) || function(c) {
- c.rrule = "", c.original_start = null, c.recurring_event_id = null, c.duration = null, c.deleted = null;
- }(f), !0;
+ var c = this.getEvent(u);
+ return t(c) || function(f) {
+ f.rrule = "", f.original_start = null, f.recurring_event_id = null, f.duration = null, f.deleted = null;
+ }(c), !0;
}), e.attachEvent("onEventCancel", function(u) {
- var f = this.getEvent(u);
- t(f) && (this._roll_back_dates(f), this.render_view_data());
+ var c = this.getEvent(u);
+ t(c) && (this._roll_back_dates(c), this.render_view_data());
}), e._roll_back_dates = function(u) {
u.start_date && (u.start_date = i(u.start_date)), u.end_date && (u.end_date = i(u.end_date)), u.duration = Math.round((u.end_date.valueOf() - u.start_date.valueOf()) / 1e3), u.end_date = u._end_date, u._start_date && (u.start_date.setMonth(0), u.start_date.setDate(u._start_date.getDate()), u.start_date.setMonth(u._start_date.getMonth()), u.start_date.setFullYear(u._start_date.getFullYear()));
}, e._is_virtual_event = function(u) {
@@ -9246,131 +9267,132 @@ const gn = { active_links: function(e) {
}, e._is_modified_occurence = function(u) {
return u.recurring_event_id && u.recurring_event_id != "0";
}, e.showLightbox_rec = e.showLightbox, e.showLightbox = function(u) {
- var f = this.locale, c = e.config.lightbox_recurring, p = this.getEvent(u), m = p.recurring_event_id, g = this._is_virtual_event(u);
- g && (m = u.split("#")[0]);
- var y = function(b) {
- var k = e.getEvent(b);
- return k._end_date = k.end_date, k.end_date = new Date(k.start_date.valueOf() + 1e3 * k.duration), e.showLightbox_rec(b);
+ var c = this.locale, f = e.config.lightbox_recurring, p = this.getEvent(u), g = p.recurring_event_id, y = this._is_virtual_event(u);
+ y && (g = u.split("#")[0]);
+ var x = function(k) {
+ var w = e.getEvent(k);
+ return w._end_date = w.end_date, w.end_date = new Date(w.start_date.valueOf() + 1e3 * w.duration), e.showLightbox_rec(k);
};
- if ((m || 1 * m == 0) && t(p))
- return y(u);
- if (!m || m === "0" || !f.labels.confirm_recurring || c == "instance" || c == "series" && !g)
+ if ((g || 1 * g == 0) && t(p))
+ return x(u);
+ if (!g || g === "0" || !c.labels.confirm_recurring || f == "instance" || f == "series" && !y)
return this.showLightbox_rec(u);
- if (c == "ask") {
- var x = this;
- e.modalbox({ text: f.labels.confirm_recurring, title: f.labels.title_confirm_recurring, width: "500px", position: "middle", buttons: [f.labels.button_edit_series, f.labels.button_edit_occurrence, f.labels.icon_cancel], callback: function(b) {
- switch (+b) {
+ if (f == "ask") {
+ var b = this;
+ e.modalbox({ text: c.labels.confirm_recurring, title: c.labels.title_confirm_recurring, width: "500px", position: "middle", buttons: [c.labels.button_edit_series, c.labels.button_edit_occurrence, c.labels.icon_cancel], callback: function(k) {
+ switch (+k) {
case 0:
- return y(m);
+ return x(g);
case 1:
- return x.showLightbox_rec(u);
+ return b.showLightbox_rec(u);
case 2:
return;
}
} });
} else
- y(m);
+ x(g);
}, e.get_visible_events_rec = e.get_visible_events, e.get_visible_events = function(u) {
- for (var f = 0; f < this._rec_temp.length; f++)
- delete this._events[this._rec_temp[f].id];
+ for (var c = 0; c < this._rec_temp.length; c++)
+ delete this._events[this._rec_temp[c].id];
this._rec_temp = [];
- const c = d();
- var p = this.get_visible_events_rec(u), m = [];
- for (f = 0; f < p.length; f++)
- p[f].deleted || p[f].recurring_event_id || (t(p[f]) ? this.repeat_date(p[f], m, void 0, void 0, void 0, void 0, c) : m.push(p[f]));
- return m;
+ const f = n();
+ var p = this.get_visible_events_rec(u), g = [];
+ for (c = 0; c < p.length; c++)
+ p[c].deleted || p[c].recurring_event_id || (t(p[c]) ? this.repeat_date(p[c], g, void 0, void 0, void 0, void 0, f) : g.push(p[c]));
+ return g;
}, function() {
var u = e.isOneDayEvent;
- e.isOneDayEvent = function(c) {
- return !!t(c) || u.call(this, c);
+ e.isOneDayEvent = function(f) {
+ return !!t(f) || u.call(this, f);
};
- var f = e.updateEvent;
- e.updateEvent = function(c) {
- var p = e.getEvent(c);
- p && t(p) && !this._is_virtual_event(c) ? e.update_view() : f.call(this, c);
+ var c = e.updateEvent;
+ e.updateEvent = function(f) {
+ var p = e.getEvent(f);
+ p && t(p) && !this._is_virtual_event(f) ? e.update_view() : c.call(this, f);
};
}();
- const n = e.date.date_to_str("%Y%m%dT%H%i%s");
- function s(u) {
- const f = u.getDay(), c = u.getDate();
- return { dayOfWeek: f, dayNumber: Math.ceil(c / 7) };
+ const s = e.date.date_to_str("%Y%m%dT%H%i%s");
+ function _(u) {
+ const c = u.getDay(), f = u.getDate();
+ return { dayOfWeek: c, dayNumber: Math.ceil(f / 7) };
}
- e.repeat_date = function(u, f, c, p, m, g, y) {
+ e.repeat_date = function(u, c, f, p, g, y, x) {
if (!u.rrule)
return;
- let x = y ? y[u.id] : d()[u.id];
- x || (x = {}), p || (p = e._min_date), m || (m = e._max_date);
- const b = new Date(Date.UTC(u.start_date.getFullYear(), u.start_date.getMonth(), u.start_date.getDate(), u.start_date.getHours(), u.start_date.getMinutes(), u.start_date.getSeconds()));
- let k;
- k = Se(g ? `RRULE:${u.rrule};UNTIL=${n(u.end_date)};COUNT=${g}` : `RRULE:${u.rrule};UNTIL=${n(u.end_date)}`, { dtstart: b });
- const E = new Date(Date.UTC(m.getFullYear(), m.getMonth(), m.getDate(), m.getHours(), m.getMinutes(), m.getSeconds())), D = k.between(p, E).map((N) => {
- const M = new Date(N);
+ let b = x ? x[u.id] : n()[u.id];
+ b || (b = {}), p = r(p || new Date(e._min_date.valueOf() - 1e3)), g = r(g || new Date(e._max_date.valueOf() - 1e3));
+ const k = r(u.start_date);
+ let w;
+ w = Se(y ? `RRULE:${u.rrule};UNTIL=${s(u.end_date)};COUNT=${y}` : `RRULE:${u.rrule};UNTIL=${s(u.end_date)}`, { dtstart: k });
+ const D = w.between(p, g, !0).map((N) => {
+ const M = (T = N, new Date(T.getUTCFullYear(), T.getUTCMonth(), T.getUTCDate(), T.getUTCHours(), T.getUTCMinutes(), T.getUTCSeconds()));
+ var T;
return M.setHours(u.start_date.getHours()), M.setMinutes(u.start_date.getMinutes()), M.setSeconds(u.start_date.getSeconds()), M;
});
- let w = 0;
+ let E = 0;
const S = u.duration;
- for (let N = 0; N < D.length && !(g && w >= g); N++) {
+ for (let N = 0; N < D.length && !(y && E >= y); N++) {
const M = D[N];
- let A = x[M.valueOf()];
- if (A) {
- if (A.deleted)
+ let T = b[M.valueOf()];
+ if (T) {
+ if (T.deleted)
continue;
- w++, f.push(A);
+ E++, c.push(T);
} else {
- const T = e._copy_event(u);
- if (T.text = u.text, T.start_date = M, T.id = u.id + "#" + Math.ceil(M.valueOf()), T.end_date = new Date(M.valueOf() + 1e3 * S), T.end_date = e._fix_daylight_saving_date(T.start_date, T.end_date, u, M, T.end_date), T._timed = e.isOneDayEvent(T), !T._timed && !e._table_view && !e.config.multi_day)
+ const A = e._copy_event(u);
+ if (A.text = u.text, A.start_date = M, A.id = u.id + "#" + Math.ceil(M.valueOf()), A.end_date = new Date(M.valueOf() + 1e3 * S), A.end_date = e._fix_daylight_saving_date(A.start_date, A.end_date, u, M, A.end_date), A._timed = e.isOneDayEvent(A), !A._timed && !e._table_view && !e.config.multi_day)
continue;
- f.push(T), c || (e._events[T.id] = T, e._rec_temp.push(T)), w++;
+ c.push(A), f || (e._events[A.id] = A, e._rec_temp.push(A)), E++;
}
}
- if (x && D.length == 0)
- for (let N in x) {
- let M = x[N];
+ if (b && D.length == 0)
+ for (let N in b) {
+ let M = b[N];
if (M) {
if (M.deleted)
continue;
- p && m && M.start_date < m && M.end_date > p && f.push(M);
+ p && g && M.start_date < g && M.end_date > p && c.push(M);
}
}
- }, e._fix_daylight_saving_date = function(u, f, c, p, m) {
- var g = u.getTimezoneOffset() - f.getTimezoneOffset();
- return g ? g > 0 ? new Date(p.valueOf() + 1e3 * c.duration - 60 * g * 1e3) : new Date(f.valueOf() - 60 * g * 1e3) : new Date(m.valueOf());
- }, e.getRecDates = function(u, f) {
- var c = typeof u == "object" ? u : e.getEvent(u), p = [];
- if (f = f || 100, !t(c))
- return [{ start_date: c.start_date, end_date: c.end_date }];
- if (c.deleted)
+ }, e._fix_daylight_saving_date = function(u, c, f, p, g) {
+ var y = u.getTimezoneOffset() - c.getTimezoneOffset();
+ return y ? y > 0 ? new Date(p.valueOf() + 1e3 * f.duration - 60 * y * 1e3) : new Date(c.valueOf() - 60 * y * 1e3) : new Date(g.valueOf());
+ }, e.getRecDates = function(u, c) {
+ var f = typeof u == "object" ? u : e.getEvent(u), p = [];
+ if (c = c || 100, !t(f))
+ return [{ start_date: f.start_date, end_date: f.end_date }];
+ if (f.deleted)
return [];
- e.repeat_date(c, p, !0, c.start_date, c.end_date, f);
- for (var m = [], g = 0; g < p.length; g++)
- p[g].deleted || m.push({ start_date: p[g].start_date, end_date: p[g].end_date });
- return m;
- }, e.getEvents = function(u, f) {
- var c = [];
- const p = d();
- for (var m in this._events) {
- var g = this._events[m];
- if (!g.recurring_event_id)
- if (u && f && g.start_date < f && g.end_date > u)
- if (t(g)) {
- var y = [];
- this.repeat_date(g, y, !0, u, f, void 0, p), y.forEach(function(x) {
- x.start_date < f && x.end_date > u && c.push(x);
+ e.repeat_date(f, p, !0, f.start_date, f.end_date, c);
+ for (var g = [], y = 0; y < p.length; y++)
+ p[y].deleted || g.push({ start_date: p[y].start_date, end_date: p[y].end_date });
+ return g;
+ }, e.getEvents = function(u, c) {
+ var f = [];
+ const p = n();
+ for (var g in this._events) {
+ var y = this._events[g];
+ if (!y.recurring_event_id)
+ if (u && c && y.start_date < c && y.end_date > u)
+ if (t(y)) {
+ var x = [];
+ this.repeat_date(y, x, !0, u, c, void 0, p), x.forEach(function(b) {
+ b.start_date < c && b.end_date > u && f.push(b);
});
} else
- this._is_virtual_event(g.id) || c.push(g);
+ this._is_virtual_event(y.id) || f.push(y);
else
- u || f || this._is_virtual_event(g.id) || c.push(g);
+ u || c || this._is_virtual_event(y.id) || f.push(y);
}
- return c;
+ return f;
}, e._copy_dummy = function(u) {
- var f = new Date(this.start_date), c = new Date(this.end_date);
- this.start_date = f, this.end_date = c, this.duration = this.rrule = null;
+ var c = new Date(this.start_date), f = new Date(this.end_date);
+ this.start_date = c, this.end_date = f, this.duration = this.rrule = null;
}, e.config.include_end_by = !1, e.config.lightbox_recurring = "ask", e.config.recurring_workdays = [C.MO.weekday, C.TU.weekday, C.WE.weekday, C.TH.weekday, C.FR.weekday], e.config.repeat_date = "%m.%d.%Y", e.config.lightbox.sections = [{ name: "description", map_to: "text", type: "textarea", focus: !0 }, { name: "recurring", type: "recurring", map_to: "rec_type" }, { name: "time", height: 72, type: "time", map_to: "auto" }], e.attachEvent("onClearAll", function() {
e._rec_markers = {}, e._rec_markers_pull = {}, e._rec_temp = [];
});
- const _ = { 0: "SU", 1: "MO", 2: "TU", 3: "WE", 4: "TH", 5: "FR", 6: "SA" }, a = { 0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0 };
- function o(u) {
+ const a = { 0: "SU", 1: "MO", 2: "TU", 3: "WE", 4: "TH", 5: "FR", 6: "SA" }, o = { 0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 0 };
+ function l(u) {
switch (u) {
case 1:
case 31:
@@ -9383,41 +9405,41 @@ const gn = { active_links: function(e) {
return `${u}th`;
}
}
- e.templates.repeat_monthly_date = function(u, f) {
- return `Every ${o(u.getDate())}`;
- }, e.templates.repeat_monthly_weekday = function(u, f) {
- const c = s(u);
- return `Every ${o(c.dayNumber)} ${e.locale.date.day_full[c.dayOfWeek]}`;
- }, e.templates.repeat_yearly_month_date = function(u, f) {
- const c = u.getDate(), p = e.locale.date.month_full[u.getMonth()];
- return `Every ${o(c)} day of ${p}`;
- }, e.templates.repeat_yearly_month_weekday = function(u, f) {
- const c = s(u), p = e.locale.date.month_full[u.getMonth()];
- return `Every ${o(c.dayNumber)} ${e.locale.date.day_full[c.dayOfWeek]} of ${p}`;
+ e.templates.repeat_monthly_date = function(u, c) {
+ return `Every ${l(u.getDate())}`;
+ }, e.templates.repeat_monthly_weekday = function(u, c) {
+ const f = _(u);
+ return `Every ${l(f.dayNumber)} ${e.locale.date.day_full[f.dayOfWeek]}`;
+ }, e.templates.repeat_yearly_month_date = function(u, c) {
+ const f = u.getDate(), p = e.locale.date.month_full[u.getMonth()];
+ return `Every ${l(f)} day of ${p}`;
+ }, e.templates.repeat_yearly_month_weekday = function(u, c) {
+ const f = _(u), p = e.locale.date.month_full[u.getMonth()];
+ return `Every ${l(f.dayNumber)} ${e.locale.date.day_full[f.dayOfWeek]} of ${p}`;
};
- const l = { MONTHLY: function(u) {
+ const h = { MONTHLY: function(u) {
return { rrule: { freq: C.MONTHLY, interval: 1, bymonthday: u.start.getDate() }, until: new Date(9999, 1, 1) };
}, WEEKLY: function(u) {
- let f = u.start.getDay() - 1;
- return f == -1 && (f = 6), { rrule: { freq: C.WEEKLY, interval: 1, byweekday: [f] }, until: new Date(9999, 1, 1) };
+ let c = u.start.getDay() - 1;
+ return c == -1 && (c = 6), { rrule: { freq: C.WEEKLY, interval: 1, byweekday: [c] }, until: new Date(9999, 1, 1) };
}, DAILY: function(u) {
return { rrule: { freq: C.DAILY, interval: 1 }, until: new Date(9999, 1, 1) };
}, YEARLY: function(u) {
return { rrule: { freq: C.YEARLY, bymonth: u.start.getMonth() + 1, interval: 1, bymonthday: u.start.getDate() }, until: new Date(9999, 1, 1) };
}, WORKDAYS: function(u) {
return { rrule: { freq: C.WEEKLY, interval: 1, byweekday: e.config.recurring_workdays }, until: new Date(9999, 1, 1) };
- }, CUSTOM: function(u, f) {
- const c = {}, p = f.querySelector('[name="repeat_interval_unit"]').value, m = Math.max(1, f.querySelector('[name="repeat_interval_value"]').value), g = f.querySelector('[name="dhx_custom_month_option"]').value, y = f.querySelector('[name="dhx_custom_year_option"]').value;
- let x, b;
- switch (c.interval = m, p) {
+ }, CUSTOM: function(u, c) {
+ const f = {}, p = c.querySelector('[name="repeat_interval_unit"]').value, g = Math.max(1, c.querySelector('[name="repeat_interval_value"]').value), y = c.querySelector('[name="dhx_custom_month_option"]').value, x = c.querySelector('[name="dhx_custom_year_option"]').value;
+ let b, k;
+ switch (f.interval = g, p) {
case "DAILY":
- c.freq = C.DAILY;
+ f.freq = C.DAILY;
break;
case "WEEKLY":
- c.freq = C.WEEKLY, x = [], f.querySelectorAll('.dhx_form_repeat_custom_week [name="week_day"]').forEach((w) => {
- w.checked && x.push(w.value);
- }), c.byweekday = x.map((w) => {
- switch (w) {
+ f.freq = C.WEEKLY, b = [], c.querySelectorAll('.dhx_form_repeat_custom_week [name="week_day"]').forEach((S) => {
+ S.checked && b.push(S.value);
+ }), f.byweekday = b.map((S) => {
+ switch (S) {
case "MO":
return C.MO.weekday;
case "TU":
@@ -9436,90 +9458,90 @@ const gn = { active_links: function(e) {
});
break;
case "MONTHLY":
- c.freq = C.MONTHLY, g === "month_date" ? c.bymonthday = u.start.getDate() : (b = u.start.getDay() - 1, b == -1 && (b = 6), c.byweekday = [b], c.bysetpos = s(u.start).dayNumber);
+ f.freq = C.MONTHLY, y === "month_date" ? f.bymonthday = u.start.getDate() : (k = u.start.getDay() - 1, k == -1 && (k = 6), f.byweekday = [k], f.bysetpos = _(u.start).dayNumber);
break;
case "YEARLY":
- c.freq = C.YEARLY, c.bymonth = u.start.getMonth() + 1, y == "month_date" ? c.bymonthday = u.start.getDate() : (b = u.start.getDay() - 1, b == -1 && (b = 6), c.byweekday = [b], c.bysetpos = s(u.start).dayNumber);
+ f.freq = C.YEARLY, f.bymonth = u.start.getMonth() + 1, x == "month_date" ? f.bymonthday = u.start.getDate() : (k = u.start.getDay() - 1, k == -1 && (k = 6), f.byweekday = [k], f.bysetpos = _(u.start).dayNumber);
}
- const k = e.date.str_to_date("%Y-%m-%d");
- let E = new Date(9999, 1, 1);
- const D = f.querySelector('[name="dhx_custom_repeat_ends"]');
- return D.value === "ON" ? E = k(f.querySelector('[name="dhx_form_repeat_ends_ondate"]').value) : D.value === "AFTER" && (c.count = Math.max(1, f.querySelector('[name="dhx_form_repeat_ends_after"]').value)), { rrule: c, until: E };
+ const w = e.date.str_to_date("%Y-%m-%d");
+ let D = new Date(9999, 1, 1);
+ const E = c.querySelector('[name="dhx_custom_repeat_ends"]');
+ return E.value === "ON" ? D = w(c.querySelector('[name="dhx_form_repeat_ends_ondate"]').value) : E.value === "AFTER" && (f.count = Math.max(1, c.querySelector('[name="dhx_form_repeat_ends_after"]').value)), { rrule: f, until: D };
}, NEVER: function() {
} };
- function h(u, f, c) {
- (function(p, m) {
- p.querySelector("[name='repeat_interval_value']").value = (m ? m.interval : 1) || 1;
- })(u, f), function(p, m, g) {
- if (p.querySelector("[name='repeat_interval_value']").value = (m ? m.interval : 1) || 1, p.querySelectorAll(".dhx_form_repeat_custom_week input").forEach((y) => y.checked = !1), m && m.byweekday)
- m.byweekday.forEach((y) => {
- const x = a[y.weekday], b = _[x];
- p.querySelector(`.dhx_form_repeat_custom_week input[value="${b}"]`).checked = !0;
+ function m(u, c, f) {
+ (function(p, g) {
+ p.querySelector("[name='repeat_interval_value']").value = (g ? g.interval : 1) || 1;
+ })(u, c), function(p, g, y) {
+ if (p.querySelector("[name='repeat_interval_value']").value = (g ? g.interval : 1) || 1, p.querySelectorAll(".dhx_form_repeat_custom_week input").forEach((x) => x.checked = !1), g && g.byweekday)
+ g.byweekday.forEach((x) => {
+ const b = o[x.weekday], k = a[b];
+ p.querySelector(`.dhx_form_repeat_custom_week input[value="${k}"]`).checked = !0;
});
else {
- const y = _[g.start_date.getDay()];
- p.querySelector(`.dhx_form_repeat_custom_week input[value="${y}"]`).checked = !0;
- }
- }(u, f, c), function(p, m, g) {
- p.querySelector("[name='repeat_interval_value']").value = (m ? m.interval : 1) || 1;
- const y = p.querySelector('.dhx_form_repeat_custom_month [value="month_date"]'), x = p.querySelector('.dhx_form_repeat_custom_month [value="month_nth_weekday"]');
- y.innerText = e.templates.repeat_monthly_date(g.start_date, g), x.innerText = e.templates.repeat_monthly_weekday(g.start_date, g), m && (!m.bysetpos || m.byweekday && m.byweekday.length) ? p.querySelector('[name="dhx_custom_month_option"]').value = "month_nth_weekday" : p.querySelector('[name="dhx_custom_month_option"]').value = "month_date";
- }(u, f, c), function(p, m, g) {
- const y = p.querySelector('.dhx_form_repeat_custom_year [value="month_date"]'), x = p.querySelector('.dhx_form_repeat_custom_year [value="month_nth_weekday"]');
- y.innerText = e.templates.repeat_yearly_month_date(g.start_date, g), x.innerText = e.templates.repeat_yearly_month_weekday(g.start_date, g), m && (!m.bysetpos || m.byweekday && m.byweekday.length) ? p.querySelector('[name="dhx_custom_year_option"]').value = "month_nth_weekday" : p.querySelector('[name="dhx_custom_year_option"]').value = "month_date";
- }(u, f, c), function(p, m, g) {
- const y = p.querySelector('.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_after"]'), x = p.querySelector('.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_ondate"]'), b = p.querySelector("[name='dhx_custom_repeat_ends']");
- y.value = 1;
- let k = e.date.date_to_str("%Y-%m-%d");
- e.config.repeat_date_of_end || (e.config.repeat_date_of_end = k(e.date.add(e._currentDate(), 30, "day"))), x.value = e.config.repeat_date_of_end, m && m.count ? (b.value = "AFTER", y.value = m.count) : g._end_date && g._end_date.getFullYear() !== 9999 ? (b.value = "ON", x.value = k(g._end_date)) : b.value = "NEVER", b.dispatchEvent(new Event("change"));
- }(u, f, c);
+ const x = a[y.start_date.getDay()];
+ p.querySelector(`.dhx_form_repeat_custom_week input[value="${x}"]`).checked = !0;
+ }
+ }(u, c, f), function(p, g, y) {
+ p.querySelector("[name='repeat_interval_value']").value = (g ? g.interval : 1) || 1;
+ const x = p.querySelector('.dhx_form_repeat_custom_month [value="month_date"]'), b = p.querySelector('.dhx_form_repeat_custom_month [value="month_nth_weekday"]');
+ x.innerText = e.templates.repeat_monthly_date(y.start_date, y), b.innerText = e.templates.repeat_monthly_weekday(y.start_date, y), g && (!g.bysetpos || g.byweekday && g.byweekday.length) ? p.querySelector('[name="dhx_custom_month_option"]').value = "month_nth_weekday" : p.querySelector('[name="dhx_custom_month_option"]').value = "month_date";
+ }(u, c, f), function(p, g, y) {
+ const x = p.querySelector('.dhx_form_repeat_custom_year [value="month_date"]'), b = p.querySelector('.dhx_form_repeat_custom_year [value="month_nth_weekday"]');
+ x.innerText = e.templates.repeat_yearly_month_date(y.start_date, y), b.innerText = e.templates.repeat_yearly_month_weekday(y.start_date, y), g && (!g.bysetpos || g.byweekday && g.byweekday.length) ? p.querySelector('[name="dhx_custom_year_option"]').value = "month_nth_weekday" : p.querySelector('[name="dhx_custom_year_option"]').value = "month_date";
+ }(u, c, f), function(p, g, y) {
+ const x = p.querySelector('.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_after"]'), b = p.querySelector('.dhx_form_repeat_ends_extra [name="dhx_form_repeat_ends_ondate"]'), k = p.querySelector("[name='dhx_custom_repeat_ends']");
+ x.value = 1;
+ let w = e.date.date_to_str("%Y-%m-%d");
+ e.config.repeat_date_of_end || (e.config.repeat_date_of_end = w(e.date.add(e._currentDate(), 30, "day"))), b.value = e.config.repeat_date_of_end, g && g.count ? (k.value = "AFTER", x.value = g.count) : y._end_date && y._end_date.getFullYear() !== 9999 ? (k.value = "ON", b.value = w(y._end_date)) : k.value = "NEVER", k.dispatchEvent(new Event("change"));
+ }(u, c, f);
}
function v(u) {
- for (let f = 0; f < e.config.lightbox.sections.length; f++) {
- let c = e.config.lightbox.sections[f];
- if (c.type === u)
- return e.formSection(c.name);
+ for (let c = 0; c < e.config.lightbox.sections.length; c++) {
+ let f = e.config.lightbox.sections[c];
+ if (f.type === u)
+ return e.formSection(f.name);
}
return null;
}
e.form_blocks.recurring = { render: function(u) {
if (u.form) {
- let c = e.form_blocks.recurring, p = c._get_node(u.form), m = c._outer_html(p);
- return p.style.display = "none", m;
+ let f = e.form_blocks.recurring, p = f._get_node(u.form), g = f._outer_html(p);
+ return p.style.display = "none", g;
}
- let f = e.locale.labels;
+ let c = e.locale.labels;
return `
- ${f.repeat_never}
- ${f.repeat_daily}
- ${f.repeat_weekly}
- ${f.repeat_monthly}
- ${f.repeat_yearly}
- ${f.repeat_workdays}
- ${f.repeat_custom}
+ ${c.repeat_never}
+ ${c.repeat_daily}
+ ${c.repeat_weekly}
+ ${c.repeat_monthly}
+ ${c.repeat_yearly}
+ ${c.repeat_workdays}
+ ${c.repeat_custom}
- ${f.repeat_freq_day}
- ${f.repeat_freq_week}
- ${f.repeat_freq_month}
- ${f.repeat_freq_year}
+ ${c.repeat_freq_day}
+ ${c.repeat_freq_week}
+ ${c.repeat_freq_month}
+ ${c.repeat_freq_year}
- ${f.day_for_recurring[1]}
- ${f.day_for_recurring[2]}
- ${f.day_for_recurring[3]}
- ${f.day_for_recurring[4]}
- ${f.day_for_recurring[5]}
- ${f.day_for_recurring[6]}
- ${f.day_for_recurring[0]}
+ ${c.day_for_recurring[1]}
+ ${c.day_for_recurring[2]}
+ ${c.day_for_recurring[3]}
+ ${c.day_for_recurring[4]}
+ ${c.day_for_recurring[5]}
+ ${c.day_for_recurring[6]}
+ ${c.day_for_recurring[0]}
@@ -9538,16 +9560,16 @@ const gn = { active_links: function(e) {
-
${f.repeat_ends}
+
${c.repeat_ends}
- ${f.repeat_never}
- ${f.repeat_radio_end2}
- ${f.repeat_on_date}
+ ${c.repeat_never}
+ ${c.repeat_radio_end2}
+ ${c.repeat_on_date}
`;
- }, _init_set_value: function(u, f, c) {
- function p(g) {
- g.classList.add("dhx_hidden");
+ }, _init_set_value: function(u, c, f) {
+ function p(y) {
+ y.classList.add("dhx_hidden");
}
- function m(g) {
- g.classList.remove("dhx_hidden");
+ function g(y) {
+ y.classList.remove("dhx_hidden");
}
- e.form_blocks.recurring._ds = { start: c.start_date, end: c.end_date }, u.querySelector(".dhx_form_repeat_pattern select").addEventListener("change", function() {
- (function(g) {
- const y = u.querySelector(".dhx_form_repeat_custom");
- g === "CUSTOM" ? m(y) : p(y);
+ e.form_blocks.recurring._ds = { start: f.start_date, end: f.end_date }, u.querySelector(".dhx_form_repeat_pattern select").addEventListener("change", function() {
+ (function(y) {
+ const x = u.querySelector(".dhx_form_repeat_custom");
+ y === "CUSTOM" ? g(x) : p(x);
})(this.value);
}), u.querySelector(".dhx_form_repeat_custom_interval [name='repeat_interval_unit']").addEventListener("change", function() {
- (function(g) {
- const y = { weekly: u.querySelector(".dhx_form_repeat_custom_week"), monthly: u.querySelector(".dhx_form_repeat_custom_month"), yearly: u.querySelector(".dhx_form_repeat_custom_year") };
- switch (g) {
+ (function(y) {
+ const x = { weekly: u.querySelector(".dhx_form_repeat_custom_week"), monthly: u.querySelector(".dhx_form_repeat_custom_month"), yearly: u.querySelector(".dhx_form_repeat_custom_year") };
+ switch (y) {
case "DAILY":
- p(y.weekly), p(y.monthly), p(y.yearly);
+ p(x.weekly), p(x.monthly), p(x.yearly);
break;
case "WEEKLY":
- m(y.weekly), p(y.monthly), p(y.yearly);
+ g(x.weekly), p(x.monthly), p(x.yearly);
break;
case "MONTHLY":
- p(y.weekly), m(y.monthly), p(y.yearly);
+ p(x.weekly), g(x.monthly), p(x.yearly);
break;
case "YEARLY":
- p(y.weekly), p(y.monthly), m(y.yearly);
+ p(x.weekly), p(x.monthly), g(x.yearly);
}
})(this.value);
}), u.querySelector(".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']").addEventListener("change", function() {
- (function(g) {
- const y = { after: u.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after"), on: u.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on") };
- switch (g) {
+ (function(y) {
+ const x = { after: u.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after"), on: u.querySelector(".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on") };
+ switch (y) {
case "NEVER":
- p(y.after), p(y.on);
+ p(x.after), p(x.on);
break;
case "AFTER":
- m(y.after), p(y.on);
+ g(x.after), p(x.on);
break;
case "ON":
- p(y.after), m(y.on);
+ p(x.after), g(x.on);
}
})(this.value);
}), e._lightbox._rec_init_done = !0;
}, button_click: function() {
- }, set_value: function(u, f, c) {
+ }, set_value: function(u, c, f) {
let p = e.form_blocks.recurring;
- e._lightbox._rec_init_done || p._init_set_value(u, f, c), u.open = !c.rrule, u.blocked = this._is_modified_occurence(c);
- let m = p._ds;
- if (m.start = c.start_date, m.end = c._end_date, c.rrule) {
- const g = Se(c.rrule);
- h(u, g.origOptions, c);
- const y = function(x, b) {
- const k = x.options, E = k.until || b;
- return k.count || E && E.getFullYear() !== 9999 ? "CUSTOM" : k.freq !== C.DAILY || k.interval !== 1 || k.byweekday ? k.freq !== C.WEEKLY || k.interval !== 1 || k.byweekday ? k.freq !== C.MONTHLY || k.interval !== 1 || k.bysetpos ? k.freq !== C.YEARLY || k.interval !== 1 || k.bysetpos ? k.freq === C.DAILY && k.byweekday && k.byweekday.length === e.config.recurring_workdays.length && k.byweekday.includes(C.MO) && k.byweekday.includes(C.TU) && k.byweekday.includes(C.WE) && k.byweekday.includes(C.TH) && k.byweekday.includes(C.FR) ? "WORKDAYS" : "CUSTOM" : "YEARLY" : "MONTHLY" : "WEEKLY" : "DAILY";
- }(g, c._end_date);
- if (u.querySelector(".dhx_form_repeat_pattern select").value = y, y === "CUSTOM") {
- let x;
- switch (g.origOptions.freq) {
+ e._lightbox._rec_init_done || p._init_set_value(u, c, f), u.open = !f.rrule, u.blocked = this._is_modified_occurence(f);
+ let g = p._ds;
+ if (g.start = f.start_date, g.end = f._end_date, f.rrule) {
+ const y = Se(f.rrule);
+ m(u, y.origOptions, f);
+ const x = function(b, k) {
+ const w = b.options, D = w.until || k;
+ return w.count || D && D.getFullYear() !== 9999 ? "CUSTOM" : w.freq !== C.DAILY || w.interval !== 1 || w.byweekday ? w.freq !== C.WEEKLY || w.interval !== 1 || w.byweekday ? w.freq !== C.MONTHLY || w.interval !== 1 || w.bysetpos ? w.freq !== C.YEARLY || w.interval !== 1 || w.bysetpos ? w.freq === C.DAILY && w.byweekday && w.byweekday.length === e.config.recurring_workdays.length && w.byweekday.includes(C.MO) && w.byweekday.includes(C.TU) && w.byweekday.includes(C.WE) && w.byweekday.includes(C.TH) && w.byweekday.includes(C.FR) ? "WORKDAYS" : "CUSTOM" : "YEARLY" : "MONTHLY" : "WEEKLY" : "DAILY";
+ }(y, f._end_date);
+ if (u.querySelector(".dhx_form_repeat_pattern select").value = x, x === "CUSTOM") {
+ let b;
+ switch (y.origOptions.freq) {
case C.DAILY:
- x = "DAILY";
+ b = "DAILY";
break;
case C.WEEKLY:
- x = "WEEKLY";
+ b = "WEEKLY";
break;
case C.MONTHLY:
- x = "MONTHLY";
+ b = "MONTHLY";
break;
case C.YEARLY:
- x = "YEARLY";
+ b = "YEARLY";
}
- x && (u.querySelector('[name="repeat_interval_unit"]').value = x, u.querySelector('[name="repeat_interval_unit"]').dispatchEvent(new Event("change")));
+ b && (u.querySelector('[name="repeat_interval_unit"]').value = b, u.querySelector('[name="repeat_interval_unit"]').dispatchEvent(new Event("change")));
}
} else
- h(u, null, c), u.querySelector(".dhx_form_repeat_pattern select").value = "NEVER";
+ m(u, null, f), u.querySelector(".dhx_form_repeat_pattern select").value = "NEVER";
u.querySelector(".dhx_form_repeat_pattern select").dispatchEvent(new Event("change"));
- }, get_value: function(u, f) {
+ }, get_value: function(u, c) {
if (u.blocked || u.querySelector(".dhx_form_repeat_pattern select").value === "NEVER")
- f.rrule = f.rrule = "", f._end_date = f.end_date;
+ c.rrule = c.rrule = "", c._end_date = c.end_date;
else {
- let c = e.form_blocks.recurring._ds, p = {};
+ let f = e.form_blocks.recurring._ds, p = {};
(function() {
- let y = e.formSection("time");
- if (y || (y = v("time")), y || (y = v("calendar_time")), !y)
+ let x = e.formSection("time");
+ if (x || (x = v("time")), x || (x = v("calendar_time")), !x)
throw new Error(["Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.", "You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. ", 'In the latter case, make sure the control is named "time":', "", "scheduler.config.lightbox.sections = [", '{name:"time", height:72, type:"YOU CONTROL", map_to:"auto" }];'].join(`
`));
- return y;
- })().getValue(p), c.start = p.start_date;
- const m = u.querySelector(".dhx_form_repeat_pattern select").value, g = l[m](c, u);
- f.rrule = new C(g.rrule).toString().replace("RRULE:", ""), c.end = g.until, f.duration = Math.floor((p.end_date - p.start_date) / 1e3), c._start ? (f.start_date = new Date(c.start), f._start_date = new Date(c.start), c._start = !1) : f._start_date = null, f._end_date = c.end;
+ return x;
+ })().getValue(p), f.start = p.start_date;
+ const g = u.querySelector(".dhx_form_repeat_pattern select").value, y = h[g](f, u);
+ c.rrule = new C(y.rrule).toString().replace("RRULE:", ""), f.end = y.until, c.duration = Math.floor((p.end_date - p.start_date) / 1e3), f._start ? (c.start_date = new Date(f.start), c._start_date = new Date(f.start), f._start = !1) : c._start_date = null, c._end_date = f.end;
}
- return f.rrule;
+ return c.rrule;
}, focus: function(u) {
} };
}, recurring_legacy: function(e) {
@@ -9728,41 +9750,41 @@ const gn = { active_links: function(e) {
}, _init_set_value: function(n, s, _) {
var a = e.form_blocks.recurring, o = a._get_node_value, l = a._set_node_value;
e.form_blocks.recurring._ds = { start: _.start_date, end: _._end_date };
- var h = e.date.str_to_date(e.config.repeat_date, !1, !0), v = e.date.date_to_str(e.config.repeat_date), u = n.getElementsByTagName("FORM")[0], f = {};
+ var h = e.date.str_to_date(e.config.repeat_date, !1, !0), m = e.date.date_to_str(e.config.repeat_date), v = n.getElementsByTagName("FORM")[0], u = {};
function c(D) {
- for (var w = 0; w < D.length; w++) {
- var S = D[w];
+ for (var E = 0; E < D.length; E++) {
+ var S = D[E];
if (S.name)
- if (f[S.name])
- if (f[S.name].nodeType) {
- var N = f[S.name];
- f[S.name] = [N, S];
+ if (u[S.name])
+ if (u[S.name].nodeType) {
+ var N = u[S.name];
+ u[S.name] = [N, S];
} else
- f[S.name].push(S);
+ u[S.name].push(S);
else
- f[S.name] = S;
+ u[S.name] = S;
}
}
- if (c(u.getElementsByTagName("INPUT")), c(u.getElementsByTagName("SELECT")), !e.config.repeat_date_of_end) {
- var p = e.date.date_to_str(e.config.repeat_date);
- e.config.repeat_date_of_end = p(e.date.add(e._currentDate(), 30, "day"));
+ if (c(v.getElementsByTagName("INPUT")), c(v.getElementsByTagName("SELECT")), !e.config.repeat_date_of_end) {
+ var f = e.date.date_to_str(e.config.repeat_date);
+ e.config.repeat_date_of_end = f(e.date.add(e._currentDate(), 30, "day"));
}
- l(f, "date_of_end", e.config.repeat_date_of_end);
- var m = function(D) {
+ l(u, "date_of_end", e.config.repeat_date_of_end);
+ var p = function(D) {
return e._lightbox.querySelector(`#${D}`) || { style: {} };
};
function g() {
- m("dhx_repeat_day").style.display = "none", m("dhx_repeat_week").style.display = "none", m("dhx_repeat_month").style.display = "none", m("dhx_repeat_year").style.display = "none", m("dhx_repeat_" + this.value).style.display = "", e.setLightboxSize();
+ p("dhx_repeat_day").style.display = "none", p("dhx_repeat_week").style.display = "none", p("dhx_repeat_month").style.display = "none", p("dhx_repeat_year").style.display = "none", p("dhx_repeat_" + this.value).style.display = "", e.setLightboxSize();
}
- function y(D, w) {
+ function y(D, E) {
var S = D.end;
if (S.length)
if (S[0].value && S[0].value != "on")
for (var N = 0; N < S.length; N++)
- S[N].value == w && (S[N].checked = !0);
+ S[N].value == E && (S[N].checked = !0);
else {
var M = 0;
- switch (w) {
+ switch (E) {
case "no":
M = 0;
break;
@@ -9775,79 +9797,79 @@ const gn = { active_links: function(e) {
S[M].checked = !0;
}
else
- S.value = w;
+ S.value = E;
}
e.form_blocks.recurring._get_repeat_code = function(D) {
- var w = [o(f, "repeat")];
- for (x[w[0]](w, D); w.length < 5; )
- w.push("");
+ var E = [o(u, "repeat")];
+ for (x[E[0]](E, D); E.length < 5; )
+ E.push("");
var S = "", N = function(M) {
- var A = M.end;
- if (A.length) {
- for (var T = 0; T < A.length; T++)
- if (A[T].checked)
- return A[T].value && A[T].value != "on" ? A[T].value : T ? T == 2 ? "date_of_end" : "occurences_count" : "no";
- } else if (A.value)
- return A.value;
+ var T = M.end;
+ if (T.length) {
+ for (var A = 0; A < T.length; A++)
+ if (T[A].checked)
+ return T[A].value && T[A].value != "on" ? T[A].value : A ? A == 2 ? "date_of_end" : "occurences_count" : "no";
+ } else if (T.value)
+ return T.value;
return "no";
- }(f);
+ }(u);
return N == "no" ? (D.end = new Date(9999, 1, 1), S = "no") : N == "date_of_end" ? D.end = function(M) {
- var A = h(M);
- return e.config.include_end_by && (A = e.date.add(A, 1, "day")), A;
- }(o(f, "date_of_end")) : (e.transpose_type(w.join("_")), S = Math.max(1, o(f, "occurences_count")), D.end = e.date["add_" + w.join("_")](new Date(D.start), S + 0, { start_date: D.start }) || D.start), w.join("_") + "#" + S;
+ var T = h(M);
+ return e.config.include_end_by && (T = e.date.add(T, 1, "day")), T;
+ }(o(u, "date_of_end")) : (e.transpose_type(E.join("_")), S = Math.max(1, o(u, "occurences_count")), D.end = e.date["add_" + E.join("_")](new Date(D.start), S + 0, { start_date: D.start }) || D.start), E.join("_") + "#" + S;
};
- var x = { month: function(D, w) {
+ var x = { month: function(D, E) {
var S = e.form_blocks.recurring._get_node_value, N = e.form_blocks.recurring._get_node_numeric_value;
- S(f, "month_type") == "d" ? (D.push(Math.max(1, N(f, "month_count"))), w.start.setDate(S(f, "month_day"))) : (D.push(Math.max(1, N(f, "month_count2"))), D.push(S(f, "month_day2")), D.push(Math.max(1, N(f, "month_week2"))), e.config.repeat_precise || w.start.setDate(1)), w._start = !0;
- }, week: function(D, w) {
+ S(u, "month_type") == "d" ? (D.push(Math.max(1, N(u, "month_count"))), E.start.setDate(S(u, "month_day"))) : (D.push(Math.max(1, N(u, "month_count2"))), D.push(S(u, "month_day2")), D.push(Math.max(1, N(u, "month_week2"))), e.config.repeat_precise || E.start.setDate(1)), E._start = !0;
+ }, week: function(D, E) {
var S = e.form_blocks.recurring._get_node_value, N = e.form_blocks.recurring._get_node_numeric_value;
- D.push(Math.max(1, N(f, "week_count"))), D.push(""), D.push("");
- for (var M = [], A = S(f, "week_day", !0), T = w.start.getDay(), H = !1, $ = 0; $ < A.length; $++)
- M.push(A[$]), H = H || A[$] == T;
- M.length || (M.push(T), H = !0), M.sort(), e.config.repeat_precise ? H || (e.transpose_day_week(w.start, M, 1, 7), w._start = !0) : (w.start = e.date.week_start(w.start), w._start = !0), D.push(M.join(","));
+ D.push(Math.max(1, N(u, "week_count"))), D.push(""), D.push("");
+ for (var M = [], T = S(u, "week_day", !0), A = E.start.getDay(), H = !1, $ = 0; $ < T.length; $++)
+ M.push(T[$]), H = H || T[$] == A;
+ M.length || (M.push(A), H = !0), M.sort(), e.config.repeat_precise ? H || (e.transpose_day_week(E.start, M, 1, 7), E._start = !0) : (E.start = e.date.week_start(E.start), E._start = !0), D.push(M.join(","));
}, day: function(D) {
- var w = e.form_blocks.recurring._get_node_value, S = e.form_blocks.recurring._get_node_numeric_value;
- w(f, "day_type") == "d" ? D.push(Math.max(1, S(f, "day_count"))) : (D.push("week"), D.push(1), D.push(""), D.push(""), D.push(e.config.recurring_workdays.join(",")), D.splice(0, 1));
- }, year: function(D, w) {
+ var E = e.form_blocks.recurring._get_node_value, S = e.form_blocks.recurring._get_node_numeric_value;
+ E(u, "day_type") == "d" ? D.push(Math.max(1, S(u, "day_count"))) : (D.push("week"), D.push(1), D.push(""), D.push(""), D.push(e.config.recurring_workdays.join(",")), D.splice(0, 1));
+ }, year: function(D, E) {
var S = e.form_blocks.recurring._get_node_value;
- S(f, "year_type") == "d" ? (D.push("1"), w.start.setMonth(0), w.start.setDate(S(f, "year_day")), w.start.setMonth(S(f, "year_month"))) : (D.push("1"), D.push(S(f, "year_day2")), D.push(S(f, "year_week2")), w.start.setDate(1), w.start.setMonth(S(f, "year_month2"))), w._start = !0;
- } }, b = { week: function(D, w) {
+ S(u, "year_type") == "d" ? (D.push("1"), E.start.setMonth(0), E.start.setDate(S(u, "year_day")), E.start.setMonth(S(u, "year_month"))) : (D.push("1"), D.push(S(u, "year_day2")), D.push(S(u, "year_week2")), E.start.setDate(1), E.start.setMonth(S(u, "year_month2"))), E._start = !0;
+ } }, b = { week: function(D, E) {
var S = e.form_blocks.recurring._set_node_value;
- S(f, "week_count", D[1]);
- for (var N = D[4].split(","), M = {}, A = 0; A < N.length; A++)
- M[N[A]] = !0;
- S(f, "week_day", M);
- }, month: function(D, w) {
+ S(u, "week_count", D[1]);
+ for (var N = D[4].split(","), M = {}, T = 0; T < N.length; T++)
+ M[N[T]] = !0;
+ S(u, "week_day", M);
+ }, month: function(D, E) {
var S = e.form_blocks.recurring._set_node_value;
- D[2] === "" ? (S(f, "month_type", "d"), S(f, "month_count", D[1]), S(f, "month_day", w.start.getDate())) : (S(f, "month_type", "w"), S(f, "month_count2", D[1]), S(f, "month_week2", D[3]), S(f, "month_day2", D[2]));
- }, day: function(D, w) {
+ D[2] === "" ? (S(u, "month_type", "d"), S(u, "month_count", D[1]), S(u, "month_day", E.start.getDate())) : (S(u, "month_type", "w"), S(u, "month_count2", D[1]), S(u, "month_week2", D[3]), S(u, "month_day2", D[2]));
+ }, day: function(D, E) {
var S = e.form_blocks.recurring._set_node_value;
- S(f, "day_type", "d"), S(f, "day_count", D[1]);
- }, year: function(D, w) {
+ S(u, "day_type", "d"), S(u, "day_count", D[1]);
+ }, year: function(D, E) {
var S = e.form_blocks.recurring._set_node_value;
- D[2] === "" ? (S(f, "year_type", "d"), S(f, "year_day", w.start.getDate()), S(f, "year_month", w.start.getMonth())) : (S(f, "year_type", "w"), S(f, "year_week2", D[3]), S(f, "year_day2", D[2]), S(f, "year_month2", w.start.getMonth()));
+ D[2] === "" ? (S(u, "year_type", "d"), S(u, "year_day", E.start.getDate()), S(u, "year_month", E.start.getMonth())) : (S(u, "year_type", "w"), S(u, "year_week2", D[3]), S(u, "year_day2", D[2]), S(u, "year_month2", E.start.getMonth()));
} };
- e.form_blocks.recurring._set_repeat_code = function(D, w) {
+ e.form_blocks.recurring._set_repeat_code = function(D, E) {
var S = e.form_blocks.recurring._set_node_value, N = D.split("#");
- switch (D = N[0].split("_"), b[D[0]](D, w), N[1]) {
+ switch (D = N[0].split("_"), b[D[0]](D, E), N[1]) {
case "no":
- y(f, "no");
+ y(u, "no");
break;
case "":
- y(f, "date_of_end");
- var M = w.end;
- e.config.include_end_by && (M = e.date.add(M, -1, "day")), S(f, "date_of_end", v(M));
+ y(u, "date_of_end");
+ var M = E.end;
+ e.config.include_end_by && (M = e.date.add(M, -1, "day")), S(u, "date_of_end", m(M));
break;
default:
- y(f, "occurences_count"), S(f, "occurences_count", N[1]);
+ y(u, "occurences_count"), S(u, "occurences_count", N[1]);
}
- S(f, "repeat", D[0]);
- var A = e.form_blocks.recurring._get_form_node(f, "repeat", D[0]);
- A.nodeName == "SELECT" ? (A.dispatchEvent(new Event("change")), A.dispatchEvent(new MouseEvent("click"))) : A.dispatchEvent(new MouseEvent("click"));
+ S(u, "repeat", D[0]);
+ var T = e.form_blocks.recurring._get_form_node(u, "repeat", D[0]);
+ T.nodeName == "SELECT" ? (T.dispatchEvent(new Event("change")), T.dispatchEvent(new MouseEvent("click"))) : T.dispatchEvent(new MouseEvent("click"));
};
- for (var k = 0; k < u.elements.length; k++) {
- var E = u.elements[k];
- E.name === "repeat" && (E.nodeName != "SELECT" || E.$_eventAttached ? E.$_eventAttached || (E.$_eventAttached = !0, E.addEventListener("click", g)) : (E.$_eventAttached = !0, E.addEventListener("change", g)));
+ for (var k = 0; k < v.elements.length; k++) {
+ var w = v.elements[k];
+ w.name === "repeat" && (w.nodeName != "SELECT" || w.$_eventAttached ? w.$_eventAttached || (w.$_eventAttached = !0, w.addEventListener("click", g)) : (w.$_eventAttached = !0, w.addEventListener("change", g)));
}
e._lightbox._rec_init_done = !0;
}, set_value: function(n, s, _) {
@@ -9925,8 +9947,8 @@ const gn = { active_links: function(e) {
} else {
s.rec_type && this._lightbox_id && this._roll_back_dates(s);
var h = this._get_rec_markers(n);
- for (var v in h)
- h.hasOwnProperty(v) && (n = h[v].id, this.getEvent(n) && this.deleteEvent(n, !0));
+ for (var m in h)
+ h.hasOwnProperty(m) && (n = h[m].id, this.getEvent(n) && this.deleteEvent(n, !0));
}
return !0;
}), e.attachEvent("onEventDeleted", function(n, s) {
@@ -9946,12 +9968,12 @@ const gn = { active_links: function(e) {
} else {
_.start_date && (_.start_date = r(_.start_date)), _.end_date && (_.end_date = r(_.end_date)), _.rec_type && this._lightbox_id && this._roll_back_dates(_);
var h = this._get_rec_markers(n);
- for (var v in h)
- h.hasOwnProperty(v) && (delete this._rec_markers[h[v].id], this.deleteEvent(h[v].id, !0));
+ for (var m in h)
+ h.hasOwnProperty(m) && (delete this._rec_markers[h[m].id], this.deleteEvent(h[m].id, !0));
delete this._rec_markers_pull[n];
- for (var u = !1, f = 0; f < this._rendered.length; f++)
- this._rendered[f].getAttribute(this.config.event_attribute) == n && (u = !0);
- u || (this._select_id = null);
+ for (var v = !1, u = 0; u < this._rendered.length; u++)
+ this._rendered[u].getAttribute(this.config.event_attribute) == n && (v = !0);
+ v || (this._select_id = null);
}
return !0;
}), e.attachEvent("onEventAdded", function(n) {
@@ -9977,22 +9999,22 @@ const gn = { active_links: function(e) {
}, e.showLightbox_rec = e.showLightbox, e.showLightbox = function(n) {
var s = this.locale, _ = e.config.lightbox_recurring, a = this.getEvent(n), o = a.event_pid, l = this._is_virtual_event(n);
l && (o = n.split("#")[0]);
- var h = function(u) {
- var f = e.getEvent(u);
- return f._end_date = f.end_date, f.end_date = new Date(f.start_date.valueOf() + 1e3 * f.event_length), e.showLightbox_rec(u);
+ var h = function(v) {
+ var u = e.getEvent(v);
+ return u._end_date = u.end_date, u.end_date = new Date(u.start_date.valueOf() + 1e3 * u.event_length), e.showLightbox_rec(v);
};
if ((o || 1 * o == 0) && a.rec_type)
return h(n);
if (!o || o === "0" || !s.labels.confirm_recurring || _ == "instance" || _ == "series" && !l)
return this.showLightbox_rec(n);
if (_ == "ask") {
- var v = this;
- e.modalbox({ text: s.labels.confirm_recurring, title: s.labels.title_confirm_recurring, width: "500px", position: "middle", buttons: [s.labels.button_edit_series, s.labels.button_edit_occurrence, s.labels.icon_cancel], callback: function(u) {
- switch (+u) {
+ var m = this;
+ e.modalbox({ text: s.labels.confirm_recurring, title: s.labels.title_confirm_recurring, width: "500px", position: "middle", buttons: [s.labels.button_edit_series, s.labels.button_edit_occurrence, s.labels.icon_cancel], callback: function(v) {
+ switch (+v) {
case 0:
return h(o);
case 1:
- return v.showLightbox_rec(n);
+ return m.showLightbox_rec(n);
case 2:
return;
}
@@ -10039,50 +10061,50 @@ const gn = { active_links: function(e) {
l[h] = 1 * l[h] || 7;
l.sort();
}
- this.date[s] = function(v, u) {
- var f = Math.floor((u.valueOf() - v.valueOf()) / (864e5 * o));
- return f > 0 && v.setDate(v.getDate() + f * o), l && e.transpose_day_week(v, l, 1, o), v;
- }, this.date[a] = function(v, u) {
- var f = new Date(v.valueOf());
+ this.date[s] = function(m, v) {
+ var u = Math.floor((v.valueOf() - m.valueOf()) / (864e5 * o));
+ return u > 0 && m.setDate(m.getDate() + u * o), l && e.transpose_day_week(m, l, 1, o), m;
+ }, this.date[a] = function(m, v) {
+ var u = new Date(m.valueOf());
if (l)
- for (var c = 0; c < u; c++)
- e.transpose_day_week(f, l, 0, o);
+ for (var c = 0; c < v; c++)
+ e.transpose_day_week(u, l, 0, o);
else
- f.setDate(f.getDate() + u * o);
- return f;
+ u.setDate(u.getDate() + v * o);
+ return u;
};
} else
- _[0] != "month" && _[0] != "year" || (this.date[s] = function(v, u, f) {
- var c = Math.ceil((12 * u.getFullYear() + 1 * u.getMonth() + 1 - (12 * v.getFullYear() + 1 * v.getMonth() + 1)) / o - 1);
- return c >= 0 && (v.setDate(1), v.setMonth(v.getMonth() + c * o)), e.date[a](v, 0, f);
- }, this.date[a] = function(v, u, f, c) {
+ _[0] != "month" && _[0] != "year" || (this.date[s] = function(m, v, u) {
+ var c = Math.ceil((12 * v.getFullYear() + 1 * v.getMonth() + 1 - (12 * m.getFullYear() + 1 * m.getMonth() + 1)) / o - 1);
+ return c >= 0 && (m.setDate(1), m.setMonth(m.getMonth() + c * o)), e.date[a](m, 0, u);
+ }, this.date[a] = function(m, v, u, c) {
if (c ? c++ : c = 1, c > 12)
return null;
- var p = new Date(v.valueOf());
- p.setDate(1), p.setMonth(p.getMonth() + u * o);
- var m = p.getMonth(), g = p.getFullYear();
- p.setDate(f.start_date.getDate()), _[3] && e.date.day_week(p, _[2], _[3]);
+ var f = new Date(m.valueOf());
+ f.setDate(1), f.setMonth(f.getMonth() + v * o);
+ var p = f.getMonth(), g = f.getFullYear();
+ f.setDate(u.start_date.getDate()), _[3] && e.date.day_week(f, _[2], _[3]);
var y = e.config.recurring_overflow_instances;
- return p.getMonth() != m && y != "none" && (p = y === "lastDay" ? new Date(g, m + 1, 0, p.getHours(), p.getMinutes(), p.getSeconds(), p.getMilliseconds()) : e.date[a](new Date(g, m + 1, 0), u || 1, f, c)), p;
+ return f.getMonth() != p && y != "none" && (f = y === "lastDay" ? new Date(g, p + 1, 0, f.getHours(), f.getMinutes(), f.getSeconds(), f.getMilliseconds()) : e.date[a](new Date(g, p + 1, 0), v || 1, u, c)), f;
});
}
}, e.repeat_date = function(n, s, _, a, o, l) {
a = a || this._min_date, o = o || this._max_date;
- var h = l || -1, v = new Date(n.start_date.valueOf()), u = v.getHours(), f = 0;
- for (!n.rec_pattern && n.rec_type && (n.rec_pattern = n.rec_type.split("#")[0]), this.transpose_type(n.rec_pattern), v = e.date["transpose_" + n.rec_pattern](v, a, n); v && (v < n.start_date || e._fix_daylight_saving_date(v, a, n, v, new Date(v.valueOf() + 1e3 * n.event_length)).valueOf() <= a.valueOf() || v.valueOf() + 1e3 * n.event_length <= a.valueOf()); )
- v = this.date["add_" + n.rec_pattern](v, 1, n);
- for (; v && v < o && v < n.end_date && (h < 0 || f < h); ) {
- v.setHours(u);
- var c = e.config.occurrence_timestamp_in_utc ? Date.UTC(v.getFullYear(), v.getMonth(), v.getDate(), v.getHours(), v.getMinutes(), v.getSeconds()) : v.valueOf(), p = this._get_rec_marker(c, n.id);
- if (p)
- _ && (p.rec_type != "none" && f++, s.push(p));
+ var h = l || -1, m = new Date(n.start_date.valueOf()), v = m.getHours(), u = 0;
+ for (!n.rec_pattern && n.rec_type && (n.rec_pattern = n.rec_type.split("#")[0]), this.transpose_type(n.rec_pattern), m = e.date["transpose_" + n.rec_pattern](m, a, n); m && (m < n.start_date || e._fix_daylight_saving_date(m, a, n, m, new Date(m.valueOf() + 1e3 * n.event_length)).valueOf() <= a.valueOf() || m.valueOf() + 1e3 * n.event_length <= a.valueOf()); )
+ m = this.date["add_" + n.rec_pattern](m, 1, n);
+ for (; m && m < o && m < n.end_date && (h < 0 || u < h); ) {
+ m.setHours(v);
+ var c = e.config.occurrence_timestamp_in_utc ? Date.UTC(m.getFullYear(), m.getMonth(), m.getDate(), m.getHours(), m.getMinutes(), m.getSeconds()) : m.valueOf(), f = this._get_rec_marker(c, n.id);
+ if (f)
+ _ && (f.rec_type != "none" && u++, s.push(f));
else {
- var m = new Date(v.valueOf() + 1e3 * n.event_length), g = this._copy_event(n);
- if (g.text = n.text, g.start_date = v, g.event_pid = n.id, g.id = n.id + "#" + Math.round(c / 1e3), g.end_date = m, g.end_date = e._fix_daylight_saving_date(g.start_date, g.end_date, n, v, g.end_date), g._timed = this.isOneDayEvent(g), !g._timed && !this._table_view && !this.config.multi_day)
+ var p = new Date(m.valueOf() + 1e3 * n.event_length), g = this._copy_event(n);
+ if (g.text = n.text, g.start_date = m, g.event_pid = n.id, g.id = n.id + "#" + Math.round(c / 1e3), g.end_date = p, g.end_date = e._fix_daylight_saving_date(g.start_date, g.end_date, n, m, g.end_date), g._timed = this.isOneDayEvent(g), !g._timed && !this._table_view && !this.config.multi_day)
return;
- s.push(g), _ || (this._events[g.id] = g, this._rec_temp.push(g)), f++;
+ s.push(g), _ || (this._events[g.id] = g, this._rec_temp.push(g)), u++;
}
- v = this.date["add_" + n.rec_pattern](v, 1, n);
+ m = this.date["add_" + n.rec_pattern](m, 1, n);
}
}, e._fix_daylight_saving_date = function(n, s, _, a, o) {
var l = n.getTimezoneOffset() - s.getTimezoneOffset();
@@ -10230,10 +10252,10 @@ END:VCALENDAR`;
return !1;
}
}
- var v = ["date=" + r(o || _), "mode=" + (a || s)];
- d && v.push("event=" + d);
- var u = "#" + v.join(",");
- return document.location.hash = u, !0;
+ var m = ["date=" + r(o || _), "mode=" + (a || s)];
+ d && m.push("event=" + d);
+ var v = "#" + m.join(",");
+ return document.location.hash = v, !0;
});
});
}, week_agenda: function(e) {
@@ -10305,14 +10327,14 @@ END:VCALENDAR`;
}
});
}
- for (var v = this.getEvents(_, this.date.add(_, 1, "day")), u = "", f = 0; f < v.length; f++) {
- var c = v[f];
+ for (var m = this.getEvents(_, this.date.add(_, 1, "day")), v = "", u = 0; u < m.length; u++) {
+ var c = m[u];
if (this.filter_event(c.id, c)) {
- var p = c.color ? "--dhx-scheduler-event-background:" + c.color + ";" : "", m = c.textColor ? "--dhx-scheduler-event-color:" + c.textColor + ";" : "";
- u += "
";
+ var f = c.color ? "--dhx-scheduler-event-background:" + c.color + ";" : "", p = c.textColor ? "--dhx-scheduler-event-color:" + c.textColor + ";" : "";
+ v += "
";
}
}
- this._tooltip.style.display = "", this._tooltip.style.top = "0px", document.body.offsetWidth - a.left - this._tooltip.offsetWidth < 0 ? this._tooltip.style.left = a.left - this._tooltip.offsetWidth + "px" : this._tooltip.style.left = a.left + l.offsetWidth + "px", this._tooltip.date = _, this._tooltip.innerHTML = u, document.body.offsetHeight - a.top - this._tooltip.offsetHeight < 0 ? this._tooltip.style.top = a.top - this._tooltip.offsetHeight + l.offsetHeight + "px" : this._tooltip.style.top = a.top + "px";
+ this._tooltip.style.display = "", this._tooltip.style.top = "0px", document.body.offsetWidth - a.left - this._tooltip.offsetWidth < 0 ? this._tooltip.style.left = a.left - this._tooltip.offsetWidth + "px" : this._tooltip.style.left = a.left + l.offsetWidth + "px", this._tooltip.date = _, this._tooltip.innerHTML = v, document.body.offsetHeight - a.top - this._tooltip.offsetHeight < 0 ? this._tooltip.style.top = a.top - this._tooltip.offsetHeight + l.offsetHeight + "px" : this._tooltip.style.top = a.top + "px";
}, e._year_view_tooltip_handler = function(_) {
if (i()) {
var a = _.target || _.srcElement;
@@ -10353,26 +10375,26 @@ END:VCALENDAR`;
a.scrollTop = 0, a.innerHTML = "", Math.floor((parseInt(a.style.height) - e.xy.year_top) / o.year_y);
var l = document.createElement("div"), h = this.date.week_start(e._currentDate());
this._process_ignores(h, 7, "day", 1);
- for (var v = 0; v < 7; v++)
- this._ignores && this._ignores[v] || (this._cols[v] = "var(--dhx-scheduler-datepicker-cell-size)", this._render_x_header(v, 0, h, l)), h = this.date.add(h, 1, "day");
- for (l.lastChild.className += " dhx_scale_bar_last", v = 0; v < l.childNodes.length; v++)
- this._waiAria.yearHeadCell(l.childNodes[v]);
- var u = this.date[this._mode + "_start"](this.date.copy(this._date)), f = u, c = null;
- const p = document.createElement("div");
- for (p.classList.add("dhx_year_wrapper"), v = 0; v < o.year_y; v++)
- for (var m = 0; m < o.year_x; m++) {
- (c = document.createElement("div")).className = "dhx_year_box", c.setAttribute("date", this._helpers.formatDate(u)), c.setAttribute("data-month-date", this._helpers.formatDate(u)), c.innerHTML = "
";
+ for (var m = 0; m < 7; m++)
+ this._ignores && this._ignores[m] || (this._cols[m] = "var(--dhx-scheduler-datepicker-cell-size)", this._render_x_header(m, 0, h, l)), h = this.date.add(h, 1, "day");
+ for (l.lastChild.className += " dhx_scale_bar_last", m = 0; m < l.childNodes.length; m++)
+ this._waiAria.yearHeadCell(l.childNodes[m]);
+ var v = this.date[this._mode + "_start"](this.date.copy(this._date)), u = v, c = null;
+ const f = document.createElement("div");
+ for (f.classList.add("dhx_year_wrapper"), m = 0; m < o.year_y; m++)
+ for (var p = 0; p < o.year_x; p++) {
+ (c = document.createElement("div")).className = "dhx_year_box", c.setAttribute("date", this._helpers.formatDate(v)), c.setAttribute("data-month-date", this._helpers.formatDate(v)), c.innerHTML = "
";
var g = c.querySelector(".dhx_year_month"), y = c.querySelector(".dhx_year_grid"), x = c.querySelector(".dhx_year_body"), b = e.uid();
- this._waiAria.yearHeader(g, b), this._waiAria.yearGrid(y, b), g.innerHTML = this.templates.year_month(u);
- var k = this.date.week_start(u);
- this._reset_month_scale(x, u, k, 6);
- for (var E = x.querySelectorAll("td"), D = 0; D < E.length; D++)
- this._waiAria.yearDayCell(E[D]);
- p.appendChild(c), _[v * o.year_x + m] = (u.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7, u = this.date.add(u, 1, "month");
- }
- a.appendChild(p);
- var w = this._getNavDateElement();
- w && (w.innerHTML = this.templates[this._mode + "_date"](f, u, this._mode)), this.week_starts = _, _._month = f.getMonth(), this._min_date = f, this._max_date = u;
+ this._waiAria.yearHeader(g, b), this._waiAria.yearGrid(y, b), g.innerHTML = this.templates.year_month(v);
+ var k = this.date.week_start(v);
+ this._reset_month_scale(x, v, k, 6);
+ for (var w = x.querySelectorAll("td"), D = 0; D < w.length; D++)
+ this._waiAria.yearDayCell(w[D]);
+ f.appendChild(c), _[m * o.year_x + p] = (v.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7, v = this.date.add(v, 1, "month");
+ }
+ a.appendChild(f);
+ var E = this._getNavDateElement();
+ E && (E.innerHTML = this.templates[this._mode + "_date"](u, v, this._mode)), this.week_starts = _, _._month = u.getMonth(), this._min_date = u, this._max_date = v;
}, e._reset_year_scale = function() {
var _ = this._els.dhx_cal_data[0];
_.scrollTop = 0, _.innerHTML = "";
@@ -10381,18 +10403,18 @@ END:VCALENDAR`;
const o = document.createElement("div");
o.classList.add("dhx_year_wrapper");
let l = a;
- for (let u = 0; u < 12; u++) {
- let f = document.createElement("div");
- f.className = "dhx_year_box", f.setAttribute("date", this._helpers.formatDate(l)), f.setAttribute("data-month-date", this._helpers.formatDate(l)), f.innerHTML = `
${this.templates.year_month(l)}
+ for (let v = 0; v < 12; v++) {
+ let u = document.createElement("div");
+ u.className = "dhx_year_box", u.setAttribute("date", this._helpers.formatDate(l)), u.setAttribute("data-month-date", this._helpers.formatDate(l)), u.innerHTML = `
${this.templates.year_month(l)}
`;
- const c = f.querySelector(".dhx_year_grid"), p = e._createDatePicker(null, { date: l, minWeeks: 6 });
- p._renderDayGrid(c), p.destructor(), o.appendChild(f), l = this.date.add(l, 1, "month");
+ const c = u.querySelector(".dhx_year_grid"), f = e._createDatePicker(null, { date: l, filterDays: e.ignore_year, minWeeks: 6 });
+ f._renderDayGrid(c), f.destructor(), o.appendChild(u), l = this.date.add(l, 1, "month");
}
_.appendChild(o);
let h = this.date.add(a, 1, "year");
h.valueOf() != this.date.week_start(new Date(h)).valueOf() && (h = this.date.week_start(new Date(h)), h = this.date.add(h, 1, "week")), this._max_date = h;
- var v = this._getNavDateElement();
- v && (v.innerHTML = this.templates[this._mode + "_date"](a, h, this._mode));
+ var m = this._getNavDateElement();
+ m && (m.innerHTML = this.templates[this._mode + "_date"](a, h, this._mode));
};
var n = e.getActionData;
e.getActionData = function(_) {
diff --git a/codebase/dhtmlxscheduler.es.js.map b/codebase/dhtmlxscheduler.es.js.map
index 2e812a8..ae76ba8 100644
--- a/codebase/dhtmlxscheduler.es.js.map
+++ b/codebase/dhtmlxscheduler.es.js.map
@@ -1 +1 @@
-{"version":3,"file":"dhtmlxscheduler.es.js","sources":["../sources/global.js","../sources/plugins/drag_highlight_pos.js","../sources/plugins/limit.js","../sources/plugins/batch_update.js","../sources/plugins/index.js","../sources/plugins/undo_delete.js","../sources/core/utils/utils.js","../sources/core/nav_bar.js","../sources/core/scheduler_resize_listener.js","../sources/utils/eventable.js","../sources/core/utils/event.js","../sources/core/common.js","../sources/core/utils/scoped_event.js","../sources/core/utils/dom_helpers.js","../sources/utils/env.js","../sources/core/common/url_serialize.js","../sources/core/base.js","../sources/core/common/get_serializable_events.js","../sources/core/load.js","../sources/core/loaders/xml.js","../sources/core/loaders/json.js","../sources/core/loaders/ical.js","../sources/core/touch.js","../sources/core/skins.js","../sources/core/dataprocessor/dataprocessor_hooks.js","../sources/core/dataprocessor/dataprocessor.js","../sources/core/message.js","../sources/locale/locale_ar.js","../sources/locale/locale_be.js","../sources/locale/locale_ca.js","../sources/locale/locale_cn.js","../sources/locale/locale_cs.js","../sources/locale/locale_da.js","../sources/locale/locale_de.js","../sources/locale/locale_el.js","../sources/locale/locale_en.js","../sources/locale/locale_es.js","../sources/locale/locale_fi.js","../sources/locale/locale_fr.js","../sources/locale/locale_he.js","../sources/locale/locale_hu.js","../sources/locale/locale_id.js","../sources/locale/locale_it.js","../sources/locale/locale_jp.js","../sources/locale/locale_manager.js","../sources/locale/locale_nb.js","../sources/locale/locale_nl.js","../sources/locale/locale_no.js","../sources/locale/locale_pl.js","../sources/locale/locale_pt.js","../sources/locale/locale_ro.js","../sources/locale/locale_ru.js","../sources/locale/locale_si.js","../sources/locale/locale_sk.js","../sources/locale/locale_sv.js","../sources/locale/locale_tr.js","../sources/locale/locale_ua.js","../sources/core/datepicker.js","../sources/scheduler_factory_method.js","../sources/core/state.js","../sources/core/common_errors.js","../sources/core/scheduler.js","../sources/core/wai_aria.js","../sources/core/common/assert.js","../sources/core/jquery.js","../sources/core/destructor.js","../sources/core/utils/ajax.js","../sources/core/config.js","../sources/core/event.js","../sources/core/event_highlight.js","../sources/core/lightbox.js","../sources/core/dhtmlx/dhtmlx_suite_hooks.js","../sources/core/delay_render.js","../sources/core/connector.js","../sources/locale/index.js","../sources/ext/extension_manager.js","../sources/dhtmlx_hook.js","../sources/ext/restricted_extensions/not_implemented_extension.js","../sources/ext/keyboard_navigation/modals.js","../sources/ext/keyboard_navigation/key_nav_legacy.js","../sources/ext/keyboard_navigation/scheduler_handlers.js","../sources/ext/map_view/gMapAdapter.ts","../sources/ext/map_view/osmMapAdapter.ts","../sources/ext/map_view/mapboxAdapter.ts","../node_modules/rrule/dist/esm/weekday.js","../node_modules/rrule/dist/esm/helpers.js","../node_modules/rrule/dist/esm/dateutil.js","../node_modules/rrule/dist/esm/iterresult.js","../node_modules/rrule/node_modules/tslib/tslib.es6.mjs","../node_modules/rrule/dist/esm/callbackiterresult.js","../node_modules/rrule/dist/esm/types.js","../node_modules/rrule/dist/esm/nlp/i18n.js","../node_modules/rrule/dist/esm/nlp/totext.js","../node_modules/rrule/dist/esm/nlp/parsetext.js","../node_modules/rrule/dist/esm/nlp/index.js","../node_modules/rrule/dist/esm/datetime.js","../node_modules/rrule/dist/esm/parseoptions.js","../node_modules/rrule/dist/esm/parsestring.js","../node_modules/rrule/dist/esm/datewithzone.js","../node_modules/rrule/dist/esm/optionstostring.js","../node_modules/rrule/dist/esm/cache.js","../node_modules/rrule/dist/esm/masks.js","../node_modules/rrule/dist/esm/iterinfo/yearinfo.js","../node_modules/rrule/dist/esm/iterinfo/index.js","../node_modules/rrule/dist/esm/iterinfo/monthinfo.js","../node_modules/rrule/dist/esm/iterinfo/easter.js","../node_modules/rrule/dist/esm/iter/poslist.js","../node_modules/rrule/dist/esm/iter/index.js","../node_modules/rrule/dist/esm/rrule.js","../node_modules/rrule/dist/esm/rrulestr.js","../node_modules/rrule/dist/esm/rruleset.js","../node_modules/rrule/dist/esm/iterset.js","../sources/ext/tooltip/tooltip.ts","../sources/ext/tooltip/tooltipManager.ts","../sources/ext/extensions_gpl.js","../sources/ext/active_links.js","../sources/ext/agenda_legacy_view.js","../sources/ext/agenda.js","../sources/ext/all_timed.js","../sources/ext/collision.js","../sources/ext/container_autoresize.js","../sources/ext/cookie.js","../sources/ext/restricted_extensions/daytimeline.js","../sources/ext/restricted_extensions/drag_between.js","../sources/ext/editors.js","../sources/ext/expand.js","../sources/ext/export_api/index.js","../sources/ext/restricted_extensions/grid_view.js","../sources/ext/html_templates.js","../sources/ext/key_nav.js","../sources/ext/keyboard_navigation/common/keyboard_shortcuts.js","../sources/ext/keyboard_navigation/common/eventhandler.js","../sources/ext/keyboard_navigation/common/trap_modal_focus.js","../sources/ext/keyboard_navigation/marker.js","../sources/ext/keyboard_navigation/elements/scheduler_node.js","../sources/ext/keyboard_navigation/elements/nav_node.js","../sources/ext/keyboard_navigation/elements/header_cell.js","../sources/ext/keyboard_navigation/elements/event.js","../sources/ext/keyboard_navigation/elements/time_slot.js","../sources/ext/keyboard_navigation/elements/minical_button.js","../sources/ext/keyboard_navigation/elements/minical_cell.js","../sources/ext/keyboard_navigation/elements/data_area.js","../sources/ext/keyboard_navigation/core.js","../sources/ext/keyboard_navigation/minical_handlers.js","../sources/ext/layer.js","../sources/ext/limit.js","../sources/ext/map_view/index.ts","../sources/ext/minical.js","../sources/ext/monthheight.js","../sources/ext/restricted_extensions/multisection.js","../sources/ext/multiselect.js","../sources/ext/multisource.js","../sources/ext/mvc.js","../sources/ext/outerdrag.js","../sources/ext/pdf.js","../sources/ext/quick_info.js","../sources/ext/readonly.js","../sources/ext/recurring.js","../sources/ext/recurring_legacy.js","../sources/ext/serialize.js","../sources/ext/restricted_extensions/timeline.js","../sources/ext/tooltip/index.ts","../sources/ext/restricted_extensions/treetimeline.js","../sources/ext/restricted_extensions/units.js","../sources/ext/url.js","../sources/ext/restricted_extensions/week_agenda.js","../sources/ext/wp.js","../sources/ext/year_view.js","../sources/dhtmlxscheduler.gpl.js","../sources/scheduler_factory.js"],"sourcesContent":["\r\n/* eslint-disable no-restricted-globals */\r\nvar globalScope;\r\nif(typeof window !== \"undefined\"){\r\n\tglobalScope = window;\r\n}else{\r\n\tglobalScope = global;\r\n}\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default globalScope;","export default function dragHighlightPos(scheduler){\r\n let dndMarkers = [];\r\n let dragStarted = false;\r\n let eventNode = null;\r\n let event = null;\r\n\r\n function isEnabled() { \r\n return scheduler.config.drag_highlight && scheduler.markTimespan;\r\n }\r\n\r\n function checkViewName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj){\r\n return viewObj.layout;\r\n }\r\n return viewName;\r\n }\r\n\r\n function checkSectionPropertyName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj.y_property){\r\n return viewObj.y_property;\r\n }\r\n if(viewObj.map_to){\r\n return viewObj.map_to;\r\n }\r\n }\r\n\r\n function setRequiredStylesToMarker(eventNode, layout){\r\n switch (layout) {\r\n case \"month\":\r\n eventNode.style.top = \"\";\r\n eventNode.style.left = \"\";\r\n break;\r\n case \"timeline\":\r\n eventNode.style.left = \"\";\r\n eventNode.style.marginLeft = \"1px\";\r\n break;\r\n default:\r\n eventNode.style.top = \"\";\r\n break;\r\n }\r\n }\r\n \r\n function createMarkerConfig(configSettings){\r\n const { event, layout, viewName, sectionId, eventNode } = configSettings;\r\n setRequiredStylesToMarker(eventNode, layout);\r\n const sections = {};\r\n let markerObject = {\r\n start_date: event.start_date,\r\n end_date: event.end_date,\r\n css: \"dhx_scheduler_dnd_marker\",\r\n html: eventNode\r\n };\r\n if (layout == \"timeline\" || layout == \"month\" ){\r\n // we need to set end date less than 24 hours of the views to avoid receiving multiple marktimespans\r\n markerObject = {...markerObject, end_date: scheduler.date.add(event.start_date, 1, 'minute')};\r\n }\r\n if (sectionId){\r\n sections[viewName] = sectionId;\r\n markerObject.sections = sections;\r\n }\r\n return markerObject;\r\n }\r\n\r\n function createViewMarker(settings){\r\n const { layout } = settings;\r\n let markerConfigs;\r\n switch (layout) {\r\n case \"month\": \r\n markerConfigs = getMonthViewMarkers(settings);\r\n break;\r\n case 'timeline':\r\n case 'units':\r\n markerConfigs = getTimelineAndUnitsViewMarkers(settings);\r\n break;\r\n default: \r\n markerConfigs = getColumnViewMarkers(settings);\r\n break;\r\n }\r\n markerConfigs.forEach((cfg) => {\r\n dndMarkers.push(scheduler.markTimespan(cfg));\r\n });\r\n }\r\n\r\n function getColumnViewMarkers(settings){\r\n const {event, layout, viewName, sectionId} = settings;\r\n let columnViewMarkersArray = [];\r\n let eventNodes = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`);\r\n if(eventNodes){\r\n for (let i = 0; i < eventNodes.length; i++) {\r\n let eventNodeClone = eventNodes[i].cloneNode(true);\r\n let startDate = new Date(+eventNodeClone.getAttribute(\"data-bar-start\"));\r\n let endDate = new Date(+eventNodeClone.getAttribute(\"data-bar-end\"));\r\n let dates = {start_date: startDate, end_date: endDate};\r\n const configSettings = {\r\n event: dates, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode:eventNodeClone\r\n };\r\n columnViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\t\r\n }\r\n return columnViewMarkersArray;\r\n }\r\n\r\n function getMonthViewMarkers(settings){\r\n let monthViewMarkersArray = [];\r\n const {event, layout, viewName, sectionId} = settings;\r\n const weekDates = [];\r\n let currDate = new Date(event.start_date);\r\n while(currDate.valueOf() < event.end_date.valueOf()){\r\n let obj = {start_date: currDate};\r\n weekDates.push(obj);\r\n currDate = scheduler.date.week_start(scheduler.date.add(currDate, 1, \"week\"));\r\n }\r\n let cells = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']`);\r\n for (let i = 0; i < cells.length; i++) {\r\n const configSettings = {\r\n event: weekDates[i], \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode: cells[i].cloneNode(true)\r\n };\r\n monthViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n return monthViewMarkersArray;\r\n }\r\n\r\n function getTimelineAndUnitsViewMarkers(settings){\r\n let unitMarkersArray = [];\r\n const {event, layout, viewName, eventNode} = settings;\r\n let sectionPropertyName = checkSectionPropertyName(viewName);\r\n if (scheduler.config.multisection && sectionPropertyName){\r\n const sections = String(event[sectionPropertyName]).split(scheduler.config.section_delimiter);\r\n const formatedSections = sections.map(element => String(element));\r\n const elems = [];\r\n for (let i = 0; i < formatedSections.length; i++) {\r\n elems[i] = eventNode.cloneNode(true);\r\n const configSettings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId: formatedSections[i],\r\n eventNode: elems[i]\r\n };\r\n unitMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n }\r\n return unitMarkersArray;\r\n }\r\n \r\n scheduler.attachEvent(\"onBeforeDrag\", function (id, mode, e){\r\n if (isEnabled()) {\r\n dragStarted = true;\r\n event = scheduler.getEvent(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n // to avoid incorrect eventNode and marker creation when scheduler.config.cascade_event_display included\r\n if (layout == \"units\" && scheduler.config.cascade_event_display ) {\r\n scheduler.unselect(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n }\r\n }\r\n return true;\r\n });\r\n\r\n scheduler.attachEvent(\"onEventDrag\", function (id, mode, e){\r\n if(dragStarted && isEnabled()){\r\n dragStarted = false;// insert element only once after dnd start\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n const sectionId = scheduler.getActionData(e).section;\r\n if (event) {\r\n const settings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode\r\n };\r\n createViewMarker(settings);\r\n }\r\n }\r\n });\r\n\r\n scheduler.attachEvent(\"onDragEnd\", function(id, mode, e){\r\n for (let i = 0; i < dndMarkers.length; i++) {\r\n scheduler.unmarkTimespan(dndMarkers[i]);\r\n }\r\n dndMarkers = [];\r\n eventNode = null;\r\n event = null;\r\n });\r\n}","export default function limitPlugin(scheduler){\r\n\r\n\r\n\tscheduler.config.mark_now = true;\r\n\tscheduler.config.display_marked_timespans = true;\r\n\tscheduler.config.overwrite_marked_timespans = true;\r\n\r\n\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\tvar default_timespan_type = \"default\";\r\n\tvar fix_options = function(options, days, zones) {\r\n\t\tif (days instanceof Date && zones instanceof Date) {\r\n\t\t\toptions.start_date = days;\r\n\t\t\toptions.end_date = zones;\r\n\t\t} else {\r\n\t\t\toptions.days = days;\r\n\t\t\toptions.zones = zones;\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tvar get_resulting_options = function(days, zones, sections) {\r\n\t\tvar options = (typeof days == \"object\") ? days : { days: days };\r\n\t\toptions.type = dhx_time_block;\r\n\t\toptions.css = \"\";\r\n\t\tif (zones) {\r\n\t\t\tif (sections)\r\n\t\t\t\toptions.sections = sections;\r\n\t\t\toptions = fix_options(options, days, zones);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tscheduler.blockTime = function(days, zones, sections){\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.addMarkedTimespan(options);\r\n\t};\r\n\tscheduler.unblockTime = function(days, zones, sections) {\r\n\t\tzones = zones || \"fullday\";\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.deleteMarkedTimespan(options);\r\n\t};\r\n\r\n\tscheduler.checkInMarkedTimespan = function(ev, timespan_type, on_overlap){\r\n\t\ttimespan_type = timespan_type || default_timespan_type;\r\n\r\n\t\tvar res = true;\r\n\t\tvar temp_start_date = new Date(ev.start_date.valueOf());\r\n\t\tvar temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\");\r\n\t\tvar timespans = scheduler._marked_timespans;\r\n\t\tfor (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\") ) {\r\n\t\t\tvar day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part\r\n\t\t\tvar day_index = temp_start_date.getDay();\r\n\r\n\t\t\tvar zones = getZones(ev, timespans, day_index, day_value, timespan_type);\r\n\t\t\tif (zones){\r\n\t\t\t\tfor (var i = 0; i < zones.length; i+=2) {\r\n\r\n\t\t\t\t\t// they may change for new event if it passes limit zone\r\n\t\t\t\t\tvar eventStart = scheduler._get_zone_minutes(temp_start_date);\r\n\t\t\t\t\tvar eventEnd = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);\r\n\r\n\t\t\t\t\tvar markerStart = zones[i];\r\n\t\t\t\t\tvar markerEnd = zones[i+1];\r\n\t\t\t\t\tif (markerStart
eventStart) {\r\n\t\t\t\t\t\tif(typeof on_overlap == \"function\"){\r\n\t\t\t\t\t\t\t//handler allows to cancel overlapping\r\n\t\t\t\t\t\t\t//actually needed only to keep default behavior of limits\r\n\t\t\t\t\t\t\tres = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd);//event object, event start/end minutes in 'zones' format, zone start/end minutes\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tres = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!res)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn !res;\r\n\t};\r\n\tscheduler.checkLimitViolation = function(event){\r\n\t\tif(!event)\r\n\t\t\treturn true;\r\n\t\tif (!scheduler.config.check_limits)\r\n\t\t\treturn true;\r\n\t\tvar s = scheduler;\r\n\t\tvar c = s.config;\r\n\t\tvar evs = [];\r\n\t\tif ((event.rec_type && event._end_date) || (event.rrule)) {\r\n\t\t\tconst seriesEnd = event._end_date || event.end_date;\r\n\t\t\t// GS-2482 need to take into account that a part of recurring events might be outside the limits\r\n\t\t\tif ((c.limit_start && c.limit_end)) {\r\n\t\t\t\tvar recEventInLimits = seriesEnd.valueOf() >= c.limit_start.valueOf() && event.start_date.valueOf() <= c.limit_end.valueOf();\r\n\t\t\t\treturn recEventInLimits;\r\n\t\t\t} else return true;\r\n\t\t} else {\r\n\t\t\tevs = [event];\r\n\t\t}\r\n\r\n\t\tvar complete_res = true;\r\n\t\tfor (var p=0; p= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;\r\n\t\t\tif (res){\r\n\t\t\t\tres = !scheduler.checkInMarkedTimespan(ev, dhx_time_block, function(event, eventStart, eventEnd, markerStart, markerEnd){\r\n\t\t\t\t\t//try crop event to allow placing\r\n\t\t\t\t\tvar allow = true;\r\n\t\t\t\t\tif (eventStart<=markerEnd && eventStart >= markerStart){\r\n\t\t\t\t\t\tif (markerEnd == 24*60 || eventEnd <= markerEnd){\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.start_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.start_date.setMinutes(markerEnd);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ((eventEnd >= markerStart && eventEnd <= markerEnd) || (eventStart < markerStart && eventEnd > markerEnd)){\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.end_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.end_date.setMinutes(markerStart);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn allow;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!res) {\r\n\t\t\t\tres = (s.checkEvent(\"onLimitViolation\")) ? s.callEvent(\"onLimitViolation\",[ev.id, ev]) : res;\r\n\t\t\t}\r\n\t\t\tcomplete_res = complete_res && res;\r\n\t\t}\r\n\t\tif(!complete_res){\r\n\t\t\ts._drag_id = null;\r\n\t\t\ts._drag_mode = null;\r\n\t\t}\r\n\t\treturn complete_res;\r\n\r\n\r\n\t};\r\n\tscheduler._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type){\r\n\t\tvar zones =[];\r\n\t\tif (timespans && timespans[property]) {\r\n\t\t\tvar timeline_zones = timespans[property];\r\n\t\t\tvar blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type);\r\n\t\t\tfor (var i=0; i this._min_date && now.getHours() >= cfg.first_hour && now.getHours() 1) {\r\n\t\t\t\t\tif(view.size && view.options.length){\r\n\t\t\t\t\t\tday_index = ((view.position+ day_index) / view.options.length) * view.size;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_index = day_index;\r\n\t\t\t\t\tend_index = day_index + units_l;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstart_index = 0;\r\n\t\t\t\t\tend_index = start_index + units_l;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar r_divs = [];\r\n\r\n\t\t\t\tfor (var i = start_index; i < end_index; i++) {\r\n\t\t\t\t\tvar t_day = i; // as each unit is actually considered +1 day\r\n\t\t\t\t\toptions.days = t_day;\r\n\t\t\t\t\tvar t_div = scheduler._render_marked_timespan(options, null, t_day)[0];\r\n\t\t\t\t\tr_divs.push(t_div);\r\n\t\t\t\t}\r\n\t\t\t\treturn r_divs;\r\n\t\t\t} else { // day/week views\r\n\t\t\t\toptions.days = day_index;\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, day_index);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\toptions.days = +scheduler.date.date_part(now);\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, null);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tscheduler._remove_mark_now = function() {\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tvar els = this._els[dhx_now_time];\r\n\t\tfor (var i=0; i config.start_date) || (config.days !== undefined && config.zones)) && !config.type )\r\n\t\t\treturn r_configs; // incorrect config was provided\r\n\r\n\t\tvar min = 0;\r\n\t\tvar max = 24*60;\r\n\t\tif (config.zones == \"fullday\")\r\n\t\t\tconfig.zones = [min, max];\r\n\t\tif (config.zones && config.invert_zones) {\r\n\t\t\tconfig.zones = scheduler.invertZones(config.zones);\r\n\t\t}\r\n\r\n\t\tconfig.id = scheduler.uid();\r\n\t\tconfig.css = config.css||\"\";\r\n\t\tconfig.type = config.type||default_timespan_type;\r\n\r\n\t\tvar sections = config.sections;\r\n\t\tif (sections) {\r\n\t\t\tfor (var view_key in sections) {\r\n\t\t\t\tif (sections.hasOwnProperty(view_key)) {\r\n\t\t\t\t\tvar ids = sections[view_key];\r\n\t\t\t\t\tif (!(ids instanceof Array))\r\n\t\t\t\t\t\tids = [ids];\r\n\t\t\t\t\tfor (var i=0; i t_sd) ? scheduler._get_zone_minutes(start_date) : min;\r\n\t\t\t\t\tvar zone_end = ( end_date > t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);\r\n\t\t\t\t\tt_config.zones = [zone_start, zone_end];\r\n\t\t\t\t\tr_configs.push(t_config);\r\n\r\n\t\t\t\t\tt_sd = t_ed;\r\n\t\t\t\t\tt_ed = scheduler.date.add(t_ed, 1, \"day\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (c_config.days instanceof Date)\r\n\t\t\t\t\tc_config.days = (scheduler.date.date_part(c_config.days)).valueOf();\r\n\t\t\t\tc_config.zones = config.zones.slice();\r\n\t\t\t\tr_configs.push(c_config);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r_configs;\r\n\t};\r\n\tscheduler._get_dates_by_index = function(index, start, end) {\r\n\t\tvar dates = [];\r\n\t\tstart = scheduler.date.date_part(new Date(start||scheduler._min_date));\r\n\t\tend = new Date(end||scheduler._max_date);\r\n\t\tvar start_day = start.getDay();\r\n\t\tvar delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);\r\n\t\tvar t_date = scheduler.date.add(start, delta, \"day\");\r\n\t\tfor (; t_date < end; t_date = scheduler.date.add(t_date, 1, \"week\")) {\r\n\t\t\tdates.push(t_date);\r\n\t\t}\r\n\t\treturn dates;\r\n\t};\r\n\tscheduler._get_css_classes_by_config = function(config) {\r\n\t\tvar css_classes = [];\r\n\t\tif (config.type == dhx_time_block) {\r\n\t\t\tcss_classes.push(dhx_time_block);\r\n\t\t\tif (config.css)\r\n\t\t\t\tcss_classes.push(dhx_time_block+\"_reset\");\r\n\t\t}\r\n\t\tcss_classes.push(\"dhx_marked_timespan\", config.css);\r\n\t\treturn css_classes.join(\" \");\r\n\t};\r\n\tscheduler._get_block_by_config = function(config) {\r\n\t\tvar block = document.createElement(\"div\");\r\n\t\tif (config.html) {\r\n\t\t\tif (typeof config.html == \"string\")\r\n\t\t\t\tblock.innerHTML = config.html;\r\n\t\t\telse\r\n\t\t\t\tblock.appendChild(config.html);\r\n\t\t}\r\n\t\treturn block;\r\n\t};\r\n\tscheduler._render_marked_timespan = function(options, area, day) {\r\n\t\tvar blocks = []; // resulting block which will be rendered and returned\r\n\t\tvar c = scheduler.config;\r\n\t\tvar min_date = this._min_date;\r\n\t\tvar max_date = this._max_date;\r\n\t\tvar day_value = false; // if timespan for specific date should be displayed\r\n\r\n\t\tif (!c.display_marked_timespans)\r\n\t\t\treturn blocks;\r\n\r\n\t\t// in case of markTimespan\r\n\t\tif (!day && day !== 0) {\r\n\t\t\tif (options.days < 7)\r\n\t\t\t\tday = options.days;\r\n\t\t\telse {\r\n\t\t\t\tvar date_to_display = new Date(options.days);\r\n\t\t\t\tday_value = +date_to_display;\r\n\r\n\t\t\t\t// in case of markTimespan date could be not in the viewing range, need to return\r\n\t\t\t\tif ( !(+max_date > +date_to_display && +min_date <= +date_to_display) )\r\n\t\t\t\t\treturn blocks;\r\n\r\n\t\t\t\tday = date_to_display.getDay();\r\n\t\t\t}\r\n\r\n\t\t\t// convert day default index (Sun - 0, Sat - 6) to index of hourscales (depends on week_start and config.start_on_monday)\r\n\t\t\tvar min_day = min_date.getDay();\r\n\t\t\tif (min_day > day) {\r\n\t\t\t\tday = 7 - (min_day-day);\r\n\t\t\t} else {\r\n\t\t\t\tday = day - min_day;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar zones = options.zones;\r\n\t\tvar css_classes = scheduler._get_css_classes_by_config(options);\r\n\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\") {\r\n\t\t\tvar areas = [];\r\n\t\t\tvar days = [];\r\n\r\n\r\n\t\t\tif (!area) {\r\n\t\t\t\tdays = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);\r\n\t\t\t\tfor (var i=0; i < days.length; i++) {\r\n\t\t\t\t\tareas.push( this._scales[days[i]] );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tareas.push(area);\r\n\t\t\t\tdays.push(day);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i=0; i < areas.length; i++) {\r\n\t\t\t\tarea = areas[i];\r\n\t\t\t\tday = days[i];\r\n\r\n\t\t\t\tvar sday = this.locate_holder_day(day, false) % this._cols.length;\r\n\r\n\t\t\t\tif(this._ignores[sday]) continue;\r\n\r\n\t\t\t\tvar block_proto = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock_proto.className = css_classes;\r\n\t\t\t\tblock_proto.style.top = \"0px\";\r\n\t\t\t\tblock_proto.style.height = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tfor (var k=0; k < zones.length; k+=2) {\r\n\t\t\t\t\tvar start = zones[i];\r\n\t\t\t\t\tvar end = zones[i+1];\r\n\t\t\t\t\tif (end <= start)\r\n\t\t\t\t\t\treturn [];\r\n\r\n\t\t\t\t\tvar block = block_proto.cloneNode(true);\r\n\r\n\t\t\t\t\tblock.style.left = \"0px\";\r\n\t\t\t\t\tblock.style.width = \"100%\";\r\n\r\n\t\t\t\t\tarea.appendChild(block);\r\n\t\t\t\t\tblocks.push(block);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar index = day;\r\n\r\n\t\t\tif(this._ignores[this.locate_holder_day(day, false)]) return blocks;\r\n\r\n\t\t\tif (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {\r\n\t\t\t\tvar view = this._props[this._mode];\r\n\t\t\t\tindex = view.order[options.sections[this._mode]];\r\n\r\n\t\t\t\tvar inner_index = view.order[options.sections[this._mode]];\r\n\t\t\t\tif(!(view.days > 1)){\r\n\t\t\t\t\tindex = inner_index;\r\n\t\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\t\tindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar units_l = view.size || view.options.length;\r\n\t\t\t\t\tindex = index*units_l + inner_index;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarea = area ? area : scheduler.locate_holder(index);\r\n\r\n\t\t\tfor (var i = 0; i < zones.length; i+=2){\r\n\t\t\t\tvar start = Math.max(zones[i], c.first_hour*60);\r\n\t\t\t\tvar end = Math.min(zones[i+1], c.last_hour*60);\r\n\t\t\t\tif (end <= start) {\r\n\t\t\t\t\tif (i+2 < zones.length)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar block = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock.className = css_classes;\r\n\r\n\t\t\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\t\t\tvar all_hours_height = this.config.hour_size_px*24 + 1;\r\n\t\t\t\tvar hour_ms = 60*60*1000;\r\n\t\t\t\tblock.style.top = (Math.round((start*60*1000-this.config.first_hour*hour_ms)*this.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\t\t\tblock.style.height = Math.max((Math.round(((end-start)*60*1000)*this.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\r\n\t\t\t\tarea.appendChild(block);\r\n\t\t\t\tblocks.push(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn blocks;\r\n\t};\r\n\r\n\tscheduler._mark_timespans = function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tvar divs = [];\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\"){\r\n\t\t\tfor (var day in this._scales) {\r\n\t\t\t\tvar date = new Date(+day);\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(this._scales[day],date));\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t//manually trigger rendering of configs for each column\r\n\t\t\tvar date = new Date(scheduler._min_date);\r\n\t\t\tfor (var i = 0, len = data.childNodes.length; i < len; i++) {\r\n\t\t\t\tvar area = data.childNodes[i];\r\n\t\t\t\tif (area.firstChild && scheduler._getClassName(area.firstChild).indexOf(\"dhx_scale_hour\") > -1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(area, date));\r\n\t\t\t\tdate = scheduler.date.add(date, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn divs;\r\n\t};\r\n\r\n\t// just marks timespan, will be cleaned after refresh\r\n\tscheduler.markTimespan = function(configuration) {\r\n\t\tif(!this._els){\r\n\t\t\tthrow new Error(\"`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.\");\r\n\t\t}\r\n\r\n\r\n\t\tvar rebuild_els = false;\r\n\t\tif(!this._els[\"dhx_cal_data\"]){\r\n\t\t\tscheduler.get_elements();\r\n\t\t\trebuild_els = true;\r\n\t\t}\r\n\r\n\r\n\t\t// backup regular marked timespans\r\n\t\tvar timespans_ids = scheduler._marked_timespans_ids,\r\n\t\t\ttimespan_types = scheduler._marked_timespans_types,\r\n\t\t\ttimespans = scheduler._marked_timespans;\r\n\r\n\t\tscheduler.deleteMarkedTimespan();\r\n\r\n\t\t//add block to configs\r\n\t\tscheduler.addMarkedTimespan(configuration);\r\n\r\n\t\tvar divs = scheduler._mark_timespans();\r\n\r\n\t\tif(rebuild_els)\r\n\t\t\tscheduler._els = [];\r\n\r\n\t\t// restore timespan config\r\n\t\tscheduler._marked_timespans_ids = timespans_ids;\r\n\t\tscheduler._marked_timespans_types = timespan_types;\r\n\t\tscheduler._marked_timespans = timespans;\r\n\r\n\t\treturn divs;\r\n\t};\r\n\tscheduler.unmarkTimespan = function(divs) {\r\n\t\tif (!divs)\r\n\t\t\treturn;\r\n\t\tfor (var i=0; i c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {\r\n\t\t\t\t\tresulting_zones[i] = Math.min(c_zone_start, zone_start);\r\n\t\t\t\t\tresulting_zones[i+1] = Math.max(c_zone_end, zone_end);\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!isLast) // do nothing, maybe next current zone will match or will be last\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tvar offset = (c_zone_start > zone_start)?0:2;\r\n\t\t\t\t\tresulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another\r\n\t\t\t\t}\r\n\t\t\t\tzones.splice(k--,2); // zone was merged or added, need to exclude it\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler._subtract_timespan_zones = function(current_zones, zones) {\r\n\t\tvar resulting_zones = current_zones.slice();\r\n\t\tfor (var i=0; i c_zone_start && zone_start < c_zone_end) {\r\n\t\t\t\t\tvar is_modified = false;\r\n\t\t\t\t\tif (c_zone_start >= zone_start && c_zone_end <= zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_start < zone_start) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2, c_zone_start, zone_start);\r\n\t\t\t\t\t\tis_modified = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_end > zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler.invertZones = function(zones) {\r\n\t\treturn scheduler._subtract_timespan_zones([0, 1440], zones.slice());\r\n\t};\r\n\tscheduler._delete_marked_timespan_by_id = function(id) {\r\n\t\tvar configs = scheduler._marked_timespans_ids[id];\r\n\t\tif (configs) {\r\n\t\t\tfor (var i=0; i 1)){\r\n\t\t\t\tday = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls\r\n\t\t\t}else{\r\n\t\t\t\tvar dx = 24*60*60*1000;\r\n\t\t\t\tvar day_ind = Math.round((day - scheduler._min_date)/dx);\r\n\t\t\t\tvar unitsPerDay = view.size || units.length;\r\n\t\t\t\tday = scheduler.date.add(scheduler._min_date, Math.floor(day_ind/unitsPerDay), \"day\"); // to the \"same\" day for all sections\r\n\t\t\t\tday = scheduler.date.date_part(day);\r\n\t\t\t}\r\n\t\t\tday_index = day.getDay();\r\n\t\t\tday_value = day.valueOf();\r\n\r\n\t\t\tif (timespans[mode] && timespans[mode][unit.key]) {\r\n\t\t\t\tvar unit_zones = timespans[mode][unit.key];\r\n\t\t\t\tvar unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar global_data = timespans[\"global\"];\r\n\r\n\t\tif(scheduler.config.overwrite_marked_timespans){\r\n\t\t\tvar day_types = global_data[day_value]||global_data[day_index];\r\n\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));\r\n\t\t} else {\r\n\t\t\tif(global_data[day_value]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_value]));\r\n\t\t\t}\r\n\t\t\tif(global_data[day_index]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_index]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i=0; i {\r\n\t\t\tif(date){\r\n\t\t\t\tcalls.setModeDate.date = date;\r\n\t\t\t}\r\n\t\t\tif(mode){\r\n\t\t\t\tcalls.setModeDate.mode = mode;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar methods = {\r\n\t\t\trender:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tsetCurrentView:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tupdateView:(date, mode) => {calls.needUpdateView = true; rememberModeDate(date, mode);},\r\n\t\t\trender_data:() => calls.needRender = true,\r\n\t\t\trender_view_data:(evs) => { \r\n\t\t\t\tif(evs && evs.length){\r\n\t\t\t\t\tevs.forEach((e) => calls.repaintEvents[e.id] = true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcalls.needRender = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tdisableMethods.call(this, methods);\r\n\r\n\t\tisActive = true;\r\n\t\tthis.callEvent(\"onBeforeBatchUpdate\", []);\r\n\r\n\t\tbatchUpdatePayload(callback);\r\n\r\n\t\tthis.callEvent(\"onAfterBatchUpdate\", []);\r\n\r\n\t\trestoreMethods.call(this);\r\n\r\n\t\tisActive = false;\r\n\t\tif(!noRedraw){\r\n\t\t\tif(calls.needRender){\r\n\t\t\t\tscheduler.render(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else if(calls.needUpdateView){\r\n\t\t\t\tscheduler.updateView(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else{\r\n\t\t\t\tfor(const i in calls.repaintEvents){\r\n\t\t\t\t\tscheduler.updateEvent(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (call_dp) {\r\n\t\t\tthis._dp.setUpdateMode(dp_mode);\r\n\t\t\tthis._dp.sendData();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default function(scheduler){\r\n\tscheduler.batchUpdate = createMethod(scheduler);\r\n}","import dragHighlightPos from \"./drag_highlight_pos\";\r\nimport undoDelete from \"./undo_delete\";\r\nimport limit from \"./limit\";\r\nimport batchUpdate from \"./batch_update\";\r\n\r\nexport default function initPlugins(scheduler){\r\n undoDelete(scheduler);\r\n dragHighlightPos(scheduler);\r\n limit(scheduler);\r\n batchUpdate(scheduler);\r\n}","export default function undoDelete(scheduler) {\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tlet deletedEvent = scheduler.copy(ev);\r\n\t\tif (scheduler.config.undo_deleted && !scheduler.getState().new_event) {\r\n\t\t\tscheduler.message({\r\n\t\t\t\ttext: `\r\n \r\n Undo \r\n
`,\r\n\t\t\t\texpire: 10000,\r\n\t\t\t\ttype: \"popup_after_delete\",\r\n\t\t\t\tcallback: function (e) {\r\n\t\t\t\t\tlet undoBtn = e.target.closest(\r\n\t\t\t\t\t\t`[data-deleted-event-id=\"${ev.id}\"]`\r\n\t\t\t\t\t);\r\n\t\t\t\t\tif (undoBtn) {\r\n\t\t\t\t\t\tscheduler.addEvent(deletedEvent);\r\n\t\t\t\t\t\tscheduler.render();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}\r\n","var uidSeed = Date.now();\r\nfunction uid () {\r\n\treturn uidSeed++;\r\n}\r\n\r\n// iframe-safe array type check instead of using instanceof\r\nfunction isArray(obj){\r\n\tif(Array.isArray){\r\n\t\treturn Array.isArray(obj);\r\n\t}else{\r\n\t\t// close enough\r\n\t\treturn (obj && obj.length !== undefined && obj.pop && obj.push);\r\n\t}\r\n}\r\n\r\n// non-primitive string object, e.g. new String(\"abc\")\r\nfunction isStringObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Number(5)\r\nfunction isNumberObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Boolean(true)\r\nfunction isBooleanObject(obj){\r\n\treturn obj && typeof obj === \"object\" &&\r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Boolean() { [native code] }\";\r\n}\r\n\r\nfunction isDate(obj) {\r\n\tif (obj && typeof obj === \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction defined(obj) {\r\n\treturn typeof(obj) != \"undefined\";\r\n}\r\n\r\nfunction delay (callback, timeout){\r\n\tvar timer;\r\n\r\n\tvar result = function() {\r\n\t\tresult.$cancelTimeout();\r\n\t\tresult.$pending = true;\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tcallback.apply(this, args);\r\n\t\t\tresult.$pending = false;\r\n\t\t}, timeout);\r\n\t};\r\n\r\n\tresult.$pending = false;\r\n\tresult.$cancelTimeout = function(){\r\n\t\tclearTimeout(timer);\r\n\t\tresult.$pending = false;\r\n\t};\r\n\tresult.$execute = function(){\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\tcallback.apply(this, args);\r\n\t\tresult.$cancelTimeout();\r\n\t};\r\n\r\n\treturn result;\r\n}\r\n\r\nexport default {\r\n\tuid: uid,\r\n\tmixin: function mixin (target, source, force){\r\n\t\tfor (var f in source)\r\n\t\t\tif (((target[f] === undefined) || force)) target[f]=source[f];\r\n\t\treturn target;\r\n\t},\r\n\tcopy: function copy(object) {\r\n\t\tvar i, result; // iterator, types array, result\r\n\t\r\n\t\tif (object && typeof object == \"object\") {\r\n\t\r\n\t\t\tswitch (true){\r\n\t\t\t\tcase (isDate(object)):\r\n\t\t\t\t\tresult = new Date(object);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isArray(object)):\r\n\t\t\t\t\tresult = new Array(object.length);\r\n\t\t\t\t\tfor(i = 0; i < object.length; i++){\r\n\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isStringObject(object)):\r\n\t\t\t\t\tresult = new String(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isNumberObject(object)):\r\n\t\t\t\t\tresult = new Number(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isBooleanObject(object)):\r\n\t\t\t\t\tresult = new Boolean(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t\tfor (i in object) {\r\n\t\t\t\t\t\tconst varType = typeof object[i];\r\n\r\n\t\t\t\t\t\tif (varType === \"string\" || varType === \"number\" || varType === \"boolean\" ) {\r\n\t\t\t\t\t\t\tresult[i] = object[i];\r\n\t\t\t\t\t\t} else if(isDate(object[i])){\r\n\t\t\t\t\t\t\tresult[i] = new Date(object[i]);\r\n\t\t\t\t\t\t}else if (Object.prototype.hasOwnProperty.apply(object, [i]))\r\n\t\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result || object;\r\n\t},\r\n\tdefined,\r\n\tisDate,\r\n\tdelay\r\n};\r\n","export default function extend(scheduler) {\r\n\r\nfunction div(className){\r\n\tvar element = document.createElement(\"div\");\r\n\tvar classes = (className || \"\").split(\" \");\r\n\tclasses.forEach(function(cssClass){\r\n\t\telement.classList.add(cssClass);\r\n\t});\r\n\treturn element;\r\n}\r\nvar itemTypes = {\r\n\trows_container: function(){\r\n\t\treturn div(\"dhx_cal_navbar_rows_container\");\r\n\t},\r\n\trow: function(){\r\n\t\treturn div(\"dhx_cal_navbar_row\");\r\n\t},\r\n\tview: function (config) {\r\n\t\tvar element = div(\"dhx_cal_tab\");\r\n\t\telement.setAttribute(\"name\", config.view + \"_tab\");\r\n\t\telement.setAttribute(\"data-tab\", config.view);\r\n\t\t// element.setAttribute(\"data-viewname\", config.view); // FIXME: need to remove? not used anywhere\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tif(config.$firstTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t}else if(config.$lastTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t} else if(config.view !== \"week\") {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t}\r\n\r\n\t\t\tif(config.$segmentedTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\tdate: function () {\r\n\t\treturn div(\"dhx_cal_date\");\r\n\t},\r\n\tbutton: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab\");\r\n\t},\r\n\tbuiltInButton: function (config){\r\n\t\treturn div(\"dhx_cal_\" + config.view + \"_button dhx_cal_nav_button\");\r\n\t},\r\n\tspacer: function () {\r\n\t\treturn div(\"dhx_cal_line_spacer\");\r\n\t},\r\n\tminicalendarButton: function(config){\r\n\t\tvar minicalendarDiv = div('dhx_minical_icon');\r\n\t\tif(!config.click && !minicalendarDiv.$_eventAttached){\r\n\t\t\t\r\n\t\t\tscheduler.event(minicalendarDiv, \"click\", function () {\r\n\t\t\t\tif (scheduler.isCalendarVisible()) {\r\n\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\t\tposition: this,\r\n\t\t\t\t\t\tdate: scheduler.getState().date,\r\n\t\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\t\thandler: function (date, calendar) {\r\n\t\t\t\t\t\t\tscheduler.setCurrentView(date);\r\n\t\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn minicalendarDiv;\r\n\t},\r\n\thtml_element: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_content\");\r\n\t}\r\n};\r\n\r\nfunction findRenderer(config) {\r\n\tvar renderer;\r\n\tif (config.view) {\r\n\t\tswitch (config.view){\r\n\t\t\tcase \"today\":\r\n\t\t\tcase \"next\":\r\n\t\t\tcase \"prev\":\r\n\t\t\t\trenderer = itemTypes.builtInButton;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"date\":\r\n\t\t\t\trenderer = itemTypes.date;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"spacer\":\r\n\t\t\t\trenderer = itemTypes.spacer;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"button\":\r\n\t\t\t\trenderer = itemTypes.button;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minicalendar\":\r\n\t\t\t\trenderer = itemTypes.minicalendarButton;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\trenderer = itemTypes.view;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t} else if(config.rows) {\r\n\t\trenderer = itemTypes.rows_container;\r\n\t} else if(config.cols) {\r\n\t\trenderer = itemTypes.row;\r\n\t}\r\n\treturn renderer;\r\n}\r\n\r\nfunction renderElement(config){\r\n\tvar renderer = findRenderer(config);\r\n\tif(!renderer){\r\n\t\treturn;\r\n\t}\r\n\tvar element = renderer(config);\r\n\tif(config.css){\r\n\t\telement.classList.add(config.css);\r\n\t}\r\n\tif(config.width){\r\n\t\tvar value = config.width;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.width = value;\r\n\t}\r\n\tif(config.height){\r\n\t\tvar value = config.height;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.height = value;\r\n\t}\r\n\tif (config.click) {\r\n\t\tscheduler.event(element, \"click\", config.click);\r\n\t}\r\n\tif (config.html) {\r\n\t\telement.innerHTML = config.html;\r\n\t}\r\n\r\n\tif (config.align) {\r\n\t\tvar value = \"\";\r\n\t\tif (config.align == \"right\") {\r\n\t\t\tvalue = \"flex-end\";\r\n\t\t} else if(config.align == \"left\") {\r\n\t\t\tvalue = \"flex-start\";\r\n\t\t}\r\n\t\telement.style.justifyContent = value;\r\n\t}\r\n\treturn element;\r\n}\r\n\r\nfunction prepareConfig(config) {\r\n\tif (typeof config === \"string\") {\r\n\t\tconfig = {\r\n\t\t\tview: config\r\n\t\t};\r\n\t}\r\n\tif (!config.view && !config.rows && !config.cols) {\r\n\t\tconfig.view = \"button\";\r\n\t}\r\n\treturn config;\r\n}\r\n\r\nfunction renderLayout(config) {\r\n\tvar fragment = document.createDocumentFragment();\r\n\tvar items;\r\n\tif(Array.isArray(config)){\r\n\t\titems = config;\r\n\t}else{\r\n\t\titems = [config];\r\n\t}\r\n\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tvar view = prepareConfig(items[i]);\r\n\r\n\t\tif(view.view === \"day\" && items[i + 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$firstTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"week\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"month\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i - 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"day\"){\r\n\t\t\t\tview.$lastTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar element = renderElement(view);\r\n\r\n\t\tfragment.appendChild(element);\r\n\t\tif(view.cols || view.rows){\r\n\t\t\telement.appendChild(renderLayout(view.cols || view.rows));\r\n\t\t}\r\n\t}\r\n\treturn fragment;\r\n}\r\n\r\nscheduler._init_nav_bar = function (items) {\r\n\tvar navBar = this.$container.querySelector(\".dhx_cal_navline\");\r\n\tif (!navBar){\r\n\t\tnavBar = document.createElement(\"div\");\r\n\t\tnavBar.className = \"dhx_cal_navline dhx_cal_navline_flex\";\r\n\t\tscheduler._update_nav_bar(items, navBar);\r\n\t\treturn navBar;\r\n\t}\r\n\treturn navBar;\r\n};\r\n\r\nvar previousNavbar = null;\r\nvar previousHeight = null;\r\nscheduler._update_nav_bar = function (config, container) {\r\n\r\n\tif(!config){\r\n\t\treturn;\r\n\t}\r\n\tvar heightChanged = false;\r\n\tvar configChanged = false;\r\n\r\n\tvar newHeight = config.height || scheduler.xy.nav_height;\r\n\r\n\tif(previousHeight === null ||\r\n\t\t\t(previousHeight !== newHeight)){\r\n\t\theightChanged = true;\r\n\t}\r\n\tif(!previousNavbar || JSON.stringify(config) !== previousNavbar){\r\n\t\tconfigChanged = true;\r\n\t}\r\n\r\n\tif(heightChanged){\r\n\t\tscheduler.xy.nav_height = newHeight;\r\n\t}\r\n\tif(configChanged){\r\n\t\tcontainer.innerHTML = \"\";\r\n\t\tcontainer.appendChild(renderLayout(config));\r\n\t}\r\n\r\n\tif(heightChanged || configChanged){\r\n\t\tscheduler.unset_actions();\r\n\t\tscheduler._els = [];\r\n\t\tscheduler.get_elements();\r\n\t\tscheduler.set_actions();\r\n\t}\r\n\r\n\tif(newHeight === 0){\r\n\t\tcontainer.style.display = \"none\";\r\n\t}else{\r\n\t\tcontainer.style.display = \"\";\r\n\t}\r\n\r\n\tpreviousHeight = newHeight;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\tfunction isAttachedNode(container){\r\n\t\tvar root = document.body;\r\n\t\r\n\t\twhile(container && container != root){\r\n\t\t\tcontainer = container.parentNode;\r\n\t\t}\r\n\t\r\n\t\treturn !!(root == container);\r\n\t}\r\n\t\r\n\tfunction getWindowSize(window){\r\n\t\treturn {\r\n\t\t\tw : window.innerWidth || document.documentElement.clientWidth,\r\n\t\t\th : window.innerHeight || document.documentElement.clientHeight\r\n\t\t};\r\n\t}\r\n\tfunction equals(a,b){\r\n\t\treturn a.w == b.w && a.h == b.h;\r\n\t}\r\n\t\r\n\tfunction listenWindowResize(scheduler, window){\r\n\t\tvar oldSize = getWindowSize(window);\r\n\t\tvar resizeDelay;\r\n\t\tscheduler.event(window, \"resize\", function(){\r\n\t\t\tclearTimeout(resizeDelay);\r\n\t\t\tresizeDelay = setTimeout(function(){\r\n\r\n\t\t\t\tif (!isAttachedNode(scheduler.$container) || scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar newSize = getWindowSize(window);\r\n\t\t\t\t// element may be resized by container-autoresize exteinsion\r\n\t\t\t\t// check if the size is actually changed in order to not to get endless loop\r\n\t\t\t\tif (!equals(oldSize, newSize)) {\r\n\t\t\t\t\toldSize = newSize;\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\t\t}, 150);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfunction triggerSchedulerResize(scheduler){\r\n\t\tif(scheduler.$destroyed || !scheduler.$root || !isAttachedNode(scheduler.$root)){\r\n\t\t\treturn;\t\r\n\t\t}\r\n\t\tif (scheduler.callEvent(\"onSchedulerResize\", [])) {\r\n\t\t\tscheduler.updateView();\r\n\t\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction watchNodeResize(scheduler){\r\n\t\tvar previousHeight = scheduler.$root.offsetHeight;\r\n\t\tvar previousWidth = scheduler.$root.offsetWidth;\r\n\t\t\r\n\t\tfunction lowlevelResizeWatcher(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(scheduler.$root){\r\n\t\t\t\tif (scheduler.$root.offsetHeight != previousHeight ||\r\n\t\t\t\t\tscheduler.$root.offsetWidth != previousWidth){\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tpreviousHeight = scheduler.$root.offsetHeight;\r\n\t\t\t\tpreviousWidth = scheduler.$root.offsetWidth;\r\n\t\t\t}\r\n\t\r\n\t\t\tsetTimeout(lowlevelResizeWatcher, 200);\r\n\t\t}\r\n\t\t\r\n\t\tlowlevelResizeWatcher();\r\n\t}\r\n\t\r\n\tfunction addResizeListener(scheduler){\r\n\t\tvar root = scheduler.$container;\r\n\t\tvar containerStyles = window.getComputedStyle(root);\r\n\t\tif(containerStyles.getPropertyValue(\"position\") == \"static\"){\r\n\t\t\troot.style.position = \"relative\";\r\n\t\t}\r\n\t\r\n\t\tvar resizeWatcher = document.createElement('iframe');\r\n\t\tresizeWatcher.className = \"scheduler_container_resize_watcher\";\r\n\t\tresizeWatcher.tabIndex = -1;\r\n\t\tif(scheduler.config.wai_aria_attributes){\r\n\t\t\tresizeWatcher.setAttribute(\"role\", \"none\");\r\n\t\t\tresizeWatcher.setAttribute(\"aria-hidden\", true);\r\n\t\t}\r\n\t\r\n\t\t// in some environments (namely, in SalesForce) iframe.contentWindow is not available\r\n\t\tvar salesforce_environment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"];\r\n\t\tif(salesforce_environment){\r\n\t\t\twatchNodeResize(scheduler);\r\n\t\t} else {\r\n\t\t\troot.appendChild(resizeWatcher);\r\n\t\t\tif (resizeWatcher.contentWindow) {\r\n\t\t\t\tlistenWindowResize(scheduler, resizeWatcher.contentWindow);\r\n\t\t\t} else {\r\n\t\t\t\t// if so - ditch the iframe and fallback to listening the main window resize\r\n\t\t\t\troot.removeChild(resizeWatcher);\r\n\t\t\t\tlistenWindowResize(scheduler, window);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\taddResizeListener(scheduler);\r\n\r\n}","class EventHost {\r\n\tconstructor(){\r\n\t\tthis._silent_mode = false;\r\n\t\tthis.listeners = {};\r\n\t}\r\n\t_silentStart(){\r\n\t\tthis._silent_mode = true;\r\n\t}\r\n\t_silentEnd() {\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n}\r\n\r\nconst createEventStorage = function(obj) {\r\n\tlet handlers = {};\r\n\tlet index = 0;\r\n\tconst eventStorage = function(){\r\n\t\tlet combinedResult = true;\r\n\t\tfor(const i in handlers){\r\n\t\t\tconst handlerResult = handlers[i].apply(obj, arguments);\r\n\t\t\tcombinedResult=combinedResult && handlerResult;\r\n\t\t}\r\n\t\treturn combinedResult;\r\n\t};\r\n\teventStorage.addEvent=function(handler, settings){\r\n\t\tif (typeof (handler) == \"function\"){\r\n\t\t\tlet handlerId;\r\n\t\t\tif(settings && settings.id){\r\n\t\t\t\thandlerId = settings.id;\r\n\t\t\t}else{\r\n\t\t\t\thandlerId = index;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings && settings.once){\r\n\t\t\t\tconst originalHandler = handler;\r\n\t\t\t\thandler = function(){\r\n\t\t\t\t\toriginalHandler();\r\n\t\t\t\t\teventStorage.removeEvent(handlerId);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\thandlers[handlerId] = handler;\r\n\t\t\treturn handlerId;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\teventStorage.removeEvent=function(id){\r\n\t\tdelete handlers[id];\r\n\t};\r\n\r\n\teventStorage.clear = function(){\r\n\t\thandlers = {};\r\n\t};\r\n\r\n\treturn eventStorage;\r\n};\r\n\r\nfunction makeEventable(obj){\r\n\r\n\tconst eventHost = new EventHost();\r\n\tobj.attachEvent=function(eventName, handler, settings){\r\n\t\teventName = 'ev_'+eventName.toLowerCase();\r\n\t\tif (!eventHost.listeners[eventName]){\r\n\t\t\teventHost.listeners[eventName] = createEventStorage(this);\r\n\t\t}\r\n\r\n\t\tif(settings && settings.thisObject){\r\n\t\t\thandler = handler.bind(settings.thisObject);\r\n\t\t}\r\n\r\n\t\tconst innerId = eventHost.listeners[eventName].addEvent(handler, settings);\r\n\r\n\t\tlet handlerId = (eventName+':'+innerId); //return ID (ev_eventname:1)\r\n\t\tif(settings && settings.id){\r\n\t\t\thandlerId = settings.id;\r\n\t\t}\r\n\t\treturn handlerId;\r\n\t};\r\n\r\n\tobj.attachAll = function(callback){\r\n\t\tthis.attachEvent('listen_all', callback);\r\n\t};\r\n\r\n\tobj.callEvent=function(name, eventArguments){\r\n\t\tif (eventHost._silent_mode) return true;\r\n\r\n\t\tconst handlerName = 'ev_'+name.toLowerCase();\r\n\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\tif (listeners['ev_listen_all']){\r\n\t\t\tlisteners['ev_listen_all'].apply(this, [name].concat(eventArguments));\r\n\t\t}\r\n\r\n\t\tif (listeners[handlerName])\r\n\t\t\treturn listeners[handlerName].apply(this, eventArguments);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tobj.checkEvent=function(name){\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\treturn (!!listeners['ev_'+name.toLowerCase()]);\r\n\t};\r\n\r\n\tobj.detachEvent=function(id){\r\n\t\tif (id){\r\n\t\t\tlet listeners = eventHost.listeners;\r\n\t\t\tfor(const i in listeners){\r\n\t\t\t\tlisteners[i].removeEvent(id); //remove event\r\n\t\t\t}\r\n\r\n\t\t\tconst list = id.split(':');//get EventName and ID\r\n\t\t\tlisteners = eventHost.listeners;\r\n\t\t\tif(list.length === 2){\r\n\t\t\t\tconst eventName = list[0];\r\n\t\t\t\tconst eventId = list[1];\r\n\t\t\t\tif(listeners[eventName]){\r\n\t\t\t\t\tlisteners[eventName].removeEvent(eventId); //remove event\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tobj.detachAllEvents = function(){\r\n\t\tfor (const name in eventHost.listeners) {\r\n\t\t\teventHost.listeners[name].clear();\r\n\t\t}\r\n\t};\r\n\r\n}\r\n\r\nexport default makeEventable;","export default {\r\n\tevent: function (el, event, handler){\r\n\t\tif (el.addEventListener)\r\n\t\t\tel.addEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.attachEvent)\r\n\t\t\tel.attachEvent(\"on\"+event, handler);\r\n\t},\r\n\teventRemove: function (el, event, handler){\r\n\t\tif (el.removeEventListener)\r\n\t\t\tel.removeEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.detachEvent)\r\n\t\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};","import createEventScope from './utils/scoped_event';\r\n\r\nexport default function extend(scheduler) {\r\n\r\n\r\nvar domEvents = createEventScope();\r\n\r\nscheduler.event = domEvents.attach;\r\nscheduler.eventRemove = domEvents.detach;\r\nscheduler._eventRemoveAll = domEvents.detachAll;\r\nscheduler._createDomEventScope = domEvents.extend;\r\n\r\n\r\nscheduler._trim = function(str){\r\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\r\n\treturn func.apply(str);\r\n};\r\n\r\nscheduler._isDate = function(obj){\r\n\tif (obj && typeof obj == \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nscheduler._isObject = function(obj){\r\n\treturn (obj && typeof obj == \"object\");\r\n};\r\n\r\n}","import defaultDomEvents from './event';\r\n\r\nexport default function(){\r\n\r\n\tvar domEvents = function (addEvent, removeEvent) {\r\n\t\taddEvent = addEvent || defaultDomEvents.event;\r\n\t\tremoveEvent = removeEvent || defaultDomEvents.eventRemove;\r\n\t\tvar handlers = [];\r\n\t\tvar eventScope = {\r\n\t\t\tattach: function(el, event, callback, capture){\r\n\t\t\t\thandlers.push({element: el, event:event, callback: callback, capture: capture});\r\n\t\t\t\taddEvent(el, event, callback, capture);\r\n\t\t\t},\r\n\t\t\tdetach: function(el, event, callback, capture){\r\n\t\t\t\tremoveEvent(el, event, callback, capture);\r\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\t\tvar handler = handlers[i];\r\n\t\t\t\t\tif (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {\r\n\t\t\t\t\t\thandlers.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdetachAll: function () {\r\n\t\t\t\tvar staticArray = handlers.slice();\r\n\t\t\t\t// original handlers array can be spliced on every iteration\r\n\t\t\t\tfor (var i = 0; i < staticArray.length; i++){\r\n\t\t\t\t\tvar handler = staticArray[i];\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, handler.capture);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, undefined);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, false);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, true);\r\n\t\t\t\t}\r\n\t\t\t\thandlers.splice(0, handlers.length);\r\n\t\t\t},\r\n\t\t\textend: function(){\r\n\t\t\t\treturn domEvents(this.event, this.eventRemove);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn eventScope;\r\n\t};\r\n\t\r\n\treturn domEvents();\r\n}","//returns position of html element on the page\r\nfunction elementPosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\n/*\r\nevent position relatively to DOM element\r\n */\r\nfunction getRelativeEventPosition(ev, node){\r\n\tvar d = document.documentElement;\r\n\tvar box = elementPosition(node);\r\n\r\n\treturn {\r\n\t\tx: ev.clientX - d.clientLeft - box.x + node.scrollLeft,\r\n\t\ty: ev.clientY - d.clientTop - box.y + node.scrollTop\r\n\t};\r\n}\r\n\r\nfunction getNodePosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\nfunction getClassName(node){\r\n\tif(!node) return \"\";\r\n\r\n\tvar className = node.className || \"\";\r\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\r\n\t\tclassName = className.baseVal;\r\n\r\n\tif(!className.indexOf)\r\n\t\tclassName = '';\r\n\r\n\treturn className || \"\";\r\n}\r\n\r\nfunction getTargetNode(e) {\r\n\tvar trg;\r\n\tif (e.tagName)\r\n\t\ttrg = e;\r\n\telse {\r\n\t\te = e || window.event;\r\n\t\ttrg = e.target || e.srcElement;\r\n\t\tif (trg.shadowRoot && e.composedPath) {\r\n\t\t\ttrg = e.composedPath()[0];\r\n\t\t}\r\n\t}\r\n\treturn trg;\r\n}\r\n\r\nfunction locateCss(e, classname, strict){\r\n\tif(strict === undefined)\r\n\t\tstrict = true;\r\n\r\n\tvar trg = e.target || e.srcElement;\r\n\tvar css = '';\r\n\r\n\twhile (trg){\r\n\t\tcss = getClassName(trg);\r\n\r\n\t\tif(css){\r\n\t\t\tvar ind = css.indexOf(classname);\r\n\t\t\tif (ind >= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!((css.charAt(ind - 1)||\"\").trim()));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!((css.charAt(ind + classname.length)).trim()));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n\r\n// get focusable nodes\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\r\n\tvar hiddenSection = false;\r\n\tvar recurringSection = locateCss({target:node}, \"dhx_form_repeat\", false);\r\n\tif(recurringSection){\r\n\t\thiddenSection = !!(recurringSection.style.height == \"0px\");\r\n\t}\r\n\thiddenSection = hiddenSection || !(node.offsetHeight);\r\n\r\n\treturn (display != \"none\" && visibility != \"hidden\" && !hiddenSection);\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport default {\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteLeft: function getAbsoluteLeft(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).left;\r\n\t},\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteTop: function getAbsoluteTop(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).top;\r\n\t},\r\n\r\n\tgetOffsetSum: function getOffsetSum(elem) {\r\n\t\tvar top=0, left=0;\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\t\treturn {top: top, left: left};\r\n\t},\r\n\r\n\tgetOffsetRect: function getOffsetRect(elem) {\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\r\n\t\tvar top = 0,\r\n\t\t\tleft = 0;\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop\r\n\t\tif (!/Mobi/.test(navigator.userAgent)) {\r\n\t\t\tvar body = document.body;\r\n\t\t\tvar docElem = document.documentElement;\r\n\t\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\r\n\t\t\ttop = box.top + scrollTop - clientTop;\r\n\t\t\tleft = box.left + scrollLeft - clientLeft;\r\n\t\t}else {\r\n\t\t\t// incorrect left coordinate on mobile zoom\r\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=489206\r\n\r\n\t\t\tvar dummy = document.createElement(\"div\");\r\n\t\t\tdummy.style.position=\"absolute\";\r\n\t\t\tdummy.style.left=\"0px\";\r\n\t\t\tdummy.style.top=\"0px\";\r\n\t\t\tdummy.style.width=\"1px\";\r\n\t\t\tdummy.style.height = \"1px\";\r\n\r\n\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\tvar dummyBox = dummy.getBoundingClientRect();\r\n\t\t\ttop = box.top - dummyBox.top;\r\n\t\t\tleft = box.left - dummyBox.left;\r\n\r\n\t\t\tdummy.parentNode.removeChild(dummy);\r\n\t\t}\r\n\r\n\t\treturn { top: Math.round(top), left: Math.round(left) };\r\n\t},\r\n\r\n\tgetOffset: function getOffset(elem) {\r\n\t\tif (elem.getBoundingClientRect) {\r\n\t\t\treturn this.getOffsetRect(elem);\r\n\t\t} else {\r\n\t\t\treturn this.getOffsetSum(elem);\r\n\t\t}\r\n\t},\r\n\r\n\tclosest: function(element, selector){\r\n\t\tif(!element || !selector){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn closest(element, selector);\r\n\t},\r\n\tinsertAfter: function(newNode, referenceNode){\r\n\t\tif(referenceNode.nextSibling){\r\n\t\t\treferenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\r\n\t\t}else{\r\n\t\t\treferenceNode.parentNode.appendChild(newNode);\r\n\t\t}\r\n\t},\r\n\tremove: function(node) {\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t},\r\n\tisChildOf: function(child, parent) {\r\n\t\treturn parent.contains(child);\r\n\t},\r\n\tgetFocusableNodes,\r\n\tgetClassName,\r\n\tlocateCss,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeEventPosition,\r\n\tgetTargetNode,\r\n\tgetNodePosition\r\n};\r\n\r\nvar closest;\r\nif(Element.prototype.closest){\r\n\tclosest = function(element, selector){\r\n\t\treturn element.closest(selector);\r\n\t};\r\n}else{\r\n\tvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n\tclosest = function(element, selector) {\r\n\t\tvar el = element;\r\n\t\tdo {\r\n\t\t\tif (matches.call(el, selector)){\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1);\r\n\t\treturn null;\r\n\t};\r\n}\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\")\r\n};","export default function(data) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\tvar result = \"\";\r\n\tfor (var key in data) {\r\n\t\tvar serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = data[key];\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}","export default function extend(scheduler) {\r\n\r\nvar generateStringToDate = function (format, utc) {\r\n\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tvar mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (var i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\": splt += \"set[2]=temp[\" + i + \"]||1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\": splt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\": splt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\": splt += \"set[0]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\": splt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\": splt += \"set[5]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\": splt += \"set[1]=this.locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\": splt += \"set[1]=this.locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) code = \" Date.UTC(\" + code + \")\";\r\n\treturn new Function(\"date\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\r\n};\r\nvar csp_date_to_str = function (format, utc) {\r\n\treturn function(date) {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, function (a) {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? scheduler.date.to_fixed(date.getUTCDate()) : scheduler.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? scheduler.date.to_fixed((date.getUTCMonth() + 1)) : scheduler.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? scheduler.date.to_fixed(date.getUTCFullYear() % 100) : scheduler.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? scheduler.locale.date.day_short[date.getUTCDay()] : scheduler.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? scheduler.locale.date.day_full[date.getUTCDay()] : scheduler.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? scheduler.locale.date.month_short[date.getUTCMonth()] : scheduler.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? scheduler.locale.date.month_full[date.getUTCMonth()] : scheduler.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? scheduler.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : scheduler.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? scheduler.date.to_fixed(date.getUTCHours()) : scheduler.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? scheduler.date.to_fixed(date.getUTCMinutes()) : scheduler.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? scheduler.date.to_fixed(date.getUTCSeconds()) : scheduler.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? scheduler.date.to_fixed(scheduler.date.getUTCISOWeek(date)) : scheduler.date.to_fixed(scheduler.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nvar csp_str_to_date = function (format, utc) {\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\treturn function (date){\r\n\t\tvar set = [0, 0, 1, 0, 0, 0];\r\n\t\tvar temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\r\n\t\tfor (var i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));\r\n\t\t}\r\n\r\n\t\treturn new Date(set[0], set[1], set[2], set[3], set[4], set[5]);\r\n\t};\r\n};\r\n\r\nlet cspEnabled = undefined;\r\nfunction checkIfCSPEnabled(){\r\n\ttry {\r\n\t\tnew Function(\"cspEnabled = false;\");\r\n\t\tcspEnabled = false;\r\n\t} catch(e) {\r\n\t\tcspEnabled = true;\r\n\t}\r\n\treturn cspEnabled;\r\n}\r\n\r\nfunction useCsp() {\r\n\tvar result = false;\r\n\tif (scheduler.config.csp === \"auto\") {\r\n\t\tif(cspEnabled === undefined){\r\n\t\t\tcspEnabled = checkIfCSPEnabled();\r\n\t\t}\r\n\t\tresult = cspEnabled;\r\n\t} else {\r\n\t\tresult = scheduler.config.csp;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.date = {\r\n\tinit:function(){\r\n\t\tvar s = scheduler.locale.date.month_short;\r\n\t\tvar t = scheduler.locale.date.month_short_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\r\n\t\tvar s = scheduler.locale.date.month_full;\r\n\t\tvar t = scheduler.locale.date.month_full_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\t},\r\n\tdate_part:function(date){\r\n\t\tvar old = new Date(date);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()) )\r\n\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\treturn date;\r\n\t},\r\n\ttime_part:function(date){\r\n\t\treturn (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;\r\n\t},\r\n\tweek_start:function(date){\r\n\t\tvar shift=date.getDay();\r\n\t\tif (scheduler.config.start_on_monday){\r\n\t\t\tif (shift===0) shift=6;\r\n\t\t\telse shift--;\r\n\t\t}\r\n\t\treturn this.date_part(this.add(date,-1*shift,\"day\"));\r\n\t},\r\n\tmonth_start:function(date){\r\n\t\tdate.setDate(1);\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\tyear_start:function(date){\r\n\t\tdate.setMonth(0);\r\n\t\treturn this.month_start(date);\r\n\t},\r\n\tday_start:function(date){\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\t_add_days:function(date, inc){\r\n\t\tvar ndate = new Date(date.valueOf());\r\n\r\n\t\tndate.setDate(ndate.getDate() + inc);\r\n\r\n\t\t// Workaround for Safari/iOS timezone bug, ref:OKZ-149693\r\n\t\tif(inc == Math.round(inc) && inc > 0){\r\n\t\t\tvar datesDiff = +ndate - +date,\r\n\t\t\t\trest = datesDiff % (24*60*60*1000);\r\n\t\t\tif(rest && date.getTimezoneOffset() == ndate.getTimezoneOffset()){\r\n\t\t\t\tvar hours = rest / (60* 60 * 1000);\r\n\t\t\t\tndate.setTime(ndate.getTime() + (24 - hours) * 60 * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\r\n\t\t\t(ndate.getDate() < date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()) )\r\n\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\r\n\t\treturn ndate;\r\n\t},\r\n\tadd:function(date,inc,mode){\r\n\t\tvar ndate=new Date(date.valueOf());\r\n\t\tswitch(mode){\r\n\t\t\tcase \"day\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc * 7);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\": ndate.setMonth(ndate.getMonth()+inc); break;\r\n\t\t\tcase \"year\": ndate.setYear(ndate.getFullYear()+inc); break;\r\n\t\t\tcase \"hour\":\r\n\t\t\t\t/*\r\n\t\t\t\t setHour(getHour() + inc) and setMinutes gives weird result when is applied on a Daylight Saving time switch\r\n\t\t\t\t setTime seems working as expected\r\n\t\t\t\t*/\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minute\":\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn scheduler.date[\"add_\"+mode](date,inc,mode);\r\n\t\t}\r\n\t\treturn ndate;\r\n\t},\r\n\tto_fixed:function(num){\r\n\t\tif (num<10)\treturn \"0\"+num;\r\n\t\treturn num;\r\n\t},\r\n\tcopy:function(date){\r\n\t\treturn new Date(date.valueOf());\r\n\t},\r\n\tdate_to_str:function(format,utc){\r\n\t\tif (useCsp()) {\r\n\t\t\treturn csp_date_to_str(format,utc);\r\n\t\t}\r\n\r\n\t\tformat=format.replace(/%[a-zA-Z]/g,function(a){\r\n\t\t\tswitch(a){\r\n\t\t\t\tcase \"%d\": return \"\\\"+this.date.to_fixed(date.getDate())+\\\"\";\r\n\t\t\t\tcase \"%m\": return \"\\\"+this.date.to_fixed((date.getMonth()+1))+\\\"\";\r\n\t\t\t\tcase \"%j\": return \"\\\"+date.getDate()+\\\"\";\r\n\t\t\t\tcase \"%n\": return \"\\\"+(date.getMonth()+1)+\\\"\";\r\n\t\t\t\tcase \"%y\": return \"\\\"+this.date.to_fixed(date.getFullYear()%100)+\\\"\";\r\n\t\t\t\tcase \"%Y\": return \"\\\"+date.getFullYear()+\\\"\";\r\n\t\t\t\tcase \"%D\": return \"\\\"+this.locale.date.day_short[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%l\": return \"\\\"+this.locale.date.day_full[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%M\": return \"\\\"+this.locale.date.month_short[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%F\": return \"\\\"+this.locale.date.month_full[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%h\": return \"\\\"+this.date.to_fixed((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%g\": return \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%G\": return \"\\\"+date.getHours()+\\\"\";\r\n\t\t\t\tcase \"%H\": return \"\\\"+this.date.to_fixed(date.getHours())+\\\"\";\r\n\t\t\t\tcase \"%i\": return \"\\\"+this.date.to_fixed(date.getMinutes())+\\\"\";\r\n\t\t\t\tcase \"%a\": return \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\r\n\t\t\t\tcase \"%A\": return \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\r\n\t\t\t\tcase \"%s\": return \"\\\"+this.date.to_fixed(date.getSeconds())+\\\"\";\r\n\t\t\t\tcase \"%W\": return \"\\\"+this.date.to_fixed(this.date.getISOWeek(date))+\\\"\";\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (utc) format=format.replace(/date\\.get/g,\"date.getUTC\");\r\n\t\tvar func = new Function(\"date\",\"return \\\"\"+format+\"\\\";\");\r\n\r\n\t\treturn func.bind(scheduler);\r\n\t},\r\n\tstr_to_date:function(format, utc, exactFormat){\r\n\t\tvar stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;\r\n\t\tvar parseExactFormat = stringToDateMethod(format, utc);\r\n\t\t// eslint-disable-next-line\r\n\t\tvar yyyyMMddhhIIss = /^[0-9]{4}(\\-|\\/)[0-9]{2}(\\-|\\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\r\n\t\t// MM/dd/yyyy - default old format for xml-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar MMddyyyyhhIIss = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/;\r\n\t\t// dd-MM-yyyy - default old format for api-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ddMMyyyyhhIIss = /^[0-9]{2}\\-[0-9]{2}\\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ISO8601 = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\n\t\tvar isYMDDate = function (datestr) {\r\n\t\t\treturn yyyyMMddhhIIss.test(String(datestr));\r\n\t\t};\r\n\r\n\t\tvar isMDYDate = function (datestr) {\r\n\t\t\treturn MMddyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isDMYDate = function (datestr) {\r\n\t\t\treturn ddMMyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isISO8601 = function (datestr) {\r\n\t\t\treturn ISO8601.test(datestr);\r\n\t\t};\r\n\r\n\t\tvar parseYMD = stringToDateMethod(\"%Y-%m-%d %H:%i:%s\", utc);\r\n\t\tvar parseMDY = stringToDateMethod(\"%m/%d/%Y %H:%i:%s\", utc);\r\n\t\tvar parseDMY = stringToDateMethod(\"%d-%m-%Y %H:%i:%s\", utc);\r\n\r\n\t\treturn function (dateString) {\r\n\r\n\t\t\tif (!exactFormat && !scheduler.config.parse_exact_format) {\r\n\t\t\t\tif (dateString && dateString.getISOWeek) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (typeof dateString === \"number\") {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (isYMDDate(dateString)) {\r\n\t\t\t\t\treturn parseYMD(dateString);\r\n\t\t\t\t} else if (isMDYDate(dateString)) {\r\n\t\t\t\t\treturn parseMDY(dateString);\r\n\t\t\t\t} else if (isDMYDate(dateString)) {\r\n\t\t\t\t\treturn parseDMY(dateString);\r\n\t\t\t\t} else if (isISO8601(dateString)) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn parseExactFormat.call(scheduler, dateString);\r\n\t\t};\r\n\t},\r\n\tgetISOWeek: function(ndate) {\r\n\t\tif(!ndate) return false;\r\n\t\tndate = this.date_part(new Date(ndate));\r\n\t\tvar nday = ndate.getDay();\r\n\t\tif (nday === 0) {\r\n\t\t\tnday = 7;\r\n\t\t}\r\n\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\tvar ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\tvar week_number = 1 + Math.floor( ordinal_date / 7);\r\n\t\treturn week_number;\r\n\t},\r\n\tgetUTCISOWeek: function(ndate){\r\n\t\treturn this.getISOWeek(this.convert_to_utc(ndate));\r\n\t},\r\n\tconvert_to_utc: function(date) {\r\n\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t}\r\n};\r\n\r\n}\r\n\r\n","export default function(scheduler){\r\n\treturn (function(){\r\n\t\tvar res = {};\r\n\t\tfor (var a in this._events){\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.id.toString().indexOf(\"#\") == -1){\r\n\t\t\t\tres[ev.id] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}).bind(scheduler);\r\n}","import xmlLoaded from \"./loaders/xml\";\r\nimport jsonLoader from \"./loaders/json\";\r\nimport iCalLoader from \"./loaders/ical\";\r\nimport createSerializator from \"../core/common/get_serializable_events\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler._loaded = {};\r\nscheduler._load = function(url, from) {\r\n\turl = url || this._load_url;\r\n\r\n\tif(!url){\r\n\t\t//if scheduler.setLoadMode is called before scheduler.init, initial rendering will invoke data loading while url is undefined\r\n\t\treturn;\r\n\t}\r\n\r\n\turl += (url.indexOf(\"?\") == -1 ? \"?\" : \"&\") + \"timeshift=\" + (new Date()).getTimezoneOffset();\r\n\tif (this.config.prevent_cache) url += \"&uid=\" + this.uid();\r\n\tvar to;\r\n\tfrom = from || this._date;\r\n\tfunction ajaxCallback(response) {\r\n\t\tscheduler.on_load(response);\r\n\t\tscheduler.callEvent(\"onLoadEnd\", []);\r\n\t}\r\n\tif (this._load_mode) {\r\n\t\tvar lf = this.templates.load_format;\r\n\r\n\t\tfrom = this.date[this._load_mode + \"_start\"](new Date(from.valueOf()));\r\n\t\twhile (from > this._min_date) from = this.date.add(from, -1, this._load_mode);\r\n\t\tto = from;\r\n\r\n\t\tvar cache_line = true;\r\n\t\twhile (to < this._max_date) {\r\n\t\t\tto = this.date.add(to, 1, this._load_mode);\r\n\t\t\tif (this._loaded[lf(from)] && cache_line)\r\n\t\t\t\tfrom = this.date.add(from, 1, this._load_mode); else cache_line = false;\r\n\t\t}\r\n\r\n\t\tvar temp_to = to;\r\n\t\tdo {\r\n\t\t\tto = temp_to;\r\n\t\t\ttemp_to = this.date.add(to, -1, this._load_mode);\r\n\t\t} while (temp_to > from && this._loaded[lf(temp_to)]);\r\n\r\n\t\tif (to <= from)\r\n\t\t\treturn false; //already loaded\r\n\r\n\t\tscheduler.ajax.get(url + \"&from=\" + lf(from) + \"&to=\" + lf(to), ajaxCallback);\r\n\r\n\t\twhile (from < to) {\r\n\t\t\tthis._loaded[lf(from)] = true;\r\n\t\t\tfrom = this.date.add(from, 1, this._load_mode);\r\n\t\t}\r\n\t} else {\r\n\t\tscheduler.ajax.get(url, ajaxCallback);\r\n\t}\r\n\r\n\t// TODO: remove onXLS\r\n\tthis.callEvent(\"onXLS\", []);\r\n\tthis.callEvent(\"onLoadStart\", []);\r\n\treturn true;\r\n};\r\n\r\nscheduler._parsers = {};\r\n\r\n\r\nxmlLoaded(scheduler);\r\njsonLoader(scheduler);\r\niCalLoader(scheduler);\r\n\r\nscheduler.on_load = function (loader) {\r\n\tthis.callEvent(\"onBeforeParse\", []);\r\n\r\n\tvar evs;\r\n\tvar error = false;\r\n\r\n\tvar foundParser = false;\r\n\tfor(var i in this._parsers){\r\n\t\tvar parser = this._parsers[i];\r\n\t\tif(parser.canParse(loader.xmlDoc.responseText, loader.xmlDoc)){\r\n\t\t\ttry{\r\n\t\t\t\tvar param = loader.xmlDoc.responseText;\r\n\t\t\t\tif(i === \"xml\"){\r\n\t\t\t\t\tparam = loader;\r\n\t\t\t\t}\r\n\t\t\t\tevs = parser.parse(param);\r\n\t\t\t\tif(!evs){\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\tfoundParser = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(!foundParser){\r\n\t\tif(this._process && this[this._process]){\r\n\t\t\ttry{\r\n\t\t\t\tevs = this[this._process].parse(loader.xmlDoc.responseText);\r\n\t\t\t}catch (e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terror = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif(error || (loader.xmlDoc.status && loader.xmlDoc.status >= 400)){\r\n\t\tthis.callEvent(\"onLoadError\", [loader.xmlDoc]);\r\n\t\tevs = [];\r\n\t}\r\n\r\n\tthis._process_loading(evs);\r\n\r\n\t// TODO: remove onXLE\r\n\tthis.callEvent(\"onXLE\", []);\r\n\tthis.callEvent(\"onParse\", []);\r\n};\r\nscheduler._process_loading = function(evs) {\r\n\tthis._loading = true;\r\n\tthis._not_render = true;\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tif (!this.callEvent(\"onEventLoading\", [evs[i]])) continue;\r\n\t\tthis.addEvent(evs[i]);\r\n\t}\r\n\tthis._not_render = false;\r\n\tif (this._render_wait) this.render_view_data();\r\n\r\n\tthis._loading = false;\r\n\tif (this._after_call) this._after_call();\r\n\tthis._after_call = null;\r\n};\r\nscheduler._init_event = function(event) {\r\n\tevent.text = (event.text || event._tagvalue) || \"\";\r\n\tevent.start_date = scheduler._init_date(event.start_date);\r\n\tevent.end_date = scheduler._init_date(event.end_date);\r\n};\r\n\r\nscheduler._init_date = function(date){\r\n\tif(!date)\r\n\t\treturn null;\r\n\tif (typeof date == \"string\") {\r\n\t\treturn scheduler._helpers.parseDate(date);\r\n\t}\r\n\telse return new Date(date);\r\n};\r\n\r\nconst getSerializableData = createSerializator(scheduler);\r\nscheduler.serialize = function(){\r\n\tconst dataset = [];\r\n\tconst allEvents = getSerializableData();\r\n\tfor (var a in allEvents){\r\n\t\t\r\n\t\tconst exportedEvent = {};\r\n\t\tvar ev = allEvents[a];\r\n\r\n\t\tfor(var key in ev){\r\n\t\t\tif (key.charAt(0) == \"$\" || key.charAt(0) == \"_\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet exportValue;\r\n\t\t\tconst rawValue = ev[key];\r\n\t\t\tif(scheduler.utils.isDate(rawValue)){\r\n\t\t\t\texportValue = scheduler.defined(scheduler.templates.xml_format) ? scheduler.templates.xml_format(rawValue) : scheduler.templates.format_date(rawValue);\r\n\t\t\t}else{\r\n\t\t\t\texportValue = rawValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texportedEvent[key] = exportValue;\r\n\t\t}\r\n\r\n\t\tdataset.push(exportedEvent);\r\n\t}\r\n\treturn dataset;\r\n};\r\n\r\n/*\r\nscheduler.json = {};\r\nscheduler.json.parse = function(data) {\r\n\r\n\tvar events = [];\r\n\r\n\tif (typeof data == \"string\") {\r\n\t\tdata = JSON.parse(data);\r\n\t}\r\n\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\tevents = data;\r\n\t} else {\r\n\t\tif(data){\r\n\t\t\tif(data.events){\r\n\t\t\t\tevents = data.events;\r\n\t\t\t}else if(data.data){\r\n\t\t\t\tevents = data.data;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tevents = events || [];\r\n\r\n\tif (data.dhx_security) {\r\n\t\tif (window.dhtmlx) {\r\n\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t}\r\n\t\tscheduler.security_key = data.dhx_security;\r\n\t}\r\n\r\n\tvar collections = (data && data.collections) ? data.collections : {};\r\n\tvar collections_loaded = false;\r\n\tfor (var key in collections) {\r\n\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\tcollections_loaded = true;\r\n\t\t\tvar collection = collections[key];\r\n\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\tvar option = collection[j];\r\n\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (collections_loaded)\r\n\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\tvar evs = [];\r\n\tfor (var i = 0; i < events.length; i++) {\r\n\t\tvar event = events[i];\r\n\t\tscheduler._init_event(event);\r\n\t\tevs.push(event);\r\n\t}\r\n\treturn evs;\r\n};*/\r\nscheduler.parse = function(data, type) {\r\n\tthis._process = type;\r\n\tthis.on_load({xmlDoc: {responseText: data}});\r\n};\r\nscheduler.load = function(url, call) {\r\n\tif (typeof call == \"string\") {\r\n\t\tthis._process = call;\r\n\t\tcall = arguments[2];\r\n\t}\r\n\r\n\tthis._load_url = url;\r\n\tthis._after_call = call;\r\n\tthis._load(url, this._date);\r\n};\r\n//possible values - day,week,month,year,all\r\nscheduler.setLoadMode = function(mode) {\r\n\tif (mode == \"all\") mode = \"\";\r\n\tthis._load_mode = mode;\r\n};\r\n\r\nscheduler.serverList = function(name, array) {\r\n\tif (array) {\r\n\t\tthis.serverList[name] = array.slice(0);\r\n\t\treturn this.serverList[name];\r\n\t}\r\n\tthis.serverList[name] = (this.serverList[name] || []);\r\n\treturn this.serverList[name];\r\n};\r\nscheduler._userdata = {};\r\n\r\nscheduler._xmlNodeToJSON = function(node) {\r\n\tvar t = {};\r\n\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\tvar child = node.childNodes[i];\r\n\t\tif (child.nodeType == 1)\r\n\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t}\r\n\r\n\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\r\n\treturn t;\r\n};\r\nscheduler.attachEvent(\"onXLS\", function() {\r\n\tif (this.config.show_loading === true) {\r\n\t\tvar t;\r\n\t\tt = this.config.show_loading = document.createElement(\"div\");\r\n\t\tt.className = 'dhx_loading';\r\n\t\tt.style.left = Math.round((this._x - 128) / 2) + \"px\";\r\n\t\tt.style.top = Math.round((this._y - 15) / 2) + \"px\";\r\n\t\tthis._obj.appendChild(t);\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onXLE\", function() {\r\n\tvar t = this.config.show_loading;\r\n\tif (t && typeof t == \"object\") {\r\n\t\tif(t.parentNode) {\r\n\t\t\tt.parentNode.removeChild(t);\r\n\t\t}\r\n\t\tthis.config.show_loading = true;\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._parsers.xml = {\r\n\tcanParse: function(data, xhr){\r\n\t\t// IE returns non-empty responseXML type regardless of actual data type\r\n\t\tif(xhr.responseXML && xhr.responseXML.firstChild){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tvar xmlDoc = scheduler.ajax.parse(xhr.responseText);\r\n\t\t\tvar topElement = scheduler.ajax.xmltop(\"data\", xmlDoc);\r\n\t\t\tif(topElement && topElement.tagName === \"data\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}catch (e){\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(loader) {\r\n\t\tvar xml;\r\n\r\n\t\tif (!loader.xmlDoc.responseXML) { //from a string\r\n\t\t\tloader.xmlDoc.responseXML = scheduler.ajax.parse(loader.xmlDoc.responseText);\r\n\t\t}\r\n\t\r\n\t\txml = scheduler.ajax.xmltop(\"data\", loader.xmlDoc);\r\n\t\tif (xml.tagName != \"data\") return null;//not an xml\r\n\t\tvar csrfToken = xml.getAttribute(\"dhx_security\");\r\n\t\tif (csrfToken) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = csrfToken;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = csrfToken;\r\n\t\t}\r\n\t\r\n\t\tvar opts = scheduler.ajax.xpath(\"//coll_options\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\tvar arr = scheduler.serverList[bind];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[bind] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length);\t//clear old options\r\n\t\t\tvar itms = scheduler.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\tvar itm = itms[j];\r\n\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\tvar obj = { key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (opts.length)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\t\r\n\t\tvar ud = scheduler.ajax.xpath(\"//userdata\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < ud.length; i++) {\r\n\t\t\tvar udx = scheduler._xmlNodeToJSON(ud[i]);\r\n\t\t\tscheduler._userdata[udx.name] = udx.text;\r\n\t\t}\r\n\t\r\n\t\tvar evs = [];\r\n\t\txml = scheduler.ajax.xpath(\"//event\", loader.xmlDoc);\r\n\t\r\n\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\tvar ev = evs[i] = scheduler._xmlNodeToJSON(xml[i]);\r\n\t\t\tscheduler._init_event(ev);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.json = scheduler._parsers.json = {\r\n\tcanParse: function(data){\r\n\t\tif(data && typeof data === \"object\"){\r\n\t\t\treturn true;\r\n\t\t} else if(typeof data === \"string\"){\r\n\t\t\ttry {\r\n\t\t\t\tvar result = JSON.parse(data);\r\n\t\t\t\treturn Object.prototype.toString.call(result) === '[object Object]' || \r\n\t\t\t\t\t\tObject.prototype.toString.call(result) === '[object Array]';\r\n\t\t\t} catch (err) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(data) {\r\n\t\tvar events = [];\r\n\r\n\t\tif (typeof data == \"string\") {\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\t\tevents = data;\r\n\t\t} else {\r\n\t\t\tif(data){\r\n\t\t\t\tif(data.events){\r\n\t\t\t\t\tevents = data.events;\r\n\t\t\t\t}else if(data.data){\r\n\t\t\t\t\tevents = data.data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tevents = events || [];\r\n\r\n\t\tif (data.dhx_security) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = data.dhx_security;\r\n\t\t}\r\n\r\n\t\tvar collections = (data && data.collections) ? data.collections : {};\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\t\tif (!arr) {\r\n\t\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t\t}\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\t\tvar evs = [];\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar event = events[i];\r\n\t\t\tscheduler._init_event(event);\r\n\t\t\tevs.push(event);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.ical = scheduler._parsers.ical = {\r\n\tcanParse: function(data){\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\treturn new RegExp(\"^BEGIN:VCALENDAR\").test(data);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tparse:function(str){\r\n\t\tvar data = str.match(RegExp(this.c_start+\"[^\\f]*\"+this.c_end,\"\"));\r\n\t\tif (!data.length) return;\r\n\r\n\t\t// mpl: handle bad unfolding\r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+ /g,\"\");\r\n\r\n\t\t//unfolding \r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+(?=[a-z \\t])/g,\" \");\r\n\t\t//drop property\r\n\t\tdata[0]=data[0].replace(/;[^:\\r\\n]*:/g,\":\");\r\n\t\t\r\n\t\t\r\n\t\tvar incoming=[];\r\n\t\tvar match;\r\n\t\tvar event_r = RegExp(\"(?:\"+this.e_start+\")([^\\f]*?)(?:\"+this.e_end+\")\",\"g\");\r\n\t\twhile ((match=event_r.exec(data)) !== null){\r\n\t\t\tvar e={};\r\n\t\t\tvar param;\r\n\t\t\tvar param_r = /[^\\r\\n]+[\\r\\n]+/g;\r\n\t\t\twhile ((param=param_r.exec(match[1])) !== null)\r\n\t\t\t\tthis.parse_param(param.toString(),e);\r\n\t\t\tif (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined\r\n\t\t\tincoming.push(e);\t\r\n\t\t}\r\n\t\treturn incoming;\r\n\t},\r\n\tparse_param:function(str,obj){\r\n\t\tvar d = str.indexOf(\":\"); \r\n\t\t\tif (d==-1) return;\r\n\t\t\r\n\t\tvar name = str.substr(0,d).toLowerCase();\r\n\t\tvar value = str.substr(d+1).replace(/\\\\,/g,\",\").replace(/[\\r\\n]+$/,\"\");\r\n\t\tif (name==\"summary\")\r\n\t\t\tname=\"text\";\r\n\t\telse if (name==\"dtstart\"){\r\n\t\t\tname = \"start_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\telse if (name==\"dtend\"){\r\n\t\t\tname = \"end_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\tobj[name]=value;\r\n\t},\r\n\tparse_date:function(value,dh,dm){\r\n\t\tvar t = value.split(\"T\");\r\n\r\n\t\tvar utcMark = false;\r\n\t\tif (t[1]){\r\n\t\t\tdh=t[1].substr(0,2);\r\n\t\t\tdm=t[1].substr(2,2);\r\n\t\t\tutcMark = !!(t[1][6] == \"Z\");\r\n\t\t}\r\n\t\tvar dy = t[0].substr(0,4);\r\n\t\tvar dn = parseInt(t[0].substr(4,2),10)-1;\r\n\t\tvar dd = t[0].substr(6,2);\r\n\r\n\t\tif(scheduler.config.server_utc || utcMark){\r\n\t\t\treturn new Date(Date.UTC(dy,dn,dd,dh,dm)) ;\r\n\t\t}else{\r\n\t\t\treturn new Date(dy,dn,dd,dh,dm);\r\n\t\t}\r\n\t},\r\n\tc_start:\"BEGIN:VCALENDAR\",\r\n\te_start:\"BEGIN:VEVENT\",\r\n\te_end:\"END:VEVENT\",\r\n\tc_end:\"END:VCALENDAR\"\t\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._init_touch_events = function(){\r\n\tvar mobile = this.config.touch &&\r\n\t\t( ((navigator.userAgent.indexOf(\"Mobile\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"iPad\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Android\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Touch\")!=-1)) && !window.MSStream) ||\r\n\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\tif(mobile){\r\n\t\tthis.xy.scroll_width = 0;\r\n\t\tthis._mobile = true;\r\n\t}\r\n\r\n\tif(this.config.touch){\r\n\r\n\t\tvar touchEventsSupported = true;\r\n\t\ttry {\r\n\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t} catch (e) {\r\n\t\t\ttouchEventsSupported = false;\r\n\t\t}\r\n\r\n\t\tif (touchEventsSupported) {\r\n\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t};\r\n\t\t\t\telse\r\n\t\t\t\t\treturn ev;\r\n\t\t\t}, function () {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else if (window.PointerEvent || window.navigator.pointerEnabled) {\r\n\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t});\r\n\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler._touch_events = function(names, accessor, ignore){\r\n\t//webkit on android need to be handled separately\r\n\t//var a_webkit = (navigator.userAgent.indexOf(\"Android\")!=-1) && (navigator.userAgent.indexOf(\"WebKit\")!=-1);\r\n\tvar source, tracker, timer, drag_mode, scroll_mode, action_mode;\r\n\tvar dblclicktime = 0;\r\n\r\n\tfunction attachTouchEvent(element, name, callback){\r\n\t\t//touch gestures must be disabled when ligthbox is opened\r\n\t\tscheduler.event(element, name, function(e){\r\n\t\t\tif(scheduler._is_lightbox_open()){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tif (ignore(e)) return;\r\n\t\t\t\treturn callback(e);\r\n\t\t\t}\r\n\t\t}, { passive: false });\r\n\t}\r\n\r\n\tfunction check_direction_swipe(s_ev, e_ev, step, max_dy){\r\n\t\tif (!s_ev || !e_ev) return false;\r\n\r\n\t\tvar t = s_ev.target;\r\n\t\twhile(t && t != scheduler._obj){\r\n\t\t\tt = t.parentNode;\r\n\t\t}\r\n\t\tif(t != scheduler._obj){\r\n\t\t\t//swipe outside scheduler\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// ignore swipe in horizontal timeline\r\n\t\tif(scheduler.matrix && scheduler.matrix[scheduler.getState().mode]){\r\n\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\tif(timeline.scrollable){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dy = Math.abs(s_ev.pageY - e_ev.pageY);\r\n\t\tvar dx = Math.abs(s_ev.pageX - e_ev.pageX);\r\n\t\tif (dy < max_dy && dx>step && (!dy || (dx/dy > 3))){\r\n\t\t\tif (s_ev.pageX > e_ev.pageX) {\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t}else {\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction doMouseMove(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tvar dnd = scheduler.getState().drag_mode,\r\n\t\t\ttimeline = scheduler.matrix ? scheduler.matrix[scheduler._mode] : false;\r\n\r\n\t\tvar original_render = scheduler.render_view_data;\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\t//suppress full redraw of timeline on creating event\r\n\t\t\tscheduler.render_view_data = function() {\r\n\t\t\t\tvar id = scheduler.getState().drag_id;\r\n\t\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\t\tvar property = timeline.y_property;\r\n\r\n\t\t\t\tvar evs = scheduler.getEvents(ev.start_date, ev.end_date);\r\n\t\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\t\tif(evs[i][property] != ev[property]){\r\n\t\t\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tev._sorder = evs.length - 1;\r\n\t\t\t\tev._count = evs.length;\r\n\r\n\t\t\t\tthis.render_data([ev], scheduler.getState().mode);\r\n\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tscheduler._on_mouse_move(e);\r\n\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\tscheduler.render_view_data = original_render;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// touchmove\r\n\tattachTouchEvent(document.body, names[0], function(e){\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tvar acc = accessor(e);\r\n\t\tif(!acc) return;\r\n\t\tif (drag_mode){\r\n\t\t\tdoMouseMove(acc);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._update_global_tip();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//if (tracker && a_webkit){\r\n\t\t//\tcheck_direction_swipe(tracker, accessor(e), 0);\r\n\t\t//}\r\n\r\n\t\ttracker = accessor(e);\r\n\t\t//ignore common and scrolling moves\r\n\t\tif (!action_mode) return;\r\n\r\n\t\t//multitouch\r\n\t\tif (!tracker){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//target changed - probably in scroll mode\r\n\r\n\t\tif (source.target != tracker.target || (Math.abs(source.pageX - tracker.pageX) > 5) || (Math.abs(source.pageY - tracker.pageY) > 5)){\r\n\t\t\tscroll_mode = true;\r\n\t\t\tclearTimeout(timer);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t//attachTouchEvent(this._els[\"dhx_cal_data\"][0], \"scroll\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"touchcancel\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"contextmenu\", function(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tif (action_mode){\r\n\t\t\tif (e && e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\t// touchstart\r\n\tattachTouchEvent(this._obj, names[1], function(e){\r\n\t\t// block pull-to-refresh\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.add(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._pointerDragId = e.pointerId;\r\n\r\n\t\tvar fake_event;\r\n\t\tdrag_mode = scroll_mode = false;\r\n\t\taction_mode = true;\r\n\t\tfake_event = tracker = accessor(e);\r\n\r\n\t\tif (!fake_event){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//dbl click\r\n\t\tvar now = new Date();\r\n\r\n\t\tif (!scroll_mode && !drag_mode && now - dblclicktime < 250){\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\twindow.setTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t//fake_event.type = \"dblclick\";\r\n\t\t\t\tscheduler._on_dbl_click(fake_event);\r\n\t\t\t}, 50);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._block_next_stop = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tdblclicktime = now;\r\n\r\n\t\t//drag\r\n\r\n\t\tif (scroll_mode || drag_mode || !scheduler.config.touch_drag)\r\n\t\t\treturn;\r\n\r\n\t\tvar actTask = scheduler._locate_event(document.activeElement);\r\n\t\tvar fakeTask = scheduler._locate_event(fake_event.target);\r\n\t\tvar sourceTask = source? scheduler._locate_event(source.target) : null;\r\n\r\n\t\tif(actTask && fakeTask && actTask == fakeTask && actTask != sourceTask)\r\n\t\t{\r\n\t\t\tif(e.preventDefault) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\tsource = fake_event;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//there is no target\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdrag_mode = true;\r\n\t\t\tvar target = source.target;\r\n\t\t\tvar className = scheduler._getClassName(target);\r\n\t\t\tif (target && className.indexOf(\"dhx_body\") != -1)\r\n\t\t\t\ttarget = target.previousSibling;\r\n\r\n\t\t\tscheduler._on_mouse_down(source, target);\r\n\t\t\tif (scheduler._drag_mode && scheduler._drag_mode != \"create\"){\r\n\t\t\t\tscheduler.for_rendered(scheduler._drag_id, function(node, i) {\r\n\t\t\t\t\tnode.style.display='none';\r\n\t\t\t\t\tscheduler._rendered.splice(i, 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (scheduler.config.touch_tip) {\r\n\t\t\t\tscheduler._show_global_tip();\r\n\t\t\t}\r\n\t\t\tscheduler.updateEvent(scheduler._drag_id);\r\n\t\t},scheduler.config.touch_drag);\r\n\r\n\t\tsource = fake_event;\r\n\t});\r\n\tfunction drag_cancel(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._hide_global_tip();\r\n\t\tif (drag_mode){\r\n\t\t\tscheduler._on_mouse_up( accessor(e) );\r\n\t\t\tscheduler._temp_touch_block = false;\r\n\t\t}\r\n\t\tscheduler._drag_id = null;\r\n\t\tscheduler._drag_mode=null;\r\n\t\tscheduler._drag_pos=null;\r\n\t\tscheduler._pointerDragId = null;\r\n\t\tclearTimeout(timer);\r\n\t\tdrag_mode = action_mode = false;\r\n\t\tscroll_mode = true;\r\n\t}\r\n\r\n\t// touch end\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], names[2], function(e){\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.remove(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tif(scheduler.config.touch_swipe_dates){\r\n\t\t\tif (!drag_mode && check_direction_swipe(source, tracker, 200, 100)) {\r\n\t\t\t\tscheduler._block_next_stop = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (drag_mode) {\r\n\t\t\tscheduler._ignore_next_click = true;\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tdrag_cancel(e);\r\n\t\tif (scheduler._block_next_stop){\r\n\t\t\tscheduler._block_next_stop = false;\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.event(document.body, names[2], drag_cancel);\r\n};\r\n\r\nscheduler._show_global_tip = function(){\r\n\tscheduler._hide_global_tip();\r\n\r\n\tvar toptip = scheduler._global_tip = document.createElement(\"div\");\r\n\ttoptip.className='dhx_global_tip';\r\n\r\n\tscheduler._update_global_tip(1);\r\n\r\n\tdocument.body.appendChild(toptip);\r\n};\r\nscheduler._update_global_tip = function(init){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip){\r\n\t\tvar time = \"\";\r\n\t\tif (scheduler._drag_id && !init){\r\n\t\t\tvar ev = scheduler.getEvent(scheduler._drag_id);\r\n\t\t\tif (ev)\r\n\t\t\t\ttime = \"\" + (ev._timed ? scheduler.templates.event_header(ev.start_date, ev.end_date, ev):scheduler.templates.day_date(ev.start_date, ev.end_date, ev)) + \"
\";\r\n\t\t}\r\n\r\n\t\tif (scheduler._drag_mode == \"create\" || scheduler._drag_mode == \"new-size\")\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_create || \"Drag to create\")+time;\r\n\t\telse\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_move || \"Drag to move\")+time;\r\n\t}\r\n};\r\nscheduler._hide_global_tip = function(){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip && toptip.parentNode){\r\n\t\ttoptip.parentNode.removeChild(toptip);\r\n\t\tscheduler._global_tip = 0;\r\n\t}\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._addThemeClass = function(){\r\n\tdocument.documentElement.setAttribute(\"data-scheduler-theme\", scheduler.skin);\r\n};\r\n\r\nscheduler._skin_settings = {\r\n\tfix_tab_position: [1,0],\r\n\tuse_select_menu_space: [1,0],\r\n\twide_form: [1,0],\r\n\r\n\thour_size_px: [44,42],\r\n\tdisplayed_event_color: [\"#ff4a4a\", \"ffc5ab\"],\r\n\tdisplayed_event_text_color: [\"#ffef80\", \"7e2727\"]\r\n};\r\n\r\nscheduler._skin_xy = {\r\n\tlightbox_additional_height: [90,50],\r\n\tnav_height: [59,22],\r\n\tbar_height: [24,20]\r\n};\r\n\r\n// material skin uses a different box sizing model than other skins, and also requires some post-processing.\r\n// In order to render events correctly, we need to know which box sizing model is used\r\n// We can detect it by styles applied, taking into account that styles may be loaded after scheduler is rendered\r\n\r\nscheduler._is_material_skin = function(){\r\n\tif(!scheduler.skin){\r\n\t\treturn checkIfMaterialSkin();\r\n\t}else{\r\n\t\treturn ((scheduler.skin + \"\").indexOf(\"material\") > -1);\r\n\t}\r\n};\r\n\r\nfunction themeNameFromFile(){\r\n\tvar links = document.getElementsByTagName(\"link\");\r\n\tfor (var i = 0; i < links.length; i++) {\r\n\t\tvar res = links[i].href.match(\"dhtmlxscheduler_([a-z]+).css\");\r\n\t\tif (res){\r\n\t\t\treturn res[1];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nscheduler._build_skin_info = function() {\r\n\tmonitorThemeChange();\r\n\tconst styles = getComputedStyle(this.$container);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-scheduler-theme\");\r\n\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\tlet cssValues = {};\r\n\tlet oldMaterialTheme = false;\r\n\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tcssValues[i] = styles.getPropertyValue(`--dhx-scheduler-xy-${i}`);\r\n\t\t}\r\n\r\n\t\tcssValues.hour_size_px = styles.getPropertyValue(`--dhx-scheduler-config-hour_size_px`);\r\n\t\tcssValues.wide_form = styles.getPropertyValue(`--dhx-scheduler-config-form_wide`);\r\n\r\n\t}else{\r\n\t\tthemeName = themeNameFromFile();\r\n\t\toldMaterialTheme = scheduler._is_material_skin();\r\n\t}\r\n\r\n\r\n\tscheduler._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme,\r\n\t\toldMaterialTheme: oldMaterialTheme,\r\n\t\tvalues: cssValues\r\n\t};\r\n\r\n\tif(scheduler._theme_info.cssVarTheme){\r\n\t\tconst themeVariables = this._theme_info.values;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tif(!isNaN(parseInt(themeVariables[i]))){\r\n\t\t\t\tscheduler.xy[i] = parseInt(themeVariables[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar calculatedMaterial;\r\nfunction checkIfMaterialSkin(){\r\n\tif(calculatedMaterial === undefined){\r\n\t\tvar probe = document.createElement(\"div\");\r\n\t\tprobe.style.position = \"absolute\";\r\n\t\tprobe.style.left = \"-9999px\";\r\n\t\tprobe.style.top = \"-9999px\";\r\n\t\tprobe.innerHTML = \"\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"
\"+\r\n\t\t\"
\";\r\n\t\tdocument.body.appendChild(probe);\r\n\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_cal_scale_placeholder\"));\r\n\t\tvar position = styles.getPropertyValue('position');\r\n\t\tif(position === \"absolute\"){\r\n\t\t\t// page has skins for placeholder element from material skin\r\n\t\t\tcalculatedMaterial = true;\r\n\t\t}else{\r\n\t\t\tcalculatedMaterial = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\tcalculatedMaterial = null;\r\n\t\t\tif(probe && probe.parentNode){\r\n\t\t\t\tprobe.parentNode.removeChild(probe);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n\treturn calculatedMaterial;\r\n}\r\n\r\nvar cachedBorderBoxValue;\r\nfunction checkIfBorderBoxStyling(){\r\n\tif(scheduler._is_material_skin()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\tif(cachedBorderBoxValue === undefined){\r\n\t\t\tvar probe = document.createElement(\"div\");\r\n\t\t\tprobe.style.position = \"absolute\";\r\n\t\t\tprobe.style.left = \"-9999px\";\r\n\t\t\tprobe.style.top = \"-9999px\";\r\n\t\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\t\"
\" +\r\n\t\t\t\t\t\"
\"+\r\n\t\t\t\"
\";\r\n\r\n\t\t\tdocument.body.appendChild(probe);\r\n\t\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_body\"));\r\n\t\t\tvar boxSizing = styles.getPropertyValue('box-sizing');\r\n\t\t\tdocument.body.removeChild(probe);\r\n\t\t\tcachedBorderBoxValue = !!(boxSizing === \"border-box\");\r\n\r\n\t\t\tif(!cachedBorderBoxValue){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tcachedBorderBoxValue = undefined;\r\n\t\t\t\t}, 1000);// recalculate in case scheduler initialized before skin is loaded\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn cachedBorderBoxValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction refreshAfterLoad(){\r\n\tif(scheduler._is_material_skin() || scheduler._border_box_events()){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar oldStyling = cachedBorderBoxValue;\r\n\tcachedBorderBoxValue = undefined;\r\n\tcalculatedMaterial = undefined;\r\n\tvar newStyling = checkIfBorderBoxStyling();\r\n\r\n\t// if box styling model changed - means scheduler was rendered before stylesheet was loaded or parsed inline\r\n\t// repaint scheduler in order to apply new styles\r\n\tif(oldStyling !== newStyling && scheduler.$container && scheduler.getState().mode){\r\n\t\tscheduler.setCurrentView();\r\n\t}\r\n}\r\nscheduler.event(window, 'DOMContentLoaded', refreshAfterLoad);\r\nscheduler.event(window, 'load', refreshAfterLoad);\r\n\r\nscheduler._border_box_events = function(){\r\n\treturn checkIfBorderBoxStyling();\r\n};\r\n\r\nscheduler._configure = function(col, data, skin){\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\")\r\n\t\t\tcol[key] = data[key][skin];\r\n};\r\n\r\nscheduler.setSkin = function(value){\r\n\tthis.skin = value;\r\n\tscheduler._addThemeClass();\r\n\tif(scheduler.$container){\r\n\t\tthis._skin_init();\r\n\t\tthis.render();\r\n\t}\r\n\t\r\n\t//\r\n};\r\n\r\nfunction flatSkinHourScale(date){\r\n\tvar min = date.getMinutes();\r\n\tmin = min < 10 ? \"0\"+min : min;\r\n\tvar html = \"
\"+ date.getHours() +\" \"+\r\n\t\t\"
\"+ min +\" \";\r\n\treturn html;\r\n}\r\n\r\nlet monitorIntervalId = null;\r\nfunction monitorThemeChange(){\r\n\tconst container = scheduler.$container;\r\n\t\r\n\tclearInterval(monitorIntervalId);\r\n\tif(container){\r\n\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-scheduler-theme');\r\n\t\t\tif(csstheme && csstheme !== scheduler.skin){\r\n\t\t\t\tscheduler.setSkin(csstheme);\r\n\t\t\t}\r\n\r\n\t\t}, 100);\r\n\t}\r\n}\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tclearInterval(monitorIntervalId);\r\n});\r\n\r\nscheduler._skin_init = function(){\r\n\tthis._build_skin_info();\r\n\r\n\tif (!this.skin){\r\n\t\tthis.skin = this._theme_info.theme;\r\n\t}\r\n\tscheduler._addThemeClass();\r\n\tif (scheduler.skin === \"flat\"){\r\n\t\t// scheduler.xy.scale_height = 35;\r\n\t\tscheduler.templates.hour_scale = flatSkinHourScale;\r\n\t}else if (scheduler.templates.hour_scale === flatSkinHourScale){\r\n\t\tscheduler.templates.hour_scale = scheduler.date.date_to_str(scheduler.config.hour_date);\r\n\t}\r\n\r\n\r\n\r\n\t//scheduler._lightbox_template=\"
\";\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\r\n\t\tvar date_to_str = scheduler.date.date_to_str(\"%d\");\r\n\t\tif(!scheduler.templates._old_month_day){\r\n\t\t\tscheduler.templates._old_month_day = scheduler.templates.month_day;\r\n\t\t}\r\n\t\tvar old_month_day = scheduler.templates._old_month_day;\r\n\t\tscheduler.templates.month_day = function(date) {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\tvar label = date_to_str(date);\r\n\t\t\t\tif (date.getDate() == 1) {\r\n\t\t\t\t\tlabel = scheduler.locale.date.month_full[date.getMonth()] + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\tif (+date == +scheduler.date.date_part(this._currentDate())) {\r\n\t\t\t\t\tlabel = scheduler.locale.labels.dhx_cal_today_button + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t} else {\r\n\t\t\t\treturn old_month_day.call(this, date);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// tab classes\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tconst tabs = scheduler._els[\"dhx_cal_navline\"][0].querySelectorAll('[data-tab]');\r\n\t\t\ttabs.forEach((tab) => {\r\n\t\t\t\tconst view = tab.getAttribute(\"data-tab\") || tab.getAttribute(\"name\");\r\n\r\n\t\t\t\tswitch (view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\tcase \"day_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\tcase \"week_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"month\":\r\n\t\t\t\t\tcase \"month_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treorderTabs(scheduler._els[\"dhx_cal_navline\"][0]);\r\n\r\n\t\t}\r\n\t}, {once: true});\r\n\r\n\tfunction reorderTabs(container) {\r\n\t\t// segmented tabs should go first\r\n\r\n\t\tif(scheduler.config.header){\r\n\t\t\treturn;\r\n\t\t\t// don't reorder tabs if header is defined via config\r\n\t\t}\r\n\t\tconst tabs = Array.from(container.querySelectorAll('.dhx_cal_tab'));\r\n\t\r\n\t\t// segmented tabs\r\n\t\tconst order = ['day', 'week', 'month'];\r\n\t\r\n\t\tconst specialTabs = order.map(tabName => \r\n\t\t\ttabs.find(tab => tab.getAttribute('data-tab') === tabName)\r\n\t\t).filter(tab => tab !== undefined);\r\n\t\r\n\t\tlet firstTab = tabs.length > 0 ? tabs[0] : null;\r\n\r\n\t\tspecialTabs.reverse().forEach(tab => {\r\n\t\t\tcontainer.insertBefore(tab, firstTab);\r\n\t\t\tfirstTab = tab;\r\n\t\t});\r\n\t}\r\n\r\n\t// scheduler._skin_init = function(){\r\n\t// \tthis._build_skin_info();\r\n\t// \tthis.skin = this._theme_info.theme;\r\n\t// };\r\n};\r\n\r\n\r\n\r\n}","export default function DataProcessorEvents(scheduler, dp){\r\n\tthis.$scheduler = scheduler;\r\n\tthis.$dp = dp;\r\n\tthis._dataProcessorHandlers = [];\r\n\r\n\tthis.attach = function () {\r\n\t\tvar dp = this.$dp;\r\n\t\tvar scheduler = this.$scheduler;\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\t\t\tif (!this._validId(id)) return;\r\n\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false); return true; }\r\n\t\t\tif (z==\"deleted\") return false;\r\n\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\treturn false;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventChanged\", function(id) { \r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onClearAll\", function() { \r\n\t\t\t// clear dataprocessor state when scheduler is reset\r\n\t\t\tdp._in_progress={};\r\n\t\t\tdp._invalid={};\r\n\t\t\tdp.updatedRows = [];\r\n\t\t\tdp._waitMode = 0;\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tif (scheduler.getEvent(id)){\r\n\t\t\t\tscheduler.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\t\tscheduler.deleteEvent(id);\r\n\t\t\t} else if (scheduler._add_rec_marker)\r\n\t\t\t\tscheduler._update_callback(upd, id);\r\n\t\t});\r\n\t};\r\n\r\n\tthis.detach = function () {\r\n\t\tfor (var key in this._dataProcessorHandlers) {\r\n\t\t\tvar handler = this._dataProcessorHandlers[key];\r\n\t\t\tthis.$scheduler.detachEvent(handler);\r\n\t\t}\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t};\r\n}\r\n\r\nexport function extendScheduler(scheduler, dp){\r\n\tscheduler._validId=function(id){\r\n\t\tif(this._is_virtual_event){\r\n\t\t\treturn !this._is_virtual_event(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\tscheduler.setUserData=function(id,name,value){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev) ev[name]=value;\r\n\t\t}else{\r\n\t\t\tthis._userdata[name]=value;\r\n\t\t}\r\n\t};\r\n\tscheduler.getUserData=function(id,name){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev)\r\n\t\t\t\treturn ev[name];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\treturn this._userdata[name];\r\n\t\t}\r\n\t};\r\n\tscheduler._set_event_text_style=function(id,style){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tthis.for_rendered(id,function(r){\r\n\t\t\tr.style.cssText+=\";\"+style;\r\n\t\t});\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tev[\"_text_style\"]=style;\r\n\t\tthis.event_updated(ev);\r\n\t};\r\n\tscheduler._update_callback = function(upd,id){\r\n\t\tvar data = scheduler._xmlNodeToJSON(upd.firstChild);\r\n\t\t//fix for updates of recurring events\r\n\t\tif (data.rec_type == \"none\") data.rec_pattern = \"none\";\r\n\t\tdata.text = data.text||data._tagvalue;\r\n\t\tdata.start_date = scheduler._helpers.parseDate(data.start_date);\r\n\t\tdata.end_date = scheduler._helpers.parseDate(data.end_date);\r\n\t\tscheduler.addEvent(data);\r\n\t\tif (scheduler._add_rec_marker)\r\n\t\t\tscheduler.setCurrentView();\r\n\t};\r\n\tscheduler._dp_change_event_id = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tscheduler.changeEventId(id, new_id);\r\n\t};\r\n\tscheduler._dp_hook_delete = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\r\n\t\tif(new_id && id != new_id){\r\n\t\t\tif(this.getUserData(id, dp.action_param) == \"true_deleted\")\r\n\t\t\t\tthis.setUserData(id, dp.action_param, \"updated\");\r\n\r\n\t\t\tthis.changeEventId(id, new_id);\r\n\t\t}\r\n\t\treturn this.deleteEvent(new_id, true);\r\n\t};\r\n\r\n\tscheduler.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\tscheduler.setDp();\r\n}","import DataProcessorEvents from \"./dataprocessor_hooks\";\r\nimport { extendScheduler } from \"./dataprocessor_hooks\";\r\nimport eventable from \"../../utils/eventable\";\r\nimport global from \"../../global\";\r\n\r\n/**\r\n *\t@desc: constructor, data processor object\r\n *\t@param: serverProcessorURL - url used for update\r\n *\t@type: public\r\n */\r\nexport function DataProcessor(serverProcessorURL){\r\n\tthis.serverProcessor = serverProcessorURL;\r\n\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\tthis.object = null;\r\n\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\tthis.autoUpdate = true;\r\n\tthis.updateMode = \"cell\";\r\n\tthis._tMode = \"GET\";\r\n\tthis._headers = null;\r\n\tthis._payload = null;\r\n\tthis.post_delim = \"_\";\r\n\r\n\tthis._waitMode = 0;\r\n\tthis._in_progress = {};\r\n\tthis._invalid = {};\r\n\tthis.messages = [];\r\n\r\n\tthis.styles = {\r\n\t\tupdated: \"font-weight:bold;\",\r\n\t\tinserted: \"font-weight:bold;\",\r\n\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\terror: \"color:red;\",\r\n\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t};\r\n\tthis.enableUTFencoding(true);\r\n\teventable(this); // TODO: need to update\r\n\r\n\treturn this;\r\n}\r\nDataProcessor.prototype = {\r\n\tsetTransactionMode: function (mode, total) {\r\n\t\tif (typeof mode == \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (mode.headers !== undefined) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (mode.payload !== undefined) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode == \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t},\r\n\tescape: function (data) {\r\n\t\tif (this._utf)\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\telse\r\n\t\t\treturn escape(data);\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to set escaping mode\r\n\t *\t@param: true - utf based escaping, simple - use current page encoding\r\n\t *\t@type: public\r\n\t */\r\n\tenableUTFencoding: function (mode) {\r\n\t\tthis._utf = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to define, which column may trigger update\r\n\t *\t@param: val - array or list of true/false values\r\n\t *\t@type: public\r\n\t */\r\n\tsetDataColumns: function (val) {\r\n\t\tthis._columns = (typeof val == \"string\") ? val.split(\",\") : val;\r\n\t},\r\n\t/**\r\n\t *\t@desc: get state of updating\r\n\t *\t@returns: true - all in sync with server, false - some items not updated yet.\r\n\t *\t@type: public\r\n\t */\r\n\tgetSyncState: function () {\r\n\t\treturn !this.updatedRows.length;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable named field for data syncing, will use column ids for grid\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenableDataNames: function (mode) {\r\n\t\tthis._endnm = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenablePartialDataSend: function (mode) {\r\n\t\tthis._changed = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: set if rows should be send to server automatically\r\n\t *\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdateMode: function (mode, dnd) {\r\n\t\tthis.autoUpdate = (mode == \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t},\r\n\tignore: function (code, master) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || window);\r\n\t\tthis._silent_mode = false;\r\n\t},\r\n\t/**\r\n\t *\t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@param: state - true for \"updated\", false for \"not updated\"\r\n\t *\t@param: mode - update mode name\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdated: function (rowId, state, mode) {\r\n\t\tif (this._silent_mode) return;\r\n\t\tvar ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tvar existing = this.$scheduler.getUserData(rowId, this.action_param);\r\n\t\tif (existing && mode == \"updated\") mode = existing;\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); //clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, mode);\r\n\t\t\tif (this._in_progress[rowId])\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\r\n\t},\r\n\r\n\tmarkRow: function (id, state, mode) {\r\n\t\tvar str = \"\";\r\n\t\tvar invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t//default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + str;\r\n\r\n\t\t\tthis.$scheduler[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (var i = 0; i < invalid.details.length; i++)\r\n\t\t\t\t\tif (invalid.details[i])\r\n\t\t\t\t\t\tthis.$scheduler[this._methods[1]](id, i, str);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetActionByState: function(state) {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\t\treturn \"update\";\r\n\t},\r\n\r\n\tgetState: function (id) {\r\n\t\treturn this.$scheduler.getUserData(id, this.action_param);\r\n\t},\r\n\tis_invalid: function (id) {\r\n\t\treturn this._invalid[id];\r\n\t},\r\n\tset_invalid: function (id, mode, details) {\r\n\t\tif (details) mode = {\r\n\t\t\tvalue: mode, details: details, toString: function () {\r\n\t\t\t\treturn this.value.toString();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis._invalid[id] = mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@type: public\r\n\t */\r\n\tcheckBeforeUpdate: function (rowId) {\r\n\t\treturn true;\r\n\t},\r\n\t/**\r\n\t *\t@desc: send row(s) values to server\r\n\t *\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t *\t@type: public\r\n\t */\r\n\tsendData: function (rowId) {\r\n\t\tif (this.$scheduler.editStop) this.$scheduler.editStop();\r\n\r\n\t\tif (typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\r\n\t\tif (this._in_progress[rowId]) return false;\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) return false;\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t},\r\n\t_beforeSendData: function (data, rowId) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) return false;\r\n\t\tthis._sendData(data, rowId);\r\n\t},\r\n\tserialize: function (data, id) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tif (typeof id != \"undefined\")\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\telse {\r\n\t\t\tvar stack = [];\r\n\t\t\tvar keys = [];\r\n\t\t\tfor (var key in data)\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this.post_delim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$scheduler.security_key)\r\n\t\t\t\tstack.push(\"dhx_security=\" + (this.$scheduler.security_key));\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t},\r\n\tserialize_one: function (data, pref) {\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tvar stack = [];\r\n\t\tvar serialized = \"\";\r\n\t\tfor (var key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = data[key];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t},\r\n\t_applyPayload: function (url) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._payload)\r\n\t\t\tfor (var key in this._payload)\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\treturn url;\r\n\t},\r\n\t_sendData: function (dataToSend, rowId) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tvar state = this.getState(rowId);\r\n\t\t\tvar action = this.getActionByState(state);\r\n\t\t\tvar _onResolvedCreateUpdate = function (tag) {\r\n\t\t\t\tvar resultState = state;\r\n\t\t\t\tif(tag && tag.responseText && tag.setRequestHeader){\r\n\t\t\t\t\tif(tag.status !== 200){\r\n\t\t\t\t\t\tresultState = \"error\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\ttag = JSON.parse(tag.responseText);\r\n\t\t\t\t\t} catch (e){}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresultState = resultState || \"updated\";\r\n\t\t\t\tvar sid = rowId;\r\n\t\t\t\tvar tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\tresultState = tag.action || resultState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tself.afterUpdateCallback(sid, tid, resultState, tag);\r\n\t\t\t};\r\n\r\n\t\t\tconst routerMode = \"event\";\r\n\t\t\tvar actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tactionPromise = this._router(routerMode, action, dataToSend, rowId);\r\n\t\t\t} else {\r\n\t\t\t\tswitch (state) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch(function(error) {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar queryParams = {\r\n\t\t\tcallback: function(xml) {\r\n\t\t\t\tvar ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (var key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.afterUpdate(self, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: self._headers\r\n\t\t};\r\n\r\n\t\tvar urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + this.$scheduler.getUserData(0, \"version\")].join(\"&\")) : \"\");\r\n\t\tvar url = this._applyPayload(urlParams);\r\n\t\tvar data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tvar preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (var key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata: data\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t},\r\n\tsendAllData: function () {\r\n\t\tif (!this.updatedRows.length || this.updateMode === \"off\") { // FIXME: need to leave checking 'this.updateMode === \"off\"'?\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tvar valid = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t_getAllData: function (rowId) {\r\n\t\tvar out = {};\r\n\t\tvar has_one = false;\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thas_one = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\t\treturn has_one ? out : null;\r\n\t},\r\n\r\n\tfindRow: function (pattern) {\r\n\t\tvar i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++)\r\n\t\t\tif (pattern == this.updatedRows[i]) break;\r\n\t\treturn i;\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: define custom actions\r\n\t *\t@param: name - name of action, same as value of action attribute\r\n\t *\t@param: handler - custom function, which receives a XMl response content for action\r\n\t *\t@type: private\r\n\t */\r\n\tdefineAction: function (name, handler) {\r\n\t\tif (!this._uActions) this._uActions = {};\r\n\t\tthis._uActions[name] = handler;\r\n\t},\r\n\r\n\t/**\r\n\t *\t @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t *\t @param: sid - id of item before update\r\n\t *\t @param: tid - id of item after up0ate\r\n\t *\t @param: action - action name\r\n\t *\t @type: public\r\n\t *\t @topic: 0\r\n\t */\r\n\tafterUpdateCallback: function (sid, tid, action, btag) {\r\n\t\tif(!this.$scheduler){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar marker = sid;\r\n\t\tvar correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tvar originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) {\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$scheduler[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"true_deleted\");\r\n\t\t\t\tthis.$scheduler[this._methods[3]](sid, tid);\r\n\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t},\r\n\r\n\t_errorResponse: function (xml, id){\r\n\t\tif(this.$scheduler && this.$scheduler.callEvent){\r\n\t\t\tthis.$scheduler.callEvent(\"onSaveError\", [id, xml.xmlDoc]);\r\n\t\t}\r\n\t\treturn this.cleanUpdate(id);\r\n\t},\r\n\r\n\t_setDefaultTransactionMode: function () {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t},\r\n\t\r\n\t/**\r\n\t *\t@desc: response from server\r\n\t *\t@param: xml - XMLLoader object with response XML\r\n\t *\t@type: private\r\n\t */\r\n\tafterUpdate: function (that, xml, id) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (xml.xmlDoc.status !== 200){\r\n\t\t\tthis._errorResponse(xml, id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to use json first\r\n\t\tvar tag;\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t} catch (e) {\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tag) {\r\n\t\t\tvar action = tag.action || this.getState(id) || \"updated\";\r\n\t\t\tvar sid = tag.sid || id[0];\r\n\t\t\tvar tid = tag.tid || id[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag);\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tvar top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\t\tvar atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < atag.length; i++) {\r\n\t\t\tvar btag = atag[i];\r\n\t\t\tvar action = btag.getAttribute(\"type\");\r\n\t\t\tvar sid = btag.getAttribute(\"sid\");\r\n\t\t\tvar tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t},\r\n\tcleanUpdate: function (id) {\r\n\t\tif (id)\r\n\t\t\tfor (var i = 0; i < id.length; i++)\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t},\r\n\tfinalizeUpdate: function () {\r\n\t\tif (this._waitMode) this._waitMode--;\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length)\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: initializes data-processor\r\n\t *\t@param: scheduler - dhtmlxScheduler object to attach this data-processor to\r\n\t *\t@type: public\r\n\t */\r\n\tinit: function (scheduler) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$scheduler = scheduler;\r\n\t\tif (this.$scheduler._dp_init) {\r\n\t\t\tthis.$scheduler._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis._methods=this._methods||[\"_set_event_text_style\",\"\",\"_dp_change_event_id\",\"_dp_hook_delete\"];\r\n\t\textendScheduler(this.$scheduler, this);\r\n\t\tvar dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$scheduler._dp;\r\n\t\t\tdelete this.$scheduler._dataprocessor;\r\n\t\t\tdelete this.$scheduler._set_event_text_style;\r\n\t\t\tdelete this.$scheduler._dp_change_event_id;\r\n\t\t\tdelete this.$scheduler._dp_hook_delete;\r\n\t\t\tdelete this.$scheduler;\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$scheduler.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\r\n\t\tscheduler._dataprocessor=this;\r\n\t},\r\n\r\n\tsetOnAfterUpdate: function (ev) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", ev);\r\n\t},\r\n\tsetOnBeforeUpdateHandler: function (func) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", func);\r\n\t},\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate: function (interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._need_update = false;\r\n\t\t//this._loader = null;\r\n\t\tthis._update_busy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", function (sid, action, tid, xml_node) {\r\n\t\t\tthis.afterAutoUpdate(sid, action, tid, xml_node);\r\n\t\t});\r\n\t\tthis.attachEvent(\"onFullSync\", function () {\r\n\t\t\tthis.fullSync();\r\n\t\t});\r\n\r\n\t\tvar self = this;\r\n\t\tlet intervalId = global.setInterval(function () {\r\n\t\t\tself.loadUpdate();\r\n\t\t}, interval);\r\n\t\tthis.attachEvent(\"onDestroy\", function(){\r\n\t\t\tclearInterval(intervalId);\r\n\t\t});\r\n\t},\r\n\r\n\t/* process updating request answer\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate: function (sid, action, tid, xml_node) {\r\n\t\tif (action == 'collision') {\r\n\t\t\tthis._need_update = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync: function () {\r\n\t\tif (this._need_update) {\r\n\t\t\tthis._need_update = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates: function (url, callback) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._update_busy)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\tthis._update_busy = true;\r\n\r\n\t\tajax.get(url, callback);\r\n\t},\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\t_getXmlNodeValue: function(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t},\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate: function () {\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tvar version = this.$scheduler.getUserData(0, \"version\");\r\n\t\tvar url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, function (xml) {\r\n\t\t\tvar vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tself.$scheduler.setUserData(0, \"version\", self._getXmlNodeValue(vers[0]));\r\n\r\n\t\t\tvar updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tself._silent_mode = true;\r\n\r\n\t\t\t\tfor (var i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tvar status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tvar id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tvar parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tself._silent_mode = false;\r\n\t\t\t}\r\n\t\t\tself._update_busy = false;\r\n\t\t\tself = null;\r\n\t\t});\r\n\t},\r\n\r\n\tdestructor: function() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {};\r\n\t\tthis._invalid = {};\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t},\r\n\r\n\turl: function(url) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t},\r\n\r\n\t_serializeAsJSON: function(data) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tvar copy = this.$scheduler.utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t},\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\t_cleanupArgumentsBeforeSend: function(dataToSend) {\r\n\t\tvar processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(var i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t},\r\n\t_cleanupItemBeforeSend: function(updatedItem) {\r\n\t\tvar output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t_forEachUpdatedRow: function(code) {\r\n\t\tvar updatedRows = this.updatedRows.slice();\r\n\t\tfor (var i = 0; i < updatedRows.length; i++) {\r\n\t\t\tvar rowId = updatedRows[i];\r\n\t\t\tif (this.$scheduler.getUserData(rowId, this.action_param)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_prepareItemForJson(item){\r\n\t\tconst processedItem = {};\r\n\t\tconst scheduler = this.$scheduler;\r\n\t\tconst copy = scheduler.utils.copy(item);\r\n\t\tfor (let i in copy) {\r\n\t\t\tlet prop = copy[i];\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (prop){\r\n\t\t\t\tif(prop.getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(prop);\r\n\t\t\t\t} else if(typeof prop == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareItemForJson(prop);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = prop; \r\n\t\t\t\t}\r\n\t\t\t} else if (prop !== undefined){\r\n\t\t\t\tprocessedItem[i] = prop; \r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_prepareItemForForm(item){\r\n\t\tconst processedItem = {};\r\n\t\tconst scheduler = this.$scheduler;\r\n\t\tconst copy = scheduler.utils.copy(item);\r\n\t\tfor (var i in copy) {\r\n\t\t\tlet prop = copy[i];\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (prop) {\r\n\t\t\t\tif(prop.getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(prop);\r\n\t\t\t\t} else if(typeof prop == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareItemForForm(prop);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = prop;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tprocessedItem[i] = \"\"; // for all falthy values\r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_prepareDataItem: function(item) {\r\n\t\tif(this._serializeAsJson){\r\n\t\t\treturn this._prepareItemForJson(item);\r\n\t\t}else {\r\n\t\t\treturn this._prepareItemForForm(item);\r\n\t\t}\r\n\t},\r\n\t_getRowData: function(id) {\r\n\t\tvar dataItem = this.$scheduler.getEvent(id);\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id: id };\r\n\t\t}\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n};\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.createDataProcessor = function(config) {\r\n\tvar router;\r\n\tvar tMode;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if(config.hasOwnProperty(\"event\")){\r\n\t\trouter = config;\r\n\t}\r\n\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\r\n\tvar dp = new DataProcessor(config.url);\r\n\tdp.init(scheduler);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter: router\r\n\t}, config.batchUpdate); // FIXME: config.batchUpdate where it is explained?\r\n\treturn dp;\r\n};\r\n\r\nscheduler.DataProcessor = DataProcessor;\r\n\r\n}\r\n\r\n//var dataProcessor = global.dataProcessor = DataProcessor; // for old","import utils from \"./utils/utils\";\r\nimport domHelpers from \"./utils/dom_helpers\";\r\n\r\n\r\nexport default function(scheduler) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"scheduler_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tscheduler.event(modality.cover, \"keydown\", modal_key);\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, classValue, result) {\r\n\t\tvar buttonAriaAttrs = scheduler._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = (classValue || \"\").toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; \r\n\t\treturn ``;\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"scheduler_message_area dhtmlx_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"
\" + text.text + \"
\";\r\n\t\tmessage.className = \"scheduler-info dhtmlx-info scheduler-\" + text.type + \" dhtmlx-\" + text.type;\r\n\t\tscheduler.event(message, \"click\",function (e) {\r\n if(text.callback) {\r\n text.callback.call(this, e);\r\n }\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t});\r\n\r\n\t\tscheduler._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Scheduler is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tscheduler._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" scheduler_modal_box dhtmlx_modal_box scheduler-\" + config.type + \" dhtmlx-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '';\r\n\t\tinner += '';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tscheduler.event(box, \"click\", function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".scheduler_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t});\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tscheduler.event(box, \"keydown\", modal_key);\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tscheduler.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id, callback) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id, callback: callback};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tscheduler.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tscheduler.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"اليوم\",\r\n\t\tday_tab: \"يوم\",\r\n\t\tweek_tab: \"أسبوع\",\r\n\t\tmonth_tab: \"شهر\",\r\n\t\tnew_event: \"حدث جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tfull_day: \"طوال اليوم\",\r\n\r\n\t\tconfirm_recurring: \"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟\",\r\n\t\tsection_recurring: \"تكرار الحدث\",\r\n\t\tbutton_recurring: \"تعطيل\",\r\n\t\tbutton_recurring_open: \"تمكين\",\r\n\t\tbutton_edit_series: \"تحرير سلسلة\",\r\n\t\tbutton_edit_occurrence: \"تعديل نسخة\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"جدول\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"يومي\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"أسبوعي\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"شهري\",\r\n\t\trepeat_radio_year: \"سنوي\",\r\n\t\trepeat_radio_day_type: \"كل\",\r\n\t\trepeat_text_day_count: \"يوم\",\r\n\t\trepeat_radio_day_type2: \"كل يوم عمل\",\r\n\t\trepeat_week: \" تكرار كل\",\r\n\t\trepeat_text_week_count: \"أسبوع في الأيام التالية:\",\r\n\t\trepeat_radio_month_type: \"تكرار\",\r\n\t\trepeat_radio_month_start: \"في\",\r\n\t\trepeat_text_month_day: \"يوم كل\",\r\n\t\trepeat_text_month_count: \"شهر\",\r\n\t\trepeat_text_month_count2_before: \"كل\",\r\n\t\trepeat_text_month_count2_after: \"شهر\",\r\n\t\trepeat_year_label: \"في\",\r\n\t\tselect_year_day2: \"من\",\r\n\t\trepeat_text_year_day: \"يوم\",\r\n\t\tselect_year_month: \"شهر\",\r\n\t\trepeat_radio_end: \"بدون تاريخ انتهاء\",\r\n\t\trepeat_text_occurences_count: \"تكرارات\",\r\n\t\trepeat_radio_end2: \"بعد\",\r\n\t\trepeat_radio_end3: \"ينتهي في\",\r\n\r\n\t\trepeat_never: \"أبداً\",\r\n\t\trepeat_daily: \"كل يوم\",\r\n\t\trepeat_workdays: \"كل يوم عمل\",\r\n\t\trepeat_weekly: \"كل أسبوع\",\r\n\t\trepeat_monthly: \"كل شهر\",\r\n\t\trepeat_yearly: \"كل سنة\",\r\n\t\trepeat_custom: \"تخصيص\",\r\n\t\trepeat_freq_day: \"يوم\",\r\n\t\trepeat_freq_week: \"أسبوع\",\r\n\t\trepeat_freq_month: \"شهر\",\r\n\t\trepeat_freq_year: \"سنة\",\r\n\t\trepeat_on_date: \"في التاريخ\",\r\n\t\trepeat_ends: \"ينتهي\",\r\n\r\n\t\tmonth_for_recurring: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_for_recurring: [\"الأحد\", \"الإثنين\", \"الثلاثاء\", \"الأربعاء\", \"الخميس\", \"الجمعة\", \"السبت\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n Translation by Sofya Morozova\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [ \"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сёння\",\r\n\t\tday_tab: \"Дзень\",\r\n\t\tweek_tab: \"Тыдзень\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новая падзея\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", //Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tfull_day: \"Увесь дзень\",\r\n\r\n\t\tconfirm_recurring: \"Вы хочаце змяніць усю серыю паўтаральных падзей?\",\r\n\t\tsection_recurring: \"Паўтарэнне\",\r\n\t\tbutton_recurring: \"Адключана\",\r\n\t\tbutton_recurring_open: \"Уключана\",\r\n\t\tbutton_edit_series: \"Рэдагаваць серыю\",\r\n\t\tbutton_edit_occurrence: \"Рэдагаваць асобнік\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Спіс\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Апісанне\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Спіс\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Спic\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Дзень\",\r\n\t\trepeat_radio_week: \"Тыдзень\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Кожны\",\r\n\t\trepeat_text_day_count: \"дзень\",\r\n\t\trepeat_radio_day_type2: \"Кожны працоўны дзень\",\r\n\t\trepeat_week: \" Паўтараць кожны\",\r\n\t\trepeat_text_week_count: \"тыдзень\",\r\n\t\trepeat_radio_month_type: \"Паўтараць\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" чысла кожнага\",\r\n\t\trepeat_text_month_count: \"месяцу\",\r\n\t\trepeat_text_month_count2_before: \"кожны \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"дзень\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты заканчэння\",\r\n\t\trepeat_text_occurences_count: \"паўтораў\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\trepeat_radio_end3: \"Да \",\r\n\r\n\t\trepeat_never: \"Ніколі\",\r\n\t\trepeat_daily: \"Кожны дзень\",\r\n\t\trepeat_workdays: \"Кожны працоўны дзень\",\r\n\t\trepeat_weekly: \"Кожны тыдзень\",\r\n\t\trepeat_monthly: \"Кожны месяц\",\r\n\t\trepeat_yearly: \"Кожны год\",\r\n\t\trepeat_custom: \"Наладжвальны\",\r\n\t\trepeat_freq_day: \"Дзень\",\r\n\t\trepeat_freq_week: \"Тыдзень\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Заканчваецца\",\r\n\r\n\t\tmonth_for_recurring: [\"Студзеня\", \"Лютага\", \"Сакавіка\", \"Красавіка\", \"Мая\", \"Чэрвеня\", \"Ліпeня\", \"Жніўня\", \"Верасня\", \"Кастрычніка\", \"Лістапада\", \"Снежня\"],\r\n\t\tday_for_recurring: [\"Нядзелю\", \"Панядзелак\", \"Аўторак\", \"Сераду\", \"Чацвер\", \"Пятніцу\", \"Суботу\"]\r\n\t}\r\n};\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hui\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Setmana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nou esdeveniment\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", //\"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tfull_day: \"Tot el dia\",\r\n\r\n\t\tconfirm_recurring: \"¿Desitja modificar el conjunt d'esdeveniments repetits?\",\r\n\t\tsection_recurring: \"Repeteixca l'esdeveniment\",\r\n\t\tbutton_recurring: \"Impedit\",\r\n\t\tbutton_recurring_open: \"Permés\",\r\n\t\tbutton_edit_series: \"Edit sèrie\",\r\n\t\tbutton_edit_occurrence: \"Edita Instància\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descripció\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Any\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Taula\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diari\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Setmanal\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mensual\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada dia laborable\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"setmana els dies següents:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada\",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"de\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sense data de finalització\",\r\n\t\trepeat_text_occurences_count: \"ocurrències\",\r\n\t\trepeat_radio_end2: \"Després\",\r\n\t\trepeat_radio_end3: \"Finalitzar el\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Cada dia\",\r\n\t\trepeat_workdays: \"Cada dia laborable\",\r\n\t\trepeat_weekly: \"Cada setmana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada any\",\r\n\t\trepeat_custom: \"Personalitzat\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Setmana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Any\",\r\n\t\trepeat_on_date: \"En la data\",\r\n\t\trepeat_ends: \"Finalitza\",\r\n\r\n\t\tmonth_for_recurring: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tday_for_recurring: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"]\r\n\t}\r\n};","/*\r\nTranslation by FreezeSoul\r\n*/\r\n//scheduler.config.day_date=\"%M %d日 %D\";\r\n//scheduler.config.default_date=\"%Y年 %M %d日\";\r\n//scheduler.config.month_date=\"%Y年 %M\";\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今天\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"周\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新建日程\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", //Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tfull_day: \"整天\",\r\n\r\n\t\tconfirm_recurring:\"请确认是否将日程设为重复模式?\",\r\n\t\tsection_recurring:\"重复周期\",\r\n\t\tbutton_recurring:\"禁用\",\r\n\t\tbutton_recurring_open:\"启用\",\r\n\t\tbutton_edit_series: \"编辑系列\",\r\n\t\tbutton_edit_occurrence: \"编辑实例\",\r\n\t\t\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"议程\",\r\n\t\tdate:\"日期\",\r\n\t\tdescription:\"说明\",\r\n\t\t\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"议程\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab:\"电网\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"按天\",\r\n\t\trepeat_radio_week: \"按周\",\r\n\t\trepeat_radio_month: \"按月\",\r\n\t\trepeat_radio_year: \"按年\",\r\n\t\trepeat_radio_day_type: \"每\",\r\n\t\trepeat_text_day_count: \"天\",\r\n\t\trepeat_radio_day_type2: \"每个工作日\",\r\n\t\trepeat_week: \" 重复 每\",\r\n\t\trepeat_text_week_count: \"星期的:\",\r\n\t\trepeat_radio_month_type: \"重复\",\r\n\t\trepeat_radio_month_start: \"在\",\r\n\t\trepeat_text_month_day: \"日 每\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"每\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"在\",\r\n\t\tselect_year_day2: \"的\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"无结束日期\",\r\n\t\trepeat_text_occurences_count: \"次结束\",\r\n\t\trepeat_radio_end2: \"重复\",\r\n\t\trepeat_radio_end3: \"结束于\",\r\n\t\t\r\n\t\trepeat_never: \"从不\",\r\n\t\trepeat_daily: \"每天\",\r\n\t\trepeat_workdays: \"每个工作日\",\r\n\t\trepeat_weekly: \"每周\",\r\n\t\trepeat_monthly: \"每月\",\r\n\t\trepeat_yearly: \"每年\",\r\n\t\trepeat_custom: \"自定义\",\r\n\t\trepeat_freq_day: \"天\",\r\n\t\trepeat_freq_week: \"周\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"在日期\",\r\n\t\trepeat_ends: \"结束\",\r\n\r\n\t\tmonth_for_recurring: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tday_for_recurring: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Den\",\r\n\t\tweek_tab: \"Týden\",\r\n\t\tmonth_tab: \"Měsíc\",\r\n\t\tnew_event: \"Nová událost\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Přejete si upravit celou řadu opakovaných událostí?\",\r\n\t\tsection_recurring: \"Opakování události\",\r\n\t\tbutton_recurring: \"Vypnuto\",\r\n\t\tbutton_recurring_open: \"Zapnuto\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Upravit instance\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Full day\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mřížka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denně\",\r\n\t\trepeat_radio_week: \"Týdně\",\r\n\t\trepeat_radio_month: \"Měsíčně\",\r\n\t\trepeat_radio_year: \"Ročně\",\r\n\t\trepeat_radio_day_type: \"každý\",\r\n\t\trepeat_text_day_count: \"Den\",\r\n\t\trepeat_radio_day_type2: \"pracovní dny\",\r\n\t\trepeat_week: \"Opakuje každých\",\r\n\t\trepeat_text_week_count: \"Týdnů na:\",\r\n\t\trepeat_radio_month_type: \"u každého\",\r\n\t\trepeat_radio_month_start: \"na\",\r\n\t\trepeat_text_month_day: \"Den každého\",\r\n\t\trepeat_text_month_count: \"Měsíc\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"Měsíc\",\r\n\t\trepeat_year_label: \"na\",\r\n\t\tselect_year_day2: \"v\",\r\n\t\trepeat_text_year_day: \"Den v\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"bez data ukončení\",\r\n\t\trepeat_text_occurences_count: \"Události\",\r\n\t\trepeat_radio_end2: \"po\",\r\n\t\trepeat_radio_end3: \"Konec\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý den\",\r\n\t\trepeat_workdays: \"Každý pracovní den\",\r\n\t\trepeat_weekly: \"Každý týden\",\r\n\t\trepeat_monthly: \"Každý měsíc\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastní\",\r\n\t\trepeat_freq_day: \"Den\",\r\n\t\trepeat_freq_week: \"Týden\",\r\n\t\trepeat_freq_month: \"Měsíc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Končí\",\r\n\r\n\t\tmonth_for_recurring: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tday_for_recurring: [\"Neděle \", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uge\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny begivenhed\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du tilrette hele serien af gentagne begivenheder?\",\r\n\t\tsection_recurring: \"Gentag begivenhed\",\r\n\t\tbutton_recurring: \"Frakoblet\",\r\n\t\tbutton_recurring_open: \"Tilkoblet\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Rediger en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagsorden\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagsorden\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ugenlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"På hver arbejdsdag\",\r\n\t\trepeat_week: \" Gentager sig hver\",\r\n\t\trepeat_text_week_count: \"uge på følgende dage:\",\r\n\t\trepeat_radio_month_type: \"Hver den\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \" i hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen slutdato\",\r\n\t\trepeat_text_occurences_count: \"gentagelse\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\trepeat_radio_end3: \"Slut\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver hverdag\",\r\n\t\trepeat_weekly: \"Hver uge\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Brugerdefineret\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uge\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [ \"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Heute\",\r\n\t\tday_tab: \"Tag\",\r\n\t\tweek_tab: \"Woche\",\r\n\t\tmonth_tab: \"Monat\",\r\n\t\tnew_event: \"neuer Eintrag\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", //\"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tfull_day: \"Ganzer Tag\",\r\n\r\n\t\tconfirm_recurring: \"Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?\",\r\n\t\tsection_recurring: \"Wiederholung\",\r\n\t\tbutton_recurring: \"Aus\",\r\n\t\tbutton_recurring_open: \"An\",\r\n\t\tbutton_edit_series: \"Bearbeiten Sie die Serie\",\r\n\t\tbutton_edit_occurrence: \"Bearbeiten Sie eine Kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beschreibung\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jahre\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Täglich\",\r\n\t\trepeat_radio_week: \"Wöchentlich\",\r\n\t\trepeat_radio_month: \"Monatlich\",\r\n\t\trepeat_radio_year: \"Jährlich\",\r\n\t\trepeat_radio_day_type: \"jeden\",\r\n\t\trepeat_text_day_count: \"Tag\",\r\n\t\trepeat_radio_day_type2: \"an jedem Arbeitstag\",\r\n\t\trepeat_week: \" Wiederholt sich jede\",\r\n\t\trepeat_text_week_count: \"Woche am:\",\r\n\t\trepeat_radio_month_type: \"an jedem\",\r\n\t\trepeat_radio_month_start: \"am\",\r\n\t\trepeat_text_month_day: \"Tag eines jeden\",\r\n\t\trepeat_text_month_count: \"Monats\",\r\n\t\trepeat_text_month_count2_before: \"jeden\",\r\n\t\trepeat_text_month_count2_after: \"Monats\",\r\n\t\trepeat_year_label: \"am\",\r\n\t\tselect_year_day2: \"im\",\r\n\t\trepeat_text_year_day: \"Tag im\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"kein Enddatum\",\r\n\t\trepeat_text_occurences_count: \"Ereignissen\",\r\n\t\trepeat_radio_end3: \"Schluß\",\r\n\t\trepeat_radio_end2: \"nach\",\r\n\r\n\t\trepeat_never: \"Nie\",\r\n\t\trepeat_daily: \"Jeden Tag\",\r\n\t\trepeat_workdays: \"Jeden Werktag\",\r\n\t\trepeat_weekly: \"Jede Woche\",\r\n\t\trepeat_monthly: \"Jeden Monat\",\r\n\t\trepeat_yearly: \"Jedes Jahr\",\r\n\t\trepeat_custom: \"Benutzerdefiniert\",\r\n\t\trepeat_freq_day: \"Tag\",\r\n\t\trepeat_freq_week: \"Woche\",\r\n\t\trepeat_freq_month: \"Monat\",\r\n\t\trepeat_freq_year: \"Jahr\",\r\n\t\trepeat_on_date: \"Am Datum\",\r\n\t\trepeat_ends: \"Endet\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Σήμερα\",\r\n\t\tday_tab: \"Ημέρα\",\r\n\t\tweek_tab: \"Εβδομάδα\",\r\n\t\tmonth_tab: \"Μήνας\",\r\n\t\tnew_event: \"Νέο έργο\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tfull_day: \"Πλήρης Ημέρα\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;\",\r\n\t\tsection_recurring: \"Επαναλαμβανόμενο έργο\",\r\n\t\tbutton_recurring: \"Ανενεργό\",\r\n\t\tbutton_recurring_open: \"Ενεργό\",\r\n\t\tbutton_edit_series: \"Επεξεργαστείτε τη σειρά\",\r\n\t\tbutton_edit_occurrence: \"Επεξεργασία ένα αντίγραφο\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ημερήσια Διάταξη\",\r\n\t\tdate: \"Ημερομηνία\",\r\n\t\tdescription: \"Περιγραφή\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Έτος\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ημερήσια Διάταξη\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Πλέγμα\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Ημερησίως\",\r\n\t\trepeat_radio_week: \"Εβδομαδιαίως\",\r\n\t\trepeat_radio_month: \"Μηνιαίως\",\r\n\t\trepeat_radio_year: \"Ετησίως\",\r\n\t\trepeat_radio_day_type: \"Κάθε\",\r\n\t\trepeat_text_day_count: \"ημέρα\",\r\n\t\trepeat_radio_day_type2: \"Κάθε εργάσιμη\",\r\n\t\trepeat_week: \" Επανάληψη κάθε\",\r\n\t\trepeat_text_week_count: \"εβδομάδα τις επόμενες ημέρες:\",\r\n\t\trepeat_radio_month_type: \"Επανάληψη\",\r\n\t\trepeat_radio_month_start: \"Την\",\r\n\t\trepeat_text_month_day: \"ημέρα κάθε\",\r\n\t\trepeat_text_month_count: \"μήνα\",\r\n\t\trepeat_text_month_count2_before: \"κάθε\",\r\n\t\trepeat_text_month_count2_after: \"μήνα\",\r\n\t\trepeat_year_label: \"Την\",\r\n\t\tselect_year_day2: \"του\",\r\n\t\trepeat_text_year_day: \"ημέρα\",\r\n\t\tselect_year_month: \"μήνα\",\r\n\t\trepeat_radio_end: \"Χωρίς ημερομηνία λήξεως\",\r\n\t\trepeat_text_occurences_count: \"επαναλήψεις\",\r\n\t\trepeat_radio_end3: \"Λήγει την\",\r\n\t\trepeat_radio_end2: \"Μετά από\",\r\n\r\n\t\trepeat_never: \"Ποτέ\",\r\n\t\trepeat_daily: \"Κάθε μέρα\",\r\n\t\trepeat_workdays: \"Κάθε εργάσιμη μέρα\",\r\n\t\trepeat_weekly: \"Κάθε εβδομάδα\",\r\n\t\trepeat_monthly: \"Κάθε μήνα\",\r\n\t\trepeat_yearly: \"Κάθε χρόνο\",\r\n\t\trepeat_custom: \"Προσαρμοσμένο\",\r\n\t\trepeat_freq_day: \"Ημέρα\",\r\n\t\trepeat_freq_week: \"Εβδομάδα\",\r\n\t\trepeat_freq_month: \"Μήνας\",\r\n\t\trepeat_freq_year: \"Χρόνος\",\r\n\t\trepeat_on_date: \"Σε ημερομηνία\",\r\n\t\trepeat_ends: \"Λήγει\",\r\n\r\n\t\tmonth_for_recurring: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tday_for_recurring: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate:{\r\n\t\tmonth_full:[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short:[\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Today\",\r\n\t\tday_tab:\"Day\",\r\n\t\tweek_tab:\"Week\",\r\n\t\tmonth_tab:\"Month\",\r\n\t\tnew_event:\"New event\",\r\n\t\ticon_save:\"Save\",\r\n\t\ticon_cancel:\"Cancel\",\r\n\t\ticon_details:\"Details\",\r\n\t\ticon_edit:\"Edit\",\r\n\t\ticon_delete:\"Delete\",\r\n\t\tconfirm_closing:\"\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Event will be deleted permanently, are you sure?\",\r\n\t\tsection_description:\"Description\",\r\n\t\tsection_time:\"Time period\",\r\n\t\tfull_day:\"Full day\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Do you want to edit the whole set of repeated events?\",\r\n\t\tsection_recurring:\"Repeat event\",\r\n\t\tbutton_recurring:\"Disabled\",\r\n\t\tbutton_recurring_open:\"Enabled\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Date\",\r\n\t\tdescription:\"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"Year\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daily\",//name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Weekly\",//name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Monthly\",\r\n\t\trepeat_radio_year: \"Yearly\",\r\n\t\trepeat_radio_day_type: \"Every\",\r\n\t\trepeat_text_day_count: \"day\",\r\n\t\trepeat_radio_day_type2: \"Every workday\",\r\n\t\trepeat_week: \" Repeat every\",\r\n\t\trepeat_text_week_count: \"week next days:\",\r\n\t\trepeat_radio_month_type: \"Repeat\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"day every\",\r\n\t\trepeat_text_month_count: \"month\",\r\n\t\trepeat_text_month_count2_before: \"every\",\r\n\t\trepeat_text_month_count2_after: \"month\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"day\",\r\n\t\tselect_year_month: \"month\",\r\n\t\trepeat_radio_end: \"No end date\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end2: \"After\",\r\n\t\trepeat_radio_end3: \"End by\",\r\n\r\n\t\trepeat_never: \"Never\",\r\n\t\trepeat_daily: \"Every day\",\r\n\t\trepeat_workdays: \"Every weekday\",\r\n\t\trepeat_weekly: \"Every week\",\r\n\t\trepeat_monthly: \"Every month\",\r\n\t\trepeat_yearly: \"Every year\",\r\n\t\trepeat_custom: \"Custom\",\r\n\t\trepeat_freq_day: \"Day\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Month\",\r\n\t\trepeat_freq_year: \"Year\",\r\n\t\trepeat_on_date: \"On date\",\r\n\t\trepeat_ends: \"Ends\",\r\n\r\n\t\tmonth_for_recurring: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]//\r\n\t}\r\n};\r\n\r\n","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoy\",\r\n\t\tday_tab: \"Día\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nuevo evento\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", //\"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tfull_day: \"Todo el día\",\r\n\r\n\t\tconfirm_recurring: \"¿Desea modificar el conjunto de eventos repetidos?\",\r\n\t\tsection_recurring: \"Repita el evento\",\r\n\t\tbutton_recurring: \"Impedido\",\r\n\t\tbutton_recurring_open: \"Permitido\",\r\n\t\tbutton_edit_series: \"Editar la serie\",\r\n\t\tbutton_edit_occurrence: \"Editar este evento\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Día\",\r\n\t\tdate: \"Fecha\",\r\n\t\tdescription: \"Descripción\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Año\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Día\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Reja\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diariamente\",\r\n\t\trepeat_radio_week: \"Semanalmente\",\r\n\t\trepeat_radio_month: \"Mensualmente\",\r\n\t\trepeat_radio_year: \"Anualmente\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada jornada de trabajo\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repita\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada \",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sin fecha de finalización\",\r\n\t\trepeat_text_occurences_count: \"ocurrencias\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Después de\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Cada día\",\r\n\t\trepeat_workdays: \"Cada día laborable\",\r\n\t\trepeat_weekly: \"Cada semana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada año\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Día\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Año\",\r\n\t\trepeat_on_date: \"En la fecha\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Enero\", \"Febrero\", \"Маrzo\", \"Аbril\", \"Mayo\", \"Junio\", \"Julio\", \"Аgosto\", \"Setiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jeuves\", \"Viernes\", \"Sabado\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Tänään\",\r\n\t\tday_tab: \"Päivä\",\r\n\t\tweek_tab: \"Viikko\",\r\n\t\tmonth_tab: \"Kuukausi\",\r\n\t\tnew_event: \"Uusi tapahtuma\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tfull_day: \"Koko päivä\",\r\n\r\n\t\tconfirm_recurring: \"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?\",\r\n\t\tsection_recurring: \"Toista tapahtuma\",\r\n\t\tbutton_recurring: \"Ei käytössä\",\r\n\t\tbutton_recurring_open: \"Käytössä\",\r\n\t\tbutton_edit_series: \"Muokkaa sarja\",\r\n\t\tbutton_edit_occurrence: \"Muokkaa kopio\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Esityslista\",\r\n\t\tdate: \"Päivämäärä\",\r\n\t\tdescription: \"Kuvaus\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Vuoden\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Esityslista\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Ritilä\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Luo uusi vetämällä\",\r\n\t\tdrag_to_move:\"Siirrä vetämällä\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Päivittäin\",\r\n\t\trepeat_radio_week: \"Viikoittain\",\r\n\t\trepeat_radio_month: \"Kuukausittain\",\r\n\t\trepeat_radio_year: \"Vuosittain\",\r\n\t\trepeat_radio_day_type: \"Joka\",\r\n\t\trepeat_text_day_count: \"päivä\",\r\n\t\trepeat_radio_day_type2: \"Joka arkipäivä\",\r\n\t\trepeat_week: \"Toista joka\",\r\n\t\trepeat_text_week_count: \"viikko näinä päivinä:\",\r\n\t\trepeat_radio_month_type: \"Toista\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \"päivänä joka\",\r\n\t\trepeat_text_month_count: \"kuukausi\",\r\n\t\trepeat_text_month_count2_before: \"joka\",\r\n\t\trepeat_text_month_count2_after: \"kuukausi\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"päivä\",\r\n\t\tselect_year_month: \"kuukausi\",\r\n\t\trepeat_radio_end: \"Ei loppumisaikaa\",\r\n\t\trepeat_text_occurences_count: \"Toiston jälkeen\",\r\n\t\trepeat_radio_end3: \"Loppuu\",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ei koskaan\",\r\n\t\trepeat_daily: \"Joka päivä\",\r\n\t\trepeat_workdays: \"Joka arkipäivä\",\r\n\t\trepeat_weekly: \"Joka viikko\",\r\n\t\trepeat_monthly: \"Joka kuukausi\",\r\n\t\trepeat_yearly: \"Joka vuosi\",\r\n\t\trepeat_custom: \"Mukautettu\",\r\n\t\trepeat_freq_day: \"Päivä\",\r\n\t\trepeat_freq_week: \"Viikko\",\r\n\t\trepeat_freq_month: \"Kuukausi\",\r\n\t\trepeat_freq_year: \"Vuosi\",\r\n\t\trepeat_on_date: \"Tiettynä päivänä\",\r\n\t\trepeat_ends: \"Päättyy\",\r\n\r\n\t\tmonth_for_recurring: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tday_for_recurring: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Aujourd'hui\",\r\n\t\tday_tab: \"Jour\",\r\n\t\tweek_tab: \"Semaine\",\r\n\t\tmonth_tab: \"Mois\",\r\n\t\tnew_event: \"Nouvel événement\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\", //Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tfull_day: \"Journée complète\",\r\n\r\n\t\tconfirm_recurring: \"Voulez-vous éditer toute une série d'évènements répétés?\",\r\n\t\tsection_recurring: \"Périodicité\",\r\n\t\tbutton_recurring: \"Désactivé\",\r\n\t\tbutton_recurring_open: \"Activé\",\r\n\t\tbutton_edit_series: \"Modifier la série\",\r\n\t\tbutton_edit_occurrence: \"Modifier une copie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Jour\",\r\n\t\tdate: \"Date\",\r\n\t\tdescription: \"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Année\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Jour\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grille\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidienne\",\r\n\t\trepeat_radio_week: \"Hebdomadaire\",\r\n\t\trepeat_radio_month: \"Mensuelle\",\r\n\t\trepeat_radio_year: \"Annuelle\",\r\n\t\trepeat_radio_day_type: \"Chaque\",\r\n\t\trepeat_text_day_count: \"jour\",\r\n\t\trepeat_radio_day_type2: \"Chaque journée de travail\",\r\n\t\trepeat_week: \" Répéter toutes les\",\r\n\t\trepeat_text_week_count: \"semaine:\",\r\n\t\trepeat_radio_month_type: \"Répéter\",\r\n\t\trepeat_radio_month_start: \"Le\",\r\n\t\trepeat_text_month_day: \"jour chaque\",\r\n\t\trepeat_text_month_count: \"mois\",\r\n\t\trepeat_text_month_count2_before: \"chaque\",\r\n\t\trepeat_text_month_count2_after: \"mois\",\r\n\t\trepeat_year_label: \"Le\",\r\n\t\tselect_year_day2: \"du\",\r\n\t\trepeat_text_year_day: \"jour\",\r\n\t\tselect_year_month: \"mois\",\r\n\t\trepeat_radio_end: \"Pas de date d"achèvement\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Après\",\r\n\r\n\t\trepeat_never: \"Jamais\",\r\n\t\trepeat_daily: \"Chaque jour\",\r\n\t\trepeat_workdays: \"Chaque jour ouvrable\",\r\n\t\trepeat_weekly: \"Chaque semaine\",\r\n\t\trepeat_monthly: \"Chaque mois\",\r\n\t\trepeat_yearly: \"Chaque année\",\r\n\t\trepeat_custom: \"Personnalisé\",\r\n\t\trepeat_freq_day: \"Jour\",\r\n\t\trepeat_freq_week: \"Semaine\",\r\n\t\trepeat_freq_month: \"Mois\",\r\n\t\trepeat_freq_year: \"Année\",\r\n\t\trepeat_on_date: \"À la date\",\r\n\t\trepeat_ends: \"Se termine\",\r\n\r\n\t\tmonth_for_recurring: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tday_for_recurring: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"היום\",\r\n\t\tday_tab: \"יום\",\r\n\t\tweek_tab: \"שבוע\",\r\n\t\tmonth_tab: \"חודש\",\r\n\t\tnew_event: \"ארוע חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"תיאור\",\r\n\t\tsection_time: \"תקופה\",\r\n\r\n\t\tconfirm_recurring: \"האם ברצונך לשנות כל סדרת ארועים מתמשכים?\",\r\n\t\tsection_recurring: \"להעתיק ארוע\",\r\n\t\tbutton_recurring: \"לא פעיל\",\r\n\t\tbutton_recurring_open: \"פעיל\",\r\n\t\tfull_day: \"יום שלם\",\r\n\t\tbutton_edit_series: \"ערוך את הסדרה\",\r\n\t\tbutton_edit_occurrence: \"עריכת עותק\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"סדר יום\",\r\n\t\tdate: \"תאריך\",\r\n\t\tdescription: \"תיאור\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"לשנה\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"סדר יום\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"סורג\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"גרור כדי להזיז\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"בטל\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"הבא\",\r\n\t\tprev: \"הקודם\",\r\n\t\tyear: \"שנה\",\r\n\t\tmonth: \"חודש\",\r\n\t\tday: \"יום\",\r\n\t\thour:\"שעה\",\r\n\t\tminute: \"דקה\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"יומי\",\r\n\t\trepeat_radio_week: \"שבועי\",\r\n\t\trepeat_radio_month: \"חודשי\",\r\n\t\trepeat_radio_year: \"שנתי\",\r\n\t\trepeat_radio_day_type: \"חזור כל\",\r\n\t\trepeat_text_day_count: \"ימים\",\r\n\t\trepeat_radio_day_type2: \"חזור כל יום עבודה\",\r\n\t\trepeat_week: \" חזור כל\",\r\n\t\trepeat_text_week_count: \"שבוע לפי ימים:\",\r\n\t\trepeat_radio_month_type: \"חזור כל\",\r\n\t\trepeat_radio_month_start: \"כל\",\r\n\t\trepeat_text_month_day: \"ימים כל\",\r\n\t\trepeat_text_month_count: \"חודשים\",\r\n\t\trepeat_text_month_count2_before: \"חזור כל\",\r\n\t\trepeat_text_month_count2_after: \"חודש\",\r\n\t\trepeat_year_label: \"כל\",\r\n\t\tselect_year_day2: \"בחודש\",\r\n\t\trepeat_text_year_day: \"ימים\",\r\n\t\tselect_year_month: \"חודש\",\r\n\t\trepeat_radio_end: \"לעולם לא מסתיים\",\r\n\t\trepeat_text_occurences_count: \"אירועים\",\r\n\t\trepeat_radio_end3: \"מסתיים ב\",\r\n\t\trepeat_radio_end2: \"אחרי\",\r\n\r\n\t\trepeat_never: \"אף פעם\",\r\n\t\trepeat_daily: \"כל יום\",\r\n\t\trepeat_workdays: \"כל יום עבודה\",\r\n\t\trepeat_weekly: \"כל שבוע\",\r\n\t\trepeat_monthly: \"כל חודש\",\r\n\t\trepeat_yearly: \"כל שנה\",\r\n\t\trepeat_custom: \"מותאם אישית\",\r\n\t\trepeat_freq_day: \"יום\",\r\n\t\trepeat_freq_week: \"שבוע\",\r\n\t\trepeat_freq_month: \"חודש\",\r\n\t\trepeat_freq_year: \"שנה\",\r\n\t\trepeat_on_date: \"בתאריך\",\r\n\t\trepeat_ends: \"מסתיים\",\r\n\r\n\t\tmonth_for_recurring: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tday_for_recurring: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Ma\",\r\n\t\tday_tab: \"Nap\",\r\n\t\tweek_tab: \"Hét\",\r\n\t\tmonth_tab: \"Hónap\",\r\n\t\tnew_event: \"Új esemény\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", //A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tfull_day: \"Egesz napos\",\r\n\r\n\t\t/*ismétlõdõ események*/\r\n\t\tconfirm_recurring: \"Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?\",\r\n\t\tsection_recurring: \"Esemény ismétlése\",\r\n\t\tbutton_recurring: \"Tiltás\",\r\n\t\tbutton_recurring_open: \"Engedélyezés\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Szerkesztés bíróság\",\r\n\r\n\t\t/*napirendi nézet*/\r\n\t\tagenda_tab: \"Napirend\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Leírás\",\r\n\r\n\t\t/*éves nézet*/\r\n\t\tyear_tab: \"Év\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Napi\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Heti\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Havi\",\r\n\t\trepeat_radio_year: \"Éves\",\r\n\t\trepeat_radio_day_type: \"Minden\",\r\n\t\trepeat_text_day_count: \"nap\",\r\n\t\trepeat_radio_day_type2: \"Minden munkanap\",\r\n\t\trepeat_week: \" Ismételje meg minden\",\r\n\t\trepeat_text_week_count: \"héten a következő napokon:\",\r\n\t\trepeat_radio_month_type: \"Ismétlés\",\r\n\t\trepeat_radio_month_start: \"Ekkor\",\r\n\t\trepeat_text_month_day: \"nap minden\",\r\n\t\trepeat_text_month_count: \"hónapban\",\r\n\t\trepeat_text_month_count2_before: \"minden\",\r\n\t\trepeat_text_month_count2_after: \"hónapban\",\r\n\t\trepeat_year_label: \"Ekkor\",\r\n\t\tselect_year_day2: \"-án/-én\",\r\n\t\trepeat_text_year_day: \"nap\",\r\n\t\tselect_year_month: \"hónap\",\r\n\t\trepeat_radio_end: \"Nincs befejezési dátum\",\r\n\t\trepeat_text_occurences_count: \"esemény\",\r\n\t\trepeat_radio_end2: \"Után\",\r\n\t\trepeat_radio_end3: \"Befejező dátum\",\r\n\r\n\t\trepeat_never: \"Soha\",\r\n\t\trepeat_daily: \"Minden nap\",\r\n\t\trepeat_workdays: \"Minden munkanap\",\r\n\t\trepeat_weekly: \"Minden héten\",\r\n\t\trepeat_monthly: \"Minden hónapban\",\r\n\t\trepeat_yearly: \"Minden évben\",\r\n\t\trepeat_custom: \"Egyedi\",\r\n\t\trepeat_freq_day: \"Nap\",\r\n\t\trepeat_freq_week: \"Hét\",\r\n\t\trepeat_freq_month: \"Hónap\",\r\n\t\trepeat_freq_year: \"Év\",\r\n\t\trepeat_on_date: \"Dátum szerint\",\r\n\t\trepeat_ends: \"Befejeződik\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Vasárnap\", \"Hétfő\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"Szombat\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hari Ini\",\r\n\t\tday_tab: \"Hari\",\r\n\t\tweek_tab: \"Minggu\",\r\n\t\tmonth_tab: \"Bulan\",\r\n\t\tnew_event: \"Acara Baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /*Perubahan tidak akan disimpan ?*/\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tfull_day: \"Hari penuh\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Apakah acara ini akan berulang?\",\r\n\t\tsection_recurring: \"Acara Rutin\",\r\n\t\tbutton_recurring: \"Tidak Difungsikan\",\r\n\t\tbutton_recurring_open: \"Difungsikan\",\r\n\t\tbutton_edit_series: \"Mengedit seri\",\r\n\t\tbutton_edit_occurrence: \"Mengedit salinan\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Tanggal\",\r\n\t\tdescription: \"Keterangan\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Tahun\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Harian\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Mingguan\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Bulanan\",\r\n\t\trepeat_radio_year: \"Tahunan\",\r\n\t\trepeat_radio_day_type: \"Setiap\",\r\n\t\trepeat_text_day_count: \"hari\",\r\n\t\trepeat_radio_day_type2: \"Setiap hari kerja\",\r\n\t\trepeat_week: \" Ulangi setiap\",\r\n\t\trepeat_text_week_count: \"minggu pada hari berikut:\",\r\n\t\trepeat_radio_month_type: \"Ulangi\",\r\n\t\trepeat_radio_month_start: \"Pada\",\r\n\t\trepeat_text_month_day: \"hari setiap\",\r\n\t\trepeat_text_month_count: \"bulan\",\r\n\t\trepeat_text_month_count2_before: \"setiap\",\r\n\t\trepeat_text_month_count2_after: \"bulan\",\r\n\t\trepeat_year_label: \"Pada\",\r\n\t\tselect_year_day2: \"dari\",\r\n\t\trepeat_text_year_day: \"hari\",\r\n\t\tselect_year_month: \"bulan\",\r\n\t\trepeat_radio_end: \"Tanpa tanggal akhir\",\r\n\t\trepeat_text_occurences_count: \"kejadian\",\r\n\t\trepeat_radio_end2: \"Setelah\",\r\n\t\trepeat_radio_end3: \"Berakhir pada\",\r\n\r\n\t\trepeat_never: \"Tidak pernah\",\r\n\t\trepeat_daily: \"Setiap hari\",\r\n\t\trepeat_workdays: \"Setiap hari kerja\",\r\n\t\trepeat_weekly: \"Setiap minggu\",\r\n\t\trepeat_monthly: \"Setiap bulan\",\r\n\t\trepeat_yearly: \"Setiap tahun\",\r\n\t\trepeat_custom: \"Kustom\",\r\n\t\trepeat_freq_day: \"Hari\",\r\n\t\trepeat_freq_week: \"Minggu\",\r\n\t\trepeat_freq_month: \"Bulan\",\r\n\t\trepeat_freq_year: \"Tahun\",\r\n\t\trepeat_on_date: \"Pada tanggal\",\r\n\t\trepeat_ends: \"Berakhir\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Oggi\",\r\n\t\tday_tab: \"Giorno\",\r\n\t\tweek_tab: \"Settimana\",\r\n\t\tmonth_tab: \"Mese\",\r\n\t\tnew_event: \"Nuovo evento\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\", //Le modifiche apportate saranno perse, siete sicuri?\r\n\t\tconfirm_deleting: \"L'evento sarà eliminato, siete sicuri?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tfull_day: \"Intera giornata\",\r\n\r\n\t\tconfirm_recurring: \"Vuoi modificare l'intera serie di eventi?\",\r\n\t\tsection_recurring: \"Ripetere l'evento\",\r\n\t\tbutton_recurring: \"Disattivato\",\r\n\t\tbutton_recurring_open: \"Attivato\",\r\n\t\tbutton_edit_series: \"Modificare la serie\",\r\n\t\tbutton_edit_occurrence: \"Modificare una copia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrizione\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Anno\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Griglia\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidiano\",\r\n\t\trepeat_radio_week: \"Settimanale\",\r\n\t\trepeat_radio_month: \"Mensile\",\r\n\t\trepeat_radio_year: \"Annuale\",\r\n\t\trepeat_radio_day_type: \"Ogni\",\r\n\t\trepeat_text_day_count: \"giorno\",\r\n\t\trepeat_radio_day_type2: \"Ogni giornata lavorativa\",\r\n\t\trepeat_week: \" Ripetere ogni\",\r\n\t\trepeat_text_week_count: \"settimana:\",\r\n\t\trepeat_radio_month_type: \"Ripetere\",\r\n\t\trepeat_radio_month_start: \"Il\",\r\n\t\trepeat_text_month_day: \"giorno ogni\",\r\n\t\trepeat_text_month_count: \"mese\",\r\n\t\trepeat_text_month_count2_before: \"ogni\",\r\n\t\trepeat_text_month_count2_after: \"mese\",\r\n\t\trepeat_year_label: \"Il\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"giorno\",\r\n\t\tselect_year_month: \"mese\",\r\n\t\trepeat_radio_end: \"Senza data finale\",\r\n\t\trepeat_text_occurences_count: \"occorenze\",\r\n\t\trepeat_radio_end3: \"Fine\",\r\n\t\trepeat_radio_end2: \"Dopo\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Ogni giorno\",\r\n\t\trepeat_workdays: \"Ogni giorno feriale\",\r\n\t\trepeat_weekly: \"Ogni settimana\",\r\n\t\trepeat_monthly: \"Ogni mese\",\r\n\t\trepeat_yearly: \"Ogni anno\",\r\n\t\trepeat_custom: \"Personalizzato\",\r\n\t\trepeat_freq_day: \"Giorno\",\r\n\t\trepeat_freq_week: \"Settimana\",\r\n\t\trepeat_freq_month: \"Mese\",\r\n\t\trepeat_freq_year: \"Anno\",\r\n\t\trepeat_on_date: \"Alla data\",\r\n\t\trepeat_ends: \"Finisce\",\r\n\r\n\t\tmonth_for_recurring: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Jiugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tday_for_recurring: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Jovedì\", \"Venerdì\", \"Sabato\"]\r\n\t}\r\n};\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [ \"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今日\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"週\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新イベント\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", //変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tconfirm_recurring: \"繰り返されているイベントを全て編集しますか?\",\r\n\t\tsection_recurring: \"イベントを繰り返す\",\r\n\t\tbutton_recurring: \"無効\",\r\n\t\tbutton_recurring_open: \"有効\",\r\n\t\tfull_day: \"終日\",\r\n\t\tbutton_edit_series: \"シリーズを編集します\",\r\n\t\tbutton_edit_occurrence: \"コピーを編集\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"議題は\",\r\n\t\tdate: \"日付\",\r\n\t\tdescription: \"説明\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"議題は\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"グリッド\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"毎日\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"毎週\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"毎月\",\r\n\t\trepeat_radio_year: \"毎年\",\r\n\t\trepeat_radio_day_type: \"毎\",\r\n\t\trepeat_text_day_count: \"日\",\r\n\t\trepeat_radio_day_type2: \"毎営業日\",\r\n\t\trepeat_week: \" 繰り返し毎\",\r\n\t\trepeat_text_week_count: \"週 次の日:\",\r\n\t\trepeat_radio_month_type: \"繰り返し\",\r\n\t\trepeat_radio_month_start: \"オン\",\r\n\t\trepeat_text_month_day: \"日毎\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"毎\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"オン\",\r\n\t\tselect_year_day2: \"の\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"終了日なし\",\r\n\t\trepeat_text_occurences_count: \"回数\",\r\n\t\trepeat_radio_end2: \"後\",\r\n\t\trepeat_radio_end3: \"終了日まで\",\r\n\r\n\t\trepeat_never: \"決して\",\r\n\t\trepeat_daily: \"毎日\",\r\n\t\trepeat_workdays: \"毎営業日\",\r\n\t\trepeat_weekly: \"毎週\",\r\n\t\trepeat_monthly: \"毎月\",\r\n\t\trepeat_yearly: \"毎年\",\r\n\t\trepeat_custom: \"カスタム\",\r\n\t\trepeat_freq_day: \"日\",\r\n\t\trepeat_freq_week: \"週\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"日にち\",\r\n\t\trepeat_ends: \"終了\",\r\n\r\n\t\tmonth_for_recurring: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_for_recurring: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default class LocaleManager{\r\n\tconstructor(config){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale(name, locale) {\r\n\t\tthis._locales[name] = locale;\r\n\t}\r\n\r\n\tgetLocale(name) {\r\n\t\treturn this._locales[name];\r\n\t}\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"I dag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny hendelse\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du forandre hele dette settet av repeterende hendelser?\",\r\n\t\tsection_recurring: \"Repeter hendelsen\",\r\n\t\tbutton_recurring: \"Av\",\r\n\t\tbutton_recurring_open: \"På\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ukentlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Alle hverdager\",\r\n\t\trepeat_week: \" Gjentas hver\",\r\n\t\trepeat_text_week_count: \"uke på:\",\r\n\t\trepeat_radio_month_type: \"På hver\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"på\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomst\",\r\n\t\trepeat_radio_end3: \"Stop den\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Sondag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Vandaag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Week\",\r\n\t\tmonth_tab: \"Maand\",\r\n\t\tnew_event: \"Nieuw item\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tfull_day: \"Hele dag\",\r\n\r\n\t\tconfirm_recurring: \"Wilt u alle terugkerende items bijwerken?\",\r\n\t\tsection_recurring: \"Item herhalen\",\r\n\t\tbutton_recurring: \"Uit\",\r\n\t\tbutton_recurring_open: \"Aan\",\r\n\t\tbutton_edit_series: \"Bewerk de serie\",\r\n\t\tbutton_edit_occurrence: \"Bewerk een kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Omschrijving\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jaar\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagelijks\",\r\n\t\trepeat_radio_week: \"Wekelijks\",\r\n\t\trepeat_radio_month: \"Maandelijks\",\r\n\t\trepeat_radio_year: \"Jaarlijks\",\r\n\t\trepeat_radio_day_type: \"Elke\",\r\n\t\trepeat_text_day_count: \"dag(en)\",\r\n\t\trepeat_radio_day_type2: \"Elke werkdag\",\r\n\t\trepeat_week: \" Herhaal elke\",\r\n\t\trepeat_text_week_count: \"week op de volgende dagen:\",\r\n\t\trepeat_radio_month_type: \"Herhaal\",\r\n\t\trepeat_radio_month_start: \"Op\",\r\n\t\trepeat_text_month_day: \"dag iedere\",\r\n\t\trepeat_text_month_count: \"maanden\",\r\n\t\trepeat_text_month_count2_before: \"iedere\",\r\n\t\trepeat_text_month_count2_after: \"maanden\",\r\n\t\trepeat_year_label: \"Op\",\r\n\t\tselect_year_day2: \"van\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"maand\",\r\n\t\trepeat_radio_end: \"Geen eind datum\",\r\n\t\trepeat_text_occurences_count: \"keren\",\r\n\t\trepeat_radio_end3: \"Eindigd per\",\r\n\t\trepeat_radio_end2: \"Na\",\r\n\r\n\t\trepeat_never: \"Nooit\",\r\n\t\trepeat_daily: \"Elke dag\",\r\n\t\trepeat_workdays: \"Elke werkdag\",\r\n\t\trepeat_weekly: \"Elke week\",\r\n\t\trepeat_monthly: \"Elke maand\",\r\n\t\trepeat_yearly: \"Elk jaar\",\r\n\t\trepeat_custom: \"Aangepast\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Maand\",\r\n\t\trepeat_freq_year: \"Jaar\",\r\n\t\trepeat_on_date: \"Op datum\",\r\n\t\trepeat_ends: \"Eindigt\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", //Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tfull_day: \"Full dag\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du endre hele settet med repeterende oppføringer?\",\r\n\t\tsection_recurring: \"Repeterende oppføring\",\r\n\t\tbutton_recurring: \"Ikke aktiv\",\r\n\t\tbutton_recurring_open: \"Aktiv\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Ukentlig\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Hver arbeidsdag\",\r\n\t\trepeat_week: \" Gjenta hver\",\r\n\t\trepeat_text_week_count: \"uke neste dager:\",\r\n\t\trepeat_radio_month_type: \"Gjenta\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"På\",\r\n\t\tselect_year_day2: \"av\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"måned\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomster\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\t\trepeat_radio_end3: \"Slutt innen\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dziś\",\r\n\t\tday_tab: \"Dzień\",\r\n\t\tweek_tab: \"Tydzień\",\r\n\t\tmonth_tab: \"Miesiąc\",\r\n\t\tnew_event: \"Nowe zdarzenie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", //Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tfull_day: \"Cały dzień\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?\",\r\n\t\tsection_recurring: \"Powtórz zdarzenie\",\r\n\t\tbutton_recurring: \"Nieaktywne\",\r\n\t\tbutton_recurring_open: \"Aktywne\",\r\n\t\tbutton_edit_series: \"Edytuj serię\",\r\n\t\tbutton_edit_occurrence: \"Edytuj kopię\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabela\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Codziennie\",\r\n\t\trepeat_radio_week: \"Co tydzie\",\r\n\t\trepeat_radio_month: \"Co miesic\",\r\n\t\trepeat_radio_year: \"Co rok\",\r\n\t\trepeat_radio_day_type: \"Kadego\",\r\n\t\trepeat_text_day_count: \"dnia\",\r\n\t\trepeat_radio_day_type2: \"Kadego dnia roboczego\",\r\n\t\trepeat_week: \" Powtarzaj kadego\",\r\n\t\trepeat_text_week_count: \"tygodnia w dni:\",\r\n\t\trepeat_radio_month_type: \"Powtrz\",\r\n\t\trepeat_radio_month_start: \"W\",\r\n\t\trepeat_text_month_day: \"dnia kadego\",\r\n\t\trepeat_text_month_count: \"miesica\",\r\n\t\trepeat_text_month_count2_before: \"kadego\",\r\n\t\trepeat_text_month_count2_after: \"miesica\",\r\n\t\trepeat_year_label: \"W\",\r\n\t\tselect_year_day2: \"miesica\",\r\n\t\trepeat_text_year_day: \"dnia miesica\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Bez daty kocowej\",\r\n\t\trepeat_text_occurences_count: \"wystpieniu/ach\",\r\n\t\trepeat_radio_end3: \"Zakocz w\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nigdy\",\r\n\t\trepeat_daily: \"Codziennie\",\r\n\t\trepeat_workdays: \"Każdy dzień roboczy\",\r\n\t\trepeat_weekly: \"Co tydzień\",\r\n\t\trepeat_monthly: \"Co miesiąc\",\r\n\t\trepeat_yearly: \"Co rok\",\r\n\t\trepeat_custom: \"Niestandardowy\",\r\n\t\trepeat_freq_day: \"Dzień\",\r\n\t\trepeat_freq_week: \"Tydzień\",\r\n\t\trepeat_freq_month: \"Miesiąc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"W dniu\",\r\n\t\trepeat_ends: \"Kończy się\",\r\n\r\n\t\tmonth_for_recurring: [\"Stycznia\", \"Lutego\", \"Marca\", \"Kwietnia\", \"Maja\", \"Czerwca\", \"Lipca\", \"Sierpnia\", \"Wrzenia\", \"Padziernka\", \"Listopada\", \"Grudnia\"],\r\n\t\tday_for_recurring: [\"Niedziela\", \"Poniedziaek\", \"Wtorek\", \"roda\", \"Czwartek\", \"Pitek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n */\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoje\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mês\",\r\n\t\tnew_event: \"Novo evento\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Deletar\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Tem certeza que deseja excluir?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período de tempo\",\r\n\t\tfull_day: \"Dia inteiro\",\r\n\r\n\t\tconfirm_recurring: \"Deseja editar todos esses eventos repetidos?\",\r\n\t\tsection_recurring: \"Repetir evento\",\r\n\t\tbutton_recurring: \"Desabilitar\",\r\n\t\tbutton_recurring_open: \"Habilitar\",\r\n\t\tbutton_edit_series: \"Editar a série\",\r\n\t\tbutton_edit_occurrence: \"Editar uma cópia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dia\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrição\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Ano\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dia\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grade\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diário\",\r\n\t\trepeat_radio_week: \"Semanal\",\r\n\t\trepeat_radio_month: \"Mensal\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia(s)\",\r\n\t\trepeat_radio_day_type2: \"Cada trabalho diário\",\r\n\t\trepeat_week: \" Repita cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"Em\",\r\n\t\trepeat_text_month_day: \"todo dia\",\r\n\t\trepeat_text_month_count: \"mês\",\r\n\t\trepeat_text_month_count2_before: \"todo\",\r\n\t\trepeat_text_month_count2_after: \"mês\",\r\n\t\trepeat_year_label: \"Em\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mês\",\r\n\t\trepeat_radio_end: \"Sem data final\",\r\n\t\trepeat_text_occurences_count: \"ocorrências\",\r\n\t\trepeat_radio_end3: \"Fim\",\r\n\t\trepeat_radio_end2: \"Depois\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Todos os dias\",\r\n\t\trepeat_workdays: \"Todos os dias úteis\",\r\n\t\trepeat_weekly: \"Toda semana\",\r\n\t\trepeat_monthly: \"Todo mês\",\r\n\t\trepeat_yearly: \"Todo ano\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mês\",\r\n\t\trepeat_freq_year: \"Ano\",\r\n\t\trepeat_on_date: \"Na data\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nexport default {\r\n\tdate:{\r\n\t\tmonth_full:[\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short:[\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Astazi\",\r\n\t\tday_tab:\"Zi\",\r\n\t\tweek_tab:\"Saptamana\",\r\n\t\tmonth_tab:\"Luna\",\r\n\t\tnew_event:\"Eveniment nou\",\r\n\t\ticon_save:\"Salveaza\",\r\n\t\ticon_cancel:\"Anuleaza\",\r\n\t\ticon_details:\"Detalii\",\r\n\t\ticon_edit:\"Editeaza\",\r\n\t\ticon_delete:\"Sterge\",\r\n\t\tconfirm_closing:\"Schimbarile nu vor fi salvate, esti sigur?\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description:\"Descriere\",\r\n\t\tsection_time:\"Interval\",\r\n\t\tfull_day:\"Toata ziua\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Vrei sa editezi toata seria de evenimente repetate?\",\r\n\t\tsection_recurring:\"Repetare\",\r\n\t\tbutton_recurring:\"Dezactivata\",\r\n\t\tbutton_recurring_open:\"Activata\",\r\n\t\tbutton_edit_series: \"Editeaza serie\",\r\n\t\tbutton_edit_occurrence: \"Editeaza doar intrare\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Data\",\r\n\t\tdescription:\"Descriere\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"An\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Lista\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Zilnic\",\r\n\t\trepeat_radio_week: \"Saptamanal\",\r\n\t\trepeat_radio_month: \"Lunar\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"La fiecare\",\r\n\t\trepeat_text_day_count: \"zi(le)\",\r\n\t\trepeat_radio_day_type2: \"Fiecare zi lucratoare\",\r\n\t\trepeat_week: \" Repeta la fiecare\",\r\n\t\trepeat_text_week_count: \"saptamana in urmatoarele zile:\",\r\n\t\trepeat_radio_month_type: \"Repeta in\",\r\n\t\trepeat_radio_month_start: \"In a\",\r\n\t\trepeat_text_month_day: \"zi la fiecare\",\r\n\t\trepeat_text_month_count: \"luni\",\r\n\t\trepeat_text_month_count2_before: \"la fiecare\",\r\n\t\trepeat_text_month_count2_after: \"luni\",\r\n\t\trepeat_year_label: \"In\",\r\n\t\tselect_year_day2: \"a lunii\",\r\n\t\trepeat_text_year_day: \"zi a lunii\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Fara data de sfarsit\",\r\n\t\trepeat_text_occurences_count: \"evenimente\",\r\n\t\trepeat_radio_end3: \"La data\",\r\n\t\trepeat_radio_end2: \"Dupa\",\r\n\r\n\t\trepeat_never: \"Niciodată\",\r\n\t\trepeat_daily: \"În fiecare zi\",\r\n\t\trepeat_workdays: \"În fiecare zi lucrătoare\",\r\n\t\trepeat_weekly: \"În fiecare săptămână\",\r\n\t\trepeat_monthly: \"În fiecare lună\",\r\n\t\trepeat_yearly: \"În fiecare an\",\r\n\t\trepeat_custom: \"Personalizat\",\r\n\t\trepeat_freq_day: \"Zi\",\r\n\t\trepeat_freq_week: \"Săptămână\",\r\n\t\trepeat_freq_month: \"Lună\",\r\n\t\trepeat_freq_year: \"An\",\r\n\t\trepeat_on_date: \"La data\",\r\n\t\trepeat_ends: \"Se termină\",\r\n\r\n\t\tmonth_for_recurring: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\"],\r\n\t\tday_for_recurring: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [ \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сегодня\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Неделя\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новое событие\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", //Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\tconfirm_recurring: \"Вы хотите изменить всю серию повторяющихся событий?\",\r\n\t\tsection_recurring: \"Повторение\",\r\n\t\tbutton_recurring: \"Отключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редактировать серию\",\r\n\t\tbutton_edit_occurrence: \"Редактировать экземпляр\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Список\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Описание\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Список\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблица\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Неделя\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Каждый\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Каждый рабочий день\",\r\n\t\trepeat_week: \" Повторять каждую\",\r\n\t\trepeat_text_week_count: \"неделю , в:\",\r\n\t\trepeat_radio_month_type: \"Повторять\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа каждый \",\r\n\t\trepeat_text_month_count: \"месяц\",\r\n\t\trepeat_text_month_count2_before: \"каждый \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты окончания\",\r\n\t\trepeat_text_occurences_count: \"повторений\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Никогда\",\r\n\t\trepeat_daily: \"Каждый день\",\r\n\t\trepeat_workdays: \"Каждый будний день\",\r\n\t\trepeat_weekly: \"Каждую неделю\",\r\n\t\trepeat_monthly: \"Каждый месяц\",\r\n\t\trepeat_yearly: \"Каждый год\",\r\n\t\trepeat_custom: \"Настроить\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Неделя\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"В дату\",\r\n\t\trepeat_ends: \"Заканчивается\",\r\n\r\n\t\tmonth_for_recurring: [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\", \"Октября\", \"Ноября\", \"Декабря\"],\r\n\t\tday_for_recurring: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среду\", \"Четверг\", \"Пятницу\", \"Субботу\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Danes\",\r\n\t\tday_tab: \"Dan\",\r\n\t\tweek_tab: \"Teden\",\r\n\t\tmonth_tab: \"Mesec\",\r\n\t\tnew_event: \"Nov dogodek\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", //Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tfull_day: \"Ves dan\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Želite urediti celoten set ponavljajočih dogodkov?\",\r\n\t\tsection_recurring: \"Ponovi dogodek\",\r\n\t\tbutton_recurring: \"Onemogočeno\",\r\n\t\tbutton_recurring_open: \"Omogočeno\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Zadeva\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Leto\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Zadeva\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Miza\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dnevno\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Tedensko\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mesečno\",\r\n\t\trepeat_radio_year: \"Letno\",\r\n\t\trepeat_radio_day_type: \"Vsak\",\r\n\t\trepeat_text_day_count: \"dan\",\r\n\t\trepeat_radio_day_type2: \"Vsak delovni dan\",\r\n\t\trepeat_week: \" Ponavljaj vsak\",\r\n\t\trepeat_text_week_count: \"teden na naslednje dni:\",\r\n\t\trepeat_radio_month_type: \"Ponavljaj\",\r\n\t\trepeat_radio_month_start: \"Na\",\r\n\t\trepeat_text_month_day: \"dan vsak\",\r\n\t\trepeat_text_month_count: \"mesec\",\r\n\t\trepeat_text_month_count2_before: \"vsak\",\r\n\t\trepeat_text_month_count2_after: \"mesec\",\r\n\t\trepeat_year_label: \"Na\",\r\n\t\tselect_year_day2: \"od\",\r\n\t\trepeat_text_year_day: \"dan\",\r\n\t\tselect_year_month: \"mesec\",\r\n\t\trepeat_radio_end: \"Brez končnega datuma\",\r\n\t\trepeat_text_occurences_count: \"pojavitve\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\trepeat_radio_end3: \"Končaj do\",\r\n\r\n\t\trepeat_never: \"Nikoli\",\r\n\t\trepeat_daily: \"Vsak dan\",\r\n\t\trepeat_workdays: \"Vsak delovni dan\",\r\n\t\trepeat_weekly: \"Vsak teden\",\r\n\t\trepeat_monthly: \"Vsak mesec\",\r\n\t\trepeat_yearly: \"Vsako leto\",\r\n\t\trepeat_custom: \"Po meri\",\r\n\t\trepeat_freq_day: \"Dan\",\r\n\t\trepeat_freq_week: \"Teden\",\r\n\t\trepeat_freq_month: \"Mesec\",\r\n\t\trepeat_freq_year: \"Leto\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Konča se\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Deň\",\r\n\t\tweek_tab: \"Týždeň\",\r\n\t\tmonth_tab: \"Mesiac\",\r\n\t\tnew_event: \"Nová udalosť\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Prajete si upraviť celú radu opakovaných udalostí?\",\r\n\t\tsection_recurring: \"Opakovanie udalosti\",\r\n\t\tbutton_recurring: \"Vypnuté\",\r\n\t\tbutton_recurring_open: \"Zapnuté\",\r\n\t\tbutton_edit_series: \"Upraviť opakovania\",\r\n\t\tbutton_edit_occurrence: \"Upraviť inštancie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Celý deň\", // Full day\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mriežka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denne\",\r\n\t\trepeat_radio_week: \"Týždenne\",\r\n\t\trepeat_radio_month: \"Mesaène\",\r\n\t\trepeat_radio_year: \"Roène\",\r\n\t\trepeat_radio_day_type: \"Každý\",\r\n\t\trepeat_text_day_count: \"deò\",\r\n\t\trepeat_radio_day_type2: \"Každý prac. deò\",\r\n\t\trepeat_week: \"Opakova každý\",\r\n\t\trepeat_text_week_count: \"týždeò v dòoch:\",\r\n\t\trepeat_radio_month_type: \"Opakova\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"deò každý\",\r\n\t\trepeat_text_month_count: \"mesiac\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"mesiac\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"poèas\",\r\n\t\trepeat_text_year_day: \"deò\",\r\n\t\tselect_year_month: \"mesiac\",\r\n\t\trepeat_radio_end: \"Bez dátumu ukonèenia\",\r\n\t\trepeat_text_occurences_count: \"udalostiach\",\r\n\t\trepeat_radio_end3: \"Ukonèi\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý deň\",\r\n\t\trepeat_workdays: \"Každý pracovný deň\",\r\n\t\trepeat_weekly: \"Každý týždeň\",\r\n\t\trepeat_monthly: \"Každý mesiac\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastné\",\r\n\t\trepeat_freq_day: \"Deň\",\r\n\t\trepeat_freq_week: \"Týždeň\",\r\n\t\trepeat_freq_month: \"Mesiac\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na dátum\",\r\n\t\trepeat_ends: \"Koniec\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nede¾a\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Vecka\",\r\n\t\tmonth_tab: \"Månad\",\r\n\t\tnew_event: \"Ny händelse\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Ångra\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\", //Dina förändingar kommer gå förlorade, är du säker?\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tfull_day: \"Hela dagen\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vill du redigera hela serien med repeterande händelser?\",\r\n\t\tsection_recurring: \"Upprepa händelse\",\r\n\t\tbutton_recurring: \"Inaktiverat\",\r\n\t\tbutton_recurring_open: \"Aktiverat\",\r\n\t\tbutton_edit_series: \"Redigera serien\",\r\n\t\tbutton_edit_occurrence: \"Redigera en kopia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagordning\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beskrivning\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagordning\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Galler\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Dra för att skapa ny\",\r\n\t\tdrag_to_move:\"Dra för att flytta\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagligen\",\r\n\t\trepeat_radio_week: \"Veckovis\",\r\n\t\trepeat_radio_month: \"Månadsvis\",\r\n\t\trepeat_radio_year: \"Årligen\",\r\n\t\trepeat_radio_day_type: \"Var\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Varje arbetsdag\",\r\n\t\trepeat_week: \" Upprepa var\",\r\n\t\trepeat_text_week_count: \"vecka dessa dagar:\",\r\n\t\trepeat_radio_month_type: \"Upprepa\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \"dagen var\",\r\n\t\trepeat_text_month_count: \"månad\",\r\n\t\trepeat_text_month_count2_before: \"var\",\r\n\t\trepeat_text_month_count2_after: \"månad\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"månad\",\r\n\t\trepeat_radio_end: \"Inget slutdatum\",\r\n\t\trepeat_text_occurences_count: \"upprepningar\",\r\n\t\trepeat_radio_end3: \"Sluta efter\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Varje dag\",\r\n\t\trepeat_workdays: \"Varje vardag\",\r\n\t\trepeat_weekly: \"Varje vecka\",\r\n\t\trepeat_monthly: \"Varje månad\",\r\n\t\trepeat_yearly: \"Varje år\",\r\n\t\trepeat_custom: \"Anpassad\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Vecka\",\r\n\t\trepeat_freq_month: \"Månad\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På datum\",\r\n\t\trepeat_ends: \"Slutar\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Þubat\", \"Mart\", \"Nisan\", \"Mayýs\", \"Haziran\", \"Temmuz\", \"Aðustos\", \"Eylül\", \"Ekim\", \"Kasým\", \"Aralýk\"],\r\n\t\tmonth_short: [\"Oca\", \"Þub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Aðu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartes,\", \"Salý\", \"Çarþamba\", \"Perþembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pts\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cts\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Bugün\",\r\n\t\tday_tab: \"Gün\",\r\n\t\tweek_tab: \"Hafta\",\r\n\t\tmonth_tab: \"Ay\",\r\n\t\tnew_event: \"Uygun\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"Ýptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Etkinlik silinecek, devam?\",\r\n\t\tsection_description: \"Açýklama\",\r\n\t\tsection_time: \"Zaman aralýðý\",\r\n\t\tfull_day: \"Tam gün\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Tüm tekrar eden etkinlikler silinecek, devam?\",\r\n\t\tsection_recurring: \"Etkinliði tekrarla\",\r\n\t\tbutton_recurring: \"Pasif\",\r\n\t\tbutton_recurring_open: \"Aktif\",\r\n\t\tbutton_edit_series: \"Dizi düzenleme\",\r\n\t\tbutton_edit_occurrence: \"Bir kopyasını düzenleyin\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ajanda\",\r\n\t\tdate: \"Tarih\",\r\n\t\tdescription: \"Açýklama\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Yýl\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ajanda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Izgara\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Günlük\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Haftalık\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Aylık\",\r\n\t\trepeat_radio_year: \"Yıllık\",\r\n\t\trepeat_radio_day_type: \"Her\",\r\n\t\trepeat_text_day_count: \"gün\",\r\n\t\trepeat_radio_day_type2: \"Her iş günü\",\r\n\t\trepeat_week: \" Tekrar her\",\r\n\t\trepeat_text_week_count: \"hafta şu günlerde:\",\r\n\t\trepeat_radio_month_type: \"Tekrar et\",\r\n\t\trepeat_radio_month_start: \"Tarihinde\",\r\n\t\trepeat_text_month_day: \"gün her\",\r\n\t\trepeat_text_month_count: \"ay\",\r\n\t\trepeat_text_month_count2_before: \"her\",\r\n\t\trepeat_text_month_count2_after: \"ay\",\r\n\t\trepeat_year_label: \"Tarihinde\",\r\n\t\tselect_year_day2: \"ayın\",\r\n\t\trepeat_text_year_day: \"günü\",\r\n\t\tselect_year_month: \"ay\",\r\n\t\trepeat_radio_end: \"Bitiş tarihi yok\",\r\n\t\trepeat_text_occurences_count: \"olay\",\r\n\t\trepeat_radio_end2: \"Sonra\",\r\n\t\trepeat_radio_end3: \"Tarihinde bitir\",\r\n\r\n\t\trepeat_never: \"Asla\",\r\n\t\trepeat_daily: \"Her gün\",\r\n\t\trepeat_workdays: \"Her iş günü\",\r\n\t\trepeat_weekly: \"Her hafta\",\r\n\t\trepeat_monthly: \"Her ay\",\r\n\t\trepeat_yearly: \"Her yıl\",\r\n\t\trepeat_custom: \"Özel\",\r\n\t\trepeat_freq_day: \"Gün\",\r\n\t\trepeat_freq_week: \"Hafta\",\r\n\t\trepeat_freq_month: \"Ay\",\r\n\t\trepeat_freq_year: \"Yıl\",\r\n\t\trepeat_on_date: \"Tarihinde\",\r\n\t\trepeat_ends: \"Biter\",\r\n\r\n\t\tmonth_for_recurring: [\"Ocak\", \"Şubat\", \"Mart\", \"Nisan\", \"Mayıs\", \"Haziran\", \"Temmuz\", \"Ağustos\", \"Eylül\", \"Ekim\", \"Kasım\", \"Aralık\"],\r\n\t\tday_for_recurring: [\"Pazar\", \"Pazartesi\", \"Salı\", \"Çarşamba\", \"Perşembe\", \"Cuma\", \"Cumartesi\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сьогодні\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Тиждень\",\r\n\t\tmonth_tab: \"Місяць\",\r\n\t\tnew_event: \"Нова подія\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", //Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Хочете редагувати весь перелік повторюваних подій?\",\r\n\t\tsection_recurring: \"Повторювана подія\",\r\n\t\tbutton_recurring: \"Відключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редагувати серію\",\r\n\t\tbutton_edit_occurrence: \"Редагувати примірник\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Перелік\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Опис\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Рік\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Перелік\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблиця\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Тиждень\",\r\n\t\trepeat_radio_month: \"Місяць\",\r\n\t\trepeat_radio_year: \"Рік\",\r\n\t\trepeat_radio_day_type: \"Кожний\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Кожний робочий день\",\r\n\t\trepeat_week: \" Повторювати кожен\",\r\n\t\trepeat_text_week_count: \"тиждень , по:\",\r\n\t\trepeat_radio_month_type: \"Повторювати\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа кожний \",\r\n\t\trepeat_text_month_count: \"місяць\",\r\n\t\trepeat_text_month_count2_before: \"кожен \",\r\n\t\trepeat_text_month_count2_after: \"місяць\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без дати закінчення\",\r\n\t\trepeat_text_occurences_count: \"повторень\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ніколи\",\r\n\t\trepeat_daily: \"Щодня\",\r\n\t\trepeat_workdays: \"Щодня в робочі дні\",\r\n\t\trepeat_weekly: \"Щотижня\",\r\n\t\trepeat_monthly: \"Щомісяця\",\r\n\t\trepeat_yearly: \"Щороку\",\r\n\t\trepeat_custom: \"Налаштоване\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Тиждень\",\r\n\t\trepeat_freq_month: \"Місяць\",\r\n\t\trepeat_freq_year: \"Рік\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Закінчується\",\r\n\r\n\t\tmonth_for_recurring: [\"січня\", \"лютого\", \"березня\", \"квітня\", \"травня\", \"червня\", \"липня\", \"серпня\", \"вересня\", \"жовтня\", \"листопада\", \"грудня\"],\r\n\t\tday_for_recurring: [\"Неділям\", \"Понеділкам\", \"Вівторкам\", \"Середам\", \"Четвергам\", \"П'ятницям\", \"Суботам\"]\r\n\t}\r\n};\r\n","import eventable from \"../utils/eventable\";\r\n\r\nexport class DatePicker {\r\n\tconstructor(scheduler, container, state = {}) {\r\n\t\tthis.state = {\r\n\t\t\tdate: new Date(),\r\n\t\t\tmodes: ['days', 'months', 'years'],\r\n\t\t\tcurrentRange: [],\r\n\t\t\teventDates: [],\r\n\t\t\tcurrentModeIndex: 0,\r\n\t\t\t...state\r\n\t\t};\r\n\t\tthis.container = null;\r\n\t\tthis.element = null;\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis.state = this.getState();\r\n\t\teventable(this);\r\n\t\tif(container){\r\n\r\n\t\t\tthis.container = container;\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\r\n\t\tthis.onStateChange((oldState, newState) => {\r\n\t\t\tthis.callEvent(\"onStateChange\", [newState, oldState]);\r\n\t\t});\r\n\t}\r\n\r\n\tgetState() {\r\n\t\treturn { \r\n\t\t\t...this.state,\r\n\t\t\tmode: this.state.modes[this.state.currentModeIndex]\r\n\t\t};\r\n\t}\r\n\r\n\tsetState(newState) {\r\n\t\tconst oldState = { ...this.state };\r\n\t\tif(newState.mode){\r\n\t\t\tnewState.currentModeIndex = this.state.modes.indexOf(newState.mode);\r\n\t\t}\r\n\t\tthis.state = { ...this.state, ...newState };\r\n\r\n\t\tthis._notifyStateChange(oldState, this.state);\r\n\r\n\t\tif (this.container) {\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\t}\r\n\r\n\tonStateChange(handler) {\r\n\t\tthis.onStateChangeHandlers.push(handler);\r\n\r\n\t\t// function to remove the handler\r\n\t\treturn () => {\r\n\t\t\tconst index = this.onStateChangeHandlers.indexOf(handler);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tthis.onStateChangeHandlers.splice(index, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t_notifyStateChange(oldState, newState) {\r\n\t\tthis.onStateChangeHandlers.forEach(handler => handler(oldState, newState));\r\n\t}\r\n\r\n\t_adjustDate(direction) {\r\n\r\n\t\tconst {mode, date} = this.getState();\r\n\t\tconst newDate = new Date(date);\r\n\t\tif (mode === 'days') {\r\n\t\t\tnewDate.setMonth(date.getMonth() + direction);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction);\r\n\t\t} else {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction * 10);\r\n\t\t}\r\n\t\tthis.setState({ date: newDate });\r\n\t}\r\n\r\n\t_toggleMode() {\r\n\t\tconst newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length;\r\n\t\tthis.setState({ currentModeIndex: newIndex });\r\n\t}\r\n\r\n\t_renderCalendarHeader(container) {\r\n\t\tconst {mode, date} = this.getState();\r\n\r\n\t\tconst header = document.createElement('div');\r\n\t\theader.classList.add('dhx_cal_datepicker_header');\r\n\r\n\t\tconst backwardArrow = document.createElement('button');\r\n\r\n\t\tbackwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_left\");\r\n\t\theader.appendChild(backwardArrow);\r\n\r\n\t\tconst monthLabel = document.createElement('div');\r\n\t\tmonthLabel.classList.add('dhx_cal_datepicker_title');\r\n\r\n\t\tif (mode === 'days') {\r\n\t\t\tmonthLabel.innerText = date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tmonthLabel.innerText = date.getFullYear();\r\n\t\t} else {\r\n\t\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\tmonthLabel.innerText = `${startYear} - ${startYear + 9}`;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(monthLabel, \"click\", this._toggleMode.bind(this));\r\n\t\theader.appendChild(monthLabel);\r\n\r\n\t\tconst forwardArrow = document.createElement('button');\r\n\r\n\t\tforwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_right\");\r\n\t\theader.appendChild(forwardArrow);\r\n\r\n\t\tcontainer.appendChild(header);\r\n\r\n\t\tthis._domEvents.attach(backwardArrow, \"click\", this._adjustDate.bind(this, -1));\r\n\t\tthis._domEvents.attach(forwardArrow, \"click\", this._adjustDate.bind(this, 1));\r\n\t}\r\n\r\n\trender(container) {\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.container = container || this.container; \r\n\t\tthis.container.innerHTML = '';\r\n\r\n\t\tif(!this.element){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"dhx_cal_datepicker\");\r\n\t\t}\r\n\t\tthis.element.innerHTML = '';\r\n\t\tthis.container.appendChild(this.element);\r\n\r\n\t\tthis._renderCalendarHeader(this.element);\r\n\t\tconst dataContainer = document.createElement(\"div\");\r\n\t\tdataContainer.classList.add(\"dhx_cal_datepicker_data\");\r\n\t\tthis.element.appendChild(dataContainer);\r\n\r\n\t\tconst {mode} = this.getState();\r\n\t\tif (mode === 'days') {\r\n\t\t\tthis._renderDayGrid(dataContainer);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tthis._renderMonthGrid(dataContainer);\r\n\t\t} else {\r\n\t\t\tthis._renderYearGrid(dataContainer);\r\n\t\t}\r\n\t}\r\n\r\n\t_renderDayGridHeader(daysOfWeekContainer) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst scheduler = this.scheduler;\r\n\r\n\t\tlet currentDate = scheduler.date.week_start(new Date(date));\r\n\t\tconst maxDate = scheduler.date.add(scheduler.date.week_start(new Date(date)), 1, 'week');\r\n\r\n\t\tdaysOfWeekContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tconst labelFormat = scheduler.date.date_to_str(\"%D\");\r\n\r\n\t\twhile (currentDate.valueOf() < maxDate.valueOf()) {\r\n\t\t\tconst label = labelFormat(currentDate);\r\n\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-day\", currentDate.getDay());\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_dayname');\r\n\t\t\tdayElement.innerText = label;\r\n\t\t\tdaysOfWeekContainer.appendChild(dayElement);\r\n\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, 'day');\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t_weeksBetween(min, max) {\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tlet weeks = 0;\r\n\t\tlet currWeek = new Date(min);\r\n\t\twhile(currWeek.valueOf() < max.valueOf()){\r\n\t\t\tweeks += 1;\r\n\t\t\tcurrWeek = scheduler.date.week_start(scheduler.date.add(currWeek, 1, \"week\"));\r\n\t\t}\r\n\t\treturn weeks;\r\n\t}\r\n\r\n\t_renderDayGrid(container) {\r\n\t\tconst {date, currentRange, eventDates, minWeeks} = this.getState();\r\n\r\n\t\tlet minSchedulerDate = currentRange[0];\r\n\t\tlet maxSchedulerDate = currentRange[1];\r\n\r\n\t\tconst eventDaysTable = eventDates.reduce((acc, date) => {\r\n\t\t\tconst dayStart = this.scheduler.date.day_start(new Date(date));\r\n\t\t\tacc[dayStart.valueOf()] = true;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\r\n\t\t// Render Days of the Week\r\n\t\tconst daysOfWeekContainer = document.createElement('div');\r\n\t\tthis._renderDayGridHeader(daysOfWeekContainer);\r\n\t\tcontainer.appendChild(daysOfWeekContainer);\r\n\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tconst firstDate = scheduler.date.week_start(scheduler.date.month_start(new Date(date)));\r\n\t\tconst monthStart = scheduler.date.month_start(new Date(date));\r\n\t\tconst monthEnd = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tlet lastDate = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tconst currentCalDate = scheduler.date.date_part(scheduler._currentDate());\r\n\t\tif(lastDate.getDay() !== 0){\r\n\t\t\tlastDate = scheduler.date.add(scheduler.date.week_start(lastDate), 1, \"week\");\r\n\t\t}\r\n\r\n\t\tlet weeks = this._weeksBetween(firstDate, lastDate);\r\n\t\tif(minWeeks && weeks < minWeeks){\r\n\t\t\tlastDate = scheduler.date.add(lastDate, (minWeeks - weeks), \"week\");\r\n\t\t}\r\n\r\n\t\tlet currDate = firstDate;\r\n\r\n\t\tconst dayGridContainer = document.createElement('div');\r\n\t\tdayGridContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tthis._domEvents.attach(dayGridContainer, \"click\", (event) => {\r\n\t\t\tconst dateCell = event.target.closest(\"[data-cell-date]\");\r\n\t\t\tconst date = new Date(dateCell.getAttribute(\"data-cell-date\"));\r\n\t\t\tthis.callEvent(\"onDateClick\", [date, event]);\r\n\t\t});\r\n\r\n\t\twhile(currDate.valueOf() < lastDate.valueOf()){\r\n\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\tdayElement.setAttribute(\"data-cell-date\", scheduler.templates.format_date(currDate));\r\n\t\t\tdayElement.setAttribute(\"data-day\", currDate.getDay());\r\n\t\t\tdayElement.innerHTML = currDate.getDate();\r\n\r\n\t\t\tif(currDate.valueOf() < monthStart.valueOf()){\r\n\t\t\t\tdayElement.classList.add('dhx_before');\r\n\t\t\t}else if(currDate.valueOf() >= monthEnd.valueOf()){\t\r\n\t\t\t\tdayElement.classList.add('dhx_after');\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.getDay() === 0 || currDate.getDay() === 6){\r\n\t\t\t\tdayElement.classList.add(\"dhx_cal_datepicker_weekend\");\r\n\t\t\t}\r\n\r\n\t\t\tif(currDate.valueOf() == currentCalDate.valueOf()){\r\n\t\t\t\tdayElement.classList.add(\"dhx_now\");\r\n\t\t\t}\r\n\r\n\t\t\tif(minSchedulerDate && maxSchedulerDate){\r\n\t\t\t\tif(currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(eventDaysTable[currDate.valueOf()]){\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_event');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdayElement.classList.add('dhx_cal_datepicker_date');\r\n\r\n\t\t\tdayGridContainer.appendChild(dayElement);\r\n\t\t\tcurrDate = scheduler.date.add(currDate, 1, 'day');\r\n\t\t}\r\n\r\n\t\tcontainer.appendChild(dayGridContainer);\r\n\r\n\t}\r\n\r\n\t_renderMonthGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_months\");\r\n\r\n\t\tconst months = [];\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tmonths.push(new Date(date.getFullYear(), i, 1));\r\n\t\t}\r\n\r\n\t\tconst formatLabel = this.scheduler.date.date_to_str(\"%M\");\r\n\t\tmonths.forEach(month => {\r\n\t\t\tconst monthElement = document.createElement('div');\r\n\t\t\tmonthElement.classList.add('dhx_cal_datepicker_month');\r\n\t\t\tif(date.getMonth() === month.getMonth()){\r\n\t\t\t\tmonthElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tmonthElement.setAttribute(\"data-month\", month.getMonth());\r\n\t\t\tmonthElement.innerHTML = formatLabel(month);\r\n\t\t\tthis._domEvents.attach(monthElement, \"click\", () => {\r\n\t\t\t\tconst newDate = new Date(month);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: newDate,\r\n\t\t\t\t\tmode: 'days'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(monthElement);\r\n\t\t});\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'days'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\t_renderYearGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_years\");\r\n\t\tfor (let i = startYear - 1; i <= startYear + 10; i++) {\r\n\t\t\tconst yearElement = document.createElement('div');\r\n\t\t\tyearElement.innerText = i;\r\n\t\t\tyearElement.classList.add('dhx_cal_datepicker_year');\r\n\t\t\tyearElement.setAttribute(\"data-year\", i);\r\n\t\t\tif(date.getFullYear() === i){\r\n\t\t\t\tyearElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tthis._domEvents.attach(yearElement, \"click\", () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: new Date(i, date.getMonth(), 1),\r\n\t\t\t\t\tmode: 'months'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(yearElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'months'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\tdestructor(){\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tif(this.element){\r\n\t\t\tthis.element.innerHTML = '';\r\n\t\t\tthis.element.remove();\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.scheduler = null;\r\n\t}\r\n}","// import \"./css/dhtmlxscheduler_terrace\";\r\n// import \"./css/dhtmlxscheduler_material\";\r\n// import \"./css/dhtmlxscheduler_material_nofont\";\r\n// import \"./css/dhtmlxscheduler_flat\";\r\n// import \"./css/dhtmlxscheduler_contrast_black\";\r\n// import \"./css/dhtmlxscheduler_contrast_white\";\r\n\r\nimport addPlugins from \"./plugins\";\r\nimport stateProvider from \"./core/state\";\r\nimport assert from \"./core/common/assert\";\r\nimport common_errors from \"./core/common_errors\";\r\nimport connector from \"./core/connector\";\r\nimport schedulerCore from \"./core/scheduler\";\r\nimport common from \"./core/common\";\r\nimport wai_aria from \"./core/wai_aria\";\r\nimport utils from \"./core/utils/utils\";\r\nimport dom_helpers from \"./core/utils/dom_helpers\";\r\nimport env from \"./utils/env\";\r\nimport destructor from \"./core/destructor\";\r\nimport ajax from \"./core/utils/ajax\";\r\nimport base from \"./core/base\";\r\nimport config from \"./core/config\";\r\nimport event from \"./core/event\";\r\nimport event_highlight from \"./core/event_highlight\";\r\nimport load from \"./core/load\";\r\nimport lightbox from \"./core/lightbox\";\r\nimport touch from \"./core/touch\";\r\nimport dhtmlx_suite_hooks from \"./core/dhtmlx/dhtmlx_suite_hooks\";\r\nimport skins from \"./core/skins\";\r\nimport jquery from \"./core/jquery\";\r\nimport delay_render from \"./core/delay_render\";\r\nimport dataProcessorExtend from \"./core/dataprocessor/dataprocessor\";\r\nimport message from \"./core/message\";\r\nimport i18nFactory from \"./locale\";\r\n\r\nimport voidFirst from \"./publish_helpers/void_script_first\";\r\nimport voidSecond from \"./publish_helpers/void_script_second\";\r\nimport voidThird from \"./publish_helpers/void_script_third\";\r\n\r\n//import datepickerHeader from \"./core/clickable_header\";\r\n\r\nimport { DatePicker } from \"./core/datepicker\";\r\n\r\nexport default function(extensionManager) {\r\n\r\n\tconst scheduler = { version: VERSION };\r\n\t\r\n\tscheduler.$stateProvider = stateProvider();\r\n\r\n\tscheduler.getState = scheduler.$stateProvider.getState;\r\n\tcommon_errors(scheduler);\r\n\tcommon(scheduler);\r\n\tschedulerCore(scheduler);\r\n\twai_aria(scheduler);\r\n\t//utils(scheduler);\r\n\r\n\tscheduler.utils = utils;\r\n\tscheduler.$domHelpers = dom_helpers;\r\n\tscheduler.utils.dom = dom_helpers;\r\n\tscheduler.uid = utils.uid;\r\n\tscheduler.mixin = utils.mixin;\r\n\tscheduler.defined = utils.defined;\r\n\tscheduler.assert = assert(scheduler);\r\n\tscheduler.copy = utils.copy;\r\n\r\n\tscheduler._createDatePicker = function(container, config){\r\n\t\treturn new DatePicker(scheduler, container, config);\r\n\t};\r\n\r\n\t//datepickerHeader(scheduler);\r\n\r\n\r\n\t//old api compatibility\r\n\tscheduler._getFocusableNodes = dom_helpers.getFocusableNodes;\r\n\tscheduler._getClassName = dom_helpers.getClassName;\r\n\tscheduler._locate_css = dom_helpers.locateCss;\r\n\r\n\tconst messageApi = message(scheduler);\r\n\tscheduler.utils.mixin(scheduler, messageApi);\r\n\r\n\tscheduler.env = scheduler.$env = env;\r\n\tscheduler.Promise = window.Promise;\r\n\tdestructor(scheduler);\r\n\tajax(scheduler);\r\n\tvoidFirst(scheduler);\r\n\tbase(scheduler);\r\n\tconfig(scheduler);\r\n\tevent(scheduler);\r\n\tevent_highlight(scheduler);\r\n\tload(scheduler);\r\n\tlightbox(scheduler);\r\n\ttouch(scheduler);\r\n\tdhtmlx_suite_hooks(scheduler);\r\n\tvoidSecond(scheduler);\r\n\tskins(scheduler);\r\n\tjquery(scheduler);\r\n\tdelay_render(scheduler);\r\n\tdataProcessorExtend(scheduler);\r\n\tvoidThird(scheduler);\r\n\tconnector(scheduler);\r\n\tconst i18n = i18nFactory();\r\n\tscheduler.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!scheduler.locale){\r\n\t\t\t\t\tscheduler.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!scheduler.locale[i]){\r\n\t\t\t\t\t\t\t\tscheduler.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tscheduler.mixin(scheduler.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar labels = scheduler.locale.labels;\r\n\t\t\tlabels.dhx_save_btn \t= labels.icon_save;\r\n\t\t\tlabels.dhx_cancel_btn \t= labels.icon_cancel;\r\n\t\t\tlabels.dhx_delete_btn \t= labels.icon_delete;\r\n\r\n\t\t\tif(scheduler.$container){\r\n\t\t\t\tscheduler.get_elements();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tscheduler.i18n.setLocale(\"en\");\r\n\taddPlugins(scheduler);\r\n\tscheduler.ext = {};\r\n\r\n\tconst activePlugins = {};\r\n\tscheduler.plugins = function(config){\r\n\t\tconst extensionList = getExtensionList(config, {\r\n\t\t\t\ttreetimeline: [\"timeline\"],\r\n\t\t\t\tdaytimeline: [\"timeline\"],\r\n\t\t\t\touterdrag: [\"legacy\"]\r\n\t\t\t}, {\r\n\t\t\t\tlegacy: 1,\r\n\t\t\t\tlimit: 1,\r\n\t\t\t\ttimeline: 2,\r\n\t\t\t\tdaytimeline: 3,\r\n\t\t\t\ttreetimeline: 3,\r\n\t\t\t\touterdrag:6\r\n\t\t\t});\r\n\r\n\t\textensionList.forEach(function(name){\r\n\t\t\tif(!activePlugins[name]){\r\n\t\t\t\tconst plugin = extensionManager.getExtension(name);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(scheduler);\r\n\t\t\t\t\tactivePlugins[name] = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Error(\"unknown plugin \" + name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getExtensionList(config, dependencies, priorities){\r\n\t\tconst result = [];\r\n\r\n\t\tfor(const i in config){\r\n\t\t\tif(config[i]){\r\n\t\t\t\tconst extension = i.toLowerCase();\r\n\t\t\t\tif(dependencies[extension]){\r\n\t\t\t\t\tdependencies[extension].forEach(function(dep){\r\n\t\t\t\t\t\tconst dependencyName = dep.toLowerCase();\r\n\t\t\t\t\t\tif(!config[dependencyName]){\r\n\t\t\t\t\t\t\tresult.push(dependencyName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(extension);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tresult.sort(function(a, b){\r\n\t\t\tconst orderA = priorities[a] || 0;\r\n\t\t\tconst orderB = priorities[b] || 0;\r\n\t\t\tif(orderA > orderB){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else if(orderA < orderB){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\treturn scheduler;\r\n\r\n}","import utils from \"./utils/utils\";\r\n\r\nconst StateService = (function(){\r\n\tconst stateProviders = {};\r\n\r\n\tfunction getState(name){\r\n\t\tconst provider = stateProviders[name];\r\n\t\tif(provider){\r\n\t\t\treturn stateProviders[name].method();\r\n\t\t}else{\r\n\t\t\tconst res = {};\r\n\t\t\tfor(const i in stateProviders){\r\n\t\t\t\tif(!stateProviders[i].internal)\r\n\t\t\t\t\tutils.mixin(res, stateProviders[i].method(), true);\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction registerProvider(name, provider, internal){\r\n\t\tstateProviders[name] = { method: provider, internal: internal};\r\n\t}\r\n\r\n\tfunction unregisterProvider(name){\r\n\t\tdelete stateProviders[name];\r\n\t}\r\n\r\n\treturn {\r\n\t\tgetState: getState,\r\n\t\tregisterProvider: registerProvider,\r\n\t\tunregisterProvider: unregisterProvider\r\n\t};\r\n});\r\n\r\nexport default StateService;\r\n\r\n","export default function extend(scheduler) {\r\n\r\nvar commonViews = {\r\n\tagenda: \"https://docs.dhtmlx.com/scheduler/agenda_view.html\",\r\n\tgrid: \"https://docs.dhtmlx.com/scheduler/grid_view.html\",\r\n\tmap: \"https://docs.dhtmlx.com/scheduler/map_view.html\",\r\n\tunit: \"https://docs.dhtmlx.com/scheduler/units_view.html\",\r\n\ttimeline: \"https://docs.dhtmlx.com/scheduler/timeline_view.html\",\r\n\tweek_agenda: \"https://docs.dhtmlx.com/scheduler/weekagenda_view.html\",\r\n\tyear: \"https://docs.dhtmlx.com/scheduler/year_view.html\",\r\n\tanythingElse: \"https://docs.dhtmlx.com/scheduler/views.html\"\r\n};\r\n\r\nvar requiredExtensions = {\r\n\tagenda: \"ext/dhtmlxscheduler_agenda_view.js\",\r\n\tgrid: \"ext/dhtmlxscheduler_grid_view.js\",\r\n\tmap: \"ext/dhtmlxscheduler_map_view.js\",\r\n\tunit: \"ext/dhtmlxscheduler_units.js\",\r\n\ttimeline: \"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js\",\r\n\tweek_agenda: \"ext/dhtmlxscheduler_week_agenda.js\",\r\n\tyear: \"ext/dhtmlxscheduler_year_view.js\",\r\n\tlimit: \"ext/dhtmlxscheduler_limit.js\"\r\n};\r\n\r\nscheduler._commonErrorMessages = {\r\n\tunknownView: function(view){\r\n\t\tvar relatedDoc = \"Related docs: \" + (commonViews[view] || commonViews.anythingElse); \r\n\t\tvar relatedExtension = requiredExtensions[view] ? (\"You're probably missing \" + requiredExtensions[view] + \".\") : \"\";\r\n\t\treturn (\r\n\t\t\t\"`\"+view+\"` view is not defined. \\n\" +\r\n\t\t\t\"Please check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \\n\" + \r\n\t\t\trelatedDoc + \"\\n\" + (relatedExtension ? (relatedExtension + \"\\n\") : \"\"));\r\n\t},\r\n\tcollapsedContainer: function(div){\r\n\t\treturn \"Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \\n\"+\r\n\t\t\"Make sure that the container has some initial height or use different units. For example:\\n\" +\r\n\t\t\"
\\n\";\r\n\t}\r\n};\r\n\r\nscheduler.createTimelineView = function() {\r\n\tthrow new Error(\"scheduler.createTimelineView is not implemented. Be sure to add the required extension: \" + requiredExtensions.timeline + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.timeline);\r\n};\r\n\r\nscheduler.createUnitsView = function() {\r\n\tthrow new Error(\"scheduler.createUnitsView is not implemented. Be sure to add the required extension: \" + requiredExtensions.unit + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.unit);\r\n};\r\n\r\nscheduler.createGridView = function() {\r\n\tthrow new Error(\"scheduler.createGridView is not implemented. Be sure to add the required extension: \" + requiredExtensions.grid + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.grid);\r\n};\r\n\r\nscheduler.addMarkedTimespan = function() {\r\n\tthrow new Error(\"scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\" + \r\n\t\"\\n\" +\r\n\t\"Related docs: https://docs.dhtmlx.com/scheduler/limits.html\");\r\n};\r\n\r\nscheduler.renderCalendar = function() {\r\n\tthrow new Error(\"scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\" + \r\n\t\"\\n\" +\r\n\t\"https://docs.dhtmlx.com/scheduler/minicalendar.html\");\r\n};\r\n\r\nscheduler.exportToPNG = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPNG is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\nscheduler.exportToPDF = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPDF is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\n\r\n}","\r\nimport nav_bar from \"./nav_bar\";\r\nimport scheduler_resize_listener from \"./scheduler_resize_listener\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\neventable(scheduler);\r\n\r\nnav_bar(scheduler);\r\n\r\nscheduler._detachDomEvent = function(el, event, handler){\r\n\tif (el.removeEventListener){\r\n\t\tel.removeEventListener(event, handler, false);\r\n\r\n\t}else if (el.detachEvent){\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._init_once = function(){\r\n\tscheduler_resize_listener(scheduler);\r\n\r\n\tscheduler._init_once = function(){};\r\n};\r\n\r\nconst layout = {\r\n\t\"navbar\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn scheduler._init_nav_bar(config);\r\n\t\t}\r\n\t},\r\n\t\"header\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_header\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"dataArea\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_data\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"html_element\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn config.html;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction hasSchedulerMarkup(element){\r\n\treturn !!(\r\n\t\telement.querySelector(\".dhx_cal_header\") &&\r\n\t\telement.querySelector(\".dhx_cal_data\") &&\r\n\t\telement.querySelector(\".dhx_cal_navline\")\r\n\t\t);\r\n}\r\n\r\nfunction createDefaultHeader(scheduler){\r\n\tconst views = [\r\n\t\t\"day\",\r\n\t\t\"week\",\r\n\t\t\"month\"\r\n\t];\r\n\tconst date = [\r\n\t\t\"date\"\r\n\t];\r\n\tconst nav = [\r\n\t\t\"prev\",\r\n\t\t\"today\",\r\n\t\t\"next\"\r\n\t];\r\n\r\n\tif(scheduler.matrix){\r\n\t\tfor(const i in scheduler.matrix){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\tif(scheduler._props){\r\n\t\tfor(const i in scheduler._props){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tif(scheduler._grid && scheduler._grid.names){\r\n\t\tfor(const i in scheduler._grid.names){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tconst optionalViews = [\r\n\t\t\"map\",\r\n\t\t\"agenda\",\r\n\t\t\"week_agenda\",\r\n\t\t\"year\"\r\n\t];\r\n\r\n\toptionalViews.forEach(function(viewName){\r\n\t\tif(scheduler[viewName + \"_view\"]){\r\n\t\t\tviews.push(viewName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn views.concat(date).concat(nav);\r\n}\r\n\r\nscheduler.init=function(id,date,mode){\r\n\tif(this.$destroyed){\r\n\t\treturn; // not have errors when try to reinit destroyed scheduler\r\n\t}\r\n\tdate=date||(scheduler._currentDate());\r\n\tmode=mode||\"week\";\r\n\r\n\tif(this._obj){\r\n\t\tthis.unset_actions();\r\n\t}\r\n\r\n\tthis._obj=(typeof id == \"string\")?document.getElementById(id):id;\r\n\tthis.$container = this._obj;\r\n\tthis.$root = this._obj;\r\n\r\n\tif(!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === \"100%\"){\r\n\t\t// scheduler container has zero height and non-zero width\r\n\t\twindow.console.error(scheduler._commonErrorMessages.collapsedContainer(), this.$container);\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tthis.$container.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\tif(!this.config.header && !hasSchedulerMarkup(this.$container)){\r\n\t\t// if no header config and no required markup - use the default header\r\n\t\t// so the scheduler could be initialized in an empty div\r\n\t\tthis.config.header = createDefaultHeader(this);\r\n\t\twindow.console.log([// jshint ignore:line\r\n\t\t\t\"Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.\",\r\n\t\t\t\"Using a default header configuration: \",\r\n\t\t\t\"scheduler.config.header = \" + JSON.stringify(this.config.header, null, 2),\r\n\t\t\t\"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html\"\r\n\t\t].join(\"\\n\"));// jshint ignore:line\r\n\t}\r\n\r\n\tif (this.config.header) {\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\tthis.$container.classList.add(\"dhx_cal_container\");\r\n\t\tif(this.config.header.height){\r\n\t\t\tthis.xy.nav_height = this.config.header.height;\r\n\t\t}\r\n\t\tthis.$container.appendChild(layout.navbar.render(this.config.header));\r\n\t\tthis.$container.appendChild(layout.header.render());\r\n\t\tthis.$container.appendChild(layout.dataArea.render());\r\n\t} else {\r\n\t\t// if no header config provided - make sure scheduler container has all necessary elements\r\n\t\tif(!hasSchedulerMarkup(this.$container)){\r\n\t\t\tthrow new Error([\r\n\t\t\t\t\"Required DOM elements are missing from the scheduler container.\",\r\n\t\t\t\t\"Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup\",\r\n\t\t\t\t\"Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig\"\r\n\t\t\t].join(\"\\n\"));\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.config.rtl) this.$container.className += \" dhx_cal_container_rtl\";\r\n\r\n\t//hook for terrace skin\r\n\tif (this._skin_init)\r\n\t\tscheduler._skin_init();\r\n\r\n\tscheduler.date.init();\r\n\r\n\tthis._scroll=true;\r\n\r\n\tthis._els=[];\r\n\tthis.get_elements();\r\n\tthis.init_templates();\r\n\tthis.set_actions();\r\n\r\n\tthis._init_once();\r\n\tthis._init_touch_events();\r\n\r\n\tthis.set_sizes();\r\n\tscheduler.callEvent('onSchedulerReady', []);\r\n\tscheduler.$initialized = true;\r\n\tthis.setCurrentView(date,mode);\r\n\r\n};\r\n\r\nscheduler.xy={\r\n\tmin_event_height:20,\r\n\tbar_height: 24,\r\n\tscale_width:50,\r\n\tscroll_width:18,\r\n\tscale_height:20,\r\n\tmonth_scale_height:20,\r\n\tmenu_width:25,\r\n\tmargin_top:0,\r\n\tmargin_left:0,\r\n\teditor_width:140,\r\n\tmonth_head_height:22,\r\n\tevent_header_height: 14\r\n};\r\nscheduler.keys={\r\n\tedit_save:13,\r\n\tedit_cancel:27\r\n};\r\n\r\nscheduler.bind = function bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n};\r\n\r\nscheduler.set_sizes=function(){\r\n\r\n\tvar w = this._x = this._obj.clientWidth-this.xy.margin_left;\r\n\r\n\t//not-table mode always has scroll - need to be fixed in future\r\n\tvar scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);\r\n\r\n\tvar materialScalePlaceholder = this.$container.querySelector(\".dhx_cal_scale_placeholder\");\r\n\tif(scheduler._is_material_skin()){\r\n\t\tif(!materialScalePlaceholder) {\r\n\t\t\tmaterialScalePlaceholder = document.createElement(\"div\");\r\n\t\t\tmaterialScalePlaceholder.className = \"dhx_cal_scale_placeholder\";\r\n\t\t\tthis.$container.insertBefore(materialScalePlaceholder, this._els[\"dhx_cal_header\"][0]);\r\n\t\t}\r\n\t\tmaterialScalePlaceholder.style.display = \"block\";\r\n\r\n\t\tthis.set_xy(materialScalePlaceholder,w,this.xy.scale_height + 1,0, this._els[\"dhx_cal_header\"][0].offsetTop);\r\n\r\n\t}else{\r\n\t\tif(materialScalePlaceholder){\r\n\t\t\tmaterialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder);\r\n\t\t}\r\n\t}\r\n\r\n\tif (this._lightbox) {\r\n\t\tif (scheduler.$container.offsetWidth < 1200) {\r\n\t\t} else {\r\n\t\t\tthis._setLbPosition(document.querySelector(\".dhx_cal_light\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis._data_width = w-scale_x;\r\n\r\n\tthis._els[\"dhx_cal_navline\"][0].style.width = w + \"px\";\r\n\tconst header = this._els[\"dhx_cal_header\"][0];\r\n\tthis.set_xy(header, this._data_width, this.xy.scale_height);\r\n\t// this._els[\"dhx_cal_header\"][0].style.marginLeft = `${scheduler.xy.scale_width}px`;\r\n\theader.style.left = ``;\r\n\theader.style.right = ``;\r\n\tif(!this._table_view){\r\n\t\tif(this.config.rtl){\r\n\t\t\theader.style.right = `${this.xy.scale_width}px`;\r\n\t\t}else{\r\n\t\t\theader.style.left = `${this.xy.scale_width}px`;\r\n\t\t}\r\n\t} else {\r\n\t\tif(!this.config.rtl){\r\n\t\t\theader.style.left = `-1px`;\r\n\t\t} else {\r\n\t\t\theader.style.right = `-1px`;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.set_xy=function(node,w,h,x,y){\r\n\tfunction prepareValue(val){\r\n\t\tlet prepared = val;\r\n\t\tif(!isNaN(Number(prepared))){\r\n\t\t\tprepared = Math.max(0,prepared) + \"px\";\r\n\t\t}\r\n\t\treturn prepared;\r\n\t}\r\n\r\n\tvar direction = 'left';\r\n\r\n\tif(w !== undefined) {\r\n\t\tnode.style.width = prepareValue(w);\r\n\t}\r\n\r\n\tif(h !== undefined){\r\n\t\tnode.style.height = prepareValue(h);\r\n\t}\r\n\r\n\tif (arguments.length>3){\r\n\r\n\t\tif(x !== undefined){\r\n\t\t\tif (this.config.rtl) direction = 'right';\r\n\t\t\tnode.style[direction]=x+\"px\";\r\n\t\t}\r\n\t\tif(y !== undefined){\r\n\t\t\tnode.style.top=y+\"px\";\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.get_elements=function(){\r\n\t//get all child elements as named hash\r\n\tconst els=this._obj.getElementsByTagName(\"DIV\");\r\n\tfor (let i=0; i < els.length; i++){\r\n\t\tlet class_name= scheduler._getClassName(els[i]);\r\n\t\tconst attr_value = els[i].getAttribute(\"data-tab\") || els[i].getAttribute(\"name\") || \"\";\r\n\t\tif (class_name) class_name = class_name.split(\" \")[0];\r\n\t\tif (!this._els[class_name]) this._els[class_name]=[];\r\n\t\tthis._els[class_name].push(els[i]);\r\n\r\n\t\t//check if name need to be changed\r\n\t\t// scheduler.locale.labels[attr_value+\"_tab\"] - to fix getting labels for data-tab\r\n\t\tlet label = scheduler.locale.labels[attr_value+\"_tab\"] || scheduler.locale.labels[attr_value||class_name];\r\n\t\tif (typeof label !== \"string\" && attr_value && !els[i].innerHTML)\r\n\t\t\tlabel = attr_value.split(\"_\")[0];\r\n\t\tif (label) {\r\n\t\t\tthis._waiAria.labelAttr(els[i], label);\r\n\t\t\tels[i].innerHTML = label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst domEventsScope = scheduler._createDomEventScope();\r\n\r\nscheduler.unset_actions = function(){\r\n\tdomEventsScope.detachAll();\r\n};\r\n\r\nscheduler.set_actions=function(){\r\n\tfor (const a in this._els){\r\n\t\tif (this._click[a]){\r\n\t\t\tfor (let i=0; i < this._els[a].length; i++){\r\n\t\t\t\tconst element = this._els[a][i];\r\n\t\t\t\tconst handler = this._click[a].bind(element);\r\n\t\t\t\tdomEventsScope.attach(element, \"click\", handler);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdomEventsScope.attach(this._obj, \"selectstart\", function(e){\r\n\t\te.preventDefault();\r\n\t\treturn false;\r\n\t});\r\n\t//this._obj.onselectstart=function(e){ return false; };\r\n\tdomEventsScope.attach(this._obj, \"mousemove\", function(e){\r\n\t\tif (!scheduler._temp_touch_block)\r\n\t\t\tscheduler._on_mouse_move(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mousedown\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_down(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mouseup\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_up(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"dblclick\", function(e){\r\n\t\tscheduler._on_dbl_click(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"contextmenu\", function(event) {\r\n\t\tif(scheduler.checkEvent(\"onContextMenu\")){\r\n\t\t\t// block the default browser context menu \r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\tconst returnValue = scheduler.callEvent(\"onContextMenu\", [scheduler._locate_event(event.target), event]);\r\n\t\treturn returnValue;\r\n\t});\r\n};\r\nscheduler.select=function(id){\r\n\tif (this._select_id==id) return;\r\n\tscheduler._close_not_saved();\r\n\tthis.editStop(false);\r\n\tif(this._select_id){\r\n\t\tthis.unselect();\r\n\t}\r\n\tthis._select_id = id;\r\n\tthis.updateEvent(id);\r\n\tthis.callEvent(\"onEventSelected\", [id]);\r\n};\r\nscheduler.unselect=function(id){\r\n\tif (id && id!=this._select_id) {\r\n\t\treturn;\r\n\t}\r\n\tconst previousSelection = this._select_id;\r\n\tthis._select_id = null;\r\n\tif (previousSelection && this.getEvent(previousSelection)) {\r\n\t\tthis.updateEvent(previousSelection);\r\n\t}\r\n\tthis.callEvent(\"onEventUnselected\", [previousSelection]);\r\n};\r\nscheduler.$stateProvider.registerProvider(\"global\", (function(){\r\n\treturn {\r\n\t\tmode: this._mode,\r\n\t\tdate: new Date(this._date),\r\n\t\tmin_date: new Date(this._min_date),\r\n\t\tmax_date: new Date(this._max_date),\r\n\t\teditor_id: this._edit_id,\r\n\t\tlightbox_id: this._lightbox_id,\r\n\t\tnew_event: this._new_event,\r\n\t\tselect_id: this._select_id,\r\n\t\texpanded: this.expanded,\r\n\t\tdrag_id: this._drag_id,\r\n\t\tdrag_mode: this._drag_mode\r\n\t};\r\n}).bind(scheduler));\r\n\r\nscheduler._click={\r\n\tdhx_cal_data:function(e){\r\n\t\t//in case of touch disable click processing\r\n\t\tif (scheduler._ignore_next_click){\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\tconst id = scheduler._locate_event(e.target);\r\n\r\n\t\tif (!id) {\r\n\t\t\tscheduler.callEvent(\"onEmptyClick\",[scheduler.getActionData(e).date, e]);\r\n\t\t} else {\r\n\t\t\tif ( !scheduler.callEvent(\"onClick\",[id,e]) || scheduler.config.readonly ) return;\r\n\t\t}\r\n\r\n\t\tif (id && scheduler.config.select) {\r\n\r\n\t\t\tscheduler.select(id);\r\n\t\t\tconst icon = e.target.closest(\".dhx_menu_icon\");\r\n\r\n\t\t\tconst mask = scheduler._getClassName(icon);\r\n\t\t\tif (mask.indexOf(\"_icon\")!=-1)\r\n\t\t\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else{\r\n\t\t\tscheduler._close_not_saved();\r\n\t\t\tif (scheduler.getState().select_id && new Date().valueOf()-(scheduler._new_event||0) > 500){\r\n\t\t\t\tscheduler.unselect();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdhx_cal_prev_button:function(){\r\n\t\tscheduler._click.dhx_cal_next_button(0,-1);\r\n\t},\r\n\tdhx_cal_next_button:function(dummy,step){\r\n\t\tlet def_step = 1;\r\n\t\tif (scheduler.config.rtl){\r\n\t\t\tstep = -step;\r\n\t\t\tdef_step = -def_step;\r\n\t\t}\r\n\t\tscheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects\r\n\t\t\tscheduler.date[scheduler._mode+\"_start\"](new Date(scheduler._date)),(step||def_step),scheduler._mode));\r\n\t},\r\n\tdhx_cal_today_button:function(){\r\n\t\tif (scheduler.callEvent(\"onBeforeTodayDisplayed\", [])) {\r\n\t\t\tscheduler.setCurrentView(scheduler._currentDate());\r\n\t\t}\r\n\t},\r\n\tdhx_cal_tab:function(){\r\n\t\tconst name = this.getAttribute(\"data-tab\");\r\n\t\tconst deprecated_name = this.getAttribute(\"name\");\r\n\t\tconst mode = name || deprecated_name.substring(0, deprecated_name.search(\"_tab\"));\r\n\t\tscheduler.setCurrentView(scheduler._date,mode);\r\n\t},\r\n\tbuttons:{\r\n\t\t\"delete\":function(id){\r\n\t\t\tconst c = scheduler.locale.labels.confirm_deleting;\r\n\t\t\tscheduler._dhtmlx_confirm({message: c, title: scheduler.locale.labels.title_confirm_deleting, callback:function(){ scheduler.deleteEvent(id); },\r\n\t\t\tconfig: {ok: scheduler.locale.labels.icon_delete}\r\n\t\t});\r\n\t\t},\r\n\t\tedit:function(id){ scheduler.edit(id); },\r\n\t\tsave:function(id){ scheduler.editStop(true); },\r\n\t\tdetails:function(id){ scheduler.showLightbox(id); },\r\n\t\tform:function(id){ scheduler.showLightbox(id); },\r\n\t\tcancel:function(id){ scheduler.editStop(false); }\r\n\t}\r\n};\r\nscheduler._dhtmlx_confirm = function({message, title, callback, config}) {\r\n\tif (!message)\r\n\t\treturn callback();\r\n\r\n\tconfig = config || {};\r\n\tconst opts = { ...config, text: message };\r\n\tif (title) {\r\n\t\topts.title = title;\r\n\t}\r\n\tif (callback) {\r\n\t\topts.callback = function(result) {\r\n\t\t\tif (result) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tscheduler.confirm(opts);\r\n};\r\nscheduler.addEventNow=function(start,end,e){\r\n\tlet base = {};\r\n\tif (scheduler._isObject(start) && !scheduler._isDate(start)){\r\n\t\tbase = start;\r\n\t\tstart = null;\r\n\t}\r\n\r\n\tconst duration = (this.config.event_duration||this.config.time_step)*60000;\r\n\tif (!start) start = base.start_date||Math.round((scheduler._currentDate()).valueOf()/duration)*duration;\r\n\tlet start_date = new Date(start);\r\n\tif (!end){\r\n\t\tlet start_hour = this.config.first_hour;\r\n\t\tif (start_hour > start_date.getHours()){\r\n\t\t\tstart_date.setHours(start_hour);\r\n\t\t\tstart = start_date.valueOf();\r\n\t\t}\r\n\t\tend = start.valueOf()+duration;\r\n\t}\r\n\tlet end_date = new Date(end);\r\n\r\n\t// scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)\r\n\tif(start_date.valueOf() == end_date.valueOf())\r\n\t\tend_date.setTime(end_date.valueOf()+duration);\r\n\tbase.start_date = base.start_date||start_date;\r\n\tbase.end_date = base.end_date||end_date;\r\n\tbase.text = base.text||this.locale.labels.new_event;\r\n\tbase.id = this._drag_id = base.id || this.uid();\r\n\tthis._drag_mode=\"new-size\";\r\n\tthis._loading=true;\r\n\tconst eventId = this.addEvent(base);\r\n\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\tthis._loading=false;\r\n\r\n\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\tthis._on_mouse_up(e);\r\n\treturn eventId;\r\n};\r\nscheduler._on_dbl_click=function(e,src){\r\n\tsrc = src || e.target;\r\n\tif (this.config.readonly) return;\r\n\tconst name = scheduler._getClassName(src).split(\" \")[0];\r\n\tswitch(name){\r\n\t\tcase \"dhx_scale_holder\":\r\n\t\tcase \"dhx_scale_holder_now\":\r\n\t\tcase \"dhx_month_body\":\r\n\t\tcase \"dhx_wa_day_data\":\r\n\t\t\tif (!scheduler.config.dblclick_create) break;\r\n\t\t\tthis.addEventNow(this.getActionData(e).date,null,e);\r\n\t\t\tbreak;\r\n\t\tcase \"dhx_cal_event\":\r\n\t\tcase \"dhx_wa_ev_body\":\r\n\t\tcase \"dhx_agenda_line\":\r\n\t\tcase \"dhx_cal_agenda_event_line\":\r\n\t\tcase \"dhx_grid_event\":\r\n\t\tcase \"dhx_cal_event_line\":\r\n\t\tcase \"dhx_cal_event_clear\": {\r\n\t\t\tconst id = this._locate_event(src);\r\n\t\t\tif (!this.callEvent(\"onDblClick\",[id,e])) return;\r\n\t\t\tif (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)\r\n\t\t\t\tthis.showLightbox(id);\r\n\t\t\telse\r\n\t\t\t\tthis.edit(id);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase \"dhx_time_block\":\r\n\t\tcase \"dhx_cal_container\":\r\n\t\t\treturn;\r\n\t\tdefault: {\r\n\t\t\tconst viewHandler = this[\"dblclick_\"+name];\r\n\t\t\tif (viewHandler) {\r\n\t\t\t\tviewHandler.call(this,e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (src.parentNode && src != this)\r\n\t\t\t\t\treturn scheduler._on_dbl_click(e,src.parentNode);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n//column index by mouse x-coordinate\r\nscheduler._get_column_index = function(x_pos){\r\n\tlet column = 0;\r\n\tif (this._cols){\r\n\t\tlet width = 0;\r\n\t\tlet i = 0;\r\n\t\twhile (width + this._cols[i] < x_pos && i < this._cols.length){\r\n\t\t\twidth += this._cols[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tcolumn = i + (this._cols[i] ? ((x_pos - width)/ this._cols[i]) : 0);\r\n\r\n\t\tif (this._ignores){\r\n\t\t\tif(column >= this._cols.length){\r\n\t\t\t\twhile(column >= 1 && this._ignores[Math.floor(column)]){\r\n\t\t\t\t\tcolumn--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn column;\r\n};\r\n\r\n//transform mouse coordinates to day-time indexes of week based view\r\nscheduler._week_indexes_from_pos = function(pos){\r\n\t//\"get position\" can be invoked before columns are loaded into the units view(e.g. by onMouseMove handler in key_nav.js)\r\n\tif(!this._cols){\r\n\t\treturn pos;\r\n\t}else{\r\n\t\tconst column = this._get_column_index(pos.x);\r\n\r\n\t\tpos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(column)-1));\r\n\t\tpos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);\r\n\t\treturn pos;\r\n\t}\r\n};\r\n\r\nscheduler._mouse_coords=function(ev){\r\n\tlet pos;\r\n\tconst body = document.body;\r\n\tconst documentElement = document.documentElement;\r\n\tif (!this.$env.isIE && (ev.pageX || ev.pageY))\r\n\t\tpos={x:ev.pageX, y:ev.pageY};\r\n\telse pos={\r\n\t\tx:ev.clientX + (body.scrollLeft||documentElement.scrollLeft||0) - body.clientLeft,\r\n\t\ty:ev.clientY + (body.scrollTop||documentElement.scrollTop||0) - body.clientTop\r\n\t};\r\n\t//apply layout\r\n\tif (this.config.rtl && this._colsS) {\r\n\t\tpos.x = this.$container.querySelector(\".dhx_cal_data\").offsetWidth - pos.x;\r\n\t\tpos.x += this.$domHelpers.getAbsoluteLeft(this._obj);\r\n\t\tif (this._mode !== \"month\") {\r\n\t\t\tpos.x -= this.xy.scale_width;\r\n\t\t}\r\n\t} else {\r\n\t\tpos.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);\r\n\t}\r\n\r\n\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t//pos.y-=this.$domHelpers.getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.y-=this.$domHelpers.getAbsoluteTop(dataArea)-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.ev = ev;\r\n\tconst handler = this[\"mouse_\"+this._mode];\r\n\tif (handler){\r\n\t\tpos = handler.call(this,pos);\r\n\t}else{\r\n\t\t//transform to date\r\n\t\tif (!this._table_view) {\r\n\t\t\tpos = this._week_indexes_from_pos(pos);\r\n\t\t} else {\r\n\t\t\tconst column = this._get_column_index(pos.x);\r\n\t\t\tif (!this._cols || !this._colsS) // agenda/map views\r\n\t\t\t\treturn pos;\r\n\t\t\tlet dy=0;\r\n\t\t\tfor (dy=1; dy < this._colsS.heights.length; dy++)\r\n\t\t\t\tif (this._colsS.heights[dy]>pos.y) break;\r\n\r\n\t\t\tpos.y=Math.ceil( (Math.max(0, column)+Math.max(0,dy-1)*7)*24*60/this.config.time_step );\r\n\r\n\t\t\tif (scheduler._drag_mode || this._mode == \"month\")\r\n\t\t\t\tpos.y=(Math.max(0,Math.ceil(column)-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;\r\n\r\n\t\t\t//we care about ignored days only during event moving in month view\r\n\t\t\tif (this._drag_mode == \"move\"){\r\n\t\t\t\tif (scheduler._ignores_detected && scheduler.config.preserve_length){\r\n\t\t\t\t\tpos._ignores = true;\r\n\t\t\t\t\t//get real lengtn of event\r\n\t\t\t\t\tif (!this._drag_event._event_length)\r\n\t\t\t\t\t\tthis._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step:1, x_unit:\"day\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpos.x=0;\r\n\t\t}\r\n\t}\r\n\tpos.timestamp = +new Date();\r\n\treturn pos;\r\n};\r\nscheduler._close_not_saved=function(){\r\n\tif (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){\r\n\t\tconst confirmationText=scheduler.locale.labels.confirm_closing;\r\n\r\n\t\tscheduler._dhtmlx_confirm({\r\n\t\t\tmessage: confirmationText, \r\n\t\t\ttitle: scheduler.locale.labels.title_confirm_closing, \r\n\t\t\tcallback: function() { \r\n\t\t\t\tscheduler.editStop(scheduler.config.positive_closing);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(confirmationText){\r\n\t\t\tthis._drag_id = this._drag_pos = this._drag_mode = null;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler._correct_shift=function(start, back){\r\n\treturn start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);\r\n};\r\n\r\nscheduler._is_pos_changed = function(old_pos, new_pos){\r\n\tfunction diff(old_val, new_val, acc){\r\n\t\treturn !!(Math.abs(old_val - new_val) > acc);\r\n\t}\r\n\r\n\tif(!(old_pos && this._drag_pos)){\r\n\t\treturn true;\r\n\t}\r\n\tconst delay = 100;\r\n\tconst d_pos = 5;\r\n\r\n\t// start drag only if passed some time since mouse down, or if mouse position changed sufficiently\r\n\treturn !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || (new_pos.timestamp - this._drag_pos.timestamp > delay) || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));\r\n};\r\n\r\nscheduler._correct_drag_start_date = function(start){\r\n\tlet obj;\r\n\tif (scheduler.matrix)\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tstart = new Date(start);\r\n\tlet len = 1;\r\n\tif(obj._start_correction || obj._end_correction)\r\n\t\tlen = (obj.last_hour||0)*60 - (start.getHours()*60+start.getMinutes()) || 1;\r\n\r\n\treturn start*1 + (scheduler._get_fictional_event_length(start, len, obj) - len);\r\n};\r\nscheduler._correct_drag_end_date = function(start, duration){\r\n\tlet obj;\r\n\tif (scheduler.matrix) {\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t}\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tconst end = start*1 + scheduler._get_fictional_event_length(start, duration, obj);\r\n\treturn new Date(end*1 - (scheduler._get_fictional_event_length(end, -1, obj, -1) + 1));\r\n};\r\n\r\nscheduler._on_mouse_move=function(e){\r\n\tif (this._drag_mode){\r\n\t\tvar pos=this._mouse_coords(e);\r\n\t\tif (this._is_pos_changed(this._drag_pos, pos)){\r\n\t\t\tvar start, end;\r\n\t\t\tif (this._edit_id!=this._drag_id)\r\n\t\t\t\tthis._close_not_saved();\r\n\r\n\t\t\tif(!this._drag_mode)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar mousedownPos = null;\r\n\t\t\tif(this._drag_pos && !this._drag_pos.has_moved){\r\n\t\t\t\tmousedownPos = this._drag_pos;\r\n\t\t\t\tmousedownPos.has_moved = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._drag_pos = pos;\r\n\r\n\t\t\tthis._drag_pos.has_moved = true;\r\n\r\n\t\t\tif (this._drag_mode==\"create\"){\r\n\r\n\t\t\t\t// use mouse down position as a starting point for drag-create\r\n\t\t\t\tif(mousedownPos){\r\n\t\t\t\t\tpos = mousedownPos;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._close_not_saved();\r\n\t\t\t\tthis.unselect(this._select_id);\r\n\t\t\t\tthis._loading=true; //will be ignored by dataprocessor\r\n\r\n\t\t\t\tstart = this._get_date_from_pos(pos).valueOf();\r\n\r\n\t\t\t\tif (!this._drag_start) {\r\n\t\t\t\t\tvar res = this.callEvent(\"onBeforeEventCreated\", [e, this._drag_id]);\r\n\t\t\t\t\tif (!res){\r\n\t\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\tthis._drag_start=start;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tend = start;\r\n\t\t\t\tif (end == this._drag_start) {\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar start_date = new Date(this._drag_start);\r\n\t\t\t\tvar end_date = new Date(end);\r\n\t\t\t\tif ( (this._mode == \"day\" || this._mode == \"week\") &&\r\n\t\t\t\t\t(start_date.getHours() == end_date.getHours() &&\r\n\t\t\t\t\tstart_date.getMinutes() == end_date.getMinutes()) ) {\r\n\t\t\t\t\t\tend_date = new Date(this._drag_start+1000);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis._drag_id=this.uid();\r\n\t\t\t\tthis.addEvent(start_date, end_date, this.locale.labels.new_event, this._drag_id, pos.fields);\r\n\r\n\t\t\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\t\t\tthis._loading=false;\r\n\t\t\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar timeStep = this.config.time_step;\r\n\t\t\tvar ev=this.getEvent(this._drag_id);\r\n\t\t\tvar obj;\r\n\t\t\tif (scheduler.matrix)\r\n\t\t\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t\t\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\t\t\tif (this._drag_mode==\"move\"){\r\n\t\t\t\tstart = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;\r\n\t\t\t\tif (!pos.custom && this._table_view) {\r\n\t\t\t\t\tstart += this.date.time_part(ev.start_date) * 1000;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._table_view && this._dragEventBody && this._drag_event._move_event_shift === undefined) {\r\n\t\t\t\t\tthis._drag_event._move_event_shift = start - ev.start_date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._drag_event._move_event_shift) {\r\n\t\t\t\t\tstart -= this._drag_event._move_event_shift;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstart = this._correct_shift(start);\r\n\r\n\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view && obj){\r\n\r\n\t\t\t\t\tstart = scheduler._correct_drag_start_date(start);\r\n\t\t\t\t\tend = scheduler._correct_drag_end_date(start,this._drag_event._event_length);\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tend = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);\r\n\t\t\t} else { // resize\r\n\t\t\t\tstart = ev.start_date.valueOf();\r\n\t\t\t\tend = ev.end_date.valueOf();\r\n\t\t\t\tif (this._table_view) {\r\n\t\t\t\t\tvar resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);\r\n\t\t\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\t\t\tresize_date = this._correct_shift(resize_date, false);\r\n\t\t\t\t\t\tif( this._drag_from_start ) {\r\n\t\t\t\t\t\t\tvar day = 24*60*60000;\r\n\t\t\t\t\t\t\tif( resize_date <= scheduler.date.date_part(new Date(end+day-1)).valueOf() ) // to get end time as 23:59:59 and then the day start\r\n\t\t\t\t\t\t\t\tstart = resize_date - day;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(this.config.preserve_length) {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = scheduler._correct_drag_start_date(resize_date);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = scheduler._correct_drag_end_date(resize_date, 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = resize_date;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar end_day_start = this.date.date_part(new Date(ev.end_date.valueOf() - 1)).valueOf();\r\n\t\t\t\t\tvar end_day_date = new Date(end_day_start);\r\n\t\t\t\t\tvar firstHour = this.config.first_hour;\r\n\t\t\t\t\tvar lastHour = this.config.last_hour;\r\n\t\t\t\t\tvar maxY = (lastHour - firstHour) * (60/timeStep);\r\n\r\n\t\t\t\t\tthis.config.time_step = 1;\r\n\t\t\t\t\tvar precisePos = this._mouse_coords(e);\r\n\t\t\t\t\tthis.config.time_step = timeStep;\r\n\r\n\t\t\t\t\tvar minDate = pos.y*timeStep*60000;\r\n\t\t\t\t\tvar maxDate = Math.min(pos.y + 1, maxY)*timeStep*60000;\r\n\t\t\t\t\tvar preciseDate = precisePos.y*60000;\r\n\r\n\t\t\t\t\t// rounding end date to the closest time step\r\n\t\t\t\t\tif(Math.abs(minDate - preciseDate) > Math.abs(maxDate - preciseDate)){\r\n\t\t\t\t\t\tend = end_day_start + maxDate;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = end_day_start + minDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = end + ((new Date(end)).getTimezoneOffset() - end_day_date.getTimezoneOffset()) * 60000;\r\n\t\t\t\t\tthis._els[\"dhx_cal_data\"][0].style.cursor=\"s-resize\";\r\n\t\t\t\t\tif (this._mode == \"week\" || this._mode == \"day\")\r\n\t\t\t\t\t\tend = this._correct_shift(end);\r\n\t\t\t\t}\r\n\t\t\t\tif (this._drag_mode == \"new-size\") {\r\n\t\t\t\t\tif (end <= this._drag_start){\r\n\t\t\t\t\t\tvar shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);\r\n\t\t\t\t\t\tstart = end-(pos.shift?0:shift);\r\n\t\t\t\t\t\tend = this._drag_start+(shift||(timeStep*60000));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstart = this._drag_start;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (end<=start)\r\n\t\t\t\t\t\tend=start+timeStep*60000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar new_end = new Date(end-1);\r\n\t\t\tvar new_start = new Date(start);\r\n\t\t\t//deny drag out of visible scheduler scale in timeline view\r\n\t\t\tif(this._drag_mode==\"move\" && scheduler.config.limit_drag_out &&\r\n\t\t\t\t(+new_start < +scheduler._min_date || +end > +scheduler._max_date)){\r\n\r\n\t\t\t\tif(+ev.start_date < +scheduler._min_date || +ev.end_date > +scheduler._max_date){\r\n\t\t\t\t\t// not move event if it's already outside time scale\r\n\t\t\t\t\tnew_start = new Date(ev.start_date);\r\n\t\t\t\t\tend = new Date(ev.end_date);\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tvar duration = end - new_start;\r\n\r\n\t\t\t\t\tif(+new_start < +scheduler._min_date){\r\n\t\t\t\t\t\tnew_start = new Date(scheduler._min_date);\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tnew_start = new Date(scheduler._correct_drag_start_date(new_start));\r\n\t\t\t\t\t\t\tif(obj._start_correction)\r\n\t\t\t\t\t\t\t\tnew_start = new Date(new_start.valueOf() + obj._start_correction);\r\n\t\t\t\t\t\t\tend = new Date(new_start*1 + this._get_fictional_event_length(new_start, this._drag_event._event_length, obj));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tend = new Date(+new_start + duration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = new Date(scheduler._max_date);\r\n\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tif(obj._end_correction)\r\n\t\t\t\t\t\t\t\tend = new Date(end.valueOf() - obj._end_correction);\r\n\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\tnew_start = new Date(end*1 - this._get_fictional_event_length(end, this._drag_event._event_length, obj, true));\r\n\t\t\t\t\t\t\tif(this._ignores_detected){\r\n\t\t\t\t\t\t\t\tnew_start = scheduler.date.add(new_start, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\t\tend = scheduler.date.add(end, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tvar new_end = new Date(end-1);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view && this._dragEventBody &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler._get_section_view() && pos.x != this._get_event_sday({start_date: new Date(start), end_date:new Date(start)})) || new Date(start).getHours() < this.config.first_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tif (this._drag_mode == \"move\") {\r\n\t\t\t\t\tvar day = this._min_date.valueOf() + (pos.x * 24 * 60) * 60000;\r\n\t\t\t\t\tnew_start = new Date(day);\r\n\t\t\t\t\tnew_start.setHours(this.config.first_hour);\r\n\t\t\t\t\tend = new Date(new_start.valueOf() + duration);\r\n\t\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler.getView() && pos.x != this._get_event_sday({start_date: new Date(end), end_date:new Date(end)})) || new Date(end).getHours() >= this.config.last_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tvar day = this._min_date.valueOf()+(pos.x*24*60)*60000;\r\n\t\t\t\tend = scheduler.date.date_part(new Date(day));\r\n\t\t\t\tend.setHours(this.config.last_hour);\r\n\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\tif(this._drag_mode == \"move\"){\r\n\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//prevent out-of-borders situation for day|week view\r\n\t\t\tif ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()
=ed)\r\n\t\t\t\tcls += ' dhx_after';\r\n\t\t\telse if (sd.valueOf()==cd.valueOf())\r\n\t\t\t\tcls += ' dhx_now';\r\n\r\n\t\t\tif (this._ignores_detected && this._ignores[j]){\r\n\t\t\t\tcls += \" dhx_scale_ignore\";\r\n\t\t\t}\r\n\r\n\t\t\tcell.className = cls + \" \" + this.templates.month_date_class(sd, cd);\r\n\r\n\t\t\tcell.setAttribute(\"data-cell-date\", scheduler.templates.format_date(sd));\r\n\t\t\tvar body_class = \"dhx_month_body\";\r\n\t\t\tvar head_class = \"dhx_month_head\";\r\n\t\t\tif (j === 0 && this.config.left_border) {\r\n\t\t\t\tbody_class += \" dhx_month_body_border\";\r\n\t\t\t\thead_class += \" dhx_month_head_border\";\r\n\t\t\t}\r\n\t\t\tif (!this._ignores_detected || !this._ignores[j]){\r\n\t\t\t\tcell.style.width = tdwidths[j];\r\n\t\t\t\tthis._waiAria.monthCellAttr(cell, sd);\r\n\r\n\t\t\t\tvar cellHead = document.createElement(\"div\");\r\n\t\t\t\tcellHead.style.height = scheduler.xy.month_head_height + \"px\";\r\n\t\t\t\tcellHead.className = head_class;\r\n\t\t\t\tcellHead.innerHTML = this.templates.month_day(sd);\r\n\t\t\t\tcell.appendChild(cellHead);\r\n\r\n\t\t\t\tvar cellBody = document.createElement(\"div\");\r\n\t\t\t\tcellBody.className = body_class;\r\n\t\t\t\t// cellBody.style.height = row_height + \"px\";\r\n\t\t\t\t// cellBody.style.width = tdwidths[j];\r\n\t\t\t\tcell.appendChild(cellBody);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t}\r\n\t\t\trendered_dates.push(sd);\r\n\t\t\tvar bf1 = sd.getDate();\r\n\t\t\tsd=this.date.add(sd,1,\"day\");\r\n\t\t\tif (sd.getDate() - bf1 > 1)\r\n\t\t\t\tsd = new Date(sd.getFullYear(), sd.getMonth(), bf1 + 1, 12, 0);\r\n\t\t}\r\n\r\n\t\tscheduler._colsS.heights[i] = cellheight;\r\n\t\tcellheight += getCellHeight(i);\r\n\t}\r\n\r\n\tthis._min_date = view_start;\r\n\tthis._max_date = sd;\r\n\r\n\tdiv.innerHTML = \"\";\r\n\tdiv.appendChild(table);\r\n\r\n\tthis._scales = {};\r\n\tvar cells = div.querySelectorAll('[data-cell-date]');\r\n\tcells.forEach((cell) => {\r\n\t\tconst date = scheduler.templates.parse_date(cell.getAttribute(\"data-cell-date\"));\r\n\t\tconst body = cell.querySelector(\".dhx_month_body\");\r\n\t\tthis._scales[+date] = body;\r\n\t\tthis.callEvent(\"onScaleAdd\", [this._scales[+date], date]);\r\n\t});\r\n\r\n\treturn this._max_date;\r\n};\r\n\r\nscheduler._reset_month_scale=function(b,dd,sd,rows){\r\n\t//recalculates rows height and redraws month layout\r\n\tvar ed=scheduler.date.add(dd,1,\"month\");\r\n\r\n\t//trim time part for comparison reasons\r\n\tvar cd = scheduler._currentDate();\r\n\tthis.date.date_part(cd);\r\n\tthis.date.date_part(sd);\r\n\r\n\trows = rows || Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);\r\n\r\n\tvar height = (Math.floor(b.clientHeight/rows) - this.xy.month_head_height);\r\n\r\n\tthis._colsS.height = height + this.xy.month_head_height;\r\n\tthis._colsS.heights = [];\r\n\r\n\treturn scheduler._render_month_scale(b, dd, sd, rows);\r\n\r\n};\r\n\r\nscheduler.getView = function (viewName) {\r\n\tif (!viewName) {\r\n\t\tviewName = scheduler.getState().mode;\r\n\t}\r\n\tif (scheduler.matrix && scheduler.matrix[viewName]) {\r\n\t\treturn scheduler.matrix[viewName];\r\n\t}\r\n\r\n\tif (scheduler._props && scheduler._props[viewName]) {\r\n\t\treturn scheduler._props[viewName];\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nscheduler.getLabel = function(property, key) {\r\n\tvar sections = this.config.lightbox.sections;\r\n\tfor (var i=0; i scheduler.getState().max_date.valueOf()){\r\n\t\t\tendColumnIndex += getDaysDifference(endDate, scheduler.getState().max_date);\r\n\t\t}\r\n\t} else{\r\n\t\tendColumnIndex = Math.round(eventLength/60/60/1000/24);\r\n\t}\r\n\r\n\tvar last_column = true;\r\n\twhile (startColumnIndex < endColumnIndex){\r\n\t\tvar check = scheduler.date.add(endDate, -config.x_step, config.x_unit);\r\n\t\tif (ignore && ignore(endDate) && (!last_column || (last_column && ignore(check) ))){\r\n\t\t\teventLength -= (endDate-check);\r\n\r\n\t\t}else{\r\n\t\t\tlet excludedDuration = 0;\r\n\t\t\tconst intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));\r\n\t\t\tconst intervalEnd = endDate;\r\n\t\t\tconst leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);\r\n\t\t\tconst leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour||24);\r\n\t\t\tconst rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);\r\n\t\t\tconst rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour||24);\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += intervalEnd - rightCellCutOffEnd;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += config._start_correction;\r\n\t\t\t} else {\r\n\t\t\t\texcludedDuration += intervalEnd.getHours()*60*60*1000 + intervalEnd.getMinutes()*60*1000;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += config._end_correction;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += (leftCellCutOffStart.valueOf() - intervalStart.valueOf());\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\teventLength -= excludedDuration;\r\n\t\t\tlast_column = false;\r\n\t\t}\r\n\t\tendDate = check;\r\n\t\tendColumnIndex--;\r\n\t}\r\n\treturn eventLength;\r\n};\r\nscheduler._get_fictional_event_length=function(end_date, ev_length, obj, back){\r\n\tvar sd = new Date(end_date);\r\n\tvar dir = back ? -1 : 1;\r\n\r\n\t//get difference caused by first|last hour\r\n\tif (obj._start_correction || obj._end_correction){\r\n\t\tvar today;\r\n\t\tif (back)\r\n\t\t\ttoday = (sd.getHours()*60+sd.getMinutes()) - (obj.first_hour||0)*60;\r\n\t\telse\r\n\t\t\ttoday = (obj.last_hour||0)*60 - (sd.getHours()*60+sd.getMinutes());\r\n\t\tvar per_day = (obj.last_hour - obj.first_hour)*60;\r\n\t\tvar days = Math.ceil( (ev_length / (60*1000) - today ) / per_day);\r\n\t\tif(days < 0) days = 0;\r\n\t\tev_length += days * (24*60 - per_day) * 60 * 1000;\r\n\t}\r\n\r\n\tvar fd = new Date(end_date*1+ev_length*dir);\r\n\tvar ignore = this[\"ignore_\"+this._mode];\r\n\r\n\tvar start_slot = 0,\r\n\t\tend_slot;\r\n\tif (obj.render){\r\n\t\tstart_slot = this._get_date_index(obj, sd);\r\n\t\tend_slot = this._get_date_index(obj, fd);\r\n\t} else{\r\n\t\tend_slot = Math.round(ev_length/60/60/1000/24);\r\n\t}\r\n\r\n\twhile (start_slot*dir <= end_slot*dir){\r\n\t\tvar check = scheduler.date.add(sd, obj.x_step*dir, obj.x_unit);\r\n\t\tif (ignore && ignore(sd)){\r\n\t\t\tev_length += (check-sd)*dir;\r\n\t\t\tend_slot += dir;\r\n\t\t}\r\n\r\n\t\tsd = check;\r\n\t\tstart_slot+=dir;\r\n\t}\r\n\r\n\treturn ev_length;\r\n};\r\n\r\nscheduler._get_section_view = function(){\r\n\treturn this.getView();\r\n};\r\n\r\nscheduler._get_section_property = function(){\r\n\tif(this.matrix && this.matrix[this._mode]){\r\n\t\treturn this.matrix[this._mode].y_property;\r\n\t}else if(this._props && this._props[this._mode]){\r\n\t\treturn this._props[this._mode].map_to;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nscheduler._is_initialized = function(){\r\n\tvar state = this.getState();\r\n\treturn (this._obj && state.date && state.mode);\r\n};\r\nscheduler._is_lightbox_open = function(){\r\n\tvar state = this.getState();\r\n\treturn state.lightbox_id !== null && state.lightbox_id !== undefined;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\t// eslint-disable-next-line no-control-regex\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tscheduler._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tif(typeof attr[i] != \"function\" && typeof attr[i] != \"object\") {\r\n\t\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\t\t},\r\n\t\tsetAttributes: function(div, values){\r\n\t\t\tfor(var i in values){\r\n\t\t\t\tdiv.setAttribute(i, stripHTMLLite(values[i]));\r\n\t\t\t}\r\n\t\t\treturn div;\r\n\t\t},\r\n\r\n\t\tlabelAttr: function(div, content){\r\n\t\t\treturn this.setAttributes(div, {\"aria-label\": content});\r\n\t\t},\r\n\t\tlabel: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\t// day/week/units\r\n\r\n\t\thourScaleAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\r\n\t\t},\r\n\t\tmonthCellAttr: function(div, date){\r\n\t\t\tthis.labelAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\tnavBarDateAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\t\tdayHeaderAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\r\n\t\tdayColumnAttr: function(div, date){\r\n\t\t\tthis.dayHeaderAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\theaderButtonsAttributes: function(div, label){\r\n\t\t\treturn this.setAttributes(div, {\"role\":\"button\", \"aria-label\":label});\r\n\t\t},\r\n\r\n\t\theaderToggleState: function(div, isActive){\r\n\t\t\treturn this.setAttributes(div, {\"aria-pressed\": isActive ? \"true\" : \"false\"});\r\n\t\t},\r\n\r\n\r\n\t\tgetHeaderCellAttr:function(dateString){\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\r\n\t\teventAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\r\n\t\t_eventCommonAttr: function(event, div){\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(scheduler.templates.event_text(event.start_date, event.end_date, event)));\r\n\r\n\t\t\tif(scheduler.config.readonly){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(event.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tdiv.setAttribute(\"aria-selected\",\r\n\t\t\t\t(scheduler.getState().select_id == event.id) ? \"true\" : \"false\");\r\n\t\t},\r\n\r\n\t\tsetEventBarAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\t\t_getAttributes: function(attributeSetter, arg){\r\n\t\t\tvar result = {\r\n\t\t\t\tsetAttribute:function(name, value){\r\n\t\t\t\t\tthis[name] = value;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tattributeSetter.apply(this, [arg, result]);\r\n\t\t\treturn result;\r\n\r\n\t\t},\r\n\r\n\t\teventBarAttrString: function(event){\r\n\t\t\treturn this.getAttributeString(this._getAttributes(this.setEventBarAttr, event));\r\n\t\t},\r\n\r\n\r\n\r\n\t\tagendaHeadAttrString :function(){\r\n\t\t\treturn this.getAttributeString({role: \"row\"});\r\n\t\t},\r\n\t\tagendaHeadDateString :function(label){\r\n\t\t\treturn this.getAttributeString({role: \"columnheader\", \"aria-label\": label});\r\n\t\t},\r\n\t\tagendaHeadDescriptionString :function(label){\r\n\t\t\treturn this.agendaHeadDateString(label);\r\n\t\t},\r\n\t\tagendaDataAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\t\tagendaEventAttrString: function(event){\r\n\t\t\tvar attrs = this._getAttributes(this._eventCommonAttr, event);\r\n\r\n\t\t\tattrs[\"role\"] = \"row\";\r\n\r\n\t\t\treturn this.getAttributeString(attrs);\r\n\r\n\t\t},\r\n\t\tagendaDetailsBtnString: function(){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels.icon_details});\r\n\t\t},\r\n\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\r\n\t\tgridRowAttrString: function(event){\r\n\t\t\treturn this.agendaEventAttrString(event);\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(event, column, value){\r\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": [\r\n\t\t\t\t(column.label === undefined ? column.id : column.label),\r\n\t\t\t\t\": \",\r\n\t\t\t\tvalue\r\n\t\t\t]});\r\n\t\t},\r\n\r\n\t\tmapAttrString: function(){\r\n\t\t\treturn this.gridAttrString();\r\n\t\t},\r\n\t\tmapRowAttrString: function(event){\r\n\t\t\treturn this.gridRowAttrString(event);\r\n\t\t},\r\n\t\tmapDetailsBtnString: function(){\r\n\t\t\treturn this.agendaDetailsBtnString();\r\n\t\t},\r\n\r\n\t\tminicalHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\",\r\n\t\t\t\t\"aria-live\":\"assertice\",\r\n\t\t\t\t\"aria-atomic\":\"true\"\r\n\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalGrid: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"aria-labelledby\":headerId+\"\",\r\n\t\t\t\t\"role\":\"grid\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalRow: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"row\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalDayCell: function(div, date){\r\n\t\t\tvar selected = (date.valueOf() < scheduler._max_date.valueOf() && date.valueOf() >= scheduler._min_date.valueOf());\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\",\r\n\t\t\t\t\"aria-label\": scheduler.templates.day_date(date),\r\n\t\t\t\t\"aria-selected\": selected ? \"true\" : \"false\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalHeadCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"columnheader\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\r\n\t\tweekAgendaDayCell: function(div, date){\r\n\t\t\tvar header = div.querySelector(\".dhx_wa_scale_bar\");\r\n\t\t\tvar content = div.querySelector(\".dhx_wa_day_data\");\r\n\t\t\tvar headerId = scheduler.uid() + \"\";\r\n\t\t\tthis.setAttributes(header, { \"id\": headerId});\r\n\t\t\tthis.setAttributes(content, { \"aria-labelledby\": headerId});\r\n\r\n\t\t},\r\n\t\tweekAgendaEvent: function(div, event){\r\n\t\t\tthis.eventAttr(event, div);\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxSectionButtonAttrString: function(label){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tyearHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tyearGrid: function(div, headerId){\r\n\t\t\tthis.minicalGrid(div, headerId);\r\n\t\t},\r\n\t\tyearHeadCell: function(div){\r\n\t\t\treturn this.minicalHeadCell(div);\r\n\t\t},\r\n\t\tyearRow: function(div){\r\n\t\t\treturn this.minicalRow(div);\r\n\t\t},\r\n\t\tyearDayCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\t\teventMenuAttrString: function(iconName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[iconName]});\r\n\t\t},\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.year;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.month;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.day;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.hour + \" \" + scheduler.locale.labels.minute;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !scheduler.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in scheduler._waiAria){\r\n\t\tscheduler._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(scheduler._waiAria[i]);\r\n\t}\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(scheduler.config.show_errors && scheduler.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (scheduler.message) {\r\n\t\t\t\t\tscheduler.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export default function extend(scheduler) {\r\n\r\nif (window.jQuery){\r\n\r\n(function( $ ){\r\n\tvar counter = 0;\r\n\tvar methods = [];\r\n\t$.fn.dhx_scheduler = function(config){\r\n\t\tif (typeof(config) === 'string') {\r\n\t\t\tif (methods[config] ) {\r\n\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t}else {\r\n\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_scheduler');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar views = [];\r\n\t\t\tthis.each(function() {\r\n\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\tif (!this.getAttribute(\"dhxscheduler\")){\r\n\t\t\t\t\t\tvar name = \"scheduler\";\r\n\t\t\t\t\t\tif (counter){\r\n\t\t\t\t\t\t\tname = \"scheduler\" + (counter+1);\r\n\t\t\t\t\t\t\twindow[name] = Scheduler.getSchedulerInstance();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar comp = window[name];\r\n\r\n\t\t\t\t\t\tthis.setAttribute(\"dhxscheduler\", name);\r\n\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\tcomp.config[key] = config[key];\r\n\r\n\t\t\t\t\t\tif (!this.getElementsByTagName(\"div\").length){\r\n\t\t\t\t\t\t\tthis.innerHTML = '
';\r\n\t\t\t\t\t\t\tthis.className += \" dhx_cal_container\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcomp.init(this, comp.config.date, comp.config.mode);\r\n\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\tcomp.parse(config.data);\r\n\r\n\t\t\t\t\t\tviews.push(comp);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tviews.push(window[this.getAttribute(\"dhxscheduler\")]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (views.length === 1) return views[0];\r\n\t\t\treturn views;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\r\n})(window.jQuery);\r\n\r\n}\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.destructor = function(){\r\n\tscheduler.callEvent(\"onDestroy\", []);\r\n\tthis.clearAll();\r\n\r\n\tif(this.$container){\r\n\t\t// FIXME: clear container or remove container\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\t// scheduler.$domHelpers.remove(this.$container);\r\n\t}\r\n\r\n\tif(this._eventRemoveAll){\r\n\t\tthis._eventRemoveAll();\r\n\t}\r\n\r\n\tif(this.resetLightbox){\r\n\t\tthis.resetLightbox();\r\n\t}\r\n\r\n\tif(this._dp && this._dp.destructor){\r\n\t\tthis._dp.destructor();\r\n\t}\r\n\r\n\t// detachAllEvents should be called last, because in components may be attached events\r\n\tthis.detachAllEvents();\r\n\r\n\tfor(var i in this){\r\n\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\tdelete this[i];\r\n\t\t}\r\n\t}\r\n\tscheduler.$destroyed = true;\r\n};\r\n\r\n}","import serialize from \"../common/url_serialize.js\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.Promise = window.Promise; \r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.ajax = {\r\n\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t// if true - do not add extra params\r\n\tcache: true,\r\n\r\n\t// default method for load/loadStruct, post/get allowed\r\n\tmethod: \"get\",\r\n\r\n\tserializeRequestParams: serialize,\r\n\tparse: function(data) {\r\n\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\tvar obj;\r\n\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\tif (typeof DOMParser !== \"undefined\" && !scheduler.$env.isIE) { // ff,ie9\r\n\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t} else if (typeof window.ActiveXObject !== \"undefined\") {\r\n\t\t\tobj = new window.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\tobj.async = \"false\";\r\n\t\t\tobj.loadXML(data);\r\n\t\t}\r\n\t\treturn obj;\r\n\t},\r\n\txmltop: function(tagname, xhr, obj) {\r\n\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj !== -1) scheduler.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\treturn document.createElement(\"DIV\");\r\n\t},\r\n\txpath: function(xpathExp, docObj) {\r\n\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\tif (scheduler.$env.isIE) {\r\n\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t} else {\r\n\t\t\tvar rows = [];\r\n\t\t\tvar first;\r\n\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\twhile (true){\r\n\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\tif(first){\r\n\t\t\t\t\trows.push(first);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t},\r\n\tquery: function(config) {\r\n\t\treturn this._call(\r\n\t\t\t(config.method || \"GET\"),\r\n\t\t\tconfig.url,\r\n\t\t\tconfig.data || \"\",\r\n\t\t\t(config.async || true),\r\n\t\t\tconfig.callback,\r\n\t\t\tconfig.headers\r\n\t\t);\r\n\t},\r\n\tget: function(url, onLoad, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tgetSync: function(url, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\tput: function(url, postData, onLoad, headers) {\r\n\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tdel: function(url, onLoad, headers) {\r\n\t\t/**\r\n\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t * implementations to reject the request.\r\n\t\t */\r\n\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpost: function(url, postData, onLoad, headers) {\r\n\t\tif (arguments.length == 1) {\r\n\t\t\tpostData = \"\";\r\n\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\tonLoad = postData;\r\n\t\t\tpostData = \"\";\r\n\t\t}\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpostSync: function(url, postData, headers) {\r\n\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\treturn new scheduler.Promise((function(resolve, reject) {\r\n\t\t\tvar t = (typeof XMLHttpRequest !== undefined && !scheduler.$env.isIE ? new XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\tif (!!async) {\r\n\t\t\t\tt.addEventListener(\"readystatechange\", function() {\r\n\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\tif (!scheduler.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad.apply(window, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (method == \"GET\" && !this.cache) {\r\n\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t}\r\n\r\n\t\t\tt.open(method, url, async);\r\n\r\n\t\t\tif (headers){\r\n\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\tpostData = null;\r\n\t\t\t}\r\n\r\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\tt.send(postData);\r\n\r\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t}.bind(this)));\r\n\t},\r\n\turlSeparator: function(str){\r\n\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\treturn \"&\";\r\n\t\telse\r\n\t\t\treturn \"?\";\r\n\t}\r\n};\r\n\r\nscheduler.$ajax = scheduler.ajax; // for old\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n/*\r\n%e\tDay of the month without leading zeros (01..31)\r\n%d\tDay of the month, 2 digits with leading zeros (01..31)\r\n%j\tDay of the year, 3 digits with leading zeros (001..366)\r\n%a\tA textual representation of a day, two letters\r\n%W\tA full textual representation of the day of the week\r\n\r\n%c\tNumeric representation of a month, without leading zeros (0..12)\r\n%m\tNumeric representation of a month, with leading zeros (00..12)\r\n%b\tA short textual representation of a month, three letters (Jan..Dec)\r\n%M\tA full textual representation of a month, such as January or March (January..December)\r\n\r\n%y\tA two digit representation of a year (93..03)\r\n%Y\tA full numeric representation of a year, 4 digits (1993..03)\r\n*/\r\n\r\nscheduler.config={\r\n\tdefault_date: \"%j %M %Y\",\r\n\tmonth_date: \"%F %Y\",\r\n\tload_date: \"%Y-%m-%d\",\r\n\tweek_date: \"%l\",\r\n\tday_date: \"%D %j\",\r\n\thour_date: \"%H:%i\",\r\n\tmonth_day: \"%d\",\r\n\t//xml_date: \"%m/%d/%Y %H:%i\",\r\n\tdate_format: \"%Y-%m-%d %H:%i\",\r\n\tapi_date: \"%d-%m-%Y %H:%i\",\r\n\tparse_exact_format: false,\r\n\tpreserve_length:true,\r\n\ttime_step: 5,\r\n\tdisplayed_event_color: \"#ff4a4a\",\r\n\tdisplayed_event_text_color: \"#ffef80\",\r\n\twide_form: 0,\r\n\tday_column_padding: 8,\r\n\tuse_select_menu_space: true,\r\n\tfix_tab_position: true,\r\n\tstart_on_monday: true,\r\n\tfirst_hour: 0,\r\n\tlast_hour: 24,\r\n\treadonly: false,\r\n\tdrag_resize: true,\r\n\tdrag_move: true,\r\n\tdrag_create: true,\r\n\tdrag_event_body: true,\r\n\tdblclick_create: true,\r\n\tdetails_on_dblclick: true,\r\n\tedit_on_create: true,\r\n\tdetails_on_create: true,\r\n\theader: null,\r\n\thour_size_px: 44,\r\n\tresize_month_events:false,\r\n\tresize_month_timed:false,\r\n\tresponsive_lightbox: false,\r\n\tseparate_short_events: true,\r\n\trtl:false,\r\n\r\n\tcascade_event_display: false,\r\n\tcascade_event_count: 4,\r\n\tcascade_event_margin: 30,\r\n\r\n\tmulti_day:true,\r\n\tmulti_day_height_limit: 200,\r\n\r\n\tdrag_lightbox: true,\r\n\tpreserve_scroll: true,\r\n\tselect: true,\r\n\tundo_deleted: true,\r\n\tserver_utc: false,\r\n\ttouch:true,\r\n\ttouch_tip:true,\r\n\ttouch_drag:500,\r\n\ttouch_swipe_dates: false,\r\n\tquick_info_detached:true,\r\n\r\n\tpositive_closing: false,\r\n\t//header_datepicker: true,\r\n\tdrag_highlight: true,\r\n\tlimit_drag_out: false,\r\n\ticons_edit: [\"icon_save\", \"icon_cancel\"],\r\n\ticons_select: [\"icon_details\", \"icon_edit\", \"icon_delete\"],\r\n\tbuttons_left: [\"dhx_save_btn\", \"dhx_cancel_btn\"],\r\n\tbuttons_right: [\"dhx_delete_btn\"],\r\n\tlightbox: {\r\n\t\tsections: [\r\n\t\t\t{name: \"description\", map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t{name: \"time\", height: 72, type: \"time\", map_to: \"auto\"}\r\n\t\t]\r\n\t},\r\n\thighlight_displayed_event: true,\r\n\tleft_border: false,\r\n\r\n\tajax_error: \"alert\",//\"ignore\"|\"console\"\r\n\tdelay_render: 0,\r\n\ttimeline_swap_resize: true,\r\n\twai_aria_attributes: true,\r\n\twai_aria_application_role: true,\r\n\r\n\tcsp: \"auto\",\r\n\tevent_attribute: \"data-event-id\",\r\n\tshow_errors: true\r\n};\r\n\r\nscheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();\r\nscheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();\r\n\r\nscheduler._helpers = {\r\n\tparseDate: function parseDate(date) {\r\n\t\tvar parse = scheduler.templates.xml_date || scheduler.templates.parse_date;\r\n\t\treturn parse(date);\r\n\t},\r\n\tformatDate: function formatDate(date) {\r\n\t\tvar format = scheduler.templates.xml_format || scheduler.templates.format_date;\r\n\t\treturn format(date);\r\n\t}\r\n};\r\n\r\nscheduler.templates={};\r\nscheduler.init_templates=function(){\r\n\r\n\r\n\r\n\tvar d=scheduler.date.date_to_str;\r\n\tvar c=scheduler.config;\r\n\tvar f = function(a,b){\r\n\t\tfor (var c in b)\r\n\t\t\tif (!a[c]) a[c]=b[c];\r\n\t};\r\n\tf(scheduler.templates,{\r\n\t\tday_date:d(c.default_date),\r\n\t\tmonth_date:d(c.month_date),\r\n\t\tweek_date:function(d1,d2){\r\n\t\t\tif(c.rtl) {\r\n\t\t\t\treturn scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"))+\" – \"+scheduler.templates.day_date(d1);\r\n\t\t\t} \r\n\t\t\treturn scheduler.templates.day_date(d1)+\" – \"+scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"));\r\n\t\t},\r\n\t\tday_scale_date:d(c.default_date),\r\n\t\ttime_slot_text: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\ttime_slot_class: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\r\n\t\tmonth_scale_date:d(c.week_date),\r\n\t\tweek_scale_date:d(c.day_date),\r\n\t\thour_scale:d(c.hour_date),\r\n\t\ttime_picker:d(c.hour_date),\r\n\t\tevent_date:d(c.hour_date),\r\n\t\tmonth_day:d(c.month_day),\r\n\r\n\t\tload_format: d(c.load_date),\r\n\t//\txml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),\r\n\t//\txml_format:d(c.date_format,c.server_utc),\r\n\t\tformat_date: d(c.date_format, c.server_utc),\r\n\t\tparse_date:scheduler.date.str_to_date(c.date_format,c.server_utc),\r\n\t\tapi_date:scheduler.date.str_to_date(c.api_date, false, false),\r\n\t\tevent_header:function(start,end,ev){\r\n\r\n\t\t\tif(ev._mode === \"small\" || ev._mode === \"smallest\"){\r\n\t\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.templates.event_date(start)+\" - \"+scheduler.templates.event_date(end);\r\n\t\t\t}\r\n\t\t},\r\n\t\tevent_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tevent_class:function(start,end,ev){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tmonth_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tweek_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tevent_bar_date:function(start,end,ev) {\r\n\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t},\r\n\t\tevent_bar_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tmonth_events_link : function(date, count){\r\n\t\t\treturn \"View more(\"+count+\" events) \";\r\n\t\t},\r\n\t\tdrag_marker_class : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tdrag_marker_content : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\t/* Could be redifined */\r\n\t\ttooltip_date_format: scheduler.date.date_to_str(\"%Y-%m-%d %H:%i\"),\r\n\t\ttooltip_text: function(start, end, event) {\r\n\t\t\treturn \"Event: \" + event.text + \"Start date: \" + scheduler.templates.tooltip_date_format(start) + \"End date: \" + scheduler.templates.tooltip_date_format(end);\r\n\t\t},\r\n\r\n\t\tcalendar_month: d(\"%F %Y\"),\r\n\t\tcalendar_scale_date: d(\"%D\"),\r\n\t\tcalendar_date: d(\"%d\"),\r\n\t\tcalendar_time: d(\"%d-%m-%Y\")\r\n\r\n\t});\r\n\tthis.callEvent(\"onTemplatesReady\",[]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._events = {};\r\nscheduler.clearAll = function() {\r\n\tthis._events = {};\r\n\tthis._loaded = {};\r\n\r\n\tthis._edit_id = null;\r\n\tthis._select_id = null;\r\n\tthis._drag_id = null;\r\n\tthis._drag_mode = null;\r\n\tthis._drag_pos = null;\r\n\tthis._new_event = null;\r\n\r\n\tthis.clear_view();\r\n\tthis.callEvent(\"onClearAll\", []);\r\n};\r\nscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\tif (!arguments.length)\r\n\t\treturn this.addEventNow();\r\n\tvar ev = start_date;\r\n\tif (arguments.length != 1) {\r\n\t\tev = extra_data || {};\r\n\t\tev.start_date = start_date;\r\n\t\tev.end_date = end_date;\r\n\t\tev.text = text;\r\n\t\tev.id = id;\r\n\t}\r\n\tev.id = ev.id || scheduler.uid();\r\n\tev.text = ev.text || \"\";\r\n\r\n\tif (typeof ev.start_date == \"string\") ev.start_date = this.templates.api_date(ev.start_date);\r\n\tif (typeof ev.end_date == \"string\") ev.end_date = this.templates.api_date(ev.end_date);\r\n\tvar d = (this.config.event_duration || this.config.time_step) * 60000;\r\n\tif (ev.start_date.valueOf() == ev.end_date.valueOf())\r\n\t\tev.end_date.setTime(ev.end_date.valueOf() + d);\r\n\r\n\tev.start_date.setMilliseconds(0);\r\n\tev.end_date.setMilliseconds(0);\r\n\r\n\tev._timed = this.isOneDayEvent(ev);\r\n\r\n\tvar is_new = !this._events[ev.id];\r\n\tthis._events[ev.id] = ev;\r\n\tthis.event_updated(ev);\r\n\tif (!this._loading)\r\n\t\tthis.callEvent(is_new ? \"onEventAdded\" : \"onEventChanged\", [ev.id, ev]);\r\n\treturn ev.id;\r\n};\r\nscheduler.deleteEvent = function(id, silent) {\r\n\tvar ev = this._events[id];\r\n\tif (!silent && (!this.callEvent(\"onBeforeEventDelete\", [id, ev]) || !this.callEvent(\"onConfirmedBeforeEventDelete\", [id, ev])))\r\n\t\treturn;\r\n\tif (ev) {\r\n\t\tif(scheduler.getState().select_id == id){\r\n\t\t\tscheduler.unselect();\r\n\t\t}\r\n\t\tdelete this._events[id];\r\n\t\tthis.event_updated(ev);\r\n\r\n\t\tif(this._drag_id == ev.id){\r\n\t\t\tthis._drag_id = null;\r\n\t\t\tthis._drag_mode=null;\r\n\t\t\tthis._drag_pos=null;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.callEvent(\"onEventDeleted\", [id, ev]);\r\n};\r\nscheduler.getEvent = function(id) {\r\n\treturn this._events[id];\r\n};\r\nscheduler.setEvent = function(id, hash) {\r\n\tif(!hash.id)\r\n\t\thash.id = id;\r\n\r\n\tthis._events[id] = hash;\r\n};\r\nscheduler.for_rendered = function(id, method) {\r\n\tfor (var i = this._rendered.length - 1; i >= 0; i--)\r\n\t\tif (this._rendered[i].getAttribute(this.config.event_attribute) == id)\r\n\t\t\tmethod(this._rendered[i], i);\r\n};\r\nscheduler.changeEventId = function(id, new_id) {\r\n\tif (id == new_id) return;\r\n\tvar ev = this._events[id];\r\n\tif (ev) {\r\n\t\tev.id = new_id;\r\n\t\tthis._events[new_id] = ev;\r\n\t\tdelete this._events[id];\r\n\t}\r\n\tthis.for_rendered(id, function(r) {\r\n\t\tr.setAttribute(\"event_id\", new_id); // for backward compatibility\r\n\t\tr.setAttribute(scheduler.config.event_attribute, new_id);\r\n\t});\r\n\tif (this._select_id == id) this._select_id = new_id;\r\n\tif (this._edit_id == id) this._edit_id = new_id;\r\n\t//if (this._drag_id==id) this._drag_id=new_id;\r\n\tthis.callEvent(\"onEventIdChange\", [id, new_id]);\r\n};\r\n\r\n(function() {\r\n\tvar attrs = [\"text\", \"Text\", \"start_date\", \"StartDate\", \"end_date\", \"EndDate\"];\r\n\tvar create_getter = function(name) {\r\n\t\treturn function(id) { return (scheduler.getEvent(id))[name]; };\r\n\t};\r\n\tvar create_setter = function(name) {\r\n\t\treturn function(id, value) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tev[name] = value;\r\n\t\t\tev._changed = true;\r\n\t\t\tev._timed = this.isOneDayEvent(ev);\r\n\t\t\tscheduler.event_updated(ev, true);\r\n\t\t};\r\n\t};\r\n\tfor (var i = 0; i < attrs.length; i += 2) {\r\n\t\tscheduler[\"getEvent\" + attrs[i + 1]] = create_getter(attrs[i]);\r\n\t\tscheduler[\"setEvent\" + attrs[i + 1]] = create_setter(attrs[i]);\r\n\t}\r\n})();\r\n\r\nscheduler.event_updated = function(ev, force) {\r\n\tif (this.is_visible_events(ev))\r\n\t\tthis.render_view_data();\r\n\telse\r\n\t\tthis.clear_event(ev.id);\r\n};\r\nscheduler.is_visible_events = function(ev) {\r\n\tif(!this._min_date || !this._max_date){\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//if in displayed dates\r\n\tvar in_visible_range = (ev.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < ev.end_date.valueOf());\r\n\r\n\tif(in_visible_range){\r\n\r\n\t\t//end dates are not between last/first hours\r\n\t\tvar evFirstHour = ev.start_date.getHours(),\r\n\t\t\tevLastHour = ev.end_date.getHours() + (ev.end_date.getMinutes()/60),\r\n\t\t\tlastHour = this.config.last_hour,\r\n\t\t\tfirstHour = this.config.first_hour;\r\n\r\n\t\tvar end_dates_visible = (this._table_view || !((evLastHour > lastHour || evLastHour <= firstHour) && (evFirstHour >= lastHour || evFirstHour < firstHour)));\r\n\r\n\t\tif(end_dates_visible){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\r\n\t\t\t//event is bigger than area hidden between last/first hours\r\n\t\t\tvar event_duration = (ev.end_date.valueOf() - ev.start_date.valueOf()) / (1000*60*60),//hours\r\n\t\t\t\thidden_duration = 24 - (this.config.last_hour - this.config.first_hour);\r\n\r\n\t\t\treturn !!((event_duration > hidden_duration) || (evFirstHour < lastHour && evLastHour > firstHour));\r\n\r\n\t\t}\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.isOneDayEvent = function(ev) {\r\n\t// decrease by one ms so events that ends on midnight on the next day were still considered one day events\r\n\t// e.g. (09-02-2018 19:00 - 10-02-2018 00:00)\r\n\t// events >= 24h long are considered multiday\r\n\tvar checkEndDate = new Date(ev.end_date.valueOf() - 1);\r\n\treturn (\r\n\t\tev.start_date.getFullYear() === checkEndDate.getFullYear() &&\r\n\t\tev.start_date.getMonth() === checkEndDate.getMonth() &&\r\n\t\tev.start_date.getDate() === checkEndDate.getDate()\r\n\t) && ((ev.end_date.valueOf() - ev.start_date.valueOf()) < (1000 * 60 * 60 * 24));\r\n};\r\n\r\nscheduler.get_visible_events = function(only_timed) {\r\n\t//not the best strategy for sure\r\n\tvar stack = [];\r\n\r\n\tfor (var id in this._events)\r\n\t\tif (this.is_visible_events(this._events[id]))\r\n\t\t\tif (!only_timed || this._events[id]._timed)\r\n\t\t\t\tif (this.filter_event(id, this._events[id]))\r\n\t\t\t\t\tstack.push(this._events[id]);\r\n\r\n\treturn stack;\r\n};\r\nscheduler.filter_event = function(id, ev) {\r\n\tvar filter = this[\"filter_\" + this._mode];\r\n\treturn (filter) ? filter(id, ev) : true;\r\n};\r\nscheduler._is_main_area_event = function(ev){\r\n\treturn !!ev._timed;\r\n};\r\nscheduler.render_view_data = function(evs, hold) {\r\n\tvar full = false;\r\n\tif (!evs) {\r\n\t\tfull = true;\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\t\tevs = this.get_visible_events(!(this._table_view || this.config.multi_day));\r\n\t}\r\n\tfor(var i= 0, len = evs.length; i < len; i++){\r\n\t\tthis._recalculate_timed(evs[i]);\r\n\t}\r\n\r\n\tif (this.config.multi_day && !this._table_view) {\r\n\r\n\t\tvar tvs = [];\r\n\t\tvar tvd = [];\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tif (this._is_main_area_event(evs[i]))\r\n\t\t\t\ttvs.push(evs[i]);\r\n\t\t\telse\r\n\t\t\t\ttvd.push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(!this._els['dhx_multi_day']){\r\n\t\t\tvar message = scheduler._commonErrorMessages.unknownView(this._mode);\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\r\n\t\t// multiday events\r\n\t\tthis._rendered_location = this._els['dhx_multi_day'][0];\r\n\t\tthis._table_view = true;\r\n\t\tthis.render_data(tvd, hold);\r\n\t\tthis._table_view = false;\r\n\r\n\t\t// normal events\r\n\t\tthis._rendered_location = this._els['dhx_cal_data'][0];\r\n\t\tthis._table_view = false;\r\n\t\tthis.render_data(tvs, hold);\r\n\r\n\t} else {\r\n\t\tvar buffer = document.createDocumentFragment();\r\n\t\tvar renderedLocation = this._els['dhx_cal_data'][0];\r\n\t\tthis._rendered_location = buffer;\r\n\t\tthis.render_data(evs, hold);\r\n\t\trenderedLocation.appendChild(buffer);\r\n\t\tthis._rendered_location = renderedLocation;\r\n\r\n\t}\r\n\r\n\tif(full){\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._view_month_day = function(e){\r\n\tvar date = scheduler.getActionData(e).date;\r\n\tif(!scheduler.callEvent(\"onViewMoreClick\", [date]))\r\n\t\treturn;\r\n\tscheduler.setCurrentView(date, \"day\");\r\n};\r\n\r\nscheduler._render_month_link = function(ev){\r\n\tvar parent = this._rendered_location;\r\n\tvar toRender = this._lame_clone(ev);\r\n\r\n\t//render links in each cell of multiday events\r\n\tfor(var d = ev._sday; d < ev._eday; d++){\r\n\r\n\t\ttoRender._sday = d;\r\n\t\ttoRender._eday = d+1;\r\n\r\n\t\tvar date = scheduler.date;\r\n\t\tvar curr = scheduler._min_date;\r\n\t\tcurr = date.add(curr, toRender._sweek, \"week\");\r\n\t\tcurr = date.add(curr, toRender._sday, \"day\");\r\n\t\tvar count = scheduler.getEvents(curr, date.add(curr, 1, \"day\")).length;\r\n\r\n\t\tvar pos = this._get_event_bar_pos(toRender);\r\n\t\tvar widt = (pos.x2 - pos.x);\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tscheduler.event(el, \"click\", function(e){scheduler._view_month_day(e);});\r\n\t\tel.className = \"dhx_month_link\";\r\n\t\tel.style.top = pos.y + \"px\";\r\n\t\tel.style.left = pos.x + \"px\";\r\n\t\tel.style.width = widt + \"px\";\r\n\t\tel.innerHTML = scheduler.templates.month_events_link(curr, count);\r\n\t\tthis._rendered.push(el);\r\n\r\n\t\tparent.appendChild(el);\r\n\t}\r\n};\r\n\r\nscheduler._recalculate_timed = function(id){\r\n\tif(!id) return;\r\n\tvar ev;\r\n\tif(typeof(id) != \"object\")\r\n\t\tev = this._events[id];\r\n\telse\r\n\t\tev = id;\r\n\tif(!ev) return;\r\n\tev._timed = scheduler.isOneDayEvent(ev);\r\n};\r\nscheduler.attachEvent(\"onEventChanged\", scheduler._recalculate_timed);\r\nscheduler.attachEvent(\"onEventAdded\", scheduler._recalculate_timed);\r\n\r\nscheduler.render_data = function(evs, hold) {\r\n\tevs = this._pre_render_events(evs, hold);\r\n\tvar containers = {};\r\n\tfor (var i = 0; i < evs.length; i++)\r\n\t\tif (this._table_view){\r\n\t\t\tif(scheduler._mode != 'month'){\r\n\t\t\t\tthis.render_event_bar(evs[i]);//may be multiday section on other views\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar max_evs = scheduler.config.max_month_events;\r\n\t\t\t\tif(max_evs !== max_evs*1 || evs[i]._sorder < max_evs){\r\n\t\t\t\t\t//of max number events per month cell is set and event can be rendered\r\n\t\t\t\t\tthis.render_event_bar(evs[i]);\r\n\t\t\t\t}else if(max_evs !== undefined && evs[i]._sorder == max_evs){\r\n\t\t\t\t\t//render 'view more' links\r\n\t\t\t\t\tscheduler._render_month_link(evs[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//do not render events with ordinal number > maximum events per cell\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tvar parent = scheduler.locate_holder(ev._sday);\r\n\t\t\tif (!parent) continue; //attempt to render non-visible event\r\n\r\n\t\t\tif(!containers[ev._sday]){\r\n\t\t\t\tcontainers[ev._sday] = {\r\n\t\t\t\t\treal: parent,\r\n\t\t\t\t\tbuffer: document.createDocumentFragment(),\r\n\t\t\t\t\twidth: parent.clientWidth\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar container = containers[ev._sday];\r\n\t\t\tthis.render_event(ev, container.buffer, container.width);\r\n\t\t}\r\n\r\n\t\tfor(var i in containers){\r\n\t\t\tvar container = containers[i];\r\n\t\t\tif(container.real && container.buffer){\r\n\t\t\t\tcontainer.real.appendChild(container.buffer);\r\n\t\t\t}\r\n\t\t}\r\n};\r\n\r\nscheduler._get_first_visible_cell = function(cells) {\r\n\tfor (var i = 0; i < cells.length; i++) {\r\n\t\tif ((cells[i].className || \"\").indexOf(\"dhx_scale_ignore\") == -1) {\r\n\t\t\treturn cells[i];\r\n\t\t}\r\n\t}\r\n\t// if no visible cell found, return cells[0] to be more tolerant, since it's the original logic\r\n\treturn cells[0];\r\n};\r\n\r\nscheduler._pre_render_events = function(evs, hold) {\r\n\tvar hb = this.xy.bar_height;\r\n\tvar h_old = this._colsS.heights;\r\n\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\tif (!this._table_view) {\r\n\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t}\r\n\telse {\r\n\t\tevs = this._pre_render_events_table(evs, hold);\r\n\t}\r\n\tif (this._table_view) {\r\n\t\tif (hold)\r\n\t\t\tthis._colsS.heights = h_old;\r\n\t\telse {\r\n\t\t\tvar monthRows = data.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\tif (monthRows.length) {\r\n\t\t\t\tfor (var i = 0; i < monthRows.length; i++) {\r\n\t\t\t\t\th[i]++;\r\n\t\t\t\t\tvar cells = monthRows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\t\t\t\t\tvar cellHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\tif ((h[i]) * hb > cellHeight) { // 22 - height of cell's header\r\n\t\t\t\t\t\t//we have overflow, update heights\r\n\r\n\t\t\t\t\t\tvar cHeight = cellHeight;\r\n\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > cellHeight){\r\n\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmonthRows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\th[i] = (h[i - 1] || 0) + scheduler._get_first_visible_cell(cells).offsetHeight;\r\n\t\t\t\t}\r\n\t\t\t\th.unshift(0);\r\n\t\t\t\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tif (dataArea.offsetHeight < dataArea.scrollHeight && !scheduler._colsS.scroll_fix && scheduler.xy.scroll_width) {\r\n\r\n\t\t\t\t\tvar scale_settings = scheduler._colsS,\r\n\t\t\t\t\t\tsum_width = scale_settings[scale_settings.col_length],\r\n\t\t\t\t\t\trow_heights = scale_settings.heights.slice();\r\n\r\n\t\t\t\t\tsum_width -= (scheduler.xy.scroll_width || 0);\r\n\t\t\t\t\tthis._calc_scale_sizes(sum_width, this._min_date, this._max_date);\r\n\t\t\t\t\tscheduler._colsS.heights = row_heights;\r\n\r\n\t\t\t\t\tthis.set_xy(this._els[\"dhx_cal_header\"][0], sum_width/*, this.xy.scale_height*/);\r\n\t\t\t\t\tscheduler._render_scales(this._els[\"dhx_cal_header\"][0]);\r\n\t\t\t\t\tscheduler._render_month_scale(this._els[\"dhx_cal_data\"][0], this._get_timeunit_start(), this._min_date);\r\n\r\n\t\t\t\t\tscale_settings.scroll_fix = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\th[0] = -1;\r\n\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\r\n\t\t\t\t\t// +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\tvar full_multi_day_height = (h[0] + 1) * hb + 4;\r\n\r\n\t\t\t\t\tvar used_multi_day_height = full_multi_day_height;\r\n\t\t\t\t\tvar used_multi_day_height_css = full_multi_day_height + \"px\";\r\n\t\t\t\t\tif (this.config.multi_day_height_limit) {\r\n\t\t\t\t\t\tused_multi_day_height = Math.min(full_multi_day_height, this.config.multi_day_height_limit) ;\r\n\t\t\t\t\t\tused_multi_day_height_css = used_multi_day_height + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar multi_day_section = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\tmulti_day_section.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_section.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_section.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t// icon\r\n\t\t\t\t\tvar multi_day_icon = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\tmulti_day_icon.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_icon.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_icon.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\tmulti_day_icon.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\tif(this.config.multi_day_height_limit){\r\n\t\t\t\t\t\tthis._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift);\r\n\t\t\t\t\t}\r\n\t\t\t\t\th[0] = 0;\r\n\r\n\t\t\t\t\tif (used_multi_day_height != full_multi_day_height) {\r\n\r\n\t\t\t\t\t\tmulti_day_section.style.overflowY = \"auto\";\r\n\t\t\t\t\t//\tmulti_day_section.style.width = (parseInt(this._els[\"dhx_cal_navline\"][0].style.width)) + \"px\";\r\n\r\n\t\t\t\t\t\tmulti_day_icon.style.position = \"fixed\";\r\n\t\t\t\t\t\tmulti_day_icon.style.top = \"\";\r\n\t\t\t\t\t\tmulti_day_icon.style.left = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn evs;\r\n};\r\nscheduler._get_event_sday = function(ev) {\r\n\t// get day in current view\r\n\t// use rounding for 23 or 25 hour days on DST\r\n\tvar datePart = this.date.day_start(new Date(ev.start_date));\r\n\treturn Math.round((datePart.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));\r\n};\r\nscheduler._get_event_mapped_end_date = function(ev) {\r\n\tvar end_date = ev.end_date;\r\n\tif (this.config.separate_short_events) {\r\n\t\tvar ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes\r\n\t\tif (ev_duration < this._min_mapped_duration) {\r\n\t\t\tend_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, \"minute\");\r\n\t\t}\r\n\t}\r\n\treturn end_date;\r\n};\r\nscheduler._pre_render_events_line = function(evs, hold){\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n\tvar days = []; //events by weeks\r\n\tvar evs_originals = [];\r\n\r\n\tthis._min_mapped_duration = Math.floor(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\r\n\t\t//check date overflow\r\n\t\tvar sd = ev.start_date;\r\n\t\tvar ed = ev.end_date;\r\n\t\t//check scale overflow\r\n\t\tvar sh = sd.getHours();\r\n\t\tvar eh = ed.getHours();\r\n\t\tev._sday = this._get_event_sday(ev); // sday based on event start_date\r\n\t\tif (this._ignores[ev._sday]){\r\n\t\t\t//ignore event\r\n\t\t\tevs.splice(i,1);\r\n\t\t\ti--;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!days[ev._sday]) days[ev._sday] = [];\r\n\r\n\t\tif (!hold) {\r\n\t\t\tev._inner = false;\r\n\r\n\t\t\tvar stack = days[ev._sday];\r\n\r\n\t\t\twhile (stack.length) {\r\n\t\t\t\tvar t_ev = stack[stack.length - 1];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tstack.splice(stack.length - 1, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar slot_index = stack.length;\r\n\t\t\tvar sorderSet = false;\r\n\t\t\tfor (var j = 0; j < stack.length; j++) {\r\n\t\t\t\tvar t_ev = stack[j];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tsorderSet = true;\r\n\t\t\t\t\tev._sorder = t_ev._sorder;\r\n\t\t\t\t\tslot_index = j;\r\n\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (stack.length)\r\n\t\t\t\tstack[stack.length - 1]._inner = true;\r\n\r\n\t\t\tif (!sorderSet) {\r\n\t\t\t\tif (stack.length) {\r\n\t\t\t\t\tif (stack.length <= stack[stack.length - 1]._sorder) {\r\n\t\t\t\t\t\tif (!stack[stack.length - 1]._sorder)\r\n\t\t\t\t\t\t\tev._sorder = 0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tfor (j = 0; j < stack.length; j++) {\r\n\t\t\t\t\t\t\t\tvar _is_sorder = false;\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < stack.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (stack[k]._sorder == j) {\r\n\t\t\t\t\t\t\t\t\t\t_is_sorder = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!_is_sorder) {\r\n\t\t\t\t\t\t\t\t\tev._sorder = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar _max_sorder = stack[0]._sorder;\r\n\t\t\t\t\t\tfor (j = 1; j < stack.length; j++) {\r\n\t\t\t\t\t\t\tif (stack[j]._sorder > _max_sorder)\r\n\t\t\t\t\t\t\t\t_max_sorder = stack[j]._sorder;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._sorder = _max_sorder + 1;\r\n\t\t\t\t\t\tev._inner = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._sorder = 0;\r\n\t\t\t}\r\n\r\n\t\t\tstack.splice(slot_index, slot_index == stack.length ? 0 : 1, ev);\r\n\r\n\t\t\tif (stack.length > (stack.max_count || 0)) {\r\n\t\t\t\tstack.max_count = stack.length;\r\n\t\t\t\tev._count = stack.length;\r\n\t\t\t} else {\r\n\t\t\t\tev._count = (ev._count) ? ev._count : 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (sh < this.config.first_hour || eh >= this.config.last_hour) {\r\n\t\t\t// Need to create copy of event as we will be changing it's start/end date\r\n\t\t\t// e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info\r\n\t\t\tevs_originals.push(ev);\r\n\t\t\tevs[i] = ev = this._copy_event(ev);\r\n\r\n\t\t\tif (sh < this.config.first_hour) {\r\n\t\t\t\tev.start_date.setHours(this.config.first_hour);\r\n\t\t\t\tev.start_date.setMinutes(0);\r\n\t\t\t}\r\n\t\t\tif (eh >= this.config.last_hour) {\r\n\t\t\t\tev.end_date.setMinutes(0);\r\n\t\t\t\tev.end_date.setHours(this.config.last_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif (ev.start_date > ev.end_date || sh == this.config.last_hour) {\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!hold) {\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tevs[i]._count = days[evs[i]._sday].max_count;\r\n\t\t}\r\n\t\tfor (var i = 0; i < evs_originals.length; i++)\r\n\t\t\tevs_originals[i]._count = days[evs_originals[i]._sday].max_count;\r\n\t}\r\n\r\n\treturn evs;\r\n};\r\nscheduler._time_order = function(evs) {\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf()) {\r\n\t\t\tif (a._timed && !b._timed) return 1;\r\n\t\t\tif (!a._timed && b._timed) return -1;\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t}\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n};\r\n\r\nscheduler._is_any_multiday_cell_visible = function(from, to, event){\r\n\tvar cols = this._cols.length;\r\n\tvar isAnyCellVisible = false;\r\n\tvar checkDate = from;\r\n\tvar noCells = true;\r\n\tvar lastDayEnd = new Date(to);\r\n\tif(scheduler.date.day_start(new Date(to)).valueOf() != to.valueOf()){\r\n\t\tlastDayEnd = scheduler.date.day_start(lastDayEnd);\r\n\t\tlastDayEnd = scheduler.date.add(lastDayEnd, 1, \"day\");\r\n\t}\r\n\twhile(checkDate < lastDayEnd){\r\n\t\tnoCells = false;\r\n\t\tvar cellIndex = this.locate_holder_day(checkDate, false, event);\r\n\t\tvar weekCellIndex = cellIndex % cols;\r\n\t\tif(!this._ignores[weekCellIndex]){\r\n\t\t\tisAnyCellVisible = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcheckDate = scheduler.date.add(checkDate, 1, \"day\");\r\n\t}\r\n\treturn noCells || isAnyCellVisible;\r\n};\r\n\r\nscheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot\r\n\tthis._time_order(evs);\r\n\tvar out = [];\r\n\tvar weeks = [\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[]\r\n\t]; //events by weeks\r\n\tvar max = this._colsS.heights;\r\n\tvar start_date;\r\n\tvar cols = this._cols.length;\r\n\tvar chunks_info = {};\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\t\tvar id = ev.id;\r\n\t\tif (!chunks_info[id]) {\r\n\t\t\tchunks_info[id] = {\r\n\t\t\t\tfirst_chunk: true,\r\n\t\t\t\tlast_chunk: true\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar chunk_info = chunks_info[id];\r\n\t\tvar sd = (start_date || ev.start_date);\r\n\t\tvar ed = ev.end_date;\r\n\t\t//trim events which are crossing through current view\r\n\t\tif (sd < this._min_date) {\r\n\t\t\tchunk_info.first_chunk = false;\r\n\t\t\tsd = this._min_date;\r\n\t\t}\r\n\t\tif (ed > this._max_date) {\r\n\t\t\tchunk_info.last_chunk = false;\r\n\t\t\ted = this._max_date;\r\n\t\t}\r\n\r\n\t\tvar locate_s = this.locate_holder_day(sd, false, ev);\r\n\t\tev._sday = locate_s % cols;\r\n\t\t//skip single day events for ignored dates\r\n\t\tif (this._ignores[ev._sday] && ev._timed) continue;\r\n\r\n\t\tvar locate_e = this.locate_holder_day(ed, true, ev) || cols;\r\n\t\tev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday\r\n\t\tev._length = locate_e - locate_s;\r\n\t\t//3600000 - compensate 1 hour during winter|summer time shift\r\n\t\tev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));\r\n\r\n\t\tvar isAnyCellVisible = scheduler._is_any_multiday_cell_visible(sd, ed, ev);\r\n\r\n\t\tif(!isAnyCellVisible){\r\n\t\t\tstart_date = null;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t//current slot\r\n\t\tvar stack = weeks[ev._sweek];\r\n\t\t//check order position\r\n\t\tvar stack_line;\r\n\r\n\t\tfor (stack_line = 0; stack_line < stack.length; stack_line++)\r\n\t\t\tif (stack[stack_line]._eday <= ev._sday)\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (!ev._sorder || !hold) {\r\n\t\t\tev._sorder = stack_line;\r\n\t\t}\r\n\r\n\t\tif (ev._sday + ev._length <= cols) {\r\n\t\t\tstart_date = null;\r\n\t\t\tout.push(ev);\r\n\t\t\tstack[stack_line] = ev;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\tev._first_chunk = chunk_info.first_chunk;\r\n\t\t\tev._last_chunk = chunk_info.last_chunk;\r\n\t\t} else { // split long event in chunks\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\tcopy.id = ev.id;\r\n\t\t\tcopy._length = cols - ev._sday;\r\n\t\t\tcopy._eday = cols;\r\n\t\t\tcopy._sday = ev._sday;\r\n\t\t\tcopy._sweek = ev._sweek;\r\n\t\t\tcopy._sorder = ev._sorder;\r\n\t\t\tcopy.end_date = this.date.add(sd, copy._length, \"day\");\r\n\t\t\tcopy._first_chunk = chunk_info.first_chunk;\r\n\t\t\tif (chunk_info.first_chunk) {\r\n\t\t\t\tchunk_info.first_chunk = false;\r\n\t\t\t}\r\n\r\n\t\t\tout.push(copy);\r\n\t\t\tstack[stack_line] = copy;\r\n\t\t\tstart_date = copy.end_date;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\ti--;\r\n\t\t\tcontinue; //repeat same step\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n};\r\nscheduler._copy_dummy = function() {\r\n\tvar a = new Date(this.start_date);\r\n\tvar b = new Date(this.end_date);\r\n\tthis.start_date = a;\r\n\tthis.end_date = b;\r\n};\r\nscheduler._copy_event = function(ev) {\r\n\tthis._copy_dummy.prototype = ev;\r\n\treturn new this._copy_dummy();\r\n\t//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}\r\n};\r\nscheduler._rendered = [];\r\nscheduler.clear_view = function() {\r\n\tfor (var i = 0; i < this._rendered.length; i++) {\r\n\t\tvar obj = this._rendered[i];\r\n\t\tif (obj.parentNode) obj.parentNode.removeChild(obj);\r\n\t}\r\n\tthis._rendered = [];\r\n};\r\nscheduler.updateEvent = function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tthis.clear_event(id);\r\n\r\n\tif (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {\r\n\t\tif (this.config.update_render){\r\n\t\t\tthis.render_view_data();\r\n\t\t}else{\r\n\t\t\tif(this.getState().mode == \"month\" && !this.getState().drag_id && !this.isOneDayEvent(ev)){\r\n\t\t\t\tthis.render_view_data();\r\n\t\t\t}else{\r\n\t\t\t\tthis.render_view_data([ev], true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.clear_event = function(id) {\r\n\tthis.for_rendered(id, function(node, i) {\r\n\t\tif (node.parentNode)\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\tscheduler._rendered.splice(i, 1);\r\n\t});\r\n};\r\nscheduler._y_from_date = function(date){\r\n\tvar sm = date.getHours() * 60 + date.getMinutes();\r\n\treturn ((Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24)); //42px/hour\r\n};\r\nscheduler._calc_event_y = function(ev, min_height){\r\n\tmin_height = min_height || 0;\r\n\tvar sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();\r\n\tvar em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);\r\n\tvar top = this._y_from_date(ev.start_date);\r\n\r\n\tvar height = Math.max(min_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: height\r\n\t};\r\n};\r\nscheduler.render_event = function(ev, buffer, parentWidth) {\r\n\tvar menu = scheduler.xy.menu_width;\r\n\tvar menu_offset = (this.config.use_select_menu_space) ? 0 : menu;\r\n\tif (ev._sday < 0) return; //can occur in case of recurring event during time shift\r\n\r\n\tvar parent = scheduler.locate_holder(ev._sday);\r\n\tif (!parent) return; //attempt to render non-visible event\r\n\r\n\tbuffer = buffer || parent;\r\n\r\n\tvar pos_y = this._calc_event_y(ev, scheduler.xy.min_event_height);\r\n\tvar top = pos_y.top,\r\n\t\theight = pos_y.height;\r\n\r\n\tvar ev_count = ev._count || 1;\r\n\tvar ev_sorder = ev._sorder || 0;\r\n\r\n\tparentWidth = parentWidth || parent.clientWidth;\r\n\tif(this.config.day_column_padding){\r\n\t\tparentWidth -= this.config.day_column_padding;\r\n\t}\r\n\r\n\tvar width = Math.floor((parentWidth - menu_offset) / ev_count);\r\n\tvar left = ev_sorder * width + 1;\r\n\tif (!ev._inner) width = width * (ev_count - ev_sorder);\r\n\tif (this.config.cascade_event_display) {\r\n\t\tvar limit = this.config.cascade_event_count;\r\n\t\tvar margin = this.config.cascade_event_margin;\r\n\t\tleft = ev_sorder % limit * margin;\r\n\t\tvar right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;\r\n\t\twidth = Math.floor(parentWidth - menu_offset - left - right);\r\n\t}\r\n\r\n\tif(height < 30){\r\n\t\tev._mode = \"smallest\";\r\n\t}else if(height < 42){\r\n\t\tev._mode = \"small\";\r\n\t}else{\r\n\t\tev._mode = null;\r\n\t}\r\n\r\n\tvar d = this._render_v_bar(ev, menu_offset + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));\r\n\t\r\n\tif(ev._mode === \"smallest\"){\r\n\t\td.classList.add(\"dhx_cal_event--xsmall\");\r\n\t}else if (ev._mode === \"small\"){\r\n\t\td.classList.add(\"dhx_cal_event--small\");\r\n\t}\r\n\r\n\tthis._waiAria.eventAttr(ev, d);\r\n\tthis._rendered.push(d);\r\n\tbuffer.appendChild(d);\r\n\r\n\tvar parentPosition = parseInt( this.config.rtl ? parent.style.right : parent.style.left, 10);\r\n\r\n\tleft = left + parentPosition + menu_offset;\r\n\r\n\tif (this._edit_id == ev.id) {\r\n\r\n\t\td.style.zIndex = 1; //fix overlapping issue\r\n\t\twidth = Math.max(width, scheduler.xy.editor_width);\r\n\t\td = document.createElement(\"div\");\r\n\t\td.setAttribute(\"event_id\", ev.id); // for backward compatibility\r\n\t\td.setAttribute(this.config.event_attribute, ev.id);\r\n\r\n\t\tthis._waiAria.eventAttr(ev, d);\r\n\r\n\t\td.className = \"dhx_cal_event dhx_cal_editor\";\r\n\t\tif (this.config.rtl) left++;\r\n\t\tthis.set_xy(d, width, height, left, top);\r\n\r\n\r\n\t\tif(ev.color){\r\n\t\t\td.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tvar tplClass = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\r\n\t\tif(tplClass){\r\n\t\t\td.className += \" \" + tplClass;\r\n\t\t}\r\n\t\tvar d2 = document.createElement(\"div\");\r\n\t\td2.style.cssText += \"overflow:hidden;height:100%\";\r\n\r\n\t\td.appendChild(d2);\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\tthis._rendered.push(d);\r\n\r\n\t\td2.innerHTML = \"\";\r\n\t\tthis._editor = d2.querySelector(\"textarea\");\r\n\t\t\r\n\t\tscheduler.event(this._editor, \"keydown\", function(e) {\r\n\t\t\tif (e.shiftKey) return true;\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tif (code == scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\tif (code == scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\r\n\t\t\tif(code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel){\r\n\t\t\t\tif(e.preventDefault) e.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.event(this._editor, \"selectstart\", function (e) {\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tscheduler._focus(this._editor, true);\r\n\t\t//IE and opera can add x-scroll during focusing\r\n\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft = 0;\r\n\t}\r\n\tif (this.xy.menu_width !== 0 && this._select_id == ev.id) {\r\n\r\n\t\tif (this.config.cascade_event_display && this._drag_mode)\r\n\t\t\td.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event\r\n\t\tvar icons = this.config[\"icons_\" + ((this._edit_id == ev.id) ? \"edit\" : \"select\")];\r\n\t\tvar icons_str = \"\";\r\n\r\n\t\tvar ariaAttr;\r\n\r\n\t\tfor (var i = 0; i < icons.length; i++) {\r\n\t\t\tconst currentIcon = icons[i];\r\n\t\t\tariaAttr = this._waiAria.eventMenuAttrString(currentIcon);\r\n\t\t\ticons_str += ``;\r\n\t\t}\r\n\t\tvar obj = this._render_v_bar(ev, left - menu - 1, top, menu, null, \"\", \"\", icons_str, true);\r\n\r\n\t\tif(ev.color){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\t//obj.style.left = left - menu + 1;\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\tthis._rendered.push(obj);\r\n\t}\r\n\tif(this.config.drag_highlight && this._drag_id == ev.id){\r\n\t\tthis.highlightEventPosition(ev);\r\n\t}\r\n};\r\nscheduler._render_v_bar = function (ev, x, y, w, h, style, contentA, contentB, bottom) {\r\n\tvar d = document.createElement(\"div\");\r\n\tvar id = ev.id;\r\n\tvar cs = (bottom) ? \"dhx_cal_event dhx_cal_select_menu\" : \"dhx_cal_event\";\r\n\r\n\tvar state = scheduler.getState();\r\n\tif(state.drag_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_drag\";\r\n\t}\r\n\r\n\tif(state.select_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_selected\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse) cs = cs + \" \" + cse;\r\n\r\n\tif(this.config.cascade_event_display) {\r\n\t\tcs += \" dhx_cal_event_cascade\";\r\n\t}\r\n\r\n\tvar boxWidth = w - 1;\r\n\tvar html = `\r\n\t\t\t\t
`;\r\n\r\n\td.innerHTML = html;\r\n\r\n\tvar container = d.cloneNode(true).firstChild;\r\n\r\n\tif (!bottom && scheduler.renderEvent(container, ev, w, h, contentA, contentB)) {\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\treturn container;\r\n\t} else {\r\n\t\tcontainer = d.firstChild;\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\tvar inner_html = '
';\r\n\t\tinner_html += '' + contentA + '
';\r\n\t\tinner_html += '' + contentB + '
'; // +2 css specific, moved from render_event\r\n\r\n\t\tvar footer_class = \"dhx_event_resize dhx_footer\";\r\n\t\tif (bottom || ev._drag_resize === false)\r\n\t\t\tfooter_class = \"dhx_resize_denied \" + footer_class;\r\n\r\n\t\tinner_html += '
';\r\n\r\n\t\tcontainer.innerHTML = inner_html;\r\n\t}\r\n\r\n\treturn container;\r\n};\r\nscheduler.renderEvent = function(){\r\n\treturn false;\r\n};\r\nscheduler.locate_holder = function(day) {\r\n\tif (this._mode == \"day\") return this._els[\"dhx_cal_data\"][0].firstChild; //dirty\r\n\treturn this._els[\"dhx_cal_data\"][0].childNodes[day];\r\n};\r\nscheduler.locate_holder_day = function(date, past) {\r\n\tvar day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));\r\n\t//when locating end data of event , we need to use next day if time part was defined\r\n\tif (past && this.date.time_part(date)) day++;\r\n\treturn day;\r\n};\r\n\r\n\r\n\r\nscheduler._get_dnd_order = function(order, ev_height, max_height){\r\n\tif(!this._drag_event)\r\n\t\treturn order;\r\n\tif(!this._drag_event._orig_sorder)\r\n\t\tthis._drag_event._orig_sorder = order;\r\n\telse\r\n\t\torder = this._drag_event._orig_sorder;\r\n\r\n\tvar evTop = ev_height * order;\r\n\twhile((evTop + ev_height) > max_height){\r\n\t\torder--;\r\n\t\tevTop -= ev_height;\r\n\t}\r\n\torder = Math.max(order, 0);\r\n\treturn order;\r\n};\r\n//scheduler._get_event_bar_pos = function(sday, eday, week, drag){\r\nscheduler._get_event_bar_pos = function(ev){\r\n\tvar rtl = this.config.rtl;\r\n\tvar columns = this._colsS;\r\n\tvar x = columns[ev._sday];\r\n\tvar x2 = columns[ev._eday];\r\n\tif (rtl) {\r\n\t\tx = columns[columns.col_length] - columns[ev._eday] + columns[0];\r\n\t\tx2 = columns[columns.col_length] - columns[ev._sday] + columns[0];\r\n\t}\r\n\r\n\tif (x2 == x) x2 = columns[ev._eday + 1];\r\n\tvar hb = this.xy.bar_height;\r\n\r\n\tvar order = ev._sorder;\r\n\tif(ev.id == this._drag_id){\r\n\t\tvar cellHeight = columns.heights[ev._sweek + 1] - columns.heights[ev._sweek]- this.xy.month_head_height;//22 for month head height\r\n\t\torder = scheduler._get_dnd_order(order, hb, cellHeight);\r\n\t}\r\n\tvar y_event_offset = order * hb;\r\n\tvar y = columns.heights[ev._sweek] + (columns.height ? (this.xy.month_scale_height + 2) : 2 ) + y_event_offset;\r\n\treturn {x:x, x2:x2, y:y};\r\n};\r\n\r\nscheduler.render_event_bar = function (ev) {\r\n\tvar parent = this._rendered_location;\r\n\tvar pos = this._get_event_bar_pos(ev);\r\n\tvar y = pos.y;\r\n\tvar x = pos.x;\r\n\tvar x2 = pos.x2;\r\n\t// resize for month mutliday events\r\n\tvar resize_handle = \"\";\r\n\r\n\t//events in ignored dates\r\n\r\n\tif (!x2) return;\r\n\r\n\tvar resizable = scheduler.config.resize_month_events && this._mode == \"month\" &&\r\n\t\t(!ev._timed || scheduler.config.resize_month_timed);\r\n\r\n\tvar d = document.createElement(\"div\");\r\n\tvar left_chunk = (ev.hasOwnProperty(\"_first_chunk\") && ev._first_chunk),\r\n\t\tright_chunk = (ev.hasOwnProperty(\"_last_chunk\") && ev._last_chunk);\r\n\r\n\tvar resize_left = resizable && (ev._timed || left_chunk);\r\n\tvar resize_right = resizable && (ev._timed || right_chunk);\r\n\r\n\tvar timed = true;\r\n\tvar cs = \"dhx_cal_event_clear\";\r\n\tif (!ev._timed || resizable) {\r\n\t\ttimed = false;\r\n\t\tcs = \"dhx_cal_event_line\";\r\n\t}\r\n\tif(left_chunk){\r\n\t\tcs += \" dhx_cal_event_line_start\";\r\n\t}\r\n\tif(right_chunk){\r\n\t\tcs += \" dhx_cal_event_line_end\";\r\n\t}\r\n\tif(resize_left){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\tif(resize_right){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse){\r\n\t\tcs += \" \" + cse;\r\n\t}\r\n\r\n\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\tvar style_text = [\r\n\t\t\"position:absolute\",\r\n\t\t\"top:\" + y + \"px\",\r\n\t\t\"left:\" + x + \"px\",\r\n\t\t\"width:\" + (x2 - x - (timed ? 1 : 0)) + \"px\",\r\n\t\t\"height:\" + (this.xy.bar_height - 2) + \"px\",\r\n\t\tcolor,\r\n\t\tbg_color,\r\n\t\t(ev._text_style || \"\")\r\n\t].join(\";\");\r\n\r\n\tvar html = \"\";\r\n\tif (resizable) {\r\n\t\thtml += resize_handle;\r\n\t}\r\n\tif(scheduler.getState().mode == \"month\"){\r\n\t\tev = scheduler.getEvent(ev.id); // ev at this point could be a part (row in a month view) of a larger event\r\n\t}\r\n\r\n\tif (ev._timed){\r\n\t\thtml += `
${scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev)} `;\r\n\t}\r\n\r\n\thtml += \"
\";\r\n\thtml += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '
';\r\n\thtml += \"
\";\r\n\thtml += ' ';\r\n\r\n\td.innerHTML = html;\r\n\r\n\tthis._rendered.push(d.firstChild);\r\n\tparent.appendChild(d.firstChild);\r\n};\r\n\r\nscheduler._locate_event = function(node) {\r\n\tvar id = null;\r\n\twhile (node && !id && node.getAttribute) {\r\n\t\tid = node.getAttribute(this.config.event_attribute);\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn id;\r\n};\r\n\r\nscheduler.edit = function(id) {\r\n\tif (this._edit_id == id) return;\r\n\tthis.editStop(false, id);\r\n\tthis._edit_id = id;\r\n\tthis.updateEvent(id);\r\n};\r\nscheduler.editStop = function(mode, id) {\r\n\tif (id && this._edit_id == id) return;\r\n\tvar ev = this.getEvent(this._edit_id);\r\n\tif (ev) {\r\n\t\tif (mode) ev.text = this._editor.value;\r\n\t\tthis._edit_id = null;\r\n\t\tthis._editor = null;\r\n\t\tthis.updateEvent(ev.id);\r\n\t\tthis._edit_stop_event(ev, mode);\r\n\t}\r\n};\r\nscheduler._edit_stop_event = function(ev, mode) {\r\n\tif (this._new_event) {\r\n\t\tif (!mode) {\r\n\t\t\tif (ev) // in case of custom lightbox user can already delete event\r\n\t\t\t\tthis.deleteEvent(ev.id, true);\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onEventAdded\", [ev.id, ev]);\r\n\t\t}\r\n\t\tthis._new_event = null;\r\n\t} else {\r\n\t\tif (mode){\r\n\t\t\tthis.callEvent(\"onEventChanged\", [ev.id, ev]);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))\r\n\t\t\tresult.push(ev);\r\n\t}\r\n\treturn result;\r\n};\r\nscheduler.getRenderedEvent = function(id) {\r\n\tif (!id)\r\n\t\treturn;\r\n\tvar rendered_events = scheduler._rendered;\r\n\tfor (var i=0; i
-1){\r\n\t\t\t\t\tsection = section.split(scheduler.config.section_delimiter)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar top = timeline.getSectionTop(section);\r\n\t\t\tvar left = timeline.posFromDate(event.start_date);\r\n\t\t\tvar container = scheduler.$container.querySelector(\".dhx_timeline_data_wrapper\");\r\n\t\t\tleft = left - (container.offsetWidth - timeline.dx) / 2;\r\n\t\t\ttop = top - container.offsetHeight / 2 + timeline.dy/2;\r\n\r\n\t\t\tif (timeline._smartRenderingEnabled()) {\r\n\t\t\t\tvar handlerId = timeline.attachEvent(\"onScroll\", function(){\r\n\t\t\t\t\trestoreOriginalColors();\r\n\t\t\t\t\ttimeline.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttimeline.scrollTo({\r\n\t\t\t\tleft: left,\r\n\t\t\t\ttop: top\r\n\t\t\t});\r\n\t\t\tif (!timeline._smartRenderingEnabled()) {\r\n\t\t\t\trestoreOriginalColors();\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trestoreOriginalColors();\r\n\t}\r\n\r\n\tscheduler.callEvent(\"onAfterEventDisplay\", [ev, mode]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._append_drag_marker = function(m){\r\n\tif(m.parentNode) return;\r\n\tvar zone = scheduler._els[\"dhx_cal_data\"][0];\r\n\r\n\tvar scale = zone.lastChild;\r\n\tvar className = scheduler._getClassName(scale);\r\n\tif(className.indexOf(\"dhx_scale_holder\") < 0 && scale.previousSibling){\r\n\t\tscale = scale.previousSibling;\r\n\t}\r\n\r\n\tclassName = scheduler._getClassName(scale);\r\n\tif (scale && className.indexOf(\"dhx_scale_holder\") === 0) {\r\n\t\tscale.appendChild(m);\r\n\t}\r\n};\r\n\r\nscheduler._update_marker_position = function(m, event){\r\n\tvar size = scheduler._calc_event_y(event, 0);\r\n\tm.style.top = size.top + \"px\";\r\n\tm.style.height = size.height + \"px\";\r\n};\r\n\r\nscheduler.highlightEventPosition = function(event){\r\n\tvar m = document.createElement(\"div\");\r\n\r\n\tm.setAttribute(\"event_id\", event.id); // for backward compatibility\r\n\tm.setAttribute(this.config.event_attribute, event.id);\r\n\tthis._rendered.push(m);\r\n\tthis._update_marker_position(m, event);\r\n\r\n\tvar css = this.templates.drag_marker_class(event.start_date, event.end_date, event);\r\n\tvar html = this.templates.drag_marker_content(event.start_date, event.end_date, event);\r\n\tm.className = \"dhx_drag_marker\";\r\n\tif(css)\r\n\t\tm.className += \" \" + css;\r\n\tif(html)\r\n\t\tm.innerHTML = html;\r\n\tthis._append_drag_marker(m);\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._lightbox_controls = {};\r\nscheduler.formSection = function(name){\r\n\tvar config = this.config.lightbox.sections;\r\n\tvar i = 0;\r\n\tfor (i; i < config.length; i++) {\r\n\t\tif (config[i].name == name) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (i === config.length) {\r\n\t\t// GS-1662 section not found, should exit here instead of throwing an error\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar section = config[i];\r\n\tif (!scheduler._lightbox) {\r\n\t\tscheduler.getLightbox();\r\n\t}\r\n\tvar header = scheduler._lightbox.querySelector(`#${section.id}`);\r\n\tvar node = header.nextSibling;\r\n\r\n\tvar result = {\r\n\t\tsection: section,\r\n\t\theader: header,\r\n\t\tnode: node,\r\n\t\tgetValue:function(ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);\r\n\t\t},\r\n\t\tsetValue:function(value, ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);\r\n\t\t}\r\n\t};\r\n\r\n\tvar handler = scheduler._lightbox_controls[\"get_\"+section.type+\"_control\"];\r\n\treturn handler?handler(result):result;\r\n};\r\nscheduler._lightbox_controls.get_template_control = function(result) {\r\n\tresult.control = result.node;\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_select_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_textarea_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('textarea')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_time_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select'); // array\r\n\treturn result;\r\n};\r\n\r\nscheduler._lightbox_controls.defaults = {\r\n\ttemplate: {\r\n\t\theight:30\r\n\t},\r\n\ttextarea: {\r\n\t\theight: 200\r\n\t},\r\n\tselect: {\r\n\t\theight: 23\r\n\t},\r\n\ttime: {\r\n\t\theight: 20\r\n\t}\r\n};\r\n\r\n\r\nscheduler.form_blocks={\r\n\ttemplate:{\r\n\t\trender: function(sns){\r\n\t\t\treturn \"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tnode.innerHTML = value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev,config){\r\n\t\t\treturn node.innerHTML||\"\";\r\n\t\t},\r\n\t\tfocus: function(node){\r\n\t\t}\r\n\t},\r\n\ttextarea:{\r\n\t\trender:function(sns){\r\n\t\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\t\treturn `
`;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev){\r\n\t\t\tscheduler.form_blocks.textarea._get_input(node).value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn scheduler.form_blocks.textarea._get_input(node).value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a = scheduler.form_blocks.textarea._get_input(node);\r\n\t\t\tscheduler._focus(a, true);\r\n\t\t},\r\n\t\t_get_input: function(node){\r\n\t\t\treturn node.getElementsByTagName(\"textarea\")[0];\r\n\t\t}\r\n\t},\r\n\tselect:{\r\n\t\trender:function(sns){\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\t\t\tvar html=\"\";\r\n\t\t\tfor (var i=0; i < sns.options.length; i++)\r\n\t\t\t\thtml+=\"\"+sns.options[i].label+\" \";\r\n\t\t\thtml+=\"
\";\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,sns){\r\n\t\t\tvar select = node.firstChild;\r\n\t\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\t\tscheduler.event(select, \"change\", sns.onchange);\r\n\t\t\t\tselect._dhx_onchange = true;\r\n\t\t\t}\r\n\t\t\tif (typeof value == \"undefined\")\r\n\t\t\t\tvalue = (select.options[0]||{}).value;\r\n\t\t\tselect.value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn node.firstChild.value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a=node.firstChild; scheduler._focus(a, true);\r\n\t\t}\r\n\t},\r\n\ttime:{\r\n\t\trender:function(sns) {\r\n\t\t\tif (!sns.time_format) {\r\n\t\t\t\t// default order\r\n\t\t\t\tsns.time_format = [\"%H:%i\", \"%d\", \"%m\", \"%Y\"];\r\n\t\t\t}\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = {};\r\n\t\t\tvar time_format = sns.time_format;\r\n\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar dt = scheduler.date.date_part(scheduler._currentDate());\r\n\t\t\tvar last = 24*60, first = 0;\r\n\t\t\tif(scheduler.config.limit_time_select){\r\n\t\t\t\tlast = 60*cfg.last_hour+1;\r\n\t\t\t\tfirst = 60*cfg.first_hour;\r\n\t\t\t\tdt.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\t\t\tvar html = \"\";\r\n\r\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\r\n\t\t\t\tvar time_option = time_format[p];\r\n\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (p > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tvar selectBoxClass = \"\";\r\n\t\t\t\tvar options = \"\";\r\n\t\t\t\tswitch (time_option) {\r\n\t\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_year_select\";\r\n\t\t\t\t\t\tsns._time_format_order[3] = p;\r\n\t\t\t\t\t\t//year\r\n\t\t\t\t\t\tvar range;\r\n\t\t\t\t\t\tvar start_year;\r\n\t\t\t\t\t\tvar end_year;\r\n\t\t\t\t\t\tif(sns.year_range){\r\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t\t\t// if\r\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trange = range || 10;\r\n\t\t\t\t\t\tvar offset = offset || Math.floor(range / 2);\r\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\r\n\t\t\t\t\t\tend_year = end_year || start_year + range;\r\n\r\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\r\n\t\t\t\t\t\t\toptions += \"\" + (i) + \" \";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%m\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_month_select\";\r\n\t\t\t\t\t\tsns._time_format_order[2] = p;\r\n\t\t\t\t\t\t//month\r\n\t\t\t\t\t\tfor (var i=0; i < 12; i++)\r\n\t\t\t\t\t\t\toptions+=\"\"+this.locale.date.month_full[i]+\" \";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%d\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_day_select\";\r\n\t\t\t\t\t\tsns._time_format_order[1] = p;\r\n\t\t\t\t\t\t//days\r\n\t\t\t\t\t\tfor (var i=1; i < 32; i++)\r\n\t\t\t\t\t\t\toptions+=\"\"+i+\" \";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_time_select\";\r\n\t\t\t\t\t\tsns._time_format_order[0] = p;\r\n\t\t\t\t\t\t//hours\r\n\t\t\t\t\t\tvar i = first;\r\n\t\t\t\t\t\tvar tdate = dt.getDate();\r\n\t\t\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\t\t\twhile(i\"+time+\"\";\r\n\t\t\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf()+this.config.time_step*60*1000);\r\n\t\t\t\t\t\t\tvar diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day\r\n\t\t\t\t\t\t\ti=diff*24*60+dt.getHours()*60+dt.getMinutes();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(options){\r\n\r\n\t\t\t\t\tvar ariaAttrs = scheduler._waiAria.lightboxSelectAttrString(time_option);\r\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\thtml += \"\"+options+\" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\r\n\t\t\treturn \"\"+html+\" – \"+html+\"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar s=node.getElementsByTagName(\"select\");\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar start_date, end_date;\r\n\r\n\t\t\tif(cfg.full_day) {\r\n\t\t\t\tif (!node._full_day){\r\n\t\t\t\t\tvar html = \" \"+scheduler.locale.labels.full_day+\" \";\r\n\t\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\t\thtml = node.previousSibling.innerHTML+html;\r\n\t\t\t\t\tnode.previousSibling.innerHTML=html;\r\n\t\t\t\t\tnode._full_day=true;\r\n\t\t\t\t}\r\n\t\t\t\tvar input=node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\t\t\t\tinput.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);\r\n\r\n\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\tif(!input.$_eventAttached){\r\n\t\t\t\t\tinput.$_eventAttached = true;\r\n\r\n\t\t\t\t\t\tscheduler.event(input, \"click\", function(){\r\n\t\t\t\t\t\tif(input.checked) {\r\n\t\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\t\tscheduler.form_blocks.time.get_value(node,obj,config);\r\n\r\n\t\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\t\t\t_fill_lightbox_select(s,0,start_date||ev.start_date);\r\n\t\t\t\t\t\t_fill_lightbox_select(s,4,end_date||ev.end_date);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(cfg.auto_end_date && cfg.event_duration) {\r\n\t\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!(cfg.auto_end_date && cfg.event_duration)){\r\n\t\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_date = new Date(s[map[3]].value,s[map[2]].value,s[map[1]].value,0,s[map[0]].value);\r\n\t\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\t\t\t\t\t_fill_lightbox_select(s, 4, end_date);\r\n\t\t\t\t};\r\n\t\t\t\tfor(var i=0; i<4; i++) {\r\n\t\t\t\t\tif(!s[i].$_eventAttached) {\r\n\t\t\t\t\t\ts[i].$_eventAttached = true;\r\n\t\t\t\t\t\tscheduler.event(s[i], \"change\", _update_lightbox_select);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction _fill_lightbox_select(s,i,d) {\r\n\t\t\t\tvar time_values = config._time_values;\r\n\t\t\t\tvar direct_value = d.getHours()*60+d.getMinutes();\r\n\t\t\t\tvar fixed_value = direct_value;\r\n\t\t\t\tvar value_found = false;\r\n\t\t\t\tfor (var k=0; k\";\r\n\t\tvar ariaAttr = \"\";\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\t\t\thtml += \"\";\r\n\t\t}\r\n\r\n\t\tbuttons = this.config.buttons_right;\r\n\t\tvar rtl = scheduler.config.rtl;\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\thtml += \"\";\r\n\t\t}\r\n\t\thtml += \" \";\r\n\t\thtml+=\"
\";\r\n\t\td.innerHTML=html;\r\n\t\tif (scheduler.config.drag_lightbox){\r\n\t\t\tscheduler.event(d.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\tscheduler.event(d.firstChild, \"selectstart\", function(e){ \r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn false; \r\n\t\t\t});\r\n\t\t\td.firstChild.style.cursor = \"move\";\r\n\t\t\tscheduler._init_dnd_events();\r\n\r\n\t\t}\r\n\r\n\t\tthis._waiAria.lightboxAttr(d);\r\n\r\n\t\tthis.show_cover();\r\n\t\tthis._cover.insertBefore(d,this._cover.firstChild);\r\n\t\t\r\n\t\tthis._lightbox=d;\r\n\r\n\t\tvar sns=this.config.lightbox.sections;\r\n\t\thtml=\"\";\r\n\t\tfor (var i=0; i < sns.length; i++) {\r\n\t\t\tvar block=this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id=\"area_\"+this.uid();\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button){\r\n\t\t\t\tvar ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels[\"button_\"+sns[i].button]);\r\n\t\t\t\tbutton = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this.config.wide_form){\r\n\t\t\t\thtml+=\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tvar label_name = this.locale.labels[\"section_\"+sns[i].name];\r\n\t\t\tif(typeof label_name !== \"string\"){\r\n\t\t\t\tlabel_name = sns[i].name;\r\n\t\t\t}\r\n\t\t\thtml+=\"
\"+button+ \"\"+label_name+\"
\"+block.render.call(this,sns[i]);\r\n\t\t\thtml+=\"
\";\r\n\t\t}\r\n\r\n\t\tvar ds=d.getElementsByTagName(\"div\");\r\n\t\tfor (var i=0; i
\r\n
\r\n
`;\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.getRootView = function() {\r\n\treturn {\r\n\t\tview: {\r\n\t\t\trender: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttag: \"div\",\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tattrs: {\r\n\t\t\t\t\t\tstyle: \"width:100%;height:100%;\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\thooks: {\r\n\t\t\t\t\t\t\"didInsert\": function(){\r\n\t\t\t\t\t\t\tscheduler.setCurrentView();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tel: this.el,\r\n\t\t\t\t\t\t\ttype: 1\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tinit: function(){\r\n\t\t\t\tvar container = document.createElement(\"DIV\");\r\n\t\t\t\tcontainer.id = \"scheduler_\"+ scheduler.uid();\r\n\t\t\t\tcontainer.style.width = \"100%\";\r\n\t\t\t\tcontainer.style.height = \"100%\";\r\n\t\t\t\tcontainer.classList.add(\"dhx_cal_container\");\r\n\t\t\t\tcontainer.cmp = \"grid\";\r\n\t\t\t\tcontainer.innerHTML = '
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
';\r\n\t\t\t\tscheduler.init(container);\r\n\r\n\t\t\t\tthis.el = container;\r\n\t\t\t}\r\n\t\t},\r\n\t\ttype: 4\r\n\t};\r\n};\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\tvar setCurrentView = scheduler.setCurrentView,\r\n\t\tupdateView = scheduler.updateView;\r\n\tvar update_view_timer = null,\r\n\t\tcurr_view_timer = null;\r\n\r\n\tvar lazy_setCurrentView = function(date, mode){\r\n\t\tvar self = this;\r\n\t\tglobal.clearTimeout(curr_view_timer);\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\r\n\t\tvar oldDate = self._date,\r\n\t\t\toldMode = self._mode;\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tcurr_view_timer = setTimeout(function(){\r\n\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!self.callEvent(\"onBeforeViewChange\", [oldMode, oldDate, mode || self._mode, date || self._date])){\r\n\t\t\t\tupdateFlags(self, oldDate, oldMode);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateView.call(self, date, mode);\r\n\t\t\tself.callEvent(\"onViewChange\", [self._mode, self._date]);\r\n\r\n\t\t\tglobal.clearTimeout(update_view_timer);\r\n\t\t\tcurr_view_timer = 0;\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tvar lazy_updateView = function(date, mode){\r\n\t\tvar self = this,\r\n\t\t\tars = arguments;\r\n\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\t\tupdate_view_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(curr_view_timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tupdateView.apply(self, ars);\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tfunction updateFlags(scheduler, date, mode){\r\n\t\tif(date)\r\n\t\t\tscheduler._date = date;\r\n\t\tif(mode)\r\n\t\t\tscheduler._mode = mode;\r\n\r\n\t}\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tif(scheduler.config.delay_render){\r\n\t\t\tscheduler.setCurrentView = lazy_setCurrentView;\r\n\t\t\tscheduler.updateView = lazy_updateView;\r\n\t\t}else{\r\n\t\t\tscheduler.setCurrentView = setCurrentView;\r\n\t\t\tscheduler.updateView = updateView;\r\n\t\t}\r\n\t});\r\n\r\n})();\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n/*\r\nif (global.dataProcessor && !dataProcessor.prototype.init_original){\r\n\tdataProcessor.prototype.init_original=dataProcessor.prototype.init;\r\n\tdataProcessor.prototype.init=function(obj){\r\n\t\tthis.init_original(obj);\r\n\t\tobj._dataprocessor=this;\r\n\r\n\t\tthis.setTransactionMode(\"POST\",true);\r\n\t\tthis.serverProcessor+=(this.serverProcessor.indexOf(\"?\")!=-1?\"&\":\"?\")+\"editing=true\";\r\n\t};\r\n}*/\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tif(typeof dhtmlxError !== \"undefined\") {\r\n\t\twindow.dhtmlxError.catchError(\"LoadXML\", function(a, b, c){\r\n\t\t\tvar message = c[0].responseText;\r\n\r\n\t\t\tswitch (scheduler.config.ajax_error){\r\n\t\t\t\tcase \"alert\":\r\n\t\t\t\t\tglobal.alert(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"console\":\r\n\t\t\t\t\tglobal.console.log(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n}","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","export default class ExtensionsManager{\r\n\tconstructor(config){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension(name, ext) {\r\n\t\tthis._extensions[name] = ext;\r\n\t}\r\n\r\n\tgetExtension(name) {\r\n\t\treturn this._extensions[name];\r\n\t}\r\n}","\r\nexport default function(){\r\n/* global dhtmlx */\r\nif (typeof dhtmlx != \"undefined\" && dhtmlx.attaches) {\r\n\tdhtmlx.attaches.attachScheduler = function (day, mode, tabs, scheduler) {\r\n\t\tvar tabs = tabs || '
';\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"dhxSchedObj_\" + this._genStr(12);\r\n\t\tobj.innerHTML = '
';\r\n\t\tdocument.body.appendChild(obj.firstChild);\r\n\r\n\t\tthis.attachObject(obj.id, false, true);\r\n\r\n\t\tthis.vs[this.av].sched = scheduler;\r\n\t\tthis.vs[this.av].schedId = obj.id;\r\n\t\tscheduler.setSizes = scheduler.updateView;\r\n\t\tscheduler.destructor = function () { };\r\n\t\tscheduler.init(obj.id, day, mode);\r\n\r\n\t\treturn this.vs[this._viewRestore()].sched;\r\n\t};\r\n}\r\n\r\n}","export default {\r\n\talert: (extension, assert) => {\r\n\t\tassert(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
\r\n\t\tYou may need a
Professional version of the component .
\r\n\t\tContact us at
https://dhtmlx.com/docs/contact.shtml if you have any questions.`);\r\n\t}\r\n};","export default function(scheduler){\r\n\r\n\r\n\r\n(function(){\r\n\tvar modalsStack = [];\r\n\r\n\tfunction isModal(){\r\n\t\treturn !!(modalsStack.length);\r\n\t}\r\n\r\n\tfunction isChildOf(child, parent){\r\n\t\twhile(child && child != parent){\r\n\t\t\tchild = child.parentNode;\r\n\t\t}\r\n\r\n\t\treturn !!(child == parent);\r\n\t}\r\n\r\n\tfunction afterPopup(box){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {\r\n\t\t\t\tscheduler.focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t}\r\n\tfunction startModal(box){\r\n\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\tmodalsStack.push(box);\r\n\t\t//scheduler.$keyboardNavigation.dispatcher.disable();\r\n\t}\r\n\r\n\tfunction endModal(){\r\n\t\tvar box = modalsStack.pop();\r\n\t\tif(box) {\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t}\r\n\t\tafterPopup(box);\r\n\r\n\t}\r\n\r\n\tfunction isTopModal(box){\r\n\t//\tif(dhtmlx._modalsStack.length){\r\n\t//\t\treturn box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];\r\n\t//\t}else{\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t//\t}\r\n\r\n\t}\r\n\r\n\tfunction trapFocus(event){\r\n\t\tvar event = event || window.event;\r\n\t\tvar target = event.currentTarget;\r\n\t\tif(!isTopModal(target)) return;\r\n\r\n\t\tscheduler.$keyboardNavigation.trapFocus(target, event);\r\n\t}\r\n\r\n\tfunction traceLightbox(){\r\n\t\tstartModal(scheduler.getLightbox());\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", traceLightbox);\r\n\tscheduler.attachEvent(\"onAfterLightbox\", endModal);\r\n\r\n\tscheduler.attachEvent(\"onAfterQuickInfo\", function(){afterPopup();});\r\n\r\n\tif(!scheduler._keyNavMessagePopup) {\r\n\t\tscheduler._keyNavMessagePopup = true;\r\n\r\n\t\tvar focusElement = null;\r\n\t\tvar backupFocus = null;\r\n\t\tconst modalsStack = [];\r\n\t\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\t\tfocusElement = document.activeElement;\r\n\t\t\tbackupFocus = focusElement;\r\n\r\n\t\t\twhile(backupFocus && scheduler._getClassName(backupFocus).indexOf(\"dhx_cal_data\") < 0){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\t\t\tif(backupFocus){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t});\r\n\r\n\r\n\t\tscheduler.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif(box) {\r\n\t\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tvar currentTarget = document.activeElement;\r\n\t\t\t\twhile(currentTarget && scheduler._getClassName(currentTarget).indexOf(\"dhx_cal_light\") < 0){\r\n\t\t\t\t\tcurrentTarget = currentTarget.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(currentTarget)\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tif(focusElement && focusElement.parentNode){\r\n\t\t\t\t\tfocusElement.focus();\r\n\r\n\t\t\t\t}else if(backupFocus && backupFocus.parentNode){\r\n\t\t\t\t\tbackupFocus.focus();\r\n\t\t\t\t}\r\n\t\t\t\tfocusElement = null;\r\n\t\t\t\tbackupFocus = null;\r\n\r\n\t\t\t}, 1);\r\n\t\t});\r\n\t}\r\n\r\n\tscheduler.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\n//Initial idea and implementation by Steve MC\r\nscheduler._temp_key_scope = function (){\r\n\r\n\tscheduler.config.key_nav = true;\r\n\r\n\tscheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations\r\n\tscheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations\r\n\tvar isCopy = null;\r\n\r\n\tvar pos = {};\r\n\r\n\tif(!document.body){\r\n\t\tscheduler.event(window, \"load\", function(){\r\n\t\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t\t});\r\n\t}else{\r\n\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t}\r\n\r\n\tfunction trackMousePosition(event){\r\n\t\tevent = event || window.event;\r\n\t\tpos.x = event.clientX;\r\n\t\tpos.y = event.clientY;\r\n\t}\r\n\tfunction currentTarget(){\r\n\r\n\t\tvar mousePointer = false;\r\n\t\tvar keyNavPointer = false;\r\n\r\n\t\tvar target = document.elementFromPoint(pos.x, pos.y);\r\n\t\twhile(target && target != scheduler._obj){\r\n\t\t\ttarget = target.parentNode;\r\n\t\t}\r\n\t\tmousePointer = !!(target == scheduler._obj);\r\n\r\n\t\tkeyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();\r\n\r\n\t\treturn mousePointer || keyNavPointer;\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onMouseMove\", function(id,e){\r\n\t\tvar state = scheduler.getState();\r\n\r\n\t\t// make sure scheduler is fully initialized before calling scheduler.getActionData\r\n\t\tif(!(state.mode && state.min_date)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar position = scheduler.getActionData(e);\r\n\t\tscheduler.$keyboardNavigation._pasteDate = position.date;\r\n\t\tscheduler.$keyboardNavigation._pasteSection = position.section;\r\n\t});\r\n\r\n\tfunction clear_event_after(ev){\r\n\t\tdelete ev.rec_type; delete ev.rec_pattern;\r\n\t\tdelete ev.event_pid; delete ev.event_length;\r\n\t}\r\n\r\n\tfunction copyEvent(ev){\r\n\t\treturn scheduler._lame_copy({}, ev);\r\n\t}\r\n\r\n\tscheduler._make_pasted_event = function(ev){\r\n\t\tvar date = scheduler.$keyboardNavigation._pasteDate;\r\n\t\tvar section = scheduler.$keyboardNavigation._pasteSection;\r\n\r\n\t\tvar event_duration = ev.end_date-ev.start_date;\r\n\r\n\t\tvar copy = copyEvent(ev);\r\n\t\tclear_event_after(copy);\r\n\t\tcopy.start_date = new Date(date);\r\n\t\tcopy.end_date = new Date(copy.start_date.valueOf() + event_duration);\r\n\r\n\t\tif(section){\r\n\t\t\tvar property = scheduler._get_section_property();\r\n\t\t\t// GS-2527: if the event has multiple sections, it will be inserted into the initial sections.\r\n\t\t\tif(scheduler.config.multisection && ev[property] && scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(ev)) \r\n\t\t\t\tcopy[property] = ev[property]; // save initial set of resources for multisection view\r\n\t\t\telse\r\n\t\t\t\tcopy[property] = section;\r\n\t\t}\r\n\t\treturn copy;\r\n\t};\r\n\tscheduler._do_paste = function(is_copy, modified_ev, original_ev){\r\n\t\tif(scheduler.callEvent(\"onBeforeEventPasted\", [is_copy, modified_ev, original_ev]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tscheduler.addEvent(modified_ev);\r\n\t\tscheduler.callEvent(\"onEventPasted\", [is_copy, modified_ev, original_ev]);\r\n\t};\r\n\r\n\tscheduler._is_key_nav_active = function(){\r\n\t\tif(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tfunction getSelectedEvent(){\r\n\t\tvar node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();\r\n\t\tif(node && node.eventId) return node.eventId;\r\n\t\treturn scheduler._select_id;\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", function(e){\r\n\t\t// compatibility fix - scheduler focus on ctrl+v on mouse hover\r\n\t\tif(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler._key_nav_copy_paste = function(e){\r\n\t\tif(!scheduler._is_key_nav_active()) return true;\r\n\r\n\t\tif (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows\r\n\t\t\te.cancelBubble = true;\r\n\r\n\t\t\tvar next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);\r\n\t\t\tscheduler.setCurrentView(next);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar select_id = getSelectedEvent();\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C\r\n\t\t\tif (select_id) {\r\n\t\t\t\tscheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\t\t\t\tisCopy = true;\r\n\t\t\t\tscheduler.callEvent(\"onEventCopied\", [scheduler.getEvent(select_id)]);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X\r\n\t\t\tif (select_id) {\r\n\t\t\t\tisCopy = false;\r\n\t\t\t\tvar ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\r\n\t\t\t\tscheduler.updateEvent(ev.id);\r\n\t\t\t\tscheduler.callEvent(\"onEventCut\", [ev]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V\r\n\t\t\tvar ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;\r\n\t\t\tev = ev || scheduler._buffer_event;\r\n\r\n\t\t\tif (ev) {\r\n\t\t\t\tvar new_ev = scheduler._make_pasted_event(ev);\r\n\t\t\t\tif (isCopy) {\r\n\t\t\t\t\tnew_ev.id = scheduler.uid();\r\n\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t}\r\n\t\t\t\telse { // cut operation\r\n\t\t\t\t\tvar res = scheduler.callEvent(\"onBeforeEventChanged\",[new_ev, e, false, ev]);\r\n\t\t\t\t\tif (res) {\r\n\t\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t\t\tisCopy = true; // switch to copy after first paste operation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n};\r\nscheduler._temp_key_scope();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.attachSchedulerHandlers = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tvar keyDownHandler = function(e){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\treturn dispatcher.keyDownHandler(e);\r\n\t};\r\n\r\n\tvar focusHandler = function () {\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tdispatcher.focusGlobalNode();\r\n\t\t});\r\n\t};\r\n\r\n\tvar waitCall;\r\n\tscheduler.attachEvent(\"onDataRender\", function(){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;\r\n\r\n\t\tclearTimeout(waitCall);\r\n\t\twaitCall = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\tdispatcher.enable();\r\n\t\t\treFocusActiveNode();\r\n\t\t});\r\n\t});\r\n\r\n\tvar reFocusActiveNode = function(){\r\n\t\tif(!dispatcher.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\tif(!activeNode)\r\n\t\t\treturn;\r\n\r\n\t\tif(!activeNode.isValid()){\r\n\t\t\tactiveNode = activeNode.fallback();\r\n\t\t}\r\n\r\n\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)\r\n\t\t\treturn;\r\n\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tactiveNode.focus(true);\r\n\t\t});\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tvar container = scheduler.$container;\r\n\t\tscheduler.eventRemove(document, \"keydown\", keyDownHandler);\r\n\t\tscheduler.eventRemove(container, \"mousedown\", mousedownHandler);\r\n\t\tscheduler.eventRemove(container, \"focus\", focusHandler);\r\n\r\n\r\n\t\tif(scheduler.config.key_nav){\r\n\r\n\t\t\tscheduler.event(document, \"keydown\", keyDownHandler);\r\n\t\t\tscheduler.event(container, \"mousedown\", mousedownHandler);\r\n\t\t\tscheduler.event(container, \"focus\", focusHandler);\r\n\r\n\t\t\tcontainer.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t}else{\r\n\t\t\tcontainer.removeAttribute(\"tabindex\");\r\n\t\t}\r\n\t});\r\n\r\n\tfunction mousedownHandler(e){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\r\n\t\tconst view = scheduler.getView();\r\n\t\tlet dataAreaClick = false;\r\n\t\tif (scheduler.getState().mode === \"month\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_cal_month_table\"));\r\n\t\t} else if (view && view.layout === \"timeline\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_timeline_data_col\"));\r\n\t\t} else {\r\n\t\t\tconst listOfScales = scheduler.$container.querySelectorAll(\".dhx_scale_holder\");\r\n\t\t\tconst arrOfScales = Array.from(listOfScales);\r\n\t\t\tdataAreaClick = arrOfScales.some(scale => scale === e.target.parentNode);\r\n\t\t}\r\n\r\n\t\tvar pos = scheduler.getActionData(e);\r\n\r\n\t\tvar focusNode;\r\n\t\tif(scheduler._locate_event(e.target || e.srcElement)){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));\r\n\t\t}else if(dataAreaClick){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(pos.date && dataAreaClick){\r\n\t\t\t\tfocusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(focusNode) {\r\n\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\tdispatcher.activeNode = focusNode;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (pos.date && dataAreaClick) {\r\n\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction focusEvent(evNode){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!dispatcher.isEnabled()) return;\r\n\r\n\r\n\t\tvar prevState = evNode;\r\n\t\tvar focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);\r\n\t\tif(!focusNode.isValid()){\r\n\t\t\tvar lastStart = focusNode.start || prevState.start;\r\n\t\t\tvar lastEnd = focusNode.end || prevState.end;\r\n\t\t\tvar lastSection = focusNode.section || prevState.section;\r\n\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);\r\n\t\t\tif(!focusNode.isValid()){\r\n\t\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdispatcher.setActiveNode(focusNode);\r\n\t\tvar node = dispatcher.getActiveNode();\r\n\t\tif(node && node.getNode && document.activeElement != node.getNode()){\r\n\t\t\tdispatcher.focusNode(dispatcher.getActiveNode());\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar updateEvent = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\tvar res = updateEvent.apply(this, arguments);\r\n\t\tif(scheduler.config.key_nav && dispatcher.isEnabled()){\r\n\t\t\tif(scheduler.getState().select_id == id){\r\n\t\t\t\tvar element = new scheduler.$keyboardNavigation.Event(id);\r\n\r\n\t\t\t\tif(!scheduler.getState().lightbox_id){\r\n\t\t\t\t\tfocusEvent(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id) {\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\tif(activeNode.eventId == id){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function(){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tif(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\ndeclare let google: any;\r\n\r\nexport class GoogleMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tprivate infoWindow: any;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tlet zoom = this.settings.zoom_after_resolve || this.settings.initial_zoom;\r\n\t\t\t\t\tif (event.lat && event.lng){\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: event.lat, \r\n\t\t\t\t\t\t\tlng: event.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t} else {\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: this.settings.error_position.lat, \r\n\t\t\t\t\t\t\tlng: this.settings.error_position.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgoogle.maps.event.trigger(this._markers[i].marker, 'click');\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tthis.settings = options;\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapOptions = {\r\n\t\t\tcenter: { lat: options.initial_position.lat, lng: options.initial_position.lng },\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tmapId: container.id,\r\n\t\t\tscrollwheel: true,\r\n\t\t\tmapTypeId: options.type\r\n\t\t}\r\n\t\t// we need to reuse the google map to avoid leak memory\r\n\t\tif (this.map === null) {\r\n\t\t\tthis.map = new google.maps.Map(container, mapOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet map = this.map;\r\n\t\t\tcontainer.appendChild(this.map.__gm.messageOverlay);\r\n\t\t\tcontainer.appendChild(this.map.__gm.outerContainer);\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tmap.setOptions({container: container.id});\r\n\t\t\t}, 500);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(this.map, \"dblclick\", function(event) {\r\n\t\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\r\n\t\t\tif (!scheduler.config.readonly && scheduler.config.dblclick_create) {\r\n\t\t\t\tlet point = event.latLng;\r\n\t\t\t\tgeocoder.geocode(\r\n\t\t\t\t\t{ 'latLng': point },\r\n\t\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\t\t\t\tlat: point.lat(),\r\n\t\t\t\t\t\t\t\tlng: point.lng(),\r\n\t\t\t\t\t\t\t\tevent_location: results[0].formatted_address,\r\n\t\t\t\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tgoogle.maps.event.clearInstanceListeners(window);\r\n\t\tgoogle.maps.event.clearInstanceListeners(document);\r\n\t\tgoogle.maps.event.clearInstanceListeners(container);\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\tasync addEventMarker(event: ICalendarEvent): Promise
{\r\n\t\tlet config = {\r\n\t\t\ttitle: event.text,\r\n\t\t\tposition: {},\r\n\t\t\tmap: {}\r\n\t\t}\r\n\t\t\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tconfig.position = { lat: event.lat, lng: event.lng };\r\n\t\t} else {\r\n\t\t\tconfig.position = { lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }\r\n\t\t}\r\n\t\tconst { AdvancedMarkerElement } = await google.maps.importLibrary(\"marker\");\r\n\t\tlet marker;\r\n\t\tif (this.scheduler.ext.mapView.createMarker) {\r\n\t\t\tconfig.map = this.map;\r\n\t\t\tmarker = this.scheduler.ext.mapView.createMarker(config);\r\n\t\t} else {\r\n\t\t\tmarker = new AdvancedMarkerElement(config);\r\n\t\t\tmarker.map = this.map;\r\n\t\t}\r\n\t\tmarker.setMap(this.map);\r\n\t\t//case for markeks which were deleted with DataProcessor\r\n\t\tif (event[\"!nativeeditor_status\"] == \"true_deleted\"){\r\n\t\t\tmarker.setMap(null);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(marker, \"click\", () => {\r\n\t\t\tif (this.infoWindow) {\r\n\t\t\t\tthis.infoWindow.close();\r\n\t\t\t}\r\n\t\t\tthis.infoWindow = new google.maps.InfoWindow({maxWidth: this.settings.info_window_max_width});\r\n\t\t\tthis.infoWindow.setContent(this.scheduler.templates.map_info_content(event));\r\n\t\t\tthis.infoWindow.open({\r\n\t\t\t\tanchor: marker,\r\n\t\t\t\tmap: this.map,\r\n\t\t\t});\r\n\t\t});\r\n\t\tlet markerInfo = {event, ...config, marker};\r\n\t\tthis._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.setVisible(false);\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t\tthis._markers[i].marker.setPosition(null);\r\n\t\t\t\tthis._markers[i].marker = null;\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tthis._markers[i].position.lat = event.lat;\r\n\t\t\t\tthis._markers[i].position.lng = event.lng;\r\n\t\t\t\tthis._markers[i].text = event.text;\r\n\t\t\t\tlet latlng = new google.maps.LatLng(event.lat, event.lng);\r\n\t\t\t\tthis._markers[i].marker.setPosition(latlng);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif (this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setCenter({\r\n\t\t\tlat: latitude, \r\n\t\t\tlng: longitude,\r\n\t\t});\r\n\t\tthis.map.setZoom(zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\tlet position: any = await new Promise((resolve) => {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{ 'address': string },\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tresolve({\r\n\t\t\t\t\t\t lat: results[0].geometry.location.lat(),\r\n\t\t\t\t\t\t lng: results[0].geometry.location.lng()\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\tresolve({});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t});\r\n\t\treturn position;\r\n\t}\r\n\t\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let L: any\r\n\r\nexport class OpenStreetMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate _markers: any[];\r\n\tprivate settings: IMapSettings;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.openPopup();\r\n\t\t\t\t\tthis._markers[i].marker.closeTooltip();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapWrapper = document.createElement('div');\r\n\t\tmapWrapper.className = 'mapWrapper';\r\n\t\tmapWrapper.id = 'mapWrapper';\r\n\t\tmapWrapper.style.width = container.style.width;\r\n\t\tmapWrapper.style.height = container.style.height;\r\n\t\tcontainer.appendChild(mapWrapper);\r\n\r\n\t\tlet map = L.map(mapWrapper, {\r\n\t\t\tcenter: L.latLng(options.initial_position.lat, options.initial_position.lng),\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tkeyboard: false // need to set false, due to bug with moving window\r\n\t\t});\r\n\t\tL.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);\r\n\t\tmap.on(\"dblclick\", async function(e){\r\n\t\t\tconst settings = {\r\n\t\t\t\t\"method\": \"GET\",\r\n\t\t\t\theaders: {\r\n\t\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e.latlng.lat}&lon=${e.latlng.lng}&format=json`, settings).then(response => response.json());\r\n\t\t\tif (response.address) {\r\n\t\t\t\tlet address = response.address.country;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.latlng.lat,\r\n\t\t\t\t\tlng: e.latlng.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\", response.error);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.map = map;\r\n\t\tthis.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n\t\tconst myIcon = L.icon({\r\n\t\t\ticonUrl: 'https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png',\r\n\t\t\ticonSize: [25, 41],\r\n\t\t\tshadowSize: [30, 65],\r\n\t\t\ticonAnchor: [12, 41],\r\n\t\t\tshadowAnchor: [7, 65]\r\n\t\t});\r\n\t\tlet popupConfig = {\r\n\t\t\tminWidth: 180,\r\n\t\t\tmaxWidth: this.settings.info_window_max_width,\r\n\t\t}\r\n\t\tconst markerPopup = L.popup(popupConfig).setContent(this.scheduler.templates.map_info_content(event));\r\n\t\tconst tooltip = L.tooltip().setContent(event.text);\r\n\r\n\t\tlet markerConfig = [\r\n\t\t\tevent.lat,\r\n\t\t\tevent.lng\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tmarkerConfig = [this.settings.error_position.lat, this.settings.error_position.lng];\r\n\t\t}\r\n\t\tconst marker = L.marker(markerConfig, {\r\n\t\t\ticon: myIcon\r\n\t\t}).bindPopup(markerPopup).bindTooltip(tooltip).addTo(this.map);\r\n\t\tconst markerInfo = {event, marker};\r\n\t\tthis._markers.push(markerInfo);\t\t\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker);\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([this.settings.error_position.lat, this.settings.error_position.lng]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([event.lat, event.lng]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif(this._markers) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker); \r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setView([latitude, longitude], zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst settings = {\r\n\t\t\t\"method\": \"GET\",\r\n\t\t\theaders: {\r\n\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t},\r\n\t\t};\r\n\t\tlet position:any = {};\r\n\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/search?q=${string}&format=json`, settings).then(response => response.json());\r\n\t\tif (response && response.length) {\r\n\t\t\tposition.lat = +response[0].lat;\r\n\t\t\tposition.lng = +response[0].lon;\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let mapboxgl: any;\r\ndeclare let MapboxGeocoder: any;\r\n\r\nexport class MapboxAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n const popup = this._markers[i].marker.getPopup();\r\n if (popup.isOpen()){\r\n popup.remove();\r\n }\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.togglePopup();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n let scheduler = this.scheduler;\r\n\r\n\t\tmapboxgl.accessToken = options.accessToken;\r\n const map = new mapboxgl.Map({\r\n container: container, \r\n center: [options.initial_position.lng, options.initial_position.lat], \r\n zoom: options.initial_zoom + 1, // problems with coordinates if zoom = 1\r\n });\r\n map.on(\"dblclick\",async function(e){\r\n\t\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${e.lngLat.lng},${ e.lngLat.lat}.json?access_token=${options.accessToken}`).then(response => response.json());\r\n\t\t\tif (response.features){\r\n\t\t\t\tlet address = response.features[0].place_name;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.lngLat.lat,\r\n\t\t\t\t\tlng: e.lngLat.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\");\r\n\t\t\t}\r\n\t\t});\r\n this.map = map;\r\n this.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n while (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n container.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n let config = [\r\n\t\t\tevent.lng,\r\n\t\t\tevent.lat\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tconfig = [this.settings.error_position.lng, this.settings.error_position.lat];\r\n\t\t} \r\n\r\n\t\tconst popup = new mapboxgl.Popup({ offset: 25, focusAfterOpen: false})\r\n .setMaxWidth(`${this.settings.info_window_max_width}px`) \r\n .setHTML(this.scheduler.templates.map_info_content(event));\r\n const marker = new mapboxgl.Marker()\r\n .setLngLat(config)\r\n .setPopup(popup)\r\n .addTo(this.map);\r\n const markerInfo = {event, marker}; \r\n this._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.remove();\r\n this._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([this.settings.error_position.lng, this.settings.error_position.lat]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([event.lng, event.lat]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tfor (let i = 0; i {\r\n\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${string}.json?access_token=${this.settings.accessToken}`).then(response => response.json());\r\n\t\tlet position:any = {};\r\n\t\tif (response && response.features.length) {\r\n\t\t\tposition.lng = response.features[0].center[0];\r\n\t\t\tposition.lat = response.features[0].center[1];\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","// =============================================================================\n// Weekday\n// =============================================================================\nexport var ALL_WEEKDAYS = [\n 'MO',\n 'TU',\n 'WE',\n 'TH',\n 'FR',\n 'SA',\n 'SU',\n];\nvar Weekday = /** @class */ (function () {\n function Weekday(weekday, n) {\n if (n === 0)\n throw new Error(\"Can't create weekday with n == 0\");\n this.weekday = weekday;\n this.n = n;\n }\n Weekday.fromStr = function (str) {\n return new Weekday(ALL_WEEKDAYS.indexOf(str));\n };\n // __call__ - Cannot call the object directly, do it through\n // e.g. RRule.TH.nth(-1) instead,\n Weekday.prototype.nth = function (n) {\n return this.n === n ? this : new Weekday(this.weekday, n);\n };\n // __eq__\n Weekday.prototype.equals = function (other) {\n return this.weekday === other.weekday && this.n === other.n;\n };\n // __repr__\n Weekday.prototype.toString = function () {\n var s = ALL_WEEKDAYS[this.weekday];\n if (this.n)\n s = (this.n > 0 ? '+' : '') + String(this.n) + s;\n return s;\n };\n Weekday.prototype.getJsWeekday = function () {\n return this.weekday === 6 ? 0 : this.weekday + 1;\n };\n return Weekday;\n}());\nexport { Weekday };\n//# sourceMappingURL=weekday.js.map","// =============================================================================\n// Helper functions\n// =============================================================================\nimport { ALL_WEEKDAYS } from './weekday';\nexport var isPresent = function (value) {\n return value !== null && value !== undefined;\n};\nexport var isNumber = function (value) {\n return typeof value === 'number';\n};\nexport var isWeekdayStr = function (value) {\n return typeof value === 'string' && ALL_WEEKDAYS.includes(value);\n};\nexport var isArray = Array.isArray;\n/**\n * Simplified version of python's range()\n */\nexport var range = function (start, end) {\n if (end === void 0) { end = start; }\n if (arguments.length === 1) {\n end = start;\n start = 0;\n }\n var rang = [];\n for (var i = start; i < end; i++)\n rang.push(i);\n return rang;\n};\nexport var clone = function (array) {\n return [].concat(array);\n};\nexport var repeat = function (value, times) {\n var i = 0;\n var array = [];\n if (isArray(value)) {\n for (; i < times; i++)\n array[i] = [].concat(value);\n }\n else {\n for (; i < times; i++)\n array[i] = value;\n }\n return array;\n};\nexport var toArray = function (item) {\n if (isArray(item)) {\n return item;\n }\n return [item];\n};\nexport function padStart(item, targetLength, padString) {\n if (padString === void 0) { padString = ' '; }\n var str = String(item);\n targetLength = targetLength >> 0;\n if (str.length > targetLength) {\n return String(str);\n }\n targetLength = targetLength - str.length;\n if (targetLength > padString.length) {\n padString += repeat(padString, targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + String(str);\n}\n/**\n * Python like split\n */\nexport var split = function (str, sep, num) {\n var splits = str.split(sep);\n return num\n ? splits.slice(0, num).concat([splits.slice(num).join(sep)])\n : splits;\n};\n/**\n * closure/goog/math/math.js:modulo\n * Copyright 2006 The Closure Library Authors.\n * The % operator in JavaScript returns the remainder of a / b, but differs from\n * some other languages in that the result will have the same sign as the\n * dividend. For example, -1 % 8 == -1, whereas in some other languages\n * (such as Python) the result would be 7. This function emulates the more\n * correct modulo behavior, which is useful for certain applications such as\n * calculating an offset index in a circular list.\n *\n * @param {number} a The dividend.\n * @param {number} b The divisor.\n * @return {number} a % b where the result is between 0 and b (either 0 <= x < b\n * or b < x <= 0, depending on the sign of b).\n */\nexport var pymod = function (a, b) {\n var r = a % b;\n // If r and b differ in sign, add b to wrap the result to the correct sign.\n return r * b < 0 ? r + b : r;\n};\n/**\n * @see: \n */\nexport var divmod = function (a, b) {\n return { div: Math.floor(a / b), mod: pymod(a, b) };\n};\nexport var empty = function (obj) {\n return !isPresent(obj) || obj.length === 0;\n};\n/**\n * Python-like boolean\n *\n * @return {Boolean} value of an object/primitive, taking into account\n * the fact that in Python an empty list's/tuple's\n * boolean value is False, whereas in JS it's true\n */\nexport var notEmpty = function (obj) {\n return !empty(obj);\n};\n/**\n * Return true if a value is in an array\n */\nexport var includes = function (arr, val) {\n return notEmpty(arr) && arr.indexOf(val) !== -1;\n};\n//# sourceMappingURL=helpers.js.map","import { padStart } from './helpers';\nexport var datetime = function (y, m, d, h, i, s) {\n if (h === void 0) { h = 0; }\n if (i === void 0) { i = 0; }\n if (s === void 0) { s = 0; }\n return new Date(Date.UTC(y, m - 1, d, h, i, s));\n};\n/**\n * General date-related utilities.\n * Also handles several incompatibilities between JavaScript and Python\n *\n */\nexport var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n/**\n * Number of milliseconds of one day\n */\nexport var ONE_DAY = 1000 * 60 * 60 * 24;\n/**\n * @see: \n */\nexport var MAXYEAR = 9999;\n/**\n * Python uses 1-Jan-1 as the base for calculating ordinals but we don't\n * want to confuse the JS engine with milliseconds > Number.MAX_NUMBER,\n * therefore we use 1-Jan-1970 instead\n */\nexport var ORDINAL_BASE = datetime(1970, 1, 1);\n/**\n * Python: MO-SU: 0 - 6\n * JS: SU-SAT 0 - 6\n */\nexport var PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5];\n/**\n * py_date.timetuple()[7]\n */\nexport var getYearDay = function (date) {\n var dateNoTime = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n return (Math.ceil((dateNoTime.valueOf() - new Date(date.getUTCFullYear(), 0, 1).valueOf()) /\n ONE_DAY) + 1);\n};\nexport var isLeapYear = function (year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n};\nexport var isDate = function (value) {\n return value instanceof Date;\n};\nexport var isValidDate = function (value) {\n return isDate(value) && !isNaN(value.getTime());\n};\n/**\n * @return {Number} the date's timezone offset in ms\n */\nexport var tzOffset = function (date) {\n return date.getTimezoneOffset() * 60 * 1000;\n};\n/**\n * @see: \n */\nexport var daysBetween = function (date1, date2) {\n // The number of milliseconds in one day\n // Convert both dates to milliseconds\n var date1ms = date1.getTime();\n var date2ms = date2.getTime();\n // Calculate the difference in milliseconds\n var differencems = date1ms - date2ms;\n // Convert back to days and return\n return Math.round(differencems / ONE_DAY);\n};\n/**\n * @see: \n */\nexport var toOrdinal = function (date) {\n return daysBetween(date, ORDINAL_BASE);\n};\n/**\n * @see - \n */\nexport var fromOrdinal = function (ordinal) {\n return new Date(ORDINAL_BASE.getTime() + ordinal * ONE_DAY);\n};\nexport var getMonthDays = function (date) {\n var month = date.getUTCMonth();\n return month === 1 && isLeapYear(date.getUTCFullYear())\n ? 29\n : MONTH_DAYS[month];\n};\n/**\n * @return {Number} python-like weekday\n */\nexport var getWeekday = function (date) {\n return PY_WEEKDAYS[date.getUTCDay()];\n};\n/**\n * @see: \n */\nexport var monthRange = function (year, month) {\n var date = datetime(year, month + 1, 1);\n return [getWeekday(date), getMonthDays(date)];\n};\n/**\n * @see: \n */\nexport var combine = function (date, time) {\n time = time || date;\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds()));\n};\nexport var clone = function (date) {\n var dolly = new Date(date.getTime());\n return dolly;\n};\nexport var cloneDates = function (dates) {\n var clones = [];\n for (var i = 0; i < dates.length; i++) {\n clones.push(clone(dates[i]));\n }\n return clones;\n};\n/**\n * Sorts an array of Date or Time objects\n */\nexport var sort = function (dates) {\n dates.sort(function (a, b) {\n return a.getTime() - b.getTime();\n });\n};\nexport var timeToUntilString = function (time, utc) {\n if (utc === void 0) { utc = true; }\n var date = new Date(time);\n return [\n padStart(date.getUTCFullYear().toString(), 4, '0'),\n padStart(date.getUTCMonth() + 1, 2, '0'),\n padStart(date.getUTCDate(), 2, '0'),\n 'T',\n padStart(date.getUTCHours(), 2, '0'),\n padStart(date.getUTCMinutes(), 2, '0'),\n padStart(date.getUTCSeconds(), 2, '0'),\n utc ? 'Z' : '',\n ].join('');\n};\nexport var untilStringToDate = function (until) {\n var re = /^(\\d{4})(\\d{2})(\\d{2})(T(\\d{2})(\\d{2})(\\d{2})Z?)?$/;\n var bits = re.exec(until);\n if (!bits)\n throw new Error(\"Invalid UNTIL value: \".concat(until));\n return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0));\n};\nvar dateTZtoISO8601 = function (date, timeZone) {\n // date format for sv-SE is almost ISO8601\n var dateStr = date.toLocaleString('sv-SE', { timeZone: timeZone });\n // '2023-02-07 10:41:36'\n return dateStr.replace(' ', 'T') + 'Z';\n};\nexport var dateInTimeZone = function (date, timeZone) {\n var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n // Date constructor can only reliably parse dates in ISO8601 format\n var dateInLocalTZ = new Date(dateTZtoISO8601(date, localTimeZone));\n var dateInTargetTZ = new Date(dateTZtoISO8601(date, timeZone !== null && timeZone !== void 0 ? timeZone : 'UTC'));\n var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime();\n return new Date(date.getTime() - tzOffset);\n};\n//# sourceMappingURL=dateutil.js.map","/**\n * This class helps us to emulate python's generators, sorta.\n */\nvar IterResult = /** @class */ (function () {\n function IterResult(method, args) {\n this.minDate = null;\n this.maxDate = null;\n this._result = [];\n this.total = 0;\n this.method = method;\n this.args = args;\n if (method === 'between') {\n this.maxDate = args.inc\n ? args.before\n : new Date(args.before.getTime() - 1);\n this.minDate = args.inc ? args.after : new Date(args.after.getTime() + 1);\n }\n else if (method === 'before') {\n this.maxDate = args.inc ? args.dt : new Date(args.dt.getTime() - 1);\n }\n else if (method === 'after') {\n this.minDate = args.inc ? args.dt : new Date(args.dt.getTime() + 1);\n }\n }\n /**\n * Possibly adds a date into the result.\n *\n * @param {Date} date - the date isn't necessarly added to the result\n * list (if it is too late/too early)\n * @return {Boolean} true if it makes sense to continue the iteration\n * false if we're done.\n */\n IterResult.prototype.accept = function (date) {\n ++this.total;\n var tooEarly = this.minDate && date < this.minDate;\n var tooLate = this.maxDate && date > this.maxDate;\n if (this.method === 'between') {\n if (tooEarly)\n return true;\n if (tooLate)\n return false;\n }\n else if (this.method === 'before') {\n if (tooLate)\n return false;\n }\n else if (this.method === 'after') {\n if (tooEarly)\n return true;\n this.add(date);\n return false;\n }\n return this.add(date);\n };\n /**\n *\n * @param {Date} date that is part of the result.\n * @return {Boolean} whether we are interested in more values.\n */\n IterResult.prototype.add = function (date) {\n this._result.push(date);\n return true;\n };\n /**\n * 'before' and 'after' return only one date, whereas 'all'\n * and 'between' an array.\n *\n * @return {Date,Array?}\n */\n IterResult.prototype.getValue = function () {\n var res = this._result;\n switch (this.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n case 'after':\n default:\n return (res.length ? res[res.length - 1] : null);\n }\n };\n IterResult.prototype.clone = function () {\n return new IterResult(this.method, this.args);\n };\n return IterResult;\n}());\nexport default IterResult;\n//# sourceMappingURL=iterresult.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { __extends } from \"tslib\";\nimport IterResult from './iterresult';\n/**\n * IterResult subclass that calls a callback function on each add,\n * and stops iterating when the callback returns false.\n */\nvar CallbackIterResult = /** @class */ (function (_super) {\n __extends(CallbackIterResult, _super);\n function CallbackIterResult(method, args, iterator) {\n var _this = _super.call(this, method, args) || this;\n _this.iterator = iterator;\n return _this;\n }\n CallbackIterResult.prototype.add = function (date) {\n if (this.iterator(date, this._result.length)) {\n this._result.push(date);\n return true;\n }\n return false;\n };\n return CallbackIterResult;\n}(IterResult));\nexport default CallbackIterResult;\n//# sourceMappingURL=callbackiterresult.js.map","export var Frequency;\n(function (Frequency) {\n Frequency[Frequency[\"YEARLY\"] = 0] = \"YEARLY\";\n Frequency[Frequency[\"MONTHLY\"] = 1] = \"MONTHLY\";\n Frequency[Frequency[\"WEEKLY\"] = 2] = \"WEEKLY\";\n Frequency[Frequency[\"DAILY\"] = 3] = \"DAILY\";\n Frequency[Frequency[\"HOURLY\"] = 4] = \"HOURLY\";\n Frequency[Frequency[\"MINUTELY\"] = 5] = \"MINUTELY\";\n Frequency[Frequency[\"SECONDLY\"] = 6] = \"SECONDLY\";\n})(Frequency || (Frequency = {}));\nexport function freqIsDailyOrGreater(freq) {\n return freq < Frequency.HOURLY;\n}\n//# sourceMappingURL=types.js.map","// =============================================================================\n// i18n\n// =============================================================================\nvar ENGLISH = {\n dayNames: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n ],\n monthNames: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n tokens: {\n SKIP: /^[ \\r\\n\\t]+|^\\.$/,\n number: /^[1-9][0-9]*/,\n numberAsText: /^(one|two|three)/i,\n every: /^every/i,\n 'day(s)': /^days?/i,\n 'weekday(s)': /^weekdays?/i,\n 'week(s)': /^weeks?/i,\n 'hour(s)': /^hours?/i,\n 'minute(s)': /^minutes?/i,\n 'month(s)': /^months?/i,\n 'year(s)': /^years?/i,\n on: /^(on|in)/i,\n at: /^(at)/i,\n the: /^the/i,\n first: /^first/i,\n second: /^second/i,\n third: /^third/i,\n nth: /^([1-9][0-9]*)(\\.|th|nd|rd|st)/i,\n last: /^last/i,\n for: /^for/i,\n 'time(s)': /^times?/i,\n until: /^(un)?til/i,\n monday: /^mo(n(day)?)?/i,\n tuesday: /^tu(e(s(day)?)?)?/i,\n wednesday: /^we(d(n(esday)?)?)?/i,\n thursday: /^th(u(r(sday)?)?)?/i,\n friday: /^fr(i(day)?)?/i,\n saturday: /^sa(t(urday)?)?/i,\n sunday: /^su(n(day)?)?/i,\n january: /^jan(uary)?/i,\n february: /^feb(ruary)?/i,\n march: /^mar(ch)?/i,\n april: /^apr(il)?/i,\n may: /^may/i,\n june: /^june?/i,\n july: /^july?/i,\n august: /^aug(ust)?/i,\n september: /^sep(t(ember)?)?/i,\n october: /^oct(ober)?/i,\n november: /^nov(ember)?/i,\n december: /^dec(ember)?/i,\n comma: /^(,\\s*|(and|or)\\s*)+/i,\n },\n};\nexport default ENGLISH;\n//# sourceMappingURL=i18n.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\nimport { isArray, isNumber, isPresent } from '../helpers';\n// =============================================================================\n// Helper functions\n// =============================================================================\n/**\n * Return true if a value is in an array\n */\nvar contains = function (arr, val) {\n return arr.indexOf(val) !== -1;\n};\nvar defaultGetText = function (id) { return id.toString(); };\nvar defaultDateFormatter = function (year, month, day) { return \"\".concat(month, \" \").concat(day, \", \").concat(year); };\n/**\n *\n * @param {RRule} rrule\n * Optional:\n * @param {Function} gettext function\n * @param {Object} language definition\n * @constructor\n */\nvar ToText = /** @class */ (function () {\n function ToText(rrule, gettext, language, dateFormatter) {\n if (gettext === void 0) { gettext = defaultGetText; }\n if (language === void 0) { language = ENGLISH; }\n if (dateFormatter === void 0) { dateFormatter = defaultDateFormatter; }\n this.text = [];\n this.language = language || ENGLISH;\n this.gettext = gettext;\n this.dateFormatter = dateFormatter;\n this.rrule = rrule;\n this.options = rrule.options;\n this.origOptions = rrule.origOptions;\n if (this.origOptions.bymonthday) {\n var bymonthday = [].concat(this.options.bymonthday);\n var bynmonthday = [].concat(this.options.bynmonthday);\n bymonthday.sort(function (a, b) { return a - b; });\n bynmonthday.sort(function (a, b) { return b - a; });\n // 1, 2, 3, .., -5, -4, -3, ..\n this.bymonthday = bymonthday.concat(bynmonthday);\n if (!this.bymonthday.length)\n this.bymonthday = null;\n }\n if (isPresent(this.origOptions.byweekday)) {\n var byweekday = !isArray(this.origOptions.byweekday)\n ? [this.origOptions.byweekday]\n : this.origOptions.byweekday;\n var days = String(byweekday);\n this.byweekday = {\n allWeeks: byweekday.filter(function (weekday) {\n return !weekday.n;\n }),\n someWeeks: byweekday.filter(function (weekday) {\n return Boolean(weekday.n);\n }),\n isWeekdays: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') === -1 &&\n days.indexOf('SU') === -1,\n isEveryDay: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') !== -1 &&\n days.indexOf('SU') !== -1,\n };\n var sortWeekDays = function (a, b) {\n return a.weekday - b.weekday;\n };\n this.byweekday.allWeeks.sort(sortWeekDays);\n this.byweekday.someWeeks.sort(sortWeekDays);\n if (!this.byweekday.allWeeks.length)\n this.byweekday.allWeeks = null;\n if (!this.byweekday.someWeeks.length)\n this.byweekday.someWeeks = null;\n }\n else {\n this.byweekday = null;\n }\n }\n /**\n * Test whether the rrule can be fully converted to text.\n *\n * @param {RRule} rrule\n * @return {Boolean}\n */\n ToText.isFullyConvertible = function (rrule) {\n var canConvert = true;\n if (!(rrule.options.freq in ToText.IMPLEMENTED))\n return false;\n if (rrule.origOptions.until && rrule.origOptions.count)\n return false;\n for (var key in rrule.origOptions) {\n if (contains(['dtstart', 'tzid', 'wkst', 'freq'], key))\n return true;\n if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key))\n return false;\n }\n return canConvert;\n };\n ToText.prototype.isFullyConvertible = function () {\n return ToText.isFullyConvertible(this.rrule);\n };\n /**\n * Perform the conversion. Only some of the frequencies are supported.\n * If some of the rrule's options aren't supported, they'll\n * be omitted from the output an \"(~ approximate)\" will be appended.\n *\n * @return {*}\n */\n ToText.prototype.toString = function () {\n var gettext = this.gettext;\n if (!(this.options.freq in ToText.IMPLEMENTED)) {\n return gettext('RRule error: Unable to fully convert this rrule to text');\n }\n this.text = [gettext('every')];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[RRule.FREQUENCIES[this.options.freq]]();\n if (this.options.until) {\n this.add(gettext('until'));\n var until = this.options.until;\n this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate()));\n }\n else if (this.options.count) {\n this.add(gettext('for'))\n .add(this.options.count.toString())\n .add(this.plural(this.options.count) ? gettext('times') : gettext('time'));\n }\n if (!this.isFullyConvertible())\n this.add(gettext('(~ approximate)'));\n return this.text.join('');\n };\n ToText.prototype.HOURLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval) ? gettext('hours') : gettext('hour'));\n };\n ToText.prototype.MINUTELY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval)\n ? gettext('minutes')\n : gettext('minute'));\n };\n ToText.prototype.DAILY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n else if (this.origOptions.byhour) {\n this._byhour();\n }\n };\n ToText.prototype.WEEKLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? gettext('weeks') : gettext('week'));\n }\n if (this.byweekday && this.byweekday.isWeekdays) {\n if (this.options.interval === 1) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n }\n else if (this.byweekday && this.byweekday.isEveryDay) {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n else {\n if (this.options.interval === 1)\n this.add(gettext('week'));\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.origOptions.byhour) {\n this._byhour();\n }\n }\n };\n ToText.prototype.MONTHLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(gettext('months'));\n if (this.plural(this.options.interval))\n this.add(gettext('in'));\n }\n else {\n // this.add(gettext('MONTH'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval)\n ? gettext('months')\n : gettext('month'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n };\n ToText.prototype.YEARLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n this.add(gettext('years'));\n }\n else {\n // this.add(gettext('YEAR'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval) ? gettext('years') : gettext('year'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.options.byyearday) {\n this.add(gettext('on the'))\n .add(this.list(this.options.byyearday, this.nth, gettext('and')))\n .add(gettext('day'));\n }\n if (this.options.byweekno) {\n this.add(gettext('in'))\n .add(this.plural(this.options.byweekno.length)\n ? gettext('weeks')\n : gettext('week'))\n .add(this.list(this.options.byweekno, undefined, gettext('and')));\n }\n };\n ToText.prototype._bymonthday = function () {\n var gettext = this.gettext;\n if (this.byweekday && this.byweekday.allWeeks) {\n this.add(gettext('on'))\n .add(this.list(this.byweekday.allWeeks, this.weekdaytext, gettext('or')))\n .add(gettext('the'))\n .add(this.list(this.bymonthday, this.nth, gettext('or')));\n }\n else {\n this.add(gettext('on the')).add(this.list(this.bymonthday, this.nth, gettext('and')));\n }\n // this.add(gettext('DAY'))\n };\n ToText.prototype._byweekday = function () {\n var gettext = this.gettext;\n if (this.byweekday.allWeeks && !this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(this.list(this.byweekday.allWeeks, this.weekdaytext));\n }\n if (this.byweekday.someWeeks) {\n if (this.byweekday.allWeeks)\n this.add(gettext('and'));\n this.add(gettext('on the')).add(this.list(this.byweekday.someWeeks, this.weekdaytext, gettext('and')));\n }\n };\n ToText.prototype._byhour = function () {\n var gettext = this.gettext;\n this.add(gettext('at')).add(this.list(this.origOptions.byhour, undefined, gettext('and')));\n };\n ToText.prototype._bymonth = function () {\n this.add(this.list(this.options.bymonth, this.monthtext, this.gettext('and')));\n };\n ToText.prototype.nth = function (n) {\n n = parseInt(n.toString(), 10);\n var nth;\n var gettext = this.gettext;\n if (n === -1)\n return gettext('last');\n var npos = Math.abs(n);\n switch (npos) {\n case 1:\n case 21:\n case 31:\n nth = npos + gettext('st');\n break;\n case 2:\n case 22:\n nth = npos + gettext('nd');\n break;\n case 3:\n case 23:\n nth = npos + gettext('rd');\n break;\n default:\n nth = npos + gettext('th');\n }\n return n < 0 ? nth + ' ' + gettext('last') : nth;\n };\n ToText.prototype.monthtext = function (m) {\n return this.language.monthNames[m - 1];\n };\n ToText.prototype.weekdaytext = function (wday) {\n var weekday = isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday();\n return ((wday.n ? this.nth(wday.n) + ' ' : '') +\n this.language.dayNames[weekday]);\n };\n ToText.prototype.plural = function (n) {\n return n % 100 !== 1;\n };\n ToText.prototype.add = function (s) {\n this.text.push(' ');\n this.text.push(s);\n return this;\n };\n ToText.prototype.list = function (arr, callback, finalDelim, delim) {\n var _this = this;\n if (delim === void 0) { delim = ','; }\n if (!isArray(arr)) {\n arr = [arr];\n }\n var delimJoin = function (array, delimiter, finalDelimiter) {\n var list = '';\n for (var i = 0; i < array.length; i++) {\n if (i !== 0) {\n if (i === array.length - 1) {\n list += ' ' + finalDelimiter + ' ';\n }\n else {\n list += delimiter + ' ';\n }\n }\n list += array[i];\n }\n return list;\n };\n callback =\n callback ||\n function (o) {\n return o.toString();\n };\n var realCallback = function (arg) {\n return callback && callback.call(_this, arg);\n };\n if (finalDelim) {\n return delimJoin(arr.map(realCallback), delim, finalDelim);\n }\n else {\n return arr.map(realCallback).join(delim + ' ');\n }\n };\n return ToText;\n}());\nexport default ToText;\n//# sourceMappingURL=totext.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\n// =============================================================================\n// Parser\n// =============================================================================\nvar Parser = /** @class */ (function () {\n function Parser(rules) {\n this.done = true;\n this.rules = rules;\n }\n Parser.prototype.start = function (text) {\n this.text = text;\n this.done = false;\n return this.nextSymbol();\n };\n Parser.prototype.isDone = function () {\n return this.done && this.symbol === null;\n };\n Parser.prototype.nextSymbol = function () {\n var best;\n var bestSymbol;\n this.symbol = null;\n this.value = null;\n do {\n if (this.done)\n return false;\n var rule = void 0;\n best = null;\n for (var name_1 in this.rules) {\n rule = this.rules[name_1];\n var match = rule.exec(this.text);\n if (match) {\n if (best === null || match[0].length > best[0].length) {\n best = match;\n bestSymbol = name_1;\n }\n }\n }\n if (best != null) {\n this.text = this.text.substr(best[0].length);\n if (this.text === '')\n this.done = true;\n }\n if (best == null) {\n this.done = true;\n this.symbol = null;\n this.value = null;\n return;\n }\n } while (bestSymbol === 'SKIP');\n this.symbol = bestSymbol;\n this.value = best;\n return true;\n };\n Parser.prototype.accept = function (name) {\n if (this.symbol === name) {\n if (this.value) {\n var v = this.value;\n this.nextSymbol();\n return v;\n }\n this.nextSymbol();\n return true;\n }\n return false;\n };\n Parser.prototype.acceptNumber = function () {\n return this.accept('number');\n };\n Parser.prototype.expect = function (name) {\n if (this.accept(name))\n return true;\n throw new Error('expected ' + name + ' but found ' + this.symbol);\n };\n return Parser;\n}());\nexport default function parseText(text, language) {\n if (language === void 0) { language = ENGLISH; }\n var options = {};\n var ttr = new Parser(language.tokens);\n if (!ttr.start(text))\n return null;\n S();\n return options;\n function S() {\n // every [n]\n ttr.expect('every');\n var n = ttr.acceptNumber();\n if (n)\n options.interval = parseInt(n[0], 10);\n if (ttr.isDone())\n throw new Error('Unexpected end');\n switch (ttr.symbol) {\n case 'day(s)':\n options.freq = RRule.DAILY;\n if (ttr.nextSymbol()) {\n AT();\n F();\n }\n break;\n // FIXME Note: every 2 weekdays != every two weeks on weekdays.\n // DAILY on weekdays is not a valid rule\n case 'weekday(s)':\n options.freq = RRule.WEEKLY;\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n ttr.nextSymbol();\n AT();\n F();\n break;\n case 'week(s)':\n options.freq = RRule.WEEKLY;\n if (ttr.nextSymbol()) {\n ON();\n AT();\n F();\n }\n break;\n case 'hour(s)':\n options.freq = RRule.HOURLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'minute(s)':\n options.freq = RRule.MINUTELY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'month(s)':\n options.freq = RRule.MONTHLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'year(s)':\n options.freq = RRule.YEARLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n options.freq = RRule.WEEKLY;\n var key = ttr.symbol\n .substr(0, 2)\n .toUpperCase();\n options.byweekday = [RRule[key]];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var wkd = decodeWKD();\n if (!wkd) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected weekday');\n }\n options.byweekday.push(RRule[wkd]);\n ttr.nextSymbol();\n }\n AT();\n MDAYs();\n F();\n break;\n case 'january':\n case 'february':\n case 'march':\n case 'april':\n case 'may':\n case 'june':\n case 'july':\n case 'august':\n case 'september':\n case 'october':\n case 'november':\n case 'december':\n options.freq = RRule.YEARLY;\n options.bymonth = [decodeM()];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var m = decodeM();\n if (!m) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected month');\n }\n options.bymonth.push(m);\n ttr.nextSymbol();\n }\n ON();\n F();\n break;\n default:\n throw new Error('Unknown symbol');\n }\n }\n function ON() {\n var on = ttr.accept('on');\n var the = ttr.accept('the');\n if (!(on || the))\n return;\n do {\n var nth = decodeNTH();\n var wkd = decodeWKD();\n var m = decodeM();\n // nth | \n if (nth) {\n // ttr.nextSymbol()\n if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd].nth(nth));\n }\n else {\n if (!options.bymonthday)\n options.bymonthday = [];\n options.bymonthday.push(nth);\n ttr.accept('day(s)');\n }\n // \n }\n else if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd]);\n }\n else if (ttr.symbol === 'weekday(s)') {\n ttr.nextSymbol();\n if (!options.byweekday) {\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n }\n }\n else if (ttr.symbol === 'week(s)') {\n ttr.nextSymbol();\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected week number');\n }\n options.byweekno = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.byweekno.push(parseInt(n[0], 10));\n }\n }\n else if (m) {\n ttr.nextSymbol();\n if (!options.bymonth)\n options.bymonth = [];\n options.bymonth.push(m);\n }\n else {\n return;\n }\n } while (ttr.accept('comma') || ttr.accept('the') || ttr.accept('on'));\n }\n function AT() {\n var at = ttr.accept('at');\n if (!at)\n return;\n do {\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected hour');\n }\n options.byhour = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected hour');\n }\n options.byhour.push(parseInt(n[0], 10));\n }\n } while (ttr.accept('comma') || ttr.accept('at'));\n }\n function decodeM() {\n switch (ttr.symbol) {\n case 'january':\n return 1;\n case 'february':\n return 2;\n case 'march':\n return 3;\n case 'april':\n return 4;\n case 'may':\n return 5;\n case 'june':\n return 6;\n case 'july':\n return 7;\n case 'august':\n return 8;\n case 'september':\n return 9;\n case 'october':\n return 10;\n case 'november':\n return 11;\n case 'december':\n return 12;\n default:\n return false;\n }\n }\n function decodeWKD() {\n switch (ttr.symbol) {\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n return ttr.symbol.substr(0, 2).toUpperCase();\n default:\n return false;\n }\n }\n function decodeNTH() {\n switch (ttr.symbol) {\n case 'last':\n ttr.nextSymbol();\n return -1;\n case 'first':\n ttr.nextSymbol();\n return 1;\n case 'second':\n ttr.nextSymbol();\n return ttr.accept('last') ? -2 : 2;\n case 'third':\n ttr.nextSymbol();\n return ttr.accept('last') ? -3 : 3;\n case 'nth':\n var v = parseInt(ttr.value[1], 10);\n if (v < -366 || v > 366)\n throw new Error('Nth out of range: ' + v);\n ttr.nextSymbol();\n return ttr.accept('last') ? -v : v;\n default:\n return false;\n }\n }\n function MDAYs() {\n ttr.accept('on');\n ttr.accept('the');\n var nth = decodeNTH();\n if (!nth)\n return;\n options.bymonthday = [nth];\n ttr.nextSymbol();\n while (ttr.accept('comma')) {\n nth = decodeNTH();\n if (!nth) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.bymonthday.push(nth);\n ttr.nextSymbol();\n }\n }\n function F() {\n if (ttr.symbol === 'until') {\n var date = Date.parse(ttr.text);\n if (!date)\n throw new Error('Cannot parse until date:' + ttr.text);\n options.until = new Date(date);\n }\n else if (ttr.accept('for')) {\n options.count = parseInt(ttr.value[0], 10);\n ttr.expect('number');\n // ttr.expect('times')\n }\n }\n}\n//# sourceMappingURL=parsetext.js.map","import ToText from './totext';\nimport parseText from './parsetext';\nimport { RRule } from '../rrule';\nimport { Frequency } from '../types';\nimport ENGLISH from './i18n';\n/* !\n * rrule.js - Library for working with recurrence rules for calendar dates.\n * https://github.com/jakubroztocil/rrule\n *\n * Copyright 2010, Jakub Roztocil and Lars Schoning\n * Licenced under the BSD licence.\n * https://github.com/jakubroztocil/rrule/blob/master/LICENCE\n *\n */\n/**\n *\n * Implementation of RRule.fromText() and RRule::toText().\n *\n *\n * On the client side, this file needs to be included\n * when those functions are used.\n *\n */\n// =============================================================================\n// fromText\n// =============================================================================\n/**\n * Will be able to convert some of the below described rules from\n * text format to a rule object.\n *\n *\n * RULES\n *\n * Every ([n])\n * day(s)\n * | [weekday], ..., (and) [weekday]\n * | weekday(s)\n * | week(s)\n * | month(s)\n * | [month], ..., (and) [month]\n * | year(s)\n *\n *\n * Plus 0, 1, or multiple of these:\n *\n * on [weekday], ..., (or) [weekday] the [monthday], [monthday], ... (or) [monthday]\n *\n * on [weekday], ..., (and) [weekday]\n *\n * on the [monthday], [monthday], ... (and) [monthday] (day of the month)\n *\n * on the [nth-weekday], ..., (and) [nth-weekday] (of the month/year)\n *\n *\n * Plus 0 or 1 of these:\n *\n * for [n] time(s)\n *\n * until [date]\n *\n * Plus (.)\n *\n *\n * Definitely no supported for parsing:\n *\n * (for year):\n * in week(s) [n], ..., (and) [n]\n *\n * on the [yearday], ..., (and) [n] day of the year\n * on day [yearday], ..., (and) [n]\n *\n *\n * NON-TERMINALS\n *\n * [n]: 1, 2 ..., one, two, three ..\n * [month]: January, February, March, April, May, ... December\n * [weekday]: Monday, ... Sunday\n * [nth-weekday]: first [weekday], 2nd [weekday], ... last [weekday], ...\n * [monthday]: first, 1., 2., 1st, 2nd, second, ... 31st, last day, 2nd last day, ..\n * [date]:\n * - [month] (0-31(,) ([year])),\n * - (the) 0-31.(1-12.([year])),\n * - (the) 0-31/(1-12/([year])),\n * - [weekday]\n *\n * [year]: 0000, 0001, ... 01, 02, ..\n *\n * Definitely not supported for parsing:\n *\n * [yearday]: first, 1., 2., 1st, 2nd, second, ... 366th, last day, 2nd last day, ..\n *\n * @param {String} text\n * @return {Object, Boolean} the rule, or null.\n */\nvar fromText = function (text, language) {\n if (language === void 0) { language = ENGLISH; }\n return new RRule(parseText(text, language) || undefined);\n};\nvar common = [\n 'count',\n 'until',\n 'interval',\n 'byweekday',\n 'bymonthday',\n 'bymonth',\n];\nToText.IMPLEMENTED = [];\nToText.IMPLEMENTED[Frequency.HOURLY] = common;\nToText.IMPLEMENTED[Frequency.MINUTELY] = common;\nToText.IMPLEMENTED[Frequency.DAILY] = ['byhour'].concat(common);\nToText.IMPLEMENTED[Frequency.WEEKLY] = common;\nToText.IMPLEMENTED[Frequency.MONTHLY] = common;\nToText.IMPLEMENTED[Frequency.YEARLY] = ['byweekno', 'byyearday'].concat(common);\n// =============================================================================\n// Export\n// =============================================================================\nvar toText = function (rrule, gettext, language, dateFormatter) {\n return new ToText(rrule, gettext, language, dateFormatter).toString();\n};\nvar isFullyConvertible = ToText.isFullyConvertible;\nexport { fromText, parseText, isFullyConvertible, toText };\n//# sourceMappingURL=index.js.map","import { __extends } from \"tslib\";\nimport { Frequency } from './types';\nimport { pymod, divmod, empty, includes } from './helpers';\nimport { getWeekday, MAXYEAR, monthRange } from './dateutil';\nvar Time = /** @class */ (function () {\n function Time(hour, minute, second, millisecond) {\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond || 0;\n }\n Time.prototype.getHours = function () {\n return this.hour;\n };\n Time.prototype.getMinutes = function () {\n return this.minute;\n };\n Time.prototype.getSeconds = function () {\n return this.second;\n };\n Time.prototype.getMilliseconds = function () {\n return this.millisecond;\n };\n Time.prototype.getTime = function () {\n return ((this.hour * 60 * 60 + this.minute * 60 + this.second) * 1000 +\n this.millisecond);\n };\n return Time;\n}());\nexport { Time };\nvar DateTime = /** @class */ (function (_super) {\n __extends(DateTime, _super);\n function DateTime(year, month, day, hour, minute, second, millisecond) {\n var _this = _super.call(this, hour, minute, second, millisecond) || this;\n _this.year = year;\n _this.month = month;\n _this.day = day;\n return _this;\n }\n DateTime.fromDate = function (date) {\n return new this(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.valueOf() % 1000);\n };\n DateTime.prototype.getWeekday = function () {\n return getWeekday(new Date(this.getTime()));\n };\n DateTime.prototype.getTime = function () {\n return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime();\n };\n DateTime.prototype.getDay = function () {\n return this.day;\n };\n DateTime.prototype.getMonth = function () {\n return this.month;\n };\n DateTime.prototype.getYear = function () {\n return this.year;\n };\n DateTime.prototype.addYears = function (years) {\n this.year += years;\n };\n DateTime.prototype.addMonths = function (months) {\n this.month += months;\n if (this.month > 12) {\n var yearDiv = Math.floor(this.month / 12);\n var monthMod = pymod(this.month, 12);\n this.month = monthMod;\n this.year += yearDiv;\n if (this.month === 0) {\n this.month = 12;\n --this.year;\n }\n }\n };\n DateTime.prototype.addWeekly = function (days, wkst) {\n if (wkst > this.getWeekday()) {\n this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7;\n }\n else {\n this.day += -(this.getWeekday() - wkst) + days * 7;\n }\n this.fixDay();\n };\n DateTime.prototype.addDaily = function (days) {\n this.day += days;\n this.fixDay();\n };\n DateTime.prototype.addHours = function (hours, filtered, byhour) {\n if (filtered) {\n // Jump to one iteration before next day\n this.hour += Math.floor((23 - this.hour) / hours) * hours;\n }\n for (;;) {\n this.hour += hours;\n var _a = divmod(this.hour, 24), dayDiv = _a.div, hourMod = _a.mod;\n if (dayDiv) {\n this.hour = hourMod;\n this.addDaily(dayDiv);\n }\n if (empty(byhour) || includes(byhour, this.hour))\n break;\n }\n };\n DateTime.prototype.addMinutes = function (minutes, filtered, byhour, byminute) {\n if (filtered) {\n // Jump to one iteration before next day\n this.minute +=\n Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes;\n }\n for (;;) {\n this.minute += minutes;\n var _a = divmod(this.minute, 60), hourDiv = _a.div, minuteMod = _a.mod;\n if (hourDiv) {\n this.minute = minuteMod;\n this.addHours(hourDiv, false, byhour);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute))) {\n break;\n }\n }\n };\n DateTime.prototype.addSeconds = function (seconds, filtered, byhour, byminute, bysecond) {\n if (filtered) {\n // Jump to one iteration before next day\n this.second +=\n Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) /\n seconds) * seconds;\n }\n for (;;) {\n this.second += seconds;\n var _a = divmod(this.second, 60), minuteDiv = _a.div, secondMod = _a.mod;\n if (minuteDiv) {\n this.second = secondMod;\n this.addMinutes(minuteDiv, false, byhour, byminute);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute)) &&\n (empty(bysecond) || includes(bysecond, this.second))) {\n break;\n }\n }\n };\n DateTime.prototype.fixDay = function () {\n if (this.day <= 28) {\n return;\n }\n var daysinmonth = monthRange(this.year, this.month - 1)[1];\n if (this.day <= daysinmonth) {\n return;\n }\n while (this.day > daysinmonth) {\n this.day -= daysinmonth;\n ++this.month;\n if (this.month === 13) {\n this.month = 1;\n ++this.year;\n if (this.year > MAXYEAR) {\n return;\n }\n }\n daysinmonth = monthRange(this.year, this.month - 1)[1];\n }\n };\n DateTime.prototype.add = function (options, filtered) {\n var freq = options.freq, interval = options.interval, wkst = options.wkst, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n switch (freq) {\n case Frequency.YEARLY:\n return this.addYears(interval);\n case Frequency.MONTHLY:\n return this.addMonths(interval);\n case Frequency.WEEKLY:\n return this.addWeekly(interval, wkst);\n case Frequency.DAILY:\n return this.addDaily(interval);\n case Frequency.HOURLY:\n return this.addHours(interval, filtered, byhour);\n case Frequency.MINUTELY:\n return this.addMinutes(interval, filtered, byhour, byminute);\n case Frequency.SECONDLY:\n return this.addSeconds(interval, filtered, byhour, byminute, bysecond);\n }\n };\n return DateTime;\n}(Time));\nexport { DateTime };\n//# sourceMappingURL=datetime.js.map","import { __assign } from \"tslib\";\nimport { freqIsDailyOrGreater } from './types';\nimport { includes, notEmpty, isPresent, isNumber, isArray, isWeekdayStr, } from './helpers';\nimport { RRule, defaultKeys, DEFAULT_OPTIONS } from './rrule';\nimport { getWeekday, isDate, isValidDate } from './dateutil';\nimport { Weekday } from './weekday';\nimport { Time } from './datetime';\nexport function initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n // Shallow copy for options and origOptions and check for invalid\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (!includes(defaultKeys, key))\n invalid.push(key);\n if (isDate(options[key]) && !isValidDate(options[key])) {\n invalid.push(key);\n }\n }\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign({}, options);\n}\nexport function parseOptions(options) {\n var opts = __assign(__assign({}, DEFAULT_OPTIONS), initializeOptions(options));\n if (isPresent(opts.byeaster))\n opts.freq = RRule.YEARLY;\n if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) {\n throw new Error(\"Invalid frequency: \".concat(opts.freq, \" \").concat(options.freq));\n }\n if (!opts.dtstart)\n opts.dtstart = new Date(new Date().setMilliseconds(0));\n if (!isPresent(opts.wkst)) {\n opts.wkst = RRule.MO.weekday;\n }\n else if (isNumber(opts.wkst)) {\n // cool, just keep it like that\n }\n else {\n opts.wkst = opts.wkst.weekday;\n }\n if (isPresent(opts.bysetpos)) {\n if (isNumber(opts.bysetpos))\n opts.bysetpos = [opts.bysetpos];\n for (var i = 0; i < opts.bysetpos.length; i++) {\n var v = opts.bysetpos[i];\n if (v === 0 || !(v >= -366 && v <= 366)) {\n throw new Error('bysetpos must be between 1 and 366,' + ' or between -366 and -1');\n }\n }\n }\n if (!(Boolean(opts.byweekno) ||\n notEmpty(opts.byweekno) ||\n notEmpty(opts.byyearday) ||\n Boolean(opts.bymonthday) ||\n notEmpty(opts.bymonthday) ||\n isPresent(opts.byweekday) ||\n isPresent(opts.byeaster))) {\n switch (opts.freq) {\n case RRule.YEARLY:\n if (!opts.bymonth)\n opts.bymonth = opts.dtstart.getUTCMonth() + 1;\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.MONTHLY:\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.WEEKLY:\n opts.byweekday = [getWeekday(opts.dtstart)];\n break;\n }\n }\n // bymonth\n if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) {\n opts.bymonth = [opts.bymonth];\n }\n // byyearday\n if (isPresent(opts.byyearday) &&\n !isArray(opts.byyearday) &&\n isNumber(opts.byyearday)) {\n opts.byyearday = [opts.byyearday];\n }\n // bymonthday\n if (!isPresent(opts.bymonthday)) {\n opts.bymonthday = [];\n opts.bynmonthday = [];\n }\n else if (isArray(opts.bymonthday)) {\n var bymonthday = [];\n var bynmonthday = [];\n for (var i = 0; i < opts.bymonthday.length; i++) {\n var v = opts.bymonthday[i];\n if (v > 0) {\n bymonthday.push(v);\n }\n else if (v < 0) {\n bynmonthday.push(v);\n }\n }\n opts.bymonthday = bymonthday;\n opts.bynmonthday = bynmonthday;\n }\n else if (opts.bymonthday < 0) {\n opts.bynmonthday = [opts.bymonthday];\n opts.bymonthday = [];\n }\n else {\n opts.bynmonthday = [];\n opts.bymonthday = [opts.bymonthday];\n }\n // byweekno\n if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) {\n opts.byweekno = [opts.byweekno];\n }\n // byweekday / bynweekday\n if (!isPresent(opts.byweekday)) {\n opts.bynweekday = null;\n }\n else if (isNumber(opts.byweekday)) {\n opts.byweekday = [opts.byweekday];\n opts.bynweekday = null;\n }\n else if (isWeekdayStr(opts.byweekday)) {\n opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday];\n opts.bynweekday = null;\n }\n else if (opts.byweekday instanceof Weekday) {\n if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) {\n opts.byweekday = [opts.byweekday.weekday];\n opts.bynweekday = null;\n }\n else {\n opts.bynweekday = [[opts.byweekday.weekday, opts.byweekday.n]];\n opts.byweekday = null;\n }\n }\n else {\n var byweekday = [];\n var bynweekday = [];\n for (var i = 0; i < opts.byweekday.length; i++) {\n var wday = opts.byweekday[i];\n if (isNumber(wday)) {\n byweekday.push(wday);\n continue;\n }\n else if (isWeekdayStr(wday)) {\n byweekday.push(Weekday.fromStr(wday).weekday);\n continue;\n }\n if (!wday.n || opts.freq > RRule.MONTHLY) {\n byweekday.push(wday.weekday);\n }\n else {\n bynweekday.push([wday.weekday, wday.n]);\n }\n }\n opts.byweekday = notEmpty(byweekday) ? byweekday : null;\n opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null;\n }\n // byhour\n if (!isPresent(opts.byhour)) {\n opts.byhour = opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null;\n }\n else if (isNumber(opts.byhour)) {\n opts.byhour = [opts.byhour];\n }\n // byminute\n if (!isPresent(opts.byminute)) {\n opts.byminute =\n opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null;\n }\n else if (isNumber(opts.byminute)) {\n opts.byminute = [opts.byminute];\n }\n // bysecond\n if (!isPresent(opts.bysecond)) {\n opts.bysecond =\n opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null;\n }\n else if (isNumber(opts.bysecond)) {\n opts.bysecond = [opts.bysecond];\n }\n return { parsedOptions: opts };\n}\nexport function buildTimeset(opts) {\n var millisecondModulo = opts.dtstart.getTime() % 1000;\n if (!freqIsDailyOrGreater(opts.freq)) {\n return [];\n }\n var timeset = [];\n opts.byhour.forEach(function (hour) {\n opts.byminute.forEach(function (minute) {\n opts.bysecond.forEach(function (second) {\n timeset.push(new Time(hour, minute, second, millisecondModulo));\n });\n });\n });\n return timeset;\n}\n//# sourceMappingURL=parseoptions.js.map","import { __assign } from \"tslib\";\nimport { Frequency } from './types';\nimport { Weekday } from './weekday';\nimport { untilStringToDate } from './dateutil';\nimport { Days } from './rrule';\nexport function parseString(rfcString) {\n var options = rfcString\n .split('\\n')\n .map(parseLine)\n .filter(function (x) { return x !== null; });\n return __assign(__assign({}, options[0]), options[1]);\n}\nexport function parseDtstart(line) {\n var options = {};\n var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\\s]+)/i.exec(line);\n if (!dtstartWithZone) {\n return options;\n }\n var tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2];\n if (tzid) {\n options.tzid = tzid;\n }\n options.dtstart = untilStringToDate(dtstart);\n return options;\n}\nfunction parseLine(rfcString) {\n rfcString = rfcString.replace(/^\\s+|\\s+$/, '');\n if (!rfcString.length)\n return null;\n var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase());\n if (!header) {\n return parseRrule(rfcString);\n }\n var key = header[1];\n switch (key.toUpperCase()) {\n case 'RRULE':\n case 'EXRULE':\n return parseRrule(rfcString);\n case 'DTSTART':\n return parseDtstart(rfcString);\n default:\n throw new Error(\"Unsupported RFC prop \".concat(key, \" in \").concat(rfcString));\n }\n}\nfunction parseRrule(line) {\n var strippedLine = line.replace(/^RRULE:/i, '');\n var options = parseDtstart(strippedLine);\n var attrs = line.replace(/^(?:RRULE|EXRULE):/i, '').split(';');\n attrs.forEach(function (attr) {\n var _a = attr.split('='), key = _a[0], value = _a[1];\n switch (key.toUpperCase()) {\n case 'FREQ':\n options.freq = Frequency[value.toUpperCase()];\n break;\n case 'WKST':\n options.wkst = Days[value.toUpperCase()];\n break;\n case 'COUNT':\n case 'INTERVAL':\n case 'BYSETPOS':\n case 'BYMONTH':\n case 'BYMONTHDAY':\n case 'BYYEARDAY':\n case 'BYWEEKNO':\n case 'BYHOUR':\n case 'BYMINUTE':\n case 'BYSECOND':\n var num = parseNumber(value);\n var optionKey = key.toLowerCase();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n options[optionKey] = num;\n break;\n case 'BYWEEKDAY':\n case 'BYDAY':\n options.byweekday = parseWeekday(value);\n break;\n case 'DTSTART':\n case 'TZID':\n // for backwards compatibility\n var dtstart = parseDtstart(line);\n options.tzid = dtstart.tzid;\n options.dtstart = dtstart.dtstart;\n break;\n case 'UNTIL':\n options.until = untilStringToDate(value);\n break;\n case 'BYEASTER':\n options.byeaster = Number(value);\n break;\n default:\n throw new Error(\"Unknown RRULE property '\" + key + \"'\");\n }\n });\n return options;\n}\nfunction parseNumber(value) {\n if (value.indexOf(',') !== -1) {\n var values = value.split(',');\n return values.map(parseIndividualNumber);\n }\n return parseIndividualNumber(value);\n}\nfunction parseIndividualNumber(value) {\n if (/^[+-]?\\d+$/.test(value)) {\n return Number(value);\n }\n return value;\n}\nfunction parseWeekday(value) {\n var days = value.split(',');\n return days.map(function (day) {\n if (day.length === 2) {\n // MO, TU, ...\n return Days[day]; // wday instanceof Weekday\n }\n // -1MO, +3FR, 1SO, 13TU ...\n var parts = day.match(/^([+-]?\\d{1,2})([A-Z]{2})$/);\n if (!parts || parts.length < 3) {\n throw new SyntaxError(\"Invalid weekday string: \".concat(day));\n }\n var n = Number(parts[1]);\n var wdaypart = parts[2];\n var wday = Days[wdaypart].weekday;\n return new Weekday(wday, n);\n });\n}\n//# sourceMappingURL=parsestring.js.map","import { dateInTimeZone, timeToUntilString } from './dateutil';\nvar DateWithZone = /** @class */ (function () {\n function DateWithZone(date, tzid) {\n if (isNaN(date.getTime())) {\n throw new RangeError('Invalid date passed to DateWithZone');\n }\n this.date = date;\n this.tzid = tzid;\n }\n Object.defineProperty(DateWithZone.prototype, \"isUTC\", {\n get: function () {\n return !this.tzid || this.tzid.toUpperCase() === 'UTC';\n },\n enumerable: false,\n configurable: true\n });\n DateWithZone.prototype.toString = function () {\n var datestr = timeToUntilString(this.date.getTime(), this.isUTC);\n if (!this.isUTC) {\n return \";TZID=\".concat(this.tzid, \":\").concat(datestr);\n }\n return \":\".concat(datestr);\n };\n DateWithZone.prototype.getTime = function () {\n return this.date.getTime();\n };\n DateWithZone.prototype.rezonedDate = function () {\n if (this.isUTC) {\n return this.date;\n }\n return dateInTimeZone(this.date, this.tzid);\n };\n return DateWithZone;\n}());\nexport { DateWithZone };\n//# sourceMappingURL=datewithzone.js.map","import { RRule, DEFAULT_OPTIONS } from './rrule';\nimport { includes, isPresent, isArray, isNumber, toArray } from './helpers';\nimport { Weekday } from './weekday';\nimport { timeToUntilString } from './dateutil';\nimport { DateWithZone } from './datewithzone';\nexport function optionsToString(options) {\n var rrule = [];\n var dtstart = '';\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === 'tzid')\n continue;\n if (!includes(defaultKeys, keys[i]))\n continue;\n var key = keys[i].toUpperCase();\n var value = options[keys[i]];\n var outValue = '';\n if (!isPresent(value) || (isArray(value) && !value.length))\n continue;\n switch (key) {\n case 'FREQ':\n outValue = RRule.FREQUENCIES[options.freq];\n break;\n case 'WKST':\n if (isNumber(value)) {\n outValue = new Weekday(value).toString();\n }\n else {\n outValue = value.toString();\n }\n break;\n case 'BYWEEKDAY':\n /*\n NOTE: BYWEEKDAY is a special case.\n RRule() deconstructs the rule.options.byweekday array\n into an array of Weekday arguments.\n On the other hand, rule.origOptions is an array of Weekdays.\n We need to handle both cases here.\n It might be worth change RRule to keep the Weekdays.\n \n Also, BYWEEKDAY (used by RRule) vs. BYDAY (RFC)\n \n */\n key = 'BYDAY';\n outValue = toArray(value)\n .map(function (wday) {\n if (wday instanceof Weekday) {\n return wday;\n }\n if (isArray(wday)) {\n return new Weekday(wday[0], wday[1]);\n }\n return new Weekday(wday);\n })\n .toString();\n break;\n case 'DTSTART':\n dtstart = buildDtstart(value, options.tzid);\n break;\n case 'UNTIL':\n outValue = timeToUntilString(value, !options.tzid);\n break;\n default:\n if (isArray(value)) {\n var strValues = [];\n for (var j = 0; j < value.length; j++) {\n strValues[j] = String(value[j]);\n }\n outValue = strValues.toString();\n }\n else {\n outValue = String(value);\n }\n }\n if (outValue) {\n rrule.push([key, outValue]);\n }\n }\n var rules = rrule\n .map(function (_a) {\n var key = _a[0], value = _a[1];\n return \"\".concat(key, \"=\").concat(value.toString());\n })\n .join(';');\n var ruleString = '';\n if (rules !== '') {\n ruleString = \"RRULE:\".concat(rules);\n }\n return [dtstart, ruleString].filter(function (x) { return !!x; }).join('\\n');\n}\nfunction buildDtstart(dtstart, tzid) {\n if (!dtstart) {\n return '';\n }\n return 'DTSTART' + new DateWithZone(new Date(dtstart), tzid).toString();\n}\n//# sourceMappingURL=optionstostring.js.map","import IterResult from './iterresult';\nimport { clone, cloneDates } from './dateutil';\nimport { isArray } from './helpers';\nfunction argsMatch(left, right) {\n if (Array.isArray(left)) {\n if (!Array.isArray(right))\n return false;\n if (left.length !== right.length)\n return false;\n return left.every(function (date, i) { return date.getTime() === right[i].getTime(); });\n }\n if (left instanceof Date) {\n return right instanceof Date && left.getTime() === right.getTime();\n }\n return left === right;\n}\nvar Cache = /** @class */ (function () {\n function Cache() {\n this.all = false;\n this.before = [];\n this.after = [];\n this.between = [];\n }\n /**\n * @param {String} what - all/before/after/between\n * @param {Array,Date} value - an array of dates, one date, or null\n * @param {Object?} args - _iter arguments\n */\n Cache.prototype._cacheAdd = function (what, value, args) {\n if (value) {\n value = value instanceof Date ? clone(value) : cloneDates(value);\n }\n if (what === 'all') {\n this.all = value;\n }\n else {\n args._value = value;\n this[what].push(args);\n }\n };\n /**\n * @return false - not in the cache\n * @return null - cached, but zero occurrences (before/after)\n * @return Date - cached (before/after)\n * @return [] - cached, but zero occurrences (all/between)\n * @return [Date1, DateN] - cached (all/between)\n */\n Cache.prototype._cacheGet = function (what, args) {\n var cached = false;\n var argsKeys = args ? Object.keys(args) : [];\n var findCacheDiff = function (item) {\n for (var i = 0; i < argsKeys.length; i++) {\n var key = argsKeys[i];\n if (!argsMatch(args[key], item[key])) {\n return true;\n }\n }\n return false;\n };\n var cachedObject = this[what];\n if (what === 'all') {\n cached = this.all;\n }\n else if (isArray(cachedObject)) {\n // Let's see whether we've already called the\n // 'what' method with the same 'args'\n for (var i = 0; i < cachedObject.length; i++) {\n var item = cachedObject[i];\n if (argsKeys.length && findCacheDiff(item))\n continue;\n cached = item._value;\n break;\n }\n }\n if (!cached && this.all) {\n // Not in the cache, but we already know all the occurrences,\n // so we can find the correct dates from the cached ones.\n var iterResult = new IterResult(what, args);\n for (var i = 0; i < this.all.length; i++) {\n if (!iterResult.accept(this.all[i]))\n break;\n }\n cached = iterResult.getValue();\n this._cacheAdd(what, cached, args);\n }\n return isArray(cached)\n ? cloneDates(cached)\n : cached instanceof Date\n ? clone(cached)\n : cached;\n };\n return Cache;\n}());\nexport { Cache };\n//# sourceMappingURL=cache.js.map","import { __spreadArray } from \"tslib\";\nimport { range, repeat } from './helpers';\n// =============================================================================\n// Date masks\n// =============================================================================\n// Every mask is 7 days longer to handle cross-year weekly periods.\nvar M365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 28), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 29), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M28 = range(1, 29);\nvar M29 = range(1, 30);\nvar M30 = range(1, 31);\nvar M31 = range(1, 32);\nvar MDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M29, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar MDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M28, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar NM28 = range(-28, 0);\nvar NM29 = range(-29, 0);\nvar NM30 = range(-30, 0);\nvar NM31 = range(-31, 0);\nvar NMDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM29, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar NMDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM28, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366];\nvar M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];\nvar WDAYMASK = (function () {\n var wdaymask = [];\n for (var i = 0; i < 55; i++)\n wdaymask = wdaymask.concat(range(7));\n return wdaymask;\n})();\nexport { WDAYMASK, M365MASK, M365RANGE, M366MASK, M366RANGE, MDAY365MASK, MDAY366MASK, NMDAY365MASK, NMDAY366MASK, };\n//# sourceMappingURL=masks.js.map","import { __assign } from \"tslib\";\nimport { datetime, getWeekday, isLeapYear, toOrdinal } from '../dateutil';\nimport { empty, repeat, pymod, includes } from '../helpers';\nimport { M365MASK, MDAY365MASK, NMDAY365MASK, WDAYMASK, M365RANGE, M366MASK, MDAY366MASK, NMDAY366MASK, M366RANGE, } from '../masks';\nexport function rebuildYear(year, options) {\n var firstyday = datetime(year, 1, 1);\n var yearlen = isLeapYear(year) ? 366 : 365;\n var nextyearlen = isLeapYear(year + 1) ? 366 : 365;\n var yearordinal = toOrdinal(firstyday);\n var yearweekday = getWeekday(firstyday);\n var result = __assign(__assign({ yearlen: yearlen, nextyearlen: nextyearlen, yearordinal: yearordinal, yearweekday: yearweekday }, baseYearMasks(year)), { wnomask: null });\n if (empty(options.byweekno)) {\n return result;\n }\n result.wnomask = repeat(0, yearlen + 7);\n var firstwkst;\n var wyearlen;\n var no1wkst = (firstwkst = pymod(7 - yearweekday + options.wkst, 7));\n if (no1wkst >= 4) {\n no1wkst = 0;\n // Number of days in the year, plus the days we got\n // from last year.\n wyearlen = result.yearlen + pymod(yearweekday - options.wkst, 7);\n }\n else {\n // Number of days in the year, minus the days we\n // left in last year.\n wyearlen = yearlen - no1wkst;\n }\n var div = Math.floor(wyearlen / 7);\n var mod = pymod(wyearlen, 7);\n var numweeks = Math.floor(div + mod / 4);\n for (var j = 0; j < options.byweekno.length; j++) {\n var n = options.byweekno[j];\n if (n < 0) {\n n += numweeks + 1;\n }\n if (!(n > 0 && n <= numweeks)) {\n continue;\n }\n var i = void 0;\n if (n > 1) {\n i = no1wkst + (n - 1) * 7;\n if (no1wkst !== firstwkst) {\n i -= 7 - firstwkst;\n }\n }\n else {\n i = no1wkst;\n }\n for (var k = 0; k < 7; k++) {\n result.wnomask[i] = 1;\n i++;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n if (includes(options.byweekno, 1)) {\n // Check week number 1 of next year as well\n // orig-TODO : Check -numweeks for next year.\n var i = no1wkst + numweeks * 7;\n if (no1wkst !== firstwkst)\n i -= 7 - firstwkst;\n if (i < yearlen) {\n // If week starts in next year, we\n // don't care about it.\n for (var j = 0; j < 7; j++) {\n result.wnomask[i] = 1;\n i += 1;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n }\n if (no1wkst) {\n // Check last week number of last year as\n // well. If no1wkst is 0, either the year\n // started on week start, or week number 1\n // got days from last year, so there are no\n // days from last year's last week number in\n // this year.\n var lnumweeks = void 0;\n if (!includes(options.byweekno, -1)) {\n var lyearweekday = getWeekday(datetime(year - 1, 1, 1));\n var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7);\n var lyearlen = isLeapYear(year - 1) ? 366 : 365;\n var weekst = void 0;\n if (lno1wkst >= 4) {\n lno1wkst = 0;\n weekst = lyearlen + pymod(lyearweekday - options.wkst, 7);\n }\n else {\n weekst = yearlen - no1wkst;\n }\n lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4);\n }\n else {\n lnumweeks = -1;\n }\n if (includes(options.byweekno, lnumweeks)) {\n for (var i = 0; i < no1wkst; i++)\n result.wnomask[i] = 1;\n }\n }\n return result;\n}\nfunction baseYearMasks(year) {\n var yearlen = isLeapYear(year) ? 366 : 365;\n var firstyday = datetime(year, 1, 1);\n var wday = getWeekday(firstyday);\n if (yearlen === 365) {\n return {\n mmask: M365MASK,\n mdaymask: MDAY365MASK,\n nmdaymask: NMDAY365MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M365RANGE,\n };\n }\n return {\n mmask: M366MASK,\n mdaymask: MDAY366MASK,\n nmdaymask: NMDAY366MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M366RANGE,\n };\n}\n//# sourceMappingURL=yearinfo.js.map","import { notEmpty, repeat, range, isPresent } from '../helpers';\nimport { Frequency } from '../types';\nimport { rebuildYear } from './yearinfo';\nimport { rebuildMonth } from './monthinfo';\nimport { easter } from './easter';\nimport { Time } from '../datetime';\nimport { datetime, sort, toOrdinal } from '../dateutil';\n// =============================================================================\n// Iterinfo\n// =============================================================================\nvar Iterinfo = /** @class */ (function () {\n // eslint-disable-next-line no-empty-function\n function Iterinfo(options) {\n this.options = options;\n }\n Iterinfo.prototype.rebuild = function (year, month) {\n var options = this.options;\n if (year !== this.lastyear) {\n this.yearinfo = rebuildYear(year, options);\n }\n if (notEmpty(options.bynweekday) &&\n (month !== this.lastmonth || year !== this.lastyear)) {\n var _a = this.yearinfo, yearlen = _a.yearlen, mrange = _a.mrange, wdaymask = _a.wdaymask;\n this.monthinfo = rebuildMonth(year, month, yearlen, mrange, wdaymask, options);\n }\n if (isPresent(options.byeaster)) {\n this.eastermask = easter(year, options.byeaster);\n }\n };\n Object.defineProperty(Iterinfo.prototype, \"lastyear\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastyear : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"lastmonth\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastmonth : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearlen\", {\n get: function () {\n return this.yearinfo.yearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearordinal\", {\n get: function () {\n return this.yearinfo.yearordinal;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mrange\", {\n get: function () {\n return this.yearinfo.mrange;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wdaymask\", {\n get: function () {\n return this.yearinfo.wdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mmask\", {\n get: function () {\n return this.yearinfo.mmask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wnomask\", {\n get: function () {\n return this.yearinfo.wnomask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nwdaymask\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.nwdaymask : [];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nextyearlen\", {\n get: function () {\n return this.yearinfo.nextyearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mdaymask\", {\n get: function () {\n return this.yearinfo.mdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nmdaymask\", {\n get: function () {\n return this.yearinfo.nmdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Iterinfo.prototype.ydayset = function () {\n return [range(this.yearlen), 0, this.yearlen];\n };\n Iterinfo.prototype.mdayset = function (_, month) {\n var start = this.mrange[month - 1];\n var end = this.mrange[month];\n var set = repeat(null, this.yearlen);\n for (var i = start; i < end; i++)\n set[i] = i;\n return [set, start, end];\n };\n Iterinfo.prototype.wdayset = function (year, month, day) {\n // We need to handle cross-year weeks here.\n var set = repeat(null, this.yearlen + 7);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n var start = i;\n for (var j = 0; j < 7; j++) {\n set[i] = i;\n ++i;\n if (this.wdaymask[i] === this.options.wkst)\n break;\n }\n return [set, start, i];\n };\n Iterinfo.prototype.ddayset = function (year, month, day) {\n var set = repeat(null, this.yearlen);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n set[i] = i;\n return [set, i, i + 1];\n };\n Iterinfo.prototype.htimeset = function (hour, _, second, millisecond) {\n var _this = this;\n var set = [];\n this.options.byminute.forEach(function (minute) {\n set = set.concat(_this.mtimeset(hour, minute, second, millisecond));\n });\n sort(set);\n return set;\n };\n Iterinfo.prototype.mtimeset = function (hour, minute, _, millisecond) {\n var set = this.options.bysecond.map(function (second) { return new Time(hour, minute, second, millisecond); });\n sort(set);\n return set;\n };\n Iterinfo.prototype.stimeset = function (hour, minute, second, millisecond) {\n return [new Time(hour, minute, second, millisecond)];\n };\n Iterinfo.prototype.getdayset = function (freq) {\n switch (freq) {\n case Frequency.YEARLY:\n return this.ydayset.bind(this);\n case Frequency.MONTHLY:\n return this.mdayset.bind(this);\n case Frequency.WEEKLY:\n return this.wdayset.bind(this);\n case Frequency.DAILY:\n return this.ddayset.bind(this);\n default:\n return this.ddayset.bind(this);\n }\n };\n Iterinfo.prototype.gettimeset = function (freq) {\n switch (freq) {\n case Frequency.HOURLY:\n return this.htimeset.bind(this);\n case Frequency.MINUTELY:\n return this.mtimeset.bind(this);\n case Frequency.SECONDLY:\n return this.stimeset.bind(this);\n }\n };\n return Iterinfo;\n}());\nexport default Iterinfo;\n//# sourceMappingURL=index.js.map","import { RRule } from '../rrule';\nimport { empty, repeat, pymod } from '../helpers';\nexport function rebuildMonth(year, month, yearlen, mrange, wdaymask, options) {\n var result = {\n lastyear: year,\n lastmonth: month,\n nwdaymask: [],\n };\n var ranges = [];\n if (options.freq === RRule.YEARLY) {\n if (empty(options.bymonth)) {\n ranges = [[0, yearlen]];\n }\n else {\n for (var j = 0; j < options.bymonth.length; j++) {\n month = options.bymonth[j];\n ranges.push(mrange.slice(month - 1, month + 1));\n }\n }\n }\n else if (options.freq === RRule.MONTHLY) {\n ranges = [mrange.slice(month - 1, month + 1)];\n }\n if (empty(ranges)) {\n return result;\n }\n // Weekly frequency won't get here, so we may not\n // care about cross-year weekly periods.\n result.nwdaymask = repeat(0, yearlen);\n for (var j = 0; j < ranges.length; j++) {\n var rang = ranges[j];\n var first = rang[0];\n var last = rang[1] - 1;\n for (var k = 0; k < options.bynweekday.length; k++) {\n var i = void 0;\n var _a = options.bynweekday[k], wday = _a[0], n = _a[1];\n if (n < 0) {\n i = last + (n + 1) * 7;\n i -= pymod(wdaymask[i] - wday, 7);\n }\n else {\n i = first + (n - 1) * 7;\n i += pymod(7 - wdaymask[i] + wday, 7);\n }\n if (first <= i && i <= last)\n result.nwdaymask[i] = 1;\n }\n }\n return result;\n}\n//# sourceMappingURL=monthinfo.js.map","export function easter(y, offset) {\n if (offset === void 0) { offset = 0; }\n var a = y % 19;\n var b = Math.floor(y / 100);\n var c = y % 100;\n var d = Math.floor(b / 4);\n var e = b % 4;\n var f = Math.floor((b + 8) / 25);\n var g = Math.floor((b - f + 1) / 3);\n var h = Math.floor(19 * a + b - d - g + 15) % 30;\n var i = Math.floor(c / 4);\n var k = c % 4;\n var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7;\n var m = Math.floor((a + 11 * h + 22 * l) / 451);\n var month = Math.floor((h + l - 7 * m + 114) / 31);\n var day = ((h + l - 7 * m + 114) % 31) + 1;\n var date = Date.UTC(y, month - 1, day + offset);\n var yearStart = Date.UTC(y, 0, 1);\n return [Math.ceil((date - yearStart) / (1000 * 60 * 60 * 24))];\n}\n//# sourceMappingURL=easter.js.map","import { combine, fromOrdinal, sort } from '../dateutil';\nimport { pymod, isPresent, includes } from '../helpers';\nexport function buildPoslist(bysetpos, timeset, start, end, ii, dayset) {\n var poslist = [];\n for (var j = 0; j < bysetpos.length; j++) {\n var daypos = void 0;\n var timepos = void 0;\n var pos = bysetpos[j];\n if (pos < 0) {\n daypos = Math.floor(pos / timeset.length);\n timepos = pymod(pos, timeset.length);\n }\n else {\n daypos = Math.floor((pos - 1) / timeset.length);\n timepos = pymod(pos - 1, timeset.length);\n }\n var tmp = [];\n for (var k = start; k < end; k++) {\n var val = dayset[k];\n if (!isPresent(val))\n continue;\n tmp.push(val);\n }\n var i = void 0;\n if (daypos < 0) {\n i = tmp.slice(daypos)[0];\n }\n else {\n i = tmp[daypos];\n }\n var time = timeset[timepos];\n var date = fromOrdinal(ii.yearordinal + i);\n var res = combine(date, time);\n // XXX: can this ever be in the array?\n // - compare the actual date instead?\n if (!includes(poslist, res))\n poslist.push(res);\n }\n sort(poslist);\n return poslist;\n}\n//# sourceMappingURL=poslist.js.map","import { freqIsDailyOrGreater } from '../types';\nimport { combine, fromOrdinal, MAXYEAR } from '../dateutil';\nimport Iterinfo from '../iterinfo/index';\nimport { RRule } from '../rrule';\nimport { buildTimeset } from '../parseoptions';\nimport { notEmpty, includes, isPresent } from '../helpers';\nimport { DateWithZone } from '../datewithzone';\nimport { buildPoslist } from './poslist';\nimport { DateTime } from '../datetime';\nexport function iter(iterResult, options) {\n var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos;\n var count = options.count;\n if (count === 0 || interval === 0) {\n return emitResult(iterResult);\n }\n var counterDate = DateTime.fromDate(dtstart);\n var ii = new Iterinfo(options);\n ii.rebuild(counterDate.year, counterDate.month);\n var timeset = makeTimeset(ii, counterDate, options);\n for (;;) {\n var _a = ii.getdayset(freq)(counterDate.year, counterDate.month, counterDate.day), dayset = _a[0], start = _a[1], end = _a[2];\n var filtered = removeFilteredDays(dayset, start, end, ii, options);\n if (notEmpty(bysetpos)) {\n var poslist = buildPoslist(bysetpos, timeset, start, end, ii, dayset);\n for (var j = 0; j < poslist.length; j++) {\n var res = poslist[j];\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n else {\n for (var j = start; j < end; j++) {\n var currentDay = dayset[j];\n if (!isPresent(currentDay)) {\n continue;\n }\n var date = fromOrdinal(ii.yearordinal + currentDay);\n for (var k = 0; k < timeset.length; k++) {\n var time = timeset[k];\n var res = combine(date, time);\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n }\n if (options.interval === 0) {\n return emitResult(iterResult);\n }\n // Handle frequency and interval\n counterDate.add(options, filtered);\n if (counterDate.year > MAXYEAR) {\n return emitResult(iterResult);\n }\n if (!freqIsDailyOrGreater(freq)) {\n timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0);\n }\n ii.rebuild(counterDate.year, counterDate.month);\n }\n}\nfunction isFiltered(ii, currentDay, options) {\n var bymonth = options.bymonth, byweekno = options.byweekno, byweekday = options.byweekday, byeaster = options.byeaster, bymonthday = options.bymonthday, bynmonthday = options.bynmonthday, byyearday = options.byyearday;\n return ((notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay])) ||\n (notEmpty(byweekno) && !ii.wnomask[currentDay]) ||\n (notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay])) ||\n (notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay]) ||\n (byeaster !== null && !includes(ii.eastermask, currentDay)) ||\n ((notEmpty(bymonthday) || notEmpty(bynmonthday)) &&\n !includes(bymonthday, ii.mdaymask[currentDay]) &&\n !includes(bynmonthday, ii.nmdaymask[currentDay])) ||\n (notEmpty(byyearday) &&\n ((currentDay < ii.yearlen &&\n !includes(byyearday, currentDay + 1) &&\n !includes(byyearday, -ii.yearlen + currentDay)) ||\n (currentDay >= ii.yearlen &&\n !includes(byyearday, currentDay + 1 - ii.yearlen) &&\n !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen)))));\n}\nfunction rezoneIfNeeded(date, options) {\n return new DateWithZone(date, options.tzid).rezonedDate();\n}\nfunction emitResult(iterResult) {\n return iterResult.getValue();\n}\nfunction removeFilteredDays(dayset, start, end, ii, options) {\n var filtered = false;\n for (var dayCounter = start; dayCounter < end; dayCounter++) {\n var currentDay = dayset[dayCounter];\n filtered = isFiltered(ii, currentDay, options);\n if (filtered)\n dayset[currentDay] = null;\n }\n return filtered;\n}\nfunction makeTimeset(ii, counterDate, options) {\n var freq = options.freq, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n if (freqIsDailyOrGreater(freq)) {\n return buildTimeset(options);\n }\n if ((freq >= RRule.HOURLY &&\n notEmpty(byhour) &&\n !includes(byhour, counterDate.hour)) ||\n (freq >= RRule.MINUTELY &&\n notEmpty(byminute) &&\n !includes(byminute, counterDate.minute)) ||\n (freq >= RRule.SECONDLY &&\n notEmpty(bysecond) &&\n !includes(bysecond, counterDate.second))) {\n return [];\n }\n return ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, counterDate.millisecond);\n}\n//# sourceMappingURL=index.js.map","import { isValidDate } from './dateutil';\nimport IterResult from './iterresult';\nimport CallbackIterResult from './callbackiterresult';\nimport { fromText, parseText, toText, isFullyConvertible } from './nlp/index';\nimport { Frequency, } from './types';\nimport { parseOptions, initializeOptions } from './parseoptions';\nimport { parseString } from './parsestring';\nimport { optionsToString } from './optionstostring';\nimport { Cache } from './cache';\nimport { Weekday } from './weekday';\nimport { iter } from './iter/index';\n// =============================================================================\n// RRule\n// =============================================================================\nexport var Days = {\n MO: new Weekday(0),\n TU: new Weekday(1),\n WE: new Weekday(2),\n TH: new Weekday(3),\n FR: new Weekday(4),\n SA: new Weekday(5),\n SU: new Weekday(6),\n};\nexport var DEFAULT_OPTIONS = {\n freq: Frequency.YEARLY,\n dtstart: null,\n interval: 1,\n wkst: Days.MO,\n count: null,\n until: null,\n tzid: null,\n bysetpos: null,\n bymonth: null,\n bymonthday: null,\n bynmonthday: null,\n byyearday: null,\n byweekno: null,\n byweekday: null,\n bynweekday: null,\n byhour: null,\n byminute: null,\n bysecond: null,\n byeaster: null,\n};\nexport var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n/**\n *\n * @param {Options?} options - see \n * - The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ...\n * @constructor\n */\nvar RRule = /** @class */ (function () {\n function RRule(options, noCache) {\n if (options === void 0) { options = {}; }\n if (noCache === void 0) { noCache = false; }\n // RFC string\n this._cache = noCache ? null : new Cache();\n // used by toString()\n this.origOptions = initializeOptions(options);\n var parsedOptions = parseOptions(options).parsedOptions;\n this.options = parsedOptions;\n }\n RRule.parseText = function (text, language) {\n return parseText(text, language);\n };\n RRule.fromText = function (text, language) {\n return fromText(text, language);\n };\n RRule.fromString = function (str) {\n return new RRule(RRule.parseString(str) || undefined);\n };\n RRule.prototype._iter = function (iterResult) {\n return iter(iterResult, this.options);\n };\n RRule.prototype._cacheGet = function (what, args) {\n if (!this._cache)\n return false;\n return this._cache._cacheGet(what, args);\n };\n RRule.prototype._cacheAdd = function (what, value, args) {\n if (!this._cache)\n return;\n return this._cache._cacheAdd(what, value, args);\n };\n /**\n * @param {Function} iterator - optional function that will be called\n * on each date that is added. It can return false\n * to stop the iteration.\n * @return Array containing all recurrences.\n */\n RRule.prototype.all = function (iterator) {\n if (iterator) {\n return this._iter(new CallbackIterResult('all', {}, iterator));\n }\n var result = this._cacheGet('all');\n if (result === false) {\n result = this._iter(new IterResult('all', {}));\n this._cacheAdd('all', result);\n }\n return result;\n };\n /**\n * Returns all the occurrences of the rrule between after and before.\n * The inc keyword defines what happens if after and/or before are\n * themselves occurrences. With inc == True, they will be included in the\n * list, if they are found in the recurrence set.\n *\n * @return Array\n */\n RRule.prototype.between = function (after, before, inc, iterator) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(after) || !isValidDate(before)) {\n throw new Error('Invalid date passed in to RRule.between');\n }\n var args = {\n before: before,\n after: after,\n inc: inc,\n };\n if (iterator) {\n return this._iter(new CallbackIterResult('between', args, iterator));\n }\n var result = this._cacheGet('between', args);\n if (result === false) {\n result = this._iter(new IterResult('between', args));\n this._cacheAdd('between', result, args);\n }\n return result;\n };\n /**\n * Returns the last recurrence before the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.before = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.before');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('before', args);\n if (result === false) {\n result = this._iter(new IterResult('before', args));\n this._cacheAdd('before', result, args);\n }\n return result;\n };\n /**\n * Returns the first recurrence after the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.after = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.after');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('after', args);\n if (result === false) {\n result = this._iter(new IterResult('after', args));\n this._cacheAdd('after', result, args);\n }\n return result;\n };\n /**\n * Returns the number of recurrences in this set. It will have go trough\n * the whole recurrence, if this hasn't been done before.\n */\n RRule.prototype.count = function () {\n return this.all().length;\n };\n /**\n * Converts the rrule into its string representation\n *\n * @see \n * @return String\n */\n RRule.prototype.toString = function () {\n return optionsToString(this.origOptions);\n };\n /**\n * Will convert all rules described in nlp:ToText\n * to text.\n */\n RRule.prototype.toText = function (gettext, language, dateFormatter) {\n return toText(this, gettext, language, dateFormatter);\n };\n RRule.prototype.isFullyConvertibleToText = function () {\n return isFullyConvertible(this);\n };\n /**\n * @return a RRule instance with the same freq and options\n * as this one (cache is not cloned)\n */\n RRule.prototype.clone = function () {\n return new RRule(this.origOptions);\n };\n // RRule class 'constants'\n RRule.FREQUENCIES = [\n 'YEARLY',\n 'MONTHLY',\n 'WEEKLY',\n 'DAILY',\n 'HOURLY',\n 'MINUTELY',\n 'SECONDLY',\n ];\n RRule.YEARLY = Frequency.YEARLY;\n RRule.MONTHLY = Frequency.MONTHLY;\n RRule.WEEKLY = Frequency.WEEKLY;\n RRule.DAILY = Frequency.DAILY;\n RRule.HOURLY = Frequency.HOURLY;\n RRule.MINUTELY = Frequency.MINUTELY;\n RRule.SECONDLY = Frequency.SECONDLY;\n RRule.MO = Days.MO;\n RRule.TU = Days.TU;\n RRule.WE = Days.WE;\n RRule.TH = Days.TH;\n RRule.FR = Days.FR;\n RRule.SA = Days.SA;\n RRule.SU = Days.SU;\n RRule.parseString = parseString;\n RRule.optionsToString = optionsToString;\n return RRule;\n}());\nexport { RRule };\n//# sourceMappingURL=rrule.js.map","import { __assign } from \"tslib\";\nimport { RRule } from './rrule';\nimport { RRuleSet } from './rruleset';\nimport { untilStringToDate } from './dateutil';\nimport { includes, split } from './helpers';\nimport { parseString, parseDtstart } from './parsestring';\n/**\n * RRuleStr\n * To parse a set of rrule strings\n */\nvar DEFAULT_OPTIONS = {\n dtstart: null,\n cache: false,\n unfold: false,\n forceset: false,\n compatible: false,\n tzid: null,\n};\nexport function parseInput(s, options) {\n var rrulevals = [];\n var rdatevals = [];\n var exrulevals = [];\n var exdatevals = [];\n var parsedDtstart = parseDtstart(s);\n var dtstart = parsedDtstart.dtstart;\n var tzid = parsedDtstart.tzid;\n var lines = splitIntoLines(s, options.unfold);\n lines.forEach(function (line) {\n var _a;\n if (!line)\n return;\n var _b = breakDownLine(line), name = _b.name, parms = _b.parms, value = _b.value;\n switch (name.toUpperCase()) {\n case 'RRULE':\n if (parms.length) {\n throw new Error(\"unsupported RRULE parm: \".concat(parms.join(',')));\n }\n rrulevals.push(parseString(line));\n break;\n case 'RDATE':\n var _c = (_a = /RDATE(?:;TZID=([^:=]+))?/i.exec(line)) !== null && _a !== void 0 ? _a : [], rdateTzid = _c[1];\n if (rdateTzid && !tzid) {\n tzid = rdateTzid;\n }\n rdatevals = rdatevals.concat(parseRDate(value, parms));\n break;\n case 'EXRULE':\n if (parms.length) {\n throw new Error(\"unsupported EXRULE parm: \".concat(parms.join(',')));\n }\n exrulevals.push(parseString(value));\n break;\n case 'EXDATE':\n exdatevals = exdatevals.concat(parseRDate(value, parms));\n break;\n case 'DTSTART':\n break;\n default:\n throw new Error('unsupported property: ' + name);\n }\n });\n return {\n dtstart: dtstart,\n tzid: tzid,\n rrulevals: rrulevals,\n rdatevals: rdatevals,\n exrulevals: exrulevals,\n exdatevals: exdatevals,\n };\n}\nfunction buildRule(s, options) {\n var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid;\n var noCache = options.cache === false;\n if (options.compatible) {\n options.forceset = true;\n options.unfold = true;\n }\n if (options.forceset ||\n rrulevals.length > 1 ||\n rdatevals.length ||\n exrulevals.length ||\n exdatevals.length) {\n var rset_1 = new RRuleSet(noCache);\n rset_1.dtstart(dtstart);\n rset_1.tzid(tzid || undefined);\n rrulevals.forEach(function (val) {\n rset_1.rrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n rdatevals.forEach(function (date) {\n rset_1.rdate(date);\n });\n exrulevals.forEach(function (val) {\n rset_1.exrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n exdatevals.forEach(function (date) {\n rset_1.exdate(date);\n });\n if (options.compatible && options.dtstart)\n rset_1.rdate(dtstart);\n return rset_1;\n }\n var val = rrulevals[0] || {};\n return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache);\n}\nexport function rrulestr(s, options) {\n if (options === void 0) { options = {}; }\n return buildRule(s, initializeOptions(options));\n}\nfunction groomRruleOptions(val, dtstart, tzid) {\n return __assign(__assign({}, val), { dtstart: dtstart, tzid: tzid });\n}\nfunction initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n keys.forEach(function (key) {\n if (!includes(defaultKeys, key))\n invalid.push(key);\n });\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign(__assign({}, DEFAULT_OPTIONS), options);\n}\nfunction extractName(line) {\n if (line.indexOf(':') === -1) {\n return {\n name: 'RRULE',\n value: line,\n };\n }\n var _a = split(line, ':', 1), name = _a[0], value = _a[1];\n return {\n name: name,\n value: value,\n };\n}\nfunction breakDownLine(line) {\n var _a = extractName(line), name = _a.name, value = _a.value;\n var parms = name.split(';');\n if (!parms)\n throw new Error('empty property name');\n return {\n name: parms[0].toUpperCase(),\n parms: parms.slice(1),\n value: value,\n };\n}\nfunction splitIntoLines(s, unfold) {\n if (unfold === void 0) { unfold = false; }\n s = s && s.trim();\n if (!s)\n throw new Error('Invalid empty string');\n // More info about 'unfold' option\n // Go head to http://www.ietf.org/rfc/rfc2445.txt\n if (!unfold) {\n return s.split(/\\s/);\n }\n var lines = s.split('\\n');\n var i = 0;\n while (i < lines.length) {\n // TODO\n var line = (lines[i] = lines[i].replace(/\\s+$/g, ''));\n if (!line) {\n lines.splice(i, 1);\n }\n else if (i > 0 && line[0] === ' ') {\n lines[i - 1] += line.slice(1);\n lines.splice(i, 1);\n }\n else {\n i += 1;\n }\n }\n return lines;\n}\nfunction validateDateParm(parms) {\n parms.forEach(function (parm) {\n if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) {\n throw new Error('unsupported RDATE/EXDATE parm: ' + parm);\n }\n });\n}\nfunction parseRDate(rdateval, parms) {\n validateDateParm(parms);\n return rdateval.split(',').map(function (datestr) { return untilStringToDate(datestr); });\n}\n//# sourceMappingURL=rrulestr.js.map","import { __extends } from \"tslib\";\nimport { RRule } from './rrule';\nimport { sort, timeToUntilString } from './dateutil';\nimport { includes } from './helpers';\nimport { iterSet } from './iterset';\nimport { rrulestr } from './rrulestr';\nimport { optionsToString } from './optionstostring';\nfunction createGetterSetter(fieldName) {\n var _this = this;\n return function (field) {\n if (field !== undefined) {\n _this[\"_\".concat(fieldName)] = field;\n }\n if (_this[\"_\".concat(fieldName)] !== undefined) {\n return _this[\"_\".concat(fieldName)];\n }\n for (var i = 0; i < _this._rrule.length; i++) {\n var field_1 = _this._rrule[i].origOptions[fieldName];\n if (field_1) {\n return field_1;\n }\n }\n };\n}\nvar RRuleSet = /** @class */ (function (_super) {\n __extends(RRuleSet, _super);\n /**\n *\n * @param {Boolean?} noCache\n * The same stratagy as RRule on cache, default to false\n * @constructor\n */\n function RRuleSet(noCache) {\n if (noCache === void 0) { noCache = false; }\n var _this = _super.call(this, {}, noCache) || this;\n _this.dtstart = createGetterSetter.apply(_this, ['dtstart']);\n _this.tzid = createGetterSetter.apply(_this, ['tzid']);\n _this._rrule = [];\n _this._rdate = [];\n _this._exrule = [];\n _this._exdate = [];\n return _this;\n }\n RRuleSet.prototype._iter = function (iterResult) {\n return iterSet(iterResult, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());\n };\n /**\n * Adds an RRule to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.rrule = function (rrule) {\n _addRule(rrule, this._rrule);\n };\n /**\n * Adds an EXRULE to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.exrule = function (rrule) {\n _addRule(rrule, this._exrule);\n };\n /**\n * Adds an RDate to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.rdate = function (date) {\n _addDate(date, this._rdate);\n };\n /**\n * Adds an EXDATE to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.exdate = function (date) {\n _addDate(date, this._exdate);\n };\n /**\n * Get list of included rrules in this recurrence set.\n *\n * @return List of rrules\n */\n RRuleSet.prototype.rrules = function () {\n return this._rrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of excluded rrules in this recurrence set.\n *\n * @return List of exrules\n */\n RRuleSet.prototype.exrules = function () {\n return this._exrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of rdates\n */\n RRuleSet.prototype.rdates = function () {\n return this._rdate.map(function (e) { return new Date(e.getTime()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of exdates\n */\n RRuleSet.prototype.exdates = function () {\n return this._exdate.map(function (e) { return new Date(e.getTime()); });\n };\n RRuleSet.prototype.valueOf = function () {\n var result = [];\n if (!this._rrule.length && this._dtstart) {\n result = result.concat(optionsToString({ dtstart: this._dtstart }));\n }\n this._rrule.forEach(function (rrule) {\n result = result.concat(rrule.toString().split('\\n'));\n });\n this._exrule.forEach(function (exrule) {\n result = result.concat(exrule\n .toString()\n .split('\\n')\n .map(function (line) { return line.replace(/^RRULE:/, 'EXRULE:'); })\n .filter(function (line) { return !/^DTSTART/.test(line); }));\n });\n if (this._rdate.length) {\n result.push(rdatesToString('RDATE', this._rdate, this.tzid()));\n }\n if (this._exdate.length) {\n result.push(rdatesToString('EXDATE', this._exdate, this.tzid()));\n }\n return result;\n };\n /**\n * to generate recurrence field such as:\n * DTSTART:19970902T010000Z\n * RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU\n * RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH\n */\n RRuleSet.prototype.toString = function () {\n return this.valueOf().join('\\n');\n };\n /**\n * Create a new RRuleSet Object completely base on current instance\n */\n RRuleSet.prototype.clone = function () {\n var rrs = new RRuleSet(!!this._cache);\n this._rrule.forEach(function (rule) { return rrs.rrule(rule.clone()); });\n this._exrule.forEach(function (rule) { return rrs.exrule(rule.clone()); });\n this._rdate.forEach(function (date) { return rrs.rdate(new Date(date.getTime())); });\n this._exdate.forEach(function (date) { return rrs.exdate(new Date(date.getTime())); });\n return rrs;\n };\n return RRuleSet;\n}(RRule));\nexport { RRuleSet };\nfunction _addRule(rrule, collection) {\n if (!(rrule instanceof RRule)) {\n throw new TypeError(String(rrule) + ' is not RRule instance');\n }\n if (!includes(collection.map(String), String(rrule))) {\n collection.push(rrule);\n }\n}\nfunction _addDate(date, collection) {\n if (!(date instanceof Date)) {\n throw new TypeError(String(date) + ' is not Date instance');\n }\n if (!includes(collection.map(Number), Number(date))) {\n collection.push(date);\n sort(collection);\n }\n}\nfunction rdatesToString(param, rdates, tzid) {\n var isUTC = !tzid || tzid.toUpperCase() === 'UTC';\n var header = isUTC ? \"\".concat(param, \":\") : \"\".concat(param, \";TZID=\").concat(tzid, \":\");\n var dateString = rdates\n .map(function (rdate) { return timeToUntilString(rdate.valueOf(), isUTC); })\n .join(',');\n return \"\".concat(header).concat(dateString);\n}\n//# sourceMappingURL=rruleset.js.map","import { DateWithZone } from './datewithzone';\nimport { iter } from './iter';\nimport { sort } from './dateutil';\nexport function iterSet(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) {\n var _exdateHash = {};\n var _accept = iterResult.accept;\n function evalExdate(after, before) {\n _exrule.forEach(function (rrule) {\n rrule.between(after, before, true).forEach(function (date) {\n _exdateHash[Number(date)] = true;\n });\n });\n }\n _exdate.forEach(function (date) {\n var zonedDate = new DateWithZone(date, tzid).rezonedDate();\n _exdateHash[Number(zonedDate)] = true;\n });\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (isNaN(dt))\n return _accept.call(this, date);\n if (!_exdateHash[dt]) {\n evalExdate(new Date(dt - 1), new Date(dt + 1));\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n }\n return true;\n };\n if (iterResult.method === 'between') {\n evalExdate(iterResult.args.after, iterResult.args.before);\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n return true;\n };\n }\n for (var i = 0; i < _rdate.length; i++) {\n var zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate();\n if (!iterResult.accept(new Date(zonedDate.getTime())))\n break;\n }\n _rrule.forEach(function (rrule) {\n iter(iterResult, rrule.options);\n });\n var res = iterResult._result;\n sort(res);\n switch (iterResult.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n return ((res.length && res[res.length - 1]) || null);\n case 'after':\n default:\n return ((res.length && res[0]) || null);\n }\n}\n//# sourceMappingURL=iterset.js.map","interface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement | null;\r\n\tprivate _scheduler: any;\r\n\r\n\tconstructor(scheduler: any){\r\n\t\tthis._scheduler = scheduler;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"dhtmlXTooltip scheduler_tooltip tooltip\";\r\n\r\n\t\t\tscheduler._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tthis._tooltipNode.classList.add(\"dhtmlXTooltip_rtl\");\r\n\t\t} else{\r\n\t\t\tthis._tooltipNode.classList.remove(\"dhtmlXTooltip_rtl\");\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tscheduler._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tscheduler._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = scheduler.config.tooltip_offset_x;\r\n\t\tconst offsetY = scheduler.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of scheduler\r\n\t\tif(container === scheduler.$event_data){\r\n\t\t\tviewport = scheduler.$event;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(scheduler.$event);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import * as utils from \"../../core/utils/utils\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _scheduler: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.tooltip = new Tooltip(scheduler);\r\n\t\tthis._scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tif(!config.global){\r\n\t\t\troot = scheduler.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\t\t\t// GS-2377: to show tooltip after touch and hide it when touch is outside the events\r\n\t\t\tif (scheduler._mobile && scheduler.config.touch_tooltip){\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconfig.onmouseleave(event, targetNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst scheduler = this._scheduler;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\t\t\r\n\t\tthis.delayShow = (utils as any).default.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(scheduler.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, scheduler.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = (utils as any).default.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, scheduler.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import active_links from \"./active_links\";\r\nimport agenda_legacy from \"./agenda_legacy_view\";\r\nimport agenda_view from \"./agenda\";\r\nimport all_timed from \"./all_timed\";\r\nimport collision from \"./collision\";\r\nimport container_autoresize from \"./container_autoresize\";\r\nimport cookie from \"./cookie\";\r\nimport daytimeline_restricted from \"./restricted_extensions/daytimeline\";\r\nimport drag_between_restricted from \"./restricted_extensions/drag_between\";\r\nimport editors from \"./editors\";\r\nimport expand from \"./expand\";\r\nimport grid_view from \"./restricted_extensions/grid_view\";\r\nimport html_templates from \"./html_templates\";\r\nimport key_nav from \"./key_nav\";\r\nimport layer from \"./layer\";\r\nimport limit from \"./limit\";\r\nimport map_view from \"./map_view\";\r\nimport minical from \"./minical\";\r\nimport monthheight from \"./monthheight\";\r\nimport multisection_restricted from \"./restricted_extensions/multisection\";\r\nimport multiselect from \"./multiselect\";\r\nimport multisource from \"./multisource\";\r\nimport mvc from \"./mvc\";\r\nimport outerdrag from \"./outerdrag\";\r\nimport pdf from \"./pdf\";\r\nimport quick_info from \"./quick_info\";\r\nimport readonly from \"./readonly\";\r\nimport recurring from \"./recurring\";\r\nimport recurring_legacy from \"./recurring_legacy\";\r\nimport serialize from \"./serialize\";\r\nimport timeline_restricted from \"./restricted_extensions/timeline\";\r\nimport tooltip from \"./tooltip\";\r\nimport treetimeline_restricted from \"./restricted_extensions/treetimeline\";\r\nimport units_restricted from \"./restricted_extensions/units\";\r\nimport url from \"./url\";\r\nimport week_agenda_restricted from \"./restricted_extensions/week_agenda\";\r\nimport wp from \"./wp\";\r\nimport year_view from \"./year_view\";\r\nimport export_api from \"./export_api\";\r\n\r\nexport default {\r\n\tactive_links,\r\n\tagenda_legacy,\r\n\tagenda_view,\r\n\tall_timed,\r\n\tcollision,\r\n\tcontainer_autoresize,\r\n\tcookie,\r\n\tdaytimeline: daytimeline_restricted,\r\n\tdrag_between: drag_between_restricted,\r\n\teditors,\r\n\texpand,\r\n\texport_api,\r\n\tgrid_view,\r\n\thtml_templates,\r\n\tkey_nav,\r\n\tlayer,\r\n\tlimit,\r\n\tmap_view,\r\n\tminical,\r\n\tmonthheight,\r\n\tmultisection: multisection_restricted,\r\n\tmultiselect,\r\n\tmultisource,\r\n\tmvc,\r\n\touterdrag,\r\n\tpdf,\r\n\tquick_info,\r\n\treadonly,\r\n\trecurring,\r\n\trecurring_legacy,\r\n\tserialize,\r\n\ttimeline: timeline_restricted,\r\n\ttooltip,\r\n\ttreetimeline: treetimeline_restricted,\r\n\tunits: units_restricted,\r\n\turl,\r\n\tweek_agenda: week_agenda_restricted,\r\n\twp,\r\n\tyear_view\r\n};","export default function(scheduler){\r\n\r\nscheduler.config.active_link_view = \"day\";\r\nscheduler._active_link_click = function(e){\r\n\tvar start = e.target;\r\n\tvar to = start.getAttribute(\"data-link-date\");\r\n\tvar s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);\r\n\tif (to) {\r\n\t\tscheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);\r\n\t\tif (e && e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar do_wrapper = function(key, fullname){\r\n\t\tfullname = fullname || (key+\"_scale_date\");\r\n\r\n\t\tif(!scheduler.templates['_active_links_old_'+ fullname]){\r\n\t\t\tscheduler.templates['_active_links_old_'+ fullname] = scheduler.templates[fullname];\r\n\t\t}\r\n\t\tvar week_x = scheduler.templates['_active_links_old_'+ fullname];\r\n\t\tvar d_s = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\t\tscheduler.templates[fullname] = function(date) {\r\n\t\t\treturn \"\" + week_x(date) + \" \";\r\n\t\t};\r\n\t};\r\n\r\n\tdo_wrapper(\"week\");\r\n\tdo_wrapper(\"\", \"month_day\");\r\n\tif (this.matrix){\r\n\t\tfor (var key in this.matrix)\r\n\t\t\tdo_wrapper(key);\r\n\t}\r\n\r\n\tthis._detachDomEvent(this._obj, \"click\", scheduler._active_link_click);\r\n\tscheduler.event(this._obj, \"click\", scheduler._active_link_click);\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.date.add_agenda_legacy = function(date){\r\n\treturn scheduler.date.add(date, 1, \"year\");\r\n};\r\n\r\nscheduler.templates.agenda_legacy_time = function(start,end,ev){\r\n\tif (ev._timed)\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev)+\" \"+this.event_date(start);\r\n\telse\r\n\t\treturn scheduler.templates.day_date(start)+\" – \"+scheduler.templates.day_date(end);\r\n};\r\nscheduler.templates.agenda_legacy_text = function(start,end,event){\r\n\treturn event.text;\r\n};\r\nscheduler.templates.agenda_legacy_date = function(){ return \"\"; };\r\n\r\nscheduler.date.agenda_legacy_start=function(){ return scheduler.date.date_part(scheduler._currentDate()); };\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\tif (this._mode == \"agenda_legacy\") {\r\n\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\tthis.addEventNow();\r\n\t\t} else {\r\n\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data=function(evs){\r\n\t\tif (this._mode == \"agenda_legacy\")\r\n\t\t\tfill_agenda_tab();\r\n\t\telse\r\n\t\t\treturn old.apply(this,arguments);\r\n\t};\r\n\r\n\tvar old_render_view_data = scheduler.render_view_data;\r\n\tscheduler.render_view_data = function(){\r\n\t\tif(this._mode == \"agenda_legacy\") {\r\n\t\t\tscheduler._agendaScrollTop = scheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop;\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = 0;\r\n\t\t}\r\n\t\treturn old_render_view_data.apply(this,arguments);\r\n\t};\r\n\r\n\r\n\r\n\tfunction set_full_view(mode){\r\n\t\tif (mode){\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\r\n\t\t\tvar rowAttr = scheduler._waiAria.agendaHeadAttrString();\r\n\t\t\tvar dateHeader = scheduler._waiAria.agendaHeadDateString(l.date);\r\n\t\t\tvar descriptionHeader = scheduler._waiAria.agendaHeadDescriptionString(l.description);\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML=\"\";\r\n\t\t\tscheduler._table_view=true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_agenda_tab(){\r\n\t\t//select events for which data need to be printed\r\n\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\tvar tableAttr = scheduler._waiAria.agendaDataAttrString();\r\n\t\tvar agendaEventAttrString;\r\n\t\t//generate html for the view\r\n\t\tvar html=\"\";\r\n\t\tfor (var i=0; i
\"+\r\n\t\t\t\t\t(scheduler.config.rtl ? scheduler.templates.agenda_time(ev.end_date,ev.start_date, ev):scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev))+\r\n\t\t\t\t\t\"
\";\r\n\t\t\thtml+=``;\r\n\t\t\thtml+=\"\"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+\" \";\r\n\t\t}\r\n\t\thtml+=\"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;\r\n\r\n\t\t// setting up dhx_v_border size\r\n\t\tvar agenda_area = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\tvar v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];\r\n\t\tv_border.style.height = (agenda_area.offsetHeight < scheduler._els[\"dhx_cal_data\"][0].offsetHeight) ? \"100%\" : (agenda_area.offsetHeight+\"px\");\r\n\r\n\t\tvar t=scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered=[];\r\n\t\tfor (var i=0; i < t.length-1; i++)\r\n\t\t\tscheduler._rendered[i]=t[i];\r\n\r\n\t}\r\n\r\n\tscheduler.agenda_legacy_view=function(mode){\r\n\t\tscheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_legacy_start(scheduler._date);\r\n\t\tscheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda_legacy(scheduler._min_date, 1);\r\n\r\n\t\tset_full_view(mode);\r\n\t\tif (mode){\r\n\t\t\tscheduler._cols = null;\r\n\t\t\tscheduler._colsS = null;\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\t//agenda tab activated\r\n\t\t\tfill_agenda_tab();\r\n\t\t} else {\r\n\t\t\tscheduler._table_view = false;\r\n\t\t\t//agenda tab de-activated\r\n\t\t}\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.date.add_agenda = function(date, inc){\r\n\t\treturn scheduler.date.add(date, 1*inc, \"month\");\r\n\t};\r\n\t\r\n\tscheduler.templates.agenda_time = function(start,end,ev){\r\n\t\tif (ev._timed){\r\n\t\t\treturn `${this.event_date(start)} - ${this.event_date(end)}`;\r\n\t\t}else{\r\n\t\t\treturn scheduler.locale.labels.full_day;\r\n\t\t}\r\n\t};\r\n\tscheduler.templates.agenda_text = function(start,end,ev){\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst dayDateToStr = scheduler.date.date_to_str(\"%F %j\");\r\n\tconst dayDowToStr = scheduler.date.date_to_str(\"%l\");\r\n\r\n\tscheduler.templates.agenda_day = function(date){ \r\n\t\treturn `
${dayDateToStr(date)}
\r\n\t\t
${dayDowToStr(date)}
`;\r\n\t};\r\n\tscheduler.templates.agenda_date = function(start, end){ \r\n\t\treturn scheduler.templates.month_date(scheduler.getState().date); \r\n\t};\r\n\t\r\n\tscheduler.date.agenda_start=function(date){\r\n\t\treturn scheduler.date.month_start(new Date(date));\r\n\t};\r\n\r\n\tlet scrollTop = 0;\r\n\t\r\n\tscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\t\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\t\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\t\tif (this._mode == \"agenda\") {\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\t\tthis.addEventNow();\r\n\t\t\t} else {\r\n\t\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\r\n\t\tvar old = scheduler.render_data;\r\n\t\tscheduler.render_data=function(evs){\r\n\t\t\tif (this._mode == \"agenda\")\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\telse\r\n\t\t\t\treturn old.apply(this,arguments);\r\n\t\t};\r\n\t\r\n\t\tvar old_render_view_data = scheduler.render_view_data;\r\n\t\tscheduler.render_view_data = function(){\r\n\t\t\tif(this._mode == \"agenda\") {\r\n\t\t\t\tscrollTop = scheduler._els[\"dhx_cal_data\"][0].scrollTop;\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0;\r\n\t\t\t}\r\n\t\t\treturn old_render_view_data.apply(this,arguments);\r\n\t\t};\r\n\r\n\t\tfunction fill_agenda_tab(){\r\n\t\t\tconst events = scheduler.get_visible_events();\r\n\t\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\t\tconst eventsInDays = {};\r\n\t\t\tlet currDate = scheduler.getState().min_date;\r\n\t\t\tconst maxDate = scheduler.getState().max_date;\r\n\t\t\twhile(currDate.valueOf() < maxDate.valueOf()){\r\n\t\t\t\teventsInDays[currDate.valueOf()] = [];\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\r\n\t\t\tlet anyEvents = false;\r\n\r\n\t\t\tevents.forEach((ev) => {\r\n\t\t\t\tlet eventStart = scheduler.date.day_start(new Date(ev.start_date)); \r\n\t\t\t\twhile (eventStart.valueOf() < ev.end_date.valueOf()) {\r\n\t\t\t\t\tif (eventsInDays[eventStart.valueOf()]) {\r\n\t\t\t\t\t\teventsInDays[eventStart.valueOf()].push(ev);\r\n\t\t\t\t\t\tanyEvents = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\teventStart = scheduler.date.day_start(scheduler.date.add(eventStart, 1, \"day\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(!anyEvents){\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = renderEmptyView();\r\n\t\t\t}else{\r\n\t\t\t\tlet html = \"\";\r\n\t\t\t\tfor(let day in eventsInDays){\r\n\t\t\t\t\thtml += renderDay(new Date(day*1), eventsInDays[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = scrollTop;\r\n\t\t\t\r\n\t\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].querySelectorAll(\".dhx_cal_agenda_event_line\");\r\n\t\t\tscheduler._rendered = [];\r\n\t\t\tfor (var i = 0; i < t.length - 1; i++) {\r\n\t\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\r\n\r\n\t\tfunction renderEmptyView(){\r\n\t\t\treturn `
${scheduler.locale.labels.agenda_tab}
`;\r\n\t\t}\r\n\r\n\t\tfunction renderDay(day, events) {\r\n\t\t\tif(!events.length){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tlet html = `\r\n
\r\n\t\r\n\t
\r\n`;\r\n\r\n\t\t\tevents.forEach((calendarEvent) => {\r\n\t\t\t\thtml += renderOneEvent(day, calendarEvent);\r\n\t\t\t});\r\n\r\n\t\t\thtml += `
`;\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tfunction renderOneEvent(day, calendarEvent){\r\n\t\t\tconst dates = scheduler.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst selectedId = scheduler.getState().select_id;\r\n\t\t\tconst cls = scheduler.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst description = scheduler.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\r\n\t\t\tlet style = \"\";\r\n\t\t\tif(calendarEvent.color || calendarEvent.textColor){\r\n\t\t\t\tconst bg = (calendarEvent.color ? (\"--dhx-scheduler-event-background:\" + calendarEvent.color + \";\") : \"\");\r\n\t\t\t\tconst color = (calendarEvent.textColor ? (\"--dhx-scheduler-event-color:\" + calendarEvent.textColor + \";\") : \"\");\r\n\t\t\t\tstyle = ` style=\"${bg}${color}\" `;\r\n\t\t\t}\r\n\r\n\t\t\treturn `
\r\n\t
\r\n\t
${dates}
\r\n\t
${description}
\r\n
`;\r\n\t\t}\r\n\t\r\n\t\tscheduler.agenda_view=function(mode){\r\n\t\t\tif (mode){\r\n\t\t\t\tscheduler._min_date = scheduler.config.agenda_start || scheduler.date.agenda_start(scheduler._date);\r\n\t\t\t\tscheduler._max_date = scheduler.config.agenda_end || scheduler.date.add_agenda(scheduler._min_date, 1);\r\n\t\t\t\tscheduler._cols = null;\r\n\t\t\t\tscheduler._colsS = null;\r\n\t\t\t\tscheduler._table_view = true;\r\n\r\n\t\t\t\tconst dateHeader = scheduler._getNavDateElement();\r\n\t\t\t\tdateHeader.innerHTML = scheduler.templates.agenda_date(scheduler._date);\r\n\t\t\t\t//agenda tab activated\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\t} else {\r\n\t\t\t\tscheduler._table_view = false;\r\n\t\t\t\t//agenda tab de-activated\r\n\t\t\t}\r\n\t\t};\r\n\t});\r\n\r\n\t// scheduler.attachEvent(\"onEventSelected\", function(id){\r\n\t// \tconst oldSelected = scheduler.$container.querySelectorAll(\".dhx_cal_agenda_event_line_selected\");\r\n\t// \toldSelected.forEach((el) => {\r\n\t// \t\tel.classList.remove(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t});\r\n\r\n\t// \tconst selected = scheduler.$container.querySelector(`[${scheduler.config.event_attribute}=\"${id}\"]`);\r\n\t// \tif(selected){\r\n\t// \t\tselected.classList.add(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t}\r\n\t// });\r\n\t\r\n\t\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.all_timed = \"short\";\r\n\tscheduler.config.all_timed_month = false;\r\n\r\n\tvar is_event_short = function (ev) {\r\n\t\tif(!((ev.end_date - ev.start_date)/(1000*60*60) >= 24)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// short event shouldn't disappear to multiday area during dnd-resize\r\n\t\tif(scheduler._drag_mode == \"resize\" && scheduler._drag_id == ev.id){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn \tfalse;\r\n\t};\r\n\r\n\t// copy of usual events and recurring instances;\r\n\t// regular copy causes problems with recurrings which have series event as a prototype\r\n\tscheduler._safe_copy = function(event){\r\n\t\tvar proto = null,\r\n\t\t\tcopy = scheduler._copy_event(event);\r\n\t\tif(event.event_pid){\r\n\t\t\tproto = scheduler.getEvent(event.event_pid);\r\n\t\t}\r\n\r\n\t\tif (proto && proto.isPrototypeOf(event)) {\r\n\t\t\tdelete copy.event_length;\r\n\t\t\tdelete copy.event_pid;\r\n\t\t\tdelete copy.rec_pattern;\r\n\t\t\tdelete copy.rec_type;\r\n\t\t}\r\n\r\n\t\treturn copy;\r\n\t};\r\n\r\n\tvar old_prerender_events_line = scheduler._pre_render_events_line;\r\n\tvar old_prerender_events_table = scheduler._pre_render_events_table;\r\n\r\n\tvar prerender_events = function (evs, hold) {\r\n\t\tif (!this._table_view) {\r\n\t\t\treturn old_prerender_events_line.call(this, evs, hold);\r\n\t\t}\r\n\r\n\t\treturn old_prerender_events_table.call(this, evs, hold);\r\n\t};\r\n\r\n\tscheduler._pre_render_events_line = scheduler._pre_render_events_table = function(evs, hold){\r\n\t\tif (!this.config.all_timed ||\r\n\t\t\t(this._table_view && this._mode != \"month\") ||\r\n\t\t\t(this._mode == \"month\" && !this.config.all_timed_month))\r\n\t\t\treturn prerender_events.call(this, evs, hold);\r\n\r\n\t\tfor (var i=0; i < evs.length; i++) {\r\n\t\t\tvar ev=evs[i];\r\n\r\n\t\t\tif (ev._timed)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (this.config.all_timed == \"short\") {\r\n\t\t\t\tif (!is_event_short(ev)) {\r\n\t\t\t\t\tif (this._mode != \"month\") {\r\n\t\t\t\t\t\tevs.splice(i--, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar ce = this._safe_copy(ev); // current event (event for one specific day) is copy of original with modified dates\r\n\t\t\tif(!ev._virtual){\r\n\t\t\t\tce._first_chunk = true;\r\n\t\t\t}else{\r\n\t\t\t\tce._first_chunk = false;\r\n\t\t\t}\r\n\t\t\tce._drag_resize = false;\r\n\t\t\tce._virtual = true;\r\n\t\t\tce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects\r\n\r\n\t\t\tif (!isOvernightEvent(ev)) {\r\n\t\t\t\tce.end_date = new Date(ev.end_date);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tce.end_date = getNextDay(ce.start_date);\r\n\t\t\t\tif (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)\r\n\t\t\t\t\tce.end_date = setDateTime(ce.start_date, this.config.last_hour);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar event_changed = false;\r\n\t\t\tif (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {\r\n\t\t\t\tevs[i] = ce; // adding another event in collection\r\n\t\t\t\tevent_changed = true;\r\n\t\t\t}\r\n\t\t//\tif (ce.start_date > ce.end_date) {\r\n\t\t//\t\tevs.splice(i--,1);\r\n\t\t//\t}\r\n\r\n\t\t\tvar re = this._safe_copy(ev); // remaining event, copy of original with modified start_date (making range more narrow)\r\n\t\t\tre._virtual = true;\r\n\t\t\tre.end_date = new Date(re.end_date);\r\n\t\t\tif (re.start_date < this._min_date)\r\n\t\t\t\tre.start_date = setDateTime(this._min_date, this.config.first_hour);// as we are starting only with whole hours\r\n\t\t\telse\r\n\t\t\t\tre.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour);\r\n\r\n\t\t\tif (re.start_date < this._max_date && re.start_date < re.end_date) {\r\n\t\t\t\tif (event_changed){\r\n\t\t\t\t\tevs.splice(i+1,0,re);//insert part\r\n\t\t\t\t}else {\r\n\t\t\t\t\tevs[i--] = re;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tre._last_chunk = false;\r\n\t\t\t}else{\r\n\t\t\t\tce._last_chunk = true;\r\n\t\t\t\tce._drag_resize = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// in case of all_timed pre_render is not applied to the original event\r\n\t\t// so we need to force redraw in case of dnd\r\n\t\tvar redraw = (this._drag_mode == 'move')?false:hold;\r\n\t\treturn prerender_events.call(this, evs, redraw);\r\n\r\n\r\n\t\tfunction isOvernightEvent(ev){\r\n\t\t\tvar next_day = getNextDay(ev.start_date);\r\n\t\t\treturn (+ev.end_date > +next_day);\r\n\t\t}\r\n\t\tfunction getNextDay(date){\r\n\t\t\tvar next_day = scheduler.date.add(date, 1, \"day\");\r\n\t\t\tnext_day = scheduler.date.date_part(next_day);\r\n\t\t\treturn next_day;\r\n\t\t}\r\n\t\tfunction setDateTime(date, hours){\r\n\t\t\tvar val = scheduler.date.date_part(new Date(date));\r\n\t\t\tval.setHours(hours);\r\n\t\t\treturn val;\r\n\t\t}\r\n\t};\r\n\tvar old_get_visible_events = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function(only_timed){\r\n\t\tif (!(this.config.all_timed && this.config.multi_day))\r\n\t\t\treturn old_get_visible_events.call(this, only_timed);\r\n\t\treturn old_get_visible_events.call(this, false); // only timed = false\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (old_mode, old_date, mode, date) {\r\n\t\tscheduler._allow_dnd = (mode == \"day\" || mode == \"week\" || scheduler.getView(mode));\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._is_main_area_event = function(ev){\r\n\t\treturn !!(ev._timed || this.config.all_timed === true || (this.config.all_timed == \"short\" && is_event_short(ev)) );\r\n\t};\r\n\r\n\tvar oldUpdate = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\t// full redraw(update_render=true) messes events order while dnd.\r\n\t\t// individual redraw(update_render=false) of multiday event, which happens on select/unselect, expands event to full width of the cell and can be fixes only with full redraw.\r\n\t\t// so for now full redraw is always enabled for not-dnd updates\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tvar fullRedrawNeeded;\r\n\t\tvar initial;\r\n\t\tif(ev) {\r\n\t\t\tfullRedrawNeeded = (scheduler.config.all_timed && !(scheduler.isOneDayEvent(scheduler._events[id]) || scheduler.getState().drag_id));\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tinitial = scheduler.config.update_render;\r\n\t\t\t\tscheduler.config.update_render = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\toldUpdate.apply(scheduler, arguments);\r\n\r\n\t\tif(ev) {\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tscheduler.config.update_render = initial;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nvar temp_section;\r\nvar before;\r\n\r\nscheduler.config.collision_limit = 1;\r\n\r\nfunction _setTempSection(event_id) { // for custom views (matrix, timeline, units)\r\n\tvar checked_mode = scheduler._get_section_view();\r\n\tif(checked_mode && event_id){\r\n\t\ttemp_section = scheduler.getEvent(event_id)[scheduler._get_section_property()];\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tbefore = [ev.start_date, ev.end_date];\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\tif (!id || !scheduler.getEvent(id)) return true;\r\n\tvar ev = scheduler.getEvent(id);\r\n\tif (!scheduler.checkCollision(ev)){\r\n\t\tif (!before) return false;\r\n\t\tev.start_date = before[0];\r\n\t\tev.end_date = before[1];\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeEventChanged\",function(ev,e,is_new){\r\n\treturn scheduler.checkCollision(ev);\r\n});\r\nscheduler.attachEvent(\"onEventAdded\",function(id,ev) {\r\n\tvar result = scheduler.checkCollision(ev);\r\n\tif (!result)\r\n\t\tscheduler.deleteEvent(id);\r\n});\r\nscheduler.attachEvent(\"onEventSave\",function(id, edited_ev, is_new){\r\n\tedited_ev = scheduler._lame_clone(edited_ev);\r\n\tedited_ev.id = id;\r\n\r\n\t//lightbox may not have 'time' section\r\n\tif(!(edited_ev.start_date && edited_ev.end_date)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tedited_ev.start_date = new Date(ev.start_date);\r\n\t\tedited_ev.end_date = new Date(ev.end_date);\r\n\t}\r\n\r\n\tif((edited_ev.rrule && !edited_ev.recurring_event_id) || edited_ev.rec_type){\r\n\t\tscheduler._roll_back_dates(edited_ev);\r\n\t}\r\n\treturn scheduler.checkCollision(edited_ev); // in case user creates event on one date but then edited it another\r\n});\r\n\r\nscheduler._check_sections_collision = function(first, second){\r\n\tvar map_to = scheduler._get_section_property();\r\n\tif (first[map_to] == second[map_to] && first.id != second.id)\r\n\t\treturn true;\r\n\treturn false;\r\n};\r\n\r\nscheduler.checkCollision = function(ev) {\r\n\tvar evs = [];\r\n\tvar collision_limit = scheduler.config.collision_limit;\r\n\r\n\tif (ev.rrule || ev.rec_type) {\r\n\t\tvar evs_dates = scheduler.getRecDates(ev);\r\n\t\tfor(var k=0; k
= collision_limit) {\r\n\r\n\t\t\tsingle = false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif ( evs.length >= collision_limit )\r\n\t\t\tsingle = false;\r\n\t}\r\n\tif (!single) {\r\n\t\tvar res = !scheduler.callEvent(\"onEventCollision\",[ev,evs]);\r\n\t\tif (!res) {\r\n\t\t\tev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\treturn single;\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.container_autoresize = true;\r\n\tscheduler.config.month_day_min_height = 90;\r\n\tscheduler.config.min_grid_size = 25;\r\n\tscheduler.config.min_map_size = 400;\r\n\r\n\tvar old_pre_render_event = scheduler._pre_render_events;\r\n\r\n\t//need for temporary disabling without modifying public config\r\n\tvar active = true;\r\n\tvar total_height = 0;\r\n\tvar multiday_height = 0;\r\n\r\n\tscheduler._pre_render_events = function(evs, hold) {\r\n\t\tif (!(scheduler.config.container_autoresize && active)) {\r\n\t\t\treturn old_pre_render_event.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar hb = this.xy.bar_height;\r\n\t\tvar h_old = this._colsS.heights;\r\n\t\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tif (!this._table_view)\r\n\t\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t\telse\r\n\t\t\tevs = this._pre_render_events_table(evs, hold);\r\n\r\n\t\tif (this._table_view) {\r\n\t\t\tif (hold){\r\n\t\t\t\tthis._colsS.heights = h_old;\r\n\t\t\t} else {\r\n\t\t\t\tvar evl = data.firstChild;\r\n\t\t\t\tconst rows = evl.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\t\tif (rows && rows.length) {\r\n\t\t\t\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\t\t\t\th[i]++;\r\n\r\n\t\t\t\t\t\tif ((h[i]) * hb > this._colsS.height - this.xy.month_head_height) { // 22 - height of cell's header\r\n\t\t\t\t\t\t\t//we have overflow, update heights\r\n\t\t\t\t\t\t\tvar cells = rows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\r\n\t\t\t\t\t\t\tvar cHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height){\r\n\t\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\trows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < cells.length; j++) {\r\n\t\t\t\t\t\t\t\tcells[j].childNodes[1].style.height = cHeight + \"px\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\th[i] = (h[i - 1] || 0) + cells[0].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\th[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(\".dhx_cal_month_cell\")[0].offsetHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\th.unshift(0);\r\n\t\t\t\t\tif (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {\r\n\t\t\t\t\t\t//we have v-scroll, decrease last day cell\r\n\r\n\t\t\t\t\t\t// NO CHECK SHOULD BE MADE ON VERTICAL SCROLL\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\t\th[0] = -1;\r\n\t\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\t\t\t\t\t\tvar dh = ((h[0] + 1) * hb + 1); // +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\t\tif(multiday_height != dh + 1) {\r\n\t\t\t\t\t\t\tthis._obj.style.height = (total_height - multiday_height + dh - 1) + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdh += \"px\";\r\n\t\t\t\t\t\tconst navHeight = this._els[\"dhx_cal_navline\"][0].offsetHeight;\r\n\t\t\t\t\t\tconst headerHeight = this._els[\"dhx_cal_header\"][0].offsetHeight;\r\n\t\t\t\t\t\tdata.style.height = (this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0)) + 'px';\r\n\t\t\t\t\t\tvar last = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\t\tlast = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t\tlast.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\t\th[0] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn evs;\r\n\t};\r\n\r\n\tvar checked_divs = [\"dhx_cal_navline\", \"dhx_cal_header\", \"dhx_multi_day\", \"dhx_cal_data\"];\r\n\tvar updateContainterHeight = function(is_repaint) {\r\n\t\ttotal_height = 0;\r\n\t\tfor (var i = 0; i < checked_divs.length; i++) {\r\n\r\n\t\t\tvar className = checked_divs[i];\r\n\t\t\tvar checked_div = (scheduler._els[className]) ? scheduler._els[className][0] : null;\r\n\t\t\tvar height = 0;\r\n\t\t\tswitch (className) {\r\n\t\t\t\tcase \"dhx_cal_navline\":\r\n\t\t\t\tcase \"dhx_cal_header\":\r\n\t\t\t\t\theight = checked_div.offsetHeight;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_multi_day\":\r\n\t\t\t\t\theight = (checked_div) ? checked_div.offsetHeight - 1 : 0;\r\n\t\t\t\t\tmultiday_height = height;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_cal_data\":\r\n\t\t\t\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\t\t\t\tif(checked_div.childNodes[1] && mode != \"month\") {\r\n\t\t\t\t\t\tlet maxHeight = 0;\r\n\t\t\t\t\t\tfor(let i = 0; i < checked_div.childNodes.length; i++){\r\n\t\t\t\t\t\t\tif(checked_div.childNodes[i].offsetHeight > maxHeight){\r\n\t\t\t\t\t\t\t\tmaxHeight = checked_div.childNodes[i].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight = maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theight = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"month\") {\r\n\t\t\t\t\t\tif (scheduler.config.month_day_min_height && !is_repaint) {\r\n\t\t\t\t\t\t\tvar rows_length = checked_div.querySelectorAll(\".dhx_cal_month_row\").length;\r\n\t\t\t\t\t\t\theight = rows_length * scheduler.config.month_day_min_height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"year\"){\r\n\t\t\t\t\t\theight = 190 * scheduler.config.year_y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"agenda\"){\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tif(checked_div.childNodes && checked_div.childNodes.length){\r\n\t\t\t\t\t\t\tfor(var j = 0; j < checked_div.childNodes.length; j++){\r\n\t\t\t\t\t\t\t\theight += checked_div.childNodes[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(height + 2 < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"week_agenda\"){\r\n\t\t\t\t\t\tvar min_height = scheduler.xy.week_agenda_scale_height + scheduler.config.min_grid_size,\r\n\t\t\t\t\t\t\tcur_height;\r\n\r\n\t\t\t\t\t\tvar column;\r\n\t\t\t\t\t\tfor(var k = 0; k < checked_div.childNodes.length; k++){\r\n\t\t\t\t\t\t\tcolumn = checked_div.childNodes[k];\r\n\t\t\t\t\t\t\tfor(var j = 0; j < column.childNodes.length; j++) {\r\n\t\t\t\t\t\t\t\tvar innerHeight = 0,\r\n\t\t\t\t\t\t\t\t\teventsContainer = column.childNodes[j].childNodes[1];\r\n\r\n\t\t\t\t\t\t\t\tfor(var g =0; g < eventsContainer.childNodes.length; g++){\r\n\t\t\t\t\t\t\t\t\tinnerHeight += eventsContainer.childNodes[g].offsetHeight;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tcur_height = innerHeight + scheduler.xy.week_agenda_scale_height;\r\n\t\t\t\t\t\t\t\tcur_height = (k == 1 && (j == 2 || j == 3)) ? cur_height * 2 : cur_height; // for last two cells;\r\n\r\n\t\t\t\t\t\t\t\tif (cur_height > min_height) {\r\n\t\t\t\t\t\t\t\t\tmin_height = cur_height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\theight = min_height * 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"map\") {\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tvar evs = checked_div.querySelectorAll(\".dhx_map_line\");\r\n\r\n\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (height + 2 < scheduler.config.min_map_size) {\r\n\t\t\t\t\t\t\theight = scheduler.config.min_map_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scheduler._gridView) {\r\n\t\t\t\t\t\theight = 0;\r\n\r\n\t\t\t\t\t\tif (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) {\r\n\t\t\t\t\t\t\tvar evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes;\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\theight += 2;\r\n\r\n\t\t\t\t\t\t\tif(height < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\theight += 0;\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\tvar cfg = scheduler.matrix[mode];\r\n\t\t\t\t\t\t\tvar rows = cfg.y_unit;\r\n\t\t\t\t\t\t\tfor(var r=0; r < rows.length; r++){\r\n\t\t\t\t\t\t\t\theight += cfg.getSectionHeight(rows[r].key);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Check and add extra height to avoid events hiding by the horizontal scrollbar\r\n\t\t\t\t\t\t\tif(scheduler.$container.clientWidth != scheduler.$container.scrollWidth){\r\n\t\t\t\t\t\t\t\theight += getScrollSize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight -= 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"day\" || mode == \"week\" || (scheduler._props && scheduler._props[mode])) {\r\n\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\theight += 1;\r\n\t\t\ttotal_height += height;\r\n\t\t}\r\n\t\tscheduler._obj.style.height = (total_height) + \"px\";\r\n\r\n\t\tif (!is_repaint)\r\n\t\t\tscheduler.updateView();\r\n\t};\r\n\r\n\tfunction callUpdate(){\r\n\t\tactive = false;\r\n\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\tactive = true;\r\n\t}\r\n\r\n\tvar conditionalUpdateContainerHeight = function() {\r\n\t\tif(!(scheduler.config.container_autoresize && active))\r\n\t\t\treturn true;\r\n\r\n\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\tif(!mode) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar asyncRepaint = window.requestAnimationFrame || window.setTimeout;\r\n\t\tvar scrollTop = document.documentElement.scrollTop;\r\n\r\n\t\tasyncRepaint(function() {\r\n\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateContainterHeight();\r\n\t\t});\r\n\r\n\t\tif ( (scheduler.matrix && scheduler.matrix[mode]) || mode == \"month\") {\r\n\t\t\tasyncRepaint(function() {\r\n\t\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tupdateContainterHeight(true);\r\n\t\t\t\tdocument.documentElement.scrollTop = scrollTop;\r\n\t\t\t\tcallUpdate();\r\n\t\t\t}, 1);\r\n\t\t}else{\r\n\t\t\tcallUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function(){\r\n\t\tvar autosizeEnabled = scheduler.config.container_autoresize;\r\n\t\tif(!scheduler.xy.$original_scroll_width){\r\n\t\t\tscheduler.xy.$original_scroll_width = scheduler.xy.scroll_width;\r\n\t\t}\r\n\r\n\t\tscheduler.xy.scroll_width = autosizeEnabled ? 0 : scheduler.xy.$original_scroll_width;\r\n\r\n\t\tif(scheduler.matrix){\r\n\t\t\tfor(var i in scheduler.matrix){\r\n\t\t\t\tvar timeline = scheduler.matrix[i];\r\n\t\t\t\tif(!timeline.$original_section_autoheight){\r\n\t\t\t\t\ttimeline.$original_section_autoheight = timeline.section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t\tif(autosizeEnabled){\r\n\t\t\t\t\ttimeline.section_autoheight = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttimeline.section_autoheight = timeline.$original_section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onXLE\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventChanged\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventCreated\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventAdded\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventDeleted\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onClearAll\", conditionalUpdateContainerHeight);\r\n\r\n\t//disable container autoresize when expanded\r\n\tscheduler.attachEvent(\"onBeforeExpand\", function(){\r\n\t\tactive = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeCollapse\", function(){\r\n\t\tactive = true;\r\n\t\treturn true;\r\n\t});\r\n\t// helper function\r\n\tfunction getScrollSize() {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tdiv.style.cssText = \"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\t\tdocument.body.appendChild(div);\r\n\t\tvar size = div.offsetWidth - div.clientWidth;\r\n\t\tdocument.body.removeChild(div);\r\n\t\treturn size;\r\n\t}\r\n\r\n\r\n}","export default function(scheduler){\r\n\tfunction setCookie(name,cookie_param,value) {\r\n\t\tvar str = name + \"=\" + value + (cookie_param?(\"; \"+cookie_param):\"\");\r\n\t\tdocument.cookie = str;\r\n\t}\r\n\tfunction getCookie(name) {\r\n\t\tvar search = name + \"=\";\r\n\t\tif (document.cookie.length > 0) {\r\n\t\t\tvar offset = document.cookie.indexOf(search);\r\n\t\t\tif (offset != -1) {\r\n\t\t\t\toffset += search.length;\r\n\t\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\tif (end == -1)\r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\t\treturn document.cookie.substring(offset, end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getCookieName(scheduler) {\r\n\t\treturn (scheduler._obj.id || \"scheduler\") + \"_settings\";\r\n\t}\r\n\r\n\tvar first = true;\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(oldMode,oldDate,mode,date){\r\n\t\t// if Url plugin is enabled - explicit url values should have more priority than cookies\r\n\t\tif (first && scheduler._get_url_nav){\r\n\t\t\tvar urlNavigationPlugin = scheduler._get_url_nav();\r\n\t\t\tif(urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event){\r\n\t\t\t\tfirst = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\r\n\t\tif (first){\r\n\t\t\tfirst = false;\r\n\t\t\tvar schedulerCookie = getCookie(cookie);\r\n\t\t\tif (schedulerCookie){\r\n\r\n\t\t\t\tif(!scheduler._min_date){\r\n\t\t\t\t\t//otherwise scheduler will have incorrect date until timeout\r\n\t\t\t\t\t//it can cause js error with 'onMouseMove' handler of key_nav.js\r\n\t\t\t\t\tscheduler._min_date = date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tschedulerCookie = unescape(schedulerCookie).split(\"@\");\r\n\t\t\t\tschedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]);\r\n\t\t\t\tvar view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode,\r\n\t\t\t\t\tdate = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date;\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscheduler.setCurrentView(date,view);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function (newMode , newDate){\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\t\tvar text = escape(this._helpers.formatDate(newDate)+\"@\"+(newMode));\r\n\t\tsetCookie(cookie,\"expires=Sun, 31 Jan 9999 22:00:00 GMT\",text);\r\n\t});\r\n\r\n\t// As we are blocking first render above there could be a problem in case of dynamic loading and rendering of visible data in general ('from'/'to' won't be defined)\r\n\tvar old_load = scheduler._load;\r\n\tscheduler._load = function() {\r\n\t\tvar args = arguments;\r\n\r\n\t\tif (!scheduler._date) {\r\n\t\t\tvar that = this;\r\n\t\t\twindow.setTimeout(function() {\r\n\t\t\t\told_load.apply(that, args);\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\told_load.apply(this, args);\r\n\t\t}\r\n\t};\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Day Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Drag Between\", scheduler.assert);\r\n}","export default function(scheduler){\r\n/* global dhtmlXCombo */\r\nscheduler.form_blocks['combo']={\r\n\trender:function(sns) {\r\n\t\tif (!sns.cached_options)\r\n\t\t\tsns.cached_options = {};\r\n\t\tvar res = '';\r\n\t\tres += \"
\";\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\t(function(){\r\n\t\t\tresetCombo();\r\n\t\t\tvar id = scheduler.attachEvent(\"onAfterLightbox\",function(){\r\n\t\t\t\t// otherwise destructor will never be called after form reset(e.g. in readonly event mode)\r\n\t\t\t\tresetCombo();\r\n\t\t\t\tscheduler.detachEvent(id);\r\n\t\t\t});\r\n\t\t\tfunction resetCombo(){\r\n\t\t\t\tif(node._combo && node._combo.DOMParent) {\r\n\t\t\t\t\tvar combo = node._combo;\r\n\t\t\t\t\tif(combo.unload){\r\n\t\t\t\t\t\tcombo.unload();\r\n\t\t\t\t\t}else if(combo.destructor){\r\n\t\t\t\t\t\tcombo.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// dhtmlxCombo 4.1.0 bug\r\n\t\t\t\t\tcombo.DOMParent = combo.DOMelem = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})();\r\n\t\twindow.dhx_globalImgPath = config.image_path||'/';\r\n\t\tnode._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);\r\n\t\tif (config.onchange)\r\n\t\t\tnode._combo.attachEvent(\"onChange\", config.onchange);\r\n\r\n\t\tif (config.options_height)\r\n\t\t\tnode._combo.setOptionHeight(config.options_height);\r\n\t\tvar combo = node._combo;\r\n\t\tcombo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache);\r\n\r\n\t\tif (!config.script_path) { // script-side filtration is used\r\n\t\t\tvar all_options = [];\r\n\t\t\tfor (var i = 0; i < config.options.length; i++) {\r\n\t\t\t\tvar option = config.options[i];\r\n\t\t\t\tvar single_option = [\r\n\t\t\t\t\toption.key,\r\n\t\t\t\t\toption.label,\r\n\t\t\t\t\toption.css\r\n\t\t\t\t];\r\n\t\t\t\tall_options.push(single_option);\r\n\t\t\t}\r\n\t\t\tcombo.addOption(all_options);\r\n\t\t\tif (ev[config.map_to]) {\r\n\t\t\t\tvar index = combo.getIndexByValue(ev[config.map_to]);\r\n\t\t\t\tcombo.selectOption(index);\r\n\t\t\t}\r\n\t\t} else { // server-side filtration is used\r\n\t\t\tvar selected_id = ev[config.map_to];\r\n\t\t\tif (selected_id) {\r\n\t\t\t\tif (config.cached_options[selected_id]) {\r\n\t\t\t\t\tcombo.addOption(selected_id, config.cached_options[selected_id]);\r\n\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.ajax.get(config.script_path+\"?id=\"+selected_id+\"&uid=\"+scheduler.uid(), function(result){\r\n\t\t\t\t\t\tvar responseText = result.xmlDoc.responseText;\r\n\t\t\t\t\t\tvar label;\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tvar res = JSON.parse(responseText);\r\n\t\t\t\t\t\t\tlabel = res.options[0].text;\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\tvar option = scheduler.ajax.xpath(\"//option\", result.xmlDoc)[0];\r\n\t\t\t\t\t\t\tlabel = option.childNodes[0].nodeValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconfig.cached_options[selected_id] = label;\r\n\t\t\t\t\t\tcombo.addOption(selected_id, label);\r\n\t\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcombo.setComboValue(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config) {\r\n\t\tvar selected_id = node._combo.getSelectedValue(); // value = key\r\n\t\tif (config.script_path) {\r\n\t\t\tconfig.cached_options[selected_id] = node._combo.getSelectedText();\r\n\t\t}\r\n\t\treturn selected_id;\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\nscheduler.form_blocks['radio']={\r\n\trender:function(sns) {\r\n\t\tvar res = '';\r\n\t\tres += ``;\r\n\t\tfor (var i=0; i\"+\" \"+sns.options[i].label+\" \";\r\n\t\t}\r\n\t\tres += \"
\";\r\n\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor (var i = 0; i < radiobuttons.length; i++) {\r\n\t\t\tradiobuttons[i].checked = false;\r\n\t\t\tvar checked_value = ev[config.map_to]||value;\r\n\t\t\tif (radiobuttons[i].value == checked_value) {\r\n\t\t\t\tradiobuttons[i].checked = true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor(var i=0; i ';\r\n\t\telse\r\n\t\t\treturn '';\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar id = scheduler.uid();\r\n\t\tvar isChecked = (typeof config.checked_value != \"undefined\") ? value == config.checked_value : !!value;\r\n\t\tnode.className += \" dhx_cal_checkbox\";\r\n\t\tvar check_html = \" \";\r\n\t\tvar label_html = \"\"+(scheduler.locale.labels[\"section_\"+config.name]||config.name)+\" \";\r\n\t\tif (scheduler.config.wide_form){\r\n\t\t\tnode.innerHTML = label_html;\r\n\t\t\tnode.nextSibling.innerHTML=check_html;\r\n\t\t} else\r\n\t\t\tnode.innerHTML=check_html+label_html;\r\n\r\n\t\tif (config.handler) {\r\n\t\t\tvar checkbox = node.getElementsByTagName('input')[0];\r\n\t\t\tif(checkbox.$_eventAttached){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcheckbox.$_eventAttached = true;\r\n\t\t\tscheduler.event(checkbox, \"click\", config.handler);\r\n\t\t\t//checkbox.onclick = config.handler;\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar checkbox = node.getElementsByTagName('input')[0]; // moved to the header\r\n\t\tif (!checkbox)\r\n\t\t\tcheckbox = node.nextSibling.getElementsByTagName('input')[0];\r\n\t\treturn (checkbox.checked)?(config.checked_value||true):(config.unchecked_value||false);\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.ext.fullscreen = {\r\n\ttoggleIcon: null\r\n};\r\n\r\nscheduler.expand = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeExpand\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt._position = t.style.position || \"\";\r\n\t\tt.style.position = \"static\";\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.position = \"absolute\";\r\n\tt._width = t.style.width;\r\n\tt._height = t.style.height;\r\n\tt.style.width = t.style.height = \"100%\";\r\n\tt.style.top = t.style.left = \"0px\";\r\n\r\n\tvar top = document.body;\r\n\ttop.scrollTop = 0;\r\n\r\n\ttop = top.parentNode;\r\n\tif (top)\r\n\t\ttop.scrollTop = 0;\r\n\tdocument.body._overflow = document.body.style.overflow || \"\";\r\n\tdocument.body.style.overflow = \"hidden\";\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onExpand\", []);\r\n};\r\nscheduler.collapse = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeCollapse\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt.style.position = t._position;\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.width = t._width;\r\n\tt.style.height = t._height;\r\n\tdocument.body.style.overflow = document.body._overflow;\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onCollapse\", []);\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar t = document.createElement(\"div\");\r\n\tt.className = \"dhx_expand_icon\";\r\n\tscheduler.ext.fullscreen.toggleIcon = t;\r\n\tt.innerHTML = `\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t \r\n\t \r\n\t`;\r\n\tscheduler._obj.appendChild(t);\r\n\tscheduler.event(t, \"click\", function() {\r\n\t\tif (!scheduler.expanded)\r\n\t\t\tscheduler.expand(); else\r\n\t\t\tscheduler.collapse();\r\n\t});\r\n});\r\nscheduler._maximize = function() {\r\n\tthis.expanded = !this.expanded;\r\n\tif(this.expanded){\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.add(\"dhx_expand_icon--expanded\");\r\n\t\t\r\n\t}else{\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.remove(\"dhx_expand_icon--expanded\");\r\n\t}\r\n\t\r\n\t//scheduler.ext.fullscreen.toggleIcon.style.backgroundPosition = \"0 \" + (this.expanded ? \"0\" : \"18\") + \"px\";\r\n\r\n\tvar directions = ['left', 'top'];\r\n\tfor (var i = 0; i < directions.length; i++) {\r\n\t\t//var margin = scheduler.xy['margin_' + directions[i]];\r\n\t\tvar prev_margin = scheduler['_prev_margin_' + directions[i]];\r\n\t\tif (scheduler.xy['margin_' + directions[i]]) {\r\n\t\t\tscheduler['_prev_margin_' + directions[i]] = scheduler.xy['margin_' + directions[i]];\r\n\t\t\tscheduler.xy['margin_' + directions[i]] = 0;\r\n\t\t} else {\r\n\t\t\tif (prev_margin) {\r\n\t\t\t\tscheduler.xy['margin_' + directions[i]] = scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t\tdelete scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.setCurrentView();\r\n};\r\n\r\n\r\n}\r\n","export default function(scheduler){\r\n\r\n\r\n(function(){\r\n\r\nfunction defaults(obj, std){\r\n\tfor (var key in std)\r\n\t\tif (!obj[key])\r\n\t\t\tobj[key] = std[key];\r\n\treturn obj;\r\n}\r\n\r\nfunction getElementSizes(element, scheduler) {\r\n\tvar sizes = {};\r\n\telement = scheduler._els[element];\r\n\tif (element && element[0]) {\r\n\t\tsizes.x = element[0].scrollWidth;\r\n\t\tsizes.y = element[0].scrollHeight;\r\n\t} else {\r\n\t\tsizes.x = 0;\r\n\t\tsizes.y = 0;\r\n\t}\r\n\treturn sizes;\r\n}\r\n\r\n//compatibility for new versions of scheduler\r\nif(!window.dhtmlxAjax){\r\n\twindow.dhtmlxAjax = {\r\n\t\tpost: function(url, data, callback){\r\n\t\t\treturn window.dhx4.ajax.post(url, data, callback);\r\n\t\t},\r\n\t\tget: function(url, callback){\r\n\t\t\treturn window.ajax.get(url, callback);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction add_export_methods(scheduler){\r\n\r\n\tscheduler.exportToPDF = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.pdf\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"pdf\");\r\n\t};\r\n\r\n\tscheduler.exportToPNG = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.png\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"png\");\r\n\t};\r\n\r\n\tscheduler.exportToICal = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.ical\",\r\n\t\t\tdata:this._serialize_plain(null, config)\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"ical\");\r\n\t};\r\n\r\n\tscheduler.exportToExcel = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.xlsx\",\r\n\t\t\ttitle:\"Events\",\r\n\t\t\tdata:this._serialize_plain( this.templates.xml_format, config),\r\n\t\t\tcolumns:this._serialize_columns()\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"excel\");\r\n\t};\r\n\r\n\tscheduler._ajax_to_export = function(data, type, callback){\r\n\t\tdelete data.callback;\r\n\t\tvar url = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\r\n\t\twindow.dhtmlxAjax.post(url,\r\n\t\t\t\"type=\"+type+\"&store=1&data=\"+encodeURIComponent(JSON.stringify(data)),\r\n\t\t\tfunction(loader){\r\n\t\t\t\tvar fail = loader.xmlDoc.status > 400;\r\n\t\t\t\tvar info = null;\r\n\r\n\t\t\t\tif (!fail){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tinfo = JSON.parse(loader.xmlDoc.responseText);\r\n\t\t\t\t\t}catch(e){}\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tscheduler._plain_export_copy = function(source, format){\r\n\t\tvar target = {};\r\n\t\tfor (var key in source)\r\n\t\t\ttarget[key] = source[key];\r\n\r\n\t\ttarget.start_date = format(target.start_date);\r\n\t\ttarget.end_date = format(target.end_date);\r\n\t\ttarget.$text = this.templates.event_text(source.start_date, source.end_date, source);\r\n\r\n\t\treturn target;\r\n\t};\r\n\r\n\tscheduler._serialize_plain = function(format, config){\r\n\t\tformat = format || scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\r\n\t\tvar events;\r\n\t\tif (config && config.start && config.end)\r\n\t\t\tevents = scheduler.getEvents(config.start, config.end);\r\n\t\telse\r\n\t\t\tevents = scheduler.getEvents();\r\n\r\n\t\tvar data = [];\r\n\t\tfor (var i = 0; i< events.length; i++)\r\n\t\t\tdata[i] = this._plain_export_copy(events[i], format);\r\n\r\n\t\treturn data;\r\n\t};\r\n\r\n\tscheduler._serialize_columns = function(){\r\n\t\treturn [\r\n\t\t\t{ id:\"start_date\", header:\"Start Date\", width:30 },\r\n\t\t\t{ id:\"end_date\", header:\"End Date\", width:30 },\r\n\t\t\t{ id:\"$text\", header:\"Text\", width:100 }\r\n\t\t];\r\n\t};\r\n\r\n\tscheduler._send_to_export = function(data, type){\r\n\t\tif(!data.version){\r\n\t\t\tdata.version = scheduler.version;\r\n\t\t}\r\n\r\n\t\tif(!data.skin){\r\n\t\t\tdata.skin = scheduler.skin;\r\n\t\t}\r\n\r\n\t\tif (data.callback)\r\n\t\t\t\treturn scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n\t\tvar form = this._create_hidden_form();\r\n\r\n\t\tform.firstChild.action = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\tform.firstChild.childNodes[1].value = type;\r\n\t\tform.firstChild.submit();\r\n\t};\r\n\r\n\tscheduler._create_hidden_form = function(){\r\n\t\tif (!this._hidden_export_form){\r\n\t\t\tvar t = this._hidden_export_form = document.createElement(\"div\");\r\n\t\t\tt.style.display = \"none\";\r\n\t\t\tt.innerHTML = \"\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t}\r\n\t\treturn this._hidden_export_form;\r\n\t};\r\n\r\n\tscheduler._get_export_size = function(format, orientation, zoom, dpi, header, footer, scales) {\r\n\r\n\t\tdpi = parseInt(dpi)/25.4 || 4;\r\n\r\n\t\tvar sizes = {\r\n\t\t\t\"A5\":{ x:148, y:210 },\r\n\t\t\t\"A4\":{ x:210, y:297 },\r\n\t\t\t\"A3\":{ x:297, y:420 },\r\n\t\t\t\"A2\":{ x:420, y:594 },\r\n\t\t\t\"A1\":{ x:594, y:841 },\r\n\t\t\t\"A0\":{ x:841, y:1189 }\r\n\t\t};\r\n\r\n\t\tvar dataX = getElementSizes(\"dhx_cal_data\", this).x;\r\n\t\tvar dataY = getElementSizes(\"dhx_cal_data\", this).y;\r\n\t\tvar headY = getElementSizes(\"dhx_cal_header\", this).y;\r\n\t\tvar multY = getElementSizes(\"dhx_multi_day\", this).y;\r\n\r\n\t\tvar cSize = {\r\n\t\t\ty: dataY + headY + multY\r\n\t\t};\r\n\r\n\t\tif (format === \"full\") {\r\n\t\t\tcSize.x = dataX;\r\n\t\t} else {\r\n\t\t\tcSize.x = Math.floor( (orientation === \"landscape\" ? sizes[format].y : sizes[format].x) * dpi );\r\n\t\t}\r\n\r\n\t\tif (scales) {\r\n\t\t\tcSize.x *= (parseFloat(scales.x) || 1);\r\n\t\t\tcSize.y *= (parseFloat(scales.y) || 1);\r\n\t\t}\r\n\r\n\t\treturn cSize;\r\n\t};\r\n\r\n\tfunction getTimeline() {\r\n\t\tvar mode = scheduler.getState().mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\treturn scheduler.matrix[mode];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getInitialSizes() {\r\n\t\tvar smartRendering = undefined,\r\n\t\t\tscrollable = undefined;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (timeline) {\r\n\t\t\tscrollable = timeline.scrollable;\r\n\t\t\tsmartRendering = timeline.smart_rendering;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tnav_height: scheduler.xy.nav_height,\r\n\t\t\tscroll_width: scheduler.xy.scroll_width,\r\n\t\t\tstyle_width: scheduler._obj.style.width,\r\n\t\t\tstyle_height: scheduler._obj.style.height,\r\n\t\t\ttimeline_scrollable: scrollable,\r\n\t\t\ttimeline_smart_rendering: smartRendering\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setExportSizes(size, initialSizes) {\r\n\t\tscheduler._obj.style.width = size.x + \"px\";\r\n\t\tscheduler._obj.style.height = size.y + \"px\";\r\n\r\n\t\tscheduler.xy.nav_height = 0;\r\n\t\tscheduler.xy.scroll_width = 0;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\r\n\t\t\ttimeline.scrollable = false;\r\n\t\t\ttimeline.smart_rendering = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setInitialSizes(initialSizes) {\r\n\t\tscheduler.xy.scroll_width = initialSizes.scroll_width;\r\n\t\tscheduler.xy.nav_height = initialSizes.nav_height;\r\n\t\tscheduler._obj.style.width = initialSizes.style_width;\r\n\t\tscheduler._obj.style.height = initialSizes.style_height;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\t\t\ttimeline.scrollable = initialSizes.timeline_scrollable;\r\n\t\t\ttimeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler._export_html = function (obj) {\r\n\t\tvar initialSizes = getInitialSizes();\r\n\t\tvar size = scheduler._get_export_size(obj.format, obj.orientation, obj.zoom, obj.dpi, obj.header, obj.footer, obj.scales);\r\n\r\n\t\tvar html = \"\";\r\n\t\ttry {\r\n\t\t\tsetExportSizes(size, initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t\thtml = scheduler._obj.innerHTML;\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.error(e);\r\n\t\t} finally {\r\n\t\t\tsetInitialSizes(initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t}\r\n\r\n\t\treturn html;\r\n\t};\r\n\r\n}\r\n\r\nadd_export_methods(scheduler);\r\n\r\n\r\n})();\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Grid\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tvar els = document.body.getElementsByTagName(\"DIV\");\r\n\tfor (var i=0; i < els.length; i++) {\r\n\t\tvar cs = els[i].className||\"\";\r\n\t\tcs = cs.split(\":\");\r\n\t\tif (cs.length == 2 && cs[0] == \"template\"){\r\n\t\t\tvar code = \"return \\\"\"+(els[i].innerHTML||\"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r]+/g,\"\")+\"\\\";\";\r\n\t\t\tcode = unescape(code).replace(/\\{event\\.([a-z]+)\\}/g,function(all,mask){\r\n\t\t\t\treturn '\"+ev.'+mask+'+\"';\r\n\t\t\t});\r\n\t\t\tscheduler.templates[cs[1]]=Function(\"start\",\"end\",\"ev\",code);\r\n\t\t\tels[i].style.display='none';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n}","import keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport marker from \"./keyboard_navigation/marker\";\r\nimport scheduler_node from \"./keyboard_navigation/elements/scheduler_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport event from \"./keyboard_navigation/elements/event\";\r\nimport time_slot from \"./keyboard_navigation/elements/time_slot\";\r\nimport minical_button from \"./keyboard_navigation/elements/minical_button\";\r\nimport minical_cell from \"./keyboard_navigation/elements/minical_cell\";\r\nimport data_area from \"./keyboard_navigation/elements/data_area\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\nimport key_nav_legacy from \"./keyboard_navigation/key_nav_legacy\";\r\n\r\n\r\nimport scheduler_handlers from \"./keyboard_navigation/scheduler_handlers\";\r\nimport minical_handlers from \"./keyboard_navigation/minical_handlers\";\r\n\r\nexport default function(scheduler){\r\n\t\tscheduler.config.key_nav = true;\r\n\t\tscheduler.config.key_nav_step = 30;\r\n\t\tscheduler.addShortcut = function(shortcut, handler, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.getShortcutHandler = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tvar commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\tif(commands.length){\r\n\t\t\t\t\treturn scopeObject.prototype.findHandler(commands[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.removeShortcut = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.focus = function(){\r\n\t\t\tif(!scheduler.config.key_nav){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar disp = scheduler.$keyboardNavigation.dispatcher;\r\n\t\t\tdisp.enable();\r\n\t\t\tvar activeNode = disp.getActiveNode();\r\n\t\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){\r\n\t\t\t\tdisp.setDefaultNode();\r\n\t\t\t}else{\r\n\t\t\t\tdisp.focusNode(disp.getActiveNode());\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction getScope(mode){\r\n\t\t\tvar scopes = {\r\n\t\t\t\t\"minicalButton\":scheduler.$keyboardNavigation.MinicalButton,\r\n\t\t\t\t\"minicalDate\":scheduler.$keyboardNavigation.MinicalCell,\r\n\t\t\t\t\"scheduler\":scheduler.$keyboardNavigation.SchedulerNode,\r\n\t\t\t\t\"dataArea\": scheduler.$keyboardNavigation.DataArea,\r\n\t\t\t\t\"timeSlot\": scheduler.$keyboardNavigation.TimeSlot,\r\n\t\t\t\t\"event\": scheduler.$keyboardNavigation.Event\r\n\t\t\t};\r\n\r\n\t\t\tvar searchMap = {};\r\n\t\t\tfor(var i in scopes)\r\n\t\t\t\tsearchMap[i.toLowerCase()] = scopes[i];\r\n\r\n\t\t\tmode = (mode + \"\").toLowerCase();\r\n\r\n\t\t\treturn searchMap[mode] || scopes.scheduler;\r\n\t\t}\r\n\r\n\t\tscheduler.$keyboardNavigation = {};\r\n\r\n\t\tscheduler._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(scheduler);\r\n\t\teventhandler(scheduler);\r\n\t\ttrap_modal_focus(scheduler);\r\n\t\tmarker(scheduler);\r\n\t\tscheduler_node(scheduler);\r\n\t\tnav_node(scheduler);\r\n\t\theader_cell(scheduler);\r\n\t\tevent(scheduler);\r\n\t\ttime_slot(scheduler);\r\n\t\tminical_button(scheduler);\r\n\t\tminical_cell(scheduler);\r\n\t\tdata_area(scheduler);\r\n\t\tmodals(scheduler);\r\n\t\tcore(scheduler);\r\n\t\tkey_nav_legacy(scheduler);\r\n\r\n\t\t(function(){\r\n\t\t\tscheduler_handlers(scheduler);\r\n\t\t\tminical_handlers(scheduler);\r\n\r\n\t\t\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tscheduler.$keyboardNavigation.attachSchedulerHandlers();\r\n\r\n\t\t\tif(scheduler.renderCalendar){\r\n\t\t\t\t// if minical ext loaded before key nav ext - patch it now\r\n\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t}else{\r\n\t\t\t\t// otherwise - wait until everything is loaded and try again\r\n\t\t\t\tvar attachOnce = scheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\t\t\t\tscheduler.detachEvent(attachOnce);\r\n\t\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction isSchedulerSelected(){\r\n\t\t\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\t\t\tvar enable;\r\n\t\t\t\tvar focusElement = document.activeElement;\r\n\t\t\t\t// halt key nav when focus is outside scheduler or in quick info popup\r\n\t\t\t\tif(!focusElement || scheduler.utils.dom.locateCss(focusElement, \"dhx_cal_quick_info\", false)){\r\n\t\t\t\t\tenable = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tenable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn enable;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction changeState(enable){\r\n\t\t\t\tif(enable && !dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst intervalId = setInterval(function(){\r\n\t\t\t\tif(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enable = isSchedulerSelected();\r\n\r\n\t\t\t\tif(enable){\r\n\t\t\t\t\tchangeState(enable);\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// doublecheck in case checking is done in handler before focus element is repainted\r\n\t\t\t\t\t\tif(scheduler.config.key_nav){\r\n\t\t\t\t\t\t\tchangeState(isSchedulerSelected());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}, 500);\r\n\t\t\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t});\r\n\t\t})();\r\n\t}\r\n\r\n\r\n","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.shortcuts = {\r\n\tcreateCommand: function(){\r\n\t\treturn {\r\n\t\t\tmodifiers:{\r\n\t\t\t\t\"shift\": false,\r\n\t\t\t\t\"alt\": false,\r\n\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\"meta\": false\r\n\t\t\t},\r\n\t\t\tkeyCode: null\r\n\t\t};\r\n\t},\r\n\tparse: function(shortcut){\r\n\t\tvar commands = [];\r\n\r\n\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\tfor(var i = 0; i < expr.length; i++){\r\n\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\tfor(var j = 0; j < words.length; j++){\r\n\t\t\t\tif(this.commandKeys[words[j]]){\r\n\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t}else if(this.specialKeys[words[j]]){\r\n\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcommands.push(command);\r\n\t\t}\r\n\t\treturn commands;\r\n\t},\r\n\r\n\tgetCommandFromEvent: function(domEvent){\r\n\t\tvar command = this.createCommand();\r\n\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t}\r\n\r\n\t\tvar printableKey = String.fromCharCode(command.keyCode );\r\n\t\tif(printableKey){\r\n\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t}\r\n\t\treturn command;\r\n\t},\r\n\r\n\tgetHashFromEvent: function(domEvent){\r\n\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t},\r\n\r\n\tgetHash: function(command){\r\n\t\tvar parts = [];\r\n\t\tfor(var i in command.modifiers){\r\n\t\t\tif(command.modifiers[i]){\r\n\t\t\t\tparts.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tparts.push(command.keyCode);\r\n\r\n\t\treturn parts.join(this.junctionChar);\r\n\t},\r\n\r\n\tgetExpressions: function(shortcut){\r\n\t\treturn shortcut.split(this.junctionChar);\r\n\t},\r\n\tgetWords: function(term){\r\n\t\treturn term.split(this.combinationChar);\r\n\t},\r\n\ttrim: function(shortcut){\r\n\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t},\r\n\tjunctionChar:\",\",\r\n\tcombinationChar:\"+\",\r\n\tcommandKeys:{\r\n\t\t\"shift\": 16,\r\n\t\t\"alt\": 18,\r\n\t\t\"ctrl\": 17,\r\n\t\t\"meta\": true\r\n\t},\r\n\tspecialKeys:{\r\n\t\t\"backspace\": 8,\r\n\t\t\"tab\": 9,\r\n\t\t\"enter\": 13,\r\n\t\t\"esc\": 27,\r\n\t\t\"space\": 32,\r\n\t\t\"up\": 38,\r\n\t\t\"down\": 40,\r\n\t\t\"left\": 37,\r\n\t\t\"right\": 39,\r\n\t\t\"home\": 36,\r\n\t\t\"end\": 35,\r\n\t\t\"pageup\": 33,\r\n\t\t\"pagedown\": 34,\r\n\t\t\"delete\": 46,\r\n\t\t\"insert\": 45,\r\n\t\t\"plus\":107,\r\n\t\t\"f1\": 112,\r\n\t\t\"f2\": 113,\r\n\t\t\"f3\": 114,\r\n\t\t\"f4\": 115,\r\n\t\t\"f5\": 116,\r\n\t\t\"f6\": 117,\r\n\t\t\"f7\": 118,\r\n\t\t\"f8\": 119,\r\n\t\t\"f9\": 120,\r\n\t\t\"f10\": 121,\r\n\t\t\"f11\": 122,\r\n\t\t\"f12\": 123\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.EventHandler = {\r\n\t_handlers: null,\r\n\tfindHandler: function(command){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\treturn this._handlers[hash];\r\n\t},\r\n\r\n\tdoAction: function(command, e){\r\n\t\tvar handler = this.findHandler(command);\r\n\t\tif(handler){\r\n\t\t\thandler.call(this, e);\r\n\r\n\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\telse e.returnValue = false;\r\n\r\n\t\t}\r\n\t},\r\n\tbind: function(shortcut, handler){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t}\r\n\t},\r\n\tunbind: function(shortcut){\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tif(this._handlers[shortcuts.getHash(commands[i])]){\r\n\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbindAll: function(map){\r\n\t\tfor(var i in map){\r\n\t\t\tthis.bind(i, map[i]);\r\n\t\t}\r\n\t},\r\n\tinitKeys: function(){\r\n\t\tif(!this._handlers)\r\n\t\t\tthis._handlers = {};\r\n\t\tif(this.keys){\r\n\t\t\tthis.bindAll(this.keys);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n(function(){\r\n\tscheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;\r\n\r\n\tscheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){\r\n\t\tif(e.keyCode != 9) return false;\r\n\r\n\t\tvar focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);\r\n\t\tvar currentFocus = document.activeElement;\r\n\t\tvar currentIndex = -1;\r\n\t\tfor(var i = 0; i < focusable.length; i++){\r\n\t\t\tif(focusable[i] == currentFocus){\r\n\t\t\t\tcurrentIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextIndex, nextItem;\r\n\t\tif(e.shiftKey){\r\n\r\n\t\t\t// back tab\r\n\t\t\t// go to the last element if we focused on the first\r\n\t\t\tnextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);\r\n\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t// forward tab\r\n\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\tnextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.marker = {\r\n\tclear: function(){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_focus_slot\");\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].parentNode.removeChild(divs[i]);\r\n\t\t}\r\n\t},\r\n\tcreateElement: function(){\r\n\t\tvar element = document.createElement(\"div\");\r\n\t\telement.setAttribute(\"tabindex\", -1);\r\n\t\telement.className = \"dhx_focus_slot\";\r\n\t\treturn element;\r\n\t},\r\n\r\n\trenderMultiple: function(start, end, method){\r\n\t\tvar divs = [];\r\n\t\tvar currentStart = new Date(start);\r\n\t\tvar currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, \"day\").valueOf()));\r\n\t\twhile(currentStart.valueOf() < end.valueOf()){\r\n\r\n\t\t\tdivs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));\r\n\t\t\tcurrentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\r\n\t\t\tcurrentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\t\t\tcurrentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));\r\n\t\t}\r\n\r\n\t\treturn divs;\r\n\t},\r\n\r\n\r\n\trender: function(start, end, section){\r\n\t\tthis.clear();\r\n\t\tvar divs = [];\r\n\r\n\t\tvar modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;\r\n\t\tvar view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();\r\n\t\tswitch (view){\r\n\t\t\tcase modes.units:\r\n\t\t\t\tdivs = this.renderVerticalMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.timeline:\r\n\t\t\t\tdivs = this.renderTimelineMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.year:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.month:\r\n\t\t\t\tdivs = this.renderMonthMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.weekAgenda:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.list:\r\n\t\t\t\tdivs = this.renderAgendaMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.dayColumns:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.addWaiAriaLabel(divs, start, end, section);\r\n\t\tthis.addDataAttributes(divs, start, end, section);\r\n\r\n\t\tfor(var i = divs.length - 1; i >= 0; i--){\r\n\t\t\tif(divs[i].offsetWidth){\r\n\t\t\t\treturn divs[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\taddDataAttributes: function(divs, start, end, section){\r\n\t\tvar dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\r\n\t\tvar from = dateToStr(start),\r\n\t\t\tto = dateToStr(end);\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].setAttribute(\"data-start-date\", from);\r\n\t\t\tdivs[i].setAttribute(\"data-end-date\", to);\r\n\t\t\tif(section){\r\n\t\t\t\tdivs[i].setAttribute(\"data-section\", section);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\taddWaiAriaLabel: function(divs, start, end, section){\r\n\t\tvar label = \"\";\r\n\t\tvar state = scheduler.getState();\r\n\t\tvar mode = state.mode;\r\n\r\n\t\tvar dateTimeLabel = false;\r\n\r\n\t\tlabel += scheduler.templates.day_date(start);\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){\r\n\t\t\tlabel += \" \" + scheduler.templates.hour_scale(start);\r\n\t\t\tdateTimeLabel = true;\r\n\t\t}\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){\r\n\r\n\t\t\tlabel += \" - \" + scheduler.templates.day_date(end);\r\n\t\t\tif(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){\r\n\t\t\t\tlabel += \" \" + scheduler.templates.hour_scale(end);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(section){\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tconst timeline = scheduler.matrix[mode];\r\n\t\t\t\tconst sectionObject = timeline.y_unit[timeline.order[section]];\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_label\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tconst units = scheduler._props[mode];\r\n\t\t\t\tconst sectionObject = units.options[units.order[section]];\r\n\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_text\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tscheduler._waiAria.setAttributes(divs[i], {\r\n\t\t\t\t\"aria-label\": label,\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\trenderWeekAgendaMarker: function(start_date, end_date){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_wa_day_cont .dhx_wa_scale_bar\");\r\n\r\n\t\tvar currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(start_date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(index != -1) return this._wrapDiv(divs[index]);\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_wrapDiv: function(cell){\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = cell.offsetTop + \"px\";\r\n\t\tmarker.style.left = cell.offsetLeft + \"px\";\r\n\t\tmarker.style.width = cell.offsetWidth + \"px\";\r\n\t\tmarker.style.height = cell.offsetHeight + \"px\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\trenderYearMarker: function(start_date, end_date){\r\n\t\tvar cell = scheduler._get_year_cell(start_date);\r\n\t\tcell.style.position = \"relative\";\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = \"0px\";\r\n\t\tmarker.style.left = \"0px\";\r\n\t\tmarker.style.width = \"100%\";\r\n\t\tmarker.style.height = \"100%\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\r\n\trenderAgendaMarker: function(start_date, end_date){\r\n\t\tvar block = this.createElement();\r\n\t\tblock.style.height = \"1px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tblock.style.opacity = 1;\r\n\t\tblock.style.top = \"0px\";\r\n\t\tblock.style.left = \"0px\";\r\n\t\tscheduler.$container.querySelector(\".dhx_cal_data\").appendChild(block);\r\n\t\treturn [block];\r\n\t},\r\n\r\n\trenderTimelineMarker: function(start_date, end_date, section){\r\n\t\tvar view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);\r\n\t\tvar areas = view_opts._scales;\r\n\t\t//timespans must always use actual position, not rounded\r\n\t\tview_opts.round_position = false;\r\n\t\tvar blocks = [];\r\n\r\n\t\tvar min_date = start_date ? new Date(start_date) : scheduler._min_date;\r\n\t\tvar max_date = end_date ? new Date(end_date) : scheduler._max_date;\r\n\r\n\t\tif(min_date.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\tmin_date = new Date(scheduler._min_date);\r\n\t\tif(max_date.valueOf() > scheduler._max_date.valueOf())\r\n\t\t\tmax_date = new Date(scheduler._max_date);\r\n\r\n\t\tif(!view_opts._trace_x) return blocks;\r\n\r\n\t\tfor(var i = 0; i < view_opts._trace_x.length; i++){\r\n\t\t\tif(scheduler._is_column_visible(view_opts._trace_x[i]))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(i == view_opts._trace_x.length)\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar area = areas[section];\r\n\r\n\t\tif (!(min_date < end_date && max_date > start_date))\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\tlet start_pos;\r\n\t\tlet end_pos;\r\n\r\n\t\tfunction set_date_part(source, target) {\r\n\t\t\t// reset to start of the month in order to prevent month change when target is on 31th day, and source month has only 30 days\r\n\t\t\ttarget.setDate(1);\r\n\r\n\t\t\ttarget.setFullYear(source.getFullYear());\r\n\t\t\ttarget.setMonth(source.getMonth());\r\n\t\t\ttarget.setDate(source.getDate());\r\n\t\t}\r\n\r\n\t\tif(!scheduler.getView().days){\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts);\r\n\t\t}else{\r\n\t\t\t// daytimeline\r\n\t\t\tconst tempStart = new Date(start_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempStart);\r\n\t\t\tconst tempEnd = new Date(end_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempEnd);\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: tempStart}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: tempEnd}, false, view_opts);\r\n\t\t}\r\n\r\n\t\tvar height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));\r\n\r\n\t\tvar top = 0;\r\n\t\tif (scheduler._isRender('cell')){\r\n\t\t\ttop = area.offsetTop;\r\n\t\t\tstart_pos += view_opts.dx;\r\n\t\t\tend_pos += view_opts.dx;\r\n\t\t\tarea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}else{\r\n\r\n\t\t}\r\n\t\tvar width = Math.max(1, end_pos - start_pos - 1);\r\n\t\tlet direction = \"left\";\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tdirection = \"right\";\r\n\t\t}\r\n\t\tblock.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`;\r\n\r\n\t\tif(area){\r\n\t\t\tarea.appendChild(block);\r\n\t\t\tblocks.push(block);\r\n\t\t}\r\n\r\n\t\treturn blocks;\r\n\t},\r\n\r\n\trenderMonthCell: function(date){\r\n\t\tvar cells = scheduler.$container.querySelectorAll(\".dhx_month_head\");\r\n\r\n\t\tvar divs = [];\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tdivs.push(cells[i].parentNode);\r\n\t\t}\r\n\r\n\t\tvar firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar weekNumber = 0;\r\n\t\tvar dayIndex = -1;\r\n\t\tvar currDate = firstDate;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\r\n\t\t\tif(dayIndex == 6){\r\n\t\t\t\tweekNumber++;\r\n\t\t\t\tdayIndex = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdayIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(index == -1){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar left = scheduler._colsS[dayIndex];\r\n\t\tvar top = scheduler._colsS.heights[weekNumber];\r\n\r\n\t\tvar div = this.createElement();\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + \"px\";\r\n\t\tdiv.style.width = scheduler._cols[dayIndex] + \"px\";\r\n\t\tdiv.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + \"px\" ;\r\n\r\n\r\n\t\tvar container = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\r\n\t\tvar datatable = container.querySelector(\".dhx_cal_month_table\");\r\n\t\tif(datatable.nextSibling){\r\n\t\t\tcontainer.insertBefore(div, datatable.nextSibling);\r\n\t\t}else{\r\n\t\t\tcontainer.appendChild(div);\r\n\t\t}\r\n\t\treturn div;\r\n\t},\r\n\trenderMonthMarker: function(start_date, end_date){\r\n\t\tvar res = [];\r\n\t\tvar currentDate = start_date;\r\n\t\twhile(currentDate.valueOf() < end_date.valueOf()){\r\n\t\t\tres.push(this.renderMonthCell(currentDate));\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, \"day\");\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\trenderVerticalMarker: function(start_date, end_date, section){\r\n\t\tvar index = scheduler.locate_holder_day(start_date);\r\n\r\n\t\tvar divs = [];\r\n\t\tvar area = null;\r\n\r\n\t\tvar c = scheduler.config;\r\n\t\tif(scheduler._ignores[index]) return divs;\r\n\r\n\t\tif (scheduler._props && scheduler._props[scheduler._mode] && section) {\r\n\t\t\tvar view = scheduler._props[scheduler._mode];\r\n\t\t\tindex = view.order[section];\r\n\r\n\t\t\tvar inner_index = view.order[section];\r\n\t\t\tif(!(view.days > 1)){\r\n\t\t\t\tindex = inner_index;\r\n\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//var units_l = view.size || view.options.length;\r\n\r\n\t\t\t\tindex = scheduler.locate_holder_day(start_date) + inner_index;\r\n\t\t\t\t//index = index*units_l + inner_index;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarea = scheduler.locate_holder(index);\r\n\t\tif(!area || area.querySelector(\".dhx_scale_hour\")){\r\n\t\t\t// hour scale instead of date column\r\n\t\t\treturn document.createElement(\"div\");\r\n\t\t}\r\n\r\n\t\tvar start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);\r\n\r\n\r\n\t\tvar end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);\r\n\t\tif(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){\r\n\t\t\tend = c.last_hour*60;\r\n\t\t}\r\n\r\n\t\tif (end <= start) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\tvar all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;\r\n\t\tvar hour_ms = 60*60*1000;\r\n\t\tblock.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\tblock.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tarea.appendChild(block);\r\n\t\tdivs.push(block);\r\n\t\treturn divs[0];\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tgetDefaultNode: function(){\r\n\t\t\tvar node = new scheduler.$keyboardNavigation.TimeSlot();\r\n\r\n\t\t\tif(!node.isValid()){\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\t_modes:{\r\n\t\t\tmonth: \"month\",\r\n\t\t\tyear: \"year\",\r\n\t\t\tdayColumns: \"dayColumns\",\r\n\t\t\ttimeline:\"timeline\",\r\n\t\t\tunits:\"units\",\r\n\t\t\tweekAgenda: \"weekAgenda\",\r\n\t\t\tlist: \"list\"\r\n\t\t},\r\n\t\tgetMode: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar mode = state.mode;\r\n\t\t\tif((scheduler.matrix && scheduler.matrix[mode])){\r\n\t\t\t\treturn this._modes.timeline;\r\n\t\t\t} else if((scheduler._props && scheduler._props[mode])){\r\n\t\t\t\treturn this._modes.units;\r\n\t\t\t}else if(mode == \"month\"){\r\n\t\t\t\treturn this._modes.month;\r\n\t\t\t}else if(mode == \"year\"){\r\n\t\t\t\treturn this._modes.year;\r\n\t\t\t}else if(mode == \"week_agenda\"){\r\n\t\t\t\treturn this._modes.weekAgenda;\r\n\t\t\t}else if(mode == \"map\" || mode == \"agenda\" || (scheduler._grid && scheduler[\"grid_\" + mode])){\r\n\t\t\t\treturn this._modes.list;\r\n\t\t\t}else{\r\n\t\t\t\treturn this._modes.dayColumns;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.focus();\r\n\t\t},\r\n\r\n\t\tblur: function(){\r\n\r\n\t\t},\r\n\r\n\t\tdisable: function(){\r\n\t\t\tscheduler.$container.setAttribute(\"tabindex\", \"0\");\r\n\t\t},\r\n\t\tenable: function(){\r\n\t\t\tif(scheduler.$container)\r\n\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t},\r\n\t\tisEnabled: function(){\r\n\t\t\treturn scheduler.$container.hasAttribute(\"tabindex\");\r\n\t\t},\r\n\r\n\r\n\t\t_compareEvents: function(a, b){\r\n\t\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t\treturn a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;\r\n\t\t},\r\n\r\n\t\t_pickEvent: function(from, to, startId, reverse){\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tfrom = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));\r\n\t\t\tto = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));\r\n\r\n\t\t\tvar evs = scheduler.getEvents(from, to);\r\n\t\t\tevs.sort(this._compareEvents);\r\n\t\t\tif(reverse){\r\n\t\t\t\tevs = evs.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tvar trim = !!startId;\r\n\t\t\tfor(var i =0; i < evs.length && trim; i++){\r\n\t\t\t\tif(evs[i].id == startId){\r\n\t\t\t\t\ttrim = false;\r\n\t\t\t\t}\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\tvar eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);\r\n\t\t\t\tif(eventElement.getNode())\r\n\t\t\t\t\treturn evs[i];\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tnextEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tcurrEvent.start_date,\r\n\t\t\t\t\tscheduler.date.add(currEvent.start_date, 1, \"year\"),\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tvisibleDates.min_date,\r\n\t\t\t\t\tscheduler.date.add(visibleDates.min_date, 1, \"year\"),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.nextEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tprevEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(currEvent.end_date, -1, \"year\"),\r\n\t\t\t\t\tcurrEvent.end_date,\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(visibleDates.max_date, -1, \"year\"),\r\n\t\t\t\t\tvisibleDates.max_date,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.prevEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\r\n\t\t\t\"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9\": function(e){\r\n\t\t\t\tvar tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(\".dhx_cal_navline .dhx_cal_tab\");\r\n\t\t\t\tvar key = e.key;\r\n\t\t\t\tif(key === undefined){\r\n\t\t\t\t\tkey = e.keyCode - 48;\r\n\t\t\t\t}\r\n\t\t\t\tif(tabs[key*1 - 1]){\r\n\t\t\t\t\ttabs[key*1 - 1].click();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+left,meta+left\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+right,meta+right\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+up,meta+up\":function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop -= 20;\r\n\t\t\t},\r\n\t\t\t\"ctrl+down,meta+down\": function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop += 20;\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"e\": function(){\r\n\t\t\t\tthis.nextEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"home\": function(){\r\n\t\t\t\tscheduler.setCurrentView(new Date());\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+e\": function(){\r\n\t\t\t\tthis.prevEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+enter,meta+enter\": function(){\r\n\t\t\t\tscheduler.addEventNow({start_date: new Date(scheduler.getState().date)});\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+c,meta+c\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+v,meta+v\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+x,meta+x\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tmoveTo: function (element) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t},\r\n\r\n\t\tcompareTo: function(b){\r\n\t\t\t// good enough comparison of two random objects\r\n\t\t\tif(!b) return false;\r\n\t\t\tfor(var i in this){\r\n\t\t\t\tif(!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\tif(canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\tif(!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\tif(b[i] != this[i]) return false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){},\r\n\t\tfocus: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className += \" scheduler_focused\";\r\n\t\t\t\tif(node.focus) node.focus();\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className = (node.className || \"\").replace(/ ?scheduler_focused/g, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.HeaderCell = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\tindex = index || this.index || 0;\r\n\t\t\tvar nodes = this.getNodes();\r\n\t\t\tif(nodes[index]) return nodes[index];\r\n\t\t},\r\n\r\n\t\tgetNodes: function(selector){\r\n\t\t\tselector = selector || [\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_prev_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_next_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_today_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_tab\"\r\n\t\t\t\t].join(\", \");\r\n\r\n\t\t\tvar nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));\r\n\t\t\tnodes.sort(function(a, b){\r\n\t\t\t\treturn a.offsetLeft - b.offsetLeft;\r\n\t\t\t});\r\n\t\t\treturn nodes;\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn !!this.getNode(this.index);\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\tvar defaultCell = this.getNode(0);\r\n\t\t\tif(!defaultCell){\r\n\t\t\t\tdefaultCell = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t\treturn defaultCell;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tvar newIndex = this.index - 1;\r\n\t\t\t\tif(newIndex < 0){\r\n\t\t\t\t\tnewIndex = this.getNodes().length - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tvar newIndex = this.index + 1;\r\n\t\t\t\tif(newIndex >= this.getNodes().length){\r\n\t\t\t\t\tnewIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t},\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.Event = function(id){\r\n\tthis.eventId = null;\r\n\tif(scheduler.getEvent(id)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tthis.start = new Date(ev.start_date);\r\n\t\tthis.end = new Date(ev.end_date);\r\n\r\n\t\tthis.section = this._getSection(ev);\r\n\t\tthis.eventId = id;\r\n\t}\r\n};\r\n\r\nscheduler.$keyboardNavigation.Event.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_getNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\"[\"+scheduler.config.event_attribute+\"]\"));\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\tgetMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\t_handlers: null,\r\n\t\tisValid: function(){\r\n\t\t\treturn !!(scheduler.getEvent(this.eventId) && this.getNode());\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar eventNode = this._getNodes()[0];\r\n\t\t\tvar defaultElement = null;\r\n\t\t\tif(!eventNode || !(scheduler._locate_event(eventNode))){\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}else{\r\n\t\t\t\tvar id = scheduler._locate_event(eventNode);\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.Event(id);\r\n\t\t\t}\r\n\r\n\t\t\treturn defaultElement;\r\n\t\t},\r\n\r\n\t\tisScrolledIntoView: function (el) {\r\n\t\t\tvar eventBox = el.getBoundingClientRect();\r\n\t\t\tvar viewPort = scheduler.$container.querySelector(\".dhx_cal_data\").getBoundingClientRect();\r\n\t\t\t\r\n\t\t\tif(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){\r\n\r\n\t\t\tvar idSelector = \"[\"+scheduler.config.event_attribute+\"='\"+this.eventId+\"']\";\r\n\r\n\t\t\tvar inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);\r\n\t\t\tif(inlineEditor){// is inline editor visible\r\n\t\t\t\treturn inlineEditor;\r\n\t\t\t}else{\r\n\t\t\t\tif(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){\r\n\t\t\t\t\tvar nodes = scheduler.$container.querySelectorAll(idSelector);\r\n\t\t\t\t\tfor(var i = 0; i < nodes.length; i++){\r\n\t\t\t\t\t\tif(this.isScrolledIntoView(nodes[i])){\r\n\t\t\t\t\t\t\treturn nodes[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nodes[0];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn scheduler.$container.querySelector(idSelector);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tvar event = scheduler.getEvent(this.eventId);\r\n\r\n\t\t\tvar calendar = scheduler.getState();\r\n\t\t\tif(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(event.start_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif (this.isScrolledIntoView(node)) {\r\n\t\t\t\tscheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t\t}).bind(this));\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\r\n\r\n\t\t_getSection: function(ev){\r\n\t\t\tvar section = null;\r\n\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\tsection = ev[timeline.y_property];\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\tsection = ev[unit.map_to];\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\t\t_moveToSlot: function(dir){\r\n\t\t\tvar ev = scheduler.getEvent(this.eventId);\r\n\t\t\tif(ev){\r\n\t\t\t\tvar section =this._getSection(ev);\r\n\t\t\t\tvar slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);\r\n\t\t\t\tthis.moveTo(slot.nextSlot(slot, dir));\r\n\t\t\t}else{\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis._moveToSlot(\"left\");\r\n\t\t\t},\r\n\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis._moveToSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"down\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"space\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node && node.click){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"up\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"delete\": function(){\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler._click.buttons[\"delete\"](this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// open lightbox\r\n\t\t\t\"enter\": function () {\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler.showLightbox(this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\nscheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){\r\n\tvar state = scheduler.getState();\r\n\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\r\n\tif(!from){\r\n\t\tfrom = this.getDefaultDate();\r\n\t}\r\n\r\n\tif(!to){\r\n\r\n\t\tif(timeline){\r\n\t\t\tto = scheduler.date.add(from, timeline.x_step, timeline.x_unit);\r\n\t\t}else{\r\n\t\t\tto = scheduler.date.add(from, scheduler.config.key_nav_step, \"minute\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tthis.section = section || this._getDefaultSection();\r\n\tthis.start_date = new Date(from);\r\n\tthis.end_date = new Date(to);\r\n\tthis.movingDate = movingDate || null;\r\n};\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_handlers:null,\r\n\r\n\t\tgetDefaultDate: function(){\r\n\t\t\tvar from;\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar visibleTime = new Date(state.date);\r\n\t\t\tvisibleTime.setSeconds(0);\r\n\t\t\tvisibleTime.setMilliseconds(0);\r\n\r\n\t\t\tvar nowTime = new Date();\r\n\t\t\tnowTime.setSeconds(0);\r\n\t\t\tnowTime.setMilliseconds(0);\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\t\t\tvar showNowTime = false;\r\n\t\t\tif(visibleTime.valueOf() === nowTime.valueOf()){\r\n\t\t\t\tshowNowTime = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(timeline){\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tif(timeline.x_unit === \"day\"){\r\n\t\t\t\t\t\tnowTime.setHours(0);\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}else if(timeline.x_unit === \"hour\"){\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfrom = scheduler.date[timeline.name + \"_start\"](new Date(state.date));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t}else{\r\n\t\t\t\tfrom = new Date(scheduler.getState().min_date);\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t\tif(!showNowTime){\r\n\t\t\t\t\tfrom.setHours(scheduler.config.first_hour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!scheduler._table_view){\r\n\t\t\t\t\tvar dataContainer = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\t\tif(dataContainer.scrollTop){\r\n\t\t\t\t\t\tfrom.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn from;\r\n\t\t},\r\n\r\n\t\tclone: function(timeslot){\r\n\t\t\treturn new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);\r\n\t\t},\r\n\t\t_getMultisectionView: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view;\r\n\t\t\tif(scheduler._props && scheduler._props[state.mode]) {\r\n\t\t\t\tview = scheduler._props[state.mode];\r\n\t\t\t}else if(scheduler.matrix && scheduler.matrix[state.mode]){\r\n\t\t\t\tview = scheduler.matrix[state.mode];\r\n\t\t\t}\r\n\t\t\treturn view;\r\n\t\t},\r\n\r\n\t\t_getDefaultSection: function(){\r\n\t\t\tvar section = null;\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tif(view && !section){\r\n\t\t\t\tsection = this._getNextSection();\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\r\n\t\t_getNextSection: function(sectionId, dir){\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tvar currentIndex = view.order[sectionId];\r\n\t\t\tvar nextIndex = currentIndex;\r\n\t\t\tif(currentIndex !== undefined){\r\n\t\t\t\tnextIndex = currentIndex + dir;\r\n\t\t\t}else{\r\n\t\t\t\tnextIndex = (view.size && view.position) ? view.position : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(nextIndex < 0){\r\n\t\t\t\tnextIndex = 0;\r\n\t\t\t}\r\n\t\t\tvar options = view.options || view.y_unit;\r\n\r\n\t\t\tif(nextIndex >= options.length){\r\n\t\t\t\tnextIndex = options.length - 1;\r\n\t\t\t}\r\n\t\t\t//nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;\r\n\r\n\t\t\tif(options[nextIndex]){\r\n\t\t\t\treturn options[nextIndex].key;\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());\r\n\r\n\t\t\tif(!isInRange) return false;\r\n\r\n\r\n\t\t\tif(!this.isVisible(this.start_date, this.end_date)) return false;\r\n\r\n\t\t\tvar view = this._getMultisectionView();\r\n\r\n\t\t\tif(view){\r\n\t\t\t\treturn (view.order[this.section] !== undefined);\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfallback:function(){\r\n\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(!defaultSlot.isValid()){\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\".dhx_focus_slot\"));\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this.getNodes()[0];\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tif(this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector(`[data-section-id=\"${this.section}\"]`)){\r\n\t\t\t\tscheduler.getView().scrollTo({section: this.section});\r\n\t\t\t}\r\n\t\t\tscheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation._pasteDate = this.start_date;\r\n\t\t\tscheduler.$keyboardNavigation._pasteSection = this.section;\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation.marker.clear();\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\t_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\taddMonthDate: function(date, dir, extend){\r\n\t\t\tvar res;\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tres = scheduler.date.add(date, -1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tres = scheduler.date.add(date, 1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, -1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, 1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tres = scheduler.date.day_start(new Date(date));\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tif(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){\r\n\t\t\t\tres = new Date(state.min_date);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\t\tnextMonthSlot: function(slot, dir, extend){\r\n\r\n\t\t\tvar start, end;\r\n\t\t\tstart = this.addMonthDate(slot.start_date, dir, extend);\r\n\r\n\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\r\n\t\t_alignTimeSlot: function(date, minDate, unit, step){\r\n\t\t\tvar currentDate = new Date(minDate);\r\n\t\t\twhile(currentDate.valueOf() < date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif(currentDate.valueOf() > date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, -step, unit);\r\n\t\t\t}\r\n\r\n\t\t\treturn currentDate;\r\n\t\t},\r\n\r\n\t\tnextTimelineSlot: function(slot, dir, extend){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler.matrix[state.mode];\r\n\r\n\t\t\tvar startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + \"_start\"](new Date(slot.start_date)), view.x_unit, view.x_step);\r\n\t\t\tvar endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + \"_start\"](new Date(slot.end_date)), view.x_unit, view.x_step);\r\n\r\n\t\t\tif(endDate.valueOf() <= startDate.valueOf()){\r\n\t\t\t\tendDate = scheduler.date.add(startDate, view.x_step, view.x_unit);\r\n\t\t\t}\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.start_date = startDate;\r\n\t\t\tnewPos.end_date = endDate;\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, +1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tif(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\t\tnewPos.start_date = new Date(state.max_date);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewPos.start_date = scheduler.date[state.mode + \"_start\"](scheduler.date.add(state.date, dir == \"left\" ? -1 : 1, state.mode));\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\tnextUnitsSlot: function(slot, dir, extend){\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\t\t\tvar section = slot.section || this._getNextSection();\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler._props[state.mode];\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tvar optionsCount = view.size ? (view.size - 1) : view.options.length;\r\n\r\n\t\t\t\t\tif(view.days > 1 && (view.order[section] == optionsCount - 1)){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, -1, \"day\").valueOf() >= state.min_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, 1);\r\n\t\t\t\t\tif(view.days > 1 && !view.order[section]){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, 1, \"day\").valueOf() < state.max_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\tsection = slot.section;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnewPos.section = section;\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\t_moveDate: function(oldDate, dir){\r\n\t\t\tvar newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, \"day\"), dir);\r\n\t\t\tnewDate.setHours(oldDate.getHours());\r\n\t\t\tnewDate.setMinutes(oldDate.getMinutes());\r\n\t\t\treturn newDate;\r\n\t\t},\r\n\r\n\t\tisBeforeLastHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));\r\n\t\t},\r\n\t\tisAfterFirstHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tfirst_hour = scheduler.config.first_hour,\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));\r\n\t\t},\r\n\t\tisInVisibleDayTime: function(date, isStartDate){\r\n\t\t\treturn (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));\r\n\t\t},\r\n\r\n\t\tnextDaySlot: function(slot, dir, extend){\r\n\t\t\tvar start, end;\r\n\r\n\t\t\tvar key_nav_step = scheduler.config.key_nav_step;\r\n\r\n\t\t\tvar date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), \"minute\", key_nav_step);\r\n\r\n\r\n\t\t\tvar oldStart = slot.start_date;\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, -key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(start, true)){\r\n\t\t\t\t\t\tif (!extend || this.isInVisibleDayTime(oldStart, true)) {\r\n\r\n\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\tif(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())\r\n\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\tif(toNextDay)\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, \"day\"), -1);\r\n\r\n\t\t\t\t\t\t\tstart.setHours(scheduler.config.last_hour);\r\n\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\tstart = scheduler.date.add(start, -key_nav_step, \"minute\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tvar testEnd = extend ? start : scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(testEnd, false)){\r\n\t\t\t\t\t\tif(!extend || this.isInVisibleDayTime(oldStart, false)) {\r\n\t\t\t\t\t\t\tif (!extend) {\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\t\tif (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {\r\n\t\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (toNextDay) {\r\n\t\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t\tstart = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, -1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, 1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = date;\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextWeekAgendaSlot: function(slot, dir){\r\n\t\t\tvar start, end;\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = scheduler.date.day_start(slot.start_date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tstart = new Date(state.min_date);\r\n\r\n\t\t\t}\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextAgendaSlot: function(slot, dir){\r\n\t\t\treturn {start_date: slot.start_date, end_date: slot.end_date};\r\n\t\t},\r\n\r\n\r\n\t\tisDateVisible: function(date){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar index;\r\n\t\t\tif(timeline){\r\n\t\t\t\tindex = scheduler._get_date_index(timeline, date);\r\n\t\t\t}else{\r\n\t\t\t\tindex = scheduler.locate_holder_day(date);\r\n\t\t\t}\r\n\r\n\t\t\treturn !scheduler._ignores[index];\r\n\t\t},\r\n\r\n\t\tfindVisibleColumn: function(start, dir){\r\n\t\t\tvar date = start;\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar range = scheduler.getState();\r\n\r\n\t\t\twhile(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){\r\n\t\t\t\tdate = this.nextDateColumn(date, dir);\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tnextDateColumn: function(start, dir){\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar date;\r\n\t\t\tif(timeline){\r\n\t\t\t\tdate = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);\r\n\t\t\t}else{\r\n\t\t\t\tdate = scheduler.date.day_start(scheduler.date.add(start, dir, \"day\"));\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tisVisible:function(from, to){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar current = new Date(from);\r\n\r\n\t\t\twhile(current.valueOf() < to.valueOf()){\r\n\t\t\t\tif(this.isDateVisible(current)) return true;\r\n\t\t\t\tcurrent = this.nextDateColumn(current);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tnextSlot: function(slot, dir, view, extend){\r\n\t\t\tvar next;\r\n\t\t\tview = view || this._getMode();\r\n\r\n\t\t\tvar tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tnext = this.nextUnitsSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tnext = this.nextTimelineSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.nextWeekAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.list:\r\n\t\t\t\t\tnext = this.nextAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.nextDaySlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(next.start_date.valueOf() >= next.end_date.valueOf()){\r\n\t\t\t\tnext = this.nextSlot(next, dir, view);\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\r\n\t\t},\r\n\r\n\t\textendSlot: function(slot, dir){\r\n\t\t\tvar view = this._getMode();\r\n\t\t\tvar next;\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tif(dir == \"left\" || dir == \"right\"){\r\n\t\t\t\t\t\tnext = this.nextUnitsSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendUnitsSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tif(dir == \"down\" || dir == \"up\"){\r\n\t\t\t\t\t\tnext = this.nextTimelineSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendTimelineSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.extendWeekAgendaSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tif(next.start_date.valueOf() < range.min_date.valueOf()){\r\n\t\t\t\tnext.start_date = this.findVisibleColumn(range.min_date);\r\n\t\t\t\tnext.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif(next.end_date.valueOf() > range.max_date.valueOf()){\r\n\t\t\t//\tnext.end_date = new Date(slot.end_date);\r\n\t\t\t\tnext.end_date = this.findVisibleColumn(range.max_date, -1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\t\t},\r\n\r\n\t\textendTimelineSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"timeline\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendWeekAgendaSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"weekAgenda\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendGenericSlot: function(allowedDirections, slot, direction, type){\r\n\t\t\tvar next;\r\n\t\t\tvar moveDate = slot.movingDate;\r\n\r\n\t\t\tif(!moveDate){\r\n\t\t\t\tmoveDate = allowedDirections[direction];\r\n\t\t\t}\r\n\r\n\t\t\tif(!moveDate || !allowedDirections[direction]){\r\n\t\t\t\treturn slot;\r\n\t\t\t}\r\n\r\n\t\t\tif(direction){\r\n\t\t\t\tnext = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);\r\n\r\n\t\t\t\tif(next.start_date.valueOf() == slot.start_date.valueOf()){\r\n\t\t\t\t\tnext = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnext.movingDate = moveDate;\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\t\t\t}\r\n\r\n\t\t\tvar newDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tif(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){\r\n\t\t\t\tnext.movingDate = next.movingDate == \"end_date\" ? \"start_date\" : \"end_date\";\r\n\t\t\t}\r\n\t\t\tnewDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tnext.start_date = newDates.start_date;\r\n\t\t\tnext.end_date = newDates.end_date;\r\n\t\t\treturn next;\r\n\t\t},\r\n\r\n\t\textendSlotDates: function(oldSlot, newSlot, dateDirection){\r\n\t\t\tvar res = {start_date:null, end_date:null};\r\n\r\n\t\t\tif(dateDirection == \"start_date\"){\r\n\t\t\t\tres.start_date = newSlot.start_date;\r\n\t\t\t\tres.end_date = oldSlot.end_date;\r\n\t\t\t}else{\r\n\t\t\t\tres.start_date = oldSlot.start_date;\r\n\t\t\t\tres.end_date = newSlot.start_date;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\r\n\t\t},\r\n\r\n\t\textendMonthSlot: function(slot, direction){\r\n\t\t\tvar slot = this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"month\"\r\n\t\t\t);\r\n\r\n\t\t\tslot.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\tslot.end_date = scheduler.date.add(slot.end_date, -1, \"day\");\r\n\t\t\tslot.end_date.setHours(scheduler.config.last_hour);\r\n\t\t\treturn slot;\r\n\t\t},\r\n\r\n\t\textendUnitsSlot: function(slot, direction){\r\n\t\t\tvar next;\r\n\r\n\t\t\tswitch (direction){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, direction);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnext.section = slot.section;\r\n\t\t\treturn next;\r\n\t\t},\r\n\t\textendDaySlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"dayColumns\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tscrollSlot: function(dir){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar slot = this.nextSlot(this, dir);\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(new Date(slot.start_date));\r\n\t\t\t}\r\n\r\n\t\t\tthis.moveTo(slot);\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis.scrollSlot(\"left\");\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis.scrollSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"down\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"up\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+down\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"down\"));\r\n\t\t\t},\r\n\t\t\t\"shift+up\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"up\"));\r\n\t\t\t},\r\n\t\t\t\"shift+right\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"right\"));\r\n\t\t\t},\r\n\t\t\t\"shift+left\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"left\"));\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};\r\n\r\n\t\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\r\n\t\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\t\tobj[timeline.y_property] = this.section;\r\n\t\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\t\tobj[unit.map_to] = this.section;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.addEventNow(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalButton = function(div, index){\r\n\tthis.container = div;\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar container = this.container;\r\n\t\t\treturn !!container.offsetWidth;// valid if container is visible\r\n\t\t},\r\n\r\n\t\tfallback: function(){\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}else{\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\tif(!this.index){\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_prev_button\");\r\n\t\t\t}else{\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_next_button\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);\r\n\t\t\t\tif(next && !next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalCell = function(div, row, col){\r\n\tthis.container = div;\r\n\tthis.row = row || 0;\r\n\tthis.col = col || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\treturn !!(grid[this.row] && grid[this.row][this.col]);\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar row = this.row;\r\n\t\t\tvar col = this.col;\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\trow = 0;\r\n\t\t\t}\r\n\t\t\tvar dir = true;\r\n\t\t\tif(row > grid.length / 2){\r\n\t\t\t\tdir = false;\r\n\t\t\t}\r\n\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\t\treturn defaultSlot;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c++){\r\n\t\t\t\t\tif(!grid[row][c] && c == grid[row].length - 1){\r\n\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\tcol = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c--){\r\n\t\t\t\t\tif(!grid[row][c] && !c){\r\n\t\t\t\t\t\trow--;\r\n\t\t\t\t\t\tcol = grid[row].length - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\t_getNode: function(row, col){\r\n\t\t\treturn this.container.querySelector(\".dhx_year_body tr:nth-child(\"+(row + 1) + \") td:nth-child(\"+(col + 1)+\")\");\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this._getNode(this.row, this.col);\r\n\t\t},\r\n\r\n\t\t_getGrid: function(){\r\n\t\t\tvar rows = this.container.querySelectorAll(\".dhx_year_body tr\");\r\n\t\t\tvar grid = [];\r\n\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\tgrid[i] = [];\r\n\t\t\t\tvar row = rows[i];\r\n\t\t\t\tvar cells = row.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var c = 0; c < cells.length; c++){\r\n\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\tvar enabled = true;\r\n\t\t\t\t\tvar css = scheduler._getClassName(cell);\r\n\t\t\t\t\tif(css.indexOf(\"dhx_after\") > -1 || css.indexOf(\"dhx_before\") > -1 || css.indexOf(\"dhx_scale_ignore\") > -1){\r\n\t\t\t\t\t\tenabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgrid[i][c] = enabled;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn grid;\r\n\t\t},\r\n\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col + 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow + 1]){\r\n\t\t\t\t\t\tnewRow = newRow + 1;\r\n\t\t\t\t\t\tnewCol = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col - 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow - 1]){\r\n\t\t\t\t\t\tnewRow = newRow - 1;\r\n\t\t\t\t\t\tnewCol = grid[newRow].length - 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row + 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tnewRow = this.row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"up\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row - 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tif(this.col > grid[this.row].length / 2){\r\n\t\t\t\t\t\tindex = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.moveTo(next);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().querySelector(\".dhx_month_head\").click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.DataArea = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\treturn scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\treturn this;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"up,down,right,left\":function(){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.dispatcher = {\r\n\tisActive: false,\r\n\tactiveNode: null,\r\n\tglobalNode: new scheduler.$keyboardNavigation.SchedulerNode(),\r\n\r\n\tkeepScrollPosition: function (callback) {\r\n\t\tvar top, left;\r\n\r\n\t\tvar scrollable = scheduler.$container.querySelector(\".dhx_timeline_scrollable_data\");\r\n\t\tif(!scrollable){\r\n\t\t\tscrollable = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}\r\n\r\n\t\tif(scrollable){\r\n\t\t\ttop = scrollable.scrollTop;\r\n\t\t\tleft = scrollable.scrollLeft;\r\n\t\t}\r\n\r\n\t\tcallback();\r\n\r\n\t\tif(scrollable){\r\n\t\t\tscrollable.scrollTop = top;\r\n\t\t\tscrollable.scrollLeft = left;\r\n\t\t}\r\n\t},\r\n\tenable: function(){\r\n\t\tif(!scheduler.$container){\r\n\t\t\t// do nothing if not initialized\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isActive = true;\r\n\t\tvar self = this;\r\n\t\tthis.keepScrollPosition(function () {\r\n\t\t\tself.globalNode.enable();\r\n\t\t\tself.setActiveNode(self.getActiveNode());\r\n\t\t});\r\n\t},\r\n\r\n\tdisable: function(){\r\n\t\tthis.isActive = false;\r\n\t\tthis.globalNode.disable();\r\n\t},\r\n\r\n\tisEnabled: function(){\r\n\t\treturn !!this.isActive;\r\n\t},\r\n\r\n\tgetDefaultNode: function(){\r\n\t\treturn this.globalNode.getDefaultNode();\r\n\t},\r\n\r\n\tsetDefaultNode: function() {\r\n\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t},\r\n\r\n\tgetActiveNode: function(){\r\n\t\tvar node = this.activeNode;\r\n\t\tif(node && !node.isValid()){\r\n\t\t\tnode = node.fallback();\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\r\n\tfocusGlobalNode: function(){\r\n\t\tthis.blurNode(this.globalNode);\r\n\t\tthis.focusNode(this.globalNode);\r\n\t},\r\n\r\n\tsetActiveNode: function(el){\r\n\t\tif(!el || !el.isValid())\r\n\t\t\treturn;\r\n\r\n\t\tif(this.activeNode){\r\n\t\t\tif(this.activeNode.compareTo(el)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.isEnabled()){\r\n\t\t\tthis.blurNode(this.activeNode);\r\n\t\t\tthis.activeNode = el;\r\n\t\t\tthis.focusNode(this.activeNode);\r\n\t\t}\r\n\t},\r\n\r\n\tfocusNode: function(el){\r\n\t\tif(el && el.focus){\r\n\t\t\tel.focus();\r\n\t\t\tif(el.getNode && document.activeElement != el.getNode()){\r\n\t\t\t\tthis.setActiveNode(new scheduler.$keyboardNavigation.DataArea());\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tblurNode: function(el){\r\n\t\tif(el && el.blur){\r\n\t\t\tel.blur();\r\n\t\t}\r\n\t},\r\n\r\n\tgetInlineEditor: function(id){\r\n\t\tvar editor = scheduler.$container.querySelector(\".dhx_cal_editor[\"+scheduler.config.event_attribute+\"='\"+id+\"'] textarea\");\r\n\t\tif(editor && editor.offsetWidth){\r\n\t\t\t// if exists and visible\r\n\t\t\treturn editor;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tkeyDownHandler: function (e) {\r\n\r\n\t\tif(e.defaultPrevented){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar activeElement = this.getActiveNode();\r\n\r\n\t\tif(scheduler.$keyboardNavigation.isModal() &&\r\n\t\t\t!(activeElement && activeElement.container && scheduler.utils.dom.locateCss({target:activeElement.container}, \"dhx_minical_popup\", false)))\r\n\t\t\treturn;\r\n\r\n\t\tif(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))\r\n\t\t\treturn;\r\n\r\n\t\tif (!this.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\te = e || window.event;\r\n\r\n\t\tvar schedulerNode = this.globalNode;\r\n\r\n\t\tvar command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\tif(!activeElement){\r\n\t\t\tthis.setDefaultNode();\r\n\t\t}else if(activeElement.findHandler(command)){\r\n\t\t\tactiveElement.doAction(command, e);\r\n\t\t}else if(schedulerNode.findHandler(command)){\r\n\t\t\tschedulerNode.doAction(command, e);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_timeout: null,\r\n\tdelay: function(callback, delay){\r\n\r\n\t\tclearTimeout(this._timeout);\r\n\t\tthis._timeout = setTimeout(callback, delay || 1);\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation._minicalendars = [];\r\n\r\nscheduler.$keyboardNavigation.isMinical = function(node){\r\n\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\tif(this.isChildOf(node, minicalendars[i]))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n};\r\n\r\nscheduler.$keyboardNavigation.isChildOf = function(child, parent){\r\n\twhile(child && child !== parent){\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn !!(child === parent);\r\n};\r\n\r\nscheduler.$keyboardNavigation.patchMinicalendar = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tfunction focusMinical(e){\r\n\t\tvar target = e.target;\r\n\r\n\t\tdispatcher.enable();\r\n\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));\r\n\t}\r\n\r\n\tfunction minicalClick(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tvar prev = scheduler.utils.dom.locateCss(e, \"dhx_cal_prev_button\", false);\r\n\t\tvar next = scheduler.utils.dom.locateCss(e, \"dhx_cal_next_button\", false);\r\n\t\tvar cell = scheduler.utils.dom.locateCss(e, \"dhx_year_body\", false);\r\n\r\n\t\tvar rowIndex = 0;\r\n\t\tvar cellIndex = 0;\r\n\t\tif(cell){\r\n\t\t\tvar tr;\r\n\t\t\tvar td;\r\n\t\t\tvar current = target;\r\n\t\t\twhile(current && current.tagName.toLowerCase() != \"td\"){\r\n\t\t\t\tcurrent = current.parentNode;\r\n\t\t\t}\r\n\t\t\tif(current){\r\n\t\t\t\ttd = current;\r\n\t\t\t\ttr = td.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif(tr && td){\r\n\t\t\t\tvar rows = tr.parentNode.querySelectorAll(\"tr\");\r\n\t\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\t\tif(rows[i] == tr){\r\n\t\t\t\t\t\trowIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar cells = tr.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\t\tif(cells[i] == td){\r\n\t\t\t\t\t\tcellIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar root = e.currentTarget;\r\n\t\tdispatcher.delay(function(){\r\n\t\t\tif(prev || next || cell){\r\n\r\n\t\t\t\tvar element;\r\n\t\t\t\tif(prev){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 0);\r\n\t\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));\r\n\t\t\t\t}else if(next){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 1);\r\n\t\t\t\t}else if(cell){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(element){\r\n\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\tif(element.isValid()){\r\n\t\t\t\t\t\tdispatcher.activeNode = null;\r\n\t\t\t\t\t\tdispatcher.setActiveNode(element);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tif(scheduler.renderCalendar){\r\n\t\tvar renderMinical = scheduler.renderCalendar;\r\n\t\tscheduler.renderCalendar = function(){\r\n\t\t\tvar cal = renderMinical.apply(this, arguments);\r\n\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"click\", minicalClick);\r\n\t\t\tscheduler.event(cal, \"click\", minicalClick);\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"focus\", focusMinical);\r\n\t\t\tscheduler.event(cal, \"focus\", focusMinical);\r\n\r\n\t\t\tvar added = false;\r\n\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\tadded = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!added)\r\n\t\t\t\tminicalendars.push(cal);\r\n\r\n\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\tif(node && node.container == cal){\r\n\t\t\t\t\tdispatcher.focusNode(node);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t}\r\n\t\t\treturn cal;\r\n\t\t};\r\n\t}\r\n\r\n\tif(scheduler.destroyCalendar){\r\n\t\tvar destroyMinical = scheduler.destroyCalendar;\r\n\t\tscheduler.destroyCalendar = function(cal, force){\r\n\t\t\tcal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);\r\n\t\t\tvar res = destroyMinical.apply(this, arguments);\r\n\r\n\t\t\tif(!cal || !cal.parentNode){\r\n\t\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\t\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\t\tscheduler.eventRemove(minicalendars[i], \"focus\", focusMinical);\r\n\t\t\t\t\t\tminicalendars.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t};\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\r\n\tthis.layers.sort(function(a, b){\r\n\t\treturn a.zIndex - b.zIndex;\r\n\t});\r\n\r\n\tscheduler._dp_init=function(dp){\r\n\t\tdp._methods=[\"_set_event_text_style\",\"\",\"changeEventId\",\"deleteEvent\"];\r\n\r\n\t\tthis.attachEvent(\"onEventAdded\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t});\r\n\t\tthis.attachEvent(\"onBeforeEventDelete\",function(id){\r\n\t\t\tif(this.getEvent(id) && this.getEvent(id).layer == dp.layer) {\r\n\t\t\t\tif (!this.validId(id)) return;\r\n\t\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false);\t\treturn true; }\r\n\t\t\t\tif (z==\"deleted\") return false;\r\n\t\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse return true;\r\n\t\t});\r\n\t\tthis.attachEvent(\"onEventChanged\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t});\r\n\r\n\t\tdp._getRowData=function(id,pref){\r\n\t\t\tvar ev=this.obj.getEvent(id);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tfor (var a in ev){\r\n\t\t\t\tif (a.indexOf(\"_\")===0) continue;\r\n\t\t\t\tif (ev[a] && ev[a].getUTCFullYear) //not very good, but will work\r\n\t\t\t\t\tdata[a] = this.obj._helpers.formatDate(ev[a]);\r\n\t\t\t\telse\r\n\t\t\t\t\tdata[a] = ev[a];\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t};\r\n\t\tdp._clearUpdateFlag=function(){};\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tthis.obj.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\tthis.obj.deleteEvent(id);\r\n\t\t});\r\n\t};\r\n\r\n\t(function() {\r\n var _cloneObj = function(obj){\r\n if(obj === null || typeof(obj) != 'object')\r\n return obj;\r\n var temp = new obj.constructor();\r\n for(var key in obj)\r\n temp[key] = _cloneObj(obj[key]);\r\n return temp;\r\n };\r\n\r\n\t\tscheduler._dataprocessors = [];\r\n\t\tscheduler._layers_zindex = {};\r\n\t\tfor(var i=0; i= scheduler.config.collision_limit);\r\n\t});\r\n\r\n\tscheduler.addEvent=function(start_date,end_date,text,id,extra_data){\r\n\t\tvar ev=start_date;\r\n\t\tif (arguments.length!=1){\r\n\t\t\tev=extra_data||{};\r\n\t\t\tev.start_date=start_date;\r\n\t\t\tev.end_date=end_date;\r\n\t\t\tev.text=text;\r\n\t\t\tev.id=id;\r\n\t\t\tev.layer = this.defaultLayer;\r\n\t\t}\r\n\t\tev.id = ev.id||scheduler.uid();\r\n\t\tev.text = ev.text||\"\";\r\n\r\n\r\n\t\tif (typeof ev.start_date == \"string\") ev.start_date=this.templates.api_date(ev.start_date);\r\n\t\tif (typeof ev.end_date == \"string\") ev.end_date=this.templates.api_date(ev.end_date);\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\r\n\t\tvar is_new=!this._events[ev.id];\r\n\t\tthis._events[ev.id]=ev;\r\n\t\tthis.event_updated(ev);\r\n\t\tif (!this._loading)\r\n\t\t\tthis.callEvent(is_new?\"onEventAdded\":\"onEventChanged\",[ev.id,ev]);\r\n\t};\r\n\r\n\tthis._evs_layer = {};\r\n\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t}\r\n\r\n\tscheduler.addEventNow=function(start,end,e){\r\n\t\tvar base = {};\r\n\t\tif (typeof start == \"object\"){\r\n\t\t\tbase = start;\r\n\t\t\tstart = null;\r\n\t\t}\r\n\r\n\t\tvar d = (this.config.event_duration||this.config.time_step)*60000;\r\n\t\tif (!start) start = Math.round((scheduler._currentDate()).valueOf()/d)*d;\r\n\t\tvar start_date = new Date(start);\r\n\t\tif (!end){\r\n\t\t\tvar start_hour = this.config.first_hour;\r\n\t\t\tif (start_hour > start_date.getHours()){\r\n\t\t\t\tstart_date.setHours(start_hour);\r\n\t\t\t\tstart = start_date.valueOf();\r\n\t\t\t}\r\n\t\t\tend = start+d;\r\n\t\t}\r\n\r\n\r\n\t\tbase.start_date = base.start_date||start_date;\r\n\t\tbase.end_date = base.end_date||new Date(end);\r\n\t\tbase.text = base.text||this.locale.labels.new_event;\r\n\t\tbase.id = this._drag_id = this.uid();\r\n\t\tbase.layer = this.defaultLayer;\r\n\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\tthis._loading=true;\r\n\t\tthis.addEvent(base);\r\n\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\tthis._loading=false;\r\n\r\n\t\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\t\tthis._on_mouse_up(e);\r\n\t};\r\n\r\n\tscheduler._t_render_view_data = function(events) { // helper\r\n\t\tif (this.config.multi_day && !this._table_view) {\r\n\t\t\tvar tvs = [];\r\n\t\t\tvar tvd = [];\r\n\t\t\tfor (var k = 0; k < events.length; k++) {\r\n\t\t\t\tif (events[k]._timed)\r\n\t\t\t\t\ttvs.push(events[k]);\r\n\t\t\t\telse\r\n\t\t\t\t\ttvd.push(events[k]);\r\n\t\t\t}\r\n\t\t\tthis._table_view = true;\r\n\t\t\tthis.render_data(tvd);\r\n\t\t\tthis._table_view = false;\r\n\t\t\tthis.render_data(tvs);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.render_data(events);\r\n\t};\r\n\r\n\tscheduler.render_view_data = function(){\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\r\n\t\tthis._evs_layer = {};\r\n\t\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t\t}\r\n\r\n\t\tvar evs = this.get_visible_events();\r\n\t\tfor (var i = 0; i < evs.length; i++) { // filling layer arrays with events\r\n\t\t\tif(this._evs_layer[evs[i].layer])\r\n\t\t\t\tthis._evs_layer[evs[i].layer].push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(this._mode == 'month') { // old logic is used\r\n\t\t\tvar tevs = [];\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible)\r\n\t\t\t\t\ttevs = tevs.concat(this._evs_layer[this.layers[i].name]);\r\n\t\t\t}\r\n\t\t\tthis._t_render_view_data(tevs);\r\n\t\t}\r\n\t\telse { // week, day; should use new logic\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible) {\r\n\t\t\t\t\tvar evs_layer = this._evs_layer[this.layers[i].name];\r\n\t\t\t\t\tthis._t_render_view_data(evs_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._render_v_bar=function(ev,x,y,w,h,style,contentA,contentB,bottom){\r\n\t\tvar id = ev.id;\r\n\r\n\t\tif(contentA.indexOf('';\r\n\t\thtml+='';\r\n\t\thtml+='
'+contentA+'
';\r\n\t\thtml+='
'+contentB+'
';\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\t\td.style.zIndex = 100;\r\n\t\treturn d.firstChild;\r\n\t};\r\n\r\n\tscheduler.render_event_bar=function(ev){\r\n\t\tvar parent=this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar x=this._colsS[ev._sday];\r\n\t\tvar x2=this._colsS[ev._eday];\r\n\t\tif (x2==x) x2=this._colsS[ev._eday+1];\r\n\t\tvar hb = this.xy.bar_height;\r\n\r\n\t\tvar y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb;\r\n\r\n\t\tvar d=document.createElement(\"div\");\r\n\t\tvar cs = ev._timed?\"dhx_cal_event_clear\":\"dhx_cal_event_line\";\r\n\t\tvar cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev);\r\n\t\tif (cse) cs=cs+\" \"+cse;\r\n\r\n\t\tvar html='';\r\n\r\n\t\tif (ev._timed)\r\n\t\t\thtml+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);\r\n\t\thtml+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '
)');\r\n\t\thtml+=' ';\r\n\r\n\t\td.innerHTML=html;\r\n\r\n\t\tthis._rendered.push(d.firstChild);\r\n\t\tparent.appendChild(d.firstChild);\r\n\t};\r\n\r\n\tscheduler.render_event=function(ev){\r\n\t\tvar menu = scheduler.xy.menu_width;\r\n\t\tif(scheduler.getLayer(ev.layer).noMenu)\r\n\t\t\tmenu = 0;\r\n\r\n\t\tif (ev._sday<0) return; //can occur in case of recurring event during time shift\r\n\t\tvar parent=scheduler.locate_holder(ev._sday);\r\n\t\tif (!parent) return; //attempt to render non-visible event\r\n\t\tvar sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();\r\n\t\tvar em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);\r\n\r\n\t\tvar top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour\r\n\t\tvar height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour\r\n\t\t\r\n\t\tvar width=Math.floor((parent.clientWidth-menu)/ev._count);\r\n\t\tvar left=ev._sorder*width+1;\r\n\t\tif (!ev._inner) width=width*(ev._count-ev._sorder);\r\n\r\n\r\n\r\n\t\tvar d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));\r\n\r\n\t\tthis._rendered.push(d);\r\n\t\tparent.appendChild(d);\r\n\r\n\t\tleft=left+parseInt(parent.style.left,10)+menu;\r\n\r\n\t\ttop+=this._dy_shift; //corrupt top, to include possible multi-day shift\r\n\t\td.style.zIndex = this._layers_zindex[ev.layer];\r\n\r\n\t\tif (this._edit_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar new_zIndex = d.style.zIndex;\r\n\t\t\twidth=Math.max(width-4,scheduler.xy.editor_width);\r\n\t\t\tvar d=document.createElement(\"div\");\r\n\t\t\td.setAttribute(\"event_id\",ev.id); // for backward compatibility\r\n\t\t\td.setAttribute(this.config.event_attribute,ev.id);\r\n\t\t\tthis.set_xy(d,width,height-20,left,top+14);\r\n\t\t\td.className=\"dhx_cal_editor\";\r\n\t\t\td.style.zIndex = new_zIndex;\r\n\t\t\tvar d2=document.createElement(\"div\");\r\n\t\t\tthis.set_xy(d2,width-6,height-26);\r\n\t\t\td2.style.cssText+=\";margin:2px 2px 2px 2px;overflow:hidden;\";\r\n\r\n\r\n\t\t\td2.style.zIndex = new_zIndex;\r\n\t\t\td.appendChild(d2);\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\t\tthis._rendered.push(d);\r\n\r\n\t\t\td2.innerHTML=\"
\";\r\n\r\n\t\t\tthis._editor=d2.firstChild;\r\n\t\t\tthis._editor.addEventListener(\"keypress\", function(e){\r\n\t\t\t\tif (e.shiftKey) return true;\r\n\t\t\t\tvar code= e.keyCode;\r\n\t\t\t\tif (code==scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\t\tif (code==scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\t\t\t});\r\n\t\t\tthis._editor.addEventListener(\"selectstart\", function(e){ e.cancelBubble=true; return true; });\r\n\t\t\td2.firstChild.focus();\r\n\t\t\t//IE and opera can add x-scroll during focusing\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft=0;\r\n\t\t\td2.firstChild.select();\r\n\t\t}\r\n\t\tif (this._select_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar icons=this.config[\"icons_\"+((this._edit_id==ev.id)?\"edit\":\"select\")];\r\n\t\t\tvar icons_str=\"\";\r\n\t\t\tfor (var i=0; i
\";\r\n\t\t\tvar obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,\"\",\"\",icons_str,true);\r\n\t\t\tobj.style.left=left-menu+1;\r\n\t\t\tobj.style.zIndex = d.style.zIndex;\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\t\tthis._rendered.push(obj);\r\n\t\t}\r\n\r\n\t};\r\n\r\n scheduler.filter_agenda = function(id, event) {\r\n var layer = scheduler.getLayer(event.layer);\r\n return (layer && layer.visible);\r\n };\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.limit_start = null;\r\nscheduler.config.limit_end = null;\r\nscheduler.config.limit_view = false;\r\nscheduler.config.check_limits = true;\r\n\r\nscheduler._temp_limit_scope = function(){\r\n\tvar before = null;\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(om,od,nm,nd){\r\n\r\n\t\tfunction isBlocked(date, mode){\r\n\t\t\tvar limit_start = scheduler.config.limit_start,\r\n\t\t\t\tlimit_end = scheduler.config.limit_end,\r\n\t\t\t\tdate_end = scheduler.date.add(date,1,mode);\r\n\r\n\t\t\treturn (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());\r\n\t\t}\r\n\r\n\t\tif (scheduler.config.limit_view){\r\n\t\t\tnd = nd||od; nm = nm||om;\r\n\t\t\tif (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;\r\n\r\n\t\t\t\t\tscheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onMouseDown\", function(classname) {\r\n\t\treturn !(classname == dhx_time_block);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t\tif (!id) return true;\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(id));\r\n\t});\r\n\tscheduler.attachEvent(\"onClick\", function (event_id, native_event_object){\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(event_id));\r\n });\r\n\tscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tbefore = [ev.start_date, ev.end_date];\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\r\n\t\t//lightbox may not have 'time' section\r\n\t\tif(!(data.start_date && data.end_date)){\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tdata.start_date = new Date(ev.start_date);\r\n\t\t\tdata.end_date = new Date(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif(data.rec_type){\r\n\t\t\t//_roll_back_dates modifies start_date of recurring event, need to check limits after modification\r\n\t\t\t// use a copy to keep original event unchanged\r\n\t\t\tvar data_copy = scheduler._lame_clone(data);\r\n\t\t\tscheduler._roll_back_dates(data_copy);\r\n\t\t\treturn scheduler.checkLimitViolation(data_copy);\r\n\t\t}\r\n\t\treturn scheduler.checkLimitViolation(data);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev) && scheduler.config.limit_start && scheduler.config.limit_end) {\r\n\t\t\t//if newly created event is outside of limited time - crop it, leaving only allowed time\r\n\t\t\tif (ev.start_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.start_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.start_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.end_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.end_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= ev.end_date.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), \"minute\");\r\n\t\t\t}\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev)){\r\n\t\t\tif (!before) return false;\r\n\t\t\tev.start_date = before[0];\r\n\t\t\tev.end_date = before[1];\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventChanged\",function(ev, native_object, is_new){\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventCreated\", function(ev) { // native event\r\n\t\tvar start_date = scheduler.getActionData(ev).date;\r\n\t\tvar event = {\r\n\t\t\t_timed: true,\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: scheduler.date.add(start_date, scheduler.config.time_step, \"minute\")\r\n\t\t};\r\n\t\treturn scheduler.checkLimitViolation(event);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function(){\r\n\t\tscheduler._mark_now();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", function(){\r\n\t\twindow.setTimeout(function(){ \r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler._mark_now(); \r\n\t\t}, 1);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tscheduler._mark_now_timer = window.setInterval(function() {\r\n\t\t\tif(!scheduler._is_initialized())\r\n\t\t\t\treturn;\r\n\t\t\tscheduler._mark_now();\r\n\t\t}, 60000);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(scheduler._mark_now_timer);\r\n\t});\r\n\r\n};\r\nscheduler._temp_limit_scope();\r\n\r\n\r\n}","import { GoogleMapAdapter } from \"./gMapAdapter\";\r\nimport { OpenStreetMapAdapter } from \"./osmMapAdapter\";\r\nimport { MapboxAdapter } from \"./mapboxAdapter\";\r\nimport { IMapAdapter, ICalendarEvent, IMapSettings } from \"./types\";\r\n\r\ndeclare let google: any;\r\n\r\nexport default function(scheduler: any){\r\n\t\r\nlet mapAdapter: IMapAdapter | null = null;\r\nlet eventHandlerIds: number[] = [];\r\nconst adapters: { [name:string]: IMapAdapter } = {\r\n\tgoogleMap: new GoogleMapAdapter(scheduler),\r\n\topenStreetMaps: new OpenStreetMapAdapter(scheduler),\r\n\tmapbox: new MapboxAdapter(scheduler)\r\n}\r\n\r\nif(!scheduler.ext){\r\n\tscheduler.ext = {};\r\n}\r\nscheduler.ext.mapView = {\r\n\tcreateAdapter: function():IMapAdapter{\r\n\t\treturn adapters[scheduler.config.map_view_provider];\r\n\t},\r\n\tcreateMarker: function(config){\r\n\t\treturn new google.maps.Marker(config);\r\n\t},\r\n\tcurrentAdapter: null,\r\n\tadapters\r\n};\r\nscheduler._latLngUpdate = false; // flag for updating events which don't have event.lat and event.lng\r\nscheduler._eventLocationChanged = false; // flag for checking if the location of the event is changed\r\nscheduler.config.map_view_provider = \"googleMap\";\r\nscheduler.config.map_settings = {\r\n\tinitial_position: {\r\n\t lat: 48.724,\r\n\t lng: 8.215\r\n\t},\r\n\terror_position: {\r\n\t lat: 15,\r\n\t lng: 15\r\n\t},\r\n\tinitial_zoom: 1,\r\n\tzoom_after_resolve: 15,\r\n\tinfo_window_max_width: 300,\r\n\tresolve_user_location: true,\r\n\tresolve_event_location: true,\r\n\tview_provider: \"googleMap\"\r\n}\r\nif (scheduler.config.map_initial_position) {\r\n\tscheduler.config.map_settings.initial_position = {\r\n\t\tlat: scheduler.config.map_initial_position.lat(),\r\n\t\tlng: scheduler.config.map_initial_position.lng(), \r\n\t};\r\n}\r\n\r\nif (scheduler.config.map_error_position) {\r\n\tscheduler.config.map_settings.error_position = {\r\n\t\tlat: scheduler.config.map_error_position.lat(),\r\n\t\tlng: scheduler.config.map_error_position.lng(), \r\n\t};\r\n}\r\n\r\nscheduler.xy.map_date_width = 188; // date column width\r\nscheduler.xy.map_icon_width = 25; // event details icon width\r\nscheduler.xy.map_description_width = 400; // description column width\r\nscheduler.date.add_map = function(date, inc, mode) {\r\n\treturn (new Date(date.valueOf()));\r\n};\r\nscheduler.templates.map_date = function(dd, ed, mode) {\r\n\treturn '';\r\n};\r\nscheduler.templates.map_time = function(start, end, ev) {\r\n\tif (scheduler.config.rtl && !ev._timed) {\r\n\t\treturn scheduler.templates.day_date(end) + \" – \" + scheduler.templates.day_date(start);\r\n\t} else if (ev._timed) {\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev) + \" \" + this.event_date(start);\r\n\t} else {\r\n\t\treturn scheduler.templates.day_date(start) + \" – \" + scheduler.templates.day_date(end);\r\n\t}\r\n};\r\nscheduler.templates.map_text = function(start, end, ev) {\r\n\treturn ev.text;\r\n};\r\nscheduler.templates.map_info_content = function(event){\r\n return `
Event's text: ${event.text}\r\n\t\t\t\t
Location: ${event.event_location}
\r\n\t\t\t\t
Starts: ${scheduler.templates.tooltip_date_format(event.start_date)}
\r\n\t\t\t\t
Ends: ${scheduler.templates.tooltip_date_format(event.end_date)}
\r\n\t\t\t
`;\r\n};\r\nscheduler.date.map_start = function(d) {\r\n\treturn d;\r\n};\r\n\r\nfunction setupMapView(scheduler) {\r\n\t// Initialization logic, possibly including creation of a new mapAdapter\r\n\tmapAdapter = scheduler.ext.mapView.createAdapter();\r\n\tattachSchedulerEvents();\r\n}\r\nasync function addEventWithLocation(event: ICalendarEvent, mapAdapter: IMapAdapter){\r\n\tlet coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\tevent.lat = coordinates.lat;\r\n\tevent.lng = coordinates.lng;\r\n\tmapAdapter.removeEventMarker(String(event.id));\r\n\tmapAdapter.addEventMarker(event);\r\n\treturn event;\r\n}\r\nfunction setUserLocation(options: IMapSettings, adapter: IMapAdapter): void{\r\n\tif (options.resolve_user_location) {\r\n\t\tif (navigator.geolocation) {\r\n\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t\t\tadapter.setView(position.coords.latitude, position.coords.longitude, options.zoom_after_resolve || options.initial_zoom);\r\n\t\t\t});\r\n\t\t}\r\n\t} else {\r\n\t\tadapter.setView(options.initial_position.lat, options.initial_position.lng, options.initial_zoom);\r\n\t}\r\n}\r\nscheduler.dblclick_dhx_map_area = function(e) {\r\n\tlet eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\tif (eventNode){\r\n\t\tlet eventId = eventNode.getAttribute(`${scheduler.config.event_attribute}`);\r\n\t\tscheduler.showLightbox(eventId);\r\n\t}\r\n\tif (!this.config.readonly && this.config.dblclick_create && !eventNode) {\r\n\t\tthis.addEventNow({\r\n\t\t\tstart_date: scheduler.config.map_start,\r\n\t\t\tend_date: scheduler.date.add( scheduler.config.map_start, scheduler.config.time_step, \"minute\"),\r\n\t\t});\r\n\t}\t\r\n};\r\n\r\nfunction attachSchedulerEvents() { \r\n eventHandlerIds.push(\r\n\tscheduler.attachEvent(\"onEventSave\",function(id,ev,is_new){\r\n\t\tlet unmodifiedEvent = scheduler.getEvent(id);\r\n\t\tif (unmodifiedEvent && unmodifiedEvent.event_location != ev.event_location) {\r\n\t\t\tscheduler._eventLocationChanged = true;\r\n\t\t}\r\n\t\treturn true;\r\n\t}),\r\n scheduler.attachEvent(\"onEventChanged\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !scheduler._latLngUpdate ) {\r\n\t\t\t\t \taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.updateEventMarker(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._latLngUpdate = false;\r\n\t\treturn true;\r\n }),\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(old_id,new_id){\r\n\t\tlet newIdEvent = scheduler.getEvent(new_id);\r\n\t\tmapAdapter?.removeEventMarker(old_id);\r\n\t\tmapAdapter?.addEventMarker(newIdEvent);\r\n\t}),\r\n scheduler.attachEvent(\"onEventAdded\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n \t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && scheduler._eventLocationChanged) {\r\n\t\t\t\t\taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t\tscheduler._eventLocationChanged = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.addEventMarker(event);\r\n\t\t\t\t\tmapAdapter.onEventClick(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }),\r\n scheduler.attachEvent(\"onClick\", function (id, e){\r\n\t\tconst event = scheduler.getEvent(id);\r\n\t\tif (mapAdapter && event) mapAdapter.onEventClick(event);\r\n\t\treturn false;\r\n }),\r\n scheduler.attachEvent(\"onBeforeEventDelete\", (id, event) => {\r\n\t\tif (mapAdapter) {\r\n\t\t\tmapAdapter.removeEventMarker(id);\r\n\t\t}\r\n\t\treturn true;\r\n })\r\n );\r\n}\r\nfunction detachSchedulerEvents() {\r\n\teventHandlerIds.forEach(id => scheduler.detachEvent(id));\r\n\teventHandlerIds = [];\r\n}\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function() {\r\n\r\n\tif(scheduler.config.map_initial_zoom !== undefined){\r\n\t\tscheduler.config.map_settings.initial_zoom = scheduler.config.map_initial_zoom;\r\n\t}\r\n\tif(scheduler.config.map_zoom_after_resolve !== undefined){\r\n\t\tscheduler.config.map_settings.zoom_after_resolve = scheduler.config.map_zoom_after_resolve;\r\n\t}\r\n\tif(scheduler.config.map_infowindow_max_width !== undefined){\r\n\t\tscheduler.config.map_settings.info_window_max_width = scheduler.config.map_infowindow_max_width;\r\n\t}\r\n\tif(scheduler.config.map_resolve_user_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_user_location = scheduler.config.map_resolve_user_location;\r\n\t}\r\n\tif(scheduler.config.map_view_provider !== undefined){\r\n\t\tscheduler.config.map_settings.view_provider = scheduler.config.map_view_provider;\r\n\t}\r\n\tif(scheduler.config.map_type !== undefined){\r\n\t\tscheduler.config.map_settings.type = scheduler.config.map_type;\r\n\t}\r\n\tif(scheduler.config.map_resolve_event_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_event_location = scheduler.config.map_resolve_event_location;\r\n\t}\r\n\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\r\n\tlet map = document.createElement('div');\r\n\tmap.className = 'mapContainer';\r\n\tmap.id = 'mapContainer';\r\n\tmap.style.display = \"none\";\r\n\tmap.style.zIndex = \"1\";\r\n\tscheduler._obj.appendChild(map);\r\n\r\n\tconst old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs, hold) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tfill_map_tab();\r\n\t\t\tlet events = scheduler.get_visible_events();\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tmapAdapter.clearEventMarkers();\r\n\t\t\t\tevents.forEach((event) => mapAdapter?.addEventMarker(event));\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn old.apply(this, arguments);\r\n\t};\r\n\r\n\tscheduler.map_view = function(mode) {\r\n\t\tscheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\tscheduler._min_date = scheduler.config.map_start || (scheduler._currentDate());\r\n\t\tscheduler._max_date = scheduler.config.map_end || scheduler.date.add(scheduler._currentDate(), 1, \"year\");\r\n\t\tscheduler._table_view = true;\r\n\t\tset_full_view(mode);\r\n\t\tlet mapContainer = document.getElementById('mapContainer');\r\n\t\t_setMapSize('mapContainer');\r\n\r\n\t\t// creating the new logic\r\n\t\tif (mode && mapContainer) {\r\n\t\t\tmap.style.display = 'block';\r\n\t\t\tfill_map_tab();\r\n\t\t\t// case to display several maps and has the opportunity to switch between them\r\n\t\t\tif (scheduler.config.map_view_provider == scheduler.ext.mapView.currentAdapter) {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t} else {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t \tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t\t}\r\n\t\t\tif(mapAdapter) {\r\n\t\t\t\tsetUserLocation(scheduler.config.map_settings, mapAdapter);\r\n\t\t\t}\t\r\n\t\t} else {\r\n\t\t\tmap.style.display = 'none';\r\n\t\t\tscheduler._els.dhx_cal_data[0].style.width = \"100%\";\r\n\t\t \tif (mapAdapter && mapContainer ) {\r\n\t\t\t\tmapAdapter.destroy(mapContainer);\r\n\t\t\t\tmapAdapter = null;\r\n\t\t\t\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t }\r\n\t\t \tdetachSchedulerEvents();\r\n\t\t}\r\n\t};\r\n\r\n\tfunction _setMapSize(elem_id) { //input - map's div id\r\n\t\tlet map = document.getElementById(elem_id);\r\n\t\tif (map) {\r\n\t\t\tconst nav_height = scheduler.$container.querySelector(\".dhx_cal_navline\").offsetHeight;\r\n\t\t\tlet height = scheduler.$container.querySelector(\".dhx_cal_data\").offsetHeight + scheduler.$container.querySelector(\".dhx_cal_header\").offsetHeight;\r\n\t\t\tif (height < 0)\r\n\t\t\t\theight = 0;\r\n\t\t\tlet width = scheduler._x - scheduler.xy.map_date_width - scheduler.xy.map_description_width - 1;\r\n\t\t\tif (width < 0)\r\n\t\t\t\twidth = 0;\r\n\t\t\tmap.style.height = height + 'px';\r\n\t\t\tmap.style.width = width + 'px';\r\n\t\t\tmap.style.position = \"absolute\";\r\n\t\t\tmap.style.top = nav_height + \"px\";\r\n\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\tmap.style.marginRight = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t} else {\r\n\t\t\t\tmap.style.marginLeft = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t}\r\n\t\t\tmap.style.marginTop = (scheduler.xy.nav_height + 2) + 'px';\r\n\t\t}\r\n\t}\t\r\n\tfunction fill_map_tab() {\r\n\t\t//select events for which data need to be printed\r\n\t\tlet events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a, b) {\r\n\t\t\tif(a.start_date.valueOf()==b.start_date.valueOf())\r\n\t\t\t\treturn a.id>b.id?1:-1;\r\n\t\t\treturn a.start_date>b.start_date?1:-1;\r\n\t\t});\r\n\r\n\t\t//generate html for the view\r\n\t\tlet ariaAttr = scheduler._waiAria.mapAttrString();\r\n\r\n\t\tlet html = \"
\";\r\n\t\tfor (let i = 0; i < events.length; i++) {\r\n\t\t\tlet ev = events[i];\r\n\t\t\tlet event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';\r\n\t\t\tlet bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tlet color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\tlet ariaAttr = scheduler._waiAria.mapRowAttrString(ev);\r\n\t\t\tlet ariaButtonAttr = scheduler._waiAria.mapDetailsBtnString();\r\n\r\n\t\t\thtml += \"
\" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + \"
\";\r\n\t\t\thtml += `
`;\r\n\t\t\thtml += \"
\" + scheduler.templates.map_text(ev.start_date, ev.end_date, ev) + \"
\"; // -25 = icon size 20 and padding 5\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0; //fix flickering in FF\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t//\tscheduler._els[\"dhx_cal_data\"][0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tlet dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates[scheduler._mode + \"_date\"](scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered = [];\r\n\t\tfor (let i = 0; i < t.length - 2; i++) {\r\n\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t}\r\n\t}\r\n\tfunction set_full_view(mode) {\r\n\t\tif (mode) {\r\n\t\t\tconst l = scheduler.locale.labels;\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML = \"
\" + l.date + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"
\" + l.description + \"
\";\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\t\r\n\tscheduler.attachEvent(\"onLocationError\", function (id){\r\n\t\talert(\"Location can't be found\");\r\n\t\treturn google.maps.LatLng(51.477840, -0.001492); \r\n\t\t//the coordinates of the Greenwich Royal Observatory\r\n\t})\r\n\tlet _updateEventLocation = async function(event) {\r\n\t\tif (mapAdapter){\r\n\t\t\tconst coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\t\t\tif (coordinates.lat && coordinates.lng) {\r\n\t\t\t\tevent.lat = +coordinates.lat;\r\n\t\t\t\tevent.lng = +coordinates.lng;\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\tevent.lng = scheduler.config.map_settings.error_position.lng;\r\n\t\t\t\tevent.lat = scheduler.config.map_settings.error_position.lat;\r\n\t\t\t}\r\n\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t}\r\n\t};\r\n\tlet _delay = function(method, object, params, delay) {\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tlet ret = method.apply(object, params);\r\n\t\t\tmethod = object = params = null;\r\n\t\t\treturn ret;\r\n\t\t}, delay || 1);\r\n\t};\r\n\tscheduler._event_resolve_delay = 1500;\r\n\tscheduler.attachEvent(\"onEventLoading\", function(event) {\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tevent.lat = +event.lat;\r\n\t\t\tevent.lng = +event.lng;\r\n\t\t}\r\n\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !event.lat && !event.lng) { // don't delete !event.lat && !event.lng as location could change\r\n\t\t\tscheduler._event_resolve_delay += 1500;\r\n\t\t\t_delay(_updateEventLocation, this, [event], scheduler._event_resolve_delay);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n})\r\n\r\n}","export default function(scheduler){\r\n\r\nconst minicalDomEvents = scheduler._createDomEventScope();\r\n\t\r\n\r\nscheduler.config.minicalendar = {\r\n\tmark_events: true\r\n};\r\nscheduler._synced_minicalendars = [];\r\nscheduler.renderCalendar = function(obj, _prev, is_refresh) {\r\n\tvar cal = null;\r\n\tvar date = obj.date || (scheduler._currentDate());\r\n\tif (typeof date == \"string\")\r\n\t\tdate = this.templates.api_date(date);\r\n\r\n\tif (!_prev) {\r\n\t\tvar cont = obj.container;\r\n\t\tvar pos = obj.position;\r\n\r\n\t\tif (typeof cont == \"string\")\r\n\t\t\tcont = document.getElementById(cont);\r\n\r\n\t\tif (typeof pos == \"string\")\r\n\t\t\tpos = document.getElementById(pos);\r\n\t\tif (pos && (typeof pos.left == \"undefined\" && typeof pos.right == \"undefined\")) {\r\n\t\t\tvar tpos = scheduler.$domHelpers.getOffset(pos);\r\n\t\t\tpos = {\r\n\t\t\t\ttop: tpos.top + pos.offsetHeight,\r\n\t\t\t\tleft: tpos.left\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!cont)\r\n\t\t\tcont = scheduler._get_def_cont(pos);\r\n\r\n\t\tcal = this._render_calendar(cont, date, obj);\r\n\t\r\n\t\tif (!cal.$_eventAttached) {\r\n\t\t\tcal.$_eventAttached = true;\r\n\t\t\tminicalDomEvents.attach(cal, \"click\", (function(e) {\r\n\t\t\t\tvar src = e.target || e.srcElement;\r\n\r\n\t\t\t\tvar $dom = scheduler.$domHelpers;\r\n\t\t\t\tif ($dom.closest(src, \".dhx_month_head\")) {\r\n\t\t\t\t\tif (!$dom.closest(src, \".dhx_after\") && !$dom.closest(src, \".dhx_before\")) {\r\n\r\n\t\t\t\t\t\tvar cellRoot = $dom.closest(src, \"[data-cell-date]\");\r\n\t\t\t\t\t\tvar dateAttribute = cellRoot.getAttribute(\"data-cell-date\");\r\n\t\t\t\t\t\tvar newDate = scheduler.templates.parse_date(dateAttribute);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tscheduler.unmarkCalendar(this);\r\n\t\t\t\t\t\tscheduler.markCalendar(this, newDate, \"dhx_calendar_click\");\r\n\t\t\t\t\t\tthis._last_date = newDate;\r\n\t\t\t\t\t\tif (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).bind(cal));\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tcal = this._render_calendar(_prev.parentNode, date, obj, _prev);\r\n\t\tscheduler.unmarkCalendar(cal);\r\n\t}\r\n\r\n\tif (scheduler.config.minicalendar.mark_events) {\r\n\t\tvar start = scheduler.date.month_start(date);\r\n\t\tvar end = scheduler.date.add(start, 1, \"month\");\r\n\t\tvar evs = this.getEvents(start, end);\r\n\t\tvar filter = this[\"filter_\" + this._mode];\r\n\t\tvar markedDates = {};\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif (filter && !filter(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar d = ev.start_date;\r\n\t\t\tif (d.valueOf() < start.valueOf())\r\n\t\t\t\td = start;\r\n\t\t\td = scheduler.date.date_part(new Date(d.valueOf()));\r\n\t\t\twhile (d < ev.end_date) {\r\n\t\t\t\tif(!markedDates[+d]) {\r\n\t\t\t\t\tmarkedDates[+d] = true;\r\n\t\t\t\t\tthis.markCalendar(cal, d, \"dhx_year_event\");\r\n\t\t\t\t}\r\n\t\t\t\td = this.date.add(d, 1, \"day\");\r\n\t\t\t\tif (d.valueOf() >= end.valueOf())\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthis._markCalendarCurrentDate(cal);\r\n\r\n\tcal.conf = obj;\r\n\tif (obj.sync && !is_refresh)\r\n\t\tthis._synced_minicalendars.push(cal);\r\n\r\n\tif(!cal.conf._on_xle_handler){\r\n\t\tcal.conf._on_xle_handler = scheduler.attachEvent(\"onXLE\", function refreshOnLoad(){\r\n\t\t\tscheduler.updateCalendar(cal, cal.conf.date);\r\n\t\t});\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tcal.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\treturn cal;\r\n};\r\nscheduler._get_def_cont = function(pos) {\r\n\tif (!this._def_count) {\r\n\t\tthis._def_count = document.createElement(\"div\");\r\n\t\tthis._def_count.className = \"dhx_minical_popup\";\r\n\t\tscheduler.event(this._def_count, \"click\", function(e) { e.cancelBubble = true; });\r\n\t\tdocument.body.appendChild(this._def_count);\r\n\t}\r\n\r\n\tif(pos.left){\r\n\t\tthis._def_count.style.left = pos.left + \"px\";\r\n\t}\r\n\tif(pos.right){\r\n\t\tthis._def_count.style.right = pos.right + \"px\";\r\n\t}\r\n\tif(pos.top){\r\n\t\tthis._def_count.style.top = pos.top + \"px\";\r\n\t}\r\n\tif(pos.bottom){\r\n\t\tthis._def_count.style.bottom = pos.bottom + \"px\";\r\n\t}\r\n\r\n\tthis._def_count._created = new Date();\r\n\r\n\treturn this._def_count;\r\n};\r\nscheduler._locateCalendar = function(cal, date) {\r\n\tif (typeof date == \"string\")\r\n\t\tdate = scheduler.templates.api_date(date);\r\n\r\n\tif(+date > +cal._max_date || +date < +cal._min_date)\r\n\t\treturn null;\r\n\r\n\tvar table = cal.querySelector(\".dhx_year_body\").childNodes[0];\r\n\r\n\tvar weekNum = 0;\r\n\tvar dat = new Date(cal._min_date);\r\n\twhile(+this.date.add(dat, 1, \"week\") <= +date){\r\n\t\tdat = this.date.add(dat, 1, \"week\");\r\n\t\tweekNum++;\r\n\t}\r\n\r\n\tvar sm = scheduler.config.start_on_monday;\r\n\tvar day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0);\r\n\r\n\tconst dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`);\r\n\tif(dayCell) {\r\n\t\treturn dayCell.firstChild;\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n};\r\nscheduler.markCalendar = function(cal, date, css) {\r\n\tvar div = this._locateCalendar(cal, date);\r\n\tif(!div)\r\n\t\treturn;\r\n\r\n\tdiv.className += \" \" + css;\r\n};\r\nscheduler.unmarkCalendar = function(cal, date, css) {\r\n\tdate = date || cal._last_date;\r\n\tcss = css || \"dhx_calendar_click\";\r\n\tif (!date) return;\r\n\tvar el = this._locateCalendar(cal, date);\r\n\tif(!el)\r\n\t\treturn;\r\n\tel.className = (el.className || \"\").replace(RegExp(css, \"g\"));\r\n};\r\nscheduler._week_template = function(width) {\r\n\tvar summ = (width || 250);\r\n\tvar left = 0;\r\n\r\n\tvar week_template = document.createElement(\"div\");\r\n\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tthis._cols[i] = Math.floor(summ / (7 - i));\r\n\t\tthis._render_x_header(i, left, dummy_date, week_template);\r\n\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\tsumm -= this._cols[i];\r\n\t\tleft += this._cols[i];\r\n\t}\r\n\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\treturn week_template;\r\n};\r\nscheduler.updateCalendar = function(obj, sd) {\r\n\tobj.conf.date = sd;\r\n\tthis.renderCalendar(obj.conf, obj, true);\r\n};\r\nscheduler._mini_cal_arrows = [\" \", \" \"];\r\nscheduler._render_calendar = function(obj, sd, conf, previous) {\r\n\t/*store*/\r\n\tvar ts = scheduler.templates;\r\n\tvar temp = this._cols;\r\n\tthis._cols = [];\r\n\tvar temp2 = this._mode;\r\n\tthis._mode = \"calendar\";\r\n\tvar temp3 = this._colsS;\r\n\tthis._colsS = {height: 0};\r\n\tvar temp4 = new Date(this._min_date);\r\n\tvar temp5 = new Date(this._max_date);\r\n\tvar temp6 = new Date(scheduler._date);\r\n\tvar temp7 = ts.month_day;\r\n\tvar temp8 = this._ignores_detected; this._ignores_detected = 0;\r\n\tts.month_day = ts.calendar_date;\r\n\r\n\tsd = this.date.month_start(sd);\r\n\tvar week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding );\r\n\r\n\tvar d;\r\n\tif (previous){\r\n\t\td = previous;\r\n\t} else {\r\n\t\td = document.createElement(\"div\");\r\n\t\td.className = \"dhx_cal_container dhx_mini_calendar\";\r\n\t}\r\n\td.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\td.innerHTML = \"
\" +\r\n\t\t\t\"
\" : \"'>\") +\r\n\t\t\t\"
\"+(week_template ? week_template.innerHTML : \"\")+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\"
\";\r\n\tvar header = d.querySelector(\".dhx_year_month\");\r\n\tvar weekHeader = d.querySelector(\".dhx_year_week\");\r\n\tvar body = d.querySelector(\".dhx_year_body\");\r\n\r\n\theader.innerHTML = this.templates.calendar_month(sd);\r\n\tif (conf.navigation) {\r\n\t\tvar move_minicalendar_date = function(calendar, diff) {\r\n\t\t\tvar date = scheduler.date.add(calendar._date, diff, \"month\");\r\n\t\t\tscheduler.updateCalendar(calendar, date);\r\n\t\t\tif (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {\r\n\t\t\t\tscheduler._markCalendarCurrentDate(calendar);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar css_classnames = [\"dhx_cal_prev_button\", \"dhx_cal_next_button\"];\r\n\t\tvar css_texts = [\"left:1px;top:4px;position:absolute;\", \"left:auto; right:1px;top:4px;position:absolute;\"];\r\n\t\tvar diffs = [-1, 1];\r\n\t\tvar handler = function(diff) {\r\n\t\t\treturn function() {\t\r\n\t\t\t\tif (conf.sync) {\r\n\t\t\t\t\tvar calendars = scheduler._synced_minicalendars;\r\n\t\t\t\t\tfor (var k = 0; k < calendars.length; k++) {\r\n\t\t\t\t\t\tmove_minicalendar_date(calendars[k], diff);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\t\t\tdiff = -diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmove_minicalendar_date(d, diff);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t};\r\n\t\tvar labels = [scheduler.locale.labels.prev, scheduler.locale.labels.next];\r\n\t\tfor (var j = 0; j < 2; j++) {\r\n\t\t\tvar arrow = document.createElement(\"div\");\r\n\t\t\t//var diff = diffs[j];\r\n\t\t\tarrow.className = css_classnames[j];\r\n\r\n\t\t\tscheduler._waiAria.headerButtonsAttributes(arrow, labels[j]);\r\n\r\n\t\t\tarrow.style.cssText = css_texts[j];\r\n\t\t\tarrow.innerHTML = this._mini_cal_arrows[j];\r\n\t\t\theader.appendChild(arrow);\r\n\t\t\tminicalDomEvents.attach(arrow, \"click\", handler(diffs[j]));\r\n\t\t}\r\n\t}\r\n\td._date = new Date(sd);\r\n\r\n\td.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\r\n\tvar dd = d._min_date = this.date.week_start(sd);\r\n\td._max_date = this.date.add(d._min_date, 6, \"week\");\r\n\r\n\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\tif (!previous)\r\n\t\tobj.appendChild(d);\r\n\r\n\tweekHeader.style.height = (weekHeader.childNodes[0].offsetHeight - 1) + \"px\"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)\r\n\r\n\tvar headerId = scheduler.uid();\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\tscheduler._waiAria.minicalGrid(d.querySelector(\".dhx_year_grid\"), headerId);\r\n\tscheduler._waiAria.minicalRow(weekHeader);\r\n\r\n\tvar dayHeaders = weekHeader.querySelectorAll(\".dhx_scale_bar\");\r\n\tfor(var i = 0; i < dayHeaders.length; i++){\r\n\t\tscheduler._waiAria.minicalHeadCell(dayHeaders[i]);\r\n\t}\r\n\tvar dayCells = body.querySelectorAll(\".dhx_cal_month_cell\");\r\n\tvar firstDate = new Date(dd);\r\n\tfor(var i = 0; i < dayCells.length; i++){\r\n\r\n\t\tscheduler._waiAria.minicalDayCell(dayCells[i], new Date(firstDate));\r\n\t\tfirstDate = scheduler.date.add(firstDate, 1, \"day\");\r\n\t}\r\n\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\r\n\t/*restore*/\r\n\tthis._cols = temp;\r\n\tthis._mode = temp2;\r\n\tthis._colsS = temp3;\r\n\tthis._min_date = temp4;\r\n\tthis._max_date = temp5;\r\n\tscheduler._date = temp6;\r\n\tts.month_day = temp7;\r\n\tthis._ignores_detected = temp8;\r\n\treturn d;\r\n};\r\nscheduler.destroyCalendar = function(cal, force) {\r\n\tif (!cal && this._def_count && this._def_count.firstChild) {\r\n\t\tif (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)\r\n\t\t\tcal = this._def_count.firstChild;\r\n\t}\r\n\tif (!cal) return;\r\n\tminicalDomEvents.detachAll();\r\n\t//cal.onclick = null;\r\n\tcal.innerHTML = \"\";\r\n\tif (cal.parentNode)\r\n\t\tcal.parentNode.removeChild(cal);\r\n\tif (this._def_count)\r\n\t\tthis._def_count.style.top = \"-1000px\";\r\n\r\n\tif(cal.conf && cal.conf._on_xle_handler)\r\n\t\tscheduler.detachEvent(cal.conf._on_xle_handler);\r\n};\r\nscheduler.isCalendarVisible = function() {\r\n\tif (this._def_count && parseInt(this._def_count.style.top, 10) > 0)\r\n\t\treturn this._def_count;\r\n\treturn false;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tscheduler.event(document.body, \"click\", function() { scheduler.destroyCalendar(); });\r\n}, {once: true});\r\n\r\n\r\n\r\nscheduler.form_blocks.calendar_time = {\r\n\trender: function(sns) {\r\n\t\tvar html = \"
\";\r\n\r\n\t\tvar cfg = scheduler.config;\r\n\t\tvar dt = this.date.date_part(scheduler._currentDate());\r\n\r\n\t\tvar last = 24 * 60, first = 0;\r\n\t\tif (cfg.limit_time_select) {\r\n\t\t\tfirst = 60 * cfg.first_hour;\r\n\t\t\tlast = 60 * cfg.last_hour + 1; // to include \"17:00\" option if time select is limited\r\n\t\t}\r\n\t\tdt.setHours(first / 60);\r\n\r\n\t\tsns._time_values = [];\r\n\t\thtml += \"
\";\r\n\t\tfor (var i = first; i < last; i += this.config.time_step * 1) { // `<` to exclude last \"00:00\" option\r\n\t\t\tvar time = this.templates.time_picker(dt);\r\n\t\t\thtml += \"\" + time + \" \";\r\n\t\t\tsns._time_values.push(i);\r\n\t\t\tdt = this.date.add(dt, this.config.time_step, \"minute\");\r\n\t\t}\r\n\t\thtml += \" \";\r\n\r\n\t\t//var full_day = scheduler.config.full_day;\r\n\r\n\t\treturn \"
\" + html + \" – \" + html + \"
\";\r\n\t},\r\n\tset_value: function(node, value, ev, config) {\r\n\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar start_date,\r\n\t\t\tend_date;\r\n\r\n\t\tvar _init_once = function(inp, date, number) {\r\n\t\t\tscheduler.event(inp, \"click\", function() {\r\n\t\t\t\tscheduler.destroyCalendar(null, true);\r\n\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\tposition: inp,\r\n\t\t\t\t\tdate: new Date(this._date),\r\n\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\thandler: function(new_date) {\r\n\t\t\t\t\t\tinp.value = scheduler.templates.calendar_time(new_date);\r\n\t\t\t\t\t\tinp._date = new Date(new_date);\r\n\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date && number === 0) { //first element = start date\r\n\t\t\t\t\t\t\t_update_minical_select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (scheduler.config.full_day) {\r\n\t\t\tif (!node._full_day) {\r\n\t\t\t\tvar html = \"
\" + scheduler.locale.labels.full_day + \" \";\r\n\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\thtml = node.previousSibling.innerHTML + html;\r\n\t\t\t\tnode.previousSibling.innerHTML = html;\r\n\t\t\t\tnode._full_day = true;\r\n\t\t\t}\r\n\t\t\tvar input = node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\r\n\t\t\tvar isFulldayEvent = (scheduler.date.time_part(ev.start_date) === 0 && scheduler.date.time_part(ev.end_date) === 0);\r\n\t\t\tinput.checked = isFulldayEvent;\r\n\r\n\t\t\tselects[0].disabled = input.checked;\r\n\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\tif (!input.$_eventAttached) {\r\n\t\t\t\tinput.$_eventAttached = true;\r\n\t\t\t\tscheduler.event(input, \"click\", function() {\r\n\t\t\t\t\tif (input.checked === true) {\r\n\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\tscheduler.form_blocks.calendar_time.get_value(node, obj);\r\n\r\n\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar start = start_date || ev.start_date;\r\n\t\t\t\t\tvar end = end_date || ev.end_date;\r\n\t\t\t\t\t_attach_action(inputs[0], start);\r\n\t\t\t\t\t_attach_action(inputs[1], end);\r\n\t\t\t\t\tselects[0].value = start.getHours() * 60 + start.getMinutes();\r\n\t\t\t\t\tselects[1].value = end.getHours() * 60 + end.getMinutes();\r\n\r\n\t\t\t\t\tselects[0].disabled = input.checked;\r\n\t\t\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date) {\r\n\r\n\t\t\tvar _update_minical_select = function () {\r\n\t\t\t\tif (!(scheduler.config.auto_end_date && scheduler.config.event_duration)){\r\n\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstart_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\r\n\t\t\t\tinputs[1].value = scheduler.templates.calendar_time(end_date);\r\n\t\t\t\tinputs[1]._date = scheduler.date.date_part(new Date(end_date));\r\n\r\n\t\t\t\tselects[1].value = end_date.getHours() * 60 + end_date.getMinutes();\r\n\t\t\t};\r\n\r\n\t\t\tif(!selects[0].$_eventAttached){\r\n\t\t\t\tselects[0].addEventListener(\"change\", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _attach_action(inp, date, number) {\r\n\t\t\t_init_once(inp, date, number);\r\n\t\t\tinp.value = scheduler.templates.calendar_time(date);\r\n\t\t\tinp._date = scheduler.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\t_attach_action(inputs[0], ev.start_date, 0);\r\n\t\t_attach_action(inputs[1], ev.end_date, 1);\r\n\t\t_init_once = function() {};\r\n\r\n\t\tfunction _round_minutes(date) {\r\n\t\t\tvar time_values = config._time_values;\r\n\t\t\tvar direct_value = date.getHours() * 60 + date.getMinutes();\r\n\t\t\tvar fixed_value = direct_value;\r\n\t\t\tvar value_found = false;\r\n\r\n\t\t\tfor (var k = 0; k < time_values.length; k++) {\r\n\t\t\t\tvar t_v = time_values[k];\r\n\t\t\t\tif (t_v === direct_value) {\r\n\t\t\t\t\tvalue_found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (t_v < direct_value)\r\n\t\t\t\t\tfixed_value = t_v;\r\n\t\t\t}\r\n\r\n\t\t\tif(!(value_found || fixed_value))\r\n\t\t\t\treturn -1;\r\n\r\n\t\t\treturn (value_found) ? direct_value : fixed_value;\r\n\t\t}\r\n\r\n\t\tselects[0].value = _round_minutes(ev.start_date);\r\n\t\tselects[1].value = _round_minutes(ev.end_date);\r\n\r\n\t},\r\n\tget_value: function(node, ev) {\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\r\n\t\tev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\tev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, \"minute\");\r\n\r\n\t\tif (ev.end_date <= ev.start_date)\r\n\t\t\tev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, \"minute\");\r\n\t\treturn {\r\n\t\t\tstart_date: new Date(ev.start_date),\r\n\t\t\tend_date: new Date(ev.end_date)\r\n\t\t};\r\n\t},\r\n\tfocus: function(node) {\r\n\t}\r\n};\r\nscheduler.linkCalendar = function(calendar, datediff) {\r\n\tvar action = function() {\r\n\t\tvar date = scheduler._date;\r\n\t\tvar dateNew = new Date(date.valueOf());\r\n\t\tif (datediff) dateNew = datediff(dateNew);\r\n\t\tdateNew.setDate(1);\r\n\t\tscheduler.updateCalendar(calendar, dateNew);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", action);\r\n\tscheduler.attachEvent(\"onXLE\", action);\r\n\tscheduler.attachEvent(\"onEventAdded\", action);\r\n\tscheduler.attachEvent(\"onEventChanged\", action);\r\n\tscheduler.attachEvent(\"onEventDeleted\", action);\r\n\taction();\r\n};\r\n\r\nscheduler._markCalendarCurrentDate = function(calendar) {\r\n\tvar state = scheduler.getState();\r\n\tvar from = state.min_date;\r\n\tvar to = state.max_date;\r\n\tvar mode = state.mode;\r\n\r\n\tvar month_start = scheduler.date.month_start(new Date(calendar._date));\r\n\tvar month_end = scheduler.date.add(month_start, 1, \"month\");\r\n\r\n\tvar noHighlight = {\r\n\t\t\"month\":true,\r\n\t\t\"year\":true,\r\n\t\t\"agenda\":true,\r\n\t\t\"grid\":true\r\n\t};\r\n\t// no need to highlight current dates for a large range views - agenda, year, etc.\r\n\tif(noHighlight[mode] || (from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf())){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar current = from;\r\n\twhile(current.valueOf() < to.valueOf()){\r\n\t\tif (month_start.valueOf() <= current.valueOf() && month_end > current) {\r\n\t\t\tscheduler.markCalendar(calendar, current, \"dhx_calendar_click\");\r\n\t\t}\r\n\t\tcurrent = scheduler.date.add(current, 1, \"day\");\r\n\t}\r\n};\r\n\r\nscheduler.attachEvent(\"onEventCancel\", function(){\r\n\tscheduler.destroyCalendar(null, true);\r\n});\r\n\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tscheduler.destroyCalendar();\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tscheduler.xy.scroll_width = 0;\r\n\r\n\tvar old = scheduler.render_view_data;\r\n\tscheduler.render_view_data=function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tdata.firstChild._h_fix = true;\r\n\r\n\t\told.apply(scheduler,arguments);\r\n\r\n\r\n\r\n\t\tvar height = parseInt(data.style.height);\r\n\t\tdata.style.height=\"1px\";\r\n\t\tdata.style.height=data.scrollHeight+\"px\";\r\n\r\n\t\tthis._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + \"px\";\r\n\t};\r\n\r\n\tvar old_s=scheduler._reset_month_scale;\r\n\tscheduler._reset_month_scale=function(a,b,c,d){\r\n\t\tvar dummy = {clientHeight:100};\r\n\t\told_s.apply(scheduler,[dummy,b,c,d]);\r\n\t\ta.innerHTML = dummy.innerHTML;\r\n\t};\r\n\r\n});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Multisection\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\n\r\nfunction parseXMLOptions(loader, config){\r\n\tvar items = scheduler.ajax.xpath(\"//data/item\", loader.xmlDoc);\r\n\tvar ids = {};\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tids[items[i].getAttribute(config.map_to)] = true;\r\n\t}\r\n\treturn ids;\r\n}\r\n\r\nfunction parseJSONOptions(loader, config){\r\n\ttry{\r\n\t\tvar items = JSON.parse(loader.xmlDoc.responseText);\r\n\t\tvar ids = {};\r\n\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\tvar option = items[i];\r\n\r\n\t\t\tids[option.value || option.key || option.id] = true;\r\n\t\t}\r\n\t\treturn ids;\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nscheduler.form_blocks[\"multiselect\"]={\r\n\trender:function(sns) {\r\n\t\tvar css = \"dhx_multi_select_control dhx_multi_select_\"+sns.name;\r\n\t\tif(!!sns.vertical){\r\n\t\t\tcss += \" dhx_multi_select_control_vertical\";\r\n\t\t}\r\n\r\n\t\tvar _result = \"
\";\r\n\t\tfor (var i=0; i \"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\t_result += \"
\";\r\n\t\treturn _result;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\r\n\t\tvar _children = node.getElementsByTagName('input');\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\t_children[i].checked = false; //unchecking all inputs on the form\r\n\t\t}\r\n\r\n\t\tfunction _mark_inputs(ids) { // ids = [ 0: undefined, 1: undefined, 2: true, 'custom_name': false ... ]\r\n\t\t\tvar _children = node.getElementsByTagName('input');\r\n\t\t\tfor(var i=0;i<_children.length; i++) {\r\n\t\t\t\t_children[i].checked = !! ids[_children[i].value];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar _ids = {};\r\n\t\tif (ev[config.map_to]) {\r\n\t\t\tvar results = (ev[config.map_to] + \"\").split(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\t_ids[results[i]] = true;\r\n\t\t\t}\r\n\t\t\t_mark_inputs(_ids);\r\n\t\t} else {\r\n\t\t\tif (scheduler._new_event || !config.script_url)\r\n\t\t\t\treturn;\r\n\t\t\tvar divLoading = document.createElement('div');\r\n\t\t\tdivLoading.className = 'dhx_loading';\r\n\t\t\tdivLoading.style.cssText = \"position: absolute; top: 40%; left: 40%;\";\r\n\t\t\tnode.appendChild(divLoading);\r\n\r\n\t\t\tvar url = [\r\n\t\t\t\tconfig.script_url,\r\n\t\t\t\t(config.script_url.indexOf(\"?\") == -1 ? \"?\" : \"&\"),\r\n\t\t\t\t'dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid()\r\n\t\t\t].join(\"\");\r\n\r\n\t\t\tscheduler.ajax.get(url, function(loader) {\r\n\t\t\t\tvar options = parseJSONOptions(loader, config);\r\n\t\t\t\tif(!options){\r\n\t\t\t\t\toptions = parseXMLOptions(loader, config);\r\n\t\t\t\t}\r\n\t\t\t\t_mark_inputs(options);\r\n\t\t\t\tnode.removeChild(divLoading);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar _result = [];\r\n\t\tvar _children = node.getElementsByTagName(\"input\");\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\tif(_children[i].checked)\r\n\t\t\t\t_result.push(_children[i].value);\r\n\t\t}\r\n\t\treturn _result.join(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t},\r\n\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\tfunction backup(obj){\r\n\t\tvar t = function(){};\r\n\t\tt.prototype = obj;\r\n\t\treturn t;\r\n\t}\r\n\r\n\tvar old = scheduler._load;\r\n\tscheduler._load=function(url,from){\r\n\t\turl=url||this._load_url;\r\n\t\tif (typeof url == \"object\"){\r\n\t\t\tvar t = backup(this._loaded);\r\n\t\t\tfor (var i=0; i < url.length; i++) {\r\n\t\t\t\tthis._loaded=new t();\r\n\t\t\t\told.call(this,url[i],from);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\told.apply(this,arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\t/* global Backbone */\r\n\tvar cfg = {\r\n\t\tuse_id : false\r\n\t};\r\n\r\n\t//remove private properties\r\n\tfunction sanitize(ev){\r\n\t\tvar obj = {};\r\n\t\tfor (var key in ev)\r\n\t\t\tif (key.indexOf(\"_\") !== 0)\r\n\t\t\t\tobj[key] = ev[key];\r\n\r\n\t\tif (!cfg.use_id)\r\n\t\t\tdelete obj.id;\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tvar update_timer;\r\n\tfunction update_view(){\r\n\t\tclearTimeout(update_timer);\r\n\t\tupdate_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.updateView();\r\n\t\t},1);\r\n\t}\r\n\r\n\tfunction _start_ext_load(cal){\r\n\t\tcal._loading = true;\r\n\t\tcal._not_render = true;\r\n\r\n\t\tcal.callEvent(\"onXLS\", []);\r\n\t}\r\n\tfunction _finish_ext_load(cal){\r\n\t\tcal._not_render = false;\r\n\t\tif (cal._render_wait)\r\n\t\t\tcal.render_view_data();\r\n\t\tcal._loading = false;\r\n\r\n\t\tcal.callEvent(\"onXLE\", []);\r\n\t}\r\n\r\n\r\n\tfunction _get_id(model){\r\n\t\treturn cfg.use_id ? model.id : model.cid;\r\n\t}\r\n\r\nscheduler.backbone = function(events, config){\r\n\tif (config) cfg = config;\r\n\r\n\tevents.bind(\"change\", function(model, info){\r\n\t\tvar cid = _get_id(model);\r\n\t\tvar ev = scheduler._events[cid] = model.toJSON();\r\n\t\tev.id = cid;\r\n\r\n\t\tscheduler._init_event(ev);\r\n\t\tupdate_view();\r\n\t});\r\n\tevents.bind(\"remove\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (scheduler._events[cid])\r\n\t\t\tscheduler.deleteEvent(cid);\r\n\t});\r\n\r\n\tvar queue = [];\r\n\tfunction add_from_queue(){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (queue.length){\r\n\t\t\tscheduler.parse(queue, \"json\");\r\n\t\t\tqueue = [];\r\n\t\t}\r\n\t}\r\n\r\n\tevents.bind(\"add\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (!scheduler._events[cid]){\r\n\t\t\tvar ev = model.toJSON();\r\n\t\t\tev.id = cid;\r\n\t\t\tscheduler._init_event(ev);\r\n\r\n\t\t\tqueue.push(ev);\r\n\t\t\tif (queue.length == 1)\r\n\t\t\t\tsetTimeout(add_from_queue,1);\r\n\t\t}\r\n\t});\r\n\r\n\tevents.bind(\"request\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_start_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"sync\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"error\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventCreated\", function(id){\r\n\t\tvar ev = new events.model(scheduler.getEvent(id));\r\n\t\tscheduler._events[id] = ev.toJSON();\r\n\t\tscheduler._events[id].id = id;\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id){\r\n\t\tif (!events.get(id)){\r\n\t\t\tvar data = sanitize(scheduler.getEvent(id));\r\n\t\t\tvar model = new events.model(data);\r\n\r\n\t\t\tvar cid = _get_id(model);\r\n\t\t\tif (cid != id)\r\n\t\t\t\tthis.changeEventId(id, cid);\r\n\t\t\tevents.add(model);\r\n\t\t\tevents.trigger(\"scheduler:add\", model);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id){\r\n\t\tvar ev = events.get(id);\r\n\t\tvar upd = sanitize(scheduler.getEvent(id));\r\n\r\n\t\tev.set(upd);\r\n\t\tevents.trigger(\"scheduler:change\", ev);\r\n\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id){\r\n\t\tvar model = events.get(id);\r\n\t\tif (model){\r\n\t\t\tevents.trigger(\"scheduler:remove\", model);\r\n\t\t\tevents.remove(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t/* global dhtmlDragAndDropObject, dhtmlx */\r\n// lame old code doesn't provide raw event object\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tvar dragger = (new dhtmlDragAndDropObject());\r\n\t\tvar old = dragger.stopDrag;\r\n\t\tvar last_event;\r\n\t\tdragger.stopDrag = function(e) {\r\n\t\t\tlast_event = e;\r\n\t\t\treturn old.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tfunction on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\r\n\t\t\tif (scheduler.checkEvent(\"onBeforeExternalDragIn\") && !scheduler.callEvent(\"onBeforeExternalDragIn\", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar temp = scheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\t\t\tif (!scheduler.callEvent(\"onExternalDragIn\", [id, sourceHtmlObject, last_event])) {\r\n\t\t\t\t\tthis._drag_mode = this._drag_id = null;\r\n\t\t\t\t\tthis.deleteEvent(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar action_data = scheduler.getActionData(last_event);\r\n\t\t\tvar event_data = {\r\n\t\t\t\tstart_date: new Date(action_data.date)\r\n\t\t\t};\r\n\r\n\t\t\t// custom views, need to assign section id, fix dates\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\tvar view_options = scheduler.matrix[scheduler._mode];\r\n\t\t\t\tevent_data[view_options.y_property] = action_data.section;\r\n\r\n\t\t\t\tvar pos = scheduler._locate_cell_timeline(last_event);\r\n\t\t\t\tevent_data.start_date = view_options._trace_x[pos.x];\r\n\t\t\t\tevent_data.end_date = scheduler.date.add(event_data.start_date, view_options.x_step, view_options.x_unit);\r\n\t\t\t}\r\n\t\t\tif (scheduler._props && scheduler._props[scheduler._mode]) {\r\n\t\t\t\tevent_data[scheduler._props[scheduler._mode].map_to] = action_data.section;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.addEventNow(event_data);\r\n\r\n\t\t\tscheduler.detachEvent(temp);\r\n\t\t}\r\n\r\n\t\tdragger.addDragLanding(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t_drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\t\t\t\ton_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml);\r\n\t\t\t},\r\n\t\t\t_dragIn: function(htmlObject, shtmlObject) {\r\n\t\t\t\treturn htmlObject;\r\n\t\t\t},\r\n\t\t\t_dragOut: function(htmlObject) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(dhtmlx.DragControl) {\r\n\t\t\tdhtmlx.DragControl.addDrop(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t\tonDrop: function (source, target, d, e) {\r\n\t\t\t\t\tvar sourceDhtmlx = dhtmlx.DragControl.getMaster(source);\r\n\t\t\t\t\tlast_event = e;\r\n\t\t\t\t\ton_drop(source, sourceDhtmlx, target, e.target || e.srcElement);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonDragIn: function (source, target, e) {\r\n\t\t\t\t\treturn target;\r\n\t\t\t\t}\r\n\t\t\t}, true);\r\n\t\t}\r\n\t});\r\n\r\n}","export default function(scheduler){\r\n\r\n\tvar dx, dy,\r\n\t\thtml_regexp = new RegExp(\"<[^>]*>\", \"g\"),\r\n\t\tnewline_regexp = new RegExp(\"
]*>\", \"g\");\r\n\r\n\tfunction clean_html(val) {\r\n\t\treturn val.replace(newline_regexp, \"\\n\").replace(html_regexp, \"\");\r\n\t}\r\n\r\n\tfunction x_norm(x, offset) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset)) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx));\r\n\t}\r\n\r\n\tfunction x_norm_event(x, offset, is_left) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset) && is_left) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx-(!isNaN(offset)?offset:0)));\r\n\t}\r\n\tfunction colsWidth(width) {\r\n\t\tvar r = 0;\r\n\t\tvar header = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\tvar els = header[1] ? header[1].childNodes : header[0].childNodes;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tvar el = els[i].style ? els[i] : els[i].parentNode;\r\n\t\t\tvar w = parseFloat(el.style.width);\r\n\t\t\tif (width > w){\r\n\t\t\t\twidth -= (w+1);\r\n\t\t\t\tr+=(w+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn { width: r, cols: i };\r\n\t}\r\n\r\n\tfunction y_norm(y) {\r\n\t\ty = parseFloat(y);\r\n\t\tif (isNaN(y)) return \"auto\";\r\n\t\treturn 100 * y / dy;\r\n\t}\r\n\r\n\tfunction get_style(node, style){\r\n\t\treturn (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||\"\";\r\n\t}\r\n\r\n\tfunction de_day(node, n) {\r\n\t\tvar x = parseInt(node.style.left, 10);\r\n\r\n\t\tfor (var dx = 0; dx < scheduler._cols.length; dx++) {\r\n\t\t\tx -= scheduler._cols[dx];\r\n\t\t\tif (x < 0) return dx;\r\n\t\t}\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction de_week(node, n) {\r\n\t\tvar y = parseInt(node.style.top, 10);\r\n\t\tfor (var dy = 0; dy < scheduler._colsS.heights.length; dy++)\r\n\t\t\tif (scheduler._colsS.heights[dy] > y) return dy;\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction xml_start(tag) {\r\n\t\treturn tag ? \"<\"+tag+\">\" : \"\";\r\n\t}\r\n\tfunction xml_end(tag) {\r\n\t\treturn tag ? \"\"+tag+\">\" : \"\";\r\n\t}\r\n\r\n\tfunction xml_top(tag, profile, header, footer) {\r\n\t\tvar xml = \"<\"+tag+\" profile='\" + profile + \"'\";\r\n\t\tif (header)\r\n\t\t\txml += \" header='\" + header + \"'\";\r\n\t\tif (footer)\r\n\t\t\txml += \" footer='\" + footer + \"'\";\r\n\t\txml += \">\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body_header() {\r\n\t\tvar xml = \"\";\r\n\t\t// detects if current mode is timeline\r\n\t\tvar mode = scheduler._mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode])\r\n\t\t\tmode = (scheduler.matrix[scheduler._mode].render == \"cell\") ? \"matrix\" : \"timeline\";\r\n\t\txml += \"
\";\r\n\r\n\t\tif (scheduler._mode == \"week_agenda\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"DIV\");\r\n\t\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\t\tif (xh[i].className == \"dhx_wa_scale_bar\")\r\n\t\t\t\t\txml += \"\" + clean_html(xh[i].innerHTML) + \" \";\r\n\t\t} else if (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;\r\n\r\n\t\t\txml += \"\" + clean_html(xh[0].innerHTML) + \" \" + clean_html(xh[1].innerHTML) + \" \";\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].childNodes;\r\n\t\t\tfor (var i = 0; i < xh.length; i++) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\txml += xml_month_scale(xh[i].querySelector(\".dhx_year_week\").childNodes);\r\n\t\t\t\txml += xml_month(xh[i].querySelector(\".dhx_year_body\"));\r\n\t\t\t\txml += \" \";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\txml += \"\";\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\t\txml += xml_month_scale(xh);\r\n\t\t\txml += \" \";\r\n\r\n\t\t\tvar yh = scheduler._els.dhx_cal_data[0];\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.firstChild.rows.length; i++) {\r\n\t\t\t\t\tvar el = yh.firstChild.rows[i];\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \" \";\r\n\t\t\t\tdy = yh.firstChild.rows[0].cells[0].offsetHeight;\r\n\t\t\t} else if (yh.firstChild.tagName == \"TABLE\") {\r\n\t\t\t\txml += xml_month(yh);\r\n\t\t\t} else {\r\n\t\t\t\tyh = yh.childNodes[yh.childNodes.length - 1];\r\n\t\t\t\twhile (yh.className.indexOf(\"dhx_scale_holder\") == -1)\r\n\t\t\t\t\tyh = yh.previousSibling;\r\n\t\t\t\tyh = yh.childNodes;\r\n\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.length; i++)\r\n\t\t\t\t\txml += \"\\n
\";\r\n\t\t\t\txml += \" \";\r\n\t\t\t\tdy = yh[0].offsetHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\txml += \" \";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month(yh) {\r\n\t\tvar xml = \"\";\r\n\t\tvar r = yh.querySelectorAll(\"tr\");\r\n\t\tfor (var i = 0; i < r.length; i++) {\r\n\t\t\tvar days = [];\r\n\t\t\tvar cells = r[i].querySelectorAll(\"td\");\r\n\r\n\t\t\tfor (var j = 0; j < cells.length; j++)\r\n\t\t\t\tdays.push(cells[j].querySelector(\".dhx_month_head\").innerHTML);\r\n\r\n\t\t\txml += \"\\n
|
\";\r\n\t\t\tdy = cells[0].offsetHeight;\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month_scale(xh) {\r\n\t\tvar xhs,\r\n\t\t\txml = \"\";\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\tif (scheduler.matrix[scheduler._mode].second_scale)\r\n\t\t\t\txhs = xh[1].childNodes;\r\n\r\n\t\t\txh = xh[0].childNodes;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\txml += \"\\n
\";\r\n\t\tdx = xh[0].offsetWidth;\r\n\r\n\t\tif (xhs) {\r\n\t\t\tvar width = 0;\r\n\t\t\tvar top_width = xh[0].offsetWidth;\r\n\t\t\tvar top_col = 1;\r\n\t\t\tfor (var i = 0; i < xhs.length; i++) {\r\n\t\t\t\txml += \"\\n
\";\r\n\t\t\t\twidth += xhs[i].offsetWidth;\r\n\t\t\t\tif (width >= top_width) {\r\n\t\t\t\t\ttop_width += (xh[top_col] ? xh[top_col].offsetWidth : 0);\r\n\t\t\t\t\ttop_col++;\r\n\t\t\t\t}\r\n\t\t\t\tdx = xhs[0].offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body(colors) {\r\n\t\tvar xml = \"\";\r\n\t\tvar evs = scheduler._rendered;\r\n\t\tvar matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];\r\n\r\n\t\tif (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n xml += \"
\";\r\n\r\n\t\t} else if (scheduler._mode == \"week_agenda\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\t\txml += \"
\" + clean_html(evs[i].innerHTML) + \" \";\r\n\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\r\n\t\t\tvar evs = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar d = evs[i].start_date;\r\n\t\t\t\tif (d.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\t\t\td = scheduler._min_date;\r\n\r\n\t\t\t\twhile (d < evs[i].end_date) {\r\n\t\t\t\t\tvar m = d.getMonth() + 12 * (d.getFullYear() - scheduler._min_date.getFullYear()) - scheduler.week_starts._month;\r\n\t\t\t\t\tvar day = scheduler.week_starts[m] + d.getDate() - 1;\r\n\t\t\t\t\tvar text_color = colors ? get_style(scheduler._get_year_cell(d), \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(scheduler._get_year_cell(d), \"backgroundColor\") : \"\";\r\n\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t\td = scheduler.date.add(d, 1, \"day\");\r\n\t\t\t\t\tif (d.valueOf() >= scheduler._max_date.valueOf())\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (matrix && matrix.render == \"cell\") {\r\n\t\t\tvar evs = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"TD\");\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\txml += \"\\n
\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar zx, zdx;\r\n\t\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\t// logic for timeline view\r\n\t\t\t\t\tzx = x_norm(evs[i].style.left);\r\n\t\t\t\t\tzdx = x_norm(evs[i].offsetWidth)-1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we should use specific logic for day/week/units view\r\n\t\t\t\t\tvar left_norm = scheduler.config.use_select_menu_space ? 0 : 26;\r\n\t\t\t\t\tzx = x_norm_event(evs[i].style.left, left_norm, true);\r\n\t\t\t\t\tzdx = x_norm_event(evs[i].style.width, left_norm)-1;\r\n\t\t\t\t}\r\n\t\t\t\tif (isNaN(zdx * 1)) continue;\r\n\t\t\t\tvar zy = y_norm(evs[i].style.top);\r\n\t\t\t\tvar zdy = y_norm(evs[i].style.height);\r\n\r\n\t\t\t\tvar e_type = evs[i].className.split(\" \")[0].replace(\"dhx_cal_\", \"\");\r\n\t\t\t\tif (e_type === 'dhx_tooltip_line') continue;\r\n\r\n\t\t\t\tvar dets = scheduler.getEvent(evs[i].getAttribute(scheduler.config.event_attribute));\r\n if (!dets) continue;\r\n\t\t\t\tvar day = dets._sday;\r\n\t\t\t\tvar week = dets._sweek;\r\n\t\t\t\tvar length = dets._length || 0;\r\n\r\n\t\t\t\tif (scheduler._mode == \"month\") {\r\n\t\t\t\t\tzdy = parseInt(evs[i].offsetHeight, 10);\r\n\t\t\t\t\tzy = parseInt(evs[i].style.top, 10) - scheduler.xy.month_head_height;\r\n\r\n\t\t\t\t\tday = de_day(evs[i], day);\r\n\t\t\t\t\tweek = de_week(evs[i], week);\r\n\t\t\t\t} else if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\tday = 0;\r\n\t\t\t\t\tvar el = evs[i].parentNode.parentNode.parentNode;\r\n\t\t\t\t\tweek = el.rowIndex;\r\n\t\t\t\t\tvar dy_copy = dy;\r\n\t\t\t\t\tdy = evs[i].parentNode.offsetHeight;\r\n\t\t\t\t\tzy = y_norm(evs[i].style.top);\r\n\t\t\t\t\tzy -= zy * 0.2;\r\n\t\t\t\t\tdy = dy_copy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;\r\n\t\t\t\t\tvar parent = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\t\t\t\tvar offset = parseFloat(parent.className.indexOf(\"dhx_scale_holder\") != -1 ? parent.style.left : 0);\r\n\t\t\t\t\tzx += x_norm(evs[i].parentNode.style.left, offset);\r\n\t\t\t\t}\r\n\r\n\t\t\t\txml += \"\\n
\";\r\n\r\n\t\t\t\tif (e_type == \"event\") {\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i].childNodes[2], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i].childNodes[2], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \" \";\r\n\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction toXML(start, end, view, mode, header, footer){\r\n\t\tvar colors = false;\r\n\t\tif (mode == \"fullcolor\") {\r\n\t\t\tcolors = true;\r\n\t\t\tmode = \"color\";\r\n\t\t}\r\n\r\n\t\tmode = mode || \"color\";\r\n\r\n\t\tvar xml = \"\";\r\n\t\tif (start) {\r\n\r\n\t\t\tvar original_date = scheduler._date;\r\n\t\t\tvar original_mode = scheduler._mode;\r\n\t\t\tend = scheduler.date[view+\"_start\"](end);\r\n\t\t\tend = scheduler.date[\"get_\"+view+\"_end\"] ? scheduler.date[\"get_\"+view+\"_end\"](end) : scheduler.date.add(end, 1, view);\r\n\r\n\t\t\txml = xml_top(\"pages\", mode, header, footer);\r\n\t\t\tfor (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) {\r\n\t\t\t\tthis.setCurrentView(temp_date, view);\r\n\t\t\t\txml += xml_start(\"page\") + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"page\");\r\n\t\t\t}\r\n\t\t\txml += xml_end(\"pages\");\r\n\r\n\t\t\tthis.setCurrentView(original_date, original_mode);\r\n\t\t} else {\r\n\t\t\txml = xml_top(\"data\", mode, header, footer) + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"data\");\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\tscheduler.getPDFData = toXML;\r\n\tfunction send_xml(xml, url){\r\n\t\tvar uid = scheduler.uid();\r\n\t\tvar d = document.createElement(\"div\");\r\n\t\td.style.display = \"none\";\r\n\t\tdocument.body.appendChild(d);\r\n\r\n\t\td.innerHTML = '
';\r\n\t\tdocument.getElementById(uid).firstChild.value = encodeURIComponent(xml);\r\n\t\tdocument.getElementById(uid).submit();\r\n\t\td.parentNode.removeChild(d);\r\n\t}\r\n\r\n\tfunction to_pdf(start, end, view, url, mode, header, footer) {\r\n\t\tvar xml = \"\";\r\n\t\tif(typeof mode == \"object\"){\r\n\t\t\txml = schedulersToPdf(mode);\r\n\t\t}else{\r\n\t\t\txml = toXML.apply(this, [start, end, view, mode, header, footer]);\r\n\t\t}\r\n\r\n\t\tsend_xml(xml, url);\r\n\t}\r\n\r\n\tfunction schedulersToPdf(objects){\r\n\t\tvar xml = \"
\";\r\n\t\tfor(var i=0; i < objects.length; i++){\r\n\t\t\txml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer);\r\n\t\t}\r\n\t\txml += \" \";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\t/*\r\n\t * scheduler.toPDF(url, mode, header, footer) - for a single scheduler\r\n\t * scheduler.toPDF(url, [scheduler1, scheduler2,...]) - for multiple schedulers\r\n\t * example:\r\n\t * scheduler.toPDF(\"generate.ashx\", [\r\n\t * { source: scheduler1, mode: \"color\" },\r\n\t * { source: scheduler2, mode: \"gray\", view:\"week\", start:new Date(2013, 06, 1), end:new Date(2013, 06, 28) },\r\n\t * { source: scheduler3 }\r\n\t * ]);\r\n\t *\r\n\t */\r\n\tscheduler.toPDF = function(url, mode, header, footer) {\r\n\t\treturn to_pdf.apply(this, [null, null, null, url, mode, header, footer]);\r\n\t};\r\n\tscheduler.toPDFRange = function(start, end, view, url, mode, header, footer) {\r\n\t\tif (typeof start == \"string\") {\r\n\t\t\tstart = scheduler.templates.api_date(start);\r\n\t\t\tend = scheduler.templates.api_date(end);\r\n\t\t}\r\n\r\n\t\treturn to_pdf.apply(this, arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.icons_select = [\"icon_form\", \"icon_delete\"];\r\nscheduler.config.details_on_create = true;\r\nscheduler.config.show_quick_info = true;\r\nscheduler.xy.menu_width = 0;\r\n\r\n\r\n\r\nlet clickedElementPosition = null;\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tconst container = scheduler.$container;\r\n\tif(container._$quickInfoHandler){\r\n\t\treturn;\r\n\t}else{\r\n\t\tcontainer._$quickInfoHandler = true;\r\n\t\t// store coordinates of clicked segment of an event\r\n\t\t// in case multi section events or multi-line month events\r\n\t\tscheduler.event(container, \"mousedown\", function(e){\r\n\t\t\tconst eventElement = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\t\t\tif (eventElement) {\r\n\t\t\t\tclickedElementPosition = {\r\n\t\t\t\t\tid: eventElement.getAttribute(scheduler.config.event_attribute),\r\n\t\t\t\t\tposition: getPositionInsideScheduler(eventElement)\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.attachEvent(\"onDestroy\", () => {\r\n\t\t\tdelete container._$quickInfoHandler;\r\n\t\t});\r\n\t}\r\n});\r\n\r\nscheduler.attachEvent(\"onClick\", function(id){\r\n\tif(!scheduler.config.show_quick_info){\r\n\t\treturn;\r\n\t}\r\n\tscheduler.showQuickInfo(id);\r\n\treturn true;\r\n});\r\n\r\n(function(){\r\n\t// pass `force` argument in order to hide quick info synchronously\r\n\t// so it won't affect showQuickInfo call that can follow\r\n\tvar events = [\"onEmptyClick\", \"onViewChange\", \"onLightbox\", \"onBeforeEventDelete\", \"onBeforeDrag\"];\r\n\tvar hiding_function = function(){\r\n\t\tscheduler.hideQuickInfo(true);\r\n\t\treturn true;\r\n\t};\r\n\tfor (var i=0; i
window.innerWidth){\r\n\t\t\tleft = window.innerWidth - width;\r\n\t\t}\r\n\t\tleft = Math.max(0, left);\r\n\r\n\t\tqi.style.left = left + \"px\";\r\n\t\tqi.style.top = pos.top - (pos.dy?height:-pos.height) + \"px\";\r\n\t} else {\r\n\r\n\t\tconst dataPos = scheduler.$container.querySelector('.dhx_cal_data').offsetTop;\r\n\t\tqi.style.top = dataPos + 20 + \"px\";\r\n\t\tif (pos.dx == 1){\r\n\t\t\tqi.style.right = \"auto\";\r\n\t\t\tqi.style.left = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.left = \"-10px\";\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\tqi.style.left = \"auto\";\r\n\t\t\tqi.style.right = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.right = \"-10px\";\r\n\t\t\t},1);\r\n\t\t}\r\n\t\tqi.className = qi.className.replace(\" dhx_qi_left\",\"\").replace(\" dhx_qi_right\",\"\")+\" dhx_qi_\"+(pos.dx==1?\"left\":\"right\");\r\n\t}\r\n\r\n\tqi.ontransitionend = () => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t\tqi.ontransitionend = null;\r\n\t};\r\n\tsetTimeout(() => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t}, 1);\r\n};\r\n\r\nfunction fitQIInsideWindow(quickInfoPopup){\r\n\tconst popupRect = quickInfoPopup.getBoundingClientRect();\r\n\tconst containerRect = scheduler.$container.getBoundingClientRect();\r\n\r\n\t// calculate the bottom offset of the Quick Info relative to the scheduler container\r\n\tconst offsetBottom = containerRect.bottom - popupRect.bottom;\r\n\r\n\t// If the popup extends outside the scheduler container, adjust its top position\r\n\tif (offsetBottom < 0) {\r\n\t\tquickInfoPopup.style.top = `${parseFloat(quickInfoPopup.style.top) + offsetBottom}px`;\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\tscheduler.hideQuickInfo();\r\n\tif(this._quick_info_box){\r\n\t\tvar box = this._quick_info_box;\r\n\t\tif(box.parentNode){\r\n\t\t\tbox.parentNode.removeChild(box);\r\n\t\t}\r\n\t\tthis._quick_info_box = null;\r\n\t}\r\n});\r\nscheduler._quick_info_onscroll_handler = function(e){\r\n\tscheduler.hideQuickInfo();\r\n};\r\nscheduler._init_quick_info = function(){\r\n\tif (!this._quick_info_box){\r\n\r\n\r\n\t\tvar qi = this._quick_info_box = document.createElement(\"div\");\r\n\r\n\t\tthis._waiAria.quickInfoAttr(qi);\r\n\r\n\t\tqi.className = \"dhx_cal_quick_info\";\r\n\t\tif (scheduler.$testmode)\r\n\t\t\tqi.className += \" dhx_no_animate\";\r\n\t\tif (scheduler.config.rtl) qi.className += \" dhx_quick_info_rtl\";\r\n\t//title\r\n\t\tvar ariaAttr = this._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t\r\n\t\t\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t//buttons\r\n\t\thtml += \"\";\r\n\t\tvar buttons = scheduler.config.icons_select;\r\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\t\tvar ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]);\r\n\t\t\t\thtml += `
\r\n\t\t\t\t
${scheduler.locale.labels[buttons[i]]}
`;\r\n\t\t\t}\r\n\t\t// }\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\t\tscheduler.event(qi, \"click\", function(ev){\r\n\t\t\tscheduler._qi_button_click(ev.target || ev.srcElement);\r\n\t\t});\r\n\t\tif (scheduler.config.quick_info_detached){\r\n\t\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this._quick_info_box;\r\n};\r\n\r\nscheduler._qi_button_click = function(node){\r\n\tvar box = scheduler._quick_info_box;\r\n\tif (!node || node == box) return;\r\n\r\n\tif(node.closest(\".dhx_cal_qi_close_btn\")){\r\n\t\tscheduler.hideQuickInfo();\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar mask = scheduler._getClassName(node);\r\n\tif (mask.indexOf(\"_icon\")!=-1){\r\n\t\tvar id = scheduler._quick_info_box_id;\r\n\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t} else\r\n\t\tscheduler._qi_button_click(node.parentNode);\r\n};\r\n\r\nfunction getPositionInsideScheduler(element){\r\n\tlet left = 0;\r\n\tlet top = 0;\r\n\r\n\tlet node = element;\r\n\twhile (node && node != scheduler._obj){\r\n\t\tleft += node.offsetLeft;\r\n\t\ttop += node.offsetTop-node.scrollTop;\r\n\t\tnode = node.offsetParent;\r\n\t}\r\n\tif(node){\r\n\t\tlet dx = (left + element.offsetWidth/2) > (scheduler._x/2) ? 1 : 0;\r\n\t\tlet dy = (top + element.offsetHeight/2) > (scheduler._y/2) ? 1 : 0;\r\n\r\n\t\treturn { left:left, top:top, dx:dx, dy:dy,\r\n\t\t\twidth:element.offsetWidth, height:element.offsetHeight };\r\n\t}\r\n\treturn 0;\r\n}\r\n\r\nscheduler._get_event_counter_part = function(id){\r\n\tvar domEv = scheduler.getRenderedEvent(id);\r\n\treturn getPositionInsideScheduler(domEv);\r\n};\r\n\r\nscheduler._fill_quick_data = function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tvar qi = scheduler._quick_info_box;\r\n\r\n\tscheduler._quick_info_box_id = id;\r\n\r\n//title content\r\n\r\n\tvar header = {\r\n\t\tcontent: scheduler.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\tdate: scheduler.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t};\r\n\tvar titleContent = qi.querySelector(\".dhx_cal_qi_tcontent\");\r\n\ttitleContent.innerHTML = `${header.content} `;\r\n\tvar titleDate = qi.querySelector(\".dhx_cal_qi_tdate\");\r\n\ttitleDate.innerHTML = header.date;\r\n\r\n\tscheduler._waiAria.quickInfoHeader(qi, [header.content, header.date].join(\" \"));\r\n\r\n//main content\r\n\tvar main = qi.querySelector(\".dhx_cal_qi_content\");\r\n\tconst mainContent = scheduler.templates.quick_info_content(ev.start_date, ev.end_date, ev);\r\n\tif(mainContent){\r\n\t\tmain.classList.remove(\"dhx_hidden\");\r\n\t\tmain.innerHTML = mainContent;\r\n\t}else{\r\n\t\tmain.classList.add(\"dhx_hidden\");\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\t\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar originalRecurringSetValue;\r\n\tif (scheduler.form_blocks.recurring) {\r\n\t\toriginalRecurringSetValue = scheduler.form_blocks.recurring.set_value;\r\n\t}\r\n\tvar original_left_buttons = scheduler.config.buttons_left.slice();\r\n\tvar original_right_buttons = scheduler.config.buttons_right.slice();\r\n\r\n\tscheduler.attachEvent(\"onBeforeLightbox\", function(id) {\r\n\t\tif (this.config.readonly_form || this.getEvent(id).readonly) {\r\n\t\t\tthis.config.readonly_active = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.config.readonly_active = false;\r\n\t\t\tscheduler.config.buttons_left = original_left_buttons.slice();\r\n\t\t\tscheduler.config.buttons_right = original_right_buttons.slice();\r\n\t\r\n\t\t\t// initial value\r\n\t\t\tif(scheduler.form_blocks.recurring) {\r\n\t\t\t\tscheduler.form_blocks.recurring.set_value = originalRecurringSetValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar sns = this.config.lightbox.sections;\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\t\tif (sns[i].type == 'recurring') {\r\n\t\t\t\t\tif (this.config.readonly_active && scheduler.form_blocks.recurring) {\r\n\t\t\t\t\t\tscheduler.form_blocks.recurring.set_value = function(node, value, ev) {\r\n\t\t\t\t\t\t\tvar wrapper = scheduler.$domHelpers.closest(node, \".dhx_wrap_section\");\r\n\t\t\t\t\t\t\tvar style = \"none\";\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_cal_lsection').display = style;\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_form_repeat').display = style;\r\n\t\t\t\t\t\t\twrapper.style.display = style;\r\n\r\n\t\t\t\t\t\t\tscheduler.setLightboxSize();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar forbidden_buttons = [\"dhx_delete_btn\", \"dhx_save_btn\"];\r\n\t\t\tvar button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];\r\n\t\t\tfor (var i = 0; i < forbidden_buttons.length; i++) {\r\n\t\t\t\tvar forbidden_button = forbidden_buttons[i];\r\n\t\t\t\tfor (var k = 0; k < button_arrays.length; k++) {\r\n\t\t\t\t\tvar button_array = button_arrays[k];\r\n\t\t\t\t\tvar index = -1;\r\n\t\t\t\t\tfor (var p = 0; p < button_array.length; p++) {\r\n\t\t\t\t\t\tif (button_array[p] == forbidden_button) {\r\n\t\t\t\t\t\t\tindex = p;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tbutton_array.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.resetLightbox();\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction txt_replace(tag, d, n, text) {\r\n\t\tvar txts = d.getElementsByTagName(tag);\r\n\t\tvar txtt = n.getElementsByTagName(tag);\r\n\t\tfor (var i = txtt.length - 1; i >= 0; i--) {\r\n\t\t\tvar n = txtt[i];\r\n\t\t\tif (!text){\r\n\t\t\t\tn.disabled = true;\r\n\t\t\t\t//radio and checkboxes loses state after .cloneNode in IE\r\n\t\t\t\tif(d.checked)\r\n\t\t\t\t\tn.checked = true;\r\n\t\t\t}else {\r\n\t\t\t\tvar t = document.createElement(\"span\");\r\n\t\t\t\tt.className = \"dhx_text_disabled\";\r\n\t\t\t\tt.innerHTML = text(txts[i]);\r\n\t\t\t\tn.parentNode.insertBefore(t, n);\r\n\t\t\t\tn.parentNode.removeChild(n);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar old = scheduler._fill_lightbox;\r\n\tscheduler._fill_lightbox = function() {\r\n\r\n\t\tvar lb = this.getLightbox();\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tlb.style.visibility = 'hidden';\r\n\t\t\t// lightbox should have actual sizes before rendering controls\r\n\t\t\t// currently only matters for dhtmlxCombo\r\n\t\t\tlb.style.display = 'block';\r\n\t\t}\r\n\t\tvar res = old.apply(this, arguments);\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\t//reset visibility and display\r\n\t\t\tlb.style.visibility = '';\r\n\t\t\tlb.style.display = 'none';\r\n\t\t}\r\n\r\n\t\tif (this.config.readonly_active) {\r\n\r\n\t\t\tvar originalForm = this.getLightbox();\r\n\t\t\tvar readonlyForm = this._lightbox_r = originalForm.cloneNode(true);\r\n\t\t\treadonlyForm.id = scheduler.uid();\r\n\t\t\treadonlyForm.className += \" dhx_cal_light_readonly\";\r\n\t\t\ttxt_replace(\"textarea\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\treturn a.value;\r\n\t\t\t});\r\n\t\t\ttxt_replace(\"input\", originalForm, readonlyForm, false);\r\n\t\t\ttxt_replace(\"select\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\tif(!a.options.length) return \"\";\r\n\t\t\t\treturn a.options[Math.max((a.selectedIndex || 0), 0)].text;\r\n\t\t\t});\r\n\r\n\t\t\toriginalForm.parentNode.insertBefore(readonlyForm, originalForm);\r\n\r\n\t\t\tthis.showCover(readonlyForm);\r\n\t\t\tif (scheduler._lightbox)\r\n\t\t\t\tscheduler._lightbox.parentNode.removeChild(scheduler._lightbox);\r\n\t\t\tthis._lightbox = readonlyForm;\r\n\r\n\t\t\tif (scheduler.config.drag_lightbox)\r\n\t\t\t\tscheduler.event(readonlyForm.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\t\t\r\n\t\t\tscheduler._init_lightbox_events();\r\n\t\t\tthis.setLightboxSize();\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar hold = scheduler.hide_lightbox;\r\n\tscheduler.hide_lightbox = function() {\r\n\t\tif (this._lightbox_r) {\r\n\t\t\tthis._lightbox_r.parentNode.removeChild(this._lightbox_r);\r\n\t\t\tthis._lightbox_r = this._lightbox = null;\r\n\t\t}\r\n\r\n\t\treturn hold.apply(this, arguments);\r\n\t};\r\n});\r\n\r\n\r\n}","import { RRule, rrulestr } from 'rrule';\r\n\r\nexport default function (scheduler) {\r\n\r\n\tfunction clearMilliseconds(date) {\r\n\t\treturn new Date(\r\n\t\t\tdate.getFullYear(),\r\n\t\t\tdate.getMonth(),\r\n\t\t\tdate.getDate(),\r\n\t\t\tdate.getHours(),\r\n\t\t\tdate.getMinutes(),\r\n\t\t\tdate.getSeconds(),\r\n\t\t\t0\r\n\t\t);\r\n\t}\r\n\r\n\tfunction isDeletedOccurrence(event) {\r\n\t\treturn !!event.deleted;\r\n\t}\r\n\r\n\tfunction isSeries(event) {\r\n\t\treturn !!event.rrule && !event.recurring_event_id;\r\n\t}\r\n\r\n\tfunction clearRecurringProperties(event) {\r\n\t\tevent.rrule = \"\";\r\n\t\tevent.original_start = null;\r\n\t\tevent.recurring_event_id = null;\r\n\t\tevent.duration = null;\r\n\t\tevent.deleted = null;\r\n\t}\r\n\r\n\tfunction createException(ev) {\r\n\t\tlet id = ev.id.split(\"#\");\r\n\r\n\t\tlet nid = scheduler.uid();\r\n\t\tscheduler._not_render = true;\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = id[0];\r\n\r\n\t\tlet timestamp = id[1];\r\n\r\n\t\tnev.original_start = new Date(Number(timestamp));\r\n\r\n\t\tscheduler._add_rec_marker(nev, timestamp);\r\n\t\tscheduler.addEvent(nev);\r\n\t\tscheduler._not_render = false;\r\n\t}\r\n\r\n\tscheduler._rec_temp = [];\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_markers = {};\r\n\tscheduler._add_rec_marker = function (ev, time) {\r\n\t\tev._pid_time = time;\r\n\t\tthis._rec_markers[ev.id] = ev;\r\n\t\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\t\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n\t};\r\n\tscheduler._get_rec_marker = function (time, id) {\r\n\t\tlet ch = this._rec_markers_pull[id];\r\n\t\tif (ch) return ch[time];\r\n\t\treturn null;\r\n\t};\r\n\tscheduler._get_rec_markers = function (id) {\r\n\t\treturn (this._rec_markers_pull[id] || []);\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old_add_event = scheduler.addEvent;\r\n\t\tscheduler.addEvent = function (start_date, end_date, text, id, extra_data) {\r\n\t\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\r\n\t\t\t\tif (ev.start_date) {\r\n\t\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t\t}\r\n\t\t\t\tif (ev.end_date) {\r\n\t\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn ev_id;\r\n\t\t};\r\n\t})();\r\n\r\n\tscheduler.attachEvent(\"onEventLoading\", function (event) {\r\n\r\n\t\tif (event.original_start) {\r\n\t\t\tevent.original_start = scheduler.templates.parse_date(event.original_start);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventIdChange\", function (id, new_id) {\r\n\t\tif (this._ignore_call) return;\r\n\t\tthis._ignore_call = true;\r\n\r\n\t\tif (scheduler._rec_markers[id]) {\r\n\t\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\t\tdelete scheduler._rec_markers[id];\r\n\t\t}\r\n\r\n\t\tif (scheduler._rec_markers_pull[id]) {\r\n\t\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\t\tdelete scheduler._rec_markers_pull[id];\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\t\tvar tev = this._rec_temp[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i in this._rec_markers) {\r\n\t\t\tvar tev = this._rec_markers[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\ttev._pid_changed = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar el = scheduler._rec_markers[new_id];\r\n\t\tif (el && el._pid_changed) {\r\n\t\t\tdelete el._pid_changed;\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tif (scheduler.$destroyed) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t\t}, 1);\r\n\t\t}\r\n\r\n\t\tdelete this._ignore_call;\r\n\t});\r\n\r\n\tfunction deleteEventFromSeries(idTimestamp, ev) {\r\n\t\tlet id = idTimestamp;\r\n\t\tidTimestamp = id.split(\"#\");\r\n\t\tlet nid = scheduler.uid();\r\n\t\tlet tid = (idTimestamp[1]) ? idTimestamp[1] : (ev._pid_time);\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = ev.recurring_event_id || idTimestamp[0];\r\n\t\tnev.original_start = new Date(Number(tid));\r\n\t\tnev.deleted = true;\r\n\t\tscheduler.addEvent(nev);\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && !isDeletedOccurrence(ev))) {\r\n\t\t\tdeleteEventFromSeries(id, ev);\r\n\t\t} else {\r\n\t\t\tif (isSeries(ev) && this._lightbox_id)\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tid = sub[i].id;\r\n\t\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tif (!this._is_virtual_event(id) && this._is_modified_occurence(ev)) {\r\n\t\t\tif (!scheduler._events[id]) {\r\n\t\t\t\tev.deleted = true;\r\n\t\t\t\tthis.setEvent(id, ev);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function (id, event) {\r\n\t\tif (this._loading) return true;\r\n\r\n\t\tvar ev = this.getEvent(id);\r\n\r\n\t\tif (this._is_virtual_event(id)) {\r\n\t\t\tcreateException(ev);\r\n\r\n\t\t} else {\r\n\t\t\tif (ev.start_date) {\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date) {\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(ev) && this._lightbox_id) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t\t//scheduler.recurrings.rollbackDates(ev);\r\n\t\t\t}\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\t\tvar isEventFound = false;\r\n\t\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\t\tisEventFound = true;\r\n\t\t\t}\r\n\t\t\tif (!isEventFound)\r\n\t\t\t\tthis._select_id = null;\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\", function (id) {\r\n\t\tif (!this._loading) {\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif (isSeries(ev)) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function (id, data, is_new_event) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev))\r\n\t\t\tthis._select_id = null;\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\tclearRecurringProperties(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCancel\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev)) {\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\t\tthis.render_view_data();\r\n\t\t}\r\n\t});\r\n\tscheduler._roll_back_dates = function (ev) {\r\n\t\t//// !!!!! calc temp properties\r\n\t\tif (ev.start_date) {\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif (ev.end_date) {\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tev.duration = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\t\tev.end_date = ev._end_date;\r\n\t\tif (ev._start_date) {\r\n\t\t\tev.start_date.setMonth(0);\r\n\t\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._is_virtual_event = function (id) {\r\n\t\treturn id.toString().indexOf(\"#\") != -1;\r\n\t};\r\n\tscheduler._is_modified_occurence = function (ev) {\r\n\t\treturn (ev.recurring_event_id && ev.recurring_event_id != \"0\");\r\n\t};\r\n\r\n\tscheduler.showLightbox_rec = scheduler.showLightbox;\r\n\tscheduler.showLightbox = function (id) {\r\n\t\tvar locale = this.locale;\r\n\t\tvar c = scheduler.config.lightbox_recurring;\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tvar pid = ev.recurring_event_id;\r\n\t\tvar isVirtual = this._is_virtual_event(id);\r\n\t\tif (isVirtual)\r\n\t\t\tpid = id.split(\"#\")[0];\r\n\r\n\t\t// show series\r\n\t\tvar showSeries = function (id) {\r\n\t\t\tvar event = scheduler.getEvent(id);\r\n\t\t\tevent._end_date = event.end_date;\r\n\t\t\tevent.end_date = new Date(event.start_date.valueOf() + event.duration * 1000);\r\n\t\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t\t};\r\n\r\n\t\tif ((pid || pid * 1 === 0) && isSeries(ev)) {\r\n\t\t\t// direct API call on series id\r\n\t\t\treturn showSeries(id);\r\n\t\t}\r\n\t\tif (!pid || pid === '0' || ((!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual))) {\r\n\t\t\t// editing instance or non recurring event\r\n\t\t\treturn this.showLightbox_rec(id);\r\n\t\t}\r\n\t\tif (c == 'ask') {\r\n\t\t\tvar that = this;\r\n\t\t\tscheduler.modalbox({\r\n\t\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\t\twidth: \"500px\",\r\n\t\t\t\tposition: \"middle\",\r\n\t\t\t\tbuttons: [locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\t\tcallback: function (index) {\r\n\t\t\t\t\tswitch (+index) {\r\n\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tshowSeries(pid);\r\n\t\t}\r\n\t};\r\n\r\n\tfunction groupExceptions() {\r\n\t\tconst exceptions = {};\r\n\t\tfor (const i in scheduler._events) {\r\n\t\t\tconst ev = scheduler._events[i];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tif (!exceptions[ev.recurring_event_id]) {\r\n\t\t\t\t\texceptions[ev.recurring_event_id] = {};\r\n\t\t\t\t}\r\n\t\t\t\texceptions[ev.recurring_event_id][ev.original_start.valueOf()] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn exceptions;\r\n\t}\r\n\r\n\tscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function (only_timed) {\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\t\tdelete this._events[this._rec_temp[i].id];\r\n\t\tthis._rec_temp = [];\r\n\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tvar stack = this.get_visible_events_rec(only_timed);\r\n\t\tvar out = [];\r\n\t\tfor (var i = 0; i < stack.length; i++) {\r\n\t\t\tif (stack[i].deleted || stack[i].recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(stack[i])) {\r\n\t\t\t\tthis.repeat_date(stack[i], out, undefined, undefined, undefined, undefined, exceptions);\r\n\t\t\t} else {\r\n\t\t\t\tout.push(stack[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn out;\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old = scheduler.isOneDayEvent;\r\n\t\tscheduler.isOneDayEvent = function (ev) {\r\n\t\t\tif (isSeries(ev)) return true;\r\n\t\t\treturn old.call(this, ev);\r\n\t\t};\r\n\t\tvar old_update_event = scheduler.updateEvent;\r\n\t\tscheduler.updateEvent = function (id) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\r\n\t\t\tif (ev && isSeries(ev) && !this._is_virtual_event(id)) {\r\n\t\t\t\tscheduler.update_view();\r\n\t\t\t} else {\r\n\t\t\t\told_update_event.call(this, id);\r\n\t\t\t}\r\n\t\t};\r\n\t})();\r\n\r\n\tconst toIcalString = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\r\n\tscheduler.repeat_date = function (ev, stack, non_render, from, to, maxCount, exceptions) {\r\n\t\tif (!ev.rrule) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet seriesExceptions = exceptions ? exceptions[ev.id] : groupExceptions()[ev.id];\r\n\t\tif (!seriesExceptions) {\r\n\t\t\tseriesExceptions = {};\r\n\t\t}\r\n\r\n\t\tif (!from) {\r\n\t\t\tfrom = scheduler._min_date;\r\n\t\t}\r\n\t\tif (!to) {\r\n\t\t\tto = scheduler._max_date;\r\n\t\t}\r\n\r\n\t\tconst utcStart = new Date(Date.UTC(ev.start_date.getFullYear(), ev.start_date.getMonth(), ev.start_date.getDate(), ev.start_date.getHours(), ev.start_date.getMinutes(), ev.start_date.getSeconds()));\r\n\t\tlet parsedRRule;\r\n\t\tif (maxCount){\r\n\t\t\t// for getRecDates() method\r\n\t\t\tparsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)};COUNT=${maxCount}`, { dtstart: utcStart });\r\n\t\t} else {\r\n\t\t\tparsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)}`, { dtstart: utcStart/*ev.start_date*/ });\r\n\t\t}\r\n\t\t// `from` is already in UTC from `dtstart: utcStart`\r\n\t\tconst utcTo = new Date(Date.UTC(to.getFullYear(), to.getMonth(), to.getDate(), to.getHours(), to.getMinutes(), to.getSeconds())); \r\n\t\tconst repeatedDates = parsedRRule.between(from, utcTo).map(date => {\r\n\t\t\tconst adjustedDate = new Date(date);\r\n\t\t\tadjustedDate.setHours(ev.start_date.getHours());\r\n\t\t\tadjustedDate.setMinutes(ev.start_date.getMinutes());\r\n\t\t\tadjustedDate.setSeconds(ev.start_date.getSeconds());\r\n\t\t\treturn adjustedDate;\r\n\t\t});\r\n\t\tlet visibleCount = 0;\r\n\r\n\t\tconst eventDuration = ev.duration;\r\n\r\n\t\tfor (let i = 0; i < repeatedDates.length; i++) {\r\n\t\t\tif (maxCount && visibleCount >= maxCount) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tconst date = repeatedDates[i];\r\n\r\n\t\t\tlet exception = seriesExceptions[date.valueOf()];\r\n\t\t\tif (exception) {\r\n\t\t\t\tif (exception.deleted) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvisibleCount++;\r\n\t\t\t\t\tstack.push(exception);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconst copy = scheduler._copy_event(ev);\r\n\t\t\t\t//copy._timed = ev._timed;\r\n\t\t\t\tcopy.text = ev.text;\r\n\t\t\t\tcopy.start_date = date;\r\n\t\t\t\tcopy.id = ev.id + \"#\" + Math.ceil(date.valueOf());\r\n\t\t\t\tcopy.end_date = new Date(date.valueOf() + eventDuration * 1000);\r\n\t\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, date, copy.end_date);\r\n\t\t\t\tcopy._timed = scheduler.isOneDayEvent(copy);\r\n\r\n\r\n\r\n\t\t\t\tif (!copy._timed && !scheduler._table_view && !scheduler.config.multi_day) continue;\r\n\t\t\t\tstack.push(copy);\r\n\r\n\t\t\t\tif (!non_render) {\r\n\t\t\t\t\tscheduler._events[copy.id] = copy;\r\n\t\t\t\t\tscheduler._rec_temp.push(copy);\r\n\t\t\t\t}\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//GS-2534: case when exceptions have different dates\r\n\t\tif (seriesExceptions && repeatedDates.length == 0 ){\r\n\t\t\tfor (let a in seriesExceptions){\r\n\t\t\t\tlet exception = seriesExceptions[a];\r\n\t\t\t\tif (exception) {\r\n\t\t\t\t\tif(exception.deleted){\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\telse if (from && to && exception.start_date < to && exception.end_date > from) {\r\n\t\t\t\t\t\tstack.push(exception);\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._fix_daylight_saving_date = function (start_date, end_date, ev, counter, default_date) {\r\n\t\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\t\tif (shift) {\r\n\t\t\tif (shift > 0) {\r\n\t\t\t\t// e.g. 24h -> 23h\r\n\t\t\t\treturn new Date(counter.valueOf() + ev.duration * 1000 - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// e.g. 24h -> 25h\r\n\t\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Date(default_date.valueOf());\r\n\t};\r\n\tscheduler.getRecDates = function (id, max) {\r\n\t\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\t\tvar recurrings = [];\r\n\t\tmax = max || 100;\r\n\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\treturn [\r\n\t\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t\t];\r\n\t\t}\r\n\t\tif (ev.deleted) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\t\tvar result = [];\r\n\t\tfor (var i = 0; i < recurrings.length; i++) {\r\n\t\t\tif (!recurrings[i].deleted) {\r\n\t\t\t\tresult.push({ start_date: recurrings[i].start_date, end_date: recurrings[i].end_date });\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n\tscheduler.getEvents = function (from, to) {\r\n\t\tvar result = [];\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tfor (var a in this._events) {\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (from && to && ev.start_date < to && ev.end_date > from) {\r\n\t\t\t\tif (isSeries(ev)) {\r\n\t\t\t\t\tvar sev = [];\r\n\t\t\t\t\tthis.repeat_date(ev, sev, true, from, to, undefined, exceptions);\r\n\t\t\t\t\tsev.forEach(function(occurence){\r\n\t\t\t\t\t\tif (occurence.start_date < to && occurence.end_date > from) {\r\n\t\t\t\t\t\t\tresult.push(occurence);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t// if it's virtual event we can skip it\r\n\t\t\t\t} else if (!this._is_virtual_event(ev.id)) {\r\n\t\t\t\t\tresult.push(ev);\r\n\t\t\t\t}\r\n\t\t\t} else if (!from && !to && !this._is_virtual_event(ev.id)) {\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t};\r\n\r\n\t//drop secondary attributes\r\n\tscheduler._copy_dummy = function (ev) {\r\n\t\tvar start_date = new Date(this.start_date);\r\n\t\tvar end_date = new Date(this.end_date);\r\n\t\tthis.start_date = start_date;\r\n\t\tthis.end_date = end_date;\r\n\t\tthis.duration = this.rrule = null;\r\n\t};\r\n\r\n\tscheduler.config.include_end_by = false;\r\n\tscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\tscheduler.config.recurring_workdays = [RRule.MO.weekday,RRule.TU.weekday,RRule.WE.weekday,RRule.TH.weekday,RRule.FR.weekday];\r\n\tscheduler.config.repeat_date = \"%m.%d.%Y\";\r\n\tscheduler.config.lightbox.sections = [\r\n\t\t{ name: \"description\", map_to: \"text\", type: \"textarea\", focus: true },\r\n\t\t{ name: \"recurring\", type: \"recurring\", map_to: \"rec_type\" },\r\n\t\t{ name: \"time\", height: 72, type: \"time\", map_to: \"auto\" }\r\n\t];\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function () {\r\n\t\tscheduler._rec_markers = {}; //clear recurring events data\r\n\t\tscheduler._rec_markers_pull = {};\r\n\t\tscheduler._rec_temp = [];\r\n\t});\r\n\r\n\r\n\tfunction getTopLevelOption(rruleObj, untilDate) {\r\n\t\tconst options = rruleObj.options;\r\n\t\tconst until = options.until || untilDate;\r\n\r\n\t\tconst hasEndCondition = options.count || (until && until.getFullYear() !== 9999);\r\n\r\n\t\tif (hasEndCondition) {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\r\n\t\tif (options.freq === RRule.DAILY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'DAILY';\r\n\t\t} else if (options.freq === RRule.WEEKLY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'WEEKLY';\r\n\t\t} else if (options.freq === RRule.MONTHLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'MONTHLY';\r\n\t\t} else if (options.freq === RRule.YEARLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'YEARLY';\r\n\t\t} else if (options.freq === RRule.DAILY && options.byweekday && options.byweekday.length === scheduler.config.recurring_workdays.length &&\r\n\t\t\toptions.byweekday.includes(RRule.MO) &&\r\n\t\t\toptions.byweekday.includes(RRule.TU) &&\r\n\t\t\toptions.byweekday.includes(RRule.WE) &&\r\n\t\t\toptions.byweekday.includes(RRule.TH) &&\r\n\t\t\toptions.byweekday.includes(RRule.FR)) {\r\n\t\t\treturn 'WORKDAYS';\r\n\t\t} else {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction getWeekdayOfMonth(date) {\r\n\t\tconst dayOfWeek = date.getDay();\r\n\t\tconst dayOfMonth = date.getDate();\r\n\t\tconst dayNumber = Math.ceil(dayOfMonth / 7);\r\n\t\treturn { dayOfWeek, dayNumber };\r\n\t}\r\n\r\n\r\n\tconst jsDaysToRRULEDays = {\r\n\t\t0: \"SU\",\r\n\t\t1: \"MO\",\r\n\t\t2: \"TU\",\r\n\t\t3: \"WE\",\r\n\t\t4: \"TH\",\r\n\t\t5: \"FR\",\r\n\t\t6: \"SA\"\r\n\t};\r\n\tconst RruleDayNumsToJs = {\r\n\t\t0: 1,\r\n\t\t1: 2,\r\n\t\t2: 3,\r\n\t\t3: 4,\r\n\t\t4: 5,\r\n\t\t5: 6,\r\n\t\t6: 0\r\n\t};\r\n\r\n\tfunction fillCustomDaily(node, rule) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\t}\r\n\r\n\tfunction fillCustomWeekly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dayCheckboxes = node.querySelectorAll(`.dhx_form_repeat_custom_week input`);\r\n\t\tdayCheckboxes.forEach((ch) => ch.checked = false);\r\n\t\tif (rule && rule.byweekday) {\r\n\t\t\trule.byweekday.forEach((day) => {\r\n\t\t\t\tconst dayNum = RruleDayNumsToJs[day.weekday];\r\n\t\t\t\tconst dayLabel = jsDaysToRRULEDays[dayNum];\r\n\t\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconst dayLabel = jsDaysToRRULEDays[event.start_date.getDay()];\r\n\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction fillCustomMonthly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dateOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfMonth.innerText = scheduler.templates.repeat_monthly_date(event.start_date, event);\r\n\t\tnthWeekDayOfMonth.innerText = scheduler.templates.repeat_monthly_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction formatDayNumber(date){\r\n\t\tswitch (date) {\r\n\t\t\tcase 1:\r\n\t\t\tcase 31:\r\n\t\t\t\treturn `${date}st`;\r\n\t\t\tcase 2:\r\n\t\t\t\treturn `${date}nd`;\r\n\t\t\tcase 3:\r\n\t\t\t\treturn `${date}rd`;\r\n\t\t\tdefault:\r\n\t\t\t\treturn `${date}th`;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.templates.repeat_monthly_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\treturn `Every ${formatDayNumber(date)}`;\r\n\t};\r\n\tscheduler.templates.repeat_monthly_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]}`;\r\n\t};\r\n\t\r\n\tscheduler.templates.repeat_yearly_month_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(date)} day of ${monthLabel}`;\r\n\t};\r\n\tscheduler.templates.repeat_yearly_month_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]} of ${monthLabel}`;\r\n\t};\r\n\r\n\tfunction fillCustomYearly(node, rule, event) {\r\n\t\tconst dateOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfYear.innerText = scheduler.templates.repeat_yearly_month_date(event.start_date, event);\r\n\t\tnthWeekDayOfYear.innerText = scheduler.templates.repeat_yearly_month_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fillEndRule(node, rule, event) {\r\n\t\tconst countInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_after\"]`);\r\n\t\tconst ondateInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_ondate\"]`);\r\n\t\tconst endOptionSelect = node.querySelector(`[name='dhx_custom_repeat_ends']`);\r\n\t\tcountInput.value = 1;\r\n\r\n\t\tlet formatter = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tondateInput.value = scheduler.config.repeat_date_of_end;\r\n\r\n\t\tif (rule && rule.count) {\r\n\t\t\tendOptionSelect.value = \"AFTER\";\r\n\t\t\tcountInput.value = rule.count;\r\n\t\t} else if (event._end_date && event._end_date.getFullYear() !== 9999) {\r\n\t\t\tendOptionSelect.value = \"ON\";\r\n\t\t\tondateInput.value = formatter(event._end_date);\r\n\t\t} else {\r\n\t\t\tendOptionSelect.value = \"NEVER\";\r\n\t\t}\r\n\t\tendOptionSelect.dispatchEvent(new Event(\"change\"));\r\n\t}\r\n\r\n\tconst getRecValue = {\r\n\t\tMONTHLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.MONTHLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWEEKLY: function (dates) {\r\n\t\t\tlet day = dates.start.getDay() - 1;\r\n\t\t\tif (day == -1) day = 6;\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: [day]\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tDAILY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.DAILY,\r\n\t\t\t\tinterval: 1\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tYEARLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.YEARLY,\r\n\t\t\t\tbymonth: dates.start.getMonth() + 1,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWORKDAYS: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: scheduler.config.recurring_workdays\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tCUSTOM: function (dates, node) {\r\n\t\t\tconst rrule = {};\r\n\t\t\tconst freq = node.querySelector(`[name=\"repeat_interval_unit\"]`).value;\r\n\t\t\tconst interval = Math.max(1, node.querySelector(`[name=\"repeat_interval_value\"]`).value);\r\n\t\t\tconst monthRepeat = node.querySelector(`[name=\"dhx_custom_month_option\"]`).value;\r\n\t\t\tconst yearRepeat = node.querySelector(`[name=\"dhx_custom_year_option\"]`).value;\r\n\r\n\t\t\trrule.interval = interval;\r\n\t\t\tlet days;\r\n\t\t\tlet day;\r\n\r\n\t\t\tswitch (freq) {\r\n\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\trrule.freq = RRule.DAILY;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"WEEKLY\": \r\n\t\t\t\t\trrule.freq = RRule.WEEKLY;\r\n\t\t\t\t\tdays = [];\r\n\t\t\t\t\tnode.querySelectorAll(`.dhx_form_repeat_custom_week [name=\"week_day\"]`).forEach((ch) => {\r\n\t\t\t\t\t\tif(ch.checked){\r\n\t\t\t\t\t\t\tdays.push(ch.value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\trrule.byweekday = days.map((day) => {\r\n\t\t\t\t\t\tswitch (day) {\r\n\t\t\t\t\t\t\tcase \"MO\":\r\n\t\t\t\t\t\t\t\treturn RRule.MO.weekday;\r\n\t\t\t\t\t\t\tcase \"TU\":\r\n\t\t\t\t\t\t\t\treturn RRule.TU.weekday;\r\n\t\t\t\t\t\t\tcase \"WE\":\r\n\t\t\t\t\t\t\t\treturn RRule.WE.weekday;\r\n\t\t\t\t\t\t\tcase \"TH\":\r\n\t\t\t\t\t\t\t\treturn RRule.TH.weekday;\r\n\t\t\t\t\t\t\tcase \"FR\":\r\n\t\t\t\t\t\t\t\treturn RRule.FR.weekday;\r\n\t\t\t\t\t\t\tcase \"SA\":\r\n\t\t\t\t\t\t\t\treturn RRule.SA.weekday;\r\n\t\t\t\t\t\t\tcase \"SU\":\r\n\t\t\t\t\t\t\t\treturn RRule.SU.weekday;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\trrule.freq = RRule.MONTHLY;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (monthRepeat === \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\trrule.freq = RRule.YEARLY;\r\n\t\t\t\t\trrule.bymonth = dates.start.getMonth() + 1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (yearRepeat == \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tconst formatFunc = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\t\t\tlet until = new Date(9999, 1, 1);\r\n\t\t\tconst endRule = node.querySelector(`[name=\"dhx_custom_repeat_ends\"]`);\r\n\t\t\tif(endRule.value === \"ON\"){\r\n\t\t\t\tuntil = formatFunc(node.querySelector(`[name=\"dhx_form_repeat_ends_ondate\"]`).value);\r\n\t\t\t} else if(endRule.value === \"AFTER\") {\r\n\t\t\t\trrule.count = Math.max(1, node.querySelector(`[name=\"dhx_form_repeat_ends_after\"]`).value);\r\n\t\t\t}\r\n\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tNEVER: function () {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction fillInDefaults(node, rule, event) {\r\n\t\tfillCustomDaily(node, rule, event);\r\n\t\tfillCustomWeekly(node, rule, event);\r\n\t\tfillCustomMonthly(node, rule, event);\r\n\t\tfillCustomYearly(node, rule, event);\r\n\t\tfillEndRule(node, rule, event);\r\n\t}\r\n\tscheduler.form_blocks[\"recurring\"] = {\r\n\t\trender: function (sns) {\r\n\t\t\tif (sns.form) {\r\n\t\t\t\tlet rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\t\tlet form = rec._get_node(sns.form);\r\n\t\t\t\tlet html = rec._outer_html(form);\r\n\t\t\t\tform.style.display = 'none';\r\n\t\t\t\treturn html;\r\n\t\t\t}\r\n\t\t\tlet loc = scheduler.locale.labels;\r\n\r\n\t\t\treturn ``;\r\n\t\t},\r\n\r\n\t\r\n\t\t_init_set_value: function (node, value, event) {\r\n\t\t\tscheduler.form_blocks[\"recurring\"]._ds = { start: event.start_date, end: event.end_date };\r\n\t\t\tfunction hide(node) {\r\n\t\t\t\tnode.classList.add(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction show(node) {\r\n\t\t\t\tnode.classList.remove(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction onRepeatOptionChange(value) {\r\n\t\t\t\tconst repeat = node.querySelector(\".dhx_form_repeat_custom\");\r\n\t\t\t\tif (value === \"CUSTOM\") {\r\n\t\t\t\t\tshow(repeat);\r\n\t\t\t\t} else {\r\n\t\t\t\t\thide(repeat);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatIntervalChange(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tweekly: node.querySelector(\".dhx_form_repeat_custom_week\"),\r\n\t\t\t\t\tmonthly: node.querySelector(\".dhx_form_repeat_custom_month\"),\r\n\t\t\t\t\tyearly: node.querySelector(\".dhx_form_repeat_custom_year\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"WEEKLY\":\r\n\t\t\t\t\t\tshow(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\tshow(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\tshow(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatEndRule(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tafter: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after\"),\r\n\t\t\t\t\ton: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"NEVER\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"AFTER\":\r\n\t\t\t\t\t\tshow(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"ON\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\tshow(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// repeat section change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").addEventListener(\"change\", function () {\r\n\t\t\t\tonRepeatOptionChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat interval change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_custom_interval [name='repeat_interval_unit']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatIntervalChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat end rule\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatEndRule(this.value);\r\n\t\t\t});\r\n\r\n\t\t\tscheduler._lightbox._rec_init_done = true;\r\n\t\t},\r\n\t\tbutton_click: function(){},\r\n\t\tset_value: function (node, value, ev) {\r\n\t\t\tlet rf = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\t\trf._init_set_value(node, value, ev);\r\n\t\t\tnode.open = !ev.rrule;\r\n\r\n\t\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\t\tlet ds = rf._ds;\r\n\t\t\tds.start = ev.start_date;\r\n\t\t\tds.end = ev._end_date;\r\n\r\n\t\t\tif (ev.rrule) {\r\n\t\t\t\tconst rruleset = rrulestr(ev.rrule);\r\n\t\t\t\tfillInDefaults(node, rruleset.origOptions, ev);\r\n\t\t\t\tconst topOption = getTopLevelOption(rruleset, ev._end_date);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = topOption;\r\n\t\t\t\tif(topOption === \"CUSTOM\"){\r\n\t\t\t\t\tlet customFreq;\r\n\t\t\t\t\tswitch (rruleset.origOptions.freq) {\r\n\t\t\t\t\t\tcase RRule.DAILY:\r\n\t\t\t\t\t\t\tcustomFreq = \"DAILY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.WEEKLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"WEEKLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.MONTHLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"MONTHLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.YEARLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"YEARLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(customFreq){\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).value = customFreq;\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).dispatchEvent(new Event(\"change\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t//\trepeat_interval_unit\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tfillInDefaults(node, null, ev);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = \"NEVER\";\r\n\t\t\t}\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").dispatchEvent(new Event(\"change\"));\r\n\r\n\t\t},\r\n\t\tget_value: function (node, ev) {\r\n\t\t\t\r\n\t\t\tif(!node.blocked && node.querySelector(\".dhx_form_repeat_pattern select\").value !== \"NEVER\") {\r\n\t\t\t\tlet ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\t\tlet actual_dates = {};\r\n\r\n\t\t\t\tlet timeControl = getTimeSection();\r\n\r\n\t\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\t\tds.start = actual_dates.start_date;\r\n\t\t\t\tconst pattern = node.querySelector(\".dhx_form_repeat_pattern select\").value;\r\n\t\t\t\tconst recurrence = getRecValue[pattern](ds, node);\r\n\t\t\t\tev.rrule = new RRule(recurrence.rrule).toString().replace(\"RRULE:\", \"\");\r\n\t\t\t\tds.end = recurrence.until;\r\n\r\n\t\t\t\tev.duration = Math.floor((actual_dates.end_date - actual_dates.start_date) / 1000);\r\n\r\n\t\t\t\tif (ds._start) {\r\n\t\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\t\tds._start = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._start_date = null;\r\n\r\n\t\t\t\tev._end_date = ds.end;\r\n\t\t\t}else{\r\n\t\t\t\tev.rrule = ev.rrule = \"\";\r\n\t\t\t\tev._end_date = ev.end_date;\r\n\t\t\t}\r\n\r\n\t\t\treturn ev.rrule;\r\n\t\t},\r\n\r\n\t\tfocus: function (node) {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction getTimeSection() {\r\n\t\tlet timeControl = scheduler.formSection('time');\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('time');\r\n\t\t}\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t\t}\r\n\r\n\r\n\t\tif (!timeControl) {\r\n\t\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\t\t\t\t\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\t\t\t\t\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\t\t\t\t\"\",\r\n\t\t\t\t\"scheduler.config.lightbox.sections = [\",\r\n\t\t\t\t\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n\t\t\t\t.join(\"\\n\"));\r\n\t\t}\r\n\r\n\t\treturn timeControl;\r\n\t}\r\n\r\n\tfunction getFirstSectionOfType(type) {\r\n\t\tfor (let i = 0; i < scheduler.config.lightbox.sections.length; i++) {\r\n\t\t\tlet section = scheduler.config.lightbox.sections[i];\r\n\t\t\tif (section.type === type) {\r\n\t\t\t\treturn scheduler.formSection(section.name);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.occurrence_timestamp_in_utc = false;\r\nscheduler.config.recurring_workdays = [1,2,3,4,5];\r\nscheduler.form_blocks[\"recurring\"] = {\r\n\t_get_node : function(node){\r\n\t\tif (typeof node == \"string\"){\r\n\t\t\tlet element = scheduler._lightbox.querySelector(`#${node}`);\r\n\t\t\tif(!element){\r\n\t\t\t\t// form is detached from lightbox \r\n\t\t\t\t// search globally, won't work in LWC\r\n\t\t\t\telement = document.getElementById(node);\r\n\t\t\t}\r\n\t\t\tnode = element;\r\n\t\t}\r\n\t\tif (node.style.display == 'none')\r\n\t\t\tnode.style.display = \"\";\r\n\t\treturn node;\r\n\t},\r\n\t_outer_html: function(node){\r\n\t\treturn node.outerHTML || getOuterHTML(node);\r\n\r\n\t\t//probably not needed, FF v10- only\r\n\t\tfunction getOuterHTML(n){\r\n\t\t\tvar div = document.createElement('div'), h;\r\n\t\t\tdiv.appendChild( n.cloneNode(true) );\r\n\t\t\th = div.innerHTML;\r\n\t\t\tdiv = null;\r\n\t\t\treturn h;\r\n\t\t}\r\n\t},\r\n\trender:function(sns) {\r\n\t\tif(sns.form){\r\n\t\t\tvar rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tvar form = rec._get_node(sns.form);\r\n\t\t\tvar html = rec._outer_html(form);\r\n\t\t\tform.style.display = 'none';\r\n\t\t\treturn html;\r\n\t\t}\r\n\t\tvar loc = scheduler.locale.labels;\r\n\t\treturn ' '+\r\n\t\t\t\t' ';\r\n\t},\r\n\t_ds: {},\r\n\t_get_form_node: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return null;\r\n\t\tif(col.nodeName) return col;\r\n\r\n\t\tif(col.length){\r\n\t\t\tfor(var i=0; i < col.length; i++){\r\n\t\t\t\tif(col[i].value == value)\r\n\t\t\t\t\treturn col[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_get_node_value: function(els, name, multiselect){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return \"\";\r\n\t\tif(col.length){\r\n\t\t\tif(multiselect){\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) res.push(col[i].value);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}else{\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) return col[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(col.value)\r\n\t\t\treturn !multiselect ? col.value : [col.value];\r\n\t},\r\n\r\n\t_get_node_numeric_value: function(els, name){\r\n\t\tvar value = scheduler.form_blocks[\"recurring\"]._get_node_value(els, name);\r\n\t\treturn ((value * 1) || 0);\r\n\t},\r\n\r\n\t_set_node_value: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return;\r\n\r\n\t\tif(col.name == name){\r\n\t\t\tcol.value = value;\r\n\t\t}else if(col.length){\r\n\t\t\tvar hash_value = typeof value == \"object\";\r\n\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\tif (hash_value || col[i].value == value){\r\n\t\t\t\t\tcol[i].checked = hash_value ? !!value[col[i].value] : !!value;\r\n\t\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_init_set_value:function(node, value, ev) {\r\n\t\tvar block = scheduler.form_blocks[\"recurring\"];\r\n\t\tvar get_value = block._get_node_value;\r\n\t\tvar set_value = block._set_node_value;\r\n\t\tscheduler.form_blocks[\"recurring\"]._ds = {start:ev.start_date, end:ev._end_date};\r\n\r\n\t\tvar str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);\r\n\t\tvar str_date = function(str_date) {\r\n\t\t\tvar date = str_date_format(str_date);\r\n\t\t\tif (scheduler.config.include_end_by)\r\n\t\t\t\tdate = scheduler.date.add(date, 1, 'day');\r\n\t\t\treturn date;\r\n\t\t};\r\n\r\n\t\tvar date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\r\n\t\tvar top = node.getElementsByTagName(\"FORM\")[0];\r\n\t\tvar els = {};\r\n\r\n\t\tfunction register_els(inps) {\r\n\t\t\tfor (var i = 0; i < inps.length; i++) {\r\n\t\t\t\tvar inp = inps[i];\r\n\r\n\t\t\t\tif(inp.name){\r\n\t\t\t\t\tif(!els[inp.name]){\r\n\t\t\t\t\t\tels[inp.name] = inp;\r\n\t\t\t\t\t}else if(els[inp.name].nodeType){\r\n\t\t\t\t\t\tvar node = els[inp.name];\r\n\t\t\t\t\t\tels[inp.name] = [node, inp];\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tels[inp.name].push(inp);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tregister_els(top.getElementsByTagName(\"INPUT\"));\r\n\t\tregister_els(top.getElementsByTagName(\"SELECT\"));\r\n\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tvar formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tset_value(els, \"date_of_end\", scheduler.config.repeat_date_of_end);\r\n\r\n\t\tvar $ = function(a) {\r\n\t\t\treturn scheduler._lightbox.querySelector(`#${a}`) || { style:{} };//return fake object if node not found\r\n\t\t};\r\n\r\n\t\tfunction change_current_view() {\r\n\t\t\t$(\"dhx_repeat_day\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_week\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_month\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_year\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_\" + this.value).style.display = \"\";\r\n\t\t\tscheduler.setLightboxSize();\r\n\t\t}\r\n\r\n\t\tfunction get_repeat_code(dates) {\r\n\t\t\tvar code = [get_value(els, \"repeat\")];\r\n\t\t\tget_rcode[code[0]](code, dates);\r\n\r\n\t\t\twhile (code.length < 5) code.push(\"\");\r\n\t\t\tvar repeat = \"\";\r\n\r\n\t\t\tvar end = get_end_rule(els);\r\n\r\n\t\t\tif (end == \"no\") {\r\n\t\t\t\tdates.end = new Date(9999, 1, 1);\r\n\t\t\t\trepeat = \"no\";\r\n\t\t\t}\r\n\t\t\telse if (end == \"date_of_end\") {\r\n\t\t\t\tdates.end = str_date(get_value(els, \"date_of_end\"));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscheduler.transpose_type(code.join(\"_\"));\r\n\t\t\t\trepeat = Math.max(1, get_value(els, \"occurences_count\"));\r\n\r\n\t\t\t\tvar transp = 0;\r\n\r\n\t\t\t\t//var transp = ((code[0] == \"week\" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);\r\n\r\n\t\t\t\t// which is equal to following code, seems to produce extra instance, not clear why needed\r\n\r\n\t\t\t\t/*if(code[0] == \"week\"){\r\n\t\t\t\t\tvar days = code[4] || \"\";\r\n\t\t\t\t\tif(scheduler.config.start_on_monday){\r\n\t\t\t\t\t\tif(days.indexOf(1) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(days.indexOf(0) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\r\n\t\t\t//\tdates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join(\"_\"));\r\n\r\n\t\t\t\tdates.end = scheduler.date[\"add_\" + code.join(\"_\")](new Date(dates.start), repeat + transp, {start_date: dates.start}) || dates.start;\r\n\t\t\t}\r\n\r\n\t\t\treturn code.join(\"_\") + \"#\" + repeat;\r\n\t\t}\r\n\t\tfunction get_end_rule(els){\r\n\t\t\tvar end = els[\"end\"];\r\n\t\t\tif(end.length){\r\n\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\tif(end[i].checked){\r\n\t\t\t\t\t\tif(end[i].value && end[i].value != \"on\"){//seems to be default value:var input = document.createElement(\"input\"); input.type = \"radio\"; input.value\r\n\t\t\t\t\t\t\treturn end[i].value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!i){\r\n\t\t\t\t\t\t\t\treturn \"no\";\r\n\t\t\t\t\t\t\t}else if(i == 2){\r\n\t\t\t\t\t\t\t\treturn \"date_of_end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn \"occurences_count\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(end.value)\r\n\t\t\t\t\treturn end.value;\r\n\t\t\t}\r\n\t\t\treturn \"no\";\r\n\t\t}\r\n\t\tfunction set_end_rule(els, value){\r\n\t\t\tvar end = els[\"end\"];\r\n\r\n\t\t\tif(end.length){\r\n\t\t\t\tvar has_values = !!end[0].value && end[0].value != \"on\";\r\n\t\t\t\tif(has_values){\r\n\t\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\t\tif(end[i].value == value)\r\n\t\t\t\t\t\t\tend[i].checked = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar ind = 0;\r\n\t\t\t\t\tswitch(value){\r\n\t\t\t\t\t\tcase \"no\":\r\n\t\t\t\t\t\t\tind = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"date_of_end\":\r\n\t\t\t\t\t\t\tind = 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tind = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend[ind].checked = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tend.value = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._get_repeat_code = get_repeat_code;\r\n\t\tvar get_rcode = {\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"month_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count\")));\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"month_day\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count2\")));\r\n\t\t\t\t\tcode.push( get_value(els, \"month_day2\"));\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_week2\")));\r\n\t\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t},\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"week_count\")));\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tvar t = [];\r\n\r\n\t\t\t\tvar col = get_value(els, \"week_day\", true);\r\n\t\t\t\t//var col = els[\"week_day\"];\r\n\t\t\t\tvar day = dates.start.getDay();\r\n\t\t\t\tvar start_exists = false;\r\n\r\n\t\t\t\tfor (var i = 0; i < col.length; i++){\r\n\t\t\t\t\tt.push(col[i]);\r\n\t\t\t\t\tstart_exists = start_exists || col[i] == day;\r\n\t\t\t\t}\r\n\t\t\t\tif (!t.length){\r\n\t\t\t\t\tt.push(day);\r\n\t\t\t\t\tstart_exists = true;\r\n\t\t\t\t}\r\n\t\t\t\tt.sort();\r\n\r\n\r\n\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\tdates.start = scheduler.date.week_start(dates.start);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t} else if (!start_exists){\r\n\t\t\t\t\tscheduler.transpose_day_week(dates.start, t, 1, 7);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcode.push(t.join(\",\"));\r\n\t\t\t},\r\n\t\t\tday:function(code) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"day_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"day_count\")));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcode.push(\"week\");\r\n\t\t\t\t\tcode.push(1);\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(scheduler.config.recurring_workdays.join(\",\"));\r\n\t\t\t\t\tcode.splice(0, 1);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\r\n\t\t\t\tif (get_value(els, \"year_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tdates.start.setMonth(0);\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"year_day\"));\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month\"));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tcode.push(get_value(els, \"year_day2\"));\r\n\t\t\t\t\tcode.push(get_value(els, \"year_week2\"));\r\n\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month2\"));\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar set_rcode = {\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"week_count\", code[1]);\r\n\r\n\t\t\t\tvar t = code[4].split(\",\");\r\n\t\t\t\tvar d = {};\r\n\t\t\t\tfor (var i = 0; i < t.length; i++) d[t[i]] = true;\r\n\r\n\t\t\t\tset_value(els, \"week_day\", d);\r\n\r\n\t\t\t\t//for (var i = 0; i < col.length; i++)\r\n\t\t\t\t//\tcol[i].checked = (!!d[col[i].value]);\r\n\t\t\t},\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"month_count\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_day\", dates.start.getDate());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"month_count2\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"month_day2\", code[2]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tday:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"day_type\", \"d\");\r\n\t\t\t\tset_value(els, \"day_count\", code[1]);\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"year_day\", dates.start.getDate());\r\n\t\t\t\t\tset_value(els, \"year_month\", dates.start.getMonth());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"year_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"year_day2\", code[2]);\r\n\t\t\t\t\tset_value(els, \"year_month2\", dates.start.getMonth());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction set_repeat_code(code, dates) {\r\n\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\tvar data = code.split(\"#\");\r\n\t\t\tcode = data[0].split(\"_\");\r\n\t\t\tset_rcode[code[0]](code, dates);\r\n\r\n\t\t\tswitch (data[1]) {\r\n\t\t\t\tcase \"no\":\r\n\t\t\t\t\tset_end_rule(els, \"no\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"\":\r\n\t\t\t\t\tset_end_rule(els, \"date_of_end\");\r\n\r\n\t\t\t\t\tvar end_date = dates.end;\r\n\t\t\t\t\tif (scheduler.config.include_end_by){\r\n\t\t\t\t\t\tend_date = scheduler.date.add(end_date, -1, 'day');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tset_value(els, \"date_of_end\", date_str(end_date));\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tset_end_rule(els, \"occurences_count\");\r\n\t\t\t\t\tset_value(els, \"occurences_count\", data[1]);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tset_value(els, \"repeat\", code[0]);\r\n\t\t\t//e.checked = true;\r\n\r\n\t\t\tvar node = scheduler.form_blocks[\"recurring\"]._get_form_node(els, \"repeat\", code[0]);\r\n\t\t\tif(node.nodeName == \"SELECT\"/* && node.onchange*/){\r\n\t\t\t//\tnode.onchange();\r\n\t\t\t\tnode.dispatchEvent(new Event('change'));\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}else{\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._set_repeat_code = set_repeat_code;\r\n\r\n\t\tfor (var i = 0; i < top.elements.length; i++) {\r\n\t\t\tvar el = top.elements[i];\r\n\t\t\tswitch (el.name) {\r\n\t\t\t\tcase \"repeat\":\r\n\t\t\t\t\tif (el.nodeName == \"SELECT\" && !el.$_eventAttached) {\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"change\", change_current_view);\r\n\t\t\t\t\t} else if(!el.$_eventAttached){\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"click\", change_current_view);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._lightbox._rec_init_done = true;\r\n\t},\r\n\tset_value:function(node, value, ev) {\r\n\t\tvar rf = scheduler.form_blocks[\"recurring\"];\r\n\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\trf._init_set_value(node, value, ev);\r\n\t\tnode.open = !ev.rec_type;\r\n\r\n\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\tvar ds = rf._ds;\r\n\t\tds.start = ev.start_date;\r\n\t\tds.end = ev._end_date;\r\n\r\n\t\trf._toggle_block();\r\n\r\n\t\tif (value)\r\n\t\t\trf._set_repeat_code(value, ds);\r\n\t},\r\n\tget_value:function(node, ev) {\r\n\t\tif (node.open) {\r\n\t\t\tvar ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\tvar actual_dates = {};\r\n\r\n\t\t\tvar timeControl = getTimeSection();\r\n\r\n\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\tds.start = actual_dates.start_date;\r\n\t\t\tev.rec_type = scheduler.form_blocks[\"recurring\"]._get_repeat_code(ds);\r\n\t\t\tif (ds._start) {\r\n\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\tds._start = false;\r\n\t\t\t} else\r\n\t\t\t\tev._start_date = null;\r\n\r\n\t\t\tev._end_date = ds.end;\r\n\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t} else {\r\n\t\t\tev.rec_type = ev.rec_pattern = \"\";\r\n\t\t\tev._end_date = ev.end_date;\r\n\t\t}\r\n\t\treturn ev.rec_type;\r\n\t},\r\n\t_get_button: function(){\r\n\t\tvar node = getRecurringSection().header;\r\n\t\treturn node.firstChild.firstChild;\r\n\t},\r\n\t_get_form: function(){\r\n\t\treturn getRecurringSection().node;\r\n\t},\r\n\topen:function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\t\tif(!cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\tclose: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\r\n\t\tif(cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\t_toggle_block: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form(),\r\n\t\t\tel = block._get_button();\r\n\t\tif (!cont.open && !cont.blocked) {\r\n\t\t\tcont.style.height = \"auto\";//reset to default value\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 0px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcont.style.height = \"0px\";\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 20px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcont.open = !cont.open;\r\n\r\n\t\tscheduler.setLightboxSize();\r\n\t},\r\n\tfocus:function(node) {\r\n\t},\r\n\tbutton_click:function(node, button, event) {\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\t\tvar cont = block._get_form();\r\n\t\tif (!cont.blocked)\r\n\t\t\tscheduler.form_blocks.recurring._toggle_block();\r\n\t}\r\n};\r\n\r\nfunction getTimeSection(){\r\n\tvar timeControl = scheduler.formSection('time');\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('time');\r\n\t}\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t}\r\n\r\n\t\r\n\tif (!timeControl) {\r\n\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n.join(\"\\n\"));\r\n\t}\r\n\r\n\treturn timeControl;\r\n}\r\n\r\nfunction getRecurringSection(){\r\n\tvar recurringSection = scheduler.formSection('recurring');\r\n\tif(!recurringSection){\r\n\t\trecurringSection = getFirstSectionOfType('recurring');\r\n\t}\r\n\r\n\tif (!recurringSection) {\r\n\t\tthrow new Error([\"Can't locate the Recurring form section.\",\r\n\t\t\"Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox \",\r\n\t\t\"and that the recurring control has name \\\"recurring\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"\t{name:\\\"recurring\\\", ... }\",\r\n\"];\"].join(\"\\n\"));\r\n\r\n\t}\r\n\r\n\treturn recurringSection;\r\n}\r\n\r\nfunction getFirstSectionOfType(type){\r\n\tfor(var i = 0; i < scheduler.config.lightbox.sections.length; i++){\r\n\t\tvar section = scheduler.config.lightbox.sections[i];\r\n\t\tif(section.type === type){\r\n\t\t\treturn scheduler.formSection(section.name);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//problem may occur if we will have two repeating events in the same moment of time\r\nscheduler._rec_markers = {};\r\nscheduler._rec_markers_pull = {};\r\nscheduler._add_rec_marker = function(ev, time) {\r\n\tev._pid_time = time;\r\n\tthis._rec_markers[ev.id] = ev;\r\n\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n};\r\nscheduler._get_rec_marker = function(time, id) {\r\n\tvar ch = this._rec_markers_pull[id];\r\n\tif (ch) return ch[time];\r\n\treturn null;\r\n};\r\nscheduler._get_rec_markers = function(id) {\r\n\treturn (this._rec_markers_pull[id] || []);\r\n};\r\n\r\nfunction clearMilliseconds(date){\r\n//\treturn date;\r\n\treturn new Date(\r\n\t\tdate.getFullYear(), \r\n\t\tdate.getMonth(), \r\n\t\tdate.getDate(), \r\n\t\tdate.getHours(), \r\n\t\tdate.getMinutes(),\r\n\t\tdate.getSeconds(),\r\n\t\t0\r\n\t);\r\n}\r\n\r\nscheduler._rec_temp = [];\r\n(function() {\r\n\tvar old_add_event = scheduler.addEvent;\r\n\tscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\t\t\t\r\n\t\t\tif(ev.start_date){\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif(ev.end_date){\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\t\t\tif (this._is_modified_occurence(ev))\r\n\t\t\t\tscheduler._add_rec_marker(ev, ev.event_length * 1000);\r\n\t\t\tif (ev.rec_type)\r\n\t\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t}\r\n\t\treturn ev_id;\r\n\t};\r\n})();\r\n\r\nscheduler.attachEvent(\"onEventIdChange\", function(id, new_id) {\r\n\tif (this._ignore_call) return;\r\n\tthis._ignore_call = true;\r\n\r\n\tif(scheduler._rec_markers[id]){\r\n\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\tdelete scheduler._rec_markers[id];\r\n\t}\r\n\r\n\tif(scheduler._rec_markers_pull[id]){\r\n\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\tdelete scheduler._rec_markers_pull[id];\r\n\t}\r\n\r\n\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\tvar tev = this._rec_temp[i];\r\n\t\tif (tev.event_pid == id) {\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i in this._rec_markers){\r\n\t\tvar tev = this._rec_markers[i];\r\n\t\tif(tev.event_pid == id){\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\ttev._pid_changed = true;\r\n\t\t}\r\n\t}\r\n\r\n\tvar el = scheduler._rec_markers[new_id];\r\n\tif(el && el._pid_changed) {\r\n\t\tdelete el._pid_changed;\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tdelete this._ignore_call;\r\n});\r\nscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && ev.rec_type && ev.rec_type != 'none')) {\r\n\t\tid = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tvar tid = (id[1]) ? id[1] : Math.round(ev._pid_time / 1000);\r\n\r\n\t\tvar nev = this._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = ev.event_pid || id[0];\r\n\t\tvar timestamp = tid;\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"none\";\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t} else {\r\n\t\tif (ev.rec_type && this._lightbox_id)\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tid = sub[i].id;\r\n\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventDeleted\", function(id, ev){\r\n\tif(!this._is_virtual_event(id) && this._is_modified_occurence(ev)){\r\n\t\tif(!scheduler._events[id]){\r\n\t\t\tev.rec_type = ev.rec_pattern = \"none\";\r\n\t\t\tthis.setEvent(id, ev);\r\n\t\t}\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\tif (this._loading) return true;\r\n\r\n\tvar ev = this.getEvent(id);\r\n\r\n\tif (this._is_virtual_event(id)) {\r\n\t\tvar id = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tthis._not_render = true;\r\n\r\n\t\tvar nev = this._copy_event(event);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = id[0];\r\n\t\tvar timestamp = id[1];\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"\";\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._not_render = false;\r\n\r\n\t} else {\r\n\t\tif(ev.start_date){\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif(ev.end_date){\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif (ev.rec_type && this._lightbox_id){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\tvar isEventFound = false;\r\n\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\tisEventFound = true;\r\n\t\t}\r\n\t\tif (!isEventFound)\r\n\t\t\tthis._select_id = null;\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\tif (!this._loading) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (ev.rec_type && !ev.event_length){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type && data.rec_type && !this._is_virtual_event(id))\r\n\t\tthis._select_id = null;\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCreated\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type)\r\n\t\tev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = \"\";\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCancel\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (ev.rec_type) {\r\n\t\tthis._roll_back_dates(ev);\r\n\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\tthis.render_view_data();\r\n\t}\r\n});\r\nscheduler._roll_back_dates = function(ev) {\r\n\tif(ev.start_date){\r\n\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t}\r\n\tif(ev.end_date){\r\n\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t}\r\n\tev.event_length = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\tev.end_date = ev._end_date;\r\n\tif (ev._start_date) {\r\n\t\tev.start_date.setMonth(0);\r\n\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t}\r\n};\r\n\r\nscheduler._is_virtual_event = function(id){\r\n\treturn id.toString().indexOf(\"#\") != -1;\r\n};\r\nscheduler._is_modified_occurence = function(ev){\r\n\treturn (ev.event_pid && ev.event_pid != \"0\");\r\n};\r\n\r\nscheduler.showLightbox_rec = scheduler.showLightbox;\r\nscheduler.showLightbox = function(id) {\r\n\tvar locale = this.locale;\r\n\tvar c = scheduler.config.lightbox_recurring;\r\n\tvar ev = this.getEvent(id);\r\n\tvar pid = ev.event_pid;\r\n\tvar isVirtual = this._is_virtual_event(id);\r\n\tif (isVirtual)\r\n\t\tpid = id.split(\"#\")[0];\r\n\r\n\t// show series\r\n\tvar showSeries = function(id) {\r\n\t\tvar event = scheduler.getEvent(id);\r\n\t\tevent._end_date = event.end_date;\r\n\t\tevent.end_date = new Date(event.start_date.valueOf() + event.event_length * 1000);\r\n\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t};\r\n\r\n\tif ( (pid || pid*1 === 0) && ev.rec_type) {\r\n\t\t// direct API call on series id\r\n\t\treturn showSeries(id);\r\n\t}\r\n\tif ( !pid || pid === '0' || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {\r\n\t\t// editing instance or non recurring event\r\n\t\treturn this.showLightbox_rec(id);\r\n\t}\r\n\tif (c == 'ask') {\r\n\t\tvar that = this;\r\n\t\tscheduler.modalbox({\r\n\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\twidth: \"500px\",\r\n\t\t\tposition: \"middle\",\r\n\t\t\tbuttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\tcallback: function(index) {\r\n\t\t\t\tswitch(+index) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tshowSeries(pid);\r\n\t}\r\n};\r\n\r\n\r\nscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\nscheduler.get_visible_events = function(only_timed) {\r\n\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\tdelete this._events[this._rec_temp[i].id];\r\n\tthis._rec_temp = [];\r\n\r\n\tvar stack = this.get_visible_events_rec(only_timed);\r\n\tvar out = [];\r\n\tfor (var i = 0; i < stack.length; i++) {\r\n\t\tif (stack[i].rec_type) {\r\n\t\t\t//deleted element of series\r\n\t\t\tif (stack[i].rec_pattern != \"none\")\r\n\t\t\t\tthis.repeat_date(stack[i], out);\r\n\t\t}\r\n\t\telse out.push(stack[i]);\r\n\t}\r\n\treturn out;\r\n};\r\n\r\n\r\n(function() {\r\n\tvar old = scheduler.isOneDayEvent;\r\n\tscheduler.isOneDayEvent = function(ev) {\r\n\t\tif (ev.rec_type) return true;\r\n\t\treturn old.call(this, ev);\r\n\t};\r\n\tvar old_update_event = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id) {\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif(ev && ev.rec_type){\r\n\t\t\t//rec_type can be changed without the lightbox,\r\n\t\t\t// make sure rec_pattern updated as well\r\n\t\t\tev.rec_pattern = (ev.rec_type || \"\").split(\"#\")[0];\r\n\t\t}\r\n\t\tif (ev && ev.rec_type && !this._is_virtual_event(id)) {\r\n\t\t\tscheduler.update_view();\r\n\t\t} else {\r\n\t\t\told_update_event.call(this, id);\r\n\t\t}\r\n\t};\r\n})();\r\n\r\nscheduler.transponse_size = {\r\n\tday:1, week:7, month:1, year:12\r\n};\r\nscheduler.date.day_week = function(sd, day, week) {\r\n\tsd.setDate(1);\r\n\tvar originalMonth = scheduler.date.month_start(new Date(sd));\r\n\tweek = (week - 1) * 7;\r\n\tvar cday = sd.getDay();\r\n\tvar nday = day * 1 + week - cday + 1;\r\n\tsd.setDate(nday <= week ? (nday + 7) : nday);\r\n\tvar newMonth = scheduler.date.month_start(new Date(sd));\r\n\tif(originalMonth.valueOf() !== newMonth.valueOf()){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\nscheduler.transpose_day_week = function(sd, list, cor, size, cor2) {\r\n\tvar cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tif (list[i] > cday)\r\n\t\t\treturn sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));\r\n\t}\r\n\tthis.transpose_day_week(sd, list, cor + size, null, cor);\r\n};\r\nscheduler.transpose_type = function(type) {\r\n\tvar transposeRecurring = \"transpose_\" + type;\r\n\tif (!this.date[transposeRecurring]) {\r\n\t\tvar recurringParts = type.split(\"_\");\r\n\t\tvar dayDurationMs = 60 * 60 * 24 * 1000;\r\n\t\tvar addRecurring = \"add_\" + type;\r\n\t\tvar recurringStepDays = this.transponse_size[recurringParts[0]] * recurringParts[1];\r\n\r\n\t\tif (recurringParts[0] == \"day\" || recurringParts[0] == \"week\") {\r\n\t\t\tvar weekDays = null;\r\n\t\t\tif (recurringParts[4]) {\r\n\t\t\t\tweekDays = recurringParts[4].split(\",\");\r\n\t\t\t\tif (scheduler.config.start_on_monday) {\r\n\t\t\t\t\tfor (var i = 0; i < weekDays.length; i++)\r\n\t\t\t\t\t\tweekDays[i] = (weekDays[i] * 1) || 7;\r\n\t\t\t\t\tweekDays.sort();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td) {\r\n\t\t\t\tvar delta = Math.floor((td.valueOf() - nd.valueOf()) / (dayDurationMs * recurringStepDays));\r\n\t\t\t\tif (delta > 0)\r\n\t\t\t\t\tnd.setDate(nd.getDate() + delta * recurringStepDays);\r\n\t\t\t\tif (weekDays)\r\n\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 1, recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc) {\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tif (weekDays) {\r\n\t\t\t\t\tfor (var count = 0; count < inc; count++)\r\n\t\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 0, recurringStepDays);\r\n\t\t\t\t} else\r\n\t\t\t\t\tnd.setDate(nd.getDate() + inc * recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if (recurringParts[0] == \"month\" || recurringParts[0] == \"year\") {\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td, seriesInstance) {\r\n\t\t\t\tvar delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1 + 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1 + 1)) / (recurringStepDays) - 1);\r\n\r\n\t\t\t\tif (delta >= 0){\r\n\t\t\t\t\tnd.setDate(1);\r\n\t\t\t\t\tnd.setMonth(nd.getMonth() + delta * recurringStepDays);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn scheduler.date[addRecurring](nd, 0, seriesInstance);\r\n\t\t\t\t//if (str[3]){\r\n\t\t\t\t//\tscheduler.date.day_week(nd, str[2], str[3]);\r\n\t\t\t\t//}\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc, seriesInstance, currentCount) {\r\n\t\t\t\tif(!currentCount){\r\n\t\t\t\t\tcurrentCount = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrentCount++;\r\n\t\t\t\t}\r\n\t\t\t\tvar maxCount = 12;\r\n\t\t\t\tif(currentCount > maxCount){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tnd.setDate(1);\r\n\r\n\r\n\t\t\t\tnd.setMonth(nd.getMonth() + inc * recurringStepDays);\r\n\t\t\t\tvar origMonth = nd.getMonth();\r\n\t\t\t\tvar origYear = nd.getFullYear();\r\n\t\t\t\tnd.setDate(seriesInstance.start_date.getDate());\r\n\t\t\t\tif (recurringParts[3]){\r\n\t\t\t\t\tscheduler.date.day_week(nd, recurringParts[2], recurringParts[3]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar correctOverflowInstances = scheduler.config.recurring_overflow_instances;\r\n\t\t\t\tif(nd.getMonth() != origMonth && correctOverflowInstances != \"none\"){\r\n\t\t\t\t\t// no such day in a month\r\n\t\t\t\t\tif(correctOverflowInstances === \"lastDay\"){\r\n\t\t\t\t\t\t// return either last day of the month\r\n\t\t\t\t\t\tnd = new Date(origYear, origMonth + 1, 0, nd.getHours(), nd.getMinutes(), nd.getSeconds(), nd.getMilliseconds());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// or go to the next instance\r\n\t\t\t\t\t\tnd = scheduler.date[addRecurring](new Date(origYear, origMonth + 1, 0), inc||1, seriesInstance, currentCount);\r\n\t\t\t\t\t\t// if next instance is not possible (e.g. 'repeat on 40th day of the month') null will be returned\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.repeat_date = function(ev, stack, non_render, from, to, maxCount) {\r\n\r\n\tfrom = from || this._min_date;\r\n\tto = to || this._max_date;\r\n\tvar max = maxCount || -1;\r\n\tvar td = new Date(ev.start_date.valueOf());\r\n\r\n\tvar startHour = td.getHours();\r\n\r\n\tvar visibleCount = 0;\r\n\r\n\tif (!ev.rec_pattern && ev.rec_type)\r\n\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\r\n\tthis.transpose_type(ev.rec_pattern);\r\n\ttd = scheduler.date[\"transpose_\" + ev.rec_pattern](td, from, ev);\r\n\twhile ( td && (\r\n\t\ttd < ev.start_date ||\r\n\t\tscheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() ||\r\n\t\ttd.valueOf() + ev.event_length * 1000 <= from.valueOf())){\r\n\t\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\r\n\t}\r\n\twhile (td && (td < to && td < ev.end_date && (max < 0 || visibleCount < max))) {\r\n\t\ttd.setHours(startHour);\r\n\r\n\t\tvar timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();\r\n\t\tvar ch = this._get_rec_marker(timestamp, ev.id);\r\n\t\tif (!ch) { // unmodified element of series\r\n\t\t\tvar ted = new Date(td.valueOf() + ev.event_length * 1000);\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\t//copy._timed = ev._timed;\r\n\t\t\tcopy.text = ev.text;\r\n\t\t\tcopy.start_date = td;\r\n\t\t\tcopy.event_pid = ev.id;\r\n\t\t\tcopy.id = ev.id + \"#\" + Math.round(timestamp / 1000);\r\n\t\t\tcopy.end_date = ted;\r\n\r\n\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);\r\n\r\n\t\t\tcopy._timed = this.isOneDayEvent(copy);\r\n\r\n\t\t\tif (!copy._timed && !this._table_view && !this.config.multi_day) return;\r\n\t\t\tstack.push(copy);\r\n\r\n\t\t\tif (!non_render) {\r\n\t\t\t\tthis._events[copy.id] = copy;\r\n\t\t\t\tthis._rec_temp.push(copy);\r\n\t\t\t}\r\n\r\n\t\t\tvisibleCount++;\r\n\r\n\t\t} else\r\n\t\tif (non_render){\r\n\t\t\tif(ch.rec_type != \"none\"){\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t\tstack.push(ch);\r\n\t\t}\r\n\r\n\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\t//\tif(!scheduler.date[\"validate_add_\" + ev.rec_pattern](td, 1, ev.rec_pattern)){\r\n\t///\t\talert(\"detect add\")\r\n\t//\t}\r\n\t}\r\n};\r\nscheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {\r\n\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\tif (shift) {\r\n\t\tif (shift > 0) {\r\n\t\t\t// e.g. 24h -> 23h\r\n\t\t\treturn new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// e.g. 24h -> 25h\r\n\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t}\r\n\t}\r\n\treturn new Date(default_date.valueOf());\r\n};\r\nscheduler.getRecDates = function(id, max) {\r\n\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\tvar recurrings = [];\r\n\tmax = max || 100;\r\n\r\n\tif (!ev.rec_type) {\r\n\t\treturn [\r\n\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t];\r\n\t}\r\n\tif (ev.rec_type == \"none\") {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\tvar result = [];\r\n\tfor(var i = 0; i < recurrings.length; i++){\r\n\t\tif(recurrings[i].rec_type != \"none\"){\r\n\t\t\tresult.push({start_date: recurrings[i].start_date, end_date: recurrings[i].end_date});\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ev.start_date < to && ev.end_date > from) {\r\n\t\t\tif (ev.rec_pattern) {\r\n\t\t\t\tif (ev.rec_pattern == \"none\") continue;\r\n\t\t\t\tvar sev = [];\r\n\t\t\t\tthis.repeat_date(ev, sev, true, from, to);\r\n\t\t\t\tfor (var i = 0; i < sev.length; i++) {\r\n\t\t\t\t\t// if event is in rec_markers then it will be checked by himself, here need to skip it\r\n\t\t\t\t\tif (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {\r\n\t\t\t\t\t\tresult.push(sev[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n};\r\n\r\nscheduler.config.repeat_date = \"%m.%d.%Y\";\r\nscheduler.config.lightbox.sections = [\r\n\t{name:\"description\", map_to:\"text\", type:\"textarea\" , focus:true},\r\n\t{name:\"recurring\", type:\"recurring\", map_to:\"rec_type\", button:\"recurring\"},\r\n\t{name:\"time\", height:72, type:\"time\", map_to:\"auto\"}\r\n];\r\n\r\n\r\n//drop secondary attributes\r\nscheduler._copy_dummy = function(ev) {\r\n\tvar start_date = new Date(this.start_date);\r\n\tvar end_date = new Date(this.end_date);\r\n\tthis.start_date = start_date;\r\n\tthis.end_date = end_date;\r\n\tthis.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;\r\n};\r\n\r\nscheduler.config.include_end_by = false;\r\nscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\r\nscheduler.attachEvent(\"onClearAll\", function(){\r\n\tscheduler._rec_markers = {}; //clear recurring events data\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_temp = [];\r\n});\r\n\r\n}","import getSerializator from '../core/common/get_serializable_events';\r\nexport default function(scheduler){\r\n\r\n\t\r\nconst getSerializableData = getSerializator(scheduler);\r\n\r\n//redefine this method, if you want to provide a custom set of attributes for serialization\r\nscheduler.data_attributes=function(){\r\n\tvar attrs = [];\r\n\tvar format = scheduler._helpers.formatDate;\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\t\tfor (var name in ev)\r\n\t\t\tif (name.substr(0,1) !=\"_\")\r\n\t\t\t\tattrs.push([name,((name == \"start_date\" || name == \"end_date\")?format:null)]);\r\n\t\tbreak;\r\n\t}\r\n\treturn attrs;\r\n};\r\n\r\nscheduler.toXML = function(header){\r\n\tvar xml = [];\r\n\tvar attrs = this.data_attributes();\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\t\txml.push(\"
\");\r\n\t\tfor (var i=0; i < attrs.length; i++)\r\n\t\t\txml.push(\"<\"+attrs[i][0]+\">\"+attrs[i][0]+\">\");\r\n\r\n\t\txml.push(\" \");\r\n\t}\r\n\treturn (header||\"\")+\"
\"+xml.join(\"\\n\")+\" \";\r\n};\r\n\r\nscheduler._serialize_json_value = function(value){\r\n\tif(value === null || typeof value === \"boolean\"){\r\n\t\tvalue = \"\" + value;\r\n\t}else{\r\n\t\tif(!value && value !== 0){\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\tvalue = '\"' + value.toString().\r\n\t\t\treplace(/\\n/g,\"\").\r\n\t\t\treplace(/\\\\/g,\"\\\\\\\\\").\r\n\t\t\treplace(/\"/g, '\\\\\"') + '\"';\r\n\t}\r\n\treturn value;\r\n};\r\n\r\n\r\n\r\nscheduler.toJSON = function(){\r\n\treturn JSON.stringify(this.serialize());\r\n};\r\n\r\n\r\nscheduler.toICal = function(header){\r\n\tvar start = \"BEGIN:VCALENDAR\\nVERSION:2.0\\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\\nDESCRIPTION:\";\r\n\tvar end = \"END:VCALENDAR\";\r\n\tvar format = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\tvar full_day_format = scheduler.date.date_to_str(\"%Y%m%d\");\r\n\r\n\tvar ical = [];\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\r\n\t\tical.push(\"BEGIN:VEVENT\");\r\n\t\tif (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))\r\n\t\t\tical.push(\"DTSTART:\"+full_day_format(ev.start_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTSTART:\"+format(ev.start_date));\r\n\t\tif (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))\r\n\t\t\tical.push(\"DTEND:\"+full_day_format(ev.end_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTEND:\"+format(ev.end_date));\r\n\t\tical.push(\"SUMMARY:\"+ev.text);\r\n\t\tical.push(\"END:VEVENT\");\r\n\t}\r\n\treturn start+(header||\"\")+\"\\n\"+ical.join(\"\\n\")+\"\\n\"+end;\r\n};\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Timeline\", scheduler.assert);\r\n}","import { TooltipManager } from \"./tooltipManager\";\r\n\r\nexport default function (scheduler: any) {\r\n\r\n\tscheduler.config.tooltip_timeout = 30;\r\n\tscheduler.config.tooltip_offset_y = 20;\r\n\tscheduler.config.tooltip_offset_x = 10;\r\n\tscheduler.config.tooltip_hide_timeout = 30;\r\n\r\n\tconst tooltipManager = new TooltipManager(scheduler);\r\n\r\n\tscheduler.ext.tooltips = tooltipManager;\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function () {\r\n\r\n\t\ttooltipManager.tooltipFor({\r\n\t\t\tselector: \"[\" + scheduler.config.event_attribute + \"]\",\r\n\t\t\thtml: (event: MouseEvent) => {\r\n\t\t\t\tif (scheduler._mobile && !scheduler.config.touch_tooltip) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst targetEventId = scheduler._locate_event(event.target);\r\n\t\t\t\tif (scheduler.getEvent(targetEventId)) {\r\n\t\t\t\t\tconst event = scheduler.getEvent(targetEventId);\r\n\t\t\t\t\treturn scheduler.templates.tooltip_text(event.start_date, event.end_date, event);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\t\t\tglobal: false\r\n\t\t});\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function () {\r\n\t\ttooltipManager.destructor();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", function () {\r\n\t\ttooltipManager.hideTooltip();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeDrag\", function() {\r\n\t\t// GS-2377: don't hide tooltip on mobile device when ontouchstart event occurs\r\n\t\tif (scheduler._mobile && scheduler.config.touch_tooltip) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Tree Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Units\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler._get_url_nav = function(){\r\n\tvar p = {};\r\n\tvar data = (document.location.hash || \"\").replace(\"#\", \"\").split(\",\");\r\n\tfor (var i = 0; i < data.length; i++) {\r\n\t\tvar s = data[i].split(\"=\");\r\n\t\tif (s.length == 2)\r\n\t\t\tp[s[0]] = s[1];\r\n\t}\r\n\treturn p;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function () {\r\n\tvar first = true;\r\n\tvar s2d = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\tvar d2s = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\tvar select_event = scheduler._get_url_nav().event || null;\r\n\r\n\tscheduler.attachEvent(\"onAfterEventDisplay\", function(ev){\r\n\t\tselect_event = null;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (om, od, m, d) {\r\n\t\tif (first) {\r\n\t\t\tfirst = false;\r\n\t\t\tvar p = scheduler._get_url_nav();\r\n\r\n\t\t\tif (p.event){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif(scheduler.getEvent(p.event)){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar handler = scheduler.attachEvent(\"onXLE\", function(){\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tscheduler.detachEvent(handler);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e){}\r\n\t\t\t}\r\n\r\n\t\t\tif (p.date || p.mode) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), (p.mode || null));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//assuming that mode is not available anymore\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), m);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar values = [\r\n\t\t\t\"date=\" + d2s(d || od),\r\n\t\t\t\"mode=\" + (m || om)\r\n\t\t];\r\n\r\n\t\tif(select_event){\r\n\t\t\tvalues.push(\"event=\" + select_event);\r\n\t\t}\r\n\r\n\t\tvar text = \"#\" + values.join(\",\");\r\n\t\tdocument.location.hash = text;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction showEvent(e){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tselect_event = e;\r\n\t\tif(scheduler.getEvent(e)){\r\n\t\t\tscheduler.showEvent(e);\r\n\t\t}\r\n\t}\r\n});\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Week Agenda\", scheduler.assert);\r\n}","export default function(scheduler){\r\nscheduler.attachEvent(\"onLightBox\",function(){\r\n\tif (this._cover){\r\n\t\ttry{\r\n\t\t\tthis._cover.style.height = this.expanded ? \"100%\" : ((document.body.parentNode||document.body).scrollHeight+\"px\");\r\n\t\t} catch(e) {\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\nscheduler.form_blocks.select.set_value=function(node,value,ev){\r\n\tif (typeof value == \"undefined\" || value === \"\")\r\n\t\tvalue = (node.firstChild.options[0]||{}).value;\r\n\tnode.firstChild.value=value||\"\";\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t// scheduler.config.year_x = 4;\r\n\t// scheduler.config.year_y = 3;\r\n\t// scheduler.xy.year_top = 0;\r\n\r\n\tscheduler.templates.year_date = function(date) {\r\n\t\treturn scheduler.date.date_to_str(scheduler.locale.labels.year_tab + \" %Y\")(date);\r\n\t};\r\n\tscheduler.templates.year_month = scheduler.date.date_to_str(\"%F\");\r\n\tscheduler.templates.year_scale_date = scheduler.date.date_to_str(\"%D\");\r\n\tscheduler.templates.year_tooltip = function(s, e, ev) {\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst isYearMode = function() {\r\n\t\treturn scheduler._mode == \"year\";\r\n\t};\r\n\t\r\n\tconst getCellDate = function(node){\r\n\t\tvar day = scheduler.$domHelpers.closest(node, \"[data-cell-date]\");\r\n\t\tif(!day || !day.hasAttribute(\"data-cell-date\")) return null;\r\n\t\treturn scheduler.templates.parse_date(day.getAttribute(\"data-cell-date\"));\r\n\t};\r\n\r\n\t// dbl click hook for scheduler._on_dbl_click\r\n\tscheduler.dblclick_dhx_year_grid= function(e) {\r\n\t\tif (isYearMode()) {\r\n\t\t\tconst target = e.target;\r\n\t\t\tif(scheduler.$domHelpers.closest(target, \".dhx_before\") || scheduler.$domHelpers.closest(target, \".dhx_after\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconst date = getCellDate(target);\r\n\t\t\t\r\n\t\t\tif(date){\r\n\t\t\t\tconst start = date;\r\n\t\t\t\tconst end = this.date.add(start, 1, \"day\");\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create){\r\n\t\t\t\t\tthis.addEventNow(start.valueOf(), end.valueOf(), e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(){\r\n\t\tif (isYearMode())\r\n\t\t\tthis.year_view(true);\r\n\t});\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs) {\r\n\t\tif (!isYearMode()) return old.apply(this, arguments);\r\n\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\tthis._year_render_event(evs[i]);\r\n\t};\r\n\r\n\tvar clear = scheduler.clear_view;\r\n\tscheduler.clear_view = function() {\r\n\t\tif (!isYearMode()) return clear.apply(this, arguments);\r\n\t\tvar dates = scheduler._year_marked_cells,\r\n\t\t\tdiv = null;\r\n\t\tfor (var date in dates) {\r\n\t\t\tif (dates.hasOwnProperty(date)) {\r\n\t\t\t\tdiv = dates[date];\r\n\t\t\t\tdiv.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n\t\t\t\t// div.className = \"dhx_month_head\";\r\n\t\t\t\t// div.removeAttribute(\"date\");\r\n\t\t\t\t// div.removeAttribute(\"data-year-date\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._year_marked_cells = {};\r\n\t};\r\n\r\n\tscheduler._hideToolTip = function() {\r\n\t\tif (this._tooltip) {\r\n\t\t\tthis._tooltip.style.display = \"none\";\r\n\t\t\tthis._tooltip.date = new Date(9999, 1, 1);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._showToolTip = function(date, pos, e, src) {\r\n\t\tif (this._tooltip) {\r\n\t\t\tif (this._tooltip.date.valueOf() == date.valueOf()) return;\r\n\t\t\tthis._tooltip.innerHTML = \"\";\r\n\t\t} else {\r\n\t\t\tvar t = this._tooltip = document.createElement(\"div\");\r\n\t\t\tt.className = \"dhx_year_tooltip\";\r\n\t\t\tif (this.config.rtl) t.className += \" dhx_tooltip_rtl\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t\tt.addEventListener(\"click\", scheduler._click.dhx_cal_data);\r\n\t\t\tt.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(e.target.closest(`[${scheduler.config.event_attribute}]`)){\r\n\t\t\t\t\tconst id = e.target.closest(`[${scheduler.config.event_attribute}]`).getAttribute(scheduler.config.event_attribute);\r\n\t\t\t\t\tscheduler.showLightbox(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar evs = this.getEvents(date, this.date.add(date, 1, \"day\"));\r\n\t\tvar html = \"\";\r\n\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif(!this.filter_event(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\thtml += \"
\";\r\n\t\t}\r\n\r\n\t\tthis._tooltip.style.display = \"\";\r\n\t\tthis._tooltip.style.top = \"0px\";\r\n\r\n\r\n\t\tif (document.body.offsetWidth - pos.left - this._tooltip.offsetWidth < 0)\r\n\t\t\tthis._tooltip.style.left = pos.left - this._tooltip.offsetWidth + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.left = pos.left + src.offsetWidth + \"px\";\r\n\r\n\t\tthis._tooltip.date = date;\r\n\t\tthis._tooltip.innerHTML = html;\r\n\r\n\t\tif (document.body.offsetHeight - pos.top - this._tooltip.offsetHeight < 0)\r\n\t\t\tthis._tooltip.style.top = pos.top - this._tooltip.offsetHeight + src.offsetHeight + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.top = pos.top + \"px\";\r\n\t};\r\n\r\n\tscheduler._year_view_tooltip_handler = function(e){\r\n\t\tif (!isYearMode()) return;\r\n\r\n\t\tvar src = e.target || e.srcElement;\r\n\t\tif (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)\r\n\t\t\tsrc = src.parentNode;\r\n\t\tif (scheduler._getClassName(src).indexOf(\"dhx_year_event\") != -1)\r\n\t\t\tscheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute(\"data-year-date\")), scheduler.$domHelpers.getOffset(src), e, src);\r\n\t\telse\r\n\t\t\tscheduler._hideToolTip();\r\n\t};\r\n\tscheduler._init_year_tooltip = function() {\r\n\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t};\r\n\r\n\tscheduler._get_year_cell = function(d) {\r\n\t\tvar dateString = scheduler.templates.format_date(d);\r\n\t\tvar cells = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date=\"${dateString}\"]`);\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tif(!scheduler.$domHelpers.closest(cells[i], \".dhx_after, .dhx_before\")){\r\n\t\t\t\treturn cells[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tscheduler._year_marked_cells = {};\r\n\tscheduler._mark_year_date = function(date, event) {\r\n\t\tvar dateString = scheduler.templates.format_date(date);\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar ev_class = this.templates.event_class(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._year_marked_cells[dateString]) {\r\n\t\t\tcell.classList.add(\"dhx_year_event\", \"dhx_cal_datepicker_event\");// = \"dhx_month_head dhx_year_event\";\r\n\t\t\tcell.setAttribute(\"data-year-date\", dateString);\r\n\t\t\tcell.setAttribute(\"date\", dateString);\r\n\t\t\tscheduler._year_marked_cells[dateString] = cell;\r\n\t\t}\r\n\t\tif(ev_class){\r\n\t\t\tcell.classList.add(ev_class);\r\n\t\t}\r\n\t};\r\n\tscheduler._unmark_year_date = function(date) {\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcell.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n//\t\tcell.className = \"dhx_month_head\";\r\n\t};\r\n\tscheduler._year_render_event = function(event) {\r\n\t\tvar date = event.start_date;\r\n\t\tif (date.valueOf() < this._min_date.valueOf()){\r\n\t\t\tdate = this._min_date;\r\n\t\t} else {\r\n\t\t\tdate = this.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\twhile (date < event.end_date) {\r\n\t\t\tthis._mark_year_date(date, event);\r\n\t\t\tdate = this.date.add(date, 1, \"day\");\r\n\t\t\tif (date.valueOf() >= this._max_date.valueOf())\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.year_view = function(mode) {\r\n\r\n\t\tscheduler.set_sizes();\r\n\r\n\t\tscheduler._table_view = mode;\r\n\r\n\t\tif (this._load_mode && this._load()) return;\r\n\r\n\t\tif (mode) {\r\n\t\t\tscheduler._init_year_tooltip();\r\n\t\t\tscheduler._reset_year_scale();\r\n\t\t\tif (scheduler._load_mode && scheduler._load()){\r\n\t\t\t\tscheduler._render_wait = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tscheduler.render_view_data();\r\n\t\t} else {\r\n\t\t\tscheduler._hideToolTip();\r\n\t\t}\r\n\t};\r\n\tscheduler._reset_year_scale = function() {\r\n\t\tthis._cols = [];\r\n\t\tthis._colsS = {};\r\n\t\tvar week_starts = []; //start day of first week in each month\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar c = this.config;\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tvar dy = Math.floor((parseInt(dataArea.style.height) - scheduler.xy.year_top) / c.year_y);\r\n\t\tif (dy < 190) {\r\n\t\t\tdy = 190;\r\n\t\t}\r\n\r\n\t\tvar week_template = document.createElement(\"div\");\r\n\t\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\r\n\t\tthis._process_ignores(dummy_date, 7, \"day\", 1);\r\n\r\n\t\tfor (var i = 0; i < 7; i++) {\r\n\t\t\tif(!(this._ignores && this._ignores[i])) {\r\n\t\t\t\tthis._cols[i] = 'var(--dhx-scheduler-datepicker-cell-size)';\r\n\t\t\t\tthis._render_x_header(i, 0, dummy_date, week_template);\r\n\r\n\t\t\t}\r\n\t\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\t}\r\n\t\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\r\n\t\tfor(var i = 0; i < week_template.childNodes.length; i++){\r\n\t\t\tthis._waiAria.yearHeadCell(week_template.childNodes[i]);\r\n\t\t}\r\n\r\n\t\tvar sd = this.date[this._mode + \"_start\"](this.date.copy(this._date));\r\n\t\tvar ssd = sd;\r\n\t\tvar yearBox = null;\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\t\tfor (var i = 0; i < c.year_y; i++){\r\n\t\t\tfor (var j = 0; j < c.year_x; j++) {\r\n\t\t\t\tyearBox = document.createElement(\"div\");\r\n\t\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.innerHTML = \"
\" + week_template.innerHTML + \"
\";\r\n\r\n\t\t\t\tvar header = yearBox.querySelector(\".dhx_year_month\");\r\n\t\t\t\tvar grid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\t\tvar body = yearBox.querySelector(\".dhx_year_body\");\r\n\r\n\t\t\t\tvar headerId = scheduler.uid();\r\n\t\t\t\tthis._waiAria.yearHeader(header, headerId);\r\n\t\t\t\tthis._waiAria.yearGrid(grid, headerId);\r\n\r\n\r\n\t\t\t\theader.innerHTML = this.templates.year_month(sd);\r\n\r\n\r\n\r\n\t\t\t\tvar dd = this.date.week_start(sd);\r\n\t\t\t\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\t\t\t\tvar days = body.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var day = 0; day < days.length; day++){\r\n\t\t\t\t\tthis._waiAria.yearDayCell(days[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\t\tweek_starts[i * c.year_x + j] = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\t\t\t\tsd = this.date.add(sd, 1, \"month\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](ssd, sd, this._mode);\r\n\t\t}\r\n\r\n\t\tthis.week_starts = week_starts;\r\n\t\tweek_starts._month = ssd.getMonth();\r\n\t\tthis._min_date = ssd;\r\n\t\tthis._max_date = sd;\r\n\t};\r\n\r\n\tscheduler._reset_year_scale = function(){\r\n\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tlet yearStart = this.date.year_start(new Date(this._date));\r\n\t\t\r\n\t\tthis._min_date = this.date.week_start(new Date(yearStart));\r\n\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\r\n\t\tlet currentDate = yearStart;\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tlet yearBox = document.createElement(\"div\");\r\n\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.innerHTML = `
${this.templates.year_month(currentDate)}
\r\n\t\t\t
`;\r\n\r\n\t\t\tconst yearGrid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\tconst datepicker = scheduler._createDatePicker(null, {\r\n\t\t\t\tdate: currentDate,\r\n\t\t\t\tminWeeks: 6\r\n\t\t\t});\r\n\t\t\tdatepicker._renderDayGrid(yearGrid);\r\n\t\t\tdatepicker.destructor();\r\n\r\n\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\tcurrentDate = this.date.add(currentDate, 1, \"month\");\r\n\r\n\t\t}\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tlet lastDate = this.date.add(yearStart, 1, \"year\");\r\n\t\tif(lastDate.valueOf() != this.date.week_start(new Date(lastDate)).valueOf()){\r\n\t\t\tlastDate = this.date.week_start(new Date(lastDate));\r\n\t\t\tlastDate = this.date.add(lastDate, 1, \"week\");\r\n\t\t}\r\n\t\tthis._max_date = lastDate;\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](yearStart, lastDate, this._mode);\r\n\t\t}\r\n\t};\r\n\r\n\tvar getActionData = scheduler.getActionData;\r\n\tscheduler.getActionData = function(n_ev) {\r\n\t\tif(!isYearMode()){\r\n\t\t\treturn getActionData.apply(scheduler, arguments);\r\n\t\t}\r\n\t\t\r\n\t\tvar date = getCellDate(n_ev.target);\r\n\t\treturn {\r\n\t\t\tdate:date,\r\n\t\t\tsection:null\r\n\t\t};\r\n\t};\r\n\r\n\tvar locateEvent = scheduler._locate_event;\r\n\tscheduler._locate_event = function(node) {\r\n\t\tvar id = locateEvent.apply(scheduler, arguments);\r\n\t\tif(!id){\r\n\t\t\t\r\n\t\t\tvar date = getCellDate(node);\r\n\t\t\tif(!date) return null;\r\n\t\t\tvar evs = scheduler.getEvents(date, scheduler.date.add(date, 1, \"day\"));\r\n\t\t\tif(!evs.length) return null;\r\n\r\n\t\t\t//can be multiple events in the cell, return any single one\r\n\t\t\tid = evs[0].id;\r\n\t\t}\r\n\t\treturn id;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tscheduler._hideToolTip();\r\n\t});\r\n}","import SchedulerFactory from \"./scheduler_factory\";\r\nimport gplExtensions from \"./ext/extensions_gpl\";\r\n\r\nconst factory = new SchedulerFactory(gplExtensions);\r\n\r\nconst scheduler = factory.getSchedulerInstance();\r\nconst Scheduler = {\r\n\tplugin: scheduler.bind(factory.plugin, factory)\r\n};\r\n\r\nwindow.scheduler = scheduler;\r\nwindow.Scheduler = Scheduler;\r\n\r\nif(!window.$dhx) {\r\n\twindow.$dhx = {};\r\n}\r\n\r\nwindow.$dhx.scheduler = scheduler;\r\nwindow.$dhx.Scheduler = Scheduler;\r\n\r\nexport default scheduler;export { scheduler, Scheduler };","\r\n\r\nimport dhtmlxHook from \"./dhtmlx_hook\";\r\nimport \"./css/theme.less\";\r\ndhtmlxHook();\r\n\r\nimport global from \"./global\";\r\n\r\nimport factoryMethod from \"./scheduler_factory_method\";\r\nimport ExtensionsManager from \"./ext/extension_manager\";\r\n\r\nclass SchedulerFactory {\r\n\r\n\tconstructor (extensions) {\r\n\t\tthis._seed = 0;\r\n\t\tthis._schedulerPlugins = [];\r\n\t\tthis._bundledExtensions = extensions;\r\n\t\tthis._extensionsManager = new ExtensionsManager(extensions);\r\n\t}\r\n\r\n\tplugin(code) {\r\n\t\tthis._schedulerPlugins.push(code);\r\n\r\n\t\tif(global.scheduler){\r\n\t\t\tcode(global.scheduler);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSchedulerInstance(initConfig) {\r\n\t\tvar scheduler = factoryMethod(this._extensionsManager);\r\n\r\n\t\tfor (var i = 0; i < this._schedulerPlugins.length; i++) {\r\n\t\t\tthis._schedulerPlugins[i](scheduler);\r\n\t\t}\r\n\t\tscheduler._internal_id = this._seed++;\r\n\t\r\n\t\tif (this.$syncFactory){\r\n\t\t\tthis.$syncFactory(scheduler);\r\n\t\t}\r\n\r\n\t\tif(initConfig){\r\n\t\t\tthis._initFromConfig(scheduler, initConfig);\r\n\t\t}\r\n\r\n\t\treturn scheduler;\r\n\t}\r\n\r\n\t_initFromConfig(scheduler, initConfig){\r\n\t\tif(initConfig.plugins){\r\n\t\t\tscheduler.plugins(initConfig.plugins);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.config){\r\n\t\t\tscheduler.mixin(scheduler.config, initConfig.config, true);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.templates){\r\n\t\t\tscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\t\t\t\tscheduler.mixin(scheduler.templates, initConfig.templates, true);\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.events){\r\n\t\t\tfor(const event in initConfig.events){\r\n\t\t\t\tscheduler.attachEvent(event, initConfig.events[event]);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.locale){\r\n\t\t\tscheduler.i18n.setLocale(initConfig.locale);\r\n\t\t}\r\n\t\r\n\t\tif(Array.isArray(initConfig.calendars)){\r\n\t\t\tinitConfig.calendars.forEach(function(calendar){\r\n\t\t\t\tscheduler.addCalendar(calendar);\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.container){\r\n\t\t\tscheduler.init(initConfig.container);\r\n\t\t} else {\r\n\t\t\tscheduler.init();\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.data){\r\n\t\t\tif(typeof initConfig.data === \"string\"){\r\n\t\t\t\tscheduler.load(initConfig.data);\r\n\t\t\t}else{\r\n\t\t\t\tscheduler.parse(initConfig.data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}\r\n\r\nexport default SchedulerFactory;"],"names":["global$1","window","global","dragHighlightPos","scheduler","dndMarkers","dragStarted","eventNode","event","isEnabled","config","drag_highlight","markTimespan","checkViewName","viewName","viewObj","getView","layout","createMarkerConfig","configSettings","sectionId","style","top","left","marginLeft","sections","markerObject","start_date","end_date","css","html","date","add","createViewMarker","settings","markerConfigs","monthViewMarkersArray","weekDates","currDate","Date","valueOf","obj","push","week_start","cells","$container","querySelectorAll","event_attribute","id","i","length","cloneNode","unitMarkersArray","sectionPropertyName","y_property","map_to","multisection","formatedSections","String","split","section_delimiter","map","element","elems","columnViewMarkersArray","eventNodes","eventNodeClone","getAttribute","forEach","cfg","attachEvent","mode","e","getEvent","target","closest","getState","cascade_event_display","unselect","getActionData","section","unmarkTimespan","limitPlugin","mark_now","display_marked_timespans","overwrite_marked_timespans","dhx_time_block","default_timespan_type","get_resulting_options","days","zones","options","type","getZones","ev","timespans","day_index","day_value","timespan_type","s","containers","_props","matrix","container","property","view","linker","_add_timespan_zones","_get_blocked_zones","blockTime","addMarkedTimespan","unblockTime","deleteMarkedTimespan","checkInMarkedTimespan","on_overlap","res","temp_start_date","temp_end_date","_marked_timespans","date_part","getDay","eventStart","_get_zone_minutes","eventEnd","getDate","markerStart","markerEnd","checkLimitViolation","check_limits","c","evs","rec_type","_end_date","seriesEnd","limit_start","limit_end","complete_res","p","_timed","isOneDayEvent","allow","_drag_id","_drag_mode","setHours","setMinutes","checkEvent","callEvent","timeline_zones","blocked_timeline_zones","this","_get_relevant_blocked_zones","resultZones","concat","_mark_now","hide","dhx_now_time","_els","now","_currentDate","_remove_mark_now","_max_date","_min_date","getHours","first_hour","last_hour","locate_holder_day","_append_mark_now","zone_start","_table_view","_mode","start_index","end_index","units_l","size","position","r_divs","t_day","t_div","_render_marked_timespan","els","div","parent","parentNode","removeChild","getMinutes","_prepare_timespan_options","r_configs","temp_configs","Array","t_days","slice","cloned_config","_lame_clone","apply","invert_zones","invertZones","uid","view_key","hasOwnProperty","ids","t_config","_lame_copy","k","c_config","t_sd","t_ed","zone_end","_get_dates_by_index","index","start","end","dates","start_day","delta","t_date","_get_css_classes_by_config","css_classes","join","_get_block_by_config","block","document","createElement","innerHTML","appendChild","area","day","blocks","min_date","max_date","date_to_display","min_day","areas","d","_scales","sday","_cols","_ignores","block_proto","className","height","width","order","inner_index","locate_holder","Math","max","min","all_hours_height","hour_size_px","hour_ms","round","_mark_timespans","data","divs","_on_scale_add_marker","len","childNodes","firstChild","_getClassName","indexOf","configuration","Error","rebuild_els","get_elements","timespans_ids","_marked_timespans_ids","timespan_types","_marked_timespans_types","_addMarkerTimespanConfig","unit_id","timespans_view","day_configs","_array","configs","current_zones","resulting_zones","c_zone_start","c_zone_end","isLast","offset","splice","_subtract_timespan_zones","is_modified","_","_delete_marked_timespan_by_id","parent_array","_delete_marked_timespan_by_config","viewspans","_delete_marked_timespans_list","dayConfig","day_timespans","d_t","related_zones","arguments","undefined","types","t","typedConfig","_get_types_to_render","common","specific","types_to_render","_get_configs_to_render","units","unit","_get_unit_index","day_ind","unitsPerDay","floor","_date","key","unit_zones","unit_types","global_data","day_types","dblclick_dhx_marked_timespan","src","dblclick_create","addEventNow","createMethod","methods","isActive","disableMethod","methodName","dummyMethod","restoreMethod","disableMethods","methodsHash","call","restoreMethods","batchUpdatePayload","callback","console","error","$stateProvider","registerProvider","batch_update","noRedraw","dp_mode","call_dp","_dp","updateMode","setUpdateMode","calls","setModeDate","needRender","needUpdateView","repaintEvents","rememberModeDate","render","setCurrentView","updateView","render_data","render_view_data","updateEvent","sendData","initPlugins","deletedEvent","copy","undo_deleted","new_event","message","text","expire","addEvent","limit","batchUpdate","uidSeed","isDate","getFullYear","getMonth","utils","mixin","source","force","f","object","result","isArray","pop","Function","prototype","toString","constructor","Number","Boolean","varType","Object","defined","delay","timeout","timer","$cancelTimeout","$pending","args","setTimeout","clearTimeout","$execute","extend","cssClass","classList","itemTypes","rows_container","row","setAttribute","fix_tab_position","$firstTab","$lastTab","$segmentedTab","button","builtInButton","spacer","minicalendarButton","minicalendarDiv","click","$_eventAttached","isCalendarVisible","destroyCalendar","renderCalendar","navigation","handler","calendar","html_element","renderElement","renderer","rows","cols","value","align","justifyContent","prepareConfig","renderLayout","items","fragment","createDocumentFragment","next","_init_nav_bar","navBar","querySelector","_update_nav_bar","previousHeight","heightChanged","newHeight","xy","nav_height","unset_actions","set_actions","display","isAttachedNode","root","body","getWindowSize","w","innerWidth","documentElement","clientWidth","h","innerHeight","clientHeight","listenWindowResize","resizeDelay","oldSize","$destroyed","a","b","newSize","triggerSchedulerResize","$root","getComputedStyle","getPropertyValue","resizeWatcher","tabIndex","wai_aria_attributes","offsetHeight","previousWidth","offsetWidth","lowlevelResizeWatcher","contentWindow","EventHost","_silent_mode","listeners","_silentStart","createEventStorage","handlers","eventStorage","combinedResult","handlerResult","handlerId","once","originalHandler","removeEvent","clear","makeEventable","eventHost","eventName","toLowerCase","thisObject","bind","attachAll","name","eventArguments","handlerName","detachEvent","list","eventId","detachAllEvents","defaultDomEvents","el","addEventListener","eventRemove","removeEventListener","domEvents","eventScope","attach","capture","detach","detachAll","staticArray","_eventRemoveAll","_createDomEventScope","_trim","str","trim","replace","_isDate","_isObject","getClassName","node","baseVal","locateCss","classname","strict","trg","srcElement","ind","charAt","right","isVisible","visibility","currentStyle","hiddenSection","recurringSection","hasNonNegativeTabIndex","isNaN","hasHref","nodeName","loLowerCase","input","select","textarea","hasAttribute","isShadowDomSupported","head","createShadowRoot","attachShadow","getRootNode","ShadowRoot","host","dom_helpers","getAbsoluteLeft","htmlObject","getOffset","getAbsoluteTop","getOffsetSum","elem","parseInt","offsetTop","offsetLeft","offsetParent","getOffsetRect","box","getBoundingClientRect","test","navigator","userAgent","dummy","dummyBox","docElem","scrollTop","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","selector","insertAfter","newNode","referenceNode","nextSibling","insertBefore","remove","isChildOf","child","contains","getFocusableNodes","nodes","nodesArray","$position","sort","hasShadowParent","getActiveElement","activeElement","shadowRoot","getSelection","focusNode","getRelativeEventPosition","bottom","y","x","clientX","clientY","getTargetNode","tagName","composedPath","getNodePosition","Element","matches","msMatchesSelector","webkitMatchesSelector","parentElement","nodeType","isWindowAwailable","env","isIE","isOpera","isChrome","isKHTML","isFF","isIPad","search","isEdge","isNode","serialize$1","serialized","encodeURIComponent","JSON","stringify","generateStringToDate","format","utc","splt","mask","match","code","csp_str_to_date","set","temp","locale","month_short_hash","month_full_hash","UTC","cspEnabled","useCsp","csp","init","month_short","month_full","old","setSeconds","setMilliseconds","setTime","getTime","time_part","getTimezoneOffset","shift","start_on_monday","month_start","setDate","year_start","setMonth","day_start","_add_days","inc","ndate","rest","hours","setYear","to_fixed","num","date_to_str","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","day_full","getUTCHours","getUTCMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","getISOWeek","str_to_date","exactFormat","stringToDateMethod","parseExactFormat","yyyyMMddhhIIss","MMddyyyyhhIIss","ddMMyyyyhhIIss","ISO8601","parseYMD","parseMDY","parseDMY","dateString","parse_exact_format","datestr","nday","first_thursday","year_number","ordinal_date","convert_to_utc","getSerializator","_events","_loaded","_load","url","from","_load_url","to","prevent_cache","_load_mode","lf","templates","load_format","cache_line","temp_to","ajax","get","ajaxCallback","response","on_load","_parsers","xml","canParse","xhr","responseXML","xmlDoc","parse","responseText","topElement","xmltop","loader","csrfToken","dhtmlx","security_key","opts","xpath","arr","serverList","itms","j","attrs","attributes","label","attr","nodeValue","ud","udx","_xmlNodeToJSON","_userdata","_init_event","json","err","events","dhx_security","collections","collections_loaded","collection","option","option_key","ical","RegExp","c_start","c_end","incoming","event_r","e_start","e_end","exec","param","param_r","parse_param","substr","parse_date","dh","dm","utcMark","dy","dn","dd","server_utc","foundParser","parser","_process","status","_process_loading","_loading","_not_render","_render_wait","_after_call","_tagvalue","_init_date","_helpers","parseDate","getSerializableData","createSerializator","serialize","dataset","allEvents","exportedEvent","exportValue","rawValue","xml_format","format_date","load","setLoadMode","array","show_loading","_x","_y","_obj","_init_touch_events","touch","MSStream","platform","maxTouchPoints","scroll_width","_mobile","touchEventsSupported","createEvent","_touch_events","touches","pageX","pageY","PointerEvent","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","names","accessor","ignore","tracker","drag_mode","scroll_mode","action_mode","dblclicktime","attachTouchEvent","_is_lightbox_open","passive","drag_cancel","_hide_global_tip","_on_mouse_up","_temp_touch_block","_drag_pos","_pointerDragId","acc","dnd","timeline","original_render","drag_id","getEvents","_sorder","_count","_on_mouse_move","preventDefault","cancelBubble","_update_global_tip","abs","fake_event","pointerId","_click","dhx_cal_data","_on_dbl_click","_block_next_stop","touch_drag","actTask","_locate_event","fakeTask","sourceTask","_ignore_next_click","previousSibling","_on_mouse_down","for_rendered","_rendered","touch_tip","_show_global_tip","touch_swipe_dates","s_ev","e_ev","step","max_dy","scrollable","dx","dhx_cal_next_button","dhx_cal_prev_button","toptip","_global_tip","time","event_header","day_date","labels","drag_to_create","drag_to_move","calculatedMaterial","cachedBorderBoxValue","checkIfBorderBoxStyling","_is_material_skin","probe","boxSizing","refreshAfterLoad","_border_box_events","oldStyling","flatSkinHourScale","_addThemeClass","skin","_skin_settings","use_select_menu_space","wide_form","displayed_event_color","displayed_event_text_color","_skin_xy","lightbox_additional_height","bar_height","_build_skin_info","clearInterval","monitorIntervalId","setInterval","csstheme","setSkin","monitorThemeChange","styles","themeVar","themeName","isCssVarTheme","cssValues","oldMaterialTheme","links","getElementsByTagName","href","_theme_info","theme","cssVarTheme","values","themeVariables","_configure","col","_skin_init","hour_scale","hour_date","_old_month_day","month_day","old_month_day","dhx_cal_today_button","tab","header","tabs","specialTabs","tabName","find","filter","firstTab","reverse","DataProcessorEvents","dp","$scheduler","$dp","_dataProcessorHandlers","_validId","setUpdated","z","_new_event","_in_progress","_invalid","updatedRows","_waitMode","_update_callback","upd","setUserData","action_param","deleteEvent","_add_rec_marker","DataProcessor","serverProcessorURL","serverProcessor","autoUpdate","_tMode","_headers","_payload","post_delim","messages","updated","inserted","deleted","invalid","invalid_cell","enableUTFencoding","eventable","boxAttribute","_dhx_msg_cfg","usercall","modalBox","modal_key","which","keyCode","messageBox","keyboard","domHelpers","modality","cover","classValue","buttonAriaAttrs","_waiAria","messageButtonAttrString","getFirstDefined","_createBox","ok","cancel","contentId","messageModalAttr","inner","title","content","message_ok","message_cancel","buttons","btn","getElementById","hidden","focus","alertPopup","confirmPopup","boxPopup","box_params","params","focusable","messageInfoAttr","timers","pull","seed","hideAll","popups","alert","confirm","modalbox","setTransactionMode","total","headers","payload","_tSend","_endnm","_serializeAsJson","_router","router","escape","_utf","setDataColumns","val","_columns","getSyncState","enableDataNames","enablePartialDataSend","_changed","master","rowId","state","findRow","existing","getUserData","set_invalid","is_invalid","markRow","_methods","details","getActionByState","checkBeforeUpdate","editStop","sendAllData","_beforeSendData","_getRowData","_sendData","_serializeAsJSON","serialize_one","stack","keys","pref","_applyPayload","urlSeparator","dataToSend","self","queryParams","afterUpdate","urlParams","_user","_cleanupArgumentsBeforeSend","method","preprocessedData","_cleanupItemBeforeSend","action","query","_onResolvedCreateUpdate","tag","resultState","setRequestHeader","sid","tid","afterUpdateCallback","routerMode","actionPromise","create","delete","update","then","catch","valid","_forEachUpdatedRow","_getAllData","out","has_one","pattern","defineAction","_uActions","btag","marker","correct","originalSid","_errorResponse","cleanUpdate","_setDefaultTransactionMode","_serverProcessor","that","finalizeUpdate","atag","_initialized","_dp_init","_is_virtual_event","_set_event_text_style","r","cssText","event_updated","rec_pattern","_dp_change_event_id","new_id","changeEventId","_dp_hook_delete","setDp","dataProcessorEvents","_dataprocessor","setOnAfterUpdate","setOnBeforeUpdateHandler","func","setAutoUpdate","interval","user","_need_update","_update_busy","xml_node","afterAutoUpdate","fullSync","intervalId","loadUpdate","getUpdates","_getXmlNodeValue","version","vers","updates","destructor","processedData","updatedItem","output","item","processedItem","prop","formatDate","_prepareItemForJson","_prepareItemForForm","_prepareDataItem","dataItem","ar","day_tab","week_tab","month_tab","icon_save","icon_cancel","icon_details","icon_edit","icon_delete","confirm_closing","confirm_deleting","section_description","section_time","full_day","confirm_recurring","section_recurring","button_recurring","button_recurring_open","button_edit_series","button_edit_occurrence","grid_tab","prev","year","month","hour","minute","repeat_radio_day","repeat_radio_week","repeat_radio_month","repeat_radio_year","repeat_radio_day_type","repeat_text_day_count","repeat_radio_day_type2","repeat_week","repeat_text_week_count","repeat_radio_month_type","repeat_radio_month_start","repeat_text_month_day","repeat_text_month_count","repeat_text_month_count2_before","repeat_text_month_count2_after","repeat_year_label","select_year_day2","repeat_text_year_day","select_year_month","repeat_radio_end","repeat_text_occurences_count","repeat_radio_end2","repeat_radio_end3","repeat_never","repeat_daily","repeat_workdays","repeat_weekly","repeat_monthly","repeat_yearly","repeat_custom","repeat_freq_day","repeat_freq_week","repeat_freq_month","repeat_freq_year","repeat_on_date","repeat_ends","month_for_recurring","day_for_recurring","be","agenda_tab","description","year_tab","week_agenda_tab","ca","cn","cs","da","de","en","es","fi","fr","he","hu","it","jp","LocaleManager","_locales","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","DatePicker","modes","currentRange","eventDates","currentModeIndex","onStateChangeHandlers","_domEvents","onStateChange","oldState","newState","_notifyStateChange","direction","newDate","setFullYear","setState","newIndex","backwardArrow","monthLabel","innerText","toLocaleString","startYear","_toggleMode","forwardArrow","_adjustDate","_renderCalendarHeader","dataContainer","_renderDayGrid","_renderMonthGrid","_renderYearGrid","daysOfWeekContainer","currentDate","maxDate","labelFormat","dayElement","weeks","currWeek","minWeeks","minSchedulerDate","maxSchedulerDate","eventDaysTable","reduce","_renderDayGridHeader","firstDate","monthStart","monthEnd","lastDate","currentCalDate","_weeksBetween","dayGridContainer","dateCell","wrapper","months","formatLabel","monthElement","doneArea","doneBtn","yearElement","factoryMethod","extensionManager","stateProviders","internal","provider","unregisterProvider","commonViews","agenda","grid","week_agenda","anythingElse","requiredExtensions","_commonErrorMessages","unknownView","relatedExtension","collapsedContainer","createTimelineView","createUnitsView","createGridView","exportToPNG","exportToPDF","nav_bar","_detachDomEvent","_init_once","scheduler_resize_listener","hasSchedulerMarkup","wai_aria_application_role","views","_grid","log","rtl","_scroll","init_templates","set_sizes","$initialized","min_event_height","scale_width","scale_height","month_scale_height","menu_width","margin_top","margin_left","editor_width","month_head_height","event_header_height","edit_save","edit_cancel","functor","scale_x","materialScalePlaceholder","set_xy","_lightbox","_setLbPosition","_data_width","prepareValue","prepared","class_name","attr_value","labelAttr","domEventsScope","getDaysDifference","startDate","endDate","differenceInDays","_select_id","_close_not_saved","previousSelection","editor_id","_edit_id","lightbox_id","_lightbox_id","select_id","expanded","readonly","icon","def_step","dhx_cal_tab","deprecated_name","substring","_dhtmlx_confirm","title_confirm_deleting","edit","save","showLightbox","form","base","duration","event_duration","time_step","start_hour","_drag_event","details_on_dblclick","viewHandler","_get_column_index","x_pos","column","_week_indexes_from_pos","pos","ceil","_mouse_coords","$env","_colsS","$domHelpers","dataArea","heights","_ignores_detected","preserve_length","_event_length","_get_real_event_length","x_step","x_unit","timestamp","confirmationText","title_confirm_closing","positive_closing","_correct_shift","back","_is_pos_changed","old_pos","new_pos","diff","old_val","new_val","has_moved","_correct_drag_start_date","_start_correction","_end_correction","_get_fictional_event_length","_correct_drag_end_date","mousedownPos","_get_date_from_pos","_drag_start","fields","timeStep","custom","_dragEventBody","_move_event_shift","resize_date","_drag_from_start","resize_from_start","end_day_start","end_day_date","firstHour","maxY","precisePos","minDate","preciseDate","cursor","new_end","new_start","limit_drag_out","all_timed","_get_section_view","_get_event_sday","_allow_dnd","update_render","sx","update_view","drag_event_body","_get_private_properties","_clear_temporary_properties","clean","flagged_event","initial","current_state","moved","_dhx_changed","is_new","edit_on_create","details_on_create","_trigger_dyn_loading","_reset_ignores","_reset_scale","isViewExists","_set_aria_buttons_attrs","buttonGroups","group","headerButtonsAttributes","icon_form","oldClass","newClass","multidayScroll","dhx_multi_day","prev_scroll","preserve_scroll","_dy_shift","headerToggleState","_render_x_header","offset_top","left_border","columnHeaderText","dayHeaderAttr","_get_columns_num","count","count_n","_get_timeunit_start","_get_view_end","ed","_calc_scale_sizes","summ","_process_ignores","realcount","_set_scale_col_size","_render_scales","data_area","sd","today","scales","cls","firstHalf","slotDate","htmlContent","time_slot_text","time_slot_class","secondHalf","week_date_class","dayColumnAttr","_getNavDateElement","drag_resize","drag_move","navBarDateStr","scaleElement","navBarDateAttr","_reset_month_scale","_reset_hours_scale","multi_day","c1","totalWidth","col_length","hiddenWidth","c2","cc","hourScaleAttr","scroll_hour","now_date","n","preserve","ign_date","_render_month_scale","view_start","cd","tdwidths","cell_width","getCellHeight","cellheight","table","cell","month_date_class","body_class","head_class","monthCellAttr","cellHead","cellBody","bf1","getLabel","lightbox","updateCollection","list_name","resetLightbox","hideCover","cache","n_ev","_focus","endColumnIndex","eventLength","startColumnIndex","_get_date_index","last_column","check","excludedDuration","intervalStart","intervalEnd","leftCellCutOffStart","leftCellCutOffEnd","rightCellCutOffStart","rightCellCutOffEnd","ev_length","dir","per_day","end_slot","fd","start_slot","_get_section_property","_is_initialized","htmlTags","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","setAttributes","role","getHeaderCellAttr","eventAttr","_eventCommonAttr","event_text","$dataprocessor_class","setEventBarAttr","_getAttributes","attributeSetter","arg","eventBarAttrString","agendaHeadAttrString","agendaHeadDateString","agendaHeadDescriptionString","agendaDataAttrString","agendaEventAttrString","agendaDetailsBtnString","gridAttrString","gridRowAttrString","gridCellAttrString","mapAttrString","mapRowAttrString","mapDetailsBtnString","minicalHeader","headerId","minicalGrid","minicalRow","minicalDayCell","selected","minicalHeadCell","weekAgendaDayCell","weekAgendaEvent","lightboxHiddenAttr","lightboxVisibleAttr","lightboxSectionButtonAttrString","tabindex","yearHeader","yearGrid","yearHeadCell","yearRow","yearDayCell","lightboxAttr","lightboxButtonAttrString","buttonName","eventMenuAttrString","iconName","lightboxHeader","headerText","lightboxSelectAttrString","time_option","buttonLabel","quickInfoAttr","quickInfoHeaderAttrString","quickInfoHeader","quickInfoButtonAttrString","tooltipAttr","tooltipVisibleAttr","tooltipHiddenAttr","dom","assert","show_errors","_createDatePicker","_getFocusableNodes","_locate_css","messageApi","$","counter","Promise","clearAll","createConfig","async","serializeRequestParams","DOMParser","ActiveXObject","loadXML","parseFromString","tagname","xpathExp","docObj","selectNodes","first","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","_call","onLoad","getSync","put","postData","del","post","postSync","resolve","reject","XMLHttpRequest","isQt","readyState","filePath","open","toUpperCase","send","$ajax","default_date","month_date","load_date","week_date","date_format","api_date","day_column_padding","drag_create","resize_month_events","resize_month_timed","responsive_lightbox","separate_short_events","cascade_event_count","cascade_event_margin","multi_day_height_limit","drag_lightbox","quick_info_detached","icons_edit","icons_select","buttons_left","buttons_right","highlight_displayed_event","ajax_error","delay_render","timeline_swap_resize","$initial","xml_date","d1","d2","day_scale_date","month_scale_date","week_scale_date","time_picker","event_date","event_class","event_bar_date","event_bar_text","month_events_link","drag_marker_class","drag_marker_content","tooltip_date_format","tooltip_text","calendar_month","calendar_scale_date","calendar_date","calendar_time","clear_view","extra_data","silent","setEvent","hash","create_getter","create_setter","is_visible_events","clear_event","evFirstHour","evLastHour","lastHour","checkEndDate","get_visible_events","only_timed","filter_event","_is_main_area_event","hold","full","_recalculate_timed","tvs","tvd","_rendered_location","buffer","renderedLocation","_view_month_day","_render_month_link","toRender","_sday","_eday","curr","_sweek","_get_event_bar_pos","widt","x2","_pre_render_events","render_event_bar","max_evs","max_month_events","real","render_event","_get_first_visible_cell","hb","h_old","_pre_render_events_table","_pre_render_events_line","monthRows","cellHeight","cHeight","unshift","scrollHeight","scroll_fix","scale_settings","sum_width","row_heights","full_multi_day_height","used_multi_day_height","used_multi_day_height_css","multi_day_section","multi_day_icon","overflowY","datePart","_get_event_mapped_end_date","ev_duration","_min_mapped_duration","evs_originals","sh","eh","_inner","t_ev","slot_index","sorderSet","_is_sorder","_max_sorder","max_count","_copy_event","_time_order","_is_any_multiday_cell_visible","isAnyCellVisible","checkDate","noCells","lastDayEnd","weekCellIndex","chunks_info","first_chunk","last_chunk","chunk_info","locate_s","locate_e","_length","stack_line","_first_chunk","_last_chunk","_copy_dummy","_y_from_date","sm","_calc_event_y","min_height","em","parentWidth","menu","menu_offset","pos_y","ev_count","ev_sorder","margin","_render_v_bar","_text_style","zIndex","color","setProperty","tplClass","_editor","shiftKey","ariaAttr","icons","icons_str","currentIcon","textColor","highlightEventPosition","contentA","contentB","cse","boxWidth","renderEvent","inner_html","footer_class","_drag_resize","past","_get_dnd_order","ev_height","max_height","_orig_sorder","evTop","columns","y_event_offset","resize_handle","resizable","left_chunk","right_chunk","resize_left","resize_right","timed","bg_color","style_text","_edit_stop_event","getRenderedEvent","rendered_events","rendered_event","showEvent","original_color","original_text_color","getSectionTop","posFromDate","_smartRenderingEnabled","restoreOriginalColors","scrollTo","_append_drag_marker","m","scale","lastChild","_update_marker_position","getLightboxRoot","cspEnvironment","salesforceEnvironment","_lightbox_controls","formSection","getLightbox","getValue","form_blocks","get_value","setValue","set_value","get_template_control","control","get_select_control","get_textarea_control","get_time_control","defaults","template","sns","placeholder","_get_input","_dhx_onchange","onchange","time_format","_time_format_order","dt","last","limit_time_select","selectBoxClass","range","start_year","end_year","year_range","tdate","_time_values","ariaAttrs","_full_day","checked","disabled","_fill_lightbox_select","auto_end_date","_update_lightbox_select","time_values","direct_value","fixed_value","value_found","t_v","selectedIndex","original","showCover","show_cover","_cover","_fill_lightbox","lightbox_header","headerContent","headerDate","headerTitle","current_sns","_get_lightbox_section_node","default_value","_lightbox_out","_empty_lightbox","hide_lightbox","endLightbox","hide_cover","_move_while_dnd","_finish_dnd","save_lightbox","startLightbox","_custom_lightbox","_temp_lightbox","cancel_lightbox","hideLightbox","_init_lightbox_events","buttonTarget","sectionButton","button_click","readonly_active","setLightboxSize","_init_dnd_events","_dnd_start_lb","dhx_unselectable","lb","_lb_start","_ready_to_dnd","recurring","_lightbox_template","label_name","ds","t_ds","_bindLightboxLabels","inputBlock","fallback","inputId","old_id","getRootView","hooks","didInsert","cmp","skins","jQuery","fn","dhx_scheduler","each","Scheduler","getSchedulerInstance","comp","update_view_timer","curr_view_timer","lazy_setCurrentView","oldDate","oldMode","updateFlags","lazy_updateView","ars","createDataProcessor","tMode","dhtmlxError","catchError","i18n","addLocale","setLocale","localeObject","getLocale","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","addPlugins","ext","activePlugins","plugins","extensionList","dependencies","priorities","extension","dep","dependencyName","orderA","orderB","treetimeline","daytimeline","outerdrag","legacy","plugin","getExtension","ExtensionsManager","_extensions","attaches","attachScheduler","_genStr","attachObject","vs","av","sched","schedId","setSizes","_viewRestore","notImplemented","modals","modalsStack","isModal","afterPopup","trapFocus","currentTarget","$keyboardNavigation","_keyNavMessagePopup","focusElement","backupFocus","key_nav_legacy","_temp_key_scope","key_nav","_pasteDate","_pasteSection","isCopy","trackMousePosition","mousePointer","keyNavPointer","elementFromPoint","dispatcher","copyEvent","_make_pasted_event","event_pid","event_length","isMultisectionEvent","_do_paste","is_copy","modified_ev","original_ev","_is_key_nav_active","ctrlKey","metaKey","_buffer_event","_key_nav_copy_paste","getActiveNode","new_ev","scheduler_handlers","attachSchedulerHandlers","waitCall","keyDownHandler","focusHandler","keepScrollPosition","focusGlobalNode","enable","reFocusActiveNode","activeNode","isValid","MinicalButton","MinicalCell","mousedownHandler","dataAreaClick","listOfScales","some","Event","TimeSlot","nextSlot","setActiveNode","removeAttribute","evNode","prevState","lastStart","lastEnd","lastSection","getNode","GoogleMapAdapter","_markers","zoom","zoom_after_resolve","initial_zoom","lat","lng","setCenter","setZoom","error_position","google","maps","trigger","mapOptions","center","initial_position","mapId","scrollwheel","mapTypeId","Map","__gm","messageOverlay","outerContainer","setOptions","addListener","geocoder","Geocoder","point","latLng","geocode","results","GeocoderStatus","OK","geometry","location","event_location","formatted_address","clearInstanceListeners","AdvancedMarkerElement","importLibrary","mapView","createMarker","setMap","infoWindow","close","InfoWindow","maxWidth","info_window_max_width","setContent","map_info_content","anchor","markerInfo","setVisible","setPosition","latlng","LatLng","latitude","longitude","string","address","OpenStreetMapAdapter","openPopup","closeTooltip","setView","mapWrapper","L","tileLayer","addTo","on","fetch","country","myIcon","iconUrl","iconSize","shadowSize","iconAnchor","shadowAnchor","popupConfig","minWidth","markerPopup","popup","tooltip","markerConfig","bindPopup","bindTooltip","removeLayer","setLatLng","lon","MapboxAdapter","getPopup","isOpen","togglePopup","mapboxgl","accessToken","lngLat","features","place_name","Popup","focusAfterOpen","setMaxWidth","setHTML","Marker","setLngLat","setPopup","ALL_WEEKDAYS","Weekday","weekday","fromStr","nth","equals","other","getJsWeekday","isPresent","isNumber","isWeekdayStr","includes","rang","repeat","times","padStart","targetLength","padString","sep","splits","pymod","divmod","mod","empty","notEmpty","datetime","MONTH_DAYS","ONE_DAY","MAXYEAR","ORDINAL_BASE","PY_WEEKDAYS","isLeapYear","isValidDate","toOrdinal","date2","differencems","fromOrdinal","ordinal","getMonthDays","getWeekday","monthRange","combine","getMilliseconds","clone","cloneDates","clones","timeToUntilString","untilStringToDate","until","bits","dateTZtoISO8601","timeZone","IterResult","_result","before","after","accept","tooEarly","tooLate","extendStatics","setPrototypeOf","__proto__","__extends","TypeError","__","__assign","assign","__spreadArray","pack","l","Frequency","CallbackIterResult","_super","iterator","_this","ENGLISH","dayNames","monthNames","tokens","SKIP","number","numberAsText","every","at","the","second","third","for","monday","tuesday","wednesday","thursday","friday","saturday","sunday","january","february","march","april","may","june","july","august","september","october","november","december","comma","defaultGetText","defaultDateFormatter","ToText","rrule","gettext","language","dateFormatter","origOptions","bymonthday","bynmonthday","byweekday","allWeeks","someWeeks","isWeekdays","isEveryDay","sortWeekDays","isFullyConvertible","freq","IMPLEMENTED","RRule","FREQUENCIES","plural","HOURLY","MINUTELY","DAILY","bymonth","_bymonth","_bymonthday","_byweekday","byhour","_byhour","WEEKLY","MONTHLY","YEARLY","byyearday","byweekno","weekdaytext","monthtext","npos","wday","finalDelim","delim","o","realCallback","delimiter","finalDelimiter","Parser","rules","done","nextSymbol","isDone","symbol","best","bestSymbol","name_1","v","acceptNumber","expect","parseText","ttr","AT","F","MO","TU","WE","TH","FR","ON","wkd","decodeWKD","decodeNTH","decodeM","freqIsDailyOrGreater","fromText","Time","millisecond","DateTime","fromDate","getYear","addYears","years","addMonths","yearDiv","monthMod","addWeekly","wkst","fixDay","addDaily","addHours","filtered","_a","dayDiv","hourMod","addMinutes","minutes","byminute","hourDiv","minuteMod","addSeconds","seconds","bysecond","minuteDiv","secondMod","daysinmonth","SECONDLY","initializeOptions","_i","keys_1","defaultKeys","parseOptions","DEFAULT_OPTIONS","byeaster","dtstart","bysetpos","bynweekday","parsedOptions","parseString","rfcString","parseLine","parseDtstart","line","dtstartWithZone","tzid","parseRrule","Days","parseIndividualNumber","optionKey","parts","SyntaxError","wdaypart","DateWithZone","RangeError","defineProperty","enumerable","configurable","isUTC","rezonedDate","localTimeZone","Intl","DateTimeFormat","resolvedOptions","dateInLocalTZ","tzOffset","optionsToString","outValue","buildDtstart","strValues","ruleString","argsMatch","Cache","all","between","_cacheAdd","what","_value","_cacheGet","cached","argsKeys","findCacheDiff","cachedObject","iterResult","M365MASK","M366MASK","M28","M29","M30","M31","MDAY366MASK","MDAY365MASK","NM28","NM29","NM30","NM31","NMDAY366MASK","NMDAY365MASK","M366RANGE","M365RANGE","WDAYMASK","wdaymask","rebuildYear","firstwkst","wyearlen","firstyday","yearlen","nextyearlen","yearordinal","yearweekday","mmask","mdaymask","nmdaymask","mrange","wnomask","no1wkst","numweeks","lnumweeks","lyearweekday","lno1wkst","lyearlen","weekst","Iterinfo","rebuild","lastyear","yearinfo","lastmonth","monthinfo","nwdaymask","ranges","eastermask","g","yearStart","ydayset","mdayset","wdayset","ddayset","htimeset","mtimeset","stimeset","getdayset","gettimeset","buildPoslist","timeset","ii","dayset","poslist","daypos","timepos","tmp","iter","emitResult","counterDate","millisecondModulo","removeFilteredDays","rezoneIfNeeded","currentDay","isFiltered","dayCounter","SA","SU","noCache","_cache","fromString","_iter","toText","isFullyConvertibleToText","unfold","forceset","compatible","parseInput","rrulevals","rdatevals","exrulevals","exdatevals","parsedDtstart","lines","_b","parms","rdateTzid","parseRDate","rrulestr","rset_1","RRuleSet","groomRruleOptions","rdate","exrule","exdate","rdateval","parm","createGetterSetter","fieldName","field","_rrule","field_1","_rdate","_exrule","_exdate","_exdateHash","_accept","evalExdate","zonedDate","_addRule","_addDate","rrules","exrules","rdates","exdates","_dtstart","rdatesToString","rrs","rule","Tooltip","_scheduler","_tooltipNode","_root","_isLikeMouseEvent","_calculateTooltipPosition","viewport","_getViewPortSize","tooltipNode","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","containerPos","scrollY","_getViewPort","scrollX","$event_data","$event","TooltipManager","_listeners","_initDelayedFunctions","delayHide","watchableTarget","eventTarget","targetNode","doOnMouseEnter","onmouseenter","touch_tooltip","onmouseleave","onmousemove","listener","cloneDomEvent","delayShow","utils.default","show","tooltip_timeout","tooltip_hide_timeout","gplExtensions","active_links","active_link_view","_active_link_click","s_d","do_wrapper","fullname","week_x","d_s","agenda_legacy","add_agenda_legacy","agenda_legacy_time","agenda_legacy_text","agenda_legacy_date","agenda_legacy_start","old_dblclick_dhx_cal_data","dblclick_dhx_cal_data","fill_agenda_tab","old_render_view_data","ev_class","agendaDetailsButtonAttr","agenda_time","agenda_text","_agendaScrollTop","agenda_area","dateElement","agenda_date","agenda_legacy_view","agenda_start","agenda_end","rowAttr","dateHeader","descriptionHeader","agenda_view","add_agenda","dayDateToStr","dayDowToStr","agenda_day","eventsInDays","anyEvents","renderDay","calendarEvent","selectedId","all_timed_month","is_event_short","_safe_copy","proto","isPrototypeOf","old_prerender_events_line","old_prerender_events_table","prerender_events","ce","_virtual","isOvernightEvent","getNextDay","setDateTime","event_changed","re","redraw","next_day","old_get_visible_events","old_mode","old_date","oldUpdate","fullRedrawNeeded","collision","temp_section","_setTempSection","event_id","collision_limit","checkCollision","edited_ev","recurring_event_id","_roll_back_dates","_check_sections_collision","evs_dates","getRecDates","tevs","concurrent","_pid_time","checked_mode","single","container_autoresize","month_day_min_height","min_grid_size","min_map_size","old_pre_render_event","active","total_height","multiday_height","evl","_h_fix","navHeight","headerHeight","checked_divs","updateContainterHeight","is_repaint","checked_div","maxHeight","year_y","cur_height","week_agenda_scale_height","eventsContainer","_gridView","y_unit","getSectionHeight","scrollWidth","getScrollSize","callUpdate","conditionalUpdateContainerHeight","asyncRepaint","requestAnimationFrame","autosizeEnabled","$original_scroll_width","$original_section_autoheight","section_autoheight","cookie","getCookieName","_get_url_nav","urlNavigationPlugin","schedulerCookie","unescape","newMode","cookie_param","old_load","drag_between","editors","cached_options","resetCombo","_combo","DOMParent","combo","unload","DOMelem","dhx_globalImgPath","image_path","dhtmlXCombo","options_height","setOptionHeight","enableFilteringMode","filtering","script_path","selected_id","addOption","disable","selectOption","setComboValue","all_options","single_option","getIndexByValue","getSelectedValue","getSelectedText","vertical","radiobuttons","checked_value","isChecked","check_html","label_html","checkbox","unchecked_value","expand","fullscreen","toggleIcon","_position","_width","_height","_overflow","overflow","_maximize","collapse","directions","prev_margin","export_api","std","getElementSizes","sizes","dhtmlxAjax","dhx4","getTimeline","orientation","dpi","_export_html","_send_to_export","exportToICal","_serialize_plain","exportToExcel","_serialize_columns","_ajax_to_export","server","info","_plain_export_copy","$text","_create_hidden_form","submit","_hidden_export_form","_get_export_size","footer","A5","A4","A3","A2","A1","A0","dataX","cSize","parseFloat","smartRendering","initialSizes","smart_rendering","style_width","style_height","timeline_scrollable","timeline_smart_rendering","grid_view","html_templates","getScope","scopes","minicalButton","minicalDate","SchedulerNode","DataArea","timeSlot","searchMap","key_nav_step","addShortcut","shortcut","scope","scopeObject","getShortcutHandler","commands","shortcuts","findHandler","removeShortcut","unbind","disp","setDefaultNode","_compose","createCommand","modifiers","alt","ctrl","meta","expr","getExpressions","words","getWords","command","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","altKey","printableKey","fromCharCode","getHashFromEvent","getHash","junctionChar","term","combinationChar","backspace","enter","esc","space","up","down","home","pageup","pagedown","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","EventHandler","_handlers","doAction","returnValue","bindAll","initKeys","nextItem","currentFocus","currentIndex","renderMultiple","currentStart","currentEnd","_modes","_getMode","renderVerticalMarker","renderTimelineMarker","renderYearMarker","renderMonthMarker","weekAgenda","renderWeekAgendaMarker","renderAgendaMarker","dayColumns","addWaiAriaLabel","addDataAttributes","dateToStr","dateTimeLabel","sectionObject","markerDate","_wrapDiv","_get_year_cell","opacity","view_opts","round_position","_trace_x","_is_column_visible","start_pos","end_pos","set_date_part","tempStart","tempEnd","_timeline_getX","_section_height","_isRender","renderMonthCell","weekNumber","dayIndex","datatable","lineHeight","getDefaultNode","getMode","blur","_compareEvents","_pickEvent","startId","nextEventHandler","nextEvent","currEvent","visibleDates","nextEv","prevEventHandler","HeaderCell","getNodes","KeyNavNode","moveTo","compareTo","canStringifyThis","canStringifyThat","defaultCell","_getSection","_getNodes","defaultElement","isScrolledIntoView","eventBox","viewPort","idSelector","inlineEditor","getInlineEditor","_moveToSlot","slot","movingDate","getDefaultDate","_getDefaultSection","visibleTime","nowTime","showNowTime","findVisibleColumn","timeslot","_getMultisectionView","_getNextSection","nextIndex","defaultSlot","addMonthDate","nextMonthSlot","_alignTimeSlot","nextTimelineSlot","newPos","nextUnitsSlot","optionsCount","nextDaySlot","_moveDate","isBeforeLastHour","isStartDate","isAfterFirstHour","isInVisibleDayTime","oldStart","toNextDay","testEnd","nextWeekAgendaSlot","nextAgendaSlot","isDateVisible","nextDateColumn","current","tempSlot","extendSlot","extendUnitsSlot","extendTimelineSlot","extendMonthSlot","extendDaySlot","extendWeekAgendaSlot","extendGenericSlot","allowedDirections","moveDate","newDates","extendSlotDates","oldSlot","newSlot","dateDirection","scrollSlot","globalNode","_getGrid","_getNode","enabled","newRow","newCol","blurNode","editor","defaultPrevented","schedulerNode","_timeout","_minicalendars","isMinical","minicalendars","patchMinicalendar","focusMinical","minicalClick","rowIndex","cellIndex","td","renderMinical","cal","added","destroyMinical","_def_count","attachOnce","isSchedulerSelected","changeState","layer","layers","validId","_clearUpdateFlag","_cloneObj","_dataprocessors","_layers_zindex","initial_layer_zindex","isDefault","defaultLayer","showLayer","tlayer","toggleLayer","hideLayer","visible","getLayer","layer_name","native_event_object","noMenu","_evs_layer","_t_render_view_data","evs_layer","borderBox","borderBoxWidth","headerWidth","bodyWidth","footerWidth","bodyHeight","new_zIndex","filter_agenda","limit_view","_temp_limit_scope","om","od","nm","nd","isBlocked","date_end","resetDate","is_new_event","data_copy","native_object","_mark_now_timer","map_view","mapAdapter","eventHandlerIds","adapters","googleMap","openStreetMaps","mapbox","setupMapView","createAdapter","unmodifiedEvent","_eventLocationChanged","map_settings","resolve_event_location","_latLngUpdate","addEventWithLocation","updateEventMarker","newIdEvent","removeEventMarker","addEventMarker","onEventClick","coordinates","resolveAddress","map_view_provider","currentAdapter","resolve_user_location","view_provider","map_initial_position","map_error_position","map_date_width","map_icon_width","map_description_width","add_map","map_date","map_time","map_text","map_start","dblclick_dhx_map_area","map_initial_zoom","map_zoom_after_resolve","map_infowindow_max_width","map_resolve_user_location","map_type","map_resolve_event_location","fill_map_tab","_selected_event_id","ariaButtonAttr","clearEventMarkers","map_end","mapContainer","adapter","elem_id","marginRight","marginTop","destroy","initialize","geolocation","getCurrentPosition","coords","_updateEventLocation","_event_resolve_delay","ret","minical","minicalDomEvents","minicalendar","mark_events","_synced_minicalendars","_prev","is_refresh","_render_calendar","unmarkCalendar","cont","tpos","_get_def_cont","$dom","dateAttribute","markCalendar","_last_date","conf","markedDates","_markCalendarCurrentDate","sync","_on_xle_handler","updateCalendar","_created","_locateCalendar","weekNum","dat","dayCell","_week_template","week_template","dummy_date","_mini_cal_arrows","previous","ts","temp2","temp3","temp4","temp5","temp6","temp7","temp8","padding","weekHeader","move_minicalendar_date","css_classnames","css_texts","diffs","calendars","arrow","dayHeaders","dayCells","inputs","selects","inp","new_date","_update_minical_select","isFulldayEvent","_attach_action","_round_minutes","linkCalendar","datediff","dateNew","month_end","monthheight","old_s","multiselect","_children","_mark_inputs","_ids","script_url","divLoading","multisource","mvc","update_timer","use_id","sanitize","_finish_ext_load","_get_id","model","cid","backbone","toJSON","changes","queue","add_from_queue","Backbone","Collection","last_event","dragger","dhtmlDragAndDropObject","stopDrag","on_drop","sourceHtmlObject","dhtmlObject","targetHtmlObject","targetHtml","action_data","event_data","view_options","_locate_cell_timeline","addDragLanding","_drag","_dragIn","shtmlObject","_dragOut","DragControl","addDrop","onDrop","sourceDhtmlx","getMaster","onDragIn","pdf","html_regexp","newline_regexp","clean_html","x_norm","colsWidth","x_norm_event","is_left","dhx_cal_header","y_norm","get_style","de_day","de_week","xml_end","xml_top","profile","xml_body_header","dhx_cal_date","xh","xml_month_scale","xml_month","yh","xhs","second_scale","top_width","top_col","xml_body","colors","week_starts","_month","text_color","zx","zdx","left_norm","zy","zdy","e_type","dets","week","dy_copy","toXML","original_date","original_mode","temp_date","to_pdf","objects","getPDFData","toPDF","toPDFRange","quick_info","show_quick_info","clickedElementPosition","fitQIInsideWindow","quickInfoPopup","popupRect","offsetBottom","getPositionInsideScheduler","_$quickInfoHandler","eventElement","showQuickInfo","hiding_function","hideQuickInfo","quick_info_title","quick_info_content","quick_info_date","_quick_info_box_id","_get_event_counter_part","_quick_info_box","_init_quick_info","_fill_quick_data","_show_quick_info","cssTimeToMs","milliseconds","forced","qi","_x_scroll","dataPos","ontransitionend","_quick_info_onscroll_handler","$testmode","_qi_button_click","main","mainContent","originalRecurringSetValue","original_left_buttons","original_right_buttons","txt_replace","txts","txtt","readonly_form","forbidden_buttons","button_arrays","forbidden_button","button_array","originalForm","readonlyForm","_lightbox_r","clearMilliseconds","isSeries","old_add_event","groupExceptions","exceptions","original_start","_rec_temp","_rec_markers_pull","_rec_markers","_get_rec_marker","ch","_get_rec_markers","ev_id","_ignore_call","tev","_pid_changed","_is_modified_occurence","idTimestamp","nid","nev","sub","isEventFound","_start_date","showLightbox_rec","lightbox_recurring","pid","isVirtual","showSeries","title_confirm_recurring","get_visible_events_rec","repeat_date","old_update_event","toIcalString","getWeekdayOfMonth","dayOfWeek","dayOfMonth","dayNumber","non_render","maxCount","seriesExceptions","utcStart","parsedRRule","utcTo","repeatedDates","adjustedDate","visibleCount","eventDuration","exception","_fix_daylight_saving_date","recurrings","sev","occurence","include_end_by","recurring_workdays","jsDaysToRRULEDays","RruleDayNumsToJs","formatDayNumber","repeat_monthly_date","repeat_monthly_weekday","nthDayOfMonth","repeat_yearly_month_date","repeat_yearly_month_weekday","getRecValue","WORKDAYS","CUSTOM","monthRepeat","yearRepeat","formatFunc","endRule","NEVER","fillInDefaults","dayNum","dayLabel","dateOfMonth","nthWeekDayOfMonth","dateOfYear","nthWeekDayOfYear","countInput","ondateInput","endOptionSelect","formatter","repeat_date_of_end","dispatchEvent","getFirstSectionOfType","rec","_get_node","_outer_html","loc","_init_set_value","_ds","weekly","monthly","yearly","_rec_init_done","rf","blocked","rruleset","topOption","rruleObj","untilDate","customFreq","actual_dates","timeControl","getTimeSection","recurrence","_start","recurring_legacy","getRecurringSection","occurrence_timestamp_in_utc","outerHTML","_get_form_node","_get_node_value","_get_node_numeric_value","_set_node_value","hash_value","str_date_format","date_str","register_els","inps","change_current_view","set_end_rule","_get_repeat_code","get_rcode","str_date","transpose_type","get_numeric_value","repeat_precise","start_exists","transpose_day_week","set_rcode","_set_repeat_code","MouseEvent","elements","_toggle_block","_get_button","_get_form","backgroundPosition","transponse_size","day_week","originalMonth","newMonth","cor","cor2","cday","transposeRecurring","recurringParts","addRecurring","recurringStepDays","weekDays","seriesInstance","currentCount","origMonth","origYear","correctOverflowInstances","recurring_overflow_instances","startHour","ted","data_attributes","all_events","_serialize_json_value","toICal","full_day_format","tooltipManager","tooltips","tooltipFor","targetEventId","hideTooltip","s2d","d2s","select_event","wp","year_view","year_date","year_month","year_scale_date","year_tooltip","isYearMode","getCellDate","dblclick_dhx_year_grid","_year_render_event","_year_marked_cells","_hideToolTip","_tooltip","_showToolTip","_year_view_tooltip_handler","_init_year_tooltip","_mark_year_date","_unmark_year_date","_reset_year_scale","year_top","ssd","yearBox","year_x","datepicker","locateEvent","factory","extensions","_seed","_schedulerPlugins","_bundledExtensions","_extensionsManager","initConfig","_internal_id","$syncFactory","_initFromConfig","addCalendar","$dhx"],"mappings":"AAUA,MAAAA,KAPqB,OAAXC,SAAW,MACNA,SAEAC;ACNA,SAASC,GAAiBC,GACrC;AAAA,MAAIC,IAAa,CACbC,GAAAA,IAAAA,IACAC,IAAY,MACZC,IAAQ;AAEZ,WAASC,IAAAA;AACL,WAAOL,EAAUM,OAAOC,kBAAkBP,EAAUQ;AAAAA,EACvD;AAED,WAASC,EAAcC,GAAAA;AACnB,UAAMC,IAAUX,EAAUY,QAAQF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nkD,qBACpBD,GAAAA,KAAY,EACjBuC,QAAQ1hE,GAAU6e,KAAK0kG,GAAQ7hD,QAAQ6hD,EAAAA,EAAAA;AAGxC1jH,OAAOG,YAAYA,IACnBH,OAAOs/D,YAAYA,IAEft/D,OAAOqkH,SACVrkH,OAAOqkH,OAAO,KAGfrkH,OAAOqkH,KAAKlkH,YAAYA,IACxBH,OAAOqkH,KAAK/kD,YAAYA;","x_google_ignoreList":[84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111]}
\ No newline at end of file
+{"version":3,"file":"dhtmlxscheduler.es.js","sources":["../sources/global.js","../sources/plugins/drag_highlight_pos.js","../sources/plugins/limit.js","../sources/plugins/batch_update.js","../sources/plugins/index.js","../sources/plugins/undo_delete.js","../sources/core/utils/utils.js","../sources/core/nav_bar.js","../sources/core/scheduler_resize_listener.js","../sources/utils/eventable.js","../sources/core/utils/event.js","../sources/core/common.js","../sources/core/utils/scoped_event.js","../sources/core/utils/dom_helpers.js","../sources/utils/env.js","../sources/core/common/url_serialize.js","../sources/core/base.js","../sources/core/common/get_serializable_events.js","../sources/core/load.js","../sources/core/loaders/xml.js","../sources/core/loaders/json.js","../sources/core/loaders/ical.js","../sources/core/touch.js","../sources/core/skins.js","../sources/core/dataprocessor/dataprocessor_hooks.js","../sources/core/dataprocessor/dataprocessor.js","../sources/core/message.js","../sources/locale/locale_ar.js","../sources/locale/locale_be.js","../sources/locale/locale_ca.js","../sources/locale/locale_cn.js","../sources/locale/locale_cs.js","../sources/locale/locale_da.js","../sources/locale/locale_de.js","../sources/locale/locale_el.js","../sources/locale/locale_en.js","../sources/locale/locale_es.js","../sources/locale/locale_fi.js","../sources/locale/locale_fr.js","../sources/locale/locale_he.js","../sources/locale/locale_hu.js","../sources/locale/locale_id.js","../sources/locale/locale_it.js","../sources/locale/locale_jp.js","../sources/locale/locale_manager.js","../sources/locale/locale_nb.js","../sources/locale/locale_nl.js","../sources/locale/locale_no.js","../sources/locale/locale_pl.js","../sources/locale/locale_pt.js","../sources/locale/locale_ro.js","../sources/locale/locale_ru.js","../sources/locale/locale_si.js","../sources/locale/locale_sk.js","../sources/locale/locale_sv.js","../sources/locale/locale_tr.js","../sources/locale/locale_ua.js","../sources/core/datepicker.js","../sources/scheduler_factory_method.js","../sources/core/state.js","../sources/core/common_errors.js","../sources/core/scheduler.js","../sources/core/wai_aria.js","../sources/core/common/assert.js","../sources/core/jquery.js","../sources/core/destructor.js","../sources/core/utils/ajax.js","../sources/core/config.js","../sources/core/event.js","../sources/core/event_highlight.js","../sources/core/lightbox.js","../sources/core/dhtmlx/dhtmlx_suite_hooks.js","../sources/core/delay_render.js","../sources/core/connector.js","../sources/locale/index.js","../sources/ext/extension_manager.js","../sources/dhtmlx_hook.js","../sources/ext/restricted_extensions/not_implemented_extension.js","../sources/ext/keyboard_navigation/modals.js","../sources/ext/keyboard_navigation/key_nav_legacy.js","../sources/ext/keyboard_navigation/scheduler_handlers.js","../sources/ext/map_view/gMapAdapter.ts","../sources/ext/map_view/osmMapAdapter.ts","../sources/ext/map_view/mapboxAdapter.ts","../node_modules/rrule/dist/esm/weekday.js","../node_modules/rrule/dist/esm/helpers.js","../node_modules/rrule/dist/esm/dateutil.js","../node_modules/rrule/dist/esm/iterresult.js","../node_modules/rrule/node_modules/tslib/tslib.es6.mjs","../node_modules/rrule/dist/esm/callbackiterresult.js","../node_modules/rrule/dist/esm/types.js","../node_modules/rrule/dist/esm/nlp/i18n.js","../node_modules/rrule/dist/esm/nlp/totext.js","../node_modules/rrule/dist/esm/nlp/parsetext.js","../node_modules/rrule/dist/esm/nlp/index.js","../node_modules/rrule/dist/esm/datetime.js","../node_modules/rrule/dist/esm/parseoptions.js","../node_modules/rrule/dist/esm/parsestring.js","../node_modules/rrule/dist/esm/datewithzone.js","../node_modules/rrule/dist/esm/optionstostring.js","../node_modules/rrule/dist/esm/cache.js","../node_modules/rrule/dist/esm/masks.js","../node_modules/rrule/dist/esm/iterinfo/yearinfo.js","../node_modules/rrule/dist/esm/iterinfo/index.js","../node_modules/rrule/dist/esm/iterinfo/monthinfo.js","../node_modules/rrule/dist/esm/iterinfo/easter.js","../node_modules/rrule/dist/esm/iter/poslist.js","../node_modules/rrule/dist/esm/iter/index.js","../node_modules/rrule/dist/esm/rrule.js","../node_modules/rrule/dist/esm/rrulestr.js","../node_modules/rrule/dist/esm/rruleset.js","../node_modules/rrule/dist/esm/iterset.js","../sources/ext/tooltip/tooltip.ts","../sources/ext/tooltip/tooltipManager.ts","../sources/ext/extensions_gpl.js","../sources/ext/active_links.js","../sources/ext/agenda_legacy_view.js","../sources/ext/agenda.js","../sources/ext/all_timed.js","../sources/ext/collision.js","../sources/ext/container_autoresize.js","../sources/ext/cookie.js","../sources/ext/restricted_extensions/daytimeline.js","../sources/ext/restricted_extensions/drag_between.js","../sources/ext/editors.js","../sources/ext/expand.js","../sources/ext/export_api/index.js","../sources/ext/restricted_extensions/grid_view.js","../sources/ext/html_templates.js","../sources/ext/key_nav.js","../sources/ext/keyboard_navigation/common/keyboard_shortcuts.js","../sources/ext/keyboard_navigation/common/eventhandler.js","../sources/ext/keyboard_navigation/common/trap_modal_focus.js","../sources/ext/keyboard_navigation/marker.js","../sources/ext/keyboard_navigation/elements/scheduler_node.js","../sources/ext/keyboard_navigation/elements/nav_node.js","../sources/ext/keyboard_navigation/elements/header_cell.js","../sources/ext/keyboard_navigation/elements/event.js","../sources/ext/keyboard_navigation/elements/time_slot.js","../sources/ext/keyboard_navigation/elements/minical_button.js","../sources/ext/keyboard_navigation/elements/minical_cell.js","../sources/ext/keyboard_navigation/elements/data_area.js","../sources/ext/keyboard_navigation/core.js","../sources/ext/keyboard_navigation/minical_handlers.js","../sources/ext/layer.js","../sources/ext/limit.js","../sources/ext/map_view/index.ts","../sources/ext/minical.js","../sources/ext/monthheight.js","../sources/ext/restricted_extensions/multisection.js","../sources/ext/multiselect.js","../sources/ext/multisource.js","../sources/ext/mvc.js","../sources/ext/outerdrag.js","../sources/ext/pdf.js","../sources/ext/quick_info.js","../sources/ext/readonly.js","../sources/ext/recurring.js","../sources/ext/recurring_legacy.js","../sources/ext/serialize.js","../sources/ext/restricted_extensions/timeline.js","../sources/ext/tooltip/index.ts","../sources/ext/restricted_extensions/treetimeline.js","../sources/ext/restricted_extensions/units.js","../sources/ext/url.js","../sources/ext/restricted_extensions/week_agenda.js","../sources/ext/wp.js","../sources/ext/year_view.js","../sources/dhtmlxscheduler.gpl.js","../sources/scheduler_factory.js"],"sourcesContent":["\r\n/* eslint-disable no-restricted-globals */\r\nvar globalScope;\r\nif(typeof window !== \"undefined\"){\r\n\tglobalScope = window;\r\n}else{\r\n\tglobalScope = global;\r\n}\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default globalScope;","export default function dragHighlightPos(scheduler){\r\n let dndMarkers = [];\r\n let dragStarted = false;\r\n let eventNode = null;\r\n let event = null;\r\n\r\n function isEnabled() { \r\n return scheduler.config.drag_highlight && scheduler.markTimespan;\r\n }\r\n\r\n function checkViewName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj){\r\n return viewObj.layout;\r\n }\r\n return viewName;\r\n }\r\n\r\n function checkSectionPropertyName(viewName){\r\n const viewObj = scheduler.getView(viewName);\r\n if(viewObj.y_property){\r\n return viewObj.y_property;\r\n }\r\n if(viewObj.map_to){\r\n return viewObj.map_to;\r\n }\r\n }\r\n\r\n function setRequiredStylesToMarker(eventNode, layout){\r\n switch (layout) {\r\n case \"month\":\r\n eventNode.style.top = \"\";\r\n eventNode.style.left = \"\";\r\n break;\r\n case \"timeline\":\r\n eventNode.style.left = \"\";\r\n eventNode.style.marginLeft = \"1px\";\r\n break;\r\n default:\r\n eventNode.style.top = \"\";\r\n break;\r\n }\r\n }\r\n \r\n function createMarkerConfig(configSettings){\r\n const { event, layout, viewName, sectionId, eventNode } = configSettings;\r\n setRequiredStylesToMarker(eventNode, layout);\r\n const sections = {};\r\n let markerObject = {\r\n start_date: event.start_date,\r\n end_date: event.end_date,\r\n css: \"dhx_scheduler_dnd_marker\",\r\n html: eventNode\r\n };\r\n if (layout == \"timeline\" || layout == \"month\" ){\r\n // we need to set end date less than 24 hours of the views to avoid receiving multiple marktimespans\r\n markerObject = {...markerObject, end_date: scheduler.date.add(event.start_date, 1, 'minute')};\r\n }\r\n if (sectionId){\r\n sections[viewName] = sectionId;\r\n markerObject.sections = sections;\r\n }\r\n return markerObject;\r\n }\r\n\r\n function createViewMarker(settings){\r\n const { layout } = settings;\r\n let markerConfigs;\r\n switch (layout) {\r\n case \"month\": \r\n markerConfigs = getMonthViewMarkers(settings);\r\n break;\r\n case 'timeline':\r\n case 'units':\r\n markerConfigs = getTimelineAndUnitsViewMarkers(settings);\r\n break;\r\n default: \r\n markerConfigs = getColumnViewMarkers(settings);\r\n break;\r\n }\r\n markerConfigs.forEach((cfg) => {\r\n dndMarkers.push(scheduler.markTimespan(cfg));\r\n });\r\n }\r\n\r\n function getColumnViewMarkers(settings){\r\n const {event, layout, viewName, sectionId} = settings;\r\n let columnViewMarkersArray = [];\r\n let eventNodes = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']:not(.dhx_cal_select_menu):not(.dhx_drag_marker)`);\r\n if(eventNodes){\r\n for (let i = 0; i < eventNodes.length; i++) {\r\n let eventNodeClone = eventNodes[i].cloneNode(true);\r\n let startDate = new Date(+eventNodeClone.getAttribute(\"data-bar-start\"));\r\n let endDate = new Date(+eventNodeClone.getAttribute(\"data-bar-end\"));\r\n let dates = {start_date: startDate, end_date: endDate};\r\n const configSettings = {\r\n event: dates, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode:eventNodeClone\r\n };\r\n columnViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\t\r\n }\r\n return columnViewMarkersArray;\r\n }\r\n\r\n function getMonthViewMarkers(settings){\r\n let monthViewMarkersArray = [];\r\n const {event, layout, viewName, sectionId} = settings;\r\n const weekDates = [];\r\n let currDate = new Date(event.start_date);\r\n while(currDate.valueOf() < event.end_date.valueOf()){\r\n let obj = {start_date: currDate};\r\n weekDates.push(obj);\r\n currDate = scheduler.date.week_start(scheduler.date.add(currDate, 1, \"week\"));\r\n }\r\n let cells = scheduler.$container.querySelectorAll(`[${scheduler.config.event_attribute}='${event.id}']`);\r\n for (let i = 0; i < cells.length; i++) {\r\n const configSettings = {\r\n event: weekDates[i], \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode: cells[i].cloneNode(true)\r\n };\r\n monthViewMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n return monthViewMarkersArray;\r\n }\r\n\r\n function getTimelineAndUnitsViewMarkers(settings){\r\n let unitMarkersArray = [];\r\n const {event, layout, viewName, eventNode} = settings;\r\n let sectionPropertyName = checkSectionPropertyName(viewName);\r\n if (sectionPropertyName){\r\n const sections = String(event[sectionPropertyName]).split(scheduler.config.section_delimiter);\r\n const formatedSections = sections.map(element => String(element));\r\n const elems = [];\r\n for (let i = 0; i < formatedSections.length; i++) {\r\n elems[i] = eventNode.cloneNode(true);\r\n const configSettings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId: formatedSections[i],\r\n eventNode: elems[i]\r\n };\r\n unitMarkersArray.push(createMarkerConfig(configSettings));\r\n }\r\n }\r\n return unitMarkersArray;\r\n }\r\n \r\n scheduler.attachEvent(\"onBeforeDrag\", function (id, mode, e){\r\n if (isEnabled()) {\r\n dragStarted = true;\r\n event = scheduler.getEvent(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n // to avoid incorrect eventNode and marker creation when scheduler.config.cascade_event_display included\r\n if (layout == \"units\" && scheduler.config.cascade_event_display ) {\r\n scheduler.unselect(id);\r\n eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n }\r\n }\r\n return true;\r\n });\r\n\r\n scheduler.attachEvent(\"onEventDrag\", function (id, mode, e){\r\n if(dragStarted && isEnabled()){\r\n dragStarted = false;// insert element only once after dnd start\r\n const viewName = scheduler.getState().mode;\r\n const layout = checkViewName(viewName);\r\n const sectionId = scheduler.getActionData(e).section;\r\n if (event) {\r\n const settings = {\r\n event, \r\n layout, \r\n viewName, \r\n sectionId, \r\n eventNode\r\n };\r\n createViewMarker(settings);\r\n }\r\n }\r\n });\r\n\r\n scheduler.attachEvent(\"onDragEnd\", function(id, mode, e){\r\n for (let i = 0; i < dndMarkers.length; i++) {\r\n scheduler.unmarkTimespan(dndMarkers[i]);\r\n }\r\n dndMarkers = [];\r\n eventNode = null;\r\n event = null;\r\n });\r\n}","export default function limitPlugin(scheduler){\r\n\r\n\r\n\tscheduler.config.mark_now = true;\r\n\tscheduler.config.display_marked_timespans = true;\r\n\tscheduler.config.overwrite_marked_timespans = true;\r\n\r\n\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\tvar default_timespan_type = \"default\";\r\n\tvar fix_options = function(options, days, zones) {\r\n\t\tif (days instanceof Date && zones instanceof Date) {\r\n\t\t\toptions.start_date = days;\r\n\t\t\toptions.end_date = zones;\r\n\t\t} else {\r\n\t\t\toptions.days = days;\r\n\t\t\toptions.zones = zones;\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tvar get_resulting_options = function(days, zones, sections) {\r\n\t\tvar options = (typeof days == \"object\") ? days : { days: days };\r\n\t\toptions.type = dhx_time_block;\r\n\t\toptions.css = \"\";\r\n\t\tif (zones) {\r\n\t\t\tif (sections)\r\n\t\t\t\toptions.sections = sections;\r\n\t\t\toptions = fix_options(options, days, zones);\r\n\t\t}\r\n\t\treturn options;\r\n\t};\r\n\tscheduler.blockTime = function(days, zones, sections){\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.addMarkedTimespan(options);\r\n\t};\r\n\tscheduler.unblockTime = function(days, zones, sections) {\r\n\t\tzones = zones || \"fullday\";\r\n\t\tvar options = get_resulting_options(days, zones, sections);\r\n\t\treturn scheduler.deleteMarkedTimespan(options);\r\n\t};\r\n\r\n\tscheduler.checkInMarkedTimespan = function(ev, timespan_type, on_overlap){\r\n\t\ttimespan_type = timespan_type || default_timespan_type;\r\n\r\n\t\tvar res = true;\r\n\t\tvar temp_start_date = new Date(ev.start_date.valueOf());\r\n\t\tvar temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\");\r\n\t\tvar timespans = scheduler._marked_timespans;\r\n\t\tfor (; temp_start_date < ev.end_date; temp_start_date = scheduler.date.date_part(temp_end_date), temp_end_date = scheduler.date.add(temp_start_date, 1, \"day\") ) {\r\n\t\t\tvar day_value = +scheduler.date.date_part( new Date(temp_start_date) ); // the first part of event not necessarily contains only date part\r\n\t\t\tvar day_index = temp_start_date.getDay();\r\n\r\n\t\t\tvar zones = getZones(ev, timespans, day_index, day_value, timespan_type);\r\n\t\t\tif (zones){\r\n\t\t\t\tfor (var i = 0; i < zones.length; i+=2) {\r\n\r\n\t\t\t\t\t// they may change for new event if it passes limit zone\r\n\t\t\t\t\tvar eventStart = scheduler._get_zone_minutes(temp_start_date);\r\n\t\t\t\t\tvar eventEnd = ( ev.end_date>temp_end_date || ev.end_date.getDate() != temp_start_date.getDate() ) ? 1440 : scheduler._get_zone_minutes(ev.end_date);\r\n\r\n\t\t\t\t\tvar markerStart = zones[i];\r\n\t\t\t\t\tvar markerEnd = zones[i+1];\r\n\t\t\t\t\tif (markerStart
eventStart) {\r\n\t\t\t\t\t\tif(typeof on_overlap == \"function\"){\r\n\t\t\t\t\t\t\t//handler allows to cancel overlapping\r\n\t\t\t\t\t\t\t//actually needed only to keep default behavior of limits\r\n\t\t\t\t\t\t\tres = on_overlap(ev, eventStart, eventEnd, markerStart, markerEnd);//event object, event start/end minutes in 'zones' format, zone start/end minutes\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tres = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(!res)\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn !res;\r\n\t};\r\n\tscheduler.checkLimitViolation = function(event){\r\n\t\tif(!event)\r\n\t\t\treturn true;\r\n\t\tif (!scheduler.config.check_limits)\r\n\t\t\treturn true;\r\n\t\tvar s = scheduler;\r\n\t\tvar c = s.config;\r\n\t\tvar evs = [];\r\n\t\tif ((event.rec_type && event._end_date) || (event.rrule)) {\r\n\t\t\tconst seriesEnd = event._end_date || event.end_date;\r\n\t\t\t// GS-2482 need to take into account that a part of recurring events might be outside the limits\r\n\t\t\tif ((c.limit_start && c.limit_end)) {\r\n\t\t\t\tvar recEventInLimits = seriesEnd.valueOf() >= c.limit_start.valueOf() && event.start_date.valueOf() <= c.limit_end.valueOf();\r\n\t\t\t\treturn recEventInLimits;\r\n\t\t\t} else return true;\r\n\t\t} else {\r\n\t\t\tevs = [event];\r\n\t\t}\r\n\r\n\t\tvar complete_res = true;\r\n\t\tfor (var p=0; p= c.limit_start.valueOf() && ev.end_date.valueOf() <= c.limit_end.valueOf()) : true;\r\n\t\t\tif (res){\r\n\t\t\t\tres = !scheduler.checkInMarkedTimespan(ev, dhx_time_block, function(event, eventStart, eventEnd, markerStart, markerEnd){\r\n\t\t\t\t\t//try crop event to allow placing\r\n\t\t\t\t\tvar allow = true;\r\n\t\t\t\t\tif (eventStart<=markerEnd && eventStart >= markerStart){\r\n\t\t\t\t\t\tif (markerEnd == 24*60 || eventEnd <= markerEnd){\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.start_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.start_date.setMinutes(markerEnd);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ((eventEnd >= markerStart && eventEnd <= markerEnd) || (eventStart < markerStart && eventEnd > markerEnd)){\r\n\t\t\t\t\t\tif(event._timed && s._drag_id && s._drag_mode == \"new-size\"){\r\n\t\t\t\t\t\t\tevent.end_date.setHours(0);\r\n\t\t\t\t\t\t\tevent.end_date.setMinutes(markerStart);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tallow = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn allow;\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tif (!res) {\r\n\t\t\t\tres = (s.checkEvent(\"onLimitViolation\")) ? s.callEvent(\"onLimitViolation\",[ev.id, ev]) : res;\r\n\t\t\t}\r\n\t\t\tcomplete_res = complete_res && res;\r\n\t\t}\r\n\t\tif(!complete_res){\r\n\t\t\ts._drag_id = null;\r\n\t\t\ts._drag_mode = null;\r\n\t\t}\r\n\t\treturn complete_res;\r\n\r\n\r\n\t};\r\n\tscheduler._get_blocked_zones = function(timespans, property, day_index, day_value, timespan_type){\r\n\t\tvar zones =[];\r\n\t\tif (timespans && timespans[property]) {\r\n\t\t\tvar timeline_zones = timespans[property];\r\n\t\t\tvar blocked_timeline_zones = this._get_relevant_blocked_zones(day_index, day_value, timeline_zones, timespan_type);\r\n\t\t\tfor (var i=0; i this._min_date && now.getHours() >= cfg.first_hour && now.getHours() 1) {\r\n\t\t\t\t\tif(view.size && view.options.length){\r\n\t\t\t\t\t\tday_index = ((view.position+ day_index) / view.options.length) * view.size;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_index = day_index;\r\n\t\t\t\t\tend_index = day_index + units_l;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tstart_index = 0;\r\n\t\t\t\t\tend_index = start_index + units_l;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar r_divs = [];\r\n\r\n\t\t\t\tfor (var i = start_index; i < end_index; i++) {\r\n\t\t\t\t\tvar t_day = i; // as each unit is actually considered +1 day\r\n\t\t\t\t\toptions.days = t_day;\r\n\t\t\t\t\tvar t_div = scheduler._render_marked_timespan(options, null, t_day)[0];\r\n\t\t\t\t\tr_divs.push(t_div);\r\n\t\t\t\t}\r\n\t\t\t\treturn r_divs;\r\n\t\t\t} else { // day/week views\r\n\t\t\t\toptions.days = day_index;\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, day_index);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\toptions.days = +scheduler.date.date_part(now);\r\n\t\t\t\treturn scheduler._render_marked_timespan(options, null, null);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tscheduler._remove_mark_now = function() {\r\n\t\tvar dhx_now_time = 'dhx_now_time';\r\n\t\tvar els = this._els[dhx_now_time];\r\n\t\tfor (var i=0; i config.start_date) || (config.days !== undefined && config.zones)) && !config.type )\r\n\t\t\treturn r_configs; // incorrect config was provided\r\n\r\n\t\tvar min = 0;\r\n\t\tvar max = 24*60;\r\n\t\tif (config.zones == \"fullday\")\r\n\t\t\tconfig.zones = [min, max];\r\n\t\tif (config.zones && config.invert_zones) {\r\n\t\t\tconfig.zones = scheduler.invertZones(config.zones);\r\n\t\t}\r\n\r\n\t\tconfig.id = scheduler.uid();\r\n\t\tconfig.css = config.css||\"\";\r\n\t\tconfig.type = config.type||default_timespan_type;\r\n\r\n\t\tvar sections = config.sections;\r\n\t\tif (sections) {\r\n\t\t\tfor (var view_key in sections) {\r\n\t\t\t\tif (sections.hasOwnProperty(view_key)) {\r\n\t\t\t\t\tvar ids = sections[view_key];\r\n\t\t\t\t\tif (!(ids instanceof Array))\r\n\t\t\t\t\t\tids = [ids];\r\n\t\t\t\t\tfor (var i=0; i t_sd) ? scheduler._get_zone_minutes(start_date) : min;\r\n\t\t\t\t\tvar zone_end = ( end_date > t_ed || end_date.getDate() != t_sd.getDate() ) ? max : scheduler._get_zone_minutes(end_date);\r\n\t\t\t\t\tt_config.zones = [zone_start, zone_end];\r\n\t\t\t\t\tr_configs.push(t_config);\r\n\r\n\t\t\t\t\tt_sd = t_ed;\r\n\t\t\t\t\tt_ed = scheduler.date.add(t_ed, 1, \"day\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (c_config.days instanceof Date)\r\n\t\t\t\t\tc_config.days = (scheduler.date.date_part(c_config.days)).valueOf();\r\n\t\t\t\tc_config.zones = config.zones.slice();\r\n\t\t\t\tr_configs.push(c_config);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn r_configs;\r\n\t};\r\n\tscheduler._get_dates_by_index = function(index, start, end) {\r\n\t\tvar dates = [];\r\n\t\tstart = scheduler.date.date_part(new Date(start||scheduler._min_date));\r\n\t\tend = new Date(end||scheduler._max_date);\r\n\t\tvar start_day = start.getDay();\r\n\t\tvar delta = (index-start_day >= 0) ? (index-start_day) : (7-start.getDay()+index);\r\n\t\tvar t_date = scheduler.date.add(start, delta, \"day\");\r\n\t\tfor (; t_date < end; t_date = scheduler.date.add(t_date, 1, \"week\")) {\r\n\t\t\tdates.push(t_date);\r\n\t\t}\r\n\t\treturn dates;\r\n\t};\r\n\tscheduler._get_css_classes_by_config = function(config) {\r\n\t\tvar css_classes = [];\r\n\t\tif (config.type == dhx_time_block) {\r\n\t\t\tcss_classes.push(dhx_time_block);\r\n\t\t\tif (config.css)\r\n\t\t\t\tcss_classes.push(dhx_time_block+\"_reset\");\r\n\t\t}\r\n\t\tcss_classes.push(\"dhx_marked_timespan\", config.css);\r\n\t\treturn css_classes.join(\" \");\r\n\t};\r\n\tscheduler._get_block_by_config = function(config) {\r\n\t\tvar block = document.createElement(\"div\");\r\n\t\tif (config.html) {\r\n\t\t\tif (typeof config.html == \"string\")\r\n\t\t\t\tblock.innerHTML = config.html;\r\n\t\t\telse\r\n\t\t\t\tblock.appendChild(config.html);\r\n\t\t}\r\n\t\treturn block;\r\n\t};\r\n\tscheduler._render_marked_timespan = function(options, area, day) {\r\n\t\tvar blocks = []; // resulting block which will be rendered and returned\r\n\t\tvar c = scheduler.config;\r\n\t\tvar min_date = this._min_date;\r\n\t\tvar max_date = this._max_date;\r\n\t\tvar day_value = false; // if timespan for specific date should be displayed\r\n\r\n\t\tif (!c.display_marked_timespans)\r\n\t\t\treturn blocks;\r\n\r\n\t\t// in case of markTimespan\r\n\t\tif (!day && day !== 0) {\r\n\t\t\tif (options.days < 7)\r\n\t\t\t\tday = options.days;\r\n\t\t\telse {\r\n\t\t\t\tvar date_to_display = new Date(options.days);\r\n\t\t\t\tday_value = +date_to_display;\r\n\r\n\t\t\t\t// in case of markTimespan date could be not in the viewing range, need to return\r\n\t\t\t\tif ( !(+max_date > +date_to_display && +min_date <= +date_to_display) )\r\n\t\t\t\t\treturn blocks;\r\n\r\n\t\t\t\tday = date_to_display.getDay();\r\n\t\t\t}\r\n\r\n\t\t\t// convert day default index (Sun - 0, Sat - 6) to index of hourscales (depends on week_start and config.start_on_monday)\r\n\t\t\tvar min_day = min_date.getDay();\r\n\t\t\tif (min_day > day) {\r\n\t\t\t\tday = 7 - (min_day-day);\r\n\t\t\t} else {\r\n\t\t\t\tday = day - min_day;\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar zones = options.zones;\r\n\t\tvar css_classes = scheduler._get_css_classes_by_config(options);\r\n\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\") {\r\n\t\t\tvar areas = [];\r\n\t\t\tvar days = [];\r\n\r\n\r\n\t\t\tif (!area) {\r\n\t\t\t\tdays = (day_value) ? [day_value] : scheduler._get_dates_by_index(day);\r\n\t\t\t\tfor (var i=0; i < days.length; i++) {\r\n\t\t\t\t\tareas.push( this._scales[days[i]] );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tareas.push(area);\r\n\t\t\t\tdays.push(day);\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i=0; i < areas.length; i++) {\r\n\t\t\t\tarea = areas[i];\r\n\t\t\t\tday = days[i];\r\n\r\n\t\t\t\tvar sday = this.locate_holder_day(day, false) % this._cols.length;\r\n\r\n\t\t\t\tif(this._ignores[sday]) continue;\r\n\r\n\t\t\t\tvar block_proto = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock_proto.className = css_classes;\r\n\t\t\t\tblock_proto.style.top = \"0px\";\r\n\t\t\t\tblock_proto.style.height = \"100%\";\r\n\t\t\t\t\r\n\t\t\t\tfor (var k=0; k < zones.length; k+=2) {\r\n\t\t\t\t\tvar start = zones[i];\r\n\t\t\t\t\tvar end = zones[i+1];\r\n\t\t\t\t\tif (end <= start)\r\n\t\t\t\t\t\treturn [];\r\n\r\n\t\t\t\t\tvar block = block_proto.cloneNode(true);\r\n\r\n\t\t\t\t\tblock.style.left = \"0px\";\r\n\t\t\t\t\tblock.style.width = \"100%\";\r\n\r\n\t\t\t\t\tarea.appendChild(block);\r\n\t\t\t\t\tblocks.push(block);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar index = day;\r\n\r\n\t\t\tif(this._ignores[this.locate_holder_day(day, false)]) return blocks;\r\n\r\n\t\t\tif (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {\r\n\t\t\t\tvar view = this._props[this._mode];\r\n\t\t\t\tindex = view.order[options.sections[this._mode]];\r\n\r\n\t\t\t\tvar inner_index = view.order[options.sections[this._mode]];\r\n\t\t\t\tif(!(view.days > 1)){\r\n\t\t\t\t\tindex = inner_index;\r\n\t\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\t\tindex = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar units_l = view.size || view.options.length;\r\n\t\t\t\t\tindex = index*units_l + inner_index;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tarea = area ? area : scheduler.locate_holder(index);\r\n\r\n\t\t\tfor (var i = 0; i < zones.length; i+=2){\r\n\t\t\t\tvar start = Math.max(zones[i], c.first_hour*60);\r\n\t\t\t\tvar end = Math.min(zones[i+1], c.last_hour*60);\r\n\t\t\t\tif (end <= start) {\r\n\t\t\t\t\tif (i+2 < zones.length)\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\treturn [];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar block = scheduler._get_block_by_config(options);\r\n\t\t\t\tblock.className = css_classes;\r\n\r\n\t\t\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\t\t\tvar all_hours_height = this.config.hour_size_px*24 + 1;\r\n\t\t\t\tvar hour_ms = 60*60*1000;\r\n\t\t\t\tblock.style.top = (Math.round((start*60*1000-this.config.first_hour*hour_ms)*this.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\t\t\tblock.style.height = Math.max((Math.round(((end-start)*60*1000)*this.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\r\n\t\t\t\tarea.appendChild(block);\r\n\t\t\t\tblocks.push(block);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn blocks;\r\n\t};\r\n\r\n\tscheduler._mark_timespans = function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tvar divs = [];\r\n\t\tif (scheduler._table_view && scheduler._mode == \"month\"){\r\n\t\t\tfor (var day in this._scales) {\r\n\t\t\t\tvar date = new Date(+day);\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(this._scales[day],date));\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\t//manually trigger rendering of configs for each column\r\n\t\t\tvar date = new Date(scheduler._min_date);\r\n\t\t\tfor (var i = 0, len = data.childNodes.length; i < len; i++) {\r\n\t\t\t\tvar area = data.childNodes[i];\r\n\t\t\t\tif (area.firstChild && scheduler._getClassName(area.firstChild).indexOf(\"dhx_scale_hour\") > -1) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdivs.push.apply(divs, scheduler._on_scale_add_marker(area, date));\r\n\t\t\t\tdate = scheduler.date.add(date, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn divs;\r\n\t};\r\n\r\n\t// just marks timespan, will be cleaned after refresh\r\n\tscheduler.markTimespan = function(configuration) {\r\n\t\tif(!this._els){\r\n\t\t\tthrow new Error(\"`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.\");\r\n\t\t}\r\n\r\n\r\n\t\tvar rebuild_els = false;\r\n\t\tif(!this._els[\"dhx_cal_data\"]){\r\n\t\t\tscheduler.get_elements();\r\n\t\t\trebuild_els = true;\r\n\t\t}\r\n\r\n\r\n\t\t// backup regular marked timespans\r\n\t\tvar timespans_ids = scheduler._marked_timespans_ids,\r\n\t\t\ttimespan_types = scheduler._marked_timespans_types,\r\n\t\t\ttimespans = scheduler._marked_timespans;\r\n\r\n\t\tscheduler.deleteMarkedTimespan();\r\n\r\n\t\t//add block to configs\r\n\t\tscheduler.addMarkedTimespan(configuration);\r\n\r\n\t\tvar divs = scheduler._mark_timespans();\r\n\r\n\t\tif(rebuild_els)\r\n\t\t\tscheduler._els = [];\r\n\r\n\t\t// restore timespan config\r\n\t\tscheduler._marked_timespans_ids = timespans_ids;\r\n\t\tscheduler._marked_timespans_types = timespan_types;\r\n\t\tscheduler._marked_timespans = timespans;\r\n\r\n\t\treturn divs;\r\n\t};\r\n\tscheduler.unmarkTimespan = function(divs) {\r\n\t\tif (!divs)\r\n\t\t\treturn;\r\n\t\tfor (var i=0; i c_zone_end && zone_start <= c_zone_end) || (zone_start < c_zone_start && zone_end >= c_zone_start)) {\r\n\t\t\t\t\tresulting_zones[i] = Math.min(c_zone_start, zone_start);\r\n\t\t\t\t\tresulting_zones[i+1] = Math.max(c_zone_end, zone_end);\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!isLast) // do nothing, maybe next current zone will match or will be last\r\n\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\tvar offset = (c_zone_start > zone_start)?0:2;\r\n\t\t\t\t\tresulting_zones.splice(i+offset, 0, zone_start, zone_end); // last current zone, need to add another\r\n\t\t\t\t}\r\n\t\t\t\tzones.splice(k--,2); // zone was merged or added, need to exclude it\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler._subtract_timespan_zones = function(current_zones, zones) {\r\n\t\tvar resulting_zones = current_zones.slice();\r\n\t\tfor (var i=0; i c_zone_start && zone_start < c_zone_end) {\r\n\t\t\t\t\tvar is_modified = false;\r\n\t\t\t\t\tif (c_zone_start >= zone_start && c_zone_end <= zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_start < zone_start) {\r\n\t\t\t\t\t\tresulting_zones.splice(i, 2, c_zone_start, zone_start);\r\n\t\t\t\t\t\tis_modified = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (c_zone_end > zone_end) {\r\n\t\t\t\t\t\tresulting_zones.splice( (is_modified)?(i+2):i, (is_modified)?0:2, zone_end, c_zone_end);\r\n\t\t\t\t\t}\r\n\t\t\t\t\ti -= 2;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn resulting_zones;\r\n\t};\r\n\tscheduler.invertZones = function(zones) {\r\n\t\treturn scheduler._subtract_timespan_zones([0, 1440], zones.slice());\r\n\t};\r\n\tscheduler._delete_marked_timespan_by_id = function(id) {\r\n\t\tvar configs = scheduler._marked_timespans_ids[id];\r\n\t\tif (configs) {\r\n\t\t\tfor (var i=0; i 1)){\r\n\t\t\t\tday = scheduler.date.date_part(new Date(this._date)); // for units view actually only 1 day is displayed yet the day variable will change, need to use this._date for all calls\r\n\t\t\t}else{\r\n\t\t\t\tvar dx = 24*60*60*1000;\r\n\t\t\t\tvar day_ind = Math.round((day - scheduler._min_date)/dx);\r\n\t\t\t\tvar unitsPerDay = view.size || units.length;\r\n\t\t\t\tday = scheduler.date.add(scheduler._min_date, Math.floor(day_ind/unitsPerDay), \"day\"); // to the \"same\" day for all sections\r\n\t\t\t\tday = scheduler.date.date_part(day);\r\n\t\t\t}\r\n\t\t\tday_index = day.getDay();\r\n\t\t\tday_value = day.valueOf();\r\n\r\n\t\t\tif (timespans[mode] && timespans[mode][unit.key]) {\r\n\t\t\t\tvar unit_zones = timespans[mode][unit.key];\r\n\t\t\t\tvar unit_types = scheduler._get_types_to_render(unit_zones[day_index], unit_zones[day_value]);\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(unit_types));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar global_data = timespans[\"global\"];\r\n\r\n\t\tif(scheduler.config.overwrite_marked_timespans){\r\n\t\t\tvar day_types = global_data[day_value]||global_data[day_index];\r\n\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(day_types));\r\n\t\t} else {\r\n\t\t\tif(global_data[day_value]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_value]));\r\n\t\t\t}\r\n\t\t\tif(global_data[day_index]){\r\n\t\t\t\tr_configs.push.apply(r_configs, scheduler._get_configs_to_render(global_data[day_index]));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i=0; i {\r\n\t\t\tif(date){\r\n\t\t\t\tcalls.setModeDate.date = date;\r\n\t\t\t}\r\n\t\t\tif(mode){\r\n\t\t\t\tcalls.setModeDate.mode = mode;\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar methods = {\r\n\t\t\trender:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tsetCurrentView:(date, mode) => {calls.needRender = true; rememberModeDate(date, mode);},\r\n\t\t\tupdateView:(date, mode) => {calls.needUpdateView = true; rememberModeDate(date, mode);},\r\n\t\t\trender_data:() => calls.needRender = true,\r\n\t\t\trender_view_data:(evs) => { \r\n\t\t\t\tif(evs && evs.length){\r\n\t\t\t\t\tevs.forEach((e) => calls.repaintEvents[e.id] = true);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcalls.needRender = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tdisableMethods.call(this, methods);\r\n\r\n\t\tisActive = true;\r\n\t\tthis.callEvent(\"onBeforeBatchUpdate\", []);\r\n\r\n\t\tbatchUpdatePayload(callback);\r\n\r\n\t\tthis.callEvent(\"onAfterBatchUpdate\", []);\r\n\r\n\t\trestoreMethods.call(this);\r\n\r\n\t\tisActive = false;\r\n\t\tif(!noRedraw){\r\n\t\t\tif(calls.needRender){\r\n\t\t\t\tscheduler.render(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else if(calls.needUpdateView){\r\n\t\t\t\tscheduler.updateView(calls.setModeDate.date, calls.setModeDate.mode);\r\n\t\t\t}else{\r\n\t\t\t\tfor(const i in calls.repaintEvents){\r\n\t\t\t\t\tscheduler.updateEvent(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (call_dp) {\r\n\t\t\tthis._dp.setUpdateMode(dp_mode);\r\n\t\t\tthis._dp.sendData();\r\n\t\t}\r\n\t};\r\n}\r\n\r\nexport default function(scheduler){\r\n\tscheduler.batchUpdate = createMethod(scheduler);\r\n}","import dragHighlightPos from \"./drag_highlight_pos\";\r\nimport undoDelete from \"./undo_delete\";\r\nimport limit from \"./limit\";\r\nimport batchUpdate from \"./batch_update\";\r\n\r\nexport default function initPlugins(scheduler){\r\n undoDelete(scheduler);\r\n dragHighlightPos(scheduler);\r\n limit(scheduler);\r\n batchUpdate(scheduler);\r\n}","export default function undoDelete(scheduler) {\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tlet deletedEvent = scheduler.copy(ev);\r\n\t\tif (scheduler.config.undo_deleted && !scheduler.getState().new_event) {\r\n\t\t\tscheduler.message({\r\n\t\t\t\ttext: `\r\n \r\n Undo \r\n
`,\r\n\t\t\t\texpire: 10000,\r\n\t\t\t\ttype: \"popup_after_delete\",\r\n\t\t\t\tcallback: function (e) {\r\n\t\t\t\t\tlet undoBtn = e.target.closest(\r\n\t\t\t\t\t\t`[data-deleted-event-id=\"${ev.id}\"]`\r\n\t\t\t\t\t);\r\n\t\t\t\t\tif (undoBtn) {\r\n\t\t\t\t\t\tscheduler.addEvent(deletedEvent);\r\n\t\t\t\t\t\tscheduler.render();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}\r\n","var uidSeed = Date.now();\r\nfunction uid () {\r\n\treturn uidSeed++;\r\n}\r\n\r\n// iframe-safe array type check instead of using instanceof\r\nfunction isArray(obj){\r\n\tif(Array.isArray){\r\n\t\treturn Array.isArray(obj);\r\n\t}else{\r\n\t\t// close enough\r\n\t\treturn (obj && obj.length !== undefined && obj.pop && obj.push);\r\n\t}\r\n}\r\n\r\n// non-primitive string object, e.g. new String(\"abc\")\r\nfunction isStringObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function String() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Number(5)\r\nfunction isNumberObject(obj){\r\n\treturn obj && typeof obj === \"object\" && \r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Number() { [native code] }\";\r\n}\r\n\r\n// non-primitive number object, e.g. new Boolean(true)\r\nfunction isBooleanObject(obj){\r\n\treturn obj && typeof obj === \"object\" &&\r\n\t\tFunction.prototype.toString.call(obj.constructor) === \"function Boolean() { [native code] }\";\r\n}\r\n\r\nfunction isDate(obj) {\r\n\tif (obj && typeof obj === \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}\r\n\r\nfunction defined(obj) {\r\n\treturn typeof(obj) != \"undefined\";\r\n}\r\n\r\nfunction delay (callback, timeout){\r\n\tvar timer;\r\n\r\n\tvar result = function() {\r\n\t\tresult.$cancelTimeout();\r\n\t\tresult.$pending = true;\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tcallback.apply(this, args);\r\n\t\t\tresult.$pending = false;\r\n\t\t}, timeout);\r\n\t};\r\n\r\n\tresult.$pending = false;\r\n\tresult.$cancelTimeout = function(){\r\n\t\tclearTimeout(timer);\r\n\t\tresult.$pending = false;\r\n\t};\r\n\tresult.$execute = function(){\r\n\t\tvar args = Array.prototype.slice.call(arguments);\r\n\t\tcallback.apply(this, args);\r\n\t\tresult.$cancelTimeout();\r\n\t};\r\n\r\n\treturn result;\r\n}\r\n\r\nexport default {\r\n\tuid: uid,\r\n\tmixin: function mixin (target, source, force){\r\n\t\tfor (var f in source)\r\n\t\t\tif (((target[f] === undefined) || force)) target[f]=source[f];\r\n\t\treturn target;\r\n\t},\r\n\tcopy: function copy(object) {\r\n\t\tvar i, result; // iterator, types array, result\r\n\t\r\n\t\tif (object && typeof object == \"object\") {\r\n\t\r\n\t\t\tswitch (true){\r\n\t\t\t\tcase (isDate(object)):\r\n\t\t\t\t\tresult = new Date(object);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isArray(object)):\r\n\t\t\t\t\tresult = new Array(object.length);\r\n\t\t\t\t\tfor(i = 0; i < object.length; i++){\r\n\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isStringObject(object)):\r\n\t\t\t\t\tresult = new String(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isNumberObject(object)):\r\n\t\t\t\t\tresult = new Number(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase (isBooleanObject(object)):\r\n\t\t\t\t\tresult = new Boolean(object);// jshint ignore:line\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tresult = {};\r\n\t\t\t\t\tfor (i in object) {\r\n\t\t\t\t\t\tconst varType = typeof object[i];\r\n\r\n\t\t\t\t\t\tif (varType === \"string\" || varType === \"number\" || varType === \"boolean\" ) {\r\n\t\t\t\t\t\t\tresult[i] = object[i];\r\n\t\t\t\t\t\t} else if(isDate(object[i])){\r\n\t\t\t\t\t\t\tresult[i] = new Date(object[i]);\r\n\t\t\t\t\t\t}else if (Object.prototype.hasOwnProperty.apply(object, [i]))\r\n\t\t\t\t\t\t\tresult[i] = copy(object[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result || object;\r\n\t},\r\n\tdefined,\r\n\tisDate,\r\n\tdelay\r\n};\r\n","export default function extend(scheduler) {\r\n\r\nfunction div(className){\r\n\tvar element = document.createElement(\"div\");\r\n\tvar classes = (className || \"\").split(\" \");\r\n\tclasses.forEach(function(cssClass){\r\n\t\telement.classList.add(cssClass);\r\n\t});\r\n\treturn element;\r\n}\r\nvar itemTypes = {\r\n\trows_container: function(){\r\n\t\treturn div(\"dhx_cal_navbar_rows_container\");\r\n\t},\r\n\trow: function(){\r\n\t\treturn div(\"dhx_cal_navbar_row\");\r\n\t},\r\n\tview: function (config) {\r\n\t\tvar element = div(\"dhx_cal_tab\");\r\n\t\telement.setAttribute(\"name\", config.view + \"_tab\");\r\n\t\telement.setAttribute(\"data-tab\", config.view);\r\n\t\t// element.setAttribute(\"data-viewname\", config.view); // FIXME: need to remove? not used anywhere\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tif(config.$firstTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t}else if(config.$lastTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t} else if(config.view !== \"week\") {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t}\r\n\r\n\t\t\tif(config.$segmentedTab) {\r\n\t\t\t\telement.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn element;\r\n\t},\r\n\tdate: function () {\r\n\t\treturn div(\"dhx_cal_date\");\r\n\t},\r\n\tbutton: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_button dhx_cal_nav_button_custom dhx_cal_tab\");\r\n\t},\r\n\tbuiltInButton: function (config){\r\n\t\treturn div(\"dhx_cal_\" + config.view + \"_button dhx_cal_nav_button\");\r\n\t},\r\n\tspacer: function () {\r\n\t\treturn div(\"dhx_cal_line_spacer\");\r\n\t},\r\n\tminicalendarButton: function(config){\r\n\t\tvar minicalendarDiv = div('dhx_minical_icon');\r\n\t\tif(!config.click && !minicalendarDiv.$_eventAttached){\r\n\t\t\t\r\n\t\t\tscheduler.event(minicalendarDiv, \"click\", function () {\r\n\t\t\t\tif (scheduler.isCalendarVisible()) {\r\n\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\t\tposition: this,\r\n\t\t\t\t\t\tdate: scheduler.getState().date,\r\n\t\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\t\thandler: function (date, calendar) {\r\n\t\t\t\t\t\t\tscheduler.setCurrentView(date);\r\n\t\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\treturn minicalendarDiv;\r\n\t},\r\n\thtml_element: function (config) {\r\n\t\treturn div(\"dhx_cal_nav_content\");\r\n\t}\r\n};\r\n\r\nfunction findRenderer(config) {\r\n\tvar renderer;\r\n\tif (config.view) {\r\n\t\tswitch (config.view){\r\n\t\t\tcase \"today\":\r\n\t\t\tcase \"next\":\r\n\t\t\tcase \"prev\":\r\n\t\t\t\trenderer = itemTypes.builtInButton;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"date\":\r\n\t\t\t\trenderer = itemTypes.date;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"spacer\":\r\n\t\t\t\trenderer = itemTypes.spacer;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"button\":\r\n\t\t\t\trenderer = itemTypes.button;\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minicalendar\":\r\n\t\t\t\trenderer = itemTypes.minicalendarButton;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\trenderer = itemTypes.view;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t} else if(config.rows) {\r\n\t\trenderer = itemTypes.rows_container;\r\n\t} else if(config.cols) {\r\n\t\trenderer = itemTypes.row;\r\n\t}\r\n\treturn renderer;\r\n}\r\n\r\nfunction renderElement(config){\r\n\tvar renderer = findRenderer(config);\r\n\tif(!renderer){\r\n\t\treturn;\r\n\t}\r\n\tvar element = renderer(config);\r\n\tif(config.css){\r\n\t\telement.classList.add(config.css);\r\n\t}\r\n\tif(config.width){\r\n\t\tvar value = config.width;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.width = value;\r\n\t}\r\n\tif(config.height){\r\n\t\tvar value = config.height;\r\n\t\tif(value === value * 1){\r\n\t\t\tvalue += \"px\";\r\n\t\t}\r\n\t\telement.style.height = value;\r\n\t}\r\n\tif (config.click) {\r\n\t\tscheduler.event(element, \"click\", config.click);\r\n\t}\r\n\tif (config.html) {\r\n\t\telement.innerHTML = config.html;\r\n\t}\r\n\r\n\tif (config.align) {\r\n\t\tvar value = \"\";\r\n\t\tif (config.align == \"right\") {\r\n\t\t\tvalue = \"flex-end\";\r\n\t\t} else if(config.align == \"left\") {\r\n\t\t\tvalue = \"flex-start\";\r\n\t\t}\r\n\t\telement.style.justifyContent = value;\r\n\t}\r\n\treturn element;\r\n}\r\n\r\nfunction prepareConfig(config) {\r\n\tif (typeof config === \"string\") {\r\n\t\tconfig = {\r\n\t\t\tview: config\r\n\t\t};\r\n\t}\r\n\tif (!config.view && !config.rows && !config.cols) {\r\n\t\tconfig.view = \"button\";\r\n\t}\r\n\treturn config;\r\n}\r\n\r\nfunction renderLayout(config) {\r\n\tvar fragment = document.createDocumentFragment();\r\n\tvar items;\r\n\tif(Array.isArray(config)){\r\n\t\titems = config;\r\n\t}else{\r\n\t\titems = [config];\r\n\t}\r\n\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tvar view = prepareConfig(items[i]);\r\n\r\n\t\tif(view.view === \"day\" && items[i + 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$firstTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"week\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i + 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"month\"){\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(view.view === \"month\" && items[i - 1]){\r\n\t\t\tvar next = prepareConfig(items[i - 1]);\r\n\t\t\tif(next.view === \"week\" || next.view === \"day\"){\r\n\t\t\t\tview.$lastTab = true;\r\n\t\t\t\tview.$segmentedTab = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar element = renderElement(view);\r\n\r\n\t\tfragment.appendChild(element);\r\n\t\tif(view.cols || view.rows){\r\n\t\t\telement.appendChild(renderLayout(view.cols || view.rows));\r\n\t\t}\r\n\t}\r\n\treturn fragment;\r\n}\r\n\r\nscheduler._init_nav_bar = function (items) {\r\n\tvar navBar = this.$container.querySelector(\".dhx_cal_navline\");\r\n\tif (!navBar){\r\n\t\tnavBar = document.createElement(\"div\");\r\n\t\tnavBar.className = \"dhx_cal_navline dhx_cal_navline_flex\";\r\n\t\tscheduler._update_nav_bar(items, navBar);\r\n\t\treturn navBar;\r\n\t}\r\n\treturn navBar;\r\n};\r\n\r\nvar previousNavbar = null;\r\nvar previousHeight = null;\r\nscheduler._update_nav_bar = function (config, container) {\r\n\r\n\tif(!config){\r\n\t\treturn;\r\n\t}\r\n\tvar heightChanged = false;\r\n\tvar configChanged = false;\r\n\r\n\tvar newHeight = config.height || scheduler.xy.nav_height;\r\n\r\n\tif(previousHeight === null ||\r\n\t\t\t(previousHeight !== newHeight)){\r\n\t\theightChanged = true;\r\n\t}\r\n\tif(!previousNavbar || JSON.stringify(config) !== previousNavbar){\r\n\t\tconfigChanged = true;\r\n\t}\r\n\r\n\tif(heightChanged){\r\n\t\tscheduler.xy.nav_height = newHeight;\r\n\t}\r\n\tif(configChanged){\r\n\t\tcontainer.innerHTML = \"\";\r\n\t\tcontainer.appendChild(renderLayout(config));\r\n\t}\r\n\r\n\tif(heightChanged || configChanged){\r\n\t\tscheduler.unset_actions();\r\n\t\tscheduler._els = [];\r\n\t\tscheduler.get_elements();\r\n\t\tscheduler.set_actions();\r\n\t}\r\n\r\n\tif(newHeight === 0){\r\n\t\tcontainer.style.display = \"none\";\r\n\t}else{\r\n\t\tcontainer.style.display = \"\";\r\n\t}\r\n\r\n\tpreviousHeight = newHeight;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\tfunction isAttachedNode(container){\r\n\t\tvar root = document.body;\r\n\t\r\n\t\twhile(container && container != root){\r\n\t\t\tcontainer = container.parentNode;\r\n\t\t}\r\n\t\r\n\t\treturn !!(root == container);\r\n\t}\r\n\t\r\n\tfunction getWindowSize(window){\r\n\t\treturn {\r\n\t\t\tw : window.innerWidth || document.documentElement.clientWidth,\r\n\t\t\th : window.innerHeight || document.documentElement.clientHeight\r\n\t\t};\r\n\t}\r\n\tfunction equals(a,b){\r\n\t\treturn a.w == b.w && a.h == b.h;\r\n\t}\r\n\t\r\n\tfunction listenWindowResize(scheduler, window){\r\n\t\tvar oldSize = getWindowSize(window);\r\n\t\tvar resizeDelay;\r\n\t\tscheduler.event(window, \"resize\", function(){\r\n\t\t\tclearTimeout(resizeDelay);\r\n\t\t\tresizeDelay = setTimeout(function(){\r\n\r\n\t\t\t\tif (!isAttachedNode(scheduler.$container) || scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tvar newSize = getWindowSize(window);\r\n\t\t\t\t// element may be resized by container-autoresize exteinsion\r\n\t\t\t\t// check if the size is actually changed in order to not to get endless loop\r\n\t\t\t\tif (!equals(oldSize, newSize)) {\r\n\t\t\t\t\toldSize = newSize;\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\t\t}, 150);\r\n\t\t});\r\n\t}\r\n\t\r\n\tfunction triggerSchedulerResize(scheduler){\r\n\t\tif(scheduler.$destroyed || !scheduler.$root || !isAttachedNode(scheduler.$root)){\r\n\t\t\treturn;\t\r\n\t\t}\r\n\t\tif (scheduler.callEvent(\"onSchedulerResize\", [])) {\r\n\t\t\tscheduler.updateView();\r\n\t\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction watchNodeResize(scheduler){\r\n\t\tvar previousHeight = scheduler.$root.offsetHeight;\r\n\t\tvar previousWidth = scheduler.$root.offsetWidth;\r\n\t\t\r\n\t\tfunction lowlevelResizeWatcher(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(scheduler.$root){\r\n\t\t\t\tif (scheduler.$root.offsetHeight != previousHeight ||\r\n\t\t\t\t\tscheduler.$root.offsetWidth != previousWidth){\r\n\t\t\t\t\ttriggerSchedulerResize(scheduler);\r\n\t\t\t\t}\r\n\t\r\n\t\t\t\tpreviousHeight = scheduler.$root.offsetHeight;\r\n\t\t\t\tpreviousWidth = scheduler.$root.offsetWidth;\r\n\t\t\t}\r\n\t\r\n\t\t\tsetTimeout(lowlevelResizeWatcher, 200);\r\n\t\t}\r\n\t\t\r\n\t\tlowlevelResizeWatcher();\r\n\t}\r\n\t\r\n\tfunction addResizeListener(scheduler){\r\n\t\tvar root = scheduler.$container;\r\n\t\tvar containerStyles = window.getComputedStyle(root);\r\n\t\tif(containerStyles.getPropertyValue(\"position\") == \"static\"){\r\n\t\t\troot.style.position = \"relative\";\r\n\t\t}\r\n\t\r\n\t\tvar resizeWatcher = document.createElement('iframe');\r\n\t\tresizeWatcher.className = \"scheduler_container_resize_watcher\";\r\n\t\tresizeWatcher.tabIndex = -1;\r\n\t\tif(scheduler.config.wai_aria_attributes){\r\n\t\t\tresizeWatcher.setAttribute(\"role\", \"none\");\r\n\t\t\tresizeWatcher.setAttribute(\"aria-hidden\", true);\r\n\t\t}\r\n\t\r\n\t\t// in some environments (namely, in SalesForce) iframe.contentWindow is not available\r\n\t\tvar salesforce_environment = !!window[\"Sfdc\"] || !!window[\"$A\"] || window[\"Aura\"];\r\n\t\tif(salesforce_environment){\r\n\t\t\twatchNodeResize(scheduler);\r\n\t\t} else {\r\n\t\t\troot.appendChild(resizeWatcher);\r\n\t\t\tif (resizeWatcher.contentWindow) {\r\n\t\t\t\tlistenWindowResize(scheduler, resizeWatcher.contentWindow);\r\n\t\t\t} else {\r\n\t\t\t\t// if so - ditch the iframe and fallback to listening the main window resize\r\n\t\t\t\troot.removeChild(resizeWatcher);\r\n\t\t\t\tlistenWindowResize(scheduler, window);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\taddResizeListener(scheduler);\r\n\r\n}","class EventHost {\r\n\tconstructor(){\r\n\t\tthis._silent_mode = false;\r\n\t\tthis.listeners = {};\r\n\t}\r\n\t_silentStart(){\r\n\t\tthis._silent_mode = true;\r\n\t}\r\n\t_silentEnd() {\r\n\t\tthis._silent_mode = false;\r\n\t}\r\n}\r\n\r\nconst createEventStorage = function(obj) {\r\n\tlet handlers = {};\r\n\tlet index = 0;\r\n\tconst eventStorage = function(){\r\n\t\tlet combinedResult = true;\r\n\t\tfor(const i in handlers){\r\n\t\t\tconst handlerResult = handlers[i].apply(obj, arguments);\r\n\t\t\tcombinedResult=combinedResult && handlerResult;\r\n\t\t}\r\n\t\treturn combinedResult;\r\n\t};\r\n\teventStorage.addEvent=function(handler, settings){\r\n\t\tif (typeof (handler) == \"function\"){\r\n\t\t\tlet handlerId;\r\n\t\t\tif(settings && settings.id){\r\n\t\t\t\thandlerId = settings.id;\r\n\t\t\t}else{\r\n\t\t\t\thandlerId = index;\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(settings && settings.once){\r\n\t\t\t\tconst originalHandler = handler;\r\n\t\t\t\thandler = function(){\r\n\t\t\t\t\toriginalHandler();\r\n\t\t\t\t\teventStorage.removeEvent(handlerId);\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\thandlers[handlerId] = handler;\r\n\t\t\treturn handlerId;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\teventStorage.removeEvent=function(id){\r\n\t\tdelete handlers[id];\r\n\t};\r\n\r\n\teventStorage.clear = function(){\r\n\t\thandlers = {};\r\n\t};\r\n\r\n\treturn eventStorage;\r\n};\r\n\r\nfunction makeEventable(obj){\r\n\r\n\tconst eventHost = new EventHost();\r\n\tobj.attachEvent=function(eventName, handler, settings){\r\n\t\teventName = 'ev_'+eventName.toLowerCase();\r\n\t\tif (!eventHost.listeners[eventName]){\r\n\t\t\teventHost.listeners[eventName] = createEventStorage(this);\r\n\t\t}\r\n\r\n\t\tif(settings && settings.thisObject){\r\n\t\t\thandler = handler.bind(settings.thisObject);\r\n\t\t}\r\n\r\n\t\tconst innerId = eventHost.listeners[eventName].addEvent(handler, settings);\r\n\r\n\t\tlet handlerId = (eventName+':'+innerId); //return ID (ev_eventname:1)\r\n\t\tif(settings && settings.id){\r\n\t\t\thandlerId = settings.id;\r\n\t\t}\r\n\t\treturn handlerId;\r\n\t};\r\n\r\n\tobj.attachAll = function(callback){\r\n\t\tthis.attachEvent('listen_all', callback);\r\n\t};\r\n\r\n\tobj.callEvent=function(name, eventArguments){\r\n\t\tif (eventHost._silent_mode) return true;\r\n\r\n\t\tconst handlerName = 'ev_'+name.toLowerCase();\r\n\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\tif (listeners['ev_listen_all']){\r\n\t\t\tlisteners['ev_listen_all'].apply(this, [name].concat(eventArguments));\r\n\t\t}\r\n\r\n\t\tif (listeners[handlerName])\r\n\t\t\treturn listeners[handlerName].apply(this, eventArguments);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tobj.checkEvent=function(name){\r\n\t\tconst listeners = eventHost.listeners;\r\n\t\treturn (!!listeners['ev_'+name.toLowerCase()]);\r\n\t};\r\n\r\n\tobj.detachEvent=function(id){\r\n\t\tif (id){\r\n\t\t\tlet listeners = eventHost.listeners;\r\n\t\t\tfor(const i in listeners){\r\n\t\t\t\tlisteners[i].removeEvent(id); //remove event\r\n\t\t\t}\r\n\r\n\t\t\tconst list = id.split(':');//get EventName and ID\r\n\t\t\tlisteners = eventHost.listeners;\r\n\t\t\tif(list.length === 2){\r\n\t\t\t\tconst eventName = list[0];\r\n\t\t\t\tconst eventId = list[1];\r\n\t\t\t\tif(listeners[eventName]){\r\n\t\t\t\t\tlisteners[eventName].removeEvent(eventId); //remove event\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\tobj.detachAllEvents = function(){\r\n\t\tfor (const name in eventHost.listeners) {\r\n\t\t\teventHost.listeners[name].clear();\r\n\t\t}\r\n\t};\r\n\r\n}\r\n\r\nexport default makeEventable;","export default {\r\n\tevent: function (el, event, handler){\r\n\t\tif (el.addEventListener)\r\n\t\t\tel.addEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.attachEvent)\r\n\t\t\tel.attachEvent(\"on\"+event, handler);\r\n\t},\r\n\teventRemove: function (el, event, handler){\r\n\t\tif (el.removeEventListener)\r\n\t\t\tel.removeEventListener(event, handler, false);\r\n\t\r\n\t\telse if (el.detachEvent)\r\n\t\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};","import createEventScope from './utils/scoped_event';\r\n\r\nexport default function extend(scheduler) {\r\n\r\n\r\nvar domEvents = createEventScope();\r\n\r\nscheduler.event = domEvents.attach;\r\nscheduler.eventRemove = domEvents.detach;\r\nscheduler._eventRemoveAll = domEvents.detachAll;\r\nscheduler._createDomEventScope = domEvents.extend;\r\n\r\n\r\nscheduler._trim = function(str){\r\n\tvar func = String.prototype.trim || function(){ return this.replace(/^\\s+|\\s+$/g, \"\"); };\r\n\treturn func.apply(str);\r\n};\r\n\r\nscheduler._isDate = function(obj){\r\n\tif (obj && typeof obj == \"object\") {\r\n\t\treturn !!(obj.getFullYear && obj.getMonth && obj.getDate);\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n};\r\n\r\nscheduler._isObject = function(obj){\r\n\treturn (obj && typeof obj == \"object\");\r\n};\r\n\r\n}","import defaultDomEvents from './event';\r\n\r\nexport default function(){\r\n\r\n\tvar domEvents = function (addEvent, removeEvent) {\r\n\t\taddEvent = addEvent || defaultDomEvents.event;\r\n\t\tremoveEvent = removeEvent || defaultDomEvents.eventRemove;\r\n\t\tvar handlers = [];\r\n\t\tvar eventScope = {\r\n\t\t\tattach: function(el, event, callback, capture){\r\n\t\t\t\thandlers.push({element: el, event:event, callback: callback, capture: capture});\r\n\t\t\t\taddEvent(el, event, callback, capture);\r\n\t\t\t},\r\n\t\t\tdetach: function(el, event, callback, capture){\r\n\t\t\t\tremoveEvent(el, event, callback, capture);\r\n\t\t\t\tfor(var i = 0; i < handlers.length; i++){\r\n\t\t\t\t\tvar handler = handlers[i];\r\n\t\t\t\t\tif (handler.element === el && handler.event === event && handler.callback === callback && handler.capture === capture) {\r\n\t\t\t\t\t\thandlers.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tdetachAll: function () {\r\n\t\t\t\tvar staticArray = handlers.slice();\r\n\t\t\t\t// original handlers array can be spliced on every iteration\r\n\t\t\t\tfor (var i = 0; i < staticArray.length; i++){\r\n\t\t\t\t\tvar handler = staticArray[i];\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, handler.capture);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, undefined);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, false);\r\n\t\t\t\t\teventScope.detach(handler.element, handler.event, handler.callback, true);\r\n\t\t\t\t}\r\n\t\t\t\thandlers.splice(0, handlers.length);\r\n\t\t\t},\r\n\t\t\textend: function(){\r\n\t\t\t\treturn domEvents(this.event, this.eventRemove);\r\n\t\t\t}\r\n\t\t};\r\n\t\treturn eventScope;\r\n\t};\r\n\t\r\n\treturn domEvents();\r\n}","//returns position of html element on the page\r\nfunction elementPosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\n/*\r\nevent position relatively to DOM element\r\n */\r\nfunction getRelativeEventPosition(ev, node){\r\n\tvar d = document.documentElement;\r\n\tvar box = elementPosition(node);\r\n\r\n\treturn {\r\n\t\tx: ev.clientX - d.clientLeft - box.x + node.scrollLeft,\r\n\t\ty: ev.clientY - d.clientTop - box.y + node.scrollTop\r\n\t};\r\n}\r\n\r\nfunction getNodePosition(elem) {\r\n\tvar top=0, left=0, right=0, bottom=0;\r\n\tif (elem.getBoundingClientRect) { //HTML5 method\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\t\tvar body = document.body;\r\n\t\tvar docElem = (document.documentElement ||\r\n\t\t\tdocument.body.parentNode ||\r\n\t\t\tdocument.body);\r\n\r\n\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\t\ttop = box.top + scrollTop - clientTop;\r\n\t\tleft = box.left + scrollLeft - clientLeft;\r\n\r\n\t\tright = document.body.offsetWidth - box.right;\r\n\t\tbottom = document.body.offsetHeight - box.bottom;\r\n\t} else { //fallback to naive approach\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop,10);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft,10);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\r\n\t\tright = document.body.offsetWidth - elem.offsetWidth - left;\r\n\t\tbottom = document.body.offsetHeight - elem.offsetHeight - top;\r\n\t}\r\n\treturn { y: Math.round(top), x: Math.round(left), width:elem.offsetWidth, height:elem.offsetHeight, right: Math.round(right), bottom: Math.round(bottom) };\r\n}\r\n\r\nfunction getClassName(node){\r\n\tif(!node) return \"\";\r\n\r\n\tvar className = node.className || \"\";\r\n\tif(className.baseVal)//'className' exist but not a string - IE svg element in DOM\r\n\t\tclassName = className.baseVal;\r\n\r\n\tif(!className.indexOf)\r\n\t\tclassName = '';\r\n\r\n\treturn className || \"\";\r\n}\r\n\r\nfunction getTargetNode(e) {\r\n\tvar trg;\r\n\tif (e.tagName)\r\n\t\ttrg = e;\r\n\telse {\r\n\t\te = e || window.event;\r\n\t\ttrg = e.target || e.srcElement;\r\n\t\tif (trg.shadowRoot && e.composedPath) {\r\n\t\t\ttrg = e.composedPath()[0];\r\n\t\t}\r\n\t}\r\n\treturn trg;\r\n}\r\n\r\nfunction locateCss(e, classname, strict){\r\n\tif(strict === undefined)\r\n\t\tstrict = true;\r\n\r\n\tvar trg = e.target || e.srcElement;\r\n\tvar css = '';\r\n\r\n\twhile (trg){\r\n\t\tcss = getClassName(trg);\r\n\r\n\t\tif(css){\r\n\t\t\tvar ind = css.indexOf(classname);\r\n\t\t\tif (ind >= 0){\r\n\t\t\t\tif (!strict)\r\n\t\t\t\t\treturn trg;\r\n\r\n\t\t\t\t//check that we have exact match\r\n\t\t\t\tvar left = (ind === 0) || (!((css.charAt(ind - 1)||\"\").trim()));\r\n\t\t\t\tvar right = ((ind + classname.length >= css.length)) || (!((css.charAt(ind + classname.length)).trim()));\r\n\r\n\t\t\t\tif (left && right)\r\n\t\t\t\t\treturn trg;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\ttrg=trg.parentNode;\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n\r\n// get focusable nodes\r\nfunction isVisible(node){\r\n\tvar display = false,\r\n\t\tvisibility = false;\r\n\tif(window.getComputedStyle){\r\n\t\tvar style = window.getComputedStyle(node, null);\r\n\t\tdisplay = style[\"display\"];\r\n\t\tvisibility = style[\"visibility\"];\r\n\t}else if(node.currentStyle){\r\n\t\tdisplay = node.currentStyle[\"display\"];\r\n\t\tvisibility = node.currentStyle[\"visibility\"];\r\n\t}\r\n\r\n\tvar hiddenSection = false;\r\n\tvar recurringSection = locateCss({target:node}, \"dhx_form_repeat\", false);\r\n\tif(recurringSection){\r\n\t\thiddenSection = !!(recurringSection.style.height == \"0px\");\r\n\t}\r\n\thiddenSection = hiddenSection || !(node.offsetHeight);\r\n\r\n\treturn (display != \"none\" && visibility != \"hidden\" && !hiddenSection);\r\n}\r\n\r\nfunction hasNonNegativeTabIndex(node){\r\n\treturn !isNaN(node.getAttribute(\"tabindex\")) && (node.getAttribute(\"tabindex\")*1 >= 0);\r\n}\r\n\r\nfunction hasHref(node){\r\n\tvar canHaveHref = {\"a\": true, \"area\": true};\r\n\tif(canHaveHref[node.nodeName.loLowerCase()]){\r\n\t\treturn !!node.getAttribute(\"href\");\r\n\t}\r\n\treturn true;\r\n}\r\n\r\nfunction isEnabled(node){\r\n\tvar canDisable = {\"input\":true, \"select\":true, \"textarea\":true, \"button\":true, \"object\":true};\r\n\tif(canDisable[node.nodeName.toLowerCase()]){\r\n\t\treturn !node.hasAttribute(\"disabled\");\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n\r\nfunction getFocusableNodes(root){\r\n\tvar nodes = root.querySelectorAll([\r\n\t\t\"a[href]\",\r\n\t\t\"area[href]\",\r\n\t\t\"input\",\r\n\t\t\"select\",\r\n\t\t\"textarea\",\r\n\t\t\"button\",\r\n\t\t\"iframe\",\r\n\t\t\"object\",\r\n\t\t\"embed\",\r\n\t\t\"[tabindex]\",\r\n\t\t\"[contenteditable]\"\r\n\t].join(\", \"));\r\n\r\n\tvar nodesArray = Array.prototype.slice.call(nodes, 0);\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tnodesArray[i].$position = i;\r\n\t\t// we remember original nodes order, \r\n\t\t// so when we sort them by tabindex we ensure order of nodes with same tabindex is preserved, \r\n\t\t// since some browsers do unstable sort\r\n\t}\r\n\t\r\n\tnodesArray.sort(function(a, b) {\r\n\t\tif(a.tabIndex === 0 && b.tabIndex !== 0){\r\n\t\t\treturn 1;\r\n\t\t}\r\n\t\tif(a.tabIndex !== 0 && b.tabIndex === 0){\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\tif (a.tabIndex === b.tabIndex){\r\n\t\t\t// ensure we do stable sort\r\n\t\t\treturn a.$position - b.$position;\r\n\t\t}\r\n\t\tif (a.tabIndex < b.tabIndex) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 1;\r\n\t});\r\n\t\r\n\tfor(var i = 0; i < nodesArray.length; i++){\r\n\t\tvar node = nodesArray[i];\r\n\t\tvar isValid = (hasNonNegativeTabIndex(node) || isEnabled(node) || hasHref(node)) && isVisible(node);\r\n\t\tif(!isValid){\r\n\t\t\tnodesArray.splice(i, 1);\r\n\t\t\ti--;\r\n\t\t}\r\n\t}\r\n\treturn nodesArray;\r\n}\r\n\r\n\r\nfunction isShadowDomSupported() {\r\n\treturn document.head.createShadowRoot || document.head.attachShadow;\r\n}\r\n\r\n/**\r\n * Returns element that has the browser focus, or null if no element has focus.\r\n * Works with shadow DOM, so it's prefereed to use this function instead of document.activeElement directly.\r\n * @returns HTMLElement\r\n */\r\nfunction getActiveElement(){\r\n\tvar activeElement = document.activeElement;\r\n\tif (activeElement.shadowRoot) {\r\n\t\tactiveElement = activeElement.shadowRoot.activeElement;\r\n\t}\r\n\tif (activeElement === document.body && document.getSelection) {\r\n\t\tactiveElement = document.getSelection().focusNode || document.body;\r\n\t}\r\n\r\n\treturn activeElement;\r\n}\r\n\r\n/**\r\n * Returns document.body or the host node of the ShadowRoot, if the element is attached to ShadowDom\r\n * @param {HTMLElement} element \r\n * @returns HTMLElement\r\n */\r\nfunction getRootNode(element) {\r\n\tif (!element) {\r\n\t\treturn document.body;\r\n\t}\r\n\tif (!isShadowDomSupported()) {\r\n\t\treturn document.body;\r\n\t}\r\n\twhile (element.parentNode && (element = element.parentNode)) {\r\n\t\tif (element instanceof ShadowRoot) {\r\n\t\t\treturn element.host;\r\n\t\t}\r\n\t}\r\n\treturn document.body;\r\n}\r\n\r\nfunction hasShadowParent(element) {\r\n\treturn !!getRootNode(element);\r\n}\r\n\r\nexport default {\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteLeft: function getAbsoluteLeft(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).left;\r\n\t},\r\n\t/**\r\n\t * @desc: Calculate absolute position of html object\r\n\t * @type: private\r\n\t * @param: htmlObject - html object\r\n\t * @topic: 0\r\n\t */\r\n\tgetAbsoluteTop: function getAbsoluteTop(htmlObject){\r\n\t\treturn this.getOffset(htmlObject).top;\r\n\t},\r\n\r\n\tgetOffsetSum: function getOffsetSum(elem) {\r\n\t\tvar top=0, left=0;\r\n\t\twhile(elem) {\r\n\t\t\ttop = top + parseInt(elem.offsetTop);\r\n\t\t\tleft = left + parseInt(elem.offsetLeft);\r\n\t\t\telem = elem.offsetParent;\r\n\t\t}\r\n\t\treturn {top: top, left: left};\r\n\t},\r\n\r\n\tgetOffsetRect: function getOffsetRect(elem) {\r\n\t\tvar box = elem.getBoundingClientRect();\r\n\r\n\t\tvar top = 0,\r\n\t\t\tleft = 0;\r\n\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Mobile_Tablet_or_Desktop\r\n\t\tif (!/Mobi/.test(navigator.userAgent)) {\r\n\t\t\tvar body = document.body;\r\n\t\t\tvar docElem = document.documentElement;\r\n\t\t\tvar scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\r\n\t\t\tvar scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\r\n\t\t\tvar clientTop = docElem.clientTop || body.clientTop || 0;\r\n\t\t\tvar clientLeft = docElem.clientLeft || body.clientLeft || 0;\r\n\r\n\t\t\ttop = box.top + scrollTop - clientTop;\r\n\t\t\tleft = box.left + scrollLeft - clientLeft;\r\n\t\t}else {\r\n\t\t\t// incorrect left coordinate on mobile zoom\r\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=489206\r\n\r\n\t\t\tvar dummy = document.createElement(\"div\");\r\n\t\t\tdummy.style.position=\"absolute\";\r\n\t\t\tdummy.style.left=\"0px\";\r\n\t\t\tdummy.style.top=\"0px\";\r\n\t\t\tdummy.style.width=\"1px\";\r\n\t\t\tdummy.style.height = \"1px\";\r\n\r\n\t\t\tdocument.body.appendChild(dummy);\r\n\t\t\tvar dummyBox = dummy.getBoundingClientRect();\r\n\t\t\ttop = box.top - dummyBox.top;\r\n\t\t\tleft = box.left - dummyBox.left;\r\n\r\n\t\t\tdummy.parentNode.removeChild(dummy);\r\n\t\t}\r\n\r\n\t\treturn { top: Math.round(top), left: Math.round(left) };\r\n\t},\r\n\r\n\tgetOffset: function getOffset(elem) {\r\n\t\tif (elem.getBoundingClientRect) {\r\n\t\t\treturn this.getOffsetRect(elem);\r\n\t\t} else {\r\n\t\t\treturn this.getOffsetSum(elem);\r\n\t\t}\r\n\t},\r\n\r\n\tclosest: function(element, selector){\r\n\t\tif(!element || !selector){\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\treturn closest(element, selector);\r\n\t},\r\n\tinsertAfter: function(newNode, referenceNode){\r\n\t\tif(referenceNode.nextSibling){\r\n\t\t\treferenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\r\n\t\t}else{\r\n\t\t\treferenceNode.parentNode.appendChild(newNode);\r\n\t\t}\r\n\t},\r\n\tremove: function(node) {\r\n\t\tif (node && node.parentNode) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t},\r\n\tisChildOf: function(child, parent) {\r\n\t\treturn parent.contains(child);\r\n\t},\r\n\tgetFocusableNodes,\r\n\tgetClassName,\r\n\tlocateCss,\r\n\tgetRootNode,\r\n\thasShadowParent,\r\n\tisShadowDomSupported,\r\n\tgetActiveElement,\r\n\tgetRelativeEventPosition,\r\n\tgetTargetNode,\r\n\tgetNodePosition\r\n};\r\n\r\nvar closest;\r\nif(Element.prototype.closest){\r\n\tclosest = function(element, selector){\r\n\t\treturn element.closest(selector);\r\n\t};\r\n}else{\r\n\tvar matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\r\n\tclosest = function(element, selector) {\r\n\t\tvar el = element;\r\n\t\tdo {\r\n\t\t\tif (matches.call(el, selector)){\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\t\t\tel = el.parentElement || el.parentNode;\r\n\t\t} while (el !== null && el.nodeType === 1);\r\n\t\treturn null;\r\n\t};\r\n}\r\n","/* eslint-disable no-restricted-globals */\r\nvar isWindowAwailable = typeof window !== \"undefined\";\r\n\r\n/* eslint-enable no-restricted-globals */\r\n\r\nexport default {\r\n\tisIE: isWindowAwailable && (navigator.userAgent.indexOf(\"MSIE\") >= 0 || navigator.userAgent.indexOf(\"Trident\") >= 0),\r\n\tisOpera: isWindowAwailable && (navigator.userAgent.indexOf(\"Opera\") >= 0),\r\n\tisChrome: isWindowAwailable && (navigator.userAgent.indexOf(\"Chrome\") >= 0),\r\n\tisKHTML: isWindowAwailable && (navigator.userAgent.indexOf(\"Safari\") >= 0 || navigator.userAgent.indexOf(\"Konqueror\") >= 0),\r\n\tisFF: isWindowAwailable && (navigator.userAgent.indexOf(\"Firefox\") >= 0),\r\n\tisIPad: isWindowAwailable && (navigator.userAgent.search(/iPad/gi) >= 0),\r\n\tisEdge: isWindowAwailable && (navigator.userAgent.indexOf(\"Edge\")!=-1),\r\n\tisNode: (!isWindowAwailable || typeof navigator == \"undefined\")\r\n};","export default function(data) {\r\n\tif (typeof data === \"string\" || typeof data === \"number\") {\r\n\t\treturn data;\r\n\t}\r\n\tvar result = \"\";\r\n\tfor (var key in data) {\r\n\t\tvar serialized = \"\";\r\n\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\tif (typeof data[key] === \"string\") {\r\n\t\t\t\tserialized = encodeURIComponent(data[key]);\r\n\t\t\t} else if (typeof data[key] === \"number\") {\r\n\t\t\t\tserialized = data[key];\r\n\t\t\t} else {\r\n\t\t\t\tserialized = encodeURIComponent(JSON.stringify(data[key]));\r\n\t\t\t}\r\n\t\t\tserialized = key + \"=\" + serialized;\r\n\r\n\t\t\tif (result.length) {\r\n\t\t\t\tserialized = \"&\" + serialized;\r\n\t\t\t}\r\n\t\t\tresult += serialized;\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}","export default function extend(scheduler) {\r\n\r\nvar generateStringToDate = function (format, utc) {\r\n\tvar splt = \"var temp=date.match(/[a-zA-Z]+|[0-9]+/g);\";\r\n\tvar mask = format.match(/%[a-zA-Z]/g);\r\n\tfor (var i = 0; i < mask.length; i++) {\r\n\t\tswitch (mask[i]) {\r\n\t\t\tcase \"%j\":\r\n\t\t\tcase \"%d\": splt += \"set[2]=temp[\" + i + \"]||1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%n\":\r\n\t\t\tcase \"%m\": splt += \"set[1]=(temp[\" + i + \"]||1)-1;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%y\": splt += \"set[0]=temp[\" + i + \"]*1+(temp[\" + i + \"]>50?1900:2000);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%g\":\r\n\t\t\tcase \"%G\":\r\n\t\t\tcase \"%h\":\r\n\t\t\tcase \"%H\":\r\n\t\t\t\tsplt += \"set[3]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%i\":\r\n\t\t\t\tsplt += \"set[4]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%Y\": splt += \"set[0]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%a\":\r\n\t\t\tcase \"%A\": splt += \"set[3]=set[3]%12+((temp[\" + i + \"]||'').toLowerCase()=='am'?0:12);\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%s\": splt += \"set[5]=temp[\" + i + \"]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%M\": splt += \"set[1]=this.locale.date.month_short_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"%F\": splt += \"set[1]=this.locale.date.month_full_hash[temp[\" + i + \"]]||0;\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tvar code = \"set[0],set[1],set[2],set[3],set[4],set[5]\";\r\n\tif (utc) code = \" Date.UTC(\" + code + \")\";\r\n\treturn new Function(\"date\", \"var set=[0,0,1,0,0,0]; \" + splt + \" return new Date(\" + code + \");\");\r\n};\r\nvar csp_date_to_str = function (format, utc) {\r\n\treturn function(date) {\r\n\t\treturn format.replace(/%[a-zA-Z]/g, function (a) {\r\n\t\t\tswitch (a) {\r\n\t\t\t\tcase \"%d\": return utc ? scheduler.date.to_fixed(date.getUTCDate()) : scheduler.date.to_fixed(date.getDate());\r\n\t\t\t\tcase \"%m\": return utc ? scheduler.date.to_fixed((date.getUTCMonth() + 1)) : scheduler.date.to_fixed((date.getMonth() + 1));\r\n\t\t\t\tcase \"%j\": return utc ? date.getUTCDate() : date.getDate();\r\n\t\t\t\tcase \"%n\": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);\r\n\t\t\t\tcase \"%y\": return utc ? scheduler.date.to_fixed(date.getUTCFullYear() % 100) : scheduler.date.to_fixed(date.getFullYear() % 100);\r\n\t\t\t\tcase \"%Y\": return utc ? date.getUTCFullYear() : date.getFullYear();\r\n\t\t\t\tcase \"%D\": return utc ? scheduler.locale.date.day_short[date.getUTCDay()] : scheduler.locale.date.day_short[date.getDay()];\r\n\t\t\t\tcase \"%l\": return utc ? scheduler.locale.date.day_full[date.getUTCDay()] : scheduler.locale.date.day_full[date.getDay()];\r\n\t\t\t\tcase \"%M\": return utc ? scheduler.locale.date.month_short[date.getUTCMonth()] : scheduler.locale.date.month_short[date.getMonth()];\r\n\t\t\t\tcase \"%F\": return utc ? scheduler.locale.date.month_full[date.getUTCMonth()] : scheduler.locale.date.month_full[date.getMonth()];\r\n\t\t\t\tcase \"%h\": return utc ? scheduler.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : scheduler.date.to_fixed((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%g\": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);\r\n\t\t\t\tcase \"%G\": return utc ? date.getUTCHours() : date.getHours();\r\n\t\t\t\tcase \"%H\": return utc ? scheduler.date.to_fixed(date.getUTCHours()) : scheduler.date.to_fixed(date.getHours());\r\n\t\t\t\tcase \"%i\": return utc ? scheduler.date.to_fixed(date.getUTCMinutes()) : scheduler.date.to_fixed(date.getMinutes());\r\n\t\t\t\tcase \"%a\": return utc ? (date.getUTCHours() > 11 ? \"pm\" : \"am\") : (date.getHours() > 11 ? \"pm\" : \"am\");\r\n\t\t\t\tcase \"%A\": return utc ? (date.getUTCHours() > 11 ? \"PM\" : \"AM\") : (date.getHours() > 11 ? \"PM\" : \"AM\");\r\n\t\t\t\tcase \"%s\": return utc ? scheduler.date.to_fixed(date.getUTCSeconds()) : scheduler.date.to_fixed(date.getSeconds());\r\n\t\t\t\tcase \"%W\": return utc ? scheduler.date.to_fixed(scheduler.date.getUTCISOWeek(date)) : scheduler.date.to_fixed(scheduler.date.getISOWeek(date));\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n};\r\nvar csp_str_to_date = function (format, utc) {\r\n\tconst mask = format.match(/%[a-zA-Z]/g);\r\n\treturn function (date){\r\n\t\tvar set = [0, 0, 1, 0, 0, 0];\r\n\t\tvar temp = date.match(/[a-zA-Z]+|[0-9]+/g);\r\n\r\n\t\tfor (var i = 0; i < mask.length; i++) {\r\n\t\t\tswitch (mask[i]) {\r\n\t\t\t\tcase \"%j\":\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tset[2] = temp[i] || 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%n\":\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tset[1] = (temp[i] || 1) - 1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%y\":\r\n\t\t\t\t\tset[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%g\":\r\n\t\t\t\tcase \"%G\":\r\n\t\t\t\tcase \"%h\":\r\n\t\t\t\tcase \"%H\":\r\n\t\t\t\t\tset[3] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%i\":\r\n\t\t\t\t\tset[4] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tset[0] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%a\":\r\n\t\t\t\tcase \"%A\":\r\n\t\t\t\t\tset[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%s\":\r\n\t\t\t\t\tset[5] = temp[i] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%M\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_short_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%F\":\r\n\t\t\t\t\tset[1] = scheduler.locale.date.month_full_hash[temp[i]] || 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (utc) {\r\n\t\t\treturn new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));\r\n\t\t}\r\n\r\n\t\treturn new Date(set[0], set[1], set[2], set[3], set[4], set[5]);\r\n\t};\r\n};\r\n\r\nlet cspEnabled = undefined;\r\nfunction checkIfCSPEnabled(){\r\n\ttry {\r\n\t\tnew Function(\"cspEnabled = false;\");\r\n\t\tcspEnabled = false;\r\n\t} catch(e) {\r\n\t\tcspEnabled = true;\r\n\t}\r\n\treturn cspEnabled;\r\n}\r\n\r\nfunction useCsp() {\r\n\tvar result = false;\r\n\tif (scheduler.config.csp === \"auto\") {\r\n\t\tif(cspEnabled === undefined){\r\n\t\t\tcspEnabled = checkIfCSPEnabled();\r\n\t\t}\r\n\t\tresult = cspEnabled;\r\n\t} else {\r\n\t\tresult = scheduler.config.csp;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.date = {\r\n\tinit:function(){\r\n\t\tvar s = scheduler.locale.date.month_short;\r\n\t\tvar t = scheduler.locale.date.month_short_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\r\n\t\tvar s = scheduler.locale.date.month_full;\r\n\t\tvar t = scheduler.locale.date.month_full_hash = {};\r\n\t\tfor (var i = 0; i < s.length; i++)\r\n\t\t\tt[s[i]]=i;\r\n\t},\r\n\tdate_part:function(date){\r\n\t\tvar old = new Date(date);\r\n\t\tdate.setHours(0);\r\n\t\tdate.setMinutes(0);\r\n\t\tdate.setSeconds(0);\r\n\t\tdate.setMilliseconds(0);\r\n\t\tif (date.getHours() && //shift to yesterday on dst\r\n\t\t\t(date.getDate() < old.getDate() || date.getMonth() < old.getMonth() || date.getFullYear() < old.getFullYear()) )\r\n\t\t\tdate.setTime(date.getTime() + 60 * 60 * 1000 * (24 - date.getHours()));\r\n\t\treturn date;\r\n\t},\r\n\ttime_part:function(date){\r\n\t\treturn (date.valueOf()/1000 - date.getTimezoneOffset()*60)%86400;\r\n\t},\r\n\tweek_start:function(date){\r\n\t\tvar shift=date.getDay();\r\n\t\tif (scheduler.config.start_on_monday){\r\n\t\t\tif (shift===0) shift=6;\r\n\t\t\telse shift--;\r\n\t\t}\r\n\t\treturn this.date_part(this.add(date,-1*shift,\"day\"));\r\n\t},\r\n\tmonth_start:function(date){\r\n\t\tdate.setDate(1);\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\tyear_start:function(date){\r\n\t\tdate.setMonth(0);\r\n\t\treturn this.month_start(date);\r\n\t},\r\n\tday_start:function(date){\r\n\t\treturn this.date_part(date);\r\n\t},\r\n\t_add_days:function(date, inc){\r\n\t\tvar ndate = new Date(date.valueOf());\r\n\r\n\t\tndate.setDate(ndate.getDate() + inc);\r\n\r\n\t\t// Workaround for Safari/iOS timezone bug, ref:OKZ-149693\r\n\t\tif(inc == Math.round(inc) && inc > 0){\r\n\t\t\tvar datesDiff = +ndate - +date,\r\n\t\t\t\trest = datesDiff % (24*60*60*1000);\r\n\t\t\tif(rest && date.getTimezoneOffset() == ndate.getTimezoneOffset()){\r\n\t\t\t\tvar hours = rest / (60* 60 * 1000);\r\n\t\t\t\tndate.setTime(ndate.getTime() + (24 - hours) * 60 * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (inc >= 0 && (!date.getHours() && ndate.getHours()) &&//shift to yesterday on dst\r\n\t\t\t(ndate.getDate() < date.getDate() || ndate.getMonth() < date.getMonth() || ndate.getFullYear() < date.getFullYear()) )\r\n\t\t\tndate.setTime(ndate.getTime() + 60 * 60 * 1000 * (24 - ndate.getHours()));\r\n\t\treturn ndate;\r\n\t},\r\n\tadd:function(date,inc,mode){\r\n\t\tvar ndate=new Date(date.valueOf());\r\n\t\tswitch(mode){\r\n\t\t\tcase \"day\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\tndate = scheduler.date._add_days(ndate, inc * 7);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\": ndate.setMonth(ndate.getMonth()+inc); break;\r\n\t\t\tcase \"year\": ndate.setYear(ndate.getFullYear()+inc); break;\r\n\t\t\tcase \"hour\":\r\n\t\t\t\t/*\r\n\t\t\t\t setHour(getHour() + inc) and setMinutes gives weird result when is applied on a Daylight Saving time switch\r\n\t\t\t\t setTime seems working as expected\r\n\t\t\t\t*/\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"minute\":\r\n\t\t\t\tndate.setTime(ndate.getTime() + inc * 60 * 1000);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn scheduler.date[\"add_\"+mode](date,inc,mode);\r\n\t\t}\r\n\t\treturn ndate;\r\n\t},\r\n\tto_fixed:function(num){\r\n\t\tif (num<10)\treturn \"0\"+num;\r\n\t\treturn num;\r\n\t},\r\n\tcopy:function(date){\r\n\t\treturn new Date(date.valueOf());\r\n\t},\r\n\tdate_to_str:function(format,utc){\r\n\t\tif (useCsp()) {\r\n\t\t\treturn csp_date_to_str(format,utc);\r\n\t\t}\r\n\r\n\t\tformat=format.replace(/%[a-zA-Z]/g,function(a){\r\n\t\t\tswitch(a){\r\n\t\t\t\tcase \"%d\": return \"\\\"+this.date.to_fixed(date.getDate())+\\\"\";\r\n\t\t\t\tcase \"%m\": return \"\\\"+this.date.to_fixed((date.getMonth()+1))+\\\"\";\r\n\t\t\t\tcase \"%j\": return \"\\\"+date.getDate()+\\\"\";\r\n\t\t\t\tcase \"%n\": return \"\\\"+(date.getMonth()+1)+\\\"\";\r\n\t\t\t\tcase \"%y\": return \"\\\"+this.date.to_fixed(date.getFullYear()%100)+\\\"\";\r\n\t\t\t\tcase \"%Y\": return \"\\\"+date.getFullYear()+\\\"\";\r\n\t\t\t\tcase \"%D\": return \"\\\"+this.locale.date.day_short[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%l\": return \"\\\"+this.locale.date.day_full[date.getDay()]+\\\"\";\r\n\t\t\t\tcase \"%M\": return \"\\\"+this.locale.date.month_short[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%F\": return \"\\\"+this.locale.date.month_full[date.getMonth()]+\\\"\";\r\n\t\t\t\tcase \"%h\": return \"\\\"+this.date.to_fixed((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%g\": return \"\\\"+((date.getHours()+11)%12+1)+\\\"\";\r\n\t\t\t\tcase \"%G\": return \"\\\"+date.getHours()+\\\"\";\r\n\t\t\t\tcase \"%H\": return \"\\\"+this.date.to_fixed(date.getHours())+\\\"\";\r\n\t\t\t\tcase \"%i\": return \"\\\"+this.date.to_fixed(date.getMinutes())+\\\"\";\r\n\t\t\t\tcase \"%a\": return \"\\\"+(date.getHours()>11?\\\"pm\\\":\\\"am\\\")+\\\"\";\r\n\t\t\t\tcase \"%A\": return \"\\\"+(date.getHours()>11?\\\"PM\\\":\\\"AM\\\")+\\\"\";\r\n\t\t\t\tcase \"%s\": return \"\\\"+this.date.to_fixed(date.getSeconds())+\\\"\";\r\n\t\t\t\tcase \"%W\": return \"\\\"+this.date.to_fixed(this.date.getISOWeek(date))+\\\"\";\r\n\t\t\t\tdefault: return a;\r\n\t\t\t}\r\n\t\t});\r\n\t\tif (utc) format=format.replace(/date\\.get/g,\"date.getUTC\");\r\n\t\tvar func = new Function(\"date\",\"return \\\"\"+format+\"\\\";\");\r\n\r\n\t\treturn func.bind(scheduler);\r\n\t},\r\n\tstr_to_date:function(format, utc, exactFormat){\r\n\t\tvar stringToDateMethod = useCsp() ? csp_str_to_date : generateStringToDate;\r\n\t\tvar parseExactFormat = stringToDateMethod(format, utc);\r\n\t\t// eslint-disable-next-line\r\n\t\tvar yyyyMMddhhIIss = /^[0-9]{4}(\\-|\\/)[0-9]{2}(\\-|\\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\r\n\t\t// MM/dd/yyyy - default old format for xml-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar MMddyyyyhhIIss = /^[0-9]{2}\\/[0-9]{2}\\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/;\r\n\t\t// dd-MM-yyyy - default old format for api-date\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ddMMyyyyhhIIss = /^[0-9]{2}\\-[0-9]{2}\\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/;\r\n\t\t// eslint-disable-next-line\r\n\t\tvar ISO8601 = /^([\\+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24\\:?00)([\\.,]\\d+(?!:))?)?(\\17[0-5]\\d([\\.,]\\d+)?)?([zZ]|([\\+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;\r\n\r\n\t\tvar isYMDDate = function (datestr) {\r\n\t\t\treturn yyyyMMddhhIIss.test(String(datestr));\r\n\t\t};\r\n\r\n\t\tvar isMDYDate = function (datestr) {\r\n\t\t\treturn MMddyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isDMYDate = function (datestr) {\r\n\t\t\treturn ddMMyyyyhhIIss.test(String(datestr));\r\n\t\t};\r\n\t\tvar isISO8601 = function (datestr) {\r\n\t\t\treturn ISO8601.test(datestr);\r\n\t\t};\r\n\r\n\t\tvar parseYMD = stringToDateMethod(\"%Y-%m-%d %H:%i:%s\", utc);\r\n\t\tvar parseMDY = stringToDateMethod(\"%m/%d/%Y %H:%i:%s\", utc);\r\n\t\tvar parseDMY = stringToDateMethod(\"%d-%m-%Y %H:%i:%s\", utc);\r\n\r\n\t\treturn function (dateString) {\r\n\r\n\t\t\tif (!exactFormat && !scheduler.config.parse_exact_format) {\r\n\t\t\t\tif (dateString && dateString.getISOWeek) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (typeof dateString === \"number\") {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t} else if (isYMDDate(dateString)) {\r\n\t\t\t\t\treturn parseYMD(dateString);\r\n\t\t\t\t} else if (isMDYDate(dateString)) {\r\n\t\t\t\t\treturn parseMDY(dateString);\r\n\t\t\t\t} else if (isDMYDate(dateString)) {\r\n\t\t\t\t\treturn parseDMY(dateString);\r\n\t\t\t\t} else if (isISO8601(dateString)) {\r\n\t\t\t\t\treturn new Date(dateString);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn parseExactFormat.call(scheduler, dateString);\r\n\t\t};\r\n\t},\r\n\tgetISOWeek: function(ndate) {\r\n\t\tif(!ndate) return false;\r\n\t\tndate = this.date_part(new Date(ndate));\r\n\t\tvar nday = ndate.getDay();\r\n\t\tif (nday === 0) {\r\n\t\t\tnday = 7;\r\n\t\t}\r\n\t\tvar first_thursday = new Date(ndate.valueOf());\r\n\t\tfirst_thursday.setDate(ndate.getDate() + (4 - nday));\r\n\t\tvar year_number = first_thursday.getFullYear(); // year of the first Thursday\r\n\t\tvar ordinal_date = Math.round( (first_thursday.getTime() - new Date(year_number, 0, 1).getTime()) / 86400000); //ordinal date of the first Thursday - 1 (so not really ordinal date)\r\n\t\tvar week_number = 1 + Math.floor( ordinal_date / 7);\r\n\t\treturn week_number;\r\n\t},\r\n\tgetUTCISOWeek: function(ndate){\r\n\t\treturn this.getISOWeek(this.convert_to_utc(ndate));\r\n\t},\r\n\tconvert_to_utc: function(date) {\r\n\t\treturn new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds());\r\n\t}\r\n};\r\n\r\n}\r\n\r\n","export default function(scheduler){\r\n\treturn (function(){\r\n\t\tvar res = {};\r\n\t\tfor (var a in this._events){\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.id.toString().indexOf(\"#\") == -1){\r\n\t\t\t\tres[ev.id] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t}).bind(scheduler);\r\n}","import xmlLoaded from \"./loaders/xml\";\r\nimport jsonLoader from \"./loaders/json\";\r\nimport iCalLoader from \"./loaders/ical\";\r\nimport createSerializator from \"../core/common/get_serializable_events\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler._loaded = {};\r\nscheduler._load = function(url, from) {\r\n\turl = url || this._load_url;\r\n\r\n\tif(!url){\r\n\t\t//if scheduler.setLoadMode is called before scheduler.init, initial rendering will invoke data loading while url is undefined\r\n\t\treturn;\r\n\t}\r\n\r\n\turl += (url.indexOf(\"?\") == -1 ? \"?\" : \"&\") + \"timeshift=\" + (new Date()).getTimezoneOffset();\r\n\tif (this.config.prevent_cache) url += \"&uid=\" + this.uid();\r\n\tvar to;\r\n\tfrom = from || this._date;\r\n\tfunction ajaxCallback(response) {\r\n\t\tscheduler.on_load(response);\r\n\t\tscheduler.callEvent(\"onLoadEnd\", []);\r\n\t}\r\n\tif (this._load_mode) {\r\n\t\tvar lf = this.templates.load_format;\r\n\r\n\t\tfrom = this.date[this._load_mode + \"_start\"](new Date(from.valueOf()));\r\n\t\twhile (from > this._min_date) from = this.date.add(from, -1, this._load_mode);\r\n\t\tto = from;\r\n\r\n\t\tvar cache_line = true;\r\n\t\twhile (to < this._max_date) {\r\n\t\t\tto = this.date.add(to, 1, this._load_mode);\r\n\t\t\tif (this._loaded[lf(from)] && cache_line)\r\n\t\t\t\tfrom = this.date.add(from, 1, this._load_mode); else cache_line = false;\r\n\t\t}\r\n\r\n\t\tvar temp_to = to;\r\n\t\tdo {\r\n\t\t\tto = temp_to;\r\n\t\t\ttemp_to = this.date.add(to, -1, this._load_mode);\r\n\t\t} while (temp_to > from && this._loaded[lf(temp_to)]);\r\n\r\n\t\tif (to <= from)\r\n\t\t\treturn false; //already loaded\r\n\r\n\t\tscheduler.ajax.get(url + \"&from=\" + lf(from) + \"&to=\" + lf(to), ajaxCallback);\r\n\r\n\t\twhile (from < to) {\r\n\t\t\tthis._loaded[lf(from)] = true;\r\n\t\t\tfrom = this.date.add(from, 1, this._load_mode);\r\n\t\t}\r\n\t} else {\r\n\t\tscheduler.ajax.get(url, ajaxCallback);\r\n\t}\r\n\r\n\t// TODO: remove onXLS\r\n\tthis.callEvent(\"onXLS\", []);\r\n\tthis.callEvent(\"onLoadStart\", []);\r\n\treturn true;\r\n};\r\n\r\nscheduler._parsers = {};\r\n\r\n\r\nxmlLoaded(scheduler);\r\njsonLoader(scheduler);\r\niCalLoader(scheduler);\r\n\r\nscheduler.on_load = function (loader) {\r\n\tthis.callEvent(\"onBeforeParse\", []);\r\n\r\n\tvar evs;\r\n\tvar error = false;\r\n\r\n\tvar foundParser = false;\r\n\tfor(var i in this._parsers){\r\n\t\tvar parser = this._parsers[i];\r\n\t\tif(parser.canParse(loader.xmlDoc.responseText, loader.xmlDoc)){\r\n\t\t\ttry{\r\n\t\t\t\tvar param = loader.xmlDoc.responseText;\r\n\t\t\t\tif(i === \"xml\"){\r\n\t\t\t\t\tparam = loader;\r\n\t\t\t\t}\r\n\t\t\t\tevs = parser.parse(param);\r\n\t\t\t\tif(!evs){\r\n\t\t\t\t\terror = true;\r\n\t\t\t\t}\r\n\t\t\t}catch(e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t\tfoundParser = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif(!foundParser){\r\n\t\tif(this._process && this[this._process]){\r\n\t\t\ttry{\r\n\t\t\t\tevs = this[this._process].parse(loader.xmlDoc.responseText);\r\n\t\t\t}catch (e){\r\n\t\t\t\terror = true;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\terror = true;\r\n\t\t}\r\n\t}\r\n\r\n\tif(error || (loader.xmlDoc.status && loader.xmlDoc.status >= 400)){\r\n\t\tthis.callEvent(\"onLoadError\", [loader.xmlDoc]);\r\n\t\tevs = [];\r\n\t}\r\n\r\n\tthis._process_loading(evs);\r\n\r\n\t// TODO: remove onXLE\r\n\tthis.callEvent(\"onXLE\", []);\r\n\tthis.callEvent(\"onParse\", []);\r\n};\r\nscheduler._process_loading = function(evs) {\r\n\tthis._loading = true;\r\n\tthis._not_render = true;\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tif (!this.callEvent(\"onEventLoading\", [evs[i]])) continue;\r\n\t\tthis.addEvent(evs[i]);\r\n\t}\r\n\tthis._not_render = false;\r\n\tif (this._render_wait) this.render_view_data();\r\n\r\n\tthis._loading = false;\r\n\tif (this._after_call) this._after_call();\r\n\tthis._after_call = null;\r\n};\r\nscheduler._init_event = function(event) {\r\n\tevent.text = (event.text || event._tagvalue) || \"\";\r\n\tevent.start_date = scheduler._init_date(event.start_date);\r\n\tevent.end_date = scheduler._init_date(event.end_date);\r\n};\r\n\r\nscheduler._init_date = function(date){\r\n\tif(!date)\r\n\t\treturn null;\r\n\tif (typeof date == \"string\") {\r\n\t\treturn scheduler._helpers.parseDate(date);\r\n\t}\r\n\telse return new Date(date);\r\n};\r\n\r\nconst getSerializableData = createSerializator(scheduler);\r\nscheduler.serialize = function(){\r\n\tconst dataset = [];\r\n\tconst allEvents = getSerializableData();\r\n\tfor (var a in allEvents){\r\n\t\t\r\n\t\tconst exportedEvent = {};\r\n\t\tvar ev = allEvents[a];\r\n\r\n\t\tfor(var key in ev){\r\n\t\t\tif (key.charAt(0) == \"$\" || key.charAt(0) == \"_\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tlet exportValue;\r\n\t\t\tconst rawValue = ev[key];\r\n\t\t\tif(scheduler.utils.isDate(rawValue)){\r\n\t\t\t\texportValue = scheduler.defined(scheduler.templates.xml_format) ? scheduler.templates.xml_format(rawValue) : scheduler.templates.format_date(rawValue);\r\n\t\t\t}else{\r\n\t\t\t\texportValue = rawValue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\texportedEvent[key] = exportValue;\r\n\t\t}\r\n\r\n\t\tdataset.push(exportedEvent);\r\n\t}\r\n\treturn dataset;\r\n};\r\n\r\n/*\r\nscheduler.json = {};\r\nscheduler.json.parse = function(data) {\r\n\r\n\tvar events = [];\r\n\r\n\tif (typeof data == \"string\") {\r\n\t\tdata = JSON.parse(data);\r\n\t}\r\n\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\tevents = data;\r\n\t} else {\r\n\t\tif(data){\r\n\t\t\tif(data.events){\r\n\t\t\t\tevents = data.events;\r\n\t\t\t}else if(data.data){\r\n\t\t\t\tevents = data.data;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tevents = events || [];\r\n\r\n\tif (data.dhx_security) {\r\n\t\tif (window.dhtmlx) {\r\n\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t}\r\n\t\tscheduler.security_key = data.dhx_security;\r\n\t}\r\n\r\n\tvar collections = (data && data.collections) ? data.collections : {};\r\n\tvar collections_loaded = false;\r\n\tfor (var key in collections) {\r\n\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\tcollections_loaded = true;\r\n\t\t\tvar collection = collections[key];\r\n\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\tvar option = collection[j];\r\n\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (collections_loaded)\r\n\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\tvar evs = [];\r\n\tfor (var i = 0; i < events.length; i++) {\r\n\t\tvar event = events[i];\r\n\t\tscheduler._init_event(event);\r\n\t\tevs.push(event);\r\n\t}\r\n\treturn evs;\r\n};*/\r\nscheduler.parse = function(data, type) {\r\n\tthis._process = type;\r\n\tthis.on_load({xmlDoc: {responseText: data}});\r\n};\r\nscheduler.load = function(url, call) {\r\n\tif (typeof call == \"string\") {\r\n\t\tthis._process = call;\r\n\t\tcall = arguments[2];\r\n\t}\r\n\r\n\tthis._load_url = url;\r\n\tthis._after_call = call;\r\n\tthis._load(url, this._date);\r\n};\r\n//possible values - day,week,month,year,all\r\nscheduler.setLoadMode = function(mode) {\r\n\tif (mode == \"all\") mode = \"\";\r\n\tthis._load_mode = mode;\r\n};\r\n\r\nscheduler.serverList = function(name, array) {\r\n\tif (array) {\r\n\t\tthis.serverList[name] = array.slice(0);\r\n\t\treturn this.serverList[name];\r\n\t}\r\n\tthis.serverList[name] = (this.serverList[name] || []);\r\n\treturn this.serverList[name];\r\n};\r\nscheduler._userdata = {};\r\n\r\nscheduler._xmlNodeToJSON = function(node) {\r\n\tvar t = {};\r\n\tfor (var i = 0; i < node.attributes.length; i++)\r\n\t\tt[node.attributes[i].name] = node.attributes[i].value;\r\n\r\n\tfor (var i = 0; i < node.childNodes.length; i++) {\r\n\t\tvar child = node.childNodes[i];\r\n\t\tif (child.nodeType == 1)\r\n\t\t\tt[child.tagName] = child.firstChild ? child.firstChild.nodeValue : \"\";\r\n\t}\r\n\r\n\tif (!t.text) t.text = node.firstChild ? node.firstChild.nodeValue : \"\";\r\n\r\n\treturn t;\r\n};\r\nscheduler.attachEvent(\"onXLS\", function() {\r\n\tif (this.config.show_loading === true) {\r\n\t\tvar t;\r\n\t\tt = this.config.show_loading = document.createElement(\"div\");\r\n\t\tt.className = 'dhx_loading';\r\n\t\tt.style.left = Math.round((this._x - 128) / 2) + \"px\";\r\n\t\tt.style.top = Math.round((this._y - 15) / 2) + \"px\";\r\n\t\tthis._obj.appendChild(t);\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onXLE\", function() {\r\n\tvar t = this.config.show_loading;\r\n\tif (t && typeof t == \"object\") {\r\n\t\tif(t.parentNode) {\r\n\t\t\tt.parentNode.removeChild(t);\r\n\t\t}\r\n\t\tthis.config.show_loading = true;\r\n\t}\r\n});\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._parsers.xml = {\r\n\tcanParse: function(data, xhr){\r\n\t\t// IE returns non-empty responseXML type regardless of actual data type\r\n\t\tif(xhr.responseXML && xhr.responseXML.firstChild){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\ttry{\r\n\t\t\tvar xmlDoc = scheduler.ajax.parse(xhr.responseText);\r\n\t\t\tvar topElement = scheduler.ajax.xmltop(\"data\", xmlDoc);\r\n\t\t\tif(topElement && topElement.tagName === \"data\"){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}catch (e){\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(loader) {\r\n\t\tvar xml;\r\n\r\n\t\tif (!loader.xmlDoc.responseXML) { //from a string\r\n\t\t\tloader.xmlDoc.responseXML = scheduler.ajax.parse(loader.xmlDoc.responseText);\r\n\t\t}\r\n\t\r\n\t\txml = scheduler.ajax.xmltop(\"data\", loader.xmlDoc);\r\n\t\tif (xml.tagName != \"data\") return null;//not an xml\r\n\t\tvar csrfToken = xml.getAttribute(\"dhx_security\");\r\n\t\tif (csrfToken) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = csrfToken;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = csrfToken;\r\n\t\t}\r\n\t\r\n\t\tvar opts = scheduler.ajax.xpath(\"//coll_options\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < opts.length; i++) {\r\n\t\t\tvar bind = opts[i].getAttribute(\"for\");\r\n\t\t\tvar arr = scheduler.serverList[bind];\r\n\t\t\tif (!arr) {\r\n\t\t\t\tscheduler.serverList[bind] = arr = [];\r\n\t\t\t}\r\n\t\t\tarr.splice(0, arr.length);\t//clear old options\r\n\t\t\tvar itms = scheduler.ajax.xpath(\".//item\", opts[i]);\r\n\t\t\tfor (var j = 0; j < itms.length; j++) {\r\n\t\t\t\tvar itm = itms[j];\r\n\t\t\t\tvar attrs = itm.attributes;\r\n\t\t\t\tvar obj = { key: itms[j].getAttribute(\"value\"), label: itms[j].getAttribute(\"label\")};\r\n\t\t\t\tfor (var k = 0; k < attrs.length; k++) {\r\n\t\t\t\t\tvar attr = attrs[k];\r\n\t\t\t\t\tif (attr.nodeName == \"value\" || attr.nodeName == \"label\")\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\tobj[attr.nodeName] = attr.nodeValue;\r\n\t\t\t\t}\r\n\t\t\t\tarr.push(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (opts.length)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\t\r\n\t\tvar ud = scheduler.ajax.xpath(\"//userdata\", loader.xmlDoc);\r\n\t\tfor (var i = 0; i < ud.length; i++) {\r\n\t\t\tvar udx = scheduler._xmlNodeToJSON(ud[i]);\r\n\t\t\tscheduler._userdata[udx.name] = udx.text;\r\n\t\t}\r\n\t\r\n\t\tvar evs = [];\r\n\t\txml = scheduler.ajax.xpath(\"//event\", loader.xmlDoc);\r\n\t\r\n\t\tfor (var i = 0; i < xml.length; i++) {\r\n\t\t\tvar ev = evs[i] = scheduler._xmlNodeToJSON(xml[i]);\r\n\t\t\tscheduler._init_event(ev);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.json = scheduler._parsers.json = {\r\n\tcanParse: function(data){\r\n\t\tif(data && typeof data === \"object\"){\r\n\t\t\treturn true;\r\n\t\t} else if(typeof data === \"string\"){\r\n\t\t\ttry {\r\n\t\t\t\tvar result = JSON.parse(data);\r\n\t\t\t\treturn Object.prototype.toString.call(result) === '[object Object]' || \r\n\t\t\t\t\t\tObject.prototype.toString.call(result) === '[object Array]';\r\n\t\t\t} catch (err) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\tparse: function(data) {\r\n\t\tvar events = [];\r\n\r\n\t\tif (typeof data == \"string\") {\r\n\t\t\tdata = JSON.parse(data);\r\n\t\t}\r\n\t\tif (Object.prototype.toString.call(data) === '[object Array]') {\r\n\t\t\tevents = data;\r\n\t\t} else {\r\n\t\t\tif(data){\r\n\t\t\t\tif(data.events){\r\n\t\t\t\t\tevents = data.events;\r\n\t\t\t\t}else if(data.data){\r\n\t\t\t\t\tevents = data.data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tevents = events || [];\r\n\r\n\t\tif (data.dhx_security) {\r\n\t\t\tif (window.dhtmlx) {\r\n\t\t\t\twindow.dhtmlx.security_key = data.dhx_security;\r\n\t\t\t}\r\n\t\t\tscheduler.security_key = data.dhx_security;\r\n\t\t}\r\n\r\n\t\tvar collections = (data && data.collections) ? data.collections : {};\r\n\t\tvar collections_loaded = false;\r\n\t\tfor (var key in collections) {\r\n\t\t\tif (collections.hasOwnProperty(key)) {\r\n\t\t\t\tcollections_loaded = true;\r\n\t\t\t\tvar collection = collections[key];\r\n\t\t\t\tvar arr = scheduler.serverList[key];\r\n\t\t\t\tif (!arr) {\r\n\t\t\t\t\tscheduler.serverList[key] = arr = [];\r\n\t\t\t\t}\r\n\t\t\t\tarr.splice(0, arr.length); //clear old options\r\n\t\t\t\tfor (var j = 0; j < collection.length; j++) {\r\n\t\t\t\t\tvar option = collection[j];\r\n\t\t\t\t\tvar obj = { key: option.value, label: option.label }; // resulting option object\r\n\t\t\t\t\tfor (var option_key in option) {\r\n\t\t\t\t\t\tif (option.hasOwnProperty(option_key)) {\r\n\t\t\t\t\t\t\tif (option_key == \"value\" || option_key == \"label\")\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\tobj[option_key] = option[option_key]; // obj['value'] = option['value']\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tarr.push(obj);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (collections_loaded)\r\n\t\t\tscheduler.callEvent(\"onOptionsLoad\", []);\r\n\r\n\t\tvar evs = [];\r\n\t\tfor (var i = 0; i < events.length; i++) {\r\n\t\t\tvar event = events[i];\r\n\t\t\tscheduler._init_event(event);\r\n\t\t\tevs.push(event);\r\n\t\t}\r\n\t\treturn evs;\r\n\t}\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler.ical = scheduler._parsers.ical = {\r\n\tcanParse: function(data){\r\n\t\tif(typeof data === \"string\"){\r\n\t\t\treturn new RegExp(\"^BEGIN:VCALENDAR\").test(data);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t},\r\n\tparse:function(str){\r\n\t\tvar data = str.match(RegExp(this.c_start+\"[^\\f]*\"+this.c_end,\"\"));\r\n\t\tif (!data.length) return;\r\n\r\n\t\t// mpl: handle bad unfolding\r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+ /g,\"\");\r\n\r\n\t\t//unfolding \r\n\t\tdata[0]=data[0].replace(/[\\r\\n]+(?=[a-z \\t])/g,\" \");\r\n\t\t//drop property\r\n\t\tdata[0]=data[0].replace(/;[^:\\r\\n]*:/g,\":\");\r\n\t\t\r\n\t\t\r\n\t\tvar incoming=[];\r\n\t\tvar match;\r\n\t\tvar event_r = RegExp(\"(?:\"+this.e_start+\")([^\\f]*?)(?:\"+this.e_end+\")\",\"g\");\r\n\t\twhile ((match=event_r.exec(data)) !== null){\r\n\t\t\tvar e={};\r\n\t\t\tvar param;\r\n\t\t\tvar param_r = /[^\\r\\n]+[\\r\\n]+/g;\r\n\t\t\twhile ((param=param_r.exec(match[1])) !== null)\r\n\t\t\t\tthis.parse_param(param.toString(),e);\r\n\t\t\tif (e.uid && !e.id) e.id = e.uid; //fallback to UID, when ID is not defined\r\n\t\t\tincoming.push(e);\t\r\n\t\t}\r\n\t\treturn incoming;\r\n\t},\r\n\tparse_param:function(str,obj){\r\n\t\tvar d = str.indexOf(\":\"); \r\n\t\t\tif (d==-1) return;\r\n\t\t\r\n\t\tvar name = str.substr(0,d).toLowerCase();\r\n\t\tvar value = str.substr(d+1).replace(/\\\\,/g,\",\").replace(/[\\r\\n]+$/,\"\");\r\n\t\tif (name==\"summary\")\r\n\t\t\tname=\"text\";\r\n\t\telse if (name==\"dtstart\"){\r\n\t\t\tname = \"start_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\telse if (name==\"dtend\"){\r\n\t\t\tname = \"end_date\";\r\n\t\t\tvalue = this.parse_date(value,0,0);\r\n\t\t}\r\n\t\tobj[name]=value;\r\n\t},\r\n\tparse_date:function(value,dh,dm){\r\n\t\tvar t = value.split(\"T\");\r\n\r\n\t\tvar utcMark = false;\r\n\t\tif (t[1]){\r\n\t\t\tdh=t[1].substr(0,2);\r\n\t\t\tdm=t[1].substr(2,2);\r\n\t\t\tutcMark = !!(t[1][6] == \"Z\");\r\n\t\t}\r\n\t\tvar dy = t[0].substr(0,4);\r\n\t\tvar dn = parseInt(t[0].substr(4,2),10)-1;\r\n\t\tvar dd = t[0].substr(6,2);\r\n\r\n\t\tif(scheduler.config.server_utc || utcMark){\r\n\t\t\treturn new Date(Date.UTC(dy,dn,dd,dh,dm)) ;\r\n\t\t}else{\r\n\t\t\treturn new Date(dy,dn,dd,dh,dm);\r\n\t\t}\r\n\t},\r\n\tc_start:\"BEGIN:VCALENDAR\",\r\n\te_start:\"BEGIN:VEVENT\",\r\n\te_end:\"END:VEVENT\",\r\n\tc_end:\"END:VCALENDAR\"\t\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._init_touch_events = function(){\r\n\tvar mobile = this.config.touch &&\r\n\t\t( ((navigator.userAgent.indexOf(\"Mobile\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"iPad\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Android\")!=-1) ||\r\n\t\t\t(navigator.userAgent.indexOf(\"Touch\")!=-1)) && !window.MSStream) ||\r\n\t\t\t((navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\r\n\r\n\tif(mobile){\r\n\t\tthis.xy.scroll_width = 0;\r\n\t\tthis._mobile = true;\r\n\t}\r\n\r\n\tif(this.config.touch){\r\n\r\n\t\tvar touchEventsSupported = true;\r\n\t\ttry {\r\n\t\t\tdocument.createEvent(\"TouchEvent\");\r\n\t\t} catch (e) {\r\n\t\t\ttouchEventsSupported = false;\r\n\t\t}\r\n\r\n\t\tif (touchEventsSupported) {\r\n\t\t\tthis._touch_events([\"touchmove\", \"touchstart\", \"touchend\"], function (ev) {\r\n\t\t\t\tif (ev.touches && ev.touches.length > 1) return null;\r\n\t\t\t\tif (ev.touches[0])\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\ttarget: ev.target,\r\n\t\t\t\t\t\tpageX: ev.touches[0].pageX,\r\n\t\t\t\t\t\tpageY: ev.touches[0].pageY,\r\n\t\t\t\t\t\tclientX: ev.touches[0].clientX,\r\n\t\t\t\t\t\tclientY: ev.touches[0].clientY\r\n\t\t\t\t\t};\r\n\t\t\t\telse\r\n\t\t\t\t\treturn ev;\r\n\t\t\t}, function () {\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else if (window.PointerEvent || window.navigator.pointerEnabled) {\r\n\t\t\tthis._touch_events([\"pointermove\", \"pointerdown\", \"pointerup\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == \"mouse\") return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || (ev.pointerType == \"mouse\" ));\r\n\t\t\t});\r\n\t\t} else if (window.navigator.msPointerEnabled) {\r\n\t\t\tthis._touch_events([\"MSPointerMove\", \"MSPointerDown\", \"MSPointerUp\"], function (ev) {\r\n\t\t\t\tif (ev.pointerType == ev.MSPOINTER_TYPE_MOUSE) return null;\r\n\t\t\t\treturn ev;\r\n\t\t\t}, function (ev) {\r\n\t\t\t\treturn (!ev || ev.pointerType == ev.MSPOINTER_TYPE_MOUSE);\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler._touch_events = function(names, accessor, ignore){\r\n\t//webkit on android need to be handled separately\r\n\t//var a_webkit = (navigator.userAgent.indexOf(\"Android\")!=-1) && (navigator.userAgent.indexOf(\"WebKit\")!=-1);\r\n\tvar source, tracker, timer, drag_mode, scroll_mode, action_mode;\r\n\tvar dblclicktime = 0;\r\n\r\n\tfunction attachTouchEvent(element, name, callback){\r\n\t\t//touch gestures must be disabled when ligthbox is opened\r\n\t\tscheduler.event(element, name, function(e){\r\n\t\t\tif(scheduler._is_lightbox_open()){\r\n\t\t\t\treturn true;\r\n\t\t\t}else{\r\n\t\t\t\tif (ignore(e)) return;\r\n\t\t\t\treturn callback(e);\r\n\t\t\t}\r\n\t\t}, { passive: false });\r\n\t}\r\n\r\n\tfunction check_direction_swipe(s_ev, e_ev, step, max_dy){\r\n\t\tif (!s_ev || !e_ev) return false;\r\n\r\n\t\tvar t = s_ev.target;\r\n\t\twhile(t && t != scheduler._obj){\r\n\t\t\tt = t.parentNode;\r\n\t\t}\r\n\t\tif(t != scheduler._obj){\r\n\t\t\t//swipe outside scheduler\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// ignore swipe in horizontal timeline\r\n\t\tif(scheduler.matrix && scheduler.matrix[scheduler.getState().mode]){\r\n\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\tif(timeline.scrollable){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar dy = Math.abs(s_ev.pageY - e_ev.pageY);\r\n\t\tvar dx = Math.abs(s_ev.pageX - e_ev.pageX);\r\n\t\tif (dy < max_dy && dx>step && (!dy || (dx/dy > 3))){\r\n\t\t\tif (s_ev.pageX > e_ev.pageX) {\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t}else {\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction doMouseMove(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tvar dnd = scheduler.getState().drag_mode,\r\n\t\t\ttimeline = scheduler.matrix ? scheduler.matrix[scheduler._mode] : false;\r\n\r\n\t\tvar original_render = scheduler.render_view_data;\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\t//suppress full redraw of timeline on creating event\r\n\t\t\tscheduler.render_view_data = function() {\r\n\t\t\t\tvar id = scheduler.getState().drag_id;\r\n\t\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\t\tvar property = timeline.y_property;\r\n\r\n\t\t\t\tvar evs = scheduler.getEvents(ev.start_date, ev.end_date);\r\n\t\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\t\tif(evs[i][property] != ev[property]){\r\n\t\t\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tev._sorder = evs.length - 1;\r\n\t\t\t\tev._count = evs.length;\r\n\r\n\t\t\t\tthis.render_data([ev], scheduler.getState().mode);\r\n\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tscheduler._on_mouse_move(e);\r\n\r\n\t\tif(dnd == 'create' && timeline){\r\n\t\t\tscheduler.render_view_data = original_render;\r\n\t\t}\r\n\r\n\t\tif (e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\te.cancelBubble = true;\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// touchmove\r\n\tattachTouchEvent(document.body, names[0], function(e){\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tvar acc = accessor(e);\r\n\t\tif(!acc) return;\r\n\t\tif (drag_mode){\r\n\t\t\tdoMouseMove(acc);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._update_global_tip();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//if (tracker && a_webkit){\r\n\t\t//\tcheck_direction_swipe(tracker, accessor(e), 0);\r\n\t\t//}\r\n\r\n\t\ttracker = accessor(e);\r\n\t\t//ignore common and scrolling moves\r\n\t\tif (!action_mode) return;\r\n\r\n\t\t//multitouch\r\n\t\tif (!tracker){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//target changed - probably in scroll mode\r\n\r\n\t\tif (source.target != tracker.target || (Math.abs(source.pageX - tracker.pageX) > 5) || (Math.abs(source.pageY - tracker.pageY) > 5)){\r\n\t\t\tscroll_mode = true;\r\n\t\t\tclearTimeout(timer);\r\n\t\t}\r\n\r\n\t});\r\n\r\n\t//attachTouchEvent(this._els[\"dhx_cal_data\"][0], \"scroll\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"touchcancel\", drag_cancel);\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], \"contextmenu\", function(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tif (action_mode){\r\n\t\t\tif (e && e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\t// touchstart\r\n\tattachTouchEvent(this._obj, names[1], function(e){\r\n\t\t// block pull-to-refresh\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.add(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._pointerDragId = e.pointerId;\r\n\r\n\t\tvar fake_event;\r\n\t\tdrag_mode = scroll_mode = false;\r\n\t\taction_mode = true;\r\n\t\tfake_event = tracker = accessor(e);\r\n\r\n\t\tif (!fake_event){\r\n\t\t\tscroll_mode = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t//dbl click\r\n\t\tvar now = new Date();\r\n\r\n\t\tif (!scroll_mode && !drag_mode && now - dblclicktime < 250){\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\twindow.setTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t//fake_event.type = \"dblclick\";\r\n\t\t\t\tscheduler._on_dbl_click(fake_event);\r\n\t\t\t}, 50);\r\n\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._block_next_stop = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tdblclicktime = now;\r\n\r\n\t\t//drag\r\n\r\n\t\tif (scroll_mode || drag_mode || !scheduler.config.touch_drag)\r\n\t\t\treturn;\r\n\r\n\t\tvar actTask = scheduler._locate_event(document.activeElement);\r\n\t\tvar fakeTask = scheduler._locate_event(fake_event.target);\r\n\t\tvar sourceTask = source? scheduler._locate_event(source.target) : null;\r\n\r\n\t\tif(actTask && fakeTask && actTask == fakeTask && actTask != sourceTask)\r\n\t\t{\r\n\t\t\tif(e.preventDefault) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\tscheduler._click.dhx_cal_data(fake_event);\r\n\t\t\tsource = fake_event;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//there is no target\r\n\t\ttimer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tdrag_mode = true;\r\n\t\t\tvar target = source.target;\r\n\t\t\tvar className = scheduler._getClassName(target);\r\n\t\t\tif (target && className.indexOf(\"dhx_body\") != -1)\r\n\t\t\t\ttarget = target.previousSibling;\r\n\r\n\t\t\tscheduler._on_mouse_down(source, target);\r\n\t\t\tif (scheduler._drag_mode && scheduler._drag_mode != \"create\"){\r\n\t\t\t\tscheduler.for_rendered(scheduler._drag_id, function(node, i) {\r\n\t\t\t\t\tnode.style.display='none';\r\n\t\t\t\t\tscheduler._rendered.splice(i, 1);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (scheduler.config.touch_tip) {\r\n\t\t\t\tscheduler._show_global_tip();\r\n\t\t\t}\r\n\t\t\tscheduler.updateEvent(scheduler._drag_id);\r\n\t\t},scheduler.config.touch_drag);\r\n\r\n\t\tsource = fake_event;\r\n\t});\r\n\tfunction drag_cancel(e){\r\n\t\tif (ignore(e)) return;\r\n\t\tscheduler._hide_global_tip();\r\n\t\tif (drag_mode){\r\n\t\t\tscheduler._on_mouse_up( accessor(e) );\r\n\t\t\tscheduler._temp_touch_block = false;\r\n\t\t}\r\n\t\tscheduler._drag_id = null;\r\n\t\tscheduler._drag_mode=null;\r\n\t\tscheduler._drag_pos=null;\r\n\t\tscheduler._pointerDragId = null;\r\n\t\tclearTimeout(timer);\r\n\t\tdrag_mode = action_mode = false;\r\n\t\tscroll_mode = true;\r\n\t}\r\n\r\n\t// touch end\r\n\tattachTouchEvent(this._els[\"dhx_cal_data\"][0], names[2], function(e){\r\n\t\tif(document && document.body){\r\n\t\t\tdocument.body.classList.remove(\"dhx_cal_touch_active\");\r\n\t\t}\r\n\r\n\t\tif (ignore(e)) return;\r\n\r\n\t\tif(scheduler.config.touch_swipe_dates){\r\n\t\t\tif (!drag_mode && check_direction_swipe(source, tracker, 200, 100)) {\r\n\t\t\t\tscheduler._block_next_stop = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (drag_mode) {\r\n\t\t\tscheduler._ignore_next_click = true;\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\t}, 100);\r\n\t\t}\r\n\r\n\t\tdrag_cancel(e);\r\n\t\tif (scheduler._block_next_stop){\r\n\t\t\tscheduler._block_next_stop = false;\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.event(document.body, names[2], drag_cancel);\r\n};\r\n\r\nscheduler._show_global_tip = function(){\r\n\tscheduler._hide_global_tip();\r\n\r\n\tvar toptip = scheduler._global_tip = document.createElement(\"div\");\r\n\ttoptip.className='dhx_global_tip';\r\n\r\n\tscheduler._update_global_tip(1);\r\n\r\n\tdocument.body.appendChild(toptip);\r\n};\r\nscheduler._update_global_tip = function(init){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip){\r\n\t\tvar time = \"\";\r\n\t\tif (scheduler._drag_id && !init){\r\n\t\t\tvar ev = scheduler.getEvent(scheduler._drag_id);\r\n\t\t\tif (ev)\r\n\t\t\t\ttime = \"\" + (ev._timed ? scheduler.templates.event_header(ev.start_date, ev.end_date, ev):scheduler.templates.day_date(ev.start_date, ev.end_date, ev)) + \"
\";\r\n\t\t}\r\n\r\n\t\tif (scheduler._drag_mode == \"create\" || scheduler._drag_mode == \"new-size\")\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_create || \"Drag to create\")+time;\r\n\t\telse\r\n\t\t\ttoptip.innerHTML = (scheduler.locale.labels.drag_to_move || \"Drag to move\")+time;\r\n\t}\r\n};\r\nscheduler._hide_global_tip = function(){\r\n\tvar toptip = scheduler._global_tip;\r\n\tif (toptip && toptip.parentNode){\r\n\t\ttoptip.parentNode.removeChild(toptip);\r\n\t\tscheduler._global_tip = 0;\r\n\t}\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._addThemeClass = function(){\r\n\tdocument.documentElement.setAttribute(\"data-scheduler-theme\", scheduler.skin);\r\n};\r\n\r\nscheduler._skin_settings = {\r\n\tfix_tab_position: [1,0],\r\n\tuse_select_menu_space: [1,0],\r\n\twide_form: [1,0],\r\n\r\n\thour_size_px: [44,42],\r\n\tdisplayed_event_color: [\"#ff4a4a\", \"ffc5ab\"],\r\n\tdisplayed_event_text_color: [\"#ffef80\", \"7e2727\"]\r\n};\r\n\r\nscheduler._skin_xy = {\r\n\tlightbox_additional_height: [90,50],\r\n\tnav_height: [59,22],\r\n\tbar_height: [24,20]\r\n};\r\n\r\n// material skin uses a different box sizing model than other skins, and also requires some post-processing.\r\n// In order to render events correctly, we need to know which box sizing model is used\r\n// We can detect it by styles applied, taking into account that styles may be loaded after scheduler is rendered\r\n\r\nscheduler._is_material_skin = function(){\r\n\tif(!scheduler.skin){\r\n\t\treturn checkIfMaterialSkin();\r\n\t}else{\r\n\t\treturn ((scheduler.skin + \"\").indexOf(\"material\") > -1);\r\n\t}\r\n};\r\n\r\nfunction themeNameFromFile(){\r\n\tvar links = document.getElementsByTagName(\"link\");\r\n\tfor (var i = 0; i < links.length; i++) {\r\n\t\tvar res = links[i].href.match(\"dhtmlxscheduler_([a-z]+).css\");\r\n\t\tif (res){\r\n\t\t\treturn res[1];\r\n\t\t}\r\n\t}\r\n}\r\n\r\nscheduler._build_skin_info = function() {\r\n\tmonitorThemeChange();\r\n\tconst styles = getComputedStyle(this.$container);\r\n\tconst themeVar = styles.getPropertyValue(\"--dhx-scheduler-theme\");\r\n\r\n\tlet isCssVarTheme = !!themeVar;\r\n\tlet themeName;\r\n\tlet cssValues = {};\r\n\tlet oldMaterialTheme = false;\r\n\r\n\tif(isCssVarTheme){\r\n\t\tthemeName = themeVar;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tcssValues[i] = styles.getPropertyValue(`--dhx-scheduler-xy-${i}`);\r\n\t\t}\r\n\r\n\t\tcssValues.hour_size_px = styles.getPropertyValue(`--dhx-scheduler-config-hour_size_px`);\r\n\t\tcssValues.wide_form = styles.getPropertyValue(`--dhx-scheduler-config-form_wide`);\r\n\r\n\t}else{\r\n\t\tthemeName = themeNameFromFile();\r\n\t\toldMaterialTheme = scheduler._is_material_skin();\r\n\t}\r\n\r\n\r\n\tscheduler._theme_info = {\r\n\t\ttheme: themeName,\r\n\t\tcssVarTheme: isCssVarTheme,\r\n\t\toldMaterialTheme: oldMaterialTheme,\r\n\t\tvalues: cssValues\r\n\t};\r\n\r\n\tif(scheduler._theme_info.cssVarTheme){\r\n\t\tconst themeVariables = this._theme_info.values;\r\n\t\tfor(let i in scheduler.xy){\r\n\t\t\tif(!isNaN(parseInt(themeVariables[i]))){\r\n\t\t\t\tscheduler.xy[i] = parseInt(themeVariables[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\nvar calculatedMaterial;\r\nfunction checkIfMaterialSkin(){\r\n\tif(calculatedMaterial === undefined){\r\n\t\tvar probe = document.createElement(\"div\");\r\n\t\tprobe.style.position = \"absolute\";\r\n\t\tprobe.style.left = \"-9999px\";\r\n\t\tprobe.style.top = \"-9999px\";\r\n\t\tprobe.innerHTML = \"\" +\r\n\t\t\t\"
\" +\r\n\t\t\t\"
\"+\r\n\t\t\"
\";\r\n\t\tdocument.body.appendChild(probe);\r\n\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_cal_scale_placeholder\"));\r\n\t\tvar position = styles.getPropertyValue('position');\r\n\t\tif(position === \"absolute\"){\r\n\t\t\t// page has skins for placeholder element from material skin\r\n\t\t\tcalculatedMaterial = true;\r\n\t\t}else{\r\n\t\t\tcalculatedMaterial = false;\r\n\t\t}\r\n\r\n\t\tsetTimeout(function(){\r\n\t\t\tcalculatedMaterial = null;\r\n\t\t\tif(probe && probe.parentNode){\r\n\t\t\t\tprobe.parentNode.removeChild(probe);\r\n\t\t\t}\r\n\t\t}, 500);\r\n\t}\r\n\treturn calculatedMaterial;\r\n}\r\n\r\nvar cachedBorderBoxValue;\r\nfunction checkIfBorderBoxStyling(){\r\n\tif(scheduler._is_material_skin()){\r\n\t\treturn true;\r\n\t}else{\r\n\t\tif(cachedBorderBoxValue === undefined){\r\n\t\t\tvar probe = document.createElement(\"div\");\r\n\t\t\tprobe.style.position = \"absolute\";\r\n\t\t\tprobe.style.left = \"-9999px\";\r\n\t\t\tprobe.style.top = \"-9999px\";\r\n\t\t\tprobe.innerHTML = \"
\" +\r\n\t\t\t\t\"
\" +\r\n\t\t\t\t\t\"
\"+\r\n\t\t\t\"
\";\r\n\r\n\t\t\tdocument.body.appendChild(probe);\r\n\t\t\tvar styles = window.getComputedStyle(probe.querySelector(\".dhx_body\"));\r\n\t\t\tvar boxSizing = styles.getPropertyValue('box-sizing');\r\n\t\t\tdocument.body.removeChild(probe);\r\n\t\t\tcachedBorderBoxValue = !!(boxSizing === \"border-box\");\r\n\r\n\t\t\tif(!cachedBorderBoxValue){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tcachedBorderBoxValue = undefined;\r\n\t\t\t\t}, 1000);// recalculate in case scheduler initialized before skin is loaded\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\treturn cachedBorderBoxValue;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction refreshAfterLoad(){\r\n\tif(scheduler._is_material_skin() || scheduler._border_box_events()){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar oldStyling = cachedBorderBoxValue;\r\n\tcachedBorderBoxValue = undefined;\r\n\tcalculatedMaterial = undefined;\r\n\tvar newStyling = checkIfBorderBoxStyling();\r\n\r\n\t// if box styling model changed - means scheduler was rendered before stylesheet was loaded or parsed inline\r\n\t// repaint scheduler in order to apply new styles\r\n\tif(oldStyling !== newStyling && scheduler.$container && scheduler.getState().mode){\r\n\t\tscheduler.setCurrentView();\r\n\t}\r\n}\r\nscheduler.event(window, 'DOMContentLoaded', refreshAfterLoad);\r\nscheduler.event(window, 'load', refreshAfterLoad);\r\n\r\nscheduler._border_box_events = function(){\r\n\treturn checkIfBorderBoxStyling();\r\n};\r\n\r\nscheduler._configure = function(col, data, skin){\r\n\tfor (var key in data)\r\n\t\tif (typeof col[key] == \"undefined\")\r\n\t\t\tcol[key] = data[key][skin];\r\n};\r\n\r\nscheduler.setSkin = function(value){\r\n\tthis.skin = value;\r\n\tscheduler._addThemeClass();\r\n\tif(scheduler.$container){\r\n\t\tthis._skin_init();\r\n\t\tthis.render();\r\n\t}\r\n\t\r\n\t//\r\n};\r\n\r\nfunction flatSkinHourScale(date){\r\n\tvar min = date.getMinutes();\r\n\tmin = min < 10 ? \"0\"+min : min;\r\n\tvar html = \"
\"+ date.getHours() +\" \"+\r\n\t\t\"
\"+ min +\" \";\r\n\treturn html;\r\n}\r\n\r\nlet monitorIntervalId = null;\r\nfunction monitorThemeChange(){\r\n\tconst container = scheduler.$container;\r\n\t\r\n\tclearInterval(monitorIntervalId);\r\n\tif(container){\r\n\t\tmonitorIntervalId = setInterval(() => {\r\n\t\t\tconst csstheme = getComputedStyle(container).getPropertyValue('--dhx-scheduler-theme');\r\n\t\t\tif(csstheme && csstheme !== scheduler.skin){\r\n\t\t\t\tscheduler.setSkin(csstheme);\r\n\t\t\t}\r\n\r\n\t\t}, 100);\r\n\t}\r\n}\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tclearInterval(monitorIntervalId);\r\n});\r\n\r\nscheduler._skin_init = function(){\r\n\tthis._build_skin_info();\r\n\r\n\tif (!this.skin){\r\n\t\tthis.skin = this._theme_info.theme;\r\n\t}\r\n\tscheduler._addThemeClass();\r\n\tif (scheduler.skin === \"flat\"){\r\n\t\t// scheduler.xy.scale_height = 35;\r\n\t\tscheduler.templates.hour_scale = flatSkinHourScale;\r\n\t}else if (scheduler.templates.hour_scale === flatSkinHourScale){\r\n\t\tscheduler.templates.hour_scale = scheduler.date.date_to_str(scheduler.config.hour_date);\r\n\t}\r\n\r\n\r\n\r\n\t//scheduler._lightbox_template=\"
\";\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\r\n\t\tvar date_to_str = scheduler.date.date_to_str(\"%d\");\r\n\t\tif(!scheduler.templates._old_month_day){\r\n\t\t\tscheduler.templates._old_month_day = scheduler.templates.month_day;\r\n\t\t}\r\n\t\tvar old_month_day = scheduler.templates._old_month_day;\r\n\t\tscheduler.templates.month_day = function(date) {\r\n\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\tvar label = date_to_str(date);\r\n\t\t\t\tif (date.getDate() == 1) {\r\n\t\t\t\t\tlabel = scheduler.locale.date.month_full[date.getMonth()] + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\tif (+date == +scheduler.date.date_part(this._currentDate())) {\r\n\t\t\t\t\tlabel = scheduler.locale.labels.dhx_cal_today_button + \" \" + label;\r\n\t\t\t\t}\r\n\t\t\t\treturn label;\r\n\t\t\t} else {\r\n\t\t\t\treturn old_month_day.call(this, date);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// tab classes\r\n\t\tif(scheduler.config.fix_tab_position){\r\n\t\t\tconst tabs = scheduler._els[\"dhx_cal_navline\"][0].querySelectorAll('[data-tab]');\r\n\t\t\ttabs.forEach((tab) => {\r\n\t\t\t\tconst view = tab.getAttribute(\"data-tab\") || tab.getAttribute(\"name\");\r\n\r\n\t\t\t\tswitch (view) {\r\n\t\t\t\t\tcase \"day\":\r\n\t\t\t\t\tcase \"day_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_first\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"week\":\r\n\t\t\t\t\tcase \"week_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"month\":\r\n\t\t\t\t\tcase \"month_tab\":\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_last\");\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_segmented\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\ttab.classList.add(\"dhx_cal_tab_standalone\");\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\treorderTabs(scheduler._els[\"dhx_cal_navline\"][0]);\r\n\r\n\t\t}\r\n\t}, {once: true});\r\n\r\n\tfunction reorderTabs(container) {\r\n\t\t// segmented tabs should go first\r\n\r\n\t\tif(scheduler.config.header){\r\n\t\t\treturn;\r\n\t\t\t// don't reorder tabs if header is defined via config\r\n\t\t}\r\n\t\tconst tabs = Array.from(container.querySelectorAll('.dhx_cal_tab'));\r\n\t\r\n\t\t// segmented tabs\r\n\t\tconst order = ['day', 'week', 'month'];\r\n\t\r\n\t\tconst specialTabs = order.map(tabName => \r\n\t\t\ttabs.find(tab => tab.getAttribute('data-tab') === tabName)\r\n\t\t).filter(tab => tab !== undefined);\r\n\t\r\n\t\tlet firstTab = tabs.length > 0 ? tabs[0] : null;\r\n\r\n\t\tspecialTabs.reverse().forEach(tab => {\r\n\t\t\tcontainer.insertBefore(tab, firstTab);\r\n\t\t\tfirstTab = tab;\r\n\t\t});\r\n\t}\r\n\r\n\t// scheduler._skin_init = function(){\r\n\t// \tthis._build_skin_info();\r\n\t// \tthis.skin = this._theme_info.theme;\r\n\t// };\r\n};\r\n\r\n\r\n\r\n}","export default function DataProcessorEvents(scheduler, dp){\r\n\tthis.$scheduler = scheduler;\r\n\tthis.$dp = dp;\r\n\tthis._dataProcessorHandlers = [];\r\n\r\n\tthis.attach = function () {\r\n\t\tvar dp = this.$dp;\r\n\t\tvar scheduler = this.$scheduler;\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\t\t\tif (!this._validId(id)) return;\r\n\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false); return true; }\r\n\t\t\tif (z==\"deleted\") return false;\r\n\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\treturn false;\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onEventChanged\", function(id) { \r\n\t\t\tif (!this._loading && this._validId(id))\r\n\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t}));\r\n\r\n\t\tthis._dataProcessorHandlers.push(scheduler.attachEvent(\"onClearAll\", function() { \r\n\t\t\t// clear dataprocessor state when scheduler is reset\r\n\t\t\tdp._in_progress={};\r\n\t\t\tdp._invalid={};\r\n\t\t\tdp.updatedRows = [];\r\n\t\t\tdp._waitMode = 0;\r\n\t\t}));\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tif (scheduler.getEvent(id)){\r\n\t\t\t\tscheduler.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\t\tscheduler.deleteEvent(id);\r\n\t\t\t} else if (scheduler._add_rec_marker)\r\n\t\t\t\tscheduler._update_callback(upd, id);\r\n\t\t});\r\n\t};\r\n\r\n\tthis.detach = function () {\r\n\t\tfor (var key in this._dataProcessorHandlers) {\r\n\t\t\tvar handler = this._dataProcessorHandlers[key];\r\n\t\t\tthis.$scheduler.detachEvent(handler);\r\n\t\t}\r\n\t\tthis._dataProcessorHandlers = [];\r\n\t};\r\n}\r\n\r\nexport function extendScheduler(scheduler, dp){\r\n\tscheduler._validId=function(id){\r\n\t\tif(this._is_virtual_event){\r\n\t\t\treturn !this._is_virtual_event(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t};\r\n\tscheduler.setUserData=function(id,name,value){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev) ev[name]=value;\r\n\t\t}else{\r\n\t\t\tthis._userdata[name]=value;\r\n\t\t}\r\n\t};\r\n\tscheduler.getUserData=function(id,name){\r\n\t\tif (id){\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif(ev)\r\n\t\t\t\treturn ev[name];\r\n\t\t\telse\r\n\t\t\t\treturn null;\r\n\t\t}else{\r\n\t\t\treturn this._userdata[name];\r\n\t\t}\r\n\t};\r\n\tscheduler._set_event_text_style=function(id,style){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tthis.for_rendered(id,function(r){\r\n\t\t\tr.style.cssText+=\";\"+style;\r\n\t\t});\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tev[\"_text_style\"]=style;\r\n\t\tthis.event_updated(ev);\r\n\t};\r\n\tscheduler._update_callback = function(upd,id){\r\n\t\tvar data = scheduler._xmlNodeToJSON(upd.firstChild);\r\n\t\t//fix for updates of recurring events\r\n\t\tif (data.rec_type == \"none\") data.rec_pattern = \"none\";\r\n\t\tdata.text = data.text||data._tagvalue;\r\n\t\tdata.start_date = scheduler._helpers.parseDate(data.start_date);\r\n\t\tdata.end_date = scheduler._helpers.parseDate(data.end_date);\r\n\t\tscheduler.addEvent(data);\r\n\t\tif (scheduler._add_rec_marker)\r\n\t\t\tscheduler.setCurrentView();\r\n\t};\r\n\tscheduler._dp_change_event_id = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\t\tscheduler.changeEventId(id, new_id);\r\n\t};\r\n\tscheduler._dp_hook_delete = function(id, new_id){\r\n\t\tif(!scheduler.getEvent(id))\r\n\t\t\treturn;\r\n\r\n\t\tif(new_id && id != new_id){\r\n\t\t\tif(this.getUserData(id, dp.action_param) == \"true_deleted\")\r\n\t\t\t\tthis.setUserData(id, dp.action_param, \"updated\");\r\n\r\n\t\t\tthis.changeEventId(id, new_id);\r\n\t\t}\r\n\t\treturn this.deleteEvent(new_id, true);\r\n\t};\r\n\r\n\tscheduler.setDp = function() {\r\n\t\tthis._dp = dp;\r\n\t};\r\n\tscheduler.setDp();\r\n}","import DataProcessorEvents from \"./dataprocessor_hooks\";\r\nimport { extendScheduler } from \"./dataprocessor_hooks\";\r\nimport eventable from \"../../utils/eventable\";\r\nimport global from \"../../global\";\r\n\r\n/**\r\n *\t@desc: constructor, data processor object\r\n *\t@param: serverProcessorURL - url used for update\r\n *\t@type: public\r\n */\r\nexport function DataProcessor(serverProcessorURL){\r\n\tthis.serverProcessor = serverProcessorURL;\r\n\tthis.action_param = \"!nativeeditor_status\";\r\n\r\n\tthis.object = null;\r\n\tthis.updatedRows = []; // ids of updated rows\r\n\r\n\tthis.autoUpdate = true;\r\n\tthis.updateMode = \"cell\";\r\n\tthis._tMode = \"GET\";\r\n\tthis._headers = null;\r\n\tthis._payload = null;\r\n\tthis.post_delim = \"_\";\r\n\r\n\tthis._waitMode = 0;\r\n\tthis._in_progress = {};\r\n\tthis._invalid = {};\r\n\tthis.messages = [];\r\n\r\n\tthis.styles = {\r\n\t\tupdated: \"font-weight:bold;\",\r\n\t\tinserted: \"font-weight:bold;\",\r\n\t\tdeleted: \"text-decoration : line-through;\",\r\n\t\tinvalid: \"background-color:FFE0E0;\",\r\n\t\tinvalid_cell: \"border-bottom:2px solid red;\",\r\n\t\terror: \"color:red;\",\r\n\t\tclear: \"font-weight:normal;text-decoration:none;\"\r\n\t};\r\n\tthis.enableUTFencoding(true);\r\n\teventable(this); // TODO: need to update\r\n\r\n\treturn this;\r\n}\r\nDataProcessor.prototype = {\r\n\tsetTransactionMode: function (mode, total) {\r\n\t\tif (typeof mode == \"object\") {\r\n\t\t\tthis._tMode = mode.mode || this._tMode;\r\n\r\n\t\t\tif (mode.headers !== undefined) {\r\n\t\t\t\tthis._headers = mode.headers;\r\n\t\t\t}\r\n\r\n\t\t\tif (mode.payload !== undefined) {\r\n\t\t\t\tthis._payload = mode.payload;\r\n\t\t\t}\r\n\t\t\tthis._tSend = !!total;\r\n\t\t} else {\r\n\t\t\tthis._tMode = mode;\r\n\t\t\tthis._tSend = total;\r\n\t\t}\r\n\r\n\t\tif (this._tMode == \"REST\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"JSON\" || this._tMode === \"REST-JSON\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._serializeAsJson = true;\r\n\t\t\tthis._headers = this._headers || {};\r\n\t\t\tthis._headers[\"Content-Type\"] = \"application/json\";\r\n\t\t}else{\r\n\t\t\tif(this._headers && !this._headers[\"Content-Type\"]){\r\n\t\t\t\tthis._headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tthis._tSend = false;\r\n\t\t\tthis._endnm = true;\r\n\t\t\tthis._router = mode.router;\r\n\t\t}\r\n\t},\r\n\tescape: function (data) {\r\n\t\tif (this._utf)\r\n\t\t\treturn encodeURIComponent(data);\r\n\t\telse\r\n\t\t\treturn escape(data);\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to set escaping mode\r\n\t *\t@param: true - utf based escaping, simple - use current page encoding\r\n\t *\t@type: public\r\n\t */\r\n\tenableUTFencoding: function (mode) {\r\n\t\tthis._utf = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: allows to define, which column may trigger update\r\n\t *\t@param: val - array or list of true/false values\r\n\t *\t@type: public\r\n\t */\r\n\tsetDataColumns: function (val) {\r\n\t\tthis._columns = (typeof val == \"string\") ? val.split(\",\") : val;\r\n\t},\r\n\t/**\r\n\t *\t@desc: get state of updating\r\n\t *\t@returns: true - all in sync with server, false - some items not updated yet.\r\n\t *\t@type: public\r\n\t */\r\n\tgetSyncState: function () {\r\n\t\treturn !this.updatedRows.length;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable named field for data syncing, will use column ids for grid\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenableDataNames: function (mode) {\r\n\t\tthis._endnm = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: enable/disable mode , when only changed fields and row id send to the server side, instead of all fields in default mode\r\n\t *\t@param: mode - true/false\r\n\t *\t@type: public\r\n\t */\r\n\tenablePartialDataSend: function (mode) {\r\n\t\tthis._changed = !!mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: set if rows should be send to server automatically\r\n\t *\t@param: mode - \"row\" - based on row selection changed, \"cell\" - based on cell editing finished, \"off\" - manual data sending\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdateMode: function (mode, dnd) {\r\n\t\tthis.autoUpdate = (mode == \"cell\");\r\n\t\tthis.updateMode = mode;\r\n\t\tthis.dnd = dnd;\r\n\t},\r\n\tignore: function (code, master) {\r\n\t\tthis._silent_mode = true;\r\n\t\tcode.call(master || window);\r\n\t\tthis._silent_mode = false;\r\n\t},\r\n\t/**\r\n\t *\t@desc: mark row as updated/normal. check mandatory fields,initiate autoupdate (if turned on)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@param: state - true for \"updated\", false for \"not updated\"\r\n\t *\t@param: mode - update mode name\r\n\t *\t@type: public\r\n\t */\r\n\tsetUpdated: function (rowId, state, mode) {\r\n\t\tif (this._silent_mode) return;\r\n\t\tvar ind = this.findRow(rowId);\r\n\r\n\t\tmode = mode || \"updated\";\r\n\t\tvar existing = this.$scheduler.getUserData(rowId, this.action_param);\r\n\t\tif (existing && mode == \"updated\") mode = existing;\r\n\t\tif (state) {\r\n\t\t\tthis.set_invalid(rowId, false); //clear previous error flag\r\n\t\t\tthis.updatedRows[ind] = rowId;\r\n\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, mode);\r\n\t\t\tif (this._in_progress[rowId])\r\n\t\t\t\tthis._in_progress[rowId] = \"wait\";\r\n\t\t} else {\r\n\t\t\tif (!this.is_invalid(rowId)) {\r\n\t\t\t\tthis.updatedRows.splice(ind, 1);\r\n\t\t\t\tthis.$scheduler.setUserData(rowId, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.markRow(rowId, state, mode);\r\n\t\tif (state && this.autoUpdate) this.sendData(rowId);\r\n\t},\r\n\r\n\tmarkRow: function (id, state, mode) {\r\n\t\tvar str = \"\";\r\n\t\tvar invalid = this.is_invalid(id);\r\n\t\tif (invalid) {\r\n\t\t\tstr = this.styles[invalid];\r\n\t\t\tstate = true;\r\n\t\t}\r\n\t\tif (this.callEvent(\"onRowMark\", [id, state, mode, invalid])) {\r\n\t\t\t//default logic\r\n\t\t\tstr = this.styles[state ? mode : \"clear\"] + str;\r\n\r\n\t\t\tthis.$scheduler[this._methods[0]](id, str);\r\n\r\n\t\t\tif (invalid && invalid.details) {\r\n\t\t\t\tstr += this.styles[invalid + \"_cell\"];\r\n\t\t\t\tfor (var i = 0; i < invalid.details.length; i++)\r\n\t\t\t\t\tif (invalid.details[i])\r\n\t\t\t\t\t\tthis.$scheduler[this._methods[1]](id, i, str);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tgetActionByState: function(state) {\r\n\t\tif (state === \"inserted\") {\r\n\t\t\treturn \"create\";\r\n\t\t}\r\n\t\tif (state === \"updated\") {\r\n\t\t\treturn \"update\";\r\n\t\t}\r\n\t\tif (state === \"deleted\") {\r\n\t\t\treturn \"delete\";\r\n\t\t}\r\n\t\treturn \"update\";\r\n\t},\r\n\r\n\tgetState: function (id) {\r\n\t\treturn this.$scheduler.getUserData(id, this.action_param);\r\n\t},\r\n\tis_invalid: function (id) {\r\n\t\treturn this._invalid[id];\r\n\t},\r\n\tset_invalid: function (id, mode, details) {\r\n\t\tif (details) mode = {\r\n\t\t\tvalue: mode, details: details, toString: function () {\r\n\t\t\t\treturn this.value.toString();\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis._invalid[id] = mode;\r\n\t},\r\n\t/**\r\n\t *\t@desc: check mandatory fields and varify values of cells, initiate update (if specified)\r\n\t *\t@param: rowId - id of row to set update-status for\r\n\t *\t@type: public\r\n\t */\r\n\tcheckBeforeUpdate: function (rowId) {\r\n\t\treturn true;\r\n\t},\r\n\t/**\r\n\t *\t@desc: send row(s) values to server\r\n\t *\t@param: rowId - id of row which data to send. If not specified, then all \"updated\" rows will be send\r\n\t *\t@type: public\r\n\t */\r\n\tsendData: function (rowId) {\r\n\t\tif (this.$scheduler.editStop) this.$scheduler.editStop();\r\n\r\n\t\tif (typeof rowId == \"undefined\" || this._tSend) return this.sendAllData();\r\n\t\tif (this._in_progress[rowId]) return false;\r\n\r\n\t\tthis.messages = [];\r\n\t\tif (!this.checkBeforeUpdate(rowId) && this.callEvent(\"onValidationError\", [rowId, this.messages])) return false;\r\n\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t},\r\n\t_beforeSendData: function (data, rowId) {\r\n\t\tif (!this.callEvent(\"onBeforeUpdate\", [rowId, this.getState(rowId), data])) return false;\r\n\t\tthis._sendData(data, rowId);\r\n\t},\r\n\tserialize: function (data, id) {\r\n\t\tif (this._serializeAsJson) {\r\n\t\t\treturn this._serializeAsJSON(data);\r\n\t\t}\r\n\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tif (typeof id != \"undefined\")\r\n\t\t\treturn this.serialize_one(data, \"\");\r\n\t\telse {\r\n\t\t\tvar stack = [];\r\n\t\t\tvar keys = [];\r\n\t\t\tfor (var key in data)\r\n\t\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\t\tstack.push(this.serialize_one(data[key], key + this.post_delim));\r\n\t\t\t\t\tkeys.push(key);\r\n\t\t\t\t}\r\n\t\t\tstack.push(\"ids=\" + this.escape(keys.join(\",\")));\r\n\t\t\tif (this.$scheduler.security_key)\r\n\t\t\t\tstack.push(\"dhx_security=\" + (this.$scheduler.security_key));\r\n\t\t\treturn stack.join(\"&\");\r\n\t\t}\r\n\t},\r\n\tserialize_one: function (data, pref) {\r\n\t\tif (typeof data == \"string\")\r\n\t\t\treturn data;\r\n\t\tvar stack = [];\r\n\t\tvar serialized = \"\";\r\n\t\tfor (var key in data)\r\n\t\t\tif (data.hasOwnProperty(key)) {\r\n\t\t\t\tif ((key == \"id\" || key == this.action_param) && this._tMode == \"REST\") continue;\r\n\t\t\t\tif (typeof data[key] === \"string\" || typeof data[key] === \"number\") {\r\n\t\t\t\t\tserialized = data[key];\r\n\t\t\t\t} else {\r\n\t\t\t\t\tserialized = JSON.stringify(data[key]);\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(this.escape((pref || \"\") + key) + \"=\" + this.escape(serialized));\r\n\t\t\t}\r\n\t\treturn stack.join(\"&\");\r\n\t},\r\n\t_applyPayload: function (url) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._payload)\r\n\t\t\tfor (var key in this._payload)\r\n\t\t\t\turl = url + ajax.urlSeparator(url) + this.escape(key) + \"=\" + this.escape(this._payload[key]);\r\n\t\treturn url;\r\n\t},\r\n\t_sendData: function (dataToSend, rowId) {\r\n\t\tif (!dataToSend) {\r\n\t\t\treturn; // nothing to send\r\n\t\t}\r\n\t\tif (!this.callEvent(\"onBeforeDataSending\", rowId ? [rowId, this.getState(rowId), dataToSend] : [null, null, dataToSend])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (rowId) {\r\n\t\t\tthis._in_progress[rowId] = (new Date()).valueOf();\r\n\t\t}\r\n\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (this._tMode === \"CUSTOM\") {\r\n\t\t\tvar state = this.getState(rowId);\r\n\t\t\tvar action = this.getActionByState(state);\r\n\t\t\tvar _onResolvedCreateUpdate = function (tag) {\r\n\t\t\t\tvar resultState = state;\r\n\t\t\t\tif(tag && tag.responseText && tag.setRequestHeader){\r\n\t\t\t\t\tif(tag.status !== 200){\r\n\t\t\t\t\t\tresultState = \"error\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\ttag = JSON.parse(tag.responseText);\r\n\t\t\t\t\t} catch (e){}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tresultState = resultState || \"updated\";\r\n\t\t\t\tvar sid = rowId;\r\n\t\t\t\tvar tid = rowId;\r\n\r\n\t\t\t\tif (tag) {\r\n\t\t\t\t\tresultState = tag.action || resultState;\r\n\t\t\t\t\tsid = tag.sid || sid;\r\n\t\t\t\t\ttid = tag.id || tag.tid || tid;\r\n\t\t\t\t}\r\n\t\t\t\tself.afterUpdateCallback(sid, tid, resultState, tag);\r\n\t\t\t};\r\n\r\n\t\t\tconst routerMode = \"event\";\r\n\t\t\tvar actionPromise;\r\n\t\t\tif (this._router instanceof Function) {\r\n\t\t\t\tactionPromise = this._router(routerMode, action, dataToSend, rowId);\r\n\t\t\t} else {\r\n\t\t\t\tswitch (state) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].create(dataToSend);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].delete(rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tactionPromise = this._router[routerMode].update(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(actionPromise){\r\n\t\t\t\t// neither promise nor {tid: newId} response object\r\n\t\t\t\tif(!actionPromise.then &&\r\n\t\t\t\t\t(actionPromise.id === undefined && actionPromise.tid === undefined && actionPromise.action === undefined)){\r\n\t\t\t\t\tthrow new Error(\"Incorrect router return value. A Promise or a response object is expected\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(actionPromise.then){\r\n\t\t\t\t\tactionPromise.then(_onResolvedCreateUpdate).catch(function(error) {\r\n\t\t\t\t\t\tif(error && error.action){\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate(error);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t_onResolvedCreateUpdate({ action: \"error\", value: error});\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\t// custom method may return a response object in case of sync action\r\n\t\t\t\t\t_onResolvedCreateUpdate(actionPromise);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t_onResolvedCreateUpdate(null);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar queryParams = {\r\n\t\t\tcallback: function(xml) {\r\n\t\t\t\tvar ids = [];\r\n\r\n\t\t\t\tif (rowId) {\r\n\t\t\t\t\tids.push(rowId);\r\n\t\t\t\t} else if (dataToSend) {\r\n\t\t\t\t\tfor (var key in dataToSend) {\r\n\t\t\t\t\t\tids.push(key);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn self.afterUpdate(self, xml, ids);\r\n\t\t\t},\r\n\t\t\theaders: self._headers\r\n\t\t};\r\n\r\n\t\tvar urlParams = this.serverProcessor + (this._user ? (ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + this.$scheduler.getUserData(0, \"version\")].join(\"&\")) : \"\");\r\n\t\tvar url = this._applyPayload(urlParams);\r\n\t\tvar data;\r\n\r\n\t\tswitch (this._tMode) {\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url + ajax.urlSeparator(url) + this.serialize(data, rowId);\r\n\t\t\t\tqueryParams.method = \"GET\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"POST\":\r\n\t\t\t\tdata = this._cleanupArgumentsBeforeSend(dataToSend);\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = this.serialize(data, rowId);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"JSON\":\r\n\t\t\t\tdata = {};\r\n\t\t\t\tvar preprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t\t\tfor (var key in preprocessedData) {\r\n\t\t\t\t\tif (key === this.action_param || key === \"id\" || key === \"gr_id\") {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdata[key] = preprocessedData[key];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tqueryParams.url = url;\r\n\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\tqueryParams.data = JSON.stringify({\r\n\t\t\t\t\tid: rowId,\r\n\t\t\t\t\taction: dataToSend[this.action_param],\r\n\t\t\t\t\tdata: data\r\n\t\t\t\t});\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REST\":\r\n\t\t\tcase \"REST-JSON\":\r\n\t\t\t\turl = urlParams.replace(/(&|\\?)editing=true/, \"\");\r\n\t\t\t\tdata = \"\";\r\n\r\n\t\t\t\tswitch (this.getState(rowId)) {\r\n\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\tqueryParams.method = \"POST\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\tqueryParams.method = \"DELETE\";\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\tqueryParams.method = \"PUT\";\r\n\t\t\t\t\t\tqueryParams.data = this.serialize(dataToSend, rowId);\r\n\t\t\t\t\t\turl = url + (url.slice(-1) === \"/\" ? \"\" : \"/\") + rowId;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tqueryParams.url = this._applyPayload(url);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis._waitMode++;\r\n\t\treturn ajax.query(queryParams);\r\n\t},\r\n\tsendAllData: function () {\r\n\t\tif (!this.updatedRows.length || this.updateMode === \"off\") { // FIXME: need to leave checking 'this.updateMode === \"off\"'?\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.messages = [];\r\n\t\tvar valid = true;\r\n\r\n\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\tvalid = valid && this.checkBeforeUpdate(rowId);\r\n\t\t});\r\n\r\n\t\tif (!valid && !this.callEvent(\"onValidationError\", [\"\", this.messages])) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (this._tSend) {\r\n\t\t\tthis._sendData(this._getAllData());\r\n\t\t} else {\r\n\t\t\tthis._forEachUpdatedRow(function(rowId) {\r\n\t\t\t\tif (!this._in_progress[rowId]) {\r\n\t\t\t\t\tif (this.is_invalid(rowId)) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis._beforeSendData(this._getRowData(rowId), rowId);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\t_getAllData: function (rowId) {\r\n\t\tvar out = {};\r\n\t\tvar has_one = false;\r\n\t\tthis._forEachUpdatedRow(function(id) {\r\n\t\t\tif (this._in_progress[id] || this.is_invalid(id)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar row = this._getRowData(id);\r\n\t\t\tif (!this.callEvent(\"onBeforeUpdate\", [id, this.getState(id), row])) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tout[id] = row;\r\n\t\t\thas_one = true;\r\n\t\t\tthis._in_progress[id] = (new Date()).valueOf();\r\n\t\t});\r\n\t\treturn has_one ? out : null;\r\n\t},\r\n\r\n\tfindRow: function (pattern) {\r\n\t\tvar i = 0;\r\n\t\tfor (i = 0; i < this.updatedRows.length; i++)\r\n\t\t\tif (pattern == this.updatedRows[i]) break;\r\n\t\treturn i;\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: define custom actions\r\n\t *\t@param: name - name of action, same as value of action attribute\r\n\t *\t@param: handler - custom function, which receives a XMl response content for action\r\n\t *\t@type: private\r\n\t */\r\n\tdefineAction: function (name, handler) {\r\n\t\tif (!this._uActions) this._uActions = {};\r\n\t\tthis._uActions[name] = handler;\r\n\t},\r\n\r\n\t/**\r\n\t *\t @desc: used in combination with setOnBeforeUpdateHandler to create custom client-server transport system\r\n\t *\t @param: sid - id of item before update\r\n\t *\t @param: tid - id of item after up0ate\r\n\t *\t @param: action - action name\r\n\t *\t @type: public\r\n\t *\t @topic: 0\r\n\t */\r\n\tafterUpdateCallback: function (sid, tid, action, btag) {\r\n\t\tif(!this.$scheduler){\r\n\t\t\t// destructor has been called before the callback\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar marker = sid;\r\n\t\tvar correct = (action !== \"error\" && action !== \"invalid\");\r\n\t\tif (!correct) {\r\n\t\t\tthis.set_invalid(sid, action);\r\n\t\t}\r\n\t\tif ((this._uActions) && (this._uActions[action]) && (!this._uActions[action](btag))) {\r\n\t\t\treturn (delete this._in_progress[marker]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tthis.setUpdated(sid, false);\r\n\t\t}\r\n\r\n\t\tvar originalSid = sid;\r\n\r\n\t\tswitch (action) {\r\n\t\t\tcase \"inserted\":\r\n\t\t\tcase \"insert\":\r\n\t\t\t\tif (tid != sid) {\r\n\t\t\t\t\tthis.setUpdated(sid, false);\r\n\t\t\t\t\tthis.$scheduler[this._methods[2]](sid, tid);\r\n\t\t\t\t\tsid = tid;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"delete\":\r\n\t\t\tcase \"deleted\":\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"true_deleted\");\r\n\t\t\t\tthis.$scheduler[this._methods[3]](sid, tid);\r\n\t\t\t\tdelete this._in_progress[marker];\r\n\t\t\t\treturn this.callEvent(\"onAfterUpdate\", [sid, action, tid, btag]);\r\n\t\t}\r\n\r\n\t\tif (this._in_progress[marker] !== \"wait\") {\r\n\t\t\tif (correct) {\r\n\t\t\t\tthis.$scheduler.setUserData(sid, this.action_param, \"\");\r\n\t\t\t}\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t} else {\r\n\t\t\tdelete this._in_progress[marker];\r\n\t\t\tthis.setUpdated(tid, true, this.$scheduler.getUserData(sid, this.action_param));\r\n\t\t}\r\n\r\n\t\tthis.callEvent(\"onAfterUpdate\", [originalSid, action, tid, btag]);\r\n\t},\r\n\r\n\t_errorResponse: function (xml, id){\r\n\t\tif(this.$scheduler && this.$scheduler.callEvent){\r\n\t\t\tthis.$scheduler.callEvent(\"onSaveError\", [id, xml.xmlDoc]);\r\n\t\t}\r\n\t\treturn this.cleanUpdate(id);\r\n\t},\r\n\r\n\t_setDefaultTransactionMode: function () {\r\n\t\tif (this.serverProcessor) {\r\n\t\t\tthis.setTransactionMode(\"POST\", true);\r\n\t\t\tthis.serverProcessor += (this.serverProcessor.indexOf(\"?\") !== -1 ? \"&\" : \"?\") + \"editing=true\";\r\n\t\t\tthis._serverProcessor = this.serverProcessor;\r\n\t\t}\r\n\t},\r\n\t\r\n\t/**\r\n\t *\t@desc: response from server\r\n\t *\t@param: xml - XMLLoader object with response XML\r\n\t *\t@type: private\r\n\t */\r\n\tafterUpdate: function (that, xml, id) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\r\n\t\tif (xml.xmlDoc.status !== 200){\r\n\t\t\tthis._errorResponse(xml, id);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// try to use json first\r\n\t\tvar tag;\r\n\t\ttry {\r\n\t\t\ttag = JSON.parse(xml.xmlDoc.responseText);\r\n\t\t} catch (e) {\r\n\t\t\t// empty response also can be processed by json handler\r\n\t\t\tif (!xml.xmlDoc.responseText.length) {\r\n\t\t\t\ttag = {};\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (tag) {\r\n\t\t\tvar action = tag.action || this.getState(id) || \"updated\";\r\n\t\t\tvar sid = tag.sid || id[0];\r\n\t\t\tvar tid = tag.tid || id[0];\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, tag);\r\n\t\t\tthat.finalizeUpdate();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// xml response\r\n\t\tvar top = ajax.xmltop(\"data\", xml.xmlDoc); // fix incorrect content type in IE\r\n\t\tif (!top) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\t\tvar atag = ajax.xpath(\"//data/action\", top);\r\n\t\tif (!atag.length) {\r\n\t\t\treturn this._errorResponse(xml, id);\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < atag.length; i++) {\r\n\t\t\tvar btag = atag[i];\r\n\t\t\tvar action = btag.getAttribute(\"type\");\r\n\t\t\tvar sid = btag.getAttribute(\"sid\");\r\n\t\t\tvar tid = btag.getAttribute(\"tid\");\r\n\r\n\t\t\tthat.afterUpdateCallback(sid, tid, action, btag);\r\n\t\t}\r\n\t\tthat.finalizeUpdate();\r\n\t},\r\n\tcleanUpdate: function (id) {\r\n\t\tif (id)\r\n\t\t\tfor (var i = 0; i < id.length; i++)\r\n\t\t\t\tdelete this._in_progress[id[i]];\r\n\t},\r\n\tfinalizeUpdate: function () {\r\n\t\tif (this._waitMode) this._waitMode--;\r\n\r\n\t\tthis.callEvent(\"onAfterUpdateFinish\", []);\r\n\t\tif (!this.updatedRows.length)\r\n\t\t\tthis.callEvent(\"onFullSync\", []);\r\n\t},\r\n\r\n\t/**\r\n\t *\t@desc: initializes data-processor\r\n\t *\t@param: scheduler - dhtmlxScheduler object to attach this data-processor to\r\n\t *\t@type: public\r\n\t */\r\n\tinit: function (scheduler) {\r\n\t\tif (this._initialized) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.$scheduler = scheduler;\r\n\t\tif (this.$scheduler._dp_init) {\r\n\t\t\tthis.$scheduler._dp_init(this);\r\n\t\t}\r\n\r\n\t\tthis._setDefaultTransactionMode();\r\n\r\n\t\tthis._methods=this._methods||[\"_set_event_text_style\",\"\",\"_dp_change_event_id\",\"_dp_hook_delete\"];\r\n\t\textendScheduler(this.$scheduler, this);\r\n\t\tvar dataProcessorEvents = new DataProcessorEvents(this.$scheduler, this);\r\n\t\tdataProcessorEvents.attach();\r\n\t\tthis.attachEvent(\"onDestroy\", function() {\r\n\t\t\tdelete this._getRowData;\r\n\r\n\t\t\tdelete this.$scheduler._dp;\r\n\t\t\tdelete this.$scheduler._dataprocessor;\r\n\t\t\tdelete this.$scheduler._set_event_text_style;\r\n\t\t\tdelete this.$scheduler._dp_change_event_id;\r\n\t\t\tdelete this.$scheduler._dp_hook_delete;\r\n\t\t\tdelete this.$scheduler;\r\n\t\t\tdataProcessorEvents.detach();\r\n\t\t});\r\n\t\tthis.$scheduler.callEvent(\"onDataProcessorReady\", [this]);\r\n\t\tthis._initialized = true;\r\n\r\n\t\tscheduler._dataprocessor=this;\r\n\t},\r\n\r\n\tsetOnAfterUpdate: function (ev) {\r\n\t\tthis.attachEvent(\"onAfterUpdate\", ev);\r\n\t},\r\n\tsetOnBeforeUpdateHandler: function (func) {\r\n\t\tthis.attachEvent(\"onBeforeDataSending\", func);\r\n\t},\r\n\r\n\t/* starts autoupdate mode\r\n\t\t@param interval time interval for sending update requests\r\n\t*/\r\n\tsetAutoUpdate: function (interval, user) {\r\n\t\tinterval = interval || 2000;\r\n\r\n\t\tthis._user = user || (new Date()).valueOf();\r\n\t\tthis._need_update = false;\r\n\t\t//this._loader = null;\r\n\t\tthis._update_busy = false;\r\n\r\n\t\tthis.attachEvent(\"onAfterUpdate\", function (sid, action, tid, xml_node) {\r\n\t\t\tthis.afterAutoUpdate(sid, action, tid, xml_node);\r\n\t\t});\r\n\t\tthis.attachEvent(\"onFullSync\", function () {\r\n\t\t\tthis.fullSync();\r\n\t\t});\r\n\r\n\t\tvar self = this;\r\n\t\tlet intervalId = global.setInterval(function () {\r\n\t\t\tself.loadUpdate();\r\n\t\t}, interval);\r\n\t\tthis.attachEvent(\"onDestroy\", function(){\r\n\t\t\tclearInterval(intervalId);\r\n\t\t});\r\n\t},\r\n\r\n\t/* process updating request answer\r\n\t\tif status == collision version is deprecated\r\n\t\tset flag for autoupdating immediately\r\n\t*/\r\n\tafterAutoUpdate: function (sid, action, tid, xml_node) {\r\n\t\tif (action == 'collision') {\r\n\t\t\tthis._need_update = true;\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t},\r\n\r\n\t/* callback function for onFillSync event\r\n\t\tcall update function if it's need\r\n\t*/\r\n\tfullSync: function () {\r\n\t\tif (this._need_update) {\r\n\t\t\tthis._need_update = false;\r\n\t\t\tthis.loadUpdate();\r\n\t\t}\r\n\t\treturn true;\r\n\t},\r\n\r\n\t/* sends query to the server and call callback function\r\n\t*/\r\n\tgetUpdates: function (url, callback) {\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tif (this._update_busy)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t\tthis._update_busy = true;\r\n\r\n\t\tajax.get(url, callback);\r\n\t},\r\n\r\n\t/* returns xml node value\r\n\t\t@param node\r\n\t\t\txml node\r\n\t*/\r\n\t_getXmlNodeValue: function(node) {\r\n\t\tif (node.firstChild) {\r\n\t\t\treturn node.firstChild.nodeValue;\r\n\t\t}\r\n\t\treturn \"\";\r\n\t},\r\n\r\n\t/* loads updates and processes them\r\n\t*/\r\n\tloadUpdate: function () {\r\n\t\tvar self = this;\r\n\t\tvar ajax = this.$scheduler.ajax;\r\n\t\tvar version = this.$scheduler.getUserData(0, \"version\");\r\n\t\tvar url = this.serverProcessor + ajax.urlSeparator(this.serverProcessor) + [\"dhx_user=\" + this._user, \"dhx_version=\" + version].join(\"&\");\r\n\t\turl = url.replace(\"editing=true&\", \"\");\r\n\t\tthis.getUpdates(url, function (xml) {\r\n\t\t\tvar vers = ajax.xpath(\"//userdata\", xml);\r\n\t\t\tself.$scheduler.setUserData(0, \"version\", self._getXmlNodeValue(vers[0]));\r\n\r\n\t\t\tvar updates = ajax.xpath(\"//update\", xml);\r\n\t\t\tif (updates.length) {\r\n\t\t\t\tself._silent_mode = true;\r\n\r\n\t\t\t\tfor (var i = 0; i < updates.length; i++) {\r\n\t\t\t\t\tvar status = updates[i].getAttribute(\"status\");\r\n\t\t\t\t\tvar id = updates[i].getAttribute(\"id\");\r\n\t\t\t\t\tvar parent = updates[i].getAttribute(\"parent\");\r\n\t\t\t\t\tswitch (status) {\r\n\t\t\t\t\t\tcase \"inserted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"insertCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"updated\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"updateCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"deleted\":\r\n\t\t\t\t\t\t\tthis.callEvent(\"deleteCallback\", [updates[i], id, parent]);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tself._silent_mode = false;\r\n\t\t\t}\r\n\t\t\tself._update_busy = false;\r\n\t\t\tself = null;\r\n\t\t});\r\n\t},\r\n\r\n\tdestructor: function() {\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.updatedRows = [];\r\n\t\tthis._in_progress = {};\r\n\t\tthis._invalid = {};\r\n\t\tthis._headers = null;\r\n\t\tthis._payload = null;\r\n\t\tdelete this._initialized;\r\n\t},\r\n\r\n\turl: function(url) {\r\n\t\tthis.serverProcessor = this._serverProcessor = url;\r\n\t},\r\n\r\n\t_serializeAsJSON: function(data) {\r\n\t\tif (typeof data === \"string\") {\r\n\t\t\treturn data;\r\n\t\t}\r\n\r\n\t\tvar copy = this.$scheduler.utils.copy(data);\r\n\t\tif (this._tMode === \"REST-JSON\") {\r\n\t\t\tdelete copy.id;\r\n\t\t\tdelete copy[this.action_param];\r\n\t\t}\r\n\r\n\t\treturn JSON.stringify(copy);\r\n\t},\r\n\r\n\t// GET/POST/JSON modes of the dataProcessor didn't send the whole data items in 'delete' requests\r\n\t// clear extra info from the data in order not to change the request format\r\n\t_cleanupArgumentsBeforeSend: function(dataToSend) {\r\n\t\tvar processedData;\r\n\t\tif(dataToSend[this.action_param] === undefined){// hash of updated items, and not an individual item\r\n\t\t\tprocessedData = {};\r\n\t\t\tfor(var i in dataToSend) {\r\n\t\t\t\tprocessedData[i] = this._cleanupArgumentsBeforeSend(dataToSend[i]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tprocessedData = this._cleanupItemBeforeSend(dataToSend);\r\n\t\t}\r\n\t\treturn processedData;\r\n\t},\r\n\t_cleanupItemBeforeSend: function(updatedItem) {\r\n\t\tvar output = null;\r\n\t\tif(updatedItem){\r\n\t\t\tif(updatedItem[this.action_param] === \"deleted\"){\r\n\t\t\t\toutput = {};\r\n\t\t\t\toutput.id = updatedItem.id;\r\n\t\t\t\toutput[this.action_param] = updatedItem[this.action_param];\r\n\t\t\t}else{\r\n\t\t\t\toutput = updatedItem;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn output;\r\n\t},\r\n\r\n\t_forEachUpdatedRow: function(code) {\r\n\t\tvar updatedRows = this.updatedRows.slice();\r\n\t\tfor (var i = 0; i < updatedRows.length; i++) {\r\n\t\t\tvar rowId = updatedRows[i];\r\n\t\t\tif (this.$scheduler.getUserData(rowId, this.action_param)) {\r\n\t\t\t\tcode.call(this, rowId);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_prepareItemForJson(item){\r\n\t\tconst processedItem = {};\r\n\t\tconst scheduler = this.$scheduler;\r\n\t\tconst copy = scheduler.utils.copy(item);\r\n\t\tfor (let i in copy) {\r\n\t\t\tlet prop = copy[i];\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (prop){\r\n\t\t\t\tif(prop.getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(prop);\r\n\t\t\t\t} else if(typeof prop == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareItemForJson(prop);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = prop; \r\n\t\t\t\t}\r\n\t\t\t} else if (prop !== undefined){\r\n\t\t\t\tprocessedItem[i] = prop; \r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_prepareItemForForm(item){\r\n\t\tconst processedItem = {};\r\n\t\tconst scheduler = this.$scheduler;\r\n\t\tconst copy = scheduler.utils.copy(item);\r\n\t\tfor (var i in copy) {\r\n\t\t\tlet prop = copy[i];\r\n\t\t\tif (i.indexOf(\"_\") === 0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else if (prop) {\r\n\t\t\t\tif(prop.getUTCFullYear){\r\n\t\t\t\t\tprocessedItem[i] = scheduler._helpers.formatDate(prop);\r\n\t\t\t\t} else if(typeof prop == \"object\") {\r\n\t\t\t\t\tprocessedItem[i] = this._prepareItemForForm(prop);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tprocessedItem[i] = prop;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tprocessedItem[i] = \"\"; // for all falthy values\r\n\t\t\t}\r\n\t\t}\r\n\t\tprocessedItem[this.action_param] = scheduler.getUserData(item.id, this.action_param);\r\n\t\treturn processedItem;\r\n\t},\r\n\t_prepareDataItem: function(item) {\r\n\t\tif(this._serializeAsJson){\r\n\t\t\treturn this._prepareItemForJson(item);\r\n\t\t}else {\r\n\t\t\treturn this._prepareItemForForm(item);\r\n\t\t}\r\n\t},\r\n\t_getRowData: function(id) {\r\n\t\tvar dataItem = this.$scheduler.getEvent(id);\r\n\t\tif (!dataItem) {\r\n\t\t\tdataItem = { id: id };\r\n\t\t}\r\n\t\treturn this._prepareDataItem(dataItem);\r\n\t}\r\n};\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.createDataProcessor = function(config) {\r\n\tvar router;\r\n\tvar tMode;\r\n\tif (config instanceof Function) {\r\n\t\trouter = config;\r\n\t} else if (config.hasOwnProperty(\"router\")) {\r\n\t\trouter = config.router;\r\n\t} else if(config.hasOwnProperty(\"event\")){\r\n\t\trouter = config;\r\n\t}\r\n\r\n\tif (router) {\r\n\t\ttMode = \"CUSTOM\";\r\n\t} else {\r\n\t\ttMode = config.mode || \"REST-JSON\";\r\n\t}\r\n\r\n\tvar dp = new DataProcessor(config.url);\r\n\tdp.init(scheduler);\r\n\tdp.setTransactionMode({\r\n\t\tmode: tMode,\r\n\t\trouter: router\r\n\t}, config.batchUpdate); // FIXME: config.batchUpdate where it is explained?\r\n\treturn dp;\r\n};\r\n\r\nscheduler.DataProcessor = DataProcessor;\r\n\r\n}\r\n\r\n//var dataProcessor = global.dataProcessor = DataProcessor; // for old","import utils from \"./utils/utils\";\r\nimport domHelpers from \"./utils/dom_helpers\";\r\n\r\n\r\nexport default function(scheduler) {\r\n\r\n\tvar boxAttribute = \"data-dhxbox\";\r\n\r\n\tvar _dhx_msg_cfg = null;\r\n\r\n\tfunction callback(config, result) {\r\n\t\tvar usercall = config.callback;\r\n\t\tmodalBox.hide(config.box);\r\n\r\n\t\t_dhx_msg_cfg = config.box = null;\r\n\tif (usercall)\r\n\t\t\tusercall(result);\r\n\t}\r\n\r\n\tfunction modal_key(event) {\r\n\t\tif (_dhx_msg_cfg) {\r\n\r\n\t\t\tvar code = event.which || event.keyCode;\r\n\t\t\tvar preventDefault = false;\r\n\r\n\t\t\tif (messageBox.keyboard) {\r\n\t\t\t\tif (code == 13 || code == 32) {\r\n\t\t\t\t\t// default behavior is to confirm/submit popup on space/enter\r\n\t\t\t\t\t// if browser focus is set on button element - do button click instead of default behavior\r\n\t\t\t\t\tvar target = event.target || event.srcElement;\r\n\t\t\t\t\tif (domHelpers.getClassName(target).indexOf(\"scheduler_popup_button\") > -1 && target.click) {\r\n\t\t\t\t\t\ttarget.click();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcallback(_dhx_msg_cfg, true);\r\n\t\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (code == 27) {\r\n\t\t\t\t\tcallback(_dhx_msg_cfg, false);\r\n\t\t\t\t\tpreventDefault = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (preventDefault) {\r\n\t\t\t\tif (event.preventDefault){\r\n\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t}\r\n\t\t\t\treturn !(event.cancelBubble = true);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", modal_key, true);\r\n\r\n\tfunction modality(mode) {\r\n\t\tif (!modality.cover) {\r\n\t\t\tmodality.cover = document.createElement(\"div\");\r\n\t\t\t//necessary for IE only\r\n\t\t\tscheduler.event(modality.cover, \"keydown\", modal_key);\r\n\t\t\tmodality.cover.className = \"dhx_modal_cover\";\r\n\t\t\tdocument.body.appendChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tmodality.cover.style.display = mode ? \"inline-block\" : \"none\";\r\n\t}\r\n\r\n\tfunction button(text, classValue, result) {\r\n\t\tvar buttonAriaAttrs = scheduler._waiAria.messageButtonAttrString(text);\r\n\t\tvar name = (classValue || \"\").toLowerCase().replace(/ /g, \"_\");\r\n\t\tvar buttonCss = `scheduler_${name}_button dhtmlx_${name}_button`; \r\n\t\treturn ``;\r\n\t}\r\n\r\n\tfunction info(text) {\r\n\t\tif (!messageBox.area) {\r\n\t\t\tmessageBox.area = document.createElement(\"div\");\r\n\t\t\tmessageBox.area.className = \"scheduler_message_area dhtmlx_message_area\";\r\n\t\t\tmessageBox.area.style[messageBox.position] = \"5px\";\r\n\t\t\tdocument.body.appendChild(messageBox.area);\r\n\t\t}\r\n\r\n\t\tmessageBox.hide(text.id);\r\n\t\tvar message = document.createElement(\"div\");\r\n\t\tmessage.innerHTML = \"
\" + text.text + \"
\";\r\n\t\tmessage.className = \"scheduler-info dhtmlx-info scheduler-\" + text.type + \" dhtmlx-\" + text.type;\r\n\t\tscheduler.event(message, \"click\",function (e) {\r\n if(text.callback) {\r\n text.callback.call(this, e);\r\n }\r\n\t\t\tmessageBox.hide(text.id);\r\n\t\t\ttext = null;\r\n\t\t});\r\n\r\n\t\tscheduler._waiAria.messageInfoAttr(message);\r\n\r\n\t\tif (messageBox.position == \"bottom\" && messageBox.area.firstChild)\r\n\t\t\tmessageBox.area.insertBefore(message, messageBox.area.firstChild);\r\n\t\telse\r\n\t\t\tmessageBox.area.appendChild(message);\r\n\r\n\t\tif (text.expire > 0)\r\n\t\t\tmessageBox.timers[text.id] = window.setTimeout(function () {\r\n\t\t\t\t// GS-1213: We need that when Scheduler is destroyed\r\n\t\t\t\tif (messageBox) messageBox.hide(text.id);\r\n\t\t\t}, text.expire);\r\n\r\n\t\tmessageBox.pull[text.id] = message;\r\n\t\tmessage = null;\r\n\r\n\t\treturn text.id;\r\n\t}\r\n\r\n\tfunction getFirstDefined() {\r\n\t\tvar values = [].slice.apply(arguments, [0]);\r\n\r\n\t\tfor (var i = 0; i < values.length; i++) {\r\n\t\t\tif (values[i]) {\r\n\t\t\t\treturn values[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction _boxStructure(config, ok, cancel) {\r\n\t\tvar box = document.createElement(\"div\");\r\n\r\n\t\tvar contentId = utils.uid();\r\n\t\tscheduler._waiAria.messageModalAttr(box, contentId);\r\n\r\n\r\n\t\tbox.className = \" scheduler_modal_box dhtmlx_modal_box scheduler-\" + config.type + \" dhtmlx-\" + config.type;\r\n\t\tbox.setAttribute(boxAttribute, 1);\r\n\r\n\t\tvar inner = '';\r\n\r\n\t\tif (config.width)\r\n\t\t\tbox.style.width = config.width;\r\n\t\tif (config.height)\r\n\t\t\tbox.style.height = config.height;\r\n\t\tif (config.title)\r\n\t\t\tinner += '';\r\n\t\tinner += '';\r\n\t\tbox.innerHTML = inner;\r\n\r\n\t\tif (config.content) {\r\n\t\t\tvar node = config.content;\r\n\t\t\tif (typeof node == \"string\")\r\n\t\t\t\tnode = document.getElementById(node);\r\n\t\t\tif (node.style.display == 'none')\r\n\t\t\t\tnode.style.display = \"\";\r\n\t\t\tbox.childNodes[config.title ? 1 : 0].appendChild(node);\r\n\t\t}\r\n\r\n\t\tscheduler.event(box, \"click\", function (event) {\r\n\t\t\tvar source = event.target || event.srcElement;\r\n\t\t\tif (!source.className) source = source.parentNode;\r\n\t\t\tif (domHelpers.closest(source, \".scheduler_popup_button\")) {\r\n\t\t\t\tvar result = source.getAttribute(\"data-result\");\r\n\t\t\t\tresult = (result == \"true\") || (result == \"false\" ? false : result);\r\n\t\t\t\tcallback(config, result);\r\n\t\t\t}\r\n\t\t});\r\n\t\tconfig.box = box;\r\n\t\tif (ok || cancel)\r\n\t\t\t_dhx_msg_cfg = config;\r\n\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction _createBox(config, ok, cancel) {\r\n\t\tvar box = config.tagName ? config : _boxStructure(config, ok, cancel);\r\n\r\n\t\tif (!config.hidden)\r\n\t\t\tmodality(true);\r\n\t\tdocument.body.appendChild(box);\r\n\t\tvar x = Math.abs(Math.floor(((window.innerWidth || document.documentElement.offsetWidth) - box.offsetWidth) / 2));\r\n\t\tvar y = Math.abs(Math.floor(((window.innerHeight || document.documentElement.offsetHeight) - box.offsetHeight) / 2));\r\n\t\tif (config.position == \"top\")\r\n\t\t\tbox.style.top = \"-3px\";\r\n\t\telse\r\n\t\t\tbox.style.top = y + 'px';\r\n\t\tbox.style.left = x + 'px';\r\n\t\t//necessary for IE only\r\n\t\tscheduler.event(box, \"keydown\", modal_key);\r\n\r\n\t\tmodalBox.focus(box);\r\n\r\n\t\tif (config.hidden)\r\n\t\t\tmodalBox.hide(box);\r\n\r\n\t\tscheduler.callEvent(\"onMessagePopup\", [box]);\r\n\t\treturn box;\r\n\t}\r\n\r\n\tfunction alertPopup(config) {\r\n\t\treturn _createBox(config, true, false);\r\n\t}\r\n\r\n\tfunction confirmPopup(config) {\r\n\t\treturn _createBox(config, true, true);\r\n\t}\r\n\r\n\tfunction boxPopup(config) {\r\n\t\treturn _createBox(config);\r\n\t}\r\n\r\n\tfunction box_params(text, type, callback) {\r\n\t\tif (typeof text != \"object\") {\r\n\t\t\tif (typeof type == \"function\") {\r\n\t\t\t\tcallback = type;\r\n\t\t\t\ttype = \"\";\r\n\t\t\t}\r\n\t\t\ttext = {text: text, type: type, callback: callback};\r\n\t\t}\r\n\t\treturn text;\r\n\t}\r\n\r\n\tfunction params(text, type, expire, id, callback) {\r\n\t\tif (typeof text != \"object\")\r\n\t\t\ttext = {text: text, type: type, expire: expire, id: id, callback: callback};\r\n\t\ttext.id = text.id || utils.uid();\r\n\t\ttext.expire = text.expire || messageBox.expire;\r\n\t\treturn text;\r\n\t}\r\n\r\n\tvar alertBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"confirm\";\r\n\t\treturn alertPopup(text);\r\n\t};\r\n\tvar confirmBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn confirmPopup(text);\r\n\t};\r\n\tvar modalBox = function () {\r\n\t\tvar text = box_params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"alert\";\r\n\t\treturn boxPopup(text);\r\n\t};\r\n\tmodalBox.hide = function (node) {\r\n\t\twhile (node && node.getAttribute && !node.getAttribute(boxAttribute))\r\n\t\t\tnode = node.parentNode;\r\n\t\tif (node) {\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t\tmodality(false);\r\n\r\n\t\t\tscheduler.callEvent(\"onAfterMessagePopup\", [node]);\r\n\t\t}\r\n\t};\r\n\r\n\tmodalBox.focus = function (node) {\r\n\t\tsetTimeout(function () {\r\n\t\t\tvar focusable = domHelpers.getFocusableNodes(node);\r\n\t\t\tif (focusable.length) {\r\n\t\t\t\tif (focusable[0].focus) focusable[0].focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t};\r\n\r\n\tvar messageBox = function (text, type, expire, id) {\r\n\t\ttext = params.apply(this, arguments);\r\n\t\ttext.type = text.type || \"info\";\r\n\r\n\t\tvar subtype = text.type.split(\"-\")[0];\r\n\t\tswitch (subtype) {\r\n\t\t\tcase \"alert\":\r\n\t\t\t\treturn alertPopup(text);\r\n\t\t\tcase \"confirm\":\r\n\t\t\t\treturn confirmPopup(text);\r\n\t\t\tcase \"modalbox\":\r\n\t\t\t\treturn boxPopup(text);\r\n\t\t\tdefault:\r\n\t\t\t\treturn info(text);\r\n\t\t}\r\n\t};\r\n\r\n\tmessageBox.seed = (new Date()).valueOf();\r\n\tmessageBox.uid = utils.uid;\r\n\tmessageBox.expire = 4000;\r\n\tmessageBox.keyboard = true;\r\n\tmessageBox.position = \"top\";\r\n\tmessageBox.pull = {};\r\n\tmessageBox.timers = {};\r\n\r\n\tmessageBox.hideAll = function () {\r\n\t\tfor (var key in messageBox.pull)\r\n\t\t\tmessageBox.hide(key);\r\n\t};\r\n\tmessageBox.hide = function (id) {\r\n\t\tvar obj = messageBox.pull[id];\r\n\t\tif (obj && obj.parentNode) {\r\n\t\t\twindow.setTimeout(function () {\r\n\t\t\t\tobj.parentNode.removeChild(obj);\r\n\t\t\t\tobj = null;\r\n\t\t\t}, 2000);\r\n\t\t\tobj.className += \" hidden\";\r\n\r\n\t\t\tif (messageBox.timers[id])\r\n\t\t\t\twindow.clearTimeout(messageBox.timers[id]);\r\n\t\t\tdelete messageBox.pull[id];\r\n\t\t}\r\n\t};\r\n\r\n\tvar popups = [];\r\n\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\tpopups.push(box);\r\n\t});\r\n\tscheduler.attachEvent(\"onAfterMessagePopup\", function(box){\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i] === box){\r\n\t\t\t\tpopups.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tif(modality.cover && modality.cover.parentNode){\r\n\t\t\tmodality.cover.parentNode.removeChild(modality.cover);\r\n\t\t}\r\n\r\n\t\tfor(var i = 0; i < popups.length; i++){\r\n\t\t\tif(popups[i].parentNode){\r\n\t\t\t\tpopups[i].parentNode.removeChild(popups[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpopups = null;\r\n\r\n\t\tif(messageBox.area && messageBox.area.parentNode){\r\n\t\t\tmessageBox.area.parentNode.removeChild(messageBox.area);\r\n\t\t}\r\n\t\tmessageBox = null;\r\n\t});\r\n\r\n\treturn {\r\n\t\talert: alertBox,\r\n\t\tconfirm: confirmBox,\r\n\t\tmessage: messageBox,\r\n\t\tmodalbox: modalBox\r\n\t};\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"كانون الثاني\", \"شباط\", \"آذار\", \"نيسان\", \"أيار\", \"حزيران\", \"تموز\", \"آب\", \"أيلول\", \"تشرين الأول\", \"تشرين الثاني\", \"كانون الأول\"],\r\n\t\tmonth_short: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_full: [\"الأحد\", \"الأثنين\", \"ألثلاثاء\", \"الأربعاء\", \"ألحميس\", \"ألجمعة\", \"السبت\"],\r\n\t\tday_short: [\"احد\", \"اثنين\", \"ثلاثاء\", \"اربعاء\", \"خميس\", \"جمعة\", \"سبت\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"اليوم\",\r\n\t\tday_tab: \"يوم\",\r\n\t\tweek_tab: \"أسبوع\",\r\n\t\tmonth_tab: \"شهر\",\r\n\t\tnew_event: \"حدث جديد\",\r\n\t\ticon_save: \"اخزن\",\r\n\t\ticon_cancel: \"الغاء\",\r\n\t\ticon_details: \"تفاصيل\",\r\n\t\ticon_edit: \"تحرير\",\r\n\t\ticon_delete: \"حذف\",\r\n\t\tconfirm_closing: \"التغييرات سوف تضيع, هل انت متأكد؟\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"الحدث سيتم حذفها نهائيا ، هل أنت متأكد؟\",\r\n\t\tsection_description: \"الوصف\",\r\n\t\tsection_time: \"الفترة الزمنية\",\r\n\t\tfull_day: \"طوال اليوم\",\r\n\r\n\t\tconfirm_recurring: \"هل تريد تحرير مجموعة كاملة من الأحداث المتكررة؟\",\r\n\t\tsection_recurring: \"تكرار الحدث\",\r\n\t\tbutton_recurring: \"تعطيل\",\r\n\t\tbutton_recurring_open: \"تمكين\",\r\n\t\tbutton_edit_series: \"تحرير سلسلة\",\r\n\t\tbutton_edit_occurrence: \"تعديل نسخة\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"جدول\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"يومي\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"أسبوعي\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"شهري\",\r\n\t\trepeat_radio_year: \"سنوي\",\r\n\t\trepeat_radio_day_type: \"كل\",\r\n\t\trepeat_text_day_count: \"يوم\",\r\n\t\trepeat_radio_day_type2: \"كل يوم عمل\",\r\n\t\trepeat_week: \" تكرار كل\",\r\n\t\trepeat_text_week_count: \"أسبوع في الأيام التالية:\",\r\n\t\trepeat_radio_month_type: \"تكرار\",\r\n\t\trepeat_radio_month_start: \"في\",\r\n\t\trepeat_text_month_day: \"يوم كل\",\r\n\t\trepeat_text_month_count: \"شهر\",\r\n\t\trepeat_text_month_count2_before: \"كل\",\r\n\t\trepeat_text_month_count2_after: \"شهر\",\r\n\t\trepeat_year_label: \"في\",\r\n\t\tselect_year_day2: \"من\",\r\n\t\trepeat_text_year_day: \"يوم\",\r\n\t\tselect_year_month: \"شهر\",\r\n\t\trepeat_radio_end: \"بدون تاريخ انتهاء\",\r\n\t\trepeat_text_occurences_count: \"تكرارات\",\r\n\t\trepeat_radio_end2: \"بعد\",\r\n\t\trepeat_radio_end3: \"ينتهي في\",\r\n\r\n\t\trepeat_never: \"أبداً\",\r\n\t\trepeat_daily: \"كل يوم\",\r\n\t\trepeat_workdays: \"كل يوم عمل\",\r\n\t\trepeat_weekly: \"كل أسبوع\",\r\n\t\trepeat_monthly: \"كل شهر\",\r\n\t\trepeat_yearly: \"كل سنة\",\r\n\t\trepeat_custom: \"تخصيص\",\r\n\t\trepeat_freq_day: \"يوم\",\r\n\t\trepeat_freq_week: \"أسبوع\",\r\n\t\trepeat_freq_month: \"شهر\",\r\n\t\trepeat_freq_year: \"سنة\",\r\n\t\trepeat_on_date: \"في التاريخ\",\r\n\t\trepeat_ends: \"ينتهي\",\r\n\r\n\t\tmonth_for_recurring: [\"يناير\", \"فبراير\", \"مارس\", \"أبريل\", \"مايو\", \"يونيو\", \"يوليو\", \"أغسطس\", \"سبتمبر\", \"أكتوبر\", \"نوفمبر\", \"ديسمبر\"],\r\n\t\tday_for_recurring: [\"الأحد\", \"الإثنين\", \"الثلاثاء\", \"الأربعاء\", \"الخميس\", \"الجمعة\", \"السبت\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n Translation by Sofya Morozova\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Студзень\", \"Люты\", \"Сакавік\", \"Красавік\", \"Maй\", \"Чэрвень\", \"Ліпень\", \"Жнівень\", \"Верасень\", \"Кастрычнік\", \"Лістапад\", \"Снежань\"],\r\n\t\tmonth_short: [\"Студз\", \"Лют\", \"Сак\", \"Крас\", \"Maй\", \"Чэр\", \"Ліп\", \"Жнів\", \"Вер\", \"Каст\", \"Ліст\", \"Снеж\"],\r\n\t\tday_full: [ \"Нядзеля\", \"Панядзелак\", \"Аўторак\", \"Серада\", \"Чацвер\", \"Пятніца\", \"Субота\"],\r\n\t\tday_short: [\"Нд\", \"Пн\", \"Аўт\", \"Ср\", \"Чцв\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сёння\",\r\n\t\tday_tab: \"Дзень\",\r\n\t\tweek_tab: \"Тыдзень\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новая падзея\",\r\n\t\ticon_save: \"Захаваць\",\r\n\t\ticon_cancel: \"Адмяніць\",\r\n\t\ticon_details: \"Дэталі\",\r\n\t\ticon_edit: \"Змяніць\",\r\n\t\ticon_delete: \"Выдаліць\",\r\n\t\tconfirm_closing: \"\", //Унесеныя змены будуць страчаны, працягнуць?\r\n\t\tconfirm_deleting: \"Падзея будзе выдалена незваротна, працягнуць?\",\r\n\t\tsection_description: \"Апісанне\",\r\n\t\tsection_time: \"Перыяд часу\",\r\n\t\tfull_day: \"Увесь дзень\",\r\n\r\n\t\tconfirm_recurring: \"Вы хочаце змяніць усю серыю паўтаральных падзей?\",\r\n\t\tsection_recurring: \"Паўтарэнне\",\r\n\t\tbutton_recurring: \"Адключана\",\r\n\t\tbutton_recurring_open: \"Уключана\",\r\n\t\tbutton_edit_series: \"Рэдагаваць серыю\",\r\n\t\tbutton_edit_occurrence: \"Рэдагаваць асобнік\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Спіс\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Апісанне\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Спіс\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Спic\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Дзень\",\r\n\t\trepeat_radio_week: \"Тыдзень\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Кожны\",\r\n\t\trepeat_text_day_count: \"дзень\",\r\n\t\trepeat_radio_day_type2: \"Кожны працоўны дзень\",\r\n\t\trepeat_week: \" Паўтараць кожны\",\r\n\t\trepeat_text_week_count: \"тыдзень\",\r\n\t\trepeat_radio_month_type: \"Паўтараць\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" чысла кожнага\",\r\n\t\trepeat_text_month_count: \"месяцу\",\r\n\t\trepeat_text_month_count2_before: \"кожны \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"дзень\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты заканчэння\",\r\n\t\trepeat_text_occurences_count: \"паўтораў\",\r\n\t\trepeat_radio_end2: \"\",\r\n\t\trepeat_radio_end3: \"Да \",\r\n\r\n\t\trepeat_never: \"Ніколі\",\r\n\t\trepeat_daily: \"Кожны дзень\",\r\n\t\trepeat_workdays: \"Кожны працоўны дзень\",\r\n\t\trepeat_weekly: \"Кожны тыдзень\",\r\n\t\trepeat_monthly: \"Кожны месяц\",\r\n\t\trepeat_yearly: \"Кожны год\",\r\n\t\trepeat_custom: \"Наладжвальны\",\r\n\t\trepeat_freq_day: \"Дзень\",\r\n\t\trepeat_freq_week: \"Тыдзень\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Заканчваецца\",\r\n\r\n\t\tmonth_for_recurring: [\"Студзеня\", \"Лютага\", \"Сакавіка\", \"Красавіка\", \"Мая\", \"Чэрвеня\", \"Ліпeня\", \"Жніўня\", \"Верасня\", \"Кастрычніка\", \"Лістапада\", \"Снежня\"],\r\n\t\tday_for_recurring: [\"Нядзелю\", \"Панядзелак\", \"Аўторак\", \"Сераду\", \"Чацвер\", \"Пятніцу\", \"Суботу\"]\r\n\t}\r\n};\r\n","/*\r\n @Traducido por Vicente Adria Bohigues - vicenteadria@hotmail.com\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Oct\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"],\r\n\t\tday_short: [\"Dg\", \"Dl\", \"Dm\", \"Dc\", \"Dj\", \"Dv\", \"Ds\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hui\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Setmana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nou esdeveniment\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancel·lar\",\r\n\t\ticon_details: \"Detalls\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Esborrar\",\r\n\t\tconfirm_closing: \"\", //\"Els seus canvis es perdràn, continuar ?\"\r\n\t\tconfirm_deleting: \"L'esdeveniment s'esborrarà definitivament, continuar ?\",\r\n\t\tsection_description: \"Descripció\",\r\n\t\tsection_time: \"Periode de temps\",\r\n\t\tfull_day: \"Tot el dia\",\r\n\r\n\t\tconfirm_recurring: \"¿Desitja modificar el conjunt d'esdeveniments repetits?\",\r\n\t\tsection_recurring: \"Repeteixca l'esdeveniment\",\r\n\t\tbutton_recurring: \"Impedit\",\r\n\t\tbutton_recurring_open: \"Permés\",\r\n\t\tbutton_edit_series: \"Edit sèrie\",\r\n\t\tbutton_edit_occurrence: \"Edita Instància\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descripció\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Any\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Taula\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create: \"Drag to create\",\r\n\t\tdrag_to_move: \"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok: \"OK\",\r\n\t\tmessage_cancel: \"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour: \"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diari\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Setmanal\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mensual\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada dia laborable\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"setmana els dies següents:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada\",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"de\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sense data de finalització\",\r\n\t\trepeat_text_occurences_count: \"ocurrències\",\r\n\t\trepeat_radio_end2: \"Després\",\r\n\t\trepeat_radio_end3: \"Finalitzar el\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Cada dia\",\r\n\t\trepeat_workdays: \"Cada dia laborable\",\r\n\t\trepeat_weekly: \"Cada setmana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada any\",\r\n\t\trepeat_custom: \"Personalitzat\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Setmana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Any\",\r\n\t\trepeat_on_date: \"En la data\",\r\n\t\trepeat_ends: \"Finalitza\",\r\n\r\n\t\tmonth_for_recurring: [\"Gener\", \"Febrer\", \"Març\", \"Abril\", \"Maig\", \"Juny\", \"Juliol\", \"Agost\", \"Setembre\", \"Octubre\", \"Novembre\", \"Desembre\"],\r\n\t\tday_for_recurring: [\"Diumenge\", \"Dilluns\", \"Dimarts\", \"Dimecres\", \"Dijous\", \"Divendres\", \"Dissabte\"]\r\n\t}\r\n};","/*\r\nTranslation by FreezeSoul\r\n*/\r\n//scheduler.config.day_date=\"%M %d日 %D\";\r\n//scheduler.config.default_date=\"%Y年 %M %d日\";\r\n//scheduler.config.month_date=\"%Y年 %M\";\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tmonth_short: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"],\r\n\t\tday_short: [\"日\", \"一\", \"二\", \"三\", \"四\", \"五\", \"六\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今天\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"周\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新建日程\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"关闭\",\r\n\t\ticon_details: \"详细\",\r\n\t\ticon_edit: \"编辑\",\r\n\t\ticon_delete: \"删除\",\r\n\t\tconfirm_closing: \"请确认是否撤销修改!\", //Your changes will be lost, are your sure?\r\n\t\tconfirm_deleting: \"是否删除日程?\",\r\n\t\tsection_description: \"描述\",\r\n\t\tsection_time: \"时间范围\",\r\n\t\tfull_day: \"整天\",\r\n\r\n\t\tconfirm_recurring:\"请确认是否将日程设为重复模式?\",\r\n\t\tsection_recurring:\"重复周期\",\r\n\t\tbutton_recurring:\"禁用\",\r\n\t\tbutton_recurring_open:\"启用\",\r\n\t\tbutton_edit_series: \"编辑系列\",\r\n\t\tbutton_edit_occurrence: \"编辑实例\",\r\n\t\t\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"议程\",\r\n\t\tdate:\"日期\",\r\n\t\tdescription:\"说明\",\r\n\t\t\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"议程\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab:\"电网\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"按天\",\r\n\t\trepeat_radio_week: \"按周\",\r\n\t\trepeat_radio_month: \"按月\",\r\n\t\trepeat_radio_year: \"按年\",\r\n\t\trepeat_radio_day_type: \"每\",\r\n\t\trepeat_text_day_count: \"天\",\r\n\t\trepeat_radio_day_type2: \"每个工作日\",\r\n\t\trepeat_week: \" 重复 每\",\r\n\t\trepeat_text_week_count: \"星期的:\",\r\n\t\trepeat_radio_month_type: \"重复\",\r\n\t\trepeat_radio_month_start: \"在\",\r\n\t\trepeat_text_month_day: \"日 每\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"每\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"在\",\r\n\t\tselect_year_day2: \"的\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"无结束日期\",\r\n\t\trepeat_text_occurences_count: \"次结束\",\r\n\t\trepeat_radio_end2: \"重复\",\r\n\t\trepeat_radio_end3: \"结束于\",\r\n\t\t\r\n\t\trepeat_never: \"从不\",\r\n\t\trepeat_daily: \"每天\",\r\n\t\trepeat_workdays: \"每个工作日\",\r\n\t\trepeat_weekly: \"每周\",\r\n\t\trepeat_monthly: \"每月\",\r\n\t\trepeat_yearly: \"每年\",\r\n\t\trepeat_custom: \"自定义\",\r\n\t\trepeat_freq_day: \"天\",\r\n\t\trepeat_freq_week: \"周\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"在日期\",\r\n\t\trepeat_ends: \"结束\",\r\n\r\n\t\tmonth_for_recurring: [\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\", \"七月\", \"八月\", \"九月\", \"十月\", \"十一月\", \"十二月\"],\r\n\t\tday_for_recurring: [\"星期日\", \"星期一\", \"星期二\", \"星期三\", \"星期四\", \"星期五\", \"星期六\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tmonth_short: [\"Led\", \"Ún\", \"Bře\", \"Dub\", \"Kvě\", \"Čer\", \"Čec\", \"Srp\", \"Září\", \"Říj\", \"List\", \"Pro\"],\r\n\t\tday_full: [\"Neděle\", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Út\", \"St\", \"Čt\", \"Pá\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Den\",\r\n\t\tweek_tab: \"Týden\",\r\n\t\tmonth_tab: \"Měsíc\",\r\n\t\tnew_event: \"Nová událost\",\r\n\t\ticon_save: \"Uložit\",\r\n\t\ticon_cancel: \"Zpět\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Smazat\",\r\n\t\tconfirm_closing: \"\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Událost bude trvale smazána, opravdu?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Přejete si upravit celou řadu opakovaných událostí?\",\r\n\t\tsection_recurring: \"Opakování události\",\r\n\t\tbutton_recurring: \"Vypnuto\",\r\n\t\tbutton_recurring_open: \"Zapnuto\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Upravit instance\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Full day\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mřížka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denně\",\r\n\t\trepeat_radio_week: \"Týdně\",\r\n\t\trepeat_radio_month: \"Měsíčně\",\r\n\t\trepeat_radio_year: \"Ročně\",\r\n\t\trepeat_radio_day_type: \"každý\",\r\n\t\trepeat_text_day_count: \"Den\",\r\n\t\trepeat_radio_day_type2: \"pracovní dny\",\r\n\t\trepeat_week: \"Opakuje každých\",\r\n\t\trepeat_text_week_count: \"Týdnů na:\",\r\n\t\trepeat_radio_month_type: \"u každého\",\r\n\t\trepeat_radio_month_start: \"na\",\r\n\t\trepeat_text_month_day: \"Den každého\",\r\n\t\trepeat_text_month_count: \"Měsíc\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"Měsíc\",\r\n\t\trepeat_year_label: \"na\",\r\n\t\tselect_year_day2: \"v\",\r\n\t\trepeat_text_year_day: \"Den v\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"bez data ukončení\",\r\n\t\trepeat_text_occurences_count: \"Události\",\r\n\t\trepeat_radio_end2: \"po\",\r\n\t\trepeat_radio_end3: \"Konec\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý den\",\r\n\t\trepeat_workdays: \"Každý pracovní den\",\r\n\t\trepeat_weekly: \"Každý týden\",\r\n\t\trepeat_monthly: \"Každý měsíc\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastní\",\r\n\t\trepeat_freq_day: \"Den\",\r\n\t\trepeat_freq_week: \"Týden\",\r\n\t\trepeat_freq_month: \"Měsíc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Končí\",\r\n\r\n\t\tmonth_for_recurring: [\"Leden\", \"Únor\", \"Březen\", \"Duben\", \"Květen\", \"Červen\", \"Červenec\", \"Srpen\", \"Září\", \"Říjen\", \"Listopad\", \"Prosinec\"],\r\n\t\tday_for_recurring: [\"Neděle \", \"Pondělí\", \"Úterý\", \"Středa\", \"Čtvrtek\", \"Pátek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marts\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uge\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny begivenhed\",\r\n\t\ticon_save: \"Gem\",\r\n\t\ticon_cancel: \"Fortryd\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Tilret\",\r\n\t\ticon_delete: \"Slet\",\r\n\t\tconfirm_closing: \"Dine rettelser vil gå tabt.. Er dy sikker?\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Bigivenheden vil blive slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du tilrette hele serien af gentagne begivenheder?\",\r\n\t\tsection_recurring: \"Gentag begivenhed\",\r\n\t\tbutton_recurring: \"Frakoblet\",\r\n\t\tbutton_recurring_open: \"Tilkoblet\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Rediger en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagsorden\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagsorden\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ugenlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"På hver arbejdsdag\",\r\n\t\trepeat_week: \" Gentager sig hver\",\r\n\t\trepeat_text_week_count: \"uge på følgende dage:\",\r\n\t\trepeat_radio_month_type: \"Hver den\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \" i hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen slutdato\",\r\n\t\trepeat_text_occurences_count: \"gentagelse\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\t\trepeat_radio_end3: \"Slut\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver hverdag\",\r\n\t\trepeat_weekly: \"Hver uge\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Brugerdefineret\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uge\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\" Januar\", \" Februar\", \" März \", \" April\", \" Mai\", \" Juni\", \" Juli\", \" August\", \" September \", \" Oktober\", \" November \", \" Dezember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mär\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [ \"Sonntag\", \"Montag\", \"Dienstag\", \" Mittwoch\", \" Donnerstag\", \"Freitag\", \"Samstag\"],\r\n\t\tday_short: [\"So\", \"Mo\", \"Di\", \"Mi\", \"Do\", \"Fr\", \"Sa\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Heute\",\r\n\t\tday_tab: \"Tag\",\r\n\t\tweek_tab: \"Woche\",\r\n\t\tmonth_tab: \"Monat\",\r\n\t\tnew_event: \"neuer Eintrag\",\r\n\t\ticon_save: \"Speichern\",\r\n\t\ticon_cancel: \"Abbrechen\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Ändern\",\r\n\t\ticon_delete: \"Löschen\",\r\n\t\tconfirm_closing: \"\", //\"Ihre Veränderungen werden verloren sein, wollen Sie ergänzen? \"\r\n\t\tconfirm_deleting: \"Der Eintrag wird gelöscht\",\r\n\t\tsection_description: \"Beschreibung\",\r\n\t\tsection_time: \"Zeitspanne\",\r\n\t\tfull_day: \"Ganzer Tag\",\r\n\r\n\t\tconfirm_recurring: \"Wollen Sie alle Einträge bearbeiten oder nur diesen einzelnen Eintrag?\",\r\n\t\tsection_recurring: \"Wiederholung\",\r\n\t\tbutton_recurring: \"Aus\",\r\n\t\tbutton_recurring_open: \"An\",\r\n\t\tbutton_edit_series: \"Bearbeiten Sie die Serie\",\r\n\t\tbutton_edit_occurrence: \"Bearbeiten Sie eine Kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beschreibung\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jahre\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Täglich\",\r\n\t\trepeat_radio_week: \"Wöchentlich\",\r\n\t\trepeat_radio_month: \"Monatlich\",\r\n\t\trepeat_radio_year: \"Jährlich\",\r\n\t\trepeat_radio_day_type: \"jeden\",\r\n\t\trepeat_text_day_count: \"Tag\",\r\n\t\trepeat_radio_day_type2: \"an jedem Arbeitstag\",\r\n\t\trepeat_week: \" Wiederholt sich jede\",\r\n\t\trepeat_text_week_count: \"Woche am:\",\r\n\t\trepeat_radio_month_type: \"an jedem\",\r\n\t\trepeat_radio_month_start: \"am\",\r\n\t\trepeat_text_month_day: \"Tag eines jeden\",\r\n\t\trepeat_text_month_count: \"Monats\",\r\n\t\trepeat_text_month_count2_before: \"jeden\",\r\n\t\trepeat_text_month_count2_after: \"Monats\",\r\n\t\trepeat_year_label: \"am\",\r\n\t\tselect_year_day2: \"im\",\r\n\t\trepeat_text_year_day: \"Tag im\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"kein Enddatum\",\r\n\t\trepeat_text_occurences_count: \"Ereignissen\",\r\n\t\trepeat_radio_end3: \"Schluß\",\r\n\t\trepeat_radio_end2: \"nach\",\r\n\r\n\t\trepeat_never: \"Nie\",\r\n\t\trepeat_daily: \"Jeden Tag\",\r\n\t\trepeat_workdays: \"Jeden Werktag\",\r\n\t\trepeat_weekly: \"Jede Woche\",\r\n\t\trepeat_monthly: \"Jeden Monat\",\r\n\t\trepeat_yearly: \"Jedes Jahr\",\r\n\t\trepeat_custom: \"Benutzerdefiniert\",\r\n\t\trepeat_freq_day: \"Tag\",\r\n\t\trepeat_freq_week: \"Woche\",\r\n\t\trepeat_freq_month: \"Monat\",\r\n\t\trepeat_freq_year: \"Jahr\",\r\n\t\trepeat_on_date: \"Am Datum\",\r\n\t\trepeat_ends: \"Endet\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"März\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\"],\r\n\t\tday_for_recurring: [\"Sonntag\", \"Montag\", \"Dienstag\", \"Mittwoch\", \"Donnerstag\", \"Freitag\", \"Samstag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tmonth_short: [\"ΙΑΝ\", \"ΦΕΒ\", \"ΜΑΡ\", \"ΑΠΡ\", \"ΜΑΙ\", \"ΙΟΥΝ\", \"ΙΟΥΛ\", \"ΑΥΓ\", \"ΣΕΠ\", \"ΟΚΤ\", \"ΝΟΕ\", \"ΔΕΚ\"],\r\n\t\tday_full: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"],\r\n\t\tday_short: [\"ΚΥ\", \"ΔΕ\", \"ΤΡ\", \"ΤΕ\", \"ΠΕ\", \"ΠΑ\", \"ΣΑ\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Σήμερα\",\r\n\t\tday_tab: \"Ημέρα\",\r\n\t\tweek_tab: \"Εβδομάδα\",\r\n\t\tmonth_tab: \"Μήνας\",\r\n\t\tnew_event: \"Νέο έργο\",\r\n\t\ticon_save: \"Αποθήκευση\",\r\n\t\ticon_cancel: \"Άκυρο\",\r\n\t\ticon_details: \"Λεπτομέρειες\",\r\n\t\ticon_edit: \"Επεξεργασία\",\r\n\t\ticon_delete: \"Διαγραφή\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Το έργο θα διαγραφεί οριστικά. Θέλετε να συνεχίσετε;\",\r\n\t\tsection_description: \"Περιγραφή\",\r\n\t\tsection_time: \"Χρονική περίοδος\",\r\n\t\tfull_day: \"Πλήρης Ημέρα\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Θέλετε να επεξεργασθείτε ολόκληρη την ομάδα των επαναλαμβανόμενων έργων;\",\r\n\t\tsection_recurring: \"Επαναλαμβανόμενο έργο\",\r\n\t\tbutton_recurring: \"Ανενεργό\",\r\n\t\tbutton_recurring_open: \"Ενεργό\",\r\n\t\tbutton_edit_series: \"Επεξεργαστείτε τη σειρά\",\r\n\t\tbutton_edit_occurrence: \"Επεξεργασία ένα αντίγραφο\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ημερήσια Διάταξη\",\r\n\t\tdate: \"Ημερομηνία\",\r\n\t\tdescription: \"Περιγραφή\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Έτος\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ημερήσια Διάταξη\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Πλέγμα\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Ημερησίως\",\r\n\t\trepeat_radio_week: \"Εβδομαδιαίως\",\r\n\t\trepeat_radio_month: \"Μηνιαίως\",\r\n\t\trepeat_radio_year: \"Ετησίως\",\r\n\t\trepeat_radio_day_type: \"Κάθε\",\r\n\t\trepeat_text_day_count: \"ημέρα\",\r\n\t\trepeat_radio_day_type2: \"Κάθε εργάσιμη\",\r\n\t\trepeat_week: \" Επανάληψη κάθε\",\r\n\t\trepeat_text_week_count: \"εβδομάδα τις επόμενες ημέρες:\",\r\n\t\trepeat_radio_month_type: \"Επανάληψη\",\r\n\t\trepeat_radio_month_start: \"Την\",\r\n\t\trepeat_text_month_day: \"ημέρα κάθε\",\r\n\t\trepeat_text_month_count: \"μήνα\",\r\n\t\trepeat_text_month_count2_before: \"κάθε\",\r\n\t\trepeat_text_month_count2_after: \"μήνα\",\r\n\t\trepeat_year_label: \"Την\",\r\n\t\tselect_year_day2: \"του\",\r\n\t\trepeat_text_year_day: \"ημέρα\",\r\n\t\tselect_year_month: \"μήνα\",\r\n\t\trepeat_radio_end: \"Χωρίς ημερομηνία λήξεως\",\r\n\t\trepeat_text_occurences_count: \"επαναλήψεις\",\r\n\t\trepeat_radio_end3: \"Λήγει την\",\r\n\t\trepeat_radio_end2: \"Μετά από\",\r\n\r\n\t\trepeat_never: \"Ποτέ\",\r\n\t\trepeat_daily: \"Κάθε μέρα\",\r\n\t\trepeat_workdays: \"Κάθε εργάσιμη μέρα\",\r\n\t\trepeat_weekly: \"Κάθε εβδομάδα\",\r\n\t\trepeat_monthly: \"Κάθε μήνα\",\r\n\t\trepeat_yearly: \"Κάθε χρόνο\",\r\n\t\trepeat_custom: \"Προσαρμοσμένο\",\r\n\t\trepeat_freq_day: \"Ημέρα\",\r\n\t\trepeat_freq_week: \"Εβδομάδα\",\r\n\t\trepeat_freq_month: \"Μήνας\",\r\n\t\trepeat_freq_year: \"Χρόνος\",\r\n\t\trepeat_on_date: \"Σε ημερομηνία\",\r\n\t\trepeat_ends: \"Λήγει\",\r\n\r\n\t\tmonth_for_recurring: [\"Ιανουάριος\", \"Φεβρουάριος\", \"Μάρτιος\", \"Απρίλιος\", \"Μάϊος\", \"Ιούνιος\", \"Ιούλιος\", \"Αύγουστος\", \"Σεπτέμβριος\", \"Οκτώβριος\", \"Νοέμβριος\", \"Δεκέμβριος\"],\r\n\t\tday_for_recurring: [\"Κυριακή\", \"Δευτέρα\", \"Τρίτη\", \"Τετάρτη\", \"Πέμπτη\", \"Παρασκευή\", \"Σάββατο\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate:{\r\n\t\tmonth_full:[\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\r\n\t\tday_short:[\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Today\",\r\n\t\tday_tab:\"Day\",\r\n\t\tweek_tab:\"Week\",\r\n\t\tmonth_tab:\"Month\",\r\n\t\tnew_event:\"New event\",\r\n\t\ticon_save:\"Save\",\r\n\t\ticon_cancel:\"Cancel\",\r\n\t\ticon_details:\"Details\",\r\n\t\ticon_edit:\"Edit\",\r\n\t\ticon_delete:\"Delete\",\r\n\t\tconfirm_closing:\"\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Event will be deleted permanently, are you sure?\",\r\n\t\tsection_description:\"Description\",\r\n\t\tsection_time:\"Time period\",\r\n\t\tfull_day:\"Full day\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Do you want to edit the whole set of repeated events?\",\r\n\t\tsection_recurring:\"Repeat event\",\r\n\t\tbutton_recurring:\"Disabled\",\r\n\t\tbutton_recurring_open:\"Enabled\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Date\",\r\n\t\tdescription:\"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"Year\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daily\",//name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Weekly\",//name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Monthly\",\r\n\t\trepeat_radio_year: \"Yearly\",\r\n\t\trepeat_radio_day_type: \"Every\",\r\n\t\trepeat_text_day_count: \"day\",\r\n\t\trepeat_radio_day_type2: \"Every workday\",\r\n\t\trepeat_week: \" Repeat every\",\r\n\t\trepeat_text_week_count: \"week next days:\",\r\n\t\trepeat_radio_month_type: \"Repeat\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"day every\",\r\n\t\trepeat_text_month_count: \"month\",\r\n\t\trepeat_text_month_count2_before: \"every\",\r\n\t\trepeat_text_month_count2_after: \"month\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"day\",\r\n\t\tselect_year_month: \"month\",\r\n\t\trepeat_radio_end: \"No end date\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end2: \"After\",\r\n\t\trepeat_radio_end3: \"End by\",\r\n\r\n\t\trepeat_never: \"Never\",\r\n\t\trepeat_daily: \"Every day\",\r\n\t\trepeat_workdays: \"Every weekday\",\r\n\t\trepeat_weekly: \"Every week\",\r\n\t\trepeat_monthly: \"Every month\",\r\n\t\trepeat_yearly: \"Every year\",\r\n\t\trepeat_custom: \"Custom\",\r\n\t\trepeat_freq_day: \"Day\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Month\",\r\n\t\trepeat_freq_year: \"Year\",\r\n\t\trepeat_on_date: \"On date\",\r\n\t\trepeat_ends: \"Ends\",\r\n\r\n\t\tmonth_for_recurring: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]//\r\n\t}\r\n};\r\n\r\n","/*\r\n @Autor Manuel Fernandez Panzuela - www.mfernandez.es\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\", \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tmonth_short: [\"Ene\", \"Feb\", \"Mar\", \"Abr\", \"May\", \"Jun\", \"Jul\", \"Ago\", \"Sep\", \"Oct\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jueves\", \"Viernes\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mié\", \"Jue\", \"Vie\", \"Sáb\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoy\",\r\n\t\tday_tab: \"Día\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mes\",\r\n\t\tnew_event: \"Nuevo evento\",\r\n\t\ticon_save: \"Guardar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalles\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Eliminar\",\r\n\t\tconfirm_closing: \"\", //\"Sus cambios se perderán, continuar ?\"\r\n\t\tconfirm_deleting: \"El evento se borrará definitivamente, ¿continuar?\",\r\n\t\tsection_description: \"Descripción\",\r\n\t\tsection_time: \"Período\",\r\n\t\tfull_day: \"Todo el día\",\r\n\r\n\t\tconfirm_recurring: \"¿Desea modificar el conjunto de eventos repetidos?\",\r\n\t\tsection_recurring: \"Repita el evento\",\r\n\t\tbutton_recurring: \"Impedido\",\r\n\t\tbutton_recurring_open: \"Permitido\",\r\n\t\tbutton_edit_series: \"Editar la serie\",\r\n\t\tbutton_edit_occurrence: \"Editar este evento\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Día\",\r\n\t\tdate: \"Fecha\",\r\n\t\tdescription: \"Descripción\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Año\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Día\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Reja\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diariamente\",\r\n\t\trepeat_radio_week: \"Semanalmente\",\r\n\t\trepeat_radio_month: \"Mensualmente\",\r\n\t\trepeat_radio_year: \"Anualmente\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia\",\r\n\t\trepeat_radio_day_type2: \"Cada jornada de trabajo\",\r\n\t\trepeat_week: \" Repetir cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repita\",\r\n\t\trepeat_radio_month_start: \"El\",\r\n\t\trepeat_text_month_day: \"dia cada \",\r\n\t\trepeat_text_month_count: \"mes\",\r\n\t\trepeat_text_month_count2_before: \"cada\",\r\n\t\trepeat_text_month_count2_after: \"mes\",\r\n\t\trepeat_year_label: \"El\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mes\",\r\n\t\trepeat_radio_end: \"Sin fecha de finalización\",\r\n\t\trepeat_text_occurences_count: \"ocurrencias\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Después de\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Cada día\",\r\n\t\trepeat_workdays: \"Cada día laborable\",\r\n\t\trepeat_weekly: \"Cada semana\",\r\n\t\trepeat_monthly: \"Cada mes\",\r\n\t\trepeat_yearly: \"Cada año\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Día\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mes\",\r\n\t\trepeat_freq_year: \"Año\",\r\n\t\trepeat_on_date: \"En la fecha\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Enero\", \"Febrero\", \"Маrzo\", \"Аbril\", \"Mayo\", \"Junio\", \"Julio\", \"Аgosto\", \"Setiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Lunes\", \"Martes\", \"Miércoles\", \"Jeuves\", \"Viernes\", \"Sabado\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tmonth_short: [\"Tam\", \"Hel\", \"Maa\", \"Huh\", \"Tou\", \"Kes\", \"Hei\", \"Elo\", \"Syy\", \"Lok\", \"Mar\", \"Jou\"],\r\n\t\tday_full: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"],\r\n\t\tday_short: [\"Su\", \"Ma\", \"Ti\", \"Ke\", \"To\", \"Pe\", \"La\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Tänään\",\r\n\t\tday_tab: \"Päivä\",\r\n\t\tweek_tab: \"Viikko\",\r\n\t\tmonth_tab: \"Kuukausi\",\r\n\t\tnew_event: \"Uusi tapahtuma\",\r\n\t\ticon_save: \"Tallenna\",\r\n\t\ticon_cancel: \"Peru\",\r\n\t\ticon_details: \"Tiedot\",\r\n\t\ticon_edit: \"Muokkaa\",\r\n\t\ticon_delete: \"Poista\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Haluatko varmasti poistaa tapahtuman?\",\r\n\t\tsection_description: \"Kuvaus\",\r\n\t\tsection_time: \"Aikajakso\",\r\n\t\tfull_day: \"Koko päivä\",\r\n\r\n\t\tconfirm_recurring: \"Haluatko varmasti muokata toistuvan tapahtuman kaikkia jaksoja?\",\r\n\t\tsection_recurring: \"Toista tapahtuma\",\r\n\t\tbutton_recurring: \"Ei käytössä\",\r\n\t\tbutton_recurring_open: \"Käytössä\",\r\n\t\tbutton_edit_series: \"Muokkaa sarja\",\r\n\t\tbutton_edit_occurrence: \"Muokkaa kopio\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Esityslista\",\r\n\t\tdate: \"Päivämäärä\",\r\n\t\tdescription: \"Kuvaus\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Vuoden\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Esityslista\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Ritilä\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Luo uusi vetämällä\",\r\n\t\tdrag_to_move:\"Siirrä vetämällä\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Päivittäin\",\r\n\t\trepeat_radio_week: \"Viikoittain\",\r\n\t\trepeat_radio_month: \"Kuukausittain\",\r\n\t\trepeat_radio_year: \"Vuosittain\",\r\n\t\trepeat_radio_day_type: \"Joka\",\r\n\t\trepeat_text_day_count: \"päivä\",\r\n\t\trepeat_radio_day_type2: \"Joka arkipäivä\",\r\n\t\trepeat_week: \"Toista joka\",\r\n\t\trepeat_text_week_count: \"viikko näinä päivinä:\",\r\n\t\trepeat_radio_month_type: \"Toista\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \"päivänä joka\",\r\n\t\trepeat_text_month_count: \"kuukausi\",\r\n\t\trepeat_text_month_count2_before: \"joka\",\r\n\t\trepeat_text_month_count2_after: \"kuukausi\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"päivä\",\r\n\t\tselect_year_month: \"kuukausi\",\r\n\t\trepeat_radio_end: \"Ei loppumisaikaa\",\r\n\t\trepeat_text_occurences_count: \"Toiston jälkeen\",\r\n\t\trepeat_radio_end3: \"Loppuu\",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ei koskaan\",\r\n\t\trepeat_daily: \"Joka päivä\",\r\n\t\trepeat_workdays: \"Joka arkipäivä\",\r\n\t\trepeat_weekly: \"Joka viikko\",\r\n\t\trepeat_monthly: \"Joka kuukausi\",\r\n\t\trepeat_yearly: \"Joka vuosi\",\r\n\t\trepeat_custom: \"Mukautettu\",\r\n\t\trepeat_freq_day: \"Päivä\",\r\n\t\trepeat_freq_week: \"Viikko\",\r\n\t\trepeat_freq_month: \"Kuukausi\",\r\n\t\trepeat_freq_year: \"Vuosi\",\r\n\t\trepeat_on_date: \"Tiettynä päivänä\",\r\n\t\trepeat_ends: \"Päättyy\",\r\n\r\n\t\tmonth_for_recurring: [\"Tammikuu\", \"Helmikuu\", \"Maaliskuu\", \"Huhtikuu\", \"Toukokuu\", \"Kesäkuu\", \"Heinäkuu\", \"Elokuu\", \"Syyskuu\", \"Lokakuu\", \"Marraskuu\", \"Joulukuu\"],\r\n\t\tday_for_recurring: [\"Sunnuntai\", \"Maanantai\", \"Tiistai\", \"Keskiviikko\", \"Torstai\", \"Perjantai\", \"Lauantai\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tmonth_short: [\"Jan\", \"Fév\", \"Mar\", \"Avr\", \"Mai\", \"Juin\", \"Juil\", \"Aoû\", \"Sep\", \"Oct\", \"Nov\", \"Déc\"],\r\n\t\tday_full: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"],\r\n\t\tday_short: [\"Dim\", \"Lun\", \"Mar\", \"Mer\", \"Jeu\", \"Ven\", \"Sam\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Aujourd'hui\",\r\n\t\tday_tab: \"Jour\",\r\n\t\tweek_tab: \"Semaine\",\r\n\t\tmonth_tab: \"Mois\",\r\n\t\tnew_event: \"Nouvel événement\",\r\n\t\ticon_save: \"Enregistrer\",\r\n\t\ticon_cancel: \"Annuler\",\r\n\t\ticon_details: \"Détails\",\r\n\t\ticon_edit: \"Modifier\",\r\n\t\ticon_delete: \"Effacer\",\r\n\t\tconfirm_closing: \"\", //Vos modifications seront perdus, êtes-vous sûr ?\r\n\t\tconfirm_deleting: \"L'événement sera effacé sans appel, êtes-vous sûr ?\",\r\n\t\tsection_description: \"Description\",\r\n\t\tsection_time: \"Période\",\r\n\t\tfull_day: \"Journée complète\",\r\n\r\n\t\tconfirm_recurring: \"Voulez-vous éditer toute une série d'évènements répétés?\",\r\n\t\tsection_recurring: \"Périodicité\",\r\n\t\tbutton_recurring: \"Désactivé\",\r\n\t\tbutton_recurring_open: \"Activé\",\r\n\t\tbutton_edit_series: \"Modifier la série\",\r\n\t\tbutton_edit_occurrence: \"Modifier une copie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Jour\",\r\n\t\tdate: \"Date\",\r\n\t\tdescription: \"Description\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Année\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Jour\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grille\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidienne\",\r\n\t\trepeat_radio_week: \"Hebdomadaire\",\r\n\t\trepeat_radio_month: \"Mensuelle\",\r\n\t\trepeat_radio_year: \"Annuelle\",\r\n\t\trepeat_radio_day_type: \"Chaque\",\r\n\t\trepeat_text_day_count: \"jour\",\r\n\t\trepeat_radio_day_type2: \"Chaque journée de travail\",\r\n\t\trepeat_week: \" Répéter toutes les\",\r\n\t\trepeat_text_week_count: \"semaine:\",\r\n\t\trepeat_radio_month_type: \"Répéter\",\r\n\t\trepeat_radio_month_start: \"Le\",\r\n\t\trepeat_text_month_day: \"jour chaque\",\r\n\t\trepeat_text_month_count: \"mois\",\r\n\t\trepeat_text_month_count2_before: \"chaque\",\r\n\t\trepeat_text_month_count2_after: \"mois\",\r\n\t\trepeat_year_label: \"Le\",\r\n\t\tselect_year_day2: \"du\",\r\n\t\trepeat_text_year_day: \"jour\",\r\n\t\tselect_year_month: \"mois\",\r\n\t\trepeat_radio_end: \"Pas de date d"achèvement\",\r\n\t\trepeat_text_occurences_count: \"occurrences\",\r\n\t\trepeat_radio_end3: \"Fin\",\r\n\t\trepeat_radio_end2: \"Après\",\r\n\r\n\t\trepeat_never: \"Jamais\",\r\n\t\trepeat_daily: \"Chaque jour\",\r\n\t\trepeat_workdays: \"Chaque jour ouvrable\",\r\n\t\trepeat_weekly: \"Chaque semaine\",\r\n\t\trepeat_monthly: \"Chaque mois\",\r\n\t\trepeat_yearly: \"Chaque année\",\r\n\t\trepeat_custom: \"Personnalisé\",\r\n\t\trepeat_freq_day: \"Jour\",\r\n\t\trepeat_freq_week: \"Semaine\",\r\n\t\trepeat_freq_month: \"Mois\",\r\n\t\trepeat_freq_year: \"Année\",\r\n\t\trepeat_on_date: \"À la date\",\r\n\t\trepeat_ends: \"Se termine\",\r\n\r\n\t\tmonth_for_recurring: [\"Janvier\", \"Février\", \"Mars\", \"Avril\", \"Mai\", \"Juin\", \"Juillet\", \"Août\", \"Septembre\", \"Octobre\", \"Novembre\", \"Décembre\"],\r\n\t\tday_for_recurring: [\"Dimanche\", \"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"Vendredi\", \"Samedi\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tmonth_short: [\"ינו\", \"פבר\", \"מרץ\", \"אפר\", \"מאי\", \"יונ\", \"יול\", \"אוג\", \"ספט\", \"אוק\", \"נוב\", \"דצמ\"],\r\n\t\tday_full: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"],\r\n\t\tday_short: [\"א\", \"ב\", \"ג\", \"ד\", \"ה\", \"ו\", \"ש\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"היום\",\r\n\t\tday_tab: \"יום\",\r\n\t\tweek_tab: \"שבוע\",\r\n\t\tmonth_tab: \"חודש\",\r\n\t\tnew_event: \"ארוע חדש\",\r\n\t\ticon_save: \"שמור\",\r\n\t\ticon_cancel: \"בטל\",\r\n\t\ticon_details: \"פרטים\",\r\n\t\ticon_edit: \"ערוך\",\r\n\t\ticon_delete: \"מחק\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"ארוע ימחק סופית.להמשיך?\",\r\n\t\tsection_description: \"תיאור\",\r\n\t\tsection_time: \"תקופה\",\r\n\r\n\t\tconfirm_recurring: \"האם ברצונך לשנות כל סדרת ארועים מתמשכים?\",\r\n\t\tsection_recurring: \"להעתיק ארוע\",\r\n\t\tbutton_recurring: \"לא פעיל\",\r\n\t\tbutton_recurring_open: \"פעיל\",\r\n\t\tfull_day: \"יום שלם\",\r\n\t\tbutton_edit_series: \"ערוך את הסדרה\",\r\n\t\tbutton_edit_occurrence: \"עריכת עותק\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"סדר יום\",\r\n\t\tdate: \"תאריך\",\r\n\t\tdescription: \"תיאור\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"לשנה\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"סדר יום\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"סורג\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"גרור כדי להזיז\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"בטל\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"הבא\",\r\n\t\tprev: \"הקודם\",\r\n\t\tyear: \"שנה\",\r\n\t\tmonth: \"חודש\",\r\n\t\tday: \"יום\",\r\n\t\thour:\"שעה\",\r\n\t\tminute: \"דקה\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"יומי\",\r\n\t\trepeat_radio_week: \"שבועי\",\r\n\t\trepeat_radio_month: \"חודשי\",\r\n\t\trepeat_radio_year: \"שנתי\",\r\n\t\trepeat_radio_day_type: \"חזור כל\",\r\n\t\trepeat_text_day_count: \"ימים\",\r\n\t\trepeat_radio_day_type2: \"חזור כל יום עבודה\",\r\n\t\trepeat_week: \" חזור כל\",\r\n\t\trepeat_text_week_count: \"שבוע לפי ימים:\",\r\n\t\trepeat_radio_month_type: \"חזור כל\",\r\n\t\trepeat_radio_month_start: \"כל\",\r\n\t\trepeat_text_month_day: \"ימים כל\",\r\n\t\trepeat_text_month_count: \"חודשים\",\r\n\t\trepeat_text_month_count2_before: \"חזור כל\",\r\n\t\trepeat_text_month_count2_after: \"חודש\",\r\n\t\trepeat_year_label: \"כל\",\r\n\t\tselect_year_day2: \"בחודש\",\r\n\t\trepeat_text_year_day: \"ימים\",\r\n\t\tselect_year_month: \"חודש\",\r\n\t\trepeat_radio_end: \"לעולם לא מסתיים\",\r\n\t\trepeat_text_occurences_count: \"אירועים\",\r\n\t\trepeat_radio_end3: \"מסתיים ב\",\r\n\t\trepeat_radio_end2: \"אחרי\",\r\n\r\n\t\trepeat_never: \"אף פעם\",\r\n\t\trepeat_daily: \"כל יום\",\r\n\t\trepeat_workdays: \"כל יום עבודה\",\r\n\t\trepeat_weekly: \"כל שבוע\",\r\n\t\trepeat_monthly: \"כל חודש\",\r\n\t\trepeat_yearly: \"כל שנה\",\r\n\t\trepeat_custom: \"מותאם אישית\",\r\n\t\trepeat_freq_day: \"יום\",\r\n\t\trepeat_freq_week: \"שבוע\",\r\n\t\trepeat_freq_month: \"חודש\",\r\n\t\trepeat_freq_year: \"שנה\",\r\n\t\trepeat_on_date: \"בתאריך\",\r\n\t\trepeat_ends: \"מסתיים\",\r\n\r\n\t\tmonth_for_recurring: [\"ינואר\", \"פברואר\", \"מרץ\", \"אפריל\", \"מאי\", \"יוני\", \"יולי\", \"אוגוסט\", \"ספטמבר\", \"אוקטובר\", \"נובמבר\", \"דצמבר\"],\r\n\t\tday_for_recurring: [\"ראשון\", \"שני\", \"שלישי\", \"רביעי\", \"חמישי\", \"שישי\", \"שבת\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Már\", \"Ápr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Vasárnap\", \"Hétfõ\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"szombat\"],\r\n\t\tday_short: [\"Va\", \"Hé\", \"Ke\", \"Sze\", \"Csü\", \"Pé\", \"Szo\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Ma\",\r\n\t\tday_tab: \"Nap\",\r\n\t\tweek_tab: \"Hét\",\r\n\t\tmonth_tab: \"Hónap\",\r\n\t\tnew_event: \"Új esemény\",\r\n\t\ticon_save: \"Mentés\",\r\n\t\ticon_cancel: \"Mégse\",\r\n\t\ticon_details: \"Részletek\",\r\n\t\ticon_edit: \"Szerkesztés\",\r\n\t\ticon_delete: \"Törlés\",\r\n\t\tconfirm_closing: \"\", //A változások elvesznek, biztosan folytatja? \"\r\n\t\tconfirm_deleting: \"Az esemény törölve lesz, biztosan folytatja?\",\r\n\t\tsection_description: \"Leírás\",\r\n\t\tsection_time: \"Idõszak\",\r\n\t\tfull_day: \"Egesz napos\",\r\n\r\n\t\t/*ismétlõdõ események*/\r\n\t\tconfirm_recurring: \"Biztosan szerkeszteni akarod az összes ismétlõdõ esemény beállítását?\",\r\n\t\tsection_recurring: \"Esemény ismétlése\",\r\n\t\tbutton_recurring: \"Tiltás\",\r\n\t\tbutton_recurring_open: \"Engedélyezés\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Szerkesztés bíróság\",\r\n\r\n\t\t/*napirendi nézet*/\r\n\t\tagenda_tab: \"Napirend\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Leírás\",\r\n\r\n\t\t/*éves nézet*/\r\n\t\tyear_tab: \"Év\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Napi\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Heti\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Havi\",\r\n\t\trepeat_radio_year: \"Éves\",\r\n\t\trepeat_radio_day_type: \"Minden\",\r\n\t\trepeat_text_day_count: \"nap\",\r\n\t\trepeat_radio_day_type2: \"Minden munkanap\",\r\n\t\trepeat_week: \" Ismételje meg minden\",\r\n\t\trepeat_text_week_count: \"héten a következő napokon:\",\r\n\t\trepeat_radio_month_type: \"Ismétlés\",\r\n\t\trepeat_radio_month_start: \"Ekkor\",\r\n\t\trepeat_text_month_day: \"nap minden\",\r\n\t\trepeat_text_month_count: \"hónapban\",\r\n\t\trepeat_text_month_count2_before: \"minden\",\r\n\t\trepeat_text_month_count2_after: \"hónapban\",\r\n\t\trepeat_year_label: \"Ekkor\",\r\n\t\tselect_year_day2: \"-án/-én\",\r\n\t\trepeat_text_year_day: \"nap\",\r\n\t\tselect_year_month: \"hónap\",\r\n\t\trepeat_radio_end: \"Nincs befejezési dátum\",\r\n\t\trepeat_text_occurences_count: \"esemény\",\r\n\t\trepeat_radio_end2: \"Után\",\r\n\t\trepeat_radio_end3: \"Befejező dátum\",\r\n\r\n\t\trepeat_never: \"Soha\",\r\n\t\trepeat_daily: \"Minden nap\",\r\n\t\trepeat_workdays: \"Minden munkanap\",\r\n\t\trepeat_weekly: \"Minden héten\",\r\n\t\trepeat_monthly: \"Minden hónapban\",\r\n\t\trepeat_yearly: \"Minden évben\",\r\n\t\trepeat_custom: \"Egyedi\",\r\n\t\trepeat_freq_day: \"Nap\",\r\n\t\trepeat_freq_week: \"Hét\",\r\n\t\trepeat_freq_month: \"Hónap\",\r\n\t\trepeat_freq_year: \"Év\",\r\n\t\trepeat_on_date: \"Dátum szerint\",\r\n\t\trepeat_ends: \"Befejeződik\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Március\", \"Április\", \"Május\", \"Június\", \"Július\", \"Augusztus\", \"Szeptember\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Vasárnap\", \"Hétfő\", \"Kedd\", \"Szerda\", \"Csütörtök\", \"Péntek\", \"Szombat\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Ags\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"],\r\n\t\tday_short: [\"Ming\", \"Sen\", \"Sel\", \"Rab\", \"Kam\", \"Jum\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hari Ini\",\r\n\t\tday_tab: \"Hari\",\r\n\t\tweek_tab: \"Minggu\",\r\n\t\tmonth_tab: \"Bulan\",\r\n\t\tnew_event: \"Acara Baru\",\r\n\t\ticon_save: \"Simpan\",\r\n\t\ticon_cancel: \"Batal\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edit\",\r\n\t\ticon_delete: \"Hapus\",\r\n\t\tconfirm_closing: \"\", /*Perubahan tidak akan disimpan ?*/\r\n\t\tconfirm_deleting: \"Acara akan dihapus\",\r\n\t\tsection_description: \"Keterangan\",\r\n\t\tsection_time: \"Periode\",\r\n\t\tfull_day: \"Hari penuh\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Apakah acara ini akan berulang?\",\r\n\t\tsection_recurring: \"Acara Rutin\",\r\n\t\tbutton_recurring: \"Tidak Difungsikan\",\r\n\t\tbutton_recurring_open: \"Difungsikan\",\r\n\t\tbutton_edit_series: \"Mengedit seri\",\r\n\t\tbutton_edit_occurrence: \"Mengedit salinan\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Tanggal\",\r\n\t\tdescription: \"Keterangan\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Tahun\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Harian\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Mingguan\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Bulanan\",\r\n\t\trepeat_radio_year: \"Tahunan\",\r\n\t\trepeat_radio_day_type: \"Setiap\",\r\n\t\trepeat_text_day_count: \"hari\",\r\n\t\trepeat_radio_day_type2: \"Setiap hari kerja\",\r\n\t\trepeat_week: \" Ulangi setiap\",\r\n\t\trepeat_text_week_count: \"minggu pada hari berikut:\",\r\n\t\trepeat_radio_month_type: \"Ulangi\",\r\n\t\trepeat_radio_month_start: \"Pada\",\r\n\t\trepeat_text_month_day: \"hari setiap\",\r\n\t\trepeat_text_month_count: \"bulan\",\r\n\t\trepeat_text_month_count2_before: \"setiap\",\r\n\t\trepeat_text_month_count2_after: \"bulan\",\r\n\t\trepeat_year_label: \"Pada\",\r\n\t\tselect_year_day2: \"dari\",\r\n\t\trepeat_text_year_day: \"hari\",\r\n\t\tselect_year_month: \"bulan\",\r\n\t\trepeat_radio_end: \"Tanpa tanggal akhir\",\r\n\t\trepeat_text_occurences_count: \"kejadian\",\r\n\t\trepeat_radio_end2: \"Setelah\",\r\n\t\trepeat_radio_end3: \"Berakhir pada\",\r\n\r\n\t\trepeat_never: \"Tidak pernah\",\r\n\t\trepeat_daily: \"Setiap hari\",\r\n\t\trepeat_workdays: \"Setiap hari kerja\",\r\n\t\trepeat_weekly: \"Setiap minggu\",\r\n\t\trepeat_monthly: \"Setiap bulan\",\r\n\t\trepeat_yearly: \"Setiap tahun\",\r\n\t\trepeat_custom: \"Kustom\",\r\n\t\trepeat_freq_day: \"Hari\",\r\n\t\trepeat_freq_week: \"Minggu\",\r\n\t\trepeat_freq_month: \"Bulan\",\r\n\t\trepeat_freq_year: \"Tahun\",\r\n\t\trepeat_on_date: \"Pada tanggal\",\r\n\t\trepeat_ends: \"Berakhir\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maret\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Agustus\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Minggu\", \"Senin\", \"Selasa\", \"Rabu\", \"Kamis\", \"Jumat\", \"Sabtu\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Giugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tmonth_short: [\"Gen\", \"Feb\", \"Mar\", \"Apr\", \"Mag\", \"Giu\", \"Lug\", \"Ago\", \"Set\", \"Ott\", \"Nov\", \"Dic\"],\r\n\t\tday_full: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Giovedì\", \"Venerdì\", \"Sabato\"],\r\n\t\tday_short: [\"Dom\", \"Lun\", \"Mar\", \"Mer\", \"Gio\", \"Ven\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Oggi\",\r\n\t\tday_tab: \"Giorno\",\r\n\t\tweek_tab: \"Settimana\",\r\n\t\tmonth_tab: \"Mese\",\r\n\t\tnew_event: \"Nuovo evento\",\r\n\t\ticon_save: \"Salva\",\r\n\t\ticon_cancel: \"Chiudi\",\r\n\t\ticon_details: \"Dettagli\",\r\n\t\ticon_edit: \"Modifica\",\r\n\t\ticon_delete: \"Elimina\",\r\n\t\tconfirm_closing: \"\", //Le modifiche apportate saranno perse, siete sicuri?\r\n\t\tconfirm_deleting: \"L'evento sarà eliminato, siete sicuri?\",\r\n\t\tsection_description: \"Descrizione\",\r\n\t\tsection_time: \"Periodo di tempo\",\r\n\t\tfull_day: \"Intera giornata\",\r\n\r\n\t\tconfirm_recurring: \"Vuoi modificare l'intera serie di eventi?\",\r\n\t\tsection_recurring: \"Ripetere l'evento\",\r\n\t\tbutton_recurring: \"Disattivato\",\r\n\t\tbutton_recurring_open: \"Attivato\",\r\n\t\tbutton_edit_series: \"Modificare la serie\",\r\n\t\tbutton_edit_occurrence: \"Modificare una copia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrizione\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Anno\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Griglia\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Quotidiano\",\r\n\t\trepeat_radio_week: \"Settimanale\",\r\n\t\trepeat_radio_month: \"Mensile\",\r\n\t\trepeat_radio_year: \"Annuale\",\r\n\t\trepeat_radio_day_type: \"Ogni\",\r\n\t\trepeat_text_day_count: \"giorno\",\r\n\t\trepeat_radio_day_type2: \"Ogni giornata lavorativa\",\r\n\t\trepeat_week: \" Ripetere ogni\",\r\n\t\trepeat_text_week_count: \"settimana:\",\r\n\t\trepeat_radio_month_type: \"Ripetere\",\r\n\t\trepeat_radio_month_start: \"Il\",\r\n\t\trepeat_text_month_day: \"giorno ogni\",\r\n\t\trepeat_text_month_count: \"mese\",\r\n\t\trepeat_text_month_count2_before: \"ogni\",\r\n\t\trepeat_text_month_count2_after: \"mese\",\r\n\t\trepeat_year_label: \"Il\",\r\n\t\tselect_year_day2: \"del\",\r\n\t\trepeat_text_year_day: \"giorno\",\r\n\t\tselect_year_month: \"mese\",\r\n\t\trepeat_radio_end: \"Senza data finale\",\r\n\t\trepeat_text_occurences_count: \"occorenze\",\r\n\t\trepeat_radio_end3: \"Fine\",\r\n\t\trepeat_radio_end2: \"Dopo\",\r\n\r\n\t\trepeat_never: \"Mai\",\r\n\t\trepeat_daily: \"Ogni giorno\",\r\n\t\trepeat_workdays: \"Ogni giorno feriale\",\r\n\t\trepeat_weekly: \"Ogni settimana\",\r\n\t\trepeat_monthly: \"Ogni mese\",\r\n\t\trepeat_yearly: \"Ogni anno\",\r\n\t\trepeat_custom: \"Personalizzato\",\r\n\t\trepeat_freq_day: \"Giorno\",\r\n\t\trepeat_freq_week: \"Settimana\",\r\n\t\trepeat_freq_month: \"Mese\",\r\n\t\trepeat_freq_year: \"Anno\",\r\n\t\trepeat_on_date: \"Alla data\",\r\n\t\trepeat_ends: \"Finisce\",\r\n\r\n\t\tmonth_for_recurring: [\"Gennaio\", \"Febbraio\", \"Marzo\", \"Aprile\", \"Maggio\", \"Jiugno\", \"Luglio\", \"Agosto\", \"Settembre\", \"Ottobre\", \"Novembre\", \"Dicembre\"],\r\n\t\tday_for_recurring: [\"Domenica\", \"Lunedì\", \"Martedì\", \"Mercoledì\", \"Jovedì\", \"Venerdì\", \"Sabato\"]\r\n\t}\r\n};\r\n","/*\r\n Translation by Genexus Japan Inc.\r\n */\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tmonth_short: [ \"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_full: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"],\r\n\t\tday_short: [\"日\", \"月\", \"火\", \"水\", \"木\", \"金\", \"土\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"今日\",\r\n\t\tday_tab: \"日\",\r\n\t\tweek_tab: \"週\",\r\n\t\tmonth_tab: \"月\",\r\n\t\tnew_event: \"新イベント\",\r\n\t\ticon_save: \"保存\",\r\n\t\ticon_cancel: \"キャンセル\",\r\n\t\ticon_details: \"詳細\",\r\n\t\ticon_edit: \"編集\",\r\n\t\ticon_delete: \"削除\",\r\n\t\tconfirm_closing: \"\", //変更が取り消されます、宜しいですか?\r\n\t\tconfirm_deleting: \"イベント完全に削除されます、宜しいですか?\",\r\n\t\tsection_description: \"デスクリプション\",\r\n\t\tsection_time: \"期間\",\r\n\t\tconfirm_recurring: \"繰り返されているイベントを全て編集しますか?\",\r\n\t\tsection_recurring: \"イベントを繰り返す\",\r\n\t\tbutton_recurring: \"無効\",\r\n\t\tbutton_recurring_open: \"有効\",\r\n\t\tfull_day: \"終日\",\r\n\t\tbutton_edit_series: \"シリーズを編集します\",\r\n\t\tbutton_edit_occurrence: \"コピーを編集\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"議題は\",\r\n\t\tdate: \"日付\",\r\n\t\tdescription: \"説明\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"今年\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"議題は\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"グリッド\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"毎日\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"毎週\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"毎月\",\r\n\t\trepeat_radio_year: \"毎年\",\r\n\t\trepeat_radio_day_type: \"毎\",\r\n\t\trepeat_text_day_count: \"日\",\r\n\t\trepeat_radio_day_type2: \"毎営業日\",\r\n\t\trepeat_week: \" 繰り返し毎\",\r\n\t\trepeat_text_week_count: \"週 次の日:\",\r\n\t\trepeat_radio_month_type: \"繰り返し\",\r\n\t\trepeat_radio_month_start: \"オン\",\r\n\t\trepeat_text_month_day: \"日毎\",\r\n\t\trepeat_text_month_count: \"月\",\r\n\t\trepeat_text_month_count2_before: \"毎\",\r\n\t\trepeat_text_month_count2_after: \"月\",\r\n\t\trepeat_year_label: \"オン\",\r\n\t\tselect_year_day2: \"の\",\r\n\t\trepeat_text_year_day: \"日\",\r\n\t\tselect_year_month: \"月\",\r\n\t\trepeat_radio_end: \"終了日なし\",\r\n\t\trepeat_text_occurences_count: \"回数\",\r\n\t\trepeat_radio_end2: \"後\",\r\n\t\trepeat_radio_end3: \"終了日まで\",\r\n\r\n\t\trepeat_never: \"決して\",\r\n\t\trepeat_daily: \"毎日\",\r\n\t\trepeat_workdays: \"毎営業日\",\r\n\t\trepeat_weekly: \"毎週\",\r\n\t\trepeat_monthly: \"毎月\",\r\n\t\trepeat_yearly: \"毎年\",\r\n\t\trepeat_custom: \"カスタム\",\r\n\t\trepeat_freq_day: \"日\",\r\n\t\trepeat_freq_week: \"週\",\r\n\t\trepeat_freq_month: \"月\",\r\n\t\trepeat_freq_year: \"年\",\r\n\t\trepeat_on_date: \"日にち\",\r\n\t\trepeat_ends: \"終了\",\r\n\r\n\t\tmonth_for_recurring: [\"1月\", \"2月\", \"3月\", \"4月\", \"5月\", \"6月\", \"7月\", \"8月\", \"9月\", \"10月\", \"11月\", \"12月\"],\r\n\t\tday_for_recurring: [\"日曜日\", \"月曜日\", \"火曜日\", \"水曜日\", \"木曜日\", \"金曜日\", \"土曜日\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default class LocaleManager{\r\n\tconstructor(config){\r\n\t\tthis._locales = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._locales[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddLocale(name, locale) {\r\n\t\tthis._locales[name] = locale;\r\n\t}\r\n\r\n\tgetLocale(name) {\r\n\t\treturn this._locales[name];\r\n\t}\r\n}","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Mon\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"I dag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny hendelse\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Rediger\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Hendelsen vil bli slettet permanent. Er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du forandre hele dette settet av repeterende hendelser?\",\r\n\t\tsection_recurring: \"Repeter hendelsen\",\r\n\t\tbutton_recurring: \"Av\",\r\n\t\tbutton_recurring_open: \"På\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\",\r\n\t\trepeat_radio_week: \"Ukentlig\",\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Alle hverdager\",\r\n\t\trepeat_week: \" Gjentas hver\",\r\n\t\trepeat_text_week_count: \"uke på:\",\r\n\t\trepeat_radio_month_type: \"På hver\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"på\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomst\",\r\n\t\trepeat_radio_end3: \"Stop den\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Sondag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"mrt\", \"Apr\", \"Mei\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"],\r\n\t\tday_short: [\"Zo\", \"Ma\", \"Di\", \"Wo\", \"Do\", \"Vr\", \"Za\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Vandaag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Week\",\r\n\t\tmonth_tab: \"Maand\",\r\n\t\tnew_event: \"Nieuw item\",\r\n\t\ticon_save: \"Opslaan\",\r\n\t\ticon_cancel: \"Annuleren\",\r\n\t\ticon_details: \"Details\",\r\n\t\ticon_edit: \"Bewerken\",\r\n\t\ticon_delete: \"Verwijderen\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Item zal permanent worden verwijderd, doorgaan?\",\r\n\t\tsection_description: \"Beschrijving\",\r\n\t\tsection_time: \"Tijd periode\",\r\n\t\tfull_day: \"Hele dag\",\r\n\r\n\t\tconfirm_recurring: \"Wilt u alle terugkerende items bijwerken?\",\r\n\t\tsection_recurring: \"Item herhalen\",\r\n\t\tbutton_recurring: \"Uit\",\r\n\t\tbutton_recurring_open: \"Aan\",\r\n\t\tbutton_edit_series: \"Bewerk de serie\",\r\n\t\tbutton_edit_occurrence: \"Bewerk een kopie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Omschrijving\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Jaar\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabel\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagelijks\",\r\n\t\trepeat_radio_week: \"Wekelijks\",\r\n\t\trepeat_radio_month: \"Maandelijks\",\r\n\t\trepeat_radio_year: \"Jaarlijks\",\r\n\t\trepeat_radio_day_type: \"Elke\",\r\n\t\trepeat_text_day_count: \"dag(en)\",\r\n\t\trepeat_radio_day_type2: \"Elke werkdag\",\r\n\t\trepeat_week: \" Herhaal elke\",\r\n\t\trepeat_text_week_count: \"week op de volgende dagen:\",\r\n\t\trepeat_radio_month_type: \"Herhaal\",\r\n\t\trepeat_radio_month_start: \"Op\",\r\n\t\trepeat_text_month_day: \"dag iedere\",\r\n\t\trepeat_text_month_count: \"maanden\",\r\n\t\trepeat_text_month_count2_before: \"iedere\",\r\n\t\trepeat_text_month_count2_after: \"maanden\",\r\n\t\trepeat_year_label: \"Op\",\r\n\t\tselect_year_day2: \"van\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"maand\",\r\n\t\trepeat_radio_end: \"Geen eind datum\",\r\n\t\trepeat_text_occurences_count: \"keren\",\r\n\t\trepeat_radio_end3: \"Eindigd per\",\r\n\t\trepeat_radio_end2: \"Na\",\r\n\r\n\t\trepeat_never: \"Nooit\",\r\n\t\trepeat_daily: \"Elke dag\",\r\n\t\trepeat_workdays: \"Elke werkdag\",\r\n\t\trepeat_weekly: \"Elke week\",\r\n\t\trepeat_monthly: \"Elke maand\",\r\n\t\trepeat_yearly: \"Elk jaar\",\r\n\t\trepeat_custom: \"Aangepast\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Week\",\r\n\t\trepeat_freq_month: \"Maand\",\r\n\t\trepeat_freq_year: \"Jaar\",\r\n\t\trepeat_on_date: \"Op datum\",\r\n\t\trepeat_ends: \"Eindigt\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Maart\", \"April\", \"Mei\", \"Juni\", \"Juli\", \"Augustus\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\"]\r\n\t}\r\n};\r\n\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Des\"],\r\n\t\tday_full: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"],\r\n\t\tday_short: [\"Søn\", \"Man\", \"Tir\", \"Ons\", \"Tor\", \"Fre\", \"Lør\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Uke\",\r\n\t\tmonth_tab: \"Måned\",\r\n\t\tnew_event: \"Ny\",\r\n\t\ticon_save: \"Lagre\",\r\n\t\ticon_cancel: \"Avbryt\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Endre\",\r\n\t\ticon_delete: \"Slett\",\r\n\t\tconfirm_closing: \"Endringer blir ikke lagret, er du sikker?\", //Endringer blir ikke lagret, er du sikker?\r\n\t\tconfirm_deleting: \"Oppføringen vil bli slettet, er du sikker?\",\r\n\t\tsection_description: \"Beskrivelse\",\r\n\t\tsection_time: \"Tidsperiode\",\r\n\t\tfull_day: \"Full dag\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vil du endre hele settet med repeterende oppføringer?\",\r\n\t\tsection_recurring: \"Repeterende oppføring\",\r\n\t\tbutton_recurring: \"Ikke aktiv\",\r\n\t\tbutton_recurring_open: \"Aktiv\",\r\n\t\tbutton_edit_series: \"Rediger serien\",\r\n\t\tbutton_edit_occurrence: \"Redigere en kopi\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Dato\",\r\n\t\tdescription: \"Beskrivelse\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grid\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Daglig\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Ukentlig\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Månedlig\",\r\n\t\trepeat_radio_year: \"Årlig\",\r\n\t\trepeat_radio_day_type: \"Hver\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Hver arbeidsdag\",\r\n\t\trepeat_week: \" Gjenta hver\",\r\n\t\trepeat_text_week_count: \"uke neste dager:\",\r\n\t\trepeat_radio_month_type: \"Gjenta\",\r\n\t\trepeat_radio_month_start: \"På\",\r\n\t\trepeat_text_month_day: \"dag hver\",\r\n\t\trepeat_text_month_count: \"måned\",\r\n\t\trepeat_text_month_count2_before: \"hver\",\r\n\t\trepeat_text_month_count2_after: \"måned\",\r\n\t\trepeat_year_label: \"På\",\r\n\t\tselect_year_day2: \"av\",\r\n\t\trepeat_text_year_day: \"dag\",\r\n\t\tselect_year_month: \"måned\",\r\n\t\trepeat_radio_end: \"Ingen sluttdato\",\r\n\t\trepeat_text_occurences_count: \"forekomster\",\r\n\t\trepeat_radio_end2: \"Etter\",\r\n\t\trepeat_radio_end3: \"Slutt innen\",\r\n\r\n\t\trepeat_never: \"Aldri\",\r\n\t\trepeat_daily: \"Hver dag\",\r\n\t\trepeat_workdays: \"Hver ukedag\",\r\n\t\trepeat_weekly: \"Hver uke\",\r\n\t\trepeat_monthly: \"Hver måned\",\r\n\t\trepeat_yearly: \"Hvert år\",\r\n\t\trepeat_custom: \"Tilpasset\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Uke\",\r\n\t\trepeat_freq_month: \"Måned\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På dato\",\r\n\t\trepeat_ends: \"Slutter\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Mars\", \"April\", \"Mai\", \"Juni\", \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Desember\"],\r\n\t\tday_for_recurring: [\"Søndag\", \"Mandag\", \"Tirsdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lørdag\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Styczeń\", \"Luty\", \"Marzec\", \"Kwiecień\", \"Maj\", \"Czerwiec\", \"Lipiec\", \"Sierpień\", \"Wrzesień\", \"Październik\", \"Listopad\", \"Grudzień\"],\r\n\t\tmonth_short: [\"Sty\", \"Lut\", \"Mar\", \"Kwi\", \"Maj\", \"Cze\", \"Lip\", \"Sie\", \"Wrz\", \"Paź\", \"Lis\", \"Gru\"],\r\n\t\tday_full: [\"Niedziela\", \"Poniedziałek\", \"Wtorek\", \"Środa\", \"Czwartek\", \"Piątek\", \"Sobota\"],\r\n\t\tday_short: [\"Nie\", \"Pon\", \"Wto\", \"Śro\", \"Czw\", \"Pią\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dziś\",\r\n\t\tday_tab: \"Dzień\",\r\n\t\tweek_tab: \"Tydzień\",\r\n\t\tmonth_tab: \"Miesiąc\",\r\n\t\tnew_event: \"Nowe zdarzenie\",\r\n\t\ticon_save: \"Zapisz\",\r\n\t\ticon_cancel: \"Anuluj\",\r\n\t\ticon_details: \"Szczegóły\",\r\n\t\ticon_edit: \"Edytuj\",\r\n\t\ticon_delete: \"Usuń\",\r\n\t\tconfirm_closing: \"\", //Zmiany zostaną usunięte, jesteś pewien?\r\n\t\tconfirm_deleting: \"Zdarzenie zostanie usunięte na zawsze, kontynuować?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Okres czasu\",\r\n\t\tfull_day: \"Cały dzień\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Czy chcesz edytować cały zbiór powtarzających się zdarzeń?\",\r\n\t\tsection_recurring: \"Powtórz zdarzenie\",\r\n\t\tbutton_recurring: \"Nieaktywne\",\r\n\t\tbutton_recurring_open: \"Aktywne\",\r\n\t\tbutton_edit_series: \"Edytuj serię\",\r\n\t\tbutton_edit_occurrence: \"Edytuj kopię\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Agenda\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Tabela\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Codziennie\",\r\n\t\trepeat_radio_week: \"Co tydzie\",\r\n\t\trepeat_radio_month: \"Co miesic\",\r\n\t\trepeat_radio_year: \"Co rok\",\r\n\t\trepeat_radio_day_type: \"Kadego\",\r\n\t\trepeat_text_day_count: \"dnia\",\r\n\t\trepeat_radio_day_type2: \"Kadego dnia roboczego\",\r\n\t\trepeat_week: \" Powtarzaj kadego\",\r\n\t\trepeat_text_week_count: \"tygodnia w dni:\",\r\n\t\trepeat_radio_month_type: \"Powtrz\",\r\n\t\trepeat_radio_month_start: \"W\",\r\n\t\trepeat_text_month_day: \"dnia kadego\",\r\n\t\trepeat_text_month_count: \"miesica\",\r\n\t\trepeat_text_month_count2_before: \"kadego\",\r\n\t\trepeat_text_month_count2_after: \"miesica\",\r\n\t\trepeat_year_label: \"W\",\r\n\t\tselect_year_day2: \"miesica\",\r\n\t\trepeat_text_year_day: \"dnia miesica\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Bez daty kocowej\",\r\n\t\trepeat_text_occurences_count: \"wystpieniu/ach\",\r\n\t\trepeat_radio_end3: \"Zakocz w\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nigdy\",\r\n\t\trepeat_daily: \"Codziennie\",\r\n\t\trepeat_workdays: \"Każdy dzień roboczy\",\r\n\t\trepeat_weekly: \"Co tydzień\",\r\n\t\trepeat_monthly: \"Co miesiąc\",\r\n\t\trepeat_yearly: \"Co rok\",\r\n\t\trepeat_custom: \"Niestandardowy\",\r\n\t\trepeat_freq_day: \"Dzień\",\r\n\t\trepeat_freq_week: \"Tydzień\",\r\n\t\trepeat_freq_month: \"Miesiąc\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"W dniu\",\r\n\t\trepeat_ends: \"Kończy się\",\r\n\r\n\t\tmonth_for_recurring: [\"Stycznia\", \"Lutego\", \"Marca\", \"Kwietnia\", \"Maja\", \"Czerwca\", \"Lipca\", \"Sierpnia\", \"Wrzenia\", \"Padziernka\", \"Listopada\", \"Grudnia\"],\r\n\t\tday_for_recurring: [\"Niedziela\", \"Poniedziaek\", \"Wtorek\", \"roda\", \"Czwartek\", \"Pitek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","/*\r\n\r\n TRANSLATION BY MATTHEUS PIROVANI RORIZ GONЗALVES\r\n\r\n mattheusroriz@hotmail.com / mattheus.pirovani@gmail.com /\r\n\r\n www.atrixian.com.br\r\n\r\n */\r\n\r\nexport default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tmonth_short: [\"Jan\", \"Fev\", \"Mar\", \"Abr\", \"Mai\", \"Jun\", \"Jul\", \"Ago\", \"Set\", \"Out\", \"Nov\", \"Dez\"],\r\n\t\tday_full: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"],\r\n\t\tday_short: [\"Dom\", \"Seg\", \"Ter\", \"Qua\", \"Qui\", \"Sex\", \"Sab\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Hoje\",\r\n\t\tday_tab: \"Dia\",\r\n\t\tweek_tab: \"Semana\",\r\n\t\tmonth_tab: \"Mês\",\r\n\t\tnew_event: \"Novo evento\",\r\n\t\ticon_save: \"Salvar\",\r\n\t\ticon_cancel: \"Cancelar\",\r\n\t\ticon_details: \"Detalhes\",\r\n\t\ticon_edit: \"Editar\",\r\n\t\ticon_delete: \"Deletar\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Tem certeza que deseja excluir?\",\r\n\t\tsection_description: \"Descrição\",\r\n\t\tsection_time: \"Período de tempo\",\r\n\t\tfull_day: \"Dia inteiro\",\r\n\r\n\t\tconfirm_recurring: \"Deseja editar todos esses eventos repetidos?\",\r\n\t\tsection_recurring: \"Repetir evento\",\r\n\t\tbutton_recurring: \"Desabilitar\",\r\n\t\tbutton_recurring_open: \"Habilitar\",\r\n\t\tbutton_edit_series: \"Editar a série\",\r\n\t\tbutton_edit_occurrence: \"Editar uma cópia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dia\",\r\n\t\tdate: \"Data\",\r\n\t\tdescription: \"Descrição\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Ano\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dia\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Grade\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Diário\",\r\n\t\trepeat_radio_week: \"Semanal\",\r\n\t\trepeat_radio_month: \"Mensal\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"Cada\",\r\n\t\trepeat_text_day_count: \"dia(s)\",\r\n\t\trepeat_radio_day_type2: \"Cada trabalho diário\",\r\n\t\trepeat_week: \" Repita cada\",\r\n\t\trepeat_text_week_count: \"semana:\",\r\n\t\trepeat_radio_month_type: \"Repetir\",\r\n\t\trepeat_radio_month_start: \"Em\",\r\n\t\trepeat_text_month_day: \"todo dia\",\r\n\t\trepeat_text_month_count: \"mês\",\r\n\t\trepeat_text_month_count2_before: \"todo\",\r\n\t\trepeat_text_month_count2_after: \"mês\",\r\n\t\trepeat_year_label: \"Em\",\r\n\t\tselect_year_day2: \"of\",\r\n\t\trepeat_text_year_day: \"dia\",\r\n\t\tselect_year_month: \"mês\",\r\n\t\trepeat_radio_end: \"Sem data final\",\r\n\t\trepeat_text_occurences_count: \"ocorrências\",\r\n\t\trepeat_radio_end3: \"Fim\",\r\n\t\trepeat_radio_end2: \"Depois\",\r\n\r\n\t\trepeat_never: \"Nunca\",\r\n\t\trepeat_daily: \"Todos os dias\",\r\n\t\trepeat_workdays: \"Todos os dias úteis\",\r\n\t\trepeat_weekly: \"Toda semana\",\r\n\t\trepeat_monthly: \"Todo mês\",\r\n\t\trepeat_yearly: \"Todo ano\",\r\n\t\trepeat_custom: \"Personalizado\",\r\n\t\trepeat_freq_day: \"Dia\",\r\n\t\trepeat_freq_week: \"Semana\",\r\n\t\trepeat_freq_month: \"Mês\",\r\n\t\trepeat_freq_year: \"Ano\",\r\n\t\trepeat_on_date: \"Na data\",\r\n\t\trepeat_ends: \"Termina\",\r\n\r\n\t\tmonth_for_recurring: [\"Janeiro\", \"Fevereiro\", \"Março\", \"Abril\", \"Maio\", \"Junho\", \"Julho\", \"Agosto\", \"Setembro\", \"Outubro\", \"Novembro\", \"Dezembro\"],\r\n\t\tday_for_recurring: [\"Domingo\", \"Segunda\", \"Terça\", \"Quarta\", \"Quinta\", \"Sexta\", \"Sábado\"]\r\n\t}\r\n};\r\n\r\n\r\n","/*\r\n\tTraducere de Ovidiu Lixandru: http://www.madball.ro\r\n */\r\n\r\nexport default {\r\n\tdate:{\r\n\t\tmonth_full:[\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"November\", \"December\"],\r\n\t\tmonth_short:[\"Ian\", \"Feb\", \"Mar\", \"Apr\", \"Mai\", \"Iun\", \"Iul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\r\n\t\tday_full:[\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"],\r\n\t\tday_short:[\"Du\", \"Lu\", \"Ma\", \"Mi\", \"Jo\", \"Vi\", \"Sa\"]\r\n\t},\r\n\tlabels:{\r\n\t\tdhx_cal_today_button:\"Astazi\",\r\n\t\tday_tab:\"Zi\",\r\n\t\tweek_tab:\"Saptamana\",\r\n\t\tmonth_tab:\"Luna\",\r\n\t\tnew_event:\"Eveniment nou\",\r\n\t\ticon_save:\"Salveaza\",\r\n\t\ticon_cancel:\"Anuleaza\",\r\n\t\ticon_details:\"Detalii\",\r\n\t\ticon_edit:\"Editeaza\",\r\n\t\ticon_delete:\"Sterge\",\r\n\t\tconfirm_closing:\"Schimbarile nu vor fi salvate, esti sigur?\",//Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting:\"Evenimentul va fi sters permanent, esti sigur?\",\r\n\t\tsection_description:\"Descriere\",\r\n\t\tsection_time:\"Interval\",\r\n\t\tfull_day:\"Toata ziua\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring:\"Vrei sa editezi toata seria de evenimente repetate?\",\r\n\t\tsection_recurring:\"Repetare\",\r\n\t\tbutton_recurring:\"Dezactivata\",\r\n\t\tbutton_recurring_open:\"Activata\",\r\n\t\tbutton_edit_series: \"Editeaza serie\",\r\n\t\tbutton_edit_occurrence: \"Editeaza doar intrare\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab:\"Agenda\",\r\n\t\tdate:\"Data\",\r\n\t\tdescription:\"Descriere\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab:\"An\",\r\n\r\n\t\t/* week agenda extension */\r\n\t\tweek_agenda_tab: \"Agenda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Lista\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Zilnic\",\r\n\t\trepeat_radio_week: \"Saptamanal\",\r\n\t\trepeat_radio_month: \"Lunar\",\r\n\t\trepeat_radio_year: \"Anual\",\r\n\t\trepeat_radio_day_type: \"La fiecare\",\r\n\t\trepeat_text_day_count: \"zi(le)\",\r\n\t\trepeat_radio_day_type2: \"Fiecare zi lucratoare\",\r\n\t\trepeat_week: \" Repeta la fiecare\",\r\n\t\trepeat_text_week_count: \"saptamana in urmatoarele zile:\",\r\n\t\trepeat_radio_month_type: \"Repeta in\",\r\n\t\trepeat_radio_month_start: \"In a\",\r\n\t\trepeat_text_month_day: \"zi la fiecare\",\r\n\t\trepeat_text_month_count: \"luni\",\r\n\t\trepeat_text_month_count2_before: \"la fiecare\",\r\n\t\trepeat_text_month_count2_after: \"luni\",\r\n\t\trepeat_year_label: \"In\",\r\n\t\tselect_year_day2: \"a lunii\",\r\n\t\trepeat_text_year_day: \"zi a lunii\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Fara data de sfarsit\",\r\n\t\trepeat_text_occurences_count: \"evenimente\",\r\n\t\trepeat_radio_end3: \"La data\",\r\n\t\trepeat_radio_end2: \"Dupa\",\r\n\r\n\t\trepeat_never: \"Niciodată\",\r\n\t\trepeat_daily: \"În fiecare zi\",\r\n\t\trepeat_workdays: \"În fiecare zi lucrătoare\",\r\n\t\trepeat_weekly: \"În fiecare săptămână\",\r\n\t\trepeat_monthly: \"În fiecare lună\",\r\n\t\trepeat_yearly: \"În fiecare an\",\r\n\t\trepeat_custom: \"Personalizat\",\r\n\t\trepeat_freq_day: \"Zi\",\r\n\t\trepeat_freq_week: \"Săptămână\",\r\n\t\trepeat_freq_month: \"Lună\",\r\n\t\trepeat_freq_year: \"An\",\r\n\t\trepeat_on_date: \"La data\",\r\n\t\trepeat_ends: \"Se termină\",\r\n\r\n\t\tmonth_for_recurring: [\"Ianuarie\", \"Februarie\", \"Martie\", \"Aprilie\", \"Mai\", \"Iunie\", \"Iulie\", \"August\", \"Septembrie\", \"Octombrie\", \"Noiembrie\", \"Decembrie\"],\r\n\t\tday_for_recurring: [\"Duminica\", \"Luni\", \"Marti\", \"Miercuri\", \"Joi\", \"Vineri\", \"Sambata\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Январь\", \"Февраль\", \"Март\", \"Апрель\", \"Maй\", \"Июнь\", \"Июль\", \"Август\", \"Сентябрь\", \"Oктябрь\", \"Ноябрь\", \"Декабрь\"],\r\n\t\tmonth_short: [\"Янв\", \"Фев\", \"Maр\", \"Aпр\", \"Maй\", \"Июн\", \"Июл\", \"Aвг\", \"Сен\", \"Окт\", \"Ноя\", \"Дек\"],\r\n\t\tday_full: [ \"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среда\", \"Четверг\", \"Пятница\", \"Суббота\"],\r\n\t\tday_short: [\"Вс\", \"Пн\", \"Вт\", \"Ср\", \"Чт\", \"Пт\", \"Сб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сегодня\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Неделя\",\r\n\t\tmonth_tab: \"Месяц\",\r\n\t\tnew_event: \"Новое событие\",\r\n\t\ticon_save: \"Сохранить\",\r\n\t\ticon_cancel: \"Отменить\",\r\n\t\ticon_details: \"Детали\",\r\n\t\ticon_edit: \"Изменить\",\r\n\t\ticon_delete: \"Удалить\",\r\n\t\tconfirm_closing: \"\", //Ваши изменения будут потеряны, продолжить?\r\n\t\tconfirm_deleting: \"Событие будет удалено безвозвратно, продолжить?\",\r\n\t\tsection_description: \"Описание\",\r\n\t\tsection_time: \"Период времени\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\tconfirm_recurring: \"Вы хотите изменить всю серию повторяющихся событий?\",\r\n\t\tsection_recurring: \"Повторение\",\r\n\t\tbutton_recurring: \"Отключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редактировать серию\",\r\n\t\tbutton_edit_occurrence: \"Редактировать экземпляр\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Список\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Описание\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Год\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Список\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблица\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Неделя\",\r\n\t\trepeat_radio_month: \"Месяц\",\r\n\t\trepeat_radio_year: \"Год\",\r\n\t\trepeat_radio_day_type: \"Каждый\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Каждый рабочий день\",\r\n\t\trepeat_week: \" Повторять каждую\",\r\n\t\trepeat_text_week_count: \"неделю , в:\",\r\n\t\trepeat_radio_month_type: \"Повторять\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа каждый \",\r\n\t\trepeat_text_month_count: \"месяц\",\r\n\t\trepeat_text_month_count2_before: \"каждый \",\r\n\t\trepeat_text_month_count2_after: \"месяц\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без даты окончания\",\r\n\t\trepeat_text_occurences_count: \"повторений\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Никогда\",\r\n\t\trepeat_daily: \"Каждый день\",\r\n\t\trepeat_workdays: \"Каждый будний день\",\r\n\t\trepeat_weekly: \"Каждую неделю\",\r\n\t\trepeat_monthly: \"Каждый месяц\",\r\n\t\trepeat_yearly: \"Каждый год\",\r\n\t\trepeat_custom: \"Настроить\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Неделя\",\r\n\t\trepeat_freq_month: \"Месяц\",\r\n\t\trepeat_freq_year: \"Год\",\r\n\t\trepeat_on_date: \"В дату\",\r\n\t\trepeat_ends: \"Заканчивается\",\r\n\r\n\t\tmonth_for_recurring: [\"Января\", \"Февраля\", \"Марта\", \"Апреля\", \"Мая\", \"Июня\", \"Июля\", \"Августа\", \"Сентября\", \"Октября\", \"Ноября\", \"Декабря\"],\r\n\t\tday_for_recurring: [\"Воскресенье\", \"Понедельник\", \"Вторник\", \"Среду\", \"Четверг\", \"Пятницу\", \"Субботу\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"],\r\n\t\tday_short: [\"Ned\", \"Pon\", \"Tor\", \"Sre\", \"Čet\", \"Pet\", \"Sob\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Danes\",\r\n\t\tday_tab: \"Dan\",\r\n\t\tweek_tab: \"Teden\",\r\n\t\tmonth_tab: \"Mesec\",\r\n\t\tnew_event: \"Nov dogodek\",\r\n\t\ticon_save: \"Shrani\",\r\n\t\ticon_cancel: \"Prekliči\",\r\n\t\ticon_details: \"Podrobnosti\",\r\n\t\ticon_edit: \"Uredi\",\r\n\t\ticon_delete: \"Izbriši\",\r\n\t\tconfirm_closing: \"\", //Spremembe ne bodo shranjene. Želite nadaljevati ?\r\n\t\tconfirm_deleting: \"Dogodek bo izbrisan. Želite nadaljevati?\",\r\n\t\tsection_description: \"Opis\",\r\n\t\tsection_time: \"Časovni okvir\",\r\n\t\tfull_day: \"Ves dan\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Želite urediti celoten set ponavljajočih dogodkov?\",\r\n\t\tsection_recurring: \"Ponovi dogodek\",\r\n\t\tbutton_recurring: \"Onemogočeno\",\r\n\t\tbutton_recurring_open: \"Omogočeno\",\r\n\t\tbutton_edit_series: \"Edit series\",\r\n\t\tbutton_edit_occurrence: \"Edit occurrence\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Zadeva\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Opis\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Leto\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Zadeva\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Miza\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dnevno\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Tedensko\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Mesečno\",\r\n\t\trepeat_radio_year: \"Letno\",\r\n\t\trepeat_radio_day_type: \"Vsak\",\r\n\t\trepeat_text_day_count: \"dan\",\r\n\t\trepeat_radio_day_type2: \"Vsak delovni dan\",\r\n\t\trepeat_week: \" Ponavljaj vsak\",\r\n\t\trepeat_text_week_count: \"teden na naslednje dni:\",\r\n\t\trepeat_radio_month_type: \"Ponavljaj\",\r\n\t\trepeat_radio_month_start: \"Na\",\r\n\t\trepeat_text_month_day: \"dan vsak\",\r\n\t\trepeat_text_month_count: \"mesec\",\r\n\t\trepeat_text_month_count2_before: \"vsak\",\r\n\t\trepeat_text_month_count2_after: \"mesec\",\r\n\t\trepeat_year_label: \"Na\",\r\n\t\tselect_year_day2: \"od\",\r\n\t\trepeat_text_year_day: \"dan\",\r\n\t\tselect_year_month: \"mesec\",\r\n\t\trepeat_radio_end: \"Brez končnega datuma\",\r\n\t\trepeat_text_occurences_count: \"pojavitve\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\t\trepeat_radio_end3: \"Končaj do\",\r\n\r\n\t\trepeat_never: \"Nikoli\",\r\n\t\trepeat_daily: \"Vsak dan\",\r\n\t\trepeat_workdays: \"Vsak delovni dan\",\r\n\t\trepeat_weekly: \"Vsak teden\",\r\n\t\trepeat_monthly: \"Vsak mesec\",\r\n\t\trepeat_yearly: \"Vsako leto\",\r\n\t\trepeat_custom: \"Po meri\",\r\n\t\trepeat_freq_day: \"Dan\",\r\n\t\trepeat_freq_week: \"Teden\",\r\n\t\trepeat_freq_month: \"Mesec\",\r\n\t\trepeat_freq_year: \"Leto\",\r\n\t\trepeat_on_date: \"Na datum\",\r\n\t\trepeat_ends: \"Konča se\",\r\n\r\n\t\tmonth_for_recurring: [\"Januar\", \"Februar\", \"Marec\", \"April\", \"Maj\", \"Junij\", \"Julij\", \"Avgust\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nedelja\", \"Ponedeljek\", \"Torek\", \"Sreda\", \"Četrtek\", \"Petek\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Máj\", \"Jún\", \"Júl\", \"Aug\", \"Sept\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Nedeľa\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"],\r\n\t\tday_short: [\"Ne\", \"Po\", \"Ut\", \"St\", \"Št\", \"Pi\", \"So\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Dnes\",\r\n\t\tday_tab: \"Deň\",\r\n\t\tweek_tab: \"Týždeň\",\r\n\t\tmonth_tab: \"Mesiac\",\r\n\t\tnew_event: \"Nová udalosť\",\r\n\t\ticon_save: \"Uložiť\",\r\n\t\ticon_cancel: \"Späť\",\r\n\t\ticon_details: \"Detail\",\r\n\t\ticon_edit: \"Edituj\",\r\n\t\ticon_delete: \"Zmazať\",\r\n\t\tconfirm_closing: \"Vaše zmeny nebudú uložené. Skutočne?\", //Vaše změny budou ztraceny, opravdu ?\r\n\t\tconfirm_deleting: \"Udalosť bude natrvalo vymazaná. Skutočne?\",\r\n\t\tsection_description: \"Poznámky\",\r\n\t\tsection_time: \"Doba platnosti\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Prajete si upraviť celú radu opakovaných udalostí?\",\r\n\t\tsection_recurring: \"Opakovanie udalosti\",\r\n\t\tbutton_recurring: \"Vypnuté\",\r\n\t\tbutton_recurring_open: \"Zapnuté\",\r\n\t\tbutton_edit_series: \"Upraviť opakovania\",\r\n\t\tbutton_edit_occurrence: \"Upraviť inštancie\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Program\",\r\n\t\tdate: \"Dátum\",\r\n\t\tdescription: \"Poznámka\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Rok\",\r\n\t\tfull_day: \"Celý deň\", // Full day\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Program\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Mriežka\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Denne\",\r\n\t\trepeat_radio_week: \"Týždenne\",\r\n\t\trepeat_radio_month: \"Mesaène\",\r\n\t\trepeat_radio_year: \"Roène\",\r\n\t\trepeat_radio_day_type: \"Každý\",\r\n\t\trepeat_text_day_count: \"deò\",\r\n\t\trepeat_radio_day_type2: \"Každý prac. deò\",\r\n\t\trepeat_week: \"Opakova každý\",\r\n\t\trepeat_text_week_count: \"týždeò v dòoch:\",\r\n\t\trepeat_radio_month_type: \"Opakova\",\r\n\t\trepeat_radio_month_start: \"On\",\r\n\t\trepeat_text_month_day: \"deò každý\",\r\n\t\trepeat_text_month_count: \"mesiac\",\r\n\t\trepeat_text_month_count2_before: \"každý\",\r\n\t\trepeat_text_month_count2_after: \"mesiac\",\r\n\t\trepeat_year_label: \"On\",\r\n\t\tselect_year_day2: \"poèas\",\r\n\t\trepeat_text_year_day: \"deò\",\r\n\t\tselect_year_month: \"mesiac\",\r\n\t\trepeat_radio_end: \"Bez dátumu ukonèenia\",\r\n\t\trepeat_text_occurences_count: \"udalostiach\",\r\n\t\trepeat_radio_end3: \"Ukonèi\",\r\n\t\trepeat_radio_end2: \"Po\",\r\n\r\n\t\trepeat_never: \"Nikdy\",\r\n\t\trepeat_daily: \"Každý deň\",\r\n\t\trepeat_workdays: \"Každý pracovný deň\",\r\n\t\trepeat_weekly: \"Každý týždeň\",\r\n\t\trepeat_monthly: \"Každý mesiac\",\r\n\t\trepeat_yearly: \"Každý rok\",\r\n\t\trepeat_custom: \"Vlastné\",\r\n\t\trepeat_freq_day: \"Deň\",\r\n\t\trepeat_freq_week: \"Týždeň\",\r\n\t\trepeat_freq_month: \"Mesiac\",\r\n\t\trepeat_freq_year: \"Rok\",\r\n\t\trepeat_on_date: \"Na dátum\",\r\n\t\trepeat_ends: \"Koniec\",\r\n\r\n\t\tmonth_for_recurring: [\"Január\", \"Február\", \"Marec\", \"Apríl\", \"Máj\", \"Jún\", \"Júl\", \"August\", \"September\", \"Október\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Nede¾a\", \"Pondelok\", \"Utorok\", \"Streda\", \"Štvrtok\", \"Piatok\", \"Sobota\"]\r\n\t}\r\n};\r\n\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tmonth_short: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"Maj\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Okt\", \"Nov\", \"Dec\"],\r\n\t\tday_full: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"],\r\n\t\tday_short: [\"Sön\", \"Mån\", \"Tis\", \"Ons\", \"Tor\", \"Fre\", \"Lör\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Idag\",\r\n\t\tday_tab: \"Dag\",\r\n\t\tweek_tab: \"Vecka\",\r\n\t\tmonth_tab: \"Månad\",\r\n\t\tnew_event: \"Ny händelse\",\r\n\t\ticon_save: \"Spara\",\r\n\t\ticon_cancel: \"Ångra\",\r\n\t\ticon_details: \"Detaljer\",\r\n\t\ticon_edit: \"Ändra\",\r\n\t\ticon_delete: \"Ta bort\",\r\n\t\tconfirm_closing: \"\", //Dina förändingar kommer gå förlorade, är du säker?\r\n\t\tconfirm_deleting: \"Är du säker på att du vill ta bort händelsen permanent?\",\r\n\t\tsection_description: \"Beskrivning\",\r\n\t\tsection_time: \"Tid\",\r\n\t\tfull_day: \"Hela dagen\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Vill du redigera hela serien med repeterande händelser?\",\r\n\t\tsection_recurring: \"Upprepa händelse\",\r\n\t\tbutton_recurring: \"Inaktiverat\",\r\n\t\tbutton_recurring_open: \"Aktiverat\",\r\n\t\tbutton_edit_series: \"Redigera serien\",\r\n\t\tbutton_edit_occurrence: \"Redigera en kopia\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Dagordning\",\r\n\t\tdate: \"Datum\",\r\n\t\tdescription: \"Beskrivning\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"År\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Dagordning\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Galler\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Dra för att skapa ny\",\r\n\t\tdrag_to_move:\"Dra för att flytta\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Dagligen\",\r\n\t\trepeat_radio_week: \"Veckovis\",\r\n\t\trepeat_radio_month: \"Månadsvis\",\r\n\t\trepeat_radio_year: \"Årligen\",\r\n\t\trepeat_radio_day_type: \"Var\",\r\n\t\trepeat_text_day_count: \"dag\",\r\n\t\trepeat_radio_day_type2: \"Varje arbetsdag\",\r\n\t\trepeat_week: \" Upprepa var\",\r\n\t\trepeat_text_week_count: \"vecka dessa dagar:\",\r\n\t\trepeat_radio_month_type: \"Upprepa\",\r\n\t\trepeat_radio_month_start: \"Den\",\r\n\t\trepeat_text_month_day: \"dagen var\",\r\n\t\trepeat_text_month_count: \"månad\",\r\n\t\trepeat_text_month_count2_before: \"var\",\r\n\t\trepeat_text_month_count2_after: \"månad\",\r\n\t\trepeat_year_label: \"Den\",\r\n\t\tselect_year_day2: \"i\",\r\n\t\trepeat_text_year_day: \"dag i\",\r\n\t\tselect_year_month: \"månad\",\r\n\t\trepeat_radio_end: \"Inget slutdatum\",\r\n\t\trepeat_text_occurences_count: \"upprepningar\",\r\n\t\trepeat_radio_end3: \"Sluta efter\",\r\n\t\trepeat_radio_end2: \"Efter\",\r\n\r\n\t\trepeat_never: \"Aldrig\",\r\n\t\trepeat_daily: \"Varje dag\",\r\n\t\trepeat_workdays: \"Varje vardag\",\r\n\t\trepeat_weekly: \"Varje vecka\",\r\n\t\trepeat_monthly: \"Varje månad\",\r\n\t\trepeat_yearly: \"Varje år\",\r\n\t\trepeat_custom: \"Anpassad\",\r\n\t\trepeat_freq_day: \"Dag\",\r\n\t\trepeat_freq_week: \"Vecka\",\r\n\t\trepeat_freq_month: \"Månad\",\r\n\t\trepeat_freq_year: \"År\",\r\n\t\trepeat_on_date: \"På datum\",\r\n\t\trepeat_ends: \"Slutar\",\r\n\r\n\t\tmonth_for_recurring: [\"Januari\", \"Februari\", \"Mars\", \"April\", \"Maj\", \"Juni\", \"Juli\", \"Augusti\", \"September\", \"Oktober\", \"November\", \"December\"],\r\n\t\tday_for_recurring: [\"Söndag\", \"Måndag\", \"Tisdag\", \"Onsdag\", \"Torsdag\", \"Fredag\", \"Lördag\"]\r\n\t}\r\n};\r\n","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Ocak\", \"Þubat\", \"Mart\", \"Nisan\", \"Mayýs\", \"Haziran\", \"Temmuz\", \"Aðustos\", \"Eylül\", \"Ekim\", \"Kasým\", \"Aralýk\"],\r\n\t\tmonth_short: [\"Oca\", \"Þub\", \"Mar\", \"Nis\", \"May\", \"Haz\", \"Tem\", \"Aðu\", \"Eyl\", \"Eki\", \"Kas\", \"Ara\"],\r\n\t\tday_full: [\"Pazar\", \"Pazartes,\", \"Salý\", \"Çarþamba\", \"Perþembe\", \"Cuma\", \"Cumartesi\"],\r\n\t\tday_short: [\"Paz\", \"Pts\", \"Sal\", \"Çar\", \"Per\", \"Cum\", \"Cts\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Bugün\",\r\n\t\tday_tab: \"Gün\",\r\n\t\tweek_tab: \"Hafta\",\r\n\t\tmonth_tab: \"Ay\",\r\n\t\tnew_event: \"Uygun\",\r\n\t\ticon_save: \"Kaydet\",\r\n\t\ticon_cancel: \"Ýptal\",\r\n\t\ticon_details: \"Detaylar\",\r\n\t\ticon_edit: \"Düzenle\",\r\n\t\ticon_delete: \"Sil\",\r\n\t\tconfirm_closing: \"\", //Your changes will be lost, are your sure ?\r\n\t\tconfirm_deleting: \"Etkinlik silinecek, devam?\",\r\n\t\tsection_description: \"Açýklama\",\r\n\t\tsection_time: \"Zaman aralýðý\",\r\n\t\tfull_day: \"Tam gün\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Tüm tekrar eden etkinlikler silinecek, devam?\",\r\n\t\tsection_recurring: \"Etkinliði tekrarla\",\r\n\t\tbutton_recurring: \"Pasif\",\r\n\t\tbutton_recurring_open: \"Aktif\",\r\n\t\tbutton_edit_series: \"Dizi düzenleme\",\r\n\t\tbutton_edit_occurrence: \"Bir kopyasını düzenleyin\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Ajanda\",\r\n\t\tdate: \"Tarih\",\r\n\t\tdescription: \"Açýklama\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Yýl\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Ajanda\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Izgara\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"Günlük\", //name=\"repeat\" value=\"day\"\r\n\t\trepeat_radio_week: \"Haftalık\", //name=\"repeat\" value=\"week\r\n\t\trepeat_radio_month: \"Aylık\",\r\n\t\trepeat_radio_year: \"Yıllık\",\r\n\t\trepeat_radio_day_type: \"Her\",\r\n\t\trepeat_text_day_count: \"gün\",\r\n\t\trepeat_radio_day_type2: \"Her iş günü\",\r\n\t\trepeat_week: \" Tekrar her\",\r\n\t\trepeat_text_week_count: \"hafta şu günlerde:\",\r\n\t\trepeat_radio_month_type: \"Tekrar et\",\r\n\t\trepeat_radio_month_start: \"Tarihinde\",\r\n\t\trepeat_text_month_day: \"gün her\",\r\n\t\trepeat_text_month_count: \"ay\",\r\n\t\trepeat_text_month_count2_before: \"her\",\r\n\t\trepeat_text_month_count2_after: \"ay\",\r\n\t\trepeat_year_label: \"Tarihinde\",\r\n\t\tselect_year_day2: \"ayın\",\r\n\t\trepeat_text_year_day: \"günü\",\r\n\t\tselect_year_month: \"ay\",\r\n\t\trepeat_radio_end: \"Bitiş tarihi yok\",\r\n\t\trepeat_text_occurences_count: \"olay\",\r\n\t\trepeat_radio_end2: \"Sonra\",\r\n\t\trepeat_radio_end3: \"Tarihinde bitir\",\r\n\r\n\t\trepeat_never: \"Asla\",\r\n\t\trepeat_daily: \"Her gün\",\r\n\t\trepeat_workdays: \"Her iş günü\",\r\n\t\trepeat_weekly: \"Her hafta\",\r\n\t\trepeat_monthly: \"Her ay\",\r\n\t\trepeat_yearly: \"Her yıl\",\r\n\t\trepeat_custom: \"Özel\",\r\n\t\trepeat_freq_day: \"Gün\",\r\n\t\trepeat_freq_week: \"Hafta\",\r\n\t\trepeat_freq_month: \"Ay\",\r\n\t\trepeat_freq_year: \"Yıl\",\r\n\t\trepeat_on_date: \"Tarihinde\",\r\n\t\trepeat_ends: \"Biter\",\r\n\r\n\t\tmonth_for_recurring: [\"Ocak\", \"Şubat\", \"Mart\", \"Nisan\", \"Mayıs\", \"Haziran\", \"Temmuz\", \"Ağustos\", \"Eylül\", \"Ekim\", \"Kasım\", \"Aralık\"],\r\n\t\tday_for_recurring: [\"Pazar\", \"Pazartesi\", \"Salı\", \"Çarşamba\", \"Perşembe\", \"Cuma\", \"Cumartesi\"]\r\n\t}\r\n};","export default {\r\n\tdate: {\r\n\t\tmonth_full: [\"Січень\", \"Лютий\", \"Березень\", \"Квітень\", \"Травень\", \"Червень\", \"Липень\", \"Серпень\", \"Вересень\", \"Жовтень\", \"Листопад\", \"Грудень\"],\r\n\t\tmonth_short: [\"Січ\", \"Лют\", \"Бер\", \"Кві\", \"Тра\", \"Чер\", \"Лип\", \"Сер\", \"Вер\", \"Жов\", \"Лис\", \"Гру\"],\r\n\t\tday_full: [\"Неділя\", \"Понеділок\", \"Вівторок\", \"Середа\", \"Четвер\", \"П'ятниця\", \"Субота\"],\r\n\t\tday_short: [\"Нед\", \"Пон\", \"Вів\", \"Сер\", \"Чет\", \"Птн\", \"Суб\"]\r\n\t},\r\n\tlabels: {\r\n\t\tdhx_cal_today_button: \"Сьогодні\",\r\n\t\tday_tab: \"День\",\r\n\t\tweek_tab: \"Тиждень\",\r\n\t\tmonth_tab: \"Місяць\",\r\n\t\tnew_event: \"Нова подія\",\r\n\t\ticon_save: \"Зберегти\",\r\n\t\ticon_cancel: \"Відміна\",\r\n\t\ticon_details: \"Деталі\",\r\n\t\ticon_edit: \"Редагувати\",\r\n\t\ticon_delete: \"Вилучити\",\r\n\t\tconfirm_closing: \"\", //Ваші зміни втратяться. Ви впевнені ?\r\n\t\tconfirm_deleting: \"Подія вилучиться назавжди. Ви впевнені?\",\r\n\t\tsection_description: \"Опис\",\r\n\t\tsection_time: \"Часовий проміжок\",\r\n\t\tfull_day: \"Весь день\",\r\n\r\n\t\t/*recurring events*/\r\n\t\tconfirm_recurring: \"Хочете редагувати весь перелік повторюваних подій?\",\r\n\t\tsection_recurring: \"Повторювана подія\",\r\n\t\tbutton_recurring: \"Відключено\",\r\n\t\tbutton_recurring_open: \"Включено\",\r\n\t\tbutton_edit_series: \"Редагувати серію\",\r\n\t\tbutton_edit_occurrence: \"Редагувати примірник\",\r\n\r\n\t\t/*agenda view extension*/\r\n\t\tagenda_tab: \"Перелік\",\r\n\t\tdate: \"Дата\",\r\n\t\tdescription: \"Опис\",\r\n\r\n\t\t/*year view extension*/\r\n\t\tyear_tab: \"Рік\",\r\n\r\n\t\t/*week agenda view extension*/\r\n\t\tweek_agenda_tab: \"Перелік\",\r\n\r\n\t\t/*grid view extension*/\r\n\t\tgrid_tab: \"Таблиця\",\r\n\r\n\t\t/* touch tooltip*/\r\n\t\tdrag_to_create:\"Drag to create\",\r\n\t\tdrag_to_move:\"Drag to move\",\r\n\r\n\t\t/* dhtmlx message default buttons */\r\n\t\tmessage_ok:\"OK\",\r\n\t\tmessage_cancel:\"Cancel\",\r\n\r\n\t\t/* wai aria labels for non-text controls */\r\n\t\tnext: \"Next\",\r\n\t\tprev: \"Previous\",\r\n\t\tyear: \"Year\",\r\n\t\tmonth: \"Month\",\r\n\t\tday: \"Day\",\r\n\t\thour:\"Hour\",\r\n\t\tminute: \"Minute\",\r\n\r\n\t\t/* recurring event components */\r\n\t\trepeat_radio_day: \"День\",\r\n\t\trepeat_radio_week: \"Тиждень\",\r\n\t\trepeat_radio_month: \"Місяць\",\r\n\t\trepeat_radio_year: \"Рік\",\r\n\t\trepeat_radio_day_type: \"Кожний\",\r\n\t\trepeat_text_day_count: \"день\",\r\n\t\trepeat_radio_day_type2: \"Кожний робочий день\",\r\n\t\trepeat_week: \" Повторювати кожен\",\r\n\t\trepeat_text_week_count: \"тиждень , по:\",\r\n\t\trepeat_radio_month_type: \"Повторювати\",\r\n\t\trepeat_radio_month_start: \"\",\r\n\t\trepeat_text_month_day: \" числа кожний \",\r\n\t\trepeat_text_month_count: \"місяць\",\r\n\t\trepeat_text_month_count2_before: \"кожен \",\r\n\t\trepeat_text_month_count2_after: \"місяць\",\r\n\t\trepeat_year_label: \"\",\r\n\t\tselect_year_day2: \"\",\r\n\t\trepeat_text_year_day: \"день\",\r\n\t\tselect_year_month: \"\",\r\n\t\trepeat_radio_end: \"Без дати закінчення\",\r\n\t\trepeat_text_occurences_count: \"повторень\",\r\n\t\trepeat_radio_end3: \"До \",\r\n\t\trepeat_radio_end2: \"\",\r\n\r\n\t\trepeat_never: \"Ніколи\",\r\n\t\trepeat_daily: \"Щодня\",\r\n\t\trepeat_workdays: \"Щодня в робочі дні\",\r\n\t\trepeat_weekly: \"Щотижня\",\r\n\t\trepeat_monthly: \"Щомісяця\",\r\n\t\trepeat_yearly: \"Щороку\",\r\n\t\trepeat_custom: \"Налаштоване\",\r\n\t\trepeat_freq_day: \"День\",\r\n\t\trepeat_freq_week: \"Тиждень\",\r\n\t\trepeat_freq_month: \"Місяць\",\r\n\t\trepeat_freq_year: \"Рік\",\r\n\t\trepeat_on_date: \"На дату\",\r\n\t\trepeat_ends: \"Закінчується\",\r\n\r\n\t\tmonth_for_recurring: [\"січня\", \"лютого\", \"березня\", \"квітня\", \"травня\", \"червня\", \"липня\", \"серпня\", \"вересня\", \"жовтня\", \"листопада\", \"грудня\"],\r\n\t\tday_for_recurring: [\"Неділям\", \"Понеділкам\", \"Вівторкам\", \"Середам\", \"Четвергам\", \"П'ятницям\", \"Суботам\"]\r\n\t}\r\n};\r\n","import eventable from \"../utils/eventable\";\r\n\r\nexport class DatePicker {\r\n\tconstructor(scheduler, container, state = {}) {\r\n\t\tthis.state = {\r\n\t\t\tdate: new Date(),\r\n\t\t\tmodes: ['days', 'months', 'years'],\r\n\t\t\tcurrentRange: [],\r\n\t\t\teventDates: [],\r\n\t\t\tfilterDays: null,\r\n\t\t\tcurrentModeIndex: 0,\r\n\t\t\t...state\r\n\t\t};\r\n\t\tthis.container = null;\r\n\t\tthis.element = null;\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis.state = this.getState();\r\n\t\teventable(this);\r\n\t\tif(container){\r\n\r\n\t\t\tthis.container = container;\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\r\n\t\tthis.onStateChange((oldState, newState) => {\r\n\t\t\tthis.callEvent(\"onStateChange\", [newState, oldState]);\r\n\t\t});\r\n\t}\r\n\r\n\tgetState() {\r\n\t\treturn { \r\n\t\t\t...this.state,\r\n\t\t\tmode: this.state.modes[this.state.currentModeIndex]\r\n\t\t};\r\n\t}\r\n\r\n\tsetState(newState) {\r\n\t\tconst oldState = { ...this.state };\r\n\t\tif(newState.mode){\r\n\t\t\tnewState.currentModeIndex = this.state.modes.indexOf(newState.mode);\r\n\t\t}\r\n\t\tthis.state = { ...this.state, ...newState };\r\n\r\n\t\tthis._notifyStateChange(oldState, this.state);\r\n\r\n\t\tif (this.container) {\r\n\t\t\tthis.render(this.container);\r\n\t\t}\r\n\t}\r\n\r\n\tonStateChange(handler) {\r\n\t\tthis.onStateChangeHandlers.push(handler);\r\n\r\n\t\t// function to remove the handler\r\n\t\treturn () => {\r\n\t\t\tconst index = this.onStateChangeHandlers.indexOf(handler);\r\n\t\t\tif (index !== -1) {\r\n\t\t\t\tthis.onStateChangeHandlers.splice(index, 1);\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\r\n\t_notifyStateChange(oldState, newState) {\r\n\t\tthis.onStateChangeHandlers.forEach(handler => handler(oldState, newState));\r\n\t}\r\n\r\n\t_adjustDate(direction) {\r\n\r\n\t\tconst {mode, date} = this.getState();\r\n\t\tconst newDate = new Date(date);\r\n\t\tif (mode === 'days') {\r\n\t\t\tnewDate.setMonth(date.getMonth() + direction);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction);\r\n\t\t} else {\r\n\t\t\tnewDate.setFullYear(date.getFullYear() + direction * 10);\r\n\t\t}\r\n\t\tthis.setState({ date: newDate });\r\n\t}\r\n\r\n\t_toggleMode() {\r\n\t\tconst newIndex = (this.state.currentModeIndex + 1) % this.state.modes.length;\r\n\t\tthis.setState({ currentModeIndex: newIndex });\r\n\t}\r\n\r\n\t_renderCalendarHeader(container) {\r\n\t\tconst {mode, date} = this.getState();\r\n\r\n\t\tconst header = document.createElement('div');\r\n\t\theader.classList.add('dhx_cal_datepicker_header');\r\n\r\n\t\tconst backwardArrow = document.createElement('button');\r\n\r\n\t\tbackwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_left\");\r\n\t\theader.appendChild(backwardArrow);\r\n\r\n\t\tconst monthLabel = document.createElement('div');\r\n\t\tmonthLabel.classList.add('dhx_cal_datepicker_title');\r\n\r\n\t\tif (mode === 'days') {\r\n\t\t\tmonthLabel.innerText = date.toLocaleString('default', { month: 'long' }) + ' ' + date.getFullYear();\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tmonthLabel.innerText = date.getFullYear();\r\n\t\t} else {\r\n\t\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\tmonthLabel.innerText = `${startYear} - ${startYear + 9}`;\r\n\t\t}\r\n\r\n\t\tthis._domEvents.attach(monthLabel, \"click\", this._toggleMode.bind(this));\r\n\t\theader.appendChild(monthLabel);\r\n\r\n\t\tconst forwardArrow = document.createElement('button');\r\n\r\n\t\tforwardArrow.classList.add(\"dhx_cal_datepicker_arrow\", \"scheduler_icon\", \"arrow_right\");\r\n\t\theader.appendChild(forwardArrow);\r\n\r\n\t\tcontainer.appendChild(header);\r\n\r\n\t\tthis._domEvents.attach(backwardArrow, \"click\", this._adjustDate.bind(this, -1));\r\n\t\tthis._domEvents.attach(forwardArrow, \"click\", this._adjustDate.bind(this, 1));\r\n\t}\r\n\r\n\trender(container) {\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.container = container || this.container; \r\n\t\tthis.container.innerHTML = '';\r\n\r\n\t\tif(!this.element){\r\n\t\t\tthis.element = document.createElement(\"div\");\r\n\t\t\tthis.element.classList.add(\"dhx_cal_datepicker\");\r\n\t\t}\r\n\t\tthis.element.innerHTML = '';\r\n\t\tthis.container.appendChild(this.element);\r\n\r\n\t\tthis._renderCalendarHeader(this.element);\r\n\t\tconst dataContainer = document.createElement(\"div\");\r\n\t\tdataContainer.classList.add(\"dhx_cal_datepicker_data\");\r\n\t\tthis.element.appendChild(dataContainer);\r\n\r\n\t\tconst {mode} = this.getState();\r\n\t\tif (mode === 'days') {\r\n\t\t\tthis._renderDayGrid(dataContainer);\r\n\t\t} else if (mode === 'months') {\r\n\t\t\tthis._renderMonthGrid(dataContainer);\r\n\t\t} else {\r\n\t\t\tthis._renderYearGrid(dataContainer);\r\n\t\t}\r\n\t}\r\n\r\n\t_renderDayGridHeader(daysOfWeekContainer) {\r\n\t\tconst {date, filterDays} = this.getState();\r\n\t\tconst scheduler = this.scheduler;\r\n\r\n\t\tlet currentDate = scheduler.date.week_start(new Date(date));\r\n\t\tconst maxDate = scheduler.date.add(scheduler.date.week_start(new Date(date)), 1, 'week');\r\n\r\n\t\tdaysOfWeekContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tconst labelFormat = scheduler.date.date_to_str(\"%D\");\r\n\r\n\t\twhile (currentDate.valueOf() < maxDate.valueOf()) {\r\n\t\t\tif(!(filterDays && filterDays(currentDate))){\r\n\t\t\t\tconst label = labelFormat(currentDate);\r\n\r\n\t\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\t\tdayElement.setAttribute(\"data-day\", currentDate.getDay());\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_dayname');\r\n\t\t\t\tdayElement.innerText = label;\r\n\t\t\t\tdaysOfWeekContainer.appendChild(dayElement);\r\n\t\t\t}\r\n\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, 'day');\r\n\t\t}\r\n\t}\r\n\r\n\t_weeksBetween(min, max) {\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tlet weeks = 0;\r\n\t\tlet currWeek = new Date(min);\r\n\t\twhile(currWeek.valueOf() < max.valueOf()){\r\n\t\t\tweeks += 1;\r\n\t\t\tcurrWeek = scheduler.date.week_start(scheduler.date.add(currWeek, 1, \"week\"));\r\n\t\t}\r\n\t\treturn weeks;\r\n\t}\r\n\r\n\t_renderDayGrid(container) {\r\n\t\tconst {date, currentRange, eventDates, minWeeks, filterDays} = this.getState();\r\n\r\n\t\tlet minSchedulerDate = currentRange[0];\r\n\t\tlet maxSchedulerDate = currentRange[1];\r\n\r\n\t\tconst eventDaysTable = eventDates.reduce((acc, date) => {\r\n\t\t\tconst dayStart = this.scheduler.date.day_start(new Date(date));\r\n\t\t\tacc[dayStart.valueOf()] = true;\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\r\n\t\t// Render Days of the Week\r\n\t\tconst daysOfWeekContainer = document.createElement('div');\r\n\t\tthis._renderDayGridHeader(daysOfWeekContainer);\r\n\t\tconst weekLength = daysOfWeekContainer.children.length;\r\n\t\tcontainer.appendChild(daysOfWeekContainer);\r\n\t\tif(weekLength !== 7){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-week-length\", weekLength);\r\n\t\t}\r\n\r\n\t\tconst scheduler = this.scheduler;\r\n\t\tconst firstDate = scheduler.date.week_start(scheduler.date.month_start(new Date(date)));\r\n\t\tconst monthStart = scheduler.date.month_start(new Date(date));\r\n\t\tconst monthEnd = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tlet lastDate = scheduler.date.add(scheduler.date.month_start(new Date(date)), 1, 'month');\r\n\t\tconst currentCalDate = scheduler.date.date_part(scheduler._currentDate());\r\n\t\tif(lastDate.getDay() !== 0){\r\n\t\t\tlastDate = scheduler.date.add(scheduler.date.week_start(lastDate), 1, \"week\");\r\n\t\t}\r\n\r\n\t\tlet weeks = this._weeksBetween(firstDate, lastDate);\r\n\t\tif(minWeeks && weeks < minWeeks){\r\n\t\t\tlastDate = scheduler.date.add(lastDate, (minWeeks - weeks), \"week\");\r\n\t\t}\r\n\r\n\t\tlet currDate = firstDate;\r\n\r\n\t\tconst dayGridContainer = document.createElement('div');\r\n\t\tdayGridContainer.classList.add('dhx_cal_datepicker_days');\r\n\r\n\t\tthis._domEvents.attach(dayGridContainer, \"click\", (event) => {\r\n\t\t\tconst dateCell = event.target.closest(\"[data-cell-date]\");\r\n\t\t\tconst date = new Date(dateCell.getAttribute(\"data-cell-date\"));\r\n\t\t\tthis.callEvent(\"onDateClick\", [date, event]);\r\n\t\t});\r\n\r\n\t\twhile(currDate.valueOf() < lastDate.valueOf()){\r\n\t\t\tif(!(filterDays && filterDays(currDate))){\r\n\r\n\t\t\t\tconst dayElement = document.createElement('div');\r\n\t\t\t\tdayElement.setAttribute(\"data-cell-date\", scheduler.templates.format_date(currDate));\r\n\t\t\t\tdayElement.setAttribute(\"data-day\", currDate.getDay());\r\n\t\t\t\tdayElement.innerHTML = currDate.getDate();\r\n\r\n\t\t\t\tif(currDate.valueOf() < monthStart.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add('dhx_before');\r\n\t\t\t\t}else if(currDate.valueOf() >= monthEnd.valueOf()){\t\r\n\t\t\t\t\tdayElement.classList.add('dhx_after');\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(currDate.getDay() === 0 || currDate.getDay() === 6){\r\n\t\t\t\t\tdayElement.classList.add(\"dhx_cal_datepicker_weekend\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(currDate.valueOf() == currentCalDate.valueOf()){\r\n\t\t\t\t\tdayElement.classList.add(\"dhx_now\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(minSchedulerDate && maxSchedulerDate){\r\n\t\t\t\t\tif(currDate.valueOf() >= minSchedulerDate.valueOf() && currDate.valueOf() < maxSchedulerDate.valueOf()){\r\n\t\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(eventDaysTable[currDate.valueOf()]){\r\n\t\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_event');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tdayElement.classList.add('dhx_cal_datepicker_date');\r\n\r\n\t\t\t\tdayGridContainer.appendChild(dayElement);\r\n\t\t\t}\r\n\t\t\tcurrDate = scheduler.date.add(currDate, 1, 'day');\r\n\t\t}\r\n\r\n\t\tcontainer.appendChild(dayGridContainer);\r\n\r\n\t}\r\n\r\n\t_renderMonthGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_months\");\r\n\r\n\t\tconst months = [];\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tmonths.push(new Date(date.getFullYear(), i, 1));\r\n\t\t}\r\n\r\n\t\tconst formatLabel = this.scheduler.date.date_to_str(\"%M\");\r\n\t\tmonths.forEach(month => {\r\n\t\t\tconst monthElement = document.createElement('div');\r\n\t\t\tmonthElement.classList.add('dhx_cal_datepicker_month');\r\n\t\t\tif(date.getMonth() === month.getMonth()){\r\n\t\t\t\tmonthElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tmonthElement.setAttribute(\"data-month\", month.getMonth());\r\n\t\t\tmonthElement.innerHTML = formatLabel(month);\r\n\t\t\tthis._domEvents.attach(monthElement, \"click\", () => {\r\n\t\t\t\tconst newDate = new Date(month);\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: newDate,\r\n\t\t\t\t\tmode: 'days'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(monthElement);\r\n\t\t});\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'days'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\t_renderYearGrid(container) {\r\n\t\tconst {date} = this.getState();\r\n\t\tconst startYear = Math.floor(date.getFullYear() / 10) * 10;\r\n\t\t\r\n\t\tconst wrapper = document.createElement('div');\r\n\t\twrapper.classList.add(\"dhx_cal_datepicker_years\");\r\n\t\tfor (let i = startYear - 1; i <= startYear + 10; i++) {\r\n\t\t\tconst yearElement = document.createElement('div');\r\n\t\t\tyearElement.innerText = i;\r\n\t\t\tyearElement.classList.add('dhx_cal_datepicker_year');\r\n\t\t\tyearElement.setAttribute(\"data-year\", i);\r\n\t\t\tif(date.getFullYear() === i){\r\n\t\t\t\tyearElement.classList.add('dhx_cal_datepicker_current');\r\n\t\t\t}\r\n\t\t\tthis._domEvents.attach(yearElement, \"click\", () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tdate: new Date(i, date.getMonth(), 1),\r\n\t\t\t\t\tmode: 'months'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\twrapper.appendChild(yearElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tcontainer.appendChild(wrapper);\r\n\r\n\t\tconst doneArea = document.createElement(\"div\");\r\n\t\tdoneArea.classList.add(\"dhx_cal_datepicker_done\");\r\n\t\tconst doneBtn = document.createElement(\"button\");\r\n\t\tdoneBtn.innerText = \"Done\";\r\n\t\tdoneBtn.classList.add(\"dhx_cal_datepicker_done_btn\");\r\n\t\tthis._domEvents.attach(doneBtn, \"click\", () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tmode: 'months'\r\n\t\t\t});\r\n\t\t});\r\n\t\tdoneArea.appendChild(doneBtn);\r\n\t\tcontainer.appendChild(doneArea);\r\n\t}\r\n\r\n\tdestructor(){\r\n\t\tthis.onStateChangeHandlers = [];\r\n\t\tif(this.element){\r\n\t\t\tthis.element.innerHTML = '';\r\n\t\t\tthis.element.remove();\r\n\t\t}\r\n\r\n\t\tthis._domEvents.detachAll();\r\n\t\tthis.callEvent(\"onDestroy\", []);\r\n\t\tthis.detachAllEvents();\r\n\r\n\t\tthis.scheduler = null;\r\n\t}\r\n}","// import \"./css/dhtmlxscheduler_terrace\";\r\n// import \"./css/dhtmlxscheduler_material\";\r\n// import \"./css/dhtmlxscheduler_material_nofont\";\r\n// import \"./css/dhtmlxscheduler_flat\";\r\n// import \"./css/dhtmlxscheduler_contrast_black\";\r\n// import \"./css/dhtmlxscheduler_contrast_white\";\r\n\r\nimport addPlugins from \"./plugins\";\r\nimport stateProvider from \"./core/state\";\r\nimport assert from \"./core/common/assert\";\r\nimport common_errors from \"./core/common_errors\";\r\nimport connector from \"./core/connector\";\r\nimport schedulerCore from \"./core/scheduler\";\r\nimport common from \"./core/common\";\r\nimport wai_aria from \"./core/wai_aria\";\r\nimport utils from \"./core/utils/utils\";\r\nimport dom_helpers from \"./core/utils/dom_helpers\";\r\nimport env from \"./utils/env\";\r\nimport destructor from \"./core/destructor\";\r\nimport ajax from \"./core/utils/ajax\";\r\nimport base from \"./core/base\";\r\nimport config from \"./core/config\";\r\nimport event from \"./core/event\";\r\nimport event_highlight from \"./core/event_highlight\";\r\nimport load from \"./core/load\";\r\nimport lightbox from \"./core/lightbox\";\r\nimport touch from \"./core/touch\";\r\nimport dhtmlx_suite_hooks from \"./core/dhtmlx/dhtmlx_suite_hooks\";\r\nimport skins from \"./core/skins\";\r\nimport jquery from \"./core/jquery\";\r\nimport delay_render from \"./core/delay_render\";\r\nimport dataProcessorExtend from \"./core/dataprocessor/dataprocessor\";\r\nimport message from \"./core/message\";\r\nimport i18nFactory from \"./locale\";\r\n\r\nimport voidFirst from \"./publish_helpers/void_script_first\";\r\nimport voidSecond from \"./publish_helpers/void_script_second\";\r\nimport voidThird from \"./publish_helpers/void_script_third\";\r\n\r\n//import datepickerHeader from \"./core/clickable_header\";\r\n\r\nimport { DatePicker } from \"./core/datepicker\";\r\n\r\nexport default function(extensionManager) {\r\n\r\n\tconst scheduler = { version: VERSION };\r\n\t\r\n\tscheduler.$stateProvider = stateProvider();\r\n\r\n\tscheduler.getState = scheduler.$stateProvider.getState;\r\n\tcommon_errors(scheduler);\r\n\tcommon(scheduler);\r\n\tschedulerCore(scheduler);\r\n\twai_aria(scheduler);\r\n\t//utils(scheduler);\r\n\r\n\tscheduler.utils = utils;\r\n\tscheduler.$domHelpers = dom_helpers;\r\n\tscheduler.utils.dom = dom_helpers;\r\n\tscheduler.uid = utils.uid;\r\n\tscheduler.mixin = utils.mixin;\r\n\tscheduler.defined = utils.defined;\r\n\tscheduler.assert = assert(scheduler);\r\n\tscheduler.copy = utils.copy;\r\n\r\n\tscheduler._createDatePicker = function(container, config){\r\n\t\treturn new DatePicker(scheduler, container, config);\r\n\t};\r\n\r\n\t//datepickerHeader(scheduler);\r\n\r\n\r\n\t//old api compatibility\r\n\tscheduler._getFocusableNodes = dom_helpers.getFocusableNodes;\r\n\tscheduler._getClassName = dom_helpers.getClassName;\r\n\tscheduler._locate_css = dom_helpers.locateCss;\r\n\r\n\tconst messageApi = message(scheduler);\r\n\tscheduler.utils.mixin(scheduler, messageApi);\r\n\r\n\tscheduler.env = scheduler.$env = env;\r\n\tscheduler.Promise = window.Promise;\r\n\tdestructor(scheduler);\r\n\tajax(scheduler);\r\n\tvoidFirst(scheduler);\r\n\tbase(scheduler);\r\n\tconfig(scheduler);\r\n\tevent(scheduler);\r\n\tevent_highlight(scheduler);\r\n\tload(scheduler);\r\n\tlightbox(scheduler);\r\n\ttouch(scheduler);\r\n\tdhtmlx_suite_hooks(scheduler);\r\n\tvoidSecond(scheduler);\r\n\tskins(scheduler);\r\n\tjquery(scheduler);\r\n\tdelay_render(scheduler);\r\n\tdataProcessorExtend(scheduler);\r\n\tvoidThird(scheduler);\r\n\tconnector(scheduler);\r\n\tconst i18n = i18nFactory();\r\n\tscheduler.i18n = {\r\n\t\taddLocale: i18n.addLocale,\r\n\t\tsetLocale: function(locale){\r\n\t\t\tif(typeof locale === \"string\"){\r\n\t\t\t\tvar localeObject = i18n.getLocale(locale);\r\n\t\t\t\tif(!localeObject){\r\n\t\t\t\t\tlocaleObject = i18n.getLocale(\"en\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.locale = localeObject;\r\n\t\t\t}else if(locale){\r\n\t\t\t\tif(!scheduler.locale){\r\n\t\t\t\t\tscheduler.locale = locale;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfor(var i in locale){\r\n\t\t\t\t\t\tif(locale[i] && typeof locale[i] === \"object\"){\r\n\t\t\t\t\t\t\tif(!scheduler.locale[i]){\r\n\t\t\t\t\t\t\t\tscheduler.locale[i] = {};\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tscheduler.mixin(scheduler.locale[i], locale[i], true);\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.locale[i] = locale[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar labels = scheduler.locale.labels;\r\n\t\t\tlabels.dhx_save_btn \t= labels.icon_save;\r\n\t\t\tlabels.dhx_cancel_btn \t= labels.icon_cancel;\r\n\t\t\tlabels.dhx_delete_btn \t= labels.icon_delete;\r\n\r\n\t\t\tif(scheduler.$container){\r\n\t\t\t\tscheduler.get_elements();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t},\r\n\t\tgetLocale: i18n.getLocale\r\n\t};\r\n\tscheduler.i18n.setLocale(\"en\");\r\n\taddPlugins(scheduler);\r\n\tscheduler.ext = {};\r\n\r\n\tconst activePlugins = {};\r\n\tscheduler.plugins = function(config){\r\n\t\tconst extensionList = getExtensionList(config, {\r\n\t\t\t\ttreetimeline: [\"timeline\"],\r\n\t\t\t\tdaytimeline: [\"timeline\"],\r\n\t\t\t\touterdrag: [\"legacy\"]\r\n\t\t\t}, {\r\n\t\t\t\tlegacy: 1,\r\n\t\t\t\tlimit: 1,\r\n\t\t\t\ttimeline: 2,\r\n\t\t\t\tdaytimeline: 3,\r\n\t\t\t\ttreetimeline: 3,\r\n\t\t\t\touterdrag:6\r\n\t\t\t});\r\n\r\n\t\textensionList.forEach(function(name){\r\n\t\t\tif(!activePlugins[name]){\r\n\t\t\t\tconst plugin = extensionManager.getExtension(name);\r\n\t\t\t\tif(plugin){\r\n\t\t\t\t\tplugin(scheduler);\r\n\t\t\t\t\tactivePlugins[name] = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthrow new Error(\"unknown plugin \" + name);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tfunction getExtensionList(config, dependencies, priorities){\r\n\t\tconst result = [];\r\n\r\n\t\tfor(const i in config){\r\n\t\t\tif(config[i]){\r\n\t\t\t\tconst extension = i.toLowerCase();\r\n\t\t\t\tif(dependencies[extension]){\r\n\t\t\t\t\tdependencies[extension].forEach(function(dep){\r\n\t\t\t\t\t\tconst dependencyName = dep.toLowerCase();\r\n\t\t\t\t\t\tif(!config[dependencyName]){\r\n\t\t\t\t\t\t\tresult.push(dependencyName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\tresult.push(extension);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tresult.sort(function(a, b){\r\n\t\t\tconst orderA = priorities[a] || 0;\r\n\t\t\tconst orderB = priorities[b] || 0;\r\n\t\t\tif(orderA > orderB){\r\n\t\t\t\treturn 1;\r\n\t\t\t}else if(orderA < orderB){\r\n\t\t\t\treturn -1;\r\n\t\t\t}else{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\treturn result;\r\n\t}\r\n\r\n\treturn scheduler;\r\n\r\n}","import utils from \"./utils/utils\";\r\n\r\nconst StateService = (function(){\r\n\tconst stateProviders = {};\r\n\r\n\tfunction getState(name){\r\n\t\tconst provider = stateProviders[name];\r\n\t\tif(provider){\r\n\t\t\treturn stateProviders[name].method();\r\n\t\t}else{\r\n\t\t\tconst res = {};\r\n\t\t\tfor(const i in stateProviders){\r\n\t\t\t\tif(!stateProviders[i].internal)\r\n\t\t\t\t\tutils.mixin(res, stateProviders[i].method(), true);\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction registerProvider(name, provider, internal){\r\n\t\tstateProviders[name] = { method: provider, internal: internal};\r\n\t}\r\n\r\n\tfunction unregisterProvider(name){\r\n\t\tdelete stateProviders[name];\r\n\t}\r\n\r\n\treturn {\r\n\t\tgetState: getState,\r\n\t\tregisterProvider: registerProvider,\r\n\t\tunregisterProvider: unregisterProvider\r\n\t};\r\n});\r\n\r\nexport default StateService;\r\n\r\n","export default function extend(scheduler) {\r\n\r\nvar commonViews = {\r\n\tagenda: \"https://docs.dhtmlx.com/scheduler/agenda_view.html\",\r\n\tgrid: \"https://docs.dhtmlx.com/scheduler/grid_view.html\",\r\n\tmap: \"https://docs.dhtmlx.com/scheduler/map_view.html\",\r\n\tunit: \"https://docs.dhtmlx.com/scheduler/units_view.html\",\r\n\ttimeline: \"https://docs.dhtmlx.com/scheduler/timeline_view.html\",\r\n\tweek_agenda: \"https://docs.dhtmlx.com/scheduler/weekagenda_view.html\",\r\n\tyear: \"https://docs.dhtmlx.com/scheduler/year_view.html\",\r\n\tanythingElse: \"https://docs.dhtmlx.com/scheduler/views.html\"\r\n};\r\n\r\nvar requiredExtensions = {\r\n\tagenda: \"ext/dhtmlxscheduler_agenda_view.js\",\r\n\tgrid: \"ext/dhtmlxscheduler_grid_view.js\",\r\n\tmap: \"ext/dhtmlxscheduler_map_view.js\",\r\n\tunit: \"ext/dhtmlxscheduler_units.js\",\r\n\ttimeline: \"ext/dhtmlxscheduler_timeline.js, ext/dhtmlxscheduler_treetimeline.js, ext/dhtmlxscheduler_daytimeline.js\",\r\n\tweek_agenda: \"ext/dhtmlxscheduler_week_agenda.js\",\r\n\tyear: \"ext/dhtmlxscheduler_year_view.js\",\r\n\tlimit: \"ext/dhtmlxscheduler_limit.js\"\r\n};\r\n\r\nscheduler._commonErrorMessages = {\r\n\tunknownView: function(view){\r\n\t\tvar relatedDoc = \"Related docs: \" + (commonViews[view] || commonViews.anythingElse); \r\n\t\tvar relatedExtension = requiredExtensions[view] ? (\"You're probably missing \" + requiredExtensions[view] + \".\") : \"\";\r\n\t\treturn (\r\n\t\t\t\"`\"+view+\"` view is not defined. \\n\" +\r\n\t\t\t\"Please check parameters you pass to `scheduler.init` or `scheduler.setCurrentView` in your code and ensure you've imported appropriate extensions. \\n\" + \r\n\t\t\trelatedDoc + \"\\n\" + (relatedExtension ? (relatedExtension + \"\\n\") : \"\"));\r\n\t},\r\n\tcollapsedContainer: function(div){\r\n\t\treturn \"Scheduler container height is set to *100%* but the rendered height is zero and the scheduler is not visible. \\n\"+\r\n\t\t\"Make sure that the container has some initial height or use different units. For example:\\n\" +\r\n\t\t\"
\\n\";\r\n\t}\r\n};\r\n\r\nscheduler.createTimelineView = function() {\r\n\tthrow new Error(\"scheduler.createTimelineView is not implemented. Be sure to add the required extension: \" + requiredExtensions.timeline + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.timeline);\r\n};\r\n\r\nscheduler.createUnitsView = function() {\r\n\tthrow new Error(\"scheduler.createUnitsView is not implemented. Be sure to add the required extension: \" + requiredExtensions.unit + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.unit);\r\n};\r\n\r\nscheduler.createGridView = function() {\r\n\tthrow new Error(\"scheduler.createGridView is not implemented. Be sure to add the required extension: \" + requiredExtensions.grid + \r\n\t\"\\n\" +\r\n\t\"Related docs: \" + commonViews.grid);\r\n};\r\n\r\nscheduler.addMarkedTimespan = function() {\r\n\tthrow new Error(\"scheduler.addMarkedTimespan is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_limit.js\" + \r\n\t\"\\n\" +\r\n\t\"Related docs: https://docs.dhtmlx.com/scheduler/limits.html\");\r\n};\r\n\r\nscheduler.renderCalendar = function() {\r\n\tthrow new Error(\"scheduler.renderCalendar is not implemented. Be sure to add the required extension: ext/dhtmlxscheduler_minical.js\" + \r\n\t\"\\n\" +\r\n\t\"https://docs.dhtmlx.com/scheduler/minicalendar.html\");\r\n};\r\n\r\nscheduler.exportToPNG = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPNG is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/png.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\nscheduler.exportToPDF = function() {\r\n\tthrow new Error([\r\n\t\t\"scheduler.exportToPDF is not implemented.\",\r\n\t\t\"This feature requires an additional module, be sure to check the related doc here https://docs.dhtmlx.com/scheduler/pdf.html\",\r\n\t\t\"Licensing info: https://dhtmlx.com/docs/products/dhtmlxScheduler/export.shtml\"\r\n\t].join(\"\\n\"));\r\n};\r\n\r\n\r\n}","\r\nimport nav_bar from \"./nav_bar\";\r\nimport scheduler_resize_listener from \"./scheduler_resize_listener\";\r\nimport eventable from \"../utils/eventable\";\r\n\r\n\r\nexport default function extend(scheduler) {\r\n\r\neventable(scheduler);\r\n\r\nnav_bar(scheduler);\r\n\r\nscheduler._detachDomEvent = function(el, event, handler){\r\n\tif (el.removeEventListener){\r\n\t\tel.removeEventListener(event, handler, false);\r\n\r\n\t}else if (el.detachEvent){\r\n\t\tel.detachEvent(\"on\"+event, handler);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._init_once = function(){\r\n\tscheduler_resize_listener(scheduler);\r\n\r\n\tscheduler._init_once = function(){};\r\n};\r\n\r\nconst layout = {\r\n\t\"navbar\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn scheduler._init_nav_bar(config);\r\n\t\t}\r\n\t},\r\n\t\"header\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_header\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"dataArea\": {\r\n\t\trender: function (config) {\r\n\t\t\tconst element = document.createElement(\"div\");\r\n\t\t\telement.className = \"dhx_cal_data\";\r\n\t\t\treturn element;\r\n\t\t}\r\n\t},\r\n\t\"html_element\": {\r\n\t\trender: function (config) {\r\n\t\t\treturn config.html;\r\n\t\t}\r\n\t}\r\n};\r\n\r\nfunction hasSchedulerMarkup(element){\r\n\treturn !!(\r\n\t\telement.querySelector(\".dhx_cal_header\") &&\r\n\t\telement.querySelector(\".dhx_cal_data\") &&\r\n\t\telement.querySelector(\".dhx_cal_navline\")\r\n\t\t);\r\n}\r\n\r\nfunction createDefaultHeader(scheduler){\r\n\tconst views = [\r\n\t\t\"day\",\r\n\t\t\"week\",\r\n\t\t\"month\"\r\n\t];\r\n\tconst date = [\r\n\t\t\"date\"\r\n\t];\r\n\tconst nav = [\r\n\t\t\"prev\",\r\n\t\t\"today\",\r\n\t\t\"next\"\r\n\t];\r\n\r\n\tif(scheduler.matrix){\r\n\t\tfor(const i in scheduler.matrix){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\tif(scheduler._props){\r\n\t\tfor(const i in scheduler._props){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tif(scheduler._grid && scheduler._grid.names){\r\n\t\tfor(const i in scheduler._grid.names){\r\n\t\t\tviews.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\tconst optionalViews = [\r\n\t\t\"map\",\r\n\t\t\"agenda\",\r\n\t\t\"week_agenda\",\r\n\t\t\"year\"\r\n\t];\r\n\r\n\toptionalViews.forEach(function(viewName){\r\n\t\tif(scheduler[viewName + \"_view\"]){\r\n\t\t\tviews.push(viewName);\r\n\t\t}\r\n\t});\r\n\r\n\treturn views.concat(date).concat(nav);\r\n}\r\n\r\nscheduler.init=function(id,date,mode){\r\n\tif(this.$destroyed){\r\n\t\treturn; // not have errors when try to reinit destroyed scheduler\r\n\t}\r\n\tdate=date||(scheduler._currentDate());\r\n\tmode=mode||\"week\";\r\n\r\n\tif(this._obj){\r\n\t\tthis.unset_actions();\r\n\t}\r\n\r\n\tthis._obj=(typeof id == \"string\")?document.getElementById(id):id;\r\n\tthis.$container = this._obj;\r\n\tthis.$root = this._obj;\r\n\r\n\tif(!this.$container.offsetHeight && this.$container.offsetWidth && this.$container.style.height === \"100%\"){\r\n\t\t// scheduler container has zero height and non-zero width\r\n\t\twindow.console.error(scheduler._commonErrorMessages.collapsedContainer(), this.$container);\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tthis.$container.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\tif(!this.config.header && !hasSchedulerMarkup(this.$container)){\r\n\t\t// if no header config and no required markup - use the default header\r\n\t\t// so the scheduler could be initialized in an empty div\r\n\t\tthis.config.header = createDefaultHeader(this);\r\n\t\twindow.console.log([// jshint ignore:line\r\n\t\t\t\"Required DOM elements are missing from the scheduler container and **scheduler.config.header** is not specified.\",\r\n\t\t\t\"Using a default header configuration: \",\r\n\t\t\t\"scheduler.config.header = \" + JSON.stringify(this.config.header, null, 2),\r\n\t\t\t\"Check this article for the details: https://docs.dhtmlx.com/scheduler/initialization.html\"\r\n\t\t].join(\"\\n\"));// jshint ignore:line\r\n\t}\r\n\r\n\tif (this.config.header) {\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\tthis.$container.classList.add(\"dhx_cal_container\");\r\n\t\tif(this.config.header.height){\r\n\t\t\tthis.xy.nav_height = this.config.header.height;\r\n\t\t}\r\n\t\tthis.$container.appendChild(layout.navbar.render(this.config.header));\r\n\t\tthis.$container.appendChild(layout.header.render());\r\n\t\tthis.$container.appendChild(layout.dataArea.render());\r\n\t} else {\r\n\t\t// if no header config provided - make sure scheduler container has all necessary elements\r\n\t\tif(!hasSchedulerMarkup(this.$container)){\r\n\t\t\tthrow new Error([\r\n\t\t\t\t\"Required DOM elements are missing from the scheduler container.\",\r\n\t\t\t\t\"Be sure to either specify them manually in the markup: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviamarkup\",\r\n\t\t\t\t\"Or to use **scheduler.config.header** setting so they could be created automatically: https://docs.dhtmlx.com/scheduler/initialization.html#initializingschedulerviaheaderconfig\"\r\n\t\t\t].join(\"\\n\"));\r\n\t\t}\r\n\t}\r\n\r\n\tif (this.config.rtl) this.$container.className += \" dhx_cal_container_rtl\";\r\n\r\n\t//hook for terrace skin\r\n\tif (this._skin_init)\r\n\t\tscheduler._skin_init();\r\n\r\n\tscheduler.date.init();\r\n\r\n\tthis._scroll=true;\r\n\r\n\tthis._els=[];\r\n\tthis.get_elements();\r\n\tthis.init_templates();\r\n\tthis.set_actions();\r\n\r\n\tthis._init_once();\r\n\tthis._init_touch_events();\r\n\r\n\tthis.set_sizes();\r\n\tscheduler.callEvent('onSchedulerReady', []);\r\n\tscheduler.$initialized = true;\r\n\tthis.setCurrentView(date,mode);\r\n\r\n};\r\n\r\nscheduler.xy={\r\n\tmin_event_height:20,\r\n\tbar_height: 24,\r\n\tscale_width:50,\r\n\tscroll_width:18,\r\n\tscale_height:20,\r\n\tmonth_scale_height:20,\r\n\tmenu_width:25,\r\n\tmargin_top:0,\r\n\tmargin_left:0,\r\n\teditor_width:140,\r\n\tmonth_head_height:22,\r\n\tevent_header_height: 14\r\n};\r\nscheduler.keys={\r\n\tedit_save:13,\r\n\tedit_cancel:27\r\n};\r\n\r\nscheduler.bind = function bind(functor, object){\r\n\tif(functor.bind)\r\n\t\treturn functor.bind(object);\r\n\telse\r\n\t\treturn function(){ return functor.apply(object,arguments); };\r\n};\r\n\r\nscheduler.set_sizes=function(){\r\n\r\n\tvar w = this._x = this._obj.clientWidth-this.xy.margin_left;\r\n\r\n\t//not-table mode always has scroll - need to be fixed in future\r\n\tvar scale_x=this._table_view?0:(this.xy.scale_width+this.xy.scroll_width);\r\n\r\n\tvar materialScalePlaceholder = this.$container.querySelector(\".dhx_cal_scale_placeholder\");\r\n\tif(scheduler._is_material_skin()){\r\n\t\tif(!materialScalePlaceholder) {\r\n\t\t\tmaterialScalePlaceholder = document.createElement(\"div\");\r\n\t\t\tmaterialScalePlaceholder.className = \"dhx_cal_scale_placeholder\";\r\n\t\t\tthis.$container.insertBefore(materialScalePlaceholder, this._els[\"dhx_cal_header\"][0]);\r\n\t\t}\r\n\t\tmaterialScalePlaceholder.style.display = \"block\";\r\n\r\n\t\tthis.set_xy(materialScalePlaceholder,w,this.xy.scale_height + 1,0, this._els[\"dhx_cal_header\"][0].offsetTop);\r\n\r\n\t}else{\r\n\t\tif(materialScalePlaceholder){\r\n\t\t\tmaterialScalePlaceholder.parentNode.removeChild(materialScalePlaceholder);\r\n\t\t}\r\n\t}\r\n\r\n\tif (this._lightbox) {\r\n\t\tif (scheduler.$container.offsetWidth < 1200) {\r\n\t\t} else {\r\n\t\t\tthis._setLbPosition(document.querySelector(\".dhx_cal_light\"));\r\n\t\t}\r\n\t}\r\n\r\n\tthis._data_width = w-scale_x;\r\n\r\n\tthis._els[\"dhx_cal_navline\"][0].style.width = w + \"px\";\r\n\tconst header = this._els[\"dhx_cal_header\"][0];\r\n\tthis.set_xy(header, this._data_width, this.xy.scale_height);\r\n\t// this._els[\"dhx_cal_header\"][0].style.marginLeft = `${scheduler.xy.scale_width}px`;\r\n\theader.style.left = ``;\r\n\theader.style.right = ``;\r\n\tif(!this._table_view){\r\n\t\tif(this.config.rtl){\r\n\t\t\theader.style.right = `${this.xy.scale_width}px`;\r\n\t\t}else{\r\n\t\t\theader.style.left = `${this.xy.scale_width}px`;\r\n\t\t}\r\n\t} else {\r\n\t\tif(!this.config.rtl){\r\n\t\t\theader.style.left = `-1px`;\r\n\t\t} else {\r\n\t\t\theader.style.right = `-1px`;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.set_xy=function(node,w,h,x,y){\r\n\tfunction prepareValue(val){\r\n\t\tlet prepared = val;\r\n\t\tif(!isNaN(Number(prepared))){\r\n\t\t\tprepared = Math.max(0,prepared) + \"px\";\r\n\t\t}\r\n\t\treturn prepared;\r\n\t}\r\n\r\n\tvar direction = 'left';\r\n\r\n\tif(w !== undefined) {\r\n\t\tnode.style.width = prepareValue(w);\r\n\t}\r\n\r\n\tif(h !== undefined){\r\n\t\tnode.style.height = prepareValue(h);\r\n\t}\r\n\r\n\tif (arguments.length>3){\r\n\r\n\t\tif(x !== undefined){\r\n\t\t\tif (this.config.rtl) direction = 'right';\r\n\t\t\tnode.style[direction]=x+\"px\";\r\n\t\t}\r\n\t\tif(y !== undefined){\r\n\t\t\tnode.style.top=y+\"px\";\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.get_elements=function(){\r\n\t//get all child elements as named hash\r\n\tconst els=this._obj.getElementsByTagName(\"DIV\");\r\n\tfor (let i=0; i < els.length; i++){\r\n\t\tlet class_name= scheduler._getClassName(els[i]);\r\n\t\tconst attr_value = els[i].getAttribute(\"data-tab\") || els[i].getAttribute(\"name\") || \"\";\r\n\t\tif (class_name) class_name = class_name.split(\" \")[0];\r\n\t\tif (!this._els[class_name]) this._els[class_name]=[];\r\n\t\tthis._els[class_name].push(els[i]);\r\n\r\n\t\t//check if name need to be changed\r\n\t\t// scheduler.locale.labels[attr_value+\"_tab\"] - to fix getting labels for data-tab\r\n\t\tlet label = scheduler.locale.labels[attr_value+\"_tab\"] || scheduler.locale.labels[attr_value||class_name];\r\n\t\tif (typeof label !== \"string\" && attr_value && !els[i].innerHTML)\r\n\t\t\tlabel = attr_value.split(\"_\")[0];\r\n\t\tif (label) {\r\n\t\t\tthis._waiAria.labelAttr(els[i], label);\r\n\t\t\tels[i].innerHTML = label;\r\n\t\t}\r\n\t}\r\n};\r\n\r\n\r\nconst domEventsScope = scheduler._createDomEventScope();\r\n\r\nscheduler.unset_actions = function(){\r\n\tdomEventsScope.detachAll();\r\n};\r\n\r\nscheduler.set_actions=function(){\r\n\tfor (const a in this._els){\r\n\t\tif (this._click[a]){\r\n\t\t\tfor (let i=0; i < this._els[a].length; i++){\r\n\t\t\t\tconst element = this._els[a][i];\r\n\t\t\t\tconst handler = this._click[a].bind(element);\r\n\t\t\t\tdomEventsScope.attach(element, \"click\", handler);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tdomEventsScope.attach(this._obj, \"selectstart\", function(e){\r\n\t\te.preventDefault();\r\n\t\treturn false;\r\n\t});\r\n\t//this._obj.onselectstart=function(e){ return false; };\r\n\tdomEventsScope.attach(this._obj, \"mousemove\", function(e){\r\n\t\tif (!scheduler._temp_touch_block)\r\n\t\t\tscheduler._on_mouse_move(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mousedown\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_down(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"mouseup\", function(e){\r\n\t\tif (!scheduler._ignore_next_click)\r\n\t\t\tscheduler._on_mouse_up(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"dblclick\", function(e){\r\n\t\tscheduler._on_dbl_click(e);\r\n\t});\r\n\tdomEventsScope.attach(this._obj, \"contextmenu\", function(event) {\r\n\t\tif(scheduler.checkEvent(\"onContextMenu\")){\r\n\t\t\t// block the default browser context menu \r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\r\n\t\tconst returnValue = scheduler.callEvent(\"onContextMenu\", [scheduler._locate_event(event.target), event]);\r\n\t\treturn returnValue;\r\n\t});\r\n};\r\nscheduler.select=function(id){\r\n\tif (this._select_id==id) return;\r\n\tscheduler._close_not_saved();\r\n\tthis.editStop(false);\r\n\tif(this._select_id){\r\n\t\tthis.unselect();\r\n\t}\r\n\tthis._select_id = id;\r\n\tthis.updateEvent(id);\r\n\tthis.callEvent(\"onEventSelected\", [id]);\r\n};\r\nscheduler.unselect=function(id){\r\n\tif (id && id!=this._select_id) {\r\n\t\treturn;\r\n\t}\r\n\tconst previousSelection = this._select_id;\r\n\tthis._select_id = null;\r\n\tif (previousSelection && this.getEvent(previousSelection)) {\r\n\t\tthis.updateEvent(previousSelection);\r\n\t}\r\n\tthis.callEvent(\"onEventUnselected\", [previousSelection]);\r\n};\r\nscheduler.$stateProvider.registerProvider(\"global\", (function(){\r\n\treturn {\r\n\t\tmode: this._mode,\r\n\t\tdate: new Date(this._date),\r\n\t\tmin_date: new Date(this._min_date),\r\n\t\tmax_date: new Date(this._max_date),\r\n\t\teditor_id: this._edit_id,\r\n\t\tlightbox_id: this._lightbox_id,\r\n\t\tnew_event: this._new_event,\r\n\t\tselect_id: this._select_id,\r\n\t\texpanded: this.expanded,\r\n\t\tdrag_id: this._drag_id,\r\n\t\tdrag_mode: this._drag_mode\r\n\t};\r\n}).bind(scheduler));\r\n\r\nscheduler._click={\r\n\tdhx_cal_data:function(e){\r\n\t\t//in case of touch disable click processing\r\n\t\tif (scheduler._ignore_next_click){\r\n\t\t\tif (e.preventDefault)\r\n\t\t\t\te.preventDefault();\r\n\t\t\te.cancelBubble = true;\r\n\t\t\tscheduler._ignore_next_click = false;\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\r\n\t\tconst id = scheduler._locate_event(e.target);\r\n\r\n\t\tif (!id) {\r\n\t\t\tscheduler.callEvent(\"onEmptyClick\",[scheduler.getActionData(e).date, e]);\r\n\t\t} else {\r\n\t\t\tif ( !scheduler.callEvent(\"onClick\",[id,e]) || scheduler.config.readonly ) return;\r\n\t\t}\r\n\r\n\t\tif (id && scheduler.config.select) {\r\n\r\n\t\t\tscheduler.select(id);\r\n\t\t\tconst icon = e.target.closest(\".dhx_menu_icon\");\r\n\r\n\t\t\tconst mask = scheduler._getClassName(icon);\r\n\t\t\tif (mask.indexOf(\"_icon\")!=-1)\r\n\t\t\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t\t} else{\r\n\t\t\tscheduler._close_not_saved();\r\n\t\t\tif (scheduler.getState().select_id && new Date().valueOf()-(scheduler._new_event||0) > 500){\r\n\t\t\t\tscheduler.unselect();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tdhx_cal_prev_button:function(){\r\n\t\tscheduler._click.dhx_cal_next_button(0,-1);\r\n\t},\r\n\tdhx_cal_next_button:function(dummy,step){\r\n\t\tlet def_step = 1;\r\n\t\tif (scheduler.config.rtl){\r\n\t\t\tstep = -step;\r\n\t\t\tdef_step = -def_step;\r\n\t\t}\r\n\t\tscheduler.setCurrentView(scheduler.date.add( //next line changes scheduler._date , but seems it has not side-effects\r\n\t\t\tscheduler.date[scheduler._mode+\"_start\"](new Date(scheduler._date)),(step||def_step),scheduler._mode));\r\n\t},\r\n\tdhx_cal_today_button:function(){\r\n\t\tif (scheduler.callEvent(\"onBeforeTodayDisplayed\", [])) {\r\n\t\t\tscheduler.setCurrentView(scheduler._currentDate());\r\n\t\t}\r\n\t},\r\n\tdhx_cal_tab:function(){\r\n\t\tconst name = this.getAttribute(\"data-tab\");\r\n\t\tconst deprecated_name = this.getAttribute(\"name\");\r\n\t\tconst mode = name || deprecated_name.substring(0, deprecated_name.search(\"_tab\"));\r\n\t\tscheduler.setCurrentView(scheduler._date,mode);\r\n\t},\r\n\tbuttons:{\r\n\t\t\"delete\":function(id){\r\n\t\t\tconst c = scheduler.locale.labels.confirm_deleting;\r\n\t\t\tscheduler._dhtmlx_confirm({message: c, title: scheduler.locale.labels.title_confirm_deleting, callback:function(){ scheduler.deleteEvent(id); },\r\n\t\t\tconfig: {ok: scheduler.locale.labels.icon_delete}\r\n\t\t});\r\n\t\t},\r\n\t\tedit:function(id){ scheduler.edit(id); },\r\n\t\tsave:function(id){ scheduler.editStop(true); },\r\n\t\tdetails:function(id){ scheduler.showLightbox(id); },\r\n\t\tform:function(id){ scheduler.showLightbox(id); },\r\n\t\tcancel:function(id){ scheduler.editStop(false); }\r\n\t}\r\n};\r\nscheduler._dhtmlx_confirm = function({message, title, callback, config}) {\r\n\tif (!message)\r\n\t\treturn callback();\r\n\r\n\tconfig = config || {};\r\n\tconst opts = { ...config, text: message };\r\n\tif (title) {\r\n\t\topts.title = title;\r\n\t}\r\n\tif (callback) {\r\n\t\topts.callback = function(result) {\r\n\t\t\tif (result) {\r\n\t\t\t\tcallback();\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n\tscheduler.confirm(opts);\r\n};\r\nscheduler.addEventNow=function(start,end,e){\r\n\tlet base = {};\r\n\tif (scheduler._isObject(start) && !scheduler._isDate(start)){\r\n\t\tbase = start;\r\n\t\tstart = null;\r\n\t}\r\n\r\n\tconst duration = (this.config.event_duration||this.config.time_step)*60000;\r\n\tif (!start) start = base.start_date||Math.round((scheduler._currentDate()).valueOf()/duration)*duration;\r\n\tlet start_date = new Date(start);\r\n\tif (!end){\r\n\t\tlet start_hour = this.config.first_hour;\r\n\t\tif (start_hour > start_date.getHours()){\r\n\t\t\tstart_date.setHours(start_hour);\r\n\t\t\tstart = start_date.valueOf();\r\n\t\t}\r\n\t\tend = start.valueOf()+duration;\r\n\t}\r\n\tlet end_date = new Date(end);\r\n\r\n\t// scheduler.addEventNow(new Date(), new Date()) + collision though get_visible events defect (such event was not retrieved)\r\n\tif(start_date.valueOf() == end_date.valueOf())\r\n\t\tend_date.setTime(end_date.valueOf()+duration);\r\n\tbase.start_date = base.start_date||start_date;\r\n\tbase.end_date = base.end_date||end_date;\r\n\tbase.text = base.text||this.locale.labels.new_event;\r\n\tbase.id = this._drag_id = base.id || this.uid();\r\n\tthis._drag_mode=\"new-size\";\r\n\tthis._loading=true;\r\n\tconst eventId = this.addEvent(base);\r\n\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\tthis._loading=false;\r\n\r\n\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\tthis._on_mouse_up(e);\r\n\treturn eventId;\r\n};\r\nscheduler._on_dbl_click=function(e,src){\r\n\tsrc = src || e.target;\r\n\tif (this.config.readonly) return;\r\n\tconst name = scheduler._getClassName(src).split(\" \")[0];\r\n\tswitch(name){\r\n\t\tcase \"dhx_scale_holder\":\r\n\t\tcase \"dhx_scale_holder_now\":\r\n\t\tcase \"dhx_month_body\":\r\n\t\tcase \"dhx_wa_day_data\":\r\n\t\t\tif (!scheduler.config.dblclick_create) break;\r\n\t\t\tthis.addEventNow(this.getActionData(e).date,null,e);\r\n\t\t\tbreak;\r\n\t\tcase \"dhx_cal_event\":\r\n\t\tcase \"dhx_wa_ev_body\":\r\n\t\tcase \"dhx_agenda_line\":\r\n\t\tcase \"dhx_cal_agenda_event_line\":\r\n\t\tcase \"dhx_grid_event\":\r\n\t\tcase \"dhx_cal_event_line\":\r\n\t\tcase \"dhx_cal_event_clear\": {\r\n\t\t\tconst id = this._locate_event(src);\r\n\t\t\tif (!this.callEvent(\"onDblClick\",[id,e])) return;\r\n\t\t\tif (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed || !this.config.select)\r\n\t\t\t\tthis.showLightbox(id);\r\n\t\t\telse\r\n\t\t\t\tthis.edit(id);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase \"dhx_time_block\":\r\n\t\tcase \"dhx_cal_container\":\r\n\t\t\treturn;\r\n\t\tdefault: {\r\n\t\t\tconst viewHandler = this[\"dblclick_\"+name];\r\n\t\t\tif (viewHandler) {\r\n\t\t\t\tviewHandler.call(this,e);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif (src.parentNode && src != this)\r\n\t\t\t\t\treturn scheduler._on_dbl_click(e,src.parentNode);\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n};\r\n//column index by mouse x-coordinate\r\nscheduler._get_column_index = function(x_pos){\r\n\tlet column = 0;\r\n\tif (this._cols){\r\n\t\tlet width = 0;\r\n\t\tlet i = 0;\r\n\t\twhile (width + this._cols[i] < x_pos && i < this._cols.length){\r\n\t\t\twidth += this._cols[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tcolumn = i + (this._cols[i] ? ((x_pos - width)/ this._cols[i]) : 0);\r\n\r\n\t\tif (this._ignores){\r\n\t\t\tif(column >= this._cols.length){\r\n\t\t\t\twhile(column >= 1 && this._ignores[Math.floor(column)]){\r\n\t\t\t\t\tcolumn--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n\treturn column;\r\n};\r\n\r\n//transform mouse coordinates to day-time indexes of week based view\r\nscheduler._week_indexes_from_pos = function(pos){\r\n\t//\"get position\" can be invoked before columns are loaded into the units view(e.g. by onMouseMove handler in key_nav.js)\r\n\tif(!this._cols){\r\n\t\treturn pos;\r\n\t}else{\r\n\t\tconst column = this._get_column_index(pos.x);\r\n\r\n\t\tpos.x=Math.min(this._cols.length-1, Math.max(0,Math.ceil(column)-1));\r\n\t\tpos.y=Math.max(0,Math.ceil(pos.y*60/(this.config.time_step*this.config.hour_size_px))-1)+this.config.first_hour*(60/this.config.time_step);\r\n\t\treturn pos;\r\n\t}\r\n};\r\n\r\nscheduler._mouse_coords=function(ev){\r\n\tlet pos;\r\n\tconst body = document.body;\r\n\tconst documentElement = document.documentElement;\r\n\tif (!this.$env.isIE && (ev.pageX || ev.pageY))\r\n\t\tpos={x:ev.pageX, y:ev.pageY};\r\n\telse pos={\r\n\t\tx:ev.clientX + (body.scrollLeft||documentElement.scrollLeft||0) - body.clientLeft,\r\n\t\ty:ev.clientY + (body.scrollTop||documentElement.scrollTop||0) - body.clientTop\r\n\t};\r\n\t//apply layout\r\n\tif (this.config.rtl && this._colsS) {\r\n\t\tpos.x = this.$container.querySelector(\".dhx_cal_data\").offsetWidth - pos.x;\r\n\t\tpos.x += this.$domHelpers.getAbsoluteLeft(this._obj);\r\n\t\tif (this._mode !== \"month\") {\r\n\t\t\tpos.x -= this.xy.scale_width;\r\n\t\t}\r\n\t} else {\r\n\t\tpos.x-=this.$domHelpers.getAbsoluteLeft(this._obj)+(this._table_view?0:this.xy.scale_width);\r\n\t}\r\n\r\n\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t//pos.y-=this.$domHelpers.getAbsoluteTop(this._obj)+this.xy.nav_height+(this._dy_shift||0)+this.xy.scale_height-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.y-=this.$domHelpers.getAbsoluteTop(dataArea)-this._els[\"dhx_cal_data\"][0].scrollTop;\r\n\tpos.ev = ev;\r\n\tconst handler = this[\"mouse_\"+this._mode];\r\n\tif (handler){\r\n\t\tpos = handler.call(this,pos);\r\n\t}else{\r\n\t\t//transform to date\r\n\t\tif (!this._table_view) {\r\n\t\t\tpos = this._week_indexes_from_pos(pos);\r\n\t\t} else {\r\n\t\t\tconst column = this._get_column_index(pos.x);\r\n\t\t\tif (!this._cols || !this._colsS) // agenda/map views\r\n\t\t\t\treturn pos;\r\n\t\t\tlet dy=0;\r\n\t\t\tfor (dy=1; dy < this._colsS.heights.length; dy++)\r\n\t\t\t\tif (this._colsS.heights[dy]>pos.y) break;\r\n\r\n\t\t\tpos.y=Math.ceil( (Math.max(0, column)+Math.max(0,dy-1)*7)*24*60/this.config.time_step );\r\n\r\n\t\t\tif (scheduler._drag_mode || this._mode == \"month\")\r\n\t\t\t\tpos.y=(Math.max(0,Math.ceil(column)-1)+Math.max(0,dy-1)*7)*24*60/this.config.time_step;\r\n\r\n\t\t\t//we care about ignored days only during event moving in month view\r\n\t\t\tif (this._drag_mode == \"move\"){\r\n\t\t\t\tif (scheduler._ignores_detected && scheduler.config.preserve_length){\r\n\t\t\t\t\tpos._ignores = true;\r\n\t\t\t\t\t//get real lengtn of event\r\n\t\t\t\t\tif (!this._drag_event._event_length)\r\n\t\t\t\t\t\tthis._drag_event._event_length = this._get_real_event_length(this._drag_event.start_date, this._drag_event.end_date, { x_step:1, x_unit:\"day\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tpos.x=0;\r\n\t\t}\r\n\t}\r\n\tpos.timestamp = +new Date();\r\n\treturn pos;\r\n};\r\nscheduler._close_not_saved=function(){\r\n\tif (new Date().valueOf()-(scheduler._new_event||0) > 500 && scheduler._edit_id){\r\n\t\tconst confirmationText=scheduler.locale.labels.confirm_closing;\r\n\r\n\t\tscheduler._dhtmlx_confirm({\r\n\t\t\tmessage: confirmationText, \r\n\t\t\ttitle: scheduler.locale.labels.title_confirm_closing, \r\n\t\t\tcallback: function() { \r\n\t\t\t\tscheduler.editStop(scheduler.config.positive_closing);\r\n\t\t\t}\r\n\t\t});\r\n\t\tif(confirmationText){\r\n\t\t\tthis._drag_id = this._drag_pos = this._drag_mode = null;\r\n\t\t}\r\n\t}\r\n};\r\nscheduler._correct_shift=function(start, back){\r\n\treturn start-=((new Date(scheduler._min_date)).getTimezoneOffset()-(new Date(start)).getTimezoneOffset())*60000*(back?-1:1);\r\n};\r\n\r\nscheduler._is_pos_changed = function(old_pos, new_pos){\r\n\tfunction diff(old_val, new_val, acc){\r\n\t\treturn !!(Math.abs(old_val - new_val) > acc);\r\n\t}\r\n\r\n\tif(!(old_pos && this._drag_pos)){\r\n\t\treturn true;\r\n\t}\r\n\tconst delay = 100;\r\n\tconst d_pos = 5;\r\n\r\n\t// start drag only if passed some time since mouse down, or if mouse position changed sufficiently\r\n\treturn !!(this._drag_pos.has_moved || !this._drag_pos.timestamp || (new_pos.timestamp - this._drag_pos.timestamp > delay) || diff(old_pos.ev.clientX, new_pos.ev.clientX, d_pos) || diff(old_pos.ev.clientY, new_pos.ev.clientY, d_pos));\r\n};\r\n\r\nscheduler._correct_drag_start_date = function(start){\r\n\tlet obj;\r\n\tif (scheduler.matrix)\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tstart = new Date(start);\r\n\tlet len = 1;\r\n\tif(obj._start_correction || obj._end_correction)\r\n\t\tlen = (obj.last_hour||0)*60 - (start.getHours()*60+start.getMinutes()) || 1;\r\n\r\n\treturn start*1 + (scheduler._get_fictional_event_length(start, len, obj) - len);\r\n};\r\nscheduler._correct_drag_end_date = function(start, duration){\r\n\tlet obj;\r\n\tif (scheduler.matrix) {\r\n\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t}\r\n\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\tconst end = start*1 + scheduler._get_fictional_event_length(start, duration, obj);\r\n\treturn new Date(end*1 - (scheduler._get_fictional_event_length(end, -1, obj, -1) + 1));\r\n};\r\n\r\nscheduler._on_mouse_move=function(e){\r\n\tif (this._drag_mode){\r\n\t\tvar pos=this._mouse_coords(e);\r\n\t\tif (this._is_pos_changed(this._drag_pos, pos)){\r\n\t\t\tvar start, end;\r\n\t\t\tif (this._edit_id!=this._drag_id)\r\n\t\t\t\tthis._close_not_saved();\r\n\r\n\t\t\tif(!this._drag_mode)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar mousedownPos = null;\r\n\t\t\tif(this._drag_pos && !this._drag_pos.has_moved){\r\n\t\t\t\tmousedownPos = this._drag_pos;\r\n\t\t\t\tmousedownPos.has_moved = true;\r\n\t\t\t}\r\n\r\n\t\t\tthis._drag_pos = pos;\r\n\r\n\t\t\tthis._drag_pos.has_moved = true;\r\n\r\n\t\t\tif (this._drag_mode==\"create\"){\r\n\r\n\t\t\t\t// use mouse down position as a starting point for drag-create\r\n\t\t\t\tif(mousedownPos){\r\n\t\t\t\t\tpos = mousedownPos;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._close_not_saved();\r\n\t\t\t\tthis.unselect(this._select_id);\r\n\t\t\t\tthis._loading=true; //will be ignored by dataprocessor\r\n\r\n\t\t\t\tstart = this._get_date_from_pos(pos).valueOf();\r\n\r\n\t\t\t\tif (!this._drag_start) {\r\n\t\t\t\t\tvar res = this.callEvent(\"onBeforeEventCreated\", [e, this._drag_id]);\r\n\t\t\t\t\tif (!res){\r\n\t\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis._loading=false;\r\n\t\t\t\t\tthis._drag_start=start;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tend = start;\r\n\t\t\t\tif (end == this._drag_start) {\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar start_date = new Date(this._drag_start);\r\n\t\t\t\tvar end_date = new Date(end);\r\n\t\t\t\tif ( (this._mode == \"day\" || this._mode == \"week\") &&\r\n\t\t\t\t\t(start_date.getHours() == end_date.getHours() &&\r\n\t\t\t\t\tstart_date.getMinutes() == end_date.getMinutes()) ) {\r\n\t\t\t\t\t\tend_date = new Date(this._drag_start+1000);\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t\tthis._drag_id=this.uid();\r\n\t\t\t\tthis.addEvent(start_date, end_date, this.locale.labels.new_event, this._drag_id, pos.fields);\r\n\r\n\t\t\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\t\t\tthis._loading=false;\r\n\t\t\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar timeStep = this.config.time_step;\r\n\t\t\tvar ev=this.getEvent(this._drag_id);\r\n\t\t\tvar obj;\r\n\t\t\tif (scheduler.matrix)\r\n\t\t\t\tobj = scheduler.matrix[scheduler._mode];\r\n\t\t\tobj = obj || { x_step:1, x_unit:\"day\" };\r\n\r\n\t\t\tif (this._drag_mode==\"move\"){\r\n\t\t\t\tstart = this._min_date.valueOf()+(pos.y*this.config.time_step+pos.x*24*60)*60000;\r\n\t\t\t\tif (!pos.custom && this._table_view) {\r\n\t\t\t\t\tstart += this.date.time_part(ev.start_date) * 1000;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!this._table_view && this._dragEventBody && this._drag_event._move_event_shift === undefined) {\r\n\t\t\t\t\tthis._drag_event._move_event_shift = start - ev.start_date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this._drag_event._move_event_shift) {\r\n\t\t\t\t\tstart -= this._drag_event._move_event_shift;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstart = this._correct_shift(start);\r\n\r\n\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view && obj){\r\n\r\n\t\t\t\t\tstart = scheduler._correct_drag_start_date(start);\r\n\t\t\t\t\tend = scheduler._correct_drag_end_date(start,this._drag_event._event_length);\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tend = ev.end_date.valueOf()-(ev.start_date.valueOf()-start);\r\n\t\t\t} else { // resize\r\n\t\t\t\tstart = ev.start_date.valueOf();\r\n\t\t\t\tend = ev.end_date.valueOf();\r\n\t\t\t\tif (this._table_view) {\r\n\t\t\t\t\tvar resize_date = this._min_date.valueOf()+pos.y*this.config.time_step*60000 + (pos.custom?0:24*60*60000);\r\n\t\t\t\t\tif (this._mode == \"month\") {\r\n\t\t\t\t\t\tresize_date = this._correct_shift(resize_date, false);\r\n\t\t\t\t\t\tif( this._drag_from_start ) {\r\n\t\t\t\t\t\t\tvar day = 24*60*60000;\r\n\t\t\t\t\t\t\tif( resize_date <= scheduler.date.date_part(new Date(end+day-1)).valueOf() ) // to get end time as 23:59:59 and then the day start\r\n\t\t\t\t\t\t\t\tstart = resize_date - day;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(this.config.preserve_length) {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = scheduler._correct_drag_start_date(resize_date);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = scheduler._correct_drag_end_date(resize_date, 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif (pos.resize_from_start) {\r\n\t\t\t\t\t\t\t\tstart = resize_date;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tend = resize_date;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar end_day_start = this.date.date_part(new Date(ev.end_date.valueOf() - 1)).valueOf();\r\n\t\t\t\t\tvar end_day_date = new Date(end_day_start);\r\n\t\t\t\t\tvar firstHour = this.config.first_hour;\r\n\t\t\t\t\tvar lastHour = this.config.last_hour;\r\n\t\t\t\t\tvar maxY = (lastHour - firstHour) * (60/timeStep);\r\n\r\n\t\t\t\t\tthis.config.time_step = 1;\r\n\t\t\t\t\tvar precisePos = this._mouse_coords(e);\r\n\t\t\t\t\tthis.config.time_step = timeStep;\r\n\r\n\t\t\t\t\tvar minDate = pos.y*timeStep*60000;\r\n\t\t\t\t\tvar maxDate = Math.min(pos.y + 1, maxY)*timeStep*60000;\r\n\t\t\t\t\tvar preciseDate = precisePos.y*60000;\r\n\r\n\t\t\t\t\t// rounding end date to the closest time step\r\n\t\t\t\t\tif(Math.abs(minDate - preciseDate) > Math.abs(maxDate - preciseDate)){\r\n\t\t\t\t\t\tend = end_day_start + maxDate;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = end_day_start + minDate;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = end + ((new Date(end)).getTimezoneOffset() - end_day_date.getTimezoneOffset()) * 60000;\r\n\t\t\t\t\tthis._els[\"dhx_cal_data\"][0].style.cursor=\"s-resize\";\r\n\t\t\t\t\tif (this._mode == \"week\" || this._mode == \"day\")\r\n\t\t\t\t\t\tend = this._correct_shift(end);\r\n\t\t\t\t}\r\n\t\t\t\tif (this._drag_mode == \"new-size\") {\r\n\t\t\t\t\tif (end <= this._drag_start){\r\n\t\t\t\t\t\tvar shift = pos.shift||((this._table_view && !pos.custom)?24*60*60000:0);\r\n\t\t\t\t\t\tstart = end-(pos.shift?0:shift);\r\n\t\t\t\t\t\tend = this._drag_start+(shift||(timeStep*60000));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tstart = this._drag_start;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (end<=start)\r\n\t\t\t\t\t\tend=start+timeStep*60000;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar new_end = new Date(end-1);\r\n\t\t\tvar new_start = new Date(start);\r\n\t\t\t//deny drag out of visible scheduler scale in timeline view\r\n\t\t\tif(this._drag_mode==\"move\" && scheduler.config.limit_drag_out &&\r\n\t\t\t\t(+new_start < +scheduler._min_date || +end > +scheduler._max_date)){\r\n\r\n\t\t\t\tif(+ev.start_date < +scheduler._min_date || +ev.end_date > +scheduler._max_date){\r\n\t\t\t\t\t// not move event if it's already outside time scale\r\n\t\t\t\t\tnew_start = new Date(ev.start_date);\r\n\t\t\t\t\tend = new Date(ev.end_date);\r\n\t\t\t\t}else{\r\n\r\n\t\t\t\t\tvar duration = end - new_start;\r\n\r\n\t\t\t\t\tif(+new_start < +scheduler._min_date){\r\n\t\t\t\t\t\tnew_start = new Date(scheduler._min_date);\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tnew_start = new Date(scheduler._correct_drag_start_date(new_start));\r\n\t\t\t\t\t\t\tif(obj._start_correction)\r\n\t\t\t\t\t\t\t\tnew_start = new Date(new_start.valueOf() + obj._start_correction);\r\n\t\t\t\t\t\t\tend = new Date(new_start*1 + this._get_fictional_event_length(new_start, this._drag_event._event_length, obj));\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tend = new Date(+new_start + duration);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tend = new Date(scheduler._max_date);\r\n\r\n\t\t\t\t\t\tif (pos._ignores && this.config.preserve_length && this._table_view){\r\n\t\t\t\t\t\t\tif(obj._end_correction)\r\n\t\t\t\t\t\t\t\tend = new Date(end.valueOf() - obj._end_correction);\r\n\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\tnew_start = new Date(end*1 - this._get_fictional_event_length(end, this._drag_event._event_length, obj, true));\r\n\t\t\t\t\t\t\tif(this._ignores_detected){\r\n\t\t\t\t\t\t\t\tnew_start = scheduler.date.add(new_start, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t\tend = new Date(end*1 - this._get_fictional_event_length(end, 0, obj, true));\r\n\t\t\t\t\t\t\t\tend = scheduler.date.add(end, obj.x_step, obj.x_unit);\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\tvar new_end = new Date(end-1);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view && this._dragEventBody &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler._get_section_view() && pos.x != this._get_event_sday({start_date: new Date(start), end_date:new Date(start)})) || new Date(start).getHours() < this.config.first_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tif (this._drag_mode == \"move\") {\r\n\t\t\t\t\tvar day = this._min_date.valueOf() + (pos.x * 24 * 60) * 60000;\r\n\t\t\t\t\tnew_start = new Date(day);\r\n\t\t\t\t\tnew_start.setHours(this.config.first_hour);\r\n\t\t\t\t\tend = new Date(new_start.valueOf() + duration);\r\n\t\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// fix event dates when resized to bottom of the column (day/week views)\r\n\t\t\tif(!this._table_view &&\r\n\t\t\t\t!scheduler.config.all_timed &&\r\n\t\t\t\t((!scheduler.getView() && pos.x != this._get_event_sday({start_date: new Date(end), end_date:new Date(end)})) || new Date(end).getHours() >= this.config.last_hour)){\r\n\t\t\t\tvar duration = end - new_start;\r\n\t\t\t\tvar day = this._min_date.valueOf()+(pos.x*24*60)*60000;\r\n\t\t\t\tend = scheduler.date.date_part(new Date(day));\r\n\t\t\t\tend.setHours(this.config.last_hour);\r\n\t\t\t\tnew_end = new Date(end-1);\r\n\t\t\t\tif(this._drag_mode == \"move\"){\r\n\t\t\t\t\tnew_start = new Date(+end - duration);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//prevent out-of-borders situation for day|week view\r\n\t\t\tif ( this._table_view || (new_end.getDate()==new_start.getDate() && new_end.getHours()
=ed)\r\n\t\t\t\tcls += ' dhx_after';\r\n\t\t\telse if (sd.valueOf()==cd.valueOf())\r\n\t\t\t\tcls += ' dhx_now';\r\n\r\n\t\t\tif (this._ignores_detected && this._ignores[j]){\r\n\t\t\t\tcls += \" dhx_scale_ignore\";\r\n\t\t\t}\r\n\r\n\t\t\tcell.className = cls + \" \" + this.templates.month_date_class(sd, cd);\r\n\r\n\t\t\tcell.setAttribute(\"data-cell-date\", scheduler.templates.format_date(sd));\r\n\t\t\tvar body_class = \"dhx_month_body\";\r\n\t\t\tvar head_class = \"dhx_month_head\";\r\n\t\t\tif (j === 0 && this.config.left_border) {\r\n\t\t\t\tbody_class += \" dhx_month_body_border\";\r\n\t\t\t\thead_class += \" dhx_month_head_border\";\r\n\t\t\t}\r\n\t\t\tif (!this._ignores_detected || !this._ignores[j]){\r\n\t\t\t\tcell.style.width = tdwidths[j];\r\n\t\t\t\tthis._waiAria.monthCellAttr(cell, sd);\r\n\r\n\t\t\t\tvar cellHead = document.createElement(\"div\");\r\n\t\t\t\tcellHead.style.height = scheduler.xy.month_head_height + \"px\";\r\n\t\t\t\tcellHead.className = head_class;\r\n\t\t\t\tcellHead.innerHTML = this.templates.month_day(sd);\r\n\t\t\t\tcell.appendChild(cellHead);\r\n\r\n\t\t\t\tvar cellBody = document.createElement(\"div\");\r\n\t\t\t\tcellBody.className = body_class;\r\n\t\t\t\t// cellBody.style.height = row_height + \"px\";\r\n\t\t\t\t// cellBody.style.width = tdwidths[j];\r\n\t\t\t\tcell.appendChild(cellBody);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t\tcell.appendChild(document.createElement(\"div\"));\r\n\t\t\t}\r\n\t\t\trendered_dates.push(sd);\r\n\t\t\tvar bf1 = sd.getDate();\r\n\t\t\tsd=this.date.add(sd,1,\"day\");\r\n\t\t\tif (sd.getDate() - bf1 > 1)\r\n\t\t\t\tsd = new Date(sd.getFullYear(), sd.getMonth(), bf1 + 1, 12, 0);\r\n\t\t}\r\n\r\n\t\tscheduler._colsS.heights[i] = cellheight;\r\n\t\tcellheight += getCellHeight(i);\r\n\t}\r\n\r\n\tthis._min_date = view_start;\r\n\tthis._max_date = sd;\r\n\r\n\tdiv.innerHTML = \"\";\r\n\tdiv.appendChild(table);\r\n\r\n\tthis._scales = {};\r\n\tvar cells = div.querySelectorAll('[data-cell-date]');\r\n\tcells.forEach((cell) => {\r\n\t\tconst date = scheduler.templates.parse_date(cell.getAttribute(\"data-cell-date\"));\r\n\t\tconst body = cell.querySelector(\".dhx_month_body\");\r\n\t\tthis._scales[+date] = body;\r\n\t\tthis.callEvent(\"onScaleAdd\", [this._scales[+date], date]);\r\n\t});\r\n\r\n\treturn this._max_date;\r\n};\r\n\r\nscheduler._reset_month_scale=function(b,dd,sd,rows){\r\n\t//recalculates rows height and redraws month layout\r\n\tvar ed=scheduler.date.add(dd,1,\"month\");\r\n\r\n\t//trim time part for comparison reasons\r\n\tvar cd = scheduler._currentDate();\r\n\tthis.date.date_part(cd);\r\n\tthis.date.date_part(sd);\r\n\r\n\trows = rows || Math.ceil(Math.round((ed.valueOf()-sd.valueOf()) / (60*60*24*1000) ) / 7);\r\n\r\n\tvar height = (Math.floor(b.clientHeight/rows) - this.xy.month_head_height);\r\n\r\n\tthis._colsS.height = height + this.xy.month_head_height;\r\n\tthis._colsS.heights = [];\r\n\r\n\treturn scheduler._render_month_scale(b, dd, sd, rows);\r\n\r\n};\r\n\r\nscheduler.getView = function (viewName) {\r\n\tif (!viewName) {\r\n\t\tviewName = scheduler.getState().mode;\r\n\t}\r\n\tif (scheduler.matrix && scheduler.matrix[viewName]) {\r\n\t\treturn scheduler.matrix[viewName];\r\n\t}\r\n\r\n\tif (scheduler._props && scheduler._props[viewName]) {\r\n\t\treturn scheduler._props[viewName];\r\n\t}\r\n\r\n\treturn null;\r\n};\r\n\r\nscheduler.getLabel = function(property, key) {\r\n\tvar sections = this.config.lightbox.sections;\r\n\tfor (var i=0; i scheduler.getState().max_date.valueOf()){\r\n\t\t\tendColumnIndex += getDaysDifference(endDate, scheduler.getState().max_date);\r\n\t\t}\r\n\t} else{\r\n\t\tendColumnIndex = Math.round(eventLength/60/60/1000/24);\r\n\t}\r\n\r\n\tvar last_column = true;\r\n\twhile (startColumnIndex < endColumnIndex){\r\n\t\tvar check = scheduler.date.add(endDate, -config.x_step, config.x_unit);\r\n\t\tif (ignore && ignore(endDate) && (!last_column || (last_column && ignore(check) ))){\r\n\t\t\teventLength -= (endDate-check);\r\n\r\n\t\t}else{\r\n\t\t\tlet excludedDuration = 0;\r\n\t\t\tconst intervalStart = new Date(Math.max(check.valueOf(), startDate.valueOf()));\r\n\t\t\tconst intervalEnd = endDate;\r\n\t\t\tconst leftCellCutOffStart = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.first_hour);\r\n\t\t\tconst leftCellCutOffEnd = new Date(intervalStart.getFullYear(), intervalStart.getMonth(), intervalStart.getDate(), config.last_hour||24);\r\n\t\t\tconst rightCellCutOffStart = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.first_hour);\r\n\t\t\tconst rightCellCutOffEnd = new Date(endDate.getFullYear(), endDate.getMonth(), endDate.getDate(), config.last_hour||24);\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += intervalEnd - rightCellCutOffEnd;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalEnd.valueOf() > rightCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += config._start_correction;\r\n\t\t\t} else {\r\n\t\t\t\texcludedDuration += intervalEnd.getHours()*60*60*1000 + intervalEnd.getMinutes()*60*1000;\r\n\t\t\t}\r\n\t\t\t// GS-2580: if the end date of the events is quals to the last_hour config, need to include that date\r\n\t\t\tif(intervalStart.valueOf() <= leftCellCutOffEnd.valueOf()){\r\n\t\t\t\texcludedDuration += config._end_correction;\r\n\t\t\t}\r\n\r\n\t\t\tif(intervalStart.valueOf() < leftCellCutOffStart.valueOf()){\r\n\t\t\t\texcludedDuration += (leftCellCutOffStart.valueOf() - intervalStart.valueOf());\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\teventLength -= excludedDuration;\r\n\t\t\tlast_column = false;\r\n\t\t}\r\n\t\tendDate = check;\r\n\t\tendColumnIndex--;\r\n\t}\r\n\treturn eventLength;\r\n};\r\nscheduler._get_fictional_event_length=function(end_date, ev_length, obj, back){\r\n\tvar sd = new Date(end_date);\r\n\tvar dir = back ? -1 : 1;\r\n\r\n\t//get difference caused by first|last hour\r\n\tif (obj._start_correction || obj._end_correction){\r\n\t\tvar today;\r\n\t\tif (back)\r\n\t\t\ttoday = (sd.getHours()*60+sd.getMinutes()) - (obj.first_hour||0)*60;\r\n\t\telse\r\n\t\t\ttoday = (obj.last_hour||0)*60 - (sd.getHours()*60+sd.getMinutes());\r\n\t\tvar per_day = (obj.last_hour - obj.first_hour)*60;\r\n\t\tvar days = Math.ceil( (ev_length / (60*1000) - today ) / per_day);\r\n\t\tif(days < 0) days = 0;\r\n\t\tev_length += days * (24*60 - per_day) * 60 * 1000;\r\n\t}\r\n\r\n\tvar fd = new Date(end_date*1+ev_length*dir);\r\n\tvar ignore = this[\"ignore_\"+this._mode];\r\n\r\n\tvar start_slot = 0,\r\n\t\tend_slot;\r\n\tif (obj.render){\r\n\t\tstart_slot = this._get_date_index(obj, sd);\r\n\t\tend_slot = this._get_date_index(obj, fd);\r\n\t} else{\r\n\t\tend_slot = Math.round(ev_length/60/60/1000/24);\r\n\t}\r\n\r\n\twhile (start_slot*dir <= end_slot*dir){\r\n\t\tvar check = scheduler.date.add(sd, obj.x_step*dir, obj.x_unit);\r\n\t\tif (ignore && ignore(sd)){\r\n\t\t\tev_length += (check-sd)*dir;\r\n\t\t\tend_slot += dir;\r\n\t\t}\r\n\r\n\t\tsd = check;\r\n\t\tstart_slot+=dir;\r\n\t}\r\n\r\n\treturn ev_length;\r\n};\r\n\r\nscheduler._get_section_view = function(){\r\n\treturn this.getView();\r\n};\r\n\r\nscheduler._get_section_property = function(){\r\n\tif(this.matrix && this.matrix[this._mode]){\r\n\t\treturn this.matrix[this._mode].y_property;\r\n\t}else if(this._props && this._props[this._mode]){\r\n\t\treturn this._props[this._mode].map_to;\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nscheduler._is_initialized = function(){\r\n\tvar state = this.getState();\r\n\treturn (this._obj && state.date && state.mode);\r\n};\r\nscheduler._is_lightbox_open = function(){\r\n\tvar state = this.getState();\r\n\treturn state.lightbox_id !== null && state.lightbox_id !== undefined;\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\t// eslint-disable-next-line no-control-regex\r\n\tvar htmlTags = new RegExp(\"<(?:.|\\n)*?>\", \"gm\");\r\n\tvar extraSpaces = new RegExp(\" +\", \"gm\");\r\n\r\n\tfunction stripHTMLLite(htmlText){\r\n\t\treturn (htmlText + \"\")\r\n\t\t\t.replace(htmlTags, \" \").\r\n\t\t\treplace(extraSpaces, \" \");\r\n\t}\r\n\r\n\tvar singleQuotes = new RegExp(\"'\", \"gm\");\r\n\tfunction escapeQuotes(text){\r\n\t\treturn (text + \"\").replace(singleQuotes, \"'\");\r\n\t}\r\n\r\n\tscheduler._waiAria = {\r\n\t\tgetAttributeString: function(attr){\r\n\t\t\tvar attributes = [\" \"];\r\n\t\t\tfor(var i in attr){\r\n\t\t\t\tif(typeof attr[i] != \"function\" && typeof attr[i] != \"object\") {\r\n\t\t\t\t\tvar text = escapeQuotes(stripHTMLLite(attr[i]));\r\n\t\t\t\t\tattributes.push(i + \"='\" + text + \"'\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tattributes.push(\" \");\r\n\t\t\treturn attributes.join(\" \");\r\n\t\t},\r\n\t\tsetAttributes: function(div, values){\r\n\t\t\tfor(var i in values){\r\n\t\t\t\tdiv.setAttribute(i, stripHTMLLite(values[i]));\r\n\t\t\t}\r\n\t\t\treturn div;\r\n\t\t},\r\n\r\n\t\tlabelAttr: function(div, content){\r\n\t\t\treturn this.setAttributes(div, {\"aria-label\": content});\r\n\t\t},\r\n\t\tlabel: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\t\t// day/week/units\r\n\r\n\t\thourScaleAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\r\n\t\t},\r\n\t\tmonthCellAttr: function(div, date){\r\n\t\t\tthis.labelAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\tnavBarDateAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\t\tdayHeaderAttr: function(div, content){\r\n\t\t\tthis.labelAttr(div, content);\r\n\t\t},\r\n\r\n\t\tdayColumnAttr: function(div, date){\r\n\t\t\tthis.dayHeaderAttr(div, scheduler.templates.day_date(date));\r\n\t\t},\r\n\r\n\t\theaderButtonsAttributes: function(div, label){\r\n\t\t\treturn this.setAttributes(div, {\"role\":\"button\", \"aria-label\":label});\r\n\t\t},\r\n\r\n\t\theaderToggleState: function(div, isActive){\r\n\t\t\treturn this.setAttributes(div, {\"aria-pressed\": isActive ? \"true\" : \"false\"});\r\n\t\t},\r\n\r\n\r\n\t\tgetHeaderCellAttr:function(dateString){\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": dateString});\r\n\t\t},\r\n\r\n\r\n\t\teventAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\r\n\t\t_eventCommonAttr: function(event, div){\r\n\t\t\tdiv.setAttribute(\"aria-label\", stripHTMLLite(scheduler.templates.event_text(event.start_date, event.end_date, event)));\r\n\r\n\t\t\tif(scheduler.config.readonly){\r\n\t\t\t\tdiv.setAttribute(\"aria-readonly\", true);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif(event.$dataprocessor_class){\r\n\t\t\t\tdiv.setAttribute(\"aria-busy\", true);\r\n\t\t\t}\r\n\r\n\r\n\t\t\tdiv.setAttribute(\"aria-selected\",\r\n\t\t\t\t(scheduler.getState().select_id == event.id) ? \"true\" : \"false\");\r\n\t\t},\r\n\r\n\t\tsetEventBarAttr: function(event, div){\r\n\t\t\tthis._eventCommonAttr(event, div);\r\n\t\t},\r\n\r\n\t\t_getAttributes: function(attributeSetter, arg){\r\n\t\t\tvar result = {\r\n\t\t\t\tsetAttribute:function(name, value){\r\n\t\t\t\t\tthis[name] = value;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tattributeSetter.apply(this, [arg, result]);\r\n\t\t\treturn result;\r\n\r\n\t\t},\r\n\r\n\t\teventBarAttrString: function(event){\r\n\t\t\treturn this.getAttributeString(this._getAttributes(this.setEventBarAttr, event));\r\n\t\t},\r\n\r\n\r\n\r\n\t\tagendaHeadAttrString :function(){\r\n\t\t\treturn this.getAttributeString({role: \"row\"});\r\n\t\t},\r\n\t\tagendaHeadDateString :function(label){\r\n\t\t\treturn this.getAttributeString({role: \"columnheader\", \"aria-label\": label});\r\n\t\t},\r\n\t\tagendaHeadDescriptionString :function(label){\r\n\t\t\treturn this.agendaHeadDateString(label);\r\n\t\t},\r\n\t\tagendaDataAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\t\tagendaEventAttrString: function(event){\r\n\t\t\tvar attrs = this._getAttributes(this._eventCommonAttr, event);\r\n\r\n\t\t\tattrs[\"role\"] = \"row\";\r\n\r\n\t\t\treturn this.getAttributeString(attrs);\r\n\r\n\t\t},\r\n\t\tagendaDetailsBtnString: function(){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels.icon_details});\r\n\t\t},\r\n\r\n\r\n\t\tgridAttrString: function(){\r\n\t\t\treturn this.getAttributeString({role: \"grid\"});\r\n\t\t},\r\n\r\n\t\tgridRowAttrString: function(event){\r\n\t\t\treturn this.agendaEventAttrString(event);\r\n\t\t},\r\n\r\n\t\tgridCellAttrString: function(event, column, value){\r\n\t\t\treturn this.getAttributeString({\"role\":\"gridcell\", \"aria-label\": [\r\n\t\t\t\t(column.label === undefined ? column.id : column.label),\r\n\t\t\t\t\": \",\r\n\t\t\t\tvalue\r\n\t\t\t]});\r\n\t\t},\r\n\r\n\t\tmapAttrString: function(){\r\n\t\t\treturn this.gridAttrString();\r\n\t\t},\r\n\t\tmapRowAttrString: function(event){\r\n\t\t\treturn this.gridRowAttrString(event);\r\n\t\t},\r\n\t\tmapDetailsBtnString: function(){\r\n\t\t\treturn this.agendaDetailsBtnString();\r\n\t\t},\r\n\r\n\t\tminicalHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\",\r\n\t\t\t\t\"aria-live\":\"assertice\",\r\n\t\t\t\t\"aria-atomic\":\"true\"\r\n\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalGrid: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"aria-labelledby\":headerId+\"\",\r\n\t\t\t\t\"role\":\"grid\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalRow: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"row\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalDayCell: function(div, date){\r\n\t\t\tvar selected = (date.valueOf() < scheduler._max_date.valueOf() && date.valueOf() >= scheduler._min_date.valueOf());\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\",\r\n\t\t\t\t\"aria-label\": scheduler.templates.day_date(date),\r\n\t\t\t\t\"aria-selected\": selected ? \"true\" : \"false\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tminicalHeadCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"columnheader\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\r\n\t\tweekAgendaDayCell: function(div, date){\r\n\t\t\tvar header = div.querySelector(\".dhx_wa_scale_bar\");\r\n\t\t\tvar content = div.querySelector(\".dhx_wa_day_data\");\r\n\t\t\tvar headerId = scheduler.uid() + \"\";\r\n\t\t\tthis.setAttributes(header, { \"id\": headerId});\r\n\t\t\tthis.setAttributes(content, { \"aria-labelledby\": headerId});\r\n\r\n\t\t},\r\n\t\tweekAgendaEvent: function(div, event){\r\n\t\t\tthis.eventAttr(event, div);\r\n\t\t},\r\n\r\n\t\tlightboxHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t},\r\n\r\n\t\tlightboxVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\tlightboxSectionButtonAttrString: function(label){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\tyearHeader: function(div, headerId){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"id\":headerId+\"\"\r\n\t\t\t});\r\n\t\t},\r\n\t\tyearGrid: function(div, headerId){\r\n\t\t\tthis.minicalGrid(div, headerId);\r\n\t\t},\r\n\t\tyearHeadCell: function(div){\r\n\t\t\treturn this.minicalHeadCell(div);\r\n\t\t},\r\n\t\tyearRow: function(div){\r\n\t\t\treturn this.minicalRow(div);\r\n\t\t},\r\n\t\tyearDayCell: function(div){\r\n\t\t\tthis.setAttributes(div, {\r\n\t\t\t\t\"role\":\"gridcell\"\r\n\t\t\t});\r\n\t\t},\r\n\r\n\t\tlightboxAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t\tdiv.firstChild.setAttribute(\"role\", \"heading\");\r\n\t\t},\r\n\r\n\t\tlightboxButtonAttrString:function(buttonName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[buttonName], \"tabindex\":\"0\"});\r\n\t\t},\r\n\t\teventMenuAttrString: function(iconName){\r\n\t\t\treturn this.getAttributeString({\"role\":\"button\", \"aria-label\":scheduler.locale.labels[iconName]});\r\n\t\t},\r\n\t\tlightboxHeader: function(div, headerText){\r\n\t\t\tdiv.setAttribute(\"aria-label\", headerText);\r\n\t\t},\r\n\r\n\t\tlightboxSelectAttrString: function(time_option){\r\n\t\t\tvar label = \"\";\r\n\r\n\t\t\tswitch (time_option) {\r\n\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.year;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%m\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.month;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%d\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.day;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\tlabel = scheduler.locale.labels.hour + \" \" + scheduler.locale.labels.minute;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"aria-label\": label});\r\n\t\t},\r\n\r\n\r\n\t\tmessageButtonAttrString: function(buttonLabel){\r\n\t\t\treturn \"tabindex='0' role='button' aria-label='\"+buttonLabel+\"'\";\r\n\t\t},\r\n\r\n\t\tmessageInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"alert\");\r\n\t\t\t//div.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tmessageModalAttr: function(div, uid){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t\tif(uid){\r\n\t\t\t\tdiv.setAttribute(\"aria-labelledby\", uid);\r\n\t\t\t}\r\n\r\n\t\t\t//\tdiv.setAttribute(\"tabindex\", \"-1\");\r\n\t\t},\r\n\r\n\t\tquickInfoAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"dialog\");\r\n\t\t},\r\n\r\n\t\tquickInfoHeaderAttrString: function(){\r\n\t\t\treturn \" role='heading' \";\r\n\t\t},\r\n\r\n\t\tquickInfoHeader: function(div, header){\r\n\t\t\tdiv.setAttribute(\"aria-label\", header);\r\n\t\t},\r\n\r\n\t\tquickInfoButtonAttrString: function(label){\r\n\t\t\treturn scheduler._waiAria.getAttributeString({\"role\":\"button\", \"aria-label\":label, \"tabindex\":\"0\"});\r\n\t\t},\r\n\r\n\t\ttooltipAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"role\", \"tooltip\");\r\n\t\t},\r\n\r\n\t\ttooltipVisibleAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"false\");\r\n\t\t},\r\n\r\n\t\ttooltipHiddenAttr: function(div){\r\n\t\t\tdiv.setAttribute(\"aria-hidden\", \"true\");\r\n\t\t}\r\n\t};\r\n\r\n\tfunction isDisabled(){\r\n\t\treturn !scheduler.config.wai_aria_attributes;\r\n\t}\r\n\r\n\tfor(var i in scheduler._waiAria){\r\n\t\tscheduler._waiAria[i] = (function(payload){\r\n\t\t\treturn function(){\r\n\t\t\t\tif(isDisabled()){\r\n\t\t\t\t\treturn \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn payload.apply(this, arguments);\r\n\t\t\t};\r\n\t\t})(scheduler._waiAria[i]);\r\n\t}\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\treturn function assert(check, message){\r\n\t\tif (!check){\r\n\t\t\tif(scheduler.config.show_errors && scheduler.callEvent(\"onError\",[message]) !== false) {\r\n\t\t\t\tif (scheduler.message) {\r\n\t\t\t\t\tscheduler.message({type: \"error\", text: message, expire: -1});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\t\tconsole.log(message);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// eslint-disable-next-line no-debugger\r\n\t\t\t\tdebugger;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n}","export default function extend(scheduler) {\r\n\r\nif (window.jQuery){\r\n\r\n(function( $ ){\r\n\tvar counter = 0;\r\n\tvar methods = [];\r\n\t$.fn.dhx_scheduler = function(config){\r\n\t\tif (typeof(config) === 'string') {\r\n\t\t\tif (methods[config] ) {\r\n\t\t\t\treturn methods[config].apply(this, []);\r\n\t\t\t}else {\r\n\t\t\t\t$.error('Method ' + config + ' does not exist on jQuery.dhx_scheduler');\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar views = [];\r\n\t\t\tthis.each(function() {\r\n\t\t\t\tif (this && this.getAttribute){\r\n\t\t\t\t\tif (!this.getAttribute(\"dhxscheduler\")){\r\n\t\t\t\t\t\tvar name = \"scheduler\";\r\n\t\t\t\t\t\tif (counter){\r\n\t\t\t\t\t\t\tname = \"scheduler\" + (counter+1);\r\n\t\t\t\t\t\t\twindow[name] = Scheduler.getSchedulerInstance();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar comp = window[name];\r\n\r\n\t\t\t\t\t\tthis.setAttribute(\"dhxscheduler\", name);\r\n\t\t\t\t\t\tfor (var key in config)\r\n\t\t\t\t\t\t\tif (key!=\"data\")\r\n\t\t\t\t\t\t\t\tcomp.config[key] = config[key];\r\n\r\n\t\t\t\t\t\tif (!this.getElementsByTagName(\"div\").length){\r\n\t\t\t\t\t\t\tthis.innerHTML = '
';\r\n\t\t\t\t\t\t\tthis.className += \" dhx_cal_container\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcomp.init(this, comp.config.date, comp.config.mode);\r\n\t\t\t\t\t\tif (config.data)\r\n\t\t\t\t\t\t\tcomp.parse(config.data);\r\n\r\n\t\t\t\t\t\tviews.push(comp);\r\n\t\t\t\t\t\tcounter++;\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t\tviews.push(window[this.getAttribute(\"dhxscheduler\")]);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (views.length === 1) return views[0];\r\n\t\t\treturn views;\r\n\t\t}\r\n\t};\r\n\r\n\r\n\r\n\r\n})(window.jQuery);\r\n\r\n}\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.destructor = function(){\r\n\tscheduler.callEvent(\"onDestroy\", []);\r\n\tthis.clearAll();\r\n\r\n\tif(this.$container){\r\n\t\t// FIXME: clear container or remove container\r\n\t\tthis.$container.innerHTML = \"\";\r\n\t\t// scheduler.$domHelpers.remove(this.$container);\r\n\t}\r\n\r\n\tif(this._eventRemoveAll){\r\n\t\tthis._eventRemoveAll();\r\n\t}\r\n\r\n\tif(this.resetLightbox){\r\n\t\tthis.resetLightbox();\r\n\t}\r\n\r\n\tif(this._dp && this._dp.destructor){\r\n\t\tthis._dp.destructor();\r\n\t}\r\n\r\n\t// detachAllEvents should be called last, because in components may be attached events\r\n\tthis.detachAllEvents();\r\n\r\n\tfor(var i in this){\r\n\t\tif(i.indexOf(\"$\") === 0){\r\n\t\t\tdelete this[i];\r\n\t\t}\r\n\t}\r\n\tscheduler.$destroyed = true;\r\n};\r\n\r\n}","import serialize from \"../common/url_serialize.js\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\nscheduler.Promise = window.Promise; \r\n\r\nfunction createConfig(method, args) {\r\n\tvar result = {\r\n\t\tmethod: method\r\n\t};\r\n\r\n\tif (args.length === 0) {\r\n\t\tthrow new Error(\"Arguments list of query is wrong.\");\r\n\t}\r\n\tif (args.length === 1) {\r\n\t\tif (typeof args[0] === \"string\") {\r\n\t\t\tresult.url = args[0];\r\n\t\t\tresult.async = true;\r\n\t\t} else {\r\n\t\t\tresult.url = args[0].url;\r\n\t\t\tresult.async = (args[0].async || true);\r\n\t\t\tresult.callback = args[0].callback;\r\n\t\t\tresult.headers = args[0].headers;\r\n\t\t}\r\n\t\tif (method === \"POST\" || \"PUT\") {\r\n\t\t\tif (args[0].data) {\r\n\t\t\t\tif (typeof args[0].data !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[0].data);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[0].data;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\r\n\tresult.url = args[0];\r\n\tswitch(method) {\r\n\t\tcase \"GET\":\r\n\t\tcase \"DELETE\":\r\n\t\t\tresult.callback = args[1];\r\n\t\t\tresult.headers = args[2];\r\n\t\tbreak;\r\n\t\tcase \"POST\":\r\n\t\tcase \"PUT\":\r\n\t\t\tif (args[1]) {\r\n\t\t\t\tif (typeof args[1] !== \"string\") {\r\n\t\t\t\t\tresult.data = serialize(args[1]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tresult.data = args[1];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tresult.data = \"\";\r\n\t\t\t}\r\n\t\t\tresult.callback = args[2];\r\n\t\t\tresult.headers = args[3];\r\n\t\tbreak;\r\n\t}\r\n\treturn result;\r\n}\r\nscheduler.ajax = {\r\n\t// if false - dhxr param will added to prevent caching on client side (default),\r\n\t// if true - do not add extra params\r\n\tcache: true,\r\n\r\n\t// default method for load/loadStruct, post/get allowed\r\n\tmethod: \"get\",\r\n\r\n\tserializeRequestParams: serialize,\r\n\tparse: function(data) {\r\n\t\tif (typeof data !== \"string\") return data;\r\n\r\n\t\tvar obj;\r\n\t\tdata = data.replace(/^[\\s]+/,\"\");\r\n\t\tif (typeof DOMParser !== \"undefined\" && !scheduler.$env.isIE) { // ff,ie9\r\n\t\t\tobj = (new DOMParser()).parseFromString(data, \"text/xml\");\r\n\t\t} else if (typeof window.ActiveXObject !== \"undefined\") {\r\n\t\t\tobj = new window.ActiveXObject(\"Microsoft.XMLDOM\");\r\n\t\t\tobj.async = \"false\";\r\n\t\t\tobj.loadXML(data);\r\n\t\t}\r\n\t\treturn obj;\r\n\t},\r\n\txmltop: function(tagname, xhr, obj) {\r\n\t\tif (typeof xhr.status == \"undefined\" || xhr.status < 400) {\r\n\t\t\tvar xml = (!xhr.responseXML) ? this.parse(xhr.responseText || xhr) : (xhr.responseXML || xhr);\r\n\t\t\tif (xml && xml.documentElement !== null && !xml.getElementsByTagName(\"parsererror\").length) {\r\n\t\t\t\treturn xml.getElementsByTagName(tagname)[0];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (obj !== -1) scheduler.callEvent(\"onLoadXMLError\",[\"Incorrect XML\", arguments[1], obj]);\r\n\t\treturn document.createElement(\"DIV\");\r\n\t},\r\n\txpath: function(xpathExp, docObj) {\r\n\t\tif (!docObj.nodeName) docObj = docObj.responseXML || docObj;\r\n\t\tif (scheduler.$env.isIE) {\r\n\t\t\treturn docObj.selectNodes(xpathExp)||[];\r\n\t\t} else {\r\n\t\t\tvar rows = [];\r\n\t\t\tvar first;\r\n\t\t\tvar col = (docObj.ownerDocument||docObj).evaluate(xpathExp, docObj, null, XPathResult.ANY_TYPE, null);\r\n\r\n\t\t\twhile (true){\r\n\t\t\t\tfirst = col.iterateNext();\r\n\t\t\t\tif(first){\r\n\t\t\t\t\trows.push(first);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn rows;\r\n\t\t}\r\n\t},\r\n\tquery: function(config) {\r\n\t\treturn this._call(\r\n\t\t\t(config.method || \"GET\"),\r\n\t\t\tconfig.url,\r\n\t\t\tconfig.data || \"\",\r\n\t\t\t(config.async || true),\r\n\t\t\tconfig.callback,\r\n\t\t\tconfig.headers\r\n\t\t);\r\n\t},\r\n\tget: function(url, onLoad, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tgetSync: function(url, headers) {\r\n\t\tvar config = createConfig(\"GET\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\tput: function(url, postData, onLoad, headers) {\r\n\t\tvar config = createConfig(\"PUT\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tdel: function(url, onLoad, headers) {\r\n\t\t/**\r\n\t\t * https://tools.ietf.org/html/rfc7231#section-4.3.5\r\n\t\t * A payload within a DELETE request message has no defined semantics;\r\n\t\t * sending a payload body on a DELETE request might cause some existing\r\n\t\t * implementations to reject the request.\r\n\t\t */\r\n\t\tvar config = createConfig(\"DELETE\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpost: function(url, postData, onLoad, headers) {\r\n\t\tif (arguments.length == 1) {\r\n\t\t\tpostData = \"\";\r\n\t\t} else if (arguments.length == 2 && typeof(postData) == \"function\") {\r\n\t\t\tonLoad = postData;\r\n\t\t\tpostData = \"\";\r\n\t\t}\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\treturn this.query(config);\r\n\t},\r\n\tpostSync: function(url, postData, headers) {\r\n\t\tpostData = (postData === null ? \"\" : String(postData));\r\n\r\n\t\tvar config = createConfig(\"POST\", arguments);\r\n\t\tconfig.async = false;\r\n\t\treturn this.query(config);\r\n\t},\r\n\t_call: function(method, url, postData, async, onLoad, headers) {\r\n\t\treturn new scheduler.Promise((function(resolve, reject) {\r\n\t\t\tvar t = (typeof XMLHttpRequest !== undefined && !scheduler.$env.isIE ? new XMLHttpRequest() : new window.ActiveXObject(\"Microsoft.XMLHTTP\"));\r\n\t\t\tvar isQt = (navigator.userAgent.match(/AppleWebKit/) !== null && navigator.userAgent.match(/Qt/) !== null && navigator.userAgent.match(/Safari/) !== null);\r\n\r\n\t\t\tif (!!async) {\r\n\t\t\t\tt.addEventListener(\"readystatechange\", function() {\r\n\t\t\t\t\tif ((t.readyState == 4) || (isQt && t.readyState == 3)) { // what for long response and status 404?\r\n\t\t\t\t\t\tif (t.status != 200 || t.responseText === \"\")\r\n\t\t\t\t\t\t\tif (!scheduler.callEvent(\"onAjaxError\", [t])) return;\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad.apply(window, [{xmlDoc:t, filePath:url}]); // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tresolve(t);\r\n\t\t\t\t\t\t\tif (typeof(onLoad) == \"function\") {\r\n\t\t\t\t\t\t\t\tonLoad = null;\r\n\t\t\t\t\t\t\t\tt = null;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (method == \"GET\" && !this.cache) {\r\n\t\t\t\turl += (url.indexOf(\"?\")>=0?\"&\":\"?\")+\"dhxr\"+new Date().getTime()+\"=1\";\r\n\t\t\t}\r\n\r\n\t\t\tt.open(method, url, async);\r\n\r\n\t\t\tif (headers){\r\n\t\t\t\tfor (var key in headers)\r\n\t\t\t\t\tt.setRequestHeader(key, headers[key]);\r\n\t\t\t} else if (method.toUpperCase() == \"POST\" || method == \"PUT\" || method == \"DELETE\") {\r\n\t\t\t\tt.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n\t\t\t} else if (method == \"GET\") {\r\n\t\t\t\tpostData = null;\r\n\t\t\t}\r\n\r\n\t\t\tt.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n\r\n\t\t\tt.send(postData);\r\n\r\n\t\t\tif (!async) return {xmlDoc:t, filePath:url}; // dhtmlx-compat, response.xmlDoc.responseXML/responseText\r\n\t\t}.bind(this)));\r\n\t},\r\n\turlSeparator: function(str){\r\n\t\tif (str.indexOf(\"?\") != -1)\r\n\t\t\treturn \"&\";\r\n\t\telse\r\n\t\t\treturn \"?\";\r\n\t}\r\n};\r\n\r\nscheduler.$ajax = scheduler.ajax; // for old\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n/*\r\n%e\tDay of the month without leading zeros (01..31)\r\n%d\tDay of the month, 2 digits with leading zeros (01..31)\r\n%j\tDay of the year, 3 digits with leading zeros (001..366)\r\n%a\tA textual representation of a day, two letters\r\n%W\tA full textual representation of the day of the week\r\n\r\n%c\tNumeric representation of a month, without leading zeros (0..12)\r\n%m\tNumeric representation of a month, with leading zeros (00..12)\r\n%b\tA short textual representation of a month, three letters (Jan..Dec)\r\n%M\tA full textual representation of a month, such as January or March (January..December)\r\n\r\n%y\tA two digit representation of a year (93..03)\r\n%Y\tA full numeric representation of a year, 4 digits (1993..03)\r\n*/\r\n\r\nscheduler.config={\r\n\tdefault_date: \"%j %M %Y\",\r\n\tmonth_date: \"%F %Y\",\r\n\tload_date: \"%Y-%m-%d\",\r\n\tweek_date: \"%l\",\r\n\tday_date: \"%D %j\",\r\n\thour_date: \"%H:%i\",\r\n\tmonth_day: \"%d\",\r\n\t//xml_date: \"%m/%d/%Y %H:%i\",\r\n\tdate_format: \"%Y-%m-%d %H:%i\",\r\n\tapi_date: \"%d-%m-%Y %H:%i\",\r\n\tparse_exact_format: false,\r\n\tpreserve_length:true,\r\n\ttime_step: 5,\r\n\tdisplayed_event_color: \"#ff4a4a\",\r\n\tdisplayed_event_text_color: \"#ffef80\",\r\n\twide_form: 0,\r\n\tday_column_padding: 8,\r\n\tuse_select_menu_space: true,\r\n\tfix_tab_position: true,\r\n\tstart_on_monday: true,\r\n\tfirst_hour: 0,\r\n\tlast_hour: 24,\r\n\treadonly: false,\r\n\tdrag_resize: true,\r\n\tdrag_move: true,\r\n\tdrag_create: true,\r\n\tdrag_event_body: true,\r\n\tdblclick_create: true,\r\n\tdetails_on_dblclick: true,\r\n\tedit_on_create: true,\r\n\tdetails_on_create: true,\r\n\theader: null,\r\n\thour_size_px: 44,\r\n\tresize_month_events:false,\r\n\tresize_month_timed:false,\r\n\tresponsive_lightbox: false,\r\n\tseparate_short_events: true,\r\n\trtl:false,\r\n\r\n\tcascade_event_display: false,\r\n\tcascade_event_count: 4,\r\n\tcascade_event_margin: 30,\r\n\r\n\tmulti_day:true,\r\n\tmulti_day_height_limit: 200,\r\n\r\n\tdrag_lightbox: true,\r\n\tpreserve_scroll: true,\r\n\tselect: true,\r\n\tundo_deleted: true,\r\n\tserver_utc: false,\r\n\ttouch:true,\r\n\ttouch_tip:true,\r\n\ttouch_drag:500,\r\n\ttouch_swipe_dates: false,\r\n\tquick_info_detached:true,\r\n\r\n\tpositive_closing: false,\r\n\t//header_datepicker: true,\r\n\tdrag_highlight: true,\r\n\tlimit_drag_out: false,\r\n\ticons_edit: [\"icon_save\", \"icon_cancel\"],\r\n\ticons_select: [\"icon_details\", \"icon_edit\", \"icon_delete\"],\r\n\tbuttons_left: [\"dhx_save_btn\", \"dhx_cancel_btn\"],\r\n\tbuttons_right: [\"dhx_delete_btn\"],\r\n\tlightbox: {\r\n\t\tsections: [\r\n\t\t\t{name: \"description\", map_to: \"text\", type: \"textarea\", focus: true},\r\n\t\t\t{name: \"time\", height: 72, type: \"time\", map_to: \"auto\"}\r\n\t\t]\r\n\t},\r\n\thighlight_displayed_event: true,\r\n\tleft_border: false,\r\n\r\n\tajax_error: \"alert\",//\"ignore\"|\"console\"\r\n\tdelay_render: 0,\r\n\ttimeline_swap_resize: true,\r\n\twai_aria_attributes: true,\r\n\twai_aria_application_role: true,\r\n\r\n\tcsp: \"auto\",\r\n\tevent_attribute: \"data-event-id\",\r\n\tshow_errors: true\r\n};\r\n\r\nscheduler.config.buttons_left.$initial = scheduler.config.buttons_left.join();\r\nscheduler.config.buttons_right.$initial = scheduler.config.buttons_right.join();\r\n\r\nscheduler._helpers = {\r\n\tparseDate: function parseDate(date) {\r\n\t\tvar parse = scheduler.templates.xml_date || scheduler.templates.parse_date;\r\n\t\treturn parse(date);\r\n\t},\r\n\tformatDate: function formatDate(date) {\r\n\t\tvar format = scheduler.templates.xml_format || scheduler.templates.format_date;\r\n\t\treturn format(date);\r\n\t}\r\n};\r\n\r\nscheduler.templates={};\r\nscheduler.init_templates=function(){\r\n\r\n\r\n\r\n\tvar d=scheduler.date.date_to_str;\r\n\tvar c=scheduler.config;\r\n\tvar f = function(a,b){\r\n\t\tfor (var c in b)\r\n\t\t\tif (!a[c]) a[c]=b[c];\r\n\t};\r\n\tf(scheduler.templates,{\r\n\t\tday_date:d(c.default_date),\r\n\t\tmonth_date:d(c.month_date),\r\n\t\tweek_date:function(d1,d2){\r\n\t\t\tif(c.rtl) {\r\n\t\t\t\treturn scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"))+\" – \"+scheduler.templates.day_date(d1);\r\n\t\t\t} \r\n\t\t\treturn scheduler.templates.day_date(d1)+\" – \"+scheduler.templates.day_date(scheduler.date.add(d2,-1,\"day\"));\r\n\t\t},\r\n\t\tday_scale_date:d(c.default_date),\r\n\t\ttime_slot_text: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\ttime_slot_class: function(date){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\r\n\t\tmonth_scale_date:d(c.week_date),\r\n\t\tweek_scale_date:d(c.day_date),\r\n\t\thour_scale:d(c.hour_date),\r\n\t\ttime_picker:d(c.hour_date),\r\n\t\tevent_date:d(c.hour_date),\r\n\t\tmonth_day:d(c.month_day),\r\n\r\n\t\tload_format: d(c.load_date),\r\n\t//\txml_date:scheduler.date.str_to_date(c.xml_date,c.server_utc),\r\n\t//\txml_format:d(c.date_format,c.server_utc),\r\n\t\tformat_date: d(c.date_format, c.server_utc),\r\n\t\tparse_date:scheduler.date.str_to_date(c.date_format,c.server_utc),\r\n\t\tapi_date:scheduler.date.str_to_date(c.api_date, false, false),\r\n\t\tevent_header:function(start,end,ev){\r\n\r\n\t\t\tif(ev._mode === \"small\" || ev._mode === \"smallest\"){\r\n\t\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.templates.event_date(start)+\" - \"+scheduler.templates.event_date(end);\r\n\t\t\t}\r\n\t\t},\r\n\t\tevent_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tevent_class:function(start,end,ev){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tmonth_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tweek_date_class:function(d){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tevent_bar_date:function(start,end,ev) {\r\n\t\t\treturn scheduler.templates.event_date(start);\r\n\t\t},\r\n\t\tevent_bar_text:function(start,end,ev){\r\n\t\t\treturn ev.text;\r\n\t\t},\r\n\t\tmonth_events_link : function(date, count){\r\n\t\t\treturn \"View more(\"+count+\" events) \";\r\n\t\t},\r\n\t\tdrag_marker_class : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\tdrag_marker_content : function(start, end, event){\r\n\t\t\treturn \"\";\r\n\t\t},\r\n\t\t/* Could be redifined */\r\n\t\ttooltip_date_format: scheduler.date.date_to_str(\"%Y-%m-%d %H:%i\"),\r\n\t\ttooltip_text: function(start, end, event) {\r\n\t\t\treturn \"Event: \" + event.text + \"Start date: \" + scheduler.templates.tooltip_date_format(start) + \"End date: \" + scheduler.templates.tooltip_date_format(end);\r\n\t\t},\r\n\r\n\t\tcalendar_month: d(\"%F %Y\"),\r\n\t\tcalendar_scale_date: d(\"%D\"),\r\n\t\tcalendar_date: d(\"%d\"),\r\n\t\tcalendar_time: d(\"%d-%m-%Y\")\r\n\r\n\t});\r\n\tthis.callEvent(\"onTemplatesReady\",[]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._events = {};\r\nscheduler.clearAll = function() {\r\n\tthis._events = {};\r\n\tthis._loaded = {};\r\n\r\n\tthis._edit_id = null;\r\n\tthis._select_id = null;\r\n\tthis._drag_id = null;\r\n\tthis._drag_mode = null;\r\n\tthis._drag_pos = null;\r\n\tthis._new_event = null;\r\n\r\n\tthis.clear_view();\r\n\tthis.callEvent(\"onClearAll\", []);\r\n};\r\nscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\tif (!arguments.length)\r\n\t\treturn this.addEventNow();\r\n\tvar ev = start_date;\r\n\tif (arguments.length != 1) {\r\n\t\tev = extra_data || {};\r\n\t\tev.start_date = start_date;\r\n\t\tev.end_date = end_date;\r\n\t\tev.text = text;\r\n\t\tev.id = id;\r\n\t}\r\n\tev.id = ev.id || scheduler.uid();\r\n\tev.text = ev.text || \"\";\r\n\r\n\tif (typeof ev.start_date == \"string\") ev.start_date = this.templates.api_date(ev.start_date);\r\n\tif (typeof ev.end_date == \"string\") ev.end_date = this.templates.api_date(ev.end_date);\r\n\tvar d = (this.config.event_duration || this.config.time_step) * 60000;\r\n\tif (ev.start_date.valueOf() == ev.end_date.valueOf())\r\n\t\tev.end_date.setTime(ev.end_date.valueOf() + d);\r\n\r\n\tev.start_date.setMilliseconds(0);\r\n\tev.end_date.setMilliseconds(0);\r\n\r\n\tev._timed = this.isOneDayEvent(ev);\r\n\r\n\tvar is_new = !this._events[ev.id];\r\n\tthis._events[ev.id] = ev;\r\n\tthis.event_updated(ev);\r\n\tif (!this._loading)\r\n\t\tthis.callEvent(is_new ? \"onEventAdded\" : \"onEventChanged\", [ev.id, ev]);\r\n\treturn ev.id;\r\n};\r\nscheduler.deleteEvent = function(id, silent) {\r\n\tvar ev = this._events[id];\r\n\tif (!silent && (!this.callEvent(\"onBeforeEventDelete\", [id, ev]) || !this.callEvent(\"onConfirmedBeforeEventDelete\", [id, ev])))\r\n\t\treturn;\r\n\tif (ev) {\r\n\t\tif(scheduler.getState().select_id == id){\r\n\t\t\tscheduler.unselect();\r\n\t\t}\r\n\t\tdelete this._events[id];\r\n\t\tthis.event_updated(ev);\r\n\r\n\t\tif(this._drag_id == ev.id){\r\n\t\t\tthis._drag_id = null;\r\n\t\t\tthis._drag_mode=null;\r\n\t\t\tthis._drag_pos=null;\r\n\t\t}\r\n\t}\r\n\r\n\tthis.callEvent(\"onEventDeleted\", [id, ev]);\r\n};\r\nscheduler.getEvent = function(id) {\r\n\treturn this._events[id];\r\n};\r\nscheduler.setEvent = function(id, hash) {\r\n\tif(!hash.id)\r\n\t\thash.id = id;\r\n\r\n\tthis._events[id] = hash;\r\n};\r\nscheduler.for_rendered = function(id, method) {\r\n\tfor (var i = this._rendered.length - 1; i >= 0; i--)\r\n\t\tif (this._rendered[i].getAttribute(this.config.event_attribute) == id)\r\n\t\t\tmethod(this._rendered[i], i);\r\n};\r\nscheduler.changeEventId = function(id, new_id) {\r\n\tif (id == new_id) return;\r\n\tvar ev = this._events[id];\r\n\tif (ev) {\r\n\t\tev.id = new_id;\r\n\t\tthis._events[new_id] = ev;\r\n\t\tdelete this._events[id];\r\n\t}\r\n\tthis.for_rendered(id, function(r) {\r\n\t\tr.setAttribute(\"event_id\", new_id); // for backward compatibility\r\n\t\tr.setAttribute(scheduler.config.event_attribute, new_id);\r\n\t});\r\n\tif (this._select_id == id) this._select_id = new_id;\r\n\tif (this._edit_id == id) this._edit_id = new_id;\r\n\t//if (this._drag_id==id) this._drag_id=new_id;\r\n\tthis.callEvent(\"onEventIdChange\", [id, new_id]);\r\n};\r\n\r\n(function() {\r\n\tvar attrs = [\"text\", \"Text\", \"start_date\", \"StartDate\", \"end_date\", \"EndDate\"];\r\n\tvar create_getter = function(name) {\r\n\t\treturn function(id) { return (scheduler.getEvent(id))[name]; };\r\n\t};\r\n\tvar create_setter = function(name) {\r\n\t\treturn function(id, value) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tev[name] = value;\r\n\t\t\tev._changed = true;\r\n\t\t\tev._timed = this.isOneDayEvent(ev);\r\n\t\t\tscheduler.event_updated(ev, true);\r\n\t\t};\r\n\t};\r\n\tfor (var i = 0; i < attrs.length; i += 2) {\r\n\t\tscheduler[\"getEvent\" + attrs[i + 1]] = create_getter(attrs[i]);\r\n\t\tscheduler[\"setEvent\" + attrs[i + 1]] = create_setter(attrs[i]);\r\n\t}\r\n})();\r\n\r\nscheduler.event_updated = function(ev, force) {\r\n\tif (this.is_visible_events(ev))\r\n\t\tthis.render_view_data();\r\n\telse\r\n\t\tthis.clear_event(ev.id);\r\n};\r\nscheduler.is_visible_events = function(ev) {\r\n\tif(!this._min_date || !this._max_date){\r\n\t\treturn false;\r\n\t}\r\n\r\n\t//if in displayed dates\r\n\tvar in_visible_range = (ev.start_date.valueOf() < this._max_date.valueOf() && this._min_date.valueOf() < ev.end_date.valueOf());\r\n\r\n\tif(in_visible_range){\r\n\r\n\t\t//end dates are not between last/first hours\r\n\t\tvar evFirstHour = ev.start_date.getHours(),\r\n\t\t\tevLastHour = ev.end_date.getHours() + (ev.end_date.getMinutes()/60),\r\n\t\t\tlastHour = this.config.last_hour,\r\n\t\t\tfirstHour = this.config.first_hour;\r\n\r\n\t\tvar end_dates_visible = (this._table_view || !((evLastHour > lastHour || evLastHour <= firstHour) && (evFirstHour >= lastHour || evFirstHour < firstHour)));\r\n\r\n\t\tif(end_dates_visible){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\r\n\t\t\t//event is bigger than area hidden between last/first hours\r\n\t\t\tvar event_duration = (ev.end_date.valueOf() - ev.start_date.valueOf()) / (1000*60*60),//hours\r\n\t\t\t\thidden_duration = 24 - (this.config.last_hour - this.config.first_hour);\r\n\r\n\t\t\treturn !!((event_duration > hidden_duration) || (evFirstHour < lastHour && evLastHour > firstHour));\r\n\r\n\t\t}\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.isOneDayEvent = function(ev) {\r\n\t// decrease by one ms so events that ends on midnight on the next day were still considered one day events\r\n\t// e.g. (09-02-2018 19:00 - 10-02-2018 00:00)\r\n\t// events >= 24h long are considered multiday\r\n\tvar checkEndDate = new Date(ev.end_date.valueOf() - 1);\r\n\treturn (\r\n\t\tev.start_date.getFullYear() === checkEndDate.getFullYear() &&\r\n\t\tev.start_date.getMonth() === checkEndDate.getMonth() &&\r\n\t\tev.start_date.getDate() === checkEndDate.getDate()\r\n\t) && ((ev.end_date.valueOf() - ev.start_date.valueOf()) < (1000 * 60 * 60 * 24));\r\n};\r\n\r\nscheduler.get_visible_events = function(only_timed) {\r\n\t//not the best strategy for sure\r\n\tvar stack = [];\r\n\r\n\tfor (var id in this._events)\r\n\t\tif (this.is_visible_events(this._events[id]))\r\n\t\t\tif (!only_timed || this._events[id]._timed)\r\n\t\t\t\tif (this.filter_event(id, this._events[id]))\r\n\t\t\t\t\tstack.push(this._events[id]);\r\n\r\n\treturn stack;\r\n};\r\nscheduler.filter_event = function(id, ev) {\r\n\tvar filter = this[\"filter_\" + this._mode];\r\n\treturn (filter) ? filter(id, ev) : true;\r\n};\r\nscheduler._is_main_area_event = function(ev){\r\n\treturn !!ev._timed;\r\n};\r\nscheduler.render_view_data = function(evs, hold) {\r\n\tvar full = false;\r\n\tif (!evs) {\r\n\t\tfull = true;\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\t\tevs = this.get_visible_events(!(this._table_view || this.config.multi_day));\r\n\t}\r\n\tfor(var i= 0, len = evs.length; i < len; i++){\r\n\t\tthis._recalculate_timed(evs[i]);\r\n\t}\r\n\r\n\tif (this.config.multi_day && !this._table_view) {\r\n\r\n\t\tvar tvs = [];\r\n\t\tvar tvd = [];\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tif (this._is_main_area_event(evs[i]))\r\n\t\t\t\ttvs.push(evs[i]);\r\n\t\t\telse\r\n\t\t\t\ttvd.push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(!this._els['dhx_multi_day']){\r\n\t\t\tvar message = scheduler._commonErrorMessages.unknownView(this._mode);\r\n\t\t\tthrow new Error(message);\r\n\t\t}\r\n\r\n\t\t// multiday events\r\n\t\tthis._rendered_location = this._els['dhx_multi_day'][0];\r\n\t\tthis._table_view = true;\r\n\t\tthis.render_data(tvd, hold);\r\n\t\tthis._table_view = false;\r\n\r\n\t\t// normal events\r\n\t\tthis._rendered_location = this._els['dhx_cal_data'][0];\r\n\t\tthis._table_view = false;\r\n\t\tthis.render_data(tvs, hold);\r\n\r\n\t} else {\r\n\t\tvar buffer = document.createDocumentFragment();\r\n\t\tvar renderedLocation = this._els['dhx_cal_data'][0];\r\n\t\tthis._rendered_location = buffer;\r\n\t\tthis.render_data(evs, hold);\r\n\t\trenderedLocation.appendChild(buffer);\r\n\t\tthis._rendered_location = renderedLocation;\r\n\r\n\t}\r\n\r\n\tif(full){\r\n\t\tthis.callEvent(\"onDataRender\", []);\r\n\t}\r\n};\r\n\r\n\r\nscheduler._view_month_day = function(e){\r\n\tvar date = scheduler.getActionData(e).date;\r\n\tif(!scheduler.callEvent(\"onViewMoreClick\", [date]))\r\n\t\treturn;\r\n\tscheduler.setCurrentView(date, \"day\");\r\n};\r\n\r\nscheduler._render_month_link = function(ev){\r\n\tvar parent = this._rendered_location;\r\n\tvar toRender = this._lame_clone(ev);\r\n\r\n\t//render links in each cell of multiday events\r\n\tfor(var d = ev._sday; d < ev._eday; d++){\r\n\r\n\t\ttoRender._sday = d;\r\n\t\ttoRender._eday = d+1;\r\n\r\n\t\tvar date = scheduler.date;\r\n\t\tvar curr = scheduler._min_date;\r\n\t\tcurr = date.add(curr, toRender._sweek, \"week\");\r\n\t\tcurr = date.add(curr, toRender._sday, \"day\");\r\n\t\tvar count = scheduler.getEvents(curr, date.add(curr, 1, \"day\")).length;\r\n\r\n\t\tvar pos = this._get_event_bar_pos(toRender);\r\n\t\tvar widt = (pos.x2 - pos.x);\r\n\r\n\t\tvar el = document.createElement(\"div\");\r\n\t\tscheduler.event(el, \"click\", function(e){scheduler._view_month_day(e);});\r\n\t\tel.className = \"dhx_month_link\";\r\n\t\tel.style.top = pos.y + \"px\";\r\n\t\tel.style.left = pos.x + \"px\";\r\n\t\tel.style.width = widt + \"px\";\r\n\t\tel.innerHTML = scheduler.templates.month_events_link(curr, count);\r\n\t\tthis._rendered.push(el);\r\n\r\n\t\tparent.appendChild(el);\r\n\t}\r\n};\r\n\r\nscheduler._recalculate_timed = function(id){\r\n\tif(!id) return;\r\n\tvar ev;\r\n\tif(typeof(id) != \"object\")\r\n\t\tev = this._events[id];\r\n\telse\r\n\t\tev = id;\r\n\tif(!ev) return;\r\n\tev._timed = scheduler.isOneDayEvent(ev);\r\n};\r\nscheduler.attachEvent(\"onEventChanged\", scheduler._recalculate_timed);\r\nscheduler.attachEvent(\"onEventAdded\", scheduler._recalculate_timed);\r\n\r\nscheduler.render_data = function(evs, hold) {\r\n\tevs = this._pre_render_events(evs, hold);\r\n\tvar containers = {};\r\n\tfor (var i = 0; i < evs.length; i++)\r\n\t\tif (this._table_view){\r\n\t\t\tif(scheduler._mode != 'month'){\r\n\t\t\t\tthis.render_event_bar(evs[i]);//may be multiday section on other views\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar max_evs = scheduler.config.max_month_events;\r\n\t\t\t\tif(max_evs !== max_evs*1 || evs[i]._sorder < max_evs){\r\n\t\t\t\t\t//of max number events per month cell is set and event can be rendered\r\n\t\t\t\t\tthis.render_event_bar(evs[i]);\r\n\t\t\t\t}else if(max_evs !== undefined && evs[i]._sorder == max_evs){\r\n\t\t\t\t\t//render 'view more' links\r\n\t\t\t\t\tscheduler._render_month_link(evs[i]);\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//do not render events with ordinal number > maximum events per cell\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t}else{\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tvar parent = scheduler.locate_holder(ev._sday);\r\n\t\t\tif (!parent) continue; //attempt to render non-visible event\r\n\r\n\t\t\tif(!containers[ev._sday]){\r\n\t\t\t\tcontainers[ev._sday] = {\r\n\t\t\t\t\treal: parent,\r\n\t\t\t\t\tbuffer: document.createDocumentFragment(),\r\n\t\t\t\t\twidth: parent.clientWidth\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\tvar container = containers[ev._sday];\r\n\t\t\tthis.render_event(ev, container.buffer, container.width);\r\n\t\t}\r\n\r\n\t\tfor(var i in containers){\r\n\t\t\tvar container = containers[i];\r\n\t\t\tif(container.real && container.buffer){\r\n\t\t\t\tcontainer.real.appendChild(container.buffer);\r\n\t\t\t}\r\n\t\t}\r\n};\r\n\r\nscheduler._get_first_visible_cell = function(cells) {\r\n\tfor (var i = 0; i < cells.length; i++) {\r\n\t\tif ((cells[i].className || \"\").indexOf(\"dhx_scale_ignore\") == -1) {\r\n\t\t\treturn cells[i];\r\n\t\t}\r\n\t}\r\n\t// if no visible cell found, return cells[0] to be more tolerant, since it's the original logic\r\n\treturn cells[0];\r\n};\r\n\r\nscheduler._pre_render_events = function(evs, hold) {\r\n\tvar hb = this.xy.bar_height;\r\n\tvar h_old = this._colsS.heights;\r\n\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\tif (!this._table_view) {\r\n\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t}\r\n\telse {\r\n\t\tevs = this._pre_render_events_table(evs, hold);\r\n\t}\r\n\tif (this._table_view) {\r\n\t\tif (hold)\r\n\t\t\tthis._colsS.heights = h_old;\r\n\t\telse {\r\n\t\t\tvar monthRows = data.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\tif (monthRows.length) {\r\n\t\t\t\tfor (var i = 0; i < monthRows.length; i++) {\r\n\t\t\t\t\th[i]++;\r\n\t\t\t\t\tvar cells = monthRows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\t\t\t\t\tvar cellHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\tif ((h[i]) * hb > cellHeight) { // 22 - height of cell's header\r\n\t\t\t\t\t\t//we have overflow, update heights\r\n\r\n\t\t\t\t\t\tvar cHeight = cellHeight;\r\n\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > cellHeight){\r\n\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmonthRows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\th[i] = (h[i - 1] || 0) + scheduler._get_first_visible_cell(cells).offsetHeight;\r\n\t\t\t\t}\r\n\t\t\t\th.unshift(0);\r\n\t\t\t\tconst dataArea = this.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tif (dataArea.offsetHeight < dataArea.scrollHeight && !scheduler._colsS.scroll_fix && scheduler.xy.scroll_width) {\r\n\r\n\t\t\t\t\tvar scale_settings = scheduler._colsS,\r\n\t\t\t\t\t\tsum_width = scale_settings[scale_settings.col_length],\r\n\t\t\t\t\t\trow_heights = scale_settings.heights.slice();\r\n\r\n\t\t\t\t\tsum_width -= (scheduler.xy.scroll_width || 0);\r\n\t\t\t\t\tthis._calc_scale_sizes(sum_width, this._min_date, this._max_date);\r\n\t\t\t\t\tscheduler._colsS.heights = row_heights;\r\n\r\n\t\t\t\t\tthis.set_xy(this._els[\"dhx_cal_header\"][0], sum_width/*, this.xy.scale_height*/);\r\n\t\t\t\t\tscheduler._render_scales(this._els[\"dhx_cal_header\"][0]);\r\n\t\t\t\t\tscheduler._render_month_scale(this._els[\"dhx_cal_data\"][0], this._get_timeunit_start(), this._min_date);\r\n\r\n\t\t\t\t\tscale_settings.scroll_fix = true;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\th[0] = -1;\r\n\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\r\n\t\t\t\t\t// +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\tvar full_multi_day_height = (h[0] + 1) * hb + 4;\r\n\r\n\t\t\t\t\tvar used_multi_day_height = full_multi_day_height;\r\n\t\t\t\t\tvar used_multi_day_height_css = full_multi_day_height + \"px\";\r\n\t\t\t\t\tif (this.config.multi_day_height_limit) {\r\n\t\t\t\t\t\tused_multi_day_height = Math.min(full_multi_day_height, this.config.multi_day_height_limit) ;\r\n\t\t\t\t\t\tused_multi_day_height_css = used_multi_day_height + \"px\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar multi_day_section = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\tmulti_day_section.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_section.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_section.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t// icon\r\n\t\t\t\t\tvar multi_day_icon = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\tmulti_day_icon.style.height = used_multi_day_height_css;\r\n\t\t\t\t\tmulti_day_icon.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\tmulti_day_icon.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\tmulti_day_icon.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\tif(this.config.multi_day_height_limit){\r\n\t\t\t\t\t\tthis._dy_shift = Math.min(this.config.multi_day_height_limit, this._dy_shift);\r\n\t\t\t\t\t}\r\n\t\t\t\t\th[0] = 0;\r\n\r\n\t\t\t\t\tif (used_multi_day_height != full_multi_day_height) {\r\n\r\n\t\t\t\t\t\tmulti_day_section.style.overflowY = \"auto\";\r\n\t\t\t\t\t//\tmulti_day_section.style.width = (parseInt(this._els[\"dhx_cal_navline\"][0].style.width)) + \"px\";\r\n\r\n\t\t\t\t\t\tmulti_day_icon.style.position = \"fixed\";\r\n\t\t\t\t\t\tmulti_day_icon.style.top = \"\";\r\n\t\t\t\t\t\tmulti_day_icon.style.left = \"\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn evs;\r\n};\r\nscheduler._get_event_sday = function(ev) {\r\n\t// get day in current view\r\n\t// use rounding for 23 or 25 hour days on DST\r\n\tvar datePart = this.date.day_start(new Date(ev.start_date));\r\n\treturn Math.round((datePart.valueOf() - this._min_date.valueOf()) / (24 * 60 * 60 * 1000));\r\n};\r\nscheduler._get_event_mapped_end_date = function(ev) {\r\n\tvar end_date = ev.end_date;\r\n\tif (this.config.separate_short_events) {\r\n\t\tvar ev_duration = (ev.end_date - ev.start_date) / 60000; // minutes\r\n\t\tif (ev_duration < this._min_mapped_duration) {\r\n\t\t\tend_date = this.date.add(end_date, this._min_mapped_duration - ev_duration, \"minute\");\r\n\t\t}\r\n\t}\r\n\treturn end_date;\r\n};\r\nscheduler._pre_render_events_line = function(evs, hold){\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n\tvar days = []; //events by weeks\r\n\tvar evs_originals = [];\r\n\r\n\tthis._min_mapped_duration = Math.floor(this.xy.min_event_height * 60 / this.config.hour_size_px); // values could change along the way\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\r\n\t\t//check date overflow\r\n\t\tvar sd = ev.start_date;\r\n\t\tvar ed = ev.end_date;\r\n\t\t//check scale overflow\r\n\t\tvar sh = sd.getHours();\r\n\t\tvar eh = ed.getHours();\r\n\t\tev._sday = this._get_event_sday(ev); // sday based on event start_date\r\n\t\tif (this._ignores[ev._sday]){\r\n\t\t\t//ignore event\r\n\t\t\tevs.splice(i,1);\r\n\t\t\ti--;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif (!days[ev._sday]) days[ev._sday] = [];\r\n\r\n\t\tif (!hold) {\r\n\t\t\tev._inner = false;\r\n\r\n\t\t\tvar stack = days[ev._sday];\r\n\r\n\t\t\twhile (stack.length) {\r\n\t\t\t\tvar t_ev = stack[stack.length - 1];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tstack.splice(stack.length - 1, 1);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar slot_index = stack.length;\r\n\t\t\tvar sorderSet = false;\r\n\t\t\tfor (var j = 0; j < stack.length; j++) {\r\n\t\t\t\tvar t_ev = stack[j];\r\n\t\t\t\tvar t_end_date = this._get_event_mapped_end_date(t_ev);\r\n\t\t\t\tif (t_end_date.valueOf() <= ev.start_date.valueOf()) {\r\n\t\t\t\t\tsorderSet = true;\r\n\t\t\t\t\tev._sorder = t_ev._sorder;\r\n\t\t\t\t\tslot_index = j;\r\n\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (stack.length)\r\n\t\t\t\tstack[stack.length - 1]._inner = true;\r\n\r\n\t\t\tif (!sorderSet) {\r\n\t\t\t\tif (stack.length) {\r\n\t\t\t\t\tif (stack.length <= stack[stack.length - 1]._sorder) {\r\n\t\t\t\t\t\tif (!stack[stack.length - 1]._sorder)\r\n\t\t\t\t\t\t\tev._sorder = 0;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tfor (j = 0; j < stack.length; j++) {\r\n\t\t\t\t\t\t\t\tvar _is_sorder = false;\r\n\t\t\t\t\t\t\t\tfor (var k = 0; k < stack.length; k++) {\r\n\t\t\t\t\t\t\t\t\tif (stack[k]._sorder == j) {\r\n\t\t\t\t\t\t\t\t\t\t_is_sorder = true;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (!_is_sorder) {\r\n\t\t\t\t\t\t\t\t\tev._sorder = j;\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._inner = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar _max_sorder = stack[0]._sorder;\r\n\t\t\t\t\t\tfor (j = 1; j < stack.length; j++) {\r\n\t\t\t\t\t\t\tif (stack[j]._sorder > _max_sorder)\r\n\t\t\t\t\t\t\t\t_max_sorder = stack[j]._sorder;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tev._sorder = _max_sorder + 1;\r\n\t\t\t\t\t\tev._inner = false;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._sorder = 0;\r\n\t\t\t}\r\n\r\n\t\t\tstack.splice(slot_index, slot_index == stack.length ? 0 : 1, ev);\r\n\r\n\t\t\tif (stack.length > (stack.max_count || 0)) {\r\n\t\t\t\tstack.max_count = stack.length;\r\n\t\t\t\tev._count = stack.length;\r\n\t\t\t} else {\r\n\t\t\t\tev._count = (ev._count) ? ev._count : 1;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (sh < this.config.first_hour || eh >= this.config.last_hour) {\r\n\t\t\t// Need to create copy of event as we will be changing it's start/end date\r\n\t\t\t// e.g. first_hour = 11 and event.start_date hours = 9. Need to preserve that info\r\n\t\t\tevs_originals.push(ev);\r\n\t\t\tevs[i] = ev = this._copy_event(ev);\r\n\r\n\t\t\tif (sh < this.config.first_hour) {\r\n\t\t\t\tev.start_date.setHours(this.config.first_hour);\r\n\t\t\t\tev.start_date.setMinutes(0);\r\n\t\t\t}\r\n\t\t\tif (eh >= this.config.last_hour) {\r\n\t\t\t\tev.end_date.setMinutes(0);\r\n\t\t\t\tev.end_date.setHours(this.config.last_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif (ev.start_date > ev.end_date || sh == this.config.last_hour) {\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (!hold) {\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tevs[i]._count = days[evs[i]._sday].max_count;\r\n\t\t}\r\n\t\tfor (var i = 0; i < evs_originals.length; i++)\r\n\t\t\tevs_originals[i]._count = days[evs_originals[i]._sday].max_count;\r\n\t}\r\n\r\n\treturn evs;\r\n};\r\nscheduler._time_order = function(evs) {\r\n\tevs.sort(function(a, b) {\r\n\t\tif (a.start_date.valueOf() == b.start_date.valueOf()) {\r\n\t\t\tif (a._timed && !b._timed) return 1;\r\n\t\t\tif (!a._timed && b._timed) return -1;\r\n\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t}\r\n\t\treturn a.start_date > b.start_date ? 1 : -1;\r\n\t});\r\n};\r\n\r\nscheduler._is_any_multiday_cell_visible = function(from, to, event){\r\n\tvar cols = this._cols.length;\r\n\tvar isAnyCellVisible = false;\r\n\tvar checkDate = from;\r\n\tvar noCells = true;\r\n\tvar lastDayEnd = new Date(to);\r\n\tif(scheduler.date.day_start(new Date(to)).valueOf() != to.valueOf()){\r\n\t\tlastDayEnd = scheduler.date.day_start(lastDayEnd);\r\n\t\tlastDayEnd = scheduler.date.add(lastDayEnd, 1, \"day\");\r\n\t}\r\n\twhile(checkDate < lastDayEnd){\r\n\t\tnoCells = false;\r\n\t\tvar cellIndex = this.locate_holder_day(checkDate, false, event);\r\n\t\tvar weekCellIndex = cellIndex % cols;\r\n\t\tif(!this._ignores[weekCellIndex]){\r\n\t\t\tisAnyCellVisible = true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcheckDate = scheduler.date.add(checkDate, 1, \"day\");\r\n\t}\r\n\treturn noCells || isAnyCellVisible;\r\n};\r\n\r\nscheduler._pre_render_events_table = function(evs, hold) { // max - max height of week slot\r\n\tthis._time_order(evs);\r\n\tvar out = [];\r\n\tvar weeks = [\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[],\r\n\t\t[]\r\n\t]; //events by weeks\r\n\tvar max = this._colsS.heights;\r\n\tvar start_date;\r\n\tvar cols = this._cols.length;\r\n\tvar chunks_info = {};\r\n\r\n\tfor (var i = 0; i < evs.length; i++) {\r\n\t\tvar ev = evs[i];\r\n\t\tvar id = ev.id;\r\n\t\tif (!chunks_info[id]) {\r\n\t\t\tchunks_info[id] = {\r\n\t\t\t\tfirst_chunk: true,\r\n\t\t\t\tlast_chunk: true\r\n\t\t\t};\r\n\t\t}\r\n\t\tvar chunk_info = chunks_info[id];\r\n\t\tvar sd = (start_date || ev.start_date);\r\n\t\tvar ed = ev.end_date;\r\n\t\t//trim events which are crossing through current view\r\n\t\tif (sd < this._min_date) {\r\n\t\t\tchunk_info.first_chunk = false;\r\n\t\t\tsd = this._min_date;\r\n\t\t}\r\n\t\tif (ed > this._max_date) {\r\n\t\t\tchunk_info.last_chunk = false;\r\n\t\t\ted = this._max_date;\r\n\t\t}\r\n\r\n\t\tvar locate_s = this.locate_holder_day(sd, false, ev);\r\n\t\tev._sday = locate_s % cols;\r\n\t\t//skip single day events for ignored dates\r\n\t\tif (this._ignores[ev._sday] && ev._timed) continue;\r\n\r\n\t\tvar locate_e = this.locate_holder_day(ed, true, ev) || cols;\r\n\t\tev._eday = (locate_e % cols) || cols; //cols used to fill full week, when event end on monday\r\n\t\tev._length = locate_e - locate_s;\r\n\t\t//3600000 - compensate 1 hour during winter|summer time shift\r\n\t\tev._sweek = Math.floor((this._correct_shift(sd.valueOf(), 1) - this._min_date.valueOf()) / (60 * 60 * 1000 * 24 * cols));\r\n\r\n\t\tvar isAnyCellVisible = scheduler._is_any_multiday_cell_visible(sd, ed, ev);\r\n\r\n\t\tif(!isAnyCellVisible){\r\n\t\t\tstart_date = null;\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t//current slot\r\n\t\tvar stack = weeks[ev._sweek];\r\n\t\t//check order position\r\n\t\tvar stack_line;\r\n\r\n\t\tfor (stack_line = 0; stack_line < stack.length; stack_line++)\r\n\t\t\tif (stack[stack_line]._eday <= ev._sday)\r\n\t\t\t\tbreak;\r\n\r\n\t\tif (!ev._sorder || !hold) {\r\n\t\t\tev._sorder = stack_line;\r\n\t\t}\r\n\r\n\t\tif (ev._sday + ev._length <= cols) {\r\n\t\t\tstart_date = null;\r\n\t\t\tout.push(ev);\r\n\t\t\tstack[stack_line] = ev;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\tev._first_chunk = chunk_info.first_chunk;\r\n\t\t\tev._last_chunk = chunk_info.last_chunk;\r\n\t\t} else { // split long event in chunks\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\tcopy.id = ev.id;\r\n\t\t\tcopy._length = cols - ev._sday;\r\n\t\t\tcopy._eday = cols;\r\n\t\t\tcopy._sday = ev._sday;\r\n\t\t\tcopy._sweek = ev._sweek;\r\n\t\t\tcopy._sorder = ev._sorder;\r\n\t\t\tcopy.end_date = this.date.add(sd, copy._length, \"day\");\r\n\t\t\tcopy._first_chunk = chunk_info.first_chunk;\r\n\t\t\tif (chunk_info.first_chunk) {\r\n\t\t\t\tchunk_info.first_chunk = false;\r\n\t\t\t}\r\n\r\n\t\t\tout.push(copy);\r\n\t\t\tstack[stack_line] = copy;\r\n\t\t\tstart_date = copy.end_date;\r\n\t\t\t//get max height of slot\r\n\t\t\tmax[ev._sweek] = stack.length - 1;\r\n\t\t\ti--;\r\n\t\t\tcontinue; //repeat same step\r\n\t\t}\r\n\t}\r\n\treturn out;\r\n};\r\nscheduler._copy_dummy = function() {\r\n\tvar a = new Date(this.start_date);\r\n\tvar b = new Date(this.end_date);\r\n\tthis.start_date = a;\r\n\tthis.end_date = b;\r\n};\r\nscheduler._copy_event = function(ev) {\r\n\tthis._copy_dummy.prototype = ev;\r\n\treturn new this._copy_dummy();\r\n\t//return {start_date:ev.start_date, end_date:ev.end_date, text:ev.text, id:ev.id}\r\n};\r\nscheduler._rendered = [];\r\nscheduler.clear_view = function() {\r\n\tfor (var i = 0; i < this._rendered.length; i++) {\r\n\t\tvar obj = this._rendered[i];\r\n\t\tif (obj.parentNode) obj.parentNode.removeChild(obj);\r\n\t}\r\n\tthis._rendered = [];\r\n};\r\nscheduler.updateEvent = function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tthis.clear_event(id);\r\n\r\n\tif (ev && this.is_visible_events(ev) && this.filter_event(id, ev) && (this._table_view || this.config.multi_day || ev._timed)) {\r\n\t\tif (this.config.update_render){\r\n\t\t\tthis.render_view_data();\r\n\t\t}else{\r\n\t\t\tif(this.getState().mode == \"month\" && !this.getState().drag_id && !this.isOneDayEvent(ev)){\r\n\t\t\t\tthis.render_view_data();\r\n\t\t\t}else{\r\n\t\t\t\tthis.render_view_data([ev], true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.clear_event = function(id) {\r\n\tthis.for_rendered(id, function(node, i) {\r\n\t\tif (node.parentNode)\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\tscheduler._rendered.splice(i, 1);\r\n\t});\r\n};\r\nscheduler._y_from_date = function(date){\r\n\tvar sm = date.getHours() * 60 + date.getMinutes();\r\n\treturn ((Math.round((sm * 60 * 1000 - this.config.first_hour * 60 * 60 * 1000) * this.config.hour_size_px / (60 * 60 * 1000))) % (this.config.hour_size_px * 24)); //42px/hour\r\n};\r\nscheduler._calc_event_y = function(ev, min_height){\r\n\tmin_height = min_height || 0;\r\n\tvar sm = ev.start_date.getHours() * 60 + ev.start_date.getMinutes();\r\n\tvar em = (ev.end_date.getHours() * 60 + ev.end_date.getMinutes()) || (scheduler.config.last_hour * 60);\r\n\tvar top = this._y_from_date(ev.start_date);\r\n\r\n\tvar height = Math.max(min_height, (em - sm) * this.config.hour_size_px / 60); //42px/hour\r\n\treturn {\r\n\t\ttop: top,\r\n\t\theight: height\r\n\t};\r\n};\r\nscheduler.render_event = function(ev, buffer, parentWidth) {\r\n\tvar menu = scheduler.xy.menu_width;\r\n\tvar menu_offset = (this.config.use_select_menu_space) ? 0 : menu;\r\n\tif (ev._sday < 0) return; //can occur in case of recurring event during time shift\r\n\r\n\tvar parent = scheduler.locate_holder(ev._sday);\r\n\tif (!parent) return; //attempt to render non-visible event\r\n\r\n\tbuffer = buffer || parent;\r\n\r\n\tvar pos_y = this._calc_event_y(ev, scheduler.xy.min_event_height);\r\n\tvar top = pos_y.top,\r\n\t\theight = pos_y.height;\r\n\r\n\tvar ev_count = ev._count || 1;\r\n\tvar ev_sorder = ev._sorder || 0;\r\n\r\n\tparentWidth = parentWidth || parent.clientWidth;\r\n\tif(this.config.day_column_padding){\r\n\t\tparentWidth -= this.config.day_column_padding;\r\n\t}\r\n\r\n\tvar width = Math.floor((parentWidth - menu_offset) / ev_count);\r\n\tvar left = ev_sorder * width + 1;\r\n\tif (!ev._inner) width = width * (ev_count - ev_sorder);\r\n\tif (this.config.cascade_event_display) {\r\n\t\tvar limit = this.config.cascade_event_count;\r\n\t\tvar margin = this.config.cascade_event_margin;\r\n\t\tleft = ev_sorder % limit * margin;\r\n\t\tvar right = (ev._inner) ? (ev_count - ev_sorder - 1) % limit * margin / 2 : 0;\r\n\t\twidth = Math.floor(parentWidth - menu_offset - left - right);\r\n\t}\r\n\r\n\tif(height < 30){\r\n\t\tev._mode = \"smallest\";\r\n\t}else if(height < 42){\r\n\t\tev._mode = \"small\";\r\n\t}else{\r\n\t\tev._mode = null;\r\n\t}\r\n\r\n\tvar d = this._render_v_bar(ev, menu_offset + left, top, width, height, ev._text_style, scheduler.templates.event_header(ev.start_date, ev.end_date, ev), scheduler.templates.event_text(ev.start_date, ev.end_date, ev));\r\n\t\r\n\tif(ev._mode === \"smallest\"){\r\n\t\td.classList.add(\"dhx_cal_event--xsmall\");\r\n\t}else if (ev._mode === \"small\"){\r\n\t\td.classList.add(\"dhx_cal_event--small\");\r\n\t}\r\n\r\n\tthis._waiAria.eventAttr(ev, d);\r\n\tthis._rendered.push(d);\r\n\tbuffer.appendChild(d);\r\n\r\n\tvar parentPosition = parseInt( this.config.rtl ? parent.style.right : parent.style.left, 10);\r\n\r\n\tleft = left + parentPosition + menu_offset;\r\n\r\n\tif (this._edit_id == ev.id) {\r\n\r\n\t\td.style.zIndex = 1; //fix overlapping issue\r\n\t\twidth = Math.max(width, scheduler.xy.editor_width);\r\n\t\td = document.createElement(\"div\");\r\n\t\td.setAttribute(\"event_id\", ev.id); // for backward compatibility\r\n\t\td.setAttribute(this.config.event_attribute, ev.id);\r\n\r\n\t\tthis._waiAria.eventAttr(ev, d);\r\n\r\n\t\td.className = \"dhx_cal_event dhx_cal_editor\";\r\n\t\tif (this.config.rtl) left++;\r\n\t\tthis.set_xy(d, width, height, left, top);\r\n\r\n\r\n\t\tif(ev.color){\r\n\t\t\td.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tvar tplClass = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\r\n\t\tif(tplClass){\r\n\t\t\td.className += \" \" + tplClass;\r\n\t\t}\r\n\t\tvar d2 = document.createElement(\"div\");\r\n\t\td2.style.cssText += \"overflow:hidden;height:100%\";\r\n\r\n\t\td.appendChild(d2);\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\tthis._rendered.push(d);\r\n\r\n\t\td2.innerHTML = \"\";\r\n\t\tthis._editor = d2.querySelector(\"textarea\");\r\n\t\t\r\n\t\tscheduler.event(this._editor, \"keydown\", function(e) {\r\n\t\t\tif (e.shiftKey) return true;\r\n\t\t\tvar code = e.keyCode;\r\n\t\t\tif (code == scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\tif (code == scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\r\n\t\t\tif(code == scheduler.keys.edit_save || code == scheduler.keys.edit_cancel){\r\n\t\t\t\tif(e.preventDefault) e.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.event(this._editor, \"selectstart\", function (e) {\r\n\t\t\te.cancelBubble = true;\r\n\t\t\treturn true;\r\n\t\t});\r\n\t\tscheduler._focus(this._editor, true);\r\n\t\t//IE and opera can add x-scroll during focusing\r\n\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft = 0;\r\n\t}\r\n\tif (this.xy.menu_width !== 0 && this._select_id == ev.id) {\r\n\r\n\t\tif (this.config.cascade_event_display && this._drag_mode)\r\n\t\t\td.style.zIndex = 1; //fix overlapping issue for cascade view in case of dnd of selected event\r\n\t\tvar icons = this.config[\"icons_\" + ((this._edit_id == ev.id) ? \"edit\" : \"select\")];\r\n\t\tvar icons_str = \"\";\r\n\r\n\t\tvar ariaAttr;\r\n\r\n\t\tfor (var i = 0; i < icons.length; i++) {\r\n\t\t\tconst currentIcon = icons[i];\r\n\t\t\tariaAttr = this._waiAria.eventMenuAttrString(currentIcon);\r\n\t\t\ticons_str += ``;\r\n\t\t}\r\n\t\tvar obj = this._render_v_bar(ev, left - menu - 1, top, menu, null, \"\", \"\", icons_str, true);\r\n\r\n\t\tif(ev.color){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tobj.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\t//obj.style.left = left - menu + 1;\r\n\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\tthis._rendered.push(obj);\r\n\t}\r\n\tif(this.config.drag_highlight && this._drag_id == ev.id){\r\n\t\tthis.highlightEventPosition(ev);\r\n\t}\r\n};\r\nscheduler._render_v_bar = function (ev, x, y, w, h, style, contentA, contentB, bottom) {\r\n\tvar d = document.createElement(\"div\");\r\n\tvar id = ev.id;\r\n\tvar cs = (bottom) ? \"dhx_cal_event dhx_cal_select_menu\" : \"dhx_cal_event\";\r\n\r\n\tvar state = scheduler.getState();\r\n\tif(state.drag_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_drag\";\r\n\t}\r\n\r\n\tif(state.select_id == ev.id){\r\n\t\tcs += \" dhx_cal_event_selected\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse) cs = cs + \" \" + cse;\r\n\r\n\tif(this.config.cascade_event_display) {\r\n\t\tcs += \" dhx_cal_event_cascade\";\r\n\t}\r\n\r\n\tvar boxWidth = w - 1;\r\n\tvar html = `\r\n\t\t\t\t
`;\r\n\r\n\td.innerHTML = html;\r\n\r\n\tvar container = d.cloneNode(true).firstChild;\r\n\r\n\tif (!bottom && scheduler.renderEvent(container, ev, w, h, contentA, contentB)) {\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\treturn container;\r\n\t} else {\r\n\t\tcontainer = d.firstChild;\r\n\t\tif(ev.color){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-background\", ev.color);\r\n\t\t}\r\n\t\tif(ev.textColor){\r\n\t\t\tcontainer.style.setProperty(\"--dhx-scheduler-event-color\", ev.textColor);\r\n\t\t}\r\n\r\n\t\tvar inner_html = '
';\r\n\t\tinner_html += '' + contentA + '
';\r\n\t\tinner_html += '' + contentB + '
'; // +2 css specific, moved from render_event\r\n\r\n\t\tvar footer_class = \"dhx_event_resize dhx_footer\";\r\n\t\tif (bottom || ev._drag_resize === false)\r\n\t\t\tfooter_class = \"dhx_resize_denied \" + footer_class;\r\n\r\n\t\tinner_html += '
';\r\n\r\n\t\tcontainer.innerHTML = inner_html;\r\n\t}\r\n\r\n\treturn container;\r\n};\r\nscheduler.renderEvent = function(){\r\n\treturn false;\r\n};\r\nscheduler.locate_holder = function(day) {\r\n\tif (this._mode == \"day\") return this._els[\"dhx_cal_data\"][0].firstChild; //dirty\r\n\treturn this._els[\"dhx_cal_data\"][0].childNodes[day];\r\n};\r\nscheduler.locate_holder_day = function(date, past) {\r\n\tvar day = Math.floor((this._correct_shift(date, 1) - this._min_date) / (60 * 60 * 24 * 1000));\r\n\t//when locating end data of event , we need to use next day if time part was defined\r\n\tif (past && this.date.time_part(date)) day++;\r\n\treturn day;\r\n};\r\n\r\n\r\n\r\nscheduler._get_dnd_order = function(order, ev_height, max_height){\r\n\tif(!this._drag_event)\r\n\t\treturn order;\r\n\tif(!this._drag_event._orig_sorder)\r\n\t\tthis._drag_event._orig_sorder = order;\r\n\telse\r\n\t\torder = this._drag_event._orig_sorder;\r\n\r\n\tvar evTop = ev_height * order;\r\n\twhile((evTop + ev_height) > max_height){\r\n\t\torder--;\r\n\t\tevTop -= ev_height;\r\n\t}\r\n\torder = Math.max(order, 0);\r\n\treturn order;\r\n};\r\n//scheduler._get_event_bar_pos = function(sday, eday, week, drag){\r\nscheduler._get_event_bar_pos = function(ev){\r\n\tvar rtl = this.config.rtl;\r\n\tvar columns = this._colsS;\r\n\tvar x = columns[ev._sday];\r\n\tvar x2 = columns[ev._eday];\r\n\tif (rtl) {\r\n\t\tx = columns[columns.col_length] - columns[ev._eday] + columns[0];\r\n\t\tx2 = columns[columns.col_length] - columns[ev._sday] + columns[0];\r\n\t}\r\n\r\n\tif (x2 == x) x2 = columns[ev._eday + 1];\r\n\tvar hb = this.xy.bar_height;\r\n\r\n\tvar order = ev._sorder;\r\n\tif(ev.id == this._drag_id){\r\n\t\tvar cellHeight = columns.heights[ev._sweek + 1] - columns.heights[ev._sweek]- this.xy.month_head_height;//22 for month head height\r\n\t\torder = scheduler._get_dnd_order(order, hb, cellHeight);\r\n\t}\r\n\tvar y_event_offset = order * hb;\r\n\tvar y = columns.heights[ev._sweek] + (columns.height ? (this.xy.month_scale_height + 2) : 2 ) + y_event_offset;\r\n\treturn {x:x, x2:x2, y:y};\r\n};\r\n\r\nscheduler.render_event_bar = function (ev) {\r\n\tvar parent = this._rendered_location;\r\n\tvar pos = this._get_event_bar_pos(ev);\r\n\tvar y = pos.y;\r\n\tvar x = pos.x;\r\n\tvar x2 = pos.x2;\r\n\t// resize for month mutliday events\r\n\tvar resize_handle = \"\";\r\n\r\n\t//events in ignored dates\r\n\r\n\tif (!x2) return;\r\n\r\n\tvar resizable = scheduler.config.resize_month_events && this._mode == \"month\" &&\r\n\t\t(!ev._timed || scheduler.config.resize_month_timed);\r\n\r\n\tvar d = document.createElement(\"div\");\r\n\tvar left_chunk = (ev.hasOwnProperty(\"_first_chunk\") && ev._first_chunk),\r\n\t\tright_chunk = (ev.hasOwnProperty(\"_last_chunk\") && ev._last_chunk);\r\n\r\n\tvar resize_left = resizable && (ev._timed || left_chunk);\r\n\tvar resize_right = resizable && (ev._timed || right_chunk);\r\n\r\n\tvar timed = true;\r\n\tvar cs = \"dhx_cal_event_clear\";\r\n\tif (!ev._timed || resizable) {\r\n\t\ttimed = false;\r\n\t\tcs = \"dhx_cal_event_line\";\r\n\t}\r\n\tif(left_chunk){\r\n\t\tcs += \" dhx_cal_event_line_start\";\r\n\t}\r\n\tif(right_chunk){\r\n\t\tcs += \" dhx_cal_event_line_end\";\r\n\t}\r\n\tif(resize_left){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\tif(resize_right){\r\n\t\tresize_handle += \"
\";\r\n\t}\r\n\r\n\tvar cse = scheduler.templates.event_class(ev.start_date, ev.end_date, ev);\r\n\tif (cse){\r\n\t\tcs += \" \" + cse;\r\n\t}\r\n\r\n\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\tvar style_text = [\r\n\t\t\"position:absolute\",\r\n\t\t\"top:\" + y + \"px\",\r\n\t\t\"left:\" + x + \"px\",\r\n\t\t\"width:\" + (x2 - x - (timed ? 1 : 0)) + \"px\",\r\n\t\t\"height:\" + (this.xy.bar_height - 2) + \"px\",\r\n\t\tcolor,\r\n\t\tbg_color,\r\n\t\t(ev._text_style || \"\")\r\n\t].join(\";\");\r\n\r\n\tvar html = \"\";\r\n\tif (resizable) {\r\n\t\thtml += resize_handle;\r\n\t}\r\n\tif(scheduler.getState().mode == \"month\"){\r\n\t\tev = scheduler.getEvent(ev.id); // ev at this point could be a part (row in a month view) of a larger event\r\n\t}\r\n\r\n\tif (ev._timed){\r\n\t\thtml += `
${scheduler.templates.event_bar_date(ev.start_date, ev.end_date, ev)} `;\r\n\t}\r\n\r\n\thtml += \"
\";\r\n\thtml += scheduler.templates.event_bar_text(ev.start_date, ev.end_date, ev) + '
';\r\n\thtml += \"
\";\r\n\thtml += ' ';\r\n\r\n\td.innerHTML = html;\r\n\r\n\tthis._rendered.push(d.firstChild);\r\n\tparent.appendChild(d.firstChild);\r\n};\r\n\r\nscheduler._locate_event = function(node) {\r\n\tvar id = null;\r\n\twhile (node && !id && node.getAttribute) {\r\n\t\tid = node.getAttribute(this.config.event_attribute);\r\n\t\tnode = node.parentNode;\r\n\t}\r\n\treturn id;\r\n};\r\n\r\nscheduler.edit = function(id) {\r\n\tif (this._edit_id == id) return;\r\n\tthis.editStop(false, id);\r\n\tthis._edit_id = id;\r\n\tthis.updateEvent(id);\r\n};\r\nscheduler.editStop = function(mode, id) {\r\n\tif (id && this._edit_id == id) return;\r\n\tvar ev = this.getEvent(this._edit_id);\r\n\tif (ev) {\r\n\t\tif (mode) ev.text = this._editor.value;\r\n\t\tthis._edit_id = null;\r\n\t\tthis._editor = null;\r\n\t\tthis.updateEvent(ev.id);\r\n\t\tthis._edit_stop_event(ev, mode);\r\n\t}\r\n};\r\nscheduler._edit_stop_event = function(ev, mode) {\r\n\tif (this._new_event) {\r\n\t\tif (!mode) {\r\n\t\t\tif (ev) // in case of custom lightbox user can already delete event\r\n\t\t\t\tthis.deleteEvent(ev.id, true);\r\n\t\t} else {\r\n\t\t\tthis.callEvent(\"onEventAdded\", [ev.id, ev]);\r\n\t\t}\r\n\t\tthis._new_event = null;\r\n\t} else {\r\n\t\tif (mode){\r\n\t\t\tthis.callEvent(\"onEventChanged\", [ev.id, ev]);\r\n\t\t}\r\n\t}\r\n};\r\n\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ( (!from && !to) || (ev.start_date < to && ev.end_date > from) ))\r\n\t\t\tresult.push(ev);\r\n\t}\r\n\treturn result;\r\n};\r\nscheduler.getRenderedEvent = function(id) {\r\n\tif (!id)\r\n\t\treturn;\r\n\tvar rendered_events = scheduler._rendered;\r\n\tfor (var i=0; i
-1){\r\n\t\t\t\t\tsection = section.split(scheduler.config.section_delimiter)[0];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar top = timeline.getSectionTop(section);\r\n\t\t\tvar left = timeline.posFromDate(event.start_date);\r\n\t\t\tvar container = scheduler.$container.querySelector(\".dhx_timeline_data_wrapper\");\r\n\t\t\tleft = left - (container.offsetWidth - timeline.dx) / 2;\r\n\t\t\ttop = top - container.offsetHeight / 2 + timeline.dy/2;\r\n\r\n\t\t\tif (timeline._smartRenderingEnabled()) {\r\n\t\t\t\tvar handlerId = timeline.attachEvent(\"onScroll\", function(){\r\n\t\t\t\t\trestoreOriginalColors();\r\n\t\t\t\t\ttimeline.detachEvent(handlerId);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\ttimeline.scrollTo({\r\n\t\t\t\tleft: left,\r\n\t\t\t\ttop: top\r\n\t\t\t});\r\n\t\t\tif (!timeline._smartRenderingEnabled()) {\r\n\t\t\t\trestoreOriginalColors();\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trestoreOriginalColors();\r\n\t}\r\n\r\n\tscheduler.callEvent(\"onAfterEventDisplay\", [ev, mode]);\r\n};\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\n\r\nscheduler._append_drag_marker = function(m){\r\n\tif(m.parentNode) return;\r\n\tvar zone = scheduler._els[\"dhx_cal_data\"][0];\r\n\r\n\tvar scale = zone.lastChild;\r\n\tvar className = scheduler._getClassName(scale);\r\n\tif(className.indexOf(\"dhx_scale_holder\") < 0 && scale.previousSibling){\r\n\t\tscale = scale.previousSibling;\r\n\t}\r\n\r\n\tclassName = scheduler._getClassName(scale);\r\n\tif (scale && className.indexOf(\"dhx_scale_holder\") === 0) {\r\n\t\tscale.appendChild(m);\r\n\t}\r\n};\r\n\r\nscheduler._update_marker_position = function(m, event){\r\n\tvar size = scheduler._calc_event_y(event, 0);\r\n\tm.style.top = size.top + \"px\";\r\n\tm.style.height = size.height + \"px\";\r\n};\r\n\r\nscheduler.highlightEventPosition = function(event){\r\n\tvar m = document.createElement(\"div\");\r\n\r\n\tm.setAttribute(\"event_id\", event.id); // for backward compatibility\r\n\tm.setAttribute(this.config.event_attribute, event.id);\r\n\tthis._rendered.push(m);\r\n\tthis._update_marker_position(m, event);\r\n\r\n\tvar css = this.templates.drag_marker_class(event.start_date, event.end_date, event);\r\n\tvar html = this.templates.drag_marker_content(event.start_date, event.end_date, event);\r\n\tm.className = \"dhx_drag_marker\";\r\n\tif(css)\r\n\t\tm.className += \" \" + css;\r\n\tif(html)\r\n\t\tm.innerHTML = html;\r\n\tthis._append_drag_marker(m);\r\n};\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler._lightbox_controls = {};\r\nscheduler.formSection = function(name){\r\n\tvar config = this.config.lightbox.sections;\r\n\tvar i = 0;\r\n\tfor (i; i < config.length; i++) {\r\n\t\tif (config[i].name == name) {\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\tif (i === config.length) {\r\n\t\t// GS-1662 section not found, should exit here instead of throwing an error\r\n\t\treturn null;\r\n\t}\r\n\r\n\tvar section = config[i];\r\n\tif (!scheduler._lightbox) {\r\n\t\tscheduler.getLightbox();\r\n\t}\r\n\tvar header = scheduler._lightbox.querySelector(`#${section.id}`);\r\n\tvar node = header.nextSibling;\r\n\r\n\tvar result = {\r\n\t\tsection: section,\r\n\t\theader: header,\r\n\t\tnode: node,\r\n\t\tgetValue:function(ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].get_value(node, (ev||{}), section);\r\n\t\t},\r\n\t\tsetValue:function(value, ev){\r\n\t\t\treturn scheduler.form_blocks[section.type].set_value(node, value, (ev||{}), section);\r\n\t\t}\r\n\t};\r\n\r\n\tvar handler = scheduler._lightbox_controls[\"get_\"+section.type+\"_control\"];\r\n\treturn handler?handler(result):result;\r\n};\r\nscheduler._lightbox_controls.get_template_control = function(result) {\r\n\tresult.control = result.node;\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_select_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_textarea_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('textarea')[0];\r\n\treturn result;\r\n};\r\nscheduler._lightbox_controls.get_time_control = function(result) {\r\n\tresult.control = result.node.getElementsByTagName('select'); // array\r\n\treturn result;\r\n};\r\n\r\nscheduler._lightbox_controls.defaults = {\r\n\ttemplate: {\r\n\t\theight:30\r\n\t},\r\n\ttextarea: {\r\n\t\theight: 200\r\n\t},\r\n\tselect: {\r\n\t\theight: 23\r\n\t},\r\n\ttime: {\r\n\t\theight: 20\r\n\t}\r\n};\r\n\r\n\r\nscheduler.form_blocks={\r\n\ttemplate:{\r\n\t\trender: function(sns){\r\n\t\t\treturn \"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tnode.innerHTML = value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev,config){\r\n\t\t\treturn node.innerHTML||\"\";\r\n\t\t},\r\n\t\tfocus: function(node){\r\n\t\t}\r\n\t},\r\n\ttextarea:{\r\n\t\trender:function(sns){\r\n\t\t\tconst placeholder = sns.placeholder ? `placeholder='${sns.placeholder}'` : \"\";\r\n\t\t\treturn `
`;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev){\r\n\t\t\tscheduler.form_blocks.textarea._get_input(node).value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn scheduler.form_blocks.textarea._get_input(node).value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a = scheduler.form_blocks.textarea._get_input(node);\r\n\t\t\tscheduler._focus(a, true);\r\n\t\t},\r\n\t\t_get_input: function(node){\r\n\t\t\treturn node.getElementsByTagName(\"textarea\")[0];\r\n\t\t}\r\n\t},\r\n\tselect:{\r\n\t\trender:function(sns){\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\t\t\tvar html=\"\";\r\n\t\t\tfor (var i=0; i < sns.options.length; i++)\r\n\t\t\t\thtml+=\"\"+sns.options[i].label+\" \";\r\n\t\t\thtml+=\"
\";\r\n\t\t\treturn html;\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,sns){\r\n\t\t\tvar select = node.firstChild;\r\n\t\t\tif (!select._dhx_onchange && sns.onchange) {\r\n\t\t\t\tscheduler.event(select, \"change\", sns.onchange);\r\n\t\t\t\tselect._dhx_onchange = true;\r\n\t\t\t}\r\n\t\t\tif (typeof value == \"undefined\")\r\n\t\t\t\tvalue = (select.options[0]||{}).value;\r\n\t\t\tselect.value=value||\"\";\r\n\t\t},\r\n\t\tget_value:function(node,ev){\r\n\t\t\treturn node.firstChild.value;\r\n\t\t},\r\n\t\tfocus:function(node){\r\n\t\t\tvar a=node.firstChild; scheduler._focus(a, true);\r\n\t\t}\r\n\t},\r\n\ttime:{\r\n\t\trender:function(sns) {\r\n\t\t\tif (!sns.time_format) {\r\n\t\t\t\t// default order\r\n\t\t\t\tsns.time_format = [\"%H:%i\", \"%d\", \"%m\", \"%Y\"];\r\n\t\t\t}\r\n\t\t\t// map: default order => real one\r\n\t\t\tsns._time_format_order = {};\r\n\t\t\tvar time_format = sns.time_format;\r\n\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar dt = scheduler.date.date_part(scheduler._currentDate());\r\n\t\t\tvar last = 24*60, first = 0;\r\n\t\t\tif(scheduler.config.limit_time_select){\r\n\t\t\t\tlast = 60*cfg.last_hour+1;\r\n\t\t\t\tfirst = 60*cfg.first_hour;\r\n\t\t\t\tdt.setHours(cfg.first_hour);\r\n\t\t\t}\r\n\t\t\tvar html = \"\";\r\n\r\n\t\t\tfor (var p = 0; p < time_format.length; p++) {\r\n\t\t\t\tvar time_option = time_format[p];\r\n\r\n\t\t\t\t// adding spaces between selects\r\n\t\t\t\tif (p > 0) {\r\n\t\t\t\t\thtml += \" \";\r\n\t\t\t\t}\r\n\t\t\t\tvar selectBoxClass = \"\";\r\n\t\t\t\tvar options = \"\";\r\n\t\t\t\tswitch (time_option) {\r\n\t\t\t\t\tcase \"%Y\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_year_select\";\r\n\t\t\t\t\t\tsns._time_format_order[3] = p;\r\n\t\t\t\t\t\t//year\r\n\t\t\t\t\t\tvar range;\r\n\t\t\t\t\t\tvar start_year;\r\n\t\t\t\t\t\tvar end_year;\r\n\t\t\t\t\t\tif(sns.year_range){\r\n\t\t\t\t\t\t\tif (!isNaN(sns.year_range)) {\r\n\t\t\t\t\t\t\t\trange = sns.year_range;\r\n\t\t\t\t\t\t\t} else if (sns.year_range.push) {\r\n\t\t\t\t\t\t\t\t// if\r\n\t\t\t\t\t\t\t\tstart_year = sns.year_range[0];\r\n\t\t\t\t\t\t\t\tend_year = sns.year_range[1];\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\trange = range || 10;\r\n\t\t\t\t\t\tvar offset = offset || Math.floor(range / 2);\r\n\t\t\t\t\t\tstart_year = start_year || dt.getFullYear() - offset;\r\n\t\t\t\t\t\tend_year = end_year || start_year + range;\r\n\r\n\t\t\t\t\t\tfor (var i = start_year; i < end_year; i++)\r\n\t\t\t\t\t\t\toptions += \"\" + (i) + \" \";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%m\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_month_select\";\r\n\t\t\t\t\t\tsns._time_format_order[2] = p;\r\n\t\t\t\t\t\t//month\r\n\t\t\t\t\t\tfor (var i=0; i < 12; i++)\r\n\t\t\t\t\t\t\toptions+=\"\"+this.locale.date.month_full[i]+\" \";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%d\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_day_select\";\r\n\t\t\t\t\t\tsns._time_format_order[1] = p;\r\n\t\t\t\t\t\t//days\r\n\t\t\t\t\t\tfor (var i=1; i < 32; i++)\r\n\t\t\t\t\t\t\toptions+=\"\"+i+\" \";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"%H:%i\":\r\n\t\t\t\t\t\tselectBoxClass = \"dhx_lightbox_time_select\";\r\n\t\t\t\t\t\tsns._time_format_order[0] = p;\r\n\t\t\t\t\t\t//hours\r\n\t\t\t\t\t\tvar i = first;\r\n\t\t\t\t\t\tvar tdate = dt.getDate();\r\n\t\t\t\t\t\tsns._time_values = [];\r\n\r\n\t\t\t\t\t\twhile(i\"+time+\"\";\r\n\t\t\t\t\t\t\tsns._time_values.push(i);\r\n\t\t\t\t\t\t\tdt.setTime(dt.valueOf()+this.config.time_step*60*1000);\r\n\t\t\t\t\t\t\tvar diff = (dt.getDate()!=tdate)?1:0; // moved or not to the next day\r\n\t\t\t\t\t\t\ti=diff*24*60+dt.getHours()*60+dt.getMinutes();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(options){\r\n\r\n\t\t\t\t\tvar ariaAttrs = scheduler._waiAria.lightboxSelectAttrString(time_option);\r\n\t\t\t\t\tvar readonly = sns.readonly ? \"disabled='disabled'\" : \"\";\r\n\t\t\t\t\thtml += \"\"+options+\" \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//var defaults = scheduler._lightbox_controls.defaults.select;\r\n\r\n\t\t\treturn \"\"+html+\" – \"+html+\"
\";\r\n\t\t},\r\n\t\tset_value:function(node,value,ev,config){\r\n\t\t\tvar cfg = scheduler.config;\r\n\t\t\tvar s=node.getElementsByTagName(\"select\");\r\n\t\t\tvar map = config._time_format_order;\r\n\t\t\tvar start_date, end_date;\r\n\r\n\t\t\tif(cfg.full_day) {\r\n\t\t\t\tif (!node._full_day){\r\n\t\t\t\t\tvar html = \" \"+scheduler.locale.labels.full_day+\" \";\r\n\t\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\t\thtml = node.previousSibling.innerHTML+html;\r\n\t\t\t\t\tnode.previousSibling.innerHTML=html;\r\n\t\t\t\t\tnode._full_day=true;\r\n\t\t\t\t}\r\n\t\t\t\tvar input=node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\t\t\t\tinput.checked = (scheduler.date.time_part(ev.start_date)===0 && scheduler.date.time_part(ev.end_date)===0);\r\n\r\n\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\tif(!input.$_eventAttached){\r\n\t\t\t\t\tinput.$_eventAttached = true;\r\n\r\n\t\t\t\t\t\tscheduler.event(input, \"click\", function(){\r\n\t\t\t\t\t\tif(input.checked) {\r\n\t\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\t\tscheduler.form_blocks.time.get_value(node,obj,config);\r\n\r\n\t\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\ts[map[0]].disabled=input.checked;\r\n\t\t\t\t\t\ts[ map[0] + s.length/2 ].disabled=input.checked;\r\n\r\n\t\t\t\t\t\t_fill_lightbox_select(s,0,start_date||ev.start_date);\r\n\t\t\t\t\t\t_fill_lightbox_select(s,4,end_date||ev.end_date);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(cfg.auto_end_date && cfg.event_duration) {\r\n\t\t\t\tvar _update_lightbox_select = function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!(cfg.auto_end_date && cfg.event_duration)){\r\n\t\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstart_date = new Date(s[map[3]].value,s[map[2]].value,s[map[1]].value,0,s[map[0]].value);\r\n\t\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\t\t\t\t\t_fill_lightbox_select(s, 4, end_date);\r\n\t\t\t\t};\r\n\t\t\t\tfor(var i=0; i<4; i++) {\r\n\t\t\t\t\tif(!s[i].$_eventAttached) {\r\n\t\t\t\t\t\ts[i].$_eventAttached = true;\r\n\t\t\t\t\t\tscheduler.event(s[i], \"change\", _update_lightbox_select);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction _fill_lightbox_select(s,i,d) {\r\n\t\t\t\tvar time_values = config._time_values;\r\n\t\t\t\tvar direct_value = d.getHours()*60+d.getMinutes();\r\n\t\t\t\tvar fixed_value = direct_value;\r\n\t\t\t\tvar value_found = false;\r\n\t\t\t\tfor (var k=0; k\";\r\n\t\tvar ariaAttr = \"\";\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\t\t\thtml += \"\";\r\n\t\t}\r\n\r\n\t\tbuttons = this.config.buttons_right;\r\n\t\tvar rtl = scheduler.config.rtl;\r\n\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\tariaAttr = this._waiAria.lightboxButtonAttrString(buttons[i]);\r\n\r\n\t\t\thtml += \"
\";\r\n\r\n\t\t\thtml += \"\";\r\n\t\t}\r\n\t\thtml += \" \";\r\n\t\thtml+=\"
\";\r\n\t\td.innerHTML=html;\r\n\t\tif (scheduler.config.drag_lightbox){\r\n\t\t\tscheduler.event(d.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\tscheduler.event(d.firstChild, \"selectstart\", function(e){ \r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn false; \r\n\t\t\t});\r\n\t\t\td.firstChild.style.cursor = \"move\";\r\n\t\t\tscheduler._init_dnd_events();\r\n\r\n\t\t}\r\n\r\n\t\tthis._waiAria.lightboxAttr(d);\r\n\r\n\t\tthis.show_cover();\r\n\t\tthis._cover.insertBefore(d,this._cover.firstChild);\r\n\t\t\r\n\t\tthis._lightbox=d;\r\n\r\n\t\tvar sns=this.config.lightbox.sections;\r\n\t\thtml=\"\";\r\n\t\tfor (var i=0; i < sns.length; i++) {\r\n\t\t\tvar block=this.form_blocks[sns[i].type];\r\n\t\t\tif (!block) continue; //ignore incorrect blocks\r\n\t\t\tsns[i].id=\"area_\"+this.uid();\r\n\t\t\tvar button = \"\";\r\n\t\t\tif (sns[i].button){\r\n\t\t\t\tvar ariaAttr = scheduler._waiAria.lightboxSectionButtonAttrString(this.locale.labels[\"button_\"+sns[i].button]);\r\n\t\t\t\tbutton = \"
\";\r\n\t\t\t}\r\n\r\n\t\t\tif (this.config.wide_form){\r\n\t\t\t\thtml+=\"
\";\r\n\t\t\t}\r\n\r\n\t\t\tvar label_name = this.locale.labels[\"section_\"+sns[i].name];\r\n\t\t\tif(typeof label_name !== \"string\"){\r\n\t\t\t\tlabel_name = sns[i].name;\r\n\t\t\t}\r\n\t\t\thtml+=\"
\"+button+ \"\"+label_name+\"
\"+block.render.call(this,sns[i]);\r\n\t\t\thtml+=\"
\";\r\n\t\t}\r\n\r\n\t\tvar ds=d.getElementsByTagName(\"div\");\r\n\t\tfor (var i=0; i
\r\n
\r\n
`;\r\n\r\n\r\n}","export default function extend(scheduler) {\r\n\r\nscheduler.getRootView = function() {\r\n\treturn {\r\n\t\tview: {\r\n\t\t\trender: function(){\r\n\t\t\t\treturn {\r\n\t\t\t\t\ttag: \"div\",\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tattrs: {\r\n\t\t\t\t\t\tstyle: \"width:100%;height:100%;\"\r\n\t\t\t\t\t},\r\n\t\t\t\t\thooks: {\r\n\t\t\t\t\t\t\"didInsert\": function(){\r\n\t\t\t\t\t\t\tscheduler.setCurrentView();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},\r\n\t\t\t\t\tbody: [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tel: this.el,\r\n\t\t\t\t\t\t\ttype: 1\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t};\r\n\t\t\t},\r\n\t\t\tinit: function(){\r\n\t\t\t\tvar container = document.createElement(\"DIV\");\r\n\t\t\t\tcontainer.id = \"scheduler_\"+ scheduler.uid();\r\n\t\t\t\tcontainer.style.width = \"100%\";\r\n\t\t\t\tcontainer.style.height = \"100%\";\r\n\t\t\t\tcontainer.classList.add(\"dhx_cal_container\");\r\n\t\t\t\tcontainer.cmp = \"grid\";\r\n\t\t\t\tcontainer.innerHTML = '
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'' +\r\n\t\t\t\t\t'
' +\r\n\t\t\t\t\t'
';\r\n\t\t\t\tscheduler.init(container);\r\n\r\n\t\t\t\tthis.el = container;\r\n\t\t\t}\r\n\t\t},\r\n\t\ttype: 4\r\n\t};\r\n};\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n\r\n(function(){\r\n\r\n\tvar setCurrentView = scheduler.setCurrentView,\r\n\t\tupdateView = scheduler.updateView;\r\n\tvar update_view_timer = null,\r\n\t\tcurr_view_timer = null;\r\n\r\n\tvar lazy_setCurrentView = function(date, mode){\r\n\t\tvar self = this;\r\n\t\tglobal.clearTimeout(curr_view_timer);\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\r\n\t\tvar oldDate = self._date,\r\n\t\t\toldMode = self._mode;\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tcurr_view_timer = setTimeout(function(){\r\n\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!self.callEvent(\"onBeforeViewChange\", [oldMode, oldDate, mode || self._mode, date || self._date])){\r\n\t\t\t\tupdateFlags(self, oldDate, oldMode);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tupdateView.call(self, date, mode);\r\n\t\t\tself.callEvent(\"onViewChange\", [self._mode, self._date]);\r\n\r\n\t\t\tglobal.clearTimeout(update_view_timer);\r\n\t\t\tcurr_view_timer = 0;\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tvar lazy_updateView = function(date, mode){\r\n\t\tvar self = this,\r\n\t\t\tars = arguments;\r\n\r\n\t\tupdateFlags(this, date, mode);\r\n\r\n\t\tglobal.clearTimeout(update_view_timer);\r\n\t\tupdate_view_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif(curr_view_timer)\r\n\t\t\t\treturn;\r\n\r\n\t\t\tupdateView.apply(self, ars);\r\n\t\t}, scheduler.config.delay_render);\r\n\t};\r\n\tfunction updateFlags(scheduler, date, mode){\r\n\t\tif(date)\r\n\t\t\tscheduler._date = date;\r\n\t\tif(mode)\r\n\t\t\tscheduler._mode = mode;\r\n\r\n\t}\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tif(scheduler.config.delay_render){\r\n\t\t\tscheduler.setCurrentView = lazy_setCurrentView;\r\n\t\t\tscheduler.updateView = lazy_updateView;\r\n\t\t}else{\r\n\t\t\tscheduler.setCurrentView = setCurrentView;\r\n\t\t\tscheduler.updateView = updateView;\r\n\t\t}\r\n\t});\r\n\r\n})();\r\n\r\n}","import global from \"../global\";\r\n\r\nexport default function extend(scheduler) {\r\n/*\r\nif (global.dataProcessor && !dataProcessor.prototype.init_original){\r\n\tdataProcessor.prototype.init_original=dataProcessor.prototype.init;\r\n\tdataProcessor.prototype.init=function(obj){\r\n\t\tthis.init_original(obj);\r\n\t\tobj._dataprocessor=this;\r\n\r\n\t\tthis.setTransactionMode(\"POST\",true);\r\n\t\tthis.serverProcessor+=(this.serverProcessor.indexOf(\"?\")!=-1?\"&\":\"?\")+\"editing=true\";\r\n\t};\r\n}*/\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tif(typeof dhtmlxError !== \"undefined\") {\r\n\t\twindow.dhtmlxError.catchError(\"LoadXML\", function(a, b, c){\r\n\t\t\tvar message = c[0].responseText;\r\n\r\n\t\t\tswitch (scheduler.config.ajax_error){\r\n\t\t\t\tcase \"alert\":\r\n\t\t\t\t\tglobal.alert(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"console\":\r\n\t\t\t\t\tglobal.console.log(message);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n}","import ar from \"./locale_ar\";\r\nimport be from \"./locale_be\";\r\nimport ca from \"./locale_ca\";\r\nimport cn from \"./locale_cn\";\r\nimport cs from \"./locale_cs\";\r\nimport da from \"./locale_da\";\r\nimport de from \"./locale_de\";\r\nimport el from \"./locale_el\";\r\nimport en from \"./locale_en\";\r\nimport es from \"./locale_es\";\r\nimport fi from \"./locale_fi\";\r\nimport fr from \"./locale_fr\";\r\nimport he from \"./locale_he\";\r\nimport hu from \"./locale_hu\";\r\nimport id from \"./locale_id\";\r\nimport it from \"./locale_it\";\r\nimport jp from \"./locale_jp\";\r\n\r\nimport LocaleManager from \"./locale_manager\";\r\n\r\nimport nb from \"./locale_nb\";\r\nimport nl from \"./locale_nl\";\r\nimport no from \"./locale_no\";\r\nimport pl from \"./locale_pl\";\r\nimport pt from \"./locale_pt\";\r\nimport ro from \"./locale_ro\";\r\nimport ru from \"./locale_ru\";\r\nimport si from \"./locale_si\";\r\nimport sk from \"./locale_sk\";\r\nimport sv from \"./locale_sv\";\r\nimport tr from \"./locale_tr\";\r\nimport ua from \"./locale_ua\";\r\n\r\nexport default function(){\r\n\treturn new LocaleManager({\r\n\t\ten,\r\n\t\tar,\r\n\t\tbe,\r\n\t\tca,\r\n\t\tcn,\r\n\t\tcs,\r\n\t\tda,\r\n\t\tde,\r\n\t\tel,\r\n\t\tes,\r\n\t\tfi,\r\n\t\tfr,\r\n\t\the,\r\n\t\thu,\r\n\t\tid,\r\n\t\tit,\r\n\t\tjp,\r\n\t\tnb,\r\n\t\tnl,\r\n\t\tno,\r\n\t\tpl,\r\n\t\tpt,\r\n\t\tro,\r\n\t\tru,\r\n\t\tsi,\r\n\t\tsk,\r\n\t\tsv,\r\n\t\ttr,\r\n\t\tua\r\n\t});\r\n}","export default class ExtensionsManager{\r\n\tconstructor(config){\r\n\t\tthis._extensions = {};\r\n\t\tfor(const i in config){\r\n\t\t\tthis._extensions[i] = config[i];\r\n\t\t}\r\n\t}\r\n\r\n\taddExtension(name, ext) {\r\n\t\tthis._extensions[name] = ext;\r\n\t}\r\n\r\n\tgetExtension(name) {\r\n\t\treturn this._extensions[name];\r\n\t}\r\n}","\r\nexport default function(){\r\n/* global dhtmlx */\r\nif (typeof dhtmlx != \"undefined\" && dhtmlx.attaches) {\r\n\tdhtmlx.attaches.attachScheduler = function (day, mode, tabs, scheduler) {\r\n\t\tvar tabs = tabs || '
';\r\n\t\tvar obj = document.createElement(\"DIV\");\r\n\t\tobj.id = \"dhxSchedObj_\" + this._genStr(12);\r\n\t\tobj.innerHTML = '
';\r\n\t\tdocument.body.appendChild(obj.firstChild);\r\n\r\n\t\tthis.attachObject(obj.id, false, true);\r\n\r\n\t\tthis.vs[this.av].sched = scheduler;\r\n\t\tthis.vs[this.av].schedId = obj.id;\r\n\t\tscheduler.setSizes = scheduler.updateView;\r\n\t\tscheduler.destructor = function () { };\r\n\t\tscheduler.init(obj.id, day, mode);\r\n\r\n\t\treturn this.vs[this._viewRestore()].sched;\r\n\t};\r\n}\r\n\r\n}","export default {\r\n\talert: (extension, assert) => {\r\n\t\tassert(false, `The ${extension} extension is not included in this version of dhtmlxScheduler.
\r\n\t\tYou may need a
Professional version of the component .
\r\n\t\tContact us at
https://dhtmlx.com/docs/contact.shtml if you have any questions.`);\r\n\t}\r\n};","export default function(scheduler){\r\n\r\n\r\n\r\n(function(){\r\n\tvar modalsStack = [];\r\n\r\n\tfunction isModal(){\r\n\t\treturn !!(modalsStack.length);\r\n\t}\r\n\r\n\tfunction isChildOf(child, parent){\r\n\t\twhile(child && child != parent){\r\n\t\t\tchild = child.parentNode;\r\n\t\t}\r\n\r\n\t\treturn !!(child == parent);\r\n\t}\r\n\r\n\tfunction afterPopup(box){\r\n\t\tsetTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!isModal() && !(isChildOf(document.activeElement, scheduler.$container))) {\r\n\t\t\t\tscheduler.focus();\r\n\t\t\t}\r\n\t\t}, 1);\r\n\t}\r\n\tfunction startModal(box){\r\n\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\tmodalsStack.push(box);\r\n\t\t//scheduler.$keyboardNavigation.dispatcher.disable();\r\n\t}\r\n\r\n\tfunction endModal(){\r\n\t\tvar box = modalsStack.pop();\r\n\t\tif(box) {\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t}\r\n\t\tafterPopup(box);\r\n\r\n\t}\r\n\r\n\tfunction isTopModal(box){\r\n\t//\tif(dhtmlx._modalsStack.length){\r\n\t//\t\treturn box == dhtmlx._modalsStack[dhtmlx._modalsStack.length - 1];\r\n\t//\t}else{\r\n\t\t\treturn box == modalsStack[modalsStack.length - 1];\r\n\t//\t}\r\n\r\n\t}\r\n\r\n\tfunction trapFocus(event){\r\n\t\tvar event = event || window.event;\r\n\t\tvar target = event.currentTarget;\r\n\t\tif(!isTopModal(target)) return;\r\n\r\n\t\tscheduler.$keyboardNavigation.trapFocus(target, event);\r\n\t}\r\n\r\n\tfunction traceLightbox(){\r\n\t\tstartModal(scheduler.getLightbox());\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", traceLightbox);\r\n\tscheduler.attachEvent(\"onAfterLightbox\", endModal);\r\n\r\n\tscheduler.attachEvent(\"onAfterQuickInfo\", function(){afterPopup();});\r\n\r\n\tif(!scheduler._keyNavMessagePopup) {\r\n\t\tscheduler._keyNavMessagePopup = true;\r\n\r\n\t\tvar focusElement = null;\r\n\t\tvar backupFocus = null;\r\n\t\tconst modalsStack = [];\r\n\t\tscheduler.attachEvent(\"onMessagePopup\", function(box){\r\n\t\t\tfocusElement = document.activeElement;\r\n\t\t\tbackupFocus = focusElement;\r\n\r\n\t\t\twhile(backupFocus && scheduler._getClassName(backupFocus).indexOf(\"dhx_cal_data\") < 0){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\t\t\tif(backupFocus){\r\n\t\t\t\tbackupFocus = backupFocus.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\tscheduler.event(box, \"keydown\", trapFocus);\r\n\t\t\tmodalsStack.push(box);\r\n\t\t});\r\n\r\n\r\n\t\tscheduler.attachEvent(\"onAfterMessagePopup\", function () {\r\n\t\t\tvar box = modalsStack.pop();\r\n\t\t\tif(box) {\r\n\t\t\t\tscheduler.eventRemove(box, \"keydown\", trapFocus);\r\n\t\t\t}\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tvar currentTarget = document.activeElement;\r\n\t\t\t\twhile(currentTarget && scheduler._getClassName(currentTarget).indexOf(\"dhx_cal_light\") < 0){\r\n\t\t\t\t\tcurrentTarget = currentTarget.parentNode;\r\n\t\t\t\t}\r\n\t\t\t\tif(currentTarget)\r\n\t\t\t\t\treturn;\r\n\r\n\r\n\t\t\t\tif(focusElement && focusElement.parentNode){\r\n\t\t\t\t\tfocusElement.focus();\r\n\r\n\t\t\t\t}else if(backupFocus && backupFocus.parentNode){\r\n\t\t\t\t\tbackupFocus.focus();\r\n\t\t\t\t}\r\n\t\t\t\tfocusElement = null;\r\n\t\t\t\tbackupFocus = null;\r\n\r\n\t\t\t}, 1);\r\n\t\t});\r\n\t}\r\n\r\n\tscheduler.$keyboardNavigation.isModal = isModal;\r\n\r\n\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\n//Initial idea and implementation by Steve MC\r\nscheduler._temp_key_scope = function (){\r\n\r\n\tscheduler.config.key_nav = true;\r\n\r\n\tscheduler.$keyboardNavigation._pasteDate = null; // used for copy and paste operations\r\n\tscheduler.$keyboardNavigation._pasteSection = null; // used for copy and paste operations\r\n\tvar isCopy = null;\r\n\r\n\tvar pos = {};\r\n\r\n\tif(!document.body){\r\n\t\tscheduler.event(window, \"load\", function(){\r\n\t\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t\t});\r\n\t}else{\r\n\t\tscheduler.event(document.body, \"mousemove\", trackMousePosition);\r\n\t}\r\n\r\n\tfunction trackMousePosition(event){\r\n\t\tevent = event || window.event;\r\n\t\tpos.x = event.clientX;\r\n\t\tpos.y = event.clientY;\r\n\t}\r\n\tfunction currentTarget(){\r\n\r\n\t\tvar mousePointer = false;\r\n\t\tvar keyNavPointer = false;\r\n\r\n\t\tvar target = document.elementFromPoint(pos.x, pos.y);\r\n\t\twhile(target && target != scheduler._obj){\r\n\t\t\ttarget = target.parentNode;\r\n\t\t}\r\n\t\tmousePointer = !!(target == scheduler._obj);\r\n\r\n\t\tkeyNavPointer = scheduler.$keyboardNavigation.dispatcher.isEnabled();\r\n\r\n\t\treturn mousePointer || keyNavPointer;\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onMouseMove\", function(id,e){\r\n\t\tvar state = scheduler.getState();\r\n\r\n\t\t// make sure scheduler is fully initialized before calling scheduler.getActionData\r\n\t\tif(!(state.mode && state.min_date)){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar position = scheduler.getActionData(e);\r\n\t\tscheduler.$keyboardNavigation._pasteDate = position.date;\r\n\t\tscheduler.$keyboardNavigation._pasteSection = position.section;\r\n\t});\r\n\r\n\tfunction clear_event_after(ev){\r\n\t\tdelete ev.rec_type; delete ev.rec_pattern;\r\n\t\tdelete ev.event_pid; delete ev.event_length;\r\n\t}\r\n\r\n\tfunction copyEvent(ev){\r\n\t\treturn scheduler._lame_copy({}, ev);\r\n\t}\r\n\r\n\tscheduler._make_pasted_event = function(ev){\r\n\t\tvar date = scheduler.$keyboardNavigation._pasteDate;\r\n\t\tvar section = scheduler.$keyboardNavigation._pasteSection;\r\n\r\n\t\tvar event_duration = ev.end_date-ev.start_date;\r\n\r\n\t\tvar copy = copyEvent(ev);\r\n\t\tclear_event_after(copy);\r\n\t\tcopy.start_date = new Date(date);\r\n\t\tcopy.end_date = new Date(copy.start_date.valueOf() + event_duration);\r\n\r\n\t\tif(section){\r\n\t\t\tvar property = scheduler._get_section_property();\r\n\t\t\t// GS-2527: if the event has multiple sections, it will be inserted into the initial sections.\r\n\t\t\tif(scheduler.config.multisection && ev[property] && scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(ev)) \r\n\t\t\t\tcopy[property] = ev[property]; // save initial set of resources for multisection view\r\n\t\t\telse\r\n\t\t\t\tcopy[property] = section;\r\n\t\t}\r\n\t\treturn copy;\r\n\t};\r\n\tscheduler._do_paste = function(is_copy, modified_ev, original_ev){\r\n\t\tif(scheduler.callEvent(\"onBeforeEventPasted\", [is_copy, modified_ev, original_ev]) === false){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tscheduler.addEvent(modified_ev);\r\n\t\tscheduler.callEvent(\"onEventPasted\", [is_copy, modified_ev, original_ev]);\r\n\t};\r\n\r\n\tscheduler._is_key_nav_active = function(){\r\n\t\tif(this._is_initialized() && !this._is_lightbox_open() && this.config.key_nav){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t};\r\n\r\n\tfunction getSelectedEvent(){\r\n\t\tvar node = scheduler.$keyboardNavigation.dispatcher.getActiveNode();\r\n\t\tif(node && node.eventId) return node.eventId;\r\n\t\treturn scheduler._select_id;\r\n\t}\r\n\r\n\tscheduler.event(document, \"keydown\", function(e){\r\n\t\t// compatibility fix - scheduler focus on ctrl+v on mouse hover\r\n\t\tif(((e.ctrlKey || e.metaKey) && e.keyCode == 86) && scheduler._buffer_event && !scheduler.$keyboardNavigation.dispatcher.isEnabled()) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.isActive = currentTarget();\r\n\t\t}\r\n\t});\r\n\r\n\tscheduler._key_nav_copy_paste = function(e){\r\n\t\tif(!scheduler._is_key_nav_active()) return true;\r\n\r\n\t\tif (e.keyCode == 37 || e.keyCode == 39) { // Left, Right arrows\r\n\t\t\te.cancelBubble = true;\r\n\r\n\t\t\tvar next = scheduler.date.add(scheduler._date,(e.keyCode == 37 ? -1 : 1 ),scheduler._mode);\r\n\t\t\tscheduler.setCurrentView(next);\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar select_id = getSelectedEvent();\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 67) { // CTRL+C\r\n\t\t\tif (select_id) {\r\n\t\t\t\tscheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\t\t\t\tisCopy = true;\r\n\t\t\t\tscheduler.callEvent(\"onEventCopied\", [scheduler.getEvent(select_id)]);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 88) { // CTRL+X\r\n\t\t\tif (select_id) {\r\n\t\t\t\tisCopy = false;\r\n\t\t\t\tvar ev = scheduler._buffer_event = copyEvent(scheduler.getEvent(select_id));\r\n\r\n\t\t\t\tscheduler.updateEvent(ev.id);\r\n\t\t\t\tscheduler.callEvent(\"onEventCut\", [ev]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ((e.ctrlKey || e.metaKey) && e.keyCode == 86 && currentTarget(e)) { // CTRL+V\r\n\t\t\tvar ev = scheduler._buffer_event ? scheduler.getEvent(scheduler._buffer_event.id) : scheduler._buffer_event;\r\n\t\t\tev = ev || scheduler._buffer_event;\r\n\r\n\t\t\tif (ev) {\r\n\t\t\t\tvar new_ev = scheduler._make_pasted_event(ev);\r\n\t\t\t\tif (isCopy) {\r\n\t\t\t\t\tnew_ev.id = scheduler.uid();\r\n\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t}\r\n\t\t\t\telse { // cut operation\r\n\t\t\t\t\tvar res = scheduler.callEvent(\"onBeforeEventChanged\",[new_ev, e, false, ev]);\r\n\t\t\t\t\tif (res) {\r\n\t\t\t\t\t\tscheduler._do_paste(isCopy, new_ev, ev);\r\n\t\t\t\t\t\tisCopy = true; // switch to copy after first paste operation\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n};\r\nscheduler._temp_key_scope();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.attachSchedulerHandlers = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tvar keyDownHandler = function(e){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\treturn dispatcher.keyDownHandler(e);\r\n\t};\r\n\r\n\tvar focusHandler = function () {\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tdispatcher.focusGlobalNode();\r\n\t\t});\r\n\t};\r\n\r\n\tvar waitCall;\r\n\tscheduler.attachEvent(\"onDataRender\", function(){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!(dispatcher.isEnabled() && !scheduler.getState().editor_id)) return;\r\n\r\n\t\tclearTimeout(waitCall);\r\n\t\twaitCall = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tif(!dispatcher.isEnabled())\r\n\t\t\t\tdispatcher.enable();\r\n\t\t\treFocusActiveNode();\r\n\t\t});\r\n\t});\r\n\r\n\tvar reFocusActiveNode = function(){\r\n\t\tif(!dispatcher.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\tif(!activeNode)\r\n\t\t\treturn;\r\n\r\n\t\tif(!activeNode.isValid()){\r\n\t\t\tactiveNode = activeNode.fallback();\r\n\t\t}\r\n\r\n\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell)\r\n\t\t\treturn;\r\n\r\n\t\tdispatcher.keepScrollPosition(function () {\r\n\t\t\tactiveNode.focus(true);\r\n\t\t});\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\tvar container = scheduler.$container;\r\n\t\tscheduler.eventRemove(document, \"keydown\", keyDownHandler);\r\n\t\tscheduler.eventRemove(container, \"mousedown\", mousedownHandler);\r\n\t\tscheduler.eventRemove(container, \"focus\", focusHandler);\r\n\r\n\r\n\t\tif(scheduler.config.key_nav){\r\n\r\n\t\t\tscheduler.event(document, \"keydown\", keyDownHandler);\r\n\t\t\tscheduler.event(container, \"mousedown\", mousedownHandler);\r\n\t\t\tscheduler.event(container, \"focus\", focusHandler);\r\n\r\n\t\t\tcontainer.setAttribute(\"tabindex\", \"0\");\r\n\r\n\t\t}else{\r\n\t\t\tcontainer.removeAttribute(\"tabindex\");\r\n\t\t}\r\n\t});\r\n\r\n\tfunction mousedownHandler(e){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\r\n\t\tconst view = scheduler.getView();\r\n\t\tlet dataAreaClick = false;\r\n\t\tif (scheduler.getState().mode === \"month\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_cal_month_table\"));\r\n\t\t} else if (view && view.layout === \"timeline\") {\r\n\t\t\tdataAreaClick = scheduler.$keyboardNavigation.isChildOf(e.target || e.srcElement, scheduler.$container.querySelector(\".dhx_timeline_data_col\"));\r\n\t\t} else {\r\n\t\t\tconst listOfScales = scheduler.$container.querySelectorAll(\".dhx_scale_holder\");\r\n\t\t\tconst arrOfScales = Array.from(listOfScales);\r\n\t\t\tdataAreaClick = arrOfScales.some(scale => scale === e.target.parentNode);\r\n\t\t}\r\n\r\n\t\tvar pos = scheduler.getActionData(e);\r\n\r\n\t\tvar focusNode;\r\n\t\tif(scheduler._locate_event(e.target || e.srcElement)){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.Event(scheduler._locate_event(e.target || e.srcElement));\r\n\t\t}else if(dataAreaClick){\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(pos.date && dataAreaClick){\r\n\t\t\t\tfocusNode = focusNode.nextSlot(new scheduler.$keyboardNavigation.TimeSlot(pos.date, null, pos.section));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(focusNode) {\r\n\t\t\tif (!dispatcher.isEnabled()) {\r\n\t\t\t\tdispatcher.activeNode = focusNode;\r\n\r\n\t\t\t} else {\r\n\t\t\t\tif (pos.date && dataAreaClick) {\r\n\t\t\t\t\tdispatcher.delay(function () {\r\n\t\t\t\t\t\tdispatcher.setActiveNode(focusNode);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfunction focusEvent(evNode){\r\n\t\tif(!scheduler.config.key_nav) return;\r\n\t\tif(!dispatcher.isEnabled()) return;\r\n\r\n\r\n\t\tvar prevState = evNode;\r\n\t\tvar focusNode = new scheduler.$keyboardNavigation.Event(prevState.eventId);\r\n\t\tif(!focusNode.isValid()){\r\n\t\t\tvar lastStart = focusNode.start || prevState.start;\r\n\t\t\tvar lastEnd = focusNode.end || prevState.end;\r\n\t\t\tvar lastSection = focusNode.section || prevState.section;\r\n\r\n\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot(lastStart, lastEnd, lastSection);\r\n\t\t\tif(!focusNode.isValid()){\r\n\t\t\t\tfocusNode = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdispatcher.setActiveNode(focusNode);\r\n\t\tvar node = dispatcher.getActiveNode();\r\n\t\tif(node && node.getNode && document.activeElement != node.getNode()){\r\n\t\t\tdispatcher.focusNode(dispatcher.getActiveNode());\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar updateEvent = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\tvar res = updateEvent.apply(this, arguments);\r\n\t\tif(scheduler.config.key_nav && dispatcher.isEnabled()){\r\n\t\t\tif(scheduler.getState().select_id == id){\r\n\t\t\t\tvar element = new scheduler.$keyboardNavigation.Event(id);\r\n\r\n\t\t\t\tif(!scheduler.getState().lightbox_id){\r\n\t\t\t\t\tfocusEvent(element);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id) {\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tvar activeNode = dispatcher.getActiveNode();\r\n\t\t\tif(activeNode.eventId == id){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function(){\r\n\t\tif(!scheduler.config.key_nav) return true;\r\n\t\tif(dispatcher.isEnabled()){\r\n\t\t\tif(dispatcher.getActiveNode() instanceof scheduler.$keyboardNavigation.Event){\r\n\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\r\n};\r\n\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\ndeclare let google: any;\r\n\r\nexport class GoogleMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tprivate infoWindow: any;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tlet zoom = this.settings.zoom_after_resolve || this.settings.initial_zoom;\r\n\t\t\t\t\tif (event.lat && event.lng){\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: event.lat, \r\n\t\t\t\t\t\t\tlng: event.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t} else {\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.map.setCenter({\r\n\t\t\t\t\t\t\tlat: this.settings.error_position.lat, \r\n\t\t\t\t\t\t\tlng: this.settings.error_position.lng,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tthis.map.setZoom(zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgoogle.maps.event.trigger(this._markers[i].marker, 'click');\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tthis.settings = options;\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapOptions = {\r\n\t\t\tcenter: { lat: options.initial_position.lat, lng: options.initial_position.lng },\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tmapId: container.id,\r\n\t\t\tscrollwheel: true,\r\n\t\t\tmapTypeId: options.type\r\n\t\t}\r\n\t\t// we need to reuse the google map to avoid leak memory\r\n\t\tif (this.map === null) {\r\n\t\t\tthis.map = new google.maps.Map(container, mapOptions);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tlet map = this.map;\r\n\t\t\tcontainer.appendChild(this.map.__gm.messageOverlay);\r\n\t\t\tcontainer.appendChild(this.map.__gm.outerContainer);\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tmap.setOptions({container: container.id});\r\n\t\t\t}, 500);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(this.map, \"dblclick\", function(event) {\r\n\t\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\r\n\t\t\tif (!scheduler.config.readonly && scheduler.config.dblclick_create) {\r\n\t\t\t\tlet point = event.latLng;\r\n\t\t\t\tgeocoder.geocode(\r\n\t\t\t\t\t{ 'latLng': point },\r\n\t\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\t\tpoint = results[0].geometry.location;\r\n\t\t\t\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\t\t\t\tlat: point.lat(),\r\n\t\t\t\t\t\t\t\tlng: point.lng(),\r\n\t\t\t\t\t\t\t\tevent_location: results[0].formatted_address,\r\n\t\t\t\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tgoogle.maps.event.clearInstanceListeners(window);\r\n\t\tgoogle.maps.event.clearInstanceListeners(document);\r\n\t\tgoogle.maps.event.clearInstanceListeners(container);\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\tasync addEventMarker(event: ICalendarEvent): Promise
{\r\n\t\tlet config = {\r\n\t\t\ttitle: event.text,\r\n\t\t\tposition: {},\r\n\t\t\tmap: {}\r\n\t\t}\r\n\t\t\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tconfig.position = { lat: event.lat, lng: event.lng };\r\n\t\t} else {\r\n\t\t\tconfig.position = { lat: this.settings.error_position.lat, lng: this.settings.error_position.lng }\r\n\t\t}\r\n\t\tconst { AdvancedMarkerElement } = await google.maps.importLibrary(\"marker\");\r\n\t\tlet marker;\r\n\t\tif (this.scheduler.ext.mapView.createMarker) {\r\n\t\t\tconfig.map = this.map;\r\n\t\t\tmarker = this.scheduler.ext.mapView.createMarker(config);\r\n\t\t} else {\r\n\t\t\tmarker = new AdvancedMarkerElement(config);\r\n\t\t\tmarker.map = this.map;\r\n\t\t}\r\n\t\tmarker.setMap(this.map);\r\n\t\t//case for markeks which were deleted with DataProcessor\r\n\t\tif (event[\"!nativeeditor_status\"] == \"true_deleted\"){\r\n\t\t\tmarker.setMap(null);\r\n\t\t}\r\n\t\tgoogle.maps.event.addListener(marker, \"click\", () => {\r\n\t\t\tif (this.infoWindow) {\r\n\t\t\t\tthis.infoWindow.close();\r\n\t\t\t}\r\n\t\t\tthis.infoWindow = new google.maps.InfoWindow({maxWidth: this.settings.info_window_max_width});\r\n\t\t\tthis.infoWindow.setContent(this.scheduler.templates.map_info_content(event));\r\n\t\t\tthis.infoWindow.open({\r\n\t\t\t\tanchor: marker,\r\n\t\t\t\tmap: this.map,\r\n\t\t\t});\r\n\t\t});\r\n\t\tlet markerInfo = {event, ...config, marker};\r\n\t\tthis._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.setVisible(false);\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t\tthis._markers[i].marker.setPosition(null);\r\n\t\t\t\tthis._markers[i].marker = null;\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tthis._markers[i].position.lat = event.lat;\r\n\t\t\t\tthis._markers[i].position.lng = event.lng;\r\n\t\t\t\tthis._markers[i].text = event.text;\r\n\t\t\t\tlet latlng = new google.maps.LatLng(event.lat, event.lng);\r\n\t\t\t\tthis._markers[i].marker.setPosition(latlng);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif (this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis._markers[i].marker.setMap(null);\r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setCenter({\r\n\t\t\tlat: latitude, \r\n\t\t\tlng: longitude,\r\n\t\t});\r\n\t\tthis.map.setZoom(zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst geocoder = new google.maps.Geocoder();\r\n\t\tlet position: any = await new Promise((resolve) => {\r\n\t\t\tgeocoder.geocode(\r\n\t\t\t\t{ 'address': string },\r\n\t\t\t\tfunction(results, status) {\r\n\t\t\t\t\tif (status == google.maps.GeocoderStatus.OK) {\r\n\t\t\t\t\t\tresolve({\r\n\t\t\t\t\t\t lat: results[0].geometry.location.lat(),\r\n\t\t\t\t\t\t lng: results[0].geometry.location.lng()\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.error('Geocode was not successful for the following reason: ' + status);\r\n\t\t\t\t\t\tresolve({});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t});\r\n\t\treturn position;\r\n\t}\r\n\t\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let L: any\r\n\r\nexport class OpenStreetMapAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate _markers: any[];\r\n\tprivate settings: IMapSettings;\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.openPopup();\r\n\t\t\t\t\tthis._markers[i].marker.closeTooltip();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n\t\tlet scheduler = this.scheduler;\r\n\t\tlet mapWrapper = document.createElement('div');\r\n\t\tmapWrapper.className = 'mapWrapper';\r\n\t\tmapWrapper.id = 'mapWrapper';\r\n\t\tmapWrapper.style.width = container.style.width;\r\n\t\tmapWrapper.style.height = container.style.height;\r\n\t\tcontainer.appendChild(mapWrapper);\r\n\r\n\t\tlet map = L.map(mapWrapper, {\r\n\t\t\tcenter: L.latLng(options.initial_position.lat, options.initial_position.lng),\r\n\t\t\tzoom: options.initial_zoom,\r\n\t\t\tkeyboard: false // need to set false, due to bug with moving window\r\n\t\t});\r\n\t\tL.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);\r\n\t\tmap.on(\"dblclick\", async function(e){\r\n\t\t\tconst settings = {\r\n\t\t\t\t\"method\": \"GET\",\r\n\t\t\t\theaders: {\r\n\t\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/reverse?lat=${e.latlng.lat}&lon=${e.latlng.lng}&format=json`, settings).then(response => response.json());\r\n\t\t\tif (response.address) {\r\n\t\t\t\tlet address = response.address.country;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.latlng.lat,\r\n\t\t\t\t\tlng: e.latlng.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\", response.error);\r\n\t\t\t}\r\n\t\t});\r\n\t\tthis.map = map;\r\n\t\tthis.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n\t\twhile (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n\t\tcontainer.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n\t\tconst myIcon = L.icon({\r\n\t\t\ticonUrl: 'https://unpkg.com/leaflet@1.0.3/dist/images/marker-icon.png',\r\n\t\t\ticonSize: [25, 41],\r\n\t\t\tshadowSize: [30, 65],\r\n\t\t\ticonAnchor: [12, 41],\r\n\t\t\tshadowAnchor: [7, 65]\r\n\t\t});\r\n\t\tlet popupConfig = {\r\n\t\t\tminWidth: 180,\r\n\t\t\tmaxWidth: this.settings.info_window_max_width,\r\n\t\t}\r\n\t\tconst markerPopup = L.popup(popupConfig).setContent(this.scheduler.templates.map_info_content(event));\r\n\t\tconst tooltip = L.tooltip().setContent(event.text);\r\n\r\n\t\tlet markerConfig = [\r\n\t\t\tevent.lat,\r\n\t\t\tevent.lng\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tmarkerConfig = [this.settings.error_position.lat, this.settings.error_position.lng];\r\n\t\t}\r\n\t\tconst marker = L.marker(markerConfig, {\r\n\t\t\ticon: myIcon\r\n\t\t}).bindPopup(markerPopup).bindTooltip(tooltip).addTo(this.map);\r\n\t\tconst markerInfo = {event, marker};\r\n\t\tthis._markers.push(markerInfo);\t\t\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker);\r\n\t\t\t\tthis._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([this.settings.error_position.lat, this.settings.error_position.lng]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLatLng([event.lat, event.lng]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tif(this._markers) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\t\tthis.map.removeLayer(this._markers[i].marker); \r\n\t\t\t}\r\n\t\t\tthis._markers = [];\r\n\t\t}\r\n\t}\r\n\r\n\tsetView(latitude: number, longitude: number, zoom: number): void {\r\n\t\tthis.map.setView([latitude, longitude], zoom);\r\n\t}\r\n\r\n\tasync resolveAddress(string: string): Promise {\r\n\t\tconst settings = {\r\n\t\t\t\"method\": \"GET\",\r\n\t\t\theaders: {\r\n\t\t\t\t\"Accept-Language\": \"en\",\r\n\t\t\t},\r\n\t\t};\r\n\t\tlet position:any = {};\r\n\t\tlet response = await fetch(`https://nominatim.openstreetmap.org/search?q=${string}&format=json`, settings).then(response => response.json());\r\n\t\tif (response && response.length) {\r\n\t\t\tposition.lat = +response[0].lat;\r\n\t\t\tposition.lng = +response[0].lon;\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","import { IMapAdapter, ICalendarEvent, IMapSettings, IMapPosition} from \"./types\";\r\n\r\ndeclare let mapboxgl: any;\r\ndeclare let MapboxGeocoder: any;\r\n\r\nexport class MapboxAdapter implements IMapAdapter {\r\n\tprivate map: any;\r\n\tprivate scheduler: any;\r\n\tprivate settings: IMapSettings;\r\n\tprivate _markers: any[];\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.map = null;\r\n\t\tthis._markers = [];\r\n\t\tthis.scheduler = scheduler;\r\n\t}\r\n\tonEventClick(event: ICalendarEvent): void {\r\n\t\tif (this._markers && this._markers.length > 0) {\r\n\t\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n const popup = this._markers[i].marker.getPopup();\r\n if (popup.isOpen()){\r\n popup.remove();\r\n }\r\n\t\t\t\tif (event.id == this._markers[i].event.id) {\r\n\t\t\t\t\tthis._markers[i].marker.togglePopup();\r\n\t\t\t\t\tif (event.lat && event.lng) {\r\n\t\t\t\t\t\tthis.setView(event.lat, event.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.setView(this.settings.error_position.lat, this.settings.error_position.lng, this.settings.zoom_after_resolve || this.settings.initial_zoom);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t} \r\n\t}\r\n\r\n\tinitialize(container: HTMLElement, options: IMapSettings): void {\r\n let scheduler = this.scheduler;\r\n\r\n\t\tmapboxgl.accessToken = options.accessToken;\r\n const map = new mapboxgl.Map({\r\n container: container, \r\n center: [options.initial_position.lng, options.initial_position.lat], \r\n zoom: options.initial_zoom + 1, // problems with coordinates if zoom = 1\r\n });\r\n map.on(\"dblclick\",async function(e){\r\n\t\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${e.lngLat.lng},${ e.lngLat.lat}.json?access_token=${options.accessToken}`).then(response => response.json());\r\n\t\t\tif (response.features){\r\n\t\t\t\tlet address = response.features[0].place_name;\r\n\t\t\t\tscheduler.addEventNow({\r\n\t\t\t\t\tlat: e.lngLat.lat,\r\n\t\t\t\t\tlng: e.lngLat.lng,\r\n\t\t\t\t\tevent_location: address,\r\n\t\t\t\t\tstart_date: scheduler.getState().date,\r\n\t\t\t\t\tend_date: scheduler.date.add(scheduler.getState().date, scheduler.config.time_step, \"minute\")\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(\"unable recieve a position of the event\");\r\n\t\t\t}\r\n\t\t});\r\n this.map = map;\r\n this.settings = options;\r\n\t}\r\n\r\n\tdestroy(container: HTMLElement): void {\r\n\t\tthis.map.remove();\r\n while (container.firstChild) {\r\n\t\t\tcontainer.firstChild.remove();\r\n\t\t}\r\n container.innerHTML = \"\";\r\n\t}\r\n\r\n\taddEventMarker(event: ICalendarEvent): void {\r\n let config = [\r\n\t\t\tevent.lng,\r\n\t\t\tevent.lat\r\n\t\t]\r\n\t\t\r\n\t\tif (!event.lat || !event.lng) {\r\n\t\t\tconfig = [this.settings.error_position.lng, this.settings.error_position.lat];\r\n\t\t} \r\n\r\n\t\tconst popup = new mapboxgl.Popup({ offset: 25, focusAfterOpen: false})\r\n .setMaxWidth(`${this.settings.info_window_max_width}px`) \r\n .setHTML(this.scheduler.templates.map_info_content(event));\r\n const marker = new mapboxgl.Marker()\r\n .setLngLat(config)\r\n .setPopup(popup)\r\n .addTo(this.map);\r\n const markerInfo = {event, marker}; \r\n this._markers.push(markerInfo);\r\n\t}\r\n\r\n\tremoveEventMarker(eventId: string): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif (eventId == this._markers[i].event.id) {\r\n\t\t\t\tthis._markers[i].marker.remove();\r\n this._markers.splice(i,1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdateEventMarker(event: ICalendarEvent): void {\r\n\t\tfor (let i = 0; i < this._markers.length; i++) {\r\n\t\t\tif(this._markers[i].event.id == event.id) {\r\n\t\t\t\tthis._markers[i].event = event;\r\n\t\t\t\tif (!event.lat || !event.lng){\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([this.settings.error_position.lng, this.settings.error_position.lat]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._markers[i].marker.setLngLat([event.lng, event.lat]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tclearEventMarkers(): void {\r\n\t\tfor (let i = 0; i {\r\n\t\tlet response = await fetch(`https://api.mapbox.com/geocoding/v5/mapbox.places/${string}.json?access_token=${this.settings.accessToken}`).then(response => response.json());\r\n\t\tlet position:any = {};\r\n\t\tif (response && response.features.length) {\r\n\t\t\tposition.lng = response.features[0].center[0];\r\n\t\t\tposition.lat = response.features[0].center[1];\r\n\t\t} else {\r\n\t\t\tconsole.error(`Unable recieve a position of the event's location: ${string}`);\r\n\t\t}\r\n\t\treturn position;\r\n\t}\r\n}","// =============================================================================\n// Weekday\n// =============================================================================\nexport var ALL_WEEKDAYS = [\n 'MO',\n 'TU',\n 'WE',\n 'TH',\n 'FR',\n 'SA',\n 'SU',\n];\nvar Weekday = /** @class */ (function () {\n function Weekday(weekday, n) {\n if (n === 0)\n throw new Error(\"Can't create weekday with n == 0\");\n this.weekday = weekday;\n this.n = n;\n }\n Weekday.fromStr = function (str) {\n return new Weekday(ALL_WEEKDAYS.indexOf(str));\n };\n // __call__ - Cannot call the object directly, do it through\n // e.g. RRule.TH.nth(-1) instead,\n Weekday.prototype.nth = function (n) {\n return this.n === n ? this : new Weekday(this.weekday, n);\n };\n // __eq__\n Weekday.prototype.equals = function (other) {\n return this.weekday === other.weekday && this.n === other.n;\n };\n // __repr__\n Weekday.prototype.toString = function () {\n var s = ALL_WEEKDAYS[this.weekday];\n if (this.n)\n s = (this.n > 0 ? '+' : '') + String(this.n) + s;\n return s;\n };\n Weekday.prototype.getJsWeekday = function () {\n return this.weekday === 6 ? 0 : this.weekday + 1;\n };\n return Weekday;\n}());\nexport { Weekday };\n//# sourceMappingURL=weekday.js.map","// =============================================================================\n// Helper functions\n// =============================================================================\nimport { ALL_WEEKDAYS } from './weekday';\nexport var isPresent = function (value) {\n return value !== null && value !== undefined;\n};\nexport var isNumber = function (value) {\n return typeof value === 'number';\n};\nexport var isWeekdayStr = function (value) {\n return typeof value === 'string' && ALL_WEEKDAYS.includes(value);\n};\nexport var isArray = Array.isArray;\n/**\n * Simplified version of python's range()\n */\nexport var range = function (start, end) {\n if (end === void 0) { end = start; }\n if (arguments.length === 1) {\n end = start;\n start = 0;\n }\n var rang = [];\n for (var i = start; i < end; i++)\n rang.push(i);\n return rang;\n};\nexport var clone = function (array) {\n return [].concat(array);\n};\nexport var repeat = function (value, times) {\n var i = 0;\n var array = [];\n if (isArray(value)) {\n for (; i < times; i++)\n array[i] = [].concat(value);\n }\n else {\n for (; i < times; i++)\n array[i] = value;\n }\n return array;\n};\nexport var toArray = function (item) {\n if (isArray(item)) {\n return item;\n }\n return [item];\n};\nexport function padStart(item, targetLength, padString) {\n if (padString === void 0) { padString = ' '; }\n var str = String(item);\n targetLength = targetLength >> 0;\n if (str.length > targetLength) {\n return String(str);\n }\n targetLength = targetLength - str.length;\n if (targetLength > padString.length) {\n padString += repeat(padString, targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + String(str);\n}\n/**\n * Python like split\n */\nexport var split = function (str, sep, num) {\n var splits = str.split(sep);\n return num\n ? splits.slice(0, num).concat([splits.slice(num).join(sep)])\n : splits;\n};\n/**\n * closure/goog/math/math.js:modulo\n * Copyright 2006 The Closure Library Authors.\n * The % operator in JavaScript returns the remainder of a / b, but differs from\n * some other languages in that the result will have the same sign as the\n * dividend. For example, -1 % 8 == -1, whereas in some other languages\n * (such as Python) the result would be 7. This function emulates the more\n * correct modulo behavior, which is useful for certain applications such as\n * calculating an offset index in a circular list.\n *\n * @param {number} a The dividend.\n * @param {number} b The divisor.\n * @return {number} a % b where the result is between 0 and b (either 0 <= x < b\n * or b < x <= 0, depending on the sign of b).\n */\nexport var pymod = function (a, b) {\n var r = a % b;\n // If r and b differ in sign, add b to wrap the result to the correct sign.\n return r * b < 0 ? r + b : r;\n};\n/**\n * @see: \n */\nexport var divmod = function (a, b) {\n return { div: Math.floor(a / b), mod: pymod(a, b) };\n};\nexport var empty = function (obj) {\n return !isPresent(obj) || obj.length === 0;\n};\n/**\n * Python-like boolean\n *\n * @return {Boolean} value of an object/primitive, taking into account\n * the fact that in Python an empty list's/tuple's\n * boolean value is False, whereas in JS it's true\n */\nexport var notEmpty = function (obj) {\n return !empty(obj);\n};\n/**\n * Return true if a value is in an array\n */\nexport var includes = function (arr, val) {\n return notEmpty(arr) && arr.indexOf(val) !== -1;\n};\n//# sourceMappingURL=helpers.js.map","import { padStart } from './helpers';\nexport var datetime = function (y, m, d, h, i, s) {\n if (h === void 0) { h = 0; }\n if (i === void 0) { i = 0; }\n if (s === void 0) { s = 0; }\n return new Date(Date.UTC(y, m - 1, d, h, i, s));\n};\n/**\n * General date-related utilities.\n * Also handles several incompatibilities between JavaScript and Python\n *\n */\nexport var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n/**\n * Number of milliseconds of one day\n */\nexport var ONE_DAY = 1000 * 60 * 60 * 24;\n/**\n * @see: \n */\nexport var MAXYEAR = 9999;\n/**\n * Python uses 1-Jan-1 as the base for calculating ordinals but we don't\n * want to confuse the JS engine with milliseconds > Number.MAX_NUMBER,\n * therefore we use 1-Jan-1970 instead\n */\nexport var ORDINAL_BASE = datetime(1970, 1, 1);\n/**\n * Python: MO-SU: 0 - 6\n * JS: SU-SAT 0 - 6\n */\nexport var PY_WEEKDAYS = [6, 0, 1, 2, 3, 4, 5];\n/**\n * py_date.timetuple()[7]\n */\nexport var getYearDay = function (date) {\n var dateNoTime = new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n return (Math.ceil((dateNoTime.valueOf() - new Date(date.getUTCFullYear(), 0, 1).valueOf()) /\n ONE_DAY) + 1);\n};\nexport var isLeapYear = function (year) {\n return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n};\nexport var isDate = function (value) {\n return value instanceof Date;\n};\nexport var isValidDate = function (value) {\n return isDate(value) && !isNaN(value.getTime());\n};\n/**\n * @return {Number} the date's timezone offset in ms\n */\nexport var tzOffset = function (date) {\n return date.getTimezoneOffset() * 60 * 1000;\n};\n/**\n * @see: \n */\nexport var daysBetween = function (date1, date2) {\n // The number of milliseconds in one day\n // Convert both dates to milliseconds\n var date1ms = date1.getTime();\n var date2ms = date2.getTime();\n // Calculate the difference in milliseconds\n var differencems = date1ms - date2ms;\n // Convert back to days and return\n return Math.round(differencems / ONE_DAY);\n};\n/**\n * @see: \n */\nexport var toOrdinal = function (date) {\n return daysBetween(date, ORDINAL_BASE);\n};\n/**\n * @see - \n */\nexport var fromOrdinal = function (ordinal) {\n return new Date(ORDINAL_BASE.getTime() + ordinal * ONE_DAY);\n};\nexport var getMonthDays = function (date) {\n var month = date.getUTCMonth();\n return month === 1 && isLeapYear(date.getUTCFullYear())\n ? 29\n : MONTH_DAYS[month];\n};\n/**\n * @return {Number} python-like weekday\n */\nexport var getWeekday = function (date) {\n return PY_WEEKDAYS[date.getUTCDay()];\n};\n/**\n * @see: \n */\nexport var monthRange = function (year, month) {\n var date = datetime(year, month + 1, 1);\n return [getWeekday(date), getMonthDays(date)];\n};\n/**\n * @see: \n */\nexport var combine = function (date, time) {\n time = time || date;\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), time.getHours(), time.getMinutes(), time.getSeconds(), time.getMilliseconds()));\n};\nexport var clone = function (date) {\n var dolly = new Date(date.getTime());\n return dolly;\n};\nexport var cloneDates = function (dates) {\n var clones = [];\n for (var i = 0; i < dates.length; i++) {\n clones.push(clone(dates[i]));\n }\n return clones;\n};\n/**\n * Sorts an array of Date or Time objects\n */\nexport var sort = function (dates) {\n dates.sort(function (a, b) {\n return a.getTime() - b.getTime();\n });\n};\nexport var timeToUntilString = function (time, utc) {\n if (utc === void 0) { utc = true; }\n var date = new Date(time);\n return [\n padStart(date.getUTCFullYear().toString(), 4, '0'),\n padStart(date.getUTCMonth() + 1, 2, '0'),\n padStart(date.getUTCDate(), 2, '0'),\n 'T',\n padStart(date.getUTCHours(), 2, '0'),\n padStart(date.getUTCMinutes(), 2, '0'),\n padStart(date.getUTCSeconds(), 2, '0'),\n utc ? 'Z' : '',\n ].join('');\n};\nexport var untilStringToDate = function (until) {\n var re = /^(\\d{4})(\\d{2})(\\d{2})(T(\\d{2})(\\d{2})(\\d{2})Z?)?$/;\n var bits = re.exec(until);\n if (!bits)\n throw new Error(\"Invalid UNTIL value: \".concat(until));\n return new Date(Date.UTC(parseInt(bits[1], 10), parseInt(bits[2], 10) - 1, parseInt(bits[3], 10), parseInt(bits[5], 10) || 0, parseInt(bits[6], 10) || 0, parseInt(bits[7], 10) || 0));\n};\nvar dateTZtoISO8601 = function (date, timeZone) {\n // date format for sv-SE is almost ISO8601\n var dateStr = date.toLocaleString('sv-SE', { timeZone: timeZone });\n // '2023-02-07 10:41:36'\n return dateStr.replace(' ', 'T') + 'Z';\n};\nexport var dateInTimeZone = function (date, timeZone) {\n var localTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n // Date constructor can only reliably parse dates in ISO8601 format\n var dateInLocalTZ = new Date(dateTZtoISO8601(date, localTimeZone));\n var dateInTargetTZ = new Date(dateTZtoISO8601(date, timeZone !== null && timeZone !== void 0 ? timeZone : 'UTC'));\n var tzOffset = dateInTargetTZ.getTime() - dateInLocalTZ.getTime();\n return new Date(date.getTime() - tzOffset);\n};\n//# sourceMappingURL=dateutil.js.map","/**\n * This class helps us to emulate python's generators, sorta.\n */\nvar IterResult = /** @class */ (function () {\n function IterResult(method, args) {\n this.minDate = null;\n this.maxDate = null;\n this._result = [];\n this.total = 0;\n this.method = method;\n this.args = args;\n if (method === 'between') {\n this.maxDate = args.inc\n ? args.before\n : new Date(args.before.getTime() - 1);\n this.minDate = args.inc ? args.after : new Date(args.after.getTime() + 1);\n }\n else if (method === 'before') {\n this.maxDate = args.inc ? args.dt : new Date(args.dt.getTime() - 1);\n }\n else if (method === 'after') {\n this.minDate = args.inc ? args.dt : new Date(args.dt.getTime() + 1);\n }\n }\n /**\n * Possibly adds a date into the result.\n *\n * @param {Date} date - the date isn't necessarly added to the result\n * list (if it is too late/too early)\n * @return {Boolean} true if it makes sense to continue the iteration\n * false if we're done.\n */\n IterResult.prototype.accept = function (date) {\n ++this.total;\n var tooEarly = this.minDate && date < this.minDate;\n var tooLate = this.maxDate && date > this.maxDate;\n if (this.method === 'between') {\n if (tooEarly)\n return true;\n if (tooLate)\n return false;\n }\n else if (this.method === 'before') {\n if (tooLate)\n return false;\n }\n else if (this.method === 'after') {\n if (tooEarly)\n return true;\n this.add(date);\n return false;\n }\n return this.add(date);\n };\n /**\n *\n * @param {Date} date that is part of the result.\n * @return {Boolean} whether we are interested in more values.\n */\n IterResult.prototype.add = function (date) {\n this._result.push(date);\n return true;\n };\n /**\n * 'before' and 'after' return only one date, whereas 'all'\n * and 'between' an array.\n *\n * @return {Date,Array?}\n */\n IterResult.prototype.getValue = function () {\n var res = this._result;\n switch (this.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n case 'after':\n default:\n return (res.length ? res[res.length - 1] : null);\n }\n };\n IterResult.prototype.clone = function () {\n return new IterResult(this.method, this.args);\n };\n return IterResult;\n}());\nexport default IterResult;\n//# sourceMappingURL=iterresult.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { __extends } from \"tslib\";\nimport IterResult from './iterresult';\n/**\n * IterResult subclass that calls a callback function on each add,\n * and stops iterating when the callback returns false.\n */\nvar CallbackIterResult = /** @class */ (function (_super) {\n __extends(CallbackIterResult, _super);\n function CallbackIterResult(method, args, iterator) {\n var _this = _super.call(this, method, args) || this;\n _this.iterator = iterator;\n return _this;\n }\n CallbackIterResult.prototype.add = function (date) {\n if (this.iterator(date, this._result.length)) {\n this._result.push(date);\n return true;\n }\n return false;\n };\n return CallbackIterResult;\n}(IterResult));\nexport default CallbackIterResult;\n//# sourceMappingURL=callbackiterresult.js.map","export var Frequency;\n(function (Frequency) {\n Frequency[Frequency[\"YEARLY\"] = 0] = \"YEARLY\";\n Frequency[Frequency[\"MONTHLY\"] = 1] = \"MONTHLY\";\n Frequency[Frequency[\"WEEKLY\"] = 2] = \"WEEKLY\";\n Frequency[Frequency[\"DAILY\"] = 3] = \"DAILY\";\n Frequency[Frequency[\"HOURLY\"] = 4] = \"HOURLY\";\n Frequency[Frequency[\"MINUTELY\"] = 5] = \"MINUTELY\";\n Frequency[Frequency[\"SECONDLY\"] = 6] = \"SECONDLY\";\n})(Frequency || (Frequency = {}));\nexport function freqIsDailyOrGreater(freq) {\n return freq < Frequency.HOURLY;\n}\n//# sourceMappingURL=types.js.map","// =============================================================================\n// i18n\n// =============================================================================\nvar ENGLISH = {\n dayNames: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n ],\n monthNames: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December',\n ],\n tokens: {\n SKIP: /^[ \\r\\n\\t]+|^\\.$/,\n number: /^[1-9][0-9]*/,\n numberAsText: /^(one|two|three)/i,\n every: /^every/i,\n 'day(s)': /^days?/i,\n 'weekday(s)': /^weekdays?/i,\n 'week(s)': /^weeks?/i,\n 'hour(s)': /^hours?/i,\n 'minute(s)': /^minutes?/i,\n 'month(s)': /^months?/i,\n 'year(s)': /^years?/i,\n on: /^(on|in)/i,\n at: /^(at)/i,\n the: /^the/i,\n first: /^first/i,\n second: /^second/i,\n third: /^third/i,\n nth: /^([1-9][0-9]*)(\\.|th|nd|rd|st)/i,\n last: /^last/i,\n for: /^for/i,\n 'time(s)': /^times?/i,\n until: /^(un)?til/i,\n monday: /^mo(n(day)?)?/i,\n tuesday: /^tu(e(s(day)?)?)?/i,\n wednesday: /^we(d(n(esday)?)?)?/i,\n thursday: /^th(u(r(sday)?)?)?/i,\n friday: /^fr(i(day)?)?/i,\n saturday: /^sa(t(urday)?)?/i,\n sunday: /^su(n(day)?)?/i,\n january: /^jan(uary)?/i,\n february: /^feb(ruary)?/i,\n march: /^mar(ch)?/i,\n april: /^apr(il)?/i,\n may: /^may/i,\n june: /^june?/i,\n july: /^july?/i,\n august: /^aug(ust)?/i,\n september: /^sep(t(ember)?)?/i,\n october: /^oct(ober)?/i,\n november: /^nov(ember)?/i,\n december: /^dec(ember)?/i,\n comma: /^(,\\s*|(and|or)\\s*)+/i,\n },\n};\nexport default ENGLISH;\n//# sourceMappingURL=i18n.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\nimport { isArray, isNumber, isPresent } from '../helpers';\n// =============================================================================\n// Helper functions\n// =============================================================================\n/**\n * Return true if a value is in an array\n */\nvar contains = function (arr, val) {\n return arr.indexOf(val) !== -1;\n};\nvar defaultGetText = function (id) { return id.toString(); };\nvar defaultDateFormatter = function (year, month, day) { return \"\".concat(month, \" \").concat(day, \", \").concat(year); };\n/**\n *\n * @param {RRule} rrule\n * Optional:\n * @param {Function} gettext function\n * @param {Object} language definition\n * @constructor\n */\nvar ToText = /** @class */ (function () {\n function ToText(rrule, gettext, language, dateFormatter) {\n if (gettext === void 0) { gettext = defaultGetText; }\n if (language === void 0) { language = ENGLISH; }\n if (dateFormatter === void 0) { dateFormatter = defaultDateFormatter; }\n this.text = [];\n this.language = language || ENGLISH;\n this.gettext = gettext;\n this.dateFormatter = dateFormatter;\n this.rrule = rrule;\n this.options = rrule.options;\n this.origOptions = rrule.origOptions;\n if (this.origOptions.bymonthday) {\n var bymonthday = [].concat(this.options.bymonthday);\n var bynmonthday = [].concat(this.options.bynmonthday);\n bymonthday.sort(function (a, b) { return a - b; });\n bynmonthday.sort(function (a, b) { return b - a; });\n // 1, 2, 3, .., -5, -4, -3, ..\n this.bymonthday = bymonthday.concat(bynmonthday);\n if (!this.bymonthday.length)\n this.bymonthday = null;\n }\n if (isPresent(this.origOptions.byweekday)) {\n var byweekday = !isArray(this.origOptions.byweekday)\n ? [this.origOptions.byweekday]\n : this.origOptions.byweekday;\n var days = String(byweekday);\n this.byweekday = {\n allWeeks: byweekday.filter(function (weekday) {\n return !weekday.n;\n }),\n someWeeks: byweekday.filter(function (weekday) {\n return Boolean(weekday.n);\n }),\n isWeekdays: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') === -1 &&\n days.indexOf('SU') === -1,\n isEveryDay: days.indexOf('MO') !== -1 &&\n days.indexOf('TU') !== -1 &&\n days.indexOf('WE') !== -1 &&\n days.indexOf('TH') !== -1 &&\n days.indexOf('FR') !== -1 &&\n days.indexOf('SA') !== -1 &&\n days.indexOf('SU') !== -1,\n };\n var sortWeekDays = function (a, b) {\n return a.weekday - b.weekday;\n };\n this.byweekday.allWeeks.sort(sortWeekDays);\n this.byweekday.someWeeks.sort(sortWeekDays);\n if (!this.byweekday.allWeeks.length)\n this.byweekday.allWeeks = null;\n if (!this.byweekday.someWeeks.length)\n this.byweekday.someWeeks = null;\n }\n else {\n this.byweekday = null;\n }\n }\n /**\n * Test whether the rrule can be fully converted to text.\n *\n * @param {RRule} rrule\n * @return {Boolean}\n */\n ToText.isFullyConvertible = function (rrule) {\n var canConvert = true;\n if (!(rrule.options.freq in ToText.IMPLEMENTED))\n return false;\n if (rrule.origOptions.until && rrule.origOptions.count)\n return false;\n for (var key in rrule.origOptions) {\n if (contains(['dtstart', 'tzid', 'wkst', 'freq'], key))\n return true;\n if (!contains(ToText.IMPLEMENTED[rrule.options.freq], key))\n return false;\n }\n return canConvert;\n };\n ToText.prototype.isFullyConvertible = function () {\n return ToText.isFullyConvertible(this.rrule);\n };\n /**\n * Perform the conversion. Only some of the frequencies are supported.\n * If some of the rrule's options aren't supported, they'll\n * be omitted from the output an \"(~ approximate)\" will be appended.\n *\n * @return {*}\n */\n ToText.prototype.toString = function () {\n var gettext = this.gettext;\n if (!(this.options.freq in ToText.IMPLEMENTED)) {\n return gettext('RRule error: Unable to fully convert this rrule to text');\n }\n this.text = [gettext('every')];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this[RRule.FREQUENCIES[this.options.freq]]();\n if (this.options.until) {\n this.add(gettext('until'));\n var until = this.options.until;\n this.add(this.dateFormatter(until.getUTCFullYear(), this.language.monthNames[until.getUTCMonth()], until.getUTCDate()));\n }\n else if (this.options.count) {\n this.add(gettext('for'))\n .add(this.options.count.toString())\n .add(this.plural(this.options.count) ? gettext('times') : gettext('time'));\n }\n if (!this.isFullyConvertible())\n this.add(gettext('(~ approximate)'));\n return this.text.join('');\n };\n ToText.prototype.HOURLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval) ? gettext('hours') : gettext('hour'));\n };\n ToText.prototype.MINUTELY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n this.add(this.plural(this.options.interval)\n ? gettext('minutes')\n : gettext('minute'));\n };\n ToText.prototype.DAILY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1)\n this.add(this.options.interval.toString());\n if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n else if (this.origOptions.byhour) {\n this._byhour();\n }\n };\n ToText.prototype.WEEKLY = function () {\n var gettext = this.gettext;\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(this.plural(this.options.interval) ? gettext('weeks') : gettext('week'));\n }\n if (this.byweekday && this.byweekday.isWeekdays) {\n if (this.options.interval === 1) {\n this.add(this.plural(this.options.interval)\n ? gettext('weekdays')\n : gettext('weekday'));\n }\n else {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n }\n else if (this.byweekday && this.byweekday.isEveryDay) {\n this.add(this.plural(this.options.interval) ? gettext('days') : gettext('day'));\n }\n else {\n if (this.options.interval === 1)\n this.add(gettext('week'));\n if (this.origOptions.bymonth) {\n this.add(gettext('in'));\n this._bymonth();\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.origOptions.byhour) {\n this._byhour();\n }\n }\n };\n ToText.prototype.MONTHLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString()).add(gettext('months'));\n if (this.plural(this.options.interval))\n this.add(gettext('in'));\n }\n else {\n // this.add(gettext('MONTH'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval)\n ? gettext('months')\n : gettext('month'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday && this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(gettext('weekdays'));\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n };\n ToText.prototype.YEARLY = function () {\n var gettext = this.gettext;\n if (this.origOptions.bymonth) {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n this.add(gettext('years'));\n }\n else {\n // this.add(gettext('YEAR'))\n }\n this._bymonth();\n }\n else {\n if (this.options.interval !== 1) {\n this.add(this.options.interval.toString());\n }\n this.add(this.plural(this.options.interval) ? gettext('years') : gettext('year'));\n }\n if (this.bymonthday) {\n this._bymonthday();\n }\n else if (this.byweekday) {\n this._byweekday();\n }\n if (this.options.byyearday) {\n this.add(gettext('on the'))\n .add(this.list(this.options.byyearday, this.nth, gettext('and')))\n .add(gettext('day'));\n }\n if (this.options.byweekno) {\n this.add(gettext('in'))\n .add(this.plural(this.options.byweekno.length)\n ? gettext('weeks')\n : gettext('week'))\n .add(this.list(this.options.byweekno, undefined, gettext('and')));\n }\n };\n ToText.prototype._bymonthday = function () {\n var gettext = this.gettext;\n if (this.byweekday && this.byweekday.allWeeks) {\n this.add(gettext('on'))\n .add(this.list(this.byweekday.allWeeks, this.weekdaytext, gettext('or')))\n .add(gettext('the'))\n .add(this.list(this.bymonthday, this.nth, gettext('or')));\n }\n else {\n this.add(gettext('on the')).add(this.list(this.bymonthday, this.nth, gettext('and')));\n }\n // this.add(gettext('DAY'))\n };\n ToText.prototype._byweekday = function () {\n var gettext = this.gettext;\n if (this.byweekday.allWeeks && !this.byweekday.isWeekdays) {\n this.add(gettext('on')).add(this.list(this.byweekday.allWeeks, this.weekdaytext));\n }\n if (this.byweekday.someWeeks) {\n if (this.byweekday.allWeeks)\n this.add(gettext('and'));\n this.add(gettext('on the')).add(this.list(this.byweekday.someWeeks, this.weekdaytext, gettext('and')));\n }\n };\n ToText.prototype._byhour = function () {\n var gettext = this.gettext;\n this.add(gettext('at')).add(this.list(this.origOptions.byhour, undefined, gettext('and')));\n };\n ToText.prototype._bymonth = function () {\n this.add(this.list(this.options.bymonth, this.monthtext, this.gettext('and')));\n };\n ToText.prototype.nth = function (n) {\n n = parseInt(n.toString(), 10);\n var nth;\n var gettext = this.gettext;\n if (n === -1)\n return gettext('last');\n var npos = Math.abs(n);\n switch (npos) {\n case 1:\n case 21:\n case 31:\n nth = npos + gettext('st');\n break;\n case 2:\n case 22:\n nth = npos + gettext('nd');\n break;\n case 3:\n case 23:\n nth = npos + gettext('rd');\n break;\n default:\n nth = npos + gettext('th');\n }\n return n < 0 ? nth + ' ' + gettext('last') : nth;\n };\n ToText.prototype.monthtext = function (m) {\n return this.language.monthNames[m - 1];\n };\n ToText.prototype.weekdaytext = function (wday) {\n var weekday = isNumber(wday) ? (wday + 1) % 7 : wday.getJsWeekday();\n return ((wday.n ? this.nth(wday.n) + ' ' : '') +\n this.language.dayNames[weekday]);\n };\n ToText.prototype.plural = function (n) {\n return n % 100 !== 1;\n };\n ToText.prototype.add = function (s) {\n this.text.push(' ');\n this.text.push(s);\n return this;\n };\n ToText.prototype.list = function (arr, callback, finalDelim, delim) {\n var _this = this;\n if (delim === void 0) { delim = ','; }\n if (!isArray(arr)) {\n arr = [arr];\n }\n var delimJoin = function (array, delimiter, finalDelimiter) {\n var list = '';\n for (var i = 0; i < array.length; i++) {\n if (i !== 0) {\n if (i === array.length - 1) {\n list += ' ' + finalDelimiter + ' ';\n }\n else {\n list += delimiter + ' ';\n }\n }\n list += array[i];\n }\n return list;\n };\n callback =\n callback ||\n function (o) {\n return o.toString();\n };\n var realCallback = function (arg) {\n return callback && callback.call(_this, arg);\n };\n if (finalDelim) {\n return delimJoin(arr.map(realCallback), delim, finalDelim);\n }\n else {\n return arr.map(realCallback).join(delim + ' ');\n }\n };\n return ToText;\n}());\nexport default ToText;\n//# sourceMappingURL=totext.js.map","import ENGLISH from './i18n';\nimport { RRule } from '../rrule';\n// =============================================================================\n// Parser\n// =============================================================================\nvar Parser = /** @class */ (function () {\n function Parser(rules) {\n this.done = true;\n this.rules = rules;\n }\n Parser.prototype.start = function (text) {\n this.text = text;\n this.done = false;\n return this.nextSymbol();\n };\n Parser.prototype.isDone = function () {\n return this.done && this.symbol === null;\n };\n Parser.prototype.nextSymbol = function () {\n var best;\n var bestSymbol;\n this.symbol = null;\n this.value = null;\n do {\n if (this.done)\n return false;\n var rule = void 0;\n best = null;\n for (var name_1 in this.rules) {\n rule = this.rules[name_1];\n var match = rule.exec(this.text);\n if (match) {\n if (best === null || match[0].length > best[0].length) {\n best = match;\n bestSymbol = name_1;\n }\n }\n }\n if (best != null) {\n this.text = this.text.substr(best[0].length);\n if (this.text === '')\n this.done = true;\n }\n if (best == null) {\n this.done = true;\n this.symbol = null;\n this.value = null;\n return;\n }\n } while (bestSymbol === 'SKIP');\n this.symbol = bestSymbol;\n this.value = best;\n return true;\n };\n Parser.prototype.accept = function (name) {\n if (this.symbol === name) {\n if (this.value) {\n var v = this.value;\n this.nextSymbol();\n return v;\n }\n this.nextSymbol();\n return true;\n }\n return false;\n };\n Parser.prototype.acceptNumber = function () {\n return this.accept('number');\n };\n Parser.prototype.expect = function (name) {\n if (this.accept(name))\n return true;\n throw new Error('expected ' + name + ' but found ' + this.symbol);\n };\n return Parser;\n}());\nexport default function parseText(text, language) {\n if (language === void 0) { language = ENGLISH; }\n var options = {};\n var ttr = new Parser(language.tokens);\n if (!ttr.start(text))\n return null;\n S();\n return options;\n function S() {\n // every [n]\n ttr.expect('every');\n var n = ttr.acceptNumber();\n if (n)\n options.interval = parseInt(n[0], 10);\n if (ttr.isDone())\n throw new Error('Unexpected end');\n switch (ttr.symbol) {\n case 'day(s)':\n options.freq = RRule.DAILY;\n if (ttr.nextSymbol()) {\n AT();\n F();\n }\n break;\n // FIXME Note: every 2 weekdays != every two weeks on weekdays.\n // DAILY on weekdays is not a valid rule\n case 'weekday(s)':\n options.freq = RRule.WEEKLY;\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n ttr.nextSymbol();\n AT();\n F();\n break;\n case 'week(s)':\n options.freq = RRule.WEEKLY;\n if (ttr.nextSymbol()) {\n ON();\n AT();\n F();\n }\n break;\n case 'hour(s)':\n options.freq = RRule.HOURLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'minute(s)':\n options.freq = RRule.MINUTELY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'month(s)':\n options.freq = RRule.MONTHLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'year(s)':\n options.freq = RRule.YEARLY;\n if (ttr.nextSymbol()) {\n ON();\n F();\n }\n break;\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n options.freq = RRule.WEEKLY;\n var key = ttr.symbol\n .substr(0, 2)\n .toUpperCase();\n options.byweekday = [RRule[key]];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var wkd = decodeWKD();\n if (!wkd) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected weekday');\n }\n options.byweekday.push(RRule[wkd]);\n ttr.nextSymbol();\n }\n AT();\n MDAYs();\n F();\n break;\n case 'january':\n case 'february':\n case 'march':\n case 'april':\n case 'may':\n case 'june':\n case 'july':\n case 'august':\n case 'september':\n case 'october':\n case 'november':\n case 'december':\n options.freq = RRule.YEARLY;\n options.bymonth = [decodeM()];\n if (!ttr.nextSymbol())\n return;\n // TODO check for duplicates\n while (ttr.accept('comma')) {\n if (ttr.isDone())\n throw new Error('Unexpected end');\n var m = decodeM();\n if (!m) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected month');\n }\n options.bymonth.push(m);\n ttr.nextSymbol();\n }\n ON();\n F();\n break;\n default:\n throw new Error('Unknown symbol');\n }\n }\n function ON() {\n var on = ttr.accept('on');\n var the = ttr.accept('the');\n if (!(on || the))\n return;\n do {\n var nth = decodeNTH();\n var wkd = decodeWKD();\n var m = decodeM();\n // nth | \n if (nth) {\n // ttr.nextSymbol()\n if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd].nth(nth));\n }\n else {\n if (!options.bymonthday)\n options.bymonthday = [];\n options.bymonthday.push(nth);\n ttr.accept('day(s)');\n }\n // \n }\n else if (wkd) {\n ttr.nextSymbol();\n if (!options.byweekday)\n options.byweekday = [];\n options.byweekday.push(RRule[wkd]);\n }\n else if (ttr.symbol === 'weekday(s)') {\n ttr.nextSymbol();\n if (!options.byweekday) {\n options.byweekday = [RRule.MO, RRule.TU, RRule.WE, RRule.TH, RRule.FR];\n }\n }\n else if (ttr.symbol === 'week(s)') {\n ttr.nextSymbol();\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected week number');\n }\n options.byweekno = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.byweekno.push(parseInt(n[0], 10));\n }\n }\n else if (m) {\n ttr.nextSymbol();\n if (!options.bymonth)\n options.bymonth = [];\n options.bymonth.push(m);\n }\n else {\n return;\n }\n } while (ttr.accept('comma') || ttr.accept('the') || ttr.accept('on'));\n }\n function AT() {\n var at = ttr.accept('at');\n if (!at)\n return;\n do {\n var n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + ', expected hour');\n }\n options.byhour = [parseInt(n[0], 10)];\n while (ttr.accept('comma')) {\n n = ttr.acceptNumber();\n if (!n) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected hour');\n }\n options.byhour.push(parseInt(n[0], 10));\n }\n } while (ttr.accept('comma') || ttr.accept('at'));\n }\n function decodeM() {\n switch (ttr.symbol) {\n case 'january':\n return 1;\n case 'february':\n return 2;\n case 'march':\n return 3;\n case 'april':\n return 4;\n case 'may':\n return 5;\n case 'june':\n return 6;\n case 'july':\n return 7;\n case 'august':\n return 8;\n case 'september':\n return 9;\n case 'october':\n return 10;\n case 'november':\n return 11;\n case 'december':\n return 12;\n default:\n return false;\n }\n }\n function decodeWKD() {\n switch (ttr.symbol) {\n case 'monday':\n case 'tuesday':\n case 'wednesday':\n case 'thursday':\n case 'friday':\n case 'saturday':\n case 'sunday':\n return ttr.symbol.substr(0, 2).toUpperCase();\n default:\n return false;\n }\n }\n function decodeNTH() {\n switch (ttr.symbol) {\n case 'last':\n ttr.nextSymbol();\n return -1;\n case 'first':\n ttr.nextSymbol();\n return 1;\n case 'second':\n ttr.nextSymbol();\n return ttr.accept('last') ? -2 : 2;\n case 'third':\n ttr.nextSymbol();\n return ttr.accept('last') ? -3 : 3;\n case 'nth':\n var v = parseInt(ttr.value[1], 10);\n if (v < -366 || v > 366)\n throw new Error('Nth out of range: ' + v);\n ttr.nextSymbol();\n return ttr.accept('last') ? -v : v;\n default:\n return false;\n }\n }\n function MDAYs() {\n ttr.accept('on');\n ttr.accept('the');\n var nth = decodeNTH();\n if (!nth)\n return;\n options.bymonthday = [nth];\n ttr.nextSymbol();\n while (ttr.accept('comma')) {\n nth = decodeNTH();\n if (!nth) {\n throw new Error('Unexpected symbol ' + ttr.symbol + '; expected monthday');\n }\n options.bymonthday.push(nth);\n ttr.nextSymbol();\n }\n }\n function F() {\n if (ttr.symbol === 'until') {\n var date = Date.parse(ttr.text);\n if (!date)\n throw new Error('Cannot parse until date:' + ttr.text);\n options.until = new Date(date);\n }\n else if (ttr.accept('for')) {\n options.count = parseInt(ttr.value[0], 10);\n ttr.expect('number');\n // ttr.expect('times')\n }\n }\n}\n//# sourceMappingURL=parsetext.js.map","import ToText from './totext';\nimport parseText from './parsetext';\nimport { RRule } from '../rrule';\nimport { Frequency } from '../types';\nimport ENGLISH from './i18n';\n/* !\n * rrule.js - Library for working with recurrence rules for calendar dates.\n * https://github.com/jakubroztocil/rrule\n *\n * Copyright 2010, Jakub Roztocil and Lars Schoning\n * Licenced under the BSD licence.\n * https://github.com/jakubroztocil/rrule/blob/master/LICENCE\n *\n */\n/**\n *\n * Implementation of RRule.fromText() and RRule::toText().\n *\n *\n * On the client side, this file needs to be included\n * when those functions are used.\n *\n */\n// =============================================================================\n// fromText\n// =============================================================================\n/**\n * Will be able to convert some of the below described rules from\n * text format to a rule object.\n *\n *\n * RULES\n *\n * Every ([n])\n * day(s)\n * | [weekday], ..., (and) [weekday]\n * | weekday(s)\n * | week(s)\n * | month(s)\n * | [month], ..., (and) [month]\n * | year(s)\n *\n *\n * Plus 0, 1, or multiple of these:\n *\n * on [weekday], ..., (or) [weekday] the [monthday], [monthday], ... (or) [monthday]\n *\n * on [weekday], ..., (and) [weekday]\n *\n * on the [monthday], [monthday], ... (and) [monthday] (day of the month)\n *\n * on the [nth-weekday], ..., (and) [nth-weekday] (of the month/year)\n *\n *\n * Plus 0 or 1 of these:\n *\n * for [n] time(s)\n *\n * until [date]\n *\n * Plus (.)\n *\n *\n * Definitely no supported for parsing:\n *\n * (for year):\n * in week(s) [n], ..., (and) [n]\n *\n * on the [yearday], ..., (and) [n] day of the year\n * on day [yearday], ..., (and) [n]\n *\n *\n * NON-TERMINALS\n *\n * [n]: 1, 2 ..., one, two, three ..\n * [month]: January, February, March, April, May, ... December\n * [weekday]: Monday, ... Sunday\n * [nth-weekday]: first [weekday], 2nd [weekday], ... last [weekday], ...\n * [monthday]: first, 1., 2., 1st, 2nd, second, ... 31st, last day, 2nd last day, ..\n * [date]:\n * - [month] (0-31(,) ([year])),\n * - (the) 0-31.(1-12.([year])),\n * - (the) 0-31/(1-12/([year])),\n * - [weekday]\n *\n * [year]: 0000, 0001, ... 01, 02, ..\n *\n * Definitely not supported for parsing:\n *\n * [yearday]: first, 1., 2., 1st, 2nd, second, ... 366th, last day, 2nd last day, ..\n *\n * @param {String} text\n * @return {Object, Boolean} the rule, or null.\n */\nvar fromText = function (text, language) {\n if (language === void 0) { language = ENGLISH; }\n return new RRule(parseText(text, language) || undefined);\n};\nvar common = [\n 'count',\n 'until',\n 'interval',\n 'byweekday',\n 'bymonthday',\n 'bymonth',\n];\nToText.IMPLEMENTED = [];\nToText.IMPLEMENTED[Frequency.HOURLY] = common;\nToText.IMPLEMENTED[Frequency.MINUTELY] = common;\nToText.IMPLEMENTED[Frequency.DAILY] = ['byhour'].concat(common);\nToText.IMPLEMENTED[Frequency.WEEKLY] = common;\nToText.IMPLEMENTED[Frequency.MONTHLY] = common;\nToText.IMPLEMENTED[Frequency.YEARLY] = ['byweekno', 'byyearday'].concat(common);\n// =============================================================================\n// Export\n// =============================================================================\nvar toText = function (rrule, gettext, language, dateFormatter) {\n return new ToText(rrule, gettext, language, dateFormatter).toString();\n};\nvar isFullyConvertible = ToText.isFullyConvertible;\nexport { fromText, parseText, isFullyConvertible, toText };\n//# sourceMappingURL=index.js.map","import { __extends } from \"tslib\";\nimport { Frequency } from './types';\nimport { pymod, divmod, empty, includes } from './helpers';\nimport { getWeekday, MAXYEAR, monthRange } from './dateutil';\nvar Time = /** @class */ (function () {\n function Time(hour, minute, second, millisecond) {\n this.hour = hour;\n this.minute = minute;\n this.second = second;\n this.millisecond = millisecond || 0;\n }\n Time.prototype.getHours = function () {\n return this.hour;\n };\n Time.prototype.getMinutes = function () {\n return this.minute;\n };\n Time.prototype.getSeconds = function () {\n return this.second;\n };\n Time.prototype.getMilliseconds = function () {\n return this.millisecond;\n };\n Time.prototype.getTime = function () {\n return ((this.hour * 60 * 60 + this.minute * 60 + this.second) * 1000 +\n this.millisecond);\n };\n return Time;\n}());\nexport { Time };\nvar DateTime = /** @class */ (function (_super) {\n __extends(DateTime, _super);\n function DateTime(year, month, day, hour, minute, second, millisecond) {\n var _this = _super.call(this, hour, minute, second, millisecond) || this;\n _this.year = year;\n _this.month = month;\n _this.day = day;\n return _this;\n }\n DateTime.fromDate = function (date) {\n return new this(date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.valueOf() % 1000);\n };\n DateTime.prototype.getWeekday = function () {\n return getWeekday(new Date(this.getTime()));\n };\n DateTime.prototype.getTime = function () {\n return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond)).getTime();\n };\n DateTime.prototype.getDay = function () {\n return this.day;\n };\n DateTime.prototype.getMonth = function () {\n return this.month;\n };\n DateTime.prototype.getYear = function () {\n return this.year;\n };\n DateTime.prototype.addYears = function (years) {\n this.year += years;\n };\n DateTime.prototype.addMonths = function (months) {\n this.month += months;\n if (this.month > 12) {\n var yearDiv = Math.floor(this.month / 12);\n var monthMod = pymod(this.month, 12);\n this.month = monthMod;\n this.year += yearDiv;\n if (this.month === 0) {\n this.month = 12;\n --this.year;\n }\n }\n };\n DateTime.prototype.addWeekly = function (days, wkst) {\n if (wkst > this.getWeekday()) {\n this.day += -(this.getWeekday() + 1 + (6 - wkst)) + days * 7;\n }\n else {\n this.day += -(this.getWeekday() - wkst) + days * 7;\n }\n this.fixDay();\n };\n DateTime.prototype.addDaily = function (days) {\n this.day += days;\n this.fixDay();\n };\n DateTime.prototype.addHours = function (hours, filtered, byhour) {\n if (filtered) {\n // Jump to one iteration before next day\n this.hour += Math.floor((23 - this.hour) / hours) * hours;\n }\n for (;;) {\n this.hour += hours;\n var _a = divmod(this.hour, 24), dayDiv = _a.div, hourMod = _a.mod;\n if (dayDiv) {\n this.hour = hourMod;\n this.addDaily(dayDiv);\n }\n if (empty(byhour) || includes(byhour, this.hour))\n break;\n }\n };\n DateTime.prototype.addMinutes = function (minutes, filtered, byhour, byminute) {\n if (filtered) {\n // Jump to one iteration before next day\n this.minute +=\n Math.floor((1439 - (this.hour * 60 + this.minute)) / minutes) * minutes;\n }\n for (;;) {\n this.minute += minutes;\n var _a = divmod(this.minute, 60), hourDiv = _a.div, minuteMod = _a.mod;\n if (hourDiv) {\n this.minute = minuteMod;\n this.addHours(hourDiv, false, byhour);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute))) {\n break;\n }\n }\n };\n DateTime.prototype.addSeconds = function (seconds, filtered, byhour, byminute, bysecond) {\n if (filtered) {\n // Jump to one iteration before next day\n this.second +=\n Math.floor((86399 - (this.hour * 3600 + this.minute * 60 + this.second)) /\n seconds) * seconds;\n }\n for (;;) {\n this.second += seconds;\n var _a = divmod(this.second, 60), minuteDiv = _a.div, secondMod = _a.mod;\n if (minuteDiv) {\n this.second = secondMod;\n this.addMinutes(minuteDiv, false, byhour, byminute);\n }\n if ((empty(byhour) || includes(byhour, this.hour)) &&\n (empty(byminute) || includes(byminute, this.minute)) &&\n (empty(bysecond) || includes(bysecond, this.second))) {\n break;\n }\n }\n };\n DateTime.prototype.fixDay = function () {\n if (this.day <= 28) {\n return;\n }\n var daysinmonth = monthRange(this.year, this.month - 1)[1];\n if (this.day <= daysinmonth) {\n return;\n }\n while (this.day > daysinmonth) {\n this.day -= daysinmonth;\n ++this.month;\n if (this.month === 13) {\n this.month = 1;\n ++this.year;\n if (this.year > MAXYEAR) {\n return;\n }\n }\n daysinmonth = monthRange(this.year, this.month - 1)[1];\n }\n };\n DateTime.prototype.add = function (options, filtered) {\n var freq = options.freq, interval = options.interval, wkst = options.wkst, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n switch (freq) {\n case Frequency.YEARLY:\n return this.addYears(interval);\n case Frequency.MONTHLY:\n return this.addMonths(interval);\n case Frequency.WEEKLY:\n return this.addWeekly(interval, wkst);\n case Frequency.DAILY:\n return this.addDaily(interval);\n case Frequency.HOURLY:\n return this.addHours(interval, filtered, byhour);\n case Frequency.MINUTELY:\n return this.addMinutes(interval, filtered, byhour, byminute);\n case Frequency.SECONDLY:\n return this.addSeconds(interval, filtered, byhour, byminute, bysecond);\n }\n };\n return DateTime;\n}(Time));\nexport { DateTime };\n//# sourceMappingURL=datetime.js.map","import { __assign } from \"tslib\";\nimport { freqIsDailyOrGreater } from './types';\nimport { includes, notEmpty, isPresent, isNumber, isArray, isWeekdayStr, } from './helpers';\nimport { RRule, defaultKeys, DEFAULT_OPTIONS } from './rrule';\nimport { getWeekday, isDate, isValidDate } from './dateutil';\nimport { Weekday } from './weekday';\nimport { Time } from './datetime';\nexport function initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n // Shallow copy for options and origOptions and check for invalid\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (!includes(defaultKeys, key))\n invalid.push(key);\n if (isDate(options[key]) && !isValidDate(options[key])) {\n invalid.push(key);\n }\n }\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign({}, options);\n}\nexport function parseOptions(options) {\n var opts = __assign(__assign({}, DEFAULT_OPTIONS), initializeOptions(options));\n if (isPresent(opts.byeaster))\n opts.freq = RRule.YEARLY;\n if (!(isPresent(opts.freq) && RRule.FREQUENCIES[opts.freq])) {\n throw new Error(\"Invalid frequency: \".concat(opts.freq, \" \").concat(options.freq));\n }\n if (!opts.dtstart)\n opts.dtstart = new Date(new Date().setMilliseconds(0));\n if (!isPresent(opts.wkst)) {\n opts.wkst = RRule.MO.weekday;\n }\n else if (isNumber(opts.wkst)) {\n // cool, just keep it like that\n }\n else {\n opts.wkst = opts.wkst.weekday;\n }\n if (isPresent(opts.bysetpos)) {\n if (isNumber(opts.bysetpos))\n opts.bysetpos = [opts.bysetpos];\n for (var i = 0; i < opts.bysetpos.length; i++) {\n var v = opts.bysetpos[i];\n if (v === 0 || !(v >= -366 && v <= 366)) {\n throw new Error('bysetpos must be between 1 and 366,' + ' or between -366 and -1');\n }\n }\n }\n if (!(Boolean(opts.byweekno) ||\n notEmpty(opts.byweekno) ||\n notEmpty(opts.byyearday) ||\n Boolean(opts.bymonthday) ||\n notEmpty(opts.bymonthday) ||\n isPresent(opts.byweekday) ||\n isPresent(opts.byeaster))) {\n switch (opts.freq) {\n case RRule.YEARLY:\n if (!opts.bymonth)\n opts.bymonth = opts.dtstart.getUTCMonth() + 1;\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.MONTHLY:\n opts.bymonthday = opts.dtstart.getUTCDate();\n break;\n case RRule.WEEKLY:\n opts.byweekday = [getWeekday(opts.dtstart)];\n break;\n }\n }\n // bymonth\n if (isPresent(opts.bymonth) && !isArray(opts.bymonth)) {\n opts.bymonth = [opts.bymonth];\n }\n // byyearday\n if (isPresent(opts.byyearday) &&\n !isArray(opts.byyearday) &&\n isNumber(opts.byyearday)) {\n opts.byyearday = [opts.byyearday];\n }\n // bymonthday\n if (!isPresent(opts.bymonthday)) {\n opts.bymonthday = [];\n opts.bynmonthday = [];\n }\n else if (isArray(opts.bymonthday)) {\n var bymonthday = [];\n var bynmonthday = [];\n for (var i = 0; i < opts.bymonthday.length; i++) {\n var v = opts.bymonthday[i];\n if (v > 0) {\n bymonthday.push(v);\n }\n else if (v < 0) {\n bynmonthday.push(v);\n }\n }\n opts.bymonthday = bymonthday;\n opts.bynmonthday = bynmonthday;\n }\n else if (opts.bymonthday < 0) {\n opts.bynmonthday = [opts.bymonthday];\n opts.bymonthday = [];\n }\n else {\n opts.bynmonthday = [];\n opts.bymonthday = [opts.bymonthday];\n }\n // byweekno\n if (isPresent(opts.byweekno) && !isArray(opts.byweekno)) {\n opts.byweekno = [opts.byweekno];\n }\n // byweekday / bynweekday\n if (!isPresent(opts.byweekday)) {\n opts.bynweekday = null;\n }\n else if (isNumber(opts.byweekday)) {\n opts.byweekday = [opts.byweekday];\n opts.bynweekday = null;\n }\n else if (isWeekdayStr(opts.byweekday)) {\n opts.byweekday = [Weekday.fromStr(opts.byweekday).weekday];\n opts.bynweekday = null;\n }\n else if (opts.byweekday instanceof Weekday) {\n if (!opts.byweekday.n || opts.freq > RRule.MONTHLY) {\n opts.byweekday = [opts.byweekday.weekday];\n opts.bynweekday = null;\n }\n else {\n opts.bynweekday = [[opts.byweekday.weekday, opts.byweekday.n]];\n opts.byweekday = null;\n }\n }\n else {\n var byweekday = [];\n var bynweekday = [];\n for (var i = 0; i < opts.byweekday.length; i++) {\n var wday = opts.byweekday[i];\n if (isNumber(wday)) {\n byweekday.push(wday);\n continue;\n }\n else if (isWeekdayStr(wday)) {\n byweekday.push(Weekday.fromStr(wday).weekday);\n continue;\n }\n if (!wday.n || opts.freq > RRule.MONTHLY) {\n byweekday.push(wday.weekday);\n }\n else {\n bynweekday.push([wday.weekday, wday.n]);\n }\n }\n opts.byweekday = notEmpty(byweekday) ? byweekday : null;\n opts.bynweekday = notEmpty(bynweekday) ? bynweekday : null;\n }\n // byhour\n if (!isPresent(opts.byhour)) {\n opts.byhour = opts.freq < RRule.HOURLY ? [opts.dtstart.getUTCHours()] : null;\n }\n else if (isNumber(opts.byhour)) {\n opts.byhour = [opts.byhour];\n }\n // byminute\n if (!isPresent(opts.byminute)) {\n opts.byminute =\n opts.freq < RRule.MINUTELY ? [opts.dtstart.getUTCMinutes()] : null;\n }\n else if (isNumber(opts.byminute)) {\n opts.byminute = [opts.byminute];\n }\n // bysecond\n if (!isPresent(opts.bysecond)) {\n opts.bysecond =\n opts.freq < RRule.SECONDLY ? [opts.dtstart.getUTCSeconds()] : null;\n }\n else if (isNumber(opts.bysecond)) {\n opts.bysecond = [opts.bysecond];\n }\n return { parsedOptions: opts };\n}\nexport function buildTimeset(opts) {\n var millisecondModulo = opts.dtstart.getTime() % 1000;\n if (!freqIsDailyOrGreater(opts.freq)) {\n return [];\n }\n var timeset = [];\n opts.byhour.forEach(function (hour) {\n opts.byminute.forEach(function (minute) {\n opts.bysecond.forEach(function (second) {\n timeset.push(new Time(hour, minute, second, millisecondModulo));\n });\n });\n });\n return timeset;\n}\n//# sourceMappingURL=parseoptions.js.map","import { __assign } from \"tslib\";\nimport { Frequency } from './types';\nimport { Weekday } from './weekday';\nimport { untilStringToDate } from './dateutil';\nimport { Days } from './rrule';\nexport function parseString(rfcString) {\n var options = rfcString\n .split('\\n')\n .map(parseLine)\n .filter(function (x) { return x !== null; });\n return __assign(__assign({}, options[0]), options[1]);\n}\nexport function parseDtstart(line) {\n var options = {};\n var dtstartWithZone = /DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\\s]+)/i.exec(line);\n if (!dtstartWithZone) {\n return options;\n }\n var tzid = dtstartWithZone[1], dtstart = dtstartWithZone[2];\n if (tzid) {\n options.tzid = tzid;\n }\n options.dtstart = untilStringToDate(dtstart);\n return options;\n}\nfunction parseLine(rfcString) {\n rfcString = rfcString.replace(/^\\s+|\\s+$/, '');\n if (!rfcString.length)\n return null;\n var header = /^([A-Z]+?)[:;]/.exec(rfcString.toUpperCase());\n if (!header) {\n return parseRrule(rfcString);\n }\n var key = header[1];\n switch (key.toUpperCase()) {\n case 'RRULE':\n case 'EXRULE':\n return parseRrule(rfcString);\n case 'DTSTART':\n return parseDtstart(rfcString);\n default:\n throw new Error(\"Unsupported RFC prop \".concat(key, \" in \").concat(rfcString));\n }\n}\nfunction parseRrule(line) {\n var strippedLine = line.replace(/^RRULE:/i, '');\n var options = parseDtstart(strippedLine);\n var attrs = line.replace(/^(?:RRULE|EXRULE):/i, '').split(';');\n attrs.forEach(function (attr) {\n var _a = attr.split('='), key = _a[0], value = _a[1];\n switch (key.toUpperCase()) {\n case 'FREQ':\n options.freq = Frequency[value.toUpperCase()];\n break;\n case 'WKST':\n options.wkst = Days[value.toUpperCase()];\n break;\n case 'COUNT':\n case 'INTERVAL':\n case 'BYSETPOS':\n case 'BYMONTH':\n case 'BYMONTHDAY':\n case 'BYYEARDAY':\n case 'BYWEEKNO':\n case 'BYHOUR':\n case 'BYMINUTE':\n case 'BYSECOND':\n var num = parseNumber(value);\n var optionKey = key.toLowerCase();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n options[optionKey] = num;\n break;\n case 'BYWEEKDAY':\n case 'BYDAY':\n options.byweekday = parseWeekday(value);\n break;\n case 'DTSTART':\n case 'TZID':\n // for backwards compatibility\n var dtstart = parseDtstart(line);\n options.tzid = dtstart.tzid;\n options.dtstart = dtstart.dtstart;\n break;\n case 'UNTIL':\n options.until = untilStringToDate(value);\n break;\n case 'BYEASTER':\n options.byeaster = Number(value);\n break;\n default:\n throw new Error(\"Unknown RRULE property '\" + key + \"'\");\n }\n });\n return options;\n}\nfunction parseNumber(value) {\n if (value.indexOf(',') !== -1) {\n var values = value.split(',');\n return values.map(parseIndividualNumber);\n }\n return parseIndividualNumber(value);\n}\nfunction parseIndividualNumber(value) {\n if (/^[+-]?\\d+$/.test(value)) {\n return Number(value);\n }\n return value;\n}\nfunction parseWeekday(value) {\n var days = value.split(',');\n return days.map(function (day) {\n if (day.length === 2) {\n // MO, TU, ...\n return Days[day]; // wday instanceof Weekday\n }\n // -1MO, +3FR, 1SO, 13TU ...\n var parts = day.match(/^([+-]?\\d{1,2})([A-Z]{2})$/);\n if (!parts || parts.length < 3) {\n throw new SyntaxError(\"Invalid weekday string: \".concat(day));\n }\n var n = Number(parts[1]);\n var wdaypart = parts[2];\n var wday = Days[wdaypart].weekday;\n return new Weekday(wday, n);\n });\n}\n//# sourceMappingURL=parsestring.js.map","import { dateInTimeZone, timeToUntilString } from './dateutil';\nvar DateWithZone = /** @class */ (function () {\n function DateWithZone(date, tzid) {\n if (isNaN(date.getTime())) {\n throw new RangeError('Invalid date passed to DateWithZone');\n }\n this.date = date;\n this.tzid = tzid;\n }\n Object.defineProperty(DateWithZone.prototype, \"isUTC\", {\n get: function () {\n return !this.tzid || this.tzid.toUpperCase() === 'UTC';\n },\n enumerable: false,\n configurable: true\n });\n DateWithZone.prototype.toString = function () {\n var datestr = timeToUntilString(this.date.getTime(), this.isUTC);\n if (!this.isUTC) {\n return \";TZID=\".concat(this.tzid, \":\").concat(datestr);\n }\n return \":\".concat(datestr);\n };\n DateWithZone.prototype.getTime = function () {\n return this.date.getTime();\n };\n DateWithZone.prototype.rezonedDate = function () {\n if (this.isUTC) {\n return this.date;\n }\n return dateInTimeZone(this.date, this.tzid);\n };\n return DateWithZone;\n}());\nexport { DateWithZone };\n//# sourceMappingURL=datewithzone.js.map","import { RRule, DEFAULT_OPTIONS } from './rrule';\nimport { includes, isPresent, isArray, isNumber, toArray } from './helpers';\nimport { Weekday } from './weekday';\nimport { timeToUntilString } from './dateutil';\nimport { DateWithZone } from './datewithzone';\nexport function optionsToString(options) {\n var rrule = [];\n var dtstart = '';\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n for (var i = 0; i < keys.length; i++) {\n if (keys[i] === 'tzid')\n continue;\n if (!includes(defaultKeys, keys[i]))\n continue;\n var key = keys[i].toUpperCase();\n var value = options[keys[i]];\n var outValue = '';\n if (!isPresent(value) || (isArray(value) && !value.length))\n continue;\n switch (key) {\n case 'FREQ':\n outValue = RRule.FREQUENCIES[options.freq];\n break;\n case 'WKST':\n if (isNumber(value)) {\n outValue = new Weekday(value).toString();\n }\n else {\n outValue = value.toString();\n }\n break;\n case 'BYWEEKDAY':\n /*\n NOTE: BYWEEKDAY is a special case.\n RRule() deconstructs the rule.options.byweekday array\n into an array of Weekday arguments.\n On the other hand, rule.origOptions is an array of Weekdays.\n We need to handle both cases here.\n It might be worth change RRule to keep the Weekdays.\n \n Also, BYWEEKDAY (used by RRule) vs. BYDAY (RFC)\n \n */\n key = 'BYDAY';\n outValue = toArray(value)\n .map(function (wday) {\n if (wday instanceof Weekday) {\n return wday;\n }\n if (isArray(wday)) {\n return new Weekday(wday[0], wday[1]);\n }\n return new Weekday(wday);\n })\n .toString();\n break;\n case 'DTSTART':\n dtstart = buildDtstart(value, options.tzid);\n break;\n case 'UNTIL':\n outValue = timeToUntilString(value, !options.tzid);\n break;\n default:\n if (isArray(value)) {\n var strValues = [];\n for (var j = 0; j < value.length; j++) {\n strValues[j] = String(value[j]);\n }\n outValue = strValues.toString();\n }\n else {\n outValue = String(value);\n }\n }\n if (outValue) {\n rrule.push([key, outValue]);\n }\n }\n var rules = rrule\n .map(function (_a) {\n var key = _a[0], value = _a[1];\n return \"\".concat(key, \"=\").concat(value.toString());\n })\n .join(';');\n var ruleString = '';\n if (rules !== '') {\n ruleString = \"RRULE:\".concat(rules);\n }\n return [dtstart, ruleString].filter(function (x) { return !!x; }).join('\\n');\n}\nfunction buildDtstart(dtstart, tzid) {\n if (!dtstart) {\n return '';\n }\n return 'DTSTART' + new DateWithZone(new Date(dtstart), tzid).toString();\n}\n//# sourceMappingURL=optionstostring.js.map","import IterResult from './iterresult';\nimport { clone, cloneDates } from './dateutil';\nimport { isArray } from './helpers';\nfunction argsMatch(left, right) {\n if (Array.isArray(left)) {\n if (!Array.isArray(right))\n return false;\n if (left.length !== right.length)\n return false;\n return left.every(function (date, i) { return date.getTime() === right[i].getTime(); });\n }\n if (left instanceof Date) {\n return right instanceof Date && left.getTime() === right.getTime();\n }\n return left === right;\n}\nvar Cache = /** @class */ (function () {\n function Cache() {\n this.all = false;\n this.before = [];\n this.after = [];\n this.between = [];\n }\n /**\n * @param {String} what - all/before/after/between\n * @param {Array,Date} value - an array of dates, one date, or null\n * @param {Object?} args - _iter arguments\n */\n Cache.prototype._cacheAdd = function (what, value, args) {\n if (value) {\n value = value instanceof Date ? clone(value) : cloneDates(value);\n }\n if (what === 'all') {\n this.all = value;\n }\n else {\n args._value = value;\n this[what].push(args);\n }\n };\n /**\n * @return false - not in the cache\n * @return null - cached, but zero occurrences (before/after)\n * @return Date - cached (before/after)\n * @return [] - cached, but zero occurrences (all/between)\n * @return [Date1, DateN] - cached (all/between)\n */\n Cache.prototype._cacheGet = function (what, args) {\n var cached = false;\n var argsKeys = args ? Object.keys(args) : [];\n var findCacheDiff = function (item) {\n for (var i = 0; i < argsKeys.length; i++) {\n var key = argsKeys[i];\n if (!argsMatch(args[key], item[key])) {\n return true;\n }\n }\n return false;\n };\n var cachedObject = this[what];\n if (what === 'all') {\n cached = this.all;\n }\n else if (isArray(cachedObject)) {\n // Let's see whether we've already called the\n // 'what' method with the same 'args'\n for (var i = 0; i < cachedObject.length; i++) {\n var item = cachedObject[i];\n if (argsKeys.length && findCacheDiff(item))\n continue;\n cached = item._value;\n break;\n }\n }\n if (!cached && this.all) {\n // Not in the cache, but we already know all the occurrences,\n // so we can find the correct dates from the cached ones.\n var iterResult = new IterResult(what, args);\n for (var i = 0; i < this.all.length; i++) {\n if (!iterResult.accept(this.all[i]))\n break;\n }\n cached = iterResult.getValue();\n this._cacheAdd(what, cached, args);\n }\n return isArray(cached)\n ? cloneDates(cached)\n : cached instanceof Date\n ? clone(cached)\n : cached;\n };\n return Cache;\n}());\nexport { Cache };\n//# sourceMappingURL=cache.js.map","import { __spreadArray } from \"tslib\";\nimport { range, repeat } from './helpers';\n// =============================================================================\n// Date masks\n// =============================================================================\n// Every mask is 7 days longer to handle cross-year weekly periods.\nvar M365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 28), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], repeat(1, 31), true), repeat(2, 29), true), repeat(3, 31), true), repeat(4, 30), true), repeat(5, 31), true), repeat(6, 30), true), repeat(7, 31), true), repeat(8, 31), true), repeat(9, 30), true), repeat(10, 31), true), repeat(11, 30), true), repeat(12, 31), true), repeat(1, 7), true);\nvar M28 = range(1, 29);\nvar M29 = range(1, 30);\nvar M30 = range(1, 31);\nvar M31 = range(1, 32);\nvar MDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M29, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar MDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], M31, true), M28, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31, true), M30, true), M31, true), M30, true), M31, true), M31.slice(0, 7), true);\nvar NM28 = range(-28, 0);\nvar NM29 = range(-29, 0);\nvar NM30 = range(-30, 0);\nvar NM31 = range(-31, 0);\nvar NMDAY366MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM29, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar NMDAY365MASK = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], NM31, true), NM28, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31, true), NM30, true), NM31, true), NM30, true), NM31, true), NM31.slice(0, 7), true);\nvar M366RANGE = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366];\nvar M365RANGE = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];\nvar WDAYMASK = (function () {\n var wdaymask = [];\n for (var i = 0; i < 55; i++)\n wdaymask = wdaymask.concat(range(7));\n return wdaymask;\n})();\nexport { WDAYMASK, M365MASK, M365RANGE, M366MASK, M366RANGE, MDAY365MASK, MDAY366MASK, NMDAY365MASK, NMDAY366MASK, };\n//# sourceMappingURL=masks.js.map","import { __assign } from \"tslib\";\nimport { datetime, getWeekday, isLeapYear, toOrdinal } from '../dateutil';\nimport { empty, repeat, pymod, includes } from '../helpers';\nimport { M365MASK, MDAY365MASK, NMDAY365MASK, WDAYMASK, M365RANGE, M366MASK, MDAY366MASK, NMDAY366MASK, M366RANGE, } from '../masks';\nexport function rebuildYear(year, options) {\n var firstyday = datetime(year, 1, 1);\n var yearlen = isLeapYear(year) ? 366 : 365;\n var nextyearlen = isLeapYear(year + 1) ? 366 : 365;\n var yearordinal = toOrdinal(firstyday);\n var yearweekday = getWeekday(firstyday);\n var result = __assign(__assign({ yearlen: yearlen, nextyearlen: nextyearlen, yearordinal: yearordinal, yearweekday: yearweekday }, baseYearMasks(year)), { wnomask: null });\n if (empty(options.byweekno)) {\n return result;\n }\n result.wnomask = repeat(0, yearlen + 7);\n var firstwkst;\n var wyearlen;\n var no1wkst = (firstwkst = pymod(7 - yearweekday + options.wkst, 7));\n if (no1wkst >= 4) {\n no1wkst = 0;\n // Number of days in the year, plus the days we got\n // from last year.\n wyearlen = result.yearlen + pymod(yearweekday - options.wkst, 7);\n }\n else {\n // Number of days in the year, minus the days we\n // left in last year.\n wyearlen = yearlen - no1wkst;\n }\n var div = Math.floor(wyearlen / 7);\n var mod = pymod(wyearlen, 7);\n var numweeks = Math.floor(div + mod / 4);\n for (var j = 0; j < options.byweekno.length; j++) {\n var n = options.byweekno[j];\n if (n < 0) {\n n += numweeks + 1;\n }\n if (!(n > 0 && n <= numweeks)) {\n continue;\n }\n var i = void 0;\n if (n > 1) {\n i = no1wkst + (n - 1) * 7;\n if (no1wkst !== firstwkst) {\n i -= 7 - firstwkst;\n }\n }\n else {\n i = no1wkst;\n }\n for (var k = 0; k < 7; k++) {\n result.wnomask[i] = 1;\n i++;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n if (includes(options.byweekno, 1)) {\n // Check week number 1 of next year as well\n // orig-TODO : Check -numweeks for next year.\n var i = no1wkst + numweeks * 7;\n if (no1wkst !== firstwkst)\n i -= 7 - firstwkst;\n if (i < yearlen) {\n // If week starts in next year, we\n // don't care about it.\n for (var j = 0; j < 7; j++) {\n result.wnomask[i] = 1;\n i += 1;\n if (result.wdaymask[i] === options.wkst)\n break;\n }\n }\n }\n if (no1wkst) {\n // Check last week number of last year as\n // well. If no1wkst is 0, either the year\n // started on week start, or week number 1\n // got days from last year, so there are no\n // days from last year's last week number in\n // this year.\n var lnumweeks = void 0;\n if (!includes(options.byweekno, -1)) {\n var lyearweekday = getWeekday(datetime(year - 1, 1, 1));\n var lno1wkst = pymod(7 - lyearweekday.valueOf() + options.wkst, 7);\n var lyearlen = isLeapYear(year - 1) ? 366 : 365;\n var weekst = void 0;\n if (lno1wkst >= 4) {\n lno1wkst = 0;\n weekst = lyearlen + pymod(lyearweekday - options.wkst, 7);\n }\n else {\n weekst = yearlen - no1wkst;\n }\n lnumweeks = Math.floor(52 + pymod(weekst, 7) / 4);\n }\n else {\n lnumweeks = -1;\n }\n if (includes(options.byweekno, lnumweeks)) {\n for (var i = 0; i < no1wkst; i++)\n result.wnomask[i] = 1;\n }\n }\n return result;\n}\nfunction baseYearMasks(year) {\n var yearlen = isLeapYear(year) ? 366 : 365;\n var firstyday = datetime(year, 1, 1);\n var wday = getWeekday(firstyday);\n if (yearlen === 365) {\n return {\n mmask: M365MASK,\n mdaymask: MDAY365MASK,\n nmdaymask: NMDAY365MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M365RANGE,\n };\n }\n return {\n mmask: M366MASK,\n mdaymask: MDAY366MASK,\n nmdaymask: NMDAY366MASK,\n wdaymask: WDAYMASK.slice(wday),\n mrange: M366RANGE,\n };\n}\n//# sourceMappingURL=yearinfo.js.map","import { notEmpty, repeat, range, isPresent } from '../helpers';\nimport { Frequency } from '../types';\nimport { rebuildYear } from './yearinfo';\nimport { rebuildMonth } from './monthinfo';\nimport { easter } from './easter';\nimport { Time } from '../datetime';\nimport { datetime, sort, toOrdinal } from '../dateutil';\n// =============================================================================\n// Iterinfo\n// =============================================================================\nvar Iterinfo = /** @class */ (function () {\n // eslint-disable-next-line no-empty-function\n function Iterinfo(options) {\n this.options = options;\n }\n Iterinfo.prototype.rebuild = function (year, month) {\n var options = this.options;\n if (year !== this.lastyear) {\n this.yearinfo = rebuildYear(year, options);\n }\n if (notEmpty(options.bynweekday) &&\n (month !== this.lastmonth || year !== this.lastyear)) {\n var _a = this.yearinfo, yearlen = _a.yearlen, mrange = _a.mrange, wdaymask = _a.wdaymask;\n this.monthinfo = rebuildMonth(year, month, yearlen, mrange, wdaymask, options);\n }\n if (isPresent(options.byeaster)) {\n this.eastermask = easter(year, options.byeaster);\n }\n };\n Object.defineProperty(Iterinfo.prototype, \"lastyear\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastyear : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"lastmonth\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.lastmonth : null;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearlen\", {\n get: function () {\n return this.yearinfo.yearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"yearordinal\", {\n get: function () {\n return this.yearinfo.yearordinal;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mrange\", {\n get: function () {\n return this.yearinfo.mrange;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wdaymask\", {\n get: function () {\n return this.yearinfo.wdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mmask\", {\n get: function () {\n return this.yearinfo.mmask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"wnomask\", {\n get: function () {\n return this.yearinfo.wnomask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nwdaymask\", {\n get: function () {\n return this.monthinfo ? this.monthinfo.nwdaymask : [];\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nextyearlen\", {\n get: function () {\n return this.yearinfo.nextyearlen;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"mdaymask\", {\n get: function () {\n return this.yearinfo.mdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Iterinfo.prototype, \"nmdaymask\", {\n get: function () {\n return this.yearinfo.nmdaymask;\n },\n enumerable: false,\n configurable: true\n });\n Iterinfo.prototype.ydayset = function () {\n return [range(this.yearlen), 0, this.yearlen];\n };\n Iterinfo.prototype.mdayset = function (_, month) {\n var start = this.mrange[month - 1];\n var end = this.mrange[month];\n var set = repeat(null, this.yearlen);\n for (var i = start; i < end; i++)\n set[i] = i;\n return [set, start, end];\n };\n Iterinfo.prototype.wdayset = function (year, month, day) {\n // We need to handle cross-year weeks here.\n var set = repeat(null, this.yearlen + 7);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n var start = i;\n for (var j = 0; j < 7; j++) {\n set[i] = i;\n ++i;\n if (this.wdaymask[i] === this.options.wkst)\n break;\n }\n return [set, start, i];\n };\n Iterinfo.prototype.ddayset = function (year, month, day) {\n var set = repeat(null, this.yearlen);\n var i = toOrdinal(datetime(year, month, day)) - this.yearordinal;\n set[i] = i;\n return [set, i, i + 1];\n };\n Iterinfo.prototype.htimeset = function (hour, _, second, millisecond) {\n var _this = this;\n var set = [];\n this.options.byminute.forEach(function (minute) {\n set = set.concat(_this.mtimeset(hour, minute, second, millisecond));\n });\n sort(set);\n return set;\n };\n Iterinfo.prototype.mtimeset = function (hour, minute, _, millisecond) {\n var set = this.options.bysecond.map(function (second) { return new Time(hour, minute, second, millisecond); });\n sort(set);\n return set;\n };\n Iterinfo.prototype.stimeset = function (hour, minute, second, millisecond) {\n return [new Time(hour, minute, second, millisecond)];\n };\n Iterinfo.prototype.getdayset = function (freq) {\n switch (freq) {\n case Frequency.YEARLY:\n return this.ydayset.bind(this);\n case Frequency.MONTHLY:\n return this.mdayset.bind(this);\n case Frequency.WEEKLY:\n return this.wdayset.bind(this);\n case Frequency.DAILY:\n return this.ddayset.bind(this);\n default:\n return this.ddayset.bind(this);\n }\n };\n Iterinfo.prototype.gettimeset = function (freq) {\n switch (freq) {\n case Frequency.HOURLY:\n return this.htimeset.bind(this);\n case Frequency.MINUTELY:\n return this.mtimeset.bind(this);\n case Frequency.SECONDLY:\n return this.stimeset.bind(this);\n }\n };\n return Iterinfo;\n}());\nexport default Iterinfo;\n//# sourceMappingURL=index.js.map","import { RRule } from '../rrule';\nimport { empty, repeat, pymod } from '../helpers';\nexport function rebuildMonth(year, month, yearlen, mrange, wdaymask, options) {\n var result = {\n lastyear: year,\n lastmonth: month,\n nwdaymask: [],\n };\n var ranges = [];\n if (options.freq === RRule.YEARLY) {\n if (empty(options.bymonth)) {\n ranges = [[0, yearlen]];\n }\n else {\n for (var j = 0; j < options.bymonth.length; j++) {\n month = options.bymonth[j];\n ranges.push(mrange.slice(month - 1, month + 1));\n }\n }\n }\n else if (options.freq === RRule.MONTHLY) {\n ranges = [mrange.slice(month - 1, month + 1)];\n }\n if (empty(ranges)) {\n return result;\n }\n // Weekly frequency won't get here, so we may not\n // care about cross-year weekly periods.\n result.nwdaymask = repeat(0, yearlen);\n for (var j = 0; j < ranges.length; j++) {\n var rang = ranges[j];\n var first = rang[0];\n var last = rang[1] - 1;\n for (var k = 0; k < options.bynweekday.length; k++) {\n var i = void 0;\n var _a = options.bynweekday[k], wday = _a[0], n = _a[1];\n if (n < 0) {\n i = last + (n + 1) * 7;\n i -= pymod(wdaymask[i] - wday, 7);\n }\n else {\n i = first + (n - 1) * 7;\n i += pymod(7 - wdaymask[i] + wday, 7);\n }\n if (first <= i && i <= last)\n result.nwdaymask[i] = 1;\n }\n }\n return result;\n}\n//# sourceMappingURL=monthinfo.js.map","export function easter(y, offset) {\n if (offset === void 0) { offset = 0; }\n var a = y % 19;\n var b = Math.floor(y / 100);\n var c = y % 100;\n var d = Math.floor(b / 4);\n var e = b % 4;\n var f = Math.floor((b + 8) / 25);\n var g = Math.floor((b - f + 1) / 3);\n var h = Math.floor(19 * a + b - d - g + 15) % 30;\n var i = Math.floor(c / 4);\n var k = c % 4;\n var l = Math.floor(32 + 2 * e + 2 * i - h - k) % 7;\n var m = Math.floor((a + 11 * h + 22 * l) / 451);\n var month = Math.floor((h + l - 7 * m + 114) / 31);\n var day = ((h + l - 7 * m + 114) % 31) + 1;\n var date = Date.UTC(y, month - 1, day + offset);\n var yearStart = Date.UTC(y, 0, 1);\n return [Math.ceil((date - yearStart) / (1000 * 60 * 60 * 24))];\n}\n//# sourceMappingURL=easter.js.map","import { combine, fromOrdinal, sort } from '../dateutil';\nimport { pymod, isPresent, includes } from '../helpers';\nexport function buildPoslist(bysetpos, timeset, start, end, ii, dayset) {\n var poslist = [];\n for (var j = 0; j < bysetpos.length; j++) {\n var daypos = void 0;\n var timepos = void 0;\n var pos = bysetpos[j];\n if (pos < 0) {\n daypos = Math.floor(pos / timeset.length);\n timepos = pymod(pos, timeset.length);\n }\n else {\n daypos = Math.floor((pos - 1) / timeset.length);\n timepos = pymod(pos - 1, timeset.length);\n }\n var tmp = [];\n for (var k = start; k < end; k++) {\n var val = dayset[k];\n if (!isPresent(val))\n continue;\n tmp.push(val);\n }\n var i = void 0;\n if (daypos < 0) {\n i = tmp.slice(daypos)[0];\n }\n else {\n i = tmp[daypos];\n }\n var time = timeset[timepos];\n var date = fromOrdinal(ii.yearordinal + i);\n var res = combine(date, time);\n // XXX: can this ever be in the array?\n // - compare the actual date instead?\n if (!includes(poslist, res))\n poslist.push(res);\n }\n sort(poslist);\n return poslist;\n}\n//# sourceMappingURL=poslist.js.map","import { freqIsDailyOrGreater } from '../types';\nimport { combine, fromOrdinal, MAXYEAR } from '../dateutil';\nimport Iterinfo from '../iterinfo/index';\nimport { RRule } from '../rrule';\nimport { buildTimeset } from '../parseoptions';\nimport { notEmpty, includes, isPresent } from '../helpers';\nimport { DateWithZone } from '../datewithzone';\nimport { buildPoslist } from './poslist';\nimport { DateTime } from '../datetime';\nexport function iter(iterResult, options) {\n var dtstart = options.dtstart, freq = options.freq, interval = options.interval, until = options.until, bysetpos = options.bysetpos;\n var count = options.count;\n if (count === 0 || interval === 0) {\n return emitResult(iterResult);\n }\n var counterDate = DateTime.fromDate(dtstart);\n var ii = new Iterinfo(options);\n ii.rebuild(counterDate.year, counterDate.month);\n var timeset = makeTimeset(ii, counterDate, options);\n for (;;) {\n var _a = ii.getdayset(freq)(counterDate.year, counterDate.month, counterDate.day), dayset = _a[0], start = _a[1], end = _a[2];\n var filtered = removeFilteredDays(dayset, start, end, ii, options);\n if (notEmpty(bysetpos)) {\n var poslist = buildPoslist(bysetpos, timeset, start, end, ii, dayset);\n for (var j = 0; j < poslist.length; j++) {\n var res = poslist[j];\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n else {\n for (var j = start; j < end; j++) {\n var currentDay = dayset[j];\n if (!isPresent(currentDay)) {\n continue;\n }\n var date = fromOrdinal(ii.yearordinal + currentDay);\n for (var k = 0; k < timeset.length; k++) {\n var time = timeset[k];\n var res = combine(date, time);\n if (until && res > until) {\n return emitResult(iterResult);\n }\n if (res >= dtstart) {\n var rezonedDate = rezoneIfNeeded(res, options);\n if (!iterResult.accept(rezonedDate)) {\n return emitResult(iterResult);\n }\n if (count) {\n --count;\n if (!count) {\n return emitResult(iterResult);\n }\n }\n }\n }\n }\n }\n if (options.interval === 0) {\n return emitResult(iterResult);\n }\n // Handle frequency and interval\n counterDate.add(options, filtered);\n if (counterDate.year > MAXYEAR) {\n return emitResult(iterResult);\n }\n if (!freqIsDailyOrGreater(freq)) {\n timeset = ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, 0);\n }\n ii.rebuild(counterDate.year, counterDate.month);\n }\n}\nfunction isFiltered(ii, currentDay, options) {\n var bymonth = options.bymonth, byweekno = options.byweekno, byweekday = options.byweekday, byeaster = options.byeaster, bymonthday = options.bymonthday, bynmonthday = options.bynmonthday, byyearday = options.byyearday;\n return ((notEmpty(bymonth) && !includes(bymonth, ii.mmask[currentDay])) ||\n (notEmpty(byweekno) && !ii.wnomask[currentDay]) ||\n (notEmpty(byweekday) && !includes(byweekday, ii.wdaymask[currentDay])) ||\n (notEmpty(ii.nwdaymask) && !ii.nwdaymask[currentDay]) ||\n (byeaster !== null && !includes(ii.eastermask, currentDay)) ||\n ((notEmpty(bymonthday) || notEmpty(bynmonthday)) &&\n !includes(bymonthday, ii.mdaymask[currentDay]) &&\n !includes(bynmonthday, ii.nmdaymask[currentDay])) ||\n (notEmpty(byyearday) &&\n ((currentDay < ii.yearlen &&\n !includes(byyearday, currentDay + 1) &&\n !includes(byyearday, -ii.yearlen + currentDay)) ||\n (currentDay >= ii.yearlen &&\n !includes(byyearday, currentDay + 1 - ii.yearlen) &&\n !includes(byyearday, -ii.nextyearlen + currentDay - ii.yearlen)))));\n}\nfunction rezoneIfNeeded(date, options) {\n return new DateWithZone(date, options.tzid).rezonedDate();\n}\nfunction emitResult(iterResult) {\n return iterResult.getValue();\n}\nfunction removeFilteredDays(dayset, start, end, ii, options) {\n var filtered = false;\n for (var dayCounter = start; dayCounter < end; dayCounter++) {\n var currentDay = dayset[dayCounter];\n filtered = isFiltered(ii, currentDay, options);\n if (filtered)\n dayset[currentDay] = null;\n }\n return filtered;\n}\nfunction makeTimeset(ii, counterDate, options) {\n var freq = options.freq, byhour = options.byhour, byminute = options.byminute, bysecond = options.bysecond;\n if (freqIsDailyOrGreater(freq)) {\n return buildTimeset(options);\n }\n if ((freq >= RRule.HOURLY &&\n notEmpty(byhour) &&\n !includes(byhour, counterDate.hour)) ||\n (freq >= RRule.MINUTELY &&\n notEmpty(byminute) &&\n !includes(byminute, counterDate.minute)) ||\n (freq >= RRule.SECONDLY &&\n notEmpty(bysecond) &&\n !includes(bysecond, counterDate.second))) {\n return [];\n }\n return ii.gettimeset(freq)(counterDate.hour, counterDate.minute, counterDate.second, counterDate.millisecond);\n}\n//# sourceMappingURL=index.js.map","import { isValidDate } from './dateutil';\nimport IterResult from './iterresult';\nimport CallbackIterResult from './callbackiterresult';\nimport { fromText, parseText, toText, isFullyConvertible } from './nlp/index';\nimport { Frequency, } from './types';\nimport { parseOptions, initializeOptions } from './parseoptions';\nimport { parseString } from './parsestring';\nimport { optionsToString } from './optionstostring';\nimport { Cache } from './cache';\nimport { Weekday } from './weekday';\nimport { iter } from './iter/index';\n// =============================================================================\n// RRule\n// =============================================================================\nexport var Days = {\n MO: new Weekday(0),\n TU: new Weekday(1),\n WE: new Weekday(2),\n TH: new Weekday(3),\n FR: new Weekday(4),\n SA: new Weekday(5),\n SU: new Weekday(6),\n};\nexport var DEFAULT_OPTIONS = {\n freq: Frequency.YEARLY,\n dtstart: null,\n interval: 1,\n wkst: Days.MO,\n count: null,\n until: null,\n tzid: null,\n bysetpos: null,\n bymonth: null,\n bymonthday: null,\n bynmonthday: null,\n byyearday: null,\n byweekno: null,\n byweekday: null,\n bynweekday: null,\n byhour: null,\n byminute: null,\n bysecond: null,\n byeaster: null,\n};\nexport var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n/**\n *\n * @param {Options?} options - see \n * - The only required option is `freq`, one of RRule.YEARLY, RRule.MONTHLY, ...\n * @constructor\n */\nvar RRule = /** @class */ (function () {\n function RRule(options, noCache) {\n if (options === void 0) { options = {}; }\n if (noCache === void 0) { noCache = false; }\n // RFC string\n this._cache = noCache ? null : new Cache();\n // used by toString()\n this.origOptions = initializeOptions(options);\n var parsedOptions = parseOptions(options).parsedOptions;\n this.options = parsedOptions;\n }\n RRule.parseText = function (text, language) {\n return parseText(text, language);\n };\n RRule.fromText = function (text, language) {\n return fromText(text, language);\n };\n RRule.fromString = function (str) {\n return new RRule(RRule.parseString(str) || undefined);\n };\n RRule.prototype._iter = function (iterResult) {\n return iter(iterResult, this.options);\n };\n RRule.prototype._cacheGet = function (what, args) {\n if (!this._cache)\n return false;\n return this._cache._cacheGet(what, args);\n };\n RRule.prototype._cacheAdd = function (what, value, args) {\n if (!this._cache)\n return;\n return this._cache._cacheAdd(what, value, args);\n };\n /**\n * @param {Function} iterator - optional function that will be called\n * on each date that is added. It can return false\n * to stop the iteration.\n * @return Array containing all recurrences.\n */\n RRule.prototype.all = function (iterator) {\n if (iterator) {\n return this._iter(new CallbackIterResult('all', {}, iterator));\n }\n var result = this._cacheGet('all');\n if (result === false) {\n result = this._iter(new IterResult('all', {}));\n this._cacheAdd('all', result);\n }\n return result;\n };\n /**\n * Returns all the occurrences of the rrule between after and before.\n * The inc keyword defines what happens if after and/or before are\n * themselves occurrences. With inc == True, they will be included in the\n * list, if they are found in the recurrence set.\n *\n * @return Array\n */\n RRule.prototype.between = function (after, before, inc, iterator) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(after) || !isValidDate(before)) {\n throw new Error('Invalid date passed in to RRule.between');\n }\n var args = {\n before: before,\n after: after,\n inc: inc,\n };\n if (iterator) {\n return this._iter(new CallbackIterResult('between', args, iterator));\n }\n var result = this._cacheGet('between', args);\n if (result === false) {\n result = this._iter(new IterResult('between', args));\n this._cacheAdd('between', result, args);\n }\n return result;\n };\n /**\n * Returns the last recurrence before the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.before = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.before');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('before', args);\n if (result === false) {\n result = this._iter(new IterResult('before', args));\n this._cacheAdd('before', result, args);\n }\n return result;\n };\n /**\n * Returns the first recurrence after the given datetime instance.\n * The inc keyword defines what happens if dt is an occurrence.\n * With inc == True, if dt itself is an occurrence, it will be returned.\n *\n * @return Date or null\n */\n RRule.prototype.after = function (dt, inc) {\n if (inc === void 0) { inc = false; }\n if (!isValidDate(dt)) {\n throw new Error('Invalid date passed in to RRule.after');\n }\n var args = { dt: dt, inc: inc };\n var result = this._cacheGet('after', args);\n if (result === false) {\n result = this._iter(new IterResult('after', args));\n this._cacheAdd('after', result, args);\n }\n return result;\n };\n /**\n * Returns the number of recurrences in this set. It will have go trough\n * the whole recurrence, if this hasn't been done before.\n */\n RRule.prototype.count = function () {\n return this.all().length;\n };\n /**\n * Converts the rrule into its string representation\n *\n * @see \n * @return String\n */\n RRule.prototype.toString = function () {\n return optionsToString(this.origOptions);\n };\n /**\n * Will convert all rules described in nlp:ToText\n * to text.\n */\n RRule.prototype.toText = function (gettext, language, dateFormatter) {\n return toText(this, gettext, language, dateFormatter);\n };\n RRule.prototype.isFullyConvertibleToText = function () {\n return isFullyConvertible(this);\n };\n /**\n * @return a RRule instance with the same freq and options\n * as this one (cache is not cloned)\n */\n RRule.prototype.clone = function () {\n return new RRule(this.origOptions);\n };\n // RRule class 'constants'\n RRule.FREQUENCIES = [\n 'YEARLY',\n 'MONTHLY',\n 'WEEKLY',\n 'DAILY',\n 'HOURLY',\n 'MINUTELY',\n 'SECONDLY',\n ];\n RRule.YEARLY = Frequency.YEARLY;\n RRule.MONTHLY = Frequency.MONTHLY;\n RRule.WEEKLY = Frequency.WEEKLY;\n RRule.DAILY = Frequency.DAILY;\n RRule.HOURLY = Frequency.HOURLY;\n RRule.MINUTELY = Frequency.MINUTELY;\n RRule.SECONDLY = Frequency.SECONDLY;\n RRule.MO = Days.MO;\n RRule.TU = Days.TU;\n RRule.WE = Days.WE;\n RRule.TH = Days.TH;\n RRule.FR = Days.FR;\n RRule.SA = Days.SA;\n RRule.SU = Days.SU;\n RRule.parseString = parseString;\n RRule.optionsToString = optionsToString;\n return RRule;\n}());\nexport { RRule };\n//# sourceMappingURL=rrule.js.map","import { __assign } from \"tslib\";\nimport { RRule } from './rrule';\nimport { RRuleSet } from './rruleset';\nimport { untilStringToDate } from './dateutil';\nimport { includes, split } from './helpers';\nimport { parseString, parseDtstart } from './parsestring';\n/**\n * RRuleStr\n * To parse a set of rrule strings\n */\nvar DEFAULT_OPTIONS = {\n dtstart: null,\n cache: false,\n unfold: false,\n forceset: false,\n compatible: false,\n tzid: null,\n};\nexport function parseInput(s, options) {\n var rrulevals = [];\n var rdatevals = [];\n var exrulevals = [];\n var exdatevals = [];\n var parsedDtstart = parseDtstart(s);\n var dtstart = parsedDtstart.dtstart;\n var tzid = parsedDtstart.tzid;\n var lines = splitIntoLines(s, options.unfold);\n lines.forEach(function (line) {\n var _a;\n if (!line)\n return;\n var _b = breakDownLine(line), name = _b.name, parms = _b.parms, value = _b.value;\n switch (name.toUpperCase()) {\n case 'RRULE':\n if (parms.length) {\n throw new Error(\"unsupported RRULE parm: \".concat(parms.join(',')));\n }\n rrulevals.push(parseString(line));\n break;\n case 'RDATE':\n var _c = (_a = /RDATE(?:;TZID=([^:=]+))?/i.exec(line)) !== null && _a !== void 0 ? _a : [], rdateTzid = _c[1];\n if (rdateTzid && !tzid) {\n tzid = rdateTzid;\n }\n rdatevals = rdatevals.concat(parseRDate(value, parms));\n break;\n case 'EXRULE':\n if (parms.length) {\n throw new Error(\"unsupported EXRULE parm: \".concat(parms.join(',')));\n }\n exrulevals.push(parseString(value));\n break;\n case 'EXDATE':\n exdatevals = exdatevals.concat(parseRDate(value, parms));\n break;\n case 'DTSTART':\n break;\n default:\n throw new Error('unsupported property: ' + name);\n }\n });\n return {\n dtstart: dtstart,\n tzid: tzid,\n rrulevals: rrulevals,\n rdatevals: rdatevals,\n exrulevals: exrulevals,\n exdatevals: exdatevals,\n };\n}\nfunction buildRule(s, options) {\n var _a = parseInput(s, options), rrulevals = _a.rrulevals, rdatevals = _a.rdatevals, exrulevals = _a.exrulevals, exdatevals = _a.exdatevals, dtstart = _a.dtstart, tzid = _a.tzid;\n var noCache = options.cache === false;\n if (options.compatible) {\n options.forceset = true;\n options.unfold = true;\n }\n if (options.forceset ||\n rrulevals.length > 1 ||\n rdatevals.length ||\n exrulevals.length ||\n exdatevals.length) {\n var rset_1 = new RRuleSet(noCache);\n rset_1.dtstart(dtstart);\n rset_1.tzid(tzid || undefined);\n rrulevals.forEach(function (val) {\n rset_1.rrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n rdatevals.forEach(function (date) {\n rset_1.rdate(date);\n });\n exrulevals.forEach(function (val) {\n rset_1.exrule(new RRule(groomRruleOptions(val, dtstart, tzid), noCache));\n });\n exdatevals.forEach(function (date) {\n rset_1.exdate(date);\n });\n if (options.compatible && options.dtstart)\n rset_1.rdate(dtstart);\n return rset_1;\n }\n var val = rrulevals[0] || {};\n return new RRule(groomRruleOptions(val, val.dtstart || options.dtstart || dtstart, val.tzid || options.tzid || tzid), noCache);\n}\nexport function rrulestr(s, options) {\n if (options === void 0) { options = {}; }\n return buildRule(s, initializeOptions(options));\n}\nfunction groomRruleOptions(val, dtstart, tzid) {\n return __assign(__assign({}, val), { dtstart: dtstart, tzid: tzid });\n}\nfunction initializeOptions(options) {\n var invalid = [];\n var keys = Object.keys(options);\n var defaultKeys = Object.keys(DEFAULT_OPTIONS);\n keys.forEach(function (key) {\n if (!includes(defaultKeys, key))\n invalid.push(key);\n });\n if (invalid.length) {\n throw new Error('Invalid options: ' + invalid.join(', '));\n }\n return __assign(__assign({}, DEFAULT_OPTIONS), options);\n}\nfunction extractName(line) {\n if (line.indexOf(':') === -1) {\n return {\n name: 'RRULE',\n value: line,\n };\n }\n var _a = split(line, ':', 1), name = _a[0], value = _a[1];\n return {\n name: name,\n value: value,\n };\n}\nfunction breakDownLine(line) {\n var _a = extractName(line), name = _a.name, value = _a.value;\n var parms = name.split(';');\n if (!parms)\n throw new Error('empty property name');\n return {\n name: parms[0].toUpperCase(),\n parms: parms.slice(1),\n value: value,\n };\n}\nfunction splitIntoLines(s, unfold) {\n if (unfold === void 0) { unfold = false; }\n s = s && s.trim();\n if (!s)\n throw new Error('Invalid empty string');\n // More info about 'unfold' option\n // Go head to http://www.ietf.org/rfc/rfc2445.txt\n if (!unfold) {\n return s.split(/\\s/);\n }\n var lines = s.split('\\n');\n var i = 0;\n while (i < lines.length) {\n // TODO\n var line = (lines[i] = lines[i].replace(/\\s+$/g, ''));\n if (!line) {\n lines.splice(i, 1);\n }\n else if (i > 0 && line[0] === ' ') {\n lines[i - 1] += line.slice(1);\n lines.splice(i, 1);\n }\n else {\n i += 1;\n }\n }\n return lines;\n}\nfunction validateDateParm(parms) {\n parms.forEach(function (parm) {\n if (!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(parm)) {\n throw new Error('unsupported RDATE/EXDATE parm: ' + parm);\n }\n });\n}\nfunction parseRDate(rdateval, parms) {\n validateDateParm(parms);\n return rdateval.split(',').map(function (datestr) { return untilStringToDate(datestr); });\n}\n//# sourceMappingURL=rrulestr.js.map","import { __extends } from \"tslib\";\nimport { RRule } from './rrule';\nimport { sort, timeToUntilString } from './dateutil';\nimport { includes } from './helpers';\nimport { iterSet } from './iterset';\nimport { rrulestr } from './rrulestr';\nimport { optionsToString } from './optionstostring';\nfunction createGetterSetter(fieldName) {\n var _this = this;\n return function (field) {\n if (field !== undefined) {\n _this[\"_\".concat(fieldName)] = field;\n }\n if (_this[\"_\".concat(fieldName)] !== undefined) {\n return _this[\"_\".concat(fieldName)];\n }\n for (var i = 0; i < _this._rrule.length; i++) {\n var field_1 = _this._rrule[i].origOptions[fieldName];\n if (field_1) {\n return field_1;\n }\n }\n };\n}\nvar RRuleSet = /** @class */ (function (_super) {\n __extends(RRuleSet, _super);\n /**\n *\n * @param {Boolean?} noCache\n * The same stratagy as RRule on cache, default to false\n * @constructor\n */\n function RRuleSet(noCache) {\n if (noCache === void 0) { noCache = false; }\n var _this = _super.call(this, {}, noCache) || this;\n _this.dtstart = createGetterSetter.apply(_this, ['dtstart']);\n _this.tzid = createGetterSetter.apply(_this, ['tzid']);\n _this._rrule = [];\n _this._rdate = [];\n _this._exrule = [];\n _this._exdate = [];\n return _this;\n }\n RRuleSet.prototype._iter = function (iterResult) {\n return iterSet(iterResult, this._rrule, this._exrule, this._rdate, this._exdate, this.tzid());\n };\n /**\n * Adds an RRule to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.rrule = function (rrule) {\n _addRule(rrule, this._rrule);\n };\n /**\n * Adds an EXRULE to the set\n *\n * @param {RRule}\n */\n RRuleSet.prototype.exrule = function (rrule) {\n _addRule(rrule, this._exrule);\n };\n /**\n * Adds an RDate to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.rdate = function (date) {\n _addDate(date, this._rdate);\n };\n /**\n * Adds an EXDATE to the set\n *\n * @param {Date}\n */\n RRuleSet.prototype.exdate = function (date) {\n _addDate(date, this._exdate);\n };\n /**\n * Get list of included rrules in this recurrence set.\n *\n * @return List of rrules\n */\n RRuleSet.prototype.rrules = function () {\n return this._rrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of excluded rrules in this recurrence set.\n *\n * @return List of exrules\n */\n RRuleSet.prototype.exrules = function () {\n return this._exrule.map(function (e) { return rrulestr(e.toString()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of rdates\n */\n RRuleSet.prototype.rdates = function () {\n return this._rdate.map(function (e) { return new Date(e.getTime()); });\n };\n /**\n * Get list of included datetimes in this recurrence set.\n *\n * @return List of exdates\n */\n RRuleSet.prototype.exdates = function () {\n return this._exdate.map(function (e) { return new Date(e.getTime()); });\n };\n RRuleSet.prototype.valueOf = function () {\n var result = [];\n if (!this._rrule.length && this._dtstart) {\n result = result.concat(optionsToString({ dtstart: this._dtstart }));\n }\n this._rrule.forEach(function (rrule) {\n result = result.concat(rrule.toString().split('\\n'));\n });\n this._exrule.forEach(function (exrule) {\n result = result.concat(exrule\n .toString()\n .split('\\n')\n .map(function (line) { return line.replace(/^RRULE:/, 'EXRULE:'); })\n .filter(function (line) { return !/^DTSTART/.test(line); }));\n });\n if (this._rdate.length) {\n result.push(rdatesToString('RDATE', this._rdate, this.tzid()));\n }\n if (this._exdate.length) {\n result.push(rdatesToString('EXDATE', this._exdate, this.tzid()));\n }\n return result;\n };\n /**\n * to generate recurrence field such as:\n * DTSTART:19970902T010000Z\n * RRULE:FREQ=YEARLY;COUNT=2;BYDAY=TU\n * RRULE:FREQ=YEARLY;COUNT=1;BYDAY=TH\n */\n RRuleSet.prototype.toString = function () {\n return this.valueOf().join('\\n');\n };\n /**\n * Create a new RRuleSet Object completely base on current instance\n */\n RRuleSet.prototype.clone = function () {\n var rrs = new RRuleSet(!!this._cache);\n this._rrule.forEach(function (rule) { return rrs.rrule(rule.clone()); });\n this._exrule.forEach(function (rule) { return rrs.exrule(rule.clone()); });\n this._rdate.forEach(function (date) { return rrs.rdate(new Date(date.getTime())); });\n this._exdate.forEach(function (date) { return rrs.exdate(new Date(date.getTime())); });\n return rrs;\n };\n return RRuleSet;\n}(RRule));\nexport { RRuleSet };\nfunction _addRule(rrule, collection) {\n if (!(rrule instanceof RRule)) {\n throw new TypeError(String(rrule) + ' is not RRule instance');\n }\n if (!includes(collection.map(String), String(rrule))) {\n collection.push(rrule);\n }\n}\nfunction _addDate(date, collection) {\n if (!(date instanceof Date)) {\n throw new TypeError(String(date) + ' is not Date instance');\n }\n if (!includes(collection.map(Number), Number(date))) {\n collection.push(date);\n sort(collection);\n }\n}\nfunction rdatesToString(param, rdates, tzid) {\n var isUTC = !tzid || tzid.toUpperCase() === 'UTC';\n var header = isUTC ? \"\".concat(param, \":\") : \"\".concat(param, \";TZID=\").concat(tzid, \":\");\n var dateString = rdates\n .map(function (rdate) { return timeToUntilString(rdate.valueOf(), isUTC); })\n .join(',');\n return \"\".concat(header).concat(dateString);\n}\n//# sourceMappingURL=rruleset.js.map","import { DateWithZone } from './datewithzone';\nimport { iter } from './iter';\nimport { sort } from './dateutil';\nexport function iterSet(iterResult, _rrule, _exrule, _rdate, _exdate, tzid) {\n var _exdateHash = {};\n var _accept = iterResult.accept;\n function evalExdate(after, before) {\n _exrule.forEach(function (rrule) {\n rrule.between(after, before, true).forEach(function (date) {\n _exdateHash[Number(date)] = true;\n });\n });\n }\n _exdate.forEach(function (date) {\n var zonedDate = new DateWithZone(date, tzid).rezonedDate();\n _exdateHash[Number(zonedDate)] = true;\n });\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (isNaN(dt))\n return _accept.call(this, date);\n if (!_exdateHash[dt]) {\n evalExdate(new Date(dt - 1), new Date(dt + 1));\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n }\n return true;\n };\n if (iterResult.method === 'between') {\n evalExdate(iterResult.args.after, iterResult.args.before);\n iterResult.accept = function (date) {\n var dt = Number(date);\n if (!_exdateHash[dt]) {\n _exdateHash[dt] = true;\n return _accept.call(this, date);\n }\n return true;\n };\n }\n for (var i = 0; i < _rdate.length; i++) {\n var zonedDate = new DateWithZone(_rdate[i], tzid).rezonedDate();\n if (!iterResult.accept(new Date(zonedDate.getTime())))\n break;\n }\n _rrule.forEach(function (rrule) {\n iter(iterResult, rrule.options);\n });\n var res = iterResult._result;\n sort(res);\n switch (iterResult.method) {\n case 'all':\n case 'between':\n return res;\n case 'before':\n return ((res.length && res[res.length - 1]) || null);\n case 'after':\n default:\n return ((res.length && res[0]) || null);\n }\n}\n//# sourceMappingURL=iterset.js.map","interface IViewPosition{\r\n\ttop: number;\r\n\tleft: number;\r\n}\r\n\r\ninterface IViewBox extends IViewPosition{\r\n\twidth: number;\r\n\theight: number;\r\n\tbottom: number;\r\n\tright: number;\r\n}\r\n\r\nexport class Tooltip {\r\n\tprivate _root: HTMLElement;\r\n\tprivate _tooltipNode: HTMLElement | null;\r\n\tprivate _scheduler: any;\r\n\r\n\tconstructor(scheduler: any){\r\n\t\tthis._scheduler = scheduler;\r\n\t}\r\n\r\n\tgetNode() : HTMLElement {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tif (!this._tooltipNode){\r\n\t\t\tthis._tooltipNode = document.createElement(\"div\");\r\n\t\t\tthis._tooltipNode.className = \"dhtmlXTooltip scheduler_tooltip tooltip\";\r\n\r\n\t\t\tscheduler._waiAria.tooltipAttr(this._tooltipNode);\r\n\t\t}\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tthis._tooltipNode.classList.add(\"dhtmlXTooltip_rtl\");\r\n\t\t} else{\r\n\t\t\tthis._tooltipNode.classList.remove(\"dhtmlXTooltip_rtl\");\r\n\t\t}\r\n\t\treturn this._tooltipNode;\r\n\t}\r\n\r\n\tsetViewport(node: HTMLElement):Tooltip{\r\n\t\tthis._root = node;\r\n\t\treturn this;\r\n\t}\r\n\r\n\tshow(left: number, top: number): Tooltip;\r\n\tshow(event: MouseEvent): Tooltip;\r\n\tshow(left: number | MouseEvent, top?: number): Tooltip {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = document.body;\r\n\t\tconst node = this.getNode();\r\n\r\n\t\tif(!domHelpers.isChildOf(node, container)){\r\n\t\t\tthis.hide();\r\n\t\t\tcontainer.appendChild(node);\r\n\t\t}\r\n\r\n\t\tif (this._isLikeMouseEvent(left)) {\r\n\t\t\tconst position = this._calculateTooltipPosition(left as MouseEvent);\r\n\t\t\ttop = position.top;\r\n\t\t\tleft = position.left;\r\n\t\t}\r\n\r\n\t\tnode.style.top = top + \"px\";\r\n\t\tnode.style.left = left + \"px\";\r\n\r\n\t\tscheduler._waiAria.tooltipVisibleAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\thide() : Tooltip{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst node = this.getNode();\r\n\t\tif(node && node.parentNode){\r\n\t\t\tnode.parentNode.removeChild(node);\r\n\t\t}\r\n\t\tscheduler._waiAria.tooltipHiddenAttr(node);\r\n\t\treturn this;\r\n\t}\r\n\r\n\tsetContent(html: string) : Tooltip{\r\n\t\tconst node = this.getNode();\r\n\t\tnode.innerHTML = html;\r\n\t\treturn this;\r\n\t}\r\n\r\n\t// it is for salesforce, because it proxies event to it own events\r\n\tprivate _isLikeMouseEvent(event: any): boolean {\r\n\t\tif (!event || typeof event !== \"object\") {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn \"clientX\" in event && \"clientY\" in event;\r\n\t}\r\n\r\n\tprivate _getViewPort() : HTMLElement {\r\n\t\treturn this._root || document.body;\r\n\t}\r\n\r\n\r\n\tprivate _calculateTooltipPosition(event: MouseEvent): IViewPosition{\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\t// top/left coordinates inside the viewport by mouse position\r\n\t\tconst viewport = this._getViewPortSize();\r\n\t\tconst tooltipNode = this.getNode();\r\n\t\tconst tooltip: IViewBox = {\r\n\t\t\ttop:0,\r\n\t\t\tleft: 0,\r\n\t\t\twidth: tooltipNode.offsetWidth,\r\n\t\t\theight: tooltipNode.offsetHeight,\r\n\t\t\tbottom: 0,\r\n\t\t\tright: 0\r\n\t\t};\r\n\r\n\t\tconst offsetX = scheduler.config.tooltip_offset_x;\r\n\t\tconst offsetY = scheduler.config.tooltip_offset_y;\r\n\r\n\t\tconst container = document.body;\r\n\t\tconst mouse = domHelpers.getRelativeEventPosition(event, container);\r\n\t\tconst containerPos = domHelpers.getNodePosition(container);\r\n\t\tmouse.y += containerPos.y; // to fix margin collapsing\r\n\r\n\t\ttooltip.top = mouse.y;\r\n\t\ttooltip.left = mouse.x;\r\n\t\ttooltip.top += offsetY;\r\n\t\ttooltip.left += offsetX;\r\n\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\r\n\t\tconst scrollTop = window.scrollY + container.scrollTop; // to fix margin collapsing\r\n\t\t// edge cases when the tooltip element can be partially hidden by edges of the viewport\r\n\t\tif(tooltip.top < viewport.top - scrollTop){\r\n\t\t\ttooltip.top = viewport.top;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}else if(tooltip.bottom > viewport.bottom){\r\n\t\t\ttooltip.bottom = viewport.bottom;\r\n\t\t\ttooltip.top = tooltip.bottom - tooltip.height;\r\n\t\t}\r\n\r\n\t\tif(tooltip.left < viewport.left){\r\n\t\t\ttooltip.left = viewport.left;\r\n\t\t\ttooltip.right = viewport.left + tooltip.width;\r\n\t\t}else if(tooltip.right > viewport.right){\r\n\t\t\ttooltip.right = viewport.right;\r\n\t\t\ttooltip.left = tooltip.right - tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.x >= tooltip.left && mouse.x <= tooltip.right) {\r\n\t\t\ttooltip.left = mouse.x - tooltip.width - offsetX;\r\n\t\t\ttooltip.right = tooltip.left + tooltip.width;\r\n\t\t}\r\n\r\n\t\tif(mouse.y >= tooltip.top && mouse.y <= tooltip.bottom) {\r\n\t\t\ttooltip.top = mouse.y - tooltip.height - offsetY;\r\n\t\t\ttooltip.bottom = tooltip.top + tooltip.height;\r\n\t\t}\r\n\r\n\t\treturn tooltip;\r\n\t}\r\n\r\n\tprivate _getViewPortSize() : IViewBox {\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tconst container = this._getViewPort();\r\n\t\tlet viewport = container;\r\n\t\tlet scrollTop = window.scrollY + document.body.scrollTop;\r\n\t\tlet scrollLeft = window.scrollX + document.body.scrollLeft;\r\n\t\tlet pos;\r\n\t\t// support for the initial tooltip mode where the tooltip element was attached to the data area of scheduler\r\n\t\tif(container === scheduler.$event_data){\r\n\t\t\tviewport = scheduler.$event;\r\n\t\t\tscrollTop = 0;\r\n\t\t\tscrollLeft = 0;\r\n\t\t\tpos = domHelpers.getNodePosition(scheduler.$event);\r\n\t\t}else{\r\n\t\t\tpos = domHelpers.getNodePosition(viewport);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tleft:pos.x + scrollLeft,\r\n\t\t\ttop: pos.y + scrollTop,\r\n\t\t\twidth: pos.width,\r\n\t\t\theight: pos.height,\r\n\t\t\tbottom: pos.y + pos.height + scrollTop,\r\n\t\t\tright: pos.x + pos.width + scrollLeft\r\n\t\t};\r\n\t}\r\n}\r\n","import * as utils from \"../../core/utils/utils\";\r\nimport { Tooltip } from \"./tooltip\";\r\n\r\ninterface ITrackerTarget {\r\n\tselector: string;\r\n\tonmouseenter: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmousemove: (event: MouseEvent, node: HTMLElement) => void;\r\n\tonmouseleave: (event: MouseEvent, node: HTMLElement) => void;\r\n\tglobal: boolean;\r\n}\r\n\r\ninterface ITooltipConfig {\r\n\tselector: string;\r\n\thtml: (event: MouseEvent, node: HTMLElement) => string;\r\n\tglobal: boolean;\r\n}\r\n\r\nexport class TooltipManager{\r\n\ttooltip: Tooltip;\r\n\tprotected _domEvents: any;\r\n\tprivate _listeners: object = {};\r\n\tprivate _scheduler: any;\r\n\tprivate delayShow: any;\r\n\tprivate delayHide: any;\r\n\r\n\tconstructor(scheduler: any) {\r\n\t\tthis.tooltip = new Tooltip(scheduler);\r\n\t\tthis._scheduler = scheduler;\r\n\t\tthis._domEvents = scheduler._createDomEventScope();\r\n\t\tthis._initDelayedFunctions();\r\n\t}\r\n\r\n\tdestructor(): void{\r\n\t\tthis.tooltip.hide();\r\n\t\tthis._domEvents.detachAll();\r\n\t}\r\n\thideTooltip(): void{\r\n\t\tthis.delayHide();\r\n\t}\r\n\tattach(config: ITrackerTarget): void {\r\n\t\tlet root = document.body;\r\n\t\tconst scheduler = this._scheduler;\r\n\t\tconst domHelpers = scheduler.$domHelpers;\r\n\t\tif(!config.global){\r\n\t\t\troot = scheduler.$root;\r\n\t\t}\r\n\r\n\t\tlet watchableTarget = null;\r\n\t\tconst handler = (event) => {\r\n\t\t\tconst eventTarget = domHelpers.getTargetNode(event);\r\n\t\t\tconst targetNode = domHelpers.closest(eventTarget, config.selector);\r\n\t\t\tif(domHelpers.isChildOf(eventTarget, this.tooltip.getNode())){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst doOnMouseEnter = () => {\r\n\t\t\t\twatchableTarget = targetNode;\r\n\t\t\t\tconfig.onmouseenter(event, targetNode);\r\n\t\t\t};\r\n\t\t\t// GS-2377: to show tooltip after touch and hide it when touch is outside the events\r\n\t\t\tif (scheduler._mobile && scheduler.config.touch_tooltip){\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconfig.onmouseleave(event, targetNode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(watchableTarget){\r\n\t\t\t\tif(targetNode && targetNode === watchableTarget){\r\n\t\t\t\t\tconfig.onmousemove(event, targetNode);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tconfig.onmouseleave(event, watchableTarget);\r\n\t\t\t\t\twatchableTarget = null;\r\n\r\n\t\t\t\t\tif(targetNode && targetNode !== watchableTarget){\r\n\t\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(targetNode){\r\n\t\t\t\t\tdoOnMouseEnter();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tthis.detach(config.selector);\r\n\t\tthis._domEvents.attach(root, \"mousemove\", handler);\r\n\t\tthis._listeners[config.selector] = {\r\n\t\t\tnode: root,\r\n\t\t\thandler\r\n\t\t};\r\n\t}\r\n\r\n\tdetach(selector: string): void {\r\n\t\tconst listener = this._listeners[selector];\r\n\t\tif(listener){\r\n\t\t\tthis._domEvents.detach(listener.node, \"mousemove\", listener.handler);\r\n\t\t}\r\n\t}\r\n\r\n\ttooltipFor(config: ITooltipConfig): void {\r\n\t\tconst cloneDomEvent = (event: MouseEvent) => {\r\n\t\t\tlet clone = event;\r\n\t\t\t// making events survive timeout in ie\r\n\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\tif(document[\"createEventObject\"] && !document.createEvent){\r\n\t\t\t\t// tslint:disable-next-line no-string-literal\r\n\t\t\t\tclone = document[\"createEventObject\"](event);\r\n\t\t\t}\r\n\t\t\treturn clone;\r\n\t\t};\r\n\t\tthis._initDelayedFunctions();\r\n\t\tthis.attach({\r\n\t\t\tselector: config.selector,\r\n\t\t\tglobal: config.global,\r\n\t\t\tonmouseenter:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmousemove:(event: MouseEvent, node: HTMLElement) => {\r\n\t\t\t\tconst html = config.html(event, node);\r\n\t\t\t\tif(html){\r\n\t\t\t\t\tthis.delayShow(cloneDomEvent(event), html);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\t\tthis.delayHide();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tonmouseleave:() => {\r\n\t\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\t\tthis.delayHide();\r\n\t\t\t},\r\n\t\t});\r\n\t}\r\n\r\n\tprivate _initDelayedFunctions(){\r\n\t\tconst scheduler = this._scheduler;\r\n\t\t// reset delayed functions in order to apply current values of tooltip_timeout\r\n\t\tif(this.delayShow){\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t}\r\n\t\tif(this.delayHide){\r\n\t\t\tthis.delayHide.$cancelTimeout();\r\n\t\t}\r\n\t\tthis.tooltip.hide();\r\n\t\t\r\n\t\tthis.delayShow = (utils as any).default.delay((event: MouseEvent, html: string) => {\r\n\t\t\tif(scheduler.callEvent(\"onBeforeTooltip\", [event]) === false) {\r\n\t\t\t\tthis.tooltip.hide();\r\n\t\t\t} else {\r\n\t\t\t\tthis.tooltip.setContent(html);\r\n\t\t\t\tthis.tooltip.show(event);\r\n\t\t\t}\r\n\t\t}, scheduler.config.tooltip_timeout || 1);\r\n\r\n\t\tthis.delayHide = (utils as any).default.delay(() => {\r\n\t\t\tthis.delayShow.$cancelTimeout();\r\n\t\t\tthis.tooltip.hide();\r\n\t\t}, scheduler.config.tooltip_hide_timeout || 1);\r\n\t}\r\n\r\n}","import active_links from \"./active_links\";\r\nimport agenda_legacy from \"./agenda_legacy_view\";\r\nimport agenda_view from \"./agenda\";\r\nimport all_timed from \"./all_timed\";\r\nimport collision from \"./collision\";\r\nimport container_autoresize from \"./container_autoresize\";\r\nimport cookie from \"./cookie\";\r\nimport daytimeline_restricted from \"./restricted_extensions/daytimeline\";\r\nimport drag_between_restricted from \"./restricted_extensions/drag_between\";\r\nimport editors from \"./editors\";\r\nimport expand from \"./expand\";\r\nimport grid_view from \"./restricted_extensions/grid_view\";\r\nimport html_templates from \"./html_templates\";\r\nimport key_nav from \"./key_nav\";\r\nimport layer from \"./layer\";\r\nimport limit from \"./limit\";\r\nimport map_view from \"./map_view\";\r\nimport minical from \"./minical\";\r\nimport monthheight from \"./monthheight\";\r\nimport multisection_restricted from \"./restricted_extensions/multisection\";\r\nimport multiselect from \"./multiselect\";\r\nimport multisource from \"./multisource\";\r\nimport mvc from \"./mvc\";\r\nimport outerdrag from \"./outerdrag\";\r\nimport pdf from \"./pdf\";\r\nimport quick_info from \"./quick_info\";\r\nimport readonly from \"./readonly\";\r\nimport recurring from \"./recurring\";\r\nimport recurring_legacy from \"./recurring_legacy\";\r\nimport serialize from \"./serialize\";\r\nimport timeline_restricted from \"./restricted_extensions/timeline\";\r\nimport tooltip from \"./tooltip\";\r\nimport treetimeline_restricted from \"./restricted_extensions/treetimeline\";\r\nimport units_restricted from \"./restricted_extensions/units\";\r\nimport url from \"./url\";\r\nimport week_agenda_restricted from \"./restricted_extensions/week_agenda\";\r\nimport wp from \"./wp\";\r\nimport year_view from \"./year_view\";\r\nimport export_api from \"./export_api\";\r\n\r\nexport default {\r\n\tactive_links,\r\n\tagenda_legacy,\r\n\tagenda_view,\r\n\tall_timed,\r\n\tcollision,\r\n\tcontainer_autoresize,\r\n\tcookie,\r\n\tdaytimeline: daytimeline_restricted,\r\n\tdrag_between: drag_between_restricted,\r\n\teditors,\r\n\texpand,\r\n\texport_api,\r\n\tgrid_view,\r\n\thtml_templates,\r\n\tkey_nav,\r\n\tlayer,\r\n\tlimit,\r\n\tmap_view,\r\n\tminical,\r\n\tmonthheight,\r\n\tmultisection: multisection_restricted,\r\n\tmultiselect,\r\n\tmultisource,\r\n\tmvc,\r\n\touterdrag,\r\n\tpdf,\r\n\tquick_info,\r\n\treadonly,\r\n\trecurring,\r\n\trecurring_legacy,\r\n\tserialize,\r\n\ttimeline: timeline_restricted,\r\n\ttooltip,\r\n\ttreetimeline: treetimeline_restricted,\r\n\tunits: units_restricted,\r\n\turl,\r\n\tweek_agenda: week_agenda_restricted,\r\n\twp,\r\n\tyear_view\r\n};","export default function(scheduler){\r\n\r\nscheduler.config.active_link_view = \"day\";\r\nscheduler._active_link_click = function(e){\r\n\tvar start = e.target;\r\n\tvar to = start.getAttribute(\"data-link-date\");\r\n\tvar s_d = scheduler.date.str_to_date(scheduler.config.api_date, false, true);\r\n\tif (to) {\r\n\t\tscheduler.setCurrentView(s_d(to), scheduler.config.active_link_view);\r\n\t\tif (e && e.preventDefault)\r\n\t\t\te.preventDefault();\r\n\t\treturn false;\r\n\t}\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar do_wrapper = function(key, fullname){\r\n\t\tfullname = fullname || (key+\"_scale_date\");\r\n\r\n\t\tif(!scheduler.templates['_active_links_old_'+ fullname]){\r\n\t\t\tscheduler.templates['_active_links_old_'+ fullname] = scheduler.templates[fullname];\r\n\t\t}\r\n\t\tvar week_x = scheduler.templates['_active_links_old_'+ fullname];\r\n\t\tvar d_s = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\t\tscheduler.templates[fullname] = function(date) {\r\n\t\t\treturn \"\" + week_x(date) + \" \";\r\n\t\t};\r\n\t};\r\n\r\n\tdo_wrapper(\"week\");\r\n\tdo_wrapper(\"\", \"month_day\");\r\n\tif (this.matrix){\r\n\t\tfor (var key in this.matrix)\r\n\t\t\tdo_wrapper(key);\r\n\t}\r\n\r\n\tthis._detachDomEvent(this._obj, \"click\", scheduler._active_link_click);\r\n\tscheduler.event(this._obj, \"click\", scheduler._active_link_click);\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.date.add_agenda_legacy = function(date){\r\n\treturn scheduler.date.add(date, 1, \"year\");\r\n};\r\n\r\nscheduler.templates.agenda_legacy_time = function(start,end,ev){\r\n\tif (ev._timed)\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev)+\" \"+this.event_date(start);\r\n\telse\r\n\t\treturn scheduler.templates.day_date(start)+\" – \"+scheduler.templates.day_date(end);\r\n};\r\nscheduler.templates.agenda_legacy_text = function(start,end,event){\r\n\treturn event.text;\r\n};\r\nscheduler.templates.agenda_legacy_date = function(){ return \"\"; };\r\n\r\nscheduler.date.agenda_legacy_start=function(){ return scheduler.date.date_part(scheduler._currentDate()); };\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\tif (this._mode == \"agenda_legacy\") {\r\n\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\tthis.addEventNow();\r\n\t\t} else {\r\n\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t}\r\n\t};\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data=function(evs){\r\n\t\tif (this._mode == \"agenda_legacy\")\r\n\t\t\tfill_agenda_tab();\r\n\t\telse\r\n\t\t\treturn old.apply(this,arguments);\r\n\t};\r\n\r\n\tvar old_render_view_data = scheduler.render_view_data;\r\n\tscheduler.render_view_data = function(){\r\n\t\tif(this._mode == \"agenda_legacy\") {\r\n\t\t\tscheduler._agendaScrollTop = scheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop;\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = 0;\r\n\t\t}\r\n\t\treturn old_render_view_data.apply(this,arguments);\r\n\t};\r\n\r\n\r\n\r\n\tfunction set_full_view(mode){\r\n\t\tif (mode){\r\n\t\t\tvar l = scheduler.locale.labels;\r\n\r\n\t\t\tvar rowAttr = scheduler._waiAria.agendaHeadAttrString();\r\n\t\t\tvar dateHeader = scheduler._waiAria.agendaHeadDateString(l.date);\r\n\t\t\tvar descriptionHeader = scheduler._waiAria.agendaHeadDescriptionString(l.description);\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML=\"\";\r\n\t\t\tscheduler._table_view=true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fill_agenda_tab(){\r\n\t\t//select events for which data need to be printed\r\n\r\n\t\tvar events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\tvar tableAttr = scheduler._waiAria.agendaDataAttrString();\r\n\t\tvar agendaEventAttrString;\r\n\t\t//generate html for the view\r\n\t\tvar html=\"\";\r\n\t\tfor (var i=0; i
\"+\r\n\t\t\t\t\t(scheduler.config.rtl ? scheduler.templates.agenda_time(ev.end_date,ev.start_date, ev):scheduler.templates.agenda_time(ev.start_date, ev.end_date,ev))+\r\n\t\t\t\t\t\"
\";\r\n\t\t\thtml+=``;\r\n\t\t\thtml+=\"\"+scheduler.templates.agenda_text(ev.start_date, ev.end_date, ev)+\" \";\r\n\t\t}\r\n\t\thtml+=\"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].childNodes[0].scrollTop = scheduler._agendaScrollTop||0;\r\n\r\n\t\t// setting up dhx_v_border size\r\n\t\tvar agenda_area = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\tvar v_border = agenda_area.childNodes[agenda_area.childNodes.length-1];\r\n\t\tv_border.style.height = (agenda_area.offsetHeight < scheduler._els[\"dhx_cal_data\"][0].offsetHeight) ? \"100%\" : (agenda_area.offsetHeight+\"px\");\r\n\r\n\t\tvar t=scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tvar dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates.agenda_date(scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered=[];\r\n\t\tfor (var i=0; i < t.length-1; i++)\r\n\t\t\tscheduler._rendered[i]=t[i];\r\n\r\n\t}\r\n\r\n\tscheduler.agenda_legacy_view=function(mode){\r\n\t\tscheduler._min_date = scheduler.config.agenda_start||scheduler.date.agenda_legacy_start(scheduler._date);\r\n\t\tscheduler._max_date = scheduler.config.agenda_end||scheduler.date.add_agenda_legacy(scheduler._min_date, 1);\r\n\r\n\t\tset_full_view(mode);\r\n\t\tif (mode){\r\n\t\t\tscheduler._cols = null;\r\n\t\t\tscheduler._colsS = null;\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\t//agenda tab activated\r\n\t\t\tfill_agenda_tab();\r\n\t\t} else {\r\n\t\t\tscheduler._table_view = false;\r\n\t\t\t//agenda tab de-activated\r\n\t\t}\r\n\t};\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.date.add_agenda = function(date, inc){\r\n\t\treturn scheduler.date.add(date, 1*inc, \"month\");\r\n\t};\r\n\t\r\n\tscheduler.templates.agenda_time = function(start,end,ev){\r\n\t\tif (ev._timed){\r\n\t\t\treturn `${this.event_date(start)} - ${this.event_date(end)}`;\r\n\t\t}else{\r\n\t\t\treturn scheduler.locale.labels.full_day;\r\n\t\t}\r\n\t};\r\n\tscheduler.templates.agenda_text = function(start,end,ev){\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst dayDateToStr = scheduler.date.date_to_str(\"%F %j\");\r\n\tconst dayDowToStr = scheduler.date.date_to_str(\"%l\");\r\n\r\n\tscheduler.templates.agenda_day = function(date){ \r\n\t\treturn `
${dayDateToStr(date)}
\r\n\t\t
${dayDowToStr(date)}
`;\r\n\t};\r\n\tscheduler.templates.agenda_date = function(start, end){ \r\n\t\treturn scheduler.templates.month_date(scheduler.getState().date); \r\n\t};\r\n\t\r\n\tscheduler.date.agenda_start=function(date){\r\n\t\treturn scheduler.date.month_start(new Date(date));\r\n\t};\r\n\r\n\tlet scrollTop = 0;\r\n\t\r\n\tscheduler.attachEvent(\"onTemplatesReady\",function() {\r\n\t\tvar old_dblclick_dhx_cal_data = scheduler.dblclick_dhx_cal_data;\r\n\t\tscheduler.dblclick_dhx_cal_data = function() {\r\n\t\t\tif (this._mode == \"agenda\") {\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create)\r\n\t\t\t\t\tthis.addEventNow();\r\n\t\t\t} else {\r\n\t\t\t\tif (old_dblclick_dhx_cal_data)\r\n\t\t\t\t\treturn old_dblclick_dhx_cal_data.apply(this, arguments);\r\n\t\t\t}\r\n\t\t};\r\n\t\r\n\t\r\n\t\tvar old = scheduler.render_data;\r\n\t\tscheduler.render_data=function(evs){\r\n\t\t\tif (this._mode == \"agenda\")\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\telse\r\n\t\t\t\treturn old.apply(this,arguments);\r\n\t\t};\r\n\t\r\n\t\tvar old_render_view_data = scheduler.render_view_data;\r\n\t\tscheduler.render_view_data = function(){\r\n\t\t\tif(this._mode == \"agenda\") {\r\n\t\t\t\tscrollTop = scheduler._els[\"dhx_cal_data\"][0].scrollTop;\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0;\r\n\t\t\t}\r\n\t\t\treturn old_render_view_data.apply(this,arguments);\r\n\t\t};\r\n\r\n\t\tfunction fill_agenda_tab(){\r\n\t\t\tconst events = scheduler.get_visible_events();\r\n\t\t\tevents.sort(function(a,b){ return a.start_date>b.start_date?1:-1;});\r\n\r\n\t\t\tconst eventsInDays = {};\r\n\t\t\tlet currDate = scheduler.getState().min_date;\r\n\t\t\tconst maxDate = scheduler.getState().max_date;\r\n\t\t\twhile(currDate.valueOf() < maxDate.valueOf()){\r\n\t\t\t\teventsInDays[currDate.valueOf()] = [];\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\r\n\t\t\tlet anyEvents = false;\r\n\r\n\t\t\tevents.forEach((ev) => {\r\n\t\t\t\tlet eventStart = scheduler.date.day_start(new Date(ev.start_date)); \r\n\t\t\t\twhile (eventStart.valueOf() < ev.end_date.valueOf()) {\r\n\t\t\t\t\tif (eventsInDays[eventStart.valueOf()]) {\r\n\t\t\t\t\t\teventsInDays[eventStart.valueOf()].push(ev);\r\n\t\t\t\t\t\tanyEvents = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\teventStart = scheduler.date.day_start(scheduler.date.add(eventStart, 1, \"day\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif(!anyEvents){\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = renderEmptyView();\r\n\t\t\t}else{\r\n\t\t\t\tlet html = \"\";\r\n\t\t\t\tfor(let day in eventsInDays){\r\n\t\t\t\t\tif(scheduler.ignore_agenda && scheduler.ignore_agenda(new Date(day*1))){\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\thtml += renderDay(new Date(day*1), eventsInDays[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = scrollTop;\r\n\t\t\t\r\n\t\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].querySelectorAll(\".dhx_cal_agenda_event_line\");\r\n\t\t\tscheduler._rendered = [];\r\n\t\t\tfor (var i = 0; i < t.length - 1; i++) {\r\n\t\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\r\n\r\n\t\tfunction renderEmptyView(){\r\n\t\t\treturn `
${scheduler.locale.labels.agenda_tab}
`;\r\n\t\t}\r\n\r\n\t\tfunction renderDay(day, events) {\r\n\t\t\tif(!events.length){\r\n\t\t\t\treturn \"\";\r\n\t\t\t}\r\n\t\t\tlet html = `\r\n
\r\n\t\r\n\t
\r\n`;\r\n\r\n\t\t\tevents.forEach((calendarEvent) => {\r\n\t\t\t\thtml += renderOneEvent(day, calendarEvent);\r\n\t\t\t});\r\n\r\n\t\t\thtml += `
`;\r\n\t\t\treturn html;\r\n\t\t}\r\n\r\n\t\tfunction renderOneEvent(day, calendarEvent){\r\n\t\t\tconst dates = scheduler.templates.agenda_time(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst selectedId = scheduler.getState().select_id;\r\n\t\t\tconst cls = scheduler.templates.event_class(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\t\t\tconst description = scheduler.templates.agenda_text(calendarEvent.start_date, calendarEvent.end_date, calendarEvent);\r\n\r\n\t\t\tlet style = \"\";\r\n\t\t\tif(calendarEvent.color || calendarEvent.textColor){\r\n\t\t\t\tconst bg = (calendarEvent.color ? (\"--dhx-scheduler-event-background:\" + calendarEvent.color + \";\") : \"\");\r\n\t\t\t\tconst color = (calendarEvent.textColor ? (\"--dhx-scheduler-event-color:\" + calendarEvent.textColor + \";\") : \"\");\r\n\t\t\t\tstyle = ` style=\"${bg}${color}\" `;\r\n\t\t\t}\r\n\r\n\t\t\treturn `
\r\n\t
\r\n\t
${dates}
\r\n\t
${description}
\r\n
`;\r\n\t\t}\r\n\t\r\n\t\tscheduler.agenda_view=function(mode){\r\n\t\t\tif (mode){\r\n\t\t\t\tscheduler._min_date = scheduler.config.agenda_start || scheduler.date.agenda_start(scheduler._date);\r\n\t\t\t\tscheduler._max_date = scheduler.config.agenda_end || scheduler.date.add_agenda(scheduler._min_date, 1);\r\n\t\t\t\tscheduler._cols = null;\r\n\t\t\t\tscheduler._colsS = null;\r\n\t\t\t\tscheduler._table_view = true;\r\n\r\n\t\t\t\tconst dateHeader = scheduler._getNavDateElement();\r\n\t\t\t\tdateHeader.innerHTML = scheduler.templates.agenda_date(scheduler._date);\r\n\t\t\t\t//agenda tab activated\r\n\t\t\t\tfill_agenda_tab();\r\n\t\t\t} else {\r\n\t\t\t\tscheduler._table_view = false;\r\n\t\t\t\t//agenda tab de-activated\r\n\t\t\t}\r\n\t\t};\r\n\t});\r\n\r\n\t// scheduler.attachEvent(\"onEventSelected\", function(id){\r\n\t// \tconst oldSelected = scheduler.$container.querySelectorAll(\".dhx_cal_agenda_event_line_selected\");\r\n\t// \toldSelected.forEach((el) => {\r\n\t// \t\tel.classList.remove(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t});\r\n\r\n\t// \tconst selected = scheduler.$container.querySelector(`[${scheduler.config.event_attribute}=\"${id}\"]`);\r\n\t// \tif(selected){\r\n\t// \t\tselected.classList.add(\"dhx_cal_agenda_event_line_selected\");\r\n\t// \t}\r\n\t// });\r\n\t\r\n\t\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.all_timed = \"short\";\r\n\tscheduler.config.all_timed_month = false;\r\n\r\n\tvar is_event_short = function (ev) {\r\n\t\tif(!((ev.end_date - ev.start_date)/(1000*60*60) >= 24)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t// short event shouldn't disappear to multiday area during dnd-resize\r\n\t\tif(scheduler._drag_mode == \"resize\" && scheduler._drag_id == ev.id){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn \tfalse;\r\n\t};\r\n\r\n\t// copy of usual events and recurring instances;\r\n\t// regular copy causes problems with recurrings which have series event as a prototype\r\n\tscheduler._safe_copy = function(event){\r\n\t\tvar proto = null,\r\n\t\t\tcopy = scheduler._copy_event(event);\r\n\t\tif(event.event_pid){\r\n\t\t\tproto = scheduler.getEvent(event.event_pid);\r\n\t\t}\r\n\r\n\t\tif (proto && proto.isPrototypeOf(event)) {\r\n\t\t\tdelete copy.event_length;\r\n\t\t\tdelete copy.event_pid;\r\n\t\t\tdelete copy.rec_pattern;\r\n\t\t\tdelete copy.rec_type;\r\n\t\t}\r\n\r\n\t\treturn copy;\r\n\t};\r\n\r\n\tvar old_prerender_events_line = scheduler._pre_render_events_line;\r\n\tvar old_prerender_events_table = scheduler._pre_render_events_table;\r\n\r\n\tvar prerender_events = function (evs, hold) {\r\n\t\tif (!this._table_view) {\r\n\t\t\treturn old_prerender_events_line.call(this, evs, hold);\r\n\t\t}\r\n\r\n\t\treturn old_prerender_events_table.call(this, evs, hold);\r\n\t};\r\n\r\n\tscheduler._pre_render_events_line = scheduler._pre_render_events_table = function(evs, hold){\r\n\t\tif (!this.config.all_timed ||\r\n\t\t\t(this._table_view && this._mode != \"month\") ||\r\n\t\t\t(this._mode == \"month\" && !this.config.all_timed_month))\r\n\t\t\treturn prerender_events.call(this, evs, hold);\r\n\r\n\t\tfor (var i=0; i < evs.length; i++) {\r\n\t\t\tvar ev=evs[i];\r\n\r\n\t\t\tif (ev._timed)\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tif (this.config.all_timed == \"short\") {\r\n\t\t\t\tif (!is_event_short(ev)) {\r\n\t\t\t\t\tif (this._mode != \"month\") {\r\n\t\t\t\t\t\tevs.splice(i--, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar ce = this._safe_copy(ev); // current event (event for one specific day) is copy of original with modified dates\r\n\t\t\tif(!ev._virtual){\r\n\t\t\t\tce._first_chunk = true;\r\n\t\t\t}else{\r\n\t\t\t\tce._first_chunk = false;\r\n\t\t\t}\r\n\t\t\tce._drag_resize = false;\r\n\t\t\tce._virtual = true;\r\n\t\t\tce.start_date = new Date(ce.start_date); // as lame copy doesn't copy date objects\r\n\r\n\t\t\tif (!isOvernightEvent(ev)) {\r\n\t\t\t\tce.end_date = new Date(ev.end_date);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tce.end_date = getNextDay(ce.start_date);\r\n\t\t\t\tif (this.config.last_hour != 24) { // if specific last_hour was set (e.g. 20)\r\n\t\t\t\t\tce.end_date = setDateTime(ce.start_date, this.config.last_hour);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar event_changed = false;\r\n\t\t\tif (ce.start_date < this._max_date && ce.end_date > this._min_date && ce.start_date < ce.end_date) {\r\n\t\t\t\tevs[i] = ce; // adding another event in collection\r\n\t\t\t\tevent_changed = true;\r\n\t\t\t}\r\n\t\t//\tif (ce.start_date > ce.end_date) {\r\n\t\t//\t\tevs.splice(i--,1);\r\n\t\t//\t}\r\n\r\n\t\t\tvar re = this._safe_copy(ev); // remaining event, copy of original with modified start_date (making range more narrow)\r\n\t\t\tre._virtual = true;\r\n\t\t\tre.end_date = new Date(re.end_date);\r\n\t\t\tif (re.start_date < this._min_date)\r\n\t\t\t\tre.start_date = setDateTime(this._min_date, this.config.first_hour);// as we are starting only with whole hours\r\n\t\t\telse\r\n\t\t\t\tre.start_date = setDateTime(getNextDay(ev.start_date), this.config.first_hour);\r\n\r\n\t\t\tif (re.start_date < this._max_date && re.start_date < re.end_date) {\r\n\t\t\t\tif (event_changed){\r\n\t\t\t\t\tevs.splice(i+1,0,re);//insert part\r\n\t\t\t\t}else {\r\n\t\t\t\t\tevs[i--] = re;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tre._last_chunk = false;\r\n\t\t\t}else{\r\n\t\t\t\tce._last_chunk = true;\r\n\t\t\t\tce._drag_resize = true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// in case of all_timed pre_render is not applied to the original event\r\n\t\t// so we need to force redraw in case of dnd\r\n\t\tvar redraw = (this._drag_mode == 'move')?false:hold;\r\n\t\treturn prerender_events.call(this, evs, redraw);\r\n\r\n\r\n\t\tfunction isOvernightEvent(ev){\r\n\t\t\tvar next_day = getNextDay(ev.start_date);\r\n\t\t\treturn (+ev.end_date > +next_day);\r\n\t\t}\r\n\t\tfunction getNextDay(date){\r\n\t\t\tvar next_day = scheduler.date.add(date, 1, \"day\");\r\n\t\t\tnext_day = scheduler.date.date_part(next_day);\r\n\t\t\treturn next_day;\r\n\t\t}\r\n\t\tfunction setDateTime(date, hours){\r\n\t\t\tvar val = scheduler.date.date_part(new Date(date));\r\n\t\t\tval.setHours(hours);\r\n\t\t\treturn val;\r\n\t\t}\r\n\t};\r\n\tvar old_get_visible_events = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function(only_timed){\r\n\t\tif (!(this.config.all_timed && this.config.multi_day))\r\n\t\t\treturn old_get_visible_events.call(this, only_timed);\r\n\t\treturn old_get_visible_events.call(this, false); // only timed = false\r\n\t};\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (old_mode, old_date, mode, date) {\r\n\t\tscheduler._allow_dnd = (mode == \"day\" || mode == \"week\" || scheduler.getView(mode));\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler._is_main_area_event = function(ev){\r\n\t\treturn !!(ev._timed || this.config.all_timed === true || (this.config.all_timed == \"short\" && is_event_short(ev)) );\r\n\t};\r\n\r\n\tvar oldUpdate = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id){\r\n\t\t// full redraw(update_render=true) messes events order while dnd.\r\n\t\t// individual redraw(update_render=false) of multiday event, which happens on select/unselect, expands event to full width of the cell and can be fixes only with full redraw.\r\n\t\t// so for now full redraw is always enabled for not-dnd updates\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tvar fullRedrawNeeded;\r\n\t\tvar initial;\r\n\t\tif(ev) {\r\n\t\t\tfullRedrawNeeded = (scheduler.config.all_timed && !(scheduler.isOneDayEvent(scheduler._events[id]) || scheduler.getState().drag_id));\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tinitial = scheduler.config.update_render;\r\n\t\t\t\tscheduler.config.update_render = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\toldUpdate.apply(scheduler, arguments);\r\n\r\n\t\tif(ev) {\r\n\t\t\tif (fullRedrawNeeded) {\r\n\t\t\t\tscheduler.config.update_render = initial;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nvar temp_section;\r\nvar before;\r\n\r\nscheduler.config.collision_limit = 1;\r\n\r\nfunction _setTempSection(event_id) { // for custom views (matrix, timeline, units)\r\n\tvar checked_mode = scheduler._get_section_view();\r\n\tif(checked_mode && event_id){\r\n\t\ttemp_section = scheduler.getEvent(event_id)[scheduler._get_section_property()];\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tbefore = [ev.start_date, ev.end_date];\r\n\t_setTempSection(id);\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\tif (!id || !scheduler.getEvent(id)) return true;\r\n\tvar ev = scheduler.getEvent(id);\r\n\tif (!scheduler.checkCollision(ev)){\r\n\t\tif (!before) return false;\r\n\t\tev.start_date = before[0];\r\n\t\tev.end_date = before[1];\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onBeforeEventChanged\",function(ev,e,is_new){\r\n\treturn scheduler.checkCollision(ev);\r\n});\r\nscheduler.attachEvent(\"onEventAdded\",function(id,ev) {\r\n\tvar result = scheduler.checkCollision(ev);\r\n\tif (!result)\r\n\t\tscheduler.deleteEvent(id);\r\n});\r\nscheduler.attachEvent(\"onEventSave\",function(id, edited_ev, is_new){\r\n\tedited_ev = scheduler._lame_clone(edited_ev);\r\n\tedited_ev.id = id;\r\n\r\n\t//lightbox may not have 'time' section\r\n\tif(!(edited_ev.start_date && edited_ev.end_date)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tedited_ev.start_date = new Date(ev.start_date);\r\n\t\tedited_ev.end_date = new Date(ev.end_date);\r\n\t}\r\n\r\n\tif((edited_ev.rrule && !edited_ev.recurring_event_id) || edited_ev.rec_type){\r\n\t\tscheduler._roll_back_dates(edited_ev);\r\n\t}\r\n\treturn scheduler.checkCollision(edited_ev); // in case user creates event on one date but then edited it another\r\n});\r\n\r\nscheduler._check_sections_collision = function(first, second){\r\n\tvar map_to = scheduler._get_section_property();\r\n\tif (first[map_to] == second[map_to] && first.id != second.id)\r\n\t\treturn true;\r\n\treturn false;\r\n};\r\n\r\nscheduler.checkCollision = function(ev) {\r\n\tvar evs = [];\r\n\tvar collision_limit = scheduler.config.collision_limit;\r\n\r\n\tif (ev.rrule || ev.rec_type) {\r\n\t\tvar evs_dates = scheduler.getRecDates(ev);\r\n\t\tfor(var k=0; k
= collision_limit) {\r\n\r\n\t\t\tsingle = false;\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tif ( evs.length >= collision_limit )\r\n\t\t\tsingle = false;\r\n\t}\r\n\tif (!single) {\r\n\t\tvar res = !scheduler.callEvent(\"onEventCollision\",[ev,evs]);\r\n\t\tif (!res) {\r\n\t\t\tev[map_to] = temp_section||ev[map_to]; // from _setTempSection for custom views\r\n\t\t}\r\n\t\treturn res;\r\n\t}\r\n\treturn single;\r\n\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\tscheduler.config.container_autoresize = true;\r\n\tscheduler.config.month_day_min_height = 90;\r\n\tscheduler.config.min_grid_size = 25;\r\n\tscheduler.config.min_map_size = 400;\r\n\r\n\tvar old_pre_render_event = scheduler._pre_render_events;\r\n\r\n\t//need for temporary disabling without modifying public config\r\n\tvar active = true;\r\n\tvar total_height = 0;\r\n\tvar multiday_height = 0;\r\n\r\n\tscheduler._pre_render_events = function(evs, hold) {\r\n\t\tif (!(scheduler.config.container_autoresize && active)) {\r\n\t\t\treturn old_pre_render_event.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\tvar hb = this.xy.bar_height;\r\n\t\tvar h_old = this._colsS.heights;\r\n\t\tvar h = this._colsS.heights = [0, 0, 0, 0, 0, 0, 0];\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tif (!this._table_view)\r\n\t\t\tevs = this._pre_render_events_line(evs, hold); //ignore long events for now\r\n\t\telse\r\n\t\t\tevs = this._pre_render_events_table(evs, hold);\r\n\r\n\t\tif (this._table_view) {\r\n\t\t\tif (hold){\r\n\t\t\t\tthis._colsS.heights = h_old;\r\n\t\t\t} else {\r\n\t\t\t\tvar evl = data.firstChild;\r\n\t\t\t\tconst rows = evl.querySelectorAll(\".dhx_cal_month_row\");\r\n\t\t\t\tif (rows && rows.length) {\r\n\t\t\t\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\t\t\t\th[i]++;\r\n\r\n\t\t\t\t\t\tif ((h[i]) * hb > this._colsS.height - this.xy.month_head_height) { // 22 - height of cell's header\r\n\t\t\t\t\t\t\t//we have overflow, update heights\r\n\t\t\t\t\t\t\tvar cells = rows[i].querySelectorAll(\".dhx_cal_month_cell\");\r\n\r\n\t\t\t\t\t\t\tvar cHeight = this._colsS.height - this.xy.month_head_height;\r\n\t\t\t\t\t\t\tif(this.config.max_month_events*1 !== this.config.max_month_events || h[i] <= this.config.max_month_events){\r\n\t\t\t\t\t\t\t\tcHeight = h[i] * hb;\r\n\t\t\t\t\t\t\t}else if( (this.config.max_month_events + 1) * hb > this._colsS.height - this.xy.month_head_height){\r\n\t\t\t\t\t\t\t\tcHeight = (this.config.max_month_events + 1) * hb;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\trows[i].style.height = (cHeight + this.xy.month_head_height) + \"px\";\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < cells.length; j++) {\r\n\t\t\t\t\t\t\t\tcells[j].childNodes[1].style.height = cHeight + \"px\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\th[i] = (h[i - 1] || 0) + cells[0].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\th[i] = (h[i - 1] || 0) + rows[i].querySelectorAll(\".dhx_cal_month_cell\")[0].offsetHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\th.unshift(0);\r\n\t\t\t\t\tif (evl.parentNode.offsetHeight < evl.parentNode.scrollHeight && !evl._h_fix) {\r\n\t\t\t\t\t\t//we have v-scroll, decrease last day cell\r\n\r\n\t\t\t\t\t\t// NO CHECK SHOULD BE MADE ON VERTICAL SCROLL\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!evs.length && this._els[\"dhx_multi_day\"][0].style.visibility == \"visible\")\r\n\t\t\t\t\t\th[0] = -1;\r\n\t\t\t\t\tif (evs.length || h[0] == -1) {\r\n\t\t\t\t\t\t//shift days to have space for multiday events\r\n\t\t\t\t\t\t//var childs = evl.parentNode.childNodes;\r\n\t\t\t\t\t\tvar dh = ((h[0] + 1) * hb + 1); // +1 so multiday events would have 2px from top and 2px from bottom by default\r\n\t\t\t\t\t\tif(multiday_height != dh + 1) {\r\n\t\t\t\t\t\t\tthis._obj.style.height = (total_height - multiday_height + dh - 1) + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdh += \"px\";\r\n\t\t\t\t\t\tconst navHeight = this._els[\"dhx_cal_navline\"][0].offsetHeight;\r\n\t\t\t\t\t\tconst headerHeight = this._els[\"dhx_cal_header\"][0].offsetHeight;\r\n\t\t\t\t\t\tdata.style.height = (this._obj.offsetHeight - navHeight - headerHeight - (this.xy.margin_top || 0)) + 'px';\r\n\t\t\t\t\t\tvar last = this._els[\"dhx_multi_day\"][0];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\t\t\t\t\t\tlast = this._els[\"dhx_multi_day\"][1];\r\n\t\t\t\t\t\tlast.style.height = dh;\r\n\t\t\t\t\t\tlast.style.visibility = (h[0] == -1 ? \"hidden\" : \"visible\");\r\n\t\t\t\t\t\tlast.style.display = (h[0] == -1 ? \"none\" : \"\");\r\n\r\n\t\t\t\t\t\tlast.className = h[0] ? \"dhx_multi_day_icon\" : \"dhx_multi_day_icon_small\";\r\n\t\t\t\t\t\tthis._dy_shift = (h[0] + 1) * hb;\r\n\t\t\t\t\t\th[0] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn evs;\r\n\t};\r\n\r\n\tvar checked_divs = [\"dhx_cal_navline\", \"dhx_cal_header\", \"dhx_multi_day\", \"dhx_cal_data\"];\r\n\tvar updateContainterHeight = function(is_repaint) {\r\n\t\ttotal_height = 0;\r\n\t\tfor (var i = 0; i < checked_divs.length; i++) {\r\n\r\n\t\t\tvar className = checked_divs[i];\r\n\t\t\tvar checked_div = (scheduler._els[className]) ? scheduler._els[className][0] : null;\r\n\t\t\tvar height = 0;\r\n\t\t\tswitch (className) {\r\n\t\t\t\tcase \"dhx_cal_navline\":\r\n\t\t\t\tcase \"dhx_cal_header\":\r\n\t\t\t\t\theight = checked_div.offsetHeight;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_multi_day\":\r\n\t\t\t\t\theight = (checked_div) ? checked_div.offsetHeight - 1 : 0;\r\n\t\t\t\t\tmultiday_height = height;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"dhx_cal_data\":\r\n\t\t\t\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\t\t\t\tif(checked_div.childNodes[1] && mode != \"month\") {\r\n\t\t\t\t\t\tlet maxHeight = 0;\r\n\t\t\t\t\t\tfor(let i = 0; i < checked_div.childNodes.length; i++){\r\n\t\t\t\t\t\t\tif(checked_div.childNodes[i].offsetHeight > maxHeight){\r\n\t\t\t\t\t\t\t\tmaxHeight = checked_div.childNodes[i].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight = maxHeight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\theight = Math.max(checked_div.offsetHeight - 1, checked_div.scrollHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"month\") {\r\n\t\t\t\t\t\tif (scheduler.config.month_day_min_height && !is_repaint) {\r\n\t\t\t\t\t\t\tvar rows_length = checked_div.querySelectorAll(\".dhx_cal_month_row\").length;\r\n\t\t\t\t\t\t\theight = rows_length * scheduler.config.month_day_min_height;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"year\"){\r\n\t\t\t\t\t\theight = 190 * scheduler.config.year_y;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"agenda\"){\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tif(checked_div.childNodes && checked_div.childNodes.length){\r\n\t\t\t\t\t\t\tfor(var j = 0; j < checked_div.childNodes.length; j++){\r\n\t\t\t\t\t\t\t\theight += checked_div.childNodes[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif(height + 2 < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (mode == \"week_agenda\"){\r\n\t\t\t\t\t\tvar min_height = scheduler.xy.week_agenda_scale_height + scheduler.config.min_grid_size,\r\n\t\t\t\t\t\t\tcur_height;\r\n\r\n\t\t\t\t\t\tvar column;\r\n\t\t\t\t\t\tfor(var k = 0; k < checked_div.childNodes.length; k++){\r\n\t\t\t\t\t\t\tcolumn = checked_div.childNodes[k];\r\n\t\t\t\t\t\t\tfor(var j = 0; j < column.childNodes.length; j++) {\r\n\t\t\t\t\t\t\t\tvar innerHeight = 0,\r\n\t\t\t\t\t\t\t\t\teventsContainer = column.childNodes[j].childNodes[1];\r\n\r\n\t\t\t\t\t\t\t\tfor(var g =0; g < eventsContainer.childNodes.length; g++){\r\n\t\t\t\t\t\t\t\t\tinnerHeight += eventsContainer.childNodes[g].offsetHeight;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tcur_height = innerHeight + scheduler.xy.week_agenda_scale_height;\r\n\t\t\t\t\t\t\t\tcur_height = (k == 1 && (j == 2 || j == 3)) ? cur_height * 2 : cur_height; // for last two cells;\r\n\r\n\t\t\t\t\t\t\t\tif (cur_height > min_height) {\r\n\t\t\t\t\t\t\t\t\tmin_height = cur_height;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\theight = min_height * 3;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(mode == \"map\") {\r\n\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\tvar evs = checked_div.querySelectorAll(\".dhx_map_line\");\r\n\r\n\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (height + 2 < scheduler.config.min_map_size) {\r\n\t\t\t\t\t\t\theight = scheduler.config.min_map_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(scheduler._gridView) {\r\n\t\t\t\t\t\theight = 0;\r\n\r\n\t\t\t\t\t\tif (checked_div.childNodes[1].childNodes[0].childNodes && checked_div.childNodes[1].childNodes[0].childNodes.length) {\r\n\t\t\t\t\t\t\tvar evs = checked_div.childNodes[1].childNodes[0].childNodes[0].childNodes;\r\n\r\n\t\t\t\t\t\t\tfor (var j = 0; j < evs.length; j++) {\r\n\t\t\t\t\t\t\t\theight += evs[j].offsetHeight;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\theight += 2;\r\n\r\n\t\t\t\t\t\t\tif(height < scheduler.config.min_grid_size){\r\n\t\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\theight = scheduler.config.min_grid_size;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\t\t\t\tif (is_repaint) {\r\n\t\t\t\t\t\t\theight += 0;\r\n\t\t\t\t\t\t\tchecked_div.style.height = height + \"px\";\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\theight = 0;\r\n\t\t\t\t\t\t\tvar cfg = scheduler.matrix[mode];\r\n\t\t\t\t\t\t\tvar rows = cfg.y_unit;\r\n\t\t\t\t\t\t\tfor(var r=0; r < rows.length; r++){\r\n\t\t\t\t\t\t\t\theight += cfg.getSectionHeight(rows[r].key);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t// Check and add extra height to avoid events hiding by the horizontal scrollbar\r\n\t\t\t\t\t\t\tif(scheduler.$container.clientWidth != scheduler.$container.scrollWidth){\r\n\t\t\t\t\t\t\t\theight += getScrollSize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\theight -= 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (mode == \"day\" || mode == \"week\" || (scheduler._props && scheduler._props[mode])) {\r\n\t\t\t\t\t\theight += 2;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\theight += 1;\r\n\t\t\ttotal_height += height;\r\n\t\t}\r\n\t\tscheduler._obj.style.height = (total_height) + \"px\";\r\n\r\n\t\tif (!is_repaint)\r\n\t\t\tscheduler.updateView();\r\n\t};\r\n\r\n\tfunction callUpdate(){\r\n\t\tactive = false;\r\n\t\tscheduler.callEvent(\"onAfterSchedulerResize\", []);\r\n\t\tactive = true;\r\n\t}\r\n\r\n\tvar conditionalUpdateContainerHeight = function() {\r\n\t\tif(!(scheduler.config.container_autoresize && active))\r\n\t\t\treturn true;\r\n\r\n\t\tvar mode = scheduler.getState().mode;\r\n\r\n\t\tif(!mode) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tvar asyncRepaint = window.requestAnimationFrame || window.setTimeout;\r\n\t\tvar scrollTop = document.documentElement.scrollTop;\r\n\r\n\t\tasyncRepaint(function() {\r\n\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tupdateContainterHeight();\r\n\t\t});\r\n\r\n\t\tif ( (scheduler.matrix && scheduler.matrix[mode]) || mode == \"month\") {\r\n\t\t\tasyncRepaint(function() {\r\n\t\t\t\tif(scheduler.$destroyed || !scheduler.$initialized){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tupdateContainterHeight(true);\r\n\t\t\t\tdocument.documentElement.scrollTop = scrollTop;\r\n\t\t\t\tcallUpdate();\r\n\t\t\t}, 1);\r\n\t\t}else{\r\n\t\t\tcallUpdate();\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function(){\r\n\t\tvar autosizeEnabled = scheduler.config.container_autoresize;\r\n\t\tif(!scheduler.xy.$original_scroll_width){\r\n\t\t\tscheduler.xy.$original_scroll_width = scheduler.xy.scroll_width;\r\n\t\t}\r\n\r\n\t\tscheduler.xy.scroll_width = autosizeEnabled ? 0 : scheduler.xy.$original_scroll_width;\r\n\r\n\t\tif(scheduler.matrix){\r\n\t\t\tfor(var i in scheduler.matrix){\r\n\t\t\t\tvar timeline = scheduler.matrix[i];\r\n\t\t\t\tif(!timeline.$original_section_autoheight){\r\n\t\t\t\t\ttimeline.$original_section_autoheight = timeline.section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t\tif(autosizeEnabled){\r\n\t\t\t\t\ttimeline.section_autoheight = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttimeline.section_autoheight = timeline.$original_section_autoheight;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onXLE\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventChanged\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventCreated\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventAdded\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onEventDeleted\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", conditionalUpdateContainerHeight);\r\n\tscheduler.attachEvent(\"onClearAll\", conditionalUpdateContainerHeight);\r\n\r\n\t//disable container autoresize when expanded\r\n\tscheduler.attachEvent(\"onBeforeExpand\", function(){\r\n\t\tactive = false;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeCollapse\", function(){\r\n\t\tactive = true;\r\n\t\treturn true;\r\n\t});\r\n\t// helper function\r\n\tfunction getScrollSize() {\r\n\t\tvar div = document.createElement(\"div\");\r\n\t\tdiv.style.cssText = \"visibility:hidden;position:absolute;left:-1000px;width:100px;padding:0px;margin:0px;height:110px;min-height:100px;overflow-y:scroll;\";\r\n\r\n\t\tdocument.body.appendChild(div);\r\n\t\tvar size = div.offsetWidth - div.clientWidth;\r\n\t\tdocument.body.removeChild(div);\r\n\t\treturn size;\r\n\t}\r\n\r\n\r\n}","export default function(scheduler){\r\n\tfunction setCookie(name,cookie_param,value) {\r\n\t\tvar str = name + \"=\" + value + (cookie_param?(\"; \"+cookie_param):\"\");\r\n\t\tdocument.cookie = str;\r\n\t}\r\n\tfunction getCookie(name) {\r\n\t\tvar search = name + \"=\";\r\n\t\tif (document.cookie.length > 0) {\r\n\t\t\tvar offset = document.cookie.indexOf(search);\r\n\t\t\tif (offset != -1) {\r\n\t\t\t\toffset += search.length;\r\n\t\t\t\tvar end = document.cookie.indexOf(\";\", offset);\r\n\t\t\t\tif (end == -1)\r\n\t\t\t\t\tend = document.cookie.length;\r\n\t\t\t\treturn document.cookie.substring(offset, end);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}\r\n\r\n\tfunction getCookieName(scheduler) {\r\n\t\treturn (scheduler._obj.id || \"scheduler\") + \"_settings\";\r\n\t}\r\n\r\n\tvar first = true;\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(oldMode,oldDate,mode,date){\r\n\t\t// if Url plugin is enabled - explicit url values should have more priority than cookies\r\n\t\tif (first && scheduler._get_url_nav){\r\n\t\t\tvar urlNavigationPlugin = scheduler._get_url_nav();\r\n\t\t\tif(urlNavigationPlugin.date || urlNavigationPlugin.mode || urlNavigationPlugin.event){\r\n\t\t\t\tfirst = false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\r\n\t\tif (first){\r\n\t\t\tfirst = false;\r\n\t\t\tvar schedulerCookie = getCookie(cookie);\r\n\t\t\tif (schedulerCookie){\r\n\r\n\t\t\t\tif(!scheduler._min_date){\r\n\t\t\t\t\t//otherwise scheduler will have incorrect date until timeout\r\n\t\t\t\t\t//it can cause js error with 'onMouseMove' handler of key_nav.js\r\n\t\t\t\t\tscheduler._min_date = date;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tschedulerCookie = unescape(schedulerCookie).split(\"@\");\r\n\t\t\t\tschedulerCookie[0] = this._helpers.parseDate(schedulerCookie[0]);\r\n\t\t\t\tvar view = this.isViewExists(schedulerCookie[1]) ? schedulerCookie[1] : mode,\r\n\t\t\t\t\tdate = !isNaN(+schedulerCookie[0]) ? schedulerCookie[0] : date;\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tscheduler.setCurrentView(date,view);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function (newMode , newDate){\r\n\t\tvar cookie = getCookieName(scheduler);\r\n\t\tvar text = escape(this._helpers.formatDate(newDate)+\"@\"+(newMode));\r\n\t\tsetCookie(cookie,\"expires=Sun, 31 Jan 9999 22:00:00 GMT\",text);\r\n\t});\r\n\r\n\t// As we are blocking first render above there could be a problem in case of dynamic loading and rendering of visible data in general ('from'/'to' won't be defined)\r\n\tvar old_load = scheduler._load;\r\n\tscheduler._load = function() {\r\n\t\tvar args = arguments;\r\n\r\n\t\tif (!scheduler._date) {\r\n\t\t\tvar that = this;\r\n\t\t\twindow.setTimeout(function() {\r\n\t\t\t\told_load.apply(that, args);\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\told_load.apply(this, args);\r\n\t\t}\r\n\t};\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Day Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Drag Between\", scheduler.assert);\r\n}","export default function(scheduler){\r\n/* global dhtmlXCombo */\r\nscheduler.form_blocks['combo']={\r\n\trender:function(sns) {\r\n\t\tif (!sns.cached_options)\r\n\t\t\tsns.cached_options = {};\r\n\t\tvar res = '';\r\n\t\tres += \"
\";\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\t(function(){\r\n\t\t\tresetCombo();\r\n\t\t\tvar id = scheduler.attachEvent(\"onAfterLightbox\",function(){\r\n\t\t\t\t// otherwise destructor will never be called after form reset(e.g. in readonly event mode)\r\n\t\t\t\tresetCombo();\r\n\t\t\t\tscheduler.detachEvent(id);\r\n\t\t\t});\r\n\t\t\tfunction resetCombo(){\r\n\t\t\t\tif(node._combo && node._combo.DOMParent) {\r\n\t\t\t\t\tvar combo = node._combo;\r\n\t\t\t\t\tif(combo.unload){\r\n\t\t\t\t\t\tcombo.unload();\r\n\t\t\t\t\t}else if(combo.destructor){\r\n\t\t\t\t\t\tcombo.destructor();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// dhtmlxCombo 4.1.0 bug\r\n\t\t\t\t\tcombo.DOMParent = combo.DOMelem = null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t})();\r\n\t\twindow.dhx_globalImgPath = config.image_path||'/';\r\n\t\tnode._combo = new dhtmlXCombo(node, config.name, node.offsetWidth-8);\r\n\t\tif (config.onchange)\r\n\t\t\tnode._combo.attachEvent(\"onChange\", config.onchange);\r\n\r\n\t\tif (config.options_height)\r\n\t\t\tnode._combo.setOptionHeight(config.options_height);\r\n\t\tvar combo = node._combo;\r\n\t\tcombo.enableFilteringMode(config.filtering, config.script_path||null, !!config.cache);\r\n\r\n\t\tif (!config.script_path) { // script-side filtration is used\r\n\t\t\tvar all_options = [];\r\n\t\t\tfor (var i = 0; i < config.options.length; i++) {\r\n\t\t\t\tvar option = config.options[i];\r\n\t\t\t\tvar single_option = [\r\n\t\t\t\t\toption.key,\r\n\t\t\t\t\toption.label,\r\n\t\t\t\t\toption.css\r\n\t\t\t\t];\r\n\t\t\t\tall_options.push(single_option);\r\n\t\t\t}\r\n\t\t\tcombo.addOption(all_options);\r\n\t\t\tif (ev[config.map_to]) {\r\n\t\t\t\tvar index = combo.getIndexByValue(ev[config.map_to]);\r\n\t\t\t\tcombo.selectOption(index);\r\n\t\t\t}\r\n\t\t} else { // server-side filtration is used\r\n\t\t\tvar selected_id = ev[config.map_to];\r\n\t\t\tif (selected_id) {\r\n\t\t\t\tif (config.cached_options[selected_id]) {\r\n\t\t\t\t\tcombo.addOption(selected_id, config.cached_options[selected_id]);\r\n\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tscheduler.ajax.get(config.script_path+\"?id=\"+selected_id+\"&uid=\"+scheduler.uid(), function(result){\r\n\t\t\t\t\t\tvar responseText = result.xmlDoc.responseText;\r\n\t\t\t\t\t\tvar label;\r\n\t\t\t\t\t\ttry{\r\n\t\t\t\t\t\t\tvar res = JSON.parse(responseText);\r\n\t\t\t\t\t\t\tlabel = res.options[0].text;\r\n\t\t\t\t\t\t}catch(e){\r\n\t\t\t\t\t\t\tvar option = scheduler.ajax.xpath(\"//option\", result.xmlDoc)[0];\r\n\t\t\t\t\t\t\tlabel = option.childNodes[0].nodeValue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconfig.cached_options[selected_id] = label;\r\n\t\t\t\t\t\tcombo.addOption(selected_id, label);\r\n\t\t\t\t\t\tcombo.disable(1);\r\n\t\t\t\t\t\tcombo.selectOption(0);\r\n\t\t\t\t\t\tcombo.disable(0);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tcombo.setComboValue(\"\");\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config) {\r\n\t\tvar selected_id = node._combo.getSelectedValue(); // value = key\r\n\t\tif (config.script_path) {\r\n\t\t\tconfig.cached_options[selected_id] = node._combo.getSelectedText();\r\n\t\t}\r\n\t\treturn selected_id;\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\nscheduler.form_blocks['radio']={\r\n\trender:function(sns) {\r\n\t\tvar res = '';\r\n\t\tres += ``;\r\n\t\tfor (var i=0; i\"+\" \"+sns.options[i].label+\" \";\r\n\t\t}\r\n\t\tres += \"
\";\r\n\r\n\t\treturn res;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor (var i = 0; i < radiobuttons.length; i++) {\r\n\t\t\tradiobuttons[i].checked = false;\r\n\t\t\tvar checked_value = ev[config.map_to]||value;\r\n\t\t\tif (radiobuttons[i].value == checked_value) {\r\n\t\t\t\tradiobuttons[i].checked = true;\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar radiobuttons = node.getElementsByTagName('input');\r\n\t\tfor(var i=0; i ';\r\n\t\telse\r\n\t\t\treturn '';\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar id = scheduler.uid();\r\n\t\tvar isChecked = (typeof config.checked_value != \"undefined\") ? value == config.checked_value : !!value;\r\n\t\tnode.className += \" dhx_cal_checkbox\";\r\n\t\tvar check_html = \" \";\r\n\t\tvar label_html = \"\"+(scheduler.locale.labels[\"section_\"+config.name]||config.name)+\" \";\r\n\t\tif (scheduler.config.wide_form){\r\n\t\t\tnode.innerHTML = label_html;\r\n\t\t\tnode.nextSibling.innerHTML=check_html;\r\n\t\t} else\r\n\t\t\tnode.innerHTML=check_html+label_html;\r\n\r\n\t\tif (config.handler) {\r\n\t\t\tvar checkbox = node.getElementsByTagName('input')[0];\r\n\t\t\tif(checkbox.$_eventAttached){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tcheckbox.$_eventAttached = true;\r\n\t\t\tscheduler.event(checkbox, \"click\", config.handler);\r\n\t\t\t//checkbox.onclick = config.handler;\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tnode=scheduler._lightbox.querySelector(`#${config.id}`);\r\n\t\tvar checkbox = node.getElementsByTagName('input')[0]; // moved to the header\r\n\t\tif (!checkbox)\r\n\t\t\tcheckbox = node.nextSibling.getElementsByTagName('input')[0];\r\n\t\treturn (checkbox.checked)?(config.checked_value||true):(config.unchecked_value||false);\r\n\t},\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.ext.fullscreen = {\r\n\ttoggleIcon: null\r\n};\r\n\r\nscheduler.expand = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeExpand\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt._position = t.style.position || \"\";\r\n\t\tt.style.position = \"static\";\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.position = \"absolute\";\r\n\tt._width = t.style.width;\r\n\tt._height = t.style.height;\r\n\tt.style.width = t.style.height = \"100%\";\r\n\tt.style.top = t.style.left = \"0px\";\r\n\r\n\tvar top = document.body;\r\n\ttop.scrollTop = 0;\r\n\r\n\ttop = top.parentNode;\r\n\tif (top)\r\n\t\ttop.scrollTop = 0;\r\n\tdocument.body._overflow = document.body.style.overflow || \"\";\r\n\tdocument.body.style.overflow = \"hidden\";\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onExpand\", []);\r\n};\r\nscheduler.collapse = function() {\r\n\tif(!scheduler.callEvent(\"onBeforeCollapse\", []))\r\n\t\treturn;\r\n\tvar t = scheduler._obj;\r\n\tdo {\r\n\t\tt.style.position = t._position;\r\n\t} while ((t = t.parentNode) && t.style);\r\n\tt = scheduler._obj;\r\n\tt.style.width = t._width;\r\n\tt.style.height = t._height;\r\n\tdocument.body.style.overflow = document.body._overflow;\r\n\tscheduler._maximize();\r\n\tscheduler.callEvent(\"onCollapse\", []);\r\n};\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar t = document.createElement(\"div\");\r\n\tt.className = \"dhx_expand_icon\";\r\n\tscheduler.ext.fullscreen.toggleIcon = t;\r\n\tt.innerHTML = `\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t \r\n\t \r\n\t`;\r\n\tscheduler._obj.appendChild(t);\r\n\tscheduler.event(t, \"click\", function() {\r\n\t\tif (!scheduler.expanded)\r\n\t\t\tscheduler.expand(); else\r\n\t\t\tscheduler.collapse();\r\n\t});\r\n});\r\nscheduler._maximize = function() {\r\n\tthis.expanded = !this.expanded;\r\n\tif(this.expanded){\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.add(\"dhx_expand_icon--expanded\");\r\n\t\t\r\n\t}else{\r\n\t\tthis.ext.fullscreen.toggleIcon.classList.remove(\"dhx_expand_icon--expanded\");\r\n\t}\r\n\t\r\n\t//scheduler.ext.fullscreen.toggleIcon.style.backgroundPosition = \"0 \" + (this.expanded ? \"0\" : \"18\") + \"px\";\r\n\r\n\tvar directions = ['left', 'top'];\r\n\tfor (var i = 0; i < directions.length; i++) {\r\n\t\t//var margin = scheduler.xy['margin_' + directions[i]];\r\n\t\tvar prev_margin = scheduler['_prev_margin_' + directions[i]];\r\n\t\tif (scheduler.xy['margin_' + directions[i]]) {\r\n\t\t\tscheduler['_prev_margin_' + directions[i]] = scheduler.xy['margin_' + directions[i]];\r\n\t\t\tscheduler.xy['margin_' + directions[i]] = 0;\r\n\t\t} else {\r\n\t\t\tif (prev_margin) {\r\n\t\t\t\tscheduler.xy['margin_' + directions[i]] = scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t\tdelete scheduler['_prev_margin_' + directions[i]];\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.setCurrentView();\r\n};\r\n\r\n\r\n}\r\n","export default function(scheduler){\r\n\r\n\r\n(function(){\r\n\r\nfunction defaults(obj, std){\r\n\tfor (var key in std)\r\n\t\tif (!obj[key])\r\n\t\t\tobj[key] = std[key];\r\n\treturn obj;\r\n}\r\n\r\nfunction getElementSizes(element, scheduler) {\r\n\tvar sizes = {};\r\n\telement = scheduler._els[element];\r\n\tif (element && element[0]) {\r\n\t\tsizes.x = element[0].scrollWidth;\r\n\t\tsizes.y = element[0].scrollHeight;\r\n\t} else {\r\n\t\tsizes.x = 0;\r\n\t\tsizes.y = 0;\r\n\t}\r\n\treturn sizes;\r\n}\r\n\r\n//compatibility for new versions of scheduler\r\nif(!window.dhtmlxAjax){\r\n\twindow.dhtmlxAjax = {\r\n\t\tpost: function(url, data, callback){\r\n\t\t\treturn window.dhx4.ajax.post(url, data, callback);\r\n\t\t},\r\n\t\tget: function(url, callback){\r\n\t\t\treturn window.ajax.get(url, callback);\r\n\t\t}\r\n\t};\r\n}\r\n\r\nfunction add_export_methods(scheduler){\r\n\r\n\tscheduler.exportToPDF = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.pdf\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"pdf\");\r\n\t};\r\n\r\n\tscheduler.exportToPNG = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.png\",\r\n\t\t\tformat:\"A4\",\r\n\t\t\torientation:\"landscape\",\r\n\t\t\tdpi:96,\r\n\t\t\tzoom:1,\r\n\t\t\trtl: scheduler.config.rtl\r\n\t\t});\r\n\t\tconfig.html = this._export_html(config);\r\n\t\tconfig.mode = this.getState().mode;\r\n\t\tthis._send_to_export(config, \"png\");\r\n\t};\r\n\r\n\tscheduler.exportToICal = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.ical\",\r\n\t\t\tdata:this._serialize_plain(null, config)\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"ical\");\r\n\t};\r\n\r\n\tscheduler.exportToExcel = function(config){\r\n\t\tconfig = defaults((config || {}), {\r\n\t\t\tname:\"calendar.xlsx\",\r\n\t\t\ttitle:\"Events\",\r\n\t\t\tdata:this._serialize_plain( this.templates.xml_format, config),\r\n\t\t\tcolumns:this._serialize_columns()\r\n\t\t});\r\n\t\tthis._send_to_export(config, \"excel\");\r\n\t};\r\n\r\n\tscheduler._ajax_to_export = function(data, type, callback){\r\n\t\tdelete data.callback;\r\n\t\tvar url = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\r\n\t\twindow.dhtmlxAjax.post(url,\r\n\t\t\t\"type=\"+type+\"&store=1&data=\"+encodeURIComponent(JSON.stringify(data)),\r\n\t\t\tfunction(loader){\r\n\t\t\t\tvar fail = loader.xmlDoc.status > 400;\r\n\t\t\t\tvar info = null;\r\n\r\n\t\t\t\tif (!fail){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tinfo = JSON.parse(loader.xmlDoc.responseText);\r\n\t\t\t\t\t}catch(e){}\r\n\t\t\t\t}\r\n\t\t\t\tcallback(info);\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\tscheduler._plain_export_copy = function(source, format){\r\n\t\tvar target = {};\r\n\t\tfor (var key in source)\r\n\t\t\ttarget[key] = source[key];\r\n\r\n\t\ttarget.start_date = format(target.start_date);\r\n\t\ttarget.end_date = format(target.end_date);\r\n\t\ttarget.$text = this.templates.event_text(source.start_date, source.end_date, source);\r\n\r\n\t\treturn target;\r\n\t};\r\n\r\n\tscheduler._serialize_plain = function(format, config){\r\n\t\tformat = format || scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\", true);\r\n\r\n\t\tvar events;\r\n\t\tif (config && config.start && config.end)\r\n\t\t\tevents = scheduler.getEvents(config.start, config.end);\r\n\t\telse\r\n\t\t\tevents = scheduler.getEvents();\r\n\r\n\t\tvar data = [];\r\n\t\tfor (var i = 0; i< events.length; i++)\r\n\t\t\tdata[i] = this._plain_export_copy(events[i], format);\r\n\r\n\t\treturn data;\r\n\t};\r\n\r\n\tscheduler._serialize_columns = function(){\r\n\t\treturn [\r\n\t\t\t{ id:\"start_date\", header:\"Start Date\", width:30 },\r\n\t\t\t{ id:\"end_date\", header:\"End Date\", width:30 },\r\n\t\t\t{ id:\"$text\", header:\"Text\", width:100 }\r\n\t\t];\r\n\t};\r\n\r\n\tscheduler._send_to_export = function(data, type){\r\n\t\tif(!data.version){\r\n\t\t\tdata.version = scheduler.version;\r\n\t\t}\r\n\r\n\t\tif(!data.skin){\r\n\t\t\tdata.skin = scheduler.skin;\r\n\t\t}\r\n\r\n\t\tif (data.callback)\r\n\t\t\t\treturn scheduler._ajax_to_export(data, type, data.callback);\r\n\r\n\t\tvar form = this._create_hidden_form();\r\n\r\n\t\tform.firstChild.action = data.server || \"https://export.dhtmlx.com/scheduler\";\r\n\t\tform.firstChild.childNodes[0].value = JSON.stringify(data);\r\n\t\tform.firstChild.childNodes[1].value = type;\r\n\t\tform.firstChild.submit();\r\n\t};\r\n\r\n\tscheduler._create_hidden_form = function(){\r\n\t\tif (!this._hidden_export_form){\r\n\t\t\tvar t = this._hidden_export_form = document.createElement(\"div\");\r\n\t\t\tt.style.display = \"none\";\r\n\t\t\tt.innerHTML = \"\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t}\r\n\t\treturn this._hidden_export_form;\r\n\t};\r\n\r\n\tscheduler._get_export_size = function(format, orientation, zoom, dpi, header, footer, scales) {\r\n\r\n\t\tdpi = parseInt(dpi)/25.4 || 4;\r\n\r\n\t\tvar sizes = {\r\n\t\t\t\"A5\":{ x:148, y:210 },\r\n\t\t\t\"A4\":{ x:210, y:297 },\r\n\t\t\t\"A3\":{ x:297, y:420 },\r\n\t\t\t\"A2\":{ x:420, y:594 },\r\n\t\t\t\"A1\":{ x:594, y:841 },\r\n\t\t\t\"A0\":{ x:841, y:1189 }\r\n\t\t};\r\n\r\n\t\tvar dataX = getElementSizes(\"dhx_cal_data\", this).x;\r\n\t\tvar dataY = getElementSizes(\"dhx_cal_data\", this).y;\r\n\t\tvar headY = getElementSizes(\"dhx_cal_header\", this).y;\r\n\t\tvar multY = getElementSizes(\"dhx_multi_day\", this).y;\r\n\r\n\t\tvar cSize = {\r\n\t\t\ty: dataY + headY + multY\r\n\t\t};\r\n\r\n\t\tif (format === \"full\") {\r\n\t\t\tcSize.x = dataX;\r\n\t\t} else {\r\n\t\t\tcSize.x = Math.floor( (orientation === \"landscape\" ? sizes[format].y : sizes[format].x) * dpi );\r\n\t\t}\r\n\r\n\t\tif (scales) {\r\n\t\t\tcSize.x *= (parseFloat(scales.x) || 1);\r\n\t\t\tcSize.y *= (parseFloat(scales.y) || 1);\r\n\t\t}\r\n\r\n\t\treturn cSize;\r\n\t};\r\n\r\n\tfunction getTimeline() {\r\n\t\tvar mode = scheduler.getState().mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[mode]) {\r\n\t\t\treturn scheduler.matrix[mode];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tfunction getInitialSizes() {\r\n\t\tvar smartRendering = undefined,\r\n\t\t\tscrollable = undefined;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (timeline) {\r\n\t\t\tscrollable = timeline.scrollable;\r\n\t\t\tsmartRendering = timeline.smart_rendering;\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tnav_height: scheduler.xy.nav_height,\r\n\t\t\tscroll_width: scheduler.xy.scroll_width,\r\n\t\t\tstyle_width: scheduler._obj.style.width,\r\n\t\t\tstyle_height: scheduler._obj.style.height,\r\n\t\t\ttimeline_scrollable: scrollable,\r\n\t\t\ttimeline_smart_rendering: smartRendering\r\n\t\t};\r\n\t}\r\n\r\n\tfunction setExportSizes(size, initialSizes) {\r\n\t\tscheduler._obj.style.width = size.x + \"px\";\r\n\t\tscheduler._obj.style.height = size.y + \"px\";\r\n\r\n\t\tscheduler.xy.nav_height = 0;\r\n\t\tscheduler.xy.scroll_width = 0;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\r\n\t\t\ttimeline.scrollable = false;\r\n\t\t\ttimeline.smart_rendering = false;\r\n\t\t}\r\n\t}\r\n\r\n\tfunction setInitialSizes(initialSizes) {\r\n\t\tscheduler.xy.scroll_width = initialSizes.scroll_width;\r\n\t\tscheduler.xy.nav_height = initialSizes.nav_height;\r\n\t\tscheduler._obj.style.width = initialSizes.style_width;\r\n\t\tscheduler._obj.style.height = initialSizes.style_height;\r\n\r\n\t\tvar timeline = getTimeline();\r\n\t\tif (initialSizes.timeline_scrollable || initialSizes.timeline_smart_rendering) {\r\n\t\t\ttimeline.scrollable = initialSizes.timeline_scrollable;\r\n\t\t\ttimeline.smart_rendering = initialSizes.timeline_smart_rendering;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler._export_html = function (obj) {\r\n\t\tvar initialSizes = getInitialSizes();\r\n\t\tvar size = scheduler._get_export_size(obj.format, obj.orientation, obj.zoom, obj.dpi, obj.header, obj.footer, obj.scales);\r\n\r\n\t\tvar html = \"\";\r\n\t\ttry {\r\n\t\t\tsetExportSizes(size, initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t\thtml = scheduler._obj.innerHTML;\r\n\t\t} catch (e) {\r\n\r\n\t\t\t// eslint-disable-next-line no-console\r\n\t\t\tconsole.error(e);\r\n\t\t} finally {\r\n\t\t\tsetInitialSizes(initialSizes);\r\n\t\t\tscheduler.setCurrentView();\r\n\t\t}\r\n\r\n\t\treturn html;\r\n\t};\r\n\r\n}\r\n\r\nadd_export_methods(scheduler);\r\n\r\n\r\n})();\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Grid\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tvar els = document.body.getElementsByTagName(\"DIV\");\r\n\tfor (var i=0; i < els.length; i++) {\r\n\t\tvar cs = els[i].className||\"\";\r\n\t\tcs = cs.split(\":\");\r\n\t\tif (cs.length == 2 && cs[0] == \"template\"){\r\n\t\t\tvar code = \"return \\\"\"+(els[i].innerHTML||\"\").replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g,\"\\\\\\\"\").replace(/[\\n\\r]+/g,\"\")+\"\\\";\";\r\n\t\t\tcode = unescape(code).replace(/\\{event\\.([a-z]+)\\}/g,function(all,mask){\r\n\t\t\t\treturn '\"+ev.'+mask+'+\"';\r\n\t\t\t});\r\n\t\t\tscheduler.templates[cs[1]]=Function(\"start\",\"end\",\"ev\",code);\r\n\t\t\tels[i].style.display='none';\r\n\t\t}\r\n\t}\r\n});\r\n\r\n}","import keyboard_shortcuts from \"./keyboard_navigation/common/keyboard_shortcuts\";\r\nimport eventhandler from \"./keyboard_navigation/common/eventhandler\";\r\nimport trap_modal_focus from \"./keyboard_navigation/common/trap_modal_focus\";\r\nimport marker from \"./keyboard_navigation/marker\";\r\nimport scheduler_node from \"./keyboard_navigation/elements/scheduler_node\";\r\nimport nav_node from \"./keyboard_navigation/elements/nav_node\";\r\nimport header_cell from \"./keyboard_navigation/elements/header_cell\";\r\nimport event from \"./keyboard_navigation/elements/event\";\r\nimport time_slot from \"./keyboard_navigation/elements/time_slot\";\r\nimport minical_button from \"./keyboard_navigation/elements/minical_button\";\r\nimport minical_cell from \"./keyboard_navigation/elements/minical_cell\";\r\nimport data_area from \"./keyboard_navigation/elements/data_area\";\r\nimport modals from \"./keyboard_navigation/modals\";\r\nimport core from \"./keyboard_navigation/core\";\r\nimport key_nav_legacy from \"./keyboard_navigation/key_nav_legacy\";\r\n\r\n\r\nimport scheduler_handlers from \"./keyboard_navigation/scheduler_handlers\";\r\nimport minical_handlers from \"./keyboard_navigation/minical_handlers\";\r\n\r\nexport default function(scheduler){\r\n\t\tscheduler.config.key_nav = true;\r\n\t\tscheduler.config.key_nav_step = 30;\r\n\t\tscheduler.addShortcut = function(shortcut, handler, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.bind(shortcut, handler);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.getShortcutHandler = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tvar commands = scheduler.$keyboardNavigation.shortcuts.parse(shortcut);\r\n\t\t\t\tif(commands.length){\r\n\t\t\t\t\treturn scopeObject.prototype.findHandler(commands[0]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.removeShortcut = function(shortcut, scope){\r\n\t\t\tvar scopeObject = getScope(scope);\r\n\t\t\tif(scopeObject){\r\n\t\t\t\tscopeObject.prototype.unbind(shortcut);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tscheduler.focus = function(){\r\n\t\t\tif(!scheduler.config.key_nav){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tvar disp = scheduler.$keyboardNavigation.dispatcher;\r\n\t\t\tdisp.enable();\r\n\t\t\tvar activeNode = disp.getActiveNode();\r\n\t\t\tif(!activeNode || activeNode instanceof scheduler.$keyboardNavigation.MinicalButton || activeNode instanceof scheduler.$keyboardNavigation.MinicalCell){\r\n\t\t\t\tdisp.setDefaultNode();\r\n\t\t\t}else{\r\n\t\t\t\tdisp.focusNode(disp.getActiveNode());\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction getScope(mode){\r\n\t\t\tvar scopes = {\r\n\t\t\t\t\"minicalButton\":scheduler.$keyboardNavigation.MinicalButton,\r\n\t\t\t\t\"minicalDate\":scheduler.$keyboardNavigation.MinicalCell,\r\n\t\t\t\t\"scheduler\":scheduler.$keyboardNavigation.SchedulerNode,\r\n\t\t\t\t\"dataArea\": scheduler.$keyboardNavigation.DataArea,\r\n\t\t\t\t\"timeSlot\": scheduler.$keyboardNavigation.TimeSlot,\r\n\t\t\t\t\"event\": scheduler.$keyboardNavigation.Event\r\n\t\t\t};\r\n\r\n\t\t\tvar searchMap = {};\r\n\t\t\tfor(var i in scopes)\r\n\t\t\t\tsearchMap[i.toLowerCase()] = scopes[i];\r\n\r\n\t\t\tmode = (mode + \"\").toLowerCase();\r\n\r\n\t\t\treturn searchMap[mode] || scopes.scheduler;\r\n\t\t}\r\n\r\n\t\tscheduler.$keyboardNavigation = {};\r\n\r\n\t\tscheduler._compose = function(){\r\n\t\t\tvar parts = Array.prototype.slice.call(arguments, 0);\r\n\t\t\tvar res = {};\r\n\t\t\tfor(var i = 0; i < parts.length; i++){\r\n\t\t\t\tvar obj = parts[i];\r\n\t\t\t\tif(typeof obj == \"function\"){\r\n\t\t\t\t\tobj = new obj();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor(var p in obj){\r\n\t\t\t\t\tres[p] = obj[p];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\t\t};\r\n\r\n\t\tkeyboard_shortcuts(scheduler);\r\n\t\teventhandler(scheduler);\r\n\t\ttrap_modal_focus(scheduler);\r\n\t\tmarker(scheduler);\r\n\t\tscheduler_node(scheduler);\r\n\t\tnav_node(scheduler);\r\n\t\theader_cell(scheduler);\r\n\t\tevent(scheduler);\r\n\t\ttime_slot(scheduler);\r\n\t\tminical_button(scheduler);\r\n\t\tminical_cell(scheduler);\r\n\t\tdata_area(scheduler);\r\n\t\tmodals(scheduler);\r\n\t\tcore(scheduler);\r\n\t\tkey_nav_legacy(scheduler);\r\n\r\n\t\t(function(){\r\n\t\t\tscheduler_handlers(scheduler);\r\n\t\t\tminical_handlers(scheduler);\r\n\r\n\t\t\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\t\t\tscheduler.$keyboardNavigation.attachSchedulerHandlers();\r\n\r\n\t\t\tif(scheduler.renderCalendar){\r\n\t\t\t\t// if minical ext loaded before key nav ext - patch it now\r\n\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t}else{\r\n\t\t\t\t// otherwise - wait until everything is loaded and try again\r\n\t\t\t\tvar attachOnce = scheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\t\t\t\t\tscheduler.detachEvent(attachOnce);\r\n\t\t\t\t\tscheduler.$keyboardNavigation.patchMinicalendar();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction isSchedulerSelected(){\r\n\t\t\t\tif(!scheduler.config.key_nav) return;\r\n\r\n\t\t\t\tvar enable;\r\n\t\t\t\tvar focusElement = document.activeElement;\r\n\t\t\t\t// halt key nav when focus is outside scheduler or in quick info popup\r\n\t\t\t\tif(!focusElement || scheduler.utils.dom.locateCss(focusElement, \"dhx_cal_quick_info\", false)){\r\n\t\t\t\t\tenable = false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tenable = scheduler.$keyboardNavigation.isChildOf(focusElement, scheduler.$container) || scheduler.$keyboardNavigation.isMinical(focusElement);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn enable;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\tfunction changeState(enable){\r\n\t\t\t\tif(enable && !dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tdispatcher.disable();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tconst intervalId = setInterval(function(){\r\n\t\t\t\tif(!scheduler.$container || !scheduler.$keyboardNavigation.isChildOf(scheduler.$container, document.body)){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar enable = isSchedulerSelected();\r\n\r\n\t\t\t\tif(enable){\r\n\t\t\t\t\tchangeState(enable);\r\n\t\t\t\t}else if(!enable && dispatcher.isEnabled()){\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// doublecheck in case checking is done in handler before focus element is repainted\r\n\t\t\t\t\t\tif(scheduler.config.key_nav){\r\n\t\t\t\t\t\t\tchangeState(isSchedulerSelected());\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t}\r\n\t\t\t}, 500);\r\n\t\t\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\t\t\tclearInterval(intervalId);\r\n\t\t\t});\r\n\t\t})();\r\n\t}\r\n\r\n\r\n","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.shortcuts = {\r\n\tcreateCommand: function(){\r\n\t\treturn {\r\n\t\t\tmodifiers:{\r\n\t\t\t\t\"shift\": false,\r\n\t\t\t\t\"alt\": false,\r\n\t\t\t\t\"ctrl\": false,\r\n\t\t\t\t\"meta\": false\r\n\t\t\t},\r\n\t\t\tkeyCode: null\r\n\t\t};\r\n\t},\r\n\tparse: function(shortcut){\r\n\t\tvar commands = [];\r\n\r\n\t\tvar expr = this.getExpressions(this.trim(shortcut));\r\n\t\tfor(var i = 0; i < expr.length; i++){\r\n\t\t\tvar words = this.getWords(expr[i]);\r\n\r\n\t\t\tvar command = this.createCommand();\r\n\r\n\t\t\tfor(var j = 0; j < words.length; j++){\r\n\t\t\t\tif(this.commandKeys[words[j]]){\r\n\t\t\t\t\tcommand.modifiers[words[j]] = true;\r\n\t\t\t\t}else if(this.specialKeys[words[j]]){\r\n\t\t\t\t\tcommand.keyCode = this.specialKeys[words[j]];\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcommand.keyCode = words[j].charCodeAt(0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tcommands.push(command);\r\n\t\t}\r\n\t\treturn commands;\r\n\t},\r\n\r\n\tgetCommandFromEvent: function(domEvent){\r\n\t\tvar command = this.createCommand();\r\n\t\tcommand.modifiers.shift = !!domEvent.shiftKey;\r\n\t\tcommand.modifiers.alt = !!domEvent.altKey;\r\n\t\tcommand.modifiers.ctrl = !!domEvent.ctrlKey;\r\n\t\tcommand.modifiers.meta = !!domEvent.metaKey;\r\n\t\tcommand.keyCode = domEvent.which || domEvent.keyCode;\r\n\r\n\t\tif(command.keyCode >= 96 && command.keyCode <= 105){\r\n\t\t\t// numpad keys 96-105 -> 48-57\r\n\t\t\tcommand.keyCode -= 48;//convert numpad number code to regular number code\r\n\t\t}\r\n\r\n\t\tvar printableKey = String.fromCharCode(command.keyCode );\r\n\t\tif(printableKey){\r\n\t\t\tcommand.keyCode = printableKey.toLowerCase().charCodeAt(0);\r\n\t\t}\r\n\t\treturn command;\r\n\t},\r\n\r\n\tgetHashFromEvent: function(domEvent){\r\n\t\treturn this.getHash(this.getCommandFromEvent(domEvent));\r\n\t},\r\n\r\n\tgetHash: function(command){\r\n\t\tvar parts = [];\r\n\t\tfor(var i in command.modifiers){\r\n\t\t\tif(command.modifiers[i]){\r\n\t\t\t\tparts.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\tparts.push(command.keyCode);\r\n\r\n\t\treturn parts.join(this.junctionChar);\r\n\t},\r\n\r\n\tgetExpressions: function(shortcut){\r\n\t\treturn shortcut.split(this.junctionChar);\r\n\t},\r\n\tgetWords: function(term){\r\n\t\treturn term.split(this.combinationChar);\r\n\t},\r\n\ttrim: function(shortcut){\r\n\t\treturn shortcut.replace(/\\s/g, \"\");\r\n\t},\r\n\tjunctionChar:\",\",\r\n\tcombinationChar:\"+\",\r\n\tcommandKeys:{\r\n\t\t\"shift\": 16,\r\n\t\t\"alt\": 18,\r\n\t\t\"ctrl\": 17,\r\n\t\t\"meta\": true\r\n\t},\r\n\tspecialKeys:{\r\n\t\t\"backspace\": 8,\r\n\t\t\"tab\": 9,\r\n\t\t\"enter\": 13,\r\n\t\t\"esc\": 27,\r\n\t\t\"space\": 32,\r\n\t\t\"up\": 38,\r\n\t\t\"down\": 40,\r\n\t\t\"left\": 37,\r\n\t\t\"right\": 39,\r\n\t\t\"home\": 36,\r\n\t\t\"end\": 35,\r\n\t\t\"pageup\": 33,\r\n\t\t\"pagedown\": 34,\r\n\t\t\"delete\": 46,\r\n\t\t\"insert\": 45,\r\n\t\t\"plus\":107,\r\n\t\t\"f1\": 112,\r\n\t\t\"f2\": 113,\r\n\t\t\"f3\": 114,\r\n\t\t\"f4\": 115,\r\n\t\t\"f5\": 116,\r\n\t\t\"f6\": 117,\r\n\t\t\"f7\": 118,\r\n\t\t\"f8\": 119,\r\n\t\t\"f9\": 120,\r\n\t\t\"f10\": 121,\r\n\t\t\"f11\": 122,\r\n\t\t\"f12\": 123\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.EventHandler = {\r\n\t_handlers: null,\r\n\tfindHandler: function(command){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\t\tvar hash = shortcuts.getHash(command);\r\n\r\n\t\treturn this._handlers[hash];\r\n\t},\r\n\r\n\tdoAction: function(command, e){\r\n\t\tvar handler = this.findHandler(command);\r\n\t\tif(handler){\r\n\t\t\thandler.call(this, e);\r\n\r\n\t\t\tif (e.preventDefault) e.preventDefault();\r\n\t\t\telse e.returnValue = false;\r\n\r\n\t\t}\r\n\t},\r\n\tbind: function(shortcut, handler){\r\n\t\tif(!this._handlers) this._handlers = {};\r\n\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tthis._handlers[shortcuts.getHash(commands[i])] = handler;\r\n\t\t}\r\n\t},\r\n\tunbind: function(shortcut){\r\n\t\tvar shortcuts = scheduler.$keyboardNavigation.shortcuts;\r\n\r\n\t\tvar commands = shortcuts.parse(shortcut);\r\n\t\tfor(var i = 0; i < commands.length; i++){\r\n\t\t\tif(this._handlers[shortcuts.getHash(commands[i])]){\r\n\t\t\t\tdelete this._handlers[shortcuts.getHash(commands[i])];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tbindAll: function(map){\r\n\t\tfor(var i in map){\r\n\t\t\tthis.bind(i, map[i]);\r\n\t\t}\r\n\t},\r\n\tinitKeys: function(){\r\n\t\tif(!this._handlers)\r\n\t\t\tthis._handlers = {};\r\n\t\tif(this.keys){\r\n\t\t\tthis.bindAll(this.keys);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n(function(){\r\n\tscheduler.$keyboardNavigation.getFocusableNodes = scheduler._getFocusableNodes;\r\n\r\n\tscheduler.$keyboardNavigation.trapFocus = function trapFocus(root, e){\r\n\t\tif(e.keyCode != 9) return false;\r\n\r\n\t\tvar focusable = scheduler.$keyboardNavigation.getFocusableNodes(root);\r\n\t\tvar currentFocus = document.activeElement;\r\n\t\tvar currentIndex = -1;\r\n\t\tfor(var i = 0; i < focusable.length; i++){\r\n\t\t\tif(focusable[i] == currentFocus){\r\n\t\t\t\tcurrentIndex = i;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar nextIndex, nextItem;\r\n\t\tif(e.shiftKey){\r\n\r\n\t\t\t// back tab\r\n\t\t\t// go to the last element if we focused on the first\r\n\t\t\tnextIndex = (currentIndex <= 0) ? (focusable.length - 1) : (currentIndex - 1);\r\n\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\t// forward tab\r\n\t\t\t// forward tab from last element should go back to the first element\r\n\t\t\tnextIndex = (currentIndex >= focusable.length - 1) ? 0 : (currentIndex + 1);\r\n\t\t\tnextItem = focusable[nextIndex];\r\n\t\t\tif(nextItem){\r\n\t\t\t\tnextItem.focus();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n})();\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.marker = {\r\n\tclear: function(){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_focus_slot\");\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].parentNode.removeChild(divs[i]);\r\n\t\t}\r\n\t},\r\n\tcreateElement: function(){\r\n\t\tvar element = document.createElement(\"div\");\r\n\t\telement.setAttribute(\"tabindex\", -1);\r\n\t\telement.className = \"dhx_focus_slot\";\r\n\t\treturn element;\r\n\t},\r\n\r\n\trenderMultiple: function(start, end, method){\r\n\t\tvar divs = [];\r\n\t\tvar currentStart = new Date(start);\r\n\t\tvar currentEnd = new Date(Math.min(end.valueOf(), scheduler.date.add(scheduler.date.day_start(new Date(start)), 1, \"day\").valueOf()));\r\n\t\twhile(currentStart.valueOf() < end.valueOf()){\r\n\r\n\t\t\tdivs = divs.concat(method.call(this, currentStart, new Date(Math.min(currentEnd.valueOf(), end.valueOf()))));\r\n\t\t\tcurrentStart = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\r\n\t\t\tcurrentEnd = scheduler.date.day_start(scheduler.date.add(currentStart, 1, \"day\"));\r\n\t\t\tcurrentEnd = new Date(Math.min(currentEnd.valueOf(), end.valueOf()));\r\n\t\t}\r\n\r\n\t\treturn divs;\r\n\t},\r\n\r\n\r\n\trender: function(start, end, section){\r\n\t\tthis.clear();\r\n\t\tvar divs = [];\r\n\r\n\t\tvar modes = scheduler.$keyboardNavigation.TimeSlot.prototype._modes;\r\n\t\tvar view = scheduler.$keyboardNavigation.TimeSlot.prototype._getMode();\r\n\t\tswitch (view){\r\n\t\t\tcase modes.units:\r\n\t\t\t\tdivs = this.renderVerticalMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.timeline:\r\n\t\t\t\tdivs = this.renderTimelineMarker(start, end, section);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.year:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderYearMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.month:\r\n\t\t\t\tdivs = this.renderMonthMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.weekAgenda:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderWeekAgendaMarker));\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.list:\r\n\t\t\t\tdivs = this.renderAgendaMarker(start, end);\r\n\t\t\t\tbreak;\r\n\t\t\tcase modes.dayColumns:\r\n\t\t\t\tdivs = divs.concat(this.renderMultiple(start, end, this.renderVerticalMarker));\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tthis.addWaiAriaLabel(divs, start, end, section);\r\n\t\tthis.addDataAttributes(divs, start, end, section);\r\n\r\n\t\tfor(var i = divs.length - 1; i >= 0; i--){\r\n\t\t\tif(divs[i].offsetWidth){\r\n\t\t\t\treturn divs[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t},\r\n\r\n\taddDataAttributes: function(divs, start, end, section){\r\n\t\tvar dateToStr = scheduler.date.date_to_str(scheduler.config.api_date);\r\n\r\n\t\tvar from = dateToStr(start),\r\n\t\t\tto = dateToStr(end);\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tdivs[i].setAttribute(\"data-start-date\", from);\r\n\t\t\tdivs[i].setAttribute(\"data-end-date\", to);\r\n\t\t\tif(section){\r\n\t\t\t\tdivs[i].setAttribute(\"data-section\", section);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\taddWaiAriaLabel: function(divs, start, end, section){\r\n\t\tvar label = \"\";\r\n\t\tvar state = scheduler.getState();\r\n\t\tvar mode = state.mode;\r\n\r\n\t\tvar dateTimeLabel = false;\r\n\r\n\t\tlabel += scheduler.templates.day_date(start);\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != start.valueOf())){\r\n\t\t\tlabel += \" \" + scheduler.templates.hour_scale(start);\r\n\t\t\tdateTimeLabel = true;\r\n\t\t}\r\n\r\n\t\tif((scheduler.date.day_start(new Date(start)).valueOf() != scheduler.date.day_start(new Date(end)).valueOf())){\r\n\r\n\t\t\tlabel += \" - \" + scheduler.templates.day_date(end);\r\n\t\t\tif(dateTimeLabel || (scheduler.date.day_start(new Date(end)).valueOf() != end.valueOf())){\r\n\t\t\t\tlabel += \" \" + scheduler.templates.hour_scale(end);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(section){\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tconst timeline = scheduler.matrix[mode];\r\n\t\t\t\tconst sectionObject = timeline.y_unit[timeline.order[section]];\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_label\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tconst units = scheduler._props[mode];\r\n\t\t\t\tconst sectionObject = units.options[units.order[section]];\r\n\r\n\t\t\t\tlabel += \", \" + scheduler.templates[mode + \"_scale_text\"](sectionObject.key, sectionObject.label, sectionObject);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tscheduler._waiAria.setAttributes(divs[i], {\r\n\t\t\t\t\"aria-label\": label,\r\n\t\t\t\t\"aria-live\": \"polite\"\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\r\n\trenderWeekAgendaMarker: function(start_date, end_date){\r\n\t\tvar divs = scheduler.$container.querySelectorAll(\".dhx_wa_day_cont .dhx_wa_scale_bar\");\r\n\r\n\t\tvar currDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(start_date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(index != -1) return this._wrapDiv(divs[index]);\r\n\t\treturn [];\r\n\t},\r\n\r\n\t_wrapDiv: function(cell){\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = cell.offsetTop + \"px\";\r\n\t\tmarker.style.left = cell.offsetLeft + \"px\";\r\n\t\tmarker.style.width = cell.offsetWidth + \"px\";\r\n\t\tmarker.style.height = cell.offsetHeight + \"px\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\trenderYearMarker: function(start_date, end_date){\r\n\t\tvar cell = scheduler._get_year_cell(start_date);\r\n\t\tcell.style.position = \"relative\";\r\n\t\tvar marker = this.createElement();\r\n\t\tmarker.style.top = \"0px\";\r\n\t\tmarker.style.left = \"0px\";\r\n\t\tmarker.style.width = \"100%\";\r\n\t\tmarker.style.height = \"100%\";\r\n\t\tcell.appendChild(marker);\r\n\t\treturn [marker];\r\n\t},\r\n\r\n\trenderAgendaMarker: function(start_date, end_date){\r\n\t\tvar block = this.createElement();\r\n\t\tblock.style.height = \"1px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tblock.style.opacity = 1;\r\n\t\tblock.style.top = \"0px\";\r\n\t\tblock.style.left = \"0px\";\r\n\t\tscheduler.$container.querySelector(\".dhx_cal_data\").appendChild(block);\r\n\t\treturn [block];\r\n\t},\r\n\r\n\trenderTimelineMarker: function(start_date, end_date, section){\r\n\t\tvar view_opts = scheduler._lame_copy({}, scheduler.matrix[scheduler._mode]);\r\n\t\tvar areas = view_opts._scales;\r\n\t\t//timespans must always use actual position, not rounded\r\n\t\tview_opts.round_position = false;\r\n\t\tvar blocks = [];\r\n\r\n\t\tvar min_date = start_date ? new Date(start_date) : scheduler._min_date;\r\n\t\tvar max_date = end_date ? new Date(end_date) : scheduler._max_date;\r\n\r\n\t\tif(min_date.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\tmin_date = new Date(scheduler._min_date);\r\n\t\tif(max_date.valueOf() > scheduler._max_date.valueOf())\r\n\t\t\tmax_date = new Date(scheduler._max_date);\r\n\r\n\t\tif(!view_opts._trace_x) return blocks;\r\n\r\n\t\tfor(var i = 0; i < view_opts._trace_x.length; i++){\r\n\t\t\tif(scheduler._is_column_visible(view_opts._trace_x[i]))\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(i == view_opts._trace_x.length)\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar area = areas[section];\r\n\r\n\t\tif (!(min_date < end_date && max_date > start_date))\r\n\t\t\treturn blocks;\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\tlet start_pos;\r\n\t\tlet end_pos;\r\n\r\n\t\tfunction set_date_part(source, target) {\r\n\t\t\t// reset to start of the month in order to prevent month change when target is on 31th day, and source month has only 30 days\r\n\t\t\ttarget.setDate(1);\r\n\r\n\t\t\ttarget.setFullYear(source.getFullYear());\r\n\t\t\ttarget.setMonth(source.getMonth());\r\n\t\t\ttarget.setDate(source.getDate());\r\n\t\t}\r\n\r\n\t\tif(!scheduler.getView().days){\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: start_date}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: end_date}, false, view_opts);\r\n\t\t}else{\r\n\t\t\t// daytimeline\r\n\t\t\tconst tempStart = new Date(start_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempStart);\r\n\t\t\tconst tempEnd = new Date(end_date);\r\n\t\t\tset_date_part(scheduler._min_date, tempEnd);\r\n\t\t\tstart_pos = scheduler._timeline_getX({start_date: tempStart}, false, view_opts);\r\n\t\t\tend_pos = scheduler._timeline_getX({start_date: tempEnd}, false, view_opts);\r\n\t\t}\r\n\r\n\t\tvar height = ((view_opts._section_height[section]-1) || (view_opts.dy - 1));\r\n\r\n\t\tvar top = 0;\r\n\t\tif (scheduler._isRender('cell')){\r\n\t\t\ttop = area.offsetTop;\r\n\t\t\tstart_pos += view_opts.dx;\r\n\t\t\tend_pos += view_opts.dx;\r\n\t\t\tarea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}else{\r\n\r\n\t\t}\r\n\t\tvar width = Math.max(1, end_pos - start_pos - 1);\r\n\t\tlet direction = \"left\";\r\n\t\tif(scheduler.config.rtl){\r\n\t\t\tdirection = \"right\";\r\n\t\t}\r\n\t\tblock.style.cssText = `height:${height}px; ${direction}:${start_pos}px; width:${width}px; top:${top}px;`;\r\n\r\n\t\tif(area){\r\n\t\t\tarea.appendChild(block);\r\n\t\t\tblocks.push(block);\r\n\t\t}\r\n\r\n\t\treturn blocks;\r\n\t},\r\n\r\n\trenderMonthCell: function(date){\r\n\t\tvar cells = scheduler.$container.querySelectorAll(\".dhx_month_head\");\r\n\r\n\t\tvar divs = [];\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tdivs.push(cells[i].parentNode);\r\n\t\t}\r\n\r\n\t\tvar firstDate = scheduler.date.week_start(new Date(scheduler.getState().min_date));\r\n\r\n\t\tvar index = -1;\r\n\t\tvar weekNumber = 0;\r\n\t\tvar dayIndex = -1;\r\n\t\tvar currDate = firstDate;\r\n\t\tvar markerDate = scheduler.date.day_start(new Date(date));\r\n\t\tfor(var i = 0; i < divs.length; i++){\r\n\t\t\tindex++;\r\n\r\n\t\t\tif(dayIndex == 6){\r\n\t\t\t\tweekNumber++;\r\n\t\t\t\tdayIndex = 0;\r\n\t\t\t}else{\r\n\t\t\t\tdayIndex++;\r\n\t\t\t}\r\n\r\n\t\t\tif(scheduler.date.day_start(new Date(currDate)).valueOf() == markerDate.valueOf()){\r\n\t\t\t\tbreak;\r\n\t\t\t}else{\r\n\t\t\t\tcurrDate = scheduler.date.add(currDate, 1, \"day\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(index == -1){\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar left = scheduler._colsS[dayIndex];\r\n\t\tvar top = scheduler._colsS.heights[weekNumber];\r\n\r\n\t\tvar div = this.createElement();\r\n\t\tdiv.style.top = top + \"px\";\r\n\t\tdiv.style.left = left + \"px\";\r\n\t\tdiv.style.width = scheduler._cols[dayIndex] + \"px\";\r\n\t\tdiv.style.height = ((scheduler._colsS.heights[weekNumber + 1] - top) || scheduler._colsS.height) + \"px\" ;\r\n\r\n\r\n\t\tvar container = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\r\n\t\tvar datatable = container.querySelector(\".dhx_cal_month_table\");\r\n\t\tif(datatable.nextSibling){\r\n\t\t\tcontainer.insertBefore(div, datatable.nextSibling);\r\n\t\t}else{\r\n\t\t\tcontainer.appendChild(div);\r\n\t\t}\r\n\t\treturn div;\r\n\t},\r\n\trenderMonthMarker: function(start_date, end_date){\r\n\t\tvar res = [];\r\n\t\tvar currentDate = start_date;\r\n\t\twhile(currentDate.valueOf() < end_date.valueOf()){\r\n\t\t\tres.push(this.renderMonthCell(currentDate));\r\n\t\t\tcurrentDate = scheduler.date.add(currentDate, 1, \"day\");\r\n\t\t}\r\n\t\treturn res;\r\n\t},\r\n\r\n\trenderVerticalMarker: function(start_date, end_date, section){\r\n\t\tvar index = scheduler.locate_holder_day(start_date);\r\n\r\n\t\tvar divs = [];\r\n\t\tvar area = null;\r\n\r\n\t\tvar c = scheduler.config;\r\n\t\tif(scheduler._ignores[index]) return divs;\r\n\r\n\t\tif (scheduler._props && scheduler._props[scheduler._mode] && section) {\r\n\t\t\tvar view = scheduler._props[scheduler._mode];\r\n\t\t\tindex = view.order[section];\r\n\r\n\t\t\tvar inner_index = view.order[section];\r\n\t\t\tif(!(view.days > 1)){\r\n\t\t\t\tindex = inner_index;\r\n\t\t\t\tif (view.size && (index > view.position+view.size)) {\r\n\t\t\t\t\tindex = 0;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//var units_l = view.size || view.options.length;\r\n\r\n\t\t\t\tindex = scheduler.locate_holder_day(start_date) + inner_index;\r\n\t\t\t\t//index = index*units_l + inner_index;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarea = scheduler.locate_holder(index);\r\n\t\tif(!area || area.querySelector(\".dhx_scale_hour\")){\r\n\t\t\t// hour scale instead of date column\r\n\t\t\treturn document.createElement(\"div\");\r\n\t\t}\r\n\r\n\t\tvar start = Math.max((start_date.getHours()*60 + start_date.getMinutes()), c.first_hour*60);\r\n\r\n\r\n\t\tvar end = Math.min((end_date.getHours()*60 + end_date.getMinutes()), c.last_hour*60);\r\n\t\tif(!end && (scheduler.date.day_start(new Date(end_date)).valueOf() > scheduler.date.day_start(new Date(start_date)).valueOf())){\r\n\t\t\tend = c.last_hour*60;\r\n\t\t}\r\n\r\n\t\tif (end <= start) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tvar block = this.createElement();\r\n\r\n\t\t// +1 for working with section which really takes up whole height (as % would be == 0)\r\n\t\tvar all_hours_height = scheduler.config.hour_size_px*c.last_hour + 1;\r\n\t\tvar hour_ms = 60*60*1000;\r\n\t\tblock.style.top = (Math.round((start*60*1000-scheduler.config.first_hour*hour_ms)*scheduler.config.hour_size_px/hour_ms) % all_hours_height) + \"px\";\r\n\t\tblock.style.lineHeight = block.style.height = Math.max((Math.round(((end-start)*60*1000)*scheduler.config.hour_size_px/hour_ms)) % all_hours_height, 1)+\"px\";\r\n\t\tblock.style.width = \"100%\";\r\n\t\tarea.appendChild(block);\r\n\t\tdivs.push(block);\r\n\t\treturn divs[0];\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tgetDefaultNode: function(){\r\n\t\t\tvar node = new scheduler.$keyboardNavigation.TimeSlot();\r\n\r\n\t\t\tif(!node.isValid()){\r\n\t\t\t\tnode = node.fallback();\r\n\t\t\t}\r\n\t\t\treturn node;\r\n\t\t},\r\n\r\n\t\t_modes:{\r\n\t\t\tmonth: \"month\",\r\n\t\t\tyear: \"year\",\r\n\t\t\tdayColumns: \"dayColumns\",\r\n\t\t\ttimeline:\"timeline\",\r\n\t\t\tunits:\"units\",\r\n\t\t\tweekAgenda: \"weekAgenda\",\r\n\t\t\tlist: \"list\"\r\n\t\t},\r\n\t\tgetMode: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar mode = state.mode;\r\n\t\t\tif((scheduler.matrix && scheduler.matrix[mode])){\r\n\t\t\t\treturn this._modes.timeline;\r\n\t\t\t} else if((scheduler._props && scheduler._props[mode])){\r\n\t\t\t\treturn this._modes.units;\r\n\t\t\t}else if(mode == \"month\"){\r\n\t\t\t\treturn this._modes.month;\r\n\t\t\t}else if(mode == \"year\"){\r\n\t\t\t\treturn this._modes.year;\r\n\t\t\t}else if(mode == \"week_agenda\"){\r\n\t\t\t\treturn this._modes.weekAgenda;\r\n\t\t\t}else if(mode == \"map\" || mode == \"agenda\" || (scheduler._grid && scheduler[\"grid_\" + mode])){\r\n\t\t\t\treturn this._modes.list;\r\n\t\t\t}else{\r\n\t\t\t\treturn this._modes.dayColumns;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.focus();\r\n\t\t},\r\n\r\n\t\tblur: function(){\r\n\r\n\t\t},\r\n\r\n\t\tdisable: function(){\r\n\t\t\tscheduler.$container.setAttribute(\"tabindex\", \"0\");\r\n\t\t},\r\n\t\tenable: function(){\r\n\t\t\tif(scheduler.$container)\r\n\t\t\t\tscheduler.$container.removeAttribute(\"tabindex\");\r\n\t\t},\r\n\t\tisEnabled: function(){\r\n\t\t\treturn scheduler.$container.hasAttribute(\"tabindex\");\r\n\t\t},\r\n\r\n\r\n\t\t_compareEvents: function(a, b){\r\n\t\t\tif (a.start_date.valueOf() == b.start_date.valueOf())\r\n\t\t\t\treturn a.id > b.id ? 1 : -1;\r\n\t\t\treturn a.start_date.valueOf() > b.start_date.valueOf() ? 1 : -1;\r\n\t\t},\r\n\r\n\t\t_pickEvent: function(from, to, startId, reverse){\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tfrom = new Date(Math.max(range.min_date.valueOf(), from.valueOf()));\r\n\t\t\tto = new Date(Math.min(range.max_date.valueOf(), to.valueOf()));\r\n\r\n\t\t\tvar evs = scheduler.getEvents(from, to);\r\n\t\t\tevs.sort(this._compareEvents);\r\n\t\t\tif(reverse){\r\n\t\t\t\tevs = evs.reverse();\r\n\t\t\t}\r\n\r\n\t\t\tvar trim = !!startId;\r\n\t\t\tfor(var i =0; i < evs.length && trim; i++){\r\n\t\t\t\tif(evs[i].id == startId){\r\n\t\t\t\t\ttrim = false;\r\n\t\t\t\t}\r\n\t\t\t\tevs.splice(i, 1);\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\r\n\t\t\tfor(var i = 0; i < evs.length; i++){\r\n\t\t\t\tvar eventElement = new scheduler.$keyboardNavigation.Event(evs[i].id);\r\n\t\t\t\tif(eventElement.getNode())\r\n\t\t\t\t\treturn evs[i];\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tnextEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tcurrEvent.start_date,\r\n\t\t\t\t\tscheduler.date.add(currEvent.start_date, 1, \"year\"),\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tvisibleDates.min_date,\r\n\t\t\t\t\tscheduler.date.add(visibleDates.min_date, 1, \"year\"),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tfalse\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.nextEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tprevEventHandler: function(id){\r\n\t\t\tvar activeNode = scheduler.$keyboardNavigation.dispatcher.activeNode;\r\n\r\n\t\t\tvar startId = id || (activeNode && activeNode.eventId);\r\n\r\n\t\t\tvar nextEvent = null;\r\n\t\t\tif(startId && scheduler.getEvent(startId)){\r\n\t\t\t\tvar currEvent = scheduler.getEvent(startId);\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(currEvent.end_date, -1, \"year\"),\r\n\t\t\t\t\tcurrEvent.end_date,\r\n\t\t\t\t\tcurrEvent.id,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t\tif(!nextEvent && !id){\r\n\t\t\t\tvar visibleDates = scheduler.getState();\r\n\r\n\t\t\t\tnextEvent = scheduler.$keyboardNavigation.SchedulerNode.prototype._pickEvent(\r\n\t\t\t\t\tscheduler.date.add(visibleDates.max_date, -1, \"year\"),\r\n\t\t\t\t\tvisibleDates.max_date,\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\ttrue\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tif(nextEvent){\r\n\t\t\t\tvar nextEv = new scheduler.$keyboardNavigation.Event(nextEvent.id);\r\n\t\t\t\tif(!nextEv.isValid()){// not visible event\r\n\t\t\t\t\tthis.prevEventHandler(nextEvent.id);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(activeNode){activeNode.blur();}\r\n\t\t\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(nextEv);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\r\n\t\t\t\"alt+1, alt+2, alt+3, alt+4, alt+5, alt+6, alt+7, alt+8, alt+9\": function(e){\r\n\t\t\t\tvar tabs = scheduler.$keyboardNavigation.HeaderCell.prototype.getNodes(\".dhx_cal_navline .dhx_cal_tab\");\r\n\t\t\t\tvar key = e.key;\r\n\t\t\t\tif(key === undefined){\r\n\t\t\t\t\tkey = e.keyCode - 48;\r\n\t\t\t\t}\r\n\t\t\t\tif(tabs[key*1 - 1]){\r\n\t\t\t\t\ttabs[key*1 - 1].click();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+left,meta+left\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_prev_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+right,meta+right\": function(e){\r\n\t\t\t\tscheduler._click.dhx_cal_next_button();\r\n\t\t\t},\r\n\t\t\t\"ctrl+up,meta+up\":function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop -= 20;\r\n\t\t\t},\r\n\t\t\t\"ctrl+down,meta+down\": function(e){\r\n\t\t\t\tvar dataArea = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\tdataArea.scrollTop += 20;\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"e\": function(){\r\n\t\t\t\tthis.nextEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"home\": function(){\r\n\t\t\t\tscheduler.setCurrentView(new Date());\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+e\": function(){\r\n\t\t\t\tthis.prevEventHandler();\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+enter,meta+enter\": function(){\r\n\t\t\t\tscheduler.addEventNow({start_date: new Date(scheduler.getState().date)});\r\n\t\t\t},\r\n\r\n\t\t\t\"ctrl+c,meta+c\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+v,meta+v\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t},\r\n\t\t\t\"ctrl+x,meta+x\": function(e){\r\n\t\t\t\tscheduler._key_nav_copy_paste(e);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.SchedulerNode.prototype.bindAll(scheduler.$keyboardNavigation.SchedulerNode.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode = function(){};\r\n\r\nscheduler.$keyboardNavigation.KeyNavNode.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.EventHandler,\r\n\t{\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\treturn null;\r\n\t\t},\r\n\r\n\t\tmoveTo: function (element) {\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.setActiveNode(element);\r\n\t\t},\r\n\r\n\t\tcompareTo: function(b){\r\n\t\t\t// good enough comparison of two random objects\r\n\t\t\tif(!b) return false;\r\n\t\t\tfor(var i in this){\r\n\t\t\t\tif(!!this[i] != !!b[i]) return false;\r\n\r\n\t\t\t\tvar canStringifyThis = !!(this[i] && this[i].toString);\r\n\t\t\t\tvar canStringifyThat = !!(b[i] && b[i].toString);\r\n\t\t\t\tif(canStringifyThat != canStringifyThis) return false;\r\n\t\t\t\tif(!(canStringifyThat && canStringifyThis)) {\r\n\t\t\t\t\tif(b[i] != this[i]) return false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(b[i].toString() != this[i].toString())\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){},\r\n\t\tfocus: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className += \" scheduler_focused\";\r\n\t\t\t\tif(node.focus) node.focus();\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif(node){\r\n\t\t\t\tnode.setAttribute(\"tabindex\", \"-1\");\r\n\t\t\t\t//node.className = (node.className || \"\").replace(/ ?scheduler_focused/g, \"\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.HeaderCell = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\tindex = index || this.index || 0;\r\n\t\t\tvar nodes = this.getNodes();\r\n\t\t\tif(nodes[index]) return nodes[index];\r\n\t\t},\r\n\r\n\t\tgetNodes: function(selector){\r\n\t\t\tselector = selector || [\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_prev_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_next_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_today_button\",\r\n\t\t\t\t\t\".dhx_cal_navline .dhx_cal_tab\"\r\n\t\t\t\t].join(\", \");\r\n\r\n\t\t\tvar nodes = Array.prototype.slice.call(scheduler.$container.querySelectorAll(selector));\r\n\t\t\tnodes.sort(function(a, b){\r\n\t\t\t\treturn a.offsetLeft - b.offsetLeft;\r\n\t\t\t});\r\n\t\t\treturn nodes;\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn !!this.getNode(this.index);\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\tvar defaultCell = this.getNode(0);\r\n\t\t\tif(!defaultCell){\r\n\t\t\t\tdefaultCell = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}\r\n\t\t\treturn defaultCell;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tvar newIndex = this.index - 1;\r\n\t\t\t\tif(newIndex < 0){\r\n\t\t\t\t\tnewIndex = this.getNodes().length - 1;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tvar newIndex = this.index + 1;\r\n\t\t\t\tif(newIndex >= this.getNodes().length){\r\n\t\t\t\t\tnewIndex = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.HeaderCell(newIndex));\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t},\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.HeaderCell.prototype.bindAll(scheduler.$keyboardNavigation.HeaderCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.Event = function(id){\r\n\tthis.eventId = null;\r\n\tif(scheduler.getEvent(id)){\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tthis.start = new Date(ev.start_date);\r\n\t\tthis.end = new Date(ev.end_date);\r\n\r\n\t\tthis.section = this._getSection(ev);\r\n\t\tthis.eventId = id;\r\n\t}\r\n};\r\n\r\nscheduler.$keyboardNavigation.Event.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_getNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\"[\"+scheduler.config.event_attribute+\"]\"));\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\tgetMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\t_handlers: null,\r\n\t\tisValid: function(){\r\n\t\t\treturn !!(scheduler.getEvent(this.eventId) && this.getNode());\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar eventNode = this._getNodes()[0];\r\n\t\t\tvar defaultElement = null;\r\n\t\t\tif(!eventNode || !(scheduler._locate_event(eventNode))){\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t}else{\r\n\t\t\t\tvar id = scheduler._locate_event(eventNode);\r\n\t\t\t\tdefaultElement = new scheduler.$keyboardNavigation.Event(id);\r\n\t\t\t}\r\n\r\n\t\t\treturn defaultElement;\r\n\t\t},\r\n\r\n\t\tisScrolledIntoView: function (el) {\r\n\t\t\tvar eventBox = el.getBoundingClientRect();\r\n\t\t\tvar viewPort = scheduler.$container.querySelector(\".dhx_cal_data\").getBoundingClientRect();\r\n\t\t\t\r\n\t\t\tif(eventBox.bottom < viewPort.top || eventBox.top > viewPort.bottom){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t},\r\n\r\n\t\tgetNode: function(){\r\n\r\n\t\t\tvar idSelector = \"[\"+scheduler.config.event_attribute+\"='\"+this.eventId+\"']\";\r\n\r\n\t\t\tvar inlineEditor = scheduler.$keyboardNavigation.dispatcher.getInlineEditor(this.eventId);\r\n\t\t\tif(inlineEditor){// is inline editor visible\r\n\t\t\t\treturn inlineEditor;\r\n\t\t\t}else{\r\n\t\t\t\tif(scheduler.isMultisectionEvent && scheduler.isMultisectionEvent(scheduler.getEvent(this.eventId))){\r\n\t\t\t\t\tvar nodes = scheduler.$container.querySelectorAll(idSelector);\r\n\t\t\t\t\tfor(var i = 0; i < nodes.length; i++){\r\n\t\t\t\t\t\tif(this.isScrolledIntoView(nodes[i])){\r\n\t\t\t\t\t\t\treturn nodes[i];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn nodes[0];\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn scheduler.$container.querySelector(idSelector);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tvar event = scheduler.getEvent(this.eventId);\r\n\r\n\t\t\tvar calendar = scheduler.getState();\r\n\t\t\tif(event.start_date.valueOf() > calendar.max_date.valueOf() || event.end_date.valueOf() <= calendar.min_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(event.start_date);\r\n\t\t\t}\r\n\r\n\t\t\tvar node = this.getNode();\r\n\t\t\tif (this.isScrolledIntoView(node)) {\r\n\t\t\t\tscheduler.$keyboardNavigation.dispatcher.keepScrollPosition((function(){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t\t}).bind(this));\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\r\n\r\n\t\t_getSection: function(ev){\r\n\t\t\tvar section = null;\r\n\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\tsection = ev[timeline.y_property];\r\n\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\tsection = ev[unit.map_to];\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\t\t_moveToSlot: function(dir){\r\n\t\t\tvar ev = scheduler.getEvent(this.eventId);\r\n\t\t\tif(ev){\r\n\t\t\t\tvar section =this._getSection(ev);\r\n\t\t\t\tvar slot = new scheduler.$keyboardNavigation.TimeSlot(ev.start_date, null, section);\r\n\t\t\t\tthis.moveTo(slot.nextSlot(slot, dir));\r\n\t\t\t}else{\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis._moveToSlot(\"left\");\r\n\t\t\t},\r\n\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis._moveToSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"down\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"space\": function(){\r\n\t\t\t\tvar node = this.getNode();\r\n\t\t\t\tif(node && node.click){\r\n\t\t\t\t\tnode.click();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tif(this.getMode() == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else {\r\n\t\t\t\t\tthis._moveToSlot(\"up\");\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t\"delete\": function(){\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler._click.buttons[\"delete\"](this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// open lightbox\r\n\t\t\t\"enter\": function () {\r\n\t\t\t\tif(scheduler.getEvent(this.eventId)) {\r\n\t\t\t\t\tscheduler.showLightbox(this.eventId);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\nscheduler.$keyboardNavigation.Event.prototype.bindAll(scheduler.$keyboardNavigation.Event.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.TimeSlot = function(from, to, section, movingDate){\r\n\tvar state = scheduler.getState();\r\n\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\r\n\tif(!from){\r\n\t\tfrom = this.getDefaultDate();\r\n\t}\r\n\r\n\tif(!to){\r\n\r\n\t\tif(timeline){\r\n\t\t\tto = scheduler.date.add(from, timeline.x_step, timeline.x_unit);\r\n\t\t}else{\r\n\t\t\tto = scheduler.date.add(from, scheduler.config.key_nav_step, \"minute\");\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tthis.section = section || this._getDefaultSection();\r\n\tthis.start_date = new Date(from);\r\n\tthis.end_date = new Date(to);\r\n\tthis.movingDate = movingDate || null;\r\n};\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\t_handlers:null,\r\n\r\n\t\tgetDefaultDate: function(){\r\n\t\t\tvar from;\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar visibleTime = new Date(state.date);\r\n\t\t\tvisibleTime.setSeconds(0);\r\n\t\t\tvisibleTime.setMilliseconds(0);\r\n\r\n\t\t\tvar nowTime = new Date();\r\n\t\t\tnowTime.setSeconds(0);\r\n\t\t\tnowTime.setMilliseconds(0);\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[state.mode];\r\n\t\t\tvar showNowTime = false;\r\n\t\t\tif(visibleTime.valueOf() === nowTime.valueOf()){\r\n\t\t\t\tshowNowTime = true;\r\n\t\t\t}\r\n\r\n\t\t\tif(timeline){\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tif(timeline.x_unit === \"day\"){\r\n\t\t\t\t\t\tnowTime.setHours(0);\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}else if(timeline.x_unit === \"hour\"){\r\n\t\t\t\t\t\tnowTime.setMinutes(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfrom = scheduler.date[timeline.name + \"_start\"](new Date(state.date));\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t}else{\r\n\t\t\t\tfrom = new Date(scheduler.getState().min_date);\r\n\t\t\t\tif(showNowTime){\r\n\t\t\t\t\tfrom = nowTime;\r\n\t\t\t\t}\r\n\t\t\t\tfrom = this.findVisibleColumn(from);\r\n\t\t\t\tif(!showNowTime){\r\n\t\t\t\t\tfrom.setHours(scheduler.config.first_hour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!scheduler._table_view){\r\n\t\t\t\t\tvar dataContainer = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t\t\t\tif(dataContainer.scrollTop){\r\n\t\t\t\t\t\tfrom.setHours(scheduler.config.first_hour + Math.ceil(dataContainer.scrollTop / scheduler.config.hour_size_px));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn from;\r\n\t\t},\r\n\r\n\t\tclone: function(timeslot){\r\n\t\t\treturn new scheduler.$keyboardNavigation.TimeSlot(timeslot.start_date, timeslot.end_date, timeslot.section, timeslot.movingDate);\r\n\t\t},\r\n\t\t_getMultisectionView: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view;\r\n\t\t\tif(scheduler._props && scheduler._props[state.mode]) {\r\n\t\t\t\tview = scheduler._props[state.mode];\r\n\t\t\t}else if(scheduler.matrix && scheduler.matrix[state.mode]){\r\n\t\t\t\tview = scheduler.matrix[state.mode];\r\n\t\t\t}\r\n\t\t\treturn view;\r\n\t\t},\r\n\r\n\t\t_getDefaultSection: function(){\r\n\t\t\tvar section = null;\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tif(view && !section){\r\n\t\t\t\tsection = this._getNextSection();\r\n\t\t\t}\r\n\t\t\treturn section;\r\n\t\t},\r\n\r\n\t\t_getNextSection: function(sectionId, dir){\r\n\t\t\tvar view = this._getMultisectionView();\r\n\t\t\tvar currentIndex = view.order[sectionId];\r\n\t\t\tvar nextIndex = currentIndex;\r\n\t\t\tif(currentIndex !== undefined){\r\n\t\t\t\tnextIndex = currentIndex + dir;\r\n\t\t\t}else{\r\n\t\t\t\tnextIndex = (view.size && view.position) ? view.position : 0;\r\n\t\t\t}\r\n\r\n\t\t\tif(nextIndex < 0){\r\n\t\t\t\tnextIndex = 0;\r\n\t\t\t}\r\n\t\t\tvar options = view.options || view.y_unit;\r\n\r\n\t\t\tif(nextIndex >= options.length){\r\n\t\t\t\tnextIndex = options.length - 1;\r\n\t\t\t}\r\n\t\t\t//nextIndex = nextIndex < 0 ? nextIndex = (view.options || view.y_unit).length -1 : nextIndex;\r\n\r\n\t\t\tif(options[nextIndex]){\r\n\t\t\t\treturn options[nextIndex].key;\r\n\t\t\t}else{\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar isInRange = !(this.start_date.valueOf() < state.min_date.valueOf() || this.start_date.valueOf() >= state.max_date.valueOf());\r\n\r\n\t\t\tif(!isInRange) return false;\r\n\r\n\r\n\t\t\tif(!this.isVisible(this.start_date, this.end_date)) return false;\r\n\r\n\t\t\tvar view = this._getMultisectionView();\r\n\r\n\t\t\tif(view){\r\n\t\t\t\treturn (view.order[this.section] !== undefined);\r\n\t\t\t}else{\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tfallback:function(){\r\n\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(!defaultSlot.isValid()){\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}else{\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetNodes: function(){\r\n\t\t\treturn Array.prototype.slice.call(scheduler.$container.querySelectorAll(\".dhx_focus_slot\"));\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this.getNodes()[0];\r\n\t\t},\r\n\r\n\t\tfocus: function(){\r\n\t\t\tif(this.section && scheduler.getView() && scheduler.getView().smart_rendering && scheduler.getView().scrollTo && !scheduler.$container.querySelector(`[data-section-id=\"${this.section}\"]`)){\r\n\t\t\t\tscheduler.getView().scrollTo({section: this.section});\r\n\t\t\t}\r\n\t\t\tscheduler.$keyboardNavigation.marker.render(this.start_date, this.end_date, this.section);\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation._pasteDate = this.start_date;\r\n\t\t\tscheduler.$keyboardNavigation._pasteSection = this.section;\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t\tscheduler.$keyboardNavigation.marker.clear();\r\n\t\t},\r\n\r\n\t\t_modes: scheduler.$keyboardNavigation.SchedulerNode.prototype._modes,\r\n\r\n\t\t_getMode: scheduler.$keyboardNavigation.SchedulerNode.prototype.getMode,\r\n\r\n\t\taddMonthDate: function(date, dir, extend){\r\n\t\t\tvar res;\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tres = scheduler.date.add(date, -1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tres = scheduler.date.add(date, 1, \"week\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, -1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tres = scheduler.date.day_start(scheduler.date.add(date, 1, \"day\"));\r\n\t\t\t\t\tres = this.findVisibleColumn(res, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tres = scheduler.date.day_start(new Date(date));\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tif(date.valueOf() < state.min_date.valueOf() || (!extend && date.valueOf() >= state.max_date.valueOf())){\r\n\t\t\t\tres = new Date(state.min_date);\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t},\r\n\r\n\t\tnextMonthSlot: function(slot, dir, extend){\r\n\r\n\t\t\tvar start, end;\r\n\t\t\tstart = this.addMonthDate(slot.start_date, dir, extend);\r\n\r\n\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\r\n\t\t_alignTimeSlot: function(date, minDate, unit, step){\r\n\t\t\tvar currentDate = new Date(minDate);\r\n\t\t\twhile(currentDate.valueOf() < date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, step, unit);\r\n\t\t\t}\r\n\r\n\t\t\tif(currentDate.valueOf() > date.valueOf()){\r\n\t\t\t\tcurrentDate = scheduler.date.add(currentDate, -step, unit);\r\n\t\t\t}\r\n\r\n\t\t\treturn currentDate;\r\n\t\t},\r\n\r\n\t\tnextTimelineSlot: function(slot, dir, extend){\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler.matrix[state.mode];\r\n\r\n\t\t\tvar startDate = this._alignTimeSlot(slot.start_date, scheduler.date[view.name + \"_start\"](new Date(slot.start_date)), view.x_unit, view.x_step);\r\n\t\t\tvar endDate = this._alignTimeSlot(slot.end_date, scheduler.date[view.name + \"_start\"](new Date(slot.end_date)), view.x_unit, view.x_step);\r\n\r\n\t\t\tif(endDate.valueOf() <= startDate.valueOf()){\r\n\t\t\t\tendDate = scheduler.date.add(startDate, view.x_step, view.x_unit);\r\n\t\t\t}\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.start_date = startDate;\r\n\t\t\tnewPos.end_date = endDate;\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tnewPos.section = this._getNextSection(slot.section, +1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, -view.x_step, view.x_unit), -1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tnewPos.start_date = this.findVisibleColumn(scheduler.date.add(newPos.start_date, view.x_step, view.x_unit), 1);\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(newPos.start_date.valueOf() < state.min_date.valueOf() || newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tif(extend && newPos.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\t\tnewPos.start_date = new Date(state.max_date);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnewPos.start_date = scheduler.date[state.mode + \"_start\"](scheduler.date.add(state.date, dir == \"left\" ? -1 : 1, state.mode));\r\n\t\t\t\t\tnewPos.end_date = scheduler.date.add(newPos.start_date, view.x_step, view.x_unit);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\tnextUnitsSlot: function(slot, dir, extend){\r\n\t\t\tvar newPos = this.clone(slot);\r\n\t\t\tnewPos.section = slot.section || this._getNextSection();\r\n\r\n\t\t\tvar section = slot.section || this._getNextSection();\r\n\t\t\tvar state = scheduler.getState();\r\n\t\t\tvar view = scheduler._props[state.mode];\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, -1);\r\n\t\t\t\t\tvar optionsCount = view.size ? (view.size - 1) : view.options.length;\r\n\r\n\t\t\t\t\tif(view.days > 1 && (view.order[section] == optionsCount - 1)){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, -1, \"day\").valueOf() >= state.min_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tsection = this._getNextSection(slot.section, 1);\r\n\t\t\t\t\tif(view.days > 1 && !view.order[section]){\r\n\t\t\t\t\t\tif(scheduler.date.add(slot.start_date, 1, \"day\").valueOf() < state.max_date.valueOf()){\r\n\t\t\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnewPos = this.nextDaySlot(slot, dir, extend);\r\n\t\t\t\t\tsection = slot.section;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnewPos.section = section;\r\n\t\t\treturn newPos;\r\n\t\t},\r\n\r\n\t\t_moveDate: function(oldDate, dir){\r\n\t\t\tvar newDate = this.findVisibleColumn(scheduler.date.add(oldDate, dir, \"day\"), dir);\r\n\t\t\tnewDate.setHours(oldDate.getHours());\r\n\t\t\tnewDate.setMinutes(oldDate.getMinutes());\r\n\t\t\treturn newDate;\r\n\t\t},\r\n\r\n\t\tisBeforeLastHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours < last_hour || (!isStartDate && ((last_hour == 24 || hours == last_hour) && !minutes)));\r\n\t\t},\r\n\t\tisAfterFirstHour: function(date, isStartDate){\r\n\t\t\tvar minutes = date.getMinutes(),\r\n\t\t\t\thours = date.getHours(),\r\n\t\t\t\tfirst_hour = scheduler.config.first_hour,\r\n\t\t\t\tlast_hour = scheduler.config.last_hour;\r\n\t\t\treturn (hours >= first_hour || (!isStartDate && (!minutes && ((!hours && last_hour == 24) || (hours == last_hour)))));\r\n\t\t},\r\n\t\tisInVisibleDayTime: function(date, isStartDate){\r\n\t\t\treturn (this.isBeforeLastHour(date, isStartDate) && this.isAfterFirstHour(date, isStartDate));\r\n\t\t},\r\n\r\n\t\tnextDaySlot: function(slot, dir, extend){\r\n\t\t\tvar start, end;\r\n\r\n\t\t\tvar key_nav_step = scheduler.config.key_nav_step;\r\n\r\n\t\t\tvar date = this._alignTimeSlot(slot.start_date, scheduler.date.day_start(new Date(slot.start_date)), \"minute\", key_nav_step);\r\n\r\n\r\n\t\t\tvar oldStart = slot.start_date;\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, -key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(start, true)){\r\n\t\t\t\t\t\tif (!extend || this.isInVisibleDayTime(oldStart, true)) {\r\n\r\n\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\tif(extend && scheduler.date.date_part(new Date(start)).valueOf() != scheduler.date.date_part(new Date(oldStart)).valueOf())\r\n\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\tif(toNextDay)\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, -1, \"day\"), -1);\r\n\r\n\t\t\t\t\t\t\tstart.setHours(scheduler.config.last_hour);\r\n\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\tstart = scheduler.date.add(start, -key_nav_step, \"minute\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\t\tstart = scheduler.date.add(date, key_nav_step, \"minute\");\r\n\r\n\t\t\t\t\tvar testEnd = extend ? start : scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tif(!this.isInVisibleDayTime(testEnd, false)){\r\n\t\t\t\t\t\tif(!extend || this.isInVisibleDayTime(oldStart, false)) {\r\n\t\t\t\t\t\t\tif (!extend) {\r\n\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tvar toNextDay = true;\r\n\t\t\t\t\t\t\t\tif (scheduler.date.date_part(new Date(oldStart)).valueOf() == oldStart.valueOf()) {\r\n\t\t\t\t\t\t\t\t\ttoNextDay = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (toNextDay) {\r\n\t\t\t\t\t\t\t\t\tstart = this.findVisibleColumn(scheduler.date.add(slot.start_date, 1, \"day\"), 1);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tstart.setHours(scheduler.config.first_hour);\r\n\t\t\t\t\t\t\t\tstart.setMinutes(0);\r\n\t\t\t\t\t\t\t\tstart = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, -1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = this._moveDate(slot.start_date, 1);\r\n\t\t\t\t\tend = this._moveDate(slot.end_date, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = date;\r\n\t\t\t\t\tend = scheduler.date.add(start, key_nav_step, \"minute\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextWeekAgendaSlot: function(slot, dir){\r\n\t\t\tvar start, end;\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tswitch (dir){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"left\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, -1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, -1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\tcase \"right\":\r\n\t\t\t\t\tstart = scheduler.date.day_start(scheduler.date.add(slot.start_date, 1, \"day\"));\r\n\t\t\t\t\tstart = this.findVisibleColumn(start, 1);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tstart = scheduler.date.day_start(slot.start_date);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tstart = new Date(state.min_date);\r\n\r\n\t\t\t}\r\n\t\t\tend = new Date(start);\r\n\t\t\tend.setHours(scheduler.config.last_hour);\r\n\t\t\treturn {start_date: start, end_date: end};\r\n\t\t},\r\n\t\tnextAgendaSlot: function(slot, dir){\r\n\t\t\treturn {start_date: slot.start_date, end_date: slot.end_date};\r\n\t\t},\r\n\r\n\r\n\t\tisDateVisible: function(date){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar index;\r\n\t\t\tif(timeline){\r\n\t\t\t\tindex = scheduler._get_date_index(timeline, date);\r\n\t\t\t}else{\r\n\t\t\t\tindex = scheduler.locate_holder_day(date);\r\n\t\t\t}\r\n\r\n\t\t\treturn !scheduler._ignores[index];\r\n\t\t},\r\n\r\n\t\tfindVisibleColumn: function(start, dir){\r\n\t\t\tvar date = start;\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar range = scheduler.getState();\r\n\r\n\t\t\twhile(!this.isDateVisible(date) && ((dir > 0 && date.valueOf() <= range.max_date.valueOf()) || (dir < 0 && date.valueOf() >= range.min_date.valueOf()))){\r\n\t\t\t\tdate = this.nextDateColumn(date, dir);\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tnextDateColumn: function(start, dir){\r\n\t\t\tdir = dir || 1;\r\n\t\t\tvar timeline = scheduler.matrix && scheduler.matrix[scheduler.getState().mode];\r\n\r\n\t\t\tvar date;\r\n\t\t\tif(timeline){\r\n\t\t\t\tdate = scheduler.date.add(start, dir * timeline.x_step, timeline.x_unit);\r\n\t\t\t}else{\r\n\t\t\t\tdate = scheduler.date.day_start(scheduler.date.add(start, dir, \"day\"));\r\n\t\t\t}\r\n\r\n\t\t\treturn date;\r\n\t\t},\r\n\r\n\t\tisVisible:function(from, to){\r\n\t\t\tif(!scheduler._ignores_detected)\r\n\t\t\t\treturn true;\r\n\r\n\t\t\tvar current = new Date(from);\r\n\r\n\t\t\twhile(current.valueOf() < to.valueOf()){\r\n\t\t\t\tif(this.isDateVisible(current)) return true;\r\n\t\t\t\tcurrent = this.nextDateColumn(current);\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\r\n\t\tnextSlot: function(slot, dir, view, extend){\r\n\t\t\tvar next;\r\n\t\t\tview = view || this._getMode();\r\n\r\n\t\t\tvar tempSlot = scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tnext = this.nextUnitsSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tnext = this.nextTimelineSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.nextMonthSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.nextWeekAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.list:\r\n\t\t\t\t\tnext = this.nextAgendaSlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.nextDaySlot(tempSlot, dir, extend);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(next.start_date.valueOf() >= next.end_date.valueOf()){\r\n\t\t\t\tnext = this.nextSlot(next, dir, view);\r\n\t\t\t}\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\r\n\t\t},\r\n\r\n\t\textendSlot: function(slot, dir){\r\n\t\t\tvar view = this._getMode();\r\n\t\t\tvar next;\r\n\t\t\tswitch (view){\r\n\t\t\t\tcase this._modes.units:\r\n\t\t\t\t\tif(dir == \"left\" || dir == \"right\"){\r\n\t\t\t\t\t\tnext = this.nextUnitsSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendUnitsSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.timeline:\r\n\t\t\t\t\tif(dir == \"down\" || dir == \"up\"){\r\n\t\t\t\t\t\tnext = this.nextTimelineSlot(slot, dir);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnext = this.extendTimelineSlot(slot, dir);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.year:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.month:\r\n\t\t\t\t\tnext = this.extendMonthSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.dayColumns:\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase this._modes.weekAgenda:\r\n\t\t\t\t\tnext = this.extendWeekAgendaSlot(slot, dir);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tvar range = scheduler.getState();\r\n\t\t\tif(next.start_date.valueOf() < range.min_date.valueOf()){\r\n\t\t\t\tnext.start_date = this.findVisibleColumn(range.min_date);\r\n\t\t\t\tnext.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\t}\r\n\r\n\t\t\tif(next.end_date.valueOf() > range.max_date.valueOf()){\r\n\t\t\t//\tnext.end_date = new Date(slot.end_date);\r\n\t\t\t\tnext.end_date = this.findVisibleColumn(range.max_date, -1);\r\n\t\t\t}\r\n\r\n\r\n\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(next);\r\n\t\t},\r\n\r\n\t\textendTimelineSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"timeline\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendWeekAgendaSlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"weekAgenda\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\textendGenericSlot: function(allowedDirections, slot, direction, type){\r\n\t\t\tvar next;\r\n\t\t\tvar moveDate = slot.movingDate;\r\n\r\n\t\t\tif(!moveDate){\r\n\t\t\t\tmoveDate = allowedDirections[direction];\r\n\t\t\t}\r\n\r\n\t\t\tif(!moveDate || !allowedDirections[direction]){\r\n\t\t\t\treturn slot;\r\n\t\t\t}\r\n\r\n\t\t\tif(direction){\r\n\t\t\t\tnext = this.nextSlot({start_date: slot[moveDate], section: slot.section}, direction, type, true);\r\n\r\n\t\t\t\tif(next.start_date.valueOf() == slot.start_date.valueOf()){\r\n\t\t\t\t\tnext = this.nextSlot({start_date: next.start_date, section:next.section}, direction, type, true);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tnext.movingDate = moveDate;\r\n\t\t\t}else{\r\n\t\t\t\treturn scheduler.$keyboardNavigation.TimeSlot.prototype.clone(slot);\r\n\t\t\t}\r\n\r\n\t\t\tvar newDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tif(newDates.end_date.valueOf() <= newDates.start_date.valueOf()){\r\n\t\t\t\tnext.movingDate = next.movingDate == \"end_date\" ? \"start_date\" : \"end_date\";\r\n\t\t\t}\r\n\t\t\tnewDates = this.extendSlotDates(slot, next, next.movingDate);\r\n\r\n\t\t\tnext.start_date = newDates.start_date;\r\n\t\t\tnext.end_date = newDates.end_date;\r\n\t\t\treturn next;\r\n\t\t},\r\n\r\n\t\textendSlotDates: function(oldSlot, newSlot, dateDirection){\r\n\t\t\tvar res = {start_date:null, end_date:null};\r\n\r\n\t\t\tif(dateDirection == \"start_date\"){\r\n\t\t\t\tres.start_date = newSlot.start_date;\r\n\t\t\t\tres.end_date = oldSlot.end_date;\r\n\t\t\t}else{\r\n\t\t\t\tres.start_date = oldSlot.start_date;\r\n\t\t\t\tres.end_date = newSlot.start_date;\r\n\t\t\t}\r\n\t\t\treturn res;\r\n\r\n\t\t},\r\n\r\n\t\textendMonthSlot: function(slot, direction){\r\n\t\t\tvar slot = this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"month\"\r\n\t\t\t);\r\n\r\n\t\t\tslot.start_date.setHours(scheduler.config.first_hour);\r\n\t\t\tslot.end_date = scheduler.date.add(slot.end_date, -1, \"day\");\r\n\t\t\tslot.end_date.setHours(scheduler.config.last_hour);\r\n\t\t\treturn slot;\r\n\t\t},\r\n\r\n\t\textendUnitsSlot: function(slot, direction){\r\n\t\t\tvar next;\r\n\r\n\t\t\tswitch (direction){\r\n\t\t\t\tcase \"down\":\r\n\t\t\t\tcase \"up\":\r\n\t\t\t\t\tnext = this.extendDaySlot(slot, direction);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tnext = slot;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tnext.section = slot.section;\r\n\t\t\treturn next;\r\n\t\t},\r\n\t\textendDaySlot: function(slot, direction){\r\n\t\t\treturn this.extendGenericSlot({\r\n\t\t\t\t\t\"up\":\"start_date\",\r\n\t\t\t\t\t\"down\":\"end_date\",\r\n\t\t\t\t\t\"left\":\"start_date\",\r\n\t\t\t\t\t\"right\":\"end_date\"\r\n\t\t\t\t},\r\n\t\t\t\tslot,\r\n\t\t\t\tdirection,\r\n\t\t\t\t\"dayColumns\"\r\n\t\t\t);\r\n\t\t},\r\n\r\n\t\tscrollSlot: function(dir){\r\n\t\t\tvar state = scheduler.getState();\r\n\r\n\t\t\tvar slot = this.nextSlot(this, dir);\r\n\t\t\tif(slot.start_date.valueOf() < state.min_date.valueOf() || slot.start_date.valueOf() >= state.max_date.valueOf()){\r\n\t\t\t\tscheduler.setCurrentView(new Date(slot.start_date));\r\n\t\t\t}\r\n\r\n\t\t\tthis.moveTo(slot);\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"left\": function(){\r\n\t\t\t\tthis.scrollSlot(\"left\");\r\n\t\t\t},\r\n\t\t\t\"right\": function () {\r\n\t\t\t\tthis.scrollSlot(\"right\");\r\n\t\t\t},\r\n\t\t\t\"down\": function () {\r\n\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.nextEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"down\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"up\": function () {\r\n\t\t\t\tvar mode = this._getMode();\r\n\t\t\t\tif(mode == this._modes.list){\r\n\t\t\t\t\tscheduler.$keyboardNavigation.SchedulerNode.prototype.prevEventHandler();\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.scrollSlot(\"up\");\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\r\n\t\t\t\"shift+down\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"down\"));\r\n\t\t\t},\r\n\t\t\t\"shift+up\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"up\"));\r\n\t\t\t},\r\n\t\t\t\"shift+right\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"right\"));\r\n\t\t\t},\r\n\t\t\t\"shift+left\":function(){\r\n\t\t\t\tthis.moveTo(this.extendSlot(this, \"left\"));\r\n\t\t\t},\r\n\r\n\r\n\t\t\t\"enter\": function(){\r\n\t\t\t\tvar obj = {start_date: new Date(this.start_date), end_date: new Date(this.end_date)};\r\n\r\n\t\t\t\tvar mode = scheduler.getState().mode;\r\n\t\t\t\tif(scheduler.matrix && scheduler.matrix[mode]){\r\n\r\n\t\t\t\t\tvar timeline = scheduler.matrix[scheduler.getState().mode];\r\n\t\t\t\t\tobj[timeline.y_property] = this.section;\r\n\t\t\t\t}else if(scheduler._props && scheduler._props[mode]){\r\n\t\t\t\t\tvar unit = scheduler._props[mode];\r\n\t\t\t\t\tobj[unit.map_to] = this.section;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tscheduler.addEventNow(obj);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.TimeSlot.prototype.bindAll(scheduler.$keyboardNavigation.TimeSlot.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalButton = function(div, index){\r\n\tthis.container = div;\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar container = this.container;\r\n\t\t\treturn !!container.offsetWidth;// valid if container is visible\r\n\t\t},\r\n\r\n\t\tfallback: function(){\r\n\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\treturn defaultSlot;\r\n\t\t\t}else{\r\n\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t}\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\tif(!this.index){\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_prev_button\");\r\n\t\t\t}else{\r\n\t\t\t\treturn this.container.querySelector(\".dhx_cal_next_button\");\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, this.index ? 0 : 1));\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, 0, 0);\r\n\t\t\t\tif(next && !next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalButton.prototype.bindAll(scheduler.$keyboardNavigation.MinicalButton.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.MinicalCell = function(div, row, col){\r\n\tthis.container = div;\r\n\tthis.row = row || 0;\r\n\tthis.col = col || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\r\n\t\tisValid: function(){\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\treturn !!(grid[this.row] && grid[this.row][this.col]);\r\n\t\t},\r\n\t\tfallback: function(){\r\n\t\t\tvar row = this.row;\r\n\t\t\tvar col = this.col;\r\n\t\t\tvar grid = this._getGrid();\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\trow = 0;\r\n\t\t\t}\r\n\t\t\tvar dir = true;\r\n\t\t\tif(row > grid.length / 2){\r\n\t\t\t\tdir = false;\r\n\t\t\t}\r\n\r\n\t\t\tif(!grid[row]){\r\n\t\t\t\tvar defaultSlot = new scheduler.$keyboardNavigation.TimeSlot();\r\n\t\t\t\tif(defaultSlot.isValid()){\r\n\t\t\t\t\treturn defaultSlot;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn new scheduler.$keyboardNavigation.DataArea();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(dir){\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c++){\r\n\t\t\t\t\tif(!grid[row][c] && c == grid[row].length - 1){\r\n\t\t\t\t\t\trow++;\r\n\t\t\t\t\t\tcol = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor(var c = col; grid[row] && c < grid[row].length; c--){\r\n\t\t\t\t\tif(!grid[row][c] && !c){\r\n\t\t\t\t\t\trow--;\r\n\t\t\t\t\t\tcol = grid[row].length - 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(grid[row][c]){\r\n\t\t\t\t\t\treturn new scheduler.$keyboardNavigation.MinicalCell(this.container, row, c);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn new scheduler.$keyboardNavigation.MinicalButton(this.container, 0);\r\n\t\t},\r\n\t\tfocus: function(){\r\n\t\t\tscheduler.$keyboardNavigation.dispatcher.globalNode.disable();\r\n\r\n\t\t\tthis.container.removeAttribute(\"tabindex\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.focus.apply(this);\r\n\t\t},\r\n\t\tblur: function(){\r\n\t\t\tthis.container.setAttribute(\"tabindex\", \"0\");\r\n\t\t\tscheduler.$keyboardNavigation.KeyNavNode.prototype.blur.apply(this);\r\n\t\t},\r\n\t\t_getNode: function(row, col){\r\n\t\t\treturn this.container.querySelector(\".dhx_year_body tr:nth-child(\"+(row + 1) + \") td:nth-child(\"+(col + 1)+\")\");\r\n\t\t},\r\n\t\tgetNode: function(){\r\n\t\t\treturn this._getNode(this.row, this.col);\r\n\t\t},\r\n\r\n\t\t_getGrid: function(){\r\n\t\t\tvar rows = this.container.querySelectorAll(\".dhx_year_body tr\");\r\n\t\t\tvar grid = [];\r\n\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\tgrid[i] = [];\r\n\t\t\t\tvar row = rows[i];\r\n\t\t\t\tvar cells = row.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var c = 0; c < cells.length; c++){\r\n\t\t\t\t\tvar cell = cells[c];\r\n\t\t\t\t\tvar enabled = true;\r\n\t\t\t\t\tvar css = scheduler._getClassName(cell);\r\n\t\t\t\t\tif(css.indexOf(\"dhx_after\") > -1 || css.indexOf(\"dhx_before\") > -1 || css.indexOf(\"dhx_scale_ignore\") > -1){\r\n\t\t\t\t\t\tenabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tgrid[i][c] = enabled;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn grid;\r\n\t\t},\r\n\r\n\r\n\t\tkeys: {\r\n\t\t\t\"right\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col + 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow + 1]){\r\n\t\t\t\t\t\tnewRow = newRow + 1;\r\n\t\t\t\t\t\tnewCol = 0;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"left\": function(e){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row;\r\n\t\t\t\tvar newCol = this.col - 1;\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tif(grid[newRow - 1]){\r\n\t\t\t\t\t\tnewRow = newRow - 1;\r\n\t\t\t\t\t\tnewCol = grid[newRow].length - 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tnewCol = this.col;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"down\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row + 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tnewRow = this.row;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.moveTo(next);\r\n\t\t\t},\r\n\t\t\t\"up\": function(){\r\n\t\t\t\tvar grid = this._getGrid();\r\n\t\t\t\tvar newRow = this.row - 1;\r\n\t\t\t\tvar newCol = this.col;\r\n\r\n\t\t\t\tif(!grid[newRow] || !grid[newRow][newCol]){\r\n\t\t\t\t\tvar index = 0;\r\n\t\t\t\t\tif(this.col > grid[this.row].length / 2){\r\n\t\t\t\t\t\tindex = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.MinicalButton(this.container, index));\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar next = new scheduler.$keyboardNavigation.MinicalCell(this.container, newRow, newCol);\r\n\t\t\t\t\tif(!next.isValid()){\r\n\t\t\t\t\t\tnext = next.fallback();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.moveTo(next);\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\t\"enter\": function(e){\r\n\t\t\t\tthis.getNode().querySelector(\".dhx_month_head\").click();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.MinicalCell.prototype.bindAll(scheduler.$keyboardNavigation.MinicalCell.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.DataArea = function(index){\r\n\tthis.index = index || 0;\r\n};\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype = scheduler._compose(\r\n\tscheduler.$keyboardNavigation.KeyNavNode,\r\n\t{\r\n\t\tgetNode: function(index){\r\n\t\t\treturn scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t},\r\n\r\n\t\t_handlers:null,\r\n\r\n\t\tisValid: function(){\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tfallback:function(){\r\n\t\t\treturn this;\r\n\t\t},\r\n\r\n\t\tkeys: {\r\n\t\t\t\"up,down,right,left\":function(){\r\n\t\t\t\tthis.moveTo(new scheduler.$keyboardNavigation.TimeSlot());\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n);\r\n\r\nscheduler.$keyboardNavigation.DataArea.prototype.bindAll(scheduler.$keyboardNavigation.DataArea.prototype.keys);\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation.dispatcher = {\r\n\tisActive: false,\r\n\tactiveNode: null,\r\n\tglobalNode: new scheduler.$keyboardNavigation.SchedulerNode(),\r\n\r\n\tkeepScrollPosition: function (callback) {\r\n\t\tvar top, left;\r\n\r\n\t\tvar scrollable = scheduler.$container.querySelector(\".dhx_timeline_scrollable_data\");\r\n\t\tif(!scrollable){\r\n\t\t\tscrollable = scheduler.$container.querySelector(\".dhx_cal_data\");\r\n\t\t}\r\n\r\n\t\tif(scrollable){\r\n\t\t\ttop = scrollable.scrollTop;\r\n\t\t\tleft = scrollable.scrollLeft;\r\n\t\t}\r\n\r\n\t\tcallback();\r\n\r\n\t\tif(scrollable){\r\n\t\t\tscrollable.scrollTop = top;\r\n\t\t\tscrollable.scrollLeft = left;\r\n\t\t}\r\n\t},\r\n\tenable: function(){\r\n\t\tif(!scheduler.$container){\r\n\t\t\t// do nothing if not initialized\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.isActive = true;\r\n\t\tvar self = this;\r\n\t\tthis.keepScrollPosition(function () {\r\n\t\t\tself.globalNode.enable();\r\n\t\t\tself.setActiveNode(self.getActiveNode());\r\n\t\t});\r\n\t},\r\n\r\n\tdisable: function(){\r\n\t\tthis.isActive = false;\r\n\t\tthis.globalNode.disable();\r\n\t},\r\n\r\n\tisEnabled: function(){\r\n\t\treturn !!this.isActive;\r\n\t},\r\n\r\n\tgetDefaultNode: function(){\r\n\t\treturn this.globalNode.getDefaultNode();\r\n\t},\r\n\r\n\tsetDefaultNode: function() {\r\n\t\tthis.setActiveNode(this.getDefaultNode());\r\n\t},\r\n\r\n\tgetActiveNode: function(){\r\n\t\tvar node = this.activeNode;\r\n\t\tif(node && !node.isValid()){\r\n\t\t\tnode = node.fallback();\r\n\t\t}\r\n\t\treturn node;\r\n\t},\r\n\r\n\tfocusGlobalNode: function(){\r\n\t\tthis.blurNode(this.globalNode);\r\n\t\tthis.focusNode(this.globalNode);\r\n\t},\r\n\r\n\tsetActiveNode: function(el){\r\n\t\tif(!el || !el.isValid())\r\n\t\t\treturn;\r\n\r\n\t\tif(this.activeNode){\r\n\t\t\tif(this.activeNode.compareTo(el)){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(this.isEnabled()){\r\n\t\t\tthis.blurNode(this.activeNode);\r\n\t\t\tthis.activeNode = el;\r\n\t\t\tthis.focusNode(this.activeNode);\r\n\t\t}\r\n\t},\r\n\r\n\tfocusNode: function(el){\r\n\t\tif(el && el.focus){\r\n\t\t\tel.focus();\r\n\t\t\tif(el.getNode && document.activeElement != el.getNode()){\r\n\t\t\t\tthis.setActiveNode(new scheduler.$keyboardNavigation.DataArea());\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\tblurNode: function(el){\r\n\t\tif(el && el.blur){\r\n\t\t\tel.blur();\r\n\t\t}\r\n\t},\r\n\r\n\tgetInlineEditor: function(id){\r\n\t\tvar editor = scheduler.$container.querySelector(\".dhx_cal_editor[\"+scheduler.config.event_attribute+\"='\"+id+\"'] textarea\");\r\n\t\tif(editor && editor.offsetWidth){\r\n\t\t\t// if exists and visible\r\n\t\t\treturn editor;\r\n\t\t}\r\n\t\treturn null;\r\n\t},\r\n\r\n\tkeyDownHandler: function (e) {\r\n\r\n\t\tif(e.defaultPrevented){\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar activeElement = this.getActiveNode();\r\n\r\n\t\tif(scheduler.$keyboardNavigation.isModal() &&\r\n\t\t\t!(activeElement && activeElement.container && scheduler.utils.dom.locateCss({target:activeElement.container}, \"dhx_minical_popup\", false)))\r\n\t\t\treturn;\r\n\r\n\t\tif(scheduler.getState().editor_id && this.getInlineEditor(scheduler.getState().editor_id))\r\n\t\t\treturn;\r\n\r\n\t\tif (!this.isEnabled())\r\n\t\t\treturn;\r\n\r\n\t\te = e || window.event;\r\n\r\n\t\tvar schedulerNode = this.globalNode;\r\n\r\n\t\tvar command = scheduler.$keyboardNavigation.shortcuts.getCommandFromEvent(e);\r\n\r\n\t\tif(!activeElement){\r\n\t\t\tthis.setDefaultNode();\r\n\t\t}else if(activeElement.findHandler(command)){\r\n\t\t\tactiveElement.doAction(command, e);\r\n\t\t}else if(schedulerNode.findHandler(command)){\r\n\t\t\tschedulerNode.doAction(command, e);\r\n\t\t}\r\n\r\n\t},\r\n\r\n\t_timeout: null,\r\n\tdelay: function(callback, delay){\r\n\r\n\t\tclearTimeout(this._timeout);\r\n\t\tthis._timeout = setTimeout(callback, delay || 1);\r\n\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.$keyboardNavigation._minicalendars = [];\r\n\r\nscheduler.$keyboardNavigation.isMinical = function(node){\r\n\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\tif(this.isChildOf(node, minicalendars[i]))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n};\r\n\r\nscheduler.$keyboardNavigation.isChildOf = function(child, parent){\r\n\twhile(child && child !== parent){\r\n\t\tchild = child.parentNode;\r\n\t}\r\n\r\n\treturn !!(child === parent);\r\n};\r\n\r\nscheduler.$keyboardNavigation.patchMinicalendar = function(){\r\n\tvar dispatcher = scheduler.$keyboardNavigation.dispatcher;\r\n\r\n\tfunction focusMinical(e){\r\n\t\tvar target = e.target;\r\n\r\n\t\tdispatcher.enable();\r\n\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(target, 0));\r\n\t}\r\n\r\n\tfunction minicalClick(e){\r\n\t\tvar target = e.target || e.srcElement;\r\n\r\n\t\tvar prev = scheduler.utils.dom.locateCss(e, \"dhx_cal_prev_button\", false);\r\n\t\tvar next = scheduler.utils.dom.locateCss(e, \"dhx_cal_next_button\", false);\r\n\t\tvar cell = scheduler.utils.dom.locateCss(e, \"dhx_year_body\", false);\r\n\r\n\t\tvar rowIndex = 0;\r\n\t\tvar cellIndex = 0;\r\n\t\tif(cell){\r\n\t\t\tvar tr;\r\n\t\t\tvar td;\r\n\t\t\tvar current = target;\r\n\t\t\twhile(current && current.tagName.toLowerCase() != \"td\"){\r\n\t\t\t\tcurrent = current.parentNode;\r\n\t\t\t}\r\n\t\t\tif(current){\r\n\t\t\t\ttd = current;\r\n\t\t\t\ttr = td.parentNode;\r\n\t\t\t}\r\n\r\n\t\t\tif(tr && td){\r\n\t\t\t\tvar rows = tr.parentNode.querySelectorAll(\"tr\");\r\n\t\t\t\tfor(var i = 0; i < rows.length; i++){\r\n\t\t\t\t\tif(rows[i] == tr){\r\n\t\t\t\t\t\trowIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tvar cells = tr.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\t\t\tif(cells[i] == td){\r\n\t\t\t\t\t\tcellIndex = i;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar root = e.currentTarget;\r\n\t\tdispatcher.delay(function(){\r\n\t\t\tif(prev || next || cell){\r\n\r\n\t\t\t\tvar element;\r\n\t\t\t\tif(prev){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 0);\r\n\t\t\t\t\tdispatcher.setActiveNode(new scheduler.$keyboardNavigation.MinicalButton(root, 0));\r\n\t\t\t\t}else if(next){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalButton(root, 1);\r\n\t\t\t\t}else if(cell){\r\n\t\t\t\t\telement = new scheduler.$keyboardNavigation.MinicalCell(root, rowIndex, cellIndex);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(element){\r\n\r\n\t\t\t\t\tdispatcher.enable();\r\n\t\t\t\t\tif(element.isValid()){\r\n\t\t\t\t\t\tdispatcher.activeNode = null;\r\n\t\t\t\t\t\tdispatcher.setActiveNode(element);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}\r\n\r\n\tif(scheduler.renderCalendar){\r\n\t\tvar renderMinical = scheduler.renderCalendar;\r\n\t\tscheduler.renderCalendar = function(){\r\n\t\t\tvar cal = renderMinical.apply(this, arguments);\r\n\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"click\", minicalClick);\r\n\t\t\tscheduler.event(cal, \"click\", minicalClick);\r\n\r\n\t\t\tscheduler.eventRemove(cal, \"focus\", focusMinical);\r\n\t\t\tscheduler.event(cal, \"focus\", focusMinical);\r\n\r\n\t\t\tvar added = false;\r\n\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\tadded = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(!added)\r\n\t\t\t\tminicalendars.push(cal);\r\n\r\n\t\t\tif(dispatcher.isEnabled()){\r\n\t\t\t\tvar node = dispatcher.getActiveNode();\r\n\t\t\t\tif(node && node.container == cal){\r\n\t\t\t\t\tdispatcher.focusNode(node);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcal.setAttribute(\"tabindex\", \"0\");\r\n\t\t\t}\r\n\t\t\treturn cal;\r\n\t\t};\r\n\t}\r\n\r\n\tif(scheduler.destroyCalendar){\r\n\t\tvar destroyMinical = scheduler.destroyCalendar;\r\n\t\tscheduler.destroyCalendar = function(cal, force){\r\n\t\t\tcal = cal || (scheduler._def_count ? scheduler._def_count.firstChild : null);\r\n\t\t\tvar res = destroyMinical.apply(this, arguments);\r\n\r\n\t\t\tif(!cal || !cal.parentNode){\r\n\t\t\t\tvar minicalendars = scheduler.$keyboardNavigation._minicalendars;\r\n\t\t\t\tfor(var i = 0; i < minicalendars.length; i++){\r\n\t\t\t\t\tif(minicalendars[i] == cal){\r\n\t\t\t\t\t\tscheduler.eventRemove(minicalendars[i], \"focus\", focusMinical);\r\n\t\t\t\t\t\tminicalendars.splice(i, 1);\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn res;\r\n\t\t};\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\r\n\tthis.layers.sort(function(a, b){\r\n\t\treturn a.zIndex - b.zIndex;\r\n\t});\r\n\r\n\tscheduler._dp_init=function(dp){\r\n\t\tdp._methods=[\"_set_event_text_style\",\"\",\"changeEventId\",\"deleteEvent\"];\r\n\r\n\t\tthis.attachEvent(\"onEventAdded\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"inserted\");\r\n\t\t});\r\n\t\tthis.attachEvent(\"onBeforeEventDelete\",function(id){\r\n\t\t\tif(this.getEvent(id) && this.getEvent(id).layer == dp.layer) {\r\n\t\t\t\tif (!this.validId(id)) return;\r\n\t\t\t\tvar z=dp.getState(id);\r\n\r\n\t\t\t\tif (z==\"inserted\" || this._new_event) { dp.setUpdated(id,false);\t\treturn true; }\r\n\t\t\t\tif (z==\"deleted\") return false;\r\n\t\t\t\tif (z==\"true_deleted\") return true;\r\n\r\n\t\t\t\tdp.setUpdated(id,true,\"deleted\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse return true;\r\n\t\t});\r\n\t\tthis.attachEvent(\"onEventChanged\",function(id){\r\n\t\t\tif (!this._loading && this.validId(id) && this.getEvent(id) && this.getEvent(id).layer == dp.layer)\r\n\t\t\t\tdp.setUpdated(id,true,\"updated\");\r\n\t\t});\r\n\r\n\t\tdp._getRowData=function(id,pref){\r\n\t\t\tvar ev=this.obj.getEvent(id);\r\n\t\t\tvar data = {};\r\n\r\n\t\t\tfor (var a in ev){\r\n\t\t\t\tif (a.indexOf(\"_\")===0) continue;\r\n\t\t\t\tif (ev[a] && ev[a].getUTCFullYear) //not very good, but will work\r\n\t\t\t\t\tdata[a] = this.obj._helpers.formatDate(ev[a]);\r\n\t\t\t\telse\r\n\t\t\t\t\tdata[a] = ev[a];\r\n\t\t\t}\r\n\t\t\treturn data;\r\n\t\t};\r\n\t\tdp._clearUpdateFlag=function(){};\r\n\r\n\t\tdp.attachEvent(\"insertCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"updateCallback\", scheduler._update_callback);\r\n\t\tdp.attachEvent(\"deleteCallback\", function(upd, id) {\r\n\t\t\tthis.obj.setUserData(id, this.action_param, \"true_deleted\");\r\n\t\t\tthis.obj.deleteEvent(id);\r\n\t\t});\r\n\t};\r\n\r\n\t(function() {\r\n var _cloneObj = function(obj){\r\n if(obj === null || typeof(obj) != 'object')\r\n return obj;\r\n var temp = new obj.constructor();\r\n for(var key in obj)\r\n temp[key] = _cloneObj(obj[key]);\r\n return temp;\r\n };\r\n\r\n\t\tscheduler._dataprocessors = [];\r\n\t\tscheduler._layers_zindex = {};\r\n\t\tfor(var i=0; i= scheduler.config.collision_limit);\r\n\t});\r\n\r\n\tscheduler.addEvent=function(start_date,end_date,text,id,extra_data){\r\n\t\tvar ev=start_date;\r\n\t\tif (arguments.length!=1){\r\n\t\t\tev=extra_data||{};\r\n\t\t\tev.start_date=start_date;\r\n\t\t\tev.end_date=end_date;\r\n\t\t\tev.text=text;\r\n\t\t\tev.id=id;\r\n\t\t\tev.layer = this.defaultLayer;\r\n\t\t}\r\n\t\tev.id = ev.id||scheduler.uid();\r\n\t\tev.text = ev.text||\"\";\r\n\r\n\r\n\t\tif (typeof ev.start_date == \"string\") ev.start_date=this.templates.api_date(ev.start_date);\r\n\t\tif (typeof ev.end_date == \"string\") ev.end_date=this.templates.api_date(ev.end_date);\r\n\t\tev._timed=this.isOneDayEvent(ev);\r\n\r\n\t\tvar is_new=!this._events[ev.id];\r\n\t\tthis._events[ev.id]=ev;\r\n\t\tthis.event_updated(ev);\r\n\t\tif (!this._loading)\r\n\t\t\tthis.callEvent(is_new?\"onEventAdded\":\"onEventChanged\",[ev.id,ev]);\r\n\t};\r\n\r\n\tthis._evs_layer = {};\r\n\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t}\r\n\r\n\tscheduler.addEventNow=function(start,end,e){\r\n\t\tvar base = {};\r\n\t\tif (typeof start == \"object\"){\r\n\t\t\tbase = start;\r\n\t\t\tstart = null;\r\n\t\t}\r\n\r\n\t\tvar d = (this.config.event_duration||this.config.time_step)*60000;\r\n\t\tif (!start) start = Math.round((scheduler._currentDate()).valueOf()/d)*d;\r\n\t\tvar start_date = new Date(start);\r\n\t\tif (!end){\r\n\t\t\tvar start_hour = this.config.first_hour;\r\n\t\t\tif (start_hour > start_date.getHours()){\r\n\t\t\t\tstart_date.setHours(start_hour);\r\n\t\t\t\tstart = start_date.valueOf();\r\n\t\t\t}\r\n\t\t\tend = start+d;\r\n\t\t}\r\n\r\n\r\n\t\tbase.start_date = base.start_date||start_date;\r\n\t\tbase.end_date = base.end_date||new Date(end);\r\n\t\tbase.text = base.text||this.locale.labels.new_event;\r\n\t\tbase.id = this._drag_id = this.uid();\r\n\t\tbase.layer = this.defaultLayer;\r\n\t\tthis._drag_mode=\"new-size\";\r\n\r\n\t\tthis._loading=true;\r\n\t\tthis.addEvent(base);\r\n\t\tthis.callEvent(\"onEventCreated\",[this._drag_id,e]);\r\n\t\tthis._loading=false;\r\n\r\n\t\tthis._drag_event={}; //dummy , to trigger correct event updating logic\r\n\t\tthis._on_mouse_up(e);\r\n\t};\r\n\r\n\tscheduler._t_render_view_data = function(events) { // helper\r\n\t\tif (this.config.multi_day && !this._table_view) {\r\n\t\t\tvar tvs = [];\r\n\t\t\tvar tvd = [];\r\n\t\t\tfor (var k = 0; k < events.length; k++) {\r\n\t\t\t\tif (events[k]._timed)\r\n\t\t\t\t\ttvs.push(events[k]);\r\n\t\t\t\telse\r\n\t\t\t\t\ttvd.push(events[k]);\r\n\t\t\t}\r\n\t\t\tthis._table_view = true;\r\n\t\t\tthis.render_data(tvd);\r\n\t\t\tthis._table_view = false;\r\n\t\t\tthis.render_data(tvs);\r\n\t\t}\r\n\t\telse\r\n\t\t\tthis.render_data(events);\r\n\t};\r\n\r\n\tscheduler.render_view_data = function(){\r\n\t\tif (this._not_render) {\r\n\t\t\tthis._render_wait = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._render_wait = false;\r\n\r\n\t\tthis.clear_view();\r\n\r\n\t\tthis._evs_layer = {};\r\n\t\tfor (var i = 0; i < this.layers.length; i++) { // array in object for each layer\r\n\t\t\tthis._evs_layer[this.layers[i].name] = [];\r\n\t\t}\r\n\r\n\t\tvar evs = this.get_visible_events();\r\n\t\tfor (var i = 0; i < evs.length; i++) { // filling layer arrays with events\r\n\t\t\tif(this._evs_layer[evs[i].layer])\r\n\t\t\t\tthis._evs_layer[evs[i].layer].push(evs[i]);\r\n\t\t}\r\n\r\n\t\tif(this._mode == 'month') { // old logic is used\r\n\t\t\tvar tevs = [];\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible)\r\n\t\t\t\t\ttevs = tevs.concat(this._evs_layer[this.layers[i].name]);\r\n\t\t\t}\r\n\t\t\tthis._t_render_view_data(tevs);\r\n\t\t}\r\n\t\telse { // week, day; should use new logic\r\n\t\t\tfor (var i = 0; i < this.layers.length; i++) {\r\n\t\t\t\tif (this.layers[i].visible) {\r\n\t\t\t\t\tvar evs_layer = this._evs_layer[this.layers[i].name];\r\n\t\t\t\t\tthis._t_render_view_data(evs_layer);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._render_v_bar=function(ev,x,y,w,h,style,contentA,contentB,bottom){\r\n\t\tvar id = ev.id;\r\n\r\n\t\tif(contentA.indexOf('';\r\n\t\thtml+='';\r\n\t\thtml+='
'+contentA+'
';\r\n\t\thtml+='
'+contentB+'
';\r\n\t\thtml+='
';\r\n\r\n\t\td.innerHTML=html;\r\n\t\td.style.zIndex = 100;\r\n\t\treturn d.firstChild;\r\n\t};\r\n\r\n\tscheduler.render_event_bar=function(ev){\r\n\t\tvar parent=this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar x=this._colsS[ev._sday];\r\n\t\tvar x2=this._colsS[ev._eday];\r\n\t\tif (x2==x) x2=this._colsS[ev._eday+1];\r\n\t\tvar hb = this.xy.bar_height;\r\n\r\n\t\tvar y=this._colsS.heights[ev._sweek]+(this._colsS.height?(this.xy.month_scale_height+2):2)+ev._sorder*hb;\r\n\r\n\t\tvar d=document.createElement(\"div\");\r\n\t\tvar cs = ev._timed?\"dhx_cal_event_clear\":\"dhx_cal_event_line\";\r\n\t\tvar cse = (scheduler.templates['event_class_'+ev.layer])?scheduler.templates['event_class_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_class(ev.start_date,ev.end_date,ev);\r\n\t\tif (cse) cs=cs+\" \"+cse;\r\n\r\n\t\tvar html='';\r\n\r\n\t\tif (ev._timed)\r\n\t\t\thtml+=(scheduler.templates['event_bar_date_'+ev.layer])?scheduler.templates['event_bar_date_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev);\r\n\t\thtml+=( (scheduler.templates['event_bar_text_'+ev.layer])?scheduler.templates['event_bar_text_'+ev.layer](ev.start_date,ev.end_date,ev):scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev) + '
)');\r\n\t\thtml+=' ';\r\n\r\n\t\td.innerHTML=html;\r\n\r\n\t\tthis._rendered.push(d.firstChild);\r\n\t\tparent.appendChild(d.firstChild);\r\n\t};\r\n\r\n\tscheduler.render_event=function(ev){\r\n\t\tvar menu = scheduler.xy.menu_width;\r\n\t\tif(scheduler.getLayer(ev.layer).noMenu)\r\n\t\t\tmenu = 0;\r\n\r\n\t\tif (ev._sday<0) return; //can occur in case of recurring event during time shift\r\n\t\tvar parent=scheduler.locate_holder(ev._sday);\r\n\t\tif (!parent) return; //attempt to render non-visible event\r\n\t\tvar sm = ev.start_date.getHours()*60+ev.start_date.getMinutes();\r\n\t\tvar em = (ev.end_date.getHours()*60+ev.end_date.getMinutes())||(scheduler.config.last_hour*60);\r\n\r\n\t\tvar top = (Math.round((sm*60*1000-this.config.first_hour*60*60*1000)*this.config.hour_size_px/(60*60*1000)))%(this.config.hour_size_px*24)+1; //42px/hour\r\n\t\tvar height = Math.max(scheduler.xy.min_event_height,(em-sm)*this.config.hour_size_px/60)+1; //42px/hour\r\n\t\t\r\n\t\tvar width=Math.floor((parent.clientWidth-menu)/ev._count);\r\n\t\tvar left=ev._sorder*width+1;\r\n\t\tif (!ev._inner) width=width*(ev._count-ev._sorder);\r\n\r\n\r\n\r\n\t\tvar d=this._render_v_bar(ev.id,menu+left,top,width,height,ev._text_style,scheduler.templates.event_header(ev.start_date,ev.end_date,ev),scheduler.templates.event_text(ev.start_date,ev.end_date,ev));\r\n\r\n\t\tthis._rendered.push(d);\r\n\t\tparent.appendChild(d);\r\n\r\n\t\tleft=left+parseInt(parent.style.left,10)+menu;\r\n\r\n\t\ttop+=this._dy_shift; //corrupt top, to include possible multi-day shift\r\n\t\td.style.zIndex = this._layers_zindex[ev.layer];\r\n\r\n\t\tif (this._edit_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar new_zIndex = d.style.zIndex;\r\n\t\t\twidth=Math.max(width-4,scheduler.xy.editor_width);\r\n\t\t\tvar d=document.createElement(\"div\");\r\n\t\t\td.setAttribute(\"event_id\",ev.id); // for backward compatibility\r\n\t\t\td.setAttribute(this.config.event_attribute,ev.id);\r\n\t\t\tthis.set_xy(d,width,height-20,left,top+14);\r\n\t\t\td.className=\"dhx_cal_editor\";\r\n\t\t\td.style.zIndex = new_zIndex;\r\n\t\t\tvar d2=document.createElement(\"div\");\r\n\t\t\tthis.set_xy(d2,width-6,height-26);\r\n\t\t\td2.style.cssText+=\";margin:2px 2px 2px 2px;overflow:hidden;\";\r\n\r\n\r\n\t\t\td2.style.zIndex = new_zIndex;\r\n\t\t\td.appendChild(d2);\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(d);\r\n\t\t\tthis._rendered.push(d);\r\n\r\n\t\t\td2.innerHTML=\"
\";\r\n\r\n\t\t\tthis._editor=d2.firstChild;\r\n\t\t\tthis._editor.addEventListener(\"keypress\", function(e){\r\n\t\t\t\tif (e.shiftKey) return true;\r\n\t\t\t\tvar code= e.keyCode;\r\n\t\t\t\tif (code==scheduler.keys.edit_save) scheduler.editStop(true);\r\n\t\t\t\tif (code==scheduler.keys.edit_cancel) scheduler.editStop(false);\r\n\t\t\t});\r\n\t\t\tthis._editor.addEventListener(\"selectstart\", function(e){ e.cancelBubble=true; return true; });\r\n\t\t\td2.firstChild.focus();\r\n\t\t\t//IE and opera can add x-scroll during focusing\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].scrollLeft=0;\r\n\t\t\td2.firstChild.select();\r\n\t\t}\r\n\t\tif (this._select_id==ev.id){\r\n\t\t\td.style.zIndex = parseInt(d.style.zIndex)+1; //fix overlapping issue\r\n\t\t\tvar icons=this.config[\"icons_\"+((this._edit_id==ev.id)?\"edit\":\"select\")];\r\n\t\t\tvar icons_str=\"\";\r\n\t\t\tfor (var i=0; i
\";\r\n\t\t\tvar obj = this._render_v_bar(ev.id,left-menu+1,top,menu,icons.length*20+26,\"\",\"\",icons_str,true);\r\n\t\t\tobj.style.left=left-menu+1;\r\n\t\t\tobj.style.zIndex = d.style.zIndex;\r\n\t\t\tthis._els[\"dhx_cal_data\"][0].appendChild(obj);\r\n\t\t\tthis._rendered.push(obj);\r\n\t\t}\r\n\r\n\t};\r\n\r\n scheduler.filter_agenda = function(id, event) {\r\n var layer = scheduler.getLayer(event.layer);\r\n return (layer && layer.visible);\r\n };\r\n});\r\n\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.limit_start = null;\r\nscheduler.config.limit_end = null;\r\nscheduler.config.limit_view = false;\r\nscheduler.config.check_limits = true;\r\n\r\nscheduler._temp_limit_scope = function(){\r\n\tvar before = null;\r\n\tvar dhx_time_block = \"dhx_time_block\";\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\",function(om,od,nm,nd){\r\n\r\n\t\tfunction isBlocked(date, mode){\r\n\t\t\tvar limit_start = scheduler.config.limit_start,\r\n\t\t\t\tlimit_end = scheduler.config.limit_end,\r\n\t\t\t\tdate_end = scheduler.date.add(date,1,mode);\r\n\r\n\t\t\treturn (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());\r\n\t\t}\r\n\r\n\t\tif (scheduler.config.limit_view){\r\n\t\t\tnd = nd||od; nm = nm||om;\r\n\t\t\tif (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvar resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;\r\n\r\n\t\t\t\t\tscheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);\r\n\t\t\t\t},1);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onMouseDown\", function(classname) {\r\n\t\treturn !(classname == dhx_time_block);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeDrag\",function(id){\r\n\t\tif (!id) return true;\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(id));\r\n\t});\r\n\tscheduler.attachEvent(\"onClick\", function (event_id, native_event_object){\r\n\t\treturn scheduler.checkLimitViolation(scheduler.getEvent(event_id));\r\n });\r\n\tscheduler.attachEvent(\"onBeforeLightbox\",function(id){\r\n\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tbefore = [ev.start_date, ev.end_date];\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\r\n\t\t//lightbox may not have 'time' section\r\n\t\tif(!(data.start_date && data.end_date)){\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\t\t\tdata.start_date = new Date(ev.start_date);\r\n\t\t\tdata.end_date = new Date(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif(data.rec_type){\r\n\t\t\t//_roll_back_dates modifies start_date of recurring event, need to check limits after modification\r\n\t\t\t// use a copy to keep original event unchanged\r\n\t\t\tvar data_copy = scheduler._lame_clone(data);\r\n\t\t\tscheduler._roll_back_dates(data_copy);\r\n\t\t\treturn scheduler.checkLimitViolation(data_copy);\r\n\t\t}\r\n\t\treturn scheduler.checkLimitViolation(data);\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev) && scheduler.config.limit_start && scheduler.config.limit_end) {\r\n\t\t\t//if newly created event is outside of limited time - crop it, leaving only allowed time\r\n\t\t\tif (ev.start_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.start_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.start_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.end_date < scheduler.config.limit_start) {\r\n\t\t\t\tev.end_date = new Date(scheduler.config.limit_start);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date.valueOf() >= scheduler.config.limit_end.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(scheduler.config.limit_end, -1, \"day\");\r\n\t\t\t}\r\n\t\t\tif (ev.start_date.valueOf() >= ev.end_date.valueOf()) {\r\n\t\t\t\tev.end_date = this.date.add(ev.start_date, (this.config.event_duration||this.config.time_step), \"minute\");\r\n\t\t\t}\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\",function(id){\r\n\t\tif (!id) return true;\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif (!scheduler.checkLimitViolation(ev)){\r\n\t\t\tif (!before) return false;\r\n\t\t\tev.start_date = before[0];\r\n\t\t\tev.end_date = before[1];\r\n\t\t\tev._timed=this.isOneDayEvent(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventChanged\",function(ev, native_object, is_new){\r\n\t\treturn scheduler.checkLimitViolation(ev);\r\n\t});\r\n\tscheduler.attachEvent(\"onBeforeEventCreated\", function(ev) { // native event\r\n\t\tvar start_date = scheduler.getActionData(ev).date;\r\n\t\tvar event = {\r\n\t\t\t_timed: true,\r\n\t\t\tstart_date: start_date,\r\n\t\t\tend_date: scheduler.date.add(start_date, scheduler.config.time_step, \"minute\")\r\n\t\t};\r\n\t\treturn scheduler.checkLimitViolation(event);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", function(){\r\n\t\tscheduler._mark_now();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onAfterSchedulerResize\", function(){\r\n\t\twindow.setTimeout(function(){ \r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler._mark_now(); \r\n\t\t}, 1);\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tscheduler._mark_now_timer = window.setInterval(function() {\r\n\t\t\tif(!scheduler._is_initialized())\r\n\t\t\t\treturn;\r\n\t\t\tscheduler._mark_now();\r\n\t\t}, 60000);\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tclearInterval(scheduler._mark_now_timer);\r\n\t});\r\n\r\n};\r\nscheduler._temp_limit_scope();\r\n\r\n\r\n}","import { GoogleMapAdapter } from \"./gMapAdapter\";\r\nimport { OpenStreetMapAdapter } from \"./osmMapAdapter\";\r\nimport { MapboxAdapter } from \"./mapboxAdapter\";\r\nimport { IMapAdapter, ICalendarEvent, IMapSettings } from \"./types\";\r\n\r\ndeclare let google: any;\r\n\r\nexport default function(scheduler: any){\r\n\t\r\nlet mapAdapter: IMapAdapter | null = null;\r\nlet eventHandlerIds: number[] = [];\r\nconst adapters: { [name:string]: IMapAdapter } = {\r\n\tgoogleMap: new GoogleMapAdapter(scheduler),\r\n\topenStreetMaps: new OpenStreetMapAdapter(scheduler),\r\n\tmapbox: new MapboxAdapter(scheduler)\r\n}\r\n\r\nif(!scheduler.ext){\r\n\tscheduler.ext = {};\r\n}\r\nscheduler.ext.mapView = {\r\n\tcreateAdapter: function():IMapAdapter{\r\n\t\treturn adapters[scheduler.config.map_view_provider];\r\n\t},\r\n\tcreateMarker: function(config){\r\n\t\treturn new google.maps.Marker(config);\r\n\t},\r\n\tcurrentAdapter: null,\r\n\tadapters\r\n};\r\nscheduler._latLngUpdate = false; // flag for updating events which don't have event.lat and event.lng\r\nscheduler._eventLocationChanged = false; // flag for checking if the location of the event is changed\r\nscheduler.config.map_view_provider = \"googleMap\";\r\nscheduler.config.map_settings = {\r\n\tinitial_position: {\r\n\t lat: 48.724,\r\n\t lng: 8.215\r\n\t},\r\n\terror_position: {\r\n\t lat: 15,\r\n\t lng: 15\r\n\t},\r\n\tinitial_zoom: 1,\r\n\tzoom_after_resolve: 15,\r\n\tinfo_window_max_width: 300,\r\n\tresolve_user_location: true,\r\n\tresolve_event_location: true,\r\n\tview_provider: \"googleMap\"\r\n}\r\nif (scheduler.config.map_initial_position) {\r\n\tscheduler.config.map_settings.initial_position = {\r\n\t\tlat: scheduler.config.map_initial_position.lat(),\r\n\t\tlng: scheduler.config.map_initial_position.lng(), \r\n\t};\r\n}\r\n\r\nif (scheduler.config.map_error_position) {\r\n\tscheduler.config.map_settings.error_position = {\r\n\t\tlat: scheduler.config.map_error_position.lat(),\r\n\t\tlng: scheduler.config.map_error_position.lng(), \r\n\t};\r\n}\r\n\r\nscheduler.xy.map_date_width = 188; // date column width\r\nscheduler.xy.map_icon_width = 25; // event details icon width\r\nscheduler.xy.map_description_width = 400; // description column width\r\nscheduler.date.add_map = function(date, inc, mode) {\r\n\treturn (new Date(date.valueOf()));\r\n};\r\nscheduler.templates.map_date = function(dd, ed, mode) {\r\n\treturn '';\r\n};\r\nscheduler.templates.map_time = function(start, end, ev) {\r\n\tif (scheduler.config.rtl && !ev._timed) {\r\n\t\treturn scheduler.templates.day_date(end) + \" – \" + scheduler.templates.day_date(start);\r\n\t} else if (ev._timed) {\r\n\t\treturn this.day_date(ev.start_date, ev.end_date, ev) + \" \" + this.event_date(start);\r\n\t} else {\r\n\t\treturn scheduler.templates.day_date(start) + \" – \" + scheduler.templates.day_date(end);\r\n\t}\r\n};\r\nscheduler.templates.map_text = function(start, end, ev) {\r\n\treturn ev.text;\r\n};\r\nscheduler.templates.map_info_content = function(event){\r\n return `
Event's text: ${event.text}\r\n\t\t\t\t
Location: ${event.event_location}
\r\n\t\t\t\t
Starts: ${scheduler.templates.tooltip_date_format(event.start_date)}
\r\n\t\t\t\t
Ends: ${scheduler.templates.tooltip_date_format(event.end_date)}
\r\n\t\t\t
`;\r\n};\r\nscheduler.date.map_start = function(d) {\r\n\treturn d;\r\n};\r\n\r\nfunction setupMapView(scheduler) {\r\n\t// Initialization logic, possibly including creation of a new mapAdapter\r\n\tmapAdapter = scheduler.ext.mapView.createAdapter();\r\n\tattachSchedulerEvents();\r\n}\r\nasync function addEventWithLocation(event: ICalendarEvent, mapAdapter: IMapAdapter){\r\n\tlet coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\tevent.lat = coordinates.lat;\r\n\tevent.lng = coordinates.lng;\r\n\tmapAdapter.removeEventMarker(String(event.id));\r\n\tmapAdapter.addEventMarker(event);\r\n\treturn event;\r\n}\r\nfunction setUserLocation(options: IMapSettings, adapter: IMapAdapter): void{\r\n\tif (options.resolve_user_location) {\r\n\t\tif (navigator.geolocation) {\r\n\t\t\tnavigator.geolocation.getCurrentPosition(function(position) {\r\n\t\t\t\tadapter.setView(position.coords.latitude, position.coords.longitude, options.zoom_after_resolve || options.initial_zoom);\r\n\t\t\t});\r\n\t\t}\r\n\t} else {\r\n\t\tadapter.setView(options.initial_position.lat, options.initial_position.lng, options.initial_zoom);\r\n\t}\r\n}\r\nscheduler.dblclick_dhx_map_area = function(e) {\r\n\tlet eventNode = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\tif (eventNode){\r\n\t\tlet eventId = eventNode.getAttribute(`${scheduler.config.event_attribute}`);\r\n\t\tscheduler.showLightbox(eventId);\r\n\t}\r\n\tif (!this.config.readonly && this.config.dblclick_create && !eventNode) {\r\n\t\tthis.addEventNow({\r\n\t\t\tstart_date: scheduler.config.map_start,\r\n\t\t\tend_date: scheduler.date.add( scheduler.config.map_start, scheduler.config.time_step, \"minute\"),\r\n\t\t});\r\n\t}\t\r\n};\r\n\r\nfunction attachSchedulerEvents() { \r\n eventHandlerIds.push(\r\n\tscheduler.attachEvent(\"onEventSave\",function(id,ev,is_new){\r\n\t\tlet unmodifiedEvent = scheduler.getEvent(id);\r\n\t\tif (unmodifiedEvent && unmodifiedEvent.event_location != ev.event_location) {\r\n\t\t\tscheduler._eventLocationChanged = true;\r\n\t\t}\r\n\t\treturn true;\r\n\t}),\r\n scheduler.attachEvent(\"onEventChanged\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !scheduler._latLngUpdate ) {\r\n\t\t\t\t \taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.updateEventMarker(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._latLngUpdate = false;\r\n\t\treturn true;\r\n }),\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(old_id,new_id){\r\n\t\tlet newIdEvent = scheduler.getEvent(new_id);\r\n\t\tmapAdapter?.removeEventMarker(old_id);\r\n\t\tmapAdapter?.addEventMarker(newIdEvent);\r\n\t}),\r\n scheduler.attachEvent(\"onEventAdded\", (id, event) => {\r\n\t\tconst {start_date, end_date} = event;\r\n\t\tconst {min_date, max_date} = scheduler.getState();\r\n\t\tif(start_date.valueOf() < max_date.valueOf() && end_date.valueOf() > min_date.valueOf()){\r\n \t\tif (mapAdapter) {\r\n\t\t\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && scheduler._eventLocationChanged) {\r\n\t\t\t\t\taddEventWithLocation(event, mapAdapter);\r\n\t\t\t\t\tscheduler._eventLocationChanged = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmapAdapter.addEventMarker(event);\r\n\t\t\t\t\tmapAdapter.onEventClick(event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n }),\r\n scheduler.attachEvent(\"onClick\", function (id, e){\r\n\t\tconst event = scheduler.getEvent(id);\r\n\t\tif (mapAdapter && event) mapAdapter.onEventClick(event);\r\n\t\treturn false;\r\n }),\r\n scheduler.attachEvent(\"onBeforeEventDelete\", (id, event) => {\r\n\t\tif (mapAdapter) {\r\n\t\t\tmapAdapter.removeEventMarker(id);\r\n\t\t}\r\n\t\treturn true;\r\n })\r\n );\r\n}\r\nfunction detachSchedulerEvents() {\r\n\teventHandlerIds.forEach(id => scheduler.detachEvent(id));\r\n\teventHandlerIds = [];\r\n}\r\n\r\nscheduler.attachEvent(\"onSchedulerReady\", function() {\r\n\r\n\tif(scheduler.config.map_initial_zoom !== undefined){\r\n\t\tscheduler.config.map_settings.initial_zoom = scheduler.config.map_initial_zoom;\r\n\t}\r\n\tif(scheduler.config.map_zoom_after_resolve !== undefined){\r\n\t\tscheduler.config.map_settings.zoom_after_resolve = scheduler.config.map_zoom_after_resolve;\r\n\t}\r\n\tif(scheduler.config.map_infowindow_max_width !== undefined){\r\n\t\tscheduler.config.map_settings.info_window_max_width = scheduler.config.map_infowindow_max_width;\r\n\t}\r\n\tif(scheduler.config.map_resolve_user_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_user_location = scheduler.config.map_resolve_user_location;\r\n\t}\r\n\tif(scheduler.config.map_view_provider !== undefined){\r\n\t\tscheduler.config.map_settings.view_provider = scheduler.config.map_view_provider;\r\n\t}\r\n\tif(scheduler.config.map_type !== undefined){\r\n\t\tscheduler.config.map_settings.type = scheduler.config.map_type;\r\n\t}\r\n\tif(scheduler.config.map_resolve_event_location !== undefined){\r\n\t\tscheduler.config.map_settings.resolve_event_location = scheduler.config.map_resolve_event_location;\r\n\t}\r\n\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\r\n\tlet map = document.createElement('div');\r\n\tmap.className = 'mapContainer';\r\n\tmap.id = 'mapContainer';\r\n\tmap.style.display = \"none\";\r\n\tmap.style.zIndex = \"1\";\r\n\tscheduler._obj.appendChild(map);\r\n\r\n\tconst old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs, hold) {\r\n\t\tif (this._mode == \"map\") {\r\n\t\t\tfill_map_tab();\r\n\t\t\tlet events = scheduler.get_visible_events();\r\n\t\t\tif (mapAdapter) {\r\n\t\t\t\tmapAdapter.clearEventMarkers();\r\n\t\t\t\tevents.forEach((event) => mapAdapter?.addEventMarker(event));\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\treturn old.apply(this, arguments);\r\n\t};\r\n\r\n\tscheduler.map_view = function(mode) {\r\n\t\tscheduler._els.dhx_cal_data[0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\tscheduler._min_date = scheduler.config.map_start || (scheduler._currentDate());\r\n\t\tscheduler._max_date = scheduler.config.map_end || scheduler.date.add(scheduler._currentDate(), 1, \"year\");\r\n\t\tscheduler._table_view = true;\r\n\t\tset_full_view(mode);\r\n\t\tlet mapContainer = document.getElementById('mapContainer');\r\n\t\t_setMapSize('mapContainer');\r\n\r\n\t\t// creating the new logic\r\n\t\tif (mode && mapContainer) {\r\n\t\t\tmap.style.display = 'block';\r\n\t\t\tfill_map_tab();\r\n\t\t\t// case to display several maps and has the opportunity to switch between them\r\n\t\t\tif (scheduler.config.map_view_provider == scheduler.ext.mapView.currentAdapter) {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t} else {\r\n\t\t\t\tmapAdapter?.destroy(mapContainer);\r\n\t\t\t\tsetupMapView(scheduler);\r\n\t\t\t\tmapAdapter?.initialize(mapContainer, scheduler.config.map_settings);\r\n\t\t\t \tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t\t}\r\n\t\t\tif(mapAdapter) {\r\n\t\t\t\tsetUserLocation(scheduler.config.map_settings, mapAdapter);\r\n\t\t\t}\t\r\n\t\t} else {\r\n\t\t\tmap.style.display = 'none';\r\n\t\t\tscheduler._els.dhx_cal_data[0].style.width = \"100%\";\r\n\t\t \tif (mapAdapter && mapContainer ) {\r\n\t\t\t\tmapAdapter.destroy(mapContainer);\r\n\t\t\t\tmapAdapter = null;\r\n\t\t\t\tscheduler.ext.mapView.currentAdapter = scheduler.config.map_view_provider;\r\n\t\t }\r\n\t\t \tdetachSchedulerEvents();\r\n\t\t}\r\n\t};\r\n\r\n\tfunction _setMapSize(elem_id) { //input - map's div id\r\n\t\tlet map = document.getElementById(elem_id);\r\n\t\tif (map) {\r\n\t\t\tconst nav_height = scheduler.$container.querySelector(\".dhx_cal_navline\").offsetHeight;\r\n\t\t\tlet height = scheduler.$container.querySelector(\".dhx_cal_data\").offsetHeight + scheduler.$container.querySelector(\".dhx_cal_header\").offsetHeight;\r\n\t\t\tif (height < 0)\r\n\t\t\t\theight = 0;\r\n\t\t\tlet width = scheduler._x - scheduler.xy.map_date_width - scheduler.xy.map_description_width - 1;\r\n\t\t\tif (width < 0)\r\n\t\t\t\twidth = 0;\r\n\t\t\tmap.style.height = height + 'px';\r\n\t\t\tmap.style.width = width + 'px';\r\n\t\t\tmap.style.position = \"absolute\";\r\n\t\t\tmap.style.top = nav_height + \"px\";\r\n\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\tmap.style.marginRight = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t} else {\r\n\t\t\t\tmap.style.marginLeft = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\t\t\t}\r\n\t\t\tmap.style.marginTop = (scheduler.xy.nav_height + 2) + 'px';\r\n\t\t}\r\n\t}\t\r\n\tfunction fill_map_tab() {\r\n\t\t//select events for which data need to be printed\r\n\t\tlet events = scheduler.get_visible_events();\r\n\t\tevents.sort(function(a, b) {\r\n\t\t\tif(a.start_date.valueOf()==b.start_date.valueOf())\r\n\t\t\t\treturn a.id>b.id?1:-1;\r\n\t\t\treturn a.start_date>b.start_date?1:-1;\r\n\t\t});\r\n\r\n\t\t//generate html for the view\r\n\t\tlet ariaAttr = scheduler._waiAria.mapAttrString();\r\n\r\n\t\tlet html = \"
\";\r\n\t\tfor (let i = 0; i < events.length; i++) {\r\n\t\t\tlet ev = events[i];\r\n\t\t\tlet event_class = (ev.id == scheduler._selected_event_id) ? 'dhx_map_line highlight' : 'dhx_map_line';\r\n\t\t\tlet bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tlet color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\tlet ariaAttr = scheduler._waiAria.mapRowAttrString(ev);\r\n\t\t\tlet ariaButtonAttr = scheduler._waiAria.mapDetailsBtnString();\r\n\r\n\t\t\thtml += \"
\" + scheduler.templates.map_time(ev.start_date, ev.end_date, ev) + \"
\";\r\n\t\t\thtml += `
`;\r\n\t\t\thtml += \"
\" + scheduler.templates.map_text(ev.start_date, ev.end_date, ev) + \"
\"; // -25 = icon size 20 and padding 5\r\n\t\t}\r\n\t\thtml += \"
\";\r\n\r\n\t\t//render html\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].scrollTop = 0; //fix flickering in FF\r\n\t\tscheduler._els[\"dhx_cal_data\"][0].innerHTML = html;\r\n\t//\tscheduler._els[\"dhx_cal_data\"][0].style.width = (scheduler.xy.map_date_width + scheduler.xy.map_description_width + 1) + 'px';\r\n\r\n\t\tlet t = scheduler._els[\"dhx_cal_data\"][0].firstChild.childNodes;\r\n\r\n\t\tlet dateElement = scheduler._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML=scheduler.templates[scheduler._mode + \"_date\"](scheduler._min_date, scheduler._max_date, scheduler._mode);\r\n\t\t}\r\n\r\n\t\tscheduler._rendered = [];\r\n\t\tfor (let i = 0; i < t.length - 2; i++) {\r\n\t\t\tscheduler._rendered[i] = t[i];\r\n\t\t}\r\n\t}\r\n\tfunction set_full_view(mode) {\r\n\t\tif (mode) {\r\n\t\t\tconst l = scheduler.locale.labels;\r\n\t\t\tscheduler._els[\"dhx_cal_header\"][0].innerHTML = \"
\" + l.date + \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"
\" + l.description + \"
\";\r\n\t\t\tscheduler._table_view = true;\r\n\t\t\tscheduler.set_sizes();\r\n\t\t}\r\n\t}\r\n\t\r\n\tscheduler.attachEvent(\"onLocationError\", function (id){\r\n\t\talert(\"Location can't be found\");\r\n\t\treturn google.maps.LatLng(51.477840, -0.001492); \r\n\t\t//the coordinates of the Greenwich Royal Observatory\r\n\t})\r\n\tlet _updateEventLocation = async function(event) {\r\n\t\tif (mapAdapter){\r\n\t\t\tconst coordinates = await mapAdapter.resolveAddress(event.event_location);\r\n\t\t\tif (coordinates.lat && coordinates.lng) {\r\n\t\t\t\tevent.lat = +coordinates.lat;\r\n\t\t\t\tevent.lng = +coordinates.lng;\r\n\t\t\t} else {\r\n\t\t\t\tscheduler.callEvent(\"onLocationError\", [event.id]);\r\n\t\t\t\tevent.lng = scheduler.config.map_settings.error_position.lng;\r\n\t\t\t\tevent.lat = scheduler.config.map_settings.error_position.lat;\r\n\t\t\t}\r\n\t\t\tscheduler._latLngUpdate = true;\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [event.id, event]);\r\n\t\t}\r\n\t};\r\n\tlet _delay = function(method, object, params, delay) {\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tlet ret = method.apply(object, params);\r\n\t\t\tmethod = object = params = null;\r\n\t\t\treturn ret;\r\n\t\t}, delay || 1);\r\n\t};\r\n\tscheduler._event_resolve_delay = 1500;\r\n\tscheduler.attachEvent(\"onEventLoading\", function(event) {\r\n\t\tif (event.lat && event.lng) {\r\n\t\t\tevent.lat = +event.lat;\r\n\t\t\tevent.lng = +event.lng;\r\n\t\t}\r\n\t\tif (scheduler.config.map_settings.resolve_event_location && event.event_location && !event.lat && !event.lng) { // don't delete !event.lat && !event.lng as location could change\r\n\t\t\tscheduler._event_resolve_delay += 1500;\r\n\t\t\t_delay(_updateEventLocation, this, [event], scheduler._event_resolve_delay);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n})\r\n\r\n}","export default function(scheduler){\r\n\r\nconst minicalDomEvents = scheduler._createDomEventScope();\r\n\t\r\n\r\nscheduler.config.minicalendar = {\r\n\tmark_events: true\r\n};\r\nscheduler._synced_minicalendars = [];\r\nscheduler.renderCalendar = function(obj, _prev, is_refresh) {\r\n\tvar cal = null;\r\n\tvar date = obj.date || (scheduler._currentDate());\r\n\tif (typeof date == \"string\")\r\n\t\tdate = this.templates.api_date(date);\r\n\r\n\tif (!_prev) {\r\n\t\tvar cont = obj.container;\r\n\t\tvar pos = obj.position;\r\n\r\n\t\tif (typeof cont == \"string\")\r\n\t\t\tcont = document.getElementById(cont);\r\n\r\n\t\tif (typeof pos == \"string\")\r\n\t\t\tpos = document.getElementById(pos);\r\n\t\tif (pos && (typeof pos.left == \"undefined\" && typeof pos.right == \"undefined\")) {\r\n\t\t\tvar tpos = scheduler.$domHelpers.getOffset(pos);\r\n\t\t\tpos = {\r\n\t\t\t\ttop: tpos.top + pos.offsetHeight,\r\n\t\t\t\tleft: tpos.left\r\n\t\t\t};\r\n\t\t}\r\n\t\tif (!cont)\r\n\t\t\tcont = scheduler._get_def_cont(pos);\r\n\r\n\t\tcal = this._render_calendar(cont, date, obj);\r\n\t\r\n\t\tif (!cal.$_eventAttached) {\r\n\t\t\tcal.$_eventAttached = true;\r\n\t\t\tminicalDomEvents.attach(cal, \"click\", (function(e) {\r\n\t\t\t\tvar src = e.target || e.srcElement;\r\n\r\n\t\t\t\tvar $dom = scheduler.$domHelpers;\r\n\t\t\t\tif ($dom.closest(src, \".dhx_month_head\")) {\r\n\t\t\t\t\tif (!$dom.closest(src, \".dhx_after\") && !$dom.closest(src, \".dhx_before\")) {\r\n\r\n\t\t\t\t\t\tvar cellRoot = $dom.closest(src, \"[data-cell-date]\");\r\n\t\t\t\t\t\tvar dateAttribute = cellRoot.getAttribute(\"data-cell-date\");\r\n\t\t\t\t\t\tvar newDate = scheduler.templates.parse_date(dateAttribute);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tscheduler.unmarkCalendar(this);\r\n\t\t\t\t\t\tscheduler.markCalendar(this, newDate, \"dhx_calendar_click\");\r\n\t\t\t\t\t\tthis._last_date = newDate;\r\n\t\t\t\t\t\tif (this.conf.handler) this.conf.handler.call(scheduler, newDate, this);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).bind(cal));\r\n\t\t}\r\n\t\r\n\t} else {\r\n\t\tcal = this._render_calendar(_prev.parentNode, date, obj, _prev);\r\n\t\tscheduler.unmarkCalendar(cal);\r\n\t}\r\n\r\n\tif (scheduler.config.minicalendar.mark_events) {\r\n\t\tvar start = scheduler.date.month_start(date);\r\n\t\tvar end = scheduler.date.add(start, 1, \"month\");\r\n\t\tvar evs = this.getEvents(start, end);\r\n\t\tvar filter = this[\"filter_\" + this._mode];\r\n\t\tvar markedDates = {};\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif (filter && !filter(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\t\t\tvar d = ev.start_date;\r\n\t\t\tif (d.valueOf() < start.valueOf())\r\n\t\t\t\td = start;\r\n\t\t\td = scheduler.date.date_part(new Date(d.valueOf()));\r\n\t\t\twhile (d < ev.end_date) {\r\n\t\t\t\tif(!markedDates[+d]) {\r\n\t\t\t\t\tmarkedDates[+d] = true;\r\n\t\t\t\t\tthis.markCalendar(cal, d, \"dhx_year_event\");\r\n\t\t\t\t}\r\n\t\t\t\td = this.date.add(d, 1, \"day\");\r\n\t\t\t\tif (d.valueOf() >= end.valueOf())\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tthis._markCalendarCurrentDate(cal);\r\n\r\n\tcal.conf = obj;\r\n\tif (obj.sync && !is_refresh)\r\n\t\tthis._synced_minicalendars.push(cal);\r\n\r\n\tif(!cal.conf._on_xle_handler){\r\n\t\tcal.conf._on_xle_handler = scheduler.attachEvent(\"onXLE\", function refreshOnLoad(){\r\n\t\t\tscheduler.updateCalendar(cal, cal.conf.date);\r\n\t\t});\r\n\t}\r\n\r\n\tif(this.config.wai_aria_attributes && this.config.wai_aria_application_role){\r\n\t\tcal.setAttribute(\"role\", \"application\");\r\n\t}\r\n\r\n\treturn cal;\r\n};\r\nscheduler._get_def_cont = function(pos) {\r\n\tif (!this._def_count) {\r\n\t\tthis._def_count = document.createElement(\"div\");\r\n\t\tthis._def_count.className = \"dhx_minical_popup\";\r\n\t\tscheduler.event(this._def_count, \"click\", function(e) { e.cancelBubble = true; });\r\n\t\tdocument.body.appendChild(this._def_count);\r\n\t}\r\n\r\n\tif(pos.left){\r\n\t\tthis._def_count.style.left = pos.left + \"px\";\r\n\t}\r\n\tif(pos.right){\r\n\t\tthis._def_count.style.right = pos.right + \"px\";\r\n\t}\r\n\tif(pos.top){\r\n\t\tthis._def_count.style.top = pos.top + \"px\";\r\n\t}\r\n\tif(pos.bottom){\r\n\t\tthis._def_count.style.bottom = pos.bottom + \"px\";\r\n\t}\r\n\r\n\tthis._def_count._created = new Date();\r\n\r\n\treturn this._def_count;\r\n};\r\nscheduler._locateCalendar = function(cal, date) {\r\n\tif (typeof date == \"string\")\r\n\t\tdate = scheduler.templates.api_date(date);\r\n\r\n\tif(+date > +cal._max_date || +date < +cal._min_date)\r\n\t\treturn null;\r\n\r\n\tvar table = cal.querySelector(\".dhx_year_body\").childNodes[0];\r\n\r\n\tvar weekNum = 0;\r\n\tvar dat = new Date(cal._min_date);\r\n\twhile(+this.date.add(dat, 1, \"week\") <= +date){\r\n\t\tdat = this.date.add(dat, 1, \"week\");\r\n\t\tweekNum++;\r\n\t}\r\n\r\n\tvar sm = scheduler.config.start_on_monday;\r\n\tvar day = (date.getDay() || (sm ? 7 : 0)) - (sm ? 1 : 0);\r\n\r\n\tconst dayCell = table.querySelector(`.dhx_cal_month_row:nth-child(${weekNum + 1}) .dhx_cal_month_cell:nth-child(${day + 1})`);\r\n\tif(dayCell) {\r\n\t\treturn dayCell.firstChild;\r\n\t} else {\r\n\t\treturn null;\r\n\t}\r\n};\r\nscheduler.markCalendar = function(cal, date, css) {\r\n\tvar div = this._locateCalendar(cal, date);\r\n\tif(!div)\r\n\t\treturn;\r\n\r\n\tdiv.className += \" \" + css;\r\n};\r\nscheduler.unmarkCalendar = function(cal, date, css) {\r\n\tdate = date || cal._last_date;\r\n\tcss = css || \"dhx_calendar_click\";\r\n\tif (!date) return;\r\n\tvar el = this._locateCalendar(cal, date);\r\n\tif(!el)\r\n\t\treturn;\r\n\tel.className = (el.className || \"\").replace(RegExp(css, \"g\"));\r\n};\r\nscheduler._week_template = function(width) {\r\n\tvar summ = (width || 250);\r\n\tvar left = 0;\r\n\r\n\tvar week_template = document.createElement(\"div\");\r\n\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\tfor (var i = 0; i < 7; i++) {\r\n\t\tthis._cols[i] = Math.floor(summ / (7 - i));\r\n\t\tthis._render_x_header(i, left, dummy_date, week_template);\r\n\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\tsumm -= this._cols[i];\r\n\t\tleft += this._cols[i];\r\n\t}\r\n\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\treturn week_template;\r\n};\r\nscheduler.updateCalendar = function(obj, sd) {\r\n\tobj.conf.date = sd;\r\n\tthis.renderCalendar(obj.conf, obj, true);\r\n};\r\nscheduler._mini_cal_arrows = [\" \", \" \"];\r\nscheduler._render_calendar = function(obj, sd, conf, previous) {\r\n\t/*store*/\r\n\tvar ts = scheduler.templates;\r\n\tvar temp = this._cols;\r\n\tthis._cols = [];\r\n\tvar temp2 = this._mode;\r\n\tthis._mode = \"calendar\";\r\n\tvar temp3 = this._colsS;\r\n\tthis._colsS = {height: 0};\r\n\tvar temp4 = new Date(this._min_date);\r\n\tvar temp5 = new Date(this._max_date);\r\n\tvar temp6 = new Date(scheduler._date);\r\n\tvar temp7 = ts.month_day;\r\n\tvar temp8 = this._ignores_detected; this._ignores_detected = 0;\r\n\tts.month_day = ts.calendar_date;\r\n\r\n\tsd = this.date.month_start(sd);\r\n\tvar week_template = this._week_template(obj.offsetWidth - 1 - this.config.minicalendar.padding );\r\n\r\n\tvar d;\r\n\tif (previous){\r\n\t\td = previous;\r\n\t} else {\r\n\t\td = document.createElement(\"div\");\r\n\t\td.className = \"dhx_cal_container dhx_mini_calendar\";\r\n\t}\r\n\td.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\td.innerHTML = \"
\" +\r\n\t\t\t\"
\" : \"'>\") +\r\n\t\t\t\"
\"+(week_template ? week_template.innerHTML : \"\")+\"
\" +\r\n\t\t\t\"
\" +\r\n\t\t\"
\";\r\n\tvar header = d.querySelector(\".dhx_year_month\");\r\n\tvar weekHeader = d.querySelector(\".dhx_year_week\");\r\n\tvar body = d.querySelector(\".dhx_year_body\");\r\n\r\n\theader.innerHTML = this.templates.calendar_month(sd);\r\n\tif (conf.navigation) {\r\n\t\tvar move_minicalendar_date = function(calendar, diff) {\r\n\t\t\tvar date = scheduler.date.add(calendar._date, diff, \"month\");\r\n\t\t\tscheduler.updateCalendar(calendar, date);\r\n\t\t\tif (scheduler._date.getMonth() == calendar._date.getMonth() && scheduler._date.getFullYear() == calendar._date.getFullYear()) {\r\n\t\t\t\tscheduler._markCalendarCurrentDate(calendar);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar css_classnames = [\"dhx_cal_prev_button\", \"dhx_cal_next_button\"];\r\n\t\tvar css_texts = [\"left:1px;top:4px;position:absolute;\", \"left:auto; right:1px;top:4px;position:absolute;\"];\r\n\t\tvar diffs = [-1, 1];\r\n\t\tvar handler = function(diff) {\r\n\t\t\treturn function() {\t\r\n\t\t\t\tif (conf.sync) {\r\n\t\t\t\t\tvar calendars = scheduler._synced_minicalendars;\r\n\t\t\t\t\tfor (var k = 0; k < calendars.length; k++) {\r\n\t\t\t\t\t\tmove_minicalendar_date(calendars[k], diff);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (scheduler.config.rtl) {\r\n\t\t\t\t\t\tdiff = -diff;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmove_minicalendar_date(d, diff);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t};\r\n\t\tvar labels = [scheduler.locale.labels.prev, scheduler.locale.labels.next];\r\n\t\tfor (var j = 0; j < 2; j++) {\r\n\t\t\tvar arrow = document.createElement(\"div\");\r\n\t\t\t//var diff = diffs[j];\r\n\t\t\tarrow.className = css_classnames[j];\r\n\r\n\t\t\tscheduler._waiAria.headerButtonsAttributes(arrow, labels[j]);\r\n\r\n\t\t\tarrow.style.cssText = css_texts[j];\r\n\t\t\tarrow.innerHTML = this._mini_cal_arrows[j];\r\n\t\t\theader.appendChild(arrow);\r\n\t\t\tminicalDomEvents.attach(arrow, \"click\", handler(diffs[j]));\r\n\t\t}\r\n\t}\r\n\td._date = new Date(sd);\r\n\r\n\td.week_start = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\r\n\tvar dd = d._min_date = this.date.week_start(sd);\r\n\td._max_date = this.date.add(d._min_date, 6, \"week\");\r\n\r\n\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\tif (!previous)\r\n\t\tobj.appendChild(d);\r\n\r\n\tweekHeader.style.height = (weekHeader.childNodes[0].offsetHeight - 1) + \"px\"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name)\r\n\r\n\tvar headerId = scheduler.uid();\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\tscheduler._waiAria.minicalGrid(d.querySelector(\".dhx_year_grid\"), headerId);\r\n\tscheduler._waiAria.minicalRow(weekHeader);\r\n\r\n\tvar dayHeaders = weekHeader.querySelectorAll(\".dhx_scale_bar\");\r\n\tfor(var i = 0; i < dayHeaders.length; i++){\r\n\t\tscheduler._waiAria.minicalHeadCell(dayHeaders[i]);\r\n\t}\r\n\tvar dayCells = body.querySelectorAll(\".dhx_cal_month_cell\");\r\n\tvar firstDate = new Date(dd);\r\n\tfor(var i = 0; i < dayCells.length; i++){\r\n\r\n\t\tscheduler._waiAria.minicalDayCell(dayCells[i], new Date(firstDate));\r\n\t\tfirstDate = scheduler.date.add(firstDate, 1, \"day\");\r\n\t}\r\n\r\n\tscheduler._waiAria.minicalHeader(header, headerId);\r\n\r\n\t/*restore*/\r\n\tthis._cols = temp;\r\n\tthis._mode = temp2;\r\n\tthis._colsS = temp3;\r\n\tthis._min_date = temp4;\r\n\tthis._max_date = temp5;\r\n\tscheduler._date = temp6;\r\n\tts.month_day = temp7;\r\n\tthis._ignores_detected = temp8;\r\n\treturn d;\r\n};\r\nscheduler.destroyCalendar = function(cal, force) {\r\n\tif (!cal && this._def_count && this._def_count.firstChild) {\r\n\t\tif (force || (new Date()).valueOf() - this._def_count._created.valueOf() > 500)\r\n\t\t\tcal = this._def_count.firstChild;\r\n\t}\r\n\tif (!cal) return;\r\n\tminicalDomEvents.detachAll();\r\n\t//cal.onclick = null;\r\n\tcal.innerHTML = \"\";\r\n\tif (cal.parentNode)\r\n\t\tcal.parentNode.removeChild(cal);\r\n\tif (this._def_count)\r\n\t\tthis._def_count.style.top = \"-1000px\";\r\n\r\n\tif(cal.conf && cal.conf._on_xle_handler)\r\n\t\tscheduler.detachEvent(cal.conf._on_xle_handler);\r\n};\r\nscheduler.isCalendarVisible = function() {\r\n\tif (this._def_count && parseInt(this._def_count.style.top, 10) > 0)\r\n\t\treturn this._def_count;\r\n\treturn false;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tscheduler.event(document.body, \"click\", function() { scheduler.destroyCalendar(); });\r\n}, {once: true});\r\n\r\n\r\n\r\nscheduler.form_blocks.calendar_time = {\r\n\trender: function(sns) {\r\n\t\tvar html = \"
\";\r\n\r\n\t\tvar cfg = scheduler.config;\r\n\t\tvar dt = this.date.date_part(scheduler._currentDate());\r\n\r\n\t\tvar last = 24 * 60, first = 0;\r\n\t\tif (cfg.limit_time_select) {\r\n\t\t\tfirst = 60 * cfg.first_hour;\r\n\t\t\tlast = 60 * cfg.last_hour + 1; // to include \"17:00\" option if time select is limited\r\n\t\t}\r\n\t\tdt.setHours(first / 60);\r\n\r\n\t\tsns._time_values = [];\r\n\t\thtml += \"
\";\r\n\t\tfor (var i = first; i < last; i += this.config.time_step * 1) { // `<` to exclude last \"00:00\" option\r\n\t\t\tvar time = this.templates.time_picker(dt);\r\n\t\t\thtml += \"\" + time + \" \";\r\n\t\t\tsns._time_values.push(i);\r\n\t\t\tdt = this.date.add(dt, this.config.time_step, \"minute\");\r\n\t\t}\r\n\t\thtml += \" \";\r\n\r\n\t\t//var full_day = scheduler.config.full_day;\r\n\r\n\t\treturn \"
\" + html + \" – \" + html + \"
\";\r\n\t},\r\n\tset_value: function(node, value, ev, config) {\r\n\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\t\tvar start_date,\r\n\t\t\tend_date;\r\n\r\n\t\tvar _init_once = function(inp, date, number) {\r\n\t\t\tscheduler.event(inp, \"click\", function() {\r\n\t\t\t\tscheduler.destroyCalendar(null, true);\r\n\t\t\t\tscheduler.renderCalendar({\r\n\t\t\t\t\tposition: inp,\r\n\t\t\t\t\tdate: new Date(this._date),\r\n\t\t\t\t\tnavigation: true,\r\n\t\t\t\t\thandler: function(new_date) {\r\n\t\t\t\t\t\tinp.value = scheduler.templates.calendar_time(new_date);\r\n\t\t\t\t\t\tinp._date = new Date(new_date);\r\n\t\t\t\t\t\tscheduler.destroyCalendar();\r\n\t\t\t\t\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date && number === 0) { //first element = start date\r\n\t\t\t\t\t\t\t_update_minical_select();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tif (scheduler.config.full_day) {\r\n\t\t\tif (!node._full_day) {\r\n\t\t\t\tvar html = \"
\" + scheduler.locale.labels.full_day + \" \";\r\n\t\t\t\tif (!scheduler.config.wide_form)\r\n\t\t\t\t\thtml = node.previousSibling.innerHTML + html;\r\n\t\t\t\tnode.previousSibling.innerHTML = html;\r\n\t\t\t\tnode._full_day = true;\r\n\t\t\t}\r\n\t\t\tvar input = node.previousSibling.getElementsByTagName(\"input\")[0];\r\n\r\n\t\t\tvar isFulldayEvent = (scheduler.date.time_part(ev.start_date) === 0 && scheduler.date.time_part(ev.end_date) === 0);\r\n\t\t\tinput.checked = isFulldayEvent;\r\n\r\n\t\t\tselects[0].disabled = input.checked;\r\n\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\tif (!input.$_eventAttached) {\r\n\t\t\t\tinput.$_eventAttached = true;\r\n\t\t\t\tscheduler.event(input, \"click\", function() {\r\n\t\t\t\t\tif (input.checked === true) {\r\n\t\t\t\t\t\tvar obj = {};\r\n\t\t\t\t\t\tscheduler.form_blocks.calendar_time.get_value(node, obj);\r\n\r\n\t\t\t\t\t\tstart_date = scheduler.date.date_part(obj.start_date);\r\n\t\t\t\t\t\tend_date = scheduler.date.date_part(obj.end_date);\r\n\r\n\t\t\t\t\t\tif (+end_date == +start_date || (+end_date >= +start_date && (ev.end_date.getHours() !== 0 || ev.end_date.getMinutes() !== 0)))\r\n\t\t\t\t\t\t\tend_date = scheduler.date.add(end_date, 1, \"day\");\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tstart_date = null;\r\n\t\t\t\t\t\tend_date = null;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar start = start_date || ev.start_date;\r\n\t\t\t\t\tvar end = end_date || ev.end_date;\r\n\t\t\t\t\t_attach_action(inputs[0], start);\r\n\t\t\t\t\t_attach_action(inputs[1], end);\r\n\t\t\t\t\tselects[0].value = start.getHours() * 60 + start.getMinutes();\r\n\t\t\t\t\tselects[1].value = end.getHours() * 60 + end.getMinutes();\r\n\r\n\t\t\t\t\tselects[0].disabled = input.checked;\r\n\t\t\t\t\tselects[1].disabled = input.checked;\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (scheduler.config.event_duration && scheduler.config.auto_end_date) {\r\n\r\n\t\t\tvar _update_minical_select = function () {\r\n\t\t\t\tif (!(scheduler.config.auto_end_date && scheduler.config.event_duration)){\r\n\t\t\t\t\t// setting may be disabled after the handler is attached\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tstart_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\t\t\tend_date = new Date(start_date.getTime() + (scheduler.config.event_duration * 60 * 1000));\r\n\r\n\t\t\t\tinputs[1].value = scheduler.templates.calendar_time(end_date);\r\n\t\t\t\tinputs[1]._date = scheduler.date.date_part(new Date(end_date));\r\n\r\n\t\t\t\tselects[1].value = end_date.getHours() * 60 + end_date.getMinutes();\r\n\t\t\t};\r\n\r\n\t\t\tif(!selects[0].$_eventAttached){\r\n\t\t\t\tselects[0].addEventListener(\"change\", _update_minical_select); // only update on first select should trigger update so user could define other end date if he wishes too\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction _attach_action(inp, date, number) {\r\n\t\t\t_init_once(inp, date, number);\r\n\t\t\tinp.value = scheduler.templates.calendar_time(date);\r\n\t\t\tinp._date = scheduler.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\t_attach_action(inputs[0], ev.start_date, 0);\r\n\t\t_attach_action(inputs[1], ev.end_date, 1);\r\n\t\t_init_once = function() {};\r\n\r\n\t\tfunction _round_minutes(date) {\r\n\t\t\tvar time_values = config._time_values;\r\n\t\t\tvar direct_value = date.getHours() * 60 + date.getMinutes();\r\n\t\t\tvar fixed_value = direct_value;\r\n\t\t\tvar value_found = false;\r\n\r\n\t\t\tfor (var k = 0; k < time_values.length; k++) {\r\n\t\t\t\tvar t_v = time_values[k];\r\n\t\t\t\tif (t_v === direct_value) {\r\n\t\t\t\t\tvalue_found = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (t_v < direct_value)\r\n\t\t\t\t\tfixed_value = t_v;\r\n\t\t\t}\r\n\r\n\t\t\tif(!(value_found || fixed_value))\r\n\t\t\t\treturn -1;\r\n\r\n\t\t\treturn (value_found) ? direct_value : fixed_value;\r\n\t\t}\r\n\r\n\t\tselects[0].value = _round_minutes(ev.start_date);\r\n\t\tselects[1].value = _round_minutes(ev.end_date);\r\n\r\n\t},\r\n\tget_value: function(node, ev) {\r\n\t\tvar inputs = node.getElementsByTagName(\"input\");\r\n\t\tvar selects = node.getElementsByTagName(\"select\");\r\n\r\n\t\tev.start_date = scheduler.date.add(inputs[0]._date, selects[0].value, \"minute\");\r\n\t\tev.end_date = scheduler.date.add(inputs[1]._date, selects[1].value, \"minute\");\r\n\r\n\t\tif (ev.end_date <= ev.start_date)\r\n\t\t\tev.end_date = scheduler.date.add(ev.start_date, scheduler.config.time_step, \"minute\");\r\n\t\treturn {\r\n\t\t\tstart_date: new Date(ev.start_date),\r\n\t\t\tend_date: new Date(ev.end_date)\r\n\t\t};\r\n\t},\r\n\tfocus: function(node) {\r\n\t}\r\n};\r\nscheduler.linkCalendar = function(calendar, datediff) {\r\n\tvar action = function() {\r\n\t\tvar date = scheduler._date;\r\n\t\tvar dateNew = new Date(date.valueOf());\r\n\t\tif (datediff) dateNew = datediff(dateNew);\r\n\t\tdateNew.setDate(1);\r\n\t\tscheduler.updateCalendar(calendar, dateNew);\r\n\t\treturn true;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onViewChange\", action);\r\n\tscheduler.attachEvent(\"onXLE\", action);\r\n\tscheduler.attachEvent(\"onEventAdded\", action);\r\n\tscheduler.attachEvent(\"onEventChanged\", action);\r\n\tscheduler.attachEvent(\"onEventDeleted\", action);\r\n\taction();\r\n};\r\n\r\nscheduler._markCalendarCurrentDate = function(calendar) {\r\n\tvar state = scheduler.getState();\r\n\tvar from = state.min_date;\r\n\tvar to = state.max_date;\r\n\tvar mode = state.mode;\r\n\r\n\tvar month_start = scheduler.date.month_start(new Date(calendar._date));\r\n\tvar month_end = scheduler.date.add(month_start, 1, \"month\");\r\n\r\n\tvar noHighlight = {\r\n\t\t\"month\":true,\r\n\t\t\"year\":true,\r\n\t\t\"agenda\":true,\r\n\t\t\"grid\":true\r\n\t};\r\n\t// no need to highlight current dates for a large range views - agenda, year, etc.\r\n\tif(noHighlight[mode] || (from.valueOf() <= month_start.valueOf() && to.valueOf() >= month_end.valueOf())){\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar current = from;\r\n\twhile(current.valueOf() < to.valueOf()){\r\n\t\tif (month_start.valueOf() <= current.valueOf() && month_end > current) {\r\n\t\t\tscheduler.markCalendar(calendar, current, \"dhx_calendar_click\");\r\n\t\t}\r\n\t\tcurrent = scheduler.date.add(current, 1, \"day\");\r\n\t}\r\n};\r\n\r\nscheduler.attachEvent(\"onEventCancel\", function(){\r\n\tscheduler.destroyCalendar(null, true);\r\n});\r\n\r\nscheduler.attachEvent(\"onDestroy\", function(){\r\n\tscheduler.destroyCalendar();\r\n});\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\",function(){\r\n\tscheduler.xy.scroll_width = 0;\r\n\r\n\tvar old = scheduler.render_view_data;\r\n\tscheduler.render_view_data=function(){\r\n\t\tvar data = this._els[\"dhx_cal_data\"][0];\r\n\t\tdata.firstChild._h_fix = true;\r\n\r\n\t\told.apply(scheduler,arguments);\r\n\r\n\r\n\r\n\t\tvar height = parseInt(data.style.height);\r\n\t\tdata.style.height=\"1px\";\r\n\t\tdata.style.height=data.scrollHeight+\"px\";\r\n\r\n\t\tthis._obj.style.height = this._obj.clientHeight + data.scrollHeight - height + \"px\";\r\n\t};\r\n\r\n\tvar old_s=scheduler._reset_month_scale;\r\n\tscheduler._reset_month_scale=function(a,b,c,d){\r\n\t\tvar dummy = {clientHeight:100};\r\n\t\told_s.apply(scheduler,[dummy,b,c,d]);\r\n\t\ta.innerHTML = dummy.innerHTML;\r\n\t};\r\n\r\n});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Multisection\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\n\r\nfunction parseXMLOptions(loader, config){\r\n\tvar items = scheduler.ajax.xpath(\"//data/item\", loader.xmlDoc);\r\n\tvar ids = {};\r\n\tfor (var i = 0; i < items.length; i++) {\r\n\t\tids[items[i].getAttribute(config.map_to)] = true;\r\n\t}\r\n\treturn ids;\r\n}\r\n\r\nfunction parseJSONOptions(loader, config){\r\n\ttry{\r\n\t\tvar items = JSON.parse(loader.xmlDoc.responseText);\r\n\t\tvar ids = {};\r\n\t\tfor (var i = 0; i < items.length; i++) {\r\n\t\t\tvar option = items[i];\r\n\r\n\t\t\tids[option.value || option.key || option.id] = true;\r\n\t\t}\r\n\t\treturn ids;\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nscheduler.form_blocks[\"multiselect\"]={\r\n\trender:function(sns) {\r\n\t\tvar css = \"dhx_multi_select_control dhx_multi_select_\"+sns.name;\r\n\t\tif(!!sns.vertical){\r\n\t\t\tcss += \" dhx_multi_select_control_vertical\";\r\n\t\t}\r\n\r\n\t\tvar _result = \"
\";\r\n\t\tfor (var i=0; i \"+sns.options[i].label+\"\";\r\n\t\t}\r\n\t\t_result += \"
\";\r\n\t\treturn _result;\r\n\t},\r\n\tset_value:function(node,value,ev,config){\r\n\r\n\t\tvar _children = node.getElementsByTagName('input');\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\t_children[i].checked = false; //unchecking all inputs on the form\r\n\t\t}\r\n\r\n\t\tfunction _mark_inputs(ids) { // ids = [ 0: undefined, 1: undefined, 2: true, 'custom_name': false ... ]\r\n\t\t\tvar _children = node.getElementsByTagName('input');\r\n\t\t\tfor(var i=0;i<_children.length; i++) {\r\n\t\t\t\t_children[i].checked = !! ids[_children[i].value];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar _ids = {};\r\n\t\tif (ev[config.map_to]) {\r\n\t\t\tvar results = (ev[config.map_to] + \"\").split(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t\t\tfor (var i = 0; i < results.length; i++) {\r\n\t\t\t\t_ids[results[i]] = true;\r\n\t\t\t}\r\n\t\t\t_mark_inputs(_ids);\r\n\t\t} else {\r\n\t\t\tif (scheduler._new_event || !config.script_url)\r\n\t\t\t\treturn;\r\n\t\t\tvar divLoading = document.createElement('div');\r\n\t\t\tdivLoading.className = 'dhx_loading';\r\n\t\t\tdivLoading.style.cssText = \"position: absolute; top: 40%; left: 40%;\";\r\n\t\t\tnode.appendChild(divLoading);\r\n\r\n\t\t\tvar url = [\r\n\t\t\t\tconfig.script_url,\r\n\t\t\t\t(config.script_url.indexOf(\"?\") == -1 ? \"?\" : \"&\"),\r\n\t\t\t\t'dhx_crosslink_' + config.map_to + '=' + ev.id + '&uid=' + scheduler.uid()\r\n\t\t\t].join(\"\");\r\n\r\n\t\t\tscheduler.ajax.get(url, function(loader) {\r\n\t\t\t\tvar options = parseJSONOptions(loader, config);\r\n\t\t\t\tif(!options){\r\n\t\t\t\t\toptions = parseXMLOptions(loader, config);\r\n\t\t\t\t}\r\n\t\t\t\t_mark_inputs(options);\r\n\t\t\t\tnode.removeChild(divLoading);\r\n\t\t\t});\r\n\t\t}\r\n\t},\r\n\tget_value:function(node,ev,config){\r\n\t\tvar _result = [];\r\n\t\tvar _children = node.getElementsByTagName(\"input\");\r\n\t\tfor(var i=0;i<_children.length;i++) {\r\n\t\t\tif(_children[i].checked)\r\n\t\t\t\t_result.push(_children[i].value);\r\n\t\t}\r\n\t\treturn _result.join(config.delimiter || scheduler.config.section_delimiter || \",\");\r\n\t},\r\n\r\n\tfocus:function(node){\r\n\t}\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\r\n\tfunction backup(obj){\r\n\t\tvar t = function(){};\r\n\t\tt.prototype = obj;\r\n\t\treturn t;\r\n\t}\r\n\r\n\tvar old = scheduler._load;\r\n\tscheduler._load=function(url,from){\r\n\t\turl=url||this._load_url;\r\n\t\tif (typeof url == \"object\"){\r\n\t\t\tvar t = backup(this._loaded);\r\n\t\t\tfor (var i=0; i < url.length; i++) {\r\n\t\t\t\tthis._loaded=new t();\r\n\t\t\t\told.call(this,url[i],from);\r\n\t\t\t}\r\n\t\t} else\r\n\t\t\told.apply(this,arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\t/* global Backbone */\r\n\tvar cfg = {\r\n\t\tuse_id : false\r\n\t};\r\n\r\n\t//remove private properties\r\n\tfunction sanitize(ev){\r\n\t\tvar obj = {};\r\n\t\tfor (var key in ev)\r\n\t\t\tif (key.indexOf(\"_\") !== 0)\r\n\t\t\t\tobj[key] = ev[key];\r\n\r\n\t\tif (!cfg.use_id)\r\n\t\t\tdelete obj.id;\r\n\r\n\t\treturn obj;\r\n\t}\r\n\r\n\tvar update_timer;\r\n\tfunction update_view(){\r\n\t\tclearTimeout(update_timer);\r\n\t\tupdate_timer = setTimeout(function(){\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.updateView();\r\n\t\t},1);\r\n\t}\r\n\r\n\tfunction _start_ext_load(cal){\r\n\t\tcal._loading = true;\r\n\t\tcal._not_render = true;\r\n\r\n\t\tcal.callEvent(\"onXLS\", []);\r\n\t}\r\n\tfunction _finish_ext_load(cal){\r\n\t\tcal._not_render = false;\r\n\t\tif (cal._render_wait)\r\n\t\t\tcal.render_view_data();\r\n\t\tcal._loading = false;\r\n\r\n\t\tcal.callEvent(\"onXLE\", []);\r\n\t}\r\n\r\n\r\n\tfunction _get_id(model){\r\n\t\treturn cfg.use_id ? model.id : model.cid;\r\n\t}\r\n\r\nscheduler.backbone = function(events, config){\r\n\tif (config) cfg = config;\r\n\r\n\tevents.bind(\"change\", function(model, info){\r\n\t\tvar cid = _get_id(model);\r\n\t\tvar ev = scheduler._events[cid] = model.toJSON();\r\n\t\tev.id = cid;\r\n\r\n\t\tscheduler._init_event(ev);\r\n\t\tupdate_view();\r\n\t});\r\n\tevents.bind(\"remove\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (scheduler._events[cid])\r\n\t\t\tscheduler.deleteEvent(cid);\r\n\t});\r\n\r\n\tvar queue = [];\r\n\tfunction add_from_queue(){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tif (queue.length){\r\n\t\t\tscheduler.parse(queue, \"json\");\r\n\t\t\tqueue = [];\r\n\t\t}\r\n\t}\r\n\r\n\tevents.bind(\"add\", function(model, changes){\r\n\t\tvar cid = _get_id(model);\r\n\t\tif (!scheduler._events[cid]){\r\n\t\t\tvar ev = model.toJSON();\r\n\t\t\tev.id = cid;\r\n\t\t\tscheduler._init_event(ev);\r\n\r\n\t\t\tqueue.push(ev);\r\n\t\t\tif (queue.length == 1)\r\n\t\t\t\tsetTimeout(add_from_queue,1);\r\n\t\t}\r\n\t});\r\n\r\n\tevents.bind(\"request\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_start_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"sync\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\tevents.bind(\"error\", function(obj){\r\n\t\tif (obj instanceof Backbone.Collection)\r\n\t\t\t_finish_ext_load(scheduler);\r\n\t});\r\n\r\n\r\n\tscheduler.attachEvent(\"onEventCreated\", function(id){\r\n\t\tvar ev = new events.model(scheduler.getEvent(id));\r\n\t\tscheduler._events[id] = ev.toJSON();\r\n\t\tscheduler._events[id].id = id;\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventAdded\", function(id){\r\n\t\tif (!events.get(id)){\r\n\t\t\tvar data = sanitize(scheduler.getEvent(id));\r\n\t\t\tvar model = new events.model(data);\r\n\r\n\t\t\tvar cid = _get_id(model);\r\n\t\t\tif (cid != id)\r\n\t\t\t\tthis.changeEventId(id, cid);\r\n\t\t\tevents.add(model);\r\n\t\t\tevents.trigger(\"scheduler:add\", model);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function(id){\r\n\t\tvar ev = events.get(id);\r\n\t\tvar upd = sanitize(scheduler.getEvent(id));\r\n\r\n\t\tev.set(upd);\r\n\t\tevents.trigger(\"scheduler:change\", ev);\r\n\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function(id){\r\n\t\tvar model = events.get(id);\r\n\t\tif (model){\r\n\t\t\tevents.trigger(\"scheduler:remove\", model);\r\n\t\t\tevents.remove(id);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t/* global dhtmlDragAndDropObject, dhtmlx */\r\n// lame old code doesn't provide raw event object\r\n\tscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\t\tvar dragger = (new dhtmlDragAndDropObject());\r\n\t\tvar old = dragger.stopDrag;\r\n\t\tvar last_event;\r\n\t\tdragger.stopDrag = function(e) {\r\n\t\t\tlast_event = e;\r\n\t\t\treturn old.apply(this, arguments);\r\n\t\t};\r\n\r\n\t\tfunction on_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\r\n\t\t\tif (scheduler.checkEvent(\"onBeforeExternalDragIn\") && !scheduler.callEvent(\"onBeforeExternalDragIn\", [sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml, last_event]))\r\n\t\t\t\treturn;\r\n\r\n\t\t\tvar temp = scheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\t\t\tif (!scheduler.callEvent(\"onExternalDragIn\", [id, sourceHtmlObject, last_event])) {\r\n\t\t\t\t\tthis._drag_mode = this._drag_id = null;\r\n\t\t\t\t\tthis.deleteEvent(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tvar action_data = scheduler.getActionData(last_event);\r\n\t\t\tvar event_data = {\r\n\t\t\t\tstart_date: new Date(action_data.date)\r\n\t\t\t};\r\n\r\n\t\t\t// custom views, need to assign section id, fix dates\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\tvar view_options = scheduler.matrix[scheduler._mode];\r\n\t\t\t\tevent_data[view_options.y_property] = action_data.section;\r\n\r\n\t\t\t\tvar pos = scheduler._locate_cell_timeline(last_event);\r\n\t\t\t\tevent_data.start_date = view_options._trace_x[pos.x];\r\n\t\t\t\tevent_data.end_date = scheduler.date.add(event_data.start_date, view_options.x_step, view_options.x_unit);\r\n\t\t\t}\r\n\t\t\tif (scheduler._props && scheduler._props[scheduler._mode]) {\r\n\t\t\t\tevent_data[scheduler._props[scheduler._mode].map_to] = action_data.section;\r\n\t\t\t}\r\n\r\n\t\t\tscheduler.addEventNow(event_data);\r\n\r\n\t\t\tscheduler.detachEvent(temp);\r\n\t\t}\r\n\r\n\t\tdragger.addDragLanding(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t_drag: function(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml) {\r\n\t\t\t\ton_drop(sourceHtmlObject, dhtmlObject, targetHtmlObject, targetHtml);\r\n\t\t\t},\r\n\t\t\t_dragIn: function(htmlObject, shtmlObject) {\r\n\t\t\t\treturn htmlObject;\r\n\t\t\t},\r\n\t\t\t_dragOut: function(htmlObject) {\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(dhtmlx.DragControl) {\r\n\t\t\tdhtmlx.DragControl.addDrop(scheduler._els[\"dhx_cal_data\"][0], {\r\n\t\t\t\tonDrop: function (source, target, d, e) {\r\n\t\t\t\t\tvar sourceDhtmlx = dhtmlx.DragControl.getMaster(source);\r\n\t\t\t\t\tlast_event = e;\r\n\t\t\t\t\ton_drop(source, sourceDhtmlx, target, e.target || e.srcElement);\r\n\t\t\t\t},\r\n\r\n\t\t\t\tonDragIn: function (source, target, e) {\r\n\t\t\t\t\treturn target;\r\n\t\t\t\t}\r\n\t\t\t}, true);\r\n\t\t}\r\n\t});\r\n\r\n}","export default function(scheduler){\r\n\r\n\tvar dx, dy,\r\n\t\thtml_regexp = new RegExp(\"<[^>]*>\", \"g\"),\r\n\t\tnewline_regexp = new RegExp(\"
]*>\", \"g\");\r\n\r\n\tfunction clean_html(val) {\r\n\t\treturn val.replace(newline_regexp, \"\\n\").replace(html_regexp, \"\");\r\n\t}\r\n\r\n\tfunction x_norm(x, offset) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset)) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx));\r\n\t}\r\n\r\n\tfunction x_norm_event(x, offset, is_left) {\r\n\t\tx = parseFloat(x);\r\n\t\toffset = parseFloat(offset);\r\n\t\tif (!isNaN(offset) && is_left) x -= offset;\r\n\r\n\t\tvar w = colsWidth(x);\r\n\t\tx = x - w.width + w.cols*dx;\r\n\t\treturn isNaN(x)?\"auto\":(100*x/(dx-(!isNaN(offset)?offset:0)));\r\n\t}\r\n\tfunction colsWidth(width) {\r\n\t\tvar r = 0;\r\n\t\tvar header = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\tvar els = header[1] ? header[1].childNodes : header[0].childNodes;\r\n\t\tfor (var i = 0; i < els.length; i++) {\r\n\t\t\tvar el = els[i].style ? els[i] : els[i].parentNode;\r\n\t\t\tvar w = parseFloat(el.style.width);\r\n\t\t\tif (width > w){\r\n\t\t\t\twidth -= (w+1);\r\n\t\t\t\tr+=(w+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\treturn { width: r, cols: i };\r\n\t}\r\n\r\n\tfunction y_norm(y) {\r\n\t\ty = parseFloat(y);\r\n\t\tif (isNaN(y)) return \"auto\";\r\n\t\treturn 100 * y / dy;\r\n\t}\r\n\r\n\tfunction get_style(node, style){\r\n\t\treturn (window.getComputedStyle?(window.getComputedStyle(node, null)[style]):(node.currentStyle?node.currentStyle[style]:null))||\"\";\r\n\t}\r\n\r\n\tfunction de_day(node, n) {\r\n\t\tvar x = parseInt(node.style.left, 10);\r\n\r\n\t\tfor (var dx = 0; dx < scheduler._cols.length; dx++) {\r\n\t\t\tx -= scheduler._cols[dx];\r\n\t\t\tif (x < 0) return dx;\r\n\t\t}\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction de_week(node, n) {\r\n\t\tvar y = parseInt(node.style.top, 10);\r\n\t\tfor (var dy = 0; dy < scheduler._colsS.heights.length; dy++)\r\n\t\t\tif (scheduler._colsS.heights[dy] > y) return dy;\r\n\t\treturn n;\r\n\t}\r\n\r\n\tfunction xml_start(tag) {\r\n\t\treturn tag ? \"<\"+tag+\">\" : \"\";\r\n\t}\r\n\tfunction xml_end(tag) {\r\n\t\treturn tag ? \"\"+tag+\">\" : \"\";\r\n\t}\r\n\r\n\tfunction xml_top(tag, profile, header, footer) {\r\n\t\tvar xml = \"<\"+tag+\" profile='\" + profile + \"'\";\r\n\t\tif (header)\r\n\t\t\txml += \" header='\" + header + \"'\";\r\n\t\tif (footer)\r\n\t\t\txml += \" footer='\" + footer + \"'\";\r\n\t\txml += \">\";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body_header() {\r\n\t\tvar xml = \"\";\r\n\t\t// detects if current mode is timeline\r\n\t\tvar mode = scheduler._mode;\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode])\r\n\t\t\tmode = (scheduler.matrix[scheduler._mode].render == \"cell\") ? \"matrix\" : \"timeline\";\r\n\t\txml += \"
\";\r\n\r\n\t\tif (scheduler._mode == \"week_agenda\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"DIV\");\r\n\t\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\t\tif (xh[i].className == \"dhx_wa_scale_bar\")\r\n\t\t\t\t\txml += \"\" + clean_html(xh[i].innerHTML) + \" \";\r\n\t\t} else if (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes[0].childNodes;\r\n\r\n\t\t\txml += \"\" + clean_html(xh[0].innerHTML) + \" \" + clean_html(xh[1].innerHTML) + \" \";\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\t\t\tvar xh = scheduler._els.dhx_cal_data[0].childNodes;\r\n\t\t\tfor (var i = 0; i < xh.length; i++) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\txml += xml_month_scale(xh[i].querySelector(\".dhx_year_week\").childNodes);\r\n\t\t\t\txml += xml_month(xh[i].querySelector(\".dhx_year_body\"));\r\n\t\t\t\txml += \" \";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\txml += \"\";\r\n\t\t\tvar xh = scheduler._els.dhx_cal_header[0].childNodes;\r\n\t\t\txml += xml_month_scale(xh);\r\n\t\t\txml += \" \";\r\n\r\n\t\t\tvar yh = scheduler._els.dhx_cal_data[0];\r\n\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.firstChild.rows.length; i++) {\r\n\t\t\t\t\tvar el = yh.firstChild.rows[i];\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \" \";\r\n\t\t\t\tdy = yh.firstChild.rows[0].cells[0].offsetHeight;\r\n\t\t\t} else if (yh.firstChild.tagName == \"TABLE\") {\r\n\t\t\t\txml += xml_month(yh);\r\n\t\t\t} else {\r\n\t\t\t\tyh = yh.childNodes[yh.childNodes.length - 1];\r\n\t\t\t\twhile (yh.className.indexOf(\"dhx_scale_holder\") == -1)\r\n\t\t\t\t\tyh = yh.previousSibling;\r\n\t\t\t\tyh = yh.childNodes;\r\n\r\n\t\t\t\txml += \"\";\r\n\t\t\t\tfor (var i = 0; i < yh.length; i++)\r\n\t\t\t\t\txml += \"\\n
\";\r\n\t\t\t\txml += \" \";\r\n\t\t\t\tdy = yh[0].offsetHeight;\r\n\t\t\t}\r\n\t\t}\r\n\t\txml += \" \";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month(yh) {\r\n\t\tvar xml = \"\";\r\n\t\tvar r = yh.querySelectorAll(\"tr\");\r\n\t\tfor (var i = 0; i < r.length; i++) {\r\n\t\t\tvar days = [];\r\n\t\t\tvar cells = r[i].querySelectorAll(\"td\");\r\n\r\n\t\t\tfor (var j = 0; j < cells.length; j++)\r\n\t\t\t\tdays.push(cells[j].querySelector(\".dhx_month_head\").innerHTML);\r\n\r\n\t\t\txml += \"\\n
|
\";\r\n\t\t\tdy = cells[0].offsetHeight;\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_month_scale(xh) {\r\n\t\tvar xhs,\r\n\t\t\txml = \"\";\r\n\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\tif (scheduler.matrix[scheduler._mode].second_scale)\r\n\t\t\t\txhs = xh[1].childNodes;\r\n\r\n\t\t\txh = xh[0].childNodes;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < xh.length; i++)\r\n\t\t\txml += \"\\n
\";\r\n\t\tdx = xh[0].offsetWidth;\r\n\r\n\t\tif (xhs) {\r\n\t\t\tvar width = 0;\r\n\t\t\tvar top_width = xh[0].offsetWidth;\r\n\t\t\tvar top_col = 1;\r\n\t\t\tfor (var i = 0; i < xhs.length; i++) {\r\n\t\t\t\txml += \"\\n
\";\r\n\t\t\t\twidth += xhs[i].offsetWidth;\r\n\t\t\t\tif (width >= top_width) {\r\n\t\t\t\t\ttop_width += (xh[top_col] ? xh[top_col].offsetWidth : 0);\r\n\t\t\t\t\ttop_col++;\r\n\t\t\t\t}\r\n\t\t\t\tdx = xhs[0].offsetWidth;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction xml_body(colors) {\r\n\t\tvar xml = \"\";\r\n\t\tvar evs = scheduler._rendered;\r\n\t\tvar matrix = scheduler.matrix && scheduler.matrix[scheduler._mode];\r\n\r\n\t\tif (scheduler._mode == \"agenda\" || scheduler._mode == \"map\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n xml += \"
\";\r\n\r\n\t\t} else if (scheduler._mode == \"week_agenda\") {\r\n\r\n\t\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\t\txml += \"
\" + clean_html(evs[i].innerHTML) + \" \";\r\n\r\n\t\t} else if (scheduler._mode == \"year\") {\r\n\r\n\t\t\tvar evs = scheduler.get_visible_events();\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar d = evs[i].start_date;\r\n\t\t\t\tif (d.valueOf() < scheduler._min_date.valueOf())\r\n\t\t\t\t\td = scheduler._min_date;\r\n\r\n\t\t\t\twhile (d < evs[i].end_date) {\r\n\t\t\t\t\tvar m = d.getMonth() + 12 * (d.getFullYear() - scheduler._min_date.getFullYear()) - scheduler.week_starts._month;\r\n\t\t\t\t\tvar day = scheduler.week_starts[m] + d.getDate() - 1;\r\n\t\t\t\t\tvar text_color = colors ? get_style(scheduler._get_year_cell(d), \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(scheduler._get_year_cell(d), \"backgroundColor\") : \"\";\r\n\r\n\t\t\t\t\txml += \"
\";\r\n\t\t\t\t\td = scheduler.date.add(d, 1, \"day\");\r\n\t\t\t\t\tif (d.valueOf() >= scheduler._max_date.valueOf())\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (matrix && matrix.render == \"cell\") {\r\n\t\t\tvar evs = scheduler._els.dhx_cal_data[0].getElementsByTagName(\"TD\");\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\txml += \"\\n
\";\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\t\tvar zx, zdx;\r\n\t\t\t\tif (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\t// logic for timeline view\r\n\t\t\t\t\tzx = x_norm(evs[i].style.left);\r\n\t\t\t\t\tzdx = x_norm(evs[i].offsetWidth)-1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we should use specific logic for day/week/units view\r\n\t\t\t\t\tvar left_norm = scheduler.config.use_select_menu_space ? 0 : 26;\r\n\t\t\t\t\tzx = x_norm_event(evs[i].style.left, left_norm, true);\r\n\t\t\t\t\tzdx = x_norm_event(evs[i].style.width, left_norm)-1;\r\n\t\t\t\t}\r\n\t\t\t\tif (isNaN(zdx * 1)) continue;\r\n\t\t\t\tvar zy = y_norm(evs[i].style.top);\r\n\t\t\t\tvar zdy = y_norm(evs[i].style.height);\r\n\r\n\t\t\t\tvar e_type = evs[i].className.split(\" \")[0].replace(\"dhx_cal_\", \"\");\r\n\t\t\t\tif (e_type === 'dhx_tooltip_line') continue;\r\n\r\n\t\t\t\tvar dets = scheduler.getEvent(evs[i].getAttribute(scheduler.config.event_attribute));\r\n if (!dets) continue;\r\n\t\t\t\tvar day = dets._sday;\r\n\t\t\t\tvar week = dets._sweek;\r\n\t\t\t\tvar length = dets._length || 0;\r\n\r\n\t\t\t\tif (scheduler._mode == \"month\") {\r\n\t\t\t\t\tzdy = parseInt(evs[i].offsetHeight, 10);\r\n\t\t\t\t\tzy = parseInt(evs[i].style.top, 10) - scheduler.xy.month_head_height;\r\n\r\n\t\t\t\t\tday = de_day(evs[i], day);\r\n\t\t\t\t\tweek = de_week(evs[i], week);\r\n\t\t\t\t} else if (scheduler.matrix && scheduler.matrix[scheduler._mode]) {\r\n\t\t\t\t\tday = 0;\r\n\t\t\t\t\tvar el = evs[i].parentNode.parentNode.parentNode;\r\n\t\t\t\t\tweek = el.rowIndex;\r\n\t\t\t\t\tvar dy_copy = dy;\r\n\t\t\t\t\tdy = evs[i].parentNode.offsetHeight;\r\n\t\t\t\t\tzy = y_norm(evs[i].style.top);\r\n\t\t\t\t\tzy -= zy * 0.2;\r\n\t\t\t\t\tdy = dy_copy;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (evs[i].parentNode == scheduler._els.dhx_cal_data[0]) continue;\r\n\t\t\t\t\tvar parent = scheduler._els[\"dhx_cal_data\"][0].childNodes[0];\r\n\t\t\t\t\tvar offset = parseFloat(parent.className.indexOf(\"dhx_scale_holder\") != -1 ? parent.style.left : 0);\r\n\t\t\t\t\tzx += x_norm(evs[i].parentNode.style.left, offset);\r\n\t\t\t\t}\r\n\r\n\t\t\t\txml += \"\\n
\";\r\n\r\n\t\t\t\tif (e_type == \"event\") {\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i].childNodes[2], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i].childNodes[2], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar text_color = colors ? get_style(evs[i], \"color\") : \"\";\r\n\t\t\t\t\tvar bg_color = colors ? get_style(evs[i], \"backgroundColor\") : \"\";\r\n\t\t\t\t\txml += \"\";\r\n\t\t\t\t}\r\n\t\t\t\txml += \" \";\r\n\t\t\t}\r\n\t\t\t}\r\n\r\n\t\treturn xml;\r\n\t}\r\n\r\n\tfunction toXML(start, end, view, mode, header, footer){\r\n\t\tvar colors = false;\r\n\t\tif (mode == \"fullcolor\") {\r\n\t\t\tcolors = true;\r\n\t\t\tmode = \"color\";\r\n\t\t}\r\n\r\n\t\tmode = mode || \"color\";\r\n\r\n\t\tvar xml = \"\";\r\n\t\tif (start) {\r\n\r\n\t\t\tvar original_date = scheduler._date;\r\n\t\t\tvar original_mode = scheduler._mode;\r\n\t\t\tend = scheduler.date[view+\"_start\"](end);\r\n\t\t\tend = scheduler.date[\"get_\"+view+\"_end\"] ? scheduler.date[\"get_\"+view+\"_end\"](end) : scheduler.date.add(end, 1, view);\r\n\r\n\t\t\txml = xml_top(\"pages\", mode, header, footer);\r\n\t\t\tfor (var temp_date = new Date(start); +temp_date < +end; temp_date = this.date.add(temp_date, 1, view)) {\r\n\t\t\t\tthis.setCurrentView(temp_date, view);\r\n\t\t\t\txml += xml_start(\"page\") + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"page\");\r\n\t\t\t}\r\n\t\t\txml += xml_end(\"pages\");\r\n\r\n\t\t\tthis.setCurrentView(original_date, original_mode);\r\n\t\t} else {\r\n\t\t\txml = xml_top(\"data\", mode, header, footer) + xml_body_header().replace(\"\\u2013\", \"-\") + xml_body(colors) + xml_end(\"data\");\r\n\t\t}\r\n\t\treturn xml;\r\n\t}\r\n\tscheduler.getPDFData = toXML;\r\n\tfunction send_xml(xml, url){\r\n\t\tvar uid = scheduler.uid();\r\n\t\tvar d = document.createElement(\"div\");\r\n\t\td.style.display = \"none\";\r\n\t\tdocument.body.appendChild(d);\r\n\r\n\t\td.innerHTML = '
';\r\n\t\tdocument.getElementById(uid).firstChild.value = encodeURIComponent(xml);\r\n\t\tdocument.getElementById(uid).submit();\r\n\t\td.parentNode.removeChild(d);\r\n\t}\r\n\r\n\tfunction to_pdf(start, end, view, url, mode, header, footer) {\r\n\t\tvar xml = \"\";\r\n\t\tif(typeof mode == \"object\"){\r\n\t\t\txml = schedulersToPdf(mode);\r\n\t\t}else{\r\n\t\t\txml = toXML.apply(this, [start, end, view, mode, header, footer]);\r\n\t\t}\r\n\r\n\t\tsend_xml(xml, url);\r\n\t}\r\n\r\n\tfunction schedulersToPdf(objects){\r\n\t\tvar xml = \"
\";\r\n\t\tfor(var i=0; i < objects.length; i++){\r\n\t\t\txml += objects[i].source.getPDFData(objects[i].start, objects[i].end, objects[i].view, objects[i].mode, objects[i].header, objects[i].footer);\r\n\t\t}\r\n\t\txml += \" \";\r\n\t\treturn xml;\r\n\t}\r\n\r\n\t/*\r\n\t * scheduler.toPDF(url, mode, header, footer) - for a single scheduler\r\n\t * scheduler.toPDF(url, [scheduler1, scheduler2,...]) - for multiple schedulers\r\n\t * example:\r\n\t * scheduler.toPDF(\"generate.ashx\", [\r\n\t * { source: scheduler1, mode: \"color\" },\r\n\t * { source: scheduler2, mode: \"gray\", view:\"week\", start:new Date(2013, 06, 1), end:new Date(2013, 06, 28) },\r\n\t * { source: scheduler3 }\r\n\t * ]);\r\n\t *\r\n\t */\r\n\tscheduler.toPDF = function(url, mode, header, footer) {\r\n\t\treturn to_pdf.apply(this, [null, null, null, url, mode, header, footer]);\r\n\t};\r\n\tscheduler.toPDFRange = function(start, end, view, url, mode, header, footer) {\r\n\t\tif (typeof start == \"string\") {\r\n\t\t\tstart = scheduler.templates.api_date(start);\r\n\t\t\tend = scheduler.templates.api_date(end);\r\n\t\t}\r\n\r\n\t\treturn to_pdf.apply(this, arguments);\r\n\t};\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.icons_select = [\"icon_form\", \"icon_delete\"];\r\nscheduler.config.details_on_create = true;\r\nscheduler.config.show_quick_info = true;\r\nscheduler.xy.menu_width = 0;\r\n\r\n\r\n\r\nlet clickedElementPosition = null;\r\nscheduler.attachEvent(\"onSchedulerReady\", function(){\r\n\tconst container = scheduler.$container;\r\n\tif(container._$quickInfoHandler){\r\n\t\treturn;\r\n\t}else{\r\n\t\tcontainer._$quickInfoHandler = true;\r\n\t\t// store coordinates of clicked segment of an event\r\n\t\t// in case multi section events or multi-line month events\r\n\t\tscheduler.event(container, \"mousedown\", function(e){\r\n\t\t\tconst eventElement = e.target.closest(`[${scheduler.config.event_attribute}]`);\r\n\t\t\tif (eventElement) {\r\n\t\t\t\tclickedElementPosition = {\r\n\t\t\t\t\tid: eventElement.getAttribute(scheduler.config.event_attribute),\r\n\t\t\t\t\tposition: getPositionInsideScheduler(eventElement)\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t});\r\n\t\tscheduler.attachEvent(\"onDestroy\", () => {\r\n\t\t\tdelete container._$quickInfoHandler;\r\n\t\t});\r\n\t}\r\n});\r\n\r\nscheduler.attachEvent(\"onClick\", function(id){\r\n\tif(!scheduler.config.show_quick_info){\r\n\t\treturn;\r\n\t}\r\n\tscheduler.showQuickInfo(id);\r\n\treturn true;\r\n});\r\n\r\n(function(){\r\n\t// pass `force` argument in order to hide quick info synchronously\r\n\t// so it won't affect showQuickInfo call that can follow\r\n\tvar events = [\"onEmptyClick\", \"onViewChange\", \"onLightbox\", \"onBeforeEventDelete\", \"onBeforeDrag\"];\r\n\tvar hiding_function = function(){\r\n\t\tscheduler.hideQuickInfo(true);\r\n\t\treturn true;\r\n\t};\r\n\tfor (var i=0; i
window.innerWidth){\r\n\t\t\tleft = window.innerWidth - width;\r\n\t\t}\r\n\t\tleft = Math.max(0, left);\r\n\r\n\t\tqi.style.left = left + \"px\";\r\n\t\tqi.style.top = pos.top - (pos.dy?height:-pos.height) + \"px\";\r\n\t} else {\r\n\r\n\t\tconst dataPos = scheduler.$container.querySelector('.dhx_cal_data').offsetTop;\r\n\t\tqi.style.top = dataPos + 20 + \"px\";\r\n\t\tif (pos.dx == 1){\r\n\t\t\tqi.style.right = \"auto\";\r\n\t\t\tqi.style.left = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.left = \"-10px\";\r\n\t\t\t},1);\r\n\t\t} else {\r\n\t\t\tqi.style.left = \"auto\";\r\n\t\t\tqi.style.right = -width + \"px\";\r\n\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tqi.style.right = \"-10px\";\r\n\t\t\t},1);\r\n\t\t}\r\n\t\tqi.className = qi.className.replace(\" dhx_qi_left\",\"\").replace(\" dhx_qi_right\",\"\")+\" dhx_qi_\"+(pos.dx==1?\"left\":\"right\");\r\n\t}\r\n\r\n\tqi.ontransitionend = () => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t\tqi.ontransitionend = null;\r\n\t};\r\n\tsetTimeout(() => {\r\n\t\tfitQIInsideWindow(qi);\r\n\t}, 1);\r\n};\r\n\r\nfunction fitQIInsideWindow(quickInfoPopup){\r\n\tconst popupRect = quickInfoPopup.getBoundingClientRect();\r\n\tconst containerRect = scheduler.$container.getBoundingClientRect();\r\n\r\n\t// calculate the bottom offset of the Quick Info relative to the scheduler container\r\n\tconst offsetBottom = containerRect.bottom - popupRect.bottom;\r\n\r\n\t// If the popup extends outside the scheduler container, adjust its top position\r\n\tif (offsetBottom < 0) {\r\n\t\tquickInfoPopup.style.top = `${parseFloat(quickInfoPopup.style.top) + offsetBottom}px`;\r\n\t}\r\n}\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\tscheduler.hideQuickInfo();\r\n\tif(this._quick_info_box){\r\n\t\tvar box = this._quick_info_box;\r\n\t\tif(box.parentNode){\r\n\t\t\tbox.parentNode.removeChild(box);\r\n\t\t}\r\n\t\tthis._quick_info_box = null;\r\n\t}\r\n});\r\nscheduler._quick_info_onscroll_handler = function(e){\r\n\tscheduler.hideQuickInfo();\r\n};\r\nscheduler._init_quick_info = function(){\r\n\tif (!this._quick_info_box){\r\n\r\n\r\n\t\tvar qi = this._quick_info_box = document.createElement(\"div\");\r\n\r\n\t\tthis._waiAria.quickInfoAttr(qi);\r\n\r\n\t\tqi.className = \"dhx_cal_quick_info\";\r\n\t\tif (scheduler.$testmode)\r\n\t\t\tqi.className += \" dhx_no_animate\";\r\n\t\tif (scheduler.config.rtl) qi.className += \" dhx_quick_info_rtl\";\r\n\t//title\r\n\t\tvar ariaAttr = this._waiAria.quickInfoHeaderAttrString();\r\n\t\tvar html = `\r\n\t\t\r\n\t\t\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t
\r\n\t\t\t
`;\r\n\r\n\t//buttons\r\n\t\thtml += \"\";\r\n\t\tvar buttons = scheduler.config.icons_select;\r\n\t\t\tfor (var i = 0; i < buttons.length; i++) {\r\n\t\t\t\tvar ariaAttr = this._waiAria.quickInfoButtonAttrString(this.locale.labels[buttons[i]]);\r\n\t\t\t\thtml += `
\r\n\t\t\t\t
${scheduler.locale.labels[buttons[i]]}
`;\r\n\t\t\t}\r\n\t\t// }\r\n\t\thtml += \"
\";\r\n\r\n\t\tqi.innerHTML = html;\r\n\t\tscheduler.event(qi, \"click\", function(ev){\r\n\t\t\tscheduler._qi_button_click(ev.target || ev.srcElement);\r\n\t\t});\r\n\t\tif (scheduler.config.quick_info_detached){\r\n\t\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"scroll\", scheduler._quick_info_onscroll_handler);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this._quick_info_box;\r\n};\r\n\r\nscheduler._qi_button_click = function(node){\r\n\tvar box = scheduler._quick_info_box;\r\n\tif (!node || node == box) return;\r\n\r\n\tif(node.closest(\".dhx_cal_qi_close_btn\")){\r\n\t\tscheduler.hideQuickInfo();\r\n\t\treturn;\r\n\t}\r\n\r\n\tvar mask = scheduler._getClassName(node);\r\n\tif (mask.indexOf(\"_icon\")!=-1){\r\n\t\tvar id = scheduler._quick_info_box_id;\r\n\t\tscheduler._click.buttons[mask.split(\" \")[1].replace(\"icon_\",\"\")](id);\r\n\t} else\r\n\t\tscheduler._qi_button_click(node.parentNode);\r\n};\r\n\r\nfunction getPositionInsideScheduler(element){\r\n\tlet left = 0;\r\n\tlet top = 0;\r\n\r\n\tlet node = element;\r\n\twhile (node && node != scheduler._obj){\r\n\t\tleft += node.offsetLeft;\r\n\t\ttop += node.offsetTop-node.scrollTop;\r\n\t\tnode = node.offsetParent;\r\n\t}\r\n\tif(node){\r\n\t\tlet dx = (left + element.offsetWidth/2) > (scheduler._x/2) ? 1 : 0;\r\n\t\tlet dy = (top + element.offsetHeight/2) > (scheduler._y/2) ? 1 : 0;\r\n\r\n\t\treturn { left:left, top:top, dx:dx, dy:dy,\r\n\t\t\twidth:element.offsetWidth, height:element.offsetHeight };\r\n\t}\r\n\treturn 0;\r\n}\r\n\r\nscheduler._get_event_counter_part = function(id){\r\n\tvar domEv = scheduler.getRenderedEvent(id);\r\n\treturn getPositionInsideScheduler(domEv);\r\n};\r\n\r\nscheduler._fill_quick_data = function(id){\r\n\tvar ev = scheduler.getEvent(id);\r\n\tvar qi = scheduler._quick_info_box;\r\n\r\n\tscheduler._quick_info_box_id = id;\r\n\r\n//title content\r\n\r\n\tvar header = {\r\n\t\tcontent: scheduler.templates.quick_info_title(ev.start_date, ev.end_date, ev),\r\n\t\tdate: scheduler.templates.quick_info_date(ev.start_date, ev.end_date, ev)\r\n\t};\r\n\tvar titleContent = qi.querySelector(\".dhx_cal_qi_tcontent\");\r\n\ttitleContent.innerHTML = `${header.content} `;\r\n\tvar titleDate = qi.querySelector(\".dhx_cal_qi_tdate\");\r\n\ttitleDate.innerHTML = header.date;\r\n\r\n\tscheduler._waiAria.quickInfoHeader(qi, [header.content, header.date].join(\" \"));\r\n\r\n//main content\r\n\tvar main = qi.querySelector(\".dhx_cal_qi_content\");\r\n\tconst mainContent = scheduler.templates.quick_info_content(ev.start_date, ev.end_date, ev);\r\n\tif(mainContent){\r\n\t\tmain.classList.remove(\"dhx_hidden\");\r\n\t\tmain.innerHTML = mainContent;\r\n\t}else{\r\n\t\tmain.classList.add(\"dhx_hidden\");\r\n\t}\r\n};\r\n\r\n\r\n}","export default function(scheduler){\r\n\t\r\nscheduler.attachEvent(\"onTemplatesReady\", function() {\r\n\tvar originalRecurringSetValue;\r\n\tif (scheduler.form_blocks.recurring) {\r\n\t\toriginalRecurringSetValue = scheduler.form_blocks.recurring.set_value;\r\n\t}\r\n\tvar original_left_buttons = scheduler.config.buttons_left.slice();\r\n\tvar original_right_buttons = scheduler.config.buttons_right.slice();\r\n\r\n\tscheduler.attachEvent(\"onBeforeLightbox\", function(id) {\r\n\t\tif (this.config.readonly_form || this.getEvent(id).readonly) {\r\n\t\t\tthis.config.readonly_active = true;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.config.readonly_active = false;\r\n\t\t\tscheduler.config.buttons_left = original_left_buttons.slice();\r\n\t\t\tscheduler.config.buttons_right = original_right_buttons.slice();\r\n\t\r\n\t\t\t// initial value\r\n\t\t\tif(scheduler.form_blocks.recurring) {\r\n\t\t\t\tscheduler.form_blocks.recurring.set_value = originalRecurringSetValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar sns = this.config.lightbox.sections;\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tfor (var i = 0; i < sns.length; i++) {\r\n\t\t\t\tif (sns[i].type == 'recurring') {\r\n\t\t\t\t\tif (this.config.readonly_active && scheduler.form_blocks.recurring) {\r\n\t\t\t\t\t\tscheduler.form_blocks.recurring.set_value = function(node, value, ev) {\r\n\t\t\t\t\t\t\tvar wrapper = scheduler.$domHelpers.closest(node, \".dhx_wrap_section\");\r\n\t\t\t\t\t\t\tvar style = \"none\";\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_cal_lsection').display = style;\r\n\t\t\t\t\t\t\twrapper.querySelector('.dhx_form_repeat').display = style;\r\n\t\t\t\t\t\t\twrapper.style.display = style;\r\n\r\n\t\t\t\t\t\t\tscheduler.setLightboxSize();\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tvar forbidden_buttons = [\"dhx_delete_btn\", \"dhx_save_btn\"];\r\n\t\t\tvar button_arrays = [scheduler.config.buttons_left, scheduler.config.buttons_right];\r\n\t\t\tfor (var i = 0; i < forbidden_buttons.length; i++) {\r\n\t\t\t\tvar forbidden_button = forbidden_buttons[i];\r\n\t\t\t\tfor (var k = 0; k < button_arrays.length; k++) {\r\n\t\t\t\t\tvar button_array = button_arrays[k];\r\n\t\t\t\t\tvar index = -1;\r\n\t\t\t\t\tfor (var p = 0; p < button_array.length; p++) {\r\n\t\t\t\t\t\tif (button_array[p] == forbidden_button) {\r\n\t\t\t\t\t\t\tindex = p;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (index != -1) {\r\n\t\t\t\t\t\tbutton_array.splice(index, 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.resetLightbox();\r\n\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction txt_replace(tag, d, n, text) {\r\n\t\tvar txts = d.getElementsByTagName(tag);\r\n\t\tvar txtt = n.getElementsByTagName(tag);\r\n\t\tfor (var i = txtt.length - 1; i >= 0; i--) {\r\n\t\t\tvar n = txtt[i];\r\n\t\t\tif (!text){\r\n\t\t\t\tn.disabled = true;\r\n\t\t\t\t//radio and checkboxes loses state after .cloneNode in IE\r\n\t\t\t\tif(d.checked)\r\n\t\t\t\t\tn.checked = true;\r\n\t\t\t}else {\r\n\t\t\t\tvar t = document.createElement(\"span\");\r\n\t\t\t\tt.className = \"dhx_text_disabled\";\r\n\t\t\t\tt.innerHTML = text(txts[i]);\r\n\t\t\t\tn.parentNode.insertBefore(t, n);\r\n\t\t\t\tn.parentNode.removeChild(n);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar old = scheduler._fill_lightbox;\r\n\tscheduler._fill_lightbox = function() {\r\n\r\n\t\tvar lb = this.getLightbox();\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\tlb.style.visibility = 'hidden';\r\n\t\t\t// lightbox should have actual sizes before rendering controls\r\n\t\t\t// currently only matters for dhtmlxCombo\r\n\t\t\tlb.style.display = 'block';\r\n\t\t}\r\n\t\tvar res = old.apply(this, arguments);\r\n\t\tif (this.config.readonly_active) {\r\n\t\t\t//reset visibility and display\r\n\t\t\tlb.style.visibility = '';\r\n\t\t\tlb.style.display = 'none';\r\n\t\t}\r\n\r\n\t\tif (this.config.readonly_active) {\r\n\r\n\t\t\tvar originalForm = this.getLightbox();\r\n\t\t\tvar readonlyForm = this._lightbox_r = originalForm.cloneNode(true);\r\n\t\t\treadonlyForm.id = scheduler.uid();\r\n\t\t\treadonlyForm.className += \" dhx_cal_light_readonly\";\r\n\t\t\ttxt_replace(\"textarea\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\treturn a.value;\r\n\t\t\t});\r\n\t\t\ttxt_replace(\"input\", originalForm, readonlyForm, false);\r\n\t\t\ttxt_replace(\"select\", originalForm, readonlyForm, function(a) {\r\n\t\t\t\tif(!a.options.length) return \"\";\r\n\t\t\t\treturn a.options[Math.max((a.selectedIndex || 0), 0)].text;\r\n\t\t\t});\r\n\r\n\t\t\toriginalForm.parentNode.insertBefore(readonlyForm, originalForm);\r\n\r\n\t\t\tthis.showCover(readonlyForm);\r\n\t\t\tif (scheduler._lightbox)\r\n\t\t\t\tscheduler._lightbox.parentNode.removeChild(scheduler._lightbox);\r\n\t\t\tthis._lightbox = readonlyForm;\r\n\r\n\t\t\tif (scheduler.config.drag_lightbox)\r\n\t\t\t\tscheduler.event(readonlyForm.firstChild, \"mousedown\", scheduler._ready_to_dnd);\r\n\t\t\t\t\r\n\t\t\tscheduler._init_lightbox_events();\r\n\t\t\tthis.setLightboxSize();\r\n\t\t}\r\n\t\treturn res;\r\n\t};\r\n\r\n\tvar hold = scheduler.hide_lightbox;\r\n\tscheduler.hide_lightbox = function() {\r\n\t\tif (this._lightbox_r) {\r\n\t\t\tthis._lightbox_r.parentNode.removeChild(this._lightbox_r);\r\n\t\t\tthis._lightbox_r = this._lightbox = null;\r\n\t\t}\r\n\r\n\t\treturn hold.apply(this, arguments);\r\n\t};\r\n});\r\n\r\n\r\n}","import { RRule, rrulestr } from 'rrule';\r\n\r\nexport default function (scheduler) {\r\n\r\n\tfunction clearMilliseconds(date) {\r\n\t\treturn new Date(\r\n\t\t\tdate.getFullYear(),\r\n\t\t\tdate.getMonth(),\r\n\t\t\tdate.getDate(),\r\n\t\t\tdate.getHours(),\r\n\t\t\tdate.getMinutes(),\r\n\t\t\tdate.getSeconds(),\r\n\t\t\t0\r\n\t\t);\r\n\t}\r\n\r\n\tfunction isDeletedOccurrence(event) {\r\n\t\treturn !!event.deleted;\r\n\t}\r\n\r\n\tfunction isSeries(event) {\r\n\t\treturn !!event.rrule && !event.recurring_event_id;\r\n\t}\r\n\r\n\tfunction clearRecurringProperties(event) {\r\n\t\tevent.rrule = \"\";\r\n\t\tevent.original_start = null;\r\n\t\tevent.recurring_event_id = null;\r\n\t\tevent.duration = null;\r\n\t\tevent.deleted = null;\r\n\t}\r\n\r\n\tfunction createException(ev) {\r\n\t\tlet id = ev.id.split(\"#\");\r\n\r\n\t\tlet nid = scheduler.uid();\r\n\t\tscheduler._not_render = true;\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = id[0];\r\n\r\n\t\tlet timestamp = id[1];\r\n\r\n\t\tnev.original_start = new Date(Number(timestamp));\r\n\r\n\t\tscheduler._add_rec_marker(nev, timestamp);\r\n\t\tscheduler.addEvent(nev);\r\n\t\tscheduler._not_render = false;\r\n\t}\r\n\r\n\tfunction toUTCDate(date){\r\n\t\treturn new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(),date.getSeconds()));\r\n\t}\r\n\r\n\tfunction setUTCPartsToDate(d) {\r\n\t\treturn new Date(\r\n\t\t\td.getUTCFullYear(),\r\n\t\t\td.getUTCMonth(),\r\n\t\t\td.getUTCDate(),\r\n\t\t\td.getUTCHours(),\r\n\t\t\td.getUTCMinutes(),\r\n\t\t\td.getUTCSeconds()\r\n\t\t);\r\n\t}\r\n\r\n\tscheduler._rec_temp = [];\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_markers = {};\r\n\tscheduler._add_rec_marker = function (ev, time) {\r\n\t\tev._pid_time = time;\r\n\t\tthis._rec_markers[ev.id] = ev;\r\n\t\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\t\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n\t};\r\n\tscheduler._get_rec_marker = function (time, id) {\r\n\t\tlet ch = this._rec_markers_pull[id];\r\n\t\tif (ch) return ch[time];\r\n\t\treturn null;\r\n\t};\r\n\tscheduler._get_rec_markers = function (id) {\r\n\t\treturn (this._rec_markers_pull[id] || []);\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old_add_event = scheduler.addEvent;\r\n\t\tscheduler.addEvent = function (start_date, end_date, text, id, extra_data) {\r\n\t\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\r\n\t\t\t\tif (ev.start_date) {\r\n\t\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t\t}\r\n\t\t\t\tif (ev.end_date) {\r\n\t\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn ev_id;\r\n\t\t};\r\n\t})();\r\n\r\n\tscheduler.attachEvent(\"onEventLoading\", function (event) {\r\n\r\n\t\tif (event.original_start) {\r\n\t\t\tevent.original_start = scheduler.templates.parse_date(event.original_start);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onEventIdChange\", function (id, new_id) {\r\n\t\tif (this._ignore_call) return;\r\n\t\tthis._ignore_call = true;\r\n\r\n\t\tif (scheduler._rec_markers[id]) {\r\n\t\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\t\tdelete scheduler._rec_markers[id];\r\n\t\t}\r\n\r\n\t\tif (scheduler._rec_markers_pull[id]) {\r\n\t\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\t\tdelete scheduler._rec_markers_pull[id];\r\n\t\t}\r\n\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\t\tvar tev = this._rec_temp[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (var i in this._rec_markers) {\r\n\t\t\tvar tev = this._rec_markers[i];\r\n\t\t\tif (tev.recurring_event_id == id) {\r\n\t\t\t\ttev.recurring_event_id = new_id;\r\n\t\t\t\ttev._pid_changed = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar el = scheduler._rec_markers[new_id];\r\n\t\tif (el && el._pid_changed) {\r\n\t\t\tdelete el._pid_changed;\r\n\t\t\tsetTimeout(function () {\r\n\t\t\t\tif (scheduler.$destroyed) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t\t}, 1);\r\n\t\t}\r\n\r\n\t\tdelete this._ignore_call;\r\n\t});\r\n\r\n\tfunction deleteEventFromSeries(idTimestamp, ev) {\r\n\t\tlet id = idTimestamp;\r\n\t\tidTimestamp = id.split(\"#\");\r\n\t\tlet nid = scheduler.uid();\r\n\t\tlet tid = (idTimestamp[1]) ? idTimestamp[1] : (ev._pid_time);\r\n\t\tlet nev = scheduler._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.recurring_event_id = ev.recurring_event_id || idTimestamp[0];\r\n\t\tnev.original_start = new Date(Number(tid));\r\n\t\tnev.deleted = true;\r\n\t\tscheduler.addEvent(nev);\r\n\t}\r\n\r\n\tscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && !isDeletedOccurrence(ev))) {\r\n\t\t\tdeleteEventFromSeries(id, ev);\r\n\t\t} else {\r\n\t\t\tif (isSeries(ev) && this._lightbox_id)\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tid = sub[i].id;\r\n\t\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function (id, ev) {\r\n\t\tif (!this._is_virtual_event(id) && this._is_modified_occurence(ev)) {\r\n\t\t\tif (!scheduler._events[id]) {\r\n\t\t\t\tev.deleted = true;\r\n\t\t\t\tthis.setEvent(id, ev);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n\tscheduler.attachEvent(\"onEventChanged\", function (id, event) {\r\n\t\tif (this._loading) return true;\r\n\r\n\t\tvar ev = this.getEvent(id);\r\n\r\n\t\tif (this._is_virtual_event(id)) {\r\n\t\t\tcreateException(ev);\r\n\r\n\t\t} else {\r\n\t\t\tif (ev.start_date) {\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif (ev.end_date) {\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(ev) && this._lightbox_id) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t\t//scheduler.recurrings.rollbackDates(ev);\r\n\t\t\t}\r\n\r\n\t\t\tvar sub = this._get_rec_markers(id);\r\n\t\t\tfor (var i in sub) {\r\n\t\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\t\tvar isEventFound = false;\r\n\t\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\t\tisEventFound = true;\r\n\t\t\t}\r\n\t\t\tif (!isEventFound)\r\n\t\t\t\tthis._select_id = null;\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventAdded\", function (id) {\r\n\t\tif (!this._loading) {\r\n\t\t\tvar ev = this.getEvent(id);\r\n\t\t\tif (isSeries(ev)) {\r\n\t\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventSave\", function (id, data, is_new_event) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev))\r\n\t\t\tthis._select_id = null;\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCreated\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\tclearRecurringProperties(ev);\r\n\t\t}\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventCancel\", function (id) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (isSeries(ev)) {\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\t\tthis.render_view_data();\r\n\t\t}\r\n\t});\r\n\tscheduler._roll_back_dates = function (ev) {\r\n\t\t//// !!!!! calc temp properties\r\n\t\tif (ev.start_date) {\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif (ev.end_date) {\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tev.duration = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\t\tev.end_date = ev._end_date;\r\n\t\tif (ev._start_date) {\r\n\t\t\tev.start_date.setMonth(0);\r\n\t\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._is_virtual_event = function (id) {\r\n\t\treturn id.toString().indexOf(\"#\") != -1;\r\n\t};\r\n\tscheduler._is_modified_occurence = function (ev) {\r\n\t\treturn (ev.recurring_event_id && ev.recurring_event_id != \"0\");\r\n\t};\r\n\r\n\tscheduler.showLightbox_rec = scheduler.showLightbox;\r\n\tscheduler.showLightbox = function (id) {\r\n\t\tvar locale = this.locale;\r\n\t\tvar c = scheduler.config.lightbox_recurring;\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tvar pid = ev.recurring_event_id;\r\n\t\tvar isVirtual = this._is_virtual_event(id);\r\n\t\tif (isVirtual)\r\n\t\t\tpid = id.split(\"#\")[0];\r\n\r\n\t\t// show series\r\n\t\tvar showSeries = function (id) {\r\n\t\t\tvar event = scheduler.getEvent(id);\r\n\t\t\tevent._end_date = event.end_date;\r\n\t\t\tevent.end_date = new Date(event.start_date.valueOf() + event.duration * 1000);\r\n\t\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t\t};\r\n\r\n\t\tif ((pid || pid * 1 === 0) && isSeries(ev)) {\r\n\t\t\t// direct API call on series id\r\n\t\t\treturn showSeries(id);\r\n\t\t}\r\n\t\tif (!pid || pid === '0' || ((!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual))) {\r\n\t\t\t// editing instance or non recurring event\r\n\t\t\treturn this.showLightbox_rec(id);\r\n\t\t}\r\n\t\tif (c == 'ask') {\r\n\t\t\tvar that = this;\r\n\t\t\tscheduler.modalbox({\r\n\t\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\t\twidth: \"500px\",\r\n\t\t\t\tposition: \"middle\",\r\n\t\t\t\tbuttons: [locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\t\tcallback: function (index) {\r\n\t\t\t\t\tswitch (+index) {\r\n\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tshowSeries(pid);\r\n\t\t}\r\n\t};\r\n\r\n\tfunction groupExceptions() {\r\n\t\tconst exceptions = {};\r\n\t\tfor (const i in scheduler._events) {\r\n\t\t\tconst ev = scheduler._events[i];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tif (!exceptions[ev.recurring_event_id]) {\r\n\t\t\t\t\texceptions[ev.recurring_event_id] = {};\r\n\t\t\t\t}\r\n\t\t\t\texceptions[ev.recurring_event_id][ev.original_start.valueOf()] = ev;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn exceptions;\r\n\t}\r\n\r\n\tscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\n\tscheduler.get_visible_events = function (only_timed) {\r\n\t\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\t\tdelete this._events[this._rec_temp[i].id];\r\n\t\tthis._rec_temp = [];\r\n\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tvar stack = this.get_visible_events_rec(only_timed);\r\n\t\tvar out = [];\r\n\t\tfor (var i = 0; i < stack.length; i++) {\r\n\t\t\tif (stack[i].deleted || stack[i].recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (isSeries(stack[i])) {\r\n\t\t\t\tthis.repeat_date(stack[i], out, undefined, undefined, undefined, undefined, exceptions);\r\n\t\t\t} else {\r\n\t\t\t\tout.push(stack[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn out;\r\n\t};\r\n\r\n\t(function () {\r\n\t\tvar old = scheduler.isOneDayEvent;\r\n\t\tscheduler.isOneDayEvent = function (ev) {\r\n\t\t\tif (isSeries(ev)) return true;\r\n\t\t\treturn old.call(this, ev);\r\n\t\t};\r\n\t\tvar old_update_event = scheduler.updateEvent;\r\n\t\tscheduler.updateEvent = function (id) {\r\n\t\t\tvar ev = scheduler.getEvent(id);\r\n\r\n\t\t\tif (ev && isSeries(ev) && !this._is_virtual_event(id)) {\r\n\t\t\t\tscheduler.update_view();\r\n\t\t\t} else {\r\n\t\t\t\told_update_event.call(this, id);\r\n\t\t\t}\r\n\t\t};\r\n\t})();\r\n\r\n\tconst toIcalString = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\r\n\tscheduler.repeat_date = function (ev, stack, non_render, from, to, maxCount, exceptions) {\r\n\t\tif (!ev.rrule) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet seriesExceptions = exceptions ? exceptions[ev.id] : groupExceptions()[ev.id];\r\n\t\tif (!seriesExceptions) {\r\n\t\t\tseriesExceptions = {};\r\n\t\t}\r\n\r\n\t\t// GS-2596: from and to should be in UTC, \r\n\t\t// need to remove one sec to not be included in repeatedDates array\r\n\t\tfrom = toUTCDate(from || new Date(scheduler._min_date.valueOf() - 1000));\r\n\t\tto = toUTCDate(to || new Date(scheduler._max_date.valueOf() - 1000));\r\n\r\n\t\t\r\n\t\tconst utcStart = toUTCDate(ev.start_date);\r\n\t\tlet parsedRRule;\r\n\t\tif (maxCount){\r\n\t\t\t// for getRecDates() method\r\n\t\t\tparsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)};COUNT=${maxCount}`, { dtstart: utcStart });\r\n\t\t} else {\r\n\t\t\tparsedRRule = rrulestr(`RRULE:${ev.rrule};UNTIL=${toIcalString(ev.end_date)}`, { dtstart: utcStart });\r\n\t\t}\r\n\t\t//GS-2596: third parameter, includes dates that match with arguments\r\n\t\tconst repeatedDates = parsedRRule.between(from, to, true).map(date => {\r\n\t\t\tconst adjustedDate = setUTCPartsToDate(date);\r\n\t\t\tadjustedDate.setHours(ev.start_date.getHours());\r\n\t\t\tadjustedDate.setMinutes(ev.start_date.getMinutes());\r\n\t\t\tadjustedDate.setSeconds(ev.start_date.getSeconds());\r\n\t\t\treturn adjustedDate;\r\n\t\t});\r\n\t\tlet visibleCount = 0;\r\n\r\n\t\tconst eventDuration = ev.duration;\r\n\r\n\t\tfor (let i = 0; i < repeatedDates.length; i++) {\r\n\t\t\tif (maxCount && visibleCount >= maxCount) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tconst date = repeatedDates[i];\r\n\r\n\t\t\tlet exception = seriesExceptions[date.valueOf()];\r\n\t\t\tif (exception) {\r\n\t\t\t\tif (exception.deleted) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvisibleCount++;\r\n\t\t\t\t\tstack.push(exception);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconst copy = scheduler._copy_event(ev);\r\n\t\t\t\t//copy._timed = ev._timed;\r\n\t\t\t\tcopy.text = ev.text;\r\n\t\t\t\tcopy.start_date = date;\r\n\t\t\t\tcopy.id = ev.id + \"#\" + Math.ceil(date.valueOf());\r\n\t\t\t\tcopy.end_date = new Date(date.valueOf() + eventDuration * 1000);\r\n\t\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, date, copy.end_date);\r\n\t\t\t\tcopy._timed = scheduler.isOneDayEvent(copy);\r\n\r\n\r\n\r\n\t\t\t\tif (!copy._timed && !scheduler._table_view && !scheduler.config.multi_day) continue;\r\n\t\t\t\tstack.push(copy);\r\n\r\n\t\t\t\tif (!non_render) {\r\n\t\t\t\t\tscheduler._events[copy.id] = copy;\r\n\t\t\t\t\tscheduler._rec_temp.push(copy);\r\n\t\t\t\t}\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//GS-2534: case when exceptions have different dates\r\n\t\tif (seriesExceptions && repeatedDates.length == 0 ){\r\n\t\t\tfor (let a in seriesExceptions){\r\n\t\t\t\tlet exception = seriesExceptions[a];\r\n\t\t\t\tif (exception) {\r\n\t\t\t\t\tif(exception.deleted){\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\telse if (from && to && exception.start_date < to && exception.end_date > from) {\r\n\t\t\t\t\t\tstack.push(exception);\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._fix_daylight_saving_date = function (start_date, end_date, ev, counter, default_date) {\r\n\t\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\t\tif (shift) {\r\n\t\t\tif (shift > 0) {\r\n\t\t\t\t// e.g. 24h -> 23h\r\n\t\t\t\treturn new Date(counter.valueOf() + ev.duration * 1000 - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// e.g. 24h -> 25h\r\n\t\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Date(default_date.valueOf());\r\n\t};\r\n\tscheduler.getRecDates = function (id, max) {\r\n\t\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\t\tvar recurrings = [];\r\n\t\tmax = max || 100;\r\n\r\n\t\tif (!isSeries(ev)) {\r\n\t\t\treturn [\r\n\t\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t\t];\r\n\t\t}\r\n\t\tif (ev.deleted) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\t\tvar result = [];\r\n\t\tfor (var i = 0; i < recurrings.length; i++) {\r\n\t\t\tif (!recurrings[i].deleted) {\r\n\t\t\t\tresult.push({ start_date: recurrings[i].start_date, end_date: recurrings[i].end_date });\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n\tscheduler.getEvents = function (from, to) {\r\n\t\tvar result = [];\r\n\t\tconst exceptions = groupExceptions();\r\n\t\tfor (var a in this._events) {\r\n\t\t\tvar ev = this._events[a];\r\n\t\t\tif (ev.recurring_event_id) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tif (from && to && ev.start_date < to && ev.end_date > from) {\r\n\t\t\t\tif (isSeries(ev)) {\r\n\t\t\t\t\tvar sev = [];\r\n\t\t\t\t\tthis.repeat_date(ev, sev, true, from, to, undefined, exceptions);\r\n\t\t\t\t\tsev.forEach(function(occurence){\r\n\t\t\t\t\t\tif (occurence.start_date < to && occurence.end_date > from) {\r\n\t\t\t\t\t\t\tresult.push(occurence);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t// if it's virtual event we can skip it\r\n\t\t\t\t} else if (!this._is_virtual_event(ev.id)) {\r\n\t\t\t\t\tresult.push(ev);\r\n\t\t\t\t}\r\n\t\t\t} else if (!from && !to && !this._is_virtual_event(ev.id)) {\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t};\r\n\r\n\t//drop secondary attributes\r\n\tscheduler._copy_dummy = function (ev) {\r\n\t\tvar start_date = new Date(this.start_date);\r\n\t\tvar end_date = new Date(this.end_date);\r\n\t\tthis.start_date = start_date;\r\n\t\tthis.end_date = end_date;\r\n\t\tthis.duration = this.rrule = null;\r\n\t};\r\n\r\n\tscheduler.config.include_end_by = false;\r\n\tscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\tscheduler.config.recurring_workdays = [RRule.MO.weekday,RRule.TU.weekday,RRule.WE.weekday,RRule.TH.weekday,RRule.FR.weekday];\r\n\tscheduler.config.repeat_date = \"%m.%d.%Y\";\r\n\tscheduler.config.lightbox.sections = [\r\n\t\t{ name: \"description\", map_to: \"text\", type: \"textarea\", focus: true },\r\n\t\t{ name: \"recurring\", type: \"recurring\", map_to: \"rec_type\" },\r\n\t\t{ name: \"time\", height: 72, type: \"time\", map_to: \"auto\" }\r\n\t];\r\n\r\n\tscheduler.attachEvent(\"onClearAll\", function () {\r\n\t\tscheduler._rec_markers = {}; //clear recurring events data\r\n\t\tscheduler._rec_markers_pull = {};\r\n\t\tscheduler._rec_temp = [];\r\n\t});\r\n\r\n\r\n\tfunction getTopLevelOption(rruleObj, untilDate) {\r\n\t\tconst options = rruleObj.options;\r\n\t\tconst until = options.until || untilDate;\r\n\r\n\t\tconst hasEndCondition = options.count || (until && until.getFullYear() !== 9999);\r\n\r\n\t\tif (hasEndCondition) {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\r\n\t\tif (options.freq === RRule.DAILY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'DAILY';\r\n\t\t} else if (options.freq === RRule.WEEKLY && options.interval === 1 && !options.byweekday) {\r\n\t\t\treturn 'WEEKLY';\r\n\t\t} else if (options.freq === RRule.MONTHLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'MONTHLY';\r\n\t\t} else if (options.freq === RRule.YEARLY && options.interval === 1 && !options.bysetpos) {\r\n\t\t\treturn 'YEARLY';\r\n\t\t} else if (options.freq === RRule.DAILY && options.byweekday && options.byweekday.length === scheduler.config.recurring_workdays.length &&\r\n\t\t\toptions.byweekday.includes(RRule.MO) &&\r\n\t\t\toptions.byweekday.includes(RRule.TU) &&\r\n\t\t\toptions.byweekday.includes(RRule.WE) &&\r\n\t\t\toptions.byweekday.includes(RRule.TH) &&\r\n\t\t\toptions.byweekday.includes(RRule.FR)) {\r\n\t\t\treturn 'WORKDAYS';\r\n\t\t} else {\r\n\t\t\treturn 'CUSTOM';\r\n\t\t}\r\n\t}\r\n\t\r\n\tfunction getWeekdayOfMonth(date) {\r\n\t\tconst dayOfWeek = date.getDay();\r\n\t\tconst dayOfMonth = date.getDate();\r\n\t\tconst dayNumber = Math.ceil(dayOfMonth / 7);\r\n\t\treturn { dayOfWeek, dayNumber };\r\n\t}\r\n\r\n\r\n\tconst jsDaysToRRULEDays = {\r\n\t\t0: \"SU\",\r\n\t\t1: \"MO\",\r\n\t\t2: \"TU\",\r\n\t\t3: \"WE\",\r\n\t\t4: \"TH\",\r\n\t\t5: \"FR\",\r\n\t\t6: \"SA\"\r\n\t};\r\n\tconst RruleDayNumsToJs = {\r\n\t\t0: 1,\r\n\t\t1: 2,\r\n\t\t2: 3,\r\n\t\t3: 4,\r\n\t\t4: 5,\r\n\t\t5: 6,\r\n\t\t6: 0\r\n\t};\r\n\r\n\tfunction fillCustomDaily(node, rule) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\t}\r\n\r\n\tfunction fillCustomWeekly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dayCheckboxes = node.querySelectorAll(`.dhx_form_repeat_custom_week input`);\r\n\t\tdayCheckboxes.forEach((ch) => ch.checked = false);\r\n\t\tif (rule && rule.byweekday) {\r\n\t\t\trule.byweekday.forEach((day) => {\r\n\t\t\t\tconst dayNum = RruleDayNumsToJs[day.weekday];\r\n\t\t\t\tconst dayLabel = jsDaysToRRULEDays[dayNum];\r\n\t\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tconst dayLabel = jsDaysToRRULEDays[event.start_date.getDay()];\r\n\t\t\tnode.querySelector(`.dhx_form_repeat_custom_week input[value=\"${dayLabel}\"]`).checked = true;\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tfunction fillCustomMonthly(node, rule, event) {\r\n\t\tnode.querySelector(\"[name='repeat_interval_value']\").value = (rule ? rule.interval : 1) || 1;\r\n\r\n\t\tconst dateOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfMonth = node.querySelector(`.dhx_form_repeat_custom_month [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfMonth.innerText = scheduler.templates.repeat_monthly_date(event.start_date, event);\r\n\t\tnthWeekDayOfMonth.innerText = scheduler.templates.repeat_monthly_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_month_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction formatDayNumber(date){\r\n\t\tswitch (date) {\r\n\t\t\tcase 1:\r\n\t\t\tcase 31:\r\n\t\t\t\treturn `${date}st`;\r\n\t\t\tcase 2:\r\n\t\t\t\treturn `${date}nd`;\r\n\t\t\tcase 3:\r\n\t\t\t\treturn `${date}rd`;\r\n\t\t\tdefault:\r\n\t\t\t\treturn `${date}th`;\r\n\t\t}\r\n\t}\r\n\r\n\tscheduler.templates.repeat_monthly_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\treturn `Every ${formatDayNumber(date)}`;\r\n\t};\r\n\tscheduler.templates.repeat_monthly_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]}`;\r\n\t};\r\n\t\r\n\tscheduler.templates.repeat_yearly_month_date = function(startDate, event) {\r\n\t\tconst date = startDate.getDate();\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(date)} day of ${monthLabel}`;\r\n\t};\r\n\tscheduler.templates.repeat_yearly_month_weekday = function(startDate, event) {\r\n\t\tconst nthDayOfMonth = getWeekdayOfMonth(startDate);\r\n\t\tconst monthLabel = scheduler.locale.date.month_full[startDate.getMonth()];\r\n\t\treturn `Every ${formatDayNumber(nthDayOfMonth.dayNumber)} ${scheduler.locale.date.day_full[nthDayOfMonth.dayOfWeek]} of ${monthLabel}`;\r\n\t};\r\n\r\n\tfunction fillCustomYearly(node, rule, event) {\r\n\t\tconst dateOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_date\"]`);\r\n\t\tconst nthWeekDayOfYear = node.querySelector(`.dhx_form_repeat_custom_year [value=\"month_nth_weekday\"]`);\r\n\t\tdateOfYear.innerText = scheduler.templates.repeat_yearly_month_date(event.start_date, event);\r\n\t\tnthWeekDayOfYear.innerText = scheduler.templates.repeat_yearly_month_weekday(event.start_date, event);\r\n\r\n\t\tif (!rule || (rule.bysetpos && !(rule.byweekday && rule.byweekday.length))) {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_date\";\r\n\t\t} else {\r\n\t\t\tnode.querySelector(`[name=\"dhx_custom_year_option\"]`).value = \"month_nth_weekday\";\r\n\t\t}\r\n\t}\r\n\r\n\tfunction fillEndRule(node, rule, event) {\r\n\t\tconst countInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_after\"]`);\r\n\t\tconst ondateInput = node.querySelector(`.dhx_form_repeat_ends_extra [name=\"dhx_form_repeat_ends_ondate\"]`);\r\n\t\tconst endOptionSelect = node.querySelector(`[name='dhx_custom_repeat_ends']`);\r\n\t\tcountInput.value = 1;\r\n\r\n\t\tlet formatter = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tondateInput.value = scheduler.config.repeat_date_of_end;\r\n\r\n\t\tif (rule && rule.count) {\r\n\t\t\tendOptionSelect.value = \"AFTER\";\r\n\t\t\tcountInput.value = rule.count;\r\n\t\t} else if (event._end_date && event._end_date.getFullYear() !== 9999) {\r\n\t\t\tendOptionSelect.value = \"ON\";\r\n\t\t\tondateInput.value = formatter(event._end_date);\r\n\t\t} else {\r\n\t\t\tendOptionSelect.value = \"NEVER\";\r\n\t\t}\r\n\t\tendOptionSelect.dispatchEvent(new Event(\"change\"));\r\n\t}\r\n\r\n\tconst getRecValue = {\r\n\t\tMONTHLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.MONTHLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWEEKLY: function (dates) {\r\n\t\t\tlet day = dates.start.getDay() - 1;\r\n\t\t\tif (day == -1) day = 6;\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: [day]\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tDAILY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.DAILY,\r\n\t\t\t\tinterval: 1\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tYEARLY: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.YEARLY,\r\n\t\t\t\tbymonth: dates.start.getMonth() + 1,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbymonthday: dates.start.getDate()\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tWORKDAYS: function (dates) {\r\n\t\t\tconst rrule = {\r\n\t\t\t\tfreq: RRule.WEEKLY,\r\n\t\t\t\tinterval: 1,\r\n\t\t\t\tbyweekday: scheduler.config.recurring_workdays\r\n\t\t\t};\r\n\t\t\tconst until = new Date(9999, 1, 1);\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tCUSTOM: function (dates, node) {\r\n\t\t\tconst rrule = {};\r\n\t\t\tconst freq = node.querySelector(`[name=\"repeat_interval_unit\"]`).value;\r\n\t\t\tconst interval = Math.max(1, node.querySelector(`[name=\"repeat_interval_value\"]`).value);\r\n\t\t\tconst monthRepeat = node.querySelector(`[name=\"dhx_custom_month_option\"]`).value;\r\n\t\t\tconst yearRepeat = node.querySelector(`[name=\"dhx_custom_year_option\"]`).value;\r\n\r\n\t\t\trrule.interval = interval;\r\n\t\t\tlet days;\r\n\t\t\tlet day;\r\n\r\n\t\t\tswitch (freq) {\r\n\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\trrule.freq = RRule.DAILY;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"WEEKLY\": \r\n\t\t\t\t\trrule.freq = RRule.WEEKLY;\r\n\t\t\t\t\tdays = [];\r\n\t\t\t\t\tnode.querySelectorAll(`.dhx_form_repeat_custom_week [name=\"week_day\"]`).forEach((ch) => {\r\n\t\t\t\t\t\tif(ch.checked){\r\n\t\t\t\t\t\t\tdays.push(ch.value);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\trrule.byweekday = days.map((day) => {\r\n\t\t\t\t\t\tswitch (day) {\r\n\t\t\t\t\t\t\tcase \"MO\":\r\n\t\t\t\t\t\t\t\treturn RRule.MO.weekday;\r\n\t\t\t\t\t\t\tcase \"TU\":\r\n\t\t\t\t\t\t\t\treturn RRule.TU.weekday;\r\n\t\t\t\t\t\t\tcase \"WE\":\r\n\t\t\t\t\t\t\t\treturn RRule.WE.weekday;\r\n\t\t\t\t\t\t\tcase \"TH\":\r\n\t\t\t\t\t\t\t\treturn RRule.TH.weekday;\r\n\t\t\t\t\t\t\tcase \"FR\":\r\n\t\t\t\t\t\t\t\treturn RRule.FR.weekday;\r\n\t\t\t\t\t\t\tcase \"SA\":\r\n\t\t\t\t\t\t\t\treturn RRule.SA.weekday;\r\n\t\t\t\t\t\t\tcase \"SU\":\r\n\t\t\t\t\t\t\t\treturn RRule.SU.weekday;\r\n\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\trrule.freq = RRule.MONTHLY;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (monthRepeat === \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\trrule.freq = RRule.YEARLY;\r\n\t\t\t\t\trrule.bymonth = dates.start.getMonth() + 1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (yearRepeat == \"month_date\") {\r\n\t\t\t\t\t\trrule.bymonthday = dates.start.getDate();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tday = dates.start.getDay() - 1;\r\n\t\t\t\t\t\tif (day == -1) day = 6;\r\n\t\t\t\t\t\trrule.byweekday = [day];\r\n\t\t\t\t\t\trrule.bysetpos = getWeekdayOfMonth(dates.start).dayNumber;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tconst formatFunc = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\t\t\tlet until = new Date(9999, 1, 1);\r\n\t\t\tconst endRule = node.querySelector(`[name=\"dhx_custom_repeat_ends\"]`);\r\n\t\t\tif(endRule.value === \"ON\"){\r\n\t\t\t\tuntil = formatFunc(node.querySelector(`[name=\"dhx_form_repeat_ends_ondate\"]`).value);\r\n\t\t\t} else if(endRule.value === \"AFTER\") {\r\n\t\t\t\trrule.count = Math.max(1, node.querySelector(`[name=\"dhx_form_repeat_ends_after\"]`).value);\r\n\t\t\t}\r\n\r\n\t\t\treturn {rrule, until};\r\n\t\t},\r\n\t\tNEVER: function () {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction fillInDefaults(node, rule, event) {\r\n\t\tfillCustomDaily(node, rule, event);\r\n\t\tfillCustomWeekly(node, rule, event);\r\n\t\tfillCustomMonthly(node, rule, event);\r\n\t\tfillCustomYearly(node, rule, event);\r\n\t\tfillEndRule(node, rule, event);\r\n\t}\r\n\tscheduler.form_blocks[\"recurring\"] = {\r\n\t\trender: function (sns) {\r\n\t\t\tif (sns.form) {\r\n\t\t\t\tlet rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\t\tlet form = rec._get_node(sns.form);\r\n\t\t\t\tlet html = rec._outer_html(form);\r\n\t\t\t\tform.style.display = 'none';\r\n\t\t\t\treturn html;\r\n\t\t\t}\r\n\t\t\tlet loc = scheduler.locale.labels;\r\n\r\n\t\t\treturn ``;\r\n\t\t},\r\n\r\n\t\r\n\t\t_init_set_value: function (node, value, event) {\r\n\t\t\tscheduler.form_blocks[\"recurring\"]._ds = { start: event.start_date, end: event.end_date };\r\n\t\t\tfunction hide(node) {\r\n\t\t\t\tnode.classList.add(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction show(node) {\r\n\t\t\t\tnode.classList.remove(\"dhx_hidden\");\r\n\t\t\t}\r\n\t\t\tfunction onRepeatOptionChange(value) {\r\n\t\t\t\tconst repeat = node.querySelector(\".dhx_form_repeat_custom\");\r\n\t\t\t\tif (value === \"CUSTOM\") {\r\n\t\t\t\t\tshow(repeat);\r\n\t\t\t\t} else {\r\n\t\t\t\t\thide(repeat);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatIntervalChange(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tweekly: node.querySelector(\".dhx_form_repeat_custom_week\"),\r\n\t\t\t\t\tmonthly: node.querySelector(\".dhx_form_repeat_custom_month\"),\r\n\t\t\t\t\tyearly: node.querySelector(\".dhx_form_repeat_custom_year\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"DAILY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"WEEKLY\":\r\n\t\t\t\t\t\tshow(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"MONTHLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\tshow(nodes.monthly);\r\n\t\t\t\t\t\thide(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"YEARLY\":\r\n\t\t\t\t\t\thide(nodes.weekly);\r\n\t\t\t\t\t\thide(nodes.monthly);\r\n\t\t\t\t\t\tshow(nodes.yearly);\r\n\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tfunction onCustomRepeatEndRule(value) {\r\n\t\t\t\tconst nodes = {\r\n\t\t\t\t\tafter: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_after\"),\r\n\t\t\t\t\ton: node.querySelector(\".dhx_form_repeat_ends_extra .dhx_form_repeat_ends_on\")\r\n\t\t\t\t};\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase \"NEVER\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"AFTER\":\r\n\t\t\t\t\t\tshow(nodes.after);\r\n\t\t\t\t\t\thide(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase \"ON\":\r\n\t\t\t\t\t\thide(nodes.after);\r\n\t\t\t\t\t\tshow(nodes.on);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// repeat section change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").addEventListener(\"change\", function () {\r\n\t\t\t\tonRepeatOptionChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat interval change\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_custom_interval [name='repeat_interval_unit']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatIntervalChange(this.value);\r\n\t\t\t});\r\n\r\n\t\t\t// custom repeat end rule\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_ends [name='dhx_custom_repeat_ends']\").addEventListener(\"change\", function () {\r\n\t\t\t\tonCustomRepeatEndRule(this.value);\r\n\t\t\t});\r\n\r\n\t\t\tscheduler._lightbox._rec_init_done = true;\r\n\t\t},\r\n\t\tbutton_click: function(){},\r\n\t\tset_value: function (node, value, ev) {\r\n\t\t\tlet rf = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\t\trf._init_set_value(node, value, ev);\r\n\t\t\tnode.open = !ev.rrule;\r\n\r\n\t\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\t\tlet ds = rf._ds;\r\n\t\t\tds.start = ev.start_date;\r\n\t\t\tds.end = ev._end_date;\r\n\r\n\t\t\tif (ev.rrule) {\r\n\t\t\t\tconst rruleset = rrulestr(ev.rrule);\r\n\t\t\t\tfillInDefaults(node, rruleset.origOptions, ev);\r\n\t\t\t\tconst topOption = getTopLevelOption(rruleset, ev._end_date);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = topOption;\r\n\t\t\t\tif(topOption === \"CUSTOM\"){\r\n\t\t\t\t\tlet customFreq;\r\n\t\t\t\t\tswitch (rruleset.origOptions.freq) {\r\n\t\t\t\t\t\tcase RRule.DAILY:\r\n\t\t\t\t\t\t\tcustomFreq = \"DAILY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.WEEKLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"WEEKLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.MONTHLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"MONTHLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase RRule.YEARLY:\r\n\t\t\t\t\t\t\tcustomFreq = \"YEARLY\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(customFreq){\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).value = customFreq;\r\n\t\t\t\t\t\tnode.querySelector(`[name=\"repeat_interval_unit\"]`).dispatchEvent(new Event(\"change\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t//\trepeat_interval_unit\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\tfillInDefaults(node, null, ev);\r\n\t\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").value = \"NEVER\";\r\n\t\t\t}\r\n\t\t\tnode.querySelector(\".dhx_form_repeat_pattern select\").dispatchEvent(new Event(\"change\"));\r\n\r\n\t\t},\r\n\t\tget_value: function (node, ev) {\r\n\t\t\t\r\n\t\t\tif(!node.blocked && node.querySelector(\".dhx_form_repeat_pattern select\").value !== \"NEVER\") {\r\n\t\t\t\tlet ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\t\tlet actual_dates = {};\r\n\r\n\t\t\t\tlet timeControl = getTimeSection();\r\n\r\n\t\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\t\tds.start = actual_dates.start_date;\r\n\t\t\t\tconst pattern = node.querySelector(\".dhx_form_repeat_pattern select\").value;\r\n\t\t\t\tconst recurrence = getRecValue[pattern](ds, node);\r\n\t\t\t\tev.rrule = new RRule(recurrence.rrule).toString().replace(\"RRULE:\", \"\");\r\n\t\t\t\tds.end = recurrence.until;\r\n\r\n\t\t\t\tev.duration = Math.floor((actual_dates.end_date - actual_dates.start_date) / 1000);\r\n\r\n\t\t\t\tif (ds._start) {\r\n\t\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\t\tds._start = false;\r\n\t\t\t\t} else\r\n\t\t\t\t\tev._start_date = null;\r\n\r\n\t\t\t\tev._end_date = ds.end;\r\n\t\t\t}else{\r\n\t\t\t\tev.rrule = ev.rrule = \"\";\r\n\t\t\t\tev._end_date = ev.end_date;\r\n\t\t\t}\r\n\r\n\t\t\treturn ev.rrule;\r\n\t\t},\r\n\r\n\t\tfocus: function (node) {\r\n\t\t}\r\n\t};\r\n\r\n\tfunction getTimeSection() {\r\n\t\tlet timeControl = scheduler.formSection('time');\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('time');\r\n\t\t}\r\n\t\tif (!timeControl) {\r\n\t\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t\t}\r\n\r\n\r\n\t\tif (!timeControl) {\r\n\t\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\t\t\t\t\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\t\t\t\t\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\t\t\t\t\"\",\r\n\t\t\t\t\"scheduler.config.lightbox.sections = [\",\r\n\t\t\t\t\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n\t\t\t\t.join(\"\\n\"));\r\n\t\t}\r\n\r\n\t\treturn timeControl;\r\n\t}\r\n\r\n\tfunction getFirstSectionOfType(type) {\r\n\t\tfor (let i = 0; i < scheduler.config.lightbox.sections.length; i++) {\r\n\t\t\tlet section = scheduler.config.lightbox.sections[i];\r\n\t\t\tif (section.type === type) {\r\n\t\t\t\treturn scheduler.formSection(section.name);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n}","export default function(scheduler){\r\n\r\nscheduler.config.occurrence_timestamp_in_utc = false;\r\nscheduler.config.recurring_workdays = [1,2,3,4,5];\r\nscheduler.form_blocks[\"recurring\"] = {\r\n\t_get_node : function(node){\r\n\t\tif (typeof node == \"string\"){\r\n\t\t\tlet element = scheduler._lightbox.querySelector(`#${node}`);\r\n\t\t\tif(!element){\r\n\t\t\t\t// form is detached from lightbox \r\n\t\t\t\t// search globally, won't work in LWC\r\n\t\t\t\telement = document.getElementById(node);\r\n\t\t\t}\r\n\t\t\tnode = element;\r\n\t\t}\r\n\t\tif (node.style.display == 'none')\r\n\t\t\tnode.style.display = \"\";\r\n\t\treturn node;\r\n\t},\r\n\t_outer_html: function(node){\r\n\t\treturn node.outerHTML || getOuterHTML(node);\r\n\r\n\t\t//probably not needed, FF v10- only\r\n\t\tfunction getOuterHTML(n){\r\n\t\t\tvar div = document.createElement('div'), h;\r\n\t\t\tdiv.appendChild( n.cloneNode(true) );\r\n\t\t\th = div.innerHTML;\r\n\t\t\tdiv = null;\r\n\t\t\treturn h;\r\n\t\t}\r\n\t},\r\n\trender:function(sns) {\r\n\t\tif(sns.form){\r\n\t\t\tvar rec = scheduler.form_blocks[\"recurring\"];\r\n\t\t\tvar form = rec._get_node(sns.form);\r\n\t\t\tvar html = rec._outer_html(form);\r\n\t\t\tform.style.display = 'none';\r\n\t\t\treturn html;\r\n\t\t}\r\n\t\tvar loc = scheduler.locale.labels;\r\n\t\treturn ' '+\r\n\t\t\t\t' ';\r\n\t},\r\n\t_ds: {},\r\n\t_get_form_node: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return null;\r\n\t\tif(col.nodeName) return col;\r\n\r\n\t\tif(col.length){\r\n\t\t\tfor(var i=0; i < col.length; i++){\r\n\t\t\t\tif(col[i].value == value)\r\n\t\t\t\t\treturn col[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\t_get_node_value: function(els, name, multiselect){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return \"\";\r\n\t\tif(col.length){\r\n\t\t\tif(multiselect){\r\n\t\t\t\tvar res = [];\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) res.push(col[i].value);\r\n\r\n\t\t\t\treturn res;\r\n\t\t\t}else{\r\n\t\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\t\tif (col[i].checked) return col[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(col.value)\r\n\t\t\treturn !multiselect ? col.value : [col.value];\r\n\t},\r\n\r\n\t_get_node_numeric_value: function(els, name){\r\n\t\tvar value = scheduler.form_blocks[\"recurring\"]._get_node_value(els, name);\r\n\t\treturn ((value * 1) || 0);\r\n\t},\r\n\r\n\t_set_node_value: function(els, name, value){\r\n\t\tvar col = els[name];\r\n\t\tif(!col) return;\r\n\r\n\t\tif(col.name == name){\r\n\t\t\tcol.value = value;\r\n\t\t}else if(col.length){\r\n\t\t\tvar hash_value = typeof value == \"object\";\r\n\t\t\tfor (var i = 0; i < col.length; i++)\r\n\t\t\t\tif (hash_value || col[i].value == value){\r\n\t\t\t\t\tcol[i].checked = hash_value ? !!value[col[i].value] : !!value;\r\n\t\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_init_set_value:function(node, value, ev) {\r\n\t\tvar block = scheduler.form_blocks[\"recurring\"];\r\n\t\tvar get_value = block._get_node_value;\r\n\t\tvar set_value = block._set_node_value;\r\n\t\tscheduler.form_blocks[\"recurring\"]._ds = {start:ev.start_date, end:ev._end_date};\r\n\r\n\t\tvar str_date_format = scheduler.date.str_to_date(scheduler.config.repeat_date, false, true);\r\n\t\tvar str_date = function(str_date) {\r\n\t\t\tvar date = str_date_format(str_date);\r\n\t\t\tif (scheduler.config.include_end_by)\r\n\t\t\t\tdate = scheduler.date.add(date, 1, 'day');\r\n\t\t\treturn date;\r\n\t\t};\r\n\r\n\t\tvar date_str = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\r\n\t\tvar top = node.getElementsByTagName(\"FORM\")[0];\r\n\t\tvar els = {};\r\n\r\n\t\tfunction register_els(inps) {\r\n\t\t\tfor (var i = 0; i < inps.length; i++) {\r\n\t\t\t\tvar inp = inps[i];\r\n\r\n\t\t\t\tif(inp.name){\r\n\t\t\t\t\tif(!els[inp.name]){\r\n\t\t\t\t\t\tels[inp.name] = inp;\r\n\t\t\t\t\t}else if(els[inp.name].nodeType){\r\n\t\t\t\t\t\tvar node = els[inp.name];\r\n\t\t\t\t\t\tels[inp.name] = [node, inp];\r\n\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tels[inp.name].push(inp);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tregister_els(top.getElementsByTagName(\"INPUT\"));\r\n\t\tregister_els(top.getElementsByTagName(\"SELECT\"));\r\n\r\n\t\tif (!scheduler.config.repeat_date_of_end) {\r\n\t\t\tvar formatter = scheduler.date.date_to_str(scheduler.config.repeat_date);\r\n\t\t\tscheduler.config.repeat_date_of_end = formatter(scheduler.date.add(scheduler._currentDate(), 30, \"day\"));\r\n\t\t}\r\n\t\tset_value(els, \"date_of_end\", scheduler.config.repeat_date_of_end);\r\n\r\n\t\tvar $ = function(a) {\r\n\t\t\treturn scheduler._lightbox.querySelector(`#${a}`) || { style:{} };//return fake object if node not found\r\n\t\t};\r\n\r\n\t\tfunction change_current_view() {\r\n\t\t\t$(\"dhx_repeat_day\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_week\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_month\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_year\").style.display = \"none\";\r\n\t\t\t$(\"dhx_repeat_\" + this.value).style.display = \"\";\r\n\t\t\tscheduler.setLightboxSize();\r\n\t\t}\r\n\r\n\t\tfunction get_repeat_code(dates) {\r\n\t\t\tvar code = [get_value(els, \"repeat\")];\r\n\t\t\tget_rcode[code[0]](code, dates);\r\n\r\n\t\t\twhile (code.length < 5) code.push(\"\");\r\n\t\t\tvar repeat = \"\";\r\n\r\n\t\t\tvar end = get_end_rule(els);\r\n\r\n\t\t\tif (end == \"no\") {\r\n\t\t\t\tdates.end = new Date(9999, 1, 1);\r\n\t\t\t\trepeat = \"no\";\r\n\t\t\t}\r\n\t\t\telse if (end == \"date_of_end\") {\r\n\t\t\t\tdates.end = str_date(get_value(els, \"date_of_end\"));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tscheduler.transpose_type(code.join(\"_\"));\r\n\t\t\t\trepeat = Math.max(1, get_value(els, \"occurences_count\"));\r\n\r\n\t\t\t\tvar transp = 0;\r\n\r\n\t\t\t\t//var transp = ((code[0] == \"week\" && code[4] && code[4].toString().indexOf(scheduler.config.start_on_monday ? 1 : 0) == -1) ? 1 : 0);\r\n\r\n\t\t\t\t// which is equal to following code, seems to produce extra instance, not clear why needed\r\n\r\n\t\t\t\t/*if(code[0] == \"week\"){\r\n\t\t\t\t\tvar days = code[4] || \"\";\r\n\t\t\t\t\tif(scheduler.config.start_on_monday){\r\n\t\t\t\t\t\tif(days.indexOf(1) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tif(days.indexOf(0) == -1)\r\n\t\t\t\t\t\ttransp = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\r\n\t\t\t//\tdates.end = scheduler.date.add(new Date(dates.start), repeat + transp, code.join(\"_\"));\r\n\r\n\t\t\t\tdates.end = scheduler.date[\"add_\" + code.join(\"_\")](new Date(dates.start), repeat + transp, {start_date: dates.start}) || dates.start;\r\n\t\t\t}\r\n\r\n\t\t\treturn code.join(\"_\") + \"#\" + repeat;\r\n\t\t}\r\n\t\tfunction get_end_rule(els){\r\n\t\t\tvar end = els[\"end\"];\r\n\t\t\tif(end.length){\r\n\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\tif(end[i].checked){\r\n\t\t\t\t\t\tif(end[i].value && end[i].value != \"on\"){//seems to be default value:var input = document.createElement(\"input\"); input.type = \"radio\"; input.value\r\n\t\t\t\t\t\t\treturn end[i].value;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\tif(!i){\r\n\t\t\t\t\t\t\t\treturn \"no\";\r\n\t\t\t\t\t\t\t}else if(i == 2){\r\n\t\t\t\t\t\t\t\treturn \"date_of_end\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\treturn \"occurences_count\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tif(end.value)\r\n\t\t\t\t\treturn end.value;\r\n\t\t\t}\r\n\t\t\treturn \"no\";\r\n\t\t}\r\n\t\tfunction set_end_rule(els, value){\r\n\t\t\tvar end = els[\"end\"];\r\n\r\n\t\t\tif(end.length){\r\n\t\t\t\tvar has_values = !!end[0].value && end[0].value != \"on\";\r\n\t\t\t\tif(has_values){\r\n\t\t\t\t\tfor(var i =0; i < end.length; i++){\r\n\t\t\t\t\t\tif(end[i].value == value)\r\n\t\t\t\t\t\t\tend[i].checked = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar ind = 0;\r\n\t\t\t\t\tswitch(value){\r\n\t\t\t\t\t\tcase \"no\":\r\n\t\t\t\t\t\t\tind = 0;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase \"date_of_end\":\r\n\t\t\t\t\t\t\tind = 2;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\tind = 1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tend[ind].checked = true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tend.value = value;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._get_repeat_code = get_repeat_code;\r\n\t\tvar get_rcode = {\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"month_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count\")));\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"month_day\"));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_count2\")));\r\n\t\t\t\t\tcode.push( get_value(els, \"month_day2\"));\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"month_week2\")));\r\n\t\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t},\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"week_count\")));\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tcode.push(\"\");\r\n\t\t\t\tvar t = [];\r\n\r\n\t\t\t\tvar col = get_value(els, \"week_day\", true);\r\n\t\t\t\t//var col = els[\"week_day\"];\r\n\t\t\t\tvar day = dates.start.getDay();\r\n\t\t\t\tvar start_exists = false;\r\n\r\n\t\t\t\tfor (var i = 0; i < col.length; i++){\r\n\t\t\t\t\tt.push(col[i]);\r\n\t\t\t\t\tstart_exists = start_exists || col[i] == day;\r\n\t\t\t\t}\r\n\t\t\t\tif (!t.length){\r\n\t\t\t\t\tt.push(day);\r\n\t\t\t\t\tstart_exists = true;\r\n\t\t\t\t}\r\n\t\t\t\tt.sort();\r\n\r\n\r\n\t\t\t\tif (!scheduler.config.repeat_precise){\r\n\t\t\t\t\tdates.start = scheduler.date.week_start(dates.start);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t} else if (!start_exists){\r\n\t\t\t\t\tscheduler.transpose_day_week(dates.start, t, 1, 7);\r\n\t\t\t\t\tdates._start = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcode.push(t.join(\",\"));\r\n\t\t\t},\r\n\t\t\tday:function(code) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\t\t\t\tvar get_numeric_value = scheduler.form_blocks[\"recurring\"]._get_node_numeric_value;\r\n\r\n\t\t\t\tif (get_value(els, \"day_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(Math.max(1, get_numeric_value(els, \"day_count\")));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tcode.push(\"week\");\r\n\t\t\t\t\tcode.push(1);\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(\"\");\r\n\t\t\t\t\tcode.push(scheduler.config.recurring_workdays.join(\",\"));\r\n\t\t\t\t\tcode.splice(0, 1);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar get_value = scheduler.form_blocks[\"recurring\"]._get_node_value;\r\n\r\n\t\t\t\tif (get_value(els, \"year_type\") == \"d\") {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tdates.start.setMonth(0);\r\n\t\t\t\t\tdates.start.setDate(get_value(els, \"year_day\"));\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month\"));\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcode.push(\"1\");\r\n\t\t\t\t\tcode.push(get_value(els, \"year_day2\"));\r\n\t\t\t\t\tcode.push(get_value(els, \"year_week2\"));\r\n\t\t\t\t\tdates.start.setDate(1);\r\n\t\t\t\t\tdates.start.setMonth(get_value(els, \"year_month2\"));\r\n\t\t\t\t}\r\n\t\t\t\tdates._start = true;\r\n\t\t\t}\r\n\t\t};\r\n\t\tvar set_rcode = {\r\n\t\t\tweek:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"week_count\", code[1]);\r\n\r\n\t\t\t\tvar t = code[4].split(\",\");\r\n\t\t\t\tvar d = {};\r\n\t\t\t\tfor (var i = 0; i < t.length; i++) d[t[i]] = true;\r\n\r\n\t\t\t\tset_value(els, \"week_day\", d);\r\n\r\n\t\t\t\t//for (var i = 0; i < col.length; i++)\r\n\t\t\t\t//\tcol[i].checked = (!!d[col[i].value]);\r\n\t\t\t},\r\n\t\t\tmonth:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"month_count\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_day\", dates.start.getDate());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"month_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"month_count2\", code[1]);\r\n\t\t\t\t\tset_value(els, \"month_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"month_day2\", code[2]);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tday:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\t\tset_value(els, \"day_type\", \"d\");\r\n\t\t\t\tset_value(els, \"day_count\", code[1]);\r\n\t\t\t},\r\n\t\t\tyear:function(code, dates) {\r\n\t\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\r\n\t\t\t\tif (code[2] === \"\") {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"d\");\r\n\t\t\t\t\tset_value(els, \"year_day\", dates.start.getDate());\r\n\t\t\t\t\tset_value(els, \"year_month\", dates.start.getMonth());\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tset_value(els, \"year_type\", \"w\");\r\n\t\t\t\t\tset_value(els, \"year_week2\", code[3]);\r\n\t\t\t\t\tset_value(els, \"year_day2\", code[2]);\r\n\t\t\t\t\tset_value(els, \"year_month2\", dates.start.getMonth());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfunction set_repeat_code(code, dates) {\r\n\t\t\tvar set_value = scheduler.form_blocks[\"recurring\"]._set_node_value;\r\n\t\t\tvar data = code.split(\"#\");\r\n\t\t\tcode = data[0].split(\"_\");\r\n\t\t\tset_rcode[code[0]](code, dates);\r\n\r\n\t\t\tswitch (data[1]) {\r\n\t\t\t\tcase \"no\":\r\n\t\t\t\t\tset_end_rule(els, \"no\");\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"\":\r\n\t\t\t\t\tset_end_rule(els, \"date_of_end\");\r\n\r\n\t\t\t\t\tvar end_date = dates.end;\r\n\t\t\t\t\tif (scheduler.config.include_end_by){\r\n\t\t\t\t\t\tend_date = scheduler.date.add(end_date, -1, 'day');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tset_value(els, \"date_of_end\", date_str(end_date));\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tset_end_rule(els, \"occurences_count\");\r\n\t\t\t\t\tset_value(els, \"occurences_count\", data[1]);\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tset_value(els, \"repeat\", code[0]);\r\n\t\t\t//e.checked = true;\r\n\r\n\t\t\tvar node = scheduler.form_blocks[\"recurring\"]._get_form_node(els, \"repeat\", code[0]);\r\n\t\t\tif(node.nodeName == \"SELECT\"/* && node.onchange*/){\r\n\t\t\t//\tnode.onchange();\r\n\t\t\t\tnode.dispatchEvent(new Event('change'));\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}else{\r\n\t\t\t\tnode.dispatchEvent(new MouseEvent('click'));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tscheduler.form_blocks[\"recurring\"]._set_repeat_code = set_repeat_code;\r\n\r\n\t\tfor (var i = 0; i < top.elements.length; i++) {\r\n\t\t\tvar el = top.elements[i];\r\n\t\t\tswitch (el.name) {\r\n\t\t\t\tcase \"repeat\":\r\n\t\t\t\t\tif (el.nodeName == \"SELECT\" && !el.$_eventAttached) {\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"change\", change_current_view);\r\n\t\t\t\t\t} else if(!el.$_eventAttached){\r\n\t\t\t\t\t\tel.$_eventAttached = true;\r\n\t\t\t\t\t\tel.addEventListener(\"click\", change_current_view);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._lightbox._rec_init_done = true;\r\n\t},\r\n\tset_value:function(node, value, ev) {\r\n\t\tvar rf = scheduler.form_blocks[\"recurring\"];\r\n\t\tif (!scheduler._lightbox._rec_init_done)\r\n\t\t\trf._init_set_value(node, value, ev);\r\n\t\tnode.open = !ev.rec_type;\r\n\r\n\t\tnode.blocked = this._is_modified_occurence(ev);\r\n\r\n\t\tvar ds = rf._ds;\r\n\t\tds.start = ev.start_date;\r\n\t\tds.end = ev._end_date;\r\n\r\n\t\trf._toggle_block();\r\n\r\n\t\tif (value)\r\n\t\t\trf._set_repeat_code(value, ds);\r\n\t},\r\n\tget_value:function(node, ev) {\r\n\t\tif (node.open) {\r\n\t\t\tvar ds = scheduler.form_blocks[\"recurring\"]._ds;\r\n\t\t\tvar actual_dates = {};\r\n\r\n\t\t\tvar timeControl = getTimeSection();\r\n\r\n\t\t\ttimeControl.getValue(actual_dates);\r\n\t\t\tds.start = actual_dates.start_date;\r\n\t\t\tev.rec_type = scheduler.form_blocks[\"recurring\"]._get_repeat_code(ds);\r\n\t\t\tif (ds._start) {\r\n\t\t\t\tev.start_date = new Date(ds.start);\r\n\t\t\t\tev._start_date = new Date(ds.start);\r\n\t\t\t\tds._start = false;\r\n\t\t\t} else\r\n\t\t\t\tev._start_date = null;\r\n\r\n\t\t\tev._end_date = ds.end;\r\n\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t} else {\r\n\t\t\tev.rec_type = ev.rec_pattern = \"\";\r\n\t\t\tev._end_date = ev.end_date;\r\n\t\t}\r\n\t\treturn ev.rec_type;\r\n\t},\r\n\t_get_button: function(){\r\n\t\tvar node = getRecurringSection().header;\r\n\t\treturn node.firstChild.firstChild;\r\n\t},\r\n\t_get_form: function(){\r\n\t\treturn getRecurringSection().node;\r\n\t},\r\n\topen:function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\t\tif(!cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\tclose: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form();\r\n\r\n\t\tif(cont.open)\r\n\t\t\tblock._toggle_block();\r\n\t},\r\n\t_toggle_block: function(){\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\r\n\t\tvar cont = block._get_form(),\r\n\t\t\tel = block._get_button();\r\n\t\tif (!cont.open && !cont.blocked) {\r\n\t\t\tcont.style.height = \"auto\";//reset to default value\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 0px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring_open;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcont.style.height = \"0px\";\r\n\t\t\tif(el){\r\n\t\t\t\tel.style.backgroundPosition = \"-5px 20px\";\r\n\t\t\t\tel.nextSibling.innerHTML = scheduler.locale.labels.button_recurring;\r\n\t\t\t}\r\n\t\t}\r\n\t\tcont.open = !cont.open;\r\n\r\n\t\tscheduler.setLightboxSize();\r\n\t},\r\n\tfocus:function(node) {\r\n\t},\r\n\tbutton_click:function(node, button, event) {\r\n\t\tvar block = scheduler.form_blocks.recurring;\r\n\t\tvar cont = block._get_form();\r\n\t\tif (!cont.blocked)\r\n\t\t\tscheduler.form_blocks.recurring._toggle_block();\r\n\t}\r\n};\r\n\r\nfunction getTimeSection(){\r\n\tvar timeControl = scheduler.formSection('time');\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('time');\r\n\t}\r\n\tif(!timeControl){\r\n\t\ttimeControl = getFirstSectionOfType('calendar_time');\r\n\t}\r\n\r\n\t\r\n\tif (!timeControl) {\r\n\t\tthrow new Error([\"Can't calculate the recurring rule, the Recurring form block can't find the Time control. Make sure you have the time control in 'scheduler.config.lightbox.sections' config.\",\r\n\"You can use either the default time control https://docs.dhtmlx.com/scheduler/time.html, or the datepicker https://docs.dhtmlx.com/scheduler/minicalendar.html, or a custom control. \",\r\n\"In the latter case, make sure the control is named \\\"time\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"{name:\\\"time\\\", height:72, type:\\\"YOU CONTROL\\\", map_to:\\\"auto\\\" }];\"]\r\n.join(\"\\n\"));\r\n\t}\r\n\r\n\treturn timeControl;\r\n}\r\n\r\nfunction getRecurringSection(){\r\n\tvar recurringSection = scheduler.formSection('recurring');\r\n\tif(!recurringSection){\r\n\t\trecurringSection = getFirstSectionOfType('recurring');\r\n\t}\r\n\r\n\tif (!recurringSection) {\r\n\t\tthrow new Error([\"Can't locate the Recurring form section.\",\r\n\t\t\"Make sure that you have the recurring control on the lightbox configuration https://docs.dhtmlx.com/scheduler/recurring_events.html#recurringlightbox \",\r\n\t\t\"and that the recurring control has name \\\"recurring\\\":\",\r\n\"\",\r\n\"scheduler.config.lightbox.sections = [\",\r\n\"\t{name:\\\"recurring\\\", ... }\",\r\n\"];\"].join(\"\\n\"));\r\n\r\n\t}\r\n\r\n\treturn recurringSection;\r\n}\r\n\r\nfunction getFirstSectionOfType(type){\r\n\tfor(var i = 0; i < scheduler.config.lightbox.sections.length; i++){\r\n\t\tvar section = scheduler.config.lightbox.sections[i];\r\n\t\tif(section.type === type){\r\n\t\t\treturn scheduler.formSection(section.name);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n}\r\n\r\n//problem may occur if we will have two repeating events in the same moment of time\r\nscheduler._rec_markers = {};\r\nscheduler._rec_markers_pull = {};\r\nscheduler._add_rec_marker = function(ev, time) {\r\n\tev._pid_time = time;\r\n\tthis._rec_markers[ev.id] = ev;\r\n\tif (!this._rec_markers_pull[ev.event_pid]) this._rec_markers_pull[ev.event_pid] = {};\r\n\tthis._rec_markers_pull[ev.event_pid][time] = ev;\r\n};\r\nscheduler._get_rec_marker = function(time, id) {\r\n\tvar ch = this._rec_markers_pull[id];\r\n\tif (ch) return ch[time];\r\n\treturn null;\r\n};\r\nscheduler._get_rec_markers = function(id) {\r\n\treturn (this._rec_markers_pull[id] || []);\r\n};\r\n\r\nfunction clearMilliseconds(date){\r\n//\treturn date;\r\n\treturn new Date(\r\n\t\tdate.getFullYear(), \r\n\t\tdate.getMonth(), \r\n\t\tdate.getDate(), \r\n\t\tdate.getHours(), \r\n\t\tdate.getMinutes(),\r\n\t\tdate.getSeconds(),\r\n\t\t0\r\n\t);\r\n}\r\n\r\nscheduler._rec_temp = [];\r\n(function() {\r\n\tvar old_add_event = scheduler.addEvent;\r\n\tscheduler.addEvent = function(start_date, end_date, text, id, extra_data) {\r\n\t\tvar ev_id = old_add_event.apply(this, arguments);\r\n\r\n\t\tif (ev_id && scheduler.getEvent(ev_id)) {\r\n\t\t\tvar ev = scheduler.getEvent(ev_id);\r\n\t\t\t\r\n\t\t\tif(ev.start_date){\r\n\t\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t\t}\r\n\t\t\tif(ev.end_date){\r\n\t\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t\t}\r\n\t\t\tif (this._is_modified_occurence(ev))\r\n\t\t\t\tscheduler._add_rec_marker(ev, ev.event_length * 1000);\r\n\t\t\tif (ev.rec_type)\r\n\t\t\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\t\t}\r\n\t\treturn ev_id;\r\n\t};\r\n})();\r\n\r\nscheduler.attachEvent(\"onEventIdChange\", function(id, new_id) {\r\n\tif (this._ignore_call) return;\r\n\tthis._ignore_call = true;\r\n\r\n\tif(scheduler._rec_markers[id]){\r\n\t\t//important for for correct work of scheduler.getEvents(from, to) and collision detection\r\n\t\tscheduler._rec_markers[new_id] = scheduler._rec_markers[id];\r\n\t\tdelete scheduler._rec_markers[id];\r\n\t}\r\n\r\n\tif(scheduler._rec_markers_pull[id]){\r\n\t\tscheduler._rec_markers_pull[new_id] = scheduler._rec_markers_pull[id];\r\n\t\tdelete scheduler._rec_markers_pull[id];\r\n\t}\r\n\r\n\tfor (var i = 0; i < this._rec_temp.length; i++) {\r\n\t\tvar tev = this._rec_temp[i];\r\n\t\tif (tev.event_pid == id) {\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\tthis.changeEventId(tev.id, new_id + \"#\" + tev.id.split(\"#\")[1]);\r\n\t\t}\r\n\t}\r\n\r\n\tfor(var i in this._rec_markers){\r\n\t\tvar tev = this._rec_markers[i];\r\n\t\tif(tev.event_pid == id){\r\n\t\t\ttev.event_pid = new_id;\r\n\t\t\ttev._pid_changed = true;\r\n\t\t}\r\n\t}\r\n\r\n\tvar el = scheduler._rec_markers[new_id];\r\n\tif(el && el._pid_changed) {\r\n\t\tdelete el._pid_changed;\r\n\t\tsetTimeout(function() {\r\n\t\t\tif(scheduler.$destroyed){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\tscheduler.callEvent(\"onEventChanged\", [new_id, scheduler.getEvent(new_id)]);\r\n\t\t}, 1);\r\n\t}\r\n\r\n\tdelete this._ignore_call;\r\n});\r\nscheduler.attachEvent(\"onConfirmedBeforeEventDelete\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (this._is_virtual_event(id) || (this._is_modified_occurence(ev) && ev.rec_type && ev.rec_type != 'none')) {\r\n\t\tid = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tvar tid = (id[1]) ? id[1] : Math.round(ev._pid_time / 1000);\r\n\r\n\t\tvar nev = this._copy_event(ev);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = ev.event_pid || id[0];\r\n\t\tvar timestamp = tid;\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"none\";\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t} else {\r\n\t\tif (ev.rec_type && this._lightbox_id)\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tid = sub[i].id;\r\n\t\t\t\tif (this.getEvent(id))\r\n\t\t\t\t\tthis.deleteEvent(id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventDeleted\", function(id, ev){\r\n\tif(!this._is_virtual_event(id) && this._is_modified_occurence(ev)){\r\n\t\tif(!scheduler._events[id]){\r\n\t\t\tev.rec_type = ev.rec_pattern = \"none\";\r\n\t\t\tthis.setEvent(id, ev);\r\n\t\t}\r\n\t}\r\n});\r\nscheduler.attachEvent(\"onEventChanged\", function(id, event) {\r\n\tif (this._loading) return true;\r\n\r\n\tvar ev = this.getEvent(id);\r\n\r\n\tif (this._is_virtual_event(id)) {\r\n\t\tvar id = id.split(\"#\");\r\n\t\tvar nid = this.uid();\r\n\t\tthis._not_render = true;\r\n\r\n\t\tvar nev = this._copy_event(event);\r\n\t\tnev.id = nid;\r\n\t\tnev.event_pid = id[0];\r\n\t\tvar timestamp = id[1];\r\n\t\tnev.event_length = timestamp;\r\n\t\tnev.rec_type = nev.rec_pattern = \"\";\r\n\r\n\t\tthis._add_rec_marker(nev, timestamp * 1000);\r\n\t\tthis.addEvent(nev);\r\n\r\n\t\tthis._not_render = false;\r\n\r\n\t} else {\r\n\t\tif(ev.start_date){\r\n\t\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t\t}\r\n\t\tif(ev.end_date){\r\n\t\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t\t}\r\n\r\n\t\tif (ev.rec_type && this._lightbox_id){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t\tvar sub = this._get_rec_markers(id);\r\n\t\tfor (var i in sub) {\r\n\t\t\tif (sub.hasOwnProperty(i)) {\r\n\t\t\t\tdelete this._rec_markers[sub[i].id];\r\n\t\t\t\tthis.deleteEvent(sub[i].id, true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdelete this._rec_markers_pull[id];\r\n\r\n\t\t// it's possible that after editing event is no longer exists, in such case we need to remove _select_id flag\r\n\t\tvar isEventFound = false;\r\n\t\tfor (var k = 0; k < this._rendered.length; k++) {\r\n\t\t\tif (this._rendered[k].getAttribute(this.config.event_attribute) == id)\r\n\t\t\t\tisEventFound = true;\r\n\t\t}\r\n\t\tif (!isEventFound)\r\n\t\t\tthis._select_id = null;\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventAdded\", function(id) {\r\n\tif (!this._loading) {\r\n\t\tvar ev = this.getEvent(id);\r\n\t\tif (ev.rec_type && !ev.event_length){\r\n\t\t\tthis._roll_back_dates(ev);\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventSave\", function(id, data, is_new_event) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type && data.rec_type && !this._is_virtual_event(id))\r\n\t\tthis._select_id = null;\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCreated\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (!ev.rec_type)\r\n\t\tev.rec_type = ev.rec_pattern = ev.event_length = ev.event_pid = \"\";\r\n\treturn true;\r\n});\r\nscheduler.attachEvent(\"onEventCancel\", function(id) {\r\n\tvar ev = this.getEvent(id);\r\n\tif (ev.rec_type) {\r\n\t\tthis._roll_back_dates(ev);\r\n\t\t// a bit expensive, but we need to be sure that event re-rendered, because view can be corrupted by resize , during edit process\r\n\t\tthis.render_view_data();\r\n\t}\r\n});\r\nscheduler._roll_back_dates = function(ev) {\r\n\tif(ev.start_date){\r\n\t\tev.start_date = clearMilliseconds(ev.start_date);\r\n\t}\r\n\tif(ev.end_date){\r\n\t\tev.end_date = clearMilliseconds(ev.end_date);\r\n\t}\r\n\tev.event_length = Math.round((ev.end_date.valueOf() - ev.start_date.valueOf()) / 1000);\r\n\tev.end_date = ev._end_date;\r\n\tif (ev._start_date) {\r\n\t\tev.start_date.setMonth(0);\r\n\t\tev.start_date.setDate(ev._start_date.getDate());\r\n\t\tev.start_date.setMonth(ev._start_date.getMonth());\r\n\t\tev.start_date.setFullYear(ev._start_date.getFullYear());\r\n\r\n\t}\r\n};\r\n\r\nscheduler._is_virtual_event = function(id){\r\n\treturn id.toString().indexOf(\"#\") != -1;\r\n};\r\nscheduler._is_modified_occurence = function(ev){\r\n\treturn (ev.event_pid && ev.event_pid != \"0\");\r\n};\r\n\r\nscheduler.showLightbox_rec = scheduler.showLightbox;\r\nscheduler.showLightbox = function(id) {\r\n\tvar locale = this.locale;\r\n\tvar c = scheduler.config.lightbox_recurring;\r\n\tvar ev = this.getEvent(id);\r\n\tvar pid = ev.event_pid;\r\n\tvar isVirtual = this._is_virtual_event(id);\r\n\tif (isVirtual)\r\n\t\tpid = id.split(\"#\")[0];\r\n\r\n\t// show series\r\n\tvar showSeries = function(id) {\r\n\t\tvar event = scheduler.getEvent(id);\r\n\t\tevent._end_date = event.end_date;\r\n\t\tevent.end_date = new Date(event.start_date.valueOf() + event.event_length * 1000);\r\n\t\treturn scheduler.showLightbox_rec(id); // editing series\r\n\t};\r\n\r\n\tif ( (pid || pid*1 === 0) && ev.rec_type) {\r\n\t\t// direct API call on series id\r\n\t\treturn showSeries(id);\r\n\t}\r\n\tif ( !pid || pid === '0' || ( (!locale.labels.confirm_recurring || c == 'instance') || (c == 'series' && !isVirtual)) ) {\r\n\t\t// editing instance or non recurring event\r\n\t\treturn this.showLightbox_rec(id);\r\n\t}\r\n\tif (c == 'ask') {\r\n\t\tvar that = this;\r\n\t\tscheduler.modalbox({\r\n\t\t\ttext: locale.labels.confirm_recurring,\r\n\t\t\ttitle: locale.labels.title_confirm_recurring,\r\n\t\t\twidth: \"500px\",\r\n\t\t\tposition: \"middle\",\r\n\t\t\tbuttons:[locale.labels.button_edit_series, locale.labels.button_edit_occurrence, locale.labels.icon_cancel],\r\n\t\t\tcallback: function(index) {\r\n\t\t\t\tswitch(+index) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\treturn showSeries(pid);\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\treturn that.showLightbox_rec(id);\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t} else {\r\n\t\tshowSeries(pid);\r\n\t}\r\n};\r\n\r\n\r\nscheduler.get_visible_events_rec = scheduler.get_visible_events;\r\nscheduler.get_visible_events = function(only_timed) {\r\n\tfor (var i = 0; i < this._rec_temp.length; i++)\r\n\t\tdelete this._events[this._rec_temp[i].id];\r\n\tthis._rec_temp = [];\r\n\r\n\tvar stack = this.get_visible_events_rec(only_timed);\r\n\tvar out = [];\r\n\tfor (var i = 0; i < stack.length; i++) {\r\n\t\tif (stack[i].rec_type) {\r\n\t\t\t//deleted element of series\r\n\t\t\tif (stack[i].rec_pattern != \"none\")\r\n\t\t\t\tthis.repeat_date(stack[i], out);\r\n\t\t}\r\n\t\telse out.push(stack[i]);\r\n\t}\r\n\treturn out;\r\n};\r\n\r\n\r\n(function() {\r\n\tvar old = scheduler.isOneDayEvent;\r\n\tscheduler.isOneDayEvent = function(ev) {\r\n\t\tif (ev.rec_type) return true;\r\n\t\treturn old.call(this, ev);\r\n\t};\r\n\tvar old_update_event = scheduler.updateEvent;\r\n\tscheduler.updateEvent = function(id) {\r\n\t\tvar ev = scheduler.getEvent(id);\r\n\t\tif(ev && ev.rec_type){\r\n\t\t\t//rec_type can be changed without the lightbox,\r\n\t\t\t// make sure rec_pattern updated as well\r\n\t\t\tev.rec_pattern = (ev.rec_type || \"\").split(\"#\")[0];\r\n\t\t}\r\n\t\tif (ev && ev.rec_type && !this._is_virtual_event(id)) {\r\n\t\t\tscheduler.update_view();\r\n\t\t} else {\r\n\t\t\told_update_event.call(this, id);\r\n\t\t}\r\n\t};\r\n})();\r\n\r\nscheduler.transponse_size = {\r\n\tday:1, week:7, month:1, year:12\r\n};\r\nscheduler.date.day_week = function(sd, day, week) {\r\n\tsd.setDate(1);\r\n\tvar originalMonth = scheduler.date.month_start(new Date(sd));\r\n\tweek = (week - 1) * 7;\r\n\tvar cday = sd.getDay();\r\n\tvar nday = day * 1 + week - cday + 1;\r\n\tsd.setDate(nday <= week ? (nday + 7) : nday);\r\n\tvar newMonth = scheduler.date.month_start(new Date(sd));\r\n\tif(originalMonth.valueOf() !== newMonth.valueOf()){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n};\r\nscheduler.transpose_day_week = function(sd, list, cor, size, cor2) {\r\n\tvar cday = (sd.getDay() || (scheduler.config.start_on_monday ? 7 : 0)) - cor;\r\n\tfor (var i = 0; i < list.length; i++) {\r\n\t\tif (list[i] > cday)\r\n\t\t\treturn sd.setDate(sd.getDate() + list[i] * 1 - cday - (size ? cor : cor2));\r\n\t}\r\n\tthis.transpose_day_week(sd, list, cor + size, null, cor);\r\n};\r\nscheduler.transpose_type = function(type) {\r\n\tvar transposeRecurring = \"transpose_\" + type;\r\n\tif (!this.date[transposeRecurring]) {\r\n\t\tvar recurringParts = type.split(\"_\");\r\n\t\tvar dayDurationMs = 60 * 60 * 24 * 1000;\r\n\t\tvar addRecurring = \"add_\" + type;\r\n\t\tvar recurringStepDays = this.transponse_size[recurringParts[0]] * recurringParts[1];\r\n\r\n\t\tif (recurringParts[0] == \"day\" || recurringParts[0] == \"week\") {\r\n\t\t\tvar weekDays = null;\r\n\t\t\tif (recurringParts[4]) {\r\n\t\t\t\tweekDays = recurringParts[4].split(\",\");\r\n\t\t\t\tif (scheduler.config.start_on_monday) {\r\n\t\t\t\t\tfor (var i = 0; i < weekDays.length; i++)\r\n\t\t\t\t\t\tweekDays[i] = (weekDays[i] * 1) || 7;\r\n\t\t\t\t\tweekDays.sort();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td) {\r\n\t\t\t\tvar delta = Math.floor((td.valueOf() - nd.valueOf()) / (dayDurationMs * recurringStepDays));\r\n\t\t\t\tif (delta > 0)\r\n\t\t\t\t\tnd.setDate(nd.getDate() + delta * recurringStepDays);\r\n\t\t\t\tif (weekDays)\r\n\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 1, recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc) {\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tif (weekDays) {\r\n\t\t\t\t\tfor (var count = 0; count < inc; count++)\r\n\t\t\t\t\t\tscheduler.transpose_day_week(nd, weekDays, 0, recurringStepDays);\r\n\t\t\t\t} else\r\n\t\t\t\t\tnd.setDate(nd.getDate() + inc * recurringStepDays);\r\n\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t\telse if (recurringParts[0] == \"month\" || recurringParts[0] == \"year\") {\r\n\t\t\tthis.date[transposeRecurring] = function(nd, td, seriesInstance) {\r\n\t\t\t\tvar delta = Math.ceil(((td.getFullYear() * 12 + td.getMonth() * 1 + 1) - (nd.getFullYear() * 12 + nd.getMonth() * 1 + 1)) / (recurringStepDays) - 1);\r\n\r\n\t\t\t\tif (delta >= 0){\r\n\t\t\t\t\tnd.setDate(1);\r\n\t\t\t\t\tnd.setMonth(nd.getMonth() + delta * recurringStepDays);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn scheduler.date[addRecurring](nd, 0, seriesInstance);\r\n\t\t\t\t//if (str[3]){\r\n\t\t\t\t//\tscheduler.date.day_week(nd, str[2], str[3]);\r\n\t\t\t\t//}\r\n\t\t\t};\r\n\t\t\tthis.date[addRecurring] = function(sd, inc, seriesInstance, currentCount) {\r\n\t\t\t\tif(!currentCount){\r\n\t\t\t\t\tcurrentCount = 1;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcurrentCount++;\r\n\t\t\t\t}\r\n\t\t\t\tvar maxCount = 12;\r\n\t\t\t\tif(currentCount > maxCount){\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar nd = new Date(sd.valueOf());\r\n\t\t\t\tnd.setDate(1);\r\n\r\n\r\n\t\t\t\tnd.setMonth(nd.getMonth() + inc * recurringStepDays);\r\n\t\t\t\tvar origMonth = nd.getMonth();\r\n\t\t\t\tvar origYear = nd.getFullYear();\r\n\t\t\t\tnd.setDate(seriesInstance.start_date.getDate());\r\n\t\t\t\tif (recurringParts[3]){\r\n\t\t\t\t\tscheduler.date.day_week(nd, recurringParts[2], recurringParts[3]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar correctOverflowInstances = scheduler.config.recurring_overflow_instances;\r\n\t\t\t\tif(nd.getMonth() != origMonth && correctOverflowInstances != \"none\"){\r\n\t\t\t\t\t// no such day in a month\r\n\t\t\t\t\tif(correctOverflowInstances === \"lastDay\"){\r\n\t\t\t\t\t\t// return either last day of the month\r\n\t\t\t\t\t\tnd = new Date(origYear, origMonth + 1, 0, nd.getHours(), nd.getMinutes(), nd.getSeconds(), nd.getMilliseconds());\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t// or go to the next instance\r\n\t\t\t\t\t\tnd = scheduler.date[addRecurring](new Date(origYear, origMonth + 1, 0), inc||1, seriesInstance, currentCount);\r\n\t\t\t\t\t\t// if next instance is not possible (e.g. 'repeat on 40th day of the month') null will be returned\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn nd;\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n};\r\nscheduler.repeat_date = function(ev, stack, non_render, from, to, maxCount) {\r\n\r\n\tfrom = from || this._min_date;\r\n\tto = to || this._max_date;\r\n\tvar max = maxCount || -1;\r\n\tvar td = new Date(ev.start_date.valueOf());\r\n\r\n\tvar startHour = td.getHours();\r\n\r\n\tvar visibleCount = 0;\r\n\r\n\tif (!ev.rec_pattern && ev.rec_type)\r\n\t\tev.rec_pattern = ev.rec_type.split(\"#\")[0];\r\n\r\n\tthis.transpose_type(ev.rec_pattern);\r\n\ttd = scheduler.date[\"transpose_\" + ev.rec_pattern](td, from, ev);\r\n\twhile ( td && (\r\n\t\ttd < ev.start_date ||\r\n\t\tscheduler._fix_daylight_saving_date(td,from,ev,td,new Date(td.valueOf() + ev.event_length * 1000)).valueOf() <= from.valueOf() ||\r\n\t\ttd.valueOf() + ev.event_length * 1000 <= from.valueOf())){\r\n\t\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\r\n\t}\r\n\twhile (td && (td < to && td < ev.end_date && (max < 0 || visibleCount < max))) {\r\n\t\ttd.setHours(startHour);\r\n\r\n\t\tvar timestamp = (scheduler.config.occurrence_timestamp_in_utc) ? Date.UTC(td.getFullYear(), td.getMonth(), td.getDate(), td.getHours(), td.getMinutes(), td.getSeconds()) : td.valueOf();\r\n\t\tvar ch = this._get_rec_marker(timestamp, ev.id);\r\n\t\tif (!ch) { // unmodified element of series\r\n\t\t\tvar ted = new Date(td.valueOf() + ev.event_length * 1000);\r\n\t\t\tvar copy = this._copy_event(ev);\r\n\t\t\t//copy._timed = ev._timed;\r\n\t\t\tcopy.text = ev.text;\r\n\t\t\tcopy.start_date = td;\r\n\t\t\tcopy.event_pid = ev.id;\r\n\t\t\tcopy.id = ev.id + \"#\" + Math.round(timestamp / 1000);\r\n\t\t\tcopy.end_date = ted;\r\n\r\n\t\t\tcopy.end_date = scheduler._fix_daylight_saving_date(copy.start_date, copy.end_date, ev, td, copy.end_date);\r\n\r\n\t\t\tcopy._timed = this.isOneDayEvent(copy);\r\n\r\n\t\t\tif (!copy._timed && !this._table_view && !this.config.multi_day) return;\r\n\t\t\tstack.push(copy);\r\n\r\n\t\t\tif (!non_render) {\r\n\t\t\t\tthis._events[copy.id] = copy;\r\n\t\t\t\tthis._rec_temp.push(copy);\r\n\t\t\t}\r\n\r\n\t\t\tvisibleCount++;\r\n\r\n\t\t} else\r\n\t\tif (non_render){\r\n\t\t\tif(ch.rec_type != \"none\"){\r\n\t\t\t\tvisibleCount++;\r\n\t\t\t}\r\n\t\t\tstack.push(ch);\r\n\t\t}\r\n\r\n\t\ttd = this.date[\"add_\" + ev.rec_pattern](td, 1, ev);\r\n\t//\tif(!scheduler.date[\"validate_add_\" + ev.rec_pattern](td, 1, ev.rec_pattern)){\r\n\t///\t\talert(\"detect add\")\r\n\t//\t}\r\n\t}\r\n};\r\nscheduler._fix_daylight_saving_date = function(start_date, end_date, ev, counter, default_date) {\r\n\tvar shift = start_date.getTimezoneOffset() - end_date.getTimezoneOffset();\r\n\tif (shift) {\r\n\t\tif (shift > 0) {\r\n\t\t\t// e.g. 24h -> 23h\r\n\t\t\treturn new Date(counter.valueOf() + ev.event_length * 1000 - shift * 60 * 1000);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// e.g. 24h -> 25h\r\n\t\t\treturn new Date(end_date.valueOf() - shift * 60 * 1000);\r\n\t\t}\r\n\t}\r\n\treturn new Date(default_date.valueOf());\r\n};\r\nscheduler.getRecDates = function(id, max) {\r\n\tvar ev = typeof id == \"object\" ? id : scheduler.getEvent(id);\r\n\tvar recurrings = [];\r\n\tmax = max || 100;\r\n\r\n\tif (!ev.rec_type) {\r\n\t\treturn [\r\n\t\t\t{ start_date: ev.start_date, end_date: ev.end_date }\r\n\t\t];\r\n\t}\r\n\tif (ev.rec_type == \"none\") {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tscheduler.repeat_date(ev, recurrings, true, ev.start_date, ev.end_date, max);\r\n\r\n\tvar result = [];\r\n\tfor(var i = 0; i < recurrings.length; i++){\r\n\t\tif(recurrings[i].rec_type != \"none\"){\r\n\t\t\tresult.push({start_date: recurrings[i].start_date, end_date: recurrings[i].end_date});\r\n\t\t}\r\n\t}\r\n\r\n\treturn result;\r\n};\r\nscheduler.getEvents = function(from, to) {\r\n\tvar result = [];\r\n\tfor (var a in this._events) {\r\n\t\tvar ev = this._events[a];\r\n\t\tif (ev && ev.start_date < to && ev.end_date > from) {\r\n\t\t\tif (ev.rec_pattern) {\r\n\t\t\t\tif (ev.rec_pattern == \"none\") continue;\r\n\t\t\t\tvar sev = [];\r\n\t\t\t\tthis.repeat_date(ev, sev, true, from, to);\r\n\t\t\t\tfor (var i = 0; i < sev.length; i++) {\r\n\t\t\t\t\t// if event is in rec_markers then it will be checked by himself, here need to skip it\r\n\t\t\t\t\tif (!sev[i].rec_pattern && sev[i].start_date < to && sev[i].end_date > from && !this._rec_markers[sev[i].id]) {\r\n\t\t\t\t\t\tresult.push(sev[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (!this._is_virtual_event(ev.id)) { // if it's virtual event we can skip it\r\n\t\t\t\tresult.push(ev);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n};\r\n\r\nscheduler.config.repeat_date = \"%m.%d.%Y\";\r\nscheduler.config.lightbox.sections = [\r\n\t{name:\"description\", map_to:\"text\", type:\"textarea\" , focus:true},\r\n\t{name:\"recurring\", type:\"recurring\", map_to:\"rec_type\", button:\"recurring\"},\r\n\t{name:\"time\", height:72, type:\"time\", map_to:\"auto\"}\r\n];\r\n\r\n\r\n//drop secondary attributes\r\nscheduler._copy_dummy = function(ev) {\r\n\tvar start_date = new Date(this.start_date);\r\n\tvar end_date = new Date(this.end_date);\r\n\tthis.start_date = start_date;\r\n\tthis.end_date = end_date;\r\n\tthis.event_length = this.event_pid = this.rec_pattern = this.rec_type = null;\r\n};\r\n\r\nscheduler.config.include_end_by = false;\r\nscheduler.config.lightbox_recurring = 'ask'; // series, instance\r\n\r\nscheduler.attachEvent(\"onClearAll\", function(){\r\n\tscheduler._rec_markers = {}; //clear recurring events data\r\n\tscheduler._rec_markers_pull = {};\r\n\tscheduler._rec_temp = [];\r\n});\r\n\r\n}","import getSerializator from '../core/common/get_serializable_events';\r\nexport default function(scheduler){\r\n\r\n\t\r\nconst getSerializableData = getSerializator(scheduler);\r\n\r\n//redefine this method, if you want to provide a custom set of attributes for serialization\r\nscheduler.data_attributes=function(){\r\n\tvar attrs = [];\r\n\tvar format = scheduler._helpers.formatDate;\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\t\tfor (var name in ev)\r\n\t\t\tif (name.substr(0,1) !=\"_\")\r\n\t\t\t\tattrs.push([name,((name == \"start_date\" || name == \"end_date\")?format:null)]);\r\n\t\tbreak;\r\n\t}\r\n\treturn attrs;\r\n};\r\n\r\nscheduler.toXML = function(header){\r\n\tvar xml = [];\r\n\tvar attrs = this.data_attributes();\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\t\txml.push(\"
\");\r\n\t\tfor (var i=0; i < attrs.length; i++)\r\n\t\t\txml.push(\"<\"+attrs[i][0]+\">\"+attrs[i][0]+\">\");\r\n\r\n\t\txml.push(\" \");\r\n\t}\r\n\treturn (header||\"\")+\"
\"+xml.join(\"\\n\")+\" \";\r\n};\r\n\r\nscheduler._serialize_json_value = function(value){\r\n\tif(value === null || typeof value === \"boolean\"){\r\n\t\tvalue = \"\" + value;\r\n\t}else{\r\n\t\tif(!value && value !== 0){\r\n\t\t\tvalue = \"\";\r\n\t\t}\r\n\t\tvalue = '\"' + value.toString().\r\n\t\t\treplace(/\\n/g,\"\").\r\n\t\t\treplace(/\\\\/g,\"\\\\\\\\\").\r\n\t\t\treplace(/\"/g, '\\\\\"') + '\"';\r\n\t}\r\n\treturn value;\r\n};\r\n\r\n\r\n\r\nscheduler.toJSON = function(){\r\n\treturn JSON.stringify(this.serialize());\r\n};\r\n\r\n\r\nscheduler.toICal = function(header){\r\n\tvar start = \"BEGIN:VCALENDAR\\nVERSION:2.0\\nPRODID:-//dhtmlXScheduler//NONSGML v2.2//EN\\nDESCRIPTION:\";\r\n\tvar end = \"END:VCALENDAR\";\r\n\tvar format = scheduler.date.date_to_str(\"%Y%m%dT%H%i%s\");\r\n\tvar full_day_format = scheduler.date.date_to_str(\"%Y%m%d\");\r\n\r\n\tvar ical = [];\r\n\tvar all_events = getSerializableData();\r\n\tfor (var a in all_events){\r\n\t\tvar ev = all_events[a];\r\n\r\n\r\n\t\tical.push(\"BEGIN:VEVENT\");\r\n\t\tif (!ev._timed || (!ev.start_date.getHours() && !ev.start_date.getMinutes()))\r\n\t\t\tical.push(\"DTSTART:\"+full_day_format(ev.start_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTSTART:\"+format(ev.start_date));\r\n\t\tif (!ev._timed || (!ev.end_date.getHours() && !ev.end_date.getMinutes()))\r\n\t\t\tical.push(\"DTEND:\"+full_day_format(ev.end_date));\r\n\t\telse\r\n\t\t\tical.push(\"DTEND:\"+format(ev.end_date));\r\n\t\tical.push(\"SUMMARY:\"+ev.text);\r\n\t\tical.push(\"END:VEVENT\");\r\n\t}\r\n\treturn start+(header||\"\")+\"\\n\"+ical.join(\"\\n\")+\"\\n\"+end;\r\n};\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Timeline\", scheduler.assert);\r\n}","import { TooltipManager } from \"./tooltipManager\";\r\n\r\nexport default function (scheduler: any) {\r\n\r\n\tscheduler.config.tooltip_timeout = 30;\r\n\tscheduler.config.tooltip_offset_y = 20;\r\n\tscheduler.config.tooltip_offset_x = 10;\r\n\tscheduler.config.tooltip_hide_timeout = 30;\r\n\r\n\tconst tooltipManager = new TooltipManager(scheduler);\r\n\r\n\tscheduler.ext.tooltips = tooltipManager;\r\n\r\n\tscheduler.attachEvent(\"onSchedulerReady\", function () {\r\n\r\n\t\ttooltipManager.tooltipFor({\r\n\t\t\tselector: \"[\" + scheduler.config.event_attribute + \"]\",\r\n\t\t\thtml: (event: MouseEvent) => {\r\n\t\t\t\tif (scheduler._mobile && !scheduler.config.touch_tooltip) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst targetEventId = scheduler._locate_event(event.target);\r\n\t\t\t\tif (scheduler.getEvent(targetEventId)) {\r\n\t\t\t\t\tconst event = scheduler.getEvent(targetEventId);\r\n\t\t\t\t\treturn scheduler.templates.tooltip_text(event.start_date, event.end_date, event);\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t},\r\n\t\t\tglobal: false\r\n\t\t});\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function () {\r\n\t\ttooltipManager.destructor();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onLightbox\", function () {\r\n\t\ttooltipManager.hideTooltip();\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeDrag\", function() {\r\n\t\t// GS-2377: don't hide tooltip on mobile device when ontouchstart event occurs\r\n\t\tif (scheduler._mobile && scheduler.config.touch_tooltip) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\tscheduler.attachEvent(\"onEventDeleted\", function() {\r\n\t\ttooltipManager.hideTooltip();\r\n\t\treturn true;\r\n\t});\r\n\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Tree Timeline\", scheduler.assert);\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Units\", scheduler.assert);\r\n}","export default function(scheduler){\r\n\r\nscheduler._get_url_nav = function(){\r\n\tvar p = {};\r\n\tvar data = (document.location.hash || \"\").replace(\"#\", \"\").split(\",\");\r\n\tfor (var i = 0; i < data.length; i++) {\r\n\t\tvar s = data[i].split(\"=\");\r\n\t\tif (s.length == 2)\r\n\t\t\tp[s[0]] = s[1];\r\n\t}\r\n\treturn p;\r\n};\r\n\r\nscheduler.attachEvent(\"onTemplatesReady\", function () {\r\n\tvar first = true;\r\n\tvar s2d = scheduler.date.str_to_date(\"%Y-%m-%d\");\r\n\tvar d2s = scheduler.date.date_to_str(\"%Y-%m-%d\");\r\n\tvar select_event = scheduler._get_url_nav().event || null;\r\n\r\n\tscheduler.attachEvent(\"onAfterEventDisplay\", function(ev){\r\n\t\tselect_event = null;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tscheduler.attachEvent(\"onBeforeViewChange\", function (om, od, m, d) {\r\n\t\tif (first) {\r\n\t\t\tfirst = false;\r\n\t\t\tvar p = scheduler._get_url_nav();\r\n\r\n\t\t\tif (p.event){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tif(scheduler.getEvent(p.event)){\r\n\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar handler = scheduler.attachEvent(\"onXLE\", function(){\r\n\t\t\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t\t\tshowEvent(p.event);\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tscheduler.detachEvent(handler);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (e){}\r\n\t\t\t}\r\n\r\n\t\t\tif (p.date || p.mode) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), (p.mode || null));\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//assuming that mode is not available anymore\r\n\t\t\t\t\tthis.setCurrentView((p.date ? s2d(p.date) : null), m);\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar values = [\r\n\t\t\t\"date=\" + d2s(d || od),\r\n\t\t\t\"mode=\" + (m || om)\r\n\t\t];\r\n\r\n\t\tif(select_event){\r\n\t\t\tvalues.push(\"event=\" + select_event);\r\n\t\t}\r\n\r\n\t\tvar text = \"#\" + values.join(\",\");\r\n\t\tdocument.location.hash = text;\r\n\t\treturn true;\r\n\t});\r\n\r\n\tfunction showEvent(e){\r\n\t\tif(scheduler.$destroyed){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tselect_event = e;\r\n\t\tif(scheduler.getEvent(e)){\r\n\t\t\tscheduler.showEvent(e);\r\n\t\t}\r\n\t}\r\n});\r\n}","import notImplemented from \"./not_implemented_extension\";\r\n\r\nexport default function(scheduler){\r\n\tnotImplemented.alert(\"Week Agenda\", scheduler.assert);\r\n}","export default function(scheduler){\r\nscheduler.attachEvent(\"onLightBox\",function(){\r\n\tif (this._cover){\r\n\t\ttry{\r\n\t\t\tthis._cover.style.height = this.expanded ? \"100%\" : ((document.body.parentNode||document.body).scrollHeight+\"px\");\r\n\t\t} catch(e) {\r\n\r\n\t\t}\r\n\t}\r\n});\r\n\r\nscheduler.form_blocks.select.set_value=function(node,value,ev){\r\n\tif (typeof value == \"undefined\" || value === \"\")\r\n\t\tvalue = (node.firstChild.options[0]||{}).value;\r\n\tnode.firstChild.value=value||\"\";\r\n};\r\n\r\n}","export default function(scheduler){\r\n\r\n\t// scheduler.config.year_x = 4;\r\n\t// scheduler.config.year_y = 3;\r\n\t// scheduler.xy.year_top = 0;\r\n\r\n\tscheduler.templates.year_date = function(date) {\r\n\t\treturn scheduler.date.date_to_str(scheduler.locale.labels.year_tab + \" %Y\")(date);\r\n\t};\r\n\tscheduler.templates.year_month = scheduler.date.date_to_str(\"%F\");\r\n\tscheduler.templates.year_scale_date = scheduler.date.date_to_str(\"%D\");\r\n\tscheduler.templates.year_tooltip = function(s, e, ev) {\r\n\t\treturn ev.text;\r\n\t};\r\n\r\n\tconst isYearMode = function() {\r\n\t\treturn scheduler._mode == \"year\";\r\n\t};\r\n\t\r\n\tconst getCellDate = function(node){\r\n\t\tvar day = scheduler.$domHelpers.closest(node, \"[data-cell-date]\");\r\n\t\tif(!day || !day.hasAttribute(\"data-cell-date\")) return null;\r\n\t\treturn scheduler.templates.parse_date(day.getAttribute(\"data-cell-date\"));\r\n\t};\r\n\r\n\t// dbl click hook for scheduler._on_dbl_click\r\n\tscheduler.dblclick_dhx_year_grid= function(e) {\r\n\t\tif (isYearMode()) {\r\n\t\t\tconst target = e.target;\r\n\t\t\tif(scheduler.$domHelpers.closest(target, \".dhx_before\") || scheduler.$domHelpers.closest(target, \".dhx_after\")){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tconst date = getCellDate(target);\r\n\t\t\t\r\n\t\t\tif(date){\r\n\t\t\t\tconst start = date;\r\n\t\t\t\tconst end = this.date.add(start, 1, \"day\");\r\n\t\t\t\tif (!this.config.readonly && this.config.dblclick_create){\r\n\t\t\t\t\tthis.addEventNow(start.valueOf(), end.valueOf(), e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\r\n\tscheduler.attachEvent(\"onEventIdChange\", function(){\r\n\t\tif (isYearMode())\r\n\t\t\tthis.year_view(true);\r\n\t});\r\n\r\n\r\n\tvar old = scheduler.render_data;\r\n\tscheduler.render_data = function(evs) {\r\n\t\tif (!isYearMode()) return old.apply(this, arguments);\r\n\t\tfor (var i = 0; i < evs.length; i++)\r\n\t\t\tthis._year_render_event(evs[i]);\r\n\t};\r\n\r\n\tvar clear = scheduler.clear_view;\r\n\tscheduler.clear_view = function() {\r\n\t\tif (!isYearMode()) return clear.apply(this, arguments);\r\n\t\tvar dates = scheduler._year_marked_cells,\r\n\t\t\tdiv = null;\r\n\t\tfor (var date in dates) {\r\n\t\t\tif (dates.hasOwnProperty(date)) {\r\n\t\t\t\tdiv = dates[date];\r\n\t\t\t\tdiv.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n\t\t\t\t// div.className = \"dhx_month_head\";\r\n\t\t\t\t// div.removeAttribute(\"date\");\r\n\t\t\t\t// div.removeAttribute(\"data-year-date\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tscheduler._year_marked_cells = {};\r\n\t};\r\n\r\n\tscheduler._hideToolTip = function() {\r\n\t\tif (this._tooltip) {\r\n\t\t\tthis._tooltip.style.display = \"none\";\r\n\t\t\tthis._tooltip.date = new Date(9999, 1, 1);\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler._showToolTip = function(date, pos, e, src) {\r\n\t\tif (this._tooltip) {\r\n\t\t\tif (this._tooltip.date.valueOf() == date.valueOf()) return;\r\n\t\t\tthis._tooltip.innerHTML = \"\";\r\n\t\t} else {\r\n\t\t\tvar t = this._tooltip = document.createElement(\"div\");\r\n\t\t\tt.className = \"dhx_year_tooltip\";\r\n\t\t\tif (this.config.rtl) t.className += \" dhx_tooltip_rtl\";\r\n\t\t\tdocument.body.appendChild(t);\r\n\t\t\tt.addEventListener(\"click\", scheduler._click.dhx_cal_data);\r\n\t\t\tt.addEventListener(\"click\", function(e){\r\n\t\t\t\tif(e.target.closest(`[${scheduler.config.event_attribute}]`)){\r\n\t\t\t\t\tconst id = e.target.closest(`[${scheduler.config.event_attribute}]`).getAttribute(scheduler.config.event_attribute);\r\n\t\t\t\t\tscheduler.showLightbox(id);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tvar evs = this.getEvents(date, this.date.add(date, 1, \"day\"));\r\n\t\tvar html = \"\";\r\n\r\n\t\tfor (var i = 0; i < evs.length; i++) {\r\n\t\t\tvar ev = evs[i];\r\n\t\t\tif(!this.filter_event(ev.id, ev))\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\tvar bg_color = (ev.color ? (\"--dhx-scheduler-event-background:\" + ev.color + \";\") : \"\");\r\n\t\t\tvar color = (ev.textColor ? (\"--dhx-scheduler-event-color:\" + ev.textColor + \";\") : \"\");\r\n\r\n\t\t\thtml += \"
\";\r\n\t\t}\r\n\r\n\t\tthis._tooltip.style.display = \"\";\r\n\t\tthis._tooltip.style.top = \"0px\";\r\n\r\n\r\n\t\tif (document.body.offsetWidth - pos.left - this._tooltip.offsetWidth < 0)\r\n\t\t\tthis._tooltip.style.left = pos.left - this._tooltip.offsetWidth + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.left = pos.left + src.offsetWidth + \"px\";\r\n\r\n\t\tthis._tooltip.date = date;\r\n\t\tthis._tooltip.innerHTML = html;\r\n\r\n\t\tif (document.body.offsetHeight - pos.top - this._tooltip.offsetHeight < 0)\r\n\t\t\tthis._tooltip.style.top = pos.top - this._tooltip.offsetHeight + src.offsetHeight + \"px\";\r\n\t\telse\r\n\t\t\tthis._tooltip.style.top = pos.top + \"px\";\r\n\t};\r\n\r\n\tscheduler._year_view_tooltip_handler = function(e){\r\n\t\tif (!isYearMode()) return;\r\n\r\n\t\tvar src = e.target || e.srcElement;\r\n\t\tif (src.tagName.toLowerCase() == 'a') // fix for active links extension (it adds links to the date in the cell)\r\n\t\t\tsrc = src.parentNode;\r\n\t\tif (scheduler._getClassName(src).indexOf(\"dhx_year_event\") != -1)\r\n\t\t\tscheduler._showToolTip(scheduler.templates.parse_date(src.getAttribute(\"data-year-date\")), scheduler.$domHelpers.getOffset(src), e, src);\r\n\t\telse\r\n\t\t\tscheduler._hideToolTip();\r\n\t};\r\n\tscheduler._init_year_tooltip = function() {\r\n\t\tscheduler._detachDomEvent(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t\tscheduler.event(scheduler._els[\"dhx_cal_data\"][0], \"mouseover\", scheduler._year_view_tooltip_handler);\r\n\t};\r\n\r\n\tscheduler._get_year_cell = function(d) {\r\n\t\tvar dateString = scheduler.templates.format_date(d);\r\n\t\tvar cells = this.$root.querySelectorAll(`.dhx_cal_data .dhx_cal_datepicker_date[data-cell-date=\"${dateString}\"]`);\r\n\t\tfor(var i = 0; i < cells.length; i++){\r\n\t\t\tif(!scheduler.$domHelpers.closest(cells[i], \".dhx_after, .dhx_before\")){\r\n\t\t\t\treturn cells[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t};\r\n\r\n\tscheduler._year_marked_cells = {};\r\n\tscheduler._mark_year_date = function(date, event) {\r\n\t\tvar dateString = scheduler.templates.format_date(date);\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar ev_class = this.templates.event_class(event.start_date, event.end_date, event);\r\n\t\tif (!scheduler._year_marked_cells[dateString]) {\r\n\t\t\tcell.classList.add(\"dhx_year_event\", \"dhx_cal_datepicker_event\");// = \"dhx_month_head dhx_year_event\";\r\n\t\t\tcell.setAttribute(\"data-year-date\", dateString);\r\n\t\t\tcell.setAttribute(\"date\", dateString);\r\n\t\t\tscheduler._year_marked_cells[dateString] = cell;\r\n\t\t}\r\n\t\tif(ev_class){\r\n\t\t\tcell.classList.add(ev_class);\r\n\t\t}\r\n\t};\r\n\tscheduler._unmark_year_date = function(date) {\r\n\t\tvar cell = this._get_year_cell(date);\r\n\t\tif (!cell) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tcell.classList.remove(\"dhx_year_event\", \"dhx_cal_datepicker_event\");\r\n//\t\tcell.className = \"dhx_month_head\";\r\n\t};\r\n\tscheduler._year_render_event = function(event) {\r\n\t\tvar date = event.start_date;\r\n\t\tif (date.valueOf() < this._min_date.valueOf()){\r\n\t\t\tdate = this._min_date;\r\n\t\t} else {\r\n\t\t\tdate = this.date.date_part(new Date(date));\r\n\t\t}\r\n\r\n\t\twhile (date < event.end_date) {\r\n\t\t\tthis._mark_year_date(date, event);\r\n\t\t\tdate = this.date.add(date, 1, \"day\");\r\n\t\t\tif (date.valueOf() >= this._max_date.valueOf())\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tscheduler.year_view = function(mode) {\r\n\r\n\t\tscheduler.set_sizes();\r\n\r\n\t\tscheduler._table_view = mode;\r\n\r\n\t\tif (this._load_mode && this._load()) return;\r\n\r\n\t\tif (mode) {\r\n\t\t\tscheduler._init_year_tooltip();\r\n\t\t\tscheduler._reset_year_scale();\r\n\t\t\tif (scheduler._load_mode && scheduler._load()){\r\n\t\t\t\tscheduler._render_wait = true;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tscheduler.render_view_data();\r\n\t\t} else {\r\n\t\t\tscheduler._hideToolTip();\r\n\t\t}\r\n\t};\r\n\tscheduler._reset_year_scale = function() {\r\n\t\tthis._cols = [];\r\n\t\tthis._colsS = {};\r\n\t\tvar week_starts = []; //start day of first week in each month\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tvar c = this.config;\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tvar dy = Math.floor((parseInt(dataArea.style.height) - scheduler.xy.year_top) / c.year_y);\r\n\t\tif (dy < 190) {\r\n\t\t\tdy = 190;\r\n\t\t}\r\n\r\n\t\tvar week_template = document.createElement(\"div\");\r\n\t\tvar dummy_date = this.date.week_start(scheduler._currentDate());\r\n\r\n\t\tthis._process_ignores(dummy_date, 7, \"day\", 1);\r\n\r\n\t\tfor (var i = 0; i < 7; i++) {\r\n\t\t\tif(!(this._ignores && this._ignores[i])) {\r\n\t\t\t\tthis._cols[i] = 'var(--dhx-scheduler-datepicker-cell-size)';\r\n\t\t\t\tthis._render_x_header(i, 0, dummy_date, week_template);\r\n\r\n\t\t\t}\r\n\t\t\tdummy_date = this.date.add(dummy_date, 1, \"day\");\r\n\t\t}\r\n\t\tweek_template.lastChild.className += \" dhx_scale_bar_last\";\r\n\r\n\t\tfor(var i = 0; i < week_template.childNodes.length; i++){\r\n\t\t\tthis._waiAria.yearHeadCell(week_template.childNodes[i]);\r\n\t\t}\r\n\r\n\t\tvar sd = this.date[this._mode + \"_start\"](this.date.copy(this._date));\r\n\t\tvar ssd = sd;\r\n\t\tvar yearBox = null;\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\t\tfor (var i = 0; i < c.year_y; i++){\r\n\t\t\tfor (var j = 0; j < c.year_x; j++) {\r\n\t\t\t\tyearBox = document.createElement(\"div\");\r\n\t\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(sd));\r\n\t\t\t\tyearBox.innerHTML = \"
\" + week_template.innerHTML + \"
\";\r\n\r\n\t\t\t\tvar header = yearBox.querySelector(\".dhx_year_month\");\r\n\t\t\t\tvar grid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\t\tvar body = yearBox.querySelector(\".dhx_year_body\");\r\n\r\n\t\t\t\tvar headerId = scheduler.uid();\r\n\t\t\t\tthis._waiAria.yearHeader(header, headerId);\r\n\t\t\t\tthis._waiAria.yearGrid(grid, headerId);\r\n\r\n\r\n\t\t\t\theader.innerHTML = this.templates.year_month(sd);\r\n\r\n\r\n\r\n\t\t\t\tvar dd = this.date.week_start(sd);\r\n\t\t\t\tthis._reset_month_scale(body, sd, dd, 6);\r\n\r\n\t\t\t\tvar days = body.querySelectorAll(\"td\");\r\n\t\t\t\tfor(var day = 0; day < days.length; day++){\r\n\t\t\t\t\tthis._waiAria.yearDayCell(days[day]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\t\tweek_starts[i * c.year_x + j] = (sd.getDay() - (this.config.start_on_monday ? 1 : 0) + 7) % 7;\r\n\t\t\t\tsd = this.date.add(sd, 1, \"month\");\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](ssd, sd, this._mode);\r\n\t\t}\r\n\r\n\t\tthis.week_starts = week_starts;\r\n\t\tweek_starts._month = ssd.getMonth();\r\n\t\tthis._min_date = ssd;\r\n\t\tthis._max_date = sd;\r\n\t};\r\n\r\n\tscheduler._reset_year_scale = function(){\r\n\r\n\t\tvar dataArea = this._els[\"dhx_cal_data\"][0];\r\n\r\n\t\tdataArea.scrollTop = 0; //fix flickering in FF\r\n\t\tdataArea.innerHTML = \"\";\r\n\r\n\t\tlet yearStart = this.date.year_start(new Date(this._date));\r\n\t\t\r\n\t\tthis._min_date = this.date.week_start(new Date(yearStart));\r\n\r\n\t\tconst wrapper = document.createElement(\"div\");\r\n\t\twrapper.classList.add(\"dhx_year_wrapper\");\r\n\r\n\t\tlet currentDate = yearStart;\r\n\t\tfor(let i = 0; i < 12; i++){\r\n\t\t\tlet yearBox = document.createElement(\"div\");\r\n\t\t\tyearBox.className = \"dhx_year_box\";\r\n\r\n\t\t\tyearBox.setAttribute(\"date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.setAttribute(\"data-month-date\", this._helpers.formatDate(currentDate));\r\n\t\t\tyearBox.innerHTML = `
${this.templates.year_month(currentDate)}
\r\n\t\t\t
`;\r\n\r\n\t\t\tconst yearGrid = yearBox.querySelector(\".dhx_year_grid\");\r\n\t\t\tconst datepicker = scheduler._createDatePicker(null, {\r\n\t\t\t\tdate: currentDate,\r\n\t\t\t\tfilterDays: scheduler.ignore_year,\r\n\t\t\t\tminWeeks: 6\r\n\t\t\t});\r\n\t\t\tdatepicker._renderDayGrid(yearGrid);\r\n\t\t\tdatepicker.destructor();\r\n\r\n\t\t\twrapper.appendChild(yearBox);\r\n\r\n\t\t\tcurrentDate = this.date.add(currentDate, 1, \"month\");\r\n\r\n\t\t}\r\n\t\tdataArea.appendChild(wrapper);\r\n\r\n\t\tlet lastDate = this.date.add(yearStart, 1, \"year\");\r\n\t\tif(lastDate.valueOf() != this.date.week_start(new Date(lastDate)).valueOf()){\r\n\t\t\tlastDate = this.date.week_start(new Date(lastDate));\r\n\t\t\tlastDate = this.date.add(lastDate, 1, \"week\");\r\n\t\t}\r\n\t\tthis._max_date = lastDate;\r\n\t\tvar dateElement = this._getNavDateElement();\r\n\t\tif(dateElement){\r\n\t\t\tdateElement.innerHTML = this.templates[this._mode + \"_date\"](yearStart, lastDate, this._mode);\r\n\t\t}\r\n\t};\r\n\r\n\tvar getActionData = scheduler.getActionData;\r\n\tscheduler.getActionData = function(n_ev) {\r\n\t\tif(!isYearMode()){\r\n\t\t\treturn getActionData.apply(scheduler, arguments);\r\n\t\t}\r\n\t\t\r\n\t\tvar date = getCellDate(n_ev.target);\r\n\t\treturn {\r\n\t\t\tdate:date,\r\n\t\t\tsection:null\r\n\t\t};\r\n\t};\r\n\r\n\tvar locateEvent = scheduler._locate_event;\r\n\tscheduler._locate_event = function(node) {\r\n\t\tvar id = locateEvent.apply(scheduler, arguments);\r\n\t\tif(!id){\r\n\t\t\t\r\n\t\t\tvar date = getCellDate(node);\r\n\t\t\tif(!date) return null;\r\n\t\t\tvar evs = scheduler.getEvents(date, scheduler.date.add(date, 1, \"day\"));\r\n\t\t\tif(!evs.length) return null;\r\n\r\n\t\t\t//can be multiple events in the cell, return any single one\r\n\t\t\tid = evs[0].id;\r\n\t\t}\r\n\t\treturn id;\r\n\t};\r\n\r\n\tscheduler.attachEvent(\"onDestroy\", function(){\r\n\t\tscheduler._hideToolTip();\r\n\t});\r\n}","import SchedulerFactory from \"./scheduler_factory\";\r\nimport gplExtensions from \"./ext/extensions_gpl\";\r\n\r\nconst factory = new SchedulerFactory(gplExtensions);\r\n\r\nconst scheduler = factory.getSchedulerInstance();\r\nconst Scheduler = {\r\n\tplugin: scheduler.bind(factory.plugin, factory)\r\n};\r\n\r\nwindow.scheduler = scheduler;\r\nwindow.Scheduler = Scheduler;\r\n\r\nif(!window.$dhx) {\r\n\twindow.$dhx = {};\r\n}\r\n\r\nwindow.$dhx.scheduler = scheduler;\r\nwindow.$dhx.Scheduler = Scheduler;\r\n\r\nexport default scheduler;export { scheduler, Scheduler };","\r\n\r\nimport dhtmlxHook from \"./dhtmlx_hook\";\r\nimport \"./css/theme.less\";\r\ndhtmlxHook();\r\n\r\nimport global from \"./global\";\r\n\r\nimport factoryMethod from \"./scheduler_factory_method\";\r\nimport ExtensionsManager from \"./ext/extension_manager\";\r\n\r\nclass SchedulerFactory {\r\n\r\n\tconstructor (extensions) {\r\n\t\tthis._seed = 0;\r\n\t\tthis._schedulerPlugins = [];\r\n\t\tthis._bundledExtensions = extensions;\r\n\t\tthis._extensionsManager = new ExtensionsManager(extensions);\r\n\t}\r\n\r\n\tplugin(code) {\r\n\t\tthis._schedulerPlugins.push(code);\r\n\r\n\t\tif(global.scheduler){\r\n\t\t\tcode(global.scheduler);\r\n\t\t}\r\n\t}\r\n\t\r\n\tgetSchedulerInstance(initConfig) {\r\n\t\tvar scheduler = factoryMethod(this._extensionsManager);\r\n\r\n\t\tfor (var i = 0; i < this._schedulerPlugins.length; i++) {\r\n\t\t\tthis._schedulerPlugins[i](scheduler);\r\n\t\t}\r\n\t\tscheduler._internal_id = this._seed++;\r\n\t\r\n\t\tif (this.$syncFactory){\r\n\t\t\tthis.$syncFactory(scheduler);\r\n\t\t}\r\n\r\n\t\tif(initConfig){\r\n\t\t\tthis._initFromConfig(scheduler, initConfig);\r\n\t\t}\r\n\r\n\t\treturn scheduler;\r\n\t}\r\n\r\n\t_initFromConfig(scheduler, initConfig){\r\n\t\tif(initConfig.plugins){\r\n\t\t\tscheduler.plugins(initConfig.plugins);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.config){\r\n\t\t\tscheduler.mixin(scheduler.config, initConfig.config, true);\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.templates){\r\n\t\t\tscheduler.attachEvent(\"onTemplatesReady\", function(){\r\n\t\t\t\tscheduler.mixin(scheduler.templates, initConfig.templates, true);\r\n\t\t\t}, {once: true});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.events){\r\n\t\t\tfor(const event in initConfig.events){\r\n\t\t\t\tscheduler.attachEvent(event, initConfig.events[event]);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.locale){\r\n\t\t\tscheduler.i18n.setLocale(initConfig.locale);\r\n\t\t}\r\n\t\r\n\t\tif(Array.isArray(initConfig.calendars)){\r\n\t\t\tinitConfig.calendars.forEach(function(calendar){\r\n\t\t\t\tscheduler.addCalendar(calendar);\r\n\t\t\t});\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.container){\r\n\t\t\tscheduler.init(initConfig.container);\r\n\t\t} else {\r\n\t\t\tscheduler.init();\r\n\t\t}\r\n\t\r\n\t\tif(initConfig.data){\r\n\t\t\tif(typeof initConfig.data === \"string\"){\r\n\t\t\t\tscheduler.load(initConfig.data);\r\n\t\t\t}else{\r\n\t\t\t\tscheduler.parse(initConfig.data);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n}\r\n\r\nexport default SchedulerFactory;"],"names":["global$1","window","global","dragHighlightPos","scheduler","dndMarkers","dragStarted","eventNode","event","isEnabled","config","drag_highlight","markTimespan","checkViewName","viewName","viewObj","getView","layout","createMarkerConfig","configSettings","sectionId","style","top","left","marginLeft","sections","markerObject","start_date","end_date","css","html","date","add","createViewMarker","settings","markerConfigs","monthViewMarkersArray","weekDates","currDate","Date","valueOf","obj","push","week_start","cells","$container","querySelectorAll","event_attribute","id","i","length","cloneNode","unitMarkersArray","sectionPropertyName","y_property","map_to","formatedSections","String","split","section_delimiter","map","element","elems","columnViewMarkersArray","eventNodes","eventNodeClone","getAttribute","forEach","cfg","attachEvent","mode","e","getEvent","target","closest","getState","cascade_event_display","unselect","getActionData","section","n","unmarkTimespan","limitPlugin","mark_now","display_marked_timespans","overwrite_marked_timespans","dhx_time_block","default_timespan_type","get_resulting_options","days","zones","options","type","getZones","ev","timespans","day_index","day_value","timespan_type","s","containers","_props","matrix","container","property","view","linker","_add_timespan_zones","_get_blocked_zones","blockTime","addMarkedTimespan","unblockTime","deleteMarkedTimespan","checkInMarkedTimespan","on_overlap","res","temp_start_date","temp_end_date","_marked_timespans","date_part","getDay","eventStart","_get_zone_minutes","eventEnd","getDate","markerStart","markerEnd","checkLimitViolation","check_limits","c","evs","rec_type","_end_date","seriesEnd","limit_start","limit_end","complete_res","p","_timed","isOneDayEvent","allow","_drag_id","_drag_mode","setHours","setMinutes","checkEvent","callEvent","timeline_zones","blocked_timeline_zones","this","_get_relevant_blocked_zones","resultZones","concat","_mark_now","hide","dhx_now_time","_els","now","_currentDate","_remove_mark_now","_max_date","_min_date","getHours","first_hour","last_hour","locate_holder_day","_append_mark_now","zone_start","_table_view","_mode","start_index","end_index","units_l","size","position","r_divs","t_day","t_div","_render_marked_timespan","els","div","parent","parentNode","removeChild","getMinutes","_prepare_timespan_options","r_configs","temp_configs","Array","t_days","slice","cloned_config","_lame_clone","apply","undefined","invert_zones","invertZones","uid","view_key","hasOwnProperty","ids","t_config","_lame_copy","k","c_config","t_sd","t_ed","zone_end","_get_dates_by_index","index","start","end","dates","start_day","delta","t_date","_get_css_classes_by_config","css_classes","join","_get_block_by_config","block","document","createElement","innerHTML","appendChild","area","day","blocks","min_date","max_date","date_to_display","min_day","areas","d","_scales","sday","_cols","_ignores","block_proto","className","height","width","order","inner_index","locate_holder","Math","max","min","all_hours_height","hour_size_px","hour_ms","round","_mark_timespans","data","divs","_on_scale_add_marker","len","childNodes","firstChild","_getClassName","indexOf","configuration","Error","rebuild_els","get_elements","timespans_ids","_marked_timespans_ids","timespan_types","_marked_timespans_types","_addMarkerTimespanConfig","unit_id","timespans_view","day_configs","_array","configs","current_zones","resulting_zones","c_zone_start","c_zone_end","isLast","offset","splice","_subtract_timespan_zones","is_modified","_","_delete_marked_timespan_by_id","parent_array","_delete_marked_timespan_by_config","viewspans","_delete_marked_timespans_list","dayConfig","day_timespans","d_t","related_zones","arguments","types","t","typedConfig","_get_types_to_render","common","specific","types_to_render","_get_configs_to_render","units","unit","_get_unit_index","day_ind","unitsPerDay","floor","_date","key","unit_zones","unit_types","global_data","day_types","dblclick_dhx_marked_timespan","src","dblclick_create","addEventNow","createMethod","methods","isActive","disableMethod","methodName","dummyMethod","restoreMethod","disableMethods","methodsHash","call","restoreMethods","batchUpdatePayload","callback","console","error","$stateProvider","registerProvider","batch_update","noRedraw","dp_mode","call_dp","_dp","updateMode","setUpdateMode","calls","setModeDate","needRender","needUpdateView","repaintEvents","rememberModeDate","render","setCurrentView","updateView","render_data","render_view_data","updateEvent","sendData","initPlugins","deletedEvent","copy","undo_deleted","new_event","message","text","expire","addEvent","limit","batchUpdate","uidSeed","isDate","getFullYear","getMonth","utils","mixin","source","force","f","object","result","isArray","pop","Function","prototype","toString","constructor","Number","Boolean","varType","Object","defined","delay","timeout","timer","$cancelTimeout","$pending","args","setTimeout","clearTimeout","$execute","extend","cssClass","classList","itemTypes","rows_container","row","setAttribute","fix_tab_position","$firstTab","$lastTab","$segmentedTab","button","builtInButton","spacer","minicalendarButton","minicalendarDiv","click","$_eventAttached","isCalendarVisible","destroyCalendar","renderCalendar","navigation","handler","calendar","html_element","renderElement","renderer","rows","cols","value","align","justifyContent","prepareConfig","renderLayout","items","fragment","createDocumentFragment","next","_init_nav_bar","navBar","querySelector","_update_nav_bar","previousHeight","heightChanged","newHeight","xy","nav_height","unset_actions","set_actions","display","isAttachedNode","root","body","getWindowSize","w","innerWidth","documentElement","clientWidth","h","innerHeight","clientHeight","listenWindowResize","resizeDelay","oldSize","$destroyed","a","b","newSize","triggerSchedulerResize","$root","getComputedStyle","getPropertyValue","resizeWatcher","tabIndex","wai_aria_attributes","offsetHeight","previousWidth","offsetWidth","lowlevelResizeWatcher","contentWindow","EventHost","_silent_mode","listeners","_silentStart","createEventStorage","handlers","eventStorage","combinedResult","handlerResult","handlerId","once","originalHandler","removeEvent","clear","makeEventable","eventHost","eventName","toLowerCase","thisObject","bind","attachAll","name","eventArguments","handlerName","detachEvent","list","eventId","detachAllEvents","defaultDomEvents","el","addEventListener","eventRemove","removeEventListener","domEvents","eventScope","attach","capture","detach","detachAll","staticArray","_eventRemoveAll","_createDomEventScope","_trim","str","trim","replace","_isDate","_isObject","getClassName","node","baseVal","locateCss","classname","strict","trg","srcElement","ind","charAt","right","isVisible","visibility","currentStyle","hiddenSection","recurringSection","hasNonNegativeTabIndex","isNaN","hasHref","nodeName","loLowerCase","input","select","textarea","hasAttribute","isShadowDomSupported","head","createShadowRoot","attachShadow","getRootNode","ShadowRoot","host","dom_helpers","getAbsoluteLeft","htmlObject","getOffset","getAbsoluteTop","getOffsetSum","elem","parseInt","offsetTop","offsetLeft","offsetParent","getOffsetRect","box","getBoundingClientRect","test","navigator","userAgent","dummy","dummyBox","docElem","scrollTop","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","selector","insertAfter","newNode","referenceNode","nextSibling","insertBefore","remove","isChildOf","child","contains","getFocusableNodes","nodes","nodesArray","$position","sort","hasShadowParent","getActiveElement","activeElement","shadowRoot","getSelection","focusNode","getRelativeEventPosition","bottom","y","x","clientX","clientY","getTargetNode","tagName","composedPath","getNodePosition","Element","matches","msMatchesSelector","webkitMatchesSelector","parentElement","nodeType","isWindowAwailable","env","isIE","isOpera","isChrome","isKHTML","isFF","isIPad","search","isEdge","isNode","serialize$1","serialized","encodeURIComponent","JSON","stringify","generateStringToDate","format","utc","splt","mask","match","code","csp_str_to_date","set","temp","locale","month_short_hash","month_full_hash","UTC","cspEnabled","useCsp","csp","init","month_short","month_full","old","setSeconds","setMilliseconds","setTime","getTime","time_part","getTimezoneOffset","shift","start_on_monday","month_start","setDate","year_start","setMonth","day_start","_add_days","inc","ndate","rest","hours","setYear","to_fixed","num","date_to_str","getUTCDate","getUTCMonth","getUTCFullYear","day_short","getUTCDay","day_full","getUTCHours","getUTCMinutes","getUTCSeconds","getSeconds","getUTCISOWeek","getISOWeek","str_to_date","exactFormat","stringToDateMethod","parseExactFormat","yyyyMMddhhIIss","MMddyyyyhhIIss","ddMMyyyyhhIIss","ISO8601","parseYMD","parseMDY","parseDMY","dateString","parse_exact_format","datestr","nday","first_thursday","year_number","ordinal_date","convert_to_utc","getSerializator","_events","_loaded","_load","url","from","_load_url","to","prevent_cache","_load_mode","lf","templates","load_format","cache_line","temp_to","ajax","get","ajaxCallback","response","on_load","_parsers","xml","canParse","xhr","responseXML","xmlDoc","parse","responseText","topElement","xmltop","loader","csrfToken","dhtmlx","security_key","opts","xpath","arr","serverList","itms","j","attrs","attributes","label","attr","nodeValue","ud","udx","_xmlNodeToJSON","_userdata","_init_event","json","events","dhx_security","collections","collections_loaded","collection","option","option_key","ical","RegExp","c_start","c_end","incoming","event_r","e_start","e_end","exec","param","param_r","parse_param","substr","parse_date","dh","dm","utcMark","dy","dn","dd","server_utc","foundParser","parser","_process","status","_process_loading","_loading","_not_render","_render_wait","_after_call","_tagvalue","_init_date","_helpers","parseDate","getSerializableData","createSerializator","serialize","dataset","allEvents","exportedEvent","exportValue","rawValue","xml_format","format_date","load","setLoadMode","array","show_loading","_x","_y","_obj","_init_touch_events","touch","MSStream","platform","maxTouchPoints","scroll_width","_mobile","touchEventsSupported","createEvent","_touch_events","touches","pageX","pageY","PointerEvent","pointerEnabled","pointerType","msPointerEnabled","MSPOINTER_TYPE_MOUSE","names","accessor","ignore","tracker","drag_mode","scroll_mode","action_mode","dblclicktime","attachTouchEvent","_is_lightbox_open","passive","drag_cancel","_hide_global_tip","_on_mouse_up","_temp_touch_block","_drag_pos","_pointerDragId","acc","dnd","timeline","original_render","drag_id","getEvents","_sorder","_count","_on_mouse_move","preventDefault","cancelBubble","_update_global_tip","abs","fake_event","pointerId","_click","dhx_cal_data","_on_dbl_click","_block_next_stop","touch_drag","actTask","_locate_event","fakeTask","sourceTask","_ignore_next_click","previousSibling","_on_mouse_down","for_rendered","_rendered","touch_tip","_show_global_tip","touch_swipe_dates","s_ev","e_ev","step","max_dy","scrollable","dx","dhx_cal_next_button","dhx_cal_prev_button","toptip","_global_tip","time","event_header","day_date","labels","drag_to_create","drag_to_move","calculatedMaterial","cachedBorderBoxValue","checkIfBorderBoxStyling","_is_material_skin","probe","boxSizing","refreshAfterLoad","_border_box_events","oldStyling","flatSkinHourScale","_addThemeClass","skin","_skin_settings","use_select_menu_space","wide_form","displayed_event_color","displayed_event_text_color","_skin_xy","lightbox_additional_height","bar_height","_build_skin_info","clearInterval","monitorIntervalId","setInterval","csstheme","setSkin","styles","themeVar","themeName","isCssVarTheme","cssValues","oldMaterialTheme","links","getElementsByTagName","href","_theme_info","theme","cssVarTheme","values","themeVariables","_configure","col","_skin_init","hour_scale","hour_date","_old_month_day","month_day","old_month_day","dhx_cal_today_button","tab","header","tabs","specialTabs","tabName","find","filter","firstTab","reverse","DataProcessorEvents","dp","$scheduler","$dp","_dataProcessorHandlers","_validId","setUpdated","z","_new_event","_in_progress","_invalid","updatedRows","_waitMode","_update_callback","upd","setUserData","action_param","deleteEvent","_add_rec_marker","DataProcessor","serverProcessorURL","serverProcessor","autoUpdate","_tMode","_headers","_payload","post_delim","messages","updated","inserted","deleted","invalid","invalid_cell","enableUTFencoding","eventable","boxAttribute","_dhx_msg_cfg","usercall","modalBox","modal_key","which","keyCode","messageBox","keyboard","domHelpers","modality","cover","classValue","buttonAriaAttrs","_waiAria","messageButtonAttrString","getFirstDefined","_createBox","ok","cancel","contentId","messageModalAttr","inner","title","content","message_ok","message_cancel","buttons","btn","getElementById","hidden","focus","alertPopup","confirmPopup","boxPopup","box_params","params","focusable","messageInfoAttr","timers","pull","seed","hideAll","popups","alert","confirm","modalbox","setTransactionMode","total","headers","payload","_tSend","_endnm","_serializeAsJson","_router","router","escape","_utf","setDataColumns","val","_columns","getSyncState","enableDataNames","enablePartialDataSend","_changed","master","rowId","state","findRow","existing","getUserData","set_invalid","is_invalid","markRow","_methods","details","getActionByState","checkBeforeUpdate","editStop","sendAllData","_beforeSendData","_getRowData","_sendData","_serializeAsJSON","serialize_one","stack","keys","pref","_applyPayload","urlSeparator","dataToSend","self","queryParams","afterUpdate","urlParams","_user","_cleanupArgumentsBeforeSend","method","preprocessedData","_cleanupItemBeforeSend","action","query","_onResolvedCreateUpdate","tag","resultState","setRequestHeader","sid","tid","afterUpdateCallback","routerMode","actionPromise","create","delete","update","then","catch","valid","_forEachUpdatedRow","_getAllData","out","has_one","pattern","defineAction","_uActions","btag","marker","correct","originalSid","_errorResponse","cleanUpdate","_setDefaultTransactionMode","_serverProcessor","that","finalizeUpdate","atag","_initialized","_dp_init","_is_virtual_event","_set_event_text_style","r","cssText","event_updated","rec_pattern","_dp_change_event_id","new_id","changeEventId","_dp_hook_delete","setDp","dataProcessorEvents","_dataprocessor","setOnAfterUpdate","setOnBeforeUpdateHandler","func","setAutoUpdate","interval","user","_need_update","_update_busy","xml_node","afterAutoUpdate","fullSync","intervalId","loadUpdate","getUpdates","_getXmlNodeValue","version","vers","updates","destructor","processedData","updatedItem","output","item","processedItem","prop","formatDate","_prepareItemForJson","_prepareItemForForm","_prepareDataItem","dataItem","ar","day_tab","week_tab","month_tab","icon_save","icon_cancel","icon_details","icon_edit","icon_delete","confirm_closing","confirm_deleting","section_description","section_time","full_day","confirm_recurring","section_recurring","button_recurring","button_recurring_open","button_edit_series","button_edit_occurrence","grid_tab","prev","year","month","hour","minute","repeat_radio_day","repeat_radio_week","repeat_radio_month","repeat_radio_year","repeat_radio_day_type","repeat_text_day_count","repeat_radio_day_type2","repeat_week","repeat_text_week_count","repeat_radio_month_type","repeat_radio_month_start","repeat_text_month_day","repeat_text_month_count","repeat_text_month_count2_before","repeat_text_month_count2_after","repeat_year_label","select_year_day2","repeat_text_year_day","select_year_month","repeat_radio_end","repeat_text_occurences_count","repeat_radio_end2","repeat_radio_end3","repeat_never","repeat_daily","repeat_workdays","repeat_weekly","repeat_monthly","repeat_yearly","repeat_custom","repeat_freq_day","repeat_freq_week","repeat_freq_month","repeat_freq_year","repeat_on_date","repeat_ends","month_for_recurring","day_for_recurring","be","agenda_tab","description","year_tab","week_agenda_tab","ca","cn","cs","da","de","en","es","fi","fr","he","hu","it","jp","LocaleManager","_locales","nb","nl","no","pl","pt","ro","ru","si","sk","sv","tr","ua","DatePicker","modes","currentRange","eventDates","filterDays","currentModeIndex","onStateChangeHandlers","_domEvents","onStateChange","oldState","newState","_notifyStateChange","direction","newDate","setFullYear","setState","_toggleMode","newIndex","backwardArrow","monthLabel","innerText","toLocaleString","startYear","forwardArrow","_adjustDate","_renderCalendarHeader","dataContainer","_renderDayGrid","_renderMonthGrid","_renderYearGrid","daysOfWeekContainer","currentDate","maxDate","labelFormat","dayElement","weeks","currWeek","minWeeks","minSchedulerDate","maxSchedulerDate","eventDaysTable","reduce","_renderDayGridHeader","weekLength","children","setProperty","firstDate","monthStart","monthEnd","lastDate","currentCalDate","_weeksBetween","dayGridContainer","dateCell","wrapper","months","formatLabel","monthElement","doneArea","doneBtn","yearElement","factoryMethod","extensionManager","stateProviders","internal","provider","unregisterProvider","commonViews","agenda","grid","week_agenda","anythingElse","requiredExtensions","_commonErrorMessages","unknownView","relatedExtension","collapsedContainer","createTimelineView","createUnitsView","createGridView","exportToPNG","exportToPDF","nav_bar","_detachDomEvent","_init_once","scheduler_resize_listener","hasSchedulerMarkup","wai_aria_application_role","views","_grid","log","rtl","_scroll","init_templates","set_sizes","$initialized","min_event_height","scale_width","scale_height","month_scale_height","menu_width","margin_top","margin_left","editor_width","month_head_height","event_header_height","edit_save","edit_cancel","functor","scale_x","materialScalePlaceholder","set_xy","_lightbox","_setLbPosition","_data_width","prepareValue","prepared","class_name","attr_value","labelAttr","domEventsScope","getDaysDifference","startDate","endDate","differenceInDays","_select_id","_close_not_saved","previousSelection","editor_id","_edit_id","lightbox_id","_lightbox_id","select_id","expanded","readonly","icon","def_step","dhx_cal_tab","deprecated_name","substring","_dhtmlx_confirm","title_confirm_deleting","edit","save","showLightbox","form","base","duration","event_duration","time_step","start_hour","_drag_event","details_on_dblclick","viewHandler","_get_column_index","x_pos","column","_week_indexes_from_pos","pos","ceil","_mouse_coords","$env","_colsS","$domHelpers","dataArea","heights","_ignores_detected","preserve_length","_event_length","_get_real_event_length","x_step","x_unit","timestamp","confirmationText","title_confirm_closing","positive_closing","_correct_shift","back","_is_pos_changed","old_pos","new_pos","diff","old_val","new_val","has_moved","_correct_drag_start_date","_start_correction","_end_correction","_get_fictional_event_length","_correct_drag_end_date","mousedownPos","_get_date_from_pos","_drag_start","fields","timeStep","custom","_dragEventBody","_move_event_shift","resize_date","_drag_from_start","resize_from_start","end_day_start","end_day_date","firstHour","maxY","precisePos","minDate","preciseDate","cursor","new_end","new_start","limit_drag_out","all_timed","_get_section_view","_get_event_sday","_allow_dnd","update_render","sx","update_view","drag_event_body","_get_private_properties","_clear_temporary_properties","clean","flagged_event","initial","current_state","moved","_dhx_changed","is_new","edit_on_create","details_on_create","_trigger_dyn_loading","_reset_ignores","_reset_scale","isViewExists","_set_aria_buttons_attrs","buttonGroups","group","headerButtonsAttributes","icon_form","oldClass","newClass","multidayScroll","dhx_multi_day","prev_scroll","preserve_scroll","_dy_shift","headerToggleState","_render_x_header","offset_top","left_border","columnHeaderText","dayHeaderAttr","_get_columns_num","count","count_n","_get_timeunit_start","_get_view_end","ed","_calc_scale_sizes","summ","_process_ignores","realcount","_set_scale_col_size","_render_scales","data_area","sd","today","scales","cls","firstHalf","slotDate","htmlContent","time_slot_text","time_slot_class","secondHalf","week_date_class","dayColumnAttr","_getNavDateElement","drag_resize","drag_move","navBarDateStr","scaleElement","navBarDateAttr","_reset_month_scale","_reset_hours_scale","multi_day","c1","totalWidth","col_length","hiddenWidth","c2","cc","hourScaleAttr","scroll_hour","now_date","preserve","ign_date","_render_month_scale","view_start","cd","tdwidths","cell_width","getCellHeight","cellheight","table","cell","month_date_class","body_class","head_class","monthCellAttr","cellHead","cellBody","bf1","getLabel","lightbox","updateCollection","list_name","resetLightbox","hideCover","cache","n_ev","_focus","endColumnIndex","eventLength","startColumnIndex","_get_date_index","last_column","check","excludedDuration","intervalStart","intervalEnd","leftCellCutOffStart","leftCellCutOffEnd","rightCellCutOffStart","rightCellCutOffEnd","ev_length","dir","per_day","end_slot","fd","start_slot","_get_section_property","_is_initialized","htmlTags","extraSpaces","stripHTMLLite","htmlText","singleQuotes","escapeQuotes","getAttributeString","setAttributes","role","getHeaderCellAttr","eventAttr","_eventCommonAttr","event_text","$dataprocessor_class","setEventBarAttr","_getAttributes","attributeSetter","arg","eventBarAttrString","agendaHeadAttrString","agendaHeadDateString","agendaHeadDescriptionString","agendaDataAttrString","agendaEventAttrString","agendaDetailsBtnString","gridAttrString","gridRowAttrString","gridCellAttrString","mapAttrString","mapRowAttrString","mapDetailsBtnString","minicalHeader","headerId","minicalGrid","minicalRow","minicalDayCell","selected","minicalHeadCell","weekAgendaDayCell","weekAgendaEvent","lightboxHiddenAttr","lightboxVisibleAttr","lightboxSectionButtonAttrString","tabindex","yearHeader","yearGrid","yearHeadCell","yearRow","yearDayCell","lightboxAttr","lightboxButtonAttrString","buttonName","eventMenuAttrString","iconName","lightboxHeader","headerText","lightboxSelectAttrString","time_option","buttonLabel","quickInfoAttr","quickInfoHeaderAttrString","quickInfoHeader","quickInfoButtonAttrString","tooltipAttr","tooltipVisibleAttr","tooltipHiddenAttr","dom","assert","show_errors","_createDatePicker","_getFocusableNodes","_locate_css","messageApi","$","counter","Promise","clearAll","createConfig","async","serializeRequestParams","DOMParser","ActiveXObject","loadXML","parseFromString","tagname","xpathExp","docObj","selectNodes","first","ownerDocument","evaluate","XPathResult","ANY_TYPE","iterateNext","_call","onLoad","getSync","put","postData","del","post","postSync","resolve","reject","XMLHttpRequest","isQt","readyState","filePath","open","toUpperCase","send","$ajax","default_date","month_date","load_date","week_date","date_format","api_date","day_column_padding","drag_create","resize_month_events","resize_month_timed","responsive_lightbox","separate_short_events","cascade_event_count","cascade_event_margin","multi_day_height_limit","drag_lightbox","quick_info_detached","icons_edit","icons_select","buttons_left","buttons_right","highlight_displayed_event","ajax_error","delay_render","timeline_swap_resize","$initial","xml_date","d1","d2","day_scale_date","month_scale_date","week_scale_date","time_picker","event_date","event_class","event_bar_date","event_bar_text","month_events_link","drag_marker_class","drag_marker_content","tooltip_date_format","tooltip_text","calendar_month","calendar_scale_date","calendar_date","calendar_time","clear_view","extra_data","silent","setEvent","hash","create_getter","create_setter","is_visible_events","clear_event","evFirstHour","evLastHour","lastHour","checkEndDate","get_visible_events","only_timed","filter_event","_is_main_area_event","hold","full","_recalculate_timed","tvs","tvd","_rendered_location","buffer","renderedLocation","_view_month_day","_render_month_link","toRender","_sday","_eday","curr","_sweek","_get_event_bar_pos","widt","x2","_pre_render_events","render_event_bar","max_evs","max_month_events","real","render_event","_get_first_visible_cell","hb","h_old","_pre_render_events_table","_pre_render_events_line","monthRows","cellHeight","cHeight","unshift","scrollHeight","scroll_fix","scale_settings","sum_width","row_heights","full_multi_day_height","used_multi_day_height","used_multi_day_height_css","multi_day_section","multi_day_icon","overflowY","datePart","_get_event_mapped_end_date","ev_duration","_min_mapped_duration","evs_originals","sh","eh","_inner","t_ev","slot_index","sorderSet","_is_sorder","_max_sorder","max_count","_copy_event","_time_order","_is_any_multiday_cell_visible","isAnyCellVisible","checkDate","noCells","lastDayEnd","weekCellIndex","chunks_info","first_chunk","last_chunk","chunk_info","locate_s","locate_e","_length","stack_line","_first_chunk","_last_chunk","_copy_dummy","_y_from_date","sm","_calc_event_y","min_height","em","parentWidth","menu","menu_offset","pos_y","ev_count","ev_sorder","margin","_render_v_bar","_text_style","zIndex","color","tplClass","_editor","shiftKey","ariaAttr","icons","icons_str","currentIcon","textColor","highlightEventPosition","contentA","contentB","cse","boxWidth","renderEvent","inner_html","footer_class","_drag_resize","past","_get_dnd_order","ev_height","max_height","_orig_sorder","evTop","columns","y_event_offset","resize_handle","resizable","left_chunk","right_chunk","resize_left","resize_right","timed","bg_color","style_text","_edit_stop_event","getRenderedEvent","rendered_events","rendered_event","showEvent","original_color","original_text_color","getSectionTop","posFromDate","_smartRenderingEnabled","restoreOriginalColors","scrollTo","_append_drag_marker","m","scale","lastChild","_update_marker_position","getLightboxRoot","cspEnvironment","salesforceEnvironment","_lightbox_controls","formSection","getLightbox","getValue","form_blocks","get_value","setValue","set_value","get_template_control","control","get_select_control","get_textarea_control","get_time_control","defaults","template","sns","placeholder","_get_input","_dhx_onchange","onchange","time_format","_time_format_order","dt","last","limit_time_select","selectBoxClass","range","start_year","end_year","year_range","tdate","_time_values","ariaAttrs","_full_day","checked","disabled","_fill_lightbox_select","auto_end_date","_update_lightbox_select","time_values","direct_value","fixed_value","value_found","t_v","selectedIndex","original","showCover","show_cover","_cover","_fill_lightbox","lightbox_header","headerContent","headerDate","headerTitle","current_sns","_get_lightbox_section_node","default_value","_lightbox_out","_empty_lightbox","hide_lightbox","endLightbox","hide_cover","_move_while_dnd","_finish_dnd","save_lightbox","startLightbox","_custom_lightbox","_temp_lightbox","cancel_lightbox","hideLightbox","_init_lightbox_events","buttonTarget","sectionButton","button_click","readonly_active","setLightboxSize","_init_dnd_events","_dnd_start_lb","dhx_unselectable","lb","_lb_start","_ready_to_dnd","recurring","_lightbox_template","label_name","ds","t_ds","_bindLightboxLabels","inputBlock","fallback","inputId","old_id","getRootView","hooks","didInsert","cmp","skins","jQuery","fn","dhx_scheduler","each","Scheduler","getSchedulerInstance","comp","update_view_timer","curr_view_timer","lazy_setCurrentView","oldDate","oldMode","updateFlags","lazy_updateView","ars","createDataProcessor","tMode","dhtmlxError","catchError","i18n","addLocale","setLocale","localeObject","getLocale","dhx_save_btn","dhx_cancel_btn","dhx_delete_btn","addPlugins","ext","activePlugins","plugins","extensionList","dependencies","priorities","extension","dep","dependencyName","orderA","orderB","treetimeline","daytimeline","outerdrag","legacy","plugin","getExtension","ExtensionsManager","_extensions","attaches","attachScheduler","_genStr","attachObject","vs","av","sched","schedId","setSizes","_viewRestore","notImplemented","modals","modalsStack","isModal","afterPopup","trapFocus","currentTarget","$keyboardNavigation","_keyNavMessagePopup","focusElement","backupFocus","key_nav_legacy","_temp_key_scope","key_nav","_pasteDate","_pasteSection","isCopy","trackMousePosition","mousePointer","keyNavPointer","elementFromPoint","dispatcher","copyEvent","_make_pasted_event","event_pid","event_length","multisection","isMultisectionEvent","_do_paste","is_copy","modified_ev","original_ev","_is_key_nav_active","ctrlKey","metaKey","_buffer_event","_key_nav_copy_paste","getActiveNode","new_ev","scheduler_handlers","attachSchedulerHandlers","waitCall","keyDownHandler","focusHandler","keepScrollPosition","focusGlobalNode","enable","reFocusActiveNode","activeNode","isValid","MinicalButton","MinicalCell","mousedownHandler","dataAreaClick","listOfScales","some","Event","TimeSlot","nextSlot","setActiveNode","removeAttribute","evNode","prevState","lastStart","lastEnd","lastSection","getNode","GoogleMapAdapter","_markers","zoom","zoom_after_resolve","initial_zoom","lat","lng","setCenter","setZoom","error_position","google","maps","trigger","mapOptions","center","initial_position","mapId","scrollwheel","mapTypeId","Map","__gm","messageOverlay","outerContainer","setOptions","addListener","geocoder","Geocoder","point","latLng","geocode","results","GeocoderStatus","OK","geometry","location","event_location","formatted_address","clearInstanceListeners","AdvancedMarkerElement","importLibrary","mapView","createMarker","setMap","infoWindow","close","InfoWindow","maxWidth","info_window_max_width","setContent","map_info_content","anchor","markerInfo","setVisible","setPosition","latlng","LatLng","latitude","longitude","resolveAddress","string","address","OpenStreetMapAdapter","openPopup","closeTooltip","setView","mapWrapper","L","tileLayer","addTo","on","fetch","country","myIcon","iconUrl","iconSize","shadowSize","iconAnchor","shadowAnchor","popupConfig","minWidth","markerPopup","popup","tooltip","markerConfig","bindPopup","bindTooltip","removeLayer","setLatLng","lon","MapboxAdapter","getPopup","isOpen","togglePopup","mapboxgl","accessToken","lngLat","features","place_name","Popup","focusAfterOpen","setMaxWidth","setHTML","Marker","setLngLat","setPopup","ALL_WEEKDAYS","Weekday","weekday","fromStr","nth","equals","other","getJsWeekday","isPresent","isNumber","isWeekdayStr","includes","rang","repeat","times","padStart","targetLength","padString","sep","splits","pymod","divmod","mod","empty","notEmpty","datetime","MONTH_DAYS","ONE_DAY","MAXYEAR","ORDINAL_BASE","PY_WEEKDAYS","isLeapYear","isValidDate","toOrdinal","date2","differencems","fromOrdinal","ordinal","getMonthDays","getWeekday","monthRange","combine","getMilliseconds","clone","cloneDates","clones","timeToUntilString","untilStringToDate","until","bits","dateTZtoISO8601","timeZone","IterResult","_result","before","after","accept","tooEarly","tooLate","extendStatics","setPrototypeOf","__proto__","__extends","TypeError","__","__assign","assign","__spreadArray","pack","l","Frequency","CallbackIterResult","_super","iterator","_this","ENGLISH","dayNames","monthNames","tokens","SKIP","number","numberAsText","every","at","the","second","third","for","monday","tuesday","wednesday","thursday","friday","saturday","sunday","january","february","march","april","may","june","july","august","september","october","november","december","comma","defaultGetText","defaultDateFormatter","ToText","rrule","gettext","language","dateFormatter","origOptions","bymonthday","bynmonthday","byweekday","allWeeks","someWeeks","isWeekdays","isEveryDay","sortWeekDays","isFullyConvertible","freq","IMPLEMENTED","RRule","FREQUENCIES","plural","HOURLY","MINUTELY","DAILY","bymonth","_bymonth","_bymonthday","_byweekday","byhour","_byhour","WEEKLY","MONTHLY","YEARLY","byyearday","byweekno","weekdaytext","monthtext","npos","wday","finalDelim","delim","o","realCallback","delimiter","finalDelimiter","Parser","rules","done","nextSymbol","isDone","symbol","best","bestSymbol","name_1","v","acceptNumber","expect","parseText","ttr","AT","F","MO","TU","WE","TH","FR","ON","wkd","decodeWKD","decodeNTH","MDAYs","decodeM","S","freqIsDailyOrGreater","fromText","Time","millisecond","DateTime","fromDate","getYear","addYears","years","addMonths","yearDiv","monthMod","addWeekly","wkst","fixDay","addDaily","addHours","filtered","_a","dayDiv","hourMod","addMinutes","minutes","byminute","hourDiv","minuteMod","addSeconds","seconds","bysecond","minuteDiv","secondMod","daysinmonth","SECONDLY","initializeOptions","_i","keys_1","defaultKeys","parseOptions","DEFAULT_OPTIONS","byeaster","dtstart","bysetpos","bynweekday","parsedOptions","parseString","rfcString","parseLine","parseDtstart","line","dtstartWithZone","tzid","parseRrule","Days","parseIndividualNumber","optionKey","parts","SyntaxError","wdaypart","DateWithZone","RangeError","defineProperty","enumerable","configurable","isUTC","rezonedDate","localTimeZone","Intl","DateTimeFormat","resolvedOptions","dateInLocalTZ","tzOffset","optionsToString","outValue","buildDtstart","strValues","ruleString","argsMatch","Cache","all","between","_cacheAdd","what","_value","_cacheGet","cached","argsKeys","findCacheDiff","cachedObject","iterResult","M365MASK","M366MASK","M28","M29","M30","M31","MDAY366MASK","MDAY365MASK","NM28","NM29","NM30","NM31","NMDAY366MASK","NMDAY365MASK","M366RANGE","M365RANGE","WDAYMASK","wdaymask","rebuildYear","firstwkst","wyearlen","firstyday","yearlen","nextyearlen","yearordinal","yearweekday","mmask","mdaymask","nmdaymask","mrange","wnomask","no1wkst","numweeks","lnumweeks","lyearweekday","lno1wkst","lyearlen","weekst","Iterinfo","rebuild","lastyear","yearinfo","lastmonth","monthinfo","nwdaymask","ranges","eastermask","g","yearStart","ydayset","mdayset","wdayset","ddayset","htimeset","mtimeset","stimeset","getdayset","gettimeset","buildPoslist","timeset","ii","dayset","poslist","daypos","timepos","tmp","iter","emitResult","counterDate","millisecondModulo","removeFilteredDays","rezoneIfNeeded","currentDay","isFiltered","dayCounter","SA","SU","noCache","_cache","fromString","_iter","toText","isFullyConvertibleToText","unfold","forceset","compatible","parseInput","rrulevals","rdatevals","exrulevals","exdatevals","parsedDtstart","lines","_b","parms","rdateTzid","parseRDate","rrulestr","rset_1","RRuleSet","groomRruleOptions","rdate","exrule","exdate","rdateval","parm","createGetterSetter","fieldName","field","_rrule","field_1","_rdate","_exrule","_exdate","_exdateHash","_accept","evalExdate","zonedDate","_addRule","_addDate","rrules","exrules","rdates","exdates","_dtstart","rdatesToString","rrs","rule","Tooltip","_scheduler","_tooltipNode","_root","_isLikeMouseEvent","_calculateTooltipPosition","_getViewPort","viewport","_getViewPortSize","tooltipNode","offsetX","tooltip_offset_x","offsetY","tooltip_offset_y","mouse","containerPos","scrollY","scrollX","$event_data","$event","TooltipManager","_listeners","_initDelayedFunctions","hideTooltip","delayHide","watchableTarget","eventTarget","targetNode","doOnMouseEnter","onmouseenter","touch_tooltip","onmouseleave","onmousemove","listener","cloneDomEvent","delayShow","utils.default","show","tooltip_timeout","tooltip_hide_timeout","gplExtensions","active_links","active_link_view","_active_link_click","s_d","do_wrapper","fullname","week_x","d_s","agenda_legacy","add_agenda_legacy","agenda_legacy_time","agenda_legacy_text","agenda_legacy_date","agenda_legacy_start","old_dblclick_dhx_cal_data","dblclick_dhx_cal_data","fill_agenda_tab","old_render_view_data","ev_class","agendaDetailsButtonAttr","agenda_time","agenda_text","_agendaScrollTop","agenda_area","dateElement","agenda_date","agenda_legacy_view","agenda_start","agenda_end","rowAttr","dateHeader","descriptionHeader","agenda_view","add_agenda","dayDateToStr","dayDowToStr","agenda_day","eventsInDays","anyEvents","ignore_agenda","renderDay","calendarEvent","selectedId","all_timed_month","is_event_short","_safe_copy","proto","isPrototypeOf","old_prerender_events_line","old_prerender_events_table","prerender_events","ce","_virtual","isOvernightEvent","getNextDay","setDateTime","event_changed","re","redraw","next_day","old_get_visible_events","old_mode","old_date","oldUpdate","fullRedrawNeeded","collision","temp_section","_setTempSection","event_id","collision_limit","checkCollision","edited_ev","recurring_event_id","_roll_back_dates","_check_sections_collision","evs_dates","getRecDates","tevs","concurrent","_pid_time","checked_mode","single","container_autoresize","month_day_min_height","min_grid_size","min_map_size","old_pre_render_event","active","total_height","multiday_height","evl","_h_fix","navHeight","headerHeight","checked_divs","updateContainterHeight","is_repaint","checked_div","maxHeight","year_y","cur_height","week_agenda_scale_height","eventsContainer","_gridView","y_unit","getSectionHeight","scrollWidth","getScrollSize","callUpdate","conditionalUpdateContainerHeight","asyncRepaint","requestAnimationFrame","autosizeEnabled","$original_scroll_width","$original_section_autoheight","section_autoheight","cookie","getCookieName","_get_url_nav","urlNavigationPlugin","schedulerCookie","unescape","newMode","cookie_param","old_load","drag_between","editors","cached_options","resetCombo","_combo","DOMParent","combo","unload","DOMelem","dhx_globalImgPath","image_path","dhtmlXCombo","options_height","setOptionHeight","enableFilteringMode","filtering","script_path","selected_id","addOption","disable","selectOption","setComboValue","all_options","single_option","getIndexByValue","getSelectedValue","getSelectedText","vertical","radiobuttons","checked_value","isChecked","check_html","label_html","checkbox","unchecked_value","expand","fullscreen","toggleIcon","_position","_width","_height","_overflow","overflow","_maximize","collapse","directions","prev_margin","export_api","std","getElementSizes","sizes","dhtmlxAjax","dhx4","getTimeline","orientation","dpi","_export_html","_send_to_export","exportToICal","_serialize_plain","exportToExcel","_serialize_columns","_ajax_to_export","server","info","_plain_export_copy","$text","_create_hidden_form","submit","_hidden_export_form","_get_export_size","footer","A5","A4","A3","A2","A1","A0","dataX","cSize","parseFloat","smartRendering","initialSizes","smart_rendering","style_width","style_height","timeline_scrollable","timeline_smart_rendering","grid_view","html_templates","getScope","scopes","minicalButton","minicalDate","SchedulerNode","DataArea","timeSlot","searchMap","key_nav_step","addShortcut","shortcut","scope","scopeObject","getShortcutHandler","commands","shortcuts","findHandler","removeShortcut","unbind","disp","setDefaultNode","_compose","createCommand","modifiers","alt","ctrl","meta","expr","getExpressions","words","getWords","command","commandKeys","specialKeys","charCodeAt","getCommandFromEvent","domEvent","altKey","printableKey","fromCharCode","getHashFromEvent","getHash","junctionChar","term","combinationChar","backspace","enter","esc","space","up","down","home","pageup","pagedown","insert","plus","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","EventHandler","_handlers","doAction","returnValue","bindAll","initKeys","nextItem","currentFocus","currentIndex","renderMultiple","currentStart","currentEnd","_modes","_getMode","renderVerticalMarker","renderTimelineMarker","renderYearMarker","renderMonthMarker","weekAgenda","renderWeekAgendaMarker","renderAgendaMarker","dayColumns","addWaiAriaLabel","addDataAttributes","dateToStr","dateTimeLabel","sectionObject","markerDate","_wrapDiv","_get_year_cell","opacity","view_opts","round_position","_trace_x","_is_column_visible","start_pos","end_pos","set_date_part","tempStart","tempEnd","_timeline_getX","_section_height","_isRender","renderMonthCell","weekNumber","dayIndex","datatable","lineHeight","getDefaultNode","getMode","blur","_compareEvents","_pickEvent","startId","nextEventHandler","nextEvent","currEvent","visibleDates","nextEv","prevEventHandler","HeaderCell","getNodes","KeyNavNode","moveTo","compareTo","canStringifyThis","canStringifyThat","defaultCell","_getSection","_getNodes","defaultElement","isScrolledIntoView","eventBox","viewPort","idSelector","inlineEditor","getInlineEditor","_moveToSlot","slot","movingDate","getDefaultDate","_getDefaultSection","visibleTime","nowTime","showNowTime","findVisibleColumn","timeslot","_getMultisectionView","_getNextSection","nextIndex","defaultSlot","addMonthDate","nextMonthSlot","_alignTimeSlot","nextTimelineSlot","newPos","nextUnitsSlot","optionsCount","nextDaySlot","_moveDate","isBeforeLastHour","isStartDate","isAfterFirstHour","isInVisibleDayTime","oldStart","toNextDay","testEnd","nextWeekAgendaSlot","nextAgendaSlot","isDateVisible","nextDateColumn","current","tempSlot","extendSlot","extendUnitsSlot","extendTimelineSlot","extendMonthSlot","extendDaySlot","extendWeekAgendaSlot","extendGenericSlot","allowedDirections","moveDate","newDates","extendSlotDates","oldSlot","newSlot","dateDirection","scrollSlot","globalNode","_getGrid","_getNode","enabled","newRow","newCol","blurNode","editor","defaultPrevented","schedulerNode","_timeout","_minicalendars","isMinical","minicalendars","patchMinicalendar","focusMinical","minicalClick","rowIndex","cellIndex","td","renderMinical","cal","added","destroyMinical","_def_count","attachOnce","isSchedulerSelected","changeState","layer","layers","validId","_clearUpdateFlag","_cloneObj","_dataprocessors","_layers_zindex","initial_layer_zindex","isDefault","defaultLayer","showLayer","tlayer","toggleLayer","hideLayer","visible","getLayer","layer_name","native_event_object","noMenu","_evs_layer","_t_render_view_data","evs_layer","borderBox","borderBoxWidth","headerWidth","bodyWidth","footerWidth","bodyHeight","new_zIndex","filter_agenda","limit_view","_temp_limit_scope","om","od","nm","nd","isBlocked","date_end","resetDate","is_new_event","data_copy","native_object","_mark_now_timer","map_view","mapAdapter","eventHandlerIds","adapters","googleMap","openStreetMaps","mapbox","setupMapView","createAdapter","unmodifiedEvent","_eventLocationChanged","map_settings","resolve_event_location","_latLngUpdate","addEventWithLocation","updateEventMarker","newIdEvent","removeEventMarker","addEventMarker","onEventClick","coordinates","map_view_provider","currentAdapter","resolve_user_location","view_provider","map_initial_position","map_error_position","map_date_width","map_icon_width","map_description_width","add_map","map_date","map_time","map_text","map_start","dblclick_dhx_map_area","map_initial_zoom","map_zoom_after_resolve","map_infowindow_max_width","map_resolve_user_location","map_type","map_resolve_event_location","fill_map_tab","_selected_event_id","ariaButtonAttr","clearEventMarkers","map_end","mapContainer","adapter","elem_id","marginRight","marginTop","destroy","initialize","geolocation","getCurrentPosition","coords","_updateEventLocation","_event_resolve_delay","ret","minical","minicalDomEvents","minicalendar","mark_events","_synced_minicalendars","_prev","is_refresh","_render_calendar","unmarkCalendar","cont","tpos","_get_def_cont","$dom","dateAttribute","markCalendar","_last_date","conf","markedDates","_markCalendarCurrentDate","sync","_on_xle_handler","updateCalendar","_created","_locateCalendar","weekNum","dat","dayCell","_week_template","week_template","dummy_date","_mini_cal_arrows","previous","ts","temp2","temp3","temp4","temp5","temp6","temp7","temp8","padding","weekHeader","move_minicalendar_date","css_classnames","css_texts","diffs","calendars","arrow","dayHeaders","dayCells","inputs","selects","inp","new_date","_update_minical_select","isFulldayEvent","_attach_action","_round_minutes","linkCalendar","datediff","dateNew","month_end","monthheight","old_s","multiselect","_children","_mark_inputs","_ids","script_url","divLoading","multisource","mvc","update_timer","use_id","sanitize","_finish_ext_load","_get_id","model","cid","backbone","toJSON","changes","queue","add_from_queue","Backbone","Collection","last_event","dragger","dhtmlDragAndDropObject","stopDrag","on_drop","sourceHtmlObject","dhtmlObject","targetHtmlObject","targetHtml","action_data","event_data","view_options","_locate_cell_timeline","addDragLanding","_drag","_dragIn","shtmlObject","_dragOut","DragControl","addDrop","onDrop","sourceDhtmlx","getMaster","onDragIn","pdf","html_regexp","newline_regexp","clean_html","x_norm","colsWidth","x_norm_event","is_left","dhx_cal_header","y_norm","get_style","de_day","de_week","xml_end","xml_top","profile","xml_body_header","dhx_cal_date","xh","xml_month_scale","xml_month","yh","xhs","second_scale","top_width","top_col","xml_body","colors","week_starts","_month","text_color","zx","zdx","left_norm","zy","zdy","e_type","dets","week","dy_copy","toXML","original_date","original_mode","temp_date","to_pdf","objects","getPDFData","toPDF","toPDFRange","quick_info","show_quick_info","clickedElementPosition","fitQIInsideWindow","quickInfoPopup","popupRect","offsetBottom","getPositionInsideScheduler","_$quickInfoHandler","eventElement","showQuickInfo","hiding_function","hideQuickInfo","quick_info_title","quick_info_content","quick_info_date","_quick_info_box_id","_get_event_counter_part","_quick_info_box","_init_quick_info","_fill_quick_data","_show_quick_info","cssTimeToMs","milliseconds","forced","qi","_x_scroll","dataPos","ontransitionend","_quick_info_onscroll_handler","$testmode","_qi_button_click","main","mainContent","originalRecurringSetValue","original_left_buttons","original_right_buttons","txt_replace","txts","txtt","readonly_form","forbidden_buttons","button_arrays","forbidden_button","button_array","originalForm","readonlyForm","_lightbox_r","clearMilliseconds","isSeries","toUTCDate","old_add_event","groupExceptions","exceptions","original_start","_rec_temp","_rec_markers_pull","_rec_markers","_get_rec_marker","ch","_get_rec_markers","ev_id","_ignore_call","tev","_pid_changed","_is_modified_occurence","idTimestamp","nid","nev","sub","isEventFound","_start_date","showLightbox_rec","lightbox_recurring","pid","isVirtual","showSeries","title_confirm_recurring","get_visible_events_rec","repeat_date","old_update_event","toIcalString","getWeekdayOfMonth","dayOfWeek","dayOfMonth","dayNumber","non_render","maxCount","seriesExceptions","utcStart","parsedRRule","repeatedDates","adjustedDate","visibleCount","eventDuration","exception","_fix_daylight_saving_date","recurrings","sev","occurence","include_end_by","recurring_workdays","jsDaysToRRULEDays","RruleDayNumsToJs","formatDayNumber","repeat_monthly_date","repeat_monthly_weekday","nthDayOfMonth","repeat_yearly_month_date","repeat_yearly_month_weekday","getRecValue","WORKDAYS","CUSTOM","monthRepeat","yearRepeat","formatFunc","endRule","NEVER","fillInDefaults","dayNum","dayLabel","dateOfMonth","nthWeekDayOfMonth","dateOfYear","nthWeekDayOfYear","countInput","ondateInput","endOptionSelect","formatter","repeat_date_of_end","dispatchEvent","getFirstSectionOfType","rec","_get_node","_outer_html","loc","_init_set_value","_ds","weekly","monthly","yearly","_rec_init_done","rf","blocked","rruleset","topOption","rruleObj","untilDate","customFreq","actual_dates","timeControl","getTimeSection","recurrence","_start","recurring_legacy","getRecurringSection","occurrence_timestamp_in_utc","outerHTML","_get_form_node","_get_node_value","_get_node_numeric_value","_set_node_value","hash_value","str_date_format","date_str","register_els","inps","change_current_view","set_end_rule","_get_repeat_code","get_rcode","str_date","transpose_type","get_numeric_value","repeat_precise","start_exists","transpose_day_week","set_rcode","_set_repeat_code","MouseEvent","elements","_toggle_block","_get_button","_get_form","backgroundPosition","transponse_size","day_week","originalMonth","newMonth","cor","cor2","cday","transposeRecurring","recurringParts","addRecurring","recurringStepDays","weekDays","seriesInstance","currentCount","origMonth","origYear","correctOverflowInstances","recurring_overflow_instances","startHour","ted","data_attributes","all_events","_serialize_json_value","toICal","full_day_format","tooltipManager","tooltips","tooltipFor","targetEventId","s2d","d2s","select_event","wp","year_view","year_date","year_month","year_scale_date","year_tooltip","isYearMode","getCellDate","dblclick_dhx_year_grid","_year_render_event","_year_marked_cells","_hideToolTip","_tooltip","_showToolTip","_year_view_tooltip_handler","_init_year_tooltip","_mark_year_date","_unmark_year_date","_reset_year_scale","year_top","ssd","yearBox","year_x","datepicker","ignore_year","locateEvent","factory","extensions","_seed","_schedulerPlugins","_bundledExtensions","_extensionsManager","initConfig","_internal_id","$syncFactory","_initFromConfig","addCalendar","$dhx"],"mappings":";;;;;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,QAAQ,SAASkW,GACrCja;AAAAA,QAAUskH,YAAYrqG,CAAAA;AAAAA,IAC1B,IAGKiqG,EAAW/9G,YACbnG,EAAU0oB,KAAKw7F,EAAW/9G,SAE1BnG,IAAAA,EAAU0oB,KAGRw7F,GAAAA,EAAWz0G,SACHy0G,OAAAA,EAAWz0G,QAAS,WAC7BzP,EAAUyyB,KAAKyxF,EAAWz0G,IAAAA,IAE1BzP,EAAU6tB,MAAMq2F,EAAWz0G,IAG7B;AAAA,EAAA;AAAA,EDxFmCk5E,EAE/B3oF,GAAAA,KAAY4jH,GAAQxkD,qBACpBD,GAAAA,KAAY,EACjBuC,QAAQ1hE,GAAU6e,KAAK+kG,GAAQliD,QAAQkiD,EAAAA,EAAAA;AAGxC/jH,OAAOG,YAAYA,IACnBH,OAAOs/D,YAAYA,IAEft/D,OAAO0kH,SACV1kH,OAAO0kH,OAAO,KAGf1kH,OAAO0kH,KAAKvkH,YAAYA,IACxBH,OAAO0kH,KAAKplD,YAAYA;","x_google_ignoreList":[84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111]}
\ No newline at end of file
diff --git a/codebase/dhtmlxscheduler.js b/codebase/dhtmlxscheduler.js
index 6dc2e08..461ea55 100644
--- a/codebase/dhtmlxscheduler.js
+++ b/codebase/dhtmlxscheduler.js
@@ -1,8 +1,16 @@
-(function(he,G){typeof exports=="object"&&typeof module<"u"?G(exports):typeof define=="function"&&define.amd?define(["exports"],G):G((he=typeof globalThis<"u"?globalThis:he||self).dhtmlxscheduler={})})(this,function(he){"use strict";const G=typeof window<"u"?window:global;function Mt(e){let i=[],t=!1,r=null,d=null;function n(){return e.config.drag_highlight&&e.markTimespan}function s(o){const l=e.getView(o);return l?l.layout:o}function _(o){const{event:l,layout:h,viewName:v,sectionId:u,eventNode:f}=o;(function(m,g){switch(g){case"month":m.style.top="",m.style.left="";break;case"timeline":m.style.left="",m.style.marginLeft="1px";break;default:m.style.top=""}})(f,h);const c={};let p={start_date:l.start_date,end_date:l.end_date,css:"dhx_scheduler_dnd_marker",html:f};return h!="timeline"&&h!="month"||(p={...p,end_date:e.date.add(l.start_date,1,"minute")}),u&&(c[v]=u,p.sections=c),p}function a(o){const{layout:l}=o;let h;switch(l){case"month":h=function(v){let u=[];const{event:f,layout:c,viewName:p,sectionId:m}=v,g=[];let y=new Date(f.start_date);for(;y.valueOf()
String(b)),x=[];for(let b=0;b{i.push(e.markTimespan(v))})}e.attachEvent("onBeforeDrag",function(o,l,h){return n()&&(t=!0,d=e.getEvent(o),r=h.target.closest(`[${e.config.event_attribute}]`),s(e.getState().mode)=="units"&&e.config.cascade_event_display&&(e.unselect(o),r=h.target.closest(`[${e.config.event_attribute}]`))),!0}),e.attachEvent("onEventDrag",function(o,l,h){if(t&&n()){t=!1;const v=e.getState().mode,u=s(v),f=e.getActionData(h).section;d&&a({event:d,layout:u,viewName:v,sectionId:f,eventNode:r})}}),e.attachEvent("onDragEnd",function(o,l,h){for(let v=0;vl||n.end_date.getDate()!=o.getDate()?1440:e._get_zone_minutes(n.end_date),m=u[f],g=u[f+1];if(mc&&!(a=typeof _=="function"&&_(n,c,p,m,g)))break}}return!a},e.checkLimitViolation=function(n){if(!n||!e.config.check_limits)return!0;var s=e,_=s.config,a=[];if(n.rec_type&&n._end_date||n.rrule){const u=n._end_date||n.end_date;return!_.limit_start||!_.limit_end||u.valueOf()>=_.limit_start.valueOf()&&n.start_date.valueOf()<=_.limit_end.valueOf()}a=[n];for(var o=!0,l=0;l=_.limit_start.valueOf()&&v.end_date.valueOf()<=_.limit_end.valueOf())&&(h=!e.checkInMarkedTimespan(v,i,function(u,f,c,p,m){var g=!0;return f<=m&&f>=p&&((m==1440||c<=m)&&(g=!1),u._timed&&s._drag_id&&s._drag_mode=="new-size"?(u.start_date.setHours(0),u.start_date.setMinutes(m)):g=!1),(c>=p&&c<=m||fm)&&(u._timed&&s._drag_id&&s._drag_mode=="new-size"?(u.end_date.setHours(0),u.end_date.setMinutes(p)):g=!1),g})),h||(h=s.checkEvent("onLimitViolation")?s.callEvent("onLimitViolation",[v.id,v]):h),o=o&&h}return o||(s._drag_id=null,s._drag_mode=null),o},e._get_blocked_zones=function(n,s,_,a,o){var l=[];if(n&&n[s])for(var h=n[s],v=this._get_relevant_blocked_zones(_,a,h,o),u=0;uthis._min_date&&_.getHours()>=a.first_hour&&_.getHours()1?(v.size&&v.options.length&&(n=(v.position+n)/v.options.length*v.size),l=n,h=n+u):h=(l=0)+u;for(var f=[],c=l;cn.start_date||n.days!==void 0&&n.zones)&&!n.type)return s;n.zones=="fullday"&&(n.zones=[0,1440]),n.zones&&n.invert_zones&&(n.zones=e.invertZones(n.zones)),n.id=e.uid(),n.css=n.css||"",n.type=n.type||t;var h=n.sections;if(h){for(var v in h)if(h.hasOwnProperty(v)){var u=h[v];for(u instanceof Array||(u=[u]),o=0;og?e._get_zone_minutes(p):0,k=m>y||m.getDate()!=g.getDate()?1440:e._get_zone_minutes(m);x.zones=[b,k],s.push(x),g=y,y=e.date.add(y,1,"day")}else c.days instanceof Date&&(c.days=e.date.date_part(c.days).valueOf()),c.zones=n.zones.slice(),s.push(c)}return s},e._get_dates_by_index=function(n,s,_){var a=[];s=e.date.date_part(new Date(s||e._min_date)),_=new Date(_||e._max_date);for(var o=s.getDay(),l=n-o>=0?n-o:7-s.getDay()+n,h=e.date.add(s,l,"day");h<_;h=e.date.add(h,1,"week"))a.push(h);return a},e._get_css_classes_by_config=function(n){var s=[];return n.type==i&&(s.push(i),n.css&&s.push(i+"_reset")),s.push("dhx_marked_timespan",n.css),s.join(" ")},e._get_block_by_config=function(n){var s=document.createElement("div");return n.html&&(typeof n.html=="string"?s.innerHTML=n.html:s.appendChild(n.html)),s},e._render_marked_timespan=function(n,s,_){var a=[],o=e.config,l=this._min_date,h=this._max_date,v=!1;if(!o.display_marked_timespans)return a;if(!_&&_!==0){if(n.days<7)_=n.days;else{var u=new Date(n.days);if(v=+u,!(+h>+u&&+l<=+u))return a;_=u.getDay()}var f=l.getDay();f>_?_=7-(f-_):_-=f}var c=n.zones,p=e._get_css_classes_by_config(n);if(e._table_view&&e._mode=="month"){var m=[],g=[];if(s)m.push(s),g.push(_);else{g=v?[v]:e._get_dates_by_index(_);for(var y=0;y1?D=D*(w.size||w.options.length)+S:(D=S,w.size&&D>w.position+w.size&&(D=0))}for(s=s||e.locate_holder(D),y=0;y-1||(s.push.apply(s,e._on_scale_add_marker(h,a)),a=e.date.add(a,1,"day"))}}return s},e.markTimespan=function(n){if(!this._els)throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.");var s=!1;this._els.dhx_cal_data||(e.get_elements(),s=!0);var _=e._marked_timespans_ids,a=e._marked_timespans_types,o=e._marked_timespans;e.deleteMarkedTimespan(),e.addMarkedTimespan(n);var l=e._mark_timespans();return s&&(e._els=[]),e._marked_timespans_ids=_,e._marked_timespans_types=a,e._marked_timespans=o,l},e.unmarkTimespan=function(n){if(n)for(var s=0;sl&&u<=l||u=o)_[a]=Math.min(o,u),_[a+1]=Math.max(l,f),a-=2;else{if(!h)continue;var c=o>u?0:2;_.splice(a+c,0,u,f)}s.splice(v--,2);break}return _},e._subtract_timespan_zones=function(n,s){for(var _=n.slice(),a=0;a<_.length;a+=2)for(var o=_[a],l=_[a+1],h=0;ho&&v=v&&l<=u&&_.splice(a,2),ou&&_.splice(f?a+2:a,f?0:2,u,l),a-=2;break}}return _},e.invertZones=function(n){return e._subtract_timespan_zones([0,1440],n.slice())},e._delete_marked_timespan_by_id=function(n){var s=e._marked_timespans_ids[n];if(s){for(var _=0;_1){var p=Math.round((s-e._min_date)/864e5),m=u.size||f.length;s=e.date.add(e._min_date,Math.floor(p/m),"day"),s=e.date.date_part(s)}else s=e.date.date_part(new Date(this._date));if(_=s.getDay(),a=s.valueOf(),l[o]&&l[o][c.key]){var g=l[o][c.key],y=e._get_types_to_render(g[_],g[a]);h.push.apply(h,e._get_configs_to_render(y))}}var x=l.global;if(e.config.overwrite_marked_timespans){var b=x[a]||x[_];h.push.apply(h,e._get_configs_to_render(b))}else x[a]&&h.push.apply(h,e._get_configs_to_render(x[a])),x[_]&&h.push.apply(h,e._get_configs_to_render(x[_]));for(var k=0;k{c&&(v.setModeDate.date=c),p&&(v.setModeDate.mode=p)};var f={render:(c,p)=>{v.needRender=!0,u(c,p)},setCurrentView:(c,p)=>{v.needRender=!0,u(c,p)},updateView:(c,p)=>{v.needUpdateView=!0,u(c,p)},render_data:()=>v.needRender=!0,render_view_data:c=>{c&&c.length?c.forEach(p=>v.repaintEvents[p.id]=!0):v.needRender=!0}};if(n.call(this,f),t=!0,this.callEvent("onBeforeBatchUpdate",[]),_(a),this.callEvent("onAfterBatchUpdate",[]),s.call(this),t=!1,!o)if(v.needRender)e.render(v.setModeDate.date,v.setModeDate.mode);else if(v.needUpdateView)e.updateView(v.setModeDate.date,v.setModeDate.mode);else for(const c in v.repaintEvents)e.updateEvent(c);h&&(this._dp.setUpdateMode(l),this._dp.sendData())}}function At(e){(function(i){i.attachEvent("onEventDeleted",function(t,r){let d=i.copy(r);i.config.undo_deleted&&!i.getState().new_event&&i.message({text:`
+(function(he,G){typeof exports=="object"&&typeof module<"u"?G(exports):typeof define=="function"&&define.amd?define(["exports"],G):G((he=typeof globalThis<"u"?globalThis:he||self).dhtmlxscheduler={})})(this,function(he){"use strict";/** @license
+
+dhtmlxScheduler v.7.1.3 Standard
+
+To use dhtmlxScheduler in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxScheduler/#licensing or contact us at sales@dhtmlx.com
+
+(c) XB Software Ltd.
+
+*/const G=typeof window<"u"?window:global;function Mt(e){let i=[],t=!1,r=null,d=null;function n(){return e.config.drag_highlight&&e.markTimespan}function s(o){const l=e.getView(o);return l?l.layout:o}function _(o){const{event:l,layout:h,viewName:m,sectionId:v,eventNode:u}=o;(function(p,g){switch(g){case"month":p.style.top="",p.style.left="";break;case"timeline":p.style.left="",p.style.marginLeft="1px";break;default:p.style.top=""}})(u,h);const c={};let f={start_date:l.start_date,end_date:l.end_date,css:"dhx_scheduler_dnd_marker",html:u};return h!="timeline"&&h!="month"||(f={...f,end_date:e.date.add(l.start_date,1,"minute")}),v&&(c[m]=v,f.sections=c),f}function a(o){const{layout:l}=o;let h;switch(l){case"month":h=function(m){let v=[];const{event:u,layout:c,viewName:f,sectionId:p}=m,g=[];let y=new Date(u.start_date);for(;y.valueOf()
String(b)),x=[];for(let b=0;b{i.push(e.markTimespan(m))})}e.attachEvent("onBeforeDrag",function(o,l,h){return n()&&(t=!0,d=e.getEvent(o),r=h.target.closest(`[${e.config.event_attribute}]`),s(e.getState().mode)=="units"&&e.config.cascade_event_display&&(e.unselect(o),r=h.target.closest(`[${e.config.event_attribute}]`))),!0}),e.attachEvent("onEventDrag",function(o,l,h){if(t&&n()){t=!1;const m=e.getState().mode,v=s(m),u=e.getActionData(h).section;d&&a({event:d,layout:v,viewName:m,sectionId:u,eventNode:r})}}),e.attachEvent("onDragEnd",function(o,l,h){for(let m=0;ml||n.end_date.getDate()!=o.getDate()?1440:e._get_zone_minutes(n.end_date),p=v[u],g=v[u+1];if(pc&&!(a=typeof _=="function"&&_(n,c,f,p,g)))break}}return!a},e.checkLimitViolation=function(n){if(!n||!e.config.check_limits)return!0;var s=e,_=s.config,a=[];if(n.rec_type&&n._end_date||n.rrule){const v=n._end_date||n.end_date;return!_.limit_start||!_.limit_end||v.valueOf()>=_.limit_start.valueOf()&&n.start_date.valueOf()<=_.limit_end.valueOf()}a=[n];for(var o=!0,l=0;l=_.limit_start.valueOf()&&m.end_date.valueOf()<=_.limit_end.valueOf())&&(h=!e.checkInMarkedTimespan(m,i,function(v,u,c,f,p){var g=!0;return u<=p&&u>=f&&((p==1440||c<=p)&&(g=!1),v._timed&&s._drag_id&&s._drag_mode=="new-size"?(v.start_date.setHours(0),v.start_date.setMinutes(p)):g=!1),(c>=f&&c<=p||up)&&(v._timed&&s._drag_id&&s._drag_mode=="new-size"?(v.end_date.setHours(0),v.end_date.setMinutes(f)):g=!1),g})),h||(h=s.checkEvent("onLimitViolation")?s.callEvent("onLimitViolation",[m.id,m]):h),o=o&&h}return o||(s._drag_id=null,s._drag_mode=null),o},e._get_blocked_zones=function(n,s,_,a,o){var l=[];if(n&&n[s])for(var h=n[s],m=this._get_relevant_blocked_zones(_,a,h,o),v=0;vthis._min_date&&_.getHours()>=a.first_hour&&_.getHours()1?(m.size&&m.options.length&&(n=(m.position+n)/m.options.length*m.size),l=n,h=n+v):h=(l=0)+v;for(var u=[],c=l;cn.start_date||n.days!==void 0&&n.zones)&&!n.type)return s;n.zones=="fullday"&&(n.zones=[0,1440]),n.zones&&n.invert_zones&&(n.zones=e.invertZones(n.zones)),n.id=e.uid(),n.css=n.css||"",n.type=n.type||t;var h=n.sections;if(h){for(var m in h)if(h.hasOwnProperty(m)){var v=h[m];for(v instanceof Array||(v=[v]),o=0;og?e._get_zone_minutes(f):0,k=p>y||p.getDate()!=g.getDate()?1440:e._get_zone_minutes(p);x.zones=[b,k],s.push(x),g=y,y=e.date.add(y,1,"day")}else c.days instanceof Date&&(c.days=e.date.date_part(c.days).valueOf()),c.zones=n.zones.slice(),s.push(c)}return s},e._get_dates_by_index=function(n,s,_){var a=[];s=e.date.date_part(new Date(s||e._min_date)),_=new Date(_||e._max_date);for(var o=s.getDay(),l=n-o>=0?n-o:7-s.getDay()+n,h=e.date.add(s,l,"day");h<_;h=e.date.add(h,1,"week"))a.push(h);return a},e._get_css_classes_by_config=function(n){var s=[];return n.type==i&&(s.push(i),n.css&&s.push(i+"_reset")),s.push("dhx_marked_timespan",n.css),s.join(" ")},e._get_block_by_config=function(n){var s=document.createElement("div");return n.html&&(typeof n.html=="string"?s.innerHTML=n.html:s.appendChild(n.html)),s},e._render_marked_timespan=function(n,s,_){var a=[],o=e.config,l=this._min_date,h=this._max_date,m=!1;if(!o.display_marked_timespans)return a;if(!_&&_!==0){if(n.days<7)_=n.days;else{var v=new Date(n.days);if(m=+v,!(+h>+v&&+l<=+v))return a;_=v.getDay()}var u=l.getDay();u>_?_=7-(u-_):_-=u}var c=n.zones,f=e._get_css_classes_by_config(n);if(e._table_view&&e._mode=="month"){var p=[],g=[];if(s)p.push(s),g.push(_);else{g=m?[m]:e._get_dates_by_index(_);for(var y=0;y1?D=D*(E.size||E.options.length)+S:(D=S,E.size&&D>E.position+E.size&&(D=0))}for(s=s||e.locate_holder(D),y=0;y-1||(s.push.apply(s,e._on_scale_add_marker(h,a)),a=e.date.add(a,1,"day"))}}return s},e.markTimespan=function(n){if(!this._els)throw new Error("`scheduler.markTimespan` can't be used before scheduler initialization. Place `scheduler.markTimespan` call after `scheduler.init`.");var s=!1;this._els.dhx_cal_data||(e.get_elements(),s=!0);var _=e._marked_timespans_ids,a=e._marked_timespans_types,o=e._marked_timespans;e.deleteMarkedTimespan(),e.addMarkedTimespan(n);var l=e._mark_timespans();return s&&(e._els=[]),e._marked_timespans_ids=_,e._marked_timespans_types=a,e._marked_timespans=o,l},e.unmarkTimespan=function(n){if(n)for(var s=0;sl&&v<=l||v=o)_[a]=Math.min(o,v),_[a+1]=Math.max(l,u),a-=2;else{if(!h)continue;var c=o>v?0:2;_.splice(a+c,0,v,u)}s.splice(m--,2);break}return _},e._subtract_timespan_zones=function(n,s){for(var _=n.slice(),a=0;a<_.length;a+=2)for(var o=_[a],l=_[a+1],h=0;ho&&m=m&&l<=v&&_.splice(a,2),ov&&_.splice(u?a+2:a,u?0:2,v,l),a-=2;break}}return _},e.invertZones=function(n){return e._subtract_timespan_zones([0,1440],n.slice())},e._delete_marked_timespan_by_id=function(n){var s=e._marked_timespans_ids[n];if(s){for(var _=0;_1){var f=Math.round((s-e._min_date)/864e5),p=v.size||u.length;s=e.date.add(e._min_date,Math.floor(f/p),"day"),s=e.date.date_part(s)}else s=e.date.date_part(new Date(this._date));if(_=s.getDay(),a=s.valueOf(),l[o]&&l[o][c.key]){var g=l[o][c.key],y=e._get_types_to_render(g[_],g[a]);h.push.apply(h,e._get_configs_to_render(y))}}var x=l.global;if(e.config.overwrite_marked_timespans){var b=x[a]||x[_];h.push.apply(h,e._get_configs_to_render(b))}else x[a]&&h.push.apply(h,e._get_configs_to_render(x[a])),x[_]&&h.push.apply(h,e._get_configs_to_render(x[_]));for(var k=0;k{c&&(m.setModeDate.date=c),f&&(m.setModeDate.mode=f)};var u={render:(c,f)=>{m.needRender=!0,v(c,f)},setCurrentView:(c,f)=>{m.needRender=!0,v(c,f)},updateView:(c,f)=>{m.needUpdateView=!0,v(c,f)},render_data:()=>m.needRender=!0,render_view_data:c=>{c&&c.length?c.forEach(f=>m.repaintEvents[f.id]=!0):m.needRender=!0}};if(n.call(this,u),t=!0,this.callEvent("onBeforeBatchUpdate",[]),_(a),this.callEvent("onAfterBatchUpdate",[]),s.call(this),t=!1,!o)if(m.needRender)e.render(m.setModeDate.date,m.setModeDate.mode);else if(m.needUpdateView)e.updateView(m.setModeDate.date,m.setModeDate.mode);else for(const c in m.repaintEvents)e.updateEvent(c);h&&(this._dp.setUpdateMode(l),this._dp.sendData())}}function At(e){(function(i){i.attachEvent("onEventDeleted",function(t,r){let d=i.copy(r);i.config.undo_deleted&&!i.getState().new_event&&i.message({text:`
Undo
-
`,expire:1e4,type:"popup_after_delete",callback:function(n){n.target.closest(`[data-deleted-event-id="${r.id}"]`)&&(i.addEvent(d),i.render())}})})})(e),Mt(e),Nt(e),function(i){i.batchUpdate=Tt(i)}(e)}var Ct=Date.now();function Te(e){return!(!e||typeof e!="object")&&!!(e.getFullYear&&e.getMonth&&e.getDate)}const ee={uid:function(){return Ct++},mixin:function(e,i,t){for(var r in i)(e[r]===void 0||t)&&(e[r]=i[r]);return e},copy:function e(i){var t,r,d;if(i&&typeof i=="object")switch(!0){case Te(i):r=new Date(i);break;case(d=i,Array.isArray?Array.isArray(d):d&&d.length!==void 0&&d.pop&&d.push):for(r=new Array(i.length),t=0;t=0){if(!t)return r;var s=n===0||!(d.charAt(n-1)||"").trim(),_=n+i.length>=d.length||!d.charAt(n+i.length).trim();if(s&&_)return r}}r=r.parentNode}return null}function qt(e){var i=!1,t=!1;if(window.getComputedStyle){var r=window.getComputedStyle(e,null);i=r.display,t=r.visibility}else e.currentStyle&&(i=e.currentStyle.display,t=e.currentStyle.visibility);var d=!1,n=Ze({target:e},"dhx_form_repeat",!1);return n&&(d=n.style.height=="0px"),d=d||!e.offsetHeight,i!="none"&&t!="hidden"&&!d}function jt(e){return!isNaN(e.getAttribute("tabindex"))&&1*e.getAttribute("tabindex")>=0}function It(e){return!{a:!0,area:!0}[e.nodeName.loLowerCase()]||!!e.getAttribute("href")}function Pt(e){return!{input:!0,select:!0,textarea:!0,button:!0,object:!0}[e.nodeName.toLowerCase()]||!e.hasAttribute("disabled")}function Qe(){return document.head.createShadowRoot||document.head.attachShadow}function et(e){if(!e||!Qe())return document.body;for(;e.parentNode&&(e=e.parentNode);)if(e instanceof ShadowRoot)return e.host;return document.body}const se={getAbsoluteLeft:function(e){return this.getOffset(e).left},getAbsoluteTop:function(e){return this.getOffset(e).top},getOffsetSum:function(e){for(var i=0,t=0;e;)i+=parseInt(e.offsetTop),t+=parseInt(e.offsetLeft),e=e.offsetParent;return{top:i,left:t}},getOffsetRect:function(e){var i=e.getBoundingClientRect(),t=0,r=0;if(/Mobi/.test(navigator.userAgent)){var d=document.createElement("div");d.style.position="absolute",d.style.left="0px",d.style.top="0px",d.style.width="1px",d.style.height="1px",document.body.appendChild(d);var n=d.getBoundingClientRect();t=i.top-n.top,r=i.left-n.left,d.parentNode.removeChild(d)}else{var s=document.body,_=document.documentElement,a=window.pageYOffset||_.scrollTop||s.scrollTop,o=window.pageXOffset||_.scrollLeft||s.scrollLeft,l=_.clientTop||s.clientTop||0,h=_.clientLeft||s.clientLeft||0;t=i.top+a-l,r=i.left+o-h}return{top:Math.round(t),left:Math.round(r)}},getOffset:function(e){return e.getBoundingClientRect?this.getOffsetRect(e):this.getOffsetSum(e)},closest:function(e,i){return e&&i?Ce(e,i):null},insertAfter:function(e,i){i.nextSibling?i.parentNode.insertBefore(e,i.nextSibling):i.parentNode.appendChild(e)},remove:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},isChildOf:function(e,i){return i.contains(e)},getFocusableNodes:function(e){for(var i=e.querySelectorAll(["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"].join(", ")),t=Array.prototype.slice.call(i,0),r=0;r=0||navigator.userAgent.indexOf("Trident")>=0),isOpera:de&&navigator.userAgent.indexOf("Opera")>=0,isChrome:de&&navigator.userAgent.indexOf("Chrome")>=0,isKHTML:de&&(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0),isFF:de&&navigator.userAgent.indexOf("Firefox")>=0,isIPad:de&&navigator.userAgent.search(/iPad/gi)>=0,isEdge:de&&navigator.userAgent.indexOf("Edge")!=-1,isNode:!de||typeof navigator>"u"};function Oe(e){if(typeof e=="string"||typeof e=="number")return e;var i="";for(var t in e){var r="";e.hasOwnProperty(t)&&(r=t+"="+(r=typeof e[t]=="string"?encodeURIComponent(e[t]):typeof e[t]=="number"?e[t]:encodeURIComponent(JSON.stringify(e[t]))),i.length&&(r="&"+r),i+=r)}return i}function Ut(e){var i=function(n,s){for(var _="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",a=n.match(/%[a-zA-Z]/g),o=0;o50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":_+="set[3]=temp["+o+"]||0;";break;case"%i":_+="set[4]=temp["+o+"]||0;";break;case"%Y":_+="set[0]=temp["+o+"]||0;";break;case"%a":case"%A":_+="set[3]=set[3]%12+((temp["+o+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":_+="set[5]=temp["+o+"]||0;";break;case"%M":_+="set[1]=this.locale.date.month_short_hash[temp["+o+"]]||0;";break;case"%F":_+="set[1]=this.locale.date.month_full_hash[temp["+o+"]]||0;"}var l="set[0],set[1],set[2],set[3],set[4],set[5]";return s&&(l=" Date.UTC("+l+")"),new Function("date","var set=[0,0,1,0,0,0]; "+_+" return new Date("+l+");")},t=function(n,s){const _=n.match(/%[a-zA-Z]/g);return function(a){for(var o=[0,0,1,0,0,0],l=a.match(/[a-zA-Z]+|[0-9]+/g),h=0;h<_.length;h++)switch(_[h]){case"%j":case"%d":o[2]=l[h]||1;break;case"%n":case"%m":o[1]=(l[h]||1)-1;break;case"%y":o[0]=1*l[h]+(l[h]>50?1900:2e3);break;case"%g":case"%G":case"%h":case"%H":o[3]=l[h]||0;break;case"%i":o[4]=l[h]||0;break;case"%Y":o[0]=l[h]||0;break;case"%a":case"%A":o[3]=o[3]%12+((l[h]||"").toLowerCase()=="am"?0:12);break;case"%s":o[5]=l[h]||0;break;case"%M":o[1]=e.locale.date.month_short_hash[l[h]]||0;break;case"%F":o[1]=e.locale.date.month_full_hash[l[h]]||0}return s?new Date(Date.UTC(o[0],o[1],o[2],o[3],o[4],o[5])):new Date(o[0],o[1],o[2],o[3],o[4],o[5])}};let r;function d(){var n=!1;return e.config.csp==="auto"?(r===void 0&&(r=function(){try{new Function("cspEnabled = false;"),r=!1}catch{r=!0}return r}()),n=r):n=e.config.csp,n}e.date={init:function(){for(var n=e.locale.date.month_short,s=e.locale.date.month_short_hash={},_=0;_0){var a=(+_-+n)%864e5;if(a&&n.getTimezoneOffset()==_.getTimezoneOffset()){var o=a/36e5;_.setTime(_.getTime()+60*(24-o)*60*1e3)}}return s>=0&&!n.getHours()&&_.getHours()&&(_.getDate()11?"pm":"am":o.getHours()>11?"pm":"am";case"%A":return a?o.getUTCHours()>11?"PM":"AM":o.getHours()>11?"PM":"AM";case"%s":return a?e.date.to_fixed(o.getUTCSeconds()):e.date.to_fixed(o.getSeconds());case"%W":return a?e.date.to_fixed(e.date.getUTCISOWeek(o)):e.date.to_fixed(e.date.getISOWeek(o));default:return l}})}}(n,s):(n=n.replace(/%[a-zA-Z]/g,function(_){switch(_){case"%d":return'"+this.date.to_fixed(date.getDate())+"';case"%m":return'"+this.date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+this.date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+this.locale.date.day_short[date.getDay()]+"';case"%l":return'"+this.locale.date.day_full[date.getDay()]+"';case"%M":return'"+this.locale.date.month_short[date.getMonth()]+"';case"%F":return'"+this.locale.date.month_full[date.getMonth()]+"';case"%h":return'"+this.date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+this.date.to_fixed(date.getHours())+"';case"%i":return'"+this.date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+this.date.to_fixed(date.getSeconds())+"';case"%W":return'"+this.date.to_fixed(this.date.getISOWeek(date))+"';default:return _}}),s&&(n=n.replace(/date\.get/g,"date.getUTC")),new Function("date",'return "'+n+'";').bind(e))},str_to_date:function(n,s,_){var a=d()?t:i,o=a(n,s),l=/^[0-9]{4}(\-|\/)[0-9]{2}(\-|\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,h=/^[0-9]{2}\/[0-9]{2}\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/,v=/^[0-9]{2}\-[0-9]{2}\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,u=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,f=a("%Y-%m-%d %H:%i:%s",s),c=a("%m/%d/%Y %H:%i:%s",s),p=a("%d-%m-%Y %H:%i:%s",s);return function(m){if(!_&&!e.config.parse_exact_format){if(m&&m.getISOWeek)return new Date(m);if(typeof m=="number")return new Date(m);if(g=m,l.test(String(g)))return f(m);if(function(y){return h.test(String(y))}(m))return c(m);if(function(y){return v.test(String(y))}(m))return p(m);if(function(y){return u.test(y)}(m))return new Date(m)}var g;return o.call(e,m)}},getISOWeek:function(n){if(!n)return!1;var s=(n=this.date_part(new Date(n))).getDay();s===0&&(s=7);var _=new Date(n.valueOf());_.setDate(n.getDate()+(4-s));var a=_.getFullYear(),o=Math.round((_.getTime()-new Date(a,0,1).getTime())/864e5);return 1+Math.floor(o/7)},getUTCISOWeek:function(n){return this.getISOWeek(this.convert_to_utc(n))},convert_to_utc:function(n){return new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds())}}}function tt(e){return(function(){var i={};for(var t in this._events){var r=this._events[t];r.id.toString().indexOf("#")==-1&&(i[r.id]=r)}return i}).bind(e)}function Vt(e){e._loaded={},e._load=function(t,r){if(t=t||this._load_url){var d;if(t+=(t.indexOf("?")==-1?"?":"&")+"timeshift="+new Date().getTimezoneOffset(),this.config.prevent_cache&&(t+="&uid="+this.uid()),r=r||this._date,this._load_mode){var n=this.templates.load_format;for(r=this.date[this._load_mode+"_start"](new Date(r.valueOf()));r>this._min_date;)r=this.date.add(r,-1,this._load_mode);d=r;for(var s=!0;dr&&this._loaded[n(_)]);if(d<=r)return!1;for(e.ajax.get(t+"&from="+n(r)+"&to="+n(d),a);r=400)&&(this.callEvent("onLoadError",[t.xmlDoc]),r=[]),this._process_loading(r),this.callEvent("onXLE",[]),this.callEvent("onParse",[])},e._process_loading=function(t){this._loading=!0,this._not_render=!0;for(var r=0;r1)&&(this.xy.scroll_width=0,this._mobile=!0),this.config.touch){var i=!0;try{document.createEvent("TouchEvent")}catch{i=!1}i?this._touch_events(["touchmove","touchstart","touchend"],function(t){return t.touches&&t.touches.length>1?null:t.touches[0]?{target:t.target,pageX:t.touches[0].pageX,pageY:t.touches[0].pageY,clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}:t},function(){return!1}):window.PointerEvent||window.navigator.pointerEnabled?this._touch_events(["pointermove","pointerdown","pointerup"],function(t){return t.pointerType=="mouse"?null:t},function(t){return!t||t.pointerType=="mouse"}):window.navigator.msPointerEnabled&&this._touch_events(["MSPointerMove","MSPointerDown","MSPointerUp"],function(t){return t.pointerType==t.MSPOINTER_TYPE_MOUSE?null:t},function(t){return!t||t.pointerType==t.MSPOINTER_TYPE_MOUSE})}},e._touch_events=function(i,t,r){var d,n,s,_,a,o,l=0;function h(u,f,c){e.event(u,f,function(p){return!!e._is_lightbox_open()||(r(p)?void 0:c(p))},{passive:!1})}function v(u){r(u)||(e._hide_global_tip(),_&&(e._on_mouse_up(t(u)),e._temp_touch_block=!1),e._drag_id=null,e._drag_mode=null,e._drag_pos=null,e._pointerDragId=null,clearTimeout(s),_=o=!1,a=!0)}h(document.body,i[0],function(u){if(!r(u)){var f=t(u);if(f){if(_)return function(c){if(!r(c)){var p=e.getState().drag_mode,m=!!e.matrix&&e.matrix[e._mode],g=e.render_view_data;p=="create"&&m&&(e.render_view_data=function(){for(var y=e.getState().drag_id,x=e.getEvent(y),b=m.y_property,k=e.getEvents(x.start_date,x.end_date),E=0;E5||Math.abs(d.pageY-n.pageY)>5)&&(a=!0,clearTimeout(s)):a=!0)}}}),h(this._els.dhx_cal_data[0],"touchcancel",v),h(this._els.dhx_cal_data[0],"contextmenu",function(u){if(!r(u))return o?(u&&u.preventDefault&&u.preventDefault(),u.cancelBubble=!0,!1):void 0}),h(this._obj,i[1],function(u){var f;if(document&&document.body&&document.body.classList.add("dhx_cal_touch_active"),!r(u))if(e._pointerDragId=u.pointerId,_=a=!1,o=!0,f=n=t(u)){var c=new Date;if(!a&&!_&&c-l<250)return e._click.dhx_cal_data(f),window.setTimeout(function(){e.$destroyed||e._on_dbl_click(f)},50),u.preventDefault&&u.preventDefault(),u.cancelBubble=!0,e._block_next_stop=!0,!1;if(l=c,!a&&!_&&e.config.touch_drag){var p=e._locate_event(document.activeElement),m=e._locate_event(f.target),g=d?e._locate_event(d.target):null;if(p&&m&&p==m&&p!=g)return u.preventDefault&&u.preventDefault(),u.cancelBubble=!0,e._ignore_next_click=!1,e._click.dhx_cal_data(f),d=f,!1;s=setTimeout(function(){if(!e.$destroyed){_=!0;var y=d.target,x=e._getClassName(y);y&&x.indexOf("dhx_body")!=-1&&(y=y.previousSibling),e._on_mouse_down(d,y),e._drag_mode&&e._drag_mode!="create"&&e.for_rendered(e._drag_id,function(b,k){b.style.display="none",e._rendered.splice(k,1)}),e.config.touch_tip&&e._show_global_tip(),e.updateEvent(e._drag_id)}},e.config.touch_drag),d=f}}else a=!0}),h(this._els.dhx_cal_data[0],i[2],function(u){if(document&&document.body&&document.body.classList.remove("dhx_cal_touch_active"),!r(u))return e.config.touch_swipe_dates&&!_&&function(f,c,p,m){if(!f||!c)return!1;for(var g=f.target;g&&g!=e._obj;)g=g.parentNode;if(g!=e._obj||e.matrix&&e.matrix[e.getState().mode]&&e.matrix[e.getState().mode].scrollable)return!1;var y=Math.abs(f.pageY-c.pageY),x=Math.abs(f.pageX-c.pageX);return yp&&(!y||x/y>3)&&(f.pageX>c.pageX?e._click.dhx_cal_next_button():e._click.dhx_cal_prev_button(),!0)}(d,n,200,100)&&(e._block_next_stop=!0),_&&(e._ignore_next_click=!0,setTimeout(function(){e._ignore_next_click=!1},100)),v(u),e._block_next_stop?(e._block_next_stop=!1,u.preventDefault&&u.preventDefault(),u.cancelBubble=!0,!1):void 0}),e.event(document.body,i[2],v)},e._show_global_tip=function(){e._hide_global_tip();var i=e._global_tip=document.createElement("div");i.className="dhx_global_tip",e._update_global_tip(1),document.body.appendChild(i)},e._update_global_tip=function(i){var t=e._global_tip;if(t){var r="";if(e._drag_id&&!i){var d=e.getEvent(e._drag_id);d&&(r=""+(d._timed?e.templates.event_header(d.start_date,d.end_date,d):e.templates.day_date(d.start_date,d.end_date,d))+"
")}e._drag_mode=="create"||e._drag_mode=="new-size"?t.innerHTML=(e.locale.labels.drag_to_create||"Drag to create")+r:t.innerHTML=(e.locale.labels.drag_to_move||"Drag to move")+r}},e._hide_global_tip=function(){var i=e._global_tip;i&&i.parentNode&&(i.parentNode.removeChild(i),e._global_tip=0)}}function Bt(e){var i,t;function r(){if(e._is_material_skin())return!0;if(t!==void 0)return t;var _=document.createElement("div");_.style.position="absolute",_.style.left="-9999px",_.style.top="-9999px",_.innerHTML="",document.body.appendChild(_);var a=window.getComputedStyle(_.querySelector(".dhx_body")).getPropertyValue("box-sizing");document.body.removeChild(_),(t=a==="border-box")||setTimeout(function(){t=void 0},1e3)}function d(){if(!e._is_material_skin()&&!e._border_box_events()){var _=t;t=void 0,i=void 0,_!==r()&&e.$container&&e.getState().mode&&e.setCurrentView()}}function n(_){var a=_.getMinutes();return a=a<10?"0"+a:a,"
"+_.getHours()+" "+a+" "}e._addThemeClass=function(){document.documentElement.setAttribute("data-scheduler-theme",e.skin)},e._skin_settings={fix_tab_position:[1,0],use_select_menu_space:[1,0],wide_form:[1,0],hour_size_px:[44,42],displayed_event_color:["#ff4a4a","ffc5ab"],displayed_event_text_color:["#ffef80","7e2727"]},e._skin_xy={lightbox_additional_height:[90,50],nav_height:[59,22],bar_height:[24,20]},e._is_material_skin=function(){return e.skin?(e.skin+"").indexOf("material")>-1:function(){if(i===void 0){var _=document.createElement("div");_.style.position="absolute",_.style.left="-9999px",_.style.top="-9999px",_.innerHTML="
",document.body.appendChild(_);var a=window.getComputedStyle(_.querySelector(".dhx_cal_scale_placeholder")).getPropertyValue("position");i=a==="absolute",setTimeout(function(){i=null,_&&_.parentNode&&_.parentNode.removeChild(_)},500)}return i}()},e._build_skin_info=function(){(function(){const u=e.$container;clearInterval(s),u&&(s=setInterval(()=>{const f=getComputedStyle(u).getPropertyValue("--dhx-scheduler-theme");f&&f!==e.skin&&e.setSkin(f)},100))})();const _=getComputedStyle(this.$container),a=_.getPropertyValue("--dhx-scheduler-theme");let o,l=!!a,h={},v=!1;if(l){o=a;for(let u in e.xy)h[u]=_.getPropertyValue(`--dhx-scheduler-xy-${u}`);h.hour_size_px=_.getPropertyValue("--dhx-scheduler-config-hour_size_px"),h.wide_form=_.getPropertyValue("--dhx-scheduler-config-form_wide")}else o=function(){for(var u=document.getElementsByTagName("link"),f=0;f{switch(o.getAttribute("data-tab")||o.getAttribute("name")){case"day":case"day_tab":o.classList.add("dhx_cal_tab_first"),o.classList.add("dhx_cal_tab_segmented");break;case"week":case"week_tab":o.classList.add("dhx_cal_tab_segmented");break;case"month":case"month_tab":o.classList.add("dhx_cal_tab_last"),o.classList.add("dhx_cal_tab_segmented");break;default:o.classList.add("dhx_cal_tab_standalone")}}),function(o){if(e.config.header)return;const l=Array.from(o.querySelectorAll(".dhx_cal_tab")),h=["day","week","month"].map(u=>l.find(f=>f.getAttribute("data-tab")===u)).filter(u=>u!==void 0);let v=l.length>0?l[0]:null;h.reverse().forEach(u=>{o.insertBefore(u,v),v=u})}(e._els.dhx_cal_navline[0]))},{once:!0})}}function Jt(e,i){this.$scheduler=e,this.$dp=i,this._dataProcessorHandlers=[],this.attach=function(){var t=this.$dp,r=this.$scheduler;this._dataProcessorHandlers.push(r.attachEvent("onEventAdded",function(d){!this._loading&&this._validId(d)&&t.setUpdated(d,!0,"inserted")})),this._dataProcessorHandlers.push(r.attachEvent("onConfirmedBeforeEventDelete",function(d){if(this._validId(d)){var n=t.getState(d);return n=="inserted"||this._new_event?(t.setUpdated(d,!1),!0):n!="deleted"&&(n=="true_deleted"||(t.setUpdated(d,!0,"deleted"),!1))}})),this._dataProcessorHandlers.push(r.attachEvent("onEventChanged",function(d){!this._loading&&this._validId(d)&&t.setUpdated(d,!0,"updated")})),this._dataProcessorHandlers.push(r.attachEvent("onClearAll",function(){t._in_progress={},t._invalid={},t.updatedRows=[],t._waitMode=0})),t.attachEvent("insertCallback",r._update_callback),t.attachEvent("updateCallback",r._update_callback),t.attachEvent("deleteCallback",function(d,n){r.getEvent(n)?(r.setUserData(n,this.action_param,"true_deleted"),r.deleteEvent(n)):r._add_rec_marker&&r._update_callback(d,n)})},this.detach=function(){for(var t in this._dataProcessorHandlers){var r=this._dataProcessorHandlers[t];this.$scheduler.detachEvent(r)}this._dataProcessorHandlers=[]}}function Le(e){return this.serverProcessor=e,this.action_param="!nativeeditor_status",this.object=null,this.updatedRows=[],this.autoUpdate=!0,this.updateMode="cell",this._tMode="GET",this._headers=null,this._payload=null,this.post_delim="_",this._waitMode=0,this._in_progress={},this._invalid={},this.messages=[],this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"},this.enableUTFencoding(!0),Ae(this),this}function Wt(e){var i="data-dhxbox",t=null;function r(m,g){var y=m.callback;f.hide(m.box),t=m.box=null,y&&y(g)}function d(m){if(t){var g=m.which||m.keyCode,y=!1;if(c.keyboard){if(g==13||g==32){var x=m.target||m.srcElement;se.getClassName(x).indexOf("scheduler_popup_button")>-1&&x.click?x.click():(r(t,!0),y=!0)}g==27&&(r(t,!1),y=!0)}return y?(m.preventDefault&&m.preventDefault(),!(m.cancelBubble=!0)):void 0}}function n(m){n.cover||(n.cover=document.createElement("div"),e.event(n.cover,"keydown",d),n.cover.className="dhx_modal_cover",document.body.appendChild(n.cover)),n.cover.style.display=m?"inline-block":"none"}function s(m,g,y){var x=e._waiAria.messageButtonAttrString(m),b=(g||"").toLowerCase().replace(/ /g,"_");return``}function _(){for(var m=[].slice.apply(arguments,[0]),g=0;g
"),N+='`,expire:1e4,type:"popup_after_delete",callback:function(n){n.target.closest(`[data-deleted-event-id="${r.id}"]`)&&(i.addEvent(d),i.render())}})})})(e),Mt(e),Nt(e),function(i){i.batchUpdate=Tt(i)}(e)}var Ct=Date.now();function Te(e){return!(!e||typeof e!="object")&&!!(e.getFullYear&&e.getMonth&&e.getDate)}const ee={uid:function(){return Ct++},mixin:function(e,i,t){for(var r in i)(e[r]===void 0||t)&&(e[r]=i[r]);return e},copy:function e(i){var t,r,d;if(i&&typeof i=="object")switch(!0){case Te(i):r=new Date(i);break;case(d=i,Array.isArray?Array.isArray(d):d&&d.length!==void 0&&d.pop&&d.push):for(r=new Array(i.length),t=0;t
=0){if(!t)return r;var s=n===0||!(d.charAt(n-1)||"").trim(),_=n+i.length>=d.length||!d.charAt(n+i.length).trim();if(s&&_)return r}}r=r.parentNode}return null}function qt(e){var i=!1,t=!1;if(window.getComputedStyle){var r=window.getComputedStyle(e,null);i=r.display,t=r.visibility}else e.currentStyle&&(i=e.currentStyle.display,t=e.currentStyle.visibility);var d=!1,n=Ze({target:e},"dhx_form_repeat",!1);return n&&(d=n.style.height=="0px"),d=d||!e.offsetHeight,i!="none"&&t!="hidden"&&!d}function jt(e){return!isNaN(e.getAttribute("tabindex"))&&1*e.getAttribute("tabindex")>=0}function It(e){return!{a:!0,area:!0}[e.nodeName.loLowerCase()]||!!e.getAttribute("href")}function Pt(e){return!{input:!0,select:!0,textarea:!0,button:!0,object:!0}[e.nodeName.toLowerCase()]||!e.hasAttribute("disabled")}function Qe(){return document.head.createShadowRoot||document.head.attachShadow}function et(e){if(!e||!Qe())return document.body;for(;e.parentNode&&(e=e.parentNode);)if(e instanceof ShadowRoot)return e.host;return document.body}const se={getAbsoluteLeft:function(e){return this.getOffset(e).left},getAbsoluteTop:function(e){return this.getOffset(e).top},getOffsetSum:function(e){for(var i=0,t=0;e;)i+=parseInt(e.offsetTop),t+=parseInt(e.offsetLeft),e=e.offsetParent;return{top:i,left:t}},getOffsetRect:function(e){var i=e.getBoundingClientRect(),t=0,r=0;if(/Mobi/.test(navigator.userAgent)){var d=document.createElement("div");d.style.position="absolute",d.style.left="0px",d.style.top="0px",d.style.width="1px",d.style.height="1px",document.body.appendChild(d);var n=d.getBoundingClientRect();t=i.top-n.top,r=i.left-n.left,d.parentNode.removeChild(d)}else{var s=document.body,_=document.documentElement,a=window.pageYOffset||_.scrollTop||s.scrollTop,o=window.pageXOffset||_.scrollLeft||s.scrollLeft,l=_.clientTop||s.clientTop||0,h=_.clientLeft||s.clientLeft||0;t=i.top+a-l,r=i.left+o-h}return{top:Math.round(t),left:Math.round(r)}},getOffset:function(e){return e.getBoundingClientRect?this.getOffsetRect(e):this.getOffsetSum(e)},closest:function(e,i){return e&&i?Ce(e,i):null},insertAfter:function(e,i){i.nextSibling?i.parentNode.insertBefore(e,i.nextSibling):i.parentNode.appendChild(e)},remove:function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},isChildOf:function(e,i){return i.contains(e)},getFocusableNodes:function(e){for(var i=e.querySelectorAll(["a[href]","area[href]","input","select","textarea","button","iframe","object","embed","[tabindex]","[contenteditable]"].join(", ")),t=Array.prototype.slice.call(i,0),r=0;r=0||navigator.userAgent.indexOf("Trident")>=0),isOpera:de&&navigator.userAgent.indexOf("Opera")>=0,isChrome:de&&navigator.userAgent.indexOf("Chrome")>=0,isKHTML:de&&(navigator.userAgent.indexOf("Safari")>=0||navigator.userAgent.indexOf("Konqueror")>=0),isFF:de&&navigator.userAgent.indexOf("Firefox")>=0,isIPad:de&&navigator.userAgent.search(/iPad/gi)>=0,isEdge:de&&navigator.userAgent.indexOf("Edge")!=-1,isNode:!de||typeof navigator>"u"};function Oe(e){if(typeof e=="string"||typeof e=="number")return e;var i="";for(var t in e){var r="";e.hasOwnProperty(t)&&(r=t+"="+(r=typeof e[t]=="string"?encodeURIComponent(e[t]):typeof e[t]=="number"?e[t]:encodeURIComponent(JSON.stringify(e[t]))),i.length&&(r="&"+r),i+=r)}return i}function Ut(e){var i=function(n,s){for(var _="var temp=date.match(/[a-zA-Z]+|[0-9]+/g);",a=n.match(/%[a-zA-Z]/g),o=0;o50?1900:2000);";break;case"%g":case"%G":case"%h":case"%H":_+="set[3]=temp["+o+"]||0;";break;case"%i":_+="set[4]=temp["+o+"]||0;";break;case"%Y":_+="set[0]=temp["+o+"]||0;";break;case"%a":case"%A":_+="set[3]=set[3]%12+((temp["+o+"]||'').toLowerCase()=='am'?0:12);";break;case"%s":_+="set[5]=temp["+o+"]||0;";break;case"%M":_+="set[1]=this.locale.date.month_short_hash[temp["+o+"]]||0;";break;case"%F":_+="set[1]=this.locale.date.month_full_hash[temp["+o+"]]||0;"}var l="set[0],set[1],set[2],set[3],set[4],set[5]";return s&&(l=" Date.UTC("+l+")"),new Function("date","var set=[0,0,1,0,0,0]; "+_+" return new Date("+l+");")},t=function(n,s){const _=n.match(/%[a-zA-Z]/g);return function(a){for(var o=[0,0,1,0,0,0],l=a.match(/[a-zA-Z]+|[0-9]+/g),h=0;h<_.length;h++)switch(_[h]){case"%j":case"%d":o[2]=l[h]||1;break;case"%n":case"%m":o[1]=(l[h]||1)-1;break;case"%y":o[0]=1*l[h]+(l[h]>50?1900:2e3);break;case"%g":case"%G":case"%h":case"%H":o[3]=l[h]||0;break;case"%i":o[4]=l[h]||0;break;case"%Y":o[0]=l[h]||0;break;case"%a":case"%A":o[3]=o[3]%12+((l[h]||"").toLowerCase()=="am"?0:12);break;case"%s":o[5]=l[h]||0;break;case"%M":o[1]=e.locale.date.month_short_hash[l[h]]||0;break;case"%F":o[1]=e.locale.date.month_full_hash[l[h]]||0}return s?new Date(Date.UTC(o[0],o[1],o[2],o[3],o[4],o[5])):new Date(o[0],o[1],o[2],o[3],o[4],o[5])}};let r;function d(){var n=!1;return e.config.csp==="auto"?(r===void 0&&(r=function(){try{new Function("cspEnabled = false;"),r=!1}catch{r=!0}return r}()),n=r):n=e.config.csp,n}e.date={init:function(){for(var n=e.locale.date.month_short,s=e.locale.date.month_short_hash={},_=0;_0){var a=(+_-+n)%864e5;if(a&&n.getTimezoneOffset()==_.getTimezoneOffset()){var o=a/36e5;_.setTime(_.getTime()+60*(24-o)*60*1e3)}}return s>=0&&!n.getHours()&&_.getHours()&&(_.getDate()11?"pm":"am":o.getHours()>11?"pm":"am";case"%A":return a?o.getUTCHours()>11?"PM":"AM":o.getHours()>11?"PM":"AM";case"%s":return a?e.date.to_fixed(o.getUTCSeconds()):e.date.to_fixed(o.getSeconds());case"%W":return a?e.date.to_fixed(e.date.getUTCISOWeek(o)):e.date.to_fixed(e.date.getISOWeek(o));default:return l}})}}(n,s):(n=n.replace(/%[a-zA-Z]/g,function(_){switch(_){case"%d":return'"+this.date.to_fixed(date.getDate())+"';case"%m":return'"+this.date.to_fixed((date.getMonth()+1))+"';case"%j":return'"+date.getDate()+"';case"%n":return'"+(date.getMonth()+1)+"';case"%y":return'"+this.date.to_fixed(date.getFullYear()%100)+"';case"%Y":return'"+date.getFullYear()+"';case"%D":return'"+this.locale.date.day_short[date.getDay()]+"';case"%l":return'"+this.locale.date.day_full[date.getDay()]+"';case"%M":return'"+this.locale.date.month_short[date.getMonth()]+"';case"%F":return'"+this.locale.date.month_full[date.getMonth()]+"';case"%h":return'"+this.date.to_fixed((date.getHours()+11)%12+1)+"';case"%g":return'"+((date.getHours()+11)%12+1)+"';case"%G":return'"+date.getHours()+"';case"%H":return'"+this.date.to_fixed(date.getHours())+"';case"%i":return'"+this.date.to_fixed(date.getMinutes())+"';case"%a":return'"+(date.getHours()>11?"pm":"am")+"';case"%A":return'"+(date.getHours()>11?"PM":"AM")+"';case"%s":return'"+this.date.to_fixed(date.getSeconds())+"';case"%W":return'"+this.date.to_fixed(this.date.getISOWeek(date))+"';default:return _}}),s&&(n=n.replace(/date\.get/g,"date.getUTC")),new Function("date",'return "'+n+'";').bind(e))},str_to_date:function(n,s,_){var a=d()?t:i,o=a(n,s),l=/^[0-9]{4}(\-|\/)[0-9]{2}(\-|\/)[0-9]{2} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,h=/^[0-9]{2}\/[0-9]{2}\/[0-9]{4} ?(([0-9]{1,2}:[0-9]{2})(:[0-9]{1,2})?)?$/,m=/^[0-9]{2}\-[0-9]{2}\-[0-9]{4} ?(([0-9]{1,2}:[0-9]{1,2})(:[0-9]{1,2})?)?$/,v=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,u=a("%Y-%m-%d %H:%i:%s",s),c=a("%m/%d/%Y %H:%i:%s",s),f=a("%d-%m-%Y %H:%i:%s",s);return function(p){if(!_&&!e.config.parse_exact_format){if(p&&p.getISOWeek)return new Date(p);if(typeof p=="number")return new Date(p);if(g=p,l.test(String(g)))return u(p);if(function(y){return h.test(String(y))}(p))return c(p);if(function(y){return m.test(String(y))}(p))return f(p);if(function(y){return v.test(y)}(p))return new Date(p)}var g;return o.call(e,p)}},getISOWeek:function(n){if(!n)return!1;var s=(n=this.date_part(new Date(n))).getDay();s===0&&(s=7);var _=new Date(n.valueOf());_.setDate(n.getDate()+(4-s));var a=_.getFullYear(),o=Math.round((_.getTime()-new Date(a,0,1).getTime())/864e5);return 1+Math.floor(o/7)},getUTCISOWeek:function(n){return this.getISOWeek(this.convert_to_utc(n))},convert_to_utc:function(n){return new Date(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds())}}}function tt(e){return(function(){var i={};for(var t in this._events){var r=this._events[t];r.id.toString().indexOf("#")==-1&&(i[r.id]=r)}return i}).bind(e)}function Vt(e){e._loaded={},e._load=function(t,r){if(t=t||this._load_url){var d;if(t+=(t.indexOf("?")==-1?"?":"&")+"timeshift="+new Date().getTimezoneOffset(),this.config.prevent_cache&&(t+="&uid="+this.uid()),r=r||this._date,this._load_mode){var n=this.templates.load_format;for(r=this.date[this._load_mode+"_start"](new Date(r.valueOf()));r>this._min_date;)r=this.date.add(r,-1,this._load_mode);d=r;for(var s=!0;dr&&this._loaded[n(_)]);if(d<=r)return!1;for(e.ajax.get(t+"&from="+n(r)+"&to="+n(d),a);r=400)&&(this.callEvent("onLoadError",[t.xmlDoc]),r=[]),this._process_loading(r),this.callEvent("onXLE",[]),this.callEvent("onParse",[])},e._process_loading=function(t){this._loading=!0,this._not_render=!0;for(var r=0;r1)&&(this.xy.scroll_width=0,this._mobile=!0),this.config.touch){var i=!0;try{document.createEvent("TouchEvent")}catch{i=!1}i?this._touch_events(["touchmove","touchstart","touchend"],function(t){return t.touches&&t.touches.length>1?null:t.touches[0]?{target:t.target,pageX:t.touches[0].pageX,pageY:t.touches[0].pageY,clientX:t.touches[0].clientX,clientY:t.touches[0].clientY}:t},function(){return!1}):window.PointerEvent||window.navigator.pointerEnabled?this._touch_events(["pointermove","pointerdown","pointerup"],function(t){return t.pointerType=="mouse"?null:t},function(t){return!t||t.pointerType=="mouse"}):window.navigator.msPointerEnabled&&this._touch_events(["MSPointerMove","MSPointerDown","MSPointerUp"],function(t){return t.pointerType==t.MSPOINTER_TYPE_MOUSE?null:t},function(t){return!t||t.pointerType==t.MSPOINTER_TYPE_MOUSE})}},e._touch_events=function(i,t,r){var d,n,s,_,a,o,l=0;function h(v,u,c){e.event(v,u,function(f){return!!e._is_lightbox_open()||(r(f)?void 0:c(f))},{passive:!1})}function m(v){r(v)||(e._hide_global_tip(),_&&(e._on_mouse_up(t(v)),e._temp_touch_block=!1),e._drag_id=null,e._drag_mode=null,e._drag_pos=null,e._pointerDragId=null,clearTimeout(s),_=o=!1,a=!0)}h(document.body,i[0],function(v){if(!r(v)){var u=t(v);if(u){if(_)return function(c){if(!r(c)){var f=e.getState().drag_mode,p=!!e.matrix&&e.matrix[e._mode],g=e.render_view_data;f=="create"&&p&&(e.render_view_data=function(){for(var y=e.getState().drag_id,x=e.getEvent(y),b=p.y_property,k=e.getEvents(x.start_date,x.end_date),w=0;w5||Math.abs(d.pageY-n.pageY)>5)&&(a=!0,clearTimeout(s)):a=!0)}}}),h(this._els.dhx_cal_data[0],"touchcancel",m),h(this._els.dhx_cal_data[0],"contextmenu",function(v){if(!r(v))return o?(v&&v.preventDefault&&v.preventDefault(),v.cancelBubble=!0,!1):void 0}),h(this._obj,i[1],function(v){var u;if(document&&document.body&&document.body.classList.add("dhx_cal_touch_active"),!r(v))if(e._pointerDragId=v.pointerId,_=a=!1,o=!0,u=n=t(v)){var c=new Date;if(!a&&!_&&c-l<250)return e._click.dhx_cal_data(u),window.setTimeout(function(){e.$destroyed||e._on_dbl_click(u)},50),v.preventDefault&&v.preventDefault(),v.cancelBubble=!0,e._block_next_stop=!0,!1;if(l=c,!a&&!_&&e.config.touch_drag){var f=e._locate_event(document.activeElement),p=e._locate_event(u.target),g=d?e._locate_event(d.target):null;if(f&&p&&f==p&&f!=g)return v.preventDefault&&v.preventDefault(),v.cancelBubble=!0,e._ignore_next_click=!1,e._click.dhx_cal_data(u),d=u,!1;s=setTimeout(function(){if(!e.$destroyed){_=!0;var y=d.target,x=e._getClassName(y);y&&x.indexOf("dhx_body")!=-1&&(y=y.previousSibling),e._on_mouse_down(d,y),e._drag_mode&&e._drag_mode!="create"&&e.for_rendered(e._drag_id,function(b,k){b.style.display="none",e._rendered.splice(k,1)}),e.config.touch_tip&&e._show_global_tip(),e.updateEvent(e._drag_id)}},e.config.touch_drag),d=u}}else a=!0}),h(this._els.dhx_cal_data[0],i[2],function(v){if(document&&document.body&&document.body.classList.remove("dhx_cal_touch_active"),!r(v))return e.config.touch_swipe_dates&&!_&&function(u,c,f,p){if(!u||!c)return!1;for(var g=u.target;g&&g!=e._obj;)g=g.parentNode;if(g!=e._obj||e.matrix&&e.matrix[e.getState().mode]&&e.matrix[e.getState().mode].scrollable)return!1;var y=Math.abs(u.pageY-c.pageY),x=Math.abs(u.pageX-c.pageX);return yf&&(!y||x/y>3)&&(u.pageX>c.pageX?e._click.dhx_cal_next_button():e._click.dhx_cal_prev_button(),!0)}(d,n,200,100)&&(e._block_next_stop=!0),_&&(e._ignore_next_click=!0,setTimeout(function(){e._ignore_next_click=!1},100)),m(v),e._block_next_stop?(e._block_next_stop=!1,v.preventDefault&&v.preventDefault(),v.cancelBubble=!0,!1):void 0}),e.event(document.body,i[2],m)},e._show_global_tip=function(){e._hide_global_tip();var i=e._global_tip=document.createElement("div");i.className="dhx_global_tip",e._update_global_tip(1),document.body.appendChild(i)},e._update_global_tip=function(i){var t=e._global_tip;if(t){var r="";if(e._drag_id&&!i){var d=e.getEvent(e._drag_id);d&&(r="
"+(d._timed?e.templates.event_header(d.start_date,d.end_date,d):e.templates.day_date(d.start_date,d.end_date,d))+"
")}e._drag_mode=="create"||e._drag_mode=="new-size"?t.innerHTML=(e.locale.labels.drag_to_create||"Drag to create")+r:t.innerHTML=(e.locale.labels.drag_to_move||"Drag to move")+r}},e._hide_global_tip=function(){var i=e._global_tip;i&&i.parentNode&&(i.parentNode.removeChild(i),e._global_tip=0)}}function Bt(e){var i,t;function r(){if(e._is_material_skin())return!0;if(t!==void 0)return t;var _=document.createElement("div");_.style.position="absolute",_.style.left="-9999px",_.style.top="-9999px",_.innerHTML="",document.body.appendChild(_);var a=window.getComputedStyle(_.querySelector(".dhx_body")).getPropertyValue("box-sizing");document.body.removeChild(_),(t=a==="border-box")||setTimeout(function(){t=void 0},1e3)}function d(){if(!e._is_material_skin()&&!e._border_box_events()){var _=t;t=void 0,i=void 0,_!==r()&&e.$container&&e.getState().mode&&e.setCurrentView()}}function n(_){var a=_.getMinutes();return a=a<10?"0"+a:a,"
"+_.getHours()+" "+a+" "}e._addThemeClass=function(){document.documentElement.setAttribute("data-scheduler-theme",e.skin)},e._skin_settings={fix_tab_position:[1,0],use_select_menu_space:[1,0],wide_form:[1,0],hour_size_px:[44,42],displayed_event_color:["#ff4a4a","ffc5ab"],displayed_event_text_color:["#ffef80","7e2727"]},e._skin_xy={lightbox_additional_height:[90,50],nav_height:[59,22],bar_height:[24,20]},e._is_material_skin=function(){return e.skin?(e.skin+"").indexOf("material")>-1:function(){if(i===void 0){var _=document.createElement("div");_.style.position="absolute",_.style.left="-9999px",_.style.top="-9999px",_.innerHTML="
",document.body.appendChild(_);var a=window.getComputedStyle(_.querySelector(".dhx_cal_scale_placeholder")).getPropertyValue("position");i=a==="absolute",setTimeout(function(){i=null,_&&_.parentNode&&_.parentNode.removeChild(_)},500)}return i}()},e._build_skin_info=function(){(function(){const v=e.$container;clearInterval(s),v&&(s=setInterval(()=>{const u=getComputedStyle(v).getPropertyValue("--dhx-scheduler-theme");u&&u!==e.skin&&e.setSkin(u)},100))})();const _=getComputedStyle(this.$container),a=_.getPropertyValue("--dhx-scheduler-theme");let o,l=!!a,h={},m=!1;if(l){o=a;for(let v in e.xy)h[v]=_.getPropertyValue(`--dhx-scheduler-xy-${v}`);h.hour_size_px=_.getPropertyValue("--dhx-scheduler-config-hour_size_px"),h.wide_form=_.getPropertyValue("--dhx-scheduler-config-form_wide")}else o=function(){for(var v=document.getElementsByTagName("link"),u=0;u{switch(o.getAttribute("data-tab")||o.getAttribute("name")){case"day":case"day_tab":o.classList.add("dhx_cal_tab_first"),o.classList.add("dhx_cal_tab_segmented");break;case"week":case"week_tab":o.classList.add("dhx_cal_tab_segmented");break;case"month":case"month_tab":o.classList.add("dhx_cal_tab_last"),o.classList.add("dhx_cal_tab_segmented");break;default:o.classList.add("dhx_cal_tab_standalone")}}),function(o){if(e.config.header)return;const l=Array.from(o.querySelectorAll(".dhx_cal_tab")),h=["day","week","month"].map(v=>l.find(u=>u.getAttribute("data-tab")===v)).filter(v=>v!==void 0);let m=l.length>0?l[0]:null;h.reverse().forEach(v=>{o.insertBefore(v,m),m=v})}(e._els.dhx_cal_navline[0]))},{once:!0})}}function Jt(e,i){this.$scheduler=e,this.$dp=i,this._dataProcessorHandlers=[],this.attach=function(){var t=this.$dp,r=this.$scheduler;this._dataProcessorHandlers.push(r.attachEvent("onEventAdded",function(d){!this._loading&&this._validId(d)&&t.setUpdated(d,!0,"inserted")})),this._dataProcessorHandlers.push(r.attachEvent("onConfirmedBeforeEventDelete",function(d){if(this._validId(d)){var n=t.getState(d);return n=="inserted"||this._new_event?(t.setUpdated(d,!1),!0):n!="deleted"&&(n=="true_deleted"||(t.setUpdated(d,!0,"deleted"),!1))}})),this._dataProcessorHandlers.push(r.attachEvent("onEventChanged",function(d){!this._loading&&this._validId(d)&&t.setUpdated(d,!0,"updated")})),this._dataProcessorHandlers.push(r.attachEvent("onClearAll",function(){t._in_progress={},t._invalid={},t.updatedRows=[],t._waitMode=0})),t.attachEvent("insertCallback",r._update_callback),t.attachEvent("updateCallback",r._update_callback),t.attachEvent("deleteCallback",function(d,n){r.getEvent(n)?(r.setUserData(n,this.action_param,"true_deleted"),r.deleteEvent(n)):r._add_rec_marker&&r._update_callback(d,n)})},this.detach=function(){for(var t in this._dataProcessorHandlers){var r=this._dataProcessorHandlers[t];this.$scheduler.detachEvent(r)}this._dataProcessorHandlers=[]}}function Le(e){return this.serverProcessor=e,this.action_param="!nativeeditor_status",this.object=null,this.updatedRows=[],this.autoUpdate=!0,this.updateMode="cell",this._tMode="GET",this._headers=null,this._payload=null,this.post_delim="_",this._waitMode=0,this._in_progress={},this._invalid={},this.messages=[],this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"},this.enableUTFencoding(!0),Ae(this),this}function Wt(e){var i="data-dhxbox",t=null;function r(p,g){var y=p.callback;u.hide(p.box),t=p.box=null,y&&y(g)}function d(p){if(t){var g=p.which||p.keyCode,y=!1;if(c.keyboard){if(g==13||g==32){var x=p.target||p.srcElement;se.getClassName(x).indexOf("scheduler_popup_button")>-1&&x.click?x.click():(r(t,!0),y=!0)}g==27&&(r(t,!1),y=!0)}return y?(p.preventDefault&&p.preventDefault(),!(p.cancelBubble=!0)):void 0}}function n(p){n.cover||(n.cover=document.createElement("div"),e.event(n.cover,"keydown",d),n.cover.className="dhx_modal_cover",document.body.appendChild(n.cover)),n.cover.style.display=p?"inline-block":"none"}function s(p,g,y){var x=e._waiAria.messageButtonAttrString(p),b=(g||"").toLowerCase().replace(/ /g,"_");return``}function _(){for(var p=[].slice.apply(arguments,[0]),g=0;g
"),N+='",m.innerHTML=N,this._rendered.push(m.firstChild),l.appendChild(m.firstChild)}},a._locate_event=function(o){for(var l=null;o&&!l&&o.getAttribute;)l=o.getAttribute(this.config.event_attribute),o=o.parentNode;return l},a.edit=function(o){this._edit_id!=o&&(this.editStop(!1,o),this._edit_id=o,this.updateEvent(o))},a.editStop=function(o,l){if(!l||this._edit_id!=l){var h=this.getEvent(this._edit_id);h&&(o&&(h.text=this._editor.value),this._edit_id=null,this._editor=null,this.updateEvent(h.id),this._edit_stop_event(h,o))}},a._edit_stop_event=function(o,l){this._new_event?(l?this.callEvent("onEventAdded",[o.id,o]):o&&this.deleteEvent(o.id,!0),this._new_event=null):l&&this.callEvent("onEventChanged",[o.id,o])},a.getEvents=function(o,l){var h=[];for(var v in this._events){var u=this._events[v];u&&(!o&&!l||u.start_date
o)&&h.push(u)}return h},a.getRenderedEvent=function(o){if(o){for(var l=a._rendered,h=0;h-1&&(y=y.split(a.config.section_delimiter)[0])}var x=p.getSectionTop(y),b=p.posFromDate(g.start_date),k=a.$container.querySelector(".dhx_timeline_data_wrapper");if(b-=(k.offsetWidth-p.dx)/2,x=x-k.offsetHeight/2+p.dy/2,p._smartRenderingEnabled())var E=p.attachEvent("onScroll",function(){D(),p.detachEvent(E)});p.scrollTo({left:b,top:x}),p._smartRenderingEnabled()||D()}}else D();a.callEvent("onAfterEventDisplay",[h,l])}function D(){h.color=f,h.textColor=c}}}(i),function(a){a._append_drag_marker=function(o){if(!o.parentNode){var l=a._els.dhx_cal_data[0].lastChild,h=a._getClassName(l);h.indexOf("dhx_scale_holder")<0&&l.previousSibling&&(l=l.previousSibling),h=a._getClassName(l),l&&h.indexOf("dhx_scale_holder")===0&&l.appendChild(o)}},a._update_marker_position=function(o,l){var h=a._calc_event_y(l,0);o.style.top=h.top+"px",o.style.height=h.height+"px"},a.highlightEventPosition=function(o){var l=document.createElement("div");l.setAttribute("event_id",o.id),l.setAttribute(this.config.event_attribute,o.id),this._rendered.push(l),this._update_marker_position(l,o);var h=this.templates.drag_marker_class(o.start_date,o.end_date,o),v=this.templates.drag_marker_content(o.start_date,o.end_date,o);l.className="dhx_drag_marker",h&&(l.className+=" "+h),v&&(l.innerHTML=v),this._append_drag_marker(l)}}(i),Vt(i),function(a){function o(){const l=a.config.csp===!0,h=!!window.Sfdc||!!window.$A||window.Aura||"$shadowResolver$"in document.body;return l||h?a.$root:document.body}a._lightbox_controls={},a.formSection=function(l){for(var h=this.config.lightbox.sections,v=0;v "},set_value:function(l,h,v,u){l.innerHTML=h||""},get_value:function(l,h,v){return l.innerHTML||""},focus:function(l){}},textarea:{render:function(l){return`
`},set_value:function(l,h,v){a.form_blocks.textarea._get_input(l).value=h||""},get_value:function(l,h){return a.form_blocks.textarea._get_input(l).value},focus:function(l){var h=a.form_blocks.textarea._get_input(l);a._focus(h,!0)},_get_input:function(l){return l.getElementsByTagName("textarea")[0]}},select:{render:function(l){for(var h="
",v=0;v"+l.options[v].label+"";return h+"
"},set_value:function(l,h,v,u){var f=l.firstChild;!f._dhx_onchange&&u.onchange&&(a.event(f,"change",u.onchange),f._dhx_onchange=!0),h===void 0&&(h=(f.options[0]||{}).value),f.value=h||""},get_value:function(l,h){return l.firstChild.value},focus:function(l){var h=l.firstChild;a._focus(h,!0)}},time:{render:function(l){l.time_format||(l.time_format=["%H:%i","%d","%m","%Y"]),l._time_format_order={};var h=l.time_format,v=a.config,u=a.date.date_part(a._currentDate()),f=1440,c=0;a.config.limit_time_select&&(f=60*v.last_hour+1,c=60*v.first_hour,u.setHours(v.first_hour));for(var p="",m=0;m
0&&(p+=" ");var y="",x="";switch(g){case"%Y":var b,k,E;y="dhx_lightbox_year_select",l._time_format_order[3]=m,l.year_range&&(isNaN(l.year_range)?l.year_range.push&&(k=l.year_range[0],E=l.year_range[1]):b=l.year_range),b=b||10;var D=D||Math.floor(b/2);k=k||u.getFullYear()-D,E=E||k+b;for(var w=k;w"+w+"";break;case"%m":for(y="dhx_lightbox_month_select",l._time_format_order[2]=m,w=0;w<12;w++)x+=""+this.locale.date.month_full[w]+" ";break;case"%d":for(y="dhx_lightbox_day_select",l._time_format_order[1]=m,w=1;w<32;w++)x+=""+w+" ";break;case"%H:%i":y="dhx_lightbox_time_select",l._time_format_order[0]=m,w=c;var S=u.getDate();for(l._time_values=[];w"+this.templates.time_picker(u)+"",l._time_values.push(w),u.setTime(u.valueOf()+60*this.config.time_step*1e3),w=24*(u.getDate()!=S?1:0)*60+60*u.getHours()+u.getMinutes()}if(x){var M=a._waiAria.lightboxSelectAttrString(g);p+=""+x+" "}}return""+p+" – "+p+"
"},set_value:function(l,h,v,u){var f,c,p=a.config,m=l.getElementsByTagName("select"),g=u._time_format_order;if(p.full_day){if(!l._full_day){var y=" "+a.locale.labels.full_day+" ";a.config.wide_form||(y=l.previousSibling.innerHTML+y),l.previousSibling.innerHTML=y,l._full_day=!0}var x=l.previousSibling.getElementsByTagName("input")[0];x.checked=a.date.time_part(v.start_date)===0&&a.date.time_part(v.end_date)===0,m[g[0]].disabled=x.checked,m[g[0]+m.length/2].disabled=x.checked,x.$_eventAttached||(x.$_eventAttached=!0,a.event(x,"click",function(){if(x.checked){var D={};a.form_blocks.time.get_value(l,D,u),f=a.date.date_part(D.start_date),(+(c=a.date.date_part(D.end_date))==+f||+c>=+f&&(v.end_date.getHours()!==0||v.end_date.getMinutes()!==0))&&(c=a.date.add(c,1,"day"))}else f=null,c=null;m[g[0]].disabled=x.checked,m[g[0]+m.length/2].disabled=x.checked,E(m,0,f||v.start_date),E(m,4,c||v.end_date)}))}if(p.auto_end_date&&p.event_duration)for(var b=function(){p.auto_end_date&&p.event_duration&&(f=new Date(m[g[3]].value,m[g[2]].value,m[g[1]].value,0,m[g[0]].value),c=new Date(f.getTime()+60*a.config.event_duration*1e3),E(m,4,c))},k=0;k<4;k++)m[k].$_eventAttached||(m[k].$_eventAttached=!0,a.event(m[k],"change",b));function E(D,w,S){for(var M=u._time_values,N=60*S.getHours()+S.getMinutes(),A=N,T=!1,H=0;H";for(var u=0;u
"+a.locale.labels[v[u]]+"
";v=this.config.buttons_right;var f=a.config.rtl;for(u=0;u
",h+="
"+a.locale.labels[v[u]]+"
";h+="
",h+=" ",l.innerHTML=h,a.config.drag_lightbox&&(a.event(l.firstChild,"mousedown",a._ready_to_dnd),a.event(l.firstChild,"selectstart",function(b){return b.preventDefault(),!1}),l.firstChild.style.cursor="move",a._init_dnd_events()),this._waiAria.lightboxAttr(l),this.show_cover(),this._cover.insertBefore(l,this._cover.firstChild),this._lightbox=l;var c=this.config.lightbox.sections;for(h="",u=0;u
"+this.locale.labels["button_"+c[u].button]+"
"),this.config.wide_form&&(h+="
");var g=this.locale.labels["section_"+c[u].name];typeof g!="string"&&(g=c[u].name),h+="
"+m+""+g+"
"+p.render.call(this,c[u]),h+="
"}}var y=l.getElementsByTagName("div");for(u=0;u
+
`;g.innerHTML=D;var E=g.cloneNode(!0).firstChild;if(!p&&a.renderEvent(E,o,m,v,c,f))return o.color&&E.style.setProperty("--dhx-scheduler-event-background",o.color),o.textColor&&E.style.setProperty("--dhx-scheduler-event-color",o.textColor),E;E=g.firstChild,o.color&&E.style.setProperty("--dhx-scheduler-event-background",o.color),o.textColor&&E.style.setProperty("--dhx-scheduler-event-color",o.textColor);var S='';S+=''+c+"
",S+=''+f+"
";var M="dhx_event_resize dhx_footer";return(p||o._drag_resize===!1)&&(M="dhx_resize_denied "+M),S+='
',E.innerHTML=S,E},a.renderEvent=function(){return!1},a.locate_holder=function(o){return this._mode=="day"?this._els.dhx_cal_data[0].firstChild:this._els.dhx_cal_data[0].childNodes[o]},a.locate_holder_day=function(o,l){var h=Math.floor((this._correct_shift(o,1)-this._min_date)/864e5);return l&&this.date.time_part(o)&&h++,h},a._get_dnd_order=function(o,l,h){if(!this._drag_event)return o;this._drag_event._orig_sorder?o=this._drag_event._orig_sorder:this._drag_event._orig_sorder=o;for(var m=l*o;m+l>h;)o--,m-=l;return Math.max(o,0)},a._get_event_bar_pos=function(o){var l=this.config.rtl,h=this._colsS,m=h[o._sday],v=h[o._eday];l&&(m=h[h.col_length]-h[o._eday]+h[0],v=h[h.col_length]-h[o._sday]+h[0]),v==m&&(v=h[o._eday+1]);var u=this.xy.bar_height,c=o._sorder;if(o.id==this._drag_id){var f=h.heights[o._sweek+1]-h.heights[o._sweek]-this.xy.month_head_height;c=a._get_dnd_order(c,u,f)}var p=c*u;return{x:m,x2:v,y:h.heights[o._sweek]+(h.height?this.xy.month_scale_height+2:2)+p}},a.render_event_bar=function(o){var l=this._rendered_location,h=this._get_event_bar_pos(o),m=h.y,v=h.x,u=h.x2,c="";if(u){var f=a.config.resize_month_events&&this._mode=="month"&&(!o._timed||a.config.resize_month_timed),p=document.createElement("div"),g=o.hasOwnProperty("_first_chunk")&&o._first_chunk,y=o.hasOwnProperty("_last_chunk")&&o._last_chunk,x=f&&(o._timed||g),b=f&&(o._timed||y),k=!0,w="dhx_cal_event_clear";o._timed&&!f||(k=!1,w="dhx_cal_event_line"),g&&(w+=" dhx_cal_event_line_start"),y&&(w+=" dhx_cal_event_line_end"),x&&(c+="
"),b&&(c+="
");var D=a.templates.event_class(o.start_date,o.end_date,o);D&&(w+=" "+D);var E=o.color?"--dhx-scheduler-event-background:"+o.color+";":"",S=o.textColor?"--dhx-scheduler-event-color:"+o.textColor+";":"",M=["position:absolute","top:"+m+"px","left:"+v+"px","width:"+(u-v-(k?1:0))+"px","height:"+(this.xy.bar_height-2)+"px",S,E,o._text_style||""].join(";"),N="";f&&(N+=c),a.getState().mode=="month"&&(o=a.getEvent(o.id)),o._timed&&(N+=`
${a.templates.event_bar_date(o.start_date,o.end_date,o)} `),N+="
",N+=a.templates.event_bar_text(o.start_date,o.end_date,o)+"
",N+="
",N+="",p.innerHTML=N,this._rendered.push(p.firstChild),l.appendChild(p.firstChild)}},a._locate_event=function(o){for(var l=null;o&&!l&&o.getAttribute;)l=o.getAttribute(this.config.event_attribute),o=o.parentNode;return l},a.edit=function(o){this._edit_id!=o&&(this.editStop(!1,o),this._edit_id=o,this.updateEvent(o))},a.editStop=function(o,l){if(!l||this._edit_id!=l){var h=this.getEvent(this._edit_id);h&&(o&&(h.text=this._editor.value),this._edit_id=null,this._editor=null,this.updateEvent(h.id),this._edit_stop_event(h,o))}},a._edit_stop_event=function(o,l){this._new_event?(l?this.callEvent("onEventAdded",[o.id,o]):o&&this.deleteEvent(o.id,!0),this._new_event=null):l&&this.callEvent("onEventChanged",[o.id,o])},a.getEvents=function(o,l){var h=[];for(var m in this._events){var v=this._events[m];v&&(!o&&!l||v.start_date
o)&&h.push(v)}return h},a.getRenderedEvent=function(o){if(o){for(var l=a._rendered,h=0;h-1&&(y=y.split(a.config.section_delimiter)[0])}var x=f.getSectionTop(y),b=f.posFromDate(g.start_date),k=a.$container.querySelector(".dhx_timeline_data_wrapper");if(b-=(k.offsetWidth-f.dx)/2,x=x-k.offsetHeight/2+f.dy/2,f._smartRenderingEnabled())var w=f.attachEvent("onScroll",function(){D(),f.detachEvent(w)});f.scrollTo({left:b,top:x}),f._smartRenderingEnabled()||D()}}else D();a.callEvent("onAfterEventDisplay",[h,l])}function D(){h.color=u,h.textColor=c}}}(i),function(a){a._append_drag_marker=function(o){if(!o.parentNode){var l=a._els.dhx_cal_data[0].lastChild,h=a._getClassName(l);h.indexOf("dhx_scale_holder")<0&&l.previousSibling&&(l=l.previousSibling),h=a._getClassName(l),l&&h.indexOf("dhx_scale_holder")===0&&l.appendChild(o)}},a._update_marker_position=function(o,l){var h=a._calc_event_y(l,0);o.style.top=h.top+"px",o.style.height=h.height+"px"},a.highlightEventPosition=function(o){var l=document.createElement("div");l.setAttribute("event_id",o.id),l.setAttribute(this.config.event_attribute,o.id),this._rendered.push(l),this._update_marker_position(l,o);var h=this.templates.drag_marker_class(o.start_date,o.end_date,o),m=this.templates.drag_marker_content(o.start_date,o.end_date,o);l.className="dhx_drag_marker",h&&(l.className+=" "+h),m&&(l.innerHTML=m),this._append_drag_marker(l)}}(i),Vt(i),function(a){function o(){const l=a.config.csp===!0,h=!!window.Sfdc||!!window.$A||window.Aura||"$shadowResolver$"in document.body;return l||h?a.$root:document.body}a._lightbox_controls={},a.formSection=function(l){for(var h=this.config.lightbox.sections,m=0;m "},set_value:function(l,h,m,v){l.innerHTML=h||""},get_value:function(l,h,m){return l.innerHTML||""},focus:function(l){}},textarea:{render:function(l){return`
`},set_value:function(l,h,m){a.form_blocks.textarea._get_input(l).value=h||""},get_value:function(l,h){return a.form_blocks.textarea._get_input(l).value},focus:function(l){var h=a.form_blocks.textarea._get_input(l);a._focus(h,!0)},_get_input:function(l){return l.getElementsByTagName("textarea")[0]}},select:{render:function(l){for(var h="",m=0;m"+l.options[m].label+"";return h+"
"},set_value:function(l,h,m,v){var u=l.firstChild;!u._dhx_onchange&&v.onchange&&(a.event(u,"change",v.onchange),u._dhx_onchange=!0),h===void 0&&(h=(u.options[0]||{}).value),u.value=h||""},get_value:function(l,h){return l.firstChild.value},focus:function(l){var h=l.firstChild;a._focus(h,!0)}},time:{render:function(l){l.time_format||(l.time_format=["%H:%i","%d","%m","%Y"]),l._time_format_order={};var h=l.time_format,m=a.config,v=a.date.date_part(a._currentDate()),u=1440,c=0;a.config.limit_time_select&&(u=60*m.last_hour+1,c=60*m.first_hour,v.setHours(m.first_hour));for(var f="",p=0;p0&&(f+=" ");var y="",x="";switch(g){case"%Y":var b,k,w;y="dhx_lightbox_year_select",l._time_format_order[3]=p,l.year_range&&(isNaN(l.year_range)?l.year_range.push&&(k=l.year_range[0],w=l.year_range[1]):b=l.year_range),b=b||10;var D=D||Math.floor(b/2);k=k||v.getFullYear()-D,w=w||k+b;for(var E=k;E"+E+"";break;case"%m":for(y="dhx_lightbox_month_select",l._time_format_order[2]=p,E=0;E<12;E++)x+=""+this.locale.date.month_full[E]+" ";break;case"%d":for(y="dhx_lightbox_day_select",l._time_format_order[1]=p,E=1;E<32;E++)x+=""+E+" ";break;case"%H:%i":y="dhx_lightbox_time_select",l._time_format_order[0]=p,E=c;var S=v.getDate();for(l._time_values=[];E"+this.templates.time_picker(v)+"",l._time_values.push(E),v.setTime(v.valueOf()+60*this.config.time_step*1e3),E=24*(v.getDate()!=S?1:0)*60+60*v.getHours()+v.getMinutes()}if(x){var M=a._waiAria.lightboxSelectAttrString(g);f+=""+x+" "}}return" "+f+" – "+f+"
"},set_value:function(l,h,m,v){var u,c,f=a.config,p=l.getElementsByTagName("select"),g=v._time_format_order;if(f.full_day){if(!l._full_day){var y=" "+a.locale.labels.full_day+" ";a.config.wide_form||(y=l.previousSibling.innerHTML+y),l.previousSibling.innerHTML=y,l._full_day=!0}var x=l.previousSibling.getElementsByTagName("input")[0];x.checked=a.date.time_part(m.start_date)===0&&a.date.time_part(m.end_date)===0,p[g[0]].disabled=x.checked,p[g[0]+p.length/2].disabled=x.checked,x.$_eventAttached||(x.$_eventAttached=!0,a.event(x,"click",function(){if(x.checked){var D={};a.form_blocks.time.get_value(l,D,v),u=a.date.date_part(D.start_date),(+(c=a.date.date_part(D.end_date))==+u||+c>=+u&&(m.end_date.getHours()!==0||m.end_date.getMinutes()!==0))&&(c=a.date.add(c,1,"day"))}else u=null,c=null;p[g[0]].disabled=x.checked,p[g[0]+p.length/2].disabled=x.checked,w(p,0,u||m.start_date),w(p,4,c||m.end_date)}))}if(f.auto_end_date&&f.event_duration)for(var b=function(){f.auto_end_date&&f.event_duration&&(u=new Date(p[g[3]].value,p[g[2]].value,p[g[1]].value,0,p[g[0]].value),c=new Date(u.getTime()+60*a.config.event_duration*1e3),w(p,4,c))},k=0;k<4;k++)p[k].$_eventAttached||(p[k].$_eventAttached=!0,a.event(p[k],"change",b));function w(D,E,S){for(var M=v._time_values,N=60*S.getHours()+S.getMinutes(),T=N,A=!1,H=0;H";for(var v=0;v
"+a.locale.labels[m[v]]+"
";m=this.config.buttons_right;var u=a.config.rtl;for(v=0;v