1/*! LICENSE: 674.8c4fe42923.js.LICENSE.txt */ 2"use strict";(self.rspackChunknewapi_web=self.rspackChunknewapi_web||[]).push([[674],{24503(e,s,a){var t=a(72361),i=a(96855),r=a(6702),n=a(39130),l=a(72868),d=a(12393),o=a(56275);function c(e){let{t:s}=(0,r.Bd)(),a=e.icon??i.A;return(0,t.jsx)(n._A,{children:(0,t.jsxs)(d.Sv,{className:(0,o.cn)("min-h-[300px]",e.className),children:[(0,t.jsxs)(d.FT,{children:[(0,t.jsx)(d.Kr,{variant:"icon",children:(0,t.jsx)(a,{className:"text-destructive size-6"})}),(0,t.jsx)(d.cz,{children:e.title??s("Oops! Something went wrong")}),null!=e.description&&(0,t.jsx)(d.Ou,{children:e.description})]}),(0,t.jsxs)(d.HY,{children:[null!=e.onRetry&&(0,t.jsx)(l.$,{variant:"outline",size:"sm",onClick:e.onRetry,children:s("Retry")}),e.action]})]})})}a.d(s,{W:()=>c})},2519(e,s,a){var t=a(72361),i=a(53771),r=a(67834),n=a(68413),l=a(6702),d=a(72868),o=a(84368),c=a(52048),m=a(22990),u=a(56275),x=a(52523);function h(){let{i18n:e,t:s}=(0,l.Bd)(),a=(0,x.n)(e=>e.auth.user),h=(0,c.LL)(e.language),p=(0,n.useCallback)(async s=>{if(await e.changeLanguage(s),a)try{await m.FH.put("/api/user/self",{language:s})}catch{}},[e,a]);return(0,t.jsxs)(o.rI,{modal:!1,children:[(0,t.jsxs)(o.ty,{render:(0,t.jsx)(d.$,{variant:"ghost",size:"icon",className:"h-9 w-9"}),children:[(0,t.jsx)(i.A,{className:"size-[1.2rem]"}),(0,t.jsx)("span",{className:"sr-only",children:s("Change language")})]}),(0,t.jsx)(o.SQ,{align:"end",children:c.iX.map(e=>(0,t.jsxs)(o._2,{onClick:()=>p(e.code),children:[e.label,(0,t.jsx)(r.A,{size:14,className:(0,u.cn)("ms-auto",h!==e.code&&"hidden")})]},e.code))})]})}a.d(s,{c:()=>h})},39130(e,s,a){var t=a(72361),i=a(47488),r=a(64798),n=a(98869),l=a(25707),d=a(60770);function o(e){return(0,n.I)()?(0,t.jsx)("div",{className:e.className,children:e.children}):(0,t.jsx)(l.PY1.div,{initial:d.mL.pageEnter.initial,animate:d.mL.pageEnter.animate,transition:d.fI.default,className:e.className,children:e.children})}function c(){let e=(0,n.I)(),s=(0,i.k)({select:e=>e.matches.at(-1)?.routeId??e.location.pathname});return e?(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsx)(r.s,{})}):(0,t.jsx)(l.PY1.div,{initial:d.mL.pageEnter.initial,animate:d.mL.pageEnter.animate,transition:d.fI.fast,className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsx)(r.s,{})},s)}function m(e){return(0,n.I)()?(0,t.jsx)("div",{className:e.className,children:e.children}):(0,t.jsx)(l.PY1.div,{variants:e.variants??d.j0,initial:"initial",animate:"animate",className:e.className,children:e.children})}function u(e){return(0,t.jsx)(l.PY1.div,{variants:e.variants??d.DX,className:e.className,children:e.children})}function x(e){return(0,n.I)()?(0,t.jsx)("div",{className:e.className,children:e.children}):(0,t.jsx)(l.PY1.div,{variants:d.AK,initial:"initial",animate:"animate",className:e.className,children:e.children})}function h(e){return(0,t.jsx)(l.PY1.div,{variants:d.mz,className:e.className,children:e.children})}function p(e){return(0,n.I)()?(0,t.jsx)("div",{className:e.className,children:e.children}):(0,t.jsx)(l.PY1.div,{initial:d.mL.fadeIn.initial,animate:d.mL.fadeIn.animate,transition:{...d.fI.default,delay:e.delay},className:e.className,children:e.children})}a.d(s,{Hd:()=>h,JX:()=>m,N8:()=>c,Tc:()=>u,Z_:()=>o,_A:()=>p,nD:()=>x})},28057(e,s,a){var t=a(72361),i=a(92429),r=a(5333),n=a(68413),l=a(56275
2),d=a(72868),o=a(1738);function c(e){let{className:s,disabled:a,ref:c,...m}=e,[u,x]=n.useState(!1);return(0,t.jsxs)("div",{className:(0,l.cn)("relative rounded-md",s),children:[(0,t.jsx)(o.p,{type:u?"text":"password",ref:c,disabled:a,...m}),(0,t.jsx)(d.$,{type:"button",size:"icon",variant:"ghost",disabled:a,className:"text-muted-foreground absolute end-1 top-1/2 h-6 w-6 -translate-y-1/2 rounded-md",onClick:()=>x(e=>!e),"aria-label":"Toggle password visibility",children:u?(0,t.jsx)(i.A,{size:18,"aria-hidden":"true"}):(0,t.jsx)(r.A,{size:18,"aria-hidden":"true"})})]})}a.d(s,{y:()=>c})},60770(e,s,a){let t=[.33,1,.68,1],i={default:{duration:.25,ease:t},fast:{duration:.15,ease:t},slow:{duration:.35,ease:t},spring:{type:"spring",damping:20,stiffness:300},none:{duration:0}},r={initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:i.default}};i.fast;let n={initial:{opacity:0,y:12,scale:.98},animate:{opacity:1,y:0,scale:1,transition:i.default}};i.fast,a.d(s,{},{AK:{initial:{},animate:{transition:{staggerChildren:.05}}},DX:r,fI:i,j0:{initial:{},animate:{transition:{staggerChildren:.04}}},mL:{pageEnter:{initial:{opacity:0,y:8,filter:"blur(4px)"},animate:{opacity:1,y:0,filter:"blur(0px)"},exit:{opacity:0,y:-4,filter:"blur(2px)"}},fadeIn:{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0}},scaleIn:{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.96}},slideUp:{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:16}},slideDown:{initial:{opacity:0,y:-16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16}},tableRow:{initial:{opacity:0,y:4},animate:{opacity:1,y:0}},cardItem:{initial:{opacity:0,y:12,scale:.98},animate:{opacity:1,y:0,scale:1}},sidebarSlide:{initial:{opacity:0,x:-8},animate:{opacity:1,x:0},exit:{opacity:0,x:-8}}},mz:n})},88601(e,s,a){a.r(s),a.d(s,{component:()=>Z});var t=a(72361),i=a(96962),r=a(53540),n=a(55667),l=a(82799),d=a(68413),o=a(86832),c=a(6702),m=a(20598),u=a(24503),x=a(2519),h=a(55724),p=a(56275);let y={sm:"size-4",md:"size-6",lg:"size-8"};function g(e){let{t:s}=(0,c.Bd)(),a=y[e.size??"md"];return e.inline?(0,t.jsxs)("span",{className:(0,p.cn)("inline-flex items-center gap-2",e.className),children:[(0,t.jsx)(h.A,{className:(0,p.cn)(a,"animate-spin")}),null!=e.message&&(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:e.message})]}):(0,t.jsxs)("div",{className:(0,p.cn)("flex min-h-[200px] flex-col items-center justify-center gap-3",e.className),children:[(0,t.jsx)("div",{className:"animate-spin",children:(0,t.jsx)(h.A,{className:a})}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:e.message??s("Loading...")})]})}var f=a(68974),j=a(36710),b=a(97785),N=a(57129),v=a(5742),w=a(73606),k=a(28057),z=a(43284),C=a(1738);function M(e){let{form:s,rootInitialized:a}=e,{t:i}=(0,c.Bd)();return a?(0,t.jsx)(z.Fc,{className:"border-sky-200 bg-sky-50 dark:border-sky-900/60 dark:bg-sky-950/40",children:(0,t.jsxs)(z.TN,{className:"flex items-start gap-2",children:[(0,t.jsx)(w.A,{className:"mt-0.5 size-4 text-sky-500"}),i("The administrator account is already initialized. You can keep your existing credentials and continue to the next step.")]})}):(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsx)(j.zB,{control:s.control,name:"username",render:e=>{let{field:a}=e;return(0,t.jsxs)(j.eI,{children:[(0,t.jsx)(j.lR,{children:i("Administrator username")}),(0,t.jsx)(j.MJ,{children:(0,t.jsx)(C.p,{...a,placeholder:i("Choose a username"),autoComplete:"username",onChange:e=>{s.clearErrors("username"),a.onChange(e)}})}),(0,t.jsx)(j.C5,{})]})}}),(0,t.jsx)(j.zB,{control:s.control,name:"password",render:e=>{let{field:a}=e;return(0,t.jsxs)(j.eI,{children:[(0,t.jsx)(j.lR,{children:i("Password")}),(0,t.jsx)(j.MJ,{children:(0,t.jsx)(k.y,{...a,placeholder:i("Set a secure password (min. 8 characters)"),autoComplete:"new-password",onChange:e=>{s.clearErrors("password"),a.onChange(e)}})}),(0,t.jsx)(j.C5,{})]})}}),(0,t.jsx)(j.zB,{control:s.control,name:"confirmPassword",render:e=>{let{field:a}=e;return(0,t.jsxs)(j.eI,{className:"sm:col-span-2",children:[(0,t.jsx)(j.lR,{children:i("Confirm password")}),(0,t.jsx)(j.MJ,{children:(0,t.jsx)(k.y,{...a,placeholder:i("Repeat the administrator password"),autoComplete:"new-password",onChange:e=>{s.clearErrors("confirmPassword"),a.onChange(e)}})}),(0,t.jsx)(j.C5,{})]})}})]})}var A=a(85949),S=a(42817),L=a(38939);let K={external:"External operations mode",self:"Personal use mode",demo:"Demo site mode"},P={sqlite:"warning",mysql:"success",postgres:"success"};function E(e){let{status:s,values:a}=e,{t:i}=(0,c.Bd)(),r=K[a.usageMode],n=s?.database_type??"Unknown",l=P[n.toLowerCase()]??"neutral";return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-6 text-center",children:[(0,t.jsx)("div",{className:"rounded-2xl bg-emerald-500/10 p-4 text-emerald-600 dark:bg-emerald-500/20 dark:text-emerald-300",children:(0,t.jsx)(A.A,{className:"size-8"})}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"text-2xl font-semibold tracking-tight",children:i("Ready to initialize")}),(0,t.jsx)("p",{className:"text-muted-foreground max-w-lg text-sm sm:text-base",children:i("Double check the configuration below. Your system will be locked until initialization is complete.")})]}),(0,t.jsx)("div",{className:"bg-card w-full rounded-xl border p-6 text-left shadow-sm sm:p-8",children:(0,t.jsxs)("dl",{className:"grid gap-6",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("dt",{className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:i("Database")}),(0,t.jsxs)("dd",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-semibold",children:n}),(0,t.jsx)(S.Wh,{label:n,variant:l,copyable:!1})]})]}),(0,t.jsx)(L.w,{}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("dt",{className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:i("Administrator account")}
2),(0,t.jsx)("dd",{className:"text-sm font-semibold",children:s?.root_init?i("Existing account will be reused"):a.username||i("Not set yet")})]}),(0,t.jsx)(L.w,{}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("dt",{className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:i("Usage mode")}),(0,t.jsx)("dd",{className:"text-sm font-semibold",children:i(r)})]})]})})]})}var I=a(11397),V=a(9781);let R=(0,V.A)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);var D=a(95227);let B={sqlite:{label:"SQLite",descriptionKey:"SQLite stores all data in a single file. Make sure that file is persisted when running in containers.",variant:"warning"},mysql:{label:"MySQL",descriptionKey:"MySQL is a production-ready relational database. Keep your credentials secure.",variant:"success"},postgres:{label:"PostgreSQL",descriptionKey:"PostgreSQL offers advanced reliability and data integrity for production workloads.",variant:"success"}};function T(e){var s;let{status:a}=e,{t:i}=(0,c.Bd)(),r=(s=a?.database_type)?B[s.toLowerCase()]??{label:s,descriptionKey:"Custom database driver detected.",variant:"info"}:null,n="u">typeof window?window?.electron:void 0,l=!!n?.isElectron,d=n?.dataDir;return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"bg-card flex items-center justify-between rounded-lg border p-4",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-muted-foreground text-sm font-medium",children:i("Detected database")}),(0,t.jsx)("p",{className:"text-foreground text-base font-semibold",children:r?.label??i("Unknown")}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:i(r?.descriptionKey??"The setup wizard will use this database during initialization.")})]}),(0,t.jsx)(S.Wh,{label:r?.label??i("Unknown"),variant:r?.variant??"info",className:"cursor-default",copyable:!1,icon:I.A})]}),a?.database_type==="sqlite"&&(0,t.jsxs)(z.Fc,{className:"border-amber-200 bg-amber-50 dark:border-amber-900/60 dark:bg-amber-950/40",children:[(0,t.jsxs)(z.XL,{className:"flex items-center gap-2",children:[(0,t.jsx)(R,{className:"size-4 text-amber-500"}),i("Persist your data file")]}),(0,t.jsxs)(z.TN,{children:[(0,t.jsx)("p",{children:i("When running in containers or ephemeral environments, ensure the SQLite file is mapped to persistent storage to avoid data loss on restart.")}),l&&d&&(0,t.jsxs)("p",{className:"mt-3 rounded-md bg-amber-100/70 px-3 py-2 font-mono text-xs text-amber-800 dark:bg-amber-900/30 dark:text-amber-200",children:[i("Data directory:")," ",d]}),l&&!d&&(0,t.jsx)("p",{className:"text-muted-foreground mt-3 text-xs",children:i("Data is stored locally on this device. Use system backups to keep a safe copy.")})]})]}),a?.database_type==="mysql"&&(0,t.jsxs)(z.Fc,{className:"border-emerald-200 bg-emerald-50 dark:border-emerald-900/60 dark:bg-emerald-950/40",children:[(0,t.jsxs)(z.XL,{className:"flex items-center gap-2",children:[(0,t.jsx)(D.A,{className:"size-4 text-emerald-500"}),i("MySQL detected")]}),(0,t.jsx)(z.TN,{children:i("MySQL is production ready. Ensure automated backups and a dedicated user with the minimal required privileges are configured.")})]}),a?.database_type==="postgres"&&(0,t.jsxs)(z.Fc,{className:"border-sky-200 bg-sky-50 dark:border-sky-900/60 dark:bg-sky-950/40",children:[(0,t.jsxs)(z.XL,{className:"flex items-center gap-2",children:[(0,t.jsx)(D.A,{className:"size-4 text-sky-500"}),i("PostgreSQL detected")]}),(0,t.jsx)(z.TN,{children:i("PostgreSQL offers strong reliability guarantees. Double check your maintenance window and retention policies before going live.")})]})]})}var _=a(72868);function F(e){let{currentStep:s,totalSteps:a,onBack:i,onNext:r,onSubmit:n,isSubmitting:l=!1}=e,{t:d}=(0,c.Bd)(),o=s===a-1;return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3 sm:flex-row sm:items-center",children:[(0,t.jsx)("div",{className:"flex justify-end gap-2 sm:justify-start",children:0!==s&&(0,t.jsx)(_.$,{type:"button",variant:"outline",onClick:i,children:d("Back")})}),(0,t.jsxs)("div",{className:"flex flex-1 justify-end gap-2",children:[!
2o&&(0,t.jsx)(_.$,{type:"button",onClick:r,children:d("Next")}),o&&(0,t.jsx)(_.$,{type:"button",onClick:n,disabled:l,children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.A,{className:"mr-2 size-4 animate-spin"}),d("Initializingâ¦")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.A,{className:"mr-2 size-4"}),d("Initialize system")]})})]})]})}var q=a(18727);let Q=(0,V.A)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]),Y=(0,V.A)("presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]);var H=a(11728),$=a(67085);let U=[{value:"external",titleKey:"External operations",descriptionKey:"Serve multiple users or teams with billing and quota control.",icon:q.A},{value:"self",titleKey:"Personal use",descriptionKey:"Best for single-tenant deployments. Pricing and billing options stay hidden.",icon:Q},{value:"demo",titleKey:"Demo site",descriptionKey:"Showcase core capabilities with demo credentials and limited access.",icon:Y}];function J(e){let{form:s}=e,{t:a}=(0,c.Bd)();return(0,t.jsx)(j.zB,{control:s.control,name:"usageMode",render:e=>{let{field:i}=e;return(0,t.jsxs)(j.eI,{children:[(0,t.jsx)(j.lR,{children:a("How will you use the platform?")}),(0,t.jsx)(j.MJ,{children:(0,t.jsx)($.z,{value:i.value,onValueChange:e=>{s.clearErrors("usageMode"),i.onChange(e)},className:"grid gap-3 sm:grid-cols-3",children:U.map(e=>{let{value:s,titleKey:i,descriptionKey:r,icon:n}=e;return(0,t.jsx)(H.J,{htmlFor:`usage-mode-${s}`,className:(0,p.cn)("hover:border-primary/40 focus-within:border-primary/50 has-data-[checked]:border-primary has-data-[checked]:ring-primary/20 group bg-card border-muted flex cursor-pointer flex-col gap-3 rounded-xl border p-4 font-normal transition-all has-data-[checked]:ring-2"),children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)($.C,{id:`usage-mode-${s}`,value:s,className:"mt-1"}),(0,t.jsxs)("div",{children:[(0,t.jsx)(H.J,{htmlFor:`usage-mode-${s}`,className:"text-base leading-none font-semibold",children:a(i)}),(0,t.jsx)("p",{className:"text-muted-foreground mt-2 text-sm",children:a(r)})]}),(0,t.jsx)(n,{className:"text-muted-foreground/70 group-hover:text-primary group-focus-within:text-primary group-has-data-[checked]:text-primary ml-auto size-5 shrink-0 transition"})]})},s)})})}),(0,t.jsx)(j.C5,{})]})}})}let W=[{titleKey:"Database check",descriptionKey:"Verify your database connection"},{titleKey:"Administrator account",descriptionKey:"Create credentials for the root user"},{titleKey:"Usage mode",descriptionKey:"Choose how the platform will operate"},{titleKey:"Review & initialize",descriptionKey:"Confirm settings and finish setup"}],X={username:"",password:"",confirmPassword:"",usageMode:"external"},Z=function(){let{t:e}=(0,c.Bd)(),s=(0,l.Z)(),a=(0,i.jE)(),{systemName:h,logo:y,loading:w}=(0,N.R)(),[k,z]=(0,d.useState)(0),[C,A]=(0,d.useState)(),S=(0,o.mN)({defaultValues:X,mode:"onBlur"}),L=S.watch(),{data:K,isLoading:P,isError:I,refetch:V}=(0,r.I)({queryKey:["setup-status"],queryFn:v.YA,retry:!1}),R=(0,n.n)({mutationKey:["setup-submit"],mutationFn:v.OF,onSuccess:async t=>{t.success?(m.oR.success(e("System initialized successfully! Redirectingâ¦")),await a.invalidateQueries({queryKey:["setup-status"]}),setTimeout(()=>{s({to:"/"})},1200)):m.oR.error(t.message||e("Initialization failed, please try again."))},onError:()=>{m.oR.error(e("Failed to initialize system"))}});(0,d.useEffect)(()=>{if(!K)return;if(!K.success)return void m.oR.error(K.message||e("Failed to load setup status"));let a=K.data;if(a){if(a.status)return void s({to:"/"});A(a),z(0),a.SelfUseModeEnabled?S.setValue("usageMode","self",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1}):a.DemoSiteEnabled?S.setValue("usageMode","demo",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1}):S.setValue("usageMode","external",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1})}},[K,s,S]),(0,d.useEffect)(()=>{C&&C.root_init&&(S.setValue("username","",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1}),S.setValue("password","",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1}),S.setValue("confirmPassword","",{shouldDirty:!1,shouldTouch:!1,shouldValidate:!1}))},[C,S]);let D=(0,d.useMemo)(()=>0===k?(0,t.jsx)(T,{status:C}):1===k?(0,t.jsx)(M,{form:S,rootInitialized:!!C?.root_init}):2===k?(0,t.jsx)(J,{form:S}):(0,t.jsx)(E,{status:C,values:L}),[k,C,S,L]),B=()=>
2{if(C?.root_init)return!0;let s=S.getValues("username")?.trim(),a=S.getValues("password")?.trim(),t=S.getValues("confirmPassword")?.trim();return s?!a||a.length<8?(S.setError("password",{type:"manual",message:e("Password must be at least 8 characters")}),m.oR.error(e("Password must be at least 8 characters")),!1):a===t||(S.setError("confirmPassword",{type:"manual",message:e("Passwords do not match")}),m.oR.error(e("Passwords do not match")),!1):(S.setError("username",{type:"manual",message:e("Please enter an administrator username")}),m.oR.error(e("Please enter an administrator username")),!1)},_=()=>!!S.getValues("usageMode")||(S.setError("usageMode",{type:"manual",message:e("Select a usage mode to continue")}),m.oR.error(e("Select a usage mode to continue")),!1),q=async()=>{let e=B(),s=_();if(!e||!s)return;let a=(0,v.s_)(S.getValues(),!!C?.root_init);R.mutate(a)};return(0,t.jsxs)("div",{className:"bg-muted/40 relative min-h-svh py-10",children:[(0,t.jsx)("div",{className:"absolute top-4 right-4 sm:top-6 sm:right-6",children:(0,t.jsx)(x.c,{})}),(0,t.jsxs)("div",{className:"container mx-auto flex max-w-5xl flex-col gap-8 px-4 sm:px-6",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsx)("div",{className:"relative h-12 w-12",children:w?(0,t.jsx)(b.E,{className:"absolute inset-0 rounded-full"}):(0,t.jsx)("img",{src:y,alt:e("System logo"),className:"h-12 w-12 rounded-full object-cover shadow-sm"})}),w?(0,t.jsx)(b.E,{className:"h-7 w-40"}):(0,t.jsxs)("h1",{className:"text-2xl font-semibold tracking-tight",children:[e("Initialize")," ",h]}),(0,t.jsx)("p",{className:"text-muted-foreground text-center text-sm sm:text-base",children:e("Follow the guided steps to prepare your workspace before the first login.")})]}),(0,t.jsxs)(f.Zp,{className:"shadow-lg",children:[(0,t.jsxs)(f.aR,{className:"space-y-2",children:[(0,t.jsx)(f.ZB,{className:"text-xl font-semibold",children:e("System setup wizard")}),(0,t.jsx)(f.BT,{children:e("Complete these steps to finish the initial installation.")})]}),(0,t.jsxs)(f.Wu,{className:"space-y-6",children:[(0,t.jsx)("ol",{className:"grid gap-3 sm:grid-cols-4",children:W.map((s,a)=>{let i=k===a,r=k>a;return(0,t.jsx)("li",{className:(0,p.cn)("rounded-xl border p-3",i?"border-primary ring-primary/20 ring-2":r?"border-primary/40 bg-primary/5":"border-muted bg-card"),children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("span",{className:(0,p.cn)("flex size-6 items-center justify-center rounded-md border text-xs font-semibold",i||r?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/40 text-muted-foreground"),children:a+1}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("p",{className:"text-sm font-semibold",children:e(s.titleKey)}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:e(s.descriptionKey)})]})]})},s.titleKey)})}),P?(0,t.jsx)(g,{message:e("Loading setup statusâ¦")}):I?(0,t.jsx)(u.W,{title:e("We could not load the setup status."),onRetry:()=>V()}):(0,t.jsx)(j.lV,{...S,children:(0,t.jsx)("form",{className:"space-y-6",onSubmit:e=>e.preventDefault(),children:D})})]}),!P&&!I&&(0,t.jsx)(f.wL,{className:"w-full justify-end border-t",children:(0,t.jsx)(F,{currentStep:k,totalSteps:W.length,onBack:()=>{z(e=>Math.max(e-1,0))},onNext:()=>{1===k&&!B()||(2!==k||_())&&z(e=>Math.min(e+1,W.length-1))},onSubmit:q,isSubmitting:R.isPending})})]})]})]})}},18727(e,s,a){let t=(0,a(9781).A)("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]]);a.d(s,{},{A:t})},95227(e,s,a){let t=(0,a(9781).A)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);a.d(s,{},{A:t})},73606(e,s,a){let t=(0,a(9781).A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
2y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);a.d(s,{},{A:t})}}]);
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.