@hebcal/core 5.4.3 → 5.4.5

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/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v5.4.3 */
1
+ /*! @hebcal/core v5.4.5 */
2
2
  'use strict';
3
3
 
4
4
  /* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
@@ -8023,6 +8023,12 @@ class Zmanim {
8023
8023
  }
8024
8024
  /**
8025
8025
  * Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.
8026
+ *
8027
+ * This method returns the latest *zman tfila* (time to recite shema in the morning)
8028
+ * that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
8029
+ * (depending on the `useElevation` setting), according
8030
+ * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
8031
+ *
8026
8032
  * If elevation is enabled, this function will include elevation in the calculation.
8027
8033
  * @return {Date}
8028
8034
  */
@@ -8032,19 +8038,16 @@ class Zmanim {
8032
8038
  /**
8033
8039
  * Returns an array with alot (Date) and ms in hour (number)
8034
8040
  * @private
8035
- * @return {any[]}
8036
8041
  */
8037
- getTemporalHour72() {
8038
- const alot72 = this.sunriseOffset(-72, false, true);
8039
- const tzeit72 = this.sunsetOffset(72, false, true);
8042
+ getTemporalHour72(forceSeaLevel) {
8043
+ const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);
8044
+ const tzeit72 = this.sunsetOffset(72, false, forceSeaLevel);
8040
8045
  const temporalHour = (tzeit72.getTime() - alot72.getTime()) / 12;
8041
8046
  return [alot72, temporalHour];
8042
8047
  }
8043
8048
  /**
8044
8049
  * Returns an array with alot (Date) and ms in hour (number)
8045
8050
  * @private
8046
- * @param {number} angle
8047
- * @return {any[]}
8048
8051
  */
8049
8052
  getTemporalHourByDeg(angle) {
8050
8053
  const alot = this.timeAtAngle(angle, true);
@@ -8060,8 +8063,9 @@ class Zmanim {
8060
8063
  * @return {Date}
8061
8064
  */
8062
8065
  sofZmanShmaMGA() {
8063
- const [alot72, temporalHour] = this.getTemporalHour72();
8064
- return new Date(alot72.getTime() + (3 * temporalHour));
8066
+ const [alot72, temporalHour] = this.getTemporalHour72(true);
8067
+ const offset = Math.floor(3 * temporalHour);
8068
+ return new Date(alot72.getTime() + offset);
8065
8069
  }
8066
8070
  /**
8067
8071
  * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
@@ -8071,7 +8075,8 @@ class Zmanim {
8071
8075
  */
8072
8076
  sofZmanShmaMGA16Point1() {
8073
8077
  const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);
8074
- return new Date(alot.getTime() + (3 * temporalHour));
8078
+ const offset = Math.floor(3 * temporalHour);
8079
+ return new Date(alot.getTime() + offset);
8075
8080
  }
8076
8081
  /**
8077
8082
  * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
@@ -8085,15 +8090,17 @@ class Zmanim {
8085
8090
  */
8086
8091
  sofZmanShmaMGA19Point8() {
8087
8092
  const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);
8088
- return new Date(alot.getTime() + (3 * temporalHour));
8093
+ const offset = Math.floor(3 * temporalHour);
8094
+ return new Date(alot.getTime() + offset);
8089
8095
  }
8090
8096
  /**
8091
8097
  * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham
8092
8098
  * @return {Date}
8093
8099
  */
8094
8100
  sofZmanTfillaMGA() {
8095
- const [alot72, temporalHour] = this.getTemporalHour72();
8096
- return new Date(alot72.getTime() + (4 * temporalHour));
8101
+ const [alot72, temporalHour] = this.getTemporalHour72(true);
8102
+ const offset = Math.floor(4 * temporalHour);
8103
+ return new Date(alot72.getTime() + offset);
8097
8104
  }
8098
8105
  /**
8099
8106
  * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
@@ -8103,7 +8110,8 @@ class Zmanim {
8103
8110
  */
8104
8111
  sofZmanTfillaMGA16Point1() {
8105
8112
  const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);
8106
- return new Date(alot.getTime() + (4 * temporalHour));
8113
+ const offset = Math.floor(4 * temporalHour);
8114
+ return new Date(alot.getTime() + offset);
8107
8115
  }
