text: /*!
   * OpenUI5
   * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
   * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
   */
  sap.ui.define(["sap/ui/thirdparty/jquery","sap/ui/documentation/sdk/controller/BaseController","sap/ui/model/json/JSONModel","sap/ui/documentation/library","sap/base/util/Version","sap/base/Log","sap/ui/documentation/sdk/util/Resources"],function(e,s,o,i,t,n,r){"use strict";var a=r.getResourceOriginPath("neo-app.json"),u=r.getResourceOriginPath("resources/sap-ui-version.json");return s.extend("sap.ui.documentation.sdk.controller.ReleaseNotes",{onInit:function(){this._oView=this.getView();this._requestResources();this._resourceAvailabilityHandler();this._oModel=new o;this._oVersionModel=new o;this._oView.setModel(this._oModel);this._oView.setModel(this._oVersionModel,"select");i._getAppInfo(this._processAppInfo.bind(this))},_processAppInfo:function(e){var s,o,i,n,r;if(!e){return}s=t(e.version);o=s.getMajor();i=s.getMinor();if(s.getSuffix()!==""){if(i%2!==0){i=i+1}}n=o+"."+i;this._updateVersionInformation(n);r={items:[]};while(i>=28){n=o+"."+i;r.items.push({key:n,value:n});i=i-(i<=60?2:1)}this._oVersionModel.setData(r);this.appendPageTitle(this.getModel("i18n").getProperty("RELEASE_NOTES_TITLE"))},_processLibInfo:function(s,o){var i,n=[],r=s.length,a,u;a=function(e,o){i+=o.notes.length;s[u].versions.push({version:e,notes:o.notes});s[u].versions.sort(function(e,s){return t(s.version).compareTo(e.version)})};for(u=0;u<r;u++){s[u]=o[s[u]];s[u].versions=[];if(s[u].relnotes){i=0;e.each(s[u].relnotes,a);if(i>0){n.push(s[u])}}}this._oModel.setData({libs:n});this._hideBusyIndicator()},_requestResources:function(){this._oNeoAppJsonPromise=e.ajax(a);this._oSapUiVersionJsonPromise=e.ajax(u)},_resourceAvailabilityHandler:function(){e.when(this._oNeoAppJsonPromise,this._oSapUiVersionJsonPromise).then(function(e,s){this._oNeoAppVersions=e[0].routes;this._sSapUiVersion=s[0].version;this._oView.byId("VersionSelect").setVisible(true)}.bind(this),function(){n.warning("No neo-app.json was detected")})},_compareUI5Versions:function(e,s){var o=t(e),i=t(s);return o.getMajor()+"."+o.getMinor()===i.getMajor()+"."+i.getMinor()},_updateLastReleasedVersion:function(e){if(this._compareUI5Versions(e,this._sSapUiVersion)&&parseFloat(this._sLastReleasedVersion)>parseFloat(this._sSapUiVersion)){this._sLastReleasedVersion=this._sSapUiVersion}},_getLastVersionFromNeoAppJson:function(e){var s=this._oNeoAppVersions?this._oNeoAppVersions.length:0,o,i;for(i=0;i<s;i++){o=this._oNeoAppVersions[i].target.version;if(this._compareUI5Versions(o,e)){return o}}},handleVersionChange:function(e){var s=e.getParameter("selectedItem"),o=s.getKey();this._updateVersionInformation(o)},_updateVersionInformation:function(e){var s;this._sLastReleasedVersion=this._getLastVersionFromNeoAppJson(e);this._updateLastReleasedVersion(e);s=this._sLastReleasedVersion?this._sLastReleasedVersion:e;this._showBusyIndicator();i._loadAllLibInfo("","_getLibraryInfoAndReleaseNotes",s,this._processLibInfo.bind(this))},_showBusyIndicator:function(){this.byId("releaseNotesObjectPage").setBusy(true)},_hideBusyIndicator:function(){this.byId("releaseNotesObjectPage").setBusy(false)}})});