(e)
| 1013 | } |
| 1014 | } |
| 1015 | function Ye(e) { |
| 1016 | const i = new qt(); |
| 1017 | e.attachEvent = function(t, n, s) { |
| 1018 | t = "ev_" + t.toLowerCase(), i.listeners[t] || (i.listeners[t] = function(o) { |
| 1019 | let _ = {}, r = 0; |
| 1020 | const d = function() { |
| 1021 | let l = !0; |
| 1022 | for (const h in _) { |
| 1023 | const p = _[h].apply(o, arguments); |
| 1024 | l = l && p; |
| 1025 | } |
| 1026 | return l; |
| 1027 | }; |
| 1028 | return d.addEvent = function(l, h) { |
| 1029 | if (typeof l == "function") { |
| 1030 | let p; |
| 1031 | if (h && h.id ? p = h.id : (p = r, r++), h && h.once) { |
| 1032 | const m = l; |
| 1033 | l = function() { |
| 1034 | m(), d.removeEvent(p); |
| 1035 | }; |
| 1036 | } |
| 1037 | return _[p] = l, p; |
| 1038 | } |
| 1039 | return !1; |
| 1040 | }, d.removeEvent = function(l) { |
| 1041 | delete _[l]; |
| 1042 | }, d.clear = function() { |
| 1043 | _ = {}; |
| 1044 | }, d; |
| 1045 | }(this)), s && s.thisObject && (n = n.bind(s.thisObject)); |
| 1046 | let a = t + ":" + i.listeners[t].addEvent(n, s); |
| 1047 | return s && s.id && (a = s.id), a; |
| 1048 | }, e.attachAll = function(t) { |
| 1049 | this.attachEvent("listen_all", t); |
| 1050 | }, e.callEvent = function(t, n) { |
| 1051 | if (i._silent_mode) |
| 1052 | return !0; |
| 1053 | const s = "ev_" + t.toLowerCase(), a = i.listeners; |
| 1054 | return a.ev_listen_all && a.ev_listen_all.apply(this, [t].concat(n)), !a[s] || a[s].apply(this, n); |
| 1055 | }, e.checkEvent = function(t) { |
| 1056 | return !!i.listeners["ev_" + t.toLowerCase()]; |
| 1057 | }, e.detachEvent = function(t) { |
| 1058 | if (t) { |
| 1059 | let n = i.listeners; |
| 1060 | for (const a in n) |
| 1061 | n[a].removeEvent(t); |
| 1062 | const s = t.split(":"); |
| 1063 | if (n = i.listeners, s.length === 2) { |
| 1064 | const a = s[0], o = s[1]; |
| 1065 | n[a] && n[a].removeEvent(o); |
| 1066 | } |
| 1067 | } |
| 1068 | }, e.detachAllEvents = function() { |
| 1069 | for (const t in i.listeners) |
| 1070 | i.listeners[t].clear(); |
| 1071 | }; |
| 1072 | } |
no test coverage detected