8108
8116
  /**
8109
8117
  * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
@@ -8117,24 +8125,67 @@ class Zmanim {
8117
8125
  */
8118
8126
  sofZmanTfillaMGA19Point8() {
8119
8127
  const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);
8120
- return new Date(alot.getTime() + (4 * temporalHour));
8128
+ const offset = Math.floor(4 * temporalHour);
8129
+ return new Date(alot.getTime() + offset);
8121
8130
  }
8122
8131
  /**
8123
- * Earliest Mincha – Mincha Gedola; Sunrise plus 6.5 halachic hours.
8132
+ * Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.
8124
8133
  * If elevation is enabled, this function will include elevation in the calculation.
8134
+ *
8135
+ * This method returns the latest mincha gedola, the earliest time one can pray mincha
8136
+ * that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise
8137
+ * (depending on the `useElevation` setting), according
8138
+ * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
8139
+ *
8140
+ * The Ramba"m is of the opinion that it is better to delay *mincha* until
8141
+ * *mincha ketana* while the Ra"sh, Tur, GRA and others are of the
8142
+ * opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.
8125
8143
  * @return {Date}
8126
8144
  */
8127
8145
  minchaGedola() {
8128
8146
  return this.getShaahZmanisBasedZman(6.5);
8129
8147
  }
8148
+ /**
8149
+ * Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.
8150
+ * If elevation is enabled, this function will include elevation in the calculation.
8151
+ *
8152
+ * This method returns the time of *mincha gedola* according to the Magen Avraham
8153
+ * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
8154
+ * This is the earliest time to pray *mincha*.
8155
+ * @return {Date}
8156
+ */
8157
+ minchaGedolaMGA() {
8158
+ const [alot72, temporalHour] = this.getTemporalHour72(false);
8159
+ const offset = Math.floor(6.5 * temporalHour);
8160
+ return new Date(alot72.getTime() + offset);
8161
+ }
8130
8162
  /**
8131
8163
  * Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.
8132
8164
  * If elevation is enabled, this function will include elevation in the calculation.
8165
+ *
8166
+ * This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the
8167
+ * opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,
8168
+ * that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
8169
+ * (depending on the `useElevation` setting), according
8170
+ * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
8133
8171
  * @return {Date}
8134
8172
  */
8135
8173
  minchaKetana() {
8136
8174
  return this.getShaahZmanisBasedZman(9.5);
8137
8175
  }
