!function(){if(document.getElementById("ozon-collect-trigger"))return;const t=document.createElement("div");t.id="ozon-collect-trigger",t.style.cssText="\n        position: fixed; top: 160px; right: 8px; z-index: 2147483647; cursor: pointer;\n        background: #005bff; width: 48px; height: 48px; border-radius: 50%;\n        box-shadow: 0 4px 15px rgba(0, 91, 255, 0.4); display: flex; align-items: center; justify-content: center;\n        transition: transform 0.2s;\n    ",t.innerHTML='\n        <svg style="width:24px;height:24px;color:white" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M12 2a10 10 0 1 0 10 10H12V2z"></path><path d="M12 12L2.1 12.05"></path><path d="M22 12A10 10 0 0 0 12 2v10z"></path></svg>\n    ',t.onmouseover=()=>t.style.transform="scale(1.1)",t.onmouseout=()=>t.style.transform="scale(1)",document.body.appendChild(t);const e=document.createElement("iframe");e.src=chrome.runtime.getURL("ui/panel.html"),e.style.cssText="\n        position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; border: none;\n        z-index: 2147483647; display: none; background: transparent;\n    ",document.body.appendChild(e),t.onclick=()=>{e.style.display="block"};window.addEventListener("message",async t=>{if("HIDE_PANEL"===t.data.action&&(e.style.display="none"),"START_SCRAPE"===t.data.action)try{const t=(()=>{if(window.OzonStrategies)for(const t in window.OzonStrategies){const e=window.OzonStrategies[t];if(e.matches(window.location.href))return e}return null})();if(!t)throw new Error("当前页面未找到支持的采集策略 (仅支持 1688)");await async function(){return new Promise(t=>{let e=0;const n=setInterval(()=>{const o=document.body.scrollHeight;window.scrollBy(0,500),e+=500,(e>=o||e>15e3)&&(clearInterval(n),window.scrollTo(0,0),t())},50)})}();const n=t.scrape();e.contentWindow.postMessage({action:"SCRAPE_SUCCESS",data:n},"*")}catch(n){e.contentWindow.postMessage({action:"SCRAPE_ERROR",message:n.message},"*")}})}();
