@hebcal/core 5.4.10 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.4.10 */
1
+ /*! @hebcal/core v5.5.0 */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -139,15 +139,15 @@ exports.greg.isLeapYear = isGregLeapYear;
139
139
  */
140
140
  const NISAN$4 = 1;
141
141
  const IYYAR$1 = 2;
142
- // const SIVAN = 3;
142
+ const SIVAN$1 = 3;
143
143
  const TAMUZ$1 = 4;
144
- // const AV = 5;
144
+ const AV$1 = 5;
145
145
  const ELUL$1 = 6;
146
146
  const TISHREI$3 = 7;
147
147
  const CHESHVAN$1 = 8;
148
148
  const KISLEV$2 = 9;
149
149
  const TEVET$2 = 10;
150
- // const SHVAT = 11;
150
+ const SHVAT$1 = 11;
151
151
  const ADAR_I$2 = 12;
152
152
  const ADAR_II$2 = 13;
153
153
  /**
@@ -157,31 +157,31 @@ const ADAR_II$2 = 13;
157
157
  */
158
158
  const months = {
159
159
  /** Nissan / ניסן */
160
- NISAN: 1,
160
+ NISAN: NISAN$4,
161
161
  /** Iyyar / אייר */
162
- IYYAR: 2,
162
+ IYYAR: IYYAR$1,
163
163
  /** Sivan / סיון */
164
- SIVAN: 3,
164
+ SIVAN: SIVAN$1,
165
165
  /** Tamuz (sometimes Tammuz) / תמוז */
166
- TAMUZ: 4,
166
+ TAMUZ: TAMUZ$1,
167
167
  /** Av / אב */
168
- AV: 5,
168
+ AV: AV$1,
169
169
  /** Elul / אלול */
170
- ELUL: 6,
170
+ ELUL: ELUL$1,
171
171
  /** Tishrei / תִּשְׁרֵי */
172
- TISHREI: 7,
172
+ TISHREI: TISHREI$3,
173
173
  /** Cheshvan / חשון */
174
- CHESHVAN: 8,
174
+ CHESHVAN: CHESHVAN$1,
175
175
  /** Kislev / כסלו */
176
- KISLEV: 9,
176
+ KISLEV: KISLEV$2,
177
177
  /** Tevet / טבת */
178
- TEVET: 10,
178
+ TEVET: TEVET$2,
179
179
  /** Sh'vat / שבט */
180
- SHVAT: 11,
180
+ SHVAT: SHVAT$1,
181
181
  /** Adar or Adar Rishon / אדר */
182
- ADAR_I: 12,
182
+ ADAR_I: ADAR_I$2,
183
183
  /** Adar Sheini (only on leap years) / אדר ב׳ */
184
- ADAR_II: 13
184
+ ADAR_II: ADAR_II$2
185
185
  };
186
186
  const monthNames0 = ['', 'Nisan', 'Iyyar', 'Sivan', 'Tamuz', 'Av', 'Elul', 'Tishrei', 'Cheshvan', 'Kislev', 'Tevet', "Sh'vat"];
187
187
  /**
@@ -420,74 +420,74 @@ function monthFromName(monthName) {
420
420
  if (c[1] === 'o') {
421
421
  break; /* this catches "november" */
422
422
  }
423
- return months.NISAN;
423
+ return NISAN$4;
424
424
  case 'i':
425
- return months.IYYAR;
425
+ return IYYAR$1;
426
426
  case 'e':
427
- return months.ELUL;
427
+ return ELUL$1;
428
428
  case 'c':
429
429
  case 'ח':
430
- return months.CHESHVAN;
430
+ return CHESHVAN$1;
431
431
  case 'k':
432
432
  case 'כ':
433
- return months.KISLEV;
433
+ return KISLEV$2;
434
434
  case 's':
435
435
  switch (c[1]) {
436
436
  case 'i':
437
- return months.SIVAN;
437
+ return SIVAN$1;
438
438
  case 'h':
439
- return months.SHVAT;
439
+ return SHVAT$1;
440
440
  }
441
441
  break;
442
442
  case 't':
