PageSourceSearch

https://app.backstagebaton.com/app/assets/OrgSetupPage-D6u0SPI-.js

js backstagebaton.com collected 2026-10-07 08:50:04 UTC 34,522 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-_aijvlUq.js","assets/index-CqSexa-f.css"])))=>i.map(i=>d[i]);
2import{v as P,O as Q,P as G,r as C,j as e,B as U,w as K,S as z,Q as L,F,U as ee,m as ae,u as te,c as se,b as q,V as ne,_ as W}from"./index-_aijvlUq.js";import{W as re}from"./WizardShell-BAf42hnX.js";import{I as y}from"./Input-ysTyZFq5.js";import{U as H}from"./usStates-B3oQG6kH.js";import{U as le}from"./timezones-DtZyaxu5.js";import{B as V}from"./Badge-DJIi163x.js";const M={getDraft(t){return P.get(`/organizations/${t}/setup`)},saveDraft(t,i){return P.put(`/organizations/${t}/setup`,i)},launch(t){return P.post(`/organizations/${t}/launch`)},analyzeWebsite(t){return P.post("/organizations/analyze-website",{url:t})}};let I=null;const ie=Q((t,i)=>({orgId:null,currentStep:0,draftData:{},isLoading:!1,isSaving:!1,isLaunching:!1,loaded:!1,async loadDraft(n){t({isLoading:!0,orgId:n});try{const[d,c]=await Promise.all([M.getDraft(n),G.getById(n)]),m=d?.draftData??{},h=m.identity||{},o={name:"name",shortName:"shortName",tagline:"tagline",ownerName:"ownerName",ownerEmail:"ownerEmail",phone:"phone",website:"website",street:"street",city:"city",state:"state",zip:"zip",facebookUrl:"facebookUrl",instagramUrl:"instagramUrl",twitterUrl:"twitterUrl",youtubeUrl:"youtubeUrl"};let g=!1;for(const[f,x]of Object.entries(o))!h[f]&&c?.[x]&&(h[f]=c[x],g=!0);g&&(m.identity=h),t({currentStep:0,draftData:m,loaded:!0,isLoading:!1})}catch{t({loaded:!0,isLoading:!1})}},updateStepData(n,d){t(c=>({draftData:{...c.draftData,[n]:d}})),clearTimeout(I),I=setTimeout(()=>{i().persistDraft()},500)},async persistDraft(){const{orgId:n,currentStep:d,draftData:c}=i();if(n){t({isSaving:!0});try{await M.saveDraft(n,{currentStep:d,draftData:c})}catch{}finally{t({isSaving:!1})}}},setStep(n){t({currentStep:n}),clearTimeout(I),I=setTimeout(()=>{i().persistDraft()},200)},nextStep(){const{currentStep:n}=i();n<8&&i().setStep(n+1)},prevStep(){const{currentStep:n}=i();n>0&&i().setStep(n-1)},async launch(){const{orgId:n}=i();if(!n)throw new Error("No org ID");t({isLaunching:!0});try{const d=await M.launch(n);return t({isLaunching:!1}),d}catch(d){throw t({isLaunching:!1}),d}},reset(){clearTimeout(I),t({orgId:null,currentStep:0,draftData:{},isLoading:!1,isSaving:!1,isLaunching:!1,loaded:!1})}}));function oe(){try{const t=Intl.DateTimeFormat().resolvedOptions().timeZone;return new Set(["America/New_York","America/Chicago","America/Denver","America/Los_Angeles","America/Phoenix","America/Anchorage","Pacific/Honolulu","America/Puerto_Rico"]).has(t)?t:/^America\/(Indiana|Detroit|Kentucky)/.test(t)?"America/New_York":t==="America/Boise"?"America/Denver":"America/New_York"}catch{return"America/New_York"}}function ce({data:t,onChange:i,onBrandingSuggestion:n,onAnalysisResult:d}){const[c,m]=C.useState(!1),[h,o]=C.useState(null),[g,f]=C.useState(null),[x,j]=C.useState(null),[l,s]=C.useState(new Set);C.useEffect(()=>{if(!t.timezone){const a=oe();i({...t,timezone:a})}},[]);function r(a,N){i({...t,[a]:N})}async function u(){if(t.website?.trim()){m(!0),o(null),f(null),j(null);try{const a=await M.analyzeWebsite(t.website.trim()),N=[],k={},R={tagline:"Tagline",phone:"Phone",street:"Street",city:"City",state:"State",z
2ip:"Zip",facebookUrl:"Facebook",instagramUrl:"Instagram",twitterUrl:"X / Twitter",youtubeUrl:"YouTube"};for(const[S,p]of Object.entries(R))a[S]&&(t[S]&&t[S]!==a[S]?N.push({key:S,label:p,current:t[S],suggested:a[S]}):t[S]||(k[S]=a[S]));Object.keys(k).length>0&&(i({...t,...k}),s(new Set(Object.keys(k)))),N.length>0&&f(N),a.suggestedColorScheme&&n&&n(a.suggestedColorScheme);const A={ensembles:a.ensembles||[],conductors:a.conductors||[],members:a.members||[],rehearsalLocations:a.rehearsalLocations||[],description:a.description||null};(A.ensembles.length||A.conductors.length||A.members.length)&&(j(A),d&&d(A))}catch(a){o(a.message||"Website analysis failed")}finally{m(!1)}}}function b(a,N){r(a,N),s(k=>new Set([...k,a])),f(k=>k.filter(R=>R.key!==a))}function w(){f(null)}const v=a=>l.has(a)?"discovered":void 0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Organization Identity"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Basic information about your organization."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Organization Details"}),e.jsx(y,{label:"Organization Name",placeholder:"Highlands Ranch Concert Band",value:t.name||"",onChange:a=>r("name",a.target.value),required:!0}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(y,{label:"Short Name",placeholder:"HRCB",value:t.shortName||"",onChange:a=>
2r("shortName",a.target.value),required:!0}),e.jsx(y,{label:"Tagline",placeholder:"Making music since 1985",value:t.tagline||"",onChange:a=>r("tagline",a.target.value),hint:v("tagline")})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Website"}),e.jsxs("div",{className:"flex gap-2 items-end",children:[e.jsx("div",{className:"flex-1",children:e.jsx(y,{label:"Website URL",type:"url",placeholder:"https://www.example.org",value:t.website||"",onChange:a=>r("website",a.target.value)})}),e.jsx(U,{type:"button",variant:"secondary",size:"sm",disabled:!t.website?.trim()||c,isLoading:c,onClick:u,children:"Analyze website"})]}),h&&e.jsx("p",{className:"text-sm text-red-600",children:h}),g&&g.length>0&&e.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 space-y-3",children:[e.jsx("p",{className:"text-sm font-medium text-amber-800",children:"Some fields already have values. Accept suggestions?"}),g.map(a=>e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium text-gray-700",children:[a.label,":"]})," ",e.jsx("span",{className:"text-gray-500 line-through",children:a.current})," ",e.jsx("span",{className:"text-amber-800",children:a.suggested})]}),e.jsx(U,{type:"button",variant:"ghost",size:"sm",onClick:()=>b(a.key,a.suggested),children:"Accept"})]},a.key)),e.jsx("button",{type:"button",onClick:w,className:"text-xs text-gray-500 hover:text-gray-700",children:"Dismiss all"})]}),x&&e.jsxs("div",{className:"rounded-lg border border-blue-200 bg-blue-50 p-4 space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-blue-800",children:"Discovered from website:"}),x.ensembles.length>0&&e.jsxs("p",{className:"text-sm text-blue-700",children:[e.jsx("span",{className:"font-medium",children:"Ensembles:"})," ",x.ensembles.map(a=>a.name).join(", "),e.jsx("span",{className:"text-blue-500 text-xs ml-1",children:"(added to Ensembles step)"})]}),x.conductors.length>0&&e.jsxs("div",{className:"text-sm text-blue-700",children:[e.jsx("span",{className:"font-medium",children:"Conductors / Directors:"}),e.jsx("ul",{className:"list-disc list-inside ml-2 mt-0.5",children:x.conductors.map((a,N)=>e.jsxs("li",{children:[a.name,a.title&&e.jsxs("span",{className:"text-blue-500",children:[" — ",a.title]}),a.ensemble&&e.jsxs("span",{className:"text-blue-400",children:[" (",a.ensemble,")"]})]},N))})]}),x.members.length>0&&e.jsxs("div",{className:"text-sm text-blue-700",children:[e.jsxs("span",{className:"font-medium",children:["People found (",x.members.length,"):"]}),e.jsx("ul",{className:"list-disc list-inside ml-2 mt-0.5 max-h-32 overflow-y-auto",children:x.members.map((a,N)=>e.jsxs("li",{children:[a.name,a.role&&e.jsxs("span",{className:"text-blue-500",children:[" — ",a.role]})]},N))})]}),x.description&&e.jsx("p",{className:"text-xs text-blue-500 italic mt-1",children:x.description})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Contact"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(y,{label:"Contact Name",placeholder:"Jane Smith",value:t.ownerName||"",onChange:a=>r("ownerName",a.target.value)}),e.jsx(y,{label:"Contact Email",type:"email",placeholder:"[email protected]",value:t.ownerEmail||"",onChange:a=>r("ownerEmail",a.target.value)})]}),e.jsx(y,{label:"Phone",placeholder:"(555) 555-5555",value:t.phone||"",onChange:a=>r("phone",K(a.target.value)),hint:v("phone")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Address"}),e.jsx(y,{label:"Street",placeholder:"123 Main St",value:t.street||"",onChange:a=>r("street",a.target.value),hint:v("street")}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-6 gap-4",children:[e.jsx("div",{className:"col-span-2",children:e.jsx(y,{label:"City",placeholder:"Highlands Ranch",value:t.city||"",onChange:a=>r("city",a.target.value),hint:v("city")})}),e.jsx("div",{className:"col-span-1 sm:col-span-2",children:e.jsx(z,{label:"State",options:H,value:t.state||"",onChange:a=>r("state",a.target.value),hint:v("state")})}),e.jsx("div",{className:"col-span-1 sm:col-span-2",children:e.jsx(y,{label:"Zip",placeholder:"80129",value:t.zip||"",onChange:a=>r("zip",a.target.value),hint:v("zip")})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Timezone"}),e.jsx(z,{label:"Timezone",options:le,value:t.timezone||"America/Ne
2w_York",onChange:a=>r("timezone",a.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"Used for rehearsal and concert times in emails, calendar sync, and reminders. We auto-detect from your browser; double-check this matches where your band rehearses."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wide",children:"Social Media"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(y,{label:"Facebook",type:"url",placeholder:"https://facebook.com/yourorg",value:t.facebookUrl||"",onChange:a=>r("facebookUrl",a.target.value),hint:v("facebookUrl")}),e.jsx(y,{label:"Instagram",type:"url",placeholder:"https://instagram.com/yourorg",value:t.instagramUrl||"",onChange:a=>r("instagramUrl",a.target.value),hint:v("instagramUrl")}),e.jsx(y,{label:"X / Twitter",type:"url",placeholder:"https://x.com/yourorg",value:t.twitterUrl||"",onChange:a=>r("twitterUrl",a.target.value),hint:v("twitterUrl")}),e.jsx(y,{label:"YouTube",type:"url",placeholder:"https://youtube.com/@yourorg",value:t.youtubeUrl||"",onChange:a=>r("youtubeUrl",a.target.value),hint:v("youtubeUrl")})]})]})]})}const de=[{value:"",label:"Select classification"},{value:"concert",label:"Concert Band"},{value:"orchestra",label:"Orchestra"},{value:"marching",label:"Marching Band"},{value:"jazz",label:"Jazz Ensemble"}],me=[{value:"",label:"No default day"},{value:"0",label:"Sunday"},{value:"1",label:"Monday"},{value:"2",label:"Tuesday"},{value:"3",label:"Wednesday"},{value:"4",label:"Thursday"},{value:"5",label:"Friday"},{value:"6",label:"Saturday"}];function ue({data:t,onChange:i}){const n=Array.isArray(t)?t:[];function d(){const l=n.find(s=>s.rehearsalVenue?.name?.trim())?.rehearsalVenue;i([...n,{name:"",description:"",classification:"",defaultRehearsalDay:"",defaultRehearsalStartTime:"",defaultRehearsalEndTime:"",rehearsalVenue:l?{...l}:null}])}function c(l){i(n.filter((s,r)=>r!==l))}function m(l,s,r){const u=n.map((b,w)=>w===l?{...b,[s]:r}:b);i(u)}function h(l){const s=n.map((r,u)=>u===l?{...r,rehearsalVenue:r.rehearsalVenue?null:{name:"",address:"",city:"",state:"",zip:"",county:""}}:r);i(s)}function o(l,s,r){const u=n.map((b,w)=>w===l?{...b,rehearsalVenue:{...b.rehearsalVenue,[s]:r}}:b);i(u)}const g={name:"",address:"",city:"",state:"",zip:"",county:""};function f(l,s,r){if(s==="none")m(l,"rehearsalVenue",null);else if(s==="different")m(l,"rehearsalVenue",{...g});else if(s.startsWith("same:")){const u=s.slice(5),b=r.find(w=>w.name.trim().toLowerCase()===u);m(l,"rehearsalVenue",b?{...b}:{...g})}}function x(l){const s=[],r=new Set;for(let u=0;u<l;u++){const b=n[u].rehearsalVenue?.name?.trim();b&&!r.has(b.toLowerCase())&&(r.add(b.toLowerCase()),s.push(n[u].rehearsalVenue))}return s}function j(l,s){return e.jsxs(e.Fragment,{children:[e.jsx(y,{label:"Venue Name",placeholder:"Community Center",value:s.name,onChange:r=>o(l,"name",r.target.value)}),e.jsx(y,{label:"Street Address",placeholder:"123 Main St",value:s.address,onChange:r=>o(l,"address",r.target.value)}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-6 gap-2",children:[e.jsx("div",{className:"col-span-2",children:e.jsx(y,{label:"City",placeholder:"Springfield",value:s.city,onChange:r=>o(l,"city",r.target.value)})}),e.jsx("div",{className:"col-span-1 sm:col-span-2",children:e.jsx(z,{label:"State",options:H,value:s.state,onChange:r=>o(l,"state",r.target.value)})}),e.jsx("div",{className:"col-span-1 sm:col-span-2",children:e.jsx(y,{label:"Zip Code",placeholder:"62701",value:s.zip,onChange:r=>o(l,"zip",r.target.value)})})]}),e.jsx(y,{label:"County",placeholder:"Sangamon",value:s.county,onChange:r=>o(l,"county",r.target.value)})]})}return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Ensembles"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Add at least one ensemble. You can also set default rehearsal schedules."})]}),n.length===0&&e.jsx("p",{className:"text-sm text-gray-400 py-4 text-center",children:"No ensembles yet. Add your first one below."}),e.jsx("div",{className:"space-y-4",children:n.map((l,s)=>e.jsxs("div",{className:"p-4 rounded-xl border border-gray-200 bg-white space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(y,{label:`Ensemble ${s+1}`,placeholder:"Concert Band",value:l.name,onChange:r=>m(s,"name",r.target.value),required:!0}),e.jsx(z,{options:de,value:l.classification||"",onChange:r=>m(s,"classification",r.target.value)}),e.jsx("textarea",{placeholder:"Description (optional) — what kind of band, who plays, style, anything you want members to know",value:l.description||"",onChange:r=>m(s,"description",r.target.value),rows:5,className:"w-full min-h-[140px] border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-band-500 focus:border-band-500 resize-y"})]}),e.jsx("button",{type:"button",onClick:()=>c(s),className:"mt-6 px-2 py-1 text-gray-400 hover:text-red-500 hover:bg-red-50 text-sm rounded transition-colors shrink-0","aria-label":"Remove ensemble",children:"Remove"})]}),e.jsxs("div",{className:"border-t border-gray-100 pt-3",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2",children:"Rehearsal Defaults"}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:[e.jsx("div",{className:"col-span-2 sm:col-span-1",children:e.jsx(z,{label:"Day",options:me,value:l.defaultRehearsalDay??"",onChange:r=>m(s,"defaultRehearsalDay",r.target.value)})}),e.jsx(y,{label:"Start Time",type:"time",value:l.defaultRehearsalStartTime||"",onChange:r=>m(s,"defaultRehearsalStartTime",r.target.value)}),e.jsx(y,{label:"End Time",type:"time",value:l.defaultRehearsalEndTime||"",onChange:r=>m(s,"defaultRehearsalEndTime",r.target.value)})]}),(()=>{const r=x(s),u=l.rehearsalVenue,b=u?.name?.trim()?r.find(a=>a.name.trim().toLowerCase()===u.name.trim().toLowerCase()):null;if(r.length===0)return u?e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Rehearsal Location"}),e.jsx("button",{type:"button",onClick:()=>h(s),className:"text-xs text-gray-400 hover:text-red-500",children:"Remove"})]}),j(s,u)]}):e.jsx("button",{type:"button",onClick:()=>h(s),className:"mt-2 text-sm text-band-600 hover:text-band-700 font-medium",children:"+ Add rehearsal location"});const w=u?b?`same:${b.name.trim().toLowerCase()}
2`:"different":"none",v=b?[b.address,b.city,b.state].filter(Boolean).join(", "):"";return e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsx(z,{label:"Rehearsal Location",value:w,onChange:a=>f(s,a.target.value,r),options:[...r.map(a=>({value:`same:${a.name.trim().toLowerCase()}`,label:`Same as “${a.name.trim()}”`})),{value:"different",label:"A different location"},{value:"none",label:"No rehearsal location"}]}),u&&b?e.jsxs("p",{className:"text-sm text-gray-600 bg-gray-50 border border-gray-200 rounded-lg px-3 py-2",children:[e.jsx("span",{"aria-hidden":!0,children:"📍 "}),e.jsx("span",{className:"font-medium text-gray-700",children:b.name.trim()}),v&&e.jsxs("span",{className:"text-gray-400",children:[" — ",v]})]}):u?j(s,u):null]})})()]})]},s))}),e.jsx(U,{type:"button",variant:"secondary",size:"sm",onClick:d,children:"New ensemble"}),n.length===0&&e.jsx("p",{className:"text-xs text-amber-600",children:"At least one ensemble is required to launch."})]})}const he=[{value:"president",label:"President"},{value:"vice_president",label:"Vice President"},{value:"music_director",label:"Music Director"},{value:"band_manager",label:"Band Manager"},{value:"treasurer",label:"Treasurer"},{value:"secretary",label:"Secretary"},{value:"marketing_director",label:"Marketing / Communications"},{value:"assistant_conductor",label:"Assistant Conductor"},{value:"membership_coordinator",label:"Membership Coordinator"},{value:"fundraising_coordinator",label:"Fundraising Coordinator"},{value:"equipment_manager",label:"Equipment Manager"},{value:"librarian",label:"Librarian"},{value:"section_leader",label:"Section Leader"},{value:"member",label:"Member"}];function xe({data:t,onChange:i}){const n=Array.isArray(t)?t:[];function d(){i([...n,{email:"",role:"president",displayName:""}])}function c(h){i(n.filter((o,g)=>g!==h))}function m(h,o,g){const f=n.map((x,j)=>j===h?{...x,[o]:g}:x);i(f)}return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Invite Staff"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Invite key people to help manage your organization. Login accounts will be created and invite emails sent on launch."})]}),n.length===0&&e.jsx("p",{className:"text-sm text-gray-400 py-4 text-center",children:"No staff invitations yet. You can invite people now or later from Settings."}),e.jsx("div",{className:"space-y-3",children:n.map((h,o)=>e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg border border-gray-100 bg-gray-50",children:[e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsx(y,{label:"Email",type:"email",placeholder:"[email protected]",value:h.email,onChange:g=>m(o,"email",g.target.value),required:!0}),e.jsx(y,{label:"Display Name",placeholder:"Jane Smith",value:h.displayName||"",onChange:g=>m(o,"displayName",g.target.value),required:!0})]}),e.jsx(z,{label:"Role",options:he,value:h.role,onChange:g=>m(o,"role",g.target.value)})]}),e.jsx("button",{type:"button",onClick:()=>c(o),className:"mt-6 px-2 py-1 text-gray-400 hover:text-red-500 hover:bg-red-50 text-sm rounded transition-colors shrink-0","aria-label":"Remove invite",children:"Remove"})]},o))}),e.jsx(U,{type:"button",variant:"secondary",size:"sm",onClick:d,children:"Add staff member"})]})}const pe=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function _({title:t,stepIndex:i,onEdit:n,children:d}){return e.jsxs("div",{className:"py-3 border-b border-gray-100 last:border-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-700",children:t}),e.jsx("button",{type:"button",onClick:()=>n(i),className:"text-xs text-band-600 hover:text-band-800",children:"Edit"})]}),e.jsx("div",{className:"text-sm text-gray-600",children:d})]})}function ge({draftData:t,onEdit:i}){const n=t.identity||{},d=t.plan||{},c=t.ensembles||[],m=t.invites||[],h=n.name&&n.shortName,o=c.filter(s=>s.name?.trim()).length>0,g=d.tier||"essentials",f=L[g],x=d.trialMode,j=d.interval||"monthly",l=!x&&!!L[g];return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Ready to Launch"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Review your configuration and launch your organization."})]}),(!h||!o)&&e.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 space-y-1",children:[!h&&e.jsx("p",{className:"text-sm text-amber-800",children:"Organization name and short name are required."}),!o&&e.jsx("p",{className:"text-sm text-amber-800",children:"At least one ensemble is required."})]}),e.jsxs("div",{className:"divide-y divide-gray-100",children:[e.jsx(_,{title:"Identity",stepIndex:0,onEdit:i,children:n.name?e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("p",{className:"font-medium",children:[n.name," 
2(",n.shortName,")"]}),n.tagline&&e.jsx("p",{className:"text-gray-400 text-xs",children:n.tagline}),n.ownerEmail&&e.jsxs("p",{className:"text-xs text-gray-400",children:[n.ownerName," · ",n.ownerEmail]}),n.website&&e.jsx("p",{className:"text-xs text-gray-400",children:n.website}),n.phone&&e.jsx("p",{className:"text-xs text-gray-400",children:n.phone}),(n.street||n.city)&&e.jsx("p",{className:"text-xs text-gray-400",children:[n.street,n.city,n.state,n.zip].filter(Boolean).join(", ")})]}):e.jsx("p",{className:"text-gray-400 italic",children:"Not configured"})}),e.jsx(_,{title:"Plan",stepIndex:1,onEdit:i,children:x?e.jsx("p",{children:"90-day free trial (Complete plan features)"}):e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("p",{className:"font-medium",children:[f?.name," — $",j==="monthly"?f?.monthlyPrice:f?.annualMonthly,"/mo"]}),j==="annual"&&e.jsxs("p",{className:"text-xs text-gray-400",children:["Billed annually ($",f?.annualPrice,"/yr)"]})]})}),e.jsx(_,{title:"Ensembles",stepIndex:2,onEdit:i,children:c.filter(s=>s.name?.trim()).length>0?e.jsx("ul",{className:"space-y-1.5",children:c.filter(s=>s.name?.trim()).map((s,r)=>e.jsxs("li",{children:[e.jsx("span",{className:"font-medium",children:s.name}),(s.defaultRehearsalDay||s.defaultRehearsalStartTime)&&e.jsxs("span",{className:"text-xs text-gray-400 ml-2",children:[s.defaultRehearsalDay&&pe[Number(s.defaultRehearsalDay)],s.defaultRehearsalDay&&s.defaultRehearsalStartTime&&" ",s.defaultRehearsalStartTime&&F(s.defaultRehearsalStartTime),s.defaultRehearsalEndTime&&`–${F(s.defaultRehearsalEndTime)}`]}),s.rehearsalVenue?.name&&e.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:["@ ",s.rehearsalVenue.name]})]},r))}):e.jsx("p",{className:"text-amber-600 italic",children:"None configured (required)"})}),e.jsx(_,{title:"Staff Invitations",stepIndex:3,onEdit:i,children:m.filter(s=>s.email?.trim()).length>0?e.jsx("ul",{className:"list-disc list-inside text-sm",children:m.filter(s=>s.email?.trim()).map((s,r)=>e.jsxs("li",{children:[s.displayName||s.email," · ",s.role]},r))}):e.jsx("p",{className:"text-gray-400 italic",children:"No staff invitations"})})]}),h&&o&&e.jsx("div",{className:"rounded-lg border border-green-200 bg-green-50 p-3",children:e.jsx("p",{className:"text-sm text-green-800 font-medium",children:l?'Everything looks good! Click "Launch Organization" to proceed to payment.':'Everything looks good! Click "Launch Organization" to go live.'})})]})}const be=["essentials","complete"],Y="complete",ye=90;function fe({data:t,onChange:i}){const n=t?.trialMode!==!1,d=t?.tier||"complete",c=t?.interval||"monthly",[m,h]=C.useState(t?.trialMode===!1);C.useEffect(()=>{t?.trialMode===void 0&&i({...t,trialMode:!0,tier:Y,interval:"monthly"})},[]);function o(){h(!1),i({...t,trialMode:!0,tier:Y})}function g(){h(!0),i({...t,trialMode:!1,tier:t?.tier||"complete"})}function f(j){i({...t,tier:j,trialMode:!1})}function x(){i({...t,interval:c==="monthly"?"annual":"monthly"})}return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Choose how to start"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Most bands start with a free trial. You can upgrade or downgrade anytime."})]}),e.jsx("button",{type:"button",onClick:o,className:`w-full text-left rounded-xl border-2 p-5 transition-all ${n?"border-band-500 ring-2 ring-band-200 bg-band-50/40":"border-gray-200 hover:border-gray-300"}`,children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:`mt-1 h-5 w-5 rounded-full border-2 flex items-center justify-center shrink-0 ${n?"border-band-500 bg-band-500":"border-gray-300"}`,children:n&&e.jsx("svg",{className:"h-3 w-3 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("h4",{className:"font-semibold text-gray-900",children:["Start a ",ye,"-day free trial"]}),e.jsx(V,{color:"green",children:"Recommended"})]}),e.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:["Try the full Complete-tier feature set at no cost. ",e.jsx("span",{className:"font-medium text-gray-800",children:"No credit card required."})," Pick a plan when you're ready to convert."]}),e.jsxs("ul",{className:"text-xs text-gray-600 mt-2 space-y-0.5",children:[e.jsxs("li",{className:"flex items-start gap-1.5",children:[e.jsx("span",{className:"text-green-500 mt-0.5 shrink-0",children:"✓"}),"Full member, music, performance, and communications features"]}),e.jsxs("li",{className:"flex items-start gap-1.5",children:[e.jsx("span",{className:"text-green-500 mt-0.5 shrink-0",children:"✓"}),"Smart import, SMS notifications, partnerships"]}),e.jsxs("li",{className:"flex items-start gap-1.5",children:[e.jsx("span",{className:"text-green-500 mt-0.5 shrink-0",children:"✓"}),"No charge until you choose to subscribe"]})]})]})]})}),m?e.jsxs("div",{className:"rounded-xl border-2 border-band-500 ring-2 ring-band-200 bg-band-50/40 p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-gray-900",children:"Skip the trial — choose a plan"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"You'll go to Stripe Checkout when you finish setup. Cancel anytime; 14-day refund window on annual plans."})]}),e.jsx("button",{type:"button",onClick:o,className:"text-xs text-band-700 hover:text-band-800 underline shrink-0",children:"Back to free trial"})]}),e.jsxs("div",{className:"flex items-center justify-center gap-3",children:[e.jsx("span",{className:`text-sm font-medium ${c==="monthly"?"text-gray-900":"text-gray-400"}`,children:"Monthly"}),e.jsx("button",{type:"button",onClick:x,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${c==="annual"?"bg-band-500":"bg-gray-300"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${c==="annual"?"translate-x-6":"translate-x-1"}`})}),e.jsx("span",{className:`text-sm font-medium ${c==="annual"?"text-gray-900":"text-gray-400"}`,children:"Annual"}),c==="annual"&&e.jsx(V,{color:"green",children:"Save 17%"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:be.map(j=>{const l=L[j];if(!l)return null;const s=d===j,r=c==="monthly"?l.monthlyPrice:l.annualMonthly;return e.jsxs("button",{type:"button",onClick:()=>f(j),className:`text-left rounded-lg border p-3 transition-all bg-white ${s?"border-band-500 ring-1 ring-band-500":"border-gray-200 hover:border-gray-300"} ${l.popular?"relative":""}`,children:[l.popular&&e.jsx(V,{color:"purple",className:"absolute -top-2.5 left-3",children:"Most Popular"}),e.jsx("h4",{className:"font-semibold text-gray-900",children:l.name}),e.jsxs("p",{className:"text-2xl font-bold text-gray-900 mt-1",children:["$",r,e.jsx("span",{className:"text-sm font-normal text-gray-500",children:"/mo"})]}),c==="annual"&&e.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:["$",l.annualPrice,"/yr billed annually"]}),e.jsx("p",{className:"text-xs text-gray-500 mt-2 mb-2",children:l.tagline}),e.jsx("ul",{className:"text-xs text-gray-600 space-y-1",children:l.highlights.slice(0,5).map(u=>e.jsxs("li",{className:"flex items-start gap-1.5",children:[e.jsx("span",{className:"text-green-500 mt-0.5 shrink-0",children:"✓"}),u]},u))}),e.jsx("div",{className:"mt-2 pt-2 border-t border-gray-100",children:e.jsx("p",{className:"text-xs text-gray-500",children:l.limits.members===null?"Unlimited members (fair use)":`Up to ${ee(l.limits.members)} members`})})]},j)})}),e.jsx("div",{className:"rounded-lg bg-white border border-gray-200 p-3",children:e.jsxs("p",{className:"text-sm text-gray-700",children:["Selected: ",e.jsx("span",{className:"font-semibold",children:L[d]?.name})," at"," ",e.jsxs("span",{className:"font-semibold",children:["$",c==="monthly"?L[d]?.monthlyPrice:L[d]?.annualMonthly,"/mo"]}),c==="annual"&&" (billed annually)","."," ",e.jsx("span",{className:"text-gray-500",children:"After setup, you'll go to Stripe Checkout."})]})})]}):e.jsx("button",{type:"button",onClick:g,className:"w-full text-left rounded-xl border border-dashed border-gray-300 p-4 hover:border-gray-400 transition-colors group",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Skip the trial — pay for a plan now"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"Lock in founding-customer pricing, or commit to an annual plan to save 17%."})]}),e.jsx("span",{className:"text-gray-400 group-hover:text-gray-600 text-sm shrink-0",children:"Choose a plan →"})]})}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-gray-200"})}),e.jsx("div",{className:"relative flex justify-center",children:e.jsx("span",{className:"bg-white px-3 text-xs font-medium text-gray-400 uppercase tracking-wide",children:"Other options"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("a",{href:"mailto:[email protected]",className:"block rounded-lg border border-gray-200 p-3 hover:border-gray-300 transition-colors",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Larger program or multi-org association?"}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"Districts, music associations, > 5 ensembles — let's talk pricing."})]}),e.jsx("span",{className:"text-sm text-band-600 hover:text-band-700 font-medium shrink-0",children:"Contact Sales →"})]})}),e.jsx("div",{className:"rounded-lg border border-gray-200 p-3",children:e.jsx("div",{className:"flex items-start justify-between gap-3",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Want hands-on help getting set up?"}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:[e.jsx("span",{className:"font-medium",children:"Founder Concierge Setup ($99 one-time)"})," — I'll personally walk you through data import, configuration, and a 60-minute training. Add it from the ",e.jsx("span",{className:"font-medium",children:"Billing"})," page anytime after launch."]})]})})})]})]})}const je=[{label:"Identity",required:!0},{label:"Plan",required:!0},{label:"Ensembles",required:!0},{label:"Invite Staff",required:!1},{label:"Launch",required:!0}];function Ee(){const{orgId:t}=ae(),i=te(),{showSuccess:n,showError:d}=se(),c=q(p=>p.loadSession),m=q(p=>p.user),{currentStep:h,draftData:o,isLoading:g,isLaunching:f,loaded:x,loadDraft:j,updateStepData:l,nextStep:s,prevStep:r,setStep:u,launch:b,reset:w}=ie();C.useEffect(()=>(j(t),()=>w()),[t]),C.useEffect(()=>{x&&m?.orgStatus==="active"&&m?.orgId===t&&i("/settings/organizations",{replace:!0})},[x,m?.orgStatus]);const[v,a]=C.useState(null);function N({ensembles:p}){const E=o.ensembles||[];p.length>0&&E.filter(T=>T.name?.trim()).length===0&&l("ensembles",p.map(T=>({name:T.name,description:T.description||""})))}function k(p){const E=ne.find(T=>T.name===p);E&&(a(p),l("branding",{...o.branding||{},...E}))}async function R(){try{await b();const p=o.plan||{},E=p.tier||"essentials";
2if(!p.trialMode&&E){const{PLANS:Z}=await W(async()=>{const{PLANS:O}=await import("./index-_aijvlUq.js").then(D=>D.as);return{PLANS:O}},__vite__mapDeps([0,1])),$=Z[E],B=(p.interval||"monthly")==="annual"?$?.annualPriceId:$?.priceId;if(B){const{billingApi:O}=await W(async()=>{const{billingApi:J}=await import("./index-_aijvlUq.js").then(X=>X.ar);return{billingApi:J}},__vite__mapDeps([0,1]));await c();const D=await O.createCheckout(B);if(!D.updated){if(D.url){window.location.href=D.url;return}}}}n("Organization launched successfully!"),await c(),i("/",{replace:!0})}catch(p){d(p.message||"Launch failed")}}function A(){i("/")}if(g||!x)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:e.jsx("p",{className:"text-gray-500",children:"Loading setup wizard..."})});const S=[e.jsx(ce,{data:o.identity||{},onChange:p=>l("identity",p),onBrandingSuggestion:k,onAnalysisResult:N},"identity"),e.jsx(fe,{data:o.plan||{},onChange:p=>l("plan",p)},"plan"),e.jsx(ue,{data:o.ensembles||[],onChange:p=>l("ensembles",p)},"ensembles"),e.jsx(xe,{data:o.invites||[],onChange:p=>l("invites",p)},"invites"),e.jsx(ge,{draftData:o,onEdit:p=>u(p)},"launch")];return e.jsxs("div",{className:"min-h-screen bg-gray-50 py-8 px-4",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Organization Setup"}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Configure your organization before going live"})]}),e.jsx(re,{steps:je,currentStep:h,onNext:s,onBack:r,onCancel:A,onSkip:s,onSubmit:R,submitLabel:"Launch Organization",isSubmitting:f,maxWidth:"max-w-2xl",children:S[h]})]})}export{Ee as OrgSetupPage};

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.