@20minutes/hela 2.0.4 → 2.0.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.
@@ -163,12 +163,12 @@ const Tt = () => {
163
163
  }
164
164
  }, 1e3);
165
165
  }
166
- }, $t = (s) => {
166
+ }, Zt = (s) => {
167
167
  const t = s.getBBox(), e = t.width / 20;
168
168
  return [t.x - e, t.y - e, t.width + e * 2, t.height + e * 2].join(
169
169
  " "
170
170
  );
171
- }, Zt = () => {
171
+ }, $t = () => {
172
172
  const s = document.querySelector(".c-map-districts-container"), t = document.querySelector(".c-map-districts");
173
173
  if (!s || !t)
174
174
  return;
@@ -222,7 +222,7 @@ const Tt = () => {
222
222
  );
223
223
  c(
224
224
  y || f,
225
- $t(y || f)
225
+ Zt(y || f)
226
226
  );
227
227
  }
228
228
  }, p = () => {
@@ -356,17 +356,17 @@ function Q(s) {
356
356
  (s.querySelector("[autofocus]") || s).focus();
357
357
  }
358
358
  function Yt(s) {
359
- const t = Z(s, !0), e = t ? Z(s, !1) || t : null;
359
+ const t = $(s, !0), e = t ? $(s, !1) || t : null;
360
360
  return [t, e];
361
361
  }
362
- function Z(s, t) {
362
+ function $(s, t) {
363
363
  if (t && et(s))
364
364
  return s;
365
365
  if (Jt(s))
366
366
  if (s.shadowRoot) {
367
367
  let e = J(s.shadowRoot, t);
368
368
  for (; e; ) {
369
- const i = Z(e, t);
369
+ const i = $(e, t);
370
370
  if (i)
371
371
  return i;
372
372
  e = tt(e, t);
@@ -377,14 +377,14 @@ function Z(s, t) {
377
377
  });
378
378
  t || e.reverse();
379
379
  for (const i of e) {
380
- const n = Z(i, t);
380
+ const n = $(i, t);
381
381
  if (n)
382
382
  return n;
383
383
  }
384
384
  } else {
385
385
  let e = J(s, t);
386
386
  for (; e; ) {
387
- const i = Z(e, t);
387
+ const i = $(e, t);
388
388
  if (i)
389
389
  return i;
390
390
  e = tt(e, t);
@@ -519,22 +519,19 @@ typeof document < "u" && (document.readyState === "loading" ? document.addEventL
519
519
  const ee = () => document.querySelectorAll(".js-modal").forEach((s) => {
520
520
  if (!(s instanceof HTMLElement))
521
521
  return;
522
- const t = new ft(s), e = {
523
- x: 0,
524
- y: 0
525
- };
522
+ const t = new ft(s);
526
523
  if (s.id === "dialog-menu") {
527
- const i = document.querySelectorAll("button[data-a11y-dialog-show='dialog-menu']"), n = document.querySelectorAll("button[data-a11y-dialog-hide='dialog-menu']");
528
- i.length > 0 && n.length > 0 && (t.on("show", () => {
529
- i.forEach((o) => o.classList.add("u-hidden")), n.forEach((o) => o.classList.remove("u-hidden"));
524
+ const e = document.querySelectorAll("button[data-a11y-dialog-show='dialog-menu']"), i = document.querySelectorAll("button[data-a11y-dialog-hide='dialog-menu']");
525
+ e.length > 0 && i.length > 0 && (t.on("show", () => {
526
+ e.forEach((n) => n.classList.add("u-hidden")), i.forEach((n) => n.classList.remove("u-hidden"));
530
527
  }), t.on("hide", () => {
531
- i.forEach((o) => o.classList.remove("u-hidden")), n.forEach((o) => o.classList.add("u-hidden"));
528
+ e.forEach((n) => n.classList.remove("u-hidden")), i.forEach((n) => n.classList.add("u-hidden"));
532
529
  }));
533
530
  }
534
531
  t.on("show", () => {
535
- e.x = window.scrollX, e.y = window.scrollY, document.body.classList.add("noscroll"), document.body.style.top = `-${e.y}px`;
532
+ document.body.classList.add("noscroll");
536
533
  }).on("hide", () => {
537
- document.body.classList.remove("noscroll"), document.body.style.top = "", (window.scrollY !== e.y || window.scrollX !== e.x) && window.scroll(e.x, e.y);
534
+ document.body.classList.remove("noscroll");
538
535
  });
539
536
  }), ie = ({ navigatedList: s, nextBtn: t, prevBtn: e }) => {
540
537
  var o, r, a, l, h, c, d, p;
@@ -2257,7 +2254,7 @@ class Re {
2257
2254
  this._helperTimeout && clearTimeout(this._helperTimeout), he(this._target), this._target.removeEventListener("transitionend", this._onTransitionEnd, !1), this._target.removeEventListener("transitioncancel", this._onTransitionEnd, !1), this._finished || this._finalizeAnimation();
2258
2255
  }
2259
2256
  }
2260
- const $e = 12, Ze = 0.75;
2257
+ const Ze = 12, $e = 0.75;
2261
2258
  class Fe {
2262
2259
  /**
2263
2260
  * @param {number} initialVelocity Initial velocity, px per ms.
@@ -2275,7 +2272,7 @@ class Fe {
2275
2272
  * Recommended value from 10 to 50
2276
2273
  */
2277
2274
  constructor(t, e, i) {
2278
- this.velocity = t * 1e3, this._dampingRatio = e || Ze, this._naturalFrequency = i || $e, this._dampedFrequency = this._naturalFrequency, this._dampingRatio < 1 && (this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio));
2275
+ this.velocity = t * 1e3, this._dampingRatio = e || $e, this._naturalFrequency = i || Ze, this._dampedFrequency = this._naturalFrequency, this._dampingRatio < 1 && (this._dampedFrequency *= Math.sqrt(1 - this._dampingRatio * this._dampingRatio));
2279
2276
  }
2280
2277
  /**
2281
2278
  * @param {number} deltaPosition Difference between current and end position of the animation
@@ -3674,7 +3671,7 @@ const b = {
3674
3671
  function ui(s) {
3675
3672
  return "button" in s && s.button === 1 || s.ctrlKey || s.metaKey || s.altKey || s.shiftKey;
3676
3673
  }
3677
- function $(s, t, e = document) {
3674
+ function Z(s, t, e = document) {
3678
3675
  let i = [];
3679
3676
  if (s instanceof Element)
3680
3677
  i = [s];
@@ -4244,7 +4241,7 @@ class bi extends mi {
4244
4241
  */
4245
4242
  _getGalleryDOMElements(t) {
4246
4243
  var e, i;
4247
- return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? $(this.options.children, this.options.childSelector, t) || [] : [t];
4244
+ return (e = this.options) !== null && e !== void 0 && e.children || (i = this.options) !== null && i !== void 0 && i.childSelector ? Z(this.options.children, this.options.childSelector, t) || [] : [t];
4248
4245
  }
4249
4246
  /**
4250
4247
  * Converts DOM element to item data object.
@@ -4293,7 +4290,7 @@ class Li extends bi {
4293
4290
  * It's not included in the main constructor, so you may bind events before it.
4294
4291
  */
4295
4292
  init() {
4296
- $(this.options.gallery, this.options.gallerySelector).forEach((t) => {
4293
+ Z(this.options.gallery, this.options.gallerySelector).forEach((t) => {
4297
4294
  t.addEventListener("click", this.onThumbnailsClick, !1);
4298
4295
  });
4299
4296
  }
@@ -4330,7 +4327,7 @@ class Li extends bi {
4330
4327
  const e = (
4331
4328
  /** @type {HTMLElement} */
4332
4329
  t.target
4333
- ), n = $(
4330
+ ), n = Z(
4334
4331
  this.options.children,
4335
4332
  this.options.childSelector,
4336
4333
  /** @type {HTMLElement} */
@@ -4350,7 +4347,7 @@ class Li extends bi {
4350
4347
  if (window.pswp || !this.options)
4351
4348
  return !1;
4352
4349
  if (!e && this.options.gallery && this.options.children) {
4353
- const n = $(this.options.gallery);
4350
+ const n = Z(this.options.gallery);
4354
4351
  n[0] && (e = {
4355
4352
  gallery: n[0]
4356
4353
  });
@@ -4426,7 +4423,7 @@ class Li extends bi {
4426
4423
  */
4427
4424
  destroy() {
4428
4425
  var t;
4429
- (t = this.pswp) === null || t === void 0 || t.destroy(), this.shouldOpen = !1, this._listeners = {}, $(this.options.gallery, this.options.gallerySelector).forEach((e) => {
4426
+ (t = this.pswp) === null || t === void 0 || t.destroy(), this.shouldOpen = !1, this._listeners = {}, Z(this.options.gallery, this.options.gallerySelector).forEach((e) => {
4430
4427
  e.removeEventListener("click", this.onThumbnailsClick, !1);
4431
4428
  });
4432
4429
  }
@@ -4556,13 +4553,13 @@ const xi = 180, Ii = () => {
4556
4553
  return;
4557
4554
  }
4558
4555
  dt();
4559
- }, $i = () => {
4556
+ }, Zi = () => {
4560
4557
  if (!(window != null && window.getSelection)) {
4561
4558
  console.warn("Selection API isn't supported");
4562
4559
  return;
4563
4560
  }
4564
4561
  document.addEventListener("mouseup", N), document.addEventListener("selectionchange", N), document.addEventListener("touchend", N), document.addEventListener("touchcancel", N);
4565
- }, Zi = (s) => {
4562
+ }, $i = (s) => {
4566
4563
  const { target: t } = s;
4567
4564
  if (t instanceof Element) {
4568
4565
  const e = t.closest(".c-search-form--button");
@@ -4572,7 +4569,7 @@ const xi = 180, Ii = () => {
4572
4569
  ".c-search-form--button"
4573
4570
  )) => {
4574
4571
  s && s.addEventListener("click", (t) => {
4575
- Zi(t);
4572
+ $i(t);
4576
4573
  });
4577
4574
  }, ki = ({
4578
4575
  tabsContainerElement: s,
@@ -4627,7 +4624,7 @@ const xi = 180, Ii = () => {
4627
4624
  i == null || i.classList.add(X);
4628
4625
  }
4629
4626
  }, Xi = () => {
4630
- jt(), Bi(), Mt(), Nt(), Ai(), Ei(), ee(), Ti(), Fi(), Rt("paralympicsGames", "countdown-paralympics-games"), $i(), Ot(), Kt(), Ft(), Tt(), Y(
4627
+ jt(), Bi(), Mt(), Nt(), Ai(), Ei(), ee(), Ti(), Fi(), Rt("paralympicsGames", "countdown-paralympics-games"), Zi(), Ot(), Kt(), Ft(), Tt(), Y(
4631
4628
  "jobs-input",
4632
4629
  "https://www.groupeactual.eu/autocomplete/profession-simple?code&prefix&limit=75",
4633
4630
  "&term=",
@@ -4640,7 +4637,7 @@ const xi = 180, Ii = () => {
4640
4637
  "?searchValue=",
4641
4638
  "text",
4642
4639
  "text"
4643
- ), Zt(), Ni(), xt(), It(), re(), ae(), Gt();
4640
+ ), $t(), Ni(), xt(), It(), re(), ae(), Gt();
4644
4641
  };
4645
4642
  export {
4646
4643
  Xi as initScripts