// ==UserScript== // @name Letterboxd Plus // @name:ru Letterboxd Plus // @name:es Letterboxd Plus // @name:pt-BR Letterboxd Plus // @name:de Letterboxd Plus // @name:fr Letterboxd Plus // @name:zh-CN Letterboxd Plus // @namespace https://github.com/NemoKing1210/letterboxd-plus // @version 0.6.2 // @author NemoKing1210 // @description Adds external ratings and enhanced cast cards to Letterboxd // @description:ru Добавляет в Letterboxd внешние рейтинги и карточки актёров // @description:es Añade valoraciones externas y fichas del reparto a Letterboxd // @description:pt-BR Adiciona avaliações externas e cartões do elenco ao Letterboxd // @description:de Ergänzt Letterboxd um externe Wertungen und Besetzungskarten // @description:fr Ajoute des notes externes et des fiches de distribution à Letterboxd // @description:zh-CN 为 Letterboxd 添加外部评分和增强演员卡片 // @license MIT // @icon https://letterboxd.com/favicon.ico // @homepage https://github.com/NemoKing1210/letterboxd-plus // @homepageURL https://github.com/NemoKing1210/letterboxd-plus // @source https://github.com/NemoKing1210/letterboxd-plus.git // @supportURL https://github.com/NemoKing1210/letterboxd-plus/issues // @downloadURL https://raw.githubusercontent.com/NemoKing1210/letterboxd-plus/main/letterboxd-plus.user.js // @updateURL https://raw.githubusercontent.com/NemoKing1210/letterboxd-plus/main/letterboxd-plus.user.js // @match https://letterboxd.com/* // @match https://www.letterboxd.com/* // @tag letterboxd // @tag movies // @tag ratings // @connect www.rottentomatoes.com // @connect rottentomatoes.com // @connect backend.metacritic.com // @grant GM_addStyle // @grant GM_deleteValue // @grant GM_getValue // @grant GM_listValues // @grant GM_registerMenuCommand // @grant GM_setValue // @grant GM_xmlhttpRequest // @run-at document-idle // @noframes // ==/UserScript== (e=>{if(typeof GM_addStyle=="function"){GM_addStyle(e);return}const t=document.createElement("style");t.textContent=e,document.head.append(t)})(' :root{--lbp-bg: #14181c;--lbp-panel: #1f252b;--lbp-panel-2: #2c3440;--lbp-text: #f3f6f8;--lbp-muted: #9ab;--lbp-green: #00e054;--lbp-blue: #40bcf4;--lbp-orange: #ff8000;--lbp-line: rgba(255, 255, 255, .1)}html.lbp-modal-open{overflow:hidden}.lbp-rating{box-sizing:border-box;margin:0 0 28px;padding:0}.lbp-rating__header{align-items:center;border-bottom:1px solid #456;display:flex;gap:7px;justify-content:space-between}.lbp-rating__favicon{display:block;flex:0 0 auto;height:16px;margin-bottom:5px;object-fit:contain;width:16px}.lbp-rating__header .section-heading{border-bottom:0;flex:1 1 auto;margin-bottom:0;padding-bottom:5px}.lbp-rating__body{padding-top:10px}.lbp-rating__link{color:inherit;display:block;text-decoration:none}.lbp-rating__score{align-items:center;background:#242c34;border-radius:3px;display:grid;gap:12px;grid-template-columns:58px minmax(0,1fr);min-height:50px;padding:8px 10px;transition:background-color .15s ease}.lbp-rating__score+.lbp-rating__score{border-top:1px solid #14181c}.lbp-rating__link:hover .lbp-rating__score,.lbp-rating__link:focus-visible .lbp-rating__score{background:#303840}.lbp-rating__link:focus-visible{outline:2px solid var(--lbp-blue);outline-offset:2px}.lbp-rating__value{color:#fff;font-size:20px;font-variant-numeric:tabular-nums;font-weight:700;letter-spacing:-.035em}.lbp-rating__score--critics .lbp-rating__value{border-left:3px solid var(--lbp-orange);padding-left:8px}.lbp-rating__score--audience .lbp-rating__value{border-left:3px solid var(--lbp-green);padding-left:8px}.lbp-rating__score--metascore .lbp-rating__value,.lbp-rating__score--user-score .lbp-rating__value{border-left:3px solid #789;padding-left:8px}.lbp-rating__score--average .lbp-rating__value{border-left:3px solid var(--lbp-blue);padding-left:8px}.lbp-rating__score--positive .lbp-rating__value{border-left-color:var(--lbp-green)}.lbp-rating__score--mixed .lbp-rating__value{border-left-color:#fc0}.lbp-rating__score--negative .lbp-rating__value{border-left-color:#e54b4b}.lbp-rating__meta{display:flex;flex-direction:column;min-width:0}.lbp-rating__meta strong{color:#c8d4dc;font-size:11px;line-height:1.25}.lbp-rating__meta small{color:#789;font-size:10px;line-height:1.3;margin-top:2px}.lbp-rating__body.is-loading{cursor:progress}.lbp-rating__skeleton{pointer-events:none}.lbp-rating__skeleton-value,.lbp-rating__skeleton-copy span{animation:lbp-shimmer 1.25s ease-in-out infinite;background:linear-gradient(90deg,#303943 20%,#3d4853,#303943 80%);background-size:220% 100%;border-radius:2px;display:block}.lbp-rating__skeleton-value{border-left:3px solid #3d4853;height:20px;margin-left:0;width:45px}.lbp-rating__skeleton-copy{display:grid;gap:7px}.lbp-rating__skeleton-copy span:first-child{height:9px;width:min(110px,72%)}.lbp-rating__skeleton-copy span:last-child{height:7px;width:min(76px,50%)}.lbp-rating__body.is-empty{color:#789;font-size:11px;line-height:1.45}@keyframes lbp-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}.lbp-cast-list--enhanced{display:grid;gap:8px;grid-template-columns:repeat(auto-fill,minmax(145px,1fr))}.lbp-cast-list--enhanced .lbp-cast-card.text-slug{align-items:center;background:#242c34;border-radius:3px;color:#c8d4dc;display:grid;float:none;gap:9px;grid-template-columns:46px minmax(0,1fr);margin:0;min-height:64px;overflow:hidden;padding:0 8px 0 0;text-decoration:none;transition:background-color .15s ease}.lbp-cast-list--enhanced .lbp-cast-card:hover,.lbp-cast-list--enhanced .lbp-cast-card:focus-visible{background:#303840;color:#fff;outline:2px solid var(--lbp-green);outline-offset:2px}.lbp-cast-card__portrait{align-self:stretch;background:radial-gradient(circle at 50% 34%,#566574 0 15%,transparent 16%),radial-gradient(ellipse at 50% 105%,#566574 0 42%,transparent 43%),#303943;display:block;min-height:64px;overflow:hidden;position:relative}.lbp-cast-card[data-lbp-portrait-state=loading] .lbp-cast-card__portrait:after{animation:lbp-shimmer 1.25s ease-in-out infinite;background:linear-gradient(90deg,transparent 20%,rgba(255,255,255,.1) 50%,transparent 80%);background-size:220% 100%;content:"";inset:0;position:absolute}.lbp-cast-card__portrait img{height:100%;inset:0;object-fit:cover;opacity:0;position:absolute;transition:opacity .18s ease,transform .18s ease;width:100%}.lbp-cast-card[data-lbp-portrait-state=loaded] .lbp-cast-card__portrait img{opacity:1}.lbp-cast-card:hover .lbp-cast-card__portrait img{transform:scale(1.035)}.lbp-cast-card__copy{display:flex;flex-direction:column;min-width:0}.lbp-cast-card__copy strong{color:inherit;font-size:11px;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lbp-cast-card__copy small{color:#789;display:-webkit-box;font-size:9px;line-height:1.3;margin-top:3px;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.lbp-cast-list--enhanced>.lbp-cast-show-all{grid-column:1 / -1}.lbp-cast-list--enhanced>.lbp-cast-show-all{cursor:pointer;justify-self:start}.lbp-cast-list--enhanced>button.lbp-cast-show-all{appearance:none;border:0;font:inherit}.lbp-cast-list--enhanced:not(.lbp-cast-list--expanded) .lbp-cast-card--extra{display:none}.lbp-cast-list--enhanced>#cast-overflow{grid-column:1 / -1}.lbp-cast-list--enhanced.lbp-cast-list--expanded>#cast-overflow{display:grid!important;gap:8px;grid-template-columns:repeat(auto-fill,minmax(145px,1fr))}.lbp-settings-backdrop{align-items:center;background:#000000d1;display:flex;inset:0;justify-content:center;opacity:0;padding:18px;position:fixed;transition:opacity .18s ease;z-index:1000000}.lbp-settings-backdrop.is-open{opacity:1}.lbp-settings{background:#2c3440;border:1px solid #445566;border-radius:4px;box-shadow:0 18px 50px #000000b8;color:var(--lbp-text);display:flex;flex-direction:column;font:14px/1.45 Graphik Web,Arial,Helvetica,sans-serif;max-height:min(88vh,720px);opacity:0;overflow:hidden;transform:translateY(12px) scale(.985);transition:opacity .2s ease,transform .2s ease;width:min(720px,100%)}.lbp-settings-backdrop.is-open .lbp-settings{opacity:1;transform:none}.lbp-settings__header{background:#14181c;border-bottom:1px solid #456;padding:21px 24px 18px;position:relative}.lbp-settings__eyebrow,.lbp-settings__kicker{color:#9ab;display:block;font-size:10px;font-weight:800;letter-spacing:.14em;margin:0 0 5px;text-transform:uppercase}.lbp-settings h2,.lbp-settings h3,.lbp-settings p{margin-top:0}.lbp-settings h2{color:#fff;font-size:22px;letter-spacing:-.02em;line-height:1.1;margin-bottom:0}.lbp-settings h3{color:#fff;font-size:18px;letter-spacing:-.015em;margin-bottom:18px}.lbp-settings__close{align-items:center;appearance:none;background:transparent;border:0;border-radius:3px;color:var(--lbp-muted);cursor:pointer;display:flex;font-size:20px;height:32px;justify-content:center;line-height:1;position:absolute;right:19px;top:19px;width:32px}.lbp-settings__close:hover,.lbp-settings__close:focus-visible{color:#fff;outline:2px solid rgba(64,188,244,.55)}.lbp-settings__layout{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.lbp-settings__tabs{background:#242b33;border-bottom:1px solid #456;display:flex;flex:0 0 auto;flex-direction:row;gap:0;overflow-x:auto;padding:0 16px}.lbp-settings__tabs button{align-items:center;appearance:none;background:transparent;border:0;border-radius:0;color:var(--lbp-muted);cursor:pointer;display:inline-flex;font:inherit;font-size:12px;font-weight:700;justify-content:center;padding:13px 14px 11px;text-align:center;text-transform:uppercase}.lbp-settings__tabs button:hover{background:#ffffff09;color:#fff}.lbp-settings__tabs button.is-active{background:transparent;box-shadow:inset 0 -3px var(--lbp-green);color:#fff}.lbp-settings__tabs button:focus-visible{outline:2px solid rgba(64,188,244,.55);outline-offset:-2px}.lbp-settings__tab-badge{align-items:center;background:#3a4652;border-radius:999px;color:#b7c4cf;display:inline-flex;font-size:9px;font-variant-numeric:tabular-nums;justify-content:center;margin-left:5px;min-width:17px;padding:1px 5px}.lbp-settings__tabs button.is-active .lbp-settings__tab-badge{background:#00e05426;color:var(--lbp-green)}.lbp-settings__content{min-height:260px;overflow:auto;padding:25px 24px 28px}.lbp-settings__content [role=tabpanel][hidden]{display:none}.lbp-settings__intro{color:var(--lbp-muted);font-size:12px;line-height:1.5;margin:-8px 0 16px;max-width:540px}.lbp-settings__card,.lbp-field,.lbp-settings__about{background:#242b33;border:1px solid #3d4854;border-radius:3px}.lbp-setting-row{align-items:center;display:flex;gap:20px;justify-content:space-between;padding:15px 16px}.lbp-setting-row+.lbp-setting-row{border-top:1px solid #3d4854}.lbp-setting-row__copy,.lbp-field{display:flex;flex-direction:column}.lbp-setting-row strong,.lbp-field>span:first-child{color:#f3f6f8;font-size:13px}.lbp-setting-row small,.lbp-field small{color:var(--lbp-muted);font-size:11px;margin-top:3px}.lbp-switch{appearance:none;background:#3a434c;border:0;border-radius:999px;cursor:pointer;flex:0 0 auto;height:24px;padding:3px;transition:background-color .18s ease;width:42px}.lbp-switch span{background:#d8e1e8;border-radius:50%;box-shadow:0 2px 5px #00000059;display:block;height:18px;transition:transform .2s ease;width:18px}.lbp-switch.is-on{background:var(--lbp-green)}.lbp-switch.is-on span{transform:translate(18px)}.lbp-switch:focus-visible{outline:2px solid var(--lbp-blue);outline-offset:2px}.lbp-field{padding:16px}.lbp-field+.lbp-field{margin-top:12px}.lbp-field__input{align-items:center;color:var(--lbp-muted);display:flex;gap:8px;margin-top:14px}.lbp-field input,.lbp-field select{background:#0f1317;border:1px solid #456;border-radius:5px;color:#fff;font:inherit;padding:8px 10px}.lbp-field input{width:82px}.lbp-field select{margin-top:14px;width:100%}.lbp-field input:focus,.lbp-field select:focus{border-color:var(--lbp-blue);box-shadow:0 0 0 3px #40bcf41f;outline:none}.lbp-cache-meter{background:#1d2329;border:1px solid #3d4854;border-radius:3px;margin-bottom:12px;padding:16px}.lbp-cache-meter__head{align-items:baseline;display:flex;gap:16px;justify-content:space-between;margin-bottom:11px}.lbp-cache-meter__percent{color:#fff;font-size:22px;font-variant-numeric:tabular-nums;font-weight:700;letter-spacing:-.03em}.lbp-cache-meter__used{color:var(--lbp-muted);font-size:11px;font-variant-numeric:tabular-nums}.lbp-cache-meter__bar{background:#11161a;border:1px solid #3d4854;border-radius:999px;display:flex;height:10px;overflow:hidden}.lbp-cache-meter__segment{display:block;flex:0 0 auto;min-width:0}.lbp-cache-meter__segment.is-active{background:var(--lbp-green)}.lbp-cache-meter__segment.is-expired{background:var(--lbp-orange)}.lbp-cache-meter__legend{display:grid;gap:6px;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:12px}.lbp-cache-meter__legend span{align-items:center;color:#b7c4cf;display:flex;font-size:11px;gap:7px;min-width:0}.lbp-cache-meter__legend i{border-radius:2px;display:inline-block;flex:0 0 auto;height:8px;width:8px}.lbp-cache-meter__legend i.is-active{background:var(--lbp-green)}.lbp-cache-meter__legend i.is-expired{background:var(--lbp-orange)}.lbp-cache-meter>p{border-top:1px solid #313b44;color:#789;font-size:10px;line-height:1.45;margin:13px 0 0;padding-top:11px}.lbp-cache-actions{align-items:center;display:flex;gap:12px;margin-top:12px}.lbp-cache-actions__clear{appearance:none;background:#37414c;border:1px solid #52606d;border-radius:3px;color:#fff;cursor:pointer;flex:0 0 auto;font:inherit;font-size:11px;font-weight:700;padding:8px 12px}.lbp-cache-actions__clear:hover,.lbp-cache-actions__clear:focus-visible{background:#45515d;border-color:#71808d;outline:none}.lbp-cache-actions>span{color:var(--lbp-muted);font-size:10px;line-height:1.4}.lbp-cache-status{color:var(--lbp-green);font-size:11px;min-height:1.4em;margin:8px 0 0!important}.lbp-about{display:grid;gap:12px}.lbp-about__card{background:#242b33;border:1px solid #3d4854;border-radius:3px;padding:18px}.lbp-about__brand{align-items:center;display:flex;gap:11px}.lbp-about__brand>strong{color:#fff;font-size:16px;letter-spacing:-.015em}.lbp-about__mark{display:flex;gap:5px}.lbp-about__mark i{border-radius:50%;display:block;height:13px;width:13px}.lbp-about__mark i:nth-child(1){background:var(--lbp-orange)}.lbp-about__mark i:nth-child(2){background:var(--lbp-green)}.lbp-about__mark i:nth-child(3){background:var(--lbp-blue)}.lbp-about__description{color:#c8d4dc;font-size:12px;line-height:1.55;margin:14px 0 0!important;max-width:520px}.lbp-about__chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:13px}.lbp-about__chips span{background:#333d47;border:1px solid #465360;border-radius:999px;color:#9ab;font-size:9px;font-variant-numeric:tabular-nums;font-weight:700;letter-spacing:.04em;padding:3px 8px;text-transform:uppercase}.lbp-about__repo{align-items:center;background:#1b2127;border:1px solid #3d4854;border-radius:3px;color:inherit;display:grid;gap:10px;grid-template-columns:auto minmax(0,1fr) auto;margin-top:14px;padding:11px 12px;text-decoration:none;transition:background-color .15s ease,border-color .15s ease}.lbp-about__repo:hover,.lbp-about__repo:focus-visible{background:#202830;border-color:#607080;outline:none}.lbp-about__repo-icon{align-items:center;background:#f4f6f8;border-radius:50%;color:#14181c;display:inline-flex;font-size:8px;font-weight:900;height:26px;justify-content:center;width:26px}.lbp-about__repo>span:nth-child(2){display:flex;flex-direction:column;min-width:0}.lbp-about__repo strong{color:var(--lbp-blue);font-size:12px}.lbp-about__repo small{color:#789;font-size:10px;margin-top:2px}.lbp-about__repo b{color:#789;font-size:14px}.lbp-about__label{color:#789;font-size:9px;font-weight:800;letter-spacing:.12em;margin:0 0 12px!important;text-transform:uppercase}.lbp-about__author{align-items:center;display:flex;gap:13px}.lbp-about__author>a{flex:0 0 auto;line-height:0}.lbp-about__author img{background:#333d47;border:2px solid #536170;border-radius:50%;display:block;height:56px;object-fit:cover;width:56px}.lbp-about__author>span{align-items:flex-start;display:flex;flex-direction:column;min-width:0}.lbp-about__author-name{color:#fff;font-size:14px;font-weight:700;text-decoration:none}.lbp-about__author-name:hover,.lbp-about__author-name:focus-visible{color:var(--lbp-blue);outline:none}.lbp-about__author small{color:#789;font-size:10px;margin-top:1px}.lbp-about__email{color:var(--lbp-blue);font-size:10px;margin-top:5px;text-decoration:none;word-break:break-all}.lbp-about__email:hover{text-decoration:underline}.lbp-settings__footer{align-items:center;background:#242b33;border-top:1px solid #456;display:flex;gap:8px;justify-content:flex-end;padding:14px 18px}.lbp-settings__footer button{appearance:none;background:var(--lbp-panel-2);border:1px solid var(--lbp-line);border-radius:3px;color:#c8d4dc;cursor:pointer;font:inherit;font-size:12px;font-weight:700;padding:9px 14px}.lbp-settings__footer button:hover,.lbp-settings__footer button:focus-visible{border-color:#789;color:#fff;outline:none}.lbp-settings__footer button.is-primary{background:var(--lbp-green);border-color:transparent;color:#07160c}@media(max-width:620px){.lbp-settings__tabs{padding:8px 10px}.lbp-settings__tabs button{flex:0 0 auto}.lbp-settings__tabs button.is-active{box-shadow:inset 0 -2px var(--lbp-blue)}.lbp-settings__content{padding:22px 18px 26px}.lbp-cache-meter__legend{grid-template-columns:1fr}.lbp-cache-actions{align-items:flex-start;flex-direction:column}}@media(prefers-reduced-motion:reduce){.lbp-settings-backdrop,.lbp-settings,.lbp-switch span,.lbp-rating__skeleton,.lbp-cast-card,.lbp-cast-card__portrait:after,.lbp-cast-card__portrait img{animation:none!important;transition:none!important}} '); (function () { 'use strict'; var e=(()=>"undefined"!=typeof GM_deleteValue?GM_deleteValue:void 0)(),t=(()=>"undefined"!=typeof GM_getValue?GM_getValue:void 0)(),a=(()=>"undefined"!=typeof GM_listValues?GM_listValues:void 0)(),n=(()=>"undefined"!=typeof GM_registerMenuCommand?GM_registerMenuCommand:void 0)(),r=(()=>"undefined"!=typeof GM_setValue?GM_setValue:void 0)(),o=(()=>"undefined"!=typeof GM_xmlhttpRequest?GM_xmlhttpRequest:void 0)();const i="0.6.2",c="data-lbp-root",s="lbp_settings",l="lbp_rt_v1:",u="https://www.rottentomatoes.com",d="https://www.metacritic.com",m="https://backend.metacritic.com",p=12e3,b=5242880,g="NemoKing",h="https://github.com/NemoKing1210",v="nemoking1210@gmail.com",f=Object.freeze({uiLocale:"auto",showRottenTomatoes:true,showAudienceScore:true,showMetacritic:true,showMetacriticUserScore:true,enhanceCast:true,cacheHours:24}),y=Object.freeze(["en","ru","es","pt-BR","de","fr","zh-CN"]),w=Object.freeze({en:"English",ru:"Русский",es:"Español","pt-BR":"Português (Brasil)",de:"Deutsch",fr:"Français","zh-CN":"简体中文"}),S=Object.freeze({en:"🇬🇧",ru:"🇷🇺",es:"🇪🇸","pt-BR":"🇧🇷",de:"🇩🇪",fr:"🇫🇷","zh-CN":"🇨🇳"}),C={en:{menuSettings:"Letterboxd Plus settings",openSettingsTitle:"Open Letterboxd Plus settings",settingsTitle:"Settings",closeSettings:"Close settings",settingsSections:"Settings sections",tabGeneral:"General",tabFilm:"Film page",tabCache:"Cache",tabAbout:"About",generalTitle:"Keep external data quick",uiLanguage:"Interface language",uiLanguageHint:"Auto follows your browser language. English is used as fallback.",uiLanguageAuto:"Auto (browser language)",cacheDuration:"Cache duration",cacheHint:"Use 0 to fetch a fresh rating on every page load.",hours:"hours",cacheTitle:"Manage stored external ratings",cacheDescription:"Cached ratings make repeat visits instant and reduce requests to external providers.",cacheFilled:"{percent}% filled",cacheUsed:"{used} of {limit}",cacheActive:"{count} active ratings",cacheExpired:"{count} expired entries",cacheActiveLabel:"Active",cacheExpiredLabel:"Expired",cacheSoftLimitHint:"The meter uses a conservative advisory budget. Your userscript manager may allow more storage.",clearCache:"Clear cache",cacheClearHint:"Removes saved ratings only. Your settings will be kept.",cacheCleared:"{count} cache entries removed.",cacheAlreadyEmpty:"The rating cache is already empty.",filmTitle:"Choose what appears in the sidebar",rottenTomatoes:"Rotten Tomatoes",rottenTomatoesHint:"Show the Tomatometer beside Letterboxd ratings.",popcornmeter:"Popcornmeter",popcornmeterHint:"Include the audience score beneath the critic score.",metacritic:"Metacritic",metacriticHint:"Show Metascore beside Letterboxd ratings.",metascore:"Metascore",metacriticUserScore:"User Score",metacriticUserScoreHint:"Include the Metacritic user score beneath Metascore.",enhancedCast:"Enhanced cast",enhancedCastHint:"Show actor portraits, names, and roles in the Cast section.",showAllCast:"Show all cast",aboutTitle:"A compact companion for Letterboxd",aboutDescription:"Letterboxd Plus adds useful film context without changing the way Letterboxd feels.",viewSource:"View source on GitHub ↗",aboutLicense:"MIT License",aboutRepository:"GitHub repository",aboutRepositoryHint:"Source code, releases, and issue tracker",aboutAuthor:"Author",cancel:"Cancel",saveReload:"Save and reload",certifiedFresh:"Certified Fresh",tomatometer:"Tomatometer",criticReviews:"{count} reviews",audienceRatings:"{count} ratings",userRatings:"{count} user ratings",averageRating:"Average rating",averageRatingScore:"Combined score",averageRatingCount:"{count} ratings included",noCount:"No count available",notRated:"Not rated yet",ratingNotFound:"Rating not found on Rotten Tomatoes.",ratingUnavailable:"Rotten Tomatoes is temporarily unavailable. Reload to try again.",metacriticRatingNotFound:"Rating not found on Metacritic.",metacriticRatingUnavailable:"Metacritic is temporarily unavailable. Reload to try again."},ru:{menuSettings:"Настройки Letterboxd Plus",openSettingsTitle:"Открыть настройки Letterboxd Plus",settingsTitle:"Настройки",closeSettings:"Закрыть настройки",settingsSections:"Разделы настроек",tabGeneral:"Общие",tabFilm:"Страница фильма",tabCache:"Кэш",tabAbout:"О проекте",generalTitle:"Быстрый доступ к внешним данным",uiLanguage:"Язык интерфейса",uiLanguageHint:"Автоматически используется язык браузера. Если он не поддерживается — английский.",uiLanguageAuto:"Авто (язык браузера)",cacheDuration:"Срок хранения кэша",cacheHint:"Укажите 0, чтобы загружать свежий рейтинг при каждом открытии страницы.",hours:"часов",cacheTitle:"Управление сохранёнными рейтингами",cacheDescription:"Кэш ускоряет повторное открытие страниц и сокращает запросы к внешним источникам.",cacheFilled:"Заполнено на {percent}%",cacheUsed:"{used} из {limit}",cacheActive:"Актуальных рейтингов: {count}",cacheExpired:"Устаревших записей: {count}",cacheActiveLabel:"Актуальные",cacheExpiredLabel:"Устаревшие",cacheSoftLimitHint:"Шкала использует рекомендуемый безопасный лимит. Менеджер userscript может разрешать больше места.",clearCache:"Очистить кэш",cacheClearHint:"Удаляет только сохранённые рейтинги. Настройки останутся без изменений.",cacheCleared:"Удалено записей кэша: {count}.",cacheAlreadyEmpty:"Кэш рейтингов уже пуст.",filmTitle:"Выберите данные для боковой панели",rottenTomatoes:"Rotten Tomatoes",rottenTomatoesHint:"Показывать Tomatometer рядом с рейтингами Letterboxd.",popcornmeter:"Popcornmeter",popcornmeterHint:"Показывать зрительский рейтинг под оценкой критиков.",metacritic:"Metacritic",metacriticHint:"Показывать Metascore рядом с рейтингами Letterboxd.",metascore:"Metascore",metacriticUserScore:"User Score",metacriticUserScoreHint:"Показывать пользовательскую оценку под Metascore.",enhancedCast:"Расширенный Cast",enhancedCastHint:"Показывать портреты, имена и роли актёров в разделе Cast.",showAllCast:"Показать всех актёров",aboutTitle:"Компактное дополнение для Letterboxd",aboutDescription:"Letterboxd Plus добавляет полезные сведения о фильмах, сохраняя привычный интерфейс Letterboxd.",viewSource:"Исходный код на GitHub ↗",aboutLicense:"Лицензия MIT",aboutRepository:"Репозиторий GitHub",aboutRepositoryHint:"Исходный код, релизы и сообщения об ошибках",aboutAuthor:"Автор",cancel:"Отмена",saveReload:"Сохранить и перезагрузить",certifiedFresh:"Сертифицировано Fresh",tomatometer:"Tomatometer",criticReviews:"{count} рецензий",audienceRatings:"{count} оценок",userRatings:"{count} пользовательских оценок",averageRating:"Средний рейтинг",averageRatingScore:"Итоговая оценка",averageRatingCount:"Учтено оценок: {count}",noCount:"Количество недоступно",notRated:"Оценки пока нет",ratingNotFound:"Рейтинг на Rotten Tomatoes не найден.",ratingUnavailable:"Rotten Tomatoes временно недоступен. Перезагрузите страницу, чтобы повторить попытку.",metacriticRatingNotFound:"Рейтинг на Metacritic не найден.",metacriticRatingUnavailable:"Metacritic временно недоступен. Перезагрузите страницу, чтобы повторить попытку."},es:{menuSettings:"Ajustes de Letterboxd Plus",openSettingsTitle:"Abrir los ajustes de Letterboxd Plus",settingsTitle:"Ajustes",closeSettings:"Cerrar ajustes",settingsSections:"Secciones de ajustes",tabGeneral:"General",tabFilm:"Página de película",tabCache:"Caché",tabAbout:"Acerca de",generalTitle:"Mantén rápidos los datos externos",uiLanguage:"Idioma de la interfaz",uiLanguageHint:"Auto usa el idioma del navegador. El inglés se utiliza como alternativa.",uiLanguageAuto:"Auto (idioma del navegador)",cacheDuration:"Duración de la caché",cacheHint:"Usa 0 para obtener una valoración nueva en cada carga.",hours:"horas",cacheTitle:"Gestiona las valoraciones guardadas",cacheDescription:"La caché acelera las visitas repetidas y reduce las solicitudes a proveedores externos.",cacheFilled:"{percent}% ocupado",cacheUsed:"{used} de {limit}",cacheActive:"{count} valoraciones activas",cacheExpired:"{count} entradas caducadas",cacheActiveLabel:"Activas",cacheExpiredLabel:"Caducadas",cacheSoftLimitHint:"El medidor usa un límite recomendado conservador. Tu gestor puede permitir más espacio.",clearCache:"Vaciar caché",cacheClearHint:"Solo elimina valoraciones guardadas. Mantiene tus ajustes.",cacheCleared:"Se eliminaron {count} entradas de caché.",cacheAlreadyEmpty:"La caché de valoraciones ya está vacía.",filmTitle:"Elige qué aparece en la barra lateral",rottenTomatoes:"Rotten Tomatoes",rottenTomatoesHint:"Muestra Tomatometer junto a las valoraciones de Letterboxd.",popcornmeter:"Popcornmeter",popcornmeterHint:"Incluye la valoración del público bajo la de la crítica.",metacritic:"Metacritic",metacriticHint:"Muestra Metascore junto a las valoraciones de Letterboxd.",metascore:"Metascore",metacriticUserScore:"Puntuación de usuarios",metacriticUserScoreHint:"Incluye la puntuación de usuarios bajo Metascore.",enhancedCast:"Reparto ampliado",enhancedCastHint:"Muestra retratos, nombres y papeles en la sección de reparto.",showAllCast:"Mostrar todo el reparto",aboutTitle:"Un complemento compacto para Letterboxd",aboutDescription:"Letterboxd Plus añade contexto útil sin cambiar la esencia de Letterboxd.",viewSource:"Ver código en GitHub ↗",aboutLicense:"Licencia MIT",aboutRepository:"Repositorio de GitHub",aboutRepositoryHint:"Código fuente, versiones e incidencias",aboutAuthor:"Autor",cancel:"Cancelar",saveReload:"Guardar y recargar",certifiedFresh:"Certified Fresh",tomatometer:"Tomatometer",criticReviews:"{count} reseñas",audienceRatings:"{count} valoraciones",userRatings:"{count} valoraciones de usuarios",averageRating:"Valoración media",averageRatingScore:"Puntuación combinada",averageRatingCount:"{count} valoraciones incluidas",noCount:"Cantidad no disponible",notRated:"Aún sin valoración",ratingNotFound:"No se encontró la valoración en Rotten Tomatoes.",ratingUnavailable:"Rotten Tomatoes no está disponible temporalmente. Recarga para intentarlo de nuevo.",metacriticRatingNotFound:"No se encontró la valoración en Metacritic.",metacriticRatingUnavailable:"Metacritic no está disponible temporalmente. Recarga para intentarlo de nuevo."},"pt-BR":{menuSettings:"Configurações do Letterboxd Plus",openSettingsTitle:"Abrir configurações do Letterboxd Plus",settingsTitle:"Configurações",closeSettings:"Fechar configurações",settingsSections:"Seções de configurações",tabGeneral:"Geral",tabFilm:"Página do filme",tabCache:"Cache",tabAbout:"Sobre",generalTitle:"Mantenha os dados externos rápidos",uiLanguage:"Idioma da interface",uiLanguageHint:"Automático segue o idioma do navegador. Inglês é usado como alternativa.",uiLanguageAuto:"Automático (idioma do navegador)",cacheDuration:"Duração do cache",cacheHint:"Use 0 para buscar uma avaliação nova a cada carregamento.",hours:"horas",cacheTitle:"Gerencie as avaliações salvas",cacheDescription:"O cache acelera visitas repetidas e reduz solicitações a provedores externos.",cacheFilled:"{percent}% ocupado",cacheUsed:"{used} de {limit}",cacheActive:"{count} avaliações ativas",cacheExpired:"{count} entradas expiradas",cacheActiveLabel:"Ativas",cacheExpiredLabel:"Expiradas",cacheSoftLimitHint:"O medidor usa um limite recomendado conservador. Seu gerenciador pode permitir mais espaço.",clearCache:"Limpar cache",cacheClearHint:"Remove apenas avaliações salvas. Suas configurações serão mantidas.",cacheCleared:"{count} entradas de cache removidas.",cacheAlreadyEmpty:"O cache de avaliações já está vazio.",filmTitle:"Escolha o que aparece na barra lateral",rottenTomatoes:"Rotten Tomatoes",rottenTomatoesHint:"Mostra o Tomatometer ao lado das avaliações do Letterboxd.",popcornmeter:"Popcornmeter",popcornmeterHint:"Inclui a nota do público abaixo da nota da crítica.",metacritic:"Metacritic",metacriticHint:"Mostra o Metascore ao lado das avaliações do Letterboxd.",metascore:"Metascore",metacriticUserScore:"Nota dos usuários",metacriticUserScoreHint:"Inclui a nota dos usuários abaixo do Metascore.",enhancedCast:"Elenco ampliado",enhancedCastHint:"Mostra retratos, nomes e papéis na seção de elenco.",showAllCast:"Mostrar todo o elenco",aboutTitle:"Um complemento compacto para o Letterboxd",aboutDescription:"Letterboxd Plus adiciona contexto útil sem mudar a experiência do Letterboxd.",viewSource:"Ver código no GitHub ↗",aboutLicense:"Licença MIT",aboutRepository:"Repositório no GitHub",aboutRepositoryHint:"Código-fonte, versões e relatos de problemas",aboutAuthor:"Autor",cancel:"Cancelar",saveReload:"Salvar e recarregar",certifiedFresh:"Certified Fresh",tomatometer:"Tomatometer",criticReviews:"{count} críticas",audienceRatings:"{count} avaliações",userRatings:"{count} avaliações de usuários",averageRating:"Avaliação média",averageRatingScore:"Nota combinada",averageRatingCount:"{count} avaliações incluídas",noCount:"Contagem indisponível",notRated:"Ainda sem avaliação",ratingNotFound:"Avaliação não encontrada no Rotten Tomatoes.",ratingUnavailable:"Rotten Tomatoes está temporariamente indisponível. Recarregue para tentar novamente.",metacriticRatingNotFound:"Avaliação não encontrada no Metacritic.",metacriticRatingUnavailable:"Metacritic está temporariamente indisponível. Recarregue para tentar novamente."},de:{menuSettings:"Letterboxd-Plus-Einstellungen",openSettingsTitle:"Letterboxd-Plus-Einstellungen öffnen",settingsTitle:"Einstellungen",closeSettings:"Einstellungen schließen",settingsSections:"Einstellungsbereiche",tabGeneral:"Allgemein",tabFilm:"Filmseite",tabCache:"Cache",tabAbout:"Über",generalTitle:"Externe Daten schnell verfügbar halten",uiLanguage:"Oberflächensprache",uiLanguageHint:"Automatisch übernimmt die Browsersprache. Englisch dient als Fallback.",uiLanguageAuto:"Automatisch (Browsersprache)",cacheDuration:"Cache-Dauer",cacheHint:"Mit 0 wird die Bewertung bei jedem Laden neu abgerufen.",hours:"Stunden",cacheTitle:"Gespeicherte Bewertungen verwalten",cacheDescription:"Der Cache beschleunigt wiederholte Besuche und reduziert Anfragen an externe Anbieter.",cacheFilled:"{percent}% belegt",cacheUsed:"{used} von {limit}",cacheActive:"{count} aktive Bewertungen",cacheExpired:"{count} abgelaufene Einträge",cacheActiveLabel:"Aktiv",cacheExpiredLabel:"Abgelaufen",cacheSoftLimitHint:"Die Anzeige nutzt ein konservatives Richtbudget. Der Userscript-Manager kann mehr Speicher erlauben.",clearCache:"Cache leeren",cacheClearHint:"Entfernt nur gespeicherte Bewertungen. Einstellungen bleiben erhalten.",cacheCleared:"{count} Cache-Einträge entfernt.",cacheAlreadyEmpty:"Der Bewertungscache ist bereits leer.",filmTitle:"Inhalte der Seitenleiste auswählen",rottenTomatoes:"Rotten Tomatoes",rottenTomatoesHint:"Tomatometer neben den Letterboxd-Bewertungen anzeigen.",popcornmeter:"Popcornmeter",popcornmeterHint:"Publikumswertung unter der Kritikerwertung anzeigen.",metacritic:"Metacritic",metacriticHint:"Metascore neben den Letterboxd-Bewertungen anzeigen.",metascore:"Metascore",metacriticUserScore:"Nutzerwertung",metacriticUserScoreHint:"Nutzerwertung unter dem Metascore anzeigen.",enhancedCast:"Erweiterte Besetzung",enhancedCastHint:"Zeigt Porträts, Namen und Rollen im Besetzungsbereich.",showAllCast:"Gesamte Besetzung anzeigen",aboutTitle:"Eine kompakte Ergänzung für Letterboxd",aboutDescription:"Letterboxd Plus ergänzt nützliche Filminformationen, ohne Letterboxd zu verfremden.",viewSource:"Quellcode auf GitHub ↗",aboutLicense:"MIT-Lizenz",aboutRepository:"GitHub-Repository",aboutRepositoryHint:"Quellcode, Releases und Fehlermeldungen",aboutAuthor:"Autor",cancel:"Abbrechen",saveReload:"Speichern und neu laden",certifiedFresh:"Certified Fresh",tomatometer:"Tomatometer",criticReviews:"{count} Kritiken",audienceRatings:"{count} Bewertungen",userRatings:"{count} Nutzerbewertungen",averageRating:"Durchschnittsbewertung",averageRatingScore:"Gesamtwertung",averageRatingCount:"{count} Wertungen berücksichtigt",noCount:"Anzahl nicht verfügbar",notRated:"Noch nicht bewertet",ratingNotFound:"Keine Bewertung auf Rotten Tomatoes gefunden.",ratingUnavailable:"Rotten Tomatoes ist vorübergehend nicht verfügbar. Bitte neu laden.",metacriticRatingNotFound:"Keine Bewertung auf Metacritic gefunden.",metacriticRatingUnavailable:"Metacritic ist vorübergehend nicht verfügbar. Bitte neu laden."},fr:{menuSettings:"Paramètres de Letterboxd Plus",openSettingsTitle:"Ouvrir les paramètres de Letterboxd Plus",settingsTitle:"Paramètres",closeSettings:"Fermer les paramètres",settingsSections:"Sections des paramètres",tabGeneral:"Général",tabFilm:"Page du film",tabCache:"Cache",tabAbout:"À propos",generalTitle:"Gardez les données externes rapides",uiLanguage:"Langue de l'interface",uiLanguageHint:"Auto suit la langue du navigateur. L'anglais est utilisé par défaut.",uiLanguageAuto:"Auto (langue du navigateur)",cacheDuration:"Durée du cache",cacheHint:"Utilisez 0 pour récupérer une note à chaque chargement.",hours:"heures",cacheTitle:"Gérer les notes enregistrées",cacheDescription:"Le cache accélère les visites répétées et réduit les requêtes vers les sources externes.",cacheFilled:"{percent}% utilisé",cacheUsed:"{used} sur {limit}",cacheActive:"{count} notes actives",cacheExpired:"{count} entrées expirées",cacheActiveLabel:"Actives",cacheExpiredLabel:"Expirées",cacheSoftLimitHint:"La jauge utilise un budget indicatif prudent. Votre gestionnaire peut autoriser plus de stockage.",clearCache:"Vider le cache",cacheClearHint:"Supprime uniquement les notes enregistrées. Vos paramètres sont conservés.",cacheCleared:"{count} entrées de cache supprimées.",cacheAlreadyEmpty:"Le cache des notes est déjà vide.",filmTitle:"Choisissez le contenu de la barre latérale",rottenTomatoes:"Rotten Tomatoes",rottenTomatoesHint:"Afficher le Tomatometer avec les notes Letterboxd.",popcornmeter:"Popcornmeter",popcornmeterHint:"Inclure la note du public sous celle des critiques.",metacritic:"Metacritic",metacriticHint:"Afficher le Metascore avec les notes Letterboxd.",metascore:"Metascore",metacriticUserScore:"Note des utilisateurs",metacriticUserScoreHint:"Inclure la note des utilisateurs sous le Metascore.",enhancedCast:"Distribution enrichie",enhancedCastHint:"Affiche portraits, noms et rôles dans la distribution.",showAllCast:"Afficher toute la distribution",aboutTitle:"Un compagnon compact pour Letterboxd",aboutDescription:"Letterboxd Plus ajoute un contexte utile sans changer l'expérience Letterboxd.",viewSource:"Voir le code sur GitHub ↗",aboutLicense:"Licence MIT",aboutRepository:"Dépôt GitHub",aboutRepositoryHint:"Code source, versions et suivi des problèmes",aboutAuthor:"Auteur",cancel:"Annuler",saveReload:"Enregistrer et recharger",certifiedFresh:"Certified Fresh",tomatometer:"Tomatometer",criticReviews:"{count} critiques",audienceRatings:"{count} notes",userRatings:"{count} notes utilisateurs",averageRating:"Note moyenne",averageRatingScore:"Note combinée",averageRatingCount:"{count} notes prises en compte",noCount:"Nombre indisponible",notRated:"Pas encore noté",ratingNotFound:"Note introuvable sur Rotten Tomatoes.",ratingUnavailable:"Rotten Tomatoes est temporairement indisponible. Rechargez pour réessayer.",metacriticRatingNotFound:"Note introuvable sur Metacritic.",metacriticRatingUnavailable:"Metacritic est temporairement indisponible. Rechargez pour réessayer."},"zh-CN":{menuSettings:"Letterboxd Plus 设置",openSettingsTitle:"打开 Letterboxd Plus 设置",settingsTitle:"设置",closeSettings:"关闭设置",settingsSections:"设置分区",tabGeneral:"常规",tabFilm:"影片页面",tabCache:"缓存",tabAbout:"关于",generalTitle:"让外部数据保持快速",uiLanguage:"界面语言",uiLanguageHint:"自动模式跟随浏览器语言;不支持时回退到英语。",uiLanguageAuto:"自动(浏览器语言)",cacheDuration:"缓存时长",cacheHint:"设为 0 可在每次加载页面时获取最新评分。",hours:"小时",cacheTitle:"管理已保存的外部评分",cacheDescription:"缓存可加快重复访问,并减少对外部评分来源的请求。",cacheFilled:"已使用 {percent}%",cacheUsed:"{used} / {limit}",cacheActive:"{count} 条有效评分",cacheExpired:"{count} 条过期记录",cacheActiveLabel:"有效",cacheExpiredLabel:"过期",cacheSoftLimitHint:"该仪表使用保守的建议容量;userscript 管理器可能允许更多空间。",clearCache:"清除缓存",cacheClearHint:"仅删除已保存的评分,不会更改设置。",cacheCleared:"已删除 {count} 条缓存记录。",cacheAlreadyEmpty:"评分缓存已经为空。",filmTitle:"选择侧边栏中显示的内容",rottenTomatoes:"Rotten Tomatoes",rottenTomatoesHint:"在 Letterboxd 评分旁显示 Tomatometer。",popcornmeter:"Popcornmeter",popcornmeterHint:"在影评人评分下显示观众评分。",metacritic:"Metacritic",metacriticHint:"在 Letterboxd 评分旁显示 Metascore。",metascore:"Metascore",metacriticUserScore:"用户评分",metacriticUserScoreHint:"在 Metascore 下显示 Metacritic 用户评分。",enhancedCast:"增强演职员表",enhancedCastHint:"在演员表中显示演员头像、姓名和角色。",showAllCast:"显示全部演员",aboutTitle:"紧凑的 Letterboxd 助手",aboutDescription:"Letterboxd Plus 在不改变网站体验的前提下补充实用影片信息。",viewSource:"在 GitHub 查看源代码 ↗",aboutLicense:"MIT 许可证",aboutRepository:"GitHub 仓库",aboutRepositoryHint:"源代码、版本发布和问题跟踪",aboutAuthor:"作者",cancel:"取消",saveReload:"保存并重新加载",certifiedFresh:"新鲜认证",tomatometer:"Tomatometer",criticReviews:"{count} 条影评",audienceRatings:"{count} 条评分",userRatings:"{count} 条用户评分",averageRating:"平均评分",averageRatingScore:"综合评分",averageRatingCount:"已计入 {count} 项评分",noCount:"暂无数量",notRated:"暂无评分",ratingNotFound:"未在 Rotten Tomatoes 找到评分。",ratingUnavailable:"Rotten Tomatoes 暂时不可用,请重新加载后重试。",metacriticRatingNotFound:"未在 Metacritic 找到评分。",metacriticRatingUnavailable:"Metacritic 暂时不可用,请重新加载后重试。"}},L=Object.freeze({en:"en",ru:"ru",es:"es",pt:"pt-BR","pt-br":"pt-BR",de:"de",fr:"fr",zh:"zh-CN","zh-cn":"zh-CN","zh-hans":"zh-CN"});let x="en";function R(e){const t=String(e||"").trim().toLowerCase();return L[t]||L[t.split("-")[0]]||null}function A(e="auto"){return x="auto"===e?function(){var e;const t=(null==(e=navigator.languages)?void 0:e.length)?navigator.languages:[navigator.language];for(const a of t){const e=R(a);if(e)return e}return "en"}():R(e)||"en",x}function _(e){return new Intl.NumberFormat(x).format(e)}function T(e,t={}){var a,n,r;const o=null!=(r=null!=(n=null==(a=C[x])?void 0:a[e])?n:C.en[e])?r:e;return Object.entries(t).reduce((e,[t,a])=>e.split(`{${t}}`).join(String(a)),o)}const M="lbp:ratings-changed";function E(e){return `\n \n `}function H({id:e,title:t,faviconUrl:a="",skeletonModifiers:n,variant:r="source"}){var o;const i=document.createElement("section");return i.id=e,i.className=`lbp-rating lbp-rating--${r} section`,i.setAttribute("aria-live","polite"),i.setAttribute("aria-busy","true"),i.innerHTML=`\n
\n ${a?`\n `:""}\n

