@hebcal/core 5.4.11 → 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.11 */
1
+ /*! @hebcal/core v5.5.0 */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
@@ -2293,7 +2293,7 @@ var check = function (it) {
2293
2293
  };
2294
2294
 
2295
2295
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
2296
- var global$a =
2296
+ var globalThis_1 =
2297
2297
  // eslint-disable-next-line es/no-global-this -- safe
2298
2298
  check(typeof globalThis == 'object' && globalThis) ||
2299
2299
  check(typeof window == 'object' && window) ||
@@ -2444,7 +2444,7 @@ var isObject$5 = function (it) {
2444
2444
  return typeof it == 'object' ? it !== null : isCallable$9(it);
2445
2445
  };
2446
2446
 
2447
- var global$9 = global$a;
2447
+ var globalThis$b = globalThis_1;
2448
2448
  var isCallable$8 = isCallable$a;
2449
2449
 
2450
2450
  var aFunction = function (argument) {
@@ -2452,20 +2452,25 @@ var aFunction = function (argument) {
2452
2452
  };
2453
2453
 
2454
2454
  var getBuiltIn$3 = function (namespace, method) {
2455
- 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];
2456
2456
  };
2457
2457
 
2458
2458
  var uncurryThis$6 = functionUncurryThis;
2459
2459
 
2460
2460
  var objectIsPrototypeOf = uncurryThis$6({}.isPrototypeOf);
2461
2461
 
2462
- var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
2462
+ var globalThis$a = globalThis_1;
2463
2463
 
2464
- var global$8 = global$a;
2465
- var userAgent = engineUserAgent;
2464
+ var navigator = globalThis$a.navigator;
2465
+ var userAgent$1 = navigator && navigator.userAgent;
2466
2466
 
2467
- var process = global$8.process;
2468
- 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;
2469
2474
  var versions = process && process.versions || Deno && Deno.version;
2470
2475
  var v8 = versions && versions.v8;
2471
2476
  var match, version$1;
@@ -2487,14 +2492,14 @@ if (!version$1 && userAgent) {
2487
2492
  }
2488
2493
  }
2489
2494
 
2490
- var engineV8Version = version$1;
2495
+ var environmentV8Version = version$1;
2491
2496
 
2492
2497
  /* eslint-disable es/no-symbol -- required for testing */
2493
- var V8_VERSION = engineV8Version;
2498
+ var V8_VERSION = environmentV8Version;
2494
2499
  var fails$5 = fails$9;
2495
- var global$7 = global$a;
2500
+ var globalThis$8 = globalThis_1;
2496
2501
 
2497
- var $String$3 = global$7.String;
2502
+ var $String$3 = globalThis$8.String;
2498
2503
 
