import{d as e,n as t,r as n,t as r,u as i}from"./bridgePayload-0nV9-YOo.js";function a(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function o(){let t=window.__ICE_APP_CONTEXT__;return!a(t)||!e(t)?null:r(t)}function s(n){let r=t(n);return e(n)&&i(n,`taobao-main-world:bridge`),console.log(`[xyxp-taobao-sku] ICE bridge post`,{href:location.href,posted:r,skuCount:i(n).length}),r}function c(){let e=o();return e?s(e):!1}function l(){let e=!1,t=0;window.addEventListener(`message`,t=>{if(t.source!==window)return;let r=t.data;if(n(r)){if(r.type===`TAOBAO_ICE_DATA_ACK`){e=!0;return}r.type===`TAOBAO_ICE_DATA_REQUEST`&&c()}});let r=()=>e?!0:c(),i=window.setInterval(()=>{if(t+=1,e){clearInterval(i);return}r(),t>=50&&clearInterval(i)},500);r(),window.addEventListener(`DOMContentLoaded`,r,{once:!0}),window.addEventListener(`load`,r,{once:!0})}l(),console.log(`[xyxp-taobao] MAIN world bridge booted`,location.href);