(function(){try{var g=typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};g["__faroBundleId_Speechify Chrome Extension"]="13.4.1"}catch(l){}})();
import{Bb as u,De as S,Hf as A,If as p,Je as P,Jf as _,Kf as d,Lf as h,Ya as g,ab as I,gc as O,lc as f,ng as L,og as o,pg as m,qg as D,rg as N,tf as R,yb as a,zf as b}from"./chunk-XMRXO6YU.js";import{p as T}from"./chunk-ODCFEFOB.js";import"./chunk-24ZZP5UQ.js";import"./chunk-GQY3J744.js";import{M as l}from"./chunk-NWEJW7RD.js";import"./chunk-ASZMUWWE.js";import"./chunk-4XRFE7WB.js";import"./chunk-6I7EUWRH.js";import{f as r,g as s,n as c}from"./chunk-CLPINNGF.js";c();s();c();s();var F=2e3;async function k(){let t=T();if(S()){await a.forceManageInitPillPlayer(!t),t||await u(F);return}t||(await a.toggleFeatureOnDomain("pill-player",!0),await u(F))}r.runtime.onMessage.addListener(t=>{t.type==="SHOW_MEETING_NOTES_TOAST"&&t.url&&import("./MeetingNotesReadyToast-66NFYBEC.js").then(({showMeetingNotesReadyToast:e})=>{e(t.url)})});async function j(){Y(),H(),C();let[t,e]=await Promise.all([b(),A()]),i=R();p.setCleanupFn(()=>{t(),e(),i()})}var E,x=[{domain:"wattpad.com",check:(t,e)=>{let i=parseInt(t.match(/[0-9]+/)?.[0]??""),n=parseInt(e.match(/[0-9]+/)?.[0]??"");return i===n}},{domain:"mail.google.com",check:(t,e)=>{let i=new URL(t),V=new URL(e).hash.split(/\/|\?/)[1]??"",y=i.hash.split(/\/|\?/)[1]??"";return!!(y.endsWith("=new")||y===V)}},{domain:"x.com",check:(t,e)=>e.includes("/compose/post")||t.includes("/compose/post")}];g(async(t,e)=>{t===e||(C(),L())||o(t,e,"chat.deepseek.com")||o(t,e,"www.perplexity.ai")||o(t,e,"www.perplexity.ai","/search/new")||o(t,e,"chat.openai.com")||o(t,e,"chatgpt.com")||((m(t,e,"chat.openai.com")||m(t,e,"chatgpt.com")||m(t,e,"chat.deepseek.com"))&&p.setIsResetFromRoot(!0),D(t,e))||x.some(n=>window.location.href.includes(n.domain)&&n.check(t??"",e??""))||(E&&(clearTimeout(E),cancelAnimationFrame(E)),_())});var w=!1;function H(){h("/browser-action",async()=>{w||(w=!0,await P()||await k(),f("extension_browser_action_clicked",{}),d.getIsHidden()?d.showExtension():(await l("browser-action",{isFromExtensionIconClick:!0}),await a.toggleFeatureOnDomain("side-player",!0),(window.getSelection()?.toString()??"").length>0&&O.play()),w=!1)}),h("/health-check",async(t,e)=>{e.body.healthCheck=!0})}async function Y(){await I();let t=document.createElement("div");t.style.fontFamily="system-ui",t.style.visibility="hidden",t.innerHTML="asd",document.body.appendChild(t),setTimeout(()=>t?.remove(),0)}function C(){if(N()){let e=window.location.hostname.split("."),i=e.length>2?e.slice(0,-2).join("."):"root";f("extension_adobe_domain_visited",{subdomain:i}).catch(()=>{})}}var G=()=>{r.runtime.connect().onDisconnect.addListener(async()=>{setTimeout(()=>{!!r.runtime?.id||l("destroy")},1e3)})};j();G();
//# sourceMappingURL=main.js.map
