UNPKG

bulma-extensions

Version:

Set of extensions for Bulma.io CSS Framework

2,031 lines (1,689 loc) 571 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else if(typeof exports === 'object') exports["bulmaExtensions"] = factory(); else root["bulmaExtensions"] = factory(); })(typeof self !== 'undefined' ? self : this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 196); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { var isDate = __webpack_require__(115) var MILLISECONDS_IN_HOUR = 3600000 var MILLISECONDS_IN_MINUTE = 60000 var DEFAULT_ADDITIONAL_DIGITS = 2 var parseTokenDateTimeDelimeter = /[T ]/ var parseTokenPlainTime = /:/ // year tokens var parseTokenYY = /^(\d{2})$/ var parseTokensYYY = [ /^([+-]\d{2})$/, // 0 additional digits /^([+-]\d{3})$/, // 1 additional digit /^([+-]\d{4})$/ // 2 additional digits ] var parseTokenYYYY = /^(\d{4})/ var parseTokensYYYYY = [ /^([+-]\d{4})/, // 0 additional digits /^([+-]\d{5})/, // 1 additional digit /^([+-]\d{6})/ // 2 additional digits ] // date tokens var parseTokenMM = /^-(\d{2})$/ var parseTokenDDD = /^-?(\d{3})$/ var parseTokenMMDD = /^-?(\d{2})-?(\d{2})$/ var parseTokenWww = /^-?W(\d{2})$/ var parseTokenWwwD = /^-?W(\d{2})-?(\d{1})$/ // time tokens var parseTokenHH = /^(\d{2}([.,]\d*)?)$/ var parseTokenHHMM = /^(\d{2}):?(\d{2}([.,]\d*)?)$/ var parseTokenHHMMSS = /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/ // timezone tokens var parseTokenTimezone = /([Z+-].*)$/ var parseTokenTimezoneZ = /^(Z)$/ var parseTokenTimezoneHH = /^([+-])(\d{2})$/ var parseTokenTimezoneHHMM = /^([+-])(\d{2}):?(\d{2})$/ /** * @category Common Helpers * @summary Convert the given argument to an instance of Date. * * @description * Convert the given argument to an instance of Date. * * If the argument is an instance of Date, the function returns its clone. * * If the argument is a number, it is treated as a timestamp. * * If an argument is a string, the function tries to parse it. * Function accepts complete ISO 8601 formats as well as partial implementations. * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601 * * If all above fails, the function passes the given argument to Date constructor. * * @param {Date|String|Number} argument - the value to convert * @param {Object} [options] - the object with options * @param {0 | 1 | 2} [options.additionalDigits=2] - the additional number of digits in the extended year format * @returns {Date} the parsed date in the local time zone * * @example * // Convert string '2014-02-11T11:30:30' to date: * var result = parse('2014-02-11T11:30:30') * //=> Tue Feb 11 2014 11:30:30 * * @example * // Parse string '+02014101', * // if the additional number of digits in the extended year format is 1: * var result = parse('+02014101', {additionalDigits: 1}) * //=> Fri Apr 11 2014 00:00:00 */ function parse (argument, dirtyOptions) { if (isDate(argument)) { // Prevent the date to lose the milliseconds when passed to new Date() in IE10 return new Date(argument.getTime()) } else if (typeof argument !== 'string') { return new Date(argument) } var options = dirtyOptions || {} var additionalDigits = options.additionalDigits if (additionalDigits == null) { additionalDigits = DEFAULT_ADDITIONAL_DIGITS } else { additionalDigits = Number(additionalDigits) } var dateStrings = splitDateString(argument) var parseYearResult = parseYear(dateStrings.date, additionalDigits) var year = parseYearResult.year var restDateString = parseYearResult.restDateString var date = parseDate(restDateString, year) if (date) { var timestamp = date.getTime() var time = 0 var offset if (dateStrings.time) { time = parseTime(dateStrings.time) } if (dateStrings.timezone) { offset = parseTimezone(dateStrings.timezone) } else { // get offset accurate to hour in timezones that change offset offset = new Date(timestamp + time).getTimezoneOffset() offset = new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE).getTimezoneOffset() } return new Date(timestamp + time + offset * MILLISECONDS_IN_MINUTE) } else { return new Date(argument) } } function splitDateString (dateString) { var dateStrings = {} var array = dateString.split(parseTokenDateTimeDelimeter) var timeString if (parseTokenPlainTime.test(array[0])) { dateStrings.date = null timeString = array[0] } else { dateStrings.date = array[0] timeString = array[1] } if (timeString) { var token = parseTokenTimezone.exec(timeString) if (token) { dateStrings.time = timeString.replace(token[1], '') dateStrings.timezone = token[1] } else { dateStrings.time = timeString } } return dateStrings } function parseYear (dateString, additionalDigits) { var parseTokenYYY = parseTokensYYY[additionalDigits] var parseTokenYYYYY = parseTokensYYYYY[additionalDigits] var token // YYYY or ±YYYYY token = parseTokenYYYY.exec(dateString) || parseTokenYYYYY.exec(dateString) if (token) { var yearString = token[1] return { year: parseInt(yearString, 10), restDateString: dateString.slice(yearString.length) } } // YY or ±YYY token = parseTokenYY.exec(dateString) || parseTokenYYY.exec(dateString) if (token) { var centuryString = token[1] return { year: parseInt(centuryString, 10) * 100, restDateString: dateString.slice(centuryString.length) } } // Invalid ISO-formatted year return { year: null } } function parseDate (dateString, year) { // Invalid ISO-formatted year if (year === null) { return null } var token var date var month var week // YYYY if (dateString.length === 0) { date = new Date(0) date.setUTCFullYear(year) return date } // YYYY-MM token = parseTokenMM.exec(dateString) if (token) { date = new Date(0) month = parseInt(token[1], 10) - 1 date.setUTCFullYear(year, month) return date } // YYYY-DDD or YYYYDDD token = parseTokenDDD.exec(dateString) if (token) { date = new Date(0) var dayOfYear = parseInt(token[1], 10) date.setUTCFullYear(year, 0, dayOfYear) return date } // YYYY-MM-DD or YYYYMMDD token = parseTokenMMDD.exec(dateString) if (token) { date = new Date(0) month = parseInt(token[1], 10) - 1 var day = parseInt(token[2], 10) date.setUTCFullYear(year, month, day) return date } // YYYY-Www or YYYYWww token = parseTokenWww.exec(dateString) if (token) { week = parseInt(token[1], 10) - 1 return dayOfISOYear(year, week) } // YYYY-Www-D or YYYYWwwD token = parseTokenWwwD.exec(dateString) if (token) { week = parseInt(token[1], 10) - 1 var dayOfWeek = parseInt(token[2], 10) - 1 return dayOfISOYear(year, week, dayOfWeek) } // Invalid ISO-formatted date return null } function parseTime (timeString) { var token var hours var minutes // hh token = parseTokenHH.exec(timeString) if (token) { hours = parseFloat(token[1].replace(',', '.')) return (hours % 24) * MILLISECONDS_IN_HOUR } // hh:mm or hhmm token = parseTokenHHMM.exec(timeString) if (token) { hours = parseInt(token[1], 10) minutes = parseFloat(token[2].replace(',', '.')) return (hours % 24) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE } // hh:mm:ss or hhmmss token = parseTokenHHMMSS.exec(timeString) if (token) { hours = parseInt(token[1], 10) minutes = parseInt(token[2], 10) var seconds = parseFloat(token[3].replace(',', '.')) return (hours % 24) * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * 1000 } // Invalid ISO-formatted time return null } function parseTimezone (timezoneString) { var token var absoluteOffset // Z token = parseTokenTimezoneZ.exec(timezoneString) if (token) { return 0 } // ±hh token = parseTokenTimezoneHH.exec(timezoneString) if (token) { absoluteOffset = parseInt(token[2], 10) * 60 return (token[1] === '+') ? -absoluteOffset : absoluteOffset } // ±hh:mm or ±hhmm token = parseTokenTimezoneHHMM.exec(timezoneString) if (token) { absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10) return (token[1] === '+') ? -absoluteOffset : absoluteOffset } return 0 } function dayOfISOYear (isoYear, week, day) { week = week || 0 day = day || 0 var date = new Date(0) date.setUTCFullYear(isoYear, 0, 4) var fourthOfJanuaryDay = date.getUTCDay() || 7 var diff = week * 7 + day + 1 - fourthOfJanuaryDay date.setUTCDate(date.getUTCDate() + diff) return date } module.exports = parse /***/ }), /* 1 */ /***/ (function(module, exports) { var commonFormatterKeys = [ 'M', 'MM', 'Q', 'D', 'DD', 'DDD', 'DDDD', 'd', 'E', 'W', 'WW', 'YY', 'YYYY', 'GG', 'GGGG', 'H', 'HH', 'h', 'hh', 'm', 'mm', 's', 'ss', 'S', 'SS', 'SSS', 'Z', 'ZZ', 'X', 'x' ] function buildFormattingTokensRegExp (formatters) { var formatterKeys = [] for (var key in formatters) { if (formatters.hasOwnProperty(key)) { formatterKeys.push(key) } } var formattingTokens = commonFormatterKeys .concat(formatterKeys) .sort() .reverse() var formattingTokensRegExp = new RegExp( '(\\[[^\\[]*\\])|(\\\\)?' + '(' + formattingTokens.join('|') + '|.)', 'g' ) return formattingTokensRegExp } module.exports = buildFormattingTokensRegExp /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(0) var startOfISOWeek = __webpack_require__(3) /** * @category ISO Week-Numbering Year Helpers * @summary Get the ISO week-numbering year of the given date. * * @description * Get the ISO week-numbering year of the given date, * which always starts 3 days before the year's first Thursday. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @param {Date|String|Number} date - the given date * @returns {Number} the ISO week-numbering year * * @example * // Which ISO-week numbering year is 2 January 2005? * var result = getISOYear(new Date(2005, 0, 2)) * //=> 2004 */ function getISOYear (dirtyDate) { var date = parse(dirtyDate) var year = date.getFullYear() var fourthOfJanuaryOfNextYear = new Date(0) fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4) fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0) var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear) var fourthOfJanuaryOfThisYear = new Date(0) fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4) fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0) var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear) if (date.getTime() >= startOfNextYear.getTime()) { return year + 1 } else if (date.getTime() >= startOfThisYear.getTime()) { return year } else { return year - 1 } } module.exports = getISOYear /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { var startOfWeek = __webpack_require__(78) /** * @category ISO Week Helpers * @summary Return the start of an ISO week for the given date. * * @description * Return the start of an ISO week for the given date. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @param {Date|String|Number} date - the original date * @returns {Date} the start of an ISO week * * @example * // The start of an ISO week for 2 September 2014 11:55:00: * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) * //=> Mon Sep 01 2014 00:00:00 */ function startOfISOWeek (dirtyDate) { return startOfWeek(dirtyDate, {weekStartsOn: 1}) } module.exports = startOfISOWeek /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(0) /** * @category Day Helpers * @summary Return the start of a day for the given date. * * @description * Return the start of a day for the given date. * The result will be in the local timezone. * * @param {Date|String|Number} date - the original date * @returns {Date} the start of a day * * @example * // The start of a day for 2 September 2014 11:55:00: * var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0)) * //=> Tue Sep 02 2014 00:00:00 */ function startOfDay (dirtyDate) { var date = parse(dirtyDate) date.setHours(0, 0, 0, 0) return date } module.exports = startOfDay /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { var buildDistanceInWordsLocale = __webpack_require__(10) var buildFormatLocale = __webpack_require__(11) /** * @category Locales * @summary English locale. */ module.exports = { distanceInWords: buildDistanceInWordsLocale(), format: buildFormatLocale() } /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(0) /** * @category Day Helpers * @summary Add the specified number of days to the given date. * * @description * Add the specified number of days to the given date. * * @param {Date|String|Number} date - the date to be changed * @param {Number} amount - the amount of days to be added * @returns {Date} the new date with the days added * * @example * // Add 10 days to 1 September 2014: * var result = addDays(new Date(2014, 8, 1), 10) * //=> Thu Sep 11 2014 00:00:00 */ function addDays (dirtyDate, dirtyAmount) { var date = parse(dirtyDate) var amount = Number(dirtyAmount) date.setDate(date.getDate() + amount) return date } module.exports = addDays /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(0) /** * @category Millisecond Helpers * @summary Add the specified number of milliseconds to the given date. * * @description * Add the specified number of milliseconds to the given date. * * @param {Date|String|Number} date - the date to be changed * @param {Number} amount - the amount of milliseconds to be added * @returns {Date} the new date with the milliseconds added * * @example * // Add 750 milliseconds to 10 July 2014 12:45:30.000: * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750) * //=> Thu Jul 10 2014 12:45:30.750 */ function addMilliseconds (dirtyDate, dirtyAmount) { var timestamp = parse(dirtyDate).getTime() var amount = Number(dirtyAmount) return new Date(timestamp + amount) } module.exports = addMilliseconds /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { var getISOYear = __webpack_require__(2) var startOfISOWeek = __webpack_require__(3) /** * @category ISO Week-Numbering Year Helpers * @summary Return the start of an ISO week-numbering year for the given date. * * @description * Return the start of an ISO week-numbering year, * which always starts 3 days before the year's first Thursday. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @param {Date|String|Number} date - the original date * @returns {Date} the start of an ISO year * * @example * // The start of an ISO week-numbering year for 2 July 2005: * var result = startOfISOYear(new Date(2005, 6, 2)) * //=> Mon Jan 03 2005 00:00:00 */ function startOfISOYear (dirtyDate) { var year = getISOYear(dirtyDate) var fourthOfJanuary = new Date(0) fourthOfJanuary.setFullYear(year, 0, 4) fourthOfJanuary.setHours(0, 0, 0, 0) var date = startOfISOWeek(fourthOfJanuary) return date } module.exports = startOfISOYear /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { var parse = __webpack_require__(0) /** * @category Common Helpers * @summary Compare the two dates and return -1, 0 or 1. * * @description * Compare the two dates and return 1 if the first date is after the second, * -1 if the first date is before the second or 0 if dates are equal. * * @param {Date|String|Number} dateLeft - the first date to compare * @param {Date|String|Number} dateRight - the second date to compare * @returns {Number} the result of the comparison * * @example * // Compare 11 February 1987 and 10 July 1989: * var result = compareAsc( * new Date(1987, 1, 11), * new Date(1989, 6, 10) * ) * //=> -1 * * @example * // Sort the array of dates: * var result = [ * new Date(1995, 6, 2), * new Date(1987, 1, 11), * new Date(1989, 6, 10) * ].sort(compareAsc) * //=> [ * // Wed Feb 11 1987 00:00:00, * // Mon Jul 10 1989 00:00:00, * // Sun Jul 02 1995 00:00:00 * // ] */ function compareAsc (dirtyDateLeft, dirtyDateRight) { var dateLeft = parse(dirtyDateLeft) var timeLeft = dateLeft.getTime() var dateRight = parse(dirtyDateRight) var timeRight = dateRight.getTime() if (timeLeft < timeRight) { return -1 } else if (timeLeft > timeRight) { return 1 } else { return 0 } } module.exports = compareAsc /***/ }), /* 10 */ /***/ (function(module, exports) { function buildDistanceInWordsLocale () { var distanceInWordsLocale = { 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' }, 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 localize (token, count, options) { options = options || {} var result if (typeof distanceInWordsLocale[token] === 'string') { result = distanceInWordsLocale[token] } else if (count === 1) { result = distanceInWordsLocale[token].one } else { result = distanceInWordsLocale[token].other.replace('{{count}}', count) } if (options.addSuffix) { if (options.comparison > 0) { return 'in ' + result } else { return result + ' ago' } } return result } return { localize: localize } } module.exports = buildDistanceInWordsLocale /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { var buildFormattingTokensRegExp = __webpack_require__(1) function buildFormatLocale () { // Note: in English, the names of days of the week and months are capitalized. // If you are making a new locale based on this one, check if the same is true for the language you're working on. // Generally, formatted dates should look like they are in the middle of a sentence, // e.g. in Spanish language the weekdays and months should be in the lowercase. var months3char = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] var monthsFull = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] var weekdays2char = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] var weekdays3char = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] var weekdaysFull = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] var meridiemUppercase = ['AM', 'PM'] var meridiemLowercase = ['am', 'pm'] var meridiemFull = ['a.m.', 'p.m.'] var formatters = { // Month: Jan, Feb, ..., Dec 'MMM': function (date) { return months3char[date.getMonth()] }, // Month: January, February, ..., December 'MMMM': function (date) { return monthsFull[date.getMonth()] }, // Day of week: Su, Mo, ..., Sa 'dd': function (date) { return weekdays2char[date.getDay()] }, // Day of week: Sun, Mon, ..., Sat 'ddd': function (date) { return weekdays3char[date.getDay()] }, // Day of week: Sunday, Monday, ..., Saturday 'dddd': function (date) { return weekdaysFull[date.getDay()] }, // AM, PM 'A': function (date) { return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] }, // am, pm 'a': function (date) { return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] }, // a.m., p.m. 'aa': function (date) { return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] } } // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] ordinalFormatters.forEach(function (formatterToken) { formatters[formatterToken + 'o'] = function (date, formatters) { return ordinal(formatters[formatterToken](date)) } }) return { formatters: formatters, formattingTokensRegExp: buildFormattingTokensRegExp(formatters) } } function ordinal (number) { var 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' } module.exports = buildFormatLocale /***/ }), /* 12 */ /***/ (function(module, exports) { function buildDistanceInWordsLocale () { var distanceInWordsLocale = { lessThanXSeconds: { one: 'أقل من ثانية واحدة', other: 'أقل من {{count}} ثواني' }, xSeconds: { one: 'ثانية واحدة', other: '{{count}} ثواني' }, halfAMinute: 'نصف دقيقة', lessThanXMinutes: { one: 'أقل من دقيقة', other: 'أقل من {{count}} دقيقة' }, xMinutes: { one: 'دقيقة واحدة', other: '{{count}} دقائق' }, aboutXHours: { one: 'ساعة واحدة تقريباً', other: '{{count}} ساعات تقريباً' }, xHours: { one: 'ساعة واحدة', other: '{{count}} ساعات' }, xDays: { one: 'يوم واحد', other: '{{count}} أيام' }, aboutXMonths: { one: 'شهر واحد تقريباً', other: '{{count}} أشهر تقريباً' }, xMonths: { one: 'شهر واحد', other: '{{count}} أشهر' }, aboutXYears: { one: 'عام واحد تقريباً', other: '{{count}} أعوام تقريباً' }, xYears: { one: 'عام واحد', other: '{{count}} أعوام' }, overXYears: { one: 'أكثر من عام', other: 'أكثر من {{count}} أعوام' }, almostXYears: { one: 'عام واحد تقريباً', other: '{{count}} أعوام تقريباً' } } function localize (token, count, options) { options = options || {} var result if (typeof distanceInWordsLocale[token] === 'string') { result = distanceInWordsLocale[token] } else if (count === 1) { result = distanceInWordsLocale[token].one } else { result = distanceInWordsLocale[token].other.replace('{{count}}', count) } if (options.addSuffix) { if (options.comparison > 0) { return 'في خلال ' + result } else { return 'منذ ' + result } } return result } return { localize: localize } } module.exports = buildDistanceInWordsLocale /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { var buildFormattingTokensRegExp = __webpack_require__(1) function buildFormatLocale () { var months3char = ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'] var monthsFull = ['كانون الثاني يناير', 'شباط فبراير', 'آذار مارس', 'نيسان أبريل', 'أيار مايو', 'حزيران يونيو', 'تموز يوليو', 'آب أغسطس', 'أيلول سبتمبر', 'تشرين الأول أكتوبر', 'تشرين الثاني نوفمبر', 'كانون الأول ديسمبر'] var weekdays2char = ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'] var weekdays3char = ['أحد', 'إثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'] var weekdaysFull = ['الأحد', 'الإثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'] var meridiemUppercase = ['صباح', 'مساء'] var meridiemLowercase = ['ص', 'م'] var meridiemFull = ['صباحاً', 'مساءاً'] var formatters = { // Month: Jan, Feb, ..., Dec 'MMM': function (date) { return months3char[date.getMonth()] }, // Month: January, February, ..., December 'MMMM': function (date) { return monthsFull[date.getMonth()] }, // Day of week: Su, Mo, ..., Sa 'dd': function (date) { return weekdays2char[date.getDay()] }, // Day of week: Sun, Mon, ..., Sat 'ddd': function (date) { return weekdays3char[date.getDay()] }, // Day of week: Sunday, Monday, ..., Saturday 'dddd': function (date) { return weekdaysFull[date.getDay()] }, // AM, PM 'A': function (date) { return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] }, // am, pm 'a': function (date) { return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] }, // a.m., p.m. 'aa': function (date) { return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] } } // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] ordinalFormatters.forEach(function (formatterToken) { formatters[formatterToken + 'o'] = function (date, formatters) { return ordinal(formatters[formatterToken](date)) } }) return { formatters: formatters, formattingTokensRegExp: buildFormattingTokensRegExp(formatters) } } function ordinal (number) { return String(number) } module.exports = buildFormatLocale /***/ }), /* 14 */ /***/ (function(module, exports) { function buildDistanceInWordsLocale () { var distanceInWordsLocale = { lessThanXSeconds: { one: 'по-малко от секунда', other: 'по-малко от {{count}} секунди' }, xSeconds: { one: '1 секунда', other: '{{count}} секунди' }, halfAMinute: 'половин минута', lessThanXMinutes: { one: 'по-малко от минута', other: 'по-малко от {{count}} минути' }, xMinutes: { one: '1 минута', other: '{{count}} минути' }, aboutXHours: { one: 'около час', other: 'около {{count}} часа' }, xHours: { one: '1 час', other: '{{count}} часа' }, xDays: { one: '1 ден', other: '{{count}} дни' }, aboutXMonths: { one: 'около месец', other: 'около {{count}} месеца' }, xMonths: { one: '1 месец', other: '{{count}} месеца' }, aboutXYears: { one: 'около година', other: 'около {{count}} години' }, xYears: { one: '1 година', other: '{{count}} години' }, overXYears: { one: 'над година', other: 'над {{count}} години' }, almostXYears: { one: 'почти година', other: 'почти {{count}} години' } } function localize (token, count, options) { options = options || {} var result if (typeof distanceInWordsLocale[token] === 'string') { result = distanceInWordsLocale[token] } else if (count === 1) { result = distanceInWordsLocale[token].one } else { result = distanceInWordsLocale[token].other.replace('{{count}}', count) } if (options.addSuffix) { if (options.comparison > 0) { return 'след ' + result } else { return 'преди ' + result } } return result } return { localize: localize } } module.exports = buildDistanceInWordsLocale /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { var buildFormattingTokensRegExp = __webpack_require__(1) function buildFormatLocale () { var months3char = ['яну', 'фев', 'мар', 'апр', 'май', 'юни', 'юли', 'авг', 'сеп', 'окт', 'ное', 'дек'] var monthsFull = ['януари', 'февруари', 'март', 'април', 'май', 'юни', 'юли', 'август', 'септември', 'октомври', 'ноември', 'декември'] var weekdays2char = ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'] var weekdays3char = ['нед', 'пон', 'вто', 'сря', 'чет', 'пет', 'съб'] var weekdaysFull = ['неделя', 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота'] var meridiem = ['сутринта', 'на обяд', 'следобед', 'вечерта'] var timeOfDay = function (date) { var hours = date.getHours() if (hours >= 4 && hours < 12) { return meridiem[0] } else if (hours >= 12 && hours < 14) { return meridiem[1] } else if (hours >= 14 && hours < 17) { return meridiem[2] } else { return meridiem[3] } } var formatters = { // Month: Jan, Feb, ..., Dec 'MMM': function (date) { return months3char[date.getMonth()] }, // Month: January, February, ..., December 'MMMM': function (date) { return monthsFull[date.getMonth()] }, // Day of week: Su, Mo, ..., Sa 'dd': function (date) { return weekdays2char[date.getDay()] }, // Day of week: Sun, Mon, ..., Sat 'ddd': function (date) { return weekdays3char[date.getDay()] }, // Day of week: Sunday, Monday, ..., Saturday 'dddd': function (date) { return weekdaysFull[date.getDay()] }, // AM, PM 'A': timeOfDay, // am, pm 'a': timeOfDay, // a.m., p.m. 'aa': timeOfDay } // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] ordinalFormatters.forEach(function (formatterToken) { formatters[formatterToken + 'o'] = function (date, formatters) { return ordinal(formatters[formatterToken](date)) } }) return { formatters: formatters, formattingTokensRegExp: buildFormattingTokensRegExp(formatters) } } function ordinal (number) { var rem100 = number % 100 if (rem100 > 20 || rem100 < 10) { switch (rem100 % 10) { case 1: return number + '-ви' case 2: return number + '-ри' } } return number + '-и' } module.exports = buildFormatLocale /***/ }), /* 16 */ /***/ (function(module, exports) { function buildDistanceInWordsLocale () { var distanceInWordsLocale = { lessThanXSeconds: { one: "menys d'un segon", other: 'menys de {{count}} segons' }, xSeconds: { one: '1 segon', other: '{{count}} segons' }, halfAMinute: 'mig minut', lessThanXMinutes: { one: "menys d'un minut", other: 'menys de {{count}} minuts' }, xMinutes: { one: '1 minut', other: '{{count}} minuts' }, aboutXHours: { one: 'aproximadament una hora', other: 'aproximadament {{count}} hores' }, xHours: { one: '1 hora', other: '{{count}} hores' }, xDays: { one: '1 dia', other: '{{count}} dies' }, aboutXMonths: { one: 'aproximadament un mes', other: 'aproximadament {{count}} mesos' }, xMonths: { one: '1 mes', other: '{{count}} mesos' }, aboutXYears: { one: 'aproximadament un any', other: 'aproximadament {{count}} anys' }, xYears: { one: '1 any', other: '{{count}} anys' }, overXYears: { one: "més d'un any", other: 'més de {{count}} anys' }, almostXYears: { one: 'gairebé un any', other: 'gairebé {{count}} anys' } } function localize (token, count, options) { options = options || {} var result if (typeof distanceInWordsLocale[token] === 'string') { result = distanceInWordsLocale[token] } else if (count === 1) { result = distanceInWordsLocale[token].one } else { result = distanceInWordsLocale[token].other.replace('{{count}}', count) } if (options.addSuffix) { if (options.comparison > 0) { return 'en ' + result } else { return 'fa ' + result } } return result } return { localize: localize } } module.exports = buildDistanceInWordsLocale /***/ }), /* 17 */ /***/ (function(module, exports, __webpack_require__) { var buildFormattingTokensRegExp = __webpack_require__(1) function buildFormatLocale () { var months3char = ['gen', 'feb', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'oct', 'nov', 'des'] var monthsFull = ['gener', 'febrer', 'març', 'abril', 'maig', 'juny', 'juliol', 'agost', 'setembre', 'octobre', 'novembre', 'desembre'] var weekdays2char = ['dg', 'dl', 'dt', 'dc', 'dj', 'dv', 'ds'] var weekdays3char = ['dge', 'dls', 'dts', 'dcs', 'djs', 'dvs', 'dss'] var weekdaysFull = ['diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte'] var meridiemUppercase = ['AM', 'PM'] var meridiemLowercase = ['am', 'pm'] var meridiemFull = ['a.m.', 'p.m.'] var formatters = { // Month: Jan, Feb, ..., Dec 'MMM': function (date) { return months3char[date.getMonth()] }, // Month: January, February, ..., December 'MMMM': function (date) { return monthsFull[date.getMonth()] }, // Day of week: Su, Mo, ..., Sa 'dd': function (date) { return weekdays2char[date.getDay()] }, // Day of week: Sun, Mon, ..., Sat 'ddd': function (date) { return weekdays3char[date.getDay()] }, // Day of week: Sunday, Monday, ..., Saturday 'dddd': function (date) { return weekdaysFull[date.getDay()] }, // AM, PM 'A': function (date) { return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] }, // am, pm 'a': function (date) { return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] }, // a.m., p.m. 'aa': function (date) { return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] } } // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] ordinalFormatters.forEach(function (formatterToken) { formatters[formatterToken + 'o'] = function (date, formatters) { return ordinal(formatters[formatterToken](date)) } }) return { formatters: formatters, formattingTokensRegExp: buildFormattingTokensRegExp(formatters) } } function ordinal (number) { switch (number) { case 1: return '1r' case 2: return '2n' case 3: return '3r' case 4: return '4t' default: return number + 'è' } } module.exports = buildFormatLocale /***/ }), /* 18 */ /***/ (function(module, exports) { function declensionGroup (scheme, count) { if (count === 1) { return scheme.one } if (count >= 2 && count <= 4) { return scheme.twoFour } // if count === null || count === 0 || count >= 5 return scheme.other } function declension (scheme, count, time) { var group = declensionGroup(scheme, count) var finalText = group[time] || group return finalText.replace('{{count}}', count) } function extractPreposition (token) { var result = ['lessThan', 'about', 'over', 'almost'].filter(function (preposition) { return !!token.match(new RegExp('^' + preposition)) }) return result[0] } function prefixPreposition (preposition) { var translation = '' if (preposition === 'almost') { translation = 'skoro' } if (preposition === 'about') { translation = 'přibližně' } return translation.length > 0 ? translation + ' ' : '' } function suffixPreposition (preposition) { var translation = '' if (preposition === 'lessThan') { translation = 'méně než' } if (preposition === 'over') { translation = 'více než' } return translation.length > 0 ? translation + ' ' : '' } function lowercaseFirstLetter (string) { return string.charAt(0).toLowerCase() + string.slice(1) } function buildDistanceInWordsLocale () { var distanceInWordsLocale = { xSeconds: { one: { regular: 'vteřina', past: 'vteřinou', future: 'vteřinu' }, twoFour: { regular: '{{count}} vteřiny', past: '{{count}} vteřinami', future: '{{count}} vteřiny' }, other: { regular: '{{count}} vteřin', past: '{{count}} vteřinami', future: '{{count}} vteřin' } }, halfAMinute: { other: { regular: 'půl minuty', past: 'půl minutou', future: 'půl minuty' } }, xMinutes: { one: { regular: 'minuta', past: 'minutou', future: 'minutu' }, twoFour: { regular: '{{count}} minuty', past: '{{count}} minutami', future: '{{count}} minuty' }, other: { regular: '{{count}} minut', past: '{{count}} minutami', future: '{{count}} minut' } }, xHours: { one: { regular: 'hodina', past: 'hodinou', future: 'hodinu' }, twoFour: { regular: '{{count}} hodiny', past: '{{count}} hodinami', future: '{{count}} hodiny' }, other: { regular: '{{count}} hodin', past: '{{count}} hodinami', future: '{{count}} hodin' } }, xDays: { one: { regular: 'den', past: 'dnem', future: 'den' }, twoFour: { regular: '{{count}} dni', past: '{{count}} dny', future: '{{count}} dni' }, other: { regular: '{{count}} dní', past: '{{count}} dny', future: '{{count}} dní' } }, xMonths: { one: { regular: 'měsíc', past: 'měsícem', future: 'měsíc' }, twoFour: { regular: '{{count}} měsíce', past: '{{count}} měsíci', future: '{{count}} měsíce' }, other: { regular: '{{count}} měsíců', past: '{{count}} měsíci', future: '{{count}} měsíců' } }, xYears: { one: { regular: 'rok', past: 'rokem', future: 'rok' }, twoFour: { regular: '{{count}} roky', past: '{{count}} roky', future: '{{count}} roky' }, other: { regular: '{{count}} roků', past: '{{count}} roky', future: '{{count}} roků' } } } function localize (token, count, options) { options = options || {} var preposition = extractPreposition(token) || '' var key = lowercaseFirstLetter(token.substring(preposition.length)) var scheme = distanceInWordsLocale[key] if (!options.addSuffix) { return prefixPreposition(preposition) + suffixPreposition(preposition) + declension(scheme, count, 'regular') } if (options.comparison > 0) { return prefixPreposition(preposition) + 'za ' + suffixPreposition(preposition) + declension(scheme, count, 'future') } else { return prefixPreposition(preposition) + 'před ' + suffixPreposition(preposition) + declension(scheme, count, 'past') } } return { localize: localize } } module.exports = buildDistanceInWordsLocale /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { var buildFormattingTokensRegExp = __webpack_require__(1) function buildFormatLocale () { var months3char = ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'] var monthsFull = ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'] var weekdays2char = ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'] var weekdays3char = ['ned', 'pon', 'úte', 'stř', 'čtv', 'pát', 'sob'] var weekdaysFull = ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'] var meridiemUppercase = ['DOP.', 'ODP.'] var meridiemLowercase = ['dop.', 'odp.'] var meridiemFull = ['dopoledne', 'odpoledne'] var formatters = { // Month: led, úno, ..., pro 'MMM': function (date) { return months3char[date.getMonth()] }, // Month: leden, únor, ..., prosinec 'MMMM': function (date) { return monthsFull[date.getMonth()] }, // Day of week: ne, po, ..., so 'dd': function (date) { return weekdays2char[date.getDay()] }, // Day of week: ned, pon, ..., sob 'ddd': function (date) { return weekdays3char[date.getDay()] }, // Day of week: neděle, pondělí, ..., sobota 'dddd': function (date) { return weekdaysFull[date.getDay()] }, // DOP., ODP. 'A': function (date) { return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] }, // dop., odp. 'a': function (date) { return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] }, // dopoledne, odpoledne 'aa': function (date) { return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] } } // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] ordinalFormatters.forEach(function (formatterToken) { formatters[formatterToken + 'o'] = function (date, formatters) { return ordinal(formatters[formatterToken](date)) } }) return { formatters: formatters, formattingTokensRegExp: buildFormattingTokensRegExp(formatters) } } function ordinal (number) { return number + '.' } module.exports = buildFormatLocale /***/ }), /* 20 */ /***/ (function(module, exports) { function buildDistanceInWordsLocale () { var distanceInWordsLocale = { lessThanXSeconds: { one: 'mindre end et sekund', other: 'mindre end {{count}} sekunder' }, xSeconds: { one: '1 sekund', other: '{{count}} sekunder' }, halfAMinute: 'et halvt minut', lessThanXMinutes: { one: 'mindre end et minut', other: 'mindre end {{count}} minutter' }, xMinutes: { one: '1 minut', other: '{{count}} minutter' }, aboutXHours: { one: 'cirka 1 time', other: 'cirka {{count}} timer' }, xHours: { one: '1 time', other: '{{count}} timer' }, xDays: { one: '1 dag', other: '{{count}} dage' }, aboutXMonths: { one: 'cirka 1 måned', other: 'cirka {{count}} måneder' }, xMonths: { one: '1 måned', other: '{{count}} måneder' }, aboutXYears: { one: 'cirka 1 år', other: 'cirka {{count}} år' }, xYears: { one: '1 år', other: '{{count}} år' }, overXYears: { one: 'over 1 år', other: 'over {{count}} år' }, almostXYears: { one: 'næsten 1 år', other: 'næsten {{count}} år' } } function localize (token, count, options) { options = options || {} var result if (typeof distanceInWordsLocale[token] === 'string') { result = distanceInWordsLocale[token] } else if (count === 1) { result = distanceInWordsLocale[token].one } else { result = distanceInWordsLocale[token].other.replace('{{count}}', count) } if (options.addSuffix) { if (options.comparison > 0) { return 'om ' + result } else { return result + ' siden' } } return result } return { localize: localize } } module.exports = buildDistanceInWordsLocale /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { var buildFormattingTokensRegExp = __webpack_require__(1) function buildFormatLocale () { var months3char = ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'] var monthsFull = ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'] var weekdays2char = ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'] var weekdays3char = ['søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør'] var weekdaysFull = ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'] var meridiemUppercase = ['AM', 'PM'] var meridiemLowercase = ['am', 'pm'] var meridiemFull = ['a.m.', 'p.m.'] var formatters = { // Month: Jan, Feb, ..., Dec 'MMM': function (date) { return months3char[date.getMonth()] }, // Month: January, February, ..., December 'MMMM': function (date) { return monthsFull[date.getMonth()] }, // Day of week: Su, Mo, ..., Sa 'dd': function (date) { return weekdays2char[date.getDay()] }, // Day of week: Sun, Mon, ..., Sat 'ddd': function (date) { return weekdays3char[date.getDay()] }, // Day of week: Sunday, Monday, ..., Saturday 'dddd': function (date) { return weekdaysFull[date.getDay()] }, // AM, PM 'A': function (date) { return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0] }, // am, pm 'a': function (date) { return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0] }, // a.m., p.m. 'aa': function (date) { return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0] } } // Generate ordinal version of formatters: M -> Mo, D -> Do, etc. var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W'] ordinalFormatters.forEach(function (formatterToken) { formatters[formatterToken + 'o'] = function (date, formatters) { return ordinal(formatters[formatterToken](date)) } }) return { formatters: formatters, formattingTokensRegExp: buildFormattingTokensRegExp(formatters) } } function ordinal (number) { return number + '.' } module.exports = buildFormatLocale /***/ }), /* 22 */ /***/ (function(module, exports) { function buildDistanceInWordsLocale () { var distanceInWordsLocale = { lessThanXSeconds: { standalone: { one: 'weniger als eine Sekunde', other: 'weniger als {{count}} Sekunden' }, withPreposition: { one: 'weniger als einer Sekunde', other: 'weniger als {{count}} Sekunden' } }, xSeconds: { standalone: { one: 'eine Sekunde', other: '{{count}} Sekunden' }, withPreposition: { one: 'einer Sekunde', other: '{{count}} Sekunden' } }, halfAMinute: { standalone: 'eine halbe Minute', withPreposition: 'einer halben Minute' }, lessThanXMinutes: { standalone: { one: 'weniger als eine Minute', other: 'weniger als {{count}} Minuten' }, withPreposition: { one: 'weniger als einer Minute', other: 'weniger als {{count}} Minuten' } }, xMinutes: { standalone: { one: 'eine Minute', other: '{{count}} Minuten' }, withPreposition: { one: 'einer Minute', other: '{{count}} Minuten' } }, aboutXHours: { standalone: { one: 'etwa eine Stunde', other: 'etwa {{count}} Stunden' }, wit