text: {"version":3,"file":"task-calendar.min.js","sources":["task-calendar.js"],"names":["BX","namespace","Tasks","Calendar","settings","this","weekends",6,"holidays","worktime","start","hours","minutes","end","setWeekends","weekEnds","setHolidays","setWorkTime","adaptSettings","cwt","cOpts","type","isPlainObject","wh","HOURS","we","WEEKEND","dayMap","MO","TU","WE","TH","FR","SA","SU","pad","num","toString","length","START","H","M","END","each","day","push","weekStart","WEEK_START","k","HOLIDAYS","month","parseInt","D","prototype","getClosestWorkTime","date","isForward","startDate","endDate","processEachDay","Date","getTime","calculateDuration","duration","calculateStartDate","newDate","interval","calculateEndDate","callback","currentDate","endless","intervals","getWorkHours","i","intervalStart","intervalEnd","availableStart","availableEnd","call","add","floorDate","Unit","Day","isWeekend","isHoliday","getWorkIntervals","year","getUTCFullYear","getUTCMonth","getUTCDate","time","UTC","getWorkDayDuration","isWorkTime","getUTCDay","isArray","j","holiday","validMonth","isNumber","validDay","isNotEmptyString","times","regex","matches","exec","startHours","startMinutes","endHours","endMinutes","isWorkTimeCorrect","sort","a","b","prevTime"],"mappings":"AAAAA,GAAGC,UAAU,WAEbD,IAAGE,MAAMC,SAAW,WAEnB,QAASA,GAASC,GAGjBC,KAAKC,UAAa,EAAG,KAAMC,EAAG,KAC9BF,MAAKG,WAGLH,MAAKI,WACJC,OAASC,MAAO,EAAGC,QAAS,GAC5BC,KAAOF,MAAO,GAAIC,QAAS,IAG5BP,MAAKS,YAAYV,EAASW,SAC1BV,MAAKW,YAAYZ,EAASI,SAC1BH,MAAKY,YAAYb,EAASK,UAE3BN,EAASe,cAAgB,SAASC,GAEjC,GAAIC,KACJ,IAAGpB,GAAGqB,KAAKC,cAAcH,GACzB,CACC,GAAII,GAAKJ,EAAIK,KACb,IAAIC,GAAKN,EAAIO,OACb,IAAIC,IACHC,GAAM,EACNC,GAAM,EACNC,GAAM,EACNC,GAAM,EACNC,GAAM,EACNC,GAAM,EACNC,GAAM,EAGP,IAAIC,GAAM,SAASC,GAElBA,EAAMA,EAAIC,U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