{"ast":null,"code":"function buildLocalizeTokenFn(schema) {\n  return (count, options) => {\n    if (count === 1) {\n      if (options?.addSuffix) {\n        return schema.one[0].replace(\"{{time}}\", schema.one[2]);\n      } else {\n        return schema.one[0].replace(\"{{time}}\", schema.one[1]);\n      }\n    } else {\n      const rem = count % 10 === 1 && count % 100 !== 11;\n      if (options?.addSuffix) {\n        return schema.other[0].replace(\"{{time}}\", rem ? schema.other[3] : schema.other[4]).replace(\"{{count}}\", String(count));\n      } else {\n        return schema.other[0].replace(\"{{time}}\", rem ? schema.other[1] : schema.other[2]).replace(\"{{count}}\", String(count));\n      }\n    }\n  };\n}\nconst formatDistanceLocale = {\n  lessThanXSeconds: buildLocalizeTokenFn({\n    one: [\"mazāk par {{time}}\", \"sekundi\", \"sekundi\"],\n    other: [\"mazāk nekā {{count}} {{time}}\", \"sekunde\", \"sekundes\", \"sekundes\", \"sekundēm\"]\n  }),\n  xSeconds: buildLocalizeTokenFn({\n    one: [\"1 {{time}}\", \"sekunde\", \"sekundes\"],\n    other: [\"{{count}} {{time}}\", \"sekunde\", \"sekundes\", \"sekundes\", \"sekundēm\"]\n  }),\n  halfAMinute: (_count, options) => {\n    if (options?.addSuffix) {\n      return \"pusminūtes\";\n    } else {\n      return \"pusminūte\";\n    }\n  },\n  lessThanXMinutes: buildLocalizeTokenFn({\n    one: [\"mazāk par {{time}}\", \"minūti\", \"minūti\"],\n    other: [\"mazāk nekā {{count}} {{time}}\", \"minūte\", \"minūtes\", \"minūtes\", \"minūtēm\"]\n  }),\n  xMinutes: buildLocalizeTokenFn({\n    one: [\"1 {{time}}\", \"minūte\", \"minūtes\"],\n    other: [\"{{count}} {{time}}\", \"minūte\", \"minūtes\", \"minūtes\", \"minūtēm\"]\n  }),\n  aboutXHours: buildLocalizeTokenFn({\n    one: [\"apmēram 1 {{time}}\", \"stunda\", \"stundas\"],\n    other: [\"apmēram {{count}} {{time}}\", \"stunda\", \"stundas\", \"stundas\", \"stundām\"]\n  }),\n  xHours: buildLocalizeTokenFn({\n    one: [\"1 {{time}}\", \"stunda\", \"stundas\"],\n    other: [\"{{count}} {{time}}\", \"stunda\", \"stundas\", \"stundas\", \"stundām\"]\n  }),\n  xDays: buildLocalizeTokenFn({\n    one: [\"1 {{time}}\", \"diena\", \"dienas\"],\n    other: [\"{{count}} {{time}}\", \"diena\", \"dienas\", \"dienas\", \"dienām\"]\n  }),\n  aboutXWeeks: buildLocalizeTokenFn({\n    one: [\"apmēram 1 {{time}}\", \"nedēļa\", \"nedēļas\"],\n    other: [\"apmēram {{count}} {{time}}\", \"nedēļa\", \"nedēļu\", \"nedēļas\", \"nedēļām\"]\n  }),\n  xWeeks: buildLocalizeTokenFn({\n    one: [\"1 {{time}}\", \"nedēļa\", \"nedēļas\"],\n    other: [\"{{count}} {{time}}\",\n    // TODO\n    \"nedēļa\", \"nedēļu\", \"nedēļas\", \"nedēļām\"]\n  }),\n  aboutXMonths: buildLocalizeTokenFn({\n    one: [\"apmēram 1 {{time}}\", \"mēnesis\", \"mēneša\"],\n    other: [\"apmēram {{count}} {{time}}\", \"mēnesis\", \"mēneši\", \"mēneša\", \"mēnešiem\"]\n  }),\n  xMonths: buildLocalizeTokenFn({\n    one: [\"1 {{time}}\", \"mēnesis\", \"mēneša\"],\n    other: [\"{{count}} {{time}}\", \"mēnesis\", \"mēneši\", \"mēneša\", \"mēnešiem\"]\n  }),\n  aboutXYears: buildLocalizeTokenFn({\n    one: [\"apmēram 1 {{time}}\", \"gads\", \"gada\"],\n    other: [\"apmēram {{count}} {{time}}\", \"gads\", \"gadi\", \"gada\", \"gadiem\"]\n  }),\n  xYears: buildLocalizeTokenFn({\n    one: [\"1 {{time}}\", \"gads\", \"gada\"],\n    other: [\"{{count}} {{time}}\", \"gads\", \"gadi\", \"gada\", \"gadiem\"]\n  }),\n  overXYears: buildLocalizeTokenFn({\n    one: [\"ilgāk par 1 {{time}}\", \"gadu\", \"gadu\"],\n    other: [\"vairāk nekā {{count}} {{time}}\", \"gads\", \"gadi\", \"gada\", \"gadiem\"]\n  }),\n  almostXYears: buildLocalizeTokenFn({\n    one: [\"gandrīz 1 {{time}}\", \"gads\", \"gada\"],\n    other: [\"vairāk nekā {{count}} {{time}}\", \"gads\", \"gadi\", \"gada\", \"gadiem\"]\n  })\n};\nexport const formatDistance = (token, count, options) => {\n  const result = formatDistanceLocale[token](count, options);\n  if (options?.addSuffix) {\n    if (options.comparison && options.comparison > 0) {\n      return \"pēc \" + result;\n    } else {\n      return \"pirms \" + result;\n    }\n  }\n  return result;\n};","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}