use once_cell::sync::Lazy;
use regex::Regex;
pub const MOBILE_WIDTH: u32 = 600;
pub const ENTRY_POINT_ELEMENTS: &[&str] = &[
"#post",
".post-content",
".article-content",
"#article-content",
".article_post",
".article-wrapper",
".entry-content",
".content-article",
".post",
".markdown-body",
"article",
"[role=\"article\"]",
"main",
"[role=\"main\"]",
"body", ];
pub const BLOCK_ELEMENTS: &[&str] = &[
"div", "section", "article", "main", "aside", "header", "footer", "nav", "content",
];
pub const PRESERVE_ELEMENTS: &[&str] = &[
"pre",
"code",
"table",
"thead",
"tbody",
"tr",
"td",
"th",
"ul",
"ol",
"li",
"dl",
"dt",
"dd",
"figure",
"figcaption",
"picture",
"details",
"summary",
"blockquote",
"form",
"fieldset",
];
pub const INLINE_ELEMENTS: &[&str] = &[
"a",
"span",
"strong",
"em",
"i",
"b",
"u",
"code",
"br",
"small",
"sub",
"sup",
"mark",
"date",
"del",
"ins",
"q",
"abbr",
"cite",
"relative-time",
"time",
"font",
];
pub const EXACT_SELECTORS: &[&str] = &[
"noscript",
"script:not([type^=\"math/\"])",
"style",
"meta",
"link",
".ad:not([class*=\"gradient\"])",
"[class^=\"ad-\" i]",
"[class$=\"-ad\" i]",
"[id^=\"ad-\" i]",
"[id$=\"-ad\" i]",
"[role=\"banner\" i]",
"[alt*=\"advert\" i]",
".promo",
".Promo",
"#barrier-page",
".alert",
"[id=\"comments\" i]",
"[id=\"comment\" i]",
"header",
".header:not(.banner)",
"#header",
"#Header",
"#banner",
"#Banner",
"nav",
".navigation",
"#navigation",
".hero",
"[role=\"navigation\" i]",
"[role=\"dialog\" i]",
"[role*=\"complementary\" i]",
"[class*=\"pagination\" i]",
".menu",
"#menu",
"#siteSub",
".previous",
"footer",
".aside",
"aside",
"button",
"canvas",
"date",
"dialog",
"fieldset",
"form",
"input:not([type=\"checkbox\"])",
"label",
"option",
"select",
"textarea",
"time",
"relative-time",
"[hidden]",
"[aria-hidden=\"true\"]:not([class*=\"math\"])",
"[style*=\"display: none\"]:not([class*=\"math\"])",
"[style*=\"display:none\"]:not([class*=\"math\"])",
"[style*=\"visibility: hidden\"]",
"[style*=\"visibility:hidden\"]",
".hidden",
".invisible",
"instaread-player",
"iframe:not([src*=\"youtube\"]):not([src*=\"youtu.be\"]):not([src*=\"vimeo\"]):not([src*=\"twitter\"]):not([src*=\"x.com\"]):not([src*=\"datawrapper\"])",
"#newsletter",
"#Newsletter",
".subscribe",
".sidebar",
".Sidebar",
"#sidebar",
"#Sidebar",
"#sitesub",
];
pub const TEST_ATTRIBUTES: &[&str] = &[
"class",
"id",
"data-test",
"data-testid",
"data-test-id",
"data-qa",
"data-cy",
];
pub const PARTIAL_SELECTORS: &[&str] = &[
"a-statement",
"access-wall",
"activitypub",
"actioncall",
"addcomment",
"advert",
"adlayout",
"ad-tldr",
"ad-placement",
"ads-container",
"_ad_",
"after_content",
"after_main_article",
"afterpost",
"alert-box",
"appendix",
"_archive",
"around-the-web",
"article-author",
"article-badges",
"article-banner",
"article-bottom",
"article-category",
"article-card",
"article-citation",
"article_date",
"article-date",
"article-end ",
"article_header",
"article-header",
"article__header",
"article__info",
"article-info",
"article-meta",
"article_meta",
"article__meta",
"article-tags",
"article_tags",
"articletitle",
"article-title",
"article_title",
"author-bio",
"author-box",
"author-info",
"author_info",
"back-to-top",
"banner",
"bio-block",
"blog-pager",
"bookmark-",
"-bookmark",
"bottomnav",
"bottom-of-article",
"breadcrumb",
"btn-",
"-btn",
"byline",
"comments",
"comment-box",
"comment-form",
"contact-",
"content-card",
"copyright",
"dateline",
"date-header",
"disclaimer",
"disqus",
"donate",
"dropdown",
"email-signup",
"entry-date",
"entry-meta",
"entry-title",
"facebook",
"feedback",
"footer",
"further-reading",
"header-logo",
"hidden-print",
"instagram",
"jump-to-",
"keep-reading",
"latest-content",
"license-",
"links-grid",
"loading",
"login",
"masthead",
"menu-",
"metadata",
"more-articles",
"more-like-this",
"most-read",
"nav-",
"navigation",
"newsletter",
"next-",
"popular",
"post-author",
"post-date",
"post-meta",
"post-tags",
"post-title",
"prev-",
"print-",
"privacy",
"profile",
"promo",
"read-more",
"read-next",
"recent-",
"recommend",
"register",
"related",
"rss-",
"search-",
"share-",
"sharing",
"sidebar",
"sign-in",
"sign-up",
"signup",
"skip-",
"social",
"sponsor",
"subscribe",
"tag-",
"tags",
"terms",
"timestamp",
"trending",
"twitter",
"widget",
];
pub const FOOTNOTE_INLINE_REFERENCES: &[&str] = &[
"sup.reference",
"cite.ltx_cite",
"sup[id^=\"fnr\"]",
"span[id^=\"fnr\"]",
"span[class*=\"footnote_ref\"]",
"span.footnote-link",
"a.citation",
"a[id^=\"ref-link\"]",
"a[href^=\"#fn\"]",
"a[href^=\"#cite\"]",
"a[href^=\"#reference\"]",
"a[href^=\"#footnote\"]",
"a[href^=\"#r\"]",
"a[href^=\"#b\"]",
"a[href*=\"cite_note\"]",
"a[href*=\"cite_ref\"]",
"a.footnote-anchor",
"span.footnote-hovercard-target a",
"a[role=\"doc-biblioref\"]",
"a[id^=\"fnref\"]",
"a[id^=\"ref-link\"]",
];
pub const FOOTNOTE_LIST_SELECTORS: &[&str] = &[
"div.footnote ol",
"div.footnotes ol",
"div[role=\"doc-endnotes\"]",
"div[role=\"doc-footnotes\"]",
"ol.footnotes-list",
"ol.footnotes",
"ol.references",
"ol[class*=\"article-references\"]",
"section.footnotes ol",
"section[role=\"doc-endnotes\"]",
"section[role=\"doc-footnotes\"]",
"section[role=\"doc-bibliography\"]",
"ul.footnotes-list",
"ul.ltx_biblist",
"div.footnote[data-component-name=\"FootnoteToDOM\"]",
];
pub const ALLOWED_EMPTY_ELEMENTS: &[&str] = &[
"area", "audio", "base", "br", "circle", "col", "defs", "ellipse", "embed", "figure", "g",
"hr", "iframe", "img", "input", "line", "link", "mask", "meta", "object", "param", "path",
"pattern", "picture", "polygon", "polyline", "rect", "source", "stop", "svg", "td", "th",
"track", "use", "video", "wbr",
];
pub const ALLOWED_ATTRIBUTES: &[&str] = &[
"alt",
"allow",
"allowfullscreen",
"aria-label",
"checked",
"colspan",
"controls",
"data-latex",
"data-src",
"data-srcset",
"data-lang",
"dir",
"display",
"frameborder",
"headers",
"height",
"href",
"lang",
"role",
"rowspan",
"src",
"srcset",
"title",
"type",
"width",
"accent",
"accentunder",
"align",
"columnalign",
"columnlines",
"columnspacing",
"columnspan",
"data-mjx-texclass",
"depth",
"displaystyle",
"fence",
"frame",
"framespacing",
"linethickness",
"lspace",
"mathsize",
"mathvariant",
"maxsize",
"minsize",
"movablelimits",
"notation",
"rowalign",
"rowlines",
"rowspacing",
"rowspan",
"rspace",
"scriptlevel",
"separator",
"stretchy",
"symmetric",
"voffset",
"xmlns",
];
pub const ALLOWED_ATTRIBUTES_DEBUG: &[&str] = &["class", "id"];
pub static PARTIAL_SELECTORS_REGEX: Lazy<Regex> = Lazy::new(|| {
let pattern = PARTIAL_SELECTORS.join("|");
Regex::new(&pattern).expect("Failed to compile partial selectors regex")
});
pub const CONTENT_INDICATORS: &[&str] = &[
"admonition",
"article",
"content",
"entry",
"image",
"img",
"font",
"figure",
"figcaption",
"pre",
"main",
"post",
"story",
"table",
];
pub const NAVIGATION_INDICATORS: &[&str] = &[
"advertisement",
"all rights reserved",
"banner",
"cookie",
"comments",
"copyright",
"follow me",
"follow us",
"footer",
"header",
"homepage",
"login",
"menu",
"more articles",
"more like this",
"most read",
"nav",
"navigation",
"newsletter",
"popular",
"privacy",
"recommended",
"register",
"related",
"responses",
"share",
"sidebar",
"sign in",
"sign up",
"signup",
"social",
"sponsored",
"subscribe",
"terms",
"trending",
];
pub const NON_CONTENT_PATTERNS: &[&str] = &[
"ad",
"banner",
"cookie",
"copyright",
"footer",
"header",
"homepage",
"menu",
"nav",
"newsletter",
"popular",
"privacy",
"recommended",
"related",
"rights",
"share",
"sidebar",
"social",
"sponsored",
"subscribe",
"terms",
"trending",
"widget",
];