import{x as p,a as c,y as m,z as o}from"./CWtpRkXC.js";import{u as _}from"./Dn70i8nH.js";import{u as b}from"./B8IrO5D1.js";import{u as y}from"./BvVjgqqk.js";import"./DPtMcQNN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4094f3f8-606c-4af0-9ff9-edc3f1b429d9",e._sentryDebugIdIdentifier="sentry-dbid-4094f3f8-606c-4af0-9ff9-edc3f1b429d9")}catch{}})();const x=p(async(e,t)=>{var f,d,l;let a,n;const{setPage:i}=_(),{tenant:g}=c(),{slug:r}=b(e.path);if(!(((f=g.value)==null?void 0:f.new_homepage_enabled)??!1))return;const{data:u,error:s}=([a,n]=m(()=>y("/api/page",{key:`page-homepage-${r}`,method:"POST",body:{full_path:e.path,slug:r}})),a=await a,n(),a);if(s.value)return((d=s.value)==null?void 0:d.statusCode)===404?(console.log("Page::NotFound",e.path),o({statusCode:404,statusMessage:"Page Not Found"})):((l=s.value)==null?void 0:l.statusCode)===500?o({statusCode:500,statusMessage:"Internal Server Error"}):o({statusCode:503,statusMessage:"Service Unavailable"});u.value&&i(u.value)});export{x as default};
