diff --git a/userScript/en.user.js b/userScript/en.user.js index 77eafdfd..3a262188 100644 --- a/userScript/en.user.js +++ b/userScript/en.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Shadowban Scanner (English) // @namespace https://github.com/Robot-Inventor/shadowban-scanner/ -// @version 3.1.6 +// @version 3.1.7 // @description A browser extension that detects shadowbans on Twitter. // @author Robot-Inventor (ろぼいん / @keita_roboin) // @match https://*.twitter.com/* @@ -128,14 +128,17 @@ opacity: 1; } } - `,n([(0,i.property)({reflect:!0})],l.prototype,"summary",void 0),n([(0,i.property)({reflect:!0,type:Array})],l.prototype,"details",void 0),n([(0,i.property)({reflect:!0,type:Array})],l.prototype,"notes",void 0),n([(0,i.property)({reflect:!0,type:Boolean})],l.prototype,"isAlert",void 0),n([(0,i.property)({reflect:!0,type:Boolean})],l.prototype,"isExpanded",void 0),n([(0,i.property)({reflect:!0,type:Boolean})],l.prototype,"isFocalMode",void 0),n([(0,i.property)({reflect:!0,type:Boolean})],l.prototype,"isTweetButtonShown",void 0),n([(0,i.property)({reflect:!0,type:Boolean})],l.prototype,"isNoteShown",void 0),n([(0,i.property)({attribute:!1,reflect:!0})],l.prototype,"onRenderedCallback",void 0),n([(0,i.property)({reflect:!0,type:String})],l.prototype,"textColor",void 0),t.SbsMessage=l=s=n([(0,i.customElement)("sbs-message")],l)},6911:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Core=void 0;const s=r(41),n=r(4114),o=r(1520),i=r(902),a=r(3114),l=r(8700),c=r(2634);t.Core=class{constructor(e,t){this.settings=e,this.onMessageCallback=t;const r=new n.Timeline;r.onNewTweet((e=>{this.checkTweet(e),this.timelineObserverCallback()})),r.onNewProfile((e=>{this.checkProfile(e)}))}checkProfile(e){if(Boolean(document.querySelector("[data-testid='editProfileButton']"))&&!this.settings.enableForOtherUsersProfiles)return;const t=i.PropsAnalyzer.analyzeProfileProps(e.props);if(!t.user.hasAnyProblem&&!this.settings.showMessagesInUnproblematicProfiles)return;const r=o.MessageDataGenerator.generateForProfile(t,this.onMessageCallback),s=new a.SbsMessageWrapper(r),n=document.querySelector("[data-testid='UserDescription']")||document.querySelector("[data-testid='UserName']");if(!n)throw new Error("Failed to get user description of profile");s.insertAdjacentElement(n,"afterend")}checkTweet(e){const t=i.PropsAnalyzer.analyzeTweetProps(new c.TweetParser(e));if(!e.metadata.isPostedByCurrentUser&&!this.settings.enableForOtherUsersTweets)return;if(!t.tweet.hasAnyProblem&&!this.settings.showMessagesInUnproblematicTweets)return;const r=o.MessageDataGenerator.generateForTweet(e,t,this.onMessageCallback,this.settings),s=new a.SbsMessageWrapper(r),n=e.element.querySelector("[data-testid='analyticsButton']")?.parentElement||e.element.querySelector("div[role='group'][id]");if(!n)throw new Error("Failed to get landmark element of tweet");s.insertAdjacentElement(n,"beforebegin")}necromancer(e){e.setAttribute(s.CHECKED_DATA_ATTRIBUTE,"true");const t=i.PropsAnalyzer.analyzeTombstoneProps(new l.TombstoneParser(e).parse());if(!t)return;const r=`https://twitter.com/i/status/${t}`,n=document.createElement("a");n.href=r,n.target="_blank",n.setAttribute(s.TRANSLATION_ATTRIBUTE,"viewTweet"),n.classList.add("shadowban-scanner-tombstone-necromancer");const o=e.querySelector("a");if(!o)throw new Error("Failed to get help link");n.style.color=getComputedStyle(o).color,o.insertAdjacentElement("afterend",n),this.onMessageCallback()}timelineObserverCallback(){const e=document.querySelectorAll(`[data-testid='cellInnerDiv']:not([${s.CHECKED_DATA_ATTRIBUTE}])`);for(const t of e)t.setAttribute(s.CHECKED_DATA_ATTRIBUTE,"true"),Boolean(t.querySelector("a[href='https://help.twitter.com/rules-and-policies/notices-on-twitter']"))&&this.necromancer(t)}}},1520:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDataGenerator=void 0;const s=r(8197),n=r(6219);t.MessageDataGenerator=class{static generateForProfile(e,t){return{...n.TranslationKeyProvider.fromProfileAnalyzer(e),isAlert:e.user.hasAnyProblem,onRenderedCallback:t,type:"profile"}}static generateForTweet(e,t,r,o){const i=n.TranslationKeyProvider.fromTweetAnalyzer(t),a=s.ShareTextGenerator.generateShareText(t);return{...i,isAlert:t.tweet.hasAnyProblem,isExpanded:o.alwaysDetailedView,isNoteShown:o.showNotesInMessages,isTweetButtonShown:o.showTweetButton,notes:["falsePositivesAndFalseNegativesOccur","translatedByAI"],onRenderedCallback:r,tweet:e,tweetText:a,type:"tweet"}}}},8700:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TombstoneParser=void 0;const s=r(2632),n=r(543);t.TombstoneParser=class{constructor(e){this.element=e}parse(){const e=(0,n.getReactProps)(this.element);if(!(0,s.isCellInnerDivProps)(e))throw new Error("Type of props is invalid.");const t=this.element.querySelector("div > div");if(!t)throw new Error("Failed to get the tombstone's grandchild element.");const r=(0,n.getReactProps)(t);if(!(0,s.isTombstoneGrandchildProps)(r))throw new Error("Type of grandchild props is invalid.");return[e,r]}}},2634:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TweetParser=void 0,t.TweetParser=class{constructor(e){this.tweet=e}parse(){return this.tweet.props}}},543:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getReactProps=void 0,t.getReactProps=e=>e[Object.getOwnPropertyNames(e).filter((e=>e.startsWith("__reactProps$")))]},902:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropsAnalyzer=void 0;class r{static analyzeProfileProps(e){const t=Boolean(e.possibly_sensitive),r=Boolean(["sensitive_media","offensive_profile_content"].includes(e.profile_interstitial_type)),s=e.withheld_in_countries,n=t||r;return{user:{hasAnyProblem:n||s.length>0,sensitiveMediaInProfile:r,shadowbanned:n,withheldInCountries:s}}}static analyzeTweetProps(e){const t=e.parse(),s=r.analyzeProfileProps(t.user),n=Boolean(t.possibly_sensitive),o=!(!1===t.possibly_sensitive_editable),i=n&&!o;let a="searchable";return i||s.user.shadowbanned?a="unsearchable":n&&(a="possiblyUnsearchable"),{...s,tweet:{ageRestriction:i,hasAnyProblem:"searchable"!==a||s.user.hasAnyProblem,possiblySensitive:n,searchability:a}}}static analyzeTombstoneProps(e){const[t,r]=e;if(!t.children._owner)return;if(r.children[0].props.entry.conversationPosition.showReplyContext)return;const{key:s}=t.children._owner;return s.split("-")[3]}}t.PropsAnalyzer=r},3114:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SbsMessageWrapper=void 0,r(380);const s=r(41);class n{constructor(e){this.tweet=null;const t=document.createElement("sbs-message");if(t.textColor=n.getTextColor(),t.summary=e.summary,t.isAlert=e.isAlert,t.onRenderedCallback=e.onRenderedCallback,"tweet"===e.type){if(!e.tweet)throw new Error("Tweet data is missing");this.tweet=e.tweet,t.details=e.details,t.notes=e.notes,t.isFocalMode=e.tweet.metadata.isFocalMode,t.isExpanded=e.isExpanded,t.isTweetButtonShown=e.isTweetButtonShown,t.isNoteShown=e.isNoteShown,this.tweetText=e.tweetText}else t.isExpanded=!0;t.setAttribute(s.SHADOW_TRANSLATION_ATTRIBUTE,""),t.addEventListener("tweetButtonClick",this.onTweetButtonClick.bind(this)),this.sbsMessage=t}static getTextColor(){const e=["[data-testid='User-Name'] div:first-child span","[data-testid='UserName'] div:first-child span"].join(","),t=document.querySelector(e);if(!t)throw new Error("Failed to get user name span of tweet");const{color:r}=getComputedStyle(t);return r}onTweetButtonClick(){if(!this.tweet||!this.tweetText)throw new Error("Tweet button clicked without source tweet");this.tweet.quoteTweet(this.tweetText)}insertAdjacentElement(e,t){e.insertAdjacentElement(t,this.sbsMessage)}}t.SbsMessageWrapper=n},8197:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ShareTextGenerator=void 0,t.ShareTextGenerator=class{static generateShareText(e){const t="searchable"===e.tweet.searchability;return`\n${e.user.shadowbanned?"🚫Account flagged as sensitive or shadowbanned":"✅Account not flagged as sensitive"}\n${e.user.sensitiveMediaInProfile?"🚫Sensitive flag on profile media":"✅No sensitive flag on profile media"}\n${e.user.withheldInCountries.length?"🚫Account blocked in some countries":"✅Account not blocked in any countries"}\n${e.tweet.possiblySensitive?"🚫Sensitive flag on tweet":"✅No sensitive flag on tweet"}\n${e.tweet.ageRestriction?"🚫Age limit on tweet":"✅No age limit on tweet"}\n${t?"✅Tweet searchable":"🚫Tweet may not be searchable"}\n\nShadowban Scanner by ろぼいん\n${navigator.language.toLowerCase().startsWith("ja")?"https://shadowban-scanner.roboin.io/":"https://shadowban-scanner.roboin.io/en/"}\n `.trim()}}},6219:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationKeyProvider=void 0;class r{static fromProfileAnalyzer(e){let t=null;return t=e.user.shadowbanned?"thisUserIsShadowbanned":e.user.withheldInCountries.length?"accountIsBlockedInSomeCountries":"thisUserIsNotShadowbanned",{summary:t}}static summarizeForTweet(e){return e.user.shadowbanned||e.user.sensitiveMediaInProfile||Boolean(e.user.withheldInCountries.length)||e.tweet.possiblySensitive?e.user.withheldInCountries.length?"accountIsBlockedInSomeCountries":e.user.shadowbanned||e.user.sensitiveMediaInProfile?e.tweet.possiblySensitive?e.tweet.ageRestriction?"accountAndTweetShadowbanned":"accountShadowbannedAndTweetFlaggedAsSensitive":"accountShadowbanned":e.tweet.ageRestriction?"tweetShadowbanned":"tweetFlaggedAsSensitive":"tweetNoProblem"}static formatCountryList(e){const t=navigator.language,r=new Intl.ListFormat(t,{style:"narrow",type:"conjunction"}),s=new Intl.DisplayNames([t],{type:"region"}),n=e.map((e=>s.of(e)||""));return r.format(n)}static getAccountDetails(e){return[e.user.shadowbanned?"accountIsShadowbannedOrFlaggedAsSensitive":"accountIsNotFlaggedAsSensitive",e.user.sensitiveMediaInProfile?"profileContainsSensitiveMedia":"profileDoesNotContainSensitiveMedia",e.user.withheldInCountries.length?{messageName:"accountIsWithheldInCountries",substitutions:r.formatCountryList(e.user.withheldInCountries)}:"accountIsNotWithheldInCountries"]}static getTweetDetails(e){return[e.tweet.possiblySensitive?"tweetIsFlaggedAsSensitive":"tweetIsNotFlaggedAsSensitive",e.tweet.ageRestriction?"tweetIsAgeRestricted":"tweetIsNotAgeRestricted",{possiblyUnsearchable:"tweetMayNotBeSearchable",searchable:"tweetIsSearchable",unsearchable:"tweetIsNotSearchable"}[e.tweet.searchability]]}static fromTweetAnalyzer(e){const t=r.summarizeForTweet(e);return{details:[...r.getAccountDetails(e),...r.getTweetDetails(e)],summary:t}}}t.TranslationKeyProvider=r},2785:function(e,t,r){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(5540),o=s(r(5094));new n.UserScriptBase(o.default)},5540:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UserScriptBase=void 0,r(5535);const s=r(6911),n=r(8140),o=r(7316);t.UserScriptBase=class{constructor(e){const t=new o.Translator(((t,r)=>{if(r){const s="string"==typeof r?[r]:r;let n=e[t].message;for(let e=0;e{t.translateElements()}))}}},1497:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isTranslationSubstitutions=void 0,t.isTranslationSubstitutions=function(e){const t=e;return void 0===t||"string"==typeof t||Array.isArray(t)&&t.every((e=>"string"==typeof e))}},2632:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isTombstoneGrandchildProps=t.isCellInnerDivProps=void 0,t.isCellInnerDivProps=function(e){const t=e;return(null!==t&&"object"==typeof t||"function"==typeof t)&&(null!==t.children&&"object"==typeof t.children||"function"==typeof t.children)&&(void 0===t.children._owner||(null!==t.children._owner&&"object"==typeof t.children._owner||"function"==typeof t.children._owner)&&"string"==typeof t.children._owner.key)},t.isTombstoneGrandchildProps=function(e){const t=e;return(null!==t&&"object"==typeof t||"function"==typeof t)&&Array.isArray(t.children)&&(null!==t.children[0]&&"object"==typeof t.children[0]||"function"==typeof t.children[0])&&(null!==t.children[0].props&&"object"==typeof t.children[0].props||"function"==typeof t.children[0].props)&&(null!==t.children[0].props.entry&&"object"==typeof t.children[0].props.entry||"function"==typeof t.children[0].props.entry)&&"tombstone"===t.children[0].props.entry.type&&(null!==t.children[0].props.entry.conversationPosition&&"object"==typeof t.children[0].props.entry.conversationPosition||"function"==typeof t.children[0].props.entry.conversationPosition)&&"boolean"==typeof t.children[0].props.entry.conversationPosition.showReplyContext}},842:(e,t,r)=>{r.d(t,{BO:()=>a,mN:()=>C,Rf:()=>d,AH:()=>c,W3:()=>T,sk:()=>h,Ec:()=>S,qM:()=>n,iz:()=>l});const s=globalThis,n=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),i=new WeakMap;class a{constructor(e,t,r){if(this._$cssResult$=!0,r!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(n&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=i.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&i.set(t,e))}return e}toString(){return this.cssText}}const l=e=>new a("string"==typeof e?e:e+"",void 0,o),c=(e,...t)=>{const r=1===e.length?e[0]:t.reduce(((t,r,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[s+1]),e[0]);return new a(r,e,o)},d=(e,t)=>{if(n)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const r of t){const t=document.createElement("style"),n=s.litNonce;void 0!==n&&t.setAttribute("nonce",n),t.textContent=r.cssText,e.appendChild(t)}},h=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return l(t)})(e):e,{is:p,defineProperty:u,getOwnPropertyDescriptor:m,getOwnPropertyNames:f,getOwnPropertySymbols:b,getPrototypeOf:y}=Object,g=globalThis,v=g.trustedTypes,w=v?v.emptyScript:"",_=g.reactiveElementPolyfillSupport,A=(e,t)=>e,T={toAttribute(e,t){switch(t){case Boolean:e=e?w:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},S=(e,t)=>!p(e,t),E={attribute:!0,type:String,converter:T,reflect:!1,hasChanged:S};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;class C extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=E){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(e,r,t);void 0!==s&&u(this.prototype,e,s)}}static getPropertyDescriptor(e,t,r){const{get:s,set:n}=m(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return s?.call(this)},set(t){const o=s?.call(this);n.call(this,t),this.requestUpdate(e,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??E}static _$Ei(){if(this.hasOwnProperty(A("elementProperties")))return;const e=y(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(A("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(A("properties"))){const e=this.properties,t=[...f(e),...b(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(h(e))}else void 0!==e&&t.push(h(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return d(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){const r=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,r);if(void 0!==s&&!0===r.reflect){const n=(void 0!==r.converter?.toAttribute?r.converter:T).toAttribute(t,r.type);this._$Em=e,null==n?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){const r=this.constructor,s=r._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=r.getPropertyOptions(s),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:T;this._$Em=s,this[s]=n.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){if(r??=this.constructor.getPropertyOptions(e),!(r.hasChanged??S)(this[e],t))return;this.P(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),!0===r.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e)!0!==r.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[A("elementProperties")]=new Map,C[A("finalized")]=new Map,_?.({ReactiveElement:C}),(g.reactiveElementVersions??=[]).push("2.0.4")},919:(e,t,r)=>{function s(e,t,r,s){var n,o=arguments.length,i=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,r,i):n(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}r.r(t),r.d(t,{MdFilledButton:()=>L}),Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var n=r(2924),o=r(6337);class i extends o.LitElement{connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){return o.html``}}const a=o.css`:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}:host{display:flex;pointer-events:none;transition-property:box-shadow,opacity}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15} + `,n([(0,i.property)({reflect:!0})],l.prototype,"summary",void 0),n([(0,i.property)({reflect:!0,type:Array})],l.prototype,"details",void 0),n([(0,i.property)({reflect:!0,type:Array})],l.prototype,"notes",void 0),n([(0,i.property)({reflect:!0,type:Boolean})],l.prototype,"isAlert",void 0),n([(0,i.property)({reflect:!0,type:Boolean})],l.prototype,"isExpanded",void 0),n([(0,i.property)({reflect:!0,type:Boolean})],l.prototype,"isFocalMode",void 0),n([(0,i.property)({reflect:!0,type:Boolean})],l.prototype,"isTweetButtonShown",void 0),n([(0,i.property)({reflect:!0,type:Boolean})],l.prototype,"isNoteShown",void 0),n([(0,i.property)({attribute:!1,reflect:!0})],l.prototype,"onRenderedCallback",void 0),n([(0,i.property)({reflect:!0,type:String})],l.prototype,"textColor",void 0),t.SbsMessage=l=s=n([(0,i.customElement)("sbs-message")],l)},6911:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Core=void 0;const s=r(41),n=r(4114),o=r(1520),i=r(902),a=r(3114),l=r(8700),c=r(2634);t.Core=class{constructor(e,t){this.settings=e,this.onMessageCallback=t;const r=new n.Timeline;r.onNewTweet((e=>{this.checkTweet(e),this.timelineObserverCallback()})),r.onNewProfile((e=>{this.checkProfile(e)}))}checkProfile(e){if(Boolean(document.querySelector("[data-testid='editProfileButton']"))&&!this.settings.enableForOtherUsersProfiles)return;const t=i.PropsAnalyzer.analyzeProfileProps(e.props);if(!t.user.hasAnyProblem&&!this.settings.showMessagesInUnproblematicProfiles)return;const r=o.MessageDataGenerator.generateForProfile(t,this.onMessageCallback),s=new a.SbsMessageWrapper(r),n=document.querySelector("[data-testid='UserDescription']")||document.querySelector("[data-testid='UserName']");if(!n)throw new Error("Failed to get user description of profile");s.insertAdjacentElement(n,"afterend")}checkTweet(e){const t=i.PropsAnalyzer.analyzeTweetProps(new c.TweetParser(e));if(!e.metadata.isPostedByCurrentUser&&!this.settings.enableForOtherUsersTweets)return;if(!t.tweet.hasAnyProblem&&!this.settings.showMessagesInUnproblematicTweets)return;const r=o.MessageDataGenerator.generateForTweet(e,t,this.onMessageCallback,this.settings),s=new a.SbsMessageWrapper(r),n=e.element.querySelector("[data-testid='analyticsButton']")?.parentElement||e.element.querySelector("div[role='group'][id]");if(!n)throw new Error("Failed to get landmark element of tweet");s.insertAdjacentElement(n,"beforebegin")}necromancer(e){e.setAttribute(s.CHECKED_DATA_ATTRIBUTE,"true");const t=i.PropsAnalyzer.analyzeTombstoneProps(new l.TombstoneParser(e).parse());if(!t)return;const r=`https://twitter.com/i/status/${t}`,n=document.createElement("a");n.href=r,n.target="_blank",n.setAttribute(s.TRANSLATION_ATTRIBUTE,"viewTweet"),n.classList.add("shadowban-scanner-tombstone-necromancer");const o=e.querySelector("a");if(!o)throw new Error("Failed to get help link");n.style.color=getComputedStyle(o).color,o.insertAdjacentElement("afterend",n),this.onMessageCallback()}timelineObserverCallback(){const e=document.querySelectorAll(`[data-testid='cellInnerDiv']:not([${s.CHECKED_DATA_ATTRIBUTE}])`);for(const t of e)t.setAttribute(s.CHECKED_DATA_ATTRIBUTE,"true"),Boolean(t.querySelector("a[href='https://help.twitter.com/rules-and-policies/notices-on-twitter']"))&&this.necromancer(t)}}},1520:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDataGenerator=void 0;const s=r(8197),n=r(6219);t.MessageDataGenerator=class{static generateForProfile(e,t){return{...n.TranslationKeyProvider.fromProfileAnalyzer(e),isAlert:e.user.hasAnyProblem,onRenderedCallback:t,type:"profile"}}static generateForTweet(e,t,r,o){const i=n.TranslationKeyProvider.fromTweetAnalyzer(t),a=s.ShareTextGenerator.generateShareText(t);return{...i,isAlert:t.tweet.hasAnyProblem,isExpanded:o.alwaysDetailedView,isNoteShown:o.showNotesInMessages,isTweetButtonShown:o.showTweetButton,notes:["falsePositivesAndFalseNegativesOccur","translatedByAI"],onRenderedCallback:r,tweet:e,tweetText:a,type:"tweet"}}}},8700:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TombstoneParser=void 0;const s=r(2632),n=r(543);t.TombstoneParser=class{constructor(e){this.element=e}parse(){const e=(0,n.getReactProps)(this.element);if(!(0,s.isCellInnerDivProps)(e))throw new Error("Type of props is invalid.");const t=this.element.querySelector("div > div");if(!t)throw new Error("Failed to get the tombstone's grandchild element.");const r=(0,n.getReactProps)(t);if(!(0,s.isTombstoneGrandchildProps)(r))throw new Error("Type of grandchild props is invalid.");return[e,r]}}},2634:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TweetParser=void 0,t.TweetParser=class{constructor(e){this.tweet=e}parse(){return this.tweet.props}}},543:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getReactProps=void 0,t.getReactProps=e=>e[Object.getOwnPropertyNames(e).filter((e=>e.startsWith("__reactProps$")))]},902:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PropsAnalyzer=void 0;class r{static analyzeProfileProps(e){const t=Boolean(e.possibly_sensitive),r=Boolean(["sensitive_media","offensive_profile_content"].includes(e.profile_interstitial_type)),s=e.withheld_in_countries,n=t||r;return{user:{hasAnyProblem:n||s.length>0,sensitiveMediaInProfile:r,shadowbanned:n,withheldInCountries:s}}}static analyzeTweetProps(e){const t=e.parse(),s=r.analyzeProfileProps(t.user),n=Boolean(t.possibly_sensitive),o=!(!1===t.possibly_sensitive_editable),i=n&&!o;let a="searchable";return i||s.user.shadowbanned?a="unsearchable":n&&(a="possiblyUnsearchable"),{...s,tweet:{ageRestriction:i,hasAnyProblem:"searchable"!==a||s.user.hasAnyProblem,possiblySensitive:n,searchability:a}}}static analyzeTombstoneProps(e){const[t,r]=e;if(!t.children._owner)return;if(r.children[0].props.entry.conversationPosition.showReplyContext)return;const{key:s}=t.children._owner;return s.split("-")[3]}}t.PropsAnalyzer=r},3114:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SbsMessageWrapper=void 0,r(380);const s=r(41);class n{constructor(e){this.tweet=null;const t=document.createElement("sbs-message");if(t.textColor=n.getTextColor(),t.summary=e.summary,t.isAlert=e.isAlert,t.onRenderedCallback=e.onRenderedCallback,"tweet"===e.type){if(!e.tweet)throw new Error("Tweet data is missing");this.tweet=e.tweet,t.details=e.details,t.notes=e.notes,t.isFocalMode=e.tweet.metadata.isFocalMode,t.isExpanded=e.isExpanded,t.isTweetButtonShown=e.isTweetButtonShown,t.isNoteShown=e.isNoteShown,this.tweetText=e.tweetText}else t.isExpanded=!0;t.setAttribute(s.SHADOW_TRANSLATION_ATTRIBUTE,""),t.addEventListener("tweetButtonClick",this.onTweetButtonClick.bind(this)),this.sbsMessage=t}static getTextColor(){const e=["[data-testid='User-Name'] div:first-child span","[data-testid='UserName'] div:first-child span"].join(","),t=document.querySelector(e);if(!t)throw new Error("Failed to get user name span of tweet");const{color:r}=getComputedStyle(t);return r}onTweetButtonClick(){if(!this.tweet||!this.tweetText)throw new Error("Tweet button clicked without source tweet");this.tweet.quoteTweet(this.tweetText)}insertAdjacentElement(e,t){e.insertAdjacentElement(t,this.sbsMessage)}}t.SbsMessageWrapper=n},8197:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ShareTextGenerator=void 0,t.ShareTextGenerator=class{static generateShareText(e){const t="searchable"===e.tweet.searchability;return`\n${e.user.shadowbanned?"🚫Account flagged as sensitive or shadowbanned":"✅Account not flagged as sensitive"}\n${e.user.sensitiveMediaInProfile?"🚫Sensitive flag on profile media":"✅No sensitive flag on profile media"}\n${e.user.withheldInCountries.length?"🚫Account blocked in some countries":"✅Account not blocked in any countries"}\n${e.tweet.possiblySensitive?"🚫Sensitive flag on tweet":"✅No sensitive flag on tweet"}\n${e.tweet.ageRestriction?"🚫Age limit on tweet":"✅No age limit on tweet"}\n${t?"✅Tweet searchable":"🚫Tweet may not be searchable"}\n\nShadowban Scanner by ろぼいん\n${navigator.language.toLowerCase().startsWith("ja")?"https://shadowban-scanner.roboin.io/ja/":"https://shadowban-scanner.roboin.io/en/"}\n `.trim()}}},6219:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TranslationKeyProvider=void 0;class r{static fromProfileAnalyzer(e){let t=null;return t=e.user.shadowbanned?"thisUserIsShadowbanned":e.user.withheldInCountries.length?"accountIsBlockedInSomeCountries":"thisUserIsNotShadowbanned",{summary:t}}static summarizeForTweet(e){return e.user.shadowbanned||e.user.sensitiveMediaInProfile||Boolean(e.user.withheldInCountries.length)||e.tweet.possiblySensitive?e.user.withheldInCountries.length?"accountIsBlockedInSomeCountries":e.user.shadowbanned||e.user.sensitiveMediaInProfile?e.tweet.possiblySensitive?e.tweet.ageRestriction?"accountAndTweetShadowbanned":"accountShadowbannedAndTweetFlaggedAsSensitive":"accountShadowbanned":e.tweet.ageRestriction?"tweetShadowbanned":"tweetFlaggedAsSensitive":"tweetNoProblem"}static formatCountryList(e){const t=navigator.language,r=new Intl.ListFormat(t,{style:"narrow",type:"conjunction"}),s=new Intl.DisplayNames([t],{type:"region"}),n=e.map((e=>s.of(e)||""));return r.format(n)}static getAccountDetails(e){return[e.user.shadowbanned?"accountIsShadowbannedOrFlaggedAsSensitive":"accountIsNotFlaggedAsSensitive",e.user.sensitiveMediaInProfile?"profileContainsSensitiveMedia":"profileDoesNotContainSensitiveMedia",e.user.withheldInCountries.length?{messageName:"accountIsWithheldInCountries",substitutions:r.formatCountryList(e.user.withheldInCountries)}:"accountIsNotWithheldInCountries"]}static getTweetDetails(e){return[e.tweet.possiblySensitive?"tweetIsFlaggedAsSensitive":"tweetIsNotFlaggedAsSensitive",e.tweet.ageRestriction?"tweetIsAgeRestricted":"tweetIsNotAgeRestricted",{possiblyUnsearchable:"tweetMayNotBeSearchable",searchable:"tweetIsSearchable",unsearchable:"tweetIsNotSearchable"}[e.tweet.searchability]]}static fromTweetAnalyzer(e){const t=r.summarizeForTweet(e);return{details:[...r.getAccountDetails(e),...r.getTweetDetails(e)],summary:t}}}t.TranslationKeyProvider=r},2785:function(e,t,r){var s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const n=r(5540),o=s(r(5094));new n.UserScriptBase(o.default)},5540:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UserScriptBase=void 0,r(5535);const s=r(6911),n=r(8140),o=r(7316);t.UserScriptBase=class{constructor(e){const t=new o.Translator(((t,r)=>{if(r){const s="string"==typeof r?[r]:r;let n=e[t].message;for(let e=0;e{t.translateElements()}))}}},1497:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isTranslationSubstitutions=function(e){const t=e;return void 0===t||"string"==typeof t||Array.isArray(t)&&t.every((e=>"string"==typeof e))}},2632:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isCellInnerDivProps=function(e){const t=e;return(null!==t&&"object"==typeof t||"function"==typeof t)&&(null!==t.children&&"object"==typeof t.children||"function"==typeof t.children)&&(void 0===t.children._owner||(null!==t.children._owner&&"object"==typeof t.children._owner||"function"==typeof t.children._owner)&&"string"==typeof t.children._owner.key)},t.isTombstoneGrandchildProps=function(e){const t=e;return(null!==t&&"object"==typeof t||"function"==typeof t)&&Array.isArray(t.children)&&(null!==t.children[0]&&"object"==typeof t.children[0]||"function"==typeof t.children[0])&&(null!==t.children[0].props&&"object"==typeof t.children[0].props||"function"==typeof t.children[0].props)&&(null!==t.children[0].props.entry&&"object"==typeof t.children[0].props.entry||"function"==typeof t.children[0].props.entry)&&"tombstone"===t.children[0].props.entry.type&&(null!==t.children[0].props.entry.conversationPosition&&"object"==typeof t.children[0].props.entry.conversationPosition||"function"==typeof t.children[0].props.entry.conversationPosition)&&"boolean"==typeof t.children[0].props.entry.conversationPosition.showReplyContext}},842:(e,t,r)=>{r.d(t,{BO:()=>a,mN:()=>C,Rf:()=>d,AH:()=>c,W3:()=>T,sk:()=>h,Ec:()=>S,qM:()=>n,iz:()=>l});const s=globalThis,n=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),i=new WeakMap;class a{constructor(e,t,r){if(this._$cssResult$=!0,r!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(n&&void 0===e){const r=void 0!==t&&1===t.length;r&&(e=i.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&i.set(t,e))}return e}toString(){return this.cssText}}const l=e=>new a("string"==typeof e?e:e+"",void 0,o),c=(e,...t)=>{const r=1===e.length?e[0]:t.reduce(((t,r,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[s+1]),e[0]);return new a(r,e,o)},d=(e,t)=>{if(n)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const r of t){const t=document.createElement("style"),n=s.litNonce;void 0!==n&&t.setAttribute("nonce",n),t.textContent=r.cssText,e.appendChild(t)}},h=n?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const r of e.cssRules)t+=r.cssText;return l(t)})(e):e,{is:p,defineProperty:u,getOwnPropertyDescriptor:m,getOwnPropertyNames:f,getOwnPropertySymbols:b,getPrototypeOf:y}=Object,g=globalThis,v=g.trustedTypes,w=v?v.emptyScript:"",_=g.reactiveElementPolyfillSupport,A=(e,t)=>e,T={toAttribute(e,t){switch(t){case Boolean:e=e?w:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},S=(e,t)=>!p(e,t),E={attribute:!0,type:String,converter:T,reflect:!1,hasChanged:S};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;class C extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=E){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(e,r,t);void 0!==s&&u(this.prototype,e,s)}}static getPropertyDescriptor(e,t,r){const{get:s,set:n}=m(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get(){return s?.call(this)},set(t){const o=s?.call(this);n.call(this,t),this.requestUpdate(e,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??E}static _$Ei(){if(this.hasOwnProperty(A("elementProperties")))return;const e=y(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(A("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(A("properties"))){const e=this.properties,t=[...f(e),...b(e)];for(const r of t)this.createProperty(r,e[r])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,r]of t)this.elementProperties.set(e,r)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const e of r)t.unshift(h(e))}else void 0!==e&&t.push(h(e));return t}static _$Eu(e,t){const r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return d(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EC(e,t){const r=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,r);if(void 0!==s&&!0===r.reflect){const n=(void 0!==r.converter?.toAttribute?r.converter:T).toAttribute(t,r.type);this._$Em=e,null==n?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){const r=this.constructor,s=r._$Eh.get(e);if(void 0!==s&&this._$Em!==s){const e=r.getPropertyOptions(s),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:T;this._$Em=s,this[s]=n.fromAttribute(t,e.type),this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){if(r??=this.constructor.getPropertyOptions(e),!(r.hasChanged??S)(this[e],t))return;this.P(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(e,t,r){this._$AL.has(e)||this._$AL.set(e,t),!0===r.reflect&&this._$Em!==e&&(this._$Ej??=new Set).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,r]of e)!0!==r.wrapped||this._$AL.has(t)||void 0===this[t]||this.P(t,this[t],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&=this._$Ej.forEach((e=>this._$EC(e,this[e]))),this._$EU()}updated(e){}firstUpdated(e){}}C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[A("elementProperties")]=new Map,C[A("finalized")]=new Map,_?.({ReactiveElement:C}),(g.reactiveElementVersions??=[]).push("2.0.4")},919:(e,t,r)=>{function s(e,t,r,s){var n,o=arguments.length,i=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(i=(o<3?n(i):o>3?n(t,r,i):n(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i}r.r(t),r.d(t,{MdFilledButton:()=>L}),Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var n=r(2924),o=r(6337);class i extends o.LitElement{connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){return o.html``}}const a=o.css`:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-property:inherit;transition-timing-function:inherit}:host{display:flex;pointer-events:none;transition-property:box-shadow,opacity}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity;--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000))}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15} `;let l=class extends i{};l.styles=[a],l=s([(0,n.customElement)("md-elevation")],l);const c=Symbol("attachableController");let d;o.isServer||(d=new MutationObserver((e=>{for(const t of e)t.target[c]?.hostConnected()})));class h{get htmlFor(){return this.host.getAttribute("for")}set htmlFor(e){null===e?this.host.removeAttribute("for"):this.host.setAttribute("for",e)}get control(){return this.host.hasAttribute("for")?this.htmlFor&&this.host.isConnected?this.host.getRootNode().querySelector(`#${this.htmlFor}`):null:this.currentControl||this.host.parentElement}set control(e){e?this.attach(e):this.detach()}constructor(e,t){this.host=e,this.onControlChange=t,this.currentControl=null,e.addController(this),e[c]=this,d?.observe(e,{attributeFilter:["for"]})}attach(e){e!==this.currentControl&&(this.setCurrentControl(e),this.host.removeAttribute("for"))}detach(){this.setCurrentControl(null),this.host.setAttribute("for","")}hostConnected(){this.setCurrentControl(this.control)}hostDisconnected(){this.setCurrentControl(null)}setCurrentControl(e){this.onControlChange(this.currentControl,e),this.currentControl=e}}const p=["focusin","focusout","pointerdown"];class u extends o.LitElement{constructor(){super(...arguments),this.visible=!1,this.inward=!1,this.attachableController=new h(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(e){this.attachableController.htmlFor=e}get control(){return this.attachableController.control}set control(e){this.attachableController.control=e}attach(e){this.attachableController.attach(e)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}handleEvent(e){if(!e[m]){switch(e.type){default:return;case"focusin":this.visible=this.control?.matches(":focus-visible")??!1;break;case"focusout":case"pointerdown":this.visible=!1}e[m]=!0}}onControlChange(e,t){if(!o.isServer)for(const r of p)e?.removeEventListener(r,this),t?.addEventListener(r,this)}update(e){e.has("visible")&&this.dispatchEvent(new Event("visibility-changed")),super.update(e)}}s([(0,n.property)({type:Boolean,reflect:!0})],u.prototype,"visible",void 0),s([(0,n.property)({type:Boolean,reflect:!0})],u.prototype,"inward",void 0);const m=Symbol("handledByFocusRing"),f=o.css`:host{animation-delay:0s,calc(var(--md-focus-ring-duration, 600ms)*.25);animation-duration:calc(var(--md-focus-ring-duration, 600ms)*.25),calc(var(--md-focus-ring-duration, 600ms)*.75);animation-timing-function:cubic-bezier(0.2, 0, 0, 1);box-sizing:border-box;color:var(--md-focus-ring-color, var(--md-sys-color-secondary, #625b71));display:none;pointer-events:none;position:absolute}:host([visible]){display:flex}:host(:not([inward])){animation-name:outward-grow,outward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) + var(--md-focus-ring-outward-offset, 2px));inset:calc(-1*var(--md-focus-ring-outward-offset, 2px));outline:var(--md-focus-ring-width, 3px) solid currentColor}:host([inward]){animation-name:inward-grow,inward-shrink;border-end-end-radius:calc(var(--md-focus-ring-shape-end-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-end-start-radius:calc(var(--md-focus-ring-shape-end-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-end-radius:calc(var(--md-focus-ring-shape-start-end, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border-start-start-radius:calc(var(--md-focus-ring-shape-start-start, var(--md-focus-ring-shape, var(--md-sys-shape-corner-full, 9999px))) - var(--md-focus-ring-inward-offset, 0px));border:var(--md-focus-ring-width, 3px) solid currentColor;inset:var(--md-focus-ring-inward-offset, 0px)}@keyframes outward-grow{from{outline-width:0}to{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes outward-shrink{from{outline-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-grow{from{border-width:0}to{border-width:var(--md-focus-ring-active-width, 8px)}}@keyframes inward-shrink{from{border-width:var(--md-focus-ring-active-width, 8px)}}@media(prefers-reduced-motion){:host{animation:none}} `;let b=class extends u{};b.styles=[f],b=s([(0,n.customElement)("md-focus-ring")],b);var y=r(2627);var g;!function(e){e[e.INACTIVE=0]="INACTIVE",e[e.TOUCH_DELAY=1]="TOUCH_DELAY",e[e.HOLDING=2]="HOLDING",e[e.WAITING_FOR_CLICK=3]="WAITING_FOR_CLICK"}(g||(g={}));const v=["click","contextmenu","pointercancel","pointerdown","pointerenter","pointerleave","pointerup"],w=o.isServer?null:window.matchMedia("(forced-colors: active)");class _ extends o.LitElement{constructor(){super(...arguments),this.disabled=!1,this.hovered=!1,this.pressed=!1,this.rippleSize="",this.rippleScale="",this.initialSize=0,this.state=g.INACTIVE,this.checkBoundsAfterContextMenu=!1,this.attachableController=new h(this,this.onControlChange.bind(this))}get htmlFor(){return this.attachableController.htmlFor}set htmlFor(e){this.attachableController.htmlFor=e}get control(){return this.attachableController.control}set control(e){this.attachableController.control=e}attach(e){this.attachableController.attach(e)}detach(){this.attachableController.detach()}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){const e={hovered:this.hovered,pressed:this.pressed};return o.html`
`}update(e){e.has("disabled")&&this.disabled&&(this.hovered=!1,this.pressed=!1),super.update(e)}handlePointerenter(e){this.shouldReactToEvent(e)&&(this.hovered=!0)}handlePointerleave(e){this.shouldReactToEvent(e)&&(this.hovered=!1,this.state!==g.INACTIVE&&this.endPressAnimation())}handlePointerup(e){if(this.shouldReactToEvent(e)){if(this.state!==g.HOLDING)return this.state===g.TOUCH_DELAY?(this.state=g.WAITING_FOR_CLICK,void this.startPressAnimation(this.rippleStartEvent)):void 0;this.state=g.WAITING_FOR_CLICK}}async handlePointerdown(e){if(this.shouldReactToEvent(e)){if(this.rippleStartEvent=e,!this.isTouch(e))return this.state=g.WAITING_FOR_CLICK,void this.startPressAnimation(e);this.checkBoundsAfterContextMenu&&!this.inBounds(e)||(this.checkBoundsAfterContextMenu=!1,this.state=g.TOUCH_DELAY,await new Promise((e=>{setTimeout(e,150)})),this.state===g.TOUCH_DELAY&&(this.state=g.HOLDING,this.startPressAnimation(e)))}}handleClick(){this.disabled||(this.state!==g.WAITING_FOR_CLICK?this.state===g.INACTIVE&&(this.startPressAnimation(),this.endPressAnimation()):this.endPressAnimation())}handlePointercancel(e){this.shouldReactToEvent(e)&&this.endPressAnimation()}handleContextmenu(){this.disabled||(this.checkBoundsAfterContextMenu=!0,this.endPressAnimation())}determineRippleSize(){const{height:e,width:t}=this.getBoundingClientRect(),r=Math.max(e,t),s=Math.max(.35*r,75),n=Math.floor(.2*r),o=Math.sqrt(t**2+e**2)+10;this.initialSize=n,this.rippleScale=""+(o+s)/n,this.rippleSize=`${n}px`}getNormalizedPointerEventCoords(e){const{scrollX:t,scrollY:r}=window,{left:s,top:n}=this.getBoundingClientRect(),o=t+s,i=r+n,{pageX:a,pageY:l}=e;return{x:a-o,y:l-i}}getTranslationCoordinates(e){const{height:t,width:r}=this.getBoundingClientRect(),s={x:(r-this.initialSize)/2,y:(t-this.initialSize)/2};let n;return n=e instanceof PointerEvent?this.getNormalizedPointerEventCoords(e):{x:r/2,y:t/2},n={x:n.x-this.initialSize/2,y:n.y-this.initialSize/2},{startPoint:n,endPoint:s}}startPressAnimation(e){if(!this.mdRoot)return;this.pressed=!0,this.growAnimation?.cancel(),this.determineRippleSize();const{startPoint:t,endPoint:r}=this.getTranslationCoordinates(e),s=`${t.x}px, ${t.y}px`,n=`${r.x}px, ${r.y}px`;this.growAnimation=this.mdRoot.animate({top:[0,0],left:[0,0],height:[this.rippleSize,this.rippleSize],width:[this.rippleSize,this.rippleSize],transform:[`translate(${s}) scale(1)`,`translate(${n}) scale(${this.rippleScale})`]},{pseudoElement:"::after",duration:450,easing:"cubic-bezier(0.2, 0, 0, 1)",fill:"forwards"})}async endPressAnimation(){this.rippleStartEvent=void 0,this.state=g.INACTIVE;const e=this.growAnimation;let t=1/0;"number"==typeof e?.currentTime?t=e.currentTime:e?.currentTime&&(t=e.currentTime.to("ms").value),t>=225?this.pressed=!1:(await new Promise((e=>{setTimeout(e,225-t)})),this.growAnimation===e&&(this.pressed=!1))}shouldReactToEvent(e){if(this.disabled||!e.isPrimary)return!1;if(this.rippleStartEvent&&this.rippleStartEvent.pointerId!==e.pointerId)return!1;if("pointerenter"===e.type||"pointerleave"===e.type)return!this.isTouch(e);const t=1===e.buttons;return this.isTouch(e)||t}inBounds({x:e,y:t}){const{top:r,left:s,bottom:n,right:o}=this.getBoundingClientRect();return e>=s&&e<=o&&t>=r&&t<=n}isTouch({pointerType:e}){return"touch"===e}async handleEvent(e){if(!w?.matches)switch(e.type){case"click":this.handleClick();break;case"contextmenu":this.handleContextmenu();break;case"pointercancel":this.handlePointercancel(e);break;case"pointerdown":await this.handlePointerdown(e);break;case"pointerenter":this.handlePointerenter(e);break;case"pointerleave":this.handlePointerleave(e);break;case"pointerup":this.handlePointerup(e)}}onControlChange(e,t){if(!o.isServer)for(const r of v)e?.removeEventListener(r,this),t?.addEventListener(r,this)}}s([(0,n.property)({type:Boolean,reflect:!0})],_.prototype,"disabled",void 0),s([(0,n.state)()],_.prototype,"hovered",void 0),s([(0,n.state)()],_.prototype,"pressed",void 0),s([(0,n.query)(".surface")],_.prototype,"mdRoot",void 0);const A=o.css`:host{display:flex;margin:auto;pointer-events:none}:host([disabled]){display:none}@media(forced-colors: active){:host{display:none}}:host,.surface{border-radius:inherit;position:absolute;inset:0;overflow:hidden}.surface{-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{content:"";opacity:0;position:absolute}.surface::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));inset:0;transition:opacity 15ms linear,background-color 15ms linear}.surface::after{background:radial-gradient(closest-side, var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1d1b20)) max(100% - 70px, 65%), transparent 100%);transform-origin:center center;transition:opacity 375ms linear}.hovered::before{background-color:var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));opacity:var(--md-ripple-hover-opacity, 0.08)}.pressed::after{opacity:var(--md-ripple-pressed-opacity, 0.12);transition-duration:105ms} `;let T=class extends _{};T.styles=[A],T=s([(0,n.customElement)("md-ripple")],T);const S=["role","ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];function E(e){return e.replace("aria","aria-").replace(/Elements?/g,"").toLowerCase()}S.map(E);const C=Symbol("internals"),$=Symbol("privateInternals");let x=!1;const P=(I=o.LitElement,class extends I{get[C](){return this[$]||(this[$]=this.attachInternals()),this[$]}});var I,k;class R extends P{get name(){return this.getAttribute("name")??""}set name(e){this.setAttribute("name",e)}get form(){return this[C].form}constructor(){super(),this.disabled=!1,this.href="",this.target="",this.trailingIcon=!1,this.hasIcon=!1,this.type="submit",this.value="",this.handleActivationClick=e=>{(function(e){return e.currentTarget===e.target&&e.composedPath()[0]===e.target&&!e.target.disabled&&!function(e){const t=x;return t&&(e.preventDefault(),e.stopImmediatePropagation()),async function(){x=!0,await null,x=!1}(),t}(e)})(e)&&this.buttonElement&&(this.focus(),function(e){const t=new MouseEvent("click",{bubbles:!0});e.dispatchEvent(t)}(this.buttonElement))},o.isServer||this.addEventListener("click",this.handleActivationClick)}focus(){this.buttonElement?.focus()}blur(){this.buttonElement?.blur()}render(){const e=this.disabled&&!this.href,t=this.href?this.renderLink():this.renderButton(),r=this.href?"link":"button";return o.html` ${this.renderElevationOrOutline?.()}
- + ${t} `}renderButton(){const{ariaLabel:e,ariaHasPopup:t,ariaExpanded:r}=this;return o.html`