pervert-monkey 1.0.13 → 1.0.15

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 +82 -29
  2. package/dist/core/pervertmonkey.core.es.js +233 -115
  3. package/dist/core/pervertmonkey.core.es.js.map +1 -1
  4. package/dist/core/pervertmonkey.core.umd.js +233 -115
  5. package/dist/core/pervertmonkey.core.umd.js.map +1 -1
  6. package/dist/userscripts/3hentai.user.js +4 -11
  7. package/dist/userscripts/camgirlfinder.user.js +2 -2
  8. package/dist/userscripts/camwhores.user.js +7 -16
  9. package/dist/userscripts/e-hentai.user.js +3 -4
  10. package/dist/userscripts/ebalka.user.js +13 -5
  11. package/dist/userscripts/eporner.user.js +21 -41
  12. package/dist/userscripts/erome.user.js +9 -8
  13. package/dist/userscripts/eroprofile.user.js +5 -14
  14. package/dist/userscripts/javhdporn.user.js +6 -5
  15. package/dist/userscripts/missav.user.js +10 -4
  16. package/dist/userscripts/motherless.user.js +12 -5
  17. package/dist/userscripts/namethatporn.user.js +8 -14
  18. package/dist/userscripts/nhentai.user.js +5 -13
  19. package/dist/userscripts/obmenvsem.user.js +10 -4
  20. package/dist/userscripts/pornhub.user.js +14 -6
  21. package/dist/userscripts/spankbang.user.js +28 -7
  22. package/dist/userscripts/thisvid.user.js +12 -30
  23. package/dist/userscripts/xhamster.user.js +9 -14
  24. package/dist/userscripts/xvideos.user.js +33 -5
  25. package/package.json +1 -1
  26. package/src/core/data-handler/data-filter-fn-defaults.ts +52 -0
  27. package/src/core/data-handler/data-filter-fn.ts +60 -0
  28. package/src/core/data-handler/data-filter.ts +22 -96
  29. package/src/core/data-handler/data-manager.ts +75 -26
  30. package/src/core/jabroni-config/default-scheme.ts +54 -5
  31. package/src/core/jabroni-config/index.ts +1 -0
  32. package/src/core/jabroni-config/jabroni-gui-controller.ts +1 -1
  33. package/src/core/jabroni-config/scheme-selectors-mapping.ts +12 -0
  34. package/src/core/parsers/thumb-data-parser.ts +4 -15
  35. package/src/core/rules/index.ts +15 -9
  36. package/src/userscripts/index.ts +1 -1
  37. package/src/userscripts/scripts/3hentai.ts +3 -6
  38. package/src/userscripts/scripts/camgirlfinder.ts +1 -1
  39. package/src/userscripts/scripts/camwhores.ts +5 -14
  40. package/src/userscripts/scripts/e-hentai.ts +4 -6
  41. package/src/userscripts/scripts/ebalka.ts +11 -3
  42. package/src/userscripts/scripts/eporner.ts +20 -39
  43. package/src/userscripts/scripts/erome.ts +9 -7
  44. package/src/userscripts/scripts/eroprofile.ts +4 -12
  45. package/src/userscripts/scripts/javhdporn.ts +7 -8
  46. package/src/userscripts/scripts/missav.ts +10 -4
  47. package/src/userscripts/scripts/motherless.ts +11 -6
  48. package/src/userscripts/scripts/namethatporn.ts +8 -15
  49. package/src/userscripts/scripts/nhentai.ts +6 -13
  50. package/src/userscripts/scripts/obmenvsem.ts +9 -3
  51. package/src/userscripts/scripts/pornhub.ts +13 -4
  52. package/src/userscripts/scripts/spankbang.ts +29 -5
  53. package/src/userscripts/scripts/thisvid.ts +14 -29
  54. package/src/userscripts/scripts/xhamster.ts +9 -14
  55. package/src/userscripts/scripts/xvideos.ts +32 -3
  56. package/src/utils/parsers/index.ts +5 -2
@@ -14,6 +14,42 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
14
14
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
15
15
 
