text: sap.ui.define(["sap/ui/model/Context","../../js/QuickTemplates/QuickActionBaseController","../../js/QuickTemplates/AnnotationHelper","../../js/QuickTemplates/ODataModelHelper","sap/ui/model/json/JSONModel","sap/base/util/each"],function(C,B,A,O,J,e){"use strict";return B.extend("sap.suite.ui.generic.template.QuickView.view.QuickView",{onInit:function(){if(!this._bIsInitialized){B.prototype.onInit.apply(this);this.sEntityPath=decodeURIComponent(this.oComponent.getComponentData().startupParameters["entityPath"]);this.sEntityPath="/"+O.createKeyFromPath(this.sEntityPath,this.getView().getModel().getMetaModel(),this.sEntitySet);var b=new J({});b.setProperty("/badgeVisible",false);b.setProperty("/fallbackBadgeVisible",false);this._sBadgeModelName="badge";this.getView().setModel(b,this._sBadgeModelName);}},_onMetaModelLoaded:function(){var c=new C(this.getView().getModel(),this.sEntityPath);this.bindView(c);c.getModel().attachRequestCompleted(this._resolveBadgeModel,this);},bindView:function(c){var i=this._getFormatterInterface(c);var f=A.getNavigationPathsFromFacet(i,this.oEntityTypeMeta.namespace+"."+this.oEntityTypeMeta.name,"FieldGroup");var h=A.getNavigationPathsUsingAnnotationHeuristics(c,this.oEntityTypeMeta.namespace+"."+this.oEntityTypeMeta.name);var o={};e(f,function(b,p){o[p]="";});e(h,function(b,p){o[p]="";});var a=A.formatExpandPaths(Object.keys(o));this.oContext=c;this.getView().bindElement({path:c.getPath(),parameters:{expand:a}});},_resolveBadgeModel:function(){if(this._badgeResolved){this.oContext.getModel().detachRequestCompleted(this._resolveBadgeModel,this);return;}var c=this.oContext;var a=this.oComponent.ContextualManagedObject;var b=this.getView().getModel(this._sBadgeModelName);if(a){var o=new a({serviceUrl:(c.getModel().sServiceUrl)?c.getModel().sServiceUrl:null,path:c.getPath(),entitytype:this.oEntitySetMeta.entityType,uiGroup:"Main Object",priority:"1"});o.setModel(c.getModel());o.setBindingContext(c);o.resolveAnnotations();b.setProperty("/imgUrlDefined",(o.getProperty("imgUrl")!=undefined&&o.getProperty("imgUrl").indexOf("sap-icon")<0));b.setProperty("/imgUrl",o.getProperty("imgUrl"));b.setProperty("/typeImgUrlDefined",(o.getProperty("typeImgUrl")!=undefined&&!b.getProperty("/imgUrlDefined")));b.setProperty("/typeImgUrl",o.getProperty("typeImgUrl"));if(!b.getProperty("/imgUrlDefined")&&!b.getProperty("/typeImgUrlDefined")){b.setProperty("/typeImgUrl","sap-icon://form");b.setProperty("/typeImgUrlDefined",true);}b.setProperty("/title",o.getProperty("title"));if(o.getProperty("typeName")){b.setProperty("/typeName",o.getProperty("typeName"));}else if(o.getProperty("titleMetadata")&&o.getProperty("titleMetadata")["sap:label"]){b.setProperty("/typeName",o.getProperty("titleMetadata")["sap:label"]);}else{b.setProperty("/typeName","");}b.setProperty("/subtitle",o.getProperty("headline"));b.setProperty("/badgeVisible",true);}else{b.setProperty("/fallbackBadgeVisible",true);}this._badgeResolved=true;}});},true);
  