443
443
  switch (c[1]) {
444
444
  case 'a':
445
- return months.TAMUZ;
445
+ return TAMUZ$1;
446
446
  case 'i':
447
- return months.TISHREI;
447
+ return TISHREI$3;
448
448
  case 'e':
449
- return months.TEVET;
449
+ return TEVET$2;
450
450
  }
451
451
  break;
452
452
  case 'a':
453
453
  switch (c[1]) {
454
454
  case 'v':
455
- return months.AV;
455
+ return AV$1;
456
456
  case 'd':
457
457
  if (/(1|[^i]i|a|א)$/i.test(monthName)) {
458
- return months.ADAR_I;
458
+ return ADAR_I$2;
459
459
  }
460
- return months.ADAR_II;
460
+ return ADAR_II$2;
461
461
  }
462
462
  break;
463
463
  case 'ס':
464
- return months.SIVAN;
464
+ return SIVAN$1;
465
465
  case 'ט':
466
- return months.TEVET;
466
+ return TEVET$2;
467
467
  case 'ש':
468
- return months.SHVAT;
468
+ return SHVAT$1;
469
469
  case 'א':
470
470
  switch (c[1]) {
471
471
  case 'ב':
472
- return months.AV;
472
+ return AV$1;
473
473
  case 'ד':
474
474
  if (/(1|[^i]i|a|א)$/i.test(monthName)) {
475
- return months.ADAR_I;
475
+ return ADAR_I$2;
476
476
  }
477
- return months.ADAR_II;
477
+ return ADAR_II$2;
478
478
  // else assume sheini
479
479
  case 'י':
480
- return months.IYYAR;
480
+ return IYYAR$1;
481
481
  case 'ל':
482
- return months.ELUL;
482
+ return ELUL$1;
483
483
  }
484
484
  break;
485
485
  case 'ת':
486
486
  switch (c[1]) {
487
487
  case 'מ':
488
- return months.TAMUZ;
488
+ return TAMUZ$1;
489
489
  case 'ש':
490
- return months.TISHREI;
490
+ return TISHREI$3;
491
491
  }
492
492
  break;
493
493
  }
