/**
* IBM Confidential OCO Source Materials IBM Business Platform: CA-Portal
* (C) Copyright IBM Corp. 2016, 2017
*
* The source code for this program is not published or otherwise divested of
* its trade secrets, irrespective of what has been deposited with the U.S.
* Copyright Office
*/
define("ba_portal/nls/BaPortalResources",{root:!0,cs:!0,da:!0,de:!0,es:!0,fi:!0,fr:!0,hr:!0,hu:!0,it:!0,ja:!0,kk:!0,ko:!0,no:!0,nb:!0,nl:!0,pl:!0,pt:!0,"pt-br":!0,ro:!0,ru:!0,sl:!0,sv:!0,th:!0,tr:!0,zh:!0,"zh-cn":!0,"zh-tw":!0}),define("ba_portal/nls/root/BaPortalResources",{homePage:"Home page",homeSet:"Your home was set successfully",homeSetError:"An error occurred setting the default home page, try closing and reopening this view.",website:"Website",invalidURLSupplied:"Invalid URL supplied",tenantName:"(%{name})",switcherRemoveIconLabel:"Close"}),define("ba_portal/nls/StringResources",["i18n!./BaPortalResources","../lib/@waca/core-client/js/core-client/utils/Lexicon"],function(e,n){"use strict";var o=new n({data:e,allowMissing:!0,verbose:!1});return{get:function(e,t){var a=o.translate(e,t);return a!==e?a:n.NOT_TRANSLATED+"("+e+")"}}}),define("text!ba_portal/api/templates/genericIframe.html",[],function(){return'\x3c!-- Licensed Materials - Property of IBM\n \n IBM Cognos Products: SHARE\n \n (C) Copyright IBM Corp. 2017\n \n US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n--\x3e\n
\n\t\n
\n'}),define("text!ba_portal/api/templates/error.html",[],function(){return'\x3c!-- Licensed Materials - Property of IBM\n \n IBM Cognos Products: SHARE\n \n (C) Copyright IBM Corp. 2017\n \n US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.\n--\x3e\n\n\t{{=it.errorMessage}}\n
\n'}),define("ba_portal/api/IFrameView",["../lib/@waca/baglass/js/baglass/app/ContentView","doT","jquery","../nls/StringResources","text!./templates/genericIframe.html","text!./templates/error.html","underscore"],function(t,n,o,e,c,i,a){"use strict";var r=t.extend({init:function(e){o.extend(this,e),t.inherited("init",this,arguments)},render:function(){return a.isString(this.url)?this._render():(o.extend(this,this._getOptionsFromId(this.id)),a.isString(this.url)?this._render():this._injectiFrame(i,{errorMessage:r.ERROR_MESSAGE}))},setFocus:function(){t.inherited("setFocus",this,arguments),this.trigger("change:state")},_render:function(){var t={"/":"_","+":"-"},e=new RegExp(Object.keys(t).join("|\\"),"g"),a={type:"GET",url:"v1/perspectives/home/urls/"+btoa(this.url).replace(e,function(e){return t[e]}),contentType:"application/json; charset=utf-8",dataType:"json",skipErrorHandling:!0};return this.glassContext.getCoreSvc(".Ajax").ajax(a).then(function(){return this._injectiFrame(c,{genericIframe_url:this.url})}.bind(this)).catch(function(){return this._injectiFrame(i,{errorMessage:r.ERROR_MESSAGE})}.bind(this))},_getOptionsFromId:function(e){try{return this.glassContext.appController.findElement(e).options}catch(e){return null}},_injectiFrame:function(e,t){o.extend(t,{genericIframe_title:this.getTitle()});var a=n.template(e)(t);return this.$el.append(a),Promise.resolve()},getContent:function(){return{id:btoa(this.url),url:this.url,title:this.getTitle()}},getType:function(){return"generic_iframe"},getTitle:function(){return this.title||e.get("website")},execute:function(e){var t=e.glassContext.appController.currentAppView.currentContentView.getContent();return t.perspective=this.getType(),t}});return r.ERROR_MESSAGE=e.get("invalidURLSupplied"),r}),define("ba_portal/common/controllers/HomeActionController",["jquery","underscore","../../lib/@waca/baglass/js/baglass/app/plugins/MenuActionInterface","../../nls/StringResources","../../lib/@waca/core-client/js/core-client/utils/Utils","../../lib/@waca/core-client/js/core-client/utils/ContentFormatter","../../lib/@waca/core-client/js/core-client/utils/BidiUtil"],function(e,t,a,w,c,i,r){"use strict";var s;return e(window).on("resize",function(){s&&s(!0)}),a.extend({onSelectItem:function(e){var t=this._getPluginKey(e.target.itemId),a=e.glassContext;switch(t){case"setHome":return a.currentAppView.setAsHome(e).then(function(){a.perspectiveLifeCycle.openPerspectiveController.setHomeFlag(a.currentAppView,!0),a.showToast(w.get("homeSet"))}.bind(this),function(e){a.showToast(w.get("homeSetError"),{type:"error"}),this.logger&&this.logger.error(e)}.bind(this));case"myHome":return a.openAppView();default:var n=e.target.plugin.itemSpec.items[e.target.specItemIndex].appView;return a.openAppView(n.perspective,n.context)}},onPress:function(e){e.glassContext.openAppView()},onRemoveItem:function(e){var t=e.target.plugin.itemSpec.items,a=e.glassContext,n=t[e.target.specItemIndex].appView,o=n===a.currentAppView;return(new Promise.resolve).then(function(){if(o)return e.target.plugin.closeGlassMenu()}).then(function(){return a.closeAppView(n.perspective,n.context.content.id||n.context.id)}).then(function(){return a.off("change:title",void 0,n.viewId),!o})},isItemVisible:function(e){return"myHome"!==this._getPluginKey(e.target.itemId)},onOpen:function(e){var t=this._getPluginKey(e.target.itemId),a=w.get("homePage");if("viewSwitcher"===t){var n=e.target.plugin.itemSpec,o=e.glassContext,c=[];n.items=c;for(var i=this._getPluginFeature(e.target.itemId),r=0;r