1import{r as n,j as t,S as h,a7 as j,B as x}from"./elements-DVh2jUIM.js";import{E as v}from"./react-error-boundary.esm-DhomiJMX.js";import{x as b,j as N,P as S,v as L,C as k,O as C,k as E}from"./index-DeQvL4I7.js";import{C as P,R as T}from"./RouteGuard-CINajRLo.js";import{u as R,a as I}from"./useUserPreferences-RcRorIPo.js";import{u as O}from"./useAuthorization-D7B2eQha.js";import{u as U}from"./useHomeSettings-BcPcJ3OS.js";import"./grids-DXrfAsUA.js";import"./startOfDay-AazlW55I.js";import"./useRedesign-DVyq07A4.js";import"./useSelectedProperty-XA-z48Yi.js";import"./CustomContent-qUKl3gpM.js";import"./index-DWdRGcKw.js";function z(e){if(typeof e!="object"||e===null||!("type"in e))return!1;const s=e;return!(s.type!=="nativeNavigate"||typeof s.url!="string"||s.token!==void 0&&typeof s.token!="string")}function F(e){return e==="/embed"?"/":e.startsWith("/embed/")||e.startsWith("/embed?")?e.slice(6):e}function M(){const e=b();n.useEffect(()=>{function s(r){r.source===window&&r.origin===window.location.origin&&z(r.data)&&(r.data.token&&N.getState().setToken(r.data.token).catch(console.error),e(F(r.data.url),{replace:r.data.replace??!1}))}return window.addEventListener("message",s),()=>window.removeEventListener("message",s)},[e])}const _=2e3,B=async e=>
1{if(e)return await e.waitUntilReady(),new Promise(s=>{let r=!1;const o=()=>{r||(r=!0,e.off("change",o),clearTimeout(a),s())};e.on("change",o);const a=setTimeout(o,_)})};function te({request:e}){return{themeOverride:new URL(e.url).searchParams.get("__theme")}}function se(){const{themeOverride:e}=S(),{isLoggedIn:s}=O(),{updateUserSettings:r}=U(),o=L(),a=k(),l=(a==null?void 0:a.showPropertySelector)??!1,d=(a==null?void 0:a.breadCrumbs)??[],[c,f]=n.useState(l),[g,m]=n.useState(!1),[y,p]=n.useState(!1);M(),n.useEffect(()=>{f(l)},[l]),n.useEffect(()=>{let i=!1;return p(!1),(async()=>{m(!0);try{const u=await E.getUserSettings();if(i||(r(u),await B(o),i))return}catch(u){console.error(u)}finally{i||(m(!1),p(!0))}})(),()=>{i=!0}},[s,o,r]),R(),I(e);const w=c||d.length>0||(a==null?void 0:a.customContentId);return t.jsxs("div",{className:"embed bg-base-fill h-screen px-horizontal-layout-sm md:px-horizontal-layout",children:[w&&t.jsx(P,{showPropertySelector:c,breadCrumbs:d,propertiesLoading:c&&g,className:"px-4 py-3 self-center w-full"}),y?t.jsx(v,{FallbackComponent:D,children:t.jsx(n.Suspense,{fallback:t.jsx("div",{className:"w-full py-16 flex items-center justify-center",children:t.jsx(h,{})}),children:t.jsx(T,{children:t.jsx(C,{context:{setDropdown:f,setPageTitle:()=>{}}})})})}):t.jsx("div",{className:"w-full py-16 flex items-center justify-center",children:t.jsx(h,{})}),t.jsx("div",{"aria-hidden":!0,className:"h-horizontal-layout-sm md:h-horizontal-layout"}),t.jsx(j,{position:"bottom-right"})]})}function D({error:e,resetErrorBoundary:s}){return/^Failed to fetch dynamically imported module:/.test(e.message)?t.jsx("div",{className:"w-full py-16 flex items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("h1",{className:"text-2xl font-bold",children:"New version available"}),t.jsx("p",{className:"text-base-fg",children:"Please refresh the page to load the latest version"}),t.jsx(x,{variant:"primaryLink",onClick:()=>window.location.reload(),className:"mt-8 w-full",children:"Refresh"})]})}):(console.error(e),t.jsx("div",{className:"w-full py-16 flex items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("h1",{className:"text-2xl font-bold",children:"Something went wrong"}),t.jsx("p",{className:"text-base-fg",children:"Please try again or contact support"}),t.jsx(x,{variant:"primaryLink",onClick:s,className:"mt-8 w-full",children:"Try again"})]})}))}export{se as Component,te as loader};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.