text: /*!
   * SAP APF Analysis Path Framework
   * 
   * (c) Copyright 2012-2018 SAP AG. All rights reserved
   */
  sap.ui.define(['sap/ui/core/format/DateFormat',"sap/apf/utils/hashtable","sap/m/ViewSettingsDialog"],function(u,H,V){'use strict';function c(a){var n=parseInt(a,10);if(n<10){return"0"+n;}return a;}var f;var s=0;var d={renderHeaderOfTextPropertyFile:function(a,m){var t=a.toLowerCase();var b=/^[0-9a-f]+$/;var i=b.test(t);if(!i||a.length!==32){m.putMessage(m.createMessageObject({code:"5409",aParameters:[a]}));t="<please enter valid translation uuid, if you want to upload into a SAP translation system>";}else{t=t.substring(0,8)+'-'+t.substring(8,12)+'-'+t.substring(12,16)+'-'+t.substring(16,20)+'-'+t.substring(20);}return"#FIORI: insert Fiori-Id\n"+"# __ldi.translation.uuid="+t+"\n"+"#ApfApplicationId="+a+"\n\n";},getUriParameters:function(){return jQuery.sap.getUriParameters().mParams;},createPromise:function(v,a){var b=jQuery.Deferred();if(!a){b.resolve(v);}else{setTimeout(function(){b.resolve(v);},a);}return b.promise();},renderTextEntries:function(h,m){f=false;var k=h.getKeys();k.sort(function(a,b){var v=h.getItem(a);var e=h.getItem(b);if(v.LastChangeUTCDateTime<e.LastChangeUTCDateTime){return-1;}if(v.LastChangeUTCDateTime>e.LastChangeUTCDateTime){return 1;}return 0;});var l=k.length;var r='';var i;for(i=0;i<l;i++){r=r+d.renderEntryOfTextPropertyFile(h.getItem(k[i]),m);}return r;},renderEntryOfTextPropertyFile:function(t,m){var a,D;if(!f&&(!t.TextElementType||!t.MaximumLength)){f=true;m.putMessage(m.createMessageObject({code:"5408",aParameters:[t.TextElement]}));}var e="#"+(t.TextElementType||"<Add text type>")+","+(t.MaximumLength||"<Add maximum length>");if(t.TranslationHint&&t.TranslationHint!==""){e=e+':'+t.TranslationHint;}e=e+"\n"+t.TextElement+"="+t.TextElementDescription+"\n";var o=u.getDateTimeInstance({pattern:"yyyy/MM/dd HH:mm:ss"});if(t.LastChangeUTCDateTime&&t.LastChangeUTCDateTime!==""){a=t.LastChangeUTCDateTime.replace(/\/Date\(/,'').replace(/\)\//,'');D=new Date(parseInt(a,10));}else{D=new Date();}e=e+"# LastChangeDate="+o.format(D)+'\n\n';return e;},eliminateDuplicatesInArray:function(m,w){m.check((w!==undefined&&typeof w==='object'&&w.hasOwnProperty('length')===true),'Error - aArray is undefined');var r=[];var i,j;for(i=0;i<w.length;i++){for(j=i+1;j<w.length;j++){if(w[i]===w[j]){j=++i;}}r.push(w[i]);}return r;},hashCode:function(v){var n=0;var i;var a=0;v=v.toString();var l=v.length;for(i=0;i<l;i++){a=v.charCodeAt(i);n=(17*n+a)<<0;}return Math.abs(n);},escapeOdata:function(v){if(typeof v==="string"){return v.replace("'","''");}return v;},json2javascriptFormat:function(v,t){var i;switch(t){case"Edm.Boolean":if(typeof v==="boolean"){return v;}if(typeof v==="string"){return v.toLowerCase()==="true";}return false;case"Edm.Decimal":case"Edm.Guid":case"Edm.Int64":case"Edm.String":return v;case"Edm.Int16":case"Edm.Int32":return parseInt(v,10);case"Edm.Single":case"Edm.Float":return parseFloat(v);case"Edm.Time":return v;case"Edm.DateTime":i=v.replace('/Date(','').replace(')/','');i=parseFloat(i);return new Date(i);case"Edm.DateTimeOffset":i=v.replace('/Date(','');i=i.replace(')/','');i=parseFloat(i);return new Date(i);default:return v;}},formatValue:function(a,p){function b(v){var k;var r=new RegExp("^[0-9]*$");if(v instanceof Date){return v;}if(typeof v==='string'){if(v.substring(0,6)==='/Date('){k=v.replace('/Date(','');k=k.replace(')/','');k=parseInt(k,10);return new Date(k);}else if(v.length===8&&r.test(v)){return d.convertFiscalYearMonthDayToDate(v);}return new Date(v);}return undefined;}var D;var F="";if(a===null||a===undefined){return"null";}var t=p.dataType.type;switch(t){case"Edm.String":if(p["sap-semantics"]==="yearmonthday"){if(typeof a==='object'&&a instanceof Date){var y=a.getUTCFullYear()+"";var m=c(a.getUTCMonth()+1+"");var e=c(a.getUTCDate()+"");a=y+m+e;}}F="'"+String(a).replace(/'/g,"''")+"'";break;case"Edm.Time":if(typeof a==='number'){D=new Date();D.setTime(a);var h=D.getUTCHours();if(h<10){h='0'+h;}var i=D.getUTCMinutes();if(i<10){i='0'+i;}var j=D.getUTCSeconds();if(j<10){j='0'+j;}F="time'"+h+':'+i+':'+j+"'";}else{F="time'"+a+"'";}break;case"Edm.DateTime":if(!d.formatValue.oDateTimeFormat){d.formatValue.oDateTimeFormat=u.getDateInstance({pattern:"'datetime'''yyyy-MM-dd'T'HH:mm:ss''"});}D=b(a);F=d.formatValue.oDateTimeFormat.format(D,true);break;case"Edm.DateTimeOffset":if(!d.formatValue.oDateTimeOffsetFormat){d.formatValue.oDateTimeOffsetFormat=u.getDateInstance({pattern:"'datetimeoffset'''yyyy-MM-dd'T'HH:mm:ss'Z'''"});}D=b(a);F=d.formatValue.oDateTimeOffsetFormat.format(D,true);break;case"Edm.Guid":F="guid'"+a+"'";break;case"Edm.Decimal":F=a+"M";break;case"Edm.Int64":F=String(a)+"L";break;case"Edm.Single":F=a+"f";break;case"Edm.Binary":F="binary'"+a+"'";break;default:F=a;break;}return F;},extractFunctionFromModulePathString:function(F){if(jQuery.isFunction(F)){return F;}var D,n,a;n=F.split('.');D=window;var i;for(i=0;i<n.length-1;i++){D=D[n[i]];if(!D){return undefined;}}a=n[n.length-1];return D[a];},isValidGuid:function(a){return/^[0-9A-F]{32}$/.test(a);},isValidPseudoGuid:function(a){return/^[0-9A-F]{32}$/.test(a);},createPseudoGuid:function(l){if(!l&&l!==0){l=32;}var a=Date.now().toString();var b=l-a.length;a+=d.createRandomNumberString(b);return a;},createRandomNumberString:function(l){var r="";var a,m,b;while(r.length<l){a=Math.min(10,l-r.length);m=Math.pow(10,a);b=g(new Date().getTime());r+=Math.floor(b*m);}return r;},migrateConfigToCategoryStepAssignment:function(a,i){var H=(i.constructors&&i.constructors.Hashtable)||H;var b=new H(i.instances.messageHandler);if(a.steps){a.steps.forEach(function(e){if(e.categories){e.categories.forEach(function(h){var j=b.getItem(h.id);if(!j){j={category:h.id,steps:[{type:"step",id:e.id}]};b.setItem(h.id,j);}else{j.steps.push({type:"step",id:e.id});}});delete e.categories;}});}if(a.categories){a.categories.forEach(function(e){if(!e.steps){var h=b.getItem(e.id);if(h){e.steps=h.steps;}else{e.steps=[];}}});}},getComponentNameFromManifest:function(m){var n;if(m["sap.ui5"]&&m["sap.ui5"].componentName){n=m["sap.ui5"].componentName;}else{n=m["sap.app"].id;}if(n.search('Component')>-1){return n;}return n+'.Component';},validateSelectedValues:function(a,b){var r={valid:[],invalid:[]};if(!a||!jQuery.isArray(a)||a.length===0){return r;}if(!b||!jQuery.isArray(b)||b.length===0){r.invalid=a;return r;}a.forEach(function(e){if(jQuery.inArray(e,b)===-1){r.invalid.push(e);}else{r.valid.push(e);}});return r;},extractPathnameFromUrl:function(a){var e='a';var p;var b=document.createElement(e);b.href=a;if(b.pathname){p=b.pathname;if(p&&p[0]!=='/'){p='/'+p;}return p;}return a;},extractOdataErrorResponse:function(r){var a;if(typeof r==='string'){a=JSON.parse(r);}else{a=r;}var m=(a&&a.error&&a.error.message&&a.error.message.value)||(a&&a.error&&a.error.message&&a.error.message)||r;if(a&&a.error&&a.error.innererror&&a.error.innererror.errordetails){m=m+'\n';a.error.innererror.errordetails.forEach(function(b){m=m+b.message+'\n';});}else if(a&&a.error&&a.error.details){m=m+'\n';a.error.details.forEach(function(b){m=m+b.message+'\n';});}return m;},checkAndCloseDialog:function(a){if(a!==undefined){if(a instanceof V){a.destroy();}else if(a.isOpen()){a.close();}}},convertFiscalYearMonthDayToDate:function(y){var a=parseInt(y.substr(0,4),10);var m=parseInt(y.substr(4,2),10);var b=parseInt(y.substr(6,2),10);return new Date(Date.UTC(a,m-1,b));},convertFiscalYearMonthDayToDateString:function(y){return d.convertFiscalYearMonthDayToDate(y).toUTCString();},convertDateListToInternalFormat:function(a,p){function b(h){var n=parseInt(h,10);if(n<10){return"200"+n;}else if(n<100){return"20"+n;}return h;}if(!a||!a.length){return a;}var e=[];a.forEach(function(h){var y,m,i,j,k;if(new RegExp('^[0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]+$').test(h)){j=h.split(".");i=c(j[0]);m=c(j[1]);y=b(j[2]);}else if(new RegExp("^[0-9]{1,2}/[0-9]{1,2}/[0-9]+$").test(h)){j=h.split("/");m=c(j[0]);i=c(j[1]);y=b(j[2]);}else if(new RegExp("^[0-9]{4}-[0-9]{2}-[0-9]{2}").test(h)){y=h.slice(0,4);m=h.slice(5,7);i=h.slice(8,10);}if(y!==undefined&&m!==undefined&&i!==undefined){if(p.getAttribute('type')==="Edm.String"){e.push(y+m+i);}else{k=new Date(Date.UTC(parseInt(y,10),parseInt(m,10)-1,parseInt(i,10)));e.push(k);}}else{e.push(h);}});return e;},convertToExternalFormat:function(i,m){var t=m.getAttribute("type");var a,b;var e;switch(t){case"Edm.DateTime":e=m.getAttribute("sap:display-format");if(e==="Date"&&i instanceof Date){a=u.getDateInstance({style:"short"});return a.format(i,true);}else if(e==="Date"&&(typeof i==='string')){if(i.length===8){b=d.convertFiscalYearMonthDayToDate(i);a=u.getDateInstance({style:"short"});return a.format(b,true);}b=new Date(Date.parse(i));if(isNaN(b.getTime())){return i;}a=u.getDateInstance({style:"short"});return a.format(b,true);}return i.toString();case"Edm.String":e=m.getAttribute('sap:semantics');if(e==="yearmonthday"){if(i.length===8){b=d.convertFiscalYearMonthDayToDate(i);}else{b=new Date(Date.parse(i));}if(isNaN(b.getTime())){return i;}a=u.getDateInstance({style:"short"});return a.format(b,true);}return i;default:return i;}},sortByProperty:function(a,p,b){if(a.length===0){return[];}var e=b?b.type:undefined;var h=a[0][p];var m;if(typeof h==='number'){return a.sort(function(v,i){return v[p]-i[p];});}else if(typeof h==='object'&&h instanceof Date){return a.sort(function(v,i){return v[p].getTime()-i[p].getTime();});}else if(typeof h==='string'){switch(e){case"Edm.DateTime":return a.sort(function(v,i){return Date.parse(v[p])-Date.parse(i[p]);});case"Edm.String":m=b["sap:semantics"];if(m==="yearmonthday"&&h.length===8){return a.sort(function(v,i){return v[p].localeCompare(i[p]);});}else if(m==="yearmonthday"){return a.sort(function(v,i){return Date.parse(v[p])-Date.parse(i[p]);});}return a.sort(function(v,i){return v[p].localeCompare(i[p]);});default:return a.sort(function(v,i){return v[p].localeCompare(i[p]);});}}},isPropertyTypeWithDateSemantics:function(p){var t=p['type'];var a=p['sap:display-format'];return(t==='Edm.DateTime'&&a==='Date')||(t==='Edm.String'&&p['sap:semantics']==='yearmonthday');}};function g(i){s++;var r,a,b;i=s.toString()+i.toString();r=d.hashCode(i);a=r.toString().length;b=r/Math.pow(10,a);return b;}Object.keys(d).forEach(function(k){sap.apf.utils[k]=d[k];});return d;},true);
  