(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]||(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]=[])).push(["object"==typeof document?document.currentScript:void 0,520362,e=>{"use strict";var t=e.i(902875),r=e.i(247865);let n=e=>{let{apiRoute:t,depth:n,refresh:o,serverURL:i}=e,l=(0,r.useRef)(!1),u=(0,r.useCallback)(e=>{e.origin===i&&e.data&&"object"==typeof e.data&&"payload-document-event"===e.data.type&&("function"==typeof o?o():console.error("You must provide a refresh function to `RefreshRouteOnSave`"))},[o,i]);return(0,r.useEffect)(()=>("u">typeof window&&window.addEventListener("message",u),l.current||(l.current=!0,(e=>{let{serverURL:t}=e;if("u">typeof window){let e=window?.opener||window?.parent;e?.postMessage({type:"payload-live-preview",ready:!0},t)}})({serverURL:i}),o()),()=>{"u">typeof window&&window.removeEventListener("message",u)}),[i,u,n,t,o]),null};var o=e.i(725287);let i=(0,e.i(695881).createLogger)("BlockHighlightOverlay"),l={position:"absolute",pointerEvents:"none",border:"2px solid #5B9BD5",backgroundColor:"rgba(91, 155, 213, 0.04)",borderRadius:"8px",boxShadow:"0 0 8px rgba(91, 155, 213, 0.3)",zIndex:"9999",transition:"opacity 150ms ease"},u=e=>{let r=(0,o.useRouter)();return(0,t.jsx)(n,{...e,refresh:r.refresh})};e.s(["LivePreviewListener",0,u],346267),e.i(346267),e.s(["BlockHighlightOverlay",0,()=>{let e=(0,r.useRef)(null),t=(0,r.useRef)(null),n=(0,r.useRef)(null),o=(0,r.useRef)(null),u=(0,r.useRef)(null),c=(0,r.useCallback)(()=>{if("u"{let r=t.current,o=e.current;if(!r||!o)return;if(!r.isConnected){t.current=null,o.style.opacity="0",n.current?.disconnect();return}let i=r.getBoundingClientRect();o.style.top=`${i.top+window.scrollY}px`,o.style.left=`${i.left+window.scrollX}px`,o.style.width=`${i.width}px`,o.style.height=`${i.height}px`,o.style.opacity="1"},[]),a=(0,r.useCallback)(()=>{t.current=null,u.current=null,e.current&&(e.current.style.opacity="0"),n.current?.disconnect()},[]),d=(0,r.useCallback)(()=>{t.current&&null===o.current&&(o.current=requestAnimationFrame(()=>{o.current=null,s()}))},[s]),w=(0,r.useCallback)(e=>{if(e===u.current)return;let r=document.querySelector(`[data-block-id="${CSS.escape(e)}"]`);if(!r)return void i.debug("No element found for block ID",{blockId:e});let o=(e=>{let t=e,r=t.getBoundingClientRect();for(let e=0;e{let t=e=>{var t;(e=>{if(e===window.location.origin)return!0;try{let{hostname:t}=new URL(e);return"weather.com"===t||t.endsWith(".weather.com")}catch{return!1}})(e.origin)&&"object"==typeof(t=e.data)&&null!==t&&"type"in t&&("wx:block-highlight-clear"===t.type||"wx:block-highlight"===t.type&&"blockId"in t&&"string"==typeof t.blockId)&&("wx:block-highlight"===e.data.type?w(e.data.blockId):a())};return window.addEventListener("message",t),window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d,{passive:!0}),()=>{window.removeEventListener("message",t),window.removeEventListener("scroll",d),window.removeEventListener("resize",d),null!==o.current&&cancelAnimationFrame(o.current),n.current?.disconnect(),e.current?.remove()}},[w,a,d]),null},"LivePreviewListener",0,u],520362)},186044,e=>{e.v(t=>Promise.all(["static/immutable/chunks/2eyqm1viprogh.js"].map(t=>e.l(t))).then(()=>t(451309)))}]);