PageSourceSearch

https://frontrunnerhc.ai/assets/ModuleSetupPage-DF76OaTJ.js

js frontrunnerhc.ai collected 2026-10-05 14:51:07 UTC 2,753 bytes, 1 lines download raw bytes

1import{h as y,o as h,e as b,r as p,j as e}from"./react-DdohInYl.js";import{e as j,f as C,g as N,h as S}from"./useClientAdmin-BefOatuJ.js";import{A as w}from"./ActivationWizard-oIaWzZWw.js";import{u as P,B as A}from"./index-JMlbVkbf.js";import{L as E}from"./ui-Lc0_U7kl.js";import"./state-CqDWEXGQ.js";import"./client-admin-api-I0H4ApzW.js";import"./users-api-BtuQ--8o.js";import"./keys-wArLlf7E.js";import"./textarea-Cjk3fkNq.js";import"./format-DxDj_4ej.js";import"./graphql-CNcS3FKT.js";import"./gql-BD4E0enk.js";import"./form-B0qNJ6Z8.js";import"./radix-CQR8bHqs.js";function M(t){if(!t||typeof t!="object")return[];const r=t.response;if(!r||typeof r!="object")return[];const a=r.data;if(!a||typeof a!="object")return[];const o=a.errors;return Array.isArray(o)?o.map(n=>{if(n&&typeof n=="object"&&"message"in n){const c=n.message;return typeof c=="string"?c:""}return""}).filter(n=>!!n):[]}function G(){const{moduleId:t=""}=y(),{clientId:r,role:a}=h(),o=b(),{toast:n}=P(),[c,i]=p.useState(null),{data:s,isLoading:v}=j(r,t),u=C(r),f=N(r),x=S(r),l=p.useRef(!1);return p.useEffect(()=>{s&&s.status==="inactive"&&s.licensed&&a==="client_admin"&&!l.current&&(l.current=!0,u.mutate(t,{onError:()=>{l.current=!1,i("Could not start setup. Please try again.")}}))},[s,t,a,u]),a!=="client_admin"?e.jsx("div",{className:"rounded-md border bg-amber-50 px-4 py-3 text-sm text-amber-900",children:"Read-only role — you cannot run the setup wizard."}):v||!s?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx(E,{className:"w-6 h-6 animate-spin text-muted-foreground"})}):s.licensed?e.jsxs("div",{className:"max-w-2xl",children:[e.jsx("div",{className:"mb-4",children:e.jsx("button",{className:"text-sm text-muted-foreground hover:text-foreground",onClick:()=>o("/client-admin/subscriptions"),children:"← Back to subscriptions"})}),e.jsx(w,{module:s,saving:f.isPending||u.isPending,activating:x.isPending,errorMsg:c,onSaveProgress:async d=>{i(null);try{await f.mutateAsync({moduleId:t,settings:d})}catch(m){throw i("Could not save your progress."),m}},onComplete:async d=>{i(null);try{await x.mutateAsync({moduleId:t,settings:d}),n({title:`${s.name} activated`,description:"Module is now live for your tenant."}),o(`/client-admin/subscriptions/${t}`)}catch(m){const g=M(m);g.length>0?i(g.join(" · ")):i("Could not activate the module. Please review the settings.")}},onCancel:()=>o("/client-admin/subscriptions")})]}):e.jsxs("div",{className:"rounded-md border bg-slate-50 px-4 py-6 text-center space-y-3",children:[e.jsxs("p",{className:"text-sm",children:[s.name," is not available on your plan."]}),e.jsx(A,{variant:"outline",onClick:()=>o("/client-admin/subscriptions"),children:"Back to subscriptions"})]})}export{G as default};

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.