pervert-monkey 1.0.17 → 1.0.19

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.
Files changed (56) hide show
  1. package/dist/core/pervertmonkey.core.es.d.ts +22 -19
  2. package/dist/core/pervertmonkey.core.es.js +148 -159
  3. package/dist/core/pervertmonkey.core.es.js.map +1 -1
  4. package/dist/core/pervertmonkey.core.umd.js +148 -159
  5. package/dist/core/pervertmonkey.core.umd.js.map +1 -1
  6. package/dist/test/test.user.js +10301 -0
  7. package/dist/userscripts/3hentai.user.js +2 -2
  8. package/dist/userscripts/camgirlfinder.user.js +2 -2
  9. package/dist/userscripts/camwhores.user.js +4 -5
  10. package/dist/userscripts/e-hentai.user.js +2 -2
  11. package/dist/userscripts/ebalka.user.js +7 -3
  12. package/dist/userscripts/eporner.user.js +2 -2
  13. package/dist/userscripts/erome.user.js +2 -2
  14. package/dist/userscripts/eroprofile.user.js +2 -2
  15. package/dist/userscripts/javhdporn.user.js +2 -2
  16. package/dist/userscripts/missav.user.js +3 -8
  17. package/dist/userscripts/motherless.user.js +2 -2
  18. package/dist/userscripts/namethatporn.user.js +2 -2
  19. package/dist/userscripts/nhentai.user.js +2 -2
  20. package/dist/userscripts/obmenvsem.user.js +3 -3
  21. package/dist/userscripts/pornhub.user.js +2 -2
  22. package/dist/userscripts/spankbang.user.js +3 -4
  23. package/dist/userscripts/thisvid.user.js +35 -30
  24. package/dist/userscripts/xhamster.user.js +3 -3
  25. package/dist/userscripts/xvideos.user.js +3 -3
  26. package/package.json +4 -4
  27. package/src/core/data-handler/data-filter.ts +4 -4
  28. package/src/core/data-handler/data-manager.ts +47 -115
  29. package/src/core/infinite-scroll/index.ts +8 -13
  30. package/src/core/parsers/thumb-data-parser.ts +4 -3
  31. package/src/core/parsers/thumbs-parser.ts +9 -10
  32. package/src/core/rules/index.ts +6 -7
  33. package/src/userscripts/index.ts +1 -1
  34. package/src/userscripts/scripts/3hentai.ts +1 -1
  35. package/src/userscripts/scripts/camgirlfinder.ts +1 -1
  36. package/src/userscripts/scripts/camwhores.ts +3 -4
  37. package/src/userscripts/scripts/e-hentai.ts +1 -1
  38. package/src/userscripts/scripts/ebalka.ts +10 -3
  39. package/src/userscripts/scripts/eporner.ts +1 -1
  40. package/src/userscripts/scripts/erome.ts +1 -1
  41. package/src/userscripts/scripts/eroprofile.ts +1 -1
  42. package/src/userscripts/scripts/javhdporn.ts +1 -1
  43. package/src/userscripts/scripts/missav.ts +2 -7
  44. package/src/userscripts/scripts/motherless.ts +1 -1
  45. package/src/userscripts/scripts/namethatporn.ts +1 -1
  46. package/src/userscripts/scripts/nhentai.ts +1 -2
  47. package/src/userscripts/scripts/obmenvsem.ts +2 -2
  48. package/src/userscripts/scripts/pornhub.ts +1 -1
  49. package/src/userscripts/scripts/spankbang.ts +1 -3
  50. package/src/userscripts/scripts/thisvid.ts +46 -38
  51. package/src/userscripts/scripts/xhamster.ts +2 -2
  52. package/src/userscripts/scripts/xvideos.ts +2 -2
  53. package/src/utils/dom/index.ts +23 -16
  54. package/src/utils/index.ts +4 -22
  55. package/src/utils/parsers/index.ts +1 -1
  56. package/src/utils/performance/index.ts +44 -0
@@ -175,9 +175,19 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
175
175
  observer.observe(element, options);
176
176
  return observer;
