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Ti4B,EAAa33B,UAAU6gC,mBAAqB,SAA4BzB,GACtE,IAAIE,EAUJ,OARIF,GACFE,EAAMT,EAASA,EAASO,EAAQA,EAC5B1/B,KAAK6/B,QAAQD,IAAMG,EAAW//B,KAAM4/B,KAExC5/B,KAAK6/B,QAAU,IAAIT,EACnBp/B,KAAK8/B,aAAe,GAGf9/B,MAMTi4B,EAAa33B,UAAU65B,IAAMlC,EAAa33B,UAAU2gC,eACpDhJ,EAAa33B,UAAUk/B,YAAcvH,EAAa33B,UAAU05B,GAK5D/B,EAAamJ,SAAWjC,EAKxBlH,EAAaA,aAAeA,EAM1BvyC,EAAOC,QAAUsyC,G,2FC7TnB,IACA,EClBe,SAAkCoJ,GAChD,IAAI94C,EACA6sC,EAASiM,EAAKjM,OAalB,MAXsB,oBAAXA,EACNA,EAAOtsC,WACVP,EAAS6sC,EAAOtsC,YAEhBP,EAAS6sC,EAAO,cAChBA,EAAOtsC,WAAaP,GAGrBA,EAAS,eAGHA,EDEK,CAZO,qBAATN,KACFA,KACoB,qBAAXD,OACTA,OACoB,qBAAX,EAAAD,EACT,EAAAA,EAEArC,I,uGELF,SAASy2C,EAAgBmF,EAAapF,GAG3C,IAFA,IAAIqF,EAAY,KAEPC,EAAM,EAAGC,EAAyBH,EAAYI,YAAaF,EAAMC,EAAuBniC,OAAQkiC,IAAO,CAC9G,IAAIG,EAAaF,EAAuBD,GAExC,GAAIG,EAAWC,OAAS,yBACtB,GAAK1F,GASE,GAAIyF,EAAWj4C,MAAQi4C,EAAWj4C,KAAKmU,QAAUq+B,EACtD,OAAOyF,MAVW,CAIlB,GAAIJ,EACF,OAAO,KAGTA,EAAYI,GAOlB,OAAOJ","sources":["webpack://_N_E/./node_modules/@sushiswap/sushi-data/constants.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/index.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/node_modules/isomorphic-ws/browser.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/bar.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/bentobox.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/blocks.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/charts.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/exchange.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/exchange/eth.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/exchange/factory.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/exchange/pair.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/exchange/token.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/exchange_v1.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/lockup.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/maker.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/masterchef.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/sushi.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/queries/timelock.js","webpack://_N_E/./node_modules/@sushiswap/sushi-data/utils.js","webpack://_N_E/./node_modules/backo2/index.js","webpack://_N_E/./node_modules/date-fns/esm/addDays/index.js","webpack://_N_E/./node_modules/date-fns/esm/addMonths/index.js","webpack://_N_E/./node_modules/date-fns/esm/add/index.js","webpack://_N_E/./node_modules/date-fns/esm/isWeekend/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSunday/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSaturday/index.js","webpack://_N_E/./node_modules/date-fns/esm/addBusinessDays/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfISOWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/getISOWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfISOWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfDay/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInCalendarDays/index.js","webpack://_N_E/./node_modules/date-fns/esm/setISOWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/addISOWeekYears/index.js","webpack://_N_E/./node_modules/date-fns/esm/addMinutes/index.js","webpack://_N_E/./node_modules/date-fns/esm/addQuarters/index.js","webpack://_N_E/./node_modules/date-fns/esm/addSeconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/addWeeks/index.js","webpack://_N_E/./node_modules/date-fns/esm/addYears/index.js","webpack://_N_E/./node_modules/date-fns/esm/areIntervalsOverlapping/index.js","webpack://_N_E/./node_modules/date-fns/esm/max/index.js","webpack://_N_E/./node_modules/date-fns/esm/min/index.js","webpack://_N_E/./node_modules/date-fns/esm/clamp/index.js","webpack://_N_E/./node_modules/date-fns/esm/closestIndexTo/index.js","webpack://_N_E/./node_modules/date-fns/esm/closestTo/index.js","webpack://_N_E/./node_modules/date-fns/esm/compareAsc/index.js","webpack://_N_E/./node_modules/date-fns/esm/compareDesc/index.js","webpack://_N_E/./node_modules/date-fns/esm/constants/index.js","webpack://_N_E/./node_modules/date-fns/esm/daysToWeeks/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSameDay/index.js","webpack://_N_E/./node_modules/date-fns/esm/isDate/index.js","webpack://_N_E/./node_modules/date-fns/esm/isValid/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInBusinessDays/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInCalendarISOWeekYears/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInCalendarISOWeeks/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInCalendarMonths/index.js","webpack://_N_E/./node_modules/date-fns/esm/getQuarter/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInCalendarQuarters/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInCalendarWeeks/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInCalendarYears/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInDays/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInMilliseconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/roundingMethods/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInHours/index.js","webpack://_N_E/./node_modules/date-fns/esm/subISOWeekYears/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInISOWeekYears/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInMinutes/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfDay/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/isLastDayOfMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInMonths/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInQuarters/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInSeconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInWeeks/index.js","webpack://_N_E/./node_modules/date-fns/esm/differenceInYears/index.js","webpack://_N_E/./node_modules/date-fns/esm/eachDayOfInterval/index.js","webpack://_N_E/./node_modules/date-fns/esm/eachHourOfInterval/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfMinute/index.js","webpack://_N_E/./node_modules/date-fns/esm/eachMinuteOfInterval/index.js","webpack://_N_E/./node_modules/date-fns/esm/eachMonthOfInterval/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfQuarter/index.js","webpack://_N_E/./node_modules/date-fns/esm/eachQuarterOfInterval/index.js","webpack://_N_E/./node_modules/date-fns/esm/eachWeekOfInterval/index.js","webpack://_N_E/./node_modules/date-fns/esm/eachWeekendOfInterval/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/eachWeekendOfMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/eachWeekendOfYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/eachYearOfInterval/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfDecade/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfHour/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfISOWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfISOWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfMinute/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfQuarter/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfSecond/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfToday/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfTomorrow/index.js","webpack://_N_E/./node_modules/date-fns/esm/endOfYesterday/index.js","webpack://_N_E/./node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js","webpack://_N_E/./node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js","webpack://_N_E/./node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js","webpack://_N_E/./node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js","webpack://_N_E/./node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js","webpack://_N_E/./node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js","webpack://_N_E/./node_modules/date-fns/esm/locale/en-US/_lib/match/index.js","webpack://_N_E/./node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js","webpack://_N_E/./node_modules/date-fns/esm/locale/en-US/index.js","webpack://_N_E/./node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js","webpack://_N_E/./node_modules/date-fns/esm/subMilliseconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/addLeadingZeros/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/format/lightFormatters/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/getUTCWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/format/formatters/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/format/longFormatters/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/protectedTokens/index.js","webpack://_N_E/./node_modules/date-fns/esm/format/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/assign/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/cloneObject/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatDistance/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatDistanceStrict/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatDistanceToNow/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatDistanceToNowStrict/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatDuration/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatISO/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatISO9075/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatISODuration/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatRFC3339/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatRFC7231/index.js","webpack://_N_E/./node_modules/date-fns/esm/formatRelative/index.js","webpack://_N_E/./node_modules/date-fns/esm/fromUnixTime/index.js","webpack://_N_E/./node_modules/date-fns/esm/getDate/index.js","webpack://_N_E/./node_modules/date-fns/esm/getDay/index.js","webpack://_N_E/./node_modules/date-fns/esm/getDayOfYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/getDaysInMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/isLeapYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/getDaysInYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/getDecade/index.js","webpack://_N_E/./node_modules/date-fns/esm/getHours/index.js","webpack://_N_E/./node_modules/date-fns/esm/getISODay/index.js","webpack://_N_E/./node_modules/date-fns/esm/getISOWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/getISOWeeksInYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/getMilliseconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/getMinutes/index.js","webpack://_N_E/./node_modules/date-fns/esm/getMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/getOverlappingDaysInIntervals/index.js","webpack://_N_E/./node_modules/date-fns/esm/getSeconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/getWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/getWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/getWeekOfMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/lastDayOfMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/getWeeksInMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/getYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/hoursToMilliseconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/hoursToMinutes/index.js","webpack://_N_E/./node_modules/date-fns/esm/hoursToSeconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/subDays/index.js","webpack://_N_E/./node_modules/date-fns/esm/subMonths/index.js","webpack://_N_E/./node_modules/date-fns/esm/sub/index.js","webpack://_N_E/./node_modules/date-fns/esm/intervalToDuration/index.js","webpack://_N_E/./node_modules/date-fns/esm/intlFormat/index.js","webpack://_N_E/./node_modules/date-fns/esm/isAfter/index.js","webpack://_N_E/./node_modules/date-fns/esm/isBefore/index.js","webpack://_N_E/./node_modules/date-fns/esm/isEqual/index.js","webpack://_N_E/./node_modules/date-fns/esm/isExists/index.js","webpack://_N_E/./node_modules/date-fns/esm/isFirstDayOfMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/isFriday/index.js","webpack://_N_E/./node_modules/date-fns/esm/isFuture/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/setUTCDay/index.js","webpack://_N_E/./node_modules/date-fns/esm/parse/_lib/parsers/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/setUTCWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/_lib/setUTCISODay/index.js","webpack://_N_E/./node_modules/date-fns/esm/parse/index.js","webpack://_N_E/./node_modules/date-fns/esm/isMatch/index.js","webpack://_N_E/./node_modules/date-fns/esm/isMonday/index.js","webpack://_N_E/./node_modules/date-fns/esm/isPast/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSameHour/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSameWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSameISOWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSameISOWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSameMinute/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSameMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSameQuarter/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfSecond/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSameSecond/index.js","webpack://_N_E/./node_modules/date-fns/esm/isSameYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/isThisHour/index.js","webpack://_N_E/./node_modules/date-fns/esm/isThisISOWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/isThisMinute/index.js","webpack://_N_E/./node_modules/date-fns/esm/isThisMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/isThisQuarter/index.js","webpack://_N_E/./node_modules/date-fns/esm/isThisSecond/index.js","webpack://_N_E/./node_modules/date-fns/esm/isThisWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/isThisYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/isThursday/index.js","webpack://_N_E/./node_modules/date-fns/esm/isToday/index.js","webpack://_N_E/./node_modules/date-fns/esm/isTomorrow/index.js","webpack://_N_E/./node_modules/date-fns/esm/isTuesday/index.js","webpack://_N_E/./node_modules/date-fns/esm/isWednesday/index.js","webpack://_N_E/./node_modules/date-fns/esm/isWithinInterval/index.js","webpack://_N_E/./node_modules/date-fns/esm/isYesterday/index.js","webpack://_N_E/./node_modules/date-fns/esm/lastDayOfDecade/index.js","webpack://_N_E/./node_modules/date-fns/esm/lastDayOfWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/lastDayOfISOWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/lastDayOfISOWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/lastDayOfQuarter/index.js","webpack://_N_E/./node_modules/date-fns/esm/lastDayOfYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/lightFormat/index.js","webpack://_N_E/./node_modules/date-fns/esm/milliseconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/millisecondsToHours/index.js","webpack://_N_E/./node_modules/date-fns/esm/millisecondsToMinutes/index.js","webpack://_N_E/./node_modules/date-fns/esm/millisecondsToSeconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/minutesToHours/index.js","webpack://_N_E/./node_modules/date-fns/esm/minutesToMilliseconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/minutesToSeconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/monthsToQuarters/index.js","webpack://_N_E/./node_modules/date-fns/esm/monthsToYears/index.js","webpack://_N_E/./node_modules/date-fns/esm/nextDay/index.js","webpack://_N_E/./node_modules/date-fns/esm/nextFriday/index.js","webpack://_N_E/./node_modules/date-fns/esm/nextMonday/index.js","webpack://_N_E/./node_modules/date-fns/esm/nextSaturday/index.js","webpack://_N_E/./node_modules/date-fns/esm/nextSunday/index.js","webpack://_N_E/./node_modules/date-fns/esm/nextThursday/index.js","webpack://_N_E/./node_modules/date-fns/esm/nextTuesday/index.js","webpack://_N_E/./node_modules/date-fns/esm/nextWednesday/index.js","webpack://_N_E/./node_modules/date-fns/esm/parseISO/index.js","webpack://_N_E/./node_modules/date-fns/esm/parseJSON/index.js","webpack://_N_E/./node_modules/date-fns/esm/previousDay/index.js","webpack://_N_E/./node_modules/date-fns/esm/previousFriday/index.js","webpack://_N_E/./node_modules/date-fns/esm/previousMonday/index.js","webpack://_N_E/./node_modules/date-fns/esm/previousSaturday/index.js","webpack://_N_E/./node_modules/date-fns/esm/previousSunday/index.js","webpack://_N_E/./node_modules/date-fns/esm/previousThursday/index.js","webpack://_N_E/./node_modules/date-fns/esm/previousTuesday/index.js","webpack://_N_E/./node_modules/date-fns/esm/previousWednesday/index.js","webpack://_N_E/./node_modules/date-fns/esm/quartersToMonths/index.js","webpack://_N_E/./node_modules/date-fns/esm/quartersToYears/index.js","webpack://_N_E/./node_modules/date-fns/esm/roundToNearestMinutes/index.js","webpack://_N_E/./node_modules/date-fns/esm/secondsToHours/index.js","webpack://_N_E/./node_modules/date-fns/esm/secondsToMilliseconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/secondsToMinutes/index.js","webpack://_N_E/./node_modules/date-fns/esm/setMonth/index.js","webpack://_N_E/./node_modules/date-fns/esm/set/index.js","webpack://_N_E/./node_modules/date-fns/esm/setDate/index.js","webpack://_N_E/./node_modules/date-fns/esm/setDay/index.js","webpack://_N_E/./node_modules/date-fns/esm/setDayOfYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/setHours/index.js","webpack://_N_E/./node_modules/date-fns/esm/setISODay/index.js","webpack://_N_E/./node_modules/date-fns/esm/setISOWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/setMilliseconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/setMinutes/index.js","webpack://_N_E/./node_modules/date-fns/esm/setQuarter/index.js","webpack://_N_E/./node_modules/date-fns/esm/setSeconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/setWeek/index.js","webpack://_N_E/./node_modules/date-fns/esm/setWeekYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/setYear/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfDecade/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfToday/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfTomorrow/index.js","webpack://_N_E/./node_modules/date-fns/esm/startOfYesterday/index.js","webpack://_N_E/./node_modules/date-fns/esm/subBusinessDays/index.js","webpack://_N_E/./node_modules/date-fns/esm/subMinutes/index.js","webpack://_N_E/./node_modules/date-fns/esm/subQuarters/index.js","webpack://_N_E/./node_modules/date-fns/esm/subSeconds/index.js","webpack://_N_E/./node_modules/date-fns/esm/subWeeks/index.js","webpack://_N_E/./node_modules/date-fns/esm/subYears/index.js","webpack://_N_E/./node_modules/date-fns/esm/weeksToDays/index.js","webpack://_N_E/./node_modules/date-fns/esm/yearsToMonths/index.js","webpack://_N_E/./node_modules/date-fns/esm/yearsToQuarters/index.js","webpack://_N_E/./node_modules/graph-results-pager/index.js","webpack://_N_E/./node_modules/graph-results-pager/node_modules/node-fetch/browser.js","webpack://_N_E/./node_modules/subscriptions-transport-ws/dist/client.js","webpack://_N_E/./node_modules/subscriptions-transport-ws/dist/defaults.js","webpack://_N_E/./node_modules/subscriptions-transport-ws/dist/message-types.js","webpack://_N_E/./node_modules/subscriptions-transport-ws/dist/protocol.js","webpack://_N_E/./node_modules/subscriptions-transport-ws/dist/utils/is-object.js","webpack://_N_E/./node_modules/subscriptions-transport-ws/dist/utils/is-string.js","webpack://_N_E/./node_modules/subscriptions-transport-ws/node_modules/eventemitter3/index.js","webpack://_N_E/./node_modules/symbol-observable/es/index.js","webpack://_N_E/./node_modules/symbol-observable/es/ponyfill.js","webpack://_N_E/./node_modules/graphql/utilities/getOperationAST.mjs"],"sourcesContent":["module.exports = {\n graphAPIEndpoints: {\n masterchef: 'https://api.thegraph.com/subgraphs/name/sushiswap/master-chef',\n bar: 'https://api.thegraph.com/subgraphs/name/sushiswap/sushi-bar',\n timelock: 'https://api.thegraph.com/subgraphs/name/sushiswap/sushi-timelock',\n maker: 'https://api.thegraph.com/subgraphs/name/sushiswap/sushi-maker',\n exchange: 'https://api.thegraph.com/subgraphs/name/sushiswap/exchange',\n exchange_v1: 'https://api.thegraph.com/subgraphs/name/jiro-ono/sushiswap-v1-exchange',\n blocklytics: 'https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks',\n lockup: 'https://api.thegraph.com/subgraphs/name/matthewlilley/lockup',\n },\n\n graphWSEndpoints: {\n bar: 'wss://api.thegraph.com/subgraphs/name/sushiswap/sushi-bar',\n exchange: 'wss://api.thegraph.com/subgraphs/name/sushiswap/exchange',\n blocklytics: 'wss://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks'\n },\n\n barAddress: \"0x8798249c2e607446efb7ad49ec89dd1865ff4272\",\n makerAddress: \"0xe11fc0b43ab98eb91e9836129d1ee7c3bc95df50\",\n chefAddress: \"0xc2edad668740f1aa35e4d8f227fb8e17dca888cd\",\n sushiAddress: \"0x6b3595068778dd592e39a122f4f5a5cf09c90fe2\",\n factoryAddress: \"0xc0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac\",\n\n TWENTY_FOUR_HOURS: 86400,\n}\n","'use strict';\n\nconst pageResults = require('graph-results-pager');\n\nconst { Promise } = require('bluebird')\n\nconst { graphAPIEndpoints } = require('./constants')\n\nconst sushi = require('./queries/sushi');\nconst blocks = require('./queries/blocks');\nconst charts = require('./queries/charts');\nconst exchange = require('./queries/exchange');\nconst exchange_v1 = require('./queries/exchange_v1')\nconst masterchef = require('./queries/masterchef');\nconst bar = require('./queries/bar')\nconst maker = require('./queries/maker')\nconst timelock = require('./queries/timelock');\nconst lockup = require('./queries/lockup');\nconst bentobox = require('./queries/bentobox');\nconst utils = require('./utils');\n\nmodule.exports = {\n\tpageResults,\n\tgraphAPIEndpoints,\n\tsushi,\n\tblocks,\n\tcharts,\n\texchange,\n\texchange_v1,\n\tmasterchef,\n\tbar,\n\tmaker,\n\ttimelock,\n\tlockup,\n\tbentobox,\n\tutils,\n\tasync timeseries({blocks = undefined, timestamps = undefined, target = undefined} = {}, targetArguments) {\n\t\tif(!target) { throw new Error(\"sushi-data: Target function undefined\"); }\n\t\tif(!blocks && !timestamps) { throw new Error(\"sushi-data: Timeframe undefined\"); }\n\n\t\tif(blocks) {\n\t\t\treturn Promise.map(blocks, async (block) => ({\n\t\t\t\tblock,\n\t\t\t\tdata: await target({block, ...targetArguments})\n\t\t\t}));\n\t\t}\n\n\t\telse {\n\t\t\treturn Promise.map(timestamps, async (timestamp) => ({\n\t\t\t\ttimestamp,\n\t\t\t\tdata: await target({timestamp, ...targetArguments})\n\t\t\t}));\n\t\t}\n\t},\n};\n","// https://github.com/maxogden/websocket-stream/blob/48dc3ddf943e5ada668c31ccd94e9186f02fafbd/ws-fallback.js\n\nvar ws = null\n\nif (typeof WebSocket !== 'undefined') {\n ws = WebSocket\n} else if (typeof MozWebSocket !== 'undefined') {\n ws = MozWebSocket\n} else if (typeof global !== 'undefined') {\n ws = global.WebSocket || global.MozWebSocket\n} else if (typeof window !== 'undefined') {\n ws = window.WebSocket || window.MozWebSocket\n} else if (typeof self !== 'undefined') {\n ws = self.WebSocket || self.MozWebSocket\n}\n\nmodule.exports = ws\n","const ws = require('isomorphic-ws');\nconst { SubscriptionClient } = require('subscriptions-transport-ws'); \n\nconst { request, gql } = require('graphql-request');\n\nconst { graphAPIEndpoints, graphWSEndpoints, barAddress } = require('./../constants')\nconst { timestampToBlock } = require('./../utils');\n\nmodule.exports = {\n async info({block = undefined, timestamp = undefined} = {}) {\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const result = await request(graphAPIEndpoints.bar,\n gql`{\n bar(id: \"${barAddress}\", ${block}) {\n ${info.properties.toString()}\n }\n }`\n );\n\n return info.callback(result.bar);\n },\n\n observeInfo() {\n const query = gql`\n subscription {\n bar(id: \"${barAddress}\") {\n ${info.properties.toString()}\n }\n }`;\n\n const client = new SubscriptionClient(graphWSEndpoints.bar, { reconnect: true, }, ws,);\n const observable = client.request({ query });\n\n return {\n subscribe({next, error, complete}) {\n return observable.subscribe({\n next(results) {\n next(info.callback(results.data.bar));\n },\n error,\n complete\n });\n }\n };\n },\n\n async user({block = undefined, timestamp = undefined, user_address = undefined} = {}) {\n if(!user_address) { throw new Error(\"sushi-data: User address undefined\"); }\n\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const result = await request(graphAPIEndpoints.bar,\n gql`{\n user(id: \"${user_address.toLowerCase()}\", ${block}) {\n ${user.properties.toString()}\n }\n }`\n );\n\n return user.callback(result.user);\n },\n}\n\nconst info = {\n properties: [\n 'decimals',\n 'name',\n 'sushi',\n 'symbol',\n 'totalSupply',\n 'ratio',\n 'xSushiMinted',\n 'xSushiBurned',\n 'sushiStaked',\n 'sushiStakedUSD',\n 'sushiHarvested',\n 'sushiHarvestedUSD',\n 'xSushiAge',\n 'xSushiAgeDestroyed',\n 'updatedAt'\n ],\n\n callback(results) {\n return ({\n decimals: Number(results.decimals),\n name: results.name,\n sushi: results.sushi,\n symbol: results.symbol,\n totalSupply: Number(results.totalSupply),\n ratio: Number(results.ratio),\n xSushiMinted: Number(results.xSushiMinted),\n xSushiBurned: Number(results.xSushiBurned),\n sushiStaked: Number(results.totalSupply) * Number(results.ratio),\n sushiStakedUSD: Number(results.sushiStakedUSD),\n sushiHarvested: Number(results.sushiHarvested),\n sushiHarvestedUSD: Number(results.sushiHarvestedUSD),\n xSushiAge: Number(results.xSushiAge),\n xSushiAgeDestroyed: Number(results.xSushiAgeDestroyed),\n updatedAt: Number(results.updatedAt)\n })\n }\n};\n\nconst user = {\n properties: [\n 'xSushi',\n 'xSushiIn',\n 'xSushiOut',\n 'xSushiMinted',\n 'xSushiBurned',\n 'xSushiOffset',\n 'xSushiAge',\n 'xSushiAgeDestroyed',\n 'sushiStaked',\n 'sushiStakedUSD',\n 'sushiHarvested',\n 'sushiHarvestedUSD',\n 'sushiIn',\n 'sushiOut',\n 'usdOut',\n 'usdIn',\n 'updatedAt',\n 'sushiOffset',\n 'usdOffset'\n ],\n\n callback(results) {\n return ({\n xSushi: Number(results.xSushi),\n xSushiIn: Number(results.xSushiIn),\n xSushiOut: Number(results.xSushiOut),\n xSushiMinted: Number(results.xSushiMinted),\n xSushiBurned: Number(results.xSushiBurned),\n xSushiOffset: Number(results.xSushiOffset),\n xSushiAge: Number(results.xSushiAge),\n xSushiAgeDestroyed: Number(results.xSushiAgeDestroyed),\n sushiStaked: Number(results.sushiStaked),\n sushiStakedUSD: Number(results.sushiStakedUSD),\n sushiHarvested: Number(results.sushiHarvested),\n sushiHarvestedUSD: Number(results.sushiHarvestedUSD),\n sushiIn: Number(results.sushiIn),\n sushiOut: Number(results.sushiOut),\n usdOut: Number(results.usdOut),\n usdIn: Number(results.usdIn),\n updatedAt: Number(results.updatedAt),\n sushiOffset: Number(results.sushiOffset),\n usdOffset: Number(results.usdOffset)\n })\n }\n};","const pageResults = require('graph-results-pager')\n\nconst { request, gql } = require('graphql-request')\n\nconst { priceUSD: sushiPriceUSD } = require('./sushi')\nconst { token: tokenInfo } = require('./exchange')\nconst { ethPrice: ethPriceUSD } = require('./exchange')\nconst { info: masterChefInfo } = require('./masterchef')\nconst { pool: chefPool } = require('./masterchef')\nconst { pools: chefPools } = require('./masterchef')\n\n// accessed by chainId\nconst ENDPOINTS = {\n 1: 'https://api.thegraph.com/subgraphs/name/sushiswap/bentobox',\n 250: 'https://api.thegraph.com/subgraphs/name/sushiswap/fantom-bentobox',\n 56: 'https://api.thegraph.com/subgraphs/name/sushiswap/bsc-bentobox',\n 137: 'https://api.thegraph.com/subgraphs/name/sushiswap/matic-bentobox',\n 100: 'https://api.thegraph.com/subgraphs/name/sushiswap/xdai-bentobox',\n}\n\nconst MASTER_CONTRACT = '0x2cba6ab6574646badc84f0544d05059e57a5dc42'\n\nmodule.exports = {\n async clones({ masterAddress = undefined, chainId = undefined } = {}) {\n if(!masterAddress) { throw new Error(\"sushi-data: Master Address undefined\"); }\n if(!chainId) { throw new Error(\"sushi-data: Chain Id undefined\"); }\n\n return pageResults({\n api: ENDPOINTS[chainId],\n query: {\n entity: 'clones',\n selection: {\n where: {\n masterContract: `\\\\\"${masterAddress.toLowerCase()}\\\\\"`\n }\n },\n properties: clones.properties\n }\n })\n .then(results => clones.callback(results))\n .catch(err => console.log(err));\n },\n\n async kashiStakedInfo() {\n const results = await pageResults({\n api: ENDPOINTS[1],\n query: {\n entity: 'kashiPairs',\n properties: kashiStakedInfo.properties\n }\n })\n\n let result = {}\n result.sushiUSD = await sushiPriceUSD();\n result.ethUSD = await ethPriceUSD();\n\n let masterChef = await masterChefInfo();\n result.totalAP = masterChef.totalAllocPoint;\n result.sushiPerBlock = masterChef.sushiPerBlock;\n\n let pools = await chefPools();\n let onsen_pools = pools.map(pool => pool.pair)\n let filtered_results = results.filter(pair => onsen_pools.includes(pair.id))\n result.kashiPairs = filtered_results\n\n return kashiStakedInfo.callback(result)\n },\n\n}\n\nconst clones = {\n properties: [\n 'id',\n 'data'\n ],\n\n callback(results) {\n return results.map(({ id, data, block, timestamp }) => ({\n address: id,\n data: data\n }));\n }\n}\n\nconst kashiStakedInfo = {\n properties: [\n 'id',\n 'name',\n 'symbol',\n 'asset { id, symbol, decimals }',\n 'collateral { id, symbol, decimals }',\n 'totalAssetBase',\n 'totalAssetElastic'\n ],\n\n async callback(results) {\n return await Promise.all(results.kashiPairs.map(async (result) => {\n let asset = await tokenInfo({ token_address: result.asset.id });\n let assetPool = await chefPool({ pool_address: result.id });\n if (assetPool === undefined) { return }\n let stakedAmt = assetPool.slpBalance * 1e18;\n let balanceUSD = (stakedAmt * asset.derivedETH * results.ethUSD) / (10 ** result.asset.decimals);\n let rewardPerBlock = ((1 / results.totalAP) * results.sushiPerBlock);\n let roiPerBlock = (rewardPerBlock * results.sushiUSD) / balanceUSD;\n let roiPerYear = roiPerBlock * 6500 * 365\n\n return {\n id: result.id,\n name: result.name,\n symbol: result.symbol,\n asset: result.asset.id,\n assetSymbol: result.asset.symbol,\n assetDecimals: Number(result.asset.decimals),\n collateral: result.collateral.id,\n collateralSymbol: result.collateral.symbol,\n collateralDecimals: Number(result.collateral.decimals),\n totalAssetBase: Number(result.totalAssetBase),\n totalAssetElastic: Number(result.totalAssetElastic),\n totalAssetStaked: Number(stakedAmt),\n assetDecimals: Number(result.asset.decimals),\n balanceUSD: balanceUSD,\n rewardPerBlock: rewardPerBlock,\n roiPerBlock: roiPerBlock,\n roiPerYear: roiPerYear\n }\n }));\n }\n}\n","const ws = require('isomorphic-ws');\nconst { SubscriptionClient } = require('subscriptions-transport-ws'); \n\nconst { request, gql } = require('graphql-request');\n\nconst { graphAPIEndpoints, graphWSEndpoints } = require('./../constants')\nconst { timestampToBlock } = require('./../utils')\n\nmodule.exports = {\n async latestBlock() {\n const result = await request(graphAPIEndpoints.blocklytics,\n gql`{\n blocks(first: 1, orderBy: number, orderDirection: desc) {\n ${latestBlock.properties.toString()}\n }\n }`\n );\n\n return latestBlock.callback(result.blocks);\n },\n\n observeLatestBlock() {\n const query = gql`\n subscription {\n blocks(first: 1, orderBy: number, orderDirection: desc) {\n ${latestBlock.properties.toString()}\n }\n }`;\n\n const client = new SubscriptionClient(graphWSEndpoints.blocklytics, { reconnect: true, }, ws,);\n const observable = client.request({ query });\n\n return {\n subscribe({next, error, complete}) {\n return observable.subscribe({\n next(results) {\n next(latestBlock.callback(results.data.blocks));\n },\n error,\n complete\n })\n }\n };\n },\n\n async getBlock({block = undefined, timestamp = undefined} = {}) {\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const result = await request(graphAPIEndpoints.blocklytics,\n gql`{\n blocks(first: 1, orderBy: number, orderDirection: desc, ${block}) {\n ${getBlock.properties.toString()}\n }\n }`\n );\n\n return getBlock.callback(result.blocks[0]);\n }\n}\n\nconst latestBlock = {\n properties: [\n 'id',\n 'number',\n 'timestamp'\n ],\n\n callback([{ id, number, timestamp }]) {\n return ({\n id: id,\n number: Number(number),\n timestamp: Number(timestamp),\n date: new Date(timestamp * 1000)\n });\n }\n};\n\nconst getBlock = {\n properties: [\n 'id',\n 'number',\n 'timestamp',\n 'author',\n 'difficulty',\n 'gasUsed',\n 'gasLimit'\n ],\n\n callback(results) {\n return ({\n id: results.id,\n number: Number(results.number),\n timestamp: Number(results.timestamp),\n author: results.author,\n difficulty: Number(results.difficulty),\n gasUsed: Number(results.gasUsed),\n gasLimit: Number(results.gasLimit)\n })\n }\n}","const {\n getWeek,\n subWeeks,\n subYears,\n startOfMinute,\n getUnixTime\n} = require(\"date-fns\");\n\nconst { TWENTY_FOUR_HOURS } = require('./../constants');\nconst { dayData, tokenHourData, tokenDayData, pairHourData, pairDayData, ethPriceHourly } = require('./exchange');\n\nmodule.exports = {\n async factory() {\n let data = await dayData();\n let weeklyData = [];\n\n let startIndexWeekly = -1;\n let currentWeek = -1;\n\n data.forEach((entry, i) => {\n const week = getWeek(data[i].date)\n\n if (week !== currentWeek) {\n currentWeek = week;\n startIndexWeekly++;\n }\n\n weeklyData[startIndexWeekly] = weeklyData[startIndexWeekly] || {};\n weeklyData[startIndexWeekly].date = data[i].date;\n weeklyData[startIndexWeekly].weeklyVolumeUSD = ((\n weeklyData[startIndexWeekly].weeklyVolumeUSD ? \n weeklyData[startIndexWeekly].weeklyVolumeUSD : 0) + data[i].volumeUSD\n );\n });\n\n return [data, weeklyData];\n },\n\n async tokenHourly({token_address = undefined, startTime = undefined}) {\n if(!token_address) { throw new Error(\"sushi-data: Token address undefined\"); }\n\n let [tokenData, ethPrices] = await Promise.all([\n tokenHourData({minTimestamp: startTime, token_address}),\n ethPriceHourly({minTimestamp: startTime})]);\n\n tokenData = tokenData.map(tokenEntry => {\n const ethPriceUSD = ethPrices.find(ethEntry => ethEntry.timestamp === tokenEntry.timestamp).priceUSD;\n return ({\n ...tokenEntry,\n priceUSD: tokenEntry.derivedETH * ethPriceUSD,\n })});\n\n tokenData = tokenData.map((tokenEntry, i) => ({\n ...tokenEntry,\n volume: tokenData[i-1] ? tokenEntry.volume - tokenData[i-1].volume : undefined,\n volumeUSD: tokenData[i-1] ? tokenEntry.volumeUSD - tokenData[i-1].volumeUSD : undefined,\n untrackedVolumeUSD: tokenData[i-1] ? tokenEntry.untrackedVolumeUSD - tokenData[i-1].untrackedVolumeUSD : undefined,\n\n txCount: tokenData[i-1] ? tokenEntry.txCount - tokenData[i-1].txCount : undefined,\n\n open: tokenEntry.priceUSD,\n close: tokenData[i+1] ? tokenData[i+1].priceUSD : undefined,\n }));\n\n return tokenData;\n },\n\n async tokenDaily({token_address = undefined} = {}) {\n if(!token_address) { throw new Error(\"sushi-data: Token address undefined\"); }\n \n let data = await tokenDayData({token_address});\n const endTime = getUnixTime(new Date());\n const startTime = getUnixTime(startOfMinute(subYears(new Date(), 1)));\n\n let dayIndexSet = new Set();\n let dayIndexArray = [];\n\n data.forEach((dayData, i) => {\n // add the day index to the set of days\n dayIndexSet.add((data[i].timestamp / TWENTY_FOUR_HOURS).toFixed(0));\n dayIndexArray.push(data[i]);\n });\n\n // fill in empty days\n let timestamp = data[0] && data[0].timestamp ? data[0].timestamp : startTime;\n let latestLiquidity = data[0] && data[0].liquidity;\n let latestLiquidityUSD = data[0] && data[0].liquidityUSD;\n let latestLiquidityETH = data[0] && data[0].liquidityETH;\n let latestPriceUSD = data[0] && data[0].priceUSD;\n let index = 1;\n\n while (timestamp < endTime - TWENTY_FOUR_HOURS) {\n const nextDay = timestamp + TWENTY_FOUR_HOURS;\n let currentDayIndex = (nextDay / TWENTY_FOUR_HOURS).toFixed(0);\n if (!dayIndexSet.has(currentDayIndex)) {\n data.push({\n id: `${data[0].id.split(\"-\")[0]}-${nextDay / TWENTY_FOUR_HOURS}`,\n date: new Date(nextDay * 1000),\n timestamp: nextDay,\n volume: 0,\n volumeETH: 0,\n volumeUSD: 0,\n liquidity: latestLiquidity,\n liquidityETH: latestLiquidityETH,\n liquidityUSD: latestLiquidityUSD,\n priceUSD: latestPriceUSD,\n txCount: 0\n });\n } else {\n latestLiquidity = dayIndexArray[index].liquidity;\n latestLiquidityETH = dayIndexArray[index].liquidityETH;\n latestLiquidityUSD = dayIndexArray[index].liquidityUSD;\n\n latestPriceUSD = dayIndexArray[index].priceUSD;\n index = index + 1;\n }\n timestamp = nextDay;\n }\n \n data = data.sort((a, b) => (parseInt(a.timestamp) > parseInt(b.timestamp) ? 1 : -1));\n\n return data;\n },\n\n async pairHourly({pair_address = undefined, startTime = undefined}) {\n if(!pair_address) { throw new Error(\"sushi-data: Pair address undefined\"); }\n\n let pairData = await pairHourData({minTimestamp: startTime, pair_address});\n\n pairData = pairData.map((pairEntry, i) => ({\n ...pairEntry,\n volumeToken0: pairData[i-1] ? pairEntry.volumeToken0 - pairData[i-1].volumeToken0 : undefined,\n volumeToken1: pairData[i-1] ? pairEntry.volumeToken1 - pairData[i-1].volumeToken1 : undefined,\n\n rate0: {\n open: pairEntry.token0Price,\n close: pairData[i+1] ? pairData[i+1].token0Price : undefined,\n },\n\n rate1: {\n open: pairEntry.token1Price,\n close: pairData[i+1] ? pairData[i+1].token1Price : undefined,\n },\n\n txCount: pairData[i-1] ? pairEntry.txCount - pairData[i-1].txCount : undefined,\n }));\n\n return pairData;\n },\n\n async pairDaily({pair_address = undefined} = {}) {\n if(!pair_address) { throw new Error(\"sushi-data: Pair address undefined\"); }\n\n let data = await pairDayData({pair_address});\n const endTime = getUnixTime(new Date());\n const startTime = getUnixTime(startOfMinute(subYears(new Date(), 1)));\n \n let dayIndexSet = new Set();\n let dayIndexArray = [];\n\n data.forEach((dayData, i) => {\n // add the day index to the set of days\n dayIndexSet.add((data[i].timestamp / TWENTY_FOUR_HOURS).toFixed(0));\n dayIndexArray.push(data[i]);\n });\n \n let timestamp = data[0].timestamp ? data[0].timestamp : startTime;\n let latestLiquidityUSD = data[0].liquidityUSD;\n let index = 1;\n\n while (timestamp < endTime - TWENTY_FOUR_HOURS) {\n const nextDay = timestamp + TWENTY_FOUR_HOURS;\n let currentDayIndex = (nextDay / TWENTY_FOUR_HOURS).toFixed(0);\n if (!dayIndexSet.has(currentDayIndex)) {\n data.push({\n id: `${data[0].id.split(\"-\")[0]}-${nextDay / TWENTY_FOUR_HOURS}`,\n date: new Date(nextDay * 1000),\n timestamp: nextDay,\n volumeUSD: 0,\n volumeToken0: 0,\n volumeToken1: 0,\n liquidityUSD: latestLiquidityUSD,\n txCount: 0\n });\n } else {\n latestLiquidityUSD = dayIndexArray[index].liquidityUSD;\n\n index = index + 1;\n }\n timestamp = nextDay;\n }\n\n data = data.sort((a, b) => (parseInt(a.timestamp) > parseInt(b.timestamp) ? 1 : -1));\n\n return data;\n }\n}","const token = require('./exchange/token');\nconst pair = require('./exchange/pair');\nconst factory = require('./exchange/factory');\nconst eth = require('./exchange/eth');\n\nmodule.exports = {\n ...token,\n ...pair,\n ...factory,\n ...eth,\n}","const ws = require('isomorphic-ws');\nconst { SubscriptionClient } = require('subscriptions-transport-ws'); \n\nconst { request, gql } = require('graphql-request');\n\nconst {\n subWeeks,\n getUnixTime,\n fromUnixTime\n} = require(\"date-fns\");\n\nconst { graphAPIEndpoints, graphWSEndpoints } = require('./../../constants')\nconst { timestampToBlock, timestampsToBlocks } = require('./../../utils');\n\nmodule.exports = {\n async ethPrice({block = undefined, timestamp = undefined} = {}) {\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const result = await request(graphAPIEndpoints.exchange,\n gql`{\n bundle(id: 1, ${block}) {\n ${ethPrice.properties.toString()}\n }\n }`\n );\n\n return ethPrice.callback(result.bundle);\n },\n\n async ethPriceHourly({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined} = {}) {\n minTimestamp = minBlock ? blockToTimestamp(minBlock) : minTimestamp;\n maxTimestamp = maxBlock ? blockToTimestamp(maxBlock) : maxTimestamp;\n\n const endTime = maxTimestamp ? fromUnixTime(maxTimestamp) : new Date();\n let time = minTimestamp ? minTimestamp : getUnixTime(subWeeks(endTime, 1));\n\n // create an array of hour start times until we reach current hour\n const timestamps = [];\n while (time <= getUnixTime(endTime) - 3600) {\n timestamps.push(time);\n time += 3600;\n }\n\n let blocks = await timestampsToBlocks(timestamps);\n\n const query = (\n gql`{\n ${blocks.map((block, i) => (gql`\n timestamp${timestamps[i]}: bundle(id: 1, block: {number: ${block}}) {\n ${ethPrice.properties.toString()}\n }`))}\n }`\n );\n\n let result = await request(graphAPIEndpoints.exchange, query)\n\n result = Object.keys(result)\n .map(key => ({...result[key], timestamp: key.split(\"timestamp\")[1]}))\n .sort((a, b) => Number(a.timestamp) - (b.timestamp));\n\n return ethPrice.callbackHourly(result);\n },\n\n observeEthPrice() {\n const query = gql`\n subscription {\n bundle(id: 1) {\n ${ethPrice.properties.toString()}\n }\n }`;\n\n const client = new SubscriptionClient(graphWSEndpoints.exchange, { reconnect: true, }, ws,);\n const observable = client.request({ query });\n\n return {\n subscribe({next, error, complete}) {\n return observable.subscribe({\n next(results) {\n next(ethPrice.callback(results.data.bundle));\n },\n error,\n complete\n });\n }\n };\n },\n}\n\n\nconst ethPrice = {\n properties: [\n 'ethPrice'\n ],\n\n callback(results) {\n return Number(results.ethPrice);\n },\n\n callbackHourly(results) {\n return results.map(result => ({\n timestamp: Number(result.timestamp),\n priceUSD: Number(result.ethPrice)\n }))\n }\n}","const pageResults = require('graph-results-pager');\n\nconst ws = require('isomorphic-ws');\nconst { SubscriptionClient } = require('subscriptions-transport-ws'); \n\nconst { request, gql } = require('graphql-request');\n\nconst { graphAPIEndpoints, graphWSEndpoints, factoryAddress, TWENTY_FOUR_HOURS } = require('./../../constants')\nconst { timestampToBlock, blockToTimestamp } = require('./../../utils');\n\nmodule.exports = {\n async factory({block = undefined, timestamp = undefined} = {}) {\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const result = await request(graphAPIEndpoints.exchange,\n gql`{\n factory(id: \"${factoryAddress}\", ${block}) {\n ${factory.properties.toString()}\n }\n }`\n );\n\n return factory.callback(result.factory);\n },\n\n observeFactory() {\n const query = gql`\n subscription {\n factory(id: \"${factoryAddress}\") {\n ${factory.properties.toString()}\n }\n }`;\n\n const client = new SubscriptionClient(graphWSEndpoints.exchange, { reconnect: true, }, ws,);\n const observable = client.request({ query });\n\n return {\n subscribe({next, error, complete}) {\n return observable.subscribe({\n next(results) {\n next(factory.callback(results.data.factory));\n },\n error,\n complete\n });\n }\n };\n },\n\n async dayData({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.exchange,\n query: {\n entity: 'dayDatas',\n selection: {\n orderDirection: 'desc',\n where: {\n date_gte: minTimestamp || (minBlock ? await blockToTimestamp(minBlock) : undefined),\n date_lte: maxTimestamp || (maxBlock ? await blockToTimestamp(maxBlock) : undefined),\n },\n },\n properties: dayData.properties\n }\n })\n .then(results => dayData.callback(results))\n .catch(err => console.log(err));\n },\n\n async twentyFourHourData({block = undefined, timestamp = undefined} = {}) {\n timestamp = timestamp ? timestamp : block ? await blockToTimestamp(block) : (Date.now() / 1000)\n timestamp24ago = timestamp - TWENTY_FOUR_HOURS;\n\n block = await timestampToBlock(timestamp);\n block24ago = await timestampToBlock(timestamp24ago);\n\n block = `block: { number: ${block} }`;\n block24ago = `block: { number: ${block24ago} }`;\n\n const result = await request(graphAPIEndpoints.exchange,\n gql`{\n factory(id: \"${factoryAddress}\", ${block}) {\n ${twentyFourHourData.properties.toString()}\n }\n }`\n );\n\n const result24ago = await request(graphAPIEndpoints.exchange,\n gql`{\n factory(id: \"${factoryAddress}\", ${block24ago}) {\n ${twentyFourHourData.properties.toString()}\n }\n }`\n );\n\n return twentyFourHourData.callback(result.factory, result24ago.factory);\n }\n};\n\nconst factory = {\n properties: [\n 'pairCount',\n 'volumeUSD',\n 'volumeETH',\n 'untrackedVolumeUSD',\n 'liquidityUSD',\n 'liquidityETH',\n 'txCount',\n 'tokenCount',\n 'userCount',\n ],\n\n callback(results) {\n return ({\n pairCount: Number(results.pairCount),\n\t\t\tvolumeUSD: Number(results.volumeUSD),\n\t\t\tvolumeETH: Number(results.volumeETH),\n\t\t\tuntrackedVolumeUSD: Number(results.untrackedVolumeUSD),\n\t\t\tliquidityUSD: Number(results.liquidityUSD),\n\t\t\tliquidityETH: Number(results.liquidityETH),\n\t\t\ttxCount: Number(results.txCount),\n\t\t\ttokenCount: Number(results.tokenCount),\n\t\t\tuserCount: Number(results.userCount),\n });\n }\n};\n\nconst dayData = {\n properties: [\n 'id',\n 'date',\n 'volumeETH',\n 'volumeUSD',\n 'liquidityETH',\n 'liquidityUSD',\n 'txCount'\n ],\n\n callback(results) {\n return results.map(({ id, date, volumeETH, volumeUSD, liquidityETH, liquidityUSD, txCount }) => ({\n id: Number(id),\n date: new Date(date * 1000),\n volumeETH: Number(volumeETH),\n volumeUSD: Number(volumeUSD),\n liquidityETH: Number(liquidityETH),\n liquidityUSD: Number(liquidityUSD),\n txCount: Number(txCount),\n }));\n }\n};\n\nconst twentyFourHourData = {\n properties: [\n 'id',\n 'volumeUSD',\n 'volumeETH',\n 'untrackedVolumeUSD',\n 'liquidityUSD',\n 'liquidityETH',\n 'txCount',\n 'pairCount'\n ],\n\n callback(results, results24ago) {\n return ({\n id: results.id,\n volumeUSD: Number(results.volumeUSD) - Number(results24ago.volumeUSD),\n volumeETH: Number(results.volumeETH) - Number(results24ago.volumeETH),\n untrackedVolumeUSD: Number(results.untrackedVolumeUSD) - Number(results24ago.untrackedVolumeUSD),\n liquidityETH: Number(results.liquidityETH) - Number(results24ago.liquidityETH),\n liquidityUSD: Number(results.liquidityUSD) - Number(results24ago.liquidityUSD),\n txCount: Number(results.txCount) - Number(results24ago.txCount),\n pairCount: Number(results.pairCount) - Number(results24ago.pairCount)\n })\n }\n}\n","const pageResults = require('graph-results-pager');\n\nconst ws = require('isomorphic-ws');\nconst { SubscriptionClient } = require('subscriptions-transport-ws'); \n\nconst { request, gql } = require('graphql-request');\n\nconst {\n subWeeks,\n getUnixTime,\n fromUnixTime\n} = require(\"date-fns\");\n\nconst { graphAPIEndpoints, graphWSEndpoints, TWENTY_FOUR_HOURS } = require('./../../constants')\nconst { timestampToBlock, timestampsToBlocks, blockToTimestamp } = require('./../../utils');\n\nconst { ethPrice } = require('./../exchange/eth');\n\nmodule.exports = {\n async pair({block = undefined, timestamp = undefined, pair_address = undefined} = {}) {\n if(!pair_address) { throw new Error(\"sushi-data: Pair address undefined\"); }\n\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const result = await request(graphAPIEndpoints.exchange,\n gql`{\n pair(id: \"${pair_address.toLowerCase()}\", ${block}) {\n ${pairs.properties.toString()}\n }\n }`\n );\n\n return pairs.callback([result.pair])[0];\n },\n\n async pair24h({block = undefined, timestamp = undefined, pair_address = undefined} = {}) {\n if(!pair_address) { throw new Error(\"sushi-data: Pair address undefined\"); }\n \n let timestampNow = timestamp ? timestamp : block ? await blockToTimestamp(block) : (Math.floor(Date.now() / 1000));\n timestamp24ago = timestampNow - TWENTY_FOUR_HOURS;\n timestamp48ago = timestamp24ago - TWENTY_FOUR_HOURS;\n\n block = timestamp ? await timestampToBlock(timestamp) : block;\n block24ago = await timestampToBlock(timestamp24ago);\n block48ago = await timestampToBlock(timestamp48ago);\n\n const result = await module.exports.pair({block: block, pair_address});\n const result24ago = await module.exports.pair({block: block24ago, pair_address});\n const result48ago = await module.exports.pair({block: block48ago, pair_address});\n\n const ethPriceUSD = await ethPrice({block: block});\n const ethPriceUSD24ago = await ethPrice({block: block24ago});\n\n return pairs.callback24h([result], [result24ago], [result48ago], ethPriceUSD, ethPriceUSD24ago)[0];\n },\n\n async pairHourData({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined, pair_address = undefined} = {}) {\n if(!pair_address) { throw new Error(\"sushi-data: Pair address undefined\"); }\n \n minTimestamp = minBlock ? blockToTimestamp(minBlock) : minTimestamp;\n maxTimestamp = maxBlock ? blockToTimestamp(maxBlock) : maxTimestamp;\n\n const endTime = maxTimestamp ? fromUnixTime(maxTimestamp) : new Date();\n let time = minTimestamp ? minTimestamp : getUnixTime(subWeeks(endTime, 1));\n\n // create an array of hour start times until we reach current hour\n const timestamps = [];\n while (time <= getUnixTime(endTime) - 3600) {\n timestamps.push(time);\n time += 3600;\n }\n\n let blocks = await timestampsToBlocks(timestamps);\n\n const query = (\n gql`{\n ${blocks.map((block, i) => (gql`\n timestamp${timestamps[i]}: pair(id: \"${pair_address.toLowerCase()}\", block: {number: ${block}}) {\n ${pairs.properties.toString()}\n }`))}\n }`\n );\n\n let result = await request(graphAPIEndpoints.exchange, query)\n result = Object.keys(result)\n .map(key => ({...result[key], timestamp: Number(key.split(\"timestamp\")[1])}))\n .sort((a, b) => (a.timestamp) - (b.timestamp));\n\n return pairs.callbackHourData(result);\n },\n\n async pairDayData({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined, pair_address = undefined} = {}) {\n if(!pair_address) { throw new Error(\"sushi-data: Pair address undefined\"); }\n \n return pageResults({\n api: graphAPIEndpoints.exchange,\n query: {\n entity: 'pairDayDatas',\n selection: {\n orderDirection: 'desc',\n where: {\n pair: `\\\\\"${pair_address.toLowerCase()}\\\\\"`,\n date_gte: minTimestamp || (minBlock ? await blockToTimestamp(minBlock) : undefined),\n date_lte: maxTimestamp || (maxBlock ? await blockToTimestamp(maxBlock) : undefined),\n },\n },\n properties: pairs.propertiesDayData\n }\n })\n .then(results => pairs.callbackDayData(results))\n .catch(err => console.log(err));\n },\n\n observePair({pair_address = undefined}) {\n if(!pair_address) { throw new Error(\"sushi-data: Pair address undefined\"); }\n\n const query = gql`\n subscription {\n pair(id: \"${pair_address.toLowerCase()}\") {\n ${pairs.properties.toString()}\n }\n }`\n\n const client = new SubscriptionClient(graphWSEndpoints.exchange, { reconnect: true, }, ws,);\n const observable = client.request({ query });\n\n return {\n subscribe({next, error, complete}) {\n return observable.subscribe({\n next(results) {\n next(pairs.callback([results.data.pair])[0]);\n },\n error,\n complete\n });\n }\n };\n },\n\n async pairs({block = undefined, timestamp = undefined, max = undefined, pair_addresses = undefined} = {}) {\n if(pair_addresses) {\n \n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const query = (\n gql`{\n ${pair_addresses.map((pair, i) => (`\n pair${i}: pair(id: \"${pair.toLowerCase()}\", ${block}) {\n ${pairs.properties.toString()}\n }`))}\n }`\n );\n\n const result = Object.values(await request(graphAPIEndpoints.exchange, query));\n\n return pairs.callback(result);\n }\n \n return pageResults({\n api: graphAPIEndpoints.exchange,\n query: {\n entity: 'pairs',\n selection: {\n block: block ? { number: block } : timestamp ? { number: await timestampToBlock(timestamp) } : undefined,\n },\n properties: pairs.properties\n },\n max\n })\n .then(results => pairs.callback(results))\n .catch(err => console.log(err));\n },\n\n async pairs24h({block = undefined, timestamp = undefined, max = undefined} = {}) {\n let timestampNow = timestamp ? timestamp : block ? await blockToTimestamp(block) : (Math.floor(Date.now() / 1000));\n timestamp24ago = timestampNow - TWENTY_FOUR_HOURS;\n timestamp48ago = timestamp24ago - TWENTY_FOUR_HOURS;\n\n block = timestamp ? await timestampToBlock(timestamp) : block;\n block24ago = await timestampToBlock(timestamp24ago);\n block48ago = await timestampToBlock(timestamp48ago);\n\n const results = await module.exports.pairs({block: block, max});\n const results24ago = await module.exports.pairs({block: block24ago, max});\n const results48ago = await module.exports.pairs({block: block48ago, max});\n\n const ethPriceUSD = await ethPrice({block: block});\n const ethPriceUSD24ago = await ethPrice({block: block24ago});\n\n return pairs.callback24h(results, results24ago, results48ago, ethPriceUSD, ethPriceUSD24ago);\n },\n\n observePairs() {\n const query = gql`\n subscription {\n pairs(first: 1000, orderBy: reserveUSD, orderDirection: desc) {\n ${pairs.properties.toString()}\n }\n }`;\n\n const client = new SubscriptionClient(graphWSEndpoints.exchange, { reconnect: true, }, ws,);\n const observable = client.request({ query });\n\n return {\n subscribe({next, error, complete}) {\n return observable.subscribe({\n next(results) {\n next(pairs.callback(results.data.pairs));\n },\n error,\n complete\n });\n }\n };\n }\n};\n\n\nconst pairs = {\n properties: [\n 'id',\n 'token0 { id, name, symbol, totalSupply, derivedETH }',\n 'token1 { id, name, symbol, totalSupply, derivedETH }',\n 'reserve0',\n 'reserve1',\n 'totalSupply',\n 'reserveETH',\n 'reserveUSD',\n 'trackedReserveETH',\n 'token0Price',\n 'token1Price',\n 'volumeToken0',\n 'volumeToken1',\n 'volumeUSD',\n 'untrackedVolumeUSD',\n 'txCount',\n ],\n\n callback(results) {\n return results\n .map(result => ({\n id: result.id,\n token0: { \n id: result.token0.id,\n name: result.token0.name,\n symbol: result.token0.symbol,\n totalSupply: Number(result.token0.totalSupply),\n derivedETH: Number(result.token0.derivedETH),\n },\n token1: { \n id: result.token1.id,\n name: result.token1.name,\n symbol: result.token1.symbol,\n totalSupply: Number(result.token1.totalSupply),\n derivedETH: Number(result.token1.derivedETH),\n },\n reserve0: Number(result.reserve0),\n reserve1: Number(result.reserve1),\n totalSupply: Number(result.totalSupply),\n reserveETH: Number(result.reserveETH),\n reserveUSD: Number(result.reserveUSD),\n trackedReserveETH: Number(result.trackedReserveETH),\n token0Price: Number(result.token0Price),\n token1Price: Number(result.token1Price),\n volumeToken0: Number(result.volumeToken0),\n volumeToken1: Number(result.volumeToken1),\n volumeUSD: Number(result.volumeUSD),\n untrackedVolumeUSD: Number(result.untrackedVolumeUSD),\n txCount: Number(result.txCount),\n }))\n .sort((a, b) => b.reserveUSD - a.reserveUSD); \n },\n\n callback24h(results, results24h, results48h, ethPriceUSD, ethPriceUSD24ago) {\n return results.map(result => {\n const result24h = results24h.find(e => e.id === result.id) || result;\n const result48h = results48h.find(e => e.id === result.id) || result;\n\n return ({\n ...result,\n \n trackedReserveUSD: result.trackedReserveETH * ethPriceUSD,\n trackedReserveUSDChange: (result.trackedReserveETH * ethPriceUSD) / (result24h.trackedReserveETH * ethPriceUSD24ago) * 100 - 100,\n trackedReserveUSDChangeCount: result.trackedReserveETH * ethPriceUSD - result24h.trackedReserveETH* ethPriceUSD24ago,\n\n trackedReserveETHChange: (result.trackedReserveETH / result24h.trackedReserveETH) * 100 - 100,\n trackedReserveETHChangeCount: result.trackedReserveETH - result24h.trackedReserveETH,\n\n volumeUSDOneDay: result.volumeUSD - result24h.volumeUSD,\n volumeUSDChange: (result.volumeUSD - result24h.volumeUSD) / (result24h.volumeUSD - result48h.volumeUSD) * 100 - 100,\n volumeUSDChangeCount: (result.volumeUSD - result24h.volumeUSD) - (result24h.volumeUSD - result48h.volumeUSD),\n \n untrackedVolumeUSDOneDay: result.untrackedVolumeUSD - result24h.untrackedVolumeUSD,\n untrackedVolumeUSDChange: (result.untrackedVolumeUSD - result24h.untrackedVolumeUSD) / (result24h.untrackedVolumeUSD - result48h.untrackedVolumeUSD) * 100 - 100,\n untrackedVolumeUSDChangeCount: (result.untrackedVolumeUSD - result24h.untrackedVolumeUSD) - (result24h.untrackedVolumeUSD - result48h.untrackedVolumeUSD),\n\n txCountOneDay: result.txCount - result24h.txCount,\n txCountChange: (result.txCount - result24h.txCount) / (result24h.txCount - result48h.txCount) * 100 - 100,\n txCountChangeCount: (result.txCount - result24h.txCount) - (result24h.txCount - result48h.txCount),\n })});\n },\n\n callbackHourData(results) {\n return results.map(result => ({\n id: result.id,\n token0: { \n id: result.token0.id,\n name: result.token0.name,\n symbol: result.token0.symbol,\n totalSupply: Number(result.token0.totalSupply),\n derivedETH: Number(result.token0.derivedETH),\n },\n token1: { \n id: result.token1.id,\n name: result.token1.name,\n symbol: result.token1.symbol,\n totalSupply: Number(result.token1.totalSupply),\n derivedETH: Number(result.token1.derivedETH),\n },\n reserve0: Number(result.reserve0),\n reserve1: Number(result.reserve1),\n totalSupply: Number(result.totalSupply),\n reserveETH: Number(result.reserveETH),\n reserveUSD: Number(result.reserveUSD),\n trackedReserveETH: Number(result.trackedReserveETH),\n token0Price: Number(result.token0Price),\n token1Price: Number(result.token1Price),\n volumeToken0: Number(result.volumeToken0),\n volumeToken1: Number(result.volumeToken1),\n volumeUSD: Number(result.volumeUSD),\n untrackedVolumeUSD: Number(result.untrackedVolumeUSD),\n txCount: Number(result.txCount),\n timestamp: result.timestamp\n }));\n },\n\n propertiesDayData: [\n 'id',\n 'date',\n 'volumeUSD',\n 'volumeToken0',\n 'volumeToken1',\n 'reserveUSD',\n 'txCount'\n ],\n\n callbackDayData(results) {\n return results.map(result => ({\n id: result.id,\n date: new Date(result.date * 1000),\n timestamp: Number(result.date),\n volumeUSD: Number(result.volumeUSD),\n volumeToken0: Number(result.volumeToken0),\n volumeToken1: Number(result.volumeToken1),\n liquidityUSD: Number(result.reserveUSD),\n txCount: Number(result.txCount)\n }));\n }\n}","const pageResults = require('graph-results-pager');\n\nconst ws = require('isomorphic-ws');\nconst { SubscriptionClient } = require('subscriptions-transport-ws'); \n\nconst { request, gql } = require('graphql-request');\n\nconst {\n subWeeks,\n getUnixTime,\n fromUnixTime\n} = require(\"date-fns\");\n\nconst { graphAPIEndpoints, graphWSEndpoints, TWENTY_FOUR_HOURS } = require('./../../constants')\nconst { timestampToBlock, timestampsToBlocks, blockToTimestamp } = require('./../../utils');\n\nconst { ethPrice } = require('./../exchange/eth');\n\nmodule.exports = {\n async token({block = undefined, timestamp = undefined, token_address = undefined} = {}) {\n if(!token_address) { throw new Error(\"sushi-data: Token address undefined\"); }\n\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const result = await request(graphAPIEndpoints.exchange,\n gql`{\n token(id: \"${token_address.toLowerCase()}\", ${block}) {\n ${tokens.properties.toString()}\n }\n }`\n );\n\n return tokens.callback([result.token])[0];\n },\n\n async token24h({block = undefined, timestamp = undefined, token_address = undefined} = {}) {\n if(!token_address) { throw new Error(\"sushi-data: Token address undefined\"); }\n\n let timestampNow = timestamp ? timestamp : block ? await blockToTimestamp(block) : (Math.floor(Date.now() / 1000));\n timestamp24ago = timestampNow - TWENTY_FOUR_HOURS;\n timestamp48ago = timestamp24ago - TWENTY_FOUR_HOURS;\n\n block = timestamp ? await timestampToBlock(timestamp) : block;\n block24ago = await timestampToBlock(timestamp24ago);\n block48ago = await timestampToBlock(timestamp48ago);\n\n const result = await module.exports.token({block: block, token_address});\n const result24ago = await module.exports.token({block: block24ago, token_address});\n const result48ago = await module.exports.token({block: block48ago, token_address});\n\n const ethPriceUSD = await ethPrice({block: block});\n const ethPriceUSD24ago = await ethPrice({block: block24ago});\n\n return tokens.callback24h([result], [result24ago], [result48ago], ethPriceUSD, ethPriceUSD24ago)[0];\n },\n\n async tokenHourData({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined, token_address = undefined} = {}) {\n if(!token_address) { throw new Error(\"sushi-data: Token address undefined\"); }\n \n minTimestamp = minBlock ? blockToTimestamp(minBlock) : minTimestamp;\n maxTimestamp = maxBlock ? blockToTimestamp(maxBlock) : maxTimestamp;\n\n const endTime = maxTimestamp ? fromUnixTime(maxTimestamp) : new Date();\n let time = minTimestamp ? minTimestamp : getUnixTime(subWeeks(endTime, 1));\n\n // create an array of hour start times until we reach current hour\n const timestamps = [];\n while (time <= getUnixTime(endTime) - 3600) {\n timestamps.push(time);\n time += 3600;\n }\n\n let blocks = await timestampsToBlocks(timestamps);\n\n const query = (\n gql`{\n ${blocks.map((block, i) => (gql`\n timestamp${timestamps[i]}: token(id: \"${token_address.toLowerCase()}\", block: {number: ${block}}) {\n ${tokens.properties.toString()}\n }`))}\n }`\n );\n\n let result = await request(graphAPIEndpoints.exchange, query)\n result = Object.keys(result)\n .map(key => ({...result[key], timestamp: Number(key.split(\"timestamp\")[1])}))\n .sort((a, b) => (a.timestamp) - (b.timestamp));\n\n return tokens.callbackHourData(result);\n },\n\n async tokenDayData({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined, token_address = undefined} = {}) {\n if(!token_address) { throw new Error(\"sushi-data: Token address undefined\"); }\n \n return pageResults({\n api: graphAPIEndpoints.exchange,\n query: {\n entity: 'tokenDayDatas',\n selection: {\n orderDirection: 'desc',\n where: {\n token: `\\\\\"${token_address.toLowerCase()}\\\\\"`,\n date_gte: minTimestamp || (minBlock ? await blockToTimestamp(minBlock) : undefined),\n date_lte: maxTimestamp || (maxBlock ? await blockToTimestamp(maxBlock) : undefined),\n },\n },\n properties: tokens.propertiesDayData\n }\n })\n .then(results => tokens.callbackDayData(results))\n .catch(err => console.log(err));\n },\n\n observeToken({token_address = undefined}) {\n if(!token_address) { throw new Error(\"sushi-data: Token address undefined\"); }\n\n const query = gql`\n subscription {\n token(id: \"${token_address.toLowerCase()}\") {\n ${tokens.properties.toString()}\n }\n }`;\n\n const client = new SubscriptionClient(graphWSEndpoints.exchange, { reconnect: true, }, ws,);\n const observable = client.request({ query });\n\n return {\n subscribe({next, error, complete}) {\n return observable.subscribe({\n next(results) {\n next(tokens.callback([results.data.token])[0]);\n },\n error,\n complete\n });\n }\n };\n },\n\n async tokens({block = undefined, timestamp = undefined, max = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.exchange,\n query: {\n entity: 'tokens',\n selection: {\n block: block ? { number: block } : timestamp ? { number: await timestampToBlock(timestamp) } : undefined,\n },\n properties: tokens.properties\n },\n max\n })\n .then(results => tokens.callback(results))\n .catch(err => console.log(err));\n },\n\n async tokens24h({block = undefined, timestamp = undefined, max = undefined} = {}) {\n let timestampNow = timestamp ? timestamp : block ? await blockToTimestamp(block) : (Math.floor(Date.now() / 1000));\n timestamp24ago = timestampNow - TWENTY_FOUR_HOURS;\n timestamp48ago = timestamp24ago - TWENTY_FOUR_HOURS;\n\n block = timestamp ? await timestampToBlock(timestamp) : block;\n block24ago = await timestampToBlock(timestamp24ago);\n block48ago = await timestampToBlock(timestamp48ago);\n\n const results = await module.exports.tokens({block: block, max});\n const results24ago = await module.exports.tokens({block: block24ago, max});\n const results48ago = await module.exports.tokens({block: block48ago, max});\n\n const ethPriceUSD = await ethPrice({block: block});\n const ethPriceUSD24ago = await ethPrice({block: block24ago});\n\n return tokens.callback24h(results, results24ago, results48ago, ethPriceUSD, ethPriceUSD24ago);\n },\n\n observeTokens() {\n const query = gql`\n subscription {\n tokens(first: 1000, orderBy: volumeUSD, orderDirection: desc) {\n ${tokens.properties.toString()}\n }\n }`;\n\n const client = new SubscriptionClient(graphWSEndpoints.exchange, { reconnect: true, }, ws,);\n const observable = client.request({ query });\n\n return {\n subscribe({next, error, complete}) {\n return observable.subscribe({\n next(results) {\n next(tokens.callback(results.data.tokens));\n },\n error,\n complete\n });\n }\n };\n },\n};\n\nconst tokens = {\n properties: [\n 'id',\n 'symbol',\n 'name',\n 'decimals',\n 'totalSupply',\n 'volume',\n 'volumeUSD',\n 'untrackedVolumeUSD',\n 'txCount',\n 'liquidity',\n 'derivedETH'\n ],\n\n callback(results) {\n return results\n .map(({ id, symbol, name, decimals, totalSupply, volume, volumeUSD, untrackedVolumeUSD, txCount, liquidity, derivedETH }) => ({\n id: id,\n symbol: symbol,\n name: name,\n decimals: Number(decimals),\n totalSupply: Number(totalSupply),\n volume: Number(volume),\n volumeUSD: Number(volumeUSD),\n untrackedVolumeUSD: Number(untrackedVolumeUSD),\n txCount: Number(txCount),\n liquidity: Number(liquidity),\n derivedETH: Number(derivedETH)\n }))\n .sort((a, b) => b.volumeUSD - a.volumeUSD);\n },\n\n callback24h(results, results24h, results48h, ethPriceUSD, ethPriceUSD24ago) {\n return results.map(result => {\n const result24h = results24h.find(e => e.id === result.id) || result;\n const result48h = results48h.find(e => e.id === result.id) || result;\n\n return ({\n ...result,\n \n priceUSD: result.derivedETH * ethPriceUSD,\n priceUSDChange: (result.derivedETH * ethPriceUSD) / (result24h.derivedETH * ethPriceUSD24ago) * 100 - 100,\n priceUSDChangeCount: (result.derivedETH * ethPriceUSD) - (result24h.derivedETH * ethPriceUSD24ago),\n \n liquidityUSD: result.liquidity * result.derivedETH * ethPriceUSD,\n liquidityUSDChange: (result.liquidity * result.derivedETH * ethPriceUSD) / (result24h.liquidity * result24h.derivedETH * ethPriceUSD24ago) * 100 - 100,\n liquidityUSDChangeCount: result.liquidity * result.derivedETH * ethPriceUSD - result24h.liquidity * result24h.derivedETH * ethPriceUSD24ago,\n \n liquidityETH: result.liquidity * result.derivedETH,\n liquidityETHChange: (result.liquidity * result.derivedETH) / (result24h.liquidity * result24h.derivedETH) * 100 - 100,\n liquidityETHChangeCount: result.liquidity * result.derivedETH - result24h.liquidity * result24h.derivedETH,\n \n volumeUSDOneDay: result.volumeUSD - result24h.volumeUSD,\n volumeUSDChange: (result.volumeUSD - result24h.volumeUSD) / (result24h.volumeUSD - result48h.volumeUSD) * 100 - 100,\n volumeUSDChangeCount: (result.volumeUSD - result24h.volumeUSD) - (result24h.volumeUSD - result48h.volumeUSD),\n \n untrackedVolumeUSDOneDay: result.untrackedVolumeUSD - result24h.untrackedVolumeUSD,\n untrackedVolumeUSDChange: (result.untrackedVolumeUSD - result24h.untrackedVolumeUSD) / (result24h.untrackedVolumeUSD - result48h.untrackedVolumeUSD) * 100 - 100,\n untrackedVolumeUSDChangeCount: (result.untrackedVolumeUSD - result24h.untrackedVolumeUSD) - (result24h.untrackedVolumeUSD - result48h.untrackedVolumeUSD),\n \n txCountOneDay: result.txCount - result24h.txCount,\n txCountChange: (result.txCount - result24h.txCount) / (result24h.txCount - result48h.txCount) * 100 - 100,\n txCountChangeCount: (result.txCount - result24h.txCount) - (result24h.txCount - result48h.txCount),\n })});\n },\n\n callbackHourData(results) {\n return results.map(result => ({\n id: result.id,\n symbol: result.symbol,\n name: result.name,\n decimals: Number(result.decimals),\n totalSupply: Number(result.totalSupply),\n volume: Number(result.volume),\n volumeUSD: Number(result.volumeUSD),\n untrackedVolumeUSD: Number(result.untrackedVolumeUSD),\n txCount: Number(result.txCount),\n liquidity: Number(result.liquidity),\n derivedETH: Number(result.derivedETH),\n timestamp: result.timestamp\n }));\n },\n\n propertiesDayData: [\n 'id',\n 'date',\n 'volume',\n 'volumeETH',\n 'volumeUSD',\n 'liquidity',\n 'liquidityETH',\n 'liquidityUSD',\n 'priceUSD',\n 'txCount'\n ],\n\n callbackDayData(results) {\n return results.map(result => ({\n id: result.id,\n date: new Date(result.date * 1000),\n timestamp: Number(result.date),\n volume: Number(result.volume),\n volumeETH: Number(result.volumeETH),\n volumeUSD: Number(result.volumeUSD),\n liquidity: Number(result.liquidity),\n liquidityETH: Number(result.liquidityETH),\n liquidityUSD: Number(result.liquidityUSD),\n priceUSD: Number(result.priceUSD),\n txCount: Number(result.txCount)\n }));\n }\n};\n","const pageResults = require('graph-results-pager');\n\nconst ws = require('isomorphic-ws');\nconst { SubscriptionClient } = require('subscriptions-transport-ws'); \n\nconst { request, gql } = require('graphql-request');\n\nconst { graphAPIEndpoints, graphWSEndpoints } = require('../constants')\nconst { timestampToBlock } = require('../utils')\n\nmodule.exports = {\n userHistory({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined, user_address = undefined, max = undefined} = {}) {\n if(!user_address) { throw new Error(\"sushi-data: User address undefined\"); }\n\n return pageResults({\n api: graphAPIEndpoints.exchange_v1,\n query: {\n entity: 'liquidityPositionSnapshots',\n selection: {\n where: {\n user: `\\\\\"${user_address.toLowerCase()}\\\\\"`,\n block_gte: minBlock || undefined,\n block_lte: maxBlock || undefined,\n timestamp_gte: minTimestamp || undefined,\n timestamp_lte: maxTimestamp || undefined,\n },\n },\n properties: userHistory.properties\n },\n max\n })\n .then(results => userHistory.callback(results))\n .catch(err => console.log(err));\n },\n\n async userPositions({block = undefined, timestamp = undefined, user_address = undefined} = {}) {\n if(!user_address) { throw new Error(\"sushi-data: User address undefined\"); }\n\n return pageResults({\n api: graphAPIEndpoints.exchange_v1,\n query: {\n entity: 'liquidityPositions',\n selection: {\n where: {\n user: `\\\\\"${user_address.toLowerCase()}\\\\\"`,\n },\n block: block ? { number: block } : timestamp ? { number: await timestampToBlock(timestamp) } : undefined,\n },\n properties: userPositions.properties\n }\n })\n .then(results => userPositions.callback(results))\n .catch(err => console.log(err));\n }\n}\n\nconst userHistory = {\n properties: [\n 'id',\n 'timestamp',\n 'block',\n 'pair { id, reserve0, reserve1, reserveUSD, token0 { id }, token1 { id } }',\n 'token0PriceUSD',\n 'token1PriceUSD',\n 'reserve0',\n 'reserve1',\n 'reserveUSD',\n 'liquidityTokenTotalSupply',\n 'liquidityTokenBalance', \n ],\n\n callback(results) {\n return results.map(entry => ({\n id: entry.id,\n timestamp: Number(entry.timestamp),\n block: Number(entry.block),\n pair: {\n id: entry.pair.id,\n reserve0: Number(entry.pair.reserve0),\n reserve1: Number(entry.pair.reserve1),\n reserveUSD: Number(entry.pair.reserveUSD),\n token0: {\n id: entry.pair.token0.id\n },\n token1: {\n id: entry.pair.token1.id\n },\n },\n token0PriceUSD: Number(entry.token0PriceUSD),\n token1PriceUSD: Number(entry.token1PriceUSD),\n reserve0: Number(entry.reserve0),\n reserve1: Number(entry.reserve1),\n reserveUSD: Number(entry.reserveUSD),\n liquidityTokenTotalSupply: Number(entry.liquidityTokenTotalSupply),\n liquidityTokenBalance: Number(entry.liquidityTokenBalance),\n }));\n }\n};\n\nconst userPositions = {\n properties: [\n 'id',\n 'pair { id, reserve0, reserve1, reserveUSD, token0 { id, symbol, derivedETH }, token1 { id, symbol, derivedETH }, totalSupply }',\n 'liquidityTokenBalance',\n ],\n\n callback(results) {\n return results.map(entry => ({\n id: entry.id,\n pair: {\n id: entry.pair.id,\n reserve0: Number(entry.pair.reserve0),\n reserve1: Number(entry.pair.reserve1),\n reserveUSD: Number(entry.pair.reserveUSD),\n token0: {\n id: entry.pair.token0.id,\n symbol: entry.pair.token0.symbol,\n derivedETH: Number(entry.pair.token0.derivedETH)\n },\n token1: {\n id: entry.pair.token1.id,\n symbol: entry.pair.token1.symbol,\n derivedETH: Number(entry.pair.token1.derivedETH)\n },\n totalSupply: Number(entry.pair.totalSupply)\n },\n liquidityTokenBalance: Number(entry.liquidityTokenBalance)\n }));\n }\n}\n","const pageResults = require('graph-results-pager');\n\nconst ws = require('isomorphic-ws');\nconst { SubscriptionClient } = require('subscriptions-transport-ws');\n\nconst { request, gql } = require('graphql-request');\n\nconst { graphAPIEndpoints, graphWSEndpoints } = require('./../constants')\nconst { timestampToBlock } = require('./../utils')\n\nmodule.exports = {\n async user({block = undefined, timestamp = undefined, user_address = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.lockup,\n query: {\n entity: 'users',\n selection: {\n where: {\n address: `\\\\\"${user_address.toLowerCase()}\\\\\"`\n },\n },\n block: block ? { number: block } : timestamp ? { number: await timestampToBlock(timestamp) } : undefined,\n properties: user.properties\n }\n })\n .then(results => user.callback(results))\n .catch(err => console.log(err));\n }\n}\n\nconst user = {\n properties: [\n 'id',\n 'address',\n 'amount',\n 'rewardDebt',\n 'pool { id, balance, accSushiPerShare }',\n 'sushiAtLockup',\n 'sushiHarvestedSinceLockup',\n 'sushiLocked',\n ],\n\n callback(results) {\n return results.map(entry => ({\n id: entry.id,\n address: entry.address,\n amount: Number(entry.amount),\n rewardDebt: BigInt(entry.rewardDebt),\n pool: {\n id: entry.pool.id,\n balance: Number(entry.pool.balance),\n accSushiPerShare: BigInt(entry.pool.accSushiPerShare)\n },\n sushiAtLockup: Number(entry.sushiAtLockup),\n sushiHarvestedSinceLockup: Number(entry.sushiHarvestedSinceLockup),\n sushiLocked: Number(entry.sushiLocked),\n }));\n }\n};\n","const pageResults = require('graph-results-pager');\n\nconst ws = require('isomorphic-ws');\nconst { SubscriptionClient } = require('subscriptions-transport-ws'); \n\nconst { request, gql } = require('graphql-request');\n\nconst { graphAPIEndpoints, graphWSEndpoints, makerAddress } = require('./../constants')\nconst { timestampToBlock } = require('./../utils')\n\nmodule.exports = {\n async info({block = undefined, timestamp = undefined} = {}) {\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const result = await request(graphAPIEndpoints.maker,\n gql`{\n makers(first: 1, ${block}) {\n ${info.properties.toString()}\n }\n }`\n );\n\n return info.callback(result.makers[0]);\n },\n\n servings({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined, max = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.maker,\n query: {\n entity: 'servings',\n selection: {\n where: {\n block_gte: minBlock || undefined,\n block_lte: maxBlock || undefined,\n timestamp_gte: minTimestamp || undefined,\n timestamp_lte: maxTimestamp || undefined,\n }\n },\n properties: servings.properties\n },\n max\n })\n .then(results => servings.callback(results))\n .catch(err => console.log(err));\n },\n\n async servers({block = undefined, timestamp = undefined, max = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.maker,\n query: {\n entity: 'servers',\n block: block ? { number: block } : timestamp ? { number: await timestampToBlock(timestamp) } : undefined,\n properties: servers.properties\n },\n max\n })\n .then(results => servers.callback(results))\n .catch(err => console.log(err)); \n },\n\n async pendingServings({block = undefined, timestamp = undefined, max = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.exchange,\n query: {\n entity: 'users',\n selection: {\n where: {\n id: `\\\\\"${makerAddress}\\\\\"`,\n },\n },\n block: block ? { number: block } : timestamp ? { number: await timestampToBlock(timestamp) } : undefined,\n properties: pendingServings.properties\n },\n max\n })\n .then(results => pendingServings.callback(results))\n .catch(err => console.log(err));\n },\n\n observePendingServings() {\n const query = gql`\n subscription {\n users(first: 1000, where: {id: \"${makerAddress}\"}) {\n ${pendingServings.properties.toString()}\n }\n }`;\n\n const client = new SubscriptionClient(graphWSEndpoints.exchange, { reconnect: true, }, ws,);\n const observable = client.request({ query });\n\n return {\n subscribe({next, error, complete}) {\n return observable.subscribe({\n next(results) {\n next(pendingServings.callback(results.data.users));\n },\n error,\n complete\n });\n }\n };\n },\n}\n\nconst info = {\n properties: [\n 'id',\n 'sushiServed'\n ],\n\n callback(results) {\n return ({\n address: results.id,\n sushiServed: Number(results.sushiServed)\n });\n }\n}\n\nconst servings = {\n properties: [\n 'server { id }',\n 'tx',\n 'pair',\n 'token0',\n 'token1',\n 'sushiServed',\n 'block',\n 'timestamp'\n ],\n\n callback(results) {\n return results.map(({ server, tx, pair, token0, token1, sushiServed, block, timestamp }) => ({\n serverAddress: server.id,\n tx: tx,\n pair: pair,\n token0: token0,\n token1: token1,\n sushiServed: Number(sushiServed),\n block: Number(block),\n timestamp: Number(timestamp * 1000),\n date: new Date(timestamp * 1000)\n }));\n }\n};\n\nconst servers = {\n properties: [\n 'id',\n 'sushiServed',\n 'servings(first: 1000, orderBy: block, orderDirection: desc) { tx, block, pair, sushiServed }'\n ],\n\n callback(results) {\n return results.map(({ id, sushiServed, servings }) => ({\n serverAddress: id,\n sushiServed: Number(sushiServed),\n servings: servings.map(({ tx, block, pair, sushiServed}) => ({\n tx,\n block: Number(block),\n pair,\n sushiServed: Number(sushiServed)\n })),\n }));\n }\n};\n\nconst pendingServings = {\n properties: [\n 'liquidityPositions(first: 1000) { id, liquidityTokenBalance, pair { id, totalSupply, reserveUSD, token0 { id, name, symbol }, token1 { id, symbol, name } } }'\n ],\n\n callback(results) {\n return results[0].liquidityPositions.map(({ liquidityTokenBalance, pair }) => ({\n address: pair.id,\n token0: pair.token0,\n token1: pair.token1,\n valueUSD: (liquidityTokenBalance / pair.totalSupply) * pair.reserveUSD\n })).sort((a, b) => b.valueUSD - a.valueUSD);\n }\n};\n","const pageResults = require('graph-results-pager');\n\nconst { request, gql } = require('graphql-request');\n\nconst { graphAPIEndpoints, chefAddress, TWENTY_FOUR_HOURS } = require('./../constants')\nconst { timestampToBlock, getAverageBlockTime } = require('./../utils');\n\nconst { pairs: exchangePairs } = require('./exchange');\nconst { priceUSD: sushiPriceUSD } = require('./sushi');\n\nmodule.exports = {\n async info({block = undefined, timestamp = undefined} = {}) {\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const result = await request(graphAPIEndpoints.masterchef,\n gql`{\n masterChef(id: \"${chefAddress}\", ${block}) {\n ${info.properties.toString()}\n }\n }`\n );\n\n return info.callback(result.masterChef);\n },\n\n async pool({block = undefined, timestamp = undefined, pool_id = undefined, pool_address = undefined} = {}) {\n if(!pool_id && !pool_address) { throw new Error(\"sushi-data: Pool ID / Address undefined\"); }\n\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n let result;\n if(pool_id) {\n result = await request(graphAPIEndpoints.masterchef,\n gql`{\n pool(id: ${pool_id}, ${block}) {\n ${pools.properties.toString()}\n }\n }`\n );\n }\n\n else {\n result = await request(graphAPIEndpoints.masterchef,\n gql`{\n pools(first: 1, where: {pair: \"${pool_address.toLowerCase()}\"}, ${block}) {\n ${pools.properties.toString()}\n }\n }`\n );\n }\n\n return pools.callback(pool_id ? [result.pool] : result.pools)[0];\n },\n\n async pools({block = undefined, timestamp = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.masterchef,\n query: {\n entity: 'pools',\n selection: {\n block: block ? { number: block } : timestamp ? { number: await timestampToBlock(timestamp) } : undefined,\n },\n properties: pools.properties\n }\n })\n .then(results => pools.callback(results))\n .catch(err => console.log(err));\n },\n\n async stakedValue({block = undefined, timestamp = undefined, token_address = undefined} = {}) {\n if(!token_address) { throw new Error(\"sushi-data: Token address undefined\"); }\n\n block = block ? block : timestamp ? (await timestampToBlock(timestamp)) : undefined;\n block = block ? `block: { number: ${block} }` : \"\";\n\n const result = await request(graphAPIEndpoints.exchange,\n gql`{\n liquidityPosition(id: \"${token_address.toLowerCase()}-${chefAddress}\", ${block}) {\n ${stakedValue.properties.toString()}\n }\n }`\n );\n\n return stakedValue.callback(result.liquidityPosition);\n },\n\n async user({block = undefined, timestamp = undefined, user_address = undefined} = {}) {\n if(!user_address) { throw new Error(\"sushi-data: User address undefined\"); }\n\n return pageResults({\n api: graphAPIEndpoints.masterchef,\n query: {\n entity: 'users',\n selection: {\n where: {\n address: `\\\\\"${user_address.toLowerCase()}\\\\\"`\n },\n block: block ? { number: block } : timestamp ? { number: await timestampToBlock(timestamp) } : undefined,\n },\n properties: user.properties\n }\n })\n .then(results => user.callback(results))\n .catch(err => console.log(err));\n },\n\n async users({block = undefined, timestamp = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.masterchef,\n query: {\n entity: 'users',\n selection: {\n block: block ? { number: block } : timestamp ? { number: await timestampToBlock(timestamp) } : undefined,\n },\n properties: user.properties\n }\n })\n .then(results => user.callback(results))\n .catch(err => console.log(err));\n },\n\n async apys({block = undefined, timestamp = undefined} = {}) {\n const masterchefList = await module.exports.pools({block, timestamp});\n const exchangeList = await exchangePairs({block, timestamp});\n const sushiUSD = await sushiPriceUSD({block, timestamp});\n\n const totalAllocPoint = masterchefList.reduce((a, b) => a + b.allocPoint, 0);\n\n const averageBlockTime = await getAverageBlockTime({block, timestamp});\n\n return masterchefList.map(masterchefPool => {\n const exchangePool = exchangeList.find(e => e.id === masterchefPool.pair);\n if(!exchangePool) {\n return {...masterchefPool, apy: 0};\n }\n\n const tvl = masterchefPool.slpBalance * (exchangePool.reserveUSD / exchangePool.totalSupply);\n const sushiPerBlock = (masterchefPool.allocPoint / (totalAllocPoint) * 100);\n const apy = sushiUSD * (sushiPerBlock * (60 / averageBlockTime) * 60 * 24 * 365) / tvl * 100;\n\n return {...masterchefPool, apy};\n });\n },\n\n async apys24h({block = undefined, timestamp = undefined} = {}) {\n let timestampNow = timestamp ? timestamp : block ? await blockToTimestamp(block) : (Math.floor(Date.now() / 1000));\n timestamp24ago = timestampNow - TWENTY_FOUR_HOURS;\n timestamp48ago = timestamp24ago - TWENTY_FOUR_HOURS;\n\n block = timestamp ? await timestampToBlock(timestamp) : block;\n block24ago = await timestampToBlock(timestamp24ago);\n block48ago = await timestampToBlock(timestamp48ago);\n\n const results = await module.exports.apys({block: block});\n const results24ago = await module.exports.apys({block: block24ago});\n\n return apys.callback24h(results, results24ago);\n }\n}\n\nconst info = {\n properties: [\n 'bonusMultiplier',\n 'bonusEndBlock',\n 'devaddr',\n 'migrator',\n 'owner',\n 'startBlock',\n 'sushi',\n 'sushiPerBlock',\n 'totalAllocPoint',\n 'poolCount',\n 'slpBalance',\n 'slpAge',\n 'slpAgeRemoved',\n 'slpDeposited',\n 'slpWithdrawn',\n 'updatedAt'\n ],\n\n callback(results) {\n return ({\n bonusMultiplier: Number(results.bonusMultiplier),\n bonusEndBlock: Number(results.bonusEndBlock),\n devaddr: results.devaddr,\n migrator: results.migrator,\n owner: results.owner,\n startBlock: Number(results.startBlock),\n sushiPerBlock: results.sushiPerBlock / 1e18,\n totalAllocPoint: Number(results.totalAllocPoint),\n poolCount: Number(results.poolCount),\n slpBalance: Number(results.slpBalance),\n slpAge: Number(results.slpAge),\n slpAgeRemoved: Number(results.slpAgeRemoved),\n slpDeposited: Number(results.slpDeposited),\n slpWithdrawn: Number(results.slpWithdrawn),\n updatedAt: Number(results.updatedAt)\n });\n }\n};\n\nconst pools = {\n properties: [\n 'id',\n 'pair',\n 'allocPoint',\n 'lastRewardBlock',\n 'accSushiPerShare',\n 'balance',\n 'userCount',\n 'slpBalance',\n 'slpAge',\n 'slpAgeRemoved',\n 'slpDeposited',\n 'slpWithdrawn',\n 'timestamp',\n 'block',\n 'updatedAt',\n 'entryUSD',\n 'exitUSD',\n 'sushiHarvested',\n 'sushiHarvestedUSD'\n ],\n\n callback(results) {\n return results.map(({ id, pair, allocPoint, lastRewardBlock, accSushiPerShare, balance, userCount, slpBalance, slpAge, slpAgeRemoved, slpDeposited, slpWithdrawn, timestamp, block, updatedAt, entryUSD, exitUSD, sushiHarvested, sushiHarvestedUSD }) => ({\n id: Number(id),\n pair: pair,\n allocPoint: Number(allocPoint),\n lastRewardBlock: Number(lastRewardBlock),\n accSushiPerShare: BigInt(accSushiPerShare),\n userCount: Number(userCount),\n slpBalance: Number(slpBalance),\n slpAge: Number(slpAge),\n slpAgeRemoved: Number(slpAgeRemoved),\n slpDeposited: Number(slpDeposited),\n slpWithdrawn: Number(slpWithdrawn),\n addedTs: Number(timestamp),\n addedDate: new Date(timestamp * 1000),\n addedBlock: Number(block),\n lastUpdatedTs: Number(updatedAt),\n lastUpdatedDate: new Date(updatedAt * 1000),\n entryUSD: Number(entryUSD),\n exitUSD: Number(exitUSD),\n sushiHarvested: Number(sushiHarvested),\n sushiHarvestedUSD: Number(sushiHarvestedUSD)\n }));\n }\n};\n\nconst stakedValue = {\n properties: [\n 'id',\n 'liquidityTokenBalance',\n 'pair { id, totalSupply, reserveETH, reserveUSD }'\n ],\n\n callback(results) {\n return ({\n id: results.id,\n liquidityTokenBalance: Number(results.liquidityTokenBalance),\n totalSupply: Number(results.pair.totalSupply),\n totalValueETH: Number(results.pair.reserveETH),\n totalValueUSD: Number(results.pair.reserveUSD)\n })\n }\n};\n\nconst user = {\n properties: [\n 'id',\n 'address',\n 'pool { id, pair, balance, accSushiPerShare, lastRewardBlock }',\n 'amount',\n 'rewardDebt',\n 'entryUSD',\n 'exitUSD',\n 'sushiHarvested',\n 'sushiHarvestedUSD',\n ],\n\n callback(results) {\n return results.map(entry => ({\n id: entry.id,\n address: entry.address,\n poolId: Number(entry.id.split(\"-\")[0]),\n pool: entry.pool ? {\n id: entry.pool.id,\n pair: entry.pool.pair,\n balance: Number(entry.pool.balance),\n accSushiPerShare: BigInt(entry.pool.accSushiPerShare),\n lastRewardBlock: Number(entry.pool.lastRewardBlock)\n } : undefined,\n amount: Number(entry.amount),\n rewardDebt: BigInt(entry.rewardDebt),\n entryUSD: Number(entry.entryUSD),\n exitUSD: Number(entry.exitUSD),\n sushiHarvested: Number(entry.sushiHarvested),\n sushiHarvestedUSD: Number(entry.sushiHarvestedUSD),\n }));\n }\n};\n\nconst apys = {\n callback24h(results, results24h) {\n return results.map(result => {\n const result24h = results24h.find(e => e.id === result.id) || result;\n\n return ({\n ...result,\n\n slpBalanceChange: (result.slpBalance / result24h.slpBalance) * 100 - 100,\n slpBalanceChangeCount: result.slpBalance - result24h.slpBalance,\n\n userCountChange: (result.userCount / result24h.userCount) * 100 - 100,\n userCountChangeCount: result.userCount - result24h.userCount,\n\n sushiHarvestedChange: (result.sushiHarvested / result24h.sushiHarvested) * 100 - 100,\n sushiHarvestedChangeCount: result.sushiHarvested - result24h.sushiHarvested,\n });\n });\n }\n}\n","const pageResults = require('graph-results-pager');\n\nconst ws = require('isomorphic-ws');\nconst { SubscriptionClient } = require('subscriptions-transport-ws'); \n\nconst { gql } = require('graphql-request');\n\nconst { graphAPIEndpoints, graphWSEndpoints, sushiAddress } = require('./../constants')\nconst { timestampToBlock } = require('./../utils')\n\nconst { ethPrice } = require('./exchange')\n\nmodule.exports = {\n async priceUSD({block = undefined, timestamp = undefined} = {}) {\n return (await ethPrice({block, timestamp}) * (await module.exports.priceETH({block, timestamp})));\n },\n\n async priceETH({block = undefined, timestamp = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.exchange,\n query: {\n entity: 'tokens',\n selection: {\n where: {\n id: `\\\\\"${sushiAddress}\\\\\"`,\n },\n block: block ? { number: block } : timestamp ? { number: await timestampToBlock(timestamp) } : undefined,\n },\n properties: priceETH.properties,\n }\n })\n .then(results => priceETH.callback(results[0]))\n .catch(err => console.error(err));\n },\n\n observePriceETH() {\n const query = gql`\n subscription {\n token(id: \"${sushiAddress}\") {\n derivedETH\n }\n }`;\n\n const client = new SubscriptionClient(graphWSEndpoints.exchange, { reconnect: true, }, ws,);\n const observable = client.request({ query });\n\n return {\n subscribe({next, error, complete}) {\n return observable.subscribe({\n next(results) {\n next(priceETH.callback(results.data.token));\n },\n error,\n complete\n });\n }\n };\n },\n}\n\nconst priceETH = {\n properties: [\n 'derivedETH'\n ],\n\n callback(results) {\n return Number(results.derivedETH);\n },\n};","const pageResults = require('graph-results-pager');\n\nconst { graphAPIEndpoints } = require('./../constants');\nconst { timestampToBlock } = require('./../utils');\n\nmodule.exports = {\t\t \n async queuedTxs({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined, max = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.timelock,\n query: {\n entity: 'timelocks',\n selection: {\n where: {\n isCanceled: false,\n isExecuted: false,\n createdBlock_gte: minBlock || (minTimestamp ? await timestampToBlock(minTimestamp) : undefined),\n createdBlock_lte: maxBlock || (maxTimestamp ? await timestampToBlock(maxTimestamp) : undefined),\n }\n },\n properties: queuedTxs.properties\n },\n max\n })\n .then(results => queuedTxs.callback(results))\n .catch(err => console.log(err));\n },\n\n async canceledTxs({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined, max = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.timelock,\n query: {\n entity: 'timelocks',\n selection: {\n where: {\n isCanceled: true,\n createdBlock_gte: minBlock || (minTimestamp ? await timestampToBlock(minTimestamp) : undefined),\n createdBlock_lte: maxBlock || (maxTimestamp ? await timestampToBlock(maxTimestamp) : undefined),\n },\n },\n properties: canceledTxs.properties\n },\n max\n })\n .then(results => canceledTxs.callback(results))\n .catch(err => console.log(err));\n },\n\n async executedTxs({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined, max = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.timelock,\n query: {\n entity: 'timelocks',\n selection: {\n where: {\n isExecuted: true,\n createdBlock_gte: minBlock || (minTimestamp ? await timestampToBlock(minTimestamp) : undefined),\n createdBlock_lte: maxBlock || (maxTimestamp ? await timestampToBlock(maxTimestamp) : undefined),\n }\n },\n properties: executedTxs.properties\n },\n max\n })\n .then(results => executedTxs.callback(results))\n .catch(err => console.log(err));\n },\n\n async allTxs({minTimestamp = undefined, maxTimestamp = undefined, minBlock = undefined, maxBlock = undefined, max = undefined} = {}) {\n return pageResults({\n api: graphAPIEndpoints.timelock,\n query: {\n entity: 'timelocks',\n selection: {\n where: {\n createdBlock_gte: minBlock || (minTimestamp ? await timestampToBlock(minTimestamp) : undefined),\n createdBlock_lte: maxBlock || (maxTimestamp ? await timestampToBlock(maxTimestamp) : undefined),\n },\n },\n properties: allTxs.properties\n },\n max\n })\n .then(results => allTxs.callback(results))\n .catch(err => console.log(err));\n }\n}\n\nconst queuedTxs = {\n properties: [\n 'id',\n 'description',\n 'value',\n 'eta',\n 'functionName',\n 'data',\n 'targetAddress',\n 'createdBlock',\n 'createdTs',\n 'expiresTs',\n 'createdTx',\n ],\n\n callback(results) {\n return results\n .map(({ id, description, value, eta, functionName, data, targetAddress, createdBlock, createdTs, expiresTs, createdTx }) => ({\n txHash: id,\n description: description,\n value: Number(value),\n etaTs: Number(eta * 1000),\n etaDate: new Date(eta * 1000),\n functionName: functionName,\n data: data,\n targetAddress: targetAddress,\n createdBlock: Number(createdBlock),\n createdTs: Number(createdTs * 1000),\n createdDate: new Date(createdTs * 1000),\n expiresTs: Number(expiresTs * 1000),\n expiresDate: new Date(expiresTs * 1000),\n createdTx: createdTx,\n }))\n .sort((a, b) => b.createdBlock - a.createdBlock);\n }\n};\n\nconst canceledTxs = {\n properties: [\n 'id',\n 'description',\n 'value',\n 'eta',\n 'functionName',\n 'data',\n 'targetAddress',\n 'createdBlock',\n 'createdTs',\n 'expiresTs',\n 'canceledBlock',\n 'canceledTs',\n 'createdTx',\n 'canceledTx',\n ],\n\n callback(results) {\n return results\n .map(({ id, description, value, eta, functionName, data, targetAddress, createdBlock, createdTs, expiresTs, canceledBlock, canceledTs, createdTx, canceledTx }) => ({\n txHash: id,\n description: description,\n value: Number(value),\n etaTs: Number(eta * 1000),\n etaDate: new Date(eta * 1000),\n functionName: functionName,\n data: data,\n targetAddress: targetAddress,\n createdBlock: Number(createdBlock),\n createdTs: Number(createdTs * 1000),\n createdDate: new Date(createdTs * 1000),\n expiresTs: Number(expiresTs * 1000),\n expiresDate: new Date(expiresTs * 1000),\n canceledBlock: canceledTx ? Number(canceledBlock) : null,\n canceledTs: canceledTx ? Number(canceledTs * 1000) : null,\n canceledDate: canceledTx ? new Date(canceledTs * 1000) : null,\n createdTx: createdTx,\n canceledTx: canceledTx,\n }))\n .sort((a, b) => b.createdBlock - a.createdBlock);\n }\n};\n\nconst executedTxs = {\n properties: [\n 'id',\n 'description',\n 'value',\n 'eta',\n 'functionName',\n 'data',\n 'targetAddress',\n 'createdBlock',\n 'createdTs',\n 'expiresTs',\n 'executedBlock',\n 'executedTs',\n 'createdTx',\n 'executedTx'\n ],\n\n callback(results) {\n return results\n .map(({ id, description, value, eta, functionName, data, targetAddress, createdBlock, createdTs, expiresTs, executedBlock, executedTs, createdTx, executedTx }) => ({\n txHash: id,\n description: description,\n value: Number(value),\n etaTs: Number(eta * 1000),\n etaDate: new Date(eta * 1000),\n functionName: functionName,\n data: data,\n targetAddress: targetAddress,\n createdBlock: Number(createdBlock),\n createdTs: Number(createdTs * 1000),\n createdDate: new Date(createdTs * 1000),\n expiresTs: Number(expiresTs * 1000),\n expiresDate: new Date(expiresTs * 1000),\n executedBlock: executedTx ? Number(executedBlock) : null,\n executedTs: executedTx ? Number(executedTs * 1000) : null,\n executedDate: executedTx ? new Date(executedTs * 1000) : null,\n createdTx: createdTx,\n executedTx: executedTx\n }))\n .sort((a, b) => b.createdBlock - a.createdBlock);;\n }\n};\n\nconst allTxs = {\n properties: [\n 'id',\n 'description',\n 'value',\n 'eta',\n 'functionName',\n 'data',\n 'targetAddress',\n 'isCanceled',\n 'isExecuted',\n 'createdBlock',\n 'createdTs',\n 'expiresTs',\n 'canceledBlock',\n 'canceledTs',\n 'executedBlock',\n 'executedTs',\n 'createdTx',\n 'canceledTx',\n 'executedTx'\n ],\n\n callback(results) {\n return results\n .map(({ id, description, value, eta, functionName, data, targetAddress, isCanceled, isExecuted, createdBlock, createdTs, expiresTs, canceledBlock, canceledTs, executedBlock, executedTs, createdTx, canceledTx, executedTx }) => ({\n txHash: id,\n description: description,\n value: Number(value),\n etaTs: Number(eta * 1000),\n etaDate: new Date(eta * 1000),\n functionName: functionName,\n data: data,\n targetAddress: targetAddress,\n isCanceled: isCanceled,\n isExecuted: isExecuted,\n createdBlock: Number(createdBlock),\n createdTs: Number(createdTs * 1000),\n createdDate: new Date(createdTs * 1000),\n expiresTs: Number(expiresTs * 1000),\n expiresDate: new Date(expiresTs * 1000),\n canceledBlock: canceledTx ? Number(canceledBlock) : null,\n canceledTs: canceledTx ? Number(canceledTs * 1000) : null,\n canceledDate: canceledTx ? new Date(canceledTs * 1000) : null,\n executedTs: executedTx ? Number(executedTs * 1000) : null,\n executedDate: executedTx ? new Date(executedTs * 1000) : null,\n createdTx: createdTx,\n canceledTx: canceledTx,\n executedTx: executedTx\n }))\n .sort((a, b) => b.createdBlock - a.createdBlock);\n }\n};\n","const pageResults = require('graph-results-pager');\n\nconst { request, gql } = require('graphql-request');\nconst blocklytics = 'https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks';\n\nconst {\n getUnixTime,\n startOfHour,\n startOfMinute,\n startOfSecond,\n subHours,\n } = require(\"date-fns\");\n\nasync function timestampToBlock(timestamp) {\n timestamp = String(timestamp).length > 10 ? Math.floor(timestamp / 1000) : timestamp;\n\n let result = await request(blocklytics,\n gql`{\n blocks(first: 1, orderBy: timestamp, orderDirection: desc, where: { timestamp_lte: ${timestamp} }) {\n number\n }\n }`\n );\n\n return Number(result.blocks[0].number);\n}\n\nasync function timestampsToBlocks(timestamps) { \n const query = (\n gql`{\n ${timestamps.map((timestamp) => (gql`\n timestamp${timestamp}: blocks(first:1, orderBy: timestamp, orderDirection: desc, where: { timestamp_lte: ${timestamp}}) {\n number\n }`))}\n }`\n );\n\n let result = await request(blocklytics, query)\n\n result = Object.keys(result)\n .map(key => ({...result[key], timestamp: key.split(\"timestamp\")[1]}))\n .sort((a, b) => Number(a.timestamp) - (b.timestamp));\n\n result.forEach(e => delete e.timestamp);\n\n return result = Object.values(result).map(e => Number(e[0].number));\n}\n\nasync function blockToTimestamp(block) {\n const result = await request(blocklytics,\n gql`{\n blocks(first: 1, where: { number: ${block} }) {\n timestamp\n }\n }`\n );\n\n return Number(result.blocks[0].timestamp);\n}\n\nasync function getAverageBlockTime({block = undefined, timestamp = undefined} = {}) {\n\n timestamp = timestamp ? String(timestamp).length > 10 ? Math.floor(timestamp / 1000) : timestamp : undefined;\n timestamp = timestamp ? timestamp : block ? await blockToTimestamp(block) : undefined;\n\n const now = startOfSecond(startOfMinute(startOfHour(timestamp ? timestamp * 1000 : Date.now())));\n const start = getUnixTime(subHours(now, 6));\n const end = getUnixTime(now);\n\n const blocks = await pageResults({\n api: blocklytics,\n query: {\n entity: 'blocks',\n selection: {\n orderBy: \"number\",\n orderDirection: \"desc\",\n where: {\n timestamp_gte: start,\n timestamp_lte: end\n }\n },\n properties: [\n 'timestamp'\n ]\n }\n })\n\n const averageBlockTime = blocks\n .sort((a, b) => Number(b.timestamp) - Number(a.timestamp))\n .reduce(\n (previousValue, currentValue, currentIndex) => {\n if (previousValue.timestamp) {\n const difference = previousValue.timestamp - currentValue.timestamp;\n\n previousValue.difference = previousValue.difference + difference;\n }\n\n previousValue.timestamp = currentValue.timestamp;\n\n if (currentIndex === blocks.length - 1) {\n return previousValue.difference / blocks.length;\n }\n\n return previousValue;\n },\n { timestamp: null, difference: 0 }\n );\n\n return averageBlockTime;\n}\n\nmodule.exports = {\n timestampToBlock,\n timestampsToBlocks,\n blockToTimestamp,\n getAverageBlockTime,\n};","\n/**\n * Expose `Backoff`.\n */\n\nmodule.exports = Backoff;\n\n/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction Backoff(opts) {\n opts = opts || {};\n this.ms = opts.min || 100;\n this.max = opts.max || 10000;\n this.factor = opts.factor || 2;\n this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n this.attempts = 0;\n}\n\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\n\nBackoff.prototype.duration = function(){\n var ms = this.ms * Math.pow(this.factor, this.attempts++);\n if (this.jitter) {\n var rand = Math.random();\n var deviation = Math.floor(rand * this.jitter * ms);\n ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;\n }\n return Math.min(ms, this.max) | 0;\n};\n\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\n\nBackoff.prototype.reset = function(){\n this.attempts = 0;\n};\n\n/**\n * Set the minimum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMin = function(min){\n this.ms = min;\n};\n\n/**\n * Set the maximum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMax = function(max){\n this.max = max;\n};\n\n/**\n * Set the jitter\n *\n * @api public\n */\n\nBackoff.prototype.setJitter = function(jitter){\n this.jitter = jitter;\n};\n\n","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} - the new date with the days added\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\n\nexport default function addDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n\n date.setDate(date.getDate() + amount);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\n\nexport default function addMonths(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n\n var dayOfMonth = date.getDate(); // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n\n var endOfDesiredMonth = new Date(date.getTime());\n endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);\n var daysInMonth = endOfDesiredMonth.getDate();\n\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n return date;\n }\n}","import addDays from \"../addDays/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n\n/**\n * @name add\n * @category Common Helpers\n * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @description\n * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n *\n * | Key | Description |\n * |----------------|------------------------------------|\n * | years | Amount of years to be added |\n * | months | Amount of months to be added |\n * | weeks | Amount of weeks to be added |\n * | days | Amount of days to be added |\n * | hours | Amount of hours to be added |\n * | minutes | Amount of minutes to be added |\n * | seconds | Amount of seconds to be added |\n *\n * All values default to 0\n *\n * @returns {Date} the new date with the seconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add the following duration to 1 September 2014, 10:19:50\n * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30,\n * })\n * //=> Thu Jun 15 2017 15:29:20\n */\nexport default function add(dirtyDate, duration) {\n requiredArgs(2, arguments);\n if (!duration || typeof duration !== 'object') return new Date(NaN);\n var years = duration.years ? toInteger(duration.years) : 0;\n var months = duration.months ? toInteger(duration.months) : 0;\n var weeks = duration.weeks ? toInteger(duration.weeks) : 0;\n var days = duration.days ? toInteger(duration.days) : 0;\n var hours = duration.hours ? toInteger(duration.hours) : 0;\n var minutes = duration.minutes ? toInteger(duration.minutes) : 0;\n var seconds = duration.seconds ? toInteger(duration.seconds) : 0; // Add years and months\n\n var date = toDate(dirtyDate);\n var dateWithMonths = months || years ? addMonths(date, months + years * 12) : date; // Add weeks and days\n\n var dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths; // Add days, hours, minutes and seconds\n\n var minutesToAdd = minutes + hours * 60;\n var secondsToAdd = seconds + minutesToAdd * 60;\n var msToAdd = secondsToAdd * 1000;\n var finalDate = new Date(dateWithDays.getTime() + msToAdd);\n return finalDate;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isWeekend\n * @category Weekday Helpers\n * @summary Does the given date fall on a weekend?\n *\n * @description\n * Does the given date fall on a weekend?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date falls on a weekend\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Does 5 October 2014 fall on a weekend?\n * const result = isWeekend(new Date(2014, 9, 5))\n * //=> true\n */\n\nexport default function isWeekend(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var day = date.getDay();\n return day === 0 || day === 6;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSunday\n * @category Weekday Helpers\n * @summary Is the given date Sunday?\n *\n * @description\n * Is the given date Sunday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Sunday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 21 September 2014 Sunday?\n * var result = isSunday(new Date(2014, 8, 21))\n * //=> true\n */\n\nexport default function isSunday(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getDay() === 0;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSaturday\n * @category Weekday Helpers\n * @summary Is the given date Saturday?\n *\n * @description\n * Is the given date Saturday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Saturday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 27 September 2014 Saturday?\n * var result = isSaturday(new Date(2014, 8, 27))\n * //=> true\n */\n\nexport default function isSaturday(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getDay() === 6;\n}","import isWeekend from \"../isWeekend/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport isSunday from \"../isSunday/index.js\";\nimport isSaturday from \"../isSaturday/index.js\";\n/**\n * @name addBusinessDays\n * @category Day Helpers\n * @summary Add the specified number of business days (mon - fri) to the given date.\n *\n * @description\n * Add the specified number of business days (mon - fri) to the given date, ignoring weekends.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of business days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the business days added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 10 business days to 1 September 2014:\n * const result = addBusinessDays(new Date(2014, 8, 1), 10)\n * //=> Mon Sep 15 2014 00:00:00 (skipped weekend days)\n */\n\nexport default function addBusinessDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var startedOnWeekend = isWeekend(date);\n var amount = toInteger(dirtyAmount);\n if (isNaN(amount)) return new Date(NaN);\n var hours = date.getHours();\n var sign = amount < 0 ? -1 : 1;\n var fullWeeks = toInteger(amount / 5);\n date.setDate(date.getDate() + fullWeeks * 7); // Get remaining days not part of a full week\n\n var restDays = Math.abs(amount % 5); // Loops over remaining days\n\n while (restDays > 0) {\n date.setDate(date.getDate() + sign);\n if (!isWeekend(date)) restDays -= 1;\n } // If the date is a weekend day and we reduce a dividable of\n // 5 from it, we land on a weekend date.\n // To counter this, we add days accordingly to land on the next business day\n\n\n if (startedOnWeekend && isWeekend(date) && amount !== 0) {\n // If we're reducing days, we want to add days until we land on a weekday\n // If we're adding days we want to reduce days until we land on a weekday\n if (isSaturday(date)) date.setDate(date.getDate() + (sign < 0 ? 2 : -1));\n if (isSunday(date)) date.setDate(date.getDate() + (sign < 0 ? 1 : -2));\n } // Restore hours to avoid DST lag\n\n\n date.setHours(hours);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfWeek\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the start of a week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Mon Sep 01 2014 00:00:00\n */\n\nexport default function startOfWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setDate(date.getDate() - diff);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import startOfWeek from \"../startOfWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of an ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\n\nexport default function startOfISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n return startOfWeek(dirtyDate, {\n weekStartsOn: 1\n });\n}","import toDate from \"../toDate/index.js\";\nimport startOfISOWeek from \"../startOfISOWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `getISOYear` to `getISOWeekYear`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the ISO week-numbering year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * const result = getISOWeekYear(new Date(2005, 0, 2))\n * //=> 2004\n */\n\nexport default function getISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);\n var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import getISOWeekYear from \"../getISOWeekYear/index.js\";\nimport startOfISOWeek from \"../startOfISOWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of an ISO week-numbering year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * const result = startOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\n\nexport default function startOfISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setFullYear(year, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n var date = startOfISOWeek(fourthOfJanuary);\n return date;\n}","/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nexport default function getTimezoneOffsetInMilliseconds(date) {\n var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));\n utcDate.setUTCFullYear(date.getFullYear());\n return date.getTime() - utcDate.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\n\nexport default function startOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport startOfDay from \"../startOfDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000;\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar days\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\n\nexport default function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var startOfDayLeft = startOfDay(dirtyDateLeft);\n var startOfDayRight = startOfDay(dirtyDateRight);\n var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport startOfISOWeekYear from \"../startOfISOWeekYear/index.js\";\nimport differenceInCalendarDays from \"../differenceInCalendarDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Set the ISO week-numbering year to the given date.\n *\n * @description\n * Set the ISO week-numbering year to the given date,\n * saving the week number and the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `setISOYear` to `setISOWeekYear`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `setWeekYear`.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} isoWeekYear - the ISO week-numbering year of the new date\n * @returns {Date} the new date with the ISO week-numbering year set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set ISO week-numbering year 2007 to 29 December 2008:\n * const result = setISOWeekYear(new Date(2008, 11, 29), 2007)\n * //=> Mon Jan 01 2007 00:00:00\n */\n\nexport default function setISOWeekYear(dirtyDate, dirtyISOWeekYear) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeekYear = toInteger(dirtyISOWeekYear);\n var diff = differenceInCalendarDays(date, startOfISOWeekYear(date));\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setFullYear(isoWeekYear, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n date = startOfISOWeekYear(fourthOfJanuary);\n date.setDate(date.getDate() + diff);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport getISOWeekYear from \"../getISOWeekYear/index.js\";\nimport setISOWeekYear from \"../setISOWeekYear/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addISOWeekYears\n * @category ISO Week-Numbering Year Helpers\n * @summary Add the specified number of ISO week-numbering years to the given date.\n *\n * @description\n * Add the specified number of ISO week-numbering years to the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `addISOYears` to `addISOWeekYears`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of ISO week-numbering years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the ISO week-numbering years added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 ISO week-numbering years to 2 July 2010:\n * const result = addISOWeekYears(new Date(2010, 6, 2), 5)\n * //=> Fri Jun 26 2015 00:00:00\n */\n\nexport default function addISOWeekYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return setISOWeekYear(dirtyDate, getISOWeekYear(dirtyDate) + amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_MINUTE = 60000;\n/**\n * @name addMinutes\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the minutes added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\n\nexport default function addMinutes(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addQuarters\n * @category Quarter Helpers\n * @summary Add the specified number of year quarters to the given date.\n *\n * @description\n * Add the specified number of year quarters to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of quarters to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the quarters added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 1 quarter to 1 September 2014:\n * const result = addQuarters(new Date(2014, 8, 1), 1)\n * //=> Mon Dec 01 2014 00:00:00\n */\n\nexport default function addQuarters(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n var months = amount * 3;\n return addMonths(dirtyDate, months);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addSeconds\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the seconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\n\nexport default function addSeconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * 1000);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addDays from \"../addDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addWeeks\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of week to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of weeks to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the weeks added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * const result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\n\nexport default function addWeeks(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n var days = amount * 7;\n return addDays(dirtyDate, days);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the years added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\n\nexport default function addYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, amount * 12);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name areIntervalsOverlapping\n * @category Interval Helpers\n * @summary Is the given time interval overlapping with another time interval?\n *\n * @description\n * Is the given time interval overlapping with another time interval? Adjacent intervals do not count as overlapping.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `areRangesOverlapping` to `areIntervalsOverlapping`.\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\n *\n * ```\n * 2.1.3\n * time interval\n * part of the time axis limited by two instants\n * ```\n *\n * Also, this function now accepts an object with `start` and `end` properties\n * instead of two arguments as an interval.\n * This function now throws `RangeError` if the start of the interval is after its end\n * or if any date in the interval is `Invalid Date`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * areRangesOverlapping(\n * new Date(2014, 0, 10), new Date(2014, 0, 20),\n * new Date(2014, 0, 17), new Date(2014, 0, 21)\n * )\n *\n * // v2.0.0 onward\n *\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\n * )\n * ```\n *\n * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.inclusive=false] - whether the comparison is inclusive or not\n * @returns {Boolean} whether the time intervals are overlapping\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // For overlapping time intervals:\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\n * )\n * //=> true\n *\n * @example\n * // For non-overlapping time intervals:\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }\n * )\n * //=> false\n *\n * @example\n * // For adjacent time intervals:\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 30) }\n * )\n * //=> false\n *\n * @example\n * // Using the inclusive option:\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) }\n * )\n * //=> false\n * areIntervalsOverlapping(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 20), end: new Date(2014, 0, 24) },\n * { inclusive: true }\n * )\n * //=> true\n */\n\nexport default function areIntervalsOverlapping(dirtyIntervalLeft, dirtyIntervalRight) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n inclusive: false\n };\n requiredArgs(2, arguments);\n var intervalLeft = dirtyIntervalLeft || {};\n var intervalRight = dirtyIntervalRight || {};\n var leftStartTime = toDate(intervalLeft.start).getTime();\n var leftEndTime = toDate(intervalLeft.end).getTime();\n var rightStartTime = toDate(intervalRight.start).getTime();\n var rightEndTime = toDate(intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {\n throw new RangeError('Invalid interval');\n }\n\n if (options.inclusive) {\n return leftStartTime <= rightEndTime && rightStartTime <= leftEndTime;\n }\n\n return leftStartTime < rightEndTime && rightStartTime < leftEndTime;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name max\n * @category Common Helpers\n * @summary Return the latest of the given dates.\n *\n * @description\n * Return the latest of the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - `max` function now accepts an array of dates rather than spread arguments.\n *\n * ```javascript\n * // Before v2.0.0\n * var date1 = new Date(1989, 6, 10)\n * var date2 = new Date(1987, 1, 11)\n * var maxDate = max(date1, date2)\n *\n * // v2.0.0 onward:\n * var dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)]\n * var maxDate = max(dates)\n * ```\n *\n * @param {Date[]|Number[]} datesArray - the dates to compare\n * @returns {Date} the latest of the dates\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which of these dates is the latest?\n * var result = max([\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * ])\n * //=> Sun Jul 02 1995 00:00:00\n */\n\nexport default function max(dirtyDatesArray) {\n requiredArgs(1, arguments);\n var datesArray; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\n\n if (dirtyDatesArray && typeof dirtyDatesArray.forEach === 'function') {\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array.\n } else if (typeof dirtyDatesArray === 'object' && dirtyDatesArray !== null) {\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\n } else {\n // `dirtyDatesArray` is non-iterable, return Invalid Date\n return new Date(NaN);\n }\n\n var result;\n datesArray.forEach(function (dirtyDate) {\n var currentDate = toDate(dirtyDate);\n\n if (result === undefined || result < currentDate || isNaN(Number(currentDate))) {\n result = currentDate;\n }\n });\n return result || new Date(NaN);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name min\n * @category Common Helpers\n * @summary Returns the earliest of the given dates.\n *\n * @description\n * Returns the earliest of the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - `min` function now accepts an array of dates rather than spread arguments.\n *\n * ```javascript\n * // Before v2.0.0\n * const date1 = new Date(1989, 6, 10)\n * const date2 = new Date(1987, 1, 11)\n * const minDate = min(date1, date2)\n *\n * // v2.0.0 onward:\n * const dates = [new Date(1989, 6, 10), new Date(1987, 1, 11)]\n * const minDate = min(dates)\n * ```\n *\n * @param {Date[]|Number[]} datesArray - the dates to compare\n * @returns {Date} - the earliest of the dates\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which of these dates is the earliest?\n * const result = min([\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * ])\n * //=> Wed Feb 11 1987 00:00:00\n */\n\nexport default function min(dirtyDatesArray) {\n requiredArgs(1, arguments);\n var datesArray; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\n\n if (dirtyDatesArray && typeof dirtyDatesArray.forEach === 'function') {\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array.\n } else if (typeof dirtyDatesArray === 'object' && dirtyDatesArray !== null) {\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\n } else {\n // `dirtyDatesArray` is non-iterable, return Invalid Date\n return new Date(NaN);\n }\n\n var result;\n datesArray.forEach(function (dirtyDate) {\n var currentDate = toDate(dirtyDate);\n\n if (result === undefined || result > currentDate || isNaN(currentDate.getDate())) {\n result = currentDate;\n }\n });\n return result || new Date(NaN);\n}","import max from \"../max/index.js\";\nimport min from \"../min/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name clamp\n * @category Interval Helpers\n * @summary Return a date bounded by the start and the end of the given interval\n *\n * @description\n * Clamps a date to the lower bound with the start of the interval and the upper\n * bound with the end of the interval.\n *\n * - When the date is less than the start of the interval, the start is returned.\n * - When the date is greater than the end of the interval, the end is returned.\n * - Otherwise the date is returned.\n *\n * @example\n * // What is Mar, 21, 2021 bounded to an interval starting at Mar, 22, 2021 and ending at Apr, 01, 2021\n * const result = clamp(new Date(2021, 2, 21), {\n * start: new Date(2021, 2, 22),\n * end: new Date(2021, 3, 1),\n * })\n * //=> Mon Mar 22 2021 00:00:00\n *\n * @param {Date | Number} date - the date to be bounded\n * @param {Interval} interval - the interval to bound to\n * @returns {Date} the date bounded by the start and the end of the interval\n * @throws {TypeError} 2 arguments required\n */\n\nexport default function clamp(date, _ref) {\n var start = _ref.start,\n end = _ref.end;\n requiredArgs(2, arguments);\n return min([max([date, start]), end]);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name closestIndexTo\n * @category Common Helpers\n * @summary Return an index of the closest date from the array comparing to the given date.\n *\n * @description\n * Return an index of the closest date from the array comparing to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now, `closestIndexTo` doesn't throw an exception\n * when the second argument is not an array, and returns Invalid Date instead.\n *\n * @param {Date | Number} dateToCompare - the date to compare with\n * @param {Array | Array} datesArray - the array to search\n * @returns {Number | undefined} an index of the date closest to the given date or undefined if no valid value is given\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Which date is closer to 6 September 2015?\n * const dateToCompare = new Date(2015, 8, 6)\n * const datesArray = [\n * new Date(2015, 0, 1),\n * new Date(2016, 0, 1),\n * new Date(2017, 0, 1)\n * ]\n * const result = closestIndexTo(dateToCompare, datesArray)\n * //=> 1\n */\n\nexport default function closestIndexTo(dirtyDateToCompare, dirtyDatesArray) {\n requiredArgs(2, arguments);\n var dateToCompare = toDate(dirtyDateToCompare);\n if (isNaN(Number(dateToCompare))) return NaN;\n var timeToCompare = dateToCompare.getTime();\n var datesArray; // `dirtyDatesArray` is undefined or null\n\n if (dirtyDatesArray == null) {\n datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\n } else if (typeof dirtyDatesArray.forEach === 'function') {\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array\n } else {\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\n }\n\n var result;\n var minDistance;\n datesArray.forEach(function (dirtyDate, index) {\n var currentDate = toDate(dirtyDate);\n\n if (isNaN(Number(currentDate))) {\n result = NaN;\n minDistance = NaN;\n return;\n }\n\n var distance = Math.abs(timeToCompare - currentDate.getTime());\n\n if (result == null || distance < Number(minDistance)) {\n result = index;\n minDistance = distance;\n }\n });\n return result;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name closestTo\n * @category Common Helpers\n * @summary Return a date from the array closest to the given date.\n *\n * @description\n * Return a date from the array closest to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now, `closestTo` doesn't throw an exception\n * when the second argument is not an array, and returns Invalid Date instead.\n *\n * @param {Date | Number} dateToCompare - the date to compare with\n * @param {Array | Array} datesArray - the array to search\n * @returns {Date | undefined} the date from the array closest to the given date or undefined if no valid value is given\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030?\n * const dateToCompare = new Date(2015, 8, 6)\n * const result = closestTo(dateToCompare, [\n * new Date(2000, 0, 1),\n * new Date(2030, 0, 1)\n * ])\n * //=> Tue Jan 01 2030 00:00:00\n */\n\nexport default function closestTo(dirtyDateToCompare, dirtyDatesArray) {\n requiredArgs(2, arguments);\n var dateToCompare = toDate(dirtyDateToCompare);\n if (isNaN(Number(dateToCompare))) return new Date(NaN);\n var timeToCompare = dateToCompare.getTime();\n var datesArray; // `dirtyDatesArray` is undefined or null\n\n if (dirtyDatesArray == null) {\n datesArray = []; // `dirtyDatesArray` is Array, Set or Map, or object with custom `forEach` method\n } else if (typeof dirtyDatesArray.forEach === 'function') {\n datesArray = dirtyDatesArray; // If `dirtyDatesArray` is Array-like Object, convert to Array. Otherwise, make it empty Array\n } else {\n datesArray = Array.prototype.slice.call(dirtyDatesArray);\n }\n\n var result;\n var minDistance;\n datesArray.forEach(function (dirtyDate) {\n var currentDate = toDate(dirtyDate);\n\n if (isNaN(Number(currentDate))) {\n result = new Date(NaN);\n minDistance = NaN;\n return;\n }\n\n var distance = Math.abs(timeToCompare - currentDate.getTime());\n\n if (result == null || distance < Number(minDistance)) {\n result = currentDate;\n minDistance = distance;\n }\n });\n return result;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\n\nexport default function compareAsc(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var diff = dateLeft.getTime() - dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name compareDesc\n * @category Common Helpers\n * @summary Compare the two dates reverse chronologically and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return -1 if the first date is after the second,\n * 1 if the first date is before the second or 0 if dates are equal.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989 reverse chronologically:\n * const result = compareDesc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> 1\n *\n * @example\n * // Sort the array of dates in reverse chronological order:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareDesc)\n * //=> [\n * // Sun Jul 02 1995 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Wed Feb 11 1987 00:00:00\n * // ]\n */\n\nexport default function compareDesc(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var diff = dateLeft.getTime() - dateRight.getTime();\n\n if (diff > 0) {\n return -1;\n } else if (diff < 0) {\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}","/**\n * Days in 1 week.\n *\n * @name daysInWeek\n * @constant\n * @type {number}\n * @default\n */\nexport var daysInWeek = 7;\n/**\n * Maximum allowed time.\n *\n * @name maxTime\n * @constant\n * @type {number}\n * @default\n */\n\nexport var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n/**\n * Milliseconds in 1 minute\n *\n * @name millisecondsInMinute\n * @constant\n * @type {number}\n * @default\n */\n\nexport var millisecondsInMinute = 60000;\n/**\n * Milliseconds in 1 hour\n *\n * @name millisecondsInHour\n * @constant\n * @type {number}\n * @default\n */\n\nexport var millisecondsInHour = 3600000;\n/**\n * Milliseconds in 1 second\n *\n * @name millisecondsInSecond\n * @constant\n * @type {number}\n * @default\n */\n\nexport var millisecondsInSecond = 1000;\n/**\n * Minimum allowed time.\n *\n * @name minTime\n * @constant\n * @type {number}\n * @default\n */\n\nexport var minTime = -maxTime;\n/**\n * Minutes in 1 hour\n *\n * @name minutesInHour\n * @constant\n * @type {number}\n * @default\n */\n\nexport var minutesInHour = 60;\n/**\n * Months in 1 quarter\n *\n * @name monthsInQuarter\n * @constant\n * @type {number}\n * @default\n */\n\nexport var monthsInQuarter = 3;\n/**\n * Months in 1 year\n *\n * @name monthsInYear\n * @constant\n * @type {number}\n * @default\n */\n\nexport var monthsInYear = 12;\n/**\n * Quarters in 1 year\n *\n * @name quartersInYear\n * @constant\n * @type {number}\n * @default\n */\n\nexport var quartersInYear = 4;\n/**\n * Seconds in 1 hour\n *\n * @name secondsInHour\n * @constant\n * @type {number}\n * @default\n */\n\nexport var secondsInHour = 3600;\n/**\n * Seconds in 1 minute\n *\n * @name secondsInMinute\n * @constant\n * @type {number}\n * @default\n */\n\nexport var secondsInMinute = 60;","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { daysInWeek } from \"../constants/index.js\";\n/**\n * @name daysToWeeks\n * @category Conversion Helpers\n * @summary Convert days to weeks.\n *\n * @description\n * Convert a number of days to a full number of weeks.\n *\n * @param {number} days - number of days to be converted\n *\n * @returns {number} the number of days converted in weeks\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 14 days to weeks:\n * const result = daysToWeeks(14)\n * //=> 2\n *\n * @example\n * // It uses floor rounding:\n * const result = daysToWeeks(13)\n * //=> 1\n */\n\nexport default function daysToWeeks(days) {\n requiredArgs(1, arguments);\n var weeks = days / daysInWeek;\n return Math.floor(weeks);\n}","import startOfDay from \"../startOfDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameDay\n * @category Day Helpers\n * @summary Are the given dates in the same day?\n *\n * @description\n * Are the given dates in the same day?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same day\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * var result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))\n * //=> true\n */\n\nexport default function isSameDay(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeftStartOfDay = startOfDay(dirtyDateLeft);\n var dateRightStartOfDay = startOfDay(dirtyDateRight);\n return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime();\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isDate\n * @category Common Helpers\n * @summary Is the given value a date?\n *\n * @description\n * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {*} value - the value to check\n * @returns {boolean} true if the given value is a date\n * @throws {TypeError} 1 arguments required\n *\n * @example\n * // For a valid date:\n * const result = isDate(new Date())\n * //=> true\n *\n * @example\n * // For an invalid date:\n * const result = isDate(new Date(NaN))\n * //=> true\n *\n * @example\n * // For some value:\n * const result = isDate('2014-02-31')\n * //=> false\n *\n * @example\n * // For an object:\n * const result = isDate({})\n * //=> false\n */\n\nexport default function isDate(value) {\n requiredArgs(1, arguments);\n return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';\n}","import isDate from \"../isDate/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isValid\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Now `isValid` doesn't throw an exception\n * if the first argument is not an instance of Date.\n * Instead, argument is converted beforehand using `toDate`.\n *\n * Examples:\n *\n * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |\n * |---------------------------|---------------|---------------|\n * | `new Date()` | `true` | `true` |\n * | `new Date('2016-01-01')` | `true` | `true` |\n * | `new Date('')` | `false` | `false` |\n * | `new Date(1488370835081)` | `true` | `true` |\n * | `new Date(NaN)` | `false` | `false` |\n * | `'2016-01-01'` | `TypeError` | `false` |\n * | `''` | `TypeError` | `false` |\n * | `1488370835081` | `TypeError` | `true` |\n * | `NaN` | `TypeError` | `false` |\n *\n * We introduce this change to make *date-fns* consistent with ECMAScript behavior\n * that try to coerce arguments to the expected type\n * (which is also the case with other *date-fns* functions).\n *\n * @param {*} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // For the valid date:\n * const result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the value, convertable into a date:\n * const result = isValid(1393804800000)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * const result = isValid(new Date(''))\n * //=> false\n */\n\nexport default function isValid(dirtyDate) {\n requiredArgs(1, arguments);\n\n if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {\n return false;\n }\n\n var date = toDate(dirtyDate);\n return !isNaN(Number(date));\n}","import addDays from \"../addDays/index.js\";\nimport differenceInCalendarDays from \"../differenceInCalendarDays/index.js\";\nimport isSameDay from \"../isSameDay/index.js\";\nimport isValid from \"../isValid/index.js\";\nimport isWeekend from \"../isWeekend/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name differenceInBusinessDays\n * @category Day Helpers\n * @summary Get the number of business days between the given dates.\n *\n * @description\n * Get the number of business day periods between the given dates.\n * Business days being days that arent in the weekend.\n * Like `differenceInCalendarDays`, the function removes the times from\n * the dates before calculating the difference.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of business days\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many business days are between\n * // 10 January 2014 and 20 July 2014?\n * const result = differenceInBusinessDays(\n * new Date(2014, 6, 20),\n * new Date(2014, 0, 10)\n * )\n * //=> 136\n *\n * // How many business days are between\n * // 1 November 2021 and 30 November 2021?\n * const result = differenceInBusinessDays(\n * new Date(2021, 10, 1),\n * new Date(2021, 10, 30)\n * )\n * //=> 21\n *\n * // How many business days are between\n * // 1 November 2021 and 1 December 2021?\n * const result = differenceInBusinessDays(\n * new Date(2021, 10, 1),\n * new Date(2021, 11, 1)\n * )\n * //=> 22\n *\n * // How many business days are between\n * // 1 November 2021 and 1 November 2021 ?\n * const result = differenceInBusinessDays(\n * new Date(2021, 10, 1),\n * new Date(2021, 10, 1)\n * )\n * //=> 0\n */\n\nexport default function differenceInBusinessDays(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n if (!isValid(dateLeft) || !isValid(dateRight)) return NaN;\n var calendarDifference = differenceInCalendarDays(dateLeft, dateRight);\n var sign = calendarDifference < 0 ? -1 : 1;\n var weeks = toInteger(calendarDifference / 7);\n var result = weeks * 5;\n dateRight = addDays(dateRight, weeks * 7); // the loop below will run at most 6 times to account for the remaining days that don't makeup a full week\n\n while (!isSameDay(dateLeft, dateRight)) {\n // sign is used to account for both negative and positive differences\n result += isWeekend(dateRight) ? 0 : sign;\n dateRight = addDays(dateRight, sign);\n }\n\n return result === 0 ? 0 : result;\n}","import getISOWeekYear from \"../getISOWeekYear/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarISOWeekYears\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of calendar ISO week-numbering years between the given dates.\n *\n * @description\n * Get the number of calendar ISO week-numbering years between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `differenceInCalendarISOYears` to `differenceInCalendarISOWeekYears`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar ISO week-numbering years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012?\n * const result = differenceInCalendarISOWeekYears(\n * new Date(2012, 0, 1),\n * new Date(2010, 0, 1)\n * )\n * //=> 2\n */\n\nexport default function differenceInCalendarISOWeekYears(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n return getISOWeekYear(dirtyDateLeft) - getISOWeekYear(dirtyDateRight);\n}","import getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport startOfISOWeek from \"../startOfISOWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000;\n/**\n * @name differenceInCalendarISOWeeks\n * @category ISO Week Helpers\n * @summary Get the number of calendar ISO weeks between the given dates.\n *\n * @description\n * Get the number of calendar ISO weeks between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar ISO weeks\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?\n * const result = differenceInCalendarISOWeeks(\n * new Date(2014, 6, 21),\n * new Date(2014, 6, 6)\n * )\n * //=> 3\n */\n\nexport default function differenceInCalendarISOWeeks(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var startOfISOWeekLeft = startOfISOWeek(dirtyDateLeft);\n var startOfISOWeekRight = startOfISOWeek(dirtyDateRight);\n var timestampLeft = startOfISOWeekLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfISOWeekLeft);\n var timestampRight = startOfISOWeekRight.getTime() - getTimezoneOffsetInMilliseconds(startOfISOWeekRight); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * var result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\n\nexport default function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\n var monthDiff = dateLeft.getMonth() - dateRight.getMonth();\n return yearDiff * 12 + monthDiff;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getQuarter\n * @category Quarter Helpers\n * @summary Get the year quarter of the given date.\n *\n * @description\n * Get the year quarter of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the quarter\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which quarter is 2 July 2014?\n * const result = getQuarter(new Date(2014, 6, 2))\n * //=> 3\n */\n\nexport default function getQuarter(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var quarter = Math.floor(date.getMonth() / 3) + 1;\n return quarter;\n}","import getQuarter from \"../getQuarter/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarQuarters\n * @category Quarter Helpers\n * @summary Get the number of calendar quarters between the given dates.\n *\n * @description\n * Get the number of calendar quarters between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar quarters\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar quarters are between 31 December 2013 and 2 July 2014?\n * var result = differenceInCalendarQuarters(\n * new Date(2014, 6, 2),\n * new Date(2013, 11, 31)\n * )\n * //=> 3\n */\n\nexport default function differenceInCalendarQuarters(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\n var quarterDiff = getQuarter(dateLeft) - getQuarter(dateRight);\n return yearDiff * 4 + quarterDiff;\n}","import startOfWeek from \"../startOfWeek/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000;\n/**\n * @name differenceInCalendarWeeks\n * @category Week Helpers\n * @summary Get the number of calendar weeks between the given dates.\n *\n * @description\n * Get the number of calendar weeks between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Number} the number of calendar weeks\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // How many calendar weeks are between 5 July 2014 and 20 July 2014?\n * const result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5)\n * )\n * //=> 3\n *\n * @example\n * // If the week starts on Monday,\n * // how many calendar weeks are between 5 July 2014 and 20 July 2014?\n * const result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5),\n * { weekStartsOn: 1 }\n * )\n * //=> 2\n */\n\nexport default function differenceInCalendarWeeks(dirtyDateLeft, dirtyDateRight, dirtyOptions) {\n requiredArgs(2, arguments);\n var startOfWeekLeft = startOfWeek(dirtyDateLeft, dirtyOptions);\n var startOfWeekRight = startOfWeek(dirtyDateRight, dirtyOptions);\n var timestampLeft = startOfWeekLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekLeft);\n var timestampRight = startOfWeekRight.getTime() - getTimezoneOffsetInMilliseconds(startOfWeekRight); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\n\nexport default function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() - dateRight.getFullYear();\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarDays from \"../differenceInCalendarDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // Like `compareAsc` but uses local time not UTC, which is needed\n// for accurate equality comparisons of UTC timestamps that end up\n// having the same representation in local time, e.g. one hour before\n// DST ends vs. the instant that DST ends.\n\nfunction compareLocalAsc(dateLeft, dateRight) {\n var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between two dates. Fractional days are\n * truncated towards zero.\n *\n * One \"full day\" is the distance between a local time in one day to the same\n * local time on the next or previous day. A full day can sometimes be less than\n * or more than 24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 24-hour periods, use this instead:\n * `Math.floor(differenceInHours(dateLeft, dateRight)/24)|0`.\n *\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full days according to the local timezone\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n * // How many full days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n * // How many full days are between\n * // 1 March 2020 0:00 and 1 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 92 days, even in\n * // time zones where DST starts and the\n * // period has only 92*24-1 hours.\n * const result = differenceInDays(\n * new Date(2020, 5, 1),\n * new Date(2020, 2, 1)\n * )\n//=> 92\n */\n\n\nexport default function differenceInDays(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareLocalAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));\n dateLeft.setDate(dateLeft.getDate() - sign * difference); // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign);\n var result = sign * (difference - isLastDayNotFull); // Prevent negative zero\n\n return result === 0 ? 0 : result;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\n\nexport default function differenceInMilliseconds(dateLeft, dateRight) {\n requiredArgs(2, arguments);\n return toDate(dateLeft).getTime() - toDate(dateRight).getTime();\n}","var roundingMap = {\n ceil: Math.ceil,\n round: Math.round,\n floor: Math.floor,\n trunc: function (value) {\n return value < 0 ? Math.ceil(value) : Math.floor(value);\n } // Math.trunc is not supported by IE\n\n};\nvar defaultRoundingMethod = 'trunc';\nexport function getRoundingMethod(method) {\n return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];\n}","import { millisecondsInHour } from \"../constants/index.js\";\nimport differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of hours\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\n\nexport default function differenceInHours(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addISOWeekYears from \"../addISOWeekYears/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subISOWeekYears\n * @category ISO Week-Numbering Year Helpers\n * @summary Subtract the specified number of ISO week-numbering years from the given date.\n *\n * @description\n * Subtract the specified number of ISO week-numbering years from the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `subISOYears` to `subISOWeekYears`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `setWeekYear`.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of ISO week-numbering years to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the ISO week-numbering years subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 5 ISO week-numbering years from 1 September 2014:\n * const result = subISOWeekYears(new Date(2014, 8, 1), 5)\n * //=> Mon Aug 31 2009 00:00:00\n */\n\nexport default function subISOWeekYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addISOWeekYears(dirtyDate, -amount);\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarISOWeekYears from \"../differenceInCalendarISOWeekYears/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport subISOWeekYears from \"../subISOWeekYears/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInISOWeekYears\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of full ISO week-numbering years between the given dates.\n *\n * @description\n * Get the number of full ISO week-numbering years between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `differenceInISOYears` to `differenceInISOWeekYears`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full ISO week-numbering years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?\n * var result = differenceInISOWeekYears(\n * new Date(2012, 0, 1),\n * new Date(2010, 0, 1)\n * )\n * //=> 1\n */\n\nexport default function differenceInISOWeekYears(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarISOWeekYears(dateLeft, dateRight));\n dateLeft = subISOWeekYears(dateLeft, sign * difference); // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1\n // if last calendar ISO year is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastISOWeekYearNotFull = Number(compareAsc(dateLeft, dateRight) === -sign);\n var result = sign * (difference - isLastISOWeekYearNotFull); // Prevent negative zero\n\n return result === 0 ? 0 : result;\n}","import { millisecondsInMinute } from \"../constants/index.js\";\nimport differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of minutes\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\n\nexport default function differenceInMinutes(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\n\nexport default function endOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\n\nexport default function endOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport endOfDay from \"../endOfDay/index.js\";\nimport endOfMonth from \"../endOfMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is the last day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * var result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\n\nexport default function isLastDayOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n return endOfDay(date).getTime() === endOfMonth(date).getTime();\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarMonths from \"../differenceInCalendarMonths/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport isLastDayOfMonth from \"../isLastDayOfMonth/index.js\";\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates using trunc as a default rounding method.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\n\nexport default function differenceInMonths(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));\n var result; // Check for the difference of less than month\n\n if (difference < 1) {\n result = 0;\n } else {\n if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {\n // This will check if the date is end of Feb and assign a higher end of month date\n // to compare it with Jan\n dateLeft.setDate(30);\n }\n\n dateLeft.setMonth(dateLeft.getMonth() - sign * difference); // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign; // Check for cases of one full calendar month\n\n if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {\n isLastMonthNotFull = false;\n }\n\n result = sign * (difference - Number(isLastMonthNotFull));\n } // Prevent negative zero\n\n\n return result === 0 ? 0 : result;\n}","import differenceInMonths from \"../differenceInMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInQuarters\n * @category Quarter Helpers\n * @summary Get the number of quarters between the given dates.\n *\n * @description\n * Get the number of quarters between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of full quarters\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full quarters are between 31 December 2013 and 2 July 2014?\n * const result = differenceInQuarters(new Date(2014, 6, 2), new Date(2013, 11, 31))\n * //=> 2\n */\n\nexport default function differenceInQuarters(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMonths(dateLeft, dateRight) / 3;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of seconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\n\nexport default function differenceInSeconds(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import differenceInDays from \"../differenceInDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInWeeks\n * @category Week Helpers\n * @summary Get the number of full weeks between the given dates.\n *\n * @description\n * Get the number of full weeks between two dates. Fractional weeks are\n * truncated towards zero by default.\n *\n * One \"full week\" is the distance between a local time in one day to the same\n * local time 7 days earlier or later. A full week can sometimes be less than\n * or more than 7*24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 7*24-hour periods, use this instead:\n * `Math.floor(differenceInHours(dateLeft, dateRight)/(7*24))|0`.\n *\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of full weeks\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full weeks are between 5 July 2014 and 20 July 2014?\n * const result = differenceInWeeks(new Date(2014, 6, 20), new Date(2014, 6, 5))\n * //=> 2\n *\n * // How many full weeks are between\n * // 1 March 2020 0:00 and 6 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 8 weeks (54 days),\n * // even if DST starts and the period has\n * // only 54*24-1 hours.\n * const result = differenceInWeeks(\n * new Date(2020, 5, 1),\n * new Date(2020, 2, 6)\n * )\n * //=> 8\n */\n\nexport default function differenceInWeeks(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInDays(dateLeft, dateRight) / 7;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarYears from \"../differenceInCalendarYears/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\n\nexport default function differenceInYears(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight)); // Set both dates to a valid leap year for accurate comparison when dealing\n // with leap days\n\n dateLeft.setFullYear(1584);\n dateRight.setFullYear(1584); // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign;\n var result = sign * (difference - Number(isLastYearNotFull)); // Prevent negative zero\n\n return result === 0 ? 0 : result;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name eachDayOfInterval\n * @category Interval Helpers\n * @summary Return the array of dates within the specified time interval.\n *\n * @description\n * Return the array of dates within the specified time interval.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `eachDay` to `eachDayOfInterval`.\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\n *\n * ```\n * 2.1.3\n * time interval\n * part of the time axis limited by two instants\n * ```\n *\n * Also, this function now accepts an object with `start` and `end` properties\n * instead of two arguments as an interval.\n * This function now throws `RangeError` if the start of the interval is after its end\n * or if any date in the interval is `Invalid Date`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * eachDay(new Date(2014, 0, 10), new Date(2014, 0, 20))\n *\n * // v2.0.0 onward\n *\n * eachDayOfInterval(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) }\n * )\n * ```\n *\n * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @param {Object} [options] - an object with options.\n * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1.\n * @returns {Date[]} the array with starts of days from the day of the interval start to the day of the interval end\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.step` must be a number greater than 1\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Each day between 6 October 2014 and 10 October 2014:\n * const result = eachDayOfInterval({\n * start: new Date(2014, 9, 6),\n * end: new Date(2014, 9, 10)\n * })\n * //=> [\n * // Mon Oct 06 2014 00:00:00,\n * // Tue Oct 07 2014 00:00:00,\n * // Wed Oct 08 2014 00:00:00,\n * // Thu Oct 09 2014 00:00:00,\n * // Fri Oct 10 2014 00:00:00\n * // ]\n */\n\nexport default function eachDayOfInterval(dirtyInterval, options) {\n requiredArgs(1, arguments);\n var interval = dirtyInterval || {};\n var startDate = toDate(interval.start);\n var endDate = toDate(interval.end);\n var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startDate.getTime() <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var dates = [];\n var currentDate = startDate;\n currentDate.setHours(0, 0, 0, 0);\n var step = options && 'step' in options ? Number(options.step) : 1;\n if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1');\n\n while (currentDate.getTime() <= endTime) {\n dates.push(toDate(currentDate));\n currentDate.setDate(currentDate.getDate() + step);\n currentDate.setHours(0, 0, 0, 0);\n }\n\n return dates;\n}","import addHours from \"../addHours/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name eachHourOfInterval\n * @category Interval Helpers\n * @summary Return the array of hours within the specified time interval.\n *\n * @description\n * Return the array of hours within the specified time interval.\n *\n * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @param {Object} [options] - an object with options.\n * @param {Number} [options.step=1] - the step to increment by. The value should be more than 1.\n * @returns {Date[]} the array with starts of hours from the hour of the interval start to the hour of the interval end\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.step` must be a number greater than 1\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Each hour between 6 October 2014, 12:00 and 6 October 2014, 15:00\n * var result = eachHourOfInterval({\n * start: new Date(2014, 9, 6, 12),\n * end: new Date(2014, 9, 6, 15)\n * })\n * //=> [\n * // Mon Oct 06 2014 12:00:00,\n * // Mon Oct 06 2014 13:00:00,\n * // Mon Oct 06 2014 14:00:00,\n * // Mon Oct 06 2014 15:00:00\n * // ]\n */\nexport default function eachHourOfInterval(dirtyInterval, options) {\n requiredArgs(1, arguments);\n var interval = dirtyInterval || {};\n var startDate = toDate(interval.start);\n var endDate = toDate(interval.end);\n var startTime = startDate.getTime();\n var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startTime <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var dates = [];\n var currentDate = startDate;\n currentDate.setMinutes(0, 0, 0);\n var step = options && 'step' in options ? Number(options.step) : 1;\n if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number greater than 1');\n\n while (currentDate.getTime() <= endTime) {\n dates.push(toDate(currentDate));\n currentDate = addHours(currentDate, step);\n }\n\n return dates;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfMinute\n * @category Minute Helpers\n * @summary Return the start of a minute for the given date.\n *\n * @description\n * Return the start of a minute for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a minute\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a minute for 1 December 2014 22:15:45.400:\n * const result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:00\n */\n\nexport default function startOfMinute(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setSeconds(0, 0);\n return date;\n}","import addMinutes from \"../addMinutes/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport startOfMinute from \"../startOfMinute/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name eachMinuteOfInterval\n * @category Interval Helpers\n * @summary Return the array of minutes within the specified time interval.\n *\n * @description\n * Returns the array of minutes within the specified time interval.\n *\n * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @param {Object} [options] - an object with options.\n * @param {Number} [options.step=1] - the step to increment by. The starts of minutes from the hour of the interval start to the hour of the interval end\n * @throws {TypeError} 1 argument requie value should be more than 1.\n * @returns {Date[]} the array withred\n * @throws {RangeError} `options.step` must be a number equal or greater than 1\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Each minute between 14 October 2020, 13:00 and 14 October 2020, 13:03\n * const result = eachMinuteOfInterval({\n * start: new Date(2014, 9, 14, 13),\n * end: new Date(2014, 9, 14, 13, 3)\n * })\n * //=> [\n * // Wed Oct 14 2014 13:00:00,\n * // Wed Oct 14 2014 13:01:00,\n * // Wed Oct 14 2014 13:02:00,\n * // Wed Oct 14 2014 13:03:00\n * // ]\n */\nexport default function eachMinuteOfInterval(interval, options) {\n requiredArgs(1, arguments);\n var startDate = startOfMinute(toDate(interval.start));\n var endDate = startOfMinute(toDate(interval.end));\n var startTime = startDate.getTime();\n var endTime = endDate.getTime();\n\n if (startTime >= endTime) {\n throw new RangeError('Invalid interval');\n }\n\n var dates = [];\n var currentDate = startDate;\n var step = options && 'step' in options ? Number(options.step) : 1;\n if (step < 1 || isNaN(step)) throw new RangeError('`options.step` must be a number equal or greater than 1');\n\n while (currentDate.getTime() <= endTime) {\n dates.push(toDate(currentDate));\n currentDate = addMinutes(currentDate, step);\n }\n\n return dates;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name eachMonthOfInterval\n * @category Interval Helpers\n * @summary Return the array of months within the specified time interval.\n *\n * @description\n * Return the array of months within the specified time interval.\n *\n * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @returns {Date[]} the array with starts of months from the month of the interval start to the month of the interval end\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Each month between 6 February 2014 and 10 August 2014:\n * var result = eachMonthOfInterval({\n * start: new Date(2014, 1, 6),\n * end: new Date(2014, 7, 10)\n * })\n * //=> [\n * // Sat Feb 01 2014 00:00:00,\n * // Sat Mar 01 2014 00:00:00,\n * // Tue Apr 01 2014 00:00:00,\n * // Thu May 01 2014 00:00:00,\n * // Sun Jun 01 2014 00:00:00,\n * // Tue Jul 01 2014 00:00:00,\n * // Fri Aug 01 2014 00:00:00\n * // ]\n */\n\nexport default function eachMonthOfInterval(dirtyInterval) {\n requiredArgs(1, arguments);\n var interval = dirtyInterval || {};\n var startDate = toDate(interval.start);\n var endDate = toDate(interval.end);\n var endTime = endDate.getTime();\n var dates = []; // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startDate.getTime() <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var currentDate = startDate;\n currentDate.setHours(0, 0, 0, 0);\n currentDate.setDate(1);\n\n while (currentDate.getTime() <= endTime) {\n dates.push(toDate(currentDate));\n currentDate.setMonth(currentDate.getMonth() + 1);\n }\n\n return dates;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfQuarter\n * @category Quarter Helpers\n * @summary Return the start of a year quarter for the given date.\n *\n * @description\n * Return the start of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a quarter\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a quarter for 2 September 2014 11:55:00:\n * const result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Jul 01 2014 00:00:00\n */\n\nexport default function startOfQuarter(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var currentMonth = date.getMonth();\n var month = currentMonth - currentMonth % 3;\n date.setMonth(month, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import addQuarters from \"../addQuarters/index.js\";\nimport startOfQuarter from \"../startOfQuarter/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name eachQuarterOfInterval\n * @category Interval Helpers\n * @summary Return the array of quarters within the specified time interval.\n *\n * @description\n * Return the array of quarters within the specified time interval.\n *\n * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @returns {Date[]} the array with starts of quarters from the quarter of the interval start to the quarter of the interval end\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Each quarter within interval 6 February 2014 - 10 August 2014:\n * var result = eachQuarterOfInterval({\n * start: new Date(2014, 1, 6),\n * end: new Date(2014, 7, 10)\n * })\n * //=> [\n * // Wed Jan 01 2014 00:00:00,\n * // Tue Apr 01 2014 00:00:00,\n * // Tue Jul 01 2014 00:00:00,\n * // ]\n */\n\nexport default function eachQuarterOfInterval(dirtyInterval) {\n requiredArgs(1, arguments);\n var interval = dirtyInterval || {};\n var startDate = toDate(interval.start);\n var endDate = toDate(interval.end);\n var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startDate.getTime() <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var startDateQuarter = startOfQuarter(startDate);\n var endDateQuarter = startOfQuarter(endDate);\n endTime = endDateQuarter.getTime();\n var quarters = [];\n var currentQuarter = startDateQuarter;\n\n while (currentQuarter.getTime() <= endTime) {\n quarters.push(toDate(currentQuarter));\n currentQuarter = addQuarters(currentQuarter, 1);\n }\n\n return quarters;\n}","import addWeeks from \"../addWeeks/index.js\";\nimport startOfWeek from \"../startOfWeek/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name eachWeekOfInterval\n * @category Interval Helpers\n * @summary Return the array of weeks within the specified time interval.\n *\n * @description\n * Return the array of weeks within the specified time interval.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date[]} the array with starts of weeks from the week of the interval start to the week of the interval end\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be 0, 1, ..., 6\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Each week within interval 6 October 2014 - 23 November 2014:\n * var result = eachWeekOfInterval({\n * start: new Date(2014, 9, 6),\n * end: new Date(2014, 10, 23)\n * })\n * //=> [\n * // Sun Oct 05 2014 00:00:00,\n * // Sun Oct 12 2014 00:00:00,\n * // Sun Oct 19 2014 00:00:00,\n * // Sun Oct 26 2014 00:00:00,\n * // Sun Nov 02 2014 00:00:00,\n * // Sun Nov 09 2014 00:00:00,\n * // Sun Nov 16 2014 00:00:00,\n * // Sun Nov 23 2014 00:00:00\n * // ]\n */\n\nexport default function eachWeekOfInterval(dirtyInterval, options) {\n requiredArgs(1, arguments);\n var interval = dirtyInterval || {};\n var startDate = toDate(interval.start);\n var endDate = toDate(interval.end);\n var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startDate.getTime() <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var startDateWeek = startOfWeek(startDate, options);\n var endDateWeek = startOfWeek(endDate, options); // Some timezones switch DST at midnight, making start of day unreliable in these timezones, 3pm is a safe bet\n\n startDateWeek.setHours(15);\n endDateWeek.setHours(15);\n endTime = endDateWeek.getTime();\n var weeks = [];\n var currentWeek = startDateWeek;\n\n while (currentWeek.getTime() <= endTime) {\n currentWeek.setHours(0);\n weeks.push(toDate(currentWeek));\n currentWeek = addWeeks(currentWeek, 1);\n currentWeek.setHours(15);\n }\n\n return weeks;\n}","import eachDayOfInterval from \"../eachDayOfInterval/index.js\";\nimport isSunday from \"../isSunday/index.js\";\nimport isWeekend from \"../isWeekend/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name eachWeekendOfInterval\n * @category Interval Helpers\n * @summary List all the Saturdays and Sundays in the given date interval.\n *\n * @description\n * Get all the Saturdays and Sundays in the given date interval.\n *\n * @param {Interval} interval - the given interval. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @returns {Date[]} an array containing all the Saturdays and Sundays\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Lists all Saturdays and Sundays in the given date interval\n * const result = eachWeekendOfInterval({\n * start: new Date(2018, 8, 17),\n * end: new Date(2018, 8, 30)\n * })\n * //=> [\n * // Sat Sep 22 2018 00:00:00,\n * // Sun Sep 23 2018 00:00:00,\n * // Sat Sep 29 2018 00:00:00,\n * // Sun Sep 30 2018 00:00:00\n * // ]\n */\n\nexport default function eachWeekendOfInterval(interval) {\n requiredArgs(1, arguments);\n var dateInterval = eachDayOfInterval(interval);\n var weekends = [];\n var index = 0;\n\n while (index < dateInterval.length) {\n var date = dateInterval[index++];\n\n if (isWeekend(date)) {\n weekends.push(date);\n if (isSunday(date)) index = index + 5;\n }\n }\n\n return weekends;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfMonth\n * @category Month Helpers\n * @summary Return the start of a month for the given date.\n *\n * @description\n * Return the start of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a month for 2 September 2014 11:55:00:\n * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\n\nexport default function startOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import eachWeekendOfInterval from \"../eachWeekendOfInterval/index.js\";\nimport startOfMonth from \"../startOfMonth/index.js\";\nimport endOfMonth from \"../endOfMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name eachWeekendOfMonth\n * @category Month Helpers\n * @summary List all the Saturdays and Sundays in the given month.\n *\n * @description\n * Get all the Saturdays and Sundays in the given month.\n *\n * @param {Date|Number} date - the given month\n * @returns {Date[]} an array containing all the Saturdays and Sundays\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} The passed date is invalid\n *\n * @example\n * // Lists all Saturdays and Sundays in the given month\n * const result = eachWeekendOfMonth(new Date(2022, 1, 1))\n * //=> [\n * // Sat Feb 05 2022 00:00:00,\n * // Sun Feb 06 2022 00:00:00,\n * // Sat Feb 12 2022 00:00:00,\n * // Sun Feb 13 2022 00:00:00,\n * // Sat Feb 19 2022 00:00:00,\n * // Sun Feb 20 2022 00:00:00,\n * // Sat Feb 26 2022 00:00:00,\n * // Sun Feb 27 2022 00:00:00\n * // ]\n */\n\nexport default function eachWeekendOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var startDate = startOfMonth(dirtyDate);\n if (isNaN(startDate.getTime())) throw new RangeError('The passed date is invalid');\n var endDate = endOfMonth(dirtyDate);\n return eachWeekendOfInterval({\n start: startDate,\n end: endDate\n });\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfYear\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\n\nexport default function startOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var cleanDate = toDate(dirtyDate);\n var date = new Date(0);\n date.setFullYear(cleanDate.getFullYear(), 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfYear\n * @category Year Helpers\n * @summary Return the end of a year for the given date.\n *\n * @description\n * Return the end of a year for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a year for 2 September 2014 11:55:00:\n * var result = endOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Dec 31 2014 23:59:59.999\n */\n\nexport default function endOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n date.setFullYear(year + 1, 0, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import eachWeekendOfInterval from \"../eachWeekendOfInterval/index.js\";\nimport startOfYear from \"../startOfYear/index.js\";\nimport endOfYear from \"../endOfYear/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name eachWeekendOfYear\n * @category Year Helpers\n * @summary List all the Saturdays and Sundays in the year.\n *\n * @description\n * Get all the Saturdays and Sundays in the year.\n *\n * @param {Date|Number} date - the given year\n * @returns {Date[]} an array containing all the Saturdays and Sundays\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} The passed date is invalid\n *\n * @example\n * // Lists all Saturdays and Sundays in the year\n * var result = eachWeekendOfYear(new Date(2020, 1, 1))\n * //=> [\n * // Sat Jan 03 2020 00:00:00,\n * // Sun Jan 04 2020 00:00:00,\n * // ...\n * // Sun Dec 27 2020 00:00:00\n * // ]\n * ]\n */\n\nexport default function eachWeekendOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var startDate = startOfYear(dirtyDate);\n if (isNaN(startDate)) throw new RangeError('The passed date is invalid');\n var endDate = endOfYear(dirtyDate);\n return eachWeekendOfInterval({\n start: startDate,\n end: endDate\n });\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name eachYearOfInterval\n * @category Interval Helpers\n * @summary Return the array of yearly timestamps within the specified time interval.\n *\n * @description\n * Return the array of yearly timestamps within the specified time interval.\n *\n * @param {Interval} interval - the interval. See [Interval]{@link https://date-fns.org/docs/Interval}\n * @returns {Date[]} the array with starts of yearly timestamps from the month of the interval start to the month of the interval end\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // Each year between 6 February 2014 and 10 August 2017:\n * const result = eachYearOfInterval({\n * start: new Date(2014, 1, 6),\n * end: new Date(2017, 7, 10)\n * })\n * //=> [\n * // Wed Jan 01 2014 00:00:00,\n * // Thu Jan 01 2015 00:00:00,\n * // Fri Jan 01 2016 00:00:00,\n * // Sun Jan 01 2017 00:00:00\n * // ]\n */\n\nexport default function eachYearOfInterval(dirtyInterval) {\n requiredArgs(1, arguments);\n var interval = dirtyInterval || {};\n var startDate = toDate(interval.start);\n var endDate = toDate(interval.end);\n var endTime = endDate.getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startDate.getTime() <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var dates = [];\n var currentDate = startDate;\n currentDate.setHours(0, 0, 0, 0);\n currentDate.setMonth(0, 1);\n\n while (currentDate.getTime() <= endTime) {\n dates.push(toDate(currentDate));\n currentDate.setFullYear(currentDate.getFullYear() + 1);\n }\n\n return dates;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfDecade\n * @category Decade Helpers\n * @summary Return the end of a decade for the given date.\n *\n * @description\n * Return the end of a decade for the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a decade\n * @param {Object} [options] - an object with options.\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // The end of a decade for 12 May 1984 00:00:00:\n * const result = endOfDecade(new Date(1984, 4, 12, 00, 00, 00))\n * //=> Dec 31 1989 23:59:59.999\n */\n\nexport default function endOfDecade(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var decade = 9 + Math.floor(year / 10) * 10;\n date.setFullYear(decade, 11, 31);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfHour\n * @category Hour Helpers\n * @summary Return the end of an hour for the given date.\n *\n * @description\n * Return the end of an hour for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of an hour\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of an hour for 2 September 2014 11:55:00:\n * const result = endOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:59:59.999\n */\n\nexport default function endOfHour(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setMinutes(59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name endOfWeek\n * @category Week Helpers\n * @summary Return the end of a week for the given date.\n *\n * @description\n * Return the end of a week for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the end of a week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // The end of a week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 23:59:59.999\n *\n * @example\n * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:\n * const result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nexport default function endOfWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n date.setDate(date.getDate() + diff);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import endOfWeek from \"../endOfWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the end of an ISO week for the given date.\n *\n * @description\n * Return the end of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of an ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of an ISO week for 2 September 2014 11:55:00:\n * var result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 23:59:59.999\n */\n\nexport default function endOfISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n return endOfWeek(dirtyDate, {\n weekStartsOn: 1\n });\n}","import getISOWeekYear from \"../getISOWeekYear/index.js\";\nimport startOfISOWeek from \"../startOfISOWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the end of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the end of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `endOfISOYear` to `endOfISOWeekYear`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `addWeekYears`.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of an ISO week-numbering year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of an ISO week-numbering year for 2 July 2005:\n * const result = endOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Sun Jan 01 2006 23:59:59.999\n */\n\nexport default function endOfISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getISOWeekYear(dirtyDate);\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);\n var date = startOfISOWeek(fourthOfJanuaryOfNextYear);\n date.setMilliseconds(date.getMilliseconds() - 1);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMinute\n * @category Minute Helpers\n * @summary Return the end of a minute for the given date.\n *\n * @description\n * Return the end of a minute for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a minute\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a minute for 1 December 2014 22:15:45.400:\n * const result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:59.999\n */\n\nexport default function endOfMinute(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setSeconds(59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfQuarter\n * @category Quarter Helpers\n * @summary Return the end of a year quarter for the given date.\n *\n * @description\n * Return the end of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a quarter\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a quarter for 2 September 2014 11:55:00:\n * const result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\n\nexport default function endOfQuarter(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var currentMonth = date.getMonth();\n var month = currentMonth - currentMonth % 3 + 3;\n date.setMonth(month, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfSecond\n * @category Second Helpers\n * @summary Return the end of a second for the given date.\n *\n * @description\n * Return the end of a second for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a second\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a second for 1 December 2014 22:15:45.400:\n * const result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.999\n */\n\nexport default function endOfSecond(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setMilliseconds(999);\n return date;\n}","import endOfDay from \"../endOfDay/index.js\";\n/**\n * @name endOfToday\n * @category Day Helpers\n * @summary Return the end of today.\n * @pure false\n *\n * @description\n * Return the end of today.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the end of today\n *\n * @example\n * // If today is 6 October 2014:\n * var result = endOfToday()\n * //=> Mon Oct 6 2014 23:59:59.999\n */\n\nexport default function endOfToday() {\n return endOfDay(Date.now());\n}","/**\n * @name endOfTomorrow\n * @category Day Helpers\n * @summary Return the end of tomorrow.\n * @pure false\n *\n * @description\n * Return the end of tomorrow.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `new Date()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the end of tomorrow\n *\n * @example\n * // If today is 6 October 2014:\n * const result = endOfTomorrow()\n * //=> Tue Oct 7 2014 23:59:59.999\n */\nexport default function endOfTomorrow() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth();\n var day = now.getDate();\n var date = new Date(0);\n date.setFullYear(year, month, day + 1);\n date.setHours(23, 59, 59, 999);\n return date;\n}","/**\n * @name endOfYesterday\n * @category Day Helpers\n * @summary Return the end of yesterday.\n * @pure false\n *\n * @description\n * Return the end of yesterday.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `new Date()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the end of yesterday\n *\n * @example\n * // If today is 6 October 2014:\n * const result = endOfYesterday()\n * //=> Sun Oct 5 2014 23:59:59.999\n */\nexport default function endOfYesterday() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth();\n var day = now.getDate();\n var date = new Date(0);\n date.setFullYear(year, month, day - 1);\n date.setHours(23, 59, 59, 999);\n return date;\n}","var formatDistanceLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n halfAMinute: 'half a minute',\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n aboutXWeeks: {\n one: 'about 1 week',\n other: 'about {{count}} weeks'\n },\n xWeeks: {\n one: '1 week',\n other: '{{count}} weeks'\n },\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n};\n\nvar formatDistance = function (token, count, options) {\n var result;\n var tokenValue = formatDistanceLocale[token];\n\n if (typeof tokenValue === 'string') {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace('{{count}}', count.toString());\n }\n\n if (options !== null && options !== void 0 && options.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return 'in ' + result;\n } else {\n return result + ' ago';\n }\n }\n\n return result;\n};\n\nexport default formatDistance;","export default function buildFormatLongFn(args) {\n return function () {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // TODO: Remove String()\n var width = options.width ? String(options.width) : args.defaultWidth;\n var format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}","import buildFormatLongFn from \"../../../_lib/buildFormatLongFn/index.js\";\nvar dateFormats = {\n full: 'EEEE, MMMM do, y',\n long: 'MMMM do, y',\n medium: 'MMM d, y',\n short: 'MM/dd/yyyy'\n};\nvar timeFormats = {\n full: 'h:mm:ss a zzzz',\n long: 'h:mm:ss a z',\n medium: 'h:mm:ss a',\n short: 'h:mm a'\n};\nvar dateTimeFormats = {\n full: \"{{date}} 'at' {{time}}\",\n long: \"{{date}} 'at' {{time}}\",\n medium: '{{date}}, {{time}}',\n short: '{{date}}, {{time}}'\n};\nvar formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: 'full'\n }),\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: 'full'\n }),\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: 'full'\n })\n};\nexport default formatLong;","var formatRelativeLocale = {\n lastWeek: \"'last' eeee 'at' p\",\n yesterday: \"'yesterday at' p\",\n today: \"'today at' p\",\n tomorrow: \"'tomorrow at' p\",\n nextWeek: \"eeee 'at' p\",\n other: 'P'\n};\n\nvar formatRelative = function (token, _date, _baseDate, _options) {\n return formatRelativeLocale[token];\n};\n\nexport default formatRelative;","export default function buildLocalizeFn(args) {\n return function (dirtyIndex, dirtyOptions) {\n var options = dirtyOptions || {};\n var context = options.context ? String(options.context) : 'standalone';\n var valuesArray;\n\n if (context === 'formatting' && args.formattingValues) {\n var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n var width = options.width ? String(options.width) : defaultWidth;\n valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n var _defaultWidth = args.defaultWidth;\n\n var _width = options.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[_width] || args.values[_defaultWidth];\n }\n\n var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challange you to try to remove it!\n\n return valuesArray[index];\n };\n}","export default function buildMatchFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var width = options.width;\n var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];\n var matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n\n var matchedString = matchResult[0];\n var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];\n var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n }) : findKey(parsePatterns, function (pattern) {\n return pattern.test(matchedString);\n });\n var value;\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}\n\nfunction findKey(object, predicate) {\n for (var key in object) {\n if (object.hasOwnProperty(key) && predicate(object[key])) {\n return key;\n }\n }\n\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (var key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n\n return undefined;\n}","import buildMatchFn from \"../../../_lib/buildMatchFn/index.js\";\nimport buildMatchPatternFn from \"../../../_lib/buildMatchPatternFn/index.js\";\nvar matchOrdinalNumberPattern = /^(\\d+)(th|st|nd|rd)?/i;\nvar parseOrdinalNumberPattern = /\\d+/i;\nvar matchEraPatterns = {\n narrow: /^(b|a)/i,\n abbreviated: /^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,\n wide: /^(before christ|before common era|anno domini|common era)/i\n};\nvar parseEraPatterns = {\n any: [/^b/i, /^(a|c)/i]\n};\nvar matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^q[1234]/i,\n wide: /^[1234](th|st|nd|rd)? quarter/i\n};\nvar parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i]\n};\nvar matchMonthPatterns = {\n narrow: /^[jfmasond]/i,\n abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,\n wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i\n};\nvar parseMonthPatterns = {\n narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],\n any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]\n};\nvar matchDayPatterns = {\n narrow: /^[smtwf]/i,\n short: /^(su|mo|tu|we|th|fr|sa)/i,\n abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,\n wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i\n};\nvar parseDayPatterns = {\n narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],\n any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]\n};\nvar matchDayPeriodPatterns = {\n narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,\n any: /^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i\n};\nvar parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mi/i,\n noon: /^no/i,\n morning: /morning/i,\n afternoon: /afternoon/i,\n evening: /evening/i,\n night: /night/i\n }\n};\nvar match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: function (value) {\n return parseInt(value, 10);\n }\n }),\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseEraPatterns,\n defaultParseWidth: 'any'\n }),\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: 'any',\n valueCallback: function (index) {\n return index + 1;\n }\n }),\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: 'any'\n }),\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: 'wide',\n parsePatterns: parseDayPatterns,\n defaultParseWidth: 'any'\n }),\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: 'any',\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: 'any'\n })\n};\nexport default match;","export default function buildMatchPatternFn(args) {\n return function (string) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n var matchedString = matchResult[0];\n var parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];\n value = options.valueCallback ? options.valueCallback(value) : value;\n var rest = string.slice(matchedString.length);\n return {\n value: value,\n rest: rest\n };\n };\n}","import formatDistance from \"./_lib/formatDistance/index.js\";\nimport formatLong from \"./_lib/formatLong/index.js\";\nimport formatRelative from \"./_lib/formatRelative/index.js\";\nimport localize from \"./_lib/localize/index.js\";\nimport match from \"./_lib/match/index.js\";\n\n/**\n * @type {Locale}\n * @category Locales\n * @summary English locale (United States).\n * @language English\n * @iso-639-2 eng\n * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}\n * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}\n */\nvar locale = {\n code: 'en-US',\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0\n /* Sunday */\n ,\n firstWeekContainsDate: 1\n }\n};\nexport default locale;","import buildLocalizeFn from \"../../../_lib/buildLocalizeFn/index.js\";\nvar eraValues = {\n narrow: ['B', 'A'],\n abbreviated: ['BC', 'AD'],\n wide: ['Before Christ', 'Anno Domini']\n};\nvar quarterValues = {\n narrow: ['1', '2', '3', '4'],\n abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],\n wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']\n}; // Note: in English, the names of days of the week and months are capitalized.\n// If you are making a new locale based on this one, check if the same is true for the language you're working on.\n// Generally, formatted dates should look like they are in the middle of a sentence,\n// e.g. in Spanish language the weekdays and months should be in the lowercase.\n\nvar monthValues = {\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],\n abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n};\nvar dayValues = {\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],\n short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n};\nvar dayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n }\n};\nvar formattingDayPeriodValues = {\n narrow: {\n am: 'a',\n pm: 'p',\n midnight: 'mi',\n noon: 'n',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n abbreviated: {\n am: 'AM',\n pm: 'PM',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n },\n wide: {\n am: 'a.m.',\n pm: 'p.m.',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'in the morning',\n afternoon: 'in the afternoon',\n evening: 'in the evening',\n night: 'at night'\n }\n};\n\nvar ordinalNumber = function (dirtyNumber, _options) {\n var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,\n // if they are different for different grammatical genders,\n // use `options.unit`.\n //\n // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',\n // 'day', 'hour', 'minute', 'second'.\n\n var rem100 = number % 100;\n\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st';\n\n case 2:\n return number + 'nd';\n\n case 3:\n return number + 'rd';\n }\n }\n\n return number + 'th';\n};\n\nvar localize = {\n ordinalNumber: ordinalNumber,\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: 'wide'\n }),\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: 'wide',\n argumentCallback: function (quarter) {\n return quarter - 1;\n }\n }),\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: 'wide'\n }),\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: 'wide'\n }),\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: 'wide',\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: 'wide'\n })\n};\nexport default localize;","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","import addLeadingZeros from \"../../addLeadingZeros/index.js\";\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nvar formatters = {\n // Year\n y: function (date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function (date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function (date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function (date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function (date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function (date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function (date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function (date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function (date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getUTCFullYear();\n var fourthOfJanuaryOfNextYear = new Date(0);\n fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);\n fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);\n var fourthOfJanuaryOfThisYear = new Date(0);\n fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);\n fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import getUTCISOWeekYear from \"../getUTCISOWeekYear/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport startOfUTCISOWeekYear from \"../startOfUTCISOWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getUTCDay();\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;\n date.setUTCDate(date.getUTCDate() - diff);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate, dirtyOptions);\n var year = date.getUTCFullYear();\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);\n var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);\n var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import toInteger from \"../toInteger/index.js\";\nimport getUTCWeekYear from \"../getUTCWeekYear/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport startOfUTCWeekYear from \"../startOfUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import lightFormatters from \"../lightFormatters/index.js\";\nimport getUTCDayOfYear from \"../../../_lib/getUTCDayOfYear/index.js\";\nimport getUTCISOWeek from \"../../../_lib/getUTCISOWeek/index.js\";\nimport getUTCISOWeekYear from \"../../../_lib/getUTCISOWeekYear/index.js\";\nimport getUTCWeek from \"../../../_lib/getUTCWeek/index.js\";\nimport getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport addLeadingZeros from \"../../addLeadingZeros/index.js\";\nvar dayPeriodEnum = {\n am: 'am',\n pm: 'pm',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n};\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nvar formatters = {\n // Era\n G: function (date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function (date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\n },\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function (date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function (date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function (date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function (date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case 'e':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n }\n\n switch (token) {\n case 'b':\n case 'bb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function (date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function (date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function (date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function (date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return 'Z';\n }\n\n switch (token) {\n // Hours and optional minutes\n case 'X':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","function dateLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'P':\n return formatLong.date({\n width: 'short'\n });\n\n case 'PP':\n return formatLong.date({\n width: 'medium'\n });\n\n case 'PPP':\n return formatLong.date({\n width: 'long'\n });\n\n case 'PPPP':\n default:\n return formatLong.date({\n width: 'full'\n });\n }\n}\n\nfunction timeLongFormatter(pattern, formatLong) {\n switch (pattern) {\n case 'p':\n return formatLong.time({\n width: 'short'\n });\n\n case 'pp':\n return formatLong.time({\n width: 'medium'\n });\n\n case 'ppp':\n return formatLong.time({\n width: 'long'\n });\n\n case 'pppp':\n default:\n return formatLong.time({\n width: 'full'\n });\n }\n}\n\nfunction dateTimeLongFormatter(pattern, formatLong) {\n var matchResult = pattern.match(/(P+)(p+)?/);\n var datePattern = matchResult[1];\n var timePattern = matchResult[2];\n\n if (!timePattern) {\n return dateLongFormatter(pattern, formatLong);\n }\n\n var dateTimeFormat;\n\n switch (datePattern) {\n case 'P':\n dateTimeFormat = formatLong.dateTime({\n width: 'short'\n });\n break;\n\n case 'PP':\n dateTimeFormat = formatLong.dateTime({\n width: 'medium'\n });\n break;\n\n case 'PPP':\n dateTimeFormat = formatLong.dateTime({\n width: 'long'\n });\n break;\n\n case 'PPPP':\n default:\n dateTimeFormat = formatLong.dateTime({\n width: 'full'\n });\n break;\n }\n\n return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));\n}\n\nvar longFormatters = {\n p: timeLongFormatter,\n P: dateTimeLongFormatter\n};\nexport default longFormatters;","var protectedDayOfYearTokens = ['D', 'DD'];\nvar protectedWeekYearTokens = ['YY', 'YYYY'];\nexport function isProtectedDayOfYearToken(token) {\n return protectedDayOfYearTokens.indexOf(token) !== -1;\n}\nexport function isProtectedWeekYearToken(token) {\n return protectedWeekYearTokens.indexOf(token) !== -1;\n}\nexport function throwProtectedError(token, format, input) {\n if (token === 'YYYY') {\n throw new RangeError(\"Use `yyyy` instead of `YYYY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'YY') {\n throw new RangeError(\"Use `yy` instead of `YY` (in `\".concat(format, \"`) for formatting years to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'D') {\n throw new RangeError(\"Use `d` instead of `D` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n } else if (token === 'DD') {\n throw new RangeError(\"Use `dd` instead of `DD` (in `\".concat(format, \"`) for formatting days of the month to the input `\").concat(input, \"`; see: https://git.io/fxCyr\"));\n }\n}","import isValid from \"../isValid/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/formatters/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * var result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n requiredArgs(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, formatterOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","export default function assign(target, dirtyObject) {\n if (target == null) {\n throw new TypeError('assign requires that input parameter not be null or undefined');\n }\n\n dirtyObject = dirtyObject || {};\n\n for (var property in dirtyObject) {\n if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {\n target[property] = dirtyObject[property];\n }\n }\n\n return target;\n}","import assign from \"../assign/index.js\";\nexport default function cloneObject(dirtyObject) {\n return assign({}, dirtyObject);\n}","import compareAsc from \"../compareAsc/index.js\";\nimport differenceInMonths from \"../differenceInMonths/index.js\";\nimport differenceInSeconds from \"../differenceInSeconds/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport cloneObject from \"../_lib/cloneObject/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MINUTES_IN_DAY = 1440;\nvar MINUTES_IN_ALMOST_TWO_DAYS = 2520;\nvar MINUTES_IN_MONTH = 43200;\nvar MINUTES_IN_TWO_MONTHS = 86400;\n/**\n * @name formatDistance\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `distanceInWords ` to `formatDistance`\n * to make its name consistent with `format` and `formatRelative`.\n *\n * - The order of arguments is swapped to make the function\n * consistent with `differenceIn...` functions.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWords(\n * new Date(1986, 3, 4, 10, 32, 0),\n * new Date(1986, 3, 4, 11, 32, 0),\n * { addSuffix: true }\n * ) //=> 'in about 1 hour'\n *\n * // v2.0.0 onward\n *\n * formatDistance(\n * new Date(1986, 3, 4, 11, 32, 0),\n * new Date(1986, 3, 4, 10, 32, 0),\n * { addSuffix: true }\n * ) //=> 'in about 1 hour'\n * ```\n *\n * @param {Date|Number} date - the date\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `baseDate` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistance(new Date(2014, 6, 2), new Date(2015, 0, 1))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * const result = formatDistance(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * { includeSeconds: true }\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistance(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistance(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> 'pli ol 1 jaro'\n */\n\nexport default function formatDistance(dirtyDate, dirtyBaseDate) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n requiredArgs(2, arguments);\n var locale = options.locale || defaultLocale;\n\n if (!locale.formatDistance) {\n throw new RangeError('locale must contain formatDistance property');\n }\n\n var comparison = compareAsc(dirtyDate, dirtyBaseDate);\n\n if (isNaN(comparison)) {\n throw new RangeError('Invalid time value');\n }\n\n var localizeOptions = cloneObject(options);\n localizeOptions.addSuffix = Boolean(options.addSuffix);\n localizeOptions.comparison = comparison;\n var dateLeft;\n var dateRight;\n\n if (comparison > 0) {\n dateLeft = toDate(dirtyBaseDate);\n dateRight = toDate(dirtyDate);\n } else {\n dateLeft = toDate(dirtyDate);\n dateRight = toDate(dirtyBaseDate);\n }\n\n var seconds = differenceInSeconds(dateRight, dateLeft);\n var offsetInSeconds = (getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft)) / 1000;\n var minutes = Math.round((seconds - offsetInSeconds) / 60);\n var months; // 0 up to 2 mins\n\n if (minutes < 2) {\n if (options.includeSeconds) {\n if (seconds < 5) {\n return locale.formatDistance('lessThanXSeconds', 5, localizeOptions);\n } else if (seconds < 10) {\n return locale.formatDistance('lessThanXSeconds', 10, localizeOptions);\n } else if (seconds < 20) {\n return locale.formatDistance('lessThanXSeconds', 20, localizeOptions);\n } else if (seconds < 40) {\n return locale.formatDistance('halfAMinute', null, localizeOptions);\n } else if (seconds < 60) {\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n } else {\n return locale.formatDistance('xMinutes', 1, localizeOptions);\n }\n } else {\n if (minutes === 0) {\n return locale.formatDistance('lessThanXMinutes', 1, localizeOptions);\n } else {\n return locale.formatDistance('xMinutes', minutes, localizeOptions);\n }\n } // 2 mins up to 0.75 hrs\n\n } else if (minutes < 45) {\n return locale.formatDistance('xMinutes', minutes, localizeOptions); // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return locale.formatDistance('aboutXHours', 1, localizeOptions); // 1.5 hrs up to 24 hrs\n } else if (minutes < MINUTES_IN_DAY) {\n var hours = Math.round(minutes / 60);\n return locale.formatDistance('aboutXHours', hours, localizeOptions); // 1 day up to 1.75 days\n } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {\n return locale.formatDistance('xDays', 1, localizeOptions); // 1.75 days up to 30 days\n } else if (minutes < MINUTES_IN_MONTH) {\n var days = Math.round(minutes / MINUTES_IN_DAY);\n return locale.formatDistance('xDays', days, localizeOptions); // 1 month up to 2 months\n } else if (minutes < MINUTES_IN_TWO_MONTHS) {\n months = Math.round(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('aboutXMonths', months, localizeOptions);\n }\n\n months = differenceInMonths(dateRight, dateLeft); // 2 months up to 12 months\n\n if (months < 12) {\n var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH);\n return locale.formatDistance('xMonths', nearestMonth, localizeOptions); // 1 year up to max Date\n } else {\n var monthsSinceStartOfYear = months % 12;\n var years = Math.floor(months / 12); // N years up to 1 years 3 months\n\n if (monthsSinceStartOfYear < 3) {\n return locale.formatDistance('aboutXYears', years, localizeOptions); // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return locale.formatDistance('overXYears', years, localizeOptions); // N years 9 months up to N year 12 months\n } else {\n return locale.formatDistance('almostXYears', years + 1, localizeOptions);\n }\n }\n}","import getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport cloneObject from \"../_lib/cloneObject/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_MINUTE = 1000 * 60;\nvar MINUTES_IN_DAY = 60 * 24;\nvar MINUTES_IN_MONTH = MINUTES_IN_DAY * 30;\nvar MINUTES_IN_YEAR = MINUTES_IN_DAY * 365;\n/**\n * @name formatDistanceStrict\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `distanceInWordsStrict` to `formatDistanceStrict`\n * to make its name consistent with `format` and `formatRelative`.\n *\n * - The order of arguments is swapped to make the function\n * consistent with `differenceIn...` functions.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsStrict(\n * new Date(2015, 0, 2),\n * new Date(2014, 6, 2)\n * ) //=> '6 months'\n *\n * // v2.0.0 onward\n *\n * formatDistanceStrict(\n * new Date(2014, 6, 2),\n * new Date(2015, 0, 2)\n * ) //=> '6 months'\n * ```\n *\n * - `partialMethod` option is renamed to `roundingMethod`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsStrict(\n * new Date(1986, 3, 4, 10, 32, 0),\n * new Date(1986, 3, 4, 10, 33, 1),\n * { partialMethod: 'ceil' }\n * ) //=> '2 minutes'\n *\n * // v2.0.0 onward\n *\n * formatDistanceStrict(\n * new Date(1986, 3, 4, 10, 33, 1),\n * new Date(1986, 3, 4, 10, 32, 0),\n * { roundingMethod: 'ceil' }\n * ) //=> '2 minutes'\n * ```\n *\n * - If `roundingMethod` is not specified, it now defaults to `round` instead of `floor`.\n *\n * - `unit` option now accepts one of the strings:\n * 'second', 'minute', 'hour', 'day', 'month' or 'year' instead of 's', 'm', 'h', 'd', 'M' or 'Y'\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsStrict(\n * new Date(1986, 3, 4, 10, 32, 0),\n * new Date(1986, 3, 4, 10, 33, 1),\n * { unit: 'm' }\n * )\n *\n * // v2.0.0 onward\n *\n * formatDistanceStrict(\n * new Date(1986, 3, 4, 10, 33, 1),\n * new Date(1986, 3, 4, 10, 32, 0),\n * { unit: 'minute' }\n * )\n * ```\n *\n * @param {Date|Number} date - the date\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit\n * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `baseDate` must not be Invalid Date\n * @throws {RangeError} `options.roundingMethod` must be 'floor', 'ceil' or 'round'\n * @throws {RangeError} `options.unit` must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * const result = formatDistanceStrict(new Date(2014, 6, 2), new Date(2015, 0, 2))\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * const result = formatDistanceStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0)\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * const result = formatDistanceStrict(new Date(2015, 0, 1), new Date(2016, 0, 1), {\n * addSuffix: true\n * })\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * const result = formatDistanceStrict(new Date(2016, 0, 1), new Date(2015, 0, 1), {\n * unit: 'minute'\n * })\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2015\n * // to 28 January 2015, in months, rounded up?\n * const result = formatDistanceStrict(new Date(2015, 0, 28), new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * import { eoLocale } from 'date-fns/locale/eo'\n * const result = formatDistanceStrict(new Date(2016, 7, 1), new Date(2015, 0, 1), {\n * locale: eoLocale\n * })\n * //=> '1 jaro'\n */\n\nexport default function formatDistanceStrict(dirtyDate, dirtyBaseDate) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n requiredArgs(2, arguments);\n var locale = options.locale || defaultLocale;\n\n if (!locale.formatDistance) {\n throw new RangeError('locale must contain localize.formatDistance property');\n }\n\n var comparison = compareAsc(dirtyDate, dirtyBaseDate);\n\n if (isNaN(comparison)) {\n throw new RangeError('Invalid time value');\n }\n\n var localizeOptions = cloneObject(options);\n localizeOptions.addSuffix = Boolean(options.addSuffix);\n localizeOptions.comparison = comparison;\n var dateLeft;\n var dateRight;\n\n if (comparison > 0) {\n dateLeft = toDate(dirtyBaseDate);\n dateRight = toDate(dirtyDate);\n } else {\n dateLeft = toDate(dirtyDate);\n dateRight = toDate(dirtyBaseDate);\n }\n\n var roundingMethod = options.roundingMethod == null ? 'round' : String(options.roundingMethod);\n var roundingMethodFn;\n\n if (roundingMethod === 'floor') {\n roundingMethodFn = Math.floor;\n } else if (roundingMethod === 'ceil') {\n roundingMethodFn = Math.ceil;\n } else if (roundingMethod === 'round') {\n roundingMethodFn = Math.round;\n } else {\n throw new RangeError(\"roundingMethod must be 'floor', 'ceil' or 'round'\");\n }\n\n var milliseconds = dateRight.getTime() - dateLeft.getTime();\n var minutes = milliseconds / MILLISECONDS_IN_MINUTE;\n var timezoneOffset = getTimezoneOffsetInMilliseconds(dateRight) - getTimezoneOffsetInMilliseconds(dateLeft); // Use DST-normalized difference in minutes for years, months and days;\n // use regular difference in minutes for hours, minutes and seconds.\n\n var dstNormalizedMinutes = (milliseconds - timezoneOffset) / MILLISECONDS_IN_MINUTE;\n var unit;\n\n if (options.unit == null) {\n if (minutes < 1) {\n unit = 'second';\n } else if (minutes < 60) {\n unit = 'minute';\n } else if (minutes < MINUTES_IN_DAY) {\n unit = 'hour';\n } else if (dstNormalizedMinutes < MINUTES_IN_MONTH) {\n unit = 'day';\n } else if (dstNormalizedMinutes < MINUTES_IN_YEAR) {\n unit = 'month';\n } else {\n unit = 'year';\n }\n } else {\n unit = String(options.unit);\n } // 0 up to 60 seconds\n\n\n if (unit === 'second') {\n var seconds = roundingMethodFn(milliseconds / 1000);\n return locale.formatDistance('xSeconds', seconds, localizeOptions); // 1 up to 60 mins\n } else if (unit === 'minute') {\n var roundedMinutes = roundingMethodFn(minutes);\n return locale.formatDistance('xMinutes', roundedMinutes, localizeOptions); // 1 up to 24 hours\n } else if (unit === 'hour') {\n var hours = roundingMethodFn(minutes / 60);\n return locale.formatDistance('xHours', hours, localizeOptions); // 1 up to 30 days\n } else if (unit === 'day') {\n var days = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_DAY);\n return locale.formatDistance('xDays', days, localizeOptions); // 1 up to 12 months\n } else if (unit === 'month') {\n var months = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_MONTH);\n return months === 12 && options.unit !== 'month' ? locale.formatDistance('xYears', 1, localizeOptions) : locale.formatDistance('xMonths', months, localizeOptions); // 1 year up to max Date\n } else if (unit === 'year') {\n var years = roundingMethodFn(dstNormalizedMinutes / MINUTES_IN_YEAR);\n return locale.formatDistance('xYears', years, localizeOptions);\n }\n\n throw new RangeError(\"unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'\");\n}","import distanceInWords from \"../formatDistance/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatDistanceToNow\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `distanceInWordsToNow ` to `formatDistanceToNow`\n * to make its name consistent with `format` and `formatRelative`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * distanceInWordsToNow(new Date(2014, 6, 2), { addSuffix: true })\n * //=> 'in 6 months'\n *\n * // v2.0.0 onward\n *\n * formatDistanceToNow(new Date(2014, 6, 2), { addSuffix: true })\n * //=> 'in 6 months'\n * ```\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result specifies if now is earlier or later than the passed date\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * var result = formatDistanceToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * var result = formatDistanceToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * var result = formatDistanceToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * var eoLocale = require('date-fns/locale/eo')\n * var result = formatDistanceToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\n\nexport default function formatDistanceToNow(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n return distanceInWords(dirtyDate, Date.now(), dirtyOptions);\n}","import formatDistanceStrict from \"../formatDistanceStrict/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatDistanceToNowStrict\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n * @pure false\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `formatDistance`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - an object with options.\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {'second'|'minute'|'hour'|'day'|'month'|'year'} [options.unit] - if specified, will force a unit\n * @param {'floor'|'ceil'|'round'} [options.roundingMethod='round'] - which way to round partial units\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {String} the distance in words\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `formatDistance` property\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * var result = formatDistanceToNowStrict(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * var result = formatDistanceToNowStrict(\n * new Date(2015, 0, 1, 0, 0, 15)\n * )\n * //=> '20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * var result = formatDistanceToNowStrict(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in 1 year'\n *\n * @example\n * // If today is 28 January 2015,\n * // what is the distance to 1 January 2015, in months, rounded up??\n * var result = formatDistanceToNowStrict(new Date(2015, 0, 1), {\n * unit: 'month',\n * roundingMethod: 'ceil'\n * })\n * //=> '1 month'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * var eoLocale = require('date-fns/locale/eo')\n * var result = formatDistanceToNowStrict(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> '1 jaro'\n */\n\nexport default function formatDistanceToNowStrict(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n return formatDistanceStrict(dirtyDate, Date.now(), dirtyOptions);\n}","import defaultLocale from \"../locale/en-US/index.js\";\nvar defaultFormat = ['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds'];\n/**\n * @name formatDuration\n * @category Common Helpers\n * @summary Formats a duration in human-readable format\n *\n * @description\n * Return human-readable duration string i.e. \"9 months 2 days\"\n *\n * @param {Duration} duration - the duration to format\n * @param {Object} [options] - an object with options.\n\n * @param {string[]} [options.format=['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds']] - the array of units to format\n * @param {boolean} [options.zero=false] - should be zeros be included in the output?\n * @param {string} [options.delimiter=' '] - delimiter string\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @returns {string} the formatted date string\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Format full duration\n * formatDuration({\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30\n * })\n * //=> '2 years 9 months 1 week 7 days 5 hours 9 minutes 30 seconds\n *\n * @example\n * // Format partial duration\n * formatDuration({ months: 9, days: 2 })\n * //=> '9 months 2 days'\n *\n * @example\n * // Customize the format\n * formatDuration(\n * {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30\n * },\n * { format: ['months', 'weeks'] }\n * ) === '9 months 1 week'\n *\n * @example\n * // Customize the zeros presence\n * formatDuration({ years: 0, months: 9 })\n * //=> '9 months'\n * formatDuration({ years: 0, months: 9 }, { zero: true })\n * //=> '0 years 9 months'\n *\n * @example\n * // Customize the delimiter\n * formatDuration({ years: 2, months: 9, weeks: 3 }, { delimiter: ', ' })\n * //=> '2 years, 9 months, 3 weeks'\n */\n\nexport default function formatDuration(duration, options) {\n if (arguments.length < 1) {\n throw new TypeError(\"1 argument required, but only \".concat(arguments.length, \" present\"));\n }\n\n var format = (options === null || options === void 0 ? void 0 : options.format) || defaultFormat;\n var locale = (options === null || options === void 0 ? void 0 : options.locale) || defaultLocale;\n var zero = (options === null || options === void 0 ? void 0 : options.zero) || false;\n var delimiter = (options === null || options === void 0 ? void 0 : options.delimiter) || ' ';\n var result = format.reduce(function (acc, unit) {\n var token = \"x\".concat(unit.replace(/(^.)/, function (m) {\n return m.toUpperCase();\n }));\n var addChunk = typeof duration[unit] === 'number' && (zero || duration[unit]);\n return addChunk ? acc.concat(locale.formatDistance(token, duration[unit])) : acc;\n }, []).join(delimiter);\n return result;\n}","import toDate from \"../toDate/index.js\";\nimport isValid from \"../isValid/index.js\";\nimport addLeadingZeros from \"../_lib/addLeadingZeros/index.js\";\n/**\n * @name formatISO\n * @category Common Helpers\n * @summary Format the date according to the ISO 8601 standard (http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).\n *\n * @description\n * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values.\n * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time with time zone, or both.\n * @returns {String} the formatted date string\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.format` must be 'extended' or 'basic'\n * @throws {RangeError} `options.represenation` must be 'date', 'time' or 'complete'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format (UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601, short format (UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918T190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, date only:\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 8601 format, time only (UTC):\n * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52Z'\n */\n\nexport default function formatISO(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError(\"1 argument required, but only \".concat(arguments.length, \" present\"));\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n }\n\n var options = dirtyOptions || {};\n var format = options.format == null ? 'extended' : String(options.format);\n var representation = options.representation == null ? 'complete' : String(options.representation);\n\n if (format !== 'extended' && format !== 'basic') {\n throw new RangeError(\"format must be 'extended' or 'basic'\");\n }\n\n if (representation !== 'date' && representation !== 'time' && representation !== 'complete') {\n throw new RangeError(\"representation must be 'date', 'time', or 'complete'\");\n }\n\n var result = '';\n var tzOffset = '';\n var dateDelimiter = format === 'extended' ? '-' : '';\n var timeDelimiter = format === 'extended' ? ':' : ''; // Representation is either 'date' or 'complete'\n\n if (representation !== 'time') {\n var day = addLeadingZeros(originalDate.getDate(), 2);\n var month = addLeadingZeros(originalDate.getMonth() + 1, 2);\n var year = addLeadingZeros(originalDate.getFullYear(), 4); // yyyyMMdd or yyyy-MM-dd.\n\n result = \"\".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);\n } // Representation is either 'time' or 'complete'\n\n\n if (representation !== 'date') {\n // Add the timezone.\n var offset = originalDate.getTimezoneOffset();\n\n if (offset !== 0) {\n var absoluteOffset = Math.abs(offset);\n var hourOffset = addLeadingZeros(Math.floor(absoluteOffset / 60), 2);\n var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2); // If less than 0, the sign is +, because it is ahead of time.\n\n var sign = offset < 0 ? '+' : '-';\n tzOffset = \"\".concat(sign).concat(hourOffset, \":\").concat(minuteOffset);\n } else {\n tzOffset = 'Z';\n }\n\n var hour = addLeadingZeros(originalDate.getHours(), 2);\n var minute = addLeadingZeros(originalDate.getMinutes(), 2);\n var second = addLeadingZeros(originalDate.getSeconds(), 2); // If there's also date, separate it with time with 'T'\n\n var separator = result === '' ? '' : 'T'; // Creates a time string consisting of hour, minute, and second, separated by delimiters, if defined.\n\n var time = [hour, minute, second].join(timeDelimiter); // HHmmss or HH:mm:ss.\n\n result = \"\".concat(result).concat(separator).concat(time).concat(tzOffset);\n }\n\n return result;\n}","import toDate from \"../toDate/index.js\";\nimport isValid from \"../isValid/index.js\";\nimport addLeadingZeros from \"../_lib/addLeadingZeros/index.js\";\n/**\n * @name formatISO9075\n * @category Common Helpers\n * @summary Format the date according to the ISO 9075 standard (https://dev.mysql.com/doc/refman/5.7/en/date-and-time-functions.html#function_get-format).\n *\n * @description\n * Return the formatted date string in ISO 9075 format. Options may be passed to control the parts and notations of the date.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {'extended'|'basic'} [options.format='extended'] - if 'basic', hide delimiters between date and time values.\n * @param {'complete'|'date'|'time'} [options.representation='complete'] - format date, time, or both.\n * @returns {String} the formatted date string\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.format` must be 'extended' or 'basic'\n * @throws {RangeError} `options.represenation` must be 'date', 'time' or 'complete'\n *\n * @example\n * // Represent 18 September 2019 in ISO 9075 format:\n * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18 19:00:52'\n *\n * @example\n * // Represent 18 September 2019 in ISO 9075, short format:\n * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })\n * //=> '20190918 190052'\n *\n * @example\n * // Represent 18 September 2019 in ISO 9075 format, date only:\n * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })\n * //=> '2019-09-18'\n *\n * @example\n * // Represent 18 September 2019 in ISO 9075 format, time only:\n * const result = formatISO9075(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })\n * //=> '19:00:52'\n */\n\nexport default function formatISO9075(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError(\"1 argument required, but only \".concat(arguments.length, \" present\"));\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n }\n\n var options = dirtyOptions || {};\n var format = options.format == null ? 'extended' : String(options.format);\n var representation = options.representation == null ? 'complete' : String(options.representation);\n\n if (format !== 'extended' && format !== 'basic') {\n throw new RangeError(\"format must be 'extended' or 'basic'\");\n }\n\n if (representation !== 'date' && representation !== 'time' && representation !== 'complete') {\n throw new RangeError(\"representation must be 'date', 'time', or 'complete'\");\n }\n\n var result = '';\n var dateDelimiter = format === 'extended' ? '-' : '';\n var timeDelimiter = format === 'extended' ? ':' : ''; // Representation is either 'date' or 'complete'\n\n if (representation !== 'time') {\n var day = addLeadingZeros(originalDate.getDate(), 2);\n var month = addLeadingZeros(originalDate.getMonth() + 1, 2);\n var year = addLeadingZeros(originalDate.getFullYear(), 4); // yyyyMMdd or yyyy-MM-dd.\n\n result = \"\".concat(year).concat(dateDelimiter).concat(month).concat(dateDelimiter).concat(day);\n } // Representation is either 'time' or 'complete'\n\n\n if (representation !== 'date') {\n var hour = addLeadingZeros(originalDate.getHours(), 2);\n var minute = addLeadingZeros(originalDate.getMinutes(), 2);\n var second = addLeadingZeros(originalDate.getSeconds(), 2); // If there's also date, separate it with time with a space\n\n var separator = result === '' ? '' : ' '; // HHmmss or HH:mm:ss.\n\n result = \"\".concat(result).concat(separator).concat(hour).concat(timeDelimiter).concat(minute).concat(timeDelimiter).concat(second);\n }\n\n return result;\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name formatISODuration\n * @category Common Helpers\n * @summary Format a duration object according as ISO 8601 duration string\n *\n * @description\n * Format a duration object according to the ISO 8601 duration standard (https://www.digi.com/resources/documentation/digidocs/90001437-13/reference/r_iso_8601_duration_format.htm)\n *\n * @param {Duration} duration - the duration to format\n *\n * @returns {String} The ISO 8601 duration string\n * @throws {TypeError} Requires 1 argument\n * @throws {Error} Argument must be an object\n *\n * @example\n * // Format the given duration as ISO 8601 string\n * const result = formatISODuration({\n * years: 39,\n * months: 2,\n * days: 20,\n * hours: 7,\n * minutes: 5,\n * seconds: 0\n * })\n * //=> 'P39Y2M20DT0H0M0S'\n */\n\nexport default function formatISODuration(duration) {\n requiredArgs(1, arguments);\n if (typeof duration !== 'object') throw new Error('Duration must be an object');\n var _duration$years = duration.years,\n years = _duration$years === void 0 ? 0 : _duration$years,\n _duration$months = duration.months,\n months = _duration$months === void 0 ? 0 : _duration$months,\n _duration$days = duration.days,\n days = _duration$days === void 0 ? 0 : _duration$days,\n _duration$hours = duration.hours,\n hours = _duration$hours === void 0 ? 0 : _duration$hours,\n _duration$minutes = duration.minutes,\n minutes = _duration$minutes === void 0 ? 0 : _duration$minutes,\n _duration$seconds = duration.seconds,\n seconds = _duration$seconds === void 0 ? 0 : _duration$seconds;\n return \"P\".concat(years, \"Y\").concat(months, \"M\").concat(days, \"DT\").concat(hours, \"H\").concat(minutes, \"M\").concat(seconds, \"S\");\n}","import toDate from \"../toDate/index.js\";\nimport isValid from \"../isValid/index.js\";\nimport addLeadingZeros from \"../_lib/addLeadingZeros/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n\n/**\n * @name formatRFC3339\n * @category Common Helpers\n * @summary Format the date according to the RFC 3339 standard (https://tools.ietf.org/html/rfc3339#section-5.6).\n *\n * @description\n * Return the formatted date string in RFC 3339 format. Options may be passed to control the parts and notations of the date.\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {0|1|2|3} [options.fractionDigits=0] - number of digits after the decimal point after seconds\n * @returns {String} the formatted date string\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.fractionDigits` must be between 0 and 3\n *\n * @example\n * // Represent 18 September 2019 in RFC 3339 format:\n * const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52))\n * //=> '2019-09-18T19:00:52Z'\n *\n * @example\n * // Represent 18 September 2019 in RFC 3339 format, 2 digits of second fraction:\n * const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), { fractionDigits: 2 })\n * //=> '2019-09-18T19:00:52.23Z'\n *\n * @example\n * // Represent 18 September 2019 in RFC 3339 format, 3 digits of second fraction\n * const result = formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), { fractionDigits: 3 })\n * //=> '2019-09-18T19:00:52.234Z'\n */\nexport default function formatRFC3339(dirtyDate, dirtyOptions) {\n if (arguments.length < 1) {\n throw new TypeError(\"1 arguments required, but only \".concat(arguments.length, \" present\"));\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n }\n\n var _ref = dirtyOptions || {},\n _ref$fractionDigits = _ref.fractionDigits,\n fractionDigits = _ref$fractionDigits === void 0 ? 0 : _ref$fractionDigits; // Test if fractionDigits is between 0 and 3 _and_ is not NaN\n\n\n if (!(fractionDigits >= 0 && fractionDigits <= 3)) {\n throw new RangeError('fractionDigits must be between 0 and 3 inclusively');\n }\n\n var day = addLeadingZeros(originalDate.getDate(), 2);\n var month = addLeadingZeros(originalDate.getMonth() + 1, 2);\n var year = originalDate.getFullYear();\n var hour = addLeadingZeros(originalDate.getHours(), 2);\n var minute = addLeadingZeros(originalDate.getMinutes(), 2);\n var second = addLeadingZeros(originalDate.getSeconds(), 2);\n var fractionalSecond = '';\n\n if (fractionDigits > 0) {\n var milliseconds = originalDate.getMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, fractionDigits - 3));\n fractionalSecond = '.' + addLeadingZeros(fractionalSeconds, fractionDigits);\n }\n\n var offset = '';\n var tzOffset = originalDate.getTimezoneOffset();\n\n if (tzOffset !== 0) {\n var absoluteOffset = Math.abs(tzOffset);\n var hourOffset = addLeadingZeros(toInteger(absoluteOffset / 60), 2);\n var minuteOffset = addLeadingZeros(absoluteOffset % 60, 2); // If less than 0, the sign is +, because it is ahead of time.\n\n var sign = tzOffset < 0 ? '+' : '-';\n offset = \"\".concat(sign).concat(hourOffset, \":\").concat(minuteOffset);\n } else {\n offset = 'Z';\n }\n\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day, \"T\").concat(hour, \":\").concat(minute, \":\").concat(second).concat(fractionalSecond).concat(offset);\n}","import toDate from \"../toDate/index.js\";\nimport isValid from \"../isValid/index.js\";\nimport addLeadingZeros from \"../_lib/addLeadingZeros/index.js\";\nvar days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n/**\n * @name formatRFC7231\n * @category Common Helpers\n * @summary Format the date according to the RFC 7231 standard (https://tools.ietf.org/html/rfc7231#section-7.1.1.1).\n *\n * @description\n * Return the formatted date string in RFC 7231 format.\n * The result will always be in UTC timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {String} the formatted date string\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `date` must not be Invalid Date\n *\n * @example\n * // Represent 18 September 2019 in RFC 7231 format:\n * const result = formatRFC7231(new Date(2019, 8, 18, 19, 0, 52))\n * //=> 'Wed, 18 Sep 2019 19:00:52 GMT'\n */\n\nexport default function formatRFC7231(dirtyDate) {\n if (arguments.length < 1) {\n throw new TypeError(\"1 arguments required, but only \".concat(arguments.length, \" present\"));\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n }\n\n var dayName = days[originalDate.getUTCDay()];\n var dayOfMonth = addLeadingZeros(originalDate.getUTCDate(), 2);\n var monthName = months[originalDate.getUTCMonth()];\n var year = originalDate.getUTCFullYear();\n var hour = addLeadingZeros(originalDate.getUTCHours(), 2);\n var minute = addLeadingZeros(originalDate.getUTCMinutes(), 2);\n var second = addLeadingZeros(originalDate.getUTCSeconds(), 2); // Result variables.\n\n return \"\".concat(dayName, \", \").concat(dayOfMonth, \" \").concat(monthName, \" \").concat(year, \" \").concat(hour, \":\").concat(minute, \":\").concat(second, \" GMT\");\n}","import differenceInCalendarDays from \"../differenceInCalendarDays/index.js\";\nimport format from \"../format/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name formatRelative\n * @category Common Helpers\n * @summary Represent the date in words relative to the given base date.\n *\n * @description\n * Represent the date in words relative to the given base date.\n *\n * | Distance to the base date | Result |\n * |---------------------------|---------------------------|\n * | Previous 6 days | last Sunday at 04:30 AM |\n * | Last day | yesterday at 04:30 AM |\n * | Same day | today at 04:30 AM |\n * | Next day | tomorrow at 04:30 AM |\n * | Next 6 days | Sunday at 04:30 AM |\n * | Other | 12/31/2017 |\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to format\n * @param {Date|Number} baseDate - the date to compare with\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {String} the date in words\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `baseDate` must not be Invalid Date\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.locale` must contain `formatRelative` property\n *\n * @example\n * // Represent the date of 6 days ago in words relative to the given base date. In this example, today is Wednesday\n * const result = formatRelative(addDays(new Date(), -6), new Date())\n * //=> \"last Thursday at 12:45 AM\"\n */\nexport default function formatRelative(dirtyDate, dirtyBaseDate, dirtyOptions) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var baseDate = toDate(dirtyBaseDate);\n\n var _ref = dirtyOptions || {},\n _ref$locale = _ref.locale,\n locale = _ref$locale === void 0 ? defaultLocale : _ref$locale,\n _ref$weekStartsOn = _ref.weekStartsOn,\n weekStartsOn = _ref$weekStartsOn === void 0 ? 0 : _ref$weekStartsOn;\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n if (!locale.formatRelative) {\n throw new RangeError('locale must contain formatRelative property');\n }\n\n var diff = differenceInCalendarDays(date, baseDate);\n\n if (isNaN(diff)) {\n throw new RangeError('Invalid time value');\n }\n\n var token;\n\n if (diff < -6) {\n token = 'other';\n } else if (diff < -1) {\n token = 'lastWeek';\n } else if (diff < 0) {\n token = 'yesterday';\n } else if (diff < 1) {\n token = 'today';\n } else if (diff < 2) {\n token = 'tomorrow';\n } else if (diff < 7) {\n token = 'nextWeek';\n } else {\n token = 'other';\n }\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var utcBaseDate = subMilliseconds(baseDate, getTimezoneOffsetInMilliseconds(baseDate));\n var formatStr = locale.formatRelative(token, utcDate, utcBaseDate, {\n locale: locale,\n weekStartsOn: weekStartsOn\n });\n return format(date, formatStr, {\n locale: locale,\n weekStartsOn: weekStartsOn\n });\n}","import toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name fromUnixTime\n * @category Timestamp Helpers\n * @summary Create a date from a Unix timestamp.\n *\n * @description\n * Create a date from a Unix timestamp (in seconds). Decimal values will be discarded.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Number} unixTime - the given Unix timestamp (in seconds)\n * @returns {Date} the date\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Create the date 29 February 2012 11:45:05:\n * const result = fromUnixTime(1330515905)\n * //=> Wed Feb 29 2012 11:45:05\n */\n\nexport default function fromUnixTime(dirtyUnixTime) {\n requiredArgs(1, arguments);\n var unixTime = toInteger(dirtyUnixTime);\n return toDate(unixTime * 1000);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDate\n * @category Day Helpers\n * @summary Get the day of the month of the given date.\n *\n * @description\n * Get the day of the month of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the day of month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which day of the month is 29 February 2012?\n * const result = getDate(new Date(2012, 1, 29))\n * //=> 29\n */\n\nexport default function getDate(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var dayOfMonth = date.getDate();\n return dayOfMonth;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDay\n * @category Weekday Helpers\n * @summary Get the day of the week of the given date.\n *\n * @description\n * Get the day of the week of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {0|1|2|3|4|5|6} the day of week, 0 represents Sunday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which day of the week is 29 February 2012?\n * const result = getDay(new Date(2012, 1, 29))\n * //=> 3\n */\n\nexport default function getDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var day = date.getDay();\n return day;\n}","import toDate from \"../toDate/index.js\";\nimport startOfYear from \"../startOfYear/index.js\";\nimport differenceInCalendarDays from \"../differenceInCalendarDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDayOfYear\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the day of year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * const result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\n\nexport default function getDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = differenceInCalendarDays(date, startOfYear(date));\n var dayOfYear = diff + 1;\n return dayOfYear;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDaysInMonth\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of days in a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many days are in February 2000?\n * const result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\n\nexport default function getDaysInMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var monthIndex = date.getMonth();\n var lastDayOfMonth = new Date(0);\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\n lastDayOfMonth.setHours(0, 0, 0, 0);\n return lastDayOfMonth.getDate();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isLeapYear\n * @category Year Helpers\n * @summary Is the given date in the leap year?\n *\n * @description\n * Is the given date in the leap year?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in the leap year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 1 September 2012 in the leap year?\n * var result = isLeapYear(new Date(2012, 8, 1))\n * //=> true\n */\n\nexport default function isLeapYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}","import toDate from \"../toDate/index.js\";\nimport isLeapYear from \"../isLeapYear/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDaysInYear\n * @category Year Helpers\n * @summary Get the number of days in a year of the given date.\n *\n * @description\n * Get the number of days in a year of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of days in a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many days are in 2012?\n * const result = getDaysInYear(new Date(2012, 0, 1))\n * //=> 366\n */\n\nexport default function getDaysInYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n\n if (String(new Date(date)) === 'Invalid Date') {\n return NaN;\n }\n\n return isLeapYear(date) ? 366 : 365;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDecade\n * @category Decade Helpers\n * @summary Get the decade of the given date.\n *\n * @description\n * Get the decade of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the year of decade\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which decade belongs 27 November 1942?\n * const result = getDecade(new Date(1942, 10, 27))\n * //=> 1940\n */\n\nexport default function getDecade(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var decade = Math.floor(year / 10) * 10;\n return decade;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getHours\n * @category Hour Helpers\n * @summary Get the hours of the given date.\n *\n * @description\n * Get the hours of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the hours\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the hours of 29 February 2012 11:45:00:\n * const result = getHours(new Date(2012, 1, 29, 11, 45))\n * //=> 11\n */\n\nexport default function getHours(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var hours = date.getHours();\n return hours;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getISODay\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the day of ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * const result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\n\nexport default function getISODay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var day = date.getDay();\n\n if (day === 0) {\n day = 7;\n }\n\n return day;\n}","import toDate from \"../toDate/index.js\";\nimport startOfISOWeek from \"../startOfISOWeek/index.js\";\nimport startOfISOWeekYear from \"../startOfISOWeekYear/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000;\n/**\n * @name getISOWeek\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\n\nexport default function getISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfISOWeek(date).getTime() - startOfISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import startOfISOWeekYear from \"../startOfISOWeekYear/index.js\";\nimport addWeeks from \"../addWeeks/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000;\n/**\n * @name getISOWeeksInYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of weeks in an ISO week-numbering year of the given date.\n *\n * @description\n * Get the number of weeks in an ISO week-numbering year of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of ISO weeks in a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many weeks are in ISO week-numbering year 2015?\n * const result = getISOWeeksInYear(new Date(2015, 1, 11))\n * //=> 53\n */\n\nexport default function getISOWeeksInYear(dirtyDate) {\n requiredArgs(1, arguments);\n var thisYear = startOfISOWeekYear(dirtyDate);\n var nextYear = startOfISOWeekYear(addWeeks(thisYear, 60));\n var diff = nextYear.valueOf() - thisYear.valueOf(); // Round the number of weeks to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getMilliseconds\n * @category Millisecond Helpers\n * @summary Get the milliseconds of the given date.\n *\n * @description\n * Get the milliseconds of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the milliseconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the milliseconds of 29 February 2012 11:45:05.123:\n * const result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 123\n */\n\nexport default function getMilliseconds(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var milliseconds = date.getMilliseconds();\n return milliseconds;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getMinutes\n * @category Minute Helpers\n * @summary Get the minutes of the given date.\n *\n * @description\n * Get the minutes of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the minutes\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the minutes of 29 February 2012 11:45:05:\n * const result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))\n * //=> 45\n */\n\nexport default function getMinutes(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var minutes = date.getMinutes();\n return minutes;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getMonth\n * @category Month Helpers\n * @summary Get the month of the given date.\n *\n * @description\n * Get the month of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which month is 29 February 2012?\n * const result = getMonth(new Date(2012, 1, 29))\n * //=> 1\n */\n\nexport default function getMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n return month;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000;\n/**\n * @name getOverlappingDaysInIntervals\n * @category Interval Helpers\n * @summary Get the number of days that overlap in two time intervals\n *\n * @description\n * Get the number of days that overlap in two time intervals\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `getOverlappingDaysInRanges` to `getOverlappingDaysInIntervals`.\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\n *\n * ```\n * 2.1.3\n * time interval\n * part of the time axis limited by two instants\n * ```\n *\n * Also, this function now accepts an object with `start` and `end` properties\n * instead of two arguments as an interval.\n * This function now throws `RangeError` if the start of the interval is after its end\n * or if any date in the interval is `Invalid Date`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * getOverlappingDaysInRanges(\n * new Date(2014, 0, 10), new Date(2014, 0, 20),\n * new Date(2014, 0, 17), new Date(2014, 0, 21)\n * )\n *\n * // v2.0.0 onward\n *\n * getOverlappingDaysInIntervals(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\n * )\n * ```\n *\n * @param {Interval} intervalLeft - the first interval to compare. See [Interval]{@link docs/Interval}\n * @param {Interval} intervalRight - the second interval to compare. See [Interval]{@link docs/Interval}\n * @returns {Number} the number of days that overlap in two time intervals\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // For overlapping time intervals adds 1 for each started overlapping day:\n * getOverlappingDaysInIntervals(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 17), end: new Date(2014, 0, 21) }\n * )\n * //=> 3\n *\n * @example\n * // For non-overlapping time intervals returns 0:\n * getOverlappingDaysInIntervals(\n * { start: new Date(2014, 0, 10), end: new Date(2014, 0, 20) },\n * { start: new Date(2014, 0, 21), end: new Date(2014, 0, 22) }\n * )\n * //=> 0\n */\n\nexport default function getOverlappingDaysInIntervals(dirtyIntervalLeft, dirtyIntervalRight) {\n requiredArgs(2, arguments);\n var intervalLeft = dirtyIntervalLeft || {};\n var intervalRight = dirtyIntervalRight || {};\n var leftStartTime = toDate(intervalLeft.start).getTime();\n var leftEndTime = toDate(intervalLeft.end).getTime();\n var rightStartTime = toDate(intervalRight.start).getTime();\n var rightEndTime = toDate(intervalRight.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(leftStartTime <= leftEndTime && rightStartTime <= rightEndTime)) {\n throw new RangeError('Invalid interval');\n }\n\n var isOverlapping = leftStartTime < rightEndTime && rightStartTime < leftEndTime;\n\n if (!isOverlapping) {\n return 0;\n }\n\n var overlapStartDate = rightStartTime < leftStartTime ? leftStartTime : rightStartTime;\n var overlapEndDate = rightEndTime > leftEndTime ? leftEndTime : rightEndTime;\n var differenceInMs = overlapEndDate - overlapStartDate;\n return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getSeconds\n * @category Second Helpers\n * @summary Get the seconds of the given date.\n *\n * @description\n * Get the seconds of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the seconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Get the seconds of 29 February 2012 11:45:05.123:\n * const result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 5\n */\n\nexport default function getSeconds(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var seconds = date.getSeconds();\n return seconds;\n}","import startOfWeek from \"../startOfWeek/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name getWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Get the local week-numbering year of the given date.\n *\n * @description\n * Get the local week-numbering year of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @returns {Number} the local week-numbering year\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n *\n * @example\n * // Which week numbering year is 26 December 2004 with the default settings?\n * const result = getWeekYear(new Date(2004, 11, 26))\n * //=> 2005\n *\n * @example\n * // Which week numbering year is 26 December 2004 if week starts on Saturday?\n * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })\n * //=> 2004\n *\n * @example\n * // Which week numbering year is 26 December 2004 if the first week contains 4 January?\n * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })\n * //=> 2004\n */\nexport default function getWeekYear(dirtyDate, options) {\n var _options$locale, _options$locale$optio;\n\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var localeFirstWeekContainsDate = options === null || options === void 0 ? void 0 : (_options$locale = options.locale) === null || _options$locale === void 0 ? void 0 : (_options$locale$optio = _options$locale.options) === null || _options$locale$optio === void 0 ? void 0 : _options$locale$optio.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = (options === null || options === void 0 ? void 0 : options.firstWeekContainsDate) == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var firstWeekOfNextYear = new Date(0);\n firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);\n firstWeekOfNextYear.setHours(0, 0, 0, 0);\n var startOfNextYear = startOfWeek(firstWeekOfNextYear, options);\n var firstWeekOfThisYear = new Date(0);\n firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);\n firstWeekOfThisYear.setHours(0, 0, 0, 0);\n var startOfThisYear = startOfWeek(firstWeekOfThisYear, options);\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1;\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year;\n } else {\n return year - 1;\n }\n}","import getWeekYear from \"../getWeekYear/index.js\";\nimport startOfWeek from \"../startOfWeek/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name startOfWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Return the start of a local week-numbering year for the given date.\n *\n * @description\n * Return the start of a local week-numbering year.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @returns {Date} the start of a week-numbering year\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n *\n * @example\n * // The start of an a week-numbering year for 2 July 2005 with default settings:\n * const result = startOfWeekYear(new Date(2005, 6, 2))\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // The start of a week-numbering year for 2 July 2005\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * const result = startOfWeekYear(new Date(2005, 6, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Mon Jan 03 2005 00:00:00\n */\nexport default function startOfWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n var date = startOfWeek(firstWeek, dirtyOptions);\n return date;\n}","import startOfWeek from \"../startOfWeek/index.js\";\nimport startOfWeekYear from \"../startOfWeekYear/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000;\n/**\n * @name getWeek\n * @category Week Helpers\n * @summary Get the local week index of the given date.\n *\n * @description\n * Get the local week index of the given date.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @returns {Number} the week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n *\n * @example\n * // Which week of the local week numbering year is 2 January 2005 with default options?\n * const result = getISOWeek(new Date(2005, 0, 2))\n * //=> 2\n *\n * // Which week of the local week numbering year is 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January?\n * const result = getISOWeek(new Date(2005, 0, 2), {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> 53\n */\n\nexport default function getWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfWeek(date, options).getTime() - startOfWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import getDate from \"../getDate/index.js\";\nimport getDay from \"../getDay/index.js\";\nimport startOfMonth from \"../startOfMonth/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getWeekOfMonth\n * @category Week Helpers\n * @summary Get the week of the month of the given date.\n *\n * @description\n * Get the week of the month of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Number} the week of month\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Which week of the month is 9 November 2017?\n * var result = getWeekOfMonth(new Date(2017, 10, 9))\n * //=> 2\n */\n\nexport default function getWeekOfMonth(date, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var currentDayOfMonth = getDate(date);\n\n if (isNaN(currentDayOfMonth)) {\n return currentDayOfMonth;\n }\n\n var startWeekDay = getDay(startOfMonth(date));\n var lastDayOfFirstWeek = 0;\n\n if (startWeekDay >= weekStartsOn) {\n lastDayOfFirstWeek = weekStartsOn + 7 - startWeekDay;\n } else {\n lastDayOfFirstWeek = weekStartsOn - startWeekDay;\n }\n\n var weekNumber = 1;\n\n if (currentDayOfMonth > lastDayOfFirstWeek) {\n var remainingDaysAfterFirstWeek = currentDayOfMonth - lastDayOfFirstWeek;\n weekNumber = weekNumber + Math.ceil(remainingDaysAfterFirstWeek / 7);\n }\n\n return weekNumber;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name lastDayOfMonth\n * @category Month Helpers\n * @summary Return the last day of a month for the given date.\n *\n * @description\n * Return the last day of a month for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the last day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The last day of a month for 2 September 2014 11:55:00:\n * var result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 00:00:00\n */\n\nexport default function lastDayOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import differenceInCalendarWeeks from \"../differenceInCalendarWeeks/index.js\";\nimport lastDayOfMonth from \"../lastDayOfMonth/index.js\";\nimport startOfMonth from \"../startOfMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name getWeeksInMonth\n * @category Week Helpers\n * @summary Get the number of calendar weeks a month spans.\n *\n * @description\n * Get the number of calendar weeks the month in the given date spans.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Number} the number of calendar weeks\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // How many calendar weeks does February 2015 span?\n * const result = getWeeksInMonth(new Date(2015, 1, 8))\n * //=> 4\n *\n * @example\n * // If the week starts on Monday,\n * // how many calendar weeks does July 2017 span?\n * const result = getWeeksInMonth(new Date(2017, 6, 5), { weekStartsOn: 1 })\n * //=> 6\n */\nexport default function getWeeksInMonth(date, options) {\n requiredArgs(1, arguments);\n return differenceInCalendarWeeks(lastDayOfMonth(date), startOfMonth(date), options) + 1;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getYear\n * @category Year Helpers\n * @summary Get the year of the given date.\n *\n * @description\n * Get the year of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Which year is 2 July 2014?\n * const result = getYear(new Date(2014, 6, 2))\n * //=> 2014\n */\n\nexport default function getYear(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getFullYear();\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { millisecondsInHour } from \"../constants/index.js\";\n/**\n * @name hoursToMilliseconds\n * @category Conversion Helpers\n * @summary Convert hours to milliseconds.\n *\n * @description\n * Convert a number of hours to a full number of milliseconds.\n *\n * @param {number} hours - number of hours to be converted\n *\n * @returns {number} the number of hours converted to milliseconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 2 hours to milliseconds:\n * const result = hoursToMilliseconds(2)\n * //=> 7200000\n */\n\nexport default function hoursToMilliseconds(hours) {\n requiredArgs(1, arguments);\n return Math.floor(hours * millisecondsInHour);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { minutesInHour } from \"../constants/index.js\";\n/**\n * @name hoursToMinutes\n * @category Conversion Helpers\n * @summary Convert hours to minutes.\n *\n * @description\n * Convert a number of hours to a full number of minutes.\n *\n * @param {number} hours - number of hours to be converted\n *\n * @returns {number} the number of hours converted in minutes\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 2 hours to minutes:\n * const result = hoursToMinutes(2)\n * //=> 120\n */\n\nexport default function hoursToMinutes(hours) {\n requiredArgs(1, arguments);\n return Math.floor(hours * minutesInHour);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { secondsInHour } from \"../constants/index.js\";\n/**\n * @name hoursToSeconds\n * @category Conversion Helpers\n * @summary Convert hours to seconds.\n *\n * @description\n * Convert a number of hours to a full number of seconds.\n *\n * @param {number} hours - number of hours to be converted\n *\n * @returns {number} the number of hours converted in seconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 2 hours to seconds:\n * const result = hoursToSeconds(2)\n * //=> 7200\n */\n\nexport default function hoursToSeconds(hours) {\n requiredArgs(1, arguments);\n return Math.floor(hours * secondsInHour);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addDays from \"../addDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subDays\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @description\n * Subtract the specified number of days from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the days subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * const result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\n\nexport default function subDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addDays(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMonths\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * const result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\n\nexport default function subMonths(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, -amount);\n}","import subDays from \"../subDays/index.js\";\nimport subMonths from \"../subMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name sub\n * @category Common Helpers\n * @summary Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date.\n *\n * @description\n * Subtract the specified years, months, weeks, days, hours, minutes and seconds from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be subtracted\n *\n * | Key | Description |\n * |---------|------------------------------------|\n * | years | Amount of years to be subtracted |\n * | months | Amount of months to be subtracted |\n * | weeks | Amount of weeks to be subtracted |\n * | days | Amount of days to be subtracted |\n * | hours | Amount of hours to be subtracted |\n * | minutes | Amount of minutes to be subtracted |\n * | seconds | Amount of seconds to be subtracted |\n *\n * All values default to 0\n *\n * @returns {Date} the new date with the seconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract the following duration from 15 June 2017 15:29:20\n * const result = sub(new Date(2017, 5, 15, 15, 29, 20), {\n * years: 2,\n * months: 9,\n * weeks: 1,\n * days: 7,\n * hours: 5,\n * minutes: 9,\n * seconds: 30\n * })\n * //=> Mon Sep 1 2014 10:19:50\n */\n\nexport default function sub(date, duration) {\n requiredArgs(2, arguments);\n if (!duration || typeof duration !== 'object') return new Date(NaN);\n var years = duration.years ? toInteger(duration.years) : 0;\n var months = duration.months ? toInteger(duration.months) : 0;\n var weeks = duration.weeks ? toInteger(duration.weeks) : 0;\n var days = duration.days ? toInteger(duration.days) : 0;\n var hours = duration.hours ? toInteger(duration.hours) : 0;\n var minutes = duration.minutes ? toInteger(duration.minutes) : 0;\n var seconds = duration.seconds ? toInteger(duration.seconds) : 0; // Subtract years and months\n\n var dateWithoutMonths = subMonths(date, months + years * 12); // Subtract weeks and days\n\n var dateWithoutDays = subDays(dateWithoutMonths, days + weeks * 7); // Subtract hours, minutes and seconds\n\n var minutestoSub = minutes + hours * 60;\n var secondstoSub = seconds + minutestoSub * 60;\n var mstoSub = secondstoSub * 1000;\n var finalDate = new Date(dateWithoutDays.getTime() - mstoSub);\n return finalDate;\n}","import compareAsc from \"../compareAsc/index.js\";\nimport differenceInYears from \"../differenceInYears/index.js\";\nimport differenceInMonths from \"../differenceInMonths/index.js\";\nimport differenceInDays from \"../differenceInDays/index.js\";\nimport differenceInHours from \"../differenceInHours/index.js\";\nimport differenceInMinutes from \"../differenceInMinutes/index.js\";\nimport differenceInSeconds from \"../differenceInSeconds/index.js\";\nimport isValid from \"../isValid/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport sub from \"../sub/index.js\";\n/**\n * @name intervalToDuration\n * @category Common Helpers\n * @summary Convert interval to duration\n *\n * @description\n * Convert a interval object to a duration object.\n *\n * @param {Interval} interval - the interval to convert to duration\n *\n * @returns {Duration} The duration Object\n * @throws {TypeError} Requires 2 arguments\n * @throws {RangeError} `start` must not be Invalid Date\n * @throws {RangeError} `end` must not be Invalid Date\n *\n * @example\n * // Get the duration between January 15, 1929 and April 4, 1968.\n * intervalToDuration({\n * start: new Date(1929, 0, 15, 12, 0, 0),\n * end: new Date(1968, 3, 4, 19, 5, 0)\n * })\n * // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }\n */\n\nexport default function intervalToDuration(_ref) {\n var start = _ref.start,\n end = _ref.end;\n requiredArgs(1, arguments);\n var dateLeft = toDate(start);\n var dateRight = toDate(end);\n\n if (!isValid(dateLeft)) {\n throw new RangeError('Start Date is invalid');\n }\n\n if (!isValid(dateRight)) {\n throw new RangeError('End Date is invalid');\n }\n\n var duration = {\n years: 0,\n months: 0,\n days: 0,\n hours: 0,\n minutes: 0,\n seconds: 0\n };\n var sign = compareAsc(dateLeft, dateRight);\n duration.years = Math.abs(differenceInYears(dateLeft, dateRight));\n var remainingMonths = sub(dateLeft, {\n years: sign * duration.years\n });\n duration.months = Math.abs(differenceInMonths(remainingMonths, dateRight));\n var remainingDays = sub(remainingMonths, {\n months: sign * duration.months\n });\n duration.days = Math.abs(differenceInDays(remainingDays, dateRight));\n var remainingHours = sub(remainingDays, {\n days: sign * duration.days\n });\n duration.hours = Math.abs(differenceInHours(remainingHours, dateRight));\n var remainingMinutes = sub(remainingHours, {\n hours: sign * duration.hours\n });\n duration.minutes = Math.abs(differenceInMinutes(remainingMinutes, dateRight));\n var remainingSeconds = sub(remainingMinutes, {\n minutes: sign * duration.minutes\n });\n duration.seconds = Math.abs(differenceInSeconds(remainingSeconds, dateRight));\n return duration;\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name intlFormat\n * @category Common Helpers\n * @summary Format the date with Intl.DateTimeFormat (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat).\n *\n * @description\n * Return the formatted date string in the given format.\n * The method uses [`Intl.DateTimeFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) inside.\n * formatOptions are the same as [`Intl.DateTimeFormat` options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options)\n *\n * > ⚠️ Please note that before Node version 13.0.0, only the locale data for en-US is available by default.\n *\n * @param {Date|Number} argument - the original date.\n * @param {Object} [formatOptions] - an object with options.\n * @param {'lookup'|'best fit'} [formatOptions.localeMatcher='best fit'] - locale selection algorithm.\n * @param {'narrow'|'short'|'long'} [formatOptions.weekday] - representation the days of the week.\n * @param {'narrow'|'short'|'long'} [formatOptions.era] - representation of eras.\n * @param {'numeric'|'2-digit'} [formatOptions.year] - representation of years.\n * @param {'numeric'|'2-digit'|'narrow'|'short'|'long'} [formatOptions.month='numeric'] - representation of month.\n * @param {'numeric'|'2-digit'} [formatOptions.day='numeric'] - representation of day.\n * @param {'numeric'|'2-digit'} [formatOptions.hour='numeric'] - representation of hours.\n * @param {'numeric'|'2-digit'} [formatOptions.minute] - representation of minutes.\n * @param {'numeric'|'2-digit'} [formatOptions.second] - representation of seconds.\n * @param {'short'|'long'} [formatOptions.timeZoneName] - representation of names of time zones.\n * @param {'basic'|'best fit'} [formatOptions.formatMatcher='best fit'] - format selection algorithm.\n * @param {Boolean} [formatOptions.hour12] - determines whether to use 12-hour time format.\n * @param {String} [formatOptions.timeZone] - the time zone to use.\n * @param {Object} [localeOptions] - an object with locale.\n * @param {String|String[]} [localeOptions.locale] - the locale code\n * @returns {String} the formatted date string.\n * @throws {TypeError} 1 argument required.\n * @throws {RangeError} `date` must not be Invalid Date\n *\n * @example\n * // Represent 10 October 2019 in German.\n * // Convert the date with format's options and locale's options.\n * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), {\n * weekday: 'long',\n * year: 'numeric',\n * month: 'long',\n * day: 'numeric',\n * }, {\n * locale: 'de-DE',\n * })\n * //=> Freitag, 4. Oktober 2019\n *\n * @example\n * // Represent 10 October 2019.\n * // Convert the date with format's options.\n * const result = intlFormat.default(new Date(2019, 9, 4, 12, 30, 13, 456), {\n * year: 'numeric',\n * month: 'numeric',\n * day: 'numeric',\n * hour: 'numeric',\n * })\n * //=> 10/4/2019, 12 PM\n *\n * @example\n * // Represent 10 October 2019 in Korean.\n * // Convert the date with locale's options.\n * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456), {\n * locale: 'ko-KR',\n * })\n * //=> 2019. 10. 4.\n *\n * @example\n * // Represent 10 October 2019 in middle-endian format:\n * const result = intlFormat(new Date(2019, 9, 4, 12, 30, 13, 456))\n * //=> 10/4/2019\n */\nexport default function intlFormat(date, formatOrLocale, localeOptions) {\n var _localeOptions;\n\n requiredArgs(1, arguments);\n var formatOptions;\n\n if (isFormatOptions(formatOrLocale)) {\n formatOptions = formatOrLocale;\n } else {\n localeOptions = formatOrLocale;\n }\n\n return new Intl.DateTimeFormat((_localeOptions = localeOptions) === null || _localeOptions === void 0 ? void 0 : _localeOptions.locale, formatOptions).format(date);\n}\n\nfunction isFormatOptions(opts) {\n return opts !== undefined && !('locale' in opts);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isAfter\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date that should be after the other one to return true\n * @param {Date|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is after the second date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\n\nexport default function isAfter(dirtyDate, dirtyDateToCompare) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dateToCompare = toDate(dirtyDateToCompare);\n return date.getTime() > dateToCompare.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isBefore\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date that should be before the other one to return true\n * @param {Date|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is before the second date\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\n\nexport default function isBefore(dirtyDate, dirtyDateToCompare) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dateToCompare = toDate(dirtyDateToCompare);\n return date.getTime() < dateToCompare.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isEqual\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Boolean} the dates are equal\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * var result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0),\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\n\nexport default function isEqual(dirtyLeftDate, dirtyRightDate) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyLeftDate);\n var dateRight = toDate(dirtyRightDate);\n return dateLeft.getTime() === dateRight.getTime();\n}","/**\n * @name isExists\n * @category Common Helpers\n * @summary Is the given date exists?\n *\n * @description\n * Checks if the given arguments convert to an existing date.\n *\n * @param {Number} year of the date to check\n * @param {Number} month of the date to check\n * @param {Number} day of the date to check\n * @returns {Boolean} the date exists\n * @throws {TypeError} 3 arguments required\n *\n * @example\n * // For the valid date:\n * var result = isExists(2018, 0, 31)\n * //=> true\n *\n * @example\n * // For the invalid date:\n * var result = isExists(2018, 1, 31)\n * //=> false\n */\nexport default function isExists(year, month, day) {\n if (arguments.length < 3) {\n throw new TypeError('3 argument required, but only ' + arguments.length + ' present');\n }\n\n var date = new Date(year, month, day);\n return date.getFullYear() === year && date.getMonth() === month && date.getDate() === day;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isFirstDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the first day of a month?\n *\n * @description\n * Is the given date the first day of a month?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is the first day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 1 September 2014 the first day of a month?\n * var result = isFirstDayOfMonth(new Date(2014, 8, 1))\n * //=> true\n */\n\nexport default function isFirstDayOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getDate() === 1;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isFriday\n * @category Weekday Helpers\n * @summary Is the given date Friday?\n *\n * @description\n * Is the given date Friday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Friday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 26 September 2014 Friday?\n * var result = isFriday(new Date(2014, 8, 26))\n * //=> true\n */\n\nexport default function isFriday(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getDay() === 5;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isFuture\n * @category Common Helpers\n * @summary Is the given date in the future?\n * @pure false\n *\n * @description\n * Is the given date in the future?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in the future\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 31 December 2014 in the future?\n * var result = isFuture(new Date(2014, 11, 31))\n * //=> true\n */\n\nexport default function isFuture(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getTime() > Date.now();\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport setUTCDay from \"../../../_lib/setUTCDay/index.js\";\nimport setUTCISODay from \"../../../_lib/setUTCISODay/index.js\";\nimport setUTCISOWeek from \"../../../_lib/setUTCISOWeek/index.js\";\nimport setUTCWeek from \"../../../_lib/setUTCWeek/index.js\";\nimport startOfUTCISOWeek from \"../../../_lib/startOfUTCISOWeek/index.js\";\nimport startOfUTCWeek from \"../../../_lib/startOfUTCWeek/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar MILLISECONDS_IN_SECOND = 1000;\nvar numericPatterns = {\n month: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n date: /^(3[0-1]|[0-2]?\\d)/,\n // 0 to 31\n dayOfYear: /^(36[0-6]|3[0-5]\\d|[0-2]?\\d?\\d)/,\n // 0 to 366\n week: /^(5[0-3]|[0-4]?\\d)/,\n // 0 to 53\n hour23h: /^(2[0-3]|[0-1]?\\d)/,\n // 0 to 23\n hour24h: /^(2[0-4]|[0-1]?\\d)/,\n // 0 to 24\n hour11h: /^(1[0-1]|0?\\d)/,\n // 0 to 11\n hour12h: /^(1[0-2]|0?\\d)/,\n // 0 to 12\n minute: /^[0-5]?\\d/,\n // 0 to 59\n second: /^[0-5]?\\d/,\n // 0 to 59\n singleDigit: /^\\d/,\n // 0 to 9\n twoDigits: /^\\d{1,2}/,\n // 0 to 99\n threeDigits: /^\\d{1,3}/,\n // 0 to 999\n fourDigits: /^\\d{1,4}/,\n // 0 to 9999\n anyDigitsSigned: /^-?\\d+/,\n singleDigitSigned: /^-?\\d/,\n // 0 to 9, -0 to -9\n twoDigitsSigned: /^-?\\d{1,2}/,\n // 0 to 99, -0 to -99\n threeDigitsSigned: /^-?\\d{1,3}/,\n // 0 to 999, -0 to -999\n fourDigitsSigned: /^-?\\d{1,4}/ // 0 to 9999, -0 to -9999\n\n};\nvar timezonePatterns = {\n basicOptionalMinutes: /^([+-])(\\d{2})(\\d{2})?|Z/,\n basic: /^([+-])(\\d{2})(\\d{2})|Z/,\n basicOptionalSeconds: /^([+-])(\\d{2})(\\d{2})((\\d{2}))?|Z/,\n extended: /^([+-])(\\d{2}):(\\d{2})|Z/,\n extendedOptionalSeconds: /^([+-])(\\d{2}):(\\d{2})(:(\\d{2}))?|Z/\n};\n\nfunction parseNumericPattern(pattern, string, valueCallback) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n }\n\n var value = parseInt(matchResult[0], 10);\n return {\n value: valueCallback ? valueCallback(value) : value,\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseTimezonePattern(pattern, string) {\n var matchResult = string.match(pattern);\n\n if (!matchResult) {\n return null;\n } // Input is 'Z'\n\n\n if (matchResult[0] === 'Z') {\n return {\n value: 0,\n rest: string.slice(1)\n };\n }\n\n var sign = matchResult[1] === '+' ? 1 : -1;\n var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;\n var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;\n var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;\n return {\n value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),\n rest: string.slice(matchResult[0].length)\n };\n}\n\nfunction parseAnyDigitsSigned(string, valueCallback) {\n return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);\n}\n\nfunction parseNDigits(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction parseNDigitsSigned(n, string, valueCallback) {\n switch (n) {\n case 1:\n return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);\n\n case 2:\n return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);\n\n case 3:\n return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);\n\n case 4:\n return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);\n\n default:\n return parseNumericPattern(new RegExp('^-?\\\\d{1,' + n + '}'), string, valueCallback);\n }\n}\n\nfunction dayPeriodEnumToHours(enumValue) {\n switch (enumValue) {\n case 'morning':\n return 4;\n\n case 'evening':\n return 17;\n\n case 'pm':\n case 'noon':\n case 'afternoon':\n return 12;\n\n case 'am':\n case 'midnight':\n case 'night':\n default:\n return 0;\n }\n}\n\nfunction normalizeTwoDigitYear(twoDigitYear, currentYear) {\n var isCommonEra = currentYear > 0; // Absolute number of the current year:\n // 1 -> 1 AC\n // 0 -> 1 BC\n // -1 -> 2 BC\n\n var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;\n var result;\n\n if (absCurrentYear <= 50) {\n result = twoDigitYear || 100;\n } else {\n var rangeEnd = absCurrentYear + 50;\n var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;\n var isPreviousCentury = twoDigitYear >= rangeEnd % 100;\n result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);\n }\n\n return isCommonEra ? result : 1 - result;\n}\n\nvar DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nvar DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n}\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O* | Timezone (GMT) |\n * | p | | P | |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n */\n\n\nvar parsers = {\n // Era\n G: {\n priority: 140,\n parse: function (string, token, match, _options) {\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n // A, B\n\n case 'GGGGG':\n return match.era(string, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return match.era(string, {\n width: 'wide'\n }) || match.era(string, {\n width: 'abbreviated'\n }) || match.era(string, {\n width: 'narrow'\n });\n }\n },\n set: function (date, flags, value, _options) {\n flags.era = value;\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['R', 'u', 't', 'T']\n },\n // Year\n y: {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'yy'\n };\n };\n\n switch (token) {\n case 'y':\n return parseNDigits(4, string, valueCallback);\n\n case 'yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, _options) {\n var currentYear = date.getUTCFullYear();\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Local week-numbering year\n Y: {\n priority: 130,\n parse: function (string, token, match, _options) {\n var valueCallback = function (year) {\n return {\n year: year,\n isTwoDigitYear: token === 'YY'\n };\n };\n\n switch (token) {\n case 'Y':\n return parseNDigits(4, string, valueCallback);\n\n case 'Yo':\n return match.ordinalNumber(string, {\n unit: 'year',\n valueCallback: valueCallback\n });\n\n default:\n return parseNDigits(token.length, string, valueCallback);\n }\n },\n validate: function (_date, value, _options) {\n return value.isTwoDigitYear || value.year > 0;\n },\n set: function (date, flags, value, options) {\n var currentYear = getUTCWeekYear(date, options);\n\n if (value.isTwoDigitYear) {\n var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);\n date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n }\n\n var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;\n date.setUTCFullYear(year, 0, options.firstWeekContainsDate);\n date.setUTCHours(0, 0, 0, 0);\n return startOfUTCWeek(date, options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week-numbering year\n R: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'R') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (_date, _flags, value, _options) {\n var firstWeekOfYear = new Date(0);\n firstWeekOfYear.setUTCFullYear(value, 0, 4);\n firstWeekOfYear.setUTCHours(0, 0, 0, 0);\n return startOfUTCISOWeek(firstWeekOfYear);\n },\n incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Extended year\n u: {\n priority: 130,\n parse: function (string, token, _match, _options) {\n if (token === 'u') {\n return parseNDigitsSigned(4, string);\n }\n\n return parseNDigitsSigned(token.length, string);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCFullYear(value, 0, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']\n },\n // Quarter\n Q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n case 'QQ':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone quarter\n q: {\n priority: 120,\n parse: function (string, token, match, _options) {\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n case 'qq':\n // 01, 02, 03, 04\n return parseNDigits(token.length, string);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return match.ordinalNumber(string, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return match.quarter(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.quarter(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 4;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth((value - 1) * 3, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Month\n M: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'M':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'MM':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.month(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Stand-alone month\n L: {\n priority: 110,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n return value - 1;\n };\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return parseNumericPattern(numericPatterns.month, string, valueCallback);\n // 01, 02, ..., 12\n\n case 'LL':\n return parseNDigits(2, string, valueCallback);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return match.ordinalNumber(string, {\n unit: 'month',\n valueCallback: valueCallback\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return match.month(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.month(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.month(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(value, 1);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Local week of year\n w: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'w':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'wo':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCWeek(setUTCWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']\n },\n // ISO week of year\n I: {\n priority: 100,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'I':\n return parseNumericPattern(numericPatterns.week, string);\n\n case 'Io':\n return match.ordinalNumber(string, {\n unit: 'week'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 53;\n },\n set: function (date, _flags, value, options) {\n return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']\n },\n // Day of the month\n d: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'd':\n return parseNumericPattern(numericPatterns.date, string);\n\n case 'do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n var month = date.getUTCMonth();\n\n if (isLeapYear) {\n return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];\n } else {\n return value >= 1 && value <= DAYS_IN_MONTH[month];\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCDate(value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']\n },\n // Day of year\n D: {\n priority: 90,\n subPriority: 1,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'D':\n case 'DD':\n return parseNumericPattern(numericPatterns.dayOfYear, string);\n\n case 'Do':\n return match.ordinalNumber(string, {\n unit: 'date'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (date, value, _options) {\n var year = date.getUTCFullYear();\n var isLeapYear = isLeapYearIndex(year);\n\n if (isLeapYear) {\n return value >= 1 && value <= 366;\n } else {\n return value >= 1 && value <= 365;\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMonth(0, value);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']\n },\n // Day of week\n E: {\n priority: 90,\n parse: function (string, token, match, _options) {\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']\n },\n // Local day of week\n e: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'e':\n case 'ee':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'eo':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'eee':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.day(string, {\n width: 'short',\n context: 'formatting'\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']\n },\n // Stand-alone local day of week\n c: {\n priority: 90,\n parse: function (string, token, match, options) {\n var valueCallback = function (value) {\n var wholeWeekDays = Math.floor((value - 1) / 7) * 7;\n return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;\n };\n\n switch (token) {\n // 3\n case 'c':\n case 'cc':\n // 03\n return parseNDigits(token.length, string, valueCallback);\n // 3rd\n\n case 'co':\n return match.ordinalNumber(string, {\n unit: 'day',\n valueCallback: valueCallback\n });\n // Tue\n\n case 'ccc':\n return match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'standalone'\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'standalone'\n }) || match.day(string, {\n width: 'short',\n context: 'standalone'\n }) || match.day(string, {\n width: 'narrow',\n context: 'standalone'\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 6;\n },\n set: function (date, _flags, value, options) {\n date = setUTCDay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']\n },\n // ISO day of week\n i: {\n priority: 90,\n parse: function (string, token, match, _options) {\n var valueCallback = function (value) {\n if (value === 0) {\n return 7;\n }\n\n return value;\n };\n\n switch (token) {\n // 2\n case 'i':\n case 'ii':\n // 02\n return parseNDigits(token.length, string);\n // 2nd\n\n case 'io':\n return match.ordinalNumber(string, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // T\n\n case 'iiiii':\n return match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tu\n\n case 'iiiiii':\n return match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n // Tuesday\n\n case 'iiii':\n default:\n return match.day(string, {\n width: 'wide',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'abbreviated',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'short',\n context: 'formatting',\n valueCallback: valueCallback\n }) || match.day(string, {\n width: 'narrow',\n context: 'formatting',\n valueCallback: valueCallback\n });\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 7;\n },\n set: function (date, _flags, value, options) {\n date = setUTCISODay(date, value, options);\n date.setUTCHours(0, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']\n },\n // AM or PM\n a: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'a':\n case 'aa':\n case 'aaa':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaaa':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // AM, PM, midnight\n b: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'b':\n case 'bb':\n case 'bbb':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbbb':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']\n },\n // in the morning, in the afternoon, in the evening, at night\n B: {\n priority: 80,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return match.dayPeriod(string, {\n width: 'wide',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'abbreviated',\n context: 'formatting'\n }) || match.dayPeriod(string, {\n width: 'narrow',\n context: 'formatting'\n });\n }\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 't', 'T']\n },\n // Hour [1-12]\n h: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'h':\n return parseNumericPattern(numericPatterns.hour12h, string);\n\n case 'ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 12;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else if (!isPM && value === 12) {\n date.setUTCHours(0, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['H', 'K', 'k', 't', 'T']\n },\n // Hour [0-23]\n H: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'H':\n return parseNumericPattern(numericPatterns.hour23h, string);\n\n case 'Ho':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 23;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCHours(value, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']\n },\n // Hour [0-11]\n K: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'K':\n return parseNumericPattern(numericPatterns.hour11h, string);\n\n case 'Ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 11;\n },\n set: function (date, _flags, value, _options) {\n var isPM = date.getUTCHours() >= 12;\n\n if (isPM && value < 12) {\n date.setUTCHours(value + 12, 0, 0, 0);\n } else {\n date.setUTCHours(value, 0, 0, 0);\n }\n\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']\n },\n // Hour [1-24]\n k: {\n priority: 70,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'k':\n return parseNumericPattern(numericPatterns.hour24h, string);\n\n case 'ko':\n return match.ordinalNumber(string, {\n unit: 'hour'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 1 && value <= 24;\n },\n set: function (date, _flags, value, _options) {\n var hours = value <= 24 ? value % 24 : value;\n date.setUTCHours(hours, 0, 0, 0);\n return date;\n },\n incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']\n },\n // Minute\n m: {\n priority: 60,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 'm':\n return parseNumericPattern(numericPatterns.minute, string);\n\n case 'mo':\n return match.ordinalNumber(string, {\n unit: 'minute'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMinutes(value, 0, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Second\n s: {\n priority: 50,\n parse: function (string, token, match, _options) {\n switch (token) {\n case 's':\n return parseNumericPattern(numericPatterns.second, string);\n\n case 'so':\n return match.ordinalNumber(string, {\n unit: 'second'\n });\n\n default:\n return parseNDigits(token.length, string);\n }\n },\n validate: function (_date, value, _options) {\n return value >= 0 && value <= 59;\n },\n set: function (date, _flags, value, _options) {\n date.setUTCSeconds(value, 0);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Fraction of second\n S: {\n priority: 30,\n parse: function (string, token, _match, _options) {\n var valueCallback = function (value) {\n return Math.floor(value * Math.pow(10, -token.length + 3));\n };\n\n return parseNDigits(token.length, string, valueCallback);\n },\n set: function (date, _flags, value, _options) {\n date.setUTCMilliseconds(value);\n return date;\n },\n incompatibleTokens: ['t', 'T']\n },\n // Timezone (ISO-8601. +00:00 is `'Z'`)\n X: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'X':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'XX':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'XXXX':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'XXXXX':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'XXX':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'x']\n },\n // Timezone (ISO-8601)\n x: {\n priority: 10,\n parse: function (string, token, _match, _options) {\n switch (token) {\n case 'x':\n return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);\n\n case 'xx':\n return parseTimezonePattern(timezonePatterns.basic, string);\n\n case 'xxxx':\n return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);\n\n case 'xxxxx':\n return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);\n\n case 'xxx':\n default:\n return parseTimezonePattern(timezonePatterns.extended, string);\n }\n },\n set: function (date, flags, value, _options) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n return new Date(date.getTime() - value);\n },\n incompatibleTokens: ['t', 'T', 'X']\n },\n // Seconds timestamp\n t: {\n priority: 40,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value * 1000), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n },\n // Milliseconds timestamp\n T: {\n priority: 20,\n parse: function (string, _token, _match, _options) {\n return parseAnyDigitsSigned(string);\n },\n set: function (_date, _flags, value, _options) {\n return [new Date(value), {\n timestampIsSet: true\n }];\n },\n incompatibleTokens: '*'\n }\n};\nexport default parsers;","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCWeek from \"../getUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCWeek(dirtyDate, dirtyWeek, options) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getUTCWeek(date, options) - week;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport getUTCISOWeek from \"../getUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISOWeek(dirtyDate, dirtyISOWeek) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getUTCISOWeek(date) - isoWeek;\n date.setUTCDate(date.getUTCDate() - diff * 7);\n return date;\n}","import toInteger from \"../toInteger/index.js\";\nimport toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function setUTCISODay(dirtyDate, dirtyDay) {\n requiredArgs(2, arguments);\n var day = toInteger(dirtyDay);\n\n if (day % 7 === 0) {\n day = day - 7;\n }\n\n var weekStartsOn = 1;\n var date = toDate(dirtyDate);\n var currentDay = date.getUTCDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n}","import defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport assign from \"../_lib/assign/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport parsers from \"./_lib/parsers/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar notWhitespaceRegExp = /\\S/;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name parse\n * @category Common Helpers\n * @summary Parse the date.\n *\n * @description\n * Return the date parsed from string using the given format string.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * parse('23 AM', 'HH a', new Date())\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 0001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `parse` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `parse` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`\n *\n * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`\n *\n * while `uu` will just assign the year as is:\n *\n * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`\n *\n * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be assigned to the date in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),\n * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.\n *\n * `referenceDate` must be passed for correct work of the function.\n * If you're not sure which `referenceDate` to supply, create a new instance of Date:\n * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`\n * In this case parsing will be done in the context of the current date.\n * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,\n * then `Invalid Date` will be returned.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n * If parsing failed, `Invalid Date` will be returned.\n * Invalid Date is a Date, whose time value is NaN.\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - Old `parse` was renamed to `toDate`.\n * Now `parse` is a new function which parses a string using a provided format.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward (toDate no longer accepts a string)\n * toDate(1392098430000) // Unix to timestamp\n * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date\n * parse('2016-01-01', 'yyyy-MM-dd', new Date())\n * ```\n *\n * @param {String} dateString - the string to parse\n * @param {String} formatString - the string of tokens\n * @param {Date|Number} referenceDate - defines values missing from the parsed dateString\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Date} the parsed date\n * @throws {TypeError} 3 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Parse 11 February 2014 from middle-endian format:\n * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())\n * //=> Tue Feb 11 2014 00:00:00\n *\n * @example\n * // Parse 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = parse('28-a de februaro', \"do 'de' MMMM\", new Date(2010, 0, 1), {\n * locale: eo\n * })\n * //=> Sun Feb 28 2010 00:00:00\n */\n\nexport default function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {\n requiredArgs(3, arguments);\n var dateString = String(dirtyDateString);\n var formatString = String(dirtyFormatString);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n\n if (!locale.match) {\n throw new RangeError('locale must contain match property');\n }\n\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (formatString === '') {\n if (dateString === '') {\n return toDate(dirtyReferenceDate);\n } else {\n return new Date(NaN);\n }\n }\n\n var subFnOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale\n }; // If timezone isn't specified, it will be set to the system timezone\n\n var setters = [{\n priority: TIMEZONE_UNIT_PRIORITY,\n subPriority: -1,\n set: dateToSystemTimezone,\n index: 0\n }];\n var i;\n var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, subFnOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp);\n var usedTokens = [];\n\n for (i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {\n throwProtectedError(token, formatString, dirtyDateString);\n }\n\n var firstCharacter = token[0];\n var parser = parsers[firstCharacter];\n\n if (parser) {\n var incompatibleTokens = parser.incompatibleTokens;\n\n if (Array.isArray(incompatibleTokens)) {\n var incompatibleToken = void 0;\n\n for (var _i = 0; _i < usedTokens.length; _i++) {\n var usedToken = usedTokens[_i].token;\n\n if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {\n incompatibleToken = usedTokens[_i];\n break;\n }\n }\n\n if (incompatibleToken) {\n throw new RangeError(\"The format string mustn't contain `\".concat(incompatibleToken.fullToken, \"` and `\").concat(token, \"` at the same time\"));\n }\n } else if (parser.incompatibleTokens === '*' && usedTokens.length) {\n throw new RangeError(\"The format string mustn't contain `\".concat(token, \"` and any other token at the same time\"));\n }\n\n usedTokens.push({\n token: firstCharacter,\n fullToken: token\n });\n var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);\n\n if (!parseResult) {\n return new Date(NaN);\n }\n\n setters.push({\n priority: parser.priority,\n subPriority: parser.subPriority || 0,\n set: parser.set,\n validate: parser.validate,\n value: parseResult.value,\n index: setters.length\n });\n dateString = parseResult.rest;\n } else {\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n } // Replace two single quote characters with one single quote character\n\n\n if (token === \"''\") {\n token = \"'\";\n } else if (firstCharacter === \"'\") {\n token = cleanEscapedString(token);\n } // Cut token from string, or, if string doesn't match the token, return Invalid Date\n\n\n if (dateString.indexOf(token) === 0) {\n dateString = dateString.slice(token.length);\n } else {\n return new Date(NaN);\n }\n }\n } // Check if the remaining input contains something other than whitespace\n\n\n if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {\n return new Date(NaN);\n }\n\n var uniquePrioritySetters = setters.map(function (setter) {\n return setter.priority;\n }).sort(function (a, b) {\n return b - a;\n }).filter(function (priority, index, array) {\n return array.indexOf(priority) === index;\n }).map(function (priority) {\n return setters.filter(function (setter) {\n return setter.priority === priority;\n }).sort(function (a, b) {\n return b.subPriority - a.subPriority;\n });\n }).map(function (setterArray) {\n return setterArray[0];\n });\n var date = toDate(dirtyReferenceDate);\n\n if (isNaN(date)) {\n return new Date(NaN);\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37\n\n\n var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));\n var flags = {};\n\n for (i = 0; i < uniquePrioritySetters.length; i++) {\n var setter = uniquePrioritySetters[i];\n\n if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {\n return new Date(NaN);\n }\n\n var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)\n\n if (result[0]) {\n utcDate = result[0];\n assign(flags, result[1]); // Result is date\n } else {\n utcDate = result;\n }\n }\n\n return utcDate;\n}\n\nfunction dateToSystemTimezone(date, flags) {\n if (flags.timestampIsSet) {\n return date;\n }\n\n var convertedDate = new Date(0);\n convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());\n return convertedDate;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","import parse from \"../parse/index.js\";\nimport isValid from \"../isValid/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name isMatch\n * @category Common Helpers\n * @summary validates the date string against given formats\n *\n * @description\n * Return the true if given date is string correct against the given format else\n * will return false.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters in the format string wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the format string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 5 below the table).\n *\n * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited\n * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:\n *\n * ```javascript\n * isMatch('23 AM', 'HH a')\n * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time\n * ```\n *\n * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true\n *\n * Accepted format string patterns:\n * | Unit |Prior| Pattern | Result examples | Notes |\n * |---------------------------------|-----|---------|-----------------------------------|-------|\n * | Era | 140 | G..GGG | AD, BC | |\n * | | | GGGG | Anno Domini, Before Christ | 2 |\n * | | | GGGGG | A, B | |\n * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |\n * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | yy | 44, 01, 00, 17 | 4 |\n * | | | yyy | 044, 001, 123, 999 | 4 |\n * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |\n * | | | yyyyy | ... | 2,4 |\n * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |\n * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |\n * | | | YY | 44, 01, 00, 17 | 4,6 |\n * | | | YYY | 044, 001, 123, 999 | 4 |\n * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |\n * | | | YYYYY | ... | 2,4 |\n * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |\n * | | | RR | -43, 01, 00, 17 | 4,5 |\n * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |\n * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |\n * | | | RRRRR | ... | 2,4,5 |\n * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |\n * | | | uu | -43, 01, 99, -99 | 4 |\n * | | | uuu | -043, 001, 123, 999, -999 | 4 |\n * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |\n * | | | uuuuu | ... | 2,4 |\n * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |\n * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | QQ | 01, 02, 03, 04 | |\n * | | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |\n * | | | qo | 1st, 2nd, 3rd, 4th | 5 |\n * | | | qq | 01, 02, 03, 04 | |\n * | | | qqq | Q1, Q2, Q3, Q4 | |\n * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | | qqqqq | 1, 2, 3, 4 | 3 |\n * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |\n * | | | Mo | 1st, 2nd, ..., 12th | 5 |\n * | | | MM | 01, 02, ..., 12 | |\n * | | | MMM | Jan, Feb, ..., Dec | |\n * | | | MMMM | January, February, ..., December | 2 |\n * | | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |\n * | | | Lo | 1st, 2nd, ..., 12th | 5 |\n * | | | LL | 01, 02, ..., 12 | |\n * | | | LLL | Jan, Feb, ..., Dec | |\n * | | | LLLL | January, February, ..., December | 2 |\n * | | | LLLLL | J, F, ..., D | |\n * | Local week of year | 100 | w | 1, 2, ..., 53 | |\n * | | | wo | 1st, 2nd, ..., 53th | 5 |\n * | | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |\n * | | | Io | 1st, 2nd, ..., 53th | 5 |\n * | | | II | 01, 02, ..., 53 | 5 |\n * | Day of month | 90 | d | 1, 2, ..., 31 | |\n * | | | do | 1st, 2nd, ..., 31st | 5 |\n * | | | dd | 01, 02, ..., 31 | |\n * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |\n * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |\n * | | | DD | 01, 02, ..., 365, 366 | 7 |\n * | | | DDD | 001, 002, ..., 365, 366 | |\n * | | | DDDD | ... | 2 |\n * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Su | |\n * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | | EEEEE | M, T, W, T, F, S, S | |\n * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |\n * | | | io | 1st, 2nd, ..., 7th | 5 |\n * | | | ii | 01, 02, ..., 07 | 5 |\n * | | | iii | Mon, Tue, Wed, ..., Su | 5 |\n * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |\n * | | | iiiii | M, T, W, T, F, S, S | 5 |\n * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |\n * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |\n * | | | eo | 2nd, 3rd, ..., 1st | 5 |\n * | | | ee | 02, 03, ..., 01 | |\n * | | | eee | Mon, Tue, Wed, ..., Su | |\n * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | | eeeee | M, T, W, T, F, S, S | |\n * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |\n * | | | co | 2nd, 3rd, ..., 1st | 5 |\n * | | | cc | 02, 03, ..., 01 | |\n * | | | ccc | Mon, Tue, Wed, ..., Su | |\n * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | | ccccc | M, T, W, T, F, S, S | |\n * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | 80 | a..aaa | AM, PM | |\n * | | | aaaa | a.m., p.m. | 2 |\n * | | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |\n * | | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | | bbbbb | a, p, n, mi | |\n * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |\n * | | | BBBB | at night, in the morning, ... | 2 |\n * | | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |\n * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |\n * | | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |\n * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |\n * | | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |\n * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |\n * | | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |\n * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |\n * | | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | 60 | m | 0, 1, ..., 59 | |\n * | | | mo | 0th, 1st, ..., 59th | 5 |\n * | | | mm | 00, 01, ..., 59 | |\n * | Second | 50 | s | 0, 1, ..., 59 | |\n * | | | so | 0th, 1st, ..., 59th | 5 |\n * | | | ss | 00, 01, ..., 59 | |\n * | Seconds timestamp | 40 | t | 512969520 | |\n * | | | tt | ... | 2 |\n * | Fraction of second | 30 | S | 0, 1, ..., 9 | |\n * | | | SS | 00, 01, ..., 99 | |\n * | | | SSS | 000, 0001, ..., 999 | |\n * | | | SSSS | ... | 2 |\n * | Milliseconds timestamp | 20 | T | 512969520900 | |\n * | | | TT | ... | 2 |\n * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |\n * | | | XX | -0800, +0530, Z | |\n * | | | XXX | -08:00, +05:30, Z | |\n * | | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |\n * | | | xx | -0800, +0530, +0000 | |\n * | | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Long localized date | NA | P | 05/29/1453 | 5,8 |\n * | | | PP | May 29, 1453 | |\n * | | | PPP | May 29th, 1453 | |\n * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |\n * | Long localized time | NA | p | 12:00 AM | 5,8 |\n * | | | pp | 12:00:00 AM | |\n * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |\n * | | | PPpp | May 29, 1453, 12:00:00 AM | |\n * | | | PPPpp | May 29th, 1453 at ... | |\n * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular.\n * In `format` function, they will produce different result:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * `isMatch` will try to match both formatting and stand-alone units interchangably.\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table:\n * - for numerical units (`yyyyyyyy`) `isMatch` will try to match a number\n * as wide as the sequence\n * - for text units (`MMMMMMMM`) `isMatch` will try to match the widest variation of the unit.\n * These variations are marked with \"2\" in the last column of the table.\n *\n * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 4. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:\n *\n * `isMatch('50', 'yy') //=> true`\n *\n * `isMatch('75', 'yy') //=> true`\n *\n * while `uu` will use the year as is:\n *\n * `isMatch('50', 'uu') //=> true`\n *\n * `isMatch('75', 'uu') //=> true`\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}\n * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).\n *\n * 5. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based\n * on the given locale.\n *\n * using `en-US` locale: `P` => `MM/dd/yyyy`\n * using `en-US` locale: `p` => `hh:mm a`\n * using `pt-BR` locale: `P` => `dd/MM/yyyy`\n * using `pt-BR` locale: `p` => `HH:mm`\n *\n * Values will be checked in the descending order of its unit's priority.\n * Units of an equal priority overwrite each other in the order of appearance.\n *\n * If no values of higher priority are matched (e.g. when matching string 'January 1st' without a year),\n * the values will be taken from today's using `new Date()` date which works as a context of parsing.\n *\n * The result may vary by locale.\n *\n * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.\n *\n *\n *\n * @param {String} dateString - the date string to verify\n * @param {String} formatString - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {Boolean}\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} `options.locale` must contain `match` property\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Match 11 February 2014 from middle-endian format:\n * var result = isMatch('02/11/2014', 'MM/dd/yyyy')\n * //=> true\n *\n * @example\n * // Match 28th of February in Esperanto locale in the context of 2010 year:\n * import eo from 'date-fns/locale/eo'\n * var result = isMatch('28-a de februaro', \"do 'de' MMMM\", {\n * locale: eo\n * })\n * //=> true\n */\nexport default function isMatch(dateString, formatString, options) {\n requiredArgs(2, arguments);\n return isValid(parse(dateString, formatString, new Date(), options));\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isMonday\n * @category Weekday Helpers\n * @summary Is the given date Monday?\n *\n * @description\n * Is the given date Monday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Monday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 22 September 2014 Monday?\n * var result = isMonday(new Date(2014, 8, 22))\n * //=> true\n */\n\nexport default function isMonday(date) {\n requiredArgs(1, arguments);\n return toDate(date).getDay() === 1;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isPast\n * @category Common Helpers\n * @summary Is the given date in the past?\n * @pure false\n *\n * @description\n * Is the given date in the past?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in the past\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 2 July 2014 in the past?\n * var result = isPast(new Date(2014, 6, 2))\n * //=> true\n */\n\nexport default function isPast(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getTime() < Date.now();\n}","import startOfHour from \"../startOfHour/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameHour\n * @category Hour Helpers\n * @summary Are the given dates in the same hour?\n *\n * @description\n * Are the given dates in the same hour?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same hour\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour?\n * var result = isSameHour(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 6, 30))\n * //=> true\n */\n\nexport default function isSameHour(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeftStartOfHour = startOfHour(dirtyDateLeft);\n var dateRightStartOfHour = startOfHour(dirtyDateRight);\n return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime();\n}","import startOfWeek from \"../startOfWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name isSameWeek\n * @category Week Helpers\n * @summary Are the given dates in the same week?\n *\n * @description\n * Are the given dates in the same week?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Boolean} the dates are in the same week\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4))\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * var result = isSameWeek(new Date(2014, 7, 31), new Date(2014, 8, 4), {\n * weekStartsOn: 1\n * })\n * //=> false\n */\nexport default function isSameWeek(dirtyDateLeft, dirtyDateRight, dirtyOptions) {\n requiredArgs(2, arguments);\n var dateLeftStartOfWeek = startOfWeek(dirtyDateLeft, dirtyOptions);\n var dateRightStartOfWeek = startOfWeek(dirtyDateRight, dirtyOptions);\n return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime();\n}","import isSameWeek from \"../isSameWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameISOWeek\n * @category ISO Week Helpers\n * @summary Are the given dates in the same ISO week?\n *\n * @description\n * Are the given dates in the same ISO week?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same ISO week\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 1 September 2014 and 7 September 2014 in the same ISO week?\n * var result = isSameISOWeek(new Date(2014, 8, 1), new Date(2014, 8, 7))\n * //=> true\n */\n\nexport default function isSameISOWeek(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n return isSameWeek(dirtyDateLeft, dirtyDateRight, {\n weekStartsOn: 1\n });\n}","import startOfISOWeekYear from \"../startOfISOWeekYear/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Are the given dates in the same ISO week-numbering year?\n *\n * @description\n * Are the given dates in the same ISO week-numbering year?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `isSameISOYear` to `isSameISOWeekYear`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same ISO week-numbering year\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year?\n * var result = isSameISOWeekYear(new Date(2003, 11, 29), new Date(2005, 0, 2))\n * //=> true\n */\n\nexport default function isSameISOWeekYear(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeftStartOfYear = startOfISOWeekYear(dirtyDateLeft);\n var dateRightStartOfYear = startOfISOWeekYear(dirtyDateRight);\n return dateLeftStartOfYear.getTime() === dateRightStartOfYear.getTime();\n}","import startOfMinute from \"../startOfMinute/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameMinute\n * @category Minute Helpers\n * @summary Are the given dates in the same minute?\n *\n * @description\n * Are the given dates in the same minute?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same minute\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15\n * // in the same minute?\n * var result = isSameMinute(\n * new Date(2014, 8, 4, 6, 30),\n * new Date(2014, 8, 4, 6, 30, 15)\n * )\n * //=> true\n */\n\nexport default function isSameMinute(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeftStartOfMinute = startOfMinute(dirtyDateLeft);\n var dateRightStartOfMinute = startOfMinute(dirtyDateRight);\n return dateLeftStartOfMinute.getTime() === dateRightStartOfMinute.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameMonth\n * @category Month Helpers\n * @summary Are the given dates in the same month?\n *\n * @description\n * Are the given dates in the same month?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same month\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * var result = isSameMonth(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\n\nexport default function isSameMonth(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear() && dateLeft.getMonth() === dateRight.getMonth();\n}","import startOfQuarter from \"../startOfQuarter/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameQuarter\n * @category Quarter Helpers\n * @summary Are the given dates in the same year quarter?\n *\n * @description\n * Are the given dates in the same year quarter?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same quarter\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 1 January 2014 and 8 March 2014 in the same quarter?\n * var result = isSameQuarter(new Date(2014, 0, 1), new Date(2014, 2, 8))\n * //=> true\n */\n\nexport default function isSameQuarter(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeftStartOfQuarter = startOfQuarter(dirtyDateLeft);\n var dateRightStartOfQuarter = startOfQuarter(dirtyDateRight);\n return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfSecond\n * @category Second Helpers\n * @summary Return the start of a second for the given date.\n *\n * @description\n * Return the start of a second for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a second\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a second for 1 December 2014 22:15:45.400:\n * const result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.000\n */\n\nexport default function startOfSecond(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setMilliseconds(0);\n return date;\n}","import startOfSecond from \"../startOfSecond/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameSecond\n * @category Second Helpers\n * @summary Are the given dates in the same second?\n *\n * @description\n * Are the given dates in the same second?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same second\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500\n * // in the same second?\n * var result = isSameSecond(\n * new Date(2014, 8, 4, 6, 30, 15),\n * new Date(2014, 8, 4, 6, 30, 15, 500)\n * )\n * //=> true\n */\n\nexport default function isSameSecond(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeftStartOfSecond = startOfSecond(dirtyDateLeft);\n var dateRightStartOfSecond = startOfSecond(dirtyDateRight);\n return dateLeftStartOfSecond.getTime() === dateRightStartOfSecond.getTime();\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isSameYear\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the first date to check\n * @param {Date|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same year\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * var result = isSameYear(new Date(2014, 8, 2), new Date(2014, 8, 25))\n * //=> true\n */\n\nexport default function isSameYear(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() === dateRight.getFullYear();\n}","import isSameHour from \"../isSameHour/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isThisHour\n * @category Hour Helpers\n * @summary Is the given date in the same hour as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same hour as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this hour\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:00:00 in this hour?\n * var result = isThisHour(new Date(2014, 8, 25, 18))\n * //=> true\n */\n\nexport default function isThisHour(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameHour(Date.now(), dirtyDate);\n}","import isSameISOWeek from \"../isSameISOWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isThisISOWeek\n * @category ISO Week Helpers\n * @summary Is the given date in the same ISO week as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same ISO week as the current date?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 25 September 2014, is 22 September 2014 in this ISO week?\n * var result = isThisISOWeek(new Date(2014, 8, 22))\n * //=> true\n */\n\nexport default function isThisISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameISOWeek(dirtyDate, Date.now());\n}","import isSameMinute from \"../isSameMinute/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isThisMinute\n * @category Minute Helpers\n * @summary Is the given date in the same minute as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same minute as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this minute\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:30:00 in this minute?\n * var result = isThisMinute(new Date(2014, 8, 25, 18, 30))\n * //=> true\n */\n\nexport default function isThisMinute(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameMinute(Date.now(), dirtyDate);\n}","import isSameMonth from \"../isSameMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isThisMonth\n * @category Month Helpers\n * @summary Is the given date in the same month as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same month as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 25 September 2014, is 15 September 2014 in this month?\n * var result = isThisMonth(new Date(2014, 8, 15))\n * //=> true\n */\n\nexport default function isThisMonth(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameMonth(Date.now(), dirtyDate);\n}","import isSameQuarter from \"../isSameQuarter/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isThisQuarter\n * @category Quarter Helpers\n * @summary Is the given date in the same quarter as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same quarter as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this quarter\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 25 September 2014, is 2 July 2014 in this quarter?\n * var result = isThisQuarter(new Date(2014, 6, 2))\n * //=> true\n */\n\nexport default function isThisQuarter(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameQuarter(Date.now(), dirtyDate);\n}","import isSameSecond from \"../isSameSecond/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isThisSecond\n * @category Second Helpers\n * @summary Is the given date in the same second as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same second as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this second\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:30:15.000 in this second?\n * var result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15))\n * //=> true\n */\n\nexport default function isThisSecond(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameSecond(Date.now(), dirtyDate);\n}","import isSameWeek from \"../isSameWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name isThisWeek\n * @category Week Helpers\n * @summary Is the given date in the same week as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same week as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @param {Object} [options] - the object with options\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Boolean} the date is in this week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // If today is 25 September 2014, is 21 September 2014 in this week?\n * var result = isThisWeek(new Date(2014, 8, 21))\n * //=> true\n *\n * @example\n * // If today is 25 September 2014 and week starts with Monday\n * // is 21 September 2014 in this week?\n * var result = isThisWeek(new Date(2014, 8, 21), { weekStartsOn: 1 })\n * //=> false\n */\nexport default function isThisWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n return isSameWeek(dirtyDate, Date.now(), options);\n}","import isSameYear from \"../isSameYear/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isThisYear\n * @category Year Helpers\n * @summary Is the given date in the same year as the current date?\n * @pure false\n *\n * @description\n * Is the given date in the same year as the current date?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is in this year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 25 September 2014, is 2 July 2014 in this year?\n * var result = isThisYear(new Date(2014, 6, 2))\n * //=> true\n */\n\nexport default function isThisYear(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameYear(dirtyDate, Date.now());\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isThursday\n * @category Weekday Helpers\n * @summary Is the given date Thursday?\n *\n * @description\n * Is the given date Thursday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Thursday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 25 September 2014 Thursday?\n * var result = isThursday(new Date(2014, 8, 25))\n * //=> true\n */\n\nexport default function isThursday(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getDay() === 4;\n}","import isSameDay from \"../isSameDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isToday\n * @category Day Helpers\n * @summary Is the given date today?\n * @pure false\n *\n * @description\n * Is the given date today?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is today\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 6 October 14:00:00 today?\n * var result = isToday(new Date(2014, 9, 6, 14, 0))\n * //=> true\n */\n\nexport default function isToday(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameDay(dirtyDate, Date.now());\n}","import addDays from \"../addDays/index.js\";\nimport isSameDay from \"../isSameDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isTomorrow\n * @category Day Helpers\n * @summary Is the given date tomorrow?\n * @pure false\n *\n * @description\n * Is the given date tomorrow?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is tomorrow\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow?\n * var result = isTomorrow(new Date(2014, 9, 7, 14, 0))\n * //=> true\n */\n\nexport default function isTomorrow(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameDay(dirtyDate, addDays(Date.now(), 1));\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isTuesday\n * @category Weekday Helpers\n * @summary Is the given date Tuesday?\n *\n * @description\n * Is the given date Tuesday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Tuesday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 23 September 2014 Tuesday?\n * var result = isTuesday(new Date(2014, 8, 23))\n * //=> true\n */\n\nexport default function isTuesday(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getDay() === 2;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isWednesday\n * @category Weekday Helpers\n * @summary Is the given date Wednesday?\n *\n * @description\n * Is the given date Wednesday?\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is Wednesday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 24 September 2014 Wednesday?\n * const result = isWednesday(new Date(2014, 8, 24))\n * //=> true\n */\n\nexport default function isWednesday(dirtyDate) {\n requiredArgs(1, arguments);\n return toDate(dirtyDate).getDay() === 3;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name isWithinInterval\n * @category Interval Helpers\n * @summary Is the given date within the interval?\n *\n * @description\n * Is the given date within the interval? (Including start and end.)\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `isWithinRange` to `isWithinInterval`.\n * This change was made to mirror the use of the word \"interval\" in standard ISO 8601:2004 terminology:\n *\n * ```\n * 2.1.3\n * time interval\n * part of the time axis limited by two instants\n * ```\n *\n * Also, this function now accepts an object with `start` and `end` properties\n * instead of two arguments as an interval.\n * This function now throws `RangeError` if the start of the interval is after its end\n * or if any date in the interval is `Invalid Date`.\n *\n * ```javascript\n * // Before v2.0.0\n *\n * isWithinRange(\n * new Date(2014, 0, 3),\n * new Date(2014, 0, 1), new Date(2014, 0, 7)\n * )\n *\n * // v2.0.0 onward\n *\n * isWithinInterval(\n * new Date(2014, 0, 3),\n * { start: new Date(2014, 0, 1), end: new Date(2014, 0, 7) }\n * )\n * ```\n *\n * @param {Date|Number} date - the date to check\n * @param {Interval} interval - the interval to check\n * @returns {Boolean} the date is within the interval\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} The start of an interval cannot be after its end\n * @throws {RangeError} Date in interval cannot be `Invalid Date`\n *\n * @example\n * // For the date within the interval:\n * isWithinInterval(new Date(2014, 0, 3), {\n * start: new Date(2014, 0, 1),\n * end: new Date(2014, 0, 7)\n * })\n * //=> true\n *\n * @example\n * // For the date outside of the interval:\n * isWithinInterval(new Date(2014, 0, 10), {\n * start: new Date(2014, 0, 1),\n * end: new Date(2014, 0, 7)\n * })\n * //=> false\n *\n * @example\n * // For date equal to interval start:\n * isWithinInterval(date, { start, end: date }) // => true\n *\n * @example\n * // For date equal to interval end:\n * isWithinInterval(date, { start: date, end }) // => true\n */\nexport default function isWithinInterval(dirtyDate, interval) {\n requiredArgs(2, arguments);\n var time = toDate(dirtyDate).getTime();\n var startTime = toDate(interval.start).getTime();\n var endTime = toDate(interval.end).getTime(); // Throw an exception if start date is after end date or if any date is `Invalid Date`\n\n if (!(startTime <= endTime)) {\n throw new RangeError('Invalid interval');\n }\n\n return time >= startTime && time <= endTime;\n}","import isSameDay from \"../isSameDay/index.js\";\nimport subDays from \"../subDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isYesterday\n * @category Day Helpers\n * @summary Is the given date yesterday?\n * @pure false\n *\n * @description\n * Is the given date yesterday?\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is yesterday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // If today is 6 October 2014, is 5 October 14:00:00 yesterday?\n * var result = isYesterday(new Date(2014, 9, 5, 14, 0))\n * //=> true\n */\n\nexport default function isYesterday(dirtyDate) {\n requiredArgs(1, arguments);\n return isSameDay(dirtyDate, subDays(Date.now(), 1));\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name lastDayOfDecade\n * @category Decade Helpers\n * @summary Return the last day of a decade for the given date.\n *\n * @description\n * Return the last day of a decade for the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the last day of a decade\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The last day of a decade for 21 December 2012 21:12:00:\n * var result = lastDayOfDecade(new Date(2012, 11, 21, 21, 12, 00))\n * //=> Wed Dec 31 2019 00:00:00\n */\n\nexport default function lastDayOfDecade(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var decade = 9 + Math.floor(year / 10) * 10;\n date.setFullYear(decade + 1, 0, 0);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name lastDayOfWeek\n * @category Week Helpers\n * @summary Return the last day of a week for the given date.\n *\n * @description\n * Return the last day of a week for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the last day of a week\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // The last day of a week for 2 September 2014 11:55:00:\n * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00:\n * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport default function lastDayOfWeek(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6');\n }\n\n var date = toDate(dirtyDate);\n var day = date.getDay();\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);\n date.setHours(0, 0, 0, 0);\n date.setDate(date.getDate() + diff);\n return date;\n}","import lastDayOfWeek from \"../lastDayOfWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name lastDayOfISOWeek\n * @category ISO Week Helpers\n * @summary Return the last day of an ISO week for the given date.\n *\n * @description\n * Return the last day of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the last day of an ISO week\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The last day of an ISO week for 2 September 2014 11:55:00:\n * var result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 00:00:00\n */\n\nexport default function lastDayOfISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n return lastDayOfWeek(dirtyDate, {\n weekStartsOn: 1\n });\n}","import getISOWeekYear from \"../getISOWeekYear/index.js\";\nimport startOfISOWeek from \"../startOfISOWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name lastDayOfISOWeekYear\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the last day of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the last day of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The function was renamed from `lastDayOfISOYear` to `lastDayOfISOWeekYear`.\n * \"ISO week year\" is short for [ISO week-numbering year](https://en.wikipedia.org/wiki/ISO_week_date).\n * This change makes the name consistent with\n * locale-dependent week-numbering year helpers, e.g., `getWeekYear`.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of an ISO week-numbering year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The last day of an ISO week-numbering year for 2 July 2005:\n * var result = lastDayOfISOWeekYear(new Date(2005, 6, 2))\n * //=> Sun Jan 01 2006 00:00:00\n */\n\nexport default function lastDayOfISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setFullYear(year + 1, 0, 4);\n fourthOfJanuary.setHours(0, 0, 0, 0);\n var date = startOfISOWeek(fourthOfJanuary);\n date.setDate(date.getDate() - 1);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name lastDayOfQuarter\n * @category Quarter Helpers\n * @summary Return the last day of a year quarter for the given date.\n *\n * @description\n * Return the last day of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @param {Object} [options] - an object with options.\n * @param {0|1|2} [options.additionalDigits=2] - passed to `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}\n * @returns {Date} the last day of a quarter\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // The last day of a quarter for 2 September 2014 11:55:00:\n * var result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 00:00:00\n */\n\nexport default function lastDayOfQuarter(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var currentMonth = date.getMonth();\n var month = currentMonth - currentMonth % 3 + 3;\n date.setMonth(month, 0);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name lastDayOfYear\n * @category Year Helpers\n * @summary Return the last day of a year for the given date.\n *\n * @description\n * Return the last day of a year for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the last day of a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The last day of a year for 2 September 2014 11:55:00:\n * var result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Dec 31 2014 00:00:00\n */\n\nexport default function lastDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n date.setFullYear(year + 1, 0, 0);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/lightFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport isValid from \"../isValid/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // This RegExp consists of three parts separated by `|`:\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /(\\w)\\1*|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name lightFormat\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. Unlike `format`,\n * `lightFormat` doesn't use locales and outputs date using the most popular tokens.\n *\n * > ⚠️ Please note that the `lightFormat` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples |\n * |---------------------------------|---------|-----------------------------------|\n * | AM, PM | a..aaa | AM, PM |\n * | | aaaa | a.m., p.m. |\n * | | aaaaa | a, p |\n * | Calendar year | y | 44, 1, 1900, 2017 |\n * | | yy | 44, 01, 00, 17 |\n * | | yyy | 044, 001, 000, 017 |\n * | | yyyy | 0044, 0001, 1900, 2017 |\n * | Month (formatting) | M | 1, 2, ..., 12 |\n * | | MM | 01, 02, ..., 12 |\n * | Day of month | d | 1, 2, ..., 31 |\n * | | dd | 01, 02, ..., 31 |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 |\n * | | hh | 01, 02, ..., 11, 12 |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 |\n * | | HH | 00, 01, 02, ..., 23 |\n * | Minute | m | 0, 1, ..., 59 |\n * | | mm | 00, 01, ..., 59 |\n * | Second | s | 0, 1, ..., 59 |\n * | | ss | 00, 01, ..., 59 |\n * | Fraction of second | S | 0, 1, ..., 9 |\n * | | SS | 00, 01, ..., 99 |\n * | | SSS | 000, 0001, ..., 999 |\n * | | SSSS | ... |\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * const result = lightFormat(new Date(2014, 1, 11), 'yyyy-MM-dd')\n * //=> '2014-02-11'\n */\n\nexport default function lightFormat(dirtyDate, formatStr) {\n requiredArgs(2, arguments);\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var tokens = formatStr.match(formattingTokensRegExp); // The only case when formattingTokensRegExp doesn't match the string is when it's empty\n\n if (!tokens) return '';\n var result = tokens.map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n return formatter(utcDate, substring);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n var matches = input.match(escapedStringRegExp);\n\n if (!matches) {\n return input;\n }\n\n return matches[1].replace(doubleQuoteRegExp, \"'\");\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\n// Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n// 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\nvar daysInYear = 365.2425;\n/**\n * @name milliseconds\n * @category Millisecond Helpers\n * @summary\n * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds.\n *\n * @description\n * Returns the number of milliseconds in the specified, years, months, weeks, days, hours, minutes and seconds.\n *\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n *\n * One month is a year divided by 12.\n *\n * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {number} the milliseconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // 1 year in milliseconds\n * milliseconds({ years: 1 })\n * //=> 31556952000\n *\n * // 3 months in milliseconds\n * milliseconds({ months: 3 })\n * //=> 7889238000\n */\n\nexport default function milliseconds(_ref) {\n var years = _ref.years,\n months = _ref.months,\n weeks = _ref.weeks,\n days = _ref.days,\n hours = _ref.hours,\n minutes = _ref.minutes,\n seconds = _ref.seconds;\n requiredArgs(1, arguments);\n var totalDays = 0;\n if (years) totalDays += years * daysInYear;\n if (months) totalDays += months * (daysInYear / 12);\n if (weeks) totalDays += weeks * 7;\n if (days) totalDays += days;\n var totalSeconds = totalDays * 24 * 60 * 60;\n if (hours) totalSeconds += hours * 60 * 60;\n if (minutes) totalSeconds += minutes * 60;\n if (seconds) totalSeconds += seconds;\n return Math.round(totalSeconds * 1000);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { millisecondsInHour } from \"../constants/index.js\";\n/**\n * @name millisecondsToHours\n * @category Conversion Helpers\n * @summary Convert milliseconds to hours.\n *\n * @description\n * Convert a number of milliseconds to a full number of hours.\n *\n * @param {number} milliseconds - number of milliseconds to be converted\n *\n * @returns {number} the number of milliseconds converted in hours\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 7200000 milliseconds to hours:\n * const result = millisecondsToHours(7200000)\n * //=> 2\n *\n * @example\n * // It uses floor rounding:\n * const result = millisecondsToHours(7199999)\n * //=> 1\n */\n\nexport default function millisecondsToHours(milliseconds) {\n requiredArgs(1, arguments);\n var hours = milliseconds / millisecondsInHour;\n return Math.floor(hours);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { millisecondsInMinute } from \"../constants/index.js\";\n/**\n * @name millisecondsToMinutes\n * @category Conversion Helpers\n * @summary Convert milliseconds to minutes.\n *\n * @description\n * Convert a number of milliseconds to a full number of minutes.\n *\n * @param {number} milliseconds - number of milliseconds to be converted.\n *\n * @returns {number} the number of milliseconds converted in minutes\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 60000 milliseconds to minutes:\n * const result = millisecondsToMinutes(60000)\n * //=> 1\n *\n * @example\n * // It uses floor rounding:\n * const result = millisecondsToMinutes(119999)\n * //=> 1\n */\n\nexport default function millisecondsToMinutes(milliseconds) {\n requiredArgs(1, arguments);\n var minutes = milliseconds / millisecondsInMinute;\n return Math.floor(minutes);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { millisecondsInSecond } from \"../constants/index.js\";\n/**\n * @name millisecondsToSeconds\n * @category Conversion Helpers\n * @summary Convert milliseconds to seconds.\n *\n * @description\n * Convert a number of milliseconds to a full number of seconds.\n *\n * @param {number} milliseconds - number of milliseconds to be converted\n *\n * @returns {number} the number of milliseconds converted in seconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 1000 miliseconds to seconds:\n * const result = millisecondsToSeconds(1000)\n * //=> 1\n *\n * @example\n * // It uses floor rounding:\n * const result = millisecondsToSeconds(1999)\n * //=> 1\n */\n\nexport default function millisecondsToSeconds(milliseconds) {\n requiredArgs(1, arguments);\n var seconds = milliseconds / millisecondsInSecond;\n return Math.floor(seconds);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { minutesInHour } from \"../constants/index.js\";\n/**\n * @name minutesToHours\n * @category Conversion Helpers\n * @summary Convert minutes to hours.\n *\n * @description\n * Convert a number of minutes to a full number of hours.\n *\n * @param {number} minutes - number of minutes to be converted\n *\n * @returns {number} the number of minutes converted in hours\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 140 minutes to hours:\n * const result = minutesToHours(120)\n * //=> 2\n *\n * @example\n * // It uses floor rounding:\n * const result = minutesToHours(179)\n * //=> 2\n */\n\nexport default function minutesToHours(minutes) {\n requiredArgs(1, arguments);\n var hours = minutes / minutesInHour;\n return Math.floor(hours);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { millisecondsInMinute } from \"../constants/index.js\";\n/**\n * @name minutesToMilliseconds\n * @category Conversion Helpers\n * @summary Convert minutes to milliseconds.\n *\n * @description\n * Convert a number of minutes to a full number of milliseconds.\n *\n * @param {number} minutes - number of minutes to be converted\n *\n * @returns {number} the number of minutes converted in milliseconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 2 minutes to milliseconds\n * const result = minutesToMilliseconds(2)\n * //=> 120000\n */\n\nexport default function minutesToMilliseconds(minutes) {\n requiredArgs(1, arguments);\n return Math.floor(minutes * millisecondsInMinute);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { secondsInMinute } from \"../constants/index.js\";\n/**\n * @name minutesToSeconds\n * @category Conversion Helpers\n * @summary Convert minutes to seconds.\n *\n * @description\n * Convert a number of minutes to a full number of seconds.\n *\n * @param { number } minutes - number of minutes to be converted\n *\n * @returns {number} the number of minutes converted in seconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 2 minutes to seconds\n * const result = minutesToSeconds(2)\n * //=> 120\n */\n\nexport default function minutesToSeconds(minutes) {\n requiredArgs(1, arguments);\n return Math.floor(minutes * secondsInMinute);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { monthsInQuarter } from \"../constants/index.js\";\n/**\n * @name monthsToQuarters\n * @category Conversion Helpers\n * @summary Convert number of months to quarters.\n *\n * @description\n * Convert a number of months to a full number of quarters.\n *\n * @param {number} months - number of months to be converted.\n *\n * @returns {number} the number of months converted in quarters\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 6 months to quarters:\n * const result = monthsToQuarters(6)\n * //=> 2\n *\n * @example\n * // It uses floor rounding:\n * const result = monthsToQuarters(7)\n * //=> 2\n */\n\nexport default function monthsToQuarters(months) {\n requiredArgs(1, arguments);\n var quarters = months / monthsInQuarter;\n return Math.floor(quarters);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { monthsInYear } from \"../constants/index.js\";\n/**\n * @name monthsToYears\n * @category Conversion Helpers\n * @summary Convert number of months to years.\n *\n * @description\n * Convert a number of months to a full number of years.\n *\n * @param {number} months - number of months to be converted\n *\n * @returns {number} the number of months converted in years\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 36 months to years:\n * const result = monthsToYears(36)\n * //=> 3\n *\n * // It uses floor rounding:\n * const result = monthsToYears(40)\n * //=> 3\n */\n\nexport default function monthsToYears(months) {\n requiredArgs(1, arguments);\n var years = months / monthsInYear;\n return Math.floor(years);\n}","import addDays from \"../addDays/index.js\";\nimport getDay from \"../getDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name nextDay\n * @category Weekday Helpers\n * @summary When is the next day of the week?\n *\n * @description\n * When is the next day of the week? 0-6 the day of the week, 0 represents Sunday.\n *\n * @param {Date | number} date - the date to check\n * @param {Day} day - day of the week\n * @returns {Date} - the date is the next day of week\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // When is the next Monday after Mar, 20, 2020?\n * const result = nextDay(new Date(2020, 2, 20), 1)\n * //=> Mon Mar 23 2020 00:00:00\n *\n * @example\n * // When is the next Tuesday after Mar, 21, 2020?\n * const result = nextDay(new Date(2020, 2, 21), 2)\n * //=> Tue Mar 24 2020 00:00:00\n */\n\nexport default function nextDay(date, day) {\n requiredArgs(2, arguments);\n var delta = day - getDay(date);\n if (delta <= 0) delta += 7;\n return addDays(date, delta);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport nextDay from \"../nextDay/index.js\";\nimport toDate from \"../toDate/index.js\";\n/**\n * @name nextFriday\n * @category Weekday Helpers\n * @summary When is the next Friday?\n *\n * @description\n * When is the next Friday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the next Friday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the next Friday after Mar, 22, 2020?\n * const result = nextFriday(new Date(2020, 2, 22))\n * //=> Fri Mar 27 2020 00:00:00\n */\n\nexport default function nextFriday(date) {\n requiredArgs(1, arguments);\n return nextDay(toDate(date), 5);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport nextDay from \"../nextDay/index.js\";\nimport toDate from \"../toDate/index.js\";\n/**\n * @name nextMonday\n * @category Weekday Helpers\n * @summary When is the next Monday?\n *\n * @description\n * When is the next Monday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the next Monday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the next Monday after Mar, 22, 2020?\n * const result = nextMonday(new Date(2020, 2, 22))\n * //=> Mon Mar 23 2020 00:00:00\n */\n\nexport default function nextMonday(date) {\n requiredArgs(1, arguments);\n return nextDay(toDate(date), 1);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport nextDay from \"../nextDay/index.js\";\nimport toDate from \"../toDate/index.js\";\n/**\n * @name nextSaturday\n * @category Weekday Helpers\n * @summary When is the next Saturday?\n *\n * @description\n * When is the next Saturday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the next Saturday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the next Saturday after Mar, 22, 2020?\n * const result = nextSaturday(new Date(2020, 2, 22))\n * //=> Sat Mar 28 2020 00:00:00\n */\n\nexport default function nextSaturday(date) {\n requiredArgs(1, arguments);\n return nextDay(toDate(date), 6);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport nextDay from \"../nextDay/index.js\";\nimport toDate from \"../toDate/index.js\";\n/**\n * @name nextSunday\n * @category Weekday Helpers\n * @summary When is the next Sunday?\n *\n * @description\n * When is the next Sunday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the next Sunday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the next Sunday after Mar, 22, 2020?\n * const result = nextSunday(new Date(2020, 2, 22))\n * //=> Sun Mar 29 2020 00:00:00\n */\n\nexport default function nextSunday(date) {\n requiredArgs(1, arguments);\n return nextDay(toDate(date), 0);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport nextDay from \"../nextDay/index.js\";\nimport toDate from \"../toDate/index.js\";\n/**\n * @name nextThursday\n * @category Weekday Helpers\n * @summary When is the next Thursday?\n *\n * @description\n * When is the next Thursday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the next Thursday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the next Thursday after Mar, 22, 2020?\n * const result = nextThursday(new Date(2020, 2, 22))\n * //=> Thur Mar 26 2020 00:00:00\n */\n\nexport default function nextThursday(date) {\n requiredArgs(1, arguments);\n return nextDay(toDate(date), 4);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport nextDay from \"../nextDay/index.js\";\nimport toDate from \"../toDate/index.js\";\n/**\n * @name nextTuesday\n * @category Weekday Helpers\n * @summary When is the next Tuesday?\n *\n * @description\n * When is the next Tuesday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the next Tuesday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the next Tuesday after Mar, 22, 2020?\n * const result = nextTuesday(new Date(2020, 2, 22))\n * //=> Tue Mar 24 2020 00:00:00\n */\n\nexport default function nextTuesday(date) {\n requiredArgs(1, arguments);\n return nextDay(toDate(date), 2);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport nextDay from \"../nextDay/index.js\";\nimport toDate from \"../toDate/index.js\";\n/**\n * @name nextWednesday\n * @category Weekday Helpers\n * @summary When is the next Wednesday?\n *\n * @description\n * When is the next Wednesday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the next Wednesday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the next Wednesday after Mar, 22, 2020?\n * const result = nextWednesday(new Date(2020, 2, 22))\n * //=> Wed Mar 25 2020 00:00:00\n */\n\nexport default function nextWednesday(date) {\n requiredArgs(1, arguments);\n return nextDay(toDate(date), 3);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\nvar MILLISECONDS_IN_MINUTE = 60000;\nvar DEFAULT_ADDITIONAL_DIGITS = 2;\nvar patterns = {\n dateTimeDelimiter: /[T ]/,\n timeZoneDelimiter: /[Z ]/i,\n timezone: /([Z+-].*)$/\n};\nvar dateRegex = /^-?(?:(\\d{3})|(\\d{2})(?:-?(\\d{2}))?|W(\\d{2})(?:-?(\\d{1}))?|)$/;\nvar timeRegex = /^(\\d{2}(?:[.,]\\d*)?)(?::?(\\d{2}(?:[.,]\\d*)?))?(?::?(\\d{2}(?:[.,]\\d*)?))?$/;\nvar timezoneRegex = /^([+-])(\\d{2})(?::?(\\d{2}))?$/;\n/**\n * @name parseISO\n * @category Common Helpers\n * @summary Parse ISO string\n *\n * @description\n * Parse the given string in ISO 8601 format and return an instance of Date.\n *\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If the argument isn't a string, the function cannot parse the string or\n * the values are invalid, it returns Invalid Date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The previous `parse` implementation was renamed to `parseISO`.\n *\n * ```javascript\n * // Before v2.0.0\n * parse('2016-01-01')\n *\n * // v2.0.0 onward\n * parseISO('2016-01-01')\n * ```\n *\n * - `parseISO` now validates separate date and time values in ISO-8601 strings\n * and returns `Invalid Date` if the date is invalid.\n *\n * ```javascript\n * parseISO('2018-13-32')\n * //=> Invalid Date\n * ```\n *\n * - `parseISO` now doesn't fall back to `new Date` constructor\n * if it fails to parse a string argument. Instead, it returns `Invalid Date`.\n *\n * @param {String} argument - the value to convert\n * @param {Object} [options] - an object with options.\n * @param {0|1|2} [options.additionalDigits=2] - the additional number of digits in the extended year format\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.additionalDigits` must be 0, 1 or 2\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * var result = parseISO('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Convert string '+02014101' to date,\n * // if the additional number of digits in the extended year format is 1:\n * var result = parseISO('+02014101', { additionalDigits: 1 })\n * //=> Fri Apr 11 2014 00:00:00\n */\n\nexport default function parseISO(argument, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var additionalDigits = options.additionalDigits == null ? DEFAULT_ADDITIONAL_DIGITS : toInteger(options.additionalDigits);\n\n if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {\n throw new RangeError('additionalDigits must be 0, 1 or 2');\n }\n\n if (!(typeof argument === 'string' || Object.prototype.toString.call(argument) === '[object String]')) {\n return new Date(NaN);\n }\n\n var dateStrings = splitDateString(argument);\n var date;\n\n if (dateStrings.date) {\n var parseYearResult = parseYear(dateStrings.date, additionalDigits);\n date = parseDate(parseYearResult.restDateString, parseYearResult.year);\n }\n\n if (isNaN(date) || !date) {\n return new Date(NaN);\n }\n\n var timestamp = date.getTime();\n var time = 0;\n var offset;\n\n if (dateStrings.time) {\n time = parseTime(dateStrings.time);\n\n if (isNaN(time) || time === null) {\n return new Date(NaN);\n }\n }\n\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone);\n\n if (isNaN(offset)) {\n return new Date(NaN);\n }\n } else {\n var dirtyDate = new Date(timestamp + time); // js parsed string assuming it's in UTC timezone\n // but we need it to be parsed in our timezone\n // so we use utc values to build date in our timezone.\n // Year values from 0 to 99 map to the years 1900 to 1999\n // so set year explicitly with setFullYear.\n\n var result = new Date(0);\n result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());\n result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());\n return result;\n }\n\n return new Date(timestamp + time + offset);\n}\n\nfunction splitDateString(dateString) {\n var dateStrings = {};\n var array = dateString.split(patterns.dateTimeDelimiter);\n var timeString; // The regex match should only return at maximum two array elements.\n // [date], [time], or [date, time].\n\n if (array.length > 2) {\n return dateStrings;\n }\n\n if (/:/.test(array[0])) {\n dateStrings.date = null;\n timeString = array[0];\n } else {\n dateStrings.date = array[0];\n timeString = array[1];\n\n if (patterns.timeZoneDelimiter.test(dateStrings.date)) {\n dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];\n timeString = dateString.substr(dateStrings.date.length, dateString.length);\n }\n }\n\n if (timeString) {\n var token = patterns.timezone.exec(timeString);\n\n if (token) {\n dateStrings.time = timeString.replace(token[1], '');\n dateStrings.timezone = token[1];\n } else {\n dateStrings.time = timeString;\n }\n }\n\n return dateStrings;\n}\n\nfunction parseYear(dateString, additionalDigits) {\n var regex = new RegExp('^(?:(\\\\d{4}|[+-]\\\\d{' + (4 + additionalDigits) + '})|(\\\\d{2}|[+-]\\\\d{' + (2 + additionalDigits) + '})$)');\n var captures = dateString.match(regex); // Invalid ISO-formatted year\n\n if (!captures) return {\n year: null\n };\n var year = captures[1] && parseInt(captures[1]);\n var century = captures[2] && parseInt(captures[2]);\n return {\n year: century == null ? year : century * 100,\n restDateString: dateString.slice((captures[1] || captures[2]).length)\n };\n}\n\nfunction parseDate(dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) return null;\n var captures = dateString.match(dateRegex); // Invalid ISO-formatted string\n\n if (!captures) return null;\n var isWeekDate = !!captures[4];\n var dayOfYear = parseDateUnit(captures[1]);\n var month = parseDateUnit(captures[2]) - 1;\n var day = parseDateUnit(captures[3]);\n var week = parseDateUnit(captures[4]);\n var dayOfWeek = parseDateUnit(captures[5]) - 1;\n\n if (isWeekDate) {\n if (!validateWeekDate(year, week, dayOfWeek)) {\n return new Date(NaN);\n }\n\n return dayOfISOWeekYear(year, week, dayOfWeek);\n } else {\n var date = new Date(0);\n\n if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {\n return new Date(NaN);\n }\n\n date.setUTCFullYear(year, month, Math.max(dayOfYear, day));\n return date;\n }\n}\n\nfunction parseDateUnit(value) {\n return value ? parseInt(value) : 1;\n}\n\nfunction parseTime(timeString) {\n var captures = timeString.match(timeRegex);\n if (!captures) return null; // Invalid ISO-formatted time\n\n var hours = parseTimeUnit(captures[1]);\n var minutes = parseTimeUnit(captures[2]);\n var seconds = parseTimeUnit(captures[3]);\n\n if (!validateTime(hours, minutes, seconds)) {\n return NaN;\n }\n\n return hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1000;\n}\n\nfunction parseTimeUnit(value) {\n return value && parseFloat(value.replace(',', '.')) || 0;\n}\n\nfunction parseTimezone(timezoneString) {\n if (timezoneString === 'Z') return 0;\n var captures = timezoneString.match(timezoneRegex);\n if (!captures) return 0;\n var sign = captures[1] === '+' ? -1 : 1;\n var hours = parseInt(captures[2]);\n var minutes = captures[3] && parseInt(captures[3]) || 0;\n\n if (!validateTimezone(hours, minutes)) {\n return NaN;\n }\n\n return sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE);\n}\n\nfunction dayOfISOWeekYear(isoWeekYear, week, day) {\n var date = new Date(0);\n date.setUTCFullYear(isoWeekYear, 0, 4);\n var fourthOfJanuaryDay = date.getUTCDay() || 7;\n var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;\n date.setUTCDate(date.getUTCDate() + diff);\n return date;\n} // Validation functions\n// February is null to handle the leap year (using ||)\n\n\nvar daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nfunction isLeapYearIndex(year) {\n return year % 400 === 0 || year % 4 === 0 && year % 100;\n}\n\nfunction validateDate(year, month, date) {\n return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28));\n}\n\nfunction validateDayOfYearDate(year, dayOfYear) {\n return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);\n}\n\nfunction validateWeekDate(_year, week, day) {\n return week >= 1 && week <= 53 && day >= 0 && day <= 6;\n}\n\nfunction validateTime(hours, minutes, seconds) {\n if (hours === 24) {\n return minutes === 0 && seconds === 0;\n }\n\n return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;\n}\n\nfunction validateTimezone(_hours, minutes) {\n return minutes >= 0 && minutes <= 59;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name parseJSON\n * @category Common Helpers\n * @summary Parse a JSON date string\n *\n * @description\n * Converts a complete ISO date string in UTC time, the typical format for transmitting\n * a date in JSON, to a JavaScript `Date` instance.\n *\n * This is a minimal implementation for converting dates retrieved from a JSON API to\n * a `Date` instance which can be used with other functions in the `date-fns` library.\n * The following formats are supported:\n *\n * - `2000-03-15T05:20:10.123Z`: The output of `.toISOString()` and `JSON.stringify(new Date())`\n * - `2000-03-15T05:20:10Z`: Without milliseconds\n * - `2000-03-15T05:20:10+00:00`: With a zero offset, the default JSON encoded format in some other languages\n * - `2000-03-15T05:20:10+05:45`: With a positive or negative offset, the default JSON encoded format in some other languages\n * - `2000-03-15T05:20:10+0000`: With a zero offset without a colon\n * - `2000-03-15T05:20:10`: Without a trailing 'Z' symbol\n * - `2000-03-15T05:20:10.1234567`: Up to 7 digits in milliseconds field. Only first 3 are taken into account since JS does not allow fractional milliseconds\n * - `2000-03-15 05:20:10`: With a space instead of a 'T' separator for APIs returning a SQL date without reformatting\n *\n * For convenience and ease of use these other input types are also supported\n * via [toDate]{@link https://date-fns.org/docs/toDate}:\n *\n * - A `Date` instance will be cloned\n * - A `number` will be treated as a timestamp\n *\n * Any other input type or invalid date strings will return an `Invalid Date`.\n *\n * @param {String|Number|Date} argument A fully formed ISO8601 date string to convert\n * @returns {Date} the parsed date in the local time zone\n * @throws {TypeError} 1 argument required\n */\n\nexport default function parseJSON(argument) {\n requiredArgs(1, arguments);\n\n if (typeof argument === 'string') {\n var parts = argument.match(/(\\d{4})-(\\d{2})-(\\d{2})[T ](\\d{2}):(\\d{2}):(\\d{2})(?:\\.(\\d{0,7}))?(?:Z|(.)(\\d{2}):?(\\d{2})?)?/);\n\n if (parts) {\n // Group 8 matches the sign\n return new Date(Date.UTC(+parts[1], +parts[2] - 1, +parts[3], +parts[4] - (+parts[9] || 0) * (parts[8] == '-' ? -1 : 1), +parts[5] - (+parts[10] || 0) * (parts[8] == '-' ? -1 : 1), +parts[6], +((parts[7] || '0') + '00').substring(0, 3)));\n }\n\n return new Date(NaN);\n }\n\n return toDate(argument);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport getDay from \"../getDay/index.js\";\nimport subDays from \"../subDays/index.js\";\n\n/**\n * @name previousDay\n * @category Weekday Helpers\n * @summary When is the previous day of the week?\n *\n * @description\n * When is the previous day of the week? 0-6 the day of the week, 0 represents Sunday.\n *\n * @param {Date | number} date - the date to check\n * @param {number} day - day of the week\n * @returns {Date} - the date is the previous day of week\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // When is the previous Monday before Mar, 20, 2020?\n * const result = previousDay(new Date(2020, 2, 20), 1)\n * //=> Mon Mar 16 2020 00:00:00\n *\n * @example\n * // When is the previous Tuesday before Mar, 21, 2020?\n * const result = previousDay(new Date(2020, 2, 21), 2)\n * //=> Tue Mar 17 2020 00:00:00\n */\nexport default function previousDay(date, day) {\n requiredArgs(2, arguments);\n var delta = getDay(date) - day;\n if (delta <= 0) delta += 7;\n return subDays(date, delta);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport previousDay from \"../previousDay/index.js\";\n/**\n * @name previousFriday\n * @category Weekday Helpers\n * @summary When is the previous Friday?\n *\n * @description\n * When is the previous Friday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the previous Friday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the previous Friday before Jun, 19, 2021?\n * const result = previousFriday(new Date(2021, 5, 19))\n * //=> Fri June 18 2021 00:00:00\n */\n\nexport default function previousFriday(date) {\n requiredArgs(1, arguments);\n return previousDay(date, 5);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport previousDay from \"../previousDay/index.js\";\n/**\n * @name previousMonday\n * @category Weekday Helpers\n * @summary When is the previous Monday?\n *\n * @description\n * When is the previous Monday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the previous Monday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the previous Monday before Jun, 18, 2021?\n * const result = previousMonday(new Date(2021, 5, 18))\n * //=> Mon June 14 2021 00:00:00\n */\n\nexport default function previousMonday(date) {\n requiredArgs(1, arguments);\n return previousDay(date, 1);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport previousDay from \"../previousDay/index.js\";\n/**\n * @name previousSaturday\n * @category Weekday Helpers\n * @summary When is the previous Saturday?\n *\n * @description\n * When is the previous Saturday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the previous Saturday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the previous Saturday before Jun, 20, 2021?\n * const result = previousSaturday(new Date(2021, 5, 20))\n * //=> Sat June 19 2021 00:00:00\n */\n\nexport default function previousSaturday(date) {\n requiredArgs(1, arguments);\n return previousDay(date, 6);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport previousDay from \"../previousDay/index.js\";\n/**\n * @name previousSunday\n * @category Weekday Helpers\n * @summary When is the previous Sunday?\n *\n * @description\n * When is the previous Sunday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the previous Sunday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the previous Sunday before Jun, 21, 2021?\n * const result = previousSunday(new Date(2021, 5, 21))\n * //=> Sun June 20 2021 00:00:00\n */\n\nexport default function previousSunday(date) {\n requiredArgs(1, arguments);\n return previousDay(date, 0);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport previousDay from \"../previousDay/index.js\";\n/**\n * @name previousThursday\n * @category Weekday Helpers\n * @summary When is the previous Thursday?\n *\n * @description\n * When is the previous Thursday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the previous Thursday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the previous Thursday before Jun, 18, 2021?\n * const result = previousThursday(new Date(2021, 5, 18))\n * //=> Thu June 17 2021 00:00:00\n */\n\nexport default function previousThursday(date) {\n requiredArgs(1, arguments);\n return previousDay(date, 4);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport previousDay from \"../previousDay/index.js\";\n/**\n * @name previousTuesday\n * @category Weekday Helpers\n * @summary When is the previous Tuesday?\n *\n * @description\n * When is the previous Tuesday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the previous Tuesday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the previous Tuesday before Jun, 18, 2021?\n * const result = previousTuesday(new Date(2021, 5, 18))\n * //=> Tue June 15 2021 00:00:00\n */\n\nexport default function previousTuesday(date) {\n requiredArgs(1, arguments);\n return previousDay(date, 2);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport previousDay from \"../previousDay/index.js\";\n/**\n * @name previousWednesday\n * @category Weekday Helpers\n * @summary When is the previous Wednesday?\n *\n * @description\n * When is the previous Wednesday?\n *\n * @param {Date | number} date - the date to start counting from\n * @returns {Date} the previous Wednesday\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // When is the previous Wednesday before Jun, 18, 2021?\n * const result = previousWednesday(new Date(2021, 5, 18))\n * //=> Wed June 16 2021 00:00:00\n */\n\nexport default function previousWednesday(date) {\n requiredArgs(1, arguments);\n return previousDay(date, 3);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { monthsInQuarter } from \"../constants/index.js\";\n/**\n * @name quartersToMonths\n * @category Conversion Helpers\n * @summary Convert number of quarters to months.\n *\n * @description\n * Convert a number of quarters to a full number of months.\n *\n * @param {number} quarters - number of quarters to be converted\n *\n * @returns {number} the number of quarters converted in months\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 2 quarters to months\n * const result = quartersToMonths(2)\n * //=> 6\n */\n\nexport default function quartersToMonths(quarters) {\n requiredArgs(1, arguments);\n return Math.floor(quarters * monthsInQuarter);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { quartersInYear } from \"../constants/index.js\";\n/**\n * @name quartersToYears\n * @category Conversion Helpers\n * @summary Convert number of quarters to years.\n *\n * @description\n * Convert a number of quarters to a full number of years.\n *\n * @param {number} quarters - number of quarters to be converted\n *\n * @returns {number} the number of quarters converted in years\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 8 quarters to years\n * const result = quartersToYears(8)\n * //=> 2\n *\n * @example\n * // It uses floor rounding:\n * const result = quartersToYears(11)\n * //=> 2\n */\n\nexport default function quartersToYears(quarters) {\n requiredArgs(1, arguments);\n var years = quarters / quartersInYear;\n return Math.floor(years);\n}","import toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name roundToNearestMinutes\n * @category Minute Helpers\n * @summary Rounds the given date to the nearest minute\n *\n * @description\n * Rounds the given date to the nearest minute (or number of minutes).\n * Rounds up when the given date is exactly between the nearest round minutes.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to round\n * @param {Object} [options] - an object with options.\n * @param {Number} [options.nearestTo=1] - nearest number of minutes to round to. E.g. `15` to round to quarter hours.\n * @returns {Date} the new date rounded to the closest minute\n * @throws {TypeError} 1 argument required\n * @throws {RangeError} `options.nearestTo` must be between 1 and 30\n *\n * @example\n * // Round 10 July 2014 12:12:34 to nearest minute:\n * var result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34))\n * //=> Thu Jul 10 2014 12:13:00\n *\n * @example\n * // Round 10 July 2014 12:07:30 to nearest quarter hour:\n * var result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 })\n * // rounds up because given date is exactly between 12:00:00 and 12:15:00\n * //=> Thu Jul 10 2014 12:15:00\n */\n\nexport default function roundToNearestMinutes(dirtyDate, options) {\n if (arguments.length < 1) {\n throw new TypeError('1 argument required, but only none provided present');\n }\n\n var nearestTo = options && 'nearestTo' in options ? toInteger(options.nearestTo) : 1;\n\n if (nearestTo < 1 || nearestTo > 30) {\n throw new RangeError('`options.nearestTo` must be between 1 and 30');\n }\n\n var date = toDate(dirtyDate);\n var seconds = date.getSeconds(); // relevant if nearestTo is 1, which is the default case\n\n var minutes = date.getMinutes() + seconds / 60;\n var roundedMinutes = Math.floor(minutes / nearestTo) * nearestTo;\n var remainderMinutes = minutes % nearestTo;\n var addedMinutes = Math.round(remainderMinutes / nearestTo) * nearestTo;\n return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), roundedMinutes + addedMinutes);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { secondsInHour } from \"../constants/index.js\";\n/**\n * @name secondsToHours\n * @category Conversion Helpers\n * @summary Convert seconds to hours.\n *\n * @description\n * Convert a number of seconds to a full number of hours.\n *\n * @param {number} seconds - number of seconds to be converted\n *\n * @returns {number} the number of seconds converted in hours\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 7200 seconds into hours\n * const result = secondsToHours(7200)\n * //=> 2\n *\n * @example\n * // It uses floor rounding:\n * const result = secondsToHours(7199)\n * //=> 1\n */\n\nexport default function secondsToHours(seconds) {\n requiredArgs(1, arguments);\n var hours = seconds / secondsInHour;\n return Math.floor(hours);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { millisecondsInSecond } from \"../constants/index.js\";\n/**\n * @name secondsToMilliseconds\n * @category Conversion Helpers\n * @summary Convert seconds to milliseconds.\n *\n * @description\n * Convert a number of seconds to a full number of milliseconds.\n *\n * @param {number} seconds - number of seconds to be converted\n *\n * @returns {number} the number of seconds converted in milliseconds\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 2 seconds into milliseconds\n * const result = secondsToMilliseconds(2)\n * //=> 2000\n */\n\nexport default function secondsToMilliseconds(seconds) {\n requiredArgs(1, arguments);\n return seconds * millisecondsInSecond;\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { secondsInMinute } from \"../constants/index.js\";\n/**\n * @name secondsToMinutes\n * @category Conversion Helpers\n * @summary Convert seconds to minutes.\n *\n * @description\n * Convert a number of seconds to a full number of minutes.\n *\n * @param {number} seconds - number of seconds to be converted\n *\n * @returns {number} the number of seconds converted in minutes\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 120 seconds into minutes\n * const result = secondsToMinutes(120)\n * //=> 2\n *\n * @example\n * // It uses floor rounding:\n * const result = secondsToMinutes(119)\n * //=> 1\n */\n\nexport default function secondsToMinutes(seconds) {\n requiredArgs(1, arguments);\n var minutes = seconds / secondsInMinute;\n return Math.floor(minutes);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport getDaysInMonth from \"../getDaysInMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setMonth\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} month - the month of the new date\n * @returns {Date} the new date with the month set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set February to 1 September 2014:\n * const result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\n\nexport default function setMonth(dirtyDate, dirtyMonth) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var month = toInteger(dirtyMonth);\n var year = date.getFullYear();\n var day = date.getDate();\n var dateWithDesiredMonth = new Date(0);\n dateWithDesiredMonth.setFullYear(year, month, 15);\n dateWithDesiredMonth.setHours(0, 0, 0, 0);\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth); // Set the last day of the new month\n // if the original date was the last day of the longer month\n\n date.setMonth(month, Math.min(day, daysInMonth));\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport setMonth from \"../setMonth/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name set\n * @category Common Helpers\n * @summary Set date values to a given date.\n *\n * @description\n * Set date values to a given date.\n *\n * Sets time values to date from object `values`.\n * A value is not set if it is undefined or null or doesn't exist in `values`.\n *\n * Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts\n * to use native `Date#setX` methods. If you use this function, you may not want to include the\n * other `setX` functions that date-fns provides if you are concerned about the bundle size.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Object} values - an object with options\n * @param {Number} [values.year] - the number of years to be set\n * @param {Number} [values.month] - the number of months to be set\n * @param {Number} [values.date] - the number of days to be set\n * @param {Number} [values.hours] - the number of hours to be set\n * @param {Number} [values.minutes] - the number of minutes to be set\n * @param {Number} [values.seconds] - the number of seconds to be set\n * @param {Number} [values.milliseconds] - the number of milliseconds to be set\n * @returns {Date} the new date with options set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `values` must be an object\n *\n * @example\n * // Transform 1 September 2014 into 20 October 2015 in a single line:\n * var result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })\n * //=> Tue Oct 20 2015 00:00:00\n *\n * @example\n * // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:\n * var result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })\n * //=> Mon Sep 01 2014 12:23:45\n */\nexport default function set(dirtyDate, values) {\n requiredArgs(2, arguments);\n\n if (typeof values !== 'object' || values === null) {\n throw new RangeError('values parameter must be an object');\n }\n\n var date = toDate(dirtyDate); // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\n\n if (isNaN(date.getTime())) {\n return new Date(NaN);\n }\n\n if (values.year != null) {\n date.setFullYear(values.year);\n }\n\n if (values.month != null) {\n date = setMonth(date, values.month);\n }\n\n if (values.date != null) {\n date.setDate(toInteger(values.date));\n }\n\n if (values.hours != null) {\n date.setHours(toInteger(values.hours));\n }\n\n if (values.minutes != null) {\n date.setMinutes(toInteger(values.minutes));\n }\n\n if (values.seconds != null) {\n date.setSeconds(toInteger(values.seconds));\n }\n\n if (values.milliseconds != null) {\n date.setMilliseconds(toInteger(values.milliseconds));\n }\n\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setDate\n * @category Day Helpers\n * @summary Set the day of the month to the given date.\n *\n * @description\n * Set the day of the month to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} dayOfMonth - the day of the month of the new date\n * @returns {Date} the new date with the day of the month set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set the 30th day of the month to 1 September 2014:\n * var result = setDate(new Date(2014, 8, 1), 30)\n * //=> Tue Sep 30 2014 00:00:00\n */\n\nexport default function setDate(dirtyDate, dirtyDayOfMonth) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dayOfMonth = toInteger(dirtyDayOfMonth);\n date.setDate(dayOfMonth);\n return date;\n}","import addDays from \"../addDays/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name setDay\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} day - the day of the week of the new date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the new date with the day of the week set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n *\n * @example\n * // Set week day to Sunday, with the default weekStartsOn of Sunday:\n * var result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // Set week day to Sunday, with a weekStartsOn of Monday:\n * var result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })\n * //=> Sun Sep 07 2014 00:00:00\n */\nexport default function setDay(dirtyDate, dirtyDay, dirtyOptions) {\n requiredArgs(2, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = date.getDay();\n var remainder = day % 7;\n var dayIndex = (remainder + 7) % 7;\n var delta = 7 - weekStartsOn;\n var diff = day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7;\n return addDays(date, diff);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setDayOfYear\n * @category Day Helpers\n * @summary Set the day of the year to the given date.\n *\n * @description\n * Set the day of the year to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} dayOfYear - the day of the year of the new date\n * @returns {Date} the new date with the day of the year set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set the 2nd day of the year to 2 July 2014:\n * var result = setDayOfYear(new Date(2014, 6, 2), 2)\n * //=> Thu Jan 02 2014 00:00:00\n */\n\nexport default function setDayOfYear(dirtyDate, dirtyDayOfYear) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var dayOfYear = toInteger(dirtyDayOfYear);\n date.setMonth(0);\n date.setDate(dayOfYear);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setHours\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} hours - the hours of the new date\n * @returns {Date} the new date with the hours set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * var result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\n\nexport default function setHours(dirtyDate, dirtyHours) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var hours = toInteger(dirtyHours);\n date.setHours(hours);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport addDays from \"../addDays/index.js\";\nimport getISODay from \"../getISODay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setISODay\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} day - the day of the ISO week of the new date\n * @returns {Date} the new date with the day of the ISO week set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * const result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\n\nexport default function setISODay(dirtyDate, dirtyDay) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var day = toInteger(dirtyDay);\n var currentDay = getISODay(date);\n var diff = day - currentDay;\n return addDays(date, diff);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport getISOWeek from \"../getISOWeek/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setISOWeek\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} isoWeek - the ISO week of the new date\n * @returns {Date} the new date with the ISO week set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * const result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\n\nexport default function setISOWeek(dirtyDate, dirtyISOWeek) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var isoWeek = toInteger(dirtyISOWeek);\n var diff = getISOWeek(date) - isoWeek;\n date.setDate(date.getDate() - diff * 7);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setMilliseconds\n * @category Millisecond Helpers\n * @summary Set the milliseconds to the given date.\n *\n * @description\n * Set the milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} milliseconds - the milliseconds of the new date\n * @returns {Date} the new date with the milliseconds set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 300 milliseconds to 1 September 2014 11:30:40.500:\n * const result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)\n * //=> Mon Sep 01 2014 11:30:40.300\n */\n\nexport default function setMilliseconds(dirtyDate, dirtyMilliseconds) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var milliseconds = toInteger(dirtyMilliseconds);\n date.setMilliseconds(milliseconds);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setMinutes\n * @category Minute Helpers\n * @summary Set the minutes to the given date.\n *\n * @description\n * Set the minutes to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} minutes - the minutes of the new date\n * @returns {Date} the new date with the minutes set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 45 minutes to 1 September 2014 11:30:40:\n * const result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:45:40\n */\n\nexport default function setMinutes(dirtyDate, dirtyMinutes) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var minutes = toInteger(dirtyMinutes);\n date.setMinutes(minutes);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport setMonth from \"../setMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setQuarter\n * @category Quarter Helpers\n * @summary Set the year quarter to the given date.\n *\n * @description\n * Set the year quarter to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} quarter - the quarter of the new date\n * @returns {Date} the new date with the quarter set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set the 2nd quarter to 2 July 2014:\n * const result = setQuarter(new Date(2014, 6, 2), 2)\n * //=> Wed Apr 02 2014 00:00:00\n */\n\nexport default function setQuarter(dirtyDate, dirtyQuarter) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var quarter = toInteger(dirtyQuarter);\n var oldQuarter = Math.floor(date.getMonth() / 3) + 1;\n var diff = quarter - oldQuarter;\n return setMonth(date, date.getMonth() + diff * 3);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setSeconds\n * @category Second Helpers\n * @summary Set the seconds to the given date.\n *\n * @description\n * Set the seconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} seconds - the seconds of the new date\n * @returns {Date} the new date with the seconds set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set 45 seconds to 1 September 2014 11:30:40:\n * const result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:30:45\n */\n\nexport default function setSeconds(dirtyDate, dirtySeconds) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var seconds = toInteger(dirtySeconds);\n date.setSeconds(seconds);\n return date;\n}","import getWeek from \"../getWeek/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name setWeek\n * @category Week Helpers\n * @summary Set the local week to the given date.\n *\n * @description\n * Set the local week to the given date, saving the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} week - the week of the new date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @returns {Date} the new date with the local week set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n *\n * @example\n * // Set the 1st week to 2 January 2005 with default options:\n * var result = setWeek(new Date(2005, 0, 2), 1)\n * //=> Sun Dec 26 2004 00:00:00\n *\n * @example\n * // Set the 1st week to 2 January 2005,\n * // if Monday is the first day of the week,\n * // and the first week of the year always contains 4 January:\n * var result = setWeek(new Date(2005, 0, 2), 1, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sun Jan 4 2004 00:00:00\n */\nexport default function setWeek(dirtyDate, dirtyWeek, options) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var week = toInteger(dirtyWeek);\n var diff = getWeek(date, options) - week;\n date.setDate(date.getDate() - diff * 7);\n return date;\n}","import differenceInCalendarDays from \"../differenceInCalendarDays/index.js\";\nimport startOfWeekYear from \"../startOfWeekYear/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n\n/**\n * @name setWeekYear\n * @category Week-Numbering Year Helpers\n * @summary Set the local week-numbering year to the given date.\n *\n * @description\n * Set the local week-numbering year to the given date,\n * saving the week number and the weekday number.\n * The exact calculation depends on the values of\n * `options.weekStartsOn` (which is the index of the first day of the week)\n * and `options.firstWeekContainsDate` (which is the day of January, which is always in\n * the first week of the week-numbering year)\n *\n * Week numbering: https://en.wikipedia.org/wiki/Week#Week_numbering\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} weekYear - the local week-numbering year of the new date\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year\n * @returns {Date} the new date with the local week-numbering year set\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n *\n * @example\n * // Set the local week-numbering year 2004 to 2 January 2010 with default options:\n * var result = setWeekYear(new Date(2010, 0, 2), 2004)\n * //=> Sat Jan 03 2004 00:00:00\n *\n * @example\n * // Set the local week-numbering year 2004 to 2 January 2010,\n * // if Monday is the first day of week\n * // and 4 January is always in the first week of the year:\n * var result = setWeekYear(new Date(2010, 0, 2), 2004, {\n * weekStartsOn: 1,\n * firstWeekContainsDate: 4\n * })\n * //=> Sat Jan 01 2005 00:00:00\n */\nexport default function setWeekYear(dirtyDate, dirtyWeekYear) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n requiredArgs(2, arguments);\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var date = toDate(dirtyDate);\n var weekYear = toInteger(dirtyWeekYear);\n var diff = differenceInCalendarDays(date, startOfWeekYear(date, options));\n var firstWeek = new Date(0);\n firstWeek.setFullYear(weekYear, 0, firstWeekContainsDate);\n firstWeek.setHours(0, 0, 0, 0);\n date = startOfWeekYear(firstWeek, options);\n date.setDate(date.getDate() + diff);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name setYear\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} year - the year of the new date\n * @returns {Date} the new date with the year set\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * const result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\n\nexport default function setYear(dirtyDate, dirtyYear) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var year = toInteger(dirtyYear); // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\n\n if (isNaN(date.getTime())) {\n return new Date(NaN);\n }\n\n date.setFullYear(year);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfDecade\n * @category Decade Helpers\n * @summary Return the start of a decade for the given date.\n *\n * @description\n * Return the start of a decade for the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a decade\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a decade for 21 October 2015 00:00:00:\n * const result = startOfDecade(new Date(2015, 9, 21, 00, 00, 00))\n * //=> Jan 01 2010 00:00:00\n */\n\nexport default function startOfDecade(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var decade = Math.floor(year / 10) * 10;\n date.setFullYear(decade, 0, 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import startOfDay from \"../startOfDay/index.js\";\n/**\n * @name startOfToday\n * @category Day Helpers\n * @summary Return the start of today.\n * @pure false\n *\n * @description\n * Return the start of today.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `Date.now()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the start of today\n *\n * @example\n * // If today is 6 October 2014:\n * var result = startOfToday()\n * //=> Mon Oct 6 2014 00:00:00\n */\n\nexport default function startOfToday() {\n return startOfDay(Date.now());\n}","/**\n * @name startOfTomorrow\n * @category Day Helpers\n * @summary Return the start of tomorrow.\n * @pure false\n *\n * @description\n * Return the start of tomorrow.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `new Date()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the start of tomorrow\n *\n * @example\n * // If today is 6 October 2014:\n * const result = startOfTomorrow()\n * //=> Tue Oct 7 2014 00:00:00\n */\nexport default function startOfTomorrow() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth();\n var day = now.getDate();\n var date = new Date(0);\n date.setFullYear(year, month, day + 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","/**\n * @name startOfYesterday\n * @category Day Helpers\n * @summary Return the start of yesterday.\n * @pure false\n *\n * @description\n * Return the start of yesterday.\n *\n * > ⚠️ Please note that this function is not present in the FP submodule as\n * > it uses `new Date()` internally hence impure and can't be safely curried.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @returns {Date} the start of yesterday\n *\n * @example\n * // If today is 6 October 2014:\n * const result = startOfYesterday()\n * //=> Sun Oct 5 2014 00:00:00\n */\nexport default function startOfYesterday() {\n var now = new Date();\n var year = now.getFullYear();\n var month = now.getMonth();\n var day = now.getDate();\n var date = new Date(0);\n date.setFullYear(year, month, day - 1);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import addBusinessDays from \"../addBusinessDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name subBusinessDays\n * @category Day Helpers\n * @summary Substract the specified number of business days (mon - fri) to the given date.\n *\n * @description\n * Substract the specified number of business days (mon - fri) to the given date, ignoring weekends.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of business days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the business days subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Substract 10 business days from 1 September 2014:\n * const result = subBusinessDays(new Date(2014, 8, 1), 10)\n * //=> Mon Aug 18 2014 00:00:00 (skipped weekend days)\n */\n\nexport default function subBusinessDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addBusinessDays(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMinutes from \"../addMinutes/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMinutes\n * @category Minute Helpers\n * @summary Subtract the specified number of minutes from the given date.\n *\n * @description\n * Subtract the specified number of minutes from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the minutes subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\n * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 11:30:00\n */\n\nexport default function subMinutes(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMinutes(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addQuarters from \"../addQuarters/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subQuarters\n * @category Quarter Helpers\n * @summary Subtract the specified number of year quarters from the given date.\n *\n * @description\n * Subtract the specified number of year quarters from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of quarters to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the quarters subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 3 quarters from 1 September 2014:\n * const result = subQuarters(new Date(2014, 8, 1), 3)\n * //=> Sun Dec 01 2013 00:00:00\n */\n\nexport default function subQuarters(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addQuarters(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addSeconds from \"../addSeconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subSeconds\n * @category Second Helpers\n * @summary Subtract the specified number of seconds from the given date.\n *\n * @description\n * Subtract the specified number of seconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the seconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 30 seconds from 10 July 2014 12:45:00:\n * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:44:30\n */\n\nexport default function subSeconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addSeconds(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addWeeks from \"../addWeeks/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subWeeks\n * @category Week Helpers\n * @summary Subtract the specified number of weeks from the given date.\n *\n * @description\n * Subtract the specified number of weeks from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of weeks to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the weeks subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 4 weeks from 1 September 2014:\n * const result = subWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Aug 04 2014 00:00:00\n */\n\nexport default function subWeeks(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addWeeks(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addYears from \"../addYears/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subYears\n * @category Year Helpers\n * @summary Subtract the specified number of years from the given date.\n *\n * @description\n * Subtract the specified number of years from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the years subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 5 years from 1 September 2014:\n * const result = subYears(new Date(2014, 8, 1), 5)\n * //=> Tue Sep 01 2009 00:00:00\n */\n\nexport default function subYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addYears(dirtyDate, -amount);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { daysInWeek } from \"../constants/index.js\";\n/**\n * @name weeksToDays\n * @category Conversion Helpers\n * @summary Convert weeks to days.\n *\n * @description\n * Convert a number of weeks to a full number of days.\n *\n * @param {number} weeks - number of weeks to be converted\n *\n * @returns {number} the number of weeks converted in days\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 2 weeks into days\n * const result = weeksToDays(2)\n * //=> 14\n */\n\nexport default function weeksToDays(weeks) {\n requiredArgs(1, arguments);\n return Math.floor(weeks * daysInWeek);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { monthsInYear } from \"../constants/index.js\";\n/**\n * @name yearsToMonths\n * @category Conversion Helpers\n * @summary Convert years to months.\n *\n * @description\n * Convert a number of years to a full number of months.\n *\n * @param {number} years - number of years to be converted\n *\n * @returns {number} the number of years converted in months\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 2 years into months\n * const result = yearsToMonths(2)\n * //=> 24\n */\n\nexport default function yearsToMonths(years) {\n requiredArgs(1, arguments);\n return Math.floor(years * monthsInYear);\n}","import requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { quartersInYear } from \"../constants/index.js\";\n/**\n * @name yearsToQuarters\n * @category Conversion Helpers\n * @summary Convert years to quarters.\n *\n * @description\n * Convert a number of years to a full number of quarters.\n *\n * @param {number} years - number of years to be converted\n *\n * @returns {number} the number of years converted in quarters\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Convert 2 years to quarters\n * const result = yearsToQuarters(2)\n * //=> 8\n */\n\nexport default function yearsToQuarters(years) {\n requiredArgs(1, arguments);\n return Math.floor(years * quartersInYear);\n}","'use strict';\n\nconst fetch = require('node-fetch');\n\nconst MAX_PAGE_SIZE = 1000; // The Graph max page size\n\n/**\n * Page results from The Graph protocol\n *\n * @param {string} api - The API address\n * @param {Object} query - The Query object\n * @param {string} query.entity - The entity name\n * @param {Object} query.selection - The selection mapping object for GraphQL filters and sorts\n * @param {Object} query.properties - The list of fields to include in the output\n * @param {number} timeout - Number of ms timeout for any single graph paging result (default: 10seconds)\n * @param {number} max - Maximum number of results to return (default: Infinity)\n */\nconst pageResults = ({ api, query: { entity, selection = {}, properties = [] }, timeout = 10e3, max = Infinity }) => {\n\tmax = Number(max);\n\tconst pageSize = MAX_PAGE_SIZE;\n\n\t// Note: this approach will call each page in linear order, ensuring it stops as soon as all results\n\t// are fetched. This could be sped up with a number of requests done in parallel, stopping as soon as any return\n\t// empty. - JJM\n\tconst runner = ({ lastId }) => {\n\t\tconst propToString = obj =>\n\t\t\tObject.entries(obj)\n\t\t\t\t.filter(([, value]) => typeof value !== 'undefined')\n\t\t\t\t.map(([key, value]) => `${key}:${typeof value === 'object' ? '{' + propToString(value) + '}' : value}`)\n\t\t\t\t.join(',');\n\n\t\tconst first = MAX_PAGE_SIZE;\n\n\t\tif(!properties.includes('id')) {\n\t\t\tproperties.push('id');\n\t\t};\n\n\t\t// mix the page size and skip fields into the selection object\n\t\tconst selectionObj = Object.assign({}, selection, {\n\t\t\tfirst,\n\t\t\torderBy: 'id',\n\t\t\twhere: { \n\t\t\t\t...selection.where, \n\t\t\t\t...lastId ? {id_gt: `\\\\\"${lastId}\\\\\"`} : {} \n\t\t\t},\n\t\t});\n\n\t\tconst body = `{\"query\":\"{${entity}(${propToString(selectionObj)}){${properties.join(',')}}}\", \"variables\": null}`;\n\n\t\t// support query logging in nodejs\n\t\tif (typeof process === 'object' && process.env.DEBUG === 'true') {\n\t\t\tconsole.log(body);\n\t\t};\n\n\t\treturn fetch(api, {\n\t\t\tmethod: 'POST',\n\t\t\tbody,\n\t\t\ttimeout,\n\t\t})\n\t\t\t.then(response => response.json())\n\t\t\t.then(json => {\n\t\t\t\tif (json.errors) {\n\t\t\t\t\tthrow Error(JSON.stringify(json.errors));\n\t\t\t\t}\n\t\t\t\tconst {\n\t\t\t\t\tdata: { [entity]: results },\n\t\t\t\t} = json;\n\n\t\t\t\t// stop if we are on the last page\n\t\t\t\tif (results.length < pageSize || results.length >= max) {\n\t\t\t\t\tif(results.length >= max) {\n\t\t\t\t\t\treturn results.slice(0, max);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\n\t\t\t\treturn runner({ lastId: results[results.length-1].id }).then(newResults => results.concat(newResults));\n\t\t\t});\n\t};\n\n\treturn runner({ lastId: undefined });\n};\n\nmodule.exports = pageResults;\n","\"use strict\";\n\n// ref: https://github.com/tc39/proposal-global\nvar getGlobal = function () {\n\t// the only reliable means to get the global object is\n\t// `Function('return this')()`\n\t// However, this causes CSP violations in Chrome apps.\n\tif (typeof self !== 'undefined') { return self; }\n\tif (typeof window !== 'undefined') { return window; }\n\tif (typeof global !== 'undefined') { return global; }\n\tthrow new Error('unable to locate global object');\n}\n\nvar global = getGlobal();\n\nmodule.exports = exports = global.fetch;\n\n// Needed for TypeScript and Webpack.\nif (global.fetch) {\n\texports.default = global.fetch.bind(global);\n}\n\nexports.Headers = global.Headers;\nexports.Request = global.Request;\nexports.Response = global.Response;","\"use strict\";\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar _global = typeof global !== 'undefined' ? global : (typeof window !== 'undefined' ? window : {});\nvar NativeWebSocket = _global.WebSocket || _global.MozWebSocket;\nvar Backoff = require(\"backo2\");\nvar eventemitter3_1 = require(\"eventemitter3\");\nvar is_string_1 = require(\"./utils/is-string\");\nvar is_object_1 = require(\"./utils/is-object\");\nvar printer_1 = require(\"graphql/language/printer\");\nvar getOperationAST_1 = require(\"graphql/utilities/getOperationAST\");\nvar symbol_observable_1 = require(\"symbol-observable\");\nvar protocol_1 = require(\"./protocol\");\nvar defaults_1 = require(\"./defaults\");\nvar message_types_1 = require(\"./message-types\");\nvar SubscriptionClient = (function () {\n function SubscriptionClient(url, options, webSocketImpl, webSocketProtocols) {\n var _a = (options || {}), _b = _a.connectionCallback, connectionCallback = _b === void 0 ? undefined : _b, _c = _a.connectionParams, connectionParams = _c === void 0 ? {} : _c, _d = _a.timeout, timeout = _d === void 0 ? defaults_1.WS_TIMEOUT : _d, _e = _a.reconnect, reconnect = _e === void 0 ? false : _e, _f = _a.reconnectionAttempts, reconnectionAttempts = _f === void 0 ? Infinity : _f, _g = _a.lazy, lazy = _g === void 0 ? false : _g, _h = _a.inactivityTimeout, inactivityTimeout = _h === void 0 ? 0 : _h;\n this.wsImpl = webSocketImpl || NativeWebSocket;\n if (!this.wsImpl) {\n throw new Error('Unable to find native implementation, or alternative implementation for WebSocket!');\n }\n this.wsProtocols = webSocketProtocols || protocol_1.GRAPHQL_WS;\n this.connectionCallback = connectionCallback;\n this.url = url;\n this.operations = {};\n this.nextOperationId = 0;\n this.wsTimeout = timeout;\n this.unsentMessagesQueue = [];\n this.reconnect = reconnect;\n this.reconnecting = false;\n this.reconnectionAttempts = reconnectionAttempts;\n this.lazy = !!lazy;\n this.inactivityTimeout = inactivityTimeout;\n this.closedByUser = false;\n this.backoff = new Backoff({ jitter: 0.5 });\n this.eventEmitter = new eventemitter3_1.EventEmitter();\n this.middlewares = [];\n this.client = null;\n this.maxConnectTimeGenerator = this.createMaxConnectTimeGenerator();\n this.connectionParams = this.getConnectionParams(connectionParams);\n if (!this.lazy) {\n this.connect();\n }\n }\n Object.defineProperty(SubscriptionClient.prototype, \"status\", {\n get: function () {\n if (this.client === null) {\n return this.wsImpl.CLOSED;\n }\n return this.client.readyState;\n },\n enumerable: true,\n configurable: true\n });\n SubscriptionClient.prototype.close = function (isForced, closedByUser) {\n if (isForced === void 0) { isForced = true; }\n if (closedByUser === void 0) { closedByUser = true; }\n this.clearInactivityTimeout();\n if (this.client !== null) {\n this.closedByUser = closedByUser;\n if (isForced) {\n this.clearCheckConnectionInterval();\n this.clearMaxConnectTimeout();\n this.clearTryReconnectTimeout();\n this.unsubscribeAll();\n this.sendMessage(undefined, message_types_1.default.GQL_CONNECTION_TERMINATE, null);\n }\n this.client.close();\n this.client = null;\n this.eventEmitter.emit('disconnected');\n if (!isForced) {\n this.tryReconnect();\n }\n }\n };\n SubscriptionClient.prototype.request = function (request) {\n var _a;\n var getObserver = this.getObserver.bind(this);\n var executeOperation = this.executeOperation.bind(this);\n var unsubscribe = this.unsubscribe.bind(this);\n var opId;\n this.clearInactivityTimeout();\n return _a = {},\n _a[symbol_observable_1.default] = function () {\n return this;\n },\n _a.subscribe = function (observerOrNext, onError, onComplete) {\n var observer = getObserver(observerOrNext, onError, onComplete);\n opId = executeOperation(request, function (error, result) {\n if (error === null && result === null) {\n if (observer.complete) {\n observer.complete();\n }\n }\n else if (error) {\n if (observer.error) {\n observer.error(error[0]);\n }\n }\n else {\n if (observer.next) {\n observer.next(result);\n }\n }\n });\n return {\n unsubscribe: function () {\n if (opId) {\n unsubscribe(opId);\n opId = null;\n }\n },\n };\n },\n _a;\n };\n SubscriptionClient.prototype.on = function (eventName, callback, context) {\n var handler = this.eventEmitter.on(eventName, callback, context);\n return function () {\n handler.off(eventName, callback, context);\n };\n };\n SubscriptionClient.prototype.onConnected = function (callback, context) {\n return this.on('connected', callback, context);\n };\n SubscriptionClient.prototype.onConnecting = function (callback, context) {\n return this.on('connecting', callback, context);\n };\n SubscriptionClient.prototype.onDisconnected = function (callback, context) {\n return this.on('disconnected', callback, context);\n };\n SubscriptionClient.prototype.onReconnected = function (callback, context) {\n return this.on('reconnected', callback, context);\n };\n SubscriptionClient.prototype.onReconnecting = function (callback, context) {\n return this.on('reconnecting', callback, context);\n };\n SubscriptionClient.prototype.onError = function (callback, context) {\n return this.on('error', callback, context);\n };\n SubscriptionClient.prototype.unsubscribeAll = function () {\n var _this = this;\n Object.keys(this.operations).forEach(function (subId) {\n _this.unsubscribe(subId);\n });\n };\n SubscriptionClient.prototype.applyMiddlewares = function (options) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var queue = function (funcs, scope) {\n var next = function (error) {\n if (error) {\n reject(error);\n }\n else {\n if (funcs.length > 0) {\n var f = funcs.shift();\n if (f) {\n f.applyMiddleware.apply(scope, [options, next]);\n }\n }\n else {\n resolve(options);\n }\n }\n };\n next();\n };\n queue(_this.middlewares.slice(), _this);\n });\n };\n SubscriptionClient.prototype.use = function (middlewares) {\n var _this = this;\n middlewares.map(function (middleware) {\n if (typeof middleware.applyMiddleware === 'function') {\n _this.middlewares.push(middleware);\n }\n else {\n throw new Error('Middleware must implement the applyMiddleware function.');\n }\n });\n return this;\n };\n SubscriptionClient.prototype.getConnectionParams = function (connectionParams) {\n return function () { return new Promise(function (resolve, reject) {\n if (typeof connectionParams === 'function') {\n try {\n return resolve(connectionParams.call(null));\n }\n catch (error) {\n return reject(error);\n }\n }\n resolve(connectionParams);\n }); };\n };\n SubscriptionClient.prototype.executeOperation = function (options, handler) {\n var _this = this;\n if (this.client === null) {\n this.connect();\n }\n var opId = this.generateOperationId();\n this.operations[opId] = { options: options, handler: handler };\n this.applyMiddlewares(options)\n .then(function (processedOptions) {\n _this.checkOperationOptions(processedOptions, handler);\n if (_this.operations[opId]) {\n _this.operations[opId] = { options: processedOptions, handler: handler };\n _this.sendMessage(opId, message_types_1.default.GQL_START, processedOptions);\n }\n })\n .catch(function (error) {\n _this.unsubscribe(opId);\n handler(_this.formatErrors(error));\n });\n return opId;\n };\n SubscriptionClient.prototype.getObserver = function (observerOrNext, error, complete) {\n if (typeof observerOrNext === 'function') {\n return {\n next: function (v) { return observerOrNext(v); },\n error: function (e) { return error && error(e); },\n complete: function () { return complete && complete(); },\n };\n }\n return observerOrNext;\n };\n SubscriptionClient.prototype.createMaxConnectTimeGenerator = function () {\n var minValue = 1000;\n var maxValue = this.wsTimeout;\n return new Backoff({\n min: minValue,\n max: maxValue,\n factor: 1.2,\n });\n };\n SubscriptionClient.prototype.clearCheckConnectionInterval = function () {\n if (this.checkConnectionIntervalId) {\n clearInterval(this.checkConnectionIntervalId);\n this.checkConnectionIntervalId = null;\n }\n };\n SubscriptionClient.prototype.clearMaxConnectTimeout = function () {\n if (this.maxConnectTimeoutId) {\n clearTimeout(this.maxConnectTimeoutId);\n this.maxConnectTimeoutId = null;\n }\n };\n SubscriptionClient.prototype.clearTryReconnectTimeout = function () {\n if (this.tryReconnectTimeoutId) {\n clearTimeout(this.tryReconnectTimeoutId);\n this.tryReconnectTimeoutId = null;\n }\n };\n SubscriptionClient.prototype.clearInactivityTimeout = function () {\n if (this.inactivityTimeoutId) {\n clearTimeout(this.inactivityTimeoutId);\n this.inactivityTimeoutId = null;\n }\n };\n SubscriptionClient.prototype.setInactivityTimeout = function () {\n var _this = this;\n if (this.inactivityTimeout > 0 && Object.keys(this.operations).length === 0) {\n this.inactivityTimeoutId = setTimeout(function () {\n if (Object.keys(_this.operations).length === 0) {\n _this.close();\n }\n }, this.inactivityTimeout);\n }\n };\n SubscriptionClient.prototype.checkOperationOptions = function (options, handler) {\n var query = options.query, variables = options.variables, operationName = options.operationName;\n if (!query) {\n throw new Error('Must provide a query.');\n }\n if (!handler) {\n throw new Error('Must provide an handler.');\n }\n if ((!is_string_1.default(query) && !getOperationAST_1.getOperationAST(query, operationName)) ||\n (operationName && !is_string_1.default(operationName)) ||\n (variables && !is_object_1.default(variables))) {\n throw new Error('Incorrect option types. query must be a string or a document,' +\n '`operationName` must be a string, and `variables` must be an object.');\n }\n };\n SubscriptionClient.prototype.buildMessage = function (id, type, payload) {\n var payloadToReturn = payload && payload.query ? __assign({}, payload, { query: typeof payload.query === 'string' ? payload.query : printer_1.print(payload.query) }) :\n payload;\n return {\n id: id,\n type: type,\n payload: payloadToReturn,\n };\n };\n SubscriptionClient.prototype.formatErrors = function (errors) {\n if (Array.isArray(errors)) {\n return errors;\n }\n if (errors && errors.errors) {\n return this.formatErrors(errors.errors);\n }\n if (errors && errors.message) {\n return [errors];\n }\n return [{\n name: 'FormatedError',\n message: 'Unknown error',\n originalError: errors,\n }];\n };\n SubscriptionClient.prototype.sendMessage = function (id, type, payload) {\n this.sendMessageRaw(this.buildMessage(id, type, payload));\n };\n SubscriptionClient.prototype.sendMessageRaw = function (message) {\n switch (this.status) {\n case this.wsImpl.OPEN:\n var serializedMessage = JSON.stringify(message);\n try {\n JSON.parse(serializedMessage);\n }\n catch (e) {\n this.eventEmitter.emit('error', new Error(\"Message must be JSON-serializable. Got: \" + message));\n }\n this.client.send(serializedMessage);\n break;\n case this.wsImpl.CONNECTING:\n this.unsentMessagesQueue.push(message);\n break;\n default:\n if (!this.reconnecting) {\n this.eventEmitter.emit('error', new Error('A message was not sent because socket is not connected, is closing or ' +\n 'is already closed. Message was: ' + JSON.stringify(message)));\n }\n }\n };\n SubscriptionClient.prototype.generateOperationId = function () {\n return String(++this.nextOperationId);\n };\n SubscriptionClient.prototype.tryReconnect = function () {\n var _this = this;\n if (!this.reconnect || this.backoff.attempts >= this.reconnectionAttempts) {\n return;\n }\n if (!this.reconnecting) {\n Object.keys(this.operations).forEach(function (key) {\n _this.unsentMessagesQueue.push(_this.buildMessage(key, message_types_1.default.GQL_START, _this.operations[key].options));\n });\n this.reconnecting = true;\n }\n this.clearTryReconnectTimeout();\n var delay = this.backoff.duration();\n this.tryReconnectTimeoutId = setTimeout(function () {\n _this.connect();\n }, delay);\n };\n SubscriptionClient.prototype.flushUnsentMessagesQueue = function () {\n var _this = this;\n this.unsentMessagesQueue.forEach(function (message) {\n _this.sendMessageRaw(message);\n });\n this.unsentMessagesQueue = [];\n };\n SubscriptionClient.prototype.checkConnection = function () {\n if (this.wasKeepAliveReceived) {\n this.wasKeepAliveReceived = false;\n return;\n }\n if (!this.reconnecting) {\n this.close(false, true);\n }\n };\n SubscriptionClient.prototype.checkMaxConnectTimeout = function () {\n var _this = this;\n this.clearMaxConnectTimeout();\n this.maxConnectTimeoutId = setTimeout(function () {\n if (_this.status !== _this.wsImpl.OPEN) {\n _this.reconnecting = true;\n _this.close(false, true);\n }\n }, this.maxConnectTimeGenerator.duration());\n };\n SubscriptionClient.prototype.connect = function () {\n var _this = this;\n this.client = new this.wsImpl(this.url, this.wsProtocols);\n this.checkMaxConnectTimeout();\n this.client.onopen = function () { return __awaiter(_this, void 0, void 0, function () {\n var connectionParams, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(this.status === this.wsImpl.OPEN)) return [3, 4];\n this.clearMaxConnectTimeout();\n this.closedByUser = false;\n this.eventEmitter.emit(this.reconnecting ? 'reconnecting' : 'connecting');\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4, this.connectionParams()];\n case 2:\n connectionParams = _a.sent();\n this.sendMessage(undefined, message_types_1.default.GQL_CONNECTION_INIT, connectionParams);\n this.flushUnsentMessagesQueue();\n return [3, 4];\n case 3:\n error_1 = _a.sent();\n this.sendMessage(undefined, message_types_1.default.GQL_CONNECTION_ERROR, error_1);\n this.flushUnsentMessagesQueue();\n return [3, 4];\n case 4: return [2];\n }\n });\n }); };\n this.client.onclose = function () {\n if (!_this.closedByUser) {\n _this.close(false, false);\n }\n };\n this.client.onerror = function (err) {\n _this.eventEmitter.emit('error', err);\n };\n this.client.onmessage = function (_a) {\n var data = _a.data;\n _this.processReceivedData(data);\n };\n };\n SubscriptionClient.prototype.processReceivedData = function (receivedData) {\n var parsedMessage;\n var opId;\n try {\n parsedMessage = JSON.parse(receivedData);\n opId = parsedMessage.id;\n }\n catch (e) {\n throw new Error(\"Message must be JSON-parseable. Got: \" + receivedData);\n }\n if ([message_types_1.default.GQL_DATA,\n message_types_1.default.GQL_COMPLETE,\n message_types_1.default.GQL_ERROR,\n ].indexOf(parsedMessage.type) !== -1 && !this.operations[opId]) {\n this.unsubscribe(opId);\n return;\n }\n switch (parsedMessage.type) {\n case message_types_1.default.GQL_CONNECTION_ERROR:\n if (this.connectionCallback) {\n this.connectionCallback(parsedMessage.payload);\n }\n break;\n case message_types_1.default.GQL_CONNECTION_ACK:\n this.eventEmitter.emit(this.reconnecting ? 'reconnected' : 'connected');\n this.reconnecting = false;\n this.backoff.reset();\n this.maxConnectTimeGenerator.reset();\n if (this.connectionCallback) {\n this.connectionCallback();\n }\n break;\n case message_types_1.default.GQL_COMPLETE:\n this.operations[opId].handler(null, null);\n delete this.operations[opId];\n break;\n case message_types_1.default.GQL_ERROR:\n this.operations[opId].handler(this.formatErrors(parsedMessage.payload), null);\n delete this.operations[opId];\n break;\n case message_types_1.default.GQL_DATA:\n var parsedPayload = !parsedMessage.payload.errors ?\n parsedMessage.payload : __assign({}, parsedMessage.payload, { errors: this.formatErrors(parsedMessage.payload.errors) });\n this.operations[opId].handler(null, parsedPayload);\n break;\n case message_types_1.default.GQL_CONNECTION_KEEP_ALIVE:\n var firstKA = typeof this.wasKeepAliveReceived === 'undefined';\n this.wasKeepAliveReceived = true;\n if (firstKA) {\n this.checkConnection();\n }\n if (this.checkConnectionIntervalId) {\n clearInterval(this.checkConnectionIntervalId);\n this.checkConnection();\n }\n this.checkConnectionIntervalId = setInterval(this.checkConnection.bind(this), this.wsTimeout);\n break;\n default:\n throw new Error('Invalid message type!');\n }\n };\n SubscriptionClient.prototype.unsubscribe = function (opId) {\n if (this.operations[opId]) {\n delete this.operations[opId];\n this.setInactivityTimeout();\n this.sendMessage(opId, message_types_1.default.GQL_STOP, undefined);\n }\n };\n return SubscriptionClient;\n}());\nexports.SubscriptionClient = SubscriptionClient;\n//# sourceMappingURL=client.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar WS_TIMEOUT = 30000;\nexports.WS_TIMEOUT = WS_TIMEOUT;\n//# sourceMappingURL=defaults.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar MessageTypes = (function () {\n function MessageTypes() {\n throw new Error('Static Class');\n }\n MessageTypes.GQL_CONNECTION_INIT = 'connection_init';\n MessageTypes.GQL_CONNECTION_ACK = 'connection_ack';\n MessageTypes.GQL_CONNECTION_ERROR = 'connection_error';\n MessageTypes.GQL_CONNECTION_KEEP_ALIVE = 'ka';\n MessageTypes.GQL_CONNECTION_TERMINATE = 'connection_terminate';\n MessageTypes.GQL_START = 'start';\n MessageTypes.GQL_DATA = 'data';\n MessageTypes.GQL_ERROR = 'error';\n MessageTypes.GQL_COMPLETE = 'complete';\n MessageTypes.GQL_STOP = 'stop';\n MessageTypes.SUBSCRIPTION_START = 'subscription_start';\n MessageTypes.SUBSCRIPTION_DATA = 'subscription_data';\n MessageTypes.SUBSCRIPTION_SUCCESS = 'subscription_success';\n MessageTypes.SUBSCRIPTION_FAIL = 'subscription_fail';\n MessageTypes.SUBSCRIPTION_END = 'subscription_end';\n MessageTypes.INIT = 'init';\n MessageTypes.INIT_SUCCESS = 'init_success';\n MessageTypes.INIT_FAIL = 'init_fail';\n MessageTypes.KEEP_ALIVE = 'keepalive';\n return MessageTypes;\n}());\nexports.default = MessageTypes;\n//# sourceMappingURL=message-types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar GRAPHQL_WS = 'graphql-ws';\nexports.GRAPHQL_WS = GRAPHQL_WS;\nvar GRAPHQL_SUBSCRIPTIONS = 'graphql-subscriptions';\nexports.GRAPHQL_SUBSCRIPTIONS = GRAPHQL_SUBSCRIPTIONS;\n//# sourceMappingURL=protocol.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isObject(value) {\n return ((value !== null) && (typeof value === 'object'));\n}\nexports.default = isObject;\n//# sourceMappingURL=is-object.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isString(value) {\n return typeof value === 'string';\n}\nexports.default = isString;\n//# sourceMappingURL=is-string.js.map","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Add a listener for a given event.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} context The context to invoke the listener with.\n * @param {Boolean} once Specify if the listener is a one-time listener.\n * @returns {EventEmitter}\n * @private\n */\nfunction addListener(emitter, event, fn, context, once) {\n if (typeof fn !== 'function') {\n throw new TypeError('The listener must be a function');\n }\n\n var listener = new EE(fn, context || emitter, once)\n , evt = prefix ? prefix + event : event;\n\n if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;\n else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);\n else emitter._events[evt] = [emitter._events[evt], listener];\n\n return emitter;\n}\n\n/**\n * Clear event by name.\n *\n * @param {EventEmitter} emitter Reference to the `EventEmitter` instance.\n * @param {(String|Symbol)} evt The Event name.\n * @private\n */\nfunction clearEvent(emitter, evt) {\n if (--emitter._eventsCount === 0) emitter._events = new Events();\n else delete emitter._events[evt];\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Array} The registered listeners.\n * @public\n */\nEventEmitter.prototype.listeners = function listeners(event) {\n var evt = prefix ? prefix + event : event\n , handlers = this._events[evt];\n\n if (!handlers) return [];\n if (handlers.fn) return [handlers.fn];\n\n for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {\n ee[i] = handlers[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Return the number of listeners listening to a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Number} The number of listeners.\n * @public\n */\nEventEmitter.prototype.listenerCount = function listenerCount(event) {\n var evt = prefix ? prefix + event : event\n , listeners = this._events[evt];\n\n if (!listeners) return 0;\n if (listeners.fn) return 1;\n return listeners.length;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n return addListener(this, event, fn, context, false);\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn The listener function.\n * @param {*} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n return addListener(this, event, fn, context, true);\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {(String|Symbol)} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {*} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n clearEvent(this, evt);\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn &&\n (!once || listeners.once) &&\n (!context || listeners.context === context)\n ) {\n clearEvent(this, evt);\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn ||\n (once && !listeners[i].once) ||\n (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else clearEvent(this, evt);\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {(String|Symbol)} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) clearEvent(this, evt);\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n","/* global window */\nimport ponyfill from './ponyfill.js';\n\nvar root;\n\nif (typeof self !== 'undefined') {\n root = self;\n} else if (typeof window !== 'undefined') {\n root = window;\n} else if (typeof global !== 'undefined') {\n root = global;\n} else if (typeof module !== 'undefined') {\n root = module;\n} else {\n root = Function('return this')();\n}\n\nvar result = ponyfill(root);\nexport default result;\n","export default function symbolObservablePonyfill(root) {\n\tvar result;\n\tvar Symbol = root.Symbol;\n\n\tif (typeof Symbol === 'function') {\n\t\tif (Symbol.observable) {\n\t\t\tresult = Symbol.observable;\n\t\t} else {\n\t\t\tresult = Symbol('observable');\n\t\t\tSymbol.observable = result;\n\t\t}\n\t} else {\n\t\tresult = '@@observable';\n\t}\n\n\treturn result;\n};\n","import { Kind } from '../language/kinds';\n\n/**\n * Returns an operation AST given a document AST and optionally an operation\n * name. If a name is not provided, an operation is only returned if only one is\n * provided in the document.\n */\nexport function getOperationAST(documentAST, operationName) {\n var operation = null;\n\n for (var _i2 = 0, _documentAST$definiti2 = documentAST.definitions; _i2 < _documentAST$definiti2.length; _i2++) {\n var definition = _documentAST$definiti2[_i2];\n\n if (definition.kind === Kind.OPERATION_DEFINITION) {\n if (!operationName) {\n // If no operation name was provided, only return an Operation if there\n // is one defined in the document. Upon encountering the second, return\n // null.\n if (operation) {\n return null;\n }\n\n operation = definition;\n } else if (definition.name && definition.name.value === operationName) {\n return definition;\n }\n }\n }\n\n return operation;\n}\n"],"names":["module","exports","graphAPIEndpoints","masterchef","bar","timelock","maker","exchange","exchange_v1","blocklytics","lockup","graphWSEndpoints","barAddress","makerAddress","chefAddress","sushiAddress","factoryAddress","TWENTY_FOUR_HOURS","pageResults","Promise","sushi","blocks","charts","bentobox","utils","timestamps","target","targetArguments","Error","map","async","block","data","timestamp","ws","WebSocket","MozWebSocket","g","window","self","SubscriptionClient","request","gql","timestampToBlock","undefined","result","info","properties","toString","callback","observeInfo","query","observable","reconnect","subscribe","next","error","complete","results","user_address","toLowerCase","user","decimals","Number","name","symbol","totalSupply","ratio","xSushiMinted","xSushiBurned","sushiStaked","sushiStakedUSD","sushiHarvested","sushiHarvestedUSD","xSushiAge","xSushiAgeDestroyed","updatedAt","xSushi","xSushiIn","xSushiOut","xSushiOffset","sushiIn","sushiOut","usdOut","usdIn","sushiOffset","usdOffset","priceUSD","sushiPriceUSD","token","tokenInfo","ethPrice","ethPriceUSD","masterChefInfo","pool","chefPool","pools","chefPools","ENDPOINTS","masterAddress","chainId","api","entity","selection","where","masterContract","clones","then","catch","err","console","log","kashiStakedInfo","sushiUSD","ethUSD","masterChef","totalAP","totalAllocPoint","sushiPerBlock","onsen_pools","pair","filtered_results","filter","includes","id","kashiPairs","address","all","asset","token_address","assetPool","pool_address","stakedAmt","slpBalance","balanceUSD","derivedETH","rewardPerBlock","roiPerBlock","roiPerYear","assetSymbol","assetDecimals","collateral","collateralSymbol","collateralDecimals","totalAssetBase","totalAssetElastic","totalAssetStaked","latestBlock","observeLatestBlock","getBlock","number","date","Date","author","difficulty","gasUsed","gasLimit","getWeek","subWeeks","subYears","startOfMinute","getUnixTime","dayData","tokenHourData","tokenDayData","pairHourData","pairDayData","ethPriceHourly","weeklyData","startIndexWeekly","currentWeek","forEach","entry","i","week","weeklyVolumeUSD","volumeUSD","startTime","tokenData","ethPrices","minTimestamp","tokenEntry","find","ethEntry","volume","untrackedVolumeUSD","txCount","open","close","endTime","dayIndexSet","Set","dayIndexArray","add","toFixed","push","latestLiquidity","liquidity","latestLiquidityUSD","liquidityUSD","latestLiquidityETH","liquidityETH","latestPriceUSD","index","nextDay","currentDayIndex","has","split","volumeETH","sort","a","b","parseInt","pair_address","pairData","pairEntry","volumeToken0","volumeToken1","rate0","token0Price","rate1","token1Price","factory","eth","fromUnixTime","timestampsToBlocks","bundle","maxTimestamp","minBlock","maxBlock","blockToTimestamp","time","Object","keys","key","callbackHourly","observeEthPrice","observeFactory","orderDirection","date_gte","date_lte","now","timestamp24ago","block24ago","twentyFourHourData","result24ago","pairCount","tokenCount","userCount","results24ago","pairs","timestampNow","Math","floor","timestamp48ago","block48ago","result48ago","ethPriceUSD24ago","callback24h","callbackHourData","propertiesDayData","callbackDayData","observePair","max","pair_addresses","values","results48ago","observePairs","token0","token1","reserve0","reserve1","reserveETH","reserveUSD","trackedReserveETH","results24h","results48h","result24h","e","result48h","trackedReserveUSD","trackedReserveUSDChange","trackedReserveUSDChangeCount","trackedReserveETHChange","trackedReserveETHChangeCount","volumeUSDOneDay","volumeUSDChange","volumeUSDChangeCount","untrackedVolumeUSDOneDay","untrackedVolumeUSDChange","untrackedVolumeUSDChangeCount","txCountOneDay","txCountChange","txCountChangeCount","tokens","observeToken","observeTokens","priceUSDChange","priceUSDChangeCount","liquidityUSDChange","liquidityUSDChangeCount","liquidityETHChange","liquidityETHChangeCount","userHistory","block_gte","block_lte","timestamp_gte","timestamp_lte","userPositions","token0PriceUSD","token1PriceUSD","liquidityTokenTotalSupply","liquidityTokenBalance","amount","rewardDebt","BigInt","balance","accSushiPerShare","sushiAtLockup","sushiHarvestedSinceLockup","sushiLocked","makers","servings","servers","pendingServings","observePendingServings","users","sushiServed","server","tx","serverAddress","liquidityPositions","valueUSD","getAverageBlockTime","exchangePairs","pool_id","stakedValue","liquidityPosition","masterchefList","exchangeList","reduce","allocPoint","averageBlockTime","masterchefPool","exchangePool","apy","tvl","apys","bonusMultiplier","bonusEndBlock","devaddr","migrator","owner","startBlock","poolCount","slpAge","slpAgeRemoved","slpDeposited","slpWithdrawn","lastRewardBlock","entryUSD","exitUSD","addedTs","addedDate","addedBlock","lastUpdatedTs","lastUpdatedDate","totalValueETH","totalValueUSD","poolId","slpBalanceChange","slpBalanceChangeCount","userCountChange","userCountChangeCount","sushiHarvestedChange","sushiHarvestedChangeCount","priceETH","observePriceETH","isCanceled","isExecuted","createdBlock_gte","createdBlock_lte","queuedTxs","canceledTxs","executedTxs","allTxs","description","value","eta","functionName","targetAddress","createdBlock","createdTs","expiresTs","createdTx","txHash","etaTs","etaDate","createdDate","expiresDate","canceledBlock","canceledTs","canceledTx","canceledDate","executedBlock","executedTs","executedTx","executedDate","startOfHour","startOfSecond","subHours","String","length","start","end","orderBy","previousValue","currentValue","currentIndex","difference","Backoff","opts","this","ms","min","factor","jitter","attempts","prototype","duration","pow","rand","random","deviation","reset","setMin","setMax","setJitter","addDays","dirtyDate","dirtyAmount","requiredArgs","arguments","toDate","toInteger","isNaN","NaN","setDate","getDate","addMonths","dayOfMonth","endOfDesiredMonth","getTime","setMonth","getMonth","daysInMonth","setFullYear","getFullYear","years","months","weeks","days","hours","minutes","seconds","dateWithMonths","dateWithDays","minutesToAdd","secondsToAdd","msToAdd","finalDate","isWeekend","day","getDay","isSunday","isSaturday","addBusinessDays","startedOnWeekend","getHours","sign","fullWeeks","restDays","abs","setHours","startOfWeek","dirtyOptions","options","locale","localeWeekStartsOn","weekStartsOn","defaultWeekStartsOn","RangeError","diff","startOfISOWeek","getISOWeekYear","year","fourthOfJanuaryOfNextYear","startOfNextYear","fourthOfJanuaryOfThisYear","startOfThisYear","startOfISOWeekYear","fourthOfJanuary","getTimezoneOffsetInMilliseconds","utcDate","UTC","getMinutes","getSeconds","getMilliseconds","setUTCFullYear","startOfDay","MILLISECONDS_IN_DAY","differenceInCalendarDays","dirtyDateLeft","dirtyDateRight","startOfDayLeft","startOfDayRight","timestampLeft","timestampRight","round","setISOWeekYear","dirtyISOWeekYear","isoWeekYear","addISOWeekYears","addMinutes","addMilliseconds","addQuarters","addSeconds","addWeeks","addYears","areIntervalsOverlapping","dirtyIntervalLeft","dirtyIntervalRight","inclusive","intervalLeft","intervalRight","leftStartTime","leftEndTime","rightStartTime","rightEndTime","dirtyDatesArray","datesArray","Array","slice","call","currentDate","clamp","_ref","closestIndexTo","dirtyDateToCompare","dateToCompare","minDistance","timeToCompare","distance","closestTo","compareAsc","dateLeft","dateRight","compareDesc","daysInWeek","maxTime","millisecondsInMinute","millisecondsInHour","millisecondsInSecond","minTime","minutesInHour","monthsInQuarter","monthsInYear","quartersInYear","secondsInHour","secondsInMinute","daysToWeeks","isSameDay","dateLeftStartOfDay","dateRightStartOfDay","isDate","isValid","differenceInBusinessDays","calendarDifference","differenceInCalendarISOWeekYears","MILLISECONDS_IN_WEEK","differenceInCalendarISOWeeks","startOfISOWeekLeft","startOfISOWeekRight","differenceInCalendarMonths","yearDiff","monthDiff","getQuarter","quarter","differenceInCalendarQuarters","quarterDiff","differenceInCalendarWeeks","startOfWeekLeft","startOfWeekRight","differenceInCalendarYears","compareLocalAsc","differenceInDays","isLastDayNotFull","differenceInMilliseconds","roundingMap","ceil","trunc","getRoundingMethod","method","differenceInHours","roundingMethod","subISOWeekYears","differenceInISOWeekYears","isLastISOWeekYearNotFull","differenceInMinutes","endOfDay","endOfMonth","month","isLastDayOfMonth","differenceInMonths","isLastMonthNotFull","differenceInQuarters","differenceInSeconds","differenceInWeeks","differenceInYears","isLastYearNotFull","eachDayOfInterval","dirtyInterval","interval","startDate","endDate","dates","step","eachHourOfInterval","setMinutes","addHours","setSeconds","eachMinuteOfInterval","eachMonthOfInterval","startOfQuarter","currentMonth","eachQuarterOfInterval","startDateQuarter","endDateQuarter","quarters","currentQuarter","eachWeekOfInterval","startDateWeek","endDateWeek","eachWeekendOfInterval","dateInterval","weekends","startOfMonth","eachWeekendOfMonth","startOfYear","cleanDate","endOfYear","eachWeekendOfYear","eachYearOfInterval","endOfDecade","decade","endOfHour","endOfWeek","endOfISOWeek","endOfISOWeekYear","setMilliseconds","endOfMinute","endOfQuarter","endOfSecond","endOfToday","endOfTomorrow","endOfYesterday","formatDistanceLocale","lessThanXSeconds","one","other","xSeconds","halfAMinute","lessThanXMinutes","xMinutes","aboutXHours","xHours","xDays","aboutXWeeks","xWeeks","aboutXMonths","xMonths","aboutXYears","xYears","overXYears","almostXYears","count","tokenValue","replace","addSuffix","comparison","buildFormatLongFn","args","width","defaultWidth","format","formats","formatLong","full","long","medium","short","dateTime","formatRelativeLocale","lastWeek","yesterday","today","tomorrow","nextWeek","buildLocalizeFn","dirtyIndex","valuesArray","context","formattingValues","defaultFormattingWidth","_defaultWidth","_width","argumentCallback","buildMatchFn","string","matchPattern","matchPatterns","defaultMatchWidth","matchResult","match","matchedString","parsePatterns","defaultParseWidth","isArray","findIndex","pattern","test","findKey","valueCallback","rest","object","predicate","hasOwnProperty","array","code","formatDistance","formatRelative","_date","_baseDate","_options","localize","ordinalNumber","dirtyNumber","rem100","era","narrow","abbreviated","wide","dayPeriod","am","pm","midnight","noon","morning","afternoon","evening","night","parsePattern","parseResult","any","firstWeekContainsDate","subMilliseconds","addLeadingZeros","targetLength","output","y","signedYear","getUTCFullYear","M","getUTCMonth","d","getUTCDate","dayPeriodEnumValue","getUTCHours","toUpperCase","h","H","m","getUTCMinutes","s","getUTCSeconds","S","numberOfDigits","milliseconds","getUTCMilliseconds","startOfUTCISOWeek","getUTCDay","setUTCDate","setUTCHours","getUTCISOWeekYear","startOfUTCISOWeekYear","getUTCISOWeek","startOfUTCWeek","getUTCWeekYear","localeFirstWeekContainsDate","defaultFirstWeekContainsDate","firstWeekOfNextYear","firstWeekOfThisYear","startOfUTCWeekYear","firstWeek","getUTCWeek","dayPeriodEnum","formatTimezoneShort","offset","dirtyDelimiter","absOffset","delimiter","formatTimezoneWithOptionalMinutes","formatTimezone","G","unit","lightFormatters","Y","signedWeekYear","weekYear","R","u","Q","q","L","w","I","isoWeek","D","dayOfYear","setUTCMonth","startOfYearTimestamp","getUTCDayOfYear","E","dayOfWeek","localDayOfWeek","c","isoDayOfWeek","B","K","k","X","_localize","timezoneOffset","_originalDate","getTimezoneOffset","x","O","z","t","originalDate","T","dateLongFormatter","timeLongFormatter","p","P","dateTimeFormat","datePattern","timePattern","protectedDayOfYearTokens","protectedWeekYearTokens","isProtectedDayOfYearToken","indexOf","isProtectedWeekYearToken","throwProtectedError","input","concat","formattingTokensRegExp","longFormattingTokensRegExp","escapedStringRegExp","doubleQuoteRegExp","unescapedLatinCharacterRegExp","dirtyFormatStr","formatStr","formatterOptions","substring","firstCharacter","longFormatter","join","cleanEscapedString","formatter","useAdditionalWeekYearTokens","useAdditionalDayOfYearTokens","dirtyObject","TypeError","property","cloneObject","MINUTES_IN_DAY","MINUTES_IN_MONTH","dirtyBaseDate","localizeOptions","Boolean","offsetInSeconds","includeSeconds","nearestMonth","monthsSinceStartOfYear","MINUTES_IN_YEAR","formatDistanceStrict","roundingMethodFn","dstNormalizedMinutes","roundedMinutes","formatDistanceToNow","formatDistanceToNowStrict","defaultFormat","formatDuration","zero","acc","formatISO","representation","tzOffset","dateDelimiter","timeDelimiter","absoluteOffset","hourOffset","minuteOffset","hour","minute","second","separator","formatISO9075","formatISODuration","_duration$years","_duration$months","_duration$days","_duration$hours","_duration$minutes","_duration$seconds","formatRFC3339","_ref$fractionDigits","fractionDigits","fractionalSecond","fractionalSeconds","formatRFC7231","dayName","monthName","baseDate","_ref$locale","_ref$weekStartsOn","utcBaseDate","dirtyUnixTime","unixTime","getDayOfYear","getDaysInMonth","monthIndex","lastDayOfMonth","isLeapYear","getDaysInYear","getDecade","getISODay","getISOWeek","getISOWeeksInYear","thisYear","nextYear","valueOf","getOverlappingDaysInIntervals","isOverlapping","overlapStartDate","overlapEndDate","differenceInMs","getWeekYear","_options$locale","_options$locale$optio","startOfWeekYear","getWeekOfMonth","currentDayOfMonth","startWeekDay","lastDayOfFirstWeek","weekNumber","remainingDaysAfterFirstWeek","getWeeksInMonth","getYear","hoursToMilliseconds","hoursToMinutes","hoursToSeconds","subDays","subMonths","sub","dateWithoutMonths","dateWithoutDays","minutestoSub","secondstoSub","mstoSub","intervalToDuration","remainingMonths","remainingDays","remainingHours","remainingMinutes","remainingSeconds","intlFormat","formatOrLocale","localeOptions","_localeOptions","formatOptions","isFormatOptions","Intl","DateTimeFormat","isAfter","isBefore","isEqual","dirtyLeftDate","dirtyRightDate","isExists","isFirstDayOfMonth","isFriday","isFuture","setUTCDay","dirtyDay","currentDay","remainder","dayIndex","numericPatterns","timezonePatterns","parseNumericPattern","parseTimezonePattern","parseAnyDigitsSigned","parseNDigits","n","RegExp","parseNDigitsSigned","dayPeriodEnumToHours","enumValue","normalizeTwoDigitYear","twoDigitYear","currentYear","isCommonEra","absCurrentYear","rangeEnd","DAYS_IN_MONTH","DAYS_IN_MONTH_LEAP_YEAR","isLeapYearIndex","priority","parse","set","flags","incompatibleTokens","isTwoDigitYear","validate","normalizedTwoDigitYear","_match","_flags","firstWeekOfYear","dirtyWeek","setUTCWeek","dirtyISOWeek","setUTCISOWeek","subPriority","wholeWeekDays","setUTCISODay","isPM","setUTCMinutes","setUTCSeconds","setUTCMilliseconds","timestampIsSet","_token","notWhitespaceRegExp","dirtyDateString","dirtyFormatString","dirtyReferenceDate","dateString","formatString","subFnOptions","setters","dateToSystemTimezone","usedTokens","parser","incompatibleToken","_i","usedToken","fullToken","uniquePrioritySetters","setter","setterArray","convertedDate","isMatch","isMonday","isPast","isSameHour","dateLeftStartOfHour","dateRightStartOfHour","isSameWeek","dateLeftStartOfWeek","dateRightStartOfWeek","isSameISOWeek","isSameISOWeekYear","dateLeftStartOfYear","dateRightStartOfYear","isSameMinute","dateLeftStartOfMinute","dateRightStartOfMinute","isSameMonth","isSameQuarter","dateLeftStartOfQuarter","dateRightStartOfQuarter","isSameSecond","dateLeftStartOfSecond","dateRightStartOfSecond","isSameYear","isThisHour","isThisISOWeek","isThisMinute","isThisMonth","isThisQuarter","isThisSecond","isThisWeek","isThisYear","isThursday","isToday","isTomorrow","isTuesday","isWednesday","isWithinInterval","isYesterday","lastDayOfDecade","lastDayOfWeek","lastDayOfISOWeek","lastDayOfISOWeekYear","lastDayOfQuarter","lastDayOfYear","lightFormat","matches","daysInYear","totalDays","totalSeconds","millisecondsToHours","millisecondsToMinutes","millisecondsToSeconds","minutesToHours","minutesToMilliseconds","minutesToSeconds","monthsToQuarters","monthsToYears","delta","nextFriday","nextMonday","nextSaturday","nextSunday","nextThursday","nextTuesday","nextWednesday","patterns","dateTimeDelimiter","timeZoneDelimiter","timezone","dateRegex","timeRegex","timezoneRegex","parseISO","argument","additionalDigits","dateStrings","splitDateString","parseYearResult","parseYear","parseDate","restDateString","parseTime","parseTimezone","timeString","substr","exec","regex","captures","century","isWeekDate","parseDateUnit","_year","validateWeekDate","fourthOfJanuaryDay","dayOfISOWeekYear","daysInMonths","validateDate","validateDayOfYearDate","parseTimeUnit","validateTime","parseFloat","timezoneString","_hours","validateTimezone","parseJSON","parts","previousDay","previousFriday","previousMonday","previousSaturday","previousSunday","previousThursday","previousTuesday","previousWednesday","quartersToMonths","quartersToYears","roundToNearestMinutes","nearestTo","remainderMinutes","addedMinutes","secondsToHours","secondsToMilliseconds","secondsToMinutes","dirtyMonth","dateWithDesiredMonth","dirtyDayOfMonth","setDay","setDayOfYear","dirtyDayOfYear","dirtyHours","setISODay","setISOWeek","dirtyMilliseconds","dirtyMinutes","setQuarter","dirtyQuarter","oldQuarter","dirtySeconds","setWeek","setWeekYear","dirtyWeekYear","setYear","dirtyYear","startOfDecade","startOfToday","startOfTomorrow","startOfYesterday","subBusinessDays","subMinutes","subQuarters","subSeconds","weeksToDays","yearsToMonths","yearsToQuarters","fetch","timeout","Infinity","runner","lastId","propToString","obj","entries","selectionObj","assign","first","id_gt","body","process","env","DEBUG","response","json","errors","JSON","stringify","newResults","global","getGlobal","bind","Headers","Request","Response","__assign","__awaiter","thisArg","_arguments","generator","resolve","reject","fulfilled","rejected","done","apply","__generator","f","_","label","sent","trys","ops","verb","Symbol","iterator","v","op","pop","defineProperty","_global","NativeWebSocket","eventemitter3_1","is_string_1","is_object_1","printer_1","getOperationAST_1","symbol_observable_1","protocol_1","defaults_1","message_types_1","url","webSocketImpl","webSocketProtocols","_a","_b","connectionCallback","_c","connectionParams","_d","WS_TIMEOUT","_e","_f","reconnectionAttempts","_g","lazy","_h","inactivityTimeout","wsImpl","wsProtocols","GRAPHQL_WS","operations","nextOperationId","wsTimeout","unsentMessagesQueue","reconnecting","closedByUser","backoff","eventEmitter","EventEmitter","middlewares","client","maxConnectTimeGenerator","createMaxConnectTimeGenerator","getConnectionParams","connect","get","CLOSED","readyState","enumerable","configurable","isForced","clearInactivityTimeout","clearCheckConnectionInterval","clearMaxConnectTimeout","clearTryReconnectTimeout","unsubscribeAll","sendMessage","default","GQL_CONNECTION_TERMINATE","emit","tryReconnect","opId","getObserver","executeOperation","unsubscribe","observerOrNext","onError","onComplete","observer","on","eventName","handler","off","onConnected","onConnecting","onDisconnected","onReconnected","onReconnecting","_this","subId","applyMiddlewares","funcs","scope","shift","applyMiddleware","queue","use","middleware","generateOperationId","processedOptions","checkOperationOptions","GQL_START","formatErrors","maxValue","checkConnectionIntervalId","clearInterval","maxConnectTimeoutId","clearTimeout","tryReconnectTimeoutId","inactivityTimeoutId","setInactivityTimeout","setTimeout","variables","operationName","getOperationAST","buildMessage","type","payload","print","message","originalError","sendMessageRaw","status","OPEN","serializedMessage","send","CONNECTING","delay","flushUnsentMessagesQueue","checkConnection","wasKeepAliveReceived","checkMaxConnectTimeout","onopen","error_1","GQL_CONNECTION_INIT","GQL_CONNECTION_ERROR","onclose","onerror","onmessage","processReceivedData","receivedData","parsedMessage","GQL_DATA","GQL_COMPLETE","GQL_ERROR","GQL_CONNECTION_ACK","parsedPayload","GQL_CONNECTION_KEEP_ALIVE","firstKA","setInterval","GQL_STOP","MessageTypes","SUBSCRIPTION_START","SUBSCRIPTION_DATA","SUBSCRIPTION_SUCCESS","SUBSCRIPTION_FAIL","SUBSCRIPTION_END","INIT","INIT_SUCCESS","INIT_FAIL","KEEP_ALIVE","GRAPHQL_SUBSCRIPTIONS","prefix","Events","EE","fn","once","addListener","emitter","event","listener","evt","_events","_eventsCount","clearEvent","create","__proto__","eventNames","events","names","getOwnPropertySymbols","listeners","handlers","l","ee","listenerCount","a1","a2","a3","a4","a5","len","removeListener","j","removeAllListeners","prefixed","root","documentAST","operation","_i2","_documentAST$definiti2","definitions","definition","kind"],"sourceRoot":""}