8176
+ /**
8177
+ * This method returns the time of *mincha ketana* according to the Magen Avraham
8178
+ * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
8179
+ * This is the preferred earliest time to pray *mincha* according to the opinion of
8180
+ * the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.
8181
+ *
8182
+ * If elevation is enabled, this function will include elevation in the calculation.
8183
+ * @return {Date}
8184
+ */
8185
+ minchaKetanaMGA() {
8186
+ const [alot72, temporalHour] = this.getTemporalHour72(false);
8187
+ return new Date(alot72.getTime() + Math.floor(9.5 * temporalHour));
8188
+ }
8138
8189
  /**
8139
8190
  * Plag haMincha; Sunrise plus 10.75 halachic hours.
8140
8191
  * If elevation is enabled, this function will include elevation in the calculation.
@@ -8633,13 +8684,6 @@ class OmerEvent extends Event {
8633
8684
  }
8634
8685
 
8635
8686
  class QuickLRU extends Map {
8636
- #size = 0;
8637
- #cache = new Map();
8638
- #oldCache = new Map();
8639
- #maxSize;
8640
- #maxAge;
8641
- #onEviction;
8642
-
8643
8687
  constructor(options = {}) {
8644
8688
  super();
8645
8689
 
@@ -8651,30 +8695,30 @@ class QuickLRU extends Map {
8651
8695
  throw new TypeError('`maxAge` must be a number greater than 0');
8652
8696
  }
8653
8697
 
8654
- this.#maxSize = options.maxSize;
8655
- this.#maxAge = options.maxAge || Number.POSITIVE_INFINITY;
8656
- this.#onEviction = options.onEviction;
8698
+ // TODO: Use private class fields when ESLint supports them.
8699
+ this.maxSize = options.maxSize;
8700
+ this.maxAge = options.maxAge || Number.POSITIVE_INFINITY;
8701
+ this.onEviction = options.onEviction;
8702
+ this.cache = new Map();
8703
+ this.oldCache = new Map();
8704
+ this._size = 0;
8657
8705
  }
8658
8706
 
8659
- // For tests.
8660
- get __oldCache() {
8661
- return this.#oldCache;
8662
- }
8663
-
8664
- #emitEvictions(cache) {
8665
- if (typeof this.#onEviction !== 'function') {
8707
+ // TODO: Use private class methods when targeting Node.js 16.
8708
+ _emitEvictions(cache) {
8709
+ if (typeof this.onEviction !== 'function') {
8666
8710
  return;
8667
8711
  }
8668
8712
 
8669
8713
  for (const [key, item] of cache) {
8670
- this.#onEviction(key, item.value);
8714
+ this.onEviction(key, item.value);
8671
8715
  }
8672
8716
  }
8673
8717
 
8674
- #deleteIfExpired(key, item) {
8718
+ _deleteIfExpired(key, item) {
8675
8719
  if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
8676
- if (typeof this.#onEviction === 'function') {
8677
- this.#onEviction(key, item.value);
8720
+ if (typeof this.onEviction === 'function') {
8721
+ this.onEviction(key, item.value);
8678
8722
  }
8679
8723
 
8680
8724
  return this.delete(key);
@@ -8683,54 +8727,54 @@ class QuickLRU extends Map {
8683
8727
  return false;
8684
8728
  }
8685
8729
 
8686
- #getOrDeleteIfExpired(key, item) {
8687
- const deleted = this.#deleteIfExpired(key, item);
8730
+ _getOrDeleteIfExpired(key, item) {
8731
+ const deleted = this._deleteIfExpired(key, item);
8688
8732
  if (deleted === false) {
8689
8733
  return item.value;
8690
8734
  }
8691
8735
  }
8692
8736
 
8693
- #getItemValue(key, item) {
8694
- return item.expiry ? this.#getOrDeleteIfExpired(key, item) : item.value;
8737
+ _getItemValue(key, item) {
8738
+ return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
8695
8739
  }
8696
8740
 
8697
- #peek(key, cache) {
8741
+ _peek(key, cache) {
8698
8742
  const item = cache.get(key);
8699
8743
 
8700
- return this.#getItemValue(key, item);
8744
+ return this._getItemValue(key, item);
8701
8745
  }
8702
8746
 
8703
- #set(key, value) {
8704
- this.#cache.set(key, value);
8705
- this.#size++;
8747
+ _set(key, value) {
8748
+ this.cache.set(key, value);
8749
+ this._size++;
8706
8750
 
8707
- if (this.#size >= this.#maxSize) {
8708
- this.#size = 0;
8709
- this.#emitEvictions(this.#oldCache);
8710
- this.#oldCache = this.#cache;
8711
- this.#cache = new Map();
8751
+ if (this._size >= this.maxSize) {
8752
+ this._size = 0;
8753
+ this._emitEvictions(this.oldCache);
8754
+ this.oldCache = this.cache;
8755
+ this.cache = new Map();
8712
8756
  }
8713
8757
  }
8714
8758
 
8715
- #moveToRecent(key, item) {
8716
- this.#oldCache.delete(key);
8717
- this.#set(key, item);
8759
+ _moveToRecent(key, item) {
8760
+ this.oldCache.delete(key);
8761
+ this._set(key, item);
8718
8762
  }
8719
8763
 
8720
- * #entriesAscending() {
8721
- for (const item of this.#oldCache) {
8764
+ * _entriesAscending() {
8765
+ for (const item of this.oldCache) {
8722
8766
  const [key, value] = item;
8723
- if (!this.#cache.has(key)) {
8724
- const deleted = this.#deleteIfExpired(key, value);
8767
+ if (!this.cache.has(key)) {
8768
+ const deleted = this._deleteIfExpired(key, value);
8725
8769
  if (deleted === false) {
8726
8770
  yield item;
8727
8771
  }
8728
8772
  }
8729
8773
  }
8730
8774
 
8731
- for (const item of this.#cache) {
8775
+ for (const item of this.cache) {
8732
8776
  const [key, value] = item;
8733
- const deleted = this.#deleteIfExpired(key, value);
8777
+ const deleted = this._deleteIfExpired(key, value);
8734
8778
  if (deleted === false) {
8735
8779
  yield item;
8736
8780
  }
@@ -8738,72 +8782,73 @@ class QuickLRU extends Map {
8738
8782
  }
8739
8783
 
8740
8784
  get(key) {
8741
- if (this.#cache.has(key)) {
8742
- const item = this.#cache.get(key);
8743
- return this.#getItemValue(key, item);
8785
+ if (this.cache.has(key)) {
8786
+ const item = this.cache.get(key);
8787
+
8788
+ return this._getItemValue(key, item);
8744
8789
  }
8745
8790
 
8746
- if (this.#oldCache.has(key)) {
8747
- const item = this.#oldCache.get(key);
8748
- if (this.#deleteIfExpired(key, item) === false) {
8749
- this.#moveToRecent(key, item);
8791
+ if (this.oldCache.has(key)) {
8792
+ const item = this.oldCache.get(key);
8793
+ if (this._deleteIfExpired(key, item) === false) {
8794
+ this._moveToRecent(key, item);
8750
8795
  return item.value;
8751
8796
  }
8752
8797
  }
8753
8798
  }
8754
8799
 
8755
- set(key, value, {maxAge = this.#maxAge} = {}) {
8756
- const expiry = typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY
8757
- ? (Date.now() + maxAge)
8758
- : undefined;
8759
-
8760
- if (this.#cache.has(key)) {
8761
- this.#cache.set(key, {
8800
+ set(key, value, {maxAge = this.maxAge} = {}) {
8801
+ const expiry =
8802
+ typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY ?
8803
+ Date.now() + maxAge :
8804
+ undefined;
8805
+ if (this.cache.has(key)) {
8806
+ this.cache.set(key, {
8762
8807
  value,
8763
- expiry,
8808
+ expiry
8764
8809
  });
8765
8810
  } else {
8766
- this.#set(key, {value, expiry});
8811
+ this._set(key, {value, expiry});
8767
8812
  }
8768
8813
 
8769
8814
  return this;
8770
8815
  }
8771
8816
 
8772
8817
  has(key) {
8773
- if (this.#cache.has(key)) {
8774
- return !this.#deleteIfExpired(key, this.#cache.get(key));
8818
+ if (this.cache.has(key)) {
8819
+ return !this._deleteIfExpired(key, this.cache.get(key));
8775
8820
  }
8776
8821
 
8777
- if (this.#oldCache.has(key)) {
8778
- return !this.#deleteIfExpired(key, this.#oldCache.get(key));
8822
+ if (this.oldCache.has(key)) {
8823
+ return !this._deleteIfExpired(key, this.oldCache.get(key));
8779
8824
  }
8780
8825
 
8781
8826
  return false;
8782
8827
  }
8783
8828
 
8784
8829
  peek(key) {
8785
- if (this.#cache.has(key)) {
8786
- return this.#peek(key, this.#cache);
8830
+ if (this.cache.has(key)) {
8831
+ return this._peek(key, this.cache);
8787
8832
  }
8788
8833
 
8789
- if (this.#oldCache.has(key)) {
8790
- return this.#peek(key, this.#oldCache);
8834
+ if (this.oldCache.has(key)) {
8835
+ return this._peek(key, this.oldCache);
8791
8836
  }
8792
8837
  }
8793
8838
 
8794
8839
  delete(key) {
8795
- const deleted = this.#cache.delete(key);
8840
+ const deleted = this.cache.delete(key);
8796
8841
  if (deleted) {
8797
- this.#size--;
8842
+ this._size--;
8798
8843
  }
8799
8844
 
8800
- return this.#oldCache.delete(key) || deleted;
8845
+ return this.oldCache.delete(key) || deleted;
8801
8846
  }
8802
8847
 
8803
8848
  clear() {
8804
- this.#cache.clear();
8805
- this.#oldCache.clear();
8806
- this.#size = 0;
8849
+ this.cache.clear();
8850
+ this.oldCache.clear();
8851
+ this._size = 0;
8807
8852
  }
8808
8853
 
8809
8854
  resize(newSize) {
@@ -8811,23 +8856,23 @@ class QuickLRU extends Map {
8811
8856
  throw new TypeError('`maxSize` must be a number greater than 0');
8812
8857
  }
8813
8858
 
8814
- const items = [...this.#entriesAscending()];
8859
+ const items = [...this._entriesAscending()];
8815
8860
  const removeCount = items.length - newSize;
8816
8861
  if (removeCount < 0) {
8817
- this.#cache = new Map(items);
8818
- this.#oldCache = new Map();
8819
- this.#size = items.length;
8862
+ this.cache = new Map(items);
8863
+ this.oldCache = new Map();
8864
+ this._size = items.length;
8820
8865
  } else {
8821
8866
  if (removeCount > 0) {
8822
- this.#emitEvictions(items.slice(0, removeCount));
8867
+ this._emitEvictions(items.slice(0, removeCount));
8823
8868
  }
8824
8869
 
8825
- this.#oldCache = new Map(items.slice(removeCount));
8826
- this.#cache = new Map();
8827
- this.#size = 0;
8870
+ this.oldCache = new Map(items.slice(removeCount));
8871
+ this.cache = new Map();
8872
+ this._size = 0;
8828
8873
  }
8829
8874
 
8830
- this.#maxSize = newSize;
8875
+ this.maxSize = newSize;
8831
8876
  }
8832
8877
 
8833
8878
  * keys() {
@@ -8843,18 +8888,18 @@ class QuickLRU extends Map {
8843
8888
  }
8844
8889
 
8845
8890
  * [Symbol.iterator]() {
8846
- for (const item of this.#cache) {
8891
+ for (const item of this.cache) {
8847
8892
  const [key, value] = item;
8848
- const deleted = this.#deleteIfExpired(key, value);
8893
+ const deleted = this._deleteIfExpired(key, value);
8849
8894
  if (deleted === false) {
8850
8895
  yield [key, value.value];
8851
8896
  }
8852
8897
  }
8853
8898
 
8854
- for (const item of this.#oldCache) {
8899
+ for (const item of this.oldCache) {
8855
8900
  const [key, value] = item;
8856
- if (!this.#cache.has(key)) {
8857
- const deleted = this.#deleteIfExpired(key, value);
8901
+ if (!this.cache.has(key)) {
8902
+ const deleted = this._deleteIfExpired(key, value);
8858
8903
  if (deleted === false) {
8859
8904
  yield [key, value.value];
8860
8905
  }
@@ -8863,22 +8908,22 @@ class QuickLRU extends Map {
8863
8908
  }
8864
8909
 
8865
8910
  * entriesDescending() {
8866
- let items = [...this.#cache];
8911
+ let items = [...this.cache];
8867
8912
  for (let i = items.length - 1; i >= 0; --i) {
8868
8913
  const item = items[i];
8869
8914
  const [key, value] = item;
8870
- const deleted = this.#deleteIfExpired(key, value);
8915
+ const deleted = this._deleteIfExpired(key, value);
8871
8916
  if (deleted === false) {
8872
8917
  yield [key, value.value];
8873
8918
  }
8874
8919
  }
8875
8920
 
8876
- items = [...this.#oldCache];
8921
+ items = [...this.oldCache];
8877
8922
  for (let i = items.length - 1; i >= 0; --i) {
8878
8923
  const item = items[i];
8879
8924
  const [key, value] = item;
8880
- if (!this.#cache.has(key)) {
8881
- const deleted = this.#deleteIfExpired(key, value);
8925
+ if (!this.cache.has(key)) {
8926
+ const deleted = this._deleteIfExpired(key, value);
8882
8927
  if (deleted === false) {
8883
8928
  yield [key, value.value];
8884
8929
  }
@@ -8887,28 +8932,24 @@ class QuickLRU extends Map {
8887
8932
  }
8888
8933
 
8889
8934
  * entriesAscending() {
8890
- for (const [key, value] of this.#entriesAscending()) {
8935
+ for (const [key, value] of this._entriesAscending()) {
8891
8936
  yield [key, value.value];
8892
8937
  }
8893
8938
  }
8894
8939
 
8895
8940
  get size() {
8896
- if (!this.#size) {
8897
- return this.#oldCache.size;
8941
+ if (!this._size) {
8942
+ return this.oldCache.size;
8898
8943
  }
8899
8944
 
8900
8945
  let oldCacheSize = 0;
8901
- for (const key of this.#oldCache.keys()) {
8902
- if (!this.#cache.has(key)) {
8946
+ for (const key of this.oldCache.keys()) {
8947
+ if (!this.cache.has(key)) {
8903
8948
  oldCacheSize++;
8904
8949
  }
8905
8950
  }
8906
8951
 
8907
- return Math.min(this.#size + oldCacheSize, this.#maxSize);
8908
- }
8909
-
8910
- get maxSize() {
8911
- return this.#maxSize;
8952
+ return Math.min(this._size + oldCacheSize, this.maxSize);
8912
8953
  }
8913
8954
 
8914
8955
  entries() {
@@ -8960,6 +9001,19 @@ class QuickLRU extends Map {
8960
9001
  const INCOMPLETE = 0;
8961
9002
  const REGULAR = 1;
8962
9003
  const COMPLETE = 2;
9004
+ function yearType(hyear) {
9005
+ const longC = HDate.longCheshvan(hyear);
9006
+ const shortK = HDate.shortKislev(hyear);
9007
+ if (longC && !shortK) {
9008
+ return COMPLETE;
9009
+ }
9010
+ else if (!longC && shortK) {
9011
+ return INCOMPLETE;
9012
+ }
9013
+ else {
9014
+ return REGULAR;
9015
+ }
9016
+ }
8963
9017
  /**
8964
9018
  * Represents Parashah HaShavua for an entire Hebrew year
8965
9019
  */
