text: /*!
   * OpenUI5
   * (c) Copyright 2009-2020 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  sap.ui.define(["sap/ui/core/mvc/Controller","sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector","sap/ui/fl/support/apps/contentbrowser/utils/DataUtils","sap/m/Dialog","sap/m/Text","sap/m/Button","sap/m/Input","sap/m/library"],function(C,L,D,a,T,B,I,m){"use strict";var b=m.ButtonType;return C.extend("sap.ui.fl.support.apps.contentbrowser.controller.ContentDetailsEdit",{oSelectedContentModel:undefined,oDataUtils:D,onInit:function(){this._initAndBindSelectedContentModel();var r=sap.ui.core.UIComponent.getRouterFor(this);r.getRoute("ContentDetailsEdit").attachMatched(this._onRouteMatched,this);},_initAndBindSelectedContentModel:function(){this.oSelectedContentModel=new sap.ui.model.json.JSONModel();this.getView().setModel(this.oSelectedContentModel,"selectedContent");},_onRouteMatched:function(r){var t=this;var R=r.getParameter("arguments");var M={};M.layer=R.layer;M.namespace=decodeURIComponent(R.namespace);M.fileName=R.fileName;M.fileType=R.fileType;if(M.namespace[M.namespace.length-1]!=="/"){M.namespace+="/";}var c=M.namespace+M.fileName+"."+M.fileType;var p=t.getView().getContent()[0];p.setBusy(true);return L.getContent(M.layer,c,null,null,true).then(t._onContentReceived.bind(t,M,p,c),function(){p.setBusy(false);});},_onContentReceived:function(M,p,c,d){var t=this;return L.getContent(M.layer,c,true).then(function(o){M.data=D.formatData(d,M.fileType);M.metadata=o;t.oSelectedContentModel.setData(M);p.setBusy(false);},function(){p.setBusy(false);});},onSave:function(){var t=this;var s=this.getView().getModel("selectedContent");var c=s.getData();var l;var d;var p;var f;var P;c.metadata.some(function(M){if(M.name==="layer"){l=M.value;return true;}});c.metadata.some(function(M){if(M.name==="transportId"){d=M.value;return true;}});try{p=JSON.parse(c.data).packageName;}catch(e){}if((l==="USER")||(l==="LOAD")||(l==="VENDOR_LOAD")||(!d&&(!p||p==="$TMP"))){f=undefined;this._saveFile(l,c.namespace,c.fileName,c.fileType,c.data,f,P);}else if(d==="ATO_NOTIFICATION"){f=d;this._saveFile(l,c.namespace,c.fileName,c.fileType,c.data,f,P);}else{var i=!!(l==="VENDOR"||l==="CUSTOMER_BASE");var o=new I({visible:i,placeholder:"Package name (Only necessary for cross client content)"});var g=new I({placeholder:"Transport ID or ATO_NOTIFICATION"});var h=new a({title:"{i18n>transportInput}",type:"Message",content:[new T({text:"{i18n>transportInputDescription}"}),o,g],beginButton:new B({text:"{i18n>confirm}",type:b.Reject,press:function(){P=o.getValue();f=g.getValue();h.close();t._saveFile(l,c.namespace,c.fileName,c.fileType,c.data,f,P);}}),endButton:new B({text:"{i18n>cancel}",press:function(){h.close();}}),afterClose:function(){h.destroy();}});this.getView().addDependent(h);h.open();}},_saveFile:function(l,n,f,F,d,t,p){return L.saveFile(l,n,f,F,d,t,p).then(this._navToDisplayMode.bind(this));},onCancel:function(){this._navToDisplayMode();},_navToDisplayMode:function(){var s=this.getView().getModel("selectedContent");var c=s.getData();var r=sap.ui.core.UIComponent.getRouterFor(this);r.navTo("ContentDetailsFlip",{layer:c.layer,namespace:encodeURIComponent(c.namespace),fileName:c.fileName,fileType:c.fileType});}});});
  