function SettingsViewModel(){var a=this;a.initializing=!1;a.calculationTypeOptions=ko.observableArray([{id:CalculationTypes.Select,label:function(){return Culture.translations().stringTextSelect}},{id:CalculationTypes.Leasing,label:function(){return Culture.translations().stringTextLeasing}},{id:CalculationTypes.Credit,label:function(){return Culture.translations().stringTextCredit}}]);a.objectTypeOptions=ko.observableArray([{id:ObjectTypes.Select,label:function(){return Culture.translations().stringTextSelect}},
{id:ObjectTypes.Undefined,label:function(){return Culture.translations().stringTextUndefined}},{id:ObjectTypes.Car,label:function(){return Culture.translations().stringTextCar}}]);a.taxModeOptions=ko.observableArray([{id:TaxModes.Select,label:function(){return Culture.translations().stringTextSelect}},{id:TaxModes.Netto,label:function(){return Culture.translations().stringTextNetto}},{id:TaxModes.Brutto,label:function(){return Culture.translations().stringTextBrutto}}]);a.getDefaultResidualValueChart=
function(){var b=ko.utils.arrayFilter(a.residualValueCharts(),function(a){return!0===a.IsDefault});if(0!==b.length)return b[0];Log("Default residual value chart did not found. Retrive chart from local file.");return DefaultResidualValueCharts[0]};a.getResidualValueChartById=function(b){var c=ko.utils.arrayFilter(a.residualValueCharts(),function(a){return a.Id===b});if(0!==c.length)return c[0];Log("Residual value chart with Id: "+b+" did not found.");return null};a.logInMode=ko.observable(LogInModes.Manual);
a.useSliders=ko.observable("false");a.listView=ko.observable(ApplicationSettings.listView);a.defaultCalculationType=ko.observable(ApplicationSettings.defaultCalculationType);a.defaultObjectType=ko.observable(ApplicationSettings.defaultObjectType);a.defaultTaxMode=ko.observable(ApplicationSettings.defaultTaxMode);a.defaultInterestRate=ko.observable(ApplicationSettings.defaultInterestRate).extend({validateInterestRate:{}});a.currentCulture=ko.observable(ApplicationSettings.currentCulture);a.calculationSettings=
ko.observable(ApplicationSettings.DefaultCalculationSettings);a.residualValueCharts=ko.observable(DefaultResidualValueCharts);a.userName=ko.observable();a.password=ko.observable();a.useExtendedDescription=ko.observable(ApplicationSettings.useExtendedDescription);a.defaultTaxModeValue=ko.observable(ApplicationSettings.valueAddedTaxRate).extend({validateTaxMode:{}});a.logInMode.subscribe(function(b){Log("Log in mode changed: "+b);b!=LogInModes.Automatic&&(Log("Clearing credentials..."),a.userName(""),
a.password(""))});var b=function(){a.initializing||DataProvider.saveSettings(a)};a.logInMode.subscribe(b);a.useSliders.subscribe(b);a.listView.subscribe(b);a.defaultCalculationType.subscribe(b);a.defaultObjectType.subscribe(b);a.defaultTaxMode.subscribe(b);a.defaultInterestRate.subscribe(b);a.currentCulture.subscribe(b);a.calculationSettings.subscribe(b);a.userName.subscribe(b);a.password.subscribe(b);a.defaultTaxModeValue.subscribe(b);b=function(a){Culture.setCulture(a)};a.currentCulture.subscribe(b);
b(a.currentCulture())}var Settings=DataProvider.getSettings();MainViewModel.userName(Settings.userName());MainViewModel.password(Settings.password());
