angular.module("app").service("upgrade",["message","core","environment",function(e,r,t){if(window.kkUpgrader)return window.kkUpgrader;var n=window.kkUpgrader={updateMultiLangFields:function(t){var a=[];for(var i in t.drops){var o=t.drops[i];if(o._internal&&o._internal.dropId){var p=r.templates[o._internal.dropId];p&&p.config&&a.concat(n._updateMultiLangFields(o,p.config)),p&&p.settings&&a.concat(n._updateMultiLangFields(o,p.settings))}else console.log("Could not update Multilang Fields because no _internal or dropId set",o)}a.length>0&&(e.info("0 Objekte wurden mit Mehrsprachigkeit nachgerüstet.","Bitte Speichern um Änderungen zu übernehmen."),console.log("multilang update: ",a,!1))},_updateMultiLangFields:function(e,r){for(var a=[],i=0;i<r.length;i++){var o=r[i];if(angular.isString(e[o.property])&&(!0===o.multilanguage||"true"===o.multilanguage)){console.log("changing drop property: ",e,"from value:",e[o.property],"at property:",o.property,"to multilanguage"),a.push({item:e,prop:o.property});var p=e[o.property];e[o.property]={_multilanguage:!0},e[o.property][t.languageDefault.cISO]=p}angular.isArray(e[o.property])&&"list"===o.type&&a.concat(n._updateMultiLangFields(e[o.property],o.itemSettings))}return a}};return window.kkUpgrader}]);