@@ -8971,11 +9025,6 @@ class Sedra {
8971
9025
  */
8972
9026
  constructor(hyear, il) {
8973
9027
  hyear = +hyear;
8974
- const longC = HDate.longCheshvan(hyear);
8975
- const shortK = HDate.shortKislev(hyear);
8976
- const type = (longC && !shortK) ? COMPLETE :
8977
- (!longC && shortK) ? INCOMPLETE :
8978
- REGULAR;
8979
9028
  this.year = hyear;
8980
9029
  const rh0 = new HDate(1, months.TISHREI, hyear);
8981
9030
  const rh = rh0.abs();
@@ -8984,6 +9033,7 @@ class Sedra {
8984
9033
  this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);
8985
9034
  const leap = +HDate.isLeapYear(hyear);
8986
9035
  this.il = Boolean(il);
9036
+ const type = yearType(hyear);
8987
9037
  let key = `${leap}${rhDay}${type}`;
8988
9038
  if (types[key]) {
8989
9039
  this.theSedraArray = types[key];
@@ -9236,7 +9286,6 @@ const YK = 'Yom Kippur'; // 1
9236
9286
  const SUKKOT = 'Sukkot'; // 0
9237
9287
  const CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0
9238
9288
  const SHMINI = 'Shmini Atzeret'; // 0
9239
- const EOY = CHMSUKOT; // always Sukkot day 3, 5 or 6
9240
9289
  const PESACH = 'Pesach'; // 25
9241
9290
  const PESACH1 = 'Pesach I';
9242
9291
  const CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25
@@ -9253,75 +9302,81 @@ const SHAVUOT$1 = 'Shavuot'; // 33
9253
9302
  function range$1(start, stop) {
9254
9303
  return Array.from({ length: stop - start + 1 }, (v, k) => k + start);
9255
9304
  }
9256
- const empty = [];
9305
+ const yearStartVayeilech = [51, 52, CHMSUKOT];
9306
+ const yearStartHaazinu = [52, YK, CHMSUKOT];
9307
+ const yearStartRH = [RH, 52, SUKKOT, SHMINI];
9308
+ const r020 = range$1(0, 20);
9309
+ const r027 = range$1(0, 27);
9310
+ const r3340 = range$1(33, 40);
9311
+ const r4349 = range$1(43, 49);
9312
+ const r4350 = range$1(43, 50);
9257
9313
  /**
9258
9314
  * The ordinary year types (keviot)
9259
9315
  * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel
9260
9316
  * @private
9261
9317
  * @readonly
9262
- * @type {Object.<string, NumberOrString[]>}
9263
9318
  */
9264
9319
  const types = {
9265
9320
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
9266
9321
  * Kislev each have 29 days), and has Passover start on Tuesday. */
9267
9322
  // e.g. 5753
9268
- '020': empty.concat(51, 52, EOY, range$1(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 49), D(50)),
9323
+ '020': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
9269
9324
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
9270
9325
  * Kislev each have 30 days), and has Passover start on Thursday. */
9271
9326
  // e.g. 5756
9272
- '0220': empty.concat(51, 52, EOY, range$1(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), 33, SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), range$1(43, 49), D(50)),
9327
+ '0220': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), 33, SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
9273
9328
  /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
