(e)
| 9 | */ |
| 10 | const _e = typeof window < "u" ? window : global; |
| 11 | function Mt(e) { |
| 12 | let i = [], t = !1, n = null, s = null; |
| 13 | function a() { |
| 14 | return e.config.drag_highlight && e.markTimespan; |
| 15 | } |
| 16 | function o(d) { |
| 17 | const l = e.getView(d); |
| 18 | return l ? l.layout : d; |
| 19 | } |
| 20 | function _(d) { |
| 21 | const { event: l, layout: h, viewName: p, sectionId: m, eventNode: g } = d; |
| 22 | (function(f, y) { |
| 23 | switch (y) { |
| 24 | case "month": |
| 25 | f.style.top = "", f.style.left = ""; |
| 26 | break; |
| 27 | case "timeline": |
| 28 | f.style.left = "", f.style.marginLeft = "1px"; |
| 29 | break; |
| 30 | default: |
| 31 | f.style.top = ""; |
| 32 | } |
| 33 | })(g, h); |
| 34 | const c = {}; |
| 35 | let u = { start_date: l.start_date, end_date: l.end_date, css: "dhx_scheduler_dnd_marker", html: g }; |
| 36 | if (h == "timeline") { |
| 37 | const f = e.getView(p); |
| 38 | if (f.round_position) { |
| 39 | const y = e._get_date_index(f, l.start_date), w = f._trace_x[y]; |
| 40 | u.start_date = w; |
| 41 | } |
| 42 | } |
| 43 | return h != "timeline" && h != "month" || (u = { ...u, end_date: e.date.add(l.start_date, 1, "minute") }), m && (c[p] = m, u.sections = c), u; |
| 44 | } |
| 45 | function r(d) { |
| 46 | const { layout: l } = d; |
| 47 | let h; |
| 48 | switch (l) { |
| 49 | case "month": |
| 50 | h = function(p) { |
| 51 | let m = []; |
| 52 | const { event: g, layout: c, viewName: u, sectionId: f } = p, y = []; |
| 53 | let w = new Date(g.start_date); |
| 54 | for (; w.valueOf() < g.end_date.valueOf(); ) { |
| 55 | let M = { start_date: w }; |
| 56 | y.push(M), w = e.date.week_start(e.date.add(w, 1, "week")); |
| 57 | } |
| 58 | let D = e.$container.querySelectorAll(`[${e.config.event_attribute}='${g.id}']`); |
| 59 | for (let M = 0; M < D.length; M++) { |
| 60 | const k = { event: y[M], layout: c, viewName: u, sectionId: f, eventNode: D[M].cloneNode(!0) }; |
| 61 | m.push(_(k)); |
| 62 | } |
| 63 | return m; |
| 64 | }(d); |
| 65 | break; |
| 66 | case "timeline": |
| 67 | case "units": |
| 68 | h = function(p) { |
no test coverage detected