${t}

\n
\n
\n ${n.map(E).join("")}\n
\n `,null==(o=i.querySelector(".lbp-rating__favicon"))||o.addEventListener("error",e=>e.currentTarget.remove(),{once:true}),i}function $(e,t){var a;const n=t.querySelector(".ratings-histogram-chart");if(!n)return t.appendChild(e),void k(e);let r=n;for(;null==(a=r.nextElementSibling)?void 0:a.classList.contains("lbp-rating--source");)r=r.nextElementSibling;r.insertAdjacentElement("afterend",e),k(e);}function N({displayValue:e,label:t,detail:a,modifier:n,score:r,maxScore:o,tone:i=""}){const c=i?` lbp-rating__score--${i}`:"",s=function(e,t){if(null==e)return null;const a=Number(e),n=Number(t);return !Number.isFinite(a)||!Number.isFinite(n)||n<=0||a<0||a>n?null:a/n*5}(r,o);return `\n \n ${e}\n \n ${t}\n ${a}\n \n \n `}function F(e,t,a){const n=e.querySelector(".lbp-rating__body");if(!n)return;e.setAttribute("aria-busy","false"),n.className="lbp-rating__body";const r=document.createElement("a");r.className="lbp-rating__link",r.href=t,r.target="_blank",r.rel="noopener noreferrer",r.innerHTML=a.map(N).join(""),n.replaceChildren(r),k(e);}function P(e,t){const a=e.querySelector(".lbp-rating__body");if(!a)return;e.setAttribute("aria-busy","false"),a.className="lbp-rating__body is-empty";const n=document.createElement("span");n.textContent=t,a.replaceChildren(n),k(e);}function k(e){e.dispatchEvent(new CustomEvent(M,{bubbles:true}));}const q="lbp-average-rating";let U=false;function z(){const e=document.getElementById(q),t=null==e?void 0:e.closest("aside.sidebar");if(!e||!t)return;if(t.querySelector('.lbp-rating--source[aria-busy="true"]'))return void function(e){const t=e.querySelector(".lbp-rating__body");t&&!t.classList.contains("is-loading")&&(e.setAttribute("aria-busy","true"),t.className="lbp-rating__body is-loading",t.innerHTML=["average"].map(E).join(""));}(e);const a=function(e){const t=[],a=e.querySelector(".ratings-histogram-chart .averagerating"),n=a?function(e){var t;const a=null==(t=e.dataset.originalTitle)?void 0:t.match(/average\D+([0-5](?:[.,]\d+)?)/i),n=(null==a?void 0:a[1])||e.textContent.trim(),r=Number.parseFloat(n.replace(",","."));return Number.isFinite(r)&&r>=0&&r<=5?r:null}(a):null;null!=n&&t.push(n);for(const r of e.querySelectorAll(".lbp-rating--source [data-lbp-rating-value]")){const e=Number(r.dataset.lbpRatingValue);Number.isFinite(e)&&e>=0&&e<=5&&t.push(e);}return t}(t);0!==a.length?function(e,t){const a=e.querySelector(".lbp-rating__body");if(!a)return;const n=t.reduce((e,t)=>e+t,0)/t.length,r=document.createElement("span");r.className="lbp-rating__score lbp-rating__score--average";const o=document.createElement("span");o.className="lbp-rating__value",o.textContent=n.toFixed(1);const i=document.createElement("span");i.className="lbp-rating__meta";const c=document.createElement("strong");c.textContent=T("averageRatingScore");const s=document.createElement("small");s.textContent=T("averageRatingCount",{count:t.length}),i.append(c,s),r.append(o,i),e.setAttribute("aria-busy","false"),a.className="lbp-rating__body",a.replaceChildren(r);}(e,a):function(e){const t=e.querySelector(".lbp-rating__body");if(!t)return;const a=document.createElement("span");a.textContent=T("notRated"),e.setAttribute("aria-busy","false"),t.className="lbp-rating__body is-empty",t.replaceChildren(a);}(e);}const D=new Set(["a.ltrbxd.com","image.tmdb.org"]),G=new Map,B=new Map,I=[];let j=0;function O(){for(;j<3&&I.length>0;){const{task:e,resolve:t,reject:a}=I.shift();j+=1,Promise.resolve().then(e).then(t,a).finally(()=>{j-=1,O();});}}function K(e){return new Promise((t,a)=>{I.push({task:e,resolve:t,reject:a}),O();})}function V(e){let t;try{t=function(e){const t=new URL(e,window.location.origin);if(t.origin!==window.location.origin||!t.pathname.startsWith("/actor/"))throw new Error("Invalid Letterboxd actor URL.");return t}(e);}catch(r){return console.warn("[Letterboxd Plus] Invalid actor portrait request.",r),Promise.resolve(null)}const a=t.pathname;if(G.has(a))return Promise.resolve(G.get(a));if(B.has(a))return B.get(a);const n=K(()=>async function(e){const t=new AbortController,a=window.setTimeout(()=>t.abort(),p);try{const a=await fetch(e.href,{cache:"default",credentials:"same-origin",headers:{Accept:"text/html,application/xhtml+xml"},signal:t.signal});if(!a.ok)throw new Error(`Letterboxd returned HTTP ${a.status}.`);return function(e){var t;const a=null==(t=(new DOMParser).parseFromString(e,"text/html").querySelector(".js-tmdb-person[data-image]"))?void 0:t.dataset.image;if(!a)return null;const n=new URL(a,window.location.origin);return "https:"===n.protocol&&D.has(n.hostname)?n.href:null}(await a.text())}finally{window.clearTimeout(a);}}(t)).then(e=>(e&&G.set(a,e),e)).catch(e=>(console.warn("[Letterboxd Plus] Failed to load actor portrait.",{actor:a,error:e}),null)).finally(()=>B.delete(a));return B.set(a,n),n}const W="lbp-cast-card",J="lbp-cast-list--enhanced",Y=new Set,Q=new Map;let Z=null;function X(e){"idle"===e.dataset.lbpPortraitState&&(e.dataset.lbpPortraitState="loading",V(e.href).then(t=>{if(!e.isConnected)return;const a=e.querySelector(".lbp-cast-card__portrait");if(!a||!t)return void(e.dataset.lbpPortraitState="empty");const n=document.createElement("img");n.alt="",n.decoding="async",n.loading="lazy",n.referrerPolicy="no-referrer",n.addEventListener("load",()=>{e.isConnected&&(e.dataset.lbpPortraitState="loaded");},{once:true}),n.addEventListener("error",()=>{n.remove(),e.isConnected&&(e.dataset.lbpPortraitState="empty");},{once:true}),a.appendChild(n),n.src=t;}));}function ee(e){var t;if(e.classList.contains(W)||!function(e){try{const t=new URL(e.href,window.location.origin);return t.origin===window.location.origin&&t.pathname.startsWith("/actor/")?t.pathname:""}catch(t){return ""}}(e))return;const a=e.textContent.trim();if(!a)return;const n=document.createElement("span");n.className="lbp-cast-card__portrait",n.setAttribute("aria-hidden","true");const r=document.createElement("span");r.className="lbp-cast-card__copy";const o=document.createElement("strong");o.textContent=a,r.appendChild(o);const i=null==(t=e.dataset.originalTitle)?void 0:t.trim();if(i){const e=document.createElement("small");e.textContent=i,r.appendChild(e);}var c;e.dataset.lbpCastName=a,e.dataset.lbpPortraitState="idle",e.classList.add(W),e.replaceChildren(n,r),c=e,"function"==typeof IntersectionObserver?Y.has(c)||(Y.add(c),(Z||(Z=new IntersectionObserver((e,t)=>{for(const a of e)a.isIntersecting&&(t.unobserve(a.target),Y.delete(a.target),X(a.target));},{rootMargin:"240px 0px"}),Z)).observe(c)):X(c);}function te(e,t){e.classList.add("lbp-cast-list--expanded"),t.setAttribute("aria-expanded","true"),t.hidden=true;}function ae(e,t){for(const[c,s]of t.entries())s.classList.toggle("lbp-cast-card--extra",c>=10);if(t.length<=10)return;let a=e.querySelector(".lbp-cast-show-all, #has-cast-overflow");const n=!a;if(a)a.classList.add("lbp-cast-show-all");else {a=document.createElement("button"),a.type="button",a.className="text-slug lbp-cast-show-all",a.textContent=T("showAllCast");const t=e.querySelector("#cast-overflow");e.insertBefore(a,t||null);}if(Q.has(a))return;const r={ariaExpanded:a.getAttribute("aria-expanded"),hidden:a.hidden,role:a.getAttribute("role"),tabIndex:a.getAttribute("tabindex")};a.setAttribute("aria-expanded","false"),"A"===a.tagName&&(a.setAttribute("role","button"),a.tabIndex=0);const o=t=>{t.preventDefault(),t.stopImmediatePropagation(),te(e,a);},i=t=>{"A"===a.tagName&&["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopImmediatePropagation(),te(e,a));};a.addEventListener("click",o,true),a.addEventListener("keydown",i,true),Q.set(a,{isCreated:n,onClick:o,onKeydown:i,original:r});}function ne(e,t,a){null==a?e.removeAttribute(t):e.setAttribute(t,a);}function re(e,t){e.removeEventListener("click",t.onClick,true),e.removeEventListener("keydown",t.onKeydown,true),t.isCreated?e.remove():(e.classList.remove("lbp-cast-show-all"),e.hidden=t.original.hidden,ne(e,"aria-expanded",t.original.ariaExpanded),ne(e,"role",t.original.role),ne(e,"tabindex",t.original.tabIndex));}function oe(e){null==Z||Z.unobserve(e),Y.delete(e);const t=e.dataset.lbpCastName||e.textContent.trim();e.classList.remove(W,"lbp-cast-card--extra"),delete e.dataset.lbpCastName,delete e.dataset.lbpPortraitState,e.replaceChildren(document.createTextNode(t));}function ie(e){return `${l}${e}`}function ce(){try{return a().filter(e=>e.startsWith(l))}catch(e){return console.warn("[Letterboxd Plus] Failed to list cache entries.",e),[]}}function se(e,t){try{return (new TextEncoder).encode(JSON.stringify({[e]:t})).byteLength}catch(a){return 0}}function le(a,n){if(n<=0)return null;const r=ie(a);try{const a=t(r,null);return a?Date.now()-Number(a.savedAt||0)>n?(e(r),null):a.value||null:null}catch(o){return null}}function ue(e,t){try{r(ie(e),{savedAt:Date.now(),value:t});}catch(a){console.warn("[Letterboxd Plus] Failed to cache external rating.",a);}}function de(e){const a=60*Math.max(0,Number(e)||0)*60*1e3,n=Date.now();let r=0,o=0,i=0,c=0;for(const u of ce())try{const e=t(u,null),s=se(u,e);a<=0||!e||n-Number(e.savedAt||0)>a?(i+=1,c+=s):(r+=1,o+=s);}catch(l){console.warn("[Letterboxd Plus] Failed to inspect cache entry.",{key:u,error:l});}const s=o+c;return {activeCount:r,activeBytes:o,expiredCount:i,expiredBytes:c,totalCount:r+i,usedBytes:s,limitBytes:b,fillPercent:Math.min(100,Math.round(s/b*100))}}function me(e){const t=Math.max(0,Number(e)||0);return t<1024?`${Math.round(t)} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(2)} MB`}function pe(e){return new Promise((t,a)=>{o({method:"GET",url:e,timeout:p,headers:{Accept:"text/html,application/xhtml+xml"},onload:e=>{e.status>=200&&e.status<300?t(e.responseText):a(new Error(`Rotten Tomatoes returned HTTP ${e.status}.`));},onerror:()=>a(new Error("Rotten Tomatoes request failed.")),ontimeout:()=>a(new Error("Rotten Tomatoes request timed out."))});})}function be(e){return String(e||"").normalize("NFKD").replace(/[^\p{L}\p{N}]+/gu," ").trim().toLowerCase()}async function ge({cacheHours:e,key:t,title:a,year:n}){const r=`rt:${t}`,o=le(r,60*e*60*1e3);if(o)return o;const i=encodeURIComponent(`${a} ${n||""}`.trim()),c=function(e,t,a){const n=[...(new DOMParser).parseFromString(e,"text/html").querySelectorAll('search-page-media-row, [tomatometer-score][release-year], [release-year] a[href*="/m/"]')].map(e=>function(e){var t;const a=e.matches("a[href]")?e:e.querySelector("a[href]"),n=e.getAttribute("title")||e.getAttribute("name")||(null==(t=e.querySelector('[data-qa*="title"], [slot="title"]'))?void 0:t.textContent)||(null==a?void 0:a.textContent)||"",r=e.getAttribute("url")||(null==a?void 0:a.getAttribute("href"))||"",o=Number(e.getAttribute("release-year"));return {row:e,title:n.trim(),normalizedTitle:be(n),year:Number.isFinite(o)?o:null,href:r}}(e.closest("[release-year]")||e)),r=be(t),o=n.find(e=>e.year===a&&e.normalizedTitle===r),i=n.find(e=>e.year===a),c=n.find(e=>e.normalizedTitle===r),s=o||i||c||n[0];if(!(null==s?void 0:s.href))return null;const l=new URL(s.href,u);return l.origin===u?l.href:null}(await pe(`${u}/search?search=${i}`),a,n);if(!c)return null;const s=function(e,t){var a;const n=null==(a=(new DOMParser).parseFromString(e,"text/html").querySelector("#media-scorecard-json"))?void 0:a.textContent;if(!n)return null;const r=JSON.parse(n),o=r.criticsScore||{},i=r.audienceScore||{},c=Number(o.score),s=Number(i.score);return {url:t,criticsScore:Number.isFinite(c)?c:null,audienceScore:Number.isFinite(s)?s:null,isCertifiedFresh:true===o.certified,criticsCount:Number(o.reviewCount||o.ratingCount)||0,audienceCount:Number(i.reviewCount||i.ratingCount)||0}}(await pe(c),c);return s&&ue(r,s),s}function he(){var e,t,a;if(!document.body.matches('[data-type="film"][data-tmdb-id]'))return null;const n=(null==(t=null==(e=document.querySelector('meta[name="production:name"]'))?void 0:e.content)?void 0:t.trim())||"",r=((null==(a=document.querySelector('meta[name="production:name-and-year"]'))?void 0:a.content)||"").match(/\((\d{4})\)\s*$/),o=document.body.dataset.tmdbId;return n&&o?{key:`tmdb:${o}`,title:n,year:r?Number(r[1]):null}:null}const ve="lbp-rotten-tomatoes";function fe(e,t,a,n){const r=a?T("critics"===n?"criticReviews":"audienceRatings",{count:_(a)}):T("noCount");return {displayValue:null==t?"—":`${t}%`,label:T(e),detail:null==t?T("notRated"):r,modifier:n,score:t,maxScore:100}}function ye(e){return new Promise((t,a)=>{o({method:"GET",url:e,timeout:p,headers:{Accept:"application/json",Referer:`${d}/`},onload:e=>{if(e.status<200||e.status>=300)a(new Error(`Metacritic returned HTTP ${e.status}.`));else try{t(JSON.parse(e.responseText));}catch(n){a(new Error("Metacritic returned invalid JSON."));}},onerror:()=>a(new Error("Metacritic request failed.")),ontimeout:()=>a(new Error("Metacritic request timed out."))});})}function we(e){return String(e||"").normalize("NFKD").replace(/[^\p{L}\p{N}]+/gu," ").trim().toLowerCase()}function Se(e,t){var a,n;return null==(n=null==(a=null==e?void 0:e.components)?void 0:a.find(e=>{var a;return (null==(a=null==e?void 0:e.meta)?void 0:a.componentName)===t}))?void 0:n.data}function Ce(e){const t=null==e?void 0:e.score,a=null==t||""===t?null:Number(t);return {score:Number.isFinite(a)?a:null,count:Math.max(0,Number(null==e?void 0:e.reviewCount)||0)}}const Le="lbp-metacritic";function xe(e,t){if(null==e)return "";const a=e/t*100;return a>=61?"positive":a>=40?"mixed":"negative"}function Re(e,t){return null==e?"—":10===t?Number(e).toFixed(1):Math.round(e)}function Ae({labelKey:e,score:t,maxScore:a,count:n,countKey:r,modifier:o}){const i=n?T(r,{count:_(n)}):T("noCount");return {displayValue:Re(t,a),label:T(e),detail:null==t?T("notRated"):i,modifier:o,score:t,maxScore:a,tone:xe(t,a)}}async function _e(e){const t=document.getElementById(Le);if(!e.showMetacritic)return void(null==t||t.remove());if(t)return;const a=he(),n=document.querySelector("#film-page-wrapper aside.sidebar");if(!a||!n)return;const r=H({id:Le,title:T("metacritic"),faviconUrl:`${d}/favicon.ico`,skeletonModifiers:e.showMetacriticUserScore?["metascore","user-score"]:["metascore"]});$(r,n);try{const t=await async function({cacheHours:e,key:t,title:a,year:n}){const r=`metacritic:${t}`,o=le(r,60*e*60*1e3);if(o)return o;const i=`${m}/composer/metacritic/pages/search/${encodeURIComponent(a)}/web?mcoTypeId=2`,c=function(e,t,a){var n;const r=null==(n=Se(e,"search"))?void 0:n.items;if(!Array.isArray(r))return null;const o=we(t);return r.filter(e=>2===(null==e?void 0:e.typeId)&&we(e.title)===o&&"string"==typeof e.slug&&/^[a-z0-9][a-z0-9-]*$/.test(e.slug)).map(e=>({...e,yearDifference:Number.isFinite(a)?Math.abs(Number(e.premiereYear)-a):0})).filter(e=>!Number.isFinite(a)||Number.isFinite(Number(e.premiereYear))&&e.yearDifference<=1).sort((e,t)=>e.yearDifference-t.yearDifference)[0]||null}(await ye(i),a,n);if(!c)return null;const s=`${m}/composer/metacritic/pages/movies/${c.slug}/web`,l=function(e,t){var a,n,r;const o=null==(a=Se(e,"product"))?void 0:a.item;if(!o||o.slug!==t.slug)return null;const i=Ce(null==(n=Se(e,"critic-score-summary"))?void 0:n.item),c=Ce(null==(r=Se(e,"user-score-summary"))?void 0:r.item);return {url:`${d}/movie/${t.slug}/`,criticsScore:i.score,criticsCount:i.count,userScore:c.score,userCount:c.count}}(await ye(s),c);return l&&ue(r,l),l}({...a,cacheHours:e.cacheHours});r.isConnected&&function(e,t,a){if(!t)return void P(e,T("metacriticRatingNotFound"));const n=[Ae({labelKey:"metascore",score:t.criticsScore,maxScore:100,count:t.criticsCount,countKey:"criticReviews",modifier:"metascore"})];a&&n.push(Ae({labelKey:"metacriticUserScore",score:t.userScore,maxScore:10,count:t.userCount,countKey:"userRatings",modifier:"user-score"})),F(e,t.url,n);}(r,t,e.showMetacriticUserScore);}catch(o){console.warn("[Letterboxd Plus] Failed to load Metacritic rating.",o),r.isConnected&&P(r,T("metacriticRatingUnavailable"));}}function Te(e){const t=e&&"object"==typeof e?e:{},a=Number(t.cacheHours);return {uiLocale:"auto"===t.uiLocale||y.includes(t.uiLocale)?t.uiLocale:f.uiLocale,showRottenTomatoes:false!==t.showRottenTomatoes,showAudienceScore:false!==t.showAudienceScore,showMetacritic:false!==t.showMetacritic,showMetacriticUserScore:false!==t.showMetacriticUserScore,enhanceCast:false!==t.enhanceCast,cacheHours:Number.isFinite(a)?Math.max(0,Math.min(168,a)):f.cacheHours}}function Me(){try{return Te(t(s,f))}catch(e){return console.warn("[Letterboxd Plus] Failed to load settings.",e),{...f}}}const Ee="lbp-nav-settings",He=["general","film","cache","about"];function $e(e,t,a,n){return `\n
\n \n ${a}\n ${n}\n \n \n
\n `}function Ne(e){const t=Math.min(100,e.activeBytes/e.limitBytes*100),a=Math.min(100,e.expiredBytes/e.limitBytes*100);return `\n
\n
\n ${T("cacheFilled",{percent:e.fillPercent})}\n ${T("cacheUsed",{used:me(e.usedBytes),limit:me(e.limitBytes)})}\n
\n \n
\n ${T("cacheActive",{count:e.activeCount})} · ${me(e.activeBytes)}\n ${T("cacheExpired",{count:e.expiredCount})} · ${me(e.expiredBytes)}\n
\n

