module.exports=[215624,e=>{"use strict";var t=e.i(921675),a=e.i(843793),n=e.i(195158),r=e.i(50377),i=e.i(86708);let s=["onboarding.completed","onboarding.lastStep","onboarding.username"];async function o(){let e=await a.db.systemConfig.findMany({where:{key:{in:[...s]}}}),t={};for(let a of e)try{t[a.key]=JSON.parse(a.value)}catch{t[a.key]=null}let n=!0===t["onboarding.completed"],r=t["onboarding.lastStep"],i=t["onboarding.username"];return{isFirstRun:!n,isCompleted:n,lastStep:"number"==typeof r?r:0,username:"string"==typeof i&&i.length>0?i:null}}async function l(e){await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),(0,n.revalidatePath)("/","layout")}async function d(e,t=4){if(await a.db.systemConfig.upsert({where:{key:"onboarding.completed"},create:{key:"onboarding.completed",value:"true"},update:{value:"true"}}),await a.db.systemConfig.upsert({where:{key:"onboarding.lastStep"},create:{key:"onboarding.lastStep",value:String(t)},update:{value:String(t)}}),void 0!==e){let t=e.trim().slice(0,64).replace(/[\r\n]/g," ");t.length>0&&await a.db.systemConfig.upsert({where:{key:"onboarding.username"},create:{key:"onboarding.username",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}})}(0,n.revalidatePath)("/","layout")}async function u(e,t){await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.requested"},create:{key:"onboarding.extensions.requested",value:JSON.stringify(e)},update:{value:JSON.stringify(e)}}),await a.db.systemConfig.upsert({where:{key:"onboarding.extensions.completed"},create:{key:"onboarding.extensions.completed",value:JSON.stringify(t)},update:{value:JSON.stringify(t)}}),(0,n.revalidatePath)("/","layout")}async function c(t){try{r.logger.create("task-completion").info("Task completion event dispatched",{taskId:t.taskId,taskTitle:t.taskTitle,status:t.status,executionId:t.executionId});let{broadcastNotification:a}=await e.A(590621);a({...t,type:"completion"})}catch{}}(0,i.ensureServerEntryExports)([o,l,d,u,c]),(0,t.registerServerReference)(o,"00312df80b3c8208578a8b18cd0fa599e94ffdee48",null),(0,t.registerServerReference)(l,"40b7fbed759b8e664404cd676bc0471a8998532582",null),(0,t.registerServerReference)(d,"602ebb4afa308d031087f196c68af4b48c2c328910",null),(0,t.registerServerReference)(u,"60833fa33531c02f00a1f5248eb271eabd3b1a0e25",null),(0,t.registerServerReference)(c,"40195180d5a2c9c2a056dd1ac9e6f01864b2897663",null),e.s(["dispatchTaskCompletionEvent",0,c])},590621,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0~ju4-d._.js","server/chunks/src_lib_0i2.v2d._.js"].map(t=>e.l(t))).then(()=>t(513200)))}];

//# sourceMappingURL=src_0bkvm8c._.js.map