@@ -514,13 +514,12 @@ function isSimpleHebrewDate$1(obj) {
514
514
  function toSimpleHebrewDate(obj) {
515
515
  if (isSimpleHebrewDate$1(obj)) {
516
516
  return obj;
517
- } else if (typeof obj === 'number') {
518
- return abs2hebrew(obj);
519
517
  } else if (isDate(obj)) {
520
518
  const abs = greg2abs(obj);
521
519
  return abs2hebrew(abs);
522
520
  } else {
523
- throw new TypeError(`Argument not a Date: ${obj}`);
521
+ // typeof obj === 'number'
522
+ return abs2hebrew(obj);
524
523
  }
525
524
  }
526
525
  function getYahrzeitHD(hyear, date) {
@@ -656,8 +655,8 @@ function num2digits(num) {
656
655
  function gematriya(num) {
657
656
  const num0 = num;
658
657
  const num1 = parseInt(num0, 10);
659
- if (!num1) {
660
- throw new TypeError(`invalid parameter to gematriya ${num}`);
658
+ if (!num1 || num1 < 0) {
659
+ throw new TypeError(`invalid gematriya number: ${num}`);
661
660
  }
662
661
  let str = '';
663
662
  const thousands = Math.floor(num1 / 1000);
@@ -908,6 +907,35 @@ function molad(year, month) {
908
907
  };
909
908
  }
910
909
 
910
+ /**
911
+ * Formats a number with leading zeros so the resulting string is 4 digits long.
912
+ * Similar to `string.padStart(4, '0')` but will also format
913
+ * negative numbers similar to how the JavaScript date formats
914
+ * negative year numbers (e.g. `-37` is formatted as `-000037`).
915
+ */
916
+ function pad4(num) {
917
+ if (num < 0) {
918
+ return '-00' + pad4(-num);
919
+ } else if (num < 10) {
920
+ return '000' + num;
921
+ } else if (num < 100) {
922
+ return '00' + num;
923
+ } else if (num < 1000) {
924
+ return '0' + num;
925
+ }
926
+ return String(num);
927
+ }
928
+ /**
929
+ * Formats a number with leading zeros so the resulting string is 2 digits long.
930
+ * Similar to `string.padStart(2, '0')`.
931
+ */
932
+ function pad2(num) {
933
+ if (num >= 0 && num < 10) {
934
+ return '0' + num;
935
+ }
936
+ return String(num);
937
+ }
938
+
911
939
  const _formatters = new Map();
912
940
  /**
913
941
  * @private
@@ -956,34 +984,6 @@ function getTimezoneOffset(tzid, date) {
956
984
  const diffMs = new Date(utcStr).getTime() - new Date(localStr).getTime();
957
985
  return Math.ceil(diffMs / 1000 / 60);
958
986
  }
959
- /**
960
- * Formats a number with leading zeros so the resulting string is 4 digits long.
961
- * Similar to `string.padStart(4, '0')` but will also format
962
- * negative numbers similar to how the JavaScript date formats
963
- * negative year numbers (e.g. `-37` is formatted as `-000037`).
964
- */
965
- function pad4(number) {
966
- if (number < 0) {
967
- return '-00' + pad4(-number);
968
- } else if (number < 10) {
969
- return '000' + number;
970
- } else if (number < 100) {
971
- return '00' + number;
972
- } else if (number < 1000) {
973
- return '0' + number;
974
- }
975
- return String(number);
976
- }
977
- /**
978
- * Formats a number with leading zeros so the resulting string is 2 digits long.
979
- * Similar to `string.padStart(2, '0')`.
980
- */
981
- function pad2(number) {
982
- if (number < 10) {
983
- return '0' + number;
984
- }
985
- return String(number);
986
- }
987
987
  /**
988
988
  * Returns YYYY-MM-DD in the local timezone
989
989
  */
@@ -1046,6 +1046,28 @@ const locales = new Map();
1046
1046
  let activeLocale;
1047
1047
  /** @private */
1048
1048
  let activeName;
1049
+ /** @private */
1050
+ function getEnOrdinal(n) {
1051
+ const s = ['th', 'st', 'nd', 'rd'];
1052
+ const v = n % 100;
1053
+ return n + (s[(v - 20) % 10] || s[v] || s[0]);
1054
+ }
1055
+ /** @private */
1056
+ function checkLocale(locale) {
1057
+ if (typeof locale !== 'string') {
1058
+ throw new TypeError(`Invalid locale name: ${locale}`);
1059
+ }
1060
+ return locale.toLowerCase();
1061
+ }
1062
+ /** @private */
1063
+ function getExistingLocale(locale) {
1064
+ const locale1 = checkLocale(locale);
1065
+ const loc = locales.get(locale1);
1066
+ if (!loc) {
1067
+ throw new RangeError(`Locale '${locale}' not found`);
1068
+ }
1069
+ return loc;
1070
+ }
1049
1071
  /**
1050
1072
  * A locale in Hebcal is used for translations/transliterations of
1051
1073
  * holidays. `@hebcal/hdate` supports four locales by default
@@ -1087,13 +1109,11 @@ class Locale {
1087
1109
  * @param data parsed data from a `.po` file.
1088
1110
  */
1089
1111
  static addLocale(locale, data) {
1090
- if (typeof locale !== 'string') {
1091
- throw new TypeError(`Invalid locale name: ${locale}`);
1092
- }
1112
+ locale = checkLocale(locale);
1093
1113
  if (typeof data.contexts !== 'object' || typeof data.contexts[''] !== 'object') {
1094
1114
  throw new TypeError(`Locale '${locale}' invalid compact format`);
1095
1115
  }
1096
- locales.set(locale.toLowerCase(), data.contexts['']);
1116
+ locales.set(locale, data.contexts['']);
1097
1117
  }
1098
1118
  /**
1099
1119
  * Adds a translation to `locale`, replacing any previous translation.
@@ -1102,15 +1122,9 @@ class Locale {
1102
1122
  * @param translation Translation text
1103
1123
  */
1104
1124
  static addTranslation(locale, id, translation) {
1105
- if (typeof locale !== 'string') {
1106
- throw new TypeError(`Invalid locale name: ${locale}`);
1107
- }
1108
- const loc = locales.get(locale.toLowerCase());
1109
- if (!loc) {
1110
- throw new TypeError(`Unknown locale: ${locale}`);
1111
- }
1125
+ const loc = getExistingLocale(locale);
1112
1126
  if (typeof id !== 'string' || id.length === 0) {
1113
- throw new TypeError(`Invalid id: ${id}`);
1127
+ throw new TypeError(`Invalid id string: ${id}`);
1114
1128
  }
1115
1129
  const isArray = Array.isArray(translation);
1116
1130
  if (isArray) {
@@ -1119,7 +1133,7 @@ class Locale {
1119
1133
  throw new TypeError(`Invalid translation array: ${translation}`);
1120
1134
  }
1121
1135
  } else if (typeof translation !== 'string') {
1122
- throw new TypeError(`Invalid translation: ${translation}`);
1136
+ throw new TypeError(`Invalid translation string: ${translation}`);
1123
1137
  }
1124
1138
  loc[id] = isArray ? translation : [translation];
1125
1139
  }
@@ -1129,13 +1143,7 @@ class Locale {
1129
1143
  * @param data parsed data from a `.po` file.
1130
1144
  */
1131
1145
  static addTranslations(locale, data) {
1132
- if (typeof locale !== 'string') {
1133
- throw new TypeError(`Invalid locale name: ${locale}`);
1134
- }
1135
- const loc = locales.get(locale.toLowerCase());
1136
- if (!loc) {
1137
- throw new TypeError(`Unknown locale: ${locale}`);
1138
- }
1146
+ const loc = getExistingLocale(locale);
1139
1147
  if (typeof data.contexts !== 'object' || typeof data.contexts[''] !== 'object') {
1140
1148
  throw new TypeError(`Locale '${locale}' invalid compact format`);
1141
1149
  }
@@ -1149,11 +1157,8 @@ class Locale {
1149
1157
  * @param locale Locale name (i.e: `'he'`, `'fr'`)
1150
1158
  */
1151
1159
  static useLocale(locale) {
1152
- const locale0 = locale.toLowerCase();
1153
- const obj = locales.get(locale0);
1154
- if (!obj) {
1155
- throw new RangeError(`Locale '${locale}' not found`);
1156
- }
1160
+ const locale0 = checkLocale(locale);
1161
+ const obj = getExistingLocale(locale0);
1157
1162
  activeName = alias[locale0] || locale0;
1158
1163
  activeLocale = obj;
1159
1164
  return activeLocale;
@@ -1179,31 +1184,24 @@ class Locale {
1179
1184
  const locale1 = locale === null || locale === void 0 ? void 0 : locale.toLowerCase();
1180
1185
  const locale0 = locale1 || activeName;
1181
1186
  if (!locale0) {
1182
- return this.getEnOrdinal(n);
1187
+ return getEnOrdinal(n);
1183
1188
  }
1184
1189
  switch (locale0) {
1185
1190
  case 'en':
1186
1191
  case 's':
1187
1192
  case 'a':
1188
- case 'ashkenazi':
1189
- case 'ashkenazi_litvish':
1190
- case 'ashkenazi_poylish':
1191
- case 'ashkenazi_standard':
1192
- return this.getEnOrdinal(n);
1193
+ return getEnOrdinal(n);
1193
1194
  case 'es':
1194
1195
  return n + 'º';
1195
1196
  case 'h':
1196
1197
  case 'he':
1197
1198
  case 'he-x-nonikud':
1198
1199
  return String(n);
1199
- default:
1200
- return n + '.';
1201
1200
  }
1202
- }
1203
- static getEnOrdinal(n) {
1204
- const s = ['th', 'st', 'nd', 'rd'];
1205
- const v = n % 100;
1206
- return n + (s[(v - 20) % 10] || s[v] || s[0]);
1201
+ if (locale0.startsWith('ashkenazi')) {
1202
+ return getEnOrdinal(n);
1203
+ }
1204
+ return n + '.';
1207
1205
  }
1208
1206
  /**
1209
1207
  * Removes nekudot from Hebrew string
@@ -1388,7 +1386,7 @@ class HDate {
1388
1386
  * @returns an integer 1-13
1389
1387
  * @example
1390
1388
  * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1391
- * hd.getMonth(); // 2
1389
+ * hd.getTishreiMonth(); // 2
1392
1390
  */
1393
1391
  getTishreiMonth() {
1394
1392
  const nummonths = monthsInYear(this.getFullYear());
@@ -1626,7 +1624,8 @@ class HDate {
1626
1624
  return new HDate(this.abs() + 7 * amount);
1627
1625
  } else if (units === UNITS_YEAR) {
1628
1626
  return new HDate(this.getDate(), this.getMonth(), this.getFullYear() + amount);
1629
- } else if (units === UNITS_MONTH) {
1627
+ } else {
1628
+ // units === UNITS_MONTH
1630
1629
  let hd = new HDate(this);
1631
1630
  const sign = amount > 0 ? 1 : -1;
1632
1631
  amount = Math.abs(amount);
@@ -1634,8 +1633,6 @@ class HDate {
1634
1633
  hd = new HDate(hd.abs() + sign * hd.daysInMonth());
1635
1634
  }
1636
1635
  return hd;
1637
- } else {
1638
- throw new TypeError(`Invalid units '${units}'`);
1639
1636
  }
1640
1637
  }
1641
1638
  /**
@@ -1678,9 +1675,6 @@ class HDate {
1678
1675
  * @param other Hebrew date to compare
1679
1676
  */
1680
1677
  deltaDays(other) {
1681
- if (!HDate.isHDate(other)) {
1682
- throw new TypeError(`Bad argument: ${other}`);
1683
- }
1684
1678
  return this.abs() - other.abs();
1685
1679
  }
1686
1680
  /**
@@ -1692,10 +1686,7 @@ class HDate {
1692
1686
  * hd1.isSameDate(hd2); // true
1693
1687
  */
1694
1688
  isSameDate(other) {
1695
- if (HDate.isHDate(other)) {
1696
- return this.yy === other.yy && this.mm === other.mm && this.dd === other.dd;
1697
- }
1698
- return false;
1689
+ return this.yy === other.yy && this.mm === other.mm && this.dd === other.dd;
1699
1690
  }
1700
1691
  /**
1701
1692
  * Returns a string representation of this Hebrew date using English transliterations
@@ -2302,7 +2293,7 @@ var check = function (it) {
2302
2293
  };
2303
2294
 
2304
2295
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
2305
- var global$a =
2296
+ var globalThis_1 =
2306
2297
  // eslint-disable-next-line es/no-global-this -- safe
2307
2298
  check(typeof globalThis == 'object' && globalThis) ||
2308
2299
  check(typeof window == 'object' && window) ||
@@ -2453,7 +2444,7 @@ var isObject$5 = function (it) {
2453
2444
  return typeof it == 'object' ? it !== null : isCallable$9(it);
2454
2445
  };
2455
2446
 
2456
- var global$9 = global$a;
2447
+ var globalThis$b = globalThis_1;
2457
2448
  var isCallable$8 = isCallable$a;
2458
2449
 
2459
2450
  var aFunction = function (argument) {
@@ -2461,20 +2452,25 @@ var aFunction = function (argument) {
2461
2452
  };
2462
2453
 
2463
2454
  var getBuiltIn$3 = function (namespace, method) {
2464
- return arguments.length < 2 ? aFunction(global$9[namespace]) : global$9[namespace] && global$9[namespace][method];
2455
+ return arguments.length < 2 ? aFunction(globalThis$b[namespace]) : globalThis$b[namespace] && globalThis$b[namespace][method];
2465
2456
  };
2466
2457
 
2467
2458
  var uncurryThis$6 = functionUncurryThis;
2468
2459
 
2469
2460
  var objectIsPrototypeOf = uncurryThis$6({}.isPrototypeOf);
2470
2461
 
2471
- var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
2462
+ var globalThis$a = globalThis_1;
2472
2463
 
2473
- var global$8 = global$a;
2474
- var userAgent = engineUserAgent;
2464
+ var navigator = globalThis$a.navigator;
2465
+ var userAgent$1 = navigator && navigator.userAgent;
2475
2466
 
2476
- var process = global$8.process;
2477
- var Deno = global$8.Deno;
2467
+ var environmentUserAgent = userAgent$1 ? String(userAgent$1) : '';
2468
+
2469
+ var globalThis$9 = globalThis_1;
2470
+ var userAgent = environmentUserAgent;
2471
+
2472
+ var process = globalThis$9.process;
2473
+ var Deno = globalThis$9.Deno;
2478
2474
  var versions = process && process.versions || Deno && Deno.version;
2479
2475
  var v8 = versions && versions.v8;
2480
2476
  var match, version$1;
@@ -2496,14 +2492,14 @@ if (!version$1 && userAgent) {
2496
2492
  }
2497
2493
  }
2498
2494
 
2499
- var engineV8Version = version$1;
2495
+ var environmentV8Version = version$1;
2500
2496
 
2501
2497
  /* eslint-disable es/no-symbol -- required for testing */
2502
- var V8_VERSION = engineV8Version;
2498
+ var V8_VERSION = environmentV8Version;
2503
2499
  var fails$5 = fails$9;
2504
- var global$7 = global$a;
2500
+ var globalThis$8 = globalThis_1;
2505
2501
 
2506
- var $String$3 = global$7.String;
2502
+ var $String$3 = globalThis$8.String;
2507
2503
 
2508
2504
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
2509
2505
  var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
@@ -2587,30 +2583,30 @@ var ordinaryToPrimitive$1 = function (input, pref) {
2587
2583
 
2588
2584
  var sharedStore = {exports: {}};
2589
2585
 
2590
- var global$6 = global$a;
2586
+ var globalThis$7 = globalThis_1;
2591
2587
 
2592
2588
  // eslint-disable-next-line es/no-object-defineproperty -- safe
2593
2589
  var defineProperty$2 = Object.defineProperty;
2594
2590
 
2595
2591
  var defineGlobalProperty$3 = function (key, value) {
2596
2592
  try {
2597
- defineProperty$2(global$6, key, { value: value, configurable: true, writable: true });
2593
+ defineProperty$2(globalThis$7, key, { value: value, configurable: true, writable: true });
2598
2594
  } catch (error) {
2599
- global$6[key] = value;
2595
+ globalThis$7[key] = value;
2600
2596
  } return value;
2601
2597
  };
2602
2598
 
2603
- var globalThis$1 = global$a;
2599
+ var globalThis$6 = globalThis_1;
2604
2600
  var defineGlobalProperty$2 = defineGlobalProperty$3;
2605
2601
 
2606
2602
  var SHARED = '__core-js_shared__';
2607
- var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
2603
+ var store$3 = sharedStore.exports = globalThis$6[SHARED] || defineGlobalProperty$2(SHARED, {});
2608
2604
 
2609
2605
  (store$3.versions || (store$3.versions = [])).push({
2610
- version: '3.37.1',
2606
+ version: '3.38.1',
2611
2607
  mode: 'global',
2612
2608
  copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
2613
- license: 'https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE',
2609
+ license: 'https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE',
2614
2610
  source: 'https://github.com/zloirock/core-js'
2615
2611
  });
2616
2612
 
@@ -2654,14 +2650,14 @@ var uid$2 = function (key) {
2654
2650
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$1(++id + postfix, 36);
2655
2651
  };
2656
2652
 
2657
- var global$5 = global$a;
2653
+ var globalThis$5 = globalThis_1;
2658
2654
  var shared$2 = shared$3;
2659
2655
  var hasOwn$6 = hasOwnProperty_1;
2660
2656
  var uid$1 = uid$2;
2661
2657
  var NATIVE_SYMBOL = symbolConstructorDetection;
2662
2658
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
2663
2659
 
2664
- var Symbol$1 = global$5.Symbol;
2660
+ var Symbol$1 = globalThis$5.Symbol;
2665
2661
  var WellKnownSymbolsStore = shared$2('wks');
2666
2662
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
2667
2663
 
@@ -2709,10 +2705,10 @@ var toPropertyKey$2 = function (argument) {
2709
2705
  return isSymbol(key) ? key : key + '';
2710
2706
  };
2711
2707
 
2712
- var global$4 = global$a;
2708
+ var globalThis$4 = globalThis_1;
2713
2709
  var isObject$2 = isObject$5;
2714
2710
 
2715
- var document$1 = global$4.document;
2711
+ var document$1 = globalThis$4.document;
2716
2712
  // typeof document.createElement is 'object' in old IE
2717
2713
  var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
2718
2714
 
@@ -2871,10 +2867,10 @@ if (!isCallable$4(store$1.inspectSource)) {
2871
2867
 
2872
2868
  var inspectSource$1 = store$1.inspectSource;
2873
2869
 
2874
- var global$3 = global$a;
2870
+ var globalThis$3 = globalThis_1;
2875
2871
  var isCallable$3 = isCallable$a;
2876
2872
 
2877
- var WeakMap$2 = global$3.WeakMap;
2873
+ var WeakMap$2 = globalThis$3.WeakMap;
2878
2874
 
2879
2875
  var weakMapBasicDetection = isCallable$3(WeakMap$2) && /native code/.test(String(WeakMap$2));
2880
2876
 
@@ -2890,7 +2886,7 @@ var sharedKey$2 = function (key) {
2890
2886
  var hiddenKeys$4 = {};
2891
2887
 
2892
2888
  var NATIVE_WEAK_MAP = weakMapBasicDetection;
2893
- var global$2 = global$a;
2889
+ var globalThis$2 = globalThis_1;
2894
2890
  var isObject = isObject$5;
2895
2891
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
2896
2892
  var hasOwn$3 = hasOwnProperty_1;
@@ -2899,8 +2895,8 @@ var sharedKey$1 = sharedKey$2;
2899
2895
  var hiddenKeys$3 = hiddenKeys$4;
2900
2896
 
2901
2897
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
2902
- var TypeError$1 = global$2.TypeError;
2903
- var WeakMap$1 = global$2.WeakMap;
2898
+ var TypeError$1 = globalThis$2.TypeError;
2899
+ var WeakMap$1 = globalThis$2.WeakMap;
2904
2900
  var set, get, has;
2905
2901
 
2906
2902
  var enforce = function (it) {
@@ -3238,7 +3234,7 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
3238
3234
 
3239
3235
  var isForced_1 = isForced$1;
3240
3236
 
3241
- var global$1 = global$a;
3237
+ var globalThis$1 = globalThis_1;
3242
3238
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
3243
3239
  var createNonEnumerableProperty = createNonEnumerableProperty$2;
3244
3240
  var defineBuiltIn = defineBuiltIn$1;
@@ -3267,11 +3263,11 @@ var _export = function (options, source) {
3267
3263
  var STATIC = options.stat;
3268
3264
  var FORCED, target, key, targetProperty, sourceProperty, descriptor;
3269
3265
  if (GLOBAL) {
3270
- target = global$1;
3266
+ target = globalThis$1;
3271
3267
  } else if (STATIC) {
3272
- target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
3268
+ target = globalThis$1[TARGET] || defineGlobalProperty(TARGET, {});
3273
3269
  } else {
3274
- target = global$1[TARGET] && global$1[TARGET].prototype;
3270
+ target = globalThis$1[TARGET] && globalThis$1[TARGET].prototype;
3275
3271
  }
3276
3272
  if (target) for (key in source) {
3277
3273
  sourceProperty = source[key];
@@ -3356,7 +3352,8 @@ var NullProtoObjectViaActiveX = function (activeXDocument) {
3356
3352
  activeXDocument.write(scriptTag(''));
3357
3353
  activeXDocument.close();
3358
3354
  var temp = activeXDocument.parentWindow.Object;
3359
- activeXDocument = null; // avoid memory leak
3355
+ // eslint-disable-next-line no-useless-assignment -- avoid memory leak
3356
+ activeXDocument = null;
3360
3357
  return temp;
3361
3358
  };
3362
3359
 
@@ -6400,7 +6397,7 @@ const expectedInteger = (e, n) => `Non-integer ${e}: ${n}`,
6400
6397
  Ta = "UTC",
6401
6398
  Da = 5184e3,
6402
6399
  Ia = /*@__PURE__*/isoArgsToEpochSec(1847),
6403
- Ma = /*@__PURE__*/isoArgsToEpochSec( /*@__PURE__*/( /*@__PURE__*/new Date()).getUTCFullYear() + 10),
6400
+ Ma = /*@__PURE__*/isoArgsToEpochSec(/*@__PURE__*/(/*@__PURE__*/new Date()).getUTCFullYear() + 10),
6404
6401
  Na = /0+$/,
6405
6402
  fn = /*@__PURE__*/Jn(_zonedEpochSlotsToIso, WeakMap),
6406
6403
  ya = 2 ** 32 - 1,
@@ -6746,7 +6743,7 @@ const Pa = "([+−-])",
6746
6743
  return [];
6747
6744
  }
6748
6745
  },
6749
- Y = /*@__PURE__*/createNativeOpsCreator( /*@__PURE__*/Object.assign({}, Va, Ja, {
6746
+ Y = /*@__PURE__*/createNativeOpsCreator(/*@__PURE__*/Object.assign({}, Va, Ja, {
6750
6747
  h: computeIsoDateParts,
6751
6748
  ee(e) {
6752
6749
  return this.id === gi ? computeGregoryEraParts(e) : this.id === Ti ? Gi(e) : [];
@@ -9181,6 +9178,7 @@ class Location extends GeoLocation {
9181
9178
  * @param dst single char 'Y' or 'N'
9182
9179
  */
9183
9180
  static getUsaTzid(state, tz, dst) {
9181
+ tz = +tz;
9184
9182
  if (tz === 10 && state === 'AK') {
9185
9183
  return 'America/Adak';
9186
9184
  }
@@ -9748,6 +9746,40 @@ class Zmanim {
9748
9746
  }
9749
9747
  return new Date(sunset.getTime() + offset * 60 * 1000);
9750
9748
  }
9749
+ /**
9750
+ * Returns the Hebrew date relative to the specified location and Gregorian date,
9751
+ * taking into consideration whether the time is before or after sunset.
9752
+ *
9753
+ * For example, if the given date and is `2024-09-22T10:35` (before sunset), and
9754
+ * sunset for the specified location is **19:04**, then this function would
9755
+ * return a Hebrew date of `19th of Elul, 5784`.
9756
+ * If the given date is the same Gregorian day after sunset
9757
+ * (for example `2024-09-22T20:07`), this function would return a
9758
+ * Hebrew date of `20th of Elul, 5784`.
9759
+ * @example
9760
+ * const {GeoLocation, Zmanim, HDate} = require('@hebcal/core');
9761
+ * const latitude = 48.85341;
9762
+ * const longitude = 2.3488;
9763
+ * const timezone = 'Europe/Paris';
9764
+ * const gloc = new GeoLocation(null, latitude, longitude, 0, timezone);
9765
+ * const before = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T17:38:46.123Z'), false);
9766
+ * console.log(before.toString()); // '19 Elul 5784'
9767
+ * const after = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T23:45:18.345Z'), false);
9768
+ * console.log(after.toString()); // '20 Elul 5784'
9769
+ */
9770
+ static makeSunsetAwareHDate(gloc, date, useElevation) {
9771
+ const zmanim = new Zmanim(gloc, date, useElevation);
9772
+ const sunset = zmanim.sunset();
9773
+ let hd = new HDate(date);
9774
+ const sunsetMillis = sunset.getTime();
9775
+ if (isNaN(sunsetMillis)) {
9776
+ return hd;
9777
+ }
9778
+ if (date.getTime() >= sunsetMillis) {
9779
+ hd = hd.next();
9780
+ }
9781
+ return hd;
9782
+ }
9751
9783
  }
9752
9784
 
9753
9785
  const hour12cc = {
@@ -11693,7 +11725,7 @@ class DailyLearning {
11693
11725
  }
11694
11726
 
11695
11727
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
11696
- const version = '5.4.10';
11728
+ const version = '5.5.0';
11697
11729
 
11698
11730
  /* eslint-disable max-len */
11699
11731
  /**