${T("cacheSoftLimitHint")}

\n
\n `}function Fe(e,t){const a=de(t),n=e.querySelector("[data-cache-meter]");if(n){const e=document.createElement("div");e.innerHTML=Ne(a).trim(),n.replaceWith(e.firstElementChild);}const r=e.querySelector("[data-cache-tab-badge]");r&&(r.textContent=`${a.fillPercent}%`);}function Pe(e,t,a=false){He.includes(t)&&(e.querySelectorAll("[data-tab]").forEach(e=>{const n=e.dataset.tab===t;e.classList.toggle("is-active",n),e.setAttribute("aria-selected",String(n)),e.tabIndex=n?0:-1,n&&a&&e.focus();}),e.querySelectorAll('[role="tabpanel"]').forEach(e=>{e.hidden=e.dataset.panel!==t;}));}function ke(){if(document.querySelector(".lbp-settings-backdrop"))return;const t=Me(),a=y.map(e=>``).join(""),n=de(t.cacheHours),o=document.activeElement,c=document.createElement("div");c.className="lbp-settings-backdrop",c.innerHTML=`\n \n `;const l=()=>{var e;document.removeEventListener("keydown",d,true),c.remove(),document.documentElement.classList.remove("lbp-modal-open"),null==(e=null==o?void 0:o.focus)||e.call(o);},u=c.querySelector(".lbp-settings"),d=e=>{"Escape"===e.key&&l();};c.addEventListener("click",e=>{(e.target===c||e.target.closest("[data-close]"))&&l();}),u.querySelector(".lbp-settings__tabs").addEventListener("click",e=>{const t=e.target.closest("[data-tab]");t&&Pe(u,t.dataset.tab);}),u.querySelector(".lbp-settings__tabs").addEventListener("keydown",e=>{const t=[...u.querySelectorAll("[data-tab]")],a=t.indexOf(e.target.closest("[data-tab]"));if(a<0)return;const n="ArrowRight"===e.key?1:"ArrowLeft"===e.key?-1:0;n&&(e.preventDefault(),Pe(u,t[(a+n+t.length)%t.length].dataset.tab,true));}),u.querySelectorAll("[data-setting]").forEach(e=>{e.addEventListener("click",()=>{const a=e.dataset.setting;t[a]=!t[a],e.classList.toggle("is-on",t[a]),e.setAttribute("aria-checked",String(t[a]));});}),u.querySelector("#lbp-cache-hours").addEventListener("input",e=>{Fe(u,Number(e.target.value));}),u.querySelector("[data-clear-cache]").addEventListener("click",()=>{const t=function(){const t=ce();for(const n of t)try{e(n);}catch(a){console.warn("[Letterboxd Plus] Failed to delete cache entry.",{key:n,error:a});}return t.length}();Fe(u,Number(u.querySelector("#lbp-cache-hours").value)),u.querySelector("[data-cache-status]").textContent=t?T("cacheCleared",{count:t}):T("cacheAlreadyEmpty");}),u.querySelector("[data-save]").addEventListener("click",()=>{t.uiLocale=u.querySelector("#lbp-ui-locale").value,t.cacheHours=Number(u.querySelector("#lbp-cache-hours").value),function(e){const t=Te(e);r(s,t);}(t),location.reload();}),document.documentElement.classList.add("lbp-modal-open"),document.body.appendChild(c),document.addEventListener("keydown",d,true),requestAnimationFrame(()=>{var e;c.classList.add("is-open"),null==(e=u.querySelector("[data-tab]"))||e.focus();});}let qe=0;function Ue(){const e=Me();A(e.uiLocale),function(){var e;if(document.getElementById(Ee))return;const t=document.querySelector(".main-nav .nav-account > .subnav");if(!t)return;const a=document.createElement("li");a.id=Ee,a.className="lbp-nav-settings",a.innerHTML=`Letterboxd Plus`,a.querySelector("a").addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),ke();});const n=[...t.querySelectorAll(":scope > li > a")].find(e=>"/settings/"===e.getAttribute("href"));null==(e=null==n?void 0:n.parentElement)||e.insertAdjacentElement("afterend",a),a.isConnected||t.appendChild(a);}(),function(e){if(function(){for(const e of Y)e.isConnected||(null==Z||Z.unobserve(e),Y.delete(e));for(const[e,t]of Q)e.isConnected||(e.removeEventListener("click",t.onClick,true),e.removeEventListener("keydown",t.onKeydown,true),Q.delete(e));}(),e.enhanceCast)for(const t of document.querySelectorAll(".cast-list.text-sluglist")){t.classList.add(J);for(const e of t.querySelectorAll("a.text-slug[href]"))ee(e);ae(t,[...t.querySelectorAll(`.${W}`)]);}else !function(){for(const e of document.querySelectorAll(`.${W}`))oe(e);for(const e of document.querySelectorAll(`.${J}`))e.classList.remove(J,"lbp-cast-list--expanded");for(const[e,t]of Q)re(e,t);Q.clear();}();}(e),async function(e){const t=document.getElementById(ve);if(!e.showRottenTomatoes)return void(null==t||t.remove());if(t)return;const a=he(),n=document.querySelector("#film-page-wrapper aside.sidebar");if(!a||!n)return;const r=(o=e.showAudienceScore,H({id:ve,title:T("rottenTomatoes"),faviconUrl:`${u}/assets/pizza-pie/images/favicon.ico`,skeletonModifiers:o?["critics","audience"]:["critics"]}));var o;$(r,n);try{const t=await ge({...a,cacheHours:e.cacheHours});r.isConnected&&function(e,t,a){if(!t)return void P(e,T("ratingNotFound"));const n=[fe(t.isCertifiedFresh?"certifiedFresh":"tomatometer",t.criticsScore,t.criticsCount,"critics")];a&&n.push(fe("popcornmeter",t.audienceScore,t.audienceCount,"audience")),F(e,t.url,n);}(r,t,e.showAudienceScore);}catch(i){console.warn("[Letterboxd Plus] Failed to load Rotten Tomatoes rating.",i),r.isConnected&&P(r,T("ratingUnavailable"));}}(e),_e(e),function(){const e=document.querySelector("#film-page-wrapper aside.sidebar"),t=null==e?void 0:e.querySelector(".ratings-histogram-chart"),a=document.getElementById(q);e&&t?(a||$(H({id:q,title:T("averageRating"),skeletonModifiers:["average"],variant:"average"}),e),U||(document.addEventListener(M,z),U=true),z()):null==a||a.remove();}();}function ze(){window.clearTimeout(qe),qe=window.setTimeout(Ue,180);}function De(){document.documentElement.hasAttribute(c)||(document.documentElement.setAttribute(c,"1"),A(Me().uiLocale),"function"==typeof n&&n(T("menuSettings"),ke),Ue(),new MutationObserver(ze).observe(document.body,{childList:true,subtree:true}));}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",De,{once:true}):De(); })();