16
16
  var _i2, _n2, _t, _e2, _s2, _l2, _o2, _d, _p2, _g, _C_instances, r_fn, R_fn, b_fn, u_fn, m_fn, a_fn, P_fn, E_fn, S_fn, O_fn, k_fn, x_fn, h_fn, f_fn, T_fn, A_fn, y_fn, w_fn, c_fn, C_fn, _a2, _i3, _n3, _t2, _e3, _s3, _l3, _b;
17
+ class DataFilterFn {
18
+ constructor(handle, deps = [], name, $preDefine) {
19
+ __publicField(this, "tag");
20
+ this.handle = handle;
21
+ this.deps = deps;
22
+ this.name = name;
23
+ this.$preDefine = $preDefine;
24
+ this.tag = `filter-${name}`;
25
+ }
26
+ static from(options, name) {
27
+ if (typeof options === "function") {
28
+ const deps = [name];
29
+ return new DataFilterFn(options, deps, name);
30
+ }
31
+ return new DataFilterFn(
32
+ options.handle,
33
+ options.deps,
34
+ name,
35
+ options.$preDefine
36
+ );
37
+ }
38
+ renderFn(state) {
39
+ const tag = this.tag;
40
+ return () => {
41
+ var _a3;
42
+ const preDefined = (_a3 = this.$preDefine) == null ? void 0 : _a3.call(this, state);
43
+ return (a2) => {
44
+ const condition = this.handle(a2, state, preDefined);
45
+ return {
46
+ condition,
47
+ tag
48
+ };
49
+ };
50
+ };
51
+ }
52
+ }
17
53
  function chunks(arr, size) {
18
54
  return Array.from(
19
55
  { length: Math.ceil(arr.length / size) },
@@ -400,9 +436,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
400
436
  function parseNumberWithLetter(str) {
401
437
  var _a3;
402
438
  const multipliers = { k: 1e3, m: 1e6 };
403
- const match = str.trim().match(/^([\d.]+)(\w)?$/);
439
+ const match = str.trim().match(/([\d., ]+)(\w)?/);
404
440
  if (!match) return 0;
405
- const num = parseFloat(match[1]);
441
+ const s1 = match[1].replace(/,/g, ".").replace(/[ ]/g, "");
442
+ const s2 = s1.split(".").filter(Boolean).length < 3 ? s1 : s1.replace(".", "");
443
+ const num = parseFloat(s2);
406
444
  const suffix = (_a3 = match[2]) == null ? void 0 : _a3.toLowerCase();
407
445
  if (suffix && suffix in multipliers) {
408
446
  return num * multipliers[suffix];
@@ -430,13 +468,54 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
430
468
  function parseCssUrl(s) {
431
469
  return s.replace(/url\("|"\).*/g, "");
432
470
  }
433
- const _DataFilter = class _DataFilter {
471
+ function createTextFilter(filterName, dataPropName, positive) {
472
+ const filterNameValue = `${filterName}Words`;
473
+ return {
474
+ handle(el2, state, searchFilter) {
475
+ if (!Object.hasOwn(state, filterName) || !state[filterName]) return false;
476
+ return !(searchFilter == null ? void 0 : searchFilter(el2[dataPropName]));
477
+ },
478
+ $preDefine: (state) => {
479
+ const r = new RegexFilter(state[filterNameValue]);
480
+ if (positive) return (s) => r.hasEvery(s);
481
+ return (s) => r.hasNone(s);
482
+ },
483
+ deps: [filterNameValue]
484
+ };
485
+ }
486
+ const filterDuration = {
487
+ handle(el2, state, notInRange) {
488
+ if (!state.filterDuration) return false;
489
+ return !!(notInRange == null ? void 0 : notInRange(el2.duration));
490
+ },
491
+ $preDefine: (state) => {
492
+ const from = state.filterDurationFrom;
493
+ const to2 = state.filterDurationTo;
494
+ function notInRange(d2) {
495
+ return d2 < from || d2 > to2;
496
+ }
497
+ return notInRange;
498
+ },
499
+ deps: ["filterDurationFrom", "filterDurationTo"]
500
+ };
501
+ const defaultDataFilterFns = {
502
+ filterDuration,
503
+ filterExclude: createTextFilter("filterExclude", "title", false),
504
+ filterInclude: createTextFilter("filterInclude", "title", true),
505
+ filterUploaderExclude: createTextFilter("filterUploaderExclude", "uploader", false),
506
+ filterUploaderInclude: createTextFilter("filterUploaderInclude", "uploader", true),
507
+ filterHD: (el2, state) => state.filterHD && !el2.hd,
508
+ filterNonHD: (el2, state) => state.filterNonHD && el2.hd,
509
+ filterPrivate: (el2, state) => state.filterPrivate && el2.private,
510
+ filterPublic: (el2, state) => state.filterPublic && !el2.private
511
+ };
512
+ class DataFilter {
434
513
  constructor(rules) {
435
514
  __publicField(this, "filters", /* @__PURE__ */ new Map());
436
- __publicField(this, "customDataSelectorFns", {});
515
+ __publicField(this, "customDataFilterFns", {});
437
516
  __publicField(this, "filterMapping", {});
438
517
  this.rules = rules;
439
- this.registerFilters(rules.customDataSelectorFns);
518
+ this.registerFilters(rules.customDataFilterFns);
440
519
  this.applyCSSFilters();
441
520
  }
442
521
  static isFiltered(el2) {
@@ -450,87 +529,30 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
450
529
  }
451
530
  registerFilters(customFilters) {
452
531
  customFilters.forEach((o) => {
453
- if (typeof o === "string") {
454
- this.customDataSelectorFns[o] = _DataFilter.customDataSelectorFnsDefault[o];
455
- this.registerFilter(o);
456
- } else {
457
- const k2 = Object.keys(o)[0];
458
- this.customDataSelectorFns[k2] = o[k2];
459
- this.registerFilter(k2);
460
- }
532
+ const isStr = typeof o === "string";
533
+ const k2 = isStr ? o : Object.keys(o)[0];
534
+ this.customDataFilterFns[k2] = isStr ? defaultDataFilterFns[o] : o[k2];
535
+ this.registerFilter(k2);
461
536
  });
462
537
  }
463
- customSelectorParser(name, selector) {
464
- if ("handle" in selector) {
465
- return selector;
466
- } else {
467
- return { handle: selector, deps: [name] };
468
- }
469
- }
470
538
  registerFilter(customSelectorName) {
471
539
  var _a3;
472
- const handler = this.customSelectorParser(
473
- customSelectorName,
474
- this.customDataSelectorFns[customSelectorName]
540
+ const dataFilterFn = DataFilterFn.from(
541
+ this.customDataFilterFns[customSelectorName],
542
+ customSelectorName
475
543
  );
476
- const tag = `filter-${customSelectorName}`;
477
- (_a3 = [customSelectorName, ...handler.deps || []]) == null ? void 0 : _a3.forEach((name) => {
544
+ (_a3 = [customSelectorName, ...dataFilterFn.deps]) == null ? void 0 : _a3.forEach((name) => {
478
545
  Object.assign(this.filterMapping, { [name]: customSelectorName });
479
546
  });
480
- const fn2 = () => {
481
- var _a4;
482
- const preDefined = (_a4 = handler.$preDefine) == null ? void 0 : _a4.call(handler, this.rules.store.state);
483
- return (v2) => {
484
- const condition = handler.handle(v2, this.rules.store.state, preDefined);
485
- return {
486
- condition,
487
- tag
488
- };
489
- };
490
- };
491
- this.filters.set(customSelectorName, fn2);
547
+ this.filters.set(customSelectorName, dataFilterFn.renderFn(this.rules.store.state));
492
548
  }
493
549
  selectFilters(filters) {
494
550
  const selectedFilters = Object.keys(filters).filter((k2) => k2 in this.filterMapping).map((k2) => this.filterMapping[k2]).map((k2) => this.filters.get(k2));
495
551
  return selectedFilters;
496
552
  }
497
- };
498
- __publicField(_DataFilter, "customDataSelectorFnsDefault", {
499
- filterDuration: {
500
- handle(el2, state, notInRange) {
501
- if (!state.filterDuration) return false;
502
- return notInRange(el2.duration);
503
- },
504
- $preDefine: (state) => {
505
- const from = state.filterDurationFrom;
506
- const to2 = state.filterDurationTo;
507
- function notInRange(d2) {
508
- return d2 < from || d2 > to2;
509
- }
510
- return notInRange;
511
- },
512
- deps: ["filterDurationFrom", "filterDurationTo"]
513
- },
514
- filterExclude: {
515
- handle(el2, state, searchFilter) {
516
- if (!state.filterExclude) return false;
517
- return !searchFilter.hasNone(el2.title);
518
- },
519
- $preDefine: (state) => new RegexFilter(state.filterExcludeWords),
520
- deps: ["filterExcludeWords"]
521
- },
522
- filterInclude: {
523
- handle(el2, state, searchFilter) {
524
- if (!state.filterInclude) return false;
525
- return !searchFilter.hasEvery(el2.title);
526
- },
527
- $preDefine: (state) => new RegexFilter(state.filterIncludeWords),
528
- deps: ["filterIncludeWords"]
529
- }
530
- });
531
- let DataFilter = _DataFilter;
553
+ }
532
554
  class DataManager {
533
- constructor(rules, parentHomogenity) {
555
+ constructor(rules, containerHomogenity) {
534
556
  __publicField(this, "data", /* @__PURE__ */ new Map());
535
557
  __publicField(this, "lazyImgLoader", new LazyImgLoader(
536
558
  (target) => !DataFilter.isFiltered(target)
@@ -541,9 +563,9 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
541
563
  if (filtersToApply.length === 0) return;
542
564
  const iterator2 = this.data.values().drop(offset);
543
565
  let finished = false;
566
+ const updates = [];
544
567
  await new Promise((resolve) => {
545
568
  function runBatch(deadline) {
546
- const updates = [];
547
569
  while (deadline.timeRemaining() > 0) {
548
570
  const { value, done } = iterator2.next();
549
571
  finished = !!done;
@@ -553,13 +575,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
553
575
  updates.push({ e: value.element, tag, condition });
554
576
  }
555
577
  }
556
- if (updates.length > 0) {
557
- requestAnimationFrame(() => {
558
- updates.forEach((u) => {
559
- u.e.classList.toggle(u.tag, u.condition);
560
- });
561
- });
562
- }
563
578
  if (!finished) {
564
579
  requestIdleCallback(runBatch);
565
580
  } else {
@@ -568,6 +583,28 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
568
583
  }
569
584
  requestIdleCallback(runBatch);
570
585
  });
586
+ const parents = new Set(updates.map((u) => u.e.parentElement));
587
+ requestAnimationFrame(() => {
588
+ const revertDisplayStyle = [...parents].map((p) => {
589
+ const display = p == null ? void 0 : p.style.display;
590
+ if (!display) return void 0;
591
+ p.style.display = "none";
592
+ p.style.contain = "layout style paint";
593
+ p.style.willChange = "contents";
594
+ return () => {
595
+ p.style.display = display;
596
+ requestAnimationFrame(() => {
597
+ p.style.willChange = "auto";
598
+ });
599
+ };
600
+ });
601
+ updates.forEach((u) => {
602
+ u.e.classList.toggle(u.tag, u.condition);
603
+ });
604
+ revertDisplayStyle.forEach((f) => {
605
+ f == null ? void 0 : f();
606
+ });
607
+ });
571
608
  });
572
609
  __publicField(this, "filterAll", async (offset) => {
573
610
  const keys = Array.from(this.dataFilter.filters.keys());
@@ -581,13 +618,17 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
581
618
  const dataOffset = this.data.size;
582
619
  const fragment = document.createDocumentFragment();
583
620
  const parent = container || this.rules.container;
584
- const homogenity = !!this.parentHomogenity;
621
+ const homogenity = !!this.containerHomogenity;
622
+ if (parent) {
623
+ parent.style.contain = "layout style paint";
624
+ parent.style.willChange = "contents";
625
+ }
585
626
  for (const thumbElement of thumbs) {
586
627
  const url = this.rules.thumbDataParser.getUrl(thumbElement);
587
628
  if (!url || this.data.has(url) || parent !== container && (parent == null ? void 0 : parent.contains(thumbElement)) || homogenity && !checkHomogenity(
588
629
  parent,
589
630
  thumbElement.parentElement,
590
- this.parentHomogenity
631
+ this.containerHomogenity
591
632
  )) {
592
633
  if (removeDuplicates) thumbElement.remove();
593
634
  continue;
@@ -602,26 +643,45 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
602
643
  }
603
644
  this.filterAll(dataOffset).then(() => {
604
645
  requestAnimationFrame(() => {
605
- parent.appendChild(fragment);
646
+ parent == null ? void 0 : parent.appendChild(fragment);
606
647
  });
607
648
  });
608
649
  });
609
650
  this.rules = rules;
610
- this.parentHomogenity = parentHomogenity;
651
+ this.containerHomogenity = containerHomogenity;
611
652
  this.dataFilter = new DataFilter(this.rules);
612
653
  }
613
654
  sortBy(key, direction = true) {
614
655
  if (this.data.size < 2) return;
615
- let sorted = this.data.values().toArray().sort((a2, b2) => {
616
- return a2[key] - b2[key];
656
+ const elements = this.data.values().toArray().filter((e) => e.element.parentElement !== null).map((e) => e);
657
+ const containers = new Set(elements.map((e) => e.element.parentElement));
658
+ containers.forEach((c) => {
659
+ c.style.contain = "layout style paint";
660
+ c.style.willChange = "contents";
661
+ });
662
+ const elementsByContainers = /* @__PURE__ */ new Map();
663
+ containers.forEach((c) => {
664
+ elementsByContainers.set(c, []);
617
665
  });
618
- if (!direction) sorted = sorted.reverse();
619
- const container = sorted[0].element.parentElement;
620
- container.style.visibility = "hidden";
621
- sorted.forEach((s) => {
622
- container.append(s.element);
666
+ elements.forEach((e) => {
667
+ const parent = e.element.parentElement;
668
+ const container = elementsByContainers.get(parent);
669
+ container == null ? void 0 : container.push(e);
623
670
  });
624
- container.style.visibility = "visible";
671
+ const dir = direction ? -1 : 1;
672
+ for (const [container, items] of elementsByContainers) {
673
+ items.sort((a2, b2) => (a2[key] - b2[key]) * dir);
674
+ const domNodes = items.map((e) => e.element);
675
+ const display = container.style.display;
676
+ container.style.display = "none";
677
+ container.replaceChildren(...domNodes);
678
+ requestAnimationFrame(() => {
679
+ container.style.display = display;
680
+ requestAnimationFrame(() => {
681
+ container.style.willChange = "auto";
682
+ });
683
+ });
684
+ }
625
685
  }
626
686
  }
627
687
  var extendStatics = function(d2, b2) {
@@ -2999,7 +3059,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2999
3059
  return paginationStrategy;
3000
3060
  }
3001
3061
  class ThumbDataParser {
3002
- constructor(strategy = "manual", selectors = {}, callback, stringsMeltInTitle = true) {
3062
+ constructor(strategy = "manual", selectors = {}, callback) {
3003
3063
  __publicField(this, "thumbDataSelectors", []);
3004
3064
  __publicField(this, "defaultThumbDataSelectors", [
3005
3065
  { name: "title", type: "string", selector: "[class *= title],[title]" },
@@ -3009,11 +3069,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
3009
3069
  selector: "[class *= uploader], [class *= user], [class *= name]"
3010
3070
  },
3011
3071
  { name: "duration", type: "duration", selector: "[class *= duration]" }
3072
+ // { name: 'views', type: 'float', selector: '[class *= view]' },
3012
3073
  ]);
3013
3074
  this.strategy = strategy;
3014
3075
  this.selectors = selectors;
3015
3076
  this.callback = callback;
3016
- this.stringsMeltInTitle = stringsMeltInTitle;
3017
3077
  this.preprocessCustomThumbDataSelectors();
3018
3078
  }
3019
3079
  autoParseText(thumb) {
@@ -3059,7 +3119,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
3059
3119
  return Number.parseInt(querySelectorText(thumb, selector));
3060
3120
  }
3061
3121
  static create(o = {}) {
3062
- return new ThumbDataParser(o.strategy, o.selectors, o.callback, o.stringsMeltInTitle);
3122
+ return new ThumbDataParser(o.strategy, o.selectors, o.callback);
3063
3123
  }
3064
3124
  getThumbData(thumb) {
3065
3125
  var _a3;
@@ -3067,19 +3127,11 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
3067
3127
  return this.autoParseText(thumb);
3068
3128
  }
3069
3129
  if (this.strategy === "auto-select") {
3070
- this.thumbDataSelectors = this.defaultThumbDataSelectors;
3130
+ this.thumbDataSelectors.push(...this.defaultThumbDataSelectors);
3071
3131
  }
3072
3132
  const thumbData = Object.fromEntries(
3073
3133
  this.thumbDataSelectors.map((s) => [s.name, this.getThumbDataWith(thumb, s)])
3074
3134
  );
3075
- if (this.stringsMeltInTitle) {
3076
- Object.entries(thumbData).forEach(([k2, v2]) => {
3077
- if (typeof v2 === "string" && k2 !== "title") {
3078
- thumbData.title = `${thumbData.title} ${k2}:${v2}`;
3079
- delete thumbData[k2];
3080
- }
3081
- });
3082
- }
3083
3135
  (_a3 = this.callback) == null ? void 0 : _a3.call(this, thumb, thumbData);
3084
3136
  return thumbData;
3085
3137
  }
@@ -9609,7 +9661,7 @@ Expected function or array of functions, received type ${typeof t}.`
9609
9661
  }
9610
9662
  const DefaultScheme = [
9611
9663
  {
9612
- title: "Text Filter",
9664
+ title: "Title Filter",
9613
9665
  collapsed: true,
9614
9666
  content: [
9615
9667
  { filterExclude: false, label: "exclude" },
@@ -9628,6 +9680,26 @@ Expected function or array of functions, received type ${typeof t}.`
9628
9680
  }
9629
9681
  ]
9630
9682
  },
9683
+ {
9684
+ title: "Uploader Filter",
9685
+ collapsed: true,
9686
+ content: [
9687
+ { filterUploaderExclude: false, label: "exclude" },
9688
+ {
9689
+ filterUploaderExcludeWords: "",
9690
+ label: "keywords",
9691
+ watch: "filterUploaderExclude",
9692
+ placeholder: "word, f:full_word, r:RegEx..."
9693
+ },
9694
+ { filterUploaderInclude: false, label: "include" },
9695
+ {
9696
+ filterUploaderIncludeWords: "",
9697
+ label: "keywords",
9698
+ watch: "filterUploaderInclude",
9699
+ placeholder: "word, f:full_word, r:RegEx..."
9700
+ }
9701
+ ]
9702
+ },
9631
9703
  {
9632
9704
  title: "Duration Filter",
9633
9705
  collapsed: true,
@@ -9649,6 +9721,7 @@ Expected function or array of functions, received type ${typeof t}.`
9649
9721
  },
9650
9722
  {
9651
9723
  title: "Sort By",
9724
+ collapsed: true,
9652
9725
  content: [
9653
9726
  {
9654
9727
  "sort by views": () => {
@@ -9660,8 +9733,29 @@ Expected function or array of functions, received type ${typeof t}.`
9660
9733
  }
9661
9734
  ]
9662
9735
  },
9736
+ {
9737
+ title: "Sort By Duration",
9738
+ collapsed: true,
9739
+ content: [
9740
+ {
9741
+ "sort by duration": () => {
9742
+ }
9743
+ }
9744
+ ]
9745
+ },
9746
+ {
9747
+ title: "Sort By Views",
9748
+ collapsed: true,
9749
+ content: [
9750
+ {
9751
+ "sort by views": () => {
9752
+ }
9753
+ }
9754
+ ]
9755
+ },
9663
9756
  {
9664
9757
  title: "Privacy Filter",
9758
+ collapsed: true,
9665
9759
  content: [
9666
9760
  { filterPrivate: false, label: "private" },
9667
9761
  { filterPublic: false, label: "public" },
@@ -9669,6 +9763,13 @@ Expected function or array of functions, received type ${typeof t}.`
9669
9763
  } }
9670
9764
  ]
9671
9765
  },
9766
+ {
9767
+ title: "HD Filter",
9768
+ content: [
9769
+ { filterHD: false, label: "hd" },
9770
+ { filterNonHD: false, label: "non-hd" }
9771
+ ]
9772
+ },
9672
9773
  {
9673
9774
  title: "Advanced",
9674
9775
  collapsed: true,
@@ -9688,6 +9789,11 @@ Expected function or array of functions, received type ${typeof t}.`
9688
9789
  {
9689
9790
  writeHistory: false,
9690
9791
  label: "write history"
9792
+ },
9793
+ {
9794
+ reset: () => {
9795
+ localStorage.removeItem("state_acephale");
9796
+ }
9691
9797
  }
9692
9798
  ]
9693
9799
  },
@@ -9745,13 +9851,22 @@ Expected function or array of functions, received type ${typeof t}.`
9745
9851
  setupStoreListeners() {
9746
9852
  var _a3;
9747
9853
  (_a3 = this.directionalEventObservable$) == null ? void 0 : _a3.subscribe((e) => {
9748
- this.eventsMap[e.type](e.direction);
9854
+ var _a4, _b2;
9855
+ (_b2 = (_a4 = this.eventsMap)[e.type]) == null ? void 0 : _b2.call(_a4, e.direction);
9749
9856
  });
9750
9857
  this.store.stateSubject.pipe(takeUntil(this.destroy$)).subscribe((a2) => {
9751
9858
  this.dataManager.applyFilters(a2);
9752
9859
  });
9753
9860
  }
9754
9861
  }
9862
+ function getSelectorFnsFromScheme(xs2) {
9863
+ const keys = xs2.flatMap((s) => {
9864
+ const schemeBlock = DefaultScheme.find((e) => e.title === s);
9865
+ if (!schemeBlock) return [];
9866
+ return schemeBlock.content.flatMap((c) => Object.keys(c));
9867
+ });
9868
+ return keys.filter((k2) => k2 in defaultDataFilterFns);
9869
+ }
9755
9870
  class Rules {
9756
9871
  constructor(options) {
9757
9872
  __publicField(this, "thumb", {});
@@ -9766,12 +9881,8 @@ Expected function or array of functions, received type ${typeof t}.`
9766
9881
  __publicField(this, "paginationStrategyOptions", {});
9767
9882
  __publicField(this, "paginationStrategy");
9768
9883
  __publicField(this, "dataManager");
9769
- __publicField(this, "dataHomogenity");
9770
- __publicField(this, "customDataSelectorFns", [
9771
- "filterInclude",
9772
- "filterExclude",
9773
- "filterDuration"
9774
- ]);
9884
+ __publicField(this, "containerHomogenity");
9885
+ __publicField(this, "customDataFilterFns", []);
9775
9886
  __publicField(this, "animatePreview");
9776
9887
  __publicField(this, "storeOptions");
9777
9888
  __publicField(this, "schemeOptions", []);
@@ -9793,7 +9904,8 @@ Expected function or array of functions, received type ${typeof t}.`
9793
9904
  this.paginationStrategy = getPaginationStrategy(this.paginationStrategyOptions);
9794
9905
  this.store = this.createStore();
9795
9906
  this.gui = this.createGui();
9796
- this.dataManager = new DataManager(this, this.dataHomogenity);
9907
+ this.hookDataFilterFns();
9908
+ this.dataManager = new DataManager(this, this.containerHomogenity);
9797
9909
  this.inputController = new JabronioGuiController(this.store, this.dataManager);
9798
9910
  this.reset();
9799
9911
  }
@@ -9812,6 +9924,12 @@ Expected function or array of functions, received type ${typeof t}.`
9812
9924
  get observable() {
9813
9925
  return this.intersectionObservable || this.paginationStrategy.getPaginationElement();
9814
9926
  }
9927
+ hookDataFilterFns() {
9928
+ const defaultFilterFns = getSelectorFnsFromScheme(
9929
+ this.schemeOptions.filter((s) => typeof s === "string")
9930
+ );
9931
+ this.customDataFilterFns.push(...defaultFilterFns);
9932
+ }
9815
9933
  createStore() {
9816
9934
  const config2 = { ...StoreStateDefault, ...this.storeOptions };
9817
9935
  this.store = new Up(config2);
@@ -9867,7 +9985,7 @@ Expected function or array of functions, received type ${typeof t}.`
9867
9985
  });
9868
9986
  this.mutationObservers = [];
9869
9987
  this.paginationStrategy = getPaginationStrategy(this.paginationStrategyOptions);
9870
- this.dataManager = new DataManager(this, this.dataHomogenity);
9988
+ this.dataManager = new DataManager(this, this.containerHomogenity);
9871
9989
  this.inputController.dispose();
9872
9990
  this.inputController = new JabronioGuiController(this.store, this.dataManager);
9873
9991
  this.resetInfiniteScroller();