<commit_before>/*! flatpickr v2.2.5, @license MIT */
function Flatpickr(element, config) {
	const self = this;

	function init() {
		if (element._flatpickr)
			destroy(element._flatpickr);

		element._flatpickr = self;

		self.element = element;
		self.instanceConfig = config || {};

		setupFormats();

		parseConfig();
		setupLocale();
		setupInputs();
		setupDates();

		setupHelperFunctions();

		self.isOpen = self.config.inline;
		self.changeMonth = changeMonth;
		self.clear = clear;
		self.close = close;
		self.destroy = destroy;
		self.formatDate = formatDate;
		self.jumpToDate = jumpToDate;
		self.open = open;
		self.redraw = redraw;
		self.set = set;
		self.setDate = setDate;
		self.toggle = toggle;

		self.isMobile = (
			!self.config.disableMobile &&
			!self.config.inline &&
			self.config.mode === "single" &&
			!self.config.disable.length &&
			!self.config.enable.length &&
			/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
		);

		if (!self.isMobile)
			build();

		bind();

		self.minDateHasTime = self.config.minDate && (
			self.config.minDate.getHours()
			|| self.config.minDate.getMinutes()
			|| self.config.minDate.getSeconds()
		);

		self.maxDateHasTime = self.config.maxDate && (
			self.config.maxDate.getHours()
			|| self.config.maxDate.getMinutes()
			|| self.config.maxDate.getSeconds()
		);

		if (!self.isMobile) {
			Object.defineProperty(self, "dateIsPicked", {
				set: function(bool) {
					if (bool)
						return self.calendarContainer.classList.add("dateIsPicked");
					self.calendarContainer.classList.remove("dateIsPicked");
				}
			});
		}

		self.dateIsPicked = self.selectedDates.length > 0 || self.config.noCalendar;

		if (self.selectedDates.length) {
			if (self.config.enableTime)
				setHoursFromDate();
			updateValue();
		}

		if (self.config.weekNumbers) {
			self.calendarContainer.style.width = self.days.offsetWidth
				+ self.weekWrapper.offsetWidth + "px";
		}


		triggerEvent("Ready");
	}

	function updateTime(e) {
		if (self.config.noCalendar && !self.selectedDates.length)
			// picking time only
			self.selectedDates = [self.now];

		timeWrapper(e);

		if (!self.selectedDates.length)
			return;

		setHoursFromInputs();
		updateValue();
	}

	function setHoursFromInputs(){
		if (!self.config.enableTime)
			return;

		let hours = (parseInt(self.hourElement.value, 10) || 0),
			minutes = (parseInt(self.minuteElement.value, 10) || 0),
			seconds = self.config.enableSeconds<commit_msg>Account for padding when determining size<commit_after>/*! flatpickr v2.2.5, @license MIT */
function Flatpickr(element, config) {
	const self = this;

	function init() {
		if (element._flatpickr)
			destroy(element._flatpickr);

		element._flatpickr = self;

		self.element = element;
		self.instanceConfig = config || {};

		setupFormats();

		parseConfig();
		setupLocale();
		setupInputs();
		setupDates();

		setupHelperFunctions();

		self.isOpen = self.config.inline;
		self.changeMonth = changeMonth;
		self.clear = clear;
		self.close = close;
		self.destroy = destroy;
		self.formatDate = formatDate;
		self.jumpToDate = jumpToDate;
		self.open = open;
		self.redraw = redraw;
		self.set = set;
		self.setDate = setDate;
		self.toggle = toggle;

		self.isMobile = (
			!self.config.disableMobile &&
			!self.config.inline &&
			self.config.mode === "single" &&
			!self.config.disable.length &&
			!self.config.enable.length &&
			/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
		);

		if (!self.isMobile)
			build();

		bind();

		self.minDateHasTime = self.config.minDate && (
			self.config.minDate.getHours()
			|| self.config.minDate.getMinutes()
			|| self.config.minDate.getSeconds()
		);

		self.maxDateHasTime = self.config.maxDate && (
			self.config.maxDate.getHours()
			|| self.config.maxDate.getMinutes()
			|| self.config.maxDate.getSeconds()
		);

		if (!self.isMobile) {
			Object.defineProperty(self, "dateIsPicked", {
				set: function(bool) {
					if (bool)
						return self.calendarContainer.classList.add("dateIsPicked");
					self.calendarContainer.classList.remove("dateIsPicked");
				}
			});
		}

		self.dateIsPicked = self.selectedDates.length > 0 || self.config.noCalendar;

		if (self.selectedDates.length) {
			if (self.config.enableTime)
				setHoursFromDate();
			updateValue();
		}

		if (self.config.weekNumbers) {
			self.calendarContainer.style.width = self.days.clientWidth
				+ self.weekWrapper.clientWidth + "px";
		}


		triggerEvent("Ready");
	}

	function updateTime(e) {
		if (self.config.noCalendar && !self.selectedDates.length)
			// picking time only
			self.selectedDates = [self.now];

		timeWrapper(e);

		if (!self.selectedDates.length)
			return;

		setHoursFromInputs();
		updateValue();
	}

	function setHoursFromInputs(){
		if (!self.config.enableTime)
			return;

		let hours = (parseInt(self.hourElement.value, 10) || 0),
			minutes = (parseInt(self.minuteElement.value, 10) || 0),
			seconds = self.config.enableSeconds
{'fraction_non_alphanumeric': 0.14761904761904762, 'fraction_numerical': 0.003968253968253968, 'mean_word_length': 3.6503690036900367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '460060', 'n_tokens_mistral': 2006, 'n_tokens_neox': 1709, 'n_words': 274}