PageSourceSearch

https://southernfm.com.au/assets/Services-Boan73mW.js

js southernfm.com.au collected 2026-09-24 21:13:25 UTC 12,809 bytes, 1 lines download raw bytes

1import{r as d,j as e,h as P,B as _,A as D,s as B,u as U,k as Y,L as J,S as G,C as O,n as Q,I as X,i as Z,J as ee}from"./index-CysU2Jg9.js";import{P as se}from"./PageHeader-tcsahsuR.js";import{C as te,E as re}from"./EnquiryForm-CmyUN08j.js";import{I as ne}from"./input-UNMuvhAA.js";import{L as ae}from"./label-CLsWIlGF.js";import{T as ie}from"./textarea-BId7pPGh.js";import{l as oe}from"./form-config-DBWkGO_e.js";import{A as le}from"./arrow-left-DtRFkuOL.js";import{S as de}from"./send-2tuXyMJR.js";import{r as z}from"./resolve-icon-CakB_cEu.js";import"./checkbox-BpTkFBno.js";import"./check-CMDL-7uT.js";import"./select-D_KGIcT1.js";import"./upload-rules-Qd9pVdD-.js";import"./map-pin-DCjLi05Y.js";import"./sparkles-CLxxs2QB.js";import"./mic-vocal-B-zapFJF.js";import"./wrench-B8lZnE01.js";const ce="csa-submission",me=new Set(["why","booking","keyInfo","publicContact"]);function H(o){const f=`${o.label??""} ${o.helpText??""}`.match(/max\s+(\d+)\s+words?/i);return f?Number(f[1]):null}function V(o){return o.trim().split(/\s+/).filter(Boolean).length}function ue({compact:o=!1}={}){const[t,f]=d.useState(null),[v,k]=d.useState(!0),[l,A]=d.useState({}),[b,S]=d.useState(0),[p,C]=d.useState(!1),[m,I]=d.useState(!1),[r,x]=d.useState(null);d.useEffect(()=>{(async()=>{const s=await oe(),i=(s==null?void 0:s.intents.find(n=>n.key===ce&&n.active))??null;f(i),k(!1)})()},[]);const a=(t==null?void 0:t.steps)??[],u=d.useMemo(()=>a.flatMap(s=>s.fields),[a]),j=(s,i)=>A(n=>({...n,[s]:i})),w=s=>{const i=(l[s.key]??"").trim();if(s.required&&!i)return!1;const n=H(s);return!(n&&V(i)>n)},c=a[b],E=c?c.fields.every(w):!1,M=u.every(w),$=a.length>0&&b===a.length-1,K=async s=>{var i;if(s.preventDefault(),!!t){if(!$){E&&S(n=>Math.min(n+1,a.length-1));return}if(M){C(!0),x(null);try{const n=u.filter(h=>(l[h.key]??"").trim()).map(h=>({label:h.label,value:l[h.key].trim()})),g=(l.sfmContactEmail??"").trim()||((i=u.find(h=>h.type==="email"&&(l[h.key]??"").trim()))!=null&&i.key?(l[u.find(h=>h.type==="email").key]??"").trim():void 0),L=l.sfmContactName||l.org||null,N=l.sfmContactPhone||null,T=l.keyInfo||null,q=`csa-${crypto.randomUUID()}`;try{await B.from("form_submissions").insert({intent_key:t.key,intent_label:t.label,submitter_name:L,submitter_email:g||null,submitter_phone:N,reply_to:g||null,message:T,details:n,metadata:{idempotencyKey:q,source:"csa-form"}})}catch(h){console.warn("Failed to persist CSA submission",h)}const{error:y}=await B.functions.invoke("send-enquiry-notification",{body:{intentKey:t.key,idempotencyKey:q,replyTo:g,templateData:{intentLabel:t.label,name:L??"",email:g??"",phone:N??"",message:T??"",details:n}}});if(y)throw y;I(!0)}catch(n){console.error("CSA submission failed",n),x("Something went wrong sending your submission. Please try again or email [email protected] directly.")}finally{C(!1)}}}},F=o?"space-y-4":"bg-card rounded-3xl border border-border shadow-sm p-5 md:p-7 space-y-5";if(v)return e.jsx("div",{className:F,children:e.jsxs("div",{className:"flex items-center justify-center py-10 text-muted-foreground",children:[e.jsx(P,{className:"h-4 w-4 animate-spin mr-2"})," Loading form…"]})});if(!t||a.length===0)return e.jsx("div",{className:F,children:e.jsx("div",{className:"py-8 text-center text-muted-foreground text-sm",children:"The CSA submission form is currently unavailable."})});if(m)return e.jsxs("div",{className:"bg-card rounded-3xl border border-border shadow-sm p-8 text-center max-w-2xl mx-auto",children:[e.jsx(te,{className:"h-14 w-14 text-sfm-blue mx-auto mb-3"}),e.jsx("h3",{className:"font-display text-xl font-bold text-foreground mb-2",children:"Thanks!"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Your CSA submission has been sent to the Southern FM team. We'll be in touch shortly."})]});const R=o?"grid grid-cols-1 sm:grid-cols-2 gap-4":"space-y-5";return e.jsxs("form",{onSubmit:K,className:F,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"text-xs uppercase tracking-wide text-muted-foreground font-semibold",children:["Step ",b+1," of ",a.length]}),e.jsx("div",{className:"font-display text-lg font-bold text-foreground",children:c==null?void 0:c.title})]}),e.jsx("div",{className:"flex gap-1.5",children:a.map((s,i)=>e.jsx("span",{className:`h-1.5 w-8 rounded-full transition-colors ${i<=b?"bg-sfm-blue":"bg-muted"}`},i))})]}),e.jsx("div",{className:R,children:c==null?void 0:c.fields.map(s=>{const i=l[s.key]??"",n=H(s),g=n?V(i):0,L=!!(n&&g>n),N=s.type==="textarea",T=!o||N||me.has(s.key),q=s.type==="email"?"email":s.type==="tel"?"tel":"text";return e.jsxs("div",{className:`space-y-1.5 ${T&&o?"sm:col-span-2":""}`,children:[e.jsxs(ae,{htmlFor:`csa-${s.key}`,className:"text-sm font-semibold text-foreground",children:[s.label,s.required&&e.jsx("span",{className:"text-destructive",children:" *"})]}),N?e.jsx(ie,{id:`csa-${s.key}`,value:i,onChange:y=>j(s.key,y.target.value),placeholder:s.placeholder,rows:n?4:2,required:s.required}):e.jsx(ne,{id:`csa-${s.key}`,type:q,value:i,onChange:y=>j(s.key,y.target.value),placeholder:s.placeholder,required:s.required}),(s.helpText||n)&&e.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:s.helpText}),n&&e.jsxs("span",{className:L?"text-destructive font-semibold":"",children:[g,"/",n," words"]})]})]},s.id)})}),r&&e.jsx("div",{className:"text-sm text-destructive bg-destructive/5 border border-destructive/20 rounded-xl p-3",children:r}),e.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2 border-t border-border",children:[e.jsxs(_,{type:"button",variant:"outline",onClick:()=>S(s=>
1Math.max(s-1,0)),disabled:b===0||p,className:"gap-2",children:[e.jsx(le,{className:"h-4 w-4"})," Back"]}),$?e.jsx(_,{type:"submit",size:"lg",disabled:!M||p,className:"gap-2",children:p?e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"h-4 w-4 animate-spin"})," Sending…"]}):e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"h-4 w-4"})," Submit CSA"]})}):e.jsxs(_,{type:"submit",size:"lg",disabled:!E,className:"gap-2",children:["Next ",e.jsx(D,{className:"h-4 w-4"})]})]})]})}const W=()=>{if(typeof window>"u")return 1;const o=window.innerWidth;return o>=1024?5:o>=768?3:1},qe=()=>{const o=U("header_services"),t=Y("services"),f=d.useRef(null),[v,k]=d.useState(null),[l,A]=d.useState(W);d.useEffect(()=>{if(typeof window>"u")return;const r=()=>A(W());return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),d.useEffect(()=>{var w;if(typeof window>"u")return;const r=window.location.hash.replace(/^#/,"");if(!r)return;const[x,a]=r.split("?");if(x==="enquire"){const E=new URLSearchParams(a??"").get("service");(w=f.current)==null||w.prefill({intent:"use-services",service:E??void 0});return}const u=t.services.find(c=>c.key===x);if(u){k(u.key),setTimeout(()=>{var c;(c=document.getElementById(`service-${u.key}`))==null||c.scrollIntoView({behavior:"smooth",block:"start"})},100);return}const j=document.getElementById(x);j&&setTimeout(()=>j.scrollIntoView({behavior:"smooth",block:"start"}),100)},[t.services]);const b=(r,x)=>{var a;x!=="csa"&&((a=f.current)==null||a.prefill({intent:"use-services",service:r}),setTimeout(()=>{var u;(u=document.getElementById("enquire"))==null||u.scrollIntoView({behavior:"smooth",block:"start"})},50))},S=r=>k(x=>x===r?null:r),p=v?t.services.findIndex(r=>r.key===v):-1,C=p>=0?Math.min(Math.floor(p/l)*l+l-1,t.services.length-1):-1,m=p>=0?t.services[p]:null,I=m?z(m.icon):null;return e.jsxs(J,{children:[e.jsx(G,{title:"Services - 88.3 Southern FM",description:"Sponsorship, production and free Community Service Announcements (CSAs) from 88.3 Southern FM.",path:"/about/services"}),e.jsx(se,{title:t.header.title,description:t.header.description,backgroundImage:o.src,backgroundImageSrcSet:o.srcSet}),e.jsx("section",{className:"bg-muted/30",children:e.jsxs("div",{className:"page-content w-full py-10",children:[e.jsxs("div",{className:"max-w-3xl mb-8",children:[e.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold text-foreground mb-3",children:t.intro.heading}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:t.intro.body})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-5 gap-3 mb-12",children:t.services.map((r,x)=>{const a=v===r.key,u=z(r.icon);return e.jsxs(d.Fragment,{children:[e.jsxs("button",{id:`service-${r.key}`,type:"button",onClick:()=>S(r.key),"aria-expanded":a,className:`text-left bg-card rounded-2xl border transition-all duration-200 group overflow-hidden scroll-mt-24 flex flex-row items-center gap-3 p-3 md:flex-col md:items-stretch md:gap-0 md:p-0 ${a?"border-sfm-blue shadow-md":"border-border hover:border-sfm-blue/40 hover:shadow-sm"}`,children:[e.jsx("div",{className:"h-11 w-11 flex-shrink-0 rounded-xl flex items-center justify-center bg-gradient-to-br from-sfm-blue/10 to-sfm-blue/5 md:h-auto md:w-full md:flex-shrink md:rounded-none md:aspect-[4/3]",children:e.jsx(u,{className:"h-5 w-5 text-sfm-blue md:h-10 md:w-10"})}),e.jsx("div",{className:"flex-1 min-w-0 md:p-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("h3",{className:"font-display text-sm font-bold text-foreground md:min-h-[3.75rem] md:flex md:items-center",children:r.title}),e.jsx(O,{className:`h-4 w-4 text-muted-foreground transition-transform duration-200 flex-shrink-0 ${a?"rotate-180":""}`})]})})]}),x===C&&m&&e.jsx("div",{className:"md:col-span-3 lg:col-span-5 bg-card rounded-3xl border border-border shadow-sm overflow-hidden animate-in fade-in slide-in-from-top-2 duration-200",children:e.jsxs("div",{className:"p-6 md:p-8",children:[I&&e.jsxs("div",{className:"hidden md:flex items-center gap-3 mb-4",children:[e.jsx("div",{className:"h-12 w-12 rounded-2xl bg-sfm-blue/10 flex items-center justify-center",children:e.jsx(I,{className:"h-6 w-6 text-sfm-blue"})}),e.jsx("h2",{className:"font-display text-2xl font-bold text-foreground",children:m.title})]}),e.jsx("p",{className:"font-display text-lg font-bold text-foreground mb-3 md:font-sans md:text-base md:font-normal md:text-muted-foreground",children:m.short}
1),e.jsx("div",{className:"text-sm text-foreground/85 leading-relaxed [&_p]:mb-3 [&_p:last-child]:mb-0 [&_strong]:text-foreground",dangerouslySetInnerHTML:{__html:Q(m.details)}}),m.key==="csa"?e.jsxs("div",{className:"mt-6 space-y-6",children:[e.jsxs("div",{className:"rounded-2xl bg-sfm-blue/5 border border-sfm-blue/15 p-5 md:p-6",children:[e.jsx("h3",{className:"font-display text-lg font-bold text-foreground mb-1",children:"Submit a Community Service Announcement"}),e.jsxs("p",{className:"text-sm text-muted-foreground mb-5",children:["Submissions go straight to"," ",e.jsx("a",{href:"mailto:[email protected]",className:"text-sfm-blue font-semibold hover:underline",children:"[email protected]"}),"."]}),e.jsx(ue,{compact:!0})]}),e.jsxs("div",{className:"rounded-2xl border border-amber-300/60 bg-amber-50 p-5 md:p-6 flex gap-4",children:[e.jsx("div",{className:"h-9 w-9 rounded-xl bg-amber-100 flex items-center justify-center flex-shrink-0",children:e.jsx(X,{className:"h-5 w-5 text-amber-700"})}),e.jsxs("div",{className:"flex-1 min-w-0 text-sm text-amber-950 leading-relaxed break-words",children:[e.jsx("p",{className:"font-semibold mb-1",children:"Is this an advertisement for a business or for-profit enterprise?"}),e.jsxs("p",{children:["If yes, please note that CSAs are accepted at the discretion of Southern FM in line with the CBAA Codes of Practice 2025. To support us with your sponsorship, please visit the"," ",e.jsx(Z,{to:"/support/sponsorship",className:"font-semibold underline hover:text-amber-900",children:"Sponsorship"})," ","page or contact"," ",e.jsx("a",{href:"mailto:[email protected]",className:"font-semibold underline hover:text-amber-900",children:"[email protected]"}),"."]})]})]})]}):e.jsx("div",{className:"mt-6",children:e.jsxs(_,{variant:"hero",size:"lg",onClick:()=>b(m.title,m.key),children:["Enquire about ",m.title]})})]})},`${m.key}-details`)]},r.key)})})]})}),e.jsx("section",{id:"enquire",className:"scroll-mt-24 bg-muted/30 py-12",children:e.jsxs("div",{className:"page-content w-full",children:[e.jsxs("div",{className:"mb-6 max-w-3xl",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-xs font-bold text-primary uppercase tracking-widest mb-3",children:[e.jsx(ee,{className:"h-3.5 w-3.5"})," ",t.enquireHeading.eyebrow]}),e.jsx("h2",{className:"font-display text-2xl md:text-3xl font-bold text-foreground mb-2",children:t.enquireHeading.heading}),e.jsx("p",{className:"text-muted-foreground",children:t.enquireHeading.body})]}),e.jsx(re,{ref:f,defaultIntent:"use-services"})]})})]})};export{qe 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.