Socket
Socket
Sign inDemoInstall

@twilio-paste/date-picker

Package Overview
Dependencies
156
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 3.0.2

2

dist/DatePicker.d.ts
import * as React from 'react';
import type { InputProps } from '@twilio-paste/input';
export declare type DatePickerProps = Omit<InputProps, 'type' | 'insertBefore' | 'insertAfter'>;
export type DatePickerProps = Omit<InputProps, 'type' | 'insertBefore' | 'insertAfter'>;
declare const DatePicker: React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<HTMLInputElement>>;
export { DatePicker };
//# sourceMappingURL=DatePicker.d.ts.map

@@ -35,12 +35,7 @@ var __defProp = Object.defineProperty;

import * as React from "react";
import * as PropTypes from "prop-types";
import PropTypes from "prop-types";
import { Input } from "@twilio-paste/input";
var DatePicker = React.forwardRef((_a, ref) => {
var _b = _a, { element = "DATEPICKER" } = _b, props = __objRest(_b, ["element"]);
return /* @__PURE__ */ React.createElement(Input, __spreadProps(__spreadValues({
element
}, props), {
type: "date",
ref
}));
return /* @__PURE__ */ React.createElement(Input, __spreadProps(__spreadValues({ element }, props), { type: "date", ref }));
});

@@ -417,5 +412,5 @@ DatePicker.displayName = "DatePicker";