177
177
  }
178
+ function querySelectorOrSelf(element, selector) {
179
+ var _a3;
180
+ if ((_a3 = element.matches) == null ? void 0 : _a3.call(element, selector)) {
181
+ return element;
182
+ }
183
+ return element.querySelector(selector);
184
+ }
178
185
  function querySelectorLast(root = document, selector) {
179
186
  const nodes = root.querySelectorAll(selector);
180
- return nodes.length > 0 ? nodes[nodes.length - 1] : void 0;
187
+ if (nodes.length < 1) {
188
+ return querySelectorOrSelf(root, selector) || void 0;
189
+ }
190
+ return nodes[nodes.length - 1];
181
191
  }
182
192
  function querySelectorLastNumber(selector, e = document) {
183
193
  var _a3;
@@ -187,7 +197,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
187
197
  function querySelectorText(e, selector) {
188
198
  var _a3;
189
199
  if (typeof selector !== "string") return "";
190
- const text = ((_a3 = e.querySelector(selector)) == null ? void 0 : _a3.innerText) || "";
200
+ const text = ((_a3 = querySelectorOrSelf(e, selector)) == null ? void 0 : _a3.innerText) || "";
191
201
  return sanitizeStr(text);
192
202
  }
193
203
  function parseHtml(html) {
@@ -223,8 +233,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
223
233
  });
224
234
  }
225
235
  function getCommonParents(elements) {
226
- const parents = Array.from(elements).map((e) => e.parentElement).filter((parent) => parent !== null);
227
- return [...new Set(parents)];
236
+ return Map.groupBy(elements, (e) => e.parentElement).keys().filter((e) => e !== null).toArray();
228
237
  }
229
238
  function findNextSibling(e) {
230
239
  if (e.nextElementSibling) return e.nextElementSibling;
@@ -267,15 +276,15 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
267
276
  video.load();
268
277
  video.remove();
269
278
  }