9274
9329
  * days and Kislev has 30 days), and has Passover start on Saturday. */
9275
9330
  // e.g. 5701
9276
- '0510': empty.concat(52, YK, EOY, range$1(0, 20), D(21), 23, 24, PESACH1, PESACH8, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 50)),
9331
+ '0510': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH1, PESACH8, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
9277
9332
  /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
9278
9333
  * days and Kislev has 30 days), and has Passover start on Saturday. */
9279
9334
  // e.g. 5745
9280
- '0511': empty.concat(52, YK, EOY, range$1(0, 20), D(21), 23, 24, PESACH, 25, D(26), D(28), range$1(30, 40), D(41), range$1(43, 50)),
9335
+ '0511': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), range$1(30, 40), D(41), r4350),
9281
9336
  /* Hebrew year that starts on Thursday, is `complete' (Heshvan and
9282
9337
  * Kislev each have 30 days), and has Passover start on Sunday. */
9283
9338
  // e.g. 5754
9284
- '052': empty.concat(52, YK, CHMSUKOT, range$1(0, 24), PESACH7, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 50)),
9339
+ '052': yearStartHaazinu.concat(range$1(0, 24), PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
9285
9340
  /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev
9286
9341
  * each have 29 days), and has Passover start on Sunday. */
9287
9342
  // e.g. 5761
9288
- '070': empty.concat(RH, 52, SUKKOT, SHMINI, range$1(0, 20), D(21), 23, 24, PESACH7, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 50)),
9343
+ '070': yearStartRH.concat(r020, D(21), 23, 24, PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
9289
9344
  /* Hebrew year that starts on Saturday, is `complete' (Heshvan and
9290
9345
  * Kislev each have 30 days), and has Passover start on Tuesday. */
9291
9346
  // e.g. 5716
9292
- '072': empty.concat(RH, 52, SUKKOT, SHMINI, range$1(0, 20), D(21), 23, 24, CHMPESACH, 25, D(26), D(28), 30, D(31), range$1(33, 40), D(41), range$1(43, 49), D(50)),
9347
+ '072': yearStartRH.concat(r020, D(21), 23, 24, CHMPESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
9293
9348
  /* -- The leap year types (keviot) -- */
9294
9349
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
9295
9350
  * Kislev each have 29 days), and has Passover start on Thursday. */
9296
9351
  // e.g. 5746
9297
- '1200': empty.concat(51, 52, CHMSUKOT, range$1(0, 27), CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), range$1(43, 49), D(50)),
9352
+ '1200': yearStartVayeilech.concat(r027, CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
9298
9353
  /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
9299
9354
  * Kislev each have 29 days), and has Passover start on Thursday. */
9300
9355
  // e.g. 5746
9301
- '1201': empty.concat(51, 52, CHMSUKOT, range$1(0, 27), CHMPESACH, range$1(28, 40), D(41), range$1(43, 49), D(50)),
9356
+ '1201': yearStartVayeilech.concat(r027, CHMPESACH, range$1(28, 40), D(41), r4349, D(50)),
9302
9357
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
9303
9358
  * Kislev each have 30 days), and has Passover start on Saturday. */
9304
9359
  // e.g.5752
9305
- '1220': empty.concat(51, 52, CHMSUKOT, range$1(0, 27), PESACH1, PESACH8, range$1(28, 40), D(41), range$1(43, 50)),
9360
+ '1220': yearStartVayeilech.concat(r027, PESACH1, PESACH8, range$1(28, 40), D(41), r4350),
9306
9361
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
9307
9362
  * Kislev each have 30 days), and has Passover start on Saturday. */
9308
9363
  // e.g.5752
9309
- '1221': empty.concat(51, 52, CHMSUKOT, range$1(0, 27), PESACH, range$1(28, 50)),
9364
+ '1221': yearStartVayeilech.concat(r027, PESACH, range$1(28, 50)),
9310
9365
  /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and
9311
9366
  * Kislev both have 29 days), and has Passover start on Sunday. */
9312
9367
  // e.g. 5768
9313
- '150': empty.concat(52, YK, CHMSUKOT, range$1(0, 28), PESACH7, range$1(29, 50)),
9368
+ '150': yearStartHaazinu.concat(range$1(0, 28), PESACH7, range$1(29, 50)),
9314
9369
  /* Hebrew year that starts on Thursday, is `complete' (Heshvan and
9315
9370
  * Kislev both have 30 days), and has Passover start on Tuesday. */
9316
9371
  // eg. 5771
9317
- '152': empty.concat(52, YK, CHMSUKOT, range$1(0, 28), CHMPESACH, range$1(29, 49), D(50)),
9372
+ '152': yearStartHaazinu.concat(range$1(0, 28), CHMPESACH, range$1(29, 49), D(50)),
9318
9373
  /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and
9319
9374
  * Kislev each have 29 days), and has Passover start on Tuesday. */
9320
9375
  // e.g.5757
9321
- '170': empty.concat(RH, 52, SUKKOT, SHMINI, range$1(0, 27), CHMPESACH, range$1(28, 40), D(41), range$1(43, 49), D(50)),
9376
+ '170': yearStartRH.concat(r027, CHMPESACH, range$1(28, 40), D(41), r4349, D(50)),
9322
9377
  /* Hebrew year that starts on Saturday, is `complete' (Heshvan and
9323
9378
  * Kislev each have 30 days), and has Passover start on Thursday. */
9324
- '1720': empty.concat(RH, 52, SUKKOT, SHMINI, range$1(0, 27), CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), range$1(43, 49), D(50)),
9379
+ '1720': yearStartRH.concat(r027, CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
9325
9380
  };
9326
9381
  /* Hebrew year that starts on Monday, is `complete' (Heshvan and
9327
9382
  * Kislev each have 30 days), and has Passover start on Thursday. */
@@ -9345,6 +9400,8 @@ types['1311'] = types['1221'];
9345
9400
  types['1721'] = types['170'];
9346
9401
  const sedraCache = new QuickLRU({ maxSize: 400 });
9347
9402
  /**
9403
+ * Convenience function to create an instance of `Sedra` or reuse a previously
9404
+ * created and cached instance.
9348
9405
  * @private
9349
9406
  * @param {number} hyear
9350
9407
  * @param {boolean} il
@@ -10009,7 +10066,7 @@ class DailyLearning {
10009
10066
  }
10010
10067
 
10011
10068
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
10012
- const version = '5.4.3';
10069
+ const version = '5.4.5';
10013
10070
 
10014
10071
  /* eslint-disable max-len */
10015
10072
  /**
@@ -10865,20 +10922,7 @@ function checkCandleOptions(options) {
10865
10922
  }
10866
10923
  let min = Number(options.candleLightingMins) || 18;
10867
10924
  if (location.getIsrael() && Math.abs(min) === 18) {
10868
- const geoid = location.getGeoId();
10869
- if (geoid) {
10870
- const offset = geoIdCandleOffset[geoid];
10871
- if (typeof offset === 'number') {
10872
- min = offset;
10873
- }
10874
- }
10875
- const shortName = location.getShortName();
10876
- if (shortName) {
10877
- const offset = israelCityOffset[shortName];
10878
- if (typeof offset === 'number') {
10879
- min = offset;
10880
- }
10881
- }
10925
+ min = overrideIsraelCandleMins(location, min);
10882
10926
  }
10883
10927
  options.candleLightingMins = -1 * Math.abs(min);
10884
10928
  if (typeof options.havdalahMins === 'number') {
@@ -10894,6 +10938,23 @@ function checkCandleOptions(options) {
10894
10938
  options.fastEndDeg = TZEIT_3MEDIUM_STARS;
10895
10939
  }
10896
10940
  }
10941
+ function overrideIsraelCandleMins(location, min) {
10942
+ const geoid = location.getGeoId();
10943
+ if (geoid) {
10944
+ const offset = geoIdCandleOffset[geoid];
10945
+ if (typeof offset === 'number') {
10946
+ return offset;
10947
+ }
10948
+ }
10949
+ const shortName = location.getShortName();
10950
+ if (shortName) {
10951
+ const offset = israelCityOffset[shortName];
10952
+ if (typeof offset === 'number') {
10953
+ return offset;
10954
+ }
10955
+ }
10956
+ return min;
10957
+ }
10897
10958
  /**
10898
10959
  * Mask to filter Holiday array
10899
10960
  * @private