return function(dirtyString, dirtyOptions) {
var string2 = String(dirtyString);
var string = String(dirtyString);
var options = dirtyOptions || {};
var matchResult = string2.match(args.matchPattern);
var matchResult = string.match(args.matchPattern);
if (!matchResult) {

@@ -425,3 +420,3 @@ return null;

var matchedString = matchResult[0];
var parseResult = string2.match(args.parsePattern);
var parseResult = string.match(args.parsePattern);
if (!parseResult) {

@@ -434,3 +429,3 @@ return null;

value,
rest: string2.slice(matchedString.length)
rest: string.slice(matchedString.length)
};

@@ -443,7 +438,7 @@ };

return function(dirtyString, dirtyOptions) {
var string2 = String(dirtyString);
var string = String(dirtyString);
var options = dirtyOptions || {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string2.match(matchPattern);
var matchResult = string.match(matchPattern);
if (!matchResult) {

@@ -468,3 +463,3 @@ return null;

value,
rest: string2.slice(matchedString.length)
rest: string.slice(matchedString.length)
};

@@ -471,0 +466,0 @@ };

@@ -0,1 +1,2 @@

"use strict";
var __create = Object.create;

@@ -48,3 +49,6 @@ var __defProp = Object.defineProperty;

};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

@@ -62,27 +66,22 @@

var React = __toESM(require("react"));
var PropTypes = __toESM(require("prop-types"));
var import_prop_types = __toESM(require("prop-types"));
var import_input = require("@twilio-paste/input");
var DatePicker = React.forwardRef((_a, ref) => {
var _b = _a, { element = "DATEPICKER" } = _b, props = __objRest(_b, ["element"]);
return /* @__PURE__ */ React.createElement(import_input.Input, __spreadProps(__spreadValues({
element
}, props), {
type: "date",
ref
}));
return /* @__PURE__ */ React.createElement(import_input.Input, __spreadProps(__spreadValues({ element }, props), { type: "date", ref }));
});
DatePicker.displayName = "DatePicker";
DatePicker.propTypes = {
disabled: PropTypes.bool,
element: PropTypes.string,
hasError: PropTypes.bool,
id: PropTypes.string,
name: PropTypes.string,
onBlur: PropTypes.func,
onChange: PropTypes.func,
onFocus: PropTypes.func,
placeholder: PropTypes.string,
readOnly: PropTypes.bool,
required: PropTypes.bool,
value: PropTypes.string
disabled: import_prop_types.default.bool,
element: import_prop_types.default.string,
hasError: import_prop_types.default.bool,
id: import_prop_types.default.string,
name: import_prop_types.default.string,
onBlur: import_prop_types.default.func,
onChange: import_prop_types.default.func,
onFocus: import_prop_types.default.func,
placeholder: import_prop_types.default.string,
readOnly: import_prop_types.default.bool,
required: import_prop_types.default.bool,
value: import_prop_types.default.string
};

@@ -444,5 +443,5 @@

return function(dirtyString, dirtyOptions) {
var string2 = String(dirtyString);
var string = String(dirtyString);
var options = dirtyOptions || {};
var matchResult = string2.match(args.matchPattern);
var matchResult = string.match(args.matchPattern);
if (!matchResult) {

@@ -452,3 +451,3 @@ return null;

var matchedString = matchResult[0];
var parseResult = string2.match(args.parsePattern);
var parseResult = string.match(args.parsePattern);
if (!parseResult) {

@@ -461,3 +460,3 @@ return null;

value,
rest: string2.slice(matchedString.length)
rest: string.slice(matchedString.length)
};

@@ -470,7 +469,7 @@ };

return function(dirtyString, dirtyOptions) {
var string2 = String(dirtyString);
var string = String(dirtyString);
var options = dirtyOptions || {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string2.match(matchPattern);
var matchResult = string.match(matchPattern);
if (!matchResult) {

@@ -495,3 +494,3 @@ return null;

value,
rest: string2.slice(matchedString.length)
rest: string.slice(matchedString.length)
};

@@ -498,0 +497,0 @@ };

@@ -1,1 +0,1 @@

var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b));var __objRest=(source,exclude)=>{var target={};for(var prop in source)__hasOwnProp.call(source,prop)&&exclude.indexOf(prop)<0&&(target[prop]=source[prop]);if(source!=null&&__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(source))exclude.indexOf(prop)<0&&__propIsEnum.call(source,prop)&&(target[prop]=source[prop]);return target};import*as React from"react";import*as PropTypes from"prop-types";import{Input}from"@twilio-paste/input";var DatePicker=React.forwardRef((_a,ref)=>{var _b=_a,{element="DATEPICKER"}=_b,props=__objRest(_b,["element"]);return React.createElement(Input,__spreadProps(__spreadValues({element},props),{type:"date",ref}))});DatePicker.displayName="DatePicker";DatePicker.propTypes={disabled:PropTypes.bool,element:PropTypes.string,hasError:PropTypes.bool,id:PropTypes.string,name:PropTypes.string,onBlur:PropTypes.func,onChange:PropTypes.func,onFocus:PropTypes.func,placeholder:PropTypes.string,readOnly:PropTypes.bool,required:PropTypes.bool,value:PropTypes.string};function toInteger(dirtyNumber){if(dirtyNumber===null||dirtyNumber===!0||dirtyNumber===!1)return NaN;var number=Number(dirtyNumber);return isNaN(number)?number:number<0?Math.ceil(number):Math.floor(number)}function requiredArgs(required,args){if(args.length<required)throw new TypeError(required+" argument"+(required>1?"s":"")+" required, but only "+args.length+" present")}function toDate(argument){requiredArgs(1,arguments);var argStr=Object.prototype.toString.call(argument);return argument instanceof Date||typeof argument=="object"&&argStr==="[object Date]"?new Date(argument.getTime()):typeof argument=="number"||argStr==="[object Number]"?new Date(argument):((typeof argument=="string"||argStr==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function addMilliseconds(dirtyDate,dirtyAmount){requiredArgs(2,arguments);var timestamp=toDate(dirtyDate).getTime(),amount=toInteger(dirtyAmount);return new Date(timestamp+amount)}function getTimezoneOffsetInMilliseconds(date){var utcDate=new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds()));return utcDate.setUTCFullYear(date.getFullYear()),date.getTime()-utcDate.getTime()}function isValid(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate);return!isNaN(date)}var formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function formatDistance(token,count,options){options=options||{};var result;return typeof formatDistanceLocale[token]=="string"?result=formatDistanceLocale[token]:count===1?result=formatDistanceLocale[token].one:result=formatDistanceLocale[token].other.replace("{{count}}",count),options.addSuffix?options.comparison>0?"in "+result:result+" ago":result}function buildFormatLongFn(args){return function(dirtyOptions){var options=dirtyOptions||{},width=options.width?String(options.width):args.defaultWidth,format2=args.formats[width]||args.formats[args.defaultWidth];return format2}}var dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatLong_default=formatLong;var formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function formatRelative(token,_date,_baseDate,_options){return formatRelativeLocale[token]}function buildLocalizeFn(args){return function(dirtyIndex,dirtyOptions){var options=dirtyOptions||{},context=options.context?String(options.context):"standalone",valuesArray;if(context==="formatting"&&args.formattingValues){var defaultWidth=args.defaultFormattingWidth||args.defaultWidth,width=options.width?String(options.width):defaultWidth;valuesArray=args.formattingValues[width]||args.formattingValues[defaultWidth]}else{var _defaultWidth=args.defaultWidth,_width=options.width?String(options.width):args.defaultWidth;valuesArray=args.values[_width]||args.values[_defaultWidth]}var index=args.argumentCallback?args.argumentCallback(dirtyIndex):dirtyIndex;return valuesArray[index]}}var eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}};function ordinalNumber(dirtyNumber,_dirtyOptions){var number=Number(dirtyNumber),rem100=number%100;if(rem100>20||rem100<10)switch(rem100%10){case 1:return number+"st";case 2:return number+"nd";case 3:return number+"rd"}return number+"th"}var localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:function(quarter){return Number(quarter)-1}}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})},localize_default=localize;function buildMatchPatternFn(args){return function(dirtyString,dirtyOptions){var string2=String(dirtyString),options=dirtyOptions||{},matchResult=string2.match(args.matchPattern);if(!matchResult)return null;var matchedString=matchResult[0],parseResult=string2.match(args.parsePattern);if(!parseResult)return null;var value=args.valueCallback?args.valueCallback(parseResult[0]):parseResult[0];return value=options.valueCallback?options.valueCallback(value):value,{value,rest:string2.slice(matchedString.length)}}}function buildMatchFn(args){return function(dirtyString,dirtyOptions){var string2=String(dirtyString),options=dirtyOptions||{},width=options.width,matchPattern=width&&args.matchPatterns[width]||args.matchPatterns[args.defaultMatchWidth],matchResult=string2.match(matchPattern);if(!matchResult)return null;var matchedString=matchResult[0],parsePatterns=width&&args.parsePatterns[width]||args.parsePatterns[args.defaultParseWidth],value;return Object.prototype.toString.call(parsePatterns)==="[object Array]"?value=findIndex(parsePatterns,function(pattern){return pattern.test(matchedString)}):value=findKey(parsePatterns,function(pattern){return pattern.test(matchedString)}),value=args.valueCallback?args.valueCallback(value):value,value=options.valueCallback?options.valueCallback(value):value,{value,rest:string2.slice(matchedString.length)}}}function findKey(object,predicate){for(var key in object)if(object.hasOwnProperty(key)&&predicate(object[key]))return key}function findIndex(array,predicate){for(var key=0;key<array.length;key++)if(predicate(array[key]))return key}var matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={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],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]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:function(value){return parseInt(value,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:function(index){return index+1}}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},match_default=match;var locale={code:"en-US",formatDistance,formatLong:formatLong_default,formatRelative,localize:localize_default,match:match_default,options:{weekStartsOn:0,firstWeekContainsDate:1}},en_US_default=locale;function subMilliseconds(dirtyDate,dirtyAmount){requiredArgs(2,arguments);var amount=toInteger(dirtyAmount);return addMilliseconds(dirtyDate,-amount)}function addLeadingZeros(number,targetLength){for(var sign=number<0?"-":"",output=Math.abs(number).toString();output.length<targetLength;)output="0"+output;return sign+output}var formatters={y:function(date,token){var signedYear=date.getUTCFullYear(),year=signedYear>0?signedYear:1-signedYear;return addLeadingZeros(token==="yy"?year%100:year,token.length)},M:function(date,token){var month=date.getUTCMonth();return token==="M"?String(month+1):addLeadingZeros(month+1,2)},d:function(date,token){return addLeadingZeros(date.getUTCDate(),token.length)},a:function(date,token){var dayPeriodEnumValue=date.getUTCHours()/12>=1?"pm":"am";switch(token){case"a":case"aa":return dayPeriodEnumValue.toUpperCase();case"aaa":return dayPeriodEnumValue;case"aaaaa":return dayPeriodEnumValue[0];case"aaaa":default:return dayPeriodEnumValue==="am"?"a.m.":"p.m."}},h:function(date,token){return addLeadingZeros(date.getUTCHours()%12||12,token.length)},H:function(date,token){return addLeadingZeros(date.getUTCHours(),token.length)},m:function(date,token){return addLeadingZeros(date.getUTCMinutes(),token.length)},s:function(date,token){return addLeadingZeros(date.getUTCSeconds(),token.length)},S:function(date,token){var numberOfDigits=token.length,milliseconds=date.getUTCMilliseconds(),fractionalSeconds=Math.floor(milliseconds*Math.pow(10,numberOfDigits-3));return addLeadingZeros(fractionalSeconds,token.length)}},lightFormatters_default=formatters;var MILLISECONDS_IN_DAY=864e5;function getUTCDayOfYear(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),timestamp=date.getTime();date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0);var startOfYearTimestamp=date.getTime(),difference=timestamp-startOfYearTimestamp;return Math.floor(difference/MILLISECONDS_IN_DAY)+1}function startOfUTCISOWeek(dirtyDate){requiredArgs(1,arguments);var weekStartsOn=1,date=toDate(dirtyDate),day=date.getUTCDay(),diff=(day<weekStartsOn?7:0)+day-weekStartsOn;return date.setUTCDate(date.getUTCDate()-diff),date.setUTCHours(0,0,0,0),date}function getUTCISOWeekYear(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),year=date.getUTCFullYear(),fourthOfJanuaryOfNextYear=new Date(0);fourthOfJanuaryOfNextYear.setUTCFullYear(year+1,0,4),fourthOfJanuaryOfNextYear.setUTCHours(0,0,0,0);var startOfNextYear=startOfUTCISOWeek(fourthOfJanuaryOfNextYear),fourthOfJanuaryOfThisYear=new Date(0);fourthOfJanuaryOfThisYear.setUTCFullYear(year,0,4),fourthOfJanuaryOfThisYear.setUTCHours(0,0,0,0);var startOfThisYear=startOfUTCISOWeek(fourthOfJanuaryOfThisYear);return date.getTime()>=startOfNextYear.getTime()?year+1:date.getTime()>=startOfThisYear.getTime()?year:year-1}function startOfUTCISOWeekYear(dirtyDate){requiredArgs(1,arguments);var year=getUTCISOWeekYear(dirtyDate),fourthOfJanuary=new Date(0);fourthOfJanuary.setUTCFullYear(year,0,4),fourthOfJanuary.setUTCHours(0,0,0,0);var date=startOfUTCISOWeek(fourthOfJanuary);return date}var MILLISECONDS_IN_WEEK=6048e5;function getUTCISOWeek(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),diff=startOfUTCISOWeek(date).getTime()-startOfUTCISOWeekYear(date).getTime();return Math.round(diff/MILLISECONDS_IN_WEEK)+1}function startOfUTCWeek(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var options=dirtyOptions||{},locale2=options.locale,localeWeekStartsOn=locale2&&locale2.options&&locale2.options.weekStartsOn,defaultWeekStartsOn=localeWeekStartsOn==null?0:toInteger(localeWeekStartsOn),weekStartsOn=options.weekStartsOn==null?defaultWeekStartsOn:toInteger(options.weekStartsOn);if(!(weekStartsOn>=0&&weekStartsOn<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var date=toDate(dirtyDate),day=date.getUTCDay(),diff=(day<weekStartsOn?7:0)+day-weekStartsOn;return date.setUTCDate(date.getUTCDate()-diff),date.setUTCHours(0,0,0,0),date}function getUTCWeekYear(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var date=toDate(dirtyDate,dirtyOptions),year=date.getUTCFullYear(),options=dirtyOptions||{},locale2=options.locale,localeFirstWeekContainsDate=locale2&&locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate);if(!(firstWeekContainsDate>=1&&firstWeekContainsDate<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var firstWeekOfNextYear=new Date(0);firstWeekOfNextYear.setUTCFullYear(year+1,0,firstWeekContainsDate),firstWeekOfNextYear.setUTCHours(0,0,0,0);var startOfNextYear=startOfUTCWeek(firstWeekOfNextYear,dirtyOptions),firstWeekOfThisYear=new Date(0);firstWeekOfThisYear.setUTCFullYear(year,0,firstWeekContainsDate),firstWeekOfThisYear.setUTCHours(0,0,0,0);var startOfThisYear=startOfUTCWeek(firstWeekOfThisYear,dirtyOptions);return date.getTime()>=startOfNextYear.getTime()?year+1:date.getTime()>=startOfThisYear.getTime()?year:year-1}function startOfUTCWeekYear(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var options=dirtyOptions||{},locale2=options.locale,localeFirstWeekContainsDate=locale2&&locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate),year=getUTCWeekYear(dirtyDate,dirtyOptions),firstWeek=new Date(0);firstWeek.setUTCFullYear(year,0,firstWeekContainsDate),firstWeek.setUTCHours(0,0,0,0);var date=startOfUTCWeek(firstWeek,dirtyOptions);return date}var MILLISECONDS_IN_WEEK2=6048e5;function getUTCWeek(dirtyDate,options){requiredArgs(1,arguments);var date=toDate(dirtyDate),diff=startOfUTCWeek(date,options).getTime()-startOfUTCWeekYear(date,options).getTime();return Math.round(diff/MILLISECONDS_IN_WEEK2)+1}var dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters2={G:function(date,token,localize2){var era=date.getUTCFullYear()>0?1:0;switch(token){case"G":case"GG":case"GGG":return localize2.era(era,{width:"abbreviated"});case"GGGGG":return localize2.era(era,{width:"narrow"});case"GGGG":default:return localize2.era(era,{width:"wide"})}},y:function(date,token,localize2){if(token==="yo"){var signedYear=date.getUTCFullYear(),year=signedYear>0?signedYear:1-signedYear;return localize2.ordinalNumber(year,{unit:"year"})}return lightFormatters_default.y(date,token)},Y:function(date,token,localize2,options){var signedWeekYear=getUTCWeekYear(date,options),weekYear=signedWeekYear>0?signedWeekYear:1-signedWeekYear;if(token==="YY"){var twoDigitYear=weekYear%100;return addLeadingZeros(twoDigitYear,2)}return token==="Yo"?localize2.ordinalNumber(weekYear,{unit:"year"}):addLeadingZeros(weekYear,token.length)},R:function(date,token){var isoWeekYear=getUTCISOWeekYear(date);return addLeadingZeros(isoWeekYear,token.length)},u:function(date,token){var year=date.getUTCFullYear();return addLeadingZeros(year,token.length)},Q:function(date,token,localize2){var quarter=Math.ceil((date.getUTCMonth()+1)/3);switch(token){case"Q":return String(quarter);case"QQ":return addLeadingZeros(quarter,2);case"Qo":return localize2.ordinalNumber(quarter,{unit:"quarter"});case"QQQ":return localize2.quarter(quarter,{width:"abbreviated",context:"formatting"});case"QQQQQ":return localize2.quarter(quarter,{width:"narrow",context:"formatting"});case"QQQQ":default:return localize2.quarter(quarter,{width:"wide",context:"formatting"})}},q:function(date,token,localize2){var quarter=Math.ceil((date.getUTCMonth()+1)/3);switch(token){case"q":return String(quarter);case"qq":return addLeadingZeros(quarter,2);case"qo":return localize2.ordinalNumber(quarter,{unit:"quarter"});case"qqq":return localize2.quarter(quarter,{width:"abbreviated",context:"standalone"});case"qqqqq":return localize2.quarter(quarter,{width:"narrow",context:"standalone"});case"qqqq":default:return localize2.quarter(quarter,{width:"wide",context:"standalone"})}},M:function(date,token,localize2){var month=date.getUTCMonth();switch(token){case"M":case"MM":return lightFormatters_default.M(date,token);case"Mo":return localize2.ordinalNumber(month+1,{unit:"month"});case"MMM":return localize2.month(month,{width:"abbreviated",context:"formatting"});case"MMMMM":return localize2.month(month,{width:"narrow",context:"formatting"});case"MMMM":default:return localize2.month(month,{width:"wide",context:"formatting"})}},L:function(date,token,localize2){var month=date.getUTCMonth();switch(token){case"L":return String(month+1);case"LL":return addLeadingZeros(month+1,2);case"Lo":return localize2.ordinalNumber(month+1,{unit:"month"});case"LLL":return localize2.month(month,{width:"abbreviated",context:"standalone"});case"LLLLL":return localize2.month(month,{width:"narrow",context:"standalone"});case"LLLL":default:return localize2.month(month,{width:"wide",context:"standalone"})}},w:function(date,token,localize2,options){var week=getUTCWeek(date,options);return token==="wo"?localize2.ordinalNumber(week,{unit:"week"}):addLeadingZeros(week,token.length)},I:function(date,token,localize2){var isoWeek=getUTCISOWeek(date);return token==="Io"?localize2.ordinalNumber(isoWeek,{unit:"week"}):addLeadingZeros(isoWeek,token.length)},d:function(date,token,localize2){return token==="do"?localize2.ordinalNumber(date.getUTCDate(),{unit:"date"}):lightFormatters_default.d(date,token)},D:function(date,token,localize2){var dayOfYear=getUTCDayOfYear(date);return token==="Do"?localize2.ordinalNumber(dayOfYear,{unit:"dayOfYear"}):addLeadingZeros(dayOfYear,token.length)},E:function(date,token,localize2){var dayOfWeek=date.getUTCDay();switch(token){case"E":case"EE":case"EEE":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"EEEEE":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"EEEEEE":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"EEEE":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},e:function(date,token,localize2,options){var dayOfWeek=date.getUTCDay(),localDayOfWeek=(dayOfWeek-options.weekStartsOn+8)%7||7;switch(token){case"e":return String(localDayOfWeek);case"ee":return addLeadingZeros(localDayOfWeek,2);case"eo":return localize2.ordinalNumber(localDayOfWeek,{unit:"day"});case"eee":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"eeeee":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"eeeeee":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"eeee":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},c:function(date,token,localize2,options){var dayOfWeek=date.getUTCDay(),localDayOfWeek=(dayOfWeek-options.weekStartsOn+8)%7||7;switch(token){case"c":return String(localDayOfWeek);case"cc":return addLeadingZeros(localDayOfWeek,token.length);case"co":return localize2.ordinalNumber(localDayOfWeek,{unit:"day"});case"ccc":return localize2.day(dayOfWeek,{width:"abbreviated",context:"standalone"});case"ccccc":return localize2.day(dayOfWeek,{width:"narrow",context:"standalone"});case"cccccc":return localize2.day(dayOfWeek,{width:"short",context:"standalone"});case"cccc":default:return localize2.day(dayOfWeek,{width:"wide",context:"standalone"})}},i:function(date,token,localize2){var dayOfWeek=date.getUTCDay(),isoDayOfWeek=dayOfWeek===0?7:dayOfWeek;switch(token){case"i":return String(isoDayOfWeek);case"ii":return addLeadingZeros(isoDayOfWeek,token.length);case"io":return localize2.ordinalNumber(isoDayOfWeek,{unit:"day"});case"iii":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"iiiii":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"iiiiii":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"iiii":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},a:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue=hours/12>=1?"pm":"am";switch(token){case"a":case"aa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"aaa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"aaaa":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},b:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue;switch(hours===12?dayPeriodEnumValue=dayPeriodEnum.noon:hours===0?dayPeriodEnumValue=dayPeriodEnum.midnight:dayPeriodEnumValue=hours/12>=1?"pm":"am",token){case"b":case"bb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"bbb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"bbbb":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},B:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue;switch(hours>=17?dayPeriodEnumValue=dayPeriodEnum.evening:hours>=12?dayPeriodEnumValue=dayPeriodEnum.afternoon:hours>=4?dayPeriodEnumValue=dayPeriodEnum.morning:dayPeriodEnumValue=dayPeriodEnum.night,token){case"B":case"BB":case"BBB":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"BBBBB":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"BBBB":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},h:function(date,token,localize2){if(token==="ho"){var hours=date.getUTCHours()%12;return hours===0&&(hours=12),localize2.ordinalNumber(hours,{unit:"hour"})}return lightFormatters_default.h(date,token)},H:function(date,token,localize2){return token==="Ho"?localize2.ordinalNumber(date.getUTCHours(),{unit:"hour"}):lightFormatters_default.H(date,token)},K:function(date,token,localize2){var hours=date.getUTCHours()%12;return token==="Ko"?localize2.ordinalNumber(hours,{unit:"hour"}):addLeadingZeros(hours,token.length)},k:function(date,token,localize2){var hours=date.getUTCHours();return hours===0&&(hours=24),token==="ko"?localize2.ordinalNumber(hours,{unit:"hour"}):addLeadingZeros(hours,token.length)},m:function(date,token,localize2){return token==="mo"?localize2.ordinalNumber(date.getUTCMinutes(),{unit:"minute"}):lightFormatters_default.m(date,token)},s:function(date,token,localize2){return token==="so"?localize2.ordinalNumber(date.getUTCSeconds(),{unit:"second"}):lightFormatters_default.s(date,token)},S:function(date,token){return lightFormatters_default.S(date,token)},X:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();if(timezoneOffset===0)return"Z";switch(token){case"X":return formatTimezoneWithOptionalMinutes(timezoneOffset);case"XXXX":case"XX":return formatTimezone(timezoneOffset);case"XXXXX":case"XXX":default:return formatTimezone(timezoneOffset,":")}},x:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"x":return formatTimezoneWithOptionalMinutes(timezoneOffset);case"xxxx":case"xx":return formatTimezone(timezoneOffset);case"xxxxx":case"xxx":default:return formatTimezone(timezoneOffset,":")}},O:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(timezoneOffset,":");case"OOOO":default:return"GMT"+formatTimezone(timezoneOffset,":")}},z:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(timezoneOffset,":");case"zzzz":default:return"GMT"+formatTimezone(timezoneOffset,":")}},t:function(date,token,_localize,options){var originalDate=options._originalDate||date,timestamp=Math.floor(originalDate.getTime()/1e3);return addLeadingZeros(timestamp,token.length)},T:function(date,token,_localize,options){var originalDate=options._originalDate||date,timestamp=originalDate.getTime();return addLeadingZeros(timestamp,token.length)}};function formatTimezoneShort(offset,dirtyDelimiter){var sign=offset>0?"-":"+",absOffset=Math.abs(offset),hours=Math.floor(absOffset/60),minutes=absOffset%60;if(minutes===0)return sign+String(hours);var delimiter=dirtyDelimiter||"";return sign+String(hours)+delimiter+addLeadingZeros(minutes,2)}function formatTimezoneWithOptionalMinutes(offset,dirtyDelimiter){if(offset%60===0){var sign=offset>0?"-":"+";return sign+addLeadingZeros(Math.abs(offset)/60,2)}return formatTimezone(offset,dirtyDelimiter)}function formatTimezone(offset,dirtyDelimiter){var delimiter=dirtyDelimiter||"",sign=offset>0?"-":"+",absOffset=Math.abs(offset),hours=addLeadingZeros(Math.floor(absOffset/60),2),minutes=addLeadingZeros(absOffset%60,2);return sign+hours+delimiter+minutes}var formatters_default=formatters2;function dateLongFormatter(pattern,formatLong2){switch(pattern){case"P":return formatLong2.date({width:"short"});case"PP":return formatLong2.date({width:"medium"});case"PPP":return formatLong2.date({width:"long"});case"PPPP":default:return formatLong2.date({width:"full"})}}function timeLongFormatter(pattern,formatLong2){switch(pattern){case"p":return formatLong2.time({width:"short"});case"pp":return formatLong2.time({width:"medium"});case"ppp":return formatLong2.time({width:"long"});case"pppp":default:return formatLong2.time({width:"full"})}}function dateTimeLongFormatter(pattern,formatLong2){var matchResult=pattern.match(/(P+)(p+)?/),datePattern=matchResult[1],timePattern=matchResult[2];if(!timePattern)return dateLongFormatter(pattern,formatLong2);var dateTimeFormat;switch(datePattern){case"P":dateTimeFormat=formatLong2.dateTime({width:"short"});break;case"PP":dateTimeFormat=formatLong2.dateTime({width:"medium"});break;case"PPP":dateTimeFormat=formatLong2.dateTime({width:"long"});break;case"PPPP":default:dateTimeFormat=formatLong2.dateTime({width:"full"});break}return dateTimeFormat.replace("{{date}}",dateLongFormatter(datePattern,formatLong2)).replace("{{time}}",timeLongFormatter(timePattern,formatLong2))}var longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},longFormatters_default=longFormatters;var protectedDayOfYearTokens=["D","DD"],protectedWeekYearTokens=["YY","YYYY"];function isProtectedDayOfYearToken(token){return protectedDayOfYearTokens.indexOf(token)!==-1}function isProtectedWeekYearToken(token){return protectedWeekYearTokens.indexOf(token)!==-1}function throwProtectedError(token,format2,input){if(token==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2,"`) for formatting years to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2,"`) for formatting years to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(format2,"`) for formatting days of the month to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2,"`) for formatting days of the month to the input `").concat(input,"`; see: https://git.io/fxCyr"))}var formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function format(dirtyDate,dirtyFormatStr,dirtyOptions){requiredArgs(2,arguments);var formatStr=String(dirtyFormatStr),options=dirtyOptions||{},locale2=options.locale||en_US_default,localeFirstWeekContainsDate=locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate);if(!(firstWeekContainsDate>=1&&firstWeekContainsDate<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var localeWeekStartsOn=locale2.options&&locale2.options.weekStartsOn,defaultWeekStartsOn=localeWeekStartsOn==null?0:toInteger(localeWeekStartsOn),weekStartsOn=options.weekStartsOn==null?defaultWeekStartsOn:toInteger(options.weekStartsOn);if(!(weekStartsOn>=0&&weekStartsOn<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!locale2.localize)throw new RangeError("locale must contain localize property");if(!locale2.formatLong)throw new RangeError("locale must contain formatLong property");var originalDate=toDate(dirtyDate);if(!isValid(originalDate))throw new RangeError("Invalid time value");var timezoneOffset=getTimezoneOffsetInMilliseconds(originalDate),utcDate=subMilliseconds(originalDate,timezoneOffset),formatterOptions={firstWeekContainsDate,weekStartsOn,locale:locale2,_originalDate:originalDate},result=formatStr.match(longFormattingTokensRegExp).map(function(substring){var firstCharacter=substring[0];if(firstCharacter==="p"||firstCharacter==="P"){var longFormatter=longFormatters_default[firstCharacter];return longFormatter(substring,locale2.formatLong,formatterOptions)}return substring}).join("").match(formattingTokensRegExp).map(function(substring){if(substring==="''")return"'";var firstCharacter=substring[0];if(firstCharacter==="'")return cleanEscapedString(substring);var formatter=formatters_default[firstCharacter];if(formatter)return!options.useAdditionalWeekYearTokens&&isProtectedWeekYearToken(substring)&&throwProtectedError(substring,dirtyFormatStr,dirtyDate),!options.useAdditionalDayOfYearTokens&&isProtectedDayOfYearToken(substring)&&throwProtectedError(substring,dirtyFormatStr,dirtyDate),formatter(utcDate,substring,locale2.localize,formatterOptions);if(firstCharacter.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+firstCharacter+"`");return substring}).join("");return result}function cleanEscapedString(input){return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}var DATE_REGEX=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,NEUTRAL_TIME="T12:00:00-00:00",formatReturnDate=(dateValue,dateFormat)=>{if(dateValue.match(DATE_REGEX)){let datePlusNoonUTC=new Date(dateValue.concat(NEUTRAL_TIME));return format(datePlusNoonUTC,dateFormat)}throw new Error("[Paste Date Picker]: Please make sure dateValue string matches YYYY-MM-DD format")};export{DatePicker,formatReturnDate};
var __defProp=Object.defineProperty,__defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b));var __objRest=(source,exclude)=>{var target={};for(var prop in source)__hasOwnProp.call(source,prop)&&exclude.indexOf(prop)<0&&(target[prop]=source[prop]);if(source!=null&&__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(source))exclude.indexOf(prop)<0&&__propIsEnum.call(source,prop)&&(target[prop]=source[prop]);return target};import*as React from"react";import PropTypes from"prop-types";import{Input}from"@twilio-paste/input";var DatePicker=React.forwardRef((_a,ref)=>{var _b=_a,{element="DATEPICKER"}=_b,props=__objRest(_b,["element"]);return React.createElement(Input,__spreadProps(__spreadValues({element},props),{type:"date",ref}))});DatePicker.displayName="DatePicker";DatePicker.propTypes={disabled:PropTypes.bool,element:PropTypes.string,hasError:PropTypes.bool,id:PropTypes.string,name:PropTypes.string,onBlur:PropTypes.func,onChange:PropTypes.func,onFocus:PropTypes.func,placeholder:PropTypes.string,readOnly:PropTypes.bool,required:PropTypes.bool,value:PropTypes.string};function toInteger(dirtyNumber){if(dirtyNumber===null||dirtyNumber===!0||dirtyNumber===!1)return NaN;var number=Number(dirtyNumber);return isNaN(number)?number:number<0?Math.ceil(number):Math.floor(number)}function requiredArgs(required,args){if(args.length<required)throw new TypeError(required+" argument"+(required>1?"s":"")+" required, but only "+args.length+" present")}function toDate(argument){requiredArgs(1,arguments);var argStr=Object.prototype.toString.call(argument);return argument instanceof Date||typeof argument=="object"&&argStr==="[object Date]"?new Date(argument.getTime()):typeof argument=="number"||argStr==="[object Number]"?new Date(argument):((typeof argument=="string"||argStr==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function addMilliseconds(dirtyDate,dirtyAmount){requiredArgs(2,arguments);var timestamp=toDate(dirtyDate).getTime(),amount=toInteger(dirtyAmount);return new Date(timestamp+amount)}function getTimezoneOffsetInMilliseconds(date){var utcDate=new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds()));return utcDate.setUTCFullYear(date.getFullYear()),date.getTime()-utcDate.getTime()}function isValid(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate);return!isNaN(date)}var formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function formatDistance(token,count,options){options=options||{};var result;return typeof formatDistanceLocale[token]=="string"?result=formatDistanceLocale[token]:count===1?result=formatDistanceLocale[token].one:result=formatDistanceLocale[token].other.replace("{{count}}",count),options.addSuffix?options.comparison>0?"in "+result:result+" ago":result}function buildFormatLongFn(args){return function(dirtyOptions){var options=dirtyOptions||{},width=options.width?String(options.width):args.defaultWidth,format2=args.formats[width]||args.formats[args.defaultWidth];return format2}}var dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatLong_default=formatLong;var formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function formatRelative(token,_date,_baseDate,_options){return formatRelativeLocale[token]}function buildLocalizeFn(args){return function(dirtyIndex,dirtyOptions){var options=dirtyOptions||{},context=options.context?String(options.context):"standalone",valuesArray;if(context==="formatting"&&args.formattingValues){var defaultWidth=args.defaultFormattingWidth||args.defaultWidth,width=options.width?String(options.width):defaultWidth;valuesArray=args.formattingValues[width]||args.formattingValues[defaultWidth]}else{var _defaultWidth=args.defaultWidth,_width=options.width?String(options.width):args.defaultWidth;valuesArray=args.values[_width]||args.values[_defaultWidth]}var index=args.argumentCallback?args.argumentCallback(dirtyIndex):dirtyIndex;return valuesArray[index]}}var eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}};function ordinalNumber(dirtyNumber,_dirtyOptions){var number=Number(dirtyNumber),rem100=number%100;if(rem100>20||rem100<10)switch(rem100%10){case 1:return number+"st";case 2:return number+"nd";case 3:return number+"rd"}return number+"th"}var localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:function(quarter){return Number(quarter)-1}}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})},localize_default=localize;function buildMatchPatternFn(args){return function(dirtyString,dirtyOptions){var string=String(dirtyString),options=dirtyOptions||{},matchResult=string.match(args.matchPattern);if(!matchResult)return null;var matchedString=matchResult[0],parseResult=string.match(args.parsePattern);if(!parseResult)return null;var value=args.valueCallback?args.valueCallback(parseResult[0]):parseResult[0];return value=options.valueCallback?options.valueCallback(value):value,{value,rest:string.slice(matchedString.length)}}}function buildMatchFn(args){return function(dirtyString,dirtyOptions){var string=String(dirtyString),options=dirtyOptions||{},width=options.width,matchPattern=width&&args.matchPatterns[width]||args.matchPatterns[args.defaultMatchWidth],matchResult=string.match(matchPattern);if(!matchResult)return null;var matchedString=matchResult[0],parsePatterns=width&&args.parsePatterns[width]||args.parsePatterns[args.defaultParseWidth],value;return Object.prototype.toString.call(parsePatterns)==="[object Array]"?value=findIndex(parsePatterns,function(pattern){return pattern.test(matchedString)}):value=findKey(parsePatterns,function(pattern){return pattern.test(matchedString)}),value=args.valueCallback?args.valueCallback(value):value,value=options.valueCallback?options.valueCallback(value):value,{value,rest:string.slice(matchedString.length)}}}function findKey(object,predicate){for(var key in object)if(object.hasOwnProperty(key)&&predicate(object[key]))return key}function findIndex(array,predicate){for(var key=0;key<array.length;key++)if(predicate(array[key]))return key}var matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={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],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]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:function(value){return parseInt(value,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:function(index){return index+1}}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},match_default=match;var locale={code:"en-US",formatDistance,formatLong:formatLong_default,formatRelative,localize:localize_default,match:match_default,options:{weekStartsOn:0,firstWeekContainsDate:1}},en_US_default=locale;function subMilliseconds(dirtyDate,dirtyAmount){requiredArgs(2,arguments);var amount=toInteger(dirtyAmount);return addMilliseconds(dirtyDate,-amount)}function addLeadingZeros(number,targetLength){for(var sign=number<0?"-":"",output=Math.abs(number).toString();output.length<targetLength;)output="0"+output;return sign+output}var formatters={y:function(date,token){var signedYear=date.getUTCFullYear(),year=signedYear>0?signedYear:1-signedYear;return addLeadingZeros(token==="yy"?year%100:year,token.length)},M:function(date,token){var month=date.getUTCMonth();return token==="M"?String(month+1):addLeadingZeros(month+1,2)},d:function(date,token){return addLeadingZeros(date.getUTCDate(),token.length)},a:function(date,token){var dayPeriodEnumValue=date.getUTCHours()/12>=1?"pm":"am";switch(token){case"a":case"aa":return dayPeriodEnumValue.toUpperCase();case"aaa":return dayPeriodEnumValue;case"aaaaa":return dayPeriodEnumValue[0];case"aaaa":default:return dayPeriodEnumValue==="am"?"a.m.":"p.m."}},h:function(date,token){return addLeadingZeros(date.getUTCHours()%12||12,token.length)},H:function(date,token){return addLeadingZeros(date.getUTCHours(),token.length)},m:function(date,token){return addLeadingZeros(date.getUTCMinutes(),token.length)},s:function(date,token){return addLeadingZeros(date.getUTCSeconds(),token.length)},S:function(date,token){var numberOfDigits=token.length,milliseconds=date.getUTCMilliseconds(),fractionalSeconds=Math.floor(milliseconds*Math.pow(10,numberOfDigits-3));return addLeadingZeros(fractionalSeconds,token.length)}},lightFormatters_default=formatters;var MILLISECONDS_IN_DAY=864e5;function getUTCDayOfYear(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),timestamp=date.getTime();date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0);var startOfYearTimestamp=date.getTime(),difference=timestamp-startOfYearTimestamp;return Math.floor(difference/MILLISECONDS_IN_DAY)+1}function startOfUTCISOWeek(dirtyDate){requiredArgs(1,arguments);var weekStartsOn=1,date=toDate(dirtyDate),day=date.getUTCDay(),diff=(day<weekStartsOn?7:0)+day-weekStartsOn;return date.setUTCDate(date.getUTCDate()-diff),date.setUTCHours(0,0,0,0),date}function getUTCISOWeekYear(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),year=date.getUTCFullYear(),fourthOfJanuaryOfNextYear=new Date(0);fourthOfJanuaryOfNextYear.setUTCFullYear(year+1,0,4),fourthOfJanuaryOfNextYear.setUTCHours(0,0,0,0);var startOfNextYear=startOfUTCISOWeek(fourthOfJanuaryOfNextYear),fourthOfJanuaryOfThisYear=new Date(0);fourthOfJanuaryOfThisYear.setUTCFullYear(year,0,4),fourthOfJanuaryOfThisYear.setUTCHours(0,0,0,0);var startOfThisYear=startOfUTCISOWeek(fourthOfJanuaryOfThisYear);return date.getTime()>=startOfNextYear.getTime()?year+1:date.getTime()>=startOfThisYear.getTime()?year:year-1}function startOfUTCISOWeekYear(dirtyDate){requiredArgs(1,arguments);var year=getUTCISOWeekYear(dirtyDate),fourthOfJanuary=new Date(0);fourthOfJanuary.setUTCFullYear(year,0,4),fourthOfJanuary.setUTCHours(0,0,0,0);var date=startOfUTCISOWeek(fourthOfJanuary);return date}var MILLISECONDS_IN_WEEK=6048e5;function getUTCISOWeek(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),diff=startOfUTCISOWeek(date).getTime()-startOfUTCISOWeekYear(date).getTime();return Math.round(diff/MILLISECONDS_IN_WEEK)+1}function startOfUTCWeek(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var options=dirtyOptions||{},locale2=options.locale,localeWeekStartsOn=locale2&&locale2.options&&locale2.options.weekStartsOn,defaultWeekStartsOn=localeWeekStartsOn==null?0:toInteger(localeWeekStartsOn),weekStartsOn=options.weekStartsOn==null?defaultWeekStartsOn:toInteger(options.weekStartsOn);if(!(weekStartsOn>=0&&weekStartsOn<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var date=toDate(dirtyDate),day=date.getUTCDay(),diff=(day<weekStartsOn?7:0)+day-weekStartsOn;return date.setUTCDate(date.getUTCDate()-diff),date.setUTCHours(0,0,0,0),date}function getUTCWeekYear(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var date=toDate(dirtyDate,dirtyOptions),year=date.getUTCFullYear(),options=dirtyOptions||{},locale2=options.locale,localeFirstWeekContainsDate=locale2&&locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate);if(!(firstWeekContainsDate>=1&&firstWeekContainsDate<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var firstWeekOfNextYear=new Date(0);firstWeekOfNextYear.setUTCFullYear(year+1,0,firstWeekContainsDate),firstWeekOfNextYear.setUTCHours(0,0,0,0);var startOfNextYear=startOfUTCWeek(firstWeekOfNextYear,dirtyOptions),firstWeekOfThisYear=new Date(0);firstWeekOfThisYear.setUTCFullYear(year,0,firstWeekContainsDate),firstWeekOfThisYear.setUTCHours(0,0,0,0);var startOfThisYear=startOfUTCWeek(firstWeekOfThisYear,dirtyOptions);return date.getTime()>=startOfNextYear.getTime()?year+1:date.getTime()>=startOfThisYear.getTime()?year:year-1}function startOfUTCWeekYear(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var options=dirtyOptions||{},locale2=options.locale,localeFirstWeekContainsDate=locale2&&locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate),year=getUTCWeekYear(dirtyDate,dirtyOptions),firstWeek=new Date(0);firstWeek.setUTCFullYear(year,0,firstWeekContainsDate),firstWeek.setUTCHours(0,0,0,0);var date=startOfUTCWeek(firstWeek,dirtyOptions);return date}var MILLISECONDS_IN_WEEK2=6048e5;function getUTCWeek(dirtyDate,options){requiredArgs(1,arguments);var date=toDate(dirtyDate),diff=startOfUTCWeek(date,options).getTime()-startOfUTCWeekYear(date,options).getTime();return Math.round(diff/MILLISECONDS_IN_WEEK2)+1}var dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters2={G:function(date,token,localize2){var era=date.getUTCFullYear()>0?1:0;switch(token){case"G":case"GG":case"GGG":return localize2.era(era,{width:"abbreviated"});case"GGGGG":return localize2.era(era,{width:"narrow"});case"GGGG":default:return localize2.era(era,{width:"wide"})}},y:function(date,token,localize2){if(token==="yo"){var signedYear=date.getUTCFullYear(),year=signedYear>0?signedYear:1-signedYear;return localize2.ordinalNumber(year,{unit:"year"})}return lightFormatters_default.y(date,token)},Y:function(date,token,localize2,options){var signedWeekYear=getUTCWeekYear(date,options),weekYear=signedWeekYear>0?signedWeekYear:1-signedWeekYear;if(token==="YY"){var twoDigitYear=weekYear%100;return addLeadingZeros(twoDigitYear,2)}return token==="Yo"?localize2.ordinalNumber(weekYear,{unit:"year"}):addLeadingZeros(weekYear,token.length)},R:function(date,token){var isoWeekYear=getUTCISOWeekYear(date);return addLeadingZeros(isoWeekYear,token.length)},u:function(date,token){var year=date.getUTCFullYear();return addLeadingZeros(year,token.length)},Q:function(date,token,localize2){var quarter=Math.ceil((date.getUTCMonth()+1)/3);switch(token){case"Q":return String(quarter);case"QQ":return addLeadingZeros(quarter,2);case"Qo":return localize2.ordinalNumber(quarter,{unit:"quarter"});case"QQQ":return localize2.quarter(quarter,{width:"abbreviated",context:"formatting"});case"QQQQQ":return localize2.quarter(quarter,{width:"narrow",context:"formatting"});case"QQQQ":default:return localize2.quarter(quarter,{width:"wide",context:"formatting"})}},q:function(date,token,localize2){var quarter=Math.ceil((date.getUTCMonth()+1)/3);switch(token){case"q":return String(quarter);case"qq":return addLeadingZeros(quarter,2);case"qo":return localize2.ordinalNumber(quarter,{unit:"quarter"});case"qqq":return localize2.quarter(quarter,{width:"abbreviated",context:"standalone"});case"qqqqq":return localize2.quarter(quarter,{width:"narrow",context:"standalone"});case"qqqq":default:return localize2.quarter(quarter,{width:"wide",context:"standalone"})}},M:function(date,token,localize2){var month=date.getUTCMonth();switch(token){case"M":case"MM":return lightFormatters_default.M(date,token);case"Mo":return localize2.ordinalNumber(month+1,{unit:"month"});case"MMM":return localize2.month(month,{width:"abbreviated",context:"formatting"});case"MMMMM":return localize2.month(month,{width:"narrow",context:"formatting"});case"MMMM":default:return localize2.month(month,{width:"wide",context:"formatting"})}},L:function(date,token,localize2){var month=date.getUTCMonth();switch(token){case"L":return String(month+1);case"LL":return addLeadingZeros(month+1,2);case"Lo":return localize2.ordinalNumber(month+1,{unit:"month"});case"LLL":return localize2.month(month,{width:"abbreviated",context:"standalone"});case"LLLLL":return localize2.month(month,{width:"narrow",context:"standalone"});case"LLLL":default:return localize2.month(month,{width:"wide",context:"standalone"})}},w:function(date,token,localize2,options){var week=getUTCWeek(date,options);return token==="wo"?localize2.ordinalNumber(week,{unit:"week"}):addLeadingZeros(week,token.length)},I:function(date,token,localize2){var isoWeek=getUTCISOWeek(date);return token==="Io"?localize2.ordinalNumber(isoWeek,{unit:"week"}):addLeadingZeros(isoWeek,token.length)},d:function(date,token,localize2){return token==="do"?localize2.ordinalNumber(date.getUTCDate(),{unit:"date"}):lightFormatters_default.d(date,token)},D:function(date,token,localize2){var dayOfYear=getUTCDayOfYear(date);return token==="Do"?localize2.ordinalNumber(dayOfYear,{unit:"dayOfYear"}):addLeadingZeros(dayOfYear,token.length)},E:function(date,token,localize2){var dayOfWeek=date.getUTCDay();switch(token){case"E":case"EE":case"EEE":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"EEEEE":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"EEEEEE":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"EEEE":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},e:function(date,token,localize2,options){var dayOfWeek=date.getUTCDay(),localDayOfWeek=(dayOfWeek-options.weekStartsOn+8)%7||7;switch(token){case"e":return String(localDayOfWeek);case"ee":return addLeadingZeros(localDayOfWeek,2);case"eo":return localize2.ordinalNumber(localDayOfWeek,{unit:"day"});case"eee":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"eeeee":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"eeeeee":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"eeee":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},c:function(date,token,localize2,options){var dayOfWeek=date.getUTCDay(),localDayOfWeek=(dayOfWeek-options.weekStartsOn+8)%7||7;switch(token){case"c":return String(localDayOfWeek);case"cc":return addLeadingZeros(localDayOfWeek,token.length);case"co":return localize2.ordinalNumber(localDayOfWeek,{unit:"day"});case"ccc":return localize2.day(dayOfWeek,{width:"abbreviated",context:"standalone"});case"ccccc":return localize2.day(dayOfWeek,{width:"narrow",context:"standalone"});case"cccccc":return localize2.day(dayOfWeek,{width:"short",context:"standalone"});case"cccc":default:return localize2.day(dayOfWeek,{width:"wide",context:"standalone"})}},i:function(date,token,localize2){var dayOfWeek=date.getUTCDay(),isoDayOfWeek=dayOfWeek===0?7:dayOfWeek;switch(token){case"i":return String(isoDayOfWeek);case"ii":return addLeadingZeros(isoDayOfWeek,token.length);case"io":return localize2.ordinalNumber(isoDayOfWeek,{unit:"day"});case"iii":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"iiiii":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"iiiiii":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"iiii":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},a:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue=hours/12>=1?"pm":"am";switch(token){case"a":case"aa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"aaa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"aaaa":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},b:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue;switch(hours===12?dayPeriodEnumValue=dayPeriodEnum.noon:hours===0?dayPeriodEnumValue=dayPeriodEnum.midnight:dayPeriodEnumValue=hours/12>=1?"pm":"am",token){case"b":case"bb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"bbb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"bbbb":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},B:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue;switch(hours>=17?dayPeriodEnumValue=dayPeriodEnum.evening:hours>=12?dayPeriodEnumValue=dayPeriodEnum.afternoon:hours>=4?dayPeriodEnumValue=dayPeriodEnum.morning:dayPeriodEnumValue=dayPeriodEnum.night,token){case"B":case"BB":case"BBB":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"BBBBB":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"BBBB":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},h:function(date,token,localize2){if(token==="ho"){var hours=date.getUTCHours()%12;return hours===0&&(hours=12),localize2.ordinalNumber(hours,{unit:"hour"})}return lightFormatters_default.h(date,token)},H:function(date,token,localize2){return token==="Ho"?localize2.ordinalNumber(date.getUTCHours(),{unit:"hour"}):lightFormatters_default.H(date,token)},K:function(date,token,localize2){var hours=date.getUTCHours()%12;return token==="Ko"?localize2.ordinalNumber(hours,{unit:"hour"}):addLeadingZeros(hours,token.length)},k:function(date,token,localize2){var hours=date.getUTCHours();return hours===0&&(hours=24),token==="ko"?localize2.ordinalNumber(hours,{unit:"hour"}):addLeadingZeros(hours,token.length)},m:function(date,token,localize2){return token==="mo"?localize2.ordinalNumber(date.getUTCMinutes(),{unit:"minute"}):lightFormatters_default.m(date,token)},s:function(date,token,localize2){return token==="so"?localize2.ordinalNumber(date.getUTCSeconds(),{unit:"second"}):lightFormatters_default.s(date,token)},S:function(date,token){return lightFormatters_default.S(date,token)},X:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();if(timezoneOffset===0)return"Z";switch(token){case"X":return formatTimezoneWithOptionalMinutes(timezoneOffset);case"XXXX":case"XX":return formatTimezone(timezoneOffset);case"XXXXX":case"XXX":default:return formatTimezone(timezoneOffset,":")}},x:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"x":return formatTimezoneWithOptionalMinutes(timezoneOffset);case"xxxx":case"xx":return formatTimezone(timezoneOffset);case"xxxxx":case"xxx":default:return formatTimezone(timezoneOffset,":")}},O:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(timezoneOffset,":");case"OOOO":default:return"GMT"+formatTimezone(timezoneOffset,":")}},z:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(timezoneOffset,":");case"zzzz":default:return"GMT"+formatTimezone(timezoneOffset,":")}},t:function(date,token,_localize,options){var originalDate=options._originalDate||date,timestamp=Math.floor(originalDate.getTime()/1e3);return addLeadingZeros(timestamp,token.length)},T:function(date,token,_localize,options){var originalDate=options._originalDate||date,timestamp=originalDate.getTime();return addLeadingZeros(timestamp,token.length)}};function formatTimezoneShort(offset,dirtyDelimiter){var sign=offset>0?"-":"+",absOffset=Math.abs(offset),hours=Math.floor(absOffset/60),minutes=absOffset%60;if(minutes===0)return sign+String(hours);var delimiter=dirtyDelimiter||"";return sign+String(hours)+delimiter+addLeadingZeros(minutes,2)}function formatTimezoneWithOptionalMinutes(offset,dirtyDelimiter){if(offset%60===0){var sign=offset>0?"-":"+";return sign+addLeadingZeros(Math.abs(offset)/60,2)}return formatTimezone(offset,dirtyDelimiter)}function formatTimezone(offset,dirtyDelimiter){var delimiter=dirtyDelimiter||"",sign=offset>0?"-":"+",absOffset=Math.abs(offset),hours=addLeadingZeros(Math.floor(absOffset/60),2),minutes=addLeadingZeros(absOffset%60,2);return sign+hours+delimiter+minutes}var formatters_default=formatters2;function dateLongFormatter(pattern,formatLong2){switch(pattern){case"P":return formatLong2.date({width:"short"});case"PP":return formatLong2.date({width:"medium"});case"PPP":return formatLong2.date({width:"long"});case"PPPP":default:return formatLong2.date({width:"full"})}}function timeLongFormatter(pattern,formatLong2){switch(pattern){case"p":return formatLong2.time({width:"short"});case"pp":return formatLong2.time({width:"medium"});case"ppp":return formatLong2.time({width:"long"});case"pppp":default:return formatLong2.time({width:"full"})}}function dateTimeLongFormatter(pattern,formatLong2){var matchResult=pattern.match(/(P+)(p+)?/),datePattern=matchResult[1],timePattern=matchResult[2];if(!timePattern)return dateLongFormatter(pattern,formatLong2);var dateTimeFormat;switch(datePattern){case"P":dateTimeFormat=formatLong2.dateTime({width:"short"});break;case"PP":dateTimeFormat=formatLong2.dateTime({width:"medium"});break;case"PPP":dateTimeFormat=formatLong2.dateTime({width:"long"});break;case"PPPP":default:dateTimeFormat=formatLong2.dateTime({width:"full"});break}return dateTimeFormat.replace("{{date}}",dateLongFormatter(datePattern,formatLong2)).replace("{{time}}",timeLongFormatter(timePattern,formatLong2))}var longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},longFormatters_default=longFormatters;var protectedDayOfYearTokens=["D","DD"],protectedWeekYearTokens=["YY","YYYY"];function isProtectedDayOfYearToken(token){return protectedDayOfYearTokens.indexOf(token)!==-1}function isProtectedWeekYearToken(token){return protectedWeekYearTokens.indexOf(token)!==-1}function throwProtectedError(token,format2,input){if(token==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2,"`) for formatting years to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2,"`) for formatting years to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(format2,"`) for formatting days of the month to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2,"`) for formatting days of the month to the input `").concat(input,"`; see: https://git.io/fxCyr"))}var formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function format(dirtyDate,dirtyFormatStr,dirtyOptions){requiredArgs(2,arguments);var formatStr=String(dirtyFormatStr),options=dirtyOptions||{},locale2=options.locale||en_US_default,localeFirstWeekContainsDate=locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate);if(!(firstWeekContainsDate>=1&&firstWeekContainsDate<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var localeWeekStartsOn=locale2.options&&locale2.options.weekStartsOn,defaultWeekStartsOn=localeWeekStartsOn==null?0:toInteger(localeWeekStartsOn),weekStartsOn=options.weekStartsOn==null?defaultWeekStartsOn:toInteger(options.weekStartsOn);if(!(weekStartsOn>=0&&weekStartsOn<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!locale2.localize)throw new RangeError("locale must contain localize property");if(!locale2.formatLong)throw new RangeError("locale must contain formatLong property");var originalDate=toDate(dirtyDate);if(!isValid(originalDate))throw new RangeError("Invalid time value");var timezoneOffset=getTimezoneOffsetInMilliseconds(originalDate),utcDate=subMilliseconds(originalDate,timezoneOffset),formatterOptions={firstWeekContainsDate,weekStartsOn,locale:locale2,_originalDate:originalDate},result=formatStr.match(longFormattingTokensRegExp).map(function(substring){var firstCharacter=substring[0];if(firstCharacter==="p"||firstCharacter==="P"){var longFormatter=longFormatters_default[firstCharacter];return longFormatter(substring,locale2.formatLong,formatterOptions)}return substring}).join("").match(formattingTokensRegExp).map(function(substring){if(substring==="''")return"'";var firstCharacter=substring[0];if(firstCharacter==="'")return cleanEscapedString(substring);var formatter=formatters_default[firstCharacter];if(formatter)return!options.useAdditionalWeekYearTokens&&isProtectedWeekYearToken(substring)&&throwProtectedError(substring,dirtyFormatStr,dirtyDate),!options.useAdditionalDayOfYearTokens&&isProtectedDayOfYearToken(substring)&&throwProtectedError(substring,dirtyFormatStr,dirtyDate),formatter(utcDate,substring,locale2.localize,formatterOptions);if(firstCharacter.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+firstCharacter+"`");return substring}).join("");return result}function cleanEscapedString(input){return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}var DATE_REGEX=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,NEUTRAL_TIME="T12:00:00-00:00",formatReturnDate=(dateValue,dateFormat)=>{if(dateValue.match(DATE_REGEX)){let datePlusNoonUTC=new Date(dateValue.concat(NEUTRAL_TIME));return format(datePlusNoonUTC,dateFormat)}throw new Error("[Paste Date Picker]: Please make sure dateValue string matches YYYY-MM-DD format")};export{DatePicker,formatReturnDate};

@@ -1,1 +0,1 @@

var __create=Object.create;var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b));var __objRest=(source,exclude)=>{var target={};for(var prop in source)__hasOwnProp.call(source,prop)&&exclude.indexOf(prop)<0&&(target[prop]=source[prop]);if(source!=null&&__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(source))exclude.indexOf(prop)<0&&__propIsEnum.call(source,prop)&&(target[prop]=source[prop]);return target};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{DatePicker:()=>DatePicker,formatReturnDate:()=>formatReturnDate});module.exports=__toCommonJS(src_exports);var React=__toESM(require("react")),PropTypes=__toESM(require("prop-types")),import_input=require("@twilio-paste/input"),DatePicker=React.forwardRef((_a,ref)=>{var _b=_a,{element="DATEPICKER"}=_b,props=__objRest(_b,["element"]);return React.createElement(import_input.Input,__spreadProps(__spreadValues({element},props),{type:"date",ref}))});DatePicker.displayName="DatePicker";DatePicker.propTypes={disabled:PropTypes.bool,element:PropTypes.string,hasError:PropTypes.bool,id:PropTypes.string,name:PropTypes.string,onBlur:PropTypes.func,onChange:PropTypes.func,onFocus:PropTypes.func,placeholder:PropTypes.string,readOnly:PropTypes.bool,required:PropTypes.bool,value:PropTypes.string};function toInteger(dirtyNumber){if(dirtyNumber===null||dirtyNumber===!0||dirtyNumber===!1)return NaN;var number=Number(dirtyNumber);return isNaN(number)?number:number<0?Math.ceil(number):Math.floor(number)}function requiredArgs(required,args){if(args.length<required)throw new TypeError(required+" argument"+(required>1?"s":"")+" required, but only "+args.length+" present")}function toDate(argument){requiredArgs(1,arguments);var argStr=Object.prototype.toString.call(argument);return argument instanceof Date||typeof argument=="object"&&argStr==="[object Date]"?new Date(argument.getTime()):typeof argument=="number"||argStr==="[object Number]"?new Date(argument):((typeof argument=="string"||argStr==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function addMilliseconds(dirtyDate,dirtyAmount){requiredArgs(2,arguments);var timestamp=toDate(dirtyDate).getTime(),amount=toInteger(dirtyAmount);return new Date(timestamp+amount)}function getTimezoneOffsetInMilliseconds(date){var utcDate=new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds()));return utcDate.setUTCFullYear(date.getFullYear()),date.getTime()-utcDate.getTime()}function isValid(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate);return!isNaN(date)}var formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function formatDistance(token,count,options){options=options||{};var result;return typeof formatDistanceLocale[token]=="string"?result=formatDistanceLocale[token]:count===1?result=formatDistanceLocale[token].one:result=formatDistanceLocale[token].other.replace("{{count}}",count),options.addSuffix?options.comparison>0?"in "+result:result+" ago":result}function buildFormatLongFn(args){return function(dirtyOptions){var options=dirtyOptions||{},width=options.width?String(options.width):args.defaultWidth,format2=args.formats[width]||args.formats[args.defaultWidth];return format2}}var dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatLong_default=formatLong;var formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function formatRelative(token,_date,_baseDate,_options){return formatRelativeLocale[token]}function buildLocalizeFn(args){return function(dirtyIndex,dirtyOptions){var options=dirtyOptions||{},context=options.context?String(options.context):"standalone",valuesArray;if(context==="formatting"&&args.formattingValues){var defaultWidth=args.defaultFormattingWidth||args.defaultWidth,width=options.width?String(options.width):defaultWidth;valuesArray=args.formattingValues[width]||args.formattingValues[defaultWidth]}else{var _defaultWidth=args.defaultWidth,_width=options.width?String(options.width):args.defaultWidth;valuesArray=args.values[_width]||args.values[_defaultWidth]}var index=args.argumentCallback?args.argumentCallback(dirtyIndex):dirtyIndex;return valuesArray[index]}}var eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}};function ordinalNumber(dirtyNumber,_dirtyOptions){var number=Number(dirtyNumber),rem100=number%100;if(rem100>20||rem100<10)switch(rem100%10){case 1:return number+"st";case 2:return number+"nd";case 3:return number+"rd"}return number+"th"}var localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:function(quarter){return Number(quarter)-1}}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})},localize_default=localize;function buildMatchPatternFn(args){return function(dirtyString,dirtyOptions){var string2=String(dirtyString),options=dirtyOptions||{},matchResult=string2.match(args.matchPattern);if(!matchResult)return null;var matchedString=matchResult[0],parseResult=string2.match(args.parsePattern);if(!parseResult)return null;var value=args.valueCallback?args.valueCallback(parseResult[0]):parseResult[0];return value=options.valueCallback?options.valueCallback(value):value,{value,rest:string2.slice(matchedString.length)}}}function buildMatchFn(args){return function(dirtyString,dirtyOptions){var string2=String(dirtyString),options=dirtyOptions||{},width=options.width,matchPattern=width&&args.matchPatterns[width]||args.matchPatterns[args.defaultMatchWidth],matchResult=string2.match(matchPattern);if(!matchResult)return null;var matchedString=matchResult[0],parsePatterns=width&&args.parsePatterns[width]||args.parsePatterns[args.defaultParseWidth],value;return Object.prototype.toString.call(parsePatterns)==="[object Array]"?value=findIndex(parsePatterns,function(pattern){return pattern.test(matchedString)}):value=findKey(parsePatterns,function(pattern){return pattern.test(matchedString)}),value=args.valueCallback?args.valueCallback(value):value,value=options.valueCallback?options.valueCallback(value):value,{value,rest:string2.slice(matchedString.length)}}}function findKey(object,predicate){for(var key in object)if(object.hasOwnProperty(key)&&predicate(object[key]))return key}function findIndex(array,predicate){for(var key=0;key<array.length;key++)if(predicate(array[key]))return key}var matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={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],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]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:function(value){return parseInt(value,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:function(index){return index+1}}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},match_default=match;var locale={code:"en-US",formatDistance,formatLong:formatLong_default,formatRelative,localize:localize_default,match:match_default,options:{weekStartsOn:0,firstWeekContainsDate:1}},en_US_default=locale;function subMilliseconds(dirtyDate,dirtyAmount){requiredArgs(2,arguments);var amount=toInteger(dirtyAmount);return addMilliseconds(dirtyDate,-amount)}function addLeadingZeros(number,targetLength){for(var sign=number<0?"-":"",output=Math.abs(number).toString();output.length<targetLength;)output="0"+output;return sign+output}var formatters={y:function(date,token){var signedYear=date.getUTCFullYear(),year=signedYear>0?signedYear:1-signedYear;return addLeadingZeros(token==="yy"?year%100:year,token.length)},M:function(date,token){var month=date.getUTCMonth();return token==="M"?String(month+1):addLeadingZeros(month+1,2)},d:function(date,token){return addLeadingZeros(date.getUTCDate(),token.length)},a:function(date,token){var dayPeriodEnumValue=date.getUTCHours()/12>=1?"pm":"am";switch(token){case"a":case"aa":return dayPeriodEnumValue.toUpperCase();case"aaa":return dayPeriodEnumValue;case"aaaaa":return dayPeriodEnumValue[0];case"aaaa":default:return dayPeriodEnumValue==="am"?"a.m.":"p.m."}},h:function(date,token){return addLeadingZeros(date.getUTCHours()%12||12,token.length)},H:function(date,token){return addLeadingZeros(date.getUTCHours(),token.length)},m:function(date,token){return addLeadingZeros(date.getUTCMinutes(),token.length)},s:function(date,token){return addLeadingZeros(date.getUTCSeconds(),token.length)},S:function(date,token){var numberOfDigits=token.length,milliseconds=date.getUTCMilliseconds(),fractionalSeconds=Math.floor(milliseconds*Math.pow(10,numberOfDigits-3));return addLeadingZeros(fractionalSeconds,token.length)}},lightFormatters_default=formatters;var MILLISECONDS_IN_DAY=864e5;function getUTCDayOfYear(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),timestamp=date.getTime();date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0);var startOfYearTimestamp=date.getTime(),difference=timestamp-startOfYearTimestamp;return Math.floor(difference/MILLISECONDS_IN_DAY)+1}function startOfUTCISOWeek(dirtyDate){requiredArgs(1,arguments);var weekStartsOn=1,date=toDate(dirtyDate),day=date.getUTCDay(),diff=(day<weekStartsOn?7:0)+day-weekStartsOn;return date.setUTCDate(date.getUTCDate()-diff),date.setUTCHours(0,0,0,0),date}function getUTCISOWeekYear(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),year=date.getUTCFullYear(),fourthOfJanuaryOfNextYear=new Date(0);fourthOfJanuaryOfNextYear.setUTCFullYear(year+1,0,4),fourthOfJanuaryOfNextYear.setUTCHours(0,0,0,0);var startOfNextYear=startOfUTCISOWeek(fourthOfJanuaryOfNextYear),fourthOfJanuaryOfThisYear=new Date(0);fourthOfJanuaryOfThisYear.setUTCFullYear(year,0,4),fourthOfJanuaryOfThisYear.setUTCHours(0,0,0,0);var startOfThisYear=startOfUTCISOWeek(fourthOfJanuaryOfThisYear);return date.getTime()>=startOfNextYear.getTime()?year+1:date.getTime()>=startOfThisYear.getTime()?year:year-1}function startOfUTCISOWeekYear(dirtyDate){requiredArgs(1,arguments);var year=getUTCISOWeekYear(dirtyDate),fourthOfJanuary=new Date(0);fourthOfJanuary.setUTCFullYear(year,0,4),fourthOfJanuary.setUTCHours(0,0,0,0);var date=startOfUTCISOWeek(fourthOfJanuary);return date}var MILLISECONDS_IN_WEEK=6048e5;function getUTCISOWeek(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),diff=startOfUTCISOWeek(date).getTime()-startOfUTCISOWeekYear(date).getTime();return Math.round(diff/MILLISECONDS_IN_WEEK)+1}function startOfUTCWeek(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var options=dirtyOptions||{},locale2=options.locale,localeWeekStartsOn=locale2&&locale2.options&&locale2.options.weekStartsOn,defaultWeekStartsOn=localeWeekStartsOn==null?0:toInteger(localeWeekStartsOn),weekStartsOn=options.weekStartsOn==null?defaultWeekStartsOn:toInteger(options.weekStartsOn);if(!(weekStartsOn>=0&&weekStartsOn<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var date=toDate(dirtyDate),day=date.getUTCDay(),diff=(day<weekStartsOn?7:0)+day-weekStartsOn;return date.setUTCDate(date.getUTCDate()-diff),date.setUTCHours(0,0,0,0),date}function getUTCWeekYear(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var date=toDate(dirtyDate,dirtyOptions),year=date.getUTCFullYear(),options=dirtyOptions||{},locale2=options.locale,localeFirstWeekContainsDate=locale2&&locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate);if(!(firstWeekContainsDate>=1&&firstWeekContainsDate<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var firstWeekOfNextYear=new Date(0);firstWeekOfNextYear.setUTCFullYear(year+1,0,firstWeekContainsDate),firstWeekOfNextYear.setUTCHours(0,0,0,0);var startOfNextYear=startOfUTCWeek(firstWeekOfNextYear,dirtyOptions),firstWeekOfThisYear=new Date(0);firstWeekOfThisYear.setUTCFullYear(year,0,firstWeekContainsDate),firstWeekOfThisYear.setUTCHours(0,0,0,0);var startOfThisYear=startOfUTCWeek(firstWeekOfThisYear,dirtyOptions);return date.getTime()>=startOfNextYear.getTime()?year+1:date.getTime()>=startOfThisYear.getTime()?year:year-1}function startOfUTCWeekYear(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var options=dirtyOptions||{},locale2=options.locale,localeFirstWeekContainsDate=locale2&&locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate),year=getUTCWeekYear(dirtyDate,dirtyOptions),firstWeek=new Date(0);firstWeek.setUTCFullYear(year,0,firstWeekContainsDate),firstWeek.setUTCHours(0,0,0,0);var date=startOfUTCWeek(firstWeek,dirtyOptions);return date}var MILLISECONDS_IN_WEEK2=6048e5;function getUTCWeek(dirtyDate,options){requiredArgs(1,arguments);var date=toDate(dirtyDate),diff=startOfUTCWeek(date,options).getTime()-startOfUTCWeekYear(date,options).getTime();return Math.round(diff/MILLISECONDS_IN_WEEK2)+1}var dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters2={G:function(date,token,localize2){var era=date.getUTCFullYear()>0?1:0;switch(token){case"G":case"GG":case"GGG":return localize2.era(era,{width:"abbreviated"});case"GGGGG":return localize2.era(era,{width:"narrow"});case"GGGG":default:return localize2.era(era,{width:"wide"})}},y:function(date,token,localize2){if(token==="yo"){var signedYear=date.getUTCFullYear(),year=signedYear>0?signedYear:1-signedYear;return localize2.ordinalNumber(year,{unit:"year"})}return lightFormatters_default.y(date,token)},Y:function(date,token,localize2,options){var signedWeekYear=getUTCWeekYear(date,options),weekYear=signedWeekYear>0?signedWeekYear:1-signedWeekYear;if(token==="YY"){var twoDigitYear=weekYear%100;return addLeadingZeros(twoDigitYear,2)}return token==="Yo"?localize2.ordinalNumber(weekYear,{unit:"year"}):addLeadingZeros(weekYear,token.length)},R:function(date,token){var isoWeekYear=getUTCISOWeekYear(date);return addLeadingZeros(isoWeekYear,token.length)},u:function(date,token){var year=date.getUTCFullYear();return addLeadingZeros(year,token.length)},Q:function(date,token,localize2){var quarter=Math.ceil((date.getUTCMonth()+1)/3);switch(token){case"Q":return String(quarter);case"QQ":return addLeadingZeros(quarter,2);case"Qo":return localize2.ordinalNumber(quarter,{unit:"quarter"});case"QQQ":return localize2.quarter(quarter,{width:"abbreviated",context:"formatting"});case"QQQQQ":return localize2.quarter(quarter,{width:"narrow",context:"formatting"});case"QQQQ":default:return localize2.quarter(quarter,{width:"wide",context:"formatting"})}},q:function(date,token,localize2){var quarter=Math.ceil((date.getUTCMonth()+1)/3);switch(token){case"q":return String(quarter);case"qq":return addLeadingZeros(quarter,2);case"qo":return localize2.ordinalNumber(quarter,{unit:"quarter"});case"qqq":return localize2.quarter(quarter,{width:"abbreviated",context:"standalone"});case"qqqqq":return localize2.quarter(quarter,{width:"narrow",context:"standalone"});case"qqqq":default:return localize2.quarter(quarter,{width:"wide",context:"standalone"})}},M:function(date,token,localize2){var month=date.getUTCMonth();switch(token){case"M":case"MM":return lightFormatters_default.M(date,token);case"Mo":return localize2.ordinalNumber(month+1,{unit:"month"});case"MMM":return localize2.month(month,{width:"abbreviated",context:"formatting"});case"MMMMM":return localize2.month(month,{width:"narrow",context:"formatting"});case"MMMM":default:return localize2.month(month,{width:"wide",context:"formatting"})}},L:function(date,token,localize2){var month=date.getUTCMonth();switch(token){case"L":return String(month+1);case"LL":return addLeadingZeros(month+1,2);case"Lo":return localize2.ordinalNumber(month+1,{unit:"month"});case"LLL":return localize2.month(month,{width:"abbreviated",context:"standalone"});case"LLLLL":return localize2.month(month,{width:"narrow",context:"standalone"});case"LLLL":default:return localize2.month(month,{width:"wide",context:"standalone"})}},w:function(date,token,localize2,options){var week=getUTCWeek(date,options);return token==="wo"?localize2.ordinalNumber(week,{unit:"week"}):addLeadingZeros(week,token.length)},I:function(date,token,localize2){var isoWeek=getUTCISOWeek(date);return token==="Io"?localize2.ordinalNumber(isoWeek,{unit:"week"}):addLeadingZeros(isoWeek,token.length)},d:function(date,token,localize2){return token==="do"?localize2.ordinalNumber(date.getUTCDate(),{unit:"date"}):lightFormatters_default.d(date,token)},D:function(date,token,localize2){var dayOfYear=getUTCDayOfYear(date);return token==="Do"?localize2.ordinalNumber(dayOfYear,{unit:"dayOfYear"}):addLeadingZeros(dayOfYear,token.length)},E:function(date,token,localize2){var dayOfWeek=date.getUTCDay();switch(token){case"E":case"EE":case"EEE":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"EEEEE":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"EEEEEE":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"EEEE":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},e:function(date,token,localize2,options){var dayOfWeek=date.getUTCDay(),localDayOfWeek=(dayOfWeek-options.weekStartsOn+8)%7||7;switch(token){case"e":return String(localDayOfWeek);case"ee":return addLeadingZeros(localDayOfWeek,2);case"eo":return localize2.ordinalNumber(localDayOfWeek,{unit:"day"});case"eee":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"eeeee":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"eeeeee":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"eeee":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},c:function(date,token,localize2,options){var dayOfWeek=date.getUTCDay(),localDayOfWeek=(dayOfWeek-options.weekStartsOn+8)%7||7;switch(token){case"c":return String(localDayOfWeek);case"cc":return addLeadingZeros(localDayOfWeek,token.length);case"co":return localize2.ordinalNumber(localDayOfWeek,{unit:"day"});case"ccc":return localize2.day(dayOfWeek,{width:"abbreviated",context:"standalone"});case"ccccc":return localize2.day(dayOfWeek,{width:"narrow",context:"standalone"});case"cccccc":return localize2.day(dayOfWeek,{width:"short",context:"standalone"});case"cccc":default:return localize2.day(dayOfWeek,{width:"wide",context:"standalone"})}},i:function(date,token,localize2){var dayOfWeek=date.getUTCDay(),isoDayOfWeek=dayOfWeek===0?7:dayOfWeek;switch(token){case"i":return String(isoDayOfWeek);case"ii":return addLeadingZeros(isoDayOfWeek,token.length);case"io":return localize2.ordinalNumber(isoDayOfWeek,{unit:"day"});case"iii":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"iiiii":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"iiiiii":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"iiii":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},a:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue=hours/12>=1?"pm":"am";switch(token){case"a":case"aa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"aaa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"aaaa":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},b:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue;switch(hours===12?dayPeriodEnumValue=dayPeriodEnum.noon:hours===0?dayPeriodEnumValue=dayPeriodEnum.midnight:dayPeriodEnumValue=hours/12>=1?"pm":"am",token){case"b":case"bb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"bbb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"bbbb":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},B:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue;switch(hours>=17?dayPeriodEnumValue=dayPeriodEnum.evening:hours>=12?dayPeriodEnumValue=dayPeriodEnum.afternoon:hours>=4?dayPeriodEnumValue=dayPeriodEnum.morning:dayPeriodEnumValue=dayPeriodEnum.night,token){case"B":case"BB":case"BBB":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"BBBBB":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"BBBB":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},h:function(date,token,localize2){if(token==="ho"){var hours=date.getUTCHours()%12;return hours===0&&(hours=12),localize2.ordinalNumber(hours,{unit:"hour"})}return lightFormatters_default.h(date,token)},H:function(date,token,localize2){return token==="Ho"?localize2.ordinalNumber(date.getUTCHours(),{unit:"hour"}):lightFormatters_default.H(date,token)},K:function(date,token,localize2){var hours=date.getUTCHours()%12;return token==="Ko"?localize2.ordinalNumber(hours,{unit:"hour"}):addLeadingZeros(hours,token.length)},k:function(date,token,localize2){var hours=date.getUTCHours();return hours===0&&(hours=24),token==="ko"?localize2.ordinalNumber(hours,{unit:"hour"}):addLeadingZeros(hours,token.length)},m:function(date,token,localize2){return token==="mo"?localize2.ordinalNumber(date.getUTCMinutes(),{unit:"minute"}):lightFormatters_default.m(date,token)},s:function(date,token,localize2){return token==="so"?localize2.ordinalNumber(date.getUTCSeconds(),{unit:"second"}):lightFormatters_default.s(date,token)},S:function(date,token){return lightFormatters_default.S(date,token)},X:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();if(timezoneOffset===0)return"Z";switch(token){case"X":return formatTimezoneWithOptionalMinutes(timezoneOffset);case"XXXX":case"XX":return formatTimezone(timezoneOffset);case"XXXXX":case"XXX":default:return formatTimezone(timezoneOffset,":")}},x:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"x":return formatTimezoneWithOptionalMinutes(timezoneOffset);case"xxxx":case"xx":return formatTimezone(timezoneOffset);case"xxxxx":case"xxx":default:return formatTimezone(timezoneOffset,":")}},O:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(timezoneOffset,":");case"OOOO":default:return"GMT"+formatTimezone(timezoneOffset,":")}},z:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(timezoneOffset,":");case"zzzz":default:return"GMT"+formatTimezone(timezoneOffset,":")}},t:function(date,token,_localize,options){var originalDate=options._originalDate||date,timestamp=Math.floor(originalDate.getTime()/1e3);return addLeadingZeros(timestamp,token.length)},T:function(date,token,_localize,options){var originalDate=options._originalDate||date,timestamp=originalDate.getTime();return addLeadingZeros(timestamp,token.length)}};function formatTimezoneShort(offset,dirtyDelimiter){var sign=offset>0?"-":"+",absOffset=Math.abs(offset),hours=Math.floor(absOffset/60),minutes=absOffset%60;if(minutes===0)return sign+String(hours);var delimiter=dirtyDelimiter||"";return sign+String(hours)+delimiter+addLeadingZeros(minutes,2)}function formatTimezoneWithOptionalMinutes(offset,dirtyDelimiter){if(offset%60===0){var sign=offset>0?"-":"+";return sign+addLeadingZeros(Math.abs(offset)/60,2)}return formatTimezone(offset,dirtyDelimiter)}function formatTimezone(offset,dirtyDelimiter){var delimiter=dirtyDelimiter||"",sign=offset>0?"-":"+",absOffset=Math.abs(offset),hours=addLeadingZeros(Math.floor(absOffset/60),2),minutes=addLeadingZeros(absOffset%60,2);return sign+hours+delimiter+minutes}var formatters_default=formatters2;function dateLongFormatter(pattern,formatLong2){switch(pattern){case"P":return formatLong2.date({width:"short"});case"PP":return formatLong2.date({width:"medium"});case"PPP":return formatLong2.date({width:"long"});case"PPPP":default:return formatLong2.date({width:"full"})}}function timeLongFormatter(pattern,formatLong2){switch(pattern){case"p":return formatLong2.time({width:"short"});case"pp":return formatLong2.time({width:"medium"});case"ppp":return formatLong2.time({width:"long"});case"pppp":default:return formatLong2.time({width:"full"})}}function dateTimeLongFormatter(pattern,formatLong2){var matchResult=pattern.match(/(P+)(p+)?/),datePattern=matchResult[1],timePattern=matchResult[2];if(!timePattern)return dateLongFormatter(pattern,formatLong2);var dateTimeFormat;switch(datePattern){case"P":dateTimeFormat=formatLong2.dateTime({width:"short"});break;case"PP":dateTimeFormat=formatLong2.dateTime({width:"medium"});break;case"PPP":dateTimeFormat=formatLong2.dateTime({width:"long"});break;case"PPPP":default:dateTimeFormat=formatLong2.dateTime({width:"full"});break}return dateTimeFormat.replace("{{date}}",dateLongFormatter(datePattern,formatLong2)).replace("{{time}}",timeLongFormatter(timePattern,formatLong2))}var longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},longFormatters_default=longFormatters;var protectedDayOfYearTokens=["D","DD"],protectedWeekYearTokens=["YY","YYYY"];function isProtectedDayOfYearToken(token){return protectedDayOfYearTokens.indexOf(token)!==-1}function isProtectedWeekYearToken(token){return protectedWeekYearTokens.indexOf(token)!==-1}function throwProtectedError(token,format2,input){if(token==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2,"`) for formatting years to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2,"`) for formatting years to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(format2,"`) for formatting days of the month to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2,"`) for formatting days of the month to the input `").concat(input,"`; see: https://git.io/fxCyr"))}var formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function format(dirtyDate,dirtyFormatStr,dirtyOptions){requiredArgs(2,arguments);var formatStr=String(dirtyFormatStr),options=dirtyOptions||{},locale2=options.locale||en_US_default,localeFirstWeekContainsDate=locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate);if(!(firstWeekContainsDate>=1&&firstWeekContainsDate<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var localeWeekStartsOn=locale2.options&&locale2.options.weekStartsOn,defaultWeekStartsOn=localeWeekStartsOn==null?0:toInteger(localeWeekStartsOn),weekStartsOn=options.weekStartsOn==null?defaultWeekStartsOn:toInteger(options.weekStartsOn);if(!(weekStartsOn>=0&&weekStartsOn<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!locale2.localize)throw new RangeError("locale must contain localize property");if(!locale2.formatLong)throw new RangeError("locale must contain formatLong property");var originalDate=toDate(dirtyDate);if(!isValid(originalDate))throw new RangeError("Invalid time value");var timezoneOffset=getTimezoneOffsetInMilliseconds(originalDate),utcDate=subMilliseconds(originalDate,timezoneOffset),formatterOptions={firstWeekContainsDate,weekStartsOn,locale:locale2,_originalDate:originalDate},result=formatStr.match(longFormattingTokensRegExp).map(function(substring){var firstCharacter=substring[0];if(firstCharacter==="p"||firstCharacter==="P"){var longFormatter=longFormatters_default[firstCharacter];return longFormatter(substring,locale2.formatLong,formatterOptions)}return substring}).join("").match(formattingTokensRegExp).map(function(substring){if(substring==="''")return"'";var firstCharacter=substring[0];if(firstCharacter==="'")return cleanEscapedString(substring);var formatter=formatters_default[firstCharacter];if(formatter)return!options.useAdditionalWeekYearTokens&&isProtectedWeekYearToken(substring)&&throwProtectedError(substring,dirtyFormatStr,dirtyDate),!options.useAdditionalDayOfYearTokens&&isProtectedDayOfYearToken(substring)&&throwProtectedError(substring,dirtyFormatStr,dirtyDate),formatter(utcDate,substring,locale2.localize,formatterOptions);if(firstCharacter.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+firstCharacter+"`");return substring}).join("");return result}function cleanEscapedString(input){return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}var DATE_REGEX=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,NEUTRAL_TIME="T12:00:00-00:00",formatReturnDate=(dateValue,dateFormat)=>{if(dateValue.match(DATE_REGEX)){let datePlusNoonUTC=new Date(dateValue.concat(NEUTRAL_TIME));return format(datePlusNoonUTC,dateFormat)}throw new Error("[Paste Date Picker]: Please make sure dateValue string matches YYYY-MM-DD format")};0&&(module.exports={DatePicker,formatReturnDate});
"use strict";var __create=Object.create;var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b));var __objRest=(source,exclude)=>{var target={};for(var prop in source)__hasOwnProp.call(source,prop)&&exclude.indexOf(prop)<0&&(target[prop]=source[prop]);if(source!=null&&__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(source))exclude.indexOf(prop)<0&&__propIsEnum.call(source,prop)&&(target[prop]=source[prop]);return target};var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var src_exports={};__export(src_exports,{DatePicker:()=>DatePicker,formatReturnDate:()=>formatReturnDate});module.exports=__toCommonJS(src_exports);var React=__toESM(require("react")),import_prop_types=__toESM(require("prop-types")),import_input=require("@twilio-paste/input");var DatePicker=React.forwardRef((_a,ref)=>{var _b=_a,{element="DATEPICKER"}=_b,props=__objRest(_b,["element"]);return React.createElement(import_input.Input,__spreadProps(__spreadValues({element},props),{type:"date",ref}))});DatePicker.displayName="DatePicker";DatePicker.propTypes={disabled:import_prop_types.default.bool,element:import_prop_types.default.string,hasError:import_prop_types.default.bool,id:import_prop_types.default.string,name:import_prop_types.default.string,onBlur:import_prop_types.default.func,onChange:import_prop_types.default.func,onFocus:import_prop_types.default.func,placeholder:import_prop_types.default.string,readOnly:import_prop_types.default.bool,required:import_prop_types.default.bool,value:import_prop_types.default.string};function toInteger(dirtyNumber){if(dirtyNumber===null||dirtyNumber===!0||dirtyNumber===!1)return NaN;var number=Number(dirtyNumber);return isNaN(number)?number:number<0?Math.ceil(number):Math.floor(number)}function requiredArgs(required,args){if(args.length<required)throw new TypeError(required+" argument"+(required>1?"s":"")+" required, but only "+args.length+" present")}function toDate(argument){requiredArgs(1,arguments);var argStr=Object.prototype.toString.call(argument);return argument instanceof Date||typeof argument=="object"&&argStr==="[object Date]"?new Date(argument.getTime()):typeof argument=="number"||argStr==="[object Number]"?new Date(argument):((typeof argument=="string"||argStr==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function addMilliseconds(dirtyDate,dirtyAmount){requiredArgs(2,arguments);var timestamp=toDate(dirtyDate).getTime(),amount=toInteger(dirtyAmount);return new Date(timestamp+amount)}function getTimezoneOffsetInMilliseconds(date){var utcDate=new Date(Date.UTC(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds()));return utcDate.setUTCFullYear(date.getFullYear()),date.getTime()-utcDate.getTime()}function isValid(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate);return!isNaN(date)}var formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function formatDistance(token,count,options){options=options||{};var result;return typeof formatDistanceLocale[token]=="string"?result=formatDistanceLocale[token]:count===1?result=formatDistanceLocale[token].one:result=formatDistanceLocale[token].other.replace("{{count}}",count),options.addSuffix?options.comparison>0?"in "+result:result+" ago":result}function buildFormatLongFn(args){return function(dirtyOptions){var options=dirtyOptions||{},width=options.width?String(options.width):args.defaultWidth,format2=args.formats[width]||args.formats[args.defaultWidth];return format2}}var dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatLong_default=formatLong;var formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function formatRelative(token,_date,_baseDate,_options){return formatRelativeLocale[token]}function buildLocalizeFn(args){return function(dirtyIndex,dirtyOptions){var options=dirtyOptions||{},context=options.context?String(options.context):"standalone",valuesArray;if(context==="formatting"&&args.formattingValues){var defaultWidth=args.defaultFormattingWidth||args.defaultWidth,width=options.width?String(options.width):defaultWidth;valuesArray=args.formattingValues[width]||args.formattingValues[defaultWidth]}else{var _defaultWidth=args.defaultWidth,_width=options.width?String(options.width):args.defaultWidth;valuesArray=args.values[_width]||args.values[_defaultWidth]}var index=args.argumentCallback?args.argumentCallback(dirtyIndex):dirtyIndex;return valuesArray[index]}}var eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}};function ordinalNumber(dirtyNumber,_dirtyOptions){var number=Number(dirtyNumber),rem100=number%100;if(rem100>20||rem100<10)switch(rem100%10){case 1:return number+"st";case 2:return number+"nd";case 3:return number+"rd"}return number+"th"}var localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:function(quarter){return Number(quarter)-1}}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})},localize_default=localize;function buildMatchPatternFn(args){return function(dirtyString,dirtyOptions){var string=String(dirtyString),options=dirtyOptions||{},matchResult=string.match(args.matchPattern);if(!matchResult)return null;var matchedString=matchResult[0],parseResult=string.match(args.parsePattern);if(!parseResult)return null;var value=args.valueCallback?args.valueCallback(parseResult[0]):parseResult[0];return value=options.valueCallback?options.valueCallback(value):value,{value,rest:string.slice(matchedString.length)}}}function buildMatchFn(args){return function(dirtyString,dirtyOptions){var string=String(dirtyString),options=dirtyOptions||{},width=options.width,matchPattern=width&&args.matchPatterns[width]||args.matchPatterns[args.defaultMatchWidth],matchResult=string.match(matchPattern);if(!matchResult)return null;var matchedString=matchResult[0],parsePatterns=width&&args.parsePatterns[width]||args.parsePatterns[args.defaultParseWidth],value;return Object.prototype.toString.call(parsePatterns)==="[object Array]"?value=findIndex(parsePatterns,function(pattern){return pattern.test(matchedString)}):value=findKey(parsePatterns,function(pattern){return pattern.test(matchedString)}),value=args.valueCallback?args.valueCallback(value):value,value=options.valueCallback?options.valueCallback(value):value,{value,rest:string.slice(matchedString.length)}}}function findKey(object,predicate){for(var key in object)if(object.hasOwnProperty(key)&&predicate(object[key]))return key}function findIndex(array,predicate){for(var key=0;key<array.length;key++)if(predicate(array[key]))return key}var matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={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],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]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:function(value){return parseInt(value,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:function(index){return index+1}}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},match_default=match;var locale={code:"en-US",formatDistance,formatLong:formatLong_default,formatRelative,localize:localize_default,match:match_default,options:{weekStartsOn:0,firstWeekContainsDate:1}},en_US_default=locale;function subMilliseconds(dirtyDate,dirtyAmount){requiredArgs(2,arguments);var amount=toInteger(dirtyAmount);return addMilliseconds(dirtyDate,-amount)}function addLeadingZeros(number,targetLength){for(var sign=number<0?"-":"",output=Math.abs(number).toString();output.length<targetLength;)output="0"+output;return sign+output}var formatters={y:function(date,token){var signedYear=date.getUTCFullYear(),year=signedYear>0?signedYear:1-signedYear;return addLeadingZeros(token==="yy"?year%100:year,token.length)},M:function(date,token){var month=date.getUTCMonth();return token==="M"?String(month+1):addLeadingZeros(month+1,2)},d:function(date,token){return addLeadingZeros(date.getUTCDate(),token.length)},a:function(date,token){var dayPeriodEnumValue=date.getUTCHours()/12>=1?"pm":"am";switch(token){case"a":case"aa":return dayPeriodEnumValue.toUpperCase();case"aaa":return dayPeriodEnumValue;case"aaaaa":return dayPeriodEnumValue[0];case"aaaa":default:return dayPeriodEnumValue==="am"?"a.m.":"p.m."}},h:function(date,token){return addLeadingZeros(date.getUTCHours()%12||12,token.length)},H:function(date,token){return addLeadingZeros(date.getUTCHours(),token.length)},m:function(date,token){return addLeadingZeros(date.getUTCMinutes(),token.length)},s:function(date,token){return addLeadingZeros(date.getUTCSeconds(),token.length)},S:function(date,token){var numberOfDigits=token.length,milliseconds=date.getUTCMilliseconds(),fractionalSeconds=Math.floor(milliseconds*Math.pow(10,numberOfDigits-3));return addLeadingZeros(fractionalSeconds,token.length)}},lightFormatters_default=formatters;var MILLISECONDS_IN_DAY=864e5;function getUTCDayOfYear(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),timestamp=date.getTime();date.setUTCMonth(0,1),date.setUTCHours(0,0,0,0);var startOfYearTimestamp=date.getTime(),difference=timestamp-startOfYearTimestamp;return Math.floor(difference/MILLISECONDS_IN_DAY)+1}function startOfUTCISOWeek(dirtyDate){requiredArgs(1,arguments);var weekStartsOn=1,date=toDate(dirtyDate),day=date.getUTCDay(),diff=(day<weekStartsOn?7:0)+day-weekStartsOn;return date.setUTCDate(date.getUTCDate()-diff),date.setUTCHours(0,0,0,0),date}function getUTCISOWeekYear(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),year=date.getUTCFullYear(),fourthOfJanuaryOfNextYear=new Date(0);fourthOfJanuaryOfNextYear.setUTCFullYear(year+1,0,4),fourthOfJanuaryOfNextYear.setUTCHours(0,0,0,0);var startOfNextYear=startOfUTCISOWeek(fourthOfJanuaryOfNextYear),fourthOfJanuaryOfThisYear=new Date(0);fourthOfJanuaryOfThisYear.setUTCFullYear(year,0,4),fourthOfJanuaryOfThisYear.setUTCHours(0,0,0,0);var startOfThisYear=startOfUTCISOWeek(fourthOfJanuaryOfThisYear);return date.getTime()>=startOfNextYear.getTime()?year+1:date.getTime()>=startOfThisYear.getTime()?year:year-1}function startOfUTCISOWeekYear(dirtyDate){requiredArgs(1,arguments);var year=getUTCISOWeekYear(dirtyDate),fourthOfJanuary=new Date(0);fourthOfJanuary.setUTCFullYear(year,0,4),fourthOfJanuary.setUTCHours(0,0,0,0);var date=startOfUTCISOWeek(fourthOfJanuary);return date}var MILLISECONDS_IN_WEEK=6048e5;function getUTCISOWeek(dirtyDate){requiredArgs(1,arguments);var date=toDate(dirtyDate),diff=startOfUTCISOWeek(date).getTime()-startOfUTCISOWeekYear(date).getTime();return Math.round(diff/MILLISECONDS_IN_WEEK)+1}function startOfUTCWeek(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var options=dirtyOptions||{},locale2=options.locale,localeWeekStartsOn=locale2&&locale2.options&&locale2.options.weekStartsOn,defaultWeekStartsOn=localeWeekStartsOn==null?0:toInteger(localeWeekStartsOn),weekStartsOn=options.weekStartsOn==null?defaultWeekStartsOn:toInteger(options.weekStartsOn);if(!(weekStartsOn>=0&&weekStartsOn<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var date=toDate(dirtyDate),day=date.getUTCDay(),diff=(day<weekStartsOn?7:0)+day-weekStartsOn;return date.setUTCDate(date.getUTCDate()-diff),date.setUTCHours(0,0,0,0),date}function getUTCWeekYear(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var date=toDate(dirtyDate,dirtyOptions),year=date.getUTCFullYear(),options=dirtyOptions||{},locale2=options.locale,localeFirstWeekContainsDate=locale2&&locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate);if(!(firstWeekContainsDate>=1&&firstWeekContainsDate<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var firstWeekOfNextYear=new Date(0);firstWeekOfNextYear.setUTCFullYear(year+1,0,firstWeekContainsDate),firstWeekOfNextYear.setUTCHours(0,0,0,0);var startOfNextYear=startOfUTCWeek(firstWeekOfNextYear,dirtyOptions),firstWeekOfThisYear=new Date(0);firstWeekOfThisYear.setUTCFullYear(year,0,firstWeekContainsDate),firstWeekOfThisYear.setUTCHours(0,0,0,0);var startOfThisYear=startOfUTCWeek(firstWeekOfThisYear,dirtyOptions);return date.getTime()>=startOfNextYear.getTime()?year+1:date.getTime()>=startOfThisYear.getTime()?year:year-1}function startOfUTCWeekYear(dirtyDate,dirtyOptions){requiredArgs(1,arguments);var options=dirtyOptions||{},locale2=options.locale,localeFirstWeekContainsDate=locale2&&locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate),year=getUTCWeekYear(dirtyDate,dirtyOptions),firstWeek=new Date(0);firstWeek.setUTCFullYear(year,0,firstWeekContainsDate),firstWeek.setUTCHours(0,0,0,0);var date=startOfUTCWeek(firstWeek,dirtyOptions);return date}var MILLISECONDS_IN_WEEK2=6048e5;function getUTCWeek(dirtyDate,options){requiredArgs(1,arguments);var date=toDate(dirtyDate),diff=startOfUTCWeek(date,options).getTime()-startOfUTCWeekYear(date,options).getTime();return Math.round(diff/MILLISECONDS_IN_WEEK2)+1}var dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters2={G:function(date,token,localize2){var era=date.getUTCFullYear()>0?1:0;switch(token){case"G":case"GG":case"GGG":return localize2.era(era,{width:"abbreviated"});case"GGGGG":return localize2.era(era,{width:"narrow"});case"GGGG":default:return localize2.era(era,{width:"wide"})}},y:function(date,token,localize2){if(token==="yo"){var signedYear=date.getUTCFullYear(),year=signedYear>0?signedYear:1-signedYear;return localize2.ordinalNumber(year,{unit:"year"})}return lightFormatters_default.y(date,token)},Y:function(date,token,localize2,options){var signedWeekYear=getUTCWeekYear(date,options),weekYear=signedWeekYear>0?signedWeekYear:1-signedWeekYear;if(token==="YY"){var twoDigitYear=weekYear%100;return addLeadingZeros(twoDigitYear,2)}return token==="Yo"?localize2.ordinalNumber(weekYear,{unit:"year"}):addLeadingZeros(weekYear,token.length)},R:function(date,token){var isoWeekYear=getUTCISOWeekYear(date);return addLeadingZeros(isoWeekYear,token.length)},u:function(date,token){var year=date.getUTCFullYear();return addLeadingZeros(year,token.length)},Q:function(date,token,localize2){var quarter=Math.ceil((date.getUTCMonth()+1)/3);switch(token){case"Q":return String(quarter);case"QQ":return addLeadingZeros(quarter,2);case"Qo":return localize2.ordinalNumber(quarter,{unit:"quarter"});case"QQQ":return localize2.quarter(quarter,{width:"abbreviated",context:"formatting"});case"QQQQQ":return localize2.quarter(quarter,{width:"narrow",context:"formatting"});case"QQQQ":default:return localize2.quarter(quarter,{width:"wide",context:"formatting"})}},q:function(date,token,localize2){var quarter=Math.ceil((date.getUTCMonth()+1)/3);switch(token){case"q":return String(quarter);case"qq":return addLeadingZeros(quarter,2);case"qo":return localize2.ordinalNumber(quarter,{unit:"quarter"});case"qqq":return localize2.quarter(quarter,{width:"abbreviated",context:"standalone"});case"qqqqq":return localize2.quarter(quarter,{width:"narrow",context:"standalone"});case"qqqq":default:return localize2.quarter(quarter,{width:"wide",context:"standalone"})}},M:function(date,token,localize2){var month=date.getUTCMonth();switch(token){case"M":case"MM":return lightFormatters_default.M(date,token);case"Mo":return localize2.ordinalNumber(month+1,{unit:"month"});case"MMM":return localize2.month(month,{width:"abbreviated",context:"formatting"});case"MMMMM":return localize2.month(month,{width:"narrow",context:"formatting"});case"MMMM":default:return localize2.month(month,{width:"wide",context:"formatting"})}},L:function(date,token,localize2){var month=date.getUTCMonth();switch(token){case"L":return String(month+1);case"LL":return addLeadingZeros(month+1,2);case"Lo":return localize2.ordinalNumber(month+1,{unit:"month"});case"LLL":return localize2.month(month,{width:"abbreviated",context:"standalone"});case"LLLLL":return localize2.month(month,{width:"narrow",context:"standalone"});case"LLLL":default:return localize2.month(month,{width:"wide",context:"standalone"})}},w:function(date,token,localize2,options){var week=getUTCWeek(date,options);return token==="wo"?localize2.ordinalNumber(week,{unit:"week"}):addLeadingZeros(week,token.length)},I:function(date,token,localize2){var isoWeek=getUTCISOWeek(date);return token==="Io"?localize2.ordinalNumber(isoWeek,{unit:"week"}):addLeadingZeros(isoWeek,token.length)},d:function(date,token,localize2){return token==="do"?localize2.ordinalNumber(date.getUTCDate(),{unit:"date"}):lightFormatters_default.d(date,token)},D:function(date,token,localize2){var dayOfYear=getUTCDayOfYear(date);return token==="Do"?localize2.ordinalNumber(dayOfYear,{unit:"dayOfYear"}):addLeadingZeros(dayOfYear,token.length)},E:function(date,token,localize2){var dayOfWeek=date.getUTCDay();switch(token){case"E":case"EE":case"EEE":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"EEEEE":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"EEEEEE":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"EEEE":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},e:function(date,token,localize2,options){var dayOfWeek=date.getUTCDay(),localDayOfWeek=(dayOfWeek-options.weekStartsOn+8)%7||7;switch(token){case"e":return String(localDayOfWeek);case"ee":return addLeadingZeros(localDayOfWeek,2);case"eo":return localize2.ordinalNumber(localDayOfWeek,{unit:"day"});case"eee":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"eeeee":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"eeeeee":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"eeee":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},c:function(date,token,localize2,options){var dayOfWeek=date.getUTCDay(),localDayOfWeek=(dayOfWeek-options.weekStartsOn+8)%7||7;switch(token){case"c":return String(localDayOfWeek);case"cc":return addLeadingZeros(localDayOfWeek,token.length);case"co":return localize2.ordinalNumber(localDayOfWeek,{unit:"day"});case"ccc":return localize2.day(dayOfWeek,{width:"abbreviated",context:"standalone"});case"ccccc":return localize2.day(dayOfWeek,{width:"narrow",context:"standalone"});case"cccccc":return localize2.day(dayOfWeek,{width:"short",context:"standalone"});case"cccc":default:return localize2.day(dayOfWeek,{width:"wide",context:"standalone"})}},i:function(date,token,localize2){var dayOfWeek=date.getUTCDay(),isoDayOfWeek=dayOfWeek===0?7:dayOfWeek;switch(token){case"i":return String(isoDayOfWeek);case"ii":return addLeadingZeros(isoDayOfWeek,token.length);case"io":return localize2.ordinalNumber(isoDayOfWeek,{unit:"day"});case"iii":return localize2.day(dayOfWeek,{width:"abbreviated",context:"formatting"});case"iiiii":return localize2.day(dayOfWeek,{width:"narrow",context:"formatting"});case"iiiiii":return localize2.day(dayOfWeek,{width:"short",context:"formatting"});case"iiii":default:return localize2.day(dayOfWeek,{width:"wide",context:"formatting"})}},a:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue=hours/12>=1?"pm":"am";switch(token){case"a":case"aa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"aaa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"aaaa":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},b:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue;switch(hours===12?dayPeriodEnumValue=dayPeriodEnum.noon:hours===0?dayPeriodEnumValue=dayPeriodEnum.midnight:dayPeriodEnumValue=hours/12>=1?"pm":"am",token){case"b":case"bb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"bbb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"bbbb":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},B:function(date,token,localize2){var hours=date.getUTCHours(),dayPeriodEnumValue;switch(hours>=17?dayPeriodEnumValue=dayPeriodEnum.evening:hours>=12?dayPeriodEnumValue=dayPeriodEnum.afternoon:hours>=4?dayPeriodEnumValue=dayPeriodEnum.morning:dayPeriodEnumValue=dayPeriodEnum.night,token){case"B":case"BB":case"BBB":return localize2.dayPeriod(dayPeriodEnumValue,{width:"abbreviated",context:"formatting"});case"BBBBB":return localize2.dayPeriod(dayPeriodEnumValue,{width:"narrow",context:"formatting"});case"BBBB":default:return localize2.dayPeriod(dayPeriodEnumValue,{width:"wide",context:"formatting"})}},h:function(date,token,localize2){if(token==="ho"){var hours=date.getUTCHours()%12;return hours===0&&(hours=12),localize2.ordinalNumber(hours,{unit:"hour"})}return lightFormatters_default.h(date,token)},H:function(date,token,localize2){return token==="Ho"?localize2.ordinalNumber(date.getUTCHours(),{unit:"hour"}):lightFormatters_default.H(date,token)},K:function(date,token,localize2){var hours=date.getUTCHours()%12;return token==="Ko"?localize2.ordinalNumber(hours,{unit:"hour"}):addLeadingZeros(hours,token.length)},k:function(date,token,localize2){var hours=date.getUTCHours();return hours===0&&(hours=24),token==="ko"?localize2.ordinalNumber(hours,{unit:"hour"}):addLeadingZeros(hours,token.length)},m:function(date,token,localize2){return token==="mo"?localize2.ordinalNumber(date.getUTCMinutes(),{unit:"minute"}):lightFormatters_default.m(date,token)},s:function(date,token,localize2){return token==="so"?localize2.ordinalNumber(date.getUTCSeconds(),{unit:"second"}):lightFormatters_default.s(date,token)},S:function(date,token){return lightFormatters_default.S(date,token)},X:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();if(timezoneOffset===0)return"Z";switch(token){case"X":return formatTimezoneWithOptionalMinutes(timezoneOffset);case"XXXX":case"XX":return formatTimezone(timezoneOffset);case"XXXXX":case"XXX":default:return formatTimezone(timezoneOffset,":")}},x:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"x":return formatTimezoneWithOptionalMinutes(timezoneOffset);case"xxxx":case"xx":return formatTimezone(timezoneOffset);case"xxxxx":case"xxx":default:return formatTimezone(timezoneOffset,":")}},O:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(timezoneOffset,":");case"OOOO":default:return"GMT"+formatTimezone(timezoneOffset,":")}},z:function(date,token,_localize,options){var originalDate=options._originalDate||date,timezoneOffset=originalDate.getTimezoneOffset();switch(token){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(timezoneOffset,":");case"zzzz":default:return"GMT"+formatTimezone(timezoneOffset,":")}},t:function(date,token,_localize,options){var originalDate=options._originalDate||date,timestamp=Math.floor(originalDate.getTime()/1e3);return addLeadingZeros(timestamp,token.length)},T:function(date,token,_localize,options){var originalDate=options._originalDate||date,timestamp=originalDate.getTime();return addLeadingZeros(timestamp,token.length)}};function formatTimezoneShort(offset,dirtyDelimiter){var sign=offset>0?"-":"+",absOffset=Math.abs(offset),hours=Math.floor(absOffset/60),minutes=absOffset%60;if(minutes===0)return sign+String(hours);var delimiter=dirtyDelimiter||"";return sign+String(hours)+delimiter+addLeadingZeros(minutes,2)}function formatTimezoneWithOptionalMinutes(offset,dirtyDelimiter){if(offset%60===0){var sign=offset>0?"-":"+";return sign+addLeadingZeros(Math.abs(offset)/60,2)}return formatTimezone(offset,dirtyDelimiter)}function formatTimezone(offset,dirtyDelimiter){var delimiter=dirtyDelimiter||"",sign=offset>0?"-":"+",absOffset=Math.abs(offset),hours=addLeadingZeros(Math.floor(absOffset/60),2),minutes=addLeadingZeros(absOffset%60,2);return sign+hours+delimiter+minutes}var formatters_default=formatters2;function dateLongFormatter(pattern,formatLong2){switch(pattern){case"P":return formatLong2.date({width:"short"});case"PP":return formatLong2.date({width:"medium"});case"PPP":return formatLong2.date({width:"long"});case"PPPP":default:return formatLong2.date({width:"full"})}}function timeLongFormatter(pattern,formatLong2){switch(pattern){case"p":return formatLong2.time({width:"short"});case"pp":return formatLong2.time({width:"medium"});case"ppp":return formatLong2.time({width:"long"});case"pppp":default:return formatLong2.time({width:"full"})}}function dateTimeLongFormatter(pattern,formatLong2){var matchResult=pattern.match(/(P+)(p+)?/),datePattern=matchResult[1],timePattern=matchResult[2];if(!timePattern)return dateLongFormatter(pattern,formatLong2);var dateTimeFormat;switch(datePattern){case"P":dateTimeFormat=formatLong2.dateTime({width:"short"});break;case"PP":dateTimeFormat=formatLong2.dateTime({width:"medium"});break;case"PPP":dateTimeFormat=formatLong2.dateTime({width:"long"});break;case"PPPP":default:dateTimeFormat=formatLong2.dateTime({width:"full"});break}return dateTimeFormat.replace("{{date}}",dateLongFormatter(datePattern,formatLong2)).replace("{{time}}",timeLongFormatter(timePattern,formatLong2))}var longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},longFormatters_default=longFormatters;var protectedDayOfYearTokens=["D","DD"],protectedWeekYearTokens=["YY","YYYY"];function isProtectedDayOfYearToken(token){return protectedDayOfYearTokens.indexOf(token)!==-1}function isProtectedWeekYearToken(token){return protectedWeekYearTokens.indexOf(token)!==-1}function throwProtectedError(token,format2,input){if(token==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2,"`) for formatting years to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2,"`) for formatting years to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(format2,"`) for formatting days of the month to the input `").concat(input,"`; see: https://git.io/fxCyr"));if(token==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2,"`) for formatting days of the month to the input `").concat(input,"`; see: https://git.io/fxCyr"))}var formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function format(dirtyDate,dirtyFormatStr,dirtyOptions){requiredArgs(2,arguments);var formatStr=String(dirtyFormatStr),options=dirtyOptions||{},locale2=options.locale||en_US_default,localeFirstWeekContainsDate=locale2.options&&locale2.options.firstWeekContainsDate,defaultFirstWeekContainsDate=localeFirstWeekContainsDate==null?1:toInteger(localeFirstWeekContainsDate),firstWeekContainsDate=options.firstWeekContainsDate==null?defaultFirstWeekContainsDate:toInteger(options.firstWeekContainsDate);if(!(firstWeekContainsDate>=1&&firstWeekContainsDate<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var localeWeekStartsOn=locale2.options&&locale2.options.weekStartsOn,defaultWeekStartsOn=localeWeekStartsOn==null?0:toInteger(localeWeekStartsOn),weekStartsOn=options.weekStartsOn==null?defaultWeekStartsOn:toInteger(options.weekStartsOn);if(!(weekStartsOn>=0&&weekStartsOn<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!locale2.localize)throw new RangeError("locale must contain localize property");if(!locale2.formatLong)throw new RangeError("locale must contain formatLong property");var originalDate=toDate(dirtyDate);if(!isValid(originalDate))throw new RangeError("Invalid time value");var timezoneOffset=getTimezoneOffsetInMilliseconds(originalDate),utcDate=subMilliseconds(originalDate,timezoneOffset),formatterOptions={firstWeekContainsDate,weekStartsOn,locale:locale2,_originalDate:originalDate},result=formatStr.match(longFormattingTokensRegExp).map(function(substring){var firstCharacter=substring[0];if(firstCharacter==="p"||firstCharacter==="P"){var longFormatter=longFormatters_default[firstCharacter];return longFormatter(substring,locale2.formatLong,formatterOptions)}return substring}).join("").match(formattingTokensRegExp).map(function(substring){if(substring==="''")return"'";var firstCharacter=substring[0];if(firstCharacter==="'")return cleanEscapedString(substring);var formatter=formatters_default[firstCharacter];if(formatter)return!options.useAdditionalWeekYearTokens&&isProtectedWeekYearToken(substring)&&throwProtectedError(substring,dirtyFormatStr,dirtyDate),!options.useAdditionalDayOfYearTokens&&isProtectedDayOfYearToken(substring)&&throwProtectedError(substring,dirtyFormatStr,dirtyDate),formatter(utcDate,substring,locale2.localize,formatterOptions);if(firstCharacter.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+firstCharacter+"`");return substring}).join("");return result}function cleanEscapedString(input){return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}var DATE_REGEX=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,NEUTRAL_TIME="T12:00:00-00:00",formatReturnDate=(dateValue,dateFormat)=>{if(dateValue.match(DATE_REGEX)){let datePlusNoonUTC=new Date(dateValue.concat(NEUTRAL_TIME));return format(datePlusNoonUTC,dateFormat)}throw new Error("[Paste Date Picker]: Please make sure dateValue string matches YYYY-MM-DD format")};0&&(module.exports={DatePicker,formatReturnDate});
/**
* dateValue must follow the format: 'YYYY-MM-DD'
*/
declare type DateValueType = string;
type DateValueType = string;
/**
* follow https://date-fns.org/v2.21.3/docs/format to define date format
*/
declare type DateFormatType = string;
type DateFormatType = string;
/**

@@ -10,0 +10,0 @@ * formatReturnDate formats a dateValue string of type 'YYYY-MM-DD' to a pre-defined dateFormat

{
"name": "@twilio-paste/date-picker",
"version": "3.0.1",
"version": "3.0.2",
"category": "user input",

@@ -45,7 +45,7 @@ "status": "production",

"devDependencies": {
"@twilio-paste/box": "^7.1.1",
"@twilio-paste/design-tokens": "^8.1.2",
"@twilio-paste/input": "^6.1.1",
"@twilio-paste/input-box": "^7.1.2",
"@twilio-paste/style-props": "^6.1.1",
"@twilio-paste/box": "^7.1.2",
"@twilio-paste/design-tokens": "^8.3.0",
"@twilio-paste/input": "^6.1.2",
"@twilio-paste/input-box": "^7.1.3",
"@twilio-paste/style-props": "^6.1.2",
"@twilio-paste/styling-library": "^1.0.3",

@@ -52,0 +52,0 @@ "@twilio-paste/theme": "^8.0.3",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc