angular.module("app").controller("LanguageModalController",["$modalScope","template","dropperUserLang","environment",function(e,n,t,a){e.template=n,e.langSettings=$.extend(!0,{},n.lang,t),e.environment=a,e.activeLang=a.getActiveLang(),e.langSearch={value:""},e.setActiveLang=function(n){e.activeLang=n},e.isUserChanged=function(t){var a=e.activeLang.cISO,r=e.diff(n.lang,e.langSettings);return!(!r[t]||!angular.isString(r[t][a]))},e.resetToOriginal=function(t){var a=e.activeLang.cISO;e.langSettings[t][a]=n.lang[t][a]},e.diff=function(n,t){var a=$.extend(!0,{},n),r=$.extend(!0,{},t);for(var g in r)angular.isArray(r[g])||angular.isObject(r[g])?(r[g]=e.diff(a[g],r[g]),Object.keys(r[g]).length||delete r[g]):r[g]!==a[g]||delete r[g];return r},e.shouldShowSearch=function(){return Object.keys(e.langSettings).length>10}}]);