import{ax as G,i3 as M,fz as V,az as t,aj as m,gz as i,gy as u,b4 as X,n as $,i4 as J,ak as P,aX as K,aI as N,ay as Q,ai as f,h$ as F,a as W}from"./app-k0jcl5PQ.js";function Z(L){var k,v;const[c,I]=G("has:playlist",null),l=M(),d=V(),s=t(m.currentUser()),h=((k=s.data)==null?void 0:k.isAuthenticated)&&m.user(s.data.id),y=i.presentation(u.Subject),g=P.allLevelPreferences(),C=t(h),b=t(((v=s.data)==null?void 0:v.isAuthenticated)&&X.customer(s.data.customerId)),S=t(i.availablePresentations(u.Subject)),T=t(y),w=t(i.availablePresentations(u.Curriculum)),r=t($.getUserPlaylists(new J)),R=t(P.mySubjectPreferences()),x=t(g),{hasPermissions:z}=K();N.useEffect(()=>{var e,a,n,o;r.hasCompleted&&c!==!!((a=(e=r.data)==null?void 0:e.data)!=null&&a.length)&&I(!!((o=(n=r.data)==null?void 0:n.data)!=null&&o.length))},[r.hasCompleted]);const p=s.hasCompleted&&C.hasCompleted&&b.hasCompleted&&S.hasCompleted&&w.hasCompleted&&T.hasCompleted&&r.hasCompleted&&R.hasCompleted&&x.hasCompleted&&c!==null,{userSettings:B}=Q(null),j={screens:{},currentScreen:null,totalScreens:0,totalScreensInProgressBar:0,hasCompletedAllSteps:!1};function q(e){var A,U,O;const a=h?d(h.key):C,n=d(y.key),o=d(g.key);return{jobTitle:e.jobTitleOverride||((O=(U=(A=a.data)==null?void 0:A.userProfile)==null?void 0:U.metadata)==null?void 0:O.jobTitle),userSettings:B.data,presentations:S.data,curriculums:w.data,preferredSubjects:R.data,preferredPresentation:e.preferredPresentationOverride||n.data,audiences:o.data,appLink:W.getCurrentRoute().appLink,appLinks:L,masterUser:a.data,customer:b.data,hasPlaylist:c,hasPermissions:z,currentUser:s.data}}function H(e={}){return p?F.getOnboardingPathway(q(e)):j}function D(e={}){return p?F.commitOnboardingPathway(q(e)):j}async function E(){var a;const e=[f(l,P.allLevelPreferences()),f(l,i.presentation(u.Subject))];(a=s.data)!=null&&a.id&&e.push(f(l,m.user(s.data.id))),await Promise.all(e)}return{getPathway:H,commitPathway:D,waitForFreshPathwayDataAsync:E,hasLoadedPathway:p}}export{Z as u};
//# sourceMappingURL=BZ-tsgAq.chunk.js.map
