(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{b as m,c as p,d as g}from"./chunk-QGWVBTAL.js";import{g as I,o as u}from"./chunk-ODCFEFOB.js";import"./chunk-GQY3J744.js";import{M as i}from"./chunk-NWEJW7RD.js";import"./chunk-6I7EUWRH.js";import{d as R,g as a,k as d,m as S,n as f}from"./chunk-CLPINNGF.js";f();a();var v=R(I());S();var n,y="speechify-google-drive-nudge-root",s=!1,h=(0,v.default)(async(e,t)=>{if(E(t))return;let r=document.querySelector(e.selectors.pdfViewActiveItemInfoSelector);if(!r)return s&&(s=!1,i("destroy",{},"pill-player")),c();let o=JSON.parse(r.textContent);if(!o||o.mimeType!=="application/pdf")return c();let l=o.id?`${e.selectors.googleDrivePathPrefix}${o.id}`:new URLSearchParams(window.location.search).get("url"),L=o.title;g().docUrl!==l&&(i("destroy",{},"pill-player"),p({docUrl:l,docTitle:L})),!u()&&(s=!0,i("init",{},"pill-player"))},200);async function D(e){h(e,[]);let t=new MutationObserver(r=>h(e,r));return t.observe(document,{childList:!0,subtree:!0}),()=>{c(),t.disconnect()}}function c(){if(m(),!n)return;let e=n.querySelector(`#${y}`);e&&(d(()=>null,e),n.removeChild(e))}var E=e=>e.some(t=>t.target instanceof HTMLElement?t.target?.className?.includes("speechify")||t.target?.id?.includes("speechify"):!1);export{D as default,c as destroyGoogleDriveSupport};
//# sourceMappingURL=init-SBGZDJ4J.js.map
