/* Copyright (C) CompareNetworks , Inc - All Rights Reserved * Unauthorized copying of this file, via any medium is strictly prohibited * Proprietary and confidential * Written by Jason Roy , November, 2015 */ !function(e,t){"use strict";function n(e,t,n,s){var r="n"+ ++i,u={cmd:e,args:t,success:n,failure:s};o[r]=u,a(r)}function a(e){var n=t.createElement("IFRAME");n.setAttribute("src","macs://"+e),t.documentElement.appendChild(n),n.parentNode.removeChild(n)}var s={initApi:function(e,t){n("initApi",{version:r},e,t)},printAsset:function(e,t,a){n("printAsset",{assetId:e},t,a)},emailAsset:function(e,t,a){n("emailAsset",{assetId:e},t,a)},viewAsset:function(e,t,a){n("viewAsset",{assetId:e},t,a)},getAsset:function(e,t,a){n("getAssetDetails",{assetId:e},t,a)},getRequiredAssetDetails:function(e,t,a,s){n("getRequiredAssetDetails",{assetId:e,assetDetails:t},a,s)},getFolderAssets:function(e,t,a){n("getFolderAssets",{assetId:e},t,a)},getAssetPath:function(e,t,a){n("getAssetPath",{assetId:e},t,a)},trackSection:function(e,t,n){var a={eVar17:e,events:"event14"};this.trackEvent(a,t,n)},emailMessage:function(e,t,a){n("emailMesssage",e,t,a)},getLocation:function(e,t){n("getLocation",{},e,t)},getStatesForLocationData:function(e,t,a){n("getStatesForLocationData",e,t,a)},readFileAtPath:function(e,t,a){n("readFileAtPath",e,t,a)},convertHTMLToPDF:function(e,t,a){n("convertHTMLToPDF",e,t,a)},getPathForConvertedPDFFileFromHTML:function(e,t,a){n("getPathForConvertedPDFFileFromHTML",e,t,a)},getOfflineLinksForAssets:function(e,t,a){n("getOfflineLinksForAssets",{assets:e},t,a)},saveFile:function(e,t,a){n("saveFile",e,t,a)},emailWithMultipleAssets:function(e,t,a){n("emailWithMultipleAssets",e,t,a)},getUserFullName:function(e,t){n("getUserFullName",{},e,t)},getGoodDataSSOSessionId:function(e,t,a,s){var o={userEmail:e,isAppUserEmail:t};n("getGoodDataSSOSessionId",o,a,s)},saveItemUserData:function(e,t,a,s,o,i){var r={appCode:e,appKey:t,value:a,privacy:s};n("saveItemUserData",r,o,i)},getItemUserData:function(e,t,a,s,o,i){var r={name:e,appCode:t,userId:a,privacy:s};n("getItemUserData",r,o,i)},getSearchResults:function(e,t,a){n("getSearchResults",e,t,a)},trackEvent:function(e,t,a){n("trackEvent",e,t,a)},getSelfDetails:function(e,t,a){n("getSelfDetails",{assetDetails:e},t,a)},createGroup:function(e,t,a,s){var o={groupName:e,groupDescription:t};n("createGroup",o,a,s)},addItemsToGroup:function(e,t,a,s){var o={assets:e,groupUniqueId:t};n("addItemsToGroup",o,a,s)},updateGroupName:function(e,t,n,a){var s={name:e},o={groupObject:s,groupUniqueId:t};this.groupUpdate(o,n,a)},deleteGroup:function(e,t,a){var s={groupUniqueId:e};n("deleteGroup",s,t,a)},getAllGroups:function(e,t,a){var s={groupTypes:e};n("getAllGroups",s,t,a)},openInSafari:function(e,t,a){var s={url:e};n("openInSafari",s,t,a)},getItemThumbnails:function(e,t,n){var a=["iconImageName","smallImageName","largeImageName","bannerImageName","squareLargeImageName","oneThirdImageName","twoThirdImageName","skinnyImageName","featuredLargeImageName"];this.getRequiredAssetDetails(e,a,function(e){if(e){var n=s.getDocumentPath();for(var a in e)null!==e[a]&&(e[a]=n.concat(e[a]+".png"));t(e)}},function(e){n(e)})},closeModule:function(){n("closeModule",{})},triggerEvent:function(e,n){var a=new CustomEvent(e,{detail:{args:n},bubbles:!0,cancelable:!0});t.dispatchEvent(a)},groupUpdate:function(e,t,a){n("updateGroup",e,t,a)},getDocumentPath:function(){var t=e.location.pathname,n=t.split("/"),a=n[n.length-2]+"/"+n[n.length-1],s=t.replace(a,"");return s},getAllItemsForGroup:function(e,t,a){var s={groupUniqueId:e};n("getAllItemsForGroup",s,t,a)},getBundleResourcePath:function(e,t,a){var s={resourceNames:e};n("getBundleResourcePath",s,t,a)},getCommand:function(e){var t=o[e];return JSON.stringify(t)},callback:function(e,t,n){var a=o[e];t?a.success(n):a.failure(n),delete o[e]}};e.addEventListener("closeModule",function(){macs.closeModule()},!1);var o={},i=0,r=2,u={getKeyPath:function(e){var t=e.split("/");return t[t.length-2]},createCookie:function(e,t){var n=new Date;n.setTime(n.getTime()+31536e6);var a="; expires="+n.toGMTString();document.cookie=e+"="+t+a+"; path=/"},readCookie:function(e){for(var t=e+"=",n=document.cookie.split(";"),a=0;a