var DataSerializer={serializeCalculations:function(a){for(var c=[],e=0;e<a.length;e++){var b=a[e];c.push({id:b.id(),updateTime:b.updateTime().format(Constants.FullDataFormat),description:b.description(),make:b.make(),model:b.model(),type:b.type(),calculationType:b.calculationType(),selectedObjectType:b.selectedObjectType(),selectedUsage:b.selectedUsage(),contractTypesDisabled:b.contractTypesDisabled(),objectTypesDisabled:b.objectTypesDisabled(),usagesDisabled:b.usagesDisabled(),presentValue:b.presentValue(),
oneOffPayment:b.oneOffPayment(),numberOfMonths:b.numberOfMonths(),finalBaseValue:b.finalBaseValue(),finalCorrectValue:b.finalCorrectValue(),monthlyPayment:b.monthlyPayment(),calculationMode:b.calculationMode(),interestRate:b.interestRate(),imageURL:b.imageURL(),taxRate:b.taxRate,mileage:b.mileage(),accessoriesValue:b.accessoriesValue(),baseValue:b.baseValue()})}return JSON.stringify(c)},deserializeCalculations:function(a){var a=$.parseJSON(a),c=[];if(!a)return c;for(var e=0;e<a.length;e++){var b=
a[e],d=new CalculationViewModel;d.initializing=!0;d.id(b.id);d.updateTime(moment(b.updateTime,Constants.FullDataFormat));d.description(b.description);d.make(b.make);d.model(b.model);d.type(b.type);d.calculationType(b.calculationType);d.selectedObjectType(b.selectedObjectType);d.selectedUsage(b.selectedUsage);d.contractTypesDisabled(b.contractTypesDisabled);d.objectTypesDisabled(b.objectTypesDisabled);d.usagesDisabled(b.usagesDisabled);d.presentValue(b.presentValue);d.oneOffPayment(b.oneOffPayment);
d.numberOfMonths(b.numberOfMonths);d.finalBaseValue(b.finalBaseValue);d.finalCorrectValue(b.finalCorrectValue);d.monthlyPayment(b.monthlyPayment);d.calculationMode(b.calculationMode);d.interestRate(b.interestRate);d.imageURL(b.imageURL);d.taxRate=b.taxRate;d.mileage(b.mileage);d.accessoriesValue(b.accessoriesValue);d.baseValue(b.baseValue);d.initializing=!1;c.push(d)}return c},serializeSettings:function(a){var c={};c.logInMode=a.logInMode();c.useSliders=a.useSliders();c.listView=a.listView();c.userName=
a.userName();c.password=a.password();c.defaultCalculationType=a.defaultCalculationType();c.defaultObjectType=a.defaultObjectType();c.defaultTaxMode=a.defaultTaxMode();c.defaultInterestRate=a.defaultInterestRate();c.currentCulture=a.currentCulture();c.calculationSettings=a.calculationSettings();c.defaultTaxModeValue=a.defaultTaxModeValue();Log("Serializing settings");Log(c);return JSON.stringify(c)},deserializeSettings:function(a){var a=$.parseJSON(a),c=new SettingsViewModel;a&&(c.initializing=!0,
c.logInMode(a.logInMode),c.useSliders(a.useSliders),c.userName(a.userName),c.password(a.password),c.defaultCalculationType(a.defaultCalculationType),c.defaultObjectType(a.defaultObjectType),c.defaultTaxMode(a.defaultTaxMode),c.defaultInterestRate(a.defaultInterestRate),c.currentCulture(a.currentCulture),c.calculationSettings(a.calculationSettings),c.defaultTaxModeValue(a.defaultTaxModeValue),c.initializing=!1);Log("Settings deserialized");Log(a);Log(c);return c},serializeCars:function(a){return JSON.stringify(a)},
deserializeCars:function(a){a=$.parseJSON(a);return!a?[]:a},serializeResidualValueCharts:function(a){return JSON.stringify(a)},deserializeResidualValueCharts:function(a){a=$.parseJSON(a);return!a?[]:a}};
