Mini Kabibi Habibi
/**
* ADOBE CONFIDENTIAL
* _________________
* Copyright 2016 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Adobe Systems Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Adobe Systems Incorporated and its
* suppliers and are protected by all applicable intellectual property
* laws, including trade secret and copyright laws.
* Dissemination of this information or reproduction of this material
* is strictly forbidden unless prior written permission is obtained
* from Adobe Systems Incorporated.
*/
function CSXSWindowType() {}
function Version(major, minor, micro, special) {
this.major = major, this.minor = minor, this.micro = micro, this.special = special;
}
function VersionBound(version, inclusive) {
this.version = version, this.inclusive = inclusive;
}
function VersionRange(lowerBound, upperBound) {
this.lowerBound = lowerBound, this.upperBound = upperBound;
}
function Runtime(name, versionRange) {
this.name = name, this.versionRange = versionRange;
}
function Extension(id, name, mainPath, basePath, windowType, width, height, minWidth, minHeight, maxWidth, maxHeight, defaultExtensionDataXml, specialExtensionDataXml, requiredRuntimeList, isAutoVisible, isPluginExtension) {
this.id = id, this.name = name, this.mainPath = mainPath, this.basePath = basePath,
this.windowType = windowType, this.width = width, this.height = height, this.minWidth = minWidth,
this.minHeight = minHeight, this.maxWidth = maxWidth, this.maxHeight = maxHeight,
this.defaultExtensionDataXml = defaultExtensionDataXml, this.specialExtensionDataXml = specialExtensionDataXml,
this.requiredRuntimeList = requiredRuntimeList, this.isAutoVisible = isAutoVisible,
this.isPluginExtension = isPluginExtension;
}
function CSEvent(type, scope, appId, extensionId) {
this.type = type, this.scope = scope, this.appId = appId, this.extensionId = extensionId;
}
function SystemPath() {}
function ColorType() {}
function RGBColor(red, green, blue, alpha) {
this.red = red, this.green = green, this.blue = blue, this.alpha = alpha;
}
function Direction(x, y) {
this.x = x, this.y = y;
}
function GradientStop(offset, rgbColor) {
this.offset = offset, this.rgbColor = rgbColor;
}
function GradientColor(type, direction, numStops, arrGradientStop) {
this.type = type, this.direction = direction, this.numStops = numStops, this.arrGradientStop = arrGradientStop;
}
function UIColor(type, antialiasLevel, color) {
this.type = type, this.antialiasLevel = antialiasLevel, this.color = color;
}
function AppSkinInfo(baseFontFamily, baseFontSize, appBarBackgroundColor, panelBackgroundColor, appBarBackgroundColorSRGB, panelBackgroundColorSRGB, systemHighlightColor) {
this.baseFontFamily = baseFontFamily, this.baseFontSize = baseFontSize, this.appBarBackgroundColor = appBarBackgroundColor,
this.panelBackgroundColor = panelBackgroundColor, this.appBarBackgroundColorSRGB = appBarBackgroundColorSRGB,
this.panelBackgroundColorSRGB = panelBackgroundColorSRGB, this.systemHighlightColor = systemHighlightColor;
}
function HostEnvironment(appName, appVersion, appLocale, appUILocale, appId, isAppOnline, appSkinInfo) {
this.appName = appName, this.appVersion = appVersion, this.appLocale = appLocale,
this.appUILocale = appUILocale, this.appId = appId, this.isAppOnline = isAppOnline,
this.appSkinInfo = appSkinInfo;
}
function HostCapabilities(EXTENDED_PANEL_MENU, EXTENDED_PANEL_ICONS, DELEGATE_APE_ENGINE, SUPPORT_HTML_EXTENSIONS, DISABLE_FLASH_EXTENSIONS) {
this.EXTENDED_PANEL_MENU = EXTENDED_PANEL_MENU, this.EXTENDED_PANEL_ICONS = EXTENDED_PANEL_ICONS,
this.DELEGATE_APE_ENGINE = DELEGATE_APE_ENGINE, this.SUPPORT_HTML_EXTENSIONS = SUPPORT_HTML_EXTENSIONS,
this.DISABLE_FLASH_EXTENSIONS = DISABLE_FLASH_EXTENSIONS;
}
function ApiVersion(major, minor, micro) {
this.major = major, this.minor = minor, this.micro = micro;
}
function MenuItemStatus(menuItemLabel, enabled, checked) {
this.menuItemLabel = menuItemLabel, this.enabled = enabled, this.checked = checked;
}
function ContextMenuItemStatus(menuItemID, enabled, checked) {
this.menuItemID = menuItemID, this.enabled = enabled, this.checked = checked;
}
function CSInterface() {}
function AAMStatus(status, callerId, payload) {
this.status = status, this.callerId = callerId, this.payload = payload;
}
function IMSInterface() {}
function Vulcan() {}
function VulcanMessage(type, appId, appVersion) {
this.type = type, this.scope = VulcanMessage.SCOPE_SUITE, this.appId = requiredParamsValid(appId) ? appId : VulcanMessage.DEFAULT_APP_ID,
this.appVersion = requiredParamsValid(appVersion) ? appVersion : VulcanMessage.DEFAULT_APP_VERSION,
this.data = VulcanMessage.DEFAULT_DATA;
}
function GetValueByKey(xmlStr, key) {
if (window.DOMParser) {
var parser = new window.DOMParser();
try {
var xmlDoc = parser.parseFromString(xmlStr, "text/xml"), node = xmlDoc.getElementsByTagName(key)[0];
if (node && node.childNodes[0]) return node.childNodes[0].nodeValue;
} catch (e) {}
}
return "";
}
function requiredParamsValid() {
for (var i = 0; i < arguments.length; i++) {
var argument = arguments[i];
if (void 0 === argument || null === argument) return !1;
}
return !0;
}
function strStartsWith(str, prefix) {
return "string" == typeof str && 0 === str.indexOf(prefix);
}
CSXSWindowType._PANEL = "Panel", CSXSWindowType._MODELESS = "Modeless", CSXSWindowType._MODAL_DIALOG = "ModalDialog",
EvalScript_ErrMessage = "EvalScript error.", Version.MAX_NUM = 999999999, CSEvent.prototype.data = "",
SystemPath.USER_DATA = "userData", SystemPath.COMMON_FILES = "commonFiles", SystemPath.MY_DOCUMENTS = "myDocuments",
SystemPath.APPLICATION = "application", SystemPath.EXTENSION = "extension", SystemPath.HOST_APPLICATION = "hostApplication",
ColorType.RGB = "rgb", ColorType.GRADIENT = "gradient", ColorType.NONE = "none",
CSInterface.THEME_COLOR_CHANGED_EVENT = "com.adobe.csxs.events.ThemeColorChanged",
CSInterface.prototype.hostEnvironment = window.__adobe_cep__ ? JSON.parse(window.__adobe_cep__.getHostEnvironment()) : null,
CSInterface.prototype.getHostEnvironment = function() {
return this.hostEnvironment = JSON.parse(window.__adobe_cep__.getHostEnvironment()),
this.hostEnvironment;
}, CSInterface.prototype.closeExtension = function() {
window.__adobe_cep__.closeExtension();
}, CSInterface.prototype.getSystemPath = function(pathType) {
var path = decodeURI(window.__adobe_cep__.getSystemPath(pathType)), OSVersion = this.getOSInformation();
return OSVersion.indexOf("Windows") >= 0 ? path = path.replace("file:///", "") : OSVersion.indexOf("Mac") >= 0 && (path = path.replace("file://", "")),
path;
}, CSInterface.prototype.evalScript = function(script, callback) {
null !== callback && void 0 !== callback || (callback = function(result) {}), window.__adobe_cep__.evalScript(script, callback);
}, CSInterface.prototype.getApplicationID = function() {
var appId = this.hostEnvironment.appId;
return appId;
}, CSInterface.prototype.getHostCapabilities = function() {
var hostCapabilities = JSON.parse(window.__adobe_cep__.getHostCapabilities());
return hostCapabilities;
}, CSInterface.prototype.dispatchEvent = function(event) {
"object" == typeof event.data && (event.data = JSON.stringify(event.data)), window.__adobe_cep__.dispatchEvent(event);
}, CSInterface.prototype.addEventListener = function(type, listener, obj) {
window.__adobe_cep__.addEventListener(type, listener, obj);
}, CSInterface.prototype.removeEventListener = function(type, listener, obj) {
window.__adobe_cep__.removeEventListener(type, listener, obj);
}, CSInterface.prototype.requestOpenExtension = function(extensionId, params) {
window.__adobe_cep__.requestOpenExtension(extensionId, params);
}, CSInterface.prototype.getExtensions = function(extensionIds) {
var extensionIdsStr = JSON.stringify(extensionIds), extensionsStr = window.__adobe_cep__.getExtensions(extensionIdsStr), extensions = JSON.parse(extensionsStr);
return extensions;
}, CSInterface.prototype.getNetworkPreferences = function() {
var result = window.__adobe_cep__.getNetworkPreferences(), networkPre = JSON.parse(result);
return networkPre;
}, CSInterface.prototype.initResourceBundle = function() {
for (var resourceBundle = JSON.parse(window.__adobe_cep__.initResourceBundle()), resElms = document.querySelectorAll("[data-locale]"), n = 0; n < resElms.length; n++) {
var resEl = resElms[n], resKey = resEl.getAttribute("data-locale");
if (resKey) for (var key in resourceBundle) if (0 === key.indexOf(resKey)) {
var resValue = resourceBundle[key];
if (key.length == resKey.length) resEl.innerHTML = resValue; else if ("." == key.charAt(resKey.length)) {
var attrKey = key.substring(resKey.length + 1);
resEl[attrKey] = resValue;
}
}
}
return resourceBundle;
}, CSInterface.prototype.dumpInstallationInfo = function() {
return window.__adobe_cep__.dumpInstallationInfo();
}, CSInterface.prototype.getOSInformation = function() {
var userAgent = navigator.userAgent;
if ("Win32" == navigator.platform || "Windows" == navigator.platform) {
var winVersion = "Windows", winBit = "";
return userAgent.indexOf("Windows") > -1 && (userAgent.indexOf("Windows NT 5.0") > -1 ? winVersion = "Windows 2000" : userAgent.indexOf("Windows NT 5.1") > -1 ? winVersion = "Windows XP" : userAgent.indexOf("Windows NT 5.2") > -1 ? winVersion = "Windows Server 2003" : userAgent.indexOf("Windows NT 6.0") > -1 ? winVersion = "Windows Vista" : userAgent.indexOf("Windows NT 6.1") > -1 ? winVersion = "Windows 7" : userAgent.indexOf("Windows NT 6.2") > -1 ? winVersion = "Windows 8" : userAgent.indexOf("Windows NT 6.3") > -1 ? winVersion = "Windows 8.1" : userAgent.indexOf("Windows NT 10") > -1 && (winVersion = "Windows 10"),
winBit = userAgent.indexOf("WOW64") > -1 || userAgent.indexOf("Win64") > -1 ? " 64-bit" : " 32-bit"),
winVersion + winBit;
}
if ("MacIntel" == navigator.platform || "Macintosh" == navigator.platform) {
var result = "Mac OS X";
return userAgent.indexOf("Mac OS X") > -1 && (result = userAgent.substring(userAgent.indexOf("Mac OS X"), userAgent.indexOf(")")),
result = result.replace(/_/g, ".")), result;
}
return "Unknown Operation System";
}, CSInterface.prototype.openURLInDefaultBrowser = function(url) {
return cep.util.openURLInDefaultBrowser(url);
}, CSInterface.prototype.getExtensionID = function() {
return window.__adobe_cep__.getExtensionId();
}, CSInterface.prototype.getScaleFactor = function() {
return window.__adobe_cep__.getScaleFactor();
}, CSInterface.prototype.setScaleFactorChangedHandler = function(handler) {
window.__adobe_cep__.setScaleFactorChangedHandler(handler);
}, CSInterface.prototype.getCurrentApiVersion = function() {
var apiVersion = JSON.parse(window.__adobe_cep__.getCurrentApiVersion());
return apiVersion;
}, CSInterface.prototype.setPanelFlyoutMenu = function(menu) {
"string" == typeof menu && window.__adobe_cep__.invokeSync("setPanelFlyoutMenu", menu);
}, CSInterface.prototype.updatePanelMenuItem = function(menuItemLabel, enabled, checked) {
var ret = !1;
if (this.getHostCapabilities().EXTENDED_PANEL_MENU) {
var itemStatus = new MenuItemStatus(menuItemLabel, enabled, checked);
ret = window.__adobe_cep__.invokeSync("updatePanelMenuItem", JSON.stringify(itemStatus));
}
return ret;
}, CSInterface.prototype.setContextMenu = function(menu, callback) {
"string" == typeof menu && window.__adobe_cep__.invokeAsync("setContextMenu", menu, callback);
}, CSInterface.prototype.setContextMenuByJSON = function(menu, callback) {
"string" == typeof menu && window.__adobe_cep__.invokeAsync("setContextMenuByJSON", menu, callback);
}, CSInterface.prototype.updateContextMenuItem = function(menuItemID, enabled, checked) {
var itemStatus = new ContextMenuItemStatus(menuItemID, enabled, checked);
ret = window.__adobe_cep__.invokeSync("updateContextMenuItem", JSON.stringify(itemStatus));
}, CSInterface.prototype.isWindowVisible = function() {
return window.__adobe_cep__.invokeSync("isWindowVisible", "");
}, CSInterface.prototype.resizeContent = function(width, height) {
window.__adobe_cep__.resizeContent(width, height);
}, CSInterface.prototype.registerInvalidCertificateCallback = function(callback) {
return window.__adobe_cep__.registerInvalidCertificateCallback(callback);
}, CSInterface.prototype.registerKeyEventsInterest = function(keyEventsInterest) {
return window.__adobe_cep__.registerKeyEventsInterest(keyEventsInterest);
}, CSInterface.prototype.setWindowTitle = function(title) {
window.__adobe_cep__.invokeSync("setWindowTitle", title);
}, CSInterface.prototype.getWindowTitle = function() {
return window.__adobe_cep__.invokeSync("getWindowTitle", "");
}, IMSInterface.prototype.addEventListener = function(type, listener) {
window.__adobe_cep__.addEventListener(type, listener);
}, IMSInterface.prototype.removeEventListener = function(type, listener) {
window.__adobe_cep__.removeEventListener(type, listener);
}, IMSInterface.prototype.imsConnect = function() {
var imsRef = window.__adobe_cep__.imsConnect();
return imsRef;
}, IMSInterface.prototype.imsDisconnect = function(imsRef) {
window.__adobe_cep__.imsDisconnect(imsRef);
}, IMSInterface.prototype.imsFetchAccounts = function(imsRef, clientId) {
var accounts = window.__adobe_cep__.imsFetchAccounts(imsRef, clientId);
return accounts;
}, IMSInterface.prototype.imsFetchAccessToken = function(imsRef, clientId, clientSecret, userAccountGuid, serviceAccountGuid, scope) {
return window.__adobe_cep__.imsFetchAccessToken(imsRef, clientId, clientSecret, userAccountGuid, serviceAccountGuid, scope);
}, IMSInterface.prototype.imsRevokeDeviceToken = function(imsRef, clientId, clientSecret, userAccountGuid, serviceAccountGuid) {
return window.__adobe_cep__.imsFetchAccessToken(imsRef, clientId, clientSecret, userAccountGuid, serviceAccountGuid, "REVOKE");
}, IMSInterface.prototype.imsSetProxyCredentials = function(proxyUsername, proxyPassword) {
window.__adobe_cep__.imsSetProxyCredentials(proxyUsername, proxyPassword);
}, IMSInterface.prototype.showAAM = function(clientId, clientSecret, redirectUri, userAccountGuid, serviceAccountGuid, scope) {
return window.__adobe_cep__.showAAM(clientId, clientSecret, redirectUri, userAccountGuid, serviceAccountGuid, scope);
}, IMSInterface.prototype.imsGetCurrentUserId = function() {
var userId = window.__adobe_cep__.getCurrentImsUserId();
return userId;
}, IMSInterface.prototype.imsGetCurrentUserIdHelper = function(callback) {
var hostEnvironment = JSON.parse(window.__adobe_cep__.getHostEnvironment()), appName = hostEnvironment.appName;
if ("ILST" === appName) window.__adobe_cep__.evalScript("app.userGUID", function(result) {
callback(result);
}); else if ("IDSN" === appName) window.__adobe_cep__.evalScript("app.userGuid", function(result) {
callback(result);
}); else if ("PHSP" === appName || "PHXS" === appName) window.__adobe_cep__.evalScript("var getUserIdPhotoshop = function() {var userId = '';try {var bhnc = app.charIDToTypeID('bhnc');var ref = new ActionReference();ref.putProperty(app.charIDToTypeID('Prpr'), bhnc);ref.putEnumerated(app.charIDToTypeID('capp'), app.charIDToTypeID('Ordn'), app.charIDToTypeID('Trgt'));var appDesc = app.executeActionGet(ref);if (appDesc.hasKey(bhnc)) {userId = appDesc.getString(bhnc);}} catch (e) {}return userId;};", function(result) {
window.__adobe_cep__.evalScript("getUserIdPhotoshop()", function(result2) {
callback(result2);
});
}); else {
var userId = window.__adobe_cep__.getCurrentImsUserId();
callback(userId);
}
}, IMSInterface.prototype.imsConnectWithEndpoint = function(imsEndpoint) {
var params = {};
return params.imsEndpoint = void 0 === imsEndpoint || null === imsEndpoint || "" === imsEndpoint ? "undefined" : imsEndpoint,
JSON.parse(window.__adobe_cep__.invokeSync("imsConnectWithEndpoint", JSON.stringify(params))).result;
}, IMSInterface.prototype.imsFetchContinueToken = function(imsRef, bearerToken, targetClientId, redirectUri, scope, responseType, locale) {
void 0 !== redirectUri && null !== redirectUri || (redirectUri = ""), void 0 !== scope && null !== scope || (scope = ""),
void 0 !== responseType && null !== responseType || (responseType = ""), void 0 !== locale && null !== locale || (locale = "");
var params = {};
return params.imsRef = imsRef, params.bearerToken = bearerToken, params.targetClientId = targetClientId,
params.redirectUri = redirectUri, params.scope = scope, params.responseType = responseType,
params.locale = locale, JSON.parse(window.__adobe_cep__.invokeSync("imsFetchContinueToken", JSON.stringify(params))).result;
}, IMSInterface.prototype.imsLogoutUser = function(imsRef, userAccountGuid, clientId) {
var params = {};
return params.imsRef = imsRef, params.userAccountGuid = userAccountGuid, params.clientId = clientId,
JSON.parse(window.__adobe_cep__.invokeSync("imsLogoutUser", JSON.stringify(params))).result;
}, IMSInterface.prototype.imsFetchUserProfileData = function(imsRef, userAccountGuid) {
var params = {};
return params.imsRef = imsRef, params.userAccountGuid = userAccountGuid, window.__adobe_cep__.invokeSync("imsFetchUserProfileData", JSON.stringify(params));
}, IMSInterface.prototype.imsAttemptSSOJumpWorkflows = function(openBrowser, url, imsRef, clientID, clientSecret, scope, userAccountGuid, targetClientId, targetScope, targetResponseType, targetLocale) {
openBrowser || (openBrowser = !1), void 0 !== clientID && null !== clientID || (clientID = ""),
void 0 !== clientSecret && null !== clientSecret || (clientSecret = ""), void 0 !== scope && null !== scope || (scope = ""),
void 0 !== targetClientId && null !== targetClientId || (targetClientId = ""), void 0 !== targetScope && null !== targetScope || (targetScope = ""),
void 0 !== targetResponseType && null !== targetResponseType || (targetResponseType = ""),
void 0 !== imsRef && null !== imsRef || (imsRef = ""), void 0 !== userAccountGuid && null !== userAccountGuid || (userAccountGuid = "");
var params = {};
return params.imsRef = imsRef, params.openBrowser = openBrowser, params.url = url,
params.clientId = clientID, params.clientSecret = clientSecret, params.scope = scope,
params.userAccountGuid = userAccountGuid, params.targetClientId = targetClientId,
params.targetScope = targetScope, params.targetResponseType = targetResponseType,
params.targetLocale = targetLocale, JSON.parse(window.__adobe_cep__.invokeSync("imsAttemptSSOJumpWorkflows", JSON.stringify(params))).result;
}, IMSInterface.events = {
imsFetchAccessTokenWithStatus: "com.adobe.csxs.events.internal.ims.FetchAccessTokenWithStatus",
imsFetchAccessToken: "com.adobe.csxs.events.internal.ims.FetchAccessToken",
imsRevokeAccessToken: "com.adobe.csxs.events.internal.ims.FetchAccessTokenWithStatus",
imsFetchContinueToken: "com.adobe.csxs.events.internal.ims.FetchAccessTokenWithStatus",
imsAAMIMSStatus: "vulcan.SuiteMessage.com.adobe.aam.AAMIMSStatus",
imsLogoutUser: "com.adobe.csxs.events.internal.ims.LogoutUser",
imsSSOStatus: "com.adobe.csxs.events.internal.ims.SSOStatus"
}, IMSInterface.status = {
IMS_SUCCESS: "0",
IMS_ERROR_FAILURE: "1",
IMS_ERROR_INVALID_ARGUMENTS: "2",
IMS_ERROR_CANCEL: "20",
IMS_ERROR_TIMEOUT: "21",
IMS_ERROR_HTTPFAILURE: "22",
IMS_ERROR_SSLFAILURE: "23",
IMS_ERROR_AUTH_PROXY_REQUIRED: "24",
IMS_ERROR_AUTH_PROXY_FAILED: "25",
IMS_ERROR_IN_ACCESS_IDP: "26",
IMS_ERROR_ANOTHER_REQUEST_IN_PROCESS: "40",
IMS_ERROR_IN_READ_USER_DATA: "60",
IMS_ERROR_IN_SAVE_USER_DATA: "61",
IMS_ERROR_IN_REMOVE_USER_DATA: "62",
IMS_ERROR_USER_DATA_NOT_PRESENT: "63",
IMS_ERROR_IN_READ_DEVICE_TOKEN: "64",
IMS_ERROR_IN_SAVE_DEVICE_TOKEN: "65",
IMS_ERROR_IN_REMOVE_DEVICE_TOKEN: "66",
IMS_ERROR_DEVICE_TOKEN_NOT_PRESENT: "67",
IMS_ERROR_INVALID_DEVICE_TOKEN: "68",
IMS_ERROR_CLIENTID_NOT_PRESENT: "69",
IMS_ERROR_IN_FETCH_USER_ACCOUNTS: "70",
IMS_ERROR_IN_SAVE_USER_FOR_CLIENTID: "71",
IMS_ERROR_DEVICE_ID_NOT_PRESENT: "72",
IMS_ERROR_DEFAULT_USER_FOR_CLIENTID_NOT_PRESENT: "73",
IMS_ERROR_NO_USER_RECORDS_PRESENT: "74",
IMS_ERROR_ACCESS_DENIED: "80",
IMS_ERROR_INVALID_REQUEST: "81",
IMS_ERROR_INVALID_CLIENT: "82",
IMS_ERROR_INVALID_GRANT: "83",
IMS_ERROR_UNAUTHORIZED_CLIENT: "84",
IMS_ERROR_UNSUPPORTED_RESPONSE_TYPE: "85",
IMS_ERROR_INVALID_SCOPE: "86",
IMS_ERROR_UNSUPPORTED_GRANT_TYPE: "87",
IMS_ERROR_BAD_REQUEST: "88",
IMS_ERROR_INVALID_CREDENTIALS: "89",
IMS_ERROR_IN_GET_AUTH_DATA_FROM_IDP: "100",
IMS_ERROR_IN_GET_DEVICE_TOKEN_FROM_IDP: "101",
IMS_ERROR_IN_GET_REFRESH_TOKEN_FROM_IDP: "102",
IMS_ERROR_IN_GET_ACCESS_TOKEN_FROM_IDP: "103",
IMS_ERROR_IN_GET_PROFILE_DATA_FROM_IDP: "104",
IMS_ERROR_TOU_CHANGED: "120",
IMS_ERROR_IN_REVOKE_DEVICE_TOKEN: "121",
IMS_ERROR_TOU_NOT_CURRENT: "122",
IMS_ERROR_EVS_INVALID: "123",
IMS_ERROR_ACCT_ACT_REQ: "124",
IMS_ERROR_ACCT_DISABLED: "125",
IMS_ERROR_SUBS_ACT_REQ: "126",
IMS_ERROR_SUBS_NO_SUB: "127",
IMS_ERROR_NO_BUDDY_GROUP_FOR_CLIENT: "150",
IMS_ERROR_CLIENT_REGISTERED_FOR_OTHER_GROUP: "151",
IMS_ERROR_GROUP_ENTRY_NOT_PRESENT: "152",
IMS_ERROR_IN_SAVE_GROUP_DATA: "153",
IMS_ERROR_CNAME_ENTRY_NOT_PRESENT: "154",
IMS_ERROR_IN_SAVE_BACKOFF_DATA: "155",
IMSMANAGER_ERROR_EXCEPTION: "3000",
IMSMANAGER_ERROR_ENCODING: "3001",
IMSMANAGER_SUCCESS_BROWSER_OPENED: "3002",
IMSMANAGER_ERROR_BROWSER_FAILED_TO_OPEN: "3003",
IMS_UNKNOWN_ERROR: "0xFFFF"
}, IMSInterface.prototype.events = IMSInterface.events, Vulcan.prototype.getTargetSpecifiers = function() {
var params = {};
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetTargetSpecifiers", JSON.stringify(params)));
}, Vulcan.prototype.launchApp = function(targetSpecifier, focus, cmdLine) {
if (!requiredParamsValid(targetSpecifier)) return !1;
var params = {};
return params.targetSpecifier = targetSpecifier, params.focus = focus ? "true" : "false",
params.cmdLine = requiredParamsValid(cmdLine) ? cmdLine : "", JSON.parse(window.__adobe_cep__.invokeSync("vulcanLaunchApp", JSON.stringify(params))).result;
}, Vulcan.prototype.isAppRunning = function(targetSpecifier) {
if (!requiredParamsValid(targetSpecifier)) return !1;
var params = {};
return params.targetSpecifier = targetSpecifier, JSON.parse(window.__adobe_cep__.invokeSync("vulcanIsAppRunning", JSON.stringify(params))).result;
}, Vulcan.prototype.isAppInstalled = function(targetSpecifier) {
if (!requiredParamsValid(targetSpecifier)) return !1;
var params = {};
return params.targetSpecifier = targetSpecifier, JSON.parse(window.__adobe_cep__.invokeSync("vulcanIsAppInstalled", JSON.stringify(params))).result;
}, Vulcan.prototype.getAppPath = function(targetSpecifier) {
if (!requiredParamsValid(targetSpecifier)) return "";
var params = {};
return params.targetSpecifier = targetSpecifier, JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetAppPath", JSON.stringify(params))).result;
}, Vulcan.prototype.addMessageListener = function(type, callback, obj) {
if (requiredParamsValid(type, callback) && strStartsWith(type, VulcanMessage.TYPE_PREFIX)) {
var params = {};
params.type = type, window.__adobe_cep__.invokeAsync("vulcanAddMessageListener", JSON.stringify(params), callback, obj);
}
}, Vulcan.prototype.removeMessageListener = function(type, callback, obj) {
if (requiredParamsValid(type, callback) && strStartsWith(type, VulcanMessage.TYPE_PREFIX)) {
var params = {};
params.type = type, window.__adobe_cep__.invokeAsync("vulcanRemoveMessageListener", JSON.stringify(params), callback, obj);
}
}, Vulcan.prototype.dispatchMessage = function(vulcanMessage) {
if (requiredParamsValid(vulcanMessage) && strStartsWith(vulcanMessage.type, VulcanMessage.TYPE_PREFIX)) {
var params = {}, message = new VulcanMessage(vulcanMessage.type);
message.initialize(vulcanMessage), params.vulcanMessage = message, window.__adobe_cep__.invokeSync("vulcanDispatchMessage", JSON.stringify(params));
}
}, Vulcan.prototype.getPayload = function(vulcanMessage) {
if (!requiredParamsValid(vulcanMessage) || !strStartsWith(vulcanMessage.type, VulcanMessage.TYPE_PREFIX)) return null;
var message = new VulcanMessage(vulcanMessage.type);
return message.initialize(vulcanMessage), message.getPayload();
}, Vulcan.prototype.getEndPoints = function() {
var params = {};
return JSON.parse(window.__adobe_cep__.invokeSync("vulcanGetEndPoints", JSON.stringify(params)));
}, Vulcan.prototype.getSelfEndPoint = function() {
var params = {};
return window.__adobe_cep__.invokeSync("vulcanGetSelfEndPoint", JSON.stringify(params));
};
var VulcanInterface = new Vulcan();
VulcanMessage.TYPE_PREFIX = "vulcan.SuiteMessage.", VulcanMessage.SCOPE_SUITE = "GLOBAL",
VulcanMessage.DEFAULT_APP_ID = "UNKNOWN", VulcanMessage.DEFAULT_APP_VERSION = "UNKNOWN",
VulcanMessage.DEFAULT_DATA = "<data><payload></payload></data>", VulcanMessage.dataTemplate = "<data>{0}</data>",
VulcanMessage.payloadTemplate = "<payload>{0}</payload>", VulcanMessage.prototype.initialize = function(message) {
this.type = message.type, this.scope = message.scope, this.appId = message.appId,
this.appVersion = message.appVersion, this.data = message.data;
}, VulcanMessage.prototype.xmlData = function() {
if (void 0 === this.data) {
var str = "";
str = String.format(VulcanMessage.payloadTemplate, str), this.data = String.format(VulcanMessage.dataTemplate, str);
}
return this.data;
}, VulcanMessage.prototype.setPayload = function(payload) {
var str = cep.encoding.convertion.utf8_to_b64(payload);
str = String.format(VulcanMessage.payloadTemplate, str), this.data = String.format(VulcanMessage.dataTemplate, str);
}, VulcanMessage.prototype.getPayload = function() {
var str = GetValueByKey(this.data, "payload");
return null !== str ? cep.encoding.convertion.b64_to_utf8(str) : null;
}, VulcanMessage.prototype.toString = function() {
var str = "type=" + this.type;
return str += ", scope=" + this.scope, str += ", appId=" + this.appId, str += ", appVersion=" + this.appVersion,
str += ", data=" + this.xmlData();
}, String.format = function(src) {
if (0 === arguments.length) return null;
var args = Array.prototype.slice.call(arguments, 1);
return src.replace(/\{(\d+)\}/g, function(m, i) {
return args[i];
});
};