270
- function downloader(options = { append: "", after: "", button: "", cbBefore: () => {
271
- } }) {
279
+ function downloader(options) {
272
280
  var _a3, _b2;
273
- const btn = parseHtml(options.button);
281
+ const btn = parseHtml(options.buttonHtml);
274
282
  if (options.append) (_a3 = document.querySelector(options.append)) == null ? void 0 : _a3.append(btn);
275
283
  if (options.after) (_b2 = document.querySelector(options.after)) == null ? void 0 : _b2.after(btn);
276
- btn.addEventListener("click", (e) => {
284
+ btn == null ? void 0 : btn.addEventListener("click", (e) => {
285
+ var _a4;
277
286
  e.preventDefault();
278
- if (options.cbBefore) options.cbBefore();
287
+ (_a4 = options.doBefore) == null ? void 0 : _a4.call(options);
279
288
  waitForElementToAppear(document.body, "video", (video) => {
280
289
  window.location.href = video.getAttribute("src");
281
290
  });
@@ -434,7 +443,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
434
443
  const num = Number(n);
435
444
  return Number.isSafeInteger(num) ? num : or2;
436
445
  }
437
- function parseNumberWithLetter(str) {
446
+ function parseNumericAbbreviation(str) {
438
447
  var _a3;
439
448
  const multipliers = { k: 1e3, m: 1e6 };
440
449
  const match = str.trim().match(/([\d., ]+)(\w)?/);
@@ -469,6 +478,42 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
469
478
  function parseCssUrl(s) {
470
479
  return s.replace(/url\("|"\).*/g, "");
471
480
  }
481
+ function runIdleJob(iterator2, job) {
482
+ return new Promise((resolve) => {
483
+ const scheduler = window.requestIdleCallback || ((cb) => {
484
+ return setTimeout(() => {
485
+ cb({
486
+ didTimeout: true,
487
+ timeRemaining: () => 50
488
+ });
489
+ }, 1);
490
+ });
491
+ function runBatch(deadline) {
492
+ while (deadline.timeRemaining() > 0) {
493
+ const { value, done } = iterator2.next();
494
+ if (done) {
495
+ resolve(true);
496
+ return;
497
+ }
498
+ job(value);
499
+ }
500
+ scheduler(runBatch);
501
+ }
502
+ scheduler(runBatch);
503
+ });
504
+ }
505
+ function containMutation(container, callback) {
506
+ container.style.contain = "content";
507
+ try {
508
+ callback();
509
+ } finally {
510
+ requestAnimationFrame(() => {
511
+ requestAnimationFrame(() => {
512
+ container.style.contain = "none";
513
+ });
514
+ });
515
+ }
516
+ }
472
517
  function createTextFilter(filterName, dataPropName, positive) {
473
518
  const filterNameValue = `${filterName}Words`;
474
519
  return {
@@ -513,7 +558,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
513
558
  class DataFilter {
514
559
  constructor(rules) {
515
560
  __publicField(this, "filters", /* @__PURE__ */ new Map());
516
- __publicField(this, "filterMapping", {});
561
+ __publicField(this, "filterDepsMapping", {});
517
562
  __publicField(this, "customDataFilterFns", {});
518
563
  this.rules = rules;
519
564
  this.registerFilters(rules.customDataFilterFns);
@@ -544,12 +589,12 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
544
589
  );
545
590
  dataFilterFn.deps.push(customSelectorName);
546
591
  dataFilterFn.deps.forEach((name) => {
547
- Object.assign(this.filterMapping, { [name]: customSelectorName });
592
+ Object.assign(this.filterDepsMapping, { [name]: customSelectorName });
548
593
  });
549
594
  this.filters.set(customSelectorName, dataFilterFn.renderFn(this.rules.store.state));
550
595
  }
551
596
  selectFilters(filters) {
552
- const selectedFilters = Object.keys(filters).filter((k2) => k2 in this.filterMapping).map((k2) => this.filterMapping[k2]).map((k2) => this.filters.get(k2));
597
+ const selectedFilters = Object.keys(filters).filter((k2) => k2 in this.filterDepsMapping).map((k2) => this.filterDepsMapping[k2]).map((k2) => this.filters.get(k2));
553
598
  return selectedFilters;
554
599
  }
555
600
  }
@@ -560,136 +605,82 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
560
605
  (target) => !DataFilter.isFiltered(target)
561
606
  ));
562
607
  __publicField(this, "dataFilter");
563
- __publicField(this, "applyFilters", async (filters = {}, offset = 0) => {
564
- const filtersToApply = this.dataFilter.selectFilters(filters);
565
- if (filtersToApply.length === 0) return;
566
- const iterator2 = this.data.values().drop(offset);
567
- let finished = false;
568
- const updates = [];
569
- await new Promise((resolve) => {
570
- function runBatch(deadline) {
571
- while (deadline.timeRemaining() > 0) {
572
- const { value, done } = iterator2.next();
573
- finished = !!done;
574
- if (done) break;
575
- for (const f of filtersToApply) {
576
- const { name, condition } = f()(value);
577
- updates.push({ e: value.element, name, condition });
578
- }
579
- }
580
- if (!finished) {
581
- requestIdleCallback(runBatch);
582
- } else {
583
- resolve(true);
584
- }
585
- }
586
- requestIdleCallback(runBatch);
587
- });
588
- const parents = [...new Set(updates.map((u) => u.e.parentElement))].filter(
589
- (_2) => _2 !== null
590
- );
591
- requestAnimationFrame(() => {
592
- const revertDisplayStyle = parents.map((p) => {
593
- const display = p.style.display;
594
- p.style.display = "none";
595
- this.layoutStylePaint(p);
596
- p.style.willChange = "contents";
597
- return () => {
598
- p.style.display = display;
599
- requestAnimationFrame(() => {
600
- p.style.willChange = "auto";
601
- });
602
- };
603
- });
604
- updates.forEach((u) => {
608
+ this.rules = rules;
609
+ this.containerHomogenity = containerHomogenity;
610
+ this.dataFilter = new DataFilter(this.rules);
611
+ }
612
+ async applyFilters(filters = {}, offset = 0) {
613
+ const filtersToApply = this.dataFilter.selectFilters(filters);
614
+ if (filtersToApply.length === 0) return;
615
+ const iterator2 = this.data.values().drop(offset);
616
+ const updates = [];
617
+ await runIdleJob(iterator2, (v2) => {
618
+ for (const f of filtersToApply) {
619
+ const { name, condition } = f()(v2);
620
+ updates.push({ e: v2.element, name, condition });
621
+ }
622
+ });
623
+ const parents = Map.groupBy(updates, (u) => u.e.parentElement);
624
+ parents.forEach((v2, parent) => {
625
+ const f = () => {
626
+ v2.forEach((u) => {
605
627
  u.e.classList.toggle(u.name, u.condition);
606
628
  });
607
- revertDisplayStyle.forEach((f) => {
608
- f == null ? void 0 : f();
609
- });
610
- });
611
- });
612
- __publicField(this, "layoutStylePaintEnabled", false);
613
- __publicField(this, "filterAll", async (offset) => {
614
- const keys = Array.from(this.dataFilter.filters.keys());
615
- const filters = Object.fromEntries(
616
- keys.map((k2) => [k2, this.rules.store.state[k2]])
617
- );
618
- await this.applyFilters(filters, offset);
619
- });
620
- __publicField(this, "parseData", (html, container, removeDuplicates = false, shouldLazify = true) => {
621
- const thumbs = this.rules.thumbsParser.getThumbs(html);
622
- const dataOffset = this.data.size;
623
- const fragment = document.createDocumentFragment();
624
- const parent = container || this.rules.container;
625
- const homogenity = !!this.containerHomogenity;
626
- for (const thumbElement of thumbs) {
627
- const url = this.rules.thumbDataParser.getUrl(thumbElement);
628
- if (!url || this.data.has(url) || parent !== container && (parent == null ? void 0 : parent.contains(thumbElement)) || homogenity && !checkHomogenity(
629
- parent,
630
- thumbElement.parentElement,
631
- this.containerHomogenity
632
- )) {
633
- if (removeDuplicates) thumbElement.remove();
634
- continue;
635
- }
636
- const data = this.rules.thumbDataParser.getThumbData(thumbElement);
637
- this.data.set(url, { element: thumbElement, ...data });
638
- if (shouldLazify) {
639
- const { img, imgSrc } = this.rules.thumbImgParser.getImgData(thumbElement);
640
- this.lazyImgLoader.lazify(thumbElement, img, imgSrc);
641
- }
642
- fragment.append(thumbElement);
643
- }
644
- this.filterAll(dataOffset).then(() => {
645
- if (!parent) return;
646
- parent.style.willChange = "contents";
629
+ };
630
+ if (!parent) {
631
+ f();
632
+ } else {
647
633
  requestAnimationFrame(() => {
648
- parent == null ? void 0 : parent.appendChild(fragment);
649
- requestAnimationFrame(() => {
650
- parent.style.willChange = "auto";
651
- });
634
+ containMutation(parent, f);
652
635
  });
653
- });
636
+ }
654
637
  });
655
- this.rules = rules;
656
- this.containerHomogenity = containerHomogenity;
657
- this.dataFilter = new DataFilter(this.rules);
658
638
  }
659
- layoutStylePaint(e) {
660
- if (!this.layoutStylePaintEnabled) return;
661
- e.style.contain = "layout style paint";
639
+ async filterAll(offset) {
640
+ const keys = Array.from(this.dataFilter.filters.keys());
641
+ const filters = Object.fromEntries(
642
+ keys.map((k2) => [k2, this.rules.store.state[k2]])
643
+ );
644
+ await this.applyFilters(filters, offset);
645
+ }
646
+ async parseData(html, container, removeDuplicates = false, shouldLazify = true) {
647
+ const thumbs = this.rules.thumbsParser.getThumbs(html);
648
+ const dataOffset = this.data.size;
649
+ const fragment = document.createDocumentFragment();
650
+ const parent = container || this.rules.container;
651
+ const homogenity = !!this.containerHomogenity;
652
+ for (const thumbElement of thumbs) {
653
+ const url = this.rules.thumbDataParser.getUrl(thumbElement);
654
+ const isHomogenic = homogenity && !checkHomogenity(
655
+ parent,
656
+ thumbElement.parentElement,
657
+ this.containerHomogenity
658
+ );
659
+ if (!url || this.data.has(url) || parent !== container && (parent == null ? void 0 : parent.contains(thumbElement)) || isHomogenic) {
660
+ if (removeDuplicates) thumbElement.remove();
661
+ continue;
662
+ }
663
+ const data = this.rules.thumbDataParser.getThumbData(thumbElement);
664
+ this.data.set(url, { element: thumbElement, ...data });
665
+ if (shouldLazify) {
666
+ const { img, imgSrc } = this.rules.thumbImgParser.getImgData(thumbElement);
667
+ this.lazyImgLoader.lazify(thumbElement, img, imgSrc);
668
+ }
669
+ fragment.append(thumbElement);
670
+ }
671
+ await this.filterAll(dataOffset);
672
+ if (!parent) return;
673
+ containMutation(parent, () => parent == null ? void 0 : parent.appendChild(fragment));
662
674
  }
663
675
  sortBy(key, direction = true) {
664
676
  if (this.data.size < 2) return;
665
- const elements = this.data.values().toArray().filter((e) => e.element.parentElement !== null).map((e) => e);
666
- const containers = new Set(elements.map((e) => e.element.parentElement));
667
- containers.forEach((c) => {
668
- this.layoutStylePaint(c);
669
- c.style.willChange = "contents";
670
- });
671
- const elementsByContainers = /* @__PURE__ */ new Map();
672
- containers.forEach((c) => {
673
- elementsByContainers.set(c, []);
674
- });
675
- elements.forEach((e) => {
676
- const parent = e.element.parentElement;
677
- const container = elementsByContainers.get(parent);
678
- container == null ? void 0 : container.push(e);
679
- });
677
+ const ds2 = this.data.values().toArray().filter((e) => e.element.parentElement !== null);
678
+ const byContainers = Map.groupBy(ds2, (e) => e.element.parentElement);
680
679
  const dir = direction ? -1 : 1;
681
- for (const [container, items] of elementsByContainers) {
680
+ for (const [container, items] of byContainers) {
682
681
  items.sort((a2, b2) => (a2[key] - b2[key]) * dir);
683
- const domNodes = items.map((e) => e.element);
684
- const display = container.style.display;
685
- container.style.display = "none";
686
- container.replaceChildren(...domNodes);
687
- requestAnimationFrame(() => {
688
- container.style.display = display;
689
- requestAnimationFrame(() => {
690
- container.style.willChange = "auto";
691
- });
692
- });
682
+ const children = items.map((e) => e.element);
683
+ containMutation(container, () => container.replaceChildren(...children));
693
684
  }
694
685
  }
695
686
  }
@@ -1969,14 +1960,13 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1969
1960
  }
1970
1961
  class InfiniteScroller {
1971
1962
  constructor(options) {
1972
- __publicField(this, "enabled", true);
1973
1963
  __publicField(this, "paginationOffset", 1);
1974
1964
  __publicField(this, "rules");
1975
1965
  __publicField(this, "observer");
1976
1966
  __publicField(this, "paginationGenerator");
1977
1967
  __publicField(this, "subject", new Subject());
1978
1968
  __publicField(this, "generatorConsumer", async () => {
1979
- if (!this.enabled) return false;
1969
+ if (!this.rules.store.state.infiniteScrollEnabled) return true;
1980
1970
  const { value, done } = await this.paginationGenerator.next();
1981
1971
  if (done) return false;
1982
1972
  const { url, offset } = value;
@@ -2026,10 +2016,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2026
2016
  }
2027
2017
  async doScroll(url, offset) {
2028
2018
  const page = await this.getPaginationData(url);
2029
- const prevScrollPos = document.documentElement.scrollTop;
2030
2019
  this.paginationOffset = Math.max(this.paginationOffset, offset);
2031
2020
  this.subject.next({ type: "scroll", scroller: this, page });
2032
- window.scrollTo(0, prevScrollPos);
2033
2021
  if (this.rules.store.state.writeHistory) {
2034
2022
  history.replaceState({}, "", url);
2035
2023
  }
@@ -2044,19 +2032,18 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2044
2032
  }
2045
2033
  }
2046
2034
  static create(rules) {
2047
- const enabled = rules.store.state.infiniteScrollEnabled;
2048
2035
  rules.store.state.$paginationLast = rules.paginationStrategy.getPaginationLast();
2049
- const infiniteScroller = new InfiniteScroller({ enabled, rules });
2036
+ const infiniteScroller = new InfiniteScroller({ rules });
2050
2037
  rules.store.state.$paginationOffset = infiniteScroller.paginationOffset;
2051
2038
  infiniteScroller.subject.subscribe((x2) => {
2052
2039
  if (x2.type === "scroll") {
2053
2040
  rules.store.state.$paginationOffset = x2.scroller.paginationOffset;
2054
- rules.dataManager.parseData(x2.page);
2041
+ const prevScrollPos = document.documentElement.scrollTop;
2042
+ rules.dataManager.parseData(x2.page).then(() => {
2043
+ window.scrollTo(0, prevScrollPos);
2044
+ });
2055
2045
  }
2056
2046
  });
2057
- rules.store.stateSubject.subscribe(() => {
2058
- infiniteScroller.enabled = rules.store.state.infiniteScrollEnabled;
2059
- });
2060
2047
  return infiniteScroller;
2061
2048
  }
2062
2049
  }
@@ -3115,7 +3102,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
3115
3102
  getThumbDataWith(thumb, { type, selector }) {
3116
3103
  var _a3;
3117
3104
  if (type === "boolean") {
3118
- return !!thumb.querySelector(selector);
3105
+ return !!querySelectorOrSelf(thumb, selector);
3119
3106
  }
3120
3107
  if (type === "string") {
3121
3108
  return sanitizeStr(((_a3 = querySelectorLast(thumb, selector)) == null ? void 0 : _a3.innerText) || "");
@@ -3125,7 +3112,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
3125
3112
  }
3126
3113
  if (type === "float") {
3127
3114
  const value = querySelectorText(thumb, selector);
3128
- return parseNumberWithLetter(value);
3115
+ return parseNumericAbbreviation(value);
3129
3116
  }
3130
3117
  return Number.parseInt(querySelectorText(thumb, selector));
3131
3118
  }
@@ -3194,24 +3181,21 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
3194
3181
  }
3195
3182
  }
3196
3183
  class ThumbsParser {
3197
- constructor(containerSelector) {
3184
+ constructor() {
3198
3185
  __publicField(this, "selector", ".thumb");
3199
3186
  __publicField(this, "strategy", "default");
3200
3187
  __publicField(this, "transform");
3201
- this.containerSelector = containerSelector;
3202
3188
  }
3203
- static create(options = {}, containerSelector) {
3204
- return Object.assign(new ThumbsParser(containerSelector), options);
3189
+ static create(options = {}) {
3190
+ return Object.assign(new ThumbsParser(), options);
3205
3191
  }
3206
- getThumbs(html) {
3207
- if (!html) return [];
3208
- let thumbs;
3192
+ getThumbs(container) {
3193
+ if (!container) return [];
3209
3194
  if (this.strategy === "auto") {
3210
3195
  if (typeof this.selector !== "string") return [];
3211
- const container = html.querySelector(this.containerSelector);
3212
- thumbs = [...(container == null ? void 0 : container.children) || []];
3196
+ return [...(container == null ? void 0 : container.children) || []];
3213
3197
  }
3214
- thumbs = Array.from(html.querySelectorAll(this.selector));
3198
+ const thumbs = Array.from(container.querySelectorAll(this.selector));
3215
3199
  if (typeof this.transform === "function") {
3216
3200
  thumbs.forEach(this.transform);
3217
3201
  }
@@ -9911,7 +9895,7 @@ Expected function or array of functions, received type ${typeof t}.`
9911
9895
  Object.assign(this, options);
9912
9896
  this.thumbDataParser = ThumbDataParser.create(this.thumb);
9913
9897
  this.thumbImgParser = ThumbImgParser.create(this.thumbImg);
9914
- this.thumbsParser = ThumbsParser.create(this.thumbs, this.containerSelector);
9898
+ this.thumbsParser = ThumbsParser.create(this.thumbs);
9915
9899
  this.paginationStrategy = getPaginationStrategy(this.paginationStrategyOptions);
9916
9900
  this.store = this.createStore();
9917
9901
  this.gui = this.createGui();
@@ -9922,15 +9906,16 @@ Expected function or array of functions, received type ${typeof t}.`
9922
9906
  }
9923
9907
  get container() {
9924
9908
  if (typeof this.containerSelectorLast === "string") {
9925
- return querySelectorLast(document, this.containerSelectorLast);
9909
+ return querySelectorLast(document.body, this.containerSelectorLast);
9926
9910
  }
9927
9911
  if (typeof this.containerSelector === "string") {
9928
- return document.querySelector(this.containerSelector);
9912
+ return querySelectorOrSelf(document.body, this.containerSelector);
9929
9913
  }
9930
9914
  return this.containerSelector();
9931
9915
  }
9932
9916
  get intersectionObservable() {
9933
- return this.intersectionObservableSelector && document.querySelector(this.intersectionObservableSelector);
9917
+ if (!this.intersectionObservableSelector) return void 0;
9918
+ return document.querySelector(this.intersectionObservableSelector);
9934
9919
  }
9935
9920
  get observable() {
9936
9921
  return this.intersectionObservable || this.paginationStrategy.getPaginationElement();
@@ -10026,6 +10011,7 @@ Expected function or array of functions, received type ${typeof t}.`
10026
10011
  exports2.checkHomogenity = checkHomogenity;
10027
10012
  exports2.chunks = chunks;
10028
10013
  exports2.circularShift = circularShift;
10014
+ exports2.containMutation = containMutation;
10029
10015
  exports2.copyAttributes = copyAttributes;
10030
10016
  exports2.downloader = downloader;
10031
10017
  exports2.exterminateVideo = exterminateVideo;
@@ -10038,20 +10024,23 @@ Expected function or array of functions, received type ${typeof t}.`
10038
10024
  exports2.getCommonParents = getCommonParents;
10039
10025
  exports2.getPaginationStrategy = getPaginationStrategy;
10040
10026
  exports2.instantiateTemplate = instantiateTemplate;
10027
+ exports2.irange = irange;
10041
10028
  exports2.memoize = memoize;
10042
10029
  exports2.objectToFormData = objectToFormData;
10043
10030
  exports2.parseCssUrl = parseCssUrl;
10044
10031
  exports2.parseDataParams = parseDataParams;
10045
10032
  exports2.parseHtml = parseHtml;
10046
10033
  exports2.parseIntegerOr = parseIntegerOr;
10047
- exports2.parseNumberWithLetter = parseNumberWithLetter;
10034
+ exports2.parseNumericAbbreviation = parseNumericAbbreviation;
10048
10035
  exports2.parseUrl = parseUrl;
10049
10036
  exports2.querySelectorLast = querySelectorLast;
10050
10037
  exports2.querySelectorLastNumber = querySelectorLastNumber;
10038
+ exports2.querySelectorOrSelf = querySelectorOrSelf;
10051
10039
  exports2.querySelectorText = querySelectorText;
10052
10040
  exports2.range = range;
10053
10041
  exports2.removeClassesAndDataAttributes = removeClassesAndDataAttributes;
10054
10042
  exports2.replaceElementTag = replaceElementTag;
10043
+ exports2.runIdleJob = runIdleJob;
10055
10044
  exports2.sanitizeStr = sanitizeStr;
10056
10045
  exports2.splitWith = splitWith;
10057
10046
  exports2.timeToSeconds = timeToSeconds;