try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`9b5add51-e61b-4a54-a48d-6a22d1a15da1`,e._sentryDebugIdIdentifier=`sentry-dbid-9b5add51-e61b-4a54-a48d-6a22d1a15da1`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{Ag as t,Oi as n,Um as r,Wh as i,Zm as a,gg as o,jg as s,ng as c,pa as l,ti as u}from"./entry.client-mpghtlrl.js";import{t as d}from"./DynamicLayoutRenderer-b1allo8r.js";var f=t(),p=e(s(),1),m=(0,p.createContext)(void 0);function h(e){let t=(0,p.useContext)(e);if(!t)throw Error(`GamePassPageSystem's Context is not present within the React tree`);return t}function g(e){let t={useGamePassPageSystem(){return h(e)},useGamePassPageQueries(){return t.useGamePassPageSystem().queries}};return t}var{useGamePassPageSystem:_,useGamePassPageQueries:v}=g(m),y=[{moduleType:`PublisherCoco`},{moduleType:`Collection`,source:`sigl`,sourceId:l.CloudRecentlyAdded,cardStyle:`Standard`},{moduleType:`Collection`,source:`sigl`,sourceId:l.ConsoleLeavingSoon,cardStyle:`SmallCard`}],b=class extends i{ROOT_QUERY_KEY=[`view-system`,`game-pass-page`];constructor(e){super(e),this.queries=this.createQueries(),this.processQueries(this.queries)}createQueries(){return{isRemoteLayoutEnabled:this.createRelationalQuery({queryKey:this.ROOT_QUERY_KEY.concat(`isRemoteLayoutEnabled`),staleTime:1/0,gcTime:1/0,getDependencyOptions:()=>[this.env.systems.configuration.queries.configuration.getOptions(`enableGamePassPageRemoteLayout`)],fetcher:async([e])=>this.env.systems.configuration.castAsConfiguration(e,`enableGamePassPageRemoteLayout`)??!1}),localStubs:this.createRelationalQuery({queryKey:this.ROOT_QUERY_KEY.concat(`localStubs`),staleTime:1/0,gcTime:1/0,fetcher:async()=>y})}}},x=c();function S(e){let t=(0,f.c)(7),{context:n,env:r,system:i,children:a}=e,{Provider:o}=n??m,s,c;t[0]!==i||t[1]!==r?(c=i??new b(r),t[0]=i,t[1]=r,t[2]=c):c=t[2],s=c;let l=s,u;return t[3]!==o||t[4]!==l||t[5]!==a?(u=(0,x.jsx)(o,{value:l,children:a}),t[3]=o,t[4]=l,t[5]=a,t[6]=u):u=t[6],u}var C=()=>{let e=(0,f.c)(4),{dynamicPageRemote:t}=a(),n;e[0]===t.queries.layout?n=e[1]:(n=t.queries.layout.getOptions({pageId:`gamepass`}),e[0]=t.queries.layout,e[1]=n);let{data:r,isPending:i,isError:s}=o(n);if(i||s||!r)return null;let c;return e[2]===r?c=e[3]:(c=(0,x.jsx)(u,{as:`section`,grid:!0,className:`flex-col-px`,children:(0,x.jsx)(d,{layout:r})}),e[2]=r,e[3]=c),c},w=()=>{let e=(0,f.c)(9),t=v(),{dynamicPageLocal:n}=a(),r;e[0]===t.localStubs?r=e[1]:(r=t.localStubs.getOptions(),e[0]=t.localStubs,e[1]=r);let{data:i}=o(r),s;if(e[2]!==i||e[3]!==n.queries.layout){let t;e[5]===i?t=e[6]:(t=i??[],e[5]=i,e[6]=t),s=n.queries.layout.getOptions({routeId:`gamepasslocal`,stubs:t}),e[2]=i,e[3]=n.queries.layout,e[4]=s}else s=e[4];let{data:c,isPending:l,isError:p}=o(s);if(l||p||!c)return null;let m;return e[7]===c?m=e[8]:(m=(0,x.jsx)(u,{as:`section`,grid:!0,className:`flex-col-px`,children:(0,x.jsx)(d,{layout:c})}),e[7]=c,e[8]=m),m},T=()=>{let e=(0,f.c)(4),t=v(),n;e[0]===t.isRemoteLayoutEnabled?n=e[1]:(n=t.isRemoteLayoutEnabled.getOptions(),e[0]=t.isRemoteLayoutEnabled,e[1]=n);let{data:r,isPending:i}=o(n);if(i)return null;if(r){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(C,{}),e[2]=t):t=e[2],t}let a;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,x.jsx)(w,{}),e[3]=a):a=e[3],a},E=n(()=>(0,x.jsx)(S,{env:r(),children:(0,x.jsx)(T,{})}),`GamePassPage`);export{T as n,E as t};