angular.module("mystrom.priceplans.services",[]).factory("priceplansService",["api",function(e){function t(e){g=e}function r(e){h=e}function n(e){d=e}function a(e){D=e}function u(){return g}function c(){return h}function s(){return d}function i(){return D}function f(t){return e.get(e.baseURL+"tariff/custom",{params:t})}function o(t,r,n){return e.get(e.baseURL+"tariff/custom/update?peakPrice="+t+"&offPeakPrice="+r+(_.isNull(n)?"":n))}function l(e,t){if(_.isEqual(e,t))return"";for(var r=m(e),n=m(t),a="",u=r+1;n>u;u++)a+=p(u)+" 0:0 on;";return a}function m(e){switch(e){case"mon":return 0;case"tue":return 1;case"wed":return 2;case"thu":return 3;case"fri":return 4;case"sat":return 5;case"sun":return 6}}function p(e){switch(e){case 0:return"mon";case 1:return"tue";case 2:return"wed";case 3:return"thu";case 4:return"fri";case 5:return"sat";case 6:return"sun"}}var g,d,h=null,D=!1;return{getData:u,getDataToSave:c,getDataTemp:s,isSchedulerChanged:i,setSchedulerChanged:a,setData:t,setDataToSave:r,setDataTemp:n,getPricePlans:f,setPricePlans:o,fillDaysBetween:l}}]);