Function.prototype.bind || (Function.prototype.bind = function(a) { var d = this; "function" !== typeof d && throwError("You must bind a function."); var c = Array.prototype.slice.call(arguments, 1) , b = function() { if (this instanceof b) { var e = function() {}; e.prototype = d.prototype; e = new e; var f = d.apply(e, c.concat(Array.prototype.slice.call(arguments))); return Object(f) === f ? f : e } return d.apply(a, c.concat(Array.prototype.slice.call(arguments))) }; return b } ); Array.isArray || (Array.isArray = function(a) { return "[object Array]" === Object.prototype.toString.call(a) } ); "function" !== typeof Object.freeze && (Object.freeze = function(a) {} ); function throwError(a) { a = Error(a); a.name = "XEngine ERROR"; throw a; } if (window.console) "function" !== typeof console.time && (console.time = function() {} ), "function" !== typeof console.timeEnd && (console.timeEnd = function() {} ); else var console = { log: function() {}, warn: function() {}, error: function() {}, time: function(a) {}, timeEnd: function(a) {} }; var DEM = { XE_INVALID_PARAM: "Invalid param." } , XE_EVENTS = { consts: { HOOK: "XE_EVENT_HOOK", READY: "XE_EVENT_READY", RUN: "XE_EVENT_RUN", DOM_READY: "XE_EVENT_DOM_READY" }, vars: { hook: null, ready: null, run: null, domready: null } } , xengine = { domainGUID: xe_config.GUID, domainKEY: xe_config.KEY } , xe_extlist = [] , xe_reslist = [] , xe_modlist = []; function requireExtRes() { var a = Array.prototype.slice.call(arguments) , d = xe_isset(a[0], "boolean") ? !0 : !1; d && (d = a[0], a.splice(0, 1)); var c = a[a.length - 1] , b = xe_isset(c, "boolean") ? !0 : !1; b && (b = c, a.splice(a.length - 1, 1)); c = []; d = d ? xe_reslist : xe_extlist; for (var e = 0; e < d.length; e++) c.push(d[e].name); if (a[0] && void 0 !== a[0] && null !== a[0]) for (b = !0, e = 0; e < a.length; e++) { var f = xe_isset(a[e], "string") ? -1 == a[e].indexOf(".js") ? a[e] + ".js" : a[e] : ""; b = b && "" != f ? c.indexOf(f.toLowerCase()) : -1; b = -1 < b && (1 == d[b].status || null == d[b].status) ? d[b].status : !1; if (!1 === b || null === b) break } else return b ? d : c; return b } function xe_extractResName(a) { a = xe_isset(a, "string") ? -1 < a.indexOf("?") ? a.split("?")[0] : a : !1; return !1 !== a ? a.substring(a.lastIndexOf("/") + 1).toLowerCase() : "" } function xe_extractResType(a) { return xe_isset(a, "string") ? a.split(".").pop().toLowerCase() : "" } function xepollStylesheet(a, d) { for (var c = xe_extractResName(a.getAttribute("href")), b = 0; b < document.styleSheets.length; b++) if (document.styleSheets[b].href && -1 < document.styleSheets[b].href.indexOf(c)) { for (b = 0; b < xe_reslist.length; b++) if (xe_reslist[b].name == c) { var e = xe_reslist[b]; e.status = !0; "function" === typeof d && d(e) } break } else b == document.styleSheets.length - 1 && setTimeout(function() { xepollStylesheet(a, d) }, 200); return !0 } function xeBuildSecureLink(a) { if (xe_core.vm && xe_isset(a, "string") && (-1 == a.indexOf("//") || -1 < a.indexOf("conectiva.io"))) { var d = xe_readCookie("xe_sl-hsh"); a = "" != d ? a + (-1 < a.indexOf("?") ? "&" : "?") + "hsh=" + d : a; d = xe_readCookie("xe_sl-exp"); a = "" != d ? a + "&exp=" + d : a } a = a + (a.indexOf("?") > -1 ? "&" : "?"); return a + "ts=" + xe_getCacheTS() } function xeLoadResource() { function a(a) { for (var b = f ? xe_extlist : g ? xe_modlist : xe_reslist, c = 0; c < b.length; c++) if (b[c].name == a) return c; return -1 } function d() { var b = this.readyState; if (!b || /ded|te/.test(b)) b = void 0 !== this.src ? this.src : this.href, r--, b = xe_extractResName(b), b = a(b), f ? xe_extlist[b].status = !0 : g ? xe_modlist[b].status = !0 : xe_reslist[b].status = !0, v && m(f ? xe_extlist[b] : g ? xe_modlist[b] : xe_reslist[b]), r || !f || xe_core.ready || xengine.ready() } function c() { var b = void 0 !== this.src ? this.src : this.href; r--; b = xe_extractResName(b); b = a(b); f ? xe_extlist[b].status = !1 : g ? xe_modlist[b].status = !1 : xe_reslist[b].status = !1; v && m(f ? xe_extlist[b] : g ? xe_modlist[b] : xe_reslist[b]) } var b = Array.prototype.slice.call(arguments) , e = xe_isset(b[0], "boolean") ? !0 : !1 , f = e && xe_isset(b[1], "boolean") && !0 === b[1] ? !0 : !1 , g = e && !f && xe_isset(b[2], "boolean") && !0 === b[2] ? !0 : !1; e && (e = b[0], b.splice(0, 1)); f && (e = !0, b.splice(0, 1)); g && (e = !0, b.splice(0, 2)); var r = b.length , m = b[r - 1] , v = m.call; v && r--; for (var p, l, h, n, x, y, u, w, k = 0; k < r; k++) { u = w = !1; (p = f || !0 !== Array.isArray(b[k]) ? !1 : !0) ? (n = 0, y = e, e = xe_isset(b[k][0], "boolean") ? b[k][0] : -1, n = -1 == e ? n : n + 1, h = b[k][n], u = xe_isset(b[k][n + 1], "boolean") ? b[k][n + 1] : !1, n++, w = xe_isset(b[k][n + 1], "boolean") ? b[k][n + 1] : !1, u = u && !w ? !0 : !1, e = -1 == e ? y : e) : h = b[k]; if (f && -1 == h.indexOf("/")) h = "extensions/" + h + "/" + h + ".js"; else if (g) if (-1 < h.indexOf("%extmod%")) for (h = h.replace("%extmod%", ""), p = h.split("_"), h = "extensions/", k = 0; k < p.length; k++) h = 0 == k ? h + p[k] + "/modules/" : k == p.length - 1 ? h + p[k] + ".js" : h + p[k] + "/"; else h = "DGUID/" + (xe_config.crossDomain ? xe_config.crossDomain.DGUID : xengine.domainGUID) + xengine.layer.relpath + "modules/" + h + ".js"; var t = ""; -1 < h.indexOf(",") && (t = h.split(",charset="), h = t[0], t = t[1]); n = xe_extractResName(h); x = xe_extractResType(n); var q = {}; q.idx = k; q.name = n; q.type = x; q.status = null; f ? xe_extlist.push(q) : g ? xe_modlist.push(q) : xe_reslist.push(q); h = xeBuildSecureLink(h); switch (x) { case "js": l = document.createElement("script"); l.type = "text/javascript"; "" != t && (l.charset = t); l.async = !e; u && (l.defer = "defer"); l.src = f || g ? xe_config.path + "/" + h : h; l.onload = l.onreadystatechange = d; l.onerror = c; break; case "css": l = document.createElement("link"), l.setAttribute("rel", "stylesheet"), l.setAttribute("type", "text/css"), l.setAttribute("href", h), xepollStylesheet(l, v ? m : null) } e = p ? y : e; w ? (document.body || document.getElementsByTagName("script")[0]).appendChild(l) : (document.head || document.getElementsByTagName("head")[0]).appendChild(l) } return !0 } xe_include = function() { var a = Array.prototype.slice.call(arguments) , d = xe_isset(a[0], "number") ? a[0] : !1; !1 !== d && a.splice(0, 1); var c = xe_isset(a[0], "boolean") ? 1 : 0; if (Array.isArray(a[c])) { var b = a[c]; a.splice(c, 1); a = a.concat(b) } if (!1 !== d) for (c = 0; c < a.length; c++) b = c == a.length - 1 && a[c].call ? !0 : !1, xe_isset(a[c], "string") && !(-1 < a[c].indexOf("/")) && -1 != a[c].indexOf("_") || b ? 2 != d || b || (a[c] = "%extmod%" + a[c]) : a.splice(c, 1); if (0 == a.length) return !1; !1 !== d && (a = [!0, !1, !0].concat(a)); return xeLoadResource.apply(this, a) } ; xe_loadModule = function() { var a = Array.prototype.slice.call(arguments); if (0 == a.length) return !1; var d = xe_isset(a[0], "boolean") && !0 === a[0] ? 2 : 1; 2 == d && a.splice(0, 1); a = [d].concat(a); return xe_include.apply(this, a) } ; xe_loadExtension = function() { var a = Array.prototype.slice.call(arguments) , d = a.length; a[d - 1].call && d--; for (var c = !1; d--; ) requireExtRes(!1, a[d]) ? a.splice(d, 1) : c = c || -1 < a[d].indexOf("proc.js") ? !0 : c; c || xe_config.avoidProc || (a = ["DGUID/" + (xe_config.crossDomain ? xe_config.crossDomain.DGUID : xengine.domainGUID) + xengine.layer.relpath + "proc.js"].concat(a), xe_config.avoidProc = !0); a = [!0, !0].concat(a); xeLoadResource.apply(this, a) } ; function xe_crossDomain() { var d = Array.prototype.slice.call(arguments); if (xe_isset(d[0], "string")) return true; function a() { if (xe_isset(d[0], "boolean")) { if (d[0] && xe_isset(d[1], "string")) { xe_config.crossDomain = {DGUID: d[1]}; xe_include(xe_config.path + '/DGUID/' + d[1] + '/load.js'); } else { xe_core.vm && console.error('ActiveAPI Cross Domain failed!'); } } else { xe_config.crossDomain = true; xe_loadExtension('actapi_crossdm'); } } xe_config.avoidProc = !0; a() } (function(a) { var d = function(b, a, c, g) { this.prop = b; this.value = a; this.cl = c; this.singleton = g || !1 } , c = function(b, c) { var e = a.getConstructorParams(c); a: { for (var g = e.length; g--; ) if (e[g] === b) { e = !0; break a } e = !1 } e && throwError("xe_VCIL") }; a.Control = function() { this.mappings = {}; this.parent = null } ; a.getConstructorParams = function(b) { function a(b, a, c) { g.push(c) } var c = /^\s*(_?)(\S+?)\1\s*$/ , g = []; if (b.hasOwnProperty("inject") && "[object Array]" === toString.call(b.inject) && 0 < b.inject.length) var d = b.inject; b = b.toString().replace(/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg, "").match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1].split(/,/); for (var m = 0; m < b.length; m++) (d && d[m] ? d[m] : b[m]).replace(c, a); return g } ; a.Control.prototype = { getVirtualMapping: function(b) { return this.mappings ? this.mappings[b] ? this.mappings[b] : this.parent ? this.parent.getVirtualMapping(b) : null : null }, mapValue: function(b, a) { this.mappings[b] && throwError("xe_MV - property: " + b); !xe_isset(b, "string") && throwError("xe_VP"); !xe_isset(a) && throwError("xe_VV - property: " + b); this.mappings[b] = new d(b,a,void 0,void 0); return this }, removeMapping: function(b) { this.mappings[b] = null; delete this.mappings[b]; return this }, instantiate: function(b) { "function" !== typeof b && throwError("xe_I"); for (var c = [null], f = a.getConstructorParams(b), g = 0; g < f.length; g++) if (xe_isset(arguments[g + 1])) c.push(arguments[g + 1]); else { var d = f[g] , m = this.getVirtualMapping(d); m ? (d = this.getInjectedValue(m, d), c.push(d)) : c.push(void 0) } return new (Function.prototype.bind.apply(b, c)) }, inject: function(b, a) { this.parent && this.parent.inject(b, !0); for (var c in this.mappings) if (this.mappings.hasOwnProperty(c)) { var e = this.getVirtualMapping(c); if (b.hasOwnProperty(e.prop) || b.constructor && b.constructor.prototype && b.constructor.prototype.hasOwnProperty(e.prop)) b[c] = this.getInjectedValue(e, c) } "function" !== typeof b.postConstruct || a || b.postConstruct(); return this }, getInjectedValue: function(b, a) { var e = b.value; if (b.cl) if (b.singleton) { if (!b.value) { c(a, b.cl); b.value = this.instantiate(b.cl); var d = b.value } e = b.value } else c(a, b.cl), d = e = this.instantiate(b.cl); d && (d.hasOwnProperty(a) && throwError("xe_VPIL"), this.inject(d)); return e }, createInstance: function() { var a = this.instantiate.apply(this, arguments); this.inject(a); return a }, dispose: function() { this.mappings = {} } } } )(this.reversal = this.reversal || {}); (function(a) { a.events_list = []; a.cloned_events_list = []; a.svcs_list = []; a.uuids_list = []; a.genUUID = function() { var a = (new Date).getTime(); window.performance && "function" === typeof window.performance.now && (a += performance.now()); return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(b) { var c = (a + 16 * Math.random()) % 16 | 0; a = Math.floor(a / 16); return ("x" == b ? c : c & 3 | 8).toString(16) }) } ; a.eventIndex = function(c, b) { var e, f, d = !0 === b ? a.cloned_events_list : a.events_list; for (e = 0; e < d.length; e++) if (f = d[e].eventName === c) return e; return -1 } ; a.serviceExists = function(c) { return xe_isset(a.svcs_list[c]) ? !0 : !1 } ; a.Event = function(c, b, e, f) { f = void 0 !== f ? f : !0; var d = a.eventIndex(c, !1); if (-1 < d) { console.error("XEngine ERROR: Event with Name " + c + " already exists!"); e = a.events_list[d]; if (!0 === e["private"]) return null; d = a.eventIndex(c, !0); return -1 < d ? a.cloned_events_list[d] : e.clone() } e = a.Event.createGenericEvent(c, e, !1); xe_isset(b) && (e.params = b); e.isCloned = !1; e.clone = this.clone.bind(e); e.isDefaultPrevented = this.isDefaultPrevented; e.preventDefault = this.preventDefault.bind(e); e["private"] = !f; return e } ; a.Event.prototype.clone = function() { var c = a.Event.createGenericEvent(this.eventName, this.bubbles, !0); c.params = this.params; c.isCloned = !0; c.clone = this.clone; c.DefaultPrevented = this.DefaultPrevented; a.cloned_events_list.push(c); return c } ; a.Event.prototype.preventDefault = function() { this.defaultPrevented = !0; return this } ; a.Event.prototype.isDefaultPrevented = function() { return this.defaultPrevented } ; a.Event.createGenericEvent = function(c, b, e) { c = new d(c,!(void 0 !== b && !b)); e || (a.events_list.push(c), a.uuids_list[c.eventName] = a.genUUID(), document.addEventListener ? Object.defineProperty(c, "uuid", { value: a.uuids_list[c.eventName], enumerable: !1, configurable: !1, writable: !1 }) : c.uuid = a.uuids_list[c.eventName]); return c } ; a.Event.prototype.toString = function() { return "[__xe.Event]" } ; var d = function(a, b) { this.eventName = a; this.bubbles = !!b; this.defaultPrevented = !1; this.target = this.currentTarget = null; this.uuid = ""; this["private"] = !1 }; a.Core = function() { this.event_targets = []; (this.vm = xe_core.vm) && (this[this.vm] = !0); this.level = xe_core.level; this.sandbox = xe_core.sandbox ? !0 : !1; this.stage = xe_core.stage ? !0 : !1; this.subdomain = xe_core.subdomain ? !0 : !1; this.relpath = this.vm ? "/workspaces/" + this.vm + "/" : "/"; var a = "XEngine is running" + (this.vm ? ' at workspace "' + this.vm + '"' : ""); a = 0 < this.level ? a + ' under debug level "' + this.level + '"' : a; "" != a && this.vm && console.log(a); this.ready = !1 } ; a.Core.prototype.requireExtension = function() { var a = Array.prototype.slice.call(arguments); a = [!1].concat(a); return requireExtRes.apply(this, a) } ; a.Core.prototype.requireResource = function() { var a = Array.prototype.slice.call(arguments); if (Array.isArray(a[0])) { var b = a[0]; a.splice(0, 1); a = a.concat(b) } a = [!0].concat(a); return requireExtRes.apply(this, a) } ; a.Core.prototype.hookEvent = function(c, b, e) { this.event_targets && c && b || throwError("@hookEvent: " + DEM.XE_INVALID_PARAM); if ("string" === typeof c) { var d = a.eventIndex(c, !1); d = -1 < d ? a.events_list[d] : null; if (null === d || !0 === d["private"]) return console.error('XEngine @hookEvent: Event "' + c + (null === d ? "\" doesn't exists." : "\" is private and can't be accessed this way.")), !1 } if ("undefined" !== typeof c.eventName) { d = a.eventIndex(c.eventName, !1); d = -1 < d ? a.events_list[d] : null; if (null === d || !0 === d["private"] && d.uuid !== c.uuid) return console.error('XEngine @hookEvent: Event "' + c + (null === d ? "\" doesn't exists." : '" is private.')), !1; c = c.eventName } isNaN(e) && (e = 0); for (d = 0; d < this.event_targets.length; d++) { var g = this.event_targets[d]; if (g.eventName === c && g.callback === b) return } this.event_targets.push({ eventName: c, callback: b, priority: e, scope: this }); return !0 } ; a.Core.prototype.unhookEvent = function(a, b) { this.event_targets && a && b || throwError("@unhookEvent: " + DEM.XE_INVALID_PARAM); for (var c = this.event_targets.length; 0 < c--; ) { var d = this.event_targets[c]; d.eventName === a && d.callback === b && this.event_targets.splice(c, 1) } } ; a.Core.prototype.eventHooks = function(a) { if (!this.event_targets || !a) return !1; for (var b, c = 0, d = this.event_targets.length; b < d; ++b) this.event_targets[b].eventName === a && c++; return 0 < c ? c : !1 } ; a.Core.prototype.fireEvent = function(c, b) { this.event_targets && c || throwError("@fireEvent: " + DEM.XE_INVALID_PARAM); if ("string" === typeof c) { var d = a.eventIndex(c, !1); d = -1 < d ? a.events_list[d] : null; if (null === d) return console.error("XEngine @fireEvent: Event " + c + " does not exist... not fired!"), !1; if (!0 === d["private"]) return !1; c = d } d = []; var f; for (f = 0; f < this.event_targets.length; f++) { var g = this.event_targets[f]; g.eventName === c.eventName && d.push(g) } d.sort(function(a, b) { return b.priority - a.priority }); for (f = 0; f < d.length && (d[f].callback.apply(c.srcElement ? c.srcElement : c.currentTarget, [xe_isset(b) ? b : null]), !c.isDefaultPrevented() || c.bubbles); f++) ; return !c.isDefaultPrevented() } ; a.Core.prototype.createEvent = function(c, b, d, f) { this.event_targets && c && "" !== c || throwError("@createEvent: " + DEM.XE_INVALID_PARAM); return c = new a.Event(c,b,d,f) } ; a.Core.prototype.createService = function(c, b) { "string" === typeof c && "function" === typeof b || throwError("@createService: " + DEM.XE_INVALID_PARAM); if (a.serviceExists(c)) return console.error('XEngine @createService: A service with name "' + c + '" already exists!'), !1; a.svcs_list[c] = b; return a.serviceExists(c) } ; a.Core.prototype.callService = function(c) { c && "" !== c || throwError("@callService: " + DEM.XE_INVALID_PARAM); if (a.serviceExists(c)) { var b = Array.prototype.slice.call(arguments, 1); return a.svcs_list[c].apply(this, b) } return !1 } ; a.Core.prototype.dispose = function() { this.event_targets = null } ; a.Core.prototype.toString = function() { return "[__xe.Core]" } } )(this.__xe = this.__xe || {}); (function(a, d) { a.version = "1.4.0"; a.applyProperties = function(a, b, d, f) { if ("[object Array]" === Object.prototype.toString.apply(f)) for (var c = 0, e = f.length; c < e; c++) { if (void 0 === a[f[c]] || null === a[f[c]]) a[f[c]] = d && "function" === typeof b[f[c]] ? b[f[c]].bind(b) : b[f[c]] } else for (c in b) a[c] = d && "function" === typeof b[c] ? b[c].bind(b) : b[c] } ; a.inherit = function(c, b) { var d = b && b.hasOwnProperty("constructor") ? b.constructor : function() { return c.apply(this, arguments) } ; var f = function() {}; f.prototype = c.prototype; d.prototype = new f; b && a.applyProperties(d.prototype, b); d.prototype.constructor = d; d.parent = c.prototype; d.extend = function(b) { return a.inherit(d, b) } ; return d } ; a.extend = function(c) { return a.inherit(function() {}, c) } ; a.Framework = a.extend({ constructor: function() { this.instantiator = new d.Control(this.layer); this.layer = new a.Core; this.version = a.version; this.domainGUID = xe_config.GUID; this.domainKEY = xe_config.KEY; this.instantiator.mapValue("instantiator", this.instantiator); this.instantiator.mapValue("instance", this); this.instantiator.mapValue("layer", this.layer); this.init() }, init: function() {}, ready: function() {}, dispose: function() { this.instantiator && (this.instantiator.removeMapping("instantiator"), this.instantiator.removeMapping("layer"), this.instantiator.removeMapping("instance")); this.instantiator && this.instantiator.dispose(); this.layer && this.layer.dispose(); this.instance = this.layer = this.instantiator = void 0 } }); window.__xe = a } )(this.__xe = this.__xe || {}, this.reversal); window.xe_coreLoaded = 1;