2499
2504
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
2500
2505
  var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5(function () {
@@ -2578,30 +2583,30 @@ var ordinaryToPrimitive$1 = function (input, pref) {
2578
2583
 
2579
2584
  var sharedStore = {exports: {}};
2580
2585
 
2581
- var global$6 = global$a;
2586
+ var globalThis$7 = globalThis_1;
2582
2587
 
2583
2588
  // eslint-disable-next-line es/no-object-defineproperty -- safe
2584
2589
  var defineProperty$2 = Object.defineProperty;
2585
2590
 
2586
2591
  var defineGlobalProperty$3 = function (key, value) {
2587
2592
  try {
2588
- defineProperty$2(global$6, key, { value: value, configurable: true, writable: true });
2593
+ defineProperty$2(globalThis$7, key, { value: value, configurable: true, writable: true });
2589
2594
  } catch (error) {
2590
- global$6[key] = value;
2595
+ globalThis$7[key] = value;
2591
2596
  } return value;
2592
2597
  };
2593
2598
 
2594
- var globalThis$1 = global$a;
2599
+ var globalThis$6 = globalThis_1;
2595
2600
  var defineGlobalProperty$2 = defineGlobalProperty$3;
2596
2601
 
2597
2602
  var SHARED = '__core-js_shared__';
2598
- var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
2603
+ var store$3 = sharedStore.exports = globalThis$6[SHARED] || defineGlobalProperty$2(SHARED, {});
2599
2604
 
2600
2605
  (store$3.versions || (store$3.versions = [])).push({
2601
- version: '3.37.1',
2606
+ version: '3.38.1',
2602
2607
  mode: 'global',
2603
2608
  copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
2604
- 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',
2605
2610
  source: 'https://github.com/zloirock/core-js'
2606
2611
  });
2607
2612
 
@@ -2645,14 +2650,14 @@ var uid$2 = function (key) {
2645
2650
  return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$1(++id + postfix, 36);
2646
2651
  };
2647
2652
 
2648
- var global$5 = global$a;
2653
+ var globalThis$5 = globalThis_1;
2649
2654
  var shared$2 = shared$3;
2650
2655
  var hasOwn$6 = hasOwnProperty_1;
2651
2656
  var uid$1 = uid$2;
2652
2657
  var NATIVE_SYMBOL = symbolConstructorDetection;
2653
2658
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
2654
2659
 
2655
- var Symbol$1 = global$5.Symbol;
2660
+ var Symbol$1 = globalThis$5.Symbol;
2656
2661
  var WellKnownSymbolsStore = shared$2('wks');
2657
2662
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
2658
2663
 
@@ -2700,10 +2705,10 @@ var toPropertyKey$2 = function (argument) {
2700
2705
  return isSymbol(key) ? key : key + '';
2701
2706
  };
2702
2707
 
2703
- var global$4 = global$a;
2708
+ var globalThis$4 = globalThis_1;
2704
2709
  var isObject$2 = isObject$5;
2705
2710
 
2706
- var document$1 = global$4.document;
2711
+ var document$1 = globalThis$4.document;
2707
2712
  // typeof document.createElement is 'object' in old IE
2708
2713
  var EXISTS$1 = isObject$2(document$1) && isObject$2(document$1.createElement);
2709
2714
 
@@ -2862,10 +2867,10 @@ if (!isCallable$4(store$1.inspectSource)) {
2862
2867
 
2863
2868
  var inspectSource$1 = store$1.inspectSource;
2864
2869
 
2865
- var global$3 = global$a;
2870
+ var globalThis$3 = globalThis_1;
2866
2871
  var isCallable$3 = isCallable$a;
2867
2872
 
2868
- var WeakMap$2 = global$3.WeakMap;
2873
+ var WeakMap$2 = globalThis$3.WeakMap;
2869
2874
 
2870
2875
  var weakMapBasicDetection = isCallable$3(WeakMap$2) && /native code/.test(String(WeakMap$2));
2871
2876
 
@@ -2881,7 +2886,7 @@ var sharedKey$2 = function (key) {
2881
2886
  var hiddenKeys$4 = {};
2882
2887
 
2883
2888
  var NATIVE_WEAK_MAP = weakMapBasicDetection;
2884
- var global$2 = global$a;
2889
+ var globalThis$2 = globalThis_1;
2885
2890
  var isObject = isObject$5;
2886
2891
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
2887
2892
  var hasOwn$3 = hasOwnProperty_1;
@@ -2890,8 +2895,8 @@ var sharedKey$1 = sharedKey$2;
2890
2895
  var hiddenKeys$3 = hiddenKeys$4;
2891
2896
 
2892
2897
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
2893
- var TypeError$1 = global$2.TypeError;
2894
- var WeakMap$1 = global$2.WeakMap;
2898
+ var TypeError$1 = globalThis$2.TypeError;
2899
+ var WeakMap$1 = globalThis$2.WeakMap;
2895
2900
  var set, get, has;
2896
2901
 
2897
2902
  var enforce = function (it) {
@@ -3229,7 +3234,7 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
3229
3234
 
3230
3235
  var isForced_1 = isForced$1;
3231
3236
 
3232
- var global$1 = global$a;
3237
+ var globalThis$1 = globalThis_1;
3233
3238
  var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
3234
3239
  var createNonEnumerableProperty = createNonEnumerableProperty$2;
3235
3240
  var defineBuiltIn = defineBuiltIn$1;
@@ -3258,11 +3263,11 @@ var _export = function (options, source) {
3258
3263
  var STATIC = options.stat;
3259
3264
  var FORCED, target, key, targetProperty, sourceProperty, descriptor;
3260
3265
  if (GLOBAL) {
3261
- target = global$1;
3266
+ target = globalThis$1;
3262
3267
  } else if (STATIC) {
3263
- target = global$1[TARGET] || defineGlobalProperty(TARGET, {});
3268
+ target = globalThis$1[TARGET] || defineGlobalProperty(TARGET, {});
3264
3269
  } else {
3265
- target = global$1[TARGET] && global$1[TARGET].prototype;
3270
+ target = globalThis$1[TARGET] && globalThis$1[TARGET].prototype;
3266
3271
  }
3267
3272
  if (target) for (key in source) {
3268
3273
  sourceProperty = source[key];
@@ -3347,7 +3352,8 @@ var NullProtoObjectViaActiveX = function (activeXDocument) {
3347
3352
  activeXDocument.write(scriptTag(''));
3348
3353
  activeXDocument.close();
3349
3354
  var temp = activeXDocument.parentWindow.Object;
3350
- activeXDocument = null; // avoid memory leak
3355
+ // eslint-disable-next-line no-useless-assignment -- avoid memory leak
3356
+ activeXDocument = null;
3351
3357
  return temp;
3352
3358
  };
3353
3359
 
@@ -6391,7 +6397,7 @@ const expectedInteger = (e, n) => `Non-integer ${e}: ${n}`,
6391
6397
  Ta = "UTC",
6392
6398
  Da = 5184e3,
6393
6399
  Ia = /*@__PURE__*/isoArgsToEpochSec(1847),
6394
- Ma = /*@__PURE__*/isoArgsToEpochSec( /*@__PURE__*/( /*@__PURE__*/new Date()).getUTCFullYear() + 10),
6400
+ Ma = /*@__PURE__*/isoArgsToEpochSec(/*@__PURE__*/(/*@__PURE__*/new Date()).getUTCFullYear() + 10),
6395
6401
  Na = /0+$/,
6396
6402
  fn = /*@__PURE__*/Jn(_zonedEpochSlotsToIso, WeakMap),
6397
6403
  ya = 2 ** 32 - 1,
@@ -6737,7 +6743,7 @@ const Pa = "([+−-])",
6737
6743
  return [];
6738
6744
  }
6739
6745
  },
6740
- Y = /*@__PURE__*/createNativeOpsCreator( /*@__PURE__*/Object.assign({}, Va, Ja, {
6746
+ Y = /*@__PURE__*/createNativeOpsCreator(/*@__PURE__*/Object.assign({}, Va, Ja, {
6741
6747
  h: computeIsoDateParts,
6742
6748
  ee(e) {
6743
6749
  return this.id === gi ? computeGregoryEraParts(e) : this.id === Ti ? Gi(e) : [];
@@ -9172,6 +9178,7 @@ class Location extends GeoLocation {
9172
9178
  * @param dst single char 'Y' or 'N'
9173
9179
  */
9174
9180
  static getUsaTzid(state, tz, dst) {
9181
+ tz = +tz;
9175
9182
  if (tz === 10 && state === 'AK') {
9176
9183
  return 'America/Adak';
9177
9184
  }
@@ -9739,6 +9746,40 @@ class Zmanim {
9739
9746
  }
9740
9747
  return new Date(sunset.getTime() + offset * 60 * 1000);
9741
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
+ }
9742
9783
  }
9743
9784
 
9744
9785
  const hour12cc = {
@@ -11684,7 +11725,7 @@ class DailyLearning {
11684
11725
  }
11685
11726
 
11686
11727
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
11687
- const version = '5.4.11';
11728
+ const version = '5.5.0';
11688
11729
 
11689
11730
  /* eslint-disable max-len */
11690
11731
  /**