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IAAkB,MAAMD,KAAKD,GACtBE,CACT,CACE,OAAO,CAEX,CAOO,SAAS3C,EAAWjB,GAEzB,OADY,IAAIzD,MACLsH,mBAAqB7D,EAAK6D,gBACvC,C","sources":["webpack://platform/./app/components/time_elements/extended_time_element.js","webpack://platform/./app/components/time_elements/local_time_element.js","webpack://platform/./app/components/time_elements/relative_time.js","webpack://platform/./app/components/time_elements/relative_time_element.js","webpack://platform/./app/components/time_elements/time_ago_element.js","webpack://platform/./app/components/time_elements/time_until_element.js","webpack://platform/./app/components/time_elements/utils.js"],"sourcesContent":["import { makeFormatter } from './utils.js'\n\nexport default class ExtendedTimeElement extends HTMLElement {\n static get observedAttributes() {\n return [\n 'datetime',\n 'day',\n 'format',\n 'hour',\n 'minute',\n 'month',\n 'second',\n 'title',\n 'weekday',\n 'year'\n ]\n }\n\n // Internal: Refresh the time element's formatted date when an attribute changes.\n //\n // Returns nothing.\n attributeChangedCallback(attrName, oldValue, newValue) {\n if (attrName === 'datetime') {\n const millis = Date.parse(newValue)\n this._date = Number.isNaN(millis) ? null : new Date(millis)\n }\n\n const title = this.getFormattedTitle()\n if (title && !this.hasAttribute('title')) {\n this.setAttribute('title', title)\n }\n\n const text = this.getFormattedDate()\n if (text) {\n this.textContent = text\n }\n }\n\n // Internal: Format the ISO 8601 timestamp according to the user agent's\n // locale-aware formatting rules. The element's existing `title` attribute\n // value takes precedence over this custom format.\n //\n // Returns a formatted time String.\n getFormattedTitle() {\n if (!this._date) {\n return\n }\n\n const formatter = makeFormatter({\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n hour: 'numeric',\n minute: '2-digit',\n timeZoneName: 'short'\n })\n\n if (formatter) {\n return formatter.format(this._date)\n } else {\n try {\n return this._date.toLocaleString()\n } catch (error) {\n if (error instanceof RangeError) {\n return this._date.toString()\n } else {\n throw error\n }\n }\n }\n }\n}\n","import ExtendedTimeElement from './extended_time_element.js'\nimport { isDayFirst, makeFormatter, strftime } from './utils.js'\n\nexport default class LocalTimeElement extends ExtendedTimeElement {\n // Formats the element's date, in the user's current locale, according to\n // the formatting attribute values. Values are not passed straight through to\n // an Intl.DateTimeFormat instance so that weekday and month names are always\n // displayed in English, for now.\n //\n // Supported attributes are:\n //\n // weekday - \"short\", \"long\", \"relative\"\n // year - \"numeric\", \"2-digit\"\n // month - \"short\", \"long\"\n // day - \"numeric\", \"2-digit\"\n // hour - \"numeric\", \"2-digit\"\n // minute - \"numeric\", \"2-digit\"\n // second - \"numeric\", \"2-digit\"\n //\n // Returns a formatted time String.\n getFormattedDate() {\n if (!this._date) {\n return\n }\n\n const date = formatDate(this) || ''\n const time = formatTime(this) || ''\n return `${date} ${time}`.trim()\n }\n}\n\n// Private: Format a date according to the `weekday`, `day`, `month`,\n// and `year` attribute values.\n//\n// This doesn't use Intl.DateTimeFormat to avoid creating text in the user's\n// language when the majority of the surrounding text is in English. There's\n// currently no way to separate the language from the format in Intl.\n//\n// el - The local-time element to format.\n//\n// Returns a date String or null if no date formats are provided.\nfunction formatDate(el) {\n // map attribute values to strftime\n const props = {\n weekday: {\n short: '%a',\n long: '%A',\n relative: '%W',\n repeated: \"%A's at\"\n },\n day: {\n numeric: '%e',\n '2-digit': '%d'\n },\n month: {\n short: '%b',\n long: '%B'\n },\n year: {\n numeric: '%Y',\n '2-digit': '%y'\n }\n }\n\n // build a strftime format string\n let format = isDayFirst() ? 'weekday day month year' : 'weekday month day, year'\n for (const prop in props) {\n const value = props[prop][el.getAttribute(prop)]\n format = format.replace(prop, value || '')\n }\n\n // clean up year separator comma\n format = format.replace(/(\\s,)|(,\\s$)/, '')\n\n // squeeze spaces from final string\n return strftime(el._date, format).replace(/\\s+/, ' ').trim()\n}\n\n// Private: Format a time according to the `hour`, `minute`, and `second`\n// attribute values.\n//\n// el - The local-time element to format.\n//\n// Returns a time String or null if no time formats are provided.\nfunction formatTime(el) {\n // retrieve format settings from attributes\n const options = {\n hour: el.getAttribute('hour'),\n minute: el.getAttribute('minute'),\n second: el.getAttribute('second'),\n timeZoneName: el.getAttribute('time-zone-name')\n }\n\n // remove unset format attributes\n for (const opt in options) {\n if (!options[opt]) {\n delete options[opt]\n }\n }\n\n // no time format attributes provided\n if (Object.keys(options).length === 0) {\n return\n }\n\n const formatter = makeFormatter(options)\n if (formatter) {\n // locale-aware formatting of 24 or 12 hour times\n return formatter.format(el._date)\n } else {\n // fall back to strftime for non-Intl browsers\n const timef = options.second ? '%H:%M:%S' : '%H:%M'\n return strftime(el._date, timef)\n }\n}\n\n// Public: LocalTimeElement constructor.\n//\n// var time = new LocalTimeElement()\n// # => \n//\nif (!window.customElements.get('local-time')) {\n window.LocalTimeElement = LocalTimeElement\n window.customElements.define('local-time', LocalTimeElement)\n}\n","import { isDayFirst, isThisYear, isYearSeparator, makeFormatter, strftime } from './utils.js'\n\nexport default class RelativeTime {\n constructor(date) {\n this.date = date\n }\n\n toString() {\n return this.timeElapsed() || this.timeAhead() || `on ${this.formatDate()}`\n }\n\n timeElapsed() {\n const ms = Date.now() - this.date.getTime()\n const sec = Math.round(ms / 1000)\n const min = Math.round(sec / 60)\n const hr = Math.round(min / 60)\n const day = Math.round(hr / 24)\n return ms >= 0 && day < 30 ? this.timeAgoFromMs(ms) : null\n }\n\n timeAhead() {\n const ms = this.date.getTime() - Date.now()\n const sec = Math.round(ms / 1000)\n const min = Math.round(sec / 60)\n const hr = Math.round(min / 60)\n const day = Math.round(hr / 24)\n return ms >= 0 && day < 30 ? this.timeUntil() : null\n }\n\n timeAgo() {\n const ms = Date.now() - this.date.getTime()\n return this.timeAgoFromMs(ms)\n }\n\n timeAgoFromMs(ms) {\n const sec = Math.round(ms / 1000)\n const min = Math.round(sec / 60)\n const hr = Math.round(min / 60)\n const day = Math.round(hr / 24)\n const month = Math.round(day / 30)\n const year = Math.round(month / 12)\n if (ms < 0) {\n return 'just now'\n } else if (sec < 10) {\n return 'just now'\n } else if (sec < 45) {\n return `${sec} seconds ago`\n } else if (sec < 90) {\n return 'a minute ago'\n } else if (min < 45) {\n return `${min} minutes ago`\n } else if (min < 90) {\n return 'an hour ago'\n } else if (hr < 24) {\n return `${hr} hours ago`\n } else if (hr < 36) {\n return 'a day ago'\n } else if (day < 30) {\n return `${day} days ago`\n } else if (day < 45) {\n return 'a month ago'\n } else if (month < 12) {\n return `${month} months ago`\n } else if (month < 18) {\n return 'a year ago'\n } else {\n return `${year} years ago`\n }\n }\n\n microTimeAgo() {\n const ms = Date.now() - this.date.getTime()\n const sec = Math.round(ms / 1000)\n const min = Math.round(sec / 60)\n const hr = Math.round(min / 60)\n const day = Math.round(hr / 24)\n const month = Math.round(day / 30)\n const year = Math.round(month / 12)\n if (min < 1) {\n return '1m'\n } else if (min < 60) {\n return `${min}m`\n } else if (hr < 24) {\n return `${hr}h`\n } else if (day < 365) {\n return `${day}d`\n } else {\n return `${year}y`\n }\n }\n\n timeUntil() {\n const ms = this.date.getTime() - Date.now()\n return this.timeUntilFromMs(ms)\n }\n\n timeUntilFromMs(ms) {\n const sec = Math.round(ms / 1000)\n const min = Math.round(sec / 60)\n const hr = Math.round(min / 60)\n const day = Math.round(hr / 24)\n const month = Math.round(day / 30)\n const year = Math.round(month / 12)\n if (month >= 18) {\n return `${year} years from now`\n } else if (month >= 12) {\n return 'a year from now'\n } else if (day >= 45) {\n return `${month} months from now`\n } else if (day >= 30) {\n return 'a month from now'\n } else if (hr >= 36) {\n return `${day} days from now`\n } else if (hr >= 24) {\n return 'a day from now'\n } else if (min >= 90) {\n return `${hr} hours from now`\n } else if (min >= 45) {\n return 'an hour from now'\n } else if (sec >= 90) {\n return `${min} minutes from now`\n } else if (sec >= 45) {\n return 'a minute from now'\n } else if (sec >= 10) {\n return `${sec} seconds from now`\n } else {\n return 'just now'\n }\n }\n\n microTimeUntil() {\n const ms = this.date.getTime() - Date.now()\n const sec = Math.round(ms / 1000)\n const min = Math.round(sec / 60)\n const hr = Math.round(min / 60)\n const day = Math.round(hr / 24)\n const month = Math.round(day / 30)\n const year = Math.round(month / 12)\n if (day >= 365) {\n return `${year}y`\n } else if (hr >= 24) {\n return `${day}d`\n } else if (min >= 60) {\n return `${hr}h`\n } else if (min > 1) {\n return `${min}m`\n } else {\n return '1m'\n }\n }\n\n formatDate() {\n let format = isDayFirst() ? '%e %b' : '%b %e'\n if (!isThisYear(this.date)) {\n format += isYearSeparator() ? ', %Y' : ' %Y'\n }\n return strftime(this.date, format)\n }\n\n formatTime() {\n const formatter = makeFormatter({ hour: 'numeric', minute: '2-digit' })\n return formatter ? formatter.format(this.date) : strftime(this.date, '%l:%M%P')\n }\n}\n","import ExtendedTimeElement from './extended_time_element.js'\nimport RelativeTime from './relative_time.js'\n\nexport default class RelativeTimeElement extends ExtendedTimeElement {\n getFormattedDate() {\n if (this._date) {\n return new RelativeTime(this._date).toString()\n }\n }\n\n connectedCallback() {\n nowElements.push(this)\n\n if (!updateNowElementsId) {\n updateNowElements()\n updateNowElementsId = setInterval(updateNowElements, 60 * 1000)\n }\n }\n\n disconnectedCallback() {\n const ix = nowElements.indexOf(this)\n if (ix !== -1) {\n nowElements.splice(ix, 1)\n }\n\n if (nowElements.length === 0 && updateNowElementsId) {\n clearInterval(updateNowElementsId)\n updateNowElementsId = null\n }\n }\n}\n\n// Internal: Array tracking all elements attached to the document that need\n// to be updated every minute.\nconst nowElements = []\n\n// Internal: Timer ID for `updateNowElements` interval.\nlet updateNowElementsId\n\n// Internal: Install a timer to refresh all attached relative-time elements every\n// minute.\nfunction updateNowElements() {\n let time, i, len\n for (i = 0, len = nowElements.length; i < len; i++) {\n time = nowElements[i]\n time.textContent = time.getFormattedDate()\n }\n}\n\n// Public: RelativeTimeElement constructor.\n//\n// var time = new RelativeTimeElement()\n// # => \n//\nif (!window.customElements.get('relative-time')) {\n window.RelativeTimeElement = RelativeTimeElement\n window.customElements.define('relative-time', RelativeTimeElement)\n}\n","import RelativeTime from './relative_time.js'\nimport RelativeTimeElement from './relative_time_element.js'\n\nexport default class TimeAgoElement extends RelativeTimeElement {\n getFormattedDate() {\n if (this._date) {\n const format = this.getAttribute('format')\n return format === 'micro'\n ? new RelativeTime(this._date).microTimeAgo()\n : new RelativeTime(this._date).timeAgo()\n }\n }\n}\n\nif (!window.customElements.get('time-ago')) {\n window.TimeAgoElement = TimeAgoElement\n window.customElements.define('time-ago', TimeAgoElement)\n}\n","import RelativeTime from './relative_time.js'\nimport RelativeTimeElement from './relative_time_element.js'\n\nexport default class TimeUntilElement extends RelativeTimeElement {\n getFormattedDate() {\n if (this._date) {\n return this.getAttribute('format') === 'micro'\n ? new RelativeTime(this._date).microTimeUntil()\n : new RelativeTime(this._date).timeUntil()\n }\n }\n}\n\nif (!window.customElements.get('time-until')) {\n window.TimeUntilElement = TimeUntilElement\n window.customElements.define('time-until', TimeUntilElement)\n}\n","import { addDays, isSameDay } from 'date-fns'\n\nconst weekdays = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\nconst months = [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n]\n\nfunction pad(num) {\n return `0${num}`.slice(-2)\n}\n\nexport function strftime(time, formatString) {\n const day = time.getDay()\n const date = time.getDate()\n const month = time.getMonth()\n const year = time.getFullYear()\n const hour = time.getHours()\n const minute = time.getMinutes()\n const second = time.getSeconds()\n return formatString.replaceAll(/%([%ABHIMPSWYZa-elmpwyz])/g, function (_arg) {\n let match\n const modifier = _arg[1]\n switch (modifier) {\n case '%': {\n return '%'\n }\n case 'a': {\n return weekdays[day].slice(0, 3)\n }\n case 'A': {\n return weekdays[day]\n }\n case 'b': {\n return months[month].slice(0, 3)\n }\n case 'B': {\n return months[month]\n }\n case 'c': {\n return time.toString()\n }\n case 'd': {\n return pad(date)\n }\n case 'e': {\n return date\n }\n case 'H': {\n return pad(hour)\n }\n case 'I': {\n return pad(strftime(time, '%l'))\n }\n case 'l': {\n return hour === 0 || hour === 12 ? 12 : (hour + 12) % 12\n }\n case 'm': {\n return pad(month + 1)\n }\n case 'M': {\n return pad(minute)\n }\n case 'p': {\n return hour > 11 ? 'PM' : 'AM'\n }\n case 'P': {\n return hour > 11 ? 'pm' : 'am'\n }\n case 'S': {\n return pad(second)\n }\n case 'w': {\n return day\n }\n case 'W': {\n if (isSameDay(new Date(), time)) return 'Today'\n if (isSameDay(time, addDays(new Date(), 1))) return 'Tomorrow'\n if (time <= addDays(new Date(), 6)) return strftime(time, '%A')\n\n return strftime(time, '%a, %b %e')\n }\n case 'y': {\n return pad(year % 100)\n }\n case 'Y': {\n return year\n }\n case 'Z': {\n match = time.toString().match(/\\((\\w+)\\)$/)\n return match ? match[1] : ''\n }\n case 'z': {\n match = time.toString().match(/\\w([+-]\\d{4}) /)\n return match ? match[1] : ''\n }\n }\n })\n}\n\nexport function makeFormatter(options) {\n if (typeof Intl !== 'undefined') {\n try {\n return new Intl.DateTimeFormat(undefined, options)\n } catch (error) {\n if (!(error instanceof RangeError)) {\n throw error\n }\n }\n }\n}\n\nlet dayFirst = null\n\n// Private: Determine if the day should be formatted before the month name in\n// the user's current locale. For example, `9 Jun` for en-GB and `Jun 9`\n// for en-US.\n//\n// Returns true if the day appears before the month.\nexport function isDayFirst() {\n if (dayFirst !== null) {\n return dayFirst\n }\n\n const formatter = makeFormatter({ day: 'numeric', month: 'short' })\n if (formatter) {\n const output = formatter.format(new Date(0))\n dayFirst = !!/^\\d/.test(output)\n return dayFirst\n } else {\n return false\n }\n}\n\nlet yearSeparator = null\n\n// Private: Determine if the year should be separated from the month and day\n// with a comma. For example, `9 Jun 2014` in en-GB and `Jun 9, 2014` in en-US.\n//\n// Returns true if the date needs a separator.\nexport function isYearSeparator() {\n if (yearSeparator !== null) {\n return yearSeparator\n }\n\n const formatter = makeFormatter({ day: 'numeric', month: 'short', year: 'numeric' })\n if (formatter) {\n const output = formatter.format(new Date(0))\n yearSeparator = !!/\\d,/.test(output)\n return yearSeparator\n } else {\n return true\n }\n}\n\n// Private: Determine if the date occurs in the same year as today's date.\n//\n// date - The Date to test.\n//\n// Returns true if it's this year.\nexport function isThisYear(date) {\n const now = new Date()\n return now.getUTCFullYear() === date.getUTCFullYear()\n}\n"],"names":["ExtendedTimeElement","HTMLElement","observedAttributes","attributeChangedCallback","attrName","oldValue","newValue","millis","Date","parse","this","_date","Number","isNaN","title","getFormattedTitle","hasAttribute","setAttribute","text","getFormattedDate","textContent","formatter","makeFormatter","day","month","year","hour","minute","timeZoneName","format","toLocaleString","error","RangeError","toString","LocalTimeElement","el","props","weekday","short","long","relative","repeated","numeric","isDayFirst","prop","value","getAttribute","replace","strftime","trim","formatDate","options","second","opt","Object","keys","length","timef","formatTime","window","customElements","get","define","RelativeTime","constructor","date","timeElapsed","timeAhead","ms","now","getTime","sec","Math","round","min","hr","timeAgoFromMs","timeUntil","timeAgo","microTimeAgo","timeUntilFromMs","microTimeUntil","isThisYear","isYearSeparator","RelativeTimeElement","connectedCallback","nowElements","push","updateNowElementsId","updateNowElements","setInterval","disconnectedCallback","ix","indexOf","splice","clearInterval","time","i","len","TimeAgoElement","TimeUntilElement","weekdays","months","pad","num","slice","formatString","getDay","getDate","getMonth","getFullYear","getHours","getMinutes","getSeconds","replaceAll","_arg","match","isSameDay","addDays","Intl","DateTimeFormat","undefined","dayFirst","output","test","yearSeparator","getUTCFullYear"],"sourceRoot":""}