1(()=>{"use strict";var e={1081:(e,t,s)=>{s.d(t,{A:()=>o});s(65043);var a=s(44632),n=s(92330),r=s(28814),i=s(70579);const o=()=>{const e=[{name:"Facebook",url:"https://www.facebook.com/turbo.au",icon:a.A,bg:"#1877F2"},{name:"Instagram",url:"https://instagram.com/turbo360au",icon:n.A,bg:"linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888)"},{name:"LinkedIn",url:"https://www.linkedin.com/company/turbo360/",icon:r.A,bg:"#0A66C2"}];return(0,i.jsx)("div",{className:"fixed bottom-0 left-0 z-[100000] flex items-center gap-2 px-4",style:{height:"40px"},children:e.map(e=>{const t=e.icon;return(0,i.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-6 h-6 rounded hover:opacity-80 transition-opacity duration-200",style:{background:e.bg},"aria-label":"Follow us on ".concat(e.name),children:(0,i.jsx)(t,{className:"w-3.5 h-3.5 text-white"})},e.name)})})}},1089:(e,t,s)=>{s.d(t,{cn:()=>r});var a=s(58387),n=s(89359);function r(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,n.QP)((0,a.$)(t))}},1312:(e,t,s)=>{s.d(t,{A:()=>f});var a=s(65043),n=s(25352),r=s(44632),i=s(92330),o=s(28814),l=s(40614),c=s(70316),d=s(63572),m=s(70579);const p={instagram:i.A,linkedin:o.A,facebook:r.A},x=[{heading:"Services",items:[{name:"Conference Photography",to:"/services/conference-photography"},{name:"Exhibition Photography",to:"/services/exhibition-photography"},{name:"Corporate Events",to:"/services/corporate-event-photography"},{name:"Corporate Headshots",to:"/services/corporate-headshots"},{name:"Event Coverage",to:"/services/event-coverage"},{name:"Video Production Melbourne",to:"/video-production-melbourne"},{name:"All Services",to:"/services"}]},{heading:"Industries",items:[{name:"Business",to:"/business"},{name:"Conferences",to:"/conferences"},{name:"Schools",to:"/schools"},{name:"Development",to:"/development"},{name:"Weddings",href:"https://weddings.turbo.net.au"}]},{heading:"Coverage",items:[{name:"Sydney",to:"/services/locations/sydney"},{name:"Melbourne",to:"/services/locations/melbourne"},{name:"Brisbane",to:"/services/locations/brisbane"},{name:"Perth",to:"/services/locations/perth"},{name:"Adelaide",to:"/services/locations/adelaide"},{name:"Canberra",to:"/services/locations/canberra"},{name:"Hobart",to:"/services/locations/hobart"},{name:"Darwin",to:"/services/locations/darwin"},{name:"Geelong",to:"/services/locations/geelong"}]},{heading:"Company",items:[{name:"Recent Gigs",to:"/recent-gigs"},{name:"About",to:"/about"},{name:"Get a Quote",to:"/get-quote"}]}],h=2*Math.PI*15,u=e=>{const t="blur(".concat(Math.round(18*e),"px)");return{background:"rgba(10,10,11,".concat((.72*e).toFixed(2),")"),backdropFilter:t,WebkitBackdropFilter:t,borderBottom:"1px solid rgba(255,255,255,".concat((.08*e).toFixed(2),")")}};function g(e){let{item:t,onClick:s}=e;const a="font-head text-[19px] font-semibold leading-[1.25] text-silver transition-[color,transform] duration-300 ease-turbo hover:translate-x-1.5 hover:text-turbo-red md:text-[22px]";return t.to?(0,m.jsx)(n.N_,{to:t.to,onClick:s,className:a,children:t.name}):(0,m.jsx)("a",{href:t.href,onClick:s,className:a,children:t.name})}function f(e){let{heroProgress:t}=e;const[s,r]=(0,a.useState)(!1),i=()=>r(!1),o=(0,a.useRef)(null),f=(0,a.useRef)(null),b=(0,a.useRef)({solid:-1,dash:""});return(0,d.s0)(e=>{const s=b.current,a=o.current;if(t&&a){const n=Math.round(100*Math.min(1,2*t(e)))/100;if(n!==s.solid){s.solid=n;const e=u(n);a.style.background=e.background,a.style.backdropFilter=e.backdropFilter,a.style.webkitBackdropFilter=e.backdropFilter,a.style.borderBottom=e.borderBottom}}const n="".concat((Math.min(1,e.y/e.docH)*h).toFixed(1)," ").concat(h);e.vw>=768&&f.current&&n!==s.dash&&(s.dash=n,f.current.setAttribute("stroke-dasharray",n))}),(0,a.useEffect)(()=>{if("undefined"===typeof document)return;const e=e=>{"Escape"===e.key&&r(!1)};return window.addEventListener("keydown",e),document.body.style.overflow=s?"hidden":"",()=>{window.removeEventListener("keydown",e),document.body.style.overflow=""}},[s]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("nav",{ref:o,className:"fixed inset-x-0 top-0 z-[100002] flex h-[76px] items-center justify-between px-7 transition-[background-color,border-color] duration-300",style:u(t?0:1),children:[(0,m.jsx)(n.N_,{to:"/","aria-label":"Turbo 360 home",className:"flex items-center",children:(0,m.jsx)("img",{src:"/turbo-logo-dark.png",alt:"Turbo 360",className:"block h-auto w-[200px]"})}),(0,m.jsxs)("div",{className:"flex items-center gap-[18px]",children:[(0,m.jsxs)("svg",{viewBox:"0 0 36 36","aria-hidden":"true",className:"hidden h-8 w-8 md:block",children:[(0,m.jsx)("circle",{cx:"18",cy:"18",r:"15",fill:"none",stroke:"rgba(255,255,255,.18)",strokeWidth:"2"}),(0,m.jsx)("circle",{ref:f,cx:"18",cy:"18",r:"15",fill:"none",stroke:"#BF212F",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"0 ".concat(h),transform:"rotate(-90 18 18)"}),(0,m.jsx)("circle",{cx:"18",cy:"18",r:"3",fill:"#BF212F"})]}),(0,m.jsx)(n.N_,{to:"/get-quote",className:"hidden rounded-full border border-smoke px-5 py-3 font-head text-[13px] font-bold text-smoke transition-[background-color,border-color] duration-300 hover:border-turbo-red hover:bg-turbo-red md:inline-block",children:"Get a quote"}),(0,m.jsxs)("button",{type:"button",onClick:()=>r(e=>!e),"aria-label":s?"Close menu":"Open menu","aria-expanded":s,className:"relative z-[1] flex items-center gap-3 px-1 py-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-turbo-red",children:[(0,m.jsx)("span",{className:"font-mono text-xs font-bold uppercase tracking-[0.22em] text-smoke",children:s?"Close":"Menu"}),s?(0,m.jsx)(l.A,{size:22,className:"text-smoke"}):(0,m.jsxs)("span",{className:"flex w-[26px] flex-col items-end gap-[6px]",children:[(0,m.jsx)("span",{className:"block h-[2px] w-[26px] rounded bg-smoke"}),(0,m.jsx)("span",{className:"block h-[2px] w-[18px] rounded bg-smoke"})]})]})]})]}),(0,m.jsxs)("div",{className:"fixed inset-0 z-[100001] flex min-h-screen flex-col overflow-y-auto bg-[#0d0d0d]/[0.98] backdrop-blur-md transition-[opacity,visibility] duration-500 ease-turbo ".concat(s?"visible opacity-100":"invisible opacity-0"),"aria-hidden":!s,children:[(0,m.jsx)("div",{className:"absolute inset-x-0 top-0 h-1",style:{background:"linear-gradient(90deg,#BF212F 0 40%,#F2A900 40% 70%,#0FA3A3 70% 100%)"}}),(0,m.jsx)("svg",{viewBox:"0 0 600 600","aria-hidden":"true",className:"pointer-events-none absolute bottom-[-18vw] right-[-18vw] hidden h-[60vw] w-[60vw] opacity-35 md:block",children:(0,m.jsxs)("g",{className:"origin-[300px_300px] animate-spin-90 motion-reduce:animate-none",children:[(0,m.jsx)("circle",{cx:"300",cy:"300",r:"290",fill:"none",stroke:"rgba(255,255,255,.14)",strokeWidth:"1"}),(0,m.jsx)("circle",{cx:"300",cy:"300",r:"230",fill:"none",stroke:"#BF212F",strokeWidth:"1",strokeDasharray:"2 10"}),(0,m.jsx)("circle",{cx:"300",cy:"300",r:"160",fill:"none",stroke:"rgba(255,255,255,.14)",strokeWidth:"1"})]})}),(0,m.jsx)("div",{className:"relative mx-auto grid w-full max-w-7xl grid-cols-2 gap-x-8 gap-y-10 px-[22px] pb-[clamp(24px,5vh,56px)] pt-[96px] md:grid-cols-4 md:gap-x-10 md:gap-y-12 md:px-11 md:pt-[120px]",children:x.map((e,t)=>(0,m.jsxs)("div",{className:"flex flex-col gap-3.5 transition-[opacity,transform] duration-[600ms] ease-turbo ".concat(s?"translate-y-0 opacity-100":"translate-y-6 opacity-0"),style:{transitionDelay:s?"".concat(.08+.07*t,"s"):"0s"},children:[(0,m.jsx)("div",{className:"mb-1 font-mono text-[11px] uppercase tracking-[0.24em] text-turbo-red",children:e.heading}),e.items.map(e=>(0,m.jsx)(g,{item:e,onClick:i},e.name))]},e.heading))}),(0,m.jsx)("div",{className:"relative mt-auto border-t border-white/10",children:(0,m.jsxs)("div",{className:"mx-auto flex w-full max-w-7xl flex-col gap-6 px-[22px] pb-12 pt-7 md:flex-row md:items-center md:justify-between md:px-11",children:[(0,m.jsxs)("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:[(0,m.jsx)("a",{href:"tel:1300207446",className:"font-head text-lg font-bold text-smoke hover:text-turbo-red",children:"1300 207 446"}),(0,m.jsx)("a",{href:"mailto:[email protected]",className:"text-[15px] text-silver hover:text-smoke",children:"[email protected]"}),(0,m.jsx)("span",{className:"hidden font-mono text-[11px] uppercase tracking-[0.22em] text-turbo-red md:inline",children:"Every angle. Full speed."})]}),(0,m.jsxs)("div",{className:"flex items-center gap-4",children:[(0,m.jsx)("div",{className:"flex gap-3",children:c.FJ.socialLinks.map(e=>{const t=p[e.icon];return t?(0,m.jsx)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":"Turbo 360 on ".concat(e.platform),title:"Turbo 360 on ".concat(e.platform),className:"flex h-[38px] w-[38px] items-center justify-center rounded-full border border-[#2B2B2B] text-silver transition-colors hover:border-turbo-red hover:text-smoke",children:(0,m.jsx)(t,{size:15})},e.platform):null})}),(0,m.jsx)(n.N_,{to:"/get-quote",onClick:i,className:"rounded-full bg-turbo-red px-[26px] py-[13px] font-head text-[15px] font-bold text-white transition-[transform,background-color] duration-[400ms] ease-turbo hover:-translate-y-[3px] hover:bg-redline",children:"Get a quote \u2192"})]})]})})]})]})}},9624:(e,t,s)=>{s.d(t,{A:()=>i,p:()=>r});s(65043);var a=s(49367),n=s(70579);const r={home:{title:"Same-Day Event Photography Australia",description:"Australia's same-day event photography & video. 25+ years, 180+ 5\u2605 reviews. Conference, corporate & wedding photographers in every capital. Free quote.",keywords:"360 video production, 360 photography, 360 photo production, same-day event photography, same-day video production, turbo 360 photographers, event photography, video production, same day delivery, conference photography, wedding photographer, corporate events, Brisbane photographer, Australia, live streaming, professional photographer",canonical:"/",structuredData:{"@context":"https://schema.org","@type":"ProfessionalService",name:"Turbo 360",legalName:"Turbo Productions PTY LTD",description:"Turbo 360 is Australia's leading same-day event photography and video production company. With over 25 years of experience,
1180+ five-star reviews, and coverage across all eight Australian capital cities plus New Zealand and Singapore, Turbo 360 delivers professionally edited photos and videos within hours of your event \u2014 not weeks. Trusted by Fortune 500 companies and government organisations for conferences, weddings, corporate events, and schools.",url:"https://turbo.net.au",logo:"https://turbo.net.au/turbo-logo-new.png",image:"https://turbo.net.au/og-image.jpg",telephone:"+61-1300-207-446",email:"[email protected]",foundingDate:"1999",address:{"@type":"PostalAddress",addressLocality:"Barwon Heads",addressRegion:"Victoria",postalCode:"3227",addressCountry:"AU"},areaServed:[{"@type":"City",name:"Brisbane"},{"@type":"City",name:"Sydney"},{"@type":"City",name:"Melbourne"},{"@type":"City",name:"Perth"},{"@type":"City",name:"Adelaide"},{"@type":"City",name:"Gold Coast"},{"@type":"City",name:"Canberra"},{"@type":"City",name:"Hobart"},{"@type":"Country",name:"New Zealand"},{"@type":"Country",name:"Singapore"}],priceRange:"$$",contactPoint:{"@type":"ContactPoint",telephone:"+61-1300-207-446",contactType:"sales",email:"[email protected]",areaServed:"AU",availableLanguage:"English"},aggregateRating:{"@type":"AggregateRating",ratingValue:"5",reviewCount:"180",bestRating:"5"},hasOfferCatalog:{"@type":"OfferCatalog",name:"Event Photography & Video Services",itemListElement:[{"@type":"Offer",itemOffered:{"@type":"Service",name:"Conference Photography",description:"Same-day conference photography with multi-camera coverage"}},{"@type":"Offer",itemOffered:{"@type":"Service",name:"Wedding Photography & Videography",description:"Cinematic wedding photography and same-day highlight videos"}},{"@type":"Offer",itemOffered:{"@type":"Service",name:"Corporate Event Photography",description:"Professional corporate video production and headshots"}},{"@type":"Offer",itemOffered:{"@type":"Service",name:"Live Streaming",description:"Multi-camera live streaming for conferences and events"}},{"@type":"Offer",itemOffered:{"@type":"Service",name:"School Photography",description:"Virtual tours, graduations, and school event coverage"}}]},knowsAbout:["Event Photography","Event Videography","Same-Day Photo Delivery","Conference Photography","Exhibition Photography","Corporate Video Production","Wedding Photography","Wedding Videography","Live Streaming","Drone Photography","Corporate Headshots","School Virtual Tours","Facial Recognition Photo Galleries","Social Media Content Production"],sameAs:["https://www.instagram.com/turbo360au","https://www.facebook.com/turbo.au","https://www.linkedin.com/company/turbo360"]}},about:{title:"About Turbo 360 Photographers | 25+ Years of Event Production",description:"25+ years of same-day event photography & video production. 180+ five-star reviews. Founded by James 'Turbo' Anderson \u2014 trusted by Fortune 500 companies across Australia, NZ & Singapore.",keywords:"about turbo 360, turbo 360 photographers, james turbo anderson, professional photography team, experienced event photographers, Australian photography company, event production company, 25 years experience",canonical:"/about"},conferences:{title:"Conference Photographer Australia | Same-Day Photos & Video",description:"Conference photography and video across Australia, with same-day edits, multi-camera coverage, AI galleries and hourly social reels. Get a fast quote.",keywords:"conference photography, conference videography, same day delivery, exhibition photography, live photo streaming, conference photographer Brisbane, conference photographer Melbourne, conference photographer Sydney, corporate event photography",canonical:"/conferences"},weddings:{title:"Wedding Photography & Videography Australia",description:"Cinematic wedding photography & videography with same-day highlight videos and drone footage. 180+ five-star reviews. Brisbane, Sydney, Melbourne & Australia-wide. Free consultation.",keywords:"wedding photography, wedding videography, wedding photographer Australia, wedding photographer Brisbane, cinematic wedding films, drone wedding photography, same day wedding highlights",canonical:"/weddings"},business:{title:"Corporate Video Production & Photography | Same-Day Delivery",description:"Professional corporate video production, business photography, headsh
1ots & promotional content with same-day delivery. Testimonial videos, brand content & social media reels. Brisbane, Sydney, Melbourne & all Australian cities.",keywords:"corporate photography, business headshots, corporate video production, Brisbane corporate photographer, promotional videos, business content creation, corporate event photography",canonical:"/business"},schools:{title:"School Photography, Virtual Tours & Video Production",description:"School photography, 360 virtual tours, graduation filming & live streaming across Australia. Interactive school tours for enrolment marketing. Sports days, productions & events. Same-day delivery.",keywords:"school photography, school virtual tours, graduation photography, school event photography, sports day photographer, school video production, Melbourne school photographer",canonical:"/schools"},packages:{title:"Event Photography & Video Packages",description:"Event photography and video packages with transparent pricing. Same-day delivery, multi-camera setups and live streaming. Build your custom package.",keywords:"photography packages, videography pricing, event photography packages, custom photography package, conference photography pricing, wedding photography packages, same day delivery",canonical:"/packages"},quote:{title:"Get a Free Event Photography Quote",description:"Request a free quote for event photography and video production. Melbourne HQ, crews in every Australian capital. Fast response, transparent pricing.",keywords:"photography quote, free quote, event photography pricing, get a quote, photography estimate, videography quote, Melbourne photographer quote, Australia-wide photography quote",canonical:"/get-quote"},development:{rawTitle:"Development Services | Apps & Websites | Turbo 360",description:"Websites and native iOS & Android apps built, hosted and maintained by Turbo 360 \u2014 plus hacked, slow or broken website recovery for businesses across Australia.",keywords:"website development, app development, iOS app development, Android app development, web development, website maintenance, website hosting, website security, hacked website repair, malware removal, website recovery, React, Next.js, Turbo 360, Australia",canonical:"/development",ogImage:"https://turbo.net.au/development-code.jpg"}},i=e=>{let{title:t,rawTitle:s,description:r,keywords:i,canonical:o,ogImage:l,ogType:c="website",geo:d,structuredData:m,noIndex:p=!1}=e;const x="https://turbo.net.au",h=s||(t?"".concat(t," | Turbo 360"):"Turbo 360 | Same-Day Event Photography & Video Production | Australia, New Zealand, Singapore"),u=o?o.startsWith("http")?o:"".concat(x).concat(o):x,g=l||"https://turbo.net.au/og-image.jpg",f=Array.isArray(m)?m:m?[m]:[];return(0,n.jsxs)(a.mg,{children:[(0,n.jsx)("title",{children:h}),(0,n.jsx)("meta",{name:"description",content:r}),i&&(0,n.jsx)("meta",{name:"keywords",content:i}),(0,n.jsx)("link",{rel:"canonical",href:u}),p?(0,n.jsx)("meta",{name:"robots",content:"noindex, nofollow"}):(0,n.jsx)("meta",{name:"robots",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),d&&d.region&&(0,n.jsx)("meta",{name:"geo.region",content:d.region}),d&&d.placename&&(0,n.jsx)("meta",{name:"geo.placename",content:d.placename}),(0,n.jsx)("meta",{property:"og:type",content:c}),(0,n.jsx)("meta",{property:"og:url",content:u}),(0,n.jsx)("meta",{property:"og:title",content:h}),(0,n.jsx)("meta",{property:"og:description",content:r}),(0,n.jsx)("meta",{property:"og:image",content:g}),(0,n.jsx)("meta",{property:"og:site_name",content:"Turbo 360"}),(0,n.jsx)("meta",{property:"og:locale",content:"en_AU"}),(0,n.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,n.jsx)("meta",{name:"twitter:url",content:u}),(0,n.jsx)("meta",{name:"twitter:title",content:h}),(0,n.jsx)("meta",{name:"twitter:description",content:r}),(0,n.jsx)("meta",{name:"twitter:image",content:g}),(0,n.jsx)("meta",{name:"twitter:site",content:"@turbo360au"}),f.map((e,t)=>(0,n.jsx)("script",{type:"application/ld+json",children:JSON.stringify(e)},t))]})}},13390:(e,t,s)=>{s.d(t,{$:()=>p});var a=s(89379),n=s(53986),r=s(65043),i=s(16851),o=s(10917),l=s(1089),c=s(70579);const d=["className","variant","size","asChild"],m=(0,o.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),p=r.forwardRef((e,t)=>
1{let{className:s,variant:r,size:o,asChild:p=!1}=e,x=(0,n.A)(e,d);const h=p?i.DX:"button";return(0,c.jsx)(h,(0,a.A)({className:(0,l.cn)(m({variant:r,size:o,className:s})),ref:t},x))});p.displayName="Button"},17931:(e,t,s)=>{s.d(t,{Bx:()=>u,KH:()=>l,vl:()=>h});var a=s(53986),n=s(89379),r=s(65043),i=s(70579);const o=["_savedAt"],l=.25,c="turbo_wedding_booking_draft",d=864e5,m={currentStep:1,selectedPackage:null,customerDetails:null,termsAccepted:!1,bookingId:null,clientSecret:null,paymentCompleted:!1,direction:"forward"};function p(e,t){switch(t.type){case"GO_NEXT":return(0,n.A)((0,n.A)((0,n.A)({},e),t.payload),{},{currentStep:e.currentStep+1,direction:"forward"});case"GO_BACK":return(0,n.A)((0,n.A)({},e),{},{currentStep:e.currentStep-1,direction:"backward"});case"UPDATE_DATA":return(0,n.A)((0,n.A)({},e),t.payload);case"RESET":return(0,n.A)({},m);case"RESTORE":return(0,n.A)((0,n.A)({},m),t.payload);default:return e}}const x=(0,r.createContext)(null);function h(e){let{children:t}=e;const[s,l]=(0,r.useReducer)(p,m),h=(0,r.useRef)(null),u=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!u.current){u.current=!0;try{const e=localStorage.getItem(c);if(e){const t=JSON.parse(e);if(t._savedAt&&Date.now()-t._savedAt<d){const{_savedAt:e}=t,s=(0,a.A)(t,o);s.currentStep>3&&(s.currentStep=3),l({type:"RESTORE",payload:s})}else localStorage.removeItem(c)}}catch(e){localStorage.removeItem(c)}}},[]),(0,r.useEffect)(()=>{if(!(s.currentStep>=4))return h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{try{const e={selectedPackage:s.selectedPackage,customerDetails:s.
1customerDetails,termsAccepted:s.termsAccepted,currentStep:s.currentStep,_savedAt:Date.now()};localStorage.setItem(c,JSON.stringify(e))}catch(e){}},500),()=>{h.current&&clearTimeout(h.current)}},[s.selectedPackage,s.customerDetails,s.termsAccepted,s.currentStep]);const g=(0,r.useCallback)(function(){l({type:"GO_NEXT",payload:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}})},[]),f=(0,r.useCallback)(()=>{l({type:"GO_BACK"})},[]),b=(0,r.useCallback)(e=>{l({type:"UPDATE_DATA",payload:e})},[]),y=(0,r.useCallback)(()=>{l({type:"RESET"}),localStorage.removeItem(c)},[]),v=(0,n.A)((0,n.A)({},s),{},{goNext:g,goBack:f,updateData:b,resetBooking:y});return(0,i.jsx)(x.Provider,{value:v,children:t})}function u(){const e=(0,r.useContext)(x);if(!e)throw new Error("useBooking must be used within a BookingProvider");return e}},20081:(e,t,s)=>{s.d(t,{A:()=>r});s(65043);var a=s(49367),n=s(70579);const r=e=>{let{faqs:t,heading:s,variant:r,tone:i="carbon",eyebrow:o,id:l}=e;if(!t||0===t.length)return null;const c={"@context":"https://schema.org","@type":"FAQPage",mainEntity:t.map(e=>({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))};if("v2"===r){const e="carbon-900"===i?"bg-carbon-900":"bg-carbon";return(0,n.jsxs)("section",{id:l,className:"border-b border-[#222] px-5 py-16 md:px-9 md:py-20 xl:px-14 xl:py-[110px] ".concat(e),children:[(0,n.jsx)(a.mg,{children:(0,n.jsx)("script",{type:"application/ld+json",children:JSON.stringify(c)})}),o&&(0,n.jsx)("div",{className:"mb-[18px] font-mono text-xs uppercase tracking-[0.24em] text-turbo-red",children:o}),s&&(0,n.jsx)("h2",{className:"m-0 mb-8 font-display text-[34px] font-black uppercase leading-[0.96] tracking-[-0.025em] text-smoke md:mb-[46px] md:text-[48px] xl:text-[56px]",children:s}),(0,n.jsx)("div",{className:"grid max-w-[1180px] grid-cols-1 gap-[22px] md:grid-cols-2 md:gap-x-[46px] md:gap-y-6",children:t.map((e,t)=>(0,n.jsxs)("div",{className:"border-t border-[#262626] pt-[22px]",children:[(0,n.jsx)("h3",{className:"m-0 mb-2.5 font-head text-[19px] font-bold text-smoke",children:e.q}),(0,n.jsx)("p",{className:"m-0 text-[15px] leading-[1.6] text-[#9C9A95] [text-wrap:pretty]",children:e.a})]},t))})]})}return(0,n.jsxs)("section",{className:"py-20 bg-black border-t border-gray-800",children:[(0,n.jsx)(a.mg,{children:(0,n.jsx)("script",{type:"application/ld+json",children:JSON.stringify(c)})}),(0,n.jsxs)("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,n.jsx)("div",{className:"text-center mb-12",children:(0,n.jsx)("h2",{className:"text-3xl md:text-4xl font-black mb-4",children:s?(0,n.jsx)("span",{className:"bg-gradient-to-r from-white to-gray-300 bg-clip-text text-transparent",children:s}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"bg-gradient-to-r from-white to-gray-300 bg-clip-text text-transparent",children:"FREQUENTLY ASKED "}),(0,n.jsx)("span",{className:"bg-gradient-to-r from-turbo-red to-orange-500 bg-clip-text text-transparent",children:"QUESTIONS"})]})})}),(0,n.jsx)("div",{className:"space-y-4",children:t.map((e,t)=>(0,n.jsxs)("details",{className:"group bg-gray-900 border border-gray-800 rounded-xl p-5 open:border-orange-400/50 transition-colors",children:[(0,n.jsxs)("summary",{className:"cursor-pointer list-none flex items-start justify-between text-white font-semibold text-lg",children:[(0,n.jsx)("span",{children:e.q}),(0,n.jsx)("span",{className:"ml-4 text-orange-400 text-2xl leading-none group-open:rotate-45 transition-transform",children:"+"})]}),(0,n.jsx)("p",{className:"text-gray-400 mt-3 leading-relaxed whitespace-pre-line",children:e.a})]},t))})]})]})}},21732:(e,t,s)=>{s.d(t,{Jf:()=>m,Y8:()=>d});var a=s(44604);const n=[{citySlug:"melbourne",slug:"centrepiece-at-melbourne-park",name:"CENTREPIECE at Melbourne Park"},{citySlug:"melbourne",slug:"crown-melbourne",name:"Crown Melbourne"},{citySlug:"melbourne",slug:"eureka-89",name:"Eureka 89"},{citySlug:"melbourne",slug:"flemington-racecourse",name:"Flemington Racecourse"},{citySlug:"melbourne",slug:"grand-hyatt-melbourne",name:"Grand Hyatt Melbourne"},{citySlug:"melbourne",slug:"leonda-by-the-yarra",name:"Leonda by the Yarra"},{citySlug:"melbourne",slug:"marvel-stadium",name:"Marvel Stadium"},{citySlug:"melbourne",slug:"mcec",name:"MCEC"},{citySlug:"melbourne",slug:"mcg",name:"MCG"},{citySlug:"melbourne",slug:"melbourne-museum",name:"Melbourne Museum"}
1,{citySlug:"melbourne",slug:"melbourne-showgrounds",name:"Melbourne Showgrounds"},{citySlug:"melbourne",slug:"melbourne-town-hall",name:"Melbourne Town Hall"},{citySlug:"melbourne",slug:"metropolis-events",name:"Metropolis Events"},{citySlug:"melbourne",slug:"ngv-international",name:"NGV International"},{citySlug:"melbourne",slug:"rod-laver-arena",name:"Rod Laver Arena"},{citySlug:"melbourne",slug:"royal-exhibition-building",name:"Royal Exhibition Building"},{citySlug:"melbourne",slug:"sofitel-melbourne-on-collins",name:"Sofitel Melbourne on Collins"},{citySlug:"melbourne",slug:"the-langham-melbourne",name:"The Langham Melbourne"},{citySlug:"melbourne",slug:"the-timber-yard",name:"The Timber Yard"},{citySlug:"melbourne",slug:"zinc-at-federation-square",name:"ZINC at Federation Square"},{citySlug:"sydney",slug:"accor-stadium",name:"Accor Stadium"},{citySlug:"sydney",slug:"carriageworks",name:"Carriageworks"},{citySlug:"sydney",slug:"cockatoo-island",name:"Cockatoo Island"},{citySlug:"sydney",slug:"crown-sydney",name:"Crown Sydney"},{citySlug:"sydney",slug:"doltone-house-darling-island",name:"Doltone House Darling Island"},{citySlug:"sydney",slug:"doltone-house-jones-bay-wharf",name:"Doltone House Jones Bay Wharf"},{citySlug:"sydney",slug:"four-seasons-hotel-sydney",name:"Four Seasons Hotel Sydney"},{citySlug:"sydney",slug:"hilton-sydney",name:"Hilton Sydney"},{citySlug:"sydney",slug:"icc-sydney",name:"ICC Sydney"},{citySlug:"sydney",slug:"luna-park-sydney",name:"Luna Park Sydney"},{citySlug:"sydney",slug:"qudos-bank-arena",name:"Qudos Bank Arena"},{citySlug:"sydney",slug:"royal-randwick-racecourse",name:"Royal Randwick Racecourse"},{citySlug:"sydney",slug:"shangri-la-sydney",name:"Shangri-La Sydney"},{citySlug:"sydney",slug:"sheraton-grand-sydney-hyde-park",name:"Sheraton Grand Sydney Hyde Park"},{citySlug:"sydney",slug:"sydney-cricket-ground",name:"Sydney Cricket Ground"},{citySlug:"sydney",slug:"sydney-opera-house",name:"Sydney Opera House"},{citySlug:"sydney",slug:"sydney-town-hall",name:"Sydney Town Hall"},{citySlug:"sydney",slug:"taronga-zoo-sydney",name:"Taronga Zoo Sydney"},{citySlug:"sydney",slug:"the-cutaway-at-barangaroo",name:"The Cutaway at Barangaroo"},{citySlug:"sydney",slug:"the-star-event-centre",name:"The Star Event Centre"},{citySlug:"brisbane",slug:"bcec",name:"BCEC"},{citySlug:"brisbane",slug:"brisbane-city-hall",name:"Brisbane City Hall"},{citySlug:"brisbane",slug:"brisbane-entertainment-centre",name:"Brisbane Entertainment Centre"},{citySlug:"brisbane",slug:"brisbane-powerhouse",name:"Brisbane Powerhouse"},{citySlug:"brisbane",slug:"cloudland",name:"Cloudland"},{citySlug:"brisbane",slug:"customs-house",name:"Customs House"},{citySlug:"brisbane",slug:"eagle-farm-racecourse",name:"Eagle Farm Racecourse"},{citySlug:"brisbane",slug:"emporium-hotel-south-bank",name:"Emporium Hotel South Bank"},{citySlug:"brisbane",slug:"howard-smith-wharves",name:"Howard Smith Wharves"},{citySlug:"brisbane",slug:"qagoma",name:"QAGOMA"},{citySlug:"brisbane",slug:"qpac",name:"QPAC"},{citySlug:"brisbane",slug:"rna",name:"Brisbane Showgrounds (RNA)"},{citySlug:"brisbane",slug:"royal-international-convention-centre",name:"Royal International Convention Centre"},{citySlug:"brisbane",slug:"sofitel-brisbane-central",name:"Sofitel Brisbane Central"},{citySlug:"brisbane",slug:"suncorp-stadium",name:"Suncorp Stadium"},{citySlug:"brisbane",slug:"the-calile-hotel",name:"The Calile Hotel"},{citySlug:"brisbane",slug:"the-fortitude-music-hall",name:"The Fortitude Music Hall"},{citySlug:"brisbane",slug:"the-gabba",name:"The Gabba"},{citySlug:"brisbane",slug:"the-star-brisbane-event-centre",name:"The Star Brisbane Event Centre"},{citySlug:"brisbane",slug:"w-brisbane",name:"W Brisbane"},{citySlug:"adelaide",slug:"adelaide-convention-centre",name:"Adelaide Convention Centre"},{citySlug:"adelaide",slug:"adelaide-entertainment-centre",name:"Adelaide Entertainment Centre"},{citySlug:"adelaide",slug:"adelaide-festival-centre",name:"Adelaide Festival Centre"},{citySlug:"adelaide",slug:"adelaide-oval",name:"Adelaide Oval"}
1,{citySlug:"adelaide",slug:"adelaide-showground",name:"Adelaide Showground"},{citySlug:"adelaide",slug:"adelaide-town-hall",name:"Adelaide Town Hall"},{citySlug:"adelaide",slug:"art-gallery-of-south-australia",name:"Art Gallery of South Australia"},{citySlug:"adelaide",slug:"bird-in-hand",name:"Bird in Hand"},{citySlug:"adelaide",slug:"chateau-tanunda",name:"Chateau Tanunda"},{citySlug:"adelaide",slug:"darenberg",name:"d'Arenberg"},{citySlug:"adelaide",slug:"glen-ewin-estate",name:"Glen Ewin Estate"},{citySlug:"adelaide",slug:"hilton-adelaide",name:"Hilton Adelaide"},{citySlug:"adelaide",slug:"intercontinental-adelaide",name:"InterContinental Adelaide"},{citySlug:"adelaide",slug:"morphettville-racecourse",name:"Morphettville Racecourse"},{citySlug:"adelaide",slug:"mount-lofty-house",name:"Mount Lofty House"},{citySlug:"adelaide",slug:"national-wine-centre-of-australia",name:"National Wine Centre of Australia"},{citySlug:"adelaide",slug:"sanctuary-adelaide-zoo",name:"Sanctuary Adelaide Zoo"},{citySlug:"adelaide",slug:"serafino-wines",name:"Serafino Wines"},{citySlug:"adelaide",slug:"skycity-adelaide",name:"SkyCity Adelaide"},{citySlug:"adelaide",slug:"sofitel-adelaide",name:"Sofitel Adelaide"},{citySlug:"hobart",slug:"cascade-brewery-bar-and-gardens",name:"Cascade Brewery Bar & Gardens"},{citySlug:"hobart",slug:"city-hall",name:"City Hall"},{citySlug:"hobart",slug:"crowne-plaza-hobart",name:"Crowne Plaza Hobart"},{citySlug:"hobart",slug:"federation-concert-hall",name:"Federation Concert Hall"},{citySlug:"hobart",slug:"frogmore-creek-winery",name:"Frogmore Creek Winery"},{citySlug:"hobart",slug:"hadleys-orient-hotel",name:"Hadley's Orient Hotel"},{citySlug:"hobart",slug:"hobart-town-hall",name:"Hobart Town Hall"},{citySlug:"hobart",slug:"hotel-grand-chancellor-hobart",name:"Hotel Grand Chancellor Hobart"},{citySlug:"hobart",slug:"macq-01-hotel",name:"MACq 01 Hotel"},{citySlug:"hobart",slug:"mona",name:"MONA"},{citySlug:"hobart",slug:"mystate-bank-arena",name:"MyState Bank Arena"},{citySlug:"hobart",slug:"ninja-stadium-function-centre",name:"Ninja Stadium Function Centre"},{citySlug:"hobart",slug:"princes-wharf-no-1",name:"Princes Wharf No. 1"},{citySlug:"hobart",slug:"racv-hobart-hotel",name:"RACV Hobart Hotel"},{citySlug:"hobart",slug:"riversdale-estate",name:"Riversdale Estate"},{citySlug:"hobart",slug:"royal-tasmanian-botanical-gardens",name:"Royal Tasmanian Botanical Gardens"},{citySlug:"hobart",slug:"the-henry-jones-art-hotel",name:"The Henry Jones Art Hotel"},{citySlug:"hobart",slug:"the-old-woolstore-apartment-hotel",name:"The Old Woolstore Apartment Hotel"},{citySlug:"hobart",slug:"theatre-royal",name:"Theatre Royal"},{citySlug:"hobart",slug:"wrest-point-hotel-and-conference-centre",name:"Wrest Point Hotel & Conference Centre"},{citySlug:"launceston",slug:"albert-hall-convention-centre",name:"Albert Hall Convention Centre"},{citySlug:"launceston",slug:"boathouse-centre-launceston",name:"Boathouse Centre Launceston"},{citySlug:"launceston",slug:"brickendon-estate",name:"Brickendon Estate"},{citySlug:"launceston",slug:"country-club-tasmania",name:"Country Club Tasmania"},{citySlug:"launceston",slug:"entally-estate",name:"Entally Estate"},{citySlug:"launceston",slug:"gorge-restaurant",name:"Gorge Restaurant"},{citySlug:"launceston",slug:"hotel-grand-chancellor-launceston",name:"Hotel Grand Chancellor Launceston"},{citySlug:"launceston",slug:"josef-chromy-wines",name:"Josef Chromy Wines"},{citySlug:"launceston",slug:"launceston-conference-centre",name:"Launceston Conference Centre"},{citySlug:"launceston",slug:"penny-royal-launceston",name:"Penny Royal Launceston"},{citySlug:"launceston",slug:"peppers-silo-hotel",name:"Peppers Silo Hotel"},{citySlug:"launceston",slug:"princess-theatre",name:"Princess Theatre"},{citySlug:"launceston",slug:"quamby-estate",name:"Quamby Estate"},{citySlug:"launceston",slug:"qvmag",name:"QVMAG"},{citySlug:"launceston",slug:"silverdome",name:"Silverdome"},{citySlug:"launceston",slug:"stillwater-restaurant",name:"Stillwater Restaurant"},{citySlug:"launceston",slug:"tamar-valley-resort",name:"Tamar Valley Resort"},{citySlug:"launceston",slug:"the-sebel-launceston",name:"The Sebel Launceston"},{citySlug:"launceston",slug:"the-tramsheds-function-centre",name:"The Tramsheds Function Centre"},{citySlug:"launceston",slug:"utas-stadium",name:"UTAS Stadium"}
1],r={sydney:["sydney","darling harbour","barangaroo","parramatta","olympic park"],melbourne:["melbourne","melb","southbank","south wharf","docklands"],brisbane:["brisbane","south bank"],perth:["perth","elizabeth quay"],adelaide:["adelaide"],canberra:["canberra"],hobart:["hobart"],darwin:["darwin"],geelong:["geelong","nyaal banyul","gcec"],launceston:["launceston"]},i=[{re:/headshot/i,slug:"corporate-headshots",label:"Corporate headshots"},{re:/exhibition|trade ?show|\bexpo\b/i,slug:"exhibition-photography",label:"Exhibition photography"},{re:/conference|keynote|delegate|breakout/i,slug:"conference-photography",label:"Conference photography"},{re:/corporate|gala|awards|\bagm\b|product launch/i,slug:"corporate-event-photography",label:"Corporate event photography"},{re:/video production|videograph|corporate video/i,slug:"event-coverage",label:"Event coverage"}],o={melbourne:[{to:"/video-production-melbourne",label:"Video production Melbourne"},{to:"/corporate-video-melbourne",label:"Corporate video Melbourne"}]};function l(e){return(e||"").toLowerCase()}function c(e){const t=l(e);if(!t)return null;let s=null,n=0;for(const i of a.EW.concat(["launceston"])){const e=[i,...r[i]||[]],o=(0,a.KM)(i);o&&e.push(o.name.toLowerCase());for(const a of e)a.length>=3&&t.includes(a)&&a.length>n&&(s=i,n=a.length)}return s}function d(e){const t=(null===e||void 0===e?void 0:e.questionnaire)||{},s=[null===e||void 0===e?void 0:e.location,null===e||void 0===e?void 0:e.job_title,t.what_we_covered,t.what_we_delivered].filter(Boolean).join(" \xb7 "),r=c(s),d=function(e,t){const s=l(e);if(!s)return null;const a=n.filter(e=>!t||e.citySlug===t);let r=null,i=0;for(const n of a){const e=l(n.name);e.length<4?new RegExp("(?:^|[^a-z0-9])".concat(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"(?:[^a-z0-9]|$)"),"i").test(s)&&e.length>=i&&(r=n,i=e.length):s.includes(e)&&e.length>i&&(r=n,i=e.length)}return r}(s,r),m=function(e){const t=e||"";for(const s of i)if(s.re.test(t))return s;return{slug:"event-coverage",label:"Event coverage"}}(s),p=r?(0,a.KM)(r)||("launceston"===r?{name:"Launceston",slug:"launceston"}:null):null,x=[],h=new Set,u=(e,t)=>{e&&!h.has(e)&&(h.add(e),x.push({to:e,label:t}))};if(d&&u("/event-photography/".concat(d.citySlug,"/").concat(d.slug),"Event photography at ".concat(d.name)),r&&m&&(0,a.KM)(r)&&(u("/services/".concat(m.slug,"/").concat(r),"".concat(m.label," in ").concat(p.name)),u("/services/locations/".concat(r),"All services in ".concat(p.name))),r&&o[r])for(const a of o[r])u(a.to,a.label);return null!==d&&void 0!==d&&d.citySlug?u("/event-photography/".concat(d.citySlug),"".concat(((0,a.KM)(d.citySlug)||{name:d.citySlug}).name," venue photography")):r&&["melbourne","sydney","brisbane","adelaide","hobart","launceston"].includes(r)&&u("/event-photography/".concat(r),"".concat(p.name," venue photography")),{citySlug:r,venue:d,service:m,links:x}}function m(e){let{citySlug:t,venueName:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)&&e.length?e.filter(e=>{const n="".concat(e.location||""," ").concat(e.job_title||""),r=c(n);if(t&&r&&r!==t)return!1;if(t&&!r){const e=(0,a.KM)(t);if(e&&!l(n).includes(e.name.toLowerCase())&&!l(n).includes(t))return!1}if(s){const e=l(n),t=[l(s)],a=s.split(/\s+at\s+/i)[0];a&&a!==s&&t.push(l(a));if(!t.some(t=>{if(!t)return!1;if(t.length<4){return new RegExp("(?:^|[^a-z0-9])".concat(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"(?:[^a-z0-9]|$)"),"i").test(e)}return e.includes(t)}))return!1}return!0}):[]}},34027:(e,t,s)=>{s.d(t,{A:()=>h});var a=s(25352),n=s(44632),r=s(92330),i=s(28814),o=s(70316),l=s(70579);const c={instagram:r.A,linkedin:i.A,facebook:n.A},d=[{name:"Event Photography",to:"/services/event-coverage"},{name:"Conference Photography",to:"/services/conference-photography"},{name:"Conference Services",to:"/conferences"},{name:"Exhibition Photography",to:"/services/exhibition-photography"},{name:"Corporate Events",to:"/services/corporate-event-photography"},{name:"Corporate Video Production",to:"/business"},{name:"Video Production Melbourne",to:"/video-production-melbourne"},{name:"Corporate Video Melbourne",to:"/corporate-video-melbourne"}
1,{name:"Corporate Headshots",to:"/services/corporate-headshots"},{name:"Venue Photography",to:"/event-photography"},{name:"All Services",to:"/services"}],m=[{name:"Sydney",to:"/services/locations/sydney"},{name:"Melbourne",to:"/services/locations/melbourne"},{name:"Brisbane",to:"/services/locations/brisbane"},{name:"Perth",to:"/services/locations/perth"},{name:"Adelaide",to:"/services/locations/adelaide"},{name:"Canberra",to:"/services/locations/canberra"},{name:"Hobart",to:"/services/locations/hobart"},{name:"Darwin",to:"/services/locations/darwin"},{name:"Geelong",to:"/services/locations/geelong"},{name:"Nyaal Banyul (GCEC)",to:"/venues/nyaal-banyul-geelong"}],p=[{name:"About Us",to:"/about"},{name:"Recent Gigs",to:"/recent-gigs"},{name:"Get a Quote",to:"/get-quote"},{name:"View Photos",href:"https://iq.turbo.net.au/showcase"},{name:"View Videos",href:"https://reviews.turbo.net.au/showcase"}];function x(e){let{title:t,items:s}=e;return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-[18px] font-mono text-[11px] uppercase tracking-[0.2em] text-turbo-red",children:t}),(0,l.jsx)("div",{className:"flex flex-col gap-2.5 text-[14.5px] text-silver",children:s.map(e=>e.to?(0,l.jsx)(a.N_,{to:e.to,className:"hover:text-smoke",children:e.name},e.name):(0,l.jsx)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"hover:text-smoke",children:e.name},e.name))})]})}function h(){return(0,l.jsx)("footer",{className:"relative border-t border-[#1F1F1F] bg-[#0A0A0B]",children:(0,l.jsxs)("div",{className:"px-5 pb-8 pt-14 md:px-11 xl:px-16",children:[(0,l.jsxs)("div",{className:"mx-auto grid max-w-[1328px] grid-cols-1 gap-10 md:grid-cols-[1.4fr_1fr_1fr_1fr]",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("img",{src:"/turbo-logo-dark.png",alt:"Turbo 360",className:"mb-5 h-auto w-[150px]"}),(0,l.jsx)("p",{className:"m-0 mb-5 max-w-[300px] text-[15px] leading-[1.65] text-ash",children:"Photography and video for conferences, exhibitions and corporate events \u2014 delivered the same day, across Australia and the Asia-Pacific."}),(0,l.jsxs)("div",{className:"mb-5 flex flex-col gap-[7px] font-mono text-[13px] tracking-[0.08em] text-silver",children:[(0,l.jsx)("a",{href:"tel:1300207446",className:"hover:text-smoke",children:"1300 207 446"}),(0,l.jsx)("a",{href:"mailto:[email protected]",className:"hover:text-smoke",children:"[email protected]"})]}),(0,l.jsxs)("div",{className:"text-[13.5px] leading-[1.8] text-[#8A8884]",children:["Turbo Productions PTY LTD",(0,l.jsx)("br",{}),"ABN 18 150 556 102",(0,l.jsx)("br",{}),"Coverage \u2014 Australia \xb7 New Zealand \xb7 Singapore"]}),(0,l.jsx)("div",{className:"mt-[22px] flex gap-3",children:o.FJ.socialLinks.map(e=>{const t=c[e.icon];return t?(0,l.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":"Turbo 360 on ".concat(e.platform),title:"Turbo 360 on ".concat(e.platform),className:"flex h-9 w-9 items-center justify-center rounded-full border border-[#2B2B2B] text-silver transition-colors hover:text-smoke",children:[(0,l.jsx)(t,{size:15}),(0,l.jsx)("span",{className:"sr-only",children:e.platform})]},e.platform):null})})]}),(0,l.jsx)(x,{title:"Services",items:d}),(0,l.jsx)(x,{title:"Locations",items:m}),(0,l.jsx)(x,{title:"Company",items:p})]}),(0,l.jsxs)("div",{className:"mx-auto mt-11 flex max-w-[1328px] flex-wrap items-center justify-between gap-3 border-t border-[#1F1F1F] pt-[22px] font-mono text-[11px] uppercase tracking-[0.18em] text-[#6F6D6A]",children:[(0,l.jsx)("span",{children:"Turbo 360 \xb7 Every angle. Full speed."}),(0,l.jsx)("span",{children:"\xa9 2026 Turbo Productions PTY LTD"})]})]})})}},34458:(e,t,s)=>{s.d(t,{L:()=>m,WG:()=>d,_p:()=>l,c4:()=>o,cd:()=>r,gf:()=>c,jd:()=>i,wR:()=>p});const a="turbo360_admin_auth",n="turbo360_admin_token",r=()=>{try{const e=localStorage.getItem(a);if(!e)return!1;const t=JSON.parse(e),s=new Date;return!(s>new Date(t.expires))||(localStorage.removeItem(a),localStorage.removeItem(n),!1)}catch(e){return console.error("Error checking admin auth:",e),localStorage.removeItem(a),!1}},i=()=>{try{const e=localStorage.getItem(a);if(!e)return null;const t=JSON.parse(e),s=new Date;return s>new Date(t.expires)?(localStorage.removeItem(a),localStorage.removeItem(n),null):{username:t.username,email:t.email,token:t.token,loginTime:t.loginTime,expires:t.expires}}catch(e){return console.error("Error getting admin user:",e),null}},o=()=>{try{const e=localStorage.getItem(a);if(!e)return null;const t=JSON.parse(e),s=new Date;return s>new Date(t.expires)?(localStorage.removeItem(a),localStorage.removeItem(n),null):t.token}catch(e){return console.error("Error getting auth token:",e),null}},l=()=>{localStorage.removeItem(a),localStorage.removeItem(n)},c=()=>{try{const e=localStorage.getItem(a);if(e){const t=JSON.parse(e);if(t.token&&new Date<new Date(t.expires))return t.token}return localStorage.getItem(n)||null}catch(e){return console.error("Error getting token:",e),null}},d=e=>{try{localStorage.setItem(n,e)}catch(t){console.error("Error setting token:",t)}},m=()=>{try{localStorage.removeItem(n),localStorage.removeItem(a)}catch(e){console.error("Error clearing token:",e)}},p=()=>!!c()||r()},43393:(e,t,s)=>{s.d(t,{A:()=>r});var a=s(1312),n=s(70579);function r(){return(0,n.jsx)(a.A,{})}},44604:(e,t,s)=>{s.d(t,{Ay:()=>o,EW:()=>n,KM:()=>r,xp:()=>i});const a={sydney:{slug:"sydney",name:"Sydney",state:"NSW",stateFullName:"New South Wales",region:"Greater Sydney",heroSubtitle:"Australia's harbour city",metaCityName:"Sydney",hubMetaTitle:"Event Photographer Sydney | Same-Day Photos & Video | Turbo 360",hubMetaDescription:"Event photographer Sydney for corporate events, galas, launches and conferences. Same-day photo and video across Greater Sydney. 180+ 5\u2605 reviews. Get a quote.",hubHeroLines:[{text:"Event Photographer",variant:"primary"},{text:"Sydney",variant:"secondary"},{text:"\u2014 Same-Day Photo & Video",variant:"tagline"}],population:"5.3 million",coordinates:{lat:-33.8688,lng:151.2093},timezone:"AEST (UTC+10)",airportCode:"SYD",airportDistance:"8km from CBD",intro:"Sydney is Australia's number one business events destination, welcoming over 3.4 million business event visitors annually. From the iconic harbour to world-class convention facilities at ICC Sydney, the city offers an unmatched combination of premium venues, corporate precincts, and that unmistakable harbour backdrop that defines Sydney event photography.",venues:[{name:"ICC Sydney",fullName:"International Convention Centre Sydney",suburb:"Darling Harbour",type:"convention",capacity:"35,000 sqm exhibition space",description:"Australia's leading convention and exhibition centre with 70+ meeting rooms, two theatres, and the country's largest ballroom with panoramic harbour views.",keywords:["ICC Sydney","Darling Harbour convention centre","Sydney convention centre"]}
1,{name:"Sydney Showground",suburb:"Sydney Olympic Park",type:"exhibition",capacity:"21,600 sqm event space",description:"Home to The Dome \u2014 the largest timber structure of its kind in the Southern Hemisphere \u2014 and 150+ major events annually including the Royal Easter Show.",keywords:["Sydney Showground","Olympic Park venue","Easter Show venue"]},{name:"The Star Event Centre",suburb:"Pyrmont",type:"entertainment",capacity:"3,000 cocktail",description:"$100 million multi-purpose venue with 12-metre ceilings, one of Australia's best sound systems, and split-level configurations for events from 500 to 3,000 guests.",keywords:["Star Event Centre","Pyrmont event venue"]},{name:"Crown Sydney",suburb:"Barangaroo",type:"hotel",capacity:"390 banquet",description:"Pearl Ballroom offering panoramic harbour views from Barangaroo's luxury tower, with state-of-the-art AV and award-winning catering.",keywords:["Crown Sydney","Barangaroo events"]},{name:"Sydney Town Hall",suburb:"Sydney CBD",type:"heritage",capacity:"2,000 across 9 spaces",description:"Heritage-listed civic landmark completed in 1889 featuring Centennial Hall with its Grand Organ, 21 stained glass windows, and ornate 12-pillar interior.",keywords:["Sydney Town Hall","heritage event venue Sydney"]},{name:"Carriageworks",suburb:"Eveleigh",type:"arts",capacity:"Multiple flexible space
1s",description:"Australia's largest contemporary multi-arts centre in a 19th-century railway heritage building. Permanent home of Australian Fashion Week and Vivid Sydney activations.",keywords:["Carriageworks","Eveleigh events","Fashion Week venue"]},{name:"Luna Park Sydney",suburb:"Milsons Point",type:"entertainment",capacity:"3,000 in Big Top",description:"13 corporate event spaces beneath the Sydney Harbour Bridge with breathtaking views of the Opera House, harbour, and city skyline.",keywords:["Luna Park Sydney","Milsons Point venue","harbour view events"]},{name:"Hordern Pavilion",suburb:"Moore Park",type:"entertainment",capacity:"5,500",description:"One of Australia's most iconic event venues since 1924, just 10 minutes from the CBD and 15 minutes from the airport.",keywords:["Hordern Pavilion","Moore Park events"]}],uniqueVenues:[{name:"Doltone House, Jones Bay Wharf",type:"Heritage wharf with harbour views",capacity:"680 seated"},{name:"Museum of Contemporary Art",type:"Rooftop with Opera House views",capacity:"Multiple spaces"},{name:"Sydney Opera House \u2014 Yallamundi Rooms",type:"Waterfront function space beneath the shells",capacity:"Three interconnecting rooms"},{name:"Taronga Zoo",type:"City skyline and harbour views",capacity:"3,000 cocktail on Concert Lawns"},{name:"Art Gallery of NSW",type:"World-class art gallery with new Sydney Modern wing",capacity:"10 event spaces"},{name:"BridgeClimb Sydney",type:"Events atop Sydney Harbour Bridge",capacity:"100 cocktail"}],precincts:[{name:"Sydney CBD",description:"Australia's financial capital with 40% of businesses in finance or professional services. Home to the Big Four banks, major law firms, and global consulting companies.",industries:["Finance","Legal","Professional services","Consulting"]},{name:"Barangaroo",description:"Premium waterfront corporate precinct featuring International Towers, Crown Sydney, and KPMG/PwC headquarters.",industries:["Financial services","Legal","Consulting","IT"]},{name:"North Sydney",description:"Third-largest concentration of jobs in NSW, home to Nine Entertainment, Foxtel, and major tech and media companies.",industries:["Technology","Media","Telecommunications","Insurance"]},{name:"Macquarie Park",description:"Sydney's third CBD with 32,000+ jobs and 900,000+ sqm of office space, dominated by pharmaceutical and tech giants.",industries:["Pharmaceutical","Technology","Telecommunications","Electronics"]},{name:"Parramatta",description:"Sydney's second CBD, 23km west, with CommBank Stadium and growing government and corporate investment in Western Sydney.",industries:["Government","Legal","Health","Education"]},{name:"Tech Central",description:"Australia's highest density of venture capital, anchored by Atlassian's headquarters tower at Central Station and home to Canva, Afterpay, and 150+ research institutes.",industries:["Technology startups","Venture capital","Software","Creative industries"]}],annualEvents:[{name:"Vivid Sydney",when:"May-June",description:"World's largest festival of light, music, and ideas \u2014 23 nights of iconic projections on the Opera House and citywide installations"},{name:"Sydney Royal Easter Show",when:"April",description:"Australia's largest annual ticketed event with approximately 900,000 attendees"},{name:"Australian Fashion Week",when:"May",description:"Australia's premier fashion industry event held at Carriageworks"},{name:"Sydney Build Expo",when:"March",description:"Australia's largest construction and design show at ICC Sydney with 28,000+ professionals"},{name:"World Business Forum",when:"November",description:"Premier leadership event for senior executives at ICC Sydney"},{name:"Sydney Festival",when:"January",description:"18-day multi-arts festival covering theatre, music, dance, and visual art"}],seasonalNotes:{peak:"October to December \u2014 conference season overlaps with Christmas/end-of-year party season. Venues book out months in advance.",secondary:"May to June \u2014 Vivid Sydney drives massive demand for event photography alongside peak conference season.",quiet:"January \u2014 summer holidays, though Sydney Festival creates localised demand.",weather:"Mild climate year-round with harbour-centric outdoor/indoor hybrid events common. Summer thu
1nderstorms can affect outdoor setups."},transportNotes:"Sydney Airport is only 8km from CBD (15 minutes to most venues). Light Rail connects Central to ICC Sydney and Pyrmont. New Metro links Barangaroo, Martin Place, and North Sydney. Parking is expensive ($40-80/day in CBD).",localInsight:"Almost every premium Sydney venue trades on harbour, bridge, or Opera House views. Event photography here is defined by waterfront light, reflections, and iconic backdrops. The city's indoor/outdoor hybrid culture means photographers must manage mixed lighting constantly.",nearbyRegions:["Hunter Valley","Blue Mountains","Central Coast","Southern Highlands"]},melbourne:{slug:"melbourne",name:"Melbourne",state:"VIC",stateFullName:"Victoria",region:"Greater Melbourne",heroSubtitle:"Australia's cultural capital",metaCityName:"Melbourne",population:"5.2 million",coordinates:{lat:-37.8136,lng:144.9631},timezone:"AEST (UTC+10)",airportCode:"MEL",airportDistance:"23km from CBD",intro:"Melbourne is Australia's events capital, with the Melbourne Convention Bureau securing 215 future events worth $252 million in a single year. The city's walkable Southbank conference precinct, UNESCO World Heritage venues, and the world's largest tram network make it a powerhouse for corporate and cultural events.",venues:[{name:"MCEC",fullName:"Melbourne Convention and Exhibition Centre",suburb:"South Wharf",type:"convention",capacity:"5,500 in Plenary",description:"Australia's largest convention and exhibition centre with 70,000 sqm total space, 39,000 sqm pillarless exhibition halls, and a waterfront location on the Yarra River.",keywords:["MCEC","Melbourne Convention Centre","South Wharf events"]},{name:"Royal Exhibition Building",suburb:"Carlton",type:"heritage",capacity:"25,000 sqm",description:"UNESCO World Heritage-listed building from 1880 with 25,000 sqm of event space. One of Australia's most iconic heritage event venues.",keywords:["Royal Exhibition Building","Carlton events","heritage venue Melbourne"]},{name:"Crown Palladium",suburb:"Southbank",type:"entertainment",capacity:"2,500 cocktail",description:"Australia's largest pillarless ballroom with seven-metre ceilings, eight custom chandeliers, and six retractable digital screens. Home of the AFL Brownlow Medal.",keywords:["Crown Palladium","Southbank events","Melbourne ballroom"]},{name:"Melbourne Town Hall",suburb:"Melbourne CBD",type:"heritage",capacity:"1,990 theatre",description:"Iconic civic building with the Grand Organ \u2014 the largest in the Southern Hemisphere \u2014 towering 70-foot ceilings, ornate chandeliers, and sweeping marble foyer.",keywords:["Melbourne Town Hall","Swanston Street venue"]},{name:"Melbourne Showgrounds",suburb:"Ascot Vale",type:"exhibition",capacity:"9,000 theatre",description:"Victoria's largest and most versatile venue, home to the Royal Melbourne Show. Current filming location for MasterChef Australia.",keywords:["Melbourne Showgrounds","Ascot Vale events","Royal Melbourne Show"]},{name:"Marvel Stadium",suburb:"Docklands",type:"entertainment",capacity:"60,000 arena / 10,000 dinner",description:"Southern Hemisphere's only retractable roof stadium with 15 function spaces and on-site parking for 2,500 cars.",keywords:["Marvel Stadium","Docklands events"]},{name:"Melbourne Park",suburb:"East Melbourne",type:"entertainment",capacity:"15,000 in Rod Laver Arena",description:"Home of the Australian Open tennis with bespoke function spaces and private suites overlooking the courts.",keywords:["Melbourne Park","Rod Laver Arena","Australian Open venue"]},{name:"Flemington Racecourse",suburb:"Flemington",type:"heritage",capacity:"1,300 conference / 1,000 dinner",description:"Home of the Melbourne Cup with unmatched city skyline views and premium hospitality managed by Crown Melbourne. 15 minutes from the airport.",keywords:["Flemington Racecourse","Melbourne Cup venue","VRC events"]}],uniqueVenues:[{name:"NGV Great Hall",type:"Famous Leonard French stained glass ceiling",capacity:"1,100 cocktail"},{name:"Plaza Ballroom at Regent Theatre",type:"1929 Spanish Rococo architecture",capacity:"1,200 cocktail"},{name:"Myer Mural Hall",type:"Art Deco heritage-listed ballroom",capacity:"Corporate dinners and galas"},{name:"Cargo Hall, South Wharf",type:"Heritage docking shed with Yarra views",capacity:"300 cocktail"},{name:"Meat Market",type:"Heritage cobblestone pavilion",capacity:"600 in Cobblestone Pavilion"},{name:"Leonda By The Yarra",type:"Riverside event space in Hawthorn",capacity:"Multiple spaces"}],precincts:[{name:"Melbourne CBD (Hoddle Grid)",description:"Australia's largest CBD office market. Collins Street'
1s \"Paris End\" is the premium corporate address, home to BHP, ANZ, and NAB headquarters.",industries:["Mining","Finance","Legal","Consulting"]},{name:"Docklands",description:"200-hectare waterfront precinct home to ANZ Bank, AMP, NAB, Commonwealth Bank, and the Australian Taxation Office.",industries:["Financial services","Professional services","Government"]},{name:"Southbank / South Wharf",description:"Melbourne's conference and arts precinct on the Yarra River, home to MCEC, Crown, NGV, and Arts Centre Melbourne \u2014 all within walking distance.",industries:["Arts","Entertainment","Hospitality","Events"]},{name:"Cremorne / Richmond",description:"Melbourne's \"Silicon Yarra\" \u2014 home to SEEK, REA Group, Carsales, MYOB, Domain, Tesla, and Uber. Contributes $4 billion annually to Victoria's economy.",industries:["Technology","Digital","Media","Startups"]},{name:"Monash / Clayton",description:"Victoria's largest employment hub outside the CBD with 75,000 jobs, home to CSIRO, Australian Synchrotron, and Monash University.",industries:["Research","Health","Advanced manufacturing","Education"]}],annualEvents:[{name:"Australian Open Tennis",when:"January",description:"First Grand Slam of the year at Melbourne Park, attracting 800,000+ spectators"},{name:"Formula 1 Australian Grand Prix",when:"March",description:"Melbourne's largest annual motorsport event at Albert Park"},{name:"Melbourne Cup Carnival",when:"October-November",description:'"The race that stops a nation" at Flemington \u2014 300,000 attendees across four race days'},{name:"RISING Festival",when:"June",description:"Premier night-time arts and culture festival across inner-city Melbourne"},{name:"Melbourne International Comedy Festival",when:"March-April",description:"One of the world's three largest comedy festivals"},{name:"PAX Australia",when:"October",description:"Australia's largest gaming convention at MCEC"}],seasonalNotes:{peak:"October to November \u2014 Spring Racing Carnival (Melbourne Cup) creates enormous corporate hospitality and fashion photography demand. The single busiest period for Melbourne event photographers.",secondary:"March to May \u2014 Grand Prix, Comedy Festival, and peak conference season. Reliable autumn weather with beautiful soft light.",quiet:"December to February \u2014 summer holidays, though Australian Open in January brings international activity.",weather:'"Four seasons in one day" \u2014 always prepare for sudden weather changes. Pack indoor and outdoor equipment regardless of forecast.'},transportNotes:"Melbourne has the world's largest tram network with a Free Tram Zone covering the CBD and Docklands. SkyBus runs 24/7 from Melbourne Airport (Tullamarine) to Southern Cross Station in 30 minutes. MCEC, Crown, Cargo Hall, and NGV are all walkable along the Yarra.",localInsight:"Melbourne's Southbank conference precinct is uniquely walkable \u2014 MCEC, Crown, NGV, Arts Centre Melbourne, and Cargo Hall are all within a few hundred metres along the Yarra River. The Free Tram Zone eliminates transport costs for delegates moving between C
1BD venues.",nearbyRegions:["Geelong","Yarra Valley","Mornington Peninsula","Great Ocean Road","Daylesford"]},brisbane:{slug:"brisbane",name:"Brisbane",state:"QLD",stateFullName:"Queensland",region:"South East Queensland",heroSubtitle:"Australia's new world city",metaCityName:"Brisbane",population:"2.6 million",coordinates:{lat:-27.4698,lng:153.0251},timezone:"AEST (UTC+10)",airportCode:"BNE",airportDistance:"20km from CBD",intro:"Brisbane is being transformed ahead of the 2032 Olympics with $7.1 billion in new venue infrastructure. The $3.6 billion Queen's Wharf development added 7,000+ sqm of premium event space in 2024, while the Brisbane Convention & Exhibition Centre remains Queensland's flagship conference facility on the vibrant South Bank cultural precinct.",venues:[{name:"BCEC",fullName:"Brisbane Convention & Exhibition Centre",suburb:"South Bank",type:"convention",capacity:"8,000 delegates",description:"Queensland's premier purpose-built convention facility with the Great Hall accommodating 4,000 for cocktail functions. Adjacent to the South Bank cultural precinct.",keywords:["BCEC","Brisbane Convention Centre","South Bank events"]},{name:"Royal ICC Brisbane",fullName:"Royal International Convention Centre",suburb:"Bowen Hills",type:"exhibition",capacity:"300+ events annually",description:"Located within the heritage Brisbane Showgrounds, hosting over 1 million visitors annually. Home to the Ekka with on-site Rydges Hotel and King Street dining.",keywords:["Royal ICC","Brisbane Showgrounds","RNA events","Ekka venue"]},{name:"The Star Brisbane",fullName:"The Star Brisbane Event Centre (Queen's Wharf)",suburb:"Brisbane CBD",type:"entertainment",capacity:"2,000 sqm ballroom",description:"Brisbane's newest major event precinct (opened 2024). Part of the $3.6 billion Queen's Wharf development with 7,000+ sqm of conference and event space.",keywords:["Star Brisbane","Queen's Wharf events","Brisbane event centre"]},{name:"Brisbane City Hall",suburb:"Brisbane CBD",type:"heritage",capacity:"1,600
1in Main Auditorium",description:"Heritage icon with sweeping marble staircases, vaulted ceilings, chandeliers, and mosaic-tiled floors. Enhanced accessibility added in 2025.",keywords:["Brisbane City Hall","King George Square events"]},{name:"Brisbane Powerhouse",suburb:"New Farm",type:"arts",capacity:"Multiple theatre and event spaces",description:"Former power station converted into a leading arts and events centre on the Brisbane River with two main stages and corporate event spaces.",keywords:["Brisbane Powerhouse","New Farm events"]},{name:"Customs House",suburb:"Petrie Bight",type:"heritage",capacity:"Six private function rooms",description:"Heritage-listed premier function venue with spectacular views of Brisbane River and Story Bridge.",keywords:["Customs House Brisbane","Story Bridge venue"]},{name:"Fortitude Music Hall",suburb:"Fortitude Valley",type:"entertainment",capacity:"3,000 cocktail",description:"Australia's largest ballroom-style theatre with classic design and cutting-edge sound and lighting technology.",keywords:["Fortitude Music Hall","Valley events"]}],uniqueVenues:[{name:"Howard Smith Wharves",type:"Heritage precinct beneath Story Bridge",capacity:"600 across multiple spaces"},{name:"The Old Museum",type:"Heritage concert hall since 1891",capacity:"Corporate dinners and markets"},{name:"Riverstage",type:"Open-air amphitheatre in Botanic Gardens",capacity:"9,000"},{name:"Eat Street Northshore",type:"180 repurposed shipping containers",capacity:"70+ traders, private functions available"},{name:"Superordinary, Hamilton",type:"Art-focused flexible event space",capacity:"1,000"},{name:"Riverlife, Kangaroo Point",type:"Open-air venue at Kangaroo Point Cliffs",capacity:"Outdoor corporate events"}],precincts:[{name:"Brisbane CBD \u2014 Golden Triangle",description:"Premium financial district anchored by Eagle Street's Riverside Centre. Home to major banks, law firms, and the new $3.6 billion Queen's Wharf development.",industries:["Finance","Legal","Professional services"]},{name:"South Bank / South Brisbane",description:"Brisbane's premier lifestyle and cultural destination housing BCEC, QPAC, GOMA, Queensland Museum, and 17 hectares of riverside parklands.",industries:["Arts","Culture","Education","Events"]},{name:"Fortitude Valley / Newstead / Teneriffe",description:"Creative industries hub blending heritage wool stores with modern offices. Newstead and Teneriffe are Brisbane's most desirable inner-city corporate addresses.",industries:["Creative industries","Media","Technology","Hospitality"]},{name:"Hamilton / Northshore",description:"Connected, sustainable riverfront precinct with Portside Wharf, Eat Street Northshore, and Bluey's World (opened 2024).",industries:["Dining","Entertainment","Cruise terminal"]}],annualEvents:[{name:"Ekka (Royal Queensland Show)",when:"August",description:"Queensland's largest annual event welcoming 400,000 visitors over 9 days at Brisbane Showgrounds"},{name:"Brisbane Festival & Riverfire",when:"September",description:"Three-week arts festival culminating in the Riverfire fireworks spectacular along the Brisbane River"},{name:"BIGSOUND",when:"September",description:"Australia's premier music industry conference and festival across Fortitude Valley"},{name:"Lord Mayor's Christmas Carols",when:"December",description:"Brisbane's largest community Christmas event at Riverstage"}],seasonalNotes:{peak:"May to October \u2014 dry season. Ideal for outdoor and indoor events. September is Brisbane Festival month.",secondary:"March to May \u2014 autumn conference season with comfortable 15-25\xb0C temperatures.",quiet:"December to February \u2014 hot and humid with thunderstorms. Most large outdoor events avoid this period.",weather:"Humid subtropical climate with 2,800 hours of sunshine annually. Golden hour light along the river is exceptional for event photography."},transportNotes:"Airtrain runs every 15 minutes from Brisbane Airport to CBD in 20 minutes. South Brisbane Station is the direct stop for BCEC and South Bank. Free CityHopper ferry covers inner-city river stops. Cross River Rail will allow trains every 5 minutes at peak.",localInsight:"The 2032 Olympics are transforming Brisbane's event infrastru
1cture with $7.1 billion in new venues including a 63,000-seat Victoria Park stadium and 17,000-seat indoor arena at Woolloongabba. Queen's Wharf (The Star Brisbane) opened in 2024 with two more luxury hotels coming by end of 2026.",nearbyRegions:["Gold Coast","Sunshine Coast","Moreton Bay","Scenic Rim"]},perth:{slug:"perth",name:"Perth",state:"WA",stateFullName:"Western Australia",region:"Greater Perth",heroSubtitle:"Australia's western capital",metaCityName:"Perth",population:"2.2 million",coordinates:{lat:-31.9505,lng:115.8605},timezone:"AWST (UTC+8)",airportCode:"PER",airportDistance:"12km from CBD",intro:"Perth is the resource and energy capital of the Indo-Pacific, home to the headquarters of BHP, Rio Tinto, Woodside Energy, and Fortescue. Corporate event photography demand is heavily driven by the mining and energy sector, with the Perth Convention and Exhibition Centre hosting flagship industry events like EXA (Energy Exchange Australia) and the WA Mining Conference.",venues:[{name:"PCEC",fullName:"Perth Convention and Exhibition Centre",suburb:"Perth CBD",type:"convention",capacity:"5,000 delegates",description:"Western Australia's only purpose-built convention centre with 16,554 sqm across 6 exhibition pavilions, the 2,500-seat Riverside Theatre, and the BelleVue Ballroom with Swan River views.",keywords:["PCEC","Perth Convention Centre","Mounts Bay Road events"]},{name:"Crown Perth",suburb:"Burswood",type:"entertainment",capacity:"2,400 in Crown Ballroom",description:"Perth's premier integrated resort with 11,000 sqm of event space, Crown Theatre (2,300 seats), 32 restaurants and bars, and three hotel towers on the Swan River.",keywords:["Crown Perth","Burswood events","Crown Ballroom Perth"]},{name:"Optus Stadium",suburb:"Burswood",type:"entertainment",capacity:"60,000 / 20 event spaces",description:'Award-winning 60,000-seat stadium (2019 Prix Versailles "Most Beautiful Stadium in the World") with 20 purpose-designed event spaces and 101 private suites.',keywords:["Optus Stadium","Perth Stadium","Burswood Peninsula events"]},{name:"RAC Arena",suburb:"Perth CBD",type:"entertainment",capacity:"15,000",description:"Perth's premier indoor entertainment arena next to Perth Train Station, home of Perth Wildcats.",keywords:["RAC Arena","Perth Arena"]},{name:"Claremont Showground",suburb:"Claremont",type:"exhibition",capacity:"1 million visitors annually",description:"Iconic multi-purpose venue with its own dedicated railway station. Hosts 250+ events annually including the Perth Royal Show.",keywords:["Claremont Showground","Perth Royal Show","Claremont events"]},{name:"Pan Pacific Perth",suburb:"Perth CBD",type:"hotel",capacity:"700 delegates",description:"Recently refurbished convention floor with 2,500+ sqm. Grand River Ballroom features full-length Swan River windows.",keywords:["Pan Pacific Perth","Adelaide Terrace events"]}],uniqueVenues:[{name:"Fraser's Kings Park",type:"Panoramic city and river views from Kings Park",capacity:"700 cocktail"},{name:"WA Maritime Museum",type:"Harbour-view event spaces in Fremantle",capacity:"Conferences and gala dinners"},{name:"Little Creatures Brewery",type:"Converted boat shed in Fremantle",capacity:"150 seated"},{name:"Elizabeth Quay Venues",type:"Waterfront precinct on Swan River",capacity:"Multiple venues"},{name:"Fremantle Arts Centre",type:"Heritage building (WA's first purpose-built asylum)",capacity:"Exhibitions and events"},{name:"The Camfield, Burswood",type:"One of Australia's largest pubs",capacity:"Corporate events and functions"}],precincts:[{name:"St Georges Terrace",description:"Perth's premier corporate boulevard with Central Park (Perth's tallest building, Rio Tinto tenant), Brookfield Place (BHP HQ), QV1 (Chevron), and Woodside Plaza.",industries:["Mining","Energy","Finance","Legal"]},{name:"Elizabeth Quay",description:"Perth's showpiece waterfront development opened in 2016 with The Ritz-Carlton, EY offices, and premium dining overlooking the Swan River.",industries:["Finance","Professional services","Hospitality"]},{name:"West Perth / Kings Park",description:"Secondary office precinct popular with mid-tier mining and exploration firms. Kings Park's 400 hectares overlook the CBD and Swan River.",industries:["Mining","Exploration","Professional services"]},{name:"Burswood Peninsula",description:"Perth's entertainment and sporting hub with Crown Perth, Optus Stadium, and proposed 15,000-seat amphitheatre. Connected to East Perth by the Matagarup Bridge.",industries:["Entertainment","Sport","Hospital
1ity"]}],annualEvents:[{name:"EXA (Energy Exchange Australia)",when:"March",description:"Major energy industry conference with 8,000+ professionals at PCEC"},{name:"WA Mining Conference & Exhibition",when:"September-October",description:"Western Australia's largest mining industry trade show at PCEC"},{name:"Perth Royal Show",when:"September-October",description:"WA's most loved community event at Claremont Showground"},{name:"Perth Festival",when:"February-March",description:"Australia's longest-running international arts festival with 100+ events"},{name:"Diggers & Dealers Mining Forum",when:"August",description:"Australia's premier mining investment forum in Kalgoorlie (Perth attendees dominate)"}],seasonalNotes:{peak:"September to April \u2014 dry season. Mining conferences cluster in March and September-November. Perth Royal Show in late September.",secondary:"February to March \u2014 Perth Festival season with arts and corporate events.",quiet:"June to August \u2014 mild, wet winter. Events move indoors.",weather:"Mediterranean climate. Outdoor corporate events and gala functions cluster in the September-to-April dry season."},transportNotes:"Perth Airport is unusually close to the CBD (12km, 15-20 minutes by car). Airport Line train reaches CBD in 18 minutes. Ferry runs from Elizabeth Quay to South Perth. Fremantle Line stops at Claremont Showground. Purpose-built Perth Stadium station serves Optus Stadium.",localInsight:'Perth operates on GMT+8 \u2014 the same timezone as 60% of the world\'s population (Singapore, Hong Kong, China). This makes it a natural host for Asia-Pacific business events. Mining and energy boom/bust cycles directly affect corporate event spend. "Fly-in, fly-out" (FIFO) culture means many events have interstate and international attendees.',nearbyRegions:["Fremantle","Swan Valley","Margaret River","Rottnest Island"]},adelaide:{slug:"adelaide",name:"Adelaide",state:"SA",stateFullName:"South Australia",region:"Greater Adelaide",heroSubtitle:"Australia's festival state capital",metaCityName:"Adelaide",population:"1.4 million",coordinates:{lat:-34.9285,lng:138.6007},timezone:"ACST (UTC+9:30)",airportCode:"ADL",airportDistance:"7km from CBD",intro:"Adelaide is the capital of \"The Festival State,\" hosting one of the world's densest festival seasons each February-March. The Lot Fourteen innovation precinct \u2014 home to the Australian Space Agency \u2014 and BioMed City create a unique intersection of science, culture, and events. With four of Australia's premier wine regions within an hour's drive, Adelaide offers event experiences no other capital can match.",venues:[{name:"Adelaide Convention Centre",fullName:"Adelaide Convention Centre",suburb:"Adelaide CBD (Riverbank Precinct)",type:"convention",capacity:"20,000+ sqm event space",description:"One of Australia's most awarded convention centres on North Terrace, directly connected to the Riverbank Precinct, hotels, and innovation districts.",keywords:["Adelaide Convention Centre","ACC","Riverbank Precinct events"]},{name:"Adelaide Showground",suburb:"Wayville",type:"exhibition",capacity:"26,000 sqm premium space",description:"Adelaide's largest multipurpose venue with one of the largest under-cover exhibition spaces in the Southern Hemisphere. Hosts 140+ events annually. 5 minutes from CBD.",keywords:["Adelaide Showground","Wayville events","Royal Adelaide Show"]},{name:"Adelaide Oval",suburb:"North Adelaide",type:"entertainment",capacity:"2,000 guests across 25 spaces",description:"25 purpose-built function spaces from intimate boardrooms to the 1,250 sqm William Magarey Room with capacity for 55 exhibition booths.",keywords:["Adelaide Oval","Adelaide Oval events","North Adelaide venue"]},{name:"National Wine Centre",fullName:"National Wine Centre of Australia",suburb:"Adelaide CBD",type:"unique",capacity:"2,024 sqm across 9 rooms",description:"Uniquely positioned wine-themed corporate venue on the edge of the Adelaide Botanic Gardens with six versatile conference spaces.",keywords:["National Wine Centre","wine venue Adelaide"]},{name:"Adelaide Town Hall",suburb:"Adelaide CBD",type:"heritage",capacity:"Heritage civic venue",description:"Built in the 1860s, this heritage-listed venue on King William Street provides magnificent architecture for gala dinners, awards, and formal events.",keywords:["Adelaide Town Hall","King William Street events"]}],uniqueVenues:[{name:"d'Arenberg Cube, McLaren Vale",type:"Architecturally striking multi-storey venue among vineyards",capacity:"30 minutes from CBD"},{name:"Barossa Valley Function Venues",type:"Grand Ballroom with award-winning wines",capacity:"450 seated"},{name:"Adelaide Pavilion",type:"Panoramic garden views in South Parklands",capacity:"320"},{name:"2KW Rooftop Bar",type:"Rooftop venue with city views",capacity:"Cocktail events"},{name:"Golding Wines, Adelaide Hills",type:"Picturesque hilltop outdoor venue",capacity:"Events among the vines"}],precincts:[{name:"Lot Fourteen",description:"Former Royal Adelaide Hospital site on North Terrace, now a 7-hectare innovation precinct home to the Australian Space Agency, Australian Institute for Machine Learning, and 160+ organisations including Salesforce, AWS, and Airbus.",industries:["Space","Defence","Cyber security","AI","Creative industries"]},{name:"Adelaide Riverbank Precinct",description:"Where cultural, sporting, education, medical, conference, and entertainment zones merge along the River Torrens. Includes ACC, Festival Centre, Adelaide Oval, and SkyCity Casino.",industries:["Events","Culture","Entertainment","Medical"]},{name:"BioMed City",description:"The largest life and health sciences cluster in the Southern Hemisphere \u2014 SAHMRI, Royal Adelaide Hospital, and university research institutes. 5-minute walk from ACC.",industries:["Health sciences","Medical research","Biotechnology"]},{name:"Tonsley Innovation District",description:"Former Mitsubishi manufacturing plant transformed into an innovation hub with 2,000+
1workers, Flinders University, and TAFE SA. Direct rail link to CBD.",industries:["Advanced manufacturing","Defence","Health sciences"]}],annualEvents:[{name:"Adelaide Festival",when:"February-March",description:"17-day arts program \u2014 one of the world's premier arts festivals"},{name:"Adelaide Fringe",when:"February-March",description:"Largest open-access arts festival in the Southern Hemisphere"},{name:"WOMADelaide",when:"March",description:"4-day world music and arts festival in Botanic Park with 700+ artists from 30+ countries"},{name:"Santos Tour Down Under",when:"January",description:"First stop on the UCI WorldTour cycling calendar"},{name:"Tasting Australia",when:"May",description:"Premier food and wine festival"},{name:"Royal Adelaide Show",when:"September",description:"Major annual agricultural show"}],seasonalNotes:{peak:"February to March \u2014 the world's densest festival period with Adelaide Festival, Adelaide Fringe, and WOMADelaide running simultaneously.",secondary:"September to November \u2014 spring conference season with comfortable weather.",quiet:"June to August \u2014 quiet winter period.",weather:"Mediterranean climate. Hot, dry summers ideal for outdoor events. Wine regions within an hour's drive add unique event photography opportunities."},transportNotes:"Adelaide Airport is only 7km from the CBD (15 minutes). Adelaide Metro trams run from the city to Glenelg beach. The Showground at Wayville is serviced by tram. Free City Connector bus loops through the CBD.",localInsight:"Adelaide's secret weapon is its wine regions \u2014 Barossa Valley, McLaren Vale, Adelaide Hills, and Clare Valley are all within an hour's drive. Corporate events frequently combine city conferences with vineyard dinners. The Lot Fourteen precinct has attracted the Australian Space Agency and global tech companies, creating a new wave of innovation-sector events.",nearbyRegions:["Barossa Valley","McLaren Vale","Adelaide Hills","Clare Valley"]},canberra:{slug:"canberra",name:"Canberra",state:"ACT",stateFullName:"Australian Capital Territory",region:"ACT",heroSubtitle:"Australia's capital city",metaCityName:"Canberra",population:"460,000",coordinates:{lat:-35.2809,lng:149.13},timezone:"AEST (UTC+10)",airportCode:"CBR",airportDistance:"8km from CBD",intro:"Canberra is the undisputed national capital of government, defence, and public policy events. Unlike any other Australian city, Canberra's national institutions \u2014 the National Gallery, National Museum, Australian War Memorial, and Parliament House itself \u2014 all function as premium event venues, offering once-in-a-lifetime backdrops for gala dinners beside world-class art and lakeside cocktail receptions.",venues:[{name:"National Convention Centre Canberra",fullName:"National Convention Centre Canberra",suburb:"Canberra CBD",type:"convention",capacity:"4,000 delegates across 15 spaces",description:"The capital's largest purpose-built conference venue with 8,200 sqm of flexible space, multiple theatres, ballrooms, and dedicated exhibition areas.",keywords:["NCCC","National Convention Centre","Canberra convention centre"]},{name:"Parliament House",suburb:"Capital Hill",type:"heritage",capacity:"1,000 in Great Hall",description:"14 event spaces including the Great Hall and Marble Foyer for large-scale functions, with private dining rooms and intimate alcoves.",keywords:["Parliament House events","Capital Hill venue"]},{name:"Old Parliament House",fullName:"Museum of Australian Democracy",suburb:"Parkes",type:"heritage",capacity:"Heritage conference and gala spaces",description:"Heritage venue for conferences, cocktail evenings, and gala dinners combining museum setting with event hosting.",keywords:["Old Parliament House","MoAD events"]},{name:"QT Canberra",suburb:"NewActon",type:"hotel",capacity:"1,000 in QT Ballroom",description:"Design-forward boutique hotel with a pillarless QT Ballroom divisible into 3 spaces, plus 7 additional meeting rooms overlooking Lake Burley Griffin.",keywords:["QT Canberra","NewActon events"]},{name:"Exhibition Park in Canberra",fullName:"EPIC",suburb:"Mitchell",type:"exhibition",capacity:"Large exhibition facility",description:"Major exhibition and outdoor event facility hosting the Royal Canberra Show and large trade exhibitions.",ke
1ywords:["EPIC Canberra","Mitchell events","Royal Canberra Show"]}],uniqueVenues:[{name:"National Gallery of Australia",type:"Gandel Hall with lakeside views",capacity:"900 cocktail"},{name:"National Museum of Australia",type:"Garden of Australian Dreams",capacity:"1,000 cocktail"},{name:"Australian War Memorial",type:"State-of-the-art event facilities",capacity:"Conferences and galas"},{name:"National Press Club",type:"Iconic venue for political and business addresses",capacity:"Seminars and networking"},{name:"Hotel Realm",type:"5-star venue adjacent to Parliamentary Triangle",capacity:"Ballrooms, terraces, gardens"}],precincts:[{name:"Parliamentary Triangle",description:"Ceremonial precinct formed by Commonwealth, Kings, and Constitution Avenues \u2014 the symbolic and functional heart of Australian government. Home to Parliament House, National Gallery, High Court, and National Library.",industries:["Government","Defence","Diplomacy","Public policy"]},{name:"Barton Precinct",description:"Prestigious government office location south of Lake Burley Griffin. Home to DFAT, AFP, and Attorney-General's Department. New National Security Precinct under construction for 5,000 public servants.",industries:["National security","Foreign affairs","Law enforcement","Government"]},{name:"Civic (Canberra City Centre)",description:"Principal commercial area as per Walter Burley Griffin's original plan. Major redevelopment underway with Crystalbrook Aurora hotel opening with conference facilities.",industries:["Commerce","Hospitality","Retail","Professional services"]}],annualEvents:[{name:"Floriade",when:"September-October",description:"Australia's biggest celebration of spring \u2014 1 million+ flowers in Commonwealth Park (free event)"},{name:"Enlighten Festival",when:"February-March",description:"Architectural light projections illuminating Parliament House, National Gallery, and iconic buildings"},{name:"Summernats",when:"January",description:"Australia's biggest car festival at EPIC"},{name:"BSides Canberra",when:"Annual",description:"Major cybersecurity conference with 3,500+ attendees"},{name:"National Multicultural Festival",when:"February",description:"Free street party celebrating cultural diversity"}],seasonalNotes:{peak:"February to May and September to November \u2014 when Parliament is sitting and government/policy conferences are most active.",secondary:"September to October \u2014 Floriade brings significant tourism and social event activity.",quiet:"December to January \u2014 government in recess, summer holidays.",weather:"Four distinct seasons. Cold winters (can drop below 0\xb0C). Warm dry summers. Autumn colours are spectacular and popular for outdoor events."},transportNotes:"Canberra Airport is only 8km from the CBD (10 minutes by car). Light Rail runs from Gungahlin through the city centre. Most national institutions in the Parliamentary Triangle are walkable or a short drive apart.",localInsight:"Canberra events are uniquely shaped by the parliamentary calendar. When Parliament sits, the city buzzes with political events, policy launches, and industry receptions. The national institutions offer event backdrops unavailable anywhere else in Australia \u2014 gala dinners beside a Jackson Pollock at the National Gallery, or cocktails at the War Memorial.",nearbyRegions:["Snowy Mountains","South Coast NSW","Yass Valley"]},hobart:{slug:"hobart",name:"Hobart",state:"TAS",stateFullName:"Tasmania",region:"Greater Hobart",heroSubtitle:"Australia's boutique event city",metaCityName:"Hobart",population:"240,000",coordinates:{lat:-42.8821,lng:147.3272},timezone:"AEST (UTC+10)",airportCode:"HBA",airportDistance:"17km from CBD",intro:"Hobart has been transformed by MONA into one of Australia's most culturally distinctive cities. Business events generate approximately $199 million annually to Tasmania, with an average 4.7 nights stayed per conference delegate. The compact, walkable waterfront precinct \u2014 Salamanca, Sullivan Cove, Constitution Dock \u2014 offers boutique, art-infused event experiences unavailable anywhere else in Australia.",venues:[{name:"HCEC",fullName:"Hobart Convention & Exhibition Centre",suburb:"Hobart Waterfront",type:"convention",capacity:"1,100 delegates",description:"Tasmania's largest purpose-built conference venue with 11 flexible function spaces, 2,000 sqm exhibition area, and 125 trade exhibition booths overlooking the waterfront.",keywords:["HCEC","Hobart Convention Centre","Hobart waterfront events"]},{name:"Wrest Point",fullName:"Wrest Point Hotel & Convention Centre",suburb:"Sandy Bay",type:"entertainment",capacity:"1,650 theatre-style",description:"Australia's first purpose-built convention and entertainment c
1omplex (opened 1984) and home of Australia's first legal casino (1973), on the Derwent River waterfront.",keywords:["Wrest Point","Sandy Bay events","Wrest Point convention"]},{name:"PW1",fullName:"Princes Wharf No. 1",suburb:"Salamanca",type:"heritage",capacity:"1,300",description:"Tasmania's premier event venue \u2014 an 1830s port warehouse converted into a flexible heritage sandstone event space on the Salamanca waterfront.",keywords:["PW1","Princes Wharf","Salamanca events"]},{name:"The Hedberg",suburb:"Central Hobart",type:"arts",capacity:"229 in Recital Hall",description:"$117 million performing arts precinct opened 2021, designed by LIMINAL Architecture and WOHA, with world-class variable acoustics.",keywords:["The Hedberg","Hobart performing arts"]}],uniqueVenues:[{name:"MONA",type:"Australia's largest private museum \u2014 3 levels underground",capacity:"500 cocktail in The Void (13m underground)"},{name:"Henry Jones Art Hotel",type:"Australia's first art hotel (heritage site from 1804)",capacity:"500 in Glass Atrium"},{name:"Salamanca Arts Centre",type:"7 heritage sandstone buildings, 60+ artists",capacity:"Galleries and performance spaces"},{name:"Tasmanian Museum and Art Gallery",type:"Central waterfront museum",capacity:"Functions and exhibitions"}],precincts:[{name:"Salamanca Place & Sullivan Cove",description:"Historic sandstone warehouse precinct from the 1830s-1840s, now a vibrant cultural and commercial hub. Home to the iconic Saturday Salamanca Market.",industries:["Arts","Culture","Tourism","Boutique retail"]},{name:"Hobart CBD & Franklin Square",description:"Low-rise heritage character with concentrated state government offices. Intimate walkable city centre with green civic spaces.",industries:["Government","Professional services"]},{name:"Macquarie Point",description:"9.3-hectare waterfront redevelopment between CBD and Port of Hobart. Proposed multi-purpose stadium, cultural zone, and mixed-use commercial precinct.",industries:["Development","Antarctic research","Mixed use"]}],annualEvents:[{name:"Dark Mofo",when:"June",description:"MONA's mid-winter arts and culture festival celebrating the solstice with large-scale installations and the Winter Feast"},{name:"Taste of Summer",when:"December-January",description:"Major food and beverage festival at Salamanca and the waterfront"},{name:"Australian Antarctic Research Conference",when:"Annual",description:"Hobart is Australia's gateway to Antarctica \u2014 inaugural event attracted 450+ polar researchers"},{name:"Open House Hobart",when:"Annual",description:"Architecture and design festival opening notable buildings to the public"}],seasonalNotes:{peak:"November to March \u2014 summer season with longest daylight hours and warmest weather. Taste of Summer festival period.",secondary:"June \u2014 Dark Mofo brings thousands of visitors for the winter solstice festival.",quiet:"July to September \u2014 cold, quiet winter (outside Dark Mofo period).",weather:"Cool maritime climate. Cool-climate wines and premium local produce add a distinctive hospitality dimension to every event."},transportNotes:"Hobart Airport is 17km from CBD (20 minutes by car). No public transport from airport (shuttle or taxi). The waterfront precinct is compact and walkable \u2014 Salamanca, Sullivan Cove, Constitution Dock, and Battery Point are all within minutes of each other.",localInsight:"MONA has single-handedly transformed Hobart's cultural identity since 2011. The MONA ferry from Brooke Street Pier is itself an event experience. PW1, Henry Jones Art Hotel, and MONA offer genuinely unique, art-infused event experiences unavailable elsewhere in Australia. Tasmania's cool-climate wines and premium produce add a hospitality dimension that larger cities struggle to match.",nearbyRegions:["Cradle Mountain","Freycinet / Wineglass Bay","Bruny Island","Huon Valley"]},darwin:{slug:"darwin",name:"Darwin",state:"NT",stateFullName:"Northern Territory",region:"Top End",heroSubtitle:"Australia's tropical gateway",metaCityName:"Darwin",population:"150,000",coordinates:{lat:-12.4634,lng:130.8456},timezone:"ACST (UTC+9:30)",airportCode:"DRW",airportDistance:"13km from CBD",intro:"Darwin is Australia's frontline for northern defence, with Robertson Barracks, RAAF Base Darwin, and the US Marine Rotational Force driving a significant defence-industry event market. The dry season (May to October) delivers near-perfect outdoor event conditions with warm tropical evenings and guaranteed clear skies \u2014 a unique advantage no other Australian capital can offer.",venues:[{name:"Darwin Convention Centre",suburb:"Darwin Waterfront Precinct",type:"convention",capacity:"4,700 cocktail / 3,660 theatre",description:"Northern Territory's largest conference facility with 23,000 sqm of event space,
115 minutes from Darwin Airport. Hosts business conferences, high-profile summits, and the Darwin Aboriginal Art Fair.",keywords:["Darwin Convention Centre","Darwin Waterfront events"]},{name:"Mindil Beach Casino Resort",suburb:"Mindil Beach",type:"entertainment",capacity:"Multiple premium spaces",description:"Darwin's only five-star resort with The Lawns overlooking the Arafura Sea, Beachside Pavilion with floor-to-ceiling glass, and the Grand Ballroom. Guaranteed near-perfect outdoor event weather in the dry season.",keywords:["Mindil Beach Casino Resort","Darwin resort events"]},{name:"Pee Wee's at the Point",suburb:"Fannie Bay",type:"unique",capacity:"200 indoor / 400 lawn",description:"Darwin's premier waterfront restaurant and function complex at East Point Reserve with sweeping views across Fannie Bay to the Darwin skyline.",keywords:["Pee Wee's at the Point","Fannie Bay events","East Point events"]}],uniqueVenues:[{name:"Stokes Hill Wharf",type:"Historic wharf with restaurants and museum",capacity:"Event functions"},{name:"Deckchair Cinema",type:"Outdoor dry-season cinema",capacity:"Quintessentially Darwin"},{name:"Crocodylus Park",type:"Unique Northern Territory event experience",capacity:"1,000 standing"},{name:"Parliament House of the Northern Territory",type:"Distinctive civic building",capacity:"Government functions"}],precincts:[{name:"Darwin Waterfront Precinct",description:"Billion-dollar waterfront redevelopment around Stokes Hill Wharf, home to the Darwin Convention Centre, wave lagoon, restaurants, and year-round free events.",industries:["Events","Tourism","Hospitality"]},{name:"Darwin CBD / Mitchell Street",description:"Darwin's central business and hospitality district, home to Parliament House and the main commercial/nightlife spine.",industries:["Government","Hospitality","Commerce"]},{name:"Defence Precinct",description:"Robertson Barracks (1st Brigade), RAAF Base Darwin, and Larrakeyah Barracks. US Marine Rotational Force deploys annually (March-October). Defence is a major economic driver.",industries:["Defence","Military","National security"]}],annualEvents:[{name:"Darwin Festival",when:"August",description:"18-day arts festival with outdoor concerts, theatre, dance, and comedy"},{name:"Darwin Aboriginal Art Fair",when:"August",description:"Premier Indigenous art fair at Darwin Convention Centre \u2014 celebrating 20 years in 2026"},{name:"National Indigenous Music Awards",when:"August",description:"Annual celebration on Larrakia Country"},{name:"NT Resources Week",when:"September",description:"Combined SEAAOC, Mining The Territory, and Environmental Management Forum at Darwin Convention Centre"},{name:"Mindil Beach Sunset Market",when:"May-October",description:"Iconic dry-season Thursday and Sunday evening market"},{name:"NT Defence Week",when:"April",description:"Flagship defence industry program showcasing the Territory's strategic role"}],seasonalNotes:{peak:"May to October \u2014 the dry season. Near-perfect event conditions with sunny skies, low humidity, and warm tropical evenings. The vast majority of outdoor events, conferences, and festivals cluster here.",secondary:"August \u2014 Darwin Festival, Aboriginal Art Fair, and NIMAs create a concentrated cultural event season.",quiet:"December to March \u2014 wet season with monsoon rains, high humidity (70%+), thunderstorms, and potential cyclones. Most large outdoor events avoid this period.",weather:"Tropical climate with two distinct seasons: the Dry (May-October) and the Wet (November-April). Outdoor evening events in the dry season are a major selling point."},transportNotes:"Darwin Airport is 13km from CBD (15 minutes by car). Limited public transport \u2014 most delegates use taxis, ride-share, or venue shuttles. The Waterfront Precinct is walkable from the CBD.",localInsight:"Darwin's event calendar is shaped by two forces: the dry season weather and the defence sector. NT Defence Week and the annual US Marine Rotational Force deployment (March-October) drive significant military and defence-industry events. First Nations culture has a strong presence \u2014 the Darwin Aboriginal Art Fair and National Indigenous Music Awards are nationally significant cultural events.",nearbyRegions:["Kakadu National Park","Litchfield National Park","Tiwi Islands","Katherine"]},geelong:{slug:"geelong",name:"Geelong",state:"VIC",stateFullName:"Victoria",regi
1on:"Greater Geelong & Surf Coast",heroSubtitle:"Victoria's second city & events gateway",metaCityName:"Geelong",population:"270,000",coordinates:{lat:-38.1499,lng:144.3617},timezone:"AEST (UTC+10)",airportCode:"AVV",airportDistance:"20km (Avalon Airport)",intro:"Geelong has transformed into one of Victoria's most exciting event destinations. The opening of Nyaal Banyul \u2014 Geelong Convention and Event Centre (GCEC) in July 2026 gives Victoria's second-largest city, just one hour from Melbourne, its first purpose-built convention and exhibition venue. With a revitalised waterfront precinct, growing corporate presence from WorkSafe Victoria, TAC, and NDIS headquarters, and easy access via the M1 freeway and V/Line rail, Geelong offers event organisers a compelling waterfront alternative to Melbourne with lower costs, excellent accommodation, and strong local government support for business events.",venues:[{name:"Nyaal Banyul",fullName:"Nyaal Banyul - Geelong Convention and Event Centre",suburb:"Geelong Waterfront",type:"convention",capacity:"1,000-seat theatre + 3,700m\xb2 event space",description:"Geelong's landmark convention and event centre, opened July 2026 on the Geelong waterfront. State-of-the-art facilities for conferences, exhibitions, gala dinners, and large-scale corporate events. Victoria's newest purpose-built convention venue with waterfront views over Corio Bay.",keywords:["Nyaal Banyul","Nyaal Banyul Geelong","GCEC","Geelong Convention Centre","Geelong Convention and Event Centre","Geelong waterfront events","Geelong conference venue"],href:"/venues/nyaal-banyul-geelong"},{name:"Deakin Waterfront Campus",fullName:"Deakin University Waterfront Campus",suburb:"Geelong",type:"convention",capacity:"Conference and seminar facilities",description:"Deakin's waterfront campus offers conference, seminar, and workshop spaces overlooking Corio Bay. Popular for academic conferences, industry symposiums, and corporate training events in Geelong.",keywords:["Deakin Waterfront","Geelong university venue","Deakin conference"]},{name:"GMHBA Stadium",fullName:"GMHBA Stadium (Kardinia Park)",suburb:"South Geelong",type:"entertainment",capacity:"36,000 stadium / corporate hospitality suites",description:"Home of the Geelong Cats AFL club with premium corporate hospitality suites, function rooms, and event spaces overlooking the arena. Major corporate entertainment and sporting event venue in Geelong.",keywords:["GMHBA Stadium","Kardinia Park","Geelong Cats venue","Geelong stadium events"]},{name:"The Pier Geelong",suburb:"Geelong Waterfront",type:"heritage",capacity:"Multiple event spaces",description:"Restored heritage pier on the Geelong waterfront with function spaces offering panoramic views of Corio Bay. Popular for corporate dinners, awards nights, and private events.",keywords:["The Pier Geelong","Geelong waterfront venue","Cunningham Pier"]},{name:"Geelong Library & Heritage Centre",fullName:"Geelong Library & Heritage Centre (The Dome)",suburb:"Geelong CBD",type:"heritage",capacity:"Conference and event spaces",description:"Award-winning architectural landmark in the Geelong CBD with modern conference and event facilities beneath its iconic dome structure.",keywords:["Geelong Library","The Dome Geelong","Geelong CBD venue"]}],uniqueVenues:[{name:"National Wool Museum",type:"Heritage bluestone woolstore with exhibition and event spaces",capacity:"Functions and exhibitions"},{name:"Novotel Geelong",type:"Waterfront hotel with conference and event facilities",capacity:"Multiple function rooms"},{name:"Geelong Boat House",type:"Waterfront dining and private event space",capacity:"Private functions"},{name:"Geelong Arts Centre",type:"Recently redeveloped performing arts and event venue",capacity:"Multiple spaces"}],precincts:[{name:"Geelong Waterfront",description:"The revitalised Geelong waterfront precinct stretching from Cunningham Pier to the Carousel Pavilion, now anchored by the Nyaal Banyul Convention and Event Centre. A major hub for events, hospitality, and tourism.",industries:["Events","Tourism","Hospitality","Government"]},{name:"Geelong CBD & Civic Precinct",description:"The commercial heart of Greater Geelong with major employers including WorkSafe Victoria, TAC, NDIS headquarters, and regional offices of major corporations.",industries:["Government","Insurance","Professional services","Retail"]},{name:"Deakin University / Waurn Ponds",description:"Geelong's education and innovation hub home to Deakin University, Epworth Geelong Hospital, and the Geelong Technology Precinct. Growing corridor for research, health, and tech events.",industries:["Education","Health","Research","Technology"]}],annualEvents:[{name:"AFL at GMHBA Stadium",when:"March-September",description:"Geelong Cats home games with corporate hospital
1ity and event photography opportunities throughout the AFL season"},{name:"Pako Festa",when:"February",description:"One of Victoria's largest multicultural street festivals along Pakington Street"},{name:"Royal Geelong Show",when:"October",description:"Annual agricultural show and community event at the Geelong Showgrounds"},{name:"Geelong Revival Motoring Festival",when:"November",description:"Motorsport festival along the Geelong waterfront attracting national attention"}],seasonalNotes:{peak:"Year-round from July 2026 \u2014 the newly opened Nyaal Banyul is driving a new wave of conferences and events in Geelong. AFL season (March-September) drives corporate hospitality photography demand.",secondary:"October to March \u2014 Warmer months bring outdoor waterfront events, festivals, and corporate functions along Corio Bay.",quiet:"Mid-winter outside of AFL season \u2014 though the newly opened Nyaal Banyul now drives year-round conference activity.",weather:"Temperate coastal climate, slightly cooler than Melbourne. Waterfront venues can be breezy \u2014 always pack wind-resistant equipment for outdoor setups."},transportNotes:"Geelong is 75km southwest of Melbourne (1 hour via M1 freeway). V/Line trains run every 20 minutes from Melbourne's Southern Cross Station to Geelong Station (55 minutes). Avalon Airport is 20 minutes away. The Nyaal Banyul Convention Centre and waterfront venues are walkable from Geelong Station.",localInsight:"Geelong is rapidly transitioning from its manufacturing heritage into a knowledge, health, and events economy. The opening of Nyaal Banyul \u2014 Geelong Convention and Event Centre (GCEC) in July 2026 was a landmark moment, giving the city its first purpose-built convention venue on the waterfront. Event organisers looking beyond Melbourne now have a premium waterfront alternative with lower venue costs, easy access, and growing accommodation stock. Photography here benefits from stunning Corio Bay waterfront light and a compact, walkable events precinct.",nearbyRegions:["Melbourne","Great Ocean Road","Bellarine Peninsula","Surf Coast","Colac & Otway"]}},n=Object.keys(a),r=e=>a[e],i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;const s=a[e];return s?s.venues.slice(0,t).map(e=>e.name).join(", "):""},o=a},48696:(e,t,s)=>{var a=s(65043),n=s(84391),r=s(25352),i=s(79722),o=s(34458);let l=!1;const c=()=>{l||(l=!0,(0,o._p)(),window.location.href="/tboadmin")};var d=s(49367),m=s(89379),p=s(82054),x=s(76245),h=s(77819),u=s(57856),g=s(40614),f=s(70579);const b=e=>{let{message:t,type:s="info",duration:n=3e3,onClose:r}=e;const[i,o]=(0,a.useState)(!0),[l,c]=(0,a.useState)(!1);(0,a.useEffect)(()=>{const e=setTimeout(()=>{c(!0),setTimeout(()=>{o(!1),null===r||void 0===r||r()},300)},n);return()=>clearTimeout(e)},[n,r]);if(!i)return null;const d={success:{bg:"bg-gradient-to-r from-green-500 to-emerald-600",icon:p.A,border:"border-green-400"},error:{bg:"bg-gradient-to-r from-red-500 to-rose-600",icon:x.A,border:"border-red-400"},warning:{bg:"bg-gradient-to-r from-yellow-500 to-amber-600",icon:h.A,border:"border-yellow-400"},info:{bg:"bg-gradient-to-r from-blue-500 to-cyan-600",icon:u.A,border:"border-blue-400"}},m=d[s]||d.info,b=m.icon;return(0,f.jsx)("div",{className:"fixed top-4 right-4 z-[9999] transform transition-all duration-300 ".concat(l?"translate-x-full opacity-0":"translate-x-0 opacity-100"),children:(0,f.jsx)("div",{className:"".concat(m.bg," text-white px-6 py-4 rounded-2xl shadow-2xl border-2 ").concat(m.border," min-w-[320px] max-w-md"),children:(0,f.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,f.jsx)(b,{className:"h-6 w-6 flex-shrink-0 mt-0.5"}),(0,f.jsx)("p",{className:"flex-1 font-semibold text-sm leading-relaxed",children:t}),(0,f.jsx)("button",{onClick:()=>{c(!0),setTimeout(()=>{o(!1),null===r||void 0===r||r()},300)},className:"flex-shrink-0 hover:bg-white/20 rounded-lg p-1 transition-colors",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]})})})},y=e=>{let{toasts:t,removeToast:s}=e;return(0,f.jsx)("div",{className:"fixed top-4 right-4 z-[9999] space-y-3",children:t.map(e=>(0,f.jsx)(b,{message:e.message,type:e.type,duration:e.duration,onClose:()=>s(e.id)},e.id))})};var v=s(37719);const j=e=>{let{isOpen:t,onClose:s,onConfirm:a,title:n,message:r,type:i="warning",confirmText:o="Confirm",cancelText:l="Cancel",confirmColor:c="red"}=e;if(!t)return null;const d={warning:v.A,success:p.A,error:x.A,info:u.A},m=d[i]||d.warning;return(0,f.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:s}),(0,f.jsxs)("div",{className:"relative bg-white rounded-3xl shadow-2xl max-w-md w-full p-8 transform transition-all animate-in zoom-in-95 duration-200",children:[(0,f.jsx)("div",{className:"mx-auto w-16 h-16 ".concat({warning:"bg-yellow-100",success:"bg-green-100",error:"bg-red-100",info:"bg-blue-100"}[i]," rounded-full flex items-center justify-center mb-6"),children:(0,f.jsx)(m,{className:"h-8 w-8 ".concat({warning:"text-yellow-500",success:"text-green-500",error:"text-red-500",info:"text-blue-500"}[i])})}),(0,f.jsx)("h3",{className:"text-2xl font-extrabold text-gray-900 text-center mb-4",children:n}),(0,f.jsx)("p",{className:"text-gray-600 text-center mb-8 leading-relaxed",children:r}),(0,f.jsxs)("div",{className:"flex gap-4",children:[(0,f.jsx)("button",{onClick:s,className:"flex-1 px-6 py-3 bg-gray-100 hover:bg-gray-200 text-gray-900 rounded-xl font-bold transition-all border-2 border-gray-300",children:l}),(0,f.jsx)("button",{onClick:()=>{a(),s()},className:"flex-1 px-6 py-3 ".concat({red:"bg-gradient-to-r from-red-600 to-red-700 hover:from-red-700 hover:to-red-800",blue:"bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800",green:"bg-gradient-to-r from-green-600 to-green-700 hover:from-green-700 hover:to-green-800",purple:"bg-gradient-to-r from-purple-600 to-purple-700 hover:from-purple-700 hover:to-purple-800"}[c]," text-white rounded-xl font-bold shadow-lg transition-all"),children:o})]})]})]})},w=(0,a.createContext)(),N=()=>{const e=(0,a.useContext)(w);if(!e)throw new Error("useNotification must be used within NotificationProvider");return e},A=e=>{let{children:t}=e;const[s,n]=(0,a.useState)([]),[r,i]=(0,a.useState)({isOpen:!1}),o=(0,a.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;const a=Date.now()+Math.random();n(n=>[...n,{id:a,message:e,type:t,duration:s}])},[]),l=(0,a.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]),c={success:(e,t)=>o(e,"success",t),error:(e,t)=>
1o(e,"error",t),warning:(e,t)=>o(e,"warning",t),info:(e,t)=>o(e,"info",t)},d=(0,a.useCallback)(e=>{let{title:t="Are you sure?",message:s="This action cannot be undone.",type:a="warning",confirmText:n="Confirm",cancelText:r="Cancel",confirmColor:o="red",onConfirm:l=()=>{}}=e;return new Promise(e=>{i({isOpen:!0,title:t,message:s,type:a,confirmText:n,cancelText:r,confirmColor:o,onConfirm:()=>{l(),e(!0)},onCancel:()=>{e(!1)}})})},[]),p=(0,a.useCallback)(()=>{r.onCancel&&r.onCancel(),i({isOpen:!1})},[r]);return(0,f.jsxs)(w.Provider,{value:{toast:c,confirm:d},children:[t,(0,f.jsx)(y,{toasts:s,removeToast:l}),r.isOpen&&(0,f.jsx)(j,(0,m.A)((0,m.A)({},r),{},{onClose:p,onConfirm:r.onConfirm}))]})},k=()=>{const e=(()=>{if("undefined"===typeof window)return!1;const e=window.location.hostname;return"portal.turbo360.au"===e||"portal.turbo360.com.au"===e})();return{isPortalSubdomain:e,showMainNavigation:!e,showFooter:!e,hideRadioPlayer:e,autoRedirectToLogin:e,portalBranding:{title:e?"Turbo 360 Client Portal":"Turbo 360",logo:e?"/Turbo ICO Red.png":"/logo.png"}}};var S=s(85692),_=s(35087),C=s(28006),F=s(20073),E=s(91286),T=s(35327),z=s(1081),B=s(66990),D=s(43393),I=s(63574),R=s(9624);const P=e=>{let{items:t=[],speed:s=40,reverse:n=!1,className:r="",itemClass:i="",separator:o}=e;if(!t.length)return null;const l=[...t,...t],c=void 0!==o?o:(0,f.jsx)("span",{"aria-hidden":"true",className:"inline-block w-2 h-2 rounded-full bg-turbo-red/70 mx-8 align-middle"});return(0,f.jsxs)("div",{className:"relative overflow-hidden w-full ".concat(r),style:{maskImage:"linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%)",WebkitMaskImage:"linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%)"},children:[(0,f.jsx)("div",{className:"flex w-max items-center whitespace-nowrap",style:{animation:"marquee-scroll ".concat(s,"s linear infinite"),animationDirection:n?"reverse":"normal"},children:l.map((e,t)=>(0,f.jsxs)(a.Fragment,{children:[(0,f.jsx)("span",{className:"inline-block ".concat(i),children:e}),c]},t))}),(0,f.jsx)("style",{children:"\n @keyframes marquee-scroll {\n 0% { transform: translateX(0); }\n 100% { transform: translateX(-50%); }\n }\n "})]})},W=e=>{let{value:t,prefix:s="",suffix:n="",duration:r=1600,className:i="",numberClass:o=""}=e;const l=(0,a.useRef)(null),[c,d]=(0,a.useState)(0),m=(0,a.useRef)(!1);return(0,a.useEffect)(()=>{const e=l.current;if(!e||m.current)return;const s=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting&&!m.current){m.current=!0,s.disconnect();const e=performance.now(),a=s=>{const n=Math.min(1,(s-e)/r),i=1-Math.pow(1-n,3);d(Math.round(i*t)),n<1&&requestAnimationFrame(a)};requestAnimationFrame(a)}})},{threshold:.4});return s.observe(e),()=>s.disconnect()},[t,r]),(0,f.jsx)("span",{ref:l,className:i,children:(0,f.jsxs)("span",{className:o,children:[s,c.toLocaleString(),n]})})};var O=s(70316),L=s(44604);const M=[{category:"01 / CONFERENCES",title:"Multi-day, multi-camera",blurb:"Auditorium coverage, panel cutaways, sponsor activations \u2014 broadcast-ready before the closing keynote.",image:"/images/services/locations/conference-auditorium-wide.jpg",href:"/conferences"},{category:"02 / EXHIBITIONS",title:"Same-day floor stories",blurb:"Exhibition reels delivered while the doors are still open. Stand-by-stand coverage, edited live on the floor.",image:"/images/services/locations/exhibition-award-ceremony.jpg",href:"/business"},{category:"03 / KEYNOTES",title:"Speakers, sharp + cinematic",blurb:"Long-lens speaker portraits, audience reactions, and a hero edit ready for socials by the time they leave the stage.",image:"/images/services/locations/event-coverage-keynote.jpg",href:"/business"}],q=[{num:"01",title:"Business",blurb:"Corporate productions, polished.",image:"/images/services/business-service.jpg",href:"/business"},{num:"02",title:"Conferences",blurb:"Multi-day, multi-camera, broadcast-ready.",image:"/images/services/locations/conference-auditorium-wide.jpg",href:"/conferences"}
1,{num:"03",title:"Schools",blurb:"Editorial-grade school media.",image:"/images/services/locations/corporate-event-audience.jpg",href:"/schools"},{num:"04",title:"Development",blurb:"Custom websites & apps, built in-house.",image:"/images/services/development-service.jpg",href:"/development"},{num:"05",title:"Weddings",blurb:"Wedding films + photography.",image:"/images/services/weddings-service.jpg",href:"https://weddings.turbo.net.au"},{num:"06",title:"Live Streaming",blurb:"Real-time broadcast to global audiences.",image:"/images/services/locations/event-coverage-panel-speaker.jpg",href:"/services"}],H=[{value:180,suffix:"+",label:"5-star reviews"},{value:24,suffix:"hr",label:"Same-day delivery"},{value:25,suffix:"+",label:"Years experience"},{value:3,suffix:"",label:"Countries covered"}],U=["sydney","melbourne","brisbane","perth","adelaide","canberra","hobart","darwin","geelong"],G=e=>{let{num:t,label:s,center:a=!1}=e;return(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-6 ".concat(a?"justify-center":""),children:[(0,f.jsx)("span",{className:"inline-block w-12 h-px bg-turbo-red"}),(0,f.jsxs)("span",{className:"text-xs font-bold text-turbo-red uppercase tracking-[0.4em]",children:[t," / ",s]})]})},V=e=>{let{children:t}=e;return(0,f.jsx)("h2",{className:"text-5xl md:text-6xl lg:text-7xl font-black leading-[0.95] mb-6",children:t})},J=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)("EXPO"),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(navigator.webdriver)return;const e=()=>c(!0);if("complete"!==document.readyState)return window.addEventListener("load",e,{once:!0}),()=>window.removeEventListener("load",e);e()},[]);const d=n.length?"recent-gigs":"work",p=e=>{var t;e.preventDefault(),null===(t=document.getElementById(d))||void 0===t||t.scrollIntoView({behavior:"smooth"})};(0,a.useEffect)(()=>{"true"===new URLSearchParams(window.location.search).get("admin")&&e((0,o.cd)()?"/admin":"/tboadmin")},[e]),(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await fetch("".concat(I.fn,"/api/settings/public"));if(!t.ok)return;const a=await t.json();e||s(a.homepage_video_selection||"EXPO")}catch(t){e||s("EXPO")}})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await fetch("".concat(I.fn,"/api/public/recent-gigs"));if(!t.ok)return;const s=await t.json();!e&&s.success&&i(s.gigs||[])}catch(t){}})(),()=>{e=!0}},[]);const x=U.map(e=>(0,L.KM)(e)).filter(Boolean);return(0,f.jsxs)("div",{className:"min-h-screen bg-dark-bg text-white pt-20",children:[(0,f.jsx)(R.A,(0,m.A)({},R.p.home)),(0,f.jsx)(D.A,{currentPage:"Home"}),(0,f.jsxs)("section",{id:"hero",className:"turbo-hero relative h-[calc(100svh-2.5rem)] flex items-end overflow-hidden bg-[#141414]",children:[(0,f.jsxs)("div",{className:"absolute inset-0 z-0",children:[l?(0,f.jsxs)("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-cover",poster:O.l4.heroBackground,children:[(0,f.jsx)("source",{src:"FOOD"===t||"FOOD_EXTENDED"===t?"/food_video_extended.mp4":"WEBBG"===t?"/webbg_compressed.mp4":"/hero_video_compressed.mp4",type:"video/mp4"}),(0,f.jsx)("img",{src:O.l4.heroBackground,alt:"Same-day event photography and video production team at Brisbane corporate conference",className:"w-full h-full object-cover"})]},t):(0,f.jsx)("img",{src:O.l4.heroBackground,alt:"Same-day event photography and video production team at Brisbane corporate conference",className:"w-full h-full object-cover"}),(0,f.jsx)("div",{className:"absolute top-0 left-0 right-0 h-32 bg-gradient-to-b from-white/55 via-white/15 to-transparent"}),(0,f.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-[62%] bg-gradient-to-t from-[#141414] via-[#141414]/55 to-transparent"})]}),(0,f.jsxs)("svg",{viewBox:"0 0 100 100","aria-hidden":"true",className:"pointer-events-none absolute -top-16 -right-12 h-72 w-72 lg:h-[28rem] lg:w-[28rem] text-white/[0.05] z-[1]",fill:"none",stroke:"currentColor",strokeWidth:"14",strokeLinecap:"round",children:[(0,f.jsx)("path",{d:"M10 26 A64 64 0 0 1 74 90"}),(0,f.jsx)("path",{d:"M10 56 A34 34 0 0 1 44 90"})]}),(0,f.jsxs)("div",{className:"relative z-10 w-full pb-24 md:pb-28",children:[(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,f.jsxs)("div",{className:"max-w-5xl",children:[(0,f.jsxs)("div",{className:"inline-flex items-center gap-3 mb-8 th-fade",children:[(0,f.jsxs)("span",{className:"relative flex h-2.5 w-2.5",children:[(0,f.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-[#BF212F] opacity-75"}),(0,f.jsx)("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-[#BF212F]"})]}),(0,f.jsx)("span",{className:"th-mono text-white text-[11px] md:text-xs",children:"Same-day \xb7 Australia-wide"})]}),(0,f.jsxs)("h1",{className:"th-display font-black leading-[0.92] mb-8 [f
1ilter:drop-shadow(0_3px_18px_rgba(0,0,0,0.55))_drop-shadow(0_1px_4px_rgba(0,0,0,0.7))]",children:[(0,f.jsx)("span",{className:"block text-[2.5rem] sm:text-5xl md:text-7xl lg:text-8xl text-white th-up",children:"Event coverage,"}),(0,f.jsx)("span",{className:"block text-[2.5rem] sm:text-5xl md:text-7xl lg:text-8xl lg:whitespace-nowrap text-[#BF212F] th-up",style:{animationDelay:"0.12s"},children:"delivered same-day."})]}),(0,f.jsx)("p",{className:"text-lg md:text-xl text-gray-200 max-w-2xl mb-10 th-up drop-shadow-[0_2px_10px_rgba(0,0,0,0.75)]",style:{animationDelay:"0.24s"},children:"Conferences, corporate events, weddings, schools \u2014 captured by an in-house crew and edited while the doors are still open."}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 items-stretch sm:items-start th-up",style:{animationDelay:"0.36s"},children:[(0,f.jsxs)(r.N_,{to:"/get-quote",className:"group inline-flex items-center justify-center gap-3 px-8 py-4 bg-[#BF212F] hover:bg-[#8E1822] text-white rounded-lg transition-colors duration-200",children:[(0,f.jsx)("span",{className:"th-mono text-sm",children:"Get a Quote"}),(0,f.jsx)(S.A,{className:"h-5 w-5 group-hover:translate-x-1 transition-transform"})]}),(0,f.jsxs)("a",{href:"#".concat(d),onClick:p,className:"group inline-flex items-center justify-center gap-3 px-8 py-4 border border-white/30 hover:border-white text-white rounded-lg transition-colors duration-200",children:[(0,f.jsx)(_.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"th-mono text-sm",children:"See the Work"})]})]})]})}),(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mt-16 flex justify-end th-up",style:{animationDelay:"0.5s"},children:(0,f.jsxs)("a",{href:"#".concat(d),onClick:p,className:"th-mono hidden md:inline-flex items-center gap-2 text-[11px] text-white/60 hover:text-white transition-colors","aria-label":"Scroll to content",children:[(0,f.jsx)("span",{children:"Scroll"}),(0,f.jsx)("span",{className:"inline-block w-6 h-px bg-white/40"}),(0,f.jsx)("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-[#BF212F] animate-bounce"})]})})]}),(0,f.jsx)("style",{children:"\n @import url('https://fonts.googleapis.com/css2?family=Archivo+Expanded:wght@700;800&family=Hanken+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');\n .turbo-hero { font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif; }\n .turbo-hero .th-display { font-family: 'Exo', system-ui, -apple-system, sans-serif; letter-spacing: -0.01em; }\n .turbo-hero .th-mono { font-family: 'Space Mono', monospace; text-transform: uppercase; letter-spacing: 0.26em; font-weight: 700; }\n @keyframes thFade { from { opacity: 0; } to { opacity: 1; } }\n @keyframes thUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }\n .turbo-hero .th-fade { animation: thFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; }\n .turbo-hero .th-up { animation: thUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; }\n "})]}),n.length>0&&(0,f.jsxs)("section",{id:"recent-gigs",className:"bg-black py-20 md:py-28 border-b border-white/5",children:[(0,f.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,f.jsxs)("div",{className:"flex items-end justify-between gap-4 mb-10",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(G,{num:"\u2022",label:"Recent Gigs"}),(0,f.jsxs)(V,{children:[(0,f.jsx)("span",{className:"block bg-gradient-to-r from-white via-gray-100 to-white bg-clip-text text-transparent",children:"Fresh off"}),(0,f.jsx)("span",{className:"block bg-gradient-to-r from-turbo-red via-orange-500 to-turbo-red bg-clip-text text-transparent",children:"the floor."})]})]}),(0,f.jsxs)(r.N_,{to:"/recent-gigs",className:"hidden sm:inline-flex items-center gap-2 text-white font-bold uppercase tracking-widest text-sm hover:text-turbo-red transition-colors whitespace-nowrap",children:["View all ",(0,f.jsx)(S.A,{className:"h-4 w-4"})]})]}),(0,f.jsx)("div",{className:"flex gap-6 overflow-x-auto snap-x snap-mandatory pb-4 -mx-4 px-4 sm:mx-0 sm:px-0 hg-rail",children:n.map(e=>(0,f.jsxs)(r.N_,{to:"/recent-gigs/".concat(e.slug),className:"group relative shrink-0 snap-start w-[280px] sm:w-[360
1px] rounded-2xl overflow-hidden bg-zinc-900 border border-white/10 hover:border-turbo-red/50 transition-colors",children:[(0,f.jsx)("div",{className:"aspect-[16/10] overflow-hidden bg-zinc-800",children:e.hero_image?(0,f.jsx)("img",{src:e.hero_image,alt:e.job_title,loading:"lazy",className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-110"}):(0,f.jsx)("div",{className:"w-full h-full flex items-center justify-center text-white/20",children:(0,f.jsx)(_.A,{className:"h-8 w-8"})})}),(0,f.jsxs)("div",{className:"p-5",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 text-[11px] text-gray-400 mb-2",children:[e.event_date&&(0,f.jsx)("span",{children:new Date(e.event_date).toLocaleDateString("en-AU",{month:"short",year:"numeric"})}),e.location&&(0,f.jsxs)("span",{className:"inline-flex items-center gap-1 truncate",children:[(0,f.jsx)(C.A,{className:"h-3 w-3 shrink-0"})," ",(0,f.jsx)("span",{className:"truncate",children:e.location})]})]}),(0,f.jsx)("h3",{className:"text-lg font-black text-white leading-tight group-hover:text-turbo-red transition-colors",children:e.job_title}),e.excerpt&&(0,f.jsx)("p",{className:"text-sm text-gray-400 mt-2 line-clamp-2",children:e.excerpt}),(0,f.jsxs)("div",{className:"flex items-center gap-2 text-white text-sm font-semibold mt-3",children:[(0,f.jsx)("span",{children:"Read the story"}),(0,f.jsx)(S.A,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]})]})]},e.slug))}),(0,f.jsxs)(r.N_,{to:"/recent-gigs",className:"sm:hidden inline-flex items-center gap-2 mt-6 text-white font-bold uppercase tracking-widest text-sm hover:text-turbo-red transition-colors",children:["View all ",(0,f.jsx)(S.A,{className:"h-4 w-4"})]})]}),(0,f.jsx)("style",{children:"\n .hg-rail { scrollbar-width: thin; scrollbar-color: #BF212F transparent; }\n .hg-rail::-webkit-scrollbar { height: 6px; }\n .hg-rail::-webkit-scrollbar-thumb { background: #BF212F; border-radius: 9999px; }\n .hg-rail::-webkit-scrollbar-track { background: transparent; }\n "})]}),(0,f.jsx)("section",{id:"work",className:"bg-dark-bg py-24 md:py-32 px-4 sm:px-6 lg:px-8",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(G,{num:"01",label:"Work"}),(0,f.jsxs)(V,{children:[(0,f.jsx)("span",{className:"block bg-gradient-to-r from-white via-gray-100 to-white bg-clip-text text-transparent",children:"Same-day,"}),(0,f.jsx)("span",{className:"block bg-gradient-to-r from-turbo-red via-orange-500 to-turbo-red bg-clip-text text-transparent",children:"broadcast-ready."})]}),(0,f.jsx)("p",{className:"max-w-2xl text-lg text-gray-400 mb-16",children:"Stories captured, cut, and delivered while the doors are still open."}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:M.map(e=>(0,f.jsxs)(r.N_,{to:e.href,className:"group relative overflow-hidden rounded-2xl block aspect-[3/4] bg-zinc-900",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center transition-transform duration-700 group-hover:scale-110",style:{backgroundImage:"url('".concat(e.image,"')")}}),(0,f.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-2/5 bg-gradient-to-t from-black via-black/75 to-transparent"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-turbo-red/40 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,f.jsxs)("div",{className:"absolute inset-0 p-8 flex flex-col justify-end",children:[(0,f.jsx)("div",{className:"text-xs font-bold text-turbo-red uppercase tracking-[0.25em] mb-3 drop-shadow-[0_2px_8px_rgba(0,0,0,0.7)]",children:e.category}),(0,f.jsx)("h3",{className:"text-2xl md:text-3xl font-black text-white mb-3 leading-tight drop-shadow-[0_2px_10px_rgba(0,0,0,0.85)]",children:e.title}),(0,f.jsx)("p",{className:"text-sm text-gray-200 mb-4 max-h-0 overflow-hidden group-hover:max-h-24 transition-[max-height] duration-500 drop-shadow-[0_1px_4px_rgba(0,0,0,0.7)]",children:e.blurb}),(0,f.jsxs)("div",{className:"flex items-center gap-2 text-white text-sm font-semibold drop-shadow-[0_1px_4px_rgba(0,0,0,0.7)]",children:[(0,f.jsx)("span",{children:"View capability"}),(0,f.jsx)(S.A,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]})]})]},e.category))})]})}),(0,f.jsx)("section",{id:"services",className:"bg-black py-24 md:py-32 px-4 sm:px-6 lg:px-8",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(G,{num:"02",label:"Services"}),(0,f.jsxs)(V,{children:[(0,f.jsx)("span",{className:"block bg-gradient-to-r from-white via-gray-100 to-white bg-clip-text text-transparent",children:"Built for"}),(0,f.jsx)("span",{className:"block bg-gradient-to-r from-turbo-red via-orange-500 to-turbo-red bg-clip-text text-transparent",children:"the brief."})]}),(0,f.jsx)("p",{className:"max-w-2xl text-lg text-gray-400 mb-16",children:"Six core capabilities. One in-house crew. Mix and match \u2014 every booking ships from the same delivery pipeline."}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:q.map(e=>{const t=/^https?:\/\//.test(e.href),s="group relative overflow-hidden rounded-2xl block aspect-[4/5] bg-zinc-900 border border-white/5 hover:border-turbo-red/50 transition-colors duration-300",a=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center transition-transform duration-700 group-hover:scale-105",style:{backgroundImage:"url('".concat(e.image,"')")}}),(0,f.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-1/2 bg-gradient-to-t from-black via-black/70 to-transparent"}),(0,f.jsx)("div",{className:"absolute top-0 left-0 w-32 h-16 bg-gradient-to-br from-black/60 to-transparent"}),(0,f.jsx)("div",{className:"absolute top-6 left-6 text-xs font-bold text-turbo-red tracking-[0.3em] drop-shadow-[0_1px_4px_rgba(0,0,0,0.8)]",children:e.num}),(0,f.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-6",children:[(0,f.jsx)("h3",{className:"text-3xl md:text-4xl font-black text-white leading-tight mb-2 drop-shadow-[0_2px_10px_rgba(0,0,0,0.85)]",children:e.title}),(0,f.jsx)("p",{className:"text-sm text-gray-200 mb-4 drop-shadow-[0_1px_4px_rgba(0,0,0,0.7)]",children:e.blurb}),(0,f.jsxs)("div",{className:"inline-flex items-center gap-2 text-turbo-red text-sm font-bold uppercase tracking-widest drop-shadow-[0_1px_4px_rgba(0,0,0,0.7)]",children:[(0,f.jsx)("span",{children:"Explore"}),(0,f.jsx)(S.A,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]})]})]});return t?(0,f.jsx)("a",{href:e.href,className:s,children:a},e.title):(0,f.jsx)(r.N_,{to:e.href,className:s,children:a},e.title)})})]})}),(0,f.jsx)("section",{className:"bg-dark-bg py-24 md:py-32 px-4 sm:px-6 lg:px-8 border-y border-white/5",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(G,{num:"03",label:"Numbers"}),(0,f.jsxs)(V,{children:[(0,f.jsx)("span",{className:"block bg-gradient-to-r from-white via-gray-100 to-white bg-clip-text text-transparent",children:"By the"}),(0,f.jsx)("span",{className:"block bg-gradient-to-r from-turbo-red via-orange-500 to-turbo-red bg-clip-text text-transparent",children:"numbers."})]}),(0,f.jsx)("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-12 mt-16",children:H.map(e=>(0,f.jsxs)("div",{className:"text-left",children:[(0,f.jsx)("div",{className:"text-6xl md:text-7xl lg:text-8xl font-black leading-none",children:(0,f.jsx)(W,{value:e.value,suffix:e.suffix,numberClass:"bg-gradient-to-br from-turbo-red via-orange-500 to-white bg-clip-text text-transparent"})}),(0,f.jsx)("div",{className:"mt-4 text-sm uppercase tracking-[0.25em] text-gray-400",children:e.label})]},e.label))})]})}),(0,f.jsxs)("section",{className:"bg-black py-24 md:py-32 px-4 sm:px-6 lg:px-8",children:[(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(G,{num:"04",label:"Coverage"}),(0,f.jsxs)(V,{children:[(0,f.jsx)("span",{className:"block bg-gradient-to-r from-white via-gray-100 to-white bg-clip-text text-transparent",children:"From Brisbane"}),(0,f.jsx)("span",{className:"block bg-gradient-to-r from-turbo-red via-orange-500 to-turbo-red bg-clip-text text-transparent",children:"to Bali."})]}),(0,f.jsx)("p",{className:"max-w-2xl text-lg text-gray-400 mb-16",children:"On-the-ground crews across every capital and major regional centre. Three countries. One booking line."})]}),(0,f.jsx)(P,{items:L.EW.map(e=>{const t=(0,L.KM)(e);return t?t.name:e}),speed:60,itemClass:"text-white/80 text-3xl md:text-5xl font-black uppercase tracking-tight",separator:(0,f.jsx)("span",{className:"inline-block w-3 h-3 rounded-full bg-turbo-red mx-10 align-middle"})}),(0,f.jsx)("div",{className:"max-w-7xl mx-auto mt-16",children:(0,f.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 ga
1p-3",children:[x.map(e=>(0,f.jsxs)(r.N_,{to:"/services/locations/".concat(e.slug),className:"group flex items-center justify-between px-4 py-3 rounded-lg bg-white/5 border border-white/10 hover:bg-turbo-red/10 hover:border-turbo-red/40 transition-all",children:[(0,f.jsx)("span",{className:"text-white font-bold uppercase text-sm tracking-wider",children:e.name}),(0,f.jsx)(S.A,{className:"h-4 w-4 text-gray-500 group-hover:text-turbo-red transition-colors"})]},e.slug)),(0,f.jsxs)(r.N_,{to:"/services",className:"group flex items-center justify-between px-4 py-3 rounded-lg bg-turbo-red/20 border border-turbo-red/40 hover:bg-turbo-red/30 transition-all",children:[(0,f.jsx)("span",{className:"text-white font-bold uppercase text-sm tracking-wider",children:"All locations"}),(0,f.jsx)(S.A,{className:"h-4 w-4 text-white group-hover:translate-x-1 transition-transform"})]})]})})]}),(0,f.jsx)("section",{className:"bg-dark-bg py-24 md:py-32 px-4 sm:px-6 lg:px-8",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-2 gap-16 items-center",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(G,{num:"05",label:"Who"}),(0,f.jsxs)(V,{children:[(0,f.jsx)("span",{className:"block bg-gradient-to-r from-white via-gray-100 to-white bg-clip-text text-transparent",children:"Australia's"}),(0,f.jsx)("span",{className:"block bg-gradient-to-r from-turbo-red via-orange-500 to-turbo-red bg-clip-text text-transparent",children:"same-day team."})]}),(0,f.jsxs)("div",{className:"prose prose-invert prose-lg max-w-none text-gray-300 mt-6 space-y-5",children:[(0,f.jsx)("p",{children:"Turbo 360 is a Melbourne-based event photography and video production studio operating across Australia and into Bali. We staff full in-house crews \u2014 shooters, editors, broadcast technicians, live-stream operators \u2014 so every booking ships from the same delivery pipeline, with the same colourist signing off the look."}),(0,f.jsxs)("p",{children:["We work the rooms most agencies don't enter: multi-day"," ",(0,f.jsx)(r.N_,{to:"/conferences",className:"text-turbo-red hover:text-orange-400 font-semibold underline-offset-4 hover:underline",children:"conferences"}),","," ",(0,f.jsx)(r.N_,{to:"/business",className:"text-turbo-red hover:text-orange-400 font-semibold underline-offset-4 hover:underline",children:"corporate events"}),","," ",(0,f.jsx)(r.N_,{to:"/schools",className:"text-turbo-red hover:text-orange-400 font-semibold underline-offset-4 hover:underline",children:"school productions"}),","," ",(0,f.jsx)(r.N_,{to:"/development",className:"text-turbo-red hover:text-orange-400 font-semibold underline-offset-4 hover:underline",children:"property launches"}),", and"," ",(0,f.jsx)("a",{href:"https://weddings.turbo.net.au",className:"text-turbo-red hover:text-orange-400 font-semibold underline-offset-4 hover:underline",children:"weddings"}),". The common thread is speed: every project ships an edit before the room clears."]}),(0,f.jsx)("p",{children:"Same crew on the camera, same crew on the cut. No outsourcing, no surprise freelancers \u2014 and no waiting two weeks for a delivery you needed last Tuesday."})]}),(0,f.jsxs)(r.N_,{to:"/about",className:"inline-flex items-center gap-2 mt-8 text-white font-bold uppercase tracking-widest text-sm hover:text-turbo-red transition-colors",children:[(0,f.jsx)("span",{children:"More about us"}),(0,f.jsx)(S.A,{className:"h-4 w-4"})]})]}),(0,f.jsxs)("div",{className:"relative aspect-[4/5] rounded-2xl overflow-hidden",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:"url('/turbo-crew-video.jpg')"}}),(0,f.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-1/3 bg-gradient-to-t from-black via-black/60 to-transparent"}),(0,f.jsxs)("div",{className:"absolute bottom-6 left-6 right-6",children:[(0,f.jsx)("div",{className:"text-xs font-bold text-turbo-red uppercase tracking-[0.3em] mb-2 drop-shadow-[0_1px_4px_rgba(0,0,0,0.7)]",children:"The crew"}),(0,f.jsx)("div",{className:"text-white text-xl font-bold drop-shadow-[0_2px_8px_rgba(0,0,0,0.85)]",children:"In-house from camera to colour."})]})]})]})}),(0,f.jsxs)("section",{className:"relative py-32 md:py-48 px-4 sm:px-6 lg:px-8 overflow-hidden",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:"url('/images/services/locations/event-coverage-panel-speaker.jpg')"}}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/25 via-black/30 to-black/55"}),(0,f.jsx)("div",{className:"absolute inset-x-0 top-1/4 bottom-0 bg-gradient-to-t from-black/65 via-black/20 to-transparent"}),(0,f.jsxs)("div",{className:"relative max-w-5xl mx-auto text-center",children:[(0,f.jsx)(G,{num:"06",label:"Ready",center:!0}),(0,f.jsxs)("h2",{className:"text-5xl md:text-7xl lg:text-8xl font-black leading-none mb-8 [filter:drop-shadow(0_4px_18px_rgba(0,0,0,0.55))]",children:[(0,f.jsx)("span",{className:"block bg-gradient-to-r from-white via-gray-100 to-white bg-clip-text text-transparent",children:"Your next"}),(0,f.jsx)("span",{className:"block bg-gradient-to-r from-turbo-red via-orange-500 to-turbo-red bg-clip-text text-transparent",children:"event covered."})]}),(0,f.jsx)("p",{className:"text-xl text-gray-200 max-w-2xl mx-auto mb-12 drop-shadow-[0_2px_8px_rgba(0,0,0,0.7)]",children:"One booking. Full crew. Same-day delivery. Tell us the brief and we'll have a quote back within hours."}),(0,f.jsx)(r.N_,{to:"/get-quote",children:(0,f.jsxs)("button",{className:"group inline-flex items-center gap-3 px-12 py-6 bg-gradient-to-r from-turbo-red via-red-600 to-orange-500 text-white font-black text-lg uppercase tracking-widest rounded-2xl shadow-2xl hover:shadow-turbo-red/50 transform hover:scale-105 transition-all duration-300",children:[(0,f.jsx)(F.A,{className:"h-6 w-6"}),(0,f.jsx)("span",{children:"Get a quote"}),(0,f.jsx)(S.A,{className:"h-5 w-5 group-hover:translate-x-1 transition-transform"})]})}),(0,f.jsxs)("div",{className:"mt-12 flex flex-wrap items-center justify-center gap-x-8 gap-y-3 text-sm text-gray-300",children:[(0,f.jsxs)("a",{href:"tel:+61410234387",className:"inline-flex items-center gap-2 hover:text-white transition-colors",children:[(0,f.jsx)(E.A,{className:"h-4 w-4 text-turbo-red"}),(0,f.jsx)("span",{className:"font-semibold",children:"+61 410 234 387"})]}),(0,f.jsxs)("a",{href:"mailto:[email protected]",className:"inline-flex items-center gap-2 hover:text-white transition-colors",children:[(0,f.jsx)(T.A,{className:"h-4 w-4 text-turbo-red"}),(0,f.jsx)("span",{className:"font-semibold",children:"[email protected]"})]}),(0,f.jsxs)("span",{className:"inline-flex items-center gap-2 text-gray-400",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-turbo-red"}),(0,f.jsx)("span",{children:"Australia \u2022 Asia-Pacific"})]})]})]})]}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})};var Y=s(1312),K=s(34027);const Z=e=>
1"turbo_promo:".concat(e.id,":v").concat(e.version||1),$=e=>{try{if("always"===e.frequency)return;if("session"===e.frequency)return void sessionStorage.setItem(Z(e),"1");localStorage.setItem(Z(e),String(Date.now()))}catch(t){}},Q=(e,t)=>{try{const s="".concat(I.fn,"/api/public/popups/").concat(e.id,"/event"),a=JSON.stringify({type:t});navigator.sendBeacon?navigator.sendBeacon(s,new Blob([a],{type:"application/json"})):fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}).catch(()=>{})}catch(s){}};function X(e){let{path:t="/"}=e;const[s,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if("undefined"===typeof window||navigator.webdriver)return;let e,s=!1;return(async()=>{try{var a;const r=await fetch("".concat(I.fn,"/api/public/popups?path=").concat(encodeURIComponent(t)));if(!r.ok)return;const o=((await r.json()).popups||[]).find(e=>e&&e.image_url&&!(e=>{try{if("always"===e.frequency)return!1;if("session"===e.frequency)return"1"===sessionStorage.getItem(Z(e));const t=localStorage.getItem(Z(e));if(!t)return!1;if("daily"===e.frequency){const e=Number(t);return Number.isFinite(e)&&Date.now()-e<864e5}return!0}catch(t){return!1}})(e));if(!o||s)return;n(o),e=setTimeout(()=>{s||(i(!0),Q(o,"view"))},Math.max(0,Number(null!==(a=o.delay_ms)&&void 0!==a?a:4e3)))}catch(r){}})(),()=>{s=!0,clearTimeout(e)}},[t]);const o=(0,a.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dismiss";s&&($(s),"dismiss"===e&&Q(s,"dismiss"),i(!1))},[s]);if((0,a.useEffect)(()=>{if(!r)return;const e=e=>{"Escape"===e.key&&o()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,o]),!r||!s)return null;const l=/^https?:\/\//i.test(s.link_url||"")&&!/^https?:\/\/(www\.)?turbo\.net\.au/i.test(s.link_url),c=(s.link_url||"#").replace(/^https?:\/\/(www\.)?turbo\.net\.au/i,"")||"/";return(0,f.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":s.name||"Promotion",onClick:()=>o(),className:"fixed inset-0 z-[100003] flex items-center justify-center bg-[#060607]/[0.82] p-6 backdrop-blur-[6px] animate-reveal",children:(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"relative max-h-[88vh] w-[94vw] overflow-hidden border border-[#2B2B2B] bg-[#0A0A0B] md:w-[min(92vw,560px)]",style:{boxShadow:"0 30px 80px rgba(0,0,0,.6)"},children:[(0,f.jsx)("button",{type:"button",onClick:()=>o(),"aria-label":"Close",className:"absolute right-2.5 top-2.5 z-[3] flex h-[38px] w-[38px] items-center justify-center border border-white/[0.28] bg-[#0A0A0B]/[0.72] font-mono text-[17px] leading-none text-white transition-colors hover:border-turbo-red hover:bg-turbo-red",children:"\u2715"}),(0,f.jsxs)("a",{href:c,onClick:()=>{$(s),Q(s,"click")},target:l||s.open_in_new_tab?"_blank":void 0,rel:l?"noopener noreferrer":void 0,className:"block no-underline",children:[(0,f.jsx)("img",{src:s.image_url,alt:s.image_alt||s.name||"",className:"block h-auto max-h-[calc(88vh-56px)] w-full object-contain"}),(s.caption_label||s.caption_cta)&&(0,f.jsxs)("div",{className:"flex items-center justify-between gap-4 bg-turbo-red px-5 py-4",children:[(0,f.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-[#FFD9DC]",children:s.caption_label}),(0,f.jsx)("span",{className:"font-head text-[15px] font-bold text-white",children:s.caption_cta})]})]})]})})}const ee="pointer-events-none absolute font-mono uppercase tracking-[0.16em] text-white/85 [text-shadow:0_1px_6px_rgba(0,0,0,.7)]";function te(e){let{pos:t}=e;const s={tl:"left-3 top-3 border-l border-t",tr:"right-3 top-3 border-r border-t",bl:"bottom-3 left-3 border-b border-l",br:"bottom-3 right-3 border-b border-r"}[t];return(0,f.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute h-[18px] w-[18px] border-white/70 ".concat(s)})}function se(e){let{src:t,alt:s="",project:a,scene:n,tc:i,ratio:o="16/9",brackets:l=!1,to:c,className:d=""}=e;const p="16/10"===o,x=c?r.N_:"div",h=c?{to:c}:{};return(0,f.jsxs)(x,(0,m.A)((0,m.A)({},h),{},{className:"group relative block overflow-hidden bg-black ".concat(p?"aspect-[16/10]":"aspect-video"," ").concat(d),children:[(0,f.jsxs)("div",{className:"absolute inset-x-0 top-[5%] h-[90%] overflow-hidden",children:[t&&(0,f.jsx)("img",{src:t,alt:s,loading:"lazy",decoding:"async",className:"h-full w-full object-cover transition-transform duration-[900ms] ease-turbo group-hover:scale-[1.04]"}
1),(0,f.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0 mix-blend-multiply",style:{background:"linear-gradient(120deg,rgba(10,42,44,.45),rgba(58,36,0,.25))"}}),(0,f.jsx)("div",{"aria-hidden":!0,className:"absolute inset-0",style:{background:"radial-gradient(circle at 50% 50%,transparent 55%,rgba(0,0,0,.45))"}})]}),l&&["tl","tr","bl","br"].map(e=>(0,f.jsx)(te,{pos:e},e)),(0,f.jsx)("span",{className:"".concat(ee," left-[6%] top-[8%] max-w-[60%] truncate ").concat(p?"text-[11px]":"text-[10px]"),children:a}),(0,f.jsx)("span",{className:"".concat(ee," right-[6%] top-[8%] ").concat(p?"text-[11px]":"text-[10px]"),children:n}),(0,f.jsx)("span",{className:"".concat(ee," bottom-[8%] right-[6%] ").concat(p?"text-[11px]":"text-[10px]"),children:i}),(0,f.jsxs)("span",{className:"".concat(ee," bottom-[8%] left-[6%] flex items-center gap-2 ").concat(p?"text-[11px]":"text-[10px]"),children:[(0,f.jsx)("span",{className:"inline-block h-[7px] w-[7px] animate-blink rounded-full bg-turbo-red motion-reduce:animate-none"}),"Rec"]})]}))}var ae=s(64996),ne=s(63572);const re=e=>String(e).padStart(2,"0"),ie=Array.from({length:51},(e,t)=>({id:re(t+1),src:"/images/headshots/wall/".concat(re(t+1),".webp"),srcSet:"/images/headshots/wall/".concat(re(t+1),".webp 200w, /images/headshots/wall@2x/").concat(re(t+1),".webp 400w")})),oe=[3,7,11,14,18,22,25,29,33,36,40,43,46,49,51,5,9,12,16,20,24,27,31,34,38,41,44,47,50,2,6,10,13,1,4,8,15,17,19,21,23,26,28,30,32,35,37,39,42,45,48].map(e=>ie[e-1]),le="/images/headshots/hero-cutout-a.webp",ce="linear-gradient(90deg,#BF212F 0 40%,#F2A900 40% 70%,#0FA3A3 70% 100%)",de="px-5 py-16 md:px-11 md:py-[100px] xl:px-16 xl:py-[120px]",me="mx-auto w-full max-w-[1328px]",pe="m-0 font-display text-[clamp(32px,4.4vw,60px)] font-black uppercase leading-[0.92] tracking-[-0.03em] text-smoke",xe="inline-flex items-center justify-center rounded-full bg-turbo-red font-head font-bold text-white transition-[transform,background-color] duration-[400ms] ease-turbo hover:-translate-y-[3px] hover:bg-redline",he="cubic-bezier(.16,1,.3,1)",ue=e=>String(e).padStart(2,"0");function ge(e){let{children:t,tone:s="red",className:a=""}=e;const n="teal"===s?"text-cinema":"amber"===s?"text-ignition":"text-turbo-red";return(0,f.jsx)("div",{className:"font-mono text-xs uppercase tracking-[0.26em] ".concat(n," ").concat(a),children:t})}function fe(){return(0,f.jsxs)("svg",{"aria-hidden":"true",className:"pointer-events-none fixed inset-[-5%] z-[60] h-[110%] w-[110%] animate-grain opacity-[0.055] mix-blend-overlay motion-reduce:animate-none",children:[(0,f.jsxs)("filter",{id:"ln-noise",children:[(0,f.jsx)("feTurbulence",{type:"fractalNoise",baseFrequency:".9",numOctaves:"2",stitchTiles:"stitch"}),(0,f.jsx)("feColorMatrix",{type:"saturate",values:"0"})]}),(0,f.jsx)("rect",{width:"100%",height:"100%",filter:"url(#ln-noise)"})]})}const be=Array.from({length:72},(e,t)=>({deg:5*t,len:t%6===0?34:24})),ye=Array.from({length:8},(e,t)=>45*t),ve=["1,840 images in a day","< 4h to first delivery","180+ five-star reviews"],je="m-0 font-display text-[clamp(48px,6.5vw,76px)] font-black uppercase leading-[0.86] tracking-[-0.035em] xl:text-[clamp(56px,5.6vw,88px)]",we=e=>Math.max(0,Math.min(1,e));function Ne(e){let{y:t,vh:s,vw:a}=e;return we(t/(s*(a<768?1:1.3)))}const Ae=e=>"".concat(ue(Math.floor(e/9e4)%24),":").concat(ue(Math.floor(e/1500)%60),":").concat(ue(Math.floor(e/25)%60),":").concat(ue(e%25));function ke(){const e=(0,a.useRef)(null),t=(0,a.useRef)({raf:0,start:0,last:-1});return(0,ne.s0)(s=>{let{y:a,vh:n,vw:r}=s;const i=t.current,o=r>=768&&a<1.5*n;if(o===Boolean(i.raf))return;if(!o)return cancelAnimationFrame(i.raf),void(i.raf=0);i.start=0,i.last=-1;const l=t=>{i.start||(i.start=t);const s=Math.floor((t-i.start)/40);s!==i.last&&e.current&&(i.last=s,e.current.textContent=Ae(s)),i.raf=requestAnimationFrame(l)};i.raf=requestAnimationFrame(l)}),(0,a.useEffect)(()=>{const e=t.current;return()=>{cancelAnimationFrame(e.raf),e.raf=0}},[]),(0,f.jsx)("span",{ref:e,suppressHydrationWarning:!0,children:Ae(0)})}function Se(){const[e,t]=(0,a.useState)("EXPO");(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const s=await fetch("".concat(I.fn,"/api/settings/public"));if(!s.ok)return;const a=await s.json();e||t(a.homepage_video_selection||"EXPO")}catch(s){}})(),()=>{e=!0}},[]);const s="FOOD"===e||"FOOD_EXTENDED"===e?"/food_video_extended.mp4":"WEBBG"===e?"/webbg_compressed.mp4":"/hero_video_compressed.mp4",[n,r]=(0,a.useState)(!1);(0,a.useEffect)(()=>
1{if("undefined"!==typeof navigator&&navigator.webdriver)return;const e=()=>r(!0);if("complete"!==document.readyState)return window.addEventListener("load",e,{once:!0}),()=>window.removeEventListener("load",e);e()},[]);const i="absolute inset-0 h-full w-full object-cover";return n?(0,f.jsx)("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,poster:"/hero-background.jpg",className:i,children:(0,f.jsx)("source",{src:s,type:"video/mp4"})},e):(0,f.jsx)("img",{src:"/hero-background.jpg",alt:"Same-day event photography and video production team covering a corporate conference",className:i})}function _e(){const e=(0,a.useRef)({}).current,t=t=>s=>{e[t]=s},s=(0,a.useRef)({dx:0,dy:0,vw:0,vh:0,r:0,cy:0,mobile:!1,last:{}}).current,n=(t,a,n)=>{const r=e[t];r&&s.last[t+a]!==n&&(s.last[t+a]=n,"text"===a?r.textContent=n:r.style[a]=n)},i=()=>"circle(".concat(s.r,"px at calc(50% + ").concat((22*s.dx).toFixed(1),"px) ").concat(Math.round(s.cy+22*s.dy),"px)");(0,ne.s0)(e=>{let{y:t,vh:a,vw:r}=e;if(s.vw=r,s.vh=a,s.mobile=r<768,s.mobile)return;const o=Ne({y:t,vh:a,vw:r}),l=1-Math.pow(1-o,3),c=r<1200?.48:.5;s.r=Math.round(.17*a+l*Math.max(r,a)*.95),s.cy=a*c,n("clip","clipPath",i());const d=1-Math.pow(1-Math.min(1,o/.22),3),m=(6*(1-d)).toFixed(1);n("lens","transform","scale(".concat((1.3-.3*l).toFixed(3),")")),n("lens","filter","0.0"===m?"saturate(.95)":"blur(".concat(m,"px) saturate(.95)")),n("fstop","text",(1.4+14.6*d).toFixed(1)),n("focus","text",String(Math.round(100*d)));const p=1-Math.min(1,1.7*o);for(const s of["bokeh","hudL","hudR","dial","head"])n(s,"opacity",p.toFixed(2)),n(s,"visibility",p>0?"visible":"hidden");p>0&&(n("ringA","transform","rotate(".concat((.06*t).toFixed(1),"deg)")),n("ringB","transform","rotate(".concat((.09*-t).toFixed(1),"deg)")),n("ringC","transform","rotate(".concat((.15*t).toFixed(1),"deg)")));const x=we((o-.5)/.32);n("msg","opacity",x.toFixed(2)),n("msg","transform","translateY(".concat(Math.round(40*(1-x)),"px)")),n("msg","pointerEvents",x>.5?"auto":"none")});const o="absolute top-24 hidden flex-col gap-1.5 font-mono text-[10.5px] uppercase tracking-[0.2em] text-ash transition-[opacity,visibility] duration-200 md:flex",l="absolute inset-0 will-change-transform",c="absolute inset-0 h-full w-full overflow-visible";return(0,f.jsx)("div",{id:"top",className:"relative md:h-[230vh]",onMouseMove:t=>{e.dial&&!s.mobile&&s.vw&&(s.dx=t.clientX/s.vw-.5,s.dy=t.clientY/s.vh-.5,e.dial.style.transform="translate(calc(-50% + ".concat(22*s.dx,"px), calc(-50% + ").concat(22*s.dy,"px)) rotate(").concat(3*s.dx,"deg)"),n("clip","clipPath",i()))},children:(0,f.jsxs)("div",{className:"relative h-[100svh] overflow-hidden bg-[#0A0A0B] md:sticky md:top-0 md:h-screen",children:[(0,f.jsxs)("div",{ref:t("bokeh"),"aria-hidden":"true",className:"pointer-events-none absolute inset-0 hidden overflow-hidden md:block md:transition-[opacity,visibility] md:duration-200",children:[(0,f.jsx)("div",{className:"absolute left-1/2 top-1/2 -ml-[28vmax] -mt-[28vmax] h-[56vmax] w-[56vmax] animate-bk1 rounded-full blur-[28px] will-change-transform motion-reduce:animate-none",style:{background:"radial-gradient(circle,rgba(191,33,47,.55),rgba(191,33,47,0) 70%)"}}),(0,f.jsx)("div",{className:"absolute left-1/2 top-1/2 -ml-[24vmax] -mt-[24vmax] h-[48vmax] w-[48vmax] animate-bk2 rounded-full blur-[30px] will-change-transform motion-reduce:animate-none",style:{background:"radial-gradient(circle,rgba(15,163,163,.42),rgba(15,163,163,0) 70%)"}}),(0,f.jsx)("div",{className:"absolute left-1/2 top-1/2 -ml-[20vmax] -mt-[20vmax] h-[40vmax] w-[40vmax] animate-bk3 rounded-full blur-[26px] will-change-transform motion-reduce:animate-none",style:{background:"radial-gradient(circle,rgba(242,169,0,.4),rgba(242,169,0,0) 70%)"}}),(0,f.jsx)("div",{className:"absolute left-1/2 top-1/2 -ml-[11vmax] -mt-[11vmax] h-[22vmax] w-[22vmax] animate-bk4 rounded-full blur-[18px] will-change-transform motion-reduce:animate-none",style:{background:"radial-gradient(circle,rgba(244,242,238,.22),rgba(244,242,238,0) 70%)"}}),(0,f.jsx)("div",{className:"absolute left-1/2 top-1/2 -ml-[7vmax] -mt-[7vmax] h-[14vmax] w-[14vmax] animate-bk5 rounded-full blur-[12px] will-change-transform motion-reduce:animate-none",style:{background:"radial-gradient(circle,rgba(191,33,47,.5),rgba(191,33,47,0) 70%)"}}),(0,f.jsx)("div",{className:"absolute inset-[-20%] animate-leak mix-blend-screen motion-reduce:animate-none",style:{background:"linear-gradient(115deg,transparent 30%,rgba(242,169,0,.14) 45%,rgba(191,33,47,.16) 52%,transparent 68%)"}}),(0,f.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(255,255,255,.03) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.03) 1px,transparent 1px)",backgroundSize:"96px 96px",maskImage:"radial-gradient(60% 60% at 50% 50%,#000,transparent)",WebkitMaskImage:"radial-gradient(60% 60% at 50% 50%,#000,transparent)"}})]}),(0,f.jsx)("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse at 50% 50%,transparent 45%,rgba(10,10,11,.7) 100%)"}}),(0,f.jsxs)("div",{ref:t("clip"),className:"absolute inset-0 max-md:![clip-path:none] md:transition-[clip-path] md:duration-[350ms] md:ease-turbo",children:[(0,f.jsx)("div",{ref:t("lens"),className:"absolute inset-0 max-md:![filter:none] max-md:!transform-none md:transition-[transform,filter] md:duration-[120ms] md:ease-linear",children:(0,f.jsx)(Se,{})}),(0,f.jsx)("div",{className:"absolute inset-0 mix-blend-multiply",style:{background:"linear-gradient(120deg,rgba(10,42,44,.3),rgba(58,36,0,.15))"}}),(0,f.jsx)("div",{className:"absolute inset-0 hidden md:block",style:{background:"radial-gradient(circle at 50% 50%,transparent 36%,rgba(10,10,11,.75))"}}),(0,f.jsx)("div",{className:"absolute inset-0 md:hidden",style:{background:"linear-gradient(180deg,rgba(10,10,11,.45) 0%,rgba(10,10,11,0) 22%,rgba(10,10,11,0) 50%,rgba(10,10,11,.35) 70%,rgba(10,10,11,.88) 100%)"}})]}),(0,f.jsxs)("div",{className:"absolute inset-x-0 top-0 h-[100svh] md:h-full",children:[(0,f.jsxs)("div",{ref:t("hudL"),className:"".concat(o," left-7"),children:[(0,f.jsxs)("span",{className:"flex items-center gap-2 text-smoke",children:[(0,f.jsx)("span",{className:"inline-block h-[7px] w-[7px] animate-blink rounded-full bg-turbo-red motion-reduce:animate-none"}),"Rec \xb7 ",(0,f.jsx)(ke,{})]}),(0,f.jsxs)("span",{children:["f/",(0,f.jsx)("span",{ref:t("fstop"),children:"1.4"})," \xb7 1/250 \xb7 ISO 1600"]}),(0,f.jsxs)("span",{children:["Focus: ",(0,f.jsx)("span",{ref:t("focus"),children:"0"}),"%"]})]}),(0,f.jsxs)("div",{ref:t("hudR"),className:"".concat(o," right-7 items-end text-right"),children:[(0,f.jsx)("span",{className:"text-smoke",children:"Nine cities \xb7 Three countries"}),(0,f.jsx)("span",{children:"Same-day delivery"}),(0,f.jsx)("span",{children:"Australia \xb7 NZ \xb7 Singapore"})]}),(0,f.jsxs)("div",{ref:t("dial"),className:"pointer-events-none absolute left-1/2 top-[48%] hidden h-[min(62vh,52vw)] w-[min(62vh,52vw)] -translate-x-1/2 -translate-y-1/2 transition-transform duration-[350ms] ease-turbo will-change-transform md:block xl:top-1/2 xl:h-[min(78vh,46vw)] xl:w-[min(78vh,46vw)]",children:[(0,f.jsxs)("div",{ref:t("ringA"),className:l,children:[(0,f.jsx)("div",{className:"absolute inset-0 animate-spin-90 motion-reduce:animate-none",children:(0,f.jsxs)("svg",{viewBox:"0 0 600 600",className:c,children:[(0,f.jsx)("defs",{children:(0,f.jsx)("path",{id:"ln-outer",d:"M300,300 m-262,0 a262,262 0 1,1 524,0 a262,262 0 1,1 -524,0"})}),(0,f.jsx)("text",{fill:"#F4F2EE",fontFamily:"Space Mono, monospace",fontSize:"15",letterSpacing:"5",children:(0,f.jsx)("textPath",{href:"#ln-outer",children:"SYDNEY \xb7 MELBOURNE \xb7 BRISBANE \xb7 PERTH \xb7 ADELAIDE \xb7 CANBERRA \xb7 HOBART \xb7 DARWIN \xb7 GEELONG \xb7 AUCKLAND \xb7 SINGAPORE \xb7 "})})]})}),(0,f.jsxs)("svg",{viewBox:"0 0 600 600",className:c,children:[(0,f.jsx)("circle",{cx:"300",cy:"300",r:"284",fill:"none",stroke:"rgba(255,255,255,.14)",strokeWidth:"1"}),(0,f.jsx)("circle",{cx:"300",cy:"300",r:"240",fill:"none",stroke:"rgba(255,255,255,.14)",strokeWidth:"1"}),(0,f.jsx)("g",{stroke:"rgba(255,255,255,.35)",strokeWidth:"1",children:be.map(e=>(0,f.jsx)("line",{x1:"300",y1:"14",x2:"300",y2:e.len,transform:"rotate(".concat(e.deg," 300 300)")},e.deg))})]})]}),(0,f.jsxs)("div",{ref:t("ringB"),className:l,children:[(0,f.jsx)("svg",{viewBox:"0 0 600 600",className:c,children:(0,f.jsx)("circle",{cx:"300",cy:"300",r:"190",fill:"none",stroke:"rgba(255,255,255,.14)",strokeWidth:"1",strokeDasharray:"2 10"})}),(0,f.jsx)("div",{className:"absolute inset-0 animate-spinr-70 motion-reduce:animate-none",children:(0,f.jsxs)("svg",{viewBox:"0 0 600 600",className:c,children:[(0,f.jsx)("defs",{children:(0,f.jsx)("path",{id:"ln-inner",d:"M300,300 m-208,0 a208,208 0 1,1 416,0 a208,208 0 1,1 -416,0"})}),(0,f.jsx)("text",{fill:"#BF212F",fontFamily:"Space Mono, monospace",fontSize:"12.5",letterSpacing:"4",children:(0,f.jsx)("textPath",{href:"#ln-inner",children:"CONFERENCES \xb7 EXHIBITIONS \xb7 LIVE STREAMING \xb7 HEADSHOTS \xb7 AWARDS NIGHTS \xb7 SAME-DAY EDIT \xb7 "})})]})})]}),(0,f.jsx)("div",{ref:t("ringC"),className:l,children:(0,f.jsxs)("svg",{viewBox:"0 0 600 600",className:c,fill:"none",stroke:"#BF212F",strokeWidth:"1.5",children:[(0,f.jsx)("circle",{cx:"300",cy:"300",r:"150"}),ye.map(e=>(0,f.jsx)("line",{x1:"300",y1:"150",x2:"300",y2:"180",transform:"rotate(".concat(e," 300 300)")},e))]})}),(0,f.jsxs)("svg",{viewBox:"0 0 600 600",className:c,stroke:"rgba(255,255,255,.5)",strokeWidth:"1",children:[(0,f.jsx)("line",{x1:"300",y1:"0",x2:"300",y2:"30"}),(0,f.jsx)("line",{x1:"300",y1:"570",x2:"300",y2:"600"}),(0,f.jsx)("line",{x1:"0",y1:"300",x2:"30",y2:"300"}),(0,f.jsx)("line",{x1:"570",y1:"300",x2:"600",y2:"300"})]})]}),(0,f.jsxs)("div",{ref:t("head"),className:"absolute inset-x-5 bottom-8 flex flex-col items-center text-center max-md:!visible max-md:!opacity-100 md:inset-x-7 md:bottom-10 md:flex-row md:items-end md:justify-between md:text-left md:transition-[opacity,visibility] md:duration-200",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"mb-3 font-mono text-[11px] uppercase tracking-[0.26em] text-ignition",children:"Same-day event photo & video"}),(0,f.jsxs)("h1",{className:"m-0 font-display font-black uppercase leading-[0.86] tracking-[-0.035em] text-smoke",children:[(0,f.jsxs)("span",{className:"hidden md:block ".concat(je.replace("m-0 font-display font-black uppercase leading-[0.86] tracking-[-0.035em]","")),children:["Every",(0,f.jsx)("br",{}),"angle."]}),(0,f.jsxs)("span",{className:"block whitespace-nowrap text-[clamp(28px,8.6vw,56px)] md:hidden",children:["Every angle.",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"Full speed."})]})]}),(0,f.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-3.5 md:hidden",children:[(0,f.jsx)("p",{className:"m-0 max-w-[400px] text-[15px] leading-[1.5] text-[#D9D6CF] [text-wrap:pretty]",children:"Photography and video for c
1onferences, exhibitions and corporate events \u2014 delivered the same day, in every Australian capital."}),(0,f.jsx)(r.N_,{to:"/get-quote",className:"".concat(xe," mt-2 box-border w-full max-w-[320px] px-[30px] py-4 text-[15px]"),children:"Get a quote \u2192"}),(0,f.jsx)("a",{href:"#gigs",className:"font-mono text-[10.5px] uppercase tracking-[0.22em] text-ash",children:"See the work \u2193"})]})]}),(0,f.jsxs)("div",{className:"hidden text-right md:block","aria-hidden":"true",children:[(0,f.jsxs)("div",{className:"".concat(je," text-turbo-red"),children:["Full",(0,f.jsx)("br",{}),"speed."]}),(0,f.jsx)("div",{className:"mt-3 font-mono text-[11px] uppercase tracking-[0.26em] text-ash",children:"Scroll to open the aperture \u2193"})]})]}),(0,f.jsxs)("div",{ref:t("msg"),className:"absolute inset-0 hidden flex-col items-center justify-center px-6 text-center md:flex md:transition-[opacity,transform] md:duration-200",children:[(0,f.jsx)("div",{className:"mb-[18px] font-mono text-xs uppercase tracking-[0.3em] text-ignition",children:"Conferences \xb7 Exhibitions \xb7 Corporate events"}),(0,f.jsxs)("h2",{className:"m-0 max-w-[1000px] font-display text-[clamp(40px,8vw,120px)] font-black uppercase leading-[0.86] tracking-[-0.04em] text-smoke [text-shadow:0_20px_80px_rgba(0,0,0,.6)]",children:["Shot today.",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"Yours today."})]}),(0,f.jsx)("p",{className:"mx-auto mb-0 mt-6 max-w-[560px] text-lg leading-[1.55] text-[#D9D6CF] [text-wrap:pretty]",children:"Photography and video for conferences, exhibitions and corporate events \u2014 delivered the same day, in every Australian capital."}),(0,f.jsxs)("div",{className:"mt-[30px] flex flex-wrap justify-center gap-3",children:[(0,f.jsx)(r.N_,{to:"/get-quote",className:"".concat(xe," px-[34px] py-[18px] text-base"),children:"Get a quote \u2192"}),(0,f.jsx)("a",{href:"#gigs",className:"inline-flex items-center rounded-full border border-white/50 px-[30px] py-[18px] font-head text-base font-semibold text-smoke backdrop-blur-[8px] transition-colors hover:border-smoke",children:"See the work"})]}),(0,f.jsx)("div",{className:"mt-10 flex flex-wrap justify-center gap-2.5",children:ve.map(e=>(0,f.jsx)("span",{className:"rounded-full border border-white/30 px-4 py-[9px] font-mono text-[11px] uppercase tracking-[0.18em] text-smoke backdrop-blur-[8px]",children:e},e))})]})]})]})})}const Ce=2*Math.PI*52,Fe=[{v:"1,840",l:"Images in a day",color:"#F2A900",pct:.92},{v:"<4h",l:"To first delivery",color:"#0FA3A3",pct:.2},{v:"180+",l:"Five-star reviews",color:"#BF212F",pct:1},{v:"9",l:"Cities on the ground",color:"#F4F2EE",pct:.75}];function Ee(){const[e,t]=(0,ae.Wx)({threshold:.1,rootMargin:"0px"});return(0,f.jsx)("section",{id:"coverage",className:"relative bg-[#0A0A0B] ".concat(de),children:(0,f.jsxs)("div",{ref:e,className:me,children:[(0,f.jsxs)(ae.gN,{className:"mb-14 text-center",children:[(0,f.jsx)(ge,{tone:"teal",className:"mb-4",children:"01 / Full coverage"}),(0,f.jsxs)("h2",{className:pe,children:["360\xb0 on the day.",(0,f.jsx)("br",{}),"Zero on the wait."]})]}),(0,f.jsx)(ae.gN,{className:"grid grid-cols-2 gap-5 md:grid-cols-4",children:Fe.map(e=>(0,f.jsxs)("div",{className:"rounded-2xl border border-[#1F1F1F] bg-carbon-900 px-3 py-7 text-center transition-colors duration-300 hover:border-[#2B2B2B]",children:[(0,f.jsxs)("svg",{viewBox:"0 0 120 120",className:"mx-auto h-[150px] w-[150px]",children:[(0,f.jsx)("circle",{cx:"60",cy:"60",r:"52",fill:"none",stroke:"#1F1F1F",strokeWidth:"6"}),(0,f.jsx)("circle",{cx:"60",cy:"60",r:"52",fill:"none",stroke:e.color,strokeWidth:"6",strokeLinecap:"round",strokeDasharray:"".concat((t?e.pct:0)*Ce," ").concat(Ce),transform:"rotate(-90 60 60)",style:{transition:"stroke-dasharray 1.6s ".concat(he)}}),(0,f.jsx)("text",{x:"60",y:"67",textAnchor:"middle",fill:"#F4F2EE",fontFamily:"Space Mono, monospace",fontWeight:"700",fontSize:"20",children:e.v})]}),(0,f.jsx)("div",{className:"mt-2.5 font-mono text-[11px] uppercase tracking-[0.18em] text-ash",children:e.l})]},e.l))})]})})}const Te=[{slug:"",job_title:"National Retail Summit",location:"Sydney",hero_image:"/images/home/expo-crowd.jpg"},{slug:"",job_title:"Aus Healthcare Week",location:"Melbourne",hero_image:"/images/home/exhibition-floor-networking.jpg"},{slug:"",job_title:"Awards Night",location:"Brisbane",hero_image:"/images/home/gig-crowd.jpg"}],ze=[{scene:"SC 04 \xb7 TK 02",tc:"00:04:12:18"},{scene:"SC 11 \xb7 TK 01",tc:"00:12:44:03"},{scene:"SC 02 \xb7 TK 05",tc:"01:02:08:22"}],Be=function(){const e=String(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(/[,\xb7/-]/)[0].trim();return"melbourne"===e.toLowerCase()?"Melb":e};function De(){const[e,t]=(0,a.useState)(Te);(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const s=await fetch("".concat(I.fn,"/api/public/recent-gigs"));if(!s.ok)return;const a=await s.json(),n=(a.gigs||[]).filter(e=>e.hero_image).slice(0,3);!e&&a.success&&n.length&&t(n)}catch(s){}})(),()=>{e=!0}},[]);const s=e.map((e,t)=>{const{scene:s,tc:a}=function(e,t){if(!e.slug)return ze[t]||ze[0];let s=0;
1for(const a of e.slug)s=31*s+a.charCodeAt(0)>>>0;return{scene:"SC ".concat(ue(1+s%12)," \xb7 TK ").concat(ue(1+(s>>4)%5)),tc:"".concat(ue((s>>8)%2),":").concat(ue((s>>10)%60),":").concat(ue((s>>16)%60),":").concat(ue((s>>22)%25))}}(e,t);return{key:e.slug||e.job_title,src:e.hero_image,alt:e.job_title,project:"".concat(e.job_title," \u2014 ").concat(Be(e.location)),scene:s,tc:a,to:e.slug?"/recent-gigs/".concat(e.slug):"/recent-gigs"}}),[n,...i]=s;return(0,f.jsx)("section",{id:"gigs",className:"border-t border-[#1F1F1F] bg-carbon-900 ".concat(de),children:(0,f.jsxs)("div",{className:me,children:[(0,f.jsxs)(ae.gN,{className:"mb-10 flex flex-wrap items-end justify-between gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(ge,{className:"mb-4",children:"02 / Recent gigs"}),(0,f.jsxs)("h2",{className:pe,children:["Fresh off",(0,f.jsx)("br",{}),"the floor."]})]}),(0,f.jsx)(r.N_,{to:"/recent-gigs",className:"font-mono text-xs uppercase tracking-[0.18em] text-silver transition-colors hover:text-turbo-red",children:"All recent gigs \u2192"})]}),(0,f.jsxs)(ae.gN,{className:"grid grid-cols-1 gap-4 md:grid-cols-[1.3fr_1fr]",children:[n&&(0,f.jsx)(se,(0,m.A)((0,m.A)({},n),{},{ratio:"16/10",brackets:!0})),(0,f.jsx)("div",{className:"grid gap-4",children:i.map(e=>(0,f.jsx)(se,(0,m.A)((0,m.A)({},e),{},{ratio:"16/9"}),e.key))})]})]})})}const Ie=[{title:"Conferences",tag:"Photo + video",color:"#BF212F",img:"/images/services/locations/conference-speaker-podium.jpg",blurb:"Multi-day, multi-camera, broadcast-ready. Keynotes, panels and breakouts covered from every angle, with stills and highlight edits landing the same day."},{title:"Exhibitions",tag:"Photo",color:"#F2A900",img:"/images/home/expo-crowd.jpg",blurb:"Stand-by-stand coverage and same-day floor stories for organisers and exhibitors alike."},{title:"Live streaming",tag:"Broadcast",color:"#0FA3A3",img:"/images/services/locations/event-coverage-plenary.jpg",blurb:"Switched multi-camera streams with graphics and lower thirds, to any platform your audience is on."},{title:"Corporate headshots",tag:"Studio",color:"#BF212F",img:"/images/headshots/hero-cutout-a.webp",fit:"xMidYMin slice",blurb:"A pop-up studio in your office. About a minute per person. Retouched, LinkedIn-ready portraits the same day."},{title:"Corporate events",tag:"Photo + video",color:"#F2A900",img:"/images/services/locations/corporate-awards-dinner-speaker.jpg",blurb:"Awards nights, launches, gala dinners and brand films \u2014 shot and cut to move while the night is still news."},{title:"Schools",tag:"Photo",color:"#0FA3A3",img:"/turbo-crew-video.jpg",blurb:"Editorial
1-grade school and production media, delivered fast enough to share the next morning."}];function Re(){const[e,t]=(0,a.useState)(0),s=Ie[e];return(0,f.jsx)("section",{id:"services",className:"border-t border-[#1F1F1F] bg-[#0A0A0B] ".concat(de),children:(0,f.jsxs)("div",{className:"".concat(me," grid grid-cols-1 items-center gap-12 md:grid-cols-2"),children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(ge,{tone:"amber",className:"mb-4",children:"03 / Services \xb7 select a channel"}),(0,f.jsx)("h2",{className:"".concat(pe," mb-7"),children:"Turn the dial."}),(0,f.jsx)("div",{className:"flex flex-col border-t border-[#2B2B2B]",children:Ie.map((s,a)=>(0,f.jsxs)(r.N_,{to:"/get-quote",onMouseEnter:()=>t(a),onFocus:()=>t(a),onClick:()=>t(a),className:"grid grid-cols-[44px_1fr_auto] items-center gap-4 border-b border-[#2B2B2B] py-[18px] transition-[color,padding] duration-300 hover:pl-2.5",style:{color:a===e?s.color:"#F4F2EE"},children:[(0,f.jsx)("span",{className:"font-mono text-[11px] tracking-[0.2em]",children:ue(a+1)}),(0,f.jsx)("span",{className:"font-head text-[26px] font-bold tracking-[-0.01em]",children:s.title}),(0,f.jsx)("span",{className:"font-mono text-[10.5px] uppercase tracking-[0.16em] text-ash",children:s.tag})]},s.title))}),(0,f.jsx)("p",{className:"mb-0 mt-[22px] max-w-[460px] text-base leading-[1.6] text-[#9C9A95]",children:s.blurb})]}),(0,f.jsxs)(ae.gN,{className:"relative mx-auto hidden w-full max-w-[520px] md:block",children:[(0,f.jsxs)("svg",{viewBox:"0 0 400 400",className:"h-auto w-full",children:[(0,f.jsx)("circle",{cx:"200",cy:"200",r:"190",fill:"none",stroke:"#2B2B2B",strokeWidth:"1"}),(0,f.jsx)("circle",{cx:"200",cy:"200",r:"150",fill:"none",stroke:"#2B2B2B",strokeWidth:"1",strokeDasharray:"3 9"}),Ie.map((e,t)=>(0,f.jsxs)("g",{transform:"rotate(".concat(60*t," 200 200)"),children:[(0,f.jsx)("line",{x1:"200",y1:"10",x2:"200",y2:"40",stroke:e.color,strokeWidth:"2"}),(0,f.jsx)("text",{x:"200",y:"62",textAnchor:"middle",fill:"#8A8884",fontFamily:"Space Mono, monospace",fontSize:"9",letterSpacing:"2",children:ue(t+1)})]},e.title)),(0,f.jsxs)("g",{style:{transformOrigin:"200px 200px",transform:"rotate(".concat(60*e,"deg)"),transition:"transform .6s ".concat(he)},children:[(0,f.jsx)("line",{x1:"200",y1:"200",x2:"200",y2:"48",stroke:"#BF212F",strokeWidth:"3",strokeLinecap:"round"}),(0,f.jsx)("circle",{cx:"200",cy:"200",r:"10",fill:"#BF212F"})]}),(0,f.jsx)("clipPath",{id:"ln-clip",children:(0,f.jsx)("circle",{cx:"200",cy:"200",r:"118"})}),(0,f.jsx)("circle",{cx:"200",cy:"200",r:"118",fill:"#1A1A1A"}),(0,f.jsx)("image",{href:s.img,x:"82",y:"82",width:"236",height:"236",preserveAspectRatio:s.fit||"xMidYMid slice",clipPath:"url(#ln-clip)",style:{opacity:.95}}),(0,f.jsx)("circle",{cx:"200",cy:"200",r:"118",fill:"none",stroke:"rgba(255,255,255,.2)",strokeWidth:"1"})]}),(0,f.jsx)("div",{className:"absolute bottom-[-8px] left-1/2 -translate-x-1/2 whitespace-nowrap bg-[#0A0A0B] px-2.5 py-1 font-mono text-[11px] uppercase tracking-[0.2em] text-smoke",children:s.title})]})]})})}const Pe=e=>"/images/headshots/wall@2x/".concat(e.id,".webp"),We=oe.slice(0,20),Oe=oe.slice(20,32),Le="block h-full w-full rounded-full border-2 border-carbon-900 bg-[#1A1A1A] object-cover [box-sizing:border-box]";function Me(){return(0,f.jsx)("section",{id:"faces",className:"overflow-hidden border-t border-[#1F1F1F] bg-carbon-900 ".concat(de),children:(0,f.jsxs)("div",{className:"".concat(me," grid grid-cols-1 items-center gap-12 md:grid-cols-2"),children:[(0,f.jsxs)(ae.gN,{className:"group relative mx-auto aspect-square w-full max-w-[560px]",children:[(0,f.jsx)("div",{className:"absolute inset-0 animate-spin-90 group-hover:[animation-play-state:paused] motion-reduce:animate-none",children:We.map((e,t)=>(0,f.jsx)("div",{className:"absolute left-1/2 top-1/2 -ml-[6.5%] -mt-[6.5%] aspect-square w-[13%]",style:{transform:"rotate(".concat(18*t,"deg) translateY(-330%) rotate(-").concat(18*t,"deg)")},children:(0,f.jsx)("img",{src:Pe(e),alt:"Corporate headshot by Turbo 360",loading:"lazy",className:"".concat(Le," animate-spinr-90 group-hover:[animation-play-state:paused] motion-reduce:animate-none")})},e.id))}),(0,f.jsx)("div",{className:"absolute inset-[18%] animate-spinr-70 group-hover:[animation-play-state:paused] motion-reduce:animate-none",children:Oe.map((e,t)=>(0,f.jsx)("div",{className:"absolute left-1/2 top-1/2 -ml-[8%] -mt-[8%] aspect-square w-[16%]",style:{transform:"rotate(".concat(30*t,"deg) translateY(-250%) rotate(-").concat(30*t,"deg)")}
1,children:(0,f.jsx)("img",{src:Pe(e),alt:"Corporate headshot by Turbo 360",loading:"lazy",className:"".concat(Le," animate-spin-70 group-hover:[animation-play-state:paused] motion-reduce:animate-none")})},e.id))}),(0,f.jsxs)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 text-center",children:[(0,f.jsx)("div",{className:"font-mono text-[44px] font-bold leading-none text-ignition",children:"51"}),(0,f.jsx)("div",{className:"mt-1.5 font-mono text-[10px] uppercase tracking-[0.2em] text-ash",children:"One session"})]})]}),(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(ge,{tone:"teal",className:"mb-4",children:"04 / Corporate headshots"}),(0,f.jsxs)("h2",{className:"".concat(pe," mb-5"),children:["A whole room",(0,f.jsx)("br",{}),"in orbit."]}),(0,f.jsx)("p",{className:"mb-7 mt-0 max-w-[460px] text-[17px] leading-[1.65] text-[#9C9A95]",children:"Pop-up studio in your office. About a minute per person. Retouched, LinkedIn-ready portraits delivered the same day \u2014 every face here is from one session."}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,f.jsx)(r.N_,{to:"/services/corporate-headshots",className:"".concat(xe," px-7 py-4 text-[15px]"),children:"Book corporate headshots \u2192"}),(0,f.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-ash",children:"1 min / person \xb7 Same-day retouch"})]})]})]})})}function qe(){return(0,f.jsxs)("section",{id:"ready",className:"relative overflow-hidden border-t border-[#1F1F1F] bg-[#0A0A0B] text-center ".concat(de),children:[(0,f.jsx)("div",{className:"pointer-events-none absolute left-1/2 top-1/2 h-[140vmax] w-[140vmax] -translate-x-1/2 -translate-y-1/2 rounded-full",style:{background:"radial-gradient(circle,rgba(191,33,47,.35),transparent 45%)"}}),(0,f.jsx)("svg",{viewBox:"0 0 600 600","aria-hidden":"true",className:"pointer-events-none absolute left-1/2 top-1/2 h-[min(140vw,900px)] w-[min(140vw,900px)] -translate-x-1/2 -translate-y-1/2 opacity-35",children:(0,f.jsxs)("g",{className:"origin-[300px_300px] animate-spin-90 motion-reduce:animate-none",children:[(0,f.jsx)("circle",{cx:"300",cy:"300",r:"290",fill:"none",stroke:"rgba(255,255,255,.14)",strokeWidth:"1"}),(0,f.jsx)("circle",{cx:"300",cy:"300",r:"220",fill:"none",stroke:"rgba(255,255,255,.14)",strokeWidth:"1",strokeDasharray:"2 10"})]})}),(0,f.jsxs)(ae.gN,{className:"relative mx-auto max-w-[900px]",children:[(0,f.jsxs)("div",{className:"mb-[18px] inline-flex items-center gap-2.5 font-mono text-xs uppercase tracking-[0.3em] text-ignition",children:[(0,f.jsx)("span",{className:"inline-block h-2 w-2 animate-blink rounded-full bg-turbo-red motion-reduce:animate-none"}),"Booking line open"]}),(0,f.jsxs)("h2",{className:"m-0 font-display text-[clamp(40px,7vw,100px)] font-black uppercase leading-[0.88] tracking-[-0.04em] text-smoke",children:["Your next event",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"covered."})]}),(0,f.jsx)("p",{className:"mx-auto mb-0 mt-[26px] max-w-[520px] text-lg leading-[1.6] text-[#C7C4BD]",children:"One booking. Full coverage. Same-day delivery. Tell us the brief and we'll have a quote back within hours."}),(0,f.jsxs)("div",{className:"mt-[34px] flex flex-wrap justify-center gap-3",children:[(0,f.jsx)(r.N_,{to:"/get-quote",className:"".concat(xe," px-11 py-5 text-lg"),children:"Get a quote \u2192"}),(0,f.jsx)("a",{href:"tel:1300207446",className:"inline-flex items-center rounded-full border border-white/30 px-[30px] py-5 font-mono text-[15px] text-smoke transition-colors hover:border-smoke",children:"1300 207 446"})]})]})]})}function He(){return(0,f.jsxs)("div",{className:"relative bg-[#0A0A0B] text-smoke [overflow-x:clip]",style:{fontFamily:"'Hanken Grotesk', system-ui, -apple-system, sans-serif"},children:[(0,f.jsx)(R.A,(0,m.A)({},R.p.home)),(0,f.jsx)(fe,{}),(0,f.jsx)(Y.A,{heroProgress:Ne}),(0,f.jsxs)("main",{children:[(0,f.jsx)(_e,{}),(0,f.jsx)(Ee,{}),(0,f.jsx)(De,{}),(0,f.jsx)(Re,{}),(0,f.jsx)(Me,{}),(0,f.jsx)(qe,{})]}),(0,f.jsx)(K.A,{}),(0,f.jsx)(X,{path:"/"})]})}var Ue=s(247),Ge=s(9333),Ve=s(99757),Je=s(4596),Ye=s(14459),Ke=s(95264),Ze=s(92330),$e=s(28814),Qe=s(44632),Xe=s(7118),et=s(55731),tt=s(23165),st=s(35746),at=s(88306),nt=s(63944),rt=s(91140),it=s(13390),ot=s(53986),lt=s(10917),ct=s(1089);const dt=["className","variant"],mt=(0,lt.F)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function pt(e){let{className:t,variant:s}=e,a=(0,ot.A)(e,dt);
1return(0,f.jsx)("div",(0,m.A)({className:(0,ct.cn)(mt({variant:s}),t)},a))}Ue.A,Ge.A,Ve.A,Je.A,F.A,E.A,T.A,Ye.A,Ke.A,C.A,Ze.A,$e.A,Qe.A,Xe.A,et.A,tt.A,Je.A,st.A,at.A;const xt=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)(0),[n,i]=(0,a.useState)(new Set),[l,c]=(0,a.useState)("EXPO");(0,a.useEffect)(()=>{const t="true"===new URLSearchParams(window.location.search).get("admin"),s=(0,o.cd)();t&&s?e("/admin"):t&&e("/tboadmin")},[e]),(0,a.useEffect)(()=>{const e=()=>s(window.scrollY);return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),(0,a.useEffect)(()=>{const e=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&i(t=>new Set([...t,e.target.id]))})},{threshold:.1});return document.querySelectorAll("[id]").forEach(t=>e.observe(t)),()=>e.disconnect()},[]),(0,a.useEffect)(()=>{d()},[]);const d=async()=>{try{const e=await fetch("".concat(I.fn,"/api/settings/public"));if(e.ok){const t=await e.json();c(t.homepage_video_selection||"EXPO")}}catch(e){console.error("Error loading video selection:",e),c("EXPO")}};return(0,f.jsxs)("div",{className:"min-h-screen bg-dark-bg text-white pt-20",children:[(0,f.jsx)(R.A,(0,m.A)({},R.p.home)),(0,f.jsx)(D.A,{currentPage:"Home"}),(0,f.jsxs)("section",{id:"hero",className:"relative h-screen flex items-center justify-center overflow-hidden",children:[(0,f.jsxs)("div",{className:"absolute inset-0 z-0",children:[(0,f.jsxs)("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-cover",poster:O.l4.heroBackground,children:[(0,f.jsx)("source",{src:"FOOD"===l||"FOOD_EXTENDED"===l?"/food_video_extended.mp4":"WEBBG"===l?"/webbg_compressed.mp4":"/hero_video_compressed.mp4",type:"video/mp4"}),(0,f.jsx)("img",{src:O.l4.heroBackground,alt:"Same-day event photography and video production team at Brisbane corporate conference",className:"w-full h-full object-cover"})]},l),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-black/50 via-black/30 to-black/60"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_center,transparent_0%,rgba(0,0,0,0.4)_100%)]"}),(0,f.jsx)("div",{className:"absolute inset-0 opacity-10",children:(0,f.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(239,68,68,0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(239,68,68,0.3) 1px, transparent 1px)",backgroundSize:"100px 100px",animation:"grid-move 20s linear infinite"}})})]}),(0,f.jsxs)("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,f.jsxs)("div",{className:"inline-flex items-center space-x-2 bg-turbo-red/10 border border-turbo-red/30 rounded-full px-4 py-2 mb-8 backdrop-blur-sm animate-fadeIn",children:[(0,f.jsxs)("span",{className:"relative flex h-3 w-3",children:[(0,f.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-turbo-red opacity-75"}),(0,f.jsx)("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-turbo-red"})]}),(0,f.jsx)("span",{className:"text-white/90 text-sm font-semibold",children:"Same-Day Delivery \u2022 Australia Wide"})]}),(0,f.jsxs)("h1",{className:"text-5xl md:text-7xl lg:text-8xl font-black mb-6 leading-none",children:[(0,f.jsx)("span",{className:"block bg-gradient-to-r from-white via-gray-100 to-white bg-clip-text text-transparent animate-fadeInUp",children:O.l4.headline.split(" ")[0]}),(0,f.jsx)("span",{className:"block bg-gradient-to-r from-turbo-red via-orange-500 to-turbo-red bg-clip-text text-transparent animate-fadeInUp",style:{animationDelay:"0.2s"},children:O.l4.headline.split(" ").slice(1).join(" ")})]}),(0,f.jsx)("div",{className:"max-w-3xl mx-auto mb-12 animate-fadeInUp",style:{animationDelay:"0.4s"},children:(0,f.jsx)("p",{className:"text-lg md:text-xl text-gray-200 backdrop-blur-sm bg-black/20 rounded-2xl p-6 border border-white/10",children:O.l4.subtext})}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 justify-center items-center animate-fadeInUp",style:{animationDelay:"0.6s"},children:[(0,f.jsx)(r.N_,{to:"/get-quote",children:(0,f.jsxs)("button",{className:"group relative px-10 py-5 bg-gradient-to-r from-turbo-red via-red-600 to-orange-500 hover:from-turbo-red hover:via-red-500 hover:to-orange-400 text-white font-bold rounded-2xl transition-all duration-300 shadow-2xl hover:shadow-turbo-red/50 transform hover:scale-105 overflow-hidden",children:[(0,f.jsxs)("div",{className:"relative z-10 flex items-center space-x-3",children:[(0,f.jsx)(F.A,{className:"h-6 w-6"}),(0,f.jsx)("span",{className:"text-lg",children:"GET A QUOTE"}),(0,f.jsx)(S.A,{className:"h-5 w-5 group-hover:translate-x-1 transition-transform"})]}),(0,f.jsx)("div",{className:"absolute inset-0 bg-white/20 opacity-0 group-hover:opacity-100 transition-opacity duration-300"})]})}),(0,f.jsx)("a",{href:"#services",onClick:e=>{var t;e.preventDefault(),null===(t=document.getElementById("services"))||void 0===t||t.scrollIntoView({behavior:"smooth"})},className:"group px-10 py-5 bg-white/10 hover:bg-white/20 backdrop-blur-md border-2 border-white/30 hover:border-white/50 text-white font-bold rounded-2xl transition-all duration-300 transform hover:scale-105",children:(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)(_.A,{className:"h-6 w-6"}),(0,f.jsx)("span",{className:"text-lg",children:"EXPLORE SERVICES"})]})})]}),(0,f.jsxs)("div",{className:"grid grid-cols-3 gap-4 max-w-3xl mx-auto mt-16 animate-fadeInUp",style:{animationDelay:"0.8s"},children:[(0,f.jsxs)("div",{className:"bg-white/5 backdrop-blur-md border border-white/10 rounded-xl p-4 hover:bg-white/10 transition-all duration-300",children:[(0,f.jsx)("div",{className:"text-3xl font-black text-turbo-red mb-1",children:"180+"}),(0,f.jsx)("div",{className:"text-sm text-gray-300",children:"5-Star Reviews"})]}),(0,f.jsxs)("div",{className:"bg-white/5 backdrop-blur-md border border-white/10 rounded-xl p-4 hover:bg-white/10 transition-all duration-300",children:[(0,f.jsx)("div",{className:"text-3xl font-black text-turbo-red mb-1",children:"24/7"}),(0,f.jsx)("div",{className:"text-sm text-gray-300",children:"Same-Day Delivery"})]}),(0,f.jsxs)("div",{className:"bg-white/5 backdrop-blur-md border border-white/10 rounded-xl p-4 hover:bg-white/10 transition-all duration-300",children:[(0,f.jsx)("div",{className:"text-3xl font-black text-turbo-red mb-1",children:"3"}),(0,f.jsx)("div",{className:"text-sm text-gray-300",children:"Countries"})]})]})]}),(0,f.jsx)("style",{jsx:!0,children:"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n @keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translateY(30px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes grid-move {\n 0% { transform: translateY(0); }\n 100% { transform: translateY(100px); }\n }\n .animate-fadeIn {\n animation: fadeIn 1s ease-out forwards;\n }\n .animate-fadeInUp {\n animation: fadeInUp 1s ease-out forwards;\n opacity: 0;\n }\n "})]}),(0,f.jsxs)("section",{id:"services",className:"relative py-32 bg-black overflow-hidden",children:[(0,f.jsxs)("div",{className:"absolute inset-0 opacity-5",children:[(0,f.jsx)("div",{className:"absolute top-0 left-1/4 w-96 h-96 bg-turbo-red rounded-full filter blur-3xl animate-pulse"}),(0,f.jsx)("div",{className:"absolute bottom-0 right-1/4 w-96 h-96 bg-
1orange-500 rounded-full filter blur-3xl animate-pulse",style:{animationDelay:"1s"}})]}),(0,f.jsxs)("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,f.jsxs)("div",{className:"text-center mb-20",children:[(0,f.jsx)("div",{className:"inline-block mb-4 px-6 py-2 bg-turbo-red/10 border border-turbo-red/30 rounded-full",children:(0,f.jsx)("span",{className:"text-turbo-red font-bold text-sm tracking-wider",children:"OUR EXPERTISE"})}),(0,f.jsx)("h2",{className:"text-5xl md:text-6xl font-black mb-6 bg-gradient-to-r from-white to-gray-400 bg-clip-text text-transparent",children:"Elite Services"}),(0,f.jsx)("p",{className:"text-xl text-gray-400 max-w-3xl mx-auto leading-relaxed",children:"From business content to weddings, conferences to development \u2014 we deliver excellence across every industry"})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:[(0,f.jsx)("a",{href:"/business",className:"group relative",children:(0,f.jsxs)("div",{className:"relative h-full bg-gradient-to-br from-gray-900 to-black border border-gray-800 hover:border-turbo-red rounded-2xl overflow-hidden transition-all duration-500 hover:scale-[1.02] hover:shadow-2xl hover:shadow-turbo-red/20",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,f.jsxs)("div",{className:"relative p-8",children:[(0,f.jsxs)("div",{className:"relative mb-6 overflow-hidden rounded-xl",children:[(0,f.jsx)("img",{src:"/images/services/business-service.jpg",alt:"Corporate photography and video production for business events",className:"w-full h-56 object-cover transition-transform duration-700 group-hover:scale-110"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/10 to-transparent"}),(0,f.jsx)("div",{className:"absolute bottom-4 left-4 flex items-center justify-center w-14 h-14 rounded-full bg-turbo-red shadow-lg",children:(0,f.jsx)(Ke.A,{className:"h-7 w-7 text-white"})})]}),(0,f.jsx)("h3",{className:"text-2xl font-black mb-3 text-white group-hover:text-turbo-red transition-colors",children:"Business"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm leading-relaxed mb-6",children:"Professional photography and videography for corporate events, product launches, and business communications."}),(0,f.jsxs)("div",{className:"flex items-center text-turbo-red font-bold text-sm",children:[(0,f.jsx)("span",{children:"Explore Service"}),(0,f.jsx)(S.A,{className:"ml-2 h-4 w-4 group-hover:translate-x-2 transition-transform duration-300"})]})]})]})}),(0,f.jsx)("a",{href:"/conferences",className:"group relative",children:(0,f.jsxs)("div",{className:"relative h-full bg-gradient-to-br from-gray-900 to-black border border-gray-800 hover:border-turbo-red rounded-2xl overflow-hidden transition-all duration-500 hover:scale-[1.02] hover:shadow-2xl hover:shadow-turbo-red/20",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,f.jsxs)("div",{className:"relative p-8",children:[(0,f.jsxs)("div",{className:"relative mb-6 overflow-hidden rounded-xl",children:[(0,f.jsx)("img",{src:"/images/services/locations/CONFERENCE-PHOTOGRAPHY.jpg",alt:"Conference photography with multi-camera setup and live streaming",className:"w-full h-56 object-cover transition-transform duration-700 group-hover:scale-110"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/10 to-transparent"}),(0,f.jsx)("div",{className:"absolute bottom-4 left-4 flex items-center justify-center w-14 h-14 rounded-full bg-turbo-red shadow-lg",children:(0,f.jsx)(Xe.A,{className:"h-7 w-7 text-white"})})]}),(0,f.jsx)("h3",{className:"text-2xl font-black mb-3 text-white group-hover:text-turbo-red transition-colors",children:"Conferences"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm leading-relaxed mb-6",children:"Complete conference coverage with live streaming, keynote recording, and instant content delivery."}),(0,f.jsxs)("div",{className:"flex items-center text-turbo-red font-bold text-sm",children:[(0,f.jsx)("span",{children:"Explore Service"}),(0,f.jsx)(S.A,{className:"ml-2 h-4 w-4 group-hover:translate-x-2 transition-transform duration-300"})]})]})]})}),(0,f.jsx)("a",{href:"/schools",className:"group relative",children:(0,f.jsxs)("div",{className:"relative h-full bg-gradient-to-br from-gray-900 to-black border border-gray-800 hover:border-turbo-red rounded-2xl overflow-hidden transition-all duration-500 hover:scale-[1.02] hover:shadow-2xl hover:shadow-turbo-red/20",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,f.jsxs)("div",{className:"relative p-8",children:[(0,f.jsxs)("div",{className:"relative mb-6 overflow-hidden rounded-xl",children:[(0,f.jsx)("img",{src:"https://images.pixieset.com/30907998/7872da9f53adc61714feb3998054845d-xxlarge.jpg",alt:"School photography for sports days, graduations and events",className:"w-full h-56 object-cover transition-transform duration-700 group-hover:scale-110"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/10 to-transparent"}),(0,f.jsx)("div",{className:"absolute bottom-4 left-4 flex items-center justify-center w-14 h-14 roun
1ded-full bg-turbo-red shadow-lg",children:(0,f.jsx)(Ue.A,{className:"h-7 w-7 text-white"})})]}),(0,f.jsx)("h3",{className:"text-2xl font-black mb-3 text-white group-hover:text-turbo-red transition-colors",children:"Schools"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm leading-relaxed mb-6",children:"Capture every milestone with professional school photography from sports days to graduations."}),(0,f.jsxs)("div",{className:"flex items-center text-turbo-red font-bold text-sm",children:[(0,f.jsx)("span",{children:"Explore Service"}),(0,f.jsx)(S.A,{className:"ml-2 h-4 w-4 group-hover:translate-x-2 transition-transform duration-300"})]})]})]})}),(0,f.jsx)("a",{href:"/development",className:"group relative",children:(0,f.jsxs)("div",{className:"relative h-full bg-gradient-to-br from-gray-900 to-black border border-gray-800 hover:border-turbo-red rounded-2xl overflow-hidden transition-all duration-500 hover:scale-[1.02] hover:shadow-2xl hover:shadow-turbo-red/20",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,f.jsxs)("div",{className:"relative p-8",children:[(0,f.jsxs)("div",{className:"relative mb-6 overflow-hidden rounded-xl",children:[(0,f.jsx)("img",{src:"/development-code.jpg",alt:"Custom software development for event management platforms",className:"w-full h-56 object-cover transition-transform duration-700 group-hover:scale-110"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/10 to-transparent"}),(0,f.jsx)("div",{className:"absolute bottom-4 left-4 flex items-center justify-center w-14 h-14 rounded-full bg-turbo-red shadow-lg",children:(0,f.jsx)(Ke.A,{className:"h-7 w-7 text-white"})})]}),(0,f.jsx)("h3",{className:"text-2xl font-black mb-3 text-white group-hover:text-turbo-red transition-colors",children:"Development"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm leading-relaxed mb-6",children:"Progress documentation and site photography for construction and development projects."}),(0,f.jsxs)("div",{className:"flex items-center text-turbo-red font-bold text-sm",children:[(0,f.jsx)("span",{children:"Explore Service"}),(0,f.jsx)(S.A,{className:"ml-2 h-4 w-4 group-hover:translate-x-2 transition-transform duration-300"})]})]})]})}),(0,f.jsx)("a",{href:"https://weddings.turbo.net.au",className:"group relative",children:(0,f.jsxs)("div",{className:"relative h-full bg-gradient-to-br from-gray-900 to-black border border-gray-800 hover:border-turbo-red rounded-2xl overflow-hidden transition-all duration-500 hover:scale-[1.02] hover:shadow-2xl hover:shadow-turbo-red/20",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,f.jsxs)("div",{className:"relative p-8",children:[(0,f.jsxs)("div",{className:"relative mb-6 overflow-hidden rounded-xl",children:[(0,f.jsx)("img",{src:"https://images.unsplash.com/photo-1519741497674-611481863552?w=800",alt:"Wedding videography with same-day highlight videos and drone footage",className:"w-full h-56 object-cover transition-transform duration-700 group-hover:scale-110"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/10 to-transparent"}),(0,f.jsx)("div",{className:"absolute bottom-4 left-4 flex items-center justify-center w-14 h-14 rounded-full bg-turbo-red shadow-lg",children:(0,f.jsx)(Ue.A,{className:"h-7 w-7 text-white"})})]}),(0,f.jsx)("h3",{className:"text-2xl font-black mb-3 text-white group-hover:text-turbo-red transition-colors",children:"Weddings"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm leading-relaxed mb-6",children:"Preserve your special day with cinematic wedding photography and videography."}),(0,f.jsxs)("div",{className:"flex items-center text-turbo-red font-bold text-sm",children:[(0,f.jsx)("span",{children:"Explore Service"}),(0,f.jsx)(S.A,{className:"ml-2 h-4 w-4 group-hover:translate-x-2 transition-transform duration-300"})]})]})]})}),(0,f.jsx)("a",{href:"/about",className:"group relative",children:(0,f.jsx)("div",{className:"relative h-full bg-gradient-to-br from-turbo-red/10 to-orange-500/10 border-2 border-dashed border-turbo-red/30 hover:border-turbo-red rounded-2xl overflow-hidden transition-all duration-500 hover:scale-[1.02]",children:(0,f.jsxs)("div",{className:"relative p-8 flex flex-col items-center justify-center h-full text-center",children:[(0,f.jsx)("div",{className:"w-20 h-20 rounded-full bg-turbo-red/20 flex items-center justify-center mb-6",children:(0,f.jsx)(F.A,{className:"h-10 w-10 text-turbo-red"})}),(0,f.jsx)("h3",{className:"text-2xl font-black mb-3 text-white",children:"More Services"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm mb-6",children:"Discover our full range of photography and videography solutions"}),(0,f.jsxs)("div",{className:"flex items-center text-turbo-red font-bold text-sm",children:[(0,f.jsx)("span",{children:"View All"}),(0,f.jsx)(S.A,{className:"ml-2 h-4 w-4 group-hover:translate-x-2 transition-transform duration-300"})]})]})})})]})]})]}),(0,f.jsxs)("section",{id:"why-choose",className:"relative py-32 bg-gradient-to-b from-gray-900 via-black to-gray-900",children:[(0,f.jsxs)("div",{className:"absolute inset-0 overflow-hidden",children:[(0,f.jsx)("div",{className:"absolute top-1/4 left-0 w-72 h-72 bg-turbo-red/10 rounded-full filter blur-3xl"}),(0,f.jsx)("div",{className:"absolute bottom-1/4 right-0 w-72 h-72 bg-orange-500/10 rounded-full filter blur-3xl"})]}),(0,f.jsxs)("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,f.jsxs)("div",{className:"text-center mb-20",children:[(0,f.jsx)("div",{className:"inline-block mb-4 px-6 py-2 bg-turbo-red/10 border border-turbo-red/30 rounded-full",children:(0,f.jsx)("span",{className:"text-turbo-red font-bold text-sm tracking-wider",children:"OUR ADVANTAGE"})}),(0,f.jsxs)("h2",{className:"text-5xl md:text-6xl font-black mb-6",children:[(0,f.jsx)("span",{className:"bg-gradient-to-r from-white via-gray-100 to-white bg-clip-text text-transparent",children:"Why Choose "}),(0,f.jsx)("span",{className:"bg-gradient-to-r from-turbo-red to-orange-500 bg-clip-text text-transparent",children:"Turbo 360"})]}),(0,f.jsx)("p",{className:"text-xl text-gray-400 max-w-3xl mx-auto",children:"25+ years of excellence delivering world-class content across Australia, New Zealand, and Singapore"})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-8",children:[(0,f.jsx)("div",{className:"group relative",children:(0,f.jsxs)("div",{className:"h-full bg-gradient-to-br from-gray-800/50 to-gray-900/50 backdrop-blur-sm border border-gray-700 hover:border-turbo-red rounded-2xl p-8 transition-all duration-500 hover:scale-105 hover:shadow-2xl hover:shadow-turbo-red/20",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/0 to-turbo-red/5 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-turbo-red to-orange-500 flex items-center justify-center mb-6 shadow-lg group-hover:scale-110 transition-transform duration-300",children:(0,f.jsx)(F.A,{className:"h-8 w-8 text-white"})}),(0,f.jsx)("h3",{className:"text-2xl font-black mb-4 text-white group-hover:text-turbo-red transition-colors",children:"Lightning Fast"}),(0,f.jsx)("p",{className:"text-gray-400 leading-relaxed",children:"24-hour content delivery guaranteed. Your content, when you need it."})]})]})}),(0,f.jsx)("div",{className:"group relative",children:(0,f.jsxs)("div",{className:"h-full bg-gradient-to-br from-gray-800/50 to-gray-900/50 backdrop-blur-sm border border-gray-700 hover:border-turbo-red rounded-2xl p-8 transition-all duration-500 hover:scale-105 hover:shadow-2xl hover:shadow-turbo-red/20",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/0 to-turbo-red/5 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-turbo-red to-orange-500 flex items-center justify-center mb-6 shadow-lg group-hover:scale-110 transition-transform duration-300",children:(0,f.jsx)(_.A,{className:"h-8 w-8 text-white"})}),(0,f.jsx)("h3",{className:"text-2xl font-black mb-4 text-white group-hover:text-turbo-red transition-colors",children:"Elite Quality"}),(0,f.jsx)("p",{className:"text-gray-400 leading-relaxed",children:"Cinema-grade equipment and expertise for stunning results every time."})]})]})}),(0,f.jsx)("div",{className:"group relative",children:(0,f.jsxs)("div",{className:"h-full bg-gradient-to-br from-gray-800/50 to-gray-900/50 backdrop-blur-sm border border-gray-700 hover:border-turbo-red rounded-2xl p-8 transition-all duration-500 hover:scale-105 hover:shadow-2xl hover:shadow-turbo-red/20",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/0 to-turbo-red/5 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-turbo-red to-orange-500 flex items-center justify-center mb-6 shadow-lg group-hover:scale-110 transition-transform duration-300",children:(0,f.jsx)(et.A,{className:"h-8 w-8 text-white"})}),(0,f.jsx)("h3",{className:"text-2xl font-black mb-4 text-white group-hover:text-turbo-red transition-colors",children:"Global Reach"}),(0,f.jsx)("p",{className:"text-gray-400 leading-relaxed",children:"Coverage across Australia, New Zealand, and Singapore."})]})]})}),(0,f.jsx)("div",{className:"group relative",children:(0,f.jsxs)("div",{className:"h-full bg-gradient-to-br from-gray-800/50 to-gray-900/50 backdrop-blur-sm border border-gray-700 hover:border-turbo-red rounded-2xl p-8 transition-all duration-500 hover:scale-105 hover:shadow-2xl hover:shadow-turbo-red/20",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/0 to-turbo-red/5 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("div",{className:"w-16 h-16 rounded-2xl bg-gradient-to-br from-turbo-red to-orange-500 flex items-center justify-center mb-6 shadow-lg group-hover:scale-110 transition-transform duration-300",children:(0,f.jsx)(nt.A,{className:"h-8 w-8 text-white"})}),(0,f.jsx)("h3",{className:"text-2xl font-black mb-4 text-white group-hover:text-turbo-red transition-colors",children:"Proven Track Record"}),(0,f.jsx)("p",{className:"text-gray-400 leading-relaxed",children:"25+ years experience trusted by industry leaders worldwide."})]})]})})]})]})]}),(0,f.jsxs)("section",{id:"nationwide",className:"relative py-24 bg-black overflow-hidden",children:[(0,f.jsx)("div",{className:"absolute inset-0 opacity-5",children:(0,f.jsx)("div",{className:"absolute top-1/3 right-1/4 w-96 h-96 bg-turbo-red rounded-full filter blur-3xl animate-pulse"})}),(0,f.jsxs)("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,f.jsxs)("div",{className:"text-center mb-16",children:[(0,f.jsx)("div",{className:"inline-block mb-4 px-6 py-2 bg-turbo-red/10 border border-turbo-red/30 rounded-full",children:(0,f.jsx)("span",{className:"text-turbo-red font-bold text-sm tracking-wider",children:"SAME-DAY COVERAGE"})}),(0,f.jsxs)("h2",{className:"text-5xl md:text-6xl font-black mb-6",children:[(0,f.jsx)("span",{className:"bg-gradient-to-r from-white via-gray-100 to-white bg-clip-text text-transparent",children:"Across "}),(0,f.jsx)("span",{className:"bg-gradient-to-r from-turbo-red to-orange-500 bg-clip-text text-transparent",children:"Australia"})]}),(0,f.jsx)("p",{className:"text-xl text-gray-400 max-w-3xl mx-auto",children:"Delivering professional event photography and videography in every Australian capital city"})]}),(0,f.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-10",children:L.EW.map(e=>{const t=(0,L.KM)(e);return(0,f.jsx)(r.N_,{to:"/services/locations/".concat(e),className:"group",children:(0,f.jsxs)("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 hover:border-turbo-red rounded-2xl p-5 transition-all duration-300 hover:scale-[1.03] hover:shadow-xl hover:shadow-turbo-red/10",children:[(0,f.jsxs)("div",{className:"flex items-center mb-2",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-turbo-red mr-2"}),(0,f.jsx)("h3",{className:"text-lg font-black text-white group-hover:text-turbo-red transition-colors",children:t.name})]}),(0,f.jsx)("p",{className:"text-gray-500 text-xs mb-2",children:t.state}),(0,f.jsxs)("p",{className:"text-gray-400 text-sm",children:[t.venues.length," major venues"]}),(0,f.jsxs)("div",{className:"flex items-center text-turbo-red text-xs font-semibold mt-3",children:[(0,f.jsx)("span",{children:"View services"}),(0,f.jsx)(S.A,{className:"h-3 w-3 ml-1 group-hover:translate-x-1 transition-transform"})]})]})},e)})}),(0,f.jsx)("div",{className:"text-center",children:(0,f.jsx)(r.N_,{to:"/services",children:(0,f.jsx)("button",{className:"group px-8 py-4 bg-gradient-to-r from-turbo-red via-red-600 to-orange-500 hover:from-turbo-red hover:via-red-500 hover:to-orange-400 text-white font-bold rounded-2xl transition-all duration-300 shadow-2xl hover:shadow-turbo-red/50 transform hover:scale-105",children:(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)("span",{children:"VIEW ALL SERVICES"}),(0,f.jsx)(S.A,{className:"h-5 w-5 group-hover:translate-x-1 transition-transform"})]})})})})]})]}),(0,f.jsx)("section",{id:"about-services",className:"relative py-24 bg-gradient-to-b from-black to-gray-900",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,f.jsxs)("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsx)("h2",{className:"text-4xl md:text-5xl font-black text-white",children:"Professional Event Photography & Video Production Across Australia"}),(0,f.jsxs)("div",{className:"prose prose-lg prose-invert",children:[(0,f.jsx)("p",{className:"text-gray-300 text-lg leading-relaxed",children:"Turbo 360 is Australia's leading same-day event photography and video production company. With over 25 years of experience, we specialize in capturing high-quality content for conferences, corporate events, weddings, and exhibitions across Australia, New Zealand, and Singapore."}),(0,f.jsx)("p",{className:"text-gray-300 text-lg leading-relaxed",children:"Our team of professional photographers and videographers use cinema-grade equipment to deliver stunning results. What sets us apart is our unique same-day delivery service \u2013 your edited photos and videos can be in your hands within hours of your event, not weeks."}),(0,f.jsxs)("p",{className:"text-gray-300 text-lg leading-relaxed",children:["Whether you need ",(0,f.jsx)(r.N_,{to:"/services/conference-photography/sydney",className:"text-turbo-red hover:text-orange-400 transition-colors",children:"conference photography in Sydney"}),", wedding videography in Melbourne, ",(0,f.jsx)(r.N_,{to:"/services/corporate-event-photography/brisbane",className:"text-turbo-red hover:text-orange-400 transition-colors",children:"corporate event coverage in Brisbane"}),", or live streaming services anywhere in Australia, our nationwide network of experienced professionals ensures consistent, high-quality results every time."]})]}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-4 pt-4",children:[(0,f.jsx)(r.N_,{to:"/conferences",className:"text-turbo-red hover:text-white transition-colors font-semibold",children:"Conference Photography \u2192"}),(0,f.jsx)(r.N_,{to:"/business",className:"text-turbo-red hover:text-white transition-colors font-semibold",children:"Corporate Photography \u2192"}),(0,f.jsx)("a",{href:"https://weddings.turbo.net.au",className:"text-turbo-red hover:text-white transition-colors font-semibold",children:"Wedding Photography \u2192"}),(0,f.jsx)(r.N_,{to:"/schools",className:"text-turbo-red hover:text-white transition-colors font-semibold",children:"School Photography \u2192"})]}),(0,f.jsxs)("div",{cla
1ssName:"flex flex-wrap gap-4 pt-2",children:[(0,f.jsx)(r.N_,{to:"/services/conference-photography",className:"text-orange-400 hover:text-white transition-colors text-sm",children:"Conference Photographer by City \u2192"}),(0,f.jsx)(r.N_,{to:"/services/exhibition-photography",className:"text-orange-400 hover:text-white transition-colors text-sm",children:"Exhibition Photographer by City \u2192"}),(0,f.jsx)(r.N_,{to:"/services/corporate-event-photography",className:"text-orange-400 hover:text-white transition-colors text-sm",children:"Corporate Event Photography \u2192"}),(0,f.jsx)(r.N_,{to:"/services/corporate-headshots",className:"text-orange-400 hover:text-white transition-colors text-sm",children:"Corporate Headshots by City \u2192"}),(0,f.jsx)(r.N_,{to:"/services/event-coverage",className:"text-orange-400 hover:text-white transition-colors text-sm",children:"Event Coverage by City \u2192"})]}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-4 pt-2",children:[(0,f.jsx)(r.N_,{to:"/services/locations/sydney",className:"text-gray-400 hover:text-white transition-colors text-sm",children:"Sydney Services \u2192"}),(0,f.jsx)(r.N_,{to:"/services/locations/melbourne",className:"text-gray-400 hover:text-white transition-colors text-sm",children:"Melbourne Services \u2192"}),(0,f.jsx)(r.N_,{to:"/services/locations/brisbane",className:"text-gray-400 hover:text-white transition-colors text-sm",children:"Brisbane Services \u2192"}),(0,f.jsx)(r.N_,{to:"/services",className:"text-gray-400 hover:text-white transition-colors text-sm",children:"All Cities & Services \u2192"})]})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-6 text-center",children:[(0,f.jsx)("div",{className:"text-5xl font-black text-turbo-red mb-2",children:"25+"}),(0,f.jsx)("div",{className:"text-gray-300 font-medium",children:"Years Experience"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm mt-2",children:"Trusted by Fortune 500 companies"})]}),(0,f.jsxs)("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-6 text-center",children:[(0,f.jsx)("div",{className:"text-5xl font-black text-turbo-red mb-2",children:"24hr"}),(0,f.jsx)("div",{className:"text-gray-300 font-medium",children:"Same-Day Delivery"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm mt-2",children:"Edited content delivered fast"})]}),(0,f.jsxs)("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-6 text-center",children:[(0,f.jsx)("div",{className:"text-5xl font-black text-turbo-red mb-2",children:"180+"}),(0,f.jsx)("div",{className:"text-gray-300 font-medium",children:"5-Star Reviews"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm mt-2",children:"Consistently excellent service"})]}),(0,f.jsxs)("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-2xl p-6 text-center",children:[(0,f.jsx)("div",{className:"text-5xl font-black text-turbo-red mb-2",children:"3"}),(0,f.jsx)("div",{className:"text-gray-300 font-medium",children:"Countries Served"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm mt-2",children:"Australia, NZ & Singapore"})]})]})]})})}),(0,f.jsxs)("section",{id:"contact",className:"relative py-32 bg-black overflow-hidden",children:[(0,f.jsxs)("div",{className:"absolute inset-0",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-turbo-red/20 via-orange-500/10 to-transparent opacity-50"}),(0,f.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 2px 2px, rgba(239,68,68,0.15) 1px, transparent 0)",backgroundSize:"40px 40px"}})]}),(0,f.jsxs)("div",{className:"relative z-10 max-w-5xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,f.jsxs)("div",{className:"text-center mb-16",children:[(0,f.jsx)("div",{className:"inline-block mb-6 px-6 py-2 bg-turbo-red/10 border border-turbo-red/30 rounded-full",children:(0,f.jsx)("span",{className:"text-turbo-red font-bold text-sm tracking-wider",children:"LET'S CREATE TOGETHER"})}),(0,f.jsxs)("h2",{className:"text-5xl md:text-7xl font-black mb-8 leading-tight",children:[(0,f.jsx)("span",{className:"block bg-gradient-to-r from-white to-gray-300 bg-clip-text text-transparent",children:"Ready to Capture"}),(0,f.jsx)("span",{className:"block bg-gradient-to-r from-turbo-red via-orange-500 to-turbo-red bg-clip-text text-transparent",children:"The Moment?"})]}),(0,f.jsx)("p",{className:"text-xl md:text-2xl text-gray-300 mb-12 max-w-3xl mx-auto leading-relaxed",children:"From concept to delivery in 24 hours. Get your quote now and experience the Turbo 360 difference."}),(0,f.jsx)(r.N_,{to:"/get-quote",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:(0,f.jsxs)("button",{className:"group relative px-12 py-6 bg-gradient-to-r from-turbo-red via-red-600 to-orange-500 hover:from-turbo-red hover:via-red-500 hover:to-orange-400 text-white font-black text-xl rounded-2xl transition-all duration-300 shadow-2xl hover:shadow-turbo-red/50 transform hover:scale-105 overflow-hidden",children:[(0,f.jsxs)("div",{className:"relative z-10 flex items-center space-x-3",children:[(0,f.jsx)(F.A,{className:"h-6 w-6"}),(0,f.jsx)("span",{children:"GET YOUR QUOTE NOW"}),(0,f.jsx)(S.A,{className:"h-6 w-6 group-hover:translate-x-2 transition-transform duration-300"})]}),(0,f.jsx)("div",{className:"absolute inset-0 bg-white/20 opacity-0 group-hover:opacity-100 transition-opacity duration-300"})]})})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-3 gap-6",children:[(0,f.jsx)("a",{href:"tel:1300207446",className:"group",children:(0,f.jsx)("div",{className:"h-full bg-gradient-to-br from-gray-800/50 to-gray-900/50 backdrop-blur-sm border border-gray-700 hover:border-turbo-red rounded-2xl p-6 transition-all duration-300 hover:scale-105",children:(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsx)("div",{className:"w-12 h-12 rounded-xl bg-turbo-red/20 flex items-center justify-center group-hover:bg-turbo-red transition-colors duration-300",children:(0,f.jsx)(E.A,{className:"h-6 w-6 text-turbo-red group-hover:text-white transition-colors"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"font-bold text-turbo-red text-sm mb-1",children:"CALL NOW"}),(0,f.jsx)("p",{className:"text-white font-semibold",children:"1300 207 446"})]})]})})}),(0,f.jsx)("a",{href:"mailto:[email protected]",className:"group",children:(0,f.jsx)("div",{className:"h-full bg-gradient-to-br from-gray-800/50 to-gray-900/50 backdrop-blur-sm border border-gray-700 hover:border-turbo-red rounded-2xl p-6 transition-all duration-300 hover:scale-105",children:(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsx)("div",{className:"w-12 h-12 rounded-xl bg-turbo-red/20 flex items-center justify-center group-hover:bg-turbo-red transition-colors duration-300",children:(0,f.jsx)(T.A,{className:"h-6 w-6 text-turbo-red group-hover:text-white transition-colors"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"font-bold text-turbo-red text-sm mb-1",children:"EMAIL US"}),(0,f.jsx)("p",{className:"text-white font-semibold text-sm",children:"[email protected]"})]})]})})}),(0,f.jsx)("div",{className:"group",children:(0,f.jsx)("div",{className:"h-full bg-gradient-to-br from-gray-800/50 to-gray-900/50 backdrop-blur-sm border border-gray-700 hover:border-turbo-red rounded-2xl p-6 transition-all duration-300 hover:scale-105",children:(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsx)("div",{className:"w-12 h-12 rounded-xl bg-turbo-red/20 flex items-center justify-center group-hover:bg-turbo-red transition-colors duration-300",children:(0,f.jsx)(C.A,{className:"h-6 w-6 text-turbo-red group-hover:text-white transition-colors"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"font-bold text-turbo-red text-sm mb-1",children:"COVERAGE"}),(0,f.jsx)("p",{className:"text-white font-semibold text-sm",children:"AU \u2022 NZ \u2022 SG"})]})]})})})]})]})]}),(0,f.jsx)("section",{className:"py-12 bg-gray-950 border-t border-gray-800",children:(0,f.jsx)("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:(0,f.jsx)("p",{className:"text-gray-400 text-sm leading-relaxed",children:"Turbo 360 is Australia's leading same-day event photography and video production company with over 25 years of industry experience. We provide professional photography, videography, live streaming, and post-production services for conferences, exhibitions, corporate events, weddings, and schools across Australia, New Zealand, and Singapore. Our team of experienced photographers and videographers use cinema-grade equipment to capture every moment, delivering professionally edited content the same day your event takes place. Trusted by Fortune 500 companies and government organisations, we cover all eight Australian capital cities with consistent quality and rapid turnaround."})})}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})};var ht=s(65727),ut=s(94651),gt=s(49682);
1const ft=e=>{const t=e.replace(/-/g,"+").replace(/_/g,"/"),s="=".repeat((4-t.length%4)%4),a=atob(t+s),n=new Uint8Array(a.length);for(let r=0;r<a.length;r++)n[r]=a.charCodeAt(r);return n.buffer},bt=e=>{const t=new Uint8Array(e);let s="";for(let a=0;a<t.byteLength;a++)s+=String.fromCharCode(t[a]);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},yt="'Space Mono',monospace",vt="'Hanken Grotesk',-apple-system,sans-serif",jt=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)(""),[n,i]=(0,a.useState)(""),[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(!1),[p,x]=(0,a.useState)(!1),[h,u]=(0,a.useState)(""),[g,b]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(async()=>{if(window.PublicKeyCredential)try{const e=await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();b(e)}catch(e){b(!1)}})()},[]);(0,a.useEffect)(()=>{const t=localStorage.getItem("turbo360_admin_auth");if(t)try{const s=JSON.parse(t);if(new Date<new Date(s.expires))return void e("/admin");localStorage.removeItem("turbo360_admin_auth")}catch(s){localStorage.removeItem("turbo360_admin_auth")}},[e]);const y={position:"relative",marginBottom:14},v={display:"block",fontFamily:yt,fontSize:10,letterSpacing:"0.14em",textTransform:"uppercase",color:"#9A9AA0",marginBottom:7},j={width:"100%",background:"#1C1C1E",border:"1px solid #2A2A2E",borderRadius:9,padding:"12px 13px 12px 40px",color:"#fff",fontSize:14,fontFamily:vt,outline:"none"};return(0,f.jsxs)("div",{style:{minHeight:"100vh",background:"#0A0A0B",display:"flex",alignItems:"center",justifyContent:"center",padding:20,position:"relative",overflow:"hidden",fontFamily:vt},children:[(0,f.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg,#BF212F 0 33%,#F2A900 33% 66%,#0FA3A3 66% 100%)"}}),(0,f.jsx)("div",{style:{position:"absolute",top:"-10%",left:"50%",transform:"translateX(-50%)",width:520,height:320,background:"radial-gradient(circle, rgba(191,33,47,.18), transparent 70%)",pointerEvents:"none"}}),(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-40,bottom:-40,width:220,opacity:.04,pointerEvents:"none"}}),(0,f.jsxs)("div",{style:{width:"100%",maxWidth:384,position:"relative",zIndex:1},children:[(0,f.jsx)("div",{style:{display:"flex",justifyContent:"center",marginBottom:22},children:(0,f.jsx)("img",{src:"/admin-assets/turbo-logo-dark.png",alt:"Turbo 360",style:{height:30,width:"auto"}})}),(0,f.jsxs)("div",{style:{background:"#141416",border:"1px solid #26262B",borderRadius:16,padding:"32px 30px",boxShadow:"0 30px 80px rgba(0,0,0,.5)"},children:[(0,f.jsx)("div",{style:{fontFamily:yt,fontSize:10,letterSpacing:"0.22em",color:"#F2A900",textAlign:"center",marginBottom:10},children:"ADMIN PORTAL \xb7 SIGN IN"}),(0,f.jsx)("h1",{className:"tg-display",style:{fontFamily:"'Archivo Expanded',sans-serif",fontWeight:800,fontSize:22,color:"#fff",textAlign:"center",margin:"0 0 6px",letterSpacing:"-0.01em"},children:"Welcome back"}),(0,f.jsx)("p",{style:{color:"#7A7A82",fontSize:13,textAlign:"center",margin:"0 0 22px"},children:"Sign in to the Turbo 360 cockpit"}),h&&(0,f.jsx)("div",{style:{marginBottom:16,padding:"11px 14px",background:"rgba(191,33,47,.12)",border:"1px solid rgba(191,33,47,.32)",borderRadius:9},children:(0,f.jsx)("p",{style:{color:"#F87171",fontSize:13,margin:0},children:h})}),(0,f.jsxs)("form",{onSubmit:async s=>{s.preventDefault(),u(""),d(!0);try{const s=await fetch("".concat(I.fn,"/api/wedding-admin/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:n})}),r=await s.json();var a;if(s.ok&&r.token)localStorage.setItem("turbo360_admin_auth",JSON.stringify({token:r.token,email:(null===(a=r.user)||void 0===a?void 0:a.email)||t,loginTime:(new Date).toISOString(),expires:new Date(Date.now()+6048e5).toISOString()})),e("/admin");else u(r.detail||"Invalid credentials")}catch(h){console.error("Login error:",h),u("Connection error. Please try again.")}finally{d(!1)}},children:[(0,f.jsxs)("div",{style:y,children:[(0,f.jsx)("label",{style:v,children:"Email"}),(0,f.jsx)(T.A,{size:16,color:"#7A7A82",style:{position:"absolute",left:13,top:38}}),(0,f.jsx)("input",{type:"email",value:t,onChange:e=>s(e.target.value),placeholder:"[email protected]",required:!0,style:j,onFocus:e=>e.target.style.borderColor="#BF212F",onBlur:e=>e.target.style.borderColor="#2A2A2E"})]}),(0,f.jsxs)("div",{style:y,children:[(0,f.jsx)("label",{style:v,children:"Password"}),(0,f.jsx)(ht.A,{size:16,color:"#7A7A82",style:{position:"absolute",left:13,top:38}}),(0,f.jsx)("input",{type:o?"text":"password",value:n,onChange:e=>i(e.target.value),placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022",required:!0,style:(0,m.A)((0,m.A)({},j),{},{paddingRight:42}),onFocus:e=>e.target.style.borderColor="#BF212F",onBlur:e=>e.target.style.borderColor="#2A2A2E"}),(0,f.jsx)("button",{type:"button",onClick:()=>l(e=>!e),tabIndex:-1,style:{position:"absolute",right:11,top:33,background:"none",border:0,color:"#7A7A82",cursor:"pointer",display:"flex",padding:3},children:o?(0,f.jsx)(ut.A,{size:16}):(0,f.jsx)(_.A,{size:16})})]}),(0,f.jsx)("button",{type:"submit",disabled:c||p,className:"tg-btn-primary",style:{width:"100%",marginTop:6,background:"#BF212F",color:"#fff",border:0,borderRadius:9,padding:"12px",fontFamily:vt,fontWeight:600,fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8,opacity:c||p?.6:1},children:c?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{style:{width:15,height:15,border:"2px s
1olid rgba(255,255,255,.4)",borderTopColor:"#fff",borderRadius:"50%",display:"inline-block",animation:"tg-spin 0.7s linear infinite"}})," Signing in\u2026"]}):(0,f.jsxs)(f.Fragment,{children:["Sign In ",(0,f.jsx)(S.A,{size:16})]})})]}),g&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{margin:"18px 0",display:"flex",alignItems:"center",gap:12},children:[(0,f.jsx)("div",{style:{flex:1,height:1,background:"#26262B"}}),(0,f.jsx)("span",{style:{color:"#55555C",fontSize:11,fontFamily:yt},children:"OR"}),(0,f.jsx)("div",{style:{flex:1,height:1,background:"#26262B"}})]}),(0,f.jsx)("button",{onClick:async()=>{u(""),x(!0);try{const a=await fetch("".concat(I.fn,"/api/wedding-admin/passkey/auth-options"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t||null})});if(!a.ok){const e=await a.json();throw new Error(e.detail||"Failed to get authentication options")}const n=await a.json();n.challenge=ft(n.challenge),n.allowCredentials&&(n.allowCredentials=n.allowCredentials.map(e=>(0,m.A)((0,m.A)({},e),{},{id:ft(e.id)})));const r=await navigator.credentials.get({publicKey:n}),i={id:r.id,rawId:bt(r.rawId),type:r.type,response:{authenticatorData:bt(r.response.authenticatorData),clientDataJSON:bt(r.response.clientDataJSON),signature:bt(r.response.signature),userHandle:r.response.userHandle?bt(r.response.userHandle):null}},o=await fetch("".concat(I.fn,"/api/wedding-admin/passkey/auth-verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({credential:i})}),l=await o.json();var s;if(o.ok&&l.token)localStorage.setItem("turbo360_admin_auth",JSON.stringify({token:l.token,email:null===(s=l.user)||void 0===s?void 0:s.email,loginTime:(new Date).toISOString(),expires:new Date(Date.now()+6048e5).toISOString()})),e("/admin");else u(l.detail||l.message||"Passkey authentication failed")}catch(h){console.error("Passkey login error:",h),u("NotAllowedError"===h.name?"Passkey authentication was cancelled or timed out":h.message||"Passkey authentication failed")}finally{x(!1)}},disabled:c||p,style:{width:"100%",background:"#1C1C1E",border:"1px solid #2A2A2E",color:"#fff",borderRadius:9,padding:"12px",fontFamily:vt,fontWeight:500,fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:8,opacity:c||p?.6:1},children:p?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{style:{width:15,height:15,border:"2px solid rgba(255,255,255,.4)",borderTopColor:"#fff",borderRadius:"50%",display:"inline-block",animation:"tg-spin 0.7s linear infinite"}})," Authenticating\u2026"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(gt.A,{size:16,color:"#9A9AA0"})," Sign in with Passkey"]})})]})]}),(0,f.jsxs)("p",{style:{textAlign:"center",marginTop:22,fontFamily:yt,fontSize:10.5,letterSpacing:"0.1em",color:"#55555C"},children:["TURBO 360 \xa9 ",(new Date).getFullYear()," \xb7 SESSION EXPIRES IN 7 DAYS"]})]}),(0,f.jsx)("style",{children:"@keyframes tg-spin { to { transform: rotate(360deg); } }"})]})};var wt=s(87260),Nt=s(75088),At=s(73062),kt=s(41680);const St=()=>{const e=(0,r.Zp)(),t=[{icon:wt.A,title:"Live Quote Calculator",description:"See pricing in real-time as you build your perfect package"},{icon:Nt.A,title:"Same-Day Pricing",description:"Rush options and same-day delivery add-ons available"},{icon:At.A,title:"Transparent Pricing",description:"No hidden fees - see exactly what you're paying for"},{icon:kt.A,title:"Instant PDF Quote",description:"Download your detailed quote immediately after submission"}],s=[{icon:Ge.A,title:"Videography",services:["B-Roll Coverage","Full Presentations","Multi-Camera","Live Streaming"],color:"bg-turbo-red"},{icon:Ue.A,title:"Photography",services:["Event Photography","Headshots","Instant Photo Drops"],color:"bg-orange-500"},{icon:Je.A,title:"Post-Production",services:["Highlight Reels","Social Media Packs","Full Edits"],color:"bg-blue-600"},{icon:Xe.A,title:"Extra Crew & Add-ons",services:["Additional Operators","Travel Coverage","Same-Day Delivery"],color:"bg-purple-600"}];return(0,f.jsxs)("div",{className:"min-h-screen bg-dark-bg text-white",children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"Event Photography & Video Packages | Turbo 360"}),(0,f.jsx)("meta",{name:"description",content:"Build your event photography & video package with live pricing and instant quotes. Same-day delivery for conferences, exhibitions & corporate events."}),(0,f.jsx)("meta",{name:"keywords",content:"custom event packages, live quote calculator, event photography packages, video production packages, same day delivery, overtime coverage, conference packages, exhibition packages, corporate event packages, instant quotes Australia"}),(0,f.jsx)("link",{rel:"canonical",href:"https://turbo.net.au/packages"}),(0,f.jsx)("meta",{property:"og:title",content:"Custom Event Photography & Video Packages | Live Quote Calculator"}),(0,f.jsx)("meta",{property:"og:description",content:"Build custom event photography and videography packages with live pricing calculator and same-day delivery options."}),(0,f.jsx)("meta",{property:"og:type",content:"website"}),(0,f.jsx)("meta",{property:"og:url",content:"https://turbo.net.au/packages"}),(0,f.jsx)("meta",{property:"og:image",content:"https://turbo.net.au/hero-background.jpg"}),(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("meta",{name:"twitter:title",content:"Custom Event Photography & Video Packages"}),(0,f.jsx)("meta",{name:"twitter:description",content:"Build custom packages with live pricing calculator and same-day delivery options."}),(0,f.jsx)("meta",{name:"twitter:image",content:"https://turbo.net.au/hero-background.jpg"})]}),(0,f.jsx)("div",{className:"bg-black/80 border-b border-gray-800",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("button",{onClick:()=>e("/"),className:"flex items-center space-x-2 text-gray-300 hover:text-white transition-colors",children:[(0,f.jsx)("img",{src:"/turbo-logo-new.png",alt:"Turbo 360 Logo",className:"h-8 w-auto"}),(0,f.jsx)("span",{className:"text-sm",children:"\u2190 Back to Home"})]}),(0,f.jsx)("div",{className:"text-sm text-gray-400",children:"Build Your Custom Package"})]})})}),(0,f.jsx)("section",{className:"py-20 px-4 sm:px-6 lg:px-8",children:(0,f.jsxs)("div",{className:"max-w-4xl mx-auto text-center",children:[(0,f.jsx)("h1",{className:"text-5xl md:text-7xl font-black mb-6 glitch-text","data-text":"BUILD YOUR PACKAGE",children:"BUILD YOUR PACKAGE"}),(0,f.jsx)("p",{className:"text-xl md:text-2xl text-gray-300 mb-8 max-w-3xl mx-auto",children:"Create a custom photography and videography package tailored to your event. Get instant pricing and submit your request in minutes."}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 justify-center mb-12",children:[(0,f.jsxs)(it.$,{onClick:()=>e("/packages/build"),className:"btn-turbo-primary motion-glow text-lg px-8 py-4 h-12 min-w-[200px]",children:["Start Building",(0,f.jsx)(S.A,{className:"ml-2 h-5 w-5"})]}),(0,f.jsx)(it.$,{onClick:()=>e("/customer/auth"),className:"btn-turbo-secondary text-lg px-8 py-4 h-12 min-w-[200px]",children:"Customer Login"})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6 mb-16",children:[(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"text-3xl font-black text-turbo-red mb-2",children:"5 Min"}),(0,f.jsx)("div",{className:"text-gray-400 text-sm",children:"Build Time"})]}),(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"text-3xl font-black text-turbo-red mb-2",children:"Instant"}),(0,f.jsx)("div",{className:"text-gray-400 text-sm",children:"Quote"})]}),(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"text-3xl font-black text-turbo-red mb-2",children:"24/7"}),(0,f.jsx)("div",{className:"text-gray-400 text-sm",children:"Availability"})]}),(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"text-3xl font-black text-turbo-red mb-2",children:"Same Day"}),(0,f.jsx)("div",{className:"text-gray-400 text-sm",children:"Delivery"})]})]})]})}),(0,f.jsx)("section",{className:"py-16 px-4 sm:px-6 lg:px-8 bg-gray-950",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)("h2",{className:"text-4xl font-black text-center mb-12 text-white",children:"Why Use Our Package Builder?"}),(0,f.jsx)("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-8",children:t.map((e,t)=>(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800 hover:border-turbo-red transition-all duration-300",children:(0,f.jsxs)(rt.Wu,{className:"p-6 text-center",children:[(0,f.jsx)("div",{className:"w-16 h-16 bg-turbo-red rounded-full flex items-center justify-center mx-auto mb-4",children:(0,f.jsx)(e.icon,{className:"h-8 w-8 text-white"})}),(0,f.jsx)("h3",{className:"text-xl font-bold mb-3 text-white",children:e.title}),(0,f.jsx)("p",{className:"text-gray-400",children:e.description})]})},t))})]})}),(0,f.jsx)("section",{className:"py-16 px-4 sm:px-6 lg:px-8",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)("h2",{className:"text-4xl font-black text-center mb-12 text-white",children:"Available Services"}),(0,f.jsx)("div",{className:"grid md:grid-cols-2 gap-8",children:s.map((e,t)=>(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800 hover:border-turbo-red transition-all duration-300",children:(0,f.jsxs)(rt.Wu,{className:"p-8",children:[(0,f.jsxs)("div",{className:"flex items-center mb-6",children:[(0,f.jsx)("div",{className:"w-12 h-12 ".concat(e.color," rounded-lg flex items-center justify-center mr-4"),children:(0,f.jsx)(e.icon,{className:"h-6 w-6 text-white"})}),(0,f.jsx)("h3",{className:"text-2xl font-bold text-white",children:e.title})]}),(0,f.jsx)("div",{className:"space-y-2",children:e.services.map((e,t)=>(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(F.A,{className:"h-4 w-4 mr-2 text-turbo-red"}),(0,f.jsx)("span",{className:"text-gray-300",children:e})]},t))})]})},t))})]})}),(0,f.jsx)("section",{className:"py-20 px-4 sm:px-6 lg:px-8 bg-gradient-to-r from-turbo-red to-orange-600",children:(0,f.jsxs)("div",{className:"max-w-4xl mx-auto text-center",children:[(0,f.jsx)("h2",{className:"text-4xl md:text-5xl font-black mb-6 text-white",children:"Ready to Get Started?"}),(0,f.jsx)("p",{className:"text-xl text-white/90 mb-8 max-w-2xl mx-auto",children:"Build your custom package now and get an instant quote. No obligations, no hidden fees - just transparent pricing."}),(0,f.jsxs)(it.$,{onClick:()=>e("/packages/build"),className:"bg-white text-turbo-red hover:bg-gray-100 text-xl px-12 py-6 font-bold shadow-lg hover:shadow-xl transition-all duration-300",children:[(0,f.jsx)(wt.A,{className:"mr-3 h-6 w-6"}),"Build My Package Now",(0,f.jsx)(S.A,{className:"ml-3 h-6 w-6"})]})]})}),(0,f.jsx)("footer",{className:"bg-black py-8 border-t border-gray-800",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"\xa9 2026 Turbo 360. Professional event photography and video production."}),(0,f.jsx)("p",{className:"text-gray-500 text-xs mt-2",children:"Need help? Call us at 1300 207 446 or email [email protected]"}),(0,f.jsxs)("div",{className:"mt-4 flex justify-center space-x-6",children:[(0,f.jsx)("button",{onClick:()=>e("/customer/auth"),className:"text-xs text-gray-600 hover:text-turbo-red transition-colors duration-300",children:"Customer Login"}),(0,f.jsx)("button",{onClick:()=>e("/admin/packages"),className:"text-xs text-gray-600 hover:text-turbo-red transition-colors duration-300",children:"Admin Login"})]})]})})]})};var _t=s(28646),Ct=s(65469),Ft=(s(25015),s(76088)),Et=s(92382),Tt=s(15711),zt=s(36210);const Bt=["className","children"],Dt=["className"],It=["className"],Rt=["className","children","position"],Pt
1=["className"],Wt=["className","children"],Ot=["className"];Ft.bL,Ft.YJ,Ft.WT;a.forwardRef((e,t)=>{let{className:s,children:a}=e,n=(0,ot.A)(e,Bt);return(0,f.jsxs)(Ft.l9,(0,m.A)((0,m.A)({ref:t,className:(0,ct.cn)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s)},n),{},{children:[a,(0,f.jsx)(Ft.In,{asChild:!0,children:(0,f.jsx)(Et.A,{className:"h-4 w-4 opacity-50"})})]}))}).displayName=Ft.l9.displayName;const Lt=a.forwardRef((e,t)=>{let{className:s}=e,a=(0,ot.A)(e,Dt);return(0,f.jsx)(Ft.PP,(0,m.A)((0,m.A)({ref:t,className:(0,ct.cn)("flex cursor-default items-center justify-center py-1",s)},a),{},{children:(0,f.jsx)(Tt.A,{className:"h-4 w-4"})}))});Lt.displayName=Ft.PP.displayName;const Mt=a.forwardRef((e,t)=>{let{className:s}=e,a=(0,ot.A)(e,It);return(0,f.jsx)(Ft.wn,(0,m.A)((0,m.A)({ref:t,className:(0,ct.cn)("flex cursor-default items-center justify-center py-1",s)},a),{},{children:(0,f.jsx)(Et.A,{className:"h-4 w-4"})}))});Mt.displayName=Ft.wn.displayName;a.forwardRef((e,t)=>{let{className:s,children:a,position:n="popper"}=e,r=(0,ot.A)(e,Rt);return(0,f.jsx)(Ft.ZL,{children:(0,f.jsxs)(Ft.UC,(0,m.A)((0,m.A)({ref:t,className:(0,ct.cn)("relative z-[70] max-h-[200px] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-gray-900 text-white shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin] border-gray-700","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n},r),{},{children:[(0,f.jsx)(Lt,{}),(0,f.jsx)(Ft.LM,{className:(0,ct.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),(0,f.jsx)(Mt,{})]}))})}).displayName=Ft.UC.displayName;a.forwardRef((e,t)=>{let{className:s}=e,a=(0,ot.A)(e,Pt);return(0,f.jsx)(Ft.JU,(0,m.A)({ref:t,className:(0,ct.cn)("px-2 py-1.5 text-sm font-semibold",s)},a))}).displayName=Ft.JU.displayName;a.forwardRef((e,t)=>{let{className:s,children:a}=e,n=(0,ot.A)(e,Wt);return(0,f.jsxs)(Ft.q7,(0,m.A)((0,m.A)({ref:t,className:(0,ct.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-gray-800 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50 text-white hover:bg-gray-800",s)},n),{},{children:[(0,f.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,f.jsx)(Ft.VF,{children:(0,f.jsx)(zt.A,{className:"h-4 w-4 text-white"})})}),(0,f.jsx)(Ft.p4,{children:a})]}))}).displayName=Ft.q7.displayName;a.forwardRef((e,t)=>{let{className:s}=e,a=(0,ot.A)(e,Ot);return(0,f.jsx)(Ft.wv,(0,m.A)({ref:t,className:(0,ct.cn)("-mx-1 my-1 h-px bg-muted",s)},a))}).displayName=Ft.wv.displayName;const qt=["className","type"],Ht=a.forwardRef((e,t)=>{let{className:s,type:a}=e,n=(0,ot.A)(e,qt);return(0,f.jsx)("input",(0,m.A)({type:a,className:(0,ct.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:t},n))});Ht.displayName="Input";var Ut=s(59938);const Gt=["className"],Vt=a.forwardRef((e,t)=>{let{className:s}=e,a=(0,ot.A)(e,Gt);return(0,f.jsx)("textarea",(0,m.A)({className:(0,ct.cn)("flex min-h-[60
1px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:t},a))});Vt.displayName="Textarea";s(65005);const Jt=["className","variant"],Yt=["className"],Kt=["className"],Zt=(0,lt.F)("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),$t=a.forwardRef((e,t)=>{let{className:s,variant:a}=e,n=(0,ot.A)(e,Jt);return(0,f.jsx)("div",(0,m.A)({ref:t,role:"alert",className:(0,ct.cn)(Zt({variant:a}),s)},n))});$t.displayName="Alert";a.forwardRef((e,t)=>{let{className:s}=e,a=(0,ot.A)(e,Yt);return(0,f.jsx)("h5",(0,m.A)({ref:t,className:(0,ct.cn)("mb-1 font-medium leading-none tracking-tight",s)},a))}).displayName="AlertTitle";const Qt=a.forwardRef((e,t)=>{let{className:s}=e,a=(0,ot.A)(e,Kt);return(0,f.jsx)("div",(0,m.A)({ref:t,className:(0,ct.cn)("text-sm [&_p]:leading-relaxed",s)},a))});Qt.displayName="AlertDescription";const Xt=()=>{var e;const t=(0,r.Zp)(),[s,n]=(0,a.useState)(1),[i,o]=(0,a.useState)({eventName:"",eventDate:"",startTime:"",endTime:"",venue:"",attendees:"",selectedServices:[],selectedAddons:[],extraCrew:[],travelKms:"",accommodationRequired:!1,quote:null,promoCode:"",clientName:"",company:"",email:"",phone:""}),[l,c]=(0,a.useState)({items:[],subtotal_ex:0,surcharges_breakdown:[],gst:0,total_inc:0,warnings:[],coverage_hours:0}),[d,x]=(0,a.useState)([]),[g,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)({}),j=[{id:1,title:"Event Details",description:"Basic event information"},{id:2,title:"Services",description:"Choose your coverage options"},{id:3,title:"Add-ons",description:"Extra features and logistics"},{id:4,title:"Review",description:"Review your quote"},{id:5,title:"Submit",description:"Client details and submission"}];(0,a.useEffect)(()=>{(async()=>{try{const e=await fetch("".concat(I.fn,"/api/admin/packages/items"));if(e.ok){const t=await e.json();x(t)}}catch(e){console.error("Error fetching items:",e)}})()},[]),(0,a.useEffect)(()=>{d.length>0&&w()},[i.selectedServices,i.selectedAddons,i.extraCrew,i.eventDate,i.startTime,i.endTime,d]),(0,a.useEffect)(()=>{s>=2&&i.eventDate&&i.startTime&&i.endTime&&i.venue&&i.attendees&&w()},[i.selectedServices,i.selectedAddons,i.extraCrew,s]);const w=async()=>{try{const e=[...i.selectedServices,...i.selectedAddons,...i.extraCrew];if(0===e.length)return void c({items:[],subtotal_ex:0,surcharges_breakdown:[],gst:0,total_inc:0,warnings:[],coverage_hours:0});const t=await fetch("".concat(I.fn,"/api/quote/calc"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event_name:i.eventName||"Event",event_date:i.eventDate,start_time:i.startTime||null,end_time:i.endTime||null,venue:i.venue,attendees:i.attendees?parseInt(i.attendees):null,selections:e,rush:i.selectedAddons.some(e=>{var t;return"RUSH"===(null===(t=d.find(t=>t.id===e.item_id))||void 0===t?void 0:t.code)})})});if(t.ok){const e=await t.json();c(e)}}catch(e){console.error("Error calculating quote:",e)}},N=(e,t)=>{o(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t}))},A=e=>{const t={};switch(e){case 1:if(i.eventName||(t.eventName="Event name is required"),i.eventDate||(t.eventDate="Event date is required"),i.venue||(t.venue="Venue is required"),i.startTime&&i.endTime){new Date("2000-01-01T".concat(i.startTime))>=new Date("2000-01-01T".concat(i.endTime))&&(t.endTime="End time must be after start time")}break;case 2:0===i.selectedServices.length&&(t.services="Please select at least one service");break;case 5:i.clientName||(t.clientName="Your name is required"),i.email||(t.email="Email is required"),i.phone||(t.phone="Phone number is required")}return v(t),0===Object.keys(t).length},k=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const s=i.selectedServices.findIndex(t=>t.item_id===e.id);if(s>=0){const e=[...i.selectedServices];e.splice(s,1),N("selectedServices",e)}else N("selectedServices",[...i.selectedServices,{item_id:e.id,qty:t}])},_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const s=i.selectedAddons.findIndex(t=>t.item_id===e.id);if(s>=0){const e=[...i.selectedAddons];e.splice(s,1),N("selectedAddons",e)}else N("selectedAddons",[...i.selectedAddons,{item_id:e.id,qty:t}])};return(0,f.jsxs)("div",{className:"min-h-screen bg-dark-bg text-white",children:[(0,f.jsx)("div",{className:"bg-black/80 border-b border-gray-800",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("button",{onClick:()=>t("/packages"),className:"flex items-center space-x-2 text-gray-300 hover:text-white transition-colors",children:[(0,f.jsx)(Ct.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"text-sm",children:"Back to Packages"})]}),(0,f.jsxs)("div",{className:"text-sm text-gray-400",children:["Step ",s," of ",j.length]})]})})}),(0,f.jsx)("div",{className:"bg-gray-900 py-4",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,f.jsx)("div",{className:"flex items-center justify-between mb-4",children:j.map((e,t)=>(0,f.jsxs)("div",{className:"flex-1 relative",children:[(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)("div",{className:"\n flex items-center justify-center w-8 h-8 rounded-full text-sm font-bold\n ".concat(s>=e.id?"bg-turbo-red text-white":"bg-gray-700 text-gray-400","\n "),children:e.id}),t<j.length-1&&(0,f.jsx)("div",{className:"\n flex-1 h-1 mx-2\n ".concat(s>e.id?"bg-turbo-red":"bg-gray-700","\n ")})]}),(0,f.jsxs)("div",{className:"mt-2",children:[(0,f.jsx)("div",{className:"text-sm font-medium ".concat(s>=e.id?"text-white":"text-gray-400"),children:e.title}),(0,f.jsx)("div",{className:"text-xs text-gray-500",children:e.description})]})]},e.id))})})}),(0,f.jsx)("div",{className:"flex-1 py-8",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4",children:(0,f.jsxs)("div",{className:"grid lg:grid-cols-4 gap-8",children:[(0,f.jsx)("div",{className:"lg:col-span-3",children:(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800",children:(0,f.jsxs)(rt.Wu,{className:"p-8",children:[(0,f.jsx)("h1",{className:"text-3xl font-bold mb-6 text-white",children:null===(e=j[s-1])||void 0===e?void 0:e.title}),(()=>{switch(s){case 1:return(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Ut.J,{htmlFor:"eventName",children:"Event Name *"}),(0,f.jsx)(Ht,{id:"eventName",placeholder:"e.g., Annual Tech Conference 2025",value:i.eventName,onChange:e=>N("eventName",e.target.value),className:"bg-gray-900 border-gray-700 text-white ".concat(y.eventName?"border-red-500":"")}
1),y.eventName&&(0,f.jsx)("p",{className:"text-red-400 text-sm",children:y.eventName})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Ut.J,{htmlFor:"eventDate",children:"Event Date *"}),(0,f.jsx)(Ht,{id:"eventDate",type:"date",value:i.eventDate,onChange:e=>N("eventDate",e.target.value),className:"bg-gray-900 border-gray-700 text-white ".concat(y.eventDate?"border-red-500":"")}),y.eventDate&&(0,f.jsx)("p",{className:"text-red-400 text-sm",children:y.eventDate})]})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-300",children:["Start Time ",(0,f.jsx)("span",{className:"text-gray-500 text-xs",children:"(optional)"})]}),(0,f.jsx)(Ht,{id:"startTime",type:"time",value:i.startTime,onChange:e=>N("startTime",e.target.value),className:"bg-gray-900 border-gray-700 text-white ".concat(y.startTime?"border-red-500":""),placeholder:"Select start time"}),y.startTime&&(0,f.jsx)("p",{className:"text-red-400 text-sm",children:y.startTime})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-300",children:["End Time ",(0,f.jsx)("span",{className:"text-gray-500 text-xs",children:"(optional)"})]}),(0,f.jsx)(Ht,{id:"endTime",type:"time",value:i.endTime,onChange:e=>N("endTime",e.target.value),className:"bg-gray-900 border-gray-700 text-white ".concat(y.endTime?"border-red-500":""),placeholder:"Select end time"}),y.endTime&&(0,f.jsx)("p",{className:"text-red-400 text-sm",children:y.endTime})]})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Ut.J,{htmlFor:"venue",children:"Venue/Location *"}),(0,f.jsx)(Ht,{id:"venue",placeholder:"e.g., Sydney Convention Centre, Sydney NSW",value:i.venue,onChange:e=>N("venue",e.target.value),className:"bg-gray-900 border-gray-700 text-white ".concat(y.venue?"border-red-500":"")}),y.venue&&(0,f.jsx)("p",{className:"text-red-400 text-sm",children:y.venue})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-300",children:["Expected Attendees ",(0,f.jsx)("span",{className:"text-gray-500 text-xs",children:"(optional)"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Ht,{id:"attendees",type:"number",placeholder:"e.g., 150 (helps us prepare better)",value:i.attendees,onChange:e=>N("attendees",e.target.value),className:"bg-gray-900 border-gray-700 text-white pl-10 ".concat(y.attendees?"border-red-500":"")}),(0,f.jsx)(Xe.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-400"})]}),y.attendees&&(0,f.jsx)("p",{className:"text-red-400 text-sm",children:y.attendees})]}),i.startTime&&i.endTime&&(0,f.jsxs)($t,{className:"bg-gray-900 border-gray-700",children:[(0,f.jsx)(u.A,{className:"h-4 w-4 text-turbo-red"}),(0,f.jsxs)(Qt,{className:"text-gray-300",children:["Coverage Duration: ",Math.max(0,(new Date("2000-01-01T".concat(i.endTime,":00"))-new Date("2000-01-01T".concat(i.startTime,":00")))/36e5).toFixed(1)," hours",i.startTime<"07:00"||i.endTime>"22:00"?" \u2022 After-hours surcharge may apply":"",(new Date("2000-01-01T".concat(i.endTime,":00"))-new Date("2000-01-01T".concat(i.startTime,":00")))/36e5>8?" \u2022 Overtime rates apply for coverage over 8 hours":""]})]}),(!i.startTime||!i.endTime)&&(0,f.jsxs)($t,{className:"bg-blue-900/20 border-blue-700",children:[(0,f.jsx)(u.A,{className:"h-4 w-4 text-blue-400"}),(0,f.jsxs)(Qt,{className:"text-blue-300",children:["\ud83d\udca1 ",(0,f.jsx)("strong",{children:"Pro tip:"})," Adding start and end times helps us provide more accurate quotes and show appropriate service options for your event duration."]})]})]});case 2:return(()=>{const e=d.filter(e=>"video"===e.category),t=d.filter(e=>"photo"===e.category),s=i.startTime&&i.endTime?Math.max(0,new Date("2000-01-01T".concat(i.endTime,":00"))-new Date("2000-01-01T".concat(i.startTime,":00")))/36e5:0,a=e=>e.filter(e=>s<=4?"half_day"===e.unit||"hour"===e.unit:"full_day"===e.unit||"hour"===e.unit),n=a(e),r=a(t),o=e=>{let{item:t,isSelected:s,onToggle:a}=e;return(0,f.jsx)("div",{className:"p-4 rounded-lg border-2 cursor-pointer transition-all duration-200 ".concat(s?"bg-turbo-red/10 border-turbo-red text-white":"bg-gray-900/50 border-gray-700 hover:border-gray-600 text-gray-300 hover:text-white"),onClick:()=>a(t),children:(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h4",{className:"font-semibold text-lg mb-1",children:t.label}),(0,f.jsx)("p",{className:"text-sm opacity-80 mb-2",children:t.description||"Professional service"}),(0,f.jsx)("div",{className:"flex items-center text-xs",children:(0,f.jsx)("span",{className:"px-2 py-1 rounded ".concat(s?"bg-turbo-red/20":"bg-gray-800"),children:"half_day"===t.unit?"\u22644 hours":"full_day"===t.unit?"\u22648 hours":"Flexible duration"})})]}),(0,f.jsxs)("div",{className:"text-right ml-4",children:[(0,f.jsxs)("div",{className:"text-2xl font-bold ".concat(s?"text-white":"text-turbo-red"),children:["$",t.base_price_ex]}),(0,f.jsx)("div",{className:"text-xs opacity-60",children:t.unit.replace("_"," ")})]})]})})};return(0,f.jsxs)("div",{className:"space-y-6",children:[y.services&&(0,f.jsxs)($t,{className:"bg-red-900/20 border-red-700",children:[(0,f.jsx)(h.A,{className:"h-4 w-4 text-red-400"}),(0,f.jsx)(Qt,{className:"text-red-300",children:y.services})]}),s>0&&(0,f.jsxs)($t,{className:"bg-blue-900/20 border-blue-700",children:[(0,f.jsx)(u.A,{className:"h-4 w-4 text-blue-400"}),(0,f.jsxs)(Qt,{className:"text-blue-300",children:[(0,f.jsxs)("strong",{children:["Event Duration: ",s," hours"]})," \u2022",s<=4?" Showing half-day options":s<=8?" Showing full-day options":" Overtime applies (".concat((s-8).toFixed(1),"h extra)")]})]}),n.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center mb-4",children:[(0,f.jsx)(Ge.A,{className:"h-5 w-5 text-turbo-red mr-2"}),(0,f.jsx)("h3",{className:"text-xl font-bold text-white",children:"Video Services"})]}),(0,f.jsx)("div",{className:"space-y-3",children:n.map(e=>{const t=i.selectedServices.some(t=>t.item_id===e.id);return(0,f.jsx)(o,{item:e,isSelected:t,onToggle:k},e.id)})})]}),r.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center mb-4",children:[(0,f.jsx)(Ue.A,{className:"h-5 w-5 text-orange-500 mr-2"}),(0,f.jsx)("h3",{className:"text-xl font-bold text-white",children:"Photography Services"})]}),(0,f.jsx)("div",{className:"space-y-3",children:r.map(e=>{const t=i.selectedServices.some(t=>t.item_id===e.id);return(0,f.jsx)(o,{item:e,isSelected:t,onToggle:k},e.id)})})]}),i.selectedServices.length>0&&(0,f.jsxs)($t,{className:"bg-green-900/20 border-green-700",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 text-green-400"}),(0,f.jsxs)(Qt,{className:"text-green-300",children:[(0,f.jsx)("strong",{children:"Selected:"})," ",i.selectedServices.length," service",i.selectedServices.length>
11?"s":""]})]})]})})();case 3:return(()=>{const e=d.filter(e=>"post_production"===e.category),t=d.filter(e=>"addon"===e.category),s=d.filter(e=>"crew"===e.category),a=i.selectedServices.map(e=>{const t=d.find(t=>t.id===e.item_id);return null===t||void 0===t?void 0:t.code}),n=e=>e.filter(e=>!e.dependencies||0===e.dependencies.length||e.dependencies.some(e=>a.includes(e))),r=[...n(t),...n(s)],o=e=>{let{item:t,isSelected:s,onToggle:a}=e;return(0,f.jsx)("div",{className:"p-4 rounded-lg border-2 cursor-pointer transition-all duration-200 ".concat(s?"bg-purple-600/10 border-purple-500 text-white":"bg-gray-900/50 border-gray-700 hover:border-gray-600 text-gray-300 hover:text-white"),onClick:()=>a(t),children:(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h4",{className:"font-semibold text-lg mb-1",children:t.label}),(0,f.jsx)("p",{className:"text-sm opacity-80 mb-2",children:t.description||"Professional enhancement"}),(0,f.jsx)("div",{className:"flex items-center text-xs",children:(0,f.jsx)("span",{className:"px-2 py-1 rounded ".concat(s?"bg-purple-600/20":"bg-gray-800"),children:"fixed"===t.unit?"One-time":"hour"===t.unit?"Per hour":"day"===t.unit?"Per day":"Service enhancement"})})]}),(0,f.jsxs)("div",{className:"text-right ml-4",children:[(0,f.jsxs)("div",{className:"text-2xl font-bold ".concat(s?"text-white":"text-purple-500"),children:["$",t.base_price_ex]}),(0,f.jsx)("div",{className:"text-xs opacity-60",children:t.unit})]})]})})};return(0,f.jsxs)("div",{className:"space-y-6",children:[e.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center mb-4",children:[(0,f.jsx)(Je.A,{className:"h-5 w-5 text-blue-500 mr-2"}),(0,f.jsx)("h3",{className:"text-xl font-bold text-white",children:"Post-Production"})]}),(0,f.jsx)("div",{className:"space-y-3",children:e.map(e=>{const t=i.selectedAddons.some(t=>t.item_id===e.id);return(0,f.jsx)(o,{item:e,isSelected:t,onToggle:_},e.id)})})]}),r.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center mb-4",children:[(0,f.jsx)(F.A,{className:"h-5 w-5 text-yellow-500 mr-2"}),(0,f.jsx)("h3",{className:"text-xl font-bold text-white",children:"Enhancements & Extras"})]}),(0,f.jsx)("p",{className:"text-gray-400 text-sm mb-4",children:"Premium features and additional services for your event"}),(0,f.jsx)("div",{className:"space-y-3",children:r.map(e=>{const t=i.selectedAddons.some(t=>t.item_id===e.id);return(0,f.jsx)(o,{item:e,isSelected:t,onToggle:_},e.id)})})]}),0===i.selectedServices.length&&(0,f.jsxs)($t,{className:"bg-blue-900/20 border-blue-700",children:[(0,f.jsx)(h.A,{className:"h-4 w-4 text-blue-400"}),(0,f.jsx)(Qt,{className:"text-blue-300",children:"Select some services in the previous step to see available add-ons and enhancements."})]}),i.selectedAddons.length>0&&(0,f.jsxs)($t,{className:"bg-green-900/20 border-green-700",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 text-green-400"}),(0,f.jsxs)(Qt,{className:"text-green-300",children:[(0,f.jsx)("strong",{children:"Added:"})," ",i.selectedAddons.length," enhancement",i.selectedAddons.length>1?"s":""]})]})]})})();case 4:return(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsxs)("div",{className:"text-center mb-8",children:[(0,f.jsx)("h2",{className:"text-3xl font-bold text-white mb-2",children:"Review Your Quote"}),(0,f.jsx)("p",{className:"text-gray-400",children:"Review your selections and pricing below"})]}),(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800",children:(0,f.jsxs)(rt.Wu,{className:"p-6",children:[(0,f.jsx)("h3",{className:"text-xl font-bold mb-4 text-white",children:"Event Summary"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(_t.A,{className:"h-5 w-5 text-turbo-red mr-3"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-semibold",children:i.eventName}),(0,f.jsxs)("div",{className:"text-gray-400 text-sm",children:[i.eventDate," \u2022 ",i.startTime," - ",i.endTime]})]})]}),(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(C.A,{className:"h-5 w-5 text-turbo-red mr-3"}),(0,f.jsx)("div",{className:"text-gray-300",children:i.venue})]}),(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(Xe.A,{className:"h-5 w-5 text-turbo-red mr-3"}),(0,f.jsxs)("div",{className:"text-gray-300",children:[i.attendees," attendees"]})]}),(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(Nt.A,{className:"h-5 w-5 text-turbo-red mr-3"}),(0,f.jsxs)("div",{className:"text-gray-300",children:[l.coverage_hours," hours coverage"]})]})]})]})}),(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800",children:(0,f.jsxs)(rt.Wu,{className:"p-6",children:[(0,f.jsx)("h3",{className:"text-xl font-bold mb-4 text-white",children:"Selected Services"}),l.items.length>0?(0,f.jsx)("div",{className:"space-y-3",children:l.items.map((e,t)=>(0,f.jsxs)("div",{className:"flex justify-between items-center py-2 border-b border-gray-700 last:border-b-0",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-medium text-white",children:e.label}),(0,f.jsxs)("div",{className:"text-gray-400 text-sm",children:[e.qty," \xd7 $",Number(e.unit_price_ex).toFixed(2)]})]}),(0,f.jsxs)("div",{className:"font-mono text-white",children:["$",Number(e.line_total_ex).toFixed(2)]})]},t))}):(0,f.jsx)("p",{className:"text-gray-400",children:"No services selected"})]})}),l.warnings.length>0&&(0,f.jsxs)($t,{children:[(0,f.jsx)(h.A,{className:"h-4 w-4"}),(0,f.jsxs)(Qt,{children:[(0,f.jsx)("strong",{children:"Important Notes:"}),(0,f.jsx)("ul",{className:"mt-2 list-disc list-inside",children:l.warnings.map((e,t)=>(0,f.jsx)("li",{children:e},t))})]})]}),(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800",children:(0,f.jsx)(rt.Wu,{className:"p-4",children:(0,f.jsxs)("div",{className:"flex space-x-4",children:[(0,f.jsx)(Ht,{placeholder:"Enter promo code",value:i.promoCode,onChange:e=>N("promoCode",e.target.value),className:"flex-1"}),(0,f.jsx)(it.$,{className:"btn-turbo-secondary",children:"Apply"})]})})})]});case 5:return(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsxs)("div",{className:"text-center mb-8",children:[(0,f.jsx)("h2",{className:"text-3xl font-bold text-white mb-2",children:"Almost Done!"}),(0,f.jsx)("p",{className:"text-gray-400",children:"Enter your details to submit your quote request"})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Ut.J,{htmlFor:"clientName",children:"Your Name *"}),(0,f.jsx)(Ht,{id:"clientName",placeholder:"e.g., John Smith",value:i.clientName,onChange:e=>N("clientName",e.target.value),className:y.clientName?"border-red-500":""}),y.clientName&&(0,f.jsx)("p",{className:"text-red-400 text-sm",children:y.clientName})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Ut.J,{htmlFor:"company",children:"Company (Optional)"}),(0,f.jsx)(Ht,{id:"company",placeholder:"e.g., ABC Corporation",value:i.company,onChange:e=>N("company",e.target.value)})]})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Ut.J,{htmlFor:"email",children:"Email Address *"}),(0,f.jsx)(Ht,{id:"email",type:"email",placeholder:"e.g., [email protected]",value:i.email,onChange:e=>N("email",e.target.value),className:y.email?"border-red-500":""}),y.email&&(0,f.jsx)("p",{className:"text-red-400 text-sm",children:y.email})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Ut.J,{htmlFor:"phone",children:"Phone Number *"}),(0,f.jsx)(Ht,{id:"phone",type:"tel",placeholder:"e.g., 0412 345 678",value:i.phone,onChange:e=>N("phone",e.target.value),className:y.phone?"border-red-500":""}),y.phone&&(0,f.jsx)("p",{className:"text-red-400 text-sm",children:y.phone})]})]}),(0,f.jsxs)($t,{children:[(0,f.jsx)(u.A,{className:"h-4 w-4"}),(0,f.jsxs)(Qt,{children:["By submitting this request, you'll receive:",(0,f.jsxs)("ul",{className:"mt-2 list-disc list-inside",children:[(0,f.jsx)("li",{children:"A detailed PDF quote via email"}),(0,f.jsx)("li",{children:"Response from our team within 2 hours"}),(0,f.jsx)("li",{children:"Option to accept, modify, or discuss the quote"})]})]})]})]});default:return null}})(),(0,f.jsxs)("div",{className:"flex justify-between pt-8 border-t border-gray-700 mt-8",children:[(0,f.jsxs)(it.$,{onClick:()=>{s>1&&n(s-1)},disabled:1===s,className:"btn-turbo-secondary",children:[(0,f.jsx)(Ct.A,{className:"mr-2 h-4 w-4"}),"Previous"]}),s===j.length?(0,f.jsxs)(it.$,{onClick:async()=>
1{if(A(5)){b(!0);try{const e=[...i.selectedServices,...i.selectedAddons,...i.extraCrew],s=await fetch("".concat(I.fn,"/api/quote/submit"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event_name:i.eventName,event_date:i.eventDate,start_time:i.startTime||null,end_time:i.endTime||null,venue:i.venue,attendees:i.attendees?parseInt(i.attendees):null,selections:e,rush:i.selectedAddons.some(e=>{var t;return"RUSH"===(null===(t=d.find(t=>t.id===e.item_id))||void 0===t?void 0:t.code)}),client_name:i.clientName,company:i.company||null,email:i.email,phone:i.phone})});if(!s.ok)throw new Error("Failed to submit quote");{const e=await s.json();t("/packages/quote/".concat(e.quote_id))}}catch(e){console.error("Error submitting quote:",e),alert("Error submitting quote. Please try again.")}finally{b(!1)}}},disabled:g,className:"btn-turbo-primary",children:[g?"Submitting...":"Submit Quote Request",(0,f.jsx)(S.A,{className:"ml-2 h-4 w-4"})]}):(0,f.jsxs)(it.$,{onClick:()=>{A(s)&&s<j.length&&n(s+1)},className:"btn-turbo-primary",children:["Next",(0,f.jsx)(S.A,{className:"ml-2 h-4 w-4"})]})]})]})})}),(0,f.jsx)("div",{className:"lg:col-span-1",children:(0,f.jsx)("div",{className:"sticky top-8",children:(0,f.jsx)(rt.Zp,{className:"bg-black/60 border-turbo-red",children:(0,f.jsxs)(rt.Wu,{className:"p-6",children:[(0,f.jsxs)("h3",{className:"text-xl font-bold mb-4 text-white flex items-center",children:[(0,f.jsx)(wt.A,{className:"mr-2 h-5 w-5"}),"Live Quote"]}),(0,f.jsx)("div",{className:"space-y-3 mb-6",children:l.items.length>0?l.items.map((e,t)=>(0,f.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,f.jsx)("span",{className:"text-gray-300 truncate pr-2",children:e.label}),(0,f.jsxs)("span",{className:"text-white font-mono",children:["$",Number(e.line_total_ex).toFixed(2)]})]},t)):(0,f.jsx)("div",{className:"text-sm text-gray-400",children:"No items selected yet"})}),(0,f.jsxs)("div",{className:"border-t border-gray-700 pt-4 space-y-2",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("span",{className:"text-gray-300",children:"Subtotal (ex-GST)"}),(0,f.jsxs)("span",{className:"text-white font-mono",children:["$",Number(l.subtotal_ex||0).toFixed(2)]})]}),l.surcharges_breakdown.map((e,t)=>(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("span",{className:"text-gray-300 text-sm",children:e.type}),(0,f.jsxs)("span",{className:"text-white font-mono text-sm",children:["$",Number(e.amount).toFixed(2)]})]},t)),(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("span",{className:"text-gray-300",children:"GST (10%)"}),(0,f.jsxs)("span",{className:"text-white font-mono",children:["$",Number(l.gst||0).toFixed(2)]})]}),(0,f.jsxs)("div",{className:"flex justify-between items-center text-lg font-bold border-t border-gray-700 pt-2",children:[(0,f.jsx)("span",{className:"text-white",children:"Total (inc-GST)"}),(0,f.jsxs)("span",{className:"text-turbo-red font-mono",children:["$",Number(l.total_inc||0).toFixed(2)]})]})]}),l.coverage_hours>0&&(0,f.jsxs)("div",{className:"mt-4 p-3 bg-gray-800 rounded-lg",children:[(0,f.jsx)("div",{className:"text-xs text-gray-400 mb-1",children:"Coverage Duration"}),(0,f.jsxs)("div",{className:"text-white font-semibold",children:[l.coverage_hours," hours"]})]}),(0,f.jsx)("div",{className:"mt-6 text-xs text-gray-500",children:"Prices are estimates. Final quote may vary based on specific requirements."})]})})})})]})})}),(0,f.jsx)("footer",{className:"bg-black py-6 border-t border-gray-800",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("p",{className:"text-gray-500 text-sm",children:"\xa9 2026 Turbo 360. Professional event coverage."}),(0,f.jsx)("button",{onClick:()=>t("/admin/packages"),className:"text-xs text-gray-600 hover:text-turbo-red transition-colors duration-300",children:"Admin Login"})]})})})]})};var es=s(7104);const ts=()=>{var e;const{quoteId:t}=(0,r.g)(),s=(0,r.Zp)(),[n,i]=(0,a.useState)(null),[o,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&(async()=>{try{const e=await fetch("".concat(I.fn,"/api/quote/").concat(t));if(!e.ok)throw new Error("Quote not found");const s=await e.json();i(s)}catch(e){d(e.message)}finally{l(!1)}})()},[t]);const m=async()=>{try{const e=await fetch("".concat(I.fn,"/api/quote/").concat(t,"/pdf"));if(e.ok){const s=await e.blob(),a=window.URL.createObjectURL(s),n=document.createElement("a");n.style.display="none",n.href=a,n.download="Turbo360_Quote_".concat(t.slice(-8).toUpperCase(),".pdf"),document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(a),document.body.removeChild(n)}else alert("Error downloading PDF. Please try again.")}catch(c){console.error("Error downloading PDF:",c),alert("Error downloading PDF. Please try again.")}},p=()=>{var e,s;window.location.href="mailto:[email protected]?subject=Accept Quote ".concat(null===t||void 0===t?void 0:t.slice(-8).toUpperCase()," - ").concat(null===n||void 0===n||null===(e=n.quote)||void 0===e?void 0:e.event_name,"&body=Hi Turbo 360 Team,%0A%0AI would like to accept the quote for ").concat(null===n||void 0===n||null===(s=n.quote)||void 0===s?void 0:s.event_name," and proceed with booking.%0A%0APlease send me the next steps.%0A%0AThank you!")};return o?(0,f.jsx)("div",{className:"min-h-screen bg-dark-bg text-white flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-turbo-red mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-400",children:"Loading quote..."})]})}):c?(0,f.jsx)("div",{className:"min-h-screen bg-dark-bg text-white flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("h1",{className:"text-4xl font-bold mb-4 text-turbo-red",children:"Quote Not Found"}),(0,f.jsx)("p",{className:"text-gray-400 mb-6",children:"The requested quote could not be found."}),(0,f.jsx)(it.$,{onClick:()=>s("/packages"),className:"btn-turbo-primary",children:"Browse Packages"})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-dark-bg text-white",children:[(0,f.jsx)("div",{className:"bg-black/80 border-b border-gray-800",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("button",{onClick:()=>s("/packages"),className:"flex items-center space-x-2 text-gray-300 hover:text-white transition-colors",children:[(0,f.jsx)(Ct.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"text-sm",children:"Back to Packages"})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsxs)(it.$,{onClick:m,className:"btn-turbo-secondary",children:[(0,f.jsx)(es.A,{className:"mr-2 h-4 w-4"}),"Download PDF"]}),(0,f.jsxs)(it.$,{onClick:p,className:"btn-turbo-primary",children:[(0,f.jsx)(T.A,{className:"mr-2 h-4 w-4"}),"Accept Quote"]})]})]})})}),(0,f.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-8",children:[(0,f.jsxs)("div",{className:"text-center mb-8",children:[(0,f.jsxs)("h1",{className:"text-4xl font-bold mb-2",children:["Quote #",null===t||void 0===t?void 0:t.slice(-8).toUpperCase()]}),(0,f.jsxs)("p",{className:"text-gray-400",children:["Generated on ",(ne
1w Date).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric"})]})]}),n?(0,f.jsxs)("div",{className:"grid lg:grid-cols-3 gap-8",children:[(0,f.jsxs)("div",{className:"lg:col-span-2",children:[(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800 mb-6",children:(0,f.jsxs)(rt.Wu,{className:"p-6",children:[(0,f.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"Event Details"}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(_t.A,{className:"h-5 w-5 text-turbo-red mr-3"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-semibold",children:n.quote.event_name}),(0,f.jsxs)("div",{className:"text-gray-400 text-sm",children:[n.quote.event_date," \u2022 ",n.quote.start_time," - ",n.quote.end_time]})]})]}),(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(C.A,{className:"h-5 w-5 text-turbo-red mr-3"}),(0,f.jsx)("div",{className:"text-gray-300",children:n.quote.venue})]}),(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(Xe.A,{className:"h-5 w-5 text-turbo-red mr-3"}),(0,f.jsxs)("div",{className:"text-gray-300",children:[n.quote.attendees," attendees"]})]})]})]})}),(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800",children:(0,f.jsxs)(rt.Wu,{className:"p-6",children:[(0,f.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"Services & Pricing"}),(0,f.jsx)("div",{className:"space-y-3",children:(null===(e=n.items)||void 0===e?void 0:e.map((e,t)=>(0,f.jsxs)("div",{className:"flex justify-between items-center py-2 border-b border-gray-700 last:border-b-0",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-medium",children:e.label}),(0,f.jsxs)("div",{className:"text-gray-400 text-sm",children:[e.qty," \xd7 $",Number(e.unit_price_ex).toFixed(2)]})]}),(0,f.jsxs)("div",{className:"font-mono",children:["$",Number(e.line_total_ex).toFixed(2)]})]},t)))||(0,f.jsx)("div",{className:"text-gray-400 text-center py-4",children:"No items found"})})]})})]}),(0,f.jsx)("div",{className:"lg:col-span-1",children:(0,f.jsx)(rt.Zp,{className:"bg-black/60 border-turbo-red sticky top-8",children:(0,f.jsxs)(rt.Wu,{className:"p-6",children:[(0,f.jsx)("h3",{className:"text-xl font-bold mb-4",children:"Pricing Summary"}),(0,f.jsxs)("div",{className:"space-y-3 mb-6",children:[(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-300",children:"Subtotal (ex-GST)"}),(0,f.jsxs)("span",{className:"font-mono",children:["$",Number(n.quote.subtotal_ex||0).toFixed(2)]})]}),n.quote.surcharges_ex>0&&(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-300",children:"Surcharges"}),(0,f.jsxs)("span",{className:"font-mono",children:["$",Number(n.quote.surcharges_ex).toFixed(2)]})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-300",children:"GST (10%)"}),(0,f.jsxs)("span",{className:"font-mono",children:["$",Number(n.quote.gst||0).toFixed(2)]})]}),(0,f.jsx)("div",{className:"border-t border-gray-700 pt-3",children:(0,f.jsxs)("div",{className:"flex justify-between items-center text-xl font-bold",children:[(0,f.jsx)("span",{children:"Total (inc-GST)"}),(0,f.jsxs)("span",{className:"text-turbo-red font-mono",children:["$",Number(n.quote.total_inc||0).toFixed(2)]})]})})]}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)(it.$,{onClick:p,className:"w-full btn-turbo-primary",children:[(0,f.jsx)(T.A,{className:"mr-2 h-4 w-4"}),"Accept This Quote"]}),(0,f.jsxs)(it.$,{onClick:m,className:"w-full btn-turbo-secondary",children:[(0,f.jsx)(es.A,{className:"mr-2 h-4 w-4"}),"Download PDF"]})]}),(0,f.jsx)("div",{className:"mt-6 text-xs text-gray-500",children:"Quote valid for 30 days. Prices may vary based on final requirements."})]})})})]}):(0,f.jsx)("div",{className:"text-center py-12",children:(0,f.jsx)("p",{className:"text-gray-400",children:"Quote data not available"})})]}),(0,f.jsx)("footer",{className:"bg-black py-6 border-t border-gray-800",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("p",{className:"text-gray-500 text-sm",children:"\xa9 2026 Turbo 360. Professional event coverage."}),(0,f.jsxs)("div",{className:"flex space-x-6",children:[(0,f.jsx)("button",{onClick:()=>s("/customer/auth"),className:"text-xs text-gray-600 hover:text-turbo-red transition-colors duration-300",children:"Customer Login"}),(0,f.jsx)("button",{onClick:()=>s("/admin/packages"),className:"text-xs text-gray-600 hover:text-turbo-red transition-colors duration-300",children:"Admin Login"})]})]})})})]})};var ss=s(7365),as=s(81990),ns=s(34537),rs=s(38326),is=s(9493);const os=e=>{let{onLogin:t}=e;const s=(0,r.Zp)(),[n,i]=(0,a.useState)({username:"",password:""}),[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),h="'Hanken Grotesk',-apple-system,BlinkMacSystemFont,sans-serif",u="'Space Mono',monospace",g="#BF212F",b={fontFamily:h,fontSize:"12px",fontWeight:600,color:"#9A9AA0",marginBottom:"7px",display:"block"},y={width:"100%",background:"#0A0A0B",border:"1px solid #2B2B2F",borderRadius:"10px",padding:"12px 14px",fontFamily:h,fontSize:"14px",color:"#F4F2EE",transition:"border-color .15s",outline:"none"},v=e=>{e.target.style.borderColor=g},j=e=>{e.target.style.borderColor="#2B2B2F"},w=p||!n.username||!n.password;return(0,f.jsxs)("div",{style:{position:"fixed",inset:0,zIndex:9999,fontFamily:h,minHeight:"100vh",background:"#0A0A0B",color:"#F4F2EE",display:"flex",alignItems:"center",justifyContent:"center",padding:"24px",overflow:"hidden"},children:[(0,f.jsx)("div",{style:{position:"absolute",left:0,top:0,width:"100%",height:"5
1px",background:"linear-gradient(90deg,#BF212F 0 33%,#F2A900 33% 66%,#0FA3A3 66% 100%)"}}),(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"","aria-hidden":"true",style:{position:"absolute",right:"-140px",top:"50%",transform:"translateY(-50%) rotate(-8deg)",width:"560px",opacity:.04,pointerEvents:"none"}}),(0,f.jsx)("div",{style:{position:"absolute",inset:0,background:"radial-gradient(circle at 70% 30%,rgba(191,33,47,.14),transparent 55%)",pointerEvents:"none"}}),(0,f.jsxs)("div",{style:{position:"relative",width:"400px",maxWidth:"100%"},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>s("/packages"),style:{display:"flex",alignItems:"center",gap:"7px",background:"transparent",border:"none",color:"#55555C",cursor:"pointer",fontFamily:u,fontSize:"11px",letterSpacing:"0.1em",marginBottom:"24px",padding:0},children:[(0,f.jsx)(Ct.A,{size:14}),"BACK TO PACKAGES"]}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",marginBottom:"30px"},children:[(0,f.jsx)("img",{src:"/admin-assets/turbo-logo-dark.png",alt:"Turbo 360",style:{height:"36px",width:"auto",marginBottom:"18px"}}),(0,f.jsx)("div",{style:{fontFamily:u,fontSize:"11px",letterSpacing:"0.28em",color:"#55555C"},children:"QUOTE BUILDER \xb7 SIGN IN"})]}),(0,f.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),x(!0),d(""),"[email protected]"===n.username&&"tboadmin"===n.password?(localStorage.setItem("packageAdminLoggedIn","true"),localStorage.setItem("packageAdminUser",n.username),t?t():s("/admin/packages")):d("Invalid credentials. Please check your username and password."),x(!1)},style:{background:"#141416",border:"1px solid #262629",borderRadius:"16px",padding:"30px"},children:[(0,f.jsx)("h1",{style:{fontFamily:"'Archivo',-apple-system,sans-serif",fontSize:"22px",fontWeight:800,color:"#F4F2EE",margin:"0 0 20px",letterSpacing:"-0.01em"},children:"Package Admin Login"}),c&&(0,f.jsx)("div",{role:"alert",style:{background:"rgba(191,33,47,0.12)",border:"1px solid rgba(191,33,47,0.5)",borderRadius:"10px",padding:"11px 13px",marginBottom:"18px"},children:(0,f.jsx)("p",{style:{margin:0,color:"#F2B8BC",fontSize:"13px"},children:c})}),(0,f.jsx)("label",{htmlFor:"username",style:b,children:"Username"}),(0,f.jsx)("input",{id:"username",type:"email",value:n.username,onChange:e=>i((0,m.A)((0,m.A)({},n),{},{username:e.target.value})),onFocus:v,onBlur:j,placeholder:"[email protected]",autoComplete:"username",required:!0,disabled:p,style:(0,m.A)((0,m.A)({},y),{},{marginBottom:"18px"})}),(0,f.jsx)("label",{htmlFor:"password",style:b,children:"Password"}),(0,f.jsxs)("div",{style:{position:"relative",marginBottom:"22px"},children:[(0,f.jsx)("input",{id:"password",type:o?"text":"password",value:n.password,onChange:e=>i((0,m.A)((0,m.A)({},n),{},{password:e.target.value})),onFocus:v,onBlur:j,placeholder:"Enter your password",autoComplete:"current-password",required:!0,disabled:p,style:(0,m.A)((0,m.A)({},y),{},{padding:"12px 44px 12px 14px"})}),(0,f.jsx)("button",{type:"button",onClick:()=>l(!o),"aria-label":o?"Hide password":"Show password",disabled:p,style:{position:"absolute",right:"14px",top:"50%",transform:"translateY(-50%)",background:"transparent",border:"none",color:"#55555C",cursor:"pointer",display:"flex",padding:0},children:o?(0,f.jsx)(ut.A,{size:18}):(0,f.jsx)(_.A,{size:18})})]}),(0,f.jsx)("button",{type:"submit",disabled:w,style:{width:"100%",background:g,color:"#fff",border:"none",borderRadius:"10px",padding:"13px",fontFamily:h,fontSize:"14.5px",fontWeight:600,cursor:w?"not-allowed":"pointer",opacity:w?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",transition:"opacity .15s"},children:p?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{style:{width:"16px",height:"16px",borderRadius:"9999px",border:"2px solid rgba(255,255,255,0.4)",borderBottomColor:"#fff",display:"inline-block",animation:"spin 0.7s linear infinite"}}),"Signing In\u2026"]}):(0,f.jsxs)(f.Fragment,{children:["Sign In",(0,f.jsx)(S.A,{size:16,strokeWidth:2.2})]})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"9px",marginTop:"18px",paddingTop:"18px",borderTop:"1px solid #262629"},children:[(0,f.jsx)("span",{style:{color:"#55555C",display:"flex"},children:(0,f.jsx)(ht.A,{size:15})}),(0,f.jsx)("span",{style:{fontFamily:u,fontSize:"10.5px",color:"#55555C",letterSpacing:"0.04em"},children:"Forgot your credentials? Contact IT support."})]})]}),(0,f.jsx)("div",{style:{textAlign:"center",marginTop:"22px",fontFamily:u,fontSize:"10px",letterSpacing:"0.16em",color:"#3A3A3E"},children:"\xa9 TURBO PRODUCTIONS 2026 \xb7 EVERY ANGLE. FULL SPEED."})]}),(0,f.jsx)("style",{children:"@keyframes spin{to{transform:rotate(360deg)}}"})]})};var ls=s(71360),cs=s(42983),ds=s(39292),ms=s(19233),ps=s(34379),xs=s(8800),hs=s(27033),us=s(19917),gs=s(53639),fs=s(14918),bs=s(19797),ys=s(23946),vs=s(26511),js=s(61161),ws=s(13190),Ns=s(22626),As=s(50516),ks=s(32494),Ss=s(6608),_s=s(50797),Cs=s(78384),Fs=s(66797),Es=s(33005);const Ts=function(e){let{cents:t=!0,sign:s="$"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};
1const a=Number(e||0),n=Math.trunc(Math.abs(a)),r=Math.round(100*(Math.abs(a)-n)),i=n.toLocaleString("en-AU");return{whole:"".concat(a<0?"-":"").concat(s).concat(i),cents:t?".".concat(String(r).padStart(2,"0")):""}},zs=e=>{let{amount:t,size:s=28,mutedSize:a=15,color:n="#0A0A0B",mutedColor:r="#9A9AA0"}=e;const i=Ts(t);return(0,f.jsxs)("span",{className:"tg-mono",style:{fontWeight:700,fontSize:s,letterSpacing:"-0.03em",color:n,lineHeight:1},children:[i.whole,(0,f.jsx)("span",{style:{fontSize:a,color:r},children:i.cents})]})},Bs={green:{bg:"#DCFCE7",fg:"#15803D"},blue:{bg:"#DBEAFE",fg:"#1D4ED8"},teal:{bg:"#CFFAFE",fg:"#0E7490"},amber:{bg:"#FEF3C7",fg:"#92400E"},indigo:{bg:"#EEF2FF",fg:"#4338CA"},danger:{bg:"#FEE2E2",fg:"#991B1B"},gray:{bg:"#EDEDF0",fg:"#55555C"},muted:{bg:"#F1F5F9",fg:"#64748B"}},Ds=e=>{let{tone:t="gray",children:s,radius:a=6,style:n}=e;const r=Bs[t]||Bs.gray;return(0,f.jsx)("span",{className:"tg-mono",style:(0,m.A)({fontSize:10,fontWeight:700,background:r.bg,color:r.fg,borderRadius:a,padding:"4px 9px",whiteSpace:"nowrap",letterSpacing:"0.02em",textTransform:"uppercase"},n),children:s})},Is={Draft:"gray",Scheduled:"indigo",Sent:"blue",Paid:"green",Overdue:"danger","Partially Paid":"amber",Cancelled:"muted"},Rs={Draft:"gray",Sent:"blue",Viewed:"teal","Pending Response":"amber",Accepted:"green",Declined:"danger","Follow-up Sent":"indigo"},Ps={new:"blue",contacted:"teal",proposal_sent:"amber",converted:"green",closed:"gray",declined:"danger"},Ws=e=>{let{rows:t=5}=e;return(0,f.jsx)("div",{style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:14,padding:22},children:Array.from({length:t}).map((e,t)=>(0,f.jsx)("div",{className:"tg-skel",style:{height:11,marginBottom:12,width:"".concat([60,100,80,92,70][t%5],"%")}},t))})},Os=e=>{let{icon:t=ls.A,title:s="No records yet",message:a,actionLabel:n,onAction:r}=e;return(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:14,padding:"48px 24px",textAlign:"center"},children:[(0,f.jsx)("div",{style:{width:46,height:46,borderRadius:12,background:"#F7F7F9",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 14px",color:"#B5B5BC"},children:(0,f.jsx)(t,{size:22})}),(0,f.jsx)("div",{style:{fontSize:14,fontWeight:700,marginBottom:6},children:s}),a&&(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0",marginBottom:n?16:0,maxWidth:360,marginInline:"auto"},children:a}),n&&(0,f.jsx)("button",{onClick:r,className:"tg-btn-primary",style:{background:"#BF212F",color:"#fff",border:"none",borderRadius:8,padding:"9px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:n})]})},Ls=e=>{let{children:t,style:s,className:a=""}=e;return(0,f.jsx)("div",{className:a,style:(0,m.A)({background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},s),children:t})},Ms=function(){return((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().split(/\s+/).map(e=>e[0]).slice(0,2).join("")||"?").toUpperCase()},qs=[{group:"OVERVIEW",items:[{to:"/admin",label:"Dashboard",icon:ps.A,accent:"#F4F2EE",end:!0},{to:"/admin/calendar",label:"Calendar",icon:xs.A,accent:"#38BDF8"},{to:"/admin/reports",label:"Reports",icon:hs.A,accent:"#34D399"},{to:"/admin/todos",label:"To-Do List",icon:us.A,accent:"#A78BFA",badge:"todos"}]},{group:"KEY ACCOUNTS",items:[{to:"/admin/national-media",label:"National Media",icon:gs.A,accent:"#F2A900"},{to:"/admin/terrapinn",label:"Terrapinn",icon:gs.A,accent:"#E5673F"},{to:"/admin/wmedia",label:"W.Media",icon:gs.A,accent:"#3B5BFF"},{to:"/admin/lifeblood",label:"Lifeblood",icon:fs.A,accent:"#E42313"},{to:"/admin/school-productions",label:"School Productions",icon:bs.A,accent:"#38BDF8"},{to:"/admin/agha",label:"AGHA Gift Fair",icon:ys.A,accent:"#FB7185"},{to:"/admin/ahw2026",label:"AHW 2026",icon:vs.A,accent:"#FBBF24"}]},{group:"CRM & SALES",items:[{to:"/admin/leads",label:"Leads",icon:js.A,accent:"#FACC15",badge:"leads"},{to:"/admin/clients",label:"Clients",icon:gs.A,accent:"#4ADE80"},{to:"/admin/proposals",label:"Proposals",icon:kt.A,accent:"#60A5FA"},{to:"/admin/services",label:"Services",icon:ws.A,accent:"#2DD4BF"},{to:"/admin/service-catalog",label:"Service Catalog",icon:Ns.A,accent:"#C084FC"}]},{group:"FINANCE",items:[{to:"/admin/invoices",label:"Invoices",icon:At.A,accent:"#F2A900",badge:"overdue",end:!0},{to:"/admin/invoices/recurring",label:"Recurring",icon:As.A,accent:"#FB923C"},{to:"/admin/default-terms",label:"Terms",icon:kt.A,accent:"#94A3B8"}]},{group:"EVENTS & MEDIA",items:[{to:"/admin/corporate",label:"Event Runsheets",icon:ks.A,accent:"#818CF8"},{to:"/admin/crew",label:"Crew",icon:Xe.A,accent:"#FBBF24"},{to:"/admin/recent-gigs",label:"Recent Gigs",icon:Ue.A,accent:"#FB7185"},{to:"/admin/popups",label:"Home Popups",icon:Ss.A,accent:"#F97316"},{to:"/admin/content-delivery",label:"Content Delivery",icon:Ge.A,accent:"#C084FC"},{to:"/admin/live-streams",label:"Live Streams",icon:Ve.A,accent:"#F472B6"},{to:"/admin/live-uploads",label:"Live Uploads",icon:_s.A,accent:"#22D3EE"},{to:"/admin/marketing",label:"Marketing",icon:T.A,accent:"#F87171"}
1]},{group:"SYSTEM",items:[{to:"/admin/weddings",label:"Weddings",icon:fs.A,accent:"#F472B6"},{to:"/admin/consent",label:"Image Consent",icon:Cs.A,accent:"#FB7185"},{to:"/admin/packages",label:"Quote Builder",icon:as.A,accent:"#2DD4BF"},{to:"/admin/settings",label:"Settings",icon:Fs.A,accent:"#9A9AA0"},{to:"/admin/backup-restore",label:"Backup / Restore",icon:Es.A,accent:"#34D399"}]}],Hs={fontFamily:"'Space Mono',monospace",fontSize:9.5,letterSpacing:"0.2em",color:"#48484E",padding:"14px 12px 6px"},Us=e=>{let{value:t,alert:s}=e;if(null==t||0===t)return null;const a=s?{background:"#3A1517",color:"#F87171"}:{background:"#1F1F23",color:"#C9C9D0"};return(0,f.jsx)("span",{className:"tg-mono",style:(0,m.A)({marginLeft:"auto",fontSize:10,borderRadius:20,padding:"2px 7px"},a),children:t})};let Gs={stats:null,at:0};const Vs=e=>{let{navOpen:t=!1,onClose:s}=e;const n=(0,r.Zp)(),i=(()=>{const{pathname:e}=(0,r.zy)(),t=qs.flatMap(e=>e.items.map(e=>e.to));let s="";for(const a of t)("/admin"===a?"/admin"===e:e===a||e.startsWith(a+"/"))&&a.length>s.length&&(s=a);return s})(),[l,c]=(0,a.useState)({}),d=(0,o.jd)()||{},m=d.fullName||d.full_name||d.username||d.email||"Admin";(0,a.useEffect)(()=>{const e=e=>{var t,s,a,n;c({leads:(null===(t=e.leads)||void 0===t?void 0:t.new)||0,overdue:(null===(s=e.invoices)||void 0===s?void 0:s.overdue)||0,todos:(null===(a=e.todos)||void 0===a?void 0:a.open)||(null===(n=e.todos)||void 0===n?void 0:n.total)||0})};(async()=>{try{if(Gs.stats&&Date.now()-Gs.at<6e4)return void e(Gs.stats);const t=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}"),s=await fetch("".concat((0,I.wE)(),"/api/mobile/dashboard/stats"),{headers:{Authorization:"Bearer ".concat(t.token)}});if(!s.ok)return;const a=await s.json(),n=a.stats||a;Gs={stats:n,at:Date.now()},e(n)}catch(t){}})()},[]);return(0,f.jsxs)("aside",{className:"tg-sidebar tg-scroll ".concat(t?"tg-draweropen":"tg-drawerclosed"),style:{width:256,flexShrink:0,background:"#0A0A0B",color:"#9A9AA0",display:"flex",flexDirection:"column",position:"sticky",top:0,height:"100vh",borderRight:"1px solid #1F1F23"},children:[(0,f.jsx)("div",{style:{padding:"22px 20px 18px",display:"flex",alignItems:"center",gap:12,borderBottom:"1px solid #1A1A1D"},children:(0,f.jsx)("img",{src:"/admin-assets/turbo-logo-dark.png",alt:"Turbo 360",style:{height:30,width:"auto"}})}),(0,f.jsx)("nav",{className:"tg-scroll",style:{flex:1,overflowY:"auto",padding:"12px",display:"flex",flexDirection:"column",gap:2},children:qs.map(e=>{let{group:t,items:n}=e;return(0,f.jsxs)(a.Fragment,{children:[(0,f.jsx)("div",{style:Hs,children:t}),n.map(e=>{const t=e.icon,a=i===e.to;return(0,f.jsxs)(r.k2,{to:e.to,onClick:s,className:"tg-nav-item",style:{display:"flex",alignItems:"center",gap:12,padding:"9px 12px",borderRadius:8,textDecoration:"none",fontSize:13.5,position:"relative",fontWeight:a?600:500,background:a?"#BF212F":"transparent",color:a?"#fff":"#C4C4CB"},children:[a&&(0,f.jsx)("span",{style:{position:"absolute",left:0,top:9,bottom:9,width:3,borderRadius:3,background:"#fff"}}),(0,f.jsx)("span",{style:{color:a?"#fff":e.accent,display:"flex",flexShrink:0},children:(0,f.jsx)(t,{size:17,strokeWidth:2})}),(0,f.jsx)("span",{className:"tg-nav-label",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),e.badge&&(0,f.jsx)(Us,{value:l[e.badge],alert:"overdue"===e.badge})]},e.to)})]},t)})}),(0,f.jsxs)("div",{style:{borderTop:"1px solid #1A1A1D",padding:12,display:"flex",alignItems:"center",gap:11},children:[(0,f.jsx)("div",{className:"tg-ui",style:{width:34,height:34,borderRadius:9,background:"linear-gradient(135deg,#BF212F,#8E1822)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:13,color:"#fff",flexShrink:0},children:Ms(m)}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"#F4F2EE",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m}),(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:10,color:"#55555C"},children:"ADMIN"})]}),(0,f.jsx)("button",{onClick:()=>{(0,o._p)(),n("/")},title:"Log out",style:{background:"none",border:"none",color:"#7A7A82",display:"flex",cursor:"pointer",padding:4},children:(0,f.jsx)(is.A,{size:17})})]})]})};var Js=s(69126);const Ys="'Space Mono',monospace",Ks=(0,I.wE)(),Zs=()=>{const e=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}");return{Authorization:"Bearer ".concat(null===e||void 0===e?void 0:e.token)}},$s={clients:{label:"CLIENTS",icon:gs.A,color:"#16A34A"},invoices:{label:"INVOICES",icon:At.A,color:"#B45309"},proposals:{label:"PROPOSALS",icon:kt.A,color:"#2563EB"},leads:{label:"LEADS",icon:js.A,color:"#CA8A04"}},Qs=["clients","invoices","proposals","leads"],Xs=e=>{let{open:t,onClose:s}=e;const n=(0,r.Zp)(),i=(0,a.useRef)(null),o=(0,a.useRef)({proposals:null,leads:null}),[l,c]=(0,a.useState)(""),[d,p]=(0,a.useState)(""),[x,h]=(0,a.useState)({clients:[],invoices:[],proposals:[],leads:[]}),[u,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(0);(0,a.useEffect)(()=>{t&&(c(""),p(""),h({clients:[],invoices:[],proposals:[],leads:[]}),v(0),setTimeout(()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus()},30))},[t]),(0,a.useEffect)(()=>{const e=setTimeout(()=>p(l.trim()),180);return()=>clearTimeout(e)},[l]),(0,a.useEffect)(()=>{t&&(async()=>
1{if(!o.current.proposals)try{const e=await fetch("".concat(Ks,"/api/proposals"),{headers:Zs()});if(e.ok){const t=await e.json();o.current.proposals=Array.isArray(t)?t:t.proposals||[]}}catch(e){o.current.proposals=[]}if(!o.current.leads)try{const e=await fetch("".concat(Ks,"/api/leads"),{headers:Zs()});if(e.ok){const t=await e.json();o.current.leads=t.leads||[]}}catch(t){o.current.leads=[]}})()},[t]),(0,a.useEffect)(()=>{if(!t)return;const e=d;if(!e||e.length<2)return h({clients:[],invoices:[],proposals:[],leads:[]}),void v(0);let s=!1;return b(!0),(async()=>{const t=e.toLowerCase(),a=fetch("".concat(Ks,"/api/clients?q=").concat(encodeURIComponent(e)),{headers:Zs()}).then(e=>e.ok?e.json():{clients:[]}).then(e=>(e.clients||[]).slice(0,6).map(e=>({id:e.id,title:e.is_company?e.company_name:e.contact_name,subtitle:e.is_company?e.abn?"ABN ".concat(e.abn):"Company":[e.company_name||e.parent_company_name,e.email].filter(Boolean).join(" \xb7 "),to:e.is_company?"/admin/clients/company/".concat(e.id):e.parent_company_id?"/admin/clients/company/".concat(e.parent_company_id):"/admin/clients"}))).catch(()=>[]),n=fetch("".concat(Ks,"/api/invoices?search=").concat(encodeURIComponent(e),"&page_size=6"),{headers:Zs()}).then(e=>e.ok?e.json():{invoices:[]}).then(e=>(e.invoices||[]).slice(0,6).map(e=>{return{id:e.id,title:"#".concat(e.invoice_number),subtitle:[e.client_company,(t=e.total,"$".concat(Number(t||0).toLocaleString("en-AU",{maximumFractionDigits:0}))),e.status].filter(Boolean).join(" \xb7 "),to:"/admin/invoices/".concat(e.id)};var t})).catch(()=>[]),[r,i]=await Promise.all([a,n]),l=(o.current.proposals||[]).filter(e=>[e.proposal_number,e.client_company,e.contact_name,e.project_name].some(e=>e&&String(e).toLowerCase().includes(t))).slice(0,6).map(e=>({id:e.id,title:e.proposal_number||"Proposal",subtitle:[e.client_company,e.project_name].filter(Boolean).join(" \xb7 "),to:"/admin/proposals/".concat(e.id)})),c=(o.current.leads||[]).filter(e=>[e.name,e.business_name,e.email,e.service].some(e=>e&&String(e).toLowerCase().includes(t))).slice(0,6).map(e=>({id:e.id,title:e.name||"Lead",subtitle:[e.business_name,e.email].filter(Boolean).join(" \xb7 "),to:"/admin/leads/".concat(e.id)}));s||(h({clients:r,invoices:i,proposals:l,leads:c}),v(0),b(!1))})(),()=>{s=!0}},[d,t]);const j=(0,a.useMemo)(()=>Qs.flatMap(e=>x[e].map(t=>(0,m.A)((0,m.A)({},t),{},{group:e}))),[x]),w=e=>{e&&(null===s||void 0===s||s(),n(e.to))};if((0,a.useEffect)(()=>{if(!t)return;const e=e=>{"Escape"===e.key?null===s||void 0===s||s():"ArrowDown"===e.key?(e.preventDefault(),v(e=>Math.min(e+1,j.length-1))):"ArrowUp"===e.key?(e.preventDefault(),v(e=>Math.max(e-1,0))):"Enter"===e.key&&(e.preventDefault(),w(j[y]))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,j,y]),!t)return null;let N=-1;const A=j.length>0;return(0,f.jsx)("div",{onClick:()=>null===s||void 0===s?void 0:s(),style:{position:"fixed",inset:0,background:"rgba(10,10,11,.5)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:95,display:"flex",alignItems:"flex-start",justifyContent:"center",padding:"12vh 20p
1x 20px"},children:(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:600,background:"#fff",borderRadius:14,boxShadow:"0 30px 80px rgba(0,0,0,.4)",overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:"70vh"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11,padding:"15px 18px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)(ds.A,{size:18,color:"#9A9AA0"}),(0,f.jsx)("input",{ref:i,value:l,onChange:e=>c(e.target.value),placeholder:"Search clients, invoices, proposals, leads\u2026",style:{flex:1,border:0,outline:"none",fontSize:15,fontFamily:"'Hanken Grotesk',sans-serif",color:"#0A0A0B",background:"transparent"}}),u&&(0,f.jsx)("span",{className:"tg-skel",style:{width:14,height:14,borderRadius:"50%"}}),(0,f.jsx)("button",{onClick:()=>null===s||void 0===s?void 0:s(),style:{background:"none",border:0,color:"#9A9AA0",cursor:"pointer",display:"flex"},children:(0,f.jsx)(g.A,{size:16})})]}),(0,f.jsx)("div",{className:"tg-scroll",style:{overflowY:"auto",flex:1},children:!d||d.length<2?(0,f.jsx)("div",{style:{padding:"34px 18px",textAlign:"center",color:"#9A9AA0",fontSize:13},children:"Type at least 2 characters to search\u2026"}):A||u?Qs.filter(e=>x[e].length>0).map(e=>{const t=$s[e];return(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:Ys,fontSize:10,letterSpacing:".14em",color:"#9A9AA0",padding:"12px 18px 6px"},children:t.label}),x[e].map(e=>{N+=1;const s=N,a=s===y,n=t.icon;return(0,f.jsxs)("button",{onMouseEnter:()=>v(s),onClick:()=>w(e),style:{width:"100%",textAlign:"left",display:"flex",alignItems:"center",gap:12,padding:"10px 18px",background:a?"#F7F7F9":"none",border:0,cursor:"pointer"},children:[(0,f.jsx)("span",{style:{width:30,height:30,borderRadius:8,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:"".concat(t.color,"1A"),color:t.color},children:(0,f.jsx)(n,{size:15})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:"#0A0A0B",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title}),e.subtitle&&(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}
1,children:e.subtitle})]}),a&&(0,f.jsx)(Js.A,{size:14,color:"#C9C9D0"})]},e.id)})]},e)}):(0,f.jsxs)("div",{style:{padding:"34px 18px",textAlign:"center",color:"#9A9AA0",fontSize:13},children:["No matches for \u201c",d,"\u201d."]})}),(0,f.jsxs)("div",{style:{borderTop:"1px solid #EDEDF0",padding:"9px 18px",display:"flex",alignItems:"center",gap:16,fontFamily:Ys,fontSize:10.5,color:"#B5B5BC"},children:[(0,f.jsx)("span",{children:"\u2191\u2193 navigate"}),(0,f.jsx)("span",{children:"\u21b5 open"}),(0,f.jsx)("span",{children:"esc close"})]})]})})},ea=[["/admin/clients/company","Company"],["/admin/clients/create","New Client"],["/admin/clients","Clients"],["/admin/leads","Leads"],["/admin/proposals","Proposals"],["/admin/services","Services"],["/admin/service-catalog","Service Catalog"],["/admin/invoices/recurring","Recurring Invoices"],["/admin/invoices","Invoices"],["/admin/recurring-invoices","Recurring Invoice"],["/admin/default-terms","Default Terms"],["/admin/corporate","Event Runsheets"],["/admin/crew","Crew"],["/admin/recent-gigs","Recent Gigs"],["/admin/content-delivery","Content Delivery"],["/admin/live-streams","Live Streams"],["/admin/live-uploads","Live Uploads"],["/admin/marketing","Marketing"],["/admin/school-productions","School Productions"],["/admin/agha","AGHA Gift Fair"],["/admin/terrapinn","Terrapinn"],["/admin/wmedia","W.Media"],["/admin/ahw2026","AHW 2026"],["/admin/weddings","Weddings"],["/admin/consent","Image Consent"],["/admin/packages","Quote Builder"],["/admin/settings","Settings"],["/admin/backup-restore","Backup / Restore"],["/admin/calendar","Calendar"],["/admin/reports","Reports"],["/admin/todos","To-Do List"],["/admin/dashboard","Dashboard"],["/admin","Dashboard"]],ta=e=>{let{children:t,title:s,meta:n,action:i}=e;const{pathname:o}=(0,r.zy)(),[l,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(!1),p=s||(e=>{var t;return(null===(t=ea.find(t=>{let[s]=t;return e===s||e.startsWith(s)}))||void 0===t?void 0:t[1])||"Admin"})(o),x=null!=n?n:(()=>{try{const e=new Date,t=e.toLocaleDateString("en-AU",{weekday:"short"}).toUpperCase(),s=e.toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric"}).toUpperCase(),a=e.toLocaleTimeString("en-AU",{hour:"2-digit",minute:"2-digit",hour12:!1});return"".concat(t," ").concat(s," \xb7 ").concat(a," AEST")}catch(e){return""}})();(0,a.useEffect)(()=>{c(!1)},[o]),(0,a.useEffect)(()=>{const e=e=>{!e.metaKey&&!e.ctrlKey||"k"!==e.key&&"K"!==e.key||(e.preventDefault(),m(!0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);const h=()=>{if(!i)return null;const e=(0,f.jsxs)(f.Fragment,{children:[i.icon?(0,f.jsx)(i.icon,{size:16,strokeWidth:2.2}):(0,f.jsx)(ls.A,{size:16,strokeWidth:2.2}),(0,f.jsx)("span",{className:"tg-desktop-only",children:i.label})]}),t={display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"11px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer",whiteSpace:"nowrap",textDecoration:"none"};return i.to?(0,f.jsx)(r.N_,{className:"tg-btn-primary",to:i.to,style:t,children:e}):(0,f.jsx)("button",{className:"tg-btn-primary",onClick:i.onClick,style:t,children:e})};return(0,f.jsxs)("div",{className:"admin-shell",children:[(0,f.jsx)("div",{className:"tg-overlay ".concat(l?"tg-ovshow":"tg-ovhide"),onClick:()=>c(!1)}),(0,f.jsx)(Vs,{navOpen:l,onClose:()=>c(!1)}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:[(0,f.jsxs)("header",{className:"tg-topbar",style:{position:"sticky",top:0,zIndex:20,background:"rgba(237,237,240,.86)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",borderBottom:"1px solid #DEDEE3",padding:"0 32px",height:64,display:"flex",alignItems:"center",gap:16},children:[(0,f.jsx)("button",{className:"tg-hamburger",onClick:()=>c(e=>!e),style:{width:40,height:40,borderRadius:9,background:"#fff",border:"1px solid #DEDEE3",cursor:"pointer",alignItems:"center",justifyContent:"center",color:"#0A0A0B",flexShrink:0},children:(0,f.jsx)(cs.A,{size:19})}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{className:"tg-ui tg-title",style:{fontWeight:700,fontSize:19,letterSpacing:"-0.01em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:p}),x?(0,f.jsx)("div",{className:"tg-mono tg-desktop-only",style:{fontSize:10.5,letterSpacing:"0.08em",color:"#9A9AA0",marginTop:1},children:x}):null]}),(0,f.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:12},children:[(0,f.jsxs)("button",{onClick:()=>m(!0),className:"tg-desktop-only",style:{display:"flex",alignItems:"center",gap:9,background:"#fff",border:"1px solid #DEDEE3",borderRadius:9,padding:"9px 13px",width:280,cursor:"pointer",textAlign:"left"},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0",display:"flex"},children:(0,f.jsx)(ds.A,{size:16})}),(0,f.jsx)("span",{style:{color:"#9A9AA0",fontSize:13.5},children:"Search clients, invoices\u2026"}),(0,f.jsx)("span",{className:"tg-mono",style:{marginLeft:"auto",fontSize:10,
1color:"#B5B5BC",border:"1px solid #DEDEE3",borderRadius:5,padding:"1px 6px"},children:"\u2318K"})]}),(0,f.jsx)("button",{onClick:()=>m(!0),className:"tg-hamburger",title:"Search",style:{width:40,height:40,borderRadius:9,background:"#fff",border:"1px solid #DEDEE3",cursor:"pointer",alignItems:"center",justifyContent:"center",color:"#333"},children:(0,f.jsx)(ds.A,{size:18})}),(0,f.jsxs)("button",{style:{position:"relative",width:40,height:40,borderRadius:9,background:"#fff",border:"1px solid #DEDEE3",cursor:"pointer",color:"#333",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,f.jsx)(ms.A,{size:18}),(0,f.jsx)("span",{style:{position:"absolute",top:8,right:9,width:7,height:7,borderRadius:"50%",background:"#BF212F",border:"1.5px solid #fff"}})]}),(0,f.jsx)(h,{})]})]}),(0,f.jsx)("main",{className:"tg-scroll tg-main",style:{flex:1,overflowY:"auto",padding:"28px 32px 48px"},children:t})]}),(0,f.jsx)(Xs,{open:d,onClose:()=>m(!1)})]})},sa="'Space Mono',monospace",aa={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},na={Requested:"amber",Approved:"blue",Booked:"green",Rejected:"danger"},ra=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)({totalQuotes:0,monthlyRevenue:0,activeItems:0,pendingQuotes:0}),[n,i]=(0,a.useState)([]),[o,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)(!1);(0,a.useEffect)(()=>{const e="true"===localStorage.getItem("packageAdminLoggedIn");d(e),e?x():l(!1)},[]);const p=()=>{d(!0),x()},x=async()=>{try{l(!0);const e=await fetch("".concat(I.fn,"/api/admin/packages/quotes?limit=5"));if(e.ok){const t=await e.json();i(t);const a=t.length,n=t.filter(e=>"Requested"===e.status).length,r=t.reduce((e,t)=>e+(t.total_inc||0),0);s(e=>(0,m.A)((0,m.A)({},e),{},{totalQuotes:a,pendingQuotes:n,monthlyRevenue:r}))}const t=await fetch("".concat(I.fn,"/api/admin/packages/items"));if(t.ok){const e=(await t.json()).filter(e=>e.active).length;s(t=>(0,m.A)((0,m.A)({},t),{},{activeItems:e}))}}catch(e){console.error("Error fetching dashboard data:",e)}finally{l(!1)}},h=[{title:"Pricing Manager",description:"Manage service items and pricing",icon:At.A,path:"/admin/packages/items",bg:"rgba(67,56,202,.1)",fg:"#4338CA"},{title:"Quote Management",description:"View and manage quote requests",icon:kt.A,path:"/admin/packages/quotes",bg:"rgba(15,163,163,.1)",fg:"#0FA3A3"},{title:"Rules & Surcharges",description:"Configure pricing rules and surcharges",icon:tt.A,path:"/admin/packages/rules",bg:"rgba(180,83,9,.1)",fg:"#B45309"},{title:"System Settings",description:"Configure tax, company details, and preferences",icon:ss.A,path:"/admin/packages/settings",bg:"rgba(100,116,139,.1)",fg:"#64748B"}],u=[{label:"TOTAL QUOTES",value:t.totalQuotes,icon:kt.A,color:"#0A0A0B"},{label:"MONTHLY REV",money:t.monthlyRevenue,icon:At.A,color:"#15803D"},{label:"ACTIVE ITEMS",value:t.activeItems,icon:as.A,color:"#4338CA"},{label:"PENDING",value:t.pendingQuotes,icon:ns.A,color:"#92400E"}],g=e=>{if(!e)return"\u2014";try{return new Date(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short"})}catch(t){return e}};return o?(0,f.jsx)(ta,{title:"Quote Builder",meta:"SALES \xb7 PACKAGES",children:(0,f.jsx)(Ws,{rows:6})}):c?(0,f.jsxs)(ta,{title:"Quote Builder",meta:"SALES \xb7 PACKAGES",children:[(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:14,marginBottom:18},children:u.map(e=>(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},aa),{},{padding:"16px 18px"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:9},children:[(0,f.jsx)("span",{style:{fontFamily:sa,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0"},children:e.label}),(0,f.jsx)("span",{style:{width:28,height:28,borderRadius:8,background:"#EDEDF0",color:"#55555C",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(e.icon,{size:15})})]}),null!=e.money?(0,f.jsx)(zs,{amount:e.money,size:22,mutedSize:13,color:e.color}):(0,f.jsx)("div",{style:{fontFamily:sa,fontWeight:700,fontSize:22,letterSpacing:"-0.02em",lineHeight:1,color:e.color},children:e.value})]},e.label))}),(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:14,marginBottom:18},children:h.map(t=>(0,f.jsxs)("button",{type:"button",className:"tg-qa",onClick:()=>e(t.path),style:(0,m.A)((0,m.A)({},aa),{},{padding:18,textAlign:"left",cursor:"pointer",transition:"all .15s",display:"block",width:"100%"}),children:[(0,f.jsx)("div",{style:{width:32,height:32,borderRadius:9,background:t.bg,color:t.fg,display:"flex",alignItems:"center",justifyContent:"center",marginBottom:10},children:(0,f.jsx)(t.icon,{size:17})}),(0,f.jsx)("div",{style:{fontSize:14,fontWeight:700},children:t.title}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",marginTop:3},children:t.description})]},t.title))}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},aa),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)("span",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:"Recent Quotes"}),n.length>0&&(0,f.jsxs)("button",{type:"button",onClick:()=>e("/admin/packages/quotes"),style:{display:"flex",alignItems:"center",gap:5,background:"none",border:"none",color:"#BF212F",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:["View all ",(0,f.jsx)(rs.A,{size:14})]})]}),0===n.length?(0,f.jsx)(Os,{icon:kt.A,title:"No quotes yet",message:"Quotes will appear here as they're submitted."}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:"1.5fr 1.2fr 120px 110px 90px",gap:12,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:sa,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Event"}),(0,f.jsx)("span",{children:"Client"}),(0,f.jsx)("span",{children:"Total"}),(0,f.jsx)("span",{children:"Status"}),(0,f.jsx)("span",{children:"Created"})]}),n.map((t,s)=>(0,f.jsxs)("div",{className:"tg-row",onClick:()=>e("/admin/packages/quotes"),style:{display:"grid",gridTemplateColumns:"1.5fr 1.2fr 120px 110px 90px",gap:12,alignItems:"center",padding:"14px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer"},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.event_name}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.client_name})]}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontSize:12.5,color:"#55555C",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:t.client_name}),(0,f.jsx)("span",{children:(0,f.jsx)(zs,{amount:t.total_inc,size:13,mutedSize:11})}),(0,f.jsx)("span",{style:{justifySelf:"start"},children:(0,f.jsx)(Ds,{tone:na[t.status]||"gray",children:t.status})}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontFamily:sa,fontSize:12,color:"#9A9AA0"},children:g(t.created_at)})]},t.id||s))]})]}),(0,f.jsx)("div",{style:{marginTop:18,display:"flex",justifyContent:"flex-end"},children:(0,f.jsxs)("button",{type:"button",onClick:()=>{localStorage.removeItem("packageAdminLoggedIn"),localStorage.removeItem("packageAdminUser"),d(!1),e("/packages")},style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(is.A,{size:14})," Logout"]})})]}):(0,f.jsx)(os,{onLogin:p})};
1var ia=s(88693),oa=s(79989),la=s(9855);const ca=e=>{let{children:t}=e;const[s,n]=(0,a.useState)(!1),[r,i]=(0,a.useState)(!0);(0,a.useEffect)(()=>{const e="true"===localStorage.getItem("packageAdminLoggedIn");n(e),i(!1)},[]);const o=()=>{n(!0)};return r?(0,f.jsx)("div",{className:"min-h-screen bg-dark-bg text-white flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-turbo-red mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-400",children:"Loading..."})]})}):s?t:(0,f.jsx)(os,{onLogin:o})},da="'Space Mono',monospace",ma={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},pa={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",background:"#FBFBFC",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",outline:"none",boxSizing:"border-box"},xa={display:"block",fontFamily:da,fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"#9A9AA0",marginBottom:6},ha="110px 160px 1.4fr 100px 130px 90px 96px",ua={video:"danger",photo:"blue",post:"indigo",addon:"green",crew:"amber",travel:"gray"},ga=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)([]),[o,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)(null),[p,x]=(0,a.useState)({}),[h,u]=(0,a.useState)(!1),[b,y]=(0,a.useState)({category:"",code:"",label:"",unit:"",base_price_ex:"",active:!0}),[j,w]=(0,a.useState)(""),[N,A]=(0,a.useState)("all"),[k,S]=(0,a.useState)({type:"",text:""}),_=[{value:"video",label:"Videography"},{value:"photo",label:"Photography"},{value:"post",label:"Post-Production"},{value:"addon",label:"Add-ons"},{value:"crew",label:"Extra Crew"},{value:"travel",label:"Travel"}],C=[{value:"half_day",label:"Half Day"},{value:"full_day",label:"Full Day"},{value:"hour",label:"Hour"},{value:"day",label:"Day"},{value:"fixed",label:"Fixed"},{value:"km",label:"Kilometer"}];(0,a.useEffect)(()=>{F()},[]),(0,a.useEffect)(()=>{E()},[t,j,N]);const F=async()=>{try{l(!0);const e=await fetch("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL,"/api/admin/packages/items"));if(e.ok){const t=await e.json();s(t)}}catch(e){console.error("Error fetching items:",e)}finally{l(!1)}},E=()=>{let e=t;j&&(e=e.filter(e=>e.label.toLowerCase().includes(j.toLowerCase())||e.code.toLowerCase().includes(j.toLowerCase()))),"all"!==N&&(e=e.filter(e=>e.category===N)),i(e)},T=()=>{d(null),x({})},z=e=>{var t;return(null===(t=_.find(t=>t.value===e))||void 0===t?void 0:t.label)||e},B=e=>{var t;return(null===(t=C.find(t=>t.value===e))||void 0===t?void 0:t.label)||(e||"").replace("_"," ")},D=e=>{let{label:t,children:s}=e;return(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:xa,children:t}),s]})},I=(0,m.A)((0,m.A)({},pa),{},{padding:"8px 10px",fontSize:13});return(0,f.jsx)(ca,{children:(0,f.jsxs)(ta,{title:"Pricing Manager",meta:"SALES \xb7 PACKAGES",children:[k.text&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:18,borderRadius:12,padding:"12px 16px",fontSize:13.5,fontWeight:500,background:"success"===k.type?"#DCFCE7":"#FEE2E2",color:"success"===k.type?"#15803D":"#991B1B",border:"1px solid ".concat("success"===k.type?"#BBF7D0":"#FECACA")},children:["success"===k.type?(0,f.jsx)(zt.A,{size:16}):(0,f.jsx)(v.A,{size:16}),k.text]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:18,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",flex:1,minWidth:220},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0",display:"flex"},children:(0,f.jsx)(ds.A,{size:16})}),(0,f.jsx)("input",{placeholder:"Search by label or code\u2026",value:j,onChange:e=>w(e.target.value),style:{border:"none",outline:"none",background:"transparent",fontSize:13.5,color:"#0A0A0B",width:"100%",fontFamily:"'Hanken Grotesk',sans-serif"}})]}),(0,f.jsxs)("select",{value:N,onChange:e=>A(e.target.value),style:(0,m.A)((0,m.A)({},pa),{},{width:200,cursor:"pointer"}),children:[(0,f.jsx)("option",{value:"all",children:"All Categories"}),_.map(e=>(0,f.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,f.jsx)("button",{onClick:()=>{localStorage.removeItem("packageAdminLoggedIn"),localStorage.removeItem("packageAdminUser"),e("/packages")},style:{display:"flex",alignItems:"center",gap:7,background:"#fff",color:"#55555C",border:"1px solid #E4E4E9",borderRadius:9,padding:"10px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13,cursor:"pointer",whiteSpace:"nowrap"},children:"Logout"}),(0,f.jsxs)("button",{onClick:()=>u(e=>!e),className:"tg-btn-primary",style:{display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"11px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer",whiteSpace:"nowrap"},children:[h?(0,f.jsx)(g.A,{size:16,strokeWidth:2.2}):(0,f.jsx)(ls.A,{size:16,strokeWidth:2.2}),h?"Close":"Add Item"]})]}),h&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},ma),{},{padding:22,marginBottom:18}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:18,fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:[(0,f.jsx)(ls.A,{size:18})," Add New Item"]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:14},children:[(0,f.jsx)(D,{label:"Category",children:(0,f.jsxs)("select",{value:b.category,onChange:e=>y((0,m.A)((0,m.A)({},b),{},{category:e.target.value})),style:(0,m.A)((0,m.A)({},pa),{},{cursor:"pointer"}),children:[(0,f.jsx)("option",{value:"",children:"Select category"}),_.map(e=>(0,f.jsx)("option",{value:e.value,children:e.label},e.value))]})}),(0,f.jsx)(D,{label:"Code",children:(0,f.jsx)("input",{placeholder:"e.g., VID_COMBO_FULL",value:b.code,onChange:e=>y((0,m.A)((0,m.A)({},b),{},{code:e.target.value})),style:(0,m.A)((0,m.A)({},pa),{},{fontFamily:da})})}),(0,f.jsx)(D,{label:"Unit",children:(0,f.jsxs)("select",{value:b.unit,onChange:e=>y((0,m.A)((0,m.A)({},b),{},{unit:e.target.value})),style:(0,m.A)((0,m.A)({},pa),{},{cursor:"pointer"}),children:[(0,f.jsx)("option",{value:"",children:"Select unit"}),C.map(e=>(0,f.jsx)("option",{value:e.value,children:e.label},e.value))]})}),(0,f.jsx)("div",{style:{gridColumn:"span 2"},children:(0,f.jsx)(D,{label:"Label",children:(0,f.jsx)("input",{placeholder:"e.g., Combination (B-Roll + Presentations) - Full Day",value:b.label,onChange:e=>y((0,m.A)((0,m.A)({},b),{},{label:e.target.value})),style:pa})})}),(0,f.jsx)(D,{label:"Price (ex-GST)",children:(0,f.jsx)("input",{type:"number",placeholder:"e.g., 3400.00",value:b.base_price_ex,onChange:e=>y((0,m.A)((0,m.A)({},b),{},{base_price_ex:e.target.value})),style:(0,m.A)((0,m.A)({},pa),{},{fontFamily:da})})})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:18},children:[(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13.5,fontWeight:500,cursor:"pointer"},children:[(0,f.jsx)("input",{type:"checkbox",checked:b.active,onChange:e=>y((0,m.A)((0,m.A)({},b),{},{active:e.target.checked})),style:{width:16,height:16,accentColor:"#BF212F",cursor:"pointer"}}),"Active"]}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,marginLeft:"auto"},children:[(0,f.jsx)("button",{onClick:()=>u(!1),style:{background:"#fff",color:"#55555C",border:"1px solid #E4E4E9",borderRadius:9,padding:"10px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer"},children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{try{if(!(await fetch("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL,"/api/admin/packages/items"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify((0,m.A)((0,m.A)({},b),{},{base_price_ex:parseFloat(b.base_price_ex)}))})).ok)throw new Error("Failed to create item");S({type:"success",text:"Item created successfully!"}),F(),u(!1),y({category:"",code:"",label:"",unit:"",base_price_ex:"",active:!0}),setTimeout(()=>S({type:"",text:""}),3e3)}catch(e){S({type:"error",text:"Error creating item. Please try again."}),setTimeout(()=>S({type:"",text:""}),3e3)}},disabled:!b.category||!b.code||!b.label||!b.unit||!b.base_price_ex,className:"tg-btn-primary",style:{display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer",opacity:b.category&&b.code&&b.label&&b.unit&&b.base_price_ex?1:.5},children:[(0,f.jsx)(ia.A,{size:16})," Create Item"]})]})]})]}),o?(0,f.jsx)(Ws,{rows:6}):(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},ma),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"16px 22px",borderBottom:"1px solid #EDEDF0",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:[(0,f.jsx)(as.A,{size:17})," Service Items",(0,f.jsx)("span",{className:"tg-mono",style:{fontFamily:da,fontSize:11,color:"#9A9AA0",marginLeft:4},children:n.length})]}),0===n.length?(0,f.jsx)(Os,{icon:as.A,title:"No items found",message:"Try adjusting your search or category filter, or add a new item."}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:ha,gap:12,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:da,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Category"}),(0,f.jsx)("span",{children:"Code"}),(0,f.jsx)("span",{children:"Label"}),(0,f.jsx)("span",{children:"Unit"}),(0,f.jsx)("span",{children:"Price ex-GST"}),(0,f.jsx)("span",{children:"Status"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Actions"})]}),n.map(e=>{const t=c===e.id;return(0,f.jsxs)("div",{className:"tg-row",style:{display:"grid",gridTemplateColumns:ha,gap:12,alignItems:"center",padding:"14px 22px",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsx)("div",{children:(0,f.jsx)(Ds,{tone:ua[e.category]||"gray",children:z(e.category)})}),(0,f.jsx)("div",{children:t?(0,f.jsx)("input",{value:p.code,onChange:e=>x((0,m.A)((0,m.A)({},p),{},{code:e.target.value})),style:(0,m.A)((0,m.A)({},I),{},{fontFamily:da})}):(0,f.jsx)("code",{style:{fontFamily:da,fontSize:11.5,background:"#F1F5F9",color:"#475569",padding:"3px 7px",borderRadius:6},children:e.code})}),(0,f.jsx)("div",{style:{minWidth:0},children:t?(0,f.jsx)("input",{value:p.label,onChange:e=>x((0,m.A)((0,m.A)({},p),{},{label:e.target.value})),style:I}):(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600,color:"#0A0A0B"},children:e.label})}),(0,f.jsx)("div",{children:t?(0,f.jsx)("select",{value:p.unit,onChange:e=>x((0,m.A)((0,m.A)({},p),{},{unit:e.target.value})),style:(0,m.A)((0,m.A)({},I),{},{cursor:"pointer"}),children:C.map(e=>(0,f.jsx)("option",{value:e.value,children:e.label},e.value))}):(0,f.jsx)("span",{style:{fontSize:13,color:"#55555C"},children:B(e.unit)})}),(0,f.jsx)("div",{children:t?(0,f.jsx)("input",{type:"number",value:p.base_price_ex,onChange:e=>x((0,m.A)((0,m.A)({},p),{},{base_price_ex:e.target.value})),style:(0,m.A)((0,m.A)({},I),{},{fontFamily:da})}):(0,f.jsx)(zs,{amount:e.base_price_ex,size:15,mutedSize:11,color:"#BF212F"})}),(0,f.jsx)("div",{children:t?(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12.5,cursor:"pointer"},children:[(0,f.jsx)("input",{type:"checkbox",checked:p.active,onChange:e=>x((0,m.A)((0,m.A)({},p),{},{active:e.target.checked})),style:{width:15,height:15,accentColor:"#BF212F",cursor:"pointer"}}),"Active"]}):(0,f.jsx)(Ds,{tone:e.active?"green":"gray",children:e.active?"Active":"Inactive"})}),(0,f.jsx)("div",{style:{display:"flex",gap:6,justifyContent:"flex-end"},children:t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{onClick:()=>(async e=>{try{if(!(await fetch("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL,"/api/admin/packages/items/").concat(e.id),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({category:e.category,code:e.code,label:e.label,unit:e.unit,base_price_ex:parseFloat(e.base_price_ex),active:e.active})})).ok)throw new Error("Failed to update item");S({type:"success",text:"Item updated successfully!"}),F(),T(),setTimeout(()=>S({type:"",text:""}),3e3)}catch(t){S({type:"error",text:"Error updating item. Please try again."}),setTimeout(()=>S({type:"",text:""}),3e3)}})(p),title:"Save",style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,he
1ight:34,borderRadius:8,background:"#BF212F",color:"#fff",border:"none",cursor:"pointer"},children:(0,f.jsx)(ia.A,{size:15})}),(0,f.jsx)("button",{onClick:T,title:"Cancel",style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,height:34,borderRadius:8,background:"#fff",color:"#55555C",border:"1px solid #E4E4E9",cursor:"pointer"},children:(0,f.jsx)(g.A,{size:15})})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{onClick:()=>(e=>{d(e.id),x((0,m.A)({},e))})(e),title:"Edit",style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,height:34,borderRadius:8,background:"#fff",color:"#55555C",border:"1px solid #E4E4E9",cursor:"pointer"},children:(0,f.jsx)(oa.A,{size:15})}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete this item? This action cannot be undone."))try{if(!(await fetch("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL,"/api/admin/packages/items/").concat(e),{method:"DELETE"})).ok)throw new Error("Failed to delete item");S({type:"success",text:"Item deleted successfully!"}),F(),setTimeout(()=>S({type:"",text:""}),3e3)}catch(t){S({type:"error",text:"Error deleting item. Please try again."}),setTimeout(()=>S({type:"",text:""}),3e3)}})(e.id),title:"Delete",style:{display:"flex",alignItems:"center",justifyContent:"center",width:34,height:34,borderRadius:8,background:"#fff",color:"#991B1B",border:"1px solid #FECACA",cursor:"pointer"},children:(0,f.jsx)(la.A,{size:15})})]})})]},e.id)})]})]})]})})},fa=()=>{const e=(0,r.Zp)();return(0,f.jsx)(ta,{title:"Rules & Surcharges",meta:"SALES \xb7 PACKAGES",children:(0,f.jsxs)("div",{style:{maxWidth:760},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>e("/admin/packages"),style:{display:"inline-flex",alignItems:"center",gap:8,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12.5,fontWeight:600,color:"#55555C",cursor:"pointer",marginBottom:18},children:[(0,f.jsx)(Ct.A,{size:15})," Back to Dashboard"]}),(0,f.jsxs)(Ls,{style:{padding:"52px 28px",textAlign:"center"},children:[(0,f.jsx)("div",{style:{width:54,height:54,borderRadius:14,background:"#F7F7F9",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",color:"#B5B5BC"},children:(0,f.jsx)(tt.A,{size:26})}),(0,f.jsx)("div",{style:{fontFamily:"'Space Mono',monospace",fontSize:10.5,letterSpacing:"0.08em",textTransform:"uppercase",color:"#9A9AA0"},children:"Coming in next update"}),(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:18,color:"#0A0A0B",margin:"4px 0 0"},children:"Rules Management"}),(0,f.jsx)("p",{style:{fontSize:13.5,color:"#9A9AA0",maxWidth:420,margin:"10px auto 0",lineHeight:1.6},children:"Configure surcharge rules for weekends, after-hours, rush orders, and more."}),(0,f.jsx)("ul",{style:{listStyle:"none",padding:0,margin:"24px auto 0",maxWidth:360,textAlign:"left",display:"grid",gap:8},children:["Weekend surcharge configuration","After-hours pricing rules","Rush order surcharges","Public holiday rates","Rule ordering and priority"].map(e=>(0,f.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:10,fontSize:13,color:"#55555C",background:"#FBFBFC",border:"1px solid #E4E4E9",borderRadius:9,padding:"10px 13px"},children:[(0,f.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:"#BF212F",flexShrink:0}}),e]},e))})]})]})})};var ba=s(5379);const ya="'Space Mono',monospace",va={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},ja={Requested:"amber",Approved:"green",Booked:"blue",Rejected:"danger"},wa={display:"inline-flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},Na={background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},Aa={width:"100%",boxSizing:"border-box",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},ka=e=>{try{return new Date(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric"})}catch(t){return e}},Sa=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)([]),[o,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)(""),[p,x]=(0,a.useState)("all"),[h,u]=(0,a.useState)(null),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(null),[S,F]=(0,a.useState)(""),[E,T]=(0,a.useState)("");(0,a.useEffect)(()=>{z()},[]),(0,a.useEffect)(()=>{B()},[t,c,p]);const z=async()=>{try{l(!0);const e=await fetch("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL,"/api/admin/packages/quotes"));if(e.ok){const t=await e.json();s(t)}}catch(e){console.error("Error fetching quotes:",e)}finally{l(!1)}},B=()=>{let e=t;c&&(e=e.filter(e=>{var t;return e.event_name.toLowerCase().includes(c.toLowerCase())||e.client_name.toLowerCase().includes(c.toLowerCase())||(null===(t=e.company)||void 0===t?void 0:t.toLowerCase().includes(c.toLowerCase()))}
1)),"all"!==p&&(e=e.filter(e=>e.status===p)),i(e)},D=e=>{let{status:t}=e;return(0,f.jsx)(Ds,{tone:ja[t]||"gray",children:t})};return(0,f.jsxs)(ta,{title:"Quote Management",meta:"SALES \xb7 PACKAGES",children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},va),{},{padding:"14px 16px",marginBottom:18,display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:220},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{value:c,onChange:e=>d(e.target.value),placeholder:"Search event, client or company\u2026",style:{border:"none",background:"transparent",outline:"none",fontSize:13.5,width:"100%",color:"#0A0A0B"}})]}),(0,f.jsxs)("select",{value:p,onChange:e=>x(e.target.value),style:Na,children:[(0,f.jsx)("option",{value:"all",children:"All statuses"}),(0,f.jsx)("option",{value:"Requested",children:"Requested"}),(0,f.jsx)("option",{value:"Approved",children:"Approved"}),(0,f.jsx)("option",{value:"Booked",children:"Booked"}),(0,f.jsx)("option",{value:"Rejected",children:"Rejected"})]}),(0,f.jsxs)("button",{style:(0,m.A)({},wa),children:[(0,f.jsx)(es.A,{size:14})," Export CSV"]})]}),o?(0,f.jsx)(Ws,{rows:6}):0===n.length?(0,f.jsx)(Os,{icon:ds.A,title:"No quotes found",message:c||"all"!==p?"Try adjusting your search or status filter.":"Quote requests will appear here as they are submitted."}):(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:n.map(t=>(0,f.jsx)("div",{className:"tg-tile",style:(0,m.A)((0,m.A)({},va),{},{padding:"18px 20px"}),children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0,1.8fr) 150px 150px",gap:18,alignItems:"center"},className:"tg-quote-grid",children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:8,flexWrap:"wrap"},children:[(0,f.jsx)("h3",{style:{margin:0,fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,letterSpacing:"-0.01em"},children:t.event_name}),(0,f.jsx)(D,{status:t.status})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,flexWrap:"wrap",fontSize:12.5,color:"#9A9AA0",marginBottom:8},children:[(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontFamily:ya},children:[(0,f.jsx)(_t.A,{size:13})," ",t.event_date]}),(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5},children:[(0,f.jsx)(C.A,{size:13})," ",t.venue]})]}),(0,f.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:13,color:"#55555C"},children:[(0,f.jsx)(Ye.A,{size:14,color:"#9A9AA0"}),(0,f.jsx)("span",{style:{fontWeight:600},children:t.client_name}),t.company&&(0,f.jsxs)("span",{style:{color:"#9A9AA0"},children:["\xb7 ",t.company]})]})]}),(0,f.jsxs)("div",{style:{textAlign:"right"},children:[(0,f.jsx)("div",{children:(0,f.jsx)(zs,{amount:t.total_inc,size:22,mutedSize:13})}),(0,f.jsx)("div",{style:{fontFamily:ya,fontSize:10.5,letterSpacing:"0.08em",color:"#9A9AA0",marginTop:4},children:"INC GST"}),(0,f.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:12,color:"#9A9AA0",marginTop:6},children:[(0,f.jsx)(Xe.A,{size:13})," ",t.attendees," attendees"]})]}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:10},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsxs)("button",{onClick:()=>e("/packages/quote/".concat(t.id)),className:"tg-btn-primary",style:{display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"9px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,f.jsx)(_.A,{size:14})," View Quote"]}),(0,f.jsxs)("div",{className:"tg-kebab",style:{position:"relative"},children:[(0,f.jsx)("button",{onClick:()=>u(h===t.id?null:t.id),style:{width:36,height:36,borderRadius:9,background:"#fff",border:"1px solid #E4E4E9",color:"#55555C",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(ba.A,{size:18})}),h===t.id&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{position:"fixed",inset:0,zIndex:25},onClick:()=>u(null)}),(0,f.jsxs)("div",{style:{position:"absolute",right:0,top:"calc(100% + 6px)",zIndex:30,background:"#fff",border:"1px solid #E4E4E9",borderRadius:11,boxShadow:"0 12px 32px rgba(10,10,11,.12)",padding:6,minWidth:180},children:[(0,f.jsxs)("button",{onClick:()=>{u(null),(e=>{k(e),F(e.status),T(""),N(!0)})(t)},style:{width:"100%",display:"flex",alignItems:"center",gap:9,background:"none",border:"none",borderRadius:8,padding:"9px 11px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer",textAlign:"left"},children:[(0,f.jsx)(Je.A,{size:15})," Change Status"]}),(0,f.jsxs)("button",{onClick:()=>{u(null),(e=>{j(e),y(!0)})(t)},style:{width:"100%",display:"flex",alignItems:"center",gap:9,background:"none",border:"none",borderRadius:8,padding:"9px 11px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,color:"#991B1B",cursor:"pointer",textAlign:"left"},children:[(0,f.jsx)(la.A,{size:15})," Delete Quote"]})]})]})]})]}),(0,f.jsx)("div",{style:{fontFamily:ya,fontSize:11,color:"#9A9AA0"},children:ka(t.created_at)})]})]})},t.id))}),b&&(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(10,10,11,.55)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,padding:16},children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},va),{},{maxWidth:460,width:"100%",overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11},children:[(0,f.jsx)("span",{style:{width:32,height:32,borderRadius:8,background:"#FEE2E2",color:"#991B1B",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(la.A,{size:16})}),(0,f.jsx)("h3",{style:{margin:0,fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16},children:"Delete Quote"})]}),(0,f.jsx)("button",{onClick:()=>y(!1),style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex",padding:4},children:(0,f.jsx)(g.A,{size:18})})]}),(0,f.jsxs)("div",{style:{padding:22},children:[(0,f.jsx)("p",{style:{margin:"0 0 16px",fontSize:13,color:"#55555C",lineHeight:1.5},children:"Are you sure you want to delete this quote? This action cannot be undone."}),v&&(0,f.jsxs)("div",{style:{background:"#FBFBFC",border:"1px solid #EDEDF0",borderRadius:11,padding:14,marginBottom:18},children:[(0,f.jsx)("div",{style:{fontWeight:700,fontSize:14},children:v.event_name}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:"#9A9AA0",marginTop:3},children:[v.client_name," \xb7 ",v.event_date]}),(0,f.jsxs)("div",{style:{marginTop:8},children:[(0,f.jsx)(zs,{amount:v.total_inc,size:16,mutedSize:11,color:"#BF212F"})," ",(0,f.jsx)("span",{style:{fontSize:11,color:"#9A9AA0"},children:"inc GST"})]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:10},children:[(0,f.jsx)("button",{onClick:()=>y(!1),style:{flex:1,padding:"11px 16px",border:"1px solid #E4E4E9",background:"#fff",color:"#333",borderRadius:9,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>
1{if(v)try{(await fetch("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL,"/api/admin/packages/quotes/").concat(v.id),{method:"DELETE"})).ok?(s(t.filter(e=>e.id!==v.id)),y(!1),j(null)):(console.error("Failed to delete quote"),alert("Failed to delete quote. Please try again."))}catch(e){console.error("Error deleting quote:",e),alert("Error deleting quote. Please try again.")}},className:"tg-btn-primary",style:{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,padding:"11px 16px",border:"none",background:"#BF212F",color:"#fff",borderRadius:9,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer"},children:[(0,f.jsx)(la.A,{size:15})," Delete Quote"]})]})]})]})}),w&&(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(10,10,11,.55)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,padding:16},children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},va),{},{maxWidth:480,width:"100%",overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11},children:[(0,f.jsx)("span",{style:{width:32,height:32,borderRadius:8,background:"#EEF2FF",color:"#4338CA",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(Je.A,{size:16})}),(0,f.jsx)("h3",{style:{margin:0,fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16},children:"Update Quote Status"})]}),(0,f.jsx)("button",{onClick:()=>N(!1),style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex",padding:4},children:(0,f.jsx)(g.A,{size:18})})]}),A&&(0,f.jsxs)("div",{style:{padding:22},children:[(0,f.jsxs)("div",{style:{background:"#FBFBFC",border:"1px solid #EDEDF0",borderRadius:11,padding:14,marginBottom:18},children:[(0,f.jsx)("div",{style:{fontWeight:700,fontSize:14},children:A.event_name}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:"#9A9AA0",marginTop:3},children:[A.client_name," \xb7 ",A.event_date]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:10},children:[(0,f.jsx)("span",{style:{fontSize:12,color:"#9A9AA0"},children:"Current:"}),(0,f.jsx)(D,{status:A.status})]})]}),(0,f.jsx)("label",{style:{display:"block",fontFamily:ya,fontSize:10.5,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:8},children:"New Status"}),(0,f.jsxs)("select",{value:S,onChange:e=>F(e.target.value),style:(0,m.A)((0,m.A)({},Aa),{},{cursor:"pointer",marginBottom:16}),children:[(0,f.jsx)("option",{value:"Requested",children:"Requested"}),(0,f.jsx)("option",{value:"Approved",children:"Approved"}),(0,f.jsx)("option",{value:"Booked",children:"Booked"}),(0,f.jsx)("option",{value:"Rejected",children:"Rejected"})]}),(0,f.jsx)("label",{style:{display:"block",fontFamily:ya,fontSize:10.5,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:8},children:"Notes (Optional)"}),(0,f.jsx)("input",{value:E,onChange:e=>T(e.target.value),placeholder:"Add notes about this status change\u2026",style:(0,m.A)((0,m.A)({},Aa),{},{marginBottom:18})}),(0,f.jsxs)("div",{style:{display:"flex",gap:10},children:[(0,f.jsx)("button",{onClick:()=>N(!1),style:{flex:1,padding:"11px 16px",border:"1px solid #E4E4E9",background:"#fff",color:"#333",borderRadius:9,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{if(A&&S)try{const e=new URL("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL,"/api/admin/packages/quotes/").concat(A.id,"/status"));e.searchParams.append("status",S),E.trim()&&e.searchParams.append("notes",E.trim());(await fetch(e.toString(),{method:"PUT"})).ok?(s(t.map(e=>e.id===A.id?(0,m.A)((0,m.A)({},e),{},{status:S}):e)),N(!1),k(null),F(""),T("")):(console.error("Failed to update quote status"),alert("Failed to update quote status. Please try again."))}catch(e){console.error("Error updating quote status:",e),alert("Error updating quote status. Please try again.")}},disabled:!S,className:"tg-btn-primary",style:{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,padding:"11px 16px",border:"none",background:"#BF212F",color:"#fff",borderRadius:9,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",opacity:S?1:.6},children:[(0,f.jsx)(zt.A,{size:15})," Update Status"]})]})]})]})})]})},_a=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)({tax_enabled:!0,gst_rate:.1,currency:"AUD",timezone:"Australia/Brisbane",abn:"18 150 556 102",company_name:"Turbo Productions PTY LTD",company_hq:"Barwon Heads, Victoria",contact_phone:"1300 207 446",contact_email:"[email protected]"}),[n,i]=(0,a.useState)(!1),[o,l]=(0,a.useState)({type:"",text:""}),c={fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,color:"#0A0A0B",margin:0},d={fontFamily:"'Space Mono',monospace",fontSize:10.5,letterSpacing:"0.08em",textTransform:"uppercase",color:"#9A9AA0"},x={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"}
1,u={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",background:"#FBFBFC",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",boxSizing:"border-box"},g={padding:20,marginBottom:16};return(0,f.jsx)(ta,{title:"Package Settings",meta:"SALES \xb7 PACKAGES",children:(0,f.jsxs)("div",{style:{maxWidth:760},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:18,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>e("/admin/packages"),style:{display:"inline-flex",alignItems:"center",gap:8,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12.5,fontWeight:600,color:"#55555C",cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{size:15})," Back to Dashboard"]}),(0,f.jsxs)("button",{type:"button",onClick:async()=>{try{i(!0),l({type:"success",text:"Settings saved successfully!"}),setTimeout(()=>l({type:"",text:""}),3e3)}catch(e){l({type:"error",text:"Error saving settings. Please try again."}),setTimeout(()=>l({type:"",text:""}),3e3)}finally{i(!1)}},disabled:n,style:(0,m.A)((0,m.A)({},{display:"inline-flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer"}),{},{opacity:n?.6:1}),children:[(0,f.jsx)(ia.A,{size:15}),n?"Saving...":"Save Settings"]})]}),o.text&&(0,f.jsxs)("div",{style:{marginBottom:16,padding:"10px 13px",borderRadius:9,display:"flex",alignItems:"center",gap:8,background:"success"===o.type?"#DCFCE7":"#FEE2E2",border:"1px solid ".concat("success"===o.type?"#BBF7D0":"#FECACA")},children:["success"===o.type?(0,f.jsx)(p.A,{className:"h-5 w-5",style:{color:"#15803D"}}):(0,f.jsx)(h.A,{className:"h-5 w-5",style:{color:"#991B1B"}}),(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"success"===o.type?"#15803D":"#991B1B"},children:o.text})]}),(0,f.jsxs)(Ls,{style:g,children:[(0,f.jsxs)("div",{style:{marginBottom:16},children:[(0,f.jsx)("div",{style:d,children:"Pricing"}),(0,f.jsx)("h3",{style:(0,m.A)((0,m.A)({},c),{},{marginTop:3}),children:"Tax & Currency"})]}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",marginBottom:16},children:[(0,f.jsx)("input",{type:"checkbox",checked:t.tax_enabled,onChange:e=>s((0,m.A)((0,m.A)({},t),{},{tax_enabled:e.target.checked})),style:{width:16,height:16,accentColor:"#BF212F",cursor:"pointer"}}),(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600,color:"#0A0A0B"},children:"Enable Tax Calculations"})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:x,children:"GST Rate (%)"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:100*t.gst_rate,onChange:e=>s((0,m.A)((0,m.A)({},t),{},{gst_rate:parseFloat(e.target.value)/100})),style:u}),(0,f.jsxs)("p",{style:{fontSize:12,color:"#9A9AA0",marginTop:6},children:["Current: ",(100*t.gst_rate).toFixed(1),"%"]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:x,children:"Currency"}),(0,f.jsx)("input",{value:t.currency,onChange:e=>s((0,m.A)((0,m.A)({},t),{},{currency:e.target.value})),style:u})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:x,children:"Timezone"}),(0,f.jsx)("input",{value:t.timezone,onChange:e=>s((0,m.A)((0,m.A)({},t),{},{timezone:e.target.value})),style:u})]})]})]}),(0,f.jsxs)(Ls,{style:g,children:[(0,f.jsxs)("div",{style:{marginBottom:16},children:[(0,f.jsx)("div",{style:d,children:"Business"}),(0,f.jsx)("h3",{style:(0,m.A)((0,m.A)({},c),{},{marginTop:3}),children:"Company Details"})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:x,children:"Company Name"}),(0,f.jsx)("input",{value:t.company_name,onChange:e=>s((0,m.A)((0,m.A)({},t),{},{company_name:e.target.value})),style:u})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:x,children:"ABN"}),(0,f.jsx)("input",{value:t.abn,onChange:e=>s((0,m.A)((0,m.A)({},t),{},{abn:e.target.value})),style:u})]})]}),(0,f.jsxs)("div",{style:{marginTop:12},children:[(0,f.jsx)("label",{style:x,children:"Headquarters Location"}),(0,f.jsx)("input",{value:t.company_hq,onChange:e=>s((0,m.A)((0,m.A)({},t),{},{company_hq:e.target.value})),style:u})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12,marginTop:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:x,children:"Contact Phone"}),(0,f.jsx)("input",{value:t.contact_phone,onChange:e=>s((0,m.A)((0,m.A)({},t),{},{contact_phone:e.target.value})),style:u})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:x,children:"Contact Email"}),(0,f.jsx)("input",{type:"email",value:t.contact_email,onChange:e=>s((0,m.A)((0,m.A)({},t),{},{contact_email:e.target.value})),style:u})]})]})]}),(0,f.jsxs)(Ls,{style:g,children:[(0,f.jsxs)("div",{style:{marginBottom:16},children:[(0,f.jsx)("div",{style:d,children:"Live Preview"}),(0,f.jsx)("h3",{style:(0,m.A)((0,m.A)({},c),{},{marginTop:3}),children:"Quote Footer Preview"})]}),(0,f.jsx)("div",{style:{background:"#FBFBFC",border:"1px solid #E4E4E9",borderRadius:11,padding:18},children:(0,f.jsxs)("div",{style:{fontSize:13,color:"#55555C",lineHeight:1.7},children:[(0,f.jsx)("p",{style:{margin:0,fontWeight:700,color:"#0A0A0B"},children:t.company_name}),(0,f.jsxs)("p",{style:{margin:0},children:["ABN ",t.abn]}),(0,f.jsxs)("p",{style:{margin:0},children:["HQ: ",t.company_hq]}),(0,f.jsxs)("p",{style:{margin:0},children:["Phone: ",t.contact_phone]}),(0,f.jsxs)("p",{style:{margin:0},children:["Email: ",t.contact_email]}),(0,f.jsxs)("div",{style:{marginTop:12,paddingTop:12,borderTop:"1px solid #E4E4E9"},children:[(0,f.jsxs)("p",{style:{margin:0},children:["Currency: ",t.currency]}),(0,f.jsxs)("p",{style:{margin:0}
1,children:["Tax Rate: ",t.tax_enabled?"".concat((100*t.gst_rate).toFixed(1),"% GST"):"Tax Disabled"]}),(0,f.jsxs)("p",{style:{margin:0},children:["Timezone: ",t.timezone]})]})]})})]})]})})},Ca=()=>{const[e]=(0,r.ok)(),t=(0,r.Zp)(),[s,n]=(0,a.useState)(""),[i,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)(""),[d,m]=(0,a.useState)(""),[p,x]=(0,a.useState)("email"),u=e.get("token"),g=e.get("quote");(0,a.useEffect)(()=>{u&&y()},[u]);const b=async()=>{if(!s.trim())return c("Please enter your email address"),void m("error");o(!0);try{const e=await fetch("".concat(I.fn,"/api/customer/magic-link"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s.trim()})}),t=await e.json();t.success?(x("sent"),c(t.message),m("success")):(c(t.message),m("error"))}catch(e){c("Failed to send magic link. Please try again."),m("error")}finally{o(!1)}},y=async()=>{x("verifying"),o(!0);try{const e=await fetch("".concat(I.fn,"/api/customer/verify-magic-link"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:u})}),s=await e.json();s.success?(localStorage.setItem("customer_session_token",s.session_token),localStorage.setItem("customer_email",s.email),t(g?"/customer/quote/".concat(g):"/customer/dashboard")):(c(s.message),m("error"),x("email"))}catch(e){c("Failed to verify magic link. Please try again."),m("error"),x("email")}finally{o(!1)}};return(0,f.jsx)("div",{className:"min-h-screen bg-dark-bg flex items-center justify-center py-12 px-4",children:(0,f.jsxs)("div",{className:"w-full max-w-md",children:[(0,f.jsxs)("div",{className:"text-center mb-8",children:[(0,f.jsx)("h1",{className:"text-3xl font-bold text-turbo-red",children:"TURBO 360"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"Professional Event Photography & Video Production"})]}),(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800",children:(0,f.jsxs)(rt.Wu,{className:"p-6",children:["email"===p&&(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)(T.A,{className:"h-16 w-16 text-turbo-red mx-auto mb-4"}),(0,f.jsx)("h2",{className:"text-2xl font-bold text-white mb-2",children:"Access Your Quotes"}),(0,f.jsx)("p",{className:"text-gray-400",children:"Enter your email address to receive a secure login link"})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-300",children:"Email Address"}),(0,f.jsx)(Ht,{type:"email",placeholder:"[email protected]",value:s,onChange:e=>n(e.target.value),className:"bg-gray-900 border-gray-700 text-white",onKeyPress:e=>"Enter"===e.key&&b()})]}),(0,f.jsx)(it.$,{onClick:b,disabled:i||!s.trim(),className:"w-full btn-turbo-primary",children:i?(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),(0,f.jsx)("span",{children:"Sending..."})]}):(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Send Magic Link"})]})})]}),l&&(0,f.jsxs)($t,{className:"".concat("error"===d?"bg-red-900/20 border-red-700":"bg-blue-900/20 border-blue-700"),children:[(0,f.jsx)(h.A,{className:"h-4 w-4 ".concat("error"===d?"text-red-400":"text-blue-400")}),(0,f.jsx)(Qt,{className:"".concat("error"===d?"text-red-300":"text-blue-300"),children:l})]}),(0,f.jsx)("div",{className:"text-center",children:(0,f.jsxs)("p",{className:"text-sm text-gray-500",children:["Don't have any quotes yet?"," ",(0,f.jsx)("button",{onClick:()=>t("/packages"),className:"text-turbo-red hover:text-orange-400 underline",children:"Create a quote"})]})})]}),"sent"===p&&(0,f.jsxs)("div",{className:"space-y-6 text-center",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(zt.A,{className:"h-16 w-16 text-green-500 mx-auto mb-4"}),(0,f.jsx)("h2",{className:"text-2xl font-bold text-white mb-2",children:"Check Your Email"}),(0,f.jsxs)("p",{className:"text-gray-400",children:["We've sent a secure login link to ",(0,f.jsx)("strong",{className:"text-white",children:s})]})]}),(0,f.jsxs)($t,{className:"bg-blue-900/20 border-blue-700 text-left",children:[(0,f.jsx)(T.A,{className:"h-4 w-4 text-blue-400"}),(0,f.jsxs)(Qt,{className:"text-blue-300",children:[(0,f.jsx)("strong",{children:"Next steps:"}),(0,f.jsxs)("ol",{className:"mt-2 space-y-1 list-decimal list-inside",children:[(0,f.jsx)("li",{children:"Check your email inbox (and spam folder)"}),(0,f.jsx)("li",{children:'Click the "Access Your Account" button'}),(0,f.jsx)("li",{children:"You'll be automatically logged in"})]})]})]}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsx)(it.$,{onClick:()=>x("email"),variant:"outline",className:"w-full",children:"Try Different Email"}),(0,f.jsx)("p",{className:"text-xs text-gray-500",children:"The link will expire in 1 hour for security"})]})]}),"verifying"===p&&(0,f.jsxs)("div",{className:"space-y-6 text-center",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-b-2 border-turbo-red mx-auto mb-4"}),(0,f.jsx)("h2",{className:"text-2xl font-bold text-white mb-2",children:"Verifying..."}),(0,f.jsx)("p",{className:"text-gray-400",children:"Please wait while we verify your magic link"})]}),l&&(0,f.jsxs)($t,{className:"bg-red-900/20 border-red-700",children:[(0,f.jsx)(h.A,{className:"h-4 w-4 text-red-400"}),(0,f.jsx)(Qt,{className:"text-red-300",children:l})]})]})]})}),(0,f.jsx)("div",{className:"text-center mt-8",children:(0,f.jsxs)("button",{onClick:()=>t("/packages"),className:"text-gray-500 hover:text-gray-300 text-sm flex items-center justify-center space-x-1",children:[(0,f.jsx)("span",{children:"Back to Package Builder"}),(0,f.jsx)(S.A,{className:"h-3 w-3"})]})})]})})},Fa=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),[o,l]=(0,a.useState)("");(0,a.useEffect)(()=>{const t=localStorage.getItem("customer_session_token"),s=localStorage.getItem("customer_email");t?(l(s||""),c(t)):e("/customer/auth")},[e]);const c=async t=>{try{const a=await fetch("".concat(I.fn,"/api/customer/quotes?session_token=").concat(t)),n=await a.json();n.success?s(n.quotes):(n.message.includes("session")||n.message.includes("expired"))&&(localStorage.removeItem("customer_session_token"),localStorage.removeItem("customer_email"),e("/customer/auth"))}catch(a){console.error("Error fetching quotes:",a)}finally{i(!1)}},d=e=>{const t={Requested:{color:"bg-yellow-500",text:"Pending Review"},requested:{color:"bg-yellow-500",text:"Pending Review"},Approved:{color:"bg-green-500",text:"Approved"},Booked:{color:"bg-blue-500",text:"Booked"},Rejected:{color:"bg-red-500",text:"Declined"},"Change Requested":{color:"bg-orange-500",text:"Changes Requested"}}[e]||{color:"bg-gray-500",text:e};return(0,f.jsx)(pt,{className:"".concat(t.color," text-white"),children:t.text})},m=e=>{try{return new Date(e).toLocaleDateString("en-AU",{year:"numeric",month:"long",day:"numeric"})}catch(t){return e}};return n?(0,f.jsx)("div",{className:"min-h-screen bg-dark-bg text-white flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-turbo-red mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-400",children:"Loading your quotes..."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-dark-bg text-white",children:[(0,f.jsx)("div",{className:"bg-black/80 border-b border-gray-800",children:(0,f.jsx)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("div",{className:"flex items-center space-x-4",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("h1",{className:"text-2xl font-bold text-turbo-red",children:"TURBO 360"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"Your Quote Dashboard"})]})}),(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-gray-300",children:[(0,f.jsx)(Ye.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"text-sm",children:o})]}),(0,f.jsxs)(it.$,{onClick:()=>{localStorage.removeItem("customer_session_token"),localStorage.removeItem("customer_email"),e("/customer/auth")},variant:"outline",size:"sm",className:"border-gray-600 text-gray-300 hover:text-white",children:[(0,f.jsx)(is.A,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})})}),(0,f.jsxs)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,f.jsxs)("div",{className:"mb-8",children:[(0,f.jsx)("h2",{className:"text-3xl font-bold text-white mb-2",children:"Welcome back!"}),(0,f.jsx)("p",{className:"text-gray-400",children:"Manage your quotes and track the status of your event photography requests."})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-3 gap-6 mb-8",children:[(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800",children:(0,f.jsx)(rt.Wu,{className:"p-6",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"Total Quotes"}),(0,f.jsx)("p",{className:"text-2xl font-bold text-white",children:t.length})]}),(0,f.jsx)(kt.A,{className:"h-8 w-8 text-turbo-red"})]})})}),(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800",children:(0,f.jsx)(rt.Wu,{className:"p-6",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"Pending Review"}),(0,f.jsx)("p",{className:"text-2xl font-bold text-white",children:t.filter(e=>"Requested"===e.status||"requested"===e.status).length})]}),(0,f.jsx)(Nt.A,{className:"h-8 w-8 text-yellow-500"})]})})}),(0,f.jsx)(rt.Zp,{className:"bg-black/40 border-gray-800",children:(0,f.jsx)(rt.Wu,{className:"p-6",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"Approved"}),(0,f.jsx)("p",{className:"text-2xl font-bold text-white",children:t.filter(e=>"Approved"===e.status||"Booked"===e.status).length})]}),(0,f.jsx)(zt.A,{className:"h-8 w-8 text-green-500"})]})})})]}),(0,f.jsxs)(rt.Zp,{className:"bg-black/40 border-gray-800",children:[(0,f.jsx)(rt.aR,{children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)(rt.ZB,{className:"text-white",children:"Your Quotes"}),(0,f.jsx)(it.$,{onClick:()=>e("/packages"),className:"btn-turbo-primary",children:"Create New Quote"})]})}),(0,f.jsx)(rt.Wu,{children:t.length>0?(0,f.jsx)("div",{className:"space-y-4",children:t.map(t=>(0,f.jsx)(rt.Zp,{className:"bg-gray-900/40 border-gray-700 hover:border-gray-600 transition-colors",children:(0,f.jsx)(rt.Wu,{className:"p-6",children:(0,f.jsxs)("div",{className:"grid lg:grid-cols-4 gap-6",children:[(0,f.jsxs)("div",{className:"lg:col-span-2",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-xl font-bold text-white mb-1",children:t.event_name}),(0,f.jsxs)("div",{className:"flex items-center text-gray-400 text-sm space-x-4",children:[(0,f.jsxs)("span",{className:"flex items-center",children:[(0,f.jsx)(_t.A,{className:"mr-1 h-4 w-4"}),m(t.event_date)]}),(0,f.jsxs)("span",{className:"flex items-center",children:[(0,f.jsx)(C.A,{className:"mr-1 h-4 w-4"}),t.venue]})]})]}),d(t.status)]}),(0,f.jsxs)("div",{className:"text-xs text-gray-500",children:["Quote #",t.id.slice(-8).toUpperCase()," \u2022 Created ",m(t.created_at)]})]}),(0,f.jsx)("div",{children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsxs)("div",{className:"text-2xl font-bold text-turbo-red mb-1",children:["$",t.total_inc.toFixed(0)]}),(0,f.jsx)("div",{className:"text-xs text-gray-400",children:"inc GST"})]})}),(0,f.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,f.jsxs)(it.$,{onClick:()=>e("/customer/quote/".concat(t.id)),className:"btn-turbo-primary",size:"sm",children:[(0,f.jsx)(_.A,{className:"mr-2 h-4 w-4"}),"View Quote"]}),(0,f.jsxs)(it.$,{onClick:()=>e("/packages/quote/".concat(t.id)),variant:"outline",size:"sm",className:"border-gray-600 text-gray-300 hover:text-white",children:[(0,f.jsx)(es.A,{className:"mr-2 h-4 w-4"}),"Download PDF"]})]})]})})},t.id))}):(0,f.jsxs)("div",{className:"text-center py-12",children:[(0,f.jsx)(kt.A,{className:"h-16 w-16 text-gray-600 mx-auto mb-4"}),(0,f.jsx)("h3",{className:"text-xl font-semibold text-white mb-2",children:"No Quotes Yet"}),(0,f.jsx)("p",{className:"text-gray-400 mb-6",children:"Create your first quote to get started with Turbo 360's professional event photography services."}),(0,f.jsx)(it.$,{onClick:()=>e("/packages"),className:"btn-turbo-primary",children:"Create Your First Quote"})]})})]}),(0,f.jsxs)($t,{className:"bg-blue-900/20 border-blue-700 mt-8",children:[(0,f.jsx)(T.A,{className:"h-4 w-4 text-blue-400"}),(0,f.jsxs)(Qt,{className:"text-blue-300",children:[(0,f.jsx)("strong",{children:"Need help?"})," Contact us at"," ",(0,f.jsx)("a",{href:"mailto:[email protected]",className:"underline hover:text-blue-200",children:"[email protected]"})," ","or call"," ",(0,f.jsx)("a",{href:"tel:1300207446",className:"underline hover:text-blue-200",children:"1300 207 446"})]})]})]})]})};var Ea=s(65598);const Ta=()=>{const{quoteId:e}=(0,r.g)(),t=(0,r.Zp)(),[s,n]=(0,a.useState)(null),[i,o]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,p]=(0,a.useState)(!1),[x,u]=(0,a.useState)(""),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(""),[S,_]=(0,a.useState)("");(0,a.useEffect)(()=>{const e=localStorage.getItem("customer_session_token"),s=localStorage.getItem("customer_email");e?(u(s||""),C()):t("/customer/auth")},[e,t]);const C=async()=>{try{const s=await fetch("".concat(I.fn,"/api/quote/").concat(e)),a=await s.json();s.ok?(n(a.quote),o(a.items)):t("/customer/dashboard")}catch(s){console.error("Error fetching quote:",s),t("/customer/dashboard")}finally{c(!1)}},F=async function(s){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const i=localStorage.getItem("customer_session_token");if(i){p(!0);try{const t=(0,m.A)((0,m.A)({action:s},a&&{notes:a}),r&&{requested_changes:r}),o=await fetch("".concat(I.fn,"/api/customer/quote/").concat(e,"/action?session_token=").concat(i),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),l=await o.json();l.success?(n(e=>(0,m.A)((0,m.A)({},e),{},{status:l.new_status})),y(!1),j(!1),N(!1),k(""),_(""),alert("Quote ".concat(s,"ed successfully! The team has been notified."))):alert(l.message)}catch(o){console.error("Error submitting quote action:",o),alert("Failed to submit action. Please try again.")}finally{p(!1)}}else t("/customer/auth")},E=e=>{if(!e)return"";try{const[t,s]=e.split(":"),a=new Date;return a.setHours(parseInt(t,10),parseInt(s,10)),a.toLocaleTimeString("en-AU",{hour:"numeric",minute:"2-digit",hour12:!0})}catch(t){return e}},T=s&&("Requested"===s.status||"requested"===s.status);return l?(0,f.jsx)("div",{className:"min-h-screen bg-dark-bg text-white flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-turbo-red mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-400",children:"Loading quote details..."})]})}):s?(0,f.jsxs)("div",{className:"min-h-screen bg-dark-bg text-white",children:[(0,f.jsx)("div",{className:"bg-black/80 border-b border-gray-800",children:(0,f.jsx)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsxs)("button",{onClick:()=>
1t("/customer/dashboard"),className:"flex items-center space-x-2 text-gray-300 hover:text-white transition-colors",children:[(0,f.jsx)(Ct.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"text-sm",children:"Back to Dashboard"})]}),(0,f.jsxs)("div",{className:"border-l border-gray-600 pl-4",children:[(0,f.jsxs)("h1",{className:"text-xl font-bold",children:["Quote #",s.id.slice(-8).toUpperCase()]}),(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:s.event_name})]})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(e=>{const t={Requested:{color:"bg-yellow-500",text:"Pending Review"},requested:{color:"bg-yellow-500",text:"Pending Review"},Approved:{color:"bg-green-500",text:"Approved"},Booked:{color:"bg-blue-500",text:"Booked"},Rejected:{color:"bg-red-500",text:"Declined"},"Change Requested":{color:"bg-orange-500",text:"Changes Requested"}}[e]||{color:"bg-gray-500",text:e};return(0,f.jsx)(pt,{className:"".concat(t.color," text-white"),children:t.text})})(s.status),(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-gray-300",children:[(0,f.jsx)(Ye.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"text-sm",children:x})]})]})]})})}),(0,f.jsx)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,f.jsxs)("div",{className:"grid lg:grid-cols-3 gap-8",children:[(0,f.jsxs)("div",{className:"lg:col-span-2 space-y-6",children:[(0,f.jsxs)(rt.Zp,{className:"bg-black/40 border-gray-800",children:[(0,f.jsx)(rt.aR,{children:(0,f.jsxs)(rt.ZB,{className:"flex items-center text-white",children:[(0,f.jsx)(_t.A,{className:"mr-2 h-5 w-5"}),"Event Details"]})}),(0,f.jsx)(rt.Wu,{className:"space-y-4",children:(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"Event Name"}),(0,f.jsx)("p",{className:"text-white font-medium",children:s.event_name})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"Event Date"}),(0,f.jsx)("p",{className:"text-white font-medium",children:(e=>{try{return new Date(e).toLocaleDateString("en-AU",{year:"numeric",month:"long",day:"numeric"})}catch(t){return e}})(s.event_date)})]}),(s.start_time||s.end_time)&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"Start Time"}),(0,f.jsx)("p",{className:"text-white font-medium",children:s.start_time?E(s.start_time):"Not specified"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"End Time"}),(0,f.jsx)("p",{className:"text-white font-medium",children:s.end_time?E(s.end_time):"Not specified"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"Venue"}),(0,f.jsx)("p",{className:"text-white font-medium",children:s.venue})]}),s.attendees&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:"Expected Attendees"}),(0,f.jsx)("p",{className:"text-white font-medium",children:s.attendees})]})]})})]}),(0,f.jsxs)(rt.Zp,{className:"bg-black/40 border-gray-800",children:[(0,f.jsx)(rt.aR,{children:(0,f.jsxs)(rt.ZB,{className:"flex items-center text-white",children:[(0,f.jsx)(kt.A,{className:"mr-2 h-5 w-5"}),"Selected Services"]})}),(0,f.jsx)(rt.Wu,{children:(0,f.jsx)("div",{className:"space-y-3",children:i.map((e,t)=>(0,f.jsxs)("div",{className:"flex justify-between items-center py-3 border-b border-gray-700 last:border-b-0",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-white font-medium",children:e.label}),(0,f.jsxs)("p",{className:"text-gray-400 text-sm",children:[e.qty," \xd7 $",parseFloat(e.unit_price_ex).toFixed(2)," (",e.unit,")"]})]}),(0,f.jsxs)("p",{className:"text-white font-semibold",children:["$",parseFloat(e.line_total_ex).toFixed(2)]})]},t))})})]})]}),(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsxs)(rt.Zp,{className:"bg-black/40 border-gray-800",children:[(0,f.jsx)(rt.aR,{children:(0,f.jsxs)(rt.ZB,{className:"flex items-center text-white",children:[(0,f.jsx)(At.A,{className:"mr-2 h-5 w-5"}),"Quote Summary"]})}),(0,f.jsxs)(rt.Wu,{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between text-gray-300",children:[(0,f.jsx)("span",{children:"Subtotal (ex GST)"}),(0,f.jsxs)("span",{children:["$",parseFloat(s.subtotal_ex).toFixed(2)]})]}),s.surcharges_ex>0&&(0,f.jsxs)("div",{className:"flex justify-between text-gray-300",children:[(0,f.jsx)("span",{children:"Surcharges"}),(0,f.jsxs)("span",{children:["$",parseFloat(s.surcharges_ex).toFixed(2)]})]}),(0,f.jsxs)("div",{className:"flex justify-between text-gray-300",children:[(0,f.jsx)("span",{children:"GST (10%)"}),(0,f.jsxs)("span",{children:["$",parseFloat(s.gst).toFixed(2)]})]}),(0,f.jsx)("div",{className:"border-t border-gray-700 pt-4",children:(0,f.jsxs)("div",{className:"flex justify-between text-xl font-bold text-turbo-red",children:[(0,f.jsx)("span",{children:"Total (inc GST)"}),(0,f.jsxs)("span",{children:["$",parseFloat(s.total_inc).toFixed(2)]})]})})]})]}),(0,f.jsxs)(rt.Zp,{className:"bg-black/40 border-gray-800",children:[(0,f.jsx)(rt.aR,{children:(0,f.jsx)(rt.ZB,{className:"text-white",children:"Actions"})}),(0,f.jsxs)(rt.Wu,{className:"space-y-3",children:[(0,f.jsxs)(it.$,{onClick:()=>window.open("/packages/quote/".concat(s.id),"_blank"),variant:"outline",className:"w-full border-gray-600 text-gray-300 hover:text-white",children:[(0,f.jsx)(es.A,{className:"mr-2 h-4 w-4"}),"Download PDF"]}),T&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(it.$,{onClick:()=>y(!0),className:"w-full bg-green-600 hover:bg-green-700 text-white",children:[(0,f.jsx)(zt.A,{className:"mr-2 h-4 w-4"}),"Accept Quote"]}),(0,f.jsxs)(it.$,{onClick:()=>N(!0),className:"w-full bg-orange-600 hover:bg-orange-700 text-white",children:[(0,f.jsx)(Je.A,{className:"mr-2 h-4 w-4"}),"Request Changes"]}),(0,f.jsxs)(it.$,{onClick:()=>j(!0),variant:"destructive",className:"w-full",children:[(0,f.jsx)(g.A,{className:"mr-2 h-4 w-4"}),"Decline Quote"]})]}),!T&&(0,f.jsxs)($t,{className:"bg-blue-900/20 border-blue-700",children:[(0,f.jsx)(h.A,{className:"h-4 w-4 text-blue-400"}),(0,f.jsxs)(Qt,{className:"text-blue-300 text-sm",children:["This quote has been ",s.status.toLowerCase(),". Contact us if you need to make changes."]})]})]})]})]})]})}),(0,f.jsx)(Ea.lG,{open:b,onOpenChange:y,children:(0,f.jsxs)(Ea.Cf,{className:"bg-black border-gray-800",children:[(0,f.jsxs)(Ea.c7,{children:[(0,f.jsx)(Ea.L3,{className:"text-white",children:"Accept Quote"}),(0,f.jsx)(Ea.rr,{className:"text-gray-400",children:"You're about to accept this quote. We'll contact you shortly to confirm booking details."})]}),(0,f.jsx)("div",{className:"space-y-4",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Additional Notes (Optional)"}),(0,f.jsx)(Vt,{placeholder:"Any additional information or requests...",value:A,onChange:e=>k(e.target.value),className:"bg-gray-900 border-gray-700 text-white",rows:3})]})}),(0,f.jsxs)(Ea.Es,{children:[(0,f.jsx)(it.$,{variant:"outline",onClick:()=>y(!1),children:"Cancel"}),(0,f.jsx)(it.$,{onClick:()=>F("accept",A),disabled:d,className:"bg-green-600 hover:bg-green-700",children:d?"Processing...":"Accept Quote"})]})]})}),(0,f.jsx)(Ea.lG,{open:v,onOpenChange:j,children:(0,f.jsxs)(Ea.Cf,{className:"bg-black border-gray-800",children:[(0,f.jsxs)(Ea.c7,{children:[(0,f.jsx)(Ea.L3,{className:"text-white",children:"Decline Quote"}),(0,f.jsx)(Ea.rr,{className:"text-gray-400",children:"You're about to decline this quote. Please let us know if there's anything we can do differently."})]}),(0,f.jsx)("div",{className:"space-y-4",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Reason for Declining (Optional)"}),(0,f.jsx)(Vt,{placeholder:"Help us improve by sharing why this quote doesn't work for you...",value:A,onChange:e=>k(e.target.value),className:"bg-gray-900 border-gray-700 text-white",rows:3})]})}),(0,f.jsxs)(Ea.Es,{children:[(0,f.jsx)(it.$,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),(0,f.jsx)(it.$,{onClick:()=>F("decline",A),disabled:d,variant:"destructive",children:d?"Processing...":"Decline Quote"})]})]})}),(0,f.jsx)(Ea.lG,{open:w,onOpenChange:N,children:(0,f.jsxs)(Ea.Cf,{className:"bg-black border-gray-800",children:[(0,f.jsxs)(Ea.c7,{children:[(0,f.jsx)(Ea.L3,{className:"text-white",children:"Request Changes"}),(0,f.jsx)(Ea.rr,{className:"text-gray-400",children:"Tell us what changes you'd like to see in this quote. We'll review and send you an updated version."})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Requested Changes *"}),(0,f.jsx)(Vt,{placeholder:"Please describe the changes you'd like us to make to this quote...",value:S,onChange:e=>_(e.target.value),className:"bg-gray-900 border-gray-700 text-white",rows:4,required:!0})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Additional Notes (Optional)"}),(0,f.jsx)(Vt,{placeholder:"Any additional information...",value:A,onChange:e=>k(e.target.value),className:"bg-gray-900 border-gray-700 text-white",rows:2})]})]}),(0,f.jsxs)(Ea.Es,{children:[(0,f.jsx)(it.$,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),(0,f.jsx)(it.$,{onClick:()=>F("request_change",A,S),disabled:d||!S.trim(),className:"bg-orange-600 hover:bg-orange-700",children:d?"Processing...":"Request Changes"})]})]})})]}):(0,f.jsx)("div",{className:"min-h-screen bg-dark-bg text-white flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)(kt.A,{className:"h-16 w-16 text-gray-600 mx-auto mb-4"}),(0,f.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Quote Not Found"}),(0,f.jsx)("p",{className:"text-gray-400 mb-4",children:"The quote you're looking for doesn't exist."}),(0,f.jsx)(it.$,{onClick:()=>
1t("/customer/dashboard"),children:"Back to Dashboard"})]})})};var za=s(85347);const Ba=()=>{const e=[{icon:Nt.A,title:"Same-Day Edits",description:"Same-day photography and video production for conferences and exhibitions. Marketing-ready content available during your event.",features:["Instant delivery during event","Professional editing","Marketing-ready content","Real-time social sharing"]},{icon:Ge.A,title:"Full Presentation Filming",description:"Comprehensive recording of presentations with slide integration, delivered within 24 hours.",features:["Multi-camera setup","Slide integration","Professional audio","24-hour delivery"]},{icon:at.A,title:"Reels Every Hour",description:"For every hour on-site, we capture and deliver a fully-edited vertical reel (15\u201360s), optimised for Instagram, TikTok, YouTube Shorts and LinkedIn.",features:["Hourly content creation","Social-media optimised","Vertical format","Platform-specific edits"]},{icon:_.A,title:"Facial Recognition Galleries",description:"Our Smart Galleries use facial recognition to instantly match and deliver event photos to registered attendees.",features:["AI-powered matching","Instant delivery","Personalised galleries","Higher attendee satisfaction"]}],t=[{icon:F.A,title:"Same-Day Delivery",description:"Content delivered while your event is still fresh."},{icon:za.A,title:"Broadcast Quality",description:"Broadcast-grade kit and experienced operators across every shoot."},{icon:Xe.A,title:"Multi-Platform",description:"Optimised for social, web, presentations and print in a single brief."},{icon:p.A,title:"Complete Coverage",description:"From networking sessions to keynote moments \u2014 nothing missed."}],s=[{q:"How does same-day event video delivery work?",a:"Our team edits on-site during your conference using portable editing stations. Professionally edited photos arrive within hours; short-form video (reels and highlights) ships throughout the day. Full presentation recordings are delivered within 24 hours."},{q:"What's included in conference photography packages?",a:"Multi-camera photography, same-day edited photo delivery, social-media-ready content, presentation filming with slide integration and optional live streaming. Add-ons include facial-recognition smart galleries and hourly reels."},{q:"Do you offer live streaming for conferences?",a:"Yes \u2014 multi-camera live streaming with professional audio, real-time switching and broadcast to YouTube, Vimeo or a private streaming portal."},{q:"Which conference venues do you cover?",a:"MCEC, ICC Sydney, Brisbane Convention & Exhibition Centre, Adelaide Convention Centre, Crown Melbourne, Crown Perth and Star Gold Coast, plus hotels and unique venues across every Australian capital."}];return(0,f.jsxs)(ae.mP,{className:"!pt-0",children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"Conference Photographer Australia | Same-Day Photos & Video | Turbo 360"}),(0,f.jsx)("meta",{name:"description",content:"Conference photography and video across Australia, with same-day edits, multi-camera coverage, AI galleries and hourly social reels. Get a fast quote."}),(0,f.jsx)("meta",{name:"robots",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),(0,f.jsx)("meta",{name:"keywords",content:"conference photography, conference videography, exhibition video, same day delivery, conference photographer Brisbane, conference photographer Melbourne, conference video Sydney, multi-camera setup, facial recognition galleries, conference streaming, exhibition photographer"}),(0,f.jsx)("link",{rel:"canonical",href:"https://turbo.net.au/conferences"}),(0,f.jsx)("meta",{property:"og:title",content:"Conference Photographer Australia | Same-Day Photos & Video | Turbo 360"}),(0,f.jsx)("meta",{property:"og:description",content:"Conference photography and video across Australia, with same-day edits, multi-camera coverage, AI galleries and hourly social reels. Get a fast quote."}),(0,f.jsx)("meta",{property:"og:type",content:"website"}),(0,f.jsx)("meta",{property:"og:url",content:"https://turbo.net.au/conferences"}),(0,f.jsx)("meta",{property:"og:image",content:"https://turbo.net.au/images/services/locations/CONFERENCE-PHOTOGRAPHY.jpg"}),(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("meta",{name:"twitter:title",content:"Conference Photographer Australia | Same-Day Photos & Video"}),(0,f.jsx)("meta",{name:"twitter:description",content:"Conference photography and video across Australia, with same-day edits, multi-camera coverage, AI galleries and hourly social reels."}),(0,f.jsx)("meta",{name:"twitter:image",content:"https://turbo.net.au/images/services/locations/CONFERENCE-PHOTOGRAPHY.jpg"}),(0,f.jsx)("script",{type:"application/ld+json",children:'{"@context":"https://schema.org","@type":"Service","name":"Conference Photography & Video Production","description":"Professional conference photography and videography services with same-day delivery across Australia","provider":{"@type":"ProfessionalService","name":"Turbo 360","url":"https://turbo.net.au","telephone":"+61-1300-207-446","email":"[email protected]","aggregateRating":{"@type":"AggregateRating","ratingValue":"5.0","reviewCount":"180"}},"areaServed":[{"@type":"City","name":"Brisbane"},{"@type":"City","name":"Sydney"},{"@type":"City","name":"Melbourne"},{"@type":"City","name":"Perth"},{"@type":"City","name":"Adelaide"},{"@type":"Country","name":"Australia"}],"serviceType":"Conference Photography and Videography","offers":{"@type":"Offer","availability":"https://schema.org/InStock","priceRange":"$$"}}'}),(0,f.jsx)("script",{type:"application/ld+json",children:'{"@context":"https://schema.org","@type":"FAQPage","mainEntity":'.concat(JSON.stringify(s.map(e=>
1({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))),"}")}),(0,f.jsx)("script",{type:"application/ld+json",children:'{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://turbo.net.au/"},{"@type":"ListItem","position":2,"name":"Conference Photography & Video","item":"https://turbo.net.au/conferences"}]}'})]}),(0,f.jsx)(D.A,{currentPage:"Conferences"}),(0,f.jsxs)("section",{className:"relative flex min-h-[88vh] items-end overflow-hidden bg-carbon-900 pt-[76px]",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:'url("/images/services/locations/CONFERENCE-PHOTOGRAPHY.jpg")'}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.55) 0%,rgba(13,13,13,.25) 38%,rgba(13,13,13,.8) 78%,#0d0d0d 100%)"}}),(0,f.jsx)("div",{className:"absolute inset-x-0 top-0 z-[2] h-1",style:{background:"linear-gradient(90deg,#BF212F 0 40%,#F2A900 40% 70%,#0FA3A3 70% 100%)"}}),(0,f.jsxs)("div",{className:"relative z-[3] mx-auto w-full max-w-7xl px-[22px] pb-16 md:px-11 md:pb-24",children:[(0,f.jsxs)("div",{className:"mb-[26px] flex items-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsx)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:"Conference specialists \xb7 180+ 5-star reviews"})]}),(0,f.jsxs)("h1",{className:"m-0 font-display text-[clamp(44px,7.4vw,118px)] font-extrabold leading-[0.9] tracking-[-0.025em] text-smoke [text-wrap:balance]",children:["Conference Photographer"," ",(0,f.jsx)("span",{className:"block text-turbo-red",children:"Australia \u2014 Same-Day Photos & Video"})]}),(0,f.jsx)("p",{className:"mt-[30px] max-w-[640px] text-[clamp(17px,1.5vw,21px)] leading-[1.6] text-[#D9D6CF]",children:"Multi-camera coverage, hourly reels, full presentation films and AI smart galleries \u2014 delivered while your conference is still running."}),(0,f.jsxs)("div",{className:"mt-[38px] flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:[(0,f.jsx)(ae.$$,{to:"/get-quote",children:"Get a quote \u2192"}),(0,f.jsx)(ae.qM,{href:"#services",onClick:e=>{var t;e.preventDefault(),null===(t=document.getElementById("services"))||void 0===t||t.scrollIntoView({behavior:"smooth"})},className:"backdrop-blur-sm",children:"Services"})]})]})]}),(0,f.jsx)("section",{id:"services",className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 flex flex-wrap items-end justify-between gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / Services"}),(0,f.jsxs)("h2",{className:"m-0 font-display text-[clamp(38px,5.2vw,72px)] font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke",children:["Built for",(0,f.jsx)("br",{}),"the conference brief."]})]}),(0,f.jsx)("p",{className:"m-0 max-w-[360px] text-[17px] leading-[1.6] text-[#9C9A95]",children:"Four core capabilities. One in-house crew. Mix them how you like \u2014 every booking ships from the same delivery pipeline."})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2",children:e.map((e,t)=>{const s=e.icon,a=String(t+1).padStart(2,"0");return(0,f.jsx)(ae.gN,{delay:t%2*80,children:(0,f.jsxs)("div",{className:"group relative h-full overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-8 transition-colors duration-300 hover:border-turbo-red/60",children:[(0,f.jsxs)("div",{className:"mb-6 flex items-start justify-between",children:[(0,f.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-xl bg-turbo-red transition-transform duration-300 ease-turbo group-hover:scale-110",children:(0,f.jsx)(s,{className:"h-7 w-7 text-white"})}),(0,f.jsx)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-turbo-red",children:a})]}),(0,f.jsx)("h3",{className:"mb-3 font-head text-2xl font-bold leading-tight text-white md:text-3xl",children:e.title}),(0,f.jsx)("p",{className:"mb-5 text-sm leading-relaxed text-[#C7C4BD]",children:e.description}),(0,f.jsx)("ul",{className:"space-y-2",children:e.features.map(e=>(0,f.jsxs)("li",{className:"flex items-start text-sm text-[#9C9A95]",children:[(0,f.jsx)(p.A,{className:"mr-2 mt
1-0.5 h-4 w-4 flex-shrink-0 text-turbo-red"}),(0,f.jsx)("span",{children:e})]},e))})]})},e.title)})})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"02 / Why Turbo"}),(0,f.jsxs)("h2",{className:"m-0 font-display text-[clamp(38px,5.2vw,72px)] font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke",children:["Why teams pick",(0,f.jsx)("br",{}),"us for conferences."]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] sm:grid-cols-2 lg:grid-cols-4",children:t.map((e,t)=>{const s=e.icon;return(0,f.jsx)(ae.gN,{delay:t%4*60,children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors hover:border-turbo-red/50",children:[(0,f.jsx)("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-turbo-red",children:(0,f.jsx)(s,{className:"h-6 w-6 text-white"})}),(0,f.jsx)("h3",{className:"mb-2 font-head text-lg font-bold text-white",children:e.title}),(0,f.jsx)("p",{className:"text-sm leading-relaxed text-[#9C9A95]",children:e.description})]})},e.title)})})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-12 flex flex-wrap items-end justify-between gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"03 / Venues"}),(0,f.jsxs)("h2",{className:"m-0 font-display text-[clamp(38px,5.2vw,72px)] font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke",children:["Major venues,",(0,f.jsx)("br",{}),"on the bench."]})]}),(0,f.jsx)("p",{className:"m-0 max-w-[360px] text-[17px] leading-[1.6] text-[#9C9A95]",children:"The Australian conference circuit we work most often. We cover everywhere else too \u2014 just ask."})]}),(0,f.jsx)(ae.gN,{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:["Melbourne Convention & Exhibition Centre (MCEC)","Sydney Convention & Exhibition Centre (ICC)","Adelaide Convention Centre","Crown Melbourne","Crown Perth","Star Gold Coast","Brisbane Convention & Exhibition Centre"].map(e=>(0,f.jsxs)("div",{className:"group flex items-center gap-3 rounded-[10px] border border-[#262626] bg-[#1A1A1A] px-5 py-4 transition-colors hover:border-turbo-red/50",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 flex-shrink-0 text-turbo-red"}),(0,f.jsx)("span",{className:"font-head text-sm font-semibold text-smoke",children:e})]},e))})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"04 / Clients"}),(0,f.jsxs)("h2",{className:"m-0 font-display text-[clamp(38px,5.2vw,72px)] font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke",children:["What conference",(0,f.jsx)("br",{}),"teams say."]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-3",children:[{name:"Chris May",company:"DecorDesign Show, InformaConnect",quote:"Turbo 360's same-day conference videography exceeded our expectations. The quality and speed are unmatched.",rating:5},{name:"Sarah Johnson",company:"Tech Summit Australia",quote:"The Reels Every Hour service was a game-changer for our event marketing. Engagement up 300%.",rating:5},{name:"Michael Chen",company:"Medical Conference Melbourne",quote:"Professional presentation filming with perfect AV sync. Our speakers were impressed with the final product.",rating:5}].map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-8",children:[(0,f.jsx)("div",{className:"mb-4 flex",children:[...Array(e.rating)].map((e,t)=>(0,f.jsx)(nt.A,{className:"h-4 w-4 fill-current text-turbo-red"},t))}),(0,f.jsxs)("p",{className:"mb-6 leading-relaxed text-[#C7C4BD]",children:["\u201c",e.quote,"\u201d"]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-head font-bold text-white",children:e.name}),(0,f.jsx)("div",{className:"text-sm font-semibold text-turbo-red",children:e.company})]})]})},e.name))})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"05 / FAQ"}),(0,f.jsxs)("h2",{className:"m-0 font-display text-[clamp(38px,5.2vw,72px)] font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke",children:["The usual",(0,f.jsx)("br",{}),"questions."]})]}),(0,f.jsx)("div",{className:"space-y-4",children:s.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%4*50,children:(0,f.jsxs)("details",{className:"group rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors hover:border-turbo-red/50",children:[(0,f.jsxs)("summary",{className:"flex cursor-pointer list-none items-start justify-between gap-4",children:[(0,f.jsx)("h3",{className:"font-head text-lg font-bold text-smoke md:text-xl",children:e.q}),(0,f.jsx)("span",{className:"shrink-0 text-2xl leading-none text-turbo-red transition-transform group-open:rotate-45",children:"+"})]}),(0,f.jsx)("p",{className:"mt-4 leading-relaxed text-[#C7C4BD]",children:e.a})]})},e.q))})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-12 flex flex-wrap items-end justify-between gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"06 / Coverage"}),(0,f.jsxs)("h2",{className:"m-0 font-display text-[clamp(38px,5.2vw,72px)] font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke",children:["Conference crews,",(0,f.jsx)("br",{}),"Australia-wide."]})]}),(0,f.jsxs)("p",{className:"m-0 max-w-[360px] text-[17px] leading-[1.6] text-[#9C9A95]",children:["On the ground in every capital. Start with"," ",(0,f.jsx)(r.N_,{to:"/services/conference-photography/sydney",className:"font-semibold text-turbo-red hover:underline",children:"conference photographer Sydney"})," ","or pick another city below."]})]}),(0,f.jsx)(ae.gN,{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:[{name:"Sydney",slug:"sydney"},{name:"Melbourne",slug:"melbourne"},{name:"Brisbane",slug:"brisbane"},{name:"Perth",slug:"perth"},{name:"Adelaide",slug:"adelaide"},{name:"Canberra",slug:"canberra"},{name:"Hobart",slug:"hobart"},{name:"Darwin",slug:"darwin"},{name:"Geelong",slug:"geelong"}].map(e=>(0,f.jsxs)(r.N_,{to:"/services/conference-photography/".concat(e.slug),className:"group flex items-center justify-between rounded-[10px] border border-[#262626] bg-[#1A1A1A] px-4 py-3 transition-colors hover:border-turbo-red/50",children:[(0,f.jsxs)("span",{className:"font-head text-sm font-bold text-smoke",children:["Conference photographer ",e.name]}),(0,f.jsx)(S.A,{className:"h-4 w-4 text-[#8A8884] transition-colors group-hover:text-turbo-red"})]},e.slug))}),(0,f.jsx)(ae.gN,{className:"mt-8",children:(0,f.jsxs)(r.N_,{to:"/services/conference-photography",className:"inline-flex items-center gap-2 font-mono text-[13px] uppercase tracking-[0.16em] text-fog transition-colors hover:text-turbo-red",children:[(0,f.jsx)("span",{children:"All conference locations"}),(0,f.jsx)(S.A,{className:"h-4 w-4"})]})})]})}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] px-[22px] py-32 text-center md:px-11 md:py-48",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:"url('/images/services/locations/conference-speaker-crown-podium.jpg')"}}),(0,f.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.6) 0%,rgba(13,13,13,.45) 40%,rgba(13,13,13,.85) 100%)"}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 50% 0%,rgba(191,33,47,.3),transparent 60%)"}}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-5xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-5",children:"07 / Ready"}),(0,f.jsxs)("h2",{className:"mb-[26px] font-display text-[clamp(42px,6.4vw,96px)] font-extrabold leading-[0.94] tracking-[-0.025em] text-smoke",children:["Your next",(0,f.jsx)("br",{}),"conference, ",(0,f.jsx)("span",{className:"text-turbo-red",children:"covered."})]}),(0,f.jsx)("p",{className:"mx-auto mb-10 max-w-2xl text-[clamp(17px,1.6vw,20px)] leading-[1.6] text-[#C7C4BD]",children:"Tell us the brief \u2014 we'll have a quote back within hours and a multi-camera crew ready for the doors opening."}),(0,f.jsx)(ae.$$,{to:"/get-quote",className:"!px-[46px] !py-5 !text-lg",children:"Get a quote \u2192"})]})]}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})};var Da=s(63172),Ia=s(44919);const Ra=e=>{let{vid:t,title:s}=e;return(0,f.jsx)("div",{className:"w-full bg-black rounded-lg overflow-hidden relative",style:{aspectRatio:"16/9",minHeight:"200px",maxHeight:"400px"}
1,children:(0,f.jsx)("iframe",{src:"https://api.vadoo.tv/iframe_test?id=".concat(t),title:s,scrolling:"no",style:{border:0,top:0,left:0,width:"100%",height:"100%",position:"absolute",overflow:"hidden",borderRadius:"5px"},allowFullScreen:!0,allow:"autoplay"})})},Pa=()=>{const e=[{icon:Ue.A,title:"Corporate Photography",description:"Same-day corporate photography for websites, social, print and PR. Exhibition, conference, headshot and product coverage.",features:["Exhibition photography","Conference photography","Corporate headshots","Board meetings","Internal events","Product photography"]},{icon:Ke.A,title:"Corporate Video Production",description:"Brand films, client testimonials, internal training content \u2014 built to communicate your brand and earn trust.",features:["Brand introduction videos","Client testimonials","Internal training content","Culture videos","Executive messaging","Product demos"]},{icon:Da.A,title:"Event Coverage & Live Streaming",description:"Multi-camera coverage and real-time streaming for events of every size, broadcast-ready output, professional audio.",features:["Multi-camera event coverage","Real-time live streaming","Conference documentation","Trade show coverage","Corporate event filming","Global audience reach"]},{icon:at.A,title:"Social Media Content",description:"Reels, shorts and editorial photography optimised per platform to lift visibility, recall and engagement.",features:["Platform-optimised content","Instagram Reels & Stories","YouTube Shorts","TikTok videos","LinkedIn content","Facebook visual ads"]},{icon:tt.A,title:"Marketing Photography",description:"Strategic photo + video aligned with your marketing goals. Concept through delivery, on-message every frame.",features:["Strategic planning","Brand identity photography","Marketing activation photography","Target audience analysis","Message optimisation","Content planning"]},{icon:F.A,title:"Same-Day Delivery",description:"Edits while the room is still warm \u2014 content shipped in hours so you can post while your event is trending.",features:["Same-day turnaround","Real-time editing","Immediate social sharing","Hot content delivery","Event momentum capture","Instant engagement"]}],t=[{icon:za.A,title:"Experienced Team",description:"In-house crew with years of corporate work across every industry."},{icon:p.A,title:"End-to-End Service",description:"Pre-production through delivery \u2014 one team, one delivery pipeline."},{icon:tt.A,title:"Tailored Solutions",description:"Each brief is shaped to your audience and message \u2014 no template work."},{icon:Ia.A,title:"Creative Excellence",description:"A creative edge on every project so your brand actually stands out."}],s=[{q:"How much does corporate video production cost?",a:"Pricing depends on scope. A basic corporate video or testimonial starts from around $1,500; comprehensive brand films with multiple shooting days and advanced post can range $3,000\u2013$10,000+. Contact us for a free custom quote."},{q:"What types of corporate videos do you produce?",a:"Brand introductions, client testimonials, internal training, culture videos, executive messaging, product demos, event highlight reels, social content and corporate event coverage with same-day delivery."},{q:"Can you film at our office location?",a:"Absolutely \u2014 we film on-location at offices, warehouses, retail spaces or any venue Australia-wide, bringing all professional lighting, audio and cinema-grade camera gear with us."},{q:"How fast can you deliver corporate content?",a:"Same-day for edited photos and short-form video; 5\u201310 business days for standard corporate video projects (rush options available)."}],a=[{name:"Sydney",slug:"sydney"},{name:"Melbourne",slug:"melbourne"},{name:"Brisbane",slug:"brisbane"},{name:"Perth",slug:"perth"},{name:"Adelaide",slug:"adelaide"},{name:"Canberra",slug:"canberra"},{name:"Hobart",slug:"hobart"},{name:"Darwin",slug:"darwin"}];return(0,f.jsxs)(ae.mP,{className:"!pt-0",children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"Corporate Photography & Video Production | Turbo 360"}),(0,f.jsx)("meta",{name:"description",content:"Corporate video, business photography & headsh
1ots with same-day delivery. Testimonial videos, brand content & social reels Australia-wide. Get a quote."}),(0,f.jsx)("meta",{name:"robots",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),(0,f.jsx)("meta",{name:"keywords",content:"corporate photography, business photography, corporate video production, Melbourne corporate videographer, video production Melbourne, corporate headshots, exhibition photography, conference photography, product photography, business content creation, social media photography, same day delivery"}),(0,f.jsx)("link",{rel:"canonical",href:"https://turbo.net.au/business"}),(0,f.jsx)("meta",{property:"og:title",content:"Corporate Video Production & Photography | Same-Day Delivery | Turbo 360"}),(0,f.jsx)("meta",{property:"og:description",content:"Professional corporate video production, business photography, headshots & promotional content with same-day delivery across Australia."}),(0,f.jsx)("meta",{property:"og:type",content:"website"}),(0,f.jsx)("meta",{property:"og:url",content:"https://turbo.net.au/business"}),(0,f.jsx)("meta",{property:"og:image",content:"https://turbo.net.au/images/services/business-service.jpg"}),(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("meta",{name:"twitter:title",content:"Corporate Video Production & Photography | Turbo 360"}),(0,f.jsx)("meta",{name:"twitter:description",content:"Professional corporate video production, business photography & same-day content delivery across all Australian cities."}),(0,f.jsx)("meta",{name:"twitter:image",content:"https://turbo.net.au/images/services/business-service.jpg"}),(0,f.jsx)("script",{type:"application/ld+json",children:'{"@context":"https://schema.org","@type":"Service","name":"Corporate Photography & Video Production","description":"Professional corporate video production, headsh
1ots and promotional content with same-day delivery","provider":{"@type":"ProfessionalService","name":"Turbo 360","url":"https://turbo.net.au","telephone":"+61-1300-207-446","email":"[email protected]","aggregateRating":{"@type":"AggregateRating","ratingValue":"5.0","reviewCount":"180"}},"areaServed":[{"@type":"City","name":"Brisbane"},{"@type":"City","name":"Sydney"},{"@type":"City","name":"Melbourne"},{"@type":"Country","name":"Australia"},{"@type":"Country","name":"New Zealand"},{"@type":"Country","name":"Singapore"}],"serviceType":"Corporate Photography and Video Production","hasOfferCatalog":{"@type":"OfferCatalog","name":"Corporate Photography & Video Services","itemListElement":[{"@type":"Offer","itemOffered":{"@type":"Service","name":"Corporate Photography","description":"Professional corporate photography with same-day delivery"}},{"@type":"Offer","itemOffered":{"@type":"Service","name":"Corporate Video Production","description":"Professional corporate videos for brand communication and training"}},{"@type":"Offer","itemOffered":{"@type":"Service","name":"Event Coverage & Live Streaming","description":"Multi-camera event coverage with live streaming capabilities"}},{"@type":"Offer","itemOffered":{"@type":"Service","name":"Social Media Content","description":"Platform-optimised photography and video content for social media"}}]}}'}),(0,f.jsx)("script",{type:"application/ld+json",children:'{"@context":"https://schema.org","@type":"FAQPage","mainEntity":'.concat(JSON.stringify(s.map(e=>({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))),"}")}),(0,f.jsx)("script",{type:"application/ld+json",children:'{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://turbo.net.au/"},{"@type":"ListItem","position":2,"name":"Corporate Photography & Video Production","item":"https://turbo.net.au/business"}]}'})]}),(0,f.jsx)(D.A,{currentPage:"Business"}),(0,f.jsxs)("section",{className:"relative flex min-h-[88vh] items-end overflow-hidden bg-carbon-900 pt-[76px]",children:[(0,f.jsx)("img",{src:"/images/services/locations/corporate-event-guests.jpg",alt:"","aria-hidden":!0,className:"absolute inset-0 h-full w-full object-cover"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.55) 0%,rgba(13,13,13,.3) 30%,rgba(13,13,13,.72) 66%,#0d0d0d 100%)"}}),(0,f.jsx)("div",{className:"absolute inset-x-0 top-[68px] z-[2] h-1 bg-turbo-red"}),(0,f.jsxs)("div",{className:"relative z-10 mx-auto w-full max-w-7xl px-[22px] pb-20 md:px-11 md:pb-24",children:[(0,f.jsxs)("div",{className:"mb-[26px] flex items-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsx)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:"Corporate content specialists"})]}),(0,f.jsxs)("h1",{className:"m-0 font-display text-[clamp(40px,8vw,118px)] font-extrabold leading-[0.92] tracking-[-0.025em] text-smoke [text-wrap:balance]",children:["Corporate photo",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"+ video, on-brand."})]}),(0,f.jsx)("p",{className:"mt-[30px] max-w-3xl text-[clamp(17px,1.5vw,21px)] leading-[1.6] text-[#D9D6CF]",children:"Brand films, executive headshots, event coverage, social reels \u2014 produced by an in-house crew with same-day turnaround when it matters."}),(0,f.jsxs)("div",{className:"mt-[38px] flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:[(0,f.jsx)(ae.$$,{to:"/get-quote",children:"Get a quote \u2192"}),(0,f.jsx)(ae.qM,{href:"#services",onClick:e=>{var t;e.preventDefault(),null===(t=document.getElementById("services"))||void 0===t||t.scrollIntoView({behavior:"smooth"})},children:"Services"})]})]})]}),(0,f.jsxs)(ae.wn,{id:"services",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / Services"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Six capabilities,",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"one in-house crew."})]}),(0,f.jsx)("p",{className:"mt-6 text-lg leading-[1.6] text-[#9C9A95]",children:"Pre-production through delivery \u2014 every project ships from the same Melbourne
1-based pipeline with the same colourist signing off the look."})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[18px] md:grid-cols-2 lg:grid-cols-3",children:e.map((e,t)=>{const s=e.icon,a=String(t+1).padStart(2,"0");return(0,f.jsx)(ae.gN,{delay:t%3*60,children:(0,f.jsxs)("div",{className:"group h-full overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-8 transition-colors duration-300 hover:border-turbo-red/50",children:[(0,f.jsxs)("div",{className:"mb-6 flex items-start justify-between",children:[(0,f.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-xl bg-turbo-red text-white transition-transform duration-300 group-hover:scale-110",children:(0,f.jsx)(s,{className:"h-7 w-7"})}),(0,f.jsx)("span",{className:"font-mono text-[13px] tracking-[0.2em] text-turbo-red",children:a})]}),(0,f.jsx)("h3",{className:"mb-3 font-head text-2xl font-bold leading-tight text-white",children:e.title}),(0,f.jsx)("p",{className:"mb-5 text-sm leading-relaxed text-[#9C9A95]",children:e.description}),(0,f.jsx)("ul",{className:"space-y-2",children:e.features.map(e=>(0,f.jsxs)("li",{className:"flex items-start text-sm text-[#C7C4BD]",children:[(0,f.jsx)(p.A,{className:"mr-2 mt-0.5 h-4 w-4 flex-shrink-0 text-turbo-red"}),(0,f.jsx)("span",{children:e})]},e))})]})},e.title)})})]}),(0,f.jsxs)(ae.wn,{tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"02 / Photo work"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["A look at the",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"corporate roll."})]}),(0,f.jsx)("p",{className:"mt-6 text-lg leading-[1.6] text-[#9C9A95]",children:"Exhibitions, headshots, conferences, products \u2014 recent work, real frames."})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] sm:grid-cols-2 lg:grid-cols-4",children:[{id:1,title:"Exhibition Photography",description:"Trade show and exhibition coverage capturing booths, networking and key moments.",category:"Exhibition",image:"/images/legacy/D1TURBO_20221020_DesignShow_2917.jpg.webp"},{id:2,title:"Corporate Headshots",description:"Editorial-quality headshots for sites, decks and LinkedIn.",category:"Corporate",image:"/images/services/headshots/20260120-007_Kaldma_Jaclyn_05-SQR.jpg"},{id:3,title:"Conference Photography",description:"Multi-camera presentation, panel and networking coverage.",category:"Conference",image:"/images/legacy/TURBO360-AHC-5522.jpg.webp"},{id:4,title:"Product Photography",description:"High-resolution product imagery for ecomm and marketing.",category:"Product",image:"https://images.pixieset.com/72258907/0000f21ea4040a60f8c5debb1578671a-xxlarge.jpg"}].map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%4*70,children:(0,f.jsxs)("div",{className:"group relative aspect-[3/4] overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A]",children:[(0,f.jsx)("img",{src:e.image,loading:"lazy",alt:e.title,className:"absolute inset-0 h-full w-full object-cover transition-transform duration-700 ease-turbo group-hover:scale-[1.06]"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 40%,rgba(13,13,13,.85))"}}
1),(0,f.jsx)("div",{className:"absolute left-4 top-4 rounded bg-turbo-red/90 px-2.5 py-[5px] font-mono text-[11px] uppercase tracking-[0.2em] text-white",children:e.category}),(0,f.jsxs)("div",{className:"absolute inset-x-[18px] bottom-[18px]",children:[(0,f.jsx)("h4",{className:"mb-1.5 font-head text-[19px] font-bold text-white",children:e.title}),(0,f.jsx)("p",{className:"m-0 text-[13px] leading-[1.55] text-[#C7C4BD]",children:e.description})]})]})},e.id))})]}),(0,f.jsxs)(ae.wn,{children:[(0,f.jsxs)(ae.gN,{className:"mb-12 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"03 / Film work"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Press play,",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"see the cut."})]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] lg:grid-cols-2",children:[{id:1,title:"Networking Events",description:"Professional networking event coverage capturing connections and key moments.",category:"Events",vid:"41nPoi67lj73eB39jVv5uIWaV8mlHXsl"},{id:2,title:"Conference Highlights",description:"Same-day conference coverage with professional multi-camera setup.",category:"Events",vid:"diznuds9dGByqsBzYZwLprBmWHFKkBrf"},{id:3,title:"Gala Events",description:"Elegant gala event coverage with professional lighting and cinematography.",category:"Events",vid:"VJleXtQ7Pds61JjeLeF3IbHTIsjECV08"},{id:4,title:"Client Testimonial",description:"Chris May, Conference Director of Decor Design Show, shares his experience.",category:"Testimonial",vid:"xixbFPzJaVIzPjQi1e6CWhIeBpS8THzb"}].map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%2*80,children:(0,f.jsxs)("div",{className:"overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6",children:[(0,f.jsxs)("div",{className:"mb-3 flex items-center gap-3",children:[(0,f.jsx)("span",{className:"rounded bg-turbo-red/90 px-2.5 py-[5px] font-mono text-[11px] uppercase tracking-[0.2em] text-white",children:e.category}),(0,f.jsx)("h4",{className:"font-head text-xl font-bold text-white",children:e.title})]}),(0,f.jsx)("p",{className:"mb-4 text-sm leading-relaxed text-[#C7C4BD]",children:e.description}),(0,f.jsx)(Ra,{vid:e.vid,title:e.title})]})},e.id))})]}),(0,f.jsxs)(ae.wn,{tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{className:"mb-12 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"04 / Why Turbo"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Why corporate teams",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"come back."})]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] sm:grid-cols-2 lg:grid-cols-4",children:t.map((e,t)=>{const s=e.icon;return(0,f.jsx)(ae.gN,{delay:t%4*60,children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors hover:border-turbo-red/40",children:[(0,f.jsx)("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-turbo-red text-white",children:(0,f.jsx)(s,{className:"h-6 w-6"})}),(0,f.jsx)("h3",{className:"mb-2 font-head text-lg font-bold text-white",children:e.title}),(0,f.jsx)("p",{className:"text-sm leading-relaxed text-[#9C9A95]",children:e.description})]})},e.title)})})]}),(0,f.jsxs)(ae.wn,{children:[(0,f.jsxs)(ae.gN,{className:"mb-12 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"05 / Clients"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["What corporate",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"teams say."})]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-3",children:[{name:"Sarah Mitchell",company:"Tech Innovations Ltd",industry:"Technology",rating:5,quote:"Turbo 360's same-day photo + video delivery transformed our conference. Quality was exceptional and having content ready immediately let us maximise the event's impact."},{name:"David Chen",company:"Global Manufacturing",industry:"Manufacturing",rating:5,quote:"Professional corporate photography and video that captured our brand essence. The headshots and company video are now our most-used marketing assets."},{name:"Emma Thompson",company:"Startup Accelerator",industry:"Business Services",rating:5,quote:"Their expertise in cross-platform visual storytelling tripled our engagement. The understanding of social-first content is outstanding."}].map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*70,children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-8",children:[(0,f.jsx)("div",{className:"mb-4 flex",children:[...Array(e.rating)].map((e,t)=>(0,f.jsx)(nt.A,{className:"h-4 w-4 fill-current text-turbo-red"},t))}),(0,f.jsxs)("p",{className:"mb-6 leading-relaxed text-[#D9D6CF]",children:["\u201c",e.quote,"\u201d"]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-head font-bold text-white",children:e.name}),(0,f.jsx)("div",{className:"text-sm font-semibold text-turbo-red",children:e.company}),(0,f.jsx)("div",{className:"mt-0.5 text-xs text-[#8A8884]",children:e.industry})]})]})},e.name))})]}),(0,f.jsx)(ae.wn,{tone:"carbon-900",children:(0,f.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"06 / FAQ"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["The usual",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"questions."})]})]}),(0,f.jsx)("div",{className:"space-y-4",children:s.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%4*50,children:(0,f.jsxs)("details",{className:"group rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors hover:border-turbo-red/40",children:[(0,f.jsxs)("summary",{className:"flex cursor-pointer list-none items-start justify-between gap-4",children:[(0,f.jsx)("h3",{className:"font-head text-lg font-bold text-white md:text-xl",children:e.q}),(0,f.jsx)("span",{className:"shrink-0 text-2xl leading-none text-turbo-red transition-transform group-open:rotate-45",children:"+"})]}),(0,f.jsx)("p",{className:"mt-4 leading-relaxed text-[#C7C4BD]",children:e.a})]})},e.q))})]})}),(0,f.jsxs)(ae.wn,{children:[(0,f.jsxs)(ae.gN,{className:"mb-12 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"07 / Coverage"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Corporate work,",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"in every capital."})]}),(0,f.jsx)("p",{className:"mt-6 text-lg leading-[1.6] text-[#9C9A95]",children:"On-the-ground crews in every Australian capital, plus NZ and Singapore on call."})]}),(0,f.jsxs)(ae.gN,{className:"mb-6 grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:[(0,f.jsxs)(r.N_,{to:"/video-production-melbourne",className:"group flex items-center justify-between rounded-lg border border-turbo-red/40 bg-turbo-red/10 px-4 py-3 transition-colors hover:border-turbo-red/80",children:[(0,f.jsx)("span",{className:"font-head text-sm font-bold text-white",children:"Video production \xb7 Melbourne"}),(0,f.jsx)(S.A,{className:"h-4 w-4 text-turbo-red"})]}),(0,f.jsxs)(r.N_,{to:"/corporate-video-melbourne",className:"group flex items-center justify-between rounded-lg border border-turbo-red/40 bg-turbo-red/10 px-4 py-3 transition-colors hover:border-turbo-red/80",children:[(0,f.jsx)("span",{className:"font-head text-sm font-bold text-white",children:"Corporate video \xb7 Melbourne"}),(0,f.jsx)(S.A,{className:"h-4 w-4 text-turbo-red"})]})]}),(0,f.jsx)(ae.gN,{className:"mb-6 grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:a.map(e=>(0,f.jsxs)(r.N_,{to:"/services/corporate-event-photography/".concat(e.slug),className:"group flex items-center justify-between rounded-lg border border-[#262626] bg-[#1A1A1A] px-4 py-3 transition-colors hover:border-turbo-red/50 hover:bg-turbo-red/5",children:[(0,f.jsxs)("span",{className:"font-head text-sm font-bold text-white",children:["Photography \xb7 ",e.name]}),(0,f.jsx)(S.A,{className:"h-4 w-4 text-[#8A8884] transition-colors group-hover:text-turbo-red"})]},e.slug))}),(0,f.jsx)(ae.gN,{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4",children:a.map(e=>(0,f.jsxs)(r.N_,{to:"/services/corporate-headshots/".concat(e.slug),className:"group flex items-center justify-between rounded-lg border border-[#262626] bg-[#1A1A1A] px-4 py-3 transition-colors hover:border-turbo-red/50 hover:bg-turbo-red/5",children:[(0,f.jsxs)("span",{className:"font-head text-sm font-bold text-white",children:["Headshots \xb7 ",e.name]}),(0,f.jsx)(S.A,{className:"h-4 w-4 text-[#8A8884] transition-colors group-hover:text-turbo-red"})]},"hs-".concat(e.slug)))}),(0,f.jsxs)("div",{className:"mt-8 flex flex-wrap gap-x-8 gap-y-3",children:[(0,f.jsxs)(r.N_,{to:"/video-production-melbourne",className:"inline-flex items-center gap-2 font-mono text-sm font-bold uppercase tracking-widest text-turbo-red transition-colors hover:text-redline",children:[(0,f.jsx)("span",{children:"Video production Melbourne"}),(0,f.jsx)(S.A,{className:"h-4 w-4"})]}),(0,f.jsxs)(r.N_,{to:"/corporate-video-melbourne",className:"inline-flex items-center gap-2 font-mono text-sm font-bold uppercase tracking-widest text-turbo-red transition-colors hover:text-redline",children:[(0,f.jsx)("span",{children:"Corporate video Melbourne"}),(0,f.jsx)(S.A,{className:"h-4 w-4"})]}),(0,f.jsxs)(r.N_,{to:"/services/corporate-event-photography",className:"inline-flex items-center gap-2 font-mono text-sm font-bold uppercase tracking-widest text-turbo-red transition-colors hover:text-redline",children:[(0,f.jsx)("span",{children:"All photography locations"}),(0,f.jsx)(S.A,{className:"h-4 w-4"})]}),(0,f.jsxs)(r.N_,{to:"/services/corporate-headshots",className:"inline-flex items-center gap-2 font-mono text-sm font-bold uppercase tracking-widest text-turbo-red transition-colors hover:text-redline",children:[(0,f.jsx)("span",{children:"All headsh
1ot locations"}),(0,f.jsx)(S.A,{className:"h-4 w-4"})]})]})]}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] px-[22px] py-[130px] text-center md:px-11",children:[(0,f.jsx)("img",{src:"/images/services/locations/event-coverage-panel-speaker.jpg",alt:"","aria-hidden":!0,className:"absolute inset-0 h-full w-full object-cover"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.78) 0%,rgba(13,13,13,.6) 40%,rgba(13,13,13,.9) 100%)"}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 50% 0%,rgba(191,33,47,.28),transparent 60%)"}}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-[900px]",children:[(0,f.jsx)(ae.YZ,{className:"mb-5",children:"08 / Ready"}),(0,f.jsxs)(ae.nl,{className:"mb-[26px] text-[clamp(42px,6.4vw,96px)] leading-[0.94] tracking-[-0.025em]",children:["Tell us",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"the brief."})]}),(0,f.jsx)("p",{className:"mx-auto mb-10 max-w-[560px] text-[clamp(17px,1.6vw,20px)] leading-[1.6] text-[#D9D6CF]",children:"One booking. Full crew. Same-day delivery when you need it. We'll have a quote back within hours."}),(0,f.jsx)(ae.$$,{to:"/get-quote",children:"Get a quote \u2192"})]})]}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})};var Wa=s(46963),Oa=s(42489),La=s(67010);const Ma=["sydney","melbourne","brisbane","perth","adelaide","canberra","hobart","darwin","geelong"],qa={Services:{columns:[{heading:"Capture",items:[{name:"Event Photography",desc:"5-star event capture",href:"/services"},{name:"Cinematic Video",desc:"Hero films + recap reels",href:"/services"},{name:"Live Streaming",desc:"Real-time multi-cam broadcast",href:"/services"},{name:"Headshots",desc:"In-room studio setup",href:"/services"}]},{heading:"Deliver",items:[{name:"Same-Day Edit",desc:"Ship while the room is hot",href:"/services"},{name:"Broadcast Production",desc:"Multi-camera, full crew",href:"/services"},{name:"Content Hub",desc:"Branded delivery portals",href:"/services"},{name:"Print + Web Ready",desc:"Pre-graded for every channel",href:"/services"}]}],feature:{eyebrow:"Why Turbo",title:"Same-day, broadcast-ready.",blurb:"From shutter click to client inbox in hours, not weeks.",image:"/images/services/locations/event-coverage-keynote.jpg",cta:{label:"See all services",href:"/services"}}},Industries:{columns:[{heading:"Corporate",items:[{name:"Business Events",desc:"Brand activations + AGMs",href:"/business"},{name:"Conferences",desc:"Multi-day, multi-camera",href:"/conferences"},{name:"Awards Nights",desc:"Editorial-grade gallery turnaround",href:"/business"}]},{heading:"Education & Lifestyle",items:[{name:"Schools",desc:"Photography, videography & virtual tours",href:"/schools"},{name:"Weddings",desc:"Films + photography",href:"https://weddings.turbo.net.au"}]},{heading:"Digital",items:[{name:"Web & App Development",desc:"Custom builds + integrations",href:"/development"}]}],feature:{eyebrow:"Built for the brief",title:"One crew, every room.",blurb:"Conference floor, corporate ballroom, school assembly \u2014 same delivery pipeline.",image:"/images/services/business-service.jpg",cta:{label:"See all industries",href:"/services"}}},Coverage:{custom:"coverage",feature:{eyebrow:"From Brisbane to Bali",title:"On the ground, anywhere in APAC.",blurb:"Hubs in every Australian capital, regional pickups across AU, plus NZ and South-East Asia.",image:"/hero-background.jpg",cta:{label:"Get a quote",href:"/get-quote"}}}},Ha=[{label:"Services",mega:"Services"},{label:"Industries",mega:"Industries"},{label:"Coverage",mega:"Coverage"},{label:"Recent Gigs",href:"/recent-gigs",flat:!0},{label:"About",href:"/about",flat:!0}],Ua="#BF212F",Ga=()=>{const[e,t]=(0,a.useState)(!1),[s,n]=(0,a.useState)(null);(0,a.useEffect)(()=>(document.body.style.overflow=e?"hidden":"unset",()=>{document.body.style.overflow="unset"}),[e]),(0,a.useEffect)(()=>{const e=e=>{"Escape"===e.key&&t(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);const i=()=>{t(!1),n(null)},o=e=>{let{href:t,className:s,children:a,onClick:n}=e;return/^https?:\/\//.test(t)?(0,f.jsx)("a",{href:t,className:s,onClick:()=>{null===n||void 0===n||n(),i()},children:a}):(0,f.jsx)(r.N_,{to:t,className:s,onClick:()=>{null===n||void 0===n||n(),i()},children:a})},l=Ma.map(e=>{const t=(0,L.KM)(e);return t?{name:t.name,state:t.state,slug:e}:{name:e,state:"",slug:e}});return(0,f.jsxs)("div",{className:"lg:hidden tmm",children:[(0,f.jsx)("style",{children:"\n @import url('https://fonts.googleapis.com/css2?family=Archivo+Expanded:wght@700;800;900&family=Hanken+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');\n .tmm { font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif; }\n .tmm-display { font-family: 'Archivo Expanded', 'Hanken Grotesk', sans-serif; letter-spacing: -0.02em; line-height: 0.98; }\n .tmm-mono { font-family: 'Space Mono', monospace; text-transform: uppercase; letter-spacing: 0.24em; }\n @keyframes tmmIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }\n @keyframes tmmRow { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }\n .tmm-panel { animation: tmmIn 0.32s cubic-bezier(0.16,1,0.3,1) forwards; }\n .tmm-row { animation: tmmRow 0.4s cubic-bezier(0.16,1,0.3,1) both; }\n"}),(0,f.jsx)("button",{onClick:()=>t(!0),className:"inline-flex items-center justify-center w-11 h-11 rounded-xl bg-[#141414] text-white active:scale-95 transition-transform","aria-label":"Open menu",type:"button",children:(0,f.jsx)(cs.A,{size:22,strokeWidth:2.5})}),e&&(0,f.jsxs)("div",{className:"fixed inset-0 z-[100] tmm",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:i}),(0,f.jsxs)("div",{className:"tmm-panel absolute inset-y-0 right-0 w-full max-w-md bg-[#141414] text-[#F4F2EE] flex flex-col overflow-hidden shadow-2xl",children:[(0,f.jsxs)("svg",{viewBox:"0 0 100 100","aria-hidden":"true",className:"pointer-events-none absolute -bottom-10 -right-8 h-80 w-80 text-white/[0.035]",fill:"none",stroke:"currentColor",strokeWidth:"14",strokeLinecap:"round",children:[(0,f.jsx)("path",{d:"M10 26 A64 64 0 0 1 74 90"}),(0,f.jsx)("path",{d:"M10 56 A34 34 0 0 1 44 90"})]}),(0,f.jsxs)("div",{className:"flex h-1 w-full shrink-0",children:[(0,f.jsx)("span",{className:"flex-1",style:{background:Ua}}),(0,f.jsx)("span",{className:"flex-1",style:{background:"#F2A900"}}),(0,f.jsx)("span",{className:"flex-1",style:{background:"#0FA3A3"}})]}),(0,f.jsxs)("div",{className:"relative flex items-center justify-between px-6 h-20 shrink-0 border-b border-white/10",children:[(0,f.jsx)(r.N_,{to:"/",onClick:i,className:"flex items-center",children:(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-9 w-auto"})}),(0,f.jsx)("button",{onClick:i,className:"inline-flex items-center justify-center w-10 h-10 rounded-full border border-white/15 text-white/80 hover:text-white hover:border-white/40 transition-colors","aria-label":"Close menu",type:"button",children:(0,f.jsx)(g.A,{size:20})})]}),(0,f.jsx)("nav",{className:"relative flex-1 overflow-y-auto overscroll-contain px-6 py-4",children:Ha.map((e,t)=>{const a=String(t+1).padStart(2,"0"),r={animationDelay:"".concat(.06*t+.05,"s")};if(e.flat)return(0,f.jsx)("div",{className:"tmm-row border-b border-white/10",style:r,children:(0,f.jsxs)(o,{href:e.href,className:"group flex items-center gap-4 py-5",children:[(0,f.jsx)("span",{className:"tmm-mono text-[10px] text-white/35 w-6",children:a}),(0,f.jsx)("span",{className:"tmm-display text-3xl font-extrabold text-white flex-1 group-active:text-[color:var(--r)]",style:{"--r":Ua},children:e.label}),(0,f.jsx)(S.A,{className:"h-5 w-5 text-white/30 group-hover:text-[color:var(--r)] transition-colors",style:{"--r":Ua}})]})},e.label);const i=qa[e.mega],c=s===e.mega,d="coverage"===(null===i||void 0===i?void 0:i.custom);return(0,f.jsxs)("div",{className:"tmm-row border-b border-white/10",style:r,children:[(0,f.jsxs)("button",{type:"button",onClick:()=>n(c?null:e.mega),className:"group w-full flex items-center gap-4 py-5 text-left","aria-expanded":c,children:[(0,f.jsx)("span",{className:"tmm-mono text-[10px] text-white/35 w-6",children:a}),(0,f.jsx)("span",{className:"tmm-display text-3xl font-extrabold flex-1 transition-colors ".concat(c?"text-[color:var(--r)]":"text-white"),style:{"--r":Ua},children:e.label}),(0,f.jsx)(ls.A,{className:"h-5 w-5 transition-transform duration-300 ".concat(c?"rotate-45 text-[color:var(--r)]":"text-white/40"),style:{"--r":Ua}})]}),(0,f.jsx)("div",{className:"overflow-hidden transition-all duration-300 ease-out ".concat(c?"max-h-[640px] opacity-100":"max-h-0 opacity-0"),children:(0,f.jsxs)("div",{className:"pb-5 pl-10 pr-1",children:[d?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"text-sm text-white/60 mb-4 leading-relaxed",children:"We dispatch crews from every Australian capital, plus NZ and South-East Asia. Tell us where the event is \u2014 we'll be there."}),(0,f.jsx)("div",{className:"tmm-mono text-[10px] text-white/40 mb-2",children:"Crew hubs"}),(0,f.jsx)("div",{className:"grid grid-cols-2 gap-1.5 mb-4",children:l.map(e=>(0,f.jsxs)(o,{href:"/services/locations/".concat(e.slug),className:"flex items-center justify-between rounded-lg border border-white/10 px-3 py-2 hover:border-white/30 transition-colors",children:[(0,f.jsx)("span",{className:"text-sm font-semibold text-white",children:e.name}),(0,f.jsx)("span",{className:"tmm-mono text-[9px] text-white/35",children:e.state})]},e.slug))})]}):i.columns.map(e=>(0,f.jsxs)("div",{className:"mb-4 last:mb-0",children:[(0,f.jsx)("div",{className:"tmm-mono text-[10px] mb-2",style:{color:Ua},children:e.heading}),(0,f.jsx)("ul",{className:"space-y-0.5",children:e.items.map(e=>(0,f.jsx)("li",{children:(0,f.jsxs)(o,{href:e.href,className:"group flex items-center gap-2 py-2",children:[(0,f.jsx)("span",{className:"text-[15px] font-semibold text-white/90 group-hover:text-white",children:e.name}),/^https?:\/\//.test(e.href)?(0,f.jsx)(La.A,{className:"h-3.5 w-3.5 text-white/25"}):(0,f.jsx)(S.A,{className:"h-3.5 w-3.5 text-white/0 group-hover:text-white/40 -translate-x-1 group-hover:translate-x-0 transition-all"})]})},e.name))})]},e.heading)),(0,f.jsxs)(o,{href:i.feature.cta.href,className:"inline-flex items-center gap-2 mt-1 text-xs font-bold tracking-wide",children:[(0,f.jsx)("span",{style:{color:Ua},children:i.feature.cta.label}
1),(0,f.jsx)(S.A,{className:"h-3.5 w-3.5",style:{color:Ua}})]})]})})]},e.label)})}),(0,f.jsxs)("div",{className:"relative shrink-0 px-6 pt-4 pb-6 border-t border-white/10 bg-[#0f0f0f]",children:[(0,f.jsx)(o,{href:"/get-quote",className:"group block w-full h-14 active:scale-[0.99] transition-transform",children:(0,f.jsxs)("span",{className:"flex items-center justify-center gap-2 w-full h-full rounded-xl text-white font-bold uppercase tracking-[0.16em] text-sm",style:{background:Ua},children:["Get a Quote",(0,f.jsx)(S.A,{className:"h-4 w-4 group-active:translate-x-0.5 transition-transform"})]})}),(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-3 mt-3",children:[(0,f.jsxs)(o,{href:"/client-login",className:"inline-flex items-center justify-center gap-2 h-12 rounded-xl border border-white/15 text-white/90 text-sm font-semibold hover:border-white/40 transition-colors",children:[(0,f.jsx)(Ye.A,{className:"h-4 w-4"})," Client Login"]}),(0,f.jsxs)("a",{href:"tel:1300207446",onClick:i,className:"inline-flex items-center justify-center gap-2 h-12 rounded-xl border border-white/15 text-white/90 text-sm font-semibold hover:border-white/40 transition-colors",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"})," 1300 207 446"]})]}),(0,f.jsxs)("div",{className:"mt-5 flex items-center justify-between",children:[(0,f.jsx)("span",{className:"tmm-mono text-[10px] text-white/40",children:"Every angle. Full speed."}),(0,f.jsx)("span",{className:"tmm-mono text-[9px] text-white/25",children:"AU \xb7 NZ \xb7 SG"})]})]})]})]})]})},Va=()=>{const[e,t]=(0,a.useState)("virtual-tours"),s=[{id:"virtual-tours",icon:et.A,title:"School Virtual Tours",description:"Interactive 360\xb0 virtual tours for school enrolment marketing, allowing prospective families to explore your school from anywhere.",features:["360\xb0 immersive experience","Interactive hotspots","Accessibility from anywhere","Enhanced engagement","Comprehensive facility showcase","Mobile-friendly viewing"]},{id:"video-production",icon:Ge.A,title:"School Video Production",description:"Professional video production for school productions, graduations, and events with high-end quality and online premiere experiences.",features:["School production filming","Graduation ceremonies","Event documentation","Multi-camera setups","Professional editing","Online streaming capability"]},{id:"live-streaming",icon:F.A,title:"Live Streaming Services",description:"Live stream school events, graduations, and productions so families can participate remotely and access content online.",features:["Real-time streaming","Multiple platform support","Professional audio/video","Remote family access","Recording for later viewing","Interactive features"]}],n=[{icon:Wa.A,title:"Accessibility",description:"Parents and students can explore the school from anywhere, convenient for those who cannot visit in person due to geographical or time constraints."},{icon:_.A,title:"Enhanced Engagement",description:"Interactive elements engage prospective students and parents more effectively than static images or brochures."},{icon:gs.A,title:"Showcasing Facilities",description:"Highlight state-of-the-art facilities, special programs, and unique features in a visually appealing manner."},{icon:At.A,title:"Cost-Effective",description:"Reduces the need for multiple physical tours, saving time and resources for school staff."},{icon:Oa.A,title:"Safety & Security",description:"Minimises disruptions to the school day and maintains security by limiting visitors on campus."},{icon:Xe.A,title:"Inclusivity",description:"Offers an alternative for families with special needs who might find physical tours challenging."}],i=[{src:"https://images.pixieset.com/30907998/d2fcdfbf531a9596f87430bd9807351c-xxlarge.jpg",alt:"School classroom environment",title:"Modern Learning Spaces",caption:"Contemporary classroom environments"},{src:"https://images.pixieset.com/30907998/87a0f70216c7e97b4acd8d6587f48519-xxlarge.jpg",alt:"School facilities and grounds",title:"Campus Facilities",caption:"Beautiful school grounds and facilities"},{src:"https://images.pixieset.com/30907998/ebc80c07306a4bd51e9fbb713f5dd732-xxlarge.jpg",alt:"School
1community and activities",title:"School Community",caption:"Students and school life"},{src:"https://images.pixieset.com/30907998/8a97c99f8f42f64dadf125b491d0c161-xxlarge.jpg",alt:"School events and activities",title:"School Events",caption:"Capturing special moments"},{src:"https://images.pixieset.com/51970059/7bd02a9126a0fc7cc6777539091a7e77-xxlarge.jpg",alt:"Professional school photography",title:"Professional Documentation",caption:"High-quality school photography"}];return(0,f.jsxs)(ae.mP,{children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"School Photography & Virtual Tours | Turbo 360"}),(0,f.jsx)("meta",{name:"description",content:"School photography, 360 virtual tours, graduation filming & live streaming across Australia. Sports days, productions & events with same-day delivery."}),(0,f.jsx)("meta",{name:"robots",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),(0,f.jsx)("meta",{name:"keywords",content:"school photography, school virtual tours, school video production, graduation filming, school event photography, 360 school tours, school live streaming, sports day photographer, education marketing"}),(0,f.jsx)("link",{rel:"canonical",href:"https://turbo.net.au/schools"}),(0,f.jsx)("meta",{property:"og:title",content:"School Photography, Virtual Tours & Video Production | Turbo 360"}),(0,f.jsx)("meta",{property:"og:description",content:"School photography, 360 virtual tours, graduation filming & live streaming across Australia. Interactive school tours for enrolment marketing."}),(0,f.jsx)("meta",{property:"og:type",content:"website"}),(0,f.jsx)("meta",{property:"og:url",content:"https://turbo.net.au/schools"}),(0,f.jsx)("meta",{property:"og:image",content:"https://turbo.net.au/hero-background.jpg"}),(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("meta",{name:"twitter:title",content:"School Photography, Virtual Tours & Video Production | Turbo 360"}),(0,f.jsx)("meta",{name:"twitter:description",content:"School photography, 360 virtual tours, graduation filming & live streaming. Interactive tours for enrolment marketing across Australia."}),(0,f.jsx)("meta",{name:"twitter:image",content:"https://turbo.net.au/hero-background.jpg"}),(0,f.jsx)("script",{type:"application/ld+json",children:'\n {\n "@context": "https://schema.org",\n "@type": "Service",\n "name": "School Virtual Tours & Video Production",\n "description": "Professional school virtual tours and video production services for enrolment marketing and school events",\n "provider": {\n "@type": "ProfessionalService",\n "name": "Turbo 360",\n "url": "https://turbo.net.au",\n "telephone": "+61-1300-207-446",\n "email": "[email protected]",\n "aggregateRating": {\n "@type": "AggregateRating",\n "ratingValue": "5.0",\n "reviewCount": "180"\n }\n },\n "areaServed": [\n {\n "@type": "City",\n "name": "Melbourne"\n },\n {\n "@type": "City",\n "name": "Brisbane"\n },\n {\n "@type": "City",\n "name": "Sydney"\n },\n {\n "@type": "Country",\n "name": "Australia"\n }\n ],\n "serviceType": "Educational Technology Services",\n "hasOfferCatalog": {\n "@type": "OfferCatalog",\n "name": "School Services",\n "itemListElement": [\n {\n "@type": "Offer",\n "itemOffered": {\n "@type": "Service",\n "name": "School Virtual Tours",\n "description": "Interactive 360\xb0 virtual tours for school enrolment marketing"\n }\n },\n {\n "@type": "Offer",\n "itemOffered": {\n "@type": "Service",\n "name": "School Video Production",\n "description": "Professional video production for graduations and school events"\n }\n },\n {\n "@type": "Offer",\n "itemOffered": {\n "@type": "Service",\n "name": "Live Streaming",\n "description": "Live streaming services for school events and productions"\n }\n }\n ]\n }\n }\n '}),(0,f.jsx)("script",{type:"application/ld+json",children:'\n {\n "@context": "https://schema.org",\n "@type": "FAQPage",\n "mainEntity": [\n {\n "@type": "Question",\n "name": "What types of school events do you photograph?",\n "acceptedA
1nswer": {\n "@type": "Answer",\n "text": "Turbo 360 covers a wide range of school events including sports days, graduations, school productions and performances, open days, awards ceremonies, camps, and special celebrations. We also create 360-degree virtual tours for school enrolment marketing and produce professional video content for graduations and school events."\n }\n },\n {\n "@type": "Question",\n "name": "How quickly are school photos delivered?",\n "acceptedAnswer": {\n "@type": "Answer",\n "text": "For school events, we offer our signature same-day delivery service \u2014 edited photos are delivered within hours of the event. School production videos and graduation films are typically delivered within 7-14 business days. Virtual tours are completed within 2-4 weeks of the on-site shoot, depending on school size."\n }\n },\n {\n "@type": "Question",\n "name": "Do you offer virtual tours for schools?",\n "acceptedAnswer": {\n "@type": "Answer",\n "text": "Yes, Turbo 360 specialises in interactive 360-degree virtual tours for schools. Our virtual tours allow prospective families to explore classrooms, facilities, and grounds from anywhere in the world. Schools using our virtual tours have reported up to a 40% increase in enrolment enquiries. The tours feature interactive hotspots, are mobile-friendly, and can be embedded on your school website."\n }\n },\n {\n "@type": "Question",\n "name": "What areas do you cover for school photography?",\n "acceptedAnswer": {\n "@type": "Answer",\n "text": "Turbo 360 covers schools across all major Australian cities including Sydney, Melbourne, Geelong, Brisbane, Perth, Adelaide, Canberra, Hobart, and Darwin. We have a particularly strong presence in Melbourne and Victoria. We\'ve served over 100 schools nationwide with photography, videography, virtual tours, and live streaming services."\n }\n }\n ]\n }\n '}),(0,f.jsx)("script",{type:"application/ld+json",children:'\n {\n "@context": "https://schema.org",\n "@type": "BreadcrumbList",\n "itemListElement": [\n {\n "@type": "ListItem",\n "position": 1,\n "name": "Home",\n "item": "https://turbo.net.au/"\n },\n {\n "@type": "ListItem",\n "position": 2,\n "name": "School Photography & Virtual Tours",\n "item": "https://turbo.net.au/schools"\n }\n ]\n }\n '})]}),(0,f.jsx)(D.A,{currentPage:"Schools"}),(0,f.jsxs)("section",{className:"relative flex min-h-[88vh] items-center justify-center overflow-hidden bg-carbon-900",children:[(0,f.jsx)("div",{className:"absolute inset-0 z-0 bg-cover bg-center",style:{backgroundImage:'url("https://images.pixieset.com/30907998/7872da9f53adc61714feb3998054845d-xxlarge.jpg")'},children:(0,f.jsx)("div",{className:"absolute inset-0 bg-carbon-900/70"})}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0 z-[1]",style:{background:"linear-gradient(180deg,rgba(13,13,13,.55) 0%,rgba(13,13,13,.35) 40%,#0d0d0d 100%)"}}),(0,f.jsx)("div",{className:"relative z-10 mx-auto w-full max-w-7xl px-[22px] py-28 text-center md:px-11",children:(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)("div",{className:"mb-6 flex items-center justify-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsx)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:"Education Specialists"})]}),(0,f.jsxs)("h1",{className:"m-0 font-display text-[clamp(44px,8vw,116px)] font-extrabold leading-[0.9] tracking-[-0.025em] text-smoke [text-wrap:balance]",children:["SCHOOL",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"PHOTOGRAPHY &"}),(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-smoke",children:"EVENT COVERAGE"})]}),(0,f.jsx)("p",{className:"mx-auto mt-8 max-w-3xl text-[clamp(17px,1.6vw,22px)] leading-[1.6] text-[#D9D6CF]",children:"Revolutionary 360\xb0 virtual tours for school enrolment marketing and professional video production for graduations and school events across Melbourne and Victoria."}),(0,f.jsxs)("div",{className:"mt-9 flex flex-col items-stretch justify-center gap-4 sm:flex-row sm:items-center",children:[(0,f.jsxs)(ae.$$,{to:"/get-quote",children:["GET YOUR QUOTE",(0,f.jsx)(bs.A,{className:"h-5 w-5"})]}),(0,f.jsxs)(ae.qM,{href:"#virtual-tour",onClick:e=>{e.preventDefault(),document.getElementById("virtual-tour").scrollIntoView({behavior:"smooth"})},children:["VIEW VIRTUAL TOUR",(0,f.jsx)(et.A,{className:"h-5 w-5"})]})]}),(0,f.jsxs)("div",{className:"mx-auto mt-16 grid max-w-4xl grid-cols-2 gap-8 md:grid-cols-4",children:[(0,f.jsxs)("div",{className:"border-t-2 border-white/25 pt-5",children:[(0,f.jsx)("div",{className:"font-display text-[clamp(32px,4vw,52px)] font-extrabold leading-none tracking-[-0.02em] text-turbo-red",children:"100+"}),(0,f.jsx)("div",{className:"mt-2 font-mono text-xs uppercase tracking-[0.16em] text-fog",children:"Schools Served"})]}),(0,f.jsxs)("div",{className:"border-t-2 border-white/25 pt-5",children:[(0,f.jsx)("div",{className:"font-display text-[clamp(32px,4vw,52px)] font-extrabold leading-none tracking-[-0.02em] text-smoke",children:"360\xb0"}),(0,f.jsx)("div",{className:"mt-2 font-mono text-xs uppercase tracking-[0.16em] text-fog",children:"Virtual Tours"})]}),(0,f.jsxs)("div",{className:"border-t-2 border-white/25 pt-5",children:[(0,f.jsx)("div",{className:"font-display text-[clamp(32px,4vw,52px)] font-extrabold leading-none tracking-[-0.02em] text-smoke",children:"40%"}),(0,f.jsx)("div",{className:"mt-2 font-mono text-xs uppercase tracking-[0.16em] text-fog",children:"Increased Enquiries"})]}),(0,f.jsxs)("div",{className:"border-t-2 border-white/25 pt-5",children:[(0,f.jsx)("div",{className:"font-display text-[clamp(32px,4vw,52px)] font-extrabold leading-none tracking-[-0.02em] text-smoke",children:"24/7"}),(0,f.jsx)("div",{className:"mt-2 font-mono text-xs uppercase tracking-[0.16em] text-fog",children:"Accessibility"})]})]})]})})]}),(0,f.jsxs)(ae.wn,{id:"virtual-tour",tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / Interactive Experience"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["VI
1RTUAL TOUR ",(0,f.jsx)("span",{className:"text-turbo-red",children:"SHOWCASE"})]}),(0,f.jsx)("p",{className:"mt-6 text-[17px] leading-[1.6] text-[#9C9A95]",children:"Experience our interactive 360\xb0 virtual tour technology. Navigate through Catholic Regional College and see how families can explore your school from anywhere in the world."})]}),(0,f.jsxs)(ae.gN,{className:"overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A]",children:[(0,f.jsxs)("div",{className:"relative w-full group cursor-pointer",style:{paddingBottom:"56.25%",minHeight:"400px"},children:[(0,f.jsx)("img",{src:"/hero-background.jpg",alt:"Catholic Regional College Virtual Tour Preview",className:"absolute top-0 left-0 w-full h-full object-cover border-0"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-carbon-900/50 group-hover:bg-carbon-900/30 transition-all duration-300"}),(0,f.jsx)("a",{href:"https://virtual.turbo360.com.au/catholicregionalcollege//update3/",target:"_blank",rel:"noopener noreferrer",className:"absolute inset-0 flex items-center justify-center group",children:(0,f.jsx)("div",{className:"bg-turbo-red hover:bg-redline text-white px-8 py-4 rounded-lg font-head font-bold text-xl transform group-hover:scale-105 transition-all duration-300 shadow-2xl border border-white/20",children:(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("svg",{className:"w-8 h-8",fill:"currentColor",viewBox:"0 0 24 24",children:(0,f.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z"})}),"View Tour"]})})}),(0,f.jsx)("div",{className:"absolute top-4 left-4 rounded bg-turbo-red/90 px-2.5 py-[5px] font-mono text-[11px] uppercase tracking-[0.2em] text-white backdrop-blur-sm",children:"360\xb0 Virtual Tour"})]}),(0,f.jsxs)("div",{className:"p-8 bg-carbon-900",children:[(0,f.jsx)("h3",{className:"font-head text-2xl font-bold text-smoke mb-2",children:"Catholic Regional College Virtual Tour"}),(0,f.jsx)("p",{className:"text-[#9C9A95] mb-4 leading-[1.6]",children:"This interactive 360\xb0 tour allows prospective families to explore the school's facilities, classrooms, and unique learning environments at their own pace."}),(0,f.jsx)("div",{className:"flex flex-wrap gap-2",children:["360\xb0 Navigation","Interactive Hotspots","Mobile Friendly","Full Screen Mode"].map(e=>(0,f.jsx)("span",{className:"rounded-full border border-[#2B2B2B] px-4 py-[7px] font-mono text-[11px] uppercase tracking-[0.12em] text-fog",children:e},e))})]})]})]}),(0,f.jsxs)(ae.wn,{id:"services",tone:"carbon",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"02 / Our Services"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["SCHOOL ",(0,f.jsx)("span",{className:"text-turbo-red",children:"SERVICES"})]}),(0,f.jsx)("p",{className:"mt-6 text-[17px] leading-[1.6] text-[#9C9A95]",children:"Comprehensive digital solutions for schools, from virtual tours to video production and live streaming services."})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-3",children:s.map((e,t)=>{const s=e.icon;return(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"flex h-full flex-col rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-8 transition-colors hover:border-turbo-red",children:[(0,f.jsxs)("div",{className:"flex items-center mb-5",children:[(0,f.jsx)("div",{className:"mr-4 inline-flex h-12 w-12 items-center justify-center rounded-lg bg-turbo-red/15",children:(0,f.jsx)(s,{className:"h-7 w-7 text-turbo-red"})}),(0,f.jsx)("h3",{className:"font-head text-xl font-bold text-smoke",children:e.title})]}),(0,f.jsx)("p",{className:"text-[#9C9A95] mb-6 leading-[1.6]",children:e.description}),(0,f.jsx)("div",{className:"mt-auto space-y-2.5",children:e.features.map((e,t)=>(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 text-turbo-red mr-2.5 flex-shrink-0"}),(0,f.jsx)("span",{className:"text-[#C7C4BD] text-sm",children:e})]},t))})]})},t)})})]}),(0,f.jsxs)(ae.wn,{tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"03 / Our Work"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["SCHOOL ",(0,f.jsx)("span",{className:"text-turbo-red",children:"PHOTOGRAPHY"})]}),(0,f.jsx)("p",{className:"mt-6 text-[17px] leading-[1.6] text-[#9C9A95]",children:"Capturing the essence of school life, learning environments, and special moments that showcase your institution's unique character."})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-3",children:[i.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsx)("div",{className:"group overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A]",children:(0,f.jsxs)("div",{className:"relative h-64 overflow-hidden",children:[(0,f.jsx)("img",{src:e.src,alt:e.alt,className:"w-full h-full object-cover transition-transform duration-700 ease-turbo group-hover:scale-[1.06]"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 40%,rgba(13,13,13,.85))"}}),(0,f.jsxs)("div",{className:"absolute bottom-4 left-4 right-4",children:[(0,f.jsx)("h3",{className:"font-head text-white font-bold text-lg",children:e.title}),(0,f.jsx)("p",{className:"text-[#C7C4BD] text-sm",children:e.caption})]})]})})},t)),(0,f.jsx)(ae.gN,{delay:i.length%3*80,children:(0,f.jsxs)("div",{className:"flex h-full flex-col items-center justify-center rounded-[10px] border border-turbo-red bg-turbo-red p-8 text-center min-h-[256px]",children:[(0,f.jsx)(Ue.A,{className:"h-12 w-12 text-white mb-4"}),(0,f.jsx)("h3",{className:"font-head text-white font-bold text-xl mb-2",children:"Ready to Showcase Your School?"}),(0,f.jsx)("p",{className:"text-white/90 text-sm mb-5",children:"Get professional photography and virtual tours for your institution"}),(0,f.jsxs)(r.N_,{to:"/get-quote",className:"inline-flex items-center gap-2 rounded-lg bg-white px-7 py-3 font-head text-base font-bold text-turbo-red transition-transform duration-[400ms] ease-turbo hover:-translate-y-[3px]",children:["Get Started",(0,f.jsx)(S.A,{className:"h-4 w-4"})]})]})})]})]}),(0,f.jsxs)(ae.wn,{tone:"carbon",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"04 / Virtual Tour Benefits"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["WHY CHOOSE ",(0,f.jsx)("span",{className:"text-turbo-red",children:"VIRTUAL TOURS"})]}),(0,f.jsx)("p",{className:"mt-6 text-[17px] leading-[1.6] text-[#9C9A95]",children:"Virtual tours offer numerous advantages for schools, enhancing accessibility, engagement, and enrolment marketing effectiveness."})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-3",children:n.map((e,t)=>{const s=e.icon;return(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"flex h-full flex-col rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-8 transition-colors hover:border-turbo-red",children:[(0,f.jsx)("div",{className:"mb-5 inline-flex h-14 w-14 items-center justify-center rounded-lg bg-turbo-red/15",children:(0,f.jsx)(s,{className:"h-7 w-7 text-turbo-red"})}),(0,f.jsx)("h3",{className:"font-head text-xl font-bold mb-3 text-smoke",children:e.title}),(0,f.jsx)("p",{className:"text-[#9C9A95] leading-[1.6]",children:e.description})]})},t)})})]}),(0,f.jsxs)(ae.wn,{tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"05 / School Success Stories"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["WHAT SCHOOLS ",(0,f.jsx)("span",{className:"text-turbo-red",children:"SAY"})]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-3",children:[{school:"Melbourne Grammar School",quote:"The virtual tour has revolutionised our enrolment process. Families from interstate and overseas can now experience our campus before making the journey. Enquiries increased by 40% since launch.",rating:5},{school:"Catholic Regional College",quote:"Turbo 360's virtual tour perfectly captures the essence of our school
1community. The interactive features allow prospective families to truly understand what makes our school special.",rating:5},{school:"Brighton Secondary College",quote:"The professional video production for our school production was outstanding. Families who couldn't attend in person felt completely included through the live stream.",rating:5}].map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"flex h-full flex-col rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-8",children:[(0,f.jsx)("div",{className:"flex mb-5",children:[...Array(e.rating)].map((e,t)=>(0,f.jsx)(nt.A,{className:"h-5 w-5 text-turbo-red fill-current"},t))}),(0,f.jsxs)("p",{className:"text-[#C7C4BD] mb-6 italic leading-[1.6]",children:['"',e.quote,'"']}),(0,f.jsx)("div",{className:"mt-auto font-mono text-[12px] uppercase tracking-[0.16em] text-turbo-red",children:e.school})]})},t))})]}),(0,f.jsx)(ae.wn,{tone:"carbon",children:(0,f.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-14",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"06 / Common Questions"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["SCHOOL ",(0,f.jsx)("span",{className:"text-turbo-red",children:"FAQ"})]})]}),(0,f.jsx)("div",{className:"space-y-5",children:[{q:"What types of school events do you photograph?",a:"Turbo 360 covers a wide range of school events including sports days, graduations, school productions and performances, open days, awards ceremonies, camps, and special celebrations. We also create 360-degree virtual tours for school enrolment marketing and produce professional video content for graduations and school events."},{q:"How quickly are school photos delivered?",a:"For school events, we offer our signature same-day delivery service \u2014 edited photos are delivered within hours of the event. School production videos and graduation films are typically delivered within 7-14 business days. Virtual tours are completed within 2-4 weeks of the on-site shoot, depending on school size."},{q:"Do you offer virtual tours for schools?",a:"Yes, Turbo 360 specialises in interactive 360-degree virtual tours for schools. Our virtual tours allow prospective families to explore classrooms, facilities, and grounds from anywhere in the world. Schools using our virtual tours have reported up to a 40% increase in enrolment enquiries. The tours feature interactive hotspots, are mobile-friendly, and can be embedded on your school website."},{q:"What areas do you cover for school photography?",a:"Turbo 360 covers schools across all Australian capital cities including Sydney, Melbourne, Brisbane, Perth, Adelaide, Canberra, Hobart, and Darwin. We have a particularly strong presence in Melbourne and Victoria. We've served over 100 schools nationwide with photography, videography, virtual tours, and live streaming services."}].map((e,t)=>(0,f.jsx)(ae.gN,{delay:60*t,children:(0,f.jsxs)("div",{className:"rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors hover:border-turbo-red",children:[(0,f.jsx)("h3",{className:"font-head text-xl font-bold text-smoke mb-3",children:e.q}),(0,f.jsx)("p",{className:"text-[#9C9A95] leading-relaxed",children:e.a})]})},t))})]})}),(0,f.jsxs)(ae.wn,{tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{className:"mb-10 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"07 / Coverage"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(32px,4.6vw,60px)]",children:["SCHOOL PHOTOGRAPHY ",(0,f.jsx)("span",{className:"text-turbo-red",children:"ACROSS AUSTRALIA"})]}),(0,f.jsx)("p",{className:"mt-6 text-[17px] leading-[1.6] text-[#9C9A95]",children:"School photography, virtual tours and event coverage available in all Australian capital cities."})]}),(0,f.jsx)(ae.gN,{className:"grid grid-cols-2 gap-[14px] md:grid-cols-4",children:[{name:"Sydney",slug:"sydney"},{name:"Melbourne",slug:"melbourne"},{name:"Brisbane",slug:"brisbane"},{name:"Perth",slug:"perth"},{name:"Adelaide",slug:"adelaide"},{name:"Canberra",slug:"canberra"},{name:"Hobart",slug:"hobart"},{name:"Darwin",slug:"darwin"}].map(e=>(0,f.jsxs)(r.N_,{to:"/services/event-coverage/".concat(e.slug),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-4 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-turbo-red mr-2 flex-shrink-0"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] group-hover:text-smoke transition-colors text-sm font-semibold",children:["Event Photography ",e.name]})]},e.slug))}),(0,f.jsx)(ae.gN,{className:"mt-8",children:(0,f.jsxs)(r.N_,{to:"/services/event-coverage",className:"inline-flex items-center gap-2 font-mono text-[13px] uppercase tracking-[0.16em] text-fog transition-colors hover:text-turbo-red",children:["View all event coverage locations ",(0,f.jsx)(S.A,{className:"inline h-4 w-4"})]})})]}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] bg-carbon px-[22px] py-[120px] text-center md:px-11",children:[(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 50% 0%,rgba(191,33,47,.22),transparent 60%)"}}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-[900px]",children:[(0,f.jsx)(ae.YZ,{className:"mb-5",children:"08 / Ready"}),(0,f.jsx)(ae.nl,{className:"text-[clamp(42px,6.4vw,96px)] tracking-[-0.025em]",children:"READY TO INNOVATE?"}),(0,f.jsx)("p",{className:"mx-auto mb-10 mt-6 max-w-[560px] text-[clamp(17px,1.6vw,20px)] leading-[1.6] text-[#C7C4BD]",children:"Transform your school's enrolment process with cutting-edge virtual tours and professional video production."}),(0,f.jsx)("div",{className:"mb-12 flex flex-col items-center justify-center gap-4 sm:flex-row",children:(0,f.jsxs)(ae.$$,{to:"/get-quote",children:["GET STARTED TODAY",(0,f.jsx)(bs.A,{className:"h-5 w-5"})]})}),(0,f.jsxs)("div",{className:"grid grid-cols-1 gap-8 text-left md:grid-cols-3",children:[(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("h4",{className:"font-mono text-xs uppercase tracking-[0.16em] text-turbo-red mb-2",children:"CALL NOW"}),(0,f.jsx)("p",{className:"text-smoke",children:"1300 207 446"})]}),(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("h4",{className:"font-mono text-xs uppercase tracking-[0.16em] text-turbo-red mb-2",children:"EMAIL"}),(0,f.jsx)("p",{className:"text-smoke",children:"[email protected]"})]}),(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("h4",{className:"font-mono text-xs uppercase tracking-[0.16em] text-turbo-red mb-2",children:"COVERAGE"}),(0,f.jsx)("p",{className:"text-smoke",children:"Australia Wide"})]})]})]})]}),(0,f.jsx)("footer",{className:"border-t border-[#222] bg-carbon-900 py-12",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl px-[22px] text-center md:px-11",children:[(0,f.jsx)("div",{className:"flex justify-center mb-6",children:(0,f.jsx)("img",{src:"/turbo-logo-new.png",alt:"Turbo 360 Logo",className:"h-12 w-auto"})}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)("p",{className:"text-fog",children:"\xa9 2026 Turbo 360. Expert school virtual tours and video production services across Melbourne and Victoria."}),(0,f.jsx)("p",{className:"text-[#8A8884] text-sm font-mono tracking-[0.04em]",children:"Turbo Productions PTY LTD. ABN 18 150 556 102. HQ: Barwon Heads, Victoria"})]})]})}),(0,f.jsx)(z.A,{})]})};var Ja=s(57234),Ya=s(19829),Ka=s(20254),Za=s(42812);const $a=()=>{const[e,t]=(0,a.useState)(null),s=[{year:"1999",title:"CE Network Born",description:"James Anderson creates LakeEildon.com, a tourism site that became the unofficial bible of the lake.",icon:Ja.A},{year:"2000s",title:"Radio Career Begins",description:"James rocks the mic at Sun FM Mt Buller, then moves to Triple M Melbourne and Sydney, achieving #1 ratings.",icon:Ve.A},{year:"2005",title:"Big Events & Tours",description:"Coca-Cola Live & Local Tour, M-One Music Concert at Etihad Stadium \u2014 the Turbo name goes national.",icon:Ya.A},{year:"2006",title:"Video Production Focus",description:"Hangs up the headphones and manages video for the International Olympic Gymnastics Training Centre in the USA.",icon:Ge.A},{year:"2007-2008",title:"Global Adventures",description:"Globe-trotting to Russia, Panama, Alaska, South America, and running shows on Celebrity Infinity cruise ship.",icon:Ka.A},{year:"2009",title:"Turbo Productions",description:"CE Network levels up to Turbo Productions in Melbourne with photography, live streaming, and virtual tours.",icon:Ue.A},{year:"2020s",title:"International Expansion",description:"Full content beast covering Australia, New Zealand, and Singapore with same-day delivery expertise.",icon:Za.A}],n=[{icon:F.A,title:"Same-Day Delivery",description:"Turning corporate chaos into polished content before the coffee even kicks in."},{icon:za.A,title:"Professional Excellence",description:"From conferences in Sydney to exhibitions in Singapore \u2014 content sharp enough to make a marketing manager cry (tears of joy)."},{icon:fs.A,title:"Personal Touch",description:"Family-owned, 25+ years of media experience, genuine care for every project."},{icon:Ja.A,title:"Global Reach",description:"Australia, New Zealand and Singapore \u2014 chaotic events turned into scroll-stopping content worldwide."}];return(0,f.jsxs)(ae.mP,{className:"!pt-20",children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"About Turbo 360 | 25+ Years of Event Production"}),(0,f.jsx)("meta",{name:"description",content:"The team behind Australia's leading same-day event photography & video. 25+ years, 180+ 5\u2605 reviews, Fortune 500 clients. Founded by James 'Turbo' Anders
1on."}),(0,f.jsx)("meta",{name:"robots",content:"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1"}),(0,f.jsx)("meta",{name:"keywords",content:"about turbo 360, turbo 360 photographers, james turbo anderson, media production company history, 25 years experience, same day content delivery, australia media company, photography video production team, event production company"}),(0,f.jsx)("link",{rel:"canonical",href:"https://turbo.net.au/about"}),(0,f.jsx)("meta",{property:"og:title",content:"About Turbo 360 Photographers | 25+ Years of Event Production"}),(0,f.jsx)("meta",{property:"og:description",content:"Meet the team behind Australia's leading same-day event photography & 360 video production company. 25+ years experience, 180+ five-star reviews."}),(0,f.jsx)("meta",{property:"og:type",content:"website"}),(0,f.jsx)("meta",{property:"og:url",content:"https://turbo.net.au/about"}),(0,f.jsx)("meta",{property:"og:image",content:"https://turbo.net.au/images/legacy/e89773c2-f1d9-4d5f-7b33-fdc6770fcb00.jpeg"}),(0,f.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,f.jsx)("meta",{name:"twitter:title",content:"About Turbo 360 Photographers | 25+ Years of Event Production"}),(0,f.jsx)("meta",{name:"twitter:description",content:"Meet the team behind Australia's leading same-day event photography & 360 video production company. Founded by James 'Turbo' Anderson."}),(0,f.jsx)("meta",{name:"twitter:image",content:"https://turbo.net.au/images/legacy/e89773c2-f1d9-4d5f-7b33-fdc6770fcb00.jpeg"}),(0,f.jsx)("script",{type:"application/ld+json",children:'{"@context":"https://schema.org","@type":"Organization","name":"Turbo 360","alternateName":"Turbo Productions","description":"Professional photography and video production company with 25+ years of media experience","founder":{"@type":"Person","name":"James Anderson","alternateName":"James \'Turbo\' Anderson"},"foundingDate":"1999","url":"https://turbo.net.au","logo":"https://turbo.net.au/turbo-logo-new.png","image":"https://turbo.net.au/images/legacy/e89773c2-f1d9-4d5f-7b33-fdc6770fcb00.jpeg","areaServed":[{"@type":"Country","name":"Australia"},{"@type":"Country","name":"New Zealand"},{"@type":"Country","name":"Singapore"}],"serviceType":["Photography","Video Production","Live Streaming","Virtual Tours"],"hasCredential":{"@type":"EducationalOccupationalCredential","credentialCategory":"Media Broadcasting","recognizedBy":{"@type":"Organization","name":"Triple M Radio"}}}'}),(0,f.jsx)("script",{type:"application/ld+json",children:'{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://turbo.net.au/"},{"@type":"ListItem","position":2,"name":"About Turbo 360","item":"https://turbo.net.au/about"}]}'})]}),(0,f.jsx)(D.A,{currentPage:"About"}),(0,f.jsxs)("section",{className:"relative flex min-h-[80vh] items-end overflow-hidden bg-carbon-900",children:[(0,f.jsx)("div",{className:"absolute inset-0 z-0 bg-cover bg-center",style:{backgroundImage:'url("/hero-background.jpg")'}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0 z-[1]",style:{background:"linear-gradient(180deg,rgba(13,13,13,.55) 0%,rgba(13,13,13,.35) 38%,rgba(13,13,13,.78) 70%,#0d0d0d 100%)"}}),(0,f.jsx)("div",{className:"relative z-[2] w-full px-[22px] pb-20 md:px-11 md:pb-24",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)("div",{className:"mb-[26px] flex items-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsx)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:"Our story \xb7 since 1999"})]}),(0,f.jsxs)("h1",{className:"m-0 font-display text-[clamp(40px,7.6vw,116px)] font-extrabold leading-[0.9] tracking-[-0.025em] text-smoke [text-wrap:balance]",children:["Twenty-five years",(0,f.jsx)("br",{}),"of ",(0,f.jsx)("span",{className:"text-turbo-red",children:"turbocharging media."})]}),(0,f.jsx)("p",{className:"mt-[30px] max-w-3xl text-[clamp(17px,1.6vw,21px)] leading-[1.6] text-[#D9D6CF]",children:"From a sleepy regional Victorian town to international media production \u2014 quite a journey since 1999, through every facet of digital media."}),(0,f.jsxs)("div",{className:"mt-[38px] flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:[(0,f.jsxs)(ae.$$,{to:"/get-quote",children:[(0,f.jsx)(fs.A,{className:"h-5 w-5"}),"Work with us",(0,f.jsx)(S.A,{className:"h-5 w-5"})]}),(0,f.jsxs)(ae.qM,{href:"#story",onClick:e=>{var t;e.preventDefault(),null===(t=document.getElementById("story"))||void 0===t||t.scrollIntoView({behavior:"smooth"})},children:[(0,f.jsx)(S.A,{className:"h-5 w-5"}),"Our story"]})]})]})})]}),(0,f.jsx)("section",{id:"story",className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / Founder"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Meet James",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"\u2018Turbo\u2019 Anderson."})]})]}),(0,f.jsxs)("div",{className:"mt-12 grid grid-cols-1 items-center gap-16 lg:grid-cols-2",children:[(0,f.jsxs)(ae.gN,{className:"space-y-5 text-lg leading-relaxed text-[#C7C4BD]",children:[(0,f.jsx)("p",{children:"James \u2018Turbo\u2019 Anderson is the bloke behind Turbo 360 \u2014 the crew that turns corporate chaos into polished photo and video gold, often before the coffee's even kicked in. From conferences in Sydney to exhibitions in Singapore, his team delivers same-day content so sharp it'll make your marketing manager cry (tears of joy)."}),(0,f.jsx)("p",{children:"He also runs Photographers.com.au \u2014 the no-nonsense way to book a local pro without trawling through outdated directories or \u201cmates with cameras.\u201d"}),(0,f.jsx)("p",{children:"When he's not sprinting around with a gimbal or wrangling timelines, he's kicking back with his wife Laura, kids Scarlett and Sebastian, and their overly dramatic dogs Kodi and Ava."})]}),(0,f.jsxs)(ae.gN,{delay:80,className:"relative aspect-[3/4] overflow-hidden rounded-xl border border-[#262626]",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:"url('/images/legacy/e89773c2-f1d9-4d5f-7b33-fdc6770fcb00.jpeg')"}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 55%,rgba(13,13,13,.92))"}}),(0,f.jsxs)("div",{className:"absolute inset-x-6 bottom-6",children:[(0,f.jsx)("div",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.3em] text-turbo-red",children:"The founder"}),(0,f.jsx)("div",{className:"font-head text-[22px] font-bold leading-tight text-white",children:"25+ years on the mic, behind the lens, in the cut."})]})]})]})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-4xl",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"02 / History"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["From a tourism site",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"to a content beast."})]})]}),(0,f.jsxs)(ae.gN,{className:"mt-12 space-y-6 leading-relaxed text-[#C7C4BD]",children:[(0,f.jsx)("p",{children:"Back in the wild old days of 1999, CE Network was born \u2014 not out of a business plan, but out of a full-blown, sleep-depriving obsession. Our top dog, James Anderson, was neck-deep in code and caffeine when he whipped up LakeEildon.com \u2014 a tourism site that quickly became the unofficial bible of the lake."}),(0,f.jsx)("p",{children:"Before long, we were the local legends of web design and hosting \u2014 making mum-and-dad businesses look like Fortune 500 heavyweights online. But James w
1asn't content just ruling the digital domain \u2014 he had a mic to rock."}),(0,f.jsx)("p",{children:"Radio? Please. That was just the warm-up act. Soon, everyone knew the name Turbo \u2014 whether it was from the Coca-Cola Live & Local Tour, the M-One Music Concert at Etihad Stadium, or just hearing his voice everywhere."}),(0,f.jsx)("p",{children:"Come 2006, he hung up the headphones (after snagging that #1 ratings spot, mind you) and hit the gas on his other love: video production. Next stop? Managing video for the International Olympic Gymnastics Training Centre in the USA."}),(0,f.jsx)("p",{children:"Then came the real globe-trotting \u2014 Russia, Panama, Alaska, South America \u2014 and, just for good measure, running the show on the Celebrity Infinity cruise ship."}),(0,f.jsx)("p",{children:"By 2009, Turbo landed back in Melbourne, fired up and ready to shake up the media world. That's when CE Network levelled up into Turbo Productions, with a full arsenal of photography, live streaming, virtual tours, and every shiny gadget a media crew could want."}),(0,f.jsx)("p",{className:"font-bold text-smoke",children:"These days, Turbo Productions is a full-blown content beast \u2014 covering Australia, New Zealand and now Singapore, turning chaotic events into scroll-stopping content same-day, every day."})]})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"03 / Milestones"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Company",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"milestones."})]})]}),(0,f.jsxs)("div",{className:"relative mt-12 max-w-3xl",children:[(0,f.jsx)("div",{className:"absolute bottom-0 left-6 top-0 w-px bg-turbo-red/50"}),s.map((e,t)=>{const s=e.icon;return(0,f.jsxs)(ae.gN,{delay:t%3*60,className:"relative pb-10 pl-20 last:pb-0",children:[(0,f.jsx)("div",{className:"absolute left-3 top-1 flex h-6 w-6 items-center justify-center rounded-full border-4 border-carbon bg-turbo-red",children:(0,f.jsx)(s,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors hover:border-turbo-red/50",children:[(0,f.jsx)("div",{className:"mb-1 font-mono text-[11px] uppercase tracking-[0.3em] text-turbo-red",children:e.year}),(0,f.jsx)("h3",{className:"mb-2 font-head text-xl font-bold text-white",children:e.title}),(0,f.jsx)("p",{className:"leading-relaxed text-[#C7C4BD]",children:e.description})]})]},t)})]})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"04 / Memories"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["A visual",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"journey."})]}),(0,f.jsx)("p",{className:"mt-6 max-w-2xl text-lg text-[#9C9A95]",children:"From radio broadcasting days to international media production \u2014 click any frame to expand."})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:[{id:1,url:"/images/legacy/e89773c2-f1d9-4d5f-7b33-fdc6770fcb00.jpeg",title:"James 'Turbo' Anderson",description:"The bloke behind Turbo 360, turning corporate chaos into polished photo + video gold.",category:"Team"},{id:2,url:"/images/legacy/38612568_10204899854414172_3353692605689888768_n.jpg",title:"Taxiride",description:"Meeting Australian rock band Taxiride during the radio days.",category:"Music"},{id:3,url:"/images/legacy/38735645_10204899854054163_3892763627572166656_n.jpg",title:"Travis & Mark from Blink 182",description:"Radio interview with international superstars Blink 182.",category:"Music"},{id:4,url:"/images/legacy/23.jpg.webp",title:"Dave Higgo Higgins 2003",description:"Radio days with Dave Higgo Higgins in 2003.",category:"Radio"},{id:5,url:"/images/legacy/38795776_10204899852894134_3702294442313515008_n.jpg",title:"Hoobastank (and Byron Cooke)",description:"Interview with international rock band Hoobastank.",category:"Music"},{id:6,url:"/images/legacy/38615027_10204899852574126_4349713998581596160_n.jpg.webp",title:"Michelle Branch",description:"Radio interview with American singer-songwriter Michelle Branch.",category:"Music"},{id:7,url:"/images/legacy/38814367_10204906368537021_8602710341589139456_n-400x516.jpg.webp",title:"The Tea Party",description:"Meeting Canadian rock band The Tea Party.",category:"Music"},{id:8,url:"/images/legacy/turbz.jpg",title:"James 'Turbo' Anders
1on",description:"Professional radio headshot of company founder.",category:"Team"},{id:9,url:"/images/legacy/38703213_10204899868334520_3094836747826102272_n.jpg",title:"The Living End",description:"Radio interview with iconic Australian rock band The Living End.",category:"Music"},{id:10,url:"/images/legacy/1597030701013-8eae3b91-05ce-4543-9f57-72edfef46222-1024x1536.jpg.webp",title:"Blink 182",description:"A gift from the boys in 2005.",category:"Career"},{id:11,url:"/images/legacy/TripleM2003.jpg",title:"Triple M 2003",description:"James 'Turbo' Anderson at Triple M radio station in 2003.",category:"Radio"},{id:12,url:"/images/legacy/Radio-Ratings2005.png",title:"Radio Ratings 2005",description:"Achieving #1 radio ratings in 2005 \u2014 a career highlight.",category:"Achievement"},{id:13,url:"/images/legacy/117316062_10207808214441355_3934346539445623409_o-1200x800-1.jpg",title:"Great Memories",description:"A parting gift from the Triple M Sydney crew.",category:"Family"}].map((e,s)=>(0,f.jsx)(ae.gN,{delay:s%4*60,children:(0,f.jsxs)("button",{onClick:()=>t(e),className:"group relative aspect-[4/5] w-full overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] text-left transition-colors hover:border-turbo-red/50",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center transition-transform duration-700 ease-turbo group-hover:scale-[1.06]",style:{backgroundImage:"url('".concat(e.url,"')")}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 45%,rgba(13,13,13,.85))"}}
1),(0,f.jsx)("div",{className:"absolute left-4 top-4 rounded bg-turbo-red/90 px-2.5 py-[5px] font-mono text-[10px] uppercase tracking-[0.2em] text-white",children:e.category}),(0,f.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-5",children:[(0,f.jsx)("h4",{className:"mb-1 font-head text-base font-bold text-white",children:e.title}),(0,f.jsx)("p",{className:"line-clamp-2 text-xs text-[#C7C4BD]",children:e.description})]})]})},e.id))})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"05 / Values"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["What",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"drives us."})]})]}),(0,f.jsx)("div",{className:"mt-12 grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-4",children:n.map((e,t)=>{const s=e.icon;return(0,f.jsx)(ae.gN,{delay:t%4*60,children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors hover:border-turbo-red/50",children:[(0,f.jsx)("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-xl bg-turbo-red",children:(0,f.jsx)(s,{className:"h-6 w-6 text-white"})}),(0,f.jsx)("h3",{className:"mb-2 font-head text-lg font-bold text-white",children:e.title}),(0,f.jsx)("p",{className:"text-sm leading-relaxed text-[#9C9A95]",children:e.description})]})},e.title)})})]})}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] bg-carbon px-[22px] py-[130px] text-center md:px-11",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center opacity-30",style:{backgroundImage:"url('/images/services/locations/event-coverage-panel-speaker.jpg')"}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 50% 0%,rgba(191,33,47,.22),transparent 60%)"}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.7) 0%,rgba(13,13,13,.55) 40%,#141414 100%)"}}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-[900px]",children:[(0,f.jsx)(ae.YZ,{className:"mb-5",children:"06 / Ready"}),(0,f.jsxs)(ae.nl,{className:"mb-[26px] text-[clamp(42px,6.4vw,96px)] leading-[0.94] tracking-[-0.025em]",children:["Let's build",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"something legendary."})]}),(0,f.jsx)("p",{className:"mx-auto mb-10 max-w-2xl text-[clamp(17px,1.6vw,20px)] leading-[1.6] text-[#C7C4BD]",children:"25 years of practice, one in-house crew, same-day delivery. Tell us the brief and we'll have a quote back within hours."}),(0,f.jsxs)(ae.$$,{to:"/get-quote",children:[(0,f.jsx)(fs.A,{className:"h-5 w-5"}),"Work with us",(0,f.jsx)(S.A,{className:"h-5 w-5"})]})]})]}),e&&(0,f.jsxs)("div",{className:"fixed inset-0 z-[1000] flex cursor-zoom-out items-center justify-center bg-carbon-900/95 p-4",onClick:()=>t(null),children:[(0,f.jsx)("button",{onClick:()=>t(null),className:"absolute right-6 top-6 flex h-10 w-10 items-center justify-center rounded-full border border-white/20 bg-white/10 transition-colors hover:bg-turbo-red/40","aria-label":"Close",children:(0,f.jsx)(g.A,{className:"h-5 w-5 text-white"})}),(0,f.jsxs)("div",{className:"max-h-full max-w-5xl text-center",onClick:e=>e.stopPropagation(),children:[(0,f.jsx)("img",{src:e.url,alt:e.title,className:"mx-auto max-h-[75vh] max-w-full rounded-xl object-contain"}),(0,f.jsxs)("div",{className:"mt-6",children:[(0,f.jsx)("div",{className:"mb-1 font-mono text-[11px] uppercase tracking-[0.3em] text-turbo-red",children:e.category}),(0,f.jsx)("h3",{className:"mb-2 font-head text-2xl font-bold text-white",children:e.title}),(0,f.jsx)("p",{className:"text-[#C7C4BD]",children:e.description})]})]})]}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})},Qa=()=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"Privacy Policy | Turbo 360"}),(0,f.jsx)("meta",{name:"description",content:"Privacy Policy for Turbo 360, UGFM App, and Dump Radio App. We respect your privacy and do not collect personal information through our streaming apps."})]}),(0,f.jsx)(D.A,{}),(0,f.jsx)(Ga,{}),(0,f.jsxs)(ae.mP,{children:[(0,f.jsx)("section",{className:"border-b border-[#222] px-[22px] pb-14 pt-20 md:px-11 md:pb-16 md:pt-24",children:(0,f.jsxs)(ae.gN,{className:"mx-auto max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-5",children:"Legal"}),(0,f.jsx)(ae.nl,{as:"h1",className:"text-[clamp(40px,6vw,72px)]",children:"Privacy Policy"}),(0,f.jsx)("p",{className:"mt-6 font-mono text-xs uppercase tracking-[0.2em] text-[#8A8884]",children:"Last updated: January 2026"})]})}),(0,f.jsx)("section",{className:"px-[22px] py-16 md:px-11 md:py-20",children:(0,f.jsxs)(ae.gN,{className:"mx-auto max-w-3xl space-y-12 text-[17px] leading-[1.7] text-fog",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"mb-4 font-head text-2xl font-bold text-smoke",children:"Introduction"}),(0,f.jsx)("p",{children:'Turbo 360 ("we", "our", or "us") is committed to protecting your privacy. This Privacy Policy explains how we handle information in relation to our website (turbo.net.au) and our mobile applications.'})]}),(0,f.jsxs)("div",{className:"rounded-xl border border-turbo-red/25 bg-turbo-red/[0.06] p-6 md:p-8",children:[(0,f.jsx)("h2",{className:"mb-6 font-head text-2xl font-bold text-smoke",children:"Mobile Applications"}),(0,f.jsxs)("div",{className:"space-y-8",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"mb-2 font-head text-xl font-semibold text-smoke",children:"UGFM App"}),(0,f.jsxs)("p",{children:["The UGFM App is a ",(0,f.jsx)("strong",{className:"text-smoke",children:"streaming-only application"}),". It allows users to listen to live radio streams. ",(0,f.jsx)("strong",{className:"text-smoke",children:"No personal information is collected, stored, or transmitted"})," through the use of this application. The app does not require account creation, does not track user behaviour, and does not access any device data beyond what is necessary for audio playback."]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"mb-2 font-head text-xl font-semibold text-smoke",children:"Dump Radio App"}),(0,f.jsxs)("p",{children:["The Dump Radio App is a ",(0,f.jsx)("strong",{className:"text-smoke",children:"streaming-only application"}),". It allows users to listen to live radio streams from The Dump Radio. ",(0,f.jsx)("strong",{className:"text-smoke",children:"No personal information is collected, stored, or transmitted"})," through the use of this application. The app does not require account creation, does not track user behaviour, and does not access any device data beyond what is necessary for audio playback."]})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"mb-4 font-head text-2xl font-bold text-smoke",children:"Website (turbo.net.au)"}),(0,f.jsx)("p",{className:"mb-4",children:"Our website may collect limited information when you:"}),(0,f.jsxs)("ul",{className:"ml-4 list-disc space-y-2 marker:text-turbo-red",children:[(0,f.jsx)("li",{children:"Submit a contact form or quote request (name, email, phone number, project details)"}),(0,f.jsx)("li",{children:"Create a client account for project management purposes"}),(0,f.jsx)("li",{children:"Subscribe to our newsletter (email address only)"})]}),(0,f.jsx)("p",{className:"mt-4",children:"This information is used solely for the purpose of providing our services and communicating with you about your projects. We do not sell, trade, or otherwise transfer your personal information to third parties."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"mb-4 font-head text-2xl font-bold text-smoke",children:"Data Security"}),(0,f.jsx)("p",{children:"We implement appropriate security measures to protect any personal information submitted through our website. However, no method of transmission over the Internet is 100% secure, and we cannot guarantee absolute security."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"mb-4 font-head text-2xl font-bold text-smoke",children:"Cookies"}),(0,f.jsx)("p",{children:"Our website may use cookies to enhance your browsing experience. The
1se cookies do not collect personal information and are used only for functional purposes such as remembering your preferences."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"mb-4 font-head text-2xl font-bold text-smoke",children:"Third-Party Services"}),(0,f.jsx)("p",{children:"Our website and apps may contain links to third-party websites or services. We are not responsible for the privacy practices of these external sites. We encourage you to review the privacy policies of any third-party services you access."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"mb-4 font-head text-2xl font-bold text-smoke",children:"Children's Privacy"}),(0,f.jsx)("p",{children:"Our services are not directed to children under 13. We do not knowingly collect personal information from children under 13. If you believe we have collected information from a child under 13, please contact us immediately."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"mb-4 font-head text-2xl font-bold text-smoke",children:"Changes to This Policy"}),(0,f.jsx)("p",{children:"We may update this Privacy Policy from time to time. Any changes will be posted on this page with an updated revision date."})]}),(0,f.jsxs)("div",{className:"rounded-xl border border-[#262626] bg-carbon-900 p-6 md:p-8",children:[(0,f.jsx)("h2",{className:"mb-4 font-head text-2xl font-bold text-smoke",children:"Contact Us"}),(0,f.jsx)("p",{className:"mb-4",children:"If you have any questions about this Privacy Policy, please contact us:"}),(0,f.jsxs)("div",{className:"space-y-1",children:[(0,f.jsx)("p",{children:(0,f.jsx)("strong",{className:"text-smoke",children:"Turbo 360"})}),(0,f.jsxs)("p",{children:["Email: ",(0,f.jsx)("a",{href:"mailto:[email protected]",className:"text-turbo-red transition-colors hover:text-redline",children:"[email protected]"})]}),(0,f.jsxs)("p",{children:["Website: ",(0,f.jsx)("a",{href:"https://turbo.net.au",className:"text-turbo-red transition-colors hover:text-redline",children:"turbo.net.au"})]})]})]})]})}),(0,f.jsx)("footer",{className:"border-t border-[#222] py-8",children:(0,f.jsx)("div",{className:"mx-auto max-w-3xl px-[22px] text-center font-mono text-xs uppercase tracking-[0.16em] text-[#8A8884] md:px-11",children:(0,f.jsxs)("p",{children:["\xa9 ",(new Date).getFullYear()," Turbo 360. All rights reserved."]})})})]})]});var Xa=s(42574);const en=[{icon:Wa.A,title:"App Development",tagline:'"Turn your big idea into a powerful, scalable app."',description:"We design and build mobile and web applications tailored to your business goals. From MVPs for startups to enterprise-level systems, we handle everything \u2014 UX de
1sign, development, integrations, and hosting.",listLabel:"Example Projects:",items:["Event check-in and ticket scanning apps","Photo delivery apps for instant content sharing","Custom internal tools and workflow systems"]},{icon:Da.A,title:"Website Development",tagline:'"Websites that don\'t just look good \u2014 they work hard."',description:"A website is more than an online brochure. We create fast, responsive, SEO-optimized websites designed to generate leads and deliver results.",listLabel:"Example Projects:",items:["Corporate websites","E-commerce stores","Tourism and experience booking sites","Membership portals & directories"]},{icon:ss.A,title:"Website Maintenance & Support",tagline:'"We keep your site secure, fast, and running 24/7."',description:"Websites need care to perform their best. Our ongoing maintenance plans include security updates, backups, performance optimization, and tech support \u2014 so you can focus on your business.",listLabel:"Key Features:",items:["Regular security patches","Speed & performance optimization","Monthly reporting","Emergency supp
1ort response"]}],tn=[{icon:F.A,title:"Fast Delivery",copy:"We build quickly without cutting corners."},{icon:Ia.A,title:"Scalable Solutions",copy:"Apps and websites designed to grow with you."},{icon:Xa.A,title:"Real Support",copy:"Local team, real humans, no endless ticket queues."},{icon:as.A,title:"All-in-One",copy:"Development, hosting, video, photography \u2014 everything under one roof."}],sn=[{n:"01",name:"Outback Bar & Grill",url:"https://www.obgcooberpedy.com.au/",host:"obgcooberpedy.com.au",type:"Hospitality website",img:"/images/work/obg.webp"},{n:"02",name:"Lake Eildon",url:"https://lakeeildon.com/",host:"lakeeildon.com",type:"Tourism platform + iOS / Android apps",img:"/images/work/lake-eildon.webp"},{n:"03",name:"Saladin Lodge",url:"https://www.saladinlodge.com.au/",host:"saladinlodge.com.au",type:"Accommodation + booking engine",img:"/images/work/saladin-lodge.webp"},{n:"04",name:"Arinya Retreat",url:"https://arinyaretreat.com/",host:"arinyaretreat.com",type:"Retreat website + gift cards",img:"/images/work/arinya-retreat.webp"},{n:"05",name:"Shootzu",url:"https://shootzu.com/",host:"shootzu.com",type:"Crew marketplace web app",img:"/images/work/shootzu.webp"},{n:"06",name:"Victorian Parents Council",url:"https://vicparentscouncil.vic.edu.au/",host:"vicparentscouncil.vic.edu.au",type:"Membership website + app",img:"/images/work/vpc.webp"}],an=[{n:"01",name:"Lake Eildon",platform:"iOS + Android",img:"/images/apps/lake-eildon.webp",lift:"lg:mb-0"},{n:"02",name:"Victorian Parents Council",platform:"iOS + Android",img:"/images/apps/vpc.webp",lift:"lg:mb-12"},{n:"03",name:"UGFM Radio Murrindindi",platform:"iOS + Android",img:"/images/apps/ugfm.webp",lift:"lg:mb-4"},{n:"04",name:"Dump Internet Radio",platform:"iOS",img:"/images/apps/dump-radio.webp",lift:"lg:mb-16"}],nn=["React","Next.js","Tailwind","Python","FastAPI","MongoDB","Swift / iOS","Kotlin / Android","AWS S3","Docker","Cloud hosting"],rn=[{q:"How long does a website take to build?",a:"Most business websites launch in four to eight weeks from brief to go-live. Apps and custom platforms are scoped individually \u2014 we agree milestones up front and you see working builds along the way."},{q:"Do you host and maintain what you build?",a:"Yes. Our maintenance plans cover hosting, security patches, backups, performance optimisation and monthly reporting, with emergency supp
1ort when you need it."},{q:"What do you build with?",a:"React and Next.js front-ends, Python back-ends and cloud deployment on modern infrastructure. Native iOS and Android where a real app is the right answer."},{q:"Can you work with our existing site or brand?",a:"Absolutely. We can rebuild, redesign or extend what you already have \u2014 and because video and photography are under the same roof, the content is covered too."},{q:"My website has been hacked \u2014 can you help?",a:"Yes. We lock the site down, remove the malware, restore from a clean backup and patch the hole it came through. Then we harden it so it does not happen again \u2014 and we can take over hosting and maintenance from there."},{q:"Our site is slow, or keeps breaking \u2014 can you take it over?",a:"Yes. We audit what you have, fix the performance and stability issues, migrate it to modern hosting and put it on a maintenance plan. You do not need to start again."},{q:"We lost access to our domain, hosting or old developer \u2014 what now?",a:"We deal with this a lot. We help you recover domain and hosting access, take a full backup, and move everything into accounts you own and control."},{q:"How do we get started?",a:"Request a quote and we will book a free consultation. You leave with a clear scope, timeline and price \u2014 no obligation."}],on={"@context":"https://schema.org","@type":"FAQPage",mainEntity:rn.map(e=>({"@type":"Question",name:e.q,acceptedAnswer:{"@type":"Answer",text:e.a}}))};function ln(){return(0,f.jsx)("div",{"aria-hidden":"true",className:"relative h-1 overflow-hidden",style:{background:"linear-gradient(90deg,#BF212F 0 40%,#F2A900 40% 70%,#0FA3A3 70% 100%)"},children:(0,f.jsx)("span",{className:"absolute inset-y-0 left-0 w-2/5 animate-sweep motion-reduce:hidden",style:{background:"linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.25),rgba(255,255,255,0))"}})})}function cn(e){let{kicker:t,title:s,lede:a}=e;return(0,f.jsxs)(ae.gN,{className:"mb-14 flex flex-wrap items-end justify-between gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:t}),(0,f.jsx)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:s})]}),(0,f.jsx)("p",{className:"m-0 max-w-[360px] text-[17px] leading-[1.6] text-[#9C9A95]",children:a})]})}const dn=()=>(0,f.jsxs)(ae.mP,{children:[(0,f.jsx)(R.A,(0,m.A)((0,m.A)({},R.p.development),{},{structuredData:on})),(0,f.jsx)(D.A,{currentPage:"Development"}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-b border-[#222] bg-carbon-900 px-[22px] py-24 md:px-11 md:py-[140px]",children:[(0,f.jsx)("img",{src:"/development-code.jpg",alt:"","aria-hidden":"true",decoding:"async",className:"pointer-events-none absolute inset-0 h-full w-full object-cover opacity-[0.28] [filter:saturate(.7)_contrast(1.1)]"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(90deg,rgba(13,13,13,.96) 0%,rgba(13,13,13,.82) 45%,rgba(13,13,13,.35) 100%),linear-gradient(180deg,rgba(15,163,163,.10),rgba(242,169,0,.10))"}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 22% 28%,rgba(191,33,47,.22),transparent 56%),radial-gradient(circle at 82% 80%,rgba(242,169,0,.14),transparent 52%)"}}),(0,f.jsx)("img",{src:"/images/turbo-mark-white-1440.webp",alt:"","aria-hidden":"true",decoding:"async",className:"pointer-events-none absolute -bottom-[130px] -right-[130px] w-[720px] max-w-none select-none opacity-[0.07]"}),(0,f.jsxs)("div",{className:"relative z-[2] mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)("div",{className:"mb-[26px] flex items-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsx)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:"Development Services"})]}),(0,f.jsxs)("h1",{className:"m-0 font-display text-[clamp(48px,8vw,128px)] font-extrabold leading-[0.9] tracking-[-0.025em] text-smoke [text-wrap:balance]",children:["From ideas",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"to impact"})]}),(0,f.jsx)("p",{className:"mt-[30px] max-w-[680px] text-[clamp(17px,1.5vw,21px)] leading-[1.6] text-[#D9D6CF]",children:"Apps & Websites Built for Growth. Whether you need a clean business website, a powerful e-commerce platform, or a fully custom application, Turbo builds, launches, and maintains solutions that just work \u2014 fast."}),(0,f.jsxs)("div",{className:"mt-[38px] flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:[(0,f.jsxs)(ae.$$,{to:"/get-quote",children:[(0,f.jsx)(F.A,{className:"h-5 w-5"})," Get Your Quote"]}),(0,f.jsxs)(ae.qM,{href:"#services",children:[(0,f.jsx)(Da.A,{className:"h-5 w-5"})," View Services"]})]})]}),(0,f.jsx)(ae.gN,{delay:120,children:(0,f.jsx)("div",{className:"mt-16 grid grid-cols-2 gap-[18px] md:grid-cols-4",children:[["Fast","Delivery"],["Scalable","Solutions"],["Real","Support"],["All-in-One","Service"]].map(e=>{let[t,s]=e;return(0,f.jsxs)("div",{className:"rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-5",children:[(0,f.jsx)("div",{className:"font-display text-2xl font-extrabold tracking-[-0.02em] text-turbo-red md:text-3xl",children:t}),(0,f.jsx)("div",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.16em] text-[#8A8884]",children:s})]},t)})})})]})]}),(0,f.jsxs)(ae.wn,{id:"services",tone:"carbon",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 flex flex-wrap items-end justify-between gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / Our Services"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Development",(0,f.jsx)("br",{}),"Services"]})]}),(0,f.jsx)("p",{className:"m-0 max-w-[360px] text-[17px] leading-[1.6] text-[#9C9A95]",children:"Comprehensive digital solutions tailored to your business needs"})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-3",children:en.map((e,t)=>{const s=e.icon;return(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"group flex h-full flex-col rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-8 transition-colors duration-300 hover:border-turbo-red",children:[(0,f.jsx)("div",{className:"mb-6 flex h-14 w-14 items-center justify-center rounded-xl bg-turbo-red transition-transform duration-300 group-hover:scale-110",children:(0,f.jsx)(s,{className:"h-7 w-7 text-white"})}),(0,f.jsx)("h3",{className:"mb-3 font-head text-2xl font-bold text-white transition-colors group-hover:text-turbo-red",children:e.title}),(0,f.jsx)("p",{className:"mb-4 font-head text-lg font-semibold text-turbo-red",children:e.tagline}),(0,f.jsx)("p",{className:"mb-6 text-sm leading-relaxed text-[#9C9A95]",children:e.description}),(0,f.jsxs)("div",{className:"mt-auto rounded-lg border border-[#262626] bg-carbon-900/60 p-4",children:[(0,f.jsx)("h4",{className:"mb-3 font-mono text-[11px] uppercase tracking-[0.16em] text-[#8A8884]",children:e.listLabel}),(0,f.jsx)("ul",{className:"space-y-2 text-xs text-[#C7C4BD]",children:e.items.map(e=>(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)("span",{className:"mr-2 text-turbo-red",children:"\u25b8"}),(0,f.jsx)("span",{children:e})]},e))})]})]})}
1,e.title)})})]}),(0,f.jsx)(ln,{}),(0,f.jsxs)(ae.wn,{id:"work",tone:"carbon-900",children:[(0,f.jsx)(cn,{kicker:"02 / Selected Work",title:(0,f.jsxs)(f.Fragment,{children:["Built by",(0,f.jsx)("br",{}),"Turbo"]}),lede:"Live sites and apps we design, build, host and maintain. Open any of them in a new tab."}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-3",children:sn.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*80,className:"h-full",children:(0,f.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex h-full flex-col overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] [transition:border-color_300ms,transform_400ms_cubic-bezier(0.16,1,0.3,1)] hover:-translate-y-[3px] hover:border-turbo-red",children:[(0,f.jsxs)("div",{className:"flex items-center gap-[10px] border-b border-[#262626] bg-[#111] px-[14px] py-[10px]",children:[(0,f.jsxs)("span",{className:"flex gap-[6px]","aria-hidden":"true",children:[(0,f.jsx)("span",{className:"h-[9px] w-[9px] rounded-full bg-[#3A3A3A]"}),(0,f.jsx)("span",{className:"h-[9px] w-[9px] rounded-full bg-[#3A3A3A]"}),(0,f.jsx)("span",{className:"h-[9px] w-[9px] rounded-full bg-[#3A3A3A]"})]}),(0,f.jsx)("span",{className:"min-w-0 flex-1 truncate rounded bg-[#1A1A1A] px-[10px] py-1 font-mono text-[11px] leading-[1.4] tracking-[.06em] text-[#8A8884]",children:e.host})]}),(0,f.jsx)("div",{className:"flex aspect-[16/10] items-center justify-center overflow-hidden bg-[#111]",children:(0,f.jsx)("img",{src:e.img,alt:"".concat(e.name," website homepage"),width:"1200",height:"750",loading:"lazy",decoding:"async",className:"h-full w-full object-contain"})}),(0,f.jsxs)("div",{className:"flex items-end justify-between gap-4 px-[22px] pb-[22px] pt-5",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"mb-[6px] font-mono text-[11px] uppercase tracking-[.16em] text-[#8A8884]",children:"".concat(e.n," / ").concat(e.type)}),(0,f.jsx)("h3",{className:"font-head text-xl font-bold leading-[1.3] text-white",children:e.name})]}),(0,f.jsxs)("span",{className:"whitespace-nowrap font-mono text-xs tracking-[.1em] text-turbo-red",children:["VISIT \u2197",(0,f.jsx)("span",{className:"sr-only",children:" (opens in a new tab)"})]})]})]})},e.name))})]}),(0,f.jsxs)(ae.wn,{id:"apps",tone:"carbon",className:"overflow-hidden pb-16 md:pb-24",children:[(0,f.jsx)(cn,{kicker:"03 / Apps",title:(0,f.jsxs)(f.Fragment,{children:["In their",(0,f.jsx)("br",{}),"pockets"]}),lede:"Native apps we design, build and publish to the App Store and Google Play \u2014 sponsored by Turbo, running every day."}),(0,f.jsx)("div",{className:"grid grid-cols-1 items-end gap-6 sm:grid-cols-2 lg:grid-cols-4",children:an.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%4*70,className:e.lift,children:(0,f.jsxs)("div",{className:"flex flex-col gap-[18px]",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"mb-[6px] font-mono text-[11px] uppercase tracking-[.16em] text-[#8A8884]",children:"".concat(e.n," / ").concat(e.platform)}),(0,f.jsx)("h3",{className:"font-head text-lg font-bold leading-[1.3] text-white",children:e.name})]}),(0,f.jsx)("div",{className:"aspect-[1320/2868] w-full max-w-[290px] overflow-hidden rounded-[clamp(28px,15%,48px)] bg-black shadow-[0_30px_60px_-20px_rgba(0,0,0,.9),0_0_0_1px_rgba(255,255,255,.08)]",children:(0,f.jsx)("img",{src:e.img,alt:"".concat(e.name," app screen"),width:"640",height:"1391",loading:"lazy",decoding:"async",className:"h-full w-full bg-black object-contain"})})]})},e.name))})]}),(0,f.jsx)("div",{className:"border-t border-[#222] bg-carbon px-[22px] py-7 md:px-11",children:(0,f.jsxs)("div",{className:"mx-auto flex max-w-7xl flex-wrap items-center justify-center gap-x-7 gap-y-[14px]",children:[(0,f.jsx)("span",{className:"mr-3 font-mono text-[11px] uppercase tracking-[.3em] text-turbo-red",children:"04 / Stack"}),nn.map(e=>(0,f.jsxs)("span",{className:"flex items-center gap-7 font-mono text-[13px] uppercase tracking-[.2em] text-[#C7C4BD]",children:[(0,f.jsx)("span",{className:"block h-1 w-1 rounded-full bg-turbo-red","aria-hidden":"true"}),e]},e))]})}),(0,f.jsxs)(ae.wn,{tone:"smoke",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 flex flex-wrap items-end justify-between gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"05 / Why Choose Us"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)] text-carbon",children:["Your Digital",(0,f.jsx)("br",{}),"Partner"]})]}),(0,f.jsx)("p",{className:"m-0 max-w-[360px] text-[17px] leading-[1.6] text-[#555350]",children:"Why businesses across Australia choose Turbo 360 for their development needs"})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[18px] sm:grid-cols-2 lg:grid-cols-4",children:tn.map((e,t)=>{const s=e.icon;return(0,f.jsx)(ae.gN,{delay:t%4*60,children:(0,f.jsxs)("div",{className:"group flex h-full flex-col rounded-[10px] border border-[#
1E2DED6] bg-white p-6 transition-colors duration-300 hover:border-turbo-red",children:[(0,f.jsx)("div",{className:"mb-4 flex h-14 w-14 items-center justify-center rounded-xl bg-turbo-red transition-transform duration-300 group-hover:scale-110",children:(0,f.jsx)(s,{className:"h-7 w-7 text-white"})}),(0,f.jsx)("h3",{className:"mb-2 font-head text-xl font-bold text-carbon transition-colors group-hover:text-turbo-red",children:e.title}),(0,f.jsx)("p",{className:"text-sm leading-relaxed text-[#555350]",children:e.copy})]})},e.title)})})]}),(0,f.jsxs)(ae.wn,{id:"faq",tone:"carbon",children:[(0,f.jsx)(cn,{kicker:"06 / FAQ",title:(0,f.jsxs)(f.Fragment,{children:["Good to",(0,f.jsx)("br",{}),"know"]}),lede:"Before you brief us. Anything else \u2014 call 1300 207 446 or use the chat."}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[18px] md:grid-cols-2",children:rn.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%2*70,className:"h-full",children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-7 transition-colors duration-300 hover:border-turbo-red",children:[(0,f.jsx)("div",{className:"mb-3 font-mono text-[11px] uppercase tracking-[.16em] text-[#8A8884]",children:"Q".concat(String(t+1).padStart(2,"0"))}),(0,f.jsx)("h3",{className:"mb-[10px] font-head text-[19px] font-bold leading-[1.35] text-white",children:e.q}),(0,f.jsx)("p",{className:"text-[15px] leading-[1.65] text-[#9C9A95]",children:e.a})]})},e.q))})]}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] bg-carbon px-[22px] py-[120px] text-center md:px-11",children:[(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 50% 0%,rgba(191,33,47,.22),transparent 60%)"}}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-[900px]",children:[(0,f.jsx)(ae.YZ,{className:"mb-5",children:"07 / Ready"}),(0,f.jsxs)(ae.nl,{className:"mb-[26px] text-[clamp(42px,6.4vw,96px)] leading-[0.94] tracking-[-0.025em]",children:["Let's Build ",(0,f.jsx)("span",{className:"text-turbo-red",children:"Something Amazing."})]}),(0,f.jsx)("p",{className:"mx-auto mb-12 max-w-[560px] text-[clamp(17px,1.6vw,20px)] leading-[1.6] text-[#C7C4BD]",children:"Get a free consultation and start your project today."}),(0,f.jsxs)("div",{className:"mb-12 flex flex-col items-center justify-center gap-4 sm:flex-row",children:[(0,f.jsx)(ae.$$,{to:"/get-quote",children:"Book a Call"}),(0,f.jsx)(ae.qM,{to:"/get-quote",children:"Get a Quote"})]}),(0,f.jsxs)("p",{className:"mb-12 text-lg text-[#9C9A95]",children:["Ready to transform your ideas into reality?",(0,f.jsx)("span",{className:"font-semibold text-turbo-red",children:" Let's talk."})]}),(0,f.jsxs)("div",{className:"mx-auto grid max-w-3xl grid-cols-1 gap-[18px] md:grid-cols-3",children:[(0,f.jsxs)("div",{className:"rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6",children:[(0,f.jsx)("h4",{className:"mb-3 font-mono text-[11px] uppercase tracking-[0.16em] text-[#8A8884]",children:"CALL NOW"}),(0,f.jsx)("p",{className:"font-head text-xl font-bold text-turbo-red",children:"1300 207 446"})]}),(0,f.jsxs)("div",{className:"rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6",children:[(0,f.jsx)("h4",{className:"mb-3 font-mono text-[11px] uppercase tracking-[0.16em] text-[#8A8884]",children:"EMAIL"}),(0,f.jsx)("p",{className:"font-head text-lg font-bold text-turbo-red",children:"[email protected]"})]}),(0,f.jsxs)("div",{className:"rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6",children:[(0,f.jsx)("h4",{className:"mb-3 font-mono text-[11px] uppercase tracking-[0.16em] text-[#8A8884]",children:"COVERAGE"}),(0,f.jsx)("p",{className:"font-semibold text-[#C7C4BD]",children:"Australia \u2022 New Zealand \u2022 Singapore"})]})]})]})]}),(0,f.jsx)(ae.wn,{tone:"carbon-900",children:(0,f.jsx)("div",{className:"mx-auto max-w-4xl",children:(0,f.jsx)("p",{className:"text-sm leading-relaxed text-[#9C9A95]",children:"Turbo 360 builds custom websites, web applications, and mobile apps for businesses across Australia. Our development team specialises in React, Next.js, and Python backends with cloud deployment on modern infrastru
1cture. Every project includes responsive design, search engine optimisation, and ongoing technical support to keep your digital presence running smoothly."})})}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]}),mn=()=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"The Dump Radio - Live Stream"}),(0,f.jsx)("meta",{name:"description",content:"Live streaming from The Dump Radio - No shit, just great music."}),(0,f.jsx)("meta",{name:"mobile-web-app-capable",content:"yes"}),(0,f.jsx)("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),(0,f.jsx)("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"}),(0,f.jsx)("meta",{property:"og:title",content:"The Dump Radio - Live Stream"}),(0,f.jsx)("meta",{property:"og:description",content:"Live streaming - No shit, just great music."}),(0,f.jsx)("meta",{property:"og:type",content:"website"}),(0,f.jsx)("meta",{property:"og:url",content:"https://turbo.net.au/dumpradio"})]}),(0,f.jsx)("iframe",{src:"https://radio.turbo.net.au/",title:"The Dump Radio",style:{position:"fixed",top:0,left:0,width:"100%",height:"100dvh",border:"none",margin:0,padding:0,overflow:"hidden"},allow:"autoplay; fullscreen",allowFullScreen:!0})]});var pn=s(19340),xn=s(64830);const hn=()=>{const e=(0,I.wE)(),[t,s]=(0,a.useState)(!1),[n,r]=(0,a.useState)(!1),[i,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)(0),[m,p]=(0,a.useState)("MP3"),[x,u]=(0,a.useState)({title:"Live Stream",artist:"The Dump Radio"}),[b,y]=(0,a.useState)({station:"The Dump Radio",description:"If it's good, we'll play it"}),[v,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(""),[A,k]=(0,a.useState)([]),[S,_]=(0,a.useState)(!1),[C,F]=(0,a.useState)(null),[E,T]=(0,a.useState)(""),[z,B]=(0,a.useState)(""),[D,R]=(0,a.useState)(!1),[P,W]=(0,a.useState)(""),O=(0,a.useRef)(null),L=(0,a.useRef)(null),M=(0,a.useRef)(null),q=(0,a.useRef)(null),H="".concat(e,"/api/radio/stream?stream=mp3"),U="".concat(e,"/api/radio/stream?stream=aac");(0,a.useEffect)(()=>{t&&"Live Stream"!==x.title?document.title="Dump Radio - ".concat(x.title," - ").concat(x.artist):document.title=t?"Dump Radio - Live Stream - On Air Now":"The Dump Radio - Live Stream"},[x,t]);const G=(0,a.useCallback)(async()=>{try{const t=Date.now(),s="".concat(e,"/api/radio/metadata?_=").concat(t);console.log("\ud83d\udce1 Fetching metadata from:",s);const a=await fetch(s,{cache:"no-cache",headers:{"Cache-Control":"no-cache",Pragma:"no-cache"}});if(a.ok){const e=a.headers.get("content-type");if(e&&e.includes("application/json")){const e=await a.json();if(console.log("Metadata received:",e),e.success)return u({title:e.title||"Live Stream",artist:e.artist||"The Dump Radio"}),void y({station:e.station||"The Dump Radio",description:"If it's good, we'll play it",genre:e.genre||"No shit, just great music",listeners:e.listeners||0,bitrate:e.bitrate||"128kbps"})}}}catch(t){console.log("Failed to fetch radio metadata:",t.message)}},[e]);(0,a.useEffect)(()=>(document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",document.documentElement.style.height="100%",document.body.style.height="100%",()=>{document.documentElement.style.overflow="",document.body.style.overflow="",document.documentElement.style.height="",document.body.style.height="",L.current&&clearInterval(L.current),O.current&&(O.current.pause(),O.current.src=""),q.current&&clearInterval(q.current)}),[]),(0,a.useEffect)(()=>{G()},[]),(0,a.useEffect)(()=>{if(t){const e=setTimeout(()=>{G();const e=setInterval(()=>{G()},2e4);L.current=e},5e3);return()=>{clearTimeout(e),L.current&&clearInterval(L.current)}}},[t]);const V=async t=>{_(!0);try{const s=await fetch("".concat(e,"/api/radio/songs/search?q=").concat(encodeURIComponent(t))),a=await s.json();a.success?k(a.songs):k([])}catch(s){console.error("Error searching songs:",s),k([])}finally{_(!1)}};return(0,f.jsxs)("div",{className:"fixed inset-0 w-full h-full bg-black flex items-center justify-center overflow-hidden",children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:t&&"Live Stream"!==x.title?"Dump Radio - ".concat(x.title," - ").concat(x.artist):t?"Dump Radio - Live Stream - On Air Now":"The Dump Radio - Live Stream"}),(0,f.jsx)("meta",{name:"description",content:"Live streaming from The Dump Radio - No shit, just great music. Free to embed in your mobile app or website."}),(0,f.jsx)("meta",{name:"referrer",content:"no-referrer-when-downgrade"}),(0,f.jsx)("meta",{name:"mobile-web-app-capable",content:"yes"}),(0,f.jsx)("meta",{name:"apple-mobile-web-app-capable",content:"yes"}),(0,f.jsx)("meta",{name:"apple-mobile-web-app-status-bar-style",content:"black-translucent"}),(0,f.jsx)("meta",{property:"og:title",content:"The Dump Radio - Live Stream"}),(0,f.jsx)("meta",{property:"og:description",content:"Live streaming - No shit, just great music. Free to embed!"}),(0,f.jsx)("meta",{property:"og:type",content:"website"}),(0,f.jsx)("meta",{property:"og:url",content:"https://turbo.net.au/dumpradio"})]}),(0,f.jsxs)("div",{className:"absolute inset-0",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-black via-gray-900 to-black"}),(0,f.jsxs)("div",{className:"absolute inset-0 opacity-20",children:[(0,f.jsx)("div",{className:"absolute top-0 left-1/4 w-96 h-96 bg-red-500 rounded-full filter blur-3xl animate-pulse"}),(0,f.jsx)("div",{className:"absolute bottom-0 right-1/4 w-96 h-96 bg-
1orange-500 rounded-full filter blur-3xl animate-pulse",style:{animationDelay:"1s"}}),(0,f.jsx)("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-96 h-96 bg-red-600 rounded-full filter blur-3xl animate-pulse",style:{animationDelay:"2s"}})]}),t&&(0,f.jsx)("div",{className:"absolute inset-0 opacity-5",children:(0,f.jsx)("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(239,68,68,0.3) 1px, transparent 1px), linear-gradient(90deg, rgba(239,68,68,0.3) 1px, transparent 1px)",backgroundSize:"100px 100px",animation:"grid-move 20s linear infinite"}})})]}),t&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"absolute inset-0 opacity-40",children:(0,f.jsx)("div",{className:"equalizer-container",children:[...Array(30)].map((e,t)=>(0,f.jsx)("div",{className:"equalizer-bar bar-".concat(t+1)},"bar-".concat(t)))})}),(0,f.jsx)("div",{className:"absolute inset-0 opacity-30",children:(0,f.jsx)("div",{className:"equalizer-container-top",children:[...Array(30)].map((e,t)=>(0,f.jsx)("div",{className:"equalizer-bar-top bar-top-".concat(t+1)},"bar-top-".concat(t)))})}),(0,f.jsx)("div",{className:"absolute inset-0 opacity-20",children:(0,f.jsxs)("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",children:[(0,f.jsx)("div",{className:"w-64 h-64 border-4 border-red-500 rounded-full animate-ping",style:{animationDuration:"3s"}}),(0,f.jsx)("div",{className:"w-96 h-96 border-2 border-red-400 rounded-full animate-ping",style:{animationDuration:"4s",animationDelay:"0.5s"}}),(0,f.jsx)("div",{className:"w-128 h-128 border-2 border-red-300 rounded-full animate-ping",style:{animationDuration:"5s",animationDelay:"1s"}})]})}),(0,f.jsx)("div",{className:"absolute inset-0 opacity-25",children:(0,f.jsxs)("div",{className:"music-notes",children:[(0,f.jsx)("div",{className:"note note-1",children:"\u266a"}),(0,f.jsx)("div",{className:"note note-2",children:"\u266b"}),(0,f.jsx)("div",{className:"note note-3",children:"\u266a"}),(0,f.jsx)("div",{className:"note note-4",children:"\u266c"}),(0,f.jsx)("div",{className:"note note-5",children:"\u2669"}),(0,f.jsx)("div",{className:"note note-6",children:"\u266b"})]})})]}),(0,f.jsxs)("div",{className:"relative z-10 w-full h-full flex flex-col items-center justify-center px-4 sm:px-6 py-4 sm:py-6",children:[(0,f.jsx)("div",{className:"mb-4 sm:mb-6 md:mb-8 animate-fadeIn flex-shrink-0",children:(0,f.jsxs)("div",{className:"relative",children:[t&&(0,f.jsx)("div",{className:"absolute inset-0 blur-2xl bg-red-500/30 animate-pulse"}),(0,f.jsx)("img",{src:"https://www.thedumpradio.com/wp-content/uploads/2019/06/dump1.png",alt:"The Dump Radio",className:"relative w-full max-w-xs sm:max-w-sm md:max-w-md lg:max-w-lg mx-auto object-contain drop-shadow-2xl"})]})}),(0,f.jsx)("div",{className:"w-full max-w-2xl mb-4 sm:mb-6 md:mb-8 animate-fadeInUp flex-shrink-0",style:{animationDelay:"0.2s"},children:(0,f.jsxs)("div",{className:"bg-gradient-to-br from-gray-900/90 to-black/90 backdrop-blur-xl rounded-2xl sm:rounded-3xl p-4 sm:p-6 md:p-8 border border-white/10 shadow-2xl relative overflow-hidden",children:[t&&(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-red-500/20 via-orange-500/20 to-red-500/20 opacity-50 blur-xl animate-pulse"}),(0,f.jsxs)("div",{className:"relative z-10",children:[(0,f.jsx)("div",{className:"flex items-center justify-center mb-3 sm:mb-4 md:mb-6",children:(0,f.jsxs)("div",{className:"inline-flex items-center space-x-2 px-4 sm:px-6 py-1.5 sm:py-2 rounded-full ".concat(n?"bg-orange-500/20 border-orange-400/30":i||t?"bg-red-500/20 border-red-400/30":"bg-gray-500/20 border-gray-400/30"," border backdrop-blur-md"),children:[t&&!n&&!i&&(0,f.jsx)("div",{className:"w-2 h-2 bg-red-500 rounded-full animate-pulse"}),(0,f.jsx)("span",{className:"font-bold text-xs sm:text-sm tracking-wider ".concat(n?"text-orange-400":i||t?"text-red-400":"text-gray-400"),children:n?"CONNECTING...":i?"CONNECTION FAILED":t?"LIVE ON AIR":"READY TO PLAY"})]})}),(0,f.jsxs)("div",{className:"text-center mb-4 sm:mb-6 md:mb-8",children:[(0,f.jsx)("div",{className:"text-xl sm:text-2xl md:text-3xl lg:text-4xl font-black mb-2 sm:mb-3 bg-gradient-to-r from-white to-gray-300 bg-clip-text text-transparent line-clamp-2",children:x.title}),(0,f.jsx)("div",{className:"text-base sm:text-lg md:text-xl lg:text-2xl text-gray-300 mb-2 sm:mb-3 md:mb-4 line-clamp-1",children:x.artist}),(0,f.jsx)("div",{className:"text-xs sm:text-sm text-gray-500",children:n?"Connecting to stream...":i?"Unable to connect to stream":t?"".concat(m," \u2022 High Quality Stream"):"Hit play to start the music"})]}),i&&(0,f.jsxs)("div",{className:"flex items-center justify-center text-red-400 text-xs sm:text-sm bg-red-500/10 rounded-xl p-3 sm:p-4 border border-red-500/20",children:[(0,f.jsx)(h.A,{className:"w-4 h-4 sm:w-5 sm:h-5 mr-2 flex-shrink-0"}),(0,f.jsx)("span",{children:"Stream may be temporarily unavailable. Please try again."})]})]})]})}),(0,f.jsx)("div",{className:"mb-3 sm:mb-4 md:mb-6 animate-fadeInUp flex-shrink-0",style:{animationDelay:"0.4s"},children:(0,f.jsxs)("button",{onClick:async()=>
1{if(O.current)if(t)O.current.pause(),O.current.src="",q.current&&(clearInterval(q.current),q.current=null),s(!1),r(!1),console.log("Stream stopped");else{r(!0),o(!1);try{const e=O.current,t="".concat(H,"&t=").concat(Date.now());console.log("\ud83c\udfb5 Starting stream:",t),e.src=t,e.load(),e.onloadstart=()=>console.log("\ud83d\udce1 Load started"),e.onloadedmetadata=()=>console.log("\ud83d\udccb Metadata loaded"),e.oncanplay=()=>console.log("\u25b6\ufe0f Can play"),e.onplaying=()=>{console.log("\u2705 Playing!"),r(!1),s(!0)},e.onwaiting=()=>console.log("\u23f3 Waiting/buffering"),e.onstalled=()=>console.log("\u26a0\ufe0f Stalled"),e.onerror=t=>{console.error("\u274c Stream error:",t,e.error),console.log("Trying fallback stream..."),e.src="".concat(U,"&t=").concat(Date.now()),e.load(),e.play().catch(e=>{console.error("Both streams failed:",e),o(!0),r(!1),s(!1)})},await e.play(),console.log("\ud83c\udfac Play initiated");let a=0,n=0;q.current=setInterval(()=>{if(e.buffered.length>0){const t=e.buffered.end(e.buffered.length-1),s=e.currentTime;t!==a||e.paused?(n>0&&console.log("\u2705 Buffer growing again, stream recovered"),n=0,console.log("\ud83d\udcca Buffer health: ".concat(t.toFixed(1),"s buffered | Playing: ").concat(s.toFixed(1),"s | Growth: +").concat((t-a).toFixed(1),"s"))):(n++,console.warn("\u26a0\ufe0f Buffer not growing! Stalled count: ".concat(n," | Buffered: ").concat(t.toFixed(1),"s | Current: ").concat(s.toFixed(1),"s")),n>=3&&(console.error("\u274c Stream appears dead (buffer not growing for 15s). Connection likely lost."),console.log("Buffered ranges:",e.buffered.length),console.log("Network state:",e.networkState),console.log("Ready state:",e.readyState))),a=t}else console.warn("\u26a0\ufe0f No buffer data available")},5e3)}catch(e){console.error("Play failed:",e),o(!0),r(!1)}}},disabled:n,className:"group relative w-20 h-20 sm:w-24 sm:h-24 md:w-28 md:h-28 rounded-full transition-all duration-300 transform hover:scale-105 ".concat(n?"opacity-75 cursor-not-allowed":""),children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-red-500 to-orange-500 rounded-full opacity-75 group-hover:opacity-100 blur-xl animate-pulse"}),(0,f.jsx)("div",{className:"relative w-full h-full bg-gradient-to-br from-red-500 to-orange-600 rounded-full flex items-center justify-center shadow-2xl border-4 border-white/20",children:n?(0,f.jsx)("div",{className:"w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 border-3 sm:border-4 border-white border-t-transparent rounded-full animate-spin"}):t?(0,f.jsx)(pn.A,{className:"w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 text-white"}):(0,f.jsx)(xn.A,{className:"w-8 h-8 sm:w-10 sm:h-10 md:w-12 md:h-12 text-white ml-0.5 sm:ml-1"})})]})}),(0,f.jsxs)("div",{className:"text-center animate-fadeInUp flex-shrink-0",style:{animationDelay:"0.6s"},children:[(0,f.jsx)("p",{className:"text-lg sm:text-xl md:text-2xl lg:text-3xl font-bold mb-1 sm:mb-2 bg-gradient-to-r from-red-400 to-orange-400 bg-clip-text text-transparent",children:"No sh*t, just great music"}),(0,f.jsx)("p",{className:"text-gray-500 text-xs sm:text-sm mb-3",children:"Powered by Turbo 360"})]}),(0,f.jsx)("audio",{ref:O,preload:"auto",crossOrigin:"anonymous"})]}),v&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-[9998] animate-fadeIn",onClick:()=>j(!1)}),(0,f.jsx)("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 pointer-events-none",children:(0,f.jsxs)("div",{className:"w-full max-w-2xl bg-gradient-to-br from-gray-900 to-black border-2 border-orange-500/50 shadow-2xl rounded-3xl pointer-events-auto animate-scaleIn",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between p-4 sm:p-6 border-b border-white/20 bg-black/80 rounded-t-3xl",children:[(0,f.jsx)("h3",{className:"text-xl sm:text-2xl font-black text-white",children:"Request a Song"}),(0,f.jsx)("button",{onClick:()=>j(!1),className:"p-2 hover:bg-white/10 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-6 w-6 text-gray-300"})})]}),(0,f.jsx)("div",{className:"p-4 sm:p-6 max-h-[70vh] overflow-y-auto bg-gray-900 rounded-b-3xl",children:C?(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"mb-6 p-4 bg-gradient-to-r from-orange-500/20 to-red-500/20 border border-orange-400/30 rounded-xl",children:(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"text-sm text-orange-400 font-bold mb-1",children:"SELECTED SONG"}),(0,f.jsx)("div",{className:"text-white font-bold text-lg",children:C.title}),(0,f.jsx)("div",{className:"text-gray-300",children:C.artist})]}),(0,f.jsx)("button",{onClick:()=>F(null),className:"p-2 hover:bg-white/10 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-5 w-5 text-gray-400"})})]})}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-bold text-gray-300 mb-2",children:["Your Name ",(0,f.jsx)("span",{className:"text-red-400",children:"*"})]}),(0,f.jsx)("input",{type:"text",value:E,onChange:e=>T(e.target.value),placeholder:"Enter your name",className:"w-full px-4 py-3 bg-gray-800 border border-gray-700 rounded-xl placeholder-gray-400 focus:outline-none focus:border-orange-400 focus:ring-2 focus:ring-orange-400/50 transition-colors",style:{color:"#ffffff",WebkitTextFillColor:"#ffffff"}})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-300 mb-2",children:"Message (Optional)"}),(0,f.jsx)("textarea",{value:z,onChange:e=>B(e.target.value),placeholder:"Add a shoutout or message...",rows:"3",className:"w-full px-4 py-3 bg-gray-800 border border-gray-700 rounded-xl placeholder-gray-400 focus:outline-none focus:border-orange-400 focus:ring-2 focus:ring-orange-400/50 transition-colors resize-none",style:{color:"#ffffff",WebkitTextFillColor:"#ffffff"}})]}),(0,f.jsx)("button",{onClick:async()=>
1{if(C&&E.trim()){R(!0),W("");try{const t=await fetch("".concat(e,"/api/radio/requests"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:E,message:z,songID:C.ID,trackArtist:C.artist,trackTitle:C.title})}),s=await t.json();s.success?(W(s.message||"Request submitted successfully!"),setTimeout(()=>{F(null),T(""),B(""),W(""),j(!1)},2e3)):W(s.message||"Error submitting request")}catch(t){console.error("Error submitting request:",t),W("Error submitting request. Please try again.")}finally{R(!1)}}else W("Please select a song and enter your name")},disabled:D||!E.trim(),className:"w-full py-4 bg-gradient-to-r from-orange-500 to-red-500 hover:from-red-500 hover:to-orange-500 disabled:opacity-50 disabled:cursor-not-allowed text-white font-bold rounded-xl transition-all duration-300 transform hover:scale-[1.02] shadow-lg hover:shadow-orange-500/50 flex items-center justify-center space-x-2",children:D?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),(0,f.jsx)("span",{children:"Sending..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{children:"Send Request"})]})}),P&&(0,f.jsx)("div",{className:"p-4 rounded-xl text-center font-medium ".concat(P.includes("success")||P.includes("submitted")?"bg-green-500/20 border border-green-400/30 text-green-400":"bg-red-500/20 border border-red-400/30 text-red-400"),children:P})]})]}):(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"relative mb-4",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",value:w,onChange:e=>{const t=e.target.value;N(t),M.current&&clearTimeout(M.current),t.length>=2?M.current=setTimeout(()=>{V(t)},300):k([])},placeholder:"Search for artist or song...",className:"w-full pl-10 pr-4 py-3 bg-gray-800 border border-gray-700 rounded-xl placeholder-gray-400 focus:outline-none focus:border-orange-400 focus:ring-2 focus:ring-orange-400/50 transition-colors",style:{color:"#ffffff",WebkitTextFillColor:"#ffffff"}})]}),S&&(0,f.jsxs)("div",{className:"text-center py-8",children:[(0,f.jsx)("div",{className:"w-8 h-8 border-3 border-orange-400 border-t-transparent rounded-full animate-spin mx-auto"}),(0,f.jsx)("p",{className:"text-gray-400 mt-2",children:"Searching..."})]}),!S&&A.length>0&&(0,f.jsx)("div",{className:"space-y-2",children:A.map(e=>(0,f.jsx)("button",{onClick:()=>(e=>{F(e),N(""),k([])})(e),className:"w-full text-left p-4 bg-gray-800 hover:bg-gray-700 border border-gray-700 hover:border-orange-400 rounded-xl transition-all group",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"text-white font-bold group-hover:text-orange-400 transition-colors",children:e.title}),(0,f.jsx)("div",{className:"text-sm text-gray-400",children:e.artist})]}),(0,f.jsx)(Ya.A,{className:"h-5 w-5 text-gray-400 group-hover:text-orange-400 transition-colors"})]})},e.ID))}),!S&&w.length>=2&&0===A.length&&(0,f.jsx)("div",{className:"text-center py-8 text-gray-400",children:"No tracks found. Try a different search."}),0===w.length&&(0,f.jsx)("div",{className:"text-center py-8 text-gray-400",children:"Start typing to search for songs..."})]})})]})})]}),(0,f.jsx)("style",{jsx:!0,children:"\n @keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translateY(30px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes slideUp {\n from {\n opacity: 0;\n transform: translateY(100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes scaleIn {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n \n .animate-fadeIn {\n animation: fadeIn 1s ease-out forwards;\n }\n \n .animate-fadeInUp {\n animation: fadeInUp 1s ease-out forwards;\n opacity: 0;\n }\n \n .animate-slideUp {\n animation: slideUp 0.3s ease-out forwards;\n }\n \n .animate-scaleIn {\n animation: scaleIn 0.2s ease-out forwards;\n }\n "})]})},un={"/weddings/wedding-videography":"/weddings","/weddings/wedding-photography":"/weddings","/wedding-videography":"/weddings","/wedding-photography":"/weddings","/conference-videography":"/conferences","/conference-photography":"/conferences","/corporate-events":"/conferences","/exhibition-photography":"/conferences","/exhibition-vi
1deography":"/conferences","/business-content":"/business","/corporate":"/business","/corporate-videography":"/business","/corporate-photography":"/business","/business-videography":"/business","/business-photography":"/business","/commercial":"/business","/commercial-videography":"/business","/commercial-photography":"/business","/event-photography/perth":"/services/locations/perth","/event-photography/canberra":"/services/locations/canberra","/event-photography/darwin":"/services/locations/darwin","/event-photography/geelong":"/services/locations/geelong","/conference-photographer-melbourne":"/services/conference-photography/melbourne","/corporate-event-photographer-melbourne":"/services/corporate-event-photography/melbourne","/education":"/schools","/school-videography":"/schools","/school-photography":"/schools","/virtual-tours":"/schools","/360-tours":"/schools","/about-us":"/about","/company":"/about","/our-story":"/about","/team":"/about","/quote":"/packages","/quotes":"/packages","/pricing":"/packages","/book":"/packages","/booking":"/packages","/contact-us":"/#contact","/our-services":"/services","/what-we-do":"/services","/portfolio":"/#work","/our-work":"/#work","/gallery":"/#work","/examples":"/#work","/showcase":"/#work","/blog":"/","/news":"/","/updates":"/","/service":"/packages","/event":"/packages"},gn=e=>{let{children:t}=e;const s=(0,r.Zp)(),n=(0,r.zy)();return(0,a.useEffect)(()=>{let e=n.pathname;if(e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),"/"===e)return;if("/wedding-share/Is7T0gs9mDssJ2Cl4vmeg74NH6lK38dDoGOOG-pYrPg"===e)return void window.location.replace("https://turbo.net.au/wedding-share/jaydewoods");const t=(e=>{if(un[e])return un[e];for(const[t,s]of Object.entries(un))if(e.startsWith(t+"/"))return s;return null})(e);if(t)if(console.log("URLRedirectHandler: Redirecting ".concat(e," \u2192 ").concat(t)),t.includes("#")){const[e,a]=t.split("#");s("".concat(e).concat(n.search),{replace:!0}),setTimeout(()=>{const e=document.getElementById(a);e&&e.scrollIntoView({behavior:"smooth"})},100)}else s("".concat(t).concat(n.search).concat(n.hash),{replace:!0})},[n.pathname,n.search,n.hash,s]),t},fn=e=>{let{value:t,onChange:s,className:a,placeholder:n="Select time"}=e;const r=(e,t)=>{const s=e>=12?"PM":"AM";return"".concat(0===e?12:e>12?e-12:e,":").concat(t.toString().padStart(2,"0")," ").concat(s)},i=(()=>{const e=[];for(let t=7;t<=23;t++)for(let s of[0,15,30,45]){const a="".concat(t.toString().padStart(2,"0"),":").concat(s.toString().padStart(2,"0")),n=r(t,s);e.push({value:a,label:n})}return e})();return(0,f.jsxs)("select",{value:t||"",onChange:e=>s(e.target.value),className:a,children:[(0,f.jsx)("option",{value:"",children:n}),i.map(e=>(0,f.jsx)("option",{value:e.value,children:e.label},e.value))]})},bn=e=>{let{fileType:t,label:s,description:n,currentFile:r,onFileUploaded:i,onFileDeleted:o,authToken:l,clientId:c,disabled:d=!1}=e;const[m,p]=(0,a.useState)(!1),[x,u]=(0,a.useState)(""),[b,y]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],w=10485760,N=async e=>{const s=(e=>e?j.includes(e.type)?e.size>w?"File size must be less than ".concat(10,"MB"):null:"Only PDF, DOC, and DOCX files are allowed":"No file selected")(e);if(s)u(s);else{p(!0),u("");try{const s=new FormData;s.append("file",e),s.append("file_type",t),c&&s.append("client_id",c);const a=await fetch("".concat(I.fn,"/api/wedding-files/upload"),{method:"POST",headers:{Authorization:"Bearer ".concat(l)},body:s});if(a.ok){const e=await a.json();e.success&&i&&i(e.file_info)}else{const e=await a.json();u(e.detail||"Upload failed")}}catch(a){console.error("Upload error:",a),u("Network error occurred")}finally{p(!1)}}},A=e=>{e&&e[0]&&N(e[0])};return(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsx)("div",{className:"flex items-center justify-between",children:(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:s})}),n&&(0,f.jsx)("p",{className:"text-sm text-gray-500",children:n}),r?(0,f.jsxs)("div",{className:"border border-green-200 rounded-lg p-4 bg-green-50",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("div",{className:"text-2xl",children:(e=>{var t;const s=null===e||void 0===e||null===(t=e.split(".").pop())||void 0===t?void 0:t.toLowerCase();return"pdf"===s?"\ud83d\udcc4":"doc"===s||"docx"===s?"\ud83d\udcdd":"\ud83d\udcce"})(r.original_filename)}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-green-900",children:r.original_filename}),(0,f.jsx)("p",{className:"text-sm text-green-600",children:r.file_size?(e=>{if(0===e)return"0 Bytes";const t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]})(r.file_size):"File uploaded"})]})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[r.download_url&&(0,f.jsx)("a",{href:r.download_url,target:"_blank",rel:"noopener noreferrer",className:"p-2 text-green-600 hover:text-green-800 hover:bg-green-100 rounded-full transition-colors",title:"Download file",children:(0,f.jsx)(es.A,{className:"h-4 w-4"})}
1),!d&&(0,f.jsx)("button",{onClick:()=>{o&&o()},className:"p-2 text-red-600 hover:text-red-800 hover:bg-red-100 rounded-full transition-colors",title:"Remove file",children:(0,f.jsx)(g.A,{className:"h-4 w-4"})})]})]}),(0,f.jsxs)("div",{className:"mt-2 flex items-center text-sm text-green-600",children:[(0,f.jsx)(zt.A,{className:"h-4 w-4 mr-1"}),"File uploaded successfully"]})]}):(0,f.jsxs)("div",{className:"border-2 border-dashed rounded-lg p-6 text-center transition-colors ".concat(b?"border-rose-500 bg-rose-50":"border-gray-300 hover:border-gray-400"," ").concat(d?"opacity-50 cursor-not-allowed":"cursor-pointer"),onDragOver:e=>{e.preventDefault(),e.stopPropagation(),d||y(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),y(!1)},onDrop:e=>{if(e.preventDefault(),e.stopPropagation(),y(!1),d)return;const t=e.dataTransfer.files;A(t)},onClick:()=>{!d&&v.current&&v.current.click()},children:[(0,f.jsx)("input",{ref:v,type:"file",accept:".pdf,.doc,.docx",onChange:e=>{A(e.target.files)},className:"hidden",disabled:d}),m?(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)("div",{className:"w-8 h-8 border-4 border-rose-200 border-t-rose-600 rounded-full animate-spin mx-auto"}),(0,f.jsx)("p",{className:"text-sm text-gray-600",children:"Uploading..."})]}):(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(_s.A,{className:"h-8 w-8 text-gray-400 mx-auto"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Click to upload or drag and drop"}),(0,f.jsx)("p",{className:"text-xs text-gray-500",children:"PDF, DOC, or DOCX files (max 10MB)"})]})]})]}),x&&(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-600 text-sm",children:[(0,f.jsx)(h.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:x})]})]})};var yn=s(23658),vn=s(91720);const jn=s.p+"static/media/turbo-360-logo.e41437bde04ac172d3fb.png",wn=s.p+"static/media/turbo-ico-red.ff72289572afc11c450f.png";let Nn=null,An=null;const kn=()=>{const[e,t]=(0,a.useState)(!1),[s,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(""),[o,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(!1),[p,x]=(0,a.useState)({wedding_date:"",first_name:"",last_name:"",mobile_number:"",email_address:"",partner_first_name:"",partner_last_name:"",partner_mobile_number:"",prep_address:"",prep_start_time:"",prep_end_time:"",prep_additional_notes:"",partner_prep_address:"",partner_prep_start_time:"",partner_prep_end_time:"",partner_prep_additional_notes:"",ceremony_location_type:"",ceremony_address:"",ceremony_start_time:"",celebrant_name:"",ceremony_type_special_events:"",guest_count:"",family_photo_combinations_file:null,bridal_party_photo_locations:"",reception_venue_address:"",bridal_party_introduction_time:"",reception_special_events:"",reception_runsheet_file:null,best_man_name:"",best_man_contact:"",maid_of_honor_name:"",maid_of_honor_contact:"",crew_meal_provided:null,additional_notes:""}),[h,u]=(0,a.useState)(!1),[g,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(null),[j,w]=(0,a.useState)(!1),N=(0,a.useRef)(null);(0,a.useEffect)(()=>{(()=>{if(window.google&&window.google.maps)return Nn=new window.google.maps.places.AutocompleteService,void(An=new window.google.maps.places.PlacesService(document.createElement("div")));if(!document.querySelector('script[src*="maps.googleapis.com"]')){const e=document.createElement("script");e.src="https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyBoyKzaLnNGgUrfkRYrW9maAFOmHRVcfys","&libraries=places"),e.async=!0,e.defer=!0,e.onload=()=>{Nn=new window.google.maps.places.AutocompleteService,An=new window.google.maps.places.PlacesService(document.createElement("div"))},document.head.appendChild(e)}})()},[]),(0,a.useEffect)(()=>{const e=sessionStorage.getItem("adminEditingForm");if(e){const{clientEmail:t,isAdminEditing:s}=JSON.parse(e);if(s)return i(t),sessionStorage.removeItem("adminEditingForm"),void k(t)}const t=localStorage.getItem("wedding_auth_token");t&&(n(t),S(t))},[]),(0,a.useEffect)(()=>(s&&!h&&(N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{F()},3e4)),()=>{N.current&&clearTimeout(N.current)}),[p,s,h]);const A=async e=>{e.preventDefault(),d(!0),l("");try{const e=await fetch("".concat(I.fn,"/api/wedding/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r})}),s=await e.json();s.success?(n(s.token),localStorage.setItem("wedding_auth_token",s.token),t(!0),S(s.token)):l(s.message||"Login failed")}catch(s){console.error("Login error:",s),l("Login failed. Please try again.")}finally{d(!1)}},k=async e=>{d(!0),l("");try{const s=await fetch("".concat(I.fn,"/api/wedding/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})}),a=await s.json();a.success?(n(a.token),localStorage.setItem("wedding_auth_token",a.token),t(!0),S(a.token)):(l("Admin editing failed - client not found"),console.error("Admin login failed:",a.message))}catch(s){console.error("Admin login error:",s),l("Admin editing failed. Please try again.")}finally{d(!1)}},S=async e=>{try{const s=await fetch("".concat(I.fn,"/api/wedding/form"),{headers:{Authorization:"Bearer ".concat(e)}});if(s.ok){const e=await s.json();if(e.success&&e.form_data){const s={};
1Object.keys(e.form_data).forEach(t=>{const a=e.form_data[t];s[t]=null===a||void 0===a?"":a}),x(s),u(!1),t(!0)}}else localStorage.removeItem("wedding_auth_token"),n(null),t(!1)}catch(s){console.error("Error loading form:",s)}},_=e=>{const t=(0,m.A)({},e);["guest_count","ceremony_duration_minutes","reception_duration_minutes","photo_session_duration","bridal_party_count","groomsmen_count"].forEach(e=>{""===t[e]||"undefined"===t[e]||void 0===t[e]?t[e]=null:t[e]&&!isNaN(t[e])&&(t[e]=parseInt(t[e],10))}),["prep_start_time","prep_end_time","partner_prep_start_time","partner_prep_end_time","ceremony_start_time","bridal_party_introduction_time","coverage_finish_time"].forEach(e=>{""!==t[e]&&"undefined"!==t[e]&&void 0!==t[e]||(t[e]=null)}),["crew_meal_provided","created_from_booking"].forEach(e=>{""===t[e]||"undefined"===t[e]||void 0===t[e]?t[e]=null:"true"===t[e]||!0===t[e]?t[e]=!0:"false"!==t[e]&&!1!==t[e]||(t[e]=!1)});["partner_first_name","partner_last_name","partner_mobile_number","ceremony_address","celebrant_name","reception_venue_address","best_man_name","best_man_contact","maid_of_honor_name","maid_of_honor_contact","additional_notes","prep_additional_notes","partner_prep_additional_notes","ceremony_type_special_events","bridal_party_photo_locations","reception_special_events"].forEach(e=>{""!==t[e]&&"undefined"!==t[e]&&void 0!==t[e]||(t[e]=null)}),t.guest_count!==e.guest_count&&console.log("cleanFormDataForSubmission: guest_count converted from",e.guest_count,"to",t.guest_count);const s={};return["wedding_date","first_name","last_name","mobile_number","email_address","partner_first_name","partner_last_name","partner_mobile_number","prep_address","prep_start_time","prep_end_time","prep_additional_notes","partner_prep_address","partner_prep_start_time","partner_prep_end_time","partner_prep_additional_notes","ceremony_location_type","ceremony_address","ceremony_start_time","celebrant_name","ceremony_type_special_events","guest_count","family_photo_combinations_file","bridal_party_photo_locations","reception_venue_address","bridal_party_introduction_time","reception_special_events","reception_runsheet_file","best_man_name","best_man_contact","maid_of_honor_name","maid_of_honor_contact","crew_meal_provided","additional_notes"].forEach(e=>{t.hasOwnProperty(e)&&(s[e]=t[e])}),s},F=async()=>{if(s&&!h){b(!0);try{const e=_(p);(await fetch("".concat(I.fn,"/api/wedding/form"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify(e)})).ok&&v(new Date)}catch(e){console.error("Auto-save error:",e)}finally{b(!1)}}},z=(e,t)=>{x(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t}))};return e?(0,f.jsxs)("div",{className:"wedding-form-container min-h-screen bg-gradient-to-br from-rose-50 to-pink-100",children:[(0,f.jsx)("div",{className:"bg-white shadow-lg",children:(0,f.jsx)("div",{className:"max-w-4xl mx-auto px-4 py-6",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("div",{className:"flex items-center justify-center",children:(0,f.jsx)("img",{src:wn,alt:"Turbo 360",className:"h-12 w-12"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Wedding Schedule"}),(0,f.jsx)("p",{className:"text-sm text-gray-600",children:"Plan your perfect day with Team Turbo"})]})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsx)("div",{className:"flex items-center space-x-2 text-sm",children:g?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-4 h-4 border-2 border-gray-300 border-t-rose-500 rounded-full animate-spin"}),(0,f.jsx)("span",{className:"text-gray-600",children:"Saving..."})]}):y?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ia.A,{className:"h-4 w-4 text-green-500"}),(0,f.jsxs)("span",{className:"text-gray-600",children:["Saved ",y.toLocaleTimeString()]})]}):null}),(0,f.jsx)("button",{onClick:()=>{localStorage.removeItem("wedding_auth_token"),n(null),t(!1),x({})},className:"text-gray-600 hover:text-gray-900 text-sm font-medium",children:"Logout"})]})]})})}),(0,f.jsxs)("div",{className:"max-w-4xl mx-auto p-4 pb-20",children:[h&&(0,f.jsx)("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4 mb-8",children:(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-6 h-6 bg-green-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(st.A,{className:"h-4 w-4 text-green-600"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"font-semibold text-green-800",children:"Form Submitted"}),(0,f.jsx)("p",{className:"text-sm text-green-700",children:"Your wedding schedule has been finalized and Team Turbo has been notified."})]})]})}),(0,f.jsxs)("div",{className:"space-y-8",children:[(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-rose-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(_t.A,{className:"h-5 w-5 text-rose-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Wedding Date"})]}),(0,f.jsxs)("div",{className:"max-w-md",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Date of Wedding *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(_t.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"date",value:p.wedding_date,onChange:e=>z("wedding_date",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600 bg-rose-50",required:!0})]})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-blue-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(Ye.A,{className:"h-5 w-5 text-blue-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Person Completing Form"})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"First Name *"}),(0,f.jsx)("input",{type:"text",value:p.first_name,onChange:e=>z("first_name",e.target.value),disabled:h,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Your first name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Last Name *"}),(0,f.jsx)("input",{type:"text",value:p.last_name,onChange:e=>z("last_name",e.target.value),disabled:h,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Your last name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Mobile Number *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(E.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"tel",value:p.mobile_number,onChange:e=>z("mobile_number",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"0400 000 000"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email Address *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(T.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"email",value:p.email_address,onChange:e=>z("email_address",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"[email protected]"})]})]})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-pink-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(fs.A,{className:"h-5 w-5 text-pink-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Partner Details"})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-3 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner's First Name *"}),(0,f.jsx)("input",{type:"text",value:p.partner_first_name,onChange:e=>z("partner_first_name",e.target.value),disabled:h,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Partner's first name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner's Last Name *"}),(0,f.jsx)("input",{type:"text",value:p.partner_last_name,onChange:e=>z("partner_last_name",e.target.value),disabled:h,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Partner's last name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner's Mobile Number *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(E.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"tel",value:p.partner_mobile_number,onChange:e=>z("partner_mobile_number",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"0400 000 000"})]})]})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-purple-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(yn.A,{className:"h-5 w-5 text-purple-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Your Preparations"})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Preparation Address *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(C.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",value:p.prep_address,onChange:e=>z("prep_address",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Where will you be getting ready?"})]})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Start Time for Prep Coverage"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Nt.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)(fn,{value:p.prep_start_time,onChange:e=>z("prep_start_time",e),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Select start time"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"End Time for Prep Coverage"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Nt.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)(fn,{value:p.prep_end_time,onChange:e=>z("prep_end_time",e),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Select end time"})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Additional Preparation Notes"}),(0,f.jsx)("div",{className:"relative",children:(0,f.jsx)("textarea",{value:p.prep_additional_notes,onChange:e=>z("prep_additional_notes",e.target.value),disabled:h,className:"w-full p-4 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600 min-h-[100px] resize-y",placeholder:"Any special notes about your preparation schedule, requirements, or details we should know..."})}),(0,f.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:'This information will appear as a yellow "Special Notes" section on your wedding run sheet'})]})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-indigo-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(yn.A,{className:"h-5 w-5 text-indigo-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Partner Preparations"})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner's Preparation Address *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(C.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",value:p.partner_prep_address,onChange:e=>z("partner_prep_address",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Where will your partner be getting ready?"})]})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Start Time for Partner Prep Coverage"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Nt.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)(fn,{value:p.partner_prep_start_time,onChange:e=>z("partner_prep_start_time",e),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Select start time"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"End Time for Partner Prep Coverage"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Nt.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)(fn,{value:p.partner_prep_end_time,onChange:e=>z("partner_prep_end_time",e),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Select end time"})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Additional Partner Preparation Notes"}),(0,f.jsx)("div",{className:"relative",children:(0,f.jsx)("textarea",{value:p.partner_prep_additional_notes,onChange:e=>z("partner_prep_additional_notes",e.target.value),disab
1led:h,className:"w-full p-4 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600 min-h-[100px] resize-y",placeholder:"Any special notes about your partner's preparation schedule, requirements, or details we should know..."})}),(0,f.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:'This information will appear as a yellow "Special Notes" section on your wedding run sheet'})]})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-yellow-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(fs.A,{className:"h-5 w-5 text-yellow-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Ceremony Details"})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Ceremony Location Type *"}),(0,f.jsxs)("div",{className:"flex space-x-4",children:[(0,f.jsxs)("label",{className:"flex items-center bg-white p-3 rounded-lg border border-gray-200 cursor-pointer hover:bg-gray-50",children:[(0,f.jsx)("input",{type:"radio",name:"ceremony_location_type",value:"inside",checked:"inside"===p.ceremony_location_type,onCh
1ange:e=>z("ceremony_location_type",e.target.value),disabled:h,className:"mr-3 text-rose-600 focus:ring-rose-500"}),(0,f.jsx)("span",{className:"text-gray-900 font-medium",children:"Inside"})]}),(0,f.jsxs)("label",{className:"flex items-center bg-white p-3 rounded-lg border border-gray-200 cursor-pointer hover:bg-gray-50",children:[(0,f.jsx)("input",{type:"radio",name:"ceremony_location_type",value:"outside",checked:"outside"===p.ceremony_location_type,onChange:e=>z("ceremony_location_type",e.target.value),disabled:h,className:"mr-3 text-rose-600 focus:ring-rose-500"}),(0,f.jsx)("span",{className:"text-gray-900 font-medium",children:"Outside"})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Address of Wedding Ceremony *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(C.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",value:p.ceremony_address,onChange:e=>z("ceremony_address",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Ceremony venue address"})]})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Start Time of Ceremony *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Nt.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)(fn,{value:p.ceremony_start_time,onChange:e=>z("ceremony_start_time",e),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Select ceremony time"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Guest Count"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Xe.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"number",value:p.guest_count,onChange:e=>z("guest_count",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Approximate number of guests"})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Name of Celebrant"}),(0,f.jsx)("input",{type:"text",value:p.celebrant_name,onChange:e=>z("celebrant_name",e.target.value),disabled:h,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Who will be officiating the ceremony?"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Type of Ceremony / Special Events"}),(0,f.jsx)("textarea",{value:p.ceremony_type_special_events,onChange:e=>z("ceremony_type_special_events",e.target.value),disabled:h,rows:3,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Describe the ceremony type and any special events or traditions..."})]})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-green-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(Ue.A,{className:"h-5 w-5 text-green-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Family Photos"})]}),(0,f.jsx)(bn,{fileType:"family_photo_list",label:"Family Photo Combinations List",description:"Upload a document with your family photo requirements and combinations",currentFile:p.family_photo_combinations_file,onFileUploaded:e=>{z("family_photo_combinations_file",e)}
1,onFileDeleted:()=>{z("family_photo_combinations_file",null)},authToken:s,disabled:h})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-orange-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(Ue.A,{className:"h-5 w-5 text-orange-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Bridal Party Photoshoot"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Specific Locations for Photos"}),(0,f.jsx)("textarea",{value:p.bridal_party_photo_locations,onChange:e=>z("bridal_party_photo_locations",e.target.value),disabled:h,rows:4,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Describe specific locations or shots you'd like for the bridal party photoshoot..."})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-red-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(Ya.A,{className:"h-5 w-5 text-red-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Reception"})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Reception Venue/Address *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(C.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",value:p.reception_venue_address,onChange:e=>z("reception_venue_address",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Reception venue address"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Time Bridal Party Introduced"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Nt.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)(fn,{value:p.bridal_party_introduction_time,onChange:e=>z("bridal_party_introduction_time",e),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Select introduction time"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Special Events During Reception"}),(0,f.jsx)("textarea",{value:p.reception_special_events,onChange:e=>z("reception_special_events",e.target.value),disabled:h,rows:3,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Describe any special events, speeches, dances, or activities during the reception..."})]}),(0,f.jsx)(bn,{fileType:"reception_runsheet",label:"Reception Runsheet",description:"Upload your reception timeline and runsheet",currentFile:p.reception_runsheet_file,onFileUploaded:e=>{z("reception_runsheet_file",e)},onFileDeleted:()=>{z("reception_runsheet_file",null)},authToken:s,disabled:h})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-teal-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(Xe.A,{className:"h-5 w-5 text-teal-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Other Contacts"})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("h3",{className:"font-semibold text-gray-800",children:"Best Man"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Name"}),(0,f.jsx)("input",{type:"text",value:p.best_man_name,onChange:e=>z("best_man_name",e.target.value),disabled:h,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Best man's name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Contact Number"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(E.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"tel",value:p.best_man_contact,onChange:e=>z("best_man_contact",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"0400 000 000"})]})]})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("h3",{className:"font-semibold text-gray-800",children:"Maid of Honor"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Name"}),(0,f.jsx)("input",{type:"text",value:p.maid_of_honor_name,onChange:e=>z("maid_of_honor_name",e.target.value),disabled:h,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Maid of honor's n
1ame"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Contact Number"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(E.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"tel",value:p.maid_of_honor_contact,onChange:e=>z("maid_of_honor_contact",e.target.value),disabled:h,className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"0400 000 000"})]})]})]})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-amber-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(vn.A,{className:"h-5 w-5 text-amber-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Crew Meal Coverage"})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-4",children:"Will you be providing a meal for the crew?"}),(0,f.jsxs)("div",{className:"flex space-x-4",children:[(0,f.jsxs)("label",{className:"flex items-center bg-white p-3 rounded-lg border border-gray-200 cursor-pointer hover:bg-gray-50",children:[(0,f.jsx)("input",{type:"radio",name:"crew_meal_provided",value:"true",checked:!0===p.crew_meal_provided,onChange:e=>z("crew_meal_provided",!0),disabled:h,className:"mr-3 text-rose-600 focus:ring-rose-500"}),(0,f.jsx)("span",{className:"text-gray-900 font-medium",children:"Yes"})]}),(0,f.jsxs)("label",{className:"flex items-center bg-white p-3 rounded-lg border border-gray-200 cursor-pointer hover:bg-gray-50",children:[(0,f.jsx)("input",{type:"radio",name:"crew_meal_provided",value:"false",checked:!1===p.crew_meal_provided,onChange:e=>z("crew_meal_provided",!1),disabled:h,className:"mr-3 text-rose-600 focus:ring-rose-500"}),(0,f.jsx)("span",{className:"text-gray-900 font-medium",children:"No"})]})]})]}),(0,f.jsx)("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:(0,f.jsxs)("div",{className:"flex items-start space-x-2",children:[(0,f.jsx)("div",{className:"w-5 h-5 text-amber-600 mt-0.5",children:"\u2139\ufe0f"}),(0,f.jsxs)("div",{className:"text-sm text-amber-800",children:[(0,f.jsx)("strong",{children:"Important:"})," If your booking is for more than 5 hours and a meal is NOT provided, the total package time will be reduced by 1 hour to allow for a meal break."]})]})})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-6",children:[(0,f.jsx)("div",{className:"w-10 h-10 bg-gray-100 rounded-full flex items-center justify-center",children:(0,f.jsx)(kt.A,{className:"h-5 w-5 text-gray-600"})}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Additional Notes"})]}),(0,f.jsx)("div",{children:(0,f.jsx)("textarea",{value:p.additional_notes,onChange:e=>z("additional_notes",e.target.value),disabled:h,rows:6,className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 disabled:bg-gray-50 text-gray-900 disabled:text-gray-600",placeholder:"Any additional notes, special requests, or important details you'd like Team Turbo to know about your wedding day..."})})]})]}),!h&&(0,f.jsx)("div",{className:"fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 p-4",children:(0,f.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,f.jsxs)("div",{className:"flex space-x-4",children:[(0,f.jsx)("button",{onClick:async()=>{if(s){b(!0);try{const e=_(p);(await fetch("".concat(I.fn,"/api/wedding/form"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify(e)})).ok&&(v(new Date),console.log("Form saved successfully!"))}catch(e){console.error("Save error:",e)}finally{b(!1)}}},disabled:g,className:"flex-1 bg-green-600 hover:bg-green-700 text-white font-bold py-4 px-6 rounded-lg transition-colors disabled:opacity-50 flex items-center justify-center space-x-3 text-lg",children:g?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-6 h-6 border-2 border-white border-t-transparent roun
1ded-full animate-spin"}),(0,f.jsx)("span",{children:"Saving..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ia.A,{className:"h-6 w-6"}),(0,f.jsx)("span",{children:"Save For Later"})]})}),(0,f.jsx)("button",{onClick:async()=>{w(!0);try{const e=_(p);if(!(await fetch("".concat(I.fn,"/api/wedding/form"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify(e)})).ok)throw new Error("Failed to save form data before finalizing");const t=await fetch("".concat(I.fn,"/api/wedding/finalize"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}}),a=await t.json();if(a.success)u(!0),alert("\u2705 Wedding schedule submitted successfully!\n\nThank you for completing your wedding details. Our team has been notified and will contact you shortly."),console.log("Wedding schedule submitted successfully!");else{const e=a.message||a.detail||"Please try again or contact support.";alert("\u274c Error submitting form: ".concat(e)),console.error("Error submitting form:",e)}}catch(e){console.error("Finalize error:",e),alert("\u274c Failed to submit wedding schedule.\n\nPlease check your internet connection and try again. If the problem persists, contact support.")}finally{w(!1)}},disabled:j,className:"flex-1 bg-rose-600 hover:bg-rose-700 text-white font-bold py-4 px-6 rounded-lg transition-colors disabled:opacity-50 flex items-center justify-center space-x-3 text-lg",children:j?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin"}),(0,f.jsx)("span",{children:"Submitting..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-6 w-6"}),(0,f.jsx)("span",{children:"Finalise and Submit"})]})})]}),(0,f.jsx)("p",{className:"text-center text-sm text-gray-600 mt-2",children:"You can return to this form to update details as needed."})]})})]})]}):(0,f.jsx)("div",{className:"wedding-form-container min-h-screen bg-gradient-to-br from-rose-50 to-pink-100 flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl p-8 w-full max-w-md",children:[(0,f.jsxs)("div",{className:"text-center mb-8",children:[(0,f.jsx)("div",{className:"mb-4",children:(0,f.jsx)("img",{src:jn,alt:"Turbo 360",className:"mx-auto h-16 w-auto"})}),(0,f.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Wedding Schedule"}),(0,f.jsx)("p",{className:"text-gray-600",children:"Welcome to your personalised wedding planning portal"})]}),(0,f.jsxs)("form",{onSubmit:A,className:"space-y-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Email Address"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(T.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{id:"email",type:"email",value:r,onChange:e=>i(e.target.value),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-rose-500 transition-colors text-gray-900",placeholder:"Enter your email address",required:!0})]})]}),o&&(0,f.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:(0,f.jsx)("p",{className:"text-sm text-red-600",children:o})}),(0,f.jsx)("button",{type:"submit",disabled:c,className:"w-full bg-rose-600 hover:bg-rose-700 text-white font-semibold py-3 px-4 rounded-lg transition-colors disabled:opacity-50 flex items-center justify-center space-x-2",children:c?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin"}),(0,f.jsx)("span",{children:"Logging in..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{children:"Access Wedding Form"}),(0,f.jsx)(fs.A,{className:"h-5 w-5"})]})})]}),(0,f.jsx)("div",{className:"mt-6 text-center",children:(0,f.jsxs)("p",{className:"text-xs text-gray-500",children:["Only authorized wedding clients can access this form.",(0,f.jsx)("br",{}),"Contact Team Turbo if you need access."]})})]})})};var Sn=s(68236);const _n=e=>{let{contacts:t,selectedContactId:s,onContactSelect:n,label:r="Select Contact",variant:i="dark"}=e;const[o,l]=(0,a.useState)(""),[c,d]=(0,a.useState)([]),m=t.filter(e=>!0===e.is_company),p=t.filter(e=>!0!==e.is_company),x="block text-sm font-bold mb-2 uppercase tracking-wide flex items-center gap-2",h="dark"===i?"text-teal-300":"text-indigo-700",u="dark"===i?"text-purple-300":"text-purple-700",g="dark"===i?"w-full px-4 py-3 bg-white/10 border-2 border-white/20 rounded-xl text-white text-lg focus:border-teal-400 focus:outline-none appearance-none pr-10":"w-full px-4 py-3 bg-white border-2 border-gray-300 rounded-xl text-gray-900 text-base focus:border-indigo-500 focus:outline-none appearance-none pr-10",b="dark"===i?"px-4 py-3 bg-yellow-500/20 border border-yellow-400/50 rounded-xl text-yellow-200 text-sm":"px-4 py-3 bg-yellow-50 border border-yellow-300 rounded-xl text-yellow-800 text-sm",y="dark"===i?"bg-blue-500/10 border border-blue-400/30 rounded-xl p-3":"bg-indigo-50 border border-indigo-200 rounded-xl p-3",v="dark"===i?"text-blue-200 text-xs":"text-indigo-700 text-xs",j="string"===typeof s?s:(null===s||void 0===s?void 0:s.id)||"";return(0,a.useEffect)(()=>
1{if(j){const e=p.find(e=>e.id===j);null!==e&&void 0!==e&&e.parent_company_id&&e.parent_company_id!==o&&l(e.parent_company_id)}},[j,p]),(0,a.useEffect)(()=>{if(o){const e=m.find(e=>e.id===o);console.log("=== CONTACT SELECTOR DEBUG ==="),console.log("Selected Company:",e),console.log("Selected Company ID:",o),console.log("Total contacts in system:",p.length),console.log("All contacts structure:",p.map(e=>({id:e.id,name:e.is_company?e.company_name:"".concat(e.first_name," ").concat(e.last_name),is_company:e.is_company,parent_company_id:e.parent_company_id,parent_company_name:e.parent_company_name})));const t=p.filter(t=>{if(t.is_company)return!1;if(t.parent_company_id===o)return console.log("\u2705 Match by parent_company_id:",t.first_name,t.last_name),!0;if(e&&t.parent_company_name){if(t.parent_company_name.trim().toLowerCase()===e.company_name.trim().toLowerCase())return console.log("\u2705 Match by parent_company_name:",t.first_name,t.last_name),!0}if(e&&t.company_name){if(t.company_name.trim().toLowerCase()===e.company_name.trim().toLowerCase())return console.log("\u2705 Match by company_name:",t.first_name,t.last_name),!0}return!1});console.log("Filtered contacts:",t.length),console.log("Filtered contact details:",t.map(e=>"".concat(e.first_name," ").concat(e.last_name))),console.log("=== END DEBUG ==="),d(t)}else d([])},[o,p,m]),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"".concat(x," ").concat(h),children:[(0,f.jsx)(gs.A,{className:"h-4 w-4"}),"Step 1: Select Company"]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsxs)("select",{value:o,onChange:e=>{const t=e.target.value;l(t),t!==o&&j&&n("")},className:g,children:[(0,f.jsx)("option",{value:"",children:"-- Select a company first --"}),m.map(e=>(0,f.jsx)("option",{value:e.id,children:e.company_name},e.id))]}),(0,f.jsx)(Et.A,{className:"absolute right-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400 pointer-events-none"})]})]}),o&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"".concat(x," ").concat(u),children:[(0,f.jsx)(Ye.A,{className:"h-4 w-4"}),"Step 2: Select Contact"]}),c.length>0?(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsxs)("select",{value:j||"",onChange:e=>{const t=e.target.value,s=c.find(e=>e.id===t);s&&n(s)},className:g,children:[(0,f.jsx)("option",{value:"",children:"-- Select a contact --"}),c.map(e=>{const t=e.contact_name||(e.first_name&&e.last_name?"".concat(e.first_name," ").concat(e.last_name):e.first_name||e.last_name||e.email||"Unnamed Contact");return(0,f.jsxs)("option",{value:e.id,children:[t,e.position?" - ".concat(e.position):""]},e.id)})]}),(0,f.jsx)(Et.A,{className:"absolute right-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400 pointer-events-none"})]}):(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:b,children:["No contacts found under this company.",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-xs",children:'Check console (F12) for debug info, or use "Show All Contacts" below.'})]}),(0,f.jsx)("button",{type:"button",onClick:()=>{const e=p.filter(e=>!e.is_company);d(e)},className:"mt-2 w-full px-3 py-2 bg-orange-100 text-orange-800 rounded-lg text-sm font-semibold hover:bg-orange-200 transition-colors",children:"\ud83d\udd13 Show All Contacts (Bypass Filter)"})]})]}),!o&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3 text-sm text-blue-800",children:[(0,f.jsx)("p",{className:"font-semibold mb-1",children:"\ud83d\udca1 Quick Tip:"}),(0,f.jsx)("p",{children:"Select a company above to filter contacts, or click below to see all contacts."})]}),(0,f.jsx)("button",{type:"button",onClick:()=>{const e=p.filter(e=>!e.is_company);d(e),l("bypass")},className:"mt-2 w-full px-4 py-3 bg-purple-100 text-purple-800 rounded-lg text-sm font-bold hover:bg-purple-200 transition-colors border-2 border-purple-300",children:"\ud83d\udc65 Show All Contacts (Skip Company Filter)"})]}),(0,f.jsx)("div",{className:y,children:(0,f.jsxs)("p",{className:v,children:[(0,f.jsx)("strong",{children:"Tip:"}
1)," Select a company first, then choose a contact from that company's list."]})})]})},Cn=e=>{let{onClose:t}=e;const[s,n]=(0,a.useState)({proposals:[],invoices:[],corporate_events:[]}),[r,i]=(0,a.useState)([]),[o,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[u,b]=(0,a.useState)(!0),[y,j]=(0,a.useState)(0);(0,a.useEffect)(()=>{w(),N()},[]);const w=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/orphaned-items"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();n(e.orphaned_items),j(e.total_count)}}catch(t){console.error("Error loading orphaned items:",t)}finally{b(!1)}},N=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();i(e.clients||[])}}catch(t){console.error("Error loading contacts:",t)}},A=(e,t)=>{d((0,m.A)((0,m.A)({},e),{},{type:t})),l(""),h(!0)},k=e=>{if(!e)return"N/A";try{return new Date(e).toLocaleDateString("en-AU",{year:"numeric",month:"short",day:"numeric"})}catch(t){return e}};return u?(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,f.jsx)("div",{className:"bg-white rounded-2xl p-8 shadow-2xl",children:(0,f.jsx)("p",{className:"text-gray-600",children:"Loading orphaned items..."})})}):0===y?null:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-5xl max-h-[90vh] overflow-hidden",children:[(0,f.jsx)("div",{className:"bg-gradient-to-r from-amber-500 to-orange-500 p-6 text-white",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)(v.A,{className:"h-8 w-8"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-2xl font-bold",children:"\u26a0\ufe0f Orphaned Items Detected"}),(0,f.jsxs)("p",{className:"text-amber-100 text-sm mt-1",children:[y," item",1!==y?"s":""," found without assigned contacts"]})]})]}),(0,f.jsx)("button",{onClick:t,className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-6 w-6"})})]})}),(0,f.jsxs)("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-180px)]",children:[(0,f.jsx)("div",{className:"mb-6 bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,f.jsxs)("p",{className:"text-yellow-800 text-sm",children:[(0,f.jsx)("strong",{children:"Action Required:"})," The following items were created without proper contact assignment. Please assign them to existing contacts to maintain data integrity. This modal will reappear on your next login until all items are assigned."]})}),s.proposals.length>0&&(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsxs)("h3",{className:"text-lg font-bold text-gray-900 mb-3 flex items-center",children:[(0,f.jsx)(kt.A,{className:"h-5 w-5 mr-2 text-purple-600"}),"Proposals (",s.proposals.length,")"]}),(0,f.jsx)("div",{className:"space-y-2",children:s.proposals.map(e=>(0,f.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"font-semibold text-gray-900",children:e.project_name}),(0,f.jsxs)("p",{className:"text-sm text-gray-600",children:[e.client_company," - ",e.contact_name]}),(0,f.jsxs)("p",{className:"text-xs text-gray-500",children:["Created: ",k(e.created_at)]})]}),(0,f.jsx)("button",{onClick:()=>A(e,"proposal"),className:"px-4 py-2 bg-purple-600 hover:bg-purple-700 text-white rounded-lg text-sm font-medium",children:"Assign Contact"})]},e.id))})]}),s.invoices.length>0&&(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsxs)("h3",{className:"text-lg font-bold text-gray-900 mb-3 flex items-center",children:[(0,f.jsx)(At.A,{className:"h-5 w-5 mr-2 text-green-600"}),"Invoices (",s.invoices.length,")"]}),(0,f.jsx)("div",{className:"space-y-2",children:s.invoices.map(e=>(0,f.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsxs)("p",{className:"font-semibold text-gray-900",children:["Invoice #",e.invoice_number]}),(0,f.jsx)("p",{className:"text-sm text-gray-600",children:e.project_name}),(0,f.jsxs)("p",{className:"text-sm text-gray-600",children:[e.client_company," - ",e.contact_name]}),(0,f.jsxs)("p",{className:"text-xs text-gray-500",children:["Created: ",k(e.created_at)]})]}),(0,f.jsx)("button",{onClick:()=>A(e,"invoice"),className:"px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium",children:"Assign Contact"})]},e.id))})]}),s.corporate_events.length>0&&(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsxs)("h3",{className:"text-lg font-bold text-gray-900 mb-3 flex items-center",children:[(0,f.jsx)(_t.A,{className:"h-5 w-5 mr-2 text-blue-600"}),"Corporate Events (",s.corporate_events.length,")"]}),(0,f.jsx)("div",{className:"space-y-2",children:s.corporate_events.map(e=>(0,f.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"font-semibold text-gray-900",children:e.event_name}),(0,f.jsxs)("p",{className:"text-sm text-gray-600",children:[e.client_company," - ",e.primary_contact]}),(0,f.jsxs)("p",{className:"text-xs text-gray-500",children:["Event Date: ",k(e.event_date)]}),(0,f.jsxs)("p",{className:"text-xs text-gray-500",children:["Created: ",k(e.created_at)]})]}),(0,f.jsx)("button",{onClick:()=>A(e,"corporate_event"),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium",children:"Assign Contact"})]},e.id))})]})]}),(0,f.jsxs)("div",{className:"bg-gray-50 p-4 border-t flex items-center justify-between",children:[(0,f.jsxs)("p",{className:"text-sm text-gray-600",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 inline mr-1 text-green-600"}),"Assigned items will be removed from this list"]}),(0,f.jsx)("button",{onClick:t,className:"px-6 py-2 bg-gray-600 hover:bg-gray-700 text-white rounded-lg font-medium",children:"Close (Will Reappear Next Login)"})]})]})}),x&&c&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-[60] p-4",children:(0,f.jsxs)("div",{className:"bg-gradient-to-br from-gray-900 to-gray-800 rounded-2xl shadow-2xl w-full max-w-2xl border-2 border-gray-700",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-gray-700",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-2xl font-bold text-white",children:"Assign Contact"}),(0,f.jsxs)("p",{className:"text-gray-400 text-sm mt-1",children:["proposal"===c.type&&"Proposal: ".concat(c.project_name),"invoice"===c.type&&"Invoice: #".concat(c.invoice_number),"corporate_event"===c.type&&"Event: ".concat(c.event_name)]})]}),(0,f.jsx)("button",{onClick:()=>{h(!1),d(null),l("")},className:"p-2 hover:bg-gray-700 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-6 w-6 text-gray-400"})})]}),(0,f.jsx)("div",{className:"p-6",children:(0,f.jsx)(_n,{contacts:r,selectedContactId:o,onContactSelect:e=>l(e.id),label:"Select Contact to Assign",variant:"dark"})}),(0,f.jsxs)("div",{className:"flex items-center justify-end space-x-4 p-6 border-t border-gray-700 bg-gray-900/50",children:[(0,f.jsx)("button",{onClick:()=>{h(!1),d(null),l("")},className:"px-6 py-2 border-2 border-gray-600 text-gray-300 rounded-lg hover:bg-gray-700 font-medium transition-colors",children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>
1{if(o&&c)try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/orphaned-items/assign-bulk"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({contact_id:o,item_type:c.type,item_id:c.id})});if(s.ok)alert("Contact assigned successfully!"),h(!1),d(null),l(""),w();else{const e=await s.json();alert("Failed to assign contact: ".concat(e.detail||"Unknown error"))}}catch(t){console.error("Error assigning contact:",t),alert("Error assigning contact")}else alert("Please select a contact")},disabled:!o,className:"px-6 py-2 bg-gradient-to-r from-amber-600 to-orange-600 hover:from-amber-700 hover:to-orange-700 text-white rounded-lg font-bold shadow-lg transition-all transform hover:scale-105 disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none",children:"Assign Contact"})]})]})})]})};var Fn=s(84669),En=s(70764),Tn=s(26533),zn=s(94615),Bn=s(51884),Dn=s(84991),In=s(76833);const Rn={photographer:"Photographer",second_photographer:"Second Photographer",videographer:"Videographer",second_videographer:"Second Videographer",voxpop_videographer:"VoxPop Videographer",editor:"Editor",remote_editor:"Remote Editor",producer:"Producer",assistant:"Assistant",coordinator:"Coordinator"};function Pn(e){if(!e)return"";const t=Rn[e];return t||String(e).replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}const Wn=["videographer","second_videographer","voxpop_videographer","producer"],On=["photographer","second_photographer","producer"];function Ln(e){return!!e&&Wn.includes(e.toLowerCase())}function Mn(e){return!!e&&On.includes(e.toLowerCase())}const qn="'Space Mono',monospace",Hn="'Hanken Grotesk',sans-serif",Un={"Lead Coordinator":["#EEF2FF","#4338CA"],"Event Manager":["#EEF2FF","#4338CA"],Billing:["#FEF3C7","#92400E"],"On-site Contact":["#ECFEFF","#0E7490"],Photographer:["#FEF3C7","#92400E"],Videographer:["#EEF2FF","#4338CA"],Coordinator:["#ECFEFF","#0E7490"],"Lead Photographer":["#FEE2E2","#991B1B"],Assistant:["#EFEFF2","#55555C"]},Gn=e=>Un[e]||["#EFEFF2","#55555C"],Vn=["linear-gradient(135deg,#BF212F,#8E1822)","linear-gradient(135deg,#4338CA,#6366F1)","linear-gradient(135deg,#0E7490,#0FA3A3)","linear-gradient(135deg,#B45309,#F2A900)","linear-gradient(135deg,#16A34A,#22C55E)"],Jn=e=>String(e).padStart(2,"0"),Yn=e=>{let{icon:t,color:s,children:a,count:n}=e;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[(0,f.jsx)(t,{size:15,color:s,strokeWidth:2}),(0,f.jsx)("span",{style:{fontFamily:qn,fontSize:10.5,fontWeight:700,letterSpacing:".16em",color:"#55555C"},children:a}),null!=n&&(0,f.jsx)("span",{style:{fontFamily:qn,fontSize:10,fontWeight:700,color:"#55555C",background:"#EFEFF2",borderRadius:20,padding:"2px 9px"},children:n})]})},Kn={email_crew:{title:"Email to crew",bg:"#FEF3C7",fg:"#B45309"},email_client:{title:"Email to client",bg:"#EEF2FF",fg:"#4338CA"},sms_crew:{title:"SMS to crew",bg:"#ECFEFF",fg:"#0E7490"}};function Zn(e){let{entry:t}=e;const[s,n]=(0,a.useState)(!1),r=Kn[t.type]||Kn.email_crew,i="sms_crew"===t.type?Fn.A:T.A,o=t.sent_at?new Date(t.sent_at):null,l=o?o.toLocaleString("en-AU",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit",hour12:!1}):"\u2014",c=t.sent_count||0,d=t.failed_count||0,m=c+d,p=0===d&&c>0,h=(t.recipients||[]).length?"".concat(c," of ").concat(m," recipient").concat(1===m?"":"s"):"".concat(c," sent");return(0,f.jsxs)("div",{style:{border:"1px solid #E4E4E9",borderRadius:10,overflow:"hidden"},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),style:{width:"100%",textAlign:"left",display:"flex",alignItems:"center",gap:12,padding:"11px 14px",background:"none",border:0,cursor:"pointer"},children:[(0,f.jsx)("div",{style:{width:30,height:30,borderRadius:8,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:r.bg,color:r.fg},children:(0,f.jsx)(i,{size:15})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontWeight:600,fontSize:13,color:"#0A0A0B"},children:r.title}),(0,f.jsxs)("div",{style:{fontSize:12,color:"#9A9AA0",marginTop:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[h," \xb7 by ",t.sent_by||"admin"]})]}),(0,f.jsxs)("div",{style:{textAlign:"right",flexShrink:0},children:[(0,f.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:qn,fontSize:9.5,fontWeight:700,letterSpacing:".05em",padding:"3px 8px",borderRadius:5,background:p?"#DCFCE7":"#FEE2E2",color:p?"#16A34A":"#DC2626"},children:p?"SENT":"FAILED"}),(0,f.jsx)("div",{style:{fontFamily:qn,fontSize:10.5,color:"#B5B5BC",marginTop:5},children:l})]}),(0,f.jsx)(rs.A,{size:15,color:"#C9C9D0",style:{flexShrink:0,transform:s?"rotate(90deg)":"none",transition:"transform .15s"}})]}),s&&(0,f.jsxs)("div",{style:{borderTop:"1px solid #F2F2F5",background:"#FBFBFC",padding:"11px 14px"},children:[t.subject&&(0,f.jsxs)("div",{style:{fontSize:12,marginBottom:6},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Subject: "}),(0,f.jsx)("span",{style:{color:"#333"},children:t.subject})]}
1),(t.recipients||[]).length>0?(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:5},children:t.recipients.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:7,fontSize:12},children:[e.success?(0,f.jsx)(In.A,{size:14,color:"#16A34A",style:{marginTop:1,flexShrink:0}}):(0,f.jsx)(x.A,{size:14,color:"#DC2626",style:{marginTop:1,flexShrink:0}}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsxs)("div",{style:{color:"#0A0A0B"},children:[e.name||e.address,e.name&&e.address&&e.name!==e.address&&(0,f.jsxs)("span",{style:{color:"#9A9AA0"},children:[" \xb7 ",e.address]})]}),!e.success&&e.error&&(0,f.jsx)("div",{style:{color:"#DC2626",fontSize:11,marginTop:1},children:e.error})]})]},t))}):(0,f.jsx)("p",{style:{fontSize:12,color:"#9A9AA0"},children:"No recipient details recorded."})]})]})}function $n(e){let{entries:t}=e;const s=[...t||[]].sort((e,t)=>(t.sent_at?new Date(t.sent_at).getTime():0)-(e.sent_at?new Date(e.sent_at).getTime():0));return(0,f.jsxs)("section",{children:[(0,f.jsx)(Yn,{icon:Fn.A,color:"#C084FC",count:s.length>0?s.length:void 0,children:"NOTIFICATION HISTORY"}),0===s.length?(0,f.jsxs)("div",{style:{border:"1px dashed #D8D8DE",borderRadius:12,padding:22,textAlign:"center",background:"#FBFBFC"},children:[(0,f.jsx)("div",{style:{fontWeight:600,fontSize:13.5,color:"#55555C"},children:"No messages sent yet"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:"#9A9AA0",marginTop:4},children:"Dispatch crew or client notifications from the actions below."})]}):(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:s.map((e,t)=>(0,f.jsx)(Zn,{entry:e},e.id||t))})]})}const Qn=e=>{let{event:t,onClose:s,onChanged:n}=e;const i=(0,r.Zp)(),{toast:o}=N(),[l,c]=(0,a.useState)(t),[d,m]=(0,a.useState)(null),[p,x]=(0,a.useState)(!1),[h,u]=(0,a.useState)([]),[b,y]=(0,a.useState)(""),[v,j]=(0,a.useState)(null),[w,A]=(0,a.useState)([]),[k,S]=(0,a.useState)(!1),[F,E]=(0,a.useState)(!1),[z,B]=(0,a.useState)(null),[D,R]=(0,a.useState)([]),[P,W]=(0,a.useState)("");(0,a.useEffect)(()=>{O(null===t||void 0===t?void 0:t.id)},[null===t||void 0===t?void 0:t.id]);const O=async e=>{if(e)try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(e),{headers:{Authorization:"Bearer ".concat(s)}});if(!a.ok)return;const n=await a.json(),r=null===n||void 0===n?void 0:n.event;r&&c(e=>e&&e.id===r.id?r:e)}catch(s){console.error("Failed to refresh event:",s)}},L=e=>{if(!e)return"-";try{return new Date(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric"})}catch(t){return e}},M=e=>"single"===e.event_duration_type||e.event_date?e.event_date:e.event_days&&e.event_days.length>0?e.event_days[0].date:null,q=(e,t)=>"".concat(e||"TBA").concat(t?" \u2013 ".concat(t):""),H=e=>u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),U=()=>{null!==d&&void 0!==d&&d.contacts?u(d.contacts.map(e=>e.id)):null!==d&&void 0!==d&&d.crew&&u(d.crew.map(e=>e.email))},G=()=>u([]),V=()=>{j(null),A([])},J=e=>{B(e),(async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();e.success&&R(e.clients||[])}}catch(t){console.error("Error loading contacts:",t)}})(),E(!0)};if(!l)return null;const Y="multi"===l.event_duration_type&&l.event_days&&l.event_days.length>0,K=Y?{label:"MULTI-DAY \xb7 ".concat(l.event_days.length," DAYS"),bg:"#EEF2FF",fg:"#4338CA"}:{label:"SINGLE-DAY",bg:"#ECFEFF",fg:"#0E7490"},Z=l.client_contacts||[],$=Z.length>0,Q=$?Z.length:1,X=l.crew_members||[],ee=l.timed_events||[];return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{onClick:()=>null===s||void 0===s?void 0:s(),style:{position:"fixed",inset:0,background:"rgba(10,10,11,.5)",backdropFilter:"blur(2px)",WebkitBackdropFilter:"blur(2px)",zIndex:90,display:"flex",alignItems:"flex-start",justifyContent:"center",padding:"48px 20px",overflow:"auto"},children:(0,f.jsxs)("div",{className:"tg-runsheet-modal tg-scroll",onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:720,maxHeight:"calc(100vh - 96px)",background:"#fff",borderRadius:14,boxShadow:"0 30px 80px rgba(0,0,0,.45)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,f.jsxs)("div",{style:{flexShrink:0,background:"#0A0A0B",color:"#fff",padding:"22px 26p
1x",display:"flex",alignItems:"flex-start",gap:16,position:"relative",overflow:"hidden"},children:[(0,f.jsx)("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:4,background:"#BF212F"}}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:9},children:[(0,f.jsx)("span",{style:{fontFamily:qn,fontSize:9.5,fontWeight:700,letterSpacing:".2em",color:"#F2A900"},children:"EVENT RUNSHEET"}),(0,f.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontFamily:qn,fontSize:10,fontWeight:700,letterSpacing:".06em",padding:"3px 9px",borderRadius:6,background:K.bg,color:K.fg},children:K.label})]}),(0,f.jsx)("div",{className:"tg-display",style:{fontWeight:800,fontSize:23,lineHeight:1.12,letterSpacing:"-.015em"},children:l.event_name}),(0,f.jsxs)("div",{style:{marginTop:7,display:"flex",alignItems:"center",gap:8,color:"#B5B5BC",fontSize:13.5},children:[(0,f.jsx)(gs.A,{size:14,color:"#7A7A82"}),(0,f.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.client_company})]})]}),(0,f.jsx)("button",{onClick:()=>null===s||void 0===s?void 0:s(),className:"tg-x","aria-label":"Close",style:{flexShrink:0,width:34,height:34,borderRadius:9,border:0,background:"rgba(255,255,255,.08)",color:"#C4C4CB",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(g.A,{size:17})})]}),(0,f.jsxs)("div",{className:"tg-scroll",style:{flex:1,overflowY:"auto",padding:"24px 26px 26px",display:"flex",flexDirection:"column",gap:22,background:"#fff"},children:[(0,f.jsxs)("section",{children:[(0,f.jsx)(Yn,{icon:ks.A,color:"#818CF8",children:"EVENT DETAILS"}),(0,f.jsxs)("div",{style:{border:"1px solid #E4E4E9",borderRadius:12,overflow:"hidden"},children:[Y?l.event_days.map((e,t)=>{const s=e.date?new Date(e.date):null,a=s&&!isNaN(s)?s.toLocaleDateString("en-AU",{weekday:"short"}).toUpperCase():"",n=s&&!isNaN(s)?Jn(s.getDate()):"\u2014";return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"13px 16px",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsxs)("div",{style:{flexShrink:0,width:46,textAlign:"center"},children:[(0,f.jsx)("div",{style:{fontFamily:qn,fontSize:9,fontWeight:700,letterSpacing:".12em",color:"#9A9AA0"},children:a}),(0,f.jsx)("div",{className:"tg-display",style:{fontWeight:800,fontSize:20,lineHeight:1,color:"#0A0A0B",marginTop:3},children:n})]}),(0,f.jsx)("div",{style:{width:1,alignSelf:"stretch",background:"#EDEDF0"}}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontWeight:600,fontSize:14,color:"#0A0A0B"},children:e.day_label||"Day ".concat(t+1)}),(0,f.jsx)("div",{style:{fontFamily:qn,fontSize:11.5,color:"#55555C",marginTop:3},children:L(e.date)})]}),(e.start_time||e.end_time)&&(0,f.jsx)("div",{style:{fontFamily:qn,fontSize:12.5,fontWeight:700,color:"#0A0A0B",background:"#F4F4F7",borderRadius:7,padding:"6px 11px",whiteSpace:"nowrap"},children:q(e.start_time,e.end_time)})]},t)}):(0,f.jsxs)("div",{className:"tg-runsheet-grid2",style:{display:"grid",gridTemplateColumns:"1fr 1fr"},children:[(0,f.jsxs)("div",{style:{padding:"14px 16px",borderRight:"1px solid #F2F2F5",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsx)("div",{style:{fontFamily:qn,fontSize:9,fontWeight:700,letterSpacing:".14em",color:"#9A9AA0",marginBottom:6},children:"DATE"}),(0,f.jsx)("div",{style:{fontWeight:600,fontSize:14},children:(e=>{if(!e)return"TBA";try{return new Date(e).toLocaleDateString("en-AU",{weekday:"long",day:"numeric",month:"long",year:"numeric"})}catch(t){return e}})(M(l))})]}),(0,f.jsxs)("div",{style:{padding:"14px 16px",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsx)("div",{style:{fontFamily:qn,fontSize:9,fontWeight:700,letterSpacing:".14em",color:"#9A9AA0",marginBottom:6},children:"TIME"}),(0,f.jsx)("div",{style:{fontFamily:qn,fontWeight:700,fontSize:13.5},children:q(l.start_time,l.end_time)})]})]}),(0,f.jsxs)("div",{style:{padding:"14px 16px",display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)(C.A,{size:15,color:"#BF212F",strokeWidth:2}),(0,f.jsxs)("div",{style:{flex:1},children:[(0,f.jsx)("div",{style:{fontFamily:qn,fontSize:9,fontWeight:700,letterSpacing:".14em",color:"#9A9AA0",marginBottom:3},children:"VENUE"}),(0,f.jsx)("div",{style:{fontWeight:600,fontSize:14},children:l.venue||"TBC"})]})]})]})]}),(0,f.jsxs)("section",{children:[(0,f.jsx)(Yn,{icon:Xe.A,color:"#4ADE80",count:Q,children:"CLIENT CONTACT".concat(1===Q?"":"S")}),$?(0,f.jsx)("div",{className:"tg-runsheet-grid2",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:Z.map((e,t)=>{const[s,a]=Gn(e.role);return(0,f.jsxs)("div",{style:{border:"1px solid ".concat(e.is_primary?"#F3C9CC":"#E4E4E9"),background:e.is_primary?"#FFF7F7":"#fff",borderRadius:11,padding:14,position:"relative"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)("div",{style:{width:36,height:36,borderRadius:9,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:13,color:"#fff",background:e.is_primary?Vn[0]:Vn[t%4+1]},children:Ms(e.name)}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontWeight:700,fontSize:14,color:"#0A0A0B",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),e.role&&(0,f.jsx)("span",{style:{display:"inline-block",marginTop:3,fontFamily:qn,fontSize:9.5,fontWeight:700,letterSpacing:".06em",padding:"2px 7px",borderRadius:5,background:s,color:a},children:e.role})]})]}),e.email&&(0,f.jsxs)("a",{href:"mailto:".concat(e.email),style:{display:"flex",alignItems:"center",gap:7,marginTop:11,color:"#55555C",fontSize:12.5,textDecoration:"none",fontFamily:qn,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(0,f.jsx)(T.A,{size:13,color:"#9A9AA0"}),e.email]}),e.is_primary&&(0,f.jsx)("span",{style:{position:"absolute",top:12,right:12,fontFamily:qn,fontSize:8.5,fontWeight:700,letterSpacing:".1em",padding:"3px 7px",borderRadius:5,background:"#BF212F",color:"#fff"},children:"PRIMARY"})]},e.id||t)})}):(0,f.jsxs)("div",{style:{border:"1px solid #E4E4E9",borderRadius:11,padding:16},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11,marginBottom:12},children:[(0,f.jsx)("div",{style:{width:38,height:38,borderRadius:9,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:14,color:"#fff",background:"linear-gradient(135deg,#55555C,#2A2A2E)"},children:Ms(l.primary_contact||l.client_company)}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontWeight:700,fontSize:14.5},children:l.primary_contact||"\u2014"}),(0,f.jsx)("div",{style:{fontFamily:qn,fontSize:9.5,fontWeight:700,letterSpacing:".08em",color:"#9A9AA0",marginTop:2},children:"PRIMARY CONTACT"})]})]}),(0,f.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px 22px"},children:[l.email&&(0,f.jsxs)("a",{href:"mailto:".concat(l.email),style:{display:"flex",alignItems:"center",gap:7,color:"#55555C",fontSize:12.5,textDecoration:"none",fontFamily:qn},children:[(0,f.jsx)(T.A,{size:13,color:"#9A9AA0"}),l.email]}),l.mobile&&(0,f.jsxs)("a",{href:"tel:".concat(l.mobile),style:{display:"flex",alignItems:"center",gap:7,color:"#55555C",fontSize:12.5,textDecoration:"none",fontFamily:qn},children:[(0,f.jsx)(Wa.A,{size:13,color:"#9A9AA0"}),l.mobile]})]})]})]}),(0,f.jsxs)("section",{children:[(0,f.jsx)(Yn,{icon:Xe.A,color:"#FBBF24",count:X.length>0?X.length:void 0,children:"CREW MEMBERS"}),X.length>0?(0,f.jsx)("div",{style:{border:"1px solid #E4E4E9",borderRadius:12,overflow:"hidden"},children:X.map((e,t)=>{const s=Pn(e.role)||"",[a,n]=Gn(s);return(0,f.jsxs)("div",{className:"tg-row",style:{display:"flex",alignItems:"center",gap:14,padding:"12px 16px",borderBottom:t===X.length-1?"none":"1px solid #F2F2F5"},children:[(0,f.jsx)("div",{style:{width:32,height:32,borderRadius:8,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:12,color:"#fff",background:Vn[t%Vn.length]},children:Ms(e.name)}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontWeight:600,fontSize:13.5,color:"#0A0A0B"},children:e.name}),s&&(0,f.jsx)("span",{style:{display:"inline-block",marginTop:2,fontFamily:qn,fontSize:9,fontWeight:700,letterSpacing:".07em",padding:"2px 7px",borderRadius:5,background:a,color:n},children:s})]}),(0,f.jsx)("div",{style:{fontFamily:qn,fontSize:12,color:"#55555C",whiteSpace:"nowrap"},children:e.mobile||e.email||"\u2014"})]},t)})}):(0,f.jsxs)("div",{style:{border:"1px dashed #D8D8DE",borderRadius:12,padding:22,textAlign:"center",background:"#FBFBFC"},children:[(0,f.jsx)("div",{style:{fontWeight:600,fontSize:13.5,color:"#55555C"},children:"No crew assigned yet"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:"#9A9AA0",marginTop:4},children:"Assign photographers, videographers or coordinators from the runsheet."})]})]}),ee.length>0&&(0,f.jsxs)("section",{children:[(0,f.jsx)(Yn,{icon:Nt.A,color:"#38BDF8",count:ee.length,children:"SCHEDULE"}),(0,f.jsx)("div",{style:{position:"relative",paddingLeft:8},children:ee.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",gap:16,padding:"0 0 4px"},children:[(0,f.jsx)("div",{style:{flexShrink:0,width:74,textAlign:"right",fontFamily:qn,fontWeight:700,fontSize:13,color:"#BF212F",paddingTop:1},children:e.time}),(0,f.jsxs)("div",{style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",flexShrink:0},children:[(0,f.jsx)("div",{style:{width:11,height:11,borderRadius:"50%",background:"#fff",border:"2.5px solid #BF212F",marginTop:3,zIndex:1}}),(0,f.jsx)("div",{style:{width:2,flex:1,background:"#EDEDF0",margin:"2px 0",visibility:t===ee.length-1?"hidden":"visible"}})]}),(0,f.jsx)("div",{style:{flex:1,minWidth:0,paddingBottom:16},children:(0,f.jsx)("div",{style:{fontWeight:600,fontSize:14,color:"#1A1A1D",lineHeight:1.4},children:e.description})})]},t))})]}),(0,f.jsx)($n,{entries:l.notification_log||[]})]}),(0,f.jsxs)("div",{className:"tg-runsheet-footer",style:{flexShrink:0,borderTop:"1px solid #E4E4E9",background:"#fff",padding:"14px 26px",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{className:"tg-fgroup",style:{display:"flex",gap:8,flex:"1 1 auto",minWidth:0,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>(e=>{const t=(e.crew_members||[]).filter(e=>e.email);0!==t.length?(u(t.map(e=>e.email)),m({type:"crew",event:e,crew:t})):o.error("No crew members with email addresses")})(l),className:"tg-fbtn tg-fprimary",style:{display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:0,borderRadius:9,padding:"11px 15px",fontFamily:Hn,fontWeight:600,fontSize:13.5,cursor:"pointer",boxShadow:"0 2px 8px rgba(191,33,47,.25)",whiteSpace:"nowrap"},children:[(0,f.jsx)(T.A,{size:15}),"Email Crew"]}),(0,f.jsxs)("button",{onClick:()=>(e=>{const t=e.client_contacts||[];0!==t.length||e.email?t.length>0?(u(t.map(e=>e.id)),m({type:"client_multi",event:e,contacts:t})):m({type:"client",event:e,message:"You are about to send an email to: ".concat(e.email," (").concat(e.primary_contact,")")}):o.error("No client contacts or email found for this event")})(l),className:"tg-fbtn tg-fsec",style:{display:"inline-flex",alignItems:"center",gap:7,background:"#fff",color:"#1A1A1D",border:"1px solid #D8D8DE",borderRadius:9,padding:"11px 15px",fontFamily:Hn,fontWeight:600,fontSize:13.5,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,f.jsx)(T.A,{size:15}),"Email Client"]}),(0,f.jsxs)("button",{onClick:()=>(e=>{const t=(e.crew_members||[]).filter(e=>e.mobile);0!==t.length?(A(t.map(e=>e.id)),j({event:e,crew:t})):o.error("No crew members with mobile numbers found for this event")})(l),className:"tg-fbtn tg-fsec",style:{display:"inline-flex",alignItems:"center",gap:7,background:"#fff",color:"#1A1A1D",border:"1px solid #D8D8DE",borderRadius:9,padding:"11px 15px",fontFamily:Hn,fontWeight:600,fontSize:13.5,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,f.jsx)(Fn.A,{size:15}),"SMS Crew"]}),(0,f.jsxs)("button",{onClick:()=>{return e=l,window.open("/corporate-runsheet/".concat(e.id,"?view=client"),"_blank");var e},className:"tg-fbtn tg-fsec",style:{display:"inline-flex",alignItems:"center",gap:7,background:"#fff",color:"#1A1A1D",border:"1px solid #D8D8DE",borderRadius:9,padding:"11px 15px",fontFamily:Hn,fontWeight:600,fontSize:13.5,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,f.jsx)(_.A,{size:15}),"Client View"]}),(0,f.jsxs)("button",{onClick:()=>{return e=l,window.open("/corporate-runsheet/".concat(e.id),"_blank");var e},className:"tg-fbtn tg-fsec",style:{display:"inline-flex",alignItems:"center",gap:7,background:"#fff",color:"#1A1A1D",border:"1px solid #D8D8DE",borderRadius:9,padding:"11px 15px",fontFamily:Hn,fontWeight:600,fontSize:13.5,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,f.jsx)(En.A,{size:15}),"Crew View"]}
1)]}),(0,f.jsx)("div",{className:"tg-ficons",style:{display:"flex",gap:6,flexShrink:0,marginLeft:"auto"},children:[{title:"Edit runsheet",icon:Tn.A,onClick:()=>i("/admin/corporate/edit/".concat(l.id))},{title:"Add to calendar",icon:zn.A,onClick:()=>window.open((e=>{const t=M(e),s=(e,t)=>{if(!e)return null;const s=new Date(e);if(isNaN(s))return null;if(t&&/^\d{1,2}:\d{2}/.test(t)){const[e,a]=t.split(":");return s.setHours(+e,+a,0,0),"".concat(s.getFullYear()).concat(Jn(s.getMonth()+1)).concat(Jn(s.getDate()),"T").concat(Jn(s.getHours())).concat(Jn(s.getMinutes()),"00")}return"".concat(s.getFullYear()).concat(Jn(s.getMonth()+1)).concat(Jn(s.getDate()))},a=s(t,e.start_time);let n=s(t,e.end_time);if(a&&!n)if(a.includes("T")){const s=new Date(t),[a,r]=(e.start_time||"0:0").split(":");s.setHours(+a+2,+r,0,0),n="".concat(s.getFullYear()).concat(Jn(s.getMonth()+1)).concat(Jn(s.getDate()),"T").concat(Jn(s.getHours())).concat(Jn(s.getMinutes()),"00")}else{const e=new Date(t);e.setDate(e.getDate()+1),n="".concat(e.getFullYear()).concat(Jn(e.getMonth()+1)).concat(Jn(e.getDate()))}const r=a&&n?"".concat(a,"/").concat(n):"",i=new URLSearchParams({action:"TEMPLATE",text:e.event_name||"Event",location:e.venue||"",details:"Turbo 360 runsheet: ".concat(window.location.origin,"/corporate-runsheet/").concat(e.id)});return"https://calendar.google.com/calendar/render?".concat(i.toString()).concat(r?"&dates=".concat(r):"")})(l),"_blank")},{title:"Assign contact",icon:Bn.A,onClick:()=>J(l)}].map(e=>(0,f.jsx)("button",{onClick:e.onClick,title:e.title,className:"tg-fbtn tg-fsec",style:{width:40,height:40,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"#fff",color:"#55555C",border:"1px solid #D8D8DE",borderRadius:9,cursor:"pointer"},children:(0,f.jsx)(e.icon,{size:16})},e.title))})]})]})}),d&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-[100] p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl max-w-md w-full overflow-hidden",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-blue-600 to-blue-700 px-6 py-4 flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:["crew"===d.type?(0,f.jsx)(st.A,{className:"h-6 w-6 text-white"}):(0,f.jsx)(T.A,{className:"h-6 w-6 text-white"}),(0,f.jsxs)("h3",{className:"text-xl font-bold text-white",children:["Email ","crew"===d.type?"Crew":"Client Runsheet"]})]}),(0,f.jsx)("button",{onClick:()=>{m(null),u([]),y("")},className:"p-1 hover:bg-white/20 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-5 w-5 text-white"})})]}),(0,f.jsxs)("div",{className:"p-6",children:["client_multi"===d.type&&d.contacts?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"text-slate-600 mb-4",children:"Select contacts to receive the runsheet email:"}),(0,f.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,f.jsx)("button",{onClick:U,className:"px-3 py-1.5 text-sm bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg transition-colors",children:"Select All"}),(0,f.jsx)("button",{onClick:G,className:"px-3 py-1.5 text-sm bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg transition-colors",children:"Deselect All"})]}),(0,f.jsx)("div",{className:"space-y-2 max-h-64 overflow-y-auto mb-4",children:d.contacts.map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 rounded-lg border-2 cursor-pointer transition-colors ".concat(h.includes(e.id)?"bg-blue-50 border-blue-300":"bg-slate-50 border-slate-200 hover:border-blue-200"),children:[(0,f.jsx)("button",{type:"button",onClick:()=>H(e.id),className:"flex-shrink-0",children:h.includes(e.id)?(0,f.jsx)(us.A,{className:"h-5 w-5 text-blue-600"}):(0,f.jsx)(Dn.A,{className:"h-5 w-5 text-slate-400"})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("span",{className:"font-medium text-slate-900",children:e.name}),e.role&&(0,f.jsx)("span",{className:"text-xs bg-slate-200 text-slate-600 px-2 py-0.5 rounded-full",children:e.role})]}),(0,f.jsx)("p",{className:"text-sm text-slate-500 truncate",children:e.email})]})]},e.id))})]}):"crew"===d.type&&d.crew?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"text-slate-600 mb-4",children:"Select crew members to receive the runsheet email:"}),(0,f.jsxs)("div",{className:"flex gap-2 mb-4",children:[(0,f.jsx)("button",{onClick:U,className:"px-3 py-1.5 text-sm bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg transition-colors",children:"Select All"}),(0,f.jsx)("button",{onClick:G,className:"px-3 py-1.5 text-sm bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg transition-colors",children:"Deselect All"})]}),(0,f.jsx)("div",{className:"space-y-2 max-h-64 overflow-y-auto mb-4",children:d.crew.map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 rounded-lg border-2 cursor-pointer transition-colors ".concat(h.includes(e.email)?"bg-emerald-50 border-emerald-300":"bg-slate-50 border-slate-200 hover:border-emerald-200"),children:[(0,f.jsx)("button",{type:"button",onClick:()=>H(e.email),className:"flex-shrink-0",children:h.includes(e.email)?(0,f.jsx)(us.A,{className:"h-5 w-5 text-emerald-600"}):(0,f.jsx)(Dn.A,{className:"h-5 w-5 text-slate-400"})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("span",{className:"font-medium text-slate-900",children:e.name||e.email}),e.role&&(0,f.jsx)("span",{className:"text-xs bg-slate-200 text-slate-600 px-2 py-0.5 rounded-full",children:e.role})]}),(0,f.jsx)("p",{className:"text-sm text-slate-500 truncate",children:e.email})]})]},e.email))})]}):(0,f.jsx)("p",{className:"text-slate-600 mb-6",children:d.message}),"crew"===d.type&&(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-1.5",children:["Message to Crew ",(0,f.jsx)("span",{className:"text-slate-400 font-normal",children:"(optional)"})]}),(0,f.jsx)("textarea",{value:b,onChange:e=>y(e.target.value),placeholder:"Add any special instructions or notes for the crew...",rows:3,className:"w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 resize-none"})]}),(0,f.jsxs)("div",{className:"flex gap-3",children:[(0,f.jsx)("button",{onClick:()=>{m(null),u([]),y("")},disabled:p,className:"flex-1 px-4 py-2.5 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg font-medium transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>
1{if(d)if("client_multi"!==d.type||0!==h.length)if("crew"!==d.type||0!==h.length){x(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s="crew"===d.type,a=s?"/api/corporate-admin/email-crew/".concat(d.event.id):"/api/corporate-admin/email-client/".concat(d.event.id),r={method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}};if("client_multi"===d.type&&(r.body=JSON.stringify({contact_ids:h})),s){const e={crew_emails:h};b.trim()&&(e.message=b.trim()),r.body=JSON.stringify(e)}const i=await fetch("".concat(I.fn).concat(a),r),l=await i.json();if(l.success){const e=s?"crew":"client",t=l.sent_count||1;o.success("Email sent to ".concat(t," ").concat(e).concat(t>1?"s":"")),await O(d.event.id),null===n||void 0===n||n()}else o.error("Failed to send email: ".concat(l.message||"Unknown error"))}catch(t){console.error("Email error:",t),o.error("Failed to send email")}finally{x(!1),m(null),u([]),y("")}}else o.error("Please select at least one crew member");else o.error("Please select at least one contact")},disabled:p||("client_multi"===d.type||"crew"===d.type)&&0===h.length,className:"flex-1 px-4 py-2.5 ".concat("crew"===d.type?"bg-emerald-600 hover:bg-emerald-700":"bg-blue-600 hover:bg-blue-700"," text-white rounded-lg font-medium transition-colors disabled:opacity-50 flex items-center justify-center gap-2"),children:p?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-white border-t-transparent"}),(0,f.jsx)("span",{children:"Sending..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"client_multi"===d.type?"Send to ".concat(h.length," Contact").concat(1!==h.length?"s":""):"crew"===d.type?"Send to ".concat(h.length," Crew"):"Send Email"})]})})]})]})]})}),v&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-[100] p-2 sm:p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl max-w-md w-full overflow-hidden",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-purple-600 to-purple-700 px-4 py-3 sm:px-6 sm:py-4 flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)(Wa.A,{className:"h-5 w-5 sm:h-6 sm:w-6 text-white"}),(0,f.jsx)("h3",{className:"text-base sm:text-xl font-bold text-white",children:"SMS Crew"})]}),(0,f.jsx)("button",{onClick:V,className:"p-1 hover:bg-white/20 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-5 w-5 text-white"})})]}),(0,f.jsxs)("div",{className:"p-4 sm:p-6",children:[(0,f.jsx)("p",{className:"text-slate-600 mb-3 text-sm",children:"Select which crew members get the SMS:"}),(0,f.jsxs)("div",{className:"flex gap-2 mb-3",children:[(0,f.jsx)("button",{type:"button",onClick:()=>{null!==v&&void 0!==v&&v.crew&&A(v.crew.map(e=>e.id))},className:"px-3 py-1.5 text-xs bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg transition-colors",children:"Select All"}),(0,f.jsx)("button",{type:"button",onClick:()=>A([]),className:"px-3 py-1.5 text-xs bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg transition-colors",children:"Deselect All"})]}),(0,f.jsx)("div",{className:"space-y-2 max-h-64 overflow-y-auto mb-4",children:v.crew.map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 rounded-lg border-2 cursor-pointer transition-colors ".concat(w.includes(e.id)?"bg-purple-50 border-purple-300":"bg-slate-50 border-slate-200 hover:border-purple-200"),children:[(0,f.jsx)("button",{type:"button",onClick:()=>{return t=e.id,A(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t]);var t},className:"flex-shrink-0",children:w.includes(e.id)?(0,f.jsx)(us.A,{className:"h-5 w-5 text-purple-600"}):(0,f.jsx)(Dn.A,{className:"h-5 w-5 text-slate-400"})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,f.jsx)("span",{className:"font-medium text-slate-900 text-sm",children:e.name||"Unnamed"}),e.role&&(0,f.jsx)("span",{className:"text-[10px] sm:text-xs bg-slate-200 text-slate-600 px-2 py-0.5 rounded-full",children:Pn(e.role)})]}),(0,f.jsx)("p",{className:"text-xs text-slate-500 truncate font-mono",children:e.mobile})]})]},e.id))}),(0,f.jsx)("div",{className:"rounded-lg bg-purple-50 border border-purple-100 px-3 py-2 mb-4",children:(0,f.jsxs)("p",{className:"text-[11px] text-purple-700 leading-snug",children:["Each selected crew member will receive: ",(0,f.jsxs)("span",{className:"font-medium",children:['"Event schedule for ',v.event.event_name,' has been emailed. Please check spam if nothing in inbox. - Turbo 360"']})]})}),(0,f.jsxs)("div",{className:"flex gap-3",children:[(0,f.jsx)("button",{onClick:V,disabled:k,className:"flex-1 px-4 py-2.5 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg font-medium transition-colors disabled:opacity-50 text-sm",children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>
1{if(v)if(0!==w.length){S(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/corporate-admin/sms-crew/").concat(v.event.id),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify({crew_ids:w})}),a=await s.json();a.success?(o.success("SMS sent successfully to ".concat(a.sent_count," crew member(s)")),await O(v.event.id),null===n||void 0===n||n()):o.error("Failed to send SMS: ".concat(a.message||"Unknown error"))}catch(t){console.error("SMS error:",t),o.error("Failed to send SMS")}finally{S(!1),V()}}else o.error("Please select at least one crew member")},disabled:k||0===w.length,className:"flex-1 px-4 py-2.5 bg-purple-600 hover:bg-purple-700 text-white rounded-lg font-medium transition-colors disabled:opacity-50 text-sm inline-flex items-center justify-center gap-2",children:k?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(As.A,{className:"h-4 w-4 animate-spin"}),(0,f.jsx)("span",{children:"Sending\u2026"})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),(0,f.jsxs)("span",{children:["Send to ",w.length,1===w.length?" member":" members"]})]})})]})]})]})}),F&&z&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-[100] p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl max-w-md w-full overflow-hidden",children:[(0,f.jsx)("div",{className:"bg-gradient-to-r from-purple-600 to-purple-700 px-6 py-4",children:(0,f.jsx)("h3",{className:"text-xl font-bold text-white",children:"Assign Contact"})}),(0,f.jsxs)("div",{className:"p-6",children:[(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider mb-1",children:"Event"}),(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:z.event_name})]}),(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider mb-1",children:"Current Contact"}),(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:z.primary_contact}),(0,f.jsx)("p",{className:"text-sm text-slate-600",children:z.email})]}),(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("label",{className:"block text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2",children:"Assign to:"}),0===D.length?(0,f.jsx)("p",{className:"text-slate-600 bg-amber-50 border border-amber-200 rounded-lg p-4 text-sm",children:"No contacts found. Please add contacts in the Clients section first."}):(0,f.jsxs)("select",{value:P,onChange:e=>W(e.target.value),className:"w-full px-4 py-3 border border-slate-300 rounded-xl text-slate-900 focus:border-purple-500 focus:ring-2 focus:ring-purple-500/20 focus:outline-none",children:[(0,f.jsx)("option",{value:"",children:"-- Select a contact --"}),D.map(e=>(0,f.jsxs)("option",{value:e.id,children:[e.company_name?"".concat(e.company_name," - "):"",e.contact_name," ",e.position?"(".concat(e.position,")"):""]},e.id))]})]}),(0,f.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-xl p-4 mb-6",children:(0,f.jsxs)("p",{className:"text-sm text-blue-800",children:[(0,f.jsx)("strong",{children:"Note:"})," This will link the event to this contact for client portal access and update the event contact details."]})}),(0,f.jsxs)("div",{className:"flex gap-3",children:[(0,f.jsx)("button",{onClick:()=>{E(!1),W(""),B(null)},className:"flex-1 px-4 py-2.5 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg font-medium transition-colors",children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>{if(P)try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token;(await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(z.id,"/reassign-contact/").concat(P),{method:"PUT",headers:{Authorization:"Bearer ".concat(t)}})).ok?(o.success("Event reassigned successfully"),E(!1),W(""),B(null),await O(l.id),null===n||void 0===n||n()):o.error("Failed to reassign event")}catch(t){console.error("Error reassigning:",t),o.error("Error reassigning event")}else o.error("Please select a contact")},disabled:!P,className:"flex-1 px-4 py-2.5 bg-purple-600 hover:bg-purple-700 text-white rounded-lg font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Assign"})]})]})]})})]})},Xn="'Space Mono',monospace",er={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},tr=e=>{let{label:t,icon:s,iconBg:a,iconFg:n,dark:r,children:i,footer:o}=e;return(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},er),{},{background:r?"#0A0A0B":"#fff",border:r?"1px solid #0A0A0B":er.border,padding:20,position:"relative",overflow:"hidden"}),children:[r&&(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-22,bottom:-22,width:96,opacity:.07}}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14},children:[(0,f.jsx)("span",{style:{fontFamily:Xn,fontSize:10.5,letterSpacing:"0.16em",color:r?"#7A7A82":"#9A9AA0"},children:t}),(0,f.jsx)("span",{style:{width:30,height:30,borderRadius:8,background:a,color:n,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(s,{size:16})})]}),i,o&&(0,f.jsx)("div",{style:{marginTop:12},children:o})]})},sr=e=>{var t,s;let{event:a,last:n,onClick:r}=e;const i=a.event_date||(null===(t=a.event_days)||void 0===t||null===(s=t[0])||void 0===s?void 0:s.date),o=i?new Date(i):null,l=o&&!isNaN(o)?o.toLocaleDateString("en-AU",{month:"short"}).toUpperCase():"\u2014",c=o&&!isNaN(o)?String(o.getDate()).padStart(2,"0"):"\xb7\xb7",d=["multi","multi-day"].includes(a.event_duration_type),m=(e=>{if(!e)return null;const t=new Date;t.setHours(0,0,0,0);const s=new Date(e);return isNaN(s)?null:(s.setHours(0,0,0,0),Math.round((s-t)/864e5))})(i);let p=null;return 0===m?p={tone:"danger",text:"TODAY"}:null!=m&&m>
10&&(p={tone:m<=3?"amber":"gray",text:"".concat(m," DAY").concat(1===m?"":"S")}),(0,f.jsxs)("div",{className:"tg-row",onClick:r,style:{display:"flex",alignItems:"center",gap:16,padding:"15px 22px",borderBottom:n?"none":"1px solid #F2F2F5",cursor:"pointer",transition:"background .15s"},children:[(0,f.jsxs)("div",{style:{width:54,textAlign:"center",flexShrink:0},children:[(0,f.jsx)("div",{style:{fontFamily:Xn,fontWeight:700,fontSize:11,color:"#BF212F",letterSpacing:"0.05em"},children:l}),(0,f.jsx)("div",{className:"tg-display",style:{fontWeight:800,fontSize:24,lineHeight:1},children:c})]}),(0,f.jsx)("div",{style:{width:1,alignSelf:"stretch",background:"#EDEDF0"}}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontWeight:700,fontSize:14.5,marginBottom:4,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a.event_name||"Untitled event"}),(0,f.jsxs)("div",{className:"tg-booking-meta",style:{fontSize:12.5,color:"#9A9AA0",display:"flex",gap:14,flexWrap:"wrap"},children:[a.venue&&(0,f.jsx)("span",{children:a.venue}),a.client_company&&(0,f.jsx)("span",{children:a.client_company})]})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexShrink:0},children:[(0,f.jsx)("span",{className:"tg-booking-meta",children:(0,f.jsx)(Ds,{tone:d?"indigo":"teal",children:d?"MULTI-DAY":"SINGLE"})}),null!=a.crew_count&&(0,f.jsxs)("span",{className:"tg-booking-meta",style:{fontSize:12,color:"#55555C"},children:[a.crew_count," crew"]}),p&&(0,f.jsx)(Ds,{tone:p.tone,radius:20,children:p.text})]})]})},ar=e=>{let{icon:t,bg:s,fg:a,title:n,sub:r,last:i,onClick:o}=e;return(0,f.jsxs)("button",{onClick:o,style:{width:"100%",textAlign:"left",display:"flex",alignItems:"center",gap:12,padding:"13px 20px",background:"none",border:"none",borderBottom:i?"none":"1px solid #F2F2F5",cursor:"pointer"},children:[(0,f.jsx)("span",{style:{width:34,height:34,borderRadius:9,background:s,color:a,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(t,{size:17})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600},children:n}),r&&(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0"},children:r})]}),(0,f.jsx)(rs.A,{size:16,color:"#C9C9D0"})]})},nr=e=>{let{icon:t,bg:s,fg:a,label:n,onClick:r}=e;return(0,f.jsxs)("button",{className:"tg-qa",onClick:r,style:{display:"flex",flexDirection:"column",gap:8,padding:14,border:"1px solid #E4E4E9",borderRadius:11,background:"#FBFBFC",cursor:"pointer",textAlign:"left"},children:[(0,f.jsx)("span",{style:{width:30,height:30,borderRadius:8,background:s,color:a,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(t,{size:16})}),(0,f.jsx)("span",{style:{fontSize:12.5,fontWeight:600},children:n})]})},rr=()=>{const e=(0,r.Zp)(),t=(0,I.wE)(),[s,n]=(0,a.useState)(null),[i,l]=(0,a.useState)(!1),[d,p]=(0,a.useState)(null),[x,h]=(0,a.useState)(!0),[u,g]=(0,a.useState)([]),[b,y]=(0,a.useState)(!0),[j,w]=(0,a.useState)(!1),[N,A]=(0,a.useState)(null),[k,S]=(0,a.useState)(null),C=()=>{const e=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}");return{Authorization:"Bearer ".concat(null===e||void 0===e?void 0:e.token)}},F=async()=>{try{const e=await fetch("".concat(t,"/api/admin/dashboard/upcoming-events"),{headers:C()});if(401===e.status)return c();if(e.ok){const t=await e.json();g(t.events||[]),w(t.has_more||!1)}}catch(e){console.error("Error fetching upcoming events:",e)}finally{y(!1)}};if((0,a.useEffect)(()=>{if(!(0,o.cd)())return void e("/?admin=true");const s=JSON.parse(localStorage.getItem("turbo360_admin_auth"));n({username:s.username,fullName:s.fullName||s.username,role:s.role||"Administrator"}),(async()=>{try{const e=await fetch("".concat(t,"/api/mobile/dashboard/stats"),{headers:C()});if(401===e.status)return c();if(e.ok){const t=await e.json();p(t.stats)}}catch(e){console.error("Error fetching stats:",e)}finally{h(!1)}})(),F(),fetch("/build-info.json?"+Date.now()).then(e=>e.ok?e.json():null).then(e=>e&&A(e)).catch(()=>{}),l(!0)},[e]),!s)return null;const E=(null===d||void 0===d?void 0:d.invoices)||{},T=(null===d||void 0===d?void 0:d.leads)||{},z=(null===d||void 0===d?void 0:d.proposals)||{},B=[];var D;return E.overdue>0&&B.push({icon:v.A,bg:"#FEE2E2",fg:"#991B1B",title:"".concat(E.overdue," invoice").concat(1===E.overdue?"":"s"," overdue"),sub:"".concat((D=E.outstanding,"$".concat(Number(D||0).toLocaleStr
1ing("en-AU",{maximumFractionDigits:0})))," outstanding"),onClick:()=>e("/admin/invoices")}),T.new>0&&B.push({icon:js.A,bg:"#FEF3C7",fg:"#92400E",title:"".concat(T.new," new lead").concat(1===T.new?"":"s"," awaiting reply"),sub:T.recent?"".concat(T.recent," this week"):null,onClick:()=>e("/admin/leads")}),z.pending>0&&B.push({icon:_.A,bg:"#EEF2FF",fg:"#4338CA",title:"".concat(z.pending," proposal").concat(1===z.pending?"":"s"," pending response"),sub:"".concat(z.accepted||0," accepted"),onClick:()=>e("/admin/proposals")}),(0,f.jsxs)(ta,{title:"Dashboard",action:{label:"New Proposal",to:"/admin/proposals/create"},children:[(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(6,1fr)",gap:16,marginBottom:24},children:x?[...Array(3)].map((e,t)=>(0,f.jsxs)("div",{className:"tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},er),{},{padding:20}),children:[(0,f.jsx)("div",{className:"tg-skel",style:{height:11,width:"50%",marginBottom:16}}),(0,f.jsx)("div",{className:"tg-skel",style:{height:26,width:"70%"}})]},t)):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(tr,{label:"PAID \xb7 30 DAYS",icon:At.A,iconBg:"rgba(34,197,94,.12)",iconFg:"#16A34A",children:(0,f.jsx)(zs,{amount:E.total_paid,size:29,mutedSize:16})}),(0,f.jsx)(tr,{label:"OUTSTANDING",icon:Nt.A,iconBg:"rgba(242,169,0,.14)",iconFg:"#B45309",footer:E.overdue>0?(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",gap:7},children:(0,f.jsxs)(Ds,{tone:"danger",children:[E.overdue," OVERDUE"]})}):(0,f.jsx)("span",{style:{fontSize:12,color:"#9A9AA0"},children:"No overdue invoices"}),children:(0,f.jsx)(zs,{amount:E.outstanding,size:29,mutedSize:16})}),(0,f.jsx)(tr,{label:"INVOICED \xb7 THIS MONTH",icon:Ia.A,iconBg:"rgba(191,33,47,.22)",iconFg:"#F87171",dark:!0,children:(0,f.jsx)(zs,{amount:E.this_month,size:29,mutedSize:16,color:"#F4F2EE",mutedColor:"#7A7A82"})})]})}),(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"1.7fr 1fr",gap:20},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},er),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)("span",{className:"tg-ui",style:{fontWeight:700,fontSize:15.5},children:"Upcoming Bookings"}),u.length>0&&(0,f.jsxs)(Ds,{tone:"gray",radius:20,children:[u.length," SCHEDULED"]})]}),(j||u.length>0)&&(0,f.jsx)("button",{onClick:()=>e("/admin/corporate"),style:{background:"none",border:"none",fontSize:12.5,fontWeight:600,color:"#BF212F",cursor:"pointer"},children:"View All \u2192"})]}),b?[...Array(4)].map((e,t)=>(0,f.jsxs)("div",{style:{padding:"15px 22px",borderBottom:"1px solid #F2F2F5",display:"flex",gap:16,alignItems:"center"},children:[(0,f.jsx)("div",{className:"tg-skel",style:{width:40,height:34}}),(0,f.jsxs)("div",{style:{flex:1},children:[(0,f.jsx)("div",{className:"tg-skel",style:{height:12,width:"60%",marginBottom:8}}),(0,f.jsx)("div",{className:"tg-skel",style:{height:10,width:"40%"}})]})]},t)):0===u.length?(0,f.jsxs)("div",{style:{padding:"48px 22px",textAlign:"center"},children:[(0,f.jsx)("div",{style:{fontSize:14,fontWeight:700,marginBottom:6},children:"No upcoming events"}),(0,f.jsx)("button",{onClick:()=>e("/admin/corporate/create"),style:{background:"none",border:"none",color:"#BF212F",fontWeight:600,fontSize:13,cursor:"pointer"},children:"Create Event \u2192"})]}):u.map((e,t)=>(0,f.jsx)(sr,{event:e,last:t===u.length-1,onClick:()=>S(e)},e.id||t))]}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},er),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{padding:"16px 20px 12px",borderBottom:"1px solid #EDEDF0",display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:"#BF212F"}}),(0,f.jsx)("span",{className:"tg-ui",style:{fontWeight:700,fontSize:14.5},children:"Needs Attention"})]}),0===B.length?(0,f.jsx)("div",{style:{padding:"24px 20px",fontSize:13,color:"#9A9AA0"},children:"You're all caught up. \ud83c\udf89"}):B.map((e,t)=>(0,f.jsx)(ar,(0,m.A)((0,m.A)({},e),{},{last:t===B.length-1}),t))]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},er),{},{padding:"18px 20px"}),children:[(0,f.jsx)("div",{style:{fontFamily:Xn,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:14},children:"QUICK ACTIONS"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[(0,f.jsx)(nr,{icon:kt.A,bg:"#FEE2E2",fg:"#BF212F",label:"New Proposal",onClick:()=>e("/admin/proposals/create")}),(0,f.jsx)(nr,{icon:At.A,bg:"#FEF3C7",fg:"#B45309",label:"New Invoice",onClick:()=>e("/admin/invoices/create")}),(0,f.jsx)(nr,{icon:ks.A,bg:"#EEF2FF",fg:"#4338CA",label:"New Runsheet",onClick:()=>e("/admin/corporate/create")}),(0,f.jsx)(nr,{icon:gs.A,bg:"#DCFCE7",fg:"#15803D",label:"Add Client",onClick:()=>e("/admin/clients/create")})]})]})]})]}),N&&"dev"!==N.version&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},er),{},{padding:"14px 20px",marginTop:20,display:"flex",alignItems:"center",gap:16,flexWrap:"wrap"}),children:[(0,f.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:7,fontFamily:Xn,fontSize:10,letterSpacing:"0.14em",color:"#9A9AA0"},children:[(0,f.jsx)(Sn.A,{size:13})," DEPLOYMENT"]}),(0,f.jsxs)("span",{style:{fontFamily:Xn,fontSize:12,color:"#55555C"},children:["v",N.version]}),(0,f.jsx)("span",{style:{fontFamily:Xn,fontSize:12,color:"#9A9AA0"},children:new Date(N.deployedAt).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}),(0,f.jsx)("span",{style:{fontFamily:Xn,fontSize:11,color:"#B5B5BC"},children:N.commit})]}),i&&(0,f.jsx)(Cn,{onClose:()=>l(!1)}
1),k&&(0,f.jsx)(Qn,{event:k,onClose:()=>S(null),onChanged:()=>F()})]})};var ir=s(84259),or=s(87977);const lr=e=>{let{todoId:t,notes:s=[],fetchTodos:n,isEditing:r}=e;const[i,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)(""),[d,m]=(0,a.useState)(!0),[p,x]=(0,a.useState)(null),[h,u]=(0,a.useState)(""),[g,b]=(0,a.useState)(!0),[y,v]=(0,a.useState)(!1);return(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("label",{className:"block text-sm font-black text-slate-700 uppercase tracking-wide flex items-center gap-2",children:[(0,f.jsx)(Fn.A,{className:"w-5 h-5 text-blue-600"}),"Progress Notes"]}),!i&&(0,f.jsxs)("button",{onClick:()=>o(!0),className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg font-bold hover:bg-blue-700 transition-all text-sm",disabled:y,children:[(0,f.jsx)(ls.A,{className:"w-4 h-4"}),"Add Note"]})]}),i&&(0,f.jsxs)("div",{className:"mb-4 p-4 bg-blue-50 rounded-xl border-2 border-blue-200",children:[(0,f.jsx)("div",{className:"mb-3",children:(0,f.jsx)("textarea",{value:l,onChange:e=>c(e.target.value),placeholder:"Enter progress update...",className:"w-full px-4 py-3 bg-white border-2 border-blue-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",rows:3,disabled:y})}),(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 cursor-pointer",children:[(0,f.jsx)("input",{type:"checkbox",checked:d,onChange:e=>m(e.target.checked),className:"w-4 h-4",disabled:y}),d?(0,f.jsxs)("span",{className:"flex items-center gap-1",children:[(0,f.jsx)(_.A,{className:"w-4 h-4 text-green-600"}),"Visible to client"]}):(0,f.jsxs)("span",{className:"flex items-center gap-1",children:[(0,f.jsx)(ut.A,{className:"w-4 h-4 text-red-600"}),"Hidden from client"]})]}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsxs)("button",{onClick:async()=>{if(l.trim()){v(!0);try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token;(await fetch("".concat(I.JR,"/api/admin/todos/").concat(t,"/notes"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify({note_text:l,visible_to_client:d})})).ok&&(c(""),m(!0),o(!1),await n())}catch(s){console.error("Error adding note:",s),alert("Failed to add note")}finally{v(!1)}}},className:"flex items-center gap-2 px-4 py-2 bg-green-600 text-white rounded-lg font-bold hover:bg-green-700 transition-all text-sm",disabled:y||!l.trim(),children:[(0,f.jsx)(ia.A,{className:"w-4 h-4"}),"Save"]}),(0,f.jsx)("button",{onClick:()=>{o(!1),c(""),m(!0)},className:"px-4 py-2 bg-slate-200 text-slate-700 rounded-lg font-bold hover:bg-slate-300 transition-all text-sm",disabled:y,children:"Cancel"})]})]})]}),(0,f.jsx)("div",{className:"space-y-4",children:s&&s.length>0?s.map((e,a)=>{return(0,f.jsxs)("div",{className:"relative pl-6 pb-6 ".concat(a!==s.length-1?"border-l-2 border-slate-200":""),children:[(0,f.jsx)("div",{className:"absolute left-0 top-0 -translate-x-1/2",children:(0,f.jsx)("div",{className:"w-3 h-3 rounded-full ".concat(e.visible_to_client?"bg-blue-500":"bg-slate-400"," ring-4 ring-white")})}),p===e.id?(0,f.jsxs)("div",{className:"ml-4 p-4 bg-slate-50 rounded-xl border-2 border-slate-200",children:[(0,f.jsx)("div",{className:"mb-3",children:(0,f.jsx)("textarea",{value:h,onChange:e=>u(e.target.value),className:"w-full px-4 py-3 bg-white border-2 border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",rows:3,disabled:y})}),(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("label",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 cursor-pointer",children:[(0,f.jsx)("input",{type:"checkbox",checked:g,onChange:e=>b(e.target.checked),className:"w-4 h-4",disabled:y}),g?(0,f.jsxs)("span",{className:"flex items-center gap-1",children:[(0,f.jsx)(_.A,{className:"w-4 h-4 text-green-600"}),"Visible to client"]}):(0,f.jsxs)("span",{className:"flex items-center gap-1",children:[(0,f.jsx)(ut.A,{className:"w-4 h-4 text-red-600"}),"Hidden from client"]})]}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsxs)("button",{onClick:()=>(async e=>{if(h.trim()){v(!0);try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token;(await fetch("".concat(I.JR,"/api/admin/todos/").concat(t,"/notes/").concat(e),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify({note_text:h,visible_to_client:g})})).ok&&(x(null),u(""),b(!0),await n())}catch(a){console.error("Error updating note:",a),alert("Failed to update note")}finally{v(!1)}}})(e.id),className:"flex items-center gap-2 px-4 py-2 bg-green-600 text-white rounded-lg font-bold hover:bg-green-700 transition-all text-sm",disabled:y||!h.trim(),children:[(0,f.jsx)(ia.A,{className:"w-4 h-4"}),"Save"]}),(0,f.jsx)("button",{onClick:()=>{x(null),u(""),b(!0)},className:"px-4 py-2 bg-slate-200 text-slate-700 rounded-lg font-bold hover:bg-slate-300 transition-all text-sm",disabled:y,children:"Cancel"})]})]})]}):(0,f.jsxs)("div",{className:"ml-4 group",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,f.jsx)("span",{className:"text-xs font-black text-slate-900 uppercase tracking-wide",children:"Turbo Team"}),!e.visible_to_client&&(0,f.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 bg-red-100 text-red-700 rounded-full text-xs font-bold",children:[(0,f.jsx)(ut.A,{className:"w-3 h-3"}),"Hidden"]})]}),(0,f.jsxs)("p",{className:"text-xs text-slate-500 font-semibold",children:[(r=e.created_at,new Date(r).toLocaleStr
1ing("en-AU",{timeZone:"Australia/Melbourne",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})),e.updated_at&&e.updated_at!==e.created_at&&(0,f.jsx)("span",{className:"ml-2 text-slate-400",children:"(edited)"})]})]}),(0,f.jsxs)("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,f.jsx)("button",{onClick:()=>(e=>{x(e.id),u(e.note_text),b(e.visible_to_client)})(e),className:"p-1.5 hover:bg-blue-100 rounded-lg text-blue-600 transition-colors",title:"Edit note",children:(0,f.jsx)(oa.A,{className:"w-4 h-4"})}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Delete this progress note?")){v(!0);try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token;(await fetch("".concat(I.JR,"/api/admin/todos/").concat(t,"/notes/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(a)}})).ok&&await n()}catch(a){console.error("Error deleting note:",a),alert("Failed to delete note")}finally{v(!1)}}})(e.id),className:"p-1.5 hover:bg-red-100 rounded-lg text-red-600 transition-colors",title:"Delete note",children:(0,f.jsx)(la.A,{className:"w-4 h-4"})})]})]}),(0,f.jsx)("div",{className:"bg-white rounded-lg p-4 border-2 border-slate-200 shadow-sm",children:(0,f.jsx)("p",{className:"text-slate-800 whitespace-pre-wrap break-words",children:e.note_text})})]})]},e.id);var r}):(0,f.jsxs)("div",{className:"text-center py-8 bg-slate-50 rounded-xl border-2 border-dashed border-slate-300",children:[(0,f.jsx)(Fn.A,{className:"w-12 h-12 text-slate-400 mx-auto mb-3"}),(0,f.jsx)("p",{className:"text-slate-500 font-semibold",children:"No progress notes yet"}),(0,f.jsx)("p",{className:"text-sm text-slate-400 mt-1",children:"Add notes to track updates and communicate with clients"})]})})]})};var cr=s(77275),dr=s(54410),mr=s(39956),pr=s.n(mr),xr=s(11869),hr=s.n(xr);s(90425);const ur="'Space Mono',monospace",gr={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},fr={"not started":"gray","in progress":"blue",completed:"green","on hold":"muted","awaiting client":"amber","design phase":"indigo",development:"blue",review:"indigo","ready to deploy":"green"},br=e=>fr[(e||"").toLowerCase().trim()]||"gray",yr=["Not Started","In Progress","On Hold","Awaiting Client","Design Phase","Development","Review","Ready to Deploy"],vr=e=>e?new Date(e).toLocaleDateString("en-AU",{timeZone:"Australia/Melbourne",day:"2-digit",month:"short"}):"",jr={display:"block",fontFamily:ur,fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"#9A9AA0",marginBottom:7},wr={width:"100%",padding:"10px 12px",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,fontSize:13.5,color:"#0A0A0B",outline:"none",fontFamily:"'Hanken Grotesk',sans-serif"},Nr=e=>{let{todo:t,onClose:s,onUpdate:n,onDelete:r,onToggleComplete:i,clients:o,fetchTodos:l}=e;const[c,d]=(0,a.useState)({project_name:t.project_name,description:t.description,status:t.status,client_id:t.client_id||"",client_company:t.client_company||"",contact_name:t.contact_name||""}),[p,x]=(0,a.useState)(()=>{if(t.description){const e=hr()(t.description);if(e){const t=dr.ContentState.createFromBlockArray(e.contentBlocks);return dr.EditorState.createWithContent(t)}}return dr.EditorState.createEmpty()}),[h,u]=(0,a.useState)(!1),b=e=>{if(e.is_company)return e.company_name||e.name||"Unnamed Company";{const t=e.first_name||e.firstName||"",s=e.last_name||e.lastName||"",a="".concat(t," ").concat(s).trim();return a||(e.name?e.name:e.contact_name?e.contact_name:e.email?e.email:"Unnamed Contact")}},y=e=>new Date(e).toLocaleDateString("en-AU",{timeZone:"Australia/Melbourne",weekday:"short",year:"numeric",month:"long",day:"numeric"});return(0,f.jsx)("div",{onClick:s,style:{position:"fixed",inset:0,background:"rgba(10,10,11,.55)",zIndex:50,display:"flex",alignItems:"flex-start",justifyContent:"center",padding:24,overflowY:"auto",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)"},children:(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),style:(0,m.A)((0,m.A)({},gr),{},{maxWidth:860,width:"100%",margin:"24px 0",display:"flex",flexDirection:"column",maxHeight:"90vh",overflow:"hidden",boxShadow:"0 24px 80px rgba(10,10,11,.35)"}),children:[(0,f.jsxs)("div",{style:{padding:"20px 24px",borderBottom:"1px solid #EDEDF0",display:"flex",alignItems:"flex-start",ga
1p:16,flexShrink:0},children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[h?(0,f.jsx)("input",{type:"text",value:c.project_name,onChange:e=>d((0,m.A)((0,m.A)({},c),{},{project_name:e.target.value})),style:(0,m.A)((0,m.A)({},wr),{},{fontFamily:"'Archivo',sans-serif",fontSize:20,fontWeight:700})}):(0,f.jsx)("h2",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:22,margin:0,wordBreak:"break-word"},children:t.project_name}),(0,f.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8,marginTop:10},children:[(0,f.jsx)(Ds,{tone:br(h?c.status:t.status),children:h?c.status:t.status}),t.completed_at&&(0,f.jsxs)(Ds,{tone:"green",children:["Completed ",vr(t.completed_at)]})]})]}),(0,f.jsx)("button",{onClick:s,style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex",flexShrink:0},children:(0,f.jsx)(g.A,{size:22})})]}),(0,f.jsxs)("div",{className:"tg-scroll",style:{padding:"20px 24px",overflowY:"auto",flex:1},children:[h?(0,f.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:10,marginBottom:20},children:[(0,f.jsxs)("button",{onClick:async()=>{const e=pr()((0,dr.convertToRaw)(p.getCurrentContent()));await n(t.id,{project_name:c.project_name,description:e,status:c.status,client_id:c.client_id||null,client_company:c.client_company||null,contact_name:c.contact_name||null}),u(!1),await l(),s()},style:{display:"flex",alignItems:"center",gap:8,background:"#16A34A",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer"},children:[(0,f.jsx)(ia.A,{size:16}),"Save Changes"]}),(0,f.jsx)("button",{onClick:()=>u(!1),style:{background:"#F2F2F5",color:"#55555C",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer"},children:"Cancel"})]}):(0,f.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:10,marginBottom:20},children:[(0,f.jsxs)("button",{onClick:()=>u(!0),className:"tg-btn-primary",style:{display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer"},children:[(0,f.jsx)(oa.A,{size:16}),"Edit Task"]}),(0,f.jsxs)("button",{onClick:()=>{i(t),l()},style:{display:"flex",alignItems:"center",gap:8,border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer",color:"#fff",background:t.is_completed?"#9A9AA0":"#16A34A"},children:[(0,f.jsx)(In.A,{size:16}),t.is_completed?"Mark Incomplete":"Mark Complete"]}),(0,f.jsxs)("button",{onClick:()=>{window.confirm("Delete this task?")&&(r(t.id),s())},style:{display:"flex",alignItems:"center",gap:8,background:"#FEE2E2",color:"#991B1B",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer"},children:[(0,f.jsx)(la.A,{size:16}),"Delete"]})]}),(0,f.jsxs)("div",{style:{marginBottom:20},children:[(0,f.jsx)("label",{style:jr,children:"Description"}),h?(0,f.jsx)("div",{style:{border:"1px solid #E4E4E9",borderRadius:9,background:"#fff",overflow:"hidden"},children:(0,f.jsx)(cr.Editor,{editorState:p,onEditorStateChange:x,toolbar:{options:["inline","list","link"],inline:{options:["bold","italic","underline"]}},editorClassName:"px-3 text-slate-900 min-h-[200px]",toolbarClassName:"border-b border-slate-200 bg-slate-50"})}):(0,f.jsx)("div",{style:{background:"#F7F7F9",borderRadius:9,padding:18,border:"1px solid #E4E4E9"},children:(0,f.jsx)("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:or.default.sanitize(t.description)},style:{wordBreak:"break-word",overflowWrap:"anywhere",color:"#1A1A1D",fontSize:13.5}})})]}),h&&(0,f.jsxs)("div",{style:{marginBottom:20},children:[(0,f.jsx)("label",{style:jr,children:"Status"}),(0,f.jsx)("input",{type:"text",list:"modal-status-options",value:c.status,onChange:e=>d((0,m.A)((0,m.A)({},c),{},{status:e.target.value})),style:wr,placeholder:"Enter or select status"}),(0,f.jsxs)("datalist",{id:"modal-status-options",children:[(0,f.jsx)("option",{value:"Not Started"}),(0,f.jsx)("option",{value:"In Progress"}),(0,f.jsx)("option",{value:"Completed"}),(0,f.jsx)("option",{value:"On Hold"}),(0,f.jsx)("option",{value:"Awaiting Client"}),(0,f.jsx)("option",{value:"Design Phase"}),(0,f.jsx)("option",{value:"Development"}),(0,f.jsx)("option",{value:"Review"}),(0,f.jsx)("option",{value:"Ready to Deploy"})]})]}),(0,f.jsxs)("div",{style:{marginBottom:20},children:[(0,f.jsx)("label",{style:jr,children:"Assigned Client/Contact"}),h?(0,f.jsxs)("select",{value:c.client_id,onChange:e=>(e=>{if(!e)return void d(e=>(0,m.A)((0,m.A)({},e),{},{client_id:"",client_company:"",contact_name:""}));const t=o.find(t=>
1t.id===e);if(t)if(t.is_company)d(e=>(0,m.A)((0,m.A)({},e),{},{client_id:t.id,client_company:t.company_name||t.name,contact_name:""}));else{let e="";if(t.parent_company_name)e=t.parent_company_name;else if(t.parent_company_id){const s=o.find(e=>e.id===t.parent_company_id);e=s?s.company_name||s.name:""}const s=t.first_name||t.firstName||"",a=t.last_name||t.lastName||"",n="".concat(s," ").concat(a).trim()||t.name||t.contact_name||t.email;d(s=>(0,m.A)((0,m.A)({},s),{},{client_id:t.id,client_company:e,contact_name:n}))}})(e.target.value),style:wr,children:[(0,f.jsx)("option",{value:"",children:"-- No client --"}),(0,f.jsx)("optgroup",{label:"Companies",children:Array.isArray(o)&&o.filter(e=>e.is_company).sort((e,t)=>b(e).localeCompare(b(t))).map(e=>(0,f.jsxs)("option",{value:e.id,children:["\ud83c\udfe2 ",b(e)]},e.id))}),(0,f.jsx)("optgroup",{label:"Contacts",children:Array.isArray(o)&&o.filter(e=>!e.is_company).sort((e,t)=>b(e).localeCompare(b(t))).map(e=>(0,f.jsxs)("option",{value:e.id,children:["\ud83d\udc64 ",b(e)]},e.id))})]}):(0,f.jsx)("div",{style:{background:"#F7F7F9",borderRadius:9,padding:18,border:"1px solid #E4E4E9"},children:t.client_company||t.contact_name?(0,f.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:16},children:[t.client_company&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontWeight:600,fontSize:13.5},children:[(0,f.jsx)(gs.A,{size:16,color:"#BF212F"}),t.client_company]}),t.contact_name&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontWeight:600,fontSize:13.5},children:[(0,f.jsx)(Ye.A,{size:16,color:"#4338CA"}),t.contact_name]})]}):(0,f.jsx)("p",{style:{color:"#9A9AA0",fontStyle:"italic",margin:0,fontSize:13.5},children:"No client assigned"})})]}),(0,f.jsx)("div",{style:{borderTop:"1px solid #EDEDF0",paddingTop:20,marginBottom:20},children:(0,f.jsx)(lr,{todoId:t.id,notes:t.progress_notes||[],fetchTodos:l,isEditing:h})}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16,paddingTop:20,borderTop:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jr,children:"Created"}),(0,f.jsx)("p",{style:{margin:0,fontWeight:600,fontSize:13.5},children:y(t.created_at)})]}),t.updated_at&&(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jr,children:"Last Updated"}),(0,f.jsx)("p",{style:{margin:0,fontWeight:600,fontSize:13.5},children:y(t.updated_at)})]})]})]})]})})},Ar=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),[l,c]=(0,a.useState)(!1),[d,p]=(0,a.useState)(null),[x,h]=(0,a.useState)(""),[u,b]=(0,a.useState)(null),[y,v]=(0,a.useState)(null),[j,w]=(0,a.useState)(!1),[N,A]=(0,a.useState)({project_name:"",description:"",status:"Not Started",client_id:"",client_company:"",contact_name:""}),[k,S]=(0,a.useState)(()=>dr.EditorState.createEmpty()),[_,C]=(0,a.useState)([]),F=e=>{if(e.is_company)return e.company_name||e.name||"Unnamed Company";{const t=e.first_name||e.firstName||"",s=e.last_name||e.lastName||"",a="".concat(t," ").concat(s).trim();return a||(e.name?e.name:e.contact_name?e.contact_name:e.email?e.email:"Unnamed Contact")}},E=e=>{if(!e)return"No description";const t=e.replace(/<[^>]*>/g,"").split("\n")[0];return t.length>80?t.substring(0,80)+"...":t};(0,a.useEffect)(()=>{(0,o.cd)()?(T(),z()):e("/?admin=true")},[e]);const T=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(I.JR,"/api/admin/todos"),{headers:{Authorization:"Bearer ".concat(t)}}),n=await a.json();n.success&&s(n.todos)}catch(t){console.error("Error fetching todos:",t)}finally{i(!1)}},z=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.JR,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();Array.isArray(e)?(console.log("Sample contact structure:",e[0]),C(e)):e.clients&&Array.isArray(e.clients)?(console.log("Sample contact structure:",e.clients[0]),C(e.clients)):(console.error("Unexpected clients data format:",e),C([]))}else C([])}catch(t){console.error("Error fetching clients:",t),C([])}},B=async(e,t)=>{try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,n=await fetch("".concat(I.JR,"/api/admin/todos/").concat(e),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify(t)});(await n.json()).success&&(await T(),p(null))}catch(a){console.error("Error updating todo:",a)}},D=async e=>{if(window.confirm("Are you sure you want to delete this to-do item?"))try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.JR,"/api/admin/todos/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}});(await a.json()).success&&await T()}catch(s){console.error("Error deleting todo:",s)}},R=async e=>{await B(e.id,{is_completed:!e.is_completed})},P=e=>{e.preventDefault(),e.dataTransfer.dropEffect="move"},W=()=>{A({project_name:"",description:"",status:"Not Started",client_id:"",client_company:"",contact_name:""}),S(dr.EditorState.createEmpty())},O=t.filter(e=>e.project_name.toLowerCase().includes(x.toLowerCase())||e.description.toLowerCase().includes(x.toLowerCase())||e.client_company&&e.client_company.toLowerCase().includes(x.toLowerCase())||e.contact_name&&e.contact_name.toLowerCase().includes(x.toLowerCase())),L=O.filter(e=>!e.is_completed),M=O.filter(e=>e.is_completed),q=t.filter(e=>!e.is_completed&&"in progress"===(e.status||"").toLowerCase().trim()).length,H=t.filter(e=>!e.is_completed&&"awaiting client"===(e.status||"").toLowerCase().trim()).length,U=[{label:"ACTIVE",value:t.filter(e=>!e.is_completed).length,color:"#0A0A0B"},{label:"IN PROGRESS",value:q,color:"#1D4ED8"},{label:"AWAITING CLIENT",value:H,color:"#92400E"},{label:"COMPLETED",value:t.filter(e=>e.is_completed).length,color:"#15803D"}],G=e=>{let{todo:s,completed:a}=e;return(0,f.jsxs)("div",{className:"tg-row",draggable:!0,onDragStart:e=>((e,t)=>{b(t),e.dataTransfer.effectAllowed="move"})(e,s),onDragOver:P,onDrop:e=>(async(e,s)=>{if(e.preventDefault(),!u||u.id===s.id)return;if(u.is_completed!==s.is_completed)return;const a=t.filter(e=>e.is_completed===u.is_completed),n=a.findIndex(e=>e.id===u.id),r=a.findIndex(e=>e.id===s.id),i=[...a],[o]=i.splice(n,1);i.splice(r,0,o);try{var l;const e=null===(l=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===l?void 0:l.token;await fetch("".concat(I.JR,"/api/admin/todos/reorder"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({todo_ids:i.map(e=>e.id)})}),await T()}catch(c){console.error("Error reordering todos:",c)}b(null)}
1)(e,s),onClick:()=>(e=>{v(e),w(!0)})(s),style:{display:"flex",alignItems:"center",gap:14,padding:"14px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer"},children:[(0,f.jsx)("button",{onClick:e=>{e.stopPropagation(),R(s)},title:a?"Mark incomplete":"Mark complete",style:{width:20,height:20,borderRadius:6,flexShrink:0,cursor:"pointer",padding:0,border:"2px solid ".concat(a?"#16A34A":"#C9C9D0"),background:a?"#16A34A":"#fff",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff"},children:a&&(0,f.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textDecoration:a?"line-through":"none",color:a?"#9A9AA0":"#0A0A0B"},children:s.project_name}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[s.client_company,s.contact_name].filter(Boolean).join(" \xb7 ")||E(s.description)})]}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontFamily:ur,fontSize:11,color:"#9A9AA0",whiteSpace:"nowrap"},children:a?s.completed_at?"done ".concat(vr(s.completed_at)):"":Array.isArray(s.progress_notes)&&s.progress_notes.length?"".concat(s.progress_notes.length," note").concat(s.progress_notes.length>1?"s":""):""}),(0,f.jsx)(Ds,{tone:br(s.status),children:s.status}),(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("button",{onClick:()=>D(s.id),title:"Delete",style:{background:"none",border:"none",color:"#B5B5BC",cursor:"pointer",padding:4,display:"flex"},children:(0,f.jsx)(la.A,{size:15})}),(0,f.jsx)("span",{title:"Drag to reorder",style:{color:"#B5B5BC",display:"flex",cursor:"grab"},children:(0,f.jsx)(ir.A,{size:16})})]})]})};return n?(0,f.jsx)(ta,{title:"To-Do List",meta:"OVERVIEW \xb7 TASKS",children:(0,f.jsx)(Ws,{rows:6})}):(0,f.jsxs)(ta,{title:"To-Do List",meta:"OVERVIEW \xb7 TASKS",children:[(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:14,marginBottom:20},children:U.map(e=>(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},gr),{},{padding:"16px 18px"}),children:[(0,f.jsx)("div",{style:{fontFamily:ur,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:9},children:e.label}),(0,f.jsx)("div",{style:{fontFamily:ur,fontWeight:700,fontSize:24,letterSpacing:"-0.02em",lineHeight:1,color:e.color},children:e.value})]},e.label))}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:18,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",flex:1,minWidth:220},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{type:"text",placeholder:"Search projects, descriptions, or clients\u2026",value:x,onChange:e=>h(e.target.value),style:{border:"none",background:"transparent",outline:"none",fontSize:13.5,width:"100%",color:"#0A0A0B"}})]}),(0,f.jsxs)("button",{onClick:()=>c(!l),className:"tg-btn-primary",style:{display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer",whiteSpace:"nowrap"},children:[l?(0,f.jsx)(g.A,{size:16,strokeWidth:2.2}):(0,f.jsx)(ls.A,{size:16,strokeWidth:2.2}),l?"Close":"Add To-Do"]})]}),l&&(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},gr),{},{padding:22,marginBottom:18}),children:(0,f.jsxs)("form",{onSubmit:async e=>{e.preventDefault();const t=pr()((0,dr.convertToRaw)(k.getCurrentContent()));try{var s;const e=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,a=await fetch("".concat(I.JR,"/api/admin/todos"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify((0,m.A)((0,m.A)({},N),{},{description:t}))});(await a.json()).success&&(await T(),c(!1),W())}catch(a){console.error("Error creating todo:",a)}},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:18},children:[(0,f.jsx)("h2",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,margin:0},children:"New To-Do Item"}),(0,f.jsx)("button",{type:"button",onClick:()=>c(!1),style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex"},children:(0,f.jsx)(g.A,{size:20})})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jr,children:"Project Name *"}),(0,f.jsx)("input",{type:"text",required:!0,value:N.project_name,onChange:e=>A((0,m.A)((0,m.A)({},N),{},{project_name:e.target.value})),style:wr,placeholder:"Enter project name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jr,children:"Status"}),(0,f.jsx)("input",{type:"text",list:"status-options",value:N.status,onChange:e=>A((0,m.A)((0,m.A)({},N),{},{status:e.target.value})),style:wr,placeholder:"Enter or select status"}),(0,f.jsx)("datalist",{id:"status-options",children:yr.map(e=>(0,f.jsx)("option",{value:e},e))})]}),(0,f.jsxs)("div",{style:{gridColumn:"1 / -1"},children:[(0,f.jsx)("label",{style:jr,children:"Description *"}),(0,f.jsx)("div",{style:{border:"1px solid #E4E4E9",borderRadius:9,background:"#fff",overflow:"hidden"},children:(0,f.jsx)(cr.Editor,{editorState:k,onEditorStateChange:S,toolbar:{options:["inline","list","link"],inline:{options:["bold","italic","underline"]}},editorClassName:"px-3",toolbarClassName:"border-b border-slate-200 bg-slate-50",placeholder:"Describe the work to be done..."})})]}),(0,f.jsxs)("div",{style:{gridColumn:"1 / -1"},children:[(0,f.jsx)("label",{style:jr,children:"Assign to Client/Contact (Optional)"}),(0,f.jsxs)("select",{value:N.client_id,onChange:e=>(e=>{if(!e)return void A(e=>(0,m.A)((0,m.A)({},e),{},{client_id:"",client_company:"",contact_name:""}));const t=_.find(t=>
1t.id===e);if(t)if(t.is_company)A(e=>(0,m.A)((0,m.A)({},e),{},{client_id:t.id,client_company:t.company_name,contact_name:""}));else{let e="";if(t.parent_company_name)e=t.parent_company_name;else if(t.parent_company_id){const s=_.find(e=>e.id===t.parent_company_id);e=s?s.company_name:""}A(s=>(0,m.A)((0,m.A)({},s),{},{client_id:t.id,client_company:e,contact_name:"".concat(t.first_name||""," ").concat(t.last_name||"").trim()}))}})(e.target.value),style:wr,children:[(0,f.jsx)("option",{value:"",children:"-- No client assigned --"}),(0,f.jsx)("optgroup",{label:"Companies",children:Array.isArray(_)&&_.filter(e=>e.is_company).sort((e,t)=>F(e).localeCompare(F(t))).map(e=>(0,f.jsxs)("option",{value:e.id,children:["\ud83c\udfe2 ",F(e)]},e.id))}),(0,f.jsx)("optgroup",{label:"Individual Contacts",children:Array.isArray(_)&&_.filter(e=>!e.is_company).sort((e,t)=>F(e).localeCompare(F(t))).map(e=>(0,f.jsxs)("option",{value:e.id,children:["\ud83d\udc64 ",F(e),e.parent_company_name?" (".concat(e.parent_company_name,")"):""]},e.id))})]}),(0,f.jsx)("p",{style:{marginTop:8,fontSize:11.5,color:"#9A9AA0"},children:"Select a company or individual contact to assign this task to"})]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,justifyContent:"flex-end",paddingTop:18,marginTop:18,borderTop:"1px solid #EDEDF0"},children:[(0,f.jsx)("button",{type:"button",onClick:()=>c(!1),style:{background:"#F2F2F5",color:"#55555C",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer"},children:"Cancel"}),(0,f.jsxs)("button",{type:"submit",className:"tg-btn-primary",style:{display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer"},children:[(0,f.jsx)(ia.A,{size:16}),"Create To-Do"]})]})]})}),0===t.length&&(0,f.jsx)(Os,{icon:In.A,title:"No to-do items yet",message:"Get started by creating your first task.",actionLabel:"Create First To-Do",onAction:()=>c(!0)}),L.length>0&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},gr),{},{overflow:"hidden",marginBottom:18}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"14px 20px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)("span",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"Active"}),(0,f.jsx)("span",{style:{fontFamily:ur,fontSize:10.5,background:"#EDEDF0",color:"#55555C",borderRadius:20,padding:"3px 9px"},children:L.length})]}),L.map(e=>(0,f.jsx)(G,{todo:e,completed:!1},e.id))]}),M.length>0&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},gr),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"14px 20px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)("span",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,color:"#9A9AA0"},children:"Completed"}),(0,f.jsx)("span",{style:{fontFamily:ur,fontSize:10.5,background:"#EDEDF0",color:"#55555C",borderRadius:20,padding:"3px 9px"},children:M.length})]}),M.map(e=>(0,f.jsx)(G,{todo:e,completed:!0},e.id))]}),t.length>0&&0===O.length&&(0,f.jsx)(Os,{icon:ds.A,title:"No matching tasks",message:"Adjust your search to find what you're looking for."}),j&&y&&(0,f.jsx)(Nr,{todo:y,onClose:()=>w(!1),onUpdate:B,onDelete:D,onToggleComplete:R,clients:_,fetchTodos:T})]})};var kr=s(97950),Sr=s(22754),_r=s(5244),Cr=s(72313);const Fr=e=>{let{value:t,onChange:s,placeholder:n="Enter address",className:r="",icon:i=null}=e;const o=(0,a.useRef)(null),l=(0,a.useRef)(null);(0,a.useEffect)(()=>((async()=>{try{await new Promise((e,t)=>{if(window.google&&window.google.maps&&window.google.maps.places)return void e();if(document.querySelector('script[src*="maps.googleapis.com"]')){const t=setInterval(()=>{window.google&&window.google.maps&&window.google.maps.places&&(clearInterval(t),e())},100);return}const s=document.createElement("script");s.src="https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyBoyKzaLnNGgUrfkRYrW9maAFOmHRVcfys","&libraries=places"),s.async=!0,s.defer=!0,s.onload=()=>{setTimeout(e,100)},s.onerror=t,document.head.appendChild(s)}),o.current&&window.google&&window.google.maps&&window.google.maps.places&&
1(l.current&&window.google.maps.event.clearInstanceListeners(l.current),l.current=new window.google.maps.places.Autocomplete(o.current,{types:["address"],componentRestrictions:{country:"AU"},fields:["formatted_address","address_components","geometry","place_id"]}),l.current.addListener("place_changed",()=>{const e=l.current.getPlace();e&&e.formatted_address&&s(e.formatted_address)}))}catch(e){console.error("Error loading Google Maps:",e)}})(),()=>{if(l.current&&window.google)try{window.google.maps.event.clearInstanceListeners(l.current)}catch(e){}}),[s]);return(0,f.jsxs)("div",{className:"relative",children:[i&&(0,f.jsx)("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400",children:i}),(0,f.jsx)("input",{ref:o,type:"text",value:t||"",onChange:e=>{s(e.target.value)},placeholder:n,className:r,autoComplete:"off"})]})},Er="'Space Mono',monospace",Tr={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},zr="#BF212F",Br="#BE185D",Dr={width:"100%",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"10px 12px",fontSize:13.5,color:"#0A0A0B",outline:"none",fontFamily:"'Hanken Grotesk',sans-serif",boxSizing:"border-box"},Ir={display:"block",fontSize:12.5,fontWeight:600,color:"#55555C",marginBottom:6},Rr=((0,m.A)((0,m.A)({},Tr),{},{padding:22,marginBottom:0}),{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,color:"#0A0A0B",margin:"0 0 16px"}),Pr=()=>{var e,t,s,n,i;(0,r.Zp)();const[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null),[x,u]=(0,a.useState)({email:"",password:""}),[b,y]=(0,a.useState)(""),[v,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)([]),[A,k]=(0,a.useState)([]),[S,F]=(0,a.useState)([]),[z,B]=(0,a.useState)("clients"),[D,R]=(0,a.useState)(!1),[P,W]=(0,a.useState)(null),[O,L]=(0,a.useState)(!1),[M,q]=(0,a.useState)(!1),[H,U]=(0,a.useState)(""),[G,V]=(0,a.useState)(""),[J,Y]=(0,a.useState)(""),[K,Z]=(0,a.useState)(!0),[$,Q]=(0,a.useState)(!1),[X,ee]=(0,a.useState)(null),[te,se]=(0,a.useState)(!1),[ae,ne]=(0,a.useState)(!1),[re,ie]=(0,a.useState)({}),[oe,le]=(0,a.useState)(!1),[ce,de]=(0,a.useState)(""),[me,pe]=(0,a.useState)(!1),[xe,he]=(0,a.useState)(!1),[ue,ge]=(0,a.useState)(!1),[fe,be]=(0,a.useState)(!1),[ye,ve]=(0,a.useState)(!1),[je,we]=(0,a.useState)(null),[Ne,Ae]=(0,a.useState)(null),[ke,Se]=(0,a.useState)(!1),[_e,Ce]=(0,a.useState)(!1),[Fe,Ee]=(0,a.useState)(null),[Te,ze]=(0,a.useState)(!1),[Be,De]=(0,a.useState)(!1),[Ie,Re]=(0,a.useState)(!1),[Pe,We]=(0,a.useState)(!1),[Oe,Le]=(0,a.useState)(null),[Me,qe]=(0,a.useState)(""),[He,Ve]=(0,a.useState)("upcoming"),[Je,Ke]=(0,a.useState)(!1),[Ze,$e]=(0,a.useState)([]),[Qe,et]=(0,a.useState)(!1),tt=(e,t)=>{const s=Ze.find(t=>t.id===e);s&&("photographer"===t?ie((0,m.A)((0,m.A)({},re),{},{photographer_name:"".concat(s.first_name," ").concat(s.last_name),photographer_contact:s.mobile_number||"",photographer_email:s.email||""})):"videographer"===t&&ie((0,m.A)((0,m.A)({},re),{},{videographer_name:"".concat(s.first_name," ").concat(s.last_name),videographer_contact:s.mobile_number||"",videographer_email:s.email||""})))};(0,a.useEffect)(()=>{const e=localStorage.getItem("turbo360_admin_auth");if(e)try{const t=JSON.parse(e);return d(t.token),l(!0),void rt(t.token)}catch(s){console.error("Error parsing unified auth:",s)}const t=localStorage.getItem("wedding_admin_token");t&&(d(t),l(!0),rt(t))},[]),(0,a.useEffect)(()=>{"settings"===z&&c&&!P&&it(c)},[z,c]);const nt=async e=>{e.preventDefault(),j(!0),y("");try{const e=await fetch("".concat(I.fn,"/api/wedding-admin/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x)}),t=await e.json();t.success&&t.token?(localStorage.setItem("wedding_admin_token",t.token),d(t.token),l(!0),rt(t.token)):y(t.message||"Login failed")}catch(t){console.error("Login error:",t),y("Network error occurred")}finally{j(!1)}},rt=async e=>{R(!0);try{const[t,s,a]=await Promise.all([fetch("".concat(I.fn,"/api/wedding-admin/clients"),{headers:{Authorization:"Bearer ".concat(e)}}),fetch("".concat(I.fn,"/api/wedding-admin/forms"),{headers:{Authorization:"Bearer ".concat(e)}}),fetch("".concat(I.fn,"/api/wedding-admin/bookings"),{headers:{Authorization:"Bearer ".concat(e)}})]);if((async e=>{et(!0);try{const t=await fetch("".concat(I.fn,"/api/crew"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json();$e(e||[])}}catch(t){console.error("Error loading crew members:",t)}finally{et(!1)}})(e),t.ok){const e=await t.json();N(e.clients||[])}if(s.ok){const e=await s.json();k(e.forms||[])}if(a.ok){const e=await a.json();F(e.bookings||[])}}catch(t){console.error("Error loading dashboard data:",t)}finally{R(!1)}},it=async e=>{L(!0),U("");try{const t=await fetch("".concat(I.fn,"/api/wedding-admin/settings"),{headers:{Authorization:"Bearer ".concat(e)}});if(!t.ok)throw new Error("Failed to load settings");{const e=await t.json();W(e.settings)}}catch(t){console.error("Error loading settings:",t),U("Failed to load settings")}finally{L(!1)}},ot=async()=>
1{if(!X)return alert("\u26a0\ufe0f Please select a wedding form first"),void console.error("No form selected for sharing");console.log("Generating share link for form:",X.id),console.log("Auth token:",c?"Present":"Missing"),pe(!0);try{const e=await fetch("".concat(I.fn,"/api/wedding-admin/forms/").concat(X.id,"/share"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(c)}});console.log("Share API response status:",e.status);const t=await e.json();console.log("Share API response data:",t),e.ok&&t.success&&t.share_url?(de(t.share_url),he(!0),console.log("\u2705 Share link generated successfully:",t.share_url),t.friendly_url&&console.log("\ud83d\udcce Friendly URL:",t.friendly_url)):(console.error("\u274c Error generating share link:",t.message||"Unknown error"),alert("\u274c Failed to generate share link:\n\n".concat(t.message||"Please try again")))}catch(e){console.error("\u274c Generate share link error:",e),alert("\u274c Network error: Unable to generate share link.\n\nPlease check your connection and try again.")}finally{pe(!1)}},lt=e=>e?new Date(e).toLocaleString():"N/A",ct=e=>e.is_finalized?{status:"Completed",color:"green",icon:p.A}:e.updated_at&&e.updated_at!==e.created_at?{status:"In Progress",color:"yellow",icon:h.A}:{status:"Draft",color:"gray",icon:kt.A},dt=()=>{window.print()},mt=async()=>{if(X&&X.id){De(!0),Le(null);try{const e=await fetch("".concat(I.fn,"/api/wedding-admin/forms/").concat(X.id,"/send-crew-emails"),{method:"POST",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"}}),t=await e.json();Le(t),t.success&&setTimeout(()=>Le(null),5e3)}catch(e){console.error("Failed to send crew emails:",e),Le({success:!1,message:"Failed to send emails. Please try again.",errors:["Network error"]})}finally{De(!1)}}};if(!o)return(0,f.jsx)("div",{className:"wedding-admin-container",style:{minHeight:"100vh",background:"#EDEDF0",display:"flex",alignItems:"center",justifyContent:"center",padding:16,fontFamily:"'Hanken Grotesk',sans-serif"},children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Tr),{},{padding:32,width:"100%",maxWidth:420,boxShadow:"0 12px 40px rgba(10,10,11,.08)"}),children:[(0,f.jsxs)("div",{style:{textAlign:"center",marginBottom:28},children:[(0,f.jsx)("img",{src:jn,alt:"Turbo 360",style:{height:48,width:"auto",margin:"0 auto 18px",display:"block"}}),(0,f.jsx)("h1",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:800,fontSize:22,letterSpacing:"-0.01em",color:"#0A0A0B",margin:0},children:"Wedding Admin"}),(0,f.jsx)("p",{style:{fontFamily:Er,fontSize:10.5,letterSpacing:"0.12em",textTransform:"uppercase",color:"#9A9AA0",marginTop:8},children:"MEDIA \xb7 WEDDINGS"})]}),(0,f.jsxs)("form",{onSubmit:nt,style:{display:"flex",flexDirection:"column",gap:18},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Ir,children:"Email Address"}),(0,f.jsx)("input",{type:"email",required:!0,style:Dr,placeholder:"[email protected]",value:x.email,onChange:e=>u((0,m.A)((0,m.A)({},x),{},{email:e.target.value}))})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Ir,children:"Password"}),(0,f.jsx)("input",{type:"password",required:!0,style:Dr,placeholder:"Enter your password",value:x.password,onChange:e=>u((0,m.A)((0,m.A)({},x),{},{password:e.target.value}))})]}),b&&(0,f.jsx)("div",{style:{background:"#FEE2E2",border:"1px solid #FECACA",borderRadius:9,padding:12},children:(0,f.jsx)("p",{style:{fontSize:13,color:"#991B1B",margin:0},children:b})}),(0,f.jsx)("button",{type:"submit",disabled:v,style:{width:"100%",background:zr,color:"#fff",fontWeight:600,fontSize:14,padding:"12px 16px",borderRadius:9,border:"none",cursor:"pointer",opacity:v?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:v?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{width:18,height:18,border:"2px solid #fff",borderTopColor:"transparent",borderRadius:"50%"},className:"animate-spin"}),(0,f.jsx)("span",{children:"Logging in..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{children:"Sign In"}),(0,f.jsx)(fs.A,{className:"h-5 w-5"})]})})]})]})});var pt,xt,ht,ut;if(te&&X)return(0,f.jsxs)("div",{className:"wedding-runsheet-page min-h-screen bg-gradient-to-br from-slate-50 via-white to-rose-50",children:[(0,f.jsx)("div",{className:"bg-white/80 backdrop-blur-md shadow-sm border-b border-gray-100 print:shadow-none print:bg-white sticky top-0 z-50",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4",children:(0,f.jsxs)("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between lg:justify-start gap-4",children:[(0,f.jsxs)("button",{onClick:()=>se(!1),className:"text-gray-500 hover:text-gray-900 flex items-center gap-2 text-sm font-medium transition-colors no-print group",children:[(0,f.jsx)(Ct.A,{className:"h-4 w-4 group-hover:-translate-x-1 transition-transform"}),(0,f.jsx)("span",{children:"Back"})]}),(0,f.jsx)("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-gray-50 border border-gray-200",children:(()=>{const{status:e,color:t,icon:s}=ct(X);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(s,{className:"h-4 w-4 text-".concat(t,"-500")}),(0,f.jsx)("span",{className:"text-".concat(t,"-600 font-medium text-sm"),children:e})]})})()})]}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-2 no-print",children:[(0,f.jsxs)("button",{onClick:()=>{ie(X),ne(!0)},className:"flex items-center gap-1.5 bg-emerald-600 hover:bg-emerald-700 text-white px-3 py-2 rounded-lg text-sm font-medium transition-all hover:shadow-md",children:[(0,f.jsx)(Tn.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"Edit"})]}),(0,f.jsxs)("button",{onClick:()=>{return e=X,sessionStorage.setItem("adminEditingForm",JSON.stringify({clientEmail:e.client_email,isAdminEditing:!0})),void(window.location.href="/weddingform");var e},className:"flex items-center gap-1.5 bg-amber-500 hover:bg-amber-600 text-white px-3 py-2 rounded-lg text-sm font-medium transition-all hover:shadow-md",children:[(0,f.jsx)(Ye.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"Edit as User"})]}),(0,f.jsxs)("button",{onClick:ot,disabled:me,className:"flex items-center gap-1.5 bg-blue-600 hover:bg-blue-700 text-white px-3 py-2 rounded-lg text-sm font-medium transition-all hover:shadow-md disabled:opacity-50",children:[(0,f.jsx)(at.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:me?"Sharing...":"Share"})]}),(0,f.jsxs)("button",{onClick:dt,className:"flex items-center gap-1.5 bg-vi
1olet-600 hover:bg-violet-700 text-white px-3 py-2 rounded-lg text-sm font-medium transition-all hover:shadow-md",children:[(0,f.jsx)(Sr.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"Print"})]}),(0,f.jsxs)("button",{onClick:mt,disabled:Be||!(null!==X&&void 0!==X&&X.photographer_email)&&!(null!==X&&void 0!==X&&X.videographer_email),className:"flex items-center gap-1.5 bg-teal-600 hover:bg-teal-700 disabled:bg-gray-400 text-white px-3 py-2 rounded-lg text-sm font-medium transition-all hover:shadow-md disabled:opacity-50",title:null!==X&&void 0!==X&&X.photographer_email||null!==X&&void 0!==X&&X.videographer_email?"Send timeline via email to crew members":"Add crew email addresses to enable",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:Be?"Sending...":"Email Crew"})]}),(0,f.jsxs)("button",{onClick:()=>We(!0),disabled:Ie||!(null!==X&&void 0!==X&&X.email_address),className:"flex items-center gap-1.5 bg-rose-600 hover:bg-rose-700 disabled:bg-gray-400 text-white px-3 py-2 rounded-lg text-sm font-medium transition-all hover:shadow-md disabled:opacity-50",title:null!==X&&void 0!==X&&X.email_address?"Send runsheet to client":"Client email not available",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:Ie?"Sending...":"Email Client"})]})]})]})})}),Oe&&(0,f.jsx)("div",{className:"max-w-5xl mx-auto px-6 mb-4",children:(0,f.jsx)("div",{className:"p-4 rounded-lg border ".concat(Oe.success?"bg-green-50 border-green-200":"bg-red-50 border-red-200"),children:(0,f.jsxs)("div",{className:"flex items-start space-x-3",children:[Oe.success?(0,f.jsx)(p.A,{className:"h-5 w-5 text-green-600 mt-0.5"}):(0,f.jsx)(h.A,{className:"h-5 w-5 text-red-600 mt-0.5"}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"font-medium ".concat(Oe.success?"text-green-800":"text-red-800"),children:Oe.message}),Oe.emails_sent&&Oe.emails_sent.length>0&&(0,f.jsx)("ul",{className:"mt-2 text-sm text-green-700",children:Oe.emails_sent.map((e,t)=>(0,f.jsxs)("li",{children:["\u2713 ",e]},t))}),Oe.errors&&Oe.errors.length>0&&(0,f.jsx)("ul",{className:"mt-2 text-sm text-red-700",children:Oe.errors.map((e,t)=>(0,f.jsxs)("li",{children:["\u2717 ",e]},t))})]}),(0,f.jsx)("button",{onClick:()=>Le(null),className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-4 w-4"})})]})})}),(0,f.jsx)("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-8 print:p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl overflow-hidden print-area print:shadow-none print:rounded-none",children:[(0,f.jsxs)("div",{className:"relative bg-gradient-to-br from-rose-500 via-pink-500 to-rose-600 text-white px-8 py-12 print:bg-rose-500",children:[(0,f.jsxs)("div",{className:"absolute inset-0 opacity-10 print:hidden",children:[(0,f.jsx)("div",{className:"absolute top-0 left-0 w-64 h-64 bg-white rounded-full -translate-x-1/2 -translate-y-1/2"}),(0,f.jsx)("div",{className:"absolute bottom-0 right-0 w-96 h-96 bg-white rounded-full translate-x-1/3 translate-y-1/3"})]}),(0,f.jsxs)("div",{className:"relative text-center",children:[(0,f.jsx)("div",{className:"mb-6",children:(0,f.jsx)("img",{src:jn,alt:"Turbo 360",className:"mx-auto h-12 w-auto brightness-0 invert"})}),(0,f.jsx)("div",{className:"inline-block bg-white/20 backdrop-blur-sm px-5 py-1.5 rounded-full text-sm font-semibold tracking-wider mb-6 border border-white/30",children:"WEDDING RUN SHEET"}),(0,f.jsxs)("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold mb-4 tracking-tight",children:[X.first_name," ",X.last_name,(0,f.jsx)("span",{className:"block sm:inline text-white/80 mx-2 sm:mx-4",children:"&"}),(0,f.jsxs)("span",{className:"block sm:inline",children:[X.partner_first_name," ",X.partner_last_name]})]}),X.wedding_date&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)("div",{className:"text-xl sm:text-2xl font-light opacity-95",children:new Date(X.wedding_date).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),X.service_type&&(0,f.jsx)("div",{className:"inline-block bg-white/25 px-4 py-1 rounded-full text-sm font-medium",children:X.service_type})]}),(0,f.jsxs)("div",{className:"flex flex-wrap justify-center gap-4 sm:gap-8 mt-8 text-sm",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 bg-white/15 px-4 py-2 rounded-full",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:X.mobile_number})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2 bg-white/15 px-4 py-2 rounded-full",children:[(0,f.jsx)(Xe.A,{className:"h-4 w-4"}),(0,f.jsxs)("span",{children:[X.guest_count," guests"]})]})]})]})]}),(0,f.jsxs)("div",{className:"px-6 sm:px-8 py-10",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-8",children:[(0,f.jsx)("div",{className:"p-2 bg-rose-100 rounded-xl",children:(0,f.jsx)(Nt.A,{className:"h-6 w-6 text-rose-600"})}),(0,f.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Wedding Day Timeline"})]}),(0,f.jsxs)("div",{className:"relative space-y-4",children:[(0,f.jsx)("div",{className:"absolute left-[22px] top-4 bottom-4 w-0.5 bg-gradient-to-b from-rose-300 via-pink-300 to-purple-300 print:bg-gray-300"}),(()=>{const e=[];var t,s,a;X.prep_start_time&&e.push({time:X.prep_start_time,type:"prep",component:(0,f.jsxs)("div",{className:"relative flex gap-4 pl-2",children:[(0,f.jsx)("div",{className:"relative z-10 flex-shrink-0 w-11 h-11 rounded-full bg-gradient-to-br from-blue-400 to-blue-600 flex items-center justify-center shadow-lg ring-4 ring-white",children:(0,f.jsx)("span",{className:"text-white text-xs font-bold",children:null===(t=X.prep_start_time)||void 0===t?void 0:t.slice(0,5)})}),(0,f.jsxs)("div",{className:"flex-1 bg-gradient-to-br from-blue-50 to-slate-50 rounded-xl p-5 shadow-sm border border-blue-100 hover:shadow-md transition-shadow",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-blue-600 bg-blue-100 px-2.5 py-0.5 rounded-full uppercase tracking-wide",children:"Preparation"}),(0,f.jsxs)("span",{className:"text-xs text-gray-500",children:["until ",X.prep_end_time||"TBD"]})]}),(0,f.jsx)("h3",{className:"font-bold text-gray-900 text-lg mb-1",children:"Getting Ready"}),(0,f.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-600 text-sm",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-blue-500"}),(0,f.jsx)("span",{children:X.prep_address})]}),(0,f.jsx)("div",{className:"mt-4 bg-white/70 rounded-lg p-3 border border-blue-100",children:(0,f.jsxs)("div",{className:"text-sm space-y-1",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Ye.A,{className:"h-3.5 w-3.5 text-gray-400"}),(0,f.jsxs)("span",{className:"font-medium text-gray-700",children:[X.first_name," ",X.last_name]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(E.A,{className:"h-3.5 w-3.5 text-gray-400"}),(0,f.jsx)("span",{className:"text-gray-600",children:X.mobile_number||"Not provided"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(T.A,{className:"h-3.5 w-3.5 text-gray-400"}),(0,f.jsx)("span",{className:"text-gray-600",children:X.email_address||"Not provided"})]})]})}),X.prep_additional_notes&&(0,f.jsxs)("div",{className:"mt-3 bg-amber-50 border border-amber-200 rounded-lg p-3",children:[(0,f.jsx)("div",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide mb-1",children:"Special Notes"}),(0,f.jsx)("div",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:X.prep_additional_notes})]})]})]})});X.partner_prep_start_time&&X.partner_prep_address!==X.prep_address&&e.push({time:X.partner_prep_start_time,type:"partner_prep",component:(0,f.jsxs)("div",{className:"relative flex gap-4 pl-2",children:[(0,f.jsx)("div",{className:"relative z-10 flex-shrink-0 w-11 h-11 rounded-full bg-gradient-to-br from-teal-400 to-teal-600 flex items-center justify-center shadow-lg ring-4 ring-white",children:(0,f.jsx)("span",{className:"text-white text-xs font-bold",children:null===(s=X.partner_prep_start_time)||void 0===s?void 0:s.slice(0,5)})}),(0,f.jsxs)("div",{className:"flex-1 bg-gradient-to-br from-teal-50 to-slate-50 rounded-xl p-5 shadow-sm border border-teal-100 hover:shadow-md transition-shadow",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-teal-600 bg-teal-100 px-2.5 py-0.5 rounded-full uppercase tracking-wide",children:"Partner Prep"}),(0,f.jsxs)("span",{className:"text-xs text-gray-500",children:["until ",X.partner_prep_end_time||"TBD"]})]}),(0,f.jsx)("h3",{className:"font-bold text-gray-900 text-lg mb-1",children:"Partner Getting Ready"}),(0,f.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-600 text-sm",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-teal-500"}),(0,f.jsx)("span",{children:X.partner_prep_address})]}),(0,f.jsx)("div",{className:"mt-4 bg-white/70 rounded-lg p-3 border border-teal-100",children:(0,f.jsxs)("div",{className:"text-sm space-y-1",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Ye.A,{className:"h-3.5 w-3.5 text-gray-400"}),(0,f.jsxs)("span",{className:"font-medium text-gray-700",children:[X.partner_first_name," ",X.partner_last_name]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(E.A,{className:"h-3.5 w-3.5 text-gray-400"}),(0,f.jsx)("span",{className:"text-gray-600",children:X.partner_mobile_number||"Not provided"})]})]})}),X.partner_prep_additional_notes&&(0,f.jsxs)("div",{className:"mt-3 bg-amber-50 border border-amber-200 rounded-lg p-3",children:[(0,f.jsx)("div",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide mb-1",children:"Special Notes"}),(0,f.jsx)("div",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:X.partner_prep_additional_notes})]})]})]})});(X.ceremony_start_time&&e.push({time:X.ceremony_start_time,type:"ceremony",component:(0,f.jsxs)("div",{className:"relative flex gap-4 pl-2",children:[(0,f.jsx)("div",{className:"relative z-10 flex-shrink-0 w-11 h-11 rounded-full bg-gradient-to-br from-rose-400 to-rose-600 flex items-center justify-center shadow-lg ring-4 ring-white",children:(0,f.jsx)(fs.A,{className:"h-5 w-5 text-white"})}),(0,f.jsxs)("div",{className:"flex-1 bg-gradient-to-br from-rose-50 to-pink-50 rounded-xl p-5 shadow-sm border border-rose-200 hover:shadow-md transition-shadow",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-rose-600 bg-rose-100 px-2.5 py-0.5 rounded-full uppercase tracking-wide",children:"Ceremony"}),(0,f.jsx)("span",{className:"text-xs font-bold text-rose-500",children:X.ceremony_start_time})]}),(0,f.jsx)("h3",{className:"font-bold text-gray-900 text-xl mb-2",children:"Wedding Ceremony"}),(0,f.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-600 text-sm mb-3",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-rose-500"}),(0,f.jsx)("span",{children:X.ceremony_address})]}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-3 text-sm",children:[(0,f.jsxs)("div",{className:"bg-white/70 px-3 py-1.5 rounded-lg border border-rose-100",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"Location:"})," ",(0,f.jsx)("span",{className:"font-medium text-gray-700",children:X.ceremony_location_type})]}),X.celebrant_name&&(0,f.jsxs)("div",{className:"bg-white/70 px-3 py-1.5 rounded-lg border border-rose-100",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"Celebrant:"})," ",(0,f.jsx)("span",{className:"font-medium text-gray-700",children:X.celebrant_name})]})]}),X.ceremony_type_special_events&&(0,f.jsxs)("div",{className:"mt-4 bg-amber-50 border border-amber-200 rounded-lg p-3",children:[(0,f.jsx)("div",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide mb-1",children:"Special Notes"}),(0,f.jsx)("div",{className:"text-sm text-gray-700",children:X.ceremony_type_special_events})]})]})]})}),X.bridal_party_introduction_time)&&e.push({time:X.bridal_party_introduction_time,type:"reception",component:(0,f.jsxs)("div",{className:"relative flex gap-4 pl-2",children:[(0,f.jsx)("div",{className:"relative z-10 flex-shrink-0 w-11 h-11 rounded-full bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center shadow-lg ring-4 ring-white",children:(0,f.jsx)("span",{className:"text-white text-xs font-bold",children:null===(a=X.bridal_party_introduction_time)||void 0===a?void 0:a.slice(0,5)})}),(0,f.jsxs)("div",{className:"flex-1 bg-gradient-to-br from-amber-50 to-orange-50 rounded-xl p-5 shadow-sm border border-amber-200 hover:shadow-md transition-shadow",children:[(0,f.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,f.jsx)("span",{className:"text-xs font-semibold text-amber-700 bg-amber-100 px-2.5 py-0.5 rounded-full uppercase tracking-wide",children:"Reception"})}),(0,f.jsx)("h3",{className:"font-bold text-gray-900 text-lg mb-1",children:"Reception Begins"}),(0,f.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-600 text-sm",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-amber-500"}),(0,f.jsx)("span",{children:X.reception_venue_address})]}),X.reception_special_events&&(0,f.jsxs)("div",{className:"mt-4 bg-amber-100/50 border border-amber-200 rounded-lg p-3",children:[(0,f.jsx)("div",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide mb-1",children:"Reception Events"}),(0,f.jsx)("div",{className:"text-sm text-gray-700",children:X.reception_special_events})]})]})]})});
1return X.coverage_finish_time&&e.push({time:X.coverage_finish_time,type:"coverage_finish",component:(0,f.jsxs)("div",{className:"relative flex gap-4 pl-2",children:[(0,f.jsx)("div",{className:"relative z-10 flex-shrink-0 w-11 h-11 rounded-full bg-gradient-to-br from-violet-400 to-purple-600 flex items-center justify-center shadow-lg ring-4 ring-white",children:(0,f.jsx)(p.A,{className:"h-5 w-5 text-white"})}),(0,f.jsxs)("div",{className:"flex-1 bg-gradient-to-br from-violet-50 to-purple-50 rounded-xl p-5 shadow-sm border border-violet-200 hover:shadow-md transition-shadow",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-violet-600 bg-violet-100 px-2.5 py-0.5 rounded-full uppercase tracking-wide",children:"Finish"}),(0,f.jsx)("span",{className:"text-xs font-bold text-violet-500",children:X.coverage_finish_time})]}),(0,f.jsx)("h3",{className:"font-bold text-gray-900 text-lg",children:"Coverage Complete"}),(0,f.jsx)("p",{className:"text-gray-600 text-sm mt-1",children:"Photography/videography coverage concludes"})]})]})}),e.sort((e,t)=>{const s=e=>{if(!e)return 0;const[t,s]=e.split(":").map(Number);return 60*t+s};return s(e.time)-s(t.time)}),e.map((e,t)=>(0,f.jsx)("div",{children:e.component},"".concat(e.type,"-").concat(t)))})()]})]}),(0,f.jsxs)("div",{className:"grid lg:grid-cols-2 gap-6 mb-8",children:[(0,f.jsxs)("div",{className:"bg-yellow-50 rounded-lg p-6",children:[(0,f.jsxs)("h3",{className:"text-lg font-semibold text-yellow-900 mb-4 flex items-center",children:[(0,f.jsx)(E.A,{className:"h-5 w-5 mr-2"}),"Important Contacts"]}),(0,f.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-medium text-gray-700",children:"Best Man:"}),(0,f.jsx)("p",{className:"text-gray-900",children:X.best_man_name||"Not provided"}),X.best_man_contact&&(0,f.jsx)("p",{className:"text-xs text-gray-500",children:X.best_man_contact})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-medium text-gray-700",children:"Maid of Honor:"}),(0,f.jsx)("p",{className:"text-gray-900",children:X.maid_of_honor_name||"Not provided"}),X.maid_of_honor_contact&&(0,f.jsx)("p",{className:"text-xs text-gray-500",children:X.maid_of_honor_contact})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-medium text-gray-700",children:"Guest Count:"}),(0,f.jsx)("p",{className:"text-gray-900",children:X.guest_count||"Not specified"})]}),(0,f.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mt-4",children:[(0,f.jsx)("div",{className:"font-medium text-red-800 mb-2",children:"\ud83d\udea8 TURBO 360 EMERGENCY CONTACT"}),(0,f.jsxs)("div",{className:"text-red-700 space-y-1",children:[(0,f.jsxs)("div",{children:["\ud83d\udcde Call: ",(0,f.jsx)("strong",{children:"1300 207 446"})]}),(0,f.jsxs)("div",{children:["\ud83d\udce7 Email: ",(0,f.jsx)("strong",{children:"[email protected]"})]})]})]})]})]}),(0,f.jsxs)("div",{className:"bg-purple-50 rounded-lg p-6",children:[(0,f.jsxs)("h3",{className:"text-lg font-semibold text-purple-900 mb-4 flex items-center",children:[(0,f.jsx)(kt.A,{className:"h-5 w-5 mr-2"}),"Crew Information"]}),(0,f.jsxs)("div",{className:"space-y-4 text-sm",children:[X.bridal_party_photo_locations&&(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-medium text-gray-700",children:"Photo Locations:"}),(0,f.jsx)("p",{className:"mt-1 text-gray-900",children:X.bridal_party_photo_locations})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-medium text-gray-700",children:"Reference Documents:"}),(0,f.jsxs)("div",{className:"mt-2 space-y-2",children:[X.family_photo_combinations_file&&(0,f.jsxs)("div",{className:"flex items-center justify-between bg-white p-3 rounded-lg border",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)(Ue.A,{className:"h-5 w-5 text-purple-600"}),(0,f.jsx)("span",{className:"font-medium text-gray-900",children:"Family Photo Combinations List"})]}),(0,f.jsxs)("a",{href:"object"===typeof X.family_photo_combinations_file&&X.family_photo_combinations_file.download_url?X.family_photo_combinations_file.download_url:null!==(pt=X.family_photo_combinations_file)&&void 0!==pt&&null!==(xt=pt.startsWith)&&void 0!==xt&&xt.call(pt,"/")?"".concat(I.fn,"/api/wedding-files/download/").concat(X.family_photo_combinations_file.split("/").pop()):"".concat(I.fn,"/api/wedding-files/download/").concat(X.family_photo_combinations_file),target:"_blank",rel:"noopener noreferrer",download:!0,className:"bg-purple-600 hover:bg-purple-700 px-3 py-1 rounded text-sm font-medium flex items-center space-x-1",style:{color:"#ffffff"},children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]}),X.reception_runsheet_file&&(0,f.jsxs)("div",{className:"flex items-center justify-between bg-white p-3 rounded-lg border",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)(kt.A,{className:"h-5 w-5 text-purple-600"}),(0,f.jsx)("span",{className:"font-medium text-gray-900",children:"Reception Runsheet"})]}),(0,f.jsxs)("a",{href:"object"===typeof X.reception_runsheet_file&&X.reception_runsheet_file.download_url?X.reception_runsheet_file.download_url:null!==(ht=X.reception_runsheet_file)&&void 0!==ht&&null!==(ut=ht.startsWith)&&void 0!==ut&&ut.call(ht,"/")?"".concat(I.fn,"/api/wedding-files/download/").concat(X.reception_runsheet_file.split("/").pop()):"".concat(I.fn,"/api/wedding-files/download/").concat(X.reception_runsheet_file),target:"_blank",rel:"noopener noreferrer",download:!0,className:"bg-purple-600 hover:bg-purple-700 px-3 py-1 rounded text-sm font-medium flex items-center space-x-1",style:{color:"#ffffff"},children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-medium text-gray-700",children:"Crew Meal Provided:"}),(0,f.jsx)("p",{className:"text-gray-900",children:!0===X.crew_meal_provided?"Yes":!1===X.crew_meal_provided?"No":"Not specified"})]}),X.additional_notes&&(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-medium text-gray-700",children:"Additional Notes:"}),(0,f.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-gray-900",children:X.additional_notes})]}),(X.photographer_name||X.videographer_name)&&(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-medium text-gray-700",children:"Assigned Crew:"}),(0,f.jsxs)("div",{className:"mt-2 space-y-2",children:[X.photographer_name&&(0,f.jsxs)("div",{className:"bg-white p-3 rounded border",children:[(0,f.jsxs)("p",{className:"font-medium text-gray-900",children:["Photographer: ",X.photographer_name]}),X.photographer_contact&&(0,f.jsxs)("p",{className:"text-sm text-gray-600",children:["Contact: ",X.photographer_contact]}),X.photographer_email&&(0,f.jsxs)("p",{className:"text-sm text-gray-600",children:["Email: ",X.photographer_email]})]}),X.videographer_name&&(0,f.jsxs)("div",{className:"bg-white p-3 rounded border",children:[(0,f.jsxs)("p",{className:"font-medium text-gray-900",children:["Videographer: ",X.videographer_name]}),X.videographer_contact&&(0,f.jsxs)("p",{className:"text-sm text-gray-600",children:["Contact: ",X.videographer_contact]}),X.videographer_email&&(0,f.jsxs)("p",{className:"text-sm text-gray-600",children:["Email: ",X.videographer_email]})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-medium text-gray-700",children:"Form Status:"}),(0,f.jsx)("p",{className:"text-gray-900",children:X.is_finalized?"Finalized":"Draft"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-medium text-gray-700",children:"Last Updated:"}),(0,f.jsx)("p",{className:"text-gray-900",children:lt(X.updated_at)})]})]})]})]}),X.timeline_photos&&X.timeline_photos.length>0&&(0,f.jsx)("div",{className:"mb-8",children:(0,f.jsxs)("div",{className:"bg-rose-50 rounded-lg p-6",children:[(0,f.jsxs)("h3",{className:"text-lg font-semibold text-rose-900 mb
1-4 flex items-center",children:[(0,f.jsx)(_.A,{className:"h-5 w-5 mr-2"}),"Timeline Photos"]}),(0,f.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:X.timeline_photos.map((e,t)=>(0,f.jsxs)("div",{className:"bg-white p-2 rounded-lg border",children:[(0,f.jsx)("img",{src:e.url,alt:e.caption||"Timeline photo ".concat(t+1),className:"w-full h-32 object-cover rounded"}),e.caption&&(0,f.jsx)("p",{className:"text-xs text-gray-600 mt-2 text-center",children:e.caption})]},t))})]})})]})}),ae&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4",style:{zIndex:9999},children:(0,f.jsxs)("div",{className:"bg-white rounded-lg shadow-xl w-full max-w-6xl max-h-[90vh] overflow-y-auto",children:[(0,f.jsxs)("div",{className:"sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between",style:{zIndex:1e4},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Edit Wedding Details"}),(0,f.jsxs)("p",{className:"text-sm text-gray-600 mt-1",children:[re.first_name," ",re.last_name," & ",re.partner_first_name," ",re.partner_last_name]})]}),(0,f.jsx)("div",{className:"flex items-center space-x-3",children:(0,f.jsx)("button",{onClick:()=>ne(!1),className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-6 w-6"})})})]}),(0,f.jsx)("div",{className:"px-6 py-4",children:(0,f.jsxs)("div",{className:"space-y-8",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Wedding Date"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-1 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Date of Wedding"}),(0,f.jsx)("input",{type:"date",value:re.wedding_date||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{wedding_date:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Service Type"}),(0,f.jsxs)("select",{value:re.service_type||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{service_type:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent",children:[(0,f.jsx)("option",{value:"",children:"Select Service Type"}),(0,f.jsx)("option",{value:"Photography",children:"Photography"}),(0,f.jsx)("option",{value:"Videography",children:"Videography"}),(0,f.jsx)("option",{value:"Photo and Video Package",children:"Photo and Video Package"})]})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Personal Details"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Your First Name"}),(0,f.jsx)("input",{type:"text",value:re.first_name||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{first_name:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Your Last Name"}),(0,f.jsx)("input",{type:"text",value:re.last_name||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{last_name:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Mobile Number"}),(0,f.jsx)("input",{type:"tel",value:re.mobile_number||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{mobile_number:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email Address"}),(0,f.jsx)("input",{type:"email",value:re.email_address||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{email_address:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-800 mb
1-4",children:"Partner Details"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner First Name"}),(0,f.jsx)("input",{type:"text",value:re.partner_first_name||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{partner_first_name:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner Last Name"}),(0,f.jsx)("input",{type:"text",value:re.partner_last_name||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{partner_last_name:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner Mobile Number"}),(0,f.jsx)("input",{type:"tel",value:re.partner_mobile_number||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{partner_mobile_number:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Preparation Details"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"md:col-span-2",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Your Preparation Address"}),(0,f.jsx)(Fr,{value:re.prep_address||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{prep_address:e})),placeholder:"Where will you be getting ready?",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Prep Start Time"}),(0,f.jsx)(fn,{value:re.prep_start_time||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{prep_start_time:e})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Prep End Time"}),(0,f.jsx)(fn,{value:re.prep_end_time||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{prep_end_time:e})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{className:"md:col-span-2",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner Preparation Address"}),(0,f.jsx)(Fr,{value:re.partner_prep_address||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{partner_prep_address:e})),placeholder:"Where will your partner be getting ready?",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner Prep Start Time"}),(0,f.jsx)(fn,{value:re.partner_prep_start_time||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{partner_prep_start_time:e})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner Prep End Time"}),(0,f.jsx)(fn,{value:re.partner_prep_end_time||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{partner_prep_end_time:e})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{className:"md:col-span-2",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Your Additional Preparation Notes"}),(0,f.jsx)("textarea",{value:re.prep_additional_notes||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{prep_additional_notes:e.target.value})),placeholder:"Any special notes or details for your preparation coverage...",rows:"3",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{className:"md:col-span-2",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Partner Additional Preparation Notes"}),(0,f.jsx)("textarea",{value:re.partner_prep_additional_notes||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{partner_prep_additional_notes:e.target.value})),placeholder:"Any special notes or details for partner's preparation coverage...",rows:"3",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-800 mb
1-4",children:"Ceremony Details"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"md:col-span-2",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Ceremony Address"}),(0,f.jsx)(Fr,{value:re.ceremony_address||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{ceremony_address:e})),placeholder:"Ceremony venue address",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Ceremony Start Time"}),(0,f.jsx)(fn,{value:re.ceremony_start_time||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{ceremony_start_time:e})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Guest Count"}),(0,f.jsx)("input",{type:"number",value:re.guest_count||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{guest_count:parseInt(e.target.value)||""})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Location Type"}),(0,f.jsxs)("select",{value:re.ceremony_location_type||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{ceremony_location_type:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent",children:[(0,f.jsx)("option",{value:"",children:"Select location type"}),(0,f.jsx)("option",{value:"inside",children:"Inside"}),(0,f.jsx)("option",{value:"outside",children:"Outside"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Celebrant Name"}),(0,f.jsx)("input",{type:"text",value:re.celebrant_name||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{celebrant_name:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{className:"md:col-span-2",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Ceremony Special Events / Notes"}),(0,f.jsx)("textarea",{value:re.ceremony_type_special_events||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{ceremony_type_special_events:e.target.value})),placeholder:"Any special events, rituals, or requirements for the ceremony...",rows:"3",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]})]})]}),(0,f.jsxs)("div",{className:"bg-purple-50 rounded-xl p-6",children:[(0,f.jsxs)("h3",{className:"text-lg font-semibold text-gray-800 mb-4 flex items-center",children:[(0,f.jsx)(Ue.A,{className:"h-5 w-5 mr-2 text-purple-600"}),"Bridal Party Photo Locations"]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Photo Location Details"}),(0,f.jsx)("textarea",{value:re.bridal_party_photo_locations||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{bridal_party_photo_locations:e.target.value})),placeholder:"Describe any specific locations or photo spots for bridal party photos...",rows:"3",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Reception Details"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"md:col-span-2",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Reception Venue Address"}),(0,f.jsx)(Fr,{value:re.reception_venue_address||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{reception_venue_address:e})),placeholder:"Reception venue address",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Reception Start Time (Introductions)"}),(0,f.jsx)(fn,{value:re.bridal_party_introduction_time||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{bridal_party_introduction_time:e})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{className:"md:col-span-2",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Reception Special Events / Notes"}),(0,f.jsx)("textarea",{value:re.reception_special_events||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{reception_special_events:e.target.value})),placeholder:"Any special events, performances, or traditions during the reception...",rows:"3",className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-800 mb
1-4",children:"Important Contacts"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Best Man Name"}),(0,f.jsx)("input",{type:"text",value:re.best_man_name||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{best_man_name:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Best Man Contact"}),(0,f.jsx)("input",{type:"text",value:re.best_man_contact||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{best_man_contact:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Maid of Honor Name"}),(0,f.jsx)("input",{type:"text",value:re.maid_of_honor_name||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{maid_of_honor_name:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Maid of Honor Contact"}),(0,f.jsx)("input",{type:"text",value:re.maid_of_honor_contact||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{maid_of_honor_contact:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Crew Meal"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Will crew meal be provided?"}),(0,f.jsxs)("div",{className:"flex space-x-4",children:[(0,f.jsxs)("label",{className:"flex items-center",children:[(0,f.jsx)("input",{type:"radio",name:"crew_meal_provided",value:"true",checked:!0===re.crew_meal_provided,onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{crew_meal_provided:!0})),className:"mr-2"}),"Yes"]}),(0,f.jsxs)("label",{className:"flex items-center",children:[(0,f.jsx)("input",{type:"radio",name:"crew_meal_provided",value:"false",checked:!1===re.crew_meal_provided,onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{crew_meal_provided:!1})),className:"mr-2"}),"No"]})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"text-md font-medium text-gray-700 mb-3",children:"Coverage Details"}),(0,f.jsx)("div",{className:"grid md:grid-cols-3 gap-4",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Coverage Finish Time"}),(0,f.jsx)("input",{type:"time",value:re.coverage_finish_time||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{coverage_finish_time:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Document Management"}),(0,f.jsx)("div",{className:"mb-6",children:(0,f.jsx)(bn,{fileType:"family_photo_list",label:"Family Photo Combinations List",description:"Upload the family photo combinations document (PDF, DOC, DOCX)",currentFile:re.family_photo_combinations_file,onFileUploaded:e=>{ie((0,m.A)((0,m.A)({},re),{},{family_photo_combinations_file:e}))},onFileDeleted:()=>{ie((0,m.A)((0,m.A)({},re),{},{family_photo_combinations_file:null}))},authToken:c,clientId:null===X||void 0===X?void 0:X.client_email,disabled:!1})}),(0,f.jsx)("div",{className:"mb-6",children:(0,f.jsx)(bn,{fileType:"reception_runsheet",label:"Reception Runsheet",description:"Upload the reception runsheet document (PDF, DOC, DOCX)",currentFile:re.reception_runsheet_file,onFileUploaded:e=>{ie((0,m.A)((0,m.A)({},re),{},{reception_runsheet_file:e}))},onFileDeleted:()=>{ie((0,m.A)((0,m.A)({},re),{},{reception_runsheet_file:null}))},authToken:c,clientId:null===X||void 0===X?void 0:X.client_email,disabled:!1})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-800 mb
1-4",children:"Additional Notes"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Any additional notes or requirements"}),(0,f.jsx)("textarea",{rows:4,value:re.additional_notes||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{additional_notes:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-rose-500 focus:border-transparent",placeholder:"Any special requirements, notes, or important information..."})]})]}),(0,f.jsxs)("div",{className:"bg-blue-50 rounded-xl p-6",children:[(0,f.jsxs)("h3",{className:"text-lg font-semibold text-gray-800 mb-4 flex items-center",children:[(0,f.jsx)(Xe.A,{className:"h-5 w-5 mr-2 text-blue-600"}),"Crew Member Details"]}),(0,f.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Select crew members from the database or manually enter details."}),(0,f.jsxs)("div",{className:"mb-6 bg-white rounded-lg p-4 border border-blue-200",children:[(0,f.jsxs)("h4",{className:"text-md font-semibold text-gray-800 mb-3 flex items-center",children:[(0,f.jsx)(Ue.A,{className:"h-4 w-4 mr-2 text-blue-500"}),"Photographer"]}),(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Select from Crew Database"}),(0,f.jsxs)("select",{onChange:e=>{e.target.value&&tt(e.target.value,"photographer")},className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white",disabled:Qe,children:[(0,f.jsx)("option",{value:"",children:"-- Select a crew member to auto-fill --"}),Ze.map(e=>(0,f.jsxs)("option",{value:e.id,children:[e.first_name," ",e.last_name," ",e.mobile_number?"(".concat(e.mobile_number,")"):""]},e.id))]}),Qe&&(0,f.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Loading crew members..."})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-3 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Name"}),(0,f.jsx)("input",{type:"text",value:re.photographer_name||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{photographer_name:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Photographer's name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Contact Number"}),(0,f.jsx)("input",{type:"tel",value:re.photographer_contact||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{photographer_contact:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"0400 000 000"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email Address"}),(0,f.jsx)("input",{type:"email",value:re.photographer_email||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{photographer_email:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"[email protected]"})]})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-lg p-4 border border-blue-200",children:[(0,f.jsxs)("h4",{className:"text-md font-semibold text-gray-800 mb-3 flex items-center",children:[(0,f.jsx)(Ge.A,{className:"h-4 w-4 mr-2 text-blue-500"}),"Videographer"]}),(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Select from Crew Database"}),(0,f.jsxs)("select",{onChange:e=>{e.target.value&&tt(e.target.value,"videographer")},className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white",disabled:Qe,children:[(0,f.jsx)("option",{value:"",children:"-- Select a crew member to auto-fill --"}),Ze.map(e=>(0,f.jsxs)("option",{value:e.id,children:[e.first_name," ",e.last_name," ",e.mobile_number?"(".concat(e.mobile_number,")"):""]},e.id))]}),Qe&&(0,f.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Loading crew members..."})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-3 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Name"}),(0,f.jsx)("input",{type:"text",value:re.videographer_name||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{videographer_name:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Videographer's name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Contact Number"}),(0,f.jsx)("input",{type:"tel",value:re.videographer_contact||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{videographer_contact:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"0400 000 000"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email Address"}),(0,f.jsx)("input",{type:"email",value:re.videographer_email||"",onChange:e=>ie((0,m.A)((0,m.A)({},re),{},{videographer_email:e.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"[email protected]"})]})]})]})]})]})}),(0,f.jsxs)("div",{className:"sticky bottom-0 bg-white border-t border-gray-200 px-6 py-4 flex items-center justify-end space-x-3",children:[(0,f.jsx)("button",{onClick:()=>ne(!1),className:"px-4 py-2 text-gray-700 bg-gray-100 hover:bg-gray-200 rounded-lg",children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{le(!0);try{const e=await fetch("".concat(I.fn,"/api/wedding-admin/forms/").concat(re.id),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(c)},body:JSON.stringify(re)});if(e.ok){console.log("Form updated successfully!"),ne(!1),ie({});const t=await e.json();ee(t.form||re),rt(c)}else console.error("Error updating form"),alert("Failed to update form. Please try again.")}catch(e){console.error("Update form error:",e),alert("Network error. Please try again.")}finally{le(!1)}},disabled:oe,className:"flex items-center space-x-2 bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded-lg disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:oe?"Saving...":"Save Changes"})]})]})]})})]});const gt=(e,t,s)=>{const a=z===e;return(0,f.jsxs)("button",{onClick:()=>B(e),style:{display:"inline-flex",alignItems:"center",gap:8,whiteSpace:"nowrap",background:"none",border:"none",cursor:"pointer",padding:"16px 4px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,fontWeight:600,color:a?Br:"#9A9AA0",borderBottom:a?"2px solid ".concat(Br):"2px solid transparent",marginBottom:-1},children:[(0,f.jsx)(t,{size:16})," ",s]})};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ta,{title:"Weddings",meta:"MEDIA \xb7 WEDDINGS",children:(0,f.jsxs)("div",{className:"wedding-admin-container",style:{fontFamily:"'Hanken Grotesk',sans-serif",color:"#0A0A0B"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:18},children:[(0,f.jsx)("h1",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:"Weddings"}),(0,f.jsx)("span",{style:{fontFamily:Er,fontSize:10,fontWeight:700,background:"#FCE7F3",color:Br,borderRadius:6,padding:"4px 9px"},children:"CONSOLE"})]}),(0,f.jsxs)("div",{className:"tg-scroll",style:(0,m.A)((0,m.A)({},Tr),{},{padding:"0 18px",marginBottom:20,display:"flex",gap:24,overflowX:"auto"}),children:[gt("clients",Xe.A,"Clients"),gt("forms",kt.A,"Run Sheets"),gt("bookings",At.A,"Bookings"),gt("settings",ss.A,"Settings")]}),"clients"===z&&(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Tr),{},{padding:22}),children:[(0,f.jsx)("h2",{style:Rr,children:"Add New Client"}),(0,f.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),J.trim()){Q(!0);try{const e=await fetch("".concat(I.fn,"/api/wedding-admin/clients"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(c)},body:JSON.stringify({email:J.trim(),send_welcome_email:K})}),t=await e.json();t.success?(Y(""),Z(!0),rt(c),console.log("Client added successfully!")):console.error("Error adding client:",t.message)}catch(t){console.error("Add client error:",t)}finally{Q(!1)}}},style:{display:"flex",flexDirection:"column",gap:14},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[(0,f.jsx)("div",{style:{flex:1,minWidth:220},children:(0,f.jsx)("input",{type:"email",placeholder:"Enter client email address",value:J,onChange:e=>Y(e.target.value),style:Dr,required:!0})}),(0,f.jsxs)("button",{type:"submit",disabled:$,style:{display:"flex",alignItems:"center",gap:8,background:zr,color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontWeight:600,fontSize:13.5,cursor:"pointer",opacity:$?.6:1,whiteSpace:"nowrap"},children:[(0,f.jsx)(Bn.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{children:$?"Adding...":"Add Client"})]})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)("input",{type:"checkbox",id:"sendWelcomeEmail",checked:K,onChange:e=>Z(e.target.checked),style:{width:16,height:16,accentColor:zr}}),(0,f.jsx)("label",{htmlFor:"sendWelcomeEmail",style:{fontSize:13,color:"#55555C",cursor:"pointer"},children:"Send welcome email to client"})]})]})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Tr),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{padding:"16px 22px",borderBottom:"1px solid #EDEDF0",display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("h2",{style:(0,m.A)((0,m.A)({},Rr),{},{margin:0}),children:"Clients"}),(0,f.jsxs)("span",{style:{fontFamily:Er,fontSize:12,color:"#9A9AA0"},children:["(",w.length,")"]})]}),0===w.length?(0,f.jsx)("div",{style:{padding:4},children:(0,f.jsx)(Os,{icon:T.A,title:"No clients yet",message:"Add a client by email above to get started."})}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:"1fr 160px 90px",gap:12,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:Er,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Email"}),(0,f.jsx)("span",{children:"Created"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Actions"})]}),w.map(e=>(0,f.jsxs)("div",{className:"tg-row",style:{display:"grid",gridTemplateColumns:"1fr 160px 90px",gap:12,alignItems:"center",padding:"13px 22px",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[(0,f.jsx)("span",{style:{width:30,height:30,borderRadius:8,background:"#EDEDF0",color:"#55555C",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(T.A,{size:15})}),(0,f.jsx)("span",{style:{fontSize:13,fontWeight:500,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.email})]}),(0,f.jsx)("span",{style:{fontFamily:Er,fontSize:12,color:"#55555C"},children:lt(e.created_at)}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:4},children:[(0,f.jsx)("button",{onClick:()=>(async(e,t)=>{if(window.confirm("Resend welcome email to ".concat(t,"?")))try{const s=await fetch("".concat(I.fn,"/api/wedding-admin/clients/").concat(e,"/resend-welcome"),{method:"POST",headers:{Authorization:"Bearer ".concat(c)}}),a=await s.json();s.ok&&a.success?alert("Welcome email sent to ".concat(t)):alert(a.message||"Failed to send welcome email")}catch(s){console.error("Resend welcome email error:",s),alert("Error sending welcome email")}})(e._id||e.id,e.email),style:{background:"none",border:"none",cursor:"pointer",color:"#1D4ED8",padding:6},title:"Resend Welcome Email",children:(0,f.jsx)(st.A,{className:"h-5 w-5"})}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete this client?"))try{(await fetch("".concat(I.fn,"/api/wedding-admin/clients/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(c)}})).ok?(rt(c),console.log("Client deleted successfully!")):console.error("Error deleting client")}catch(t){console.error("Delete client error:",t)}})(e._id||e.id),style:{background:"none",border:"none",cursor:"pointer",color:"#991B1B",padding:6},title:"Delete Client",children:(0,f.jsx)(la.A,{className:"h-5 w-5"})})]})]},e._id||e.id))]})]})]}),"forms"===z&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Tr),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{padding:"16px 18px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:14,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("h2",{style:(0,m.A)((0,m.A)({},Rr),{},{margin:0}),children:"Run Sheets"}),(0,f.jsxs)("span",{style:{fontFamily:Er,fontSize:12,color:"#9A9AA0"},children:["(",A.length,")"]})]}),(0,f.jsxs)("button",{onClick:()=>Ke(!Je),style:{display:"flex",alignItems:"center",gap:7,background:Je?"#EDEDF0":"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(_r.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:Je?"Show Active Forms":"Show Archived Forms"})]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:200},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{type:"text",placeholder:"Search couples by name\u2026",value:Me,onChange:e=>qe(e.target.value),style:{border:"none",background:"transparent",outline:"none",fontSize:13,width:"100%"}})]}
1),(0,f.jsxs)("select",{value:He,onChange:e=>Ve(e.target.value),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)("option",{value:"upcoming",children:"Sort: Upcoming Date"}),(0,f.jsx)("option",{value:"alphabetical",children:"Sort: Alphabetical"}),(0,f.jsx)("option",{value:"created",children:"Sort: Created Date"})]})]})]}),(()=>{const e=(e=>{if(!e)return[];let t=e.filter(e=>{if(!Me)return!0;const t=Me.toLowerCase(),s="".concat(e.first_name||""," ").concat(e.last_name||"").toLowerCase(),a="".concat(e.partner_first_name||""," ").concat(e.partner_last_name||"").toLowerCase();return s.includes(t)||a.includes(t)});const s=new Date,a=new Date(s.getTime()-1728e5);switch(t=t.filter(e=>{if(!e.wedding_date)return!Je;const t=new Date(e.wedding_date)<a;return Je?t:!t}),He){case"upcoming":return t.sort((e,t)=>e.wedding_date||t.wedding_date?e.wedding_date?t.wedding_date?new Date(e.wedding_date)-new Date(t.wedding_date):-1:1:0);case"alphabetical":return t.sort((e,t)=>{const s="".concat(e.first_name||""," ").concat(e.last_name||"").toLowerCase(),a="".concat(t.first_name||""," ").concat(t.last_name||"").toLowerCase();return s.localeCompare(a)});case"created":return t.sort((e,t)=>new Date(t.created_at)-new Date(e.created_at));default:return t}})(A);return 0===e.length?(0,f.jsx)("div",{style:{padding:4},children:Me?(0,f.jsx)(Os,{icon:ds.A,title:"No matches",message:'No forms found matching "'.concat(Me,'".')}):Je?(0,f.jsx)(Os,{icon:_r.A,title:"No archived forms",message:"Archived run sheets will appear here."}):(0,f.jsx)(Os,{icon:kt.A,title:"No active run sheets",message:"Run sheets created by clients will appear here."})}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:"1.6fr 130px 1.1fr 120px 110px",gap:12,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:Er,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Couple"}),(0,f.jsx)("span",{children:"Wedding date"}),(0,f.jsx)("span",{children:"Email"}),(0,f.jsx)("span",{children:"Status"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Actions"})]}),e.map(e=>{const{status:t}=ct(e),s="Completed"===t?"green":"In Progress"===t?"blue":"gray";return(0,f.jsxs)("div",{className:"tg-row",style:{display:"grid",gridTemplateColumns:"1.6fr 130px 1.1fr 120px 110px",gap:12,alignItems:"center",padding:"14px 22px",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[(0,f.jsx)("span",{style:{width:30,height:30,borderRadius:8,background:Br,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(fs.A,{size:15})}),(0,f.jsxs)("span",{style:{fontSize:13.5,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.first_name," ",e.last_name," & ",e.partner_first_name," ",e.partner_last_name]})]}),(0,f.jsx)("span",{style:{fontFamily:Er,fontSize:12.5,color:"#55555C"},children:e.wedding_date?new Date(e.wedding_date).toLocaleDateString():"\u2014"}),(0,f.jsx)("span",{style:{fontSize:12.5,color:"#55555C",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.client_email}),(0,f.jsx)("span",{style:{justifySelf:"start"},children:(0,f.jsx)(Ds,{tone:s,children:t})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:4},children:[(0,f.jsxs)("button",{onClick:()=>(e=>{ee(e),se(!0)})(e),style:{display:"flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid #E4E4E9",borderRadius:8,padding:"6px 10px",fontSize:12.5,fontWeight:600,color:"#333",cursor:"pointer"},title:"View Run Sheet",children:[(0,f.jsx)(_.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"tg-desktop-only",children:"View"})]}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete this wedding form?"))try{(await fetch("".concat(I.fn,"/api/wedding-admin/forms/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(c)}})).ok?(rt(c),console.log("Form deleted successfully!")):console.error("Error deleting form")}catch(t){console.error("Delete form error:",t)}})(e._id||e.id),style:{background:"none",border:"none",cursor:"pointer",color:"#991B1B",padding:6},title:"Delete",children:(0,f.jsx)(la.A,{className:"h-5 w-5"})})]})]},e._id||e.id)})]})})()]}),"bookings"===z&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Tr),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{padding:"16px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:6,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("h2",{style:(0,m.A)((0,m.A)({},Rr),{},{margin:0}),children:"Wedding Bookings"}),(0,f.jsxs)("span",{style:{fontFamily:Er,fontSize:12,color:"#9A9AA0"},children:["(",S.length,")"]})]}),(0,f.jsxs)("button",{onClick:()=>rt(c),style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(ds.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Refresh"})]})]}),(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0"},children:"Manage wedding bookings from the online booking system"})]}),(0,f.jsx)("div",{children:D?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:6})}):0===S.length?(0,f.jsx)("div",{style:{padding:4},children:(0,f.jsx)(Os,{icon:fs.A,title:"No wedding bookings yet",message:"Bookings from the online booking system will appear here."})}):S.map(e=>{var t;const s=e.wedding_date?new Date(e.wedding_date):null,a=s&&s>new Date,n="confirmed"===e.status;return(0,f.jsxs)("div",{style:{padding:"18px 22px",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsx)("div",{style:{width:36,height:36,borderRadius:9,background:Br,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(fs.A,{size:18})}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"font-semibold text-gray-900",children:[e.customer_name," & ",e.partner_name]}),(0,f.jsxs)("div",{className:"text-sm text-gray-600",children:[s&&(0,f.jsxs)("span",{className:"mr-4",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4 inline mr-1"}),s.toLocaleDateString(),a&&(0,f.jsx)("span",{className:"ml-1 text-green-600",children:"(Upcoming)"})]}),(0,f.jsxs)("span",{className:"mr-4",children:[(0,f.jsx)(T.A,{className:"h-4 w-4 inline mr-1"}),e.customer_email]}),(0,f.jsxs)("span",{children:[(0,f.jsx)(E.A,{className:"h-4 w-4 inline mr-1"}),e.customer_mobile]})]}),(0,f.jsxs)("div",{className:"text-xs text-gray-500 mt-1 flex items-center space-x-4",children:[(0,f.jsxs)("span",{children:["Package: ",null===(t=e.package_type)||void 0===t?void 0:t.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())]}),(0,f.jsxs)("span",{children:["Total: $",e.package_price]}),(0,f.jsxs)("span",{children:["Deposit: $",e.deposit_amount]}),(0,f.jsxs)("span",{children:["Created: ",new Date(e.created_at).toLocaleDateString()]})]})]})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)(Ds,{tone:n?"green":"amber",children:n?"Confirmed":"Pending Payment"}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsxs)("div",{style:{fontFamily:Er,fontSize:14,fontWeight:700,color:"#0A0A0B"},children:["$",e.package_price]}),(0,f.jsx)("div",{className:"text-xs text-gray-500",children:e.wedding_location&&(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(C.A,{className:"h-3 w-3 mr-1"}),e.wedding_location.substring(0,30),e.wedding_location.length>30?"...":""]})})]})]})]}),(0,f.jsx)("div",{className:"mt-4 pt-4 border-t border-gray-100",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-xs text-gray-500",children:[(0,f.jsxs)("span",{children:["Booking ID: ",e.id]}),e.stripe_payment_intent_id&&(0,f.jsxs)("span",{children:["\u2022 Payment ID: ",e.stripe_payment_intent_id.substring(0,15),"..."]})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsxs)("button",{onClick:()=>{const t="Wedding Booking - ".concat(e.customer_name," & ").concat(e.partner_name),a="Hi ".concat(e.customer_name,",\n\nRegarding your wedding booking for ").concat(null===s||void 0===s?void 0:s.toLocaleDateString(),"...\n\nBest regards,\nTurbo 360");window.location.href="mailto:".concat(e.customer_email,"?subject=").concat(encodeURIComponent(t),"&body=").concat(encodeURIComponent(a))},className:"text-blue-600 hover:text-blue-700 text-sm flex items-center space-x-1",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Email"})]}),(0,f.jsxs)("button",{onClick:()=>{window.location.href="tel:".concat(e.customer_mobile)}
1,className:"text-green-600 hover:text-green-700 text-sm flex items-center space-x-1",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Call"})]}),(0,f.jsxs)("button",{onClick:()=>(e=>{Ae(e),Se(!0)})(e),className:"text-red-600 hover:text-red-700 text-sm flex items-center space-x-1",children:[(0,f.jsx)(la.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Delete"})]})]})]})})]},e._id||e.id)})})]}),"settings"===z&&(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Tr),{},{padding:22}),children:(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:18},children:[(0,f.jsx)("div",{style:{width:36,height:36,borderRadius:9,background:"#EEF2FF",color:"#4338CA",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(ss.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:800,fontSize:18,color:"#0A0A0B",margin:0},children:"Admin Settings"}),(0,f.jsx)("p",{style:{fontSize:13,color:"#9A9AA0",margin:"2px 0 0"},children:"Manage package pricing and payment settings"})]})]}),H&&(0,f.jsxs)("div",{style:{background:"#FEE2E2",border:"1px solid #FECACA",borderRadius:9,padding:14,marginBottom:16,display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)(h.A,{className:"h-5 w-5",style:{color:"#991B1B"}}),(0,f.jsx)("span",{style:{color:"#991B1B",fontSize:13},children:H})]}),G&&(0,f.jsxs)("div",{style:{background:"#DCFCE7",border:"1px solid #BBF7D0",borderRadius:9,padding:14,marginBottom:16,display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)(p.A,{className:"h-5 w-5",style:{color:"#15803D"}}),(0,f.jsx)("span",{style:{color:"#15803D",fontSize:13},children:G})]}),O?(0,f.jsx)(Ws,{rows:6}):P?(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsxs)("div",{style:{border:"1px solid #E4E4E9",borderRadius:12,padding:22,marginBottom:0},children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-4",children:[(0,f.jsx)(Es.A,{className:"h-5 w-5 text-blue-600"}),(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Data Backup & Import"})]}),(0,f.jsx)("p",{className:"text-gray-600 mb-4",children:"Export all wedding data for backup purposes or import previously exported data."}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4",children:[(0,f.jsx)("button",{onClick:async()=>{ge(!0);try{const e=await fetch("".concat(I.fn,"/api/wedding-admin/export"),{headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"}});if(!e.ok)throw new Error("Failed to export data");const t=await e.json(),s=JSON.stringify(t,null,2),a=new Blob([s],{type:"application/json"}),n=URL.createObjectURL(a),r=document.createElement("a");r.href=n,r.download="wedding_data_backup_".concat((new Date).toISOString().split("T")[0],".json"),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}catch(e){console.error("Export error:",e),alert("Failed to export data. Please try again.")}finally{ge(!1)}},disabled:ue,className:"flex items-center justify-center px-4 py-2 bg-green-600 text-white rounded-lg hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:ue?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Exporting..."]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(es.A,{className:"h-4 w-4 mr-2"}),"Export All Data"]})}),(0,f.jsxs)("button",{onClick:()=>ve(!0),disabled:fe,className:"flex items-center justify-center px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:[(0,f.jsx)(_s.A,{className:"h-4 w-4 mr-2"}),"Import Data"]})]})]}),(0,f.jsxs)("div",{style:{border:"1px solid #E4E4E9",borderRadius:12,padding:22,marginBottom:0},children:[(0,f.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center",children:[(0,f.jsx)(At.A,{className:"h-5 w-5 mr-2 text-green-600"}),"All Package Pricing (AUD)"]}),(0,f.jsxs)("div",{className:"mb-8",children:[(0,f.jsx)("h4",{className:"text-md font-semibold text-gray-800 mb
1-4 border-b pb-2",children:"Photography Packages"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Photography - Ceremony Only"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.photography_ceremony||950,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{photography_ceremony:parseFloat(e.target.value)||950})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"950.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Photography - 3 Hour"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.photography_3hr||1450,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{photography_3hr:parseFloat(e.target.value)||1450})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"1450.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Photography - 5 Hour"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.photography_5hr||1900,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{photography_5hr:parseFloat(e.target.value)||1900})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"1900.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Photography - 8 Hour"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.photography_8hr||2500,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{photography_8hr:parseFloat(e.target.value)||2500})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"2500.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Photography - 10 Hour"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.photography_10hr||2850,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{photography_10hr:parseFloat(e.target.value)||2850})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"2850.00"})]})]})]})]}),(0,f.jsxs)("div",{className:"mb-8",children:[(0,f.jsx)("h4",{className:"text-md font-semibold text-gray-800 mb-4 border-b pb-2",children:"Videography Packages"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Videography - Ceremony Only"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.videography_ceremony||950,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{videography_ceremony:parseFloat(e.target.value)||950})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"950.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Videography - 3 Hour"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.videography_3hr||1450,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{videography_3hr:parseFloat(e.target.value)||1450})}
1)),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"1450.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Videography - 5 Hour"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.videography_5hr||1900,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{videography_5hr:parseFloat(e.target.value)||1900})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"1900.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Videography - 8 Hour"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.videography_8hr||2500,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{videography_8hr:parseFloat(e.target.value)||2500})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"2500.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Videography - 10 Hour"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.videography_10hr||2850,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{videography_10hr:parseFloat(e.target.value)||2850})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"2850.00"})]})]})]})]}),(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("h4",{className:"text-md font-semibold text-gray-800 mb-4 border-b pb-2",children:"Combined Photo + Video Packages"}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Combined - 5 Hour Package"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.combined_5hr||3300,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{combined_5hr:parseFloat(e.target.value)||3300})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"3300.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Combined - 8 Hour Package"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.combined_8hr||4300,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{combined_8hr:parseFloat(e.target.value)||4300})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"4300.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Photography Only",(0,f.jsx)("span",{className:"text-xs text-gray-500 ml-1",children:"(Legacy - use specific packages above)"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.photography_only||2500,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{photography_only:parseFloat(e.target.value)||2500})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 bg-gray-50",placeholder:"2500.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Videography Only",(0,f.jsx)("span",{className:"text-xs text-gray-500 ml-1",children:"(Legacy - use specific packages above)"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.videography_only||3e3,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{videography_only:parseFloat(e.target.value)||3e3})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 bg-gray-50",placeholder:"3000.00"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Combined Photo + Video",(0,f.jsx)("span",{className:"text-xs text-gray-500 ml-1",children:"(Legacy - use specific packages above)"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("span",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-500",children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",value:P.package_pricing.combined_photo_video||4800,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{package_pricing:(0,m.A)((0,m.A)({},P.package_pricing),{},{combined_photo_video:parseFloat(e.target.value)||4800})})),className:"w-full pl-8 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 bg-gray-50",placeholder:"4800.00"})]})]})]})]})]}),(0,f.jsxs)("div",{style:{border:"1px solid #E4E4E9",borderRadius:12,padding:22,marginBottom:0},children:[(0,f.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center",children:[(0,f.jsx)(kt.A,{className:"h-5 w-5 mr-2 text-blue-600"}),"Stripe Payment Settings"]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Stripe Publishable Key"}),(0,f.jsx)("input",{type:"text",value:P.stripe_settings.stripe_publishable_key||"",onChange:e=>W((0,m.A)((0,m.A)({},P),{},{stripe_settings:(0,m.A)((0,m.A)({},P.stripe_settings),{},{stripe_publishable_key:e.target.value})})),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"pk_test_..."}),(0,f.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"This key is safe to use in frontend code"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Stripe Secret Key"}),(0,f.jsx)("input",{type:"password",value:P.stripe_settings.stripe_secret_key||"",onChange:e=>W((0,m.A)((0,m.A)({},P),{},{stripe_settings:(0,m.A)((0,m.A)({},P.stripe_settings),{},{stripe_secret_key:e.target.value})})),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"sk_test_... (masked for security)"}),(0,f.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"This key is encrypted and stored securely"})]})]})]}),(0,f.jsxs)("div",{style:{border:"1px solid #E4E4E9",borderRadius:12,padding:22,marginBottom:0},children:[(0,f.jsxs)("h3",{className:"text-lg font-semibold text-gray-900 mb-4 flex items-center",children:[(0,f.jsx)(T.A,{className:"h-5 w-5 mr-2 text-orange-600"}),"Postmark Email Settings"]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"SMTP Server"}),(0,f.jsx)("input",{type:"text",value:(null===(e=P.postmark_settings)||void 0===e?void 0:e.smtp_server)||"smtp.postmarkapp.com",onChange:e=>W((0,m.A)((0,m.A)({},P),{},{postmark_settings:(0,m.A)((0,m.A)({},P.postmark_settings),{},{smtp_server:e.target.value})})),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"smtp.postmarkapp.com"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"SMTP Port"}),(0,f.jsx)("input",{type:"number",value:(null===(t=P.postmark_settings)||void 0===t?void 0:t.smtp_port)||587,onChange:e=>W((0,m.A)((0,m.A)({},P),{},{postmark_settings:(0,m.A)((0,m.A)({},P.postmark_settings),{},{smtp_port:parseInt(e.target.value)||587})})),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"587"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"SMTP Username / API Token"}),(0,f.jsx)("input",{type:"text",value:(null===(s=P.postmark_settings)||void 0===s?void 0:s.smtp_user)||"",onChange:e=>W((0,m.A)((0,m.A)({},P),{},{postmark_settings:(0,m.A)((0,m.A)({},P.postmark_settings),{},{smtp_user:e.target.value})})),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"Your Postmark API token"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"SMTP Password"}),(0,f.jsx)("input",{type:"password",value:(null===(n=P.postmark_settings)||void 0===n?void 0:n.smtp_password)||"",onChange:e=>W((0,m.A)((0,m.A)({},P),{},{postmark_settings:(0,m.A)((0,m.A)({},P.postmark_settings),{},{smtp_password:e.target.value})})),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"Your Postmark password"}),(0,f.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Password is encrypted and stored securely"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Default Email Sender"}),(0,f.jsx)("input",{type:"email",value:(null===(i=P.postmark_settings)||void 0===i?void 0:i.email_sender)||"[email protected]",onChange:e=>W((0,m.A)((0,m.A)({},P),{},{postmark_settings:(0,m.A)((0,m.A)({},P.postmark_settings),{},{email_sender:e.target.value})})),className:"w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"[email protected]"}),(0,f.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"This email will be used as the sender for all wedding emails"})]})]})]}),(0,f.jsx)("div",{className:"flex justify-end",children:(0,f.jsx)("button",{onClick:()=>(async e=>{q(!0),U(""),V("");try{const t=await fetch("".concat(I.fn,"/api/wedding-admin/settings"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(c)},body:JSON.stringify(e)});if(!t.ok){const e=await t.json();throw new Error(e.detail||"Failed to save settings")}{const e=await t.json();W(e.settings),V("Settings updated successfully!"),setTimeout(()=>V(""),3e3)}}catch(t){console.error("Error saving settings:",t),U(t.message||"Failed to save settings")}finally{q(!1)}})({package_pricing:{photography_ceremony:P.package_pricing.photography_ceremony||950,photography_3hr:P.package_pricing.photography_3hr||1450,photography_5hr:P.package_pricing.photography_5hr||1900,photography_8hr:P.package_pricing.photography_8hr||2500,photography_10hr:P.package_pricing.photography_10hr||2850,videography_ceremony:P.package_pricing.videography_ceremony||950,videography_3hr:P.package_pricing.videography_3hr||1450,videography_5hr:P.package_pricing.videography_5hr||1900,videography_8hr:P.package_pricing.videography_8hr||2500,videography_10hr:P.package_pricing.videography_10hr||2850,combined_5hr:P.package_pricing.combined_5hr||3300,combined_8hr:P.package_pricing.combined_8hr||4300,photography_only:P.package_pricing.photography_only||2500,videography_only:P.package_pricing.videography_only||3e3,combined_photo_video:P.package_pricing.combined_photo_video||4800},stripe_settings:P.stripe_settings,postmark_settings:P.postmark_settings}),disabled:M,className:"flex items-center space-x-2 text-white px-6 py-3 rounded-lg font-medium transition-colors",style:{background:zr,opacity:M?.6:1},children:M?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),(0,f.jsx)("span",{children:"Saving..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ia.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{children:"Save Settings"})]})})})]}):(0,f.jsxs)("div",{className:"text-center py-8",children:[(0,f.jsx)(ss.A,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-600",children:"No settings found"}),(0,f.jsx)("button",{onClick:()=>it(c),className:"mt-2 font-medium",style:{color:zr,background:"none",border:"none",cursor:"pointer"},children:"Reload Settings"})]})]})}),ye&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4",style:{zIndex:9999},children:(0,f.jsxs)("div",{className:"bg-white rounded-lg p-6 w-full max-w-md
1shadow-2xl",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsx)("h3",{className:"text-lg font-semibold",children:"Import Wedding Data"}),(0,f.jsx)("button",{onClick:()=>{ve(!1),we(null)},className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,f.jsxs)("div",{className:"flex items-start",children:[(0,f.jsx)(h.A,{className:"h-5 w-5 text-yellow-500 mr-2 mt-0.5"}),(0,f.jsxs)("div",{className:"text-sm text-yellow-700",children:[(0,f.jsx)("p",{className:"font-medium mb-1",children:"Warning:"}),(0,f.jsx)("p",{children:"This will update existing records and add new ones from the backup file. Make sure you have a current backup before proceeding."})]})]})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Select Backup File"}),(0,f.jsx)("input",{type:"file",accept:".json",onChange:e=>{const t=e.target.files[0];t&&"application/json"===t.type?we(t):(alert("Please select a valid JSON backup file."),e.target.value="")},className:"block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100"}),je&&(0,f.jsxs)("p",{className:"text-sm text-green-600 mt-2",children:["Selected: ",je.name]})]})]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-3 mt-6",children:[(0,f.jsx)("button",{onClick:()=>{ve(!1),we(null)},className:"px-4 py-2 bg-gray-200 hover:bg-gray-300 text-gray-800 rounded-lg text-sm",children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>{if(je){be(!0);try{const e=await je.text(),t=JSON.parse(e),s=await fetch("".concat(I.fn,"/api/wedding-admin/import"),{method:"POST",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok)throw new Error("Failed to import data");const a=await s.json();Ee(a),await rt(c),alert("Import successful! ".concat(a.message))}catch(e){console.error("Import error:",e),alert("Failed to import data: ".concat(e.message))}finally{be(!1),ve(!1),we(null)}}else alert("Please select a backup file to import.")},disabled:!je||fe,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded-lg text-sm",children:fe?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2 inline-block"}),"Importing..."]}):"Import Data"})]})]})}),ke&&Ne&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4",style:{zIndex:9999},children:(0,f.jsxs)("div",{className:"bg-white rounded-lg p-6 w-full max-w-md
1shadow-2xl",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-red-600",children:"Delete Booking"}),(0,f.jsx)("button",{onClick:()=>{Se(!1),Ae(null)},className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:(0,f.jsxs)("div",{className:"flex items-start",children:[(0,f.jsx)(h.A,{className:"h-5 w-5 text-red-500 mr-2 mt-0.5"}),(0,f.jsxs)("div",{className:"text-sm text-red-700",children:[(0,f.jsx)("p",{className:"font-medium mb-1",children:"Warning:"}),(0,f.jsx)("p",{children:"This action cannot be undone. The booking will be permanently deleted."})]})]})}),(0,f.jsxs)("div",{className:"text-sm text-gray-600",children:[(0,f.jsx)("p",{children:(0,f.jsx)("strong",{children:"Booking Details:"})}),(0,f.jsxs)("p",{children:["Client: ",Ne.customer_name&&Ne.partner_name?"".concat(Ne.customer_name," & ").concat(Ne.partner_name):"Unknown"]}),(0,f.jsxs)("p",{children:["Date: ",Ne.wedding_date?new Date(Ne.wedding_date).toLocaleDateString():"Not specified"]}),(0,f.jsxs)("p",{children:["Package: ",Ne.package_type?Ne.package_type.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):"Not specified"]}),(0,f.jsxs)("p",{children:["Amount: $",Ne.package_price||"Not specified"]})]})]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-3 mt-6",children:[(0,f.jsx)("button",{onClick:()=>{Se(!1),Ae(null)},className:"px-4 py-2 bg-gray-200 hover:bg-gray-300 text-gray-800 rounded-lg text-sm",children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>{if(Ne){Ce(!0);try{const e=Ne._id||Ne.id,t=await fetch("".concat(I.fn,"/api/wedding-admin/bookings/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(c)}});if(t.ok)rt(c),console.log("Booking deleted successfully!"),Se(!1),Ae(null);else{const e=await t.json().catch(()=>({}));console.error("Error deleting booking:",e),alert("Failed to delete booking: ".concat(e.detail||"Unknown error"))}}catch(e){console.error("Delete booking error:",e),alert("Network error occurred while deleting booking")}finally{Ce(!1)}}},disabled:_e,className:"px-4 py-2 bg-red-600 hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed text-white rounded-lg text-sm",children:_e?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2 inline-block"}),"Deleting..."]}):"Delete Booking"})]})]})})]})}),xe&&kr.createPortal((0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4",style:{zIndex:999999},children:(0,f.jsxs)("div",{className:"bg-white rounded-lg p-6 w-full max-w-md
1shadow-2xl",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsx)("h3",{className:"text-lg font-semibold",children:"Share with Crew"}),(0,f.jsx)("button",{onClick:()=>he(!1),className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"Share this user-friendly link with your crew members. The link remains active as long as this run sheet is active."}),(0,f.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,f.jsx)("input",{type:"text",value:ce,readOnly:!0,className:"flex-1 px-3 py-2 border border-gray-300 rounded-lg text-sm bg-gray-50 text-gray-900"}),(0,f.jsxs)("button",{onClick:async()=>{try{await navigator.clipboard.writeText(ce),ze(!0),setTimeout(()=>ze(!1),2e3)}catch(e){console.error("Failed to copy to clipboard:",e)}},className:"flex items-center space-x-1 bg-blue-600 hover:bg-blue-700 text-white px-3 py-2 rounded-lg text-sm",children:[Te?(0,f.jsx)(zt.A,{className:"h-4 w-4"}):(0,f.jsx)(Cr.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:Te?"Copied!":"Copy"})]})]}),(0,f.jsx)("div",{className:"flex justify-end",children:(0,f.jsx)("button",{onClick:()=>he(!1),className:"px-4 py-2 bg-gray-200 hover:bg-gray-300 text-gray-800 rounded-lg text-sm",children:"Close"})})]})}),document.body),Pe&&X&&kr.createPortal((0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4",style:{zIndex:999999},children:(0,f.jsxs)("div",{className:"bg-white rounded-lg p-6 w-full max-w-md
1shadow-2xl",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Email Client Runsheet"}),(0,f.jsx)("button",{onClick:()=>We(!1),className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("p",{className:"text-sm text-gray-600 mb-4",children:"This will send the wedding runsheet email to the client at:"}),(0,f.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3 mb-4",children:[(0,f.jsx)("p",{className:"text-sm font-medium text-gray-900",children:X.email_address}),X.first_name&&(0,f.jsxs)("p",{className:"text-sm text-gray-600",children:[X.first_name," ",X.partner_first_name&&"& ".concat(X.partner_first_name)]})]}),(0,f.jsx)("p",{className:"text-xs text-gray-500",children:"Subject: Your Wedding Day \u2013 We're Ready to Capture the Magic!"})]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,f.jsx)("button",{onClick:()=>We(!1),className:"px-4 py-2 bg-gray-200 hover:bg-gray-300 text-gray-800 rounded-lg text-sm font-medium",children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{if(X&&X.id){Re(!0);try{const e=await fetch("".concat(I.fn,"/api/wedding-admin/forms/").concat(X.id,"/send-client-email"),{method:"POST",headers:{Authorization:"Bearer ".concat(c),"Content-Type":"application/json"}}),t=await e.json();t.success?(alert("\u2705 Email sent successfully to client!"),We(!1)):alert("\u274c Failed to send email: ".concat(t.message||"Please try again"))}catch(e){console.error("Failed to send client email:",e),alert("\u274c Network error: Unable to send email. Please try again.")}finally{Re(!1)}}},disabled:Ie,className:"px-4 py-2 text-white rounded-lg text-sm font-medium disabled:opacity-50 flex items-center space-x-2",style:{background:zr},children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:Ie?"Sending...":"Send Email"})]})]})]})}),document.body)]})};var Wr=s(56099),Or=s(92419),Lr=s(76210);function Mr(e){let{open:t,onToggle:s,onClose:n,children:r,label:i="More actions",buttonStyle:o,wrapperStyle:l}=e;const c=(0,a.useRef)(null),d=(0,a.useRef)(null),[p,x]=(0,a.useState)(null),h=(0,a.useCallback)(()=>{var e;const t=null===(e=c.current)||void 0===e?void 0:e.getBoundingClientRect(),s=d.current;if(!t||!s)return;const a=s.offsetWidth,n=s.offsetHeight,r=window.innerHeight-t.bottom-6-8,i=t.top-6-8,o=n>r&&i>r;x({top:o?Math.max(8,t.top-6-n):t.bottom+6,left:Math.max(8,Math.min(t.right-a,window.innerWidth-a-8)),maxHeight:Math.max(120,o?i:r)})},[]);return(0,a.useLayoutEffect)(()=>{t?h():x(null)},[t,h]),(0,a.useEffect)(()=>{if(!t)return;const e=e=>{"Escape"===e.key&&(null===n||void 0===n||n())};return window.addEventListener("keydown",e),window.addEventListener("resize",h),window.addEventListener("scroll",h,!0),()=>{window.removeEventListener("keydown",e),window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0)}},[t,n,h]),(0,f.jsxs)("div",{className:"tg-kebab",onClick:e=>e.stopPropagation(),style:(0,m.A)({justifySelf:"center"},l),children:[(0,f.jsx)("button",{ref:c,type:"button","aria-label":i,"aria-haspopup":"menu","aria-expanded":t,onClick:s,style:(0,m.A)({background:"none",border:"none",color:"#B5B5BC",cursor:"pointer",padding:4,display:"flex"},o),children:(0,f.jsx)(ba.A,{size:18})}),t&&(0,kr.createPortal)((0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{position:"fixed",inset:0,zIndex:1e3},onClick:n}),(0,f.jsx)("div",{ref:d,className:"tg-kebab-menu",role:"menu",onClick:e=>e.stopPropagation(),style:{position:"fixed",zIndex:1001,top:p?p.top:0,left:p?p.left:0,right:"auto",maxHeight:p?p.maxHeight:void 0,overflowY:"auto",visibility:p?"visible":"hidden"},children:r})]}),document.body)]})}const qr="'Space Mono',monospace",Hr={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Ur="70px 1.6fr 1.2fr 84px 70px 110px 96px 40px",Gr=()=>{const e=(0,r.Zp)(),[t]=(0,r.ok)(),{toast:s}=N(),[n,i]=(0,a.useState)(null),[l,c]=(0,a.useState)([]),[d,p]=(0,a.useState)([]),[x,h]=(0,a.useState)(!0),[u,g]=(0,a.useState)(()=>t.get("q")||""),[b,y]=(0,a.useState)(()=>"archived"===t.get("tab")?"archived":"upcoming"),[v,j]=(0,a.useState)("event_date"),[w,A]=(0,a.useState)("asc"),[k,S]=(0,a.useState)(!1),[C,F]=(0,a.useState)(null),[E,z]=(0,a.useState)(null),[B,D]=(0,a.useState)(null),[R,P]=(0,a.useState)("");(0,a.useEffect)(()=>
1{if((0,o.cd)()){const e=JSON.parse(localStorage.getItem("turbo360_admin_auth"));i({username:e.username,fullName:e.fullName||e.username}),L()}else e("/?admin=true")},[e,b]),(0,a.useEffect)(()=>{W()},[u,l,v,w]);const W=()=>{let e=[...l];if(u.trim()){const t=u.toLowerCase();e=e.filter(e=>{var s,a,n,r;return(null===(s=e.event_name)||void 0===s?void 0:s.toLowerCase().includes(t))||(null===(a=e.client_company)||void 0===a?void 0:a.toLowerCase().includes(t))||(null===(n=e.venue)||void 0===n?void 0:n.toLowerCase().includes(t))||(null===(r=e.primary_contact)||void 0===r?void 0:r.toLowerCase().includes(t))})}e.sort((e,t)=>{let s=e[v],a=t[v];return"event_date"===v&&(s=new Date(U(e)||0),a=new Date(U(t)||0)),"asc"===w?s>a?1:-1:s<a?1:-1}),p(e)},O=e=>{v===e?A("asc"===w?"desc":"asc"):(j(e),A("asc"))},L=async()=>{h(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s="archived"===b?"true":"false",a=await fetch("".concat(I.fn,"/api/corporate-admin/events?archived=").concat(s),{headers:{Authorization:"Bearer ".concat(t)}}),n=await a.json();n.success&&(c(n.events),p(n.events))}catch(t){console.error("Error loading events:",t),s.error("Failed to load events")}finally{h(!1)}},M=(e,t)=>{D({id:e.id,field:t}),P(null!=e[t]?String(e[t]):"")},q=()=>D(null),H=async(e,t,a)=>{D(null);const n="event_date"===t?a:(null!==a&&void 0!==a?a:"").trim(),r=null!=e[t]?String(e[t]):"";if(n===r)return;if("event_name"===t&&!n)return;const i=e[t];c(s=>s.map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{[t]:n}):s));try{var o;const a=null===(o=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===o?void 0:o.token;if(!(await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(e.id),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify({[t]:n})})).ok)throw new Error("Update failed");s.success("Saved")}catch(l){console.error("Inline save error:",l),c(s=>s.map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{[t]:i}):s)),s.error("Failed to save change")}},U=e=>"single"===e.event_duration_type||e.event_date?e.event_date:e.event_days&&e.event_days.length>0?e.event_days[0].date:null,G=e=>{F(e),S(!0)};if(!n)return null;const V=(()=>{const e=new Map;d.forEach(t=>{const s=U(t),a=s&&/^\d{4}/.test(String(s))?String(s).slice(0,4):"Undated";e.has(a)||e.set(a,[]),e.get(a).push(t)});const t=[...e.entries()].filter(e=>{let[t]=e;return"Undated"!==t});t.sort((e,t)=>"event_date"===v&&"desc"===w?Number(t[0])-Number(e[0]):Number(e[0])-Number(t[0]));const s=t.map(e=>{let[t,s]=e;return{year:t,events:s}});return e.has("Undated")&&s.push({year:"Undated",events:e.get("Undated")}),s})(),J=function(e,t,s){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return(null===B||void 0===B?void 0:B.id)===e.id&&B.field===t?(0,f.jsx)("input",{autoFocus:!0,t
1ype:a.type||"text",value:R,onChange:e=>P(e.target.value),onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onKeyDown:s=>{"Enter"===s.key?(s.preventDefault(),H(e,t,R)):"Escape"===s.key&&(s.preventDefault(),q())},onBlur:()=>H(e,t,R),style:{width:"100%",boxSizing:"border-box",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:a.fontSize||13.5,fontWeight:a.fontWeight||600,color:"#0A0A0B",padding:"4px 6px",border:"1px solid #0FA3A3",borderRadius:6,outline:"none",background:"#fff",boxShadow:"0 0 0 3px rgba(15,163,163,.12)"}}):(0,f.jsx)("span",{className:"tg-editable",title:"Click to edit",onClick:s=>{s.stopPropagation(),M(e,t)},style:(0,m.A)({cursor:"text",display:"inline-block",borderRadius:5,padding:"1px 3px",margin:"-1px -3px",maxWidth:"100%",whiteSpace:"normal",overflowWrap:"anywhere",wordBreak:"break-word"},a.displayStyle||{}),children:s})},Y=t=>{var a;const n=(e=>{const t=U(e);if(!t)return{text:"\u2014",tone:"gray"};const s=new Date(t+"T00:00:00"),a=new Date;a.setHours(0,0,0,0);const n=s.getTime()-a.getTime(),r=Math.round(n/864e5);return r<0?{text:"PAST",tone:"gray"}:0===r?{text:"TODAY",tone:"danger"}:1===r?{text:"1 DAY",tone:"amber"}:r<=3?{text:"".concat(r," DAYS"),tone:"amber"}:{text:"".concat(r," DAYS"),tone:"gray"}})(t),r="multi"===t.event_duration_type&&t.event_days&&t.event_days.length>0,i=(e=>{if(!e)return{mon:"\u2014",day:""};const t=new Date(e+"T00:00:00");return isNaN(t.getTime())?{mon:"\u2014",day:""}:{mon:t.toLocaleDateString("en-AU",{month:"short"}).toUpperCase(),day:t.toLocaleDateString("en-AU",{day:"2-digit"})}})(U(t)),o=(null===(a=t.crew_members)||void 0===a?void 0:a.length)||0;return(0,f.jsxs)("div",{className:"tg-row",style:{display:"grid",gridTemplateColumns:Ur,gap:12,alignItems:"center",padding:"14px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer"},onClick:()=>G(t),children:[(null===B||void 0===B?void 0:B.id)===t.id&&"event_date"===B.field?(0,f.jsx)("input",{autoFocus:!0,t
1ype:"date",value:R,onChange:e=>P(e.target.value),onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"===e.key?(e.preventDefault(),H(t,"event_date",R)):"Escape"===e.key&&(e.preventDefault(),q())},onBlur:()=>H(t,"event_date",R),style:{width:"100%",boxSizing:"border-box",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:11,padding:"3px 4px",border:"1px solid #0FA3A3",borderRadius:6,outline:"none"}}):(0,f.jsxs)("div",{onClick:r?void 0:e=>{e.stopPropagation(),M(t,"event_date")},title:r?void 0:"Click to edit date",style:{textAlign:"center",cursor:r?"pointer":"text"},children:[(0,f.jsx)("div",{style:{fontFamily:qr,fontSize:10,fontWeight:700,color:"#BF212F"},children:i.mon}),(0,f.jsx)("div",{className:"tg-display",style:{fontWeight:800,fontSize:20,lineHeight:1},children:i.day})]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600},children:J(t,"event_name",t.event_name)}),(0,f.jsxs)("div",{style:{fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[t.client_company,t.primary_contact?" \xb7 ".concat(t.primary_contact):""]})]}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontSize:12.5,color:"#55555C",minWidth:0,display:"block"},children:J(t,"venue",t.venue||"\u2014",{fontSize:12.5,displayStyle:{color:"#55555C"}})}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontFamily:qr,fontSize:12,color:o?"#55555C":"#B5B5BC",textAlign:"center"},children:o?"".concat(o," crew"):"\u2014"}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{display:"flex",justifyContent:"center"},onClick:e=>e.stopPropagation(),children:(0,f.jsx)("button",{type:"button",onClick:()=>(async e=>{const t=!e.invoiced;c(s=>s.map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{invoiced:t}):s));try{var a;const s=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token;if(!(await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(e.id),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify({invoiced:t})})).ok)throw new Error("Update failed")}catch(n){console.error("Invoiced toggle error:",n),c(s=>s.map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{invoiced:!t}):s)),s.error("Failed to update invoiced status")}})(t),title:t.invoiced?"Marked as invoiced \u2014 click to unmark":"Click to mark as invoiced",style:{width:32,height:18,borderRadius:20,background:t.invoiced?"#16A34A":"#D4D4DA",position:"relative",border:"none",padding:0,cursor:"pointer",flexShrink:0},children:(0,f.jsx)("span",{style:{position:"absolute",top:2,left:t.invoiced?"auto":2,right:t.invoiced?2:"auto",width:14,height:14,borderRadius:"50%",background:"#fff"}})})}),(0,f.jsx)("span",{style:{justifySelf:"start"},children:(0,f.jsx)(Ds,{tone:n.tone,children:n.text})}),(0,f.jsx)("span",{className:"tg-booking-meta",children:r?(0,f.jsxs)(Ds,{tone:"indigo",children:[t.event_days.length,"D"]}):(0,f.jsx)(Ds,{tone:"teal",children:"Single"})}),(0,f.jsxs)(Mr,{open:E===t.id,onToggle:()=>z(E===t.id?null:t.id),onClose:()=>z(null),children:[(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{z(null),G(t)},children:[(0,f.jsx)(_.A,{size:15})," View details"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{z(null),(t=>{e("/admin/corporate/edit/".concat(t.id))})(t)},children:[(0,f.jsx)(Tn.A,{size:15})," Edit"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",style:{color:"#BF212F"},onClick:()=>{z(null),window.open("/admin/corporate/edit/".concat(t.id,"?editor=v5"),"_blank")},children:[(0,f.jsx)(Wr.A,{size:15})," AI Editor"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{z(null),(e=>{window.open("/corporate-runsheet/".concat(e.id),"_blank")})(t)},children:[(0,f.jsx)(kt.A,{size:15})," View runsheet"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{z(null),window.open((e=>{var t;const s=(e,t)=>{if(!e)return"";const s=e.replace(/-/g,"");if(t){t.replace(/[: ]/g,"").replace(/am|pm/gi,"");const e=t.match(/^(\d{1,2}):?(\d{2})?\s*(am|pm)?$/i);if(e){let t=parseInt(e[1]);const a=e[2]||"00",n=e[3];return"pm"===(null===n||void 0===n?void 0:n.toLowerCase())&&t<12&&(t+=12),"am"===(null===n||void 0===n?void 0:n.toLowerCase())&&12===t&&(t=0),"".concat(s,"T").concat(String(t).padStart(2,"0")).concat(a,"00")}}return"".concat(s,"T000000")};let a,n,r,i;if("multi"===e.event_duration_type&&(null===(t=e.event_days)||void 0===t?void 0:t.length)>0){const t=e.event_days[0],s=e.event_days[e.event_days.length-1];a=t.date,r=t.start_time||e.start_time,n=s.date,i=s.end_time||e.end_time}else a=e.event_date||U(e),n=a,r=e.start_time,i=e.end_time;const o=s(a,r),l=s(n,i||r),c=new URLSearchParams({action:"TEMPLATE",text:e.event_name||"",dates:"".concat(o,"/").concat(l),location:e.venue||"",details:e.client_company||""});return"https://calendar.google.com/calendar/render?".concat(c.toString())})(t),"_blank")},children:[(0,f.jsx)(zn.A,{size:15})," Add to calendar"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{z(null),G(t)},children:[(0,f.jsx)(st.A,{size:15})," Email crew"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{z(null),G(t)},children:[(0,f.jsx)(T.A,{size:15})," Email client"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{z(null),G(t)},children:[(0,f.jsx)(Wa.A,{size:15})," SMS crew"]}),(0,f.jsx)("button",{className:"tg-kebab-item",onClick:()=>{z(null),(async e=>{const t=l.find(t=>
1t.id===e),a="archived"===b?"unarchive":"archive";if(confirm("".concat(a.charAt(0).toUpperCase()+a.slice(1),' "').concat(t.event_name,'"?')))try{var n;const t=null===(n=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===n?void 0:n.token;(await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(e,"/archive"),{method:"PUT",headers:{Authorization:"Bearer ".concat(t)}})).ok?(s.success("Event ".concat(a,"d successfully")),L()):s.error("Failed to ".concat(a," event"))}catch(r){console.error("Error ".concat(a,"ing event:"),r),s.error("Error ".concat(a,"ing event"))}})(t.id)},children:"archived"===b?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Or.A,{size:15})," Restore"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(_r.A,{size:15})," Archive"]})}),(0,f.jsxs)("button",{className:"tg-kebab-item",style:{color:"#991B1B"},onClick:()=>{z(null),(async e=>{if(window.confirm("Are you sure you want to delete this event? This action cannot be undone."))try{var t;const a=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token;(await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(a)}})).ok?(s.success("Event deleted successfully"),L()):s.error("Failed to delete event")}catch(a){console.error("Delete error:",a),s.error("Failed to delete event")}})(t.id)},children:[(0,f.jsx)(la.A,{size:15})," Delete"]})]})]},t.id)},K=(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:Ur,gap:12,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:qr,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{style:{textAlign:"center"},children:"Date"}),(0,f.jsx)("span",{children:"Event"}),(0,f.jsx)("span",{children:"Venue"}),(0,f.jsx)("span",{style:{textAlign:"center"},children:"Crew"}),(0,f.jsx)("span",{style:{textAlign:"center"},children:"Inv."}),(0,f.jsx)("span",{children:"Countdown"}),(0,f.jsx)("span",{children:"Type"}),(0,f.jsx)("span",{})]});return(0,f.jsx)(ta,{title:"Event Runsheets",meta:"EVENTS \xb7 RUNSHEETS",action:{label:"Create Event",to:"/admin/corporate/create"},children:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{display:"flex",gap:10,marginBottom:18},children:[{key:"upcoming",label:"Upcoming"},{key:"archived",label:"Archived"}].map(e=>{const t=b===e.key;return(0,f.jsx)("button",{onClick:()=>y(e.key),style:{background:t?"#0A0A0B":"#fff",border:t?"none":"1px solid #E4E4E9",color:t?"#fff":"#55555C",borderRadius:9,padding:"9px 16px",fontSize:13,fontWeight:600,fontFamily:"'Hanken Grotesk',sans-serif",cursor:"pointer"},children:e.label},e.key)})}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Hr),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 18px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:200},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{value:u,onChange:e=>g(e.target.value),placeholder:"Search by event, company or venue\u2026",style:{border:"none",background:"transparent",outline:"none",fontSize:13,width:"100%"}})]}),(0,f.jsxs)("button",{onClick:()=>O("event_name"),style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"event_name"===v?"#0A0A0B":"#55555C",cursor:"pointer"},children:[(0,f.jsx)(Lr.A,{size:14})," Event","event_name"===v?"asc"===w?" \u2191":" \u2193":""]}),(0,f.jsxs)("button",{onClick:()=>O("event_date"),style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"event_date"===v?"#0A0A0B":"#55555C",cursor:"pointer"},children:[(0,f.jsx)(Lr.A,{size:14})," Date","event_date"===v?"asc"===w?" \u2191":" \u2193":""]}),(0,f.jsxs)("button",{onClick:L,style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(As.A,{size:14})," Refresh"]})]}),x?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:6})}):0===d.length?(0,f.jsx)(Os,{icon:_t.A,title:"No events found",message:u?"Try adjusting your search.":"archived"===b?"No archived events.":"Get started by creating your first event.",actionLabel:u||"archived"===b?void 0:"Create Event",onAction:()=>{e("/admin/corporate/create")}}):V.map(e=>{let{year:t,events:s}=e;return(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 22px",background:"#0A0A0B"},children:[(0,f.jsx)("span",{className:"tg-display",style:{fontSize:17,fontWeight:800,color:"#fff",letterSpacing:"-0.01em"},children:"Undated"===t?"No date":t}),(0,f.jsxs)("span",{style:{fontFamily:qr,fontSize:11,letterSpacing:"0.1em",color:"#9A9AA0"},children:[s.length," EVENT",1===s.length?"":"S"]})]}),K,s.map(Y)]},"yr-".concat(t))}),!x&&d.length>0&&(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 22px",borderTop:"1px solid #EDEDF0"},children:(0,f.jsxs)("span",{style:{fontFamily:qr,fontSize:11.5,color:"#9A9AA0"},children:["SHOWING ",d.length," OF ",l.length]})})]}),k&&C&&(0,f.jsx)(Qn,{event:C,archived:"archived"===b,onClose:()=>S(!1),onChanged:()=>L()})]})})};var Vr=s(70929),Jr=s(70067),Yr=s(94965),Kr=s(22024);async function Zr(){const e=await fetch("".concat("https://iq.turbo.net.au/api/external","/galleries"),{headers:{"x-api-key":"tiq_7f3a9b2e1d5c8f4a6e0b3d7c9a2f5e8b1d4c7a0e3b6f9d2c5a8e1b4d7f0a3c","Content-Type":"application/json"}});if(!e.ok)throw new Error("Galleries request failed (".concat(e.status,")"));return(await e.json()).galleries||[]}async function $r(){const e=await fetch("https://reviews.turbo.net.au/api/showcase");if(!e.ok)throw new Error("Showcase request failed (".concat(e.status,")"));const t=await e.json();return Array.isArray(t)?t:t.videos||[]}const Qr=[{key:"client_name",label:"Client / organisation",placeholder:"Who was the event for?"},{key:"what_we_covered",label:"What we covered",placeholder:"Services we provided (photography, video, live stream, drone, headshots\u2026)",textarea:!0},{key:"what_we_delivered",label:"What we delivered",placeholder:"Deliverables and turnaround (e.g. 300 edited photos same day, 60s highlight reel)",textarea:!0},{key:"highlights",label:"Standout moments / highlights",placeholder:"Anything memorable about the event or our coverage",textarea:!0},{key:"crew_scope",label:"Crew & scope",placeholder:"Crew size, number of days, scale of the event"},{key:"gear",label:"Gear / approach",placeholder:"Notable kit or approach (optional)"},{key:"challenges",label:"Challenges & how we solved them",placeholder:"Optional",textarea:!0},{key:"extra_notes",label:"Anything else",placeholder:"Optional extra context for the AI",textarea:!0}],Xr="'Space Mono',monospace",ei={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},ti={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},si={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},ai={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,fontSize:13,fontWeight:600,color:"#333",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 14px",cursor:"pointer",textDecoration:"none"},ni=e=>{let{n:t,title:s,right:a,children:n}=e;return(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},ei),{},{padding:22}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:16,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11},children:[(0,f.jsx)("span",{className:"tg-mono",style:{width:26,height:26,borderRadius:8,background:"#FEE2E2",color:"#BF212F",fontWeight:700,fontSize:12,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t}),(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:s})]}),a]}),n]})},ri=e=>{let{label:t,hint:s,span:a,children:n}=e;return(0,f.jsxs)("div",{style:{gridColumn:2===a?"span 2":"auto"},children:[(0,f.jsxs)("label",{style:ti,children:[t,s&&(0,f.jsxs)("span",{style:{color:"#9A9AA0",fontWeight:400},children:[" ",s]})]}),n]})},ii=()=>{var e,t;const s=(0,r.Zp)(),{toast:n}=N(),[i,l]=(0,a.useState)([]),[c,d]=(0,a.useState)(!0),[p,x]=(0,a.useState)(null),[h,u]=(0,a.useState)(!1),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1),[w,A]=(0,a.useState)([]),[k,S]=(0,a.useState)([]),[F,E]=(0,a.useState)(!1),T=(0,o.c4)(),z={Authorization:"Bearer ".concat(T)};(0,a.useEffect)(()=>{(0,o.cd)()?B():s("/?admin=true")},[]);const B=async()=>{d(!0);try{const e=await fetch("".concat(I.fn,"/api/recent-gigs"),{headers:z}),t=await e.json();t.success&&l(t.gigs)}catch(e){n.error("Failed to load gigs")}finally{d(!1)}},D=async()=>{try{const[e,t]=await Promise.allSettled([Zr(),$r()]);"fulfilled"===e.status&&A(e.value),"fulfilled"===t.status&&S(t.value),E(!0)}catch(e){E(!0)}},R=async e=>{y(!0);try{x(P(await H(e))),n.success("Blog generated \u2014 review and edit below")}catch(t){n.error(t.message||"Generation failed")}finally{y(!1)}},P=e=>(0,m.A)((0,m.A)({},e),{},{questionnaire:e.questionnaire||{},images:e.images||[],seo:e.seo||{}}),W=async()=>{const e=window.prompt('Job title for this gig (e.g. "EduTech 2026 Conference"):');if(e&&e.trim())try{const t=await fetch("".concat(I.fn,"/api/recent-gigs"),{method:"POST",headers:(0,m.A)((0,m.A)({},z),{},{"Content-Type":"application/json"}),body:JSON.stringify({job_title:e.trim()})}),s=await t.json();s.success?(await B(),x(P(s.gig)),F||D()):n.error("Could not create gig")}catch(t){n.error("Could not create gig")}},O=(e,t)=>x(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t})),L=(e,t)=>x(s=>(0,m.A)((0,m.A)({},s),{},{questionnaire:(0,m.A)((0,m.A)({},s.questionnaire),{},{[e]:t})})),M=(e,t)=>x(s=>(0,m.A)((0,m.A)({},s),{},{seo:(0,m.A)((0,m.A)({},s.seo),{},{[e]:t})})),q=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{silent:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!p)return null;u(!0);try{const s=(0,m.A)({job_title:p.job_title,event_date:p.event_date||"",location:p.location||"",questionnaire:p.questionnaire||{},blog_html:p.blog_html||"",excerpt:p.excerpt||"",hero_image:p.hero_image||"",images:p.images||[],showcase_video:p.showcase_video||null,gallery:p.gallery||null,seo:p.seo||{}},e),a=await fetch("".concat(I.fn,"/api/recent-gigs/").concat(p.id),{method:"PUT",headers:(0,m.A)((0,m.A)({},z),{},{"Content-Type":"application/json"}),body:JSON.stringify(s)}
1),r=await a.json();return r.success?(x(P(r.gig)),t||n.success("Saved"),B(),r.gig):(n.error("Save failed"),null)}catch(s){return n.error("Save failed"),null}finally{u(!1)}},H=async e=>{const t=Date.now()+48e4;for(;Date.now()<t;){let t;await new Promise(e=>setTimeout(e,3e3));try{const s=await fetch("".concat(I.fn,"/api/recent-gigs/").concat(e,"/generation"),{headers:z});t=await s.json()}catch(s){continue}if("done"===t.status)return t.gig;if("error"===t.status)throw new Error(t.error||"Generation failed")}throw new Error("Still writing \u2014 reload this page in a minute to see the result.")};if(!p)return(0,f.jsx)(ta,{title:"Recent Gigs",meta:"EVENTS \xb7 CONTENT",action:{label:"New Gig",onClick:W},children:c?(0,f.jsx)(Ws,{rows:6}):0===i.length?(0,f.jsx)(Os,{icon:Vr.A,title:"No gigs yet",message:"Create your first Recent Gig post \u2014 the AI turns your event notes into a published blog.",actionLabel:"New Gig",onAction:W}):(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:16},children:i.map(e=>{const t="published"===e.status;return(0,f.jsxs)("div",{className:"tg-tile",style:(0,m.A)((0,m.A)({},ei),{},{overflow:"hidden",transition:"all .2s",display:"flex",flexDirection:"column"}),children:[(0,f.jsxs)("div",{style:{height:150,background:"#F2F2F5",position:"relative"},children:[e.hero_image?(0,f.jsx)("img",{src:e.hero_image,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}):(0,f.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#C9C9D0"},children:(0,f.jsx)(Jr.A,{size:26})}),(0,f.jsx)("span",{style:{position:"absolute",top:12,left:12},children:(0,f.jsx)(Ds,{tone:t?"green":"gray",children:t?"Published":"Draft"})}),(0,f.jsxs)("div",{style:{position:"absolute",bottom:12,left:12,display:"flex",gap:6},children:[e.showcase_video&&(0,f.jsxs)("span",{className:"tg-mono",style:{display:"inline-flex",alignItems:"center",gap:4,background:"rgba(10,10,11,.7)",color:"#fff",borderRadius:6,padding:"4px 7px",fontSize:9.5},children:[(0,f.jsx)(Ge.A,{size:11})," Reel"]}),e.gallery&&(0,f.jsxs)("span",{className:"tg-mono",style:{display:"inline-flex",alignItems:"center",gap:4,background:"rgba(10,10,11,.7)",color:"#fff",borderRadius:6,padding:"4px 7px",fontSize:9.5},children:[(0,f.jsx)(Yr.A,{size:11})," Gallery"]})]})]}),(0,f.jsxs)("div",{style:{padding:"15px 16px",display:"flex",flexDirection:"column",flex:1},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontSize:14,fontWeight:700,lineHeight:1.3,marginBottom:6},children:e.job_title}),(0,f.jsxs)("div",{className:"tg-mono",style:{fontSize:11,color:"#9A9AA0",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[e.event_date&&(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,f.jsx)(_t.A,{size:11})," ",e.event_date]}),e.location&&(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[(0,f.jsx)(C.A,{size:11})," ",e.location]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:"auto",paddingTop:14},children:[(0,f.jsxs)("button",{onClick:()=>(async e=>{try{const t=await fetch("".concat(I.fn,"/api/recent-gigs/").concat(e.id),{headers:z}),s=await t.json();s.success&&(x(P(s.gig)),"processing"===s.gig.generation_status&&R(e.id))}catch(t){n.error("Failed to open gig")}F||D()})(e),style:(0,m.A)((0,m.A)({},ai),{},{flex:1,padding:"8px 12px"}),children:[(0,f.jsx)(Tn.A,{size:14})," Edit"]}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm('Delete "'.concat(e.job_title,'"? This cannot be undone.')))try{const t=await fetch("".concat(I.fn,"/api/recent-gigs/").concat(e.id),{method:"DELETE",headers:z});(await t.json()).success&&(n.success("Gig deleted"),B())}catch(t){n.error("Failed to delete")}})(e),title:"Delete",style:(0,m.A)((0,m.A)({},ai),{},{color:"#991B1B",border:"1px solid #FECACA",padding:"8px 11px"}),children:(0,f.jsx)(la.A,{size:14})})]})]})]},e.id)})})});const U=p,G="published"===U.status;return(0,f.jsxs)(ta,{title:"Recent Gigs",meta:"EVENTS \xb7 CONTENT",children:[(0,f.jsxs)("div",{style:{position:"sticky",top:0,zIndex:10,margin:"-28px -32px 20px",padding:"16px 32px",background:"rgba(237,237,240,.92)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",borderBottom:"1px solid #DEDEE3",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>x(null),style:ai,children:[(0,f.jsx)(Ct.A,{size:15})," Back to list"]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[G&&(0,f.jsxs)("a",{href:"/recent-gigs/".concat(U.slug),target:"_blank",rel:"noreferrer",style:(0,m.A)({},ai),children:[(0,f.jsx)(_.A,{size:15})," View live"]}),(0,f.jsxs)("button",{onClick:()=>q(),disabled:h,style:(0,m.A)((0,m.A)({},ai),{},{opacity:h?.6:1}),children:[h?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(zt.A,{size:15})," Save"]}),(0,f.jsx)("button",{onClick:async()=>{const e="published"===p.status?"draft":"published";await q({status:e},{silent:!0})&&n.success("published"===e?"Published live":"Unpublished (now a draft)")},className:"tg-btn-primary",style:{display:"inline-flex",alignItems:"center",gap:7,color:"#fff",border:"none",borderRadius:9,padding:"9px 18px",fontWeight:600,fontSize:13,cursor:"pointer",background:G?"#92400E":"#15803D"},children:G?"Unpublish":"Publish"})]})]}),(0,f.jsxs)("div",{style:{maxWidth:820,display:"flex",flexDirection:"column",gap:18},children:[(0,f.jsx)(ni,{n:1,title:"Event details",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsx)(ri,{label:"Job title",span:2,children:(0,f.jsx)("input",{value:U.job_title||"",onChange:e=>O("job_title",e.target.value),style:si})}),(0,f.jsx)(ri,{label:"Event date",children:(0,f.jsx)("input",{type:"date",value:U.event_date||"",onChange:e=>O("event_date",e.target.value),style:(0,m.A)((0,m.A)({},si),{},{fontFamily:Xr})})}),(0,f.jsx)(ri,{label:"Location",children:(0,f.jsx)("input",{value:U.location||"",onChange:e=>O("location",e.target.value),placeholder:"e.g. Melbourne Convention Centre",style:si})})]})}),(0,f.jsx)(ni,{n:2,title:"Questionnaire",children:(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:Qr.map(e=>(0,f.jsx)(ri,{label:e.label,span:e.textarea?2:1,children:e.textarea?(0,f.jsx)("textarea",{rows:2,value:U.questionnaire[e.key]||"",onChange:t=>L(e.key,t.target.value),placeholder:e.placeholder,style:(0,m.A)((0,m.A)({},si),{},{resize:"vertical"})}):(0,f.jsx)("input",{value:U.questionnaire[e.key]||"",onChange:t=>L(e.key,t.target.value),placeholder:e.placeholder,style:si})},e.key))})}),(0,f.jsxs)(ni,{n:3,title:"Photos",children:[(0,f.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:12,marginBottom:12},children:[(U.images||[]).map(e=>{const t=U.hero_image===e;return(0,f.jsxs)("div",{style:{position:"relative",width:124,height:90,borderRadius:10,overflow:"hidden",border:"2px s
1olid ".concat(t?"#BF212F":"transparent"),background:"#F2F2F5"},children:[(0,f.jsx)("img",{src:e,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}}),(0,f.jsx)("button",{onClick:()=>(e=>x(t=>(0,m.A)((0,m.A)({},t),{},{images:(t.images||[]).filter(t=>t!==e),hero_image:t.hero_image===e?"":t.hero_image})))(e),style:{position:"absolute",top:6,right:6,background:"rgba(10,10,11,.6)",color:"#fff",border:"none",borderRadius:"50%",width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:(0,f.jsx)(g.A,{size:12})}),(0,f.jsx)("button",{onClick:()=>O("hero_image",e),className:"tg-mono",style:{position:"absolute",bottom:0,left:0,right:0,background:"rgba(10,10,11,.62)",color:"#fff",border:"none",fontSize:10,padding:"3px 0",cursor:"pointer"},children:t?"Hero \u2605":"Set hero"})]},e)}),(0,f.jsxs)("label",{style:{width:124,height:90,borderRadius:10,border:"2px dashed #C9C9D0",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"#9A9AA0",cursor:"pointer",gap:4},children:[v?(0,f.jsx)(Kr.A,{size:18,className:"animate-spin"}):(0,f.jsx)(_s.A,{size:18}),(0,f.jsx)("span",{className:"tg-mono",style:{fontSize:10},children:"Upload"}),(0,f.jsx)("input",{type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:async e=>{const t=Array.from(e.target.files||[]);if(t.length){j(!0);try{const e=[];for(const s of t){const t=new FormData;t.append("file",s);const a=await fetch("".concat(I.fn,"/api/recent-gigs/upload-image"),{method:"POST",headers:z,body:t}),r=await a.json();r.success?e.push(r.url):n.error(r.error||"Image upload failed")}e.length&&(x(t=>{const s=[...t.images||[],...e];return(0,m.A)((0,m.A)({},t),{},{images:s,hero_image:t.hero_image||s[0]})}),n.success("".concat(e.length," image(s) uploaded")))}finally{j(!1),e.target.value=""}}}})]})]}),(0,f.jsx)("p",{style:{fontSize:12,color:"#9A9AA0",margin:0},children:"JPG, PNG or WEBP up to 10MB. The AI uses these to write and lay out the post."})]}),(0,f.jsx)(ni,{n:4,title:"AI blog",right:(0,f.jsxs)("button",{onClick:async()=>{if(!p)return;if(!await q({},{silent:!0}))return;const e=p.id;y(!0);try{const t=await fetch("".concat(I.fn,"/api/recent-gigs/").concat(e,"/generate"),{method:"POST",headers:z}),s=await t.json();if(!s.success)return void n.error(s.detail||"Generation failed");const a=await H(e);x(P(a)),n.success("Blog generated \u2014 review and edit below")}catch(t){n.error(t.message||"Generation failed")}finally{y(!1)}},disabled:b,className:"tg-btn-primary",style:{display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"9px 16px",fontWeight:600,fontSize:13,cursor:"pointer",opacity:b?.6:1},children:[b?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(Wr.A,{size:15}),b?"Researching & writing\u2026":U.blog_html?"Regenerate":"Generate with AI"]}),children:(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[(0,f.jsx)(ri,{label:"Excerpt",hint:"(cards + meta)",children:(0,f.jsx)("textarea",{rows:2,value:U.excerpt||"",onChange:e=>O("excerpt",e.target.value),style:(0,m.A)((0,m.A)({},si),{},{resize:"vertical"})})}),(0,f.jsx)(ri,{label:"Blog HTML",hint:"(editable)",children:(0,f.jsx)("textarea",{rows:14,value:U.blog_html||"",onChange:e=>O("blog_html",e.target.value),placeholder:"Click 'Generate with AI' to draft the post, then tidy it here.",style:(0,m.A)((0,m.A)({},si),{},{fontFamily:Xr,fontSize:12,lineHeight:1.6,resize:"vertical"})})})]})}),(0,f.jsxs)(ni,{n:5,title:"Attach media",children:[(0,f.jsxs)("div",{style:{marginBottom:18},children:[(0,f.jsxs)("label",{style:(0,m.A)((0,m.A)({},ti),{},{display:"flex",alignItems:"center",gap:7}),children:[(0,f.jsx)(Ge.A,{size:15})," Turbo Reviews showcase video"]}),(0,f.jsxs)("select",{value:(null===(e=U.showcase_video)||void 0===e?void 0:e.version_id)||"",onChange:e=>{const t=k.find(t=>t._id===e.target.value);O("showcase_video",t?{version_id:t._id,title:t.showcaseTitle,playback_url:t.playbackUrl,thumbnail:t.thumbnailUrl||"",width:t.width,height:t.height}:null)},style:(0,m.A)((0,m.A)({},si),{},{cursor:"pointer"}),children:[(0,f.jsx)("option",{value:"",children:"\u2014 None \u2014"}),k.map(e=>(0,f.jsx)("option",{value:e._id,children:e.showcaseTitle||e._id},e._id))]}),U.showcase_video&&(0,f.jsxs)("p",{style:{fontSize:12,color:"#15803D",margin:"7px 0 0"},children:["Attached: ",U.showcase_video.title]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{style:(0,m.A)((0,m.A)({},ti),{},{display:"flex",alignItems:"center",gap:7}),children:[(0,f.jsx)(Yr.A,{size:15})," Turbo IQ full gallery"]}),(0,f.jsxs)("select",{value:(null===(t=U.gallery)||void 0===t?void 0:t.gallery_id)||"",onChange:e=>{const t=w.find(t=>
1t.id===e.target.value);O("gallery",t?{gallery_id:t.id,name:t.name,share_url:t.share_url||t.simple_share_url||"",thumbnail:t.featured_photo_thumbnail||"",photo_count:t.photo_count||0}:null)},style:(0,m.A)((0,m.A)({},si),{},{cursor:"pointer"}),children:[(0,f.jsx)("option",{value:"",children:"\u2014 None \u2014"}),w.map(e=>(0,f.jsxs)("option",{value:e.id,children:[e.name,e.photo_count?" (".concat(e.photo_count," photos)"):""]},e.id))]}),U.gallery&&(0,f.jsxs)("p",{style:{fontSize:12,color:"#15803D",margin:"7px 0 0",display:"inline-flex",alignItems:"center",gap:4},children:["Linked: ",U.gallery.name,U.gallery.share_url&&(0,f.jsx)("a",{href:U.gallery.share_url,target:"_blank",rel:"noreferrer",style:{color:"#BF212F",display:"inline-flex",alignItems:"center"},children:(0,f.jsx)(En.A,{size:13,style:{marginLeft:2}})})]})]})]}),(0,f.jsx)(ni,{n:6,title:"SEO",children:(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[(0,f.jsx)(ri,{label:"Meta title",hint:"(".concat((U.seo.meta_title||"").length,"/60)"),children:(0,f.jsx)("input",{value:U.seo.meta_title||"",onChange:e=>M("meta_title",e.target.value),style:si})}),(0,f.jsx)(ri,{label:"Meta description",hint:"(".concat((U.seo.meta_description||"").length,"/160)"),children:(0,f.jsx)("textarea",{rows:2,value:U.seo.meta_description||"",onChange:e=>M("meta_description",e.target.value),style:(0,m.A)((0,m.A)({},si),{},{resize:"vertical"})})}),(0,f.jsx)(ri,{label:"URL slug",children:(0,f.jsxs)("div",{style:{fontSize:13.5,color:"#9A9AA0",padding:"11px 13px",background:"#F7F7F9",border:"1px solid #EDEDF0",borderRadius:9},children:["/recent-gigs/",(0,f.jsx)("span",{className:"tg-mono",style:{color:"#0A0A0B"},children:U.slug})]})})]})})]})]})};var oi=s(16388);const li={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},ci={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},di={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},mi={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,fontSize:13,fontWeight:600,color:"#333",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 14px",cursor:"pointer",textDecoration:"none"},pi=(0,m.A)((0,m.A)({},mi),{},{background:"#BF212F",border:"1px solid #BF212F",color:"#fff"}),xi=[{value:"once",label:"Once per visitor",hint:'Until you press "Show again to everyone"'},{value:"daily",label:"Once a day",hint:"Re-shows 24h after a dismissal"},{value:"session",label:"Once per session",hint:"Again next time the browser is opened"},{value:"always",label:"Every visit",hint:"Every page load \u2014 use sparingly"}],hi={name:"",image_url:"",image_alt:"",link_url:"/services/corporate-headshots",open_in_new_tab:!1,caption_label:"",caption_cta:"See how it works \u2192",delay_ms:4e3,frequency:"once",enabled:!1,start_at:"",end_at:"",sort_order:0},ui=e=>{let{n:t,title:s,right:a,children:n}=e;return(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},li),{},{padding:22}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:16,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11},children:[(0,f.jsx)("span",{className:"tg-mono",style:{width:26,height:26,borderRadius:8,background:"#FEE2E2",color:"#BF212F",fontWeight:700,fontSize:12,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:t}),(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:s})]}),a]}),n]})},gi=e=>{let{label:t,hint:s,span:a,children:n}=e;return(0,f.jsxs)("div",{style:{gridColumn:2===a?"span 2":"auto"},children:[(0,f.jsxs)("label",{style:ci,children:[t,s&&(0,f.jsxs)("span",{style:{color:"#9A9AA0",fontWeight:400},children:[" ",s]})]}),n]})},fi=e=>{let{p:t}=e;return(0,f.jsx)("div",{style:{background:"#060607",borderRadius:12,padding:28,display:"flex",alignItems:"center",justifyContent:"center",minHeight:360},children:(0,f.jsxs)("div",{style:{position:"relative",width:"min(100%, 420px)",background:"#0A0A0B",border:"1px solid #2B2B2B",boxShadow:"0 30px 80px rgba(0,0,0,.6)"},children:[(0,f.jsx)("div",{style:{position:"absolute",top:10,right:10,width:38,height:38,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(10,10,11,.72)",border:"1px solid rgba(255,255,255,.28)",color:"#fff",fontFamily:"'Space Mono',monospace",fontSize:17},children:"\u2715"}),t.image_url?(0,f.jsx)("img",{src:t.image_url,alt:"",style:{display:"block",width:"100%",height:"auto"}}):(0,f.jsxs)("div",{style:{aspectRatio:"1",display:"flex",alignItems:"center",justifyContent:"center",color:"#55534F",flexDirection:"column",gap:8},children:[(0,f.jsx)(Jr.A,{size:30}),(0,f.jsx)("span",{className:"tg-mono",style:{fontSize:11},children:"No graphic yet"})]}),(t.caption_label||t.caption_cta)&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,padding:"16px 20px",background:"#BF212F"},children:[(0,f.jsx)("span",{style:{fontFamily:"'Space Mono',monospace",fontSize:11,letterSpacing:"0.18em",textTransform:"uppercase",color:"#FFD9DC"},children:t.caption_label}),(0,f.jsx)("span",{style:{fontFamily:"Archivo,sans-serif",fontSize:15,fontWeight:700,color:"#fff"},children:t.caption_cta})]})]})})},bi=()=>{var e,t,s,n,i,l,c,d;const p=(0,r.Zp)(),{toast:x}=N(),[h,u]=(0,a.useState)([]),[b,y]=(0,a.useState)(!0),[v,j]=(0,a.useState)(null),[w,A]=(0,a.useState)(!1),[k,S]=(0,a.useState)(!1),[C,F]=(0,a.useState)(!1),E=(0,o.c4)(),T={Authorization:"Bearer ".concat(E)};(0,a.useEffect)(()=>{(0,o.cd)()?z():p("/?admin=true")},[]);const z=async()=>{y(!0);try{const e=await fetch("".concat(I.fn,"/api/popups"),{headers:T}),t=await e.json();t.success&&u(t.popups)}catch(e){x.error("Failed to load popups")}finally{y(!1)}},B=()=>{j((0,m.A)({},hi)),A(!0)},D=(e,t)=>j(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t})),R=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(v)if(v.name.trim())if(v.image_url){S(!0);try{const t=(0,m.A)((0,m.A)({},(e=>({name:e.name||"",image_url:e.image_url||"",image_alt:e.image_alt||"",link_url:e.link_url||"",open_in_new_tab:!!e.open_in_new_tab,caption_label:e.caption_label||"",caption_cta:e.caption_cta||"",delay_ms:Number(e.delay_ms)||0,frequency:e.frequency||"once",enabled:!!e.enabled,start_at:e.start_at||"",end_at:e.end_at||"",sort_order:Number(e.sort_order)||0}))(v)),e),s=await fetch(w?"".concat(I.fn,"/api/popups"):"".concat(I.fn,"/api/popups/").concat(v.id),{method:w?"POST":"PUT",headers:(0,m.A)((0,m.A)({},T),{},{"Content-Type":"application/json"}),body:JSON.stringify(t)}),a=await s.json();a.success?(x.success(e.bump_version?"Saved \u2014 everyone will see it again":"Popup saved"),j((0,m.A)((0,m.A)({},hi),a.popup)),A(!1),z()):x.error(a.detail||"Save failed")}catch(t){x.error("Save failed")}finally{S(!1)}}else x.error("Add a graphic first");
1else x.error("Give the popup a name")},P=async e=>{if(window.confirm('Delete "'.concat(e.name,'"? This cannot be undone.')))try{const t=await fetch("".concat(I.fn,"/api/popups/").concat(e.id),{method:"DELETE",headers:T});(await t.json()).success&&(x.success("Popup deleted"),(null===v||void 0===v?void 0:v.id)===e.id&&j(null),z())}catch(t){x.error("Failed to delete")}};if(!v){const e=h.filter(e=>e.is_live).length;return(0,f.jsx)(ta,{title:"Home Page Popups",meta:"MARKETING \xb7 HOME PAGE",action:{label:"New Popup",onClick:B},children:b?(0,f.jsx)(Ws,{rows:4}):0===h.length?(0,f.jsx)(Os,{icon:Ss.A,title:"No popups yet",message:"Create a popup to promote a campaign on the turbo.net.au home page. Only enabled popups inside their schedule are shown.",actionLabel:"New Popup",onAction:B}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},li),{},{padding:"12px 16px",marginBottom:16,display:"flex",alignItems:"center",gap:12,flexWrap:"wrap",fontSize:13,color:"#55555C"}),children:[(0,f.jsx)(Ss.A,{size:15,color:"#BF212F"}),0===e?(0,f.jsx)("span",{children:"Nothing is showing on the home page right now."}):(0,f.jsxs)("span",{children:[(0,f.jsx)("strong",{style:{color:"#0A0A0B"},children:e})," live \u2014 visitors see the first one in the list order below."]})]}),(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:16},children:h.map(e=>{var t,s,a,n,r,i;return(0,f.jsxs)("div",{className:"tg-tile",style:(0,m.A)((0,m.A)({},li),{},{overflow:"hidden",display:"flex",flexDirection:"column"}),children:[(0,f.jsxs)("div",{style:{height:190,background:"#0A0A0B",position:"relative"},children:[e.image_url?(0,f.jsx)("img",{src:e.image_url,alt:"",style:{width:"100%",height:"100%",objectFit:"contain"}}):(0,f.jsx)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#55534F"},children:(0,f.jsx)(Jr.A,{size:26})}),(0,f.jsx)("span",{style:{position:"absolute",top:12,left:12},children:(0,f.jsx)(Ds,{tone:e.is_live?"green":e.enabled?"amber":"gray",children:e.is_live?"Live":e.enabled?"Scheduled":"Off"})})]}),(0,f.jsxs)("div",{style:{padding:"15px 16px",display:"flex",flexDirection:"column",flex:1},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontSize:14,fontWeight:700,lineHeight:1.3,marginBottom:6},children:e.name}),(0,f.jsxs)("div",{className:"tg-mono",style:{fontSize:11,color:"#9A9AA0",display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},title:"Impressions",children:[(0,f.jsx)(_.A,{size:11})," ",null!==(t=null===(s=e.stats)||void 0===s?void 0:s.views)&&void 0!==t?t:0]}),(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},title:"Clicks",children:[(0,f.jsx)(oi.A,{size:11})," ",null!==(a=null===(n=e.stats)||void 0===n?void 0:n.clicks)&&void 0!==a?a:0]}),(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4},title:"Dismissed",children:[(0,f.jsx)(g.A,{size:11})," ",null!==(r=null===(i=e.stats)||void 0===i?void 0:i.dismissals)&&void 0!==r?r:0]})]}),(0,f.jsxs)("div",{className:"tg-mono",style:{fontSize:10.5,color:"#9A9AA0",marginTop:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["\u2192 ",e.link_url]}),(e.start_at||e.end_at)&&(0,f.jsxs)("div",{className:"tg-mono",style:{fontSize:10.5,color:"#9A9AA0",marginTop:4},children:[e.start_at||"\u2026"," \u2192 ",e.end_at||"\u2026"]}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:"auto",paddingTop:14},children:[(0,f.jsx)("button",{onClick:()=>(async e=>{try{const t=await fetch("".concat(I.fn,"/api/popups/").concat(e.id),{method:"PUT",headers:(0,m.A)((0,m.A)({},T),{},{"Content-Type":"application/json"}),body:JSON.stringify({enabled:!e.enabled})});(await t.json()).success&&(x.success(e.enabled?"Popup disabled":"Popup enabled"),z())}catch(t){x.error("Could not update")}})(e),style:(0,m.A)((0,m.A)({},mi),{},{flex:1,padding:"8px 12px",color:e.enabled?"#166534":"#333",borderColor:e.enabled?"#BBF7D0":"#E4E4E9"}),children:e.enabled?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(_.A,{size:14})," Enabled"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ut.A,{size:14})," Disabled"]})}),(0,f.jsxs)("button",{onClick:()=>(e=>{j((0,m.A)((0,m.A)({},hi),e)),A(!1)})(e),style:(0,m.A)((0,m.A)({},mi),{},{padding:"8px 12px"}),children:[(0,f.jsx)(Tn.A,{size:14})," Edit"]}),(0,f.jsx)("button",{onClick:()=>P(e),title:"Delete",style:(0,m.A)((0,m.A)({},mi),{},{color:"#991B1B",border:"1px solid #FECACA",padding:"8px 11px"}),children:(0,f.jsx)(la.A,{size:14})})]})]})]},e.id)})})]})})}const W=v;return(0,f.jsxs)(ta,{title:"Home Page Popups",meta:"MARKETING \xb7 HOME PAGE",children:[(0,f.jsxs)("div",{style:{position:"sticky",top:0,zIndex:10,margin:"-28px -32px 20px",padding:"16px 32px",background:"rgba(237,237,240,.92)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",borderBottom:"1px solid #DEDEE3",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>j(null),style:mi,children:[(0,f.jsx)(Ct.A,{size:15})," Back to list"]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,f.jsxs)("a",{href:"/",target:"_blank",rel:"noreferrer",style:mi,children:[(0,f.jsx)(En.A,{size:15})," Open home page"]}),!w&&(0,f.jsxs)("button",{onClick:()=>R({bump_version:!0}),disabled:k,style:mi,title:"Visitors who already dismissed this popup will see it again",children:[(0,f.jsx)(As.A,{size:15})," Show again to everyone"]}),(0,f.jsxs)("label",{style:(0,m.A)((0,m.A)({},mi),{},{gap:9}),children:[(0,f.jsx)("input",{type:"checkbox",checked:!!W.enabled,onChange:e=>D("enabled",e.target.checked),style:{accentColor:"#BF212F"}}),"Enabled"]}),(0,f.jsxs)("button",{onClick:()=>R(),disabled:k,style:pi,children:[k?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(zt.A,{size:15})," ",w?"Create popup":"Save"]})]})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0,1fr) minmax(0,460px)",gap:20,alignItems:"start"},className:"tg-two-col",children:[(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16}
1,children:[(0,f.jsx)(ui,{n:"1",title:"Graphic",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsx)(gi,{label:"Internal name",hint:"(only shown here)",span:2,children:(0,f.jsx)("input",{style:di,value:W.name,onChange:e=>D("name",e.target.value),placeholder:'e.g. "Headshots \u2014 51 in the lunch hour"'})}),(0,f.jsx)(gi,{label:"Upload image",hint:"PNG / JPG / WEBP, square or portrait works best",children:(0,f.jsxs)("label",{style:(0,m.A)((0,m.A)({},mi),{},{width:"100%",padding:"11px 13px",cursor:C?"wait":"pointer"}),children:[C?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(_s.A,{size:15})," ",C?"Uploading\u2026":"Choose file",(0,f.jsx)("input",{type:"file",accept:"image/png,image/jpeg,image/webp",style:{display:"none"},disabled:C,onChange:e=>{var t;return(async t=>{if(t){F(!0);try{const e=new FormData;e.append("file",t);const s=await fetch("".concat(I.fn,"/api/popups/upload-image"),{method:"POST",headers:T,body:e}),a=await s.json();a.success?(D("image_url",a.url),x.success("Graphic uploaded")):x.error(a.error||"Upload failed")}catch(e){x.error("Upload failed")}finally{F(!1)}}})(null===(t=e.target.files)||void 0===t?void 0:t[0])}})]})}),(0,f.jsx)(gi,{label:"\u2026or image URL / path",children:(0,f.jsx)("input",{style:di,value:W.image_url,onChange:e=>D("image_url",e.target.value),placeholder:"/images/promo/headshots-lunch-hour.jpg"})}),(0,f.jsx)(gi,{label:"Alt text",hint:"(accessibility \u2014 describe the graphic)",span:2,children:(0,f.jsx)("input",{style:di,value:W.image_alt,onChange:e=>D("image_alt",e.target.value),placeholder:"51 headshots in the lunch hour \u2014 on-site pop-up studio, delivered same day"})})]})}),(0,f.jsx)(ui,{n:"2",title:"Link & caption bar",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsx)(gi,{label:"Link to",hint:"(path on turbo.net.au or a full URL)",span:2,children:(0,f.jsx)("input",{style:di,value:W.link_url,onChange:e=>D("link_url",e.target.value),placeholder:"/services/corporate-headshots"})}),(0,f.jsx)(gi,{label:"Caption label",hint:"(left, small caps)",children:(0,f.jsx)("input",{style:di,value:W.caption_label,onChange:e=>D("caption_label",e.target.value),placeholder:"Corporate headshots"})}),(0,f.jsx)(gi,{label:"Call to action",hint:"(right, bold)",children:(0,f.jsx)("input",{style:di,value:W.caption_cta,onChange:e=>D("caption_cta",e.target.value),placeholder:"See how it works \u2192"})}),(0,f.jsx)(gi,{span:2,label:"",children:(0,f.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:9,fontSize:13,color:"#333"},children:[(0,f.jsx)("input",{type:"checkbox",checked:!!W.open_in_new_tab,onChange:e=>D("open_in_new_tab",e.target.checked),style:{accentColor:"#BF212F"}}),"Open the link in a new tab"]})})]})}),(0,f.jsx)(ui,{n:"3",title:"Timing & frequency",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsx)(gi,{label:"Delay before showing",hint:"(seconds after the page loads)",children:(0,f.jsx)("input",{style:di,type:"number",min:"0",step:"0.5",value:(Number(W.delay_ms)||0)/1e3,onChange:e=>D("delay_ms",Math.round(1e3*Number(e.target.value)))})}),(0,f.jsxs)(gi,{label:"Show each visitor",children:[(0,f.jsx)("select",{style:di,value:W.frequency,onChange:e=>D("frequency",e.target.value),children:xi.map(e=>(0,f.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",marginTop:6},children:null===(e=xi.find(e=>e.value===W.frequency))||void 0===e?void 0:e.hint})]}),(0,f.jsx)(gi,{label:"Order",hint:"(lowest number wins when several are live)",children:(0,f.jsx)("input",{style:di,type:"number",value:W.sort_order,onChange:e=>D("sort_order",e.target.value)})})]})}),(0,f.jsx)(ui,{n:"4",title:"Schedule",right:(0,f.jsx)("span",{className:"tg-mono",style:{fontSize:10.5,color:"#9A9AA0"},children:"Leave blank to run until disabled"}),children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsx)(gi,{label:"Start date",children:(0,f.jsx)("input",{style:di,type:"date",value:(W.start_at||"").slice(0,10),onChange:e=>D("start_at",e.target.value)})}),(0,f.jsx)(gi,{label:"End date",hint:"(inclusive)",children:(0,f.jsx)("input",{style:di,type:"date",value:(W.end_at||"").slice(0,10),onChange:e=>D("end_at",e.target.value)})})]})}),!w&&(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,flexWrap:"wrap",padding:"4px 2px"},children:[(0,f.jsxs)("div",{className:"tg-mono",style:{fontSize:11,color:"#9A9AA0"},children:[null!==(t=null===(s=W.stats)||void 0===s?void 0:s.views)&&void 0!==t?t:0," views \xb7 ",null!==(n=null===(i=W.stats)||void 0===i?void 0:i.clicks)&&void 0!==n?n:0," clicks \xb7 ",null!==(l=null===(c=W.stats)||void 0===c?void 0:c.dismissals)&&void 0!==l?l:0," dismissed \xb7 version ",null!==(d=W.version)&&void 0!==d?d:1]}),(0,f.jsxs)("button",{onClick:()=>P(W),style:(0,m.A)((0,m.A)({},mi),{},{color:"#991B1B",border:"1px solid #FECACA"}),children:[(0,f.jsx)(la.A,{size:14})," Delete popup"]})]})]}),(0,f.jsxs)("div",{style:{position:"sticky",top:84},children:[(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:10},children:"PREVIEW \u2014 AS SHOWN ON THE HOME PAGE"}),(0,f.jsx)(fi,{p:W}),(0,f.jsxs)("div",{style:{fontSize:12,color:"#9A9AA0",marginTop:10,lineHeight:1.5},children:["Shows ",((Number(W.delay_ms)||0)/1e3).toFixed(1),"s after the home page loads. The whole graphic links to ",(0,f.jsx)("strong",{style:{color:"#333"},children:W.link_url||"\u2014"}),". Visitors can close it with \u2715, Escape or by clicking outside."]})]})]}),(0,f.jsx)("style",{children:"@media (max-width: 1100px){ .tg-two-col{ grid-template-columns: 1fr !important; } }"})]})},yi=e=>{if(!e)return"";const t=new Date(e);return isNaN(t)?e:t.toLocaleDateString("en-AU",{day:"numeric",month:"long",year:"numeric"})},vi=()=>{const[e,t]=(0,a.useState)([]),[s,n]=(0,a.useState)(!0);(0,a.useEffect)(()=>{(async()=>{try{const e=await fetch("".concat(I.fn,"/api/public/recent-gigs")),s=await e.json();if(s.success){const e=[...s.gigs].sort((e,t)=>
1(t.event_date||"").localeCompare(e.event_date||""));t(e)}}catch(e){}finally{n(!1)}})()},[]);const i=[{"@context":"https://schema.org","@type":"CollectionPage",name:"Recent Gigs | Turbo 360",description:"Recent events Turbo 360 has covered across Australia, with what we shot and what we delivered.",url:"https://turbo.net.au/recent-gigs"},{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://turbo.net.au/"},{"@type":"ListItem",position:2,name:"Recent Gigs",item:"https://turbo.net.au/recent-gigs"}]},{"@context":"https://schema.org","@type":"ItemList",itemListElement:e.map((e,t)=>({"@type":"ListItem",position:t+1,url:"https://turbo.net.au/recent-gigs/".concat(e.slug),name:e.job_title}))}];return(0,f.jsxs)(ae.mP,{children:[(0,f.jsx)(R.A,{title:"Recent Gigs | Events We've Covered",description:"Recent events Turbo 360 has photographed and filmed across Australia \u2014 conferences, corporate events and more, delivered same day.",keywords:"recent gigs, event photography case studies, conference photography examples, corporate event coverage, turbo 360 portfolio, event video production australia",canonical:"/recent-gigs",ogType:"website",structuredData:i}),(0,f.jsx)(D.A,{}),(0,f.jsx)(z.A,{}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)(ae.gN,{className:"mx-auto max-w-7xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"Recent Gigs"}),(0,f.jsx)("h1",{className:"m-0 font-display text-[clamp(40px,6vw,84px)] font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke",children:"Events we've covered"}),(0,f.jsx)("p",{className:"mt-7 max-w-2xl text-lg leading-[1.7] text-[#C7C4BD]",children:"A look behind the lens at recent jobs \u2014 what we shot, what we delivered, and how fast it landed in our clients' hands."})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsx)("div",{className:"mx-auto max-w-7xl",children:s?(0,f.jsx)("div",{className:"py-20 text-center font-mono text-[13px] uppercase tracking-[0.16em] text-[#8A8884]",children:"Loading recent gigs\u2026"}):0===e.length?(0,f.jsxs)("div",{className:"py-20 text-center text-[#8A8884]",children:[(0,f.jsx)(Ue.A,{className:"mx-auto mb-3 h-10 w-10 text-[#3a3a3a]"}),"New gigs are on the way. Check back soon."]}):(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] sm:grid-cols-2 md:grid-cols-3",children:e.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)(r.N_,{to:"/recent-gigs/".concat(e.slug),className:"group block overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] transition-colors hover:border-turbo-red",children:[(0,f.jsx)("div",{className:"relative aspect-[16/10] overflow-hidden bg-[#222]",children:e.hero_image?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("img",{src:e.hero_image,alt:e.job_title,loading:"lazy",className:"absolute inset-0 h-full w-full object-cover transition-transform duration-700 ease-turbo group-hover:scale-[1.06]"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 55%,rgba(13,13,13,.55))"}})]}):(0,f.jsx)("div",{className:"flex h-full w-full items-center justify-center text-[#3a3a3a]",children:(0,f.jsx)(Ue.A,{className:"h-8 w-8"})})}),(0,f.jsxs)("div",{className:"p-[22px]",children:[(0,f.jsxs)("div",{className:"mb-2.5 flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[11px] uppercase tracking-[0.16em] text-[#8A8884]",children:[e.event_date&&(0,f.jsx)("span",{children:yi(e.event_date)}),e.location&&(0,f.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,f.jsx)(C.A,{size:12})," ",e.location]})]}),(0,f.jsx)("h2",{className:"font-head text-[20px] font-bold leading-tight text-white transition-colors group-hover:text-turbo-red",children:e.job_title}),e.excerpt&&(0,f.jsx)("p",{className:"mt-3 text-[15px] leading-[1.6] text-[#9C9A95] line-clamp-3",children:e.excerpt}),(0,f.jsxs)("div",{className:"mt-4 flex items-center justify-between",children:[(0,f.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-[0.16em] text-[#8A8884]",children:"Read the story"}),(0,f.jsx)(La.A,{size:18,className:"text-smoke transition-transform duration-[400ms] ease-turbo group-hover:-translate-y-1 group-hover:translate-x-1 group-hover:text-turbo-red"})]})]})]})},e.slug))})})}),(0,f.jsx)(B.A,{})]})};var ji=s(83279),wi=s(72822),Ni=s(21732);function Ai(e){let{gig:t}=e;const{links:s}=(0,Ni.Y8)(t);return s.length?(0,f.jsxs)("nav",{"aria-label":"Related services and venues",className:"mt-12 rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6",children:[(0,f.jsx)("div",{className:"mb-4 font-mono text-[11px] uppercase tracking-[0.16em] text-turbo-red",children:"Related coverage"}),(0,f.jsx)("ul",{className:"space-y-2",children:s.map(e=>(0,f.jsx)("li",{children:(0,f.jsxs)(r.N_,{to:e.to,className:"group flex items-center gap-2 text-[#C7C4BD] transition-colors hover:text-smoke",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 flex-shrink-0 text-turbo-red"}),(0,f.jsx)("span",{children:e.label}),(0,f.jsx)(S.A,{className:"h-4 w-4 text-turbo-red opacity-0 transition-all group-hover:translate-x-1 group-hover:opacity-100"})]})},e.to))})]}):null}const ki=e=>{if(!e)return"";const t=new Date(e);return isNaN(t)?e:t.toLocaleDateString("en-AU",{day:"numeric",month:"long",year:"numeric"})},Si=()=>{var e,t;const{slug:s}=(0,r.g)(),[n,i]=(0,a.useState)(null),[o,l]=(0,a.useState)("loading"),[c,d]=(0,a.useState)("");if((0,a.useEffect)(()=>{(async()=>
1{l("loading");try{const e=await fetch("".concat(I.fn,"/api/public/recent-gigs/").concat(s));if(404===e.status)return void l("notfound");const t=await e.json();t.success?(i(t.gig),l("ok")):l("notfound")}catch(e){l("notfound")}})()},[s]),(0,a.useEffect)(()=>{const e=null===n||void 0===n?void 0:n.showcase_video;if(null===e||void 0===e||!e.playback_url)return void d("");if(e.thumbnail)return void d(e.thumbnail);let t=!1;return(async()=>{try{const s=(await $r()).find(t=>t._id===e.version_id);!t&&null!==s&&void 0!==s&&s.thumbnailUrl&&d(s.thumbnailUrl)}catch(s){}})(),()=>{t=!0}},[n]),"loading"===o)return(0,f.jsxs)(ae.mP,{children:[(0,f.jsx)(D.A,{}),(0,f.jsx)("div",{className:"py-40 text-center font-mono text-sm uppercase tracking-[0.3em] text-fog",children:"Loading\u2026"}),(0,f.jsx)(B.A,{})]});if("notfound"===o)return(0,f.jsxs)(ae.mP,{children:[(0,f.jsx)(R.A,{title:"Gig not found",description:"This recent gig could not be found.",canonical:"/recent-gigs/".concat(s),noIndex:!0}),(0,f.jsx)(D.A,{}),(0,f.jsxs)("div",{className:"mx-auto max-w-2xl px-[22px] py-32 text-center md:px-11",children:[(0,f.jsx)(ae.YZ,{className:"mb-5 justify-center",children:"404"}),(0,f.jsx)("h1",{className:"mb-3 font-display text-3xl font-extrabold tracking-[-0.02em] text-smoke",children:"Gig not found"}),(0,f.jsx)("p",{className:"mb-8 text-[#9C9A95]",children:"This post may have been moved or unpublished."}),(0,f.jsxs)(ae.qM,{to:"/recent-gigs",children:[(0,f.jsx)(Ct.A,{className:"h-4 w-4"})," Back to Recent Gigs"]})]}),(0,f.jsx)(B.A,{})]});const p=n.seo||{},x="/recent-gigs/".concat(n.slug),h=or.default.sanitize(n.blog_html||"",{ADD_ATTR:["loading","target","rel"]}).replace(/href\s*=\s*("|')([^"']*)\1/gi,(e,t,s)=>{const a=s.trim().toLowerCase();return a.startsWith("mailto:")||a.startsWith("tel:")?e:/(contact|enquir|get-?a-?quote|getaquote|\/quote|\/get-quote)/.test(a)?'href="/get-quote"':e});const u=[(0,m.A)({"@context":"https://schema.org","@type":"Article",headline:n.job_title,description:p.meta_description||n.excerpt||"",image:n.hero_image?[n.hero_image]:void 0,datePublished:n.published_at||n.created_at,dateModified:n.updated_at,author:{"@type":"Organization",name:"Turbo 360"},publisher:{"@type":"Organization",name:"Turbo 360",logo:{"@type":"ImageObject",url:"https://turbo.net.au/turbo-logo-new.png"}},mainEntityOfPage:{"@type":"WebPage","@id":"https://turbo.net.au".concat(x)}},n.location?{contentLocation:{"@type":"Place",name:n.location}}:{}),{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://turbo.net.au/"},{"@type":"ListItem",position:2,name:"Recent Gigs",item:"https://turbo.net.au/recent-gigs"},{"@type":"ListItem",position:3,name:n.job_title,item:"https://turbo.net.au".concat(x)}]}];return(0,f.jsxs)(ae.mP,{className:"!pt-0",children:[(0,f.jsx)("style",{children:"\n .gig-article { color: #C7C4BD; font-size: 1.075rem; line-height: 1.75; }\n .gig-article h2 { font-size: 1.7rem; font-weight: 800; margin: 2.25rem 0 0.85rem; color: #F4F2EE; font-family: 'Archivo', system-ui, sans-serif; letter-spacing: -0.01em; }\n .gig-article h3 { font-size: 1.3rem; font-weight: 700; margin: 1.6rem 0 0.5rem; color: #F4F2EE; font-family: 'Archivo', system-ui, sans-serif; }\n .gig-article p { margin: 0 0 1.1rem; }\n .gig-article ul, .gig-article ol { margin: 0 0 1.1rem 1.25rem; }\n .gig-article ul { list-style: disc; }\n .gig-article ol { list-style: decimal; }\n .gig-article li { margin: 0.35rem 0; }\n .gig-article strong, .gig-article b { color: #F4F2EE !important; font-weight: 700; }\n .gig-article a, .gig-article a strong, .gig-article a b { color: #BF212F !important; text-decoration: underline; }\n .gig-article figure { margin: 1.75rem 0; }\n .gig-article img { width: 100%; border-radius: 0.9rem; border: 1px solid #262626; }\n .gig-article figcaption { font-size: 0.85rem; color: #8A8884; text-align: center; margin-top: 0.5rem; font-family: 'Space Mono', ui-monospace, monospace; }\n .gig-article blockquote { border-left: 4px solid #BF212F; padding-left: 1rem; color: #9C9A95; font-style: italic; margin: 1.5rem 0; }\n"}),(0,f.jsx)(R.A,{rawTitle:/turbo 360/i.test(p.meta_title||n.job_title||"")?p.meta_title||n.job_title:"".concat(p.meta_title||n.job_title," | Turbo 360"),description:p.meta_description||n.excerpt||"How Turbo 360 covered ".concat(n.job_title,"."),keywords:(p.keywords||[]).join(", "),canonical:x,ogType:"article",ogImage:n.hero_image||void 0,structuredData:u}),(0,f.jsx)(D.A,{}),(0,f.jsx)(z.A,{}),(0,f.jsxs)("header",{className:"relative overflow-hidden bg-carbon-900 pt-[76px] text-smoke",children:[n.hero_image&&(0,f.jsxs)("div",{className:"absolute inset-0",children:[(0,f.jsx)("img",{src:n.hero_image,alt:n.job_title,className:"h-full w-full scale-105 object-cover object-center opacity-50"}),(0,f.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.32) 0%,rgba(13,13,13,.6) 55%,#0D0D0D 100%)"}}),(0,f.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(90deg,rgba(13,13,13,.55) 0%,transparent 75%)"}})]}),(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"","aria-hidden":!0,
1className:"pointer-events-none absolute right-[-90px] top-[14%] z-[1] hidden w-[420px] -rotate-[7deg] opacity-[0.05] md:block"}),(0,f.jsxs)("div",{className:"relative z-10 mx-auto max-w-7xl px-[22px] pb-24 pt-14 md:px-11 md:pb-32 md:pt-16",children:[(0,f.jsxs)(r.N_,{to:"/recent-gigs",className:"mb-8 flex w-fit items-center gap-2 font-mono text-xs uppercase tracking-[0.16em] text-fog transition-colors hover:text-turbo-red",children:[(0,f.jsx)(Ct.A,{className:"h-4 w-4"})," Back to Recent Gigs"]}),(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)("div",{className:"mb-5 flex items-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsx)(ae.YZ,{children:"Recent Gig"})]}),(0,f.jsx)(ae.nl,{as:"h1",className:"max-w-4xl text-[clamp(40px,6.4vw,86px)] [filter:drop-shadow(0_2px_18px_rgba(0,0,0,0.55))]",children:n.job_title}),(0,f.jsx)("div",{className:"mt-7 h-1 w-20 rounded-full bg-turbo-red"}),n.excerpt&&(0,f.jsx)("p",{className:"mt-7 max-w-2xl text-[clamp(17px,1.5vw,21px)] leading-[1.6] text-[#D9D6CF]",children:n.excerpt}),(0,f.jsxs)("div",{className:"mt-9 flex flex-wrap items-center gap-3",children:[n.event_date&&(0,f.jsxs)("span",{className:"inline-flex items-center gap-2 rounded-full border border-[#2B2B2B] bg-[#1A1A1A] px-4 py-1.5 font-mono text-[12px] uppercase tracking-[0.08em] text-smoke",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4 text-turbo-red"})," ",(0,f.jsx)("time",{dateTime:n.event_date,children:ki(n.event_date)})]}),n.location&&(0,f.jsxs)("span",{className:"inline-flex items-center gap-2 rounded-full border border-[#2B2B2B] bg-[#1A1A1A] px-4 py-1.5 font-mono text-[12px] uppercase tracking-[0.08em] text-smoke",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-turbo-red"})," ",n.location]})]})]})]})]}),(null===(e=n.showcase_video)||void 0===e?void 0:e.playback_url)&&(0,f.jsx)("div",{className:"relative bg-carbon",children:(0,f.jsx)("div",{className:"mx-auto max-w-4xl px-[22px] md:px-11",children:(0,f.jsxs)("div",{className:"relative z-20 pt-10 md:pt-14",children:[(0,f.jsxs)("div",{className:"mb-3 flex items-center gap-2.5 pl-1",children:[(0,f.jsx)(ji.A,{className:"h-4 w-4 text-turbo-red"}),(0,f.jsx)(ae.YZ,{children:"Featured film"})]}),(0,f.jsx)("div",{className:"aspect-video overflow-hidden rounded-xl border border-[#262626] bg-black",children:(0,f.jsx)("video",{controls:!0,playsInline:!0,preload:"metadata",poster:c||n.hero_image||void 0,className:"h-full w-full object-cover",src:n.showcase_video.playback_url})}),n.showcase_video.title&&(0,f.jsx)("p",{className:"mt-3 pl-1 font-mono text-[12px] uppercase tracking-[0.08em] text-fog",children:n.showcase_video.title})]})})}),(0,f.jsxs)("main",{className:"mx-auto max-w-3xl bg-carbon px-[22px] pb-20 pt-12 md:px-11 md:pb-[120px] md:pt-16",children:[(0,f.jsx)("article",{className:"gig-article",dangerouslySetInnerHTML:{__html:h}}),(0,f.jsx)(Ai,{gig:n}),(null===(t=n.gallery)||void 0===t?void 0:t.share_url)&&(0,f.jsxs)("a",{href:n.gallery.share_url,target:"_blank",rel:"noopener noreferrer",className:"group mt-12 flex items-center gap-4 roun
1ded-[10px] border border-[#262626] bg-[#1A1A1A] p-5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)("div",{className:"h-16 w-20 flex-shrink-0 overflow-hidden rounded-lg bg-[#222]",children:n.gallery.thumbnail?(0,f.jsx)("img",{src:n.gallery.thumbnail,alt:"",className:"h-full w-full object-cover transition-transform duration-700 ease-turbo group-hover:scale-[1.06]"}):(0,f.jsx)(wi.A,{className:"m-auto mt-5 h-6 w-6 text-[#555350]"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("div",{className:"font-mono text-[11px] uppercase tracking-[0.16em] text-turbo-red",children:"Full gallery"}),(0,f.jsx)("div",{className:"font-head text-lg font-bold text-smoke",children:n.gallery.name||"View the full gallery"}),n.gallery.photo_count?(0,f.jsxs)("div",{className:"font-mono text-[12px] uppercase tracking-[0.08em] text-fog",children:[n.gallery.photo_count," photos"]}):null]}),(0,f.jsxs)("span",{className:"inline-flex items-center gap-1 font-head text-sm font-bold text-turbo-red",children:["View ",(0,f.jsx)(S.A,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]})]}),(0,f.jsxs)("div",{className:"relative mt-14 overflow-hidden rounded-xl border border-[#262626] bg-carbon-900 p-8 text-center md:p-10",children:[(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 50% 0%,rgba(191,33,47,.22),transparent 60%)"}}),(0,f.jsxs)("div",{className:"relative z-[2]",children:[(0,f.jsx)(ae.YZ,{className:"mb-4 justify-center",children:"Ready"}),(0,f.jsx)("h2",{className:"mb-3 font-display text-[clamp(26px,4vw,40px)] font-extrabold leading-[0.98] tracking-[-0.02em] text-smoke",children:"Got an event coming up?"}),(0,f.jsx)("p",{className:"mx-auto mb-7 max-w-xl text-[#C7C4BD]",children:"Same-day photography, video and live streaming \u2014 anywhere in Australia."}),(0,f.jsxs)(ae.$$,{to:"/get-quote",children:["Get a free quote ",(0,f.jsx)(S.A,{className:"h-4 w-4"})]})]})]})]}),(0,f.jsx)(B.A,{})]})};var _i=s(56898);function Ci(e){let{eventId:t}=e;const[s,n]=(0,a.useState)(null);if((0,a.useEffect)(()=>{if(!t)return;let e=!1;return(async()=>{try{const s=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}").token||"",a=await fetch("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL||"","/api/ka/event-lookup/").concat(t),{headers:{Authorization:"Bearer ".concat(s)}});if(!a.ok)return;const r=await a.json();!e&&r.account&&n(r)}catch(s){}})(),()=>{e=!0}},[t]),!s)return null;const{account:r,booking:i}=s;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,flexWrap:"wrap",background:"#0F0F11",border:"1px solid #26262B",borderRadius:14,padding:"14px 18px",marginBottom:18},children:[(0,f.jsx)("span",{style:{background:"#3A1A1D",color:"#F2A900",borderRadius:5,padding:"4px 8px",fontFamily:"'Space Mono',monospace",fontSize:9,fontWeight:700,letterSpacing:".14em"},children:"KEY ACCOUNT"}),(0,f.jsx)("span",{style:{fontFamily:"'Archivo',sans-serif",fontSize:15,fontWeight:700,color:"#fff"},children:r.name}),i?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{style:{fontFamily:"'Space Mono',monospace",fontSize:11,color:"#9A9AA0"},children:i.job_ref}),(0,f.jsxs)("span",{style:{background:"#DCFCE7",color:"#15803D",borderRadius:5,padding:"4px 8px",fontFamily:"'Space Mono',monospace",fontSize:9,fontWeight:700,letterSpacing:".12em"},children:["BOOKED ",new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(i.total||0)]}),i.confirmed_offline&&(0,f.jsx)("span",{title:"Confirmed outside the portal \u2014 no electronic signature",style:Fi,children:"OFFLINE"})]}):(0,f.jsx)("span",{style:{background:"#FEF3C7",color:"#92400E",borderRadius:5,padding:"4px 8px",fontFamily:"'Space Mono',monospace",fontSize:9,fontWeight:700,letterSpacing:".12em"},children:r.portal_visible?"IN THEIR PORTAL \xb7 NOT BOOKED":"NOT PUBLISHED TO PORTAL"}),s.crew_locked&&(0,f.jsxs)("span",{style:Fi,children:[(0,f.jsx)(ht.A,{size:9,style:{verticalAlign:-1}})," CREW LOCKED"]}),i&&!s.invoiced&&(0,f.jsxs)("span",{style:(0,m.A)((0,m.A)({},Fi),{},{background:"#FEE2E2",color:"#B91C1C"}),children:[(0,f.jsx)(_i.A,{size:9,style:{verticalAlign:-1}})," NOT INVOICED"]}),(0,f.jsxs)("a",{href:r.admin_path,style:{marginLeft:"auto",color:"#fff",background:"#BF212F",textDecoration:"none",borderRadius:9,padding:"8px 14px",fontFamily:"'Archivo',sans-serif",fontSize:12.5,fontWeight:700,display:"inline-flex",alignItems:"center",gap:7},children:["Open ",r.name," hub ",(0,f.jsx)(S.A,{size:13,strokeWidth:2.4})]})]})}const Fi={background:"#141417",color:"#9A9AA0",borderRadius:5,padding:"4px 8px",fontFamily:"'Space Mono',monospace",fontSize:9,fontWeight:700,letterSpacing:".12em"};var Ei=s(27673),Ti=s(58487),zi=s(73002),Bi=s(96817),Di=s(10629),Ii=s(78615),Ri=s(75239);function Pi(e){return e?Array.isArray(e.items)?e.items:e.time||e.contact_name||e.meeting_point?[{id:"legacy",time:e.time||"",contact_name:e.contact_name||"",meeting_point:e.meeting_point||""}]:[]:[]}function Wi(e){const t=(e||"").trim();return t?"https://www.google.com/maps/search/?api=1&query=".concat(encodeURIComponent(t)):null}const Oi={A:{rail:"#BF212F",bg:"#FBEAEC",fg:"#8E1822"},B:{rail:"#0FA3A3",bg:"#E3F4F4",fg:"#0B6E6E"}
1,C:{rail:"#E08600",bg:"#FBF1DC",fg:"#8A5B00"},D:{rail:"#4338CA",bg:"#ECEDFB",fg:"#3730A3"},E:{rail:"#7C3AED",bg:"#F2EAFE",fg:"#5B21B6"}},Li=["A","B","C","D","E"];function Mi(e){const t=e.match(/(?:^|[\s\xb7-])([A-Za-z])$/);if(!t)return null;const s=t[1].toUpperCase();return Oi[s]?s:null}function qi(e){const t=[...new Set(e.map(e=>(null==e?"":String(e)).trim()).filter(Boolean))].sort(),s=new Map,a=new Set;for(const r of t){const e=Mi(r);e&&(s.set(r,Oi[e]),a.add(e))}let n=0;for(const r of t){if(s.has(r))continue;let e=Li.find((e,t)=>t>=n&&!a.has(e));e?n=Li.indexOf(e)+1:e=Li[(n+t.indexOf(r))%Li.length],a.add(e),s.set(r,Oi[e])}return s}function Hi(e){const t=(null==e?"":String(e)).trim(),s=Mi(t);return Oi[s||function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;return Li[e.length?t%Li.length:0]}(t)]}const Ui={rail:"#6B7280",bg:"#F3F4F6",fg:"#374151"};function Gi(e,t){if(!e||0===e.length)return[];const s=qi(e.map(e=>e.stream)),a={},n=[];return e.forEach(e=>{const t=e.time||"00:00";a[t]||(a[t]=[],n.push(t)),a[t].push(e)}),n.sort(),n.map(e=>{const n=a[e],r=[...new Set(n.map(e=>(e.stream||"").trim()).filter(Boolean))].sort(),i=t?t(e):e;if(r.length>=2){const t=r.map(e=>({label:e.toUpperCase(),name:e,style:s.get(e)||Hi(e),items:n.filter(t=>(t.stream||"").trim()===e)})),a=n.filter(e=>!(e.stream||"").trim());return a.length&&t.push({label:"ALL",name:"",style:Ui,items:a}),{id:e,time:e,timeLabel:i,isConcurrent:!0,streams:r,lanes:t,items:n}}return{id:e,time:e,timeLabel:i,isConcurrent:!1,streams:r,items:n}})}function Vi(e){const t=new Set;(e||[]).forEach(e=>{const s=(e.stream||"").trim();s&&t.add(s)});const s=qi([...t]);return[...t].sort().map(e=>({label:e.toUpperCase(),name:e,style:s.get(e)||Hi(e)}))}const Ji={photographer:Ue.A,second_photographer:Ue.A,videographer:Ge.A,second_videographer:Ge.A,voxpop_videographer:Ge.A},Yi=e=>{let{availableRoles:t,activeRole:s,setActiveRole:n}=e;const[r,i]=(0,a.useState)(!1),o=(0,a.useRef)(null);if((0,a.useEffect)(()=>{if(!r)return;const e=e=>{o.current&&!o.current.contains(e.target)&&i(!1)},t=e=>{"Escape"===e.key&&i(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),window.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e),window.removeEventListener("keydown",t)}},[r]),!t||t.length<=1)return null;const l=s||"shared",c=t.find(e=>e.key===l)||t[0],d=c.isShared?Xe.A:Ji[c.key]||Xe.A;return(0,f.jsxs)("div",{ref:o,className:"fixed right-4 z-[99998] flex flex-col items-end gap-2",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) + 60px)"},children:[r&&(0,f.jsxs)("div",{className:"flex flex-col items-end gap-1.5 bg-white border border-gray-200 rounded-2xl shadow-2xl p-2 mb-1 max-w-[80vw]",children:[(0,f.jsxs)("div",{className:"px-2 py-1 text-[10px] font-bold uppercase tracking-[0.25em] text-gray-500 flex items-center gap-2 self-stretch",children:[(0,f.jsx)("span",{children:"Switch view"}),(0,f.jsx)("button",{type:"button",onClick:()=>i(!1),className:"ml-auto p-1 text-gray-400 hover:text-gray-700","aria-label":"Close",children:(0,f.jsx)(g.A,{className:"h-3.5 w-3.5"})})]}),t.filter(e=>!e.isShared).map(e=>{const t=e.key===l,s=Ji[e.key]||Xe.A;return(0,f.jsxs)("button",{type:"button",onClick:()=>{n(e.isShared?null:e.key),i(!1)},className:"w-full inline-flex items-center gap-2 px-3 py-2 rounded-xl text-sm font-semibold transition-colors ".concat(t?"bg-turbo-red text-white":"bg-gray-50 text-gray-800 hover:bg-gray-100"),children:[(0,f.jsx)(s,{className:"h-4 w-4 shrink-0"}),(0,f.jsx)("span",{className:"text-left whitespace-nowrap",children:e.label})]},e.key)})]}),(0,f.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":r,"aria-label":"Current view: ".concat(c.label,". Tap to switch role view."),className:"inline-flex items-center gap-2 pl-3 pr-4 py-3 rounded-full bg-turbo-red text-white font-bold shadow-2xl shadow-turbo-red/40 hover:bg-red-700 transition-colors",children:[(0,f.jsx)(d,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"text-sm",children:c.label}),(0,f.jsx)(Tt.A,{className:"h-3.5 w-3.5 transition-transform ".concat(r?"rotate-180":"")})]})]})},Ki="'Archivo',sans-serif",Zi="'Hanken Grotesk',-apple-system,system-ui,sans-serif",$i="'Space Mono',monospace",Qi={fontFamily:"'Archivo',sans-serif",fontStretch:"125%"}
1,Xi={carbon:"#0A0A0B",ink:"#141414",body:"#2B2B2B",secondary:"#555350",muted:"#8A8884",silver:"#B9B6AF",faint:"#C9C5BD",canvas:"#EDEDF0",paper:"#F4F2EE",card:"#FFFFFF",inset:"#FCFBF9",inset2:"#F4F1EB",hairline:"#E2DED6",divider:"#EFEDE7",railLine:"#1F1F22",red:"#BF212F",redline:"#8E1822",redTint:"#FBEAEC",amber:"#F2A900",amberTint:"#FBF1DC",amberInk:"#8A5B00",amberDeep:"#B45309",teal:"#0FA3A3",tealDeep:"#0E8C8C",tealTint:"#E3F4F4",indigo:"#4338CA",green:"#16A34A",greenText:"#4ADE80",greenInk:"#15803D",greenTint:"#F4FBF6"},eo="linear-gradient(90deg,".concat(Xi.red," 0 33.3%,").concat(Xi.amber," 33.3% 66.6%,").concat(Xi.teal," 66.6% 100%)"),to=[Xi.red,Xi.tealDeep,Xi.amberDeep,Xi.indigo,"#7C3AED"],so=e=>String(e).padStart(2,"0"),ao=e=>(e||"").split(/\s+/).filter(Boolean).map(e=>e[0]).slice(0,2).join("").toUpperCase(),no="\n .tg-item:hover{background:rgba(191,33,47,.05);}\n .tg-add:hover{border-color:".concat(Xi.red,";background:").concat(Xi.redTint,";}\n .tg-done:hover{background:").concat(Xi.red,";}\n .tg-rowhover:hover{background:").concat(Xi.inset,";}\n .tg-edithover:hover{background:").concat(Xi.inset2,";}\n .tg-nav-item:hover{background:rgba(255,255,255,.05);}\n .tg-ghost:hover{background:rgba(255,255,255,.16);}\n .tg-primary:hover{background:").concat(Xi.redline,";}\n .tg-icon-call:hover{background:").concat(Xi.redTint,";border-color:").concat(Xi.red,";}\n .tg-icon-mail:hover{background:").concat(Xi.tealTint,";border-color:").concat(Xi.teal,";}\n .tg-del:hover{color:").concat(Xi.red,";}\n .tg-input:focus{border-color:").concat(Xi.red,"!important;box-shadow:0 0 0 3px rgba(191,33,47,.09);outline:none;background:#fff;}\n @keyframes tg-pulse{0%,100%{opacity:1}50%{opacity:.35}}\n @keyframes tg-pop{from{opacity:0;transform:scale(.97) translateY(8px);}to{opacity:1;transform:scale(1) translateY(0);}}\n @keyframes tg-kenburns{0%{transform:scale(1.06) translate3d(0,0,0);}100%{transform:scale(1.16) translate3d(-2.5%,-1.5%,0);}}\n @keyframes tg-drift{0%{transform:translate(0,-50%) scale(1);opacity:.4;}100%{transform:translate(-26px,-50%) scale(1.05);opacity:.5;}}\n @keyframes tg-signal{0%{transform:translate(50%,-50%) scale(.35);opacity:0;}18%{opacity:.9;}100%{transform:translate(50%,-50%) scale(1.25);opacity:0;}}\n @keyframes tg-glow{0%{opacity:.30;transform:translate(0,0) scale(1);}100%{opacity:.62;transform:translate(40px,-14px) scale(1.18);}}\n @keyframes tg-sweep{0%{transform:translateX(-140%) skewX(-18deg);}55%,100%{transform:translateX(320%) skewX(-18deg);}}\n .tg-mobile-save{display:none;}\n @media (prefers-reduced-motion: reduce){ .tg-fx{animation:none!important;} }\n @media (max-width:1024px){\n /* align-items must flip to stretch with the direction: the desktop shell is\n flex-start (so the sticky rail sizes to itself), but in the column layout\n that would make every promoted rail block and <main> shrink to content\n width and the nav overflow the page. */\n .tg-shell{flex-direction:column!important;align-items:stretch!important;}\n .tg-rail{display:contents!important;}\n .tg-rail-top{padding:20px 20px 0!important;background:").concat(Xi.carbon,"!important;}\n .tg-rail-id{padding:16px 20px 18px!important;background:").concat(Xi.carbon,"!important;}\n .tg-rail-view{padding:0 20px 16px!important;background:").concat(Xi.carbon,"!important;}\n .tg-signal{width:100%!important;}\n .tg-rail-nav{position:sticky!important;top:0!important;z-index:30!important;background:").concat(Xi.carbon,"!important;flex-direction:row!important;overflow-x:auto!important;padding:10px 14px!important;gap:6px!important;border-bottom:1px solid ").concat(Xi.railLine,";}\n .tg-rail-nav a{flex:0 0 auto!important;border-left:none!important;padding:9px 13px!important;}\n .tg-rail-foot{order:9!important;margin-top:0!important;padding:22px 20px 26px!important;background:").concat(Xi.carbon,"!important;}\n .tg-pad{padding-left:22px!important;padding-right:22px!important;}\n .tg-slot{flex-direction:column!important;align-items:stretch!important;gap:10px!important;}\n .tg-gutter{flex:0 0 auto!important;text-align:left!important;display:flex!important;align-items:baseline!important;gap:9px!important;padding-top:0!important;}\n .tg-indent{padding-left:0!important;}\n .tg-role-head{align-items:flex-start!important;}\n .tg-mobile-save{display:inline-flex;}\n }\n @media (max-width:560px){\n .tg-pad{padding-left:16px!important;padding-right:16px!important;}\n .tg-hero{padding-top:34px!important;padding-bottom:30px!important;}\n .tg-glance{grid-template-columns:1fr 1fr!important;}\n }
1\n @media print{\n /* The <=1024px rule sets display:contents!important on the rail, and print\n paper width matches that query \u2014 so these need !important to win. */\n .tg-rail,.tg-rail-top,.tg-rail-id,.tg-rail-view,.tg-rail-nav,.tg-rail-foot,.tg-no-print{display:none!important;}\n .tg-fx{display:none!important;}\n .tg-shell{display:block!important;max-width:none!important;}\n .tg-slot{page-break-inside:avoid;}\n body{background:#fff!important;}\n }\n"),ro=e=>{let{rail:t,children:s}=e;return(0,f.jsxs)("div",{style:{background:Xi.canvas,color:Xi.ink,fontFamily:Zi,WebkitFontSmoothing:"antialiased",minHeight:"100vh",display:"flex",justifyContent:"center"},children:[(0,f.jsx)("style",{children:no}),(0,f.jsxs)("div",{className:"tg-shell",style:{width:"100%",maxWidth:1360,display:"flex",alignItems:"flex-start",background:Xi.paper},children:[(0,f.jsx)("aside",{className:"tg-rail",style:{position:"sticky",top:0,flex:"0 0 296px",alignSelf:"flex-start",height:"100vh",overflow:"auto",background:Xi.carbon,color:"#fff",display:"flex",flexDirection:"column"},children:t}),(0,f.jsx)("main",{style:{flex:"1 1 auto",minWidth:0},children:s})]})]})},io=e=>{let{children:t}=e;return(0,f.jsx)("div",{className:"tg-rail-top",style:{padding:"28px 26px 0"},children:t})},oo=e=>{let{children:t}=e;return(0,f.jsx)("div",{className:"tg-rail-id",style:{padding:"26px 26px 20px"},children:t})},lo=e=>{let{children:t}=e;return(0,f.jsx)("div",{className:"tg-rail-view",style:{padding:"0 26px 20px"},children:t})},co=()=>(0,f.jsx)("div",{className:"tg-signal",style:{height:3,background:eo,flexShrink:0}}),mo=e=>{let{children:t}=e;return(0,f.jsx)("div",{className:"tg-rail-foot",style:{marginTop:"auto",padding:"20px 26px 26px",borderTop:"1px solid ".concat(Xi.railLine)},children:t})},po=e=>{let{icon:t,color:s,children:a}=e;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,fontFamily:$i,fontSize:11,color:Xi.silver},children:[t&&(0,f.jsx)(t,{size:12,color:s,strokeWidth:2,style:{flexShrink:0}}),(0,f.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:a})]})},xo=e=>{let{items:t,activeAnchor:s,onSelect:a}=e;return(0,f.jsx)("nav",{className:"tg-rail-nav",style:{padding:"20px 16px",display:"flex",flexDirection:"column",gap:2},children:t.map(e=>{const t=e.anchor===s;return(0,f.jsxs)("a",{href:"#".concat(e.anchor),className:"tg-nav-item",onClick:t=>{a&&a(e.anchor,t)},style:{display:"flex",alignItems:"center",gap:12,textDecoration:"none",padding:"10px 12px",borderRadius:4,background:t?"rgba(191,33,47,.16)":"transparent",borderLeft:"2px solid ".concat(t?Xi.red:"transparent")},children:[(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10,fontWeight:700,letterSpacing:".1em",color:t?Xi.red:Xi.secondary},children:e.num}),(0,f.jsx)("span",{style:{flex:"1 1 auto",fontFamily:Ki,fontSize:13,fontWeight:700,color:t?"#fff":Xi.silver,whiteSpace:"nowrap"},children:e.label}),(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10,fontWeight:700,color:t?"#fff":Xi.secondary},children:e.count})]},e.anchor)})})},ho=e=>{let{text:t,fg:s,dot:a,onRetry:n}=e;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:18,fontFamily:$i,fontSize:10,fontWeight:700,letterSpacing:".08em",color:s},children:[(0,f.jsx)("span",{style:{width:7,height:7,borderRadius:"50%",background:a,flexShrink:0}}),t,n&&(0,f.jsx)("button",{type:"button",onClick:n,style:{marginLeft:2,fontFamily:$i,fontSize:9.5,fontWeight:700,letterSpacing:".06em",border:0,background:Xi.red,color:"#fff",borderRadius:3,padding:"4px 8px",cursor:"pointer"},children:"RETRY"})]})},uo=e=>{let{kicker:t,actions:s,title:a,children:n,image:r="/runsheet-hero.jpg"}=e;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("section",{className:"tg-pad tg-hero",style:{position:"relative",background:Xi.carbon,color:"#fff",padding:"52px 56px 46px",overflow:"hidden"},children:[(0,f.jsx)("img",{className:"tg-fx",src:r,alt:"","aria-hidden":"true",style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",opacity:.6,filter:"grayscale(1) contrast(1.15) brightness(.62)",pointerEvents:"none",animation:"tg-kenburns 26s cubic-bezier(0.16,1,0.3,1) infinite alternate"}}),(0,f.jsx)("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, rgba(10,10,11,.92) 0%, rgba(10,10,11,.6) 45%, rgba(10,10,11,.28) 100%)",pointerEvents:"none"}}),(0,f.jsx)("div",{style:{position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(10,10,11,.5) 0%, rgba(10,10,11,.08) 40%, rgba(10,10,11,.62) 100%)",pointerEvents:"none"}}),(0,f.jsx)("div",{className:"tg-fx",style:{position:"absolute",inset:"-20% -10%",background:"radial-gradient(closest-side, rgba(191,33,47,.55), rgba(191,33,47,0) 70%)",filter:"blur(30px)",mixBlendMode:"screen",pointerEvents:"none",animation:"tg-glow 11s cubic-bezier(0.16,1,0.3,1) infinite alternate"}}),(0,f.jsx)("div",{className:"tg-fx",style:{position:"absolute",top:"50%",right:"6%",width:"120vh",height:"120vh",transform:"translate(50%,-50%)",borderRadius:"50%",background:"repeating-radial-gradient(circle, rgba(242,169,0,.14) 0 1.5px, rgba(242,169,0,0) 1.5px 74px)",pointerEvents:"none",animation:"tg-signal 7s cubic-bezier(0.16,1,0.3,1) infinite"}}),(0,f.jsx)("div",{className:"tg-fx",style:{position:"absolute",top:0,bottom:0,left:0,width:"26%",background:"linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.07), rgba(255,255,255,0))",pointerEvents:"none",animation:"tg-sweep 7.5s cubic-bezier(0.16,1,0.3,1) infinite"}}),(0,f.jsx)("img",{className:"tg-fx",src:"/turbo-mark-white.png",alt:"","aria-hidden":"true",style:{position:"absolute",right:-90,top:"50%",transform:"translateY(-50%)",width:440,height:"auto",opacity:.4,pointerEvents:"none",animation:"tg-drift 13s cubic-bezier(0.16,1,0.3,1) infinite alternate"}}),(0,f.jsxs)("div",{style:{position:"relative",display:"flex",justifyContent:"space-between",alignItems:"flex-start",ga
1p:20,flexWrap:"wrap"},children:[(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:10,fontWeight:700,letterSpacing:".26em",color:Xi.amber},children:t}),s&&(0,f.jsx)("div",{className:"tg-no-print",style:{display:"flex",gap:8},children:s})]}),(0,f.jsx)("h1",{style:(0,m.A)((0,m.A)({},Qi),{},{position:"relative",fontWeight:900,fontSize:"clamp(32px,4.2vw,52px)",lineHeight:.98,letterSpacing:"-.025em",textTransform:"uppercase",margin:"26px 0 0",maxWidth:"14ch"}),children:a}),n]}),(0,f.jsx)("div",{style:{height:4,background:eo}})]})},go=e=>{let{onClick:t,children:s,disabled:a}=e;return(0,f.jsx)("button",{type:"button",onClick:t,disabled:a,className:"tg-ghost",style:{display:"inline-flex",alignItems:"center",gap:7,background:"rgba(255,255,255,.08)",border:"1px solid rgba(255,255,255,.16)",color:"#fff",borderRadius:4,padding:"9px 15px",fontFamily:Ki,fontSize:12.5,fontWeight:700,cursor:"pointer",opacity:a?.6:1},children:s})},fo=e=>{let{onClick:t,children:s,disabled:a}=e;return(0,f.jsx)("button",{type:"button",onClick:t,disabled:a,className:"tg-primary",style:{display:"inline-flex",alignItems:"center",gap:7,background:Xi.red,border:"1px solid ".concat(Xi.red),color:"#fff",borderRadius:4,padding:"9px 15px",fontFamily:Ki,fontSize:12.5,fontWeight:700,cursor:"pointer",opacity:a?.6:1},children:s})},bo=e=>{let{id:t,top:s=44,children:a}=e;return(0,f.jsx)("section",{id:t,className:"tg-pad",style:{padding:"".concat(s,"px 56px 0"),scrollMarginTop:70},children:a})},yo=e=>{let{num:t,title:s,tag:a,tagBg:n=Xi.red,tagFg:r="#fff",trailing:i}=e;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:11,fontWeight:700,letterSpacing:".16em",color:Xi.red},children:t}),(0,f.jsx)("h2",{style:(0,m.A)((0,m.A)({},Qi),{},{fontWeight:800,fontSize:15,letterSpacing:".02em",textTransform:"uppercase",margin:0}),children:s}),(0,f.jsx)("span",{style:{flex:"1 1 auto",height:1,background:Xi.hairline,minWidth:12}}
1),a&&(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:9,fontWeight:700,letterSpacing:".14em",color:r,background:n,borderRadius:3,padding:"3px 7px"},children:a}),i]})},vo=e=>{let{children:t,color:s=Xi.silver}=e;return(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:9,fontWeight:700,letterSpacing:".18em",color:s,marginBottom:10},children:t})},jo=e=>{let{bg:t,fg:s,children:a}=e;return(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:8,fontWeight:700,letterSpacing:".1em",background:t,color:s,borderRadius:3,padding:"2px 6px"},children:a})},wo=e=>{let{children:t}=e;return(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:10.5,letterSpacing:".08em",textTransform:"uppercase",color:Xi.faint,textAlign:"center",border:"1px dashed ".concat(Xi.hairline),borderRadius:4,padding:"22px 16px"},children:t})},No=e=>{let{children:t,min:s=170}=e;return(0,f.jsx)("div",{className:"tg-glance",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(".concat(s,"px,1fr))"),gap:1,background:Xi.hairline,border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:t})},Ao=e=>{let{label:t,value:s,dark:a}=e;return(0,f.jsxs)("div",{style:{background:a?Xi.carbon:Xi.card,color:a?"#fff":Xi.ink,padding:"20px 22px"},children:[(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:9,fontWeight:700,letterSpacing:".18em",color:a?Xi.amber:Xi.silver},children:t}),(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:26,fontWeight:700,letterSpacing:"-.02em",marginTop:8},children:s})]})},ko=e=>{let{time:t,concurrentCount:s,timeColor:a=Xi.ink,children:n}=e;const{clock:r,meridiem:i}=(e=>{if(!e)return{clock:"",meridiem:""};const[t,s]=String(e).split(":"),a=parseInt(t,10);return Number.isNaN(a)?{clock:String(e),meridiem:""}:{clock:"".concat(a%12||12,":").concat(s),meridiem:a>=12?"PM":"AM"}})(t);return(0,f.jsxs)("div",{className:"tg-slot",style:{display:"flex",gap:20,alignItems:"flex-start",marginBottom:18},children:[(0,f.jsxs)("div",{className:"tg-gutter",style:{flex:"0 0 84px",textAlign:"right",paddingTop:2},children:[(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:15,fontWeight:700,letterSpacing:"-.01em",color:a},children:r}),(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:9.5,fontWeight:700,letterSpacing:".14em",color:Xi.silver,marginTop:2},children:i}),s>1&&(0,f.jsxs)("div",{style:{display:"inline-block",marginTop:8,fontFamily:$i,fontSize:8.5,fontWeight:700,letterSpacing:".1em",color:"#fff",background:Xi.red,borderRadius:2,padding:"3px 6px"},children:[s,"\xd7"]})]}),(0,f.jsx)("div",{style:{flex:"1 1 auto",minWidth:0},children:n})]})},So=e=>{let{children:t}=e;return(0,f.jsxs)("div",{className:"tg-indent",style:{display:"flex",alignItems:"center",gap:12,margin:"0 0 16px",paddingLeft:104,flexWrap:"wrap"},children:[t,(0,f.jsx)("span",{style:{flex:"1 1 auto",height:1,background:Xi.hairline,minWidth:12}}
1)]})},_o=e=>{let{legend:t}=e;return t&&0!==t.length?(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:9,fontWeight:700,letterSpacing:".16em",color:Xi.silver},children:"STREAMS"}),t.map(e=>(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7},children:[(0,f.jsx)("span",{style:{width:10,height:10,borderRadius:2,background:e.style.rail,flexShrink:0}}),(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10,fontWeight:700,letterSpacing:".06em",color:e.style.fg},children:e.label})]},e.label))]}):null},Co=e=>{let{children:t}=e;return(0,f.jsxs)("footer",{className:"tg-pad",style:{marginTop:56,background:Xi.carbon,color:"#fff",padding:"34px 56px",display:"flex",justifyContent:"space-between",alignItems:"center",gap:20,flexWrap:"wrap"},children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",style:{height:24,width:"auto",display:"block"}}),(0,f.jsx)("div",{style:{display:"flex",gap:24,flexWrap:"wrap",fontFamily:$i,fontSize:10.5,letterSpacing:".1em",color:Xi.muted},children:t})]})},Fo=e=>{let{text:t,fg:s,dot:a,onRetry:n}=e;return(0,f.jsxs)("div",{className:"tg-mobile-save tg-no-print",style:{position:"fixed",right:16,bottom:16,zIndex:150,alignItems:"center",gap:9,background:Xi.card,border:"1px solid ".concat(Xi.hairline),borderRadius:999,padding:"9px 16px",boxShadow:"0 12px 32px -12px rgba(20,20,20,.4)",animation:"tg-pop .25s cubic-bezier(0.16,1,0.3,1)"},children:[(0,f.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:a}}),(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10.5,fontWeight:700,letterSpacing:".06em",color:s},children:t}),n&&(0,f.jsx)("button",{type:"button",onClick:n,style:{marginLeft:2,fontFamily:$i,fontSize:10,fontWeight:700,border:0,background:Xi.red,color:"#fff",borderRadius:4,padding:"5px 9px",cursor:"pointer"},children:"RETRY"})]})},Eo=(e,t)=>{const[s,n]=(0,a.useState)(t||e&&e[0]),r=(e||[]).join("|");return(0,a.useEffect)(()=>{const t=(e||[]).map(e=>document.getElementById(e)).filter(Boolean);if(0===t.length)return;const s=new IntersectionObserver(e=>{const t=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top);t[0]&&n(t[0].target.id)},{rootMargin:"-15% 0px -70% 0px",threshold:0});return t.forEach(e=>s.observe(e)),()=>s.disconnect()},[r]),[s,n]},To=e=>{var t;const{event:s,photographyStandards:n,videographyStandards:r,saveNotification:i,checklistCompletions:o,priorityStandCompletions:l,timedEventCompletions:c,editingContact:d,editingBriefing:p,contactFormData:x,setContactFormData:h,briefingFormData:u,setBriefingFormData:b,isSaving:y,handleShare:v,handleDownloadPDF:j,showShareNotification:w,isGeneratingPDF:N,formatDate:A,formatTime:k,startEditingContact:S,cancelEditingContact:_,saveContactChanges:F,startEditingBriefing:z,cancelEditingBriefing:B,saveBriefingChanges:D,toggleChecklistItem:I,togglePriorityStand:R,toggleTimedEvent:P,toggleVoxpopItem:W,downloadDocument:O,shouldShowPhotographyStandards:L,shouldShowVideographyStandards:M,availableRoles:q,activeRole:H,setActiveRole:U,activeRunsheet:G,getTimezoneDisplay:V}=e,J="multi"===(null===s||void 0===s?void 0:s.event_duration_type),Y=V?V():"",K=(null===s||void 0===s?void 0:s.event_timezone)||void 0,Z=(()=>{try{return new Intl.DateTimeFormat("en-CA",{timeZone:K}).format(new Date)}catch(e){return null}})(),$=(()=>{try{return new Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:K}).format(new Date)}catch(e){return null}})(),Q=e=>!!e&&!!Z&&String(e).slice(0,10)===Z,X=e=>null!=c[e.id]?!!c[e.id]:!!e.completed,ee=(0,a.useMemo)(()=>((null===s||void 0===s?void 0:s.crew_members)||[]).filter(e=>e&&e.name),[s]),te=(null===s||void 0===s?void 0:s.deliverables)||[],se=(null===s||void 0===s?void 0:s.must_capture_checklist)||[],ae=(null===s||void 0===s?void 0:s.priority_sponsor_stands)||[],ne=null!==s&&void 0!==s&&null!==(t=s.voxpops)&&void 0!==t&&t.enabled?Pi(null===s||void 0===s?void 0:s.voxpops):[],re=((null===s||void 0===s?void 0:s.supporting_documents)||[]).filter(Boolean);let ie=((null===s||void 0===s?void 0:s.client_contacts)||[]).filter(e=>e&&e.name);const oe=0===ie.length;oe&&(null!==s&&void 0!==s&&s.primary_contact||null!==s&&void 0!==s&&s.email||null!==s&&void 0!==s&&s.mobile)&&(ie=[{name:s.primary_contact||"Primary contact",email:s.email,mobile:s.mobile,role:"Primary contact",is_primary:!0}]);const le=L&&L()&&n,ce=M&&M()&&r,de=le||ce,me=(null===s||void 0===s?void 0:s.masv_upload_enabled)||(null===s||void 0===s?void 0:s.show_crew_upload_instructions)||(null===s||void 0===s?void 0:s.show_generic_upload_instructions),pe=de||me,xe=q||[],he=xe.length>1,ue=H||"shared",ge=!G||!G.crewName&&G.isShared?null:G,fe=(0,a.useMemo)(()=>J?((null===s||void 0===s?void 0:s.event_days)||[]).reduce((e,t)=>
1e.concat(t.timed_events||[]),[]):(null===s||void 0===s?void 0:s.timed_events)||[],[s,J]),be=fe.filter(X).length,ye=fe.length?Math.round(be/fe.length*100):0,ve=(0,a.useMemo)(()=>Vi(fe),[fe]),je=se.filter(e=>o[e.id]).length,we=ae.filter(e=>l[e.id]).length,Ne=ne.filter(e=>e.completed).length,{nowCue:Ae,nextCue:ke}=(0,a.useMemo)(()=>{const e=J?((null===s||void 0===s?void 0:s.event_days)||[]).filter(e=>Q(e.date)).reduce((e,t)=>e.concat(t.timed_events||[]),[]):Q(null===s||void 0===s?void 0:s.event_date)&&(null===s||void 0===s?void 0:s.timed_events)||[];if(0===e.length||!$){const e=[...fe].filter(e=>e.time).sort((e,t)=>e.time.localeCompare(t.time))[0];return{nowCue:{time:"\u2014",label:"Not shooting today"},nextCue:e?{time:k(e.time),label:e.description||"Untitled"}:{time:"\u2014",label:"Nothing scheduled"}}}const t=[...e].filter(e=>e.time).sort((e,t)=>e.time.localeCompare(t.time)),a=[...t].reverse().find(e=>e.time<=$),n=t.find(e=>e.time>$);return{nowCue:a?{time:k(a.time),label:a.description||"Untitled"}:{time:"\u2014",label:"Not started yet"},nextCue:n?{time:k(n.time),label:n.description||"Untitled"}:{time:"\u2014",label:"Wrap"}}},[s,J,$,Z,fe]),Se=(0,a.useMemo)(()=>{const e=[];let t=1;const s=(s,a,n)=>{e.push({anchor:s,num:so(t++),label:a,count:n})};return s("contact","Contact",""),s("briefing","Briefing",""),pe&&s("imagery-standards","Standards",""),ee.length&&s("crew","Crew",String(ee.length)),fe.length&&s("timeline","Timeline","".concat(be,"/").concat(fe.length)),se.length&&s("checklist","Must-capture","".concat(je,"/").concat(se.length)),ae.length&&s("sponsor-stands","Sponsors","".concat(we,"/").concat(ae.length)),ne.length&&s("voxpops","Voxpops","".concat(Ne,"/").concat(ne.length)),re.length&&s("documents","Documents",String(re.length)),e},[pe,ee.length,fe.length,be,se.length,je,ae.length,we,ne.length,Ne,re.length]),[_e,Ce]=Eo(Se.map(e=>e.anchor),"contact"),Fe=y?{text:"SAVING\u2026",fg:Xi.amber,dot:Xi.amber}:i?"error"===i.type?{text:String(i.message||"SAVE FAILED").toUpperCase(),fg:Xi.red,dot:Xi.red}:{text:"SAVED",fg:Xi.greenText,dot:Xi.green}:{text:"ALL CHANGES SAVED",fg:Xi.muted,dot:Xi.secondary},Ee=null!==s&&void 0!==s&&s.start_time?k(s.start_time):"",Te=[null!==s&&void 0!==s&&s.event_date?A(s.event_date):"",Ee?"CALL ".concat(Ee):""].filter(Boolean).join(" \xb7 "),ze=e=>{let{te:t,dayId:s,isNow:a}=e;const n=X(t),r=t.stream&&t.stream.trim()?Hi(t.stream):{rail:Xi.red,fg:Xi.redline},i=n?Xi.green:r.rail;return(0,f.jsxs)("div",{onClick:()=>P(t.id,s),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),P(t.id,s))},className:"tg-item",style:{cursor:"pointer",display:"flex",gap:12,alignItems:"flex-start",borderRadius:4,padding:"11px 12px",margin:"-11px -12px"},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",width:26,height:26,borderRadius:4,border:"2px solid ".concat(i),background:n?Xi.green:"transparent",display:"flex",alignItems:"center",justifyContent:"center",marginTop:1},children:n&&(0,f.jsx)(zt.A,{size:15,color:"#fff",strokeWidth:3.4})}),(0,f.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:Zi,fontSize:15,fontWeight:600,lineHeight:1.35,color:n?Xi.muted:Xi.ink,textDecoration:n?"line-through":"none"},children:t.description||t.title||"Untitled"}),a&&!n&&(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:8.5,fontWeight:700,letterSpacing:".14em",color:"#fff",background:Xi.red,borderRadius:2,padding:"3px 7px",animation:"tg-pulse 1.6s infinite"},children:"\u25cf NOW"})]}),t.location&&(0,f.jsxs)("a",{href:Wi(t.location),target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),style:{display:"inline-flex",alignItems:"center",gap:5,marginTop:7,fontFamily:$i,fontSize:10.5,fontWeight:700,letterSpacing:".08em",textTransform:"uppercase",color:Xi.tealDeep,textDecoration:"none"},children:[(0,f.jsx)(C.A,{size:11,strokeWidth:2.2}),t.location]}),t.notes&&(0,f.jsx)("div",{style:{marginTop:8,paddingLeft:11,borderLeft:"2px solid ".concat(Xi.divider),fontFamily:Zi,fontSize:13,color:Xi.muted,lineHeight:1.5,whiteSpace:"pre-line"},children:t.notes}),n&&(0,f.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:5,marginTop:9,fontFamily:$i,fontSize:9.5,fontWeight:700,letterSpacing:".1em",color:Xi.greenInk},children:[(0,f.jsx)(zt.A,{size:11,strokeWidth:3}),t.completed_by?"DONE \xb7 ".concat(String(t.completed_by).toUpperCase()):"DONE"]})]})]})},Be=(e,t,s)=>{const a=Gi(e||[],k);if(0===a.length)return(0,f.jsx)("div",{className:"tg-indent",style:{paddingLeft:104,marginBottom:16},children:(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:10.5,letterSpacing:".08em",textTransform:"uppercase",color:Xi.faint,padding:"18px 0"}
1,children:"No schedule items yet"})});const n=((e,t)=>{if(!t||!$)return null;let s=null;return e.forEach(e=>{e.time<=$&&(s=e.id)}),s})(a,s);return a.map(e=>{const s=e.id===n,a=e.isConcurrent?e.lanes.reduce((e,t)=>e.concat(t.items),[]):e.items,r=a.filter(X).length,i=r===a.length&&a.length>0;return(0,f.jsx)(ko,{time:e.time,timeColor:s?Xi.red:Xi.ink,concurrentCount:e.isConcurrent?e.streams.length:0,children:e.isConcurrent?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,background:Xi.carbon,border:"1px solid ".concat(s?Xi.red:Xi.carbon),borderBottom:"none",borderRadius:"4px 4px 0 0",padding:"9px 14px",flexWrap:"wrap"},children:[(0,f.jsxs)("span",{style:{fontFamily:$i,fontSize:9.5,fontWeight:700,letterSpacing:".16em",color:Xi.amber},children:[e.streams.length," STREAMS RUNNING TOGETHER"]}),s&&(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:8.5,fontWeight:700,letterSpacing:".14em",color:"#fff",background:Xi.red,borderRadius:2,padding:"3px 7px",animation:"tg-pulse 1.6s infinite"},children:"\u25cf NOW"}),(0,f.jsx)("span",{style:{flex:"1 1 auto",height:1,background:Xi.body,minWidth:20}}),(0,f.jsxs)("span",{style:{fontFamily:$i,fontSize:9.5,fontWeight:700,letterSpacing:".1em",color:i?Xi.greenText:Xi.muted},children:[r,"/",a.length," DONE"]})]}),(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(230px,1fr))",gap:1,background:Xi.hairline,border:"1px solid ".concat(Xi.hairline),borderTop:"none",borderRadius:"0 0 4px 4px",overflow:"hidden"},children:e.lanes.map(e=>{const a=e.items.length>0&&e.items.every(X);return(0,f.jsxs)("div",{style:{background:a?Xi.greenTint:Xi.card,borderTop:"3px solid ".concat(a?Xi.green:e.style.rail),padding:"14px 16px"},children:[(0,f.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:11,flexWrap:"wrap"},children:(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10,fontWeight:700,letterSpacing:".12em",color:a?Xi.greenInk:e.style.fg},children:e.label})}),(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:e.items.map(e=>(0,f.jsx)(ze,{te:e,dayId:t,isNow:s},e.id))})]},e.label)})})]}):(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:e.items.map(e=>{const a=X(e);return(0,f.jsx)("div",{style:{background:a?Xi.greenTint:Xi.card,border:"1px solid ".concat(Xi.hairline),borderLeft:"3px solid ".concat(a?Xi.green:Xi.red),borderRadius:4,padding:"15px 17px"},children:(0,f.jsx)(ze,{te:e,dayId:t,isNow:s})},e.id)})})},e.id)})},De=e=>{let{done:t,onToggle:s,accent:a,last:n,children:r}=e;return(0,f.jsxs)("div",{onClick:s,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),s())},className:"tg-rowhover",style:{background:t?Xi.greenTint:Xi.card,display:"flex",alignItems:"center",gap:13,padding:"14px 17px",borderBottom:n?"none":"1px solid ".concat(Xi.divider),cursor:"pointer"},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",width:24,height:24,borderRadius:4,border:"2px solid ".concat(t?Xi.green:a),background:t?Xi.green:"transparent",display:"flex",alignItems:"center",justifyContent:"center"},children:t&&(0,f.jsx)(zt.A,{size:13,color:"#fff",strokeWidth:3.4})}),(0,f.jsx)("span",{style:{flex:"1 1 auto",fontSize:14,fontWeight:500,color:t?Xi.muted:Xi.body,textDecoration:t?"line-through":"none"},children:r})]})},Ie=e=>{let{done:t,total:s}=e;return(0,f.jsxs)("span",{style:{fontFamily:$i,fontSize:10.5,fontWeight:700,color:t===s&&s>0?Xi.greenInk:Xi.silver},children:[t,"/",s]})},Re=(e,t)=>(0,f.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:9},children:[(0,f.jsxs)("button",{type:"button",onClick:e,style:{display:"inline-flex",alignItems:"center",gap:5,background:Xi.inset2,border:"none",borderRadius:4,padding:"9px 15px",fontFamily:Ki,fontWeight:700,fontSize:12.5,color:Xi.secondary,cursor:"pointer"},children:[(0,f.jsx)(g.A,{size:13}),"Cancel"]}),(0,f.jsxs)("button",{type:"button",onClick:t,disabled:y,className:"tg-done",style:{display:"inline-flex",alignItems:"center",gap:5,background:Xi.ink,border:"none",borderRadius:4,padding:"9px 17px",fontFamily:Ki,fontWeight:700,fontSize:12.5,color:"#fff",cursor:"pointer"},children:[(0,f.jsx)(ia.A,{size:13}),y?"Saving\u2026":"Save"]})]}),Pe={fontFamily:Zi,fontSize:14,padding:"10px 12px",border:"1px solid ".concat(Xi.hairline),borderRadius:4,background:Xi.inset,outline:"none",color:Xi.body},We=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(io,{children:(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",style:{height:28,width:"auto",display:"block"}})}),(0,f.jsxs)(oo,{children:[(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:9.5,fontWeight:700,letterSpacing:".24em",color:Xi.red},children:"CREW RUNSHEET"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Qi),{},{fontWeight:900,fontSize:21,lineHeight:1.12,letterSpacing:"-.01em",marginTop:10}),children:null===s||void 0===s?void 0:s.event_name}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:7,marginTop:16},children:[Te&&(0,f.jsx)(po,{icon:_t.A,color:Xi.amber,children:Te}),(null===s||void 0===s?void 0:s.venue)&&(0,f.jsx)(po,{icon:C.A,color:Xi.teal,children:s.venue.toUpperCase()}),Y&&(0,f.jsx)(po,{icon:et.A,color:Xi.teal,children:Y})]})]}),(ge||he)&&(0,f.jsxs)(lo,{children:[ge&&(0,f.jsxs)("div",{style:{border:"1px solid ".concat(Xi.railLine),borderLeft:"2px s
1olid ".concat(Xi.teal),borderRadius:4,padding:"13px 15px"},children:[(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:8.5,fontWeight:700,letterSpacing:".18em",color:Xi.secondary},children:ge.crewName?"YOU'RE VIEWING AS":"VIEWING RUNSHEET"}),(0,f.jsx)("div",{style:{fontFamily:Ki,fontSize:15,fontWeight:800,marginTop:5},children:ge.crewName||ge.label}),(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:10,letterSpacing:".08em",textTransform:"uppercase",color:Xi.teal,marginTop:3},children:ge.crewName?ge.label:"Tap any card to tick it off"})]}),he&&(0,f.jsx)("div",{style:{display:"flex",gap:6,marginTop:ge?12:0,flexWrap:"wrap"},children:xe.map(e=>{const t=e.key===ue;return(0,f.jsx)("button",{type:"button",onClick:()=>U(e.isShared?null:e.key),style:{flex:"1 1 auto",fontFamily:Ki,fontSize:12,fontWeight:700,color:t?"#fff":Xi.muted,background:t?Xi.red:"transparent",border:"1px solid ".concat(t?Xi.red:Xi.railLine),borderRadius:4,padding:"9px 8px",cursor:"pointer"},children:e.label},e.key)})})]}),(0,f.jsx)(co,{}),(0,f.jsx)(xo,{items:Se,activeAnchor:_e,onSelect:Ce}),(0,f.jsxs)(mo,{children:[(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:9,fontWeight:700,letterSpacing:".18em",color:Xi.red,marginBottom:12},children:"ON-DAY SUPPORT"}),(0,f.jsxs)("a",{href:"tel:1300207446",className:"tg-primary",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,width:"100%",boxSizing:"border-box",background:Xi.red,color:"#fff",textDecoration:"none",borderRadius:4,padding:11,fontFamily:Ki,fontSize:12.5,fontWeight:700},children:[(0,f.jsx)(E.A,{size:13,strokeWidth:2}),"1300 207 446"]}),(0,f.jsx)(ho,(0,m.A)({},Fe))]})]});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Yi,{availableRoles:q,activeRole:H,setActiveRole:U}),(0,f.jsxs)(ro,{rail:We,children:[(0,f.jsx)("div",{id:"overview",style:{scrollMarginTop:70},children:(0,f.jsx)(uo,{kicker:"SHOOT DAY".concat(null!==s&&void 0!==s&&s.masv_job_code?" \xb7 JOB #".concat(s.masv_job_code):""),title:null===s||void 0===s?void 0:s.event_name,actions:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(go,{onClick:j,disabled:N,children:[(0,f.jsx)(es.A,{size:14,strokeWidth:2}),N?"Preparing\u2026":"PDF"]}),(0,f.jsxs)(go,{onClick:()=>window.print(),children:[(0,f.jsx)(Sr.A,{size:14,strokeWidth:2}),"Print"]}),(0,f.jsxs)(fo,{onClick:v,children:[w?(0,f.jsx)(zt.A,{size:14,strokeWidth:2.4}):(0,f.jsx)(at.A,{size:14,strokeWidth:2}),w?"Copied":"Share"]})]}),children:(0,f.jsxs)("div",{style:{position:"relative",display:"flex",gap:10,flexWrap:"wrap",marginTop:26},children:[(0,f.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:10,background:"rgba(191,33,47,.22)",border:"1px solid ".concat(Xi.red),borderRadius:4,padding:"10px 15px"},children:[(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:"#fff",background:Xi.red,borderRadius:2,padding:"3px 7px",animation:"tg-pulse 1.6s infinite"},children:"\u25cf NOW"}),(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:12,fontWeight:700,color:"#fff"},children:Ae.time}),(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600,color:"#fff"},children:Ae.label})]}),(0,f.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:10,background:"rgba(255,255,255,.07)",border:"1px solid rgba(255,255,255,.14)",borderRadius:4,padding:"10px 15px"},children:[(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:Xi.amber},children:"NEXT"}),(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:12,fontWeight:700,color:"#fff"},children:ke.time}),(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600,color:Xi.silver},children:ke.label})]}),(null===s||void 0===s?void 0:s.event_website)&&(0,f.jsxs)("a",{href:s.event_website,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:7,background:"rgba(255,255,255,.07)",border:"1px solid rgba(255,255,255,.14)",borderRadius:4,padding:"10px 15px",fontSize:12.5,fontWeight:600,color:Xi.teal,textDecoration:"none"},children:[(0,f.jsx)(et.A,{size:14,strokeWidth:2}),s.event_website.replace(/^https?:\/\//,"")]})]})})}),(0,f.jsx)(bo,{top:36,children:(0,f.jsxs)(No,{children:[(0,f.jsx)(Ao,{dark:!0,label:"TIMELINE",value:fe.length?"".concat(be,"/").concat(fe.length):"\u2014"}),se.length>0&&(0,f.jsx)(Ao,{label:"MUST-CAPTURE",value:"".concat(je,"/").concat(se.length)}),ae.length>0&&(0,f.jsx)(Ao,{label:"SPONSORS",value:"".concat(we,"/").concat(ae.length)}),ne.length>0&&(0,f.jsx)(Ao,{label:"VOXPOPS",value:"".concat(Ne,"/").concat(ne.length)}),ee.length>0&&(0,f.jsx)(Ao,{label:"CREW",value:so(ee.length)})]})}),(0,f.jsxs)(bo,{id:"contact",children:[(0,f.jsx)(yo,{num:"01",title:"Contact & Deliverables",tag:oe?"EDITABLE":null}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(300px,1fr))",gap:20},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(vo,{children:"CLIENT ON SITE"}),d?(0,f.jsxs)("div",{style:{background:Xi.card,border:"1px solid ".concat(Xi.hairline),borderRadius:4,padding:"16px 18px",display:"flex",flexDirection:"column",gap:10},children:[(0,f.jsx)("input",{value:x.primary_contact||"",onChange:e=>h((0,m.A)((0,m.A)({},x),{},{primary_contact:e.target.value})),placeholder:"Contact name",style:Pe}),(0,f.jsx)("input",{value:x.mobile||"",onChange:e=>h((0,m.A)((0,m.A)({},x),{},{mobile:e.target.value})),placeholder:"Mobile",style:Pe}),(0,f.jsx)("input",{value:x.email||"",onChange:e=>h((0,m.A)((0,m.A)({},x),{},{email:e.target.value})),placeholder:"Email",style:Pe}),Re(_,F)]}):ie.length>0?(0,f.jsx)("div",{style:{border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:ie.map((e,t)=>(0,f.jsxs)("div",{style:{background:Xi.card,padding:"15px 18px",borderBottom:t===ie.length-1?"none":"1px solid ".concat(Xi.divider),display:"flex",alignItems:"center",gap:14}
1,children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",width:34,height:34,borderRadius:4,background:e.is_primary?Xi.red:to[t%4+1],color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:Ki,fontWeight:800,fontSize:12.5},children:ao(e.name)}),(0,f.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:Ki,fontSize:14,fontWeight:800},children:e.name}),e.is_primary&&(0,f.jsx)(jo,{bg:Xi.redTint,fg:Xi.redline,children:"PRIMARY"}),oe&&(0,f.jsx)("button",{type:"button",onClick:S,title:"Edit contact","aria-label":"Edit contact",style:{color:Xi.faint,background:"none",border:"none",cursor:"pointer",padding:2},children:(0,f.jsx)(oa.A,{size:13})})]}),e.role&&(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:10,letterSpacing:".06em",textTransform:"uppercase",color:Xi.muted,marginTop:2},children:e.role})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat((e.mobile||"").replace(/\s/g,"")),className:"tg-icon-call","aria-label":"Call ".concat(e.name),style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid ".concat(Xi.hairline),borderRadius:4,color:Xi.red,textDecoration:"none"},children:(0,f.jsx)(E.A,{size:14,strokeWidth:2})}),e.email&&(0,f.jsx)("a",{href:"mailto:".concat(e.email),className:"tg-icon-mail","aria-label":"Email ".concat(e.name),style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid ".concat(Xi.hairline),borderRadius:4,color:Xi.tealDeep,textDecoration:"none"},children:(0,f.jsx)(T.A,{size:14,strokeWidth:2})})]},e.id||t))}):(0,f.jsx)("button",{type:"button",onClick:S,className:"tg-add",style:{width:"100%",textAlign:"left",background:Xi.card,border:"1px dashed ".concat(Xi.hairline),borderRadius:4,padding:"16px 18px",cursor:"pointer",fontFamily:Zi,fontSize:13.5,color:Xi.silver,fontStyle:"italic"},children:"Add a client contact\u2026"})]}),(0,f.jsxs)("div",{id:"deliverables",style:{scrollMarginTop:70},children:[(0,f.jsx)(vo,{children:"DELIVERABLES"}),0===te.length?(0,f.jsx)(wo,{children:"No deliverables listed"}):(0,f.jsx)("div",{style:{border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:te.map((e,t)=>(0,f.jsxs)("div",{style:{background:Xi.card,display:"flex",gap:16,alignItems:"flex-start",padding:"14px 18px",borderBottom:t===te.length-1?"none":"1px solid ".concat(Xi.divider)},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",fontFamily:$i,fontSize:11.5,fontWeight:700,color:Xi.red,paddingTop:2},children:so(t+1)}),(0,f.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:Ki,fontSize:14,fontWeight:800},children:e.name}),e.description&&(0,f.jsx)("div",{style:{fontSize:12.5,color:Xi.muted,lineHeight:1.5,marginTop:3},children:e.description})]})]},e.id||t))})]})]})]}),(0,f.jsxs)(bo,{id:"briefing",children:[(0,f.jsx)(yo,{num:"02",title:"Briefing Notes",tag:"EDITABLE"}),p?(0,f.jsxs)("div",{children:[(0,f.jsx)("textarea",{value:u,onChange:e=>b(e.target.value),rows:5,style:{width:"100%",boxSizing:"border-box",background:Xi.card,border:"1px solid ".concat(Xi.red),boxShadow:"0 0 0 3px rgba(191,33,47,.09)",borderRadius:4,padding:"18px 20px",fontFamily:Zi,fontSize:15,lineHeight:1.6,color:Xi.body,resize:"vertical",outline:"none"}}),Re(B,D)]}):(0,f.jsxs)("div",{role:"button",tabIndex:0,onClick:z,onKeyDown:e=>{"Enter"===e.key&&z()},className:"tg-rowhover",style:{background:Xi.card,border:"1px solid ".concat(Xi.hairline),borderRadius:4,padding:"18px 20px",cursor:"text",display:"flex",gap:12,alignItems:"flex-start",minHeight:96},children:[(0,f.jsx)("div",{style:{flex:1,fontSize:15,lineHeight:1.6,color:null!==s&&void 0!==s&&s.special_briefing_notes?Xi.body:Xi.silver,fontStyle:null!==s&&void 0!==s&&s.special_briefing_notes?"normal":"italic",whiteSpace:"pre-wrap"},children:(null===s||void 0===s?void 0:s.special_briefing_notes)||"Add briefing notes for the crew \u2014 call time, dress code, access, on-the-ground contacts\u2026"}),(0,f.jsx)(oa.A,{size:15,color:Xi.faint,strokeWidth:2,style:{flexShrink:0,marginTop:2}})]})]}),pe&&(0,f.jsxs)(bo,{id:"imagery-standards",children:[(0,f.jsx)(yo,{num:"03",title:"Standards & Upload"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(300px,1fr))",gap:20},children:[de&&(0,f.jsxs)("div",{style:{background:Xi.card,border:"1px solid ".concat(Xi.hairline),borderRadius:4,padding:"18px 20px"},children:[le&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(vo,{color:Xi.indigo,children:"PHOTOGRAPHY"}),(0,f.jsx)("div",{style:{fontSize:13.5,color:Xi.secondary,lineHeight:1.6,marginBottom:ce?16:0},dangerouslySetInnerHTML:{__html:or.default.sanitize(n)}})]}),ce&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(vo,{color:Xi.indigo,children:"VIDEOGRAPHY"}),(0,f.jsx)("div",{style:{fontSize:13.5,color:Xi.secondary,lineHeight:1.6},dangerouslySetInnerHTML:{__html:or.default.sanitize(r)}})]})]}),me&&(0,f.jsxs)("div",{id:"upload",style:{background:Xi.card,border:"1px solid ".concat(Xi.hairline),borderRadius:4,padding:"18px 20px",display:"flex",flexDirection:"column",scrollMarginTop:70},children:[(0,f.jsx)(vo,{color:Xi.tealDeep,children:"UPLOAD FOOTAGE"}),(0,f.jsx)("div",{style:{fontSize:13.5,color:Xi.secondary,lineHeight:1.6},children:"Upload all cards before you leave site. Use the Turbo Crew Upload app if you're on mobile data."}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,flexWrap:"wrap",marginTop:"auto",paddingTop:18},children:[(null===s||void 0===s?void 0:s.masv_portal_url)&&(0,f.jsxs)("a",{href:s.masv_portal_url,target:"_blank",rel:"noopener noreferrer",className:"tg-done",style:{display:"inline-flex",alignItems:"center",gap:8,background:Xi.carbon,color:"#fff",textDecoration:"none",borderRadius:4,padding:"11px 18px",fontFamily:Ki,fontSize:12.5,fontWeight:700},children:[(0,f.jsx)(_s.A,{size:14,strokeWidth:2}),"Open MASV portal"]}),(null===s||void 0===s?void 0:s.masv_job_code)&&(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",fontFamily:$i,fontSize:11.5,fontWeight:700,color:Xi.ink,background:Xi.inset2,borderRadius:4,padding:"11px 16px"},children:["#",s.masv_job_code]})]})]})]})]}),ee.length>0&&(0,f.jsxs)(bo,{id:"crew",children:[(0,f.jsx)(yo,{num:so(Se.findIndex(e=>"crew"===e.anchor)+1),title:"Crew On Site"}),(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(250px,1fr))",gap:1,background:Xi.hairline,border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:ee.map((e,t)=>{const s=e.start_time||e.end_time?"".concat(e.start_time?k(e.start_time):"").concat(e.end_time?"\u2013".concat(k(e.end_time)):""):"";return(0,f.jsxs)("div",{style:{background:Xi.card,padding:"16px 18px",display:"flex",alignItems:"center",gap:13},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",width:38,height:38,borderRadius:4,background:to[t%to.length],color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:Ki,fontWeight:800,fontSize:13.5},children:ao(e.name)}),(0,f.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:Ki,fontSize:14,fontWeight:800},children:e.name}),(0,f.jsxs)("div",{style:{fontFamily:$i,fontSize:10,letterSpacing:".06em",textTransform:"uppercase",color:Xi.muted,marginTop:2},children:[Pn(e.role)||"Crew",s?" \xb7 ".concat(s):""]})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat((e.mobile||"").replace(/\s/g,"")),className:"tg-icon-call","aria-label":"Call ".concat(e.name),style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid ".concat(Xi.hairline),borderRadius:4,color:Xi.red,textDecoration:"none"},children:(0,f.jsx)(E.A,{size:14,strokeWidth:2})})]},e.id||t)})})]}),fe.length>0&&(0,f.jsxs)(bo,{id:"timeline",top:48,children:[(0,f.jsx)(yo,{num:so(Se.findIndex(e=>"timeline"===e.anchor)+1),title:"Timeline",tag:"TAP TO TICK",tagBg:Xi.ink}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:20,flexWrap:"wrap",background:Xi.card,border:"1px solid ".concat(Xi.hairline),borderRadius:4,padding:"14px 18px",marginBottom:24},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flex:"1 1 220px",minWidth:0},children:[(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:9,fontWeight:700,letterSpacing:".16em",color:Xi.silver},children:"PROGRESS"}),(0,f.jsx)("span",{style:{flex:"1 1 auto",height:6,borderRadius:3,background:Xi.divider,overflow:"hidden",minWidth:80},children:(0,f.jsx)("span",{style:{display:"block",height:"100%",width:"".concat(ye,"%"),background:"linear-gradient(90deg,".concat(Xi.red,",").concat(Xi.amber,")"),borderRadius:3}})}),(0,f.jsxs)("span",{style:{fontFamily:$i,fontSize:11,fontWeight:700,color:Xi.ink},children:[be,"/",fe.length]})]}),(0,f.jsx)(_o,{legend:ve})]}),J?((null===s||void 0===s?void 0:s.event_days)||[]).map((e,t)=>(0,f.jsxs)("div",{style:{marginBottom:10},children:[(0,f.jsxs)(So,{children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Qi),{},{fontWeight:800,fontSize:13,letterSpacing:".06em",textTransform:"uppercase",color:Xi.ink}),children:"DAY ".concat(t+1)}),e.date&&(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10.5,fontWeight:700,letterSpacing:".1em",color:Xi.red},children:A(e.date)}),e.location&&(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10,letterSpacing:".06em",textTransform:"uppercase",color:Xi.muted},children:e.location}),Q(e.date)&&(0,f.jsx)(jo,{bg:Xi.red,fg:"#fff",children:"TODAY"})]}),Be(e.timed_events,e.id,Q(e.date))]},e.id||t)):Be(null===s||void 0===s?void 0:s.timed_events,null,Q(null===s||void 0===s?void 0:s.event_date))]}),(se.length>0||ae.length>0)&&(0,f.jsx)(bo,{top:28,children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(320px,1fr))",gap:28},children:[se.length>0&&(0,f.jsxs)("div",{id:"checklist",style:{scrollMarginTop:70},children:[(0,f.jsx)(yo,{num:so(Se.findIndex(e=>"checklist"===e.anchor)+1),title:"Must-Capture",trailing:(0,f.jsx)(Ie,{done:je,total:se.length})}),(0,f.jsx)("div",{style:{border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:se.map((e,t)=>(0,f.jsx)(De,{done:!!o[e.id],onToggle:()=>I(e.id),accent:Xi.indigo,last:t===se.length-1,children:e.text},e.id))})]}),ae.length>0&&(0,f.jsxs)("div",{id:"sponsor-stands",style:{scrollMarginTop:70},children:[(0,f.jsx)(yo,{num:so(Se.findIndex(e=>"sponsor-stands"===e.anchor)+1),title:"Sponsor Stands",trailing:(0,f.jsx)(Ie,{done:we,total:ae.length})}),(0,f.jsx)("div",{style:{border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:ae.map((e,t)=>(0,f.jsx)(De,{done:!!l[e.id],onToggle:()=>R(e.id),accent:Xi.amberDeep,last:t===ae.length-1,children:e.text},e.id))})]})]})}),ne.length>0&&(0,f.jsxs)(bo,{id:"voxpops",children:[(0,f.jsx)(yo,{num:so(Se.findIndex(e=>"voxpops"===e.anchor)+1),title:"Voxpops",trailing:(0,f.jsx)(Ie,{done:Ne,total:ne.length})}),(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(300px,1fr))",gap:1,background:Xi.hairline,border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:ne.map(e=>(0,f.jsxs)("div",{onClick:()=>W(e.id),role:"button",tabIndex:0,onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),W(e.id))},className:"tg-rowhover",style:{background:e.completed?Xi.greenTint:Xi.card,borderTop:"3px solid ".concat(e.completed?Xi.green:Xi.teal),padding:"16px 18px",cursor:"pointer",display:"flex",gap:13,alignItems:"flex-start"},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",width:24,height:24,borderRadius:4,border:"2px s
1olid ".concat(e.completed?Xi.green:Xi.teal),background:e.completed?Xi.green:"transparent",display:"flex",alignItems:"center",justifyContent:"center",marginTop:1},children:e.completed&&(0,f.jsx)(zt.A,{size:13,color:"#fff",strokeWidth:3.4})}),(0,f.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:Ki,fontSize:14.5,fontWeight:800,color:e.completed?Xi.muted:Xi.ink,textDecoration:e.completed?"line-through":"none"},children:e.contact_name||"Voxpop subject"}),(0,f.jsxs)("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginTop:6,fontFamily:$i,fontSize:10.5,letterSpacing:".06em",textTransform:"uppercase",color:Xi.muted},children:[e.time&&(0,f.jsx)("span",{children:k(e.time)}),e.meeting_point&&(0,f.jsx)("span",{children:e.meeting_point})]})]})]},e.id))})]}),re.length>0&&(0,f.jsxs)(bo,{id:"documents",children:[(0,f.jsx)(yo,{num:so(Se.findIndex(e=>"documents"===e.anchor)+1),title:"Supporting Documents"}),(0,f.jsx)("div",{style:{border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:re.map((e,t)=>{const s=!!e.external_url,a=e.title||e.original_filename||e.external_url||"Document",n=s?()=>window.open(e.external_url,"_blank","noopener"):()=>O&&O(e);return(0,f.jsxs)("button",{type:"button",onClick:n,className:"tg-rowhover",style:{background:Xi.card,display:"flex",alignItems:"center",gap:14,padding:"14px 18px",border:"none",borderBottom:t===re.length-1?"none":"1px solid ".concat(Xi.divider),borderRadius:0,cursor:"pointer",textAlign:"left",width:"100%"},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",width:32,height:32,borderRadius:4,background:Xi.inset2,color:Xi.muted,display:"flex",alignItems:"center",justifyContent:"center"},children:s?(0,f.jsx)(En.A,{size:15,strokeWidth:2}):(0,f.jsx)(kt.A,{size:15,strokeWidth:2})}),(0,f.jsx)("span",{style:{flex:"1 1 auto",minWidth:0,fontSize:14,fontWeight:600,color:Xi.ink,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a}),s?(0,f.jsx)(En.A,{size:15,color:Xi.silver,strokeWidth:2}):(0,f.jsx)(es.A,{size:15,color:Xi.silver,strokeWidth:2})]},e.file_key||e.s3_key||e.link_id||t)})})]}),(0,f.jsxs)(Co,{children:[(0,f.jsx)("a",{href:"tel:1300207446",style:{color:Xi.muted,textDecoration:"none"},children:"ON-DAY SUPPORT 1300 207 446"}),(0,f.jsx)("span",{style:{color:Xi.red},children:"EVERY ANGLE \xb7 FULL SPEED"})]})]}),(y||i)&&(0,f.jsx)(Fo,(0,m.A)({},Fe))]})};var zo=s(78162);const Bo={photographer:Ue.A,second_photographer:Ue.A,videographer:Ge.A,second_videographer:Ge.A,voxpop_videographer:Ge.A},Do=e=>{let{availableRoles:t,activeRole:s,setActiveRole:a,dark:n=!1}=e;if(!t||t.length<=1)return null;const r=s||"shared",i=n?"bg-white/5 text-gray-200 border-white/10 hover:bg-white/10":"bg-white text-gray-700 border-gray-200 hover:bg-gray-50";return(0,f.jsx)("div",{className:"w-full sticky top-0 z-30 ".concat(n?"bg-black/85":"bg-white/90"," border-y ").concat(n?"border-white/10":"border-gray-200"," backdrop-blur-md shadow-sm"),children:(0,f.jsx)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-2.5",children:(0,f.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3 flex-wrap",children:[(0,f.jsx)("div",{className:"text-[10px] font-bold uppercase tracking-[0.3em] ".concat(n?"text-gray-400":"text-gray-500"," mr-2"),children:"View"}),t.filter(e=>!e.isShared).map(e=>{const t=e.key===r,s=Bo[e.key]||Xe.A;return(0,f.jsxs)("button",{type:"button",onClick:()=>a(e.isShared?null:e.key),className:"inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full border text-sm font-semibold transition-colors ".concat(t?"bg-turbo-red text-white border-turbo-red shadow-md":i),children:[(0,f.jsx)(s,{className:"h-3.5 w-3.5"}),(0,f.jsx)("span",{children:e.label})]},e.key)})]})})})},Io=e=>{let{location:t,className:s="",size:a="sm"}=e;const n=(t||"").trim();if(!n)return null;const r=Wi(n),i="xs"===a?"text-xs":"text-sm",o="xs"===a?"h-3 w-3":"h-3.5 w-3.5";return(0,f.jsxs)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-flex items-center gap-1 font-medium text-turbo-red underline-offset-2 hover:underline ".concat(i," ").concat(s),children:[(0,f.jsx)(C.A,{className:"".concat(o," shrink-0")}),n]})},Ro=e=>{var t,s,a,n,r,i,o,l,c,d,x,h;const{eventId:u,event:b,showShareNotification:y,isGeneratingPDF:v,photographyStandards:j,videographyStandards:w,activeSection:N,showMobileNav:A,setShowMobileNav:k,editingContact:S,editingBriefing:_,contactFormData:F,setContactFormData:z,briefingFormData:B,setBriefingFormData:D,isSaving:I,saveNotification:R,checklistCompletions:P,priorityStandCompletions:W,timedEventCompletions:O,showMessageModal:L,setShowMessageModal:M,crewMessage:q,setCrewMessage:H,isSendingMessage:U,handleShare:G,handleDownloadPDF:V,formatDate:J,formatTime:Y,groupEventsByTimeSlot:K,shouldShowPhotographyStandards:Z,shouldShowVideographyStandards:$,scrollToSection:Q,startEditingContact:X,cancelEditingContact:ee,saveContactChanges:te,startEditingBriefing:se,cancelEditingBriefing:ae,saveBriefingChanges:ne,toggleChecklistItem:re,togglePriorityStand:ie,toggleTimedEvent:oe,sendCrewMessage:le,downloadDocument:ce,navItems:de,toggleVoxpopItem:me,voxpopVideographers:pe=[],availableRoles:xe,activeRole:he,setActiveRole:ue,handleDownloadAllRoles:ge}=e;return(0,f.jsxs)("div",{className:"min-h-screen bg-slate-50",children:[(0,f.jsx)("div",{className:"bg-white border-b border-slate-200 sticky top-0 z-50 print:hidden shadow-sm",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 py-3",children:(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-8 bg-slate-900 rounded px-2 py-1"}),(0,f.jsx)("div",{className:"hidden sm:block",children:(0,f.jsx)("h1",{className:"text-sm font-medium text-slate-900 truncate max-w-xs",children:b.event_name})})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)("button",{onClick:()=>k(!A),className:"lg:hidden p-2 text-slate-600 hover:bg-slate-100 rounded-lg",children:(0,f.jsx)(cs.A,{className:"h-5 w-5"})}),(0,f.jsxs)("button",{onClick:G,className:"flex items-center space-x-1 px-3 py-2 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(at.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"Share"})]}),(0,f.jsxs)("button",{onClick:V,disabled:v,className:"flex items-center space-x-1 px-3 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:v?"Generating...":"PDF"})]})]})]})})}),(0,f.jsx)(Do,{availableRoles:xe,activeRole:he,setActiveRole:ue,activeRunsheet:e.activeRunsheet}),(0,f.jsx)(Yi,{availableRoles:xe,activeRole:he,setActiveRole:ue}),A&&(0,f.jsx)("div",{className:"lg:hidden fixed inset-0 z-40 bg-black/50",onClick:()=>k(!1),children:(0,f.jsx)("div",{className:"absolute top-16 left-4 right-4 bg-white rounded-xl shadow-xl p-4",onClick:e=>e.stopPropagation(),children:(0,f.jsxs)("nav",{className:"space-y-1",children:[de.map(e=>(0,f.jsxs)("button",{onClick:()=>Q(e.id),className:"w-full flex items-center space-x-3 px-4 py-3 rounded-lg text-left transition-colors ".concat(N===e.id?"bg-red-50 text-red-700":"text-slate-700 hover:bg-slate-50"),children:[(0,f.jsx)(e.icon,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"font-medium",children:e.label})]},e.id)),!1]})})}),y&&(0,f.jsxs)("div",{className:"fixed top-20 right-4 bg-green-600 text-white px-4 py-2 rounded-lg shadow-lg z-50 flex items-center space-x-2 print:hidden text-sm",children:[(0,f.jsx)(p.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Link copied!"})]}),R&&(0,f.jsxs)("div",{className:"fixed top-20 right-4 px-4 py-2 rounded-lg shadow-lg z-50 flex items-center space-x-2 print:hidden text-sm ".concat("success"===R.type?"bg-green-600":"bg-red-600"," text-white"),children:["success"===R.type?(0,f.jsx)(p.A,{className:"h-4 w-4"}):(0,f.jsx)(g.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:R.message})]}),L&&(0,f.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 print:hidden",onClick:()=>M(!1),children:(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-xl w-full max-w-md mx-4 p-6",onClick:e=>e.stopPropagation(),children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("h3",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(Fn.A,{className:"h-5 w-5 text-red-600"}),(0,f.jsx)("span",{children:"Message Crew"})]}),(0,f.jsx)("button",{onClick:()=>M(!1),className:"text-slate-400 hover:text-slate-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsx)("textarea",{value:q,onChange:e=>H(e.target.value),placeholder:"Type your message to the crew...",className:"w-full border border-slate-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-red-500 focus:border-red-500 outline-none resize-none",rows:4,maxLength:500,autoFocus:!0}),(0,f.jsxs)("p",{className:"text-xs text-slate-400 mt-1 mb-4",children:[q.length,"/500 characters"]}),(0,f.jsxs)("p",{className:"text-xs text-slate-500 mb-4",children:["This will send a push notification and chat message to all ",null===(t=b.crew_members)||void 0===t?void 0:t.length," crew member(s)."]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,f.jsx)("button",{onClick:()=>M(!1),className:"px-4 py-2 text-sm text-slate-600 hover:text-slate-800",children:"Cancel"}),(0,f.jsx)("button",{onClick:le,disabled:!q.trim()||U,className:"px-4 py-2 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-2",children:U?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),(0,f.jsx)("span",{children:"Sending..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Send"})]})})]})]})}),(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 py-6",children:(0,f.jsxs)("div",{className:"flex gap-6",children:[(0,f.jsx)("aside",{className:"hidden lg:block w-64 flex-shrink-0",children:(0,f.jsxs)("nav",{className:"sticky top-20 bg-white rounded-xl shadow-sm border border-slate-200 p-4 space-y-1",children:[(0,f.jsx)("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3 px-3",children:"Navigation"}),de.map(e=>(0,f.jsxs)("button",{onClick:()=>Q(e.id),className:"w-full flex items-center space-x-3 px-3 py-2 rounded-lg text-left text-sm transition-colors ".concat(N===e.id?"bg-red-50 text-red-700 font-medium":"text-slate-600 hover:bg-slate-50 hover:text-slate-900"),children:[(0,f.jsx)(e.icon,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:e.label}),N===e.id&&(0,f.jsx)(rs.A,{className:"h-4 w-4 ml-auto"})]},e.id)),!1]})}),(0,f.jsx)("main",{className:"flex-1 min-w-0",children:(0,f.jsxs)("div",{id:"runsheet-content",className:"space-y-6",children:[(0,f.jsxs)("section",{id:"overview",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 text-white px-6 py-8 sm:px-8",children:[(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4 mb-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-12 object-contain"}),b.company_logo_url&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"h-8 w-px bg-white/30"}),(0,f.jsx)("img",{src:b.company_logo_url,alt:"Company Logo",className:"h-12 object-contain",onError:e=>{e.target.style.display="none"}})]})]}),(0,f.jsx)("div",{className:"text-sm text-slate-400",children:(0,f.jsxs)("span",{children:["Generated ",(new Date).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"})]})})]}),(0,f.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold mb-4",children:b.event_name}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-4 text-sm",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 bg-white/10 rounded-full px-4 py-2",children:[(0,f.jsx)(Ke.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:b.client_company})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2 bg-white/10 rounded-full px-4 py-2",children:[(0,f.jsx)(C.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:b.venue})]})]}),b.event_website&&(0,f.jsxs)("a",{href:b.event_website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center space-x-2 mt-4 px-4 py-2 bg-white/20 hover:bg-white/30 rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"View Event Website"})]})]}),(0,f.jsx)("div",{className:"px-6 py-6 sm:px-8 bg-gradient-to-r from-red-50 to-orange-50 border-t-4 border-red-600",children:"single"===b.event_duration_type?(0,f.jsxs)("div",{className:"grid sm:grid-cols-3 gap-4",children:[(0,f.jsxs)("div",{className:"bg-white rounded-xl p-4 shadow-sm",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-600 text-sm font-medium mb-2",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Date"})]}),(0,f.jsx)("p",{className:"text-slate-900 font-semibold",children:J(b.event_date)})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl p-4 shadow-sm",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-600 text-sm font-medium mb-2",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Start"})]}),(0,f.jsxs)("p",{className:"text-slate-900 font-semibold text-xl",children:[Y(b.start_time)||"TBC",b.event_timezone&&"Australia/Melbourne"!==b.event_timezone&&(0,f.jsx)("span",{className:"text-sm text-slate-500 ml-1",children:(0,zo.iU)(b.event_timezone)})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl p-4 shadow-sm",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-600 text-sm font-medium mb-2",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"End"})]}),(0,f.jsxs)("p",{className:"text-slate-900 font-semibold text-xl",children:[Y(b.end_time)||"TBC",b.event_timezone&&"Australia/Melbourne"!==b.event_timezone&&(0,f.jsx)("span",{className:"text-sm text-slate-500 ml-1",children:(0,zo.iU)(b.event_timezone)})]})]})]}):(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-600 font-semibold mb-4",children:[(0,f.jsx)(_t.A,{className:"h-5 w-5"}),(0,f.jsxs)("span",{children:["Multi-Day Event: ",(null===(s=b.event_days)||void 0===s?void 0:s.length)||0," Days"]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:null===(a=b.event_days)||void 0===a?void 0:a.map((e,t)=>{var s,a,n;const r=(null===(s=b.crew_members)||void 0===s?void 0:s.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];return(0,f.jsxs)("div",{className:"bg-white rounded-xl p-4 shadow-sm flex flex-col",children:[(0,f.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,f.jsxs)("span",{className:"text-xs font-bold text-white bg-red-600 px-2 py-1 rounded",children:["DAY ",t+1]})}),(0,f.jsx)("p",{className:"font-semibold text-slate-900 text-sm",children:new Date(e.date).toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short"})}),(0,f.jsxs)("p",{className:"text-red-600 font-medium text-sm mt-1",children:[Y(e.start_time)," - ",Y(e.end_time)]}),(e.location||b.venue)&&(0,f.jsxs)("p",{className:"text-slate-500 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(C.A,{className:"h-3 w-3 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:e.location||b.venue})]}),(r.length>0||(null===(a=e.client_contacts)||void 0===a?void 0:a.length)>0)&&(0,f.jsx)("div",{className:"mt-3 pt-3 border-t border-slate-200 flex-1",children:(0,f.jsxs)("div",{className:"space-y-1",children:[r.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,f.jsx)(Xe.A,{className:"h-3 w-3 text-purple-600 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-medium text-slate-70
10 truncate",children:e.name}),(0,f.jsxs)("span",{className:"text-slate-400",children:["(",Pn(e.role),")"]})]},e.id)),null===(n=e.client_contacts)||void 0===n?void 0:n.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,f.jsx)(Ye.A,{className:"h-3 w-3 text-green-600 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-medium text-slate-700 truncate",children:e.name}),e.role&&(0,f.jsxs)("span",{className:"text-slate-400",children:["(",e.role,")"]})]},e.id))]})})]},e.id)})})]})})]}),(0,f.jsxs)("section",{id:"contact",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-slate-200 bg-slate-50 flex justify-between items-center",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(Ye.A,{className:"h-5 w-5 text-red-600"}),(0,f.jsxs)("span",{children:["Client Contact",(null===(n=b.client_contacts)||void 0===n?void 0:n.length)>1?"s":""]})]}),!S&&!(null!==(r=b.client_contacts)&&void 0!==r&&r.length)&&(0,f.jsxs)("button",{onClick:X,className:"flex items-center space-x-1 px-3 py-1.5 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium transition-colors print:hidden",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]})]}),(0,f.jsx)("div",{className:"p-6",children:(null===(i=b.client_contacts)||void 0===i?void 0:i.length)>0?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,f.jsx)(Ke.A,{className:"h-5 w-5 text-slate-400"}),(0,f.jsx)("span",{className:"font-semibold text-lg text-slate-900",children:b.client_company})]}),(0,f.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:b.client_contacts.map(e=>(0,f.jsxs)("div",{className:"rounded-xl p-4 border-2 ".concat(e.is_primary?"bg-red-50 border-red-200":"bg-slate-50 border-slate-200"),children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:e.name}),e.role&&(0,f.jsx)("span",{className:"inline-block text-xs px-2 py-0.5 rounded-full mt-1 ".concat(e.is_primary?"bg-red-100 text-red-700":"bg-slate-200 text-slate-600"),children:e.role})]}),e.is_primary&&(0,f.jsx)("span",{className:"text-xs bg-red-600 text-white px-2 py-1 rounded-full font-medium",children:"Primary"})]}),(0,f.jsxs)("div",{className:"space-y-1 mt-3",children:[e.email&&(0,f.jsxs)("a",{href:"mailto:".concat(e.email),className:"flex items-center gap-2 text-sm text-blue-600 hover:text-blue-700",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),e.email]}),e.mobile&&(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center gap-2 text-sm text-blue-600 hover:text-blue-700",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),e.mobile]})]})]},e.id))}),b.additional_notes&&(0,f.jsxs)("div",{className:"pt-4 border-t border-slate-200",children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider mb-1",children:"Additional Notes"}),(0,f.jsx)("p",{className:"text-slate-700",children:b.additional_notes})]})]}):S?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-slate-600 font-medium mb-1 block",children:"Name"}),(0,f.jsx)("input",{type:"text",value:F.primary_contact,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{primary_contact:e.target.value})),className:"w-full px-3 py-2 border border-slate-300 rounded-lg bg-white text-slate-900 focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Primary contact name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-slate-600 font-medium mb-1 block",children:"Company"}),(0,f.jsx)("input",{type:"text",value:b.client_company,disabled:!0,className:"w-full px-3 py-2 border border-slate-200 rounded-lg bg-slate-100 text-slate-500"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-slate-600 font-medium mb-1 block",children:"Email"}),(0,f.jsx)("input",{type:"email",value:F.email,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{email:e.target.value})),className:"w-full px-3 py-2 border border-slate-300 rounded-lg bg-white text-slate-900 focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"[email protected]"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-slate-600 font-medium mb-1 block",children:"Mobile"}),(0,f.jsx)("input",{type:"tel",value:F.mobile,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{mobile:e.target.value})),className:"w-full px-3 py-2 border border-slate-300 rounded-lg bg-white text-slate-900 focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"Mobile number"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-slate-600 font-medium mb-1 block",children:"Additional Notes"}),(0,f.jsx)("textarea",{value:F.additional_notes,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{additional_notes:e.target.value})),className:"w-full px-3 py-2 border border-slate-300 rounded-lg bg-white text-slate-900 focus:ring-2 focus:ring-blue-500 focus:border-transparent",rows:"2",placeholder:"Any additional notes..."})]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-2 pt-2",children:[(0,f.jsx)("button",{onClick:ee,disabled:I,className:"px-4 py-2 bg-slate-200 hover:bg-slate-300 text-slate-700 rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:te,disabled:I,className:"flex items-center space-x-1 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:I?"Saving...":"Save"})]})]})]}):(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider mb-1",children:"Name"}),(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:b.primary_contact||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider mb-1",children:"Company"}),(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:b.client_company})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider mb-1",children:"Email"}),(0,f.jsx)("a",{href:"mailto:".concat(b.email),className:"font-medium text-blue-600 hover:text-blue-700",children:b.email||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider mb-1",children:"Mobile"}),(0,f.jsx)("a",{href:"tel:".concat(b.mobile),className:"font-medium text-blue-600 hover:text-blue-700",children:b.mobile||"\u2014"})]}),b.additional_notes&&(0,f.jsxs)("div",{className:"sm:col-span-2 pt-4 border-t border-slate-200",children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider mb-1",children:"Additional Notes"}),(0,f.jsx)("p",{className:"text-slate-700",children:b.additional_notes})]})]})})]}),(null===(o=b.crew_members)||void 0===o?void 0:o.length)>0&&(0,f.jsxs)("section",{id:"crew",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 py-4 border-b border-slate-200 bg-slate-50",children:(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(Xe.A,{className:"h-5 w-5 text-red-600"}),(0,f.jsxs)("span",{children:["Crew (",b.crew_members.length,")"]})]})}),(0,f.jsx)("div",{className:"p-6",children:(0,f.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:b.crew_members.map(e=>(0,f.jsxs)("div",{className:"bg-slate-50 rounded-xl p-4 border border-slate-200",children:[(0,f.jsx)("div",{className:"flex items-start justify-between mb-3",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:e.name}),(0,f.jsx)("p",{className:"text-sm text-red-600 font-medium uppercase",children:Pn(e.role)}),(e.start_time||e.end_time)&&(0,f.jsxs)("p",{className:"text-xs text-slate-500 mt-1 flex items-center gap-1 font-mono",children:[(0,f.jsx)(Nt.A,{className:"h-3 w-3"}),e.start_time||b.start_time||"09:00"," \u2013 ",e.end_time||b.end_time||"17:00"]})]})}),(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center space-x-2 text-slate-600 hover:text-red-600 transition-colors",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"font-medium",children:e.mobile})]})]},e.id))})})]}),(null===(l=b.deliverables)||void 0===l?void 0:l.length)>0&&(0,f.jsxs)("section",{id:"deliverables",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-slate-200 bg-slate-50",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(as.A,{className:"h-5 w-5 text-amber-600"}),(0,f.jsx)("span",{children:"Deliverables"})]}),(0,f.jsx)("p",{className:"mt-1 text-sm text-slate-500",children:"What's included with this engagement"})]}),(0,f.jsx)("div",{className:"p-6",children:(0,f.jsx)("ul",{className:"space-y-3",children:b.deliverables.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start gap-3",children:[(0,f.jsx)("span",{className:"flex-shrink-0 w-7 h-7 rounded-full bg-amber-100 text-amber-700 text-xs font-bold flex items-center justify-center mt-0.5",children:t+1}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900 leading-snug",children:e.name}),e.description&&(0,f.jsx)("p",{className:"text-sm text-slate-600 leading-relaxed mt-0.5",children:e.description})]})]},e.id))})})]}),("single"===b.event_duration_type&&(null===(c=b.timed_events)||void 0===c?void 0:c.length)>0||"multi"===b.event_duration_type&&(null===(d=b.event_days)||void 0===d?void 0:d.length)>0)&&(0,f.jsxs)("section",{id:"timeline",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 py-4 border-b border-slate-200 bg-slate-50",children:(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(Nt.A,{className:"h-5 w-5 text-red-600"}),(0,f.jsx)("span",{children:"Event Timeline"})]})}),(0,f.jsx)("div",{className:"p-6",children:"single"===b.event_duration_type?(0,f.jsx)("div",{className:"space-y-3",children:K(b.timed_events).map(e=>
1(0,f.jsx)("div",{children:e.hasStreams?(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-24 text-right pt-2",children:(0,f.jsx)("span",{className:"inline-block px-3 py-1.5 rounded-lg text-sm font-bold ".concat(e.events.every(e=>O[e.id]||e.completed)?"bg-green-600 text-white":"bg-red-600 text-white"),children:Y(e.time)})}),(0,f.jsx)("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-3",children:e.events.map(e=>{const t=O[e.id]||e.completed;return(0,f.jsxs)("div",{onClick:()=>oe(e.id),className:"rounded-lg p-4 border-l-4 cursor-pointer transition-all ".concat(t?"bg-green-50 border-green-600 hover:bg-green-100":"bg-slate-50 border-indigo-500 hover:bg-slate-100"),children:[e.stream&&(0,f.jsx)("span",{className:"inline-block px-2 py-0.5 bg-indigo-100 text-indigo-700 text-xs font-semibold rounded mb-2",children:e.stream}),(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-5 h-5 rounded border-2 flex items-center justify-center transition-colors ".concat(t?"bg-green-600 border-green-600":"border-slate-400 hover:border-green-500"),children:t&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"".concat(t?"text-slate-500 line-through":"text-slate-900"),children:e.description}),e.notes&&(0,f.jsxs)("p",{className:"text-slate-600 text-sm mt-2 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),e.notes]}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),t&&e.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",e.completed_by]})]})]})]},e.id)})})]}):e.events.map(e=>{const t=O[e.id]||e.completed;return(0,f.jsxs)("div",{className:"flex items-start gap-4 group",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-24 text-right",children:(0,f.jsx)("span",{className:"inline-block px-3 py-1.5 rounded-lg text-sm font-bold ".concat(t?"bg-green-600 text-white":"bg-red-600 text-white"),children:Y(e.time)})}),(0,f.jsx)("div",{onClick:()=>oe(e.id),className:"flex-1 rounded-lg p-4 border-l-4 cursor-pointer transition-all ".concat(t?"bg-green-50 border-green-600 hover:bg-green-100":"bg-slate-50 border-red-600 group-hover:bg-slate-100"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-5 h-5 rounded border-2 flex items-center justify-center transition-colors ".concat(t?"bg-green-600 border-green-600":"border-slate-400 hover:border-green-500"),children:t&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"".concat(t?"text-slate-500 line-through":"text-slate-900"),children:e.description}),e.notes&&(0,f.jsxs)("p",{className:"text-slate-600 text-sm mt-2 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),e.notes]}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),t&&e.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",e.completed_by]})]})]})})]},e.id)})},e.time))}):(0,f.jsx)("div",{className:"space-y-8",children:b.event_days.map((e,t)=>{var s,a,n;const r=(null===(s=b.crew_members)||void 0===s?void 0:s.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];return(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"bg-gradient-to-r from-red-100 to-orange-100 rounded-xl p-4 mb-4",children:(0,f.jsxs)("div",{className:"flex flex-col lg:flex-row lg:items-start lg:justify-between gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"text-lg font-bold text-red-900",children:["Day ",t+1]}),(0,f.jsxs)("p",{className:"text-red-700 text-sm",children:[J(e.date)," \u2022 ",Y(e.start_time)," - ",Y(e.end_time)]}),(e.location||b.venue)&&(0,f.jsxs)("p",{className:"text-red-600 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(C.A,{className:"h-3 w-3"}),e.location||b.venue]})]}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-2",children:[r.map(e=>(0,f.jsxs)("div",{className:"bg-white rounded-lg px-3 py-2 shadow-sm border border-red-200",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Xe.A,{className:"h-4 w-4 text-red-600"}),(0,f.jsx)("span",{className:"font-semibold text-slate-900",children:e.name}),(0,f.jsx)("span",{className:"text-xs bg-red-100 text-red-700 px-2 py-0.5 rounded-full uppercase",children:Pn(e.role)})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat(e.mobile),className:"text-sm text-red-600 hover:text-red-800 font-medium mt
1-1 block",children:e.mobile})]},e.id)),null===(a=e.client_contacts)||void 0===a?void 0:a.map(e=>(0,f.jsxs)("div",{className:"bg-white rounded-lg px-3 py-2 shadow-sm border border-green-200",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Ye.A,{className:"h-4 w-4 text-green-600"}),(0,f.jsx)("span",{className:"font-semibold text-slate-900",children:e.name}),e.role&&(0,f.jsx)("span",{className:"text-xs bg-green-100 text-green-700 px-2 py-0.5 rounded-full uppercase",children:e.role})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat(e.mobile),className:"text-sm text-green-600 hover:text-green-800 font-medium mt-1 block",children:e.mobile})]},e.id))]})]})}),(null===(n=e.timed_events)||void 0===n?void 0:n.length)>0&&(0,f.jsx)("div",{className:"space-y-3 ml-4",children:K(e.timed_events).map(t=>(0,f.jsx)("div",{children:t.hasStreams?(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-20 text-right pt-2",children:(0,f.jsx)("span",{className:"inline-block px-2 py-1 rounded text-sm font-bold ".concat(t.events.every(e=>O[e.id]||e.completed)?"bg-green-600 text-white":"bg-red-600 text-white"),children:Y(t.time)})}),(0,f.jsx)("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-3",children:t.events.map(t=>{const s=O[t.id]||t.completed;return(0,f.jsxs)("div",{onClick:()=>oe(t.id,e.id),className:"rounded-lg p-3 border-l-4 cursor-pointer transition-all ".concat(s?"bg-green-50 border-green-600 hover:bg-green-100":"bg-slate-50 border-indigo-500 hover:bg-slate-100"),children:[t.stream&&(0,f.jsx)("span",{className:"inline-block px-2 py-0.5 bg-indigo-100 text-indigo-700 text-xs font-semibold rounded mb-2",children:t.stream}),(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded border-2 flex items-center justify-center transition-colors ".concat(s?"bg-green-600 border-green-600":"border-slate-400 hover:border-green-500"),children:s&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm ".concat(s?"text-slate-500 line-through":"text-slate-900"),children:t.description}),t.notes&&(0,f.jsxs)("p",{className:"text-slate-600 text-xs mt-1 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),t.notes]}),t.location&&(0,f.jsx)(Io,{location:t.location,size:"xs"}),s&&t.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",t.completed_by]})]})]})]},t.id)})})]}):t.events.map(t=>{const s=O[t.id]||t.completed;return(0,f.jsxs)("div",{className:"flex items-start gap-4 group",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-20 text-right",children:(0,f.jsx)("span",{className:"inline-block px-2 py-1 rounded text-sm font-bold ".concat(s?"bg-green-600 text-white":"bg-red-600 text-white"),children:Y(t.time)})}),(0,f.jsx)("div",{onClick:()=>oe(t.id,e.id),className:"flex-1 rounded-lg p-3 border-l-4 cursor-pointer transition-all ".concat(s?"bg-green-50 border-green-600 hover:bg-green-100":"bg-slate-50 border-red-600 hover:bg-slate-100"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded border-2 flex items-center justify-center transition-colors ".concat(s?"bg-green-600 border-green-600":"border-slate-400 hover:border-green-500"),children:s&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm ".concat(s?"text-slate-500 line-through":"text-slate-900"),children:t.description}),t.notes&&(0,f.jsxs)("p",{className:"text-slate-600 text-xs mt-1 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),t.notes]}),t.location&&(0,f.jsx)(Io,{location:t.location,size:"xs"}),s&&t.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",t.completed_by]})]})]})})]},t.id)})},t.time))})]},e.id)})})})]}
1),(b.supporting_documents&&b.supporting_documents.length>0||b.client_brief_file)&&(0,f.jsxs)("section",{id:"documents",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 py-4 border-b border-slate-200 bg-slate-50",children:(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(kt.A,{className:"h-5 w-5 text-blue-600"}),(0,f.jsx)("span",{children:"Supporting Documents"})]})}),(0,f.jsxs)("div",{className:"p-6 space-y-3",children:[null===(x=b.supporting_documents)||void 0===x?void 0:x.map((e,t)=>!!e.external_url?(0,f.jsxs)("a",{href:e.external_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-indigo-50 rounded-xl p-4 border border-indigo-200 hover:bg-indigo-100 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 min-w-0",children:[(0,f.jsx)("div",{className:"bg-indigo-600 text-white rounded-lg p-2",children:(0,f.jsx)(En.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("p",{className:"font-medium text-slate-900 truncate",children:e.title||e.external_url}),(0,f.jsx)("p",{className:"text-xs text-slate-500 truncate",children:e.external_url})]})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-1 px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-sm font-medium transition-colors flex-shrink-0 ml-3",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Open"})]})]},e.link_id||t):(0,f.jsxs)("div",{className:"flex items-center justify-between bg-blue-50 rounded-xl p-4 border border-blue-200",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("div",{className:"bg-blue-600 text-white rounded-lg p-2",children:(0,f.jsx)(kt.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-slate-900",children:e.original_filename||"Document"}),(0,f.jsx)("p",{className:"text-xs text-slate-500",children:e.file_size?"".concat((e.file_size/1024/1024).toFixed(2)," MB"):""})]})]}),(0,f.jsxs)("button",{onClick:()=>ce(e),className:"flex items-center space-x-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]},e.file_key||t)),b.client_brief_file&&(!b.supporting_documents||0===b.supporting_documents.length)&&(0,f.jsxs)("div",{className:"flex items-center justify-between bg-blue-50 rounded-xl p-4 border border-blue-200",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("div",{className:"bg-blue-600 text-white rounded-lg p-2",children:(0,f.jsx)(kt.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-slate-900",children:b.client_brief_file.original_filename||"Document"}),(0,f.jsx)("p",{className:"text-xs text-slate-500",children:b.client_brief_file.file_size?"".concat((b.client_brief_file.file_size/1024/1024).toFixed(2)," MB"):""})]})]}),(0,f.jsxs)("button",{onClick:()=>ce(b.client_brief_file),className:"flex items-center space-x-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]})]})]}),(0,f.jsxs)("section",{id:"briefing",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-slate-200 bg-amber-50 flex justify-between items-center",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(oa.A,{className:"h-5 w-5 text-amber-600"}),(0,f.jsx)("span",{children:"Special Briefing Notes"})]}),!_&&(0,f.jsxs)("button",{onClick:se,className:"flex items-center space-x-1 px-3 py-1.5 bg-blue-600 hover:bg-blue-700 text-white rounded-lg text-sm font-medium transition-colors print:hidden",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]})]}),(0,f.jsx)("div",{className:"p-6",children:_?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("textarea",{value:B,onChange:e=>D(e.target.value),className:"w-full px-3 py-2 border border-slate-300 rounded-lg bg-white text-slate-900 focus:ring-2 focus:ring-blue-500 focus:border-transparent",rows:"5",placeholder:"Add any special briefing notes for the crew..."}),(0,f.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,f.jsx)("button",{onClick:ae,disabled:I,className:"px-4 py-2 bg-slate-200 hover:bg-slate-300 text-slate-700 rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:ne,disabled:I,className:"flex items-center space-x-1 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:I?"Saving...":"Save"})]})]})]}):(0,f.jsx)("div",{className:"bg-amber-50 rounded-lg p-4 border-l-4 border-amber-500",children:b.special_briefing_notes?(0,f.jsx)("p",{className:"text-slate-800 whitespace-pre-wrap",children:b.special_briefing_notes}):(0,f.jsx)("p",{className:"text-slate-500 italic",children:"No briefing notes added yet. Click 'Edit' to add notes."})})})]}),(Z()&&j||$()&&w)&&(0,f.jsxs)("section",{id:"imagery-standards",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 py-4 border-b border-slate-200 bg-indigo-50",children:(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(Ue.A,{className:"h-5 w-5 text-indigo-600"}),(0,f.jsx)("span",{children:"Imagery Standards"})]})}),(0,f.jsxs)("div",{className:"p-6 space-y-6",children:[Z()&&j&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"font-semibold text-slate-900 flex items-center space-x-2 mb-3",children:[(0,f.jsx)(Ue.A,{className:"h-4 w-4 text-indigo-600"}),(0,f.jsx)("span",{children:"Photography Standards"})]}),(0,f.jsx)("div",{className:"bg-indigo-50 rounded-lg p-4 border-l-4 border-indigo-500 prose prose-sm max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-slate-800",dangerouslySetInnerHTML:{__html:or.default.sanitize(j)}})]}),$()&&w&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"font-semibold text-slate-900 flex items-center space-x-2 mb-3",children:[(0,f.jsx)(Ge.A,{className:"h-4 w-4 text-purple-600"}),(0,f.jsx)("span",{children:"Videography Standards"})]}),(0,f.jsx)("div",{className:"bg-purple-50 rounded-lg p-4 border-l-4 border-purple-500 prose prose-sm max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-slate-800",dangerouslySetInnerHTML:{__html:or.default.sanitize(w)}})]})]})]}),b.must_capture_checklist&&b.must_capture_checklist.length>0&&(0,f.jsxs)("section",{id:"checklist",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-slate-200 bg-purple-50 flex justify-between items-center",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(p.A,{className:"h-5 w-5 text-purple-600"}),(0,f.jsx)("span",{children:"Must-Capture Checklist"})]}),(0,f.jsxs)("span",{className:"text-sm font-medium text-purple-700 bg-purple-100 px-3 py-1 rounded-full",children:[Object.values(P).filter(
1Boolean).length," / ",b.must_capture_checklist.length]})]}),(0,f.jsxs)("div",{className:"p-6",children:[(0,f.jsx)("p",{className:"text-sm text-purple-700 mb-4",children:"Click items as you complete them. Progress is saved automatically."}),(0,f.jsx)("div",{className:"space-y-2",children:b.must_capture_checklist.sort((e,t)=>e.order-t.order).map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg border border-slate-200 hover:border-purple-300 cursor-pointer transition-all group",children:[(0,f.jsx)("input",{type:"checkbox",checked:P[e.id]||!1,onChange:()=>re(e.id),className:"w-5 h-5 text-purple-600 border-2 border-purple-300 rounded focus:ring-2 focus:ring-purple-500"}),(0,f.jsx)("span",{className:"flex-1 ".concat(P[e.id]?"line-through text-slate-400":"text-slate-900"," transition-all"),children:e.text})]},e.id))})]})]}),b.priority_sponsor_stands&&b.priority_sponsor_stands.length>0&&(0,f.jsxs)("section",{id:"sponsor-stands",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-slate-200 bg-rose-50 flex justify-between items-center",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(p.A,{className:"h-5 w-5 text-rose-600"}),(0,f.jsx)("span",{children:"Priority Sponsor Stands"})]}),(0,f.jsxs)("span",{className:"text-sm font-medium text-rose-700 bg-rose-100 px-3 py-1 rounded-full",children:[Object.values(W).filter(Boolean).length," / ",b.priority_sponsor_stands.length]})]}),(0,f.jsxs)("div",{className:"p-6",children:[(0,f.jsx)("p",{className:"text-sm text-rose-700 mb-4",children:"Please ensure you capture at least one strong shot at each of the following stands with clear branding and visible attendee engagement."}),(0,f.jsx)("div",{className:"space-y-2",children:b.priority_sponsor_stands.sort((e,t)=>e.order-t.order).map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 bg-slate-50 rounded-lg border border-slate-200 hover:border-rose-300 cursor-pointer transition-all group",children:[(0,f.jsx)("input",{type:"checkbox",checked:W[e.id]||!1,onChange:()=>ie(e.id),className:"w-5 h-5 text-rose-600 border-2 border-rose-300 rounded focus:ring-2 focus:ring-rose-500"}),(0,f.jsx)("span",{className:"flex-1 ".concat(W[e.id]?"line-through text-slate-400":"text-slate-900"," transition-all"),children:e.text})]},e.id))})]})]}),(null===(h=b.voxpops)||void 0===h?void 0:h.enabled)&&(e=>{const t=Pi(b.voxpops),s=t.length>1;return(0,f.jsxs)("section",{id:"voxpops",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-slate-200 bg-emerald-50",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2 flex-wrap",children:[(0,f.jsx)(Di.A,{className:"h-5 w-5 text-emerald-600"}),(0,f.jsx)("span",{children:"Voxpops"}),pe.length>0&&(0,f.jsxs)("span",{className:"text-sm font-medium text-emerald-700",children:["\u2014 Filmed by ",pe.map(e=>e.name).join(", ")]})]}),(0,f.jsx)("p",{className:"text-sm text-slate-600 mt-1",children:"Turbo 360 crew will focus on sound and visual quality. Client to arrange the talent and ask the questions."})]}),(0,f.jsxs)("div",{className:"p-6 space-y-6",children:[t.map((e,t)=>(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[s?(0,f.jsxs)("p",{className:"text-xs font-semibold uppercase tracking-wider ".concat(e.completed?"text-emerald-500 line-through":"text-emerald-700"),children:["Subject ",t+1,e.completed&&e.completed_by?" \xb7 captured".concat(e.completed_by?" by "+e.completed_by:""):""]}):(0,f.jsx)("span",{}),me&&e.id&&(0,f.jsxs)("button",{type:"button",onClick:()=>me(e.id),className:"inline-flex items-center gap-1.5 text-xs font-medium rounded-full px-3 py-1 border transition-colors ".concat(e.completed?"bg-emerald-600 text-white border-emerald-600 hover:bg-emerald-700":"bg-white text-emerald-700 border-emerald-300 hover:bg-emerald-50"),title:e.completed?"Mark as not yet captured":"Mark as captured",children:[(0,f.jsx)(p.A,{className:"h-3.5 w-3.5"}),e.completed?"Captured":"Mark captured"]})]}),(0,f.jsxs)("div",{className:"grid sm:grid-cols-3 gap-4 ".concat(e.completed?"opacity-60":""),children:[e.time&&(0,f.jsxs)("div",{className:"bg-emerald-50 rounded-xl p-4 border border-emerald-100",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-600 font-medium mb-1",children:"Time"}),(0,f.jsx)("p",{className:"text-slate-900 font-semibold",children:Y(e.time)})]}),e.contact_name&&(0,f.jsxs)("div",{className:"bg-emerald-50 rounded-xl p-4 border border-emerald-100",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-600 font-medium mb-1",children:"Contact"}),(0,f.jsx)("p",{className:"text-slate-900 font-semibold",children:e.contact_name})]}),e.meeting_point&&(0,f.jsxs)("div",{className:"bg-emerald-50 rounded-xl p-4 border border-emerald-100",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-600 font-medium mb-1",children:"Meeting Point"}),(0,f.jsx)("p",{className:"text-slate-900 font-semibold",children:e.meeting_point})]})]})]},e.id||t)),(null===(e=b.voxpops.questions)||void 0===e?void 0:e.length)>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-emerald-600 uppercase tracking-wider mb-3",children:"Suggested Questions"}),(0,f.jsx)("ol",{className:"space-y-2",children:b.voxpops.questions.filter(e=>e).map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start space-x-3 bg-slate-50 rounded-lg p-3 border border-slate-100",children:[(0,f.jsx)("span",{className:"flex-shrink-0 w-6 h-6 bg-emerald-100 text-emerald-700 rounded-full flex items-center justify-center text-sm font-bold",children:t+1}),(0,f.jsx)("span",{className:"text-slate-700",children:e})]},t))})]})]})]})})(),(b.show_crew_upload_instructions||b.show_generic_upload_instructions||b.masv_portal_url)&&(0,f.jsxs)("section",{id:"upload",className:"bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 py-4 border-b border-slate-200 bg-slate-50",children:(0,f.jsxs)("h2",{className:"text-lg font-semibold text-slate-900 flex items-center space-x-2",children:[(0,f.jsx)(_s.A,{className:"h-5 w-5 text-red-600"}),(0,f.jsx)("span",{children:"Crew Upload Instructions"})]})}),(0,f.jsx)("div",{className:"p-6",children:b.masv_portal_url?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("p",{className:"text-slate-700",children:"Upload your RAW video and photo files directly from your browser \u2014 no software installation required."}),(0,f.jsxs)("a",{href:b.masv_portal_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-3 bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-500 hover:to-indigo-500 text-white rounded-xl p-5 transition-colors text-center",children:[(0,f.jsx)(_s.A,{className:"h-6 w-6"}),(0,f.jsx)("span",{className:"font-semibold text-lg",children:"Upload Files"})]}),b.masv_job_code&&(0,f.jsx)("div",{className:"bg-violet-50 border border-violet-200 rounded-lg p-3",children:(0,f.jsxs)("p",{className:"text-violet-900 text-sm font-medium",children:[(0,f.jsx)("span",{className:"font-semibold",children:"Job Code:"})," ",b.masv_job_code]})})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"text-slate-700 mb-6",children:"Download and install the Turbo Crew Upload software:"}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-arm64.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-slate-800 to-slate-900 hover:from-slate-700 hover:to-slate-800 text-white rounded-xl p-4 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold",children:"Crew Upload (Apple Silicon).dmg"}),(0,f.jsx)("p",{className:"text-xs text-slate-300",children:"For Apple Silicon Macs (M1, M2, M3, M4)"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-slate-600 to-slate-700 hover:from-slate-500 hover:to-slate-600 text-white rounded-xl p-4 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold",children:"Crew Upload (Intel).dmg"}),(0,f.jsx)("p",{className:"text-xs text-slate-300",children:"For Intel Macs"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-Setup.exe",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-500 hover:to-blue-600 text-white rounded-xl p-4 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M3 12V6.75l6-1.32v6.48L3 12zm17-9v8.75l-10 .15V5.21L20 3zM3 13l6 .09v6.81l-6-1.15V13zm17 .25V22l-10-1.91V13.1l10 .15z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold",children:"Crew Upload Setup.exe"}),(0,f.jsx)("p",{className:"text-xs text-blue-200",children:"For Windows"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5"})]})]}),(0,f.jsx)("div",{className:"mt-4 bg-amber-50 border border-amber-200 rounded-lg p-3",children:(0,f.jsxs)("p",{className:"text-amber-900 text-sm font-medium",children:[(0,f.jsx)("span",{className:"font-semibold",children:"Upload Password:"})," tcrew26"]})})]})})]}),(0,f.jsx)("section",{className:"bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 text-white rounded-xl overflow-hidden",children:(0,f.jsxs)("div",{className:"p-6 text-center",children:[(0,f.jsx)("div",{className:"bg-white/10 rounded-xl p-4 mb-4 inline-block",children:(0,f.jsxs)("div",{className:"flex items-center justify-center space-x-3",children:[(0,f.jsx)(E.A,{className:"h-6 w-6"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm text-slate-300",children:"Emergency Contact"}),(0,f.jsx)("p",{className:"text-2xl font-bold",children:"1300 207 446"})]})]})}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-2 text-sm text-slate-400",children:[(0,f.jsxs)("span",{children:["\xa9 ",(new Date).getFullYear()," Turbo 360"]}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"\u2022"}),(0,f.jsx)("span",{children:"[email protected]"})]})]})})]})})]})})]})};var Po=s(61972);const Wo={teal:"from-teal-500 to-cyan-600",rose:"from-rose-500 to-pink-600",purple:"from-purple-500 to-fuchsia-600",amber:"from-amber-500 to-orange-600",emerald:"from-emerald-500 to-teal-600",indigo:"from-indigo-500 to-blue-600",cyan:"from-cyan-500 to-sky-600",violet:"from-violet-500 to-purple-600",blue:"from-blue-500 to-indigo-600",slate:"from-slate-700 to-slate-900",orange:"from-orange-500 to-red-600"},Oo={teal:"border-t-teal-500",rose:"border-t-rose-500",purple:"border-t-purple-500",amber:"border-t-amber-500",emerald:"border-t-emerald-500",indigo:"border-t-indigo-500",cyan:"border-t-cyan-500",violet:"border-t-violet-500",blue:"border-t-blue-500",slate:"border-t-slate-700",orange:"border-t-orange-500"},Lo={teal:"text-teal-600",rose:"text-rose-600",purple:"text-purple-600",amber:"text-amber-600",emerald:"text-emerald-600",indigo:"text-indigo-600",cyan:"text-cyan-600",violet:"text-violet-600",blue:"text-blue-600",slate:"text-slate-700",orange:"text-orange-600"},Mo=e=>{var t,s,n,r,i,o,l,c,d,x,h,u,b,y,v,j,w;const{eventId:N,event:A,showShareNotification:k,isGeneratingPDF:S,photographyStandards:_,videographyStandards:z,activeSection:B,showMobileNav:D,setShowMobileNav:I,editingContact:R,editingBriefing:P,contactFormData:W,setContactFormData:O,briefingFormData:L,setBriefingFormData:M,isSaving:q,saveNotification:H,checklistCompletions:U,priorityStandCompletions:G,timedEventCompletions:V,showMessageModal:J,setShowMessageModal:Y,crewMessage:K,setCrew
1Message:Z,isSendingMessage:$,handleShare:Q,handleDownloadPDF:X,formatDate:ee,formatTime:te,groupEventsByTimeSlot:se,shouldShowPhotographyStandards:ae,shouldShowVideographyStandards:ne,scrollToSection:re,startEditingContact:ie,cancelEditingContact:oe,saveContactChanges:le,startEditingBriefing:ce,cancelEditingBriefing:de,saveBriefingChanges:me,toggleChecklistItem:pe,togglePriorityStand:xe,toggleTimedEvent:he,sendCrewMessage:ue,downloadDocument:ge,navItems:fe,toggleVoxpopItem:be,voxpopVideographers:ye=[],availableRoles:ve,activeRole:je,setActiveRole:we,handleDownloadAllRoles:Ne}=e,[Ae,ke]=(0,a.useState)(!1),Se=A.event_timezone||"Australia/Melbourne",_e=A.event_timezone&&"Australia/Melbourne"!==A.event_timezone?" ".concat((0,zo.iU)(A.event_timezone)):"",Ce=(0,a.useMemo)(()=>{var e,t;const s=A.event_date||(null===(e=A.event_days)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.date);if(!s)return null;const a=new Date;a.setHours(0,0,0,0);const n=new Date(s);n.setHours(0,0,0,0);const r=Math.round((n-a)/864e5);return 0===r?{label:"Today",tone:"live"}:1===r?{label:"Tomorrow",tone:"soon"}:r>1&&r<14?{label:"In ".concat(r," days"),tone:"soon"}:r<0?{label:"Wrapped",tone:"past"}:{label:n.toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short"}),tone:"soon"}},[A.event_date,A.event_days]),Fe=(0,a.useMemo)(()=>{if(!Ce||"Today"!==Ce.label)return null;let e=[];if("multi"===A.event_duration_type){const t=(new Date).toLocaleDateString("en-CA",{timeZone:Se}),s=(A.event_days||[]).find(e=>e.date===t);e=(null===s||void 0===s?void 0:s.timed_events)||[]}else e=A.timed_events||[];if(0===e.length)return null;const t=(new Date).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",timeZone:Se}),s=[...e].sort((e,t)=>(e.time||"00:00").localeCompare(t.time||"00:00"));let a=null,n=null;for(const r of s){if(!((r.time||"00:00")<=t)){n=r;break}a=r}return{current:a,next:n,nowHHMM:t}},[Ce,A,Se]),Ee=(null===(t=A.must_capture_checklist)||void 0===t?void 0:t.length)||0,Te=Object.values(U||{}).filter(Boolean).length,ze=(null===(s=A.priority_sponsor_stands)||void 0===s?void 0:s.length)||0,Be=Object.values(G||{}).filter(Boolean).length,De="multi"===A.event_duration_type?(A.event_days||[]).reduce((e,t)=>{var s;return e+((null===(s=t.timed_events)||void 0===s?void 0:s.length)||0)},0):(null===(n=A.timed_events)||void 0===n?void 0:n.length)||0,Ie=Object.values(V||{}).filter(Boolean).length,Re=(null===(r=A.crew_members)||void 0===r?void 0:r.length)||0,Pe=new Set((fe||[]).map(e=>e.id)),We=[{id:"overview",label:"Overview",icon:yn.A,accent:"teal"},{id:"timeline",label:"Schedule",icon:Nt.A,accent:"indigo",when:()=>Pe.has("timeline")},{id:"checklist",label:"Checklist",icon:Po.A,accent:"purple",when:()=>Pe.has("checklist")||Pe.has("sponsor-stands")},{id:"crew",label:"Crew",icon:Xe.A,accent:"emerald",when:()=>Pe.has("crew")},{id:"upload",label:"Upload",icon:_s.A,accent:"amber",when:()=>Pe.has("upload")}].filter(e=>!e.when||e.when()),Oe=e=>{let{id:t,accent:s="slate",children:a,className:n=""}=e;return(0,f.jsx)("section",{id:t,className:"relative bg-white rounded-3xl shadow-md ring-1 ring-slate-200/60 p-5 sm:p-7 scroll-mt-32 overflow-hidden border-t-[6px] ".concat(Oo[s]," ").concat(n),children:a})},Le=e=>{let{icon:t,accent:s,children:a,right:n}=e;return(0,f.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-5",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-11 h-11 rounded-2xl bg-gradient-to-br ".concat(Wo[s]," flex items-center justify-center shadow-sm"),children:t&&(0,f.jsx)(t,{className:"h-5 w-5 text-white"})}),(0,f.jsx)("h2",{className:"text-xl sm:text-2xl font-bold text-slate-900 tracking-tight truncate",children:a})]}),n]})},Me=function(e){var t;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const a=V[e.id]||e.completed,n=(null===Fe||void 0===Fe||null===(t=Fe.current)||void 0===t?void 0:t.id)===e.id;return(0,f.jsxs)("button",{type:"button",onClick:()=>he(e.id,s),className:"group relative w-full flex items-start gap-3 sm:gap-4 rounded-2xl p-3.5 sm:p-4 text-left transition-all min-h-[68px] ".concat(n?"bg-gradient-to-br from-orange-500 to-rose-600 text-white shadow-lg ring-2 ring-orange-400":a?"bg-emerald-50 ring-1 ring-emerald-200 hover:bg-emerald-100":"bg-slate-50 ring-1 ring-slate-200 active:bg-indigo-50 hover:ring-indigo-300"),children:[(0,f.jsxs)("div",{className:"flex-shrink-0 w-14 sm:w-16 text-right",children:[(0,f.jsx)("p",{className:"text-sm sm:text-base font-bold tabular-nums leading-tight ".concat(n?"text-white":a?"text-emerald-700":"text-slate-900"),children:te(e.time)}),n&&(0,f.jsxs)("p",{className:"text-[10px] uppercase tracking-widest text-white/95 mt-0.5 font-extrabold flex items-center justify-end gap-1",children:[(0,f.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-white rounded-full animate-pulse"}),"Now"]})]}),(0,f.jsxs)("div",{className:"flex-shrink-0 mt-1 w-6 h-6 rounded-lg border-2 flex items-center justify-center transition-colors ".concat(n?"bg-white/20 border-white":a?"bg-emerald-600 border-emerald-600":"border-slate-300 bg-white group-hover:border-indigo-400"),children:[a&&!n&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"}),n&&(0,f.jsx)(Ve.A,{className:"h-3.5 w-3.5 text-white"})]}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[e.stream&&(0,f.jsx)("p",{className:"text-[10px] uppercase tracking-widest mb-0.5 font-bold ".concat(n?"text-white/90":"text-indigo-600"),children:e.stream}),(0,f.jsx)("p",{className:"text-sm sm:text-base font-medium ".concat(n?"text-white":a?"text-slate-500 line-through":"text-slate-900"),children:e.description||e.title||"Untitled task"}),e.notes&&(0,f.jsx)("p",{className:"text-xs mt-1 italic whitespace-pre-line ".concat(n?"text-white/90":"text-slate-500"),children:e.notes}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),a&&!n&&e.completed_by&&(0,f.jsxs)("p",{className:"text-xs text-emerald-700 mt-1 font-medium",children:["\u2713 ",e.completed_by]})]})]},e.id)};return(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-b from-slate-100 via-white to-slate-100 pb-28 lg:pb-12",children:[(0,f.jsx)("header",{className:"bg-white/80 backdrop-blur-md border-b border-slate-200/80 sticky top-0 z-40 print:hidden",children:(0,f.jsxs)("div",{className:"max-w-3xl mx-auto px-4 py-2.5 flex items-center justify-between gap-3",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-6 bg-slate-900 rounded-md px-1.5 py-0.5 flex-shrink-0"}),(0,f.jsx)("h1",{className:"text-sm font-semibold text-slate-900 truncate",children:A.event_name})]}),(0,f.jsxs)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[(0,f.jsx)("button",{onClick:Q,"aria-label":"Share",className:"p-2 text-slate-600 hover:text-teal-600 hover:bg-slate-100 rounded-lg transition-colors",children:(0,f.jsx)(at.A,{className:"h-4 w-4"})}),(0,f.jsxs)("button",{onClick:X,disabled:S,className:"flex items-center gap-1.5 px-3 py-1.5 bg-gradient-to-r from-teal-500 to-cyan-600 hover:from-teal-600 hover:to-cyan-700 disabled:opacity-50 text-white rounded-lg text-sm font-semibold shadow-sm transition-all",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:S?"Generating\u2026":"PDF"})]})]})]})}),(0,f.jsx)(Do,{availableRoles:ve,activeRole:je,setActiveRole:we,activeRunsheet:e.activeRunsheet}),(0,f.jsx)(Yi,{availableRoles:ve,activeRole:je,setActiveRole:we}),k&&(0,f.jsxs)("div",{className:"fixed top-16 right-4 bg-slate-900 text-white px-4 py-2 rounded-xl shadow-lg z-50 flex items-center gap-2 print:hidden text-sm",children:[(0,f.jsx)(p.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Link copied!"})]}),H&&(0,f.jsxs)("div",{className:"fixed top-16 right-4 px-4 py-2 rounded-xl shadow-lg z-50 flex items-center gap-2 print:hidden text-sm ".concat("success"===H.type?"bg-emerald-600":"bg-rose-600"," text-white"),children:["success"===H.type?(0,f.jsx)(p.A,{className:"h-4 w-4"}):(0,f.jsx)(g.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:H.message})]}),J&&(0,f.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm print:hidden",onClick:()=>Y(!1),children:(0,f.jsxs)("div",{className:"bg-white rounded-3xl shadow-2xl w-full max-w-md mx-4 p-6",onClick:e=>e.stopPropagation(),children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("h3",{className:"font-bold text-slate-900 flex items-center gap-2",children:[(0,f.jsx)(Fn.A,{className:"h-5 w-5 text-teal-600"}),(0,f.jsx)("span",{children:"Message Crew"})]}),(0,f.jsx)("button",{onClick:()=>Y(!1),className:"text-slate-400 hover:text-slate-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsx)("textarea",{value:K,onChange:e=>Z(e.target.value),placeholder:"Type your message\u2026",className:"w-full border border-slate-200 rounded-xl px-3 py-2 text-sm focus:ring-2 focus:ring-teal-600 focus:border-teal-600 outline-none resize-none",rows:4,maxLength:500,autoFocus:!0}),(0,f.jsxs)("div",{className:"flex justify-end gap-2 mt-4",children:[(0,f.jsx)("button",{onClick:()=>Y(!1),className:"px-4 py-2 text-sm text-slate-600 hover:text-slate-800",children:"Cancel"}),(0,f.jsxs)("button",{onClick:ue,disabled:!K.trim()||$,className:"px-4 py-2 text-sm bg-gradient-to-r from-teal-500 to-cyan-600 text-white rounded-lg hover:from-teal-600 hover:to-cyan-700 disabled:opacity-50 flex items-center gap-2",children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:$?"Sending\u2026":"Send"})]})]})]})}),(0,f.jsxs)("main",{className:"max-w-3xl mx-auto px-3 sm:px-4 py-4 sm:py-6 space-y-4 sm:sp
1ace-y-5",children:[(0,f.jsxs)("section",{id:"overview",className:"relative rounded-3xl overflow-hidden shadow-xl",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-indigo-600 via-purple-600 to-pink-600"}),(0,f.jsx)("div",{className:"absolute -top-16 -right-16 w-64 h-64 bg-cyan-400/30 rounded-full blur-3xl"}),(0,f.jsx)("div",{className:"absolute -bottom-20 -left-20 w-72 h-72 bg-fuchsia-400/30 rounded-full blur-3xl"}),(0,f.jsxs)("div",{className:"relative p-6 sm:p-8 text-white",children:[A.company_logo_url&&(0,f.jsx)("img",{src:A.company_logo_url,alt:"",className:"h-10 object-contain mb-4 bg-white/10 rounded-lg p-1.5 backdrop-blur",onError:e=>{e.target.style.display="none"}}),(0,f.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-4",children:[(0,f.jsx)("h1",{className:"text-3xl sm:text-4xl font-extrabold tracking-tight leading-tight drop-shadow-sm",children:A.event_name}),Ce&&(0,f.jsxs)("span",{className:"flex-shrink-0 px-3 py-1.5 rounded-full text-xs font-extrabold uppercase tracking-wider self-start backdrop-blur ".concat("live"===Ce.tone?"bg-white text-pink-600 shadow-lg":"soon"===Ce.tone?"bg-white/20 text-white ring-1 ring-white/40":"bg-black/30 text-white/80"),children:["live"===Ce.tone&&(0,f.jsx)("span",{className:"inline-block w-1.5 h-1.5 bg-pink-600 rounded-full mr-1.5 animate-pulse"}),Ce.label]})]}),(0,f.jsxs)("div",{className:"space-y-2 text-sm sm:text-base",children:[A.client_company&&(0,f.jsxs)("p",{className:"flex items-center gap-2",children:[(0,f.jsx)(Ke.A,{className:"h-4 w-4 text-white/70 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-medium",children:A.client_company})]}),A.venue&&(0,f.jsxs)("p",{className:"flex items-center gap-2",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-white/70 flex-shrink-0"}),(0,f.jsx)("span",{children:A.venue})]}),"single"===A.event_duration_type&&A.event_date&&(0,f.jsxs)("p",{className:"flex items-center gap-2",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4 text-white/70 flex-shrink-0"}),(0,f.jsx)("span",{children:ee(A.event_date)})]}),"single"===A.event_duration_type&&(A.start_time||A.end_time)&&(0,f.jsxs)("p",{className:"flex items-center gap-2",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4 text-white/70 flex-shrink-0"}),(0,f.jsxs)("span",{className:"tabular-nums",children:[te(A.start_time)||"TBC"," \u2014 ",te(A.end_time)||"TBC",_e]})]}),A.event_website&&(0,f.jsxs)("a",{href:A.event_website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm bg-white/15 hover:bg-white/25 backdrop-blur px-3 py-1.5 rounded-full font-semibold mt-2 transition-colors",children:[(0,f.jsx)(En.A,{className:"h-3.5 w-3.5"}),(0,f.jsx)("span",{children:"Event website"})]})]}),"multi"===A.event_duration_type&&(null===(i=A.event_days)||void 0===i?void 0:i.length)>0&&(0,f.jsx)("div",{className:"mt-5 grid grid-cols-2 sm:grid-cols-3 gap-2",children:A.event_days.map((e,t)=>(0,f.jsxs)("div",{className:"bg-white/15 backdrop-blur rounded-2xl p-3 ring-1 ring-white/20",children:[(0,f.jsxs)("p",{className:"text-[10px] font-extrabold uppercase tracking-widest text-white/80",children:["Day ",t+1]}),(0,f.jsx)("p",{className:"font-bold text-white text-sm mt-0.5",children:new Date(e.date).toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short"})}),(0,f.jsxs)("p",{className:"text-xs text-white/80 tabular-nums mt-0.5",children:[te(e.start_time)," \u2014 ",te(e.end_time)]})]},e.id||t))})]})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[De>0&&(0,f.jsxs)("button",{onClick:()=>re("timeline"),className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-indigo-500 to-blue-600 p-4 text-left text-white shadow-md hover:shadow-lg transition-shadow",children:[(0,f.jsx)(Nt.A,{className:"absolute -bottom-2 -right-2 h-16 w-16 text-white/10"}),(0,f.jsx)("p",{className:"text-[10px] font-extrabold uppercase tracking-widest text-white/80",children:"Schedule"}),(0,f.jsxs)("p",{className:"text-2xl font-extrabold tabular-nums mt-1",children:[Ie,(0,f.jsxs)("span",{className:"text-white/70 text-base",children:["/",De]})]}),(0,f.jsx)("p",{className:"text-xs text-white/80",children:"tasks complete"})]}),Re>0&&(0,f.jsxs)("button",{onClick:()=>re("crew"),className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-emerald-500 to-teal-600 p-4 text-left text-white shadow-md hover:shadow-lg transition-shadow",children:[(0,f.jsx)(Xe.A,{className:"absolute -bottom-2 -right-2 h-16 w-16 text-white/10"}),(0,f.jsx)("p",{className:"text-[10px] font-extrabold uppercase tracking-widest text-white/80",children:"Crew"}),(0,f.jsx)("p",{className:"text-2xl font-extrabold tabular-nums mt-1",children:Re}),(0,f.jsx)("p",{className:"text-xs text-white/80",children:"on the team"})]}),Ee>0&&(0,f.jsxs)("button",{onClick:()=>re("checklist"),className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-purple-500 to-fuchsia-600 p-4 text-left text-white shadow-md hover:shadow-lg transition-shadow",children:[(0,f.jsx)(p.A,{className:"absolute -bottom-2 -right-2 h-16 w-16 text-white/10"}),(0,f.jsx)("p",{className:"text-[10px] font-extrabold uppercase tracking-widest text-white/80",children:"Must Capture"}),(0,f.jsxs)("p",{className:"text-2xl font-extrabold tabular-nums mt-1",children:[Te,(0,f.jsxs)("span",{className:"text-white/70 text-base",children:["/",Ee]})]}),(0,f.jsx)("p",{className:"text-xs text-white/80",children:"shots captured"})]}),ze>0&&(0,f.jsxs)("button",{onClick:()=>
1re("sponsor-stands"),className:"relative overflow-hidden rounded-2xl bg-gradient-to-br from-rose-500 to-pink-600 p-4 text-left text-white shadow-md hover:shadow-lg transition-shadow",children:[(0,f.jsx)(nt.A,{className:"absolute -bottom-2 -right-2 h-16 w-16 text-white/10"}),(0,f.jsx)("p",{className:"text-[10px] font-extrabold uppercase tracking-widest text-white/80",children:"Sponsors"}),(0,f.jsxs)("p",{className:"text-2xl font-extrabold tabular-nums mt-1",children:[Be,(0,f.jsxs)("span",{className:"text-white/70 text-base",children:["/",ze]})]}),(0,f.jsx)("p",{className:"text-xs text-white/80",children:"stands covered"})]})]}),Fe&&(Fe.current||Fe.next)&&(0,f.jsxs)("section",{id:"now",className:"relative rounded-3xl overflow-hidden shadow-xl",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-orange-500 via-rose-500 to-pink-600"}),(0,f.jsx)("div",{className:"absolute -top-20 right-0 w-80 h-80 bg-yellow-400/30 rounded-full blur-3xl"}),(0,f.jsxs)("div",{className:"relative p-6 sm:p-8 text-white",children:[(0,f.jsxs)("div",{className:"flex items-baseline justify-between mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(F.A,{className:"h-5 w-5 text-yellow-200"}),(0,f.jsx)("p",{className:"text-xs uppercase tracking-[0.2em] font-extrabold",children:"Right Now"}),(0,f.jsx)("span",{className:"inline-block w-2 h-2 bg-yellow-200 rounded-full animate-pulse"})]}),(0,f.jsxs)("p",{className:"text-sm tabular-nums font-semibold opacity-90",children:[Fe.nowHHMM,_e]})]}),Fe.current?(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-6xl sm:text-7xl font-black tabular-nums leading-none drop-shadow-sm",children:te(Fe.current.time)}),(0,f.jsx)("p",{className:"text-lg sm:text-xl mt-3 leading-snug font-semibold",children:Fe.current.description||Fe.current.title||"Current task"}),Fe.current.stream&&(0,f.jsx)("p",{className:"text-xs opacity-90 mt-1 uppercase tracking-widest font-bold",children:Fe.current.stream})]}):(0,f.jsx)("div",{children:(0,f.jsxs)("p",{className:"text-3xl sm:text-4xl font-extrabold leading-tight",children:["Coming up at ",(0,f.jsx)("span",{className:"tabular-nums",children:te(null===(o=Fe.next)||void 0===o?void 0:o.time)})]})}),Fe.next&&Fe.current&&(0,f.jsxs)("div",{className:"mt-5 pt-5 border-t border-white/30",children:[(0,f.jsx)("p",{className:"text-[10px] uppercase tracking-widest font-extrabold opacity-80 mb-1.5",children:"Up Next"}),(0,f.jsxs)("div",{className:"flex items-baseline gap-3",children:[(0,f.jsx)("p",{className:"text-xl font-bold tabular-nums flex-shrink-0",children:te(Fe.next.time)}),(0,f.jsx)("p",{className:"text-sm sm:text-base opacity-95 leading-snug font-medium",children:Fe.next.description||Fe.next.title||"Next task"})]})]})]})]}),(null===(l=A.deliverables)||void 0===l?void 0:l.length)>0&&(0,f.jsxs)(Oe,{id:"deliverables",accent:"amber",children:[(0,f.jsx)(Le,{icon:as.A,accent:"amber",children:"Deliverables"}),(0,f.jsx)("ul",{className:"space-y-2",children:A.deliverables.map(e=>(0,f.jsxs)("li",{className:"bg-gradient-to-r from-amber-50 to-orange-50 rounded-xl p-3 border-l-4 border-amber-500",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:e.name}),e.description&&(0,f.jsx)("p",{className:"text-sm text-slate-600 mt-0.5",children:e.description})]},e.id))})]}),("single"===A.event_duration_type&&(null===(c=A.timed_events)||void 0===c?void 0:c.length)>0||"multi"===A.event_duration_type&&(null===(d=A.event_days)||void 0===d?void 0:d.length)>0)&&(0,f.jsxs)(Oe,{id:"timeline",accent:"indigo",children:[(0,f.jsx)(Le,{icon:Nt.A,accent:"indigo",children:"Schedule"}),"single"===A.event_duration_type?(0,f.jsx)("div",{className:"space-y-2",children:se(A.timed_events).map(e=>(0,f.jsx)("div",{children:e.hasStreams?(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:e.events.map(e=>Me(e))}):e.events.map(e=>Me(e))},e.time))}):(0,f.jsx)("div",{className:"space-y-6",children:A.event_days.map((e,t)=>{var s;return(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"mb-3 pb-3 border-b-2 border-indigo-100",children:[(0,f.jsxs)("p",{className:"text-[10px] font-extrabold uppercase tracking-widest text-indigo-600",children:["Day ",t+1]}),(0,f.jsx)("p",{className:"font-bold text-slate-900 text-lg",children:ee(e.date)}),(0,f.jsxs)("p",{className:"text-xs text-slate-500 tabular-nums",children:[te(e.start_time)," \u2014 ",te
1(e.end_time)]})]}),(null===(s=e.timed_events)||void 0===s?void 0:s.length)>0&&(0,f.jsx)("div",{className:"space-y-2",children:se(e.timed_events).map(t=>(0,f.jsx)("div",{children:t.hasStreams?(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:t.events.map(t=>Me(t,e.id))}):t.events.map(t=>Me(t,e.id))},t.time))})]},e.id||t)})})]}),(null===(x=A.voxpops)||void 0===x?void 0:x.enabled)&&(e=>{const t=Pi(A.voxpops),s=t.length>1;return(0,f.jsxs)(Oe,{id:"voxpops",accent:"emerald",children:[(0,f.jsx)(Le,{icon:Di.A,accent:"emerald",right:ye.length>0&&(0,f.jsxs)("span",{className:"hidden sm:inline-flex text-xs text-emerald-700 bg-emerald-50 px-2.5 py-1 rounded-full ring-1 ring-emerald-200 self-center",children:["Filmed by ",ye.map(e=>e.name).join(", ")]}),children:"Voxpops"}),(0,f.jsx)("p",{className:"text-sm text-slate-600 mb-4",children:"Turbo 360 crew will focus on sound and visual quality. Client to arrange the talent and ask the questions."}),(0,f.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>(0,f.jsxs)("div",{className:"bg-gradient-to-r from-emerald-50 to-teal-50 rounded-2xl p-4 ring-1 ring-emerald-200 ".concat(e.completed?"opacity-60":""),children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[s?(0,f.jsxs)("p",{className:"text-xs font-extrabold uppercase tracking-widest text-emerald-700",children:["Subject ",t+1]}):(0,f.jsx)("span",{}),be&&e.id&&(0,f.jsx)("button",{onClick:()=>be(e.id),className:"text-xs font-bold rounded-full px-3 py-1.5 ring-1 transition-colors ".concat(e.completed?"bg-emerald-600 text-white ring-emerald-600":"bg-white text-emerald-700 ring-emerald-300 hover:bg-emerald-50"),children:e.completed?"\u2713 Captured":"Mark captured"})]}),(0,f.jsxs)("div",{className:"grid sm:grid-cols-3 gap-3 text-sm",children:[e.time&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[10px] uppercase tracking-widest text-emerald-700 font-extrabold mb-0.5",children:"Time"}),(0,f.jsx)("p",{className:"text-slate-900 font-semibold tabular-nums",children:te(e.time)})]}),e.contact_name&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[10px] uppercase tracking-widest text-emerald-700 font-extrabold mb-0.5",children:"Contact"}),(0,f.jsx)("p",{className:"text-slate-900 font-semibold",children:e.contact_name})]}),e.meeting_point&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-[10px] uppercase tracking-widest text-emerald-700 font-extrabold mb-0.5",children:"Meeting Point"}),(0,f.jsx)("p",{className:"text-slate-900 font-semibold",children:e.meeting_point})]})]})]},e.id||t))}),(null===(e=A.voxpops.questions)||void 0===e?void 0:e.length)>0&&(0,f.jsxs)("div",{className:"mt-5 pt-4 border-t border-slate-200",children:[(0,f.jsx)("p",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold mb-3",children:"Suggested questions"}),(0,f.jsx)("ol",{className:"space-y-2",children:A.voxpops.questions.filter(e=>e).map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start gap-3 text-sm",children:[(0,f.jsx)("span",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-emerald-100 text-emerald-700 flex items-center justify-center font-bold text-xs",children:t+1}),(0,f.jsx)("span",{className:"text-slate-700 pt-0.5",children:e})]},t))})]})]})})(),(null===(h=A.must_capture_checklist)||void 0===h?void 0:h.length)>0&&(0,f.jsxs)(Oe,{id:"checklist",accent:"purple",children:[(0,f.jsx)(Le,{icon:p.A,accent:"purple",right:(0,f.jsxs)("div",{className:"flex items-center gap-2 self-center",children:[(0,f.jsx)("div",{className:"w-24 h-2 bg-slate-200 rounded-full overflow-hidden",children:(0,f.jsx)("div",{className:"h-full bg-gradient-to-r from-purple-500 to-fuchsia-600",style:{width:"".concat(Ee?Te/Ee*100:0,"%")}})}),(0,f.jsxs)("span",{className:"text-sm font-extrabold text-purple-700 tabular-nums",children:[Te,"/",Ee]})]}),children:"Must Capture"}),(0,f.jsx)("p",{className:"text-sm text-slate-500 mb-3",children:"Tap each one as you capture it."}),(0,f.jsx)("div",{className:"space-y-1.5",children:A.must_capture_checklist.sort((e,t)=>(e.order||0)-(t.order||0)).map(e=>{const t=U[e.id];return(0,f.jsxs)("button",{type:"button",onClick:()=>pe(e.id),className:"w-full flex items-center gap-3 p-3.5 rounded-2xl text-left min-h-[60
1px] transition-all ".concat(t?"bg-emerald-50 ring-1 ring-emerald-200":"bg-gradient-to-r from-purple-50 to-fuchsia-50 ring-1 ring-purple-200 active:bg-purple-100 hover:ring-purple-300"),children:[(0,f.jsx)("span",{className:"flex-shrink-0 w-7 h-7 rounded-lg border-2 flex items-center justify-center ".concat(t?"bg-emerald-600 border-emerald-600":"border-purple-300 bg-white"),children:t&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"})}),(0,f.jsx)("span",{className:"flex-1 text-sm sm:text-base font-medium ".concat(t?"text-slate-500 line-through":"text-slate-900"),children:e.text})]},e.id)})})]}),(null===(u=A.priority_sponsor_stands)||void 0===u?void 0:u.length)>0&&(0,f.jsxs)(Oe,{id:"sponsor-stands",accent:"rose",children:[(0,f.jsx)(Le,{icon:nt.A,accent:"rose",right:(0,f.jsxs)("div",{className:"flex items-center gap-2 self-center",children:[(0,f.jsx)("div",{className:"w-24 h-2 bg-slate-200 rounded-full overflow-hidden",children:(0,f.jsx)("div",{className:"h-full bg-gradient-to-r from-rose-500 to-pink-600",style:{width:"".concat(ze?Be/ze*100:0,"%")}})}),(0,f.jsxs)("span",{className:"text-sm font-extrabold text-rose-700 tabular-nums",children:[Be,"/",ze]})]}),children:"Sponsor Stands"}),(0,f.jsx)("p",{className:"text-sm text-slate-500 mb-3",children:"Please capture at least one strong shot at each of the following stands with clear branding and visible attendee engagement."}),(0,f.jsx)("div",{className:"space-y-1.5",children:A.priority_sponsor_stands.sort((e,t)=>(e.order||0)-(t.order||0)).map(e=>{const t=G[e.id];return(0,f.jsxs)("button",{type:"button",onClick:()=>xe(e.id),className:"w-full flex items-center gap-3 p-3.5 rounded-2xl text-left min-h-[60px] transition-all ".concat(t?"bg-emerald-50 ring-1 ring-emerald-200":"bg-gradient-to-r from-rose-50 to-pink-50 ring-1 ring-rose-200 active:bg-rose-100 hover:ring-rose-300"),children:[(0,f.jsx)("span",{className:"flex-shrink-0 w-7 h-7 rounded-lg border-2 flex items-center justify-center ".concat(t?"bg-emerald-600 border-emerald-600":"border-rose-300 bg-white"),children:t&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"})}),(0,f.jsx)("span",{className:"flex-1 text-sm sm:text-base font-medium ".concat(t?"text-slate-500 line-through":"text-slate-900"),children:e.text})]},e.id)})})]}),(null===(b=A.crew_members)||void 0===b?void 0:b.length)>0&&(0,f.jsxs)(Oe,{id:"crew",accent:"emerald",children:[(0,f.jsxs)(Le,{icon:Xe.A,accent:"emerald",children:["Crew \xb7 ",A.crew_members.length]}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2.5",children:A.crew_members.map((e,t)=>{const s=["from-emerald-500 to-teal-600","from-cyan-500 to-blue-600","from-indigo-500 to-purple-600","from-purple-500 to-pink-600","from-orange-500 to-rose-600","from-amber-500 to-orange-600"],a=s[t%s.length],n=(e.name||"?").split(/\s+/).slice(0,2).map(e=>e[0]).join("").toUpperCase();return(0,f.jsx)("div",{className:"bg-slate-50 rounded-2xl p-3.5 ring-1 ring-slate-200 hover:ring-emerald-300 transition-colors",children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-12 h-12 rounded-2xl bg-gradient-to-br ".concat(a," text-white flex items-center justify-center font-extrabold text-sm shadow-sm"),children:n}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"font-bold text-slate-900 text-sm truncate",children:e.name}),(0,f.jsx)("span",{className:"inline-block text-[10px] font-extrabold uppercase tracking-widest text-emerald-700 bg-emerald-100 rounded-full px-2 py-0.5 mt-1",children:Pn(e.role)}),(e.start_time||e.end_time)&&(0,f.jsxs)("p",{className:"text-[11px] text-slate-500 mt-1 flex items-center gap-1 font-mono",children:[(0,f.jsx)(Nt.A,{className:"h-3 w-3"}),e.start_time||A.start_time||"09:00"," \u2013 ",e.end_time||A.end_time||"17:00"]}),e.mobile&&(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center gap-1.5 text-xs text-slate-600 hover:text-emerald-600 mt-1.5 font-medium",children:[(0,f.jsx)(E.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{className:"tabular-nums",children:e.mobile})]})]})]})},e.id)})})]}),(0,f.jsxs)(Oe,{id:"contact",accent:"cyan",children:[(0,f.jsxs)(Le,{icon:Ye.A,accent:"cyan",right:!R&&!(null!==(y=A.client_contacts)&&void 0!==y&&y.length)&&(0,f.jsxs)("button",{onClick:ie,className:"flex items-center gap-1 text-cyan-600 hover:text-cyan-700 text-sm font-semibold print:hidden self-center",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]}),children:["Client Contact",(null===(v=A.client_contacts)||void 0===v?void 0:v.length)>1?"s":""]}),(null===(j=A.client_contacts)||void 0===j?void 0:j.length)>0?(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,f.jsx)(Ke.A,{className:"h-4 w-4 text-cyan-500"}),(0,f.jsx)("span",{className:"font-bold text-slate-900",children:A.client_company})]}),(0,f.jsx)("div",{className:"grid sm:grid-cols-2 gap-2.5",children:A.client_contacts.map(e=>(0,f.jsxs)("div",{className:"rounded-2xl p-3.5 ring-1 ".concat(e.is_primary?"bg-gradient-to-br from-cyan-50 to-sky-50 ring-cyan-200":"bg-slate-50 ring-slate-200"),children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-1.5",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-bold text-slate-900 text-sm",children:e.name}),e.role&&(0,f.jsx)("p",{className:"text-xs text-slate-500",children:e.role})]}),e.is_primary&&(0,f.jsx)("span",{className:"text-[10px] font-extrabold uppercase tracking-widest text-white bg-gradient-to-r from-cyan-500 to-sky-600 px-2 py-0.5 rounded-full",children:"Primary"})]}),(0,f.jsxs)("div",{className:"space-y-1 mt-2",children:[e.email&&(0,f.jsxs)("a",{href:"mailto:".concat(e.email),className:"flex items-center gap-1.5 text-xs text-slate-600 hover:text-cyan-600 font-medium",children:[(0,f.jsx)(T.A,{className:"h-3 w-3"}),e.email]}),e.mobile&&(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center gap-1.5 text-xs text-slate-600 hover:text-cyan-600 font-medium",children:[(0,f.jsx)(E.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{className:"tabular-nums",children:e.mobile})]})]})]},e.id))}),A.additional_notes&&(0,f.jsxs)("div",{className:"pt-3 border-t border-slate-200",children:[(0,f.jsx)("p",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold mb-1",children:"Additional notes"}),(0,f.jsx)("p",{className:"text-sm text-slate-700",children:A.additional_notes})]})]}):R?(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold block mb-1",children:"Name"}),(0,f.jsx)("input",{type:"text",value:W.primary_contact,onChange:e=>O(t=>(0,m.A)((0,m.A)({},t),{},{primary_contact:e.target.value})),className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm focus:ring-2 focus:ring-cyan-600 focus:border-cyan-600 outline-none"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold block mb-1",children:"Company"}),(0,f.jsx)("input",{type:"text",value:A.client_company,disabled:!0,className:"w-full px-3 py-2 border border-slate-100 bg-slate-50 rounded-lg text-sm text-slate-400"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold block mb-1",children:"Email"}),(0,f.jsx)("input",{type:"email",value:W.email,onChange:e=>O(t=>(0,m.A)((0,m.A)({},t),{},{email:e.target.value})),className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm focus:ring-2 focus:ring-cyan-600 focus:border-cyan-600 outline-none"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold block mb-1",children:"Mobile"}),(0,f.jsx)("input",{type:"tel",value:W.mobile,onChange:e=>O(t=>(0,m.A)((0,m.A)({},t),{},{mobile:e.target.value})),className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm focus:ring-2 focus:ring-cyan-600 focus:border-cyan-600 outline-none"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold block mb-1",children:"Additional notes"}),(0,f.jsx)("textarea",{value:W.additional_notes,onChange:e=>O(t=>(0,m.A)((0,m.A)({},t),{},{additional_notes:e.target.value})),className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm focus:ring-2 focus:ring-cyan-600 focus:border-cyan-600 outline-none",rows:2})]}),(0,f.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,f.jsx)("button",{onClick:oe,disabled:q,className:"px-4 py-2 text-sm text-slate-600 hover:text-slate-800",children:"Cancel"}),(0,f.jsxs)("button",{onClick:le,disabled:q,className:"flex items-center gap-1.5 px-4 py-2 bg-gradient-to-r from-cyan-500 to-sky-600 hover:from-cyan-600 hover:to-sky-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:q?"Saving\u2026":"Save"})]})]})]}):(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-x-6 gap-y-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold mb-0.5",children:"Name"}),(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:A.primary_contact||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold mb-0.5",children:"Company"}),(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:A.client_company||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold mb-0.5",children:"Email"}),(0,f.jsx)("a",{href:"mailto:".concat(A.email),className:"text-sm text-slate-600 hover:text-cyan-600 font-medium",children:A.email||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold mb-0.5",children:"Mobile"}),(0,f.jsx)("a",{href:"tel:".concat(A.mobile),className:"text-sm text-slate-600 hover:text-cyan-600 tabular-nums font-medium",children:A.mobile||"\u2014"})]}),A.additional_notes&&(0,f.jsxs)("div",{className:"sm:col-span-2 pt-2 border-t border-slate-200",children:[(0,f.jsx)("p",{className:"text-xs uppercase tracking-widest text-slate-500 font-bold mb-1",children:"Additional notes"}),(0,f.jsx)("p",{className:"text-sm text-slate-700",children:A.additional_notes})]})]})]}),(A.supporting_documents&&A.supporting_documents.length>0||A.client_brief_file)&&(0,f.jsxs)(Oe,{id:"documents",accent:"blue",children:[(0,f.jsx)(Le,{icon:kt.A,accent:"blue",children:"Documents"}),(0,f.jsxs)("div",{className:"space-y-2",children:[null===(w=A.supporting_documents)||void 0===w?void 0:w.map((e,t)=>e.external_url?(0,f.jsxs)("a",{href:e.external_url,target:"_blank",rel:"noopener noreferrer",className:"w-full flex items-center justify-between bg-gradient-to-r from-indigo-50 to-violet-50 hover:from-indigo-100 hover:to-violet-100 active:from-indigo-200 active:to-violet-200 rounded-2xl p-3.5 ring-1 ring-indigo-200 transition-all text-left min-h-[60
1px]",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-9 h-9 rounded-xl bg-gradient-to-br from-indigo-500 to-violet-600 flex items-center justify-center",children:(0,f.jsx)(En.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900 text-sm truncate",children:e.title||e.external_url}),(0,f.jsx)("p",{className:"text-xs text-slate-500 truncate",children:e.external_url})]})]}),(0,f.jsx)(En.A,{className:"h-4 w-4 text-indigo-600 flex-shrink-0"})]},e.link_id||t):(0,f.jsxs)("button",{onClick:()=>ge(e),className:"w-full flex items-center justify-between bg-gradient-to-r from-blue-50 to-indigo-50 hover:from-blue-100 hover:to-indigo-100 active:from-blue-200 active:to-indigo-200 rounded-2xl p-3.5 ring-1 ring-blue-200 transition-all text-left min-h-[60px]",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-9 h-9 rounded-xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center",children:(0,f.jsx)(kt.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900 text-sm truncate",children:e.original_filename||"Document"}),e.file_size&&(0,f.jsxs)("p",{className:"text-xs text-slate-500",children:[(e.file_size/1024/1024).toFixed(2)," MB"]})]})]}),(0,f.jsx)(es.A,{className:"h-4 w-4 text-blue-600 flex-shrink-0"})]},e.file_key||t)),A.client_brief_file&&(!A.supporting_documents||0===A.supporting_documents.length)&&(0,f.jsxs)("button",{onClick:()=>ge(A.client_brief_file),className:"w-full flex items-center justify-between bg-gradient-to-r from-blue-50 to-indigo-50 hover:from-blue-100 hover:to-indigo-100 rounded-2xl p-3.5 ring-1 ring-blue-200 transition-all text-left min-h-[60px]",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-9 h-9 rounded-xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center",children:(0,f.jsx)(kt.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900 text-sm truncate",children:A.client_brief_file.original_filename||"Document"}),A.client_brief_file.file_size&&(0,f.jsxs)("p",{className:"text-xs text-slate-500",children:[(A.client_brief_file.file_size/1024/1024).toFixed(2)," MB"]})]})]}),(0,f.jsx)(es.A,{className:"h-4 w-4 text-blue-600 flex-shrink-0"})]})]})]}),(0,f.jsxs)(Oe,{id:"briefing",accent:"violet",children:[(0,f.jsx)(Le,{icon:Wr.A,accent:"violet",right:!P&&(0,f.jsxs)("button",{onClick:ce,className:"flex items-center gap-1 text-violet-600 hover:text-violet-700 text-sm font-semibold print:hidden self-center",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]}),children:"Briefing Notes"}),P?(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsx)("textarea",{value:L,onChange:e=>M(e.target.value),className:"w-full px-3 py-2 border border-slate-200 rounded-lg text-sm focus:ring-2 focus:ring-violet-600 focus:border-violet-600 outline-none",rows:5,placeholder:"Add any special briefing notes for the crew\u2026"}),(0,f.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,f.jsx)("button",{onClick:de,disabled:q,className:"px-4 py-2 text-sm text-slate-600 hover:text-slate-800",children:"Cancel"}),(0,f.jsxs)("button",{onClick:me,disabled:q,className:"flex items-center gap-1.5 px-4 py-2 bg-gradient-to-r from-violet-500 to-purple-600 hover:from-violet-600 hover:to-purple-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:q?"Saving\u2026":"Save"})]})]})]}):A.special_briefing_notes?(0,f.jsx)("div",{className:"bg-gradient-to-br from-violet-50 to-purple-50 rounded-2xl p-4 ring-1 ring-violet-200 border-l-4 border-violet-500",children:(0,f.jsx)("p",{className:"text-sm text-slate-700 whitespace-pre-wrap leading-relaxed",children:A.special_briefing_notes})}):(0,f.jsx)("p",{className:"text-sm text-slate-400 italic",children:"No briefing notes added yet."})]}),(ae()&&_||ne()&&z)&&(0,f.jsxs)(Oe,{id:"imagery-standards",accent:"cyan",children:[(0,f.jsxs)("button",{onClick:()=>ke(e=>!e),className:"w-full flex items-center justify-between gap-3",children:[(0,f.jsx)(Le,{icon:Jr.A,accent:"cyan",children:"Imagery Standards"}),Ae?(0,f.jsx)(Tt.A,{className:"h-5 w-5 text-slate-400 -mt-2"}):(0,f.jsx)(Et.A,{className:"h-5 w-5 text-slate-400 -mt-2"})]}),Ae&&(0,f.jsxs)("div",{className:"space-y-6 mt-2",children:[ae()&&_&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("div",{className:"w-7 h-7 rounded-lg bg-gradient-to-br from-cyan-500 to-sky-600 flex items-center justify-center",children:(0,f.jsx)(Ue.A,{className:"h-3.5 w-3.5 text-white"})}),(0,f.jsx)("p",{className:"text-sm font-bold text-slate-900",children:"Photography"})]}),(0,f.jsx)("div",{className:"border-l-4 border-cyan-300 pl-4 prose prose-sm max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-slate-700",dangerouslySetInnerHTML:{__html:or.default.sanitize(_)}})]}),ne()&&z&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("div",{className:"w-7 h-7 rounded-lg bg-gradient-to-br from-cyan-500 to-sky-600 flex items-center justify-center",children:(0,f.jsx)(Ge.A,{className:"h-3.5 w-3.5 text-white"})}),(0,f.jsx)("p",{className:"text-sm font-bold text-slate-900",children:"Videography"})]}),(0,f.jsx)("div",{className:"border-l-4 border-cyan-300 pl-4 prose prose-sm max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-slate-700",dangerouslySetInnerHTML:{__html:or.default.sanitize(z)}})]})]})]}),(A.show_crew_upload_instructions||A.show_generic_upload_instructions||A.masv_portal_url)&&(0,f.jsxs)(Oe,{id:"upload",accent:"amber",children:[(0,f.jsx)(Le,{icon:_s.A,accent:"amber",children:"Upload"}),A.masv_portal_url?(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsx)("p",{className:"text-sm text-slate-600",children:"Upload your RAW video and photo files directly from your browser \u2014 no software installation required."}),(0,f.jsxs)("a",{href:A.masv_portal_url,target:"_blank",rel:"noopener noreferrer",className:"relative overflow-hidden flex items-center justify-center gap-2.5 bg-gradient-to-br from-amber-500 to-orange-600 hover:from-amber-600 hover:to-orange-700 text-white p-4 rounded-2xl transition-all text-base font-bold min-h-[60
1px] shadow-md hover:shadow-lg",children:[(0,f.jsx)(_s.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{children:"Upload Files"})]}),A.masv_job_code&&(0,f.jsxs)("p",{className:"text-sm text-slate-700 bg-amber-50 rounded-xl p-3 ring-1 ring-amber-200",children:[(0,f.jsx)("span",{className:"font-bold",children:"Job Code:"})," ",(0,f.jsx)("span",{className:"font-mono",children:A.masv_job_code})]})]}):(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsx)("p",{className:"text-sm text-slate-600",children:"Download and install the Turbo Crew Upload software:"}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-arm64.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-amber-50 to-orange-50 hover:from-amber-100 hover:to-orange-100 rounded-2xl p-3.5 ring-1 ring-amber-200 transition-all min-h-[60px]",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900 text-sm",children:"Crew Upload (Apple Silicon)"}),(0,f.jsx)("p",{className:"text-xs text-slate-500",children:"M1, M2, M3, M4"})]}),(0,f.jsx)(es.A,{className:"h-4 w-4 text-amber-600 flex-shrink-0"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-amber-50 to-orange-50 hover:from-amber-100 hover:to-orange-100 rounded-2xl p-3.5 ring-1 ring-amber-200 transition-all min-h-[60px]",children:[(0,f.jsx)("div",{children:(0,f.jsx)("p",{className:"font-semibold text-slate-900 text-sm",children:"Crew Upload (Intel Mac)"})}),(0,f.jsx)(es.A,{className:"h-4 w-4 text-amber-600 flex-shrink-0"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-Setup.exe",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-amber-50 to-orange-50 hover:from-amber-100 hover:to-orange-100 rounded-2xl p-3.5 ring-1 ring-amber-200 transition-all min-h-[60px]",children:[(0,f.jsx)("div",{children:(0,f.jsx)("p",{className:"font-semibold text-slate-900 text-sm",children:"Crew Upload (Windows)"})}),(0,f.jsx)(es.A,{className:"h-4 w-4 text-amber-600 flex-shrink-0"})]})]}),(0,f.jsxs)("p",{className:"text-sm text-slate-700 bg-amber-50 rounded-xl p-3 ring-1 ring-amber-200",children:[(0,f.jsx)("span",{className:"font-bold",children:"Upload password:"})," ",(0,f.jsx)("span",{className:"font-mono",children:"tcrew26"})]})]})]}),(0,f.jsxs)("section",{className:"text-center py-8",children:[(0,f.jsx)("p",{className:"text-xs uppercase tracking-[0.2em] text-slate-500 font-extrabold mb-3",children:"Emergency Contact"}),(0,f.jsxs)("a",{href:"tel:1300207446",className:"inline-flex items-center gap-3 px-6 py-3 rounded-2xl bg-gradient-to-r from-slate-900 to-slate-700 hover:from-slate-800 hover:to-slate-600 text-white text-xl font-extrabold tabular-nums shadow-md transition-all",children:[(0,f.jsx)(E.A,{className:"h-5 w-5"}),"1300 207 446"]}),(0,f.jsxs)("p",{className:"text-xs text-slate-400 mt-4",children:["\xa9 ",(new Date).getFullYear()," Turbo 360 \xb7 [email protected]"]})]})]}),(0,f.jsx)("nav",{className:"lg:hidden fixed bottom-0 inset-x-0 bg-white/95 backdrop-blur-md border-t border-slate-200 z-40 print:hidden shadow-lg",children:(0,f.jsx)("div",{className:"max-w-3xl mx-auto grid",style:{gridTemplateColumns:"repeat(".concat(We.length,", minmax(0, 1fr))")},children:We.map(e=>{const t=e.icon,s=B===e.id;return(0,f.jsxs)("button",{onClick:()=>re(e.id),className:"flex flex-col items-center justify-center pt-2 pb-[max(0.5rem,env(safe-area-inset-bottom))] min-h-[58px] transition-all relative ".concat(s?Lo[e.accent]:"text-slate-500"),children:[(0,f.jsx)("div",{className:"w-10 h-7 rounded-full flex items-center justify-center transition-all ".concat(s?"bg-gradient-to-r ".concat(Wo[e.accent]," text-white shadow-md"):""),children:(0,f.jsx)(t,{className:"h-4 w-4"})}),(0,f.jsx)("span",{className:"text-[10px] mt-0.5 ".concat(s?"font-bold":"font-semibold"),children:e.label})]},e.id)})})})]})},qo=e=>{var t,s,a,n,r,i,o,l,c,d,x;const{eventId:h,event:u,showShareNotification:b,isGeneratingPDF:y,photographyStandards:v,videographyStandards:j,activeSection:w,showMobileNav:N,setShowMobileNav:A,editingContact:k,editingBriefing:S,contactFormData:_,setContactFormData:F,briefingFormData:z,setBriefingFormData:B,isSaving:D,saveNotification:I,checklistCompletions:R,priorityStandCompletions:P,timedEventCompletions:W,showMessageModal:O,setShowMessageModal:L,crewMessage:M,setCrew
1Message:q,isSendingMessage:H,handleShare:U,handleDownloadPDF:G,formatDate:V,formatTime:J,groupEventsByTimeSlot:Y,shouldShowPhotographyStandards:K,shouldShowVideographyStandards:Z,scrollToSection:$,startEditingContact:Q,cancelEditingContact:X,saveContactChanges:ee,startEditingBriefing:te,cancelEditingBriefing:se,saveBriefingChanges:ae,toggleChecklistItem:ne,togglePriorityStand:re,toggleTimedEvent:ie,sendCrewMessage:oe,downloadDocument:le,navItems:ce,toggleVoxpopItem:de,voxpopVideographers:me=[],availableRoles:pe,activeRole:xe,setActiveRole:he,handleDownloadAllRoles:ue}=e;return(0,f.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,f.jsx)("div",{className:"bg-white border-b border-gray-200 sticky top-0 z-50 print:hidden",children:(0,f.jsx)("div",{className:"max-w-3xl mx-auto px-4 py-3",children:(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("div",{className:"flex items-center space-x-3",children:(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-6 bg-gray-900 rounded px-1.5 py-0.5"})}),(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsxs)("button",{onClick:U,className:"flex items-center space-x-1 px-3 py-1.5 text-gray-600 hover:text-red-600 text-sm font-medium transition-colors",children:[(0,f.jsx)(at.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"Share"})]}),(0,f.jsxs)("button",{onClick:G,disabled:y,className:"flex items-center space-x-1 px-3 py-1.5 bg-red-600 hover:bg-red-700 text-white rounded text-sm font-medium transition-colors disabled:opacity-50",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:y?"Generating...":"PDF"})]})]})]})})}),(0,f.jsx)("div",{className:"bg-white border-b border-gray-200 sticky top-[53px] z-40 print:hidden",children:(0,f.jsx)("div",{className:"max-w-3xl mx-auto px-4",children:(0,f.jsxs)("div",{className:"flex overflow-x-auto scrollbar-hide -mb-px py-2 space-x-1",children:[ce.map(e=>(0,f.jsx)("button",{onClick:()=>$(e.id),className:"flex-shrink-0 px-3 py-1.5 rounded-full text-xs font-medium tracking-wide transition-colors ".concat(w===e.id?"bg-red-600 text-white":"text-gray-500 hover:text-gray-900 hover:bg-gray-100"),children:e.label},e.id)),!1]})})}),b&&(0,f.jsxs)("div",{className:"fixed top-20 right-4 bg-gray-900 text-white px-4 py-2 rounded shadow-lg z-50 flex items-center space-x-2 print:hidden text-sm",children:[(0,f.jsx)(p.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Link copied!"})]}),I&&(0,f.jsxs)("div",{className:"fixed top-20 right-4 px-4 py-2 rounded shadow-lg z-50 flex items-center space-x-2 print:hidden text-sm ".concat("success"===I.type?"bg-gray-900":"bg-red-600"," text-white"),children:["success"===I.type?(0,f.jsx)(p.A,{className:"h-4 w-4"}):(0,f.jsx)(g.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:I.message})]}),O&&(0,f.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 print:hidden",onClick:()=>L(!1),children:(0,f.jsxs)("div",{className:"bg-white shadow-xl w-full max-w-md mx-4 p-6",onClick:e=>e.stopPropagation(),children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("h3",{className:"text-sm font-medium text-gray-900 uppercase tracking-widest flex items-center space-x-2",children:[(0,f.jsx)(Fn.A,{className:"h-4 w-4 text-red-600"}),(0,f.jsx)("span",{children:"Message Crew"})]}),(0,f.jsx)("button",{onClick:()=>L(!1),className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsx)("textarea",{value:M,onChange:e=>q(e.target.value),placeholder:"Type your message to the crew...",className:"w-full border border-gray-200 px-3 py-2 text-sm focus:ring-1 focus:ring-red-600 focus:border-red-600 outline-none resize-none",rows:4,maxLength:500,autoFocus:!0}),(0,f.jsxs)("p",{className:"text-xs text-gray-400 mt-1 mb-4",children:[M.length,"/500 characters"]}),(0,f.jsxs)("p",{className:"text-xs text-gray-500 mb-4",children:["This will send a push notification and chat message to all ",null===(t=u.crew_members)||void 0===t?void 0:t.length," crew member(s)."]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,f.jsx)("button",{onClick:()=>L(!1),className:"px-4 py-2 text-sm text-gray-500 hover:text-gray-700",children:"Cancel"}),(0,f.jsx)("button",{onClick:oe,disabled:!M.trim()||H,className:"px-4 py-2 text-sm bg-red-600 text-white hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-2",children:H?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),(0,f.jsx)("span",{children:"Sending..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Send"})]})})]})]})}),(0,f.jsx)(Do,{availableRoles:pe,activeRole:xe,setActiveRole:he,activeRunsheet:e.activeRunsheet}),(0,f.jsx)(Yi,{availableRoles:pe,activeRole:xe,setActiveRole:he}),(0,f.jsx)("div",{className:"max-w-3xl mx-auto px-4 py-12",children:(0,f.jsxs)("div",{id:"runsheet-content",className:"space-y-0",children:[(0,f.jsxs)("section",{id:"overview",className:"pb-10 border-b border-gray-200",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-4 mb-6",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-8 bg-gray-900 rounded px-2 py-1 object-contain"}),u.company_logo_url&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"h-6 w-px bg-gray-300"}),(0,f.jsx)("img",{src:u.company_logo_url,alt:"Company Logo",className:"h-8 object-contain",onError:e=>{e.target.style.display="none"}})]})]}),(0,f.jsx)("h1",{className:"text-3xl sm:text-4xl font-light text-gray-900 mb-4 leading-tight",children:u.event_name}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2 text-sm text-gray-600",children:[(0,f.jsxs)("span",{className:"flex items-center space-x-1.5",children:[(0,f.jsx)(Ke.A,{className:"h-4 w-4 text-gray-400"}),(0,f.jsx)("span",{children:u.client_company})]}),(0,f.jsxs)("span",{className:"flex items-center space-x-1.5",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-gray-400"}),(0,f.jsx)("span",{children:u.venue})]}),"single"===u.event_duration_type&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("span",{className:"flex items-center space-x-1.5",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4 text-gray-400"}),(0,f.jsx)("span",{children:V(u.event_date)})]}),(0,f.jsxs)("span",{className:"flex items-center space-x-1.5",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4 text-gray-400"}),(0,f.jsxs)("span",{children:[J(u.start_time)||"TBC"," \u2014 ",J(u.end_time)||"TBC",u.event_timezone&&"Australia/Melbourne"!==u.event_timezone?" ".concat((0,zo.iU)(u.event_timezone)):""]})]})]})]}),u.event_website&&(0,f.jsxs)("a",{href:u.event_website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center space-x-1.5 mt-4 text-sm text-red-600 hover:text-red-700 font-medium transition-colors",children:[(0,f.jsx)(En.A,{className:"h-3.5 w-3.5"}),(0,f.jsx)("span",{children:"Event Website"})]}),"multi"===u.event_duration_type&&(null===(s=u.event_days)||void 0===s?void 0:s.length)>0&&(0,f.jsxs)("div",{className:"mt-8 space-y-3",children:[(0,f.jsxs)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest mb-4",children:["Schedule \u2014 ",u.event_days.length," Days"]}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:u.event_days.map((e,t)=>{var s,a,n;const r=(null===(s=u.crew_members)||void 0===s?void 0:s.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];return(0,f.jsxs)("div",{className:"bg-white p-4 border-b border-gray-200",children:[(0,f.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,f.jsxs)("span",{className:"text-xs font-medium text-red-600 uppercase tracking-widest",children:["Day ",t+1]})}),(0,f.jsx)("p",{className:"font-medium text-gray-900 text-sm",children:new Date(e.date).toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short"})}),(0,f.jsxs)("p",{className:"text-gray-500 text-sm mt-0.5",children:[J(e.start_time)," \u2014 ",J(e.end_time)]}),(e.location||u.venue)&&(0,f.jsxs)("p",{className:"text-gray-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(C.A,{className:"h-3 w-3 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:e.location||u.venue})]}),(r.length>0||(null===(a=e.client_contacts)||void 0===a?void 0:a.length)>0)&&(0,f.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-100 space-y-1",children:[r.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-600",children:[(0,f.jsx)(Xe.A,{className:"h-3 w-3 text-gray-400 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-medium",children:e.name}),(0,f.jsxs)("span",{className:"text-gray-400",children:["(",Pn(e.role),")"]})]},e.id)),null===(n=e.client_contacts)||void 0===n?void 0:n.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-600",children:[(0,f.jsx)(Ye.A,{className:"h-3 w-3 text-green-500 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-medium",children:e.name}),e.role&&(0,f.jsxs)("span",{className:"text-gray-400",children:["(",e.role,")"]})]},e.id))]})]},e.id)})})]})]}),(null===(a=u.deliverables)||void 0===a?void 0:a.length)>0&&(0,f.jsxs)("section",{id:"deliverables",className:"py-10 border-b border-gray-200",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest mb-6",children:"Deliverables"}),(0,f.jsx)("ul",{className:"space-y-4",children:u.deliverables.map(e=>(0,f.jsxs)("li",{children:[(0,f.jsx)("p",{className:"text-base font-medium text-gray-900 leading-snug",children:e.name}),e.description&&(0,f.jsx)("p",{className:"text-sm text-gray-500 leading-relaxed mt-1",children:e.description})]},e.id))})]}),("single"===u.event_duration_type&&(null===(n=u.timed_events)||void 0===n?void 0:n.length)>0||"multi"===u.event_duration_type&&(null===(r=u.event_days)||void 0===r?void 0:r.length)>0)&&(0,f.jsxs)("section",{id:"timeline",className:"py-10 border-b border-gray-200",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest mb-6",children:"Timeline"}),"single"===u.event_duration_type?(0,f.jsx)("div",{className:"space-y-2",children:Y(u.timed_events).map(e=>
1(0,f.jsx)("div",{children:e.hasStreams?(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-20 text-right pt-2",children:(0,f.jsx)("span",{className:"text-sm font-medium ".concat(e.events.every(e=>W[e.id]||e.completed)?"text-green-600":"text-gray-900"),children:J(e.time)})}),(0,f.jsx)("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-2",children:e.events.map(e=>{const t=W[e.id]||e.completed;return(0,f.jsxs)("div",{onClick:()=>ie(e.id),className:"p-3 border-l-2 cursor-pointer transition-colors ".concat(t?"border-green-500 bg-green-50/50":"border-gray-200 hover:bg-gray-50"),children:[e.stream&&(0,f.jsx)("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest",children:e.stream}),(0,f.jsxs)("div",{className:"flex items-start gap-3 mt-1",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded-sm border flex items-center justify-center transition-colors ".concat(t?"bg-green-600 border-green-600":"border-gray-300 hover:border-red-500"),children:t&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm ".concat(t?"text-gray-400 line-through":"text-gray-900"),children:e.description}),e.notes&&(0,f.jsx)("p",{className:"text-gray-500 text-xs mt-1 italic whitespace-pre-line",children:e.notes}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),t&&e.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1",children:["Completed by ",e.completed_by]})]})]})]},e.id)})})]}):e.events.map(e=>{const t=W[e.id]||e.completed;return(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-20 text-right",children:(0,f.jsx)("span",{className:"text-sm font-medium ".concat(t?"text-green-600":"text-gray-900"),children:J(e.time)})}),(0,f.jsx)("div",{onClick:()=>ie(e.id),className:"flex-1 p-3 border-l-2 cursor-pointer transition-colors ".concat(t?"border-green-500 bg-green-50/50":"border-gray-200 hover:bg-gray-50"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded-sm border flex items-center justify-center transition-colors ".concat(t?"bg-green-600 border-green-600":"border-gray-300 hover:border-red-500"),children:t&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm ".concat(t?"text-gray-400 line-through":"text-gray-900"),children:e.description}),e.notes&&(0,f.jsx)("p",{className:"text-gray-500 text-xs mt-1 italic whitespace-pre-line",children:e.notes}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),t&&e.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1",children:["Completed by ",e.completed_by]})]})]})})]},e.id)})},e.time))}):(0,f.jsx)("div",{className:"space-y-10",children:u.event_days.map((e,t)=>{var s,a,n,r;const i=(null===(s=u.crew_members)||void 0===s?void 0:s.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];return(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsxs)("p",{className:"text-xs font-medium text-red-600 uppercase tracking-widest mb-1",children:["Day ",t+1]}),(0,f.jsx)("p",{className:"text-gray-900 font-medium",children:V(e.date)}),(0,f.jsxs)("p",{className:"text-gray-500 text-sm",children:[J(e.start_time)," \u2014 ",J(e.end_time)]}),(e.location||u.venue)&&(0,f.jsxs)("p",{className:"text-gray-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(C.A,{className:"h-3 w-3"}),e.location||u.venue]}),(i.length>0||(null===(a=e.client_contacts)||void 0===a?void 0:a.length)>0)&&(0,f.jsxs)("div",{className:"flex flex-wrap gap-3 mt-2",children:[i.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,f.jsx)(Xe.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{className:"font-medium text-gray-700",children:e.name}),(0,f.jsxs)("span",{children:["(",Pn(e.role),")"]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat(e.mobile),className:"text-red-600 hover:text-red-700",children:e.mobile})]},e.id)),null===(n=e.client_contacts)||void 0===n?void 0:n.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,f.jsx)(Ye.A,{className:"h-3 w-3 text-green-500"}),(0,f.jsx)("span",{className:"font-medium text-gray-700",children:e.name}),e.role&&(0,f.jsxs)("span",{children:["(",e.role,")"]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat(e.mobile),className:"text-green-600 hover:text-green-700",children:e.mobile})]},e.id))]})]}),(null===(r=e.timed_events)||void 0===r?void 0:r.length)>0&&(0,f.jsx)("div",{className:"space-y-2",children:Y(e.timed_events).map(t=>
1(0,f.jsx)("div",{children:t.hasStreams?(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-16 text-right pt-2",children:(0,f.jsx)("span",{className:"text-sm font-medium ".concat(t.events.every(e=>W[e.id]||e.completed)?"text-green-600":"text-gray-900"),children:J(t.time)})}),(0,f.jsx)("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-2",children:t.events.map(t=>{const s=W[t.id]||t.completed;return(0,f.jsxs)("div",{onClick:()=>ie(t.id,e.id),className:"p-3 border-l-2 cursor-pointer transition-colors ".concat(s?"border-green-500 bg-green-50/50":"border-gray-200 hover:bg-gray-50"),children:[t.stream&&(0,f.jsx)("span",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest",children:t.stream}),(0,f.jsxs)("div",{className:"flex items-start gap-3 mt-1",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded-sm border flex items-center justify-center transition-colors ".concat(s?"bg-green-600 border-green-600":"border-gray-300 hover:border-red-500"),children:s&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm ".concat(s?"text-gray-400 line-through":"text-gray-900"),children:t.description}),t.notes&&(0,f.jsx)("p",{className:"text-gray-500 text-xs mt-1 italic whitespace-pre-line",children:t.notes}),t.location&&(0,f.jsx)(Io,{location:t.location,size:"xs"}),s&&t.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1",children:["Completed by ",t.completed_by]})]})]})]},t.id)})})]}):t.events.map(t=>{const s=W[t.id]||t.completed;return(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-16 text-right",children:(0,f.jsx)("span",{className:"text-sm font-medium ".concat(s?"text-green-600":"text-gray-900"),children:J(t.time)})}),(0,f.jsx)("div",{onClick:()=>ie(t.id,e.id),className:"flex-1 p-3 border-l-2 cursor-pointer transition-colors ".concat(s?"border-green-500 bg-green-50/50":"border-gray-200 hover:bg-gray-50"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded-sm border flex items-center justify-center transition-colors ".concat(s?"bg-green-600 border-green-600":"border-gray-300 hover:border-red-500"),children:s&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm ".concat(s?"text-gray-400 line-through":"text-gray-900"),children:t.description}),t.notes&&(0,f.jsx)("p",{className:"text-gray-500 text-xs mt-1 italic whitespace-pre-line",children:t.notes}),t.location&&(0,f.jsx)(Io,{location:t.location,size:"xs"}),s&&t.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1",children:["Completed by ",t.completed_by]})]})]})})]},t.id)})},t.time))})]},e.id)})})]}),(null===(i=u.voxpops)||void 0===i?void 0:i.enabled)&&(e=>{const t=Pi(u.voxpops),s=t.length>1;return(0,f.jsxs)("section",{id:"voxpops",className:"py-10 border-b border-gray-200",children:[(0,f.jsxs)("div",{className:"flex items-baseline gap-2 flex-wrap mb-2",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-emerald-500 uppercase tracking-widest",children:"Voxpops"}),me.length>0&&(0,f.jsxs)("p",{className:"text-xs text-emerald-600",children:["\u2014 Filmed by ",me.map(e=>e.name).join(", ")]})]}),(0,f.jsx)("p",{className:"text-sm text-gray-600 mb-6 max-w-2xl",children:"Turbo 360 crew will focus on sound and visual quality. Client to arrange the talent and ask the questions."}),(0,f.jsx)("div",{className:"space-y-6 mb-6",children:t.map((e,t)=>(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[s?(0,f.jsxs)("p",{className:"text-xs font-medium uppercase tracking-widest ".concat(e.completed?"text-emerald-400/70 line-through":"text-emerald-600"),children:["Subject ",t+1]}):(0,f.jsx)("span",{}),de&&e.id&&(0,f.jsxs)("button",{type:"button",onClick:()=>de(e.id),className:"inline-flex items-center gap-1.5 text-xs uppercase tracking-widest rounded-full px-3 py-1 border transition-colors ".concat(e.completed?"bg-emerald-600 text-white border-emerald-600":"bg-white text-emerald-600 border-emerald-200 hover:bg-emerald-50"),children:[(0,f.jsx)(p.A,{className:"h-3.5 w-3.5"}),e.completed?"Captured":"Mark captured"]})]}),(0,f.jsxs)("div",{className:"grid sm:grid-cols-3 gap-6 ".concat(e.completed?"opacity-60":""),children:[e.time&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1",children:"Time"}),(0,f.jsx)("p",{className:"text-gray-900 font-medium",children:J(e.time)})]}),e.contact_name&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1",children:"Contact"}),(0,f.jsx)("p",{className:"text-gray-900 font-medium",children:e.contact_name})]}),e.meeting_point&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1",children:"Meeting Point"}),(0,f.jsx)("p",{className:"text-gray-900 font-medium",children:e.meeting_point})]})]})]},e.id||t))}),(null===(e=u.voxpops.questions)||void 0===e?void 0:e.length)>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-400 uppercase tracking-widest mb-3",children:"Suggested Questions"}),(0,f.jsx)("ol",{className:"space-y-2",children:u.voxpops.questions.filter(e=>e).map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start space-x-3 py-2 border-b border-gray-100 last:border-0",children:[(0,f.jsxs)("span",{className:"text-emerald-500 font-medium text-sm",children:[t+1,"."]}),(0,f.jsx)("span",{className:"text-gray-700",children:e})]},t))})]})]})})(),(null===(o=u.crew_members)||void 0===o?void 0:o.length)>0&&(0,f.jsxs)("section",{id:"crew",className:"py-10 border-b border-gray-200",children:[(0,f.jsxs)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest mb-6",children:["Crew (",u.crew_members.length,")"]}),(0,f.jsx)("div",{className:"grid sm:grid-cols-2 gap-x-8 gap-y-4",children:u.crew_members.map(e=>(0,f.jsxs)("div",{className:"py-3 border-b border-gray-100 last:border-0",children:[(0,f.jsx)("p",{className:"font-medium text-gray-900",children:e.name}),(0,f.jsx)("p",{className:"text-xs text-red-600 uppercase tracking-widest mt-0.5",children:Pn(e.role)}),(e.start_time||e.end_time)&&(0,f.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5 flex items-center gap-1 font-mono",children:[(0,f.jsx)(Nt.A,{className:"h-3 w-3"}),e.start_time||u.start_time||"09:00"," \u2013 ",e.end_time||u.end_time||"17:00"]}),(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center space-x-1.5 text-sm text-gray-500 hover:text-red-600 transition-colors mt-1",children:[(0,f.jsx)(E.A,{className:"h-3.5 w-3.5"}),(0,f.jsx)("span",{children:e.mobile})]})]},e.id))})]}),(0,f.jsxs)("section",{id:"contact",className:"py-10 border-b border-gray-200",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,f.jsxs)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest",children:["Client Contact",(null===(l=u.client_contacts)||void 0===l?void 0:l.length)>1?"s":""]}),!k&&!(null!==(c=u.client_contacts)&&void 0!==c&&c.length)&&(0,f.jsxs)("button",{onClick:Q,className:"flex items-center space-x-1 text-red-600 hover:text-red-700 text-sm font-medium transition-colors print:hidden",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]})]}),(null===(d=u.client_contacts)||void 0===d?void 0:d.length)>0?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,f.jsx)(Ke.A,{className:"h-4 w-4 text-gray-400"}),(0,f.jsx)("span",{className:"font-medium text-gray-900",children:u.client_company})]}),(0,f.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:u.client_contacts.map(e=>(0,f.jsxs)("div",{className:"p-4 border-b border-gray-200 ".concat(e.is_primary?"bg-white":""),children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-900",children:e.name}),e.role&&(0,f.jsx)("span",{className:"text-xs text-gray-500 uppercase tracking-widest",children:e.role})]}),e.is_primary&&(0,f.jsx)("span",{className:"text-xs text-red-600 font-medium uppercase tracking-widest",children:"Primary"})]}),(0,f.jsxs)("div",{className:"space-y-1 mt-3",children:[e.email&&(0,f.jsxs)("a",{href:"mailto:".concat(e.email),className:"flex items-center gap-2 text-sm text-gray-600 hover:text-red-600",children:[(0,f.jsx)(T.A,{className:"h-3.5 w-3.5"}),e.email]}),e.mobile&&(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center gap-2 text-sm text-gray-600 hover:text-red-600",children:[(0,f.jsx)(E.A,{className:"h-3.5 w-3.5"}),e.mobile]})]})]},e.id))}),u.additional_notes&&(0,f.jsxs)("div",{className:"pt-4",children:[(0,f.jsx)("p",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1",children:"Additional Notes"}),(0,f.jsx)("p",{className:"text-gray-700 text-sm",children:u.additional_notes})]})]}):k?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1 block",children:"Name"}),(0,f.jsx)("input",{type:"text",value:_.primary_contact,onChange:e=>F(t=>(0,m.A)((0,m.A)({},t),{},{primary_contact:e.target.value})),className:"w-full px-3 py-2 border border-gray-200 bg-white text-gray-900 focus:ring-1 focus:ring-red-600 focus:border-red-600 outline-none text-sm",placeholder:"Primary contact name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1 block",children:"Company"}),(0,f.jsx)("input",{type:"text",value:u.client_company,disabled:!0,className:"w-full px-3 py-2 border border-gray-100 bg-gray-50 text-gray-400 text-sm"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1 block",children:"Email"}),(0,f.jsx)("input",{type:"email",value:_.email,onChange:e=>F(t=>(0,m.A)((0,m.A)({},t),{},{email:e.target.value})),className:"w-full px-3 py-2 border border-gray-200 bg-white text-gray-900 focus:ring-1 focus:ring-red-600 focus:border-red-600 outline-none text-sm",placeholder:"[email protected]"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1 block",children:"Mobile"}),(0,f.jsx)("input",{type:"tel",value:_.mobile,onChange:e=>F(t=>(0,m.A)((0,m.A)({},t),{},{mobile:e.target.value})),className:"w-full px-3 py-2 border border-gray-200 bg-white text-gray-900 focus:ring-1 focus:ring-red-600 focus:border-red-600 outline-none text-sm",placeholder:"Mobile number"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1 block",children:"Additional Notes"}),(0,f.jsx)("textarea",{value:_.additional_notes,onChange:e=>F(t=>(0,m.A)((0,m.A)({},t),{},{additional_notes:e.target.value})),className:"w-full px-3 py-2 border border-gray-200 bg-white text-gray-900 focus:ring-1 focus:ring-red-600 focus:border-red-600 outline-none text-sm",rows:"2",placeholder:"Any additional notes..."})]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-2 pt-2",children:[(0,f.jsx)("button",{onClick:X,disabled:D,className:"px-4 py-2 text-gray-500 hover:text-gray-700 text-sm font-medium transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:ee,disabled:D,className:"flex items-center space-x-1 px-4 py-2 bg-red-600 hover:bg-red-700 text-white text-sm font-medium transition-colors disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:D?"Saving...":"Save"})]})]})]}):(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1",children:"Name"}),(0,f.jsx)("p",{className:"font-medium text-gray-900",children:u.primary_contact||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1",children:"Company"}),(0,f.jsx)("p",{className:"font-medium text-gray-900",children:u.client_company})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1",children:"Email"}),(0,f.jsx)("a",{href:"mailto:".concat(u.email),className:"text-sm text-gray-600 hover:text-red-600",children:u.email||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1",children:"Mobile"}),(0,f.jsx)("a",{href:"tel:".concat(u.mobile),className:"text-sm text-gray-600 hover:text-red-600",children:u.mobile||"\u2014"})]}),u.additional_notes&&(0,f.jsxs)("div",{className:"sm:col-span-2 pt-4 border-t border-gray-100",children:[(0,f.jsx)("p",{className:"text-xs text-gray-400 uppercase tracking-widest mb-1",children:"Additional Notes"}),(0,f.jsx)("p",{className:"text-gray-700 text-sm",children:u.additional_notes})]})]})]}),(u.supporting_documents&&u.supporting_documents.length>0||u.client_brief_file)&&(0,f.jsxs)("section",{id:"documents",className:"py-10 border-b border-gray-200",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest mb-6",children:"Supporting Documents"}),(0,f.jsxs)("div",{className:"space-y-2",children:[null===(x=u.supporting_documents)||void 0===x?void 0:x.map((e,t)=>e.external_url?(0,f.jsxs)("a",{href:e.external_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-white p-4 border-b border-gray-100 hover:bg-gray-50 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 min-w-0",children:[(0,f.jsx)(En.A,{className:"h-5 w-5 text-indigo-500 flex-shrink-0"}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("p",{className:"font-medium text-gray-900 text-sm truncate",children:e.title||e.external_url}),(0,f.jsx)("p",{className:"text-xs text-gray-400 truncate",children:e.external_url})]})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-1 text-indigo-600 text-sm font-medium transition-colors flex-shrink-0 ml-3",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Open"})]})]},e.link_id||t):(0,f.jsxs)("div",{className:"flex items-center justify-between bg-white p-4 border-b border-gray-100",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)(kt.A,{className:"h-5 w-5 text-gray-400"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-900 text-sm",children:e.original_filename||"Document"}),(0,f.jsx)("p",{className:"text-xs text-gray-400",children:e.file_size?"".concat((e.file_size/1024/1024).toFixed(2)," MB"):""})]})]}),(0,f.jsxs)("button",{onClick:()=>le(e),className:"flex items-center space-x-1 text-red-600 hover:text-red-700 text-sm font-medium transition-colors",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]},e.file_key||t)),u.client_brief_file&&(!u.supporting_documents||0===u.supporting_documents.length)&&(0,f.jsxs)("div",{className:"flex items-center justify-between bg-white p-4 border-b border-gray-100",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)(kt.A,{className:"h-5 w-5 text-gray-400"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-900 text-sm",children:u.client_brief_file.original_filename||"Document"}),(0,f.jsx)("p",{className:"text-xs text-gray-400",children:u.client_brief_file.file_size?"".concat((u.client_brief_file.file_size/1024/1024).toFixed(2)," MB"):""})]})]}),(0,f.jsxs)("button",{onClick:()=>le(u.client_brief_file),className:"flex items-center space-x-1 text-red-600 hover:text-red-700 text-sm font-medium transition-colors",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]})]})]}),(0,f.jsxs)("section",{id:"briefing",className:"py-10 border-b border-gray-200",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,f.jsx)("p",
1{className:"text-xs font-medium text-gray-400 uppercase tracking-widest",children:"Special Briefing Notes"}),!S&&(0,f.jsxs)("button",{onClick:te,className:"flex items-center space-x-1 text-red-600 hover:text-red-700 text-sm font-medium transition-colors print:hidden",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]})]}),S?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("textarea",{value:z,onChange:e=>B(e.target.value),className:"w-full px-3 py-2 border border-gray-200 bg-white text-gray-900 focus:ring-1 focus:ring-red-600 focus:border-red-600 outline-none text-sm",rows:"5",placeholder:"Add any special briefing notes for the crew..."}),(0,f.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,f.jsx)("button",{onClick:se,disabled:D,className:"px-4 py-2 text-gray-500 hover:text-gray-700 text-sm font-medium transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:ae,disabled:D,className:"flex items-center space-x-1 px-4 py-2 bg-red-600 hover:bg-red-700 text-white text-sm font-medium transition-colors disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:D?"Saving...":"Save"})]})]})]}):(0,f.jsx)("div",{className:"border-l-2 border-gray-200 pl-4",children:u.special_briefing_notes?(0,f.jsx)("p",{className:"text-gray-700 text-sm whitespace-pre-wrap",children:u.special_briefing_notes}):(0,f.jsx)("p",{className:"text-gray-400 text-sm italic",children:"No briefing notes added yet. Click 'Edit' to add notes."})})]}),(K()&&v||Z()&&j)&&(0,f.jsxs)("section",{id:"imagery-standards",className:"py-10 border-b border-gray-200",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest mb-6",children:"Imagery Standards"}),(0,f.jsxs)("div",{className:"space-y-8",children:[K()&&v&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,f.jsx)(Ue.A,{className:"h-4 w-4 text-gray-400"}),(0,f.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Photography Standards"})]}),(0,f.jsx)("div",{className:"border-l-2 border-gray-200 pl-4 prose prose-sm max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-gray-700",dangerouslySetInnerHTML:{__html:or.default.sanitize(v)}})]}),Z()&&j&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,f.jsx)(Ge.A,{className:"h-4 w-4 text-gray-400"}),(0,f.jsx)("p",{className:"text-sm font-medium text-gray-900",children:"Videography Standards"})]}),(0,f.jsx)("div",{className:"border-l-2 border-gray-200 pl-4 prose prose-sm max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-gray-700",dangerouslySetInnerHTML:{__html:or.default.sanitize(j)}})]})]})]}),u.must_capture_checklist&&u.must_capture_checklist.length>0&&(0,f.jsxs)("section",{id:"checklist",className:"py-10 border-b border-gray-200",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest",children:"Must-Capture Checklist"}),(0,f.jsxs)("span",{className:"text-xs font-medium text-gray-500",children:[Object.values(R).filter(Boolean).length," / ",u.must_capture_checklist.length]})]}),(0,f.jsx)("p",{className:"text-xs text-gray-400 mb-4",children:"Click items as you complete them. Progress is saved automatically."}),(0,f.jsx)("div",{className:"space-y-1",children:u.must_capture_checklist.sort((e,t)=>e.order-t.order).map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 border-b border-gray-100 cursor-pointer hover:bg-white transition-colors",children:[(0,f.jsx)("input",{type:"checkbox",checked:R[e.id]||!1,onChange:()=>ne(e.id),className:"w-4 h-4 text-red-600 border border-gray-300 rounded-sm focus:ring-1 focus:ring-red-600"}),(0,f.jsx)("span",{className:"flex-1 text-sm ".concat(R[e.id]?"line-through text-gray-400":"text-gray-900"," transition-all"),children:e.text})]},e.id))})]}),u.priority_sponsor_stands&&u.priority_sponsor_stands.length>0&&(0,f.jsxs)("section",{id:"sponsor-stands",className:"py-10 border-b border-gray-200",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest",children:"Priority Sponsor Stands"}),(0,f.jsxs)("span",{className:"text-xs font-medium text-gray-500",children:[Object.values(P).filter(
1Boolean).length," / ",u.priority_sponsor_stands.length]})]}),(0,f.jsx)("p",{className:"text-xs text-gray-400 mb-4",children:"Please ensure you capture at least one strong shot at each of the following stands with clear branding and visible attendee engagement."}),(0,f.jsx)("div",{className:"space-y-1",children:u.priority_sponsor_stands.sort((e,t)=>e.order-t.order).map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 border-b border-gray-100 cursor-pointer hover:bg-white transition-colors",children:[(0,f.jsx)("input",{type:"checkbox",checked:P[e.id]||!1,onChange:()=>re(e.id),className:"w-4 h-4 text-rose-600 border border-gray-300 rounded-sm focus:ring-1 focus:ring-rose-600"}),(0,f.jsx)("span",{className:"flex-1 text-sm ".concat(P[e.id]?"line-through text-gray-400":"text-gray-900"," transition-all"),children:e.text})]},e.id))})]}),(u.show_crew_upload_instructions||u.show_generic_upload_instructions||u.masv_portal_url)&&(0,f.jsxs)("section",{id:"upload",className:"py-10 border-b border-gray-200",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest mb-6",children:"Crew Upload Instructions"}),u.masv_portal_url?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("p",{className:"text-gray-700 text-sm",children:"Upload your RAW video and photo files directly from your browser \u2014 no software installation required."}),(0,f.jsxs)("a",{href:u.masv_portal_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-3 bg-gray-900 hover:bg-gray-800 text-white p-5 transition-colors text-center",children:[(0,f.jsx)(_s.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"font-medium text-lg",children:"Upload Files"})]}),u.masv_job_code&&(0,f.jsx)("div",{className:"border-l-2 border-gray-200 pl-4",children:(0,f.jsxs)("p",{className:"text-gray-700 text-sm",children:[(0,f.jsx)("span",{className:"font-medium",children:"Job Code:"})," ",u.masv_job_code]})})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"text-gray-700 text-sm mb-6",children:"Download and install the Turbo Crew Upload software:"}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-arm64.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-white p-4 border-b border-gray-100 hover:bg-gray-50 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-6 w-6 text-gray-900",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-900 text-sm",children:"Crew Upload (Apple Silicon).dmg"}),(0,f.jsx)("p",{className:"text-xs text-gray-400",children:"For Apple Silicon Macs (M1, M2, M3, M4)"})]})]}),(0,f.jsx)(es.A,{className:"h-4 w-4 text-red-600"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-white p-4 border-b border-gray-100 hover:bg-gray-50 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-6 w-6 text-gray-900",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-900 text-sm",children:"Crew Upload (Intel).dmg"}),(0,f.jsx)("p",{className:"text-xs text-gray-400",children:"For Intel Macs"})]})]}),(0,f.jsx)(es.A,{className:"h-4 w-4 text-red-600"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-Setup.exe",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-white p-4 border-b border-gray-100 hover:bg-gray-50 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-6 w-6 text-gray-900",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,f.jsx)("path",{d:"M3 12V6.75l6-1.32v6.48L3 12zm17-9v8.75l-10 .15V5.21L20 3zM3 13l6 .09v6.81l-6-1.15V13zm17 .25V22l-10-1.91V13.1l10 .15z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-900 text-sm",children:"Crew Upload Setup.exe"}),(0,f.jsx)("p",{className:"text-xs text-gray-400",children:"For Windows"})]})]}),(0,f.jsx)(es.A,{className:"h-4 w-4 text-red-600"})]})]}),(0,f.jsx)("div",{className:"mt-4 border-l-2 border-gray-200 pl-4",children:(0,f.jsxs)("p",{className:"text-gray-700 text-sm",children:[(0,f.jsx)("span",{className:"font-medium",children:"Upload Password:"})," tcrew26"]})})]})]}),(0,f.jsxs)("section",{className:"py-10 text-center",children:[(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-widest mb-3",children:"Emergency Contact"}),(0,f.jsxs)("div",{className:"flex items-center justify-center space-x-2",children:[(0,f.jsx)(E.A,{className:"h-5 w-5 text-gray-900"}),(0,f.jsx)("p",{className:"text-2xl font-light text-gray-900",children:"1300 207 446"})]})]}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-2 text-xs text-gray-400",children:[(0,f.jsxs)("span",{children:["\xa9 ",(new Date).getFullYear()," Turbo 360"]}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"\xb7"}),(0,f.jsx)("span",{children:"[email protected]"})]})]})]})})]})},Ho=e=>{var t,s,a,n,r,i,o,l,c,d,x,h;const{eventId:u,event:b,showShareNotification:y,isGeneratingPDF:v,photographyStandards:j,videographyStandards:w,activeSection:N,showMobileNav:A,setShowMobileNav:k,editingContact:S,editingBriefing:_,contactFormData:F,setContactFormData:z,briefingFormData:B,setBriefingFormData:D,isSaving:I,saveNotification:R,checklistCompletions:P,priorityStandCompletions:W,timedEventCompletions:O,showMessageModal:L,setShowMessageModal:M,crewMessage:q,setCrewMessage:H,isSendingMessage:U,handleShare:G,handleDownloadPDF:V,formatDate:J,formatTime:Y,groupEventsByTimeSlot:K,shouldShowPhotographyStandards:Z,shouldShowVideographyStandards:$,scrollToSection:Q,startEditingContact:X,cancelEditingContact:ee,saveContactChanges:te,startEditingBriefing:se,cancelEditingBriefing:ae,saveBriefingChanges:ne,toggleChecklistItem:re,togglePriorityStand:ie,toggleTimedEvent:oe,sendCrewMessage:le,downloadDocument:ce,navItems:de,toggleVoxpopItem:me,voxpopVideographers:pe=[],availableRoles:xe,activeRole:he,setActiveRole:ue,handleDownloadAllRoles:ge}=e;const fe=(null===(t=b.deliverables)||void 0===t?void 0:t.length)>0,be="single"===b.event_duration_type&&(null===(s=b.timed_events)||void 0===s?void 0:s.length)>0||"multi"===b.event_duration_type&&(null===(a=b.event_days)||void 0===a?void 0:a.length)>0,ye=(null===(n=b.crew_members)||void 0===n?void 0:n.length)>0,ve=b.supporting_documents&&b.supporting_documents.length>0||b.client_brief_file,je=Z()&&j||$()&&w,we=b.must_capture_checklist&&b.must_capture_checklist.length>0,Ne=b.priority_sponsor_stands&&b.priority_sponsor_stands.length>0,Ae=b.show_crew_upload_instructions||b.show_generic_upload_instructions||b.masv_portal_url;let ke=1;const Se=fe?String(++ke).padStart(2,"0"):null,_e=be?String(++ke).padStart(2,"0"):null,Ce=ye?String(++ke).padStart(2,"0"):null,Fe=String(++ke).padStart(2,"0"),Ee=ve?String(++ke).padStart(2,"0"):null,Te=String(++ke).padStart(2,"0"),ze=je?String(++ke).padStart(2,"0"):null,Be=we?String(++ke).padStart(2,"0"):null,De=Ne?String(++ke).padStart(2,"0"):null,Ie=Ae?String(++ke).padStart(2,"0"):null,Re=e=>{let{number:t,icon:s,title:a,dark:n,extra:r}=e;return(0,f.jsxs)("div",{className:"flex items-center justify-between mb-8 ".concat(""),children:[(0,f.jsxs)("div",{className:"flex items-center gap-4",children:[(0,f.jsx)("span",{className:"text-5xl font-black ".concat(n?"text-white/10":"text-slate-900/10"),children:t}),(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)(s,{className:"h-6 w-6 ".concat(n?"text-red-400":"text-red-600")}),(0,f.jsx)("h2",{className:"text-2xl font-black uppercase tracking-wide ".concat(n?"text-white":"text-slate-900"),children:a})]})]}),r]})};return(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsx)("div",{className:"bg-slate-900 border-b border-slate-700 sticky top-0 z-50 print:hidden",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 py-3",children:(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-8"}),(0,f.jsx)("div",{className:"hidden sm:block",children:(0,f.jsx)("h1",{className:"text-sm font-bold text-white truncate max-w-xs",children:b.event_name})})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)("button",{onClick:()=>k(!A),className:"lg:hidden p-2 text-slate-400 hover:bg-slate-800 rounded-lg",children:(0,f.jsx)(cs.A,{className:"h-5 w-5"})}),(0,f.jsxs)("button",{onClick:G,className:"flex items-center space-x-1 px-3 py-2 bg-slate-800 hover:bg-slate-700 text-white rounded-lg text-sm font-bold transition-colors border border-slate-600",children:[(0,f.jsx)(at.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"Share"})]}),(0,f.jsxs)("button",{onClick:V,disabled:v,className:"flex items-center space-x-1 px-3 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg text-sm font-bold transition-colors disabled:opacity-50",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:v?"Generating...":"PDF"})]})]})]})})}),(0,f.jsx)(Do,{availableRoles:xe,activeRole:he,setActiveRole:ue,activeRunsheet:e.activeRunsheet}),(0,f.jsx)(Yi,{availableRoles:xe,activeRole:he,setActiveRole:ue}),A&&(0,f.jsx)("div",{className:"lg:hidden fixed inset-0 z-40 bg-black/70",onClick:()=>k(!1),children:(0,f.jsx)("div",{className:"absolute top-16 left-4 right-4 bg-slate-800 rounded-xl shadow-2xl p-4 border border-slate-700",onClick:e=>e.stopPropagation(),children:(0,f.jsxs)("nav",{className:"space-y-1",children:[de.map(e=>(0,f.jsxs)("button",{onClick:()=>Q(e.id),className:"w-full flex items-center space-x-3 px-4 py-3 rounded-lg text-left transition-colors ".concat(N===e.id?"bg-red-600 text-white":"text-slate-300 hover:bg-slate-700"),
1children:[(0,f.jsx)(e.icon,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"font-bold",children:e.label})]},e.id)),!1]})})}),y&&(0,f.jsxs)("div",{className:"fixed top-20 right-4 bg-green-600 text-white px-4 py-2 rounded-lg shadow-lg z-50 flex items-center space-x-2 print:hidden text-sm font-bold",children:[(0,f.jsx)(p.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Link copied!"})]}),R&&(0,f.jsxs)("div",{className:"fixed top-20 right-4 px-4 py-2 rounded-lg shadow-lg z-50 flex items-center space-x-2 print:hidden text-sm font-bold ".concat("success"===R.type?"bg-green-600":"bg-red-600"," text-white"),children:["success"===R.type?(0,f.jsx)(p.A,{className:"h-4 w-4"}):(0,f.jsx)(g.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:R.message})]}),L&&(0,f.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 print:hidden",onClick:()=>M(!1),children:(0,f.jsxs)("div",{className:"bg-slate-800 rounded-xl shadow-2xl w-full max-w-md mx-4 p-6 border border-slate-700",onClick:e=>e.stopPropagation(),children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("h3",{className:"text-lg font-black text-white flex items-center space-x-2",children:[(0,f.jsx)(Fn.A,{className:"h-5 w-5 text-red-500"}),(0,f.jsx)("span",{children:"Message Crew"})]}),(0,f.jsx)("button",{onClick:()=>M(!1),className:"text-slate-400 hover:text-white",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsx)("textarea",{value:q,onChange:e=>H(e.target.value),placeholder:"Type your message to the crew...",className:"w-full border border-slate-600 rounded-lg px-3 py-2 text-sm bg-slate-900 text-white placeholder-slate-500 focus:ring-2 focus:ring-red-500 focus:border-red-500 outline-none resize-none",rows:4,maxLength:500,autoFocus:!0}),(0,f.jsxs)("p",{className:"text-xs text-slate-500 mt-1 mb-4",children:[q.length,"/500 characters"]}),(0,f.jsxs)("p",{className:"text-xs text-slate-400 mb-4",children:["This will send a push notification and chat message to all ",null===(r=b.crew_members)||void 0===r?void 0:r.length," crew member(s)."]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,f.jsx)("button",{onClick:()=>M(!1),className:"px-4 py-2 text-sm text-slate-400 hover:text-white",children:"Cancel"}),(0,f.jsx)("button",{onClick:le,disabled:!q.trim()||U,className:"px-4 py-2 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-2 font-bold",children:U?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),(0,f.jsx)("span",{children:"Sending..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Send"})]})})]})]})}),(0,f.jsx)("div",{className:"lg:hidden fixed bottom-0 left-0 right-0 z-40 bg-slate-900/95 backdrop-blur-sm border-t border-slate-700 print:hidden",children:(0,f.jsxs)("div",{className:"flex items-center justify-around py-2 px-2",children:[de.slice(0,5).map(e=>(0,f.jsxs)("button",{onClick:()=>Q(e.id),className:"flex flex-col items-center p-2 rounded-lg transition-colors ".concat(N===e.id?"text-red-500":"text-slate-500 hover:text-slate-300"),children:[(0,f.jsx)(e.icon,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"text-[10px] mt-0.5 font-bold",children:e.label.split(" ")[0]})]},e.id)),de.length>5&&(0,f.jsxs)("button",{onClick:()=>k(!0),className:"flex flex-col items-center p-2 rounded-lg text-slate-500 hover:text-slate-300 transition-colors",children:[(0,f.jsx)(cs.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"text-[10px] mt-0.5 font-bold",children:"More"})]})]})}),(0,f.jsxs)("div",{id:"runsheet-content",children:[(0,f.jsxs)("section",{id:"overview",className:"min-h-screen flex flex-col justify-center relative overflow-hidden",children:[(0,f.jsx)("div",{className:"absolute inset-0 opacity-5",style:{backgroundImage:"radial-gradient(circle at 1px 1px, white 1px, transparent 0)",backgroundSize:"40px 40px"}}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-b from-slate-900 via-slate-900/95 to-slate-900"}),(0,f.jsxs)("div",{className:"relative z-10 px-6 sm:px-8 lg:px-16 py-16 max-w-7xl mx-auto w-full",children:[(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4 mb-12",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-14 object-contain self-start"}),b.company_logo_url&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"hidden sm:block h-10 w-px bg-white/20"}),(0,f.jsx)("img",{src:b.company_logo_url,alt:"Company Logo",className:"h-14 object-contain self-start",onError:e=>{e.target.style.display="none"}})]})]}),(0,f.jsxs)("div",{className:"mb-8",children:[(0,f.jsx)("div",{className:"inline-block bg-red-600 px-4 py-1 mb-4",children:(0,f.jsx)("span",{className:"text-white text-sm font-black uppercase tracking-widest",children:"Production Runsheet"})}),(0,f.jsx)("h1",{className:"text-4xl sm:text-5xl lg:text-6xl font-black text-white leading-tight mb-6",children:b.event_name}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 bg-white/10 backdrop-blur-sm rounded px-4 py-2 text-white",children:[(0,f.jsx)(Ke.A,{className:"h-5 w-5 text-red-400"}),(0,f.jsx)("span",{className:"font-bold text-lg",children:b.client_company})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2 bg-white/10 backdrop-blur-sm rounded px-4 py-2 text-white",children:[(0,f.jsx)(C.A,{className:"h-5 w-5 text-red-400"}),(0,f.jsx)("span",{className:"font-bold text-lg",children:b.venue})]})]}),b.event_website&&(0,f.jsxs)("a",{href:b.event_website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center space-x-2 mt-6 px-5 py-3 bg-red-600 hover:bg-red-700 rounded text-white font-bold transition-colors",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"View Event Website"})]})]}),(0,f.jsx)("div",{className:"mt-12 border-t border-white/10 pt-8",children:"single"===b.event_duration_type?(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,f.jsxs)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-400 text-sm font-black uppercase tracking-wider mb-3",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Date"})]}),(0,f.jsx)("p",{className:"text-white font-black text-xl",children:J(b.event_date)})]}),(0,f.jsxs)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-400 text-sm font-black uppercase tracking-wider mb-3",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Start"})]}),(0,f.jsxs)("p",{className:"text-white font-black text-3xl",children:[Y(b.start_time)||"TBC",b.event_timezone&&"Australia/Melbourne"!==b.event_timezone&&(0,f.jsx)("span",{className:"text-base text-slate-400 ml-1",children:(0,zo.iU)(b.event_timezone)})]})]}),(0,f.jsxs)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-400 text-sm font-black uppercase tracking-wider mb-3",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"End"})]}),(0,f.jsxs)("p",{className:"text-white font-black text-3xl",children:[Y(b.end_time)||"TBC",b.event_timezone&&"Australia/Melbourne"!==b.event_timezone&&(0,f.jsx)("span",{className:"text-base text-slate-400 ml-1",children:(0,zo.iU)(b.event_timezone)})]})]})]}):(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-400 font-black mb-6 text-lg uppercase tracking-wider",children:[(0,f.jsx)(_t.A,{className:"h-5 w-5"}),(0,f.jsxs)("span",{children:["Multi-Day Event: ",(null===(i=b.event_days)||void 0===i?void 0:i.length)||0," Days"]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:null===(o=b.event_days)||void 0===o?void 0:o.map((e,t)=>{var s,a,n;const r=(null===(s=b.crew_members)||void 0===s?void 0:s.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];return(0,f.jsxs)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-5 flex flex-col",children:[(0,f.jsx)("div",{className:"flex items-center justify-between mb-3",children:(0,f.jsxs)("span",{className:"text-xs font-black text-white bg-red-600 px-3 py-1 rounded",children:["DAY ",t+1]})}),(0,f.jsx)("p",{className:"font-black text-white text-lg",children:new Date(e.date).toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short"})}),(0,f.jsxs)("p",{className:"text-red-400 font-bold text-sm mt-1",children:[Y(e.start_time)," - ",Y(e.end_time)]}),(e.location||b.venue)&&(0,f.jsxs)("p",{className:"text-slate-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(C.A,{className:"h-3 w-3 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:e.location||b.venue})]}),(r.length>0||(null===(a=e.client_contacts)||void 0===a?void 0:a.length)>0)&&(0,f.jsx)("div",{className:"mt-3 pt-3 border-t border-white/10 flex-1",children:(0,f.jsxs)("div",{className:"space-y-1",children:[r.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,f.jsx)(Xe.A,{className:"h-3 w-3 text-red-400 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-bold text-white truncate",children:e.name}),(0,f.jsxs)("span",{className:"text-slate-500",children:["(",Pn(e.role),")"]})]},e.id)),null===(n=e.client_contacts)||void 0===n?void 0:n.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,f.jsx)(Ye.A,{className:"h-3 w-3 text-green-400 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-bold text-white truncate",children:e.name}),e.role&&(0,f.jsxs)("span",{className:"text-slate-500",children:["(",e.role,")"]})]},e.id))]})})]},e.id)})})]})}),(0,f.jsxs)("div",{className:"mt-8 text-sm text-slate-500",children:["Generated ",(new Date).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"})]})]})]}),fe&&(0,f.jsx)("section",{id:"deliverables",className:"bg-slate-900 text-white py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(Re,{number:Se,icon:as.A,title:"Deliverables",dar
1k:!0}),(0,f.jsx)("ul",{className:"space-y-4",children:b.deliverables.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start gap-4 border-l-4 border-amber-500 bg-white/5 hover:bg-white/10 transition-colors p-4 rounded-r-lg",children:[(0,f.jsx)("span",{className:"flex-shrink-0 text-2xl font-black text-amber-400 leading-none w-10",children:String(t+1).padStart(2,"0")}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"text-lg font-bold leading-snug",children:e.name}),e.description&&(0,f.jsx)("p",{className:"text-sm text-white/70 leading-relaxed mt-1",children:e.description})]})]},e.id))})]})}),be&&(0,f.jsx)("section",{id:"timeline",className:"bg-white py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(Re,{number:_e,icon:Nt.A,title:"Event Timeline",dark:!1}),"single"===b.event_duration_type?(0,f.jsx)("div",{className:"space-y-3",children:K(b.timed_events).map(e=>(0,f.jsx)("div",{children:e.hasStreams?(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-24 text-right pt-3",children:(0,f.jsx)("span",{className:"inline-block px-3 py-2 rounded text-sm font-black ".concat(e.events.every(e=>O[e.id]||e.completed)?"bg-green-600 text-white":"bg-slate-900 text-white"),children:Y(e.time)})}),(0,f.jsx)("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-3",children:e.events.map(e=>{const t=O[e.id]||e.completed;return(0,f.jsxs)("div",{onClick:()=>oe(e.id),className:"rounded-lg p-4 border-l-4 cursor-pointer transition-all shadow-md ".concat(t?"bg-green-50 border-green-600 hover:bg-green-100":"bg-white border-red-600 hover:bg-slate-50"),children:[e.stream&&(0,f.jsx)("span",{className:"inline-block px-2 py-0.5 bg-indigo-100 text-indigo-700 text-xs font-black rounded mb-2 uppercase",children:e.stream}),(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-5 h-5 rounded border-2 flex items-center justify-center transition-colors ".concat(t?"bg-green-600 border-green-600":"border-slate-400 hover:border-green-500"),children:t&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"font-bold ".concat(t?"text-slate-400 line-through":"text-slate-900"),children:e.description}),e.notes&&(0,f.jsxs)("p",{className:"text-slate-500 text-sm mt-2 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),e.notes]}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),t&&e.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1 flex items-center gap-1 font-bold",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",e.completed_by]})]})]})]},e.id)})})]}):e.events.map(e=>{const t=O[e.id]||e.completed;return(0,f.jsxs)("div",{className:"flex items-start gap-4 group",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-24 text-right",children:(0,f.jsx)("span",{className:"inline-block px-3 py-2 rounded text-sm font-black ".concat(t?"bg-green-600 text-white":"bg-slate-900 text-white"),children:Y(e.time)})}),(0,f.jsx)("div",{onClick:()=>oe(e.id),className:"flex-1 rounded-lg p-4 border-l-4 cursor-pointer transition-all shadow-md ".concat(t?"bg-green-50 border-green-600 hover:bg-green-100":"bg-white border-red-600 group-hover:bg-slate-50"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-5 h-5 rounded border-2 flex items-center justify-center transition-colors ".concat(t?"bg-green-600 border-green-600":"border-slate-400 hover:border-green-500"),children:t&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"font-bold ".concat(t?"text-slate-400 line-through":"text-slate-900"),children:e.description}),e.notes&&(0,f.jsxs)("p",{className:"text-slate-500 text-sm mt-2 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),e.notes]}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),t&&e.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1 flex items-center gap-1 font-bold",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",e.completed_by]})]})]})})]},e.id)})}
1,e.time))}):(0,f.jsx)("div",{className:"space-y-10",children:b.event_days.map((e,t)=>{var s,a,n;const r=(null===(s=b.crew_members)||void 0===s?void 0:s.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];return(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"bg-slate-900 rounded-xl p-5 mb-4",children:(0,f.jsxs)("div",{className:"flex flex-col lg:flex-row lg:items-start lg:justify-between gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"text-xl font-black text-white",children:["Day ",t+1]}),(0,f.jsxs)("p",{className:"text-red-400 font-bold text-sm",children:[J(e.date)," \u2022 ",Y(e.start_time)," - ",Y(e.end_time)]}),(e.location||b.venue)&&(0,f.jsxs)("p",{className:"text-slate-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(C.A,{className:"h-3 w-3"}),e.location||b.venue]})]}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-2",children:[r.map(e=>(0,f.jsxs)("div",{className:"bg-white/10 rounded-lg px-3 py-2 border border-white/20",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Xe.A,{className:"h-4 w-4 text-red-400"}),(0,f.jsx)("span",{className:"font-bold text-white",children:e.name}),(0,f.jsx)("span",{className:"text-xs bg-red-600 text-white px-2 py-0.5 rounded-full uppercase font-black",children:Pn(e.role)})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat(e.mobile),className:"text-sm text-red-400 hover:text-red-300 font-bold mt-1 block",children:e.mobile})]},e.id)),null===(a=e.client_contacts)||void 0===a?void 0:a.map(e=>(0,f.jsxs)("div",{className:"bg-white/10 rounded-lg px-3 py-2 border border-green-500/30",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Ye.A,{className:"h-4 w-4 text-green-400"}),(0,f.jsx)("span",{className:"font-bold text-white",children:e.name}),e.role&&(0,f.jsx)("span",{className:"text-xs bg-green-600 text-white px-2 py-0.5 rounded-full uppercase font-black",children:e.role})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat(e.mobile),className:"text-sm text-green-400 hover:text-green-300 font-bold mt-1 block",children:e.mobile})]},e.id))]})]})}),(null===(n=e.timed_events)||void 0===n?void 0:n.length)>0&&(0,f.jsx)("div",{className:"space-y-3 ml-4",children:K(e.timed_events).map(t=>
1(0,f.jsx)("div",{children:t.hasStreams?(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-20 text-right pt-2",children:(0,f.jsx)("span",{className:"inline-block px-2 py-1 rounded text-sm font-black ".concat(t.events.every(e=>O[e.id]||e.completed)?"bg-green-600 text-white":"bg-slate-900 text-white"),children:Y(t.time)})}),(0,f.jsx)("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-3",children:t.events.map(t=>{const s=O[t.id]||t.completed;return(0,f.jsxs)("div",{onClick:()=>oe(t.id,e.id),className:"rounded-lg p-3 border-l-4 cursor-pointer transition-all shadow-md ".concat(s?"bg-green-50 border-green-600 hover:bg-green-100":"bg-white border-red-600 hover:bg-slate-50"),children:[t.stream&&(0,f.jsx)("span",{className:"inline-block px-2 py-0.5 bg-indigo-100 text-indigo-700 text-xs font-black rounded mb-2 uppercase",children:t.stream}),(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded border-2 flex items-center justify-center transition-colors ".concat(s?"bg-green-600 border-green-600":"border-slate-400 hover:border-green-500"),children:s&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm font-bold ".concat(s?"text-slate-400 line-through":"text-slate-900"),children:t.description}),t.notes&&(0,f.jsxs)("p",{className:"text-slate-500 text-xs mt-1 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),t.notes]}),t.location&&(0,f.jsx)(Io,{location:t.location,size:"xs"}),s&&t.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1 flex items-center gap-1 font-bold",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",t.completed_by]})]})]})]},t.id)})})]}):t.events.map(t=>{const s=O[t.id]||t.completed;return(0,f.jsxs)("div",{className:"flex items-start gap-4 group",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-20 text-right",children:(0,f.jsx)("span",{className:"inline-block px-2 py-1 rounded text-sm font-black ".concat(s?"bg-green-600 text-white":"bg-slate-900 text-white"),children:Y(t.time)})}),(0,f.jsx)("div",{onClick:()=>oe(t.id,e.id),className:"flex-1 rounded-lg p-3 border-l-4 cursor-pointer transition-all shadow-md ".concat(s?"bg-green-50 border-green-600 hover:bg-green-100":"bg-white border-red-600 hover:bg-slate-50"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded border-2 flex items-center justify-center transition-colors ".concat(s?"bg-green-600 border-green-600":"border-slate-400 hover:border-green-500"),children:s&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm font-bold ".concat(s?"text-slate-400 line-through":"text-slate-900"),children:t.description}),t.notes&&(0,f.jsxs)("p",{className:"text-slate-500 text-xs mt-1 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),t.notes]}),t.location&&(0,f.jsx)(Io,{location:t.location,size:"xs"}),s&&t.completed_by&&(0,f.jsxs)("p",{className:"text-green-600 text-xs mt-1 flex items-center gap-1 font-bold",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",t.completed_by]})]})]})})]},t.id)})},t.time))})]},e.id)})})]})}),(null===(l=b.voxpops)||void 0===l?void 0:l.enabled)&&(e=>{const t=Pi(b.voxpops),s=t.length>1;return(0,f.jsx)("section",{id:"voxpops",className:"bg-slate-950 py-16 px-6 sm:px-8 lg:px-16 border-t-4 border-emerald-500",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-3 flex-wrap",children:[(0,f.jsx)(Di.A,{className:"h-8 w-8 text-emerald-400"}),(0,f.jsx)("h2",{className:"text-3xl font-black text-white uppercase tracking-tight",children:"Voxpops"}),pe.length>0&&(0,f.jsxs)("span",{className:"text-base text-emerald-400 font-bold uppercase tracking-wider",children:["\u2014 Filmed by ",pe.map(e=>
1e.name).join(", ")]})]}),(0,f.jsx)("p",{className:"text-sm text-white/70 mb-8 max-w-3xl",children:"Turbo 360 crew will focus on sound and visual quality. Client to arrange the talent and ask the questions."}),(0,f.jsx)("div",{className:"space-y-8 mb-8",children:t.map((e,t)=>(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[s?(0,f.jsxs)("p",{className:"text-sm font-black uppercase tracking-wider ".concat(e.completed?"text-emerald-300/60 line-through":"text-emerald-400"),children:["Subject ",t+1]}):(0,f.jsx)("span",{}),me&&e.id&&(0,f.jsxs)("button",{type:"button",onClick:()=>me(e.id),className:"inline-flex items-center gap-1.5 text-xs font-black uppercase tracking-wider rounded-full px-3 py-1 border transition-colors ".concat(e.completed?"bg-emerald-500 text-slate-950 border-emerald-500":"bg-transparent text-emerald-400 border-emerald-500/50 hover:bg-emerald-500/10"),children:[(0,f.jsx)(p.A,{className:"h-3.5 w-3.5"}),e.completed?"Captured":"Mark captured"]})]}),(0,f.jsxs)("div",{className:"grid sm:grid-cols-3 gap-4 ".concat(e.completed?"opacity-60":""),children:[e.time&&(0,f.jsxs)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-5",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-400 font-black uppercase tracking-wider mb-2",children:"Time"}),(0,f.jsx)("p",{className:"text-white font-bold text-xl",children:Y(e.time)})]}),e.contact_name&&(0,f.jsxs)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-5",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-400 font-black uppercase tracking-wider mb-2",children:"Contact"}),(0,f.jsx)("p",{className:"text-white font-bold text-xl",children:e.contact_name})]}),e.meeting_point&&(0,f.jsxs)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-5",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-400 font-black uppercase tracking-wider mb-2",children:"Meeting Point"}),(0,f.jsx)("p",{className:"text-white font-bold text-xl",children:e.meeting_point})]})]})]},e.id||t))}),(null===(e=b.voxpops.questions)||void 0===e?void 0:e.length)>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm text-emerald-400 font-black uppercase tracking-wider mb-4",children:"Suggested Questions"}),(0,f.jsx)("div",{className:"space-y-3",children:b.voxpops.questions.filter(e=>e).map((e,t)=>(0,f.jsxs)("div",{className:"flex items-start space-x-4 bg-white/5 border border-white/10 rounded-lg p-4",children:[(0,f.jsx)("span",{className:"flex-shrink-0 w-8 h-8 bg-emerald-500/20 text-emerald-400 rounded-full flex items-center justify-center font-black",children:t+1}),(0,f.jsx)("span",{className:"text-slate-300 text-lg",children:e})]},t))})]})]})})})(),ye&&(0,f.jsx)("section",{id:"crew",className:"bg-slate-900 py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(Re,{number:Ce,icon:Xe.A,title:"Crew (".concat(b.crew_members.length,")"),dark:!0}),(0,f.jsx)("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:b.crew_members.map(e=>(0,f.jsxs)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-5 hover:bg-white/10 transition-colors border-l-4 border-l-red-600",children:[(0,f.jsxs)("div",{className:"mb-3",children:[(0,f.jsx)("p",{className:"font-black text-white text-lg",children:e.name}),(0,f.jsx)("p",{className:"text-sm text-red-400 font-black uppercase tracking-wider",children:Pn(e.role)}),(e.start_time||e.end_time)&&(0,f.jsxs)("p",{className:"text-xs text-slate-400 mt-1 flex items-center gap-1 font-mono tracking-wider",children:[(0,f.jsx)(Nt.A,{className:"h-3 w-3"}),e.start_time||b.start_time||"09:00"," \u2013 ",e.end_time||b.end_time||"17:00"]})]}),(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center space-x-2 text-slate-400 hover:text-red-400 transition-colors",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"font-bold",children:e.mobile})]})]},e.id))})]})}),(0,f.jsx)("section",{id:"contact",className:"bg-white py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(Re,{number:Fe,icon:Ye.A,title:"Client Contact".concat((null===(c=b.client_contacts)||void 0===c?void 0:c.length)>1?"s":""),dark:!1,extra:S||null!==(d=b.client_contacts)&&void 0!==d&&d.length?null:(0,f.jsxs)("button",{onClick:X,className:"flex items-center space-x-1 px-4 py-2 bg-slate-900 hover:bg-slate-800 text-white rounded-lg text-sm font-bold transition-colors print:hidden",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]})}),(null===(x=b.client_contacts)||void 0===x?void 0:x.length)>0?(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,f.jsx)(Ke.A,{className:"h-5 w-5 text-slate-400"}),(0,f.jsx)("span",{className:"font-black text-xl text-slate-900",children:b.client_company})]}),(0,f.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:b.client_contacts.map(e=>(0,f.jsxs)("div",{className:"rounded-lg p-5 border-l-4 shadow-md ".concat(e.is_primary?"bg-red-50 border-red-600":"bg-slate-50 border-slate-300"),children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-black text-slate-900 text-lg",children:e.name}),e.role&&(0,f.jsx)("span",{className:"inline-block text-xs px-2 py-0.5 rounded-full mt-1 font-bold ".concat(e.is_primary?"bg-red-100 text-red-700":"bg-slate-200 text-slate-600"),children:e.role})]}),e.is_primary&&(0,f.jsx)("span",{className:"text-xs bg-red-600 text-white px-3 py-1 rounded-full font-black uppercase",children:"Primary"})]}),(0,f.jsxs)("div",{className:"space-y-1 mt-3",children:[e.email&&(0,f.jsxs)("a",{href:"mailto:".concat(e.email),className:"flex items-center gap-2 text-sm text-red-600 hover:text-red-700 font-bold",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),e.email]}),e.mobile&&(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center gap-2 text-sm text-red-600 hover:text-red-700 font-bold",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),e.mobile]})]})]},e.id))}),b.additional_notes&&(0,f.jsxs)("div",{className:"pt-4 border-t border-slate-200",children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider font-black mb-1",children:"Additional Notes"}),(0,f.jsx)("p",{className:"text-slate-700",children:b.additional_notes})]})]}):S?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-slate-600 font-black mb-1 block uppercase tracking-wider",children:"Name"}),(0,f.jsx)("input",{type:"text",value:F.primary_contact,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{primary_contact:e.target.value})),className:"w-full px-3 py-2 border-2 border-slate-300 rounded-lg bg-white text-slate-900 focus:ring-2 focus:ring-red-500 focus:border-red-500 font-bold",placeholder:"Primary contact name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-slate-600 font-black mb-1 block uppercase tracking-wider",children:"Company"}),(0,f.jsx)("input",{type:"text",value:b.client_company,disabled:!0,className:"w-full px-3 py-2 border-2 border-slate-200 rounded-lg bg-slate-100 text-slate-500 font-bold"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-slate-600 font-black mb-1 block uppercase tracking-wider",children:"Email"}),(0,f.jsx)("input",{type:"email",value:F.email,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{email:e.target.value})),className:"w-full px-3 py-2 border-2 border-slate-300 rounded-lg bg-white text-slate-900 focus:ring-2 focus:ring-red-500 focus:border-red-500 font-bold",placeholder:"[email protected]"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-slate-600 font-black mb-1 block uppercase tracking-wider",children:"Mobile"}),(0,f.jsx)("input",{type:"tel",value:F.mobile,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{mobile:e.target.value})),className:"w-full px-3 py-2 border-2 border-slate-300 rounded-lg bg-white text-slate-900 focus:ring-2 focus:ring-red-500 focus:border-red-500 font-bold",placeholder:"Mobile number"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-slate-600 font-black mb-1 block uppercase tracking-wider",children:"Additional Notes"}),(0,f.jsx)("textarea",{value:F.additional_notes,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{additional_notes:e.target.value})),className:"w-full px-3 py-2 border-2 border-slate-300 rounded-lg bg-white text-slate-900 focus:ring-2 focus:ring-red-500 focus:border-red-500",rows:"2",placeholder:"Any additional notes..."})]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-2 pt-2",children:[(0,f.jsx)("button",{onClick:ee,disabled:I,className:"px-4 py-2 bg-slate-200 hover:bg-slate-300 text-slate-700 rounded-lg text-sm font-bold transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:te,disabled:I,className:"flex items-center space-x-1 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-bold transition-colors disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:I?"Saving...":"Save"})]})]})]}):(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider font-black mb-1",children:"Name"}),(0,f.jsx)("p",{className:"font-black text-slate-900 text-lg",children:b.primary_contact||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider font-black mb-1",children:"Company"}),(0,f.jsx)("p",{className:"font-black text-slate-900 text-lg",children:b.client_company})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider font-black mb-1",children:"Email"}),(0,f.jsx)("a",{href:"mailto:".concat(b.email),className:"font-bold text-red-600 hover:text-red-700 text-lg",children:b.email||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider font-black mb-1",children:"Mobile"}),(0,f.jsx)("a",{href:"tel:".concat(b.mobile),className:"font-bold text-red-600 hover:text-red-700 text-lg",children:b.mobile||"\u2014"})]}),b.additional_notes&&(0,f.jsxs)("div",{className:"sm:col-span-2 pt-4 border-t border-slate-200",children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 uppercase tracking-wider font-black mb-1",children:"Additional Notes"}),(0,f.jsx)("p",{className:"text-slate-700",children:b.additional_notes})]})]})]})}),ve&&(0,f.jsx)("section",{id:"documents",className:"bg-slate-900 py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(Re,{number:Ee,icon:kt.A,title:"Supporting Documents",dark:!0}),(0,f.jsxs)("div",{className:"space-y-3",children:[null===(h=b.supporting_documents)||void 0===h?void 0:h.map((e,t)=>e.external_url?(0,f.jsxs)("a",{href:e.external_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-white/5 border border-white/10 rounded-lg p-4 border-l-4 border-l-indigo-500 hover:bg-white/10 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 min-w-0",children:[(0,f.jsx)("div",{className:"bg-indigo-500 text-white rounded-lg p-2 flex-shrink-0",children:(0,f.jsx)(En.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("p",{className:"font-bold text-white truncate",children:e.title||e.external_url}),(0,f.jsx)("p",{className:"text-xs text-slate-400 truncate",children:e.external_url})]})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-1 px-4 py-2 bg-indigo-500 hover:bg-indigo-600 text-white rounded-lg text-sm font-bold transition-colors flex-shrink-0 ml-3",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Open"})]})]},e.link_id||t):(0,f.jsxs)("div",{className:"flex items-center justify-between bg-white/5 border border-white/10 rounded-lg p-4 border-l-4 border-l-red-600 hover:bg-white/10 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("div",{className:"bg-red-600 text-white rounded-lg p-2",children:(0,f.jsx)(kt.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-bold text-white",children:e.original_filename||"Document"}),(0,f.jsx)("p",{className:"text-xs text-slate-500",children:e.file_size?"".concat((e.file_size/1024/1024).toFixed(2)," MB"):""})]})]}),(0,f.jsxs)("button",{onClick:()=>ce(e),className:"flex items-center space-x-1 px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg text-sm font-bold transition-colors",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]},e.file_key||t)),b.client_brief_file&&(!b.supporting_documents||0===b.supporting_documents.length)&&(0,f.jsxs)("div",{className:"flex items-center justify-between bg-white/5 border border-white/10 rounded-lg p-4 border-l-4 border-l-red-600 hover:bg-white/10 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("div",{className:"bg-red-600 text-white rounded-lg p-2",children:(0,f.jsx)(kt.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-bold text-white",children:b.client_brief_file.original_filename||"Document"}),(0,f.jsx)("p",{className:"text-xs text-slate-500",children:b.client_brief_file.file_size?"".concat((b.client_brief_file.file_size/1024/1024).toFixed(2)," MB"):""})]})]}),(0,f.jsxs)("button",{onClick:()=>ce(b.client_brief_file),className:"flex items-center space-x-1 px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg text-sm font-bold transition-colors",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]})]})]})}),(0,f.jsx)("section",{id:"briefing",className:"bg-white py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(Re,{number:Te,icon:oa.A,title:"Special Briefing Notes",dar
1k:!1,extra:_?null:(0,f.jsxs)("button",{onClick:se,className:"flex items-center space-x-1 px-4 py-2 bg-slate-900 hover:bg-slate-800 text-white rounded-lg text-sm font-bold transition-colors print:hidden",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]})}),_?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("textarea",{value:B,onChange:e=>D(e.target.value),className:"w-full px-3 py-2 border-2 border-slate-300 rounded-lg bg-white text-slate-900 focus:ring-2 focus:ring-red-500 focus:border-red-500",rows:"5",placeholder:"Add any special briefing notes for the crew..."}),(0,f.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,f.jsx)("button",{onClick:ae,disabled:I,className:"px-4 py-2 bg-slate-200 hover:bg-slate-300 text-slate-700 rounded-lg text-sm font-bold transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:ne,disabled:I,className:"flex items-center space-x-1 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-bold transition-colors disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:I?"Saving...":"Save"})]})]})]}):(0,f.jsx)("div",{className:"bg-amber-50 rounded-lg p-6 border-l-4 border-red-600 shadow-md",children:b.special_briefing_notes?(0,f.jsx)("p",{className:"text-slate-800 whitespace-pre-wrap font-medium",children:b.special_briefing_notes}):(0,f.jsx)("p",{className:"text-slate-500 italic",children:"No briefing notes added yet. Click 'Edit' to add notes."})})]})}),je&&(0,f.jsx)("section",{id:"imagery-standards",className:"bg-slate-900 py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(Re,{number:ze,icon:Ue.A,title:"Imagery Standards",dark:!0}),(0,f.jsxs)("div",{className:"space-y-8",children:[Z()&&j&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"font-black text-white flex items-center space-x-2 mb-4 text-lg uppercase tracking-wider",children:[(0,f.jsx)(Ue.A,{className:"h-5 w-5 text-red-400"}),(0,f.jsx)("span",{children:"Photography Standards"})]}),(0,f.jsx)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-6 border-l-4 border-l-red-600 prose prose-sm max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-slate-300 prose-headings:text-white prose-strong:text-white",dangerouslySetInnerHTML:{__html:or.default.sanitize(j)}})]}),$()&&w&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"font-black text-white flex items-center space-x-2 mb-4 text-lg uppercase tracking-wider",children:[(0,f.jsx)(Ge.A,{className:"h-5 w-5 text-red-400"}),(0,f.jsx)("span",{children:"Videography Standards"})]}),(0,f.jsx)("div",{className:"bg-white/5 border border-white/10 rounded-lg p-6 border-l-4 border-l-red-600 prose prose-sm max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-slate-300 prose-headings:text-white prose-strong:text-white",dangerouslySetInnerHTML:{__html:or.default.sanitize(w)}})]})]})]})}),we&&(0,f.jsx)("section",{id:"checklist",className:"bg-white py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(Re,{number:Be,icon:p.A,title:"Must-Capture Checklist",dark:!1,extra:(0,f.jsxs)("span",{className:"text-sm font-black text-white bg-red-600 px-4 py-2 rounded-full",children:[Object.values(P).filter(Boolean).length," / ",b.must_capture_checklist.length]})}),(0,f.jsx)("p",{className:"text-sm text-slate-500 mb-6 font-bold",children:"Click items as you complete them. Progress is saved automatically."}),(0,f.jsx)("div",{className:"space-y-2",children:b.must_capture_checklist.sort((e,t)=>e.order-t.order).map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-4 bg-slate-50 rounded-lg border-l-4 border-red-600 hover:bg-red-50 cursor-pointer transition-all group shadow-sm",children:[(0,f.jsx)("input",{type:"checkbox",checked:P[e.id]||!1,onChange:()=>re(e.id),className:"w-5 h-5 text-red-600 border-2 border-red-300 rounded focus:ring-2 focus:ring-red-500"}),(0,f.jsx)("span",{className:"flex-1 font-bold ".concat(P[e.id]?"line-through text-slate-400":"text-slate-900"," transition-all"),children:e.text})]},e.id))})]})}),Ne&&(0,f.jsx)("section",{id:"sponsor-stands",className:"bg-rose-50 py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(Re,{number:De,icon:p.A,title:"Priority Sponsor Stands",dark:!1,extra:(0,f.jsxs)("span",{className:"text-sm font-black text-white bg-rose-600 px-4 py-2 rounded-full",children:[Object.values(W).filter(
1Boolean).length," / ",b.priority_sponsor_stands.length]})}),(0,f.jsx)("p",{className:"text-sm text-rose-700 mb-6 font-bold",children:"Please ensure you capture at least one strong shot at each of the following stands with clear branding and visible attendee engagement."}),(0,f.jsx)("div",{className:"space-y-2",children:b.priority_sponsor_stands.sort((e,t)=>e.order-t.order).map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-4 bg-white rounded-lg border-l-4 border-rose-600 hover:bg-rose-100 cursor-pointer transition-all group shadow-sm",children:[(0,f.jsx)("input",{type:"checkbox",checked:W[e.id]||!1,onChange:()=>ie(e.id),className:"w-5 h-5 text-rose-600 border-2 border-rose-300 rounded focus:ring-2 focus:ring-rose-500"}),(0,f.jsx)("span",{className:"flex-1 font-bold ".concat(W[e.id]?"line-through text-slate-400":"text-slate-900"," transition-all"),children:e.text})]},e.id))})]})}),Ae&&(0,f.jsx)("section",{id:"upload",className:"bg-slate-900 py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,f.jsx)(Re,{number:Ie,icon:_s.A,title:"Crew Upload Instructions",dark:!0}),b.masv_portal_url?(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsx)("p",{className:"text-slate-400 font-bold",children:"Upload your RAW video and photo files directly from your browser \u2014 no software installation required."}),(0,f.jsxs)("a",{href:b.masv_portal_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-4 bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-500 hover:to-indigo-500 text-white rounded-lg p-6 transition-colors border-l-4 border-l-red-600",children:[(0,f.jsx)(_s.A,{className:"h-8 w-8"}),(0,f.jsx)("span",{className:"font-black text-2xl",children:"Upload Files"})]}),b.masv_job_code&&(0,f.jsx)("div",{className:"bg-red-600/20 border border-red-600/40 rounded-lg p-4",children:(0,f.jsxs)("p",{className:"text-red-300 font-black",children:[(0,f.jsx)("span",{className:"uppercase tracking-wider",children:"Job Code:"})," ",b.masv_job_code]})})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"text-slate-400 mb-8 font-bold",children:"Download and install the Turbo Crew Upload software:"}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-arm64.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-white/5 border border-white/10 hover:bg-white/10 text-white rounded-lg p-5 transition-colors border-l-4 border-l-red-600",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsx)("svg",{className:"h-10 w-10 text-white",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-black text-lg",children:"Crew Upload (Apple Silicon).dmg"}),(0,f.jsx)("p",{className:"text-sm text-slate-400",children:"For Apple Silicon Macs (M1, M2, M3, M4)"})]})]}),(0,f.jsx)(es.A,{className:"h-6 w-6 text-red-400"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-white/5 border border-white/10 hover:bg-white/10 text-white rounded-lg p-5 transition-colors border-l-4 border-l-red-600",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsx)("svg",{className:"h-10 w-10 text-white",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-black text-lg",children:"Crew Upload (Intel).dmg"}),(0,f.jsx)("p",{className:"text-sm text-slate-400",children:"For Intel Macs"})]})]}),(0,f.jsx)(es.A,{className:"h-6 w-6 text-red-400"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-Setup.exe",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-white/5 border border-white/10 hover:bg-white/10 text-white rounded-lg p-5 transition-colors border-l-4 border-l-red-600",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsx)("svg",{className:"h-10 w-10 text-white",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,f.jsx)("path",{d:"M3 12V6.75l6-1.32v6.48L3 12zm17-9v8.75l-10 .15V5.21L20 3zM3 13l6 .09v6.81l-6-1.15V13zm17 .25V22l-10-1.91V13.1l10 .15z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-black text-lg",children:"Crew Upload Setup.exe"}),(0,f.jsx)("p",{className:"text-sm text-slate-400",children:"For Windows"})]})]}),(0,f.jsx)(es.A,{className:"h-6 w-6 text-red-400"})]})]}),(0,f.jsx)("div",{className:"mt-6 bg-red-600/20 border border-red-600/40 rounded-lg p-4",children:(0,f.jsxs)("p",{className:"text-red-300 font-black",children:[(0,f.jsx)("span",{className:"uppercase tracking-wider",children:"Upload Password:"})," tcrew26"]})})]})]})}),(0,f.jsx)("section",{className:"bg-red-600 py-16 px-6 sm:px-8 lg:px-16",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto text-center",children:[(0,f.jsx)("div",{className:"mb-6",children:(0,f.jsxs)("div",{className:"inline-flex items-center justify-center space-x-4 bg-white/20 rounded-xl p-6",children:[(0,f.jsx)(E.A,{className:"h-8 w-8 text-white"}),(0,f.jsxs)("div",{className:"text-left",children:[(0,f.jsx)("p",{className:"text-sm text-white/80 font-bold uppercase tracking-widest",children:"Emergency Contact"}),(0,f.jsx)("p",{className:"text-4xl font-black text-white",children:"1300 207 446"})]})]})}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-2 text-sm text-white/60 font-bold",children:[(0,f.jsxs)("span",{children:["\xa9 ",(new Date).getFullYear()," Turbo 360"]}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"\u2022"}),(0,f.jsx)("span",{children:"[email protected]"})]})]})})]}),(0,f.jsx)("div",{className:"lg:hidden h-16 print:hidden"})]})},Uo=e=>{var t,s,a,n,r,i,o,l,c,d,x,h;const{eventId:u,event:b,showShareNotification:y,isGeneratingPDF:v,photographyStandards:j,videographyStandards:w,activeSection:N,showMobileNav:A,setShowMobileNav:k,editingContact:S,editingBriefing:_,contactFormData:F,setContactFormData:z,briefingFormData:B,setBriefingFormData:D,isSaving:I,saveNotification:R,checklistCompletions:P,priorityStandCompletions:W,timedEventCompletions:O,showMessageModal:L,setShowMessageModal:M,crewMessage:q,setCrewMessage:H,isSendingMessage:U,handleShare:G,handleDownloadPDF:V,formatDate:J,formatTime:Y,groupEventsByTimeSlot:K,shouldShowPhotographyStandards:Z,shouldShowVideographyStandards:$,scrollToSection:Q,startEditingContact:X,cancelEditingContact:ee,saveContactChanges:te,startEditingBriefing:se,cancelEditingBriefing:ae,saveBriefingChanges:ne,toggleChecklistItem:re,togglePriorityStand:ie,toggleTimedEvent:oe,sendCrewMessage:le,downloadDocument:ce,navItems:de,toggleVoxpopItem:me,voxpopVideographers:pe=[],availableRoles:xe,activeRole:he,setActiveRole:ue,handleDownloadAllRoles:ge}=e,fe=e=>{let{icon:t,iconColor:s,children:a,rightContent:n}=e;return(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-stone-200 flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex items-center w-full",children:[(0,f.jsx)("div",{className:"hidden sm:block flex-1 h-px bg-stone-300"}),(0,f.jsxs)("h2",{className:"font-serif text-lg text-stone-800 flex items-center space-x-2 px-4 whitespace-nowrap",children:[(0,f.jsx)(t,{className:"h-5 w-5 ".concat(s)}),(0,f.jsx)("span",{children:a})]}),(0,f.jsx)("div",{className:"hidden sm:block flex-1 h-px bg-stone-300"})]}),n&&(0,f.jsx)("div",{className:"ml-4 flex-shrink-0",children:n})]})};return(0,f.jsxs)("div",{className:"min-h-screen bg-amber-50/30",children:[(0,f.jsx)("div",{className:"bg-white/90 backdrop-blur-sm border-b border-stone-200 sticky top-0 z-50 print:hidden",children:(0,f.jsx)("div",{className:"max-w-5xl mx-auto px-4 py-3",children:(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-8 bg-stone-900 rounded px-2 py-1"}),(0,f.jsx)("div",{className:"hidden sm:block",children:(0,f.jsx)("h1",{className:"text-sm font-serif text-stone-800 truncate max-w-xs",children:b.event_name})})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)("button",{onClick:()=>k(!A),className:"lg:hidden p-2 text-stone-600 hover:bg-stone-100 rounded-lg",children:(0,f.jsx)(cs.A,{className:"h-5 w-5"})}),(0,f.jsxs)("button",{onClick:G,className:"flex items-center space-x-1 px-3 py-2 bg-stone-100 hover:bg-stone-200 text-stone-700 rounded-lg text-sm transition-colors",children:[(0,f.jsx)(at.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"Share"})]}),(0,f.jsxs)("button",{onClick:V,disabled:v,className:"flex items-center space-x-1 px-3 py-2 bg-amber-700 hover:bg-amber-800 text-white rounded-lg text-sm transition-colors disabled:opacity-50",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:v?"Generating...":"PDF"})]})]})]})})}),(0,f.jsx)(Do,{availableRoles:xe,activeRole:he,setActiveRole:ue,activeRunsheet:e.activeRunsheet}),(0,f.jsx)(Yi,{availableRoles:xe,activeRole:he,setActiveRole:ue}),A&&(0,f.jsx)("div",{className:"lg:hidden fixed inset-0 z-40 bg-black/40",onClick:()=>k(!1),children:(0,f.jsx)("div",{className:"absolute top-16 left-4 right-4 bg-white rounded-lg shadow-xl border border-stone-200 p-4",onClick:e=>e.stopPropagation(),children:(0,f.jsxs)("nav",{className:"space-y-1",children:[de.map(e=>(0,f.jsxs)("button",{onClick:()=>Q(e.id),className:"w-full flex items-center space-x-3 px-4 py-3 rounded-lg text-left transition-colors ".concat(N===e.id?"bg-amber-50 text-amber-800":"text-stone-700 hover:bg-stone-50"),children:[(0,f.jsx)(e.icon,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"font-serif",children:e.label})]},e.id)),!1]})})}),y&&(0,f.jsxs)("div",{className:"fixed top-20 right-4 bg-green-700 text-white px-4 py-2 rounded-lg shadow-lg z-50 flex items-center space-x-2 print:hidden text-sm",children:[(0,f.jsx)(p.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Link copied!"})]}),R&&(0,f.jsxs)("div",{className:"fixed top-20 right-4 px-4 py-2 rounded-lg shadow-lg z-50 flex items-center space-x-2 print:hidden text-sm ".concat("success"===R.type?"bg-green-700":"bg-red-700"," text-white"),children:["success"===R.type?(0,f.jsx)(p.A,{className:"h-4 w-4"}):(0,f.jsx)(g.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:R.message})]}),L&&(0,f.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 print:hidden",onClick:()=>M(!1),children:(0,f.jsxs)("div",{className:"bg-white rounded-lg shadow-xl border border-stone-200 w-full max-w-md mx-4 p-6",onClick:e=>e.stopPropagation(),children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("h3",{className:"font-serif text-lg text-stone-800 flex items-center space-x-2",children:[(0,f.jsx)(Fn.A,{className:"h-5 w-5 text-amber-600"}),(0,f.jsx)("span",{children:"Message Crew"})]}),(0,f.jsx)("button",{onClick:()=>M(!1),className:"text-stone-400 hover:text-stone-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsx)("textarea",{value:q,onChange:e=>H(e.target.value),placeholder:"Type your message to the crew...",className:"w-full border border-stone-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-amber-500 focus:border-amber-500 outline-none resize-none",rows:4,maxLength:500,autoFocus:!0}),(0,f.jsxs)("p",{className:"text-xs text-stone-400 mt-1 mb-4",children:[q.length,"/500 characters"]}),(0,f.jsxs)("p",{className:"text-xs text-stone-500 mb-4",children:["This will send a push notification and chat message to all ",null===(t=b.crew_members)||void 0===t?void 0:t.length," crew member(s)."]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,f.jsx)("button",{onClick:()=>M(!1),className:"px-4 py-2 text-sm text-stone-600 hover:text-stone-800",children:"Cancel"}),(0,f.jsx)("button",{onClick:le,disabled:!q.trim()||U,className:"px-4 py-2 text-sm bg-amber-700 text-white rounded-lg hover:bg-amber-800 disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-2",children:U?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),(0,f.jsx)("span",{children:"Sending..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Send"})]})})]})]})}),(0,f.jsx)("div",{className:"max-w-5xl mx-auto px-4 py-8",children:(0,f.jsxs)("div",{className:"flex gap-6",children:[(0,f.jsx)("div",{className:"order-2 hidden lg:block w-48 flex-shrink-0",children:(0,f.jsxs)("nav",{className:"sticky top-20 bg-white/80 backdrop-blur-sm rounded-lg border border-stone-200 p-3 space-y-0.5",children:[(0,f.jsx)("h3",{className:"text-xs text-stone-400 uppercase tracking-widest mb-2 px-2 font-serif",children:"Contents"}),de.map(e=>(0,f.jsxs)("button",{onClick:()=>Q(e.id),className:"w-full flex items-center space-x-2 px-2 py-1.5 rounded text-left text-xs transition-colors ".concat(N===e.id?"text-amber-700 bg-amber-50 font-medium":"text-stone-500 hover:text-stone-800 hover:bg-stone-50"),children:[(0,f.jsx)(e.icon,{className:"h-3 w-3 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:e.label}),N===e.id&&(0,f.jsx)(rs.A,{className:"h-3 w-3 ml-auto flex-shrink-0"})]},e.id)),!1]})}),(0,f.jsx)("main",{className:"flex-1 min-w-0 order-1",children:(0,f.jsxs)("div",{id:"runsheet-content",className:"space-y-6",children:[(0,f.jsxs)("section",{id:"overview",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-br from-stone-100 to-amber-50 px-6 py-10 sm:px-10 text-center",children:[(0,f.jsxs)("div",{className:"flex items-center justify-center space-x-4 mb-6",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-10 bg-stone-800 rounded px-2 py-1 opacity-80"}),b.company_logo_url&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"h-6 w-px bg-stone-300"}),(0,f.jsx)("img",{src:b.company_logo_url,alt:"Company Logo",className:"h-10 object-contain opacity-80",onError:e=>{e.target.style.display="none"}})]})]}),(0,f.jsx)("div",{className:"h-px w-24 bg-amber-600/40 mx-auto mb-6"}),(0,f.jsx)("h1",{className:"font-serif text-2xl sm:text-3xl text-stone-800 mb-2",children:b.event_name}),(0,f.jsx)("div",{className:"h-px w-16 bg-amber-600/40 mx-auto my-4"}),(0,f.jsxs)("div",{className:"flex flex-wrap justify-center gap-4 text-sm text-stone-600",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)(Ke.A,{className:"h-4 w-4 text-amber-600"}),(0,f.jsx)("span",{children:b.client_company})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-amber-600"}),(0,f.jsx)("span",{children:b.venue})]})]}),b.event_website&&(0,f.jsxs)("a",{href:b.event_website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center space-x-2 mt-5 px-4 py-2 border border-stone-300 hover:border-amber-600 hover:text-amber-700 rounded text-sm text-stone-600 transition-colors",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"View Event Website"})]}),(0,f.jsx)("div",{className:"text-xs text-stone-400 mt-6",children:(0,f.jsxs)("span",{children:["Prepared ",(new Date).toLocaleDateString("en-AU",{day:"numeric",month:"long",year:"numeric"})]})})]}),(0,f.jsx)("div",{className:"px-6 py-6 sm:px-10 border-t border-stone-200",children:"single"===b.event_duration_type?(0,f.jsxs)("div",{className:"grid sm:grid-cols-3 gap-4",children:[(0,f.jsxs)("div",{className:"bg-amber-50/50 rounded-lg p-4 border border-stone-200 text-center",children:[(0,f.jsxs)("div",{className:"flex items-center justify-center space-x-2 text-amber-700 text-sm mb-2",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"font-serif",children:"Date"})]}),(0,f.jsx)("p",{className:"text-stone-800 font-serif font-semibold",children:J(b.event_date)})]}),(0,f.jsxs)("div",{className:"bg-amber-50/50 rounded-lg p-4 border border-stone-200 text-center",children:[(0,f.jsxs)("div",{className:"flex items-center justify-center space-x-2 text-amber-700 text-sm mb-2",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"font-serif",children:"Start"})]}),(0,f.jsxs)("p",{className:"text-stone-800 font-serif font-semibold text-xl",children:[Y(b.start_time)||"TBC",b.event_timezone&&"Australia/Melbourne"!==b.event_timezone&&(0,f.jsx)("span",{className:"text-sm text-stone-500 ml-1",children:(0,zo.iU)(b.event_timezone)})]})]}),(0,f.jsxs)("div",{className:"bg-amber-50/50 rounded-lg p-4 border border-stone-200 text-center",children:[(0,f.jsxs)("div",{className:"flex items-center justify-center space-x-2 text-amber-700 text-sm mb-2",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"font-serif",children:"End"})]}),(0,f.jsxs)("p",{className:"text-stone-800 font-serif font-semibold text-xl",children:[Y(b.end_time)||"TBC",b.event_timezone&&"Australia/Melbourne"!==b.event_timezone&&(0,f.jsx)("span",{className:"text-sm text-stone-500 ml-1",children:(0,zo.iU)(b.event_timezone)})]})]})]}):(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-center space-x-2 text-amber-700 font-serif mb-4",children:[(0,f.jsx)(_t.A,{className:"h-5 w-5"}),(0,f.jsxs)("span",{children:["Multi-Day Event \u2014 ",(null===(s=b.event_days)||void 0===s?void 0:s.length)||0," Days"]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:null===(a=b.event_days)||void 0===a?void 0:a.map((e,t)=>{var s,a,n;const r=(null===(s=b.crew_members)||void 0===s?void 0:s.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];return(0,f.jsxs)("div",{className:"bg-amber-50/50 rounded-lg p-4 border border-stone-200 flex flex-col",children:[(0,f.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,f.jsxs)("span",{className:"text-xs font-serif font-medium text-amber-800 bg-amber-100 px-2 py-1 rounded",children:["Day ",t+1]})}),(0,f.jsx)("p",{className:"font-serif text-stone-800 text-sm",children:new Date(e.date).toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short"})}),(0,f.jsxs)("p",{className:"text-amber-700 text-sm mt-1",children:[Y(e.start_time)," - ",Y(e.end_time)]}),(e.location||b.venue)&&(0,f.jsxs)("p",{className:"text-stone-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(C.A,{className:"h-3 w-3 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:e.location||b.venue})]}),(r.length>0||(null===(a=e.client_contacts)||void 0===a?void 0:a.length)>0)&&(0,f.jsx)("div",{className:"mt-3 pt-3 border-t border-stone-200 flex-1",children:(0,f.jsxs)("div",{className:"space-y-1",children:[r.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,f.jsx)(Xe.A,{className:"h-3 w-3 text-amber-600 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-medium text-stone-700 truncate",children:e.name}),(0,f.jsxs)("span",{className:"text-stone-400",children:["(",Pn(e.role),")"]})]},e.id)),null===(n=e.client_contacts)||void 0===n?void 0:n.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,f.jsx)(Ye.A,{className:"h-3 w-3 text-green-600 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-medium text-stone-700 truncate",children:e.name}),e.role&&(0,f.jsxs)("span",{className:"text-stone-400",children:["(",e.role,")"]})]},e.id))]})})]},e.id)})})]})})]}),(null===(n=b.deliverables)||void 0===n?void 0:n.length)>0&&(0,f.jsxs)("section",{id:"deliverables",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsx)(fe,{icon:as.A,iconColor:"text-amber-700",children:"Deliverables"}),(0,f.jsx)("div",{className:"p-6",children:(0,f.jsx)("ul",{className:"space-y-4",children:b.deliverables.map(e=>(0,f.jsxs)("li",{className:"border-b border-stone-100 last:border-b-0 pb-4 last:pb-0",children:[(0,f.jsx)("p",{className:"font-serif text-lg font-semibold text-stone-900 leading-snug",children:e.name}),e.description&&(0,f.jsx)("p",{className:"text-sm text-stone-600 leading-relaxed mt-1.5 italic",children:e.description})]},e.id))})})]}),("single"===b.event_duration_type&&(null===(r=b.timed_events)||void 0===r?void 0:r.length)>0||"multi"===b.event_duration_type&&
1(null===(i=b.event_days)||void 0===i?void 0:i.length)>0)&&(0,f.jsxs)("section",{id:"timeline",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsx)(fe,{icon:Nt.A,iconColor:"text-amber-600",children:"Event Timeline"}),(0,f.jsx)("div",{className:"p-6",children:"single"===b.event_duration_type?(0,f.jsx)("div",{className:"space-y-3",children:K(b.timed_events).map(e=>(0,f.jsx)("div",{children:e.hasStreams?(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-24 text-right pt-2",children:(0,f.jsx)("span",{className:"inline-block px-3 py-1.5 rounded text-sm font-serif font-semibold ".concat(e.events.every(e=>O[e.id]||e.completed)?"bg-green-700 text-white":"bg-amber-700 text-white"),children:Y(e.time)})}),(0,f.jsx)("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-3",children:e.events.map(e=>{const t=O[e.id]||e.completed;return(0,f.jsxs)("div",{onClick:()=>oe(e.id),className:"rounded-lg p-4 border-l-4 cursor-pointer transition-all ".concat(t?"bg-green-50 border-green-600 hover:bg-green-100":"bg-stone-50 border-amber-500 hover:bg-stone-100"),children:[e.stream&&(0,f.jsx)("span",{className:"inline-block px-2 py-0.5 bg-amber-100 text-amber-800 text-xs font-medium rounded mb-2",children:e.stream}),(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-5 h-5 rounded border-2 flex items-center justify-center transition-colors ".concat(t?"bg-green-600 border-green-600":"border-stone-400 hover:border-green-500"),children:t&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"".concat(t?"text-stone-400 line-through":"text-stone-800"),children:e.description}),e.notes&&(0,f.jsxs)("p",{className:"text-stone-500 text-sm mt-2 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),e.notes]}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),t&&e.completed_by&&(0,f.jsxs)("p",{className:"text-green-700 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",e.completed_by]})]})]})]},e.id)})})]}):e.events.map(e=>{const t=O[e.id]||e.completed;return(0,f.jsxs)("div",{className:"flex items-start gap-4 group",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-24 text-right",children:(0,f.jsx)("span",{className:"inline-block px-3 py-1.5 rounded text-sm font-serif font-semibold ".concat(t?"bg-green-700 text-white":"bg-amber-700 text-white"),children:Y(e.time)})}),(0,f.jsx)("div",{onClick:()=>oe(e.id),className:"flex-1 rounded-lg p-4 border-l-4 cursor-pointer transition-all ".concat(t?"bg-green-50 border-green-600 hover:bg-green-100":"bg-stone-50 border-amber-600 group-hover:bg-stone-100"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-5 h-5 rounded border-2 flex items-center justify-center transition-colors ".concat(t?"bg-green-600 border-green-600":"border-stone-400 hover:border-green-500"),children:t&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"".concat(t?"text-stone-400 line-through":"text-stone-800"),children:e.description}),e.notes&&(0,f.jsxs)("p",{className:"text-stone-500 text-sm mt-2 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),e.notes]}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),t&&e.completed_by&&(0,f.jsxs)("p",{className:"text-green-700 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",e.completed_by]})]})]})})]},e.id)})},e.time))}):(0,f.jsx)("div",{className:"space-y-8",children:b.event_days.map((e,t)=>{var s,a,n;const r=(null===(s=b.crew_members)||void 0===s?void 0:s.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];return(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"bg-gradient-to-r from-amber-50 to-stone-50 rounded-lg p-4 mb-4 border border-stone-200",children:(0,f.jsxs)("div",{className:"flex flex-col lg:flex-row lg:items-start lg:justify-between gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"font-serif text-lg text-stone-800",children:["Day ",t+1]}),(0,f.jsxs)("p",{className:"text-amber-700 text-sm",children:[J(e.date)," \u2014 ",Y(e.start_time)," - ",Y(e.end_time)]}),(e.location||b.venue)&&(0,f.jsxs)("p",{className:"text-stone-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(C.A,{className:"h-3 w-3"}),e.location||b.venue]})]}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-2",children:[r.map(e=>(0,f.jsxs)("div",{className:"bg-white rounded-lg px-3 py-2 border border-stone-200",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Xe.A,{className:"h-4 w-4 text-amber-600"}),(0,f.jsx)("span",{className:"font-medium text-stone-800",children:e.name}),(0,f.jsx)("span",{className:"text-xs bg-amber-100 text-amber-700 px-2 py-0.5 rounded-full uppercase",children:Pn(e.role)})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat(e.mobile),className:"text-sm text-amber-700 hover:text-amber-900 font-medium mt
1-1 block",children:e.mobile})]},e.id)),null===(a=e.client_contacts)||void 0===a?void 0:a.map(e=>(0,f.jsxs)("div",{className:"bg-white rounded-lg px-3 py-2 border border-green-200",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Ye.A,{className:"h-4 w-4 text-green-600"}),(0,f.jsx)("span",{className:"font-medium text-stone-800",children:e.name}),e.role&&(0,f.jsx)("span",{className:"text-xs bg-green-100 text-green-700 px-2 py-0.5 rounded-full uppercase",children:e.role})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat(e.mobile),className:"text-sm text-green-700 hover:text-green-900 font-medium mt-1 block",children:e.mobile})]},e.id))]})]})}),(null===(n=e.timed_events)||void 0===n?void 0:n.length)>0&&(0,f.jsx)("div",{className:"space-y-3 ml-4",children:K(e.timed_events).map(t=>(0,f.jsx)("div",{children:t.hasStreams?(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-20 text-right pt-2",children:(0,f.jsx)("span",{className:"inline-block px-2 py-1 rounded text-sm font-serif font-semibold ".concat(t.events.every(e=>O[e.id]||e.completed)?"bg-green-700 text-white":"bg-amber-700 text-white"),children:Y(t.time)})}),(0,f.jsx)("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-3",children:t.events.map(t=>{const s=O[t.id]||t.completed;return(0,f.jsxs)("div",{onClick:()=>oe(t.id,e.id),className:"rounded-lg p-3 border-l-4 cursor-pointer transition-all ".concat(s?"bg-green-50 border-green-600 hover:bg-green-100":"bg-stone-50 border-amber-500 hover:bg-stone-100"),children:[t.stream&&(0,f.jsx)("span",{className:"inline-block px-2 py-0.5 bg-amber-100 text-amber-800 text-xs font-medium rounded mb-2",children:t.stream}),(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded border-2 flex items-center justify-center transition-colors ".concat(s?"bg-green-600 border-green-600":"border-stone-400 hover:border-green-500"),children:s&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm ".concat(s?"text-stone-400 line-through":"text-stone-800"),children:t.description}),t.notes&&(0,f.jsxs)("p",{className:"text-stone-500 text-xs mt-1 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),t.notes]}),t.location&&(0,f.jsx)(Io,{location:t.location,size:"xs"}),s&&t.completed_by&&(0,f.jsxs)("p",{className:"text-green-700 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",t.completed_by]})]})]})]},t.id)})})]}):t.events.map(t=>{const s=O[t.id]||t.completed;return(0,f.jsxs)("div",{className:"flex items-start gap-4 group",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-20 text-right",children:(0,f.jsx)("span",{className:"inline-block px-2 py-1 rounded text-sm font-serif font-semibold ".concat(s?"bg-green-700 text-white":"bg-amber-700 text-white"),children:Y(t.time)})}),(0,f.jsx)("div",{onClick:()=>oe(t.id,e.id),className:"flex-1 rounded-lg p-3 border-l-4 cursor-pointer transition-all ".concat(s?"bg-green-50 border-green-600 hover:bg-green-100":"bg-stone-50 border-amber-600 hover:bg-stone-100"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded border-2 flex items-center justify-center transition-colors ".concat(s?"bg-green-600 border-green-600":"border-stone-400 hover:border-green-500"),children:s&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm ".concat(s?"text-stone-400 line-through":"text-stone-800"),children:t.description}),t.notes&&(0,f.jsxs)("p",{className:"text-stone-500 text-xs mt-1 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),t.notes]}),t.location&&(0,f.jsx)(Io,{location:t.location,size:"xs"}),s&&t.completed_by&&(0,f.jsxs)("p",{className:"text-green-700 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",t.completed_by]})]})]})})]},t.id)})},t.time))})]},e.id)})})})]}),(null===(o=b.voxpops)||void 0===o?void 0:o.enabled)&&(e=>{const t=Pi(b.voxpops),s=t.length>1;return(0,f.jsxs)("section",{id:"voxpops",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsxs)(fe,{icon:Di.A,iconColor:"text-emerald-600",children:["Voxpops",pe.length>0&&(0,f.jsxs)("span",{className:"text-sm font-serif text-emerald-700 italic font-normal ml-2",children:["\u2014 Filmed by ",pe.map(e=>
1e.name).join(", ")]})]}),(0,f.jsx)("p",{className:"px-6 pt-4 pb-2 text-sm font-serif italic text-stone-600",children:"Turbo 360 crew will focus on sound and visual quality. Client to arrange the talent and ask the questions."}),(0,f.jsxs)("div",{className:"p-6 space-y-6",children:[t.map((e,t)=>(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[s?(0,f.jsxs)("p",{className:"text-xs font-serif uppercase tracking-wider ".concat(e.completed?"text-emerald-500/70 line-through":"text-emerald-700"),children:["Subject ",t+1]}):(0,f.jsx)("span",{}),me&&e.id&&(0,f.jsxs)("button",{type:"button",onClick:()=>me(e.id),className:"inline-flex items-center gap-1.5 text-xs font-serif rounded-full px-3 py-1 border transition-colors ".concat(e.completed?"bg-emerald-600 text-white border-emerald-600":"bg-white text-emerald-700 border-emerald-300 hover:bg-emerald-50"),children:[(0,f.jsx)(p.A,{className:"h-3.5 w-3.5"}),e.completed?"Captured":"Mark captured"]})]}),(0,f.jsxs)("div",{className:"grid sm:grid-cols-3 gap-4 ".concat(e.completed?"opacity-60":""),children:[e.time&&(0,f.jsxs)("div",{className:"bg-emerald-50/50 rounded-lg p-4 border border-stone-200 text-center",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-700 font-serif mb-1",children:"Time"}),(0,f.jsx)("p",{className:"text-stone-800 font-serif font-semibold",children:Y(e.time)})]}),e.contact_name&&(0,f.jsxs)("div",{className:"bg-emerald-50/50 rounded-lg p-4 border border-stone-200 text-center",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-700 font-serif mb-1",children:"Contact"}),(0,f.jsx)("p",{className:"text-stone-800 font-serif font-semibold",children:e.contact_name})]}),e.meeting_point&&(0,f.jsxs)("div",{className:"bg-emerald-50/50 rounded-lg p-4 border border-stone-200 text-center",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-700 font-serif mb-1",children:"Meeting Point"}),(0,f.jsx)("p",{className:"text-stone-800 font-serif font-semibold",children:e.meeting_point})]})]})]},e.id||t)),(null===(e=b.voxpops.questions)||void 0===e?void 0:e.length)>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-serif text-emerald-700 mb-3",children:"Suggested Questions"}),(0,f.jsx)("ol",{className:"space-y-2",children:b.voxpops.questions.filter(e=>e).map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start space-x-3 bg-stone-50 rounded-lg p-3 border border-stone-100",children:[(0,f.jsx)("span",{className:"flex-shrink-0 w-6 h-6 bg-emerald-100 text-emerald-700 rounded-full flex items-center justify-center text-sm font-serif",children:t+1}),(0,f.jsx)("span",{className:"text-stone-700 font-serif",children:e})]},t))})]})]})]})})(),(null===(l=b.crew_members)||void 0===l?void 0:l.length)>0&&(0,f.jsxs)("section",{id:"crew",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsxs)(fe,{icon:Xe.A,iconColor:"text-amber-600",children:["Crew (",b.crew_members.length,")"]}),(0,f.jsx)("div",{className:"p-6",children:(0,f.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:b.crew_members.map(e=>(0,f.jsxs)("div",{className:"bg-stone-50 rounded-lg p-4 border border-stone-200",children:[(0,f.jsx)("div",{className:"flex items-start justify-between mb-3",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-serif text-stone-800",children:e.name}),(0,f.jsx)("p",{className:"text-sm text-amber-700 font-medium uppercase tracking-wide",children:Pn(e.role)}),(e.start_time||e.end_time)&&(0,f.jsxs)("p",{className:"text-xs text-stone-500 mt-1 flex items-center gap-1 font-mono",children:[(0,f.jsx)(Nt.A,{className:"h-3 w-3"}),e.start_time||b.start_time||"09:00"," \u2013 ",e.end_time||b.end_time||"17:00"]})]})}),(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center space-x-2 text-stone-600 hover:text-amber-700 transition-colors",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"font-medium",children:e.mobile})]})]},e.id))})})]}),(0,f.jsxs)("section",{id:"contact",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-stone-200 flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex items-center w-full",children:[(0,f.jsx)("div",{className:"hidden sm:block flex-1 h-px bg-stone-300"}),(0,f.jsxs)("h2",{className:"font-serif text-lg text-stone-800 flex items-center space-x-2 px-4 whitespace-nowrap",children:[(0,f.jsx)(Ye.A,{className:"h-5 w-5 text-amber-600"}),(0,f.jsxs)("span",{children:["Client Contact",(null===(c=b.client_contacts)||void 0===c?void 0:c.length)>1?"s":""]})]}),(0,f.jsx)("div",{className:"hidden sm:block flex-1 h-px bg-stone-300"})]}),!S&&!(null!==(d=b.client_contacts)&&void 0!==d&&d.length)&&(0,f.jsx)("div",{className:"ml-4 flex-shrink-0",children:(0,f.jsxs)("button",{onClick:X,className:"flex items-center space-x-1 px-3 py-1.5 bg-amber-700 hover:bg-amber-800 text-white rounded text-sm transition-colors print:hidden",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]})})]}),(0,f.jsx)("div",{className:"p-6",children:(null===(x=b.client_contacts)||void 0===x?void 0:x.length)>0?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,f.jsx)(Ke.A,{className:"h-5 w-5 text-stone-400"}),(0,f.jsx)("span",{className:"font-serif text-lg text-stone-800",children:b.client_company})]}),(0,f.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:b.client_contacts.map(e=>(0,f.jsxs)("div",{className:"rounded-lg p-4 border-2 ".concat(e.is_primary?"bg-amber-50/50 border-amber-200":"bg-stone-50 border-stone-200"),children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-serif text-stone-800",children:e.name}),e.role&&(0,f.jsx)("span",{className:"inline-block text-xs px-2 py-0.5 rounded-full mt-1 ".concat(e.is_primary?"bg-amber-100 text-amber-800":"bg-stone-200 text-stone-600"),children:e.role})]}),e.is_primary&&(0,f.jsx)("span",{className:"text-xs bg-amber-700 text-white px-2 py-1 rounded-full font-medium",children:"Primary"})]}),(0,f.jsxs)("div",{className:"space-y-1 mt-3",children:[e.email&&(0,f.jsxs)("a",{href:"mailto:".concat(e.email),className:"flex items-center gap-2 text-sm text-amber-700 hover:text-amber-900",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),e.email]}),e.mobile&&(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center gap-2 text-sm text-amber-700 hover:text-amber-900",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),e.mobile]})]})]},e.id))}),b.additional_notes&&(0,f.jsxs)("div",{className:"pt-4 border-t border-stone-200",children:[(0,f.jsx)("p",{className:"text-xs text-stone-400 uppercase tracking-wider mb-1 font-serif",children:"Additional Notes"}),(0,f.jsx)("p",{className:"text-stone-700",children:b.additional_notes})]})]}):S?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-stone-600 font-medium mb-1 block",children:"Name"}),(0,f.jsx)("input",{type:"text",value:F.primary_contact,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{primary_contact:e.target.value})),className:"w-full px-3 py-2 border border-stone-300 rounded-lg bg-white text-stone-800 focus:ring-2 focus:ring-amber-500 focus:border-transparent",placeholder:"Primary contact name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-stone-600 font-medium mb-1 block",children:"Company"}),(0,f.jsx)("input",{type:"text",value:b.client_company,disabled:!0,className:"w-full px-3 py-2 border border-stone-200 rounded-lg bg-stone-100 text-stone-400"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-stone-600 font-medium mb-1 block",children:"Email"}),(0,f.jsx)("input",{type:"email",value:F.email,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{email:e.target.value})),className:"w-full px-3 py-2 border border-stone-300 rounded-lg bg-white text-stone-800 focus:ring-2 focus:ring-amber-500 focus:border-transparent",placeholder:"[email protected]"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-stone-600 font-medium mb-1 block",children:"Mobile"}),(0,f.jsx)("input",{type:"tel",value:F.mobile,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{mobile:e.target.value})),className:"w-full px-3 py-2 border border-stone-300 rounded-lg bg-white text-stone-800 focus:ring-2 focus:ring-amber-500 focus:border-transparent",placeholder:"Mobile number"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-stone-600 font-medium mb-1 block",children:"Additional Notes"}),(0,f.jsx)("textarea",{value:F.additional_notes,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{additional_notes:e.target.value})),className:"w-full px-3 py-2 border border-stone-300 rounded-lg bg-white text-stone-800 focus:ring-2 focus:ring-amber-500 focus:border-transparent",rows:"2",placeholder:"Any additional notes..."})]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-2 pt-2",children:[(0,f.jsx)("button",{onClick:ee,disabled:I,className:"px-4 py-2 bg-stone-200 hover:bg-stone-300 text-stone-700 rounded-lg text-sm transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:te,disabled:I,className:"flex items-center space-x-1 px-4 py-2 bg-green-700 hover:bg-green-800 text-white rounded-lg text-sm transition-colors disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:I?"Saving...":"Save"})]})]})]}):(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-stone-400 uppercase tracking-wider mb-1 font-serif",children:"Name"}),(0,f.jsx)("p",{className:"text-stone-800",children:b.primary_contact||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-stone-400 uppercase tracking-wider mb-1 font-serif",children:"Company"}),(0,f.jsx)("p",{className:"text-stone-800",children:b.client_company})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-stone-400 uppercase tracking-wider mb-1 font-serif",children:"Email"}),(0,f.jsx)("a",{href:"mailto:".concat(b.email),className:"text-amber-700 hover:text-amber-900",children:b.email||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-stone-400 uppercase tracking-wider mb-1 font-serif",children:"Mobile"}),(0,f.jsx)("a",{href:"tel:".concat(b.mobile),className:"text-amber-700 hover:text-amber-900",children:b.mobile||"\u2014"})]}),b.additional_notes&&(0,f.jsxs)("div",{className:"sm:col-span-2 pt-4 border-t border-stone-200",children:[(0,f.jsx)("p",{className:"text-xs text-stone-400 uppercase tracking-wider mb-1 font-serif",children:"Additional Notes"}),(0,f.jsx)("p",{className:"text-stone-700",children:b.additional_notes})]})]})})]}
1),(b.supporting_documents&&b.supporting_documents.length>0||b.client_brief_file)&&(0,f.jsxs)("section",{id:"documents",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsx)(fe,{icon:kt.A,iconColor:"text-amber-600",children:"Supporting Documents"}),(0,f.jsxs)("div",{className:"p-6 space-y-3",children:[null===(h=b.supporting_documents)||void 0===h?void 0:h.map((e,t)=>e.external_url?(0,f.jsxs)("a",{href:e.external_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-amber-50/50 rounded-lg p-4 border border-stone-200 hover:bg-amber-100/50 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 min-w-0",children:[(0,f.jsx)("div",{className:"bg-stone-700 text-white rounded-lg p-2 flex-shrink-0",children:(0,f.jsx)(En.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("p",{className:"font-medium text-stone-800 truncate",children:e.title||e.external_url}),(0,f.jsx)("p",{className:"text-xs text-stone-500 truncate",children:e.external_url})]})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-1 px-4 py-2 bg-stone-700 hover:bg-stone-800 text-white rounded-lg text-sm transition-colors flex-shrink-0 ml-3",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Open"})]})]},e.link_id||t):(0,f.jsxs)("div",{className:"flex items-center justify-between bg-amber-50/50 rounded-lg p-4 border border-stone-200",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("div",{className:"bg-amber-700 text-white rounded-lg p-2",children:(0,f.jsx)(kt.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-stone-800",children:e.original_filename||"Document"}),(0,f.jsx)("p",{className:"text-xs text-stone-400",children:e.file_size?"".concat((e.file_size/1024/1024).toFixed(2)," MB"):""})]})]}),(0,f.jsxs)("button",{onClick:()=>ce(e),className:"flex items-center space-x-1 px-4 py-2 bg-amber-700 hover:bg-amber-800 text-white rounded-lg text-sm transition-colors",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]},e.file_key||t)),b.client_brief_file&&(!b.supporting_documents||0===b.supporting_documents.length)&&(0,f.jsxs)("div",{className:"flex items-center justify-between bg-amber-50/50 rounded-lg p-4 border border-stone-200",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("div",{className:"bg-amber-700 text-white rounded-lg p-2",children:(0,f.jsx)(kt.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-stone-800",children:b.client_brief_file.original_filename||"Document"}),(0,f.jsx)("p",{className:"text-xs text-stone-400",children:b.client_brief_file.file_size?"".concat((b.client_brief_file.file_size/1024/1024).toFixed(2)," MB"):""})]})]}),(0,f.jsxs)("button",{onClick:()=>ce(b.client_brief_file),className:"flex items-center space-x-1 px-4 py-2 bg-amber-700 hover:bg-amber-800 text-white rounded-lg text-sm transition-colors",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]})]})]}),(0,f.jsxs)("section",{id:"briefing",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-stone-200 flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex items-center w-full",children:[(0,f.jsx)("div",{className:"hidden sm:block flex-1 h-px bg-stone-300"}),(0,f.jsxs)("h2",{className:"font-serif text-lg text-stone-800 flex items-center space-x-2 px-4 whitespace-nowrap",children:[(0,f.jsx)(oa.A,{className:"h-5 w-5 text-amber-600"}),(0,f.jsx)("span",{children:"Special Briefing Notes"})]}),(0,f.jsx)("div",{className:"hidden sm:block flex-1 h-px bg-stone-300"})]}),!_&&(0,f.jsx)("div",{className:"ml-4 flex-shrink-0",children:(0,f.jsxs)("button",{onClick:se,className:"flex items-center space-x-1 px-3 py-1.5 bg-amber-700 hover:bg-amber-800 text-white rounded text-sm transition-colors print:hidden",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]})})]}),(0,f.jsx)("div",{className:"p-6",children:_?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("textarea",{value:B,onChange:e=>D(e.target.value),className:"w-full px-3 py-2 border border-stone-300 rounded-lg bg-white text-stone-800 focus:ring-2 focus:ring-amber-500 focus:border-transparent",rows:"5",placeholder:"Add any special briefing notes for the crew..."}),(0,f.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,f.jsx)("button",{onClick:ae,disabled:I,className:"px-4 py-2 bg-stone-200 hover:bg-stone-300 text-stone-700 rounded-lg text-sm transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:ne,disabled:I,className:"flex items-center space-x-1 px-4 py-2 bg-green-700 hover:bg-green-800 text-white rounded-lg text-sm transition-colors disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:I?"Saving...":"Save"})]})]})]}):(0,f.jsx)("div",{className:"bg-amber-50/50 rounded-lg p-4 border-l-4 border-amber-600",children:b.special_briefing_notes?(0,f.jsx)("p",{className:"text-stone-700
1whitespace-pre-wrap",children:b.special_briefing_notes}):(0,f.jsx)("p",{className:"text-stone-400 italic",children:"No briefing notes added yet. Click 'Edit' to add notes."})})})]}),(Z()&&j||$()&&w)&&(0,f.jsxs)("section",{id:"imagery-standards",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsx)(fe,{icon:Ue.A,iconColor:"text-amber-600",children:"Imagery Standards"}),(0,f.jsxs)("div",{className:"p-6 space-y-6",children:[Z()&&j&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"font-serif text-stone-800 flex items-center space-x-2 mb-3",children:[(0,f.jsx)(Ue.A,{className:"h-4 w-4 text-amber-600"}),(0,f.jsx)("span",{children:"Photography Standards"})]}),(0,f.jsx)("div",{className:"bg-stone-50 rounded-lg p-4 border-l-4 border-amber-600 prose prose-sm max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-stone-700",dangerouslySetInnerHTML:{__html:or.default.sanitize(j)}})]}),$()&&w&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"font-serif text-stone-800 flex items-center space-x-2 mb-3",children:[(0,f.jsx)(Ge.A,{className:"h-4 w-4 text-amber-600"}),(0,f.jsx)("span",{children:"Videography Standards"})]}),(0,f.jsx)("div",{className:"bg-stone-50 rounded-lg p-4 border-l-4 border-amber-600 prose prose-sm max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-stone-700",dangerouslySetInnerHTML:{__html:or.default.sanitize(w)}})]})]})]}),b.must_capture_checklist&&b.must_capture_checklist.length>0&&(0,f.jsxs)("section",{id:"checklist",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-stone-200 flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex items-center w-full",children:[(0,f.jsx)("div",{className:"hidden sm:block flex-1 h-px bg-stone-300"}),(0,f.jsxs)("h2",{className:"font-serif text-lg text-stone-800 flex items-center space-x-2 px-4 whitespace-nowrap",children:[(0,f.jsx)(p.A,{className:"h-5 w-5 text-amber-600"}),(0,f.jsx)("span",{children:"Must-Capture Checklist"})]}),(0,f.jsx)("div",{className:"hidden sm:block flex-1 h-px bg-stone-300"})]}),(0,f.jsx)("div",{className:"ml-4 flex-shrink-0",children:(0,f.jsxs)("span",{className:"text-sm font-medium text-amber-800 bg-amber-100 px-3 py-1 rounded-full",children:[Object.values(P).filter(Boolean).length," / ",b.must_capture_checklist.length]})})]}),(0,f.jsxs)("div",{className:"p-6",children:[(0,f.jsx)("p",{className:"text-sm text-stone-500 mb-4",children:"Click items as you complete them. Progress is saved automatically."}),(0,f.jsx)("div",{className:"space-y-2",children:b.must_capture_checklist.sort((e,t)=>e.order-t.order).map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 bg-stone-50 rounded-lg border border-stone-200 hover:border-amber-300 cursor-pointer transition-all group",children:[(0,f.jsx)("input",{type:"checkbox",checked:P[e.id]||!1,onChange:()=>re(e.id),className:"w-5 h-5 text-amber-600 border-2 border-amber-300 rounded focus:ring-2 focus:ring-amber-500"}),(0,f.jsx)("span",{className:"flex-1 ".concat(P[e.id]?"line-through text-stone-400":"text-stone-800"," transition-all"),children:e.text})]},e.id))})]})]}),b.priority_sponsor_stands&&b.priority_sponsor_stands.length>0&&(0,f.jsxs)("section",{id:"sponsor-stands",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-stone-200 flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex items-center w-full",children:[(0,f.jsx)("div",{className:"hidden sm:block flex-1 h-px bg-stone-300"}),(0,f.jsxs)("h2",{className:"font-serif text-lg text-stone-800 flex items-center space-x-2 px-4 whitespace-nowrap",children:[(0,f.jsx)(p.A,{className:"h-5 w-5 text-rose-600"}),(0,f.jsx)("span",{children:"Priority Sponsor Stands"})]}),(0,f.jsx)("div",{className:"hidden sm:block flex-1 h-px bg-stone-300"})]}),(0,f.jsx)("div",{className:"ml-4 flex-shrink-0",children:(0,f.jsxs)("span",{className:"text-sm font-medium text-rose-800 bg-rose-100 px-3 py-1 rounded-full",children:[Object.values(W).filter(
1Boolean).length," / ",b.priority_sponsor_stands.length]})})]}),(0,f.jsxs)("div",{className:"p-6",children:[(0,f.jsx)("p",{className:"text-sm text-stone-500 mb-4",children:"Please ensure you capture at least one strong shot at each of the following stands with clear branding and visible attendee engagement."}),(0,f.jsx)("div",{className:"space-y-2",children:b.priority_sponsor_stands.sort((e,t)=>e.order-t.order).map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 bg-stone-50 rounded-lg border border-stone-200 hover:border-rose-300 cursor-pointer transition-all group",children:[(0,f.jsx)("input",{type:"checkbox",checked:W[e.id]||!1,onChange:()=>ie(e.id),className:"w-5 h-5 text-rose-600 border-2 border-rose-300 rounded focus:ring-2 focus:ring-rose-500"}),(0,f.jsx)("span",{className:"flex-1 ".concat(W[e.id]?"line-through text-stone-400":"text-stone-800"," transition-all"),children:e.text})]},e.id))})]})]}),(b.show_crew_upload_instructions||b.show_generic_upload_instructions||b.masv_portal_url)&&(0,f.jsxs)("section",{id:"upload",className:"bg-white/80 rounded-lg border border-stone-200 overflow-hidden shadow-sm",children:[(0,f.jsx)(fe,{icon:_s.A,iconColor:"text-amber-600",children:"Crew Upload Instructions"}),(0,f.jsx)("div",{className:"p-6",children:b.masv_portal_url?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("p",{className:"text-stone-600",children:"Upload your RAW video and photo files directly from your browser \u2014 no software installation required."}),(0,f.jsxs)("a",{href:b.masv_portal_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-3 bg-gradient-to-r from-stone-800 to-stone-900 hover:from-stone-700 hover:to-stone-800 text-white rounded-lg p-5 transition-colors text-center",children:[(0,f.jsx)(_s.A,{className:"h-6 w-6"}),(0,f.jsx)("span",{className:"font-semibold text-lg",children:"Upload Files"})]}),b.masv_job_code&&(0,f.jsx)("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3",children:(0,f.jsxs)("p",{className:"text-amber-900 text-sm",children:[(0,f.jsx)("span",{className:"font-semibold",children:"Job Code:"})," ",b.masv_job_code]})})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"text-stone-600 mb-6",children:"Download and install the Turbo Crew Upload software:"}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-arm64.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-stone-800 to-stone-900 hover:from-stone-700 hover:to-stone-800 text-white rounded-lg p-4 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium",children:"Crew Upload (Apple Silicon).dmg"}),(0,f.jsx)("p",{className:"text-xs text-stone-300",children:"For Apple Silicon Macs (M1, M2, M3, M4)"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-stone-600 to-stone-700 hover:from-stone-500 hover:to-stone-600 text-white rounded-lg p-4 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24
1-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium",children:"Crew Upload (Intel).dmg"}),(0,f.jsx)("p",{className:"text-xs text-stone-300",children:"For Intel Macs"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-Setup.exe",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-amber-700 to-amber-800 hover:from-amber-600 hover:to-amber-700 text-white rounded-lg p-4 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M3 12V6.75l6-1.32v6.48L3 12zm17-9v8.75l-10 .15V5.21L20 3zM3 13l6 .09v6.81l-6-1.15V13zm17 .25V22l-10-1.91V13.1l10 .15z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium",children:"Crew Upload Setup.exe"}),(0,f.jsx)("p",{className:"text-xs text-amber-200",children:"For Windows"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5"})]})]}),(0,f.jsx)("div",{className:"mt-4 bg-amber-50 border border-amber-200 rounded-lg p-3",children:(0,f.jsxs)("p",{className:"text-amber-900 text-sm",children:[(0,f.jsx)("span",{className:"font-semibold",children:"Upload Password:"})," tcrew26"]})})]})})]}),(0,f.jsx)("section",{className:"bg-gradient-to-br from-stone-800 to-stone-900 text-white rounded-lg overflow-hidden",children:(0,f.jsxs)("div",{className:"p-8 text-center",children:[(0,f.jsx)("div",{className:"h-px w-16 bg-amber-600/50 mx-auto mb-6"}),(0,f.jsx)("div",{className:"inline-block mb-4",children:(0,f.jsxs)("div",{className:"flex items-center justify-center space-x-3",children:[(0,f.jsx)(E.A,{className:"h-6 w-6 text-amber-400"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm text-stone-400 font-serif",children:"Emergency Contact"}),(0,f.jsx)("p",{className:"text-2xl font-serif",children:"1300 207 446"})]})]})}),(0,f.jsx)("div",{className:"h-px w-16 bg-amber-600/50 mx-auto my-4"}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-2 text-sm text-stone-400",children:[(0,f.jsxs)("span",{className:"font-serif",children:["\xa9 ",(new Date).getFullYear()," Turbo 360"]}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"\xb7"}),(0,f.jsx)("span",{children:"[email protected]"})]})]})})]})})]})})]})},Go=e=>{var t,s,a,n,r,i,o,l,c,d,x,h;const{eventId:u,event:b,showShareNotification:y,isGeneratingPDF:v,photographyStandards:j,videographyStandards:w,activeSection:N,showMobileNav:A,setShowMobileNav:k,editingContact:S,editingBriefing:_,contactFormData:F,setContactFormData:z,briefingFormData:B,setBriefingFormData:D,isSaving:I,saveNotification:R,checklistCompletions:P,priorityStandCompletions:W,timedEventCompletions:O,showMessageModal:L,setShowMessageModal:M,crewMessage:q,setCrewMessage:H,isSendingMessage:U,handleShare:G,handleDownloadPDF:V,formatDate:J,formatTime:Y,groupEventsByTimeSlot:K,shouldShowPhotographyStandards:Z,shouldShowVideographyStandards:$,scrollToSection:Q,startEditingContact:X,cancelEditingContact:ee,saveContactChanges:te,startEditingBriefing:se,cancelEditingBriefing:ae,saveBriefingChanges:ne,toggleChecklistItem:re,togglePriorityStand:ie,toggleTimedEvent:oe,sendCrewMessage:le,downloadDocument:ce,navItems:de,toggleVoxpopItem:me,voxpopVideographers:pe=[],availableRoles:xe,activeRole:he,setActiveRole:ue,handleDownloadAllRoles:ge}=e;return(0,f.jsxs)("div",{className:"min-h-screen bg-gray-950",children:[(0,f.jsx)("div",{className:"bg-gray-900 border-b border-gray-800 sticky top-0 z-50 print:hidden shadow-lg",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 py-3",children:(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-8"}),(0,f.jsx)("div",{className:"hidden sm:block",children:(0,f.jsx)("h1",{className:"text-sm font-medium text-gray-100 truncate max-w-xs",children:b.event_name})})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)("button",{onClick:()=>k(!A),className:"lg:hidden p-2 text-gray-400 hover:bg-gray-800 rounded-lg",children:(0,f.jsx)(cs.A,{className:"h-5 w-5"})}),(0,f.jsxs)("button",{onClick:G,className:"flex items-center space-x-1 px-3 py-2 bg-gray-800 hover:bg-gray-700 text-gray-300 rounded-lg text-sm font-medium transition-colors border border-gray-700",children:[(0,f.jsx)(at.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"Share"})]}),(0,f.jsxs)("button",{onClick:V,disabled:v,className:"flex items-center space-x-1 px-3 py-2 bg-red-600 hover:bg-red-500 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:v?"Generating...":"PDF"})]})]})]})})}),(0,f.jsx)(Do,{availableRoles:xe,activeRole:he,setActiveRole:ue,activeRunsheet:e.activeRunsheet,dark:!0}),(0,f.jsx)(Yi,{availableRoles:xe,activeRole:he,setActiveRole:ue}),A&&(0,f.jsx)("div",{className:"lg:hidden fixed inset-0 z-40 bg-black/70",onClick:()=>k(!1),children:(0,f.jsx)("div",{className:"absolute top-16 left-4 right-4 bg-gray-900 rounded-xl shadow-2xl p-4 border border-gray-800",onClick:e=>e.stopPropagation(),children:(0,f.jsxs)("nav",{className:"space-y-1",children:[de.map(e=>(0,f.jsxs)("button",{onClick:()=>Q(e.id),className:"w-full flex items-center space-x-3 px-4 py-3 rounded-lg text-left transition-colors ".concat(N===e.id?"bg-red-950/50 text-red-400 shadow-[0_0_10px_rgba(239,68,68,0.3)]":"text-gray-300 hover:bg-gray-800"),children:[(0,f.jsx)(e.icon,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"font-medium",children:e.label})]},e.id)),!1]})})}),y&&(0,f.jsxs)("div",{className:"fixed top-20 right-4 bg-green-600 text-white px-4 py-2 rounded-lg shadow-lg z-50 flex items-center space-x-2 print:hidden text-sm",children:[(0,f.jsx)(p.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Link copied!"})]}),R&&(0,f.jsxs)("div",{className:"fixed top-20 right-4 px-4 py-2 rounded-lg shadow-lg z-50 flex items-center space-x-2 print:hidden text-sm ".concat("success"===R.type?"bg-green-600":"bg-red-600"," text-white"),children:["success"===R.type?(0,f.jsx)(p.A,{className:"h-4 w-4"}):(0,f.jsx)(g.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:R.message})]}),L&&(0,f.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 print:hidden",onClick:()=>M(!1),children:(0,f.jsxs)("div",{className:"bg-gray-900 rounded-xl shadow-2xl w-full max-w-md mx-4 p-6 border border-gray-800",onClick:e=>e.stopPropagation(),children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("h3",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)(Fn.A,{className:"h-5 w-5 text-red-500"}),(0,f.jsx)("span",{children:"Message Crew"})]}),(0,f.jsx)("button",{onClick:()=>M(!1),className:"text-gray-500 hover:text-gray-300",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsx)("textarea",{value:q,onChange:e=>H(e.target.value),placeholder:"Type your message to the crew...",className:"w-full border border-gray-700 rounded-lg px-3 py-2 text-sm bg-gray-800 text-gray-100 placeholder-gray-500 focus:ring-2 focus:ring-red-500 focus:border-red-500 outline-none resize-none",rows:4,maxLength:500,autoFocus:!0}),(0,f.jsxs)("p",{className:"text-xs text-gray-500 mt-1 mb-4",children:[q.length,"/500 characters"]}),(0,f.jsxs)("p",{className:"text-xs text-gray-400 mb-4",children:["This will send a push notification and chat message to all ",null===(t=b.crew_members)||void 0===t?void 0:t.length," crew member(s)."]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-3",children:[(0,f.jsx)("button",{onClick:()=>M(!1),className:"px-4 py-2 text-sm text-gray-400 hover:text-gray-200",children:"Cancel"}),(0,f.jsx)("button",{onClick:le,disabled:!q.trim()||U,className:"px-4 py-2 text-sm bg-red-600 text-white rounded-lg hover:bg-red-500 disabled:opacity-50 disabled:cursor-not-allowed flex items-center space-x-2",children:U?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white"}),(0,f.jsx)("span",{children:"Sending..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Send"})]})})]})]})}),(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 py-6",children:(0,f.jsxs)("div",{className:"flex gap-6",children:[(0,f.jsx)("aside",{className:"hidden lg:block w-64 flex-shrink-0",children:(0,f.jsxs)("nav",{className:"sticky top-20 bg-gray-900 rounded-xl shadow-lg border border-gray-800 p-4 space-y-1",children:[(0,f.jsx)("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-3 px-3",children:"Navigation"}),de.map(e=>(0,f.jsxs)("button",{onClick:()=>Q(e.id),className:"w-full flex items-center space-x-3 px-3 py-2 rounded-lg text-left text-sm transition-all ".concat(N===e.id?"bg-red-950/50 text-red-400 font-medium shadow-[0_0_10px_rgba(239,68,68,0.3)]":"text-gray-400 hover:bg-gray-800 hover:text-gray-200"),children:[(0,f.jsx)(e.icon,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:e.label}),N===e.id&&(0,f.jsx)(rs.A,{className:"h-4 w-4 ml-auto"})]},e.id)),!1]})}),(0,f.jsx)("main",{className:"flex-1 min-w-0",children:(0,f.jsxs)("div",{id:"runsheet-content",className:"space-y-6",children:[(0,f.jsxs)("section",{id:"overview",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsxs)("div",{className:"bg-gray-950 text-white px-6 py-8 sm:px-8",children:[(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4 mb-6",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-12 object-contain"}),b.company_logo_url&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"h-8 w-px bg-gray-700"}),(0,f.jsx)("img",{src:b.company_logo_url,alt:"Company Logo",className:"h-12 object-contain brightness-110",onError:e=>{e.target.style.display="none"}})]})]}),(0,f.jsx)("div",{className:"text-sm text-gray-500",children:(0,f.jsxs)("span",{children:["Generated ",(new Date).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"})]})})]}),(0,f.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold text-white mb-2",children:b.event_name}),(0,f.jsx)("div",{className:"h-0.5 w-24 bg-red-500 mb-4"}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-4 text-sm",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 bg-gray-800 rounded-full px-4 py-2 text-gray-300",children:[(0,f.jsx)(Ke.A,{className:"h-4 w-4 text-gray-500"}),(0,f.jsx)("span",{children:b.client_company})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2 bg-gray-800 rounded-full px-4 py-2 text-gray-300",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-gray-500"}),(0,f.jsx)("span",{children:b.venue})]})]}),b.event_website&&(0,f.jsxs)("a",{href:b.event_website,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center space-x-2 mt-4 px-4 py-2 bg-gray-800 hover:bg-gray-700 border border-gray-700 rounded-lg text-sm font-medium text-blue-400 transition-colors",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"View Event Website"})]})]}),(0,f.jsx)("div",{className:"px-6 py-6 sm:px-8 bg-gray-900 border-t border-gray-800",children:"single"===b.event_duration_type?(0,f.jsxs)("div",{className:"grid sm:grid-cols-3 gap-4",children:[(0,f.jsxs)("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-500 text-sm font-medium mb-2",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Date"})]}),(0,f.jsx)("p",{className:"text-gray-100 font-semibold",children:J(b.event_date)})]}),(0,f.jsxs)("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-500 text-sm font-medium mb-2",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Start"})]}),(0,f.jsxs)("p",{className:"text-gray-100 font-semibold text-xl",children:[Y(b.start_time)||"TBC",b.event_timezone&&"Australia/Melbourne"!==b.event_timezone&&(0,f.jsx)("span",{className:"text-sm text-gray-500 ml-1",children:(0,zo.iU)(b.event_timezone)})]})]}),(0,f.jsxs)("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-500 text-sm font-medium mb-2",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"End"})]}),(0,f.jsxs)("p",{className:"text-gray-100 font-semibold text-xl",children:[Y(b.end_time)||"TBC",b.event_timezone&&"Australia/Melbourne"!==b.event_timezone&&(0,f.jsx)("span",{className:"text-sm text-gray-500 ml-1",children:(0,zo.iU)(b.event_timezone)})]})]})]}):(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2 text-red-500 font-semibold mb-4",children:[(0,f.jsx)(_t.A,{className:"h-5 w-5"}),(0,f.jsxs)("span",{children:["Multi-Day Event: ",(null===(s=b.event_days)||void 0===s?void 0:s.length)||0," Days"]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:null===(a=b.event_days)||void 0===a?void 0:a.map((e,t)=>{var s,a,n;const r=(null===(s=b.crew_members)||void 0===s?void 0:s.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];return(0,f.jsxs)("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700 flex flex-col",children:[(0,f.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,f.jsxs)("span",{className:"text-xs font-bold text-white bg-red-600 px-2 py-1 rounded",children:["DAY ",t+1]})}),(0,f.jsx)("p",{className:"font-semibold text-gray-100 text-sm",children:new Date(e.date).toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short"})}),(0,f.jsxs)("p",{className:"text-red-500 font-medium text-sm mt-1",children:[Y(e.start_time)," - ",Y(e.end_time)]}),(e.location||b.venue)&&(0,f.jsxs)("p",{className:"text-gray-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(C.A,{className:"h-3 w-3 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:e.location||b.venue})]}),(r.length>0||(null===(a=e.client_contacts)||void 0===a?void 0:a.length)>0)&&(0,f.jsx)("div",{className:"mt-3 pt-3 border-t border-gray-700 flex-1",children:(0,f.jsxs)("div",{className:"space-y-1",children:[r.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,f.jsx)(Xe.A,{className:"h-3 w-3 text-purple-400 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-medium text-gray-300 truncate",children:e.name}),(0,f.jsxs)("span",{className:"text-gray-500",children:["(",Pn(e.role),")"]})]},e.id)),null===(n=e.client_contacts)||void 0===n?void 0:n.map(e=>(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,f.jsx)(Ye.A,{className:"h-3 w-3 text-green-400 flex-shrink-0"}),(0,f.jsx)("span",{className:"font-medium text-gray-300 truncate",children:e.name}),e.role&&(0,f.jsxs)("span",{className:"text-gray-500",children:["(",e.role,")"]})]},e.id))]})})]},e.id)})})]})})]}),(null===(n=b.deliverables)||void 0===n?void 0:n.length)>0&&(0,f.jsxs)("section",{id:"deliverables",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-gray-800",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-amber-400 rounded-full mr-1"}),(0,f.jsx)(as.A,{className:"h-5 w-5 text-amber-400"}),(
10,f.jsx)("span",{children:"Deliverables"})]}),(0,f.jsx)("p",{className:"mt-1 text-sm text-gray-400 ml-3",children:"What's included with this engagement"})]}),(0,f.jsx)("div",{className:"p-6",children:(0,f.jsx)("ul",{className:"space-y-3",children:b.deliverables.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start gap-3",children:[(0,f.jsx)("span",{className:"flex-shrink-0 w-7 h-7 rounded-full bg-amber-400/15 text-amber-300 text-xs font-bold flex items-center justify-center mt-0.5",children:t+1}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"font-semibold text-gray-100 leading-snug",children:e.name}),e.description&&(0,f.jsx)("p",{className:"text-sm text-gray-400 leading-relaxed mt-0.5",children:e.description})]})]},e.id))})})]}),("single"===b.event_duration_type&&(null===(r=b.timed_events)||void 0===r?void 0:r.length)>0||"multi"===b.event_duration_type&&(null===(i=b.event_days)||void 0===i?void 0:i.length)>0)&&(0,f.jsxs)("section",{id:"timeline",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 py-4 border-b border-gray-800",children:(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-red-500 rounded-full mr-1"}),(0,f.jsx)(Nt.A,{className:"h-5 w-5 text-red-500"}),(0,f.jsx)("span",{children:"Event Timeline"})]})}),(0,f.jsx)("div",{className:"p-6",children:"single"===b.event_duration_type?(0,f.jsx)("div",{className:"space-y-3",children:K(b.timed_events).map(e=>(0,f.jsx)("div",{children:e.hasStreams?(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-24 text-right pt-2",children:(0,f.jsx)("span",{className:"inline-block px-3 py-1.5 rounded-lg text-sm font-bold ".concat(e.events.every(e=>O[e.id]||e.completed)?"bg-green-600 text-white":"bg-red-600 text-white"),children:Y(e.time)})}),(0,f.jsx)("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-3",children:e.events.map(e=>{const t=O[e.id]||e.completed;return(0,f.jsxs)("div",{onClick:()=>oe(e.id),className:"rounded-lg p-4 border-l-4 cursor-pointer transition-all ".concat(t?"bg-green-900/30 border-green-700 hover:bg-green-900/40":"bg-gray-800 border-indigo-500 hover:bg-gray-750"),children:[e.stream&&(0,f.jsx)("span",{className:"inline-block px-2 py-0.5 bg-indigo-900/50 text-indigo-300 text-xs font-semibold rounded mb-2",children:e.stream}),(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-5 h-5 rounded border-2 flex items-center justify-center transition-colors ".concat(t?"bg-green-600 border-green-600":"border-gray-600 hover:border-green-500"),children:t&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"".concat(t?"text-gray-500 line-through":"text-gray-200"),children:e.description}),e.notes&&(0,f.jsxs)("p",{className:"text-gray-400 text-sm mt-2 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),e.notes]}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),t&&e.completed_by&&(0,f.jsxs)("p",{className:"text-green-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",e.completed_by]})]})]})]},e.id)})})]}):e.events.map(e=>{const t=O[e.id]||e.completed;return(0,f.jsxs)("div",{className:"flex items-start gap-4 group",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-24 text-right",children:(0,f.jsx)("span",{className:"inline-block px-3 py-1.5 rounded-lg text-sm font-bold ".concat(t?"bg-green-600 text-white":"bg-red-600 text-white"),children:Y(e.time)})}),(0,f.jsx)("div",{onClick:()=>oe(e.id),className:"flex-1 rounded-lg p-4 border-l-4 cursor-pointer transition-all ".concat(t?"bg-green-900/30 border-green-700 hover:bg-green-900/40":"bg-gray-800 border-red-600 group-hover:bg-gray-750"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-
15 h-5 rounded border-2 flex items-center justify-center transition-colors ".concat(t?"bg-green-600 border-green-600":"border-gray-600 hover:border-green-500"),children:t&&(0,f.jsx)(p.A,{className:"h-4 w-4 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"".concat(t?"text-gray-500 line-through":"text-gray-200"),children:e.description}),e.notes&&(0,f.jsxs)("p",{className:"text-gray-400 text-sm mt-2 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),e.notes]}),e.location&&(0,f.jsx)(Io,{location:e.location,size:"xs"}),t&&e.completed_by&&(0,f.jsxs)("p",{className:"text-green-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",e.completed_by]})]})]})})]},e.id)})},e.time))}):(0,f.jsx)("div",{className:"space-y-8",children:b.event_days.map((e,t)=>{var s,a,n;const r=(null===(s=b.crew_members)||void 0===s?void 0:s.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];return(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"bg-gray-800 rounded-xl p-4 mb-4 border border-gray-700",children:(0,f.jsxs)("div",{className:"flex flex-col lg:flex-row lg:items-start lg:justify-between gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"text-lg font-bold text-gray-100",children:["Day ",t+1]}),(0,f.jsxs)("p",{className:"text-red-400 text-sm",children:[J(e.date)," \u2022 ",Y(e.start_time)," - ",Y(e.end_time)]}),(e.location||b.venue)&&(0,f.jsxs)("p",{className:"text-gray-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(C.A,{className:"h-3 w-3"}),e.location||b.venue]})]}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-2",children:[r.map(e=>(0,f.jsxs)("div",{className:"bg-gray-900 rounded-lg px-3 py-2 border border-gray-700",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Xe.A,{className:"h-4 w-4 text-red-500"}),(0,f.jsx)("span",{className:"font-semibold text-gray-200",children:e.name}),(0,f.jsx)("span",{className:"text-xs bg-red-900/50 text-red-300 px-2 py-0.5 rounded-full uppercase",children:Pn(e.role)})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat(e.mobile),className:"text-sm text-blue-400 hover:text-blue-300 font-medium mt-1 block",children:e.mobile})]},e.id)),null===(a=e.client_contacts)||void 0===a?void 0:a.map(e=>(0,f.jsxs)("div",{className:"bg-gray-900 rounded-lg px-3 py-2 border border-green-800",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Ye.A,{className:"h-4 w-4 text-green-400"}),(0,f.jsx)("span",{className:"font-semibold text-gray-200",children:e.name}),e.role&&(0,f.jsx)("span",{className:"text-xs bg-green-900/50 text-green-300 px-2 py-0.5 rounded-full uppercase",children:e.role})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat(e.mobile),className:"text-sm text-green-400 hover:text-green-300 font-medium mt-1 block",children:e.mobile})]},e.id))]})]})}),(null===(n=e.timed_events)||void 0===n?void 0:n.length)>0&&(0,f.jsx)("div",{className:"space-y-3 ml-4",children:K(e.timed_events).map(t=>
1(0,f.jsx)("div",{children:t.hasStreams?(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-20 text-right pt-2",children:(0,f.jsx)("span",{className:"inline-block px-2 py-1 rounded text-sm font-bold ".concat(t.events.every(e=>O[e.id]||e.completed)?"bg-green-600 text-white":"bg-red-600 text-white"),children:Y(t.time)})}),(0,f.jsx)("div",{className:"flex-1 grid grid-cols-1 sm:grid-cols-2 gap-3",children:t.events.map(t=>{const s=O[t.id]||t.completed;return(0,f.jsxs)("div",{onClick:()=>oe(t.id,e.id),className:"rounded-lg p-3 border-l-4 cursor-pointer transition-all ".concat(s?"bg-green-900/30 border-green-700 hover:bg-green-900/40":"bg-gray-800 border-indigo-500 hover:bg-gray-750"),children:[t.stream&&(0,f.jsx)("span",{className:"inline-block px-2 py-0.5 bg-indigo-900/50 text-indigo-300 text-xs font-semibold rounded mb-2",children:t.stream}),(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded border-2 flex items-center justify-center transition-colors ".concat(s?"bg-green-600 border-green-600":"border-gray-600 hover:border-green-500"),children:s&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm ".concat(s?"text-gray-500 line-through":"text-gray-200"),children:t.description}),t.notes&&(0,f.jsxs)("p",{className:"text-gray-400 text-xs mt-1 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),t.notes]}),t.location&&(0,f.jsx)(Io,{location:t.location,size:"xs"}),s&&t.completed_by&&(0,f.jsxs)("p",{className:"text-green-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",t.completed_by]})]})]})]},t.id)})})]}):t.events.map(t=>{const s=O[t.id]||t.completed;return(0,f.jsxs)("div",{className:"flex items-start gap-4 group",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-20 text-right",children:(0,f.jsx)("span",{className:"inline-block px-2 py-1 rounded text-sm font-bold ".concat(s?"bg-green-600 text-white":"bg-red-600 text-white"),children:Y(t.time)})}),(0,f.jsx)("div",{onClick:()=>oe(t.id,e.id),className:"flex-1 rounded-lg p-3 border-l-4 cursor-pointer transition-all ".concat(s?"bg-green-900/30 border-green-700 hover:bg-green-900/40":"bg-gray-800 border-red-600 hover:bg-gray-750"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"flex-shrink-0 mt-0.5 w-4 h-4 rounded border-2 flex items-center justify-center transition-colors ".concat(s?"bg-green-600 border-green-600":"border-gray-600 hover:border-green-500"),children:s&&(0,f.jsx)(p.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"text-sm ".concat(s?"text-gray-500 line-through":"text-gray-200"),children:t.description}),t.notes&&(0,f.jsxs)("p",{className:"text-gray-400 text-xs mt-1 italic flex items-center gap-1 whitespace-pre-line",children:[(0,f.jsx)(kt.A,{className:"h-3 w-3"}),t.notes]}),t.location&&(0,f.jsx)(Io,{location:t.location,size:"xs"}),s&&t.completed_by&&(0,f.jsxs)("p",{className:"text-green-400 text-xs mt-1 flex items-center gap-1",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Completed by ",t.completed_by]})]})]})})]},t.id)})},t.time))})]},e.id)})})})]}),(null===(o=b.voxpops)||void 0===o?void 0:o.enabled)&&(e=>{const t=Pi(b.voxpops),s=t.length>1;return(0,f.jsxs)("section",{id:"voxpops",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-gray-800",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2 flex-wrap",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-emerald-500 rounded-full mr-1"}),(0,f.jsx)(Di.A,{className:"h-5 w-5 text-emerald-500"}),(0,f.jsx)("span",{children:"Voxpops"}),pe.length>0&&(0,f.jsxs)("span",{className:"text-sm font-medium text-emerald-400",children:["\u2014 Filmed by ",pe.map(e=>
1e.name).join(", ")]})]}),(0,f.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:"Turbo 360 crew will focus on sound and visual quality. Client to arrange the talent and ask the questions."})]}),(0,f.jsxs)("div",{className:"p-6 space-y-6",children:[t.map((e,t)=>(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[s?(0,f.jsxs)("p",{className:"text-xs font-semibold uppercase tracking-wider ".concat(e.completed?"text-emerald-300/60 line-through":"text-emerald-400"),children:["Subject ",t+1]}):(0,f.jsx)("span",{}),me&&e.id&&(0,f.jsxs)("button",{type:"button",onClick:()=>me(e.id),className:"inline-flex items-center gap-1.5 text-xs font-medium rounded-full px-3 py-1 border transition-colors ".concat(e.completed?"bg-emerald-600 text-white border-emerald-600":"bg-transparent text-emerald-400 border-emerald-500/50 hover:bg-emerald-500/10"),children:[(0,f.jsx)(p.A,{className:"h-3.5 w-3.5"}),e.completed?"Captured":"Mark captured"]})]}),(0,f.jsxs)("div",{className:"grid sm:grid-cols-3 gap-4 ".concat(e.completed?"opacity-60":""),children:[e.time&&(0,f.jsxs)("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-500 font-medium mb-1",children:"Time"}),(0,f.jsx)("p",{className:"text-gray-100 font-semibold",children:Y(e.time)})]}),e.contact_name&&(0,f.jsxs)("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-500 font-medium mb-1",children:"Contact"}),(0,f.jsx)("p",{className:"text-gray-100 font-semibold",children:e.contact_name})]}),e.meeting_point&&(0,f.jsxs)("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700",children:[(0,f.jsx)("p",{className:"text-sm text-emerald-500 font-medium mb-1",children:"Meeting Point"}),(0,f.jsx)("p",{className:"text-gray-100 font-semibold",children:e.meeting_point})]})]})]},e.id||t)),(null===(e=b.voxpops.questions)||void 0===e?void 0:e.length)>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-emerald-500 uppercase tracking-wider mb-3",children:"Suggested Questions"}),(0,f.jsx)("ol",{className:"space-y-2",children:b.voxpops.questions.filter(e=>e).map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start space-x-3 bg-gray-800 rounded-lg p-3 border border-gray-700",children:[(0,f.jsx)("span",{className:"flex-shrink-0 w-6 h-6 bg-emerald-500/20 text-emerald-400 rounded-full flex items-center justify-center text-sm font-bold",children:t+1}),(0,f.jsx)("span",{className:"text-gray-300",children:e})]},t))})]})]})]})})(),(null===(l=b.crew_members)||void 0===l?void 0:l.length)>0&&(0,f.jsxs)("section",{id:"crew",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 py-4 border-b border-gray-800",children:(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-red-500 rounded-full mr-1"}),(0,f.jsx)(Xe.A,{className:"h-5 w-5 text-red-500"}),(0,f.jsxs)("span",{children:["Crew (",b.crew_members.length,")"]})]})}),(0,f.jsx)("div",{className:"p-6",children:(0,f.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:b.crew_members.map(e=>(0,f.jsxs)("div",{className:"bg-gray-800 rounded-xl p-4 border border-gray-700 hover:bg-gray-750 transition-colors",children:[(0,f.jsx)("div",{className:"flex items-start justify-between mb-3",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold text-gray-100",children:e.name}),(0,f.jsx)("p",{className:"text-sm text-red-400 font-medium uppercase",children:Pn(e.role)}),(e.start_time||e.end_time)&&(0,f.jsxs)("p",{className:"text-xs text-gray-400 mt-1 flex items-center gap-1 font-mono",children:[(0,f.jsx)(Nt.A,{className:"h-3 w-3"}),e.start_time||b.start_time||"09:00"," \u2013 ",e.end_time||b.end_time||"17:00"]})]})}),(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center space-x-2 text-gray-400 hover:text-blue-400 transition-colors",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"font-medium",children:e.mobile})]})]},e.id))})})]}),(0,f.jsxs)("section",{id:"contact",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-gray-800 flex justify-between items-center",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-red-500 rounded-full mr-1"}),(0,f.jsx)(Ye.A,{className:"h-5 w-5 text-red-500"}),(0,f.jsxs)("span",{children:["Client Contact",(null===(c=b.client_contacts)||void 0===c?void 0:c.length)>1?"s":""]})]}),!S&&!(null!==(d=b.client_contacts)&&void 0!==d&&d.length)&&(0,f.jsxs)("button",{onClick:X,className:"flex items-center space-x-1 px-3 py-1.5 bg-blue-600 hover:bg-blue-500 text-white rounded-lg text-sm font-medium transition-colors print:hidden",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]})]}),(0,f.jsx)("div",{className:"p-6",children:(null===(x=b.client_contacts)||void 0===x?void 0:x.length)>0?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,f.jsx)(Ke.A,{className:"h-5 w-5 text-gray-500"}),(0,f.jsx)("span",{className:"font-semibold text-lg text-gray-100",children:b.client_company})]}),(0,f.jsx)("div",{className:"grid sm:grid-cols-2 gap-4",children:b.client_contacts.map(e=>(0,f.jsxs)("div",{className:"rounded-xl p-4 border-2 ".concat(e.is_primary?"bg-red-950/30 border-red-800":"bg-gray-800 border-gray-700"),children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold text-gray-100",children:e.name}),e.role&&(0,f.jsx)("span",{className:"inline-block text-xs px-2 py-0.5 rounded-full mt-1 ".concat(e.is_primary?"bg-red-900/50 text-red-300":"bg-gray-700 text-gray-400"),children:e.role})]}),e.is_primary&&(0,f.jsx)("span",{className:"text-xs bg-red-600 text-white px-2 py-1 rounded-full font-medium",children:"Primary"})]}),(0,f.jsxs)("div",{className:"space-y-1 mt-3",children:[e.email&&(0,f.jsxs)("a",{href:"mailto:".concat(e.email),className:"flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),e.email]}),e.mobile&&(0,f.jsxs)("a",{href:"tel:".concat(e.mobile),className:"flex items-center gap-2 text-sm text-blue-400 hover:text-blue-300",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),e.mobile]})]})]},e.id))}),b.additional_notes&&(0,f.jsxs)("div",{className:"pt-4 border-t border-gray-800",children:[(0,f.jsx)("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1",children:"Additional Notes"}),(0,f.jsx)("p",{className:"text-gray-300",children:b.additional_notes})]})]}):S?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-gray-400 font-medium mb-1 block",children:"Name"}),(0,f.jsx)("input",{type:"text",value:F.primary_contact,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{primary_contact:e.target.value})),className:"w-full px-3 py-2 border border-gray-700 rounded-lg bg-gray-800 text-gray-100 focus:ring-2 focus:ring-red-500 focus:border-transparent placeholder-gray-500",placeholder:"Primary contact name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-gray-400 font-medium mb-1 block",children:"Company"}),(0,f.jsx)("input",{type:"text",value:b.client_company,disabled:!0,className:"w-full px-3 py-2 border border-gray-700 rounded-lg bg-gray-900 text-gray-500"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-gray-400 font-medium mb-1 block",children:"Email"}),(0,f.jsx)("input",{type:"email",value:F.email,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{email:e.target.value})),className:"w-full px-3 py-2 border border-gray-700 rounded-lg bg-gray-800 text-gray-100 focus:ring-2 focus:ring-red-500 focus:border-transparent placeholder-gray-500",placeholder:"[email protected]"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-gray-400 font-medium mb-1 block",children:"Mobile"}),(0,f.jsx)("input",{type:"tel",value:F.mobile,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{mobile:e.target.value})),className:"w-full px-3 py-2 border border-gray-700 rounded-lg bg-gray-800 text-gray-100 focus:ring-2 focus:ring-red-500 focus:border-transparent placeholder-gray-500",placeholder:"Mobile number"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"text-sm text-gray-400 font-medium mb-1 block",children:"Additional Notes"}),(0,f.jsx)("textarea",{value:F.additional_notes,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{additional_notes:e.target.value})),className:"w-full px-3 py-2 border border-gray-700 rounded-lg bg-gray-800 text-gray-100 focus:ring-2 focus:ring-red-500 focus:border-transparent placeholder-gray-500",rows:"2",placeholder:"Any additional notes..."})]}),(0,f.jsxs)("div",{className:"flex justify-end space-x-2 pt-2",children:[(0,f.jsx)("button",{onClick:ee,disabled:I,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:te,disabled:I,className:"flex items-center space-x-1 px-4 py-2 bg-green-600 hover:bg-green-500 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:I?"Saving...":"Save"})]})]})]}):(0,f.jsxs)("div",{className:"grid sm:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1",children:"Name"}),(0,f.jsx)("p",{className:"font-semibold text-gray-100",children:b.primary_contact||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1",children:"Company"}),(0,f.jsx)("p",{className:"font-semibold text-gray-100",children:b.client_company})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1",children:"Email"}),(0,f.jsx)("a",{href:"mailto:".concat(b.email),className:"font-medium text-blue-400 hover:text-blue-300",children:b.email||"\u2014"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1",children:"Mobile"}),(0,f.jsx)("a",{href:"tel:".concat(b.mobile),className:"font-medium text-blue-400 hover:text-blue-300",children:b.mobile||"\u2014"})]}),b.additional_notes&&(0,f.jsxs)("div",{className:"sm:col-span-2 pt-4 border-t border-gray-800",children:[(0,f.jsx)("p",{className:"text-xs text-gray-500 uppercase tracking-wider mb-1",children:"Additional Notes"}),(0,f.jsx)("p",{className:"text-gray-300",children:b.additional_notes})]})]})})]}
1),(b.supporting_documents&&b.supporting_documents.length>0||b.client_brief_file)&&(0,f.jsxs)("section",{id:"documents",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 py-4 border-b border-gray-800",children:(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-red-500 rounded-full mr-1"}),(0,f.jsx)(kt.A,{className:"h-5 w-5 text-blue-400"}),(0,f.jsx)("span",{children:"Supporting Documents"})]})}),(0,f.jsxs)("div",{className:"p-6 space-y-3",children:[null===(h=b.supporting_documents)||void 0===h?void 0:h.map((e,t)=>e.external_url?(0,f.jsxs)("a",{href:e.external_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gray-800 rounded-xl p-4 border border-indigo-500/40 hover:bg-gray-750 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 min-w-0",children:[(0,f.jsx)("div",{className:"bg-indigo-500 text-white rounded-lg p-2 flex-shrink-0",children:(0,f.jsx)(En.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("p",{className:"font-medium text-gray-100 truncate",children:e.title||e.external_url}),(0,f.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.external_url})]})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-1 px-4 py-2 bg-indigo-500 hover:bg-indigo-600 text-white rounded-lg text-sm font-medium transition-colors flex-shrink-0 ml-3",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Open"})]})]},e.link_id||t):(0,f.jsxs)("div",{className:"flex items-center justify-between bg-gray-800 rounded-xl p-4 border border-gray-700 hover:bg-gray-750 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("div",{className:"bg-blue-600 text-white rounded-lg p-2",children:(0,f.jsx)(kt.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-100",children:e.original_filename||"Document"}),(0,f.jsx)("p",{className:"text-xs text-gray-500",children:e.file_size?"".concat((e.file_size/1024/1024).toFixed(2)," MB"):""})]})]}),(0,f.jsxs)("button",{onClick:()=>ce(e),className:"flex items-center space-x-1 px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]},e.file_key||t)),b.client_brief_file&&(!b.supporting_documents||0===b.supporting_documents.length)&&(0,f.jsxs)("div",{className:"flex items-center justify-between bg-gray-800 rounded-xl p-4 border border-gray-700 hover:bg-gray-750 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("div",{className:"bg-blue-600 text-white rounded-lg p-2",children:(0,f.jsx)(kt.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-100",children:b.client_brief_file.original_filename||"Document"}),(0,f.jsx)("p",{className:"text-xs text-gray-500",children:b.client_brief_file.file_size?"".concat((b.client_brief_file.file_size/1024/1024).toFixed(2)," MB"):""})]})]}),(0,f.jsxs)("button",{onClick:()=>ce(b.client_brief_file),className:"flex items-center space-x-1 px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Download"})]})]})]})]}),(0,f.jsxs)("section",{id:"briefing",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-gray-800 flex justify-between items-center",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-red-500 rounded-full mr-1"}),(0,f.jsx)(oa.A,{className:"h-5 w-5 text-amber-500"}),(0,f.jsx)("span",{children:"Special Briefing Notes"})]}),!_&&(0,f.jsxs)("button",{onClick:se,className:"flex items-center space-x-1 px-3 py-1.5 bg-blue-600 hover:bg-blue-500 text-white rounded-lg text-sm font-medium transition-colors print:hidden",children:[(0,f.jsx)(oa.A,{className:"h-3 w-3"}),(0,f.jsx)("span",{children:"Edit"})]})]}),(0,f.jsx)("div",{className:"p-6",children:_?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("textarea",{value:B,onChange:e=>D(e.target.value),className:"w-full px-3 py-2 border border-gray-700 rounded-lg bg-gray-800 text-gray-100 focus:ring-2 focus:ring-red-500 focus:border-transparent placeholder-gray-500",rows:"5",placeholder:"Add any special briefing notes for the crew..."}),(0,f.jsxs)("div",{className:"flex justify-end space-x-2",children:[(0,f.jsx)("button",{onClick:ae,disabled:I,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:ne,disabled:I,className:"flex items-center space-x-1 px-4 py-2 bg-green-600 hover:bg-green-500 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:I?"Saving...":"Save"})]})]})]}):(0,f.jsx)("div",{className:"bg-amber-950/30 rounded-lg p-4 border-l-4 border-amber-500",children:b.special_briefing_notes?(0,f.jsx)("p",{className:"text-gray-300 whitespace-pre-wrap",children:b.special_briefing_notes}):(0,f.jsx)("p",{className:"text-gray-500 italic",children:"No briefing notes added yet. Click 'Edit' to add notes."})})})]}),(Z()&&j||$()&&w)&&(0,f.jsxs)("section",{id:"imagery-standards",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 py-4 border-b border-gray-800",children:(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-red-500 rounded-full mr-1"}),(0,f.jsx)(Ue.A,{className:"h-5 w-5 text-indigo-400"}),(0,f.jsx)("span",{children:"Imagery Standards"})]})}),(0,f.jsxs)("div",{className:"p-6 space-y-6",children:[Z()&&j&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"font-semibold text-gray-100 flex items-center space-x-2 mb-3",children:[(0,f.jsx)(Ue.A,{className:"h-4 w-4 text-indigo-400"}),(0,f.jsx)("span",{children:"Photography Standards"})]}),(0,f.jsx)("div",{className:"bg-indigo-950/30 rounded-lg p-4 border-l-4 border-indigo-500 prose prose-sm prose-invert max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-gray-300",dangerouslySetInnerHTML:{__html:or.default.sanitize(j)}})]}),$()&&w&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("h3",{className:"font-semibold text-gray-100 flex items-center space-x-2 mb-3",children:[(0,f.jsx)(Ge.A,{className:"h-4 w-4 text-purple-400"}),(0,f.jsx)("span",{children:"Videography Standards"})]}),(0,f.jsx)("div",{className:"bg-purple-950/30 rounded-lg p-4 border-l-4 border-purple-500 prose prose-sm prose-invert max-w-none prose-ul:list-disc prose-ul:pl-4 prose-li:my-1 text-gray-300",dangerouslySetInnerHTML:{__html:or.default.sanitize(w)}})]})]})]}),b.must_capture_checklist&&b.must_capture_checklist.length>0&&(0,f.jsxs)("section",{id:"checklist",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-gray-800 flex justify-between items-center",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-red-500 rounded-full mr-1"}),(0,f.jsx)(p.A,{className:"h-5 w-5 text-purple-400"}),(0,f.jsx)("span",{children:"Must-Capture Checklist"})]}),(0,f.jsxs)("span",{className:"text-sm font-medium text-purple-300 bg-purple-900/50 px-3 py-1 rounded-full border border-purple-800",children:[Object.values(P).filter(
1Boolean).length," / ",b.must_capture_checklist.length]})]}),(0,f.jsxs)("div",{className:"p-6",children:[(0,f.jsx)("p",{className:"text-sm text-purple-300 mb-4",children:"Click items as you complete them. Progress is saved automatically."}),(0,f.jsx)("div",{className:"space-y-2",children:b.must_capture_checklist.sort((e,t)=>e.order-t.order).map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-all group ".concat(P[e.id]?"bg-green-900/30 border-green-700":"bg-gray-800 border-gray-700 hover:border-gray-600"),children:[(0,f.jsx)("input",{type:"checkbox",checked:P[e.id]||!1,onChange:()=>re(e.id),className:"w-5 h-5 text-purple-600 border-2 border-purple-400 rounded focus:ring-2 focus:ring-purple-500 bg-gray-700"}),(0,f.jsx)("span",{className:"flex-1 ".concat(P[e.id]?"line-through text-gray-500":"text-gray-200"," transition-all"),children:e.text})]},e.id))})]})]}),b.priority_sponsor_stands&&b.priority_sponsor_stands.length>0&&(0,f.jsxs)("section",{id:"sponsor-stands",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsxs)("div",{className:"px-6 py-4 border-b border-gray-800 flex justify-between items-center",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-rose-500 rounded-full mr-1"}),(0,f.jsx)(p.A,{className:"h-5 w-5 text-rose-400"}),(0,f.jsx)("span",{children:"Priority Sponsor Stands"})]}),(0,f.jsxs)("span",{className:"text-sm font-medium text-rose-300 bg-rose-900/50 px-3 py-1 rounded-full border border-rose-800",children:[Object.values(W).filter(Boolean).length," / ",b.priority_sponsor_stands.length]})]}),(0,f.jsxs)("div",{className:"p-6",children:[(0,f.jsx)("p",{className:"text-sm text-rose-300 mb-4",children:"Please ensure you capture at least one strong shot at each of the following stands with clear branding and visible attendee engagement."}),(0,f.jsx)("div",{className:"space-y-2",children:b.priority_sponsor_stands.sort((e,t)=>e.order-t.order).map(e=>(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition-all group ".concat(W[e.id]?"bg-green-900/30 border-green-700":"bg-gray-800 border-gray-700 hover:border-gray-600"),children:[(0,f.jsx)("input",{type:"checkbox",checked:W[e.id]||!1,onChange:()=>ie(e.id),className:"w-5 h-5 text-rose-600 border-2 border-rose-400 rounded focus:ring-2 focus:ring-rose-500 bg-gray-700"}),(0,f.jsx)("span",{className:"flex-1 ".concat(W[e.id]?"line-through text-gray-500":"text-gray-200"," transition-all"),children:e.text})]},e.id))})]})]}),(b.show_crew_upload_instructions||b.show_generic_upload_instructions||b.masv_portal_url)&&(0,f.jsxs)("section",{id:"upload",className:"bg-gray-900/80 rounded-xl shadow-lg border border-gray-800 overflow-hidden",children:[(0,f.jsx)("div",{className:"px-6 py-4 border-b border-gray-800",children:(0,f.jsxs)("h2",{className:"text-lg font-semibold text-gray-100 flex items-center space-x-2",children:[(0,f.jsx)("div",{className:"w-1 h-6 bg-red-500 rounded-full mr-1"}),(0,f.jsx)(_s.A,{className:"h-5 w-5 text-red-500"}),(0,f.jsx)("span",{children:"Crew Upload Instructions"})]})}),(0,f.jsx)("div",{className:"p-6",children:b.masv_portal_url?(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("p",{className:"text-gray-300",children:"Upload your RAW video and photo files directly from your browser \u2014 no software installation required."}),(0,f.jsxs)("a",{href:b.masv_portal_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-3 bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-500 hover:to-indigo-500 text-white rounded-xl p-5 transition-colors text-center border border-violet-500/30",children:[(0,f.jsx)(_s.A,{className:"h-6 w-6"}),(0,f.jsx)("span",{className:"font-semibold text-lg",children:"Upload Files"})]}),b.masv_job_code&&(0,f.jsx)("div",{className:"bg-amber-950/30 border border-amber-800 rounded-lg p-3",children:(0,f.jsxs)("p",{className:"text-amber-300 text-sm font-medium",children:[(0,f.jsx)("span",{className:"font-semibold",children:"Job Code:"})," ",b.masv_job_code]})})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"text-gray-300 mb-6",children:"Download and install the Turbo Crew Upload software:"}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-arm64.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gray-800 hover:bg-gray-750 text-white rounded-xl p-4 transition-colors border border-gray-700",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold",children:"Crew Upload (Apple Silicon).dmg"}),(0,f.jsx)("p",{className:"text-xs text-gray-400",children:"For Apple Silicon Macs (M1, M2, M3, M4)"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5 text-gray-400"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gray-800 hover:bg-gray-750 text-white rounded-xl p-4 transition-colors border border-gray-700",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold",children:"Crew Upload (Intel).dmg"}),(0,f.jsx)("p",{className:"text-xs text-gray-400",children:"For Intel Macs"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5 text-gray-400"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-Setup.exe",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-blue-950/50 hover:bg-blue-950/70 text-white rounded-xl p-4 transition-colors border border-blue-800",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M3 12V6.75l6-1.32v6.48L3 12zm17-9v8.75l-10 .15V5.21L20 3zM3 13l6 .09v6.81l-6-1.15V13zm17 .25V22l-10-1.91V13.1l10 .15z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold",children:"Crew Upload Setup.exe"}),(0,f.jsx)("p",{className:"text-xs text-blue-300",children:"For Windows"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5 text-blue-400"})]})]}),(0,f.jsx)("div",{className:"mt-4 bg-amber-950/30 border border-amber-800 rounded-lg p-3",children:(0,f.jsxs)("p",{className:"text-amber-300 text-sm font-medium",children:[(0,f.jsx)("span",{className:"font-semibold",children:"Upload Password:"})," tcrew26"]})})]})})]}),(0,f.jsx)("section",{className:"bg-gray-900 border border-gray-800 text-white rounded-xl overflow-hidden",children:(0,f.jsxs)("div",{className:"p-6 text-center",children:[(0,f.jsx)("div",{className:"bg-gray-800 rounded-xl p-4 mb-4 inline-block border border-gray-700",children:(0,f.jsxs)("div",{className:"flex items-center justify-center space-x-3",children:[(0,f.jsx)(E.A,{className:"h-6 w-6 text-red-500"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm text-gray-400",children:"Emergency Contact"}),(0,f.jsx)("p",{className:"text-2xl font-bold text-gray-100",children:"1300 207 446"})]})]})}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-2 text-sm text-gray-500",children:[(0,f.jsxs)("span",{children:["\xa9 ",(new Date).getFullYear()," Turbo 360"]}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"\u2022"}),(0,f.jsx)("span",{children:"[email protected]"})]})]})})]})})]})})]})},Vo={modern:To,classic:To,"classic-legacy":Ro,"classic-pro":Mo,minimal:qo,bold:Ho,elegant:Uo,dark:Go},Jo=[{id:"modern",name:"Modern",description:"Dark hero, sticky jump-nav, clean cards (default)",color:"#0b0d12"}
1,{id:"classic-pro",name:"Classic Pro",description:"Mobile-first, colour-coded sections, dashboard tiles",color:"#9333ea"},{id:"minimal",name:"Minimal",description:"Clean, whitespace-focused, single column layout",color:"#f9fafb"},{id:"bold",name:"Bold",description:"High-impact, strong typography, vibrant accents",color:"#0f172a"},{id:"elegant",name:"Elegant",description:"Premium feel, serif typography, gold accents",color:"#d97706"},{id:"dark",name:"Dark",description:"Dark mode, editorial, high contrast",color:"#030712"},{id:"classic-legacy",name:"Classic (legacy)",description:"Original sidebar-nav layout",color:"#475569"}],Yo=e=>{let{allClients:t=[],selectedContactId:s,onContactSelect:n,label:r="Select Client & Contact"}=e;const[i,o]=(0,a.useState)(""),[l,c]=(0,a.useState)(null),[d,m]=(0,a.useState)(null),[p,x]=(0,a.useState)([]),[h,u]=(0,a.useState)(!1),b=t.filter(e=>!0===e.is_company),y=t.filter(e=>!e.is_company),v=e=>e.contact_name?e.contact_name:e.first_name&&e.last_name?"".concat(e.first_name," ").concat(e.last_name):e.first_name||e.last_name||e.email||"Unnamed Contact",j=b.filter(e=>{var t;return null===(t=e.company_name)||void 0===t?void 0:t.toLowerCase().includes(i.toLowerCase())}),w=y.filter(e=>{var t,s,a;const n=v(e).toLowerCase(),r=i.toLowerCase();return n.includes(r)||(null===(t=e.email)||void 0===t?void 0:t.toLowerCase().includes(r))||(null===(s=e.position)||void 0===s?void 0:s.toLowerCase().includes(r))||(null===(a=e.parent_company_name)||void 0===a?void 0:a.toLowerCase().includes(r))});(0,a.useEffect)(()=>{if(s&&t.length>0){const e=t.find(e=>e.id===s);if(e&&(m(e),e.parent_company_id)){const s=t.find(t=>t.id===e.parent_company_id);if(s){c(s),o("");const e=t.filter(e=>!e.is_company&&e.parent_company_id===s.id);x(e)}}}else s||(c(null),m(null),o(""),x([]))},[s,t]);const N=j.length>0||w.length>0;return(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-900 uppercase tracking-wide",children:r}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",value:i,onChange:e=>{o(e.target.value),u(!0)},onFocus:()=>
1u(!0),placeholder:"Search by company or contact name...",className:"w-full pl-10 pr-10 py-3 bg-white border-2 border-gray-300 rounded-lg text-gray-900 placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500",disabled:!(!l||!d)}),(l||d)&&(0,f.jsx)("button",{onClick:()=>{o(""),c(null),m(null),x([]),n("")},className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-red-600 transition-colors",title:"Clear selection",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),h&&i&&!(l&&d)&&N&&(0,f.jsxs)("div",{className:"absolute z-50 w-full mt-2 bg-white border-2 border-gray-300 rounded-lg shadow-lg max-h-80 overflow-y-auto",children:[j.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"px-4 py-2 bg-blue-50 border-b border-blue-200 sticky top-0",children:(0,f.jsx)("div",{className:"text-xs font-bold text-blue-900 uppercase tracking-wide",children:"Companies"})}),j.map(e=>(0,f.jsxs)("button",{onClick:()=>(e=>{c(e),o(""),u(!1);const s=t.filter(t=>!t.is_company&&t.parent_company_id===e.id);x(s),m(null),n("")})(e),className:"w-full px-4 py-3 text-left hover:bg-blue-50 transition-colors flex items-center gap-3 border-b border-gray-100",children:[(0,f.jsx)(gs.A,{className:"h-5 w-5 text-blue-600 flex-shrink-0"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-semibold text-gray-900",children:e.company_name}),e.email&&(0,f.jsx)("div",{className:"text-sm text-gray-500",children:e.email})]})]},"company-".concat(e.id)))]}),w.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"px-4 py-2 bg-purple-50 border-b border-purple-200 sticky top-0",children:(0,f.jsx)("div",{className:"text-xs font-bold text-purple-900 uppercase tracking-wide",children:"Contacts"})}),w.map(e=>(0,f.jsxs)("button",{onClick:()=>(e=>{if(e.parent_company_id){const s=t.find(t=>t.id===e.parent_company_id);if(s){c(s);const e=t.filter(e=>!e.is_company&&e.parent_company_id===s.id);x(e)}}m(e),o(""),u(!1),n(e)})(e),className:"w-full px-4 py-3 text-left hover:bg-purple-50 transition-colors flex items-center gap-3 border-b border-gray-100",children:[(0,f.jsx)(Ye.A,{className:"h-5 w-5 text-purple-600 flex-shrink-0"}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("div",{className:"font-semibold text-gray-900",children:v(e)}),(0,f.jsx)("div",{className:"text-sm text-gray-600",children:e.parent_company_name&&(0,f.jsxs)("span",{className:"flex items-center gap-1",children:[(0,f.jsx)(gs.A,{className:"h-3 w-3"}),e.parent_company_name]})}),e.email&&(0,f.jsx)("div",{className:"text-xs text-gray-500",children:e.email})]})]},"contact-".concat(e.id)))]})]}),h&&i&&!N&&(0,f.jsxs)("div",{className:"absolute z-50 w-full mt-2 bg-white border-2 border-gray-300 rounded-lg shadow-lg p-4 text-center text-gray-500",children:['No companies or contacts found matching "',(0,f.jsx)("strong",{children:i}),'"']})]}),l&&(0,f.jsx)("div",{className:"p-4 bg-green-50 border-2 border-green-200 rounded-lg",children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)(zt.A,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("div",{className:"font-bold text-green-900 mb-1",children:"Company Selected"}),(0,f.jsx)("div",{className:"text-sm text-green-800",children:l.company_name})]})]})}),l&&!d&&(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-semibold text-gray-700 mb-2",children:"Select Contact *"}),p.length>0?(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Ye.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400 pointer-events-none"}),(0,f.jsxs)("select",{value:(null===d||void 0===d?void 0:d.id)||"",onChange:e=>{const s=e.target.value;if(!s)return m(null),void n("");const a=t.find(e=>e.id===s);a&&(m(a),n(a))},className:"w-full pl-10 pr-4 py-3 bg-white border-2 border-gray-300 rounded-lg text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 appearance-none cursor-pointer",children:[(0,f.jsx)("option",{value:"",children:"-- Select a contact --"}),p.map(e=>(0,f.jsxs)("option",{value:e.id,children:[v(e),e.position?" - ".concat(e.position):"",e.email?" (".concat(e.email,")"):""]},e.id))]})]}):(0,f.jsxs)("div",{className:"p-4 bg-amber-50 border-2 border-amber-200 rounded-lg text-amber-800 text-sm",children:[(0,f.jsx)("strong",{children:"No contacts found"})," for this company. Please add contacts to this company first."]})]}),d&&(0,f.jsx)("div",{className:"p-4 bg-blue-50 border-2 border-blue-200 rounded-lg",children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)(Ye.A,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("div",{className:"font-bold text-blue-900 mb-1",children:"Contact Selected"}),(0,f.jsxs)("div",{className:"text-sm text-blue-800",children:[v(d),d.position&&" - ".concat(d.position)]}),d.email&&(0,f.jsx)("div",{className:"text-sm text-blue-700",children:d.email}),d.phone&&(0,f.jsx)("div",{className:"text-sm text-blue-700",children:d.phone})]})]})}),!l&&!d&&(0,f.jsx)("p",{className:"text-xs text-gray-500 italic",children:"\ud83d\udca1 Search by company name or contact name. Select from results to continue."})]})},Ko={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14,overflow:"hidden"},Zo={display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13,cursor:"pointer",whiteSpace:"nowrap"};function $o(e){let{label:t,placeholder:s,value:n,countLabel:r,onChange:i}=e;
1const[o,l]=a.useState(""),[c,d]=a.useState(!1),[m,p]=a.useState(null),x=async()=>{const e=o.trim();if(e&&!c){d(!0),p(null);try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/corporate-admin/linked-media/resolve"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify({url:e})}),n=await a.json();if(!a.ok)throw new Error((null===n||void 0===n?void 0:n.detail)||"Could not read that link");i(n.media),l("")}catch(s){p(s.message||"Could not read that link")}finally{d(!1)}}};if(null!==n&&void 0!==n&&n.share_url){const e=r?r(n):null;return(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:t}),(0,f.jsxs)("div",{className:"flex items-center gap-3 p-3 border border-slate-200 rounded-xl bg-slate-50",children:[n.thumbnail?(0,f.jsx)("img",{src:n.thumbnail,alt:"",className:"w-16 h-12 object-cover rounded-lg bg-slate-200"}):(0,f.jsx)("div",{className:"w-16 h-12 rounded-lg bg-slate-200 flex items-center justify-center",children:(0,f.jsx)(Jr.A,{className:"h-4 w-4 text-slate-400"})}),(0,f.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,f.jsx)("div",{className:"text-sm font-semibold text-slate-800 truncate",children:n.name||"Untitled"}),(0,f.jsxs)("a",{href:n.share_url,target:"_blank",rel:"noreferrer",className:"text-xs text-slate-500 hover:text-slate-700 truncate block",children:[e?"".concat(e," \xb7 "):"",n.share_url]})]}),(0,f.jsx)("button",{type:"button",onClick:()=>i(null),className:"p-2 text-slate-400 hover:text-red-600","aria-label":"Remove ".concat(t),children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]})]})}return(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:t}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsx)("input",{type:"url",value:o,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),x())},placeholder:s,className:"flex-1 px-3 py-2 border border-slate-200 rounded-xl text-sm"}),(0,f.jsx)("button",{type:"button",onClick:x,disabled:c||!o.trim(),className:"px-4 py-2 bg-slate-900 text-white rounded-xl text-sm font-semibold disabled:opacity-40",children:c?"Reading\u2026":"Attach"})]}),m&&(0,f.jsx)("p",{className:"mt-1 text-xs text-red-600",children:m})]})}const Qo=()=>{var e,t,s,n,i,l,c,d,p,x,h,u;const b=(0,r.Zp)(),{eventId:y}=(0,r.g)(),[v,j]=(0,a.useState)(!!y),[w,N]=(0,a.useState)(!y),[A,k]=(0,a.useState)(null),[S,_]=(0,a.useState)({event:!0,template:!1,client:!0,contacts:!0,documents:!1,hero:!1,schedule:!0,crew:!0,briefing:!1,voxpops:!1,checklist:!1,priorityStands:!1,deliverables:!1,linkedMedia:!1,upload:!1}),F=(0,a.useRef)(null),[z,B]=(0,a.useState)({event_name:"",event_duration_type:"single",venue:"",event_website:"",contact_id:"",client_company:"",primary_contact:"",email:"",mobile:"",additional_notes:"",event_date:"",start_time:"09:00",end_time:"17:00",timed_events:[],event_days:[],crew_members:[],client_contacts:[],special_briefing_notes:"",must_capture_checklist:[],priority_sponsor_stands:[],deliverables:[],gallery:null,video_project:null,client_brief_file:null,supporting_documents:[],hero_image_url:"",show_crew_upload_instructions:!0,show_generic_upload_instructions:!1,masv_upload_enabled:!1,runsheet_template:"classic",voxpops:{enabled:!1,items:[],questions:[]},event_timezone:"Australia/Melbourne",role_variants:[]}),[D,R]=(0,a.useState)(null),[P,W]=(0,a.useState)(!1),[O,L]=(0,a.useState)(!1),[M,q]=(0,a.useState)(null);(0,a.useEffect)(()=>{const e=z.role_variants||[];0!==e.length?e.some(e=>e.role===D)||R(e[0].role):null!==D&&R(null)},[z.role_variants,D]);const[H,U]=(0,a.useState)(!1),[G,V]=(0,a.useState)(""),[J,Y]=(0,a.useState)(!1),[K,Z]=(0,a.useState)(null),[$,Q]=(0,a.useState)(!1),[X,ee]=(0,a.useState)(""),[te,se]=(0,a.useState)(!1),[ae,ne]=(0,a.useState)(""),[re,ie]=(0,a.useState)(!1),[oe,le]=(0,a.useState)(""),[ce,de]=(0,a.useState)(""),[me,pe]=(0,a.useState)(""),[xe,he]=(0,a.useState)(!1),[ue,ge]=(0,a.useState)(!1),[fe,be]=(0,a.useState)([]),[ye,ve]=(0,a.useState)([]),[je,we]=(0,a.useState)(""),[Ne,Ae]=(0,a.useState)([]),[ke,Se]=(0,a.useState)(!1),[_e,Ce]=(0,a.useState)(""),[Fe,Ee]=(0,a.useState)(null),[Te,ze]=(0,a.useState)(null),[Be,De]=(0,a.useState)(!1),[Ie,Re]=(0,a.useState)([]),[Pe,We]=(0,a.useState)(!1);(0,a.useEffect)(()=>{F.current=z},[z]),(0,a.useEffect)(()=>
1{if(!(0,o.cd)())return void b("/?admin=true");const e=JSON.parse(localStorage.getItem("turbo360_admin_auth"));k(e),Oe(),Le(),y?qe(y):j(!1)},[b,y]);const Oe=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();be(e.clients||[])}}catch(t){console.error("Error loading clients:",t)}},Le=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/crew"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();ve(e)}}catch(t){console.error("Error loading crew database:",t)}},Me=(e,t,s)=>{B(a=>(0,m.A)((0,m.A)({},a),{},{client_contacts:a.client_contacts.map(a=>a.id===e?(0,m.A)((0,m.A)({},a),{},{[t]:s}):a)}))},qe=async e=>{try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(e),{headers:{Authorization:"Bearer ".concat(s)}}),n=await a.json();if(n.success){const e=n.event;if(e.client_brief_file&&!e.supporting_documents&&(e.supporting_documents=[e.client_brief_file]),e.supporting_documents||(e.supporting_documents=[]),e.client_contacts||(e.client_contacts=[]),void 0===e.show_crew_upload_instructions&&(e.show_crew_upload_instructions=!0),void 0===e.show_generic_upload_instructions&&(e.show_generic_upload_instructions=!1),e.runsheet_template||(e.runsheet_template="classic"),e.voxpops){if(!Array.isArray(e.voxpops.items)){const t=e.voxpops.time||e.voxpops.contact_name||e.voxpops.meeting_point?[{id:"vox-".concat(Date.now()),time:e.voxpops.time||"",contact_name:e.voxpops.contact_name||"",meeting_point:e.voxpops.meeting_point||""}]:[];e.voxpops={enabled:!!e.voxpops.enabled,items:t,questions:e.voxpops.questions||[]}}}else e.voxpops={enabled:!1,items:[],questions:[]};e.event_timezone||(e.event_timezone="Australia/Melbourne"),e.event_duration_type||(e.event_duration_type="single"),e.event_days&&0!==e.event_days.length||(e.event_days=[{id:"day-".concat(Date.now()),day_label:"Day 1",date:e.event_date||"",start_time:e.start_time||"09:00",end_time:e.end_time||"17:00",timed_events:[]}]),B(e),N(!0)}}catch(s){console.error("Error loading event:",s)}finally{j(!1)}},He=(()=>{const e=[];for(let t=0;t<24;t++)for(let s=0;s<60;s+=5){const a="".concat(t.toString().padStart(2,"0"),":").concat(s.toString().padStart(2,"0"));e.push(a)}return e})(),Ue=e=>[...e].sort((e,t)=>{const s=(e.time||"00:00").localeCompare(t.time||"00:00");return 0!==s?s:(e.stream||"").localeCompare(t.stream||"")}),Ge=async()=>{if(y&&w)try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token;if(!t)return;const s=F.current;if(!s)return;const a=(0,m.A)((0,m.A)({},s),{},{timed_events:Ue(s.timed_events),event_days:s.event_days.map(e=>(0,m.A)((0,m.A)({},e),{},{timed_events:Ue(e.timed_events||[])}))});await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(y),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(a)})}catch(t){console.error("Auto-save error:",t)}};(0,a.useEffect)(()=>{y&&z.masv_upload_enabled&&(async()=>{if(y)try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(y,"/masv-status"),{headers:{Authorization:"Bearer ".concat(t)}}),a=await s.json();a.success&&(ze(a.portal),Re(a.uploads||[]))}catch(t){console.error("Failed to fetch MASV status:",t)}})()},[y,z.masv_upload_enabled]);const Ve=(e,t)=>{if(B("event_duration_type"===e?s=>{if("multi"===t&&"single"===s.event_duration_type){var a,n,r;const e={id:(null===(a=s.event_days)||void 0===a||null===(n=a[0])||void 0===n?void 0:n.id)||"day-".concat(Date.now()),day_label:"Day 1",date:s.event_date||"",start_time:s.start_time||"09:00",end_time:s.end_time||"17:00",location:s.venue||"",timed_events:[...s.timed_events||[]],client_contacts:[]};return(0,m.A)((0,m.A)({},s),{},{event_duration_type:"multi",event_days:[e,...(null===(r=s.event_days)||void 0===r?void 0:r.slice(1))||[]]})}if("single"===t&&"multi"===s.event_duration_type){var i;const e=null===(i=s.event_days)||void 0===i?void 0:i[0];return(0,m.A)((0,m.A)({},s),{},{event_duration_type:"single",event_date:(null===e||void 0===e?void 0:e.date)||s.event_date||"",start_time:(null===e||void 0===e?void 0:e.start_time)||s.start_time||"09:00",end_time:(null===e||void 0===e?void 0:e.end_time)||s.end_time||"17:00",timed_events:[...(null===e||void 0===e?void 0:e.timed_events)||s.timed_events||[]]})}return(0,m.A)((0,m.A)({},s),{},{[e]:t})}:s=>(0,m.A)((0,m.A)({},s),{},{[e]:t})),K&&clearTimeout(K),y&&w){const e=setTimeout(()=>Ge(),500);Z(e)}},Je=async e=>{var t;const s=null===(t=e.target.files)||void 0===t?void 0:t[0];if(s){if(!y)return ne("Save the event first, then add a hero image."),void(e.target.value="");if(!s.type.startsWith("image/"))return ne("Please choose a JPEG, PNG, WebP or HEIC image"),void(e.target.value="");if(s.size>
115728640)return ne("Image must be under 15MB"),void(e.target.value="");ne(""),se(!0);try{var a;const e=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,t=new FormData;t.append("file",s);const n=await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(y,"/hero-image"),{method:"POST",headers:{Authorization:"Bearer ".concat(e)},body:t}),r=await n.json().catch(()=>({}));if(!n.ok||!r.success)throw new Error(r.detail||r.message||"Upload failed (".concat(n.status,")"));B(e=>(0,m.A)((0,m.A)({},e),{},{hero_image_url:r.hero_image_url})),V("Hero image updated"),setTimeout(()=>V(""),3e3)}catch(n){console.error("Hero upload error:",n),ne(n.message||"Upload failed")}finally{se(!1),e.target.value=""}}},Ke=(e,t,s)=>{B(a=>{const n=a.event_days.map(a=>a.id===e?(0,m.A)((0,m.A)({},a),{},{[t]:s}):a);return(0,m.A)((0,m.A)({},a),{},{event_days:"date"===t?(r=n,[...r].sort((e,t)=>{const s=e.date||"9999-99-99",a=t.date||"9999-99-99";return s.localeCompare(a)})):n});var r})},Ze=(e,t,s,a)=>{B(n=>(0,m.A)((0,m.A)({},n),{},{event_days:n.event_days.map(n=>n.id===e?(0,m.A)((0,m.A)({},n),{},{timed_events:Ue(n.timed_events.map(e=>e.id===t?(0,m.A)((0,m.A)({},e),{},{[s]:a}):e))}):n)}))},$e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=t?{id:"dcc-".concat(Date.now()),contact_id:t.contact_id||t.id||"",name:t.name||"",email:t.email||"",mobile:t.mobile||"",role:t.role||"Contact",is_primary:!1}:{id:"dcc-".concat(Date.now()),contact_id:"",name:"",email:"",mobile:"",role:"Contact",is_primary:!1};B(t=>(0,m.A)((0,m.A)({},t),{},{event_days:t.event_days.map(t=>t.id===e?(0,m.A)((0,m.A)({},t),{},{client_contacts:[...t.client_contacts||[],s]}):t)}))},Qe=(e,t,s,a)=>{B(n=>(0,m.A)((0,m.A)({},n),{},{event_days:n.event_days.map(n=>n.id===e?(0,m.A)((0,m.A)({},n),{},{client_contacts:(n.client_contacts||[]).map(e=>e.id===t?(0,m.A)((0,m.A)({},e),{},{[s]:a}):e)}):n)}))},tt=e=>(z.role_variants||[]).find(t=>t.role===e),st={timed_events:"timed_events",event_days:"event_days",brief:"special_briefing_notes",must_capture:"must_capture_checklist"},at=e=>{const t=st[e];if(!D)return z[t];const s=tt(D);if(!s)return z[t];const a=s[e];return null===a||void 0===a||"string"===typeof a&&""===a?z[t]:a},rt=(e,t)=>{B(D?s=>{const a=st[e],n=(s.role_variants||[]).map(n=>{if(n.role!==D)return n;const r=null===n[e]||void 0===n[e]||""===n[e]?s[a]:n[e],i="function"===typeof t?t(r):t;return(0,m.A)((0,m.A)({},n),{},{[e]:i})});return(0,m.A)((0,m.A)({},s),{},{role_variants:n})}:s=>{const a=st[e],n="function"===typeof t?t(s[a]):t;return(0,m.A)((0,m.A)({},s),{},{[a]:n})})},it=(e,t)=>{if(!D||t===D)return;const s=st[e];B(a=>{const n=a.role_variants||[];let r=a[s];if(t){const i=n.find(e=>e.role===t),o=i?i[e]:null;r=null===o||void 0===o||"string"===typeof o&&""===o?a[s]:o}return(0,m.A)((0,m.A)({},a),{},{role_variants:n.map(t=>{if(t.role!==D)return t;const s=Array.isArray(r)?r.map(t=>(0,m.A)((0,m.A)({},t),{},{id:"".concat(e,"-").concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,6))})):r;return(0,m.A)((0,m.A)({},t),{},{[e]:s})})})}),L(!1)},ot=(e,t)=>{D&&B(s=>(0,m.A)((0,m.A)({},s),{},{role_variants:(s.role_variants||[]).map(s=>s.role===D?(0,m.A)((0,m.A)({},s),{},{[e]:t}):s)}))},lt=["photographer","second_photographer","videographer","second_videographer","voxpop_videographer","editor","remote_editor","producer","assistant","coordinator"].filter(e=>!(z.role_variants||[]).some(t=>t.role===e)),ct=(e,t,s)=>{rt("timed_events",a=>Ue((a||[]).map(a=>a.id===e?(0,m.A)((0,m.A)({},a),{},{[t]:s}):a)))},dt=async e=>{var t,s,a;const n=((null===e||void 0===e?void 0:e.name)||"").toLowerCase();if(!e||!n.endsWith(".pdf")&&!n.endsWith(".docx"))return void alert("Please select a PDF or DOCX file");z.event_name||z.venue||z.client_company||(null===(t=z.timed_events)||void 0===t?void 0:t.length)>0||(null===(s=z.event_days)||void 0===s?void 0:s.length)>0||(null===(a=z.must_capture_checklist)||void 0===a?void 0:a.length)>0?q({file:e}):mt(e,"replace")},mt=async(e,t)=>{q(null);ge(!0);try{const n=JSON.parse(localStorage.getItem("turbo360_admin_auth")),r=new FormData;r.append("file",e),r.append("mode",t),"enrich"===t&&r.append("existing_event",JSON.stringify((()=>{const e=e=>(e||[]).map(e=>({time:e.time,description:e.description,stream:e.stream||"",notes:e.notes||""})),t=e=>(e||[]).map(e=>
1"string"===typeof e?e:e.text).filter(Boolean);return{event_name:z.event_name,venue:z.venue,client_company:z.client_company,primary_contact:z.primary_contact,email:z.email,mobile:z.mobile,event_duration_type:z.event_duration_type,special_briefing_notes:z.special_briefing_notes||"",must_capture_checklist:t(z.must_capture_checklist),timed_events:e(z.timed_events),event_days:(z.event_days||[]).map(t=>({day_label:t.day_label,date:t.date,events:e(t.timed_events)})),role_variants:(z.role_variants||[]).map(s=>({role:s.role,brief:s.brief||"",must_capture:t(s.must_capture),events:e(s.timed_events),days:(s.event_days||[]).map(t=>({day_label:t.day_label,date:t.date,events:e(t.timed_events)}))}))}})()));const i=await fetch("".concat(I.fn,"/api/corporate-admin/analyze-runsheet"),{method:"POST",headers:{Authorization:"Bearer ".concat(null===n||void 0===n?void 0:n.token)},body:r}),o=await i.json();if(o.success){var s;const e={};let n=0,r=[];if(o.event_details){const t=o.event_details;if(t.event_name&&(e.event_name=t.event_name,r.push("Event name")),t.venue&&(e.venue=t.venue,r.push("Venue")),t.client_company&&(e.client_company=t.client_company,r.push("Client")),t.primary_contact&&(e.primary_contact=t.primary_contact,r.push("Contact")),t.email&&(e.email=t.email),t.mobile&&(e.mobile=t.mobile),t.special_briefing_notes&&(e.special_briefing_notes=t.special_briefing_notes,r.push("Briefing notes")),t.must_capture_checklist&&t.must_capture_checklist.length>0){const s=t.must_capture_checklist.filter(e=>e&&"string"===typeof e&&""!==e.trim()).map((e,t)=>({id:"checklist-".concat(Date.now(),"-").concat(t),text:e.trim(),order:t}));s.length>0&&(e.must_capture_checklist=s,r.push("".concat(s.length," checklist items")))}}if(o.is_multi_day&&o.days&&o.days.length>1){e.event_duration_type="multi";const t=o.days.map((e,t)=>{var s,a;return{id:"day-".concat(Date.now(),"-").concat(t),day_label:e.day_label||"Day ".concat(t+1),date:e.date||"",start_time:(null===(s=e.events[0])||void 0===s?void 0:s.time)||"09:00",end_time:(null===(a=e.events[e.events.length-1])||void 0===a?void 0:a.time)||"17:00",timed_events:e.events.map(e=>(0,m.A)((0,m.A)({},e),{},{id:e.id||"timed-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),stream:e.stream||""}))}});e.event_days=t,e.timed_events=[],n=o.days.reduce((e,t)=>e+t.events.length,0),r.push("".concat(n," events across ").concat(o.days.length," days"))}else if(o.timed_events&&o.timed_events.length>0){var a;e.timed_events=Ue(o.timed_events),e.event_duration_type="single",e.event_days=[],n=o.timed_events.length,r.push("".concat(n," timed events")),o.days&&null!==(a=o.days[0])&&void 0!==a&&a.date&&(e.event_date=o.days[0].date,r.push("Event date"))}else o.days&&1===o.days.length&&(null===(s=o.days[0].events)||void 0===s?void 0:s.length)>0&&(e.timed_events=Ue(o.days[0].events),e.event_duration_type="single",e.event_days=[],n=o.days[0].events.length,r.push("".concat(n," timed events")),o.days[0].date&&(e.event_date=o.days[0].date,r.push("Event date")));if(Array.isArray(o.role_variants)&&o.role_variants.length>0){const t=(e,t)=>(e.time||"").localeCompare(t.time||"");e.role_variants=o.role_variants.map((e,s)=>({id:"rv-".concat(Date.now(),"-").concat(s),role:e.role,enabled:!0,brief:"string"===typeof e.brief?e.brief:"",timed_events:Array.isArray(e.events)&&e.events.length?[...e.events].sort(t):null,event_days:Array.isArray(e.days)&&e.days.length?e.days.map((e,t)=>{var a,n,r,i;return{id:"day-".concat(Date.now(),"-").concat(s,"-").concat(t),date:e.date||"",day_label:e.day_label||"Day ".concat(t+1),start_time:(null===(a=e.events)||void 0===a||null===(n=a[0])||void 0===n?void 0:n.time)||"09:00",end_time:(null===(r=e.events)||void 0===r||null===(i=r[e.events.length-1])||void 0===i?void 0:i.time)||"17:00",timed_events:(e.events||[]).map(e=>(0,m.A)((0,m.A)({},e),{},{id:e.id||"timed-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8))}))}}):null,must_capture:Array.isArray(e.must_capture)&&e.must_capture.length?e.must_capture.filter(e=>"string"===typeof e&&e.trim()).map((e,t)=>({id:"mc-".concat(Date.now(),"-").concat(s,"-").concat(t),text:e.trim(),order:t})):null}));const s=o.role_variants.map(e=>gt[e.role]||e.role).join(" + ");r.push("".concat(o.role_variants.length," role variants (").concat(s,")"))}if(Object.keys(e).length>0){B(t=>(0,m.A)((0,m.A)({},t),e));alert("Successfully ".concat(("enrich"===t?"Enriched with":"Imported").toLowerCase(),": ").concat(r.join(", ")))}else alert("No new data found in the runsheet")}else o.detail?alert("Error: ".concat(o.detail)):alert("No data found in the runsheet")}catch(n){console.error("Error analyzing runsheet:",n),alert("Failed to analyze runsheet. Please try again.")}finally{ge(!1)}};(0,a.useEffect)(()=>{const e=je.trim();if(e.length<2)return Ae([]),void Ce("");let t=!1;const s=setTimeout(async()=>{Se(!0),Ce("");try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,n=await fetch("".concat(I.fn,"/api/crew/shootzu/search?q=").concat(encodeURIComponent(e),"&limit=15"),{headers:{Authorization:"Bearer ".concat(a)}});if(t)return;if(n.ok){const e=await n.json();Ae(e.crew||[])}else{const e=await n.json().catch(()=>({}));Ce(502===n.status?e.detail||"Shootzu is unreachable \u2014 your own crew list still works.":"Could not search Shootzu."),Ae([])}}catch(a){t||(Ce("Could not search Shootzu."),Ae([]))}finally{t||Se(!1)}},350);return()=>{t=!0,clearTimeout(s)}},[je]);const pt=function(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||ye.find(t=>
1t.id===e);if(!t)return;if(z.crew_members.some(t=>t.crew_id===e))return void alert("This crew member is already assigned");const s={id:"crew-assignment-".concat(Date.now()),crew_id:t.id,name:"".concat(t.first_name," ").concat(t.last_name),first_name:t.first_name,last_name:t.last_name,email:t.email,mobile:t.mobile_number,shootzu_user_id:t.shootzu_user_id||null,photo_url:t.photo_url||null,role:t.suggested_roles&&t.suggested_roles[0]||"photographer"};B(e=>(0,m.A)((0,m.A)({},e),{},{crew_members:[...e.crew_members,s]}))},xt=(e,t,s)=>{if(B(a=>{const n=a.crew_members.map(a=>a.id===e?(0,m.A)((0,m.A)({},a),{},{[t]:s}):a);return(0,m.A)((0,m.A)({},a),{},{crew_members:n})}),K&&clearTimeout(K),y&&w){const e=setTimeout(()=>Ge(),800);Z(e)}},ht=(e,t,s)=>{if(B(a=>(0,m.A)((0,m.A)({},a),{},{voxpops:(0,m.A)((0,m.A)({},a.voxpops),{},{items:(a.voxpops&&a.voxpops.items||[]).map(a=>a.id===e?(0,m.A)((0,m.A)({},a),{},{[t]:s}):a)})})),K&&clearTimeout(K),y&&w){const e=setTimeout(()=>Ge(),800);Z(e)}},ut=async()=>{U(!0),V("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=y?"".concat(I.fn,"/api/corporate-admin/events/").concat(y):"".concat(I.fn,"/api/corporate-admin/events"),a=y?"PUT":"POST",n=(0,m.A)((0,m.A)({},z),{},{timed_events:Ue(z.timed_events),event_days:z.event_days.map(e=>(0,m.A)((0,m.A)({},e),{},{timed_events:Ue(e.timed_events||[])}))}),r=await fetch(s,{method:a,headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(n)}),i=await r.json();r.ok&&i.success?(V("Saved successfully"),setTimeout(()=>b("/admin/corporate"),1e3)):V("Save failed")}catch(t){console.error("Save error:",t),V("Save failed")}finally{U(!1)}},gt={photographer:"Photographer",second_photographer:"Second Photographer",videographer:"Videographer",second_videographer:"Second Videographer",voxpop_videographer:"VoxPop Videographer",editor:"Editor",remote_editor:"Remote Editor",producer:"Producer",assistant:"Assistant",coordinator:"Coordinator"},ft=e=>{let{scope:t}=e;const s=z.role_variants||[];return 0!==s.length||P?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"mb-4 flex items-center gap-2 flex-wrap",style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:12,padding:"10px 14px"},children:[(0,f.jsx)("span",{className:"tg-mono",style:{fontSize:10,letterSpacing:"0.14em",color:"#9A9AA0",marginRight:2},children:"ROLE VARIANT"}),0===s.length&&(0,f.jsx)("button",{type:"button",onClick:()=>R(null),className:"inline-flex items-center gap-1.5",style:null===D?{padding:"7px 13px",borderRadius:8,fontSize:12.5,fontWeight:600,background:"#0A0A0B",color:"#fff",border:"1px solid #0A0A0B",cursor:"pointer"}:{padding:"7px 13px",borderRadius:8,fontSize:12.5,fontWeight:600,background:"#fff",color:"#55555C",border:"1px solid #E4E4E9",cursor:"pointer"},children:"Shared"}),s.map(e=>{const t=D===e.role;return(0,f.jsxs)("button",{type:"button",onClick:()=>R(e.role),className:"inline-flex items-center gap-2",style:t?{padding:"7px 13px",borderRadius:8,fontSize:12.5,fontWeight:600,background:"#0A0A0B",color:"#fff",border:"1px solid #0A0A0B",cursor:"pointer"}:{padding:"7px 13px",borderRadius:8,fontSize:12.5,fontWeight:600,background:"#fff",color:"#55555C",border:"1px solid #E4E4E9",cursor:"pointer"},children:[(0,f.jsx)("span",{children:gt[e.role]||e.role}),t&&(0,f.jsx)("span",{role:"button",tabIndex:0,onClick:t=>{var s;t.stopPropagation(),s=e.role,window.confirm("Remove the ".concat(gt[s]||s," variant? Their timeline / brief / must-capture will be deleted; the shared schedule still applies."))&&B(e=>{const t=(e.role_variants||[]).filter(e=>e.role!==s);return(0,m.A)((0,m.A)({},e),{},{role_variants:t})})},className:"ml-1 -mr-0.5 inline-flex items-center",style:{opacity:.8},title:"Remove this role variant",children:(0,f.jsx)(g.A,{className:"h-3.5 w-3.5"})})]},e.id)}),lt.length>0&&(0,f.jsxs)("div",{className:"relative inline-block",children:[(0,f.jsxs)("button",{type:"button",onClick:()=>W(e=>!e),className:"inline-flex items-center gap-1.5",style:{padding:"7px 13px",borderRadius:8,fontSize:12.5,fontWeight:600,background:"#fff",border:"1px dashed #C9C9D0",color:"#9A9AA0",cursor:"pointer"},children:[(0,f.jsx)(ls.A,{className:"h-3.5 w-3.5"}),"Add role"]}),P&&(0,f.jsx)("div",{className:"absolute left-0 top-full mt-1 z-20 min-w-[10rem] bg-white border border-slate-200 rounded-lg shadow-lg overflow-hidden",children:lt.map(e=>(0,f.jsx)("button",{type:"button",onClick:()=>{return t=e,B(e=>(0,m.A)((0,m.A)({},e),{},{role_variants:[...e.role_variants||[],{id:"rv-".concat(Date.now()),role:t,timed_events:null,event_days:null,brief:"",must_capture:null,enabled:!0}]})),R(t),void W(!1);var t},className:"w-full text-left px-3 py-2 text-sm text-slate-700 hover:bg-slate-100 transition-colors",children:gt[e]||e},e))})]}),null!==D&&(()=>{const e="schedule"===t?"timed_events":"brief"===t?"brief":"must_capture",a=s.filter(e=>e.role!==D);return 0===a.length?(0,f.jsxs)("button",{type:"button",onClick:()=>it(e,null),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold text-emerald-700 hover:bg-emerald-50 transition-colors",title:"Copy the Shared ".concat(t," into this variant as a starting point."),children:[(0,f.jsx)(Cr.A,{className:"h-3.5 w-3.5"}),"Mirror from Shared"]}):(0,f.jsxs)("div",{className:"relative inline-block",children:[(0,f.jsxs)("button",{type:"button",onClick:()=>L(e=>!e),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold text-emerald-700 hover:bg-emerald-50 transition-colors",title:"Copy another role's ".concat(t," into this variant as a starting point."),children:[(0,f.jsx)(Cr.A,{className:"h-3.5 w-3.5"}),"Mirror from\u2026",(0,f.jsx)(Et.A,{className:"h-3.5 w-3.5"})]}),O&&(0,f.jsx)("div",{className:"absolute left-0 top-full mt-1 z-20 min-w-[11rem] bg-white border border-slate-200 rounded-lg shadow-lg overflow-hidden",children:a.map(t=>(0,f.jsx)("button",{type:"button",onClick:()=>it(e,t.role),className:"w-full text-left px-3 py-2 text-sm text-slate-700 hover:bg-slate-100 transition-colors",children:gt[t.role]||t.role},t.id))})]})})()]}
1),"schedule"===t&&null!==D&&(()=>{const e=tt(D);return(0,f.jsxs)("div",{className:"mb-4 grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-xs text-slate-500 mb-1",children:["Runsheet name",(0,f.jsxs)("span",{className:"text-slate-400 font-normal ml-1",children:["(defaults to \u201c",gt[D]||D,"\u201d)"]})]}),(0,f.jsx)("input",{type:"text",value:(null===e||void 0===e?void 0:e.label)||"",onChange:e=>ot("label",e.target.value),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500",placeholder:"e.g. ".concat(gt[D]||D," \u2014 Scout Camp")})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-xs text-slate-500 mb-1",children:["Primary location",(0,f.jsx)("span",{className:"text-slate-400 font-normal ml-1",children:"(overrides event venue for this runsheet)"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-slate-400 shrink-0"}),(0,f.jsx)("input",{type:"text",value:(null===e||void 0===e?void 0:e.location)||"",onChange:e=>ot("location",e.target.value),onBlur:Ge,className:"flex-1 px-3 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500",placeholder:"e.g. GWS Anderson Scout Park"})]})]})]})})(),"schedule"===t&&null!==D&&(()=>{const e=z.crew_members||[],t=tt(D),s=e=>e.runsheet_variant_id?e.runsheet_variant_id===(null===t||void 0===t?void 0:t.id):e.role===D,a=e.filter(s),n=e.filter(e=>!s(e));return(0,f.jsxs)("div",{className:"mb-4 -mt-1 flex items-center gap-2 flex-wrap text-sm",children:[(0,f.jsxs)("span",{className:"inline-flex items-center gap-1 text-slate-500 font-medium",children:[(0,f.jsx)(Ye.A,{className:"h-3.5 w-3.5"})," Assigned to:"]}),0===e.length&&(0,f.jsx)("span",{className:"text-slate-400 italic",children:"Add crew in the Crew section to assign this schedule"}),e.length>0&&0===a.length&&(0,f.jsx)("span",{className:"text-slate-400 italic",children:"No one yet"}),a.map(e=>(0,f.jsxs)("span",{className:"inline-flex items-center gap-1 pl-2.5 pr-1.5 py-1 rounded-full bg-emerald-50 text-emerald-800 border border-emerald-200 font-medium",children:[e.name||"Unnamed",(0,f.jsx)("button",{type:"button",onClick:()=>{return t=e.id,B(e=>(0,m.A)((0,m.A)({},e),{},{crew_members:(e.crew_members||[]).map(e=>e.id===t?(0,m.A)((0,m.A)({},e),{},{role:"",runsheet_variant_id:null}):e)})),void(y&&w&&(K&&clearTimeout(K),Z(setTimeout(()=>Ge(),800))));var t},className:"hover:text-rose-600",title:"Unassign from this schedule",children:(0,f.jsx)(g.A,{className:"h-3.5 w-3.5"})})]},e.id)),n.length>0&&(0,f.jsxs)("select",{value:"",onChange:e=>{e.target.value&&((e,t)=>{const s=(tt(t)||{}).id||null;B(a=>(0,m.A)((0,m.A)({},a),{},{crew_members:(a.crew_members||[]).map(a=>a.id===e?(0,m.A)((0,m.A)({},a),{},{role:t,runsheet_variant_id:s}):a)})),y&&w&&(K&&clearTimeout(K),Z(setTimeout(()=>Ge(),800)))})(e.target.value,D)},className:"px-2 py-1 bg-white border border-dashed border-slate-300 rounded-lg text-slate-600 hover:border-slate-500 focus:outline-none",children:[(0,f.jsx)("option",{value:"",children:"+ Assign crew\u2026"}),n.map(e=>(0,f.jsxs)("option",{value:e.id,children:[e.name||"Unnamed",e.role?" (now ".concat(gt[e.role]||e.role,")"):""]},e.id))]})]})})()]}):(0,f.jsx)("div",{className:"mb-4 flex items-center gap-2",children:(0,f.jsxs)("button",{type:"button",onClick:()=>W(!0),className:"inline-flex items-center gap-1.5",style:{padding:"7px 13px",borderRadius:8,fontSize:12.5,fontWeight:600,background:"#fff",border:"1px dashed #C9C9D0",color:"#9A9AA0",cursor:"pointer"},title:"Some events ship different briefs to the Photographer and Videographer \u2014 opt in here.",children:[(0,f.jsx)(ls.A,{className:"h-3.5 w-3.5"}),"Add per-role ",t]})})},bt=e=>{let{icon:t,title:s,section:a,color:n="indigo"}=e;const r=S[a];return(0,f.jsxs)("button",{type:"button",onClick:()=>(e=>{_(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!t[e]}))})(a),style:{width:"100%",display:"flex",alignItems:"center",gap:13,padding:"16px 18px",cursor:"pointer",background:"#fff",borderBottom:r?"1px solid #EDEDF0":"none",textAlign:"left"},children:[(0,f.jsx)("span",{style:{width:30,height:30,borderRadius:8,background:"#F4F4F6",color:"#55555C",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(t,{size:16})}),(0,f.jsx)("div",{style:{flex:1,minWidth:0,fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,color:"#0A0A0B"},children:s}),(0,f.jsx)(Et.A,{size:18,style:{color:"#9A9AA0",transform:r?"rotate(0deg)":"rotate(-90deg)",transition:"transform .2s"}})]})};return v?(0,f.jsxs)(ta,{title:y?"Edit Runsheet":"New Runsheet",meta:"EVENTS \xb7 RUNSHEET",children:[(0,f.jsx)(Ci,{eventId:y}),(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"120px 0"},children:(0,f.jsxs)("div",{style:{textAlign:"center"},children:[(0,f.jsx)("div",{className:"inline-block animate-spin rounded-full h-12 w-12 border-4 border-t-transparent",style:{borderColor:"#BF212F",borderTopColor:"transparent"}}),(0,f.jsx)("p",{style:{marginTop:16,color:"#9A9AA0",fontSize:13.5},children:"Loading event..."})]})})]}):(0,f.jsxs)(ta,{title:y?"Edit Runsheet":"New Runsheet",meta:"EVENTS \xb7 RUNSHEET",children:[M&&(0,f.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:()=>q(null),children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl max-w-md w-full p-6",onClick:e=>e.stopPropagation(),children:[(0,f.jsx)("h3",{className:"text-lg font-bold text-slate-900",children:"This event already has data"}),(0,f.jsxs)("p",{className:"mt-2 text-sm text-slate-600",children:["How should ",(0,f.jsx)("span",{className:"font-semibold",children:null===(e=M.file)||void 0===e?void 0:e.name})," be applied?"]}),(0,f.jsxs)("div",{className:"mt-5 space-y-3",children:[(0,f.jsxs)("button",{type:"button",onClick:()=>mt(M.file,"enrich"),className:"w-full text-left p-4 rounded-xl border border-emerald-200 bg-emerald-50 hover:bg-emerald-100 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-emerald-800",children:[(0,f.jsx)(Cr.A,{className:"h-4 w-4"})," Add more detail"]}),(0,f.jsx)("div",{className:"mt-1 text-xs text-emerald-700",children:"Keep the existing schedule and let the AI merge in any extra detail from this document \u2014 adding to each item's notes, the checklist, and the briefing \u2014 without duplicating what's already there."})]}),(0,f.jsxs)("button",{type:"button",onClick:()=>mt(M.file,"replace"),className:"w-full text-left p-4 rounded-xl border border-slate-200 hover:bg-slate-50 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 font-semibold text-slate-800",children:[(0,f.jsx)(_s.A,{className:"h-4 w-4"})," Override all"]}),(0,f.jsx)("div",{className:"mt-1 text-xs text-slate-500",children:"Discard the current event data and rebuild it fresh from this document."})]})]}),(0,f.jsx)("button",{type:"button",onClick:()=>q(null),className:"mt-4 w-full text-center text-sm text-slate-500 hover:text-slate-700",children:"Cancel"})]})}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>b("/admin/corporate"),style:{display:"inline-flex",alignItems:"center",gap:7,fontSize:13,fontWeight:600,color:"#55555C",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{size:15})," Runsheets"]}),(0,f.jsx)("div",{style:{minWidth:0},children:(0,f.jsx)("h1",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:800,fontSize:22,letterSpacing:"-0.01em",margin:0,color:"#0A0A0B",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:z.event_name||(y?"Edit Event":"Create New Event")})}),(0,f.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:12},children:[G&&(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600,color:G.includes("success")||G.includes("uploaded")||G.includes("added")?"#15803D":"#BF212F"},children:G}),y&&!G&&(0,f.jsx)("span",{className:"tg-mono",style:{fontSize:11,letterSpacing:"0.04em",color:"#9A9AA0"},children:"AUTO-SAVE ON"}),(0,f.jsxs)("button",{onClick:ut,disabled:H,style:(0,m.A)((0,m.A)({},Zo),{},{padding:"10px 18px",opacity:H?.6:1}),children:[(0,f.jsx)(ia.A,{size:15}),H?"Saving...":"Save Event"]})]})]}),(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsxs)("div",{style:Ko,children:[(0,f.jsx)(bt,{icon:_t.A,title:"Event Details",section:"event",color:"indigo"}),S.event&&(0,f.jsxs)("div",{className:"p-6 space-y-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:["Event Name ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsx)("input",{type:"text",value:z.event_name,onChange:e=>Ve("event_name",e.target.value),onBlur:Ge,className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent",placeholder:"Annual Conference 2025"})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:["Venue ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsx)("input",{type:"text",value:z.venue,onChange:e=>Ve("venue",e.target.value),onBlur:Ge,className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent",placeholder:"Sydney Convention Centre"})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:["Event Website ",(0,f.jsx)("span",{className:"text-slate-400 font-normal",children:"(optional)"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(et.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-slate-400"}),(0,f.jsx)("input",{type:"url",value:z.event_website,onChange:e=>Ve("event_website",e.target.value),onBlur:Ge,className:"w-full pl-11 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent",placeholder:"https://www.eventwebsite.com"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Event Timezone"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Nt.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-slate-400"}),(0,f.jsx)("select",{value:z.event_timezone||"Australia/Melbourne",onChange:e=>{Ve("event_timezone",e.target.value),Ge()},className:"w-full pl-11 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent appearance-none",children:zo.xJ.map(e=>(0,f.jsx)("option",{value:e.value,children:e.label},e.value))})]})]})]})]})]}),(0,f.jsxs)("div",{style:Ko,children:[(0,f.jsx)(bt,{icon:Ei.A,title:"Runsheet Template",section:"template",color:"purple"}),S.template&&(0,f.jsxs)("div",{className:"p-6",children:[(0,f.jsx)("p",{className:"text-sm text-slate-600 mb-4",children:"Choose a visual template for the public runsheet page."}),(0,f.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 ga
1p-3",children:Jo.map(e=>(0,f.jsxs)("button",{onClick:()=>Ve("runsheet_template",e.id),className:"relative rounded-xl border-2 p-4 text-left transition-all hover:shadow-md ".concat(z.runsheet_template===e.id?"border-red-600 bg-red-50 shadow-sm":"border-slate-200 bg-white hover:border-slate-300"),children:[(0,f.jsx)("div",{className:"w-full h-3 rounded-full mb-3",style:{backgroundColor:e.color,border:"#f9fafb"===e.color?"1px solid #d1d5db":"none"}}),(0,f.jsx)("p",{className:"font-semibold text-sm ".concat(z.runsheet_template===e.id?"text-red-700":"text-slate-900"),children:e.name}),(0,f.jsx)("p",{className:"text-xs text-slate-500 mt-1 line-clamp-2",children:e.description}),z.runsheet_template===e.id&&(0,f.jsx)("div",{className:"absolute top-2 right-2",children:(0,f.jsx)(In.A,{className:"h-5 w-5 text-red-600"})})]},e.id))}),y&&(0,f.jsx)("div",{className:"mt-4 pt-4 border-t border-slate-200",children:(0,f.jsxs)("a",{href:"/corporate-runsheet/".concat(y),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-sm text-red-600 hover:text-red-700 font-medium",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),"Preview Runsheet"]})})]})]}),(0,f.jsxs)("div",{style:Ko,children:[(0,f.jsx)(bt,{icon:Ye.A,title:"Client Information",section:"client",color:"blue"}),S.client&&(0,f.jsxs)("div",{className:"p-6 space-y-6",children:[(0,f.jsxs)("div",{className:"p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border border-blue-200 rounded-xl",children:[z.contact_id&&z.client_company?(0,f.jsxs)("div",{className:"mb-4 p-3 bg-emerald-50 border border-emerald-200 rounded-lg flex items-center gap-2",children:[(0,f.jsx)(In.A,{className:"h-5 w-5 text-emerald-600"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-emerald-900",children:z.client_company}),(0,f.jsxs)("p",{className:"text-xs text-emerald-700",children:[z.primary_contact," (",z.email,")"]})]})]}):z.client_company&&!z.contact_id?(0,f.jsxs)("div",{className:"mb-4 p-3 bg-amber-50 border border-amber-200 rounded-lg flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-amber-600",children:"\u26a0\ufe0f"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-amber-900",children:"Client Not Linked"}),(0,f.jsx)("p",{className:"text-xs text-amber-700",children:"Please select the contact below to enable portal access."})]})]}):null,(0,f.jsx)(Yo,{allClients:fe,selectedContactId:z.contact_id,onContactSelect:async e=>{const t="string"===typeof e?e:null===e||void 0===e?void 0:e.id;if(t){if(z.contact_id!==t)try{var s;const e=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,a=await fetch("".concat(I.fn,"/api/clients/").concat(t),{headers:{Authorization:"Bearer ".concat(e)}});if(a.ok){const s=await a.json();let n=s.company_name;if(s.parent_company_id){const t=await fetch("".concat(I.fn,"/api/clients/").concat(s.parent_company_id),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json();n=e.company_name}}B(e=>(0,m.A)((0,m.A)({},e),{},{contact_id:t,client_company:n,primary_contact:s.contact_name,email:s.email,mobile:s.phone})),y&&setTimeout(()=>Ge(),500)}}catch(a){console.error("Error loading contact:",a)}}else B(e=>(0,m.A)((0,m.A)({},e),{},{contact_id:"",client_company:"",primary_contact:"",email:"",mobile:""}))},label:"Select Company and Contact"})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:["Client Company ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsx)("input",{type:"text",value:z.client_company,onChange:e=>Ve("client_company",e.target.value),onBlur:Ge,className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent",placeholder:"ABC Corporation"})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:["Primary Contact ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsx)("input",{type:"text",value:z.primary_contact,onChange:e=>Ve("primary_contact",e.target.value),onBlur:Ge,className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent",placeholder:"John Smith"})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:["Email ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(T.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-slate-400"}),(0,f.jsx)("input",{type:"email",value:z.email,onChange:e=>Ve("email",e.target.value),onBlur:Ge,className:"w-full pl-11 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent",placeholder:"[email protected]"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:["Mobile ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(E.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-slate-400"}),(0,f.jsx)("input",{type:"tel",value:z.mobile,onChange:e=>Ve("mobile",e.target.value),onBlur:Ge,className:"w-full pl-11 pr-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent",placeholder:"+61 400 000 000"})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Additional Notes"}),(0,f.jsx)("textarea",{value:z.additional_notes,onChange:e=>Ve("additional_notes",e.target.value),onBlur:Ge,className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent",rows:"3",placeholder:"Any special requests..."})]})]})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Ko),{},{borderLeft:"3px solid #16A34A"}),children:[(0,f.jsx)(bt,{icon:Xe.A,title:"Client Contacts (".concat((null===(t=z.client_contacts)||void 0===t?void 0:t.length)||0,")"),section:"contacts",color:"green"}),S.contacts&&(0,f.jsxs)("div",{className:"p-6 space-y-4",children:[(0,f.jsxs)("div",{className:"p-4 bg-green-50 rounded-lg border border-green-200",children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:[(0,f.jsx)(Bn.A,{className:"inline h-4 w-4 mr-1"}),"Add Contact from Company"]}),(0,f.jsxs)("select",{onChange:e=>{e.target.value&&((async e=>{if(!e)return;if(z.client_contacts.some(t=>t.contact_id===e))alert("This contact is already added to the event");else try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/clients/").concat(e),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const t=await a.json(),s=0===z.client_contacts.length,n={id:"cc-".concat(Date.now()),contact_id:e,name:t.contact_name||"",email:t.email||"",mobile:t.phone||"",role:t.position||(s?"Primary":"Contact"),is_primary:s};B(e=>(0,m.A)((0,m.A)({},e),{},{client_contacts:[...e.client_contacts,n]})),y&&setTimeout(()=>Ge(),500)}}catch(s){console.error("Error adding contact:",s)}})(e.target.value),e.target.value="")},className:"w-full px-4 py-3 bg-white border border-green-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-green-500",defaultValue:"",children:[(0,f.jsx)("option",{value:"",children:"Select a contact to add..."}),fe.filter(e=>{const t=fe.find(e=>e.id===z.contact_id),s=(null===t||void 0===t?void 0:t.parent_company_id)||z.contact_id;return e.parent_company_id===s||e.id===s}).filter(e=>e.contact_name).map(e=>(0,f.jsxs)("option",{value:e.id,children:[e.contact_name," ",e.position?"(".concat(e.position,")"):""," - ",e.email]},e.id))]}),(0,f.jsxs)("div",{className:"flex items-center gap-3 mt-3",children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 flex-1",children:"These contacts will receive emails and appear on the runsheet."}),(0,f.jsxs)("button",{type:"button",onClick:()=>{const e={id:"cc-".concat(Date.now()),contact_id:"",name:"",email:"",mobile:"",role:0===z.client_contacts.length?"Primary":"Contact",is_primary:0===z.client_contacts.length};B(t=>(0,m.A)((0,m.A)({},t),{},{client_contacts:[...t.client_contacts,e]})),y&&setTimeout(()=>Ge(),500)},className:"flex items-center gap-1.5 px-3 py-1.5 bg-green-600 hover:bg-green-700 text-white text-xs font-medium rounded-lg transition-colors whitespace-nowrap",children:[(0,f.jsx)(Bn.A,{className:"h-3.5 w-3.5"}),"Add Manually"]})]})]}),0===(null===(s=z.client_contacts)||void 0===s?void 0:s.length)?(0,f.jsxs)("div",{className:"p-6 bg-slate-50 rounded-lg text-center text-slate-500",children:[(0,f.jsx)(Xe.A,{className:"h-8 w-8 mx-auto mb-2 text-slate-300"}),(0,f.jsx)("p",{children:"No client contacts added yet."}),(0,f.jsx)("p",{className:"text-sm",children:"Add contacts above who should receive emails about this event."})]}):(0,f.jsx)("div",{className:"space-y-3",children:null===(n=z.client_contacts)||void 0===n?void 0:n.map(e=>(0,f.jsx)("div",{className:"p-4 rounded-lg border-2 transition-colors ".concat(e.is_primary?"bg-green-50 border-green-300":"bg-white border-slate-200 hover:border-green-200"),children:(0,f.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,f.jsxs)("button",{type:"button",onClick:()=>{return t=e.id,B(e=>(0,m.A)((0,m.A)({},e),{},{client_contacts:e.client_contacts.map(e=>(0,m.A)((0,m.A)({},e),{},{is_primary:e.id===t}))})),void(y&&setTimeout(()=>Ge(),500));var t},className:"flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium transition-colors ".concat(e.is_primary?"bg-green-100 text-green-700 border border-green-300":"bg-slate-100 text-slate-500 hover:bg-green-50 hover:text-green-600"),children:[(0,f.jsx)(nt.A,{className:"h-3 w-3 ".concat(e.is_primary?"fill-green-500":"")}
1),e.is_primary?"Primary Contact":"Set as Primary"]})}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs text-slate-500 mb-1",children:"Name"}),(0,f.jsx)("input",{type:"text",value:e.name,onChange:t=>Me(e.id,"name",t.target.value),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 text-sm focus:outline-none focus:ring-2 focus:ring-green-500",placeholder:"Contact name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs text-slate-500 mb-1",children:"Email"}),(0,f.jsx)("input",{type:"email",value:e.email,onChange:t=>Me(e.id,"email",t.target.value),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 text-sm focus:outline-none focus:ring-2 focus:ring-green-500",placeholder:"[email protected]"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs text-slate-500 mb-1",children:"Mobile"}),(0,f.jsx)("input",{type:"tel",value:e.mobile||"",onChange:t=>Me(e.id,"mobile",t.target.value),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 text-sm focus:outline-none focus:ring-2 focus:ring-green-500",placeholder:"0400 000 000"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs text-slate-500 mb-1",children:"Role"}),(0,f.jsx)("input",{type:"text",value:e.role,onChange:t=>Me(e.id,"role",t.target.value),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 text-sm focus:outline-none focus:ring-2 focus:ring-green-500",placeholder:"Event Coordinator"})]})]})]}),(0,f.jsx)("button",{type:"button",onClick:()=>{return t=e.id,B(e=>{const s=e.client_contacts.filter(e=>e.id!==t);return s.length>0&&!s.some(e=>e.is_primary)&&(s[0].is_primary=!0),(0,m.A)((0,m.A)({},e),{},{client_contacts:s})}),void(y&&setTimeout(()=>Ge(),500));var t},className:"p-2 text-red-500 hover:bg-red-50 rounded-lg transition-colors",title:"Remove contact",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]})},e.id))})]})]}),(0,f.jsxs)("div",{style:Ko,children:[(0,f.jsx)(bt,{icon:Jr.A,title:"Hero Image",section:"hero",color:"amber"}),S.hero&&(0,f.jsxs)("div",{className:"p-6 space-y-4",children:[(0,f.jsx)("p",{className:"text-sm text-slate-600",children:"Shown as the photo on the crew app's Week and Events dashboards. Landscape, at least 1600px wide."}),z.hero_image_url?(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsx)("div",{className:"relative w-full overflow-hidden rounded-xl border border-slate-200 bg-slate-100",style:{aspectRatio:"16 / 9"},children:(0,f.jsx)("img",{src:z.hero_image_url,alt:"Event hero",className:"absolute inset-0 h-full w-full object-cover"})}),(0,f.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,f.jsxs)("label",{className:"px-3 py-1.5 text-sm text-indigo-600 hover:bg-indigo-100 rounded-lg transition-colors inline-flex items-center gap-1 cursor-pointer ".concat(te?"opacity-50 pointer-events-none":""),children:[(0,f.jsx)(_s.A,{className:"h-3.5 w-3.5"})," Replace",(0,f.jsx)("input",{type:"file",accept:"image/*",onChange:Je,className:"hidden",disabled:te})]}),(0,f.jsxs)("button",{type:"button",onClick:async()=>{if(confirm("Remove the hero image? The crew app will show its standard photo instead.")){ne("");try{if(y){var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(y,"/hero-image"),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}});if(!s.ok)throw new Error("Remove failed (".concat(s.status,")"))}B(e=>(0,m.A)((0,m.A)({},e),{},{hero_image_url:""}))}catch(t){console.error("Hero remove error:",t),ne(t.message||"Remove failed")}}},disabled:te,className:"px-3 py-1.5 text-sm text-red-600 hover:bg-red-50 rounded-lg transition-colors inline-flex items-center gap-1 disabled:opacity-50",children:[(0,f.jsx)(g.A,{className:"h-3.5 w-3.5"})," Remove"]})]})]}):(0,f.jsxs)("label",{className:"flex flex-col items-center justify-center p-8 border-2 border-dashed border-slate-300 rounded-xl cursor-pointer hover:border-indigo-400 hover:bg-indigo-50/50 transition-colors ".concat(te?"opacity-50 pointer-events-none":""),children:[(0,f.jsx)(Jr.A,{className:"h-8 w-8 text-slate-400 mb-2"}),(0,f.jsx)("span",{className:"text-sm font-medium text-indigo-600",children:"Click to upload a hero image"}),(0,f.jsx)("span",{className:"text-xs text-slate-500 mt-1",children:"JPEG, PNG, WebP or HEIC (max 15MB) \u2014 falls back to the standard crew photo when empty"}),(0,f.jsx)("input",{type:"file",accept:"image/*",onChange:Je,className:"hidden",disabled:te})]}),te&&(0,f.jsx)("p",{className:"text-sm text-indigo-600 text-center",children:"Uploading..."}),ae&&(0,f.jsx)("p",{className:"text-sm text-red-500 text-center",children:ae})]})]}),(0,f.jsxs)("div",{style:Ko,children:[(0,f.jsx)(bt,{icon:kt.A,title:"Supporting Documents",section:"documents",color:"orange"}),S.documents&&(0,f.jsxs)("div",{className:"p-6 space-y-4",children:[(null===(i=z.supporting_documents)||void 0===i?void 0:i.length)>0&&(0,f.jsx)("div",{className:"space-y-2",children:z.supporting_documents.map((e,t)=>{const s=!!e.external_url,a=e.link_id||e.file_key||e.s3_key||t,n=s?e.title||e.external_url:e.original_filename||"Document";return(0,f.jsxs)("div",{className:"flex items-center justify-between p-3 rounded-lg border ".concat(s?"bg-indigo-50 border-indigo-200":"bg-slate-50 border-slate-200"),children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[s?(0,f.jsx)(Ti.A,{className:"h-5 w-5 text-indigo-500 flex-shrink-0"}):(0,f.jsx)(zi.A,{className:"h-5 w-5 text-orange-500 flex-shrink-0"}),(0,f.jsxs)("div",{className:"min-w-0",children:[(0,f.jsx)("p",{className:"text-sm font-medium text-slate-900 truncate",children:n}),(0,f.jsx)("p",{className:"text-xs text-slate-500 truncate",children:s?e.external_url:"".concat((e.file_size/1024/1024).toFixed(2)," MB")}
1)]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,f.jsx)("a",{href:s?e.external_url:e.download_url,download:!s,target:"_blank",rel:"noopener noreferrer",className:"px-3 py-1.5 text-sm text-indigo-600 hover:bg-indigo-100 rounded-lg transition-colors inline-flex items-center gap-1",children:s?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(En.A,{className:"h-3.5 w-3.5"})," Open"]}):"Download"}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(confirm("Remove this document?"))try{if(y){var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token;await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(y,"/documents/").concat(encodeURIComponent(e)),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}})}const s=z.supporting_documents.filter(t=>t.file_key!==e&&t.s3_key!==e&&t.link_id!==e);B(e=>(0,m.A)((0,m.A)({},e),{},{supporting_documents:s}))}catch(s){console.error("Error removing file:",s)}})(e.link_id||e.file_key||e.s3_key),className:"p-1.5 text-red-500 hover:bg-red-50 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-4 w-4"})})]})]},a)})}),(0,f.jsxs)("label",{className:"flex flex-col items-center justify-center p-8 border-2 border-dashed border-slate-300 rounded-xl cursor-pointer hover:border-indigo-400 hover:bg-indigo-50/50 transition-colors",children:[(0,f.jsx)(_s.A,{className:"h-8 w-8 text-slate-400 mb-2"}),(0,f.jsx)("span",{className:"text-sm font-medium text-indigo-600",children:"Click to upload"}),(0,f.jsx)("span",{className:"text-xs text-slate-500 mt-1",children:"PDF, DOC, DOCX (max 10MB)"}),(0,f.jsx)("input",{type:"file",accept:".pdf,.doc,.docx",onChange:async e=>{const t=e.target.files[0];if(!t)return;if(["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"].includes(t.type))if(t.size>10485760)ee("File size must be less than 10MB");else{ee(""),Q(!0);try{var s;const e=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,a=new FormData;a.append("file",t),a.append("file_type","supporting_document"),y&&a.append("event_id",y);const n=await fetch("".concat(I.fn,"/api/corporate-admin/upload-supporting-document"),{method:"POST",headers:{Authorization:"Bearer ".concat(e)},body:a});if(!n.ok)throw new Error("Upload failed (".concat(n.status,")"));const r=await n.json();if(r.success){const e=[...z.supporting_documents||[],r.file];B(t=>(0,m.A)((0,m.A)({},t),{},{supporting_documents:e})),V("File uploaded"),setTimeout(()=>V(""),3e3)}else ee(r.message||"Upload failed")}catch(a){console.error("Upload error:",a),ee(a.message||"Upload failed")}finally{Q(!1),e.target.value=""}}else ee("Please upload a PDF, DOC, or DOCX file")},className:"hidden",disabled:$})]}),$&&(0,f.jsx)("p",{className:"text-sm text-indigo-600 text-center",children:"Uploading..."}),X&&(0,f.jsx)("p",{className:"text-sm text-red-500 text-center",children:X}),re?(0,f.jsxs)("div",{className:"p-4 bg-indigo-50 rounded-xl border border-indigo-200 space-y-3",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-indigo-900",children:[(0,f.jsx)(Ti.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Add external link (Google Slides, Sheets, Drive, etc.)"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"URL"}),(0,f.jsx)("input",{type:"url",value:oe,onChange:e=>le(e.target.value),placeholder:"https://docs.google.com/...",className:"w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:ring-2 focus:ring-indigo-500 focus:border-transparent",disabled:xe})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"Title (optional)"}),(0,f.jsx)("input",{type:"text",value:ce,onChange:e=>de(e.target.value),placeholder:"e.g. Run-of-show deck",className:"w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:ring-2 focus:ring-indigo-500 focus:border-transparent",disabled:xe})]}),me&&(0,f.jsx)("p",{className:"text-xs text-red-500",children:me}),(0,f.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,f.jsx)("button",{type:"button",onClick:()=>{ie(!1),le(""),de(""),pe("")},className:"px-3 py-1.5 text-sm text-slate-600 hover:bg-slate-100 rounded-lg transition-colors",disabled:xe,children:"Cancel"}),(0,f.jsx)("button",{type:"button",onClick:async()=>{pe("");const e=oe.trim(),t=ce.trim();if(e)if(/^https?:\/\//i.test(e))if(y){he(!0);try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,n=await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(y,"/external-link"),{method:"POST",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify({external_url:e,title:t})}
1),r=await n.json();if(!n.ok||!r.success)return void pe(r.detail||r.message||"Failed to add link");B(e=>(0,m.A)((0,m.A)({},e),{},{supporting_documents:[...e.supporting_documents||[],r.link]})),le(""),de(""),ie(!1),V("Link added"),setTimeout(()=>V(""),3e3)}catch(a){console.error("Add link error:",a),pe(a.message||"Failed to add link")}finally{he(!1)}}else pe("Save the event first before adding external links");else pe("URL must start with http:// or https://");else pe("Please enter a URL")},disabled:xe,className:"px-3 py-1.5 text-sm bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg transition-colors disabled:opacity-50 inline-flex items-center gap-1",children:xe?"Adding...":"Add link"})]})]}):(0,f.jsxs)("button",{type:"button",onClick:()=>ie(!0),className:"w-full flex items-center justify-center gap-2 p-3 border border-slate-300 rounded-xl text-sm font-medium text-indigo-600 hover:bg-indigo-50 hover:border-indigo-400 transition-colors",children:[(0,f.jsx)(Ti.A,{className:"h-4 w-4"}),"Add external link (Google Slides, Sheets, Drive, etc.)"]})]})]}),(0,f.jsxs)("div",{style:Ko,children:[(0,f.jsx)(bt,{icon:Nt.A,title:"Event Schedule",section:"schedule",color:"emerald"}),S.schedule&&(0,f.jsxs)("div",{className:"p-6 space-y-6",children:[ft({scope:"schedule"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-3",children:"Event Duration"}),(0,f.jsxs)("div",{className:"flex bg-slate-100 rounded-lg p-1 w-fit",children:[(0,f.jsx)("button",{type:"button",onClick:()=>Ve("event_duration_type","single"),className:"px-4 py-2 rounded-md text-sm font-medium transition-all ".concat("single"===z.event_duration_type?"bg-white text-emerald-600 shadow-sm":"text-slate-600 hover:text-slate-900"),children:"Single Day"}),(0,f.jsx)("button",{type:"button",onClick:()=>Ve("event_duration_type","multi"),className:"px-4 py-2 rounded-md text-sm font-medium transition-all ".concat("multi"===z.event_duration_type?"bg-white text-emerald-600 shadow-sm":"text-slate-600 hover:text-slate-900"),children:"Multi-Day"})]})]}),"single"===z.event_duration_type&&(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:["Event Date ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsx)("input",{type:"date",value:z.event_date,onChange:e=>Ve("event_date",e.target.value),onBlur:Ge,className:"date-input-light w-full px-4 py-3 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500",style:{colorScheme:"light",backgroundColor:"#ffffff",color:"#1e293b"}})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:["Start Time ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsx)("select",{value:z.start_time,onChange:e=>Ve("start_time",e.target.value),onBlur:Ge,className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500",children:He.map(e=>(0,f.jsx)("option",{value:e,children:e},e))})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:["End Time ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsx)("select",{value:z.end_time,onChange:e=>Ve("end_time",e.target.value),onBlur:Ge,className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500",children:He.map(e=>(0,f.jsx)("option",{value:e,children:e},e))})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,f.jsx)("label",{className:"text-sm font-medium text-slate-700",children:"Timed Events"}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsxs)("label",{className:"flex items-center gap-1.5 px-3 py-1.5 ".concat(ue?"bg-purple-400 cursor-wait":"bg-purple-600 hover:bg-purple-700 cursor-pointer"," text-white text-sm rounded-lg transition-colors"),children:[(0,f.jsx)("input",{type:"file",accept:".pdf,.docx",className:"hidden",disabled:ue,onChange:e=>{var t;null!==(t=e.target.files)&&void 0!==t&&t[0]&&(dt(e.target.files[0]),e.target.value="")}}),ue?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin h-4 w-4 border-2 border-white border-t-transparent roun
1ded-full"}),"Analyzing..."]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(_s.A,{className:"h-4 w-4"}),"AI Import (PDF / DOCX)"]})]}),(0,f.jsxs)("button",{type:"button",onClick:()=>{const e={id:"timed-".concat(Date.now()),time:"12:00",description:"",stream:"",notes:""};rt("timed_events",t=>Ue([...t||[],e]))},className:"flex items-center gap-1.5 px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white text-sm rounded-lg transition-colors",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"Add Event"]})]})]}),0===(at("timed_events")||[]).length?(0,f.jsx)("p",{className:"text-sm text-slate-500 text-center py-6 bg-slate-50 rounded-lg",children:D?"No ".concat(gt[D]||D,' events yet. Add one, or use "Mirror from\u2026" above to clone another role\'s schedule as a starting point.'):'No timed events yet. Click "Add Event" to create one.'}):(0,f.jsx)("div",{className:"space-y-2",children:Ue(at("timed_events")||[]).map(e=>(0,f.jsxs)("div",{className:"p-3 bg-slate-50 rounded-lg border border-slate-200",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("select",{value:e.time,onChange:t=>ct(e.id,"time",t.target.value),onBlur:Ge,className:"px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 font-mono text-sm",children:He.map(e=>(0,f.jsx)("option",{value:e,children:e},e))}),(0,f.jsx)("input",{type:"text",value:e.description,onChange:t=>ct(e.id,"description",t.target.value),onBlur:Ge,className:"flex-1 px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500",placeholder:"What's happening at this time?"}),(0,f.jsx)("input",{type:"text",value:e.stream||"",onChange:t=>ct(e.id,"stream",t.target.value),onBlur:Ge,className:"w-32 px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 text-sm",placeholder:"Stream / Track"}),(0,f.jsx)("button",{type:"button",onClick:()=>{return t=e.id,void rt("timed_events",e=>(e||[]).filter(e=>e.id!==t));var t},className:"p-2 text-red-500 hover:bg-red-50 rounded-lg transition-colors",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]}),(0,f.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-slate-400 shrink-0"}),(0,f.jsx)("input",{type:"text",value:e.location||"",onChange:t=>ct(e.id,"location",t.target.value),onBlur:Ge,className:"flex-1 px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500",placeholder:"Location / address for this item (tappable map link on the runsheet)"})]}),(0,f.jsx)("textarea",{value:e.notes||"",onChange:t=>ct(e.id,"notes",t.target.value),onBlur:Ge,rows:Math.min(8,Math.max(2,(e.notes||"").split("\n").length)),className:"mt-2 w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500",placeholder:"Notes / shot list \u2014 one item per line"})]},e.id))}),(0,f.jsx)("p",{className:"text-xs text-slate-500 mt-2",children:"Events are automatically sorted by time"})]})]}),"multi"===z.event_duration_type&&(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("label",{className:"text-sm font-medium text-slate-700",children:"Event Days"}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsxs)("label",{className:"flex items-center gap-1.5 px-3 py-1.5 ".concat(ue?"bg-purple-400 cursor-wait":"bg-purple-600 hover:bg-purple-700 cursor-pointer"," text-white text-sm rounded-lg transition-colors"),children:[(0,f.jsx)("input",{type:"file",accept:".pdf,.docx",className:"hidden",disabled:ue,onChange:e=>{var t;null!==(t=e.target.files)&&void 0!==t&&t[0]&&(dt(e.target.files[0]),e.target.value="")}}),ue?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full"}),"Analyzing..."]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(_s.A,{className:"h-4 w-4"}),"AI Import (PDF / DOCX)"]})]}),(0,f.jsxs)("button",{type:"button",onClick:()=>{const e={id:"day-".concat(Date.now()),date:"",start_time:"09:00",end_time:"17:00",location:"",timed_events:[],client_contacts:[]};B(t=>(0,m.A)((0,m.A)({},t),{},{event_days:[...t.event_days,e]}))},className:"flex items-center gap-1.5 px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white text-sm rounded-lg transition-colors",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"Add Day"]})]})]}),0===z.event_days.length?(0,f.jsx)("p",{className:"text-sm text-slate-500 text-center py-6 bg-slate-50 rounded-lg",children:'No event days added yet. Click "Add Day" to start.'}):(0,f.jsx)("div",{className:"space-y-4",children:z.event_days.map((e,t)=>{var s;return(0,f.jsxs)("div",{className:"p-4 bg-slate-50 rounded-xl border border-slate-200",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("h4",{className:"font-semibold text-slate-900",children:["Day ",t+1]}),(0,f.jsx)("button",{type:"button",onClick:()=>{return t=e.id,void B(e=>(0,m.A)((0,m.A)({},e),{},{event_days:e.event_days.filter(e=>e.id!==t)}));var t},className:"p-1.5 text-red-500 hover:bg-red-50 rounded-lg transition-colors",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-3",children:[(0,f.jsx)("input",{type:"date",value:e.date,onChange:t=>Ke(e.id,"date",t.target.value),onBlur:Ge,className:"date-input-light px-3 py-2 border border-slate-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-indigo-500",style:{colorScheme:"light",backgroundColor:"#ffffff",color:"#1e293b"}}),(0,f.jsx)("select",{value:e.start_time,onChange:t=>Ke(e.id,"start_time",t.target.value),onBlur:Ge,className:"px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500",children:He.map(e=>(0,f.jsx)("option",{value:e,children:e},e))}),(0,f.jsx)("select",{value:e.end_time,onChange:t=>Ke(e.id,"end_time",t.target.value),onBlur:Ge,className:"px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500",children:He.map(e=>(0,f.jsx)("option",{value:e,children:e},e))})]}),(0,f.jsx)("div",{className:"mb-4",children:(0,f.jsx)("input",{type:"text",value:e.location||"",onChange:t=>Ke(e.id,"location",t.target.value),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500",placeholder:"Location (if different from main venue)"})}),(0,f.jsxs)("div",{className:"mb-4 grid grid-cols-1 sm:grid-cols-[110px_1fr] gap-2",children:[(0,f.jsx)("input",{type:"time",value:e.handover_time||"",onChange:t=>Ke(e.id,"handover_time",t.target.value),onBlur:Ge,title:"Crew handover time",className:"px-3 py-2 bg-white border border-amber-200 rounded-lg text-slate-900 text-sm focus:outline-none focus:ring-2 focus:ring-amber-500"}),(0,f.jsx)("input",{type:"text",value:e.handover_notes||"",onChange:t=>Ke(e.id,"handover_notes",t.target.value),onBlur:Ge,placeholder:"Handover notes (what the incoming crew needs to know)",className:"px-3 py-2 bg-white border border-amber-200 rounded-lg text-slate-900 text-sm focus:outline-none focus:ring-2 focus:ring-amber-500"})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-medium text-slate-600",children:"Timed
1Events"}),(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{const t={id:"timed-".concat(Date.now()),time:"12:00",description:"",stream:""};B(s=>(0,m.A)((0,m.A)({},s),{},{event_days:s.event_days.map(s=>s.id===e?(0,m.A)((0,m.A)({},s),{},{timed_events:Ue([...s.timed_events,t])}):s)}))})(e.id),className:"text-xs text-emerald-600 hover:text-emerald-700 font-medium",children:"+ Add Event"})]}),0===e.timed_events.length?(0,f.jsx)("p",{className:"text-xs text-slate-400 py-2",children:"No timed events for this day"}):(0,f.jsx)("div",{className:"space-y-2",children:Ue(e.timed_events).map(t=>(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("select",{value:t.time,onChange:s=>Ze(e.id,t.id,"time",s.target.value),onBlur:Ge,className:"px-2 py-1.5 bg-white border border-slate-200 rounded text-sm text-slate-900 font-mono",children:He.map(e=>(0,f.jsx)("option",{value:e,children:e},e))}),(0,f.jsx)("input",{type:"text",value:t.description,onChange:s=>Ze(e.id,t.id,"description",s.target.value),onBlur:Ge,className:"flex-1 px-2 py-1.5 bg-white border border-slate-200 rounded text-sm text-slate-900",placeholder:"Description"}),(0,f.jsx)("input",{type:"text",value:t.stream||"",onChange:s=>Ze(e.id,t.id,"stream",s.target.value),onBlur:Ge,className:"w-28 px-2 py-1.5 bg-white border border-slate-200 rounded text-sm text-slate-900",placeholder:"Stream / Track"}),(0,f.jsx)("button",{type:"button",onClick:()=>((e,t)=>{B(s=>(0,m.A)((0,m.A)({},s),{},{event_days:s.event_days.map(s=>s.id===e?(0,m.A)((0,m.A)({},s),{},{timed_events:s.timed_events.filter(e=>e.id!==t)}):s)}))})(e.id,t.id),className:"p-1 text-red-500 hover:bg-red-50 rounded",children:(0,f.jsx)(la.A,{className:"h-3.5 w-3.5"})})]}),(0,f.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,f.jsx)(C.A,{className:"h-3.5 w-3.5 text-slate-400 shrink-0"}),(0,f.jsx)("input",{type:"text",value:t.location||"",onChange:s=>Ze(e.id,t.id,"location",s.target.value),onBlur:Ge,className:"flex-1 px-2 py-1.5 bg-white border border-slate-200 rounded text-sm text-slate-900",placeholder:"Location / address for this item (tappable map link)"})]}),(0,f.jsx)("textarea",{value:t.notes||"",onChange:s=>Ze(e.id,t.id,"notes",s.target.value),onBlur:Ge,rows:Math.min(8,Math.max(2,(t.notes||"").split("\n").length)),className:"mt-1.5 w-full px-2 py-1.5 bg-white border border-slate-200 rounded text-sm text-slate-900",placeholder:"Notes / shot list \u2014 one item per line"})]},t.id))})]}),(0,f.jsxs)("div",{className:"mt-4 pt-4 border-t border-slate-200",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-medium text-slate-600",children:"Day Contacts"}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(null===(s=z.client_contacts)||void 0===s?void 0:s.length)>0&&(0,f.jsxs)("select",{onChange:t=>{if(t.target.value){const s=z.client_contacts.find(e=>e.id===t.target.value);if(s){(e.client_contacts||[]).some(e=>e.contact_id===s.contact_id&&s.contact_id)?alert("This contact is already added to this day"):($e(e.id,s),y&&setTimeout(()=>Ge(),500))}t.target.value=""}},className:"px-2 py-1 bg-white border border-slate-200 rounded text-xs text-slate-700 focus:outline-none focus:ring-2 focus:ring-green-500",defaultValue:"",children:[(0,f.jsx)("option",{value:"",children:"+ From event contacts"}),z.client_contacts.map(e=>(0,f.jsxs)("option",{value:e.id,children:[e.name||"Unnamed"," ",e.role?"(".concat(e.role,")"):""]},e.id))]}),(0,f.jsx)("button",{type:"button",onClick:()=>{$e(e.id),y&&setTimeout(()=>Ge(),500)},className:"text-xs text-green-600 hover:text-green-700 font-medium",children:"+ Add Manually"})]})]}),0===(e.client_contacts||[]).length?(0,f.jsx)("p",{className:"text-xs text-slate-400 py-1",children:"No specific contacts for this day"}):(0,f.jsx)("div",{className:"space-y-2",children:(e.client_contacts||[]).map(t=>(0,f.jsxs)("div",{className:"flex items-center gap-2 bg-white p-2 rounded-lg border border-green-100",children:[(0,f.jsx)("input",{type:"text",value:t.name,onChange:s=>Qe(e.id,t.id,"name",s.target.value),onBlur:Ge,className:"flex-1 px-2 py-1 bg-white border border-slate-200 rounded text-xs text-slate-900",placeholder:"Name"}),(0,f.jsx)("input",{type:"email",value:t.email,onChange:s=>Qe(e.id,t.id,"email",s.target.value),onBlur:Ge,className:"flex-1 px-2 py-1 bg-white border border-slate-200 rounded text-xs text-slate-900",placeholder:"Email"}),(0,f.jsx)("input",{type:"tel",value:t.mobile||"",onChange:s=>Qe(e.id,t.id,"mobile",s.target.value),onBlur:Ge,className:"w-28 px-2 py-1 bg-white border border-slate-200 rounded text-xs text-slate-900",placeholder:"Mobile"}),(0,f.jsx)("input",{type:"text",value:t.role,onChange:s=>Qe(e.id,t.id,"role",s.target.value),onBlur:Ge,className:"w-24 px-2 py-1 bg-white border border-slate-200 rounded text-xs text-slate-900",placeholder:"Role"}),(0,f.jsx)("button",{type:"button",onClick:()=>{var s,a;s=e.id,a=t.id,B(e=>(0,m.A)((0,m.A)({},e),{},{event_days:e.event_days.map(e=>e.id===s?(0,m.A)((0,m.A)({},e),{},{client_contacts:(e.client_contacts||[]).filter(e=>e.id!==a)}):e)})),y&&setTimeout(()=>Ge(),500)},className:"p-1 text-red-500 hover:bg-red-50 rounded",children:(0,f.jsx)(la.A,{className:"h-3 w-3"})})]},t.id))})]})]},e.id)})})]})]})]}),(0,f.jsxs)("div",{style:Ko,children:[(0,f.jsx)(bt,{icon:Xe.A,title:"Crew Members",section:"crew",color:"purple"}),S.crew&&(0,f.jsxs)("div",{className:"p-6 space-y-4",children:[(0,f.jsxs)("div",{className:"p-4 bg-purple-50 rounded-lg",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Add Crew Member"}),(0,f.jsxs)(Ii.AM,{open:J,onOpenChange:Y,children:[(0,f.jsx)(Ii.Wv,{asChild:!0,children:(0,f.jsxs)("button",{type:"button",role:"combobox","aria-expanded":J,className:"w-full px-4 py-3 bg-white border border-purple-200 rounded-lg text-slate-900 text-left flex items-center justify-between focus:outline-none focus:ring-2 focus:ring-purple-500",children:[(0,f.jsx)("span",{className:"text-slate-500",children:"Search your crew or the Shootzu directory\u2026"}),(0,f.jsx)(Bi.A,{className:"h-4 w-4 opacity-50 flex-shrink-0 ml-2"})]})}),(0,f.jsx)(Ii.hl,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,f.jsxs)(Ri.uB,{children:[(0,f.jsx)(Ri.G7,{placeholder:"Search by name or email\u2026",value:je,onValueChange:we}),(0,f.jsxs)(Ri.oI,{children:[(0,f.jsx)(Ri.xL,{children:ke?"Searching Shootzu\u2026":"No crew member found."}),(0,f.jsx)(Ri.L$,{heading:"Your crew",children:ye.filter(e=>!z.crew_members.some(t=>t.crew_id===e.id)).map(e=>{const t="".concat(e.first_name||""," ").concat(e.last_name||"").trim();return(0,f.jsx)(Ri.h_,{value:"".concat(t," ").concat(e.email||""),onSelect:()=>{pt(e.id),Y(!1)},children:(0,f.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[e.photo_url?(0,f.jsx)("img",{src:e.photo_url,alt:"",className:"h-7 w-7 rounded-full object-cover flex-shrink-0"}):(0,f.jsx)("span",{className:"h-7 w-7 rounded-full bg-slate-200 flex-shrink-0"}),(0,f.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,f.jsx)("span",{className:"font-medium truncate",children:t}),(0,f.jsx)("span",{className:"text-xs text-slate-500 truncate",children:[e.email,e.mobile_number].filter(
1Boolean).join(" \xb7 ")})]})]})},e.id)})}),(0,f.jsxs)(Ri.L$,{heading:"Shootzu directory",className:ke||_e||Ne.length>0?"":"hidden",children:[_e&&(0,f.jsx)("div",{className:"px-3 py-2 text-xs text-amber-700 bg-amber-50",children:_e}),Ne.filter(e=>!z.crew_members.some(t=>t.shootzu_user_id===e.id)).map(e=>(0,f.jsx)(Ri.h_,{value:je,disabled:Fe===e.id,onSelect:()=>{Fe||(async e=>{Ee(e.id),Ce("");try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/crew/shootzu/allocate"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify({shootzu_user_id:e.id,event_id:y||""})});if(!a.ok){const e=await a.json().catch(()=>({}));throw new Error(e.detail||"Could not add this crew member.")}const{crew:n}=await a.json();ve(e=>e.some(e=>e.id===n.id)?e.map(e=>e.id===n.id?n:e):[...e,n]),pt(n.id,n),Y(!1),we("")}catch(s){Ce(s.message)}finally{Ee(null)}})(e)},children:(0,f.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0
1w-full",children:[e.photo_url?(0,f.jsx)("img",{src:e.photo_url,alt:"",className:"h-7 w-7 rounded-full object-cover flex-shrink-0"}):(0,f.jsx)("span",{className:"h-7 w-7 rounded-full bg-slate-200 flex-shrink-0"}),(0,f.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,f.jsx)("span",{className:"font-medium truncate",children:e.full_name||"\u2014"}),(0,f.jsx)("span",{className:"text-xs text-slate-500 truncate",children:[e.email,e.phone].filter(Boolean).join(" \xb7 ")}),(0,f.jsx)("span",{className:"text-[11px] text-slate-400 truncate",children:[(e.suggested_roles||[]).map(e=>gt[e]||e).join(", "),[e.location_city,e.location_state].filter(Boolean).join(", ")].filter(Boolean).join(" \u2014 ")})]}),(0,f.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-slate-400 flex-shrink-0 ml-2",children:Fe===e.id?"Adding\u2026":e.already_mirrored?"On your crew":"Shootzu"})]})},"sz-".concat(e.id)))]})]})]})})]})]}),0===z.crew_members.length?(0,f.jsx)("p",{className:"text-sm text-slate-500 text-center py-6 bg-slate-50 rounded-lg",children:"No crew members assigned yet."}):(0,f.jsx)("div",{className:"space-y-3",children:z.crew_members.map(e=>(0,f.jsxs)("div",{className:"p-4 bg-slate-50 rounded-lg border-l-4 border-purple-500",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex-1 grid grid-cols-1 md:grid-cols-4 gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500",children:"Name"}),(0,f.jsx)("p",{className:"font-medium text-slate-900",children:e.name})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500",children:"Mobile"}),(0,f.jsx)("p",{className:"text-slate-700",children:e.mobile||"-"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500",children:"Email"}),(0,f.jsx)("p",{className:"text-slate-700 truncate",children:e.email||"-"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-xs text-slate-500",children:"Role"}),(0,f.jsxs)("select",{value:e.role,onChange:t=>xt(e.id,"role",t.target.value),onBlur:Ge,className:"mt-1 px-2 py-1 bg-white border border-slate-200 rounded text-sm text-slate-900",children:[(0,f.jsx)("option",{value:"photographer",children:"Photographer"}),(0,f.jsx)("option",{value:"second_photographer",children:"Second Photographer"}),(0,f.jsx)("option",{value:"videographer",children:"Videographer"}),(0,f.jsx)("option",{value:"second_videographer",children:"Second Videographer"}),(0,f.jsx)("option",{value:"voxpop_videographer",children:"VoxPop Videographer"}),(0,f.jsx)("option",{value:"editor",children:"Editor"}),(0,f.jsx)("option",{value:"remote_editor",children:"Remote Editor"}),(0,f.jsx)("option",{value:"producer",children:"Producer"}),(0,f.jsx)("option",{value:"assistant",children:"Assistant"}),(0,f.jsx)("option",{value:"coordinator",children:"Coordinator"})]})]})]}),(0,f.jsx)("button",{type:"button",onClick:()=>{return t=e.id,void B(e=>(0,m.A)((0,m.A)({},e),{},{crew_members:e.crew_members.filter(e=>e.id!==t)}));var t},className:"ml-4 p-2 text-red-500 hover:bg-red-50 rounded-lg transition-colors",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]}),(z.role_variants||[]).length>0&&(0,f.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-200",children:[(0,f.jsxs)("label",{className:"block text-xs text-slate-500 mb-1",children:["Runsheet",(0,f.jsx)("span",{className:"text-slate-400 font-normal ml-1",children:"(which timeline this crew sees + their personal link)"})]}),(0,f.jsxs)("select",{value:e.runsheet_variant_id||"",onChange:t=>xt(e.id,"runsheet_variant_id",t.target.value||null),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900",children:[(0,f.jsxs)("option",{value:"",children:["Auto \u2014 match by role (",gt[e.role]||e.role||"no role set",")"]}),(z.role_variants||[]).filter(e=>!1!==e.enabled).map(e=>(0,f.jsx)("option",{value:e.id,children:e.label&&e.label.trim()||gt[e.role]||e.role},e.id))]}),!e.runsheet_variant_id&&!(z.role_variants||[]).some(t=>t.role===e.role&&!1!==t.enabled)&&(0,f.jsx)("p",{className:"mt-1 text-xs text-amber-600",children:"\u26a0 Not matched to any runsheet \u2014 pick one so their link and the crew app open the right timeline."})]}),(0,f.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-200 grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-xs text-slate-500 mb-1",children:["Start time",(0,f.jsxs)("span",{className:"text-slate-400 font-normal ml-1",children:["(defaults to event start: ",z.start_time||"09:00",")"]})]}),(0,f.jsxs)("select",{value:e.start_time||"",onChange:t=>xt(e.id,"start_time",t.target.value||null),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900 font-mono",children:[(0,f.jsxs)("option",{value:"",children:["Inherit event (",z.start_time||"09:00",")"]}),He.map(e=>(0,f.jsx)("option",{value:e,children:e},e))]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-xs text-slate-500 mb-1",children:["End time",(0,f.jsxs)("span",{className:"text-slate-400 font-normal ml-1",children:["(defaults to event end: ",z.end_time||"17:00",")"]})]}),(0,f.jsxs)("select",{value:e.end_time||"",onChange:t=>xt(e.id,"end_time",t.target.value||null),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-sm text-slate-900 font-mono",children:[(0,f.jsxs)("option",{value:"",children:["Inherit event (",z.end_time||"17:00",")"]}),He.map(e=>(0,f.jsx)("option",{value:e,children:e},e))]})]})]}),"multi"===z.event_duration_type&&z.event_days.length>0&&(0,f.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-200",children:[(0,f.jsx)("p",{className:"text-xs text-slate-500 mb-2",children:"Assigned Days:"}),(0,f.jsx)("div",{className:"flex flex-wrap gap-2",children:z.event_days.map((t,s)=>{const a=(e.assigned_days||[]).includes(t.id);return(0,f.jsxs)("label",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg cursor-pointer transition-colors ".concat(a?"bg-purple-100 border-purple-300 border":"bg-white border border-slate-200 hover:border-purple-200"),children:[(0,f.jsx)("input",{type:"checkbox",checked:a,onChange:s=>{const a=e.assigned_days||[],n=s.target.checked?[...a,t.id]:a.filter(e=>e!==t.id);xt(e.id,"assigned_days",n)},className:"w-4 h-4 text-purple-600 border-slate-300 rounded focus:ring-purple-500"}),(0,f.jsxs)("span",{className:"text-sm font-medium ".concat(a?"text-purple-700":"text-slate-600"),children:["Day ",s+1,t.date&&(0,f.jsxs)("span",{className:"text-xs ml-1 text-slate-400",children:["(",new Date(t.date).toLocaleDateString("en-AU",{day:"numeric",month:"short"}),")"]})]})]},t.id)})})]})]},e.id))})]})]}),(0,f.jsxs)("div",{style:Ko,children:[(0,f.jsx)(bt,{icon:kt.A,title:"Special Briefing Notes",section:"briefing",color:"amber"}),S.briefing&&(0,f.jsxs)("div",{className:"p-6",children:[ft({scope:"brief"}),(0,f.jsx)("textarea",{value:at("brief")||"",onChange:e=>rt("brief",e.target.value),onBlur:Ge,className:"w-full px-4 py-3 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-indigo-500",rows:"5",placeholder:D?"".concat(gt[D]||D,"-specific briefing notes\u2026"):"Special instructions or briefing notes for the crew..."}),null!==D&&(0,f.jsx)("p",{className:"mt-2 text-xs text-slate-500",children:"Leave empty to fall back to the Shared briefing for this role."})]})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Ko),{},{borderTop:"3px solid #10B981"}),children:[(0,f.jsxs)("div",{className:"cursor-pointer",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 18px",borderBottom:S.voxpops?"1px solid #EDEDF0":"none"},onClick:()=>_(e=>(0,m.A)((0,m.A)({},e),{},{voxpops:!e.voxpops})),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:13},children:[(0,f.jsx)("span",{style:{width:30,height:30,borderRadius:8,background:"#F4F4F6",color:"#55555C",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(Di.A,{size:16})}),(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,color:"#0A0A0B",margin:0},children:"Voxpops"})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsxs)("label",{className:"flex items-center space-x-2",onClick:e=>e.stopPropagation(),children:[(0,f.jsx)("span",{className:"text-sm text-slate-500",children:null!==(l=z.voxpops)&&void 0!==l&&l.enabled?"Enabled":"Disabled"}),(0,f.jsx)("button",{type:"button",onClick:()=>{var e;const t=(0,m.A)((0,m.A)({},z.voxpops),{},{enabled:!(null!==(e=z.voxpops)&&void 0!==e&&e.enabled)});Ve("voxpops",t),Ge()},className:"relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(null!==(c=z.voxpops)&&void 0!==c&&c.enabled?"bg-emerald-500":"bg-slate-300"),children:(0,f.jsx)("span",{className:"inline-block h-4 w-4 transform rounded-full bg-white transition-transform ".concat(null!==(d=z.voxpops)&&void 0!==d&&d.enabled?"translate-x-6":"translate-x-1")})})]}),S.voxpops?(0,f.jsx)(Tt.A,{className:"h-5 w-5 text-slate-400"}):(0,f.jsx)(Et.A,{className:"h-5 w-5 text-slate-400"})]})]}),S.voxpops&&(0,f.jsx)("div",{className:"p-6 space-y-4",children:null!==(p=z.voxpops)&&void 0!==p&&p.enabled?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-slate-700",children:"Voxpop Subjects"}),(0,f.jsxs)("button",{type:"button",onClick:()=>
1{if(B(e=>(0,m.A)((0,m.A)({},e),{},{voxpops:(0,m.A)((0,m.A)({},e.voxpops),{},{enabled:!0,items:[...e.voxpops&&e.voxpops.items||[],{id:"undefined"!==typeof crypto&&crypto.randomUUID?"vox-".concat(crypto.randomUUID().slice(0,8)):"vox-".concat(Date.now()),time:"",contact_name:"",meeting_point:""}]})})),K&&clearTimeout(K),y&&w){const e=setTimeout(()=>Ge(),500);Z(e)}},className:"flex items-center gap-1.5 px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white text-sm rounded-lg transition-colors",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"Add Voxpop"]})]}),0===((null===(x=z.voxpops)||void 0===x?void 0:x.items)||[]).length?(0,f.jsx)("p",{className:"text-sm text-slate-400 italic",children:'No voxpop subjects yet. Click "Add Voxpop" to add one.'}):z.voxpops.items.map((e,t)=>(0,f.jsxs)("div",{className:"p-4 bg-slate-50 rounded-lg border-l-4 border-emerald-500",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between gap-3 mb-3",children:[(0,f.jsxs)("p",{className:"text-xs font-semibold text-emerald-700 uppercase tracking-wider",children:["Subject ",t+1]}),(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{if(B(t=>(0,m.A)((0,m.A)({},t),{},{voxpops:(0,m.A)((0,m.A)({},t.voxpops),{},{items:(t.voxpops&&t.voxpops.items||[]).filter(t=>t.id!==e)})})),K&&clearTimeout(K),y&&w){const e=setTimeout(()=>Ge(),500);Z(e)}})(e.id),className:"p-1.5 text-red-500 hover:bg-red-50 rounded-lg transition-colors",title:"Remove voxpop",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"Time"}),(0,f.jsx)("input",{type:"time",value:e.time||"",onChange:t=>ht(e.id,"time",t.target.value),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-emerald-500"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"Contact Name"}),(0,f.jsx)("input",{type:"text",value:e.contact_name||"",onChange:t=>ht(e.id,"contact_name",t.target.value),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-emerald-500",placeholder:"e.g. Sarah Jones"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"Meeting Point"}),(0,f.jsx)("input",{type:"text",value:e.meeting_point||"",onChange:t=>ht(e.id,"meeting_point",t.target.value),onBlur:Ge,className:"w-full px-3 py-2 bg-white border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-emerald-500",placeholder:"e.g. Main lobby entrance"})]})]})]},e.id))]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-slate-700",children:["Suggested Questions ",(0,f.jsx)("span",{className:"text-xs font-normal text-slate-400",children:"(shared across all voxpops)"})]}),(0,f.jsxs)("button",{type:"button",onClick:()=>{var e;const t=[...(null===(e=z.voxpops)||void 0===e?void 0:e.questions)||[],""];Ve("voxpops",(0,m.A)((0,m.A)({},z.voxpops),{},{questions:t}))},className:"flex items-center gap-1.5 px-3 py-1.5 bg-emerald-600 hover:bg-emerald-700 text-white text-sm rounded-lg transition-colors",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"Add Question"]})]}),0===((null===(h=z.voxpops)||void 0===h?void 0:h.questions)||[]).length?(0,f.jsx)("p",{className:"text-sm text-slate-400 italic",children:"No questions added yet."}):(0,f.jsx)("div",{className:"space-y-2",children:z.voxpops.questions.map((e,t)=>(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsxs)("span",{className:"text-sm font-medium text-slate-400 w-6 text-right",children:[t+1,"."]}),(0,f.jsx)("input",{type:"text",value:e,onChange:e=>{const s=[...z.voxpops.questions];s[t]=e.target.value,Ve("voxpops",(0,m.A)((0,m.A)({},z.voxpops),{},{questions:s}))},onBlur:Ge,className:"flex-1 px-3 py-2 bg-slate-50 border border-slate-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-emerald-500",placeholder:"Enter a question..."}),(0,f.jsx)("button",{type:"button",onClick:()=>{const e=z.voxpops.questions.filter((e,s)=>s!==t);Ve("voxpops",(0,m.A)((0,m.A)({},z.voxpops),{},{questions:e})),Ge()},className:"p-2 text-red-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]},t))})]})]}):(0,f.jsx)("p",{className:"text-sm text-slate-500 italic",children:"Enable voxpops to configure street interview details."})})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Ko),{},{borderTop:"3px solid #7C3AED"}),children:[(0,f.jsx)(bt,{icon:In.A,title:"Must Capture Checklist",section:"checklist",color:"purple"}),S.checklist&&(0,f.jsxs)("div",{className:"p-6 space-y-4",children:[ft({scope:"must_capture"}),(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("p",{className:"text-sm text-slate-600",children:D?"Items the ".concat(gt[D]||D," must capture (overrides the Shared list)."):"Items crew must capture during the event"}),(0,f.jsxs)("button",{type:"button",onClick:()=>{rt("must_capture",e=>{const t=Array.isArray(e)?e:[];return[...t,{id:Date.now().toString(),text:"",order:t.length}]})},className:"flex items-center gap-1.5 px-3 py-1.5 bg-purple-600 hover:bg-purple-700 text-white text-sm rounded-lg transition-colors",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"Add Item"]})]}),(()=>{const e=at("must_capture")||[];return 0===e.length?(0,f.jsx)("p",{className:"text-sm text-slate-500 text-center py-6 bg-slate-50 rounded-lg",children:D?"No ".concat(gt[D]||D,' items yet. Add one, or use "Mirror from\u2026" above.'):"No checklist items
1yet."}):(0,f.jsx)("div",{className:"space-y-2",children:[...e].sort((e,t)=>e.order-t.order).map((t,s)=>(0,f.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-purple-50 rounded-lg border border-purple-200",children:[(0,f.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,f.jsx)("button",{type:"button",onClick:()=>{s>0&&(rt("must_capture",e=>{const t=Array.isArray(e)?[...e]:[];return t[s].order=s-1,t[s-1].order=s,t}),Ge())},disabled:0===s,className:"text-xs ".concat(0===s?"text-slate-300":"text-slate-500 hover:text-slate-700"),children:"\u25b2"}),(0,f.jsx)("button",{type:"button",onClick:()=>{s<e.length-1&&(rt("must_capture",e=>{const t=Array.isArray(e)?[...e]:[];return t[s].order=s+1,t[s+1].order=s,t}),Ge())},disabled:s===e.length-1,className:"text-xs ".concat(s===e.length-1?"text-slate-300":"text-slate-500 hover:text-slate-700"),children:"\u25bc"})]}),(0,f.jsxs)("span",{className:"text-purple-600 font-bold text-sm",children:[s+1,"."]}),(0,f.jsx)("input",{type:"text",value:t.text,onChange:e=>{rt("must_capture",s=>(Array.isArray(s)?s:[]).map(s=>s.id===t.id?(0,m.A)((0,m.A)({},s),{},{text:e.target.value}):s))},onBlur:Ge,placeholder:"Enter checklist item...",className:"flex-1 px-3 py-2 bg-white border border-purple-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-purple-500"}),(0,f.jsxs)("select",{value:t.deliverable_id||"",onChange:e=>{const s=e.target.value||null;rt("must_capture",e=>(Array.isArray(e)?e:[]).map(e=>e.id===t.id?(0,m.A)((0,m.A)({},e),{},{deliverable_id:s}):e)),Ge()},title:"Which deliverable this shot feeds",className:"w-44 px-2 py-2 bg-white border border-purple-200 rounded-lg text-slate-700 text-xs focus:outline-none focus:ring-2 focus:ring-purple-500",children:[(0,f.jsx)("option",{value:"",children:"\u2014 no deliverable \u2014"}),(z.deliverables||[]).map(e=>(0,f.jsx)("option",{value:e.id,children:e.short_label||e.name||"Untitled"},e.id))]}),(0,f.jsx)("button",{type:"button",onClick:()=>{rt("must_capture",e=>(Array.isArray(e)?e:[]).filter(e=>e.id!==t.id).map((e,t)=>(0,m.A)((0,m.A)({},e),{},{order:t}))),Ge()},className:"p-2 text-red-500 hover:bg-red-50 rounded-lg transition-colors",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]},t.id))})})(),null!==D&&(0,f.jsx)("p",{className:"text-xs text-slate-500",children:"Empty per-role list falls back to the Shared checklist on the public runsheet."})]})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Ko),{},{borderTop:"3px solid #E11D48"}),children:[(0,f.jsx)(bt,{icon:nt.A,title:"Priority Sponsor Stands",section:"priorityStands",color:"rose"}),S.priorityStands&&(0,f.jsxs)("div",{className:"p-6 space-y-4",children:[(0,f.jsx)("p",{className:"text-sm text-slate-600",children:"Please ensure you capture at least one strong shot at each of the following stands with clear branding and visible attendee engagement."}),(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("p",{className:"text-sm text-slate-500",children:"Sponsor stands the crew must photograph"}),(0,f.jsxs)("button",{type:"button",onClick:()=>{const e=z.priority_sponsor_stands||[],t={id:Date.now().toString(),text:"",order:e.length};Ve("priority_sponsor_stands",[...e,t])},className:"flex items-center gap-1.5 px-3 py-1.5 bg-rose-600 hover:bg-rose-700 text-white text-sm rounded-lg transition-colors",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"Add Stand"]})]}),z.priority_sponsor_stands&&0!==z.priority_sponsor_stands.length?(0,f.jsx)("div",{className:"space-y-2",children:z.priority_sponsor_stands.sort((e,t)=>e.order-t.order).map((e,t)=>(0,f.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-rose-50 rounded-lg border border-rose-200",children:[(0,f.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,f.jsx)("button",{type:"button",onClick:()=>{if(t>0){const e=[...z.priority_sponsor_stands||[]];e[t].order=t-1,e[t-1].order=t,Ve("priority_sponsor_stands",e),Ge()}},disabled:0===t,className:"text-xs ".concat(0===t?"text-slate-300":"text-slate-500 hover:text-slate-700"),children:"\u25b2"}),(0,f.jsx)("button",{type:"button",onClick:()=>{const e=z.priority_sponsor_stands||[];if(t<e.length-1){const s=[...e];s[t].order=t+1,s[t+1].order=t,Ve("priority_sponsor_stands",s),Ge()}},disabled:t===(z.priority_sponsor_stands||[]).length-1,className:"text-xs ".concat(t===(z.priority_sponsor_stands||[]).length-1?"text-slate-300":"text-slate-500 hover:text-slate-700"),
1children:"\u25bc"})]}),(0,f.jsxs)("span",{className:"text-rose-600 font-bold text-sm",children:[t+1,"."]}),(0,f.jsx)("input",{type:"text",value:e.text,onChange:t=>{const s=(z.priority_sponsor_stands||[]).map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{text:t.target.value}):s);Ve("priority_sponsor_stands",s)},onBlur:Ge,placeholder:"e.g. Hilton Hotels \u2014 booth 3B",className:"flex-1 px-3 py-2 bg-white border border-rose-200 rounded-lg text-slate-900 focus:outline-none focus:ring-2 focus:ring-rose-500"}),(0,f.jsx)("button",{type:"button",onClick:()=>{const t=(z.priority_sponsor_stands||[]).filter(t=>t.id!==e.id).map((e,t)=>(0,m.A)((0,m.A)({},e),{},{order:t}));Ve("priority_sponsor_stands",t),Ge()},className:"p-2 text-red-500 hover:bg-red-50 rounded-lg transition-colors",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]},e.id))}):(0,f.jsx)("p",{className:"text-sm text-slate-500 text-center py-6 bg-slate-50 rounded-lg",children:"No sponsor stands yet."})]})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Ko),{},{borderTop:"3px solid #D97706"}),children:[(0,f.jsx)(bt,{icon:as.A,title:"Deliverables".concat(null!==(u=z.deliverables)&&void 0!==u&&u.length?" (".concat(z.deliverables.length,")"):""),section:"deliverables",color:"amber"}),S.deliverables&&(0,f.jsxs)("div",{className:"p-6 space-y-4",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("p",{className:"text-sm text-slate-600",children:"What the client receives. Shown on the runsheet share link and the client portal, and used by the crew app's shot manifest \u2014 tag must-capture shots to a deliverable to give the crew a progress count."}),(0,f.jsxs)("button",{type:"button",onClick:()=>{const e=z.deliverables||[],t={id:"del-".concat(Date.now()),name:"",description:"",short_label:"",due:"",target_count:0,role:""};Ve("deliverables",[...e,t])},className:"flex items-center gap-1.5 px-3 py-1.5 bg-amber-600 hover:bg-amber-700 text-white text-sm rounded-lg transition-colors",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"Add Deliverable"]})]}),z.deliverables&&0!==z.deliverables.length?(0,f.jsx)("div",{className:"space-y-2",children:z.deliverables.map((e,t)=>{var s;return(0,f.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-amber-50 rounded-lg border border-amber-200",children:[(0,f.jsxs)("div",{className:"flex flex-col gap-0.5 pt-1.5",children:[(0,f.jsx)("button",{type:"button",onClick:()=>{if(t>0){const e=[...z.deliverables||[]];[e[t-1],e[t]]=[e[t],e[t-1]],Ve("deliverables",e),Ge()}},disabled:0===t,className:"text-xs ".concat(0===t?"text-slate-300":"text-slate-500 hover:text-slate-700"),children:"\u25b2"}),(0,f.jsx)("button",{type:"button",onClick:()=>{const e=z.deliverables||[];if(t<e.length-1){const s=[...e];[s[t+1],s[t]]=[s[t],s[t+1]],Ve("deliverables",s),Ge()}},disabled:t===(z.deliverables||[]).length-1,className:"text-xs ".concat(t===(z.deliverables||[]).length-1?"text-slate-300":"text-slate-500 hover:text-slate-700"),children:"\u25bc"})]}),(0,f.jsxs)("span",{className:"text-amber-600 font-bold text-sm pt-2",children:[t+1,"."]}),(0,f.jsxs)("div",{className:"flex-1 space-y-1.5",children:[(0,f.jsx)("input",{type:"text",value:e.name,onChange:t=>{const s=(z.deliverables||[]).map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{name:t.target.value}):s);Ve("deliverables",s)},onBlur:Ge,placeholder:'Name (e.g. "200 edited photos")',className:"w-full px-3 py-2 bg-white border border-amber-200 rounded-lg text-slate-900 text-sm font-medium focus:outline-none focus:ring-2 focus:ring-amber-500"}),(0,f.jsx)("input",{type:"text",value:e.description||"",onChange:t=>{const s=(z.deliverables||[]).map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{description:t.target.value}):s);Ve("deliverables",s)},onBlur:Ge,placeholder:'Description (optional, e.g. "Delivered within 48 hours")',className:"w-full px-3 py-2 bg-white border border-amber-200 rounded-lg text-slate-700 text-sm focus:outline-none focus:ring-2 focus:ring-amber-500"}),(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-1.5",children:[(0,f.jsxs)("select",{value:e.role||"",onChange:t=>{const s=(z.deliverables||[]).map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{role:t.target.value}):s);Ve("deliverables",s),setTimeout(Ge,0)},className:"px-3 py-2 bg-white border border-amber-200 rounded-lg text-slate-700 text-sm focus:outline-none focus:ring-2 focus:ring-amber-500",children:[(0,f.jsx)("option",{value:"",children:"Role: whole crew"}),(0,f.jsx)("option",{value:"videographer",children:"Role: Video"}),(0,f.jsx)("option",{value:"photographer",children:"Role: Photo"})]}),(0,f.jsx)("input",{type:"text",value:e.short_label||"",onChange:t=>{const s=(z.deliverables||[]).map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{short_label:t.target.value}):s);Ve("deliverables",s)},onBlur:Ge,placeholder:'Crew tile label (e.g. "60s RECAP")',className:"px-3 py-2 bg-white border border-amber-200 rounded-lg text-slate-700 text-sm focus:outline-none focus:ring-2 focus:ring-amber-500"}),(0,f.jsx)("input",{type:"text",value:e.due||"",onChange:t=>{const s=(z.deliverables||[]).map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{due:t.target.value}):s);Ve("deliverables",s)},onBlur:Ge,placeholder:'Due (e.g. "Tonight 19:00")',className:"px-3 py-2 bg-white border border-amber-200 rounded-lg text-slate-700 text-sm focus:outline-none focus:ring-2 focus:ring-amber-500"}),(0,f.jsx)("input",{type:"number",min:"0",value:null!==(s=e.target_count)&&void 0!==s?s:0,onChange:t=>{const s=(z.deliverables||[]).map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{target_count:Number(t.target.value)||0}):s);Ve("deliverables",s)},onBlur:Ge,placeholder:"Shots needed",title:"How many must-capture shots feed this deliverable. 0 = don't track progress.",className:"px-3 py-2 bg-white border border-amber-200 rounded-lg text-slate-700 text-sm focus:outline-none focus:ring-2 focus:ring-amber-500"})]})]}),(0,f.jsx)("button",{type:"button",onClick:()=>{const t=(z.deliverables||[]).filter(t=>t.id!==e.id);Ve("deliverables",t),Ge()},className:"p-2 text-red-500 hover:bg-red-50 rounded-lg transition-colors mt-1",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]},e.id)})}):(0,f.jsx)("p",{className:"text-sm text-slate-500 text-center py-6 bg-slate-50 rounded-lg",children:"No deliverables yet. Add the first one to let the client see what's included."})]})]}),(0,f.jsxs)("div",{style:Ko,children:[(0,f.jsx)(bt,{icon:Jr.A,title:"Gallery & Film",section:"linkedMedia",color:"teal"}),S.linkedMedia&&(0,f.jsxs)("div",{className:"p-6 space-y-4",children:[(0,f.jsx)("p",{className:"text-sm text-slate-500",children:"Attach the Turbo IQ gallery and the Turbo Reviews cut once they are ready. Both appear on the crew's Brief and on the client's job page, and open the ordinary public share link."}),(0,f.jsx)($o,{label:"Photo gallery",placeholder:"https://iq.turbo.net.au/share/\u2026",value:z.gallery,countLabel:e=>e.photo_count?"".concat(e.photo_count," photos"):null,onChange:e=>{B(t=>(0,m.A)((0,m.A)({},t),{},{gallery:e})),setTimeout(Ge,0)}}),(0,f.jsx)($o,{label:"Film",placeholder:"https://reviews.turbo.net.au/share/bundle/\u2026",value:z.video_project,countLabel:e=>e.item_count?"".concat(e.item_count," cuts"):null,onChange:e=>{B(t=>(0,m.A)((0,m.A)({},t),{},{video_project:e})),setTimeout(Ge,0)}})]})]}),(0,f.jsxs)("div",{style:Ko,children:[(0,f.jsx)(bt,{icon:_s.A,title:"Crew Upload Instructions",section:"upload",color:"cyan"}),S.upload&&(0,f.jsxs)("div",{className:"p-6 space-y-4",children:[(0,f.jsxs)("div",{className:"p-4 bg-gradient-to-r from-violet-50 to-indigo-50 rounded-lg border border-violet-200",children:[(0,f.jsxs)("label",{className:"flex items-start gap-4 cursor-pointer",children:[(0,f.jsx)("input",{type:"checkbox",checked:z.masv_upload_enabled,onChange:e=>Ve("masv_upload_enabled",e.target.checked),onBlur:Ge,className:"mt-1 h-5 w-5 text-violet-600 rounded focus:ring-2 focus:ring-violet-500"}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:"MASV Upload Portal"}),(0,f.jsx)("p",{className:"text-sm text-slate-600",children:"Browser-based uploads for large video files. No software installation required."})]})]}),z.masv_upload_enabled&&y&&(0,f.jsx)("div",{className:"mt-4 ml-9 space-y-3",children:null!==Te&&void 0!==Te&&Te.portal_id?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-white rounded-lg border border-violet-200",children:[(0,f.jsx)(Ti.A,{className:"h-4 w-4 text-violet-600 flex-shrink-0"}),(0,f.jsx)("a",{href:Te.portal_url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-violet-700 hover:underline truncate flex-1",children:Te.portal_url}),(0,f.jsxs)("button",{onClick:()=>{null!==Te&&void 0!==Te&&Te.portal_url&&(navigator.clipboard.writeText(Te.portal_url),We(!0),setTimeout(()=>We(!1),2e3))},className:"flex items-center gap-1 px-2 py-1 text-xs bg-violet-100 hover:bg-violet-200 text-violet-700 rounded transition-colors",children:[(0,f.jsx)(Cr.A,{className:"h-3 w-3"}),Pe?"Copied!":"Copy"]})]}),(0,f.jsx)("div",{className:"flex items-center gap-4 text-sm text-slate-600",children:(0,f.jsxs)("span",{children:["Job Code: ",(0,f.jsx)("strong",{className:"text-slate-900",children:Te.job_c
1ode})]})}),Ie.length>0&&(0,f.jsxs)("div",{className:"space-y-1",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wider",children:"Recent Uploads"}),Ie.slice(0,5).map((e,t)=>(0,f.jsxs)("div",{className:"flex items-center justify-between text-sm p-2 bg-white rounded border border-slate-100",children:[(0,f.jsx)("span",{className:"text-slate-700",children:e.sender_name}),(0,f.jsxs)("span",{className:"text-slate-500",children:[e.file_count," file",1!==e.file_count?"s":""," \xb7 ",(e.size_bytes/1048576).toFixed(0)," MB"]})]},e.id||t))]}),(0,f.jsx)("button",{onClick:async()=>{if(confirm("Delete the MASV upload portal? Crew will no longer be able to upload via this link.")){De(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(y,"/masv-portal"),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}});(await s.json()).success&&(ze(null),Re([]),Ve("masv_upload_enabled",!1),Ge())}catch(t){console.error("Failed to delete MASV portal:",t)}finally{De(!1)}}},disabled:Be,className:"text-xs text-red-500 hover:text-red-700 transition-colors",children:Be?"Deleting...":"Delete Portal"})]}):(0,f.jsxs)("button",{onClick:async()=>{De(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/corporate-admin/events/").concat(y,"/masv-portal"),{method:"POST",headers:{Authorization:"Bearer ".concat(t)}}),a=await s.json();a.success?ze({portal_id:a.portal.id,portal_url:a.portal.url,job_code:a.portal.job_code,created_at:a.portal.created_at,enabled:!0}):alert(a.detail||"Failed to create MASV portal")}catch(t){console.error("Failed to create MASV portal:",t),alert("Failed to create MASV portal")}finally{De(!1)}},disabled:Be,className:"flex items-center gap-2 px-4 py-2 bg-violet-600 hover:bg-violet-700 text-white rounded-lg text-sm font-medium transition-colors disabled:opacity-50",children:[Be?(0,f.jsx)(Kr.A,{className:"h-4 w-4 animate-spin"}):(0,f.jsx)(ls.A,{className:"h-4 w-4"}),Be?"Creating Portal...":"Create MASV Portal"]})})]}),(0,f.jsxs)("div",{className:"border-t border-slate-200 pt-4",children:[(0,f.jsx)("p",{className:"text-xs font-medium text-slate-400 uppercase tracking-wider mb-3",children:"Desktop App (Legacy)"}),(0,f.jsxs)("label",{className:"flex items-start gap-4 p-4 bg-slate-50 rounded-lg cursor-pointer hover:bg-slate-100 transition-colors",children:[(0,f.jsx)("input",{type:"checkbox",checked:z.show_crew_upload_instructions,onChange:e=>Ve("show_crew_upload_instructions",e.target.checked),onBlur:Ge,className:"mt-1 h-5 w-5 text-indigo-600 rounded focus:ring-2 focus:ring-indigo-500"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-slate-900",children:"Conference & Exhibition Instructions"}),(0,f.jsx)("p",{className:"text-sm text-slate-600",children:"Full instructions with RAW upload schedule and batch timing"})]})]}),(0,f.jsxs)("label",{className:"flex items-start gap-4 p-4 bg-slate-50 rounded-lg cursor-pointer hover:bg-slate-100 transition-colors mt-2",children:[(0,f.jsx)("input",{type:"checkbox",checked:z.show_generic_upload_instructions,onChange:e=>Ve("show_generic_upload_instructions",e.target.checked),onBlur:Ge,className:"mt-1 h-5 w-5 text-purple-600 rounded focus:ring-2 focus:ring-purple-500"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-slate-900",children:"Generic Upload Instructions"}),(0,f.jsx)("p",{className:"text-sm text-slate-600",children:"Simplified instructions (software download and login only)"})]})]})]})]})]}),(0,f.jsx)("div",{className:"flex justify-end pt-4",children:(0,f.jsxs)("button",{onClick:ut,disabled:H,style:(0,m.A)((0,m.A)({},Zo),{},{padding:"12px 28px",fontSize:14,opacity:H?.6:1}),children:[(0,f.jsx)(ia.A,{size:18}),H?"Saving...":"Save Event"]})})]})]})]})};var Xo=s(71831);const el={photographer:"Photographer",second_photographer:"Second Photographer",videographer:"Videographer",second_videographer:"Second Videographer",voxpop_videographer:"VoxPop Videographer",editor:"Editor",remote_editor:"Remote Editor",producer:"Producer",assistant:"Assistant",coordinator:"Coordinator"};async function tl(e){var t,s,a,n,r,i,o,l,c;let{event:d,role:m=null,checklistCompletions:p={},priorityStandCompletions:x={},timedEventCompletions:h={},photographyStandards:u="",videographyStandards:g=""}=e;const f=new Xo.Ay({orientation:"portrait",unit:"mm",format:"a4"});let b=0;const y=210,v=18,j=174,w=[15,23,42],N=[51,65,85],A=[100,116,139],k=[203,213,225],S=[241,245,249],_=[220,38,38],C=[254,242,242],F=[22,163,74],E=[240,253,244],T=[99,102,241],z=[217,119,6],B=[255,251,235],D=[147,51,234],I=[225,29,72],R=[37,99,235],P=[255,255,255],W=e=>{if(!e)return"TBC";return new Date(e).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric"})},O=e=>{if(!e)return"TBC";const[t,s]=e.split(":"),a=parseInt(t),n=a>=12?"PM":"AM";return"".concat(a%12||12,":").concat(s," ").concat(n)},L=e=>{if(!e)return"";const t=document.createElement("div");t.innerHTML=e;
1t.querySelectorAll("li").forEach(e=>{e.textContent="\u2022 "+e.textContent.trim()});const s=t.querySelectorAll("p, li, div, h1, h2, h3, h4, h5, h6");return s.length>0?Array.from(s).map(e=>e.textContent.trim()).filter(Boolean).join("\n"):t.textContent.trim()},M=e=>{if(!e||0===e.length)return[];const t={},s=[];return e.forEach(e=>{const a=e.time||"00:00";t[a]||(t[a]=[],s.push(a)),t[a].push(e)}),s.map(e=>{const s=t[e],a=s.filter(e=>e.stream&&e.stream.trim());return{time:e,events:s,hasStreams:a.length>=2}})},q=e=>new Promise(t=>{const s=new Image;s.crossOrigin="anonymous",s.onload=()=>{try{const e=document.createElement("canvas");e.width=s.naturalWidth,e.height=s.naturalHeight;e.getContext("2d").drawImage(s,0,0),t(e.toDataURL("image/png"))}catch(e){t(null)}},s.onerror=()=>t(null),s.src=e}),H=await q("/turbo-logo-white-new.png"),U=d.company_logo_url?await q(d.company_logo_url):null,G=e=>{f.setFillColor(...w),f.rect(0,0,y,14,"F"),f.setFillColor(..._),f.rect(0,14,y,1.2,"F"),f.setFont("helvetica","bold"),f.setFontSize(11),f.setTextColor(...P),f.text("TURBO 360",v,9.5),f.setFont("helvetica","normal"),f.setFontSize(7.5);const t=e.length>50?e.substring(0,47)+"...":e;f.text(t,192,9.5,{align:"right"}),b=22},V=(e,t)=>{f.setDrawColor(...k),f.setLineWidth(.3),f.line(v,281,192,281),f.setFont("helvetica","normal"),f.setFontSize(7),f.setTextColor(...A),f.text("Emergency Contact: 1300 207 446 | [email protected]",v,286),f.text("Page ".concat(e," of ").concat(t),192,286,{align:"right"})},J=e=>b+e>279&&(f.addPage(),G(d.event_name),!0),Y=(e,t,s)=>{if(J(20),b+=4,f.setFillColor(...t),f.rect(v,b,2,7,"F"),f.setFont("helvetica","bold"),f.setFontSize(14),f.setTextColor(...w),f.text(e,24,b+6),s){const a=24+f.getTextWidth(e)+4;f.setFillColor(...t);const n=f.getTextWidth(s)+6;f.roundedRect(a,b+.5,n>14?n:14,6,2,2,"F"),f.setFont("helvetica","bold"),f.setFontSize(7.5),f.setTextColor(...P),f.text(s,a+(n>14?n:14)/2,b+4.5,{align:"center"})}b+=12};f.setFillColor(...w),f.rect(0,0,y,80,"F"),f.setFillColor(..._),f.rect(0,80,y,2.5,"F");let K=16;if(H)try{f.addImage(H,"PNG",v,K,40,14)}catch(ne){f.setFont("helvetica","bold"),f.setFontSize(16),f.setTextColor(...P),f.text("TURBO 360",v,26)}else f.setFont("helvetica","bold"),f.setFontSize(16),f.setTextColor(...P),f.text("TURBO 360",v,26);if(U)try{f.setDrawColor(255,255,255,.3),f.setLineWidth(.3),f.line(64,18,64,28),f.addImage(U,"PNG",70,K,36,14)}catch(re){}f.setFont("helvetica","normal"),f.setFontSize(7.5),f.setTextColor(180,190,210),f.text("Generated ".concat((new Date).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"})),192,21,{align:"right"}),f.setFont("helvetica","bold"),f.setFontSize(24),f.setTextColor(...P);const Z=f.splitTextToSize(d.event_name,j);let $=46;Z.slice(0,2).forEach(e=>{f.text(e,v,$),$+=10}),m&&el[m]&&(f.setFont("helvetica","normal"),f.setFontSize(13),f.setTextColor(254,215,215),f.text("".concat(el[m]," Brief"),v,$),$+=7),f.setFont("helvetica","normal"),f.setFontSize(10),f.setTextColor(180,200,220),$=66,d.client_company&&(f.text(d.client_company,v,$),$+=5),d.venue&&f.text(d.venue,v,$),b=90,f.setFillColor(...C);if("multi"===d.event_duration_type&&(null===(t=d.event_days)||void 0===t?void 0:t.length)>0){const e=d.event_days,t=Math.min(e.length,3),s=(j-4*(t-1))/t,a=Math.ceil(e.length/t);f.setFillColor(254,242,242);const n=40*a+12;f.rect(0,b-2,y,n,"F"),f.setFillColor(..._),f.rect(0,b-2,y,.8,"F"),f.setFont("helvetica","bold"),f.setFontSize(9),f.setTextColor(..._),f.text("MULTI-DAY EVENT: ".concat(e.length," DAYS"),v,b+6),b+=10,e.forEach((e,a)=>{var n;const r=a%t,i=Math.floor(a/t),o=v+r*(s+4),l=b+40*i;var c;f.setFillColor(...P),f.roundedRect(o,l,s,36,2,2,"F"),f.setFillColor(..._),f.roundedRect(o+4,l+4,18,5.5,1.5,1.5,"F"),f.setFont("helvetica","bold"),f.setFontSize(6),f.setTextColor(...P),f.text("DAY ".concat(a+1),o+13,l+8,{align:"center"}),f.setFont("helvetica","bold"),f.setFontSize(8.5),f.setTextColor(...w),f.text((c=e.date)?new Date(c).toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short"}):"TBC",o+4,l+16),f.setFont("helvetica","bold"),f.setFontSize(8),f.setTextColor(..._),f.text("".concat(O(e.start_time)," - ").concat(O(e.end_time)),o+4,l+22);const m=(null===(n=d.crew_members)||void 0===n?void 0:n.filter(t=>t.assigned_days&&t.assigned_days.includes(e.id)))||[];if(m.length>0){f.setFont("helvetica","normal"),f.setFontSize(6),f.setTextColor(...N);let e=l+28;m.slice(0,2).forEach(t=>{f.text("".concat(t.name," (").concat(Pn(t.role),")"),o+4,e),e+=3.5}),m.length>2&&f.text("+".concat(m.length-2," more"),o+4,e)}}),b+=40*a+6}else{const e=32;f.setFillColor(254,242,242),f.rect(0,b-2,y,e+4,"F"),f.setFillColor(..._),f.rect(0,b-2,y,.8,"F");const t=166/3,s=d.event_timezone&&"Australia/Melbourne"!==d.event_timezone?" ".concat((0,zo.iU)(d.event_timezone)):"";[{label:"DATE",value:W(d.event_date)},{label:"START",value:O(d.start_time)+s},{label:"END",value:O(d.end_time)+s}
1].forEach((s,a)=>{const n=v+a*(t+4);f.setFillColor(...P),f.roundedRect(n,b+2,t,e-6,2,2,"F"),f.setFont("helvetica","bold"),f.setFontSize(7.5),f.setTextColor(..._),f.text(s.label,n+5,b+9),f.setFont("helvetica","bold"),f.setFontSize(0===a?9:13),f.setTextColor(...w);const r=f.splitTextToSize(s.value,t-10);f.text(r[0]||"TBC",n+5,b+18),r[1]&&(f.setFontSize(8),f.text(r[1],n+5,b+23))}),b+=e+8}(null===(s=d.deliverables)||void 0===s?void 0:s.length)>0&&(Y("DELIVERABLES",z),d.deliverables.forEach((e,t)=>{const s=f.splitTextToSize(e.name||"",162),a=e.description?f.splitTextToSize(e.description,162):[],n=4.8*s.length+4.2*a.length+6;J(n),f.setFillColor(...z),f.roundedRect(v,b-3,6,6,1,1,"F"),f.setFont("helvetica","bold"),f.setFontSize(8),f.setTextColor(...P),f.text(String(t+1),21,b+1,{align:"center"});f.setFont("helvetica","bold"),f.setFontSize(10),f.setTextColor(...w),s.forEach((e,t)=>{f.text(e,28,b+4.8*t)});let r=b+4.8*s.length;a.length>0&&(f.setFont("helvetica","normal"),f.setFontSize(8.5),f.setTextColor(...A),a.forEach((e,t)=>{f.text(e,28,r+4.2*t+1)}),r+=4.2*a.length+1),b=r+4}),b+=4);if("single"===d.event_duration_type&&(null===(a=d.timed_events)||void 0===a?void 0:a.length)>0||"multi"===d.event_duration_type&&(null===(n=d.event_days)||void 0===n?void 0:n.some(e=>{var t;return(null===(t=e.timed_events)||void 0===t?void 0:t.length)>0}))){Y("EVENT TIMELINE",_);const e=(e,t)=>{const s=e.events.every(e=>h[e.id]||e.completed)?F:_;let a=0;if(e.events.forEach(t=>{let s=4.5*f.splitTextToSize(t.description||"",e.hasStreams?60:138).length+4;t.notes&&(s+=4.5),(h[t.id]||t.completed)&&t.completed_by&&(s+=4),t.stream&&e.hasStream
1s&&(s+=5),a=Math.max(a,s)}),e.hasStreams&&(a+=2),a=Math.max(a,12),J(a+4),f.setFillColor(...s),f.roundedRect(v,b,22,7,2,2,"F"),f.setFont("helvetica","bold"),f.setFontSize(8),f.setTextColor(...P),f.text(O(e.time),29,b+5,{align:"center"}),e.hasStreams){const t=72;e.events.forEach((e,s)=>{const n=44+s*(t+4),r=h[e.id]||e.completed,i=r?E:S,o=r?F:T;f.setFillColor(...i),f.roundedRect(n,b,t,a,1.5,1.5,"F"),f.setFillColor(...o),f.rect(n,b,1.5,a,"F");let l=b+4;if(e.stream){f.setFillColor(224,231,255);const t=Math.max(.6*f.getTextWidth(e.stream)+6,14);f.roundedRect(n+5,l-2.5,t,4.5,1,1,"F"),f.setFont("helvetica","bold"),f.setFontSize(6),f.setTextColor(...T),f.text(e.stream,n+5+2,l),l+=5}f.setFont("helvetica","normal"),f.setFontSize(8.5),f.setTextColor(...r?A:w);if(f.splitTextToSize(e.description||"",t-10).forEach(e=>{if(f.text(e,n+5,l),r){const t=f.getTextWidth(e);f.setDrawColor(...A),f.setLineWidth(.3),f.line(n+5,l-1.2,n+5+t,l-1.2)}l+=4}),e.notes){f.setFont("helvetica","italic"),f.setFontSize(7),f.setTextColor(...A);f.splitTextToSize(e.notes,t-10).slice(0,2).forEach(e=>{f.text(e,n+5,l),l+=3.5})}r&&e.completed_by&&(f.setFont("helvetica","normal"),f.setFontSize(6.5),f.setTextColor(...F),f.text("Completed by ".concat(e.completed_by),n+5,l))})}else e.events.forEach(e=>{const t=h[e.id]||e.completed,s=t?E:S,n=t?F:_,r=44;f.setFillColor(...s),f.roundedRect(r,b,148,a,1.5,1.5,"F"),f.setFillColor(...n),f.rect(r,b,1.5,a,"F");let i=b+5;t?(f.setFillColor(...F),f.roundedRect(48,i-3.5,4,4,.8,.8,"F"),f.setFont("helvetica","bold"),f.setFontSize(7),f.setTextColor(...P),f.text("\u2713",49,i-.5)):(f.setDrawColor(...A),f.setLineWidth(.4),f.roundedRect(48,i-3.5,4,4,.8,.8,"S")),f.setFont("helvetica","normal"),f.setFontSize(9.5),f.setTextColor(...t?A:w);if(f.splitTextToSize(e.description||"",132).forEach(e=>{if(f.text(e,56,i),t){const t=f.getTextWidth(e);f.setDrawColor(...A),f.setLineWidth(.3),f.line(56,i-1.2,56+t,i-1.2)}i+=4.5}),e.notes){f.setFont("helvetica","italic"),f.setFontSize(7.5),f.setTextColor(...A);f.splitTextToSize(e.notes,132).slice(0,2).forEach(e=>{f.text(e,56,i),i+=3.5})}t&&e.completed_by&&(f.setFont("helvetica","normal"),f.setFontSize(6.5),f.setTextColor(...F),f.text("Completed by ".concat(e.completed_by),56,i))});b+=a+3};if("single"===d.event_duration_type){M(d.timed_events).forEach(t=>e(t))}else d.event_days.forEach((t,s)=>{var a,n;J(20),f.setFillColor(254,226,226),f.roundedRect(v,b,j,16,2,2,"F"),f.setFont("helvetica","bold"),f.setFontSize(11),f.setTextColor(127,29,29),f.text("Day ".concat(s+1),23,b+7),f.setFont("helvetica","normal"),f.setFontSize(8),f.setTextColor(153,27,27),f.text("".concat(W(t.date)," \u2022 ").concat(O(t.start_time)," - ").concat(O(t.end_time)),23,b+13);const r=(null===(a=d.crew_members)||void 0===a?void 0:a.filter(e=>e.assigned_days&&e.assigned_days.includes(t.id)))||[];if(r.length>0){let e=187;f.setFont("helvetica","bold"),f.setFontSize(6),r.slice(0,3).reverse().forEach(t=>{const s="".concat(t.name," (").concat(Pn(t.role),")"),a=f.getTextWidth(s)+6;f.setFillColor(...P),f.roundedRect(e-a,b+3,a,5,1.2,1.2,"F"),f.setTextColor(...N),f.text(s,e-a+3,b+6.5),e-=a+2})}if(b+=20,(null===(n=t.timed_events)||void 0===n?void 0:n.length)>0){M(t.timed_events).forEach(s=>e(s,t.id))}b+=4});b+=4}if(null!==(r=d.voxpops)&&void 0!==r&&r.enabled){const e=[5,150,105];Y("VOXPOPS",e);const t=Pi(d.voxpops),s=t.length>1;t.forEach((t,a)=>{const n=[];if(t.time&&n.push({label:"TIME",value:O(t.time)}),t.contact_name&&n.push({label:"CONTACT",value:t.contact_name}),t.meeting_point&&n.push({label:"MEETING POINT",value:t.meeting_point}),0===n.length)return;s&&(J(8),f.setFont("helvetica","bold"),f.setFontSize(8),f.setTextColor(...e),f.text("SUBJECT ".concat(a+1),v,b),b+=5),J(24);const r=(j-4*(n.length-1))/n.length;n.forEach((t,s)=>{const a=v+s*(r+4);f.setFillColor(236,253,245),f.roundedRect(a,b,r,18,2,2,"F"),f.setFont("helvetica","bold"),f.setFontSize(7),f.setTextColor(...e),f.text(t.label,a+4,b+6),f.setFont("helvetica","bold"),f.setFontSize(10),f.setTextColor(...w);const n=f.splitTextToSize(t.value,r-8);f.text(n[0]||"",a+4,b+13)}),b+=22});const a=(d.voxpops.questions||[]).filter(e=>e);a.length>0&&(J(10),f.setFont("helvetica","bold"),f.setFontSize(8),f.setTextColor(...e),f.text("SUGGESTED QUESTIONS",v,b),b+=5,a.forEach((t,s)=>{J(8),f.setFillColor(248,250,252),f.roundedRect(v,b,j,7,1.5,1.5,"F"),f.setFont("helvetica","bold"),f.setFontSize(8),f.setTextColor(...e),f.text("".concat(s+1,"."),21,b+4.5),f.setFont("helvetica","normal"),f.setFontSize(8),f.setTextColor(...N),f.text(t,28,b+4.5),b+=9})),b+=4}if((null===(i=d.crew_members)||void 0===i?void 0:i.length)>0){Y("CREW (".concat(d.crew_members.length,")"),_);const e=85,t=22;for(let s=0;s<d.crew_members.length;
1s+=2){J(t+4);for(let a=0;a<2&&s+a<d.crew_members.length;a++){const n=d.crew_members[s+a],r=v+a*(e+4);f.setFillColor(...S),f.roundedRect(r,b,e,t,2,2,"F"),f.setFillColor(..._),f.rect(r,b,1.5,t,"F"),f.setFont("helvetica","bold"),f.setFontSize(10),f.setTextColor(...w),f.text(n.name||"",r+6,b+7),f.setFont("helvetica","bold"),f.setFontSize(7),f.setTextColor(..._),f.text(Pn(n.role).toUpperCase(),r+6,b+12),n.mobile&&(f.setFont("helvetica","normal"),f.setFontSize(8),f.setTextColor(...N),f.text(n.mobile,r+6,b+18)),n.email&&(f.setFont("helvetica","normal"),f.setFontSize(7),f.setTextColor(...A),f.text(n.email,r+e-4,b+18,{align:"right"}))}b+=t+3}b+=4}if(Y("CLIENT CONTACTS",_),d.client_company&&(f.setFont("helvetica","bold"),f.setFontSize(11),f.setTextColor(...w),f.text(d.client_company,v,b+4),b+=10),(null===(o=d.client_contacts)||void 0===o?void 0:o.length)>0){const e=85,t=26;for(let s=0;s<d.client_contacts.length;s+=2){J(t+4);for(let a=0;a<2&&s+a<d.client_contacts.length;a++){const n=d.client_contacts[s+a],r=v+a*(e+4),i=n.is_primary;f.setFillColor(...i?C:S),f.roundedRect(r,b,e,t,2,2,"F"),i&&(f.setFillColor(..._),f.roundedRect(r+e-22,b+3,18,5,1.5,1.5,"F"),f.setFont("helvetica","bold"),f.setFontSize(5.5),f.setTextColor(...P),f.text("PRIMARY",r+e-13,b+6.5,{align:"center"})),f.setFont("helvetica","bold"),f.setFontSize(10),f.setTextColor(...w),f.text(n.name||"",r+5,b+7),n.role&&(f.setFont("helvetica","normal"),f.setFontSize(7),f.setTextColor(...A),f.text(n.role,r+5,b+12)),n.email&&(f.setFont("helvetica","normal"),f.setFontSize(8),f.setTextColor(...R),f.text(n.email,r+5,b+18)),n.mobile&&(f.setFont("helvetica","normal"),f.setFontSize(8),f.setTextColor(...R),f.text(n.mobile,r+5,b+23))}b+=t+3}}else{const e=[];d.primary_contact&&e.push({label:"Name",value:d.primary_contact}),d.email&&e.push({label:"Email",value:d.email}),d.mobile&&e.push({label:"Mobile",value:d.mobile}),e.forEach(e=>{J(8),f.setFont("helvetica","bold"),f.setFontSize(7),f.setTextColor(...A),f.text(e.label.toUpperCase(),v,b),f.setFont("helvetica","normal"),f.setFontSize(9.5),f.setTextColor(...w),f.text(e.value,43,b),b+=6})}if(d.additional_notes&&(J(12),f.setDrawColor(...k),f.setLineWidth(.3),f.line(v,b,192,b),b+=4,f.setFont("helvetica","bold"),f.setFontSize(7),f.setTextColor(...A),f.text("ADDITIONAL NOTES",v,b),b+=4,b=((e,t,s,a,n,r,i,o)=>{f.setFont("helvetica",r||"normal"),f.setFontSize(n||9.5),f.setTextColor(...i||N);const l=o||4.5,c=f.splitTextToSize(e,a);let m=s;return c.forEach(e=>{m+l>279&&(f.addPage(),G(d.event_name),m=b),f.text(e,t,m),m+=l}),m})(d.additional_notes,v,b,j,9,"normal",N,4.5)),b+=8,d.special_briefing_notes&&d.special_briefing_notes.trim()){Y("SPECIAL BRIEFING NOTES",z);const e=d.special_briefing_notes.trim(),t=f.splitTextToSize(e,160),s=Math.max(4.5*t.length+10,16);J(s+4),f.setFillColor(...B),f.roundedRect(v,b,j,s,2,2,"F"),f.setFillColor(...z),f.rect(v,b,2,s,"F"),f.setFont("helvetica","normal"),f.setFontSize(9),f.setTextColor(...N);let a=b+6;t.forEach(e=>{a>279&&(f.addPage(),G(d.event_name),a=b),f.text(e,26,a),a+=4.5}),b=a+4,b+=4}const Q=(()=>{var e;return null===d||void 0===d||null===(e=d.crew_members)||void 0===e?void 0:e.some(e=>Mn(e.role))})()&&u,X=(()=>{var e;return null===d||void 0===d||null===(e=d.crew_members)||void 0===e?void 0:e.some(e=>Ln(e.role))})()&&g;if(Q||X){if(Y("IMAGERY STANDARDS",T),Q){J(14),f.setFont("helvetica","bold"),f.setFontSize(11),f.setTextColor(...w),f.text("Photography Standards",v,b+4),b+=10;L(u).split("\n").filter(Boolean).forEach(e=>{J(6);const t=f.splitTextToSize(e,168);f.setFont("helvetica",(e.startsWith("\u2022"),"normal")),f.setFontSize(8.5),f.setTextColor(...N),t.forEach(e=>{J(5),f.text(e,21,b),b+=4}),b+=1}),b+=4}if(X){J(14),f.setFont("helvetica","bold"),f.setFontSize(11),f.setTextColor(...w),f.text("Videography Standards",v,b+4),b+=10;L(g).split("\n").filter(Boolean).forEach(e=>{J(6);const t=f.splitTextToSize(e,168);f.setFont("helvetica","normal"),f.setFontSize(8.5),f.setTextColor(...N),t.forEach(e=>{J(5),f.text(e,21,b),b+=4}),b+=1}),b+=4}b+=4}if((null===(l=d.must_capture_checklist)||void 0===l?void 0:l.length)>
10){const e=Object.values(p).filter(Boolean).length,t=d.must_capture_checklist.length;Y("MUST-CAPTURE CHECKLIST",D,"".concat(e,"/").concat(t));[...d.must_capture_checklist].sort((e,t)=>(e.order||0)-(t.order||0)).forEach(e=>{J(8);const t=p[e.id];t?(f.setFillColor(...F),f.roundedRect(v,b-3,4.5,4.5,.8,.8,"F"),f.setFont("helvetica","bold"),f.setFontSize(8),f.setTextColor(...P),f.text("\u2713",19,b)):(f.setDrawColor(...A),f.setLineWidth(.4),f.setFillColor(...P),f.roundedRect(v,b-3,4.5,4.5,.8,.8,"FD")),f.setFont("helvetica","normal"),f.setFontSize(9.5),f.setTextColor(...t?A:w);const s=f.splitTextToSize(e.text||"",164);s.forEach((e,s)=>{if(f.text(e,26,b+4.5*s),t){const t=f.getTextWidth(e);f.setDrawColor(...A),f.setLineWidth(.3),f.line(26,b+4.5*s-1.2,26+t,b+4.5*s-1.2)}}),b+=Math.max(4.5*s.length,4.5)+3}),b+=4}if((null===(c=d.priority_sponsor_stands)||void 0===c?void 0:c.length)>0){const e=Object.values(x).filter(Boolean).length,t=d.priority_sponsor_stands.length;Y("PRIORITY SPONSOR STANDS",I,"".concat(e,"/").concat(t)),J(10),f.setFont("helvetica","italic"),f.setFontSize(8.5),f.setTextColor(...A);f.splitTextToSize("Please ensure you capture at least one strong shot at each of the following stands with clear branding and visible attendee engagement.",j).forEach(e=>{f.text(e,v,b),b+=4}),b+=2;[...d.priority_sponsor_stands].sort((e,t)=>(e.order||0)-(t.order||0)).forEach(e=>{J(8);const t=x[e.id];t?(f.setFillColor(...F),f.roundedRect(v,b-3,4.5,4.5,.8,.8,"F"),f.setFont("helvetica","bold"),f.setFontSize(8),f.setTextColor(...P),f.text("\u2713",19,b)):(f.setDrawColor(...A),f.setLineWidth(.4),f.setFillColor(...P),f.roundedRect(v,b-3,4.5,4.5,.8,.8,"FD")),f.setFont("helvetica","normal"),f.setFontSize(9.5),f.setTextColor(...t?A:w);const s=f.splitTextToSize(e.text||"",164);s.forEach((e,s)=>{if(f.text(e,26,b+4.5*s),t){const t=f.getTextWidth(e);f.setDrawColor(...A),f.setLineWidth(.3),f.line(26,b+4.5*s-1.2,26+t,b+4.5*s-1.2)}}),b+=Math.max(4.5*s.length,4.5)+3}),b+=4}const ee=d.supporting_documents||[],te=d.client_brief_file&&0===ee.length?[d.client_brief_file]:ee;te.length>0&&(Y("SUPPORTING DOCUMENTS",R),te.forEach(e=>{if(J(10),f.setFillColor(239,246,255),f.roundedRect(v,b,j,10,1.5,1.5,"F"),f.setFillColor(...R),f.roundedRect(21,b+2,6,6,1,1,"F"),f.setFont("helvetica","bold"),f.setFontSize(6),f.setTextColor(...P),f.text("DOC",24,b+6,{align:"center"}),f.setFont("helvetica","bold"),f.setFontSize(9),f.setTextColor(...w),f.text(e.original_filename||"Document",30,b+5.5),e.file_size){const t="".concat((e.file_size/1024/1024).toFixed(2)," MB");f.setFont("helvetica","normal"),f.setFontSize(7),f.setTextColor(...A),f.text(t,30,b+8.5)}f.setFont("helvetica","italic"),f.setFontSize(7),f.setTextColor(...R),f.text("Download from online runsheet",188,b+6,{align:"right"}),b+=13}),b+=4);const se=f.internal.getNumberOfPages();for(let ie=1;ie<=se;ie++)f.setPage(ie),V(ie,se);const ae=m&&el[m]?" - ".concat(el[m]):"";f.save("".concat(d.event_name).concat(ae," - Runsheet.pdf"))}function sl(e,t){if(!e||!t)return null;const s=e.role_variants||[];for(const a of s)if(a&&a.role===t&&!1!==a.enabled)return a;return null}function al(e,t){if(!e||!t)return[];return(Array.isArray(e.crew_members)?e.crew_members:[]).filter(e=>!!e&&(e.runsheet_variant_id?e.runsheet_variant_id===t.id:e.role===t.role))}function nl(e,t){if(!e)return{timed_events:[],event_days:[],brief:"",must_capture:[],variant_id:null};const s=sl(e,t),a=(t,a)=>{if(!s)return e[a];const n=s[t];return(e=>null===e||void 0===e||!(!Array.isArray(e)||0!==e.length)||"string"===typeof e&&""===e.trim())(n)?e[a]:n};return{timed_events:a("timed_events","timed_events"),event_days:a("event_days","event_days"),brief:a("brief","special_briefing_notes"),must_capture:a("must_capture","must_capture_checklist"),variant_id:s?s.id:null}}const rl="corp-runsheet-role:";const il="corp-runsheet-role-prompted:";const ol=(e,t,s)=>{if(s)return s;const a=t.get("role");return a?a.toLowerCase():function(e){try{const t=window.localStorage.getItem(rl+e);return t&&"shared"!==t?t:null}catch(t){return null}}(e)},ll=function(){var e,t,s,n,i,o,l,c;let{initialRole:d}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{eventId:x}=(0,r.g)(),[h,u]=(0,r.ok)(),[g,f]=(0,a.useState)(null),[b,y]=(0,a.useState)(()=>ol(x,h,d)),[v,j]=(0,a.useState)(null),w=!!(h.get("crew")||h.get("role")||"client"===h.get("view")||d),[N,A]=(0,a.useState)(!0),[k,S]=(0,a.useState)(null),[_,C]=(0,a.useState)(!1),[F,E]=(0,a.useState)(!1),[T,z]=(0,a.useState)(""),[B,D]=(0,a.useState)(""),[R,P]=(0,a.useState)("overview"),[W,O]=(0,a.useState)(!1),[L,M]=(0,a.useState)(!1),[q,H]=(0,a.useState)(!1),[U,G]=(0,a.useState)(!1),[V,J]=(0,a.useState)({}),[Y,K]=(0,a.useState)(""),[Z,$]=(0,a.useState)(!1),[Q,X]=(0,a.useState)(null),[ee,te]=(0,a.useState)({}),[se,ae]=(0,a.useState)({}),[ne,re]=(0,a.useState)({}),[ie,oe]=(0,a.useState)(!1),[le,ce]=(0,a.useState)(""),[de,me]=(0,a.useState)(!1);(0,a.useEffect)(()=>{pe(),xe()},[x]),(0,a.useEffect)(()=>{const e=()=>{const e=["overview","timeline","crew","contact","documents","briefing","imagery-standards","checklist","sponsor-stands","upload"];for(const t of e){const e=document.getElementById(t);if(e){const s=e.getBoundingClientRect();if(s.top<=150&&s.bottom>=150){P(t);break}}}};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]);const pe=async()=>{try{const a=window.location.search||"",n=await fetch("".concat(I.fn,"/api/corporate-runsheet/").concat(x).concat(a)),r=await n.json();if(r.success){var e;if(f(r.event),r.active_crew_id)j((null===(e=r.resolved_view)||void 0===e?void 0:e.crew_name)||null);if(r.active_role&&!b&&y(String(r.active_role).toLowerCase()),r.event.must_capture_completions&&te(r.event.must_capture_completions),r.event.priority_sponsor_stands_completions&&ae(r.event.priority_sponsor_stands_completions),r.event.timed_event_c
1ompletions)re(r.event.timed_event_completions);else{var t,s;const e={};null===(t=r.event.timed_events)||void 0===t||t.forEach(t=>{t.completed&&(e[t.id]=!0)}),null===(s=r.event.event_days)||void 0===s||s.forEach(t=>{var s;null===(s=t.timed_events)||void 0===s||s.forEach(t=>{t.completed&&(e[t.id]=!0)})}),re(e)}}else S("Event not found")}catch(k){console.error("Error loading event:",k),S("Failed to load event")}finally{A(!1)}},xe=async()=>{try{const e=await fetch("".concat(I.fn,"/api/settings/public")),t=await e.json();t&&(z(t.photography_standards||""),D(t.videography_standards||""))}catch(k){console.error("Error loading production standards:",k)}},he=(0,a.useMemo)(()=>{var e,t,s,a;if(!g)return null;if(!b||"shared"===b)return g;const n=nl(g,b),r=sl(g,b),i=r&&r.location&&r.location.trim()?r.location.trim():g.venue;return(0,m.A)((0,m.A)({},g),{},{venue:i,timed_events:null!==(e=n.timed_events)&&void 0!==e?e:g.timed_events,event_days:null!==(t=n.event_days)&&void 0!==t?t:g.event_days,special_briefing_notes:null!==(s=n.brief)&&void 0!==s?s:g.special_briefing_notes,must_capture_checklist:null!==(a=n.must_capture)&&void 0!==a?a:g.must_capture_checklist,active_role:b,active_variant_id:n.variant_id})},[g,b]),ue=(0,a.useMemo)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=[{key:"shared",label:"Shared",isShared:!0}];if(!e||!Array.isArray(e.role_variants))return s;for(const a of e.role_variants){if(!a||!a.role||!1===a.enabled)continue;const n=al(e,a).filter(e=>e.name&&e.name.trim()).map(e=>e.name.trim());s.push({key:a.role,label:a.label&&a.label.trim()||t[a.role]||a.role.charAt(0).toUpperCase()+a.role.slice(1),isShared:!1,variantId:a.id,location:(a.location||"").trim(),people:n})}return s}(g,Rn),[g]),ge=(0,a.useMemo)(()=>{if(!ue||ue.length<=1)return null;const e=b||"shared",t=ue.find(t=>t.key===e)||ue[0];return{isShared:!b||"shared"===b,label:(null===t||void 0===t?void 0:t.label)||(b?Pn(b):"Shared schedule"),people:(null===t||void 0===t?void 0:t.people)||[],location:(null===t||void 0===t?void 0:t.location)||"",crewName:v}},[ue,b,v]);(0,a.useEffect)(()=>{g&&(w||ue.length>1&&!b&&!function(e){try{return"1"===window.localStorage.getItem(il+e)}catch(t){return!1}}(x)&&M(!0))},[g,ue.length]);const fe=()=>{var e;return null===he||void 0===he||null===(e=he.crew_members)||void 0===e?void 0:e.some(e=>Mn(e.role))},be=()=>{var e;return null===he||void 0===he||null===(e=he.crew_members)||void 0===e?void 0:e.some(e=>Ln(e.role))},ye=((null===he||void 0===he?void 0:he.crew_members)||[]).filter(e=>"voxpop_videographer"===e.role),ve=[{id:"overview",label:"Overview",icon:_t.A},{id:"deliverables",label:"Deliverables",icon:as.A,show:(null===he||void 0===he||null===(e=he.deliverables)||void 0===e?void 0:e.length)>0},{id:"timeline",label:"Timeline",icon:Nt.A,show:(null===he||void 0===he||null===(t=he.timed_events)||void 0===t?void 0:t.length)>0||(null===he||void 0===he||null===(s=he.event_days)||void 0===s?void 0:s.length)>0},{id:"voxpops",label:"Voxpops",icon:Di.A,show:null===he||void 0===he||null===(n=he.voxpops)||void 0===n?void 0:n.enabled},{id:"crew",label:"Crew",icon:Xe.A,show:(null===he||void 0===he||null===(i=he.crew_members)||void 0===i?void 0:i.length)>0},{id:"contact",label:"Contact",icon:Ye.A},{id:"documents",label:"Documents",icon:kt.A,show:(null===he||void 0===he||null===(o=he.supporting_documents)||void 0===o?void 0:o.length)>0||(null===he||void 0===he?void 0:he.client_brief_file)},{id:"briefing",label:"Briefing Notes",icon:oa.A},{id:"imagery-standards",label:"Imagery Standards",icon:Ue.A,show:fe()&&T||be()&&B},{id:"checklist",label:"Checklist",icon:p.A,show:(null===he||void 0===he||null===(l=he.must_capture_checklist)||void 0===l?void 0:l.length)>0},{id:"sponsor-stands",label:"Sponsor Stands",icon:p.A,show:(null===he||void 0===he||null===(c=he.priority_sponsor_stands)||void 0===c?void 0:c.length)>0},{id:"upload",label:"Upload",icon:_s.A,show:(null===he||void 0===he?void 0:he.show_crew_upload_instructions)||(null===he||void 0===he?void 0:he.show_generic_upload_instructions)||(null===he||void 0===he?void 0:he.masv_upload_enabled)}].filter(e=>!1!==e.show);return{eventId:x,event:he,rawEvent:g,activeRole:b,setActiveRole:e=>{const t=e&&"shared"!==e?String(e).toLowerCase():null;y(t),function(e,t){try{t&&"shared"!==t?window.localStorage.setItem(rl+e,t):window.localStorage.removeItem(rl+e)}catch(s){}}(x,t),j(null);const s=new URLSearchParams(h);s.delete("crew"),t?s.set("role",t):s.delete("role"),u(s,{replace:!0})},availableRoles:ue,activeRunsheet:ge,showRoleModal:L,dismissRoleModal:()=>{!function(e){try{window.localStorage.setItem(il+e,"1")}
1catch(t){}}(x),M(!1)},handleDownloadAllRoles:async()=>{if(g&&ue&&!(ue.length<2)){E(!0);try{for(const e of ue){const t=e.isShared?null:e.key,s=t?(0,m.A)((0,m.A)({},g),((e,s,a,n)=>{const r=nl(g,t);return{timed_events:null!==(e=r.timed_events)&&void 0!==e?e:g.timed_events,event_days:null!==(s=r.event_days)&&void 0!==s?s:g.event_days,special_briefing_notes:null!==(a=r.brief)&&void 0!==a?a:g.special_briefing_notes,must_capture_checklist:null!==(n=r.must_capture)&&void 0!==n?n:g.must_capture_checklist}})()):g;await tl({event:s,role:t,checklistCompletions:ee,priorityStandCompletions:se,timedEventCompletions:ne,photographyStandards:T,videographyStandards:B})}}catch(k){console.error("Error generating per-role PDFs:",k),alert("Failed to generate one or more PDFs. Please try again.")}finally{E(!1)}}},isLoading:N,error:k,showShareNotification:_,isGeneratingPDF:F,photographyStandards:T,videographyStandards:B,activeSection:R,showMobileNav:W,setShowMobileNav:O,editingContact:q,editingBriefing:U,contactFormData:V,setContactFormData:J,briefingFormData:Y,setBriefingFormData:K,isSaving:Z,saveNotification:Q,checklistCompletions:ee,priorityStandCompletions:se,timedEventCompletions:ne,showMessageModal:ie,setShowMessageModal:oe,crewMessage:le,setCrewMessage:ce,isSendingMessage:de,handleShare:()=>{const e=window.location.href;navigator.clipboard.writeText(e).then(()=>{C(!0),setTimeout(()=>C(!1),3e3)})},handleDownloadPDF:async()=>{E(!0);try{await tl({event:he,role:b,checklistCompletions:ee,priorityStandCompletions:se,timedEventCompletions:ne,photographyStandards:T,videographyStandards:B})}catch(k){console.error("Error generating PDF:",k),alert("Failed to generate PDF. Please try again.")}finally{E(!1)}},formatDate:e=>{if(!e)return"TBC";return new Date(e).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric"})},formatTime:e=>{if(!e)return"";const[t,s]=e.split(":"),a=parseInt(t),n=a>=12?"PM":"AM";return"".concat(a%12||12,":").concat(s," ").concat(n)},groupEventsByTimeSlot:e=>{if(!e||0===e.length)return[];const t={},s=[];return e.forEach(e=>{const a=e.time||"00:00";t[a]||(t[a]=[],s.push(a)),t[a].push(e)}),s.map(e=>{const s=t[e],a=s.filter(e=>e.stream&&e.stream.trim());return{time:e,events:s,hasStreams:a.length>=2}})},hasCrewRole:e=>{var t;return null===he||void 0===he||null===(t=he.crew_members)||void 0===t?void 0:t.some(t=>t.role===e)},shouldShowPhotographyStandards:fe,shouldShowVideographyStandards:be,scrollToSection:e=>{const t=document.getElementById(e);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),O(!1))},startEditingContact:()=>{J({primary_contact:he.primary_contact||"",email:he.email||"",mobile:he.mobile||"",additional_notes:he.additional_notes||""}),H(!0)},cancelEditingContact:()=>{H(!1),J({})},saveContactChanges:async()=>{$(!0);try{const e=await fetch("".concat(I.fn,"/api/corporate-runsheet/").concat(x,"/client-edits"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)});(await e.json()).success?(f(e=>(0,m.A)((0,m.A)({},e),V)),H(!1),X({type:"success",message:"Contact details updated!"}),setTimeout(()=>X(null),3e3)):(X({type:"error",message:"Failed to save. Please try again."}),setTimeout(()=>X(null),3e3))}catch(k){console.error("Error saving contact changes:",k),X({type:"error",message:"Failed to save. Please try again."}),setTimeout(()=>X(null),3e3)}finally{$(!1)}},startEditingBriefing:()=>{K(he.special_briefing_notes||""),G(!0)},cancelEditingBriefing:()=>{G(!1),K("")},saveBriefingChanges:async()=>{$(!0);try{const e=await fetch("".concat(I.fn,"/api/corporate-runsheet/").concat(x,"/client-edits"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({special_briefing_notes:Y})});(await e.json()).success?(f(e=>(0,m.A)((0,m.A)({},e),{},{special_briefing_notes:Y})),G(!1),X({type:"success",message:"Briefing notes updated!"}),setTimeout(()=>X(null),3e3)):(X({type:"error",message:"Failed to save. Please try again."}),setTimeout(()=>X(null),3e3))}catch(k){console.error("Error saving briefing changes:",k),X({type:"error",message:"Failed to save. Please try again."}),setTimeout(()=>X(null),3e3)}finally{$(!1)}},toggleChecklistItem:async e=>{const t=!ee[e];te(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t}));try{await fetch("".concat(I.fn,"/api/corporate-runsheet/").concat(x,"/checklist"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({item_id:e,completed:t})})}catch(k){console.error("Error saving checklist state:",k),te(s=>(0,m.A)((0,m.A)({},s),{},{[e]:!t}))}},togglePriorityStand:async e=>{const t=!se[e];ae(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t}));try{await fetch("".concat(I.fn,"/api/corporate-runsheet/").concat(x,"/sponsor-stands"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({item_id:e,completed:t})})}catch(k){console.error("Error saving sponsor stand state:",k),ae(s=>(0,m.A)((0,m.A)({},s),{},{[e]:!t}))}},toggleTimedEvent:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=!ne[e];re(t=>(0,m.A)((0,m.A)({},t),{},{[e]:s}));try{const a=await fetch("".concat(I.fn,"/api/corporate-runsheet/").concat(x,"/timeline/").concat(e,"/toggle"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({completed:s,day_id:t,source:"runsheet"})});(await a.json()).success||re(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!s}))}catch(k){console.error("Error toggling timed event:",k),re(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!s}))}},toggleVoxpopItem:async e=>
1{if(!he)return;const t=he.voxpops||{},s=Array.isArray(t.items)?t.items:[],a=s.findIndex(t=>t.id===e);if(-1===a)return;const n=!s[a].completed,r=s.map((e,t)=>t===a?(0,m.A)((0,m.A)({},e),{},{completed:n}):e);f(e=>(0,m.A)((0,m.A)({},e),{},{voxpops:(0,m.A)((0,m.A)({},e.voxpops),{},{items:r})}));try{const t=await fetch("".concat(I.fn,"/api/corporate-runsheet/").concat(x,"/voxpops/").concat(e,"/toggle"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({completed:n,source:"runsheet"})});(await t.json()).success||f(e=>(0,m.A)((0,m.A)({},e),{},{voxpops:(0,m.A)((0,m.A)({},e.voxpops),{},{items:s})}))}catch(k){console.error("Error toggling voxpop:",k),f(e=>(0,m.A)((0,m.A)({},e),{},{voxpops:(0,m.A)((0,m.A)({},e.voxpops),{},{items:s})}))}},voxpopVideographers:ye,sendCrewMessage:async()=>{if(le.trim()){me(!0);try{const e=await fetch("".concat(I.fn,"/api/corporate-runsheet/").concat(x,"/message-crew"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:le.trim(),crew_id:h.get("crew")||void 0,sender_name:v||void 0})}),t=await e.json();t.success?(oe(!1),ce(""),X({type:"success",message:"Message sent to ".concat(t.crew_notified," crew member(s)")}),setTimeout(()=>X(null),3e3)):(X({type:"error",message:t.detail||"Failed to send message"}),setTimeout(()=>X(null),3e3))}catch(k){console.error("Error sending crew message:",k),X({type:"error",message:"Failed to send message"}),setTimeout(()=>X(null),3e3)}finally{me(!1)}}},downloadDocument:async e=>{try{const t=e.file_key||e.s3_key;if(!t)return void alert("File information missing.");const s=await fetch("".concat(I.fn,"/api/corporate-runsheet/").concat(x,"/document-download/").concat(t)),a=await s.json();a.success&&a.download_url?window.location.href=a.download_url:alert("Download failed: ".concat(a.detail||"Unknown error"))}catch(k){alert("Download error: ".concat(k.message))}},navItems:ve,getTimezoneDisplay:()=>null!==he&&void 0!==he&&he.event_timezone&&"Australia/Melbourne"!==he.event_timezone?(0,zo.iU)(he.event_timezone):""}},cl={photographer:Ue.A,second_photographer:Ue.A,videographer:Ge.A,second_videographer:Ge.A,voxpop_videographer:Ge.A},dl=e=>{let{availableRoles:t,activeRole:s,setActiveRole:n,onClose:r}=e;if((0,a.useEffect)(()=>{const e=e=>{"Escape"===e.key&&r()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r]),!t||t.length<=1)return null;const i=t.filter(e=>!e.isShared);if(0===i.length)return null;const o=s||"shared";return(0,f.jsx)("div",{className:"fixed inset-0 z-[99999] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",onClick:r,role:"dialog","aria-modal":"true","aria-label":"Choose which runsheet to view",children:(0,f.jsxs)("div",{className:"w-full max-w-md mx-auto bg-white rounded-3xl shadow-2xl max-h-[85vh] overflow-y-auto",style:{paddingBottom:"env(safe-area-inset-bottom, 0px)"},onClick:e=>e.stopPropagation(),children:[(0,f.jsxs)("div",{className:"relative px-6 pt-6 pb-2",children:[(0,f.jsx)("button",{type:"button",onClick:r,className:"absolute top-4 right-4 p-1.5 text-gray-400 hover:text-gray-700 rounded-full hover:bg-gray-100","aria-label":"Close",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})}),(0,f.jsx)("h2",{className:"text-xl font-extrabold text-gray-900 pr-8 leading-tight",children:"Which runsheet do you want to view?"}),(0,f.jsx)("p",{className:"mt-1.5 text-sm text-gray-500",children:"This event has a tailored runsheet for each role. Pick yours to see only the details that matter to you."})]}),(0,f.jsx)("div",{className:"px-4 py-3 flex flex-col gap-2",children:i.map(e=>{const t=e.key===o,s=cl[e.key]||Xe.A,a=(e.people||[]).join(", ");return(0,f.jsxs)("button",{type:"button",onClick:()=>{return t=e.key,n(t),void r();var t},className:"w-full inline-flex items-center gap-3 px-4 py-3.5 rounded-2xl text-base font-semibold transition-colors ".concat(t?"bg-turbo-red text-white shadow-lg shadow-turbo-red/30":"bg-gray-50 text-gray-800 hover:bg-gray-100 active:bg-gray-200"),children:[(0,f.jsx)(s,{className:"h-5 w-5 shrink-0 ".concat(t?"text-white":"text-turbo-red")}),(0,f.jsxs)("span",{className:"text-left leading-tight",children:[e.label,a&&(0,f.jsx)("span",{className:"block text-sm font-medium ".concat(t?"text-white/85":"text-gray-500"),children:a}),e.location&&(0,f.jsxs)("span",{className:"mt-0.5 flex items-center gap-1 text-xs ".concat(t?"text-white/75":"text-gray-400"),children:[(0,f.jsx)(C.A,{className:"h-3 w-3 shrink-0"}),e.location]})]})]},e.key)})}),(0,f.jsxs)("div",{className:"mx-4 mb-5 mt-1 rounded-2xl bg-amber-50 border border-amber-100 px-4 py-3 text-sm text-amber-800 flex gap-2",children:[(0,f.jsx)("span",{"aria-hidden":"true",children:"\ud83d\udca1"}),(0,f.jsx)("span",{children:"You can switch views anytime using the floating button at the bottom\u2011right, or the role bar at the top of the page."})]})]})})};var ml=s(65505);const pl=[Xi.red,Xi.teal,Xi.amberDeep,Xi.indigo],xl="turbo-client-runsheet-intro",hl=(()=>{const e=[];for(let t=0;t<24;t++)for(let s=0;s<60;s+=15)e.push("".concat(so(t),":").concat(so(s)));return e})();let ul=0;const gl=e=>(0,m.A)((0,m.A)({},e),{},{id:e.id,time:e.time||"",description:e.description||"",notes:e.notes||"",stream:e.stream||"",location:e.location||""}),fl=gl,bl=e=>{if(!e)return"";const[t,s]=e.split(":"),a=parseInt(t,10);return Number.isNaN(a)?e:"".concat(a%12||12,":").concat(s," ").concat(a>=12?"PM":"AM")};const yl=e=>{let{onClose:t}=e;(0,a.useEffect)(()=>{const e=e=>{"Escape"===e.key&&t()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]);const s=e=>{let{icon:t,iconBg:s,iconFg:a,title:n,children:r,last:i}=e;return(0,f.jsxs)("div",{style:{display:"flex",gap:14,alignItems:"flex-start",padding:"16px 0",borderBottom:i?"none":"1px solid ".concat(Xi.divider)},children:[(0,f.jsx)("div",{style:{width:36,height:36,borderRadius:4,flexShrink:0,background:s,color:a,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(t,{size:17,strokeWidth:2})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:Ki,fontWeight:800,fontSize:14.5},children:n}),(0,f.jsx)("div",{style:{fontSize:13.5,color:Xi.muted,lineHeight:1.5,marginTop:2},children:r})]})]})};return(0,f.jsx)("div",{onClick:t,role:"dialog","aria-modal":"true","aria-label":"How to use this runsheet",className:"tg-no-print",style:{position:"fixed",inset:0,zIndex:300,background:"rgba(10,10,11,.6)",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)",display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:440,maxHeight:"85vh",overflowY:"auto",background:Xi.card,borderRadius:4,boxShadow:"0 30px 80px rgba(0,0,0,.45)",paddingBottom:"env(safe-area-inset-bottom)",animation:"tg-pop .25s cubic-bezier(0.16,1,0.3,1)"},children:[(0,f.jsxs)("div",{style:{background:Xi.carbon,color:"#fff",padding:"22px 24px",position:"relative",overflow:"hidden"},children:[(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"","aria-hidden":"true",style:{position:"absolute",right:-20,top:-14,width:130,opacity:.4,pointerEvents:"none"}}),(0,f.jsx)("div",{style:{position:"relative",fontFamily:$i,fontSize:10,letterSpacing:".22em",color:Xi.amber},children:"WELCOME"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Qi),{},{position:"relative",fontWeight:800,fontSize:21,letterSpacing:"-.01em",marginTop:8,lineHeight:1.15}),children:"This runsheet is yours to review & edit"})]}),(0,f.jsx)("div",{style:{height:3,background:eo}}),(0,f.jsxs)("div",{style:{padding:"8px 24px 4px"},children:[(0,f.jsx)(s,{icon:ml.A,iconBg:Xi.redTint,iconFg:Xi.red,title:"Tap to edit",children:"Times, notes, locations and your checklist \u2014 tap any highlighted item to change it."}),(0,f.jsx)(s,{icon:ls.A,iconBg:Xi.amberTint,iconFg:Xi.amberDeep,title:"Add items",children:"Use \u201cAdd schedule item\u201d to add timeline entries or shots you want us to capture."}),(0,f.jsx)(s,{icon:zt.A,iconBg:Xi.tealTint,iconFg:Xi.tealDeep,title:"Saves automatically",last:!0,children:"No save button \u2014 your changes save as you go. We\u2019ll see them straight away."})]}),(0,f.jsx)("div",{style:{padding:"6px 24px 24px"},children:(0,f.jsx)("button",{type:"button",onClick:t,className:"tg-primary",style:{width:"100%",background:Xi.red,color:"#fff",border:0,borderRadius:4,padding:14,fontFamily:Ki,fontWeight:700,fontSize:15,cursor:"pointer"},children:"Got it \u2014 let\u2019s review"})})]})})},vl=e=>{const{rawEvent:t,availableRoles:s,formatDate:n,getTimezoneDisplay:r,downloadDocument:i}=e,o=r?r():"",l=null===t||void 0===t?void 0:t.id,[c,d]=(0,a.useState)((null===t||void 0===t?void 0:t.special_briefing_notes)||""),[p,x]=(0,a.useState)(()=>function(e,t){const s="multi"===(null===e||void 0===e?void 0:e.event_duration_type),a=e=>(e||[]).map(e=>({id:e.id,date:e.date,location:e.location,items:(e.timed_events||[]).map(gl)})),n=(t||[]).filter(e=>!e.isShared);if(0===n.length){const t=nl(e,null);
1return[{key:"shared",target:"shared",label:"Run Sheet",people:[],location:(null===e||void 0===e?void 0:e.venue)||"",brief:(null===e||void 0===e?void 0:e.special_briefing_notes)||"",briefTarget:"shared",isMulti:s,items:s?null:(t.timed_events||[]).map(gl),days:s?a(t.event_days):null}]}return n.map(t=>{const n=sl(e,t.key),r=nl(e,t.key),i=al(e,n||{role:t.key,id:t.variantId}).map(e=>e.name).filter(Boolean);return{key:t.key,target:t.variantId,label:t.label,people:i,location:t.location||(null===e||void 0===e?void 0:e.venue)||"",brief:(null===n||void 0===n?void 0:n.brief)||"",briefTarget:t.variantId,isMulti:s,items:s?null:(r.timed_events||[]).map(gl),days:s?a(r.event_days):null}})}(t,s)),[h,u]=(0,a.useState)("idle"),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)("all"),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(()=>{try{const e=parseInt(window.localStorage.getItem(xl)||"0",10);return!e||Date.now()-e>2592e5}catch(e){return!0}}),S=(0,a.useMemo)(()=>(s||[]).some(e=>!e.isShared),[s]),_=e=>y(e),F=e=>y(t=>t===e?null:t),z=e=>t=>{t.currentTarget.contains(t.relatedTarget)||F(e)},B=(0,a.useRef)({}),D=(0,a.useRef)(null),R=(0,a.useRef)(null),P=async e=>{R.current=e,u("saving");try{const t=await fetch("".concat(I.fn,"/api/corporate-runsheet/").concat(l,"/client-content"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e())}),s=await t.json();null!==s&&void 0!==s&&s.success?(u("saved"),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>u("idle"),2500)):u("error")}catch(t){u("error")}},W=(e,t)=>{B.current[e]&&clearTimeout(B.current[e]),B.current[e]=setTimeout(()=>P(t),800)},O=()=>{R.current&&P(R.current)},L=(e,t)=>()=>({type:"timeline",target:e.target,day_id:t?t.id:null,items:(t?t.items:e.items).map(fl)}),M=(e,t,s,a,n)=>{x(r=>{const i=r.map(e=>(0,m.A)({},e)),o=i[e],l=(null==t?o.items:o.days[t].items).map(e=>e.id===s?(0,m.A)((0,m.A)({},e),{},{[a]:n}):e);null==t?o.items=l:o.days=o.days.map((e,s)=>s===t?(0,m.A)((0,m.A)({},e),{},{items:l}):e);const c=null==t?null:o.days[t];return W("tl:".concat(o.target,":").concat(c?c.id:"-"),L(o,c)),i})},q=(e,t)=>{const s={id:"tmp-".concat(Date.now(),"-").concat(ul++),time:"12:00",description:"",notes:"",stream:"",location:""};x(a=>{const n=a.map(e=>(0,m.A)({},e)),r=n[e];null==t?r.items=[...r.items,s]:r.days=r.days.map((e,a)=>a===t?(0,m.A)((0,m.A)({},e),{},{items:[...e.items,s]}):e);const i=null==t?null:r.days[t];return W("tl:".concat(r.target,":").concat(i?i.id:"-"),L(r,i)),n}),y("item:".concat(s.id))},[H,U]=(0,a.useState)(()=>((null===t||void 0===t?void 0:t.must_capture_checklist)||[]).map(e=>({id:e.id,text:e.text||""}))),G=e=>()=>({type:"checklist",target:"shared",items:e.map((e,t)=>({id:e.id,text:e.text,order:t}))}),V=(0,a.useMemo)(()=>{const e=[];return(p||[]).forEach(t=>{t.isMulti?(t.days||[]).forEach(t=>e.push(...t.items||[])):e.push(...t.items||[])}),e},[p]),J=(0,a.useMemo)(()=>Vi(V),[V]),Y=(0,a.useMemo)(()=>((null===t||void 0===t?void 0:t.supporting_documents)||[]).filter(Boolean),[t]),K=(0,a.useMemo)(()=>(null===t||void 0===t?void 0:t.deliverables)||[],[t]),Z=(0,a.useMemo)(()=>((null===t||void 0===t?void 0:t.crew_members)||[]).filter(e=>e&&e.name),[t]),$=(0,a.useMemo)(()=>{const e=((null===t||void 0===t?void 0:t.client_contacts)||[]).filter(e=>e&&e.name);return 0===e.length&&(null!==t&&void 0!==t&&t.primary_contact||null!==t&&void 0!==t&&t.email||null!==t&&void 0!==t&&t.mobile)?[{name:t.primary_contact||"Primary contact",email:t.email,mobile:t.mobile,role:"Primary contact",is_primary:!0}]:e},[t]),Q=(0,a.useMemo)(()=>{const e=(null===t||void 0===t?void 0:t.client_company)||"Client",s=[];return Z.forEach((e,t)=>s.push({key:e.id||"crew-".concat(t),name:e.name,role:"".concat(Pn(e.role)||"Crew"," \xb7 Turbo 360"),mobile:e.mobile,email:null,avatarBg:to[t%4+1]})),$.forEach((t,a)=>s.push({key:t.id||"cc-".concat(a),name:t.name,role:[t.role,e].filter(
1Boolean).join(" \xb7 "),mobile:t.mobile,email:t.email,isPrimary:t.is_primary,avatarBg:t.is_primary?Xi.red:to[a%4+1]})),s.push({key:"emergency",name:"Turbo 360 Emergency Line",role:"On-the-day urgent contact",mobile:"1300 207 446",email:null,emergency:!0}),s},[Z,$,t]),{callTime:X,wrapTime:ee}=(0,a.useMemo)(()=>{const e=V.map(e=>e.time).filter(Boolean).sort();return{callTime:(null===t||void 0===t?void 0:t.start_time)||e[0]||"",wrapTime:(null===t||void 0===t?void 0:t.end_time)||e[e.length-1]||""}},[V,t]),te=(0,a.useMemo)(()=>"all"===v?p:p.filter(e=>e.key===v),[p,v]),se=null!==t&&void 0!==t&&t.event_date?n(t.event_date):"",ae=(e=>{if(!e)return"";const t=new Date(e);if(Number.isNaN(t.getTime()))return"";const s=t.toLocaleDateString("en-AU",{day:"numeric",month:"short",timeZone:"Australia/Melbourne"}).toUpperCase(),a=t.toLocaleTimeString("en-AU",{hour:"numeric",minute:"2-digit",timeZone:"Australia/Melbourne"}).toUpperCase();return"UPDATED ".concat(s," \xb7 ").concat(a)})(null===t||void 0===t?void 0:t.updated_at),ne=(0,a.useMemo)(()=>[{anchor:"sec-glance",num:"00",label:"At a glance",count:""},{anchor:"sec-brief",num:"01",label:"Briefing",count:String(Q.length)},{anchor:"sec-schedule",num:"02",label:"Run schedule",count:String(V.length)},{anchor:"sec-capture",num:"03",label:"Must-capture",count:String(H.length)},{anchor:"sec-deliverables",num:"04",label:"Deliverables",count:String(K.length)},{anchor:"sec-docs",num:"05",label:"Documents",count:String(Y.length)}],[Q.length,V.length,H.length,K.length,Y.length]),[re,ie]=Eo(ne.map(e=>e.anchor),"sec-glance"),oe=(0,a.useCallback)(async()=>{const e=window.location.href;try{await navigator.clipboard.writeText(e),N(!0),setTimeout(()=>N(!1),2e3)}catch(t){if(navigator.share)try{await navigator.share({url:e})}catch(s){}}},[]),le=(e,t,s)=>{const a="item:".concat(e.id),n=b===a,r={fontFamily:$i,fontSize:9,fontWeight:700,letterSpacing:".18em",textTransform:"uppercase",color:Xi.silver},i={fontFamily:Zi,padding:"10px 12px",border:"1px solid ".concat(Xi.hairline),borderRadius:4,background:Xi.inset,outline:"none",color:Xi.body};return n?(0,f.jsxs)("div",{tabIndex:-1,onBlur:z(a),style:{border:"1px solid ".concat(Xi.red),boxShadow:"inset 0 0 0 2px rgba(191,33,47,.09)",borderRadius:4,background:Xi.card,padding:16,display:"flex",flexDirection:"column",gap:12},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:[(0,f.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:6,flex:"0 0 150px"},children:[(0,f.jsx)("span",{style:r,children:"Time"}),(0,f.jsxs)("div",{style:{position:"relative"},children:[(0,f.jsxs)("select",{value:e.time||"",onChange:a=>M(t,s,e.id,"time",a.target.value),style:(0,m.A)((0,m.A)({},i),{},{appearance:"none",WebkitAppearance:"none",width:"100%",fontFamily:$i,fontSize:13,fontWeight:700,color:Xi.ink,paddingRight:28,cursor:"pointer"}),children:[e.time&&!hl.includes(e.time)&&(0,f.jsx)("option",{value:e.time,children:bl(e.time)}),hl.map(e=>(0,f.jsx)("option",{value:e,children:bl(e)},e))]}),(0,f.jsx)(Et.A,{size:13,color:Xi.muted,strokeWidth:2.2,style:{position:"absolute",right:10,top:"50%",transform:"translateY(-50%)",pointerEvents:"none"}})]})]}),(0,f.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:6,flex:"1 1 220px",minWidth:0},children:[(0,f.jsx)("span",{style:r,children:"Session"}),(0,f.jsx)("input",{autoFocus:!0,defaultValue:e.description,onChange:a=>M(t,s,e.id,"description",a.target.value),placeholder:"What's happening?",style:(0,m.A)((0,m.A)({},i),{},{fontSize:15,fontWeight:600,color:Xi.ink})})]})]}),(0,f.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,f.jsx)("span",{style:r,children:"Location"}),(0,f.jsx)("input",{defaultValue:e.location,onChange:a=>M(t,s,e.id,"location",a.target.value),placeholder:"Add a location",style:(0,m.A)((0,m.A)({},i),{},{fontSize:14})})]}),(0,f.jsxs)("label",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,f.jsx)("span",{style:r,children:"Notes / shot list"}),(0,f.jsx)("textarea",{defaultValue:e.notes,onChange:a=>M(t,s,e.id,"notes",a.target.value),placeholder:"Add shot notes",rows:2,style:(0,m.A)((0,m.A)({},i),{},{fontSize:14,resize:"vertical",lineHeight:1.5})})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>((e,t,s)=>{x(a=>{const n=a.map(e=>(0,m.A)({},e)),r=n[e];null==t?r.items=r.items.filter(e=>e.id!==s):r.days=r.days.map((e,a)=>a===t?(0,m.A)((0,m.A)({},e),{},{items:e.items.filter(e=>e.id!==s)}):e);const i=null==t?null:r.days[t];return W("tl:".concat(r.target,":").concat(i?i.id:"-"),L(r,i)),n}),y(null)}
1)(t,s,e.id),style:{display:"inline-flex",alignItems:"center",gap:6,fontFamily:$i,fontSize:10.5,fontWeight:700,letterSpacing:".1em",textTransform:"uppercase",color:Xi.red,background:"none",border:"none",cursor:"pointer",padding:"6px 2px"},children:[(0,f.jsx)(la.A,{size:13,strokeWidth:2}),"Delete"]}),(0,f.jsx)("button",{type:"button",onClick:()=>F(a),className:"tg-done",style:{fontFamily:Ki,fontSize:12.5,fontWeight:700,color:"#fff",background:Xi.ink,border:"none",borderRadius:4,padding:"10px 20px",cursor:"pointer"},children:"Done"})]})]}):(0,f.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>_(a),onKeyDown:e=>{"Enter"===e.key&&_(a)},className:"tg-item",style:{position:"relative",cursor:"pointer",borderRadius:4,padding:"11px 12px",margin:"-11px -12px"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10},children:[(0,f.jsx)("span",{style:{flex:"1 1 auto",fontFamily:Zi,fontSize:15,fontWeight:600,lineHeight:1.35,color:e.description?Xi.ink:Xi.silver,fontStyle:e.description?"normal":"italic"},children:e.description||"Untitled \u2014 tap to edit"}),(0,f.jsx)(ml.A,{size:13,color:Xi.faint,strokeWidth:2,style:{flexShrink:0,marginTop:2}})]}),e.location&&(0,f.jsx)("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginTop:7},children:(0,f.jsxs)("a",{href:Wi(e.location),target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),style:{display:"inline-flex",alignItems:"center",gap:5,fontFamily:$i,fontSize:10.5,fontWeight:700,letterSpacing:".08em",textTransform:"uppercase",color:Xi.tealDeep,textDecoration:"none"},children:[(0,f.jsx)(C.A,{size:11,strokeWidth:2.2}),e.location]})}),e.notes&&(0,f.jsx)("div",{style:{marginTop:8,paddingLeft:11,borderLeft:"2px solid ".concat(Xi.divider),fontFamily:Zi,fontSize:13,color:Xi.muted,lineHeight:1.5,whiteSpace:"pre-line"},children:e.notes})]})},ce=(e,t,s)=>{const n=Gi(t||[],bl);return 0===n.length?(0,f.jsx)("div",{className:"tg-indent",style:{paddingLeft:104,marginBottom:16},children:(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:10.5,letterSpacing:".08em",textTransform:"uppercase",color:Xi.faint,padding:"18px 0"},children:"No schedule items yet"})}):n.map(t=>(0,f.jsx)(ko,{time:t.time,concurrentCount:t.isConcurrent?t.streams.length:0,children:t.isConcurrent?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,background:Xi.carbon,borderRadius:"4px 4px 0 0",padding:"9px 14px",flexWrap:"wrap"},children:[(0,f.jsxs)("span",{style:{fontFamily:$i,fontSize:9.5,fontWeight:700,letterSpacing:".16em",color:Xi.amber},children:[t.streams.length," STREAMS RUNNING TOGETHER"]}),(0,f.jsx)("span",{style:{flex:"1 1 auto",height:1,background:Xi.body,minWidth:12}}
1),(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:9.5,fontWeight:700,letterSpacing:".1em",color:Xi.secondary},children:t.timeLabel})]}),(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(230px,1fr))",gap:1,background:Xi.hairline,border:"1px solid ".concat(Xi.hairline),borderTop:"none",borderRadius:"0 0 4px 4px",overflow:"hidden"},children:t.lanes.map(t=>(0,f.jsxs)("div",{style:{background:Xi.card,borderTop:"3px solid ".concat(t.style.rail),padding:"14px 16px"},children:[(0,f.jsx)("div",{style:{display:"flex",alignItems:"baseline",gap:8,marginBottom:11,flexWrap:"wrap"},children:(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10,fontWeight:700,letterSpacing:".12em",color:t.style.fg},children:t.label})}),(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:t.items.map(t=>(0,f.jsx)(a.Fragment,{children:le(t,e,s)},t.id))})]},t.label))})]}):(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:t.items.map(t=>{const a=b==="item:".concat(t.id);return(0,f.jsx)("div",{style:a?void 0:{background:Xi.card,border:"1px solid ".concat(Xi.hairline),borderLeft:"3px solid ".concat(Xi.red),borderRadius:4,padding:"15px 17px"},children:le(t,e,s)},t.id)})})},t.id))},de=e=>{let{onClick:t}=e;return(0,f.jsx)("div",{className:"tg-indent",style:{paddingLeft:104,marginBottom:6},children:(0,f.jsxs)("button",{type:"button",onClick:t,className:"tg-add",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,width:"100%",fontFamily:Ki,fontSize:12.5,fontWeight:700,color:Xi.red,background:"none",border:"1px dashed #D6D1C8",borderRadius:4,padding:"11px 18px",cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:14,strokeWidth:2.4}),"Add schedule item"]})})},me={idle:{text:"ALL CHANGES SAVED",fg:Xi.muted,dot:Xi.secondary},saving:{text:"SAVING\u2026",fg:Xi.amber,dot:Xi.amber},saved:{text:"SAVED",fg:Xi.greenText,dot:Xi.green},error:{text:"SAVE FAILED",fg:Xi.red,dot:Xi.red,isError:!0}}[h],pe=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(io,{children:(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",style:{height:28,width:"auto",display:"block"}})}),(0,f.jsxs)(oo,{children:[(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:9.5,fontWeight:700,letterSpacing:".24em",color:Xi.red},children:"CLIENT RUNSHEET"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Qi),{},{fontWeight:900,fontSize:21,lineHeight:1.12,letterSpacing:"-.01em",marginTop:10}),children:null===t||void 0===t?void 0:t.event_name}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:7,marginTop:16},children:[se&&(0,f.jsx)(po,{icon:_t.A,color:Xi.amber,children:se}),(null===t||void 0===t?void 0:t.venue)&&(0,f.jsx)(po,{icon:C.A,color:Xi.teal,children:t.venue.toUpperCase()}),o&&(0,f.jsx)(po,{icon:Nt.A,color:Xi.teal,children:o})]})]}),(0,f.jsx)(co,{}),(0,f.jsx)(xo,{items:ne,activeAnchor:re,onSelect:ie}),(0,f.jsxs)(mo,{children:[(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:9,fontWeight:700,letterSpacing:".18em",color:Xi.secondary,marginBottom:12},children:"YOUR TURBO 360 TEAM"}),(0,f.jsx)("div",{style:{fontFamily:Ki,fontSize:14,fontWeight:800},children:"Production support"}),(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:10,letterSpacing:".06em",color:Xi.silver,marginTop:3},children:"ON-THE-DAY \xb7 24/7"}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:12},children:[(0,f.jsxs)("a",{href:"tel:1300207446",className:"tg-primary",style:{flex:"1 1 auto",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,background:Xi.red,color:"#fff",textDecoration:"none",borderRadius:4,padding:10,fontFamily:Ki,fontSize:12.5,fontWeight:700},children:[(0,f.jsx)(E.A,{size:13,strokeWidth:2}),"Call"]}),(0,f.jsx)("a",{href:"mailto:[email protected]",className:"tg-ghost","aria-label":"Email Turbo 360",style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,.09)",border:"1px solid rgba(255,255,255,.14)",color:"#fff",textDecoration:"none",borderRadius:4,padding:"10px 13px"},children:(0,f.jsx)(T.A,{size:14,strokeWidth:2})})]}),(0,f.jsx)(ho,(0,m.A)((0,m.A)({},me),{},{onRetry:me.isError?O:null}))]})]});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(ro,{rail:pe,children:[(0,f.jsx)(uo,{kicker:"EVENT RUNSHEET",title:null===t||void 0===t?void 0:t.event_name,actions:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(go,{onClick:()=>window.print(),children:[(0,f.jsx)(Sr.A,{size:14,strokeWidth:2}),"Print"]}),(0,f.jsxs)(fo,{onClick:oe,children:[w?(0,f.jsx)(zt.A,{size:14,strokeWidth:2.4}):(0,f.jsx)(at.A,{size:14,strokeWidth:2}),w?"Link copied":"Share"]})]}),children:(0,f.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center",gap:16,marginTop:26,flexWrap:"wrap"},children:[(null===t||void 0===t?void 0:t.company_logo_url)&&(0,f.jsx)("span",{style:{width:38,height:38,borderRadius:4,background:"#fff",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",flexShrink:0},children:(0,f.jsx)("img",{src:t.company_logo_url,alt:"",style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})}),(null===t||void 0===t?void 0:t.client_company)&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10,fontWeight:700,letterSpacing:".18em",color:Xi.secondary},children:"PREPARED FOR"}),(0,f.jsx)("span",{style:{fontFamily:Ki,fontSize:16,fontWeight:800},children:t.client_company})]}),ae&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{style:{width:1,height:16,background:Xi.body}}),(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:11,color:Xi.silver},children:ae})]})]})}),(0,f.jsx)(bo,{id:"sec-glance",top:36,children:(0,f.jsxs)(No,{children:[(0,f.jsx)(Ao,{label:"CALL TIME",value:X||"\u2014"}),(0,f.jsx)(Ao,{label:"WRAP",value:ee||"\u2014"}
1),(0,f.jsx)(Ao,{label:"CREW",value:Z.length?so(Z.length):"\u2014"}),(0,f.jsx)(Ao,{label:"DELIVERABLES",value:K.length?so(K.length):"\u2014",dark:!0})]})}),(0,f.jsxs)(bo,{id:"sec-brief",children:[(0,f.jsx)(yo,{num:"01",title:"Briefing & Contacts",tag:"EDITABLE"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(300px,1fr))",gap:20},children:[(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,f.jsx)(vo,{children:"ON-THE-DAY BRIEF"}),"brief:shared"===b?(0,f.jsxs)("div",{tabIndex:-1,onBlur:z("brief:shared"),style:{flex:"1 1 auto",display:"flex",flexDirection:"column"},children:[(0,f.jsx)("textarea",{autoFocus:!0,value:c,onChange:e=>{return t=e.target.value,d(t),void W("br:shared",()=>({type:"brief",target:"shared",value:t}));var t},rows:7,placeholder:"Add a briefing note for the whole crew\u2026",style:{width:"100%",boxSizing:"border-box",flex:"1 1 auto",minHeight:190,background:Xi.card,border:"1px solid ".concat(Xi.red),boxShadow:"0 0 0 3px rgba(191,33,47,.09)",borderRadius:4,padding:"18px 20px",fontFamily:Zi,fontSize:15,lineHeight:1.6,color:Xi.body,resize:"vertical",outline:"none"}}),(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8,marginTop:9,fontFamily:$i,fontSize:9.5,letterSpacing:".1em",color:Xi.muted},children:"SAVES AUTOMATICALLY \u2014 TAP OUTSIDE WHEN DONE"})]}):(0,f.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>_("brief:shared"),onKeyDown:e=>{"Enter"===e.key&&_("brief:shared")},className:"tg-rowhover",style:{flex:"1 1 auto",background:Xi.card,border:"1px solid ".concat(Xi.hairline),borderRadius:4,padding:"18px 20px",minHeight:190,cursor:"text",display:"flex",gap:12,alignItems:"flex-start"},children:[(0,f.jsx)("div",{style:{flex:1,fontSize:15,lineHeight:1.6,color:c?Xi.body:Xi.silver,fontStyle:c?"normal":"italic",whiteSpace:"pre-wrap"},children:c||"Add briefing notes for the crew \u2014 dress code, access, key contacts on the ground\u2026"}),(0,f.jsx)(ml.A,{size:15,color:Xi.faint,strokeWidth:2,style:{flexShrink:0,marginTop:2}})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)(vo,{children:"KEY CONTACTS"}),(0,f.jsx)("div",{style:{border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:Q.map((e,t)=>(0,f.jsxs)("div",{style:{background:Xi.card,padding:"15px 18px",borderBottom:t===Q.length-1?"none":"1px solid ".concat(Xi.divider),display:"flex",alignItems:"center",gap:14},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",width:34,height:34,borderRadius:4,background:e.emergency?Xi.red:e.avatarBg,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:Ki,fontWeight:800,fontSize:12.5},children:e.emergency?(0,f.jsx)(E.A,{size:16,strokeWidth:2}):ao(e.name)}),(0,f.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:Ki,fontSize:14,fontWeight:800},children:e.name}),e.isPrimary&&(0,f.jsx)(jo,{bg:Xi.redTint,fg:Xi.redline,children:"PRIMARY"}),e.emergency&&(0,f.jsx)(jo,{bg:"#FEF3C7",fg:"#92400E",children:"24/7"})]}),e.role&&(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:10,letterSpacing:".06em",textTransform:"uppercase",color:Xi.muted,marginTop:2,overflow:"hidden",textOverflow:"ellipsis"},children:e.role})]}),e.mobile&&(0,f.jsx)("a",{href:"tel:".concat((e.mobile||"").replace(/\s/g,"")),className:"tg-icon-call","aria-label":"Call ".concat(e.name),style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid ".concat(Xi.hairline),borderRadius:4,color:Xi.red,textDecoration:"none"},children:(0,f.jsx)(E.A,{size:14,strokeWidth:2})}),e.email&&(0,f.jsx)("a",{href:"mailto:".concat(e.email),className:"tg-icon-mail","aria-label":"Email ".concat(e.name),style:{flex:"0 0 auto",display:"inline-flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid ".concat(Xi.hairline),borderRadius:4,color:Xi.tealDeep,textDecoration:"none"},children:(0,f.jsx)(T.A,{size:14,strokeWidth:2})})]},e.key))})]})]})]}),(0,f.jsxs)(bo,{id:"sec-schedule",top:48,children:[(0,f.jsx)(yo,{num:"02",title:"Run Schedule",tag:"EDITABLE"}),(p.length>1||J.length>0)&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:20,flexWrap:"wrap",background:Xi.card,border:"1px solid ".concat(Xi.hairline),borderRadius:4,padding:"14px 18px",marginBottom:24},children:[p.length>1&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:9,fontWeight:700,letterSpacing:".16em",color:Xi.silver},children:"VIEW"}),[{key:"all",label:"All crew"},...p.map(e=>({key:e.key,label:e.label}))].map(e=>{const t=e.key===v;return(0,f.jsx)("button",{type:"button",onClick:()=>j(e.key),style:{fontFamily:Ki,fontSize:12,fontWeight:700,color:t?"#fff":Xi.secondary,background:t?Xi.ink:Xi.
1card,border:"1px solid ".concat(t?Xi.ink:Xi.hairline),borderRadius:999,padding:"6px 14px",cursor:"pointer"},children:e.label},e.key)})]}),(0,f.jsx)("span",{style:{flex:"1 1 auto"}}),(0,f.jsx)(_o,{legend:J})]}),te.map(e=>{const t=p.indexOf(e),s=pl[t%pl.length],a=(r=e.key,/photograph/i.test(r)?Ue.A:/video/i.test(r)?Ge.A:Xe.A);var r;const i=e.isMulti?(e.days||[]).reduce((e,t)=>e+(t.items||[]).length,0):(e.items||[]).length,o=(e.people||[]).join(" \xb7 ");return(0,f.jsxs)("div",{style:{marginBottom:34},children:[(0,f.jsxs)("div",{className:"tg-role-head",style:{display:"flex",alignItems:"center",gap:14,background:Xi.card,border:"1px solid ".concat(Xi.hairline),borderLeft:"3px solid ".concat(s),borderRadius:4,padding:"16px 20px",marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",width:36,height:36,borderRadius:4,background:s,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(a,{size:18,strokeWidth:2})}),(0,f.jsxs)("div",{style:{flex:"1 1 200px",minWidth:0},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Qi),{},{fontSize:15,fontWeight:800,letterSpacing:".01em",textTransform:"uppercase"}),children:e.label}),o&&(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:10.5,letterSpacing:".06em",textTransform:"uppercase",color:Xi.muted,marginTop:3},children:o})]}),(0,f.jsxs)("div",{style:{flex:"0 1 180px",minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:8.5,fontWeight:700,letterSpacing:".14em",color:Xi.silver,marginBottom:3},children:"BASE LOCATION"}),b==="loc:".concat(e.key)?(0,f.jsx)("div",{tabIndex:-1,onBlur:z("loc:".concat(e.key)),children:(0,f.jsx)("input",{autoFocus:!0,value:e.location,onChange:e=>((e,t)=>{x(s=>{const a=s.map((s,a)=>a===e?(0,m.A)((0,m.A)({},s),{},{location:t}):s),n=a[e];return W("loc:".concat(n.target),()=>({type:"location",target:n.target,value:t})),a})})(t,e.target.value),placeholder:"Add a primary location\u2026",style:{width:"100%",border:"1px solid ".concat(Xi.red),boxShadow:"0 0 0 3px rgba(191,33,47,.09)",borderRadius:4,padding:"7px 10px",fontSize:13,fontWeight:600,fontFamily:Zi,outline:"none"}})}):(0,f.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>_("loc:".concat(e.key)),onKeyDown:t=>{"Enter"===t.key&&_("loc:".concat(e.key))},className:"tg-edithover",style:{display:"inline-flex",alignItems:"center",gap:7,cursor:"pointer",borderRadius:4,padding:"2px 4px",margin:"-2px -4px",maxWidth:"100%"},children:[(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600,color:e.location?Xi.body:Xi.silver,fontStyle:e.location?"normal":"italic",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.location||"Add location\u2026"}),(0,f.jsx)(ml.A,{size:12,color:Xi.faint,strokeWidth:2,style:{flexShrink:0}})]})]}),S&&(0,f.jsxs)("div",{style:{flex:"1 1 220px",minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:$i,fontSize:8.5,fontWeight:700,letterSpacing:".14em",color:Xi.silver,marginBottom:3},children:"ROLE BRIEF"}),b==="brief:".concat(e.key)?(0,f.jsx)("div",{tabIndex:-1,onBlur:z("brief:".concat(e.key)),children:(0,f.jsx)("textarea",{autoFocus:!0,value:e.brief,onChange:e=>((e,t)=>{x(s=>{const a=s.map((s,a)=>a===e?(0,m.A)((0,m.A)({},s),{},{brief:t}):s),n=a[e];return W("br:".concat(n.briefTarget),()=>({type:"brief",target:n.briefTarget,value:t})),a})})(t,e.target.value),placeholder:"Add a note for this role\u2026",style:{width:"100%",boxSizing:"border-box",minHeight:54,border:"1px solid ".concat(Xi.red),boxShadow:"0 0 0 3px rgba(191,33,47,.09)",borderRadius:4,padding:"8px 11px",fontSize:13,lineHeight:1.5,fontFamily:Zi,outline:"none",resize:"vertical"}})}):(0,f.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>_("brief:".concat(e.key)),onKeyDown:t=>{"Enter"===t.key&&_("brief:".concat(e.key))},className:"tg-edithover",style:{display:"flex",alignItems:"flex-start",gap:7,cursor:"pointer",borderRadius:4,padding:"2px 4px",margin:"-2px -4px"},children:[(0,f.jsx)("span",{style:{flex:1,fontSize:13,lineHeight:1.5,color:e.brief?Xi.secondary:Xi.silver,fontStyle:e.brief?"normal":"italic"},children:e.brief||"Add a note for this role\u2026"}),(0,f.jsx)(ml.A,{size:12,color:Xi.faint,strokeWidth:2,style:{marginTop:2,flexShrink:0}})]})]}),(0,f.jsxs)("span",{style:{flex:"0 0 auto",fontFamily:$i,fontSize:10,fontWeight:700,letterSpacing:".08em",color:Xi.secondary,background:Xi.inset2,borderRadius:3,padding:"5px 10px",whiteSpace:"nowrap"},children:[i," ",1===i?"ITEM":"ITEMS"]})]}),e.isMulti?(e.days||[]).map((e,s)=>(0,f.jsxs)("div",{style:{marginBottom:10},children:[(0,f.jsxs)(So,{children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Qi),{},{fontWeight:800,fontSize:13,letterSpacing:".06em",textTransform:"uppercase",color:Xi.ink}),children:"DAY ".concat(s+1)}),e.date&&(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10.5,fontWeight:700,letterSpacing:".1em",color:Xi.red},children:n(e.date)}),e.location&&(0,f.jsx)("span",{style:{fontFamily:$i,fontSize:10,letterSpacing:".06em",textTransform:"uppercase",color:Xi.muted},children:e.location})]}),ce(t,e.items,s),(0,f.jsx)(de,{onClick:()=>q(t,s)})]},e.id||s)):(0,f.jsxs)(f.Fragment,{children:[ce(t,e.items,null),(0,f.jsx)(de,{onClick:()=>q(t,null)})]})]},e.key)})]}),(0,f.jsxs)(bo,{id:"sec-capture",top:20,children:[(0,f.jsx)(yo,{num:"03",title:"Must-Capture",tag:"EDITABLE"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(320px,1fr))",gap:1,background:Xi.hairline,border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:[H.map((e,t)=>(0,f.jsxs)("div",{style:{background:Xi.card,display:"flex",alignItems:"center",gap:14,padding:"6px 14px 6px 18px"},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",fontFamily:$i,fontSize:13,fontWeight:700,color:Xi.red,width:22},children:so(t+1)}),(0,f.jsx)("input",{value:e.text,onChange:e=>{return s=t,a=e.target.value,U(e=>{const t=e.map((e,t)=>t===s?(0,m.A)((0,m.A)({},e),{},{text:a}):e);return W("chk:shared",G(t)),t});var s,a},placeholder:"Shot / item to capture",className:"tg-input",style:{flex:"1 1 auto",minWidth:0,fontFamily:Zi,fontSize:14.5,color:Xi.body,border:"1px solid transparent",borderRadius:4,padding:10,background:"transparent"}}),(0,f.jsx)("button",{type:"button",onClick:()=>{return e=t,U(t=>{const s=t.filter((t,s)=>s!==e);return W("chk:shared",G(s)),s});var e},title:"Delete item","aria-label":"Delete item",className:"tg-del",style:{flex:"0 0 auto",color:Xi.faint,background:"none",border:"none",cursor:"pointer",padding:6},children:(0,f.jsx)(g.A,{size:14,strokeWidth:2})})]},e.id||t)),(0,f.jsxs)("button",{type:"button",onClick:()=>{const e={id:"tmp-mc-".concat(Date.now(),"-").concat(ul++),text:""};U(t=>{const s=[...t,e];return W("chk:shared",G(s)),s}),y("chk:".concat(e.id))}
1,className:"tg-add",style:{background:Xi.inset,display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:18,fontFamily:Ki,fontSize:12.5,fontWeight:700,color:Xi.red,border:"none",cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:14,strokeWidth:2.4}),"Add a shot"]})]})]}),(0,f.jsxs)(bo,{id:"sec-deliverables",top:48,children:[(0,f.jsx)(yo,{num:"04",title:"Deliverables"}),0===K.length?(0,f.jsx)(wo,{children:"No deliverables listed yet"}):(0,f.jsx)("div",{style:{border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:K.map((e,t)=>(0,f.jsxs)("div",{style:{background:Xi.card,display:"flex",gap:20,alignItems:"flex-start",padding:"18px 22px",borderBottom:t===K.length-1?"none":"1px solid ".concat(Xi.divider)},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",fontFamily:$i,fontSize:12,fontWeight:700,color:Xi.red,paddingTop:2},children:so(t+1)}),(0,f.jsxs)("div",{style:{flex:"1 1 auto",minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:Ki,fontSize:15,fontWeight:800},children:e.name}),e.description&&(0,f.jsx)("div",{style:{fontSize:13.5,color:Xi.muted,lineHeight:1.55,marginTop:4},children:e.description})]})]},e.id||t))})]}),(0,f.jsxs)(bo,{id:"sec-docs",top:48,children:[(0,f.jsx)(yo,{num:"05",title:"Supporting Documents"}),0===Y.length?(0,f.jsx)(wo,{children:"No documents attached yet"}):(0,f.jsx)("div",{style:{border:"1px solid ".concat(Xi.hairline),borderRadius:4,overflow:"hidden"},children:Y.map((e,t)=>{const s=!!e.external_url,a=e.title||e.original_filename||e.external_url||"Document",n=(e=>{if(null==e||""===e)return"";const t="number"===typeof e?e:parseInt(e,10);return Number.isNaN(t)?String(e):t>=1048576?"".concat((t/1048576).toFixed(1)," MB"):t>=1024?"".concat(Math.round(t/1024)," KB"):"".concat(t," B")})(e.file_size),r=s?()=>window.open(e.external_url,"_blank","noopener"):()=>i&&i(e);return(0,f.jsxs)("button",{type:"button",onClick:r,className:"tg-rowhover",style:{background:Xi.card,display:"flex",alignItems:"center",gap:14,padding:"14px 18px",border:"none",borderBottom:t===Y.length-1?"none":"1px solid ".concat(Xi.divider),borderRadius:0,cursor:"pointer",textAlign:"left",width:"100%"},children:[(0,f.jsx)("span",{style:{flex:"0 0 auto",width:32,height:32,borderRadius:4,background:Xi.inset2,color:Xi.muted,display:"flex",alignItems:"center",justifyContent:"center"},children:s?(0,f.jsx)(En.A,{size:15,strokeWidth:2}):(0,f.jsx)(kt.A,{size:15,strokeWidth:2})}),(0,f.jsxs)("span",{style:{flex:"1 1 auto",minWidth:0},children:[(0,f.jsx)("span",{style:{display:"block",fontSize:14,fontWeight:600,color:Xi.ink,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a}),n&&(0,f.jsx)("span",{style:{display:"block",fontFamily:$i,fontSize:10,letterSpacing:".08em",color:Xi.silver,marginTop:2},children:n})]}),s?(0,f.jsx)(En.A,{size:15,color:Xi.silver,strokeWidth:2}):(0,f.jsx)(es.A,{size:15,color:Xi.silver,strokeWidth:2})]},e.file_key||e.s3_key||e.link_id||t)})})]}),(0,f.jsxs)(Co,{children:[(0,f.jsx)("a",{href:"tel:1300207446",style:{color:Xi.muted,textDecoration:"none"},children:"1300 207 446"}),(0,f.jsx)("a",{href:"mailto:[email protected]",style:{color:Xi.muted,textDecoration:"none"},children:"[email protected]"}),(0,f.jsx)("span",{style:{color:Xi.red},children:"EVERY ANGLE \xb7 FULL SPEED"})]})]}),"idle"!==h&&(0,f.jsx)(Fo,(0,m.A)((0,m.A)({},me),{},{onRetry:me.isError?O:null})),A&&(0,f.jsx)(yl,{onClose:()=>{try{window.localStorage.setItem(xl,String(Date.now()))}catch(e){}k(!1)}})]})},jl=()=>{const e=ll(),{isLoading:t,error:s,event:a}=e,[n]=(0,r.ok)(),i="client"===n.get("view");if(t)return(0,f.jsx)("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-red-600 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-slate-600",children:"Loading runsheet..."})]})});if(s||!a)return(0,f.jsx)("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Runsheet Not Found"}),(0,f.jsx)("p",{className:"text-slate-600",children:s||"The requested runsheet could not be found."})]})});if(i)return(0,f.jsx)(vl,(0,m.A)({},e));const o=a.runsheet_template||"classic",l=Vo[o]||Vo.classic;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(l,(0,m.A)({},e)),e.showRoleModal&&(0,f.jsx)(dl,{availableRoles:e.availableRoles,activeRole:e.activeRole,setActiveRole:e.setActiveRole,onClose:e.dismissRoleModal})]})},wl={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},Nl={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},Al="'Space Mono',monospace",kl=()=>{var e;const t=(0,r.Zp)(),s=(0,r.zy)(),n=(null===(e=s.state)||void 0===e?void 0:e.prefilledClient)||s.state,[i,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(!1),[x,u]=(0,a.useState)(null),[b,y]=(0,a.useState)({client_name:(null===n||void 0===n?void 0:n.contact_name)||"",email_address:(null===n||void 0===n?void 0:n.email)||"",mobile_number:(null===n||void 0===n?void 0:n.phone)||"",project_name:"",video_link:"",message:""});(0,a.useEffect)(()=>
1{if((0,o.cd)()){const e=JSON.parse(localStorage.getItem("turbo360_admin_auth"));l(e)}else t("/?admin=true")},[t]);const v=(e,t)=>{y(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t}))};if(!i)return(0,f.jsx)(ta,{title:"Content Delivery",meta:"MEDIA \xb7 DELIVERY",children:(0,f.jsx)("div",{style:{maxWidth:720,margin:"0 auto"},children:(0,f.jsx)(Ws,{rows:6})})});const j=(null===x||void 0===x?void 0:x.results)||{};return(0,f.jsx)(ta,{title:"Content Delivery",meta:"MEDIA \xb7 DELIVERY",children:(0,f.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",display:"flex",flexDirection:"column",gap:18},children:[x&&(0,f.jsx)(Ls,{style:{padding:18,border:"1px solid ".concat(x.success?"#BBF7D0":"#FECACA"),background:x.success?"#F0FDF4":"#FEF2F2"},children:(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:12},children:[(0,f.jsx)("span",{style:{width:34,height:34,borderRadius:9,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",background:x.success?"#DCFCE7":"#FEE2E2",color:x.success?"#15803D":"#991B1B"},children:x.success?(0,f.jsx)(p.A,{size:18}):(0,f.jsx)(h.A,{size:18})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:14,fontWeight:700,color:x.success?"#166534":"#991B1B"},children:x.message}),x.results&&(0,f.jsxs)("div",{style:{marginTop:8,display:"flex",flexDirection:"column",gap:5},children:[j.email_sent&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,fontSize:12.5,color:"#15803D"},children:[(0,f.jsx)(p.A,{size:15}),(0,f.jsx)("span",{children:"Email sent successfully"})]}),j.sms_sent&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,fontSize:12.5,color:"#15803D"},children:[(0,f.jsx)(p.A,{size:15}),(0,f.jsx)("span",{children:"SMS sent successfully"})]}),j.errors&&j.errors.length>0&&j.errors.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,fontSize:12.5,color:"#991B1B"},children:[(0,f.jsx)(h.A,{size:15}),(0,f.jsx)("span",{children:e})]},t))]})]}),(0,f.jsx)("button",{onClick:()=>u(null),style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex",padding:2},children:(0,f.jsx)(g.A,{size:18})})]})}),(0,f.jsxs)(Ls,{style:{padding:24},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:16,marginBottom:4},children:"Deliver finished video"}),(0,f.jsx)("p",{style:{fontSize:13,color:"#9A9AA0",margin:"0 0 20px"},children:"Emails the client a secure link (CC [email protected]). Add a mobile to also send an SMS."}),(0,f.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),d(!0),u(null);try{var t;const e=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,s=await fetch("".concat(I.fn,"/api/wedding-admin/content-delivery"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(b)}),a=await s.json();s.ok?(u({success:!0,message:"Content delivery sent successfully!",results:a.results||{}}),y({client_name:"",email_address:"",mobile_number:"",project_name:"",video_link:"",message:""})):u({success:!1,message:a.message||"Failed to send content delivery"})}catch(s){console.error("Content delivery error:",s),u({success:!1,message:"Network error. Please try again."})}finally{d(!1)}},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:wl,children:"Client name *"}),(0,f.jsx)("input",{type:"text",required:!0,value:b.client_name,onChange:e=>v("client_name",e.target.value),placeholder:"Enter client's full name",style:Nl})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:wl,children:"Project name *"}),(0,f.jsx)("input",{type:"text",required:!0,value:b.project_name,onChange:e=>v("project_name",e.target.value),placeholder:"e.g., Sarah & John's Wedding Video",style:Nl})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:wl,children:"Email address *"}),(0,f.jsx)("input",{type:"email",required:!0,value:b.email_address,onChange:e=>v("email_address",e.target.value),placeholder:"[email protected]",style:Nl})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{style:wl,children:["Mobile ",(0,f.jsx)("span",{style:{color:"#9A9AA0",fontWeight:400},children:"(optional \u2192 SMS)"})]}),(0,f.jsx)("input",{type:"tel",value:b.mobile_number,onChange:e=>v("mobile_number",e.target.value),placeholder:"0412 345 678",style:(0,m.A)((0,m.A)({},Nl),{},{fontFamily:Al})})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:wl,children:"Video link *"}),(0,f.jsx)("input",{type:"url",required:!0,value:b.video_link,onChange:e=>v("video_link",e.target.value),placeholder:"https://vimeo.com/123456789 or https://youtu.be/abc123",style:(0,m.A)((0,m.A)({},Nl),{},{fontFamily:Al})})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:wl,children:"Message"}),(0,f.jsx)("textarea",{rows:"4",value:b.message,onChange:e=>v("message",e.target.value),placeholder:"Add a personal message for the client (e.g., special notes about the video, next steps, etc.)",style:(0,m.A)((0,m.A)({},Nl),{},{resize:"vertical",minHeight:88})})]})]}),(0,f.jsx)("div",{style:{display:"flex",gap:10,marginTop:20}
1,children:(0,f.jsxs)("button",{type:"submit",disabled:c,className:"tg-btn-primary",style:{display:"inline-flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:10,padding:"12px 20px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:14,fontWeight:600,cursor:c?"default":"pointer",opacity:c?.6:1},children:[(0,f.jsx)(st.A,{size:16})," ",c?"Sending\u2026":"Send Delivery"]})})]})]}),(0,f.jsxs)(Ls,{style:{padding:"18px 20px"},children:[(0,f.jsx)("div",{style:{fontFamily:Al,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:14},children:"WILL SEND"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11,padding:"11px 0",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsx)("span",{style:{width:34,height:34,borderRadius:9,background:"#DCFCE7",color:"#15803D",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(T.A,{size:17})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600},children:"Email"}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0"},children:"to client + CC [email protected]"})]})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11,padding:"11px 0"},children:[(0,f.jsx)("span",{style:{width:34,height:34,borderRadius:9,background:b.mobile_number?"#DBEAFE":"#F2F2F5",color:b.mobile_number?"#1D4ED8":"#9A9AA0",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(E.A,{size:17})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600},children:"SMS"}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0"},children:b.mobile_number?"mobile provided":"add a mobile to enable"})]})]})]})]})})},Sl="'Space Mono',monospace",_l={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Cl={fontFamily:Sl,fontSize:10.5,letterSpacing:"0.14em",color:"#9A9AA0",textTransform:"uppercase"},Fl={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},El=()=>{var e,t;const s=(0,r.Zp)(),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(null),[d,h]=(0,a.useState)(""),[u,g]=(0,a.useState)(!0),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)([]),[w,N]=(0,a.useState)([]),[A,k]=(0,a.useState)(""),[S,C]=(0,a.useState)(""),[F,E]=(0,a.useState)(""),[z,B]=(0,a.useState)(!1),[D,R]=(0,a.useState)(null),[P,W]=(0,a.useState)(""),[O,L]=(0,a.useState)([]),[M,q]=(0,a.useState)(!1),[H,U]=(0,a.useState)(!1),G=(0,a.useRef)(null),V=(0,a.useRef)(null),J=()=>({Authorization:"Bearer ".concat((0,o.c4)()),"Content-Type":"application/json"});(0,a.useEffect)(()=>{(0,o.cd)()?Y():s("/tboadmin")},[]);const Y=async()=>{try{const e=await fetch("".concat(I.fn,"/api/admin/marketing/campaigns"),{headers:J()});if(e.ok){const t=await e.json();i(t)}}catch(e){console.error("Error fetching campaigns:",e)}finally{g(!1)}},K=e=>{W(e),clearTimeout(G.current),G.current=setTimeout(()=>(async e=>{if(!e||e.length<2)L([]);else{q(!0);try{const t=await fetch("".concat(I.fn,"/api/clients?q=").concat(encodeURIComponent(e)),{headers:J()});if(t.ok){const e=((await t.json()).clients||[]).filter(e=>!e.is_company&&e.email&&e.contact_name).map(e=>({first_name:e.contact_name.split(" ")[0],full_name:e.contact_name,email:e.email,company:e.parent_company_name||e.company_name||""}));L(e)}}catch(t){console.error("Error searching contacts:",t)}finally{q(!1)}}})(e),300)},Z=()=>{A.trim()&&S.trim()&&(w.some(e=>e.email.toLowerCase()===S.trim().toLowerCase())||(N([...w,{first_name:A.trim(),email:S.trim()}]),k(""),C("")))},$=e=>{"Enter"===e.key&&(e.preventDefault(),Z())};if((0,a.useEffect)(()=>{if(V.current&&d){const e=V.current.contentDocument;e.open(),e.write(d),e.close()}},[d,b]),u)return(0,f.jsx)(ta,{title:"Marketing",meta:"MEDIA \xb7 CAMPAIGNS",children:(0,f.jsx)(Ws,{rows:6})});return(0,f.jsx)(ta,{title:"Marketing",meta:"MEDIA \xb7 CAMPAIGNS",children:(0,f.jsxs)("div",{className:"tg-marketing-grid",style:{display:"grid",gridTemplateColumns:"1fr 1.3fr",gap:20,alignItems:"start"},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},_l),{},{overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"Campaigns"}),0===n.length?(0,f.jsx)(Os,{icon:T.A,title:"No campaigns yet",message:"Marketing campaigns will appear here once configured."}):n.map(e=>{const t=(null===l||void 0===l?void 0:l.id)===e.id;return(0,f.jsxs)("div",{className:"tg-row",onClick:()=>(async e=>{c(e),E(e.subject),N([]),R(null);try{const t=await fetch("".concat(I.fn,"/api/admin/marketing/campaigns/").concat(e.id,"/preview"),{headers:J()});if(t.ok){const e=await t.json();h(e.html)}}catch(t){console.error("Error fetching preview:",t)}try{const t=await fetch("".concat(I.fn,"/api/admin/marketing/send-history?campaign_id=").concat(e.id),{headers:J()});if(t.ok){const e=await t.json();j(e)}}catch(t){console.error("Error fetching send history:",t)}})(e),style:{display:"flex",alignItems:"center",gap:12,padding:"14px 20px",borderBottom:"1px solid #F2F2F5",cursor:"pointer",background:t?"#FBF0F0":"#fff"}
1,children:[(0,f.jsx)("span",{style:{width:34,height:34,borderRadius:9,background:t?"#BF212F":"#EDEDF0",color:t?"#fff":"#9A9AA0",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(T.A,{size:16})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.description})]}),t?(0,f.jsx)("span",{style:{fontFamily:Sl,fontSize:9.5,fontWeight:700,background:"#DCFCE7",color:"#15803D",borderRadius:5,padding:"3px 7px",flexShrink:0},children:"SELECTED"}):(0,f.jsx)("span",{style:{color:"#C9C9D0",flexShrink:0},children:"\u203a"})]},e.id)})]}),l?(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},_l),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[(0,f.jsx)("span",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.name}),(0,f.jsxs)("button",{className:"tg-btn-primary",onClick:async()=>{if(0!==w.length&&l){B(!0),R(null);try{const e=await fetch("".concat(I.fn,"/api/admin/marketing/send"),{method:"POST",headers:J(),body:JSON.stringify({campaign_id:l.id,subject:F||l.subject,recipients:w})});if(e.ok){const t=await e.json();R(t);const s=await fetch("".concat(I.fn,"/api/admin/marketing/send-history?campaign_id=").concat(l.id),{headers:J()});s.ok&&j(await s.json())}}catch(e){console.error("Error sending:",e),R({total:w.length,successful:0,failed:w.length,error:e.message})}finally{B(!1)}}},disabled:z||0===w.length,style:{display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"9px 16px",fontSize:13,fontWeight:600,cursor:"pointer",flexShrink:0,opacity:z||0===w.length?.5:1},children:[z?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(st.A,{size:15}),z?"Sending ".concat(w.length,"\u2026"):"Send to ".concat(w.length)]})]}),(0,f.jsxs)("div",{style:{padding:"18px 20px"},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Cl),{},{marginBottom:7}),children:"Subject"}),(0,f.jsx)("input",{type:"text",value:F,onChange:e=>E(e.target.value),style:(0,m.A)((0,m.A)({},Fl),{},{marginBottom:16})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:7},children:[(0,f.jsx)("div",{style:Cl,children:"Preview"}),(0,f.jsxs)("button",{onClick:()=>y(!b),style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:12,fontWeight:600,color:"#BF212F",background:"none",border:"none",cursor:"pointer"},children:[(0,f.jsx)(_.A,{size:14})," ",b?"Hide":"Show"]})]}),b?(0,f.jsx)("div",{style:{border:"1px solid #E4E4E9",borderRadius:10,overflow:"hidden",marginBottom:18,background:"#F7F7F9"},children:(0,f.jsx)("iframe",{ref:V,title:"Email Preview",style:{width:"100%",height:480,border:"none",background:"#fff",display:"block"},sandbox:"allow-same-origin"})}):(0,f.jsxs)("div",{onClick:()=>y(!0),style:{border:"1px solid #E4E4E9",borderRadius:10,padding:"28px 20px",marginBottom:18,textAlign:"center",color:"#9A9AA0",cursor:"pointer",background:"#FBFBFC"},children:[(0,f.jsx)(_.A,{size:22,style:{margin:"0 auto 6px"}}),(0,f.jsx)("div",{style:{fontSize:12.5,fontWeight:600,color:"#55555C"},children:"Click to preview the email"})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Cl),{},{marginBottom:10}),children:["Recipients \xb7 ",w.length," selected"]}),(0,f.jsxs)("div",{style:{position:"relative",marginBottom:12},children:[(0,f.jsxs)("div",{style:{position:"relative"},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0",style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)"}}),(0,f.jsx)("input",{type:"text",placeholder:"Search clients by name or company\u2026",value:P,onChange:e=>K(e.target.value),onFocus:()=>U(!0),style:(0,m.A)((0,m.A)({},Fl),{},{paddingLeft:36,paddingRight:36})}),M&&(0,f.jsx)(Kr.A,{size:15,className:"animate-spin",color:"#9A9AA0",style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)"}})]}),H&&O.length>0&&(0,f.jsx)("div",{style:{marginTop:4,border:"1px solid #E4E4E9",borderRadius:9,maxHeight:200,overflowY:"auto",background:"#fff",boxShadow:"0 12px 32px rgba(10,10,11,.12)",position:"relative",zIndex:5},children:O.map((e,t)=>{const s=w.some(t=>t.email.toLowerCase()===e.email.toLowerCase());return(0,f.jsxs)("button",{onClick:()=>{(e=>{w.some(t=>t.email.toLowerCase()===e.email.toLowerCase())||N([...w,{first_name:e.first_name,email:e.email}])})(e)},disabled:s,style:{width:"100%",textAlign:"left",padding:"10px 13px",background:"none",border:"none",borderBottom:"1px solid #F2F2F5",cursor:s?"default":"pointer",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,opacity:s?.4:1},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"#0A0A0B"},children:e.full_name}),(0,f.jsx)("span",{style:{fontSize:12,color:"#9A9AA0",marginLeft:8},children:e.email}),e.company&&(0,f.jsxs)("span",{style:{fontSize:11,color:"#B5B5BC",marginLeft:8,display:"inline-flex",alignItems:"center",gap:4},children:[(0,f.jsx)(gs.A,{size:12}),e.company]})]}
1),s?(0,f.jsx)("span",{style:{fontFamily:Sl,fontSize:10,color:"#9A9AA0",flexShrink:0},children:"ADDED"}):(0,f.jsx)(ls.A,{size:15,color:"#9A9AA0",style:{flexShrink:0}})]},t)})}),H&&P.length>=2&&0===O.length&&!M&&(0,f.jsx)("div",{style:{marginTop:6,fontSize:12,color:"#9A9AA0",paddingLeft:2},children:"No contacts found"})]}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",marginBottom:7},children:"Or add manually:"}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginBottom:14},children:[(0,f.jsx)("input",{type:"text",placeholder:"First name",value:A,onChange:e=>k(e.target.value),onKeyDown:$,style:(0,m.A)((0,m.A)({},Fl),{},{flex:1})}),(0,f.jsx)("input",{type:"email",placeholder:"Email address",value:S,onChange:e=>C(e.target.value),onKeyDown:$,style:(0,m.A)((0,m.A)({},Fl),{},{flex:1})}),(0,f.jsx)("button",{onClick:Z,disabled:!A.trim()||!S.trim(),style:{display:"flex",alignItems:"center",justifyContent:"center",width:42,border:"1px solid #E4E4E9",borderRadius:9,background:"#F7F7F9",cursor:"pointer",color:"#55555C",flexShrink:0,opacity:A.trim()&&S.trim()?1:.4},children:(0,f.jsx)(ls.A,{size:16})})]}),w.length>0?(0,f.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:7,marginBottom:4},children:w.map((e,t)=>(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:11.5,background:"#F2F2F5",color:"#55555C",borderRadius:6,padding:"4px 9px"},children:[(0,f.jsx)("span",{style:{fontWeight:600},children:e.first_name}),(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:e.email}),(0,f.jsx)("button",{onClick:()=>{return e=t,void N(w.filter((t,s)=>s!==e));var e},title:"Remove",style:{display:"flex",background:"none",border:"none",padding:0,cursor:"pointer",color:"#B5B5BC"},children:(0,f.jsx)(la.A,{size:12.5})})]},t))}):(0,f.jsx)("div",{style:{fontSize:12.5,color:"#9A9AA0"},children:"No recipients added yet. Each person receives their own individual email."}),D&&(0,f.jsxs)("div",{style:{marginTop:18,border:"1px solid ".concat(D.failed>0?"#FDE68A":"#BBF7D0"),background:D.failed>0?"#FFFBEB":"#F0FDF4",borderRadius:11,padding:16},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:700,color:"#0A0A0B",marginBottom:4},children:0===D.failed?"All emails sent successfully":"".concat(D.successful," of ").concat(D.total," sent")}),(0,f.jsxs)("div",{style:{display:"flex",gap:14,fontFamily:Sl,fontSize:11,color:"#55555C",marginBottom:null!==(e=D.results)&&void 0!==e&&e.length?10:0},children:[(0,f.jsxs)("span",{children:["TOTAL ",D.total]}),(0,f.jsxs)("span",{style:{color:"#15803D"},children:["OK ",D.successful]}),(0,f.jsxs)("span",{style:{color:"#991B1B"},children:["FAIL ",D.failed]})]}),(null===(t=D.results)||void 0===t?void 0:t.length)>0&&(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:D.results.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12.5},children:[e.success?(0,f.jsx)(p.A,{size:14,color:"#15803D",style:{flexShrink:0}}):(0,f.jsx)(x.A,{size:14,color:"#991B1B",style:{flexShrink:0}}),(0,f.jsx)("span",{style:{fontWeight:600,color:"#0A0A0B"},children:e.first_name}),(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:e.email})]},t))})]})]}),v.length>0&&(0,f.jsxs)("div",{style:{padding:"18px 20px",borderTop:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Cl),{},{marginBottom:12,display:"flex",alignItems:"center",gap:7}),children:[(0,f.jsx)(Nt.A,{size:13})," Send history"]}),(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",maxHeight:220,overflowY:"auto"},children:v.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"8px 0",borderBottom:t===v.length-1?"none":"1px solid #F2F2F5"},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"#0A0A0B"},children:e.recipient_name}),(0,f.jsx)("span",{style:{fontSize:12,color:"#9A9AA0",marginLeft:8},children:e.recipient_email})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[e.success?(0,f.jsx)(p.A,{size:14,color:"#15803D"}):(0,f.jsx)(x.A,{size:14,color:"#991B1B"}),(0,f.jsx)("span",{style:{fontFamily:Sl,fontSize:11,color:"#9A9AA0"},children:new Date(e.sent_at).toLocaleDateString("en-AU",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})})]})]},t))})]})]}):(0,f.jsx)("section",{style:(0,m.A)({},_l),children:(0,f.jsx)(Os,{icon:st.A,title:"Select a campaign",message:"Pick a campaign from the list to preview the email and build your recipient list."})})]})})};var Tl=s(77737),zl=s(40183);s(14657);const Bl=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)(null),[n,i]=(0,a.useState)("integrations"),[l,c]=(0,a.useState)({stripe_public_key:"",stripe_secret_key:"",stripe_webhook_secret:"",stripe_mode:"live",stripe_sandbox_public_key:"",stripe_sandbox_secret_key:"",stripe_sandbox_webhook_secret:"",postmark_api_key:"",smsglobal_api_key:"",smsglobal_secret_key:"",aws_access_key_id:"",aws_secret_access_key:"",aws_s3_bucket:"",aws_region:"",xero_client_id:"",xero_client_secret:"",xero_redirect_uri:"",photography_standards:"",videography_standards:"",charla_enabled:!0,card_surcharge_enabled:!0,homepage_video_selection:"EXPO"}),[d,x]=(0,a.useState)({connected:!1,credentials_configured:!1}),[u,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(""),[v,j]=(0,a.useState)(!0),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(""),[S,_]=(0,a.useState)(!1),[C,F]=(0,a.useState)(""),[E,z]=(0,a.useState)(!1),[B,D]=(0,a.useState)(""),[R,P]=(0,a.useState)(!1),[W,O]=(0,a.useState)(""),[L,M]=(0,a.useState)(!1),[q,H]=(0,a.useState)(""),[U,G]=(0,a.useState)(""),[V,J]=(0,a.useState)(!1),[Y,K]=(0,a.useState)(!1),[Z,$]=(0,a.useState)(""),[Q,X]=(0,a.useState)(!1),[ee,te]=(0,a.useState)(""),[se,ae]=(0,a.useState)([]),[ne,re]=(0,a.useState)(!1),[ie,oe]=(0,a.useState)(!1),[le,ce]=(0,a.useState)(""),[de,me]=(0,a.useState)(!1),[pe,xe]=(0,a.useState)(""),[he,ue]=(0,a.useState)(""),[ge,fe]=(0,a.useState)(""),[be,ye]=(0,a.useState)(!1),[ve,je]=(0,a.useState)(""),[we,Ne]=(0,a.useState)([]),[Ae,ke]=(0,a.useState)(!1),[Se,_e]=(0,a.useState)(!1),[Ce,Fe]=(0,a.useState)(""),[Ee,Te]=(0,a.useState)(""),[ze,Be]=(0,a.useState)(""),[De,Ie]=(0,a.useState)(60),[Re,Pe]=(0,a.useState)(!1),[We,Oe]=(0,a.useState)(null),[Le,Me]=(0,a.useState)(null),qe=e=>{const t=e.replace(/-/g,"+").replace(/_/g,"/"),s="=".repeat((4-t.length%4)%4),a=atob(t+s),n=new Uint8Array(a.length);for(let r=0;r<a.length;
1r++)n[r]=a.charCodeAt(r);return n.buffer},He=e=>{const t=new Uint8Array(e);let s="";for(let a=0;a<t.byteLength;a++)s+=String.fromCharCode(t[a]);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")};(0,a.useEffect)(()=>{if((0,o.cd)()){const e=JSON.parse(localStorage.getItem("turbo360_admin_auth"));s({username:e.username,fullName:e.fullName||e.username,email:e.email}),Ve(),Ke(),Ze(),Ye();try{const e=new URLSearchParams(window.location.search),t=e.get("xero");if("connected"===t?(y("Xero connected."),setTimeout(()=>y(""),4e3)):"error"===t&&y("Xero connect failed: ".concat(e.get("detail")||"unknown error")),t){e.delete("xero"),e.delete("detail");const t=e.toString();window.history.replaceState({},"",window.location.pathname+(t?"?".concat(t):""))}}catch(t){}window.PublicKeyCredential&&PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable().then(e=>{me(e)}).catch(()=>me(!1))}else e("/?admin=true")},[e]);const Ve=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/settings"),{headers:{Authorization:"Bearer ".concat(t)}}),a=await s.json();a&&c({stripe_public_key:a.stripe_public_key||"",stripe_secret_key:a.stripe_secret_key||"",stripe_webhook_secret:a.stripe_webhook_secret||"",stripe_mode:a.stripe_mode||"live",stripe_sandbox_public_key:a.stripe_sandbox_public_key||"",stripe_sandbox_secret_key:a.stripe_sandbox_secret_key||"",stripe_sandbox_webhook_secret:a.stripe_sandbox_webhook_secret||"",postmark_api_key:a.postmark_api_key||"",smsglobal_api_key:a.smsglobal_api_key||"",smsglobal_secret_key:a.smsglobal_secret_key||"",aws_access_key_id:a.aws_access_key_id||"",aws_secret_access_key:a.aws_secret_access_key||"",aws_s3_bucket:a.aws_s3_bucket||"",aws_region:a.aws_region||"",xero_client_id:a.xero_client_id||"",xero_client_secret:a.xero_client_secret||"",xero_redirect_uri:a.xero_redirect_uri||"",photography_standards:a.photography_standards||"",videography_standards:a.videography_standards||"",charla_enabled:void 0===a.charla_enabled||a.charla_enabled,card_surcharge_enabled:void 0===a.card_surcharge_enabled||a.card_surcharge_enabled,homepage_video_selection:a.homepage_video_selection||"EXPO"})}catch(t){console.error("Error loading settings:",t)}finally{j(!1)}},Je=(e,t)=>{c(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t}))},Ye=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/xero/status"),{headers:{Authorization:"Bearer ".concat(t)}});s.ok&&x(await s.json())}catch(t){}},Ke=async()=>{re(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/wedding-admin/passkey/list"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();ae(e.passkeys||[])}}catch(t){console.error("Error loading passkeys:",t)}finally{re(!1)}},Ze=async()=>{ke(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/external-api-keys"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();Ne(e.api_keys||[])}}catch(t){console.error("Error loading API keys:",t)}finally{ke(!1)}};if(!t)return null;const $e={fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,color:"#0A0A0B",margin:0},Qe={fontFamily:"'Space Mono',monospace",fontSize:10.5,letterSpacing:"0.08em",textTransform:"uppercase",color:"#9A9AA0"},Xe={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},tt={fontSize:12,color:"#9A9AA0",marginTop:6},at={padding:20,marginBottom:16},nt={display:"inline-flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer"},rt={display:"inline-flex",alignItems:"center",gap:8,background:"#0A0A0B",color:"#fff",border:"none",borderRadius:9,padding:"9px 15px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12.5,fontWeight:600,cursor:"pointer"},it={display:"inline-flex",alignItems:"center",gap:8,background:"#fff",border:"1px solid #E4E4E9",borderRadius:8,padding:"8px 14px",fontSize:12,fontWeight:600,color:"#333",cursor:"pointer",whiteSpace:"nowrap"},ot={background:"#fff",border:"1px solid #FECACA",color:"#991B1B",borderRadius:7,padding:"6px 11px",fontSize:11.5,fontWeight:600,cursor:"pointer"},lt=e=>{let{message:t,style:s}=e;if(!t)return null;const a=t.includes("\u2713");return(0,f.jsxs)("div",{style:(0,m.A)({marginTop:12,padding:"10px 13px",borderRadius:9,display:"flex",alignItems:"center",gap:8,background:a?"#DCFCE7":"#FEE2E2",border:"1px solid ".concat(a?"#BBF7D0":"#FECACA")},s),children:[a&&(0,f.jsx)(p.A,{className:"h-5 w-5",style:{color:"#15803D"}}),t.includes("\u2717")&&(0,f.jsx)(h.A,{className:"h-5 w-5",style:{color:"#991B1B"}}),(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600,color:a?"#15803D":"#991B1B"},children:t})]})};return(0,f.jsxs)(ta,{title:"Settings",meta:"SYSTEM \xb7 CONFIG",children:[(0,f.jsx)("style",{children:"\n /* ReactQuill editor styles */\n .admin-settings-editor .ql-editor {\n background-color: #ffffff;\n color: #0A0A0B;\n min-height: 200px;\n font-family: 'Hanken Grotesk', sans-serif;\n }\n\n .admin-settings-editor .ql-editor.ql-blank::before {\n color: #9A9AA0;\n font-style: italic;\n }\n\n .admin-settings-editor .ql-editor p,\n .admin-settings-editor .ql-editor li,\n .admin-settings-editor .ql-editor span {\n color: #0A0A0B;\n }\n\n .admin-settings-editor .ql-toolbar {\n background-color: #FBFBFC;\n border-color: #E4E4E9;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n }\n\n .admin-settings-editor .ql-container {\n border-color: #E4E4E9;\n border-bottom-left-radius: 10px;\n border-bottom-right-radius: 10px;\n }\n\n /* Input field styles - scoped to admin settings only */\n .admin-settings-input {\n background-color: #FBFBFC;\n color: #0A0A0B;\n border: 1px solid #E4E4E9;\n border-radius: 9px;\n padding: 11px 13px;\n font-family: 'Hanken Grotesk', sans-serif;\n font-size: 13.5px;\n }\n\n .admin-settings-input::placeholder {\n color: #9A9AA0;\n }\n\n .admin-settings-input:focus {\n outline: none;\n border-color: #BF212F;\n background-color: #fff;\n }\n\n .admin-settings-input:disabled {\n background-color: #F2F2F5;\n color: #9A9AA0;\n }\n\n .tg-set-tab {\n font-family: 'Hanken Grotesk', sans-serif;\n font-weight: 600;\n font-size: 13.5px;\n color: #9A9AA0;\n padding: 16px 4px;\n border: none;\n border-bottom: 2px solid transparent;\n background: transparent;\n cursor: pointer;\n white-space: nowrap;\n transition: color .15s, border-color .15s;\n }\n .tg-set-tab:hover { color: #55555C; }\n .tg-set-tab.active { color: #BF212F; border-bottom-color: #BF212F; }\n"}),v?(0,f.jsx)("div",{style:{maxWidth:760},children:(0,f.jsx)(Ws,{rows:6})}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"tg-scroll",style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:14,padding:"0 18px",marginBottom:20,display:"flex",gap:24,overflowX:"auto",maxWidth:760},children:[["integrations","Integrations"],["content","Content"],["security","Security"],["system","System"]].map(e=>{let[t,s]=e;return(0,f.jsx)("button",{type:"button",className:"tg-set-tab ".concat(n===t?"active":""),onClick:()=>i(t),children:s},t)})}),"integrations"===n&&(0,f.jsxs)("div",{style:{maxWidth:760},children:[(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",gap:10},children:(0,f.jsx)("h3",{style:$e,children:"Stripe Payment Integration"})}),(0,f.jsx)(Ds,{tone:"sandbox"===l.stripe_mode?"amber":"green",children:"sandbox"===l.stripe_mode?"SANDBOX MODE":"LIVE MODE"})]}),(0,f.jsx)("div",{style:{display:"flex",gap:10,marginBottom:16},children:(0,f.jsxs)("div",{style:{display:"flex",border:"1px solid #E4E4E9",borderRadius:9,overflow:"hidden"},children:[(0,f.jsx)("button",{type:"button",onClick:()=>Je("stripe_mode","live"),style:{padding:"7px 16px",fontSize:12.5,fontWeight:600,border:"none",cursor:"pointer",background:"live"===l.stripe_mode?"#0A0A0B":"#fff",color:"live"===l.stripe_mode?"#fff":"#55555C"},children:"Live"}),(0,f.jsx)("button",{type:"button",onClick:()=>Je("stripe_mode","sandbox"),style:{padding:"7px 16px",fontSize:12.5,fontWeight:600,border:"none",cursor:"pointer",background:"sandbox"===l.stripe_mode?"#0A0A0B":"#fff",color:"sandbox"===l.stripe_mode?"#fff":"#55555C"},children:"Sandbox"})]})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"14px 0",marginBottom:16,borderTop:"1px solid #EFEFF2",borderBottom:"1px solid #EFEFF2"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:{fontSize:13,fontWeight:600,color:"#0A0A0B"},children:"Card surcharge on online invoice payments"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:4}),children:l.card_surcharge_enabled?"On: clients paying an invoice by card online are charged an extra 3%.":"Off
1: clients pay the invoice amount only. Invoice page, PDFs and emails drop the surcharge note."})]}),(0,f.jsx)("button",{type:"button","aria-label":"Toggle card surcharge","aria-pressed":l.card_surcharge_enabled,onClick:()=>Je("card_surcharge_enabled",!l.card_surcharge_enabled),style:{width:38,height:22,borderRadius:20,background:l.card_surcharge_enabled?"#16A34A":"#C9C9D0",position:"relative",flexShrink:0,border:"none",cursor:"pointer",transition:"background .15s"},children:(0,f.jsx)("span",{style:{position:"absolute",top:3,left:l.card_surcharge_enabled?19:3,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left .15s"}})})]}),"live"===l.stripe_mode&&(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Live Publishable Key"}),(0,f.jsx)("input",{type:"text",value:l.stripe_public_key,onChange:e=>Je("stripe_public_key",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"pk_live_..."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Live Secret Key"}),(0,f.jsx)("input",{type:"password",value:l.stripe_secret_key,onChange:e=>Je("stripe_secret_key",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"sk_live_..."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Live Webhook Secret"}),(0,f.jsx)("input",{type:"password",value:l.stripe_webhook_secret,onChange:e=>Je("stripe_webhook_secret",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"whsec_..."}),(0,f.jsx)("p",{style:tt,children:"Webhook signing secret from Stripe Dashboard (for production webhook verification)"})]})]}),(0,f.jsxs)("div",{style:{background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:10,padding:14,marginTop:14},children:[(0,f.jsx)("h4",{style:(0,m.A)((0,m.A)({},$e),{},{fontSize:13,marginBottom:8}),children:"Webhook Setup Instructions"}),(0,f.jsxs)("div",{style:{fontSize:12,color:"#55555C",lineHeight:1.6},children:[(0,f.jsx)("p",{style:{fontWeight:600,margin:"0 0 6px"},children:"One webhook endpoint handles ALL payment types (invoices & live streams):"}),(0,f.jsxs)("ol",{style:{margin:0,paddingLeft:18},children:[(0,f.jsxs)("li",{children:[(0,f.jsx)("strong",{children:"Stripe Dashboard"})," \u2192 Developers \u2192 Webhooks \u2192 Add Endpoint"]}),(0,f.jsxs)("li",{children:[(0,f.jsx)("strong",{children:"Endpoint URL:"})," ",(0,f.jsx)("code",{style:{fontFamily:"'Space Mono',monospace",background:"#EDEDF0",padding:"1px 5px",borderRadius:4},children:"https://turbo.net.au/api/webhook/stripe"})]}),(0,f.jsxs)("li",{children:[(0,f.jsx)("strong",{children:"Select Events:"}),(0,f.jsxs)("ul",{style:{marginTop:4,paddingLeft:18},children:[(0,f.jsxs)("li",{children:[(0,f.jsx)("code",{style:{fontFamily:"'Space Mono',monospace",background:"#EDEDF0",padding:"1px 5px",borderRadius:4,fontSize:10.5},children:"checkout.session.completed"})," (for invoices)"]}),(0,f.jsxs)("li",{children:[(0,f.jsx)("code",{style:{fontFamily:"'Space Mono',monospace",background:"#EDEDF0",padding:"1px 5px",borderRadius:4,fontSize:10.5},children:"payment_intent.succeeded"})," (for live streams)"]})]})]}),(0,f.jsxs)("li",{children:[(0,f.jsx)("strong",{children:"Copy Signing Secret"})," (starts with ",(0,f.jsx)("code",{style:{fontFamily:"'Space Mono',monospace",background:"#EDEDF0",padding:"1px 5px",borderRadius:4},children:"whsec_..."}),")"]}),(0,f.jsxs)("li",{children:[(0,f.jsx)("strong",{children:"Paste above"})," in the appropriate Webhook Secret field"]})]}),(0,f.jsx)("p",{style:{fontSize:10.5,fontStyle:"italic",marginTop:8,paddingTop:8,borderTop:"1px solid #E4E4E9",color:"#9A9AA0"},children:"Tip: Create separate webhook endpoints for Live and Test modes. Use Live keys for production, Test keys for development."})]})]}),"sandbox"===l.stripe_mode&&(0,f.jsxs)("div",{style:{display:"grid",gap:12,marginTop:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Test Publishable Key"}),(0,f.jsx)("input",{type:"text",value:l.stripe_sandbox_public_key,onChange:e=>Je("stripe_sandbox_public_key",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"pk_test_..."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Test Secret Key"}),(0,f.jsx)("input",{type:"password",value:l.stripe_sandbox_secret_key,onChange:e=>Je("stripe_sandbox_secret_key",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"sk_test_..."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Test Webhook Secret"}),(0,f.jsx)("input",{type:"password",value:l.stripe_sandbox_webhook_secret,onChange:e=>Je("stripe_sandbox_webhook_secret",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"whsec_..."}),(0,f.jsx)("p",{style:tt,children:"Test webhook signing secret from Stripe Dashboard"})]}),(0,f.jsx)("div",{style:{background:"#DBEAFE",border:"1px solid #BFDBFE",borderRadius:9,padding:11},children:(0,f.jsxs)("p",{style:{fontSize:12,color:"#1D4ED8",margin:0},children:[(0,f.jsx)("strong",{children:"Test Cards:"})," Use 4242 4242 4242 4242 (any future date, any CVC) for successful test payments"]})})]})]}),(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:14,gap:12,flexWrap:"wrap"},children:[(0,f.jsx)("h3",{style:$e,children:"Postmark Email Integration"}),(0,f.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[(0,f.jsxs)("button",{onClick:async()=>{_(!0),F("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/settings/test-email"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}}),a=await s.json();s.ok&&a.success?(F("\u2713 Test email sent successfully to [email protected]"),setTimeout(()=>F(""),5e3)):(F("\u2717 ".concat(a.message||"Failed to send test email")),setTimeout(()=>F(""),5e3))}catch(t){console.error("Test email error:",t),F("\u2717 Failed to send test email"),setTimeout(()=>F(""),5e3)}finally{_(!1)}},disabled:S||!l.postmark_api_key,style:(0,m.A)((0,m.A)({},it),{},{opacity:S||!l.postmark_api_key?.5:1}),title:l.postmark_api_key?"Send test email":"Please enter Postmark API key first",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:S?"Sending...":"Test Basic"})]}),(0,f.jsxs)("button",{onClick:async()=>{z(!0),D("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/settings/test-crew-email"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}}),a=await s.json();s.ok&&a.success?(D("\u2713 Test crew email sent successfully to [email protected]"),setTimeout(()=>D(""),5e3)):(D("\u2717 ".concat(a.message||"Failed to send test email")),setTimeout(()=>D(""),5e3))}catch(t){console.error("Test crew email error:",t),D("\u2717 Failed to send test email"),setTimeout(()=>D(""),5e3)}finally{z(!1)}},disabled:E||!l.postmark_api_key,style:(0,m.A)((0,m.A)({},it),{},{opacity:E||!l.postmark_api_key?.5:1}),title:"Send test crew email",children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:E?"Sending...":"Test Crew"})]}),(0,f.jsxs)("button",{onClick:async()=>{P(!0),O("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/settings/test-client-email"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}}),a=await s.json();s.ok&&a.success?(O("\u2713 Test client email sent successfully to [email protected]"),setTimeout(()=>O(""),5e3)):(O("\u2717 ".concat(a.message||"Failed to send test email")),setTimeout(()=>O(""),5e3))}catch(t){console.error("Test client email error:",t),O("\u2717 Failed to send test email"),setTimeout(()=>O(""),5e3)}finally{P(!1)}},disabled:R||!l.postmark_api_key,style:(0,m.A)((0,m.A)({},it),{},{opacity:R||!l.postmark_api_key?.5:1}),title:"Send test client email",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:R?"Sending...":"Test Client"})]}),(0,f.jsxs)("button",{onClick:async()=>{M(!0),H("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/settings/test-wedding-client-email"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}}),a=await s.json();s.ok&&a.success?(H("\u2713 Test wedding client email sent successfully to [email protected]"),setTimeout(()=>H(""),5e3)):(H("\u2717 ".concat(a.message||"Failed to send test email")),setTimeout(()=>H(""),5e3))}catch(t){console.error("Test wedding client email error:",t),H("\u2717 Failed to send test email"),setTimeout(()=>H(""),5e3)}finally{M(!1)}},disabled:L||!l.postmark_api_key,style:(0,m.A)((0,m.A)({},it),{},{opacity:L||!l.postmark_api_key?.5:1}),title:"Send test wedding client email",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:L?"Sending...":"Test Wedding"})]}),(0,f.jsxs)("button",{onClick:async()=>{J(!0),G("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/proposals/test-emails"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}});if(!s.ok){const e=await s.text();return console.error("Test emails error response:",e),G("\u2717 Failed to send test emails (".concat(s.status,")")),void setTimeout(()=>G(""),5e3)}const a=await s.json();a.success?(G("\u2713 All proposal test emails sent successfully to [email protected]"),setTimeout(()=>G(""),5e3)):(G("\u2717 ".concat(a.message||"Failed to send test emails")),setTimeout(()=>G(""),5e3))}catch(t){console.error("Test proposal emails error:",t),G("\u2717 Failed to send test emails"),setTimeout(()=>G(""),5e3)}finally{J(!1)}},disabled:V||!l.postmark_api_key,style:(0,m.A)((0,m.A)({},it),{},{opacity:V||!l.postmark_api_key?.5:1}),title:"Send all proposal test emails",children:[(0,f.jsx)(kt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:V?"Sending...":"Test Proposals"})]})]})]}),(0,f.jsx)(lt,{message:U}),(0,f.jsxs)("div",{style:{marginTop:12},children:[(0,f.jsx)("label",{style:Xe,children:"Postmark Server API Token"}),(0,f.jsx)("input",{type:"password",value:l.postmark_api_key,onChange:e=>Je("postmark_api_key",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"Enter Postmark API token"})]}),(0,f.jsx)(lt,{message:C}),(0,f.jsx)(lt,{message:B}),(0,f.jsx)(lt,{message:W}),(0,f.jsx)(lt,{message:q}),(0,f.jsxs)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:12}),children:["All test emails will be sent to: ",(0,f.jsx)("span",{style:{fontWeight:600,color:"#55555C"},children:"[email protected]"})," with dummy event data"]})]}),(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsx)("h3",{style:(0,m.A)((0,m.A)({},$e),{},{marginBottom:14}),children:"SMSGlobal SMS Integration"}),(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"SMSGlobal API Key"}),(0,f.jsx)("input",{type:"text",value:l.smsglobal_api_key,onChange:e=>Je("smsglobal_api_key",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"Enter API Key"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"SMSGlobal Secret Key"}),(0,f.jsx)("input",{type:"password",value:l.smsglobal_secret_key,onChange:e=>Je("smsglobal_secret_key",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"Enter Secret Key"})]})]})]}),(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsx)("h3",{style:(0,m.A)((0,m.A)({},$e),{},{marginBottom:14}),children:"AWS S3 File Storage"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"AWS Access Key ID"}),(0,f.jsx)("input",{type:"text",value:l.aws_access_key_id,onChange:e=>Je("aws_access_key_id",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"AKIAIOSFODNN7EXAMPLE"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"AWS Secret Acce
1ss Key"}),(0,f.jsx)("input",{type:"password",value:l.aws_secret_access_key,onChange:e=>Je("aws_secret_access_key",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"S3 Bucket Name"}),(0,f.jsx)("input",{type:"text",value:l.aws_s3_bucket,onChange:e=>Je("aws_s3_bucket",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"my-bucket-name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"AWS Region"}),(0,f.jsx)("input",{type:"text",value:l.aws_region,onChange:e=>Je("aws_region",e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"ap-southeast-2"})]})]})]}),(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14,gap:12},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,f.jsx)("div",{style:{height:26,width:26,borderRadius:6,background:"#1D4ED8",color:"#fff",fontSize:12,fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center"},children:"X"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{style:$e,children:"Xero"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:2}),children:"Connect your Xero org to power the admin reports page with live financials."})]})]}),d.connected?(0,f.jsxs)(Ds,{tone:"green",children:["Connected: ",d.tenant_name||"Xero"]}):(0,f.jsx)(Ds,{tone:"amber",children:"Not connected"})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Client ID"}),(0,f.jsx)("input",{type:"text",value:l.xero_client_id,onChange:e=>Je("xero_client_id",e.target.value),className:"admin-settings-input",style:{width:"100%",fontFamily:"'Space Mono',monospace",fontSize:12},placeholder:"Xero developer app client_id"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Client Secret"}),(0,f.jsx)("input",{type:"password",value:l.xero_client_secret,onChange:e=>Je("xero_client_secret",e.target.value),className:"admin-settings-input",style:{width:"100%",fontFamily:"'Space Mono',monospace",fontSize:12},placeholder:"Xero developer app client_secret"})]}),(0,f.jsxs)("div",{style:{gridColumn:"1 / -1"},children:[(0,f.jsx)("label",{style:Xe,children:"Redirect URI"}),(0,f.jsx)("input",{type:"text",value:l.xero_redirect_uri,onChange:e=>Je("xero_redirect_uri",e.target.value),className:"admin-settings-input",style:{width:"100%",fontFamily:"'Space Mono',monospace",fontSize:11.5},placeholder:"https://turbo.net.au/api/admin/xero/callback"}),(0,f.jsx)("p",{style:tt,children:"Must match a redirect URI registered on your Xero app."})]})]}),(0,f.jsxs)("div",{style:{marginTop:16,display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[d.connected?(0,f.jsx)("button",{type:"button",onClick:async()=>{if(window.confirm("Disconnect Xero? Reports will stop working until you reconnect.")){g(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token;if(!(await fetch("".concat(I.fn,"/api/admin/xero/disconnect"),{method:"POST",headers:{Authorization:"Bearer ".concat(t)}})).ok)throw new Error("Failed to disconnect");x({connected:!1,credentials_configured:d.credentials_configured}),y("Xero disconnected."),setTimeout(()=>y(""),3e3)}catch(t){y(t.message||"Failed to disconnect")}finally{g(!1)}}},disabled:u,style:{display:"inline-flex",alignItems:"center",gap:8,background:"#fff",border:"1px solid #FECACA",color:"#991B1B",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",opacity:u?.4:1},children:"Disconnect"}):(0,f.jsx)("button",{type:"button",onClick:async()=>{g(!0),y("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/xero/authorize"),{headers:{Authorization:"Bearer ".concat(t)}});if(!s.ok){const e=await s.json().catch(()=>({}));throw new Error(e.detail||"Failed to start Xero authorize")}const{url:a}=await s.json();window.location.href=a}catch(t){y(t.message||"Failed to start Xero connect"),g(!1)}},disabled:u||!l.xero_client_id||!l.xero_client_secret,style:(0,m.A)((0,m.A)({},nt),{},{opacity:!u&&l.xero_client_id&&l.xero_client_secret?1:.4}),children:u?"Opening Xero\u2026":"Connect to Xero"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:0,flex:1,minWidth:220}),children:"Save your client_id / client_secret first, then click Connect \u2014 Xero will ask you to choose an org and authorise read-only access (invoices, contacts, reports)."})]}),b&&(0,f.jsx)("div",{style:{marginTop:12,fontSize:13,fontWeight:600,color:b.startsWith("Xero connected")||b.startsWith("Xero disconnected")?"#15803D":"#991B1B"},children:b})]}),(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14,gap:12},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,f.jsx)(et.A,{className:"h-6 w-6",style:{color:"#16A34A"}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{style:$e,children:"Exter
1nal API Keys"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:2}),children:"Manage API keys for third-party integrations"})]})]}),(0,f.jsxs)("button",{onClick:()=>Pe(!Re),style:rt,children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Create API Key"})]})]}),Re&&(0,f.jsxs)("div",{style:{marginBottom:18,padding:16,background:"#FBFBFC",border:"1px solid #E4E4E9",borderRadius:10},children:[(0,f.jsx)("h4",{style:(0,m.A)((0,m.A)({},$e),{},{fontSize:13,marginBottom:12}),children:"Create New API Key"}),(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{style:Xe,children:["Name ",(0,f.jsx)("span",{style:{color:"#BF212F"},children:"*"})]}),(0,f.jsx)("input",{type:"text",value:Ee,onChange:e=>Te(e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"e.g., Production Integration, Calendar Sync"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Description"}),(0,f.jsx)("input",{type:"text",value:ze,onChange:e=>Be(e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"Optional description of what this key is used for"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Rate Limit (requests per minute)"}),(0,f.jsx)("input",{type:"number",value:De,onChange:e=>Ie(parseInt(e.target.value)||60),min:"1",max:"1000",className:"admin-settings-input",style:{width:130}})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:12},children:[(0,f.jsx)("button",{onClick:async()=>{if(Ee.trim()){_e(!0),Fe("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/external-api-keys"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({name:Ee.trim(),description:ze.trim(),rate_limit:De})}),a=await s.json();s.ok&&a.success?(Oe(a.api_key),Fe("\u2713 API key created successfully. Copy it now - it cannot be retrieved later!"),Te(""),Be(""),Ie(60),Pe(!1),Ze()):Fe("\u2717 ".concat(a.detail||"Failed to create API key"))}catch(t){console.error("Create API key error:",t),Fe("\u2717 Failed to create API key")}finally{_e(!1)}}else Fe("\u2717 Please enter a name for the API key")},disabled:Se,style:(0,m.A)((0,m.A)({},nt),{},{opacity:Se?.5:1}),children:Se?"Creating...":"Create Key"}),(0,f.jsx)("button",{onClick:()=>{Pe(!1),Te(""),Be(""),Ie(60)},style:(0,m.A)((0,m.A)({},it),{},{padding:"10px 16px"}),children:"Cancel"})]})]})]}),We&&(0,f.jsx)("div",{style:{marginBottom:18,padding:16,background:"#DCFCE7",border:"1px solid #BBF7D0",borderRadius:10},children:(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:12},children:[(0,f.jsx)(p.A,{className:"h-5 w-5",style:{color:"#15803D",flexShrink:0,marginTop:2}}),(0,f.jsxs)("div",{style:{flex:1},children:[(0,f.jsx)("p",{style:{fontSize:13,fontWeight:700,color:"#15803D",margin:"0 0 8px"},children:"API Key Created Successfully!"}),(0,f.jsx)("p",{style:{fontSize:12,color:"#15803D",margin:"0 0 12px"},children:"Copy this key now. For security reasons, it cannot be displayed again."}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,background:"#fff",border:"1px solid #BBF7D0",borderRadius:9,padding:12},children:[(0,f.jsx)("code",{style:{flex:1,fontSize:13,fontFamily:"'Space Mono',monospace",color:"#0A0A0B",wordBreak:"break-all"},children:We}),(0,f.jsx)("button",{onClick:()=>(async(e,t)=>{try{await navigator.clipboard.writeText(e),Me(t),setTimeout(()=>Me(null),2e3)}catch(s){console.error("Failed to copy:",s)}})(We,"new"),style:{flexShrink:0,padding:8,background:"transparent",border:"none",color:"#15803D",cursor:"pointer",borderRadius:8},title:"Copy to clipboard",children:"new"===Le?(0,f.jsx)(p.A,{className:"h-5 w-5"}):(0,f.jsx)(Cr.A,{className:"h-5 w-5"})})]}),(0,f.jsx)("button",{onClick:()=>Oe(null),style:{marginTop:12,fontSize:13,color:"#15803D",background:"none",border:"none",textDecoration:"underline",cursor:"pointer"},children:"Dismiss"})]})]})}),Ce&&!We&&(0,f.jsx)(lt,{message:Ce,style:{marginTop:0,marginBottom:14}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{style:(0,m.A)((0,m.A)({},Qe),{},{marginBottom:12}),children:"Active API Keys"}),Ae?(0,f.jsx)("div",{style:{textAlign:"center",padding:16},children:(0,f.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2",style:{borderColor:"#16A34A",margin:"0 auto"}})}):0===we.length?(0,f.jsxs)("div",{style:{background:"#FBFBFC",border:"1px solid #E4E4E9",borderRadius:10,padding:24,textAlign:"center"},children:[(0,f.jsx)(et.A,{className:"h-10 w-10",style:{color:"#B5B5BC",margin:"0 auto 10px"}}),(0,f.jsx)("p",{style:{fontSize:13,color:"#55555C",fontWeight:600,margin:0},children:"No API keys created yet"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:4}),children:"Create an API key to allow third-party applications to access your event data"})]}):(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:we.map(e=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:"13px 0",borderTop:"1px solid #F2F2F5",gap:12},children:[(0,f.jsxs)("div",{style:{flex:1},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,f.jsx)(Tl.A,{className:"h-4 w-4",style:{color:"#16A34A"}}),(0,f.jsx)("span",{style:{fontWeight:600,fontSize:13,color:"#0A0A0B"},children:e.name}),(0,f.jsx)(Ds,{tone:e.is_active?"green":"danger",children:e.is_active?"Active":"Revoked"})]}),e.description&&(0,f.jsx)("p",{style:{fontSize:13,color:"#55555C",marginTop:4},children:e.description}),(0,f.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px 16px",marginTop:6,fontFamily:"'Space Mono',monospace",fontSize:10.5,color:"#9A9AA0"},children:[(0,f.jsxs)("span",{children:["Key: ",e.key_prefix,"..."]}),(0,f.jsxs)("span",{children:["Rate limit: ",e.rate_limit,"/min"]}),(0,f.jsxs)("span",{children:["Requests: ",e.request_count||0]}),e.created_at&&(0,f.jsxs)("span",{children:["Created: ",new Date(e.created_at).toLocaleDateString()]}),e.last_used_at&&(0,f.jsxs)("span",{children:["Last used: ",new Date(e.last_used_at).toLocaleDateString()]})]})]}),e.is_active&&(0,f.jsx)("button",{onClick:()=>(async(e,t)=>{if(window.confirm('Are you sure you want to revoke the API key "'.concat(t,'"? This action cannot be undone and any integrations using this key will stop working.')))try{var s;const t=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,a=await fetch("".concat(I.fn,"/api/admin/external-api-keys/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}});if(a.ok)Fe("\u2713 API key revoked successfully"),Ze(),setTimeout(()=>Fe(""),3e3);else{const e=await a.json();Fe("\u2717 ".concat(e.detail||"Failed to revoke API key"))}}catch(a){console.error("Revoke API key error:",a),Fe("\u2717 Failed to revoke API key")}})(e.id,e.name),style:ot,title:"Revoke API key",children:"Revoke"})]},e.id))})]}),(0,f.jsxs)("div",{style:{marginTop:18,background:"#DBEAFE",border:"1px solid #BFDBFE",borderRadius:10,padding:14},children:[(0,f.jsx)("h4",{style:(0,m.A)((0,m.A)({},$e),{},{fontSize:13,color:"#1D4ED8",marginBottom:8}),children:"API Documentation"}),(0,f.jsx)("p",{style:{fontSize:12,color:"#1D4ED8",margin:"0 0 8px"},children:"Third-party applications can use these API keys to access upcoming event data via:"}),(0,f.jsx)("code",{style:{display:"block",fontSize:12,background:"#BFDBFE",padding:8,borderRadius:6,color:"#1E3A8A",fontFamily:"'Space Mono',monospace"},children:"GET https://turbo.net.au/api/external/upcoming-bookings"}),(0,f.jsxs)("p",{style:{fontSize:12,color:"#1D4ED8",marginTop:8},children:["Include the API key in the ",(0,f.jsx)("code",{style:{fontFamily:"'Space Mono',monospace",background:"#BFDBFE",padding:"1px 5px",borderRadius:4},children:"X-API-Key"})," header."]})]})]})]}),"content"===n&&(0,f.jsxs)("div",{style:{maxWidth:760},children:[(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsx)("h3",{style:(0,m.A)((0,m.A)({},$e),{},{marginBottom:14}),children:"Charla AI Assistant"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:{fontSize:13,fontWeight:600,color:"#0A0A0B"},children:"Enable Charla AI Assistant"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:4}),children:"Toggle the Charla AI assistant feature on or off for the platform"})]}),(0,f.jsx)("button",{type:"button",onClick:()=>Je("charla_enabled",!l.charla_enabled),style:{width:38,height:22,borderRadius:20,background:l.charla_enabled?"#16A34A":"#C9C9D0",position:"relative",flexShrink:0,border:"none",cursor:"pointer",transition:"background .15s"},children:(0,f.jsx)("span",{style:{position:"absolute",top:3,left:l.charla_enabled?19:3,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left .15s"}})})]}),(0,f.jsx)("div",{style:{marginTop:12},children:(0,f.jsxs)("span",{style:{fontSize:13,fontWeight:600,color:l.charla_enabled?"#16A34A":"#9A9AA0"},children:["Status: ",l.charla_enabled?"Enabled":"Disabled"]})})]}),(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsx)("h3",{style:(0,m.A)((0,m.A)({},$e),{},{marginBottom:6}
1),children:"Homepage Background Video"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:0,marginBottom:14}),children:"Select which background video to display on the homepage"}),(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[["EXPO","EXPO Video","Professional expo and conference coverage"],["FOOD","FOOD Video","Food and hospitality event coverage"],["FOOD_EXTENDED","Food Video Extended","Extended food and hospitality showcase"],["WEBBG","Web BG Video","High-quality cinematic web background loop"]].map(e=>{let[t,s,a]=e;const n=l.homepage_video_selection===t;return(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:12,padding:14,border:"1px solid ".concat(n?"#BF212F":"#E4E4E9"),borderRadius:10,cursor:"pointer",background:n?"#FFF5F5":"#fff",transition:"all .12s"},children:[(0,f.jsx)("input",{type:"radio",name:"homepage_video",value:t,checked:n,onChange:e=>c((0,m.A)((0,m.A)({},l),{},{homepage_video_selection:e.target.value})),style:{position:"absolute",opacity:0,width:0,height:0}}),(0,f.jsx)("span",{style:{width:18,height:18,borderRadius:"50%",border:"2px solid ".concat(n?"#BF212F":"#C9C9D0"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:n&&(0,f.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:"#BF212F"}})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{style:{display:"block",fontSize:13.5,fontWeight:600,color:"#0A0A0B"},children:s}),(0,f.jsx)("span",{style:{display:"block",fontSize:12,color:"#9A9AA0"},children:a})]})]},t)})})]}),(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:12},children:[(0,f.jsx)(Ue.A,{className:"h-6 w-6",style:{color:"#7C3AED"}}),(0,f.jsx)("h3",{style:$e,children:"Photography Standards"})]}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:0,marginBottom:14}),children:"Define photography guidelines, style requirements, and camera settings for your crew. These will appear on runsheets when a photographer is assigned."}),(0,f.jsx)(zl.A,{theme:"snow",className:"admin-settings-editor",value:l.photography_standards,onChange:e=>Je("photography_standards",e),placeholder:"Enter photography standards, camera settings, style guidelines...",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]}],["link"],["clean"]]},style:{height:"200px",marginBottom:"50px"}})]}),(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:12},children:[(0,f.jsx)(Ge.A,{className:"h-6 w-6",style:{color:"#1D4ED8"}}),(0,f.jsx)("h3",{style:$e,children:"Videography Standards"})]}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:0,marginBottom:14}),children:"Define videography guidelines, equipment requirements, and shooting standards. These will appear on runsheets when a videographer is assigned."}),(0,f.jsx)(zl.A,{theme:"snow",className:"admin-settings-editor",value:l.videography_standards,onChange:e=>Je("videography_standards",e),placeholder:"Enter videography standards, camera settings, equipment requirements...",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],[{color:[]},{background:[]}],["link"],["clean"]]},style:{height:"200px",marginBottom:"50px"}})]})]}),"security"===n&&(0,f.jsxs)("div",{style:{maxWidth:560},children:[(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:16},children:[(0,f.jsx)(ht.A,{className:"h-6 w-6",style:{color:"#1D4ED8"}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{style:$e,children:"Change Password"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:2}),children:"Update your admin login password"})]})]}),(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Current Password"}),(0,f.jsx)("input",{type:"password",value:pe,onChange:e=>xe(e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"Enter current password"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"New Password"}
1),(0,f.jsx)("input",{type:"password",value:he,onChange:e=>ue(e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"Enter new password (min 8 characters)"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xe,children:"Confirm New Password"}),(0,f.jsx)("input",{type:"password",value:ge,onChange:e=>fe(e.target.value),className:"admin-settings-input",style:{width:"100%"},placeholder:"Confirm new password"})]}),(0,f.jsx)("div",{children:(0,f.jsxs)("button",{onClick:async()=>{if(je(""),pe&&he&&ge)if(he===ge)if(he.length<8)je("\u2717 New password must be at least 8 characters");else{ye(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/wedding-admin/change-password"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({current_password:pe,new_password:he})}),a=await s.json();s.ok&&a.success?(je("\u2713 Password changed successfully"),xe(""),ue(""),fe(""),setTimeout(()=>je(""),5e3)):je("\u2717 ".concat(a.message||"Failed to change password"))}catch(t){console.error("Change password error:",t),je("\u2717 Failed to change password")}finally{ye(!1)}}else je("\u2717 New passwords do not match");else je("\u2717 Please fill in all password fields")},disabled:be,style:(0,m.A)((0,m.A)({},nt),{},{opacity:be?.5:1}),children:[(0,f.jsx)(ht.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:be?"Changing...":"Change Password"})]})}),ve&&(0,f.jsx)(lt,{message:ve,style:{marginTop:0}})]})]}),(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:14},children:[(0,f.jsx)(gt.A,{className:"h-6 w-6",style:{color:"#7C3AED"}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{style:$e,children:"Passkey Authentication"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:2}),children:"Use passkeys for passwordless login with 1Password, Face ID, or Touch ID"})]})]}),de?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{marginBottom:14},children:[(0,f.jsx)("h4",{style:(0,m.A)((0,m.A)({},Qe),{},{marginBottom:10}),children:"Registered Passkeys"}),ne?(0,f.jsx)("div",{style:{textAlign:"center",padding:16},children:(0,f.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2",style:{borderColor:"#7C3AED",margin:"0 auto"}})}):0===se.length?(0,f.jsxs)("div",{style:{background:"#FBFBFC",border:"1px solid #E4E4E9",borderRadius:10,padding:16,textAlign:"center"},children:[(0,f.jsx)(Tl.A,{className:"h-8 w-8",style:{color:"#B5B5BC",margin:"0 auto 8px"}}),(0,f.jsx)("p",{style:{fontSize:13,color:"#55555C",margin:0},children:"No passkeys registered yet"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:4}),children:"Register a passkey to enable passwordless login"})]}):(0,f.jsx)("div",{children:se.map(e=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"11px 0",borderTop:"1px solid #F2F2F5",gap:12},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)(Tl.A,{className:"h-5 w-5",style:{color:"#7C3AED"}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{style:{fontSize:13,fontWeight:600,color:"#0A0A0B",margin:0},children:e.device_name||"Passkey"}),(0,f.jsxs)("p",{style:{fontFamily:"'Space Mono',monospace",fontSize:10.5,color:"#9A9AA0",margin:0},children:["Added ",e.created_at?new Date(e.created_at).toLocaleDateString():"unknown",e.last_used&&" \u2022 Last used ".concat(new Date(e.last_used).toLocaleDateString())]})]})]}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete this passkey? You will need to use password login if this is your only passkey."))try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/wedding-admin/passkey/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}});if(a.ok)ce("\u2713 Passkey deleted"),Ke(),setTimeout(()=>ce(""),3e3);else{const e=await a.json();ce("\u2717 ".concat(e.detail||"Failed to delete passkey"))}}catch(s){console.error("Delete passkey error:",s),ce("\u2717 Failed to delete passkey")}})(e.id),style:(0,m.A)((0,m.A)({},it),{},{color:"#991B1B"}),title:"Delete passkey",children:"Remove"})]},e.id))})]}),(0,f.jsxs)("button",{onClick:async()=>{oe(!0),ce("");try{const e=JSON.parse(localStorage.getItem("turbo360_admin_auth")),t=null===e||void 0===e?void 0:e.email;if(!t)return void ce("\u2717 Could not determine admin email. Please log out and log in again.");const s=await fetch("".concat(I.fn,"/api/wedding-admin/passkey/register-options"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(!s.ok){const e=await s.json();throw new Error(e.detail||"Failed to get registration options")}const a=await s.json();a.challenge=qe(a.challenge),a.user.id=qe(a.user.id),a.excludeCredentials&&(a.excludeCredentials=a.excludeCredentials.map(e=>(0,m.A)((0,m.A)({},e),{},{id:qe(e.id)})));const n=await navigator.credentials.create({publicKey:a}),r={id:n.id,rawId:He(n.rawId),type:n.type,response:{attestationObject:He(n.response.attestationObject),clientDataJSON:He(n.response.clientDataJSON)},device_name:navigator.platform||"Passkey"},i=await fetch("".concat(I.fn,"/api/wedding-admin/passkey/register-verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,credential:r})}),o=await i.json();i.ok&&o.success?(ce("\u2713 Passkey registered successfully"),Ke(),setTimeout(()=>ce(""),5e3)):ce("\u2717 ".concat(o.detail||"Failed to register passkey"))}catch(e){console.error("Passkey registration error:",e),"NotAllowedError"===e.name?ce("\u2717 Passkey registration was cancelled"):ce("\u2717 ".concat(e.message||"Failed to register passkey"))}finally{oe(!1)}},disabled:ie,style:(0,m.A)((0,m.A)({},rt),{},{opacity:ie?.5:1}),children:[(0,f.jsx)(gt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:ie?"Registering...":"Register New Passkey"})]}),le&&(0,f.jsx)(lt,{message:le}),(0,f.jsx)("div",{style:{marginTop:14,background:"#DBEAFE",border:"1px solid #BFDBFE",borderRadius:10,padding:12},children:(0,f.jsxs)("p",{style:{fontSize:12,color:"#1D4ED8",margin:0},children:[(0,f.jsx)("strong",{children:"Tip:"})," Passkeys work with 1Password, iCloud Keychain, Windows Hello, and other password managers. Once registered, you can sign in without entering your password."]})})]}):(0,f.jsx)("div",{style:{background:"#FEF3C7",border:"1px solid #FDE68A",borderRadius:10,padding:14},children:(0,f.jsx)("p",{style:{fontSize:13,color:"#92400E",margin:0},children:"Passkeys are not supported on this device or browser. Try using Chrome, Safari, or Edge on a device with biometric authentication."})})]})]}),"system"===n&&(0,f.jsx)("div",{style:{maxWidth:640},children:(0,f.jsxs)(Ls,{style:at,children:[(0,f.jsx)("h3",{style:(0,m.A)((0,m.A)({},$e),{},{marginBottom:6}),children:"Database Maintenance"}),(0,f.jsx)("p",{style:(0,m.A)((0,m.A)({},tt),{},{marginTop:0,marginBottom:14}),children:"One-off migrations. Run with care."}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"13px 0",borderTop:"1px solid #F2F2F5",gap:16},children:[(0,f.jsxs)("div",{style:{paddingRight:16},children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"#0A0A0B"},children:"Migrate To-Do Timezone"}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",marginTop:2},children:"Migrate existing To-Do list timestamps from UTC to Melbourne timezone. This should only be run once after upgrading to the timezone-aware system."})]}),(0,f.jsx)("button",{onClick:async()=>
1{if(window.confirm("This will migrate all To-Do list timestamps to Melbourne timezone. This should only be run once. Continue?")){K(!0),$("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/todos/migrate-timezone"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}}),a=await s.json();s.ok&&a.success?($("\u2713 ".concat(a.message)),setTimeout(()=>$(""),5e3)):($("\u2717 ".concat(a.detail||"Failed to migrate timezone")),setTimeout(()=>$(""),5e3))}catch(t){console.error("Timezone migration error:",t),$("\u2717 Failed to migrate timezone"),setTimeout(()=>$(""),5e3)}finally{K(!1)}}},disabled:Y,style:(0,m.A)((0,m.A)({},it),{},{opacity:Y?.5:1}),title:"Migrate To-Do timestamps to Melbourne timezone",children:Y?"Migrating...":"Run"})]}),Z&&(0,f.jsx)(lt,{message:Z}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"13px 0",borderTop:"1px solid #F2F2F5",gap:16},children:[(0,f.jsxs)("div",{style:{paddingRight:16},children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"#0A0A0B"},children:"Fix Company Logo URLs"}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",marginTop:2},children:"Fix company logo URLs by converting expiring presigned S3 URLs to permanent public URLs. This ensures logos don't break after 7 days. Safe to run multiple times."})]}),(0,f.jsx)("button",{onClick:async()=>{if(window.confirm("This will fix company logo URLs by converting expiring presigned URLs to permanent public URLs. Continue?")){X(!0),te("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/fix-company-logo-urls"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}}),a=await s.json();s.ok&&a.success?(te("\u2713 ".concat(a.message," (Fixed: ").concat(a.fixed_count,", Skipped: ").concat(a.skipped_count,")")),setTimeout(()=>te(""),8e3)):(te("\u2717 ".concat(a.detail||"Failed to fix logo URLs")),setTimeout(()=>te(""),8e3))}catch(t){console.error("Logo fix error:",t),te("\u2717 Failed to fix logo URLs"),setTimeout(()=>te(""),8e3)}finally{X(!1)}}},disabled:Q,style:(0,m.A)((0,m.A)({},it),{},{opacity:Q?.5:1}),title:"Fix company logo URLs",children:Q?"Fixing URLs...":"Run"})]}),ee&&(0,f.jsx)(lt,{message:ee})]})}),(0,f.jsxs)("div",{style:{maxWidth:760,marginTop:4,background:"#FEF3C7",border:"1px solid #FDE68A",borderRadius:12,padding:14,display:"flex",alignItems:"flex-start",gap:12},children:[(0,f.jsx)(h.A,{className:"h-5 w-5",style:{color:"#92400E",flexShrink:0,marginTop:1}}),(0,f.jsxs)("div",{style:{fontSize:13,color:"#92400E"},children:[(0,f.jsx)("p",{style:{fontWeight:700,margin:"0 0 4px"},children:"Security Notice"}),(0,f.jsx)("p",{style:{margin:0},children:"These settings contain sensitive API keys. Ensure only authorized personnel have access to this page. Changes take effect immediately."})]})]}),(0,f.jsxs)("div",{style:{maxWidth:760,marginTop:18,paddingTop:18,borderTop:"1px solid #E4E4E9",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[(0,f.jsx)("div",{children:A&&(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600,color:A.includes("\u2713")?"#15803D":"#991B1B"},children:A})}),(0,f.jsxs)("div",{style:{display:"flex",gap:12},children:[(0,f.jsx)("button",{onClick:()=>e("/admin"),style:(0,m.A)((0,m.A)({},it),{},{padding:"11px 22px"}),children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{N(!0),k("");try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/settings"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(l)});await s.json();s.ok?(k("\u2713 Settings saved successfully"),setTimeout(()=>k(""),3e3)):k("\u2717 Failed to save settings")}catch(t){console.error("Save error:",t),k("\u2717 Failed to save settings")}finally{N(!1)}},disabled:w,style:(0,m.A)((0,m.A)({},nt),{},{padding:"11px 22px",opacity:w?.5:1}),children:[(0,f.jsx)(ia.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:w?"Saving...":"Save Settings"})]})]})]})]})]})};var Dl=s(42043),Il=s(465);const Rl="'Space Mono',monospace",Pl=e=>{let{title:t,children:s,right:a,danger:n}=e;return(0,f.jsxs)(Ls,{style:(0,m.A)({padding:22},n?{borderColor:"#FECACA"}:{}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:t}),a]}),s]})},Wl=()=>{const e=(0,r.Zp)(),t=(0,I.wE)(),[s,n]=(0,a.useState)(null),[i,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(!1),[x,g]=(0,a.useState)({type:"",text:""}),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)(null),[w,N]=(0,a.useState)(null);a.useEffect(()=>{const t=(0,o.cd)(e);t&&n(t)},[e]);const A=(e,t)=>
1{g({type:e,text:t}),setTimeout(()=>g({type:"",text:""}),8e3)};if(!s)return null;const k={fontFamily:Rl,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:8},S={fontFamily:Rl,fontWeight:700,fontSize:13,color:"#0A0A0B",wordBreak:"break-all"},_={fontFamily:Rl,fontSize:11,color:"#9A9AA0",marginTop:4},C={background:"#FBFBFC",border:"1px solid #E4E4E9",borderRadius:10,padding:14},F={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:10,padding:"12px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:i?"not-allowed":"pointer",opacity:i?.55:1,flex:1},E={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,background:"#0A0A0B",color:"#fff",border:"none",borderRadius:10,padding:"12px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:i?"not-allowed":"pointer",opacity:i?.55:1,flex:1},T=!w||c,z={display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,width:"100%",background:"#DC2626",color:"#fff",border:"none",borderRadius:10,padding:"12px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:T?"not-allowed":"pointer",opacity:T?.55:1},B="success"===x.type?{bg:"#DCFCE7",bd:"#BBF7D0",fg:"#15803D"}:"error"===x.type?{bg:"#FEE2E2",bd:"#FECACA",fg:"#991B1B"}:{bg:"#EEF2FF",bd:"#E0E7FF",fg:"#4338CA"},D=e=>(0,f.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:13,color:"#55555C",lineHeight:1.5},children:[(0,f.jsx)("span",{style:{color:"#BF212F",flexShrink:0},children:"\u2022"}),(0,f.jsx)("span",{children:e})]});return(0,f.jsxs)(ta,{title:"Backup / Restore",meta:"SYSTEM \xb7 DATA",children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{width:40,height:40,borderRadius:10,background:"#FEE2E2",color:"#BF212F",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(Es.A,{size:20})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:22,letterSpacing:"-0.01em",margin:0},children:"Database Backup & Restore"}),(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0",marginTop:2},children:"Download a complete snapshot of every collection, or restore from a backup file."})]})]}),x.text&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,background:B.bg,border:"1px solid ".concat(B.bd),color:B.fg,borderRadius:11,padding:"12px 14px",marginBottom:18,fontSize:13,fontWeight:600},children:["success"===x.type?(0,f.jsx)(p.A,{size:17,style:{flexShrink:0}}):"error"===x.type?(0,f.jsx)(h.A,{size:17,style:{flexShrink:0}}):(0,f.jsx)(Es.A,{size:17,style:{flexShrink:0}}),(0,f.jsx)("span",{children:x.text})]}),(0,f.jsxs)("div",{style:{maxWidth:900,display:"flex",flexDirection:"column",gap:18},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:18,alignItems:"start"},children:[(0,f.jsxs)(Pl,{title:"Backup",right:(0,f.jsx)("span",{style:{width:34,height:34,borderRadius:9,background:"#DCFCE7",color:"#15803D",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(es.A,{size:17})}),children:[(0,f.jsx)("p",{style:{fontSize:13,color:"#9A9AA0",margin:"0 0 16px"},children:"Export a full snapshot of every collection."}),b?(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},C),{},{marginBottom:16}),children:[(0,f.jsx)("div",{style:k,children:"LAST BACKUP"}),(0,f.jsx)("div",{style:S,children:b.filename}),(0,f.jsxs)("div",{style:_,children:[b.size,"string"===typeof b.size&&b.size.includes(" ")?"":" MB"," \xb7 ",b.timestamp]})]}):(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},C),{},{marginBottom:16}),children:[(0,f.jsx)("div",{style:k,children:"LAST BACKUP"}),(0,f.jsx)("div",{style:{fontFamily:Rl,fontSize:12,color:"#9A9AA0"},children:"No backup downloaded this session"})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:10},children:[(0,f.jsx)("button",{onClick:async()=>{if(confirm("Download a JSON backup of all database data?")){l(!0),y(null),A("info","Creating JSON backup... This may take a moment.");try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(t,"/api/backup/all"),{headers:{Authorization:"Bearer ".concat(s)}});if(!a.ok)throw new Error("JSON backup failed");const n=a.headers.get("Content-Disposition");let r="turbo360_complete_backup_".concat((new Date).toISOString().split("T")[0],".json");if(n){const e=n.match(/filename="?(.+)"?/);e&&(r=e[1])}const i=await a.blob(),o=(i.size/1024).toFixed(2),l=window.URL.createObjectURL(i),c=document.createElement("a");c.href=l,c.download=r,document.body.appendChild(c),c.click(),window.URL.revokeObjectURL(l),document.body.removeChild(c),y({filename:r,size:o>1024?"".concat((o/1024).toFixed(2)," MB"):"".concat(o," KB"),timestamp:(new Date).toLocaleStr
1ing()}),A("success","JSON backup downloaded successfully! (".concat(o>1024?(o/1024).toFixed(2)+" MB":o+" KB",")"))}catch(s){console.error("JSON backup error:",s),A("error","Failed to create JSON backup. Please try again or contact support.")}finally{l(!1)}}},disabled:i,className:"tg-btn-primary",style:F,children:i?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Dl.A,{size:16,className:"tg-spin",style:{animation:"spin 1s linear infinite"}})," Working\u2026"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Il.A,{size:16})," Download JSON"]})}),(0,f.jsx)("button",{onClick:async()=>{if(confirm("Download a complete backup of all database data?")){l(!0),y(null),A("info","Creating database backup... This may take a moment.");try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(t,"/api/admin/database/backup-all"),{headers:{Authorization:"Bearer ".concat(s)}});if(!a.ok)throw new Error("Backup failed");const n=a.headers.get("Content-Disposition");let r="database_backup_".concat((new Date).toISOString().split("T")[0],"_").concat(Date.now(),".tar.gz");if(n){const e=n.match(/filename="?(.+)"?/);e&&(r=e[1])}const i=await a.blob(),o=(i.size/1048576).toFixed(2),l=window.URL.createObjectURL(i),c=document.createElement("a");c.href=l,c.download=r,document.body.appendChild(c),c.click(),window.URL.revokeObjectURL(l),document.body.removeChild(c),y({filename:r,size:o,timestamp:(new Date).toLocaleString()}),A("success","Complete database backup downloaded successfully! (".concat(o," MB)"))}catch(s){console.error("Backup error:",s),A("error","Failed to create backup. Please try again or contact support.")}finally{l(!1)}}},disabled:i,style:E,children:i?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Dl.A,{size:16,style:{animation:"spin 1s linear infinite"}})," Working\u2026"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(_r.A,{size:16})," Download .tar.gz"]})})]})]}),(0,f.jsxs)(Pl,{title:"Restore",danger:!0,right:(0,f.jsx)("span",{style:{width:34,height:34,borderRadius:9,background:"#FEE2E2",color:"#991B1B",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(_s.A,{size:17})}),children:[(0,f.jsx)("p",{style:{fontSize:13,color:"#9A9AA0",margin:"0 0 16px"},children:"Replace all data from a JSON backup file."}),(0,f.jsxs)("label",{htmlFor:"backup-file-input",style:{display:"block",cursor:"pointer",marginBottom:16},children:[(0,f.jsxs)("div",{style:{border:"2px dashed #FECACA",borderRadius:10,padding:26,textAlign:"center",background:"#FFFBFB"},children:[(0,f.jsx)(es.A,{size:20,style:{margin:"0 auto 8px",color:"#DC8A8A"}}),(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"#991B1B"},children:w?w.name:"Drop backup file or browse"}),(0,f.jsx)("div",{style:{fontFamily:Rl,fontSize:11,color:"#C99",marginTop:4},children:w?"".concat((w.size/1024).toFixed(2)," KB"):".json backup files"})]}),(0,f.jsx)("input",{id:"backup-file-input",type:"file",accept:".json",onChange:e=>{const t=e.target.files[0];if(t){if(!t.name.endsWith(".json"))return void A("error","Please select a JSON backup file");N(t),A("info","Selected: ".concat(t.name," (").concat((t.size/1024).toFixed(2)," KB)"))}},style:{display:"none"}})]}),v&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},C),{},{marginBottom:16,background:"#FFFBFB",borderColor:"#FECACA"}),children:[(0,f.jsx)("div",{style:k,children:"RESTORE COMPLETE"}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[(0,f.jsx)("span",{style:{fontSize:13,color:"#55555C"},children:"Documents restored"}),(0,f.jsx)("span",{style:{fontFamily:Rl,fontWeight:700,fontSize:14,color:"#0A0A0B"},children:v.totalDocuments})]}),(0,f.jsx)("div",{style:_,children:v.timestamp})]}),(0,f.jsx)("button",{onClick:async()=>{if(w){if(confirm("\u26a0\ufe0f WARNING: This will REPLACE ALL existing data with the backup data. This action cannot be undone. Are you sure you want to continue?")){d(!0),j(null),A("info","Restoring database from backup... This may take a moment.");try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=new FormData;a.append("file",w);const n=await fetch("".concat(t,"/api/restore/all"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)},body:a});if(!n.ok){const e=await n.json();throw new Error(e.detail||"Restore failed")}const r=await n.json();j({restored:r.restored,deleted:r.deleted,totalDocuments:Object.values(r.restored).reduce((e,t)=>
1e+t,0),timestamp:(new Date).toLocaleString()}),A("success","Database restored successfully! ".concat(Object.values(r.restored).reduce((e,t)=>e+t,0)," documents restored.")),N(null);const i=document.getElementById("backup-file-input");i&&(i.value="")}catch(s){console.error("Restore error:",s),A("error","Failed to restore backup: ".concat(s.message))}finally{d(!1)}}}else A("error","Please select a backup file first")},disabled:T,style:z,children:c?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Dl.A,{size:16,style:{animation:"spin 1s linear infinite"}})," Restoring\u2026"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(_s.A,{size:16})," Restore from Backup"]})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:9,background:"#FEF2F2",borderRadius:9,padding:12,marginTop:14},children:[(0,f.jsx)(h.A,{size:16,style:{color:"#991B1B",flexShrink:0,marginTop:1}}),(0,f.jsxs)("p",{style:{fontSize:12,color:"#991B1B",lineHeight:1.5,margin:0},children:["Restore ",(0,f.jsx)("strong",{children:"overwrites all current data"}),". This cannot be undone \u2014 always back up before restoring."]})]})]})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:18,alignItems:"start"},children:[(0,f.jsx)(Pl,{title:"What's Included",children:(0,f.jsxs)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:10},children:[(0,f.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"center",fontSize:13,color:"#55555C"},children:[(0,f.jsx)(p.A,{size:15,style:{color:"#15803D",flexShrink:0}})," All collections"]}),(0,f.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"center",fontSize:13,color:"#55555C"},children:[(0,f.jsx)(p.A,{size:15,style:{color:"#15803D",flexShrink:0}})," Events & clients"]}),(0,f.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"center",fontSize:13,color:"#55555C"},children:[(0,f.jsx)(p.A,{size:15,style:{color:"#15803D",flexShrink:0}})," Invoices & proposals"]}),(0,f.jsxs)("li",{style:{display:"flex",gap:8,alignItems:"center",fontSize:13,color:"#55555C"},children:[(0,f.jsx)(p.A,{size:15,style:{color:"#15803D",flexShrink:0}})," Settings & services"]})]})}),(0,f.jsx)(Pl,{title:"Backup Formats",children:(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,fontSize:13,fontWeight:700,color:"#0A0A0B",marginBottom:8},children:[(0,f.jsx)(Il.A,{size:15,style:{color:"#BF212F"}})," JSON Backup (.json)"]}),(0,f.jsxs)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:6},children:[D("Human-readable format for easy inspection"),D("Restored directly using the restore panel above"),D("Best for quick backups and restores")]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7,fontSize:13,fontWeight:700,color:"#0A0A0B",marginBottom:8},children:[(0,f.jsx)(_r.A,{size:15,style:{color:"#BF212F"}})," Archive Backup (.tar.gz)"]}),(0,f.jsxs)("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:6},children:[D("Compressed BSON format for efficient storage"),D("Compatible with the mongorestore CLI tool"),D("Best for long-term archival storage")]})]})]})})]}),(0,f.jsx)(Pl,{title:"How to Restore",right:(0,f.jsx)("span",{style:{color:"#9A9AA0",display:"flex"},children:(0,f.jsx)(u.A,{size:16})}),children:(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:700,color:"#0A0A0B",marginBottom:6},children:"JSON Backup"}),(0,f.jsxs)("p",{style:{fontSize:13,color:"#55555C",margin:0,lineHeight:1.55},children:["Use the ",(0,f.jsx)("strong",{children:"Restore"})," panel above to upload and restore your JSON backup file directly."]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:700,color:"#0A0A0B",marginBottom:6},children:"Archive Backup"}),(0,f.jsx)("p",{style:{fontSize:13,color:"#55555C",margin:"0 0 10px",lineHeight:1.55},children:"Use the command-line mongorestore tool:"}),(0,f.jsxs)("div",{style:{background:"#0A0A0B",borderRadius:10,padding:14,fontFamily:Rl,fontSize:12,color:"#4ADE80",overflowX:"auto",lineHeight:1.7},children:[(0,f.jsx)("div",{style:{color:"#9A9AA0"},children:"# Extract the backup"}),(0,f.jsx)("div",{children:"tar -xzf database_backup_YYYY-MM-DD.tar.gz"}),(0,f.jsx)("div",{style:{color:"#9A9AA0",marginTop:8},children:"# Restore to MongoDB"}),(0,f.jsx)("div",{children:'mongorestore --uri="your-mongodb-url" ./backup_directory'})]}),(0,f.jsxs)("p",{style:{fontSize:12,color:"#9A9AA0",marginTop:10,marginBottom:0},children:["Or visit ",(0,f.jsx)("strong",{children:"/tboadmin/database-migration"})," for the web-based migration tool."]})]})]})})]})]})},Ol={created:{icon:ls.A,color:"bg-blue-100 text-blue-600",label:"Created",getDescription:e=>null!==e&&void 0!==e&&e.proposal_number?"Proposal ".concat(e.proposal_number," created"):"Proposal created"}
1,edited:{icon:Tn.A,color:"bg-amber-100 text-amber-600",label:"Edited",getDescription:e=>{var t;if((null===e||void 0===e||null===(t=e.fields_changed)||void 0===t?void 0:t.length)>0){const t=e.fields_changed.slice(0,3).join(", "),s=e.fields_changed.length>3?" +".concat(e.fields_changed.length-3," more"):"";return"Updated: ".concat(t).concat(s)}return"Document updated"}},sent:{icon:st.A,color:"bg-green-100 text-green-600",label:"Sent",getDescription:e=>null!==e&&void 0!==e&&e.recipient_email?"Sent to ".concat(e.recipient_email):"Sent to client"},resent:{icon:As.A,color:"bg-green-100 text-green-600",label:"Resent",getDescription:e=>null!==e&&void 0!==e&&e.recipient_email?"Resent to ".concat(e.recipient_email):"Resent to client"},viewed:{icon:_.A,color:"bg-purple-100 text-purple-600",label:"Viewed",getDescription:(e,t)=>t?"Viewed by client (IP: ".concat(t,")"):"Viewed by client"},accepted:{icon:zt.A,color:"bg-emerald-100 text-emerald-600",label:"Accepted",getDescription:(e,t,s)=>s?"Accepted by ".concat(s):"Proposal accepted"},declined:{icon:g.A,color:"bg-red-100 text-red-600",label:"Declined",getDescription:e=>null!==e&&void 0!==e&&e.category?"Declined: ".concat(e.category).concat(e.reason?" \u2014 ".concat(e.reason):""):null!==e&&void 0!==e&&e.reason?"Declined: ".concat(e.reason):"Proposal declined"},followup_sent:{icon:T.A,color:"bg-orange-100 text-orange-600",label:"Follow-up Sent",getDescription:e=>{var t;const s=(null===e||void 0===e||null===(t=e.followup_type)||void 0===t?void 0:t.replace("_","-"))||"";return"".concat(s," follow-up email sent")}},converted_to_invoice:{icon:kt.A,color:"bg-indigo-100 text-indigo-600",label:"Converted",getDescription:e=>null!==e&&void 0!==e&&e.invoice_number?"Converted to invoice ".concat(e.invoice_number):"Converted to invoice"},status_changed:{icon:As.A,color:"bg-slate-100 text-slate-600",label:"Status Changed",getDescription:e=>null!==e&&void 0!==e&&e.new_status?"Status changed to ".concat(e.new_status):"Status updated"},payment_recorded:{icon:At.A,color:"bg-emerald-100 text-emerald-600",label:"Payment",getDescription:e=>{if(null!==e&&void 0!==e&&e.amount){var t;const s=(null===(t=e.payment_method)||void 0===t?void 0:t.replace("_"," "))||"Manual";return"$".concat(e.amount.toFixed(2)," payment recorded (").concat(s,")")}return"Payment recorded"}},payment_stripe:{icon:At.A,color:"bg-emerald-100 text-emerald-600",label:"Stripe Payment",getDescription:e=>null!==e&&void 0!==e&&e.amount?"$".concat(e.amount.toFixed(2)," paid via Stripe"):"Stripe payment received"},reminder_sent:{icon:Nt.A,color:"bg-yellow-100 text-yellow-600",label:"Reminder",getDescription:e=>null!==e&&void 0!==e&&e.reminder_type?"".concat(e.reminder_type," reminder sent"):"Payment reminder sent"},late_fees_waived:{icon:h.A,color:"bg-amber-100 text-amber-600",label:"Fees Waived",getDescription:e=>null!==e&&void 0!==e&&e.amount_waived?"$".concat(e.amount_waived.toFixed(2)," late fees waived"):"Late fees waived"}},Ll={icon:Nt.A,color:"bg-slate-100 text-slate-600",label:"Activity",getDescription:()=>"Activity recorded"},Ml={admin:{label:"Admin",color:"bg-blue-100 text-blue-700"},client:{label:"Client",color:"bg-purple-100 text-purple-700"},system:{label:"System",color:"bg-slate-100 text-slate-700"}},ql=e=>{if(!e)return null;const t=String(e);return t.endsWith("Z")||t.includes("+")||/\d{2}:\d{2}$/.test(t.slice(-6))?new Date(t):new Date(t+"Z")},Hl=e=>{if(!e)return"";return ql(e).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"Australia/Melbourne"})},Ul=e=>{if(!e)return"";const t=ql(e),s=new Date-t,a=Math.floor(s/6e4),n=Math.floor(s/36e5),r=Math.floor(s/864e5);return a<1?"Just now":a<60?"".concat(a,"m ago"):n<24?"".concat(n,"h ago"):r<7?"".concat(r,"d ago"):Hl(e)},Gl=e=>{let{activity:t}=e;const s=Ol[t.action]||Ll,a=s.icon,n=Ml[t.actor_type]||Ml.system,r=s.getDescription(t.details,t.ip_address,t.actor_name);return(0,f.jsxs)("div",{className:"flex items-start gap-3 py-3 border-b border-slate-100 last:border-b-0",children:[(0,f.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center ".concat(s.color),children:(0,f.jsx)(a,{className:"w-4 h-4"})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,f.jsx)("span",{className:"font-medium text-slate-900",children:s.label}),(0,f.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(n.color),children:n.label})]}),(0,f.jsx)("p",{className:"text-sm text-slate-600 mt-0.5 line-clamp-2",children:r}),t.actor_name&&"client"===t.actor_type&&(0,f.jsxs)("p",{className:"text-xs text-slate-500 mt-1 flex items-center gap-1",children:[(0,f.jsx)(Ye.A,{className:"w-3 h-3"}),t.actor_name]})]}),(0,f.jsx)("div",{className:"flex-shrink-0 text-right",children:(0,f.jsx)("p",{className:"text-xs text-slate-500",title:Hl(t.timestamp),children:Ul(t.timestamp)})})]})},Vl=e=>
1{let{activities:t=[],maxItems:s=10,title:a="Activity Log"}=e;const n=[...t].sort((e,t)=>{const s=new Date(e.timestamp);return new Date(t.timestamp)-s}),r=n.slice(0,s),i=n.length>s;return t&&0!==t.length?(0,f.jsxs)("div",{className:"bg-slate-50 rounded-xl p-4",children:[(0,f.jsxs)("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:[a," (",t.length,")"]}),(0,f.jsxs)("div",{className:"max-h-80 overflow-y-auto",children:[r.map((e,t)=>(0,f.jsx)(Gl,{activity:e},e.id||t)),i&&(0,f.jsxs)("p",{className:"text-xs text-slate-500 text-center py-2",children:["+",n.length-s," more activities"]})]})]}):(0,f.jsxs)("div",{className:"bg-slate-50 rounded-xl p-4",children:[(0,f.jsx)("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:a}),(0,f.jsx)("p",{className:"text-sm text-slate-500 text-center py-4",children:"No activity recorded yet"})]})},Jl="'Space Mono',monospace",Yl={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Kl="100px 1.5fr 1.25fr 92px 116px 132px 130px 34px",Zl=["Draft","Sent","Viewed","Pending Response","Accepted","Declined"],$l=["#0A0A0B","#4338CA","#0FA3A3","#BF212F","#7C3AED","#0891B2","#B45309","#64748B"],Ql=function(){return $l[((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").charCodeAt(0)||0)%$l.length]},Xl=e=>({background:"#fff",border:"1px solid #E4E4E9",borderRadius:8,padding:"6px 12px",fontSize:12.5,fontWeight:600,color:e?"#C9C9CE":"#333",cursor:e?"default":"pointer"}),ec=()=>{var e;const t=(0,r.Zp)(),{toast:s}=N(),[n,i]=(0,a.useState)(null),[l,c]=(0,a.useState)([]),[d,x]=(0,a.useState)(0),[h,u]=(0,a.useState)(1),[b,y]=(0,a.useState)({total:0,accepted:0,pending:0,draft:0,totalValue:0,acceptedValue:0,by_status:{}}),[v,j]=(0,a.useState)(!0),[w,A]=(0,a.useState)(""),[k,S]=(0,a.useState)(""),[C,F]=(0,a.useState)(()=>{const e=localStorage.getItem("proposalStatusFilter");return e?JSON.parse(e):["Draft","Sent","Viewed","Pending Response","Accepted","Declined"]}),[E,z]=(0,a.useState)(!1),[B,D]=(0,a.useState)("created_at"),[R,P]=(0,a.useState)("desc"),[W,O]=(0,a.useState)({}),[L,M]=(0,a.useState)(null),[q,H]=(0,a.useState)(!1),[U,G]=(0,a.useState)(null),[V,J]=(0,a.useState)(null),[Y,K]=(0,a.useState)(null),[Z,$]=(0,a.useState)(null),[Q,X]=(0,a.useState)(!1),[ee,te]=(0,a.useState)("choice"),[se,ae]=(0,a.useState)([]),[ne,re]=(0,a.useState)(""),[ie,oe]=(0,a.useState)(""),[le,ce]=(0,a.useState)(!1),de=()=>{te("choice"),re(""),oe(""),X(!0),0===se.length&&me()},me=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();ae(e.clients||[])}}catch(t){console.error("Error loading clients:",t)}},pe=async e=>{if(confirm("Send a follow-up reminder email to the client for this proposal?")){J(e.id);try{var t;const a=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,n=await fetch("".concat(I.fn,"/api/proposals/").concat(e.id,"/send-followup"),{method:"POST",headers:{Authorization:"Bearer ".concat(a)}}),r=await n.json();r.success?(s.success(r.message||"Follow-up email sent successfully!"),he(),H(!1)):s.error(r.detail||"Failed to send follow-up email")}catch(a){console.error("Error sending follow-up:",a),s.error("An error occurred while sending the follow-up email")}finally{J(null)}}},xe=async e=>{try{var t;G(e.id);const a=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,n=await fetch("".concat(I.fn,"/api/proposals/").concat(e.id,"/send"),{method:"POST",headers:{Authorization:"Bearer ".concat(a)}});if(n.ok)c(t=>t.map(t=>t.id===e.id?(0,m.A)((0,m.A)({},t),{},{status:"Sent"}):t)),s.success("Proposal sent successfully!");else{const e=await n.json();s.error(e.detail||"Failed to send proposal")}}catch(a){console.error("Error sending proposal:",a),s.error("Failed to send proposal")}finally{G(null)}};(0,a.useEffect)(()=>{const e=(0,o.cd)(t);e&&i(e)},[t]),(0,a.useEffect)(()=>{const e=setTimeout(()=>S(w.trim()),350);return()=>clearTimeout(e)},[w]),(0,a.useEffect)(()=>{u(1)},[k,C,B,R]),(0,a.useEffect)(()=>{he()},[k,C,B,R,h]);const he=async()=>{j(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=new URLSearchParams({page:String(h),page_size:String(25),sort:"".concat(B,":").concat(R)});k&&s.set("q",k),C.length>0&&C.length<Zl.length&&s.set("status",C.join(","));const a=await fetch("".concat(I.fn,"/api/proposals?").concat(s),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){const e=await a.json();c(e.proposals||[]),x(e.total||0),e.stats&&y(e.stats)}}catch(t){console.error("Error loading proposals:",t),s.error("Failed to load proposals")}finally{j(!1)}},ue=async e=>{try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/proposals/").concat(e),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok)return await a.json()}catch(s){console.error("Error loading proposal:",s)}return null},ge=e=>{B===e?P("asc"===R?"desc":"asc"):(D(e),P("desc"))},fe=b,be=fe.total>0?Math.round(fe.accepted/fe.total*100):0,ye=Math.max(1,Math.ceil(d/25)),ve=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:0,maximumFractionDigits:0}).format(e||0),je=e=>{if(!e)return null;const t=String(e);return t.endsWith("Z")||t.includes("+")||/\d{2}:\d{2}$/.test(t.slice(-6))?new Date(t):new Date(t+"Z")},we=e=>{if(!e)return"-";try{return je(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric",timeZone:"Australia/Melbourne"})}catch(t){return e}},Ne=e=>{if(!e)return"\u2014";try{return je(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short",timeZone:"Australia/Melbourne"})}catch(t){return e}},Ae=async e=>{M(e),H(!0);const t=await ue(e.id);t&&M(s=>s&&s.id===e.id?(0,m.A)((0,m.A)({},s),t):s)};return(0,f.jsxs)(ta,{title:"Proposals",meta:"SALES \xb7 PROPOSALS",action:{label:"New Proposal",onClick:de},children:[(0,f.jsxs)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:16,marginBottom:20},children:[(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Yl),{},{padding:18}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[(0,f.jsx)("span",{style:{fontFamily:Jl,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0"},children:"TOTAL PROPOSALS"}),(0,f.jsx)("span",{style:{width:28,height:28,borderRadius:8,background:"#EEF2FF",color:"#4338CA",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(kt.A,{size:15})})]}),(0,f.jsx)("div",{style:{fontFamily:Jl,fontWeight:700,fontSize:28,letterSpacing:"-0.03em",lineHeight:1},children:fe.total}),(0,f.jsxs)("div",{style:{marginTop:10,fontSize:12,color:"#9A9AA0"},children:[fe.draft," in draft"]})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Yl),{},{padding:18,position:"relative",overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{position:"absolute",right:-18,top:-18,width:84,height:84,borderRadius:"50%",background:"rgba(34,197,94,.07)"}}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[(0,f.jsx)("span",{style:{fontFamily:Jl,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0"},children:"ACCEPTED"}),(0,f.jsx)("span",{style:{width:28,height:28,borderRadius:8,background:"rgba(34,197,94,.12)",color:"#16A34A",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(p.A,{size:15})})]}),(0,f.jsx)("div",{style:{fontFamily:Jl,fontWeight:700,fontSize:28,letterSpacing:"-0.03em",lineHeight:1,color:"#16A34A"},children:fe.accepted}),(0,f.jsxs)("div",{style:{marginTop:10,fontSize:12,color:"#16A34A",fontWeight:600},children:[be,"% win rate"]})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Yl),{},{padding:18}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[(0,f.jsx)("span",{style:{fontFamily:Jl,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0"},children:"PENDING"}),(0,f.jsx)("span",{style:{width:28,height:28,borderRadius:8,background:"rgba(242,169,0,.14)",color:"#B45309",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(Nt.A,{size:15})})]}),(0,f.jsx)("div",{style:{fontFamily:Jl,fontWeight:700,fontSize:28,letterSpacing:"-0.03em",lineHeight:1},children:fe.pending}),(0,f.jsx)("div",{style:{marginTop:10,fontSize:12,color:"#9A9AA0"},children:"sent \xb7 viewed \xb7 awaiting"})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:{gridColumn:"span 2",background:"#0A0A0B",border:"1px solid #0A0A0B",borderRadius:14,padding:18,position:"relative",overflow:"hidden"},children:[(0,f.jsx)("div",{style:{position:"absolute",right:-18,bottom:-18,width:84,height:84,borderRadius:"50%",background:"rgba(255,255,255,.04)"}}),(0,f.jsx)("div",{style:{fontFamily:Jl,fontSize:10.5,letterSpacing:"0.16em",color:"#F87171",marginBottom:12},children:"ACCEPTED VALUE"}),(0,f.jsx)(zs,{amount:fe.acceptedValue,size:28,mutedSize:15,color:"#fff",mutedColor:"#7A7A82"}),(0,f.jsx)("div",{style:{marginTop:10,fontSize:12,color:"#7A7A82"},children:"booked from accepted"})]})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Yl),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 18px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:200},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{value:w,onChange:e=>A(e.target.value),placeholder:"Search by #, client or project\u2026",style:{border:"none",background:"transparent",outline:"none",fontSize:13,width:"100%"}})]}),(0,f.jsxs)("div",{style:{position:"relative"},children:[(0,f.jsxs)("button",{onClick:()=>z(!E),style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:["Status: ",6===C.length?"All":"".concat(C.length," selected"),C.length<6&&(0,f.jsx)("span",{style:{fontFamily:Jl,fontSize:10,fontWeight:700,background:"#EEF2FF",color:"#4338CA",borderRadius:5,padding:"1px 6px"},children:C.length}),(0,f.jsx)(Et.A,{size:14,color:"#9A9AA0",style:{transform:E?"rotate(180deg)":"none",transition:"transform .15s"}})]}),E&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{position:"fixed",inset:0,zIndex:25},onClick:()=>z(!1)}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({position:"absolute",top:"100%",right:0,marginTop:8,width:230},Yl),{},{boxShadow:"0 12px 32px rgba(0,0,0,.12)",padding:"6px 0",zIndex:30}),children:Zl.map(e=>(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",padding:"8px 14px",cursor:"pointer",fontSize:13},children:[(0,f.jsx)("input",{type:"checkbox",checked:C.includes(e),onChange:t=>{const s=t.target.checked?[...C,e]:C.filter(t=>t!==e);F(s),localStorage.setItem("proposalStatusFilter",JSON.stringify(s))},style:{width:15,height:15,accentColor:"#4338CA",cursor:"pointer"}}),(0,f.jsx)("span",{style:{marginLeft:10,color:"#333"},children:e}),(0,f.jsx)("span",{style:{marginLeft:"auto",fontFamily:Jl,fontSize:11,color:"#9A9AA0"},children:fe.by_status&&fe.by_status[e]||0})]},e))})]})]}),(0,f.jsxs)("select",{value:"".concat(B,":").concat(R),onChange:e=>{const[t,s]=e.target.value.split(":");D(t),P(s)},style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)("option",{value:"created_at:desc",children:"Sort: Recent"}),(0,f.jsx)("option",{value:"created_at:asc",children:"Oldest"}),(0,f.jsx)("option",{value:"job_date:asc",children:"Job date \u2191"}),(0,f.jsx)("option",{value:"job_date:desc",children:"Job date \u2193"}),(0,f.jsx)("option",{value:"total:desc",children:"Amount \u2193"}),(0,f.jsx)("option",{value:"total:asc",children:"Amount \u2191"}),(0,f.jsx)("option",{value:"proposal_number:asc",children:"Proposal #"})]}),(0,f.jsxs)("button",{onClick:he,style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(As.A,{size:14})," Refresh"]})]}),(0,f.jsxs)("div",{className:"tg-leadrow tg-booking-meta",style:{gridTemplateColumns:Kl,gap:12,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:Jl,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{onClick:()=>ge("proposal_number"),style:{cursor:"pointer"},children:"Proposal #"}),(0,f.jsx)("span",{onClick:()=>ge("client_company"),style:{cursor:"pointer"},children:"Client"}),(0,f.jsx)("span",{onClick:()=>ge("project_name"),style:{cursor:"pointer"},children:"Project"}),(0,f.jsx)("span",{onClick:()=>ge("job_date"),style:{cursor:"pointer"},children:"Job date"}),(0,f.jsx)("span",{onClick:()=>ge("total"),style:{textAlign:"right",cursor:"pointer"},children:"Amount"}),(0,f.jsx)("span",{children:"Status"}),(0,f.jsx)("span",{children:"Actions"}),(0,f.jsx)("span",{})]}),v?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:8})}):0===l.length?(0,f.jsx)(Os,{icon:kt.A,title:"No proposals found",message:w||C.length<6?"Try adjusting your filters.":"Get started by creating your first proposal.",actionLabel:"Create Proposal",onAction:de}):l.map(e=>{var a;return(0,f.jsxs)("div",{className:"tg-leadrow tg-row",style:{gridTemplateColumns:Kl,gap:12,alignItems:"center",padding:"14px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer"},onClick:()=>Ae(e),children:[(0,f.jsx)("span",{style:{fontFamily:Jl,fontSize:13,fontWeight:700,color:"#0A0A0B",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.proposal_number||"\u2014"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[(0,f.jsx)("span",{className:"tg-ui",style:{width:30,height:30,borderRadius:8,background:Ql(e.client_company),color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:11,flexShrink:0},children:Ms(e.client_company)}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsxs)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[e.client_company,e.ai_generated&&(0,f.jsx)("span",{style:{fontFamily:Jl,fontSize:8.5,fontWeight:700,background:"linear-gradient(135deg,#7C3AED,#A78BFA)",color:"#fff",borderRadius:4,padding:"2px 5px",marginLeft:6,verticalAlign:"middle"},children:"AI"})]}),e.contact_name&&(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.contact_name})]})]}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontSize:13,color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},title:e.project_name,children:e.project_name||"\u2014"}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontFamily:Jl,fontSize:12,color:"#55555C"},children:Ne(e.job_date)}),(0,f.jsx)("span",{style:{fontFamily:Jl,fontSize:13.5,fontWeight:700,textAlign:"right"},children:ve(null!==(a=e.booked_total)&&void 0!==a?a:e.total)}),(0,f.jsx)("span",{onClick:e=>e.stopPropagation(),children:(0,f.jsxs)("select",{value:e.status,onChange:t=>(async(e,t)=>{try{var a;O(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!0}));const n=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,r=await fetch("".concat(I.fn,"/api/proposals/").concat(e,"/status"),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify({status:t})});if(r.ok)c(s=>s.map(s=>s.id===e?(0,m.A)((0,m.A)({},s),{},{status:t}):s)),s.success("Status updated to ".concat(t));else{const e=await r.json();s.error(e.detail||"Failed to update status")}}catch(n){cons
1ole.error("Error updating proposal status:",n),s.error("Failed to update status")}finally{O(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!1}))}})(e.id,t.target.value),disabled:W[e.id],style:{fontFamily:Jl,fontSize:10,fontWeight:700,textTransform:"uppercase",background:Rs[e.status]?void 0:"#EDEDF0",border:"1px solid #E4E4E9",borderRadius:6,padding:"4px 8px",cursor:"pointer",color:"#333",opacity:W[e.id]?.5:1,maxWidth:"100%"},children:[(0,f.jsx)("option",{value:"Draft",children:"Draft"}),(0,f.jsx)("option",{value:"Sent",children:"Sent"}),(0,f.jsx)("option",{value:"Viewed",children:"Viewed"}),(0,f.jsx)("option",{value:"Pending Response",children:"Pending"}),(0,f.jsx)("option",{value:"Accepted",children:"Accepted"}),(0,f.jsx)("option",{value:"Declined",children:"Declined"})]})}),(0,f.jsx)("span",{children:(0,f.jsx)(Ds,{tone:Rs[e.status]||"gray",children:e.status})}),(0,f.jsxs)(Mr,{open:Z===e.id,onToggle:()=>$(Z===e.id?null:e.id),onClose:()=>$(null),children:[(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{$(null),Ae(e)},children:[(0,f.jsx)(_.A,{size:15})," View details"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{$(null),t("/admin/proposals/edit/".concat(e.id))},children:[(0,f.jsx)(Tn.A,{size:15})," Edit"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",disabled:Y===e.id,onClick:()=>{$(null),(async e=>{K(e.id);try{var a;const n=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,r=await fetch("".concat(I.fn,"/api/proposals/").concat(e.id,"/duplicate"),{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify({})}),i=await r.json();i.success?(s.success("Duplicated as ".concat(i.proposal_number," \u2014 set the job date and send")),t("/admin/proposals/edit/".concat(i.proposal_id))):s.error(i.detail||"Failed to duplicate proposal")}catch(n){console.error("Error duplicating proposal:",n),s.error("Failed to duplicate proposal")}finally{K(null)}})(e)},children:[(0,f.jsx)(Cr.A,{size:15})," ",Y===e.id?"Duplicating\u2026":"Duplicate for a new year"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",disabled:U===e.id,onClick:()=>{$(null),xe(e)},children:[(0,f.jsx)(st.A,{size:15})," Send to client"]}),"Draft"!==e.status&&"Accepted"!==e.status&&(0,f.jsxs)("button",{className:"tg-kebab-item",disabled:V===e.id,onClick:()=>{$(null),pe(e)},children:[(0,f.jsx)(T.A,{size:15})," Send followup"]}),"Accepted"===e.status&&!e.invoice_created&&(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:async()=>{$(null);const s=await ue(e.id);t("/admin/invoices/create",{state:{fromProposal:!0,proposal:s||e}})},children:[(0,f.jsx)(At.A,{size:15})," Create invoice"]})]})]},e.id)}),!v&&l.length>0&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 22px",borderTop:"1px solid #EDEDF0",flexWrap:"wrap",gap:10},children:[(0,f.jsxs)("span",{style:{fontFamily:Jl,fontSize:11.5,color:"#9A9AA0"},children:["SHOWING ",25*(h-1)+1,"\u2013",25*(h-1)+l.length," OF ",d," PROPOSALS"]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)("button",{disabled:h<=1,onClick:()=>u(e=>e-1),style:Xl(h<=1),children:"\u2190 Prev"}),(0,f.jsxs)("span",{style:{fontFamily:Jl,fontSize:11.5,color:"#55555C"},children:["PAGE ",h," / ",ye]}),(0,f.jsx)("button",{disabled:h>=ye,onClick:()=>u(e=>e+1),style:Xl(h>=ye),children:"Next \u2192"})]})]})]}),q&&L&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-4xl max-h-[90vh] overflow-hidden",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-700 px-6 py-4 flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"text-white",children:[(0,f.jsx)("h2",{className:"text-xl font-bold",children:"Proposal Details"}),(0,f.jsx)("p",{className:"text-indigo-200 text-sm mt-0.5",children:L.proposal_number})]}),(0,f.jsx)("button",{onClick:()=>H(!1),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-5 w-5 text-white"})})]}),(0,f.jsxs)("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-180px)]",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-6 pb-6 border-b border-slate-200",children:[(0,f.jsxs)("div",{className:"flex items-center gap-4",children:[(0,f.jsx)("span",{className:"px-4 py-2 rounded-full text-sm font-semibold border ".concat((e=>{const t={Draft:"bg-slate-100 text-slate-700 border-slate-200",Sent:"bg-blue-50 text-blue-700 border-blue-200","Pending Response":"bg-amber-50 text-amber-700 border-amber-200",Viewed:"bg-purple-50 text-purple-700 border-purple-200",Accepted:"bg-emerald-50 text-emerald-700 border-emerald-200",Declined:"bg-red-50 text-red-700 border-red-200"};return t[e]||t.Draft})(L.status)),children:L.status}),L.first_viewed_at&&(0,f.jsxs)("span",{className:"text-sm text-slate-500 flex items-center gap-1",children:[(0,f.jsx)(_.A,{className:"h-4 w-4"}),"Viewed: ",we(L.first_viewed_at)]})]}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsx)("p",{className:"text-3xl font-bold text-slate-900",children:ve(null!==(e=L.booked_total)&&void 0!==e?e:L.total)}),L.client_discount>0&&(0,f.jsxs)("p",{className:"text-sm text-emerald-600",children:["Discount: ","percentage"===L.client_discount_type?"".concat(L.client_discount,"%"):ve(L.client_discount)]})]})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-6",children:[(0,f.jsxs)("div",{className:"bg-slate-50 rounded-xl p-4",children:[(0,f.jsx)("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:"Client Information"}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(gs.A,{className:"h-4 w-4 text-slate-400"}),(0,f.jsx)("span",{className:"font-semibold text-slate-900",children:L.client_company})]}),(0,f.jsx)("p",{className:"text-slate-700 ml-6",children:L.contact_name}),L.position&&(0,f.jsx)("p",{className:"text-sm text-slate-500 ml-6",children:L.position}),(0,f.jsx)("p",{className:"text-sm text-slate-600 ml-6",children:L.email}),L.phone&&(0,f.jsx)("p",{className:"text-sm text-slate-600 ml-6",children:L.phone})]})]}),(0,f.jsxs)("div",{className:"bg-slate-50 rounded-xl p-4",children:[(0,f.jsx)("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:"Project Details"}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:L.project_name}),(0,f.jsxs)("div",{className:"flex items-center gap-2 text-slate-600",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4 text-slate-400"}),(0,f.jsxs)("span",{children:["Job Date: ",we(L.job_date)]})]}),L.job_location&&(0,f.jsx)("p",{className:"text-sm text-slate-600",children:L.job_location}),L.start_time&&(0,f.jsxs)("p",{className:"text-sm text-slate-600",children:["Start Time: ",L.start_time]})]})]})]}),L.service_items&&L.service_items.length>0&&(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:"Services"}),(0,f.jsx)("div",{className:"bg-slate-50 rounded-xl overflow-hidden",children:(0,f.jsxs)("table",{className:"w-full",children:[(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{className:"bg-slate-100",children:[(0,f.jsx)("th",{className:"px-4 py-2 text-left text-xs font-semibold text-slate-600",children:"Service"}),(0,f.jsx)("th",{className:"px-4 py-2 text-right text-xs font-semibold text-slate-600",children:"Price"})]})}),(0,f.jsx)("tbody",{className:"divide-y divide-slate-200",children:L.service_items.map((e,t)=>{const s=!("Accepted"===L.status)||!L.accepted_service_items||L.accepted_service_items.includes(t);return(0,f.jsxs)("tr",{className:s?"":"opacity-40 line-through",children:[(0,f.jsxs)("td",{className:"px-4 py-3",children:[(0,f.jsx)("p",{className:"font-medium text-slate-900",children:e.title}),e.description&&(0,f.jsx)("p",{className:"text-sm text-slate-500 mt-1",children:e.description})]}),(0,f.jsx)("td",{className:"px-4 py-3 text-right font-medium text-slate-900",children:ve(e.price)})]},t)})})]})})]}),L.deliverables&&L.deliverables.length>0&&(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:"Deliverables"}),(0,f.jsx)("ul",{className:"bg-slate-50 rounded-xl p-4 space-y-2",children:L.deliverables.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start gap-2 text-slate-700",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 text-emerald-500 mt-0.5 flex-shrink-0"}),(0,f.jsx)("span",{children:e})]},t))})]}),(0,f.jsxs)("div",{className:"bg-slate-50 rounded-xl p-4",children:[(0,f.jsx)("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:"Timeline"}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-4 text-sm",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"text-slate-500",children:"Created:"}),(0,f.jsx)("span",{className:"ml-2 text-slate-900 font-medium",children:we(L.created_at)})]}),L.sent_at&&(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"text-slate-500",children:"Sent:"}),(0,f.jsx)("span",{className:"ml-2 text-slate-900 font-medium",children:we(L.sent_at)})]}),L.first_viewed_at&&(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"text-slate-500",children:"First Viewed:"}),(0,f.jsx)("span",{className:"ml-2 text-slate-900 font-medium",children:we(L.first_viewed_at)})]}),L.accepted_at&&(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"text-slate-500",children:"Accepted:"}),(0,f.jsx)("span",{className:"ml-2 text-emerald-600 font-medium",children:we(L.accepted_at)})]})]})]}),L.activity_log&&L.activity_log.length>0&&(0,f.jsx)("div",{className:"mt-6",children:(0,f.jsx)(Vl,{activities:L.activity_log,maxItems:15})})]}),(0,f.jsxs)("div",{className:"bg-slate-50 px-6 py-4 border-t border-slate-200 flex items-center justify-between",children:[(0,f.jsx)("div",{className:"flex items-center gap-2",children:(0,f.jsxs)("a",{href:"/proposal/".concat(L.id),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-slate-200 text-slate-700 rounded-lg hover:bg-slate-50 transition-colors text-sm font-medium",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),"View Public Page"]})}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsxs)("button",{onClick:()=>{xe(L),H(!1)},className:"inline-flex items-center gap-2 px-4 py-2 bg-emerald-600 text-white rounded-lg hover:bg-emerald-700 transition-colors text-sm font-medium",children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),"Draft"===L.status?"Send to Client":"Re-send to Client"]}),"Draft"!==L.status&&"Accepted"!==L.status&&(0,f.jsxs)("button",{onClick:()=>pe(L),disabled:V===L.id,className:"inline-flex items-center gap-2 px-4 py-2 bg-orange-600 text-white rounded-lg hover:bg-orange-700 transition-colors text-sm font-medium disabled:opacity-50",children:[(0,f.jsx)(T.A,{className:"h-4 w-4"}),V===L.id?"Sending...":"Send Followup"]}),"Accepted"===L.status&&!L.invoice_created&&(0,f.jsxs)("button",{onClick:()=>{t("/admin/invoices/create",{state:{fromProposal:!0,proposal:L}})},className:"inline-flex items-center gap-2 px-4 py-2 bg-emerald-600 text-white rounded-lg hover:bg-emerald-700 transition-colors text-sm font-medium",children:[(0,f.jsx)(At.A,{className:"h-4 w-4"}),"Create Invoice"]}),(0,f.jsxs)("button",{onClick:()=>t("/admin/proposals/edit/".concat(L.id)),className:"inline-flex items-center gap-2 px-4 py-2 bg-indigo-600 text-white rounded-lg hover:bg-indigo-700 transition-colors text-sm font-medium",children:[(0,f.jsx)(Tn.A,{className:"h-4 w-4"}),"Edit Proposal"]})]})]})]})}),Q&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:()=>{le||X(!1)},children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-2xl overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:["ai"===ee&&!le&&(0,f.jsx)("button",{onClick:()=>te("choice"),style:{background:"none",border:"none",cursor:"pointer",color:"#9A9AA0",display:"flex"},children:(0,f.jsx)(Ct.A,{size:18})}),(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:800,fontSize:17,margin:0},children:"choice"===ee?"New Proposal":"AI Draft Proposal"})]}),!le&&(0,f.jsx)("button",{onClick:()=>X(!1),style:{background:"none",border:"none",cursor:"pointer",color:"#9A9AA0",display:"flex"},children:(0,f.jsx)(g.A,{size:19})})]}),"choice"===ee?(0,f.jsxs)("div",{style:{padding:22,display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("button",{onClick:()=>{X(!1),t("/admin/proposals/create")},style:(0,m.A)((0,m.A)({},Yl),{},{padding:22,textAlign:"left",cursor:"pointer",display:"flex",flexDirection:"column",gap:10}),className:"hover:shadow-md transition-shadow",children:[(0,f.jsx)("span",{style:{width:38,height:38,borderRadius:10,background:"#EEF2FF",color:"#4338CA",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(kt.A,{size:19})}),(0,f.jsx)("span",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"Standard"}),(0,f.jsx)("span",{style:{fontSize:12.5,color:"#9A9AA0",lineHeight:1.5},children:"Build the proposal yourself in the editor \u2014 pick services, pricing and content from scratch."})]}),(0,f.jsxs)("button",{onClick:()=>te("ai"),style:(0,m.A)((0,m.A)({},Yl),{},{padding:22,textAlign:"left",cursor:"pointer",display:"flex",flexDirection:"column",gap:10,borderColor:"#DDD6FE"}),className:"hover:shadow-md transition-shadow",children:[(0,f.jsx)("span",{style:{width:38,height:38,borderRadius:10,background:"linear-gradient(135deg,#7C3AED,#A78BFA)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(Wr.A,{size:19})}),(0,f.jsx)("span",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"AI Draft"}),(0,f.jsx)("span",{style:{fontSize:12.5,color:"#9A9AA0",lineHeight:1.5},children:"Paste the client's enquiry and Claude drafts the proposal \u2014 services, pricing and wording \u2014 for you to review."})]})]}):le?(0,f.jsxs)("div",{style:{padding:"48px 22px",display:"flex",flexDirection:"column",alignItems:"center",gap:16,textAlign:"center"},children:[(0,f.jsx)("span",{style:{width:52,height:52,borderRadius:14,background:"linear-gradient(135deg,#7C3AED,#A78BFA)",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(Kr.A,{size:26,className:"animate-spin"})}),(0,f.jsx)("div",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16},children:"Drafting your proposal\u2026"}),(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0",maxWidth:380,lineHeight:1.6},children:"Claude is analysing the enquiry, matching it to your service catalog and past proposals, and writing the draft. This usually takes 1\u20132 minutes \u2014 keep this window open."})]}):(0,f.jsxs)("div",{style:{padding:22,display:"flex",flexDirection:"column",gap:16},children:[(0,f.jsx)(Yo,{allClients:se,selectedContactId:ne,onContactSelect:e=>re(e?"string"===typeof e?e:e.id:""),label:"Who is this proposal for?"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:{display:"block",fontSize:12.5,fontWeight:600,color:"#55555C",marginBottom:6},children:"Client's enquiry"}),(0,f.jsx)("textarea",{value:ie,onChange:e=>oe(e.target.value),rows:10,placeholder:'Paste what the client has asked for \u2014 emails work great. Include dates, locations, times and any "must have" vs "nice to have" services.',style:{width:"100%",border:"1px solid #E4E4E9",borderRadius:10,padding:"10px 12px",fontSize:13,lineHeight:1.6,outline:"none",resize:"vertical",fontFamily:"inherit"}})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[(0,f.jsx)("button",{onClick:()=>te("choice"),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"10px 1
16px",fontSize:13.5,fontWeight:600,color:"#55555C",cursor:"pointer"},children:"Back"}),(0,f.jsxs)("button",{onClick:async()=>{if(ne)if(ie.trim()){ce(!0);try{var e;const a=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,n=await fetch("".concat(I.fn,"/api/proposals/generate-ai"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify({client_id:ne,enquiry_text:ie})}),r=await n.json().catch(()=>({}));n.ok&&r.proposal_id?(s.success("AI draft ".concat(r.proposal_number||""," ready \u2014 review before sending")),X(!1),t("/admin/proposals/edit/".concat(r.proposal_id))):s.error(r.detail||"AI generation failed \u2014 please try again")}catch(a){console.error("Error generating AI proposal:",a),s.error("AI generation failed \u2014 please try again")}finally{ce(!1)}}else s.error("Paste the client's enquiry first");else s.error("Select a contact for this proposal")},style:{display:"inline-flex",alignItems:"center",gap:8,background:"linear-gradient(135deg,#7C3AED,#A78BFA)",border:"none",borderRadius:9,padding:"10px 18px",fontSize:13.5,fontWeight:600,color:"#fff",cursor:"pointer"},children:[(0,f.jsx)(Wr.A,{size:15})," Generate with AI"]})]})]})]})})]})},tc=[{value:"EXPO",label:"EXPO Video"},{value:"FOOD",label:"FOOD Video"},{value:"FOOD_EXTENDED",label:"Food Video Extended"},{value:"WEBBG",label:"Web BG Video"},{value:"GALA",label:"Gala Video"}],sc={EXPO:"/hero_video_compressed.mp4",FOOD:"/food_video_extended.mp4",FOOD_EXTENDED:"/food_video_extended.mp4",WEBBG:"/webbg_compressed.mp4",GALA:"/gala_compressed.mp4"},ac=e=>sc[e]||null;var nc=s(23585),rc=s(1648),ic=s(41024);const oc={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},lc={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},cc=(0,m.A)((0,m.A)({},lc),{},{fontFamily:"'Space Mono',monospace"}),dc=e=>{let{title:t,children:s,right:a,style:n}=e;return(0,f.jsxs)(Ls,{style:(0,m.A)({padding:22},n),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:t}),a]}),s]})},mc=e=>{let{id:t,item:s,index:a,formData:n,handleServiceItemChange:r,handleHoursChange:i,removeServiceItem:o,searchServices:l,activeSearchIndex:c,setActiveSearchIndex:d,searchResults:p,selectService:x,addExtraToItem:h,updateExtraInItem:u,removeExtraFromItem:b}=e;const{attributes:y,listeners:v,setNodeRef:j,transform:w,transition:N,isDragging:A}=(0,rc.gl)({id:t}),k={transform:ic.Ks.Transform.toString(w),transition:N,opacity:A?.5:1,background:A?"#F7F7F9":"#FBFBFC",border:"1px solid #EDEDF0",borderRadius:12,padding:14,marginBottom:12};return(0,f.jsx)("div",{ref:j,style:k,children:(0,f.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[(0,f.jsx)("button",(0,m.A)((0,m.A)((0,m.A)({type:"button"},y),v),{},{style:{marginTop:8,border:"none",background:"transparent",color:"#B5B5BC",cursor:"grab",padding:0,flexShrink:0},title:"Drag to reorder",children:(0,f.jsx)(ir.A,{size:18})})),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsxs)("div",{style:{position:"relative",marginBottom:8},children:[(0,f.jsx)("input",{type:"text",value:s.title,onChange:e=>{r(a,"title",e.target.value),l(e.target.value,a)},onFocus:()=>d(a),onBlur:()=>setTimeout(()=>d(null),200),style:(0,m.A)((0,m.A)({},lc),{},{fontWeight:600,background:"#fff"}),placeholder:"Type to search services\u2026"}),c===a&&p.length>0&&(0,f.jsx)("div",{style:{position:"absolute",zIndex:50,width:"100%",marginTop:4,background:"#fff",border:"1px solid #E4E4E9",borderRadius:10,boxShadow:"0 8px 24px rgba(10,10,11,.12)",maxHeight:240,overflowY:"auto"},children:p.map(e=>(0,f.jsxs)("button",{type:"button",onClick:()=>x(a,e),className:"tg-row",style:{display:"block",width:"100%",textAlign:"left",padding:"11px 14px",border:"none",borderBottom:"1px solid #F2F2F5",background:"transparent",curs
1or:"pointer"},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:"#0A0A0B"},children:e.name}),(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0",marginTop:1},children:e.category}),(0,f.jsxs)("div",{className:"tg-mono",style:{fontSize:12,fontWeight:700,color:"#BF212F",marginTop:3},children:["$",e.price.toFixed(2),"hourly"===e.pricing_type&&(0,f.jsx)("span",{style:{marginLeft:3},children:"/hour"})]})]},e.id))})]}),(0,f.jsx)("textarea",{value:s.description,onChange:e=>r(a,"description",e.target.value),style:(0,m.A)((0,m.A)({},lc),{},{fontSize:13,resize:"vertical",background:"#fff"}),placeholder:"Service description\u2026",rows:2}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:10,flexWrap:"wrap"},children:[s.hourlyRate&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("label",{style:(0,m.A)((0,m.A)({},oc),{},{marginBottom:0}),children:"Hours"}),(0,f.jsx)("input",{type:"number",value:s.hours||"",onChange:e=>i(a,e.target.value),style:(0,m.A)((0,m.A)({},cc),{},{width:80,padding:"8px 10px",background:"#fff"}),placeholder:"1",step:"0.5",min:"0"}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontSize:12,color:"#9A9AA0"},children:["\xd7 $",s.hourlyRate.toFixed(2),"/hr"]})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("label",{style:(0,m.A)((0,m.A)({},oc),{},{marginBottom:0}),children:"Price (ex GST)"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,f.jsx)("span",{className:"tg-mono",style:{color:"#55555C"},children:"$"}),(0,f.jsx)("input",{type:"number",value:s.free_addon?0:s.price,onChange:e=>r(a,"price",e.target.value),style:(0,m.A)((0,m.A)({},cc),{},{width:130,padding:"8px 10px",textAlign:"right",background:s.hourlyRate||s.free_addon?"#F2F2F5":"#fff"}),placeholder:"0.00",step:"0.01",min:"0",readOnly:!!s.hourlyRate||!!s.free_addon})]})]}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:7,cursor:"pointer",fontSize:12.5,color:"#55555C",fontWeight:600},children:[(0,f.jsx)("input",{type:"checkbox",checked:s.optional||!1,onChange:e=>r(a,"optional",e.target.checked),style:{width:16,height:16,accentColor:"#BF212F",cursor:"pointer"}}),"Optional"]}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:7,cursor:"pointer",fontSize:12.5,color:s.free_addon?"#15803D":"#55555C",fontWeight:700},children:[(0,f.jsx)("input",{type:"checkbox",checked:s.free_addon||!1,onChange:e=>r(a,"free_addon",e.target.checked),style:{width:16,height:16,accentColor:"#16A34A",cursor:"pointer"}}),"FREE ADD-ON"]})]}),(0,f.jsxs)("div",{style:{marginTop:12,paddingTop:12,borderTop:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8},children:[(0,f.jsx)("span",{className:"tg-mono",style:{fontSize:9.5,letterSpacing:"0.1em",textTransform:"uppercase",color:"#9A9AA0"},children:"Optional Add-ons for this item"}),(0,f.jsxs)("button",{type:"button",onClick:()=>h(a),style:{display:"inline-flex",alignItems:"center",gap:4,border:"none",background:"transparent",color:"#BF212F",fontSize:12,fontWeight:600,cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:13})," Add Extra"]})]}),s.optional_extras&&s.optional_extras.length>0&&(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:s.optional_extras.map((e,t)=>(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid #EDEDF0",borderRadius:10,padding:12},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10,marginBottom:10},children:[(0,f.jsxs)("div",{style:{flex:1},children:[(0,f.jsx)("label",{style:oc,children:"Title"}),(0,f.jsx)("input",{type:"text",value:e.name,onChange:e=>u(a,t,"name",e.target.value),style:(0,m.A)((0,m.A)({},lc),{},{padding:"9px 11px"}),placeholder:"e.g., Add Photographer"})]}),(0,f.jsxs)("div",{style:{width:128},children:[(0,f.jsx)("label",{style:oc,children:"Price"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},children:[(0,f.jsx)("span",{className:"tg-mono",style:{color:"#55555C",fontSize:13},children:"+$"}),(0,f.jsx)("input",{type:"number",value:e.price,onChange:e=>u(a,t,"price",e.target.value),style:(0,m.A)((0,m.A)({},cc),{},{padding:"9px 10px",textAlign:"right"}),placeholder:"0.00",step:"0.01",min:"0"})]})]}),(0,f.jsx)("button",{type:"button",onClick:()=>b(a,t),style:{marginTop:24,width:28,height:28,border:"none",background:"#F7F7F9",borderRadius:7,color:"#9A9AA0",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},title:"Remove add-on",children:(0,f.jsx)(g.A,{size:15})})]}),(0,f.jsxs)("div",{style:{marginBottom:10},children:[(0,f.jsx)("label",{style:oc,children:"Description (optional)"}),(0,f.jsx)("textarea",{value:e.description||"",onChange:e=>u(a,t,"description",e.target.value),style:(0,m.A)((0,m.A)({},lc),{},{padding:"9px 11px",resize:"vertical"}
1),placeholder:"Brief description of what this add-on includes\u2026",rows:2})]}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,paddingTop:8,borderTop:"1px solid #EDEDF0",cursor:"pointer",fontSize:12,color:"#55555C"},children:[(0,f.jsx)("input",{type:"checkbox",id:"default-".concat(e.id),checked:e.selected_by_default||!1,onChange:e=>u(a,t,"selected_by_default",e.target.checked),style:{width:16,height:16,accentColor:"#BF212F",cursor:"pointer"}}),"Selected by default when client views proposal"]})]},e.id))}),(!s.optional_extras||0===s.optional_extras.length)&&(0,f.jsx)("p",{style:{fontSize:12,color:"#B5B5BC",fontStyle:"italic",margin:0},children:"No add-ons. Client can select these extras when viewing the proposal."})]})]}),n.service_items.length>1&&(0,f.jsx)("button",{type:"button",onClick:()=>o(a),style:{marginTop:6,width:28,height:28,border:"none",background:"#F7F7F9",borderRadius:7,color:"#9A9AA0",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},title:"Remove service item",children:(0,f.jsx)(g.A,{size:16})})]})})},pc=()=>{var e,t,s;const n=(0,r.Zp)(),i=(0,r.zy)(),l=(null===(e=i.state)||void 0===e?void 0:e.leadData)||(null===(t=i.state)||void 0===t?void 0:t.prefilledClient)||i.state,c=null===(s=i.state)||void 0===s?void 0:s.duplicateFrom,{proposalId:d}=(0,r.g)(),p=!!d,x=!!c,[h,b]=(0,a.useState)(null),[y,v]=(0,a.useState)(!1),[j,w]=(0,a.useState)(p),[N,A]=(0,a.useState)(!1),[k,S]=(0,a.useState)([]),[_,C]=(0,a.useState)(null),[F,E]=(0,a.useState)(!1),[T,z]=(0,a.useState)({client_id:(null===l||void 0===l?void 0:l.client_id)||"",client_company:(null===l||void 0===l?void 0:l.client_company)||"",contact_name:(null===l||void 0===l?void 0:l.contact_name)||"",position:(null===l||void 0===l?void 0:l.position)||"",email:(null===l||void 0===l?void 0:l.email)||"",phone:(null===l||void 0===l?void 0:l.phone)||"",project_name:(null===l||void 0===l?void 0:l.project_name)||"",job_date:(null===l||void 0===l?void 0:l.job_date)||"",job_location:"",start_time:"",service_items:[{title:"",description:"",price:0,hours:null,hourlyRate:null,optional:!1,free_addon:!1,order:0,optional_extras:[]}],client_discount:0,client_discount_type:"fixed",client_discount_reason:"",incentive_enabled:!1,incentive_discount:0,incentive_discount_type:"percentage",incentive_expiry_date:"",service_summary:"",deliverables:[],important_notes:[],booking_terms:"",hero_image:"",hero_video:""}),[B,D]=(0,a.useState)(!1),[R,P]=(0,a.useState)(!0),[W,O]=(0,a.useState)(!1),[L,M]=(0,a.useState)([]),[q,H]=(0,a.useState)((null===l||void 0===l?void 0:l.client_id)||"");(0,a.useEffect)(()=>{const e=(0,o.cd)(n);if(e)if(b(e),J(),p)V();else if(x)U();else{const e=new URLSearchParams(window.location.search).get("clientId");e&&Y(e),G()}},[n,d]);const U=()=>{c&&(z({client_id:c.client_id||"",client_company:c.client_company||"",contact_name:c.contact_name||"",position:c.position||"",email:c.email||"",phone:c.phone||"",project_name:c.project_name?"".concat(c.project_name," (Copy)"):"",job_date:c.job_date||"",job_location:c.job_location||"",start_time:c.start_time||"",service_items:(c.service_items||[{title:"",description:"",price:0,hours:null,hourlyRate:null,optional:!1,order:0}]).map((e,t)=>(0,m.A)((0,m.A)({},e),{},{optional:void 0!==e.optional&&e.optional,order:void 0!==e.order?e.order:t})),client_discount:c.client_discount||0,client_discount_type:c.client_discount_type||"fixed",client_discount_reason:c.client_discount_reason||"",incentive_enabled:c.incentive_enabled||!1,incentive_discount:c.incentive_discount||0,incentive_discount_type:c.incentive_discount_type||"percentage",incentive_expiry_date:c.incentive_expiry_date||"",service_summary:c.service_summary||"",deliverables:c.deliverables||[],important_notes:c.important_notes||[],booking_terms:c.booking_terms||"",hero_image:c.hero_image||"",hero_video:c.hero_video||""}),c.client_id&&H(c.client_id))},G=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/settings"),{headers:{Authorization:"Bearer ".concat(t)}});let a="";if(s.ok){const e=await s.json();a=e.default_booking_terms||""}const n=["Desk space will be required for our crew, cameras and editing equipment. This should be setup within the main conference room, so we can see what is happening at all times, even when loading same-day content.","High Speed Internet connection will be required to facilitate delivery of same-day content.","Additional hours if requested last minute will be charged at $250+GST per hour, per crew member on the day of the event.","Client to arrange Access pass (lanyards) for all area access of the event."];z(e=>(0,m.A)((0,m.A)({},e),{},{important_notes:n,booking_terms:a}))}catch(t){console.error("Error loading default content:",t);const e=["Desk space will be required for our crew, cameras and editing equipment. This should be setup within the main conference room, so we can see what is happening at all times, even when loading same-day content.","High Speed Internet connection will be required to facilitate delivery of same-day content.","Additional hours if requested last minute will be charged at $250+GST per hour, per crew member on the day of the event.","Client to arrange Access pass (lanyards) for all area access of the event."];z(t=>(0,m.A)((0,m.A)({},t),{},{important_notes:e}))}},V=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/proposals/").concat(d),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();if("Accepted"===e.status)return alert("Cannot edit accepted proposals"),void n("/admin/proposals");z({client_id:e.client_id||"",client_company:e.client_company||"",contact_name:e.contact_name||"",position:e.position||"",email:e.email||"",phone:e.phone||"",project_name:e.project_name||"",job_date:e.job_date||"",job_location:e.job_location||"",start_time:e.start_time||"",service_items:(e.service_items||[{title:"",description:"",price:0,hours:null,hourlyRate:null,optional:!1,order:0}]).map((e,t)=>(0,m.A)((0,m.A)({},e),{},{optional:void 0!==e.optional&&e.optional,order:void 0!==e.order?e.order:t})),client_discount:e.client_discount||0,client_discount_type:e.client_discount_type||"fixed",client_discount_reason:e.client_discount_reason||"",incentive_enabled:e.incentive_enabled||!1,incentive_discount:e.incentive_discount||0,incentive_discount_type:e.incentive_discount_type||"percentage",incentive_expiry_date:e.incentive_expiry_date||"",service_summary:e.service_summary||"",deliverables:e.deliverables||[],important_notes:e.important_notes||[],booking_terms:e.booking_terms||"",hero_image:e.hero_image||"",hero_video:e.hero_video||""}),e.client_id&&H(e.client_id)}else alert("Failed to load proposal"),n("/admin/proposals")}catch(t){console.error("Error loading proposal:",t),alert("An error occurred"),n("/admin/proposals")}finally{w(!1)}},J=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();M(e.clients||[])}}catch(t){console.error("Error loading clients:",t)}},Y=async e=>{const t="object"===typeof e&&null!==e,s=t?null===e||void 0===e?void 0:e.id:e;if(H(s),s)try{var a;const n=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token;if(t){const t=e;let a=t.parent_company_name||t.company_name;if(!a&&t.parent_company_id){const e=await fetch("".concat(I.fn,"/api/clients/").concat(t.parent_company_id),{headers:{Authorization:"Bearer ".concat(n)}});if(e.ok){const t=await e.json();a=t.company_name}}const r=t.contact_name||(t.first_name&&t.last_name?"".concat(t.first_name," ").concat(t.last_name):"")||t.first_name||t.last_name||"";return void z(e=>(0,m.A)((0,m.A)({},e),{},{client_id:s,client_company:a||"",contact_name:r,position:t.position||"",email:t.email||"",phone:t.phone||""}))}const r=await fetch("".concat(I.fn,"/api/clients/").concat(s),{headers:{Authorization:"Bearer ".concat(n)}});if(r.ok){const e=await r.json();let t=e.company_name;if(e.parent_company_id){const s=await fetch("".concat(I.fn,"/api/clients/").concat(e.parent_company_id),{headers:{Authorization:"Bearer ".concat(n)}});if(s.ok){const e=await s.json();t=e.company_name}}z(a=>(0,m.A)((0,m.A)({},a),{},{client_id:s,client_company:t,contact_name:e.contact_name,position:e.position||"",email:e.email,phone:e.phone}))}}catch(n){console.error("Error loading contact:",n)}else z(e=>(0,m.A)((0,m.A)({},e),{},{client_id:"",client_company:"",contact_name:"",position:"",email:"",ph
1one:""}))},K=(e,t)=>{z(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t}))},Z=(e,t,s)=>{const a=[...T.service_items];"free_addon"===t?(a[e].free_addon=s,s&&(a[e].price=0)):a[e][t]="price"===t?parseFloat(s)||0:s,z(e=>(0,m.A)((0,m.A)({},e),{},{service_items:a}))},$=async(e,t)=>{if(!e||e.length<2)return S([]),void C(null);E(!0),C(t);try{var s;const t=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,a=await fetch("".concat(I.fn,"/api/services/search?q=").concat(encodeURIComponent(e)),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){const e=await a.json();S(e.services||[])}}catch(a){console.error("Error searching services:",a),S([])}finally{E(!1)}},Q=(e,t)=>{const s=[...T.service_items];"hourly"===t.pricing_type?s[e]={title:t.name,description:t.description,price:t.price,hours:1,hourlyRate:t.price}:s[e]={title:t.name,description:t.description,price:t.price,hours:null,hourlyRate:null},z(e=>(0,m.A)((0,m.A)({},e),{},{service_items:s})),S([]),C(null)},X=(e,t)=>{const s=[...T.service_items],a=s[e].hourlyRate;a&&(s[e].hours=parseFloat(t)||0,s[e].price=(parseFloat(t)||0)*a,z(e=>(0,m.A)((0,m.A)({},e),{},{service_items:s})))},ee=e=>{const t=[...T.service_items],s={id:"extra-".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),name:"",description:"",price:0,selected_by_default:!1};t[e].optional_extras=[...t[e].optional_extras||[],s],z(e=>(0,m.A)((0,m.A)({},e),{},{service_items:t}))},te=(e,t,s,a)=>{const n=[...T.service_items];n[e].optional_extras||(n[e].optional_extras=[]),n[e].optional_extras[t][s]="price"===s?parseFloat(a)||0:a,z(e=>(0,m.A)((0,m.A)({},e),{},{service_items:n}))},se=(e,t)=>{const s=[...T.service_items];s[e].optional_extras=s[e].optional_extras.filter((e,s)=>s!==t),z(e=>(0,m.A)((0,m.A)({},e),{},{service_items:s}))},ae=e=>{if(T.service_items.length>1){const t=T.service_items.filter((t,s)=>s!==e).map((e,t)=>(0,m.A)((0,m.A)({},e),{},{order:t}));z(e=>(0,m.A)((0,m.A)({},e),{},{service_items:t}))}},ne=(0,nc.FR)((0,nc.MS)(nc.AN),(0,nc.MS)(nc.uN,{coordinateGetter:rc.JR})),re=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!y&&(q?T.project_name&&T.job_date?0!==T.service_items.length&&!T.service_items.some(e=>!e.title||!e.description||e.price<=0&&!e.free_addon)||(alert("Please add at least one service item with description and price"),0):(alert("Please fill in all required fields"),0):(alert("Please select a company and contact"),0))){v(!0);try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token;if(p){const t=await fetch("".concat(I.fn,"/api/proposals/").concat(d),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify(T)});if((await t.json()).success)if(e){const e=await fetch("".concat(I.fn,"/api/proposals/").concat(d,"/send"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}});(await e.json()).success?(A(!0),setTimeout(()=>{n("/admin/proposals")},2e3)):(alert("Proposal updated but failed to send. You can send it from the proposals list."),n("/admin/proposals"))}else A(!0),setTimeout(()=>{n("/admin/proposals")},2e3);else alert("Failed to update proposal. Please try again.")}else{const t=await fetch("".concat(I.fn,"/api/proposals"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify(T)});if(!t.ok){const e=await t.text();throw console.error("Server error response:",e),new Error("Server returned ".concat(t.status,": ").concat(t.statusText))}const a=await t.json();if(a.success){const t=a.proposal_id;if(e){const e=await fetch("".concat(I.fn,"/api/proposals/").concat(t,"/send"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}});if(!e.ok)throw new Error("Failed to send proposal: ".concat(e.status));(await e.json()).success?(A(!0),setTimeout(()=>{n("/admin/proposals")},2e3)):(alert("Proposal created but failed to send. You can send it from the proposals list."),n("/admin/proposals"))}else A(!0),setTimeout(()=>{n("/admin/proposals")},2e3)}else alert("Failed to create proposal. Please try again.")}}catch(s){console.error("Error saving proposal:",s),alert("An error occurred. Please try again.")}finally{v(!1)}}},{subtotal:ie,clientDiscount:oe,gst:le,total:ce,incentiveTotal:de,isIncentiveValid:me}=(()=>{const e=T.service_items.reduce((e,t)=>
1e+(parseFloat(t.price)||0),0);let t=0;t="percentage"===T.client_discount_type?e*(parseFloat(T.client_discount)/100):parseFloat(T.client_discount)||0;const s=e-t,a=.1*s,n=s+a;let r=n;const i=(new Date).toISOString().split("T")[0],o=T.incentive_enabled&&T.incentive_expiry_date&&T.incentive_expiry_date>=i;if(o){let e=0;e="percentage"===T.incentive_discount_type?n*(parseFloat(T.incentive_discount)/100):parseFloat(T.incentive_discount)||0,r=n-e}return{subtotal:e,clientDiscount:t,gst:a,total:n,incentiveTotal:r,isIncentiveValid:o}})(),pe={toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],["clean"]]},xe=p?"Edit Proposal":x?"Duplicate Proposal":"New Proposal",he=(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>n("/admin/dashboard"),type:"button",style:{display:"inline-flex",alignItems:"center",gap:7,fontSize:13,fontWeight:600,color:"#55555C",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{size:15})," Back"]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:xe}),(0,f.jsx)("p",{style:{fontSize:12.5,color:"#9A9AA0",margin:"2px 0 0"},children:p?"Update the details below":x?"Duplicated from existing proposal \u2014 edit as needed":"Fill in the details below to create a proposal"})]}),(0,f.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:10},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>re(!1),disabled:y,style:{display:"inline-flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"10px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer",opacity:y?.6:1},children:[(0,f.jsx)(ia.A,{size:15})," ",y?"Saving\u2026":"Save as Draft"]}),(0,f.jsxs)("button",{type:"button",onClick:()=>re(!0),disabled:y,className:"tg-btn-primary",style:{display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",border:"none",borderRadius:9,padding:"10px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,color:"#fff",cursor:"pointer",opacity:y?.6:1},children:[(0,f.jsx)(st.A,{size:15})," ",y?"Sending\u2026":"Save & Send"]})]})]});return h?j?(0,f.jsxs)(ta,{title:xe,meta:"SALES \xb7 PROPOSAL",children:[he,(0,f.jsx)(Ws,{rows:8})]}):(0,f.jsxs)(ta,{title:xe,meta:"SALES \xb7 PROPOSAL",children:[(0,f.jsx)("style",{children:"\n .proposal-quill-editor .ql-container { min-height: 200px; background:#fff; border-bottom-left-radius:9px; border-bottom-right-radius:9px; }\n .proposal-quill-editor .ql-toolbar { border-top-left-radius:9px; border-top-right-radius:9px; border-color:#E4E4E9; }\n .proposal-quill-editor .ql-container { border-color:#E4E4E9; }\n .proposal-quill-editor .ql-editor { color:#0A0A0B; min-height:200px; }\n .proposal-quill-editor .ql-editor.ql-blank::before { color:#9A9AA0; font-style:normal; }\n .proposal-service-summary .ql-container { min-height: 300px; }\n .proposal-service-summary .ql-editor { min-height: 300px; }\n"}),N&&(0,f.jsxs)("div",{style:{position:"fixed",top:16,right:16,background:"#15803D",color:"#fff",padding:"12px 20px",borderRadius:10,boxShadow:"0 8px 24px rgba(10,10,11,.18)",zIndex:80,display:"flex",alignItems:"center",gap:9,fontSize:13.5,fontWeight:600},children:[(0,f.jsx)(st.A,{size:17}),(0,f.jsxs)("span",{children:["Proposal ",p?"updated":"created"," successfully!"]})]}),he,(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"1.62fr 1fr",gap:20,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)(dc,{title:"Client Information",children:[(0,f.jsx)(Yo,{allClients:L,selectedContactId:q,onContactSelect:Y,label:"Select Client for this Proposal",variant:"light"}),(0,f.jsx)("p",{style:{fontSize:11.5,color:"#9A9AA0",marginTop:10,marginBottom:0},children:"Select a company first, then choose a contact from that c
1ompany. The contact information is automatically populated below."}),q&&T.client_company&&(0,f.jsxs)("div",{style:{marginTop:16,padding:16,background:"#FBFBFC",border:"1px solid #EDEDF0",borderRadius:11},children:[(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"#9A9AA0",marginBottom:12},children:"Selected Contact Details"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:oc,children:"Company Name"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},lc),{},{background:"#fff"}),children:T.client_company||"-"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:oc,children:"Contact Name"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},lc),{},{background:"#fff"}),children:T.contact_name||"-"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:oc,children:"Position/Title"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},lc),{},{background:"#fff"}),children:T.position||"-"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:oc,children:"Email Address"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},lc),{},{background:"#fff"}),children:T.email||"-"})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:oc,children:"Phone Number"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},cc),{},{background:"#fff"}),children:T.phone||"-"})]})]})]}),!q&&(0,f.jsxs)("div",{style:{marginTop:14,padding:"12px 14px",background:"#FEF3C7",border:"1px solid #FDE68A",borderRadius:10,fontSize:12.5,color:"#92400E"},children:[(0,f.jsx)("strong",{children:"Note:"})," Please select a company and contact above to continue. All new proposals must be assigned to an existing contact."]})]}),(0,f.jsx)(dc,{title:"Project Information",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:oc,children:"Project Name *"}),(0,f.jsx)("input",{type:"text",value:T.project_name,onChange:e=>K("project_name",e.target.value),style:lc,placeholder:"Annual Conference 2025"})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsxs)("label",{style:oc,children:["Header Background ",(0,f.jsx)("span",{style:{color:"#9A9AA0",fontWeight:400},children:"(optional \u2014 a generic graphic is used by default)"})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16},children:[(0,f.jsx)("div",{style:{width:128,height:80,borderRadius:10,overflow:"hidden",border:"1px solid #E4E4E9",background:"#0A0A0B",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:T.hero_video?(0,f.jsx)("video",{src:sc[T.hero_video],muted:!0,loop:!0,autoPlay:!0,playsInline:!0,style:{width:"100%",height:"100%",objectFit:"cover"}}):(0,f.jsx)("img",{src:T.hero_image||"/hero-background.jpg",alt:"Header preview",style:{width:"100%",height:"100%",objectFit:"cover"}})}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,f.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:8,padding:"9px 14px",background:"#0A0A0B",color:"#fff",fontSize:13,fontWeight:600,borderRadius:9,cursor:"pointer",width:"fit-content"},children:[B?"Uploading\u2026":T.hero_image?"Change image":"Upload image",(0,f.jsx)("input",{type:"file",accept:"image/png,image/jpeg,image/webp",style:{display:"none"},onChange:async e=>{var t;const s=null===(t=e.target.files)||void 0===t?void 0:t[0];if(s){D(!0);try{var a;const e=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,t=new FormData;t.append("file",s);const n=await fetch("".concat(I.fn,"/api/proposals/upload-hero"),{method:"POST",headers:{Authorization:"Bearer ".concat(e)},body:t}),r=await n.json();r.success?z(e=>(0,m.A)((0,m.A)({},e),{},{hero_image:r.url,hero_video:""})):alert(r.error||"Image upload failed")}catch(n){alert("Image upload failed")}finally{D(!1),e.target.value=""}}},disabled:B})]}),(T.hero_image||T.hero_video)&&(0,f.jsx)("button",{type:"button",onClick:()=>z(e=>(0,m.A)((0,m.A)({},e),{},{hero_image:"",hero_video:""})),style:{fontSize:11.5,color:"#9A9AA0",background:"none",border:"none",cursor:"pointer",textAlign:"left",padding:0},children:"Use default graphic"})]})]}),(0,f.jsxs)("div",{style:{marginTop:12},children:[(0,f.jsx)("label",{style:oc,children:"\u2026or use a stored background video"}),(0,f.jsxs)("select",{value:T.hero_video,onChange:e=>z(t=>(0,m.A)((0,m.A)({},t),{},{hero_video:e.target.value,hero_image:e.target.value?"":t.hero_image})),style:(0,m.A)((0,m.A)({},lc),{},{maxWidth:320}),children:[(0,f.jsx)("option",{value:"",children:"None (use image / default)"}),tc.map(e=>(0,f.jsx)("option",{value:e.value,children:e.label},e.value))]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:oc,children:"Job Date *"}),(0,f.jsx)("input",{type:"date",value:T.job_date,onChange:e=>K("job_date",e.target.value),style:cc})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:oc,children:"Start Time (Optional)"}),(0,f.jsx)("input",{type:"time",value:T.start_time,onChange:e=>K("start_time",e.target.value),style:cc})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:oc,children:"Job Location"}),(0,f.jsx)("input",{type:"text",value:T.job_location,onChange:e=>K("job_location",e.target.value),style:lc,placeholder:"123 Event Street, Melbourne VIC 3000"})]})]})}),(0,f.jsxs)(dc,{title:"Service Summary",right:!R&&(0,f.jsxs)("button",{type:"button",onClick:()=>P(!0),style:{display:"inline-flex",alignItems:"center",gap:6,border:"none",background:"transparent",color:"#BF212F",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:[(0,f.jsx)(oa.A,{size:14})," Edit"]}),children:[(0,f.jsx)("p",{style:{fontSize:12.5,color:"#9A9AA0",margin:"-6px 0 14px"},children:"Describe the services being provided for this event"}),R?(0,f.jsx)(zl.A,{value:T.service_summary,onChange:e=>K("service_summary",e),className:"proposal-quill-editor proposal-service-summary",theme:"snow",modules:pe}):(0,f.jsx)("div",{className:"prose",style:{maxWidth:"none",background:"#FBFBFC",padding:18,borderRadius:10,border:"1px solid #EDEDF0",minHeight:300,color:"#0A0A0B"},dangerouslySetInnerHTML:{__html:or.default.sanitize(T.service_summary||'<p style="color:#9A9AA0;">No service summary added yet</p>')}})]}),(0,f.jsxs)(dc,{title:"Deliverables",children:[(0,f.jsx)("p",{style:{fontSize:12.5,color:"#9A9AA0",margin:"-6px 0 14px"},children:"List what will be delivered to the client"}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[T.deliverables.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)("span",{style:{color:"#55555C",fontWeight:700},children:"\u2022"}
1),(0,f.jsx)("input",{type:"text",value:e,onChange:e=>((e,t)=>{z(s=>(0,m.A)((0,m.A)({},s),{},{deliverables:s.deliverables.map((s,a)=>a===e?t:s)}))})(t,e.target.value),style:(0,m.A)((0,m.A)({},lc),{},{flex:1}),placeholder:"e.g., Professionally edited highlight video (3-5 minutes)"}),(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{z(t=>(0,m.A)((0,m.A)({},t),{},{deliverables:t.deliverables.filter((t,s)=>s!==e)}))})(t),style:{width:28,height:28,border:"none",background:"#F7F7F9",borderRadius:7,color:"#9A9AA0",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},title:"Remove deliverable",children:(0,f.jsx)(g.A,{size:15})})]},t)),(0,f.jsxs)("button",{type:"button",onClick:()=>{z(e=>(0,m.A)((0,m.A)({},e),{},{deliverables:[...e.deliverables,""]}))},style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"10px 16px",border:"1px dashed #D5D5DB",background:"#FBFBFC",color:"#55555C",borderRadius:10,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",width:"100%"},children:[(0,f.jsx)(ls.A,{size:16})," Add Deliverable"]})]})]}),(0,f.jsxs)(dc,{title:"Service Quote",right:(0,f.jsxs)("button",{type:"button",onClick:()=>{z(e=>(0,m.A)((0,m.A)({},e),{},{service_items:[...e.service_items,{title:"",description:"",price:0,hours:null,hourlyRate:null,optional:!1,free_addon:!1,order:e.service_items.length,optional_extras:[]}]}))},style:{display:"inline-flex",alignItems:"center",gap:6,background:"#0A0A0B",border:"none",borderRadius:8,padding:"7px 12px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12,fontWeight:600,color:"#fff",cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:14})," Add Service"]}),children:[(0,f.jsx)(nc.Mp,{sensors:ne,collisionDetection:nc.fp,onDragEnd:e=>{const{active:t,over:s}=e;t.id!==s.id&&z(e=>{const a=e.service_items.findIndex((e,s)=>"item-".concat(s)===t.id),n=e.service_items.findIndex((e,t)=>"item-".concat(t)===s.id),r=(0,rc.be)(e.service_items,a,n).map((e,t)=>(0,m.A)((0,m.A)({},e),{},{order:t}));return(0,m.A)((0,m.A)({},e),{},{service_items:r})})},children:(0,f.jsx)(rc.gB,{items:T.service_items.map((e,t)=>"item-".concat(t)),strategy:rc._G,children:T.service_items.map((e,t)=>(0,f.jsx)(mc,{id:"item-".concat(t),item:e,index:t,formData:T,handleServiceItemChange:Z,handleHoursChange:X,removeServiceItem:ae,searchServices:$,activeSearchIndex:_,setActiveSearchIndex:C,searchResults:k,selectService:Q,addExtraToItem:ee,updateExtraInItem:te,removeExtraFromItem:se},"item-".concat(t)))})}),(0,f.jsxs)("div",{style:{marginTop:6,paddingTop:14,borderTop:"1px solid #EDEDF0",display:"flex",flexDirection:"column",gap:9},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsx)("span",{style:{color:"#55555C"},children:"Subtotal"}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontWeight:600},children:["$",ie.toFixed(2)]})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsx)("span",{style:{color:"#55555C"},children:"GST (10%)"}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontWeight:600},children:["$",le.toFixed(2)]})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",paddingTop:11,borderTop:"1px solid #EDEDF0"},children:[(0,f.jsx)("span",{style:{fontWeight:700,fontSize:15},children:"Total (inc GST)"}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontWeight:700,fontSize:18},children:["$",ce.toFixed(2)]})]})]})]}),(0,f.jsxs)(dc,{title:"Pricing",children:[(0,f.jsxs)("div",{style:{padding:16,background:"#FBFBFC",border:"1px solid #EDEDF0",borderRadius:11,marginBottom:16},children:[(0,f.jsxs)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:13.5,marginBottom:12},children:["Client Discount ",(0,f.jsx)("span",{style:{color:"#9A9AA0",fontWeight:400},children:"(optional)"})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:oc,children:"Discount Type"}
1),(0,f.jsxs)("select",{value:T.client_discount_type,onChange:e=>K("client_discount_type",e.target.value),style:(0,m.A)((0,m.A)({},lc),{},{background:"#fff"}),children:[(0,f.jsx)("option",{value:"fixed",children:"Fixed Amount ($)"}),(0,f.jsx)("option",{value:"percentage",children:"Percentage (%)"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{style:oc,children:["Discount ","percentage"===T.client_discount_type?"(%)":"($)"]}),(0,f.jsx)("input",{type:"number",value:T.client_discount,onChange:e=>K("client_discount",parseFloat(e.target.value)||0),style:(0,m.A)((0,m.A)({},cc),{},{background:"#fff"}),placeholder:"percentage"===T.client_discount_type?"10":"500.00",step:"percentage"===T.client_discount_type?"0.1":"0.01",min:"0",max:"percentage"===T.client_discount_type?"100":void 0})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:oc,children:"Reason for Discount"}),(0,f.jsx)("input",{type:"text",value:T.client_discount_reason,onChange:e=>K("client_discount_reason",e.target.value),style:(0,m.A)((0,m.A)({},lc),{},{background:"#fff"}),placeholder:"e.g., Repeat client"})]})]})]}),(0,f.jsxs)("div",{style:{padding:16,background:"#FBFBFC",border:"1px solid #EDEDF0",borderRadius:11},children:[(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:10,cursor:"pointer",marginBottom:T.incentive_enabled?12:0},children:[(0,f.jsx)("input",{type:"checkbox",checked:T.incentive_enabled,onChange:e=>K("incentive_enabled",e.target.checked),style:{width:16,height:16,accentColor:"#BF212F",cursor:"pointer"}}),(0,f.jsx)("span",{className:"tg-ui",style:{fontWeight:700,fontSize:13.5},children:"Enable Early Bird Incentive Discount"})]}),T.incentive_enabled&&(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:oc,children:"Discount Type"}),(0,f.jsxs)("select",{value:T.incentive_discount_type,onChange:e=>K("incentive_discount_type",e.target.value),style:(0,m.A)((0,m.A)({},lc),{},{background:"#fff"}),children:[(0,f.jsx)("option",{value:"percentage",children:"Percentage (%)"}),(0,f.jsx)("option",{value:"fixed",children:"Fixed Amount ($)"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{style:oc,children:["Discount ","percentage"===T.incentive_discount_type?"(%)":"($)"]}),(0,f.jsx)("input",{type:"number",value:T.incentive_discount,onChange:e=>K("incentive_discount",parseFloat(e.target.value)||0),style:(0,m.A)((0,m.A)({},cc),{},{background:"#fff"}),placeholder:"percentage"===T.incentive_discount_type?"10":"500.00",step:"percentage"===T.incentive_discount_type?"0.1":"0.01",min:"0",max:"percentage"===T.incentive_discount_type?"100":void 0})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:oc,children:"Book Before Date"}),(0,f.jsx)("input",{type:"date",value:T.incentive_expiry_date,onChange:e=>K("incentive_expiry_date",e.target.value),style:(0,m.A)((0,m.A)({},cc),{},{background:"#fff"})})]})]})]})]}),(0,f.jsxs)(dc,{title:"Important Proposal Notes",children:[(0,f.jsx)("p",{style:{fontSize:12.5,color:"#9A9AA0",margin:"-6px 0 14px"},children:"Key details and requirements for this event"}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[T.important_notes.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10},children:[(0,f.jsx)("span",{style:{color:"#55555C",fontWeight:700,marginTop:10},children:"\u2022"}),(0,f.jsx)("textarea",{value:e,onChange:e=>((e,t)=>{z(s=>(0,m.A)((0,m.A)({},s),{},{important_notes:s.important_notes.map((s,a)=>a===e?t:s)}))})(t,e.target.value),style:(0,m.A)((0,m.A)({},lc),{},{flex:1,resize:"vertical"}),rows:2,placeholder:"e.g., Desk space required for crew equipment"}),(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{z(t=>(0,m.A)((0,m.A)({},t),{},{important_notes:t.important_notes.filter((t,s)=>s!==e)}))})(t),style:{marginTop:4,width:28,height:28,border:"none",background:"#F7F7F9",borderRadius:7,color:"#9A9AA0",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},title:"Remove note",children:(0,f.jsx)(g.A,{size:15})})]},t)),(0,f.jsxs)("button",{type:"button",onClick:()=>{z(e=>(0,m.A)((0,m.A)({},e),{},{important_notes:[...e.important_notes,""]}))},style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"10px 16px",border:"1px dashed #D5D5DB",background:"#FBFBFC",color:"#55555C",borderRadius:10,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",width:"100%"},children:[(0,f.jsx)(ls.A,{size:16})," Add Important Note"]})]})]}),(0,f.jsxs)(dc,{title:"Booking Terms & Conditions",right:!W&&(0,f.jsxs)("button",{type:"button",onClick:()=>O(!0),style:{display:"inline-flex",alignItems:"center",gap:6,border:"none",background:"transparent",color:"#BF212F",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:[(0,f.jsx)(oa.A,{size:14})," Edit"]}),children:[(0,f.jsx)("p",{style:{fontSize:12.5,color:"#9A9AA0",margin:"-6px 0 14px"},children:"Default terms are pre-filled. Click Edit to customize."}),W?(0,f.jsx)(zl.A,{value:T.booking_terms,onChange:e=>K("booking_terms",e),className:"proposal-quill-editor",theme:"snow",modules:pe}):(0,f.jsx)("div",{className:"prose",style:{maxWidth:"none",background:"#FBFBFC",padding:18,borderRadius:10,border:"1px solid #EDEDF0",minHeight:200,color:"#0A0A0B"},dangerouslySetInnerHTML:{__html:or.default.sanitize(T.booking_terms)}})]})]}),(0,f.jsxs)("div",{style:{position:"sticky",top:84,display:"flex",flexDirection:"column",gap:16},children:[(0,f.jsxs)(Ls,{style:{overflow:"hidden"},children:[(0,f.jsx)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0"},className:"tg-ui",children:(0,f.jsx)("span",{style:{fontWeight:700,fontSize:15},children:"Summary"})}),(0,f.jsxs)("div",{style:{padding:"18px 20px",display:"flex",flexDirection:"column",gap:11},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsx)("span",{style:{color:"#55555C"},children:"Subtotal"}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontWeight:600},children:["$",ie.toFixed(2)]})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsxs)("span",{style:{color:"#55555C"},children:["Discount","percentage"===T.client_discount_type&&oe>
10?" (".concat(T.client_discount,"%)"):""]}),(0,f.jsxs)("span",{className:"tg-mono",style:{color:oe>0?"#15803D":"#9A9AA0",fontWeight:oe>0?600:400},children:["\u2212$",oe.toFixed(2)]})]}),oe>0&&T.client_discount_reason&&(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",textAlign:"right",marginTop:-6},children:T.client_discount_reason}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsx)("span",{style:{color:"#55555C"},children:"GST (10%)"}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontWeight:600},children:["$",le.toFixed(2)]})]}),me&&(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsx)("span",{style:{color:"#55555C"},children:"Early-bird price"}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontWeight:600,color:"#15803D"},children:["$",de.toFixed(2)]})]})]}),(0,f.jsxs)("div",{style:{margin:"0 16px 16px",borderRadius:12,background:"#0A0A0B",padding:18,position:"relative",overflow:"hidden"},children:[(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-20,bottom:-20,width:84,opacity:.07}}),(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"#7A7A82",marginBottom:10},children:"Total (inc GST)"}),(0,f.jsx)(zs,{amount:ce,size:30,mutedSize:16,color:"#fff",mutedColor:"#7A7A82"})]}),(0,f.jsxs)("div",{style:{padding:"0 20px 20px",display:"flex",flexDirection:"column",gap:10},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>re(!0),disabled:y,className:"tg-btn-primary",style:{width:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,background:"#BF212F",border:"none",borderRadius:10,padding:13,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:14,fontWeight:600,color:"#fff",cursor:"pointer",opacity:y?.6:1},children:[(0,f.jsx)(st.A,{size:16})," ",y?"Sending\u2026":"Save & Send to Client"]}),(0,f.jsxs)("button",{type:"button",onClick:()=>re(!1),disabled:y,style:{width:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:10,padding:13,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:14,fontWeight:600,color:"#333",cursor:"pointer",opacity:y?.6:1},children:[(0,f.jsx)(ia.A,{size:16})," ",y?"Saving\u2026":"Save as Draft"]}),(0,f.jsx)("button",{type:"button",onClick:()=>n("/admin/proposals"),style:{width:"100%",background:"transparent",border:"none",padding:4,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,color:"#9A9AA0",cursor:"pointer"},children:"Cancel"})]})]}),(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:14,padding:"16px 18px",display:"flex",gap:11,alignItems:"flex-start"},children:[(0,f.jsx)(u.A,{size:17,color:"#0FA3A3",style:{flexShrink:0,marginTop:1}}),(0,f.jsx)("p",{style:{fontSize:12.5,color:"#55555C",lineHeight:1.55,margin:0},children:"The client receives a branded proposal link. Optional line items and add-ons can be toggled by the client when they view the proposal."})]})]})]})]}):null},xc=e=>{let{proposalRef:t,projectName:s,amount:n}=e;const r=(0,a.useRef)(null);return(0,a.useEffect)(()=>{var e;const t=window.scrollY||document.documentElement.scrollTop,s=document.documentElement,a=document.body,n={htmlOverflow:s.style.overflow,position:a.style.position,top:a.style.top,left:a.style.left,right:a.style.right,width:a.style.width,overflow:a.style.overflow};return s.style.overflow="hidden",a.style.position="fixed",a.style.top="-".concat(t,"px"),a.style.left="0",a.style.right="0",a.style.width="100%",a.style.overflow="hidden",null===(e=r.current)||void 0===e||e.focus(),()=>{s.style.overflow=n.htmlOverflow,a.style.position=n.position,a.style.top=n.top,a.style.left=n.left,a.style.right=n.right,a.style.width=n.width,a.style.overflow=n.overflow,window.scrollTo(0,t)}},[]),(0,f.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":"proposal-declined-heading",className:"pdm-veil fixed inset-0 z-50 flex items-center justify-center overflow-y-auto",style:{padding:"clamp(12px, 3vw, 40px)",background:"rgba(10,10,11,0.74)",backdropFilter:"blur(10px)"},children:[(0,f.jsx)("style",{children:"\n @media (prefers-reduced-motion: no-preference) {\n .pdm-veil { animation: pdmVeilIn 260ms cubic-bezier(0.16,1,0.3,1) both; }\n .pdm-dialog { animation: pdmDialogIn 380ms cubic-bezier(0.16,1,0.3,1) both; }\n }\n @keyframes pdmVeilIn { from { opacity: 0; } to { opacity: 1; } }\n @keyframes pdmDialogIn { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }\n"}),(0,f.jsxs)("div",{className:"pdm-dialog relative w-full overflow-hidden rounded-[14px] bg-white",style:{maxWidth:"720px",boxShadow:"0 40px 90px rgba(10,10,11,0.45)"},children:[(0,f.jsxs)("div",{className:"relative",style:{background:"#0A0A0B",padding:"clamp(22px,4vw,32px) clamp(20px,4vw,40px) clamp(20px,4vw,28px)"},children:[(0,f.jsx)("div",{className:"pointer-events-none absolute",style:{right:"-60px",top:"-40px",width:"260px",height:"260px",borderRadius:"50%",background:"radial-gradient(circle, rgba(191,33,47,0.38) 0%, rgba(191,33,47,0) 68%)"}}),(0,f.jsxs)("div",{className:"relative flex flex-col gap-[14px]",children:[(0,f.jsx)("div",{className:"uppercase text-turbo",style:{fontFamily:"'Space Mono', ui-monospace, monospace",fontSize:"11px",fontWeight:700,letterSpacing:"0.24em"},children:"Proposal Declined"}),(0,f.jsxs)("h2",{id:"proposal-declined-heading",className:"font-display font-extrabold uppercase text-white",style:{fontSize:"clamp(26px,5.4vw,42px)",lineHeight:1.02,letterSpacing:"-0.02em"},children:["This proposal",(0,f.jsx)("br",{}),"was declined."]})]}),(0,f.jsx)("div",{className:"relative mt-[clamp(18px,3vw,26px)] h-[3px] rounded-[2px]",style:{background:"linear-gradient(90deg,#BF212F 0 33%,#F2A900 33% 66%,#0FA3A3 66% 100%)"}})]}),(0,f.jsxs)("div",{className:"flex flex-col gap-[clamp(20px,3vw,28px)]",style:{padding:"clamp(22px,4vw,36px) clamp(20px,4vw,40px) clamp(24px,4vw,36px)"},children:[(0,f.jsxs)("p",{className:"m-0 text-[#555350]",style:{fontSize:"clamp(15px,2.6vw,18px)",lineHeight:1.6,maxWidth:"56ch"},children:["Proposal"," ",(0,f.jsx)("span",{className:"text-carbon",style:{fontFamily:"'Space Mono', ui-monospace, monospace",fontWeight:700},children:t})," ","has been marked as declined and is now closed."]}),(0,f.jsxs)("div",{className:"grid overflow-hidden rounded-xl border",style:{gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"1px",background:"#E4E4E9",borderColor:"#E4E4E9"},children:[(0,f.jsxs)("div",{className:"flex flex-col gap-2",style:{background:"#FBFBFC",padding:"16px 18px"},children:[(0,f.jsx)("div",{className:"uppercase",style:{fontFamily:"'Space Mono', ui-monospace, monospace",fontSize:"10px",letterSpacing:"0.18em",color:"#9A9AA0"},children:"Project"}),(0,f.jsx)("div",{className:"text-carbon font-semibold",style:{fontSize:"15px"},children:s})]}),(0,f.jsxs)("div",{className:"flex flex-col gap-2",style:{background:"#FBFBFC",padding:"16px 18px"},children:[(0,f.jsx)("div",{className:"uppercase",style:{fontFamily:"'Space Mono', ui-monospace, monospace",fontSize:"10px",letterSpacing:"0.18em",color:"#9A9AA0"},children:"Value"}),(0,f.jsx)("div",{className:"text-carbon",style:{fontFamily:"'Space Mono', ui-monospace, monospace",fontWeight:700,fontSize:"15px"},children:n})]}),(0,f.jsxs)("div",{className:"flex flex-col gap-2",style:{background:"#FBFBFC",padding:"16px 18px"},children:[(0,f.jsx)("div",{className:"uppercase",style:{fontFamily:"'Space Mono', ui-monospace, monospace",fontSize:"10px",letterSpacing:"0.18em",color:"#9A9AA0"},children:"Status"}),(0,f.jsx)("div",{children:(0,f.jsx)("span",{className:"inline-block rounded-md uppercase",style:{fontFamily:"'Space Mono', ui-monospace, monospace",fontWeight:700,fontSize:"10px",letterSpacing:"0.04em",background:"#FEE2E2",color:"#991B1B",padding:"5px 10px"},children:"Declined"})})]})]}),(0,f.jsx)("div",{className:"flex flex-wrap items-center gap-3",children:(0,f.jsxs)("a",{ref:r,href:"https://turbo.net.au/get-quote",target:"_blank",rel:"noopener",className:"inline-flex items-center justify-center gap-2.5 rounded-xl bg-turbo font-display font-semibold text-white transition-[background-color,border-color,transform] duration-150 ease-turbo hover:bg-redline hover:border-redline active:translate-y-
1px",style:{flex:"1 1 260px",fontSize:"clamp(15px,2.4vw,16px)",lineHeight:1,padding:"18px 26px",border:"1px solid #BF212F"},children:["Request a new proposal ",(0,f.jsx)("span",{style:{fontSize:"18px"},children:"\u2192"})]})}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center uppercase",style:{borderTop:"1px solid #F2F2F5",paddingTop:"18px",fontFamily:"'Space Mono', ui-monospace, monospace",fontSize:"11px",letterSpacing:"0.12em",color:"#9A9AA0",gap:"6px 18px"},children:[(0,f.jsx)("span",{children:"Questions?"}),(0,f.jsx)("a",{href:"mailto:[email protected]",className:"text-turbo hover:text-redline transition-colors",children:"[email protected]"}),(0,f.jsx)("a",{href:"tel:1300207446",className:"text-turbo hover:text-redline transition-colors",children:"1300 207 446"})]})]})]})]})},hc=e=>{if(!e)return null;const t=String(e);return t.endsWith("Z")||t.includes("+")||/\d{2}:\d{2}$/.test(t.slice(-6))?new Date(t):new Date(t+"Z")},uc=["Job Cancelled","Exceeded Budget","Not Ready to Proceed","Chose Another Provider"],gc=()=>{const{proposalId:e}=(0,r.g)(),[t,s]=(0,a.useState)(null),[n,i]=(0,a.useState)(!0),[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(!1),[p,h]=(0,a.useState)(""),[u,g]=(0,a.useState)(""),[b,y]=(0,a.useState)(""),[v,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(!1),[S,_]=(0,a.useState)(!1),[C,F]=(0,a.useState)(!0),E=(0,a.useRef)(null),[T,z]=(0,a.useState)(null),[B,D]=(0,a.useState)(!1),[R,P]=(0,a.useState)({}),[W,O]=(0,a.useState)({}),[L,M]=(0,a.useState)([]),q=(0,a.useRef)(null);(0,a.useEffect)(()=>{const e="true"===new URLSearchParams(window.location.search).get("preview");D(e),U(e)},[e]),(0,a.useEffect)(()=>{let e=!1;return(async()=>{try{const t=await fetch("".concat(I.fn,"/api/public/recent-gigs"));if(!t.ok)return;const s=await t.json();!e&&s.success&&M((s.gigs||[]).slice(0,8))}catch(t){}})(),()=>{e=!0}},[]),(0,a.useEffect)(()=>{if("undefined"===typeof IntersectionObserver)return;const e=document.querySelectorAll(".pp-reveal:not(.in)"),t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(e.target.classList.add("in"),t.unobserve(e.target))})},{threshold:.1,rootMargin:"0px 0px -5% 0px"});return e.forEach(e=>t.observe(e)),requestAnimationFrame(()=>{e.forEach(e=>{e.getBoundingClientRect().top<.95*(window.innerHeight||800)&&e.classList.add("in")})}),()=>t.disconnect()},[t,L]);const H=e=>{const t=q.current;t&&t.scrollBy({left:e*(.85*t.clientWidth),behavior:"smooth"})};(0,a.useEffect)(()=>{if(t&&t.service_items){const e={},s={};"Accepted"===t.status&&t.accepted_service_items?(t.service_items.forEach((s,a)=>{s.optional&&(e[a]=t.accepted_service_items.includes(a))}),t.accepted_extras&&Object.keys(t.accepted_extras).forEach(e=>{s[e]=t.accepted_extras[e]||[]})):t.service_items.forEach((t,a)=>{t.optional&&(e[a]=!1);const n=(t.optional_extras||[]).filter(e=>e.selected_by_default).map(e=>e.id);s[a]=n}),P(e),O(s)}},[t]);const U=async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{let a="".concat(I.fn,"/api/proposals/").concat(e);t&&(a+="?preview=true");const n=await fetch(a);if(n.ok){const e=await n.json();s(e)}else 404===n.status?z("Proposal not found"):403===n.status?z("This Proposal Has Expired"):z("Failed to load proposal")}catch(T){console.error("Error loading proposal:",T),z("An error occurred while loading the proposal")}finally{i(!1)}},G=e=>{k(!0);const t=E.current,s=t.getContext("2d"),a=t.getBoundingClientRect(),n=(e.clientX||e.touches[0].clientX)-a.left,r=(e.clientY||e.touches[0].clientY)-a.top;s.beginPath(),s.moveTo(n,r)},V=e=>{if(!A)return;const t=E.current,s=t.getContext("2d"),a=t.getBoundingClientRect(),n=(e.clientX||e.touches[0].clientX)-a.left,r=(e.clientY||e.touches[0].clientY)-a.top;s.lineTo(n,r),s.stroke()},J=()=>{k(!1)},Y=()=>{d(!1),F(!0),y(""),g(""),j(!1)},K=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(e),Z=e=>new Date(e).toLocaleDateString("en-AU",{year:"numeric",month:"long",day:"numeric"}),$=()=>{if(!t.incentive_enabled||!t.incentive_expiry_date)return!1;const e=(new Date).toISOString().split("T")[0];return t.incentive_expiry_date>=e},Q=()=>"percentage"===t.incentive_discount_type?"".concat(t.incentive_discount,"%"):K(t.incentive_discount),X=(()=>
1{if(!t||!t.service_items)return{subtotal:0,gst:0,total:0};let e=0;t.service_items.forEach((t,s)=>{let a=!1;if(a=!t.optional||(R[s]||!1),a){e+=parseFloat(t.price)||0;const a=t.optional_extras||[],n=W[s]||[];a.forEach(t=>{n.includes(t.id)&&(e+=parseFloat(t.price)||0)})}});let s=e;t.client_discount>0&&(s="percentage"===t.client_discount_type?e-e*t.client_discount/100:e-t.client_discount);const a=.1*s;return{subtotal:e,discountedSubtotal:s,gst:a,total:s+a}})();if(n)return(0,f.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-indigo-600 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading proposal..."})]})});if(T){const e="This Proposal Has Expired"===T;return(0,f.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center max-w-md px-4",children:[(0,f.jsx)(x.A,{className:"h-12 w-12 text-red-600 mx-auto mb-4"}),(0,f.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:T}),(0,f.jsx)("p",{className:"text-gray-600",children:e?(0,f.jsxs)(f.Fragment,{children:["The requested date is no longer available. Get in touch at ",(0,f.jsx)("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:underline",children:"[email protected]"})," and we'll check availability and send you a fresh proposal."]}):"Please contact us if you believe this is an error."})]})})}const ee="Accepted"===t.status,te="Declined"===t.status,se=!ee&&!te,ae=t.hero_image||"/hero-background.jpg",ne=t.client_discount>0,re="percentage"===t.client_discount_type?X.subtotal*t.client_discount/100:t.client_discount,ie=$(),oe=X.total-("percentage"===t.incentive_discount_type?X.total*(t.incentive_discount/100):t.incentive_discount),le=e=>{try{return new Date(e).toLocaleDateString("en-AU",{month:"long",year:"numeric"})}catch(t){return e||""}};return(0,f.jsxs)("div",{className:"pp min-h-screen bg-smoke text-carbon",children:[(0,f.jsx)("style",{children:"\n .pp { font-family: 'Hanken Grotesk', Arial, Helvetica, sans-serif; }\n .pp ::selection { background:#BF212F; color:#fff; }\n .kicker { font-family:'Space Mono', ui-monospace, monospace; text-transform:uppercase; letter-spacing:0.26em; }\n .signal-bar { background:linear-gradient(90deg,#BF212F 0 40%,#F2A900 40% 70%,#0FA3A3 70% 100%); }\n\n /* Hero fills the visible mobile viewport (100svh, with a vh-less fallback floor). */\n .pp-hero { min-height:640px; min-height:100svh; }\n @media (min-width:640px) { .pp-hero { min-height:0; height:100vh; max-height:1000px; } }\n\n /* booking_terms rich HTML */\n .terms-prose h3 { font-family:'Archivo', sans-serif; font-weight:700; color:#141414; margin:18px 0 6px; font-size:16px; }\n .terms-prose h3:first-child { margin-top:0; }\n .terms-prose p { margin:0 0 10px; line-height:1.7; color:#2B2B2B; font-size:15px; }\n .terms-prose ul, .terms-prose ol { list-style:disc; margin:0 0 10px 20px; line-height:1.7; color:#2B2B2B; }\n .terms-prose li { margin-bottom:4px; }\n .terms-prose strong { color:#141414; font-weight:700; }\n\n /* service_summary on the dark carbon card */\n .summary-prose p { margin:0 0 12px; line-height:1.75; }\n .summary-prose strong { color:#fff; font-weight:700; }\n\n /* showcase cards: white -> Turbo Red on hover */\n .show-card { transition: background .3s, border-color .3s, transform .4s cubic-bezier(0.16,1,0.3,1); }\n .show-card:hover { background:#BF212F !important; border-color:#BF212F !important; transform:translateY(-3px); }\n .show-card:hover .show-ink, .show-card:hover .show-sub, .show-card:hover .show-cta { color:#fff !important; }\n .show-card:hover .show-icon { background:#fff !important; }\n .show-card:hover .show-icon svg { stroke:#BF212F !important; }\n\n .btn-red { transition: background .25s, transform .4s cubic-bezier(0.16,1,0.3,1); }\n .btn-red:hover { background:#8E1822 !important; transform:translateY(-2px); }\n\n /* recent-jobs rail */\n .pp-rail { scrollbar-width:none; -ms-overflow-style:none; scroll-snap-type:x mandatory; }\n .pp-rail::-webkit-scrollbar { display:none; }\n .job-card { scroll-snap-align:start; transition: transform .4s cubic-bezier(0.16,1,0.3,1); }\n .job-card:hover { transform:translateY(-4px); }\n .job-card:hover .job-img { transform:scale(1.06); }\n .job-card:hover .job-arrow { transform:translate(3px,-3px); color:#BF212F; }\n\n /* optional row dimming */\n tr.is-off { opacity:0.4; }\n tr.is-off .row-strike { text-decoration:line-through; }\n tr.is-free td { background: rgba(31,157,87,0.06); }\n tr.is-free td:first-child { box-shadow: inset 3px 0 0 #1F9D57; }\n\n /* hero motion (turbo easing) */\n @keyframes ppHeroZoom { from { transform:scale(1.12); } to { transform:scale(1); } }
1\n @keyframes ppBarWipe { from { transform:scaleX(0); } to { transform:scaleX(1); } }\n @keyframes ppRiseIn { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }\n @keyframes ppGrain { 0%,100%{transform:translate(0,0);} 25%{transform:translate(-1.5%,1%);} 50%{transform:translate(1%,-1.5%);} 75%{transform:translate(1.5%,1.5%);} }\n @keyframes ppPing { 0%{opacity:.3;transform:scale(.85);} 50%{opacity:1;} 100%{opacity:.3;transform:scale(1.05);} }\n @keyframes ppNudge { 0%,100%{transform:translateY(0);opacity:.5;} 50%{transform:translateY(6px);opacity:1;} }\n .hero-img { animation: ppHeroZoom 14s cubic-bezier(0.16,1,0.3,1) forwards; }\n .hero-bar { transform-origin:left; animation: ppBarWipe 1.1s cubic-bezier(0.16,1,0.3,1) .15s both; }\n .hero-rise { opacity:0; animation: ppRiseIn 1s cubic-bezier(0.16,1,0.3,1) both; }\n .hero-grain{ animation: ppGrain 7s steps(6) infinite; }\n .ping-dot { animation: ppPing 2.4s ease-in-out infinite; }\n .scroll-cue{ animation: ppNudge 1.8s ease-in-out infinite; }\n\n /* scroll reveal */\n .pp-reveal { opacity:0; transform:translateY(26px); transition:opacity .85s cubic-bezier(0.16,1,0.3,1), transform .85s cubic-bezier(0.16,1,0.3,1); }\n .pp-reveal.in { opacity:1; transform:translateY(0); }\n\n @media (prefers-reduced-motion: reduce) {\n .hero-img,.hero-bar,.hero-rise,.hero-grain,.ping-dot,.scroll-cue { animation:none !important; }\n .hero-rise { opacity:1 !important; }\n .pp-reveal { opacity:1 !important; transform:none !important; transition:none !important; }\n }\n\n /* Decline modal (Turbo easing entrance + success pop) */\n @keyframes tdmFade { from { opacity:0; } to { opacity:1; } }\n @keyframes tdmUp { from { opacity:0; transform:translateY(24px) scale(0.985); } to { opacity:1; transform:none; } }\n @keyframes tdmPop { 0% { transform:scale(0.4); opacity:0; } 70% { transform:scale(1.08); } 100% { transform:scale(1); opacity:1; } }\n .tdm-backdrop { animation: tdmFade 0.3s ease-out; }\n .tdm-card { animation: tdmUp 0.45s cubic-bezier(0.16,1,0.3,1); }\n .tdm-nudge { animation: tdmUp 0.35s cubic-bezier(0.16,1,0.3,1); }\n .tdm-check { animation: tdmPop 0.5s cubic-bezier(0.16,1,0.3,1); }\n .tdm-notes:focus { outline: 2px solid #141414; outline-offset: -1px; }\n"}),B&&(0,f.jsx)("div",{className:"bg-ignition text-carbon py-2.5 px-4 text-center kicker text-[11px]",children:"Preview mode \u2014 this is how the proposal appears to the client"}),(0,f.jsxs)("header",{className:"pp-hero relative overflow-hidden bg-carbon flex flex-col",children:[(0,f.jsx)("div",{className:"hero-bar signal-bar absolute top-0 left-0 w-full h-1.5 z-40"}),(0,f.jsxs)("div",{className:"absolute inset-0 overflow-hidden",children:[t.hero_video&&ac(t.hero_video)?(0,f.jsx)("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,poster:ae,className:"hero-img absolute inset-0 w-full h-full object-cover",children:(0,f.jsx)("source",{src:ac(t.hero_video),type:"video/mp4"})}):(0,f.jsx)("img",{src:ae,alt:"",className:"hero-img absolute inset-0 w-full h-full object-cover"}),(0,f.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg,rgba(20,20,20,.74) 0%,rgba(20,20,20,.52) 34%,rgba(20,20,20,.82) 74%,#141414 100%)"}}),(0,f.jsx)("div",{className:"absolute inset-0 pointer-events-none",style:{background:"radial-gradient(circle at 20% 26%,rgba(15,163,163,.26),transparent 56%),radial-gradient(circle at 84% 82%,rgba(242,169,0,.18),transparent 52%)"}}),(0,f.jsx)("div",{className:"absolute inset-0 pointer-events-none",style:{background:"linear-gradient(90deg,rgba(20,20,20,.6) 0%,transparent 60%)"}}),(0,f.jsx)("div",{className:"hero-grain absolute pointer-events-none",style:{inset:"-15%",opacity:.05,mixBlendMode:"overlay",backgroundImage:"url('data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%22160%22 height=%22160%22><filter id=%22n%22><feTurbulence type=%22fractalNoise%22 baseFrequency=%22.9%22 numOctaves=%222%22/></filter><rect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23n)%22/></svg>')"}}),(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"","aria-hidden":"true",className:"hidden md:block absolute -right-28 top-[42%] w-[520px] opacity-[0.14] pointer-events-none select-none",style:{transform:"translateY(-50%) rotate(-7deg)"}})]}),(0,f.jsxs)("div",{className:"relative z-20 flex items-center justify-between gap-4 px-6 sm:px-12 pt-7",children:[(0,f.jsx)("img",{src:"/turbo-logo-dark.png",alt:"Turbo 360",className:"hero-rise h-9 sm:h-11 w-auto object-contain",style:{animationDelay:".2s"}}),(0,f.jsxs)("div",{className:"flex items-center gap-3 sm:gap-5",children:[t.proposal_number&&(0,f.jsxs)("span",{className:"hero-rise hidden sm:inline kicker text-[11px] text-silver",style:{animationDelay:".3s"},children:["Proposal ",(0,f.jsx)("span",{className:"text-white",children:t.proposal_number})]}),(0,f.jsxs)("button",{onClick:async()=>{_(!0);try{const s=new Xo.Ay({orientation:"portrait",unit:"mm",format:"a4"});let a=0;const n=210,r=297,i=18,o=n-2*i,l=[0,43,73],c=[220,38,38],d=[30,30,30],m=[80,80,80],p=[120,120,120],x=[255,255,255],h=[245,247,250],u=[22,163,74],g=[79,70,229],f=(e,t)=>{s.setDrawColor(...p),s.setLineWidth(.3),s.line(i,r-18,n-i,r-18),s.setFont("helvetica","normal"),s.setFontSize(7),s.setTextColor(...p),s.text("[email protected] | 1300 207 446 | turbo360.com.au",i,r-13),s.text("Page ".concat(e," of ").concat(t),n-i,r-13,{align:"right"}),s.setFontSize(6.5),s.text("Turbo Productions PTY LTD | ABN 18 150 556 102",i,r-9.5)},b=()=>{s.setFillColor(...l),s.rect(0,0,n,16,"F"),s.setFillColor(...c),s.rect(0,16,n,1.5,"F"),s.setFont("helvetica","bold"),s.setFontSize(13),s.setTextColor(...x),s.text("TURBO 360",i,11),s.setFont("helvetica","normal"),s.setFontSize(8),s.text("Quote #".concat(t.proposal_number||"N/A"),n-i,11,{align:"right"}),a=25},y=e=>a+e>r-25&&(s.addPage(),b(),!0);s.setFillColor(...l),s.rect(0,0,n,44,"F"),s.setFillColor(...c),s.rect(0,44,n,2.5,"F"),s.setFont("helvetica","bold"),s.setFontSize(28),s.setTextColor(...x),s.text("TURBO 360",i,20),s.setFont("helvetica","normal"),s.setFontSize(13),s.setTextColor(180,200,220),s.text("SERVICE PROPOSAL",i,30),s.setFont("helvetica","normal"),s.setFontSize(9),s.setTextColor(180,200,220),s.text("Quote #".concat(t.proposal_number||"N/A"),n-i,20,{align:"right"}),s.setFontSize(8),s.text(Z((new Date).toISOString()),n-i,26,{align:"right"}),s.setFontSize(9),s.setTextColor(...x),s.text("Prepared for ".concat(t.client_company),n-i,34,{align:"right"}),a=54;const v=5,j=o/2-3;let w=0;t.position&&w++,w+=3;const N=14+5*w+v;let A=1;if(t.start_time&&A++,t.job_location){A+=s.splitTextToSize(t.job_location,j-12).length}const k=14+5*A+v,S=Math.max(N,k,38);s.setFillColor(...h),s.roundedRect(i,a,j,S,2,2,"F"),s.setFillColor(...l),s.rect(i,a,1.5,S,"F"),s.setFont("helvetica","bold"),s.setFontSize(7.5),s.setTextColor(...p),s.text("BILL TO",i+v+2,a+v+3),s.setFont("helvetica","bold"),s.setFontSize(11),s.setTextColor(...d),s.text(t.contact_name||"",i+v+2,a+v+10),s.setFont("helvetica","normal"),s.setFontSize(8.5),s.setTextColor(...m);let _=a+v+16;t.position&&(s.text(t.position,i+v+2,_),_+=4.5),t.client_company&&(s.text(t.client_company,i+v+2,_),_+=4.5),t.email&&(s.text(t.email,i+v+2,_),_+=4.5),t.phone&&s.text(t.phone,i+v+2,_);const C=i+j+6;s.setFillColor(...h),s.roundedRect(C,a,j,S,2,2,"F"),s.setFillColor(...c),s.rect(C,a,1.5,S,"F"),s.setFont("helvetica","bold"),s.setFontSize(7.5),s.setTextColor(...p),s.text("EVENT DETAILS",C+v+2,a+v+3),s.setFont("helvetica","bold"),s.setFontSize(11),s.setTextColor(...d);const F=s.splitTextToSize(t.project_name||"",j-12);s.text(F[0]||"",C+v+2,a+v+10),s.setFont("helvetica","normal"),s.setFontSize(8.5),s.setTextColor(...m);let E=a+v+16;if(s.text(Z(t.job_date),C+v+2,E),E+=4.5,t.start_time&&(s.text("Time: ".concat(t.start_time),C+v+2,E),E+=4.5),t.job_location){s.splitTextToSize(t.job_location,j-12).forEach(e
1=>{s.text(e,C+v+2,E),E+=4.5})}if(a+=S+10,t.service_summary&&t.service_summary.trim()){y(30),s.setFillColor(...l),s.rect(i,a,1.5,6,"F"),s.setFont("helvetica","bold"),s.setFontSize(11),s.setTextColor(...d),s.text("SERVICE SUMMARY",i+5,a+5),a+=12;const e=document.createElement("div");e.innerHTML=t.service_summary;const n=e.querySelectorAll("p, li, div"),r=n.length>0?Array.from(n).map(e=>e.textContent.trim()).filter(Boolean):[e.textContent.trim()];s.setFontSize(9),s.setFont("helvetica","normal"),s.setTextColor(...m),r.forEach(e=>{s.splitTextToSize(e,o).forEach(e=>{y(5),s.text(e,i,a),a+=4.5}),a+=2}),a+=5}t.deliverables&&t.deliverables.length>0&&(y(20+7*t.deliverables.length),s.setFillColor(...u),s.rect(i,a,1.5,6,"F"),s.setFont("helvetica","bold"),s.setFontSize(11),s.setTextColor(...d),s.text("WHAT YOU'LL RECEIVE",i+5,a+5),a+=12,t.deliverables.forEach(e=>{const t=s.splitTextToSize(e,o-10),n=4.5*t.length+2;y(n),s.setFont("helvetica","bold"),s.setFontSize(10),s.setTextColor(...u),s.text("\u2713",i+2,a+1),s.setFont("helvetica","normal"),s.setFontSize(9),s.setTextColor(...d);let r=a;t.forEach(e=>{s.text(e,i+9,r),r+=4.5}),a=r+2}),a+=5),y(20),s.setFillColor(...c),s.rect(i,a,1.5,6,"F"),s.setFont("helvetica","bold"),s.setFontSize(11),s.setTextColor(...d),s.text("INVESTMENT BREAKDOWN",i+5,a+5),a+=12,s.setFillColor(...l),s.rect(i,a,o,9,"F"),s.setFont("helvetica","bold"),s.setFontSize(8),s.setTextColor(...x),s.text("SERVICE DESCRIPTION",i+5,a+6),s.text("INVESTMENT",n-i-5,a+6,{align:"right"}),a+=9;let T=0;t.service_items.forEach((e,t)=>{if(e.optional&&!R[t])return;const r=e.title||e.description||"",l=e.title&&e.description?e.description:"",c=(e,t)=>e.split("\n").flatMap(e=>""===e?[""]:s.splitTextToSize(e,t)),p=c(r,o-55),h=l?c(l,o-55):[],u=Math.max(6+4.5*p.length+4*h.length+(h.length>0?1:0),12);y(u+2),T%2===0?s.setFillColor(252,252,254):s.setFillColor(...x),s.rect(i,a,o,u,"F"),s.setDrawColor(230,230,230),s.setLineWidth(.2),s.line(i,a+u,n-i,a+u);let f=a+5.5;if(s.setFont("helvetica","bold"),s.setFontSize(9),s.setTextColor(...d),p.forEach(e=>{s.text(e,i+5,f),f+=4.5}),e.optional){const e=p[p.length-1]||"",t=s.getTextWidth(e),n=i+5+t+2,r=a+5.5+4.5*(p.length-1);s.setFillColor(219,234,254),s.roundedRect(n,r-3,16,4,1,1,"F"),s.setFont("helvetica","bold"),s.setFontSize(5.5),s.setTextColor(30,64,175),s.text("Optional",n+1.5,r)}h.length>0&&(f+=1,s.setFont("helvetica","normal"),s.setFontSize(8),s.setTextColor(...m),h.forEach(e=>{s.text(e,i+5,f),f+=4})),s.setFont("helvetica","bold"),s.setFontSize(10),s.setTextColor(...d),s.text(K(e.price),n-i-5,a+6,{align:"right"}),a+=u,T++;const b=e.optional_extras||[],v=W[t]||[];(!e.optional||(R[t]||!1))&&b.length>0&&b.forEach(e=>{if(!v.includes(e.id))return;const t="+ ".concat(e.name),r=e.description||"",l=c(t,o-65),d=r?c(r,o-65):[],p=Math.max(5+4*l.length+3.5*d.length+(d.length>0?1:0),9);y(p+1),s.setFillColor(238,242,255),s.rect(i,a,o,p,"F"),s.setDrawColor(220,225,240),s.setLineWidth(.15),s.line(i,a+p,n-i,a+p);let x=a+4.5;s.setFont("helvetica","bold"),s.setFontSize(8),s.setTextColor(...g),l.forEach(e=>{s.text(e,i+12,x),x+=4});
1const h=l[0]||"",u=s.getTextWidth(h),f=i+12+u+2,b=a+4.5;s.setFillColor(224,231,255),s.roundedRect(f,b-3,13,3.8,.8,.8,"F"),s.setFont("helvetica","bold"),s.setFontSize(5),s.setTextColor(...g),s.text("Add-on",f+1.2,b-.2),d.length>0&&(x+=.5,s.setFont("helvetica","normal"),s.setFontSize(7),s.setTextColor(...m),d.forEach(e=>{s.text(e,i+12,x),x+=3.5})),s.setFont("helvetica","bold"),s.setFontSize(8.5),s.setTextColor(...g),s.text("+".concat(K(e.price)),n-i-5,a+5,{align:"right"}),a+=p})}),a+=6,y(45);const z=85,B=n-i-z;s.setFillColor(250,250,252),s.roundedRect(B,a,z,10+(t.client_discount>0?6:0)+6+3,1.5,1.5,"F");let D=a+5;if(s.setFont("helvetica","normal"),s.setFontSize(8.5),s.setTextColor(...p),s.text("Subtotal (ex GST):",B+4,D),s.setFont("helvetica","bold"),s.setTextColor(...d),s.text(K(X.subtotal),n-i-4,D,{align:"right"}),D+=6,t.client_discount>0){s.setFont("helvetica","normal"),s.setTextColor(...p);const e="percentage"===t.client_discount_type?"".concat(t.client_discount,"%"):K(t.client_discount);let a="Discount (".concat(e,")");t.client_discount_reason&&(a+=" \u2014 ".concat(t.client_discount_reason));const r=s.splitTextToSize(a+":",z-30)[0];s.text(r,B+4,D),s.setFont("helvetica","bold"),s.setTextColor(...u);const o="percentage"===t.client_discount_type?X.subtotal*t.client_discount/100:t.client_discount;s.text("-".concat(K(o)),n-i-4,D,{align:"right"}),D+=6}if(s.setFont("helvetica","normal"),s.setTextColor(...p),s.text("GST (10%):",B+4,D),s.setFont("helvetica","bold"),s.setTextColor(...d),s.text(K(X.gst),n-i-4,D,{align:"right"}),D+=5,s.setDrawColor(...p),s.setLineWidth(.3),s.line(B+2,D,n-i-2,D),D+=2,a=D+2,s.setFillColor(...c),s.roundedRect(B,a,z,13,1.5,1.5,"F"),s.setFont("helvetica","bold"),s.setFontSize(9),s.setTextColor(...x),s.text("TOTAL (inc GST):",B+5,a+8.5),s.setFontSize(13),s.text(K(X.total),n-i-5,a+9,{align:"right"}),a+=16,$()){y(18),s.setFillColor(...u),s.roundedRect(B,a,z,14,1.5,1.5,"F"),s.setFont("helvetica","bold"),s.setFontSize(7),s.setTextColor(...x),s.text("BOOK BEFORE ".concat(Z(t.incentive_expiry_date).toUpperCase(),":"),B+4,a+5.5),s.setFontSize(13);const e=X.total-("percentage"===t.incentive_discount_type?X.total*(t.incentive_discount/100):t.incentive_discount);s.text(K(e),n-i-5,a+10,{align:"right"}),a+=18}if(t.booking_terms){s.addPage(),b(),s.setFillColor(...l),s.rect(i,a,1.5,6,"F"),s.setFont("helvetica","bold"),s.setFontSize(11),s.setTextColor(...d),s.text("TERMS & CONDITIONS",i+5,a+5),a+=12;const e=document.createElement("div");e.innerHTML=t.booking_terms;const n=e.querySelectorAll("h3, p, li"),c=o/2-4,p=i,x=i+c+8,h=a;let u=h,g=h,f=!0;n.forEach(e=>{const t=e.textContent.trim();if(t)if("H3"===e.tagName){const e=f?p:x;let n=f?u:g;n>r-30&&(s.addPage(),b(),u=a,g=a,f=!0,n=a),s.setFontSize(8.5),s.setFont("helvetica","bold"),s.setTextColor(...d),s.text(t,e,n),f?u=n+5:g=n+5}else{const n=f?p:x;let i=f?u:g;i>r-30&&(s.addPage(),b(),u=a,g=a,f=!0,i=a),s.setFontSize(7.5),s.setFont("helvetica","normal"),s.setTextColor(...m);const o="LI"===e.tagName?"\u2022 ":"",l=s.splitTextToSize(o+t,c);let d=i;l.forEach(e=>{s.text(e,n,d),d+=3.3}),d+=2.5,f?(u=d,u>h+155&&(f=!1)):g=d}}),a=Math.max(u,g)+8}if(t.important_notes&&t.important_notes.length>0){const e=Array.isArray(t.important_notes)?t.important_notes:[t.important_notes];let n=14;e.forEach(e=>{const t=s.splitTextToSize("\u2022 ".concat(e),o-14);n+=4.5*t.length+2}),y(n+5),s.setFillColor(255,251,243),s.setDrawColor(234,140,30),s.setLineWidth(.8),s.roundedRect(i,a,o,n,2,2,"FD"),a+=7,s.setFontSize(10),s.setFont("helvetica","bold"),s.setTextColor(180,83,9),s.text("IMPORTANT NOTES",i+6,a),a+=7,s.setFontSize(8.5),s.setFont("helvetica","normal"),s.setTextColor(80,60,30),e.forEach(e=>{s.splitTextToSize("\u2022 ".concat(e),o-14).forEach(e=>{s.text(e,i+6,a),a+=4.5}),a+=2}),a+=3}if("Accepted"===t.status&&t.signature){const n=t.signature,r=[21,128,61],l=[240,253,244],c=[187,247,208];s.addPage(),b(),s.setFillColor(...r),s.rect(i,a,1.5,8,"F"),s.setFont("helvetica","bold"),s.setFontSize(14),s.setTextColor(...d),s.text("PROPOSAL ACCEPTED & SIGNED",i+5,a+6),a+=12;const x=16;s.setFillColor(...l),s.setDrawColor(...c),s.setLineWidth(.6),s.roundedRect(i,a,o,x,2,2,"FD"),s.setFont("helvetica","bold"),s.setFontSize(10),s.setTextColor(...r),s.text("Status: Accepted",i+6,a+7),s.setFont("helvetica","normal"),s.setFontSize(8.5),s.setTextColor(...m),s.text("Quote #".concat(t.proposal_number||"N/A"," \u2022 ").concat(t.client_company||""),i+6,a+13),a+=x+8,s.setFont("helvetica","bold"),s.setFontSize(7.5),s.setTextColor(...p),s.text("DIGITAL SIGNATURE",i,a),a+=4;const h=38;s.setFillColor(248,250,252),s.setDrawColor(203,213,225),s.setLineWidth(.4),s.roun
1dedRect(i,a,o,h,1.5,1.5,"FD");try{const e=90,t=30,r=i+(o-e)/2,l=a+(h-t)/2;s.addImage(n.signature_data,"PNG",r,l,e,t,void 0,"FAST")}catch(e){s.setFont("helvetica","italic"),s.setFontSize(9),s.setTextColor(...p),s.text("(Signature image unavailable)",i+8,a+h/2)}a+=h+10;const u=(e,t,a,n,r)=>{s.setFont("helvetica","bold"),s.setFontSize(7.5),s.setTextColor(...p),s.text(a.toUpperCase(),e,t),s.setFont("helvetica","normal"),s.setFontSize(10),s.setTextColor(...d);const i=s.splitTextToSize(String(n||"\u2014"),r);let o=t+4.5;return i.forEach(t=>{s.text(t,e,o),o+=4.5}),o-t};let g="";try{g=new Date(n.signed_at).toLocaleString("en-AU",{timeZone:"Australia/Melbourne",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short"})}catch(e){g=n.signed_at||""}const f=(o-8)/2,y=i,v=i+f+8,j=u(y,a,"Signed by",n.signed_by,f),w=u(v,a,"Date & time (Melbourne)",g,f);if(a+=Math.max(j,w)+6,n.ip_address||n.user_agent){const e=n.ip_address?u(y,a,"IP address",n.ip_address,f):0,t=n.user_agent?u(v,a,"Device / browser",n.user_agent,f):0;a+=Math.max(e,t)+6}a+=4,s.setFont("helvetica","italic"),s.setFontSize(8),s.setTextColor(...m);const N="This electronic signature is legally binding and constitutes acceptance of all terms and conditions outlined in this proposal.";s.splitTextToSize(N,o).forEach(e=>{s.text(e,i,a),a+=4})}const I=s.internal.getNumberOfPages();for(let e=1;e<=I;e++)s.setPage(e),f(e,I);s.save("".concat(t.project_name," - Proposal.pdf"))}catch(T){console.error("Error generating PDF:",T),alert("Failed to generate PDF. Please try again.")}finally{_(!1)}},disabled:S,className:"hero-rise inline-flex items-center gap-2.5 px-5 py-2.5 bg-white/95 text-carbon rounded-md shadow-xl font-semibold text-sm hover:bg-white disabled:opacity-60 transition-colors",style:{animationDelay:".35s"},children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),S?"Generating\u2026":"Download PDF"]})]})]}),(0,f.jsxs)("div",{className:"relative z-20 flex-1 flex flex-col justify-center px-6 sm:px-12 max-w-[1180px]",children:[(0,f.jsxs)("div",{className:"hero-rise flex items-center flex-wrap gap-3 mb-7",style:{animationDelay:".45s"},children:[(0,f.jsx)("span",{className:"ping-dot inline-block h-2 w-2 rounded-full bg-turbo"}),(0,f.jsx)("span",{className:"kicker text-[12px] text-ignition",children:"Service Proposal"}),(0,f.jsx)("span",{className:"text-graphite",children:"\u2014"}),(0,f.jsxs)("span",{className:"kicker text-[12px] text-silver",children:["Prepared for ",t.client_company]})]}),(0,f.jsx)("h1",{className:"hero-rise font-display font-extrabold text-white leading-[0.9] tracking-tight",style:{animationDelay:".55s",fontSize:"clamp(40px,8.2vw,118px)",textWrap:"balance"},children:t.project_name}),ie&&(0,f.jsxs)("div",{className:"hero-rise mt-8 inline-flex flex-wrap items-center gap-x-3 gap-y-1.5 self-start rounded-full px-4 py-2.5",style:{animationDelay:".7s",background:"rgba(31,157,87,.18)",border:"1px solid rgba(31,157,87,.5)",boxShadow:"0 10px 30px -12px rgba(31,157,87,.6)"},children:[(0,f.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,f.jsx)("span",{className:"ping-dot absolute inline-flex h-full w-full rounded-full bg-[#3ed293]"}),(0,f.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-[#3ed293]"})]}),(0,f.jsx)("span",{className:"kicker text-[10px] text-[#8fe9bf]",children:"Bonus \xb7 limited-time incentive"}),(0,f.jsxs)("span",{className:"text-white text-sm font-semibold",children:["Book before ",Z(t.incentive_expiry_date)," and save ",Q()]})]})]}),(0,f.jsxs)("div",{className:"relative z-20 px-6 sm:px-12 pb-9",children:[(0,f.jsxs)("div",{className:"hero-rise grid grid-cols-2 md:grid-cols-4 gap-px bg-white/10 border border-white/10 rounded-lg overflow-hidden",style:{animationDelay:".8s"},children:[(0,f.jsxs)("div",{className:"bg-carbon/40 backdrop-blur-sm px-5 py-4",children:[(0,f.jsx)("div",{className:"kicker text-[9px] text-ash mb-1.5",children:"Event Date"}),(0,f.jsxs)("div",{className:"font-display font-bold text-white text-[15px] leading-tight",children:[Z(t.job_date),t.start_time?" \xb7 ".concat(t.start_time):""]})]}),(0,f.jsxs)("div",{className:"bg-carbon/40 backdrop-blur-sm px-5 py-4",children:[(0,f.jsx)("div",{className:"kicker text-[9px] text-ash mb-1.5",children:"Location"}),(0,f.jsx)("div",{className:"font-display font-bold text-white text-[15px] leading-tight",children:t.job_location||"\u2014"})]}),(0,f.jsxs)("div",{className:"bg-carbon/40 backdrop-blur-sm px-5 py-4",children:[(0,f.jsx)("div",{className:"kicker text-[9px] text-ash mb-1.5",children:"Contact"}),(0,f.jsx)("div",{className:"font-display font-bold text-white text-[15px] leading-tight",children:t.contact_name})]}),(0,f.jsxs)("div",{className:"bg-carbon/40 backdrop-blur-sm px-5 py-4",children:[(0,f.jsx)("div",{className:"kicker text-[9px] text-ignition mb-1.5",children:"Proposal No."}),(0,f.jsx)("div",{className:"font-display font-bold text-white text-[15px] leading-tight",children:t.proposal_number||"\u2014"})]})]}),(0,f.jsx)("div",{className:"hero-rise flex items-center justify-center gap-2 mt-7",style:{animationDelay:"1s"},children:(0,f.jsxs)("span",{className:"scroll-cue inline-flex flex-col items-center text-silver",children:[(0,f.jsx)("span",{className:"kicker text-[10px] mb-1.5",children:"Scroll"}),(0,f.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M12 5v14"}),(0,f.jsx)("path",{d:"m19 12-7 7-7-7"})]})]})})]})]}),(0,f.jsxs)("main",{className:"max-w-5xl mx-auto px-4 sm:px-6 pb-28 pt-12 relative z-10",children:[ee&&(0,f.jsxs)("div",{className:"flex items-center gap-4 bg-carbon rounded-xl p-5 mb-8 shadow-2xl border-l-4 border-cinema",children:[(0,f.jsx)("div",{className:"shrink-0 h-11 w-11 rounded-full bg-cinema/15 flex items-center justify-center",children:(0,f.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#0FA3A3",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M20 6 9 17l-5-5"})})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"kicker text-[11px] text-cinema mb-1",children:"Status / Accepted"}),(0,f.jsx)("h3",{className:"font-display font-bold text-white text-lg leading-tight",children:"Proposal Accepted"}),(0,f.jsxs)("p",{className:"text-sm text-silver mt-1",children:["Thank you",t.contact_name?", ".concat(t.contact_name):"",". We'll be in touch shortly to lock in the details."]})]})]}),te&&(0,f.jsxs)("div",{className:"flex items-center gap-4 bg-carbon rounded-xl p-5 mb-8 shadow-2xl border-l-4 border-turbo",children:[(0,f.jsx)("div",{className:"shrink-0 h-11 w-11 rounded-full bg-turbo/20 flex items-center justify-center",children:(0,f.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"#BF212F",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M18 6 6 18"}),(0,f.jsx)("path",{d:"m6 6 12 12"})]})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"kicker text-[11px] text-turbo mb-1",children:"Status / Declined"}),(0,f.jsx)("h3",{className:"font-display font-bold text-white text-lg leading-tight",children:"Proposal Declined"}),(0,f.jsx)("p",{className:"text-sm text-silver mt-1",children:"No problem \u2014 reach out any time if anything changes."})]})]}),(0,f.jsx)("section",{className:"pp-reveal bg-white rounded-2xl shadow-2xl shadow-carbon/5 p-8 sm:p-10 mb-7 border border-fog",children:(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-10",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,f.jsx)("span",{className:"h-5 w-1 bg-turbo rounded-full"}),(0,f.jsx)("h3",{className:"kicker text-[11px] text-[#555350]",children:"Client Details"})]}),(0,f.jsxs)("dl",{className:"space-y-5",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{className:"kicker text-[10px] text-ash mb-1",children:"Company"}),(0,f.jsx)("dd",{className:"font-display font-bold text-lg leading-tight",children:t.client_company})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{className:"kicker text-[10px] text-ash mb-1",children:"Contact"}),(0,f.jsxs)("dd",{className:"text-[15px] font-semibold",children:[t.contact_name,t.position?(0,f.jsxs)("span",{className:"font-normal text-[#555350]",children:[" \xb7 ",t.position]}):null]})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{className:"kicker text-[10px] text-ash mb-1",children:"Email"}),(0,f.jsx)("dd",{children:(0,f.jsx)("a",{href:"mailto:".concat(t.email),className:"text-[15px] font-semibold text-carbon hover:text-turbo break-words transition-colors",children:t.email})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{className:"kicker text-[10px] text-ash mb-1",children:"Phone"}),(0,f.jsx)("dd",{children:(0,f.jsx)("a",{href:"tel:".concat(t.phone),className:"text-[15px] font-semibold text-carbon hover:text-turbo transition-colors",children:t.phone})})]})]})]})]}),(0,f.jsxs)("div",{className:"md:border-l md:border-fog md:pl-10",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,f.jsx)("span",{className:"h-5 w-1 bg-turbo rounded-full"}),(0,f.jsx)("h3",{className:"kicker text-[11px] text-[#555350]",children:"Project Details"})]}),(0,f.jsxs)("dl",{className:"space-y-5",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{className:"kicker text-[10px] text-ash mb-1",children:"Project"}),(0,f.jsx)("dd",{className:"font-display font-bold text-lg leading-tight",children:t.project_name})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{className:"kicker text-[10px] text-ash mb-1",children:"Date"}),(0,f.jsx)("dd",{className:"text-[15px] font-semibold",children:Z(t.job_date)}),t.start_time&&(0,f.jsx)("dd",{className:"text-sm text-[#555350] mt-0.5",children:t.start_time})]}),t.job_location&&(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{className:"kicker text-[10px] text-ash mb-1",children:"Location"}),(0,f.jsx)("dd",{className:"text-[15px] font-semibold",children:t.job_location})]})]})]})]})]})}),(t.service_summary||t.deliverables&&t.deliverables.length>0)&&(0,f.jsxs)("div",{className:"pp-reveal grid grid-cols-1 md:grid-cols-2 gap-7 mb-7",children:[t.service_summary&&(0,f.jsxs)("section",{className:"relative overflow-hidden bg-carbon text-smoke rounded-2xl shadow-2xl shadow-carbon/20 p-8 sm:p-9",children:[(0,f.jsx)("div",{className:"signal-bar absolute top-0 left-0 w-full h-1"}),(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,f.jsx)("span",{className:"h-5 w-1 bg-turbo rounded-full"}),(0,f.jsx)("h2",{className:"kicker text-[11px] text-ignition",children:"Service Summary"})]}),(0,f.jsx)("div",{className:"summary-prose text-[15.5px] text-silver",dangerouslySetInnerHTML:{__html:or.default.sanitize(t.service_summary)}})]}),t.deliverables&&t.deliverables.length>0&&(0,f.jsxs)("section",{className:"bg-white rounded-2xl shadow-2xl shadow-carbon/5 p-8 sm:p-9 border border-fog",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,f.jsx)("span",{className:"h-5 w-1 bg-turbo rounded-full"}),(0,f.jsx)("h2",{className:"kicker text-[11px] text-[#555350]",children:"What You'll Receive"})]}),(0,f.jsx)("ul",{className:"space-y-3.5",children:t.deliverables.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start gap-3",children:[(0,f.jsx)("span",{className:"shrink-0 mt-0.5 h-5 w-5 rounded-full bg-turbo/10 flex items-center justify-center",children:(0,f.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"#BF212F",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M20 6 9 17l-5-5"})})}
1),(0,f.jsx)("span",{className:"text-[15px] text-graphite leading-snug",children:e})]},t))})]})]}),(0,f.jsxs)("section",{className:"pp-reveal bg-white rounded-2xl shadow-2xl shadow-carbon/5 mb-7 border border-fog overflow-hidden",children:[(0,f.jsxs)("div",{className:"p-7 sm:p-9 pb-2",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-1",children:[(0,f.jsx)("span",{className:"h-6 w-1.5 bg-turbo rounded-full"}),(0,f.jsx)("h2",{className:"kicker text-[11px] text-[#555350]",children:"Investment"})]}),(0,f.jsx)("p",{className:"font-display font-extrabold text-2xl sm:text-3xl tracking-tight ml-4",children:"Investment Breakdown"})]}),(0,f.jsxs)("table",{className:"w-full",children:[(0,f.jsx)("tbody",{className:"divide-y divide-fog",children:t.service_items&&t.service_items.map((e,t)=>{const s=!!e.optional,n=!!e.free_addon,r=!s||(R[t]||!1),i=e.optional_extras||[],o=s&&!ee&&!n;return(0,f.jsxs)(a.Fragment,{children:[(0,f.jsxs)("tr",{className:"align-top ".concat(n?"is-free":s&&!r?"is-off":""),children:[(0,f.jsx)("td",{className:"px-3 sm:px-9 py-5",children:n?(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("span",{className:"shrink-0 mt-1 kicker text-[9px] text-white bg-[#1F9D57] rounded-full px-2 py-0.5",children:"FREE ADD-ON"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-display font-bold text-[16px] leading-tight mb-1 whitespace-pre-wrap",children:e.title||e.description}),e.title&&e.description&&(0,f.jsx)("div",{className:"text-sm text-[#555350] leading-snug whitespace-pre-wrap",children:e.description})]})]}):s?(0,f.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer",children:[(0,f.jsx)("input",{type:"checkbox",checked:r,disabled:ee,onChange:()=>o&&(e=>{P(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!t[e]}))})(t),className:"mt-1 w-5 h-5 shrink-0 accent-[#BF212F] cursor-pointer"}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"row-strike font-display font-bold text-[16px] leading-tight mb-1 flex items-center flex-wrap gap-2 whitespace-pre-wrap",children:[e.title||e.description,(0,f.jsx)("span",{className:"kicker text-[9px] text-turbo bg-turbo/10 rounded-full px-2 py-0.5",children:"Optional"})]}),e.title&&e.description&&(0,f.jsx)("div",{className:"text-sm text-[#555350] leading-snug whitespace-pre-wrap",children:e.description})]})]}):(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("span",{className:"shrink-0 mt-1 kicker text-[9px] text-ash border border-fog rounded px-1.5 py-0.5",children:"Incl"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-display font-bold text-[16px] leading-tight mb-1 whitespace-pre-wrap",children:e.title||e.description}),e.title&&e.description&&(0,f.jsx)("div",{className:"text-sm text-[#555350] leading-snug whitespace-pre-wrap",children:e.description})]})]})}),(0,f.jsx)("td",{className:"px-3 sm:px-9 py-5 text-right font-display font-bold text-[14px] sm:text-[16px] whitespace-nowrap row-strike",children:n?(0,f.jsx)("span",{className:"text-[#1F9D57] font-bold",children:"FREE"}):K(e.price)})]}),r&&i.map(e=>{const s=(W[t]||[]).includes(e.id);return(0,f.jsxs)("tr",{className:"align-top bg-smoke/60 ".concat(s?"":"is-off"),children:[(0,f.jsx)("td",{className:"px-3 sm:px-9 py-3.5 pl-8 sm:pl-16",children:(0,f.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer",children:[(0,f.jsx)("input",{type:"checkbox",checked:s,disabled:ee,onChange:()=>{return!ee&&(s=t,a=e.id,void O(e=>{const t=e[s]||[],n=t.includes(a);return(0,m.A)((0,m.A)({},e),{},{[s]:n?t.filter(e=>e!==a):[...t,a]})}));var s,a},className:"mt-0.5 w-4 h-4 shrink-0 accent-[#BF212F] cursor-pointer"}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"row-strike text-[14px] font-semibold text-graphite flex items-center flex-wrap gap-2",children:[(0,f.jsx)("span",{className:"text-turbo font-bold",children:"+"})," ",e.name,(0,f.jsx)("span",{className:"kicker text-[9px] text-[#555350] bg-fog rounded-full px-2 py-0.5",children:"Add-on"})]}),e.description&&(0,f.jsx)("div",{className:"text-xs text-ash mt-0.5 whitespace-pre-wrap",children:e.description})]})]})}),(0,f.jsxs)("td",{className:"px-3 sm:px-9 py-3.5 text-right text-turbo font-semibold text-[14px] whitespace-nowrap row-strike",children:["+",K(e.price)]})]},"".concat(t,"-x-").concat(e.id))})]},t)})}),(0,f.jsxs)("tfoot",{className:"border-t-2 border-fog",children:[(0,f.jsxs)("tr",{className:"bg-smoke/50",children:[(0,f.jsx)("td",{className:"px-3 sm:px-9 py-3.5 text-right kicker text-[10px] text-[#555350]",children:"Subtotal (ex GST)"}),(0,f.jsx)("td",{className:"px-3 sm:px-9 py-3.5 text-right font-semibold whitespace-nowrap",children:K(X.subtotal)})]}),ne&&(0,f.jsxs)("tr",{style:{background:"#0FA3A3"},children:[(0,f.jsx)("td",{className:"px-3 sm:px-9 py-4 text-right",children:(0,f.jsxs)("span",{className:"inline-flex items-center gap-2.5",children:[(0,f.jsx)("span",{className:"kicker text-[9px] font-bold px-2 py-0.5 rounded-full bg-white",style:{color:"#0B7E7E"},children:"You save"}),(0,f.jsxs)("span",{className:"kicker text-[11px] font-bold text-white",children:["Client Discount \xb7 ","percentage"===t.client_discount_type?"".concat(t.client_discount,"%"):K(t.client_discount),t.client_discount_reason?" ".concat(t.client_discount_reason):""]})]})}),(0,f.jsxs)("td",{className:"px-3 sm:px-9 py-4 text-right font-display font-extrabold text-white text-base sm:text-2xl whitespace-nowrap",children:["-",K(re)]})]}),(0,f.jsxs)("tr",{className:"bg-smoke/50",children:[(0,f.jsx)("td",{className:"px-3 sm:px-9 py-3.5 text-right kicker text-[10px] text-[#555350]",children:"GST \xb7 10%"}),(0,f.jsx)("td",{className:"px-3 sm:px-9 py-3.5 text-right font-semibold whitespace-nowrap",children:K(X.gst)})]}),(0,f.jsxs)("tr",{className:"bg-carbon",children:[(0,f.jsxs)("td",{className:"px-3 sm:px-9 py-6 text-right",children:[(0,f.jsx)("span",{className:"kicker text-[10px] text-ignition block mb-1",children:"Total Investment \xb7 inc GST"}),(0,f.jsx)("span",{className:"font-display font-extrabold text-white text-base tracking-tight",children:"Every angle. Full speed."})]}),(0,f.jsx)("td",{className:"px-3 sm:px-9 py-6 text-right font-display font-extrabold text-white text-lg sm:text-3xl whitespace-nowrap",children:K(X.total)})]}),ie&&(0,f.jsxs)("tr",{style:{background:"#1F9D57"},children:[(0,f.jsxs)("td",{className:"px-3 sm:px-9 py-5 text-right",children:[(0,f.jsxs)("span",{className:"kicker text-[10px] text-white/75 block mb-1",children:["Book before ",Z(t.incentive_expiry_date)]}),(0,f.jsx)("span",{className:"font-display font-extrabold text-white text-base tracking-tight",children:"Bonus early-bird rate"})]}),(0,f.jsx)("td",{className:"px-3 sm:px-9 py-5 text-right font-display font-extrabold text-white text-base sm:text-2xl whitespace-nowrap",children:K(oe)})]})]})]}),ie&&(0,f.jsxs)("div",{className:"m-7 sm:m-9 mt-6 p-6 sm:p-7 rounded-xl relative overflow-hidden",style:{background:"linear-gradient(120deg,#1F9D57,#17794380)",boxShadow:"0 14px 34px -10px rgba(31,157,87,.55)"},children:[(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"","aria-hidden":"true",className:"absolute -right-8 -bottom-10 w-44 opacity-[0.12] pointer-events-none select-none",style:{transform:"rotate(-8deg)"}}),(0,f.jsxs)("div",{className:"relative flex items-start gap-4",children:[(0,f.jsx)("div",{className:"shrink-0 h-12 w-12 rounded-full bg-white flex items-center justify-center shadow-lg",children:(0,f.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#1F9D57",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M13 2 3 14h
17l-1 8 10-12h-7l1-8z"})})}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full bg-white/20 px-3 py-1 mb-2.5",children:[(0,f.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,f.jsx)("span",{className:"ping-dot absolute inline-flex h-full w-full rounded-full bg-white"}),(0,f.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-white"})]}),(0,f.jsx)("span",{className:"kicker text-[10px] text-white",children:"Bonus \xb7 limited-time incentive"})]}),(0,f.jsxs)("h3",{className:"font-display font-extrabold text-xl sm:text-2xl text-white leading-tight mb-1.5 tracking-tight",children:["Book before ",Z(t.incentive_expiry_date)," and save ",Q()]}),(0,f.jsxs)("p",{className:"text-[15px] text-white/85",children:["Your total drops to ",(0,f.jsx)("span",{className:"font-bold text-white",children:K(oe)})," \u2014 locked in the moment you accept."]})]})]})]})]}),t.important_notes&&(Array.isArray(t.important_notes)?t.important_notes.length>0:!!t.important_notes)&&(0,f.jsxs)("section",{className:"pp-reveal bg-white rounded-2xl shadow-xl shadow-carbon/5 p-8 sm:p-9 mb-7 border border-fog",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,f.jsx)("span",{className:"h-5 w-1 bg-turbo rounded-full"}),(0,f.jsx)("h2",{className:"kicker text-[11px] text-[#555350]",children:"Important Proposal Notes"})]}),Array.isArray(t.important_notes)?(0,f.jsx)("ul",{className:"space-y-3.5",children:t.important_notes.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start gap-3.5",children:[(0,f.jsx)("span",{className:"shrink-0 mt-2 h-1.5 w-1.5 bg-turbo rounded-full"}),(0,f.jsx)("span",{className:"text-[15px] text-graphite leading-relaxed",children:e})]},t))}):(0,f.jsx)("div",{className:"terms-prose text-[15px]",dangerouslySetInnerHTML:{__html:or.default.sanitize(t.important_notes)}})]}),L.length>0&&(0,f.jsxs)("section",{className:"pp-reveal mb-7",children:[(0,f.jsxs)("div",{className:"flex items-end justify-between gap-4 mb-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,f.jsx)("span",{className:"h-5 w-1 bg-turbo rounded-full"}),(0,f.jsx)("h2",{className:"kicker text-[11px] text-[#555350]",children:"Recent Work"})]}),(0,f.jsx)("p",{className:"font-display font-extrabold text-2xl sm:text-3xl tracking-tight",children:"Fresh off the floor."})]}),(0,f.jsxs)("div",{className:"hidden sm:flex items-center gap-2.5",children:[(0,f.jsx)("button",{onClick:()=>H(-1),"aria-label":"Previous",className:"h-10 w-10 rounded-full border border-fog bg-white text-carbon hover:bg-carbon hover:text-white hover:border-carbon transition-colors flex items-center justify-center",children:(0,f.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"m15 18-6-6 6-6"})})}),(0,f.jsx)("button",{onClick:()=>H(1),"aria-label":"Next",className:"h-10 w-10 rounded-full border border-fog bg-white text-carbon hover:bg-carbon hover:text-white hover:border-carbon transition-colors flex items-center justify-center",children:(0,f.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"m9 18 6-6-6-6"})})})]})]}),(0,f.jsx)("div",{ref:q,className:"pp-rail flex gap-5 overflow-x-auto pb-3 -mx-4 sm:-mx-6 px-4 sm:px-6",children:L.map(e=>(0,f.jsx)("a",{href:"/recent-gigs/".concat(e.slug),target:"_blank",rel:"noopener noreferrer",className:"job-card group shrink-0 w-[280px] sm:w-[340px] rounded-2xl overflow-hidden border border-graphite bg-carbon block",children:(0,f.jsxs)("div",{className:"relative aspect-[4/5] overflow-hidden",children:[e.hero_image?(0,f.jsx)("img",{src:e.hero_image,alt:e.job_title,loading:"lazy",className:"job-img absolute inset-0 w-full h-full object-cover transition-transform duration-700"}):(0,f.jsx)("div",{className:"job-img absolute inset-0 transition-transform duration-700",style:{background:"linear-gradient(150deg,#0a2a2c,#06181a)"}}),(0,f.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg,transparent 42%,rgba(13,13,13,.92))"}}),(0,f.jsxs)("div",{className:"absolute left-5 right-5 bottom-5",children:[(0,f.jsxs)("div",{className:"kicker text-[10px] text-silver mb-2 flex items-center gap-2",children:[(0,f.jsx)("span",{children:le(e.event_date)}),e.location&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{className:"text-turbo",children:"/"}),(0,f.jsx)("span",{className:"truncate",children:e.location})]})]}),(0,f.jsx)("div",{className:"font-display font-bold text-white text-xl leading-tight mb-3",children:e.job_title}),(0,f.jsxs)("span",{className:"inline-flex items-center gap-2 kicker text-[10px] text-silver",children:["Read the story ",(0,f.jsx)("span",{className:"job-arrow inline-block transition-transform",children:"\u2197"})]})]})]})},e.slug))})]}),(0,f.jsxs)("div",{className:"pp-reveal grid md:grid-cols-2 gap-6 mb-7",children:[(0,f.jsxs)("a",{href:"https://iq.turbo.net.au/showcase",target:"_blank",rel:"noopener noreferrer",className:"show-card group bg-white rounded-2xl shadow-xl shadow-carbon/5 p-8 border border-fog block",children:[(0,f.jsx)("div",{className:"show-icon h-12 w-12 rounded-xl bg-carbon flex items-center justify-center mb-5 transition-colors",children:(0,f.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#F4F2EE",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"}),(0,f.jsx)("circle",{cx:"12",cy:"13",r:"3"})]})}),(0,f.jsx)("div",{className:"kicker text-[10px] text-turbo mb-2 show-cta",children:"Photography"}),(0,f.jsx)("h3",{className:"show-ink font-display font-bold text-xl mb-2 leading-tight",children:"View Photo Examples"}),(0,f.jsx)("p",{className:"show-sub text-[15px] text-[#555350] mb-5 leading-snug",children:"Browse our portfolio of professional event photography."}),(0,f.jsxs)("span",{className:"show-cta inline-flex items-center gap-2 kicker text-[11px] text-carbon",children:["Open gallery ",(0,f.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M7 17 17 7"}),(0,f.jsx)("path",{d:"M7 7h10v10"})]})]})]}),(0,f.jsxs)("a",{href:"https://reviews.turbo.net.au/showcase",target:"_blank",rel:"noopener noreferrer",className:"show-card group bg-white rounded-2xl shadow-xl shadow-carbon/5 p-8 border border-fog block",children:[(0,f.jsx)("div",{className:"show-icon h-12 w-12 rounded-xl bg-carbon flex items-center justify-center mb-5 transition-colors",children:(0,f.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"#F4F2EE",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"m22 8-6 4 6 4V8z"}),(0,f.jsx)("rect",{x:"2",y:"6",width:"14",height:"12",rx:"2"})]})}),(0,f.jsx)("div",{className:"kicker text-[10px] text-turbo mb-2 show-cta",children:"Videography"}),(0,f.jsx)("h3",{className:"show-ink font-display font-bold text-xl mb-2 leading-tight",children:"View Video Examples"}),(0,f.jsx)("p",{className:"show-sub text-[15px] text-[#555350] mb-5 leading-snug",children:"Watch examples of our event videography and highlight reels."}),(0,f.jsxs)("span",{className:"show-cta inline-flex items-center gap-2 kicker text-[11px] text-carbon",children:["Watch reels ",(0,f.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M7 17 17 7"}),(0,f.jsx)("path",{d:"M7 7h10v10"})]})]})]})]}),t.booking_terms&&(0,f.jsxs)("section",{className:"pp-reveal bg-white rounded-2xl shadow-xl shadow-carbon/5 p-8 sm:p-9 mb-8 border border-fog",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,f.jsx)("span",{className:"h-5 w-1 bg-turbo rounded-full"}),(0,f.jsx)("h2",{className:"kicker text-[11px] text-[#555350]",children:"Booking Terms & Conditions"})]}),(0,f.jsx)("div",{className:"terms-prose text-[15px] bg-smoke/60 rounded-xl p-6 border border-fog",dangerouslySetInnerHTML:{__html:or.default.sanitize(t.booking_terms)}})]}),ee&&t.signature&&(0,f.jsxs)("section",{className:"pp-reveal bg-white rounded-2xl shadow-2xl shadow-carbon/5 p-8 sm:p-10 border border-fog border-t-4 border-t-cinema mb-2",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,f.jsx)("span",{className:"h-5 w-1 bg-cinema rounded-full"}),(0,f.jsx)("h2",{className:"kicker text-[11px] text-cinema",children:"Accepted & Signed"})]}),(0,f.jsxs)("div",{className:"grid sm:grid-cols-[1.2fr_1fr] gap-8 items-end",children:[(0,f.jsx)("div",{className:"border-b-2 border-carbon pb-3",children:(0,f.jsx)("img",{src:t.signature.signature_data,alt:"Signature",className:"h-20 w-auto"})}),(0,f.jsxs)("dl",{className:"space-y-3 text-sm",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{className:"kicker text-[10px] text-ash",children:"Signed by"}),(0,f.jsx)("dd",{className:"font-semibold text-[15px]",children:t.signature.signed_by})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{className:"kicker text-[10px] text-ash",children:"Timestamp"}),(0,f.jsx)("dd",{className:"font-semibold text-[15px]",children:hc(t.signature.signed_at).toLocaleStr
1ing("en-AU",{timeZone:"Australia/Melbourne",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"})})]}),t.signature.ip_address&&(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{className:"kicker text-[10px] text-ash",children:"IP address"}),(0,f.jsx)("dd",{className:"font-mono text-[13px] text-[#555350]",children:t.signature.ip_address})]})]})]})]}),se&&!B&&(0,f.jsxs)("section",{className:"pp-reveal relative overflow-hidden bg-carbon text-smoke rounded-2xl shadow-2xl shadow-carbon/20 p-9 sm:p-12 text-center",children:[(0,f.jsx)("div",{className:"signal-bar absolute top-0 left-0 w-full h-1.5"}),(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"","aria-hidden":"true",className:"hidden sm:block absolute -right-16 -bottom-16 w-64 opacity-[0.06] pointer-events-none select-none"}),(0,f.jsxs)("div",{className:"relative z-10",children:[(0,f.jsx)("div",{className:"kicker text-[11px] text-ignition mb-4",children:"Your Decision"}),(0,f.jsx)("h2",{className:"font-display font-extrabold text-white text-2xl sm:text-4xl tracking-tight leading-[0.98] mb-3",children:"Ready to Move Forward?"}),(0,f.jsx)("p",{className:"text-silver text-[16px] max-w-md mx-auto mb-9",children:"Review the proposal above and let us know \u2014 we'll have your crew locked in within hours."}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row justify-center gap-4",children:[(0,f.jsxs)("button",{onClick:()=>l(!0),className:"btn-red inline-flex items-center justify-center gap-2.5 px-9 py-4 bg-turbo text-white rounded-lg font-display font-bold text-base shadow-xl",children:[(0,f.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Accept Proposal"]}),(0,f.jsx)("button",{onClick:()=>d(!0),className:"inline-flex items-center justify-center gap-2.5 px-9 py-4 rounded-lg font-display font-bold text-base text-smoke border border-white/25 hover:border-white/60 hover:bg-white/5 transition-colors",children:"Decline"})]}),(0,f.jsxs)("div",{className:"mt-8 flex items-center justify-center gap-3",children:[(0,f.jsx)("span",{className:"kicker text-[10px] text-ash",children:"Questions first?"}),(0,f.jsxs)("button",{onClick:()=>{window.TurboChat&&"function"===typeof window.TurboChat.toggle?window.TurboChat.toggle():window.location.href="mailto:[email protected]"},className:"group inline-flex items-center gap-2.5 px-5 py-2.5 rounded-full border border-white/20 text-smoke hover:border-cinema hover:text-cinema transition-colors",children:[(0,f.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,f.jsx)("span",{className:"ping-dot absolute inline-flex h-full w-full rounded-full bg-cinema"}),(0,f.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-cinema"})]}),(0,f.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),(0,f.jsx)("span",{className:"font-display font-bold text-sm",children:"Live Chat"})]})]})]})]})]}),(0,f.jsxs)("footer",{className:"bg-carbon text-smoke",children:[(0,f.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-9 flex flex-col sm:flex-row items-center justify-between gap-4 border-t border-graphite",children:[(0,f.jsx)("img",{src:"/turbo-logo-dark.png",alt:"Turbo 360",className:"h-7 w-auto opacity-90"}),(0,f.jsxs)("div",{className:"kicker text-[10px] text-white text-center sm:text-right leading-relaxed",children:[(0,f.jsx)("a",{href:"mailto:[email protected]",className:"text-white hover:text-smoke transition-colors",children:"[email protected]"}),(0,f.jsx)("span",{className:"text-white mx-2",children:"\xb7"}),(0,f.jsx)("a",{href:"tel:1300207446",className:"text-white hover:text-smoke transition-colors",children:"1300 207 446"}),(0,f.jsx)("div",{className:"text-white mt-1.5",children:"\xa9 Turbo 360 \u2014 Every angle. Full speed."})]})]}),(0,f.jsx)("div",{className:"signal-bar h-1.5 w-full"})]}),o&&(0,f.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(20,20,20,.72)",backdropFilter:"blur(4px)"},onClick:e=>{e.target===e.currentTarget&&(l(!1),F(!0))},children:[(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"","aria-hidden":"true",className:"absolute -left-10 -bottom-10 w-72 opacity-[0.06] pointer-events-none select-none",style:{transform:"rotate(-8deg)"}}),(0,f.jsxs)("div",{className:"bg-white rounded-2xl max-w-lg w-full shadow-2xl overflow-hidden relative",children:[(0,f.jsx)("div",{className:"signal-bar h-1.5 w-full"}),(0,f.jsxs)("div",{className:"p-8",children:[(0,f.jsx)("div",{className:"kicker text-[10px] text-turbo mb-2",children:"Confirm Acceptance"}),(0,f.jsx)("h3",{className:"font-display font-extrabold text-2xl tracking-tight mb-6",children:"Accept Proposal"}),(0,f.jsx)("label",{className:"kicker text-[10px] text-[#555350] block mb-2",children:"Full Name *"}),(0,f.jsx)("input",{type:"text",value:p,onChange:e=>h(e.target.value),className:"w-full px-4 py-3 border border-fog rounded-lg mb-5 text-[15px] focus:border-turbo focus:ring-1 focus:ring-turbo outline-none transition",placeholder:"Enter your full name",style:{color:"#141414",backgroundColor:"#fff"}}),(0,f.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,f.jsx)("label",{className:"kicker text-[10px] text-[#555350]",children:"Signature *"}),(0,f.jsx)("button",{type:"button",onClick:()=>{const e=E.current;e.getContext("2d").clearRect(0,0,e.width,e.height)},className:"kicker text-[10px] text-ash hover:text-turbo transition-colors",children:"Clear"})]}),(0,f.jsx)("div",{className:"relative border border-fog rounded-lg overflow-hidden bg-smoke/50",children:(0,f.jsx)("canvas",{ref:E,width:600,height:200,onMouseDown:G,onMouseMove:V,onMouseUp:J,onMouseLeave:J,onTouchStart:G,onTouchMove:V,onTouchEnd:J,className:"w-full block cursor-crosshair bg-white",style:{touchAction:"none",height:"160px"}})}),(0,f.jsx)("p",{className:"text-xs text-[#555350] mt-4 mb-1",children:"By
1signing above, you agree to the terms and conditions outlined in this proposal."}),(0,f.jsxs)("div",{className:"mt-5 flex gap-3",children:[(0,f.jsx)("button",{onClick:()=>{l(!1),F(!0)},disabled:w,className:"flex-1 px-6 py-3.5 rounded-lg font-display font-bold border border-fog text-[#555350] hover:bg-smoke transition-colors",children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{if(!p.trim())return void alert("Please enter your full name");const s=E.current;if(!s)return void alert("Signature pad not available");if(s.getContext("2d").getImageData(0,0,s.width,s.height).data.some(e=>0!==e)){N(!0);try{const a=s.toDataURL("image/png"),n=t.service_items.map((e,t)=>e.optional?R[t]?t:null:t).filter(e=>null!==e),r={};n.forEach(e=>{const t=W[e]||[];t.length>0&&(r[String(e)]=t)});const i=await fetch("".concat(I.fn,"/api/proposals/").concat(e,"/accept"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({signature_data:a,signed_by:p,selected_items:n,selected_extras:r,ip_address:"client",user_agent:navigator.userAgent})});(await i.json()).success?(alert("Thank you! Your acceptance has been recorded. We will be in touch shortly."),U(),l(!1)):alert("Failed to submit acceptance. Please try again.")}catch(T){console.error("Error accepting proposal:",T),alert("An error occurred. Please try again.")}finally{N(!1)}}else alert("Please sign in the signature box")},disabled:w,className:"btn-red flex-1 px-6 py-3.5 bg-turbo text-white rounded-lg font-display font-bold inline-flex items-center justify-center gap-2 disabled:opacity-60",children:[(0,f.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M20 6 9 17l-5-5"})}),w?"Submitting\u2026":"Confirm"]})]})]})]})]}),c&&(0,f.jsx)("div",{className:"tdm-backdrop fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-8",style:{background:"rgba(10,10,11,0.78)",backdropFilter:"blur(6px)"},onClick:e=>{e.target===e.currentTarget&&Y()},children:(0,f.jsxs)("div",{className:"tdm-card bg-white w-full sm:max-w-[520px] overflow-hidden relative flex flex-col rounded-t-2xl sm:rounded-2xl max-h-[94dvh] sm:max-h-none shadow-[0_-12px_40px_rgba(0,0,0,0.35)] sm:shadow-[0_25px_60px_-12px_rgba(0,0,0,0.45)]",children:[(0,f.jsxs)("div",{className:"h-1.5 w-full flex",style:{background:"#141414"},children:[(0,f.jsx)("div",{style:{width:"56px",background:"#BF212F"}}),(0,f.jsx)("div",{style:{width:"18px",background:"#F2A900"}}),(0,f.jsx)("div",{style:{width:"18px",background:"#0FA3A3"}})]}),(0,f.jsx)("div",{className:"sm:hidden flex justify-center pt-2.5",children:(0,f.jsx)("div",{className:"w-10 h-1 rounded-full",style:{background:"#E4E4E9"}})}),v?(0,f.jsxs)("div",{className:"p-[28px_24px_32px_24px] sm:p-[44px_40px] text-center",children:[(0,f.jsx)("div",{className:"tdm-check w-[52px] h-[52px] mx-auto mb-[18px] flex items-center justify-center",style:{background:"#0FA3A3"},children:(0,f.jsx)("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M20 6L9 17l-5-5"})})}),(0,f.jsx)("div",{className:"kicker text-[10px] mb-2.5",style:{color:"#55555C"},children:"Proposal Declined"}),(0,f.jsx)("h3",{className:"font-display font-extrabold uppercase mb-2.5",style:{fontSize:"clamp(19px,5vw,22px)",letterSpacing:"-0.015em",fontStretch:"125%",color:"#141414"},children:"Got it. Thanks for the steer."}),(0,f.jsxs)("p",{className:"text-[15px] mb-6",style:{color:"#55555C",lineHeight:1.5},children:[b?"Marked as declined \u2014 reason noted: ".concat(b.toLowerCase(),"."):"Marked as declined."," If anything changes, this door stays open \u2014 ",(0,f.jsx)("a",{href:"mailto:[email protected]",className:"text-turbo hover:text-redline",children:"[email protected]"}),"."]}),(0,f.jsx)("div",{className:"flex justify-center",children:(0,f.jsx)("button",{onClick:Y,className:"rounded-lg font-display font-bold",style:{width:"140px",height:"48px",background:"#141414",color:"#F4F2EE",border:"none"},children:"Done"})})]}):(0,f.jsxs)("div",{className:"min-h-0 px-5 pt-5 pb-[calc(24px+env(safe-area-inset-bottom))] sm:p-8 overflow-y-auto sm:overflow-visible",children:[(0,f.jsxs)("div",{className:"flex items-baseline justify-between gap-3 mb-2.5",children:[(0,f.jsx)("div",{className:"kicker text-[10px]",style:{color:"#55555C"},children:"Decline Proposal"}),(null===t||void 0===t?void 0:t.proposal_number)&&(0,f.jsxs)("div",{style:{fontFamily:"'Space Mono', ui-monospace, monospace",fontSize:"10px",letterSpacing:"0.1em",color:"#8A8A92"},children:["#",t.proposal_number]})]}),(0,f.jsx)("h3",{className:"font-display font-extrabold uppercase mb-2.5",style:{fontSize:"clamp(20px,5.5vw,24px)",letterSpacing:"-0.015em",fontStretch:"125%",color:"#141414"},children:"Not this time?"}),(0,f.jsx)("p",{className:"text-[15px] mb-[22px]",style:{color:"#55555C",lineHeight:1.5},children:"All good \u2014 timing isn't always right. Mind telling us what got in the way? It helps us put a better offer in front of you next time."}),(0,f.jsx)("div",{className:"kicker text-[10px] mb-2.5",style:{color:"#55555C"},children:"Reason"}),(0,f.jsx)("div",{className:"flex flex-wrap gap-2 mb-2.5",children:("Exceeded Budget"===b?["Exceeded Budget"]:uc).map(e=>(0,f.jsx)("button",{type:"button",onClick:()=>y(b===e?"":e),className:"rounded-full text-sm font-display font-bold transition-all",style:{padding:"9px 16px",minHeight:"44px",transitionDuration:"250ms",transitionTimingFunction:"cubic-bezier(0.16,1,0.3,1)",border:b===e?"1px solid #141414":"1px solid #E4E4E9",background:b===e?"#141414":"#fff",color:b===e?"#F4F2EE":"#55555C"},children:e},e))}),!b&&(0,f.jsx)("p",{className:"text-xs mb-[18px]",style:{color:"#8A8A92"},children:"Select a reason to continue"}),"Exceeded Budget"===b&&(0,f.jsxs)("div",{className:"tdm-nudge rounded-xl overflow-hidden mt-1 mb-[18px]",style:{background:"#141414"},children:[(0,f.jsx)("div",{style:{height:"4px",background:"linear-gradient(90deg, #F2A900 0%, #F2A900 64px, rgba(255,255,255,0.12) 64px)"}}),(0,f.jsxs)("div",{className:"flex items-center",style:{gap:"clamp(12px,3vw,16px)",padding:"clamp(14px,3.5vw,18px)"},children:[(0,f.jsx)("div",{className:"flex-none rounded-[10px] flex items-center justify-center",style:{width:"54px",height:"54px",background:"#F2A900"},children:(0,f.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 24 24",fill:"none",stroke:"#141414",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("rect",{x:"2",y:"6",width:"20",height:"12",rx:"2"}),(0,f.jsx)("circle",{cx:"12",cy:"12",r:"2.5"}),(0,f.jsx)("path",{d:"M6 12h.01M18 12h.01"})]})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("div",{className:"uppercase",style:{fontFamily:"'Space Mono', ui-monospace, monospace",fontSize:"13px",fontWeight:700,letterSpacing:"0.18em",color:"#F2A900",marginBottom:"6px"},children:"Let's talk budget"}),(0,f.jsx)("p",{className:"text-sm font-medium",style:{color:"rgba(244,242,238,0.85)",lineHeight:1.5}
1,children:"What budget did you have in mind? Share a ballpark below and we'd be happy to look at a package that fits it."})]})]})]}),(0,f.jsx)("div",{className:"kicker text-[10px] mb-2.5",style:{color:"#55555C"},children:"Other notes"}),(0,f.jsx)("textarea",{value:u,onChange:e=>g(e.target.value),disabled:!b,placeholder:"Budget, timing, scope\u2026",className:"tdm-notes w-full px-[14px] py-3 rounded-[10px] resize-none transition-colors mb-[18px] sm:mb-6 h-[88px] sm:h-[104px] text-base",style:{border:"1px solid #E4E4E9",color:"#141414",background:b?"#fff":"#F7F7F9",fontFamily:"'Hanken Grotesk', system-ui, sans-serif"}}),(0,f.jsxs)("div",{className:"flex gap-3",children:[(0,f.jsx)("button",{onClick:Y,disabled:w,className:"flex-1 rounded-lg font-display font-bold transition-colors",style:{height:"48px",border:"1px solid #E4E4E9",color:"#55555C",background:"#fff"},children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>{N(!0);try{const t=await fetch("".concat(I.fn,"/api/proposals/").concat(e,"/decline"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:u,category:b})});(await t.json()).success?(j(!0),U()):alert("Failed to submit response. Please try again.")}catch(T){console.error("Error declining proposal:",T),alert("An error occurred. Please try again.")}finally{N(!1)}},disabled:w||!b,className:"btn-red flex-1 rounded-lg font-display font-bold transition-opacity",style:{height:"48px",border:"none",color:"#fff",background:"#BF212F",opacity:b?w?.7:1:.45,pointerEvents:b?"auto":"none"},children:w?"Submitting\u2026":"Decline Proposal"})]})]})]})}),se&&!B&&C&&(0,f.jsxs)("div",{className:"fixed right-4 sm:right-6 z-40 flex flex-col gap-3",style:{bottom:"94px"},children:[(0,f.jsxs)("button",{onClick:()=>{l(!0),F(!1)},className:"group inline-flex items-center justify-center gap-2.5 pl-5 pr-6 py-3.5 bg-[#1F9D57] hover:bg-[#17794D] text-white rounded-full font-display font-bold text-sm shadow-2xl transition-all hover:-translate-y-0.5",title:"Accept this proposal",children:[(0,f.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M20 6 9 17l-5-5"})}),"Accept"]}),(0,f.jsxs)("button",{onClick:()=>{d(!0),F(!1)},className:"group inline-flex items-center justify-center gap-2.5 pl-5 pr-6 py-3.5 bg-turbo hover:bg-redline text-white rounded-full font-display font-bold text-sm shadow-2xl transition-all hover:-translate-y-0.5",title:"Decline this proposal",children:[(0,f.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M18 6 6 18"}),(0,f.jsx)("path",{d:"m6 6 12 12"})]}),"Decline"]})]}),te&&!B&&(0,f.jsx)(xc,{proposalRef:"#".concat(t.proposal_number),projectName:t.project_name,amount:K(t.total)})]})},fc=["Job Cancelled","Exceeded Budget","Not Ready to Proceed","Chose Another Provider"],bc=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)("loading"),[n,i]=(0,a.useState)(null),[o,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(""),[m,p]=(0,a.useState)(!1),x=new URLSearchParams(window.location.search).get("token")||"";(0,a.useEffect)(()=>{x?(async()=>{try{const e=await fetch("".concat(I.fn,"/api/proposals/decline-confirm?token=").concat(encodeURIComponent(x)));if(!e.ok)return void s("invalid");const t=await e.json();i(t),"Declined"===t.status?s("already_declined"):"Accepted"===t.status?s("already_accepted"):s("confirm")}catch(e){s("invalid")}})():s("invalid")},[x]);const h=()=>{n&&n.proposal_id&&e("/proposal/".concat(n.proposal_id))};return(0,f.jsxs)("div",{className:"min-h-screen bg-smoke flex items-center justify-center p-4",style:{fontFamily:"'Hanken Grotesk', Arial, Helvetica, sans-serif"},children:[(0,f.jsx)("style",{children:"\n .btn-decline-red:hover { background: #8E1822 !important; }\n .tdm-confirm-notes:focus { outline: 2px solid #141414; outline-offset: -1px; }\n "}),(0,f.jsxs)("div",{className:"w-full max-w-lg bg-white rounded-2xl shadow-2xl shadow-carbon/10 overflow-hidden border border-fog",children:[(0,f.jsx)("div",{className:"signal-bar h-1.5 w-full",style:{background:"linear-gradient(90deg,#BF212F 0 40%,#F2A900 40% 70%,#0FA3A3 70% 100%)"}}),"loading"===t&&(0,f.jsx)("div",{className:"p-12 text-center text-[#555350]",children:"Loading\u2026"}),"invalid"===t&&(0,f.jsxs)("div",{className:"p-10 text-center",children:[(0,f.jsx)("h1",{className:"font-display font-extrabold text-2xl tracking-tight mb-3 text-carbon",children:"Link not found"}),(0,f.jsx)("p",{className:"text-[15px] text-[#555350]",children:"This decline link isn't valid. If you're trying to respond to a proposal, please use the link from your most recent email, or reply to it directly and we'll sort it out."})]}),"error"===t&&(0,f.jsxs)("div",{className:"p-10 text-center",children:[(0,f.jsx)("h1",{className:"font-display font-extrabold text-2xl tracking-tight mb-3 text-carbon",children:"Something went wrong"}),(0,f.jsx)("p",{className:"text-[15px] text-[#555350]",children:"We couldn't process that just now. Please try again, or reply to your proposal email and we'll take care of it."})]}),"already_declined"===t&&(0,f.jsxs)("div",{className:"p-10 text-center",children:[(0,f.jsx)("div",{className:"kicker text-[10px] text-[#8A857A] mb-2",style:{fontFamily:"'Space Mono', ui-monospace, monospace",textTransform:"uppercase",letterSpacing:"0.26em"},children:"Already Handled"}),(0,f.jsx)("h1",{className:"font-display font-extrabold text-2xl tracking-tight mb-3 text-carbon",children:"You've already declined this one"}),(0,f.jsx)("p",{className:"text-[15px] text-[#555350] mb-8",children:"Nothing more to do here \u2014 we've already closed it out on our side."}),n&&(0,f.jsx)("button",{onClick:h,className:"px-6 py-3 rounded-lg font-display font-bold border border-fog text-[#555350] hover:bg-smoke transition-colors",children:"View proposal"})]}),"already_accepted"===t&&(0,f.jsxs)("div",{className:"p-10 text-center",children:[(0,f.jsx)("div",{className:"kicker text-[10px] text-[#8A857A] mb-2",style:{fontFamily:"'Space Mono', ui-monospace, monospace",textTransform:"uppercase",letterSpacing:"0.26em"},children:"Already Handled"}),(0,f.jsx)("h1",{className:"font-display font-extrabold text-2xl tracking-tight mb-3 text-carbon",children:"This proposal was already accepted"}),(0,f.jsx)("p",{className:"text-[15px] text-[#555350] mb-8",children:"It can't be declined now. If that's not right, just reply to your proposal email and we'll sort it out."}),n&&(0,f.jsx)("button",{onClick:h,className:"px-6 py-3 rounded-lg font-display font-bold border border-fog text-[#555350] hover:bg-smoke transition-colors",children:"View proposal"})]}),"success"===t&&(0,f.jsxs)("div",{className:"p-10 text-center",children:[(0,f.jsx)("div",{className:"kicker text-[10px] text-[#8A857A] mb-2",style:{fontFamily:"'Space Mono', ui-monospace, monospace",textTransform:"uppercase",letterSpacing:"0.26em"},children:"Declined"}),(0,f.jsx)("h1",{className:"font-display font-extrabold text-2xl tracking-tight mb-3 text-carbon",children:"Declined \u2014 thanks for letting us know"}),(0,f.jsx)("p",{className:"text-[15px] text-[#555350]",children:"We've released the date and closed this out. A confirmation has been sent to your inbox. If anything changes down the track, we'd love the chance to work with you."})]}),"confirm"===t&&n&&(0,f.jsxs)("div",{className:"p-8 sm:p-10",children:[(0,f.jsx)("div",{className:"kicker text-[10px] text-[#555350] mb-2",style:{fontFamily:"'Space Mono', ui-monospace, monospace",textTransform:"uppercase",letterSpacing:"0.26em"},children:"Confirm Decline"}),(0,f.jsx)("h1",{className:"font-display font-extrabold text-2xl sm:text-3xl tracking-tight mb-3 text-carbon",children:"Decline this proposal?"}),(0,f.jsxs)("p",{className:"text-[15px] text-[#555350] mb-1",children:["The proposal for ",(0,f.jsx)("strong",{className:"text-carbon",children:n.project_name})," will be marked declined and the date released."]}),(0,f.jsx)("p",{className:"text-[15px] text-[#555350] mb-6",children:"Wrong click? No problem \u2014 just view the proposal instead."}),(0,f.jsx)("label",{className:"kicker text-[10px] text-[#555350] block mb-2",style:{fontFamily:"'Space Mono', ui-monospace, monospace",textTransform:"uppercase",letterSpacing:"0.2em"},children:"Reason"}),(0,f.jsx)("div",{className:"flex flex-wrap gap-2 mb-2.5",children:("Exceeded Budget"===c?["Exceeded Budget"]:fc).map(e=>(0,f.jsx)("button",{type:"button",onClick:()=>d(c===e?"":e),className:"rounded-full text-sm font-display font-bold transition-all",style:{padding:"9px 16px",minHeight:"44px",transitionDuration:"250ms",transitionTimingFunction:"cubic-bezier(0.16,1,0.3,1)",border:c===e?"1px solid #141414":"1px solid #E4E4E9",background:c===e?"#141414":"#fff",color:c===e?"#F4F2EE":"#55555C"},children:e},e))}),!c&&(0,f.jsx)("p",{className:"text-xs mb-4",style:{color:"#8A8A92"},children:"Select a reason to continue"}),"Exceeded Budget"===c&&(0,f.jsxs)("div",{className:"rounded-xl overflow-hidden mt-1 mb-4",style:{background:"#141414"},children:[(0,f.jsx)("div",{style:{height:"4px",background:"linear-gradient(90deg, #F2A900 0%, #F2A900 64px, rgba(255,255,255,0.12) 64px)"}}),(0,f.jsxs)("div",{className:"flex items-center",style:{gap:"14px",padding:"16px"},children:[(0,f.jsx)("div",{className:"flex-none rounded-[10px] flex items-center justify-center",style:{width:"48px",height:"48px",background:"#F2A900"},children:(0,f.jsxs)("svg",{width:"26",height:"26",viewBox:"0 0 24 24",fill:"none",stroke:"#141414",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("rect",{x:"2",y:"6",width:"20",height:"12",rx:"2"}),(0,f.jsx)("circle",{cx:"12",cy:"12",r:"2.5"}),(0,f.jsx)("path",{d:"M6 12h.01M18 12h.01"})]})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("div",{className:"uppercase",style:{fontFamily:"'Space Mono', ui-monospace, monospace",fontSize:"12px",fontWeight:700,letterSpacing:"0.18em",color:"#F2A900",marginBottom:"4px"},children:"Let's talk budget"}),(0,f.jsx)("p",{className:"text-sm font-medium",style:{color:"rgba(244,242,238,0.85)",lineHeight:1.5}
1,children:"What budget did you have in mind? Share a ballpark below and we'd be happy to look at a package that fits it."})]})]})]}),(0,f.jsx)("label",{className:"kicker text-[10px] text-[#555350] block mb-2",style:{fontFamily:"'Space Mono', ui-monospace, monospace",textTransform:"uppercase",letterSpacing:"0.2em"},children:"Other notes"}),(0,f.jsx)("textarea",{value:o,onChange:e=>l(e.target.value),disabled:!c,className:"tdm-confirm-notes w-full px-4 py-3 rounded-lg mb-6 text-base h-24 transition-colors resize-none",placeholder:"Budget, timing, scope\u2026",style:{border:"1px solid #E4E4E9",color:"#141414",background:c?"#fff":"#F7F7F9"}}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,f.jsx)("button",{onClick:h,disabled:m,className:"flex-1 px-6 py-3.5 rounded-lg font-display font-bold border border-fog text-[#555350] hover:bg-smoke transition-colors disabled:opacity-60",children:"No, take me to the proposal"}),(0,f.jsx)("button",{onClick:async()=>{p(!0);try{const e=await fetch("".concat(I.fn,"/api/proposals/decline-confirm"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:x,reason:o||null,category:c||null})}),t=await e.json();"declined"===t.state?s("success"):"already_declined"===t.state?s("already_declined"):"already_accepted"===t.state?s("already_accepted"):s("error")}catch(e){s("error")}finally{p(!1)}},disabled:m||!c,className:"btn-decline-red flex-1 px-6 py-3.5 rounded-lg font-display font-bold transition-opacity",style:{border:"none",color:"#fff",background:"#BF212F",opacity:c?m?.7:1:.45,pointerEvents:c?"auto":"none"},children:m?"Submitting\u2026":"Yes, decline this proposal"})]})]})]})]})};var yc=s(30086);const vc="'Space Mono',monospace",jc={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},wc=e=>{let{children:t,color:s="#9A9AA0",style:a}=e;return(0,f.jsx)("div",{style:(0,m.A)({fontFamily:vc,fontSize:10.5,letterSpacing:"0.16em",color:s,textTransform:"uppercase"},a),children:t})},Nc=(e,t,s)=>({display:"inline-flex",alignItems:"center",gap:7,background:e,color:t,border:s||"none",borderRadius:9,padding:"10px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",textDecoration:"none",whiteSpace:"nowrap"}),Ac=()=>{const{proposalId:e}=(0,r.g)(),t=(0,r.Zp)(),[s,n]=(0,a.useState)(null),[i,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(!0),[p,x]=(0,a.useState)(!1),[h,u]=(0,a.useState)(!1),[g,b]=(0,a.useState)([]),[y,v]=(0,a.useState)("");(0,a.useEffect)(()=>{const e=(0,o.cd)(t);e&&(n(e),j())},[t,e]);const j=async()=>{try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,n=await fetch("".concat(I.fn,"/api/proposals/").concat(e),{headers:{Authorization:"Bearer ".concat(a)}});if(n.ok){const e=await n.json();l(e)}else alert("Failed to load proposal"),t("/admin/proposals")}catch(a){console.error("Error loading proposal:",a),alert("An error occurred"),t("/admin/proposals")}finally{d(!1)}},w=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(e),N=e=>new Date(e).toLocaleDateString("en-AU",{year:"numeric",month:"long",day:"numeric"}),A=e=>e?new Date(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short",timeZone:"Australia/Sydney"}):"\u2014";if(!s)return null;if(c)return(0,f.jsx)(ta,{title:"Proposal",meta:"SALES",children:(0,f.jsx)(Ws,{rows:8})});if(!i)return null;const k="Draft"===i.status,S="Accepted"===i.status,C="".concat(window.location.origin,"/proposal/").concat(e).concat(k?"?preview=true":""),F=k,E=!k&&!S,z=!S,B=i.view_log&&i.view_log.length||i.views||0;return(0,f.jsxs)(ta,{title:"Proposal",meta:"SALES \xb7 PROPOSAL",children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>t("/admin/proposals"),style:Nc("#fff","#55555C","1px solid #E4E4E9"),children:[(0,f.jsx)(Ct.A,{size:15})," Proposals"]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,f.jsx)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:i.proposal_number?"Proposal ".concat(i.proposal_number):"Proposal"}),(0,f.jsx)(Ds,{tone:Rs[i.status]||"gray",radius:7,children:i.status}),i.ai_generated&&(0,f.jsx)("span",{className:"tg-mono",style:{fontSize:8.5,fontWeight:700,background:"linear-gradient(135deg,#7C3AED,#A78BFA)",color:"#fff",borderRadius:4,padding:"3px 6px",letterSpacing:"0.04em",textTransform:"uppercase"},children:"AI Generated"})]}),(0,f.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,f.jsxs)("a",{href:C,target:"_blank",rel:"noopener noreferrer",style:Nc("#fff","#333","1px solid #E4E4E9"),children:[(0,f.jsx)(En.A,{size:15})," ",k?"Preview":"Public Link"]}),z&&(0,f.jsxs)("button",{onClick:()=>t("/admin/proposals/edit/".concat(e)),style:Nc("#fff","#333","1px solid #E4E4E9"),children:[(0,f.jsx)(Tn.A,{size:15})," Edit"]}),F&&(0,f.jsxs)("button",{onClick:async()=>
1{if(confirm("Send this proposal to the client? They will receive an email with a link to view and respond to the proposal.")){x(!0);try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/proposals/").concat(e,"/send"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}});(await a.json()).success?(alert("Proposal sent successfully!"),j()):alert("Failed to send proposal")}catch(s){console.error("Error sending proposal:",s),alert("An error occurred")}finally{x(!1)}}},disabled:p,style:(0,m.A)((0,m.A)({},Nc("#0A0A0B","#fff")),{},{opacity:p?.5:1}),children:[(0,f.jsx)(st.A,{size:15})," Send to Client"]}),E&&(0,f.jsxs)("button",{onClick:async()=>{if(confirm("Resend this proposal to the client?")){x(!0);try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/proposals/").concat(e,"/resend"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}});(await a.json()).success?(alert("Proposal resent successfully!"),j()):alert("Failed to resend proposal")}catch(s){console.error("Error resending proposal:",s),alert("An error occurred")}finally{x(!1)}}},disabled:p,style:(0,m.A)((0,m.A)({},Nc("#fff","#333","1px solid #E4E4E9")),{},{opacity:p?.5:1}),children:[(0,f.jsx)(yc.A,{size:15})," Resend"]}),E&&(0,f.jsxs)("button",{onClick:async()=>{if(confirm("Send a follow-up reminder email to the client for this proposal?")){x(!0);try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/proposals/").concat(e,"/send-followup"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}}),n=await a.json();n.success?(alert(n.message||"Follow-up email sent successfully!"),j()):alert(n.detail||"Failed to send follow-up email")}catch(s){console.error("Error sending follow-up:",s),alert("An error occurred while sending the follow-up email")}finally{x(!1)}}},disabled:p,style:(0,m.A)((0,m.A)({},Nc("#fff","#B45309","1px solid #FED7AA")),{},{opacity:p?.5:1}),children:[(0,f.jsx)(T.A,{size:15})," Send Followup"]}),(0,f.jsxs)("button",{onClick:async()=>{x(!0);try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,n=await fetch("".concat(I.fn,"/api/proposals/").concat(e,"/duplicate"),{method:"POST",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify({})}),r=await n.json();r.success?t("/admin/proposals/edit/".concat(r.proposal_id)):alert(r.detail||"Failed to duplicate proposal")}catch(a){console.error("Error duplicating proposal:",a),alert("An error occurred")}finally{x(!1)}},disabled:p,style:(0,m.A)((0,m.A)({},Nc("#fff","#334155","1px solid #CBD5E1")),{},{opacity:p?.5:1}),children:[(0,f.jsx)(Cr.A,{size:15})," Duplicate"]}),(0,f.jsxs)("button",{onClick:()=>{(async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();e.success&&b(e.clients||[])}}catch(t){console.error("Error loading contacts:",t)}})(),u(!0)},className:"tg-btn-primary",style:Nc("#BF212F","#fff"),children:[(0,f.jsx)(Xe.A,{size:15})," Assign Contact"]}),(0,f.jsx)("button",{onClick:async()=>{let s="Are you sure you want to delete this proposal? This action cannot be undone.";if("Accepted"===i.status?s="\u26a0\ufe0f WARNING: This proposal has been ACCEPTED by the client!\n\nDeleting an accepted proposal will remove all records including the client signature.\n\nAre you absolutely sure you want to proceed?":"Sent"!==i.status&&"Viewed"!==i.status||(s="\u26a0\ufe0f WARNING: This proposal has been sent to the client.\n\nDeleting it will remove the public link and all proposal data.\n\nAre you sure you want to delete this proposal?"),confirm(s)){x(!0);try{var a;const s=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,n=await fetch("".concat(I.fn,"/api/proposals/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}}),r=await n.json();r.success?(alert("Proposal deleted successfully"),t("/admin/proposals")):alert(r.detail||"Failed to delete proposal")}catch(n){console.error("Error deleting proposal:",n),alert("An error occurred while deleting the proposal")}finally{x(!1)}}},disabled:p,title:"Delete proposal",style:(0,m.A)((0,m.A)({},Nc("#fff","#991B1B","1px solid #FECACA")),{},{opacity:p?.5:1}),children:(0,f.jsx)(la.A,{size:15})})]})]}),(0,f.jsxs)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:16,marginBottom:20},children:[(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},jc),{},{padding:18}),children:[(0,f.jsx)(wc,{style:{marginBottom:10},children:"Status"}),(0,f.jsx)("div",{style:{fontSize:18,fontWeight:700,color:"green"===Rs[i.status]?"#15803D":"#0A0A0B"},children:i.status}),(0,f.jsx)("div",{style:{marginTop:7,fontSize:11.5,color:"#9A9AA0"},children:S&&i.signature_date?"signed ".concat(N(i.signature_date)):"created ".concat(A(i.created_at))})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},jc),{},{padding:18}),children:[(0,f.jsx)(wc,{style:{marginBottom:10},children:"First Viewed"}),(0,f.jsx)("div",{className:"tg-mono",style:{fontFamily:vc,fontSize:18,fontWeight:700},children:i.viewed_at?A(i.viewed_at):"\u2014"}),(0,f.jsxs)("div",{style:{marginTop:7,fontSize:11.5,color:"#9A9AA0"},children:[B," total view",1===B?"":"s"]})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},jc),{},{padding:18}),children:[(0,f.jsx)(wc,{style:{marginBottom:10},children:"Sent"}),(0,f.jsx)("div",{className:"tg-mono",style:{fontFamily:vc,fontSize:18,fontWeight:700},children:i.sent_at?A(i.sent_at):"\u2014"}),(0,f.jsx)("div",{style:{marginTop:7,fontSize:11.5,color:"#9A9AA0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i.sent_at?"to ".concat(i.email):"not sent yet"})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},jc),{},{background:"#0A0A0B",border:"1px solid #0A0A0B",padding:18,position:"relative",overflow:"hidden"}),children:[(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-20,bottom:-20,width:84,opacity:.08}}),(0,f.jsx)(wc,{color:"#F87171",style:{marginBottom:10},children:"Booked Total"}),(0,f.jsx)(zs,{amount:i.total,size:26,mutedSize:15,color:"#fff",mutedColor:"#7A7A82"}),(0,f.jsxs)("div",{style:{marginTop:8,fontSize:11.5,color:"#7A7A82"},children:["inc. GST",i.incentive_enabled&&i.incentive_expiry_date?" \xb7 early-bird available":""]})]})]}),(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"1.62fr 1fr",gap:20,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(i.service_summary||i.deliverables&&i.deliverables.length>0)&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},jc),{},{padding:20}),children:[i.service_summary&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(wc,{style:{marginBottom:12},children:"Service Summary"}),(0,f.jsx)("div",{style:{fontSize:14,color:"#333",lineHeight:1.65},dangerouslySetInnerHTML:{__html:or.default.sanitize(i.service_summary)}})]}),i.deliverables&&i.deliverables.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(wc,{style:{margin:i.service_summary?"18px 0 10px":"0 0 10px"},children:"Deliverables"}),(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:i.deliverables.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",ga
1p:9,fontSize:13.5,color:"#333"},children:[(0,f.jsx)(zt.A,{size:15,color:"#16A34A",style:{flexShrink:0,marginTop:2}}),(0,f.jsx)("span",{children:e})]},t))})]})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},jc),{},{overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"Service Quote"}),i.service_items.map((e,t)=>(0,f.jsxs)(a.Fragment,{children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 120px",gap:12,padding:"14px 20px",borderBottom:"1px solid #F2F2F5",alignItems:"start"},children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"pre-wrap"},children:[e.title||e.description,e.optional&&(0,f.jsx)("span",{className:"tg-mono",style:{fontFamily:vc,fontSize:9.5,fontWeight:700,background:"#EEF2FF",color:"#4338CA",borderRadius:5,padding:"2px 6px",marginLeft:8,verticalAlign:"middle",textTransform:"uppercase"},children:"Optional"})]}),e.title&&e.description&&(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0",marginTop:2,whiteSpace:"pre-wrap"},children:e.description})]}),(0,f.jsx)("span",{className:"tg-mono",style:{fontFamily:vc,fontSize:13,fontWeight:700,textAlign:"right"},children:w(e.price)})]}),e.optional_extras&&e.optional_extras.length>0&&e.optional_extras.map((e,s)=>(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 120px",gap:12,padding:"10px 20px 10px 36px",borderBottom:"1px solid #F2F2F5",alignItems:"start",background:"#FBFBFC"},children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{fontSize:13,color:"#333",display:"flex",alignItems:"center",gap:6},children:[(0,f.jsx)("span",{style:{color:"#4338CA"},children:"\u21b3"}),(0,f.jsx)("span",{children:e.name}),(0,f.jsx)("span",{className:"tg-mono",style:{fontFamily:vc,fontSize:9.5,fontWeight:700,background:"#EEF2FF",color:"#4338CA",borderRadius:5,padding:"2px 6px",textTransform:"uppercase"},children:"Add-on"})]}),e.description&&(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",marginTop:2,marginLeft:18,whiteSpace:"pre-wrap"},children:e.description})]}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontFamily:vc,fontSize:13,color:"#4338CA",textAlign:"right"},children:["+",w(e.price)]})]},"".concat(t,"-extra-").concat(s)))]},t)),(0,f.jsxs)("div",{style:{padding:"16px 20px",display:"flex",flexDirection:"column",gap:8,alignItems:"flex-end"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:13},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Subtotal (ex GST)"}),(0,f.jsx)("span",{className:"tg-mono",style:{fontFamily:vc,width:120,textAlign:"right"},children:w(i.subtotal)})]}),i.client_discount>0&&(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:13},children:[(0,f.jsxs)("span",{style:{color:"#15803D"},children:["Discount","percentage"===i.client_discount_type?" (".concat(i.client_discount,"%)"):"",i.client_discount_reason?" \xb7 ".concat(i.client_discount_reason):""]}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontFamily:vc,width:120,textAlign:"right",color:"#15803D"},children:["-",w("percentage"===i.client_discount_type?i.subtotal*i.client_discount/100:i.client_discount)]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:13},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"GST (10%)"}),(0,f.jsx)("span",{className:"tg-mono",style:{fontFamily:vc,width:120,textAlign:"right"},children:w(i.gst)})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:15,fontWeight:700,borderTop:"1px solid #EDEDF0",paddingTop:9,marginTop:2},children:[(0,f.jsx)("span",{children:"Total (inc GST)"}),(0,f.jsx)("span",{className:"tg-mono",style:{fontFamily:vc,width:120,textAlign:"right"},children:w(i.total)})]}),i.incentive_enabled&&i.incentive_expiry_date&&(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:12.5,color:"#15803D",background:"#F0FDF4",border:"1px solid #BBF7D0",borderRadius:9,padding:"9px 12px",marginTop:6,alignSelf:"stretch",justifyContent:"space-between"},children:[(0,f.jsxs)("span",{children:["Early Bird (","percentage"===i.incentive_discount_type?"".concat(i.incentive_discount,"%"):w(i.incentive_discount),") if booked before ",N(i.incentive_expiry_date)]}),(0,f.jsx)("span",{className:"tg-mono",style:{fontFamily:vc,fontWeight:700,whiteSpace:"nowrap"},children:w(i.total-("percentage"===i.incentive_discount_type?i.total*i.incentive_discount/100:i.incentive_discount))})]})]})]}),i.important_notes&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},jc),{},{padding:20}),children:[(0,f.jsx)(wc,{style:{marginBottom:10},children:"Important Notes"}),Array.isArray(i.important_notes)?(0,f.jsx)("ul",{style:{margin:0,paddingLeft:18,fontSize:13.5,color:"#333",lineHeight:1.8},children:i.important_notes.map((e,t)=>(0,f.jsx)("li",{children:e},t))}):(0,f.jsx)("div",{style:{fontSize:13.5,color:"#333",lineHeight:1.7},dangerouslySetInnerHTML:{__html:or.default.sanitize(i.important_notes)}})]}),i.booking_terms&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},jc),{},{padding:20}),children:[(0,f.jsx)(wc,{style:{marginBottom:10},children:"Booking Terms & Conditions"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:"#55555C",lineHeight:1.65},dangerouslySetInnerHTML:{__html:or.default.sanitize(i.booking_terms)}})]}),(0,f.jsx)("section",{style:(0,m.A)((0,m.A)({},jc),{},{padding:"18px 20px"}),children:(0,f.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",ga
1p:12,cursor:"pointer"},children:[(0,f.jsx)("input",{type:"checkbox",checked:i.do_not_follow_up,onChange:async t=>{const s=t.target.checked;try{var a;const n=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,r=await fetch("".concat(I.fn,"/api/proposals/").concat(e,"/follow-up-settings"),{method:"PATCH",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify({do_not_follow_up:s})});(await r.json()).success?l((0,m.A)((0,m.A)({},i),{},{do_not_follow_up:s})):(alert("Failed to update follow-up settings"),t.target.checked=!s)}catch(n){console.error("Error updating follow-up settings:",n),alert("An error occurred"),t.target.checked=!s}},style:{width:18,height:18,marginTop:1,accentColor:"#BF212F",cursor:"pointer"}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:"#0A0A0B"},children:"Do Not Send Automated Follow-ups"}),(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0",marginTop:2},children:"Disable automated reminder emails for this proposal"})]})]})})]}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},jc),{},{overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"Timeline"}),(0,f.jsx)("div",{style:{padding:"6px 20px 16px"},children:[i.responded_at&&{label:"Responded",date:i.responded_at,dot:"#15803D",ring:"#DCFCE7"},i.viewed_at&&{label:"Viewed",date:i.viewed_at,dot:"#0E7490",ring:"#CFFAFE",meta:"".concat(B," view").concat(1===B?"":"s")},i.sent_at&&{label:"Sent",date:i.sent_at,dot:"#B45309",ring:"#FEF3C7",meta:"email + link"},i.created_at&&{label:"Created",date:i.created_at,dot:"#7C3AED",ring:"#EDE9FE",meta:i.ai_generated?"AI-generated draft":void 0}].filter(Boolean).map((e,t,s)=>(0,f.jsxs)("div",{style:{display:"flex",gap:12,padding:"11px 0",borderBottom:t<s.length-1?"1px solid #F2F2F5":"none"},children:[(0,f.jsx)("span",{style:{width:9,height:9,borderRadius:"50%",background:e.dot,marginTop:4,flexShrink:0,boxShadow:"0 0 0 3px ".concat(e.ring)}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600},children:e.label}),(0,f.jsxs)("div",{className:"tg-mono",style:{fontFamily:vc,fontSize:11,color:"#9A9AA0",marginTop:2},children:[N(e.date),e.meta?" \xb7 ".concat(e.meta):""]})]})]},t))})]}),i.view_log&&i.view_log.length>0&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},jc),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,f.jsxs)("span",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)(_.A,{size:16,color:"#1D4ED8"})," View Log"]}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontFamily:vc,fontSize:10.5,background:"#EDEDF0",color:"#55555C",borderRadius:20,padding:"3px 9px",textTransform:"uppercase"},children:[i.view_log.length," view",1===i.view_log.length?"":"s"]})]}),(0,f.jsx)("div",{className:"tg-scroll",style:{padding:"8px 20px 14px",maxHeight:260,overflowY:"auto"},children:i.view_log.slice().reverse().map((e,t)=>{const s=new Date(e.viewed_at).toLocaleString("en-AU",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1,timeZone:"Australia/Sydney"});return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"9px 0",borderBottom:"1px solid #F2F2F5",fontFamily:vc,fontSize:11.5},children:[(0,f.jsxs)("span",{style:{color:"#333"},children:[s," ",(0,f.jsx)("span",{style:{color:"#B5B5BC"},children:"AEST"})]}),(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:e.ip_address})]},t)})})]}),S&&i.signed_by&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},jc),{},{padding:"18px 20px",border:"1px solid #BBF7D0",background:"#F0FDF4"}),children:[(0,f.jsx)(wc,{color:"#15803D",style:{marginBottom:10},children:"Acceptance"}),(0,f.jsxs)("div",{style:{fontSize:13.5,color:"#333",lineHeight:1.7},children:["Signed by ",(0,f.jsx)("strong",{children:i.signed_by}),i.signature_date&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("br",{}),N(i.signature_date)]}),(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"tg-mono",style:{fontFamily:vc,fontSize:11.5,color:"#15803D"},children:"\u2713 Digitally signed & verified"})]})]})]})]}),h&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:(0,f.jsxs)("div",{className:"bg-gradient-to-br from-slate-800 to-gray-800 rounded-3xl shadow-2xl max-w-lg w-full p-8 border-2 border-purple-500",children:[(0,f.jsx)("h3",{className:"text-3xl font-extrabold text-white mb-6",children:"Assign Contact"}),(0,f.jsxs)("div",{className:"mb-6 bg-white/10 rounded-xl p-4",children:[(0,f.jsx)("p",{className:"text-sm text-gray-300 mb-2",children:"Current Contact:"}),(0,f.jsx)("p",{className:"font-bold text-white text-lg",children:i.contact_name}),(0,f.jsx)("p",{className:"text-sm text-gray-400",children:i.email})]}),0===g.length?(0,f.jsx)("div",{className:"mb-6 bg-yellow-500/20 border border-yellow-400/50 rounded-xl p-4",children:(0,f.jsx)("p",{className:"text-yellow-200",children:"No contacts found. Please add contacts in the Clients section first."})}):(0,f.jsx)("div",{className:"mb-6",children:(0,f.jsx)(_n,{contacts:g,selectedContactId:y,onContactSelect:v})}),(0,f.jsx)("div",{className:"bg-blue-500/20 border border-blue-400/50 rounded-xl p-4 mb-6",children:(0,f.jsxs)("p",{className:"text-sm text-blue-200",children:[(0,f.jsx)("strong",{children:"Note:"})," This will link the proposal to this contact for client portal access and update the proposal contact details."]})}),(0,f.jsxs)("div",{className:"flex gap-3",children:[(0,f.jsx)("button",{onClick:()=>{u(!1),v("")},className:"flex-1 px-6 py-3 bg-white/10 hover:bg-white/20 border border-white/30 text-white rounded-xl font-bold",children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>
1{if(y)try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token;(await fetch("".concat(I.fn,"/api/proposals/").concat(e,"/reassign-contact/").concat(y),{method:"PUT",headers:{Authorization:"Bearer ".concat(s)}})).ok?(alert("Proposal reassigned successfully"),u(!1),j()):alert("Failed to reassign proposal")}catch(s){console.error("Error reassigning:",s),alert("Error reassigning proposal")}else alert("Please select a contact")},disabled:!y,className:"flex-1 px-6 py-3 bg-gradient-to-r from-purple-600 to-purple-700 hover:from-purple-700 hover:to-purple-800 text-white rounded-xl font-bold shadow-lg disabled:opacity-50 disabled:cursor-not-allowed",children:"Assign"})]})]})})]})},kc="'Space Mono',monospace",Sc=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)(null),[n,i]=(0,a.useState)(""),[l,c]=(0,a.useState)(!0),[d,m]=(0,a.useState)(!1),[p,x]=(0,a.useState)(null);(0,a.useEffect)(()=>{const t=(0,o.cd)(e);t&&(s(t),h())},[e]);const h=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/admin/settings"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();i(e.default_booking_terms||"")}}catch(t){console.error("Error loading default terms:",t)}finally{c(!1)}};if(!t)return null;const u={display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",opacity:d?.6:1};return(0,f.jsxs)(ta,{title:"Default Terms",meta:"FINANCE \xb7 PROPOSAL TERMS",children:[(0,f.jsx)("style",{children:"\n .default-terms-editor .ql-toolbar {\n background-color: #FBFBFC !important;\n border-color: #EDEDF0 !important;\n border-top-left-radius: 13px;\n border-top-right-radius: 13px;\n }\n .default-terms-editor .ql-container {\n background-color: #ffffff !important;\n border-color: #EDEDF0 !important;\n border-bottom-left-radius: 13px;\n border-bottom-right-radius: 13px;\n min-height: 420px;\n }\n .default-terms-editor .ql-editor {\n background-color: #ffffff !important;\n color: #333 !important;\n font-family: 'Hanken Grotesk', sans-serif;\n font-size: 14px;\n line-height: 1.7;\n }\n .default-terms-editor .ql-editor.ql-blank::before {\n color: #9A9AA0 !important;\n font-style: normal;\n }\n .default-terms-editor .ql-stroke { stroke: #55555C !important; }\n .default-terms-editor .ql-fill { fill: #55555C !important; }\n .default-terms-editor .ql-picker-label { color: #55555C !important; }\n"}),(0,f.jsxs)("div",{style:{maxWidth:840,margin:"0 auto",display:"flex",flexDirection:"column",gap:18},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>e("/admin/proposals"),style:{display:"inline-flex",alignItems:"center",gap:7,fontSize:13,fontWeight:600,color:"#55555C",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{size:15})," Proposals"]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("h1",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:"Default Booking Terms"}),(0,f.jsxs)("div",{style:{fontFamily:kc,fontSize:11,color:"#9A9AA0",marginTop:4},children:["Auto-populates new proposals",p&&" \xb7 last saved ".concat(p.toLocaleString())]})]}),(0,f.jsx)("div",{style:{marginLeft:"auto"},children:(0,f.jsxs)("button",{className:"tg-btn-primary",onClick:async()=>{m(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token;(await fetch("".concat(I.fn,"/api/admin/settings"),{method:"PUT",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify({default_booking_terms:n})})).ok?(x(new Date),alert("Default Terms & Conditions saved successfully!")):alert("Failed to save default terms")}catch(t){console.error("Error saving default terms:",t),alert("An error occurred while saving")}finally{m(!1)}},disabled:d,style:u,children:[(0,f.jsx)(ia.A,{size:15})," ",d?"Saving\u2026":"Save terms"]})})]}),(0,f.jsxs)(Ls,{style:{padding:22,display:"flex",gap:14,alignItems:"flex-start"},children:[(0,f.jsx)("span",{style:{width:38,height:38,flexShrink:0,borderRadius:9,background:"#FEE2E2",color:"#BF212F",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(kt.A,{size:18})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:14,marginBottom:4},children:"About default terms"}),(0,f.jsx)("div",{style:{fontSize:13,color:"#55555C",lineHeight:1.6},children:"These terms automatically populate when creating new proposals. Administrators can still customize or override terms for individual proposals if needed."})]})]}),l?(0,f.jsx)(Ws,{rows:8}):(0,f.jsxs)(Ls,{style:{padding:22},children:[(0,f.jsx)("label",{style:{fontFamily:kc,fontSize:11,fontWeight:700,letterSpacing:"0.16em",textTransform:"uppercase",color:"#9A9AA0",display:"block",marginBottom:12},children:"Terms & Conditions Content"}),(0,f.jsx)("div",{className:"default-terms-editor",children:(0,f.jsx)(zl.A,{theme:"snow",value:n,onChange:i,modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],[{indent:"-1"},{indent:"+1"}],["link"],[{align:[]}],["clean"]]},placeholder:"Enter the default booking terms and conditions..."})})]}),(0,f.jsxs)(Ls,{style:{padding:22,background:"#FBFBFC"},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:14,marginBottom:10},children:"Tips for writing terms & conditions"}),(0,f.jsxs)("ul",{style:{margin:0,paddingLeft:18,fontSize:13,color:"#55555C",lineHeight:1.8},children:[(0,f.jsx)("li",{children:"Use clear, concise language that clients can easily understand"}),(0,f.jsx)("li",{children:"Include payment terms, cancellation policies, and service details"}),(0,f.jsx)("li",{children:"Specify any restrictions or limitations clearly"}),(0,f.jsx)("li",{children:"Review and update regularly to ensure compliance with current policies"})]})]})]})]})},_c=()=>{const e=[{icon:Ue.A,name:"On-Site Photo Package",price:"$300 + GST",description:"10\u201315 edited photos of the exhibitor's stand, team, and products \u2013 delivered within minutes.",features:["High-resolution edited photos","Stand, team, and product shots","Delivered within minutes"]},{icon:Ge.A,name:"Social Media Video Reel",price:"$400 + GST",description:"A 15\u201330 second vertical video reel with captions and logo, ready to post on Reels, TikTok, or LinkedIn.",features:["15-30 second vertical video","Captions and logo included","Ready for social media"]},{icon:Wr.A,name:"Booth Highlight Reel",price:"$800 + GST",description:"A 60\u201390 second highlight video featuring booth visuals, interactions, and interviews.",features:["60-90 second highlight video","Booth visuals and interactions","Professional editing"]},{icon:Xe.A,name:"Interview/Testimonial Video",price:"$250 + GST",description:"A one-minute interview or testimonial video filmed with professional lighting and audio.",features:["1-minute edited video","Professional lighting","Professional audio"]},{icon:Ue.A,name:"Additional Photo Set",price:"$100 + GST",description:"10 additional edited photos to expand your visual content library.",features:["10 additional photos","High-resolution","Same-day delivery"]},{icon:Nt.A,name:"Custom/Hourly Shooting",price:"$200 + GST",description:"30-minute custom session for product demos, presentations, or VIP visits.",features:["30-minute session","Flexible content capture","On-demand availability"]},{icon:F.A,name:"Continuous 'Reel Every Hour' Coverage",price:"$2,000 + GST",description:"Dedicated crew producing one edited reel every hour for constant social updates (6 reels per day).",features:["Dedicated crew all day","One reel every hour","6 reels per day included"]}],t=[{icon:F.A,title:"Fast, Engaging Content",description:"Same-day editing with photos and videos delivered within hours."},{icon:Ia.A,title:"Increased Visibility and ROI",description:"Exhibitors attract more visitors and generate higher online engagement in real time."},{icon:as.A,title:"Turnkey Operation",description:"Turbo 360 manages scheduling, shooting, and editing on-site \u2013 requiring minimal setup from the organiser."}];return(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white",children:[(0,f.jsxs)("div",{className:"relative overflow-hidden bg-gradient-to-br from-gray-900 via-red-900 to-black",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-red-600/20 to-transparent animate-pulse"}),(0,f.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}}),(0,f.jsx)("div",{className:"relative z-10 max-w-7xl mx-auto px-4 py-24 sm:py-32",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-16 sm:h-24 mb-8 mx-auto object-contain filter drop-shadow-2xl"}),(0,f.jsx)("h1",{className:"text-4xl sm:text-6xl lg:text-7xl font-extrabold text-white mb-6 tracking-tight",children:"Content Hub"}),(0,f.jsx)("p",{className:"text-xl sm:text-2xl text-gray-200 mb-4 max-w-4xl mx-auto leading-relaxed",children:"A Content Hub at your exhibition provides on-demand ph
1otography and videography for exhibitors, with same-day turnaround to capture the energy and atmosphere of the event."}),(0,f.jsx)("p",{className:"text-lg sm:text-xl text-gray-300 max-w-3xl mx-auto",children:"It's designed to help exhibitors showcase their presence, engage audiences, and amplify their visibility instantly."})]})}),(0,f.jsx)("div",{className:"absolute bottom-0 left-0 right-0 w-full",children:(0,f.jsx)("svg",{viewBox:"0 0 1440 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-12 sm:h-20",preserveAspectRatio:"none",children:(0,f.jsx)("path",{d:"M0,64L80,69.3C160,75,320,85,480,80C640,75,800,53,960,48C1120,43,1280,53,1360,58.7L1440,64L1440,120L1360,120C1280,120,1120,120,960,120C800,120,640,120,480,120C320,120,160,120,80,120L0,120Z",fill:"rgb(249, 250, 251)"})})})]}),(0,f.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-12 sm:py-16",children:[(0,f.jsxs)("div",{className:"bg-white rounded-3xl shadow-2xl overflow-hidden mb-16",children:[(0,f.jsx)("div",{className:"bg-gradient-to-r from-red-600 to-red-700 px-8 py-6",children:(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(Wr.A,{className:"h-8 w-8 text-white mr-3"}),(0,f.jsx)("h2",{className:"text-3xl font-bold text-white",children:"Overview"})]})}),(0,f.jsxs)("div",{className:"p-8 sm:p-12",children:[(0,f.jsx)("div",{className:"flex justify-center mb-8",children:(0,f.jsx)("img",{src:"https://customer-assets.emergentagent.com/job_turboproposal/artifacts/8gyep47j_AGHA_logo_black.png",alt:"AGHA - Australian Gift & Homewares Association",className:"h-32 sm:h-40 object-contain"})}),(0,f.jsxs)("p",{className:"text-gray-700 text-lg leading-relaxed mb-6",children:["Turbo 360 proposes an on-site Content Hub for the ",(0,f.jsx)("span",{className:"font-bold text-gray-900",children:"AGHA Sydney Gift Fair in 2026"})," \u2013 a dedicated booth where a team of content creators (videographers, photographers, and editors) produce high-quality photo and video content in real time for exhibitors."]}),(0,f.jsx)("p",{className:"text-gray-700 text-lg leading-relaxed mb-6",children:"This service allows vendors at the event to highlight their products and brand with professionally captured and edited content, delivered the same day. Exhibitors can immediately use this content for social media, marketing, and post-event communication, capitalising on the buzz while the event is in full swing and drive more promotion for AGHA with content available immediately for socials."}),(0,f.jsx)("a",{href:"/agha/book",className:"inline-flex items-center gap-2 px-8 py-4 bg-[#BF212F] text-white rounded-xl font-semibold text-lg hover:bg-red-700 transition-colors shadow-lg",children:"Book Your Content Session"})]})]}),(0,f.jsxs)("div",{className:"mb-16",children:[(0,f.jsx)("div",{className:"text-center mb-10",children:(0,f.jsx)("h2",{className:"text-4xl font-bold text-gray-900 mb-3",children:"Benefits for the Event & Exhibitors"})}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:t.map((e,t)=>{const s=e.icon;return(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl p-8 border border-gray-200 hover:shadow-2xl transition-all",children:[(0,f.jsx)("div",{className:"bg-red-100 w-16 h-16 rounded-full flex items-center justify-center mb-6 mx-auto",children:(0,f.jsx)(s,{className:"h-8 w-8 text-red-600"})}),(0,f.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-3 text-center",children:e.title}),(0,f.jsx)("p",{className:"text-gray-700 text-center leading-relaxed",children:e.description})]},t)})})]}),(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl p-8 mb-16 border border-gray-200",children:[(0,f.jsxs)("div",{className:"flex items-center mb-4",children:[(0,f.jsx)("div",{className:"h-8 w-1 bg-gradient-to-b from-red-600 to-red-700 rounded-full mr-3"}),(0,f.jsx)("h2",{className:"text-3xl font-bold text-gray-900",children:"Services Offered at the Content Hub"})]}),(0,f.jsx)("div",{className:"bg-yellow-50 border-l-4 border-yellow-500 p-4 mb-6",children:(0,f.jsx)("p",{className:"text-yellow-800 font-semibold text-lg",children:"\u26a0\ufe0f Pricing Below is Tentative (To Be Confirmed)"})}),(0,f.jsx)("p",{className:"text-gray-700 text-lg mb-8 leading-relaxed",children:"All services include same-day editing and digital delivery (via online). Content can be branded with the exhibitor's logo and formatted for different social platforms."}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map((e,t)=>{const s=e.icon;return(0,f.jsxs)("div",{className:"bg-gradient-to-br from-gray-50 to-white rounded-xl p-6 border-2 border-gray-200 hover:border-red-400 transition-all shadow-md hover:shadow-xl",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-3 mb-4",children:[(0,f.jsx)("div",{className:"bg-red-100 p-2 rounded-lg",children:(0,f.jsx)(s,{className:"h-6 w-6 text-red-600"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:e.name}),(0,f.jsx)("p",{className:"text-2xl font-bold text-red-600",children:e.price})]})]}),(0,f.jsx)("p",{className:"text-gray-700 mb-4 text-sm",children:e.description}),(0,f.jsx)("ul",{className:"space-y-2",children:e.features.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 text-green-600 mr-2 flex-shrink-0 mt-0.5"}),(0,f.jsx)("span",{className:"text-gray-700 text-sm",children:e})]},t))})]},t)})})]}),(0,f.jsxs)("div",{className:"bg-gradient-to-br from-gray-50 to-white rounded-2xl shadow-xl p-8 mb-16 border-2 border-gray-300",children:[(0,f.jsxs)("div",{className:"flex items-center mb-4",children:[(0,f.jsx)("div",{className:"h-8 w-1 bg-gradient-to-b from-yellow-500 to-yellow-600 rounded-full mr-3"}),(0,f.jsx)("h2",{className:"text-3xl font-bold text-gray-900",children:"Package Deals"})]}),(0,f.jsx)("div",{className:"bg-yellow-50 border-l-4 border-yellow-500 p-4 mb-6",children:(0,f.jsx)("p",{className:"text-yellow-800 font-semibold text-lg",children:"\u26a0\ufe0f Pricing Below is Tentative (To Be Confirmed)"})}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[{name:"Bronze",description:"Photo + Reel",price:"$650 + GST",savings:"Save $50",gradient:"from-
1amber-700 to-amber-900"},{name:"Silver",description:"Photo + Highlight Video",price:"$1,050 + GST",savings:"Save $50",gradient:"from-gray-400 to-gray-600"},{name:"Gold",description:"Photo + Highlight + Reel",price:"$1,350 + GST",savings:"Save $150",gradient:"from-yellow-400 to-yellow-600"}].map((e,t)=>(0,f.jsxs)("div",{className:"bg-white rounded-xl overflow-hidden shadow-lg border-2 border-gray-200 hover:shadow-2xl transition-all",children:[(0,f.jsx)("div",{className:"bg-gradient-to-r ".concat(e.gradient," px-6 py-4"),children:(0,f.jsx)("h3",{className:"text-2xl font-bold text-white text-center",children:e.name})}),(0,f.jsxs)("div",{className:"p-6",children:[(0,f.jsx)("p",{className:"text-gray-700 text-center mb-4",children:e.description}),(0,f.jsx)("p",{className:"text-3xl font-bold text-red-600 text-center mb-2",children:e.price}),(0,f.jsx)("div",{className:"bg-green-100 rounded-lg px-4 py-2 text-center",children:(0,f.jsx)("p",{className:"text-green-800 font-bold",children:e.savings})})]})]},t))}),(0,f.jsx)("p",{className:"text-sm text-gray-600 mt-6 text-center italic",children:"*All prices shown plus GST"})]}),(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl p-8 mb-16 border border-gray-200",children:[(0,f.jsxs)("div",{className:"flex items-center mb-6",children:[(0,f.jsx)("div",{className:"h-8 w-1 bg-gradient-to-b from-blue-600 to-blue-700 rounded-full mr-3"}),(0,f.jsx)("h2",{className:"text-3xl font-bold text-gray-900",children:"On-Site Team and Workflow"})]}),(0,f.jsxs)("div",{className:"bg-blue-50 rounded-xl p-6 border border-blue-200",children:[(0,f.jsxs)("p",{className:"text-gray-700 text-lg leading-relaxed mb-4",children:["The on-site crew size is fully scalable and can be adjusted based on pre-bookings and real-time demand during the event. Approximate capacity is between ",(0,f.jsx)("span",{className:"font-bold text-blue-900",children:"15 and 30 content sessions per day"}),", and this can be scaled up as required."]}),(0,f.jsxs)("p",{className:"text-gray-700 text-lg leading-relaxed mb-4",children:["A typical setup includes ",(0,f.jsx)("span",{className:"font-bold text-blue-900",children:"two videographers/photographers and two editors"})," working in parallel to ensure rapid turnaround."]}),(0,f.jsx)("p",{className:"text-gray-700 text-lg leading-relaxed",children:"Content is delivered digitally via a secure download link or USB, with optional assistance for social media uploads."})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl p-8 mb-16 border border-gray-200",children:[(0,f.jsxs)("div",{className:"flex items-center mb-4",children:[(0,f.jsx)("div",{className:"h-8 w-1 bg-gradient-to-b from-red-600 to-red-700 rounded-full mr-3"}),(0,f.jsx)("h2",{className:"text-3xl font-bold text-gray-900",children:"Pricing Structure"})]}),(0,f.jsx)("div",{className:"bg-yellow-50 border-l-4 border-yellow-500 p-4 mb-6",children:(0,f.jsx)("p",{className:"text-yellow-800 font-semibold text-lg",children:"\u26a0\ufe0f Pricing Below is Tentative (To Be Confirmed)"})}),(0,f.jsx)("p",{className:"text-gray-700 mb-6",children:"All prices are in AUD and include on-site shooting, same-day editing, and delivery."}),(0,f.jsx)("div",{className:"overflow-x-auto",children:(0,f.jsxs)("table",{className:"w-full border-collapse",children:[(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{className:"bg-gray-100",children:[(0,f.jsx)("th",{className:"border border-gray-300 px-6 py-3 text-left font-bold text-gray-900",children:"Service Description"}),(0,f.jsx)("th",{className:"border border-gray-300 px-6 py-3 text-left font-bold text-gray-900",children:"Price (AUD)"})]})}),(0,f.jsxs)("tbody",{children:[(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsxs)("td",{className:"border border-gray-300 px-6 py-3 text-gray-700",children:["Booth Photo Package",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-sm text-gray-600",children:"15 edited photos"})]}),(0,f.jsx)("td",{className:"border border-gray-300 px-6 py-3 font-bold text-red-600",children:"$300 + GST"})]}),(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsxs)("td",{className:"border border-gray-300 px-6 py-3 text-gray-700",children:["Social Media Video Reel",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-sm text-gray-600",children:"15\u201330 sec video"})]}),(0,f.jsx)("td",{className:"border border-gray-300 px-6 py-3 font-bold text-red-600",children:"$400 + GST"})]}),(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsxs)("td",{className:"border border-gray-300 px-6 py-3 text-gray-700",children:["Booth Highlight Video",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-sm text-gray-600",children:"60\u201390 sec video"})]}),(0,f.jsx)("td",{className:"border border-gray-300 px-6 py-3 font-bold text-red-600",children:"$800 + GST"})]}),(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsxs)("td",{className:"border border-gray-300 px-6 py-3 text-gray-700",children:["Interview/Testimonial Video",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-sm text-gray-600",children:"1 min edited video"})]}),(0,f.jsx)("td",{className:"border border-gray-300 px-6 py-3 font-bold text-red-600",children:"$250 + GST"})]}),(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsxs)("td",{className:"border border-gray-300 px-6 py-3 text-gray-700",children:["Additional Photo Set",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-sm text-gray-600",children:"10 additional edited photos"})]}),(0,f.jsx)("td",{className:"border border-gray-300 px-6 py-3 font-bold text-red-600",children:"$100 + GST"})]}),(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsxs)("td",{className:"border border-gray-300 px-6 py-3 text-gray-700",children:["Custom/Hourly Shooting",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-sm text-gray-600",children:"30-minute session"})]}),(0,f.jsx)("td",{className:"border border-gray-300 px-6 py-3 font-bold text-red-600",children:"$200 + GST"})]}),(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsxs)("td",{className:"border border-gray-300 px-6 py-3 text-gray-700",children:["Continuous Coverage 'Reel Every Hour'",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-sm text-gray-600",children:"6 reels per day (dedicated crew)"})]}),(0,f.jsx)("td",{className:"border border-gray-300 px-6 py-3 font-bold text-red-600",children:"$2,000 + GST"})]})]})]})})]}),(0,f.jsxs)("div",{className:"bg-gradient-to-br from-green-50 to-white rounded-2xl shadow-xl p-8 mb-16 border-2 border-green-300",children:[(0,f.jsxs)("div",{className:"flex items-center mb-6",children:[(0,f.jsx)("div",{className:"h-8 w-1 bg-gradient-to-b from-green-600 to-green-700 rounded-full mr-3"}),(0,f.jsx)("h2",{className:"text-3xl font-bold text-gray-900",children:"Implementation and Partnership Details"})]}),(0,f.jsxs)("div",{className:"space-y-4 text-gray-700 text-lg leading-relaxed",children:[(0,f.jsx)("p",{children:"Turbo 360 will partner with event organisers to promote the Content Hub as an optional add-on service for exhibitors. Organisers simply promote the service as a value-ad
1ded to exhibitors at much cheaper rate than hiring outside crew for their content."}),(0,f.jsx)("p",{children:"The Content Hub requires only booth space, power, tables, and signage; Turbo 360 supplies all cameras, crew, lighting, and editing equipment and will work independently and directly with vendors."}),(0,f.jsxs)("p",{children:["Bookings can be made prior via a custom built AGHA Branded content booking system - or during the event for walk-up bookings. The on-site crew can scale according to pre-bookings and demand, with an approximate estimated capacity of ",(0,f.jsx)("span",{className:"font-bold text-green-900",children:"15\u201330 sessions per day, expandable if required."})]})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-3xl shadow-2xl overflow-hidden mb-8",children:[(0,f.jsx)("div",{className:"bg-gradient-to-r from-gray-900 to-red-900 px-8 py-6",children:(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)(za.A,{className:"h-8 w-8 text-white mr-3"}),(0,f.jsx)("h2",{className:"text-3xl font-bold text-white",children:"Summary"})]})}),(0,f.jsx)("div",{className:"p-8 sm:p-12",children:(0,f.jsx)("p",{className:"text-gray-700 text-xl leading-relaxed",children:"Turbo 360's Content Hub delivers premium, same-day photo and video content designed to maximise exhibitor exposure and engagement. It's a high-impact, fast-turnaround media service that captures the excitement of your event in real time."})})]}),(0,f.jsxs)("div",{className:"bg-gradient-to-r from-gray-900 via-gray-800 to-red-900 rounded-2xl shadow-2xl p-10 text-white text-center",children:[(0,f.jsx)("h2",{className:"text-3xl font-bold mb-3",children:"Contact Turbo 360"}),(0,f.jsx)("p",{className:"text-xl mb-8 text-red-400 font-semibold",children:"Ready to Amplify Your Event?"}),(0,f.jsxs)("div",{className:"flex flex-col md:flex-row justify-center items-center space-y-4 md:space-y-0 md:space-x-8 text-lg",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)("span",{className:"font-semibold",children:"\ud83d\udce7"}),(0,f.jsx)("a",{href:"mailto:[email protected]",className:"hover:text-red-400 transition-colors",children:"[email protected]"})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)("span",{className:"font-semibold",children:"\ud83c\udf10"}),(0,f.jsx)("a",{href:"https://www.turbo360.au",target:"_blank",rel:"noopener noreferrer",className:"hover:text-red-400 transition-colors",children:"www.turbo360.au"})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,f.jsx)("span",{className:"font-semibold",children:"\ud83d\udcde"}),(0,f.jsx)("a",{href:"tel:0499944333",className:"hover:text-red-400 transition-colors",children:"0499 944 333"})]})]})]})]})]})},Cc=()=>{(0,r.Zp)();const[e,t]=(0,a.useState)(null),[s,n]=(0,a.useState)(!0),[i,o]=(0,a.useState)(null),[l,c]=(0,a.useState)({firstName:"",lastName:"",email:"",businessName:"",mobile:"",boothNumber:"",services:[],date:"",timeSlot:"",termsAccepted:!1}),[d,u]=(0,a.useState)([]),[g,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),[j,w]=(0,a.useState)(null),[N,A]=(0,a.useState)(!1),[k,S]=(0,a.useState)(null),[_,z]=(0,a.useState)({}),B={"photo-package":Ue.A,"social-reel":Ge.A,"highlight-reel":Wr.A,"interview-video":Xe.A,"speakers-package":Di.A,"additional-photos":Ue.A,"custom-session":Nt.A,"continuous-coverage":F.A,bronze:as.A,silver:as.A,gold:as.A};(0,a.useEffect)(()=>{D()},[]),(0,a.useEffect)(()=>{l.date?R(l.date):u([])},[l.date]);const D=async()=>{try{const e=await fetch("".concat(I.fn,"/api/ahw2026/config")),s=await e.json();s.success?t(s.config):o("Failed to load booking configuration")}catch(e){o("Failed to connect to booking system"),console.error("Config load error:",e)}finally{n(!1)}},R=async e=>{b(!0);try{const t=await fetch("".concat(I.fn,"/api/ahw2026/slots?date=").concat(e)),s=await t.json();if(s.success&&(u(s.slots),l.timeSlot)){const e=s.slots.find(e=>e.timeSlot===l.timeSlot);e&&"booked"===e.status&&c(e=>(0,m.A)((0,m.A)({},e),{},{timeSlot:""}))}}catch(t){console.error("Slots load error:",t)}finally{b(!1)}},P=e=>{const{name:t,value:s}=e.target;c(e=>(0,m.A)((0,m.A)({},e),{},{[t]:s})),_[t]&&z(e=>(0,m.A)((0,m.A)({},e),{},{[t]:null}))},W=e=>new Date(e+"T00:00:00").toLocaleDateString("en-AU",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),O=t=>{if(!e)return t;const s=[...e.services,...e.packages].find(e=>e.id===t);return s?s.name:t};return s?(0,f.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)(Kr.A,{className:"h-12 w-12 animate-spin text-red-600 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-600",children:"Loading booking system..."})]})}):i?(0,f.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-8 max-w-md text-center",children:[(0,f.jsx)(h.A,{className:"h-12 w-12 text-red-600 mx-auto mb-4"}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-2",children:"Unable to Load Booking System"}),(0,f.jsx)("p",{className:"text-gray-600 mb-4",children:i}),(0,f.jsx)("button",{onClick:D,className:"px-6 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition",children:"Try Again"})]})}):N&&k?(0,f.jsx)("div",{className:"min-h-screen bg-gradient-to-b from-green-50 to-white py-12 px-4",children:(0,f.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl overflow-hidden",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-green-600 to-green-700 px-8 py-10 text-center",children:[(0,f.jsx)(p.A,{className:"h-16 w-16 text-white mx-auto mb-4"}),(0,f.jsx)("h1",{className:"text-3xl font-bold text-white mb-2",children:"Booking Confirmed!"}),(0,f.jsx)("p",{className:"text-green-100",children:"Your Content Hub session has been reserved"})]}),(0,f.jsxs)("div",{className:"p-8",children:[(0,f.jsxs)("div",{className:"bg-gray-50 rounded-xl p-6 mb-6",children:[(0,f.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Booking Details"}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-600",children:"Booking ID:"}),(0,f.jsxs)("span",{className:"font-mono text-sm text-gray-900 bg-gray-200 px-2 py-1 rounded",children:[k.id.substring(0,8),"..."]})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-600",children:"Name:"}),(0,f.jsxs)("span",{className:"font-medium text-gray-900",children:[k.firstName," ",k.lastName]})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-600",children:"Business:"}),(0,f.jsx)("span",{className:"font-medium text-gray-900",children:k.businessName})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-600",children:"Booth:"}),(0,f.jsx)("span",{className:"font-medium text-gray-900",children:k.boothNumber})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-600",children:"Date:"}),(0,f.jsx)("span",{className:"font-medium text-gray-900",children:W(k.date)})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-600",children:"Time:"}),(0,f.jsx)("span",{className:"font-medium text-gray-900",children:k.timeSlot})]})]})]}),(0,f.jsxs)("div",{className:"bg-blue-50 rounded-xl p-6 mb-6",children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Selected Services"}),(0,f.jsx)("ul",{className:"space-y-2",children:k.services.map(e=>(0,f.jsxs)("li",{className:"flex items-center text-gray-700",children:[(0,f.jsx)(zt.A,{className:"h-5 w-5 text-green-600 mr-2"}),O(e)]},e))})]}),(0,f.jsxs)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-xl p-6 mb-6",children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-yellow-800 mb
1-2",children:"What's Next?"}),(0,f.jsxs)("p",{className:"text-yellow-700",children:["Our team will be at your booth at ",k.timeSlot.split("-")[0]," on ",W(k.date),". Please ensure your booth is ready for your content creation session. A confirmation email has been sent to ",k.email,"."]})]}),(0,f.jsx)("div",{className:"flex justify-center",children:(0,f.jsxs)("button",{onClick:()=>{A(!1),S(null),c({firstName:"",lastName:"",email:"",businessName:"",mobile:"",boothNumber:"",services:[],date:"",timeSlot:"",termsAccepted:!1})},className:"px-8 py-3 bg-red-600 text-white rounded-lg hover:bg-red-700 transition flex items-center justify-center",children:[(0,f.jsx)(Ct.A,{className:"h-5 w-5 mr-2"}),"Back to Booking"]})})]})]})})}):(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white",children:[(0,f.jsx)("div",{className:"bg-gradient-to-br from-gray-900 via-red-900 to-black",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 py-8 sm:py-12",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"mb-6",children:(0,f.jsx)("img",{src:"/ahw2026-logo.png",alt:"Australian Healthcare Week 2026",className:"h-16 sm:h-20 mx-auto object-contain",onError:e=>{e.target.src="https://eco-cdn.iqpc.com/eco/images/builder/avh4iNSoY8eOIDmzZrFcvLLi1ZVgZWFFZmwasHcs.png"}})}),(0,f.jsx)("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-extrabold text-white mb-4",children:"Book Your Content Session"}),(0,f.jsx)("p",{className:"text-lg sm:text-xl text-gray-300 max-w-2xl mx-auto",children:"Australian Healthcare Week 2026 Content Hub - 11th & 12th March 2026"}),(0,f.jsx)("p",{className:"text-sm text-gray-400 mt-4",children:"Services provided by Turbo 360 Australia"})]})})}),(0,f.jsx)("div",{className:"max-w-5xl mx-auto px-4 py-12",children:(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6 border border-gray-200",children:[(0,f.jsx)("div",{className:"bg-red-100 w-12 h-12 rounded-full flex items-center justify-center mb-4 mx-auto",children:(0,f.jsx)(Wr.A,{className:"h-6 w-6 text-red-600"})}),(0,f.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-2 text-center",children:"Stand Out Instantly on the Expo Floor"}),(0,f.jsx)("p",{className:"text-gray-600 text-sm text-center",children:"High-quality photos and videos help exhibitors cut through the noise, showcasing their booth, products, and team in a polished, professional way \u2014 attracting more foot traffic and increasing engagement throughout the event."})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6 border border-gray-200",children:[(0,f.jsx)("div",{className:"bg-red-100 w-12 h-12 rounded-full flex items-center justify-center mb-4 mx-auto",children:(0,f.jsx)(Ia.A,{className:"h-6 w-6 text-red-600"})}),(0,f.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-2 text-center",children:"Ready-to-Post Content That Drives Leads"}),(0,f.jsx)("p",{className:"text-gray-600 text-sm text-center",children:"With same-day delivery, exhibitors get social-ready content they can publish immediately \u2014 boosting online visibility, generating conversation, and capturing leads while the event is still happening."})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6 border border-gray-200",children:[(0,f.jsx)("div",{className:"bg-red-100 w-12 h-12 rounded-full flex items-center justify-center mb-4 mx-auto",children:(0,f.jsx)(as.A,{className:"h-6 w-6 text-red-600"})}),(0,f.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-2 text-center",children:"Stress-Free, Fully Managed Production"}),(0,f.jsx)("p",{className:"text-gray-600 text-sm text-center",children:"Turbo 360 handles everything \u2014 scheduling, shooting, editing, and delivery \u2014 allowing exhibitors to focus on selling, networking, and running their booth without worrying about content creation."})]})]})}),(0,f.jsx)("div",{className:"max-w-4xl mx-auto px-4 py-8",children:(0,f.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),w(null),!(()=>{const e={};return l.firstName.trim()||(e.firstName="First name is required"),l.lastName.trim()||(e.lastName="Last name is required"),l.email.trim()?/^[\w\.\-]+@[\w\.\-]+\.\w+$/.test(l.email)||(e.email="Please enter a valid email address"):e.email="Email is required",l.businessName.trim()||(e.businessName="Business name is required"),l.mobile.trim()?/^[\d\+\-\(\)\s]{8,15}$/.test(l.mobile.replace(/\s/g,""))||(e.mobile="Please enter a valid mobile number"):e.mobile="Mobile number is required",l.boothNumber.trim()||(e.boothNumber="Booth number is required"),0===l.services.length&&(e.services="Please select at least one service"),l.date||(e.date="Please select a date"),l.timeSlot||(e.timeSlot="Please select a time slot"),l.termsAccepted||(e.termsAccepted="You must accept the Terms & Conditions"),z(e),0===Object.keys(e).length})()){const e=document.querySelector(".border-red-500");return void(e&&e.scrollIntoView({behavior:"smooth",block:"center"}))}v(!0);try{const e=await fetch("".concat(I.fn,"/api/ahw2026/bookings"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}),t=await e.json();e.ok&&t.success?(S(t.booking),A(!0),window.scrollTo({top:0,behavior:"smooth"})):409===e.status?(w("This time slot was just booked by another user. Please select a different slot."),R(l.date)):w(t.detail||"Failed to create booking. Please try again.")}catch(t){console.error("Submit error:",t),w("Connection error. Please check your internet and try again.")}finally{v(!1)}},className:"space-y-8",children:[j&&(0,f.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-xl p-4 flex items-start",children:[(0,f.jsx)(h.A,{className:"h-5 w-5 text-red-600 mr-3 flex-shrink-0 mt-0.5"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"font-medium text-red-800",children:"Booking Failed"}),(0,f.jsx)("p",{className:"text-red-700 text-sm",children:j})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-6 sm:p-8",children:[(0,f.jsxs)("div",{className:"flex items-center mb-6",children:[(0,f.jsx)("div",{className:"h-10 w-10 bg-red-100 rounded-full flex items-center justify-center mr-4",children:(0,f.jsx)("span",{className:"text-red-600 font-bold",children:"1"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Select Services"}),(0,f.jsx)("p",{className:"text-gray-600 text-sm",children:"Choose the content services you need"})]})]}),_.services&&(0,f.jsxs)("div",{className:"mb-4 text-red-600 text-sm flex items-center",children:[(0,f.jsx)(h.A,{className:"h-4 w-4 mr-1"}),_.services]}
1),(0,f.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:"Individual Services"}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:null===e||void 0===e?void 0:e.services.filter(e=>!["additional-photos","custom-session"].includes(e.id)).map(e=>{const t=B[e.id]||Ue.A,s=l.services.includes(e.id);return(0,f.jsx)("button",{type:"button",onClick:()=>{return t=e.id,c(e=>{const s=e.services.includes(t)?e.services.filter(e=>e!==t):[...e.services,t];return(0,m.A)((0,m.A)({},e),{},{services:s})}),void(_.services&&z(e=>(0,m.A)((0,m.A)({},e),{},{services:null})));var t},className:"p-4 rounded-xl border-2 text-left transition-all ".concat(s?"border-red-500 bg-red-50":"border-gray-200 hover:border-gray-300 bg-white"),children:(0,f.jsxs)("div",{className:"flex items-start",children:[(0,f.jsx)("div",{className:"p-2 rounded-lg mr-3 ".concat(s?"bg-red-100":"bg-gray-100"),children:(0,f.jsx)(t,{className:"h-5 w-5 ".concat(s?"text-red-600":"text-gray-600")})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("h4",{className:"font-semibold text-gray-900 text-sm",children:e.name}),s&&(0,f.jsx)(zt.A,{className:"h-5 w-5 text-red-600 flex-shrink-0"})]}),(0,f.jsx)("p",{className:"text-red-600 font-bold text-sm",children:e.price}),(0,f.jsx)("p",{className:"text-gray-500 text-xs mt-1",children:e.description})]})]})},e.id)})})]}),(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-6 sm:p-8",children:[(0,f.jsxs)("div",{className:"flex items-center mb-6",children:[(0,f.jsx)("div",{className:"h-10 w-10 bg-red-100 rounded-full flex items-center justify-center mr-4",children:(0,f.jsx)("span",{className:"text-red-600 font-bold",children:"2"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Select Date"}),(0,f.jsx)("p",{className:"text-gray-600 text-sm",children:"Choose your preferred date"})]})]}),_.date&&(0,f.jsxs)("div",{className:"mb-4 text-red-600 text-sm flex items-center",children:[(0,f.jsx)(h.A,{className:"h-4 w-4 mr-1"}),_.date]}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:null===e||void 0===e?void 0:e.allowedDates.map(e=>{const t=l.date===e;return(0,f.jsxs)("button",{type:"button",onClick:()=>(e=>{c(t=>(0,m.A)((0,m.A)({},t),{},{date:e,timeSlot:""})),_.date&&z(e=>(0,m.A)((0,m.A)({},e),{},{date:null}))})(e),className:"p-6 rounded-xl border-2 text-center transition-all ".concat(t?"border-red-500 bg-red-50":"border-gray-200 hover:border-gray-300 bg-white"),children:[(0,f.jsx)(_t.A,{className:"h-8 w-8 mx-auto mb-2 ".concat(t?"text-red-600":"text-gray-400")}),(0,f.jsx)("div",{className:"font-bold text-gray-900",children:W(e)}),t&&(0,f.jsxs)("div",{className:"mt-2 flex items-center justify-center text-red-600 text-sm",children:[(0,f.jsx)(zt.A,{className:"h-4 w-4 mr-1"}),"Selected"]})]},e)})})]}),(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-6 sm:p-8",children:[(0,f.jsxs)("div",{className:"flex items-center mb-6",children:[(0,f.jsx)("div",{className:"h-10 w-10 bg-red-100 rounded-full flex items-center justify-center mr-4",children:(0,f.jsx)("span",{className:"text-red-600 font-bold",children:"3"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Select Time Slot"}),(0,f.jsx)("p",{className:"text-gray-600 text-sm",children:l.date?"Available slots for ".concat(W(l.date)):"Please select a date first"})]})]}),_.timeSlot&&(0,f.jsxs)("div",{className:"mb-4 text-red-600 text-sm flex items-center",children:[(0,f.jsx)(h.A,{className:"h-4 w-4 mr-1"}),_.timeSlot]}),l.date?g?(0,f.jsxs)("div",{className:"text-center py-8",children:[(0,f.jsx)(Kr.A,{className:"h-8 w-8 animate-spin text-red-600 mx-auto mb-2"}),(0,f.jsx)("p",{className:"text-gray-500",children:"Loading available slots..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"flex items-center gap-4 mb-4 text-sm",children:[(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)("div",{className:"w-4 h-4 bg-green-100 border border-green-300 rounded mr-2"}),(0,f.jsx)("span",{className:"text-gray-600",children:"Available"})]}),(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)("div",{className:"w-4 h-4 bg-gray-200 rounded mr-2"}),(0,f.jsx)("span",{className:"text-gray-600",children:"Booked"})]}),(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)("div",{className:"w-4 h-4 bg-red-500 rounded mr-2"}),(0,f.jsx)("span",{className:"text-gray-600",children:"Selected"})]})]}),(0,f.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:d.map(e=>{const t=l.timeSlot===e.timeSlot,s="booked"===e.status;return(0,f.jsxs)("button",{type:"button",disabled:s,onClick:()=>(e=>{"booked"!==e.status&&(c(t=>(0,m.A)((0,m.A)({},t),{},{timeSlot:e.timeSlot})),_.timeSlot&&z(e=>(0,m.A)((0,m.A)({},e),{},{timeSlot:null})))}
1)(e),className:"py-3 px-4 rounded-lg text-center transition-all ".concat(t?"bg-red-600 text-white font-semibold":s?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-green-50 text-gray-900 border border-green-200 hover:border-green-400 hover:bg-green-100"),children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4 mx-auto mb-1 ".concat(t?"text-white":s?"text-gray-300":"text-green-600")}),(0,f.jsx)("span",{className:"text-sm font-medium",children:e.timeSlot}),s&&(0,f.jsxs)("div",{className:"text-xs mt-1 flex items-center justify-center",children:[(0,f.jsx)(x.A,{className:"h-3 w-3 mr-1"}),"Booked"]})]},e.timeSlot)})})]}):(0,f.jsxs)("div",{className:"text-center py-8 text-gray-500",children:[(0,f.jsx)(Nt.A,{className:"h-12 w-12 mx-auto mb-3 text-gray-300"}),(0,f.jsx)("p",{children:"Select a date above to see available time slots"})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-6 sm:p-8",children:[(0,f.jsxs)("div",{className:"flex items-center mb-4",children:[(0,f.jsx)("div",{className:"h-10 w-10 bg-red-100 rounded-full flex items-center justify-center mr-4",children:(0,f.jsx)("span",{className:"text-red-600 font-bold",children:"4"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Your Details"}),(0,f.jsx)("p",{className:"text-gray-600 text-sm",children:"Contact information for your booking"})]})]}),(0,f.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:(0,f.jsx)("p",{className:"text-sm text-blue-800",children:"An invoice will be generated under the business name in the coming days and sent to you for payment processing. Terms: 30 days."})}),(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["First Name ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Ye.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",name:"firstName",value:l.firstName,onChange:P,className:"w-full pl-10 pr-4 py-3 border rounded-lg focus:ring-2 focus:ring-red-500 focus:border-red-500 ".concat(_.firstName?"border-red-500":"border-gray-300"),placeholder:"John"})]}),_.firstName&&(0,f.jsx)("p",{className:"mt-1 text-sm text-red-600",children:_.firstName})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Last Name ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Ye.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",name:"lastName",value:l.lastName,onChange:P,className:"w-full pl-10 pr-4 py-3 border rounded-lg focus:ring-2 focus:ring-red-500 focus:border-red-500 ".concat(_.lastName?"border-red-500":"border-gray-300"),placeholder:"Smith"})]}),_.lastName&&(0,f.jsx)("p",{className:"mt-1 text-sm text-red-600",children:_.lastName})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Email Address ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(T.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"email",name:"email",value:l.email,onChange:P,className:"w-full pl-10 pr-4 py-3 border rounded-lg focus:ring-2 focus:ring-red-500 focus:border-red-500 ".concat(_.email?"border-red-500":"border-gray-300"),placeholder:"[email protected]"})]}),_.email&&(0,f.jsx)("p",{className:"mt-1 text-sm text-red-600",children:_.email})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Mobile Number ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(E.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"tel",name:"mobile",value:l.mobile,onChange:P,className:"w-full pl-10 pr-4 py-3 border rounded-lg focus:ring-2 focus:ring-red-500 focus:border-red-500 ".concat(_.mobile?"border-red-500":"border-gray-300"),placeholder:"0400 000 000"})]}),_.mobile&&(0,f.jsx)("p",{className:"mt-1 text-sm text-red-600",children:_.mobile})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Business N
1ame ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(gs.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",name:"businessName",value:l.businessName,onChange:P,className:"w-full pl-10 pr-4 py-3 border rounded-lg focus:ring-2 focus:ring-red-500 focus:border-red-500 ".concat(_.businessName?"border-red-500":"border-gray-300"),placeholder:"Your Company Pty Ltd"})]}),_.businessName&&(0,f.jsx)("p",{className:"mt-1 text-sm text-red-600",children:_.businessName})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Booth Number ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(C.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",name:"boothNumber",value:l.boothNumber,onChange:P,className:"w-full pl-10 pr-4 py-3 border rounded-lg focus:ring-2 focus:ring-red-500 focus:border-red-500 ".concat(_.boothNumber?"border-red-500":"border-gray-300"),placeholder:"A123"})]}),_.boothNumber&&(0,f.jsx)("p",{className:"mt-1 text-sm text-red-600",children:_.boothNumber})]})]}),(0,f.jsxs)("div",{className:"mt-6 pt-6 border-t border-gray-200",children:[(0,f.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:"Terms & Conditions"}),(0,f.jsxs)("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 mb-4 text-sm text-gray-600",children:[(0,f.jsx)("p",{className:"mb-3",children:"By booking Content Hub services, exhibitors and speakers agree that all fees are payable to Turbo 360, and all content will be delivered digitally. Video content includes up to two rounds of revision requests following delivery of the first draft. Additional revisions may incur fees. Clients are responsible for providing accurate briefs, access, and timely approvals. Production timelines may vary depending on workload and event conditions. Cancellations or schedule changes may incur charges. Turbo 360 may use non-confidential captured material in its portfolio unless otherwise agreed in writing."}),(0,f.jsx)("p",{className:"text-xs text-gray-500 italic",children:"Note: Turbo 360 provides Content Hub services (photo and video production) as an independent supplier. Australian Healthcare Week and IQPC are not affiliated with these services and accept no responsibility or liability for any arrangements, deliverables, or transactions made with Turbo 360."})]}),(0,f.jsxs)("label",{className:"flex items-start cursor-pointer ".concat(_.termsAccepted?"text-red-600":""),children:[(0,f.jsx)("input",{type:"checkbox",name:"termsAccepted",checked:l.termsAccepted,onChange:e=>c(t=>(0,m.A)((0,m.A)({},t),{},{termsAccepted:e.target.checked})),className:"mt-1 h-5 w-5 text-red-600 border-gray-300 rounded focus:ring-red-500"}),(0,f.jsxs)("span",{className:"ml-3 text-sm text-gray-700",children:["I have read and agree to the Terms & Conditions ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]})]}),_.termsAccepted&&(0,f.jsx)("p",{className:"mt-1 text-sm text-red-600",children:_.termsAccepted})]})]}),(0,f.jsx)("div",{className:"flex justify-center",children:(0,f.jsx)("button",{type:"submit",disabled:y,className:"w-full sm:w-auto px-12 py-4 bg-red-600 text-white rounded-xl hover:bg-red-700 transition flex items-center justify-center text-lg font-semibold disabled:opacity-50 disabled:cursor-not-allowed",children:y?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kr.A,{className:"h-5 w-5 mr-2 animate-spin"}),"Processing..."]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.A,{className:"h-5 w-5 mr-2"}),"Confirm Booking"]})})})]})}),(0,f.jsx)("div",{className:"bg-gray-900 text-white py-8 px-4 mt-12",children:(0,f.jsxs)("div",{className:"max-w-4xl mx-auto text-center",children:[(0,f.jsxs)("p",{className:"text-gray-400",children:["Need help? Contact us at"," ",(0,f.jsx)("a",{href:"mailto:[email protected]",className:"text-red-400 hover:text-red-300",children:"[email protected]"})]}),(0,f.jsx)("p",{className:"text-gray-500 text-sm mt-2",children:"Powered by Turbo 360"})]})})]})},Fc="'Space Mono',monospace",Ec={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Tc="150px 1.5fr 1.3fr 90px 150px 1fr 110px 78px",zc=()=>{var e,t;const s=(0,r.Zp)(),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,p]=(0,a.useState)(null),[x,u]=(0,a.useState)(""),[b,y]=(0,a.useState)(""),[v,j]=(0,a.useState)(""),[w,N]=(0,a.useState)(null),[A,k]=(0,a.useState)(!1),S=()=>{const e=(0,o.gf)();if(e)return e;try{const e=localStorage.getItem("turbo360_admin_auth");if(e){return JSON.parse(e).token||null}}catch(t){console.error("Error parsing auth data:",t)}return null};(0,a.useEffect)(()=>{(0,o.cd)()?F():s("/tboadmin")},[b,v,s]);const F=async()=>{c(!0),p(null);try{const e=S();if(!e)return p("Session expired. Please log in again."),void c(!1);let t="".concat(I.fn,"/api/ahw2026/bookings?");b&&(t+="date=".concat(b,"&")),v&&(t+="status=".concat(v,"&")),x&&(t+="search=".concat(encodeURIComponent(x),"&"));const a=await fetch(t,{headers:{Authorization:"Bearer ".concat(e)}});if(401===a.status)return void s("/tboadmin");const n=await a.json();n.success?i(n.bookings):p("Failed to load bookings")}catch(e){console.error("Error loading bookings:",e),p("Failed to connect to server")}finally{c(!1)}},z=async e=>{if(window.confirm("Are you sure you want to cancel this booking?"))try{const t=S();(await fetch("".concat(I.fn,"/api/ahw2026/bookings/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}})).ok?F():alert("Failed to cancel booking")}catch(t){console.error("Error cancelling booking:",t),alert("Error cancelling booking")}},B=e=>{if(!e)return"N/A";try{return new Date(e+"T00:00:00").toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short",year:"numeric"})}catch(t){return e}},D=e=>{if(!e)return"N/A";
1try{return new Date(e).toLocaleString("en-AU",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})}catch(t){return e}},R=()=>{const e=[["ID","Name","Business","Email","Mobile","Booth","Date","Time","Services","Status","Created"],...n.map(e=>[e.id,"".concat(e.firstName," ").concat(e.lastName),e.businessName,e.email,e.mobile,e.boothNumber,e.date,e.timeSlot,e.services.join("; "),e.status,e.createdAt])].map(e=>e.map(e=>'"'.concat(e,'"')).join(",")).join("\n"),t=new Blob([e],{type:"text/csv"}),s=window.URL.createObjectURL(t),a=document.createElement("a");a.href=s,a.download="ahw2026-bookings-".concat((new Date).toISOString().split("T")[0],".csv"),a.click()},P=n.filter(e=>{var t,s,a,n,r,i;if(!x)return!0;const o=x.toLowerCase();return(null===(t=e.firstName)||void 0===t?void 0:t.toLowerCase().includes(o))||(null===(s=e.lastName)||void 0===s?void 0:s.toLowerCase().includes(o))||(null===(a=e.email)||void 0===a?void 0:a.toLowerCase().includes(o))||(null===(n=e.businessName)||void 0===n?void 0:n.toLowerCase().includes(o))||(null===(r=e.boothNumber)||void 0===r?void 0:r.toLowerCase().includes(o))||(null===(i=e.mobile)||void 0===i?void 0:i.includes(o))}),W=n.length,O=n.filter(e=>"active"===e.status).length,L=n.filter(e=>"2026-03-11"===e.date).length,M=n.filter(e=>"2026-03-12"===e.date).length,q=e=>{let{label:t,value:s,color:a="#0A0A0B"}=e;return(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Ec),{},{padding:18}),children:[(0,f.jsx)("div",{style:{fontFamily:Fc,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:9},children:t}),(0,f.jsx)("div",{style:{fontFamily:Fc,fontWeight:700,fontSize:28,letterSpacing:"-0.03em",lineHeight:1,color:a},children:s})]})};return(0,f.jsxs)(ta,{title:"AHW 2026",meta:"EVENTS \xb7 BOOKINGS",action:{label:"Export CSV",icon:es.A,onClick:R},children:[(0,f.jsxs)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:16,marginBottom:20},children:[(0,f.jsx)(q,{label:"TOTAL BOOKINGS",value:W,color:"#4338CA"}),(0,f.jsx)(q,{label:"ACTIVE",value:O,color:"#15803D"}),(0,f.jsx)(q,{label:"MAR 11",value:L,color:"#1D4ED8"}),(0,f.jsx)(q,{label:"MAR 12",value:M,color:"#7C3AED"})]}),d&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Ec),{},{border:"1px solid #FECACA",background:"#FEF2F2",padding:"14px 18px",marginBottom:20,display:"flex",alignItems:"center",gap:12}),children:[(0,f.jsx)(h.A,{size:18,color:"#991B1B"}),(0,f.jsx)("span",{style:{color:"#991B1B",fontSize:13.5,fontWeight:600},children:d})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Ec),{},{overflow:"hidden"}),children:[(0,f.jsxs)("form",{onSubmit:e=>{e.preventDefault(),F()},style:{display:"flex",alignItems:"center",gap:12,padding:"16px 18px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:200},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{type:"text",value:x,onChange:e=>u(e.target.value),placeholder:"Search by name, email, business\u2026",style:{border:"none",background:"transparent",outline:"none",fontSize:13,width:"100%"}})]}),(0,f.jsxs)("select",{value:b,onChange:e=>y(e.target.value),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)("option",{value:"",children:"Date: All"}),(0,f.jsx)("option",{value:"2026-03-11",children:"March 11, 2026"}),(0,f.jsx)("option",{value:"2026-03-12",children:"March 12, 2026"})]}),(0,f.jsxs)("select",{value:v,onChange:e=>j(e.target.value),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)("option",{value:"",children:"Status: All"}),(0,f.jsx)("option",{value:"active",children:"Active"}),(0,f.jsx)("option",{value:"cancelled",children:"Cancelled"})]}),(0,f.jsx)("button",{type:"submit",className:"tg-btn-primary",style:{background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"9px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Search"}),(0,f.jsxs)("button",{type:"button",onClick:F,style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(As.A,{size:14})," Refresh"]}),(0,f.jsxs)("button",{type:"button",onClick:R,style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(es.A,{size:14})," Export CSV"]})]}),(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:Tc,gap:12,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:Fc,fontSize:10,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Business"}),(0,f.jsx)("span",{children:"Contact"}),(0,f.jsx)("span",{children:"Email / Mobile"}),(0,f.jsx)("span",{children:"Booth"}),(0,f.jsx)("span",{children:"Date & Time"}),(0,f.jsx)("span",{children:"Services"}),(0,f.jsx)("span",{children:"Status"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Actions"})]}),l?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:8})}):0===P.length?(0,f.jsx)(Os,{icon:_t.A,title:"No bookings found",message:"No bookings match your search criteria."}):P.map(e=>{var t,s;return(0,f.jsxs)("div",{className:"tg-row",style:{display:"grid",gridTemplateColumns:Tc,gap:12,alignItems:"center",padding:"13px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer"},onClick:()=>{N(e),k(!0)},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.businessName}),(0,f.jsxs)("div",{style:{fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[e.firstName," ",e.lastName]})]}),(0,f.jsxs)("div",{style:{minWidth:0,fontSize:13,color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[e.firstName," ",e.lastName]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:12,color:"#55555C",minWidth:0},children:[(0,f.jsx)(T.A,{size:13,style:{flexShrink:0}}),(0,f.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.email})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:5,fontSize:12,color:"#9A9AA0"},children:[(0,f.jsx)(E.A,{size:13,style:{flexShrink:0}}),(0,f.jsx)("span",{children:e.mobile})]})]}),(0,f.jsxs)("span",{style:{fontFamily:Fc,fontSize:12,color:"#55555C",display:"inline-flex",alignItems:"center",gap:4},children:[(0,f.jsx)(C.A,{size:12}),e.boothNumber]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:Fc,fontSize:12,fontWeight:700,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:B(e.date)}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,fontSize:11.5,color:"#9A9AA0"},children:[(0,f.jsx)(Nt.A,{size:12}),e.timeSlot]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:5,flexWrap:"wrap"},children:[null===(t=e.services)||void 0===t?void 0:t.slice(0,2).map((e,t)=>(0,f.jsx)("span",{style:{fontSize:10.5,background:"#F2F2F5",color:"#55555C",borderRadius:5,padding:"2px 7px"},children:e},t)),(null===(s=e.services)||void 0===s?void 0:s.length)>2&&(0,f.jsxs)("span",{style:{fontSize:10.5,background:"#EDEDF0",color:"#9A9AA0",borderRadius:5,padding:"2px 7px"},children:["+",e.services.length-2]})]}),(0,f.jsx)("span",{children:(0,f.jsx)(Ds,{tone:"active"===e.status?"green":"danger",children:"active"===e.status?"Active":"Cancelled"})}),(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:4},children:[(0,f.jsx)("button",{onClick:()=>{N(e),k(!0)},title:"View Details",style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",padding:6,display:"flex",borderRadius:7},children:(0,f.jsx)(_.A,{size:16})}),"active"===e.status&&(0,f.jsx)("button",{onClick:()=>z(e.id),title:"Cancel Booking",style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",padding:6,display:"flex",borderRadius:7},children:(0,f.jsx)(la.A,{size:16})})]})]},e.id)}),!l&&P.length>0&&(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 22px",borderTop:"1px solid #EDEDF0"},children:(0,f.jsxs)("span",{style:{fontFamily:Fc,fontSize:11.5,color:"#9A9AA0"},children:["SHOWING ",P.length," OF ",n.length]})})]}),A&&w&&(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(10,10,11,.55)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:80,padding:16},onClick:()=>k(!1),children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Ec),{},{borderRadius:16,maxWidth:540,width:"100%",maxHeight:"90vh",overflowY:"auto"}),onClick:e=>e.stopPropagation(),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:18,letterSpacing:"-0.01em"},children:"Booking Details"}),(0,f.jsx)("button",{onClick:()=>k(!1),style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",padding:6,display:"flex"},children:(0,f.jsx)(g.A,{size:18})})]}),(0,f.jsxs)("div",{style:{padding:22,display:"flex",flexDirection:"column",gap:18},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:Fc,fontSize:10,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:5},children:"Booking ID"}),(0,f.jsx)("div",{style:{fontFamily:Fc,fontSize:13,color:"#0A0A0B"},children:w.id})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:Fc,fontSize:10,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:5},children:"Status"}),(0,f.jsx)(Ds,{tone:"active"===w.status?"green":"danger",children:null===(e=w.status)||void 0===e?void 0:e.toUpperCase()})]})]}),(0,f.jsxs)("div",{style:{borderTop:"1px solid #EDEDF0",paddingTop:16},children:[(0,f.jsx)("div",{style:{fontFamily:Fc,fontSize:10,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:6},children:"Contact"}),(0,f.jsxs)("div",{style:{fontSize:14,fontWeight:600},children:[w.firstName," ",w.lastName]}),(0,f.jsx)("div",{style:{fontSize:13,color:"#55555C"},children:w.email}),(0,f.jsx)("div",{style:{fontSize:13,color:"#55555C"},children:w.mobile})]}),(0,f.jsxs)("div",{style:{borderTop:"1px solid #EDEDF0",paddingTop:16},children:[(0,f.jsx)("div",{style:{fontFamily:Fc,fontSize:10,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:6},children:"Business & Booth"}),(0,f.jsx)("div",{style:{fontSize:14,fontWeight:600},children:w.businessName}),(0,f.jsxs)("div",{style:{fontSize:13,color:"#55555C"},children:["Booth: ",w.boothNumber]})]}),(0,f.jsxs)("div",{style:{borderTop:"1px solid #EDEDF0",paddingTop:16},children:[(0,f.jsx)("div",{style:{fontFamily:Fc,fontSize:10,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:6},children:"Session"}),(0,f.jsx)("div",{style:{fontSize:14,fontWeight:600},children:B(w.date)}),(0,f.jsx)("div",{style:{fontSize:13,color:"#55555C"},children:w.timeSlot})]}),(0,f.jsxs)("div",{style:{borderTop:"1px solid #EDEDF0",paddingTop:16},children:[(0,f.jsx)("div",{style:{fontFamily:Fc,fontSize:10,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:8},children:"Services"}),(0,f.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:null===(t=w.services)||void 0===t?void 0:t.map((e,t)=>(0,f.jsx)("span",{style:{fontSize:11.5,background:"#F2F2F5",color:"#55555C",borderRadius:6,padding:"4px 10px"},children:e},t))})]}),(0,f.jsxs)("div",{style:{borderTop:"1px solid #EDEDF0",paddingTop:16,fontFamily:Fc,fontSize:11.5,color:"#9A9AA0",display:"flex",flexDirection:"column",gap:4},children:[(0,f.jsxs)("span",{children:["CREATED: ",D(w.createdAt)]}),(0,f.jsxs)("span",{children:["UPDATED: ",D(w.updatedAt)]})]})]}),(0,f.jsxs)("div",{style:{padding:"16px 22px",borderTop:"1px solid #EDEDF0",background:"#FBFBFC",display:"flex",justifyContent:"flex-end",gap:10},children:[(0,f.jsx)("button",{onClick:()=>k(!1),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 16px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:"Close"}),"active"===w.status&&(0,f.jsx)("button",{onClick:()=>{z(w.id),k(!1)},className:"tg-btn-primary",style:{background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"9px 16px",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Cancel Booking"})]})]})})]})};var Bc=s(27598),Dc=s(86376);const Ic={"photo-package":Ue.A,"social-reel":Ge.A,"highlight-reel":Wr.A,"interview-video":Xe.A,"speakers-package":Xe.A,"additional-photos":Ue.A,"custom-session":Nt.A,"continuous-coverage":F.A,bronze:as.A,silver:as.A,gold:as.A}
1,Rc={style:{base:{fontSize:"16px",color:"#1f2937","::placeholder":{color:"#9ca3af"}}}},Pc=e=>new Date(e+"T00:00:00").toLocaleDateString("en-AU",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),Wc=e=>"$".concat(Number(e||0).toLocaleString("en-AU",{minimumFractionDigits:2,maximumFractionDigits:2}));function Oc(e){var t,s,n,r,i;let{config:o,stripeReady:l}=e;const c=(0,Bc.t2)(),d=(0,Bc.HH)(),[u,g]=(0,a.useState)({firstName:"",lastName:"",email:"",businessName:"",mobile:"",boothNumber:"",services:[],date:"",timeSlot:"",termsAccepted:!1}),[b,y]=(0,a.useState)(l?"stripe":"invoice"),[v,j]=(0,a.useState)([]),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(!1),[S,_]=(0,a.useState)(null),[F,z]=(0,a.useState)(!1),[B,D]=(0,a.useState)(null),[R,P]=(0,a.useState)({}),W=[...o.services||[],...o.packages||[]],O=Object.fromEntries(W.map(e=>[e.id,e])),L=null!==(t=o.gstRate)&&void 0!==t?t:.1,M=u.services.reduce((e,t)=>{var s;return e+Number((null===(s=O[t])||void 0===s?void 0:s.price)||0)},0),q=+(M*L).toFixed(2),H=+(M+q).toFixed(2);(0,a.useEffect)(()=>{if(!u.date)return void j([]);let e=!1;return N(!0),fetch("".concat(I.fn,"/api/agha/slots?date=").concat(u.date)).then(e=>e.json()).then(t=>{if(!e&&t.success&&(j(t.slots),u.timeSlot)){const e=t.slots.find(e=>e.timeSlot===u.timeSlot);e&&"booked"===e.status&&g(e=>(0,m.A)((0,m.A)({},e),{},{timeSlot:""}))}}).catch(e=>console.error("Slots load error:",e)).finally(()=>!e&&N(!1)),()=>{e=!0}},[u.date]);const U=e=>{const{name:t,value:s}=e.target;g(e=>(0,m.A)((0,m.A)({},e),{},{[t]:s})),R[t]&&P(e=>(0,m.A)((0,m.A)({},e),{},{[t]:null}))},G=e=>{g(t=>(0,m.A)((0,m.A)({},t),{},{services:t.services.includes(e)?t.services.filter(t=>t!==e):[...t.services,e]})),R.services&&P(e=>(0,m.A)((0,m.A)({},e),{},{services:null}))},V=()=>{z(!1),D(null),g({firstName:"",lastName:"",email:"",businessName:"",mobile:"",boothNumber:"",services:[],date:"",timeSlot:"",termsAccepted:!1}),y("invoice")};if(F&&B){const e="paid"===B.payment_status;return(0,f.jsx)("div",{className:"min-h-screen bg-gradient-to-b from-green-50 to-white py-12 px-4",children:(0,f.jsxs)("div",{className:"max-w-2xl mx-auto bg-white rounded-2xl shadow-xl overflow-hidden",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-green-600 to-green-700 px-8 py-10 text-center",children:[(0,f.jsx)(p.A,{className:"h-16 w-16 text-white mx-auto mb-4"}),(0,f.jsx)("h1",{className:"text-3xl font-bold text-white mb-2",children:"Booking Confirmed!"}),(0,f.jsx)("p",{className:"text-green-100",children:"Your Content Hub session has been reserved"})]}),(0,f.jsxs)("div",{className:"p-8",children:[(0,f.jsxs)("div",{className:"bg-gray-50 rounded-xl p-6 mb-6 space-y-3",children:[(0,f.jsx)(Lc,{label:"Booking ID",value:"".concat(B.id.substring(0,8),"..."),mono:!0}),(0,f.jsx)(Lc,{label:"Name",value:"".concat(B.firstName," ").concat(B.lastName)}),(0,f.jsx)(Lc,{label:"Business",value:B.businessName}),(0,f.jsx)(Lc,{label:"Booth",value:B.boothNumber}),(0,f.jsx)(Lc,{label:"Date",value:Pc(B.date)}),(0,f.jsx)(Lc,{label:"Time",value:B.timeSlot}),(0,f.jsx)(Lc,{label:"Total",value:"".concat(Wc(B.amount_total)," inc GST")})]}),(0,f.jsxs)("div",{className:"rounded-xl p-6 mb-6 border ".concat(e?"bg-green-50 border-green-200":"bg-yellow-50 border-yellow-200"),children:[(0,f.jsx)("h3",{className:"text-lg font-semibold mb-2 ".concat(e?"text-green-800":"text-yellow-800"),children:e?"Payment Received":"Invoice to Follow"}),(0,f.jsx)("p",{className:e?"text-green-700":"text-yellow-700",children:e?"Payment received and confirmed. A receipt has been emailed to ".concat(B.email,"."):"An invoice will be generated under your business name and emailed to ".concat(B.email," for payment (30-day terms).")})]}),(0,f.jsx)("div",{className:"flex justify-center",children:(0,f.jsxs)("button",{onClick:V,className:"px-8 py-3 bg-[#BF212F] text-white rounded-lg hover:bg-red-700 transition flex items-center",children:[(0,f.jsx)(Ct.A,{className:"h-5 w-5 mr-2"})," Make Another Booking"]})})]})]})})}return(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white",children:[(0,f.jsx)("div",{className:"bg-gradient-to-br from-gray-900 via-red-900 to-black",children:(0,f.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8 sm:py-12 text-center",children:[(0,f.jsx)("div",{className:"inline-block bg-white rounded-xl px-6 py-4 mb-6",children:(0,f.jsx)("img",{src:"https://customer-assets.emergentagent.com/job_turboproposal/artifacts/8gyep47j_AGHA_logo_black.png",alt:"AGHA",className:"h-12 sm:h-14 object-contain"})}),(0,f.jsx)("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-extrabold text-white mb-3",children:"Book Your Content Session"}),(0,f.jsxs)("p",{className:"text-lg sm:text-xl text-gray-300 max-w-2xl mx-auto",children:[o.eventName," Content Hub"]}),(0,f.jsx)("p",{className:"text-sm text-gray-400 mt-3",children:"Services provided by Turbo 360 Australia"})]})}),(0,f.jsx)("div",{className:"max-w-5xl mx-auto px-4 pt-12",children:(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[{Icon:Wr.A,title:"Stand Out Instantly on the Expo Floor",text:"High-quality photos and videos help exhibitors cut through the noise, showcasing their booth, products, and team in a polished, professional way \u2014 attracting more foot traffic and increasing engagement throughout the event."},{Icon:Ia.A,title:"Ready-to-Post Content That Drives Leads",text:"With same-day delivery, exhibitors get social-ready content they can publish immediately \u2014 boosting online visibility, generating conversation, and capturing leads while the event is still happening."},{Icon:as.A,title:"Stress-Free, Fully Managed Production",text:"Turbo 360 handles everything \u2014 scheduling, shooting, editing, and delivery \u2014 allowing exhibitors to focus on selling, networking, and running their booth without worrying about content creation."}].map((e,t)=>{let{Icon:s,title:a,text:n}=e;return(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg p-6 border border-gray-200",children:[(0,f.jsx)("div",{className:"bg-red-100 w-12 h-12 rounded-full flex items-center justify-center mb-4 mx-auto",children:(0,f.jsx)(s,{className:"h-6 w-6 text-[#BF212F]"})}),(0,f.jsx)("h3",{className:"text-lg font-bold text-gray-900 mb-2 text-center",children:a}),(0,f.jsx)("p",{className:"text-gray-600 text-sm text-center",children:n})]},t)})})}),(0,f.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),_(null),!(()=>{const e={};return u.firstName.trim()||(e.firstName="First name is required"),u.lastName.trim()||(e.lastName="Last name is required"),u.email.trim()?/^[\w.\-]+@[\w.\-]+\.\w+$/.test(u.email)||(e.email="Enter a valid email"):e.email="Email is required",u.businessName.trim()||(e.businessName="Business name is required"),u.mobile.trim()?/^[\d+\-()\s]{8,15}$/.test(u.mobile.replace(/\s/g,""))||(e.mobile="Enter a valid mobile number"):e.mobile="Mobile number is required",u.boothNumber.trim()||(e.boothNumber="Booth number is required"),0===u.services.length&&(e.services="Select at least one service"),u.date||(e.date="Select a date"),u.timeSlot||(e.timeSlot="Select a time slot"),u.termsAccepted||(e.termsAccepted="You must accept the Terms & Conditions"),P(e),0===Object.keys(e).length})()){const e=document.querySelector(".border-red-500");return void(e&&e.scrollIntoView({behavior:"smooth",block:"center"}))}if("stripe"!==b||c&&d){k(!0);try{const e=(0,m.A)((0,m.A)({},u),{},{paymentMethod:b}),t=await fetch("".concat(I.fn,"/api/agha/bookings"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();if(!t.ok||!s.success){if(409===t.status){if(_("That time slot was just booked. Please pick another."),u.date){const e=await(await fetch("".concat(I.fn,"/api/agha/slots?date=").concat(u.date))).json();e.success&&j(e.slots)}}else _(s.detail||"Failed to create booking. Please try again.");return}const a=s.booking;if("stripe"===b){const e=await c.confirmCardPayment(s.client_secret,{payment_method:{card:d.getElement(Bc.hA),billing_details:{name:"".concat(u.firstName," ").concat(u.lastName),email:u.email}}});if(e.error)return void _("".concat(e.error.message," Your slot is held briefly \u2014 you can retry payment or contact us."));e.paymentIntent&&"succeeded"===e.paymentIntent.status?(await fetch("".concat(I.fn,"/api/agha/bookings/").concat(a.id,"/confirm-payment"),{method:"POST"}),D((0,m.A)((0,m.A)({},a),{},{payment_status:"paid"})),z(!0),window.scrollTo({top:0,behavior:"smooth"}
1)):_("Payment could not be completed. Please try again.")}else D(a),z(!0),window.scrollTo({top:0,behavior:"smooth"})}catch(t){console.error("Submit error:",t),_("Connection error. Please check your internet and try again.")}finally{k(!1)}}else _("Card payment is not ready yet \u2014 please wait a moment or choose Invoice.")},className:"max-w-4xl mx-auto px-4 py-8 space-y-8",children:[S&&(0,f.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-xl p-4 flex items-start",children:[(0,f.jsx)(h.A,{className:"h-5 w-5 text-red-600 mr-3 flex-shrink-0 mt-0.5"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"font-medium text-red-800",children:"Booking Failed"}),(0,f.jsx)("p",{className:"text-red-700 text-sm",children:S})]})]}),(0,f.jsxs)(Mc,{n:"1",title:"Select Services",subtitle:"Choose the content services you need",children:[R.services&&(0,f.jsx)(qc,{msg:R.services}),(null===(s=o.services)||void 0===s?void 0:s.length)>0&&(0,f.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:"Individual Services"}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:null===(n=o.services)||void 0===n?void 0:n.map(e=>(0,f.jsx)(Hc,{item:e,selected:u.services.includes(e.id),onClick:()=>G(e.id)},e.id))}),(null===(r=o.packages)||void 0===r?void 0:r.length)>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("h3",{className:"font-semibold text-gray-800 mb-1 mt-2",children:"Package Deals"}),(0,f.jsx)("p",{className:"text-sm text-gray-500 mb-3",children:"Bundle services together and save."}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:o.packages.map(e=>(0,f.jsx)(Hc,{item:e,selected:u.services.includes(e.id),onClick:()=>G(e.id),isPackage:!0},e.id))})]})]}
1),(0,f.jsxs)(Mc,{n:"2",title:"Select Date",subtitle:"Choose your preferred day",children:[R.date&&(0,f.jsx)(qc,{msg:R.date}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:null===(i=o.allowedDates)||void 0===i?void 0:i.map(e=>{const t=u.date===e;return(0,f.jsxs)("button",{type:"button",onClick:()=>g(t=>(0,m.A)((0,m.A)({},t),{},{date:e,timeSlot:""})),className:"p-5 rounded-xl border-2 text-center transition-all ".concat(t?"border-[#BF212F] bg-red-50":"border-gray-200 hover:border-gray-300 bg-white"),children:[(0,f.jsx)(_t.A,{className:"h-7 w-7 mx-auto mb-2 ".concat(t?"text-[#BF212F]":"text-gray-400")}),(0,f.jsx)("div",{className:"font-bold text-gray-900 text-sm",children:Pc(e)})]},e)})})]}),(0,f.jsxs)(Mc,{n:"3",title:"Select Time Slot",subtitle:u.date?"Available for ".concat(Pc(u.date)):"Select a date first",children:[R.timeSlot&&(0,f.jsx)(qc,{msg:R.timeSlot}),u.date?w?(0,f.jsxs)("div",{className:"text-center py-8",children:[(0,f.jsx)(Kr.A,{className:"h-8 w-8 animate-spin text-[#BF212F] mx-auto mb-2"}),(0,f.jsx)("p",{className:"text-gray-500",children:"Loading slots..."})]}):(0,f.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:v.map(e=>{const t=u.timeSlot===e.timeSlot,s="booked"===e.status;return(0,f.jsxs)("button",{type:"button",disabled:s,onClick:()=>!s&&g(t=>(0,m.A)((0,m.A)({},t),{},{timeSlot:e.timeSlot})),className:"py-3 px-3 rounded-lg text-center transition-all ".concat(t?"bg-[#BF212F] text-white font-semibold":s?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-green-50 text-gray-900 border border-green-200 hover:bg-green-100"),children:[(0,f.jsx)("span",{className:"text-sm font-medium",children:e.timeSlot}),s&&(0,f.jsxs)("div",{className:"text-xs mt-1 flex items-center justify-center",children:[(0,f.jsx)(x.A,{className:"h-3 w-3 mr-1"}),"Booked"]})]},e.timeSlot)})}):(0,f.jsxs)("div",{className:"text-center py-8 text-gray-500",children:[(0,f.jsx)(Nt.A,{className:"h-12 w-12 mx-auto mb-3 text-gray-300"}),(0,f.jsx)("p",{children:"Select a date to see available time slots"})]})]}),(0,f.jsx)(Mc,{n:"4",title:"Your Details",subtitle:"Contact information for your booking",children:(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,f.jsx)(Uc,{label:"First Name",name:"firstName",value:u.firstName,onChange:U,error:R.firstName,Icon:Ye.A,placeholder:"John"}),(0,f.jsx)(Uc,{label:"Last Name",name:"lastName",value:u.lastName,onChange:U,error:R.lastName,Icon:Ye.A,placeholder:"Smith"}),(0,f.jsx)(Uc,{label:"Email Address",name:"email",type:"email",value:u.email,onChange:U,error:R.email,Icon:T.A,placeholder:"[email protected]"}),(0,f.jsx)(Uc,{label:"Mobile Number",name:"mobile",type:"tel",value:u.mobile,onChange:U,error:R.mobile,Icon:E.A,placeholder:"0400 000 000"}),(0,f.jsx)(Uc,{label:"Business Name",name:"businessName",value:u.businessName,onChange:U,error:R.businessName,Icon:gs.A,placeholder:"Your Company Pty Ltd"}),(0,f.jsx)(Uc,{label:"Booth Number",name:"boothNumber",value:u.boothNumber,onChange:U,error:R.boothNumber,Icon:C.A,placeholder:"A123"})]})}),u.services.length>0&&(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-6 sm:p-8",children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-4",children:"Order Summary"}),(0,f.jsx)("div",{className:"space-y-2 mb-4",children:u.services.map(e=>{var t,s;return(0,f.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,f.jsx)("span",{className:"text-gray-700",children:(null===(t=O[e])||void 0===t?void 0:t.name)||e}),(0,f.jsx)("span",{className:"text-gray-900",children:Wc(null===(s=O[e])||void 0===s?void 0:s.price)})]},e)})}),(0,f.jsxs)("div",{className:"border-t border-gray-200 pt-3 space-y-1 text-sm",children:[(0,f.jsxs)("div",{className:"flex justify-between text-gray-600",children:[(0,f.jsx)("span",{children:"Subtotal (ex GST)"}),(0,f.jsx)("span",{children:Wc(M)})]}),(0,f.jsxs)("div",{className:"flex justify-between text-gray-600",children:[(0,f.jsx)("span",{children:"GST (10%)"}),(0,f.jsx)("span",{children:Wc(q)})]}),(0,f.jsxs)("div",{className:"flex justify-between text-lg font-bold text-gray-900 pt-1",children:[(0,f.jsx)("span",{children:"Total"}),(0,f.jsx)("span",{children:Wc(H)})]})]})]}),(0,f.jsxs)(Mc,{n:"5",title:"Payment",subtitle:"Pay now by card, or request an invoice",children:[(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-5",children:[(0,f.jsxs)("button",{type:"button",onClick:()=>y("invoice"),className:"p-4 rounded-xl border-2 text-left flex items-start ".concat("invoice"===b?"border-[#BF212F] bg-red-50":"border-gray-200 hover:border-gray-300"),children:[(0,f.jsx)(kt.A,{className:"h-5 w-5 mr-3 mt-0.5 ".concat("invoice"===b?"text-[#BF212F]":"text-gray-500")}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-semibold text-gray-900",children:"Invoice me"}),(0,f.jsx)("div",{className:"text-xs text-gray-500",children:"Invoice emailed under your business name, 30-day terms."})]})]}),(0,f.jsxs)("button",{type:"button",disabled:!l,onClick:()=>l&&y("stripe"),className:"p-4 rounded-xl border-2 text-left flex items-start ".concat("stripe"===b?"border-[#BF212F] bg-red-50":"border-gray-200 hover:border-gray-300"," ").concat(l?"":"op
1acity-50 cursor-not-allowed"),children:[(0,f.jsx)(Dc.A,{className:"h-5 w-5 mr-3 mt-0.5 ".concat("stripe"===b?"text-[#BF212F]":"text-gray-500")}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-semibold text-gray-900",children:"Pay now by card"}),(0,f.jsx)("div",{className:"text-xs text-gray-500",children:l?"Secure payment via Stripe.":"Card payment unavailable right now."})]})]})]}),"stripe"===b&&l&&(0,f.jsxs)("div",{className:"border border-gray-300 rounded-lg p-4",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Card Details"}),(0,f.jsx)(Bc.hA,{options:Rc})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-6 sm:p-8",children:[(0,f.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:"Terms & Conditions"}),(0,f.jsxs)("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 mb-4 text-sm text-gray-600",children:[(0,f.jsx)("p",{className:"mb-3",children:"By booking Content Hub services, exhibitors agree that all fees are payable to Turbo 360 and all content is delivered digitally. Video content includes up to two rounds of revisions following the first draft; additional revisions may incur fees. Clients are responsible for accurate briefs, access and timely approvals. Cancellations or schedule changes may incur charges. Turbo 360 may use non-confidential captured material in its portfolio unless otherwise agreed in writing."}),(0,f.jsx)("p",{className:"text-xs text-gray-500 italic",children:"Turbo 360 provides Content Hub services as an independent supplier. AGHA and the Melbourne Gift Fair are not affiliated with these services and accept no responsibility or liability for arrangements, deliverables, or transactions made with Turbo 360."})]}),(0,f.jsxs)("label",{className:"flex items-start cursor-pointer ".concat(R.termsAccepted?"text-red-600":""),children:[(0,f.jsx)("input",{type:"checkbox",checked:u.termsAccepted,onChange:e=>{g(t=>(0,m.A)((0,m.A)({},t),{},{termsAccepted:e.target.checked})),R.termsAccepted&&P(e=>(0,m.A)((0,m.A)({},e),{},{termsAccepted:null}))},className:"mt-1 h-5 w-5 text-[#BF212F] rounded focus:ring-red-500 ".concat(R.termsAccepted?"border-red-500":"border-gray-300")}),(0,f.jsxs)("span",{className:"ml-3 text-sm text-gray-700",children:["I have read and agree to the Terms & Conditions ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]})]}),R.termsAccepted&&(0,f.jsx)("p",{className:"mt-1 text-sm text-red-600",children:R.termsAccepted})]}),(0,f.jsx)("div",{className:"flex justify-center",children:(0,f.jsx)("button",{type:"submit",disabled:A,className:"w-full sm:w-auto px-12 py-4 bg-[#BF212F] text-white rounded-xl hover:bg-red-700 transition flex items-center justify-center text-lg font-semibold disabled:opacity-50",children:A?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kr.A,{className:"h-5 w-5 mr-2 animate-spin"}),"Processing..."]}):"stripe"===b?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Dc.A,{className:"h-5 w-5 mr-2"}),"Pay ",Wc(H)," & Confirm"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.A,{className:"h-5 w-5 mr-2"}),"Confirm Booking"]})})})]}),(0,f.jsxs)("div",{className:"bg-gray-900 text-white py-8 px-4 mt-12 text-center",children:[(0,f.jsxs)("p",{className:"text-gray-400",children:["Need help? Contact ",(0,f.jsx)("a",{href:"mailto:[email protected]",className:"text-red-400 hover:text-red-300",children:"[email protected]"})]}),(0,f.jsx)("p",{className:"text-gray-500 text-sm mt-2",children:"Powered by Turbo 360"})]})]})}const Lc=e=>{let{label:t,value:s,mono:a}=e;return(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsxs)("span",{className:"text-gray-600",children:[t,":"]}),(0,f.jsx)("span",{className:"font-medium text-gray-900 ".concat(a?"font-mono text-sm bg-gray-200 px-2 py-0.5 rounded":""),children:s})]})},Mc=e=>{let{n:t,title:s,subtitle:a,children:n}=e;return(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-6 sm:p-8",children:[(0,f.jsxs)("div",{className:"flex items-center mb-6",children:[(0,f.jsx)("div",{className:"h-10 w-10 bg-red-100 rounded-full flex items-center justify-center mr-4",children:(0,f.jsx)("span",{className:"text-[#BF212F] font-bold",children:t})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:s}),(0,f.jsx)("p",{className:"text-gray-600 text-sm",children:a})]})]}),n]})},qc=e=>{let{msg:t}=e;return(0,f.jsxs)("div",{className:"mb-4 text-red-600 text-sm flex items-center",children:[(0,f.jsx)(h.A,{className:"h-4 w-4 mr-1"}),t]})},Hc=e=>{let{item:t,selected:s,onClick:a,isPackage:n}=e;const r=Ic[t.id]||Ue.A,[i,o]=(t.description||"").split("|").map(e=>e.trim()),l=n&&i?i.split(" + ").map(e=>
1e.trim()).filter(Boolean):[];return(0,f.jsx)("button",{type:"button",onClick:a,className:"p-4 rounded-xl border-2 text-left transition-all ".concat(s?"border-[#BF212F] bg-red-50":"border-gray-200 hover:border-gray-300 bg-white"),children:(0,f.jsxs)("div",{className:"flex items-start",children:[(0,f.jsx)("div",{className:"p-2 rounded-lg mr-3 ".concat(s?"bg-red-100":"bg-gray-100"),children:(0,f.jsx)(r,{className:"h-5 w-5 ".concat(s?"text-[#BF212F]":"text-gray-600")})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("h4",{className:"font-semibold text-gray-900 text-sm",children:t.name}),s&&(0,f.jsx)(zt.A,{className:"h-5 w-5 text-[#BF212F] flex-shrink-0"})]}),(0,f.jsxs)("p",{className:"text-[#BF212F] font-bold text-sm",children:[Wc(t.price)," + GST"]}),n?(0,f.jsxs)(f.Fragment,{children:[l.length>0&&(0,f.jsxs)("ul",{className:"mt-2 space-y-1",children:[(0,f.jsx)("li",{className:"text-xs font-medium text-gray-700",children:"Includes:"}),l.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start text-xs text-gray-600",children:[(0,f.jsx)(zt.A,{className:"h-3.5 w-3.5 text-green-600 mr-1.5 mt-0.5 flex-shrink-0"}),e]},t))]}),o&&(0,f.jsx)("span",{className:"inline-block mt-2 bg-green-100 text-green-800 text-xs font-semibold px-2 py-0.5 rounded-full",children:o})]}):t.description&&(0,f.jsx)("p",{className:"text-gray-500 text-xs mt-1",children:t.description})]})]})})},Uc=e=>{let{label:t,name:s,value:a,onChange:n,error:r,Icon:i,type:o="text",placeholder:l}=e;return(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[t," ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(i,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:o,name:s,value:a,onChange:n,placeholder:l,className:"w-full pl-10 pr-4 py-3 border rounded-lg bg-white text-gray-900 placeholder-gray-400 focus:ring-2 focus:ring-red-500 focus:border-red-500 ".concat(r?"border-red-500":"border-gray-300")})]}),r&&(0,f.jsx)("p",{className:"mt-1 text-sm text-red-600",children:r})]})};function Gc(){const[e,t]=(0,a.useState)(null),[n,r]=(0,a.useState)(null),[i,o]=(0,a.useState)(!0),[l,c]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(async()=>{try{const a=await fetch("".concat(I.fn,"/api/agha/config")),n=await a.json();n.success?t(n.config):c("Failed to load booking configuration");try{const e=await(await fetch("".concat(I.fn,"/api/agha/stripe-config"))).json();if(e.success&&e.publishable_key){const{loadStripe:t}=await Promise.resolve().then(s.bind(s,69677));r(t(e.publishable_key))}}catch(e){}}catch(e){c("Failed to connect to booking system")}finally{o(!1)}})()},[]),i?(0,f.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)(Kr.A,{className:"h-12 w-12 animate-spin text-[#BF212F] mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-600",children:"Loading booking system..."})]})}):l||!e?(0,f.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-8 max-w-md text-center",children:[(0,f.jsx)(h.A,{className:"h-12 w-12 text-[#BF212F] mx-auto mb-4"}),(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-2",children:"Unable to Load Booking System"}),(0,f.jsx)("p",{className:"text-gray-600",children:l})]})}):(0,f.jsx)(Bc.S8,{stripe:n,children:(0,f.jsx)(Oc,{config:e,stripeReady:!!n})})}const Vc=e=>!!e&&"".concat(e.company_name||""," ").concat(e.parent_company_name||"").toLowerCase().includes("national media"),Jc="nm-portal-token",Yc=()=>{try{return window.localStorage.getItem(Jc)}catch(e){return null}},Kc=()=>{try{window.localStorage.removeItem(Jc)}catch(e){}};async function Zc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=Yc(),a=await fetch("/api/nm".concat(e),(0,m.A)((0,m.A)({},t),{},{headers:(0,m.A)((0,m.A)({"Content-Type":"application/json"},s?{Authorization:"Bearer ".concat(s)}:{}),t.headers||{})}));if(401===a.status)throw Kc(),window.location.pathname.startsWith("/national-media/login")||(window.location.href="/national-media/login?expired=1"),new Error("Sign-in required");if(!a.ok){let e="Something went wrong";try{e=(await a.json()).detail||e}catch(n){}const t=new Error(e);throw t.status=a.status,t}return a.json()}const $c=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(e||0)),Qc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return t?"Date TBC":"TBC";const s=new Date(e);if(Number.isNaN(s.getTime()))return String(e);const a=s.toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short",year:"numeric"});return t?"".concat(a," (TBC)"):a}
1,Xc=e=>{if(!e)return{month:"TBC",day:"--"};const t=new Date(e);return Number.isNaN(t.getTime())?{month:"TBC",day:"--"}:{month:t.toLocaleDateString("en-AU",{month:"short"}).toUpperCase(),day:String(t.getDate())}},ed={red:"#BF212F",redHover:"#A81B28",redLight:"#E6505A",amber:"#F2A900",teal:"#0FA3A3",tealDeep:"#0E8C8C",indigo:"#4338CA",carbon:"#0A0A0B",carbon2:"#0F0F11",carbon3:"#141417",carbonBorder:"#26262B",carbonHairline:"#1F1F23",adminCanvas:"#EDEDF0",adminBorder:"#E4E4E9",adminRowHover:"#F7F7F9",adminTableHead:"#FBFBFC",paper:"#F4F2EE",paperBorder:"#E2DED6",paperHairline:"#F1EFE9",paperHairline2:"#EDEBE5",paperInset:"#FBF9F5",paperRowHover:"#FBFAF7",textPrimary:"#0A0A0B",textSecondary:"#55555C",textMuted:"#9A9AA0",textFaint:"#B5B5BC",textFaintDark:"#6A6A72",successBg:"#DCFCE7",successFg:"#15803D",warnBg:"#FEF3C7",warnFg:"#92400E",dangerBg:"#FEE2E2",dangerFg:"#B91C1C",infoBg:"#E0E7FF",infoFg:"#4338CA",neutralAdminBg:"#F2F2F5",neutralAdminFg:"#7A7A82",neutralClientBg:"#EDEBE5",neutralClientFg:"#7A7A82"},td="'Archivo',sans-serif",sd="'Hanken Grotesk',-apple-system,system-ui,sans-serif",ad="'Space Mono',monospace",nd={fontFamily:"'Archivo',sans-serif",fontStretch:"125%"}
1,rd="linear-gradient(90deg, ".concat(ed.red," 0 50%, ").concat(ed.amber," 50% 75%, ").concat(ed.teal," 75% 100%)"),id={booked:{bg:ed.successBg,fg:ed.successFg,label:"BOOKED"},draft:{bg:"#E0E7FF",fg:"#4338CA",label:"NOT BOOKED YET \xb7 DRAFT SAVED"},open:{bg:ed.warnBg,fg:ed.warnFg,label:"NOT BOOKED YET"},locked:{bg:ed.neutralClientBg,fg:ed.neutralClientFg,label:"LOCKED"}},od=[{label:"SHOWS AHEAD",value:"14"},{label:"NEXT SHOW",value:"SEP 11"},{label:"DIRECTOR ON SITE",value:"EVERY SHOW"}],ld="[email protected]";function cd(){const e=(0,r.Zp)(),[t]=(0,r.ok)(),s=t.get("token"),[n,i]=(0,a.useState)(s?"verifying":"form"),[o,l]=(0,a.useState)(t.get("email")||""),[c,p]=(0,a.useState)(""),[x,h]=(0,a.useState)(null),[u,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(t.get("expired")?"Your session ended. Sign in again to pick up where you left off.":""),[v,j]=(0,a.useState)(!1),w=(0,a.useRef)(!1);(0,a.useEffect)(()=>{s&&!w.current&&(w.current=!0,(async()=>{try{const e=await fetch("/api/nm/auth/verify?token=".concat(encodeURIComponent(s))),t=await e.json();if(!e.ok)throw new Error(t.detail||"That link isn't valid.");(e=>{try{window.localStorage.setItem(Jc,e)}catch(t){}})(t.token),h(t.contact),i("signedin")}catch(e){Kc(),y(e.message),i("form")}})())},[s]);const N=(0,a.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const s=(e||"").trim();if(s){g(!0),y("");try{const e=await fetch("/api/nm/auth/request-link",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s})}),a=await e.json();p(s),i("sent"),t&&(j(!0),setTimeout(()=>j(!1),2600)),!e.ok&&null!==a&&void 0!==a&&a.detail&&y(a.detail)}catch(a){y("We couldn't send that just now. Try again in a moment.")}finally{g(!1)}}},[]),A={width:"100%",maxWidth:360},k={width:"100%",boxSizing:"border-box",background:"#141417",border:"1px solid ".concat(ed.carbonBorder),borderRadius:10,padding:14,fontFamily:sd,fontSize:15,color:"#fff",outline:"none"};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"National Media Booking Portal | Turbo 360"}),(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,f.jsxs)("div",{className:"nm-login-grid",style:{minHeight:"100vh",display:"grid",gridTemplateColumns:"1fr 460px",background:"#0F0F11",color:"#fff",fontFamily:sd},children:[(0,f.jsx)("style",{children:"\n .nm-login-left { position: relative; overflow: hidden; }\n @media (max-width: 820px) {\n .nm-login-grid { grid-template-columns: 1fr !important; }\n .nm-login-left { display: none !important; }\n }\n .nm-primary:hover:not(:disabled) { background: ".concat(ed.redHover," !important; }\n .nm-ghost:hover { color: #fff !important; }\n .nm-input:focus { border-color: ").concat(ed.red," !important; }\n @keyframes nm-bar { 0%,100% { opacity: .25; transform: scaleY(.6); } 50% { opacity: 1; transform: scaleY(1); } }\n @keyframes nm-spin { to { transform: rotate(360deg); } }\n ")}),(0,f.jsxs)("div",{className:"nm-login-left",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"clamp(32px,5vw,56px)"},children:[(0,f.jsx)("div",{style:{position:"absolute",inset:0,backgroundImage:"url(/nm/login-bg.jpg)",backgroundSize:"cover",backgroundPosition:"center 30%"}}
1),(0,f.jsx)("div",{style:{position:"absolute",inset:0,background:"rgba(10,10,11,.62)"}}),(0,f.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,height:3,background:rd}}),(0,f.jsx)("img",{src:"/nm/turbo-logo-white.png",alt:"Turbo 360",style:{position:"relative",height:38,width:"auto",alignSelf:"flex-start"}}),(0,f.jsxs)("div",{style:{position:"relative"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10.5,fontWeight:700,letterSpacing:".22em",color:"#FFFFFF"},children:"NATIONAL MEDIA \xb7 BOOKING PORTAL"}),(0,f.jsxs)("h1",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:"clamp(30px,3.4vw,40px)",lineHeight:1.06,letterSpacing:"-.02em",margin:"18px 0 0",textTransform:"uppercase"}),children:["Every angle.",(0,f.jsx)("br",{}),"Full speed."]}),(0,f.jsx)("div",{style:{width:430,maxWidth:"100%",height:1,background:"rgba(255,255,255,.16)",margin:"28px 0 24px"}}),(0,f.jsx)("div",{style:{display:"flex",gap:34,flexWrap:"wrap"},children:od.map(e=>(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:"#FFFFFF"},children:e.label}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:15,fontWeight:700,marginTop:6},children:e.value})]},e.label))})]}),(0,f.jsxs)("div",{style:{position:"relative",fontFamily:ad,fontSize:10.5,letterSpacing:".1em",color:ed.textFaintDark},children:["1300 207 446 \xb7 ",ld]})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"clamp(24px,4vw,40px)",background:"#0F0F11"},children:["form"===n&&(0,f.jsxs)("div",{style:A,children:[(0,f.jsx)("img",{src:"/nm/turbo-icon-red.png",alt:"",style:{width:46,height:46,borderRadius:11,display:"block"}}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".22em",color:ed.red,marginTop:26},children:"SECURE SIGN-IN"}),(0,f.jsx)("h2",{style:{fontFamily:td,fontSize:22,fontWeight:700,letterSpacing:"-.01em",margin:"10px 0 8px"},children:"Sign in to your portal"}),(0,f.jsx)("p",{style:{fontSize:14.5,lineHeight:1.6,color:ed.textMuted,margin:"0 0 24px"},children:"We'll email you a link \u2014 no password to remember."}),(0,f.jsx)("label",{style:{display:"block",fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".16em",color:ed.textMuted,marginBottom:8},children:"WORK EMAIL"}),(0,f.jsx)("input",{className:"nm-input",type:"email",value:o,autoFocus:!0,placeholder:"[email protected]",onChange:e=>{l(e.target.value),y("")},onKeyDown:e=>{"Enter"===e.key&&N(o)},style:k}),b&&(0,f.jsx)("div",{style:{marginTop:14,background:"#1F1315",border:"1px solid #3A1A1D",borderRadius:10,padding:"12px 14px",fontSize:13.5,lineHeight:1.55,color:"#F87171"},children:b}),(0,f.jsxs)("button",{type:"button",className:"nm-primary",disabled:u||!o.trim(),onClick:()=>N(o),style:{width:"100%",marginTop:18,background:ed.red,color:"#fff",border:"none",borderRadius:10,padding:"15px 18px",fontFamily:td,fontSize:15,fontWeight:700,cursor:u||!o.trim()?"default":"pointer",opacity:u||!o.trim()?.55:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:9},children:[u&&(0,f.jsx)(Kr.A,{size:16,style:{animation:"nm-spin .9s linear infinite"}}),u?"Sending your link\u2026":"Email me a sign-in link"]}),(0,f.jsx)(dd,{label:"PRIVATE PORTAL"}),(0,f.jsxs)("p",{style:{fontSize:12.5,lineHeight:1.6,color:ed.textFaintDark,margin:0},children:["Only approved National Media contacts can sign in. Need access?"," ",(0,f.jsx)("a",{href:"mailto:".concat(ld),style:{color:ed.textMuted},children:ld})]})]}),"sent"===n&&(0,f.jsxs)("div",{style:A,children:[(0,f.jsx)("div",{style:{width:46,height:46,borderRadius:11,background:"#12281F",border:"1px solid #1E4632",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(T.A,{size:21,color:"#4ADE80",strokeWidth:2})}),(0,f.jsx)("h2",{style:{fontFamily:td,fontSize:22,fontWeight:700,letterSpacing:"-.01em",margin:"24px 0 10px"},children:"Check your inbox"}),(0,f.jsxs)("p",{style:{fontSize:14.5,lineHeight:1.65,color:ed.textMuted,margin:0},children:["If ",(0,f.jsx)("strong",{style:{color:"#fff",fontWeight:600},children:c})," has portal access, a sign-in link is on its way. It works once and expires in 24 hours."]}),(0,f.jsxs)("div",{style:{marginTop:26,border:"1px solid ".concat(ed.carbonBorder),borderRadius:12,padding:"18px 20px",background:"#141417"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".16em",color:ed.textMuted},children:"DIDN'T ARRIVE?"}),(0,f.jsx)("p",{style:{fontSize:13,lineHeight:1.6,color:ed.textFaintDark,margin:"10px 0 16px"},children:"Check spam, then try again. A new link replaces the old one."}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:[(0,f.jsx)("button",{type:"button",className:"nm-primary",disabled:u,onClick:()=>N(c,!0),style:{background:v?"#12281F":ed.red,color:v?"#4ADE80":"#fff",border:v?"1px solid #1E4632":"none",borderRadius:9,padding:"11px 16px",fontFamily:td,fontSize:13.5,fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:7},children:v?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(zt.A,{size:14,strokeWidth:2.6}),"Link resent"]}):"Resend link"}),(0,f.jsx)("button",{type:"button",className:"nm-ghost",onClick:()=>{i("form"),l(c),y("")},style:{background:"none",border:"none",color:ed.textMuted,fontFamily:sd,fontSize:13.5,fontWeight:600,cursor:"pointer"},children:"Use a different email"})]})]})]}),"verifying"===n&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},A),{},{textAlign:"center"}),children:[(0,f.jsx)("div",{style:{display:"flex",gap:7,justifyContent:"center",alignItems:"flex-end",height:34},children:[ed.red,ed.amber,ed.teal].map((e,t)=>(0,f.jsx)("span",{style:{width:7,height:34,borderRadius:3,background:e,animation:"nm-bar 1.1s ".concat(.16*t,"s cubic-bezier(0.16,1,0.3,1) infinite")}},e))}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10,fontWeight:700,letterSpacing:".22em",color:ed.textMuted,marginTop:24},children:"VERIFYING YOUR LINK\u2026"})]}),"signedin"===n&&(0,f.jsxs)("div",{style:A,children:[(0,f.jsx)("div",{style:{width:46,height:46,borderRadius:11,background:"#12281F",border:"1px solid #1E4632",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(zt.A,{size:22,color:"#4ADE80",strokeWidth:2.6})}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".22em",color:"#4ADE80",marginTop:26},children:"SIGNED IN"}),(0,f.jsxs)("h2",{style:{fontFamily:td,fontSize:22,fontWeight:700,letterSpacing:"-.01em",margin:"10px 0 8px"}
1,children:["Welcome back",null!==x&&void 0!==x&&x.name?", ".concat(x.name.split(" ")[0]):""]}),(0,f.jsx)("p",{style:{fontSize:14.5,lineHeight:1.6,color:ed.textMuted,margin:"0 0 24px"},children:"You'll stay signed in on this device for 24 hours."}),(0,f.jsxs)("button",{type:"button",className:"nm-primary",onClick:()=>e("/national-media"),style:{width:"100%",background:ed.red,color:"#fff",border:"none",borderRadius:10,padding:"15px 18px",fontFamily:td,fontSize:15,fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:9},children:["Open my portal ",(0,f.jsx)(S.A,{size:16,strokeWidth:2.4})]}),(0,f.jsx)(dd,{label:"NOT YOU?"}),(0,f.jsx)("button",{type:"button",className:"nm-ghost",onClick:async()=>{try{await fetch("/api/nm/auth/sign-out",{method:"POST",headers:{Authorization:"Bearer ".concat(Yc())}})}catch(e){}Kc(),h(null),l(""),i("form")},style:{background:"none",border:"none",color:ed.textMuted,fontFamily:sd,fontSize:13.5,fontWeight:600,cursor:"pointer",padding:0},children:"Sign out"})]})]})]})]})}const dd=e=>{let{label:t}=e;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,margin:"26px 0 16px"},children:[(0,f.jsx)("span",{style:{flex:1,height:1,background:ed.carbonBorder}}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".2em",color:ed.textFaintDark},children:t}),(0,f.jsx)("span",{style:{flex:1,height:1,background:ed.carbonBorder}})]})};var md=s(56174);const pd=[{n:1,label:"Crew"},{n:2,label:"Time on site"},{n:3,label:"Deliverables"},{n:4,label:"Extras & review"}],xd={1:"ADD AT LEAST ONE ROLE TO CONTINUE",2:"RATES UPDATE AS YOU CHANGE TIME ON SITE",3:"GALLERIES ARE ALWAYS INCLUDED",4:"READY WHEN YOU ARE"};const hd=e=>Math.round(100*e)/100;function ud(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)(null),[n,i]=(0,a.useState)([]),[o,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(null),[p,x]=(0,a.useState)(!0),[h,u]=(0,a.useState)(""),[b,y]=(0,a.useState)("list"),[v,j]=(0,a.useState)(null),[w,N]=(0,a.useState)({roles:{},durations:{},deliverables:{},addons:{}}),[A,k]=(0,a.useState)(1),[S,_]=(0,a.useState)(null),[C,F]=(0,a.useState)(!1),[E,T]=(0,a.useState)(null),[z,B]=(0,a.useState)(!1),[D,I]=(0,a.useState)(null),R=(0,a.useRef)(null),P=(0,a.useRef)(!0),W=(0,a.useCallback)(e=>{u(e),window.scrollTo({top:0,behavior:"smooth"})},[]),O=(0,a.useCallback)(async()=>{const e=await Zc("/shows");i(e.shows||[]),l(e.summary||null),s(e.contact||null),I(e.impersonated_by||null)},[]);(0,a.useEffect)(()=>{Yc()?(async()=>{try{const[,e]=await Promise.all([O(),Zc("/catalogue")]);d(e)}catch(e){u(e.message)}finally{x(!1)}})():e("/national-media/login")},[O,e]),(0,a.useEffect)(()=>{if("build"===b&&v&&!P.current&&!D)return R.current&&clearTimeout(R.current),R.current=setTimeout(async()=>{try{const e=await Zc("/draft/".concat(v.event_id),{method:"PUT",body:JSON.stringify({selection:w,step:A})});_(e.saved_at)}catch(e){}},1e3),()=>R.current&&clearTimeout(R.current)},[w,A,b,v,D]);const L=(0,a.useMemo)(()=>c?function(e,t){const s=Object.fromEntries((e.roles||[]).map(e=>[e.id,e])),a=Object.fromEntries((e.items||[]).map(e=>[e.id,e])),n=[];Object.entries(t.roles||{}).forEach(e=>{var a,r;let[i,o]=e;const l=s[i],c=null===(a=t.durations)||void 0===a?void 0:a[i];if(!l||!o||!c)return;const d=Number((null===(r=l.rates)||void 0===r?void 0:r[c])||0);d<=0||n.push({kind:"crew",id:i,label:l.label,duration:c,count:o,amount:d*o})}),Object.entries(t.deliverables||{}).forEach(e=>{let[t,s]=e;const r=a[t];if(!r||!s)return;const i=r.quantity_based?s:1;n.push({kind:"deliverable",id:t,label:r.label,count:i,amount:Number(r.price||0)*i})}),Object.entries(t.addons||{}).forEach(e=>{let[t,s]=e;const r=a[t];r&&s&&n.push({kind:"extra",id:t,label:r.label,count:1,amount:Number(r.price||0)})});const r=hd(n.reduce((e,t)=>e+t.amount,0)),i=hd(.1*r);return{lines:n,crewTotal:hd(n.filter(e=>"crew"===e.kind).reduce((e,t)=>e+t.amount,0)),delivTotal:hd(n.filter(e=>"deliverable"===e.kind).reduce((e,t)=>e+t.amount,0)),extrasTotal:hd(n.filter(e=>"extra"===e.kind).reduce((e,t)=>e+t.amount,0)),subtotal:r,gst:i,total:hd(r+i),priced:n.some(e=>
1"crew"===e.kind)}}(c,w):null,[c,w]),M=(0,a.useCallback)(async e=>{P.current=!0,j(e),N({roles:{},durations:{},deliverables:{},addons:{}}),k(1),_(null);try{var t;const[s,a]=await Promise.all([Zc("/draft/".concat(e.event_id)),"booked"===e.state?Zc("/bookings/".concat(e.event_id)).catch(()=>null):Promise.resolve(null)]);null!==a&&void 0!==a&&null!==(t=a.booking)&&void 0!==t&&t.selection?(N((0,m.A)((0,m.A)({},{roles:{},durations:{},deliverables:{},addons:{}}),a.booking.selection)),k(4)):null!==s&&void 0!==s&&s.draft&&(N((0,m.A)((0,m.A)({},{roles:{},durations:{},deliverables:{},addons:{}}),s.draft.selection)),k(s.draft.step||1),_(s.draft.saved_at))}catch(s){}y("build"),window.scrollTo({top:0}),setTimeout(()=>{P.current=!1},400)},[]),q=(0,a.useCallback)(async e=>{const t=v||(null===E||void 0===E?void 0:E.show);if(t)try{await async function(e){const t=Yc(),s=await fetch("/api/nm".concat(e),{headers:t?{Authorization:"Bearer ".concat(t)}:{}});if(401===s.status)throw Kc(),window.location.href="/national-media/login?expired=1",new Error("Sign-in required");if(!s.ok){let e="That document isn't available yet";try{e=(await s.json()).detail||e}catch(o){}throw new Error(e)}const a=(s.headers.get("content-disposition")||"").match(/filename="?([^";]+)"?/i),n=await s.blob(),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r,i.download=a?a[1]:"Turbo 360.pdf",document.body.appendChild(i),i.click(),i.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3)}("/documents/".concat(e,"/").concat(t.event_id))}catch(s){W(s.message)}},[v,E,W]),H=(0,a.useCallback)(async e=>{try{const t=await Zc("/bookings/".concat(e.event_id));T(t),j(e),y("job"),window.scrollTo({top:0})}catch(t){W(t.message)}},[W]),U=(0,a.useCallback)(async()=>{P.current=!0,y("list"),j(null),T(null);try{await O()}catch(e){}},[O]),G=(0,a.useCallback)(async()=>{if(v){P.current=!0;try{await Zc("/draft/".concat(v.event_id),{method:"DELETE"})}catch(e){}await U()}},[v,U]),V=(0,a.useCallback)(async e=>{let{signerName:t,signerPosition:s}=e;B(!0);try{await Zc("/bookings",{method:"POST",body:JSON.stringify({event_id:v.event_id,selection:w,signer_name:t,signer_position:s,accepted_terms:!0,accepted_authority:!0})})}catch(a){return F(!1),W(a.message),void B(!1)}F(!1);try{await O();const e=await Zc("/bookings/".concat(v.event_id));T(e),y("job"),window.scrollTo({top:0})}catch(n){await U(),W("Your booking is confirmed \u2014 we couldn't load the job view just now. Reopen the show to see it.")}finally{B(!1)}},[v,w,O,U,W]);return p?(0,f.jsx)(gd,{contact:null,children:(0,f.jsx)("div",{style:{padding:"80px 0",textAlign:"center",color:ed.textMuted},children:(0,f.jsx)(Kr.A,{size:22,style:{animation:"nm-spin .9s linear infinite"}})})}):(0,f.jsxs)(gd,{contact:t,previewAs:D,children:[h&&(0,f.jsxs)("div",{style:{margin:"20px 0",background:ed.dangerBg,border:"1px solid #FCA5A5",borderRadius:10,padding:"14px 16px",color:ed.dangerFg,fontSize:14},children:[h,(0,f.jsx)("button",{type:"button",onClick:()=>u(""),style:{float:"right",background:"none",border:"none",color:ed.dangerFg,cursor:"pointer"},children:(0,f.jsx)(g.A,{size:15})})]}),"list"===b&&(0,f.jsx)(fd,{shows:n,summary:o,onBuild:M,onJob:H}),"build"===b&&v&&c&&(0,f.jsx)(vd,{show:v,catalogue:c,selection:w,setSelection:N,step:A,setStep:k,pricing:L,savedAt:S,onBack:U,onDiscard:G,onBook:()=>F(!0),onDownloadQuote:()=>q("quote")}),"job"===b&&E&&(0,f.jsx)(jd,{job:E,onBack:U,onModify:()=>M(E.show),onDownload:()=>q("confirmation")}),C&&c&&(0,f.jsx)(wd,{show:v,terms:c.terms,pricing:L,contact:t,busy:z,isUpdate:"booked"===(null===v||void 0===v?void 0:v.state),onClose:()=>F(!1),onConfirm:V})]})}function gd(e){let{contact:t,previewAs:s,children:a}=e;const n=((null===t||void 0===t?void 0:t.name)||"").split(/\s+/).filter(Boolean).map(e=>e[0]).slice(0,2).join("").toUpperCase();return(0,f.jsxs)("div",{style:{minHeight:"100vh",background:ed.paper,color:ed.textPrimary,fontFamily:sd},children:[s&&(0,f.jsx)("div",{style:{background:ed.amber,color:ed.carbon,padding:"9px 0"},children:(0,f.jsxs)("div",{style:{maxWidth:1180,margin:"0 auto",padding:"0 40px",display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".14em"},children:"ADMIN PREVIEW"}),(0,f.jsxs)("span",{style:{fontSize:13,fontWeight:600},children:["Viewing as ",(null===t||void 0===t?void 0:t.name)||"this contact"," \u2014 read-only. Bookings and drafts are disabled."]})]})}),(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"National Media Booking Portal | Turbo 360"}),(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,f.jsx)("style",{children:"\n @keyframes nm-spin { to { transform: rotate(360deg); } }\n .nm-row:hover { background: ".concat(ed.paperRowHover,"; }\n .nm-primary:hover:not(:disabled) { background: ").concat(ed.redHover," !important; }\n .nm-card-btn:hover { border-color: ").concat(ed.red,"; }\n /* The input is transparent, so the ring has to be drawn on its sibling. */\n .nm-check:focus-visible + span { outline: 2px solid ").concat(ed.red,"; outline-offset: 2px; }\n @media (max-width: 1024px) {\n .nm-build-grid { grid-template-columns: 1fr !important; }\n .nm-job-grid { grid-template-columns: 1fr !important; }\n .nm-show-row { grid-template-columns: 64px 1fr !important; }\n .nm-show-right { grid-column: 2 !important; padding-left: 0 !important; margin-top: 12px; }\n .nm-header-contact { display: none !important; }\n }\n @media (max-width: 560px) {\n .nm-hero-h1 { font-size: 25px !important; }\n .nm-summary { grid-template-columns: 1fr 1fr !important; }\n }\n ")}),(0,f.jsx)("div",{style:{height:3,background:rd}}),(0,f.jsx)("header",{style:{background:ed.carbon,color:"#fff",height:74,display:"flex",alignItems:"center"},children:(0,f.jsxs)("div",{style:{width:"100%",maxWidth:1180,margin:"0 auto",padding:"0 clamp(16px,4vw,40px)",display:"flex",alignItems:"center",gap:18},children:[(0,f.jsx)("img",{src:"/nm/turbo-logo-white.png",alt:"Turbo 360",style:{height:26,width:"auto"}}),(0,f.jsx)("span",{style:{width:1,height:30,background:ed.carbonBorder}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14,fontWeight:700},children:"National Media"}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".18em",color:ed.textFaintDark},children:"BOOKING PORTAL"})]}),(0,f.jsx)("span",{style:{flex:1}}),(0,f.jsx)("span",{className:"nm-header-contact",style:{fontFamily:ad,fontSize:10.5,letterSpacing:".08em",color:ed.textFaintDark},children:"1300 207 446 \xb7 [email protected]"}),t&&(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:9},children:[(0,f.jsx)("span",{style:{width:26,height:26,borderRadius:8,background:ed.red,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:td,fontSize:11,fontWeight:700},children:n}),(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600},children:t.name})]})]})}),(0,f.jsx)("main",{style:{maxWidth:1180,margin:"0 auto",padding:"0 clamp(16px,4vw,40px) 64px"},children:a})]})}function fd(e){let{shows:t,summary:s,onBuild:n,onJob:r}=e;const i=(0,a.useMemo)(()=>{const e={};return t.forEach(t=>{const s=t.event_date?new Date(t.event_date).getFullYear():"Dates TBC";(e[s]=e[s]||[]).push(t)}),Object.entries(e).sort((e,t)=>
1{let[s]=e,[a]=t;return String(s).localeCompare(String(a))})},[t]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("section",{style:{padding:"52px 0 36px"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10.5,fontWeight:700,letterSpacing:".2em",color:ed.red},children:"YOUR SHOW CALENDAR \xb7 MAINTAINED BY TURBO"}),(0,f.jsx)("h1",{className:"nm-hero-h1",style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:"clamp(28px,4vw,42px)",lineHeight:1.04,letterSpacing:"-.02em",textTransform:"uppercase",margin:"16px 0 0"}),children:"Every show. Booked your way."}),(0,f.jsx)("p",{style:{maxWidth:620,fontSize:15.5,lineHeight:1.65,color:ed.textSecondary,margin:"16px 0 0"},children:"Every show in your calendar is here. Build the coverage you want for each one, save it as you go, and book when you're ready."})]}),s&&(0,f.jsxs)("div",{className:"nm-summary",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(160px,1fr))",gap:1,background:ed.paperBorder,border:"1px solid ".concat(ed.paperBorder),borderRadius:12,overflow:"hidden",marginBottom:36},children:[(0,f.jsx)(bd,{label:"SHOWS AHEAD",value:s.shows_ahead}),(0,f.jsx)(bd,{label:"BOOKED",value:s.booked,tone:ed.successFg}),(0,f.jsx)(bd,{label:"NOT YET BOOKED",value:s.not_booked,tone:ed.warnFg}),(0,f.jsx)(bd,{label:s.drafts>0?"DRAFTS SAVED":"NEXT SHOW",value:s.drafts>0?s.drafts:s.next_show?Xc(s.next_show).month+" "+Xc(s.next_show).day:"\u2014"})]}),i.map(e=>{let[t,s]=e;const a=s.filter(e=>"booked"===e.state).length;return(0,f.jsxs)("section",{style:{marginBottom:28},children:[(0,f.jsxs)("div",{style:{background:ed.carbon,color:"#fff",borderRadius:"10px 10px 0 0",padding:"14px 20px",display:"flex",alignItems:"baseline",gap:14,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:17}),children:t}),(0,f.jsxs)("span",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".16em",color:ed.textFaintDark},children:[s.length," SHOWS \xb7 ",a," BOOKED \xb7 ",s.length-a," TO BOOK"]})]}),(0,f.jsx)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderTop:"none",borderRadius:"0 0 10px 10px",overflow:"hidden"},children:s.map((e,t)=>(0,f.jsx)(yd,{row:e,last:t===s.length-1,onBuild:n,onJob:r},e.event_id))})]},t)}),(0,f.jsxs)("div",{style:{background:ed.carbon,color:"#fff",borderRadius:12,padding:"26px 28px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:20,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:16,fontWeight:700},children:"A show missing, or dates changed?"}),(0,f.jsx)("div",{style:{fontSize:13.5,color:ed.textFaintDark,marginTop:4},children:"We keep this calendar current \u2014 tell us and we'll update it."})]}),(0,f.jsxs)("a",{href:"mailto:[email protected]",className:"nm-primary",style:{background:ed.red,color:"#fff",textDecoration:"none",borderRadius:9,padding:"12px 20px",fontFamily:td,fontSize:13.5,fontWeight:700,display:"inline-flex",alignItems:"center",gap:8},children:["Contact [email protected] ",(0,f.jsx)(S.A,{size:15,strokeWidth:2.4})]})]})]})}const bd=e=>{let{label:t,value:s,tone:a}=e;return(0,f.jsxs)("div",{style:{background:"#fff",padding:"18px 20px"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:t}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:24,fontWeight:700,marginTop:7,color:a||ed.textPrimary},children:s})]})};function yd(e){let{row:t,last:s,onBuild:a,onJob:n}=e;const r=Xc(t.event_date),i="booked"===t.state?id.booked:"draft"===t.state?id.draft:id.open;return(0,f.jsxs)("div",{className:"nm-row nm-show-row",style:{display:"grid",gridTemplateColumns:"78px 1fr 280px",gap:16,padding:"18px 20px",borderBottom:s?"none":"1px solid ".concat(ed.paperHairline),alignItems:"center"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10.5,fontWeight:700,color:ed.red,letterSpacing:".08em"},children:r.month}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:25,fontWeight:700,lineHeight:1},children:r.day})]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:16.5,fontWeight:700},children:t.name}),(0,f.jsxs)("div",{style:{fontSize:13,color:ed.textSecondary,marginTop:3},children:[Qc(t.event_date,t.date_tbc),t.venue?" \xb7 ".concat(t.venue):""]}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginTop:9},children:[(0,f.jsx)(Nd,{bg:i.bg,fg:i.fg,children:i.label}),t.countdown&&(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".1em",color:ed.textFaint},children:t.countdown.toUpperCase()}),"booked"===t.state&&t.crew_locked&&(0,f.jsxs)(Nd,{bg:id.locked.bg,fg:id.locked.fg,children:[(0,f.jsx)(ht.A,{size:9,style:{marginRight:4,verticalAlign:-1}}),"LOCKED"]})]})]}),(0,f.jsxs)("div",{className:"nm-show-right",style:{textAlign:"right"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".16em",color:ed.textFaint},children:"booked"===t.state?"BOOKED TOTAL":"draft"===t.state?"DRAFT":"NO QUOTE YET"}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:16,fontWeight:700,margin:"5px 0 11px"},children:"booked"===t.state?$c(t.booked_total):"draft"===t.state?$c(t.draft_total):(0,f.jsx)("span",{style:{color:ed.textFaint,fontSize:13},children:"Build to price"})}),(0,f.jsx)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",flexWrap:"wrap"},children:"booked"===t.state?(0,f.jsxs)(f.Fragment,{children:[t.editable&&(0,f.jsx)(Rd,{onClick:()=>a(t),children:"Modify package"}),(0,f.jsx)(Id,{onClick:()=>n(t),children:"View job"})]}):(0,f.jsx)(Dd,{onClick:()=>a(t),children:"draft"===t.state?"Resume draft":"Build package"})})]})]})}function vd(e){let{show:t,catalogue:s,selection:a,setSelection:n,step:r,setStep:i,pricing:o,savedAt:l,onBack:c,onDiscard:d,onBook:p,onDownloadQuote:x}=e;const h=s.roles||[],u=(s.items||[]).filter(e=>"deliverable"===e.scope),g=(s.items||[]).filter(e=>"extra"===e.scope),b=h.filter(e=>{var t;return((null===(t=a.roles)||void 0===t?void 0:t[e.id])||0)>0}),y=Object.values(a.roles||{}).reduce((e,t)=>
1e+t,0),v=(e,t)=>n(s=>{const a=(0,m.A)({},s.roles||{}),n=(0,m.A)({},s.durations||{});return t<=0?(delete a[e],delete n[e]):a[e]=t,(0,m.A)((0,m.A)({},s),{},{roles:a,durations:n})}),j=(e,t)=>n(s=>{const a=(0,m.A)({},s.deliverables||{});return t<=0?delete a[e]:a[e]=t,(0,m.A)((0,m.A)({},s),{},{deliverables:a})}),w=e=>(s.durations||[]).filter(s=>{var a,n;return"halfDay"===s.id?t.half_day_enabled&&Number((null===(a=e.rates)||void 0===a?void 0:a.halfDay)||0)>0:(s.days||0)<=(t.max_days||1)&&Number((null===(n=e.rates)||void 0===n?void 0:n[s.id])||0)>0}),N=r>1||y>0;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{padding:"30px 0 24px"},children:[(0,f.jsxs)("button",{type:"button",onClick:c,style:{background:"none",border:"none",padding:0,color:ed.textSecondary,fontFamily:sd,fontSize:13.5,fontWeight:600,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6},children:[(0,f.jsx)(Ct.A,{size:15})," All shows"]}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10,fontWeight:700,letterSpacing:".2em",color:ed.red,marginTop:18},children:"BUILD YOUR PACKAGE"}),(0,f.jsx)("h1",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:28,letterSpacing:"-.02em",textTransform:"uppercase",margin:"10px 0 0"}),children:t.name}),(0,f.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"center",flexWrap:"wrap",marginTop:10},children:[(0,f.jsxs)("span",{style:{fontSize:13.5,color:ed.textSecondary},children:[Qc(t.event_date,t.date_tbc),t.venue?" \xb7 ".concat(t.venue):""]}),(0,f.jsxs)(Nd,{bg:ed.neutralClientBg,fg:ed.neutralClientFg,children:["UP TO ",t.max_days," ",1===t.max_days?"DAY":"DAYS"]})]})]}),(0,f.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:26},children:pd.map(e=>{const t=e.n===r,s=e.n<r;return(0,f.jsxs)("button",{type:"button",onClick:()=>(1===e.n||y>0)&&i(e.n),style:{display:"inline-flex",alignItems:"center",gap:9,borderRadius:999,padding:"9px 16px 9px 9px",border:"1px solid ".concat(t?ed.carbon:ed.paperBorder),background:t?ed.carbon:"#fff",color:t?"#fff":ed.textSecondary,cursor:"pointer",fontFamily:sd,fontSize:13,fontWeight:600},children:[(0,f.jsx)("span",{style:{width:22,height:22,borderRadius:7,display:"inline-flex",alignItems:"center",justifyContent:"center",fontFamily:ad,fontSize:10.5,fontWeight:700,background:t?ed.red:s?ed.successBg:ed.paperHairline2,color:t?"#fff":s?ed.successFg:ed.textMuted},children:s?(0,f.jsx)(zt.A,{size:12,strokeWidth:3}):e.n}),e.label]},e.n)})}),(0,f.jsxs)("div",{className:"nm-build-grid",style:{display:"grid",gridTemplateColumns:"1fr 330px",gap:24,alignItems:"start"},children:[(0,f.jsxs)("div",{children:[1===r&&(0,f.jsx)(kd,{n:1,title:"I need a\u2026",children:h.map(e=>{var t;const s=(null===(t=a.roles)||void 0===t?void 0:t[e.id])||0,n=Math.min(...Object.values(e.rates||{}).filter(e=>e>0).concat([0]))||0;return(0,f.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"center",background:s?"#FEF7F6":"#fff",border:"1px solid ".concat(s?ed.red:ed.paperBorder),borderRadius:12,padding:"16px 18px",marginBottom:10},children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:15.5,fontWeight:700},children:e.label}),n>0&&(0,f.jsxs)("span",{style:{fontFamily:ad,fontSize:10,letterSpacing:".1em",color:ed.textMuted},children:["FROM ",$c(n)]})]}),e.blurb&&(0,f.jsx)("div",{style:{fontSize:13,color:ed.textSecondary,marginTop:4},children:e.blurb})]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:15,fontWeight:700,width:22,textAlign:"center"},children:s}),(0,f.jsx)(_d,{label:e.label,onMinus:()=>v(e.id,s-1),onPlus:()=>v(e.id,s+1),minusDisabled:0===s})]},e.id)})}),2===r&&(0,f.jsx)(kd,{n:2,title:"How long on site?",children:0===b.length?(0,f.jsx)(Sd,{children:"No crew added yet \u2014 go back to step 1."}):b.map(e=>{var t,s;const r=a.roles[e.id],i=null===(t=a.durations)||void 0===t?void 0:t[e.id],o=Number((null===(s=e.rates)||void 0===s?void 0:s[i])||0);return(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:"16px 18px",marginBottom:10},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:14,flexWrap:"wrap",alignItems:"baseline"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:15.5,fontWeight:700},children:e.label}),(0,f.jsxs)("span",{style:{fontFamily:ad,fontSize:10,letterSpacing:".1em",color:ed.textMuted,marginLeft:10},children:[r," ",1===r?"PERSON":"PEOPLE",o>0?" \xb7 ".concat($c(o)," EACH"):""]})]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:14,fontWeight:700},children:o>0?$c(o*r):(0,f.jsx)("span",{style:{color:ed.textFaint},children:"\u2014"})})]}),(0,f.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:12},children:w(e).map(t=>(0,f.jsx)("button",{type:"button",onClick:()=>{return s=e.id,a=t.id,n(e=>(0,m.A)((0,m.A)({},e),{},{durations:(0,m.A)((0,m.A)({},e.durations||{}),{},{[s]:a})}));var s,a},style:{borderRadius:8,padding:"9px 14px",cursor:"pointer",fontFamily:sd,fontSize:13,fontWeight:600,border:"1px solid ".concat(i===t.id?ed.red:ed.paperBorder),background:i===t.id?ed.red:"#fff",color:i===t.id?"#fff":ed.textSecondary},children:t.label},t.id))}
1),e.inclusions&&(0,f.jsx)("div",{style:{marginTop:14,paddingTop:13,borderTop:"1px solid ".concat(ed.paperHairline),fontSize:12.5,lineHeight:1.6,color:ed.textSecondary,whiteSpace:"pre-line"},children:e.inclusions})]},e.id)})}),3===r&&(0,f.jsx)(kd,{n:3,title:"What do you want back?",note:"Stills galleries are always included.",children:u.map(e=>{var t;const s=(null===(t=a.deliverables)||void 0===t?void 0:t[e.id])||0;return(0,f.jsx)(Cd,{item:e,qty:s,onMinus:()=>j(e.id,s-1),onPlus:()=>j(e.id,e.quantity_based?s+1:1),onToggle:()=>j(e.id,s?0:1)},e.id)})}),4===r&&(0,f.jsxs)(kd,{n:4,title:"Extras & review",children:[(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(240px,1fr))",gap:10,marginBottom:22},children:g.map(e=>{var t;const s=!(null===(t=a.addons)||void 0===t||!t[e.id]);return(0,f.jsxs)("button",{type:"button",role:"switch","aria-checked":s,onClick:()=>{return t=e.id,n(e=>{const s=(0,m.A)({},e.addons||{});return s[t]?delete s[t]:s[t]=!0,(0,m.A)((0,m.A)({},e),{},{addons:s})});var t},style:{textAlign:"left",background:s?"#FEF7F6":"#fff",border:"1px solid ".concat(s?ed.red:ed.paperBorder),borderRadius:12,padding:"14px 16px",cursor:"pointer",display:"flex",gap:12,alignItems:"flex-start"},children:[(0,f.jsx)("span",{style:{width:34,height:19,borderRadius:999,background:s?ed.red:ed.paperBorder,position:"relative",flexShrink:0,marginTop:2,transition:"background .2s"},children:(0,f.jsx)("span",{style:{position:"absolute",top:2,left:s?17:2,width:15,height:15,borderRadius:"50%",background:"#fff",transition:"left .2s"}})}),(0,f.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("span",{style:{display:"block",fontFamily:td,fontSize:14,fontWeight:700},children:e.label}),(0,f.jsxs)("span",{style:{display:"block",fontFamily:ad,fontSize:10.5,color:ed.textMuted,marginTop:3},children:[$c(e.price),e.unit?" ".concat(e.unit):""]}),e.description&&(0,f.jsx)("span",{style:{display:"block",fontSize:12.5,lineHeight:1.55,color:ed.textSecondary,marginTop:7,whiteSpace:"pre-line"},children:e.description})]})]},e.id)})}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".18em",color:ed.textMuted,marginBottom:12},children:"YOUR PACKAGE FOR THIS SHOW"}),(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,overflow:"hidden"},children:[0===o.lines.length&&(0,f.jsx)(Sd,{children:"Nothing added yet."}),o.lines.map((e,t)=>{var a;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:14,padding:"13px 17px",borderBottom:"1px solid ".concat(ed.paperHairline),fontSize:14},children:[(0,f.jsxs)("span",{children:[e.count>1?"".concat(e.count," \xd7 "):"",e.label,e.duration?" \xb7 ".concat((null===(a=(s.durations||[]).find(t=>t.id===e.duration))||void 0===a?void 0:a.label)||""):""]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontWeight:700},children:$c(e.amount)})]},"".concat(e.kind,"-").concat(e.id,"-").concat(t))}),(0,f.jsxs)("div",{style:{padding:"14px 17px",background:ed.paperInset},children:[(0,f.jsx)(Fd,{label:"Subtotal ex GST",value:o.priced?$c(o.subtotal):"\u2014"}),(0,f.jsx)(Fd,{label:"GST 10%",value:o.priced?$c(o.gst):"\u2014"}),(0,f.jsx)(Fd,{label:"Total",value:o.priced?$c(o.total):"\u2014",strong:!0})]})]}),(0,f.jsxs)("div",{style:{marginTop:18,background:ed.paperInset,border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:"16px 18px"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".16em",color:ed.warnFg},children:"BILLED 30 DAYS PRIOR"}),(0,f.jsx)("p",{style:{fontSize:13,lineHeight:1.6,color:ed.textSecondary,margin:"8px 0 0"},children:"Invoice is issued 30 days before the show, Net 30 from issue. Travel for jobs outside Victoria is invoiced at cost after the event."})]})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:14,marginTop:22,flexWrap:"wrap"},children:[r>1?(0,f.jsxs)(Rd,{onClick:()=>i(r-1),children:[(0,f.jsx)(Ct.A,{size:14,style:{marginRight:6,verticalAlign:-2}}),pd[r-2].label]}):(0,f.jsx)("span",{}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".14em",color:ed.textFaint},children:1===r&&y>0?"".concat(y," CREW ADDED"):xd[r]}),r<4?(0,f.jsxs)(Dd,{disabled:!N,onClick:()=>N&&i(r+1),children:[pd[r].label," ",(0,f.jsx)(S.A,{size:14,style:{marginLeft:6,verticalAlign:-2}})]}):(0,f.jsx)("span",{})]})]}),(0,f.jsxs)("aside",{style:{position:"sticky",top:20,background:ed.carbon,color:"#fff",borderRadius:12,padding:"22px 22px 20px"},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:10},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".18em",color:ed.redLight},children:"YOUR PACKAGE"}),l&&(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9,color:"#4ADE80"},children:"\u25cf DRAFT SAVED"})]}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700,marginTop:12},children:t.name}),(0,f.jsxs)("div",{style:{marginTop:18,borderTop:"1px solid ".concat(ed.carbonBorder),paddingTop:14},children:[(0,f.jsx)(Ed,{label:"Crew",value:o.priced?$c(o.crewTotal):"\u2014"}),(0,f.jsx)(Ed,{label:"Deliverables",value:o.priced?$c(o.delivTotal):"\u2014"}),(0,f.jsx)(Ed,{label:"Extras",value:o.priced?$c(o.extrasTotal):"\u2014"})]}),(0,f.jsxs)("div",{style:{marginTop:14,borderTop:"1px solid ".concat(ed.carbonBorder),paddingTop:14},children:[(0,f.jsx)(Ed,{label:"Subtotal ex GST",value:o.priced?$c(o.subtotal):"\u2014"}),o.priced?(0,f.jsx)(Ed,{label:"GST 10%",value:$c(o.gst)}):(0,f.jsx)("p",{style:{fontSize:12.5,lineHeight:1.55,color:ed.textFaintDark,margin:"8px 0 0"},children:"Add the crew you need, then set their time on site \u2014 we'll price it from there."})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginTop:16,paddingTop:14,borderTop:"1px solid ".concat(ed.carbonBorder)},children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:14,fontWeight:700},children:"Total"}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:22,fontWeight:700},children:o.priced?$c(o.total):"\u2014"})]}),4===r&&(0,f.jsx)("button",{type:"button",className:"nm-primary",disabled:!o.priced,onClick:p,style:{width:"100%",marginTop:18,background:ed.red,color:"#fff",border:"none",borderRadius:10,padding:"14px 16px",fontFamily:td,fontSize:14.5,fontWeight:700,cursor:o.priced?"pointer":"default",opacity:o.priced?1:.5}
1,children:"booked"===t.state?"Update this booking":"Book this package"}),(0,f.jsxs)(Td,{disabled:!o.priced,onClick:x,children:[(0,f.jsx)(es.A,{size:14})," Download PDF"]}),(0,f.jsxs)("div",{style:{marginTop:14,fontFamily:ad,fontSize:9,lineHeight:1.7,letterSpacing:".08em",color:ed.textFaintDark},children:["YOUR DRAFT IS SAVED AS YOU GO \u2014 COME BACK ANY TIME."," ",(0,f.jsx)("button",{type:"button",onClick:d,style:{background:"none",border:"none",padding:0,color:ed.redLight,fontFamily:ad,fontSize:9,letterSpacing:".08em",cursor:"pointer"},children:"DISCARD DRAFT"})]})]})]})]})}function jd(e){let{job:t,onBack:s,onModify:a,onDownload:n}=e;const{show:r,booking:i,stages:o,crew:l,editable:c}=t;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{padding:"30px 0 24px"},children:[(0,f.jsxs)("button",{type:"button",onClick:s,style:{background:"none",border:"none",padding:0,color:ed.textSecondary,fontFamily:sd,fontSize:13.5,fontWeight:600,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6},children:[(0,f.jsx)(Ct.A,{size:15})," All shows"]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:20,flexWrap:"wrap",alignItems:"flex-end",marginTop:18},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)(Nd,{bg:id.booked.bg,fg:id.booked.fg,children:"BOOKED \xb7 SIGNED"}),(0,f.jsx)("h1",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:28,letterSpacing:"-.02em",textTransform:"uppercase",margin:"12px 0 0"}),children:r.name}),(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:11,letterSpacing:".1em",color:ed.textMuted,marginTop:8},children:[Qc(r.event_date,r.date_tbc).toUpperCase(),r.venue?" \xb7 ".concat(r.venue.toUpperCase()):""," \xb7 ",i.job_ref]})]}),(0,f.jsxs)("div",{style:{textAlign:"right"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".16em",color:ed.textFaint},children:"TOTAL INC GST"}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:24,fontWeight:700,marginTop:5},children:$c(i.total)})]})]})]}),(0,f.jsx)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:"22px 24px",marginBottom:22,display:"flex",gap:8,flexWrap:"wrap"},children:o.map((e,t)=>{const s=!e.done&&o.slice(0,t).every(e=>e.done);return(0,f.jsxs)("div",{style:{flex:"1 1 150px",minWidth:130},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("span",{style:{width:14,height:14,borderRadius:"50%",flexShrink:0,background:e.done?ed.red:ed.paperBorder,boxShadow:s?"0 0 0 4px rgba(191,33,47,.16)":"none"}}),t<o.length-1&&(0,f.jsx)("span",{style:{flex:1,height:2,background:e.done?ed.red:ed.paperBorder}})]}),(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600,color:e.done?ed.textPrimary:ed.textFaint,marginTop:10},children:e.label}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:8.5,letterSpacing:".14em",color:ed.textFaint,marginTop:3},children:e.meta})]},e.key)})}),(0,f.jsxs)("div",{className:"nm-job-grid",style:{display:"grid",gridTemplateColumns:"1.35fr 1fr",gap:22,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:"20px 22px"},children:[(0,f.jsx)(Ad,{children:"EVENT RUNSHEET"}),(0,f.jsx)(Nd,{bg:"published"===t.runsheet.state?id.booked.bg:ed.neutralClientBg,fg:"published"===t.runsheet.state?id.booked.fg:ed.neutralClientFg,children:t.runsheet.state.replace("_"," ").toUpperCase()}),(0,f.jsx)("p",{style:{fontSize:13.5,lineHeight:1.6,color:ed.textSecondary,margin:"14px 0 0"},children:"published"===t.runsheet.state?"Your runsheet is published \u2014 crew call times and site contacts are set.":"We build the detailed runsheet about three weeks before the show. You\u2019ll see it here as soon as it\u2019s ready."})]}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:22},children:[(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:"20px 22px"},children:[(0,f.jsx)(Ad,{children:"CREW ON THIS SHOW"}),(0,f.jsxs)("div",{style:{marginTop:12},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14.5,fontWeight:700},children:"James Anderson"}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".12em",color:ed.textMuted,marginTop:3},children:"DIRECTOR \xb7 ON EVERY NATIONAL MEDIA SHOW"})]}),l.length>1?l.filter(e=>"James Anderson"!==e.name).map(e=>(0,f.jsxs)("div",{style:{marginTop:13,paddingTop:13,borderTop:"1px solid ".concat(ed.paperHairline)},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14,fontWeight:700},children:e.name}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".12em",color:ed.textMuted,marginTop:3},children:(e.role||"CREW").toUpperCase()})]},e.name)):(0,f.jsx)("div",{style:{marginTop:13,paddingTop:13,borderTop:"1px solid ".concat(ed.paperHairline),fontSize:13,color:ed.textSecondary},children:"Additional crew assigned closer to the show."})]}),(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:"20px 22px"},children:[(0,f.jsx)(Ad,{children:"YOUR PACKAGE"}),(0,f.jsxs)("div",{style:{marginTop:12},children:[(i.lines||[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12,padding:"9px 0",borderBottom:"1px solid ".concat(ed.paperHairline),fontSize:13.5},children:[(0,f.jsxs)("span",{children:[e.count>1?"".concat(e.count," \xd7 "):"",e.label]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontWeight:700},children:$c(e.amount)})]},t)),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",paddingTop:12},children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:13.5,fontWeight:700},children:"TOTAL INC GST"}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:15,fontWeight:700},children:$c(i.total)})]})]}),c?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",className:"nm-primary",onClick:a,style:{width:"100%",marginTop:18,background:ed.red,color:"#fff",border:"none",borderRadius:10,padding:"13px 16px",fontFamily:td,fontSize:14,fontWeight:700,cursor:"pointer"},children:"Modify this package"}),(0,f.jsx)("p",{style:{fontSize:12.5,lineHeight:1.6,color:ed.textSecondary,margin:"10px 0 0"},children:"You can still change crew, days, deliverables and extras \u2014 right up until we assign crew to this job."})]}):(0,f.jsxs)("div",{style:{marginTop:18,background:ed.paperInset,border:"1px solid ".concat(ed.paperBorder),borderRadius:10,padding:"14px 16px"},children:[(0,f.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:7,fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".14em",color:ed.neutralClientFg},children:[(0,f.jsx)(ht.A,{size:11})," LOCKED"]}),(0,f.jsx)("p",{style:{fontSize:12.5,lineHeight:1.6,color:ed.textSecondary,margin:"8px 0 0"},children:"Crew is assigned and briefed for this show, so the package is now locked. Need a change? Call 1300 207 446 or email [email protected]."})]}),(0,f.jsxs)("button",{type:"button",onClick:n,style:{width:"100%",marginTop:12,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:10,padding:"12px 16px",fontFamily:td,fontSize:13.5,fontWeight:700,color:ed.textSecondary,cursor:"pointer"},children:[(0,f.jsx)(kt.A,{size:14})," Download booking confirmation"]})]})]})]})]})}function wd(e){let{show:t,terms:s,pricing:n,contact:r,busy:i,isUpdate:o,onClose:l,onConfirm:c}=e;const[d,p]=(0,a.useState)(!1),[x,h]=(0,a.useState)(!1),[u,b]=(0,a.useState)((null===r||void 0===r?void 0:r.name)||""),[y,v]=(0,a.useState)((null===r||void 0===r?void 0:r.position)||""),j=d&&x&&u.trim()&&!i;return(0,f.jsx)("div",{onClick:l,role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:300,background:"rgba(10,10,11,.62)",backdropFilter:"blur(3px)",overflowY:"auto",padding:20,display:"flex",alignItems:"flex-start",justifyContent:"center"},children:(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"100%",maxWidth:820,margin:"40px 0",background:ed.paper,borderRadius:14,overflow:"hidden"},children:[(0,f.jsxs)("div",{style:{background:ed.carbon,color:"#fff",padding:"20px 24px",display:"flex",justifyContent:"space-between",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".2em",color:ed.redLight},children:"CONFIRM YOUR BOOKING"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:20,textTransform:"uppercase",marginTop:8}),children:t.name}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textFaintDark,marginTop:5},children:[Qc(t.event_date,t.date_tbc),t.venue?" \xb7 ".concat(t.venue):""]})]}),(0,f.jsx)("button",{type:"button",onClick:l,style:{background:"none",border:"none",color:ed.textMuted,cursor:"pointer",alignSelf:"flex-start"},children:(0,f.jsx)(g.A,{size:20})})]}),(0,f.jsxs)("div",{style:{padding:"22px 24px"},children:[(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:10,overflow:"hidden",marginBottom:20},children:[n.lines.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12,padding:"11px 16px",borderBottom:"1px solid ".concat(ed.paperHairline),fontSize:13.5},children:[(0,f.jsxs)("span",{children:[e.count>1?"".concat(e.count," \xd7 "):"",e.label]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontWeight:700},children:$c(e.amount)})]},t)),(0,f.jsxs)("div",{style:{padding:"12px 16px",background:ed.paperInset},children:[(0,f.jsx)(Fd,{label:"Subtotal ex GST",value:$c(n.subtotal)}),(0,f.jsx)(Fd,{label:"GST 10%",value:$c(n.gst)}),(0,f.jsx)(Fd,{label:"Total",value:$c(n.total),strong:!0})]})]}),(0,f.jsxs)("div",{style:{maxHeight:300,overflowY:"auto",background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:10,padding:"18px 20px"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".16em",color:ed.warnFg},children:"IMPORTANT PROPOSAL NOTES"}),(0,f.jsx)("ol",{style:{margin:"12px 0 22px",paddingLeft:20,fontSize:12.5,lineHeight:1.65,color:ed.textSecondary},children:((null===s||void 0===s?void 0:s.proposal_notes)||[]).map((e,t)=>(0,f.jsx)("li",{style:{marginBottom:8},children:e},t))}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".16em",color:ed.textMuted},children:"TERMS & CONDITIONS"}),((null===s||void 0===s?void 0:s.sections)||[]).map(e=>(0,f.jsxs)("div",{style:{marginTop:16},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:12.5,fontWeight:700,textTransform:"uppercase",letterSpacing:".04em"},children:e.title}),e.highlight&&(0,f.jsx)("div",{style:{fontSize:12.5,fontWeight:700,color:ed.successFg,marginTop:5},children:e.highlight}),(0,f.jsx)("p",{style:{fontSize:12.5,lineHeight:1.65,color:ed.textSecondary,margin:"5px 0 0"},children:e.body})]},e.title))]}),(0,f.jsxs)("div",{style:{marginTop:20,display:"flex",flexDirection:"column",gap:12},children:[(0,f.jsx)(zd,{checked:d,onChange:p,children:"I have read and accept the Important Proposal Notes and the Terms & Conditions above."}),(0,f.jsx)(zd,{checked:x,onChange:h,children:"I confirm I am authorised to book this coverage on behalf of National Media, and that invoicing will follow the payment terms."})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(200px,1fr))",gap:12,marginTop:18},children:[(0,f.jsx)(Bd,{label:"FULL NAME",value:u,onChange:b,placeholder:"Your full name"}),(0,f.jsx)(Bd,{label:"POSITION",value:y,onChange:v,placeholder:"e.g. Event Manager"})]})]}),(0,f.jsxs)("div",{style:{borderTop:"1px solid ".concat(ed.paperBorder),padding:"18px 24px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,flexWrap:"wrap",background:"#fff"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".16em",color:ed.textFaint},children:"TOTAL INC GST"}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:20,fontWeight:700},children:$c(n.total)})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)(Rd,{onClick:l,children:"Back to package"}),(0,f.jsxs)(Dd,{disabled:!j,onClick:()=>c({signerName:u.trim(),signerPosition:y.trim()}),children:[i&&(0,f.jsx)(Kr.A,{size:14,style:{marginRight:7,verticalAlign:-2,animation:"nm-spin .9s linear infinite"}}),o?"Agree & update booking":"Agree & confirm booking"]})]}),(0,f.jsx)("div",{style:{flexBasis:"100%",fontFamily:ad,fontSize:8.5,letterSpacing:".12em",color:ed.textFaint},children:"CONFIRMING CREATES THE JOB, THE RUNSHEET RECORD AND EMAILS YOUR BOOKING CONFIRMATION PDF."})]})]})})}const Nd=e=>{let{bg:t,fg:s,children:a}=e;return(0,f.jsx)("span",{style:{display:"inline-flex",alignItems:"center",fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".1em",background:t,color:s,borderRadius:6,padding:"4px 8px"},children:a})},Ad=e=>{let{children:t}=e;return(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".18em",color:ed.textMuted,marginBottom:8},children:t})},kd=e=>{let{n:t,title:s,note:a,children:n}=e;return(0,f.jsxs)("section",{children:[(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".18em",color:ed.textMuted},children:["STEP ",t," OF 4"]}),(0,f.jsx)("h2",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:22,letterSpacing:"-.01em",margin:"8px 0 6px"}),children:s}),a&&(0,f.jsx)("p",{style:{fontSize:13.5,color:ed.textSecondary,margin:"0 0 16px"},children:a}),(0,f.jsx)("div",{style:{marginTop:a?0:16},children:n})]})},Sd=e=>{let{children:t}=e;return(0,f.jsx)("div",{style:{border:"1px dashed ".concat(ed.paperBorder),borderRadius:12,padding:"26px 18px",textAlign:"center",fontSize:13.5,color:ed.textFaint},children:t})},_d=e=>{let{onMinus:t,onPlus:s,minusDisabled:a,label:n="item"}=e;return(0,f.jsxs)("span",{style:{display:"inline-flex",gap:8},children:[(0,f.jsx)("button",{type:"button",onClick:t,disabled:a,"aria-label":"Remove one ".concat(n),style:{width:40,height:40,borderRadius:10,border:"1px solid ".concat(ed.paperBorder),background:"#fff",cursor:a?"default":"pointer",opacity:a?.4:1,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(md.A,{size:15})}),(0,f.jsx)("button",{type:"button",onClick:s,className:"nm-primary","aria-label":"Add one ".concat(n),style:{width:40,height:40,borderRadius:10,border:"none",background:ed.red,color:"#fff",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(ls.A,{size:15})})]})},Cd=e=>{let{item:t,qty:s,onMinus:a,onPlus:n,onToggle:r}=e;return(0,f.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"center",background:s?"#FEF7F6":"#fff",border:"1px solid ".concat(s?ed.red:ed.paperBorder),borderRadius:12,padding:"15px 18px",marginBottom:10},children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14.5,fontWeight:700},children:t.label}),(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:10.5,color:ed.textMuted,marginTop:3},children:[$c(t.price),t.unit?" ".concat(t.unit):""]}),t.description&&(0,f.jsx)("div",{style:{fontSize:12.5,lineHeight:1.55,color:ed.textSecondary,marginTop:6,whiteSpace:"pre-line"},children:t.description})]}),t.quantity_based?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:15,fontWeight:700,width:22,textAlign:"center"},children:s}),(0,f.jsx)(_d,{label:t.label,onMinus:a,onPlus:n,minusDisabled:0===s})]}):(0,f.jsx)("button",{type:"button",onClick:r,style:{borderRadius:9,padding:"10px 18px",border:"1px solid ".concat(s?ed.red:ed.paperBorder),background:s?ed.red:"#fff",color:s?"#fff":ed.textSecondary,fontFamily:td,fontSize:13,fontWeight:700,cursor:"pointer"},children:s?"YES":"NO"})]})},Fd=e=>{let{label:t,value:s,strong:a}=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"5px 0",fontSize:a?14.5:13,fontWeight:a?700:500,color:a?ed.textPrimary:ed.textSecondary},children:[(0,f.jsx)("span",{children:t}),(0,f.jsx)("span",{style:{fontFamily:ad,fontWeight:700},children:s})]})},Ed=e=>{let{label:t,value:s}=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"5px 0",fontSize:13,color:ed.textMuted},children:[(0,f.jsx)("span",{children:t}),(0,f.jsx)("span",{style:{fontFamily:ad,fontWeight:700,color:"
1#fff"},children:s})]})},Td=e=>{let{children:t,onClick:s,disabled:a}=e;return(0,f.jsx)("button",{type:"button",onClick:s,disabled:a,style:{width:"100%",marginTop:10,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,background:"transparent",border:"1px solid ".concat(ed.carbonBorder),borderRadius:10,padding:"11px 16px",fontFamily:td,fontSize:13,fontWeight:700,color:a?ed.textFaintDark:"#fff",cursor:a?"default":"pointer",opacity:a?.55:1},children:t})},zd=e=>{let{checked:t,onChange:s,children:a}=e;return(0,f.jsxs)("label",{style:{display:"flex",gap:12,alignItems:"flex-start",cursor:"pointer",fontSize:13.5,lineHeight:1.6,color:ed.textSecondary},children:[(0,f.jsxs)("span",{style:{position:"relative",width:20,height:20,flexShrink:0,marginTop:1},children:[(0,f.jsx)("input",{type:"checkbox",className:"nm-check",checked:t,onChange:e=>s(e.target.checked),style:{position:"absolute",inset:0,width:"100%",height:"100%",margin:0,opacity:0,cursor:"pointer"}}),(0,f.jsx)("span",{"aria-hidden":"true",style:{position:"absolute",inset:0,pointerEvents:"none",borderRadius:6,border:"1px solid ".concat(t?ed.red:ed.paperBorder),background:t?ed.red:"#fff",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:t&&(0,f.jsx)(zt.A,{size:13,color:"#fff",strokeWidth:3})})]}),(0,f.jsx)("span",{children:a})]})},Bd=e=>{let{label:t,value:s,onChange:a,placeholder:n}=e;return(0,f.jsxs)("label",{style:{display:"block"},children:[(0,f.jsx)("span",{style:{display:"block",fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".16em",color:ed.textMuted,marginBottom:6},children:t}),(0,f.jsx)("input",{value:s,onChange:e=>a(e.target.value),placeholder:n,style:{width:"100%",boxSizing:"border-box",background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:9,padding:"11px 13px",fontFamily:sd,fontSize:14,outline:"none"}})]})},Dd=e=>{let{children:t,onClick:s,disabled:a}=e;return(0,f.jsx)("button",{type:"button",onClick:s,disabled:a,className:"nm-primary",style:{background:ed.red,color:"#fff",border:"none",borderRadius:9,padding:"11px 18px",fontFamily:td,fontSize:13.5,fontWeight:700,cursor:a?"default":"pointer",opacity:a?.5:1},children:t})},Id=e=>{let{children:t,onClick:s}=e;return(0,f.jsx)("button",{type:"button",onClick:s,style:{background:ed.carbon,color:"#fff",border:"none",borderRadius:9,padding:"11px 18px",fontFamily:td,fontSize:13.5,fontWeight:700,cursor:"pointer"},children:t})},Rd=e=>{let{children:t,onClick:s}=e;return(0,f.jsx)("button",{type:"button",onClick:s,style:{background:"#fff",color:ed.textSecondary,border:"1px solid ".concat(ed.paperBorder),borderRadius:9,padding:"11px 18px",fontFamily:td,fontSize:13.5,fontWeight:700,cursor:"pointer"},children:t})};var Pd=s(26405);const Wd="'Space Mono',monospace",Od={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Ld={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},Md={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},qd={background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},Hd={display:"inline-flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},Ud="140px 1.4fr 1.5fr 90px 1.1fr 120px 130px 110px 36px",Gd=e=>new Date(e+"T00:00:00").toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric"}),Vd=()=>{const e=(0,o.gf)();if(e)return e;try{const e=localStorage.getItem("turbo360_admin_auth");if(e)return JSON.parse(e).token||null}catch(t){}return null};function Jd(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)("bookings");(0,a.useEffect)(()=>{(0,o.cd)()||e("/tboadmin")},[e]);const n=e=>({display:"inline-flex",alignItems:"center",gap:8,borderRadius:9,padding:"9px 16px",fontSize:13,fontWeight:600,cursor:"pointer",background:e?"#0A0A0B":"#fff",color:e?"#fff":"#55555C",border:e?"1px solid #0A0A0B":"1px solid #E4E4E9"});return(0,f.jsxs)(ta,{title:"AGHA Gift Fair",meta:"EVENTS \xb7 BOOKINGS",children:[(0,f.jsxs)("div",{style:{display:"flex",gap:10,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>
1s("bookings"),style:n("bookings"===t),children:[(0,f.jsx)(Pd.A,{size:15})," Bookings"]}),(0,f.jsxs)("button",{onClick:()=>s("settings"),style:n("settings"===t),children:[(0,f.jsx)(ss.A,{size:15})," Settings & Pricing"]})]}),"bookings"===t?(0,f.jsx)(Yd,{getAuthToken:Vd,navigate:e}):(0,f.jsx)(Kd,{getAuthToken:Vd,navigate:e})]})}function Yd(e){let{getAuthToken:t,navigate:s}=e;const[n,r]=(0,a.useState)([]),[i,o]=(0,a.useState)(!0),[l,c]=(0,a.useState)(null),[d,u]=(0,a.useState)(""),[g,b]=(0,a.useState)(""),[y,v]=(0,a.useState)(""),j=async()=>{o(!0),c(null);try{const e=t();if(!e)return c("Session expired. Please log in again."),void o(!1);let a="".concat(I.fn,"/api/agha/bookings?");g&&(a+="date=".concat(g,"&")),y&&(a+="status=".concat(y,"&")),d&&(a+="search=".concat(encodeURIComponent(d),"&"));const n=await fetch(a,{headers:{Authorization:"Bearer ".concat(e)}});if(401===n.status)return void s("/tboadmin");const i=await n.json();i.success?r(i.bookings):c("Failed to load bookings")}catch(e){c("Failed to connect to server")}finally{o(!1)}};(0,a.useEffect)(()=>{j()},[g,y]);const w=n.filter(e=>"active"===e.status),N=w.filter(e=>"paid"===e.payment_status).length,A=w.filter(e=>"invoice_requested"===e.payment_status).length,k=e=>{let{label:t,value:s,color:a="#0A0A0B"}=e;return(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Od),{},{padding:"16px 18px"}),children:[(0,f.jsx)("div",{style:{fontFamily:Wd,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:9},children:t}),(0,f.jsx)("div",{style:{fontFamily:Wd,fontWeight:700,fontSize:24,letterSpacing:"-0.02em",color:a},children:s})]})};return(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:14,marginBottom:20},children:[(0,f.jsx)(k,{label:"ACTIVE",value:w.length}),(0,f.jsx)(k,{label:"PAID (CARD)",value:N,color:"#15803D"}),(0,f.jsx)(k,{label:"INVOICE REQ.",value:A,color:"#92400E"}),(0,f.jsx)(k,{label:"TOTAL",value:n.length,color:"#4338CA"})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Od),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"16px 18px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:[(0,f.jsxs)("form",{onSubmit:e=>{e.preventDefault(),j()},style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:200},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{value:d,onChange:e=>u(e.target.value),placeholder:"Search name, email, business, booth\u2026",style:{border:"none",background:"transparent",outline:"none",fontSize:13,width:"100%"}})]}),(0,f.jsxs)("select",{value:g,onChange:e=>b(e.target.value),style:qd,children:[(0,f.jsx)("option",{value:"",children:"All dates"}),[...new Set(n.map(e=>e.date))].sort().map(e=>(0,f.jsx)("option",{value:e,children:Gd(e)},e))]}),(0,f.jsxs)("select",{value:y,onChange:e=>v(e.target.value),style:qd,children:[(0,f.jsx)("option",{value:"",children:"All statuses"}),(0,f.jsx)("option",{value:"active",children:"Active"}),(0,f.jsx)("option",{value:"cancelled",children:"Cancelled"})]}),(0,f.jsxs)("button",{onClick:j,style:Hd,children:[(0,f.jsx)(As.A,{size:14})," Refresh"]}),(0,f.jsxs)("button",{className:"tg-btn-primary",onClick:()=>{const e=[["Date","Time","Business","Name","Email","Mobile","Booth","Services","Total","Payment","Status"],...n.map(e=>{var t;return[e.date,e.timeSlot,e.businessName,"".concat(e.firstName," ").concat(e.lastName),e.email,e.mobile,e.boothNumber,(e.services||[]).join("; "),null!==(t=e.amount_total)&&void 0!==t?t:"","".concat(e.payment_method||"","/").concat(e.payment_status||""),e.status]})].map(e=>e.map(e=>'"'.concat(String(null!==e&&void 0!==e?e:"").replace(/"/g,'""'),'"')).join(",")).join("\n"),t=document.createElement("a");t.href=URL.createObjectURL(new Blob([e],{type:"text/csv"})),t.download="agha-bookings-".concat((new Date).toISOString().slice(0,10),".csv"),t.click()},style:{display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"8px 14px",fontSize:13,fontWeight:600,cursor:"pointer"},children:[(0,f.jsx)(es.A,{size:14})," Export CSV"]})]}),l&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,margin:18,background:"#FEE2E2",border:"1px solid #FECACA",borderRadius:9,padding:"11px 13px",color:"#991B1B",fontSize:13},children:[(0,f.jsx)(h.A,{size:15}),l]}),(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:Ud,gap:12,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:Wd,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Date / Slot"}),(0,f.jsx)("span",{children:"Business"}),(0,f.jsx)("span",{children:"Contact"}),(0,f.jsx)("span",{children:"Booth"}),(0,f.jsx)("span",{children:"Services"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Total"}),(0,f.jsx)("span",{children:"Payment"}),(0,f.jsx)("span",{children:"Status"}),(0,f.jsx)("span",{})]}),i?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:6})}):0===n.length?(0,f.jsx)(Os,{icon:Pd.A,title:"No bookings yet",message:"Bookings will appear here once exhibitors start reserving slots."}):n.map(e=>{const s="cancelled"===e.status;return(0,f.jsxs)("div",{className:"tg-row",style:{display:"grid",gridTemplateColumns:Ud,gap:12,alignItems:"center",padding:"13px 22px",borderBottom:"1px solid #F2F2F5",opacity:s?.5:1},children:[(0,f.jsxs)("div",{style:{fontFamily:Wd,fontSize:12},children:[(0,f.jsx)("div",{style:{fontWeight:700},children:Gd(e.date)}),(0,f.jsx)("div",{style:{color:"#9A9AA0"},children:e.timeSlot})]}),(0,f.jsx)("div",{style:{minWidth:0,fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.businessName}),(0,f.jsxs)("div",{className:"tg-booking-meta",style:{minWidth:0},children:[(0,f.jsxs)("div",{style:{fontSize:13,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[e.firstName," ",e.lastName]}),(0,f.jsx)("div",{style:{fontSize:11,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.email}),(0,f.jsx)("div",{style:{fontSize:11,color:"#9A9AA0"},children:e.mobile})]}),(0,f.jsx)("span",{style:{fontFamily:Wd,fontSize:12,color:"#55555C"},children:e.boothNumber}),(0,f.jsx)("div",{className:"tg-booking-meta",style:{display:"flex",gap:5,flexWrap:"wrap"},children:(e.services||[]).map((e,t)=>(0,f.jsx)("span",{style:{fontSize:10.5,background:"#F2F2F5",color:"#55555C",borderRadius:5,padding:"2px 7px"},children:e},t))}),(0,f.jsx)("span",{style:{textAlign:"right"},children:(0,f.jsx)(zs,{amount:e.amount_total,size:13,mutedSize:10})}),(0,f.jsx)("span",{children:(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5},children:["stripe"===e.payment_method?(0,f.jsx)(Dc.A,{size:13,color:"#55555C"}):(0,f.jsx)(kt.A,{size:13,color:"#55555C"}),(0,f.jsx)(Ds,{tone:"paid"===e.payment_status?"green":"amber",children:"paid"===e.payment_status?"Paid":"invoice_requested"===e.payment_status?"Invoice":e.payment_status||"\u2014"})]})}),(0,f.jsx)("span",{children:"active"===e.status?(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:12,fontWeight:600,color:"#15803D"},children:[(0,f.jsx)(p.A,{size:13}),"Active"]}):(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:12,color:"#9A9AA0"},children:[(0,f.jsx)(x.A,{size:13}),"Cancelled"]})}),(0,f.jsx)("span",{style:{justifySelf:"center"},children:"active"===e.status&&(0,f.jsx)("button",{onClick:()=>(async e=>{if(!window.confirm("Cancel this booking?"))return;const s=t();(await fetch("".concat(I.fn,"/api/agha/admin/bookings/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}})).ok?j():alert("Failed to cancel booking")})(e.id),title:"Cancel booking",style:{background:"none",border:"none",color:"#991B1B",cursor:"pointer",display:"flex",padding:4},children:(0,f.jsx)(la.A,{size:15})})})]},e.id)})]})]})}function Kd(e){let{getAuthToken:t,navigate:s}=e;const[n,r]=(0,a.useState)(null),[i,o]=(0,a.useState)(!0),[l,c]=(0,a.useState)(!1),[d,p]=(0,a.useState)(null),[x,h]=(0,a.useState)("");(0,a.useEffect)(()=>{(async()=>{o(!0);const e=t(),a=await fetch("".concat(I.fn,"/api/agha/admin/config"),{headers:{Authorization:"Bearer ".concat(e)}});if(401===a.status)return void s("/tboadmin");const n=await a.json();n.success&&r(n.config),o(!1)})()},[]);const u=(e,t)=>
1r(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t})),g=(e,t,s,a)=>r(n=>{const r=[...n[e]||[]];return r[t]=(0,m.A)((0,m.A)({},r[t]),{},{[s]:a}),(0,m.A)((0,m.A)({},n),{},{[e]:r})});if(i||!n)return(0,f.jsx)("div",{style:{maxWidth:880},children:(0,f.jsx)(Ws,{rows:6})});const b=e=>{let{title:t,subtitle:s,right:a,children:n}=e;return(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Od),{},{padding:22}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",marginBottom:s?14:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:t}),s&&(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0",marginTop:4},children:s})]}),a]}),n]})},y=e=>{let{label:t,children:s}=e;return(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Ld,children:t}),s]})},v=e=>{let{keyName:t,title:s}=e;return(0,f.jsx)(b,{title:s,right:(0,f.jsxs)("button",{onClick:()=>{return e=t,r(t=>(0,m.A)((0,m.A)({},t),{},{[e]:[...t[e]||[],{id:"".concat("services"===e?"svc":"pkg","-").concat(Date.now()),name:"New item",description:"",price:0,active:!0,sort_order:(t[e]||[]).length+1}]}));var e},style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:13,fontWeight:600,color:"#BF212F",background:"none",border:"none",cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:15})," Add"]}),children:(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:(n[t]||[]).map((e,s)=>(0,f.jsx)("div",{style:{border:"1px solid #EDEDF0",borderRadius:11,padding:12,background:e.active?"#fff":"#FBFBFC",opacity:e.active?1:.7},children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1.2fr 1.4fr 0.8fr auto auto",gap:10,alignItems:"center"},children:[(0,f.jsx)("input",{value:e.name,onChange:e=>g(t,s,"name",e.target.value),placeholder:"Name",style:Md}),(0,f.jsx)("input",{value:e.description||"",onChange:e=>g(t,s,"description",e.target.value),placeholder:"Description",style:Md}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0",fontSize:13},children:"$"}),(0,f.jsx)("input",{type:"number",value:e.price,onChange:e=>g(t,s,"price",e.target.value),placeholder:"0",style:(0,m.A)((0,m.A)({},Md),{},{padding:"11px 10px"})}),(0,f.jsx)("span",{style:{color:"#9A9AA0",fontSize:11},children:"ex"})]}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12,fontWeight:600,color:"#55555C",whiteSpace:"nowrap"},children:[(0,f.jsx)("input",{type:"checkbox",checked:e.active,onChange:e=>g(t,s,"active",e.target.checked)})," On"]}),(0,f.jsx)("button",{onClick:()=>((e,t)=>r(s=>(0,m.A)((0,m.A)({},s),{},{[e]:(s[e]||[]).filter((e,s)=>s!==t)})))(t,s),title:"Remove",style:{background:"none",border:"none",color:"#991B1B",cursor:"pointer",display:"flex",justifySelf:"end",padding:4},children:(0,f.jsx)(la.A,{size:15})})]})},e.id))})})};return(0,f.jsxs)("div",{style:{maxWidth:880,display:"flex",flexDirection:"column",gap:18},children:[d&&(0,f.jsx)("div",{style:{borderRadius:9,padding:"11px 13px",fontSize:13,fontWeight:600,background:d.ok?"#DCFCE7":"#FEE2E2",color:d.ok?"#15803D":"#991B1B",border:"1px solid ".concat(d.ok?"#BBF7D0":"#FECACA")},children:d.text}),(0,f.jsx)(b,{title:"Event Settings",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsx)(y,{label:"Event name",children:(0,f.jsx)("input",{value:n.event_name||"",onChange:e=>u("event_name",e.target.value),style:Md})}),(0,f.jsx)(y,{label:"Notification email",children:(0,f.jsx)("input",{value:n.business_owner_email||"",onChange:e=>u("business_owner_email",e.target.value),style:Md})}),(0,f.jsx)(y,{label:"Start time (HH:MM)",children:(0,f.jsx)("input",{value:n.start_time||"",onChange:e=>u("start_time",e.target.value),style:Md,placeholder:"10:00"})}),(0,f.jsx)(y,{label:"End time (HH:MM)",children:(0,f.jsx)("input",{value:n.end_time||"",onChange:e=>u("end_time",e.target.value),style:Md,placeholder:"16:30"})}),(0,f.jsx)(y,{label:"Slot duration (min)",children:(0,f.jsx)("input",{type:"number",value:n.slot_duration_minutes||30,onChange:e=>u("slot_duration_minutes",e.target.value),style:Md})}),(0,f.jsx)(y,{label:"Allowed dates (comma separated, YYYY-MM-DD)",children:(0,f.jsx)("input",{value:(n.allowed_dates||[]).join(", "),onChange:e=>u("allowed_dates",e.target.value.split(",").map(e=>
1e.trim()).filter(Boolean)),style:Md})})]})}),(0,f.jsx)(v,{keyName:"services",title:"Individual Services (prices ex-GST)"}),(0,f.jsx)(v,{keyName:"packages",title:"Packages (prices ex-GST)"}),(0,f.jsx)(b,{title:"AGHA Staff View-Only Login",subtitle:(0,f.jsxs)(f.Fragment,{children:["Shared login for AGHA staff to view (not edit) bookings at ",(0,f.jsx)("span",{style:{fontFamily:Wd},children:"/agha-staff/login"}),". ",n.has_staff_login?"A login is currently set.":"No login set yet."]}),children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsx)(y,{label:"Staff email",children:(0,f.jsx)("input",{value:n.staff_email||"",onChange:e=>u("staff_email",e.target.value),style:Md,placeholder:"[email protected]"})}),(0,f.jsx)(y,{label:"Staff password ".concat(n.has_staff_login?"(leave blank to keep current)":""),children:(0,f.jsx)("input",{type:"password",value:x,onChange:e=>h(e.target.value),style:Md,placeholder:"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"})})]})}),(0,f.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,f.jsxs)("button",{onClick:async()=>{c(!0),p(null);try{const e=t(),s={event_name:n.event_name,allowed_dates:n.allowed_dates,start_time:n.start_time,end_time:n.end_time,slot_duration_minutes:Number(n.slot_duration_minutes),business_owner_email:n.business_owner_email,staff_email:n.staff_email,services:(n.services||[]).map(e=>(0,m.A)((0,m.A)({},e),{},{price:Number(e.price)||0,sort_order:Number(e.sort_order)||0})),packages:(n.packages||[]).map(e=>(0,m.A)((0,m.A)({},e),{},{price:Number(e.price)||0,sort_order:Number(e.sort_order)||0}))};x&&(s.staff_password=x);const a=await fetch("".concat(I.fn,"/api/agha/admin/config"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(s)}),i=await a.json();i.success?(r(i.config),h(""),p({ok:!0,text:"Saved."})):p({ok:!1,text:i.detail||"Save failed"})}catch(e){p({ok:!1,text:"Save failed"})}finally{c(!1)}},disabled:l,className:"tg-btn-primary",style:{display:"inline-flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"11px 20px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,fontWeight:600,cursor:"pointer",opacity:l?.6:1},children:[l?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(ia.A,{size:15})," Save Changes"]})})]})}var Zd=s(97873),$d=s(69807),Qd=s(61064);const Xd=()=>{const e=(0,o.gf)();if(e)return e;try{const e=localStorage.getItem("turbo360_admin_auth");if(e)return JSON.parse(e).token||null}catch(t){}return null};async function em(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=await fetch("".concat(I.fn,"/api/nm/admin").concat(e),(0,m.A)((0,m.A)({},t),{},{headers:(0,m.A)({"Content-Type":"application/json",Authorization:"Bearer ".concat(Xd())},t.headers||{})}));if(!s.ok){let e="Request failed (".concat(s.status,")");try{e=(await s.json()).detail||e}catch(a){}const t=new Error(e);throw t.status=s.status,t}return s.json()}const tm="https://nm.turbo.net.au",sm=[{id:"overview",label:"Overview"},{id:"bookings",label:"Bookings"},{id:"timeline",label:"Timeline"},{id:"quotes",label:"Quotes"},{id:"runsheets",label:"Runsheets"},{id:"invoices",label:"Invoices"},{id:"crew",label:"Crew"},{id:"delivery",label:"Delivery"},{id:"catalogue",label:"Catalogue"},{id:"contacts",label:"Contacts & activity"}],am={background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:14},nm={fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:"0.14em",color:ed.textMuted},rm={width:"100%",boxSizing:"border-box",border:"1px solid ".concat(ed.adminBorder),borderRadius:9,padding:"10px 12px",fontFamily:sd,fontSize:13.5,color:ed.textPrimary,background:"#FBFBFC",outline:"none"},im=e=>e?String(e).slice(0,4):"",om=e=>{if(!e)return"\u2014";const t=Math.ceil((new Date("".concat(e,"T00:00:00"))-new Date)/864e5);return Number.isNaN(t)?"\u2014":t<0?"DONE":0===t?"TODAY":"T-".concat(t," DAYS")},lm={booked:{bg:ed.successBg,fg:ed.successFg,label:"BOOKED"},draft:{bg:ed.infoBg,fg:ed.infoFg,label:"QUOTED"},open:{bg:ed.warnBg,fg:ed.warnFg,label:"NOT BOOKED"}},cm={published:{bg:ed.successBg,fg:ed.successFg,label:"PUBLISHED"},draft:{bg:ed.warnBg,fg:ed.warnFg,label:"DRAFT"},not_started:{bg:ed.neutralAdminBg,fg:ed.neutralAdminFg,label:"NOT STARTED"}};function dm(){var e;const t=(0,r.Zp)(),[s,n]=(0,a.useState)("overview"),[i,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(!0),[p,x]=(0,a.useState)(""),[u,g]=(0,a.useState)("");(0,a.useEffect)(()=>{(0,o.cd)()||t("/tboadmin")},[t]);const b=(0,a.useCallback)(async()=>{const e=await em("/overview");return l(e),e},[]);(0,a.useEffect)(()=>{(async()=>{try{await b()}catch(e){x(e.message)}finally{d(!1)}})()},[b]);const y=(0,a.useCallback)(e=>{g(e),window.setTimeout(()=>g(""),4e3)},[]),v=(null===i||void 0===i?void 0:i.events)||[],j=(null===i||void 0===i?void 0:i.figures)||{},w=j.shows_total,N=c?"KEY ACCOUNT":"KEY ACCOUNT \xb7 ".concat(w," SHOW").concat(1===w?"":"S"," IN SYSTEM \xb7 ").concat(null!==(e=j.to_book)&&void 0!==e?e:0," TO BOOK");return(0,f.jsxs)(ta,{title:"National Media",meta:N,children:[(0,f.jsx)("style",{children:"\n @keyframes nm-spin { to { transform: rotate(360deg); } }\n .nm-tabs::-webkit-scrollbar { display: none; }\n .nm-tabs { scrollbar-width: none; }
1\n .nm-arow:hover { background: ".concat(ed.adminRowHover,"; }\n .nm-lift { transition: transform .18s, box-shadow .18s; }\n .nm-lift:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(10,10,11,.08); }\n @media (max-width: 1279px) { .nm-a-2up { grid-template-columns: 1fr !important; } }\n @media (max-width: 1023px) {\n .nm-a-head { display: none !important; }\n .nm-a-3up { grid-template-columns: 1fr !important; }\n .nm-a-4up { grid-template-columns: repeat(2,1fr) !important; }\n .nm-a-formgrid { grid-template-columns: 1fr !important; }\n }\n ")}),(0,f.jsxs)("div",{style:{background:ed.adminCanvas,minHeight:"100vh",padding:"28px 32px 60px",fontFamily:sd,color:ed.textPrimary},children:[p&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{borderColor:"#FCA5A5",background:ed.dangerBg,color:ed.dangerFg,padding:"13px 16px",marginBottom:18,display:"flex",gap:10,alignItems:"center",fontSize:13.5}),children:[(0,f.jsx)(h.A,{size:16})," ",p]}),u&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{borderColor:"#86EFAC",background:ed.successBg,color:ed.successFg,padding:"13px 16px",marginBottom:18,display:"flex",gap:10,alignItems:"center",fontSize:13.5}),children:[(0,f.jsx)(zt.A,{size:16})," ",u]}),(0,f.jsx)(mm,{figures:j,loading:c,onError:x}),(0,f.jsx)("div",{className:"nm-tabs",style:{display:"flex",gap:2,overflowX:"auto",borderBottom:"1px solid #DEDEE3",margin:"22px 0 20px"},children:sm.map(e=>{const t=s===e.id;return(0,f.jsx)("button",{type:"button",onClick:()=>n(e.id),style:{flexShrink:0,background:"none",border:"none",cursor:"pointer",padding:"10px 14px",fontFamily:sd,fontSize:13.5,fontWeight:600,color:t?ed.textPrimary:ed.textMuted,borderBottom:"2px solid ".concat(t?ed.red:"transparent"),marginBottom:-1},children:e.label},e.id)})}),c?(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"60px 0",textAlign:"center",color:ed.textMuted}),children:(0,f.jsx)(Kr.A,{size:22,style:{animation:"nm-spin .9s linear infinite"}})}):(0,f.jsxs)(f.Fragment,{children:["overview"===s&&(0,f.jsx)(ym,{events:v,onChanged:b,flash:y,onError:x,onGoTab:n}),"bookings"===s&&(0,f.jsx)(km,{onError:x}),"timeline"===s&&(0,f.jsx)(zm,{events:v}),"quotes"===s&&(0,f.jsx)(Tm,{onError:x}),"runsheets"===s&&(0,f.jsx)(Bm,{events:v}),"invoices"===s&&(0,f.jsx)(Dm,{events:v}),"crew"===s&&(0,f.jsx)(Im,{events:v,onChanged:b,flash:y,onError:x}),"delivery"===s&&(0,f.jsx)(Pm,{events:v,onChanged:b,flash:y,onError:x}),"catalogue"===s&&(0,f.jsx)(Om,{flash:y,onError:x}),"contacts"===s&&(0,f.jsx)(Lm,{onError:x})]})]})]})}function mm(e){var t,s,a;let{figures:n,loading:r,onError:i}=e;const o=[{label:"BOOKED TO DATE",value:r?"\u2014":$c(n.booked_value||0)},{label:"SHOWS IN SYSTEM",value:r?"\u2014":String(null!==(t=n.shows_total)&&void 0!==t?t:"\u2014")},{label:"STILL TO BOOK",value:r?"\u2014":"".concat(null!==(s=n.to_book)&&void 0!==s?s:0," SHOWS"),tone:ed.amber},{label:"QUOTES IN FLIGHT",value:r?"\u2014":String(null!==(a=n.drafts_open)&&void 0!==a?a:0)}];return(0,f.jsxs)("div",{style:{background:ed.carbon2,borderRadius:16,overflow:"hidden",border:"1px solid ".concat(ed.carbonBorder)},children:[(0,f.jsx)("div",{style:{height:3,background:rd}}),(0,f.jsxs)("div",{style:{padding:"22px 24px",display:"flex",gap:18,alignItems:"flex-start",flexWrap:"wrap"},children:[(0,f.jsx)("div",{style:{width:52,height:52,borderRadius:12,background:"#141414",border:"1px solid ".concat(ed.carbonBorder),display:"flex",alignItems:"center",justifyContent:"center",fontFamily:ad,fontSize:15,fontWeight:700,color:"#fff",flexShrink:0},children:"NM"}),(0,f.jsxs)("div",{style:{flex:1,minWidth:260},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:23,textTransform:"uppercase",color:"#fff",letterSpacing:"-.01em"}),children:"National Media"}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:9,flexWrap:"wrap"},children:[(0,f.jsx)(xm,{bg:"#3A1A1D",fg:ed.amber,children:"KEY ACCOUNT"}),(0,f.jsx)(xm,{bg:"#12281F",fg:"#4ADE80",children:"ACTIVE"})]}),(0,f.jsx)("p",{style:{maxWidth:660,margin:"13px 0 0",fontSize:13.5,lineHeight:1.6,color:"#9A9AA0"},children:"Trade-show media across Australia. Shows entered here publish straight to their booking portal and create the Event Runsheet record \u2014 the client builds and confirms their own coverage, then assigning crew locks the package."}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:15,flexWrap:"wrap"},children:[(0,f.jsx)(hm,{to:"/admin/clients",children:"Company 360"}),(0,f.jsx)(hm,{to:"/admin/invoices",children:"Invoices"}),(0,f.jsx)(hm,{to:"/admin/corporate",children:"Runsheets"}),(0,f.jsx)(pm,{onError:i}),(0,f.jsxs)("a",{href:tm,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:7,background:ed.red,color:"#fff",borderRadius:9,padding:"8px 13px",fontSize:13,fontWeight:700,textDecoration:"none"},children:[(0,f.jsx)(at.A,{size:14})," Open client portal"]})]})]})]}),(0,f.jsx)("div",{className:"nm-a-4up",style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:1,background:ed.carbonBorder},children:o.map(e=>(0,f.jsxs)("div",{style:{background:ed.carbon2,padding:"15px 20px"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".16em",color:"#6A6A72"},children:e.label}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:19,fontWeight:700,color:e.tone||"#fff",marginTop:6},children:e.value})]},e.label))})]})}function pm(e){let{onError:t}=e;const[s,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(!1),[o,l]=(0,a.useState)("");(0,a.useEffect)(()=>{(async()=>{try{const e=await em("/contacts");n((e.contacts||[]).filter(e=>!e.is_company))}catch(e){n([])}})()},[]);const c=(s||[]).find(e=>/adele/i.test(e.name))||(s||[])[0];if(!c)return null;const d=async e=>{l(e.id);try{await async function(e){const{token:t}=await em("/impersonate",{method:"POST",body:JSON.stringify({contact_id:e})});try{localStorage.setItem("nm-portal-token",t)}catch(s){}window.open("/national-media","_blank","noopener")}(e.id),i(!1)}catch(s){null===t||void 0===t||t(s.message)}finally{l("")}},p=(c.name||"").split(" ")[0]||"contact";return(0,f.jsxs)("span",{style:{position:"relative",display:"inline-flex"},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>d(c),disabled:!!o,style:{display:"inline-flex",alignItems:"center",gap:7,background:ed.carbon3,border:"1px solid ".concat(ed.carbonBorder),color:"#fff",borderRadius:"9px 0 0 9px",padding:"8px 13px",fontSize:13,fontWeight:600,cursor:"pointer"},children:[o?(0,f.jsx)(Kr.A,{size:14,style:{animation:"nm-spin .9s linear infinite"}}):(0,f.jsx)(Zd.A,{size:14}
1),"Login as ",p]}),(0,f.jsx)("button",{type:"button",onClick:()=>i(e=>!e),title:"View as another contact",style:{background:ed.carbon3,border:"1px solid ".concat(ed.carbonBorder),borderLeft:"none",color:"#9A9AA0",borderRadius:"0 9px 9px 0",padding:"8px 10px",fontSize:11,cursor:"pointer"},children:"\u25be"}),r&&(0,f.jsxs)("div",{style:{position:"absolute",top:"calc(100% + 6px)",left:0,zIndex:40,minWidth:240,background:ed.carbon2,border:"1px solid ".concat(ed.carbonBorder),borderRadius:10,padding:6,boxShadow:"0 12px 30px rgba(0,0,0,.45)"},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{padding:"6px 8px"}),children:"VIEW PORTAL AS"}),s.map(e=>(0,f.jsxs)("button",{type:"button",onClick:()=>d(e),disabled:!!o,style:{display:"block",width:"100%",textAlign:"left",background:"none",border:"none",color:"#fff",padding:"7px 8px",borderRadius:7,fontSize:13,cursor:"pointer"},children:[e.name||e.email,(0,f.jsx)("span",{style:{display:"block",fontSize:11,color:ed.textFaintDark},children:e.email})]},e.id)),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{padding:"7px 8px 4px",lineHeight:1.5}),children:"READ-ONLY PREVIEW \xb7 CAN'T BOOK OR SAVE DRAFTS"})]})]})}const xm=e=>{let{bg:t,fg:s,children:a}=e;return(0,f.jsx)("span",{style:{background:t,color:s,borderRadius:5,padding:"4px 8px",fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".14em"},children:a})},hm=e=>{let{to:t,children:s}=e;return(0,f.jsxs)(r.N_,{to:t,style:{display:"inline-flex",alignItems:"center",gap:6,background:ed.carbon3,border:"1px solid ".concat(ed.carbonBorder),color:"#fff",borderRadius:9,padding:"8px 13px",fontSize:13,fontWeight:600,textDecoration:"none"},children:[s," ",(0,f.jsx)(S.A,{size:13})]})},um=e=>{let{tone:t,children:s}=e;return(0,f.jsx)("span",{style:{background:t.bg,color:t.fg,borderRadius:5,padding:"3px 7px",fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".12em",whiteSpace:"nowrap"},children:null!==s&&void 0!==s?s:t.label})},gm=e=>{let{label:t,right:s}=e;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:12,flexWrap:"wrap"},children:[(0,f.jsx)("div",{style:nm,children:t}),s]})},fm=e=>{let{label:t,value:s,tone:a}=e;return(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"15px 18px"}),children:[(0,f.jsx)("div",{style:nm,children:t}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:21,fontWeight:700,color:a||ed.textPrimary,marginTop:7},children:s})]})},bm=e=>{let{children:t,to:s,cta:a}=e;return(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"14px 18px",marginBottom:14,display:"flex",gap:12,alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",background:ed.adminTableHead}),children:[(0,f.jsx)("div",{style:{fontSize:13,color:ed.textSecondary},children:t}),s&&(0,f.jsxs)(r.N_,{to:s,style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:13,fontWeight:700,color:ed.red,textDecoration:"none",whiteSpace:"nowrap"},children:[a," ",(0,f.jsx)(S.A,{size:13})]})]})};function ym(e){let{events:t,onChanged:s,flash:n,onError:r,onGoTab:i}=e;const[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)("list"),[p,x]=(0,a.useState)("upcoming"),[h,u]=(0,a.useState)(!1),[g,b]=(0,a.useState)({event_name:"",event_date:"",venue:"",city:"",nm_max_days:1,date_tbc:!1}),y=(0,a.useMemo)(()=>[...new Set(t.map(e=>im(e.event_date)).filter(Boolean))].sort(),[t]),v=(0,a.useMemo)(()=>t.filter(e=>"all"===p||("upcoming"===p?"DONE"!==om(e.event_date):im(e.event_date)===p)),[t,p]),j=g.event_name.trim()&&g.event_date&&!h;return(0,f.jsxs)(f.Fragment,{children:[o?(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{border:"1px solid ".concat(ed.red),padding:"20px 22px",marginBottom:18}),children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700,marginBottom:15},children:"New event"}),(0,f.jsxs)("div",{className:"nm-a-formgrid",style:{display:"grid",gridTemplateColumns:"2fr 1fr 1.4fr 1fr 0.7fr",gap:12},children:[(0,f.jsx)(vm,{label:"EVENT NAME *",children:(0,f.jsx)("input",{style:rm,value:g.event_name,onChange:e=>b((0,m.A)((0,m.A)({},g),{},{event_name:e.target.value})),placeholder:"e.g. Futurebuild Queensland"})}),(0,f.jsx)(vm,{label:"START DATE *",children:(0,f.jsx)("input",{style:rm,type:"date",value:g.event_date,onChange:e=>b((0,m.A)((0,m.A)({},g),{},{event_date:e.target.value}))})}),(0,f.jsx)(vm,{label:"VENUE",children:(0,f.jsx)("input",{style:rm,value:g.venue,onChange:e=>b((0,m.A)((0,m.A)({},g),{},{venue:e.target.value}))})}),(0,f.jsx)(vm,{label:"CITY",children:(0,f.jsx)("input",{style:rm,value:g.city,onChange:e=>b((0,m.A)((0,m.A)({},g),{},{city:e.target.value}))})}),(0,f.jsx)(vm,{label:"MAX DAYS",children:(0,f.jsx)("input",{style:rm,type:"number",min:1,max:7,value:g.nm_max_days,onChange:e=>b((0,m.A)((0,m.A)({},g),{},{nm_max_days:e.target.value}))})})]}),(0,f.jsxs)("label",{style:{display:"inline-flex",gap:8,alignItems:"center",marginTop:14,fontSize:13,color:ed.textSecondary,cursor:"pointer"},children:[(0,f.jsx)("input",{type:"checkbox",checked:g.date_tbc,onChange:e=>b((0,m.A)((0,m.A)({},g),{},{date_tbc:e.target.checked}))}),'Date is still TBC (the show stays visible; the portal shows the date with "(TBC)")']}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:16,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{type:"button",disabled:!j,onClick:async()=>{u(!0);try{await em("/events",{method:"POST",body:JSON.stringify((0,m.A)((0,m.A)({},g),{},{nm_max_days:Number(g.nm_max_days)||1}
1))}),b({event_name:"",event_date:"",venue:"",city:"",nm_max_days:1,date_tbc:!1}),l(!1),await s(),n("Show added \u2014 it is live in the client portal and its runsheet record exists.")}catch(e){r(e.message)}finally{u(!1)}},style:{display:"inline-flex",alignItems:"center",gap:7,background:ed.red,color:"#fff",border:"none",borderRadius:9,padding:"10px 15px",fontFamily:td,fontSize:13.5,fontWeight:700,cursor:j?"pointer":"default",opacity:j?1:.5},children:[h?(0,f.jsx)(Kr.A,{size:15,style:{animation:"nm-spin .9s linear infinite"}}):(0,f.jsx)(ls.A,{size:15})," Add event & publish"]}),(0,f.jsx)("button",{type:"button",onClick:()=>l(!1),style:{background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:9,padding:"10px 15px",fontSize:13.5,fontWeight:600,color:ed.textSecondary,cursor:"pointer"},children:"Cancel"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},nm),{},{marginLeft:4}),children:"DATES CAN BE MARKED TBC AND EDITED LATER"})]})]}):(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"17px 20px",display:"flex",gap:14,alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",marginBottom:18}),children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:"Add a show to National Media's calendar"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:4},children:"Entering a show publishes it to their portal and creates its Event Runsheet record automatically."})]}),(0,f.jsxs)("button",{type:"button",onClick:()=>l(!0),style:{display:"inline-flex",alignItems:"center",gap:7,background:ed.red,color:"#fff",border:"none",borderRadius:9,padding:"10px 15px",fontFamily:td,fontSize:13.5,fontWeight:700,cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:15})," New event"]})]}),(0,f.jsx)(gm,{label:"UPCOMING SHOWS \xb7 IS IT BOOKED?",right:(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)(jm,{value:p,onChange:x,options:[{v:"upcoming",l:"UPCOMING"},...y.map(e=>({v:e,l:e})),{v:"all",l:"ALL"}]}),(0,f.jsx)(jm,{value:c,onChange:d,options:[{v:"board",l:"SEASON BOARD"},{v:"list",l:"ACTION LIST"}]})]})}),"list"===c?(0,f.jsx)(Nm,{rows:v,onChanged:s,flash:n,onError:r,onGoTab:i}):(0,f.jsx)(Am,{rows:v,onGoTab:i})]})}const vm=e=>{let{label:t,children:s}=e;return(0,f.jsxs)("label",{style:{display:"block"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},nm),{},{display:"block",marginBottom:6}),children:t}),s]})},jm=e=>{let{value:t,onChange:s,options:a}=e;return(0,f.jsx)("div",{style:{display:"inline-flex",background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:9,overflow:"hidden"},children:a.map(e=>(0,f.jsx)("button",{type:"button",onClick:()=>s(e.v),style:{background:t===e.v?ed.carbon:"transparent",color:t===e.v?"#fff":ed.textSecondary,border:"none",cursor:"pointer",padding:"7px 11px",fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".12em"},children:e.l},e.v))})},wm=e=>{let{row:t,onGoTab:s}=e;const a=(e=>"booked"===e.state?{label:"Open booking",tab:"bookings",tone:"carbon"}:"draft"===e.state?{label:"Chase signature",tab:"quotes",tone:"red"}:{label:"Start quote",tab:"quotes",tone:"red"})(t),n="carbon"===a.tone;return(0,f.jsxs)("button",{type:"button",onClick:()=>null===s||void 0===s?void 0:s(a.tab),style:{display:"inline-flex",alignItems:"center",gap:6,borderRadius:8,padding:"7px 11px",fontFamily:td,fontSize:12.5,fontWeight:700,cursor:"pointer",whiteSpace:"nowrap",background:n?ed.carbon:ed.red,color:"#fff",border:"none"},children:[a.label," ",(0,f.jsx)(S.A,{size:12})]})};function Nm(e){let{rows:t,onChanged:s,flash:n,onError:r,onGoTab:i}=e;const[o,l]=(0,a.useState)(""),c="104px 1.4fr 104px 150px 108px 210px";return(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{className:"nm-a-head",style:{display:"grid",gridTemplateColumns:c,gap:12,padding:"11px 20px",background:ed.adminTableHead,borderBottom:"1px solid ".concat(ed.adminBorder),fontFamily:ad,fontSize:10,fontWeight:700,letterSpacing:".12em",color:ed.textMuted},children:[(0,f.jsx)("span",{children:"DATES"}),(0,f.jsx)("span",{children:"SHOW"}),(0,f.jsx)("span",{children:"BOOKING"}),(0,f.jsx)("span",{children:"READINESS"}),(0,f.jsx)("span",{children:"VALUE"}),(0,f.jsx)("span",{children:"NEXT ACTION"})]}),0===t.length&&(0,f.jsx)("div",{style:{padding:"40px 20px",textAlign:"center",color:ed.textMuted,fontSize:13.5},children:"No shows for this filter."}),t.map(e=>(0,f.jsxs)("div",{className:"nm-arow",style:{display:"grid",gridTemplateColumns:c,gap:12,padding:"14px 20px",borderBottom:"1px solid ".concat(ed.neutralAdminBg),alignItems:"center"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:12,fontWeight:700},children:e.event_date?new Date("".concat(e.event_date,"T00:00:00")).toLocaleDateString("en-AU",{day:"2-digit",month:"short"}):"TBC"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginTop:3}),children:om(e.event_date)})]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsxs)("div",{style:{fontFamily:td,fontSize:14,fontWeight:700},children:[e.name,e.date_tbc&&(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},nm),{},{marginLeft:7}),children:"TBC"})]}),(0,f.jsx)("div",{style:{fontSize:12,color:ed.textSecondary,marginTop:3},children:e.venue||"\u2014"})]}),(0,f.jsx)("div",{children:(0,f.jsx)(um,{tone:lm[e.state]||lm.open})}),(0,f.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",alignItems:"center"},children:[(0,f.jsx)(um,{tone:cm[e.runsheet_state]||cm.not_started}),e.crew_locked&&(0,f.jsx)(um,{tone:{bg:ed.neutralAdminBg,fg:ed.neutralAdminFg},children:"LOCKED"})]}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:13,fontWeight:700},children:null!=e.total?$c(e.total):(0,f.jsx)("span",{style:{color:ed.textFaint},children:"\u2014"})}),(0,f.jsxs)("div",{style:{display:"flex",gap:7,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)(wm,{row:e,onGoTab:i}),(0,f.jsxs)("button",{type:"button",title:e.portal_visible?"Visible in the client portal \u2014 click to hide":"Hidden from the client portal \u2014 click to publish",onClick:()=>(async e=>{l(e.event_id);try{await em("/events/".concat(e.event_id),{method:"PATCH",body:JSON.stringify({nm_portal_visible:!e.portal_visible})}),await s(),n(e.portal_visible?"Show hidden from the client portal.":"Show published to the client portal.")}catch(t){r(t.message)}finally{l("")}})(e),disabled:o===e.event_id,style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:8,padding:"7px 9px",fontSize:12,fontWeight:600,color:e.portal_visible?ed.textSecondary:ed.amber,cursor:"pointer"},children:[o===e.event_id?(0,f.jsx)(Kr.A,{size:13,style:{animation:"nm-spin .9s linear infinite"}}):e.portal_visible?(0,f.jsx)(_.A,{size:13}):(0,f.jsx)(ut.A,{size:13}),e.portal_visible?"Live":"Hidden"]})]})]},e.event_id)),(0,f.jsxs)("div",{style:(0,m.A)({padding:"11px 20px"},nm),children:[t.length," SHOWS"]}
1)]})}function Am(e){let{rows:t,onGoTab:s}=e;const a={booked:"#4ADE80",draft:ed.amber,open:"#C9C9D0"};return(0,f.jsx)("div",{className:"nm-a-3up",style:{display:"grid",gridTemplateColumns:"repeat(3,1fr)",gap:14},children:t.map(e=>(0,f.jsxs)("div",{className:"nm-lift",style:(0,m.A)((0,m.A)({},am),{},{overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{height:4,background:a[e.state]||a.open}}),(0,f.jsxs)("div",{style:{padding:"16px 18px"},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:10,alignItems:"center"},children:[(0,f.jsx)("span",{style:nm,children:e.job_ref||"NO REF"}),(0,f.jsx)(um,{tone:lm[e.state]||lm.open})]}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:16.5,fontWeight:700,marginTop:10},children:e.name}),(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:5},children:Qc(e.event_date,e.date_tbc)}),(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:2},children:e.venue||"\u2014"}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:13},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:14,fontWeight:700},children:null!=e.total?$c(e.total):"\u2014"}),(0,f.jsxs)("span",{style:nm,children:[e.crew_count," CREW"]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:6,marginTop:12,flexWrap:"wrap"},children:[(0,f.jsx)(um,{tone:cm[e.runsheet_state]||cm.not_started}),e.crew_locked&&(0,f.jsx)(um,{tone:{bg:ed.neutralAdminBg,fg:ed.neutralAdminFg},children:"LOCKED"}),!e.portal_visible&&(0,f.jsx)(um,{tone:{bg:ed.warnBg,fg:ed.warnFg},children:"HIDDEN"})]}),(0,f.jsx)("div",{style:{marginTop:14},children:(0,f.jsx)(wm,{row:e,onGoTab:s})})]})]},e.event_id))})}function km(e){let{onError:t}=e;const[s,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(""),[o,l]=(0,a.useState)("all"),[c,d]=(0,a.useState)(null);if((0,a.useEffect)(()=>{(async()=>{try{n((await em("/bookings")).bookings||[])}catch(e){t(e.message),n([])}})()},[t]),!s)return(0,f.jsx)(Mm,{});const p=s.filter(e=>{if("booked"===o&&"confirmed"!==e.status)return!1;if("locked"===o&&!e.crew_locked)return!1;return"".concat(e.job_ref||""," ").concat(e.event_name||""," ").concat(e.contact_name||"").toLowerCase().includes(r.toLowerCase())}),x=s.filter(e=>"confirmed"===e.status),h="104px 1.2fr 1.1fr 1fr 108px 150px";return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"nm-a-4up",style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:14,marginBottom:18},children:[(0,f.jsx)(fm,{label:"CONFIRMED",value:String(x.length),tone:ed.successFg}),(0,f.jsx)(fm,{label:"CREW LOCKED",value:String(s.filter(e=>e.crew_locked).length)}),(0,f.jsx)(fm,{label:"ON RECORD",value:String(s.length)}),(0,f.jsx)(fm,{label:"BOOKED VALUE",value:$c(x.reduce((e,t)=>e+Number(t.total||0),0))})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",gap:10,padding:"14px 18px",borderBottom:"1px solid ".concat(ed.adminBorder),flexWrap:"wrap",alignItems:"center"},children:[(0,f.jsxs)("div",{style:{position:"relative",flex:1,minWidth:200},children:[(0,f.jsx)(ds.A,{size:14,style:{position:"absolute",left:11,top:12,color:ed.textMuted}}),(0,f.jsx)("input",{value:r,onChange:e=>i(e.target.value),placeholder:"Search ref, show or contact",style:(0,m.A)((0,m.A)({},rm),{},{paddingLeft:32})})]}),(0,f.jsx)(jm,{value:o,onChange:l,options:[{v:"all",l:"ALL"},{v:"booked",l:"CONFIRMED"},{v:"locked",l:"LOCKED"}]})]}),(0,f.jsxs)("div",{className:"nm-a-head",style:{display:"grid",gridTemplateColumns:h,gap:12,padding:"11px 18px",background:ed.adminTableHead,borderBottom:"1px solid ".concat(ed.adminBorder),fontFamily:ad,fontSize:10,fontWeight:700,letterSpacing:".12em",color:ed.textMuted},children:[(0,f.jsx)("span",{children:"REF"}),(0,f.jsx)("span",{children:"SHOW"}),(0,f.jsx)("span",{children:"COVERAGE"}),(0,f.jsx)("span",{children:"SIGNED BY"}),(0,f.jsx)("span",{children:"TOTAL"}),(0,f.jsx)("span",{children:"STATUS"})]}),0===p.length&&(0,f.jsx)("div",{style:{padding:"40px 18px",textAlign:"center",color:ed.textMuted,fontSize:13.5},children:"No bookings match."}),p.map(e=>(0,f.jsxs)("div",{className:"nm-arow",role:"button",tabIndex:0,onClick:()=>d(e),onKeyDown:t=>{"Enter"===t.key&&d(e)},style:{display:"grid",gridTemplateColumns:h,gap:12,padding:"14px 18px",borderBottom:"1px solid ".concat(ed.neutralAdminBg),alignItems:"center",cursor:"pointer"},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:12,fontWeight:700},children:e.job_ref||"\u2014"}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:13.5,fontWeight:700},children:e.event_name||"\u2014"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginTop:3}),children:e.event_date?Qc(e.event_date):"DATE TBC"})]}),(0,f.jsx)("span",{style:{fontSize:12.5,color:ed.textSecondary},children:Fm(e.lines)}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600},children:e.signer_name||e.contact_name||"\u2014"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginTop:3}),children:(e.signer_position||"").toUpperCase()})]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:13,fontWeight:700},children:$c(e.total)}),(0,f.jsxs)("div",{style:{display:"flex",gap:5,flexWrap:"wrap",alignItems:"center"},children:[(0,f.jsx)(um,{tone:"confirmed"===e.status?lm.booked:{bg:ed.neutralAdminBg,fg:ed.neutralAdminFg},children:(e.status||"draft").toUpperCase()}),e.crew_locked&&(0,f.jsx)(um,{tone:{bg:ed.neutralAdminBg,fg:ed.neutralAdminFg},children:"LOCKED"}),"confirmed"===e.status&&(0,f.jsx)("span",{onClick:e=>e.stopPropagation(),children:(0,f.jsx)(Em,{kind:"confirmation",eventId:e.event_id,label:"PDF",onError:t})})]})]},e.job_ref||e.event_id)),(0,f.jsxs)("div",{style:(0,m.A)({padding:"11px 18px"},nm),children:["SHOWING ",p.length," OF ",s.length," \xb7 CLICK A ROW FOR FULL DETAIL"]})]}),c&&(0,f.jsx)(Sm,{booking:c,onClose:()=>d(null),onError:t})]})}function Sm(e){let{booking:t,onClose:s,onError:a}=e;const n=t,i=(n.lines||[]).filter(e=>"crew"===e.kind),o=(n.lines||[]).filter(e=>"crew"!==e.kind),l=e=>{let{l:t}=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12,padding:"9px 0",borderBottom:"1px solid ".concat(ed.neutralAdminBg),fontSize:13.5},children:[(0,f.jsxs)("span",{children:[t.count>1?"".concat(t.count," \xd7 "):"",t.label,t.duration_label?(0,f.jsxs)("span",{style:{color:ed.textMuted},children:[" \xb7 ",t.duration_label]}):null,t.count>1&&t.unit_price?(0,f.jsxs)("span",{style:{color:ed.textFaint},children:[" \xb7 ",$c(t.unit_price)," each"]}):null]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontWeight:700},children:$c(t.amount)})]})};return(0,f.jsx)("div",{onClick:s,style:{position:"fixed",inset:0,zIndex:200,background:"rgba(10,10,11,.55)",display:"flex",justifyContent:"flex-end"},children:(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{width:"min(560px,100%)",background:"#fff",height:"100%",overflowY:"auto",boxShadow:"-20px 0 50px rgba(0,0,0,.2)"},children:[(0,f.jsxs)("div",{style:{background:ed.carbon,color:"#fff",padding:"20px 24px"},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12,alignItems:"flex-start"},children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},nm),{},{color:"#8A8A92"}),children:["BOOKING ",n.job_ref||"\u2014"]}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:19,textTransform:"uppercase",marginTop:7}),children:n.event_name}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginTop:5}),children:n.event_date?Qc(n.event_date).toUpperCase():"DATE TBC"})]}),(0,f.jsx)("button",{type:"button",onClick:s,style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer"},children:(0,f.jsx)(g.A,{size:20})})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:7,marginTop:12,flexWrap:"wrap"},children:[(0,f.jsx)(um,{tone:"confirmed"===n.status?lm.booked:{bg:ed.neutralAdminBg,fg:ed.neutralAdminFg},children:(n.status||"draft").toUpperCase()}),n.crew_locked&&(0,f.jsx)(um,{tone:{bg:"#3A1A1D",fg:ed.amber},children:"CREW LOCKED"}),n.confirmed_offline&&(0,f.jsx)(um,{tone:{bg:"#3A1A1D",fg:ed.amber},children:"BOOKED OFFLINE"})]})]}),(0,f.jsxs)("div",{style:{padding:"20px 24px"},children:[(0,f.jsx)(gm,{label:"CREW ON SITE"}),i.length?i.map((e,t)=>(0,f.jsx)(l,{l:e},t)):(0,f.jsx)("div",{style:{fontSize:13,color:ed.textMuted},children:"No crew lines."}),o.length>0&&(0,f.jsxs)("div",{style:{marginTop:20},children:[(0,f.jsx)(gm,{label:"DELIVERABLES & EXTRAS"}),o.map((e,t)=>(0,f.jsx)(l,{l:e},t))]}),(0,f.jsxs)("div",{style:{marginTop:20,background:ed.adminTableHead,borderRadius:10,padding:"14px 16px"},children:[(0,f.jsx)(_m,{label:"Subtotal ex GST",value:$c(n.subtotal)}),(0,f.jsx)(_m,{label:"GST 10%",value:$c(n.gst)}),(0,f.jsx)(_m,{label:"Total inc GST",value:$c(n.total),strong:!0})]}),(0,f.jsxs)("div",{style:{marginTop:20},children:[(0,f.jsx)(gm,{label:"CONFIRMATION"}),(0,f.jsx)(Cm,{k:"Signed by",v:n.signer_name||"\u2014"}),(0,f.jsx)(Cm,{k:"Position",v:n.signer_position||"\u2014"}),(0,f.jsx)(Cm,{k:"Confirmed at",v:n.acknowledged_at?new Date(n.acknowledged_at).toLocaleStr
1ing("en-AU"):"Booked directly \u2014 no timestamp"}),(0,f.jsx)(Cm,{k:"Terms version",v:n.terms_version||"\u2014"}),n.proposal_ref&&(0,f.jsx)(Cm,{k:"Proposal",v:n.proposal_ref}),n.invoice_ref&&(0,f.jsx)(Cm,{k:"Invoice",v:n.invoice_ref}),n.confirmation_note&&(0,f.jsx)("p",{style:{fontSize:12.5,lineHeight:1.6,color:ed.textSecondary,marginTop:10},children:n.confirmation_note})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:9,marginTop:20,flexWrap:"wrap"},children:[(0,f.jsx)(Em,{kind:"confirmation",eventId:n.event_id,label:"Booking PDF",onError:a}),(0,f.jsxs)(r.N_,{to:"/admin/corporate",style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:8,padding:"8px 12px",fontSize:12.5,fontWeight:600,color:ed.textSecondary,textDecoration:"none"},children:["Runsheet ",(0,f.jsx)(S.A,{size:13})]}),(0,f.jsxs)(r.N_,{to:"/admin/invoices",style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:8,padding:"8px 12px",fontSize:12.5,fontWeight:600,color:ed.textSecondary,textDecoration:"none"},children:["Invoices ",(0,f.jsx)(S.A,{size:13})]})]})]})]})})}const _m=e=>{let{label:t,value:s,strong:a}=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12,padding:"5px 0",fontSize:a?14.5:13,fontWeight:a?700:500,color:a?ed.textPrimary:ed.textSecondary},children:[(0,f.jsx)("span",{children:t}),(0,f.jsx)("span",{style:{fontFamily:ad,fontWeight:700},children:s})]})},Cm=e=>{let{k:t,v:s}=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12,padding:"6px 0",fontSize:13},children:[(0,f.jsx)("span",{style:{color:ed.textSecondary},children:t}),(0,f.jsx)("span",{style:{fontWeight:600,textAlign:"right"},children:s})]})},Fm=e=>{const t=(e||[]).filter(e=>"crew"===e.kind);return t.length?t.map(e=>"".concat(e.count>1?"".concat(e.count," \xd7 "):"").concat(e.label)).join(", "):"\u2014"};function Em(e){let{kind:t,eventId:s,label:n,onError:r}=e;const[i,o]=(0,a.useState)(!1);return(0,f.jsxs)("button",{type:"button",onClick:async()=>{o(!0);try{await async function(e,t){const s=await fetch("".concat(I.fn,"/api/nm/admin/documents/").concat(e,"/").concat(t),{headers:{Authorization:"Bearer ".concat(Xd())}});if(!s.ok){let e="That document isn't available yet";try{e=(await s.json()).detail||e}catch(i){}throw new Error(e)}const a=(s.headers.get("content-disposition")||"").match(/filename="?([^";]+)"?/i),n=URL.createObjectURL(await s.blob()),r=document.createElement("a");r.href=n,r.download=a?a[1]:"Turbo 360.pdf",document.body.appendChild(r),r.click(),r.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)}(t,s)}catch(e){r(e.message)}finally{o(!1)}},disabled:i,style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:8,padding:"8px 12px",fontSize:12.5,fontWeight:600,color:ed.textSecondary,cursor:i?"default":"pointer"},children:[i?(0,f.jsx)(Kr.A,{size:13,style:{animation:"nm-spin .9s linear infinite"}}):(0,f.jsx)($d.A,{size:13}),n]})}function Tm(e){var t,s,n,i,o,l;let{onError:c}=e;const[d,p]=(0,a.useState)(null),[x,h]=(0,a.useState)("all"),[u,g]=(0,a.useState)("");if((0,a.useEffect)(()=>{(async()=>{try{p(await em("/quotes"))}catch(e){c(e.message),p({quotes:[],counts:{}})}})()},[c]),!d)return(0,f.jsx)(Mm,{});const b=(d.quotes||[]).filter(e=>"all"===x||("booked"===x?"booked"===e.kind:"draft"===e.kind));return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(gm,{label:"FROM PORTAL \xb7 ".concat(tm.replace("https://","")),right:(0,f.jsx)(jm,{value:x,onChange:h,options:[{v:"all",l:"ALL ".concat(null!==(t=null===(s=d.counts)||void 0===s?void 0:s.all)&&void 0!==t?t:0)},{v:"booked",l:"BOOKED ".concat(null!==(n=null===(i=d.counts)||void 0===i?void 0:i.booked)&&void 0!==n?n:0)},{v:"progress",l:"IN PROGRESS ".concat(null!==(o=null===(l=d.counts)||void 0===l?void 0:l.in_progress)&&void 0!==o?o:0)}]})}),(0,f.jsxs)("div",{style:{display:"grid",gap:10},children:[0===b.length&&(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"40px 18px",textAlign:"center",color:ed.textMuted,fontSize:13.5}),children:"Nothing in flight. Quotes appear here as soon as a contact starts building in the portal."}),b.map(e=>{var t,s,a;const n=u===e.event_id+e.kind;return(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{overflow:"hidden"}),children:[(0,f.jsxs)("button",{type:"button",onClick:()=>g(n?"":e.event_id+e.kind),style:{width:"100%",textAlign:"left",background:"none",border:"none",cursor:"pointer",padding:"15px 18px",display:"flex",gap:14,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)(um,{tone:"booked"===e.kind?lm.booked:lm.draft,children:"booked"===e.kind?"BOOKED":"IN PROGRESS \xb7 STEP ".concat(e.step," OF 4")}),(0,f.jsxs)("div",{style:{flex:1,minWidth:200},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14.5,fontWeight:700},children:e.event_name}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:3},children:[(null===(t=e.contact)||void 0===t?void 0:t.name)||"Unknown contact",null!==(s=e.contact)&&void 0!==s&&s.position?" \xb7 ".concat(e.contact.position):"",null!==(a=e.contact)&&void 0!==a&&a.email?" \xb7 ".concat(e.contact.email):""]})]}),(0,f.jsxs)("div",{style:{textAlign:"right"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:14,fontWeight:700},children:e.priced?$c(e.total):(0,f.jsx)("span",{style:{color:ed.textFaint},children:"NOT PRICED"})}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginTop:3}),children:e.job_ref||Qc(e.event_date,e.date_tbc)})]})]}),n&&(0,f.jsxs)("div",{style:{borderTop:"1px solid ".concat(ed.adminBorder),padding:"14px 18px",background:ed.adminTableHead},children:[0===(e.lines||[]).length?(0,f.jsx)("div",{style:{fontSize:13,color:ed.textMuted},children:"Nothing selected yet \u2014 the client has opened the builder but not chosen crew."}):(e.lines||[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"6px 0",fontSize:13},children:[(0,f.jsxs)("span",{children:[e.count>1?"".concat(e.count," \xd7 "):"",e.label,e.duration_label?" \xb7 ".concat(e.duration_label):""]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontWeight:700},children:$c(e.amount)})]},t)),(0,f.jsxs)("div",{style:{display:"flex",gap:9,marginTop:14,flexWrap:"wrap"},children:[(0,f.jsx)(Em,{kind:"booked"===e.kind?"confirmation":"quote",eventId:e.event_id,label:"booked"===e.kind?"Booking PDF":"Quote PDF",onError:c}),(0,f.jsxs)("a",{href:tm,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:8,padding:"8px 12px",fontSize:12.5,fontWeight:600,color:ed.textSecondary,textDecoration:"none"},children:[(0,f.jsx)(En.A,{size:13})," See it in the portal"]}),(0,f.jsxs)(r.N_,{to:"/admin/invoices",style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:8,padding:"8px 12px",fontSize:12.5,fontWeight:600,color:ed.textSecondary,textDecoration:"none"},children:["Raise invoice ",(0,f.jsx)(S.A,{size:13})]}),(0,f.jsxs)(r.N_,{to:"/admin/corporate",style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:8,padding:"8px 12px",fontSize:12.5,fontWeight:600,color:ed.textSecondary,textDecoration:"none"},children:["Build runsheet ",(0,f.jsx)(S.A,{size:13})]})]})]})]},e.event_id+e.kind)})]})]})}function zm(e){let{events:t}=e;const s=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],n=(0,a.useMemo)(()=>{const e=new Map;return t.forEach(t=>{const s=im(t.event_date)||"TBC";e.has(s)||e.set(s,[]),e.get(s).push(t)}),[...e.entries()].sort((e,t)=>
1{let[s]=e,[a]=t;return s.localeCompare(a)})},[t]),r={booked:"#4ADE80",draft:ed.amber,open:"#C9C9D0"};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(bm,{to:"/admin/calendar",cta:"Full calendar",children:"Read-only view of the season. Scheduling lives in the Calendar."}),n.map(e=>{let[t,a]=e;return(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"18px 20px",marginBottom:14}),children:[(0,f.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"center",marginBottom:14,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({background:ed.carbon,color:"#fff",borderRadius:8,padding:"5px 11px"},nd),{},{fontWeight:800,fontSize:14}),children:t}),(0,f.jsxs)("span",{style:nm,children:[a.length," SHOWS \xb7 ",a.filter(e=>"booked"===e.state).length," BOOKED \xb7 ",a.filter(e=>"booked"!==e.state).length," OPEN"]})]}),(0,f.jsx)("div",{className:"nm-a-head",style:{display:"flex",gap:0,paddingLeft:210,paddingRight:100,marginBottom:8},children:s.map(e=>(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({flex:1},nm),{},{fontSize:9,textAlign:"center"}),children:e},e))}),a.map(e=>{const t=(a=e.event_date)?Number(String(a).slice(5,7)):0;var a;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:0,padding:"5px 0"},children:[(0,f.jsxs)("div",{style:{width:210,flexShrink:0,minWidth:0,paddingRight:12},children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{fontSize:9}),children:e.job_ref||(e.date_tbc?"TBC":"")})]}),(0,f.jsxs)("div",{style:{flex:1,position:"relative",height:26,background:ed.adminTableHead,borderRadius:5},children:[s.map((e,t)=>(0,f.jsx)("span",{style:{position:"absolute",left:"".concat(t/12*100,"%"),top:0,bottom:0,width:1,background:"#EFEFF3"}},t)),t>0&&(0,f.jsx)("span",{style:{position:"absolute",top:5,height:16,left:"".concat((t-1)/12*100,"%"),width:"".concat(1/12*100,"%"),background:r[e.state]||r.open,borderRadius:4}})]}),(0,f.jsx)("div",{style:{width:100,flexShrink:0,textAlign:"right",fontFamily:ad,fontSize:12,fontWeight:700},children:null!=e.total?$c(e.total):"\u2014"})]},e.event_id)})]},t)})]})}function Bm(e){let{events:t}=e;const s="1.4fr 130px 1fr 130px 120px";return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(bm,{to:"/admin/corporate",cta:"All event runsheets",children:"ONE RECORD PER EVENT \xb7 CREATED AUTOMATICALLY WHEN A SHOW IS ENTERED. Editing happens in Event Runsheets."}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{className:"nm-a-head",style:{display:"grid",gridTemplateColumns:s,gap:12,padding:"11px 18px",background:ed.adminTableHead,borderBottom:"1px solid ".concat(ed.adminBorder),fontFamily:ad,fontSize:10,fontWeight:700,letterSpacing:".12em",color:ed.textMuted},children:[(0,f.jsx)("span",{children:"SHOW"}),(0,f.jsx)("span",{children:"DATE"}),(0,f.jsx)("span",{children:"CREW ASSIGNED"}),(0,f.jsx)("span",{children:"STATUS"}),(0,f.jsx)("span",{})]}),t.map(e=>(0,f.jsxs)("div",{className:"nm-arow",style:{display:"grid",gridTemplateColumns:s,gap:12,padding:"14px 18px",borderBottom:"1px solid ".concat(ed.neutralAdminBg),alignItems:"center"},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:13.5,fontWeight:700},children:e.name}),(0,f.jsx)("span",{style:(0,m.A)({},nm),children:e.event_date?Qc(e.event_date,e.date_tbc):"TBC"}),(0,f.jsx)("span",{style:{fontSize:12.5,color:ed.textSecondary},children:e.crew_count>0?"".concat(e.crew_count," assigned"):"Auto-created on event entry \xb7 no crew yet"}),(0,f.jsx)("div",{children:(0,f.jsx)(um,{tone:cm[e.runsheet_state]||cm.not_started})}),(0,f.jsx)(r.N_,{to:"/admin/corporate",style:{fontSize:12.5,fontWeight:700,color:ed.red,textDecoration:"none"},children:"Open \u2192"})]},e.event_id))]})]})}function Dm(e){let{events:t}=e;const s=t.filter(e=>"booked"===e.state);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(bm,{to:"/admin/invoices",cta:"All invoices",children:"Invoices are raised and tracked in Finance \u2192 Invoices. Terms for this account are Net 30, issued 30 days before each show."}),(0,f.jsxs)("div",{className:"nm-a-4up",style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:14,marginBottom:18},children:[(0,f.jsx)(fm,{label:"BOOKED VALUE",value:$c(s.reduce((e,t)=>
1e+Number(t.total||0),0))}),(0,f.jsx)(fm,{label:"BOOKED SHOWS",value:String(s.length)}),(0,f.jsx)(fm,{label:"TERMS",value:"NET 30"}),(0,f.jsx)(fm,{label:"BILLING",value:"30D PRIOR"})]}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"18px 20px",fontSize:13.5,color:ed.textSecondary}),children:"Per-invoice status isn't mirrored here \u2014 Finance \u2192 Invoices is the source of truth, and duplicating it would create two places to read a payment state from."})]})}function Im(e){let{events:t,onChanged:s,flash:n,onError:r}=e;const[i,o]=(0,a.useState)(""),[l,c]=(0,a.useState)(null),[d,p]=(0,a.useState)(null),x=t.filter(e=>"booked"===e.state);(0,a.useEffect)(()=>{(async()=>{try{const[e,t]=await Promise.all([em("/crew"),em("/bookings")]);c(e.crew||[]),p(Object.fromEntries((t.bookings||[]).map(e=>[e.event_id,e])))}catch(e){r(e.message),c([]),p({})}})()},[r]);return l&&d?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(bm,{to:"/admin/crew",cta:"Full crew admin",children:"Assign people to each booked position. Locking is what closes the client's edit window \u2014 a deliberate action, not a side effect of assigning someone."}),(0,f.jsxs)("div",{className:"nm-a-2up",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14,alignItems:"start"},children:[0===x.length&&(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"30px 18px",color:ed.textMuted,fontSize:13.5}),children:"No booked shows yet."}),x.map(e=>(0,f.jsx)(Rm,{event:e,booking:d[e.event_id],roster:l,busy:i===e.event_id,onLock:()=>(async e=>{o(e.event_id);try{await em("/events/".concat(e.event_id,"/").concat(e.crew_locked?"unlock-crew":"lock-crew"),{method:"POST"}),await s(),n(e.crew_locked?"Crew unlocked \u2014 the client can change this package again.":"Crew locked \u2014 the client can no longer change this package.")}catch(t){r(t.message)}finally{o("")}})(e),onChanged:s,flash:n,onError:r},e.event_id))]})]}):(0,f.jsx)(Mm,{})}function Rm(e){let{event:t,booking:s,roster:n,busy:r,onLock:i,onChanged:o,flash:l,onError:c}=e;const d=(0,a.useMemo)(()=>{const e=[];return((null===s||void 0===s?void 0:s.lines)||[]).filter(e=>"crew"===e.kind).forEach(t=>{for(let s=0;s<(t.count||1);s+=1)e.push({role:t.label,key:"".concat(t.id,"-").concat(s)})}),e},[s]),p=(t.crew_members||[]).filter(e=>"James Anderson"!==e.name),[x,h]=(0,a.useState)(()=>d.map((e,t)=>{var s,a;return(0,m.A)((0,m.A)({},e),{},{id:(null===(s=p[t])||void 0===s?void 0:s.id)||"",role:(null===(a=p[t])||void 0===a?void 0:a.role)||e.role})})),[u,g]=(0,a.useState)(!1),b=x.filter(e=>e.id).length;return(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"16px 18px"}),children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:14.5,fontWeight:700},children:t.name}),(0,f.jsx)(um,{tone:d.length&&b>=d.length?lm.booked:{bg:ed.warnBg,fg:ed.warnFg},children:d.length?"".concat(b,"/").concat(d.length," FILLED"):"NO BOOKED POSITIONS"})]}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginTop:6}),children:t.event_date?Qc(t.event_date,t.date_tbc).toUpperCase():"DATE TBC"}),(0,f.jsxs)("div",{style:{marginTop:12,paddingTop:10,borderTop:"1px solid ".concat(ed.neutralAdminBg)},children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:700},children:"James Anderson"}),(0,f.jsx)("div",{style:nm,children:"DIRECTOR \xb7 ON EVERY NATIONAL MEDIA SHOW"})]}),0===d.length&&(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textMuted,marginTop:12},children:"This booking has no crew lines, so there are no positions to fill."}),x.map((e,s)=>(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 132px",gap:8,marginTop:10},children:[(0,f.jsxs)("select",{value:e.id,disabled:t.crew_locked,onChange:e=>h(x.map((t,a)=>a===s?(0,m.A)((0,m.A)({},t),{},{id:e.target.value}):t)),style:(0,m.A)((0,m.A)({},rm),{},{fontSize:13,padding:"9px 10px"}),children:[(0,f.jsx)("option",{value:"",children:"\u2014 unassigned \u2014"}),n.map(e=>(0,f.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,f.jsx)("input",{value:e.role,disabled:t.crew_locked,onChange:e=>h(x.map((t,a)=>a===s?(0,m.A)((0,m.A)({},t),{},{role:e.target.value}):t)),style:(0,m.A)((0,m.A)({},rm),{},{fontSize:12.5,padding:"9px 10px"}),placeholder:"Role"})]},e.key)),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:14,flexWrap:"wrap"},children:[d.length>0&&(0,f.jsxs)("button",{type:"button",onClick:async()=>{g(!0);try{const e=(t.crew_members||[]).find(e=>"James Anderson"===e.name),s=[...e?[{id:e.id,role:e.role||"director"}]:[],...x.filter(e=>e.id).map(e=>({id:e.id,role:e.role}))];await em("/events/".concat(t.event_id,"/crew"),{method:"PUT",body:JSON.stringify({crew:s})}),await o(),l("Crew saved for ".concat(t.name,"."))}catch(e){c(e.message)}finally{g(!1)}},disabled:u||t.crew_locked,style:{display:"inline-flex",alignItems:"center",gap:7,background:ed.red,color:"#fff",border:"none",borderRadius:9,padding:"9px 14px",fontFamily:td,fontSize:13,fontWeight:700,cursor:t.crew_locked?"default":"pointer",opacity:t.crew_locked?.5:1},children:[u?(0,f.jsx)(Kr.A,{size:14,style:{animation:"nm-spin .9s linear infinite"}}):(0,f.jsx)(ia.A,{size:14}),"Save crew"]}),(0,f.jsxs)("button",{type:"button",onClick:i,disabled:r,style:{display:"inline-flex",alignItems:"center",gap:7,background:t.crew_locked?"#fff":ed.carbon,color:t.crew_locked?ed.textSecondary:"#fff",border:"1px solid ".concat(t.crew_locked?ed.adminBorder:ed.carbon),borderRadius:9,padding:"9px 14px",fontSize:13,fontWeight:700,cursor:"pointer"},children:[r?(0,f.jsx)(Kr.A,{size:14,style:{animation:"nm-spin .9s linear infinite"}}):t.crew_locked?(0,f.jsx)(Qd.A,{size:14}):(0,f.jsx)(ht.A,{size:14}),t.crew_locked?"Unlock package":"Lock crew & package"]})]}),t.crew_locked&&(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginTop:9}),children:"UNLOCK TO CHANGE CREW"})]})}function Pm(e){let{events:t,onChanged:s,flash:n,onError:r}=e;const[i,o]=(0,a.useState)(null),l=t.filter(e=>"booked"===e.state);if((0,a.useEffect)(()=>{(async()=>{try{o(await em("/delivery-sources"))}catch(e){r(e.message),o({galleries:[],projects:[],errors:{}})}})()},[r]),!i)return(0,f.jsx)(Mm,{});const c=i.errors||{};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(bm,{to:"/admin/content-delivery",cta:"Content Delivery",children:"Connect the Turbo IQ gallery and the Turbo Reviews project for each show, so the client's job view links straight to their content."}),(c.turbo_iq||c.turbo_reviews)&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{borderColor:"#FCD34D",background:ed.warnBg,color:ed.warnFg,padding:"12px 16px",marginBottom:14,fontSize:13}),children:[c.turbo_iq&&(0,f.jsx)("div",{children:"Turbo IQ didn't respond \u2014 galleries unavailable right now."}),c.turbo_reviews&&(0,f.jsx)("div",{children:"Turbo Reviews didn't respond \u2014 projects unavailable right now."})]}),(0,f.jsxs)("div",{className:"nm-a-2up",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14,alignItems:"start"},children:[0===l.length&&(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"30px 18px",color:ed.textMuted,fontSize:13.5}),children:"No booked shows yet."}),l.map(e=>(0,f.jsx)(Wm,{event:e,sources:i,onChanged:s,flash:n,onError:r},e.event_id))]})]})}function Wm(e){let{event:t,sources:s,onChanged:n,flash:r,onError:i}=e;const o=t.delivery||{},[l,c]=(0,a.useState)(o.gallery_id||""),[d,p]=(0,a.useState)(o.reviews_project_id||""),[x,h]=(0,a.useState)(!1);return(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"16px 18px"}),children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:14.5,fontWeight:700},children:t.name}),(0,f.jsx)(um,{tone:o.gallery_url||o.reviews_project_url?lm.booked:{bg:ed.neutralAdminBg,fg:ed.neutralAdminFg},children:o.gallery_url||o.reviews_project_url?"CONNECTED":"NOT CONNECTED"})]}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginTop:6}),children:t.event_date?Qc(t.event_date,t.date_tbc).toUpperCase():"DATE TBC"}),(0,f.jsx)(vm,{label:"TURBO IQ GALLERY",children:(0,f.jsxs)("select",{value:l,onCh
1ange:e=>c(e.target.value),style:(0,m.A)((0,m.A)({},rm),{},{fontSize:13}),children:[(0,f.jsx)("option",{value:"",children:"\u2014 not connected \u2014"}),(s.galleries||[]).map(e=>(0,f.jsxs)("option",{value:e.id,children:[e.name,e.count?" (".concat(e.count," images)"):""]},e.id))]})}),(0,f.jsx)("div",{style:{marginTop:10},children:(0,f.jsx)(vm,{label:"TURBO REVIEWS PROJECT",children:(0,f.jsxs)("select",{value:d,onChange:e=>p(e.target.value),style:(0,m.A)((0,m.A)({},rm),{},{fontSize:13}),children:[(0,f.jsx)("option",{value:"",children:"\u2014 not connected \u2014"}),(s.projects||[]).map(e=>(0,f.jsxs)("option",{value:e.id,children:[e.name,e.assets?" (".concat(e.assets," assets)"):""]},e.id))]})})}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:13,flexWrap:"wrap",alignItems:"center"},children:[(0,f.jsxs)("button",{type:"button",onClick:async()=>{h(!0);try{const e=(s.galleries||[]).find(e=>String(e.id)===String(l)),a=(s.projects||[]).find(e=>String(e.id)===String(d));await em("/events/".concat(t.event_id,"/delivery"),{method:"PUT",body:JSON.stringify({gallery_id:(null===e||void 0===e?void 0:e.id)||"",gallery_name:(null===e||void 0===e?void 0:e.name)||"",gallery_url:(null===e||void 0===e?void 0:e.url)||"",reviews_project_id:(null===a||void 0===a?void 0:a.id)||"",reviews_project_name:(null===a||void 0===a?void 0:a.name)||"",reviews_project_url:(null===a||void 0===a?void 0:a.url)||""})}),await n(),r("Delivery links saved for ".concat(t.name,"."))}catch(e){i(e.message)}finally{h(!1)}},disabled:x,style:{display:"inline-flex",alignItems:"center",gap:7,background:ed.red,color:"#fff",border:"none",borderRadius:9,padding:"9px 14px",fontFamily:td,fontSize:13,fontWeight:700,cursor:"pointer"},children:[x?(0,f.jsx)(Kr.A,{size:14,style:{animation:"nm-spin .9s linear infinite"}}):(0,f.jsx)(ia.A,{size:14}),"Save links"]}),o.gallery_url&&(0,f.jsxs)("a",{href:o.gallery_url,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12.5,fontWeight:700,color:ed.red,textDecoration:"none"},children:[(0,f.jsx)(En.A,{size:13})," Gallery"]}),o.reviews_project_url&&(0,f.jsxs)("a",{href:o.reviews_project_url,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12.5,fontWeight:700,color:ed.red,textDecoration:"none"},children:[(0,f.jsx)(En.A,{size:13})," Videos"]})]})]})}function Om(e){var t,s;let{flash:n,onError:r}=e;const[i,o]=(0,a.useState)(null),[l,c]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{(async()=>{try{o((await em("/catalogue")).catalogue)}catch(e){r(e.message)}})()},[r]),!i)return(0,f.jsx)(Mm,{});const d=(e,t)=>o((0,m.A)((0,m.A)({},i),{},{roles:i.roles.map((s,a)=>a===e?(0,m.A)((0,m.A)({},s),t):s)})),p=(e,t)=>o((0,m.A)((0,m.A)({},i),{},{items:i.items.map((s,a)=>a===e?(0,m.A)((0,m.A)({},s),t):s)})),x=e=>o((0,m.A)((0,m.A)({},i),{},{items:[...i.items||[],{id:"".concat(e,"-").concat(Date.now()),label:"New ".concat(e),unit:"",price:0,quantity_based:!1,description:"",scope:e,sort_order:(i.items||[]).length}]})),h=[["halfDay","HALF DAY"],["days1","1 DAY"],["days2","2 DAYS"],["days3","3 DAYS"]];return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(gm,{label:"ACCOUNT CATALOGUE \xb7 EVERYTHING THE CLIENT CAN CHOOSE IN THEIR PORTAL",right:(0,f.jsxs)("button",{type:"button",onClick:async()=>{c(!0);try{await em("/catalogue",{method:"PUT",body:JSON.stringify({roles:i.roles,items:i.items,terms:i.terms})}),n("Catalogue saved \u2014 the portal is showing these prices now.")}catch(e){r(e.message)}finally{c(!1)}},disabled:l,style:{display:"inline-flex",alignItems:"center",gap:7,background:ed.red,color:"#fff",border:"none",borderRadius:9,padding:"9px 14px",fontFamily:td,fontSize:13,fontWeight:700,cursor:"pointer"},children:[l?(0,f.jsx)(Kr.A,{size:14,style:{animation:"nm-spin .9s linear infinite"}}):(0,f.jsx)(ia.A,{size:14})," Save & publish"]})}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginBottom:14,color:ed.amber}),children:"SAVED CHANGES PUBLISH TO THE PORTAL INSTANTLY"}),(0,f.jsxs)("div",{className:"nm-a-2up",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14,alignItems:"start"},children:[(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"18px 20px"}),children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,marginBottom:14},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:"Crew roles & rates"}),(0,f.jsxs)("button",{type:"button",onClick:()=>o((0,m.A)((0,m.A)({},i),{},{roles:[...i.roles||[],{id:"role-".concat(Date.now()),label:"New role",blurb:"",inclusions:"",rates:{},sort_order:(i.roles||[]).length}]})),style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px dashed ".concat(ed.adminBorder),borderRadius:8,padding:"7px 11px",fontSize:12.5,fontWeight:700,color:ed.red,cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:13})," Add role"]})]}),(i.roles||[]).map((e,t)=>(0,f.jsxs)("div",{style:{borderTop:"1px solid ".concat(ed.neutralAdminBg),padding:"13px 0"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,f.jsx)("input",{value:e.label||"",onChange:e=>d(t,{label:e.target.value}),style:(0,m.A)((0,m.A)({},rm),{},{fontWeight:700,flex:1}),placeholder:"Role name"}),(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{const t=i.roles[e];window.confirm('Remove "'.concat(t.label,'" from the catalogue?\n\nClients will no longer be able to book it. Existing bookings keep their priced lines.'))&&o((0,m.A)((0,m.A)({},i),{},{roles:i.roles.filter((t,s)=>s!==e)}))})(t),title:"Remove role",style:{background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:8,padding:"9px 10px",color:ed.dangerFg,cursor:"pointer",display:"inline-flex"},children:(0,f.jsx)(la.A,{size:14})})]}),(0,f.jsx)("input",{value:e.blurb||"",onChange:e=>d(t,{blurb:e.target.value}),placeholder:"One-line blurb shown under the name in the builder",style:(0,m.A)((0,m.A)({},rm),{},{marginTop:7,fontSize:12.5})}),(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:8,marginTop:8},children:h.map(s=>{var a,n;let[r,o]=s;return(0,f.jsxs)("label",{style:{display:"block"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},nm),{},{display:"block",marginBottom:4}),children:o}),(0,f.jsx)("input",{type:"number",value:null!==(a=null===(n=e.rates)||void 0===n?void 0:n[r])&&void 0!==a?a:"",placeholder:"\u2014",onChange:e=>((e,t,s)=>d(e,{rates:(0,m.A)((0,m.A)({},i.roles[e].rates||{}),{},{[t]:""===s?void 0:Number(s)})}))(t,r,e.target.value),style:(0,m.A)((0,m.A)({},rm),{},{padding:"7px 9px",fontFamily:ad,fontSize:12,textAlign:"right"})})]},r)})}),(0,f.jsxs)("label",{style:{display:"block",marginTop:8},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},nm),{},{display:"block",marginBottom:4}),children:"GENERAL INCLUSIONS \u2014 ONE PER LINE, SHOWN IN BUILDER STEP 2 AN
1D ON THE QUOTE"}),(0,f.jsx)("textarea",{rows:5,value:e.inclusions||"",onChange:e=>d(t,{inclusions:e.target.value}),placeholder:"Standard Inclusions:\n- One professional photographer on-site.\n- Same-day progressive delivery of edited images.",style:(0,m.A)((0,m.A)({},rm),{},{fontFamily:sd,fontSize:12.5,lineHeight:1.6,resize:"vertical"})})]})]},e.id)),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginTop:12}),children:"BLANK RATE = NOT OFFERED FOR THAT DURATION"})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"18px 20px"}),children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,marginBottom:14},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:"Deliverables & extras"}),(0,f.jsxs)("span",{style:{display:"inline-flex",gap:7},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>x("deliverable"),style:{display:"inline-flex",alignItems:"center",gap:5,background:"#fff",border:"1px dashed ".concat(ed.adminBorder),borderRadius:8,padding:"7px 10px",fontSize:12,fontWeight:700,color:ed.textSecondary,cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:12})," Deliverable"]}),(0,f.jsxs)("button",{type:"button",onClick:()=>x("extra"),style:{display:"inline-flex",alignItems:"center",gap:5,background:"#fff",border:"1px dashed ".concat(ed.adminBorder),borderRadius:8,padding:"7px 10px",fontSize:12,fontWeight:700,color:ed.red,cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:12})," Extra"]})]})]}),(i.items||[]).map((e,t)=>{var s;return(0,f.jsxs)("div",{style:{borderTop:"1px solid ".concat(ed.neutralAdminBg),padding:"11px 0"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,f.jsx)("input",{value:e.label||"",onChange:e=>p(t,{label:e.target.value}),style:(0,m.A)((0,m.A)({},rm),{},{fontWeight:600,flex:1}),placeholder:"Item name"}),(0,f.jsx)("input",{type:"number",value:null!==(s=e.price)&&void 0!==s?s:"",onChange:e=>p(t,{price:Number(e.target.value)}),style:(0,m.A)((0,m.A)({},rm),{},{width:96,padding:"9px",fontFamily:ad,fontSize:12,textAlign:"right"})}),(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{const t=i.items[e];window.confirm('Remove "'.concat(t.label,'" from the catalogue?\n\nClients will no longer be able to book it. Existing bookings keep their priced lines.'))&&o((0,m.A)((0,m.A)({},i),{},{items:i.items.filter((t,s)=>s!==e)}))})(t),title:"Remove item",style:{background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:8,padding:"9px 10px",color:ed.dangerFg,cursor:"pointer",display:"inline-flex"},children:(0,f.jsx)(la.A,{size:14})})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:7,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)("input",{value:e.unit||"",onChange:e=>p(t,{unit:e.target.value}),placeholder:"Unit e.g. Per Video",style:(0,m.A)((0,m.A)({},rm),{},{flex:1,minWidth:130,fontSize:12.5,padding:"8px 10px"})}),(0,f.jsxs)("select",{value:e.scope||"deliverable",onChange:e=>p(t,{scope:e.target.value}),style:(0,m.A)((0,m.A)({},rm),{},{width:132,fontSize:12.5,padding:"8px 10px"}),children:[(0,f.jsx)("option",{value:"deliverable",children:"Deliverable"}),(0,f.jsx)("option",{value:"extra",children:"Extra"})]}),(0,f.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:12.5,color:ed.textSecondary,cursor:"pointer",whiteSpace:"nowrap"},children:[(0,f.jsx)("input",{type:"checkbox",checked:!!e.quantity_based,onChange:e=>p(t,{quantity_based:e.target.checked})}),"Quantity"]})]}),(0,f.jsx)("input",{value:e.description||"",onChange:e=>p(t,{description:e.target.value}),placeholder:"Description shown to the client (optional)",style:(0,m.A)((0,m.A)({},rm),{},{marginTop:7,fontSize:12.5,padding:"8px 10px"})})]},e.id)}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nm),{},{marginTop:12}),children:"QUANTITY ITEMS GET A \u2212/+ STEPPER \xb7 OTHERS GET YES/NO"})]})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"18px 20px",marginTop:14}),children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:"Proposal notes & terms"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary,margin:"6px 0 14px"},children:"Shown in the portal's acknowledgement modal and on the booking documents. Editing here is the point \u2014 these used to be hardcoded and needed a deploy to change."}),(0,f.jsx)(vm,{label:"IMPORTANT PROPOSAL NOTES (ONE PER LINE)",children:(0,f.jsx)("textarea",{rows:7,value:((null===(t=i.terms)||void 0===t?void 0:t.proposal_notes)||[]).join("\n"),onChange:e=>o((0,m.A)((0,m.A)({},i),{},{terms:(0,m.A)((0,m.A)({},i.terms||{}),{},{proposal_notes:e.target.value.split("\n")})})),style:(0,m.A)((0,m.A)({},rm),{},{fontFamily:sd,lineHeight:1.6,resize:"vertical"})})}),(0,f.jsx)("div",{style:{marginTop:14},children:((null===(s=i.terms)||void 0===s?void 0:s.sections)||[]).map((e,t)=>(0,f.jsxs)("div",{style:{borderTop:"1px solid ".concat(ed.neutralAdminBg),padding:"12px 0"},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[(0,f.jsx)("input",{value:e.title||"",placeholder:"Section title",style:rm,onChange:e=>o((0,m.A)((0,m.A)({},i),{},{terms:(0,m.A)((0,m.A)({},i.terms),{},{sections:i.terms.sections.map((s,a)=>a===t?(0,m.A)((0,m.A)({},s),{},{title:e.target.value}):s)})}))}),(0,f.jsx)("input",{value:e.highlight||"",placeholder:"Green highlight (optional)",style:rm,onChange:e=>o((0,m.A)((0,m.A)({},i),{},{terms:(0,m.A)((0,m.A)({},i.terms),{},{sections:i.terms.sections.map((s,a)=>a===t?(0,m.A)((0,m.A)({},s),{},{highlight:e.target.value}):s)})}))})]}),(0,f.jsx)("textarea",{rows:3,value:e.body||"",style:(0,m.A)((0,m.A)({},rm),{},{marginTop:8,fontFamily:sd,lineHeight:1.6,resize:"vertical"}),onChange:e=>o((0,m.A)((0,m.A)({},i),{},{terms:(0,m.A)((0,m.A)({},i.terms),{},{sections:i.terms.sections.map((s,a)=>a===t?(0,m.A)((0,m.A)({},s),{},{body:e.target.value}):s)})}))})]},t))})]})]})}function Lm(e){let{onError:t}=e;const[s,n]=(0,a.useState)(null);if((0,a.useEffect)(()=>{(async()=>{try{n(await em("/contacts"))}catch(e){t(e.message)}})()},[t]),!s)return(0,f.jsx)(Mm,{});const r=(s.contacts||[]).filter(e=>!e.is_company);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(bm,{to:"/admin/clients",cta:"Edit in Clients",children:[(0,f.jsx)("strong",{children:"This list is the portal allow-list."})," Anyone here can request a sign-in link; anyone not here cannot, and removing someone in Clients ends their live session on their next request."]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},am),{},{overflow:"hidden"}),children:[0===r.length&&(0,f.jsx)("div",{style:{padding:"40px 18px",textAlign:"center",color:ed.textMuted,fontSize:13.5},children:"No contacts linked to this company."}),r.map(e=>(0,f.jsxs)("div",{className:"nm-arow",style:{display:"flex",gap:14,padding:"14px 18px",borderBottom:"1px solid ".concat(ed.neutralAdminBg),alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)("div",{style:{width:36,height:36,borderRadius:10,background:ed.red,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:ad,fontSize:12,fontWeight:700,flexShrink:0}
1,children:(e.name||"?").split(/\s+/).filter(Boolean).map(e=>e[0]).slice(0,2).join("").toUpperCase()}),(0,f.jsxs)("div",{style:{flex:1,minWidth:180},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14,fontWeight:700},children:e.name||"\u2014"}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:3},children:[e.position||"No position recorded",e.email?" \xb7 ".concat(e.email):""]})]}),(0,f.jsxs)("div",{style:{textAlign:"right"},children:[(0,f.jsx)("div",{style:nm,children:"LAST SIGN-IN"}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:12,fontWeight:700,marginTop:3},children:e.last_sign_in?new Date(e.last_sign_in).toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric"}):"NEVER"})]})]},e.id)),(0,f.jsxs)("div",{style:(0,m.A)({padding:"11px 18px"},nm),children:[r.length," CONTACTS WITH PORTAL ACCESS"]})]})]})}const Mm=()=>(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},am),{},{padding:"60px 0",textAlign:"center",color:ed.textMuted}),children:(0,f.jsx)(Kr.A,{size:22,style:{animation:"nm-spin .9s linear infinite"}})}),qm={terrapinn:{key:"terrapinn",name:"Terrapinn",initials:"TP",logo:"/ka/terrapinn.jpg",loginBg:"/ka/terrapinn-login-bg.jpg",portalHost:"terrapinn.turbo.net.au",accent:"#E5673F",recordName:"Terrapinn",serviceTag:"PHOTO + VIDEO \xb7 STANDARD PACKAGE",routes:{portal:"/terrapinn",login:"/terrapinn/login",admin:"/admin/terrapinn"},nouns:{item:"event",items:"events",Item:"Event",Items:"Events"},mode:"fixed",portal:{kicker:"YOUR EVENT CALENDAR \xb7 MAINTAINED BY TURBO",headline:"Photo + video production",intro:"Every Terrapinn event is here with your Standard Package already applied and priced. Confirm it as is, or add extras \u2014 your draft saves as you go.",emailPlaceholder:"[email protected]"},login:{kicker:"TERRAPINN \xb7 BOOKING PORTAL",headline:["Every angle.","Full speed."],stats:[["EVENTS AHEAD","7"],["NEXT EVENT","MAR 2027"],["STANDARD PACKAGE","PHOTO + VIDEO"]]},admin:{label:"Terrapinn",blurb:"Conference and exhibition organiser. Every Terrapinn event runs the same Standard Package \u2014 photo + video, same deliverables, same price \u2014 so their portal is a one-click confirm per event, with optional extras. Entering an event here publishes it to their portal and creates its Event Runsheet record.",eventPlaceholder:"e.g. EduTECH 2028",defaultDays:1,packageKicker:"STANDARD PACKAGE \xb7 APPLIES TO EVERY EVENT",packageNote:"PRICE CHANGES APPLY TO FUTURE EVENTS ONLY",howSteps:["We add the event \u2014 it lands in their portal with the Standard Package pre-applied and priced.","A Terrapinn contact confirms with one click, and can add extras.","Assigning crew locks the package. Runsheet, crew, galleries and invoice all appear on the same job."]}},wmedia:{key:"wmedia",name:"W.Media",initials:"WM",logo:"/ka/wmedia.png",loginBg:"/ka/wmedia-login-bg.jpg",portalHost:"wmedia.turbo.net.au",accent:"#3B5BFF",recordName:"WMedia",serviceTag:"PHOTOGRAPHY",routes:{portal:"/wmedia",login:"/wmedia/login",admin:"/admin/wmedia"},nouns:{item:"event",items:"events",Item:"Event",Items:"Events"},mode:"build",portal:{kicker:"YOUR EVENT CALENDAR \xb7 MAINTAINED BY TURBO",headline:"Event imagery services",intro:"Every W.Media event is here. Choose how many photographers and how long, add what you\u2019d like back, and book when you\u2019re ready. Galleries are always included.",emailPlaceholder:"[email protected]"},login:{kicker:"W.MEDIA \xb7 BOOKING PORTAL",headline:["Every angle.","Full speed."],stats:[["EVENTS AHEAD","3"],["NEXT EVENT","NOV 2026"],["DIRECTOR ON SITE","EVERY EVENT"]]},admin:{label:"W.Media",blurb:"Data-centre and cloud conferences across Asia-Pacific. Photography only \u2014 W.Media book photographers and days per event in their portal; galleries are always included. Entering an event here publishes it to their portal and creates its Event Runsheet record.",eventPlaceholder:"e.g. Cloud & Datacentre Convention Perth",defaultDays:1,packageKicker:"PHOTOGRAPHY RATES \xb7 THEIR PORTAL PRICES FROM THESE",packageNote:"RATE CHANGES APPLY TO NEW QUOTES ONLY",howSteps:["We add the event \u2014 it lands in their portal, unpriced, with the rate c
1ard behind it.","A W.Media contact picks photographers, days and extras, sees the price live, and books when ready.","Assigning crew locks the package. Gallery lands on the same job when delivered."]}}},Hm={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL||"";function Um(e){const t=qm[e];if(!t)throw new Error("Unknown key account: ".concat(e));const s="ka-".concat(e,"-portal-token"),a="/api/ka/".concat(e),n=t.routes.login,r=()=>{try{return window.localStorage.getItem(s)}catch(e){return null}},i=()=>{try{window.localStorage.removeItem(s)}catch(e){}};return{account:t,getToken:r,setToken:e=>{try{window.localStorage.setItem(s,e)}catch(t){}},clearToken:i,request:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=r(),o=await fetch("".concat(a).concat(e),(0,m.A)((0,m.A)({},t),{},{headers:(0,m.A)((0,m.A)({"Content-Type":"application/json"},s?{Authorization:"Bearer ".concat(s)}:{}),t.headers||{})}));if(401===o.status)throw i(),window.location.pathname.startsWith(n)||(window.location.href="".concat(n,"?expired=1")),new Error("Sign-in required");if(!o.ok){let e="Something went wrong";try{e=(await o.json()).detail||e}catch(l){}const t=new Error(e);throw t.status=o.status,t}return o.json()},downloadPdf:async function(e){const t=r(),s=await fetch("".concat(a).concat(e),{headers:t?{Authorization:"Bearer ".concat(t)}:{}});if(401===s.status)throw i(),window.location.href="".concat(n,"?expired=1"),new Error("Sign-in required");if(!s.ok){let e="That document isn't available yet";try{e=(await s.json()).detail||e}catch(m){}throw new Error(e)}const o=(s.headers.get("content-disposition")||"").match(/filename="?([^";]+)"?/i),l=await s.blob(),c=URL.createObjectURL(l),d=document.createElement("a");d.href=c,d.download=o?o[1]:"Turbo 360.pdf",document.body.appendChild(d),d.click(),d.remove(),window.setTimeout(()=>URL.revokeObjectURL(c),1e3)},API_BASE:a,LOGIN_ROUTE:n}}const Gm=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(e||0)),Vm=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return t?"Date TBC":"TBC";const s=new Date(e);if(Number.isNaN(s.getTime()))return String(e);const a=s.toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short",year:"numeric"});return t?"".concat(a," (TBC)"):a},Jm=e=>{if(!e)return{month:"TBC",day:"--"};const t=new Date(e);return Number.isNaN(t.getTime())?{month:"TBC",day:"--"}:{month:t.toLocaleDateString("en-AU",{month:"short"}).toUpperCase(),day:String(t.getDate())}};function Ym(e){let{accountKey:t}=e;const s=Um(t),{account:n}=s,i=(0,r.Zp)(),[o]=(0,r.ok)(),l=o.get("token"),[c,p]=(0,a.useState)(l?"verifying":"form"),[x,h]=(0,a.useState)(o.get("email")||""),[u,g]=(0,a.useState)(""),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(o.get("expired")?"Your session ended. Sign in again to pick up where you left off.":""),[A,k]=(0,a.useState)(!1),_=(0,a.useRef)(!1);(0,a.useEffect)(()=>{l&&!_.current&&(_.current=!0,(async()=>{try{const e=await fetch("".concat(s.API_BASE,"/auth/verify?token=").concat(encodeURIComponent(l))),t=await e.json();if(!e.ok)throw new Error(t.detail||"That link isn't valid.");s.setToken(t.token),y(t.contact),p("signedin")}catch(e){s.clearToken(),N(e.message),p("form")}})())},[l]);const C=(0,a.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const a=(e||"").trim();if(a){j(!0),N("");try{const e=await fetch("".concat(s.API_BASE,"/auth/request-link"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a})}),n=await e.json();g(a),p("sent"),t&&(k(!0),setTimeout(()=>k(!1),2600)),!e.ok&&null!==n&&void 0!==n&&n.detail&&N(n.detail)}catch(n){N("We couldn't send that just now. Try again in a moment.")}finally{j(!1)}}},[s.API_BASE]),F={width:"100%",maxWidth:360},E={width:"100%",boxSizing:"border-box",background:"#141417",border:"1px solid ".concat(ed.carbonBorder),borderRadius:10,padding:14,fontFamily:sd,fontSize:15,color:"#fff",outline:"none"};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsxs)("title",{children:[n.name," Booking Portal | Turbo 360"]}),(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,f.jsxs)("div",{className:"ka-login-grid",style:{minHeight:"100vh",display:"grid",gridTemplateColumns:"1fr 460px",background:"#0F0F11",color:"#fff",fontFamily:sd},children:[(0,f.jsx)("style",{children:"\n .ka-login-left { position: relative; overflow: hidden; }\n @media (max-width: 820px) {\n .ka-login-grid { grid-template-columns: 1fr !important; }\n .ka-login-left { display: none !important; }\n }\n .ka-primary:hover:not(:disabled) { background: ".concat(ed.redHover," !important; }\n .ka-ghost:hover { color: #fff !important; }\n .ka-input:focus { border-color: ").concat(ed.red," !important; }\n @keyframes ka-bar { 0%,100% { opacity: .25; transform: scaleY(.6); } 50% { opacity: 1; transform: scaleY(1); } }\n @keyframes ka-spin { to { transform: rotate(360deg); } }\n ")}),(0,f.jsxs)("div",{className:"ka-login-left",style:{display:"flex",flexDirection:"column",justifyContent:"space-between",padding:"clamp(32px,5vw,56px)"},children:[(0,f.jsx)("div",{style:{position:"absolute",inset:0,backgroundImage:"url(".concat(n.loginBg,")"),backgroundSize:"cover",backgroundPosition:"center 30%"}}
1),(0,f.jsx)("div",{style:{position:"absolute",inset:0,background:"rgba(10,10,11,.62)"}}),(0,f.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,height:3,background:rd}}),(0,f.jsxs)("div",{style:{position:"relative",display:"flex",alignItems:"center",gap:16,alignSelf:"flex-start"},children:[(0,f.jsx)("img",{src:"/nm/turbo-logo-white.png",alt:"Turbo 360",style:{height:38,width:"auto"}}),(0,f.jsx)("span",{style:{width:1,height:34,background:"rgba(255,255,255,.25)"}}),(0,f.jsx)("img",{src:n.logo,alt:n.name,style:{width:38,height:38,borderRadius:9,background:"#fff",objectFit:"contain",padding:3,boxSizing:"border-box"}})]}),(0,f.jsxs)("div",{style:{position:"relative"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10.5,fontWeight:700,letterSpacing:".22em",color:"#FFFFFF"},children:n.login.kicker}),(0,f.jsxs)("h1",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:"clamp(30px,3.4vw,40px)",lineHeight:1.06,letterSpacing:"-.02em",margin:"18px 0 0",textTransform:"uppercase"}),children:[n.login.headline[0],(0,f.jsx)("br",{}),n.login.headline[1]]}),(0,f.jsx)("div",{style:{width:430,maxWidth:"100%",height:1,background:"rgba(255,255,255,.16)",margin:"28px 0 24px"}}),(0,f.jsx)("div",{style:{display:"flex",gap:34,flexWrap:"wrap"},children:n.login.stats.map(e=>{let[t,s]=e;return(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:"#FFFFFF"},children:t}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:15,fontWeight:700,marginTop:6},children:s})]},t)})})]}),(0,f.jsx)("div",{style:{position:"relative",fontFamily:ad,fontSize:10.5,letterSpacing:".1em",color:ed.textFaintDark},children:"1300 207 446 \xb7 [email protected]"})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"clamp(24px,4vw,40px)",background:"#0F0F11"},children:["form"===c&&(0,f.jsxs)("div",{style:F,children:[(0,f.jsx)("img",{src:"/nm/turbo-icon-red.png",alt:"",style:{width:46,height:46,borderRadius:11,display:"block"}}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".22em",color:ed.red,marginTop:26},children:"SECURE SIGN-IN"}),(0,f.jsx)("h2",{style:{fontFamily:td,fontSize:22,fontWeight:700,letterSpacing:"-.01em",margin:"10px 0 8px"},children:"Sign in to your portal"}),(0,f.jsx)("p",{style:{fontSize:14.5,lineHeight:1.6,color:ed.textMuted,margin:"0 0 24px"},children:"We'll email you a link \u2014 no password to remember."}),(0,f.jsx)("label",{style:{display:"block",fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".16em",color:ed.textMuted,marginBottom:8},children:"WORK EMAIL"}),(0,f.jsx)("input",{className:"ka-input",type:"email",value:x,autoFocus:!0,placeholder:n.portal.emailPlaceholder,onChange:e=>{h(e.target.value),N("")},onKeyDown:e=>{"Enter"===e.key&&C(x)},style:E}),w&&(0,f.jsx)("div",{style:{marginTop:14,background:"#1F1315",border:"1px solid #3A1A1D",borderRadius:10,padding:"12px 14px",fontSize:13.5,lineHeight:1.55,color:"#F87171"},children:w}),(0,f.jsxs)("button",{type:"button",className:"ka-primary",disabled:v||!x.trim(),onClick:()=>C(x),style:{width:"100%",marginTop:18,background:ed.red,color:"#fff",border:"none",borderRadius:10,padding:"15px 18px",fontFamily:td,fontSize:15,fontWeight:700,cursor:v||!x.trim()?"default":"pointer",opacity:v||!x.trim()?.55:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:9},children:[v&&(0,f.jsx)(Kr.A,{size:16,style:{animation:"ka-spin .9s linear infinite"}}),v?"Sending your link\u2026":"Email me a sign-in link"]}),(0,f.jsx)(Km,{label:"PRIVATE PORTAL"}),(0,f.jsxs)("p",{style:{fontSize:12.5,lineHeight:1.6,color:ed.textFaintDark,margin:0},children:["Only approved ",n.name," contacts can sign in. Need access?"," ",(0,f.jsx)("a",{href:"mailto:[email protected]",style:{color:ed.textMuted},children:"[email protected]"})]})]}),"sent"===c&&(0,f.jsxs)("div",{style:F,children:[(0,f.jsx)("div",{style:{width:46,height:46,borderRadius:11,background:"#12281F",border:"1px solid #1E4632",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(T.A,{size:21,color:"#4ADE80",strokeWidth:2})}),(0,f.jsx)("h2",{style:{fontFamily:td,fontSize:22,fontWeight:700,letterSpacing:"-.01em",margin:"24px 0 10px"},children:"Check your inbox"}),(0,f.jsxs)("p",{style:{fontSize:14.5,lineHeight:1.65,color:ed.textMuted,margin:0},children:["If ",(0,f.jsx)("strong",{style:{color:"#fff",fontWeight:600},children:u})," has portal access, a sign-in link is on its way. It works once and expires in 24 hours."]}),(0,f.jsxs)("div",{style:{marginTop:26,border:"1px solid ".concat(ed.carbonBorder),borderRadius:12,padding:"18px 20px",background:"#141417"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".16em",color:ed.textMuted},children:"DIDN'T ARRIVE?"}),(0,f.jsx)("p",{style:{fontSize:13,lineHeight:1.6,color:ed.textFaintDark,margin:"10px 0 16px"},children:"Check spam, then try again. A new link replaces the old one."}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:[(0,f.jsx)("button",{type:"button",className:"ka-primary",disabled:v,onClick:()=>C(u,!0),style:{background:A?"#12281F":ed.red,color:A?"#4ADE80":"#fff",border:A?"1px solid #1E4632":"none",borderRadius:9,padding:"11px 16px",fontFamily:td,fontSize:13.5,fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:7},children:A?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(zt.A,{size:14,strokeWidth:2.6}),"Link resent"]}):"Resend link"}),(0,f.jsx)("button",{type:"button",className:"ka-ghost",onClick:()=>{p("form"),h(u),N("")},style:{background:"none",border:"none",color:ed.textMuted,fontFamily:sd,fontSize:13.5,fontWeight:600,cursor:"pointer"},children:"Use a different email"})]})]})]}),"verifying"===c&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},F),{},{textAlign:"center"}),children:[(0,f.jsx)("div",{style:{display:"flex",gap:7,justifyContent:"center",alignItems:"flex-end",height:34},children:[ed.red,ed.amber,ed.teal].map((e,t)=>(0,f.jsx)("span",{style:{width:7,height:34,borderRadius:3,background:e,animation:"ka-bar 1.1s ".concat(.16*t,"s cubic-bezier(0.16,1,0.3,1) infinite")}},e))}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10,fontWeight:700,letterSpacing:".22em",color:ed.textMuted,marginTop:24},children:"VERIFYING YOUR LINK\u2026"})]}),"signedin"===c&&(0,f.jsxs)("div",{style:F,children:[(0,f.jsx)("div",{style:{width:46,height:46,borderRadius:11,background:"#12281F",border:"1px solid #1E4632",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(zt.A,{size:22,color:"#4ADE80",strokeWidth:2.6})}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".22em",color:"#4ADE80",marginTop:26},children:"SIGNED IN"}),(0,f.jsxs)("h2",{style:{fontFamily:td,fontSize:22,fontWeight:700,letterSpacing:"-.01em",margin:"10px 0 8px"}
1,children:["Welcome back",null!==b&&void 0!==b&&b.name?", ".concat(b.name.split(" ")[0]):""]}),(0,f.jsx)("p",{style:{fontSize:14.5,lineHeight:1.6,color:ed.textMuted,margin:"0 0 24px"},children:"You'll stay signed in on this device for 24 hours."}),(0,f.jsxs)("button",{type:"button",className:"ka-primary",onClick:()=>i(n.routes.portal),style:{width:"100%",background:ed.red,color:"#fff",border:"none",borderRadius:10,padding:"15px 18px",fontFamily:td,fontSize:15,fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:9},children:["Open my portal ",(0,f.jsx)(S.A,{size:16,strokeWidth:2.4})]}),(0,f.jsx)(Km,{label:"NOT YOU?"}),(0,f.jsx)("button",{type:"button",className:"ka-ghost",onClick:async()=>{try{await fetch("".concat(s.API_BASE,"/auth/sign-out"),{method:"POST",headers:{Authorization:"Bearer ".concat(s.getToken())}})}catch(e){}s.clearToken(),y(null),h(""),p("form")},style:{background:"none",border:"none",color:ed.textMuted,fontFamily:sd,fontSize:13.5,fontWeight:600,cursor:"pointer",padding:0},children:"Sign out"})]})]})]})]})}const Km=e=>{let{label:t}=e;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,margin:"26px 0 16px"},children:[(0,f.jsx)("span",{style:{flex:1,height:1,background:ed.carbonBorder}}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".2em",color:ed.textFaintDark},children:t}),(0,f.jsx)("span",{style:{flex:1,height:1,background:ed.carbonBorder}})]})},Zm="#FEF7F6";function $m(e){var t;let{account:s,STEPS:a,event:n,catalogue:r,offering:i,selection:o,setSelection:l,step:c,setStep:d,pricing:p,savedAt:x,readOnly:h,onBack:u,onDiscard:g,onBook:b,onDownloadQuote:y}=e;const v=a.length,j=a[Math.min(c,v)-1]||a[0],w=e=>{var t;return null===(t=a[e-1])||void 0===t?void 0:t.label},N=e=>l(t=>e((0,m.A)((0,m.A)({},t),{},{roles:(0,m.A)({},t.roles),durations:(0,m.A)({},t.durations),deliverables:(0,m.A)({},t.deliverables),addons:(0,m.A)({},t.addons)}))),A=(e,t)=>N(s=>(t<=0?delete s.deliverables[e]:s.deliverables[e]=t,s)),k=r.packages||[],_=r.roles||[],C=(r.items||[]).filter(e=>"deliverable"===e.scope),F=(r.items||[]).filter(e=>"extra"===e.scope),E=k.find(e=>e.id===o.package)||null,T=_.filter(e=>(o.roles||{})[e.id]>0),z=null===j||void 0===j?void 0:j.label,B="Choose a package"!==z||!!o.package;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{padding:"30px 0 22px"},children:[(0,f.jsxs)("button",{type:"button",onClick:u,style:{background:"none",border:"none",padding:0,color:ed.textSecondary,fontFamily:sd,fontSize:13.5,fontWeight:600,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:7},children:[(0,f.jsx)(Ct.A,{size:15,strokeWidth:2.2})," All ",s.nouns.items]}),(0,f.jsx)("h1",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:"clamp(24px,3.2vw,34px)",lineHeight:1.08,letterSpacing:"-.02em",textTransform:"uppercase",margin:"14px 0 0"}),children:n.name}),(0,f.jsxs)("div",{style:{fontSize:14,color:ed.textSecondary,marginTop:6},children:[Vm(n.event_date,n.date_tbc),n.venue?" \xb7 ".concat(n.venue):""]})]}),h&&(0,f.jsx)("div",{style:{background:"#FEF3C7",border:"1px solid #FDE68A",borderRadius:10,padding:"10px 14px",marginBottom:14,fontSize:13,color:"#92400E"},children:"You\u2019re previewing as the client. Build away to see what they see \u2014 nothing is saved and booking is disabled."}),(0,f.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:20},children:a.map(e=>{const t=e.n===c,s=e.n<c;return(0,f.jsxs)("button",{type:"button",onClick:()=>d(e.n),style:{background:t?ed.carbon:s?"#fff":"transparent",color:t?"#fff":s?ed.textPrimary:ed.textMuted,border:"1px solid ".concat(t?ed.carbon:ed.paperBorder),borderRadius:999,padding:"9px 15px",fontFamily:td,fontSize:13,fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:7},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:10,opacity:.75},children:e.n}),e.label,s&&(0,f.jsx)(zt.A,{size:13,strokeWidth:2.6,color:ed.successFg})]},"".concat(e.n,"-").concat(e.label))})}),(0,f.jsxs)("div",{className:"ka-build-grid",style:{display:"grid",gridTemplateColumns:"1fr 340px",gap:20,alignItems:"start"},children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)(rp,{n:c,of:v,title:null===j||void 0===j?void 0:j.label,hint:null===j||void 0===j?void 0:j.hint,children:["Choose a package"===z&&(0,f.jsx)(Qm,{packages:k,offering:i,catalogue:r,chosen:o.package,onChoose:e=>N(t=>(t.package=e,"custom"!==e&&(t.roles={},t.durations={}),t))}),"Your package"===z&&k[0]&&(0,f.jsx)(ep,{pkg:k[0],catalogue:r,account:s}),"Crew"===z&&(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[_.map(e=>{const t=(o.roles||{})[e.id]||0,s=Object.values(e.rates||{}).filter(e=>e>0),a=s.length?Math.min(...s):null;return(0,f.jsxs)("div",{className:"ka-card-btn",style:op(t>0),children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15.5,fontWeight:700},children:e.label}),e.blurb&&(0,f.jsx)("div",{style:{fontSize:13,color:ed.textSecondary,marginTop:3},children:e.blurb}),null!=a&&(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:10,letterSpacing:".12em",color:ed.textFaint,marginTop:7},children:["FROM ",Gm(a)]})]}),(0,f.jsx)(lp,{value:t,onChange:t=>((e,t)=>N(s=>(t<=0?(delete s.roles[e],delete s.durations[e]):s.roles[e]=t,s)))(e.id,t)}
1)]},e.id)}),0===_.length&&(0,f.jsxs)(ip,{children:["No crew roles offered for this ",s.nouns.item,"."]})]}),"Time on site"===z&&(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[0===T.length&&(0,f.jsx)(ip,{children:"Pick your crew first."}),T.map(e=>{const t=(e=>(r.durations||[]).filter(t=>{var s,a;return"halfDay"===t.id?n.half_day_enabled&&Number((null===(s=e.rates)||void 0===s?void 0:s.halfDay)||0)>0:(t.days||0)<=(n.max_days||1)&&Number((null===(a=e.rates)||void 0===a?void 0:a[t.id])||0)>0}))(e),a=(o.durations||{})[e.id];return(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:16},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:(o.roles[e.id]>1?"".concat(o.roles[e.id]," \xd7 "):"")+e.label}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginTop:12},children:[t.map(t=>{var s;return(0,f.jsxs)("button",{type:"button",onClick:()=>((e,t)=>N(s=>(s.durations[e]=t,s)))(e.id,t.id),style:{background:a===t.id?Zm:"#fff",border:"1px solid ".concat(a===t.id?ed.red:ed.paperBorder),borderRadius:9,padding:"9px 14px",fontFamily:td,fontSize:13,fontWeight:700,cursor:"pointer"},children:[t.label,(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:11,marginLeft:8,color:ed.textSecondary},children:Gm(null===(s=e.rates)||void 0===s?void 0:s[t.id])})]},t.id)}),0===t.length&&(0,f.jsxs)("span",{style:{fontSize:13,color:ed.textMuted},children:["No durations offered for this role on this ",s.nouns.item,"."]})]}),e.inclusions&&(0,f.jsx)("div",{style:{whiteSpace:"pre-line",fontSize:12.5,lineHeight:1.6,color:ed.textSecondary,marginTop:12,background:ed.paperInset,borderRadius:9,padding:12},children:e.inclusions})]},e.id)})]}),"Deliverables"===z&&(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[0===C.length&&(0,f.jsx)(ip,{children:"Nothing optional here \u2014 your gallery is always included."}),C.map(e=>{const t=(o.deliverables||{})[e.id]||0;return(0,f.jsxs)("div",{className:"ka-card-btn",style:op(t>0),children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:e.label}),e.description&&(0,f.jsx)("div",{style:{fontSize:13,color:ed.textSecondary,marginTop:3},children:e.description}),(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:11,color:ed.textSecondary,marginTop:7},children:[Gm(e.price)," ",e.unit?"\xb7 ".concat(e.unit):""]})]}),e.quantity_based?(0,f.jsx)(lp,{value:t,onChange:t=>A(e.id,t)}):(0,f.jsx)(cp,{on:t>0,onClick:()=>A(e.id,t>0?0:1)})]},e.id)})]}),"Optional Extras & Review"===z&&(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[E&&(0,f.jsx)(tp,{pkg:E,catalogue:r,account:s,canChange:i.has_choice,onChange:()=>d(1)}),F.map(e=>{const t=!!(o.addons||{})[e.id];return(0,f.jsxs)("div",{className:"ka-card-btn",style:op(t),children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:e.label}),e.description&&(0,f.jsx)("div",{style:{fontSize:13,color:ed.textSecondary,marginTop:3},children:e.description}),(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:11,color:ed.textSecondary,marginTop:7},children:[Gm(e.price)," ",e.unit?"\xb7 ".concat(e.unit):""]})]}),(0,f.jsx)(cp,{on:t,onClick:()=>{return t=e.id,N(e=>(e.addons[t]?delete e.addons[t]:e.addons[t]=!0,e));var t}})]},e.id)}),0===F.length&&(0,f.jsxs)(ip,{children:["No optional extras for this ",s.nouns.item,"."]}),r.travel_fee&&(0,f.jsx)(sp,{travel:r.travel_fee}),(0,f.jsx)(ap,{pricing:p,account:s})]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:16,flexWrap:"wrap"},children:[c>1&&(0,f.jsxs)("button",{type:"button",onClick:()=>d(c-1),style:pp,children:[(0,f.jsx)(Ct.A,{size:15,strokeWidth:2.2})," ",w(c-1)]}),c<v&&(0,f.jsxs)("button",{type:"button",className:"ka-primary",disabled:!B,onClick:()=>B&&d(c+1),style:(0,m.A)((0,m.A)({},mp),{},{opacity:B?1:.5}),children:[w(c+1)," ",(0,f.jsx)(S.A,{size:15,strokeWidth:2.4})]}),(0,f.jsx)("span",{style:{flex:1}}),x&&(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:10,letterSpacing:".12em",color:ed.textFaint},children:"DRAFT SAVED"})]})]}),(0,f.jsxs)("aside",{className:"ka-rail",style:{position:"sticky",top:92}
1,children:[(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,overflow:"hidden"},children:[(0,f.jsx)("div",{style:{padding:"16px 18px",borderBottom:"1px solid ".concat(ed.paperHairline)},children:(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:"YOUR PACKAGE"})}),(0,f.jsxs)("div",{style:{padding:"14px 18px",display:"grid",gap:9},children:[(0,f.jsx)(np,{label:p.packageLabel||"Crew",value:p.crewTotal,priced:p.priced}),(0,f.jsx)(np,{label:"Deliverables & extras",value:p.itemsTotal,priced:p.priced}),p.travelTotal>0&&(0,f.jsx)(np,{label:"Travel",value:p.travelTotal,priced:p.priced,note:"SET BY TURBO"})]}),(0,f.jsxs)("div",{style:{padding:"14px 18px",borderTop:"1px solid ".concat(ed.paperHairline),display:"grid",gap:9},children:[(0,f.jsx)(np,{label:"Subtotal ex GST",value:p.subtotal,priced:p.priced}),(0,f.jsx)(np,{label:"GST ".concat(Math.round(100*(null!==(t=p.gstRate)&&void 0!==t?t:.1)),"%"),value:p.gst,priced:p.priced})]}),(0,f.jsxs)("div",{style:{background:ed.carbon,color:"#fff",padding:"16px 18px"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".18em",color:ed.textFaintDark},children:"TOTAL INC GST"}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:24,fontWeight:700,marginTop:5},children:p.priced?Gm(p.total):"\u2014"})]})]}),(0,f.jsxs)("div",{style:{display:"grid",gap:9,marginTop:12},children:[(0,f.jsx)("button",{type:"button",className:"ka-primary",disabled:!p.priced||h,onClick:b,title:h?"Admin preview is read-only \u2014 sign in as the contact to book":void 0,style:(0,m.A)((0,m.A)({},mp),{},{width:"100%",justifyContent:"center",opacity:!p.priced||h?.5:1}),children:h?"Booking disabled in preview":"booked"===n.state?"Update this booking":E?"Confirm & book this package":"Book this package"}),(0,f.jsxs)("button",{type:"button",onClick:y,disabled:!p.priced,style:(0,m.A)((0,m.A)({},pp),{},{width:"100%",justifyContent:"center",opacity:p.priced?1:.5}),children:[(0,f.jsx)(es.A,{size:14,strokeWidth:2.2})," Download quote"]}),"booked"!==n.state&&x&&!h&&(0,f.jsx)("button",{type:"button",onClick:g,style:{background:"none",border:"none",color:ed.textMuted,fontFamily:sd,fontSize:12.5,fontWeight:600,cursor:"pointer",padding:6},children:"Discard this draft"})]}),(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".14em",color:ed.textFaint,marginTop:14,lineHeight:1.7},children:["BILLED 30 DAYS PRIOR",(0,f.jsx)("br",{}),(0,f.jsxs)("span",{style:{fontFamily:sd,fontSize:12,letterSpacing:0,color:ed.textSecondary},children:["Invoice is issued 30 days before the ",s.nouns.item,", Net 30 from issue."]})]})]})]})]})}function Qm(e){let{packages:t,offering:s,catalogue:a,chosen:n,onChoose:r}=e;const i=null==a.gst_rate?.1:Number(a.gst_rate);return(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[t.map(e=>(0,f.jsx)(Xm,{selected:n===e.id,onSelect:()=>r(e.id),title:e.label,recommended:e.is_default,subtitle:e.sublabel,price:e.price,gstRate:i,inclusions:e.inclusions},e.id)),s.custom&&(0,f.jsx)(Xm,{selected:"custom"===n,onSelect:()=>r("custom"),title:"Build your own",subtitle:"Pick your crew and time on site from our rate c
1ard",priceNote:"Priced as you build",detail:"Choose how many people you need and how long for, then add what you'd like back."}),(0,f.jsx)("p",{style:{fontSize:13,lineHeight:1.6,color:ed.textSecondary,margin:"4px 0 0"},children:"Not sure? Start with the recommended package \u2014 you can add extras on the next step, or change your mind before you book."})]})}function Xm(e){let{selected:t,onSelect:s,title:a,subtitle:n,price:r,gstRate:i,inclusions:o,recommended:l,priceNote:c,detail:d}=e;return(0,f.jsx)("button",{type:"button",onClick:s,style:{textAlign:"left",width:"100%",cursor:"pointer",background:t?Zm:"#fff",border:"1px solid ".concat(t?ed.red:ed.paperBorder),borderRadius:12,padding:18},children:(0,f.jsxs)("div",{style:{display:"flex",gap:13,alignItems:"flex-start"},children:[(0,f.jsx)("span",{style:{width:20,height:20,borderRadius:"50%",flexShrink:0,marginTop:2,border:"1px solid ".concat(t?ed.red:ed.paperBorder),background:t?ed.red:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:t&&(0,f.jsx)(zt.A,{size:12,strokeWidth:3,color:"#fff"})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:9,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:16,fontWeight:700},children:a}),l&&(0,f.jsx)("span",{style:{background:"#3A1A1D",color:ed.amber,borderRadius:5,padding:"3px 7px",fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".14em"},children:"RECOMMENDED"})]}),n&&(0,f.jsx)("div",{style:{fontSize:13.5,color:ed.textSecondary,marginTop:4},children:n}),t&&(null===o||void 0===o?void 0:o.length)>0&&(0,f.jsx)("div",{style:{display:"grid",gap:7,marginTop:13},children:o.map(e=>(0,f.jsxs)("div",{style:{display:"flex",gap:9,alignItems:"flex-start"},children:[(0,f.jsx)("span",{style:{width:17,height:17,borderRadius:5,background:ed.successBg,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:1},children:(0,f.jsx)(zt.A,{size:11,strokeWidth:3,color:ed.successFg})}),(0,f.jsx)("span",{style:{fontSize:13,lineHeight:1.5},children:e})]},e))}),t&&d&&(0,f.jsx)("div",{style:{fontSize:13,lineHeight:1.55,color:ed.textSecondary,marginTop:11},children:d})]}),(0,f.jsx)("div",{style:{textAlign:"right",whiteSpace:"nowrap"},children:null!=r?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:17,fontWeight:700},children:Gm(r)}),(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".12em",color:ed.textFaint,marginTop:3},children:["EX GST \xb7 ",Gm(Number(r)*(1+i))," INC"]})]}):(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10.5,letterSpacing:".1em",color:ed.textFaint},children:c})})]})})}function ep(e){let{pkg:t,catalogue:s,account:a}=e;const n=null==s.gst_rate?.1:Number(s.gst_rate);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{background:Zm,border:"1px solid ".concat(ed.red),borderRadius:12,padding:20},children:[(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.red},children:["PRE-APPLIED TO EVERY ",a.nouns.Item.toUpperCase()]}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:18,fontWeight:700,marginTop:8},children:t.label}),t.sublabel&&(0,f.jsx)("div",{style:{fontSize:13.5,color:ed.textSecondary,marginTop:3},children:t.sublabel}),(0,f.jsx)("div",{style:{display:"grid",gap:9,marginTop:16},children:(t.inclusions||[]).map(e=>(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"flex-start"},children:[(0,f.jsx)("span",{style:{width:18,height:18,borderRadius:5,background:ed.successBg,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:1},children:(0,f.jsx)(zt.A,{size:12,strokeWidth:3,color:ed.successFg})}),(0,f.jsx)("span",{style:{fontSize:13.5,lineHeight:1.55},children:e})]},e))}),(0,f.jsxs)("div",{style:{borderTop:"1px solid ".concat(ed.paperHairline2),marginTop:18,paddingTop:14,display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[(0,f.jsxs)("span",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".16em",color:ed.textFaint},children:["PER ",a.nouns.Item.toUpperCase()," \xb7 EX GST"]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:21,fontWeight:700},children:Gm(t.price)})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,marginTop:4},children:[(0,f.jsxs)("span",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".16em",color:ed.textFaint},children:["TOTAL INC GST ",Math.round(100*n),"%"]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:13,fontWeight:700,color:ed.textSecondary},children:Gm(Number(t.price||0)*(1+n))})]})]}),(0,f.jsxs)("p",{style:{fontSize:13.5,lineHeight:1.65,color:ed.textSecondary,margin:"16px 0 0"},children:["This is the package we run on every ",a.nouns.item,". Nothing to configure \u2014 continue to add extras if you need them, or book it as is."]})]})}function tp(e){let{pkg:t,catalogue:s,account:a,canChange:n,onChange:r}=e;const i=null==s.gst_rate?.1:Number(s.gst_rate);return(0,f.jsxs)("div",{style:{background:Zm,border:"1px solid ".concat(ed.red),borderRadius:12,padding:18},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"baseline",justifyContent:"space-between",flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.red},children:n?"YOUR PACKAGE FOR THIS ".concat(a.nouns.Item.toUpperCase()):"PRE-APPLIED TO EVERY ".concat(a.nouns.Item.toUpperCase())}),n&&(0,f.jsx)("button",{type:"button",onClick:r,style:{background:"none",border:"none",padding:0,cursor:"pointer",color:ed.red,fontFamily:td,fontSize:12.5,fontWeight:700},children:"Change package"})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"baseline",justifyContent:"space-between",marginTop:8,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:16,fontWeight:700},children:t.label}),(0,f.jsxs)("span",{style:{fontFamily:ad,fontSize:15,fontWeight:700},children:[Gm(t.price),(0,f.jsxs)("span",{style:{fontSize:9.5,color:ed.textFaint,marginLeft:6},children:["EX GST \xb7 ",Gm(Number(t.price)*(1+i))," INC"]})]})]}),(t.inclusions||[]).length>0&&(0,f.jsx)("div",{style:{display:"grid",gap:6,marginTop:12},children:t.inclusions.map(e=>(0,f.jsxs)("div",{style:{display:"flex",gap:9,alignItems:"flex-start"},children:[(0,f.jsx)(zt.A,{size:13,strokeWidth:3,color:ed.successFg,style:{flexShrink:0,marginTop:2}}),(0,f.jsx)("span",{style:{fontSize:13,lineHeight:1.5},children:e})]},e))})]})}function sp(e){let{travel:t}=e;return(0,f.jsxs)("div",{style:{background:ed.paperInset,border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:16,display:"flex",gap:14,alignItems:"flex-start"}
1,children:[(0,f.jsx)("span",{style:{width:34,height:34,borderRadius:9,background:ed.amber,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(Za.A,{size:17,color:ed.carbon,strokeWidth:2.2})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:"TRAVEL FOR THIS EVENT"}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14.5,fontWeight:700,marginTop:5},children:t.label}),(0,f.jsx)("div",{style:{fontSize:13,lineHeight:1.55,color:ed.textSecondary,marginTop:4},children:"Set by Turbo for this location. It\u2019s added to your package total below and on your quote."})]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:15,fontWeight:700,whiteSpace:"nowrap"},children:Gm(t.amount)})]})}function ap(e){let{pricing:t,account:s}=e;return(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,overflow:"hidden",marginTop:6},children:[(0,f.jsxs)("div",{style:{padding:"14px 18px",borderBottom:"1px solid ".concat(ed.paperHairline),fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:["YOUR PACKAGE FOR THIS ",s.nouns.Item.toUpperCase()]}),0===t.lines.length&&(0,f.jsx)("div",{style:{padding:18,fontSize:13.5,color:ed.textMuted},children:"Nothing selected yet."}),t.lines.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:14,padding:"12px 18px",borderBottom:"1px solid ".concat(ed.paperHairline)},children:[(0,f.jsxs)("span",{style:{fontSize:13.5},children:[e.count>1?"".concat(e.count," \xd7 "):"",e.label,e.duration_label&&(0,f.jsxs)("span",{style:{color:ed.textMuted},children:[" \xb7 ",e.duration_label]})]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:13,fontWeight:700,whiteSpace:"nowrap"},children:Gm(e.amount)})]},"".concat(e.id,"-").concat(t)))]})}const np=e=>{let{label:t,value:s,priced:a,note:n}=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12,alignItems:"baseline"},children:[(0,f.jsxs)("span",{style:{fontSize:13,color:ed.textSecondary},children:[t,n&&(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:8.5,letterSpacing:".12em",color:ed.textFaint,marginLeft:6},children:n})]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:13,fontWeight:700},children:a?Gm(s):"\u2014"})]})},rp=e=>{let{n:t,of:s,title:a,hint:n,children:r}=e;return(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:20},children:[(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:["STEP ",t," OF ",s]}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:19,fontWeight:700,marginTop:7},children:a}),n&&(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".14em",color:ed.red,marginTop:5},children:n}),(0,f.jsx)("div",{style:{marginTop:18},children:r})]})},ip=e=>{let{children:t}=e;return(0,f.jsx)("div",{style:{fontSize:13.5,color:ed.textMuted,background:ed.paperInset,borderRadius:9,padding:14},children:t})},op=e=>({display:"flex",gap:14,alignItems:"center",background:e?Zm:"#fff",border:"1px solid ".concat(e?ed.red:ed.paperBorder),borderRadius:12,padding:16}),lp=e=>{let{value:t,onChange:s,disabled:a}=e;return(0,f.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[(0,f.jsx)("button",{type:"button",disabled:a||t<=0,onClick:()=>s(t-1),style:dp,children:(0,f.jsx)(md.A,{size:15,strokeWidth:2.4})}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:15,fontWeight:700,minWidth:20,textAlign:"center"},children:t}),(0,f.jsx)("button",{type:"button",disabled:a,onClick:()=>s(t+1),style:dp,children:(0,f.jsx)(ls.A,{size:15,strokeWidth:2.4})})]})},cp=e=>{let{on:t,onClick:s,disabled:a}=e;return(0,f.jsx)("button",{type:"button",onClick:s,disabled:a,style:{width:46,height:27,borderRadius:999,border:"none",flexShrink:0,background:t?ed.red:"#D9D5CC",cursor:a?"default":"pointer",display:"flex",alignItems:"center",padding:3,transition:"background .18s"},children:(0,f.jsx)("span",{style:{width:21,height:21,borderRadius:"50%",background:"#fff",transform:t?"translateX(19px)":"translateX(0)",transition:"transform .18s cubic-bezier(0.16,1,0.3,1)"}})})},dp={width:40,height:40,borderRadius:9,border:"1px solid ".concat(ed.paperBorder),background:"#fff",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center"},mp={background:ed.red,color:"#fff",border:"none",borderRadius:10,padding:"13px 20px",fontFamily:td,fontSize:14,fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:8},pp={background:"#fff",color:ed.textPrimary,border:"1px solid ".concat(ed.paperBorder),borderRadius:10,padding:"12px 18px",fontFamily:td,fontSize:13.5,fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:8};function xp(e){let{account:t,event:s,terms:n,pricing:r,contact:i,busy:o,isUpdate:l,onClose:c,onConfirm:d}=e;const[p,x]=(0,a.useState)((null===i||void 0===i?void 0:i.name)||""),[h,u]=(0,a.useState)((null===i||void 0===i?void 0:i.position)||""),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1),w=p.trim()&&b&&v&&!o;return(0,f.jsx)("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:60,background:"rgba(10,10,11,.55)",display:"flex",alignItems:"center",justifyContent:"center",padding:"clamp(12px,4vw,32px)"},onClick:e=>{e.target!==e.currentTarget||o||c()},children:(0,f.jsxs)("div",{style:{background:"#fff",borderRadius:14,width:"100%",maxWidth:620,maxHeight:"90vh",overflow:"auto"},children:[(0,f.jsxs)("div",{style:{position:"sticky",top:0,background:"#fff",borderBottom:"1px solid ".concat(ed.paperHairline),padding:"18px 22px",display:"flex",alignItems:"center",gap:12},children:[(0,f.jsxs)("div",{style:{flex:1},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.red},children:l?"UPDATE YOUR BOOKING":"CONFIRM YOUR BOOKING"}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:17,fontWeight:700,marginTop:4},children:null===s||void 0===s?void 0:s.name})]}),(0,f.jsx)("button",{type:"button",onClick:c,disabled:o,style:{background:"none",border:"none",cursor:"pointer",color:ed.textMuted},children:(0,f.jsx)(g.A,{size:18})})]}),(0,f.jsxs)("div",{style:{padding:22},children:[(0,f.jsxs)("div",{style:{background:ed.carbon,color:"#fff",borderRadius:10,padding:"16px 18px",display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".16em",color:ed.textFaintDark},children:"TOTAL INC GST"}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:22,fontWeight:700},children:Gm(r.total)})]}),((null===n||void 0===n?void 0:n.proposal_notes)||[]).length>0&&(0,f.jsxs)("div",{style:{marginTop:18},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:"TERMS"}),(0,f.jsx)("ul",{style:{margin:"10px 0 0",paddingLeft:18,display:"grid",gap:7},children:n.proposal_notes.map(e=>(0,f.jsx)("li",{style:{fontSize:13,lineHeight:1.6,color:ed.textSecondary},children:e},e))})]}),(0,f.jsxs)("div",{style:{display:"grid",gap:12,marginTop:20},children:[(0,f.jsxs)("label",{style:{display:"grid",gap:6},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".16em",color:ed.textFaint},children:"YOUR NAME"}),(0,f.jsx)("input",{value:p,onChange:e=>x(e.target.value),style:up})]}),(0,f.jsxs)("label",{style:{display:"grid",gap:6},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".16em",color:ed.textFaint},children:"POSITION"}),(0,f.jsx)("input",{value:h,onChange:e=>u(e.target.value),style:up})]})]}),(0,f.jsxs)("div",{style:{display:"grid",gap:12,marginTop:18},children:[(0,f.jsx)(hp,{checked:b,onChange:y,children:"I\u2019ve read and accept the terms above."}),(0,f.jsxs)(hp,{checked:v,onChange:j,children:["I\u2019m authorised to book this coverage on behalf of ",t.name,"."]})]}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".14em",color:ed.textFaint,marginTop:18,lineHeight:1.7},children:"CONFIRMING CREATES THE JOB, THE RUNSHEET RECORD AND EMAILS YOUR BOOKING CONFIRMATION PDF."}),(0,f.jsxs)("button",{type:"button",className:"ka-primary",disabled:!w,onClick:()=>d(p.trim(),h.trim()),style:(0,m.A)((0,m.A)({},mp),{},{width:"100%",justifyContent:"center",marginTop:16,opacity:w?1:.5}),children:[o&&(0,f.jsx)(Kr.A,{size:16,style:{animation:"ka-spin .9s linear infinite"}}),o?"Confirming\u2026":l?"Update my booking":"Confirm & book"]})]})]})})}const hp=e=>{let{checked:t,onChange:s,children:a}=e;return(0,f.jsxs)("label",{style:{display:"flex",gap:11,alignItems:"flex-start",cursor:"pointer"},children:[(0,f.jsx)("input",{type:"checkbox",className:"ka-check",checked:t,onChange:e=>s(e.target.checked),style:{position:"absolute",opacity:0,width:0,height:0}}),(0,f.jsx)("span",{style:{width:20,height:20,borderRadius:5,flexShrink:0,marginTop:1,border:"1px solid ".concat(t?ed.red:ed.paperBorder),background:t?ed.red:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:t&&(0,f.jsx)(zt.A,{size:13,strokeWidth:3,color:"#fff"})}),(0,f.jsx)("span",{style:{fontSize:13.5,lineHeight:1.55},children:a})]})},up={width:"100%",boxSizing:"border-box",background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:9,padding:"11px 13px",fontFamily:sd,fontSize:14,color:ed.textPrimary,outline:"none"};function gp(e){let{account:t,job:s,onBack:a,onModify:n,onDownload:r}=e;const{event:i,booking:o,stages:l,runsheet:c,crew:d,delivery:p,editable:x}=s,h="published"===(null===c||void 0===c?void 0:c.state),u=null==(null===o||void 0===o?void 0:o.gst_rate)?.1:Number(o.gst_rate);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{padding:"30px 0 22px"},children:[(0,f.jsxs)("button",{type:"button",onClick:a,style:{background:"none",border:"none",padding:0,color:ed.textSecondary,fontFamily:sd,fontSize:13.5,fontWeight:600,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:7},children:[(0,f.jsx)(Ct.A,{size:15,strokeWidth:2.2})," All ",t.nouns.items]}),(0,f.jsxs)("div",{style:{display:"flex",gap:14,alignItems:"baseline",flexWrap:"wrap",marginTop:14},children:[(0,f.jsx)("h1",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:"clamp(24px,3.2vw,34px)",lineHeight:1.08,letterSpacing:"-.02em",textTransform:"uppercase",margin:0}),children:i.name}),(0,f.jsx)("span",{style:{background:id.booked.bg,color:id.booked.fg,borderRadius:5,padding:"5px 9px",fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".14em"},children:"BOOKED"})]}),(0,f.jsxs)("div",{style:{fontSize:14,color:ed.textSecondary,marginTop:6},children:[Vm(i.event_date,i.date_tbc),i.venue?" \xb7 ".concat(i.venue):"",(null===o||void 0===o?void 0:o.job_ref)&&(0,f.jsx)("span",{style:{fontFamily:ad,marginLeft:10,color:ed.textFaint},children:o.job_ref})]})]}),(0,f.jsx)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:"18px 20px",marginBottom:20},children:(0,f.jsx)("div",{style:{display:"flex",gap:10,flexWrap:"wrap"},children:(l||[]).map(e=>(0,f.jsxs)("div",{style:{flex:"1 1 150px",minWidth:140},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("span",{style:{width:20,height:20,borderRadius:"50%",flexShrink:0,background:e.done?ed.successBg:ed.neutralClientBg,display:"flex",alignItems:"center",justifyContent:"center"},children:e.done&&(0,f.jsx)(zt.A,{size:12,strokeWidth:3,color:ed.successFg})}),(0,f.jsx)("span",{style:{fontFamily:td,fontSize:13.5,fontWeight:700,color:e.done?ed.textPrimary:ed.textMuted},children:e.label})]}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:8.5,letterSpacing:".16em",color:ed.textFaint,marginTop:5,paddingLeft:28},children:e.meta})]},e.key))})}),(0,f.jsxs)("div",{className:"ka-job-grid",style:{display:"grid",gridTemplateColumns:"1fr 340px",gap:20,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{display:"grid",gap:20},children:[(0,f.jsxs)(jp,{title:"YOUR PACKAGE",children:[((null===o||void 0===o?void 0:o.lines)||[]).map((e,t)=>(0,f.jsx)(wp,{left:"".concat(e.count>1?"".concat(e.count," \xd7 "):"").concat(e.label).concat(e.duration_label?" \xb7 ".concat(e.duration_label):""),right:Gm(e.amount)},"".concat(e.id,"-").concat(t))),(0,f.jsxs)("div",{style:{borderTop:"1px solid ".concat(ed.paperHairline),marginTop:6,paddingTop:12,display:"grid",gap:7},children:[(0,f.jsx)(wp,{left:"Subtotal ex GST",right:Gm(null===o||void 0===o?void 0:o.subtotal),muted:!0}
1),(0,f.jsx)(wp,{left:"GST ".concat(Math.round(100*u),"%"),right:Gm(null===o||void 0===o?void 0:o.gst),muted:!0}),(0,f.jsx)(wp,{left:(0,f.jsx)("strong",{children:"Total inc GST"}),right:(0,f.jsx)("strong",{children:Gm(null===o||void 0===o?void 0:o.total)})})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:9,marginTop:16,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{type:"button",onClick:r,style:Sp,children:[(0,f.jsx)(es.A,{size:14,strokeWidth:2.2})," Booking PDF"]}),x?(0,f.jsx)("button",{type:"button",onClick:n,style:_p,children:"Modify package"}):(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".14em",color:ed.textFaint,alignSelf:"center"},children:"CREW ASSIGNED \xb7 CHANGES VIA JAMES"})]})]}),(0,f.jsx)(jp,{title:"RUNSHEET",children:h?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(130px,1fr))",gap:1,background:ed.paperBorder,border:"1px solid ".concat(ed.paperBorder),borderRadius:10,overflow:"hidden"},children:[(0,f.jsx)(Np,{label:"CREW CALL",value:yp(c)||"\u2014"}),(0,f.jsx)(Np,{label:"DOORS",value:vp(c)||"\u2014"}),(0,f.jsx)(Np,{label:"SITE CONTACT",value:i.contact_name||"\u2014"})]}),(0,f.jsxs)("a",{href:"/corporate-runsheet/".concat(i.event_id),target:"_blank",rel:"noreferrer noopener",style:{display:"inline-flex",alignItems:"center",gap:7,marginTop:14,color:ed.red,fontFamily:td,fontSize:13.5,fontWeight:700,textDecoration:"none"},children:[(0,f.jsx)(kt.A,{size:14,strokeWidth:2.2})," Open full runsheet \u2192"]})]}):(0,f.jsxs)("div",{style:{fontSize:13.5,color:ed.textSecondary},children:["We publish the runsheet about three weeks before the ",t.nouns.item,". It'll appear here, and your crew get it in the Turbo Crew app."]})}),(0,f.jsxs)(jp,{title:"CREW",children:[0===(d||[]).length&&(0,f.jsx)("div",{style:{fontSize:13.5,color:ed.textSecondary},children:"Crew are assigned closer to the date and appear here once locked in."}),(0,f.jsx)("div",{style:{display:"grid",gap:14},children:(d||[]).map(e=>(0,f.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[(0,f.jsx)("span",{style:{width:28,height:28,borderRadius:8,background:ed.carbon,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:td,fontSize:11,fontWeight:700,flexShrink:0},children:(e.name||"").split(/\s+/).map(e=>e[0]).slice(0,2).join("").toUpperCase()}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14.5,fontWeight:700},children:e.name}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".14em",color:ed.textFaint,marginTop:2},children:(e.role||"crew").toUpperCase()}),(0,f.jsxs)("div",{style:{display:"flex",gap:14,flexWrap:"wrap",marginTop:6},children:[e.mobile&&(0,f.jsxs)("a",{className:"ka-crew-link",href:"tel:".concat(String(e.mobile).replace(/\s+/g,"")),style:{display:"inline-flex",alignItems:"center",gap:5,fontFamily:ad,fontSize:11.5,color:ed.textSecondary,textDecoration:"none"},children:[(0,f.jsx)(E.A,{size:12,strokeWidth:2.2})," ",e.mobile]}),e.email&&(0,f.jsxs)("a",{className:"ka-crew-link",href:"mailto:".concat(e.email),style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:13,color:ed.textSecondary,textDecoration:"none"},children:[(0,f.jsx)(T.A,{size:12,strokeWidth:2.2})," ",e.email]})]})]})]},"".concat(e.name,"-").concat(e.role)))})]})]}),(0,f.jsxs)("aside",{style:{display:"grid",gap:20},children:[(0,f.jsxs)(jp,{title:"DELIVERABLES",children:[(0,f.jsx)(kp,{label:"Stills gallery",state:null!==p&&void 0!==p&&p.gallery_url?"DELIVERED":"AFTER EVENT",href:null===p||void 0===p?void 0:p.gallery_url}),fp(o,"package")&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(kp,{label:"Same-day social edits",state:"ON THE DAY"}),(0,f.jsx)(kp,{label:"Highlight reel",state:null!==p&&void 0!==p&&p.reviews_project_url?"IN REVIEW":"AFTER EVENT",href:null===p||void 0===p?void 0:p.reviews_project_url})]})]}),(0,f.jsxs)(jp,{title:"INVOICE",children:[(0,f.jsxs)("div",{style:{fontSize:13.5,color:ed.textSecondary,lineHeight:1.6},children:["Issued 30 days before the ",t.nouns.item,", Net 30 from issue."]}),(0,f.jsx)("div",{style:{marginTop:10},children:(0,f.jsx)("span",{style:{background:ed.infoBg,color:ed.infoFg,borderRadius:5,padding:"4px 8px",fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".14em"},children:"SCHEDULED"})})]})]})]})]})}const fp=(e,t)=>((null===e||void 0===e?void 0:e.lines)||[]).some(e=>e.kind===t),bp=e=>{const t=[...(null===e||void 0===e?void 0:e.timed_events)||[]];
1return((null===e||void 0===e?void 0:e.days)||[]).forEach(e=>t.push(...e.timed_events||[])),t.filter(e=>e.time).sort((e,t)=>String(e.time).localeCompare(String(t.time)))},yp=e=>{var t;return null===(t=bp(e)[0])||void 0===t?void 0:t.time},vp=e=>{var t;return null===(t=bp(e)[1])||void 0===t?void 0:t.time},jp=e=>{let{title:t,children:s}=e;return(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,overflow:"hidden"},children:[(0,f.jsx)("div",{style:{padding:"14px 18px",borderBottom:"1px solid ".concat(ed.paperHairline),fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:t}),(0,f.jsx)("div",{style:{padding:18},children:s})]})},wp=e=>{let{left:t,right:s,muted:a}=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:14,padding:"5px 0"},children:[(0,f.jsx)("span",{style:{fontSize:13.5,color:a?ed.textSecondary:ed.textPrimary},children:t}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:13,fontWeight:700,whiteSpace:"nowrap"},children:s})]})},Np=e=>{let{label:t,value:s}=e;return(0,f.jsxs)("div",{style:{background:"#fff",padding:"12px 14px"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:ed.textFaint},children:t}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:14,fontWeight:700,marginTop:5},children:s})]})},Ap={DELIVERED:{bg:ed.successBg,fg:ed.successFg},"IN REVIEW":{bg:ed.infoBg,fg:ed.infoFg},"ON THE DAY":{bg:ed.warnBg,fg:ed.warnFg},"AFTER EVENT":{bg:ed.neutralClientBg,fg:ed.neutralClientFg}},kp=e=>{let{label:t,state:s,href:a}=e;const n=Ap[s]||Ap["AFTER EVENT"],r=(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12,alignItems:"center",padding:"8px 0"},children:[(0,f.jsx)("span",{style:{fontSize:13.5,color:a?ed.red:ed.textPrimary,fontWeight:a?600:400},children:t}),(0,f.jsx)("span",{style:{background:n.bg,color:n.fg,borderRadius:5,padding:"4px 8px",fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".14em",whiteSpace:"nowrap"},children:s})]});return a?(0,f.jsx)("a",{href:a,target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"none"},children:r}):r},Sp={background:"#fff",color:ed.textPrimary,border:"1px solid ".concat(ed.paperBorder),borderRadius:9,padding:"10px 15px",fontFamily:td,fontSize:13,fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:7},_p={background:ed.carbon,color:"#fff",border:"none",borderRadius:9,padding:"10px 16px",fontFamily:td,fontSize:13,fontWeight:700,cursor:"pointer"},Cp=e=>Math.round(100*e)/100;function Fp(e,t){if(!e.has_choice)return function(e){const t={label:"Optional Extras & Review",hint:"ADD ANYTHING EXTRA, THEN CONFIRM"};let s;return s=e.custom_only?[{label:"Crew",hint:"WHO DO YOU NEED ON SITE?"},{label:"Time on site",hint:"HOW LONG FOR EACH ROLE?"},{label:"Deliverables",hint:"WHAT DO YOU WANT BACK?"},t]:e.single?[{label:"Your package",hint:"INCLUDED ON EVERY EVENT"},t]:[{n:1,label:"Choose a package",hint:"WHAT WOULD YOU LIKE FOR THIS EVENT?"},t],s.map((e,t)=>(0,m.A)((0,m.A)({},e),{},{n:t+1}))}(e);return[{label:"Choose a package",hint:"WHAT WOULD YOU LIKE FOR THIS EVENT?"},..."custom"===t.package?[{label:"Crew",hint:"WHO DO YOU NEED ON SITE?"},{label:"Time on site",hint:"HOW LONG FOR EACH ROLE?"},{label:"Deliverables",hint:"WHAT DO YOU WANT BACK?"}]:[],{label:"Optional Extras & Review",hint:"ADD ANYTHING EXTRA, THEN CONFIRM"}].map((e,t)=>(0,m.A)((0,m.A)({},e),{},{n:t+1}))}function Ep(e){let{accountKey:t}=e;const s=(0,a.useMemo)(()=>Um(t),[t]),{account:n}=s,[r,i]=(0,a.useState)(!0),[o,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(null),[p,x]=(0,a.useState)(null),[h,u]=(0,a.useState)([]),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)(null),[w,N]=(0,a.useState)("list"),[A,k]=(0,a.useState)(null),[S,_]=(0,a.useState)(null),[C,F]=(0,a.useState)({package:null,roles:{},durations:{},deliverables:{},addons:{}}),[E,T]=(0,a.useState)(1),[z,B]=(0,a.useState)(null),[D,I]=(0,a.useState)(!1),[R,P]=(0,a.useState)(!1),W=(0,a.useRef)(null),O=(0,a.useRef)(!0),L=(0,a.useCallback)(async()=>{const e=await s.request("/events");u(e.events||[]),y(e.summary||null),d(e.contact||null),x(e.impersonated_by||null)},[s]);(0,a.useEffect)(()=>{s.getToken()?(async()=>{try{const[,e]=await Promise.all([L(),s.request("/catalogue")]);j(e)}catch(e){"Sign-in required"!==e.message&&l(e.message)}finally{i(!1)}})():window.location.href=n.routes.login},[]);const[M,q]=(0,a.useState)(null),H=M||v,U=(0,a.useMemo)(()=>H?function(e,t,s){const a=e=>Object.fromEntries((e||[]).map(e=>[e.id,e])),n=a(t.roles),r=a(t.items),i=a(t.packages),o=null==t.gst_rate?.1:Number(t.gst_rate),l=[],c=s.package,d=c&&"custom"!==c?i[c]:null;d?l.push({kind:"package",id:d.id,label:d.label,sublabel:d.sublabel||"",inclusions:d.inclusions||[],count:1,unit_price:Number(d.price||0),amount:Cp(Number(d.price||0))}):Object.entries(s.roles||{}
1).forEach(e=>{var a;let[r,i]=e;const o=n[r],c=Number(i||0);if(!o||c<=0)return;const d=(s.durations||{})[r];if(!d)return;const m=Number((o.rates||{})[d]||0);if(m<=0)return;const p=(null===(a=(t.durations||[]).find(e=>e.id===d))||void 0===a?void 0:a.label)||d;l.push({kind:"crew",id:r,label:o.label,duration:d,duration_label:p,count:c,unit_price:m,amount:Cp(m*c)})});const m=[];Object.entries(s.deliverables||{}).forEach(e=>{let[t,s]=e;const a=r[t];let n=Number(s||0);!a||n<=0||(a.quantity_based||(n=1),m.push({kind:"deliverable",id:t,label:a.label,count:n,unit_price:Number(a.price||0),amount:Cp(Number(a.price||0)*n)}))}),Object.entries(s.addons||{}).forEach(e=>{let[t,s]=e;const a=r[t];s&&a&&m.push({kind:"extra",id:t,label:a.label,count:1,unit_price:Number(a.price||0),amount:Cp(Number(a.price||0))})});const p=[],x=t.travel_fee||null,h=Number((null===x||void 0===x?void 0:x.amount)||0);h>0&&p.push({kind:"travel",id:"travel",label:x.label?"Travel \u2014 ".concat(x.label):"Travel",count:1,unit_price:h,amount:Cp(h)});const u=[...l,...m,...p],g=Cp(u.reduce((e,t)=>e+t.amount,0)),f=Cp(g*o);return{lines:u,crewTotal:Cp(l.reduce((e,t)=>e+t.amount,0)),itemsTotal:Cp(m.reduce((e,t)=>e+t.amount,0)),travelTotal:Cp(p.reduce((e,t)=>e+t.amount,0)),subtotal:g,gst:f,gstRate:o,total:Cp(g+f),packageLabel:d?d.label:null,priced:l.length>0}}(0,H,C):null,[n,H,C]),G=(null===H||void 0===H?void 0:H.offering)||{packages:[],custom:!1,single:!1,custom_only:!1,has_choice:!1},V=(0,a.useMemo)(()=>Fp((0,m.A)((0,m.A)({},G),{},{packages:(null===H||void 0===H?void 0:H.packages)||[]}),C),[G,H,C]);(0,a.useEffect)(()=>{if("build"===w&&A&&!p&&!O.current)return W.current&&clearTimeout(W.current),W.current=setTimeout(async()=>{try{const e=await s.request("/draft/".concat(A.event_id),{method:"PUT",body:JSON.stringify({selection:C,step:E})});B(e.saved_at)}catch(e){}},1e3),()=>W.current&&clearTimeout(W.current)},[C,E,w,A,p]);const J=(0,a.useCallback)(async e=>{l(""),O.current=!0,k(e),T(1);try{const i=await s.request("/catalogue?event_id=".concat(encodeURIComponent(e.event_id)));q(i);const o=(0,m.A)((0,m.A)({},i.offering||{}),{},{packages:i.packages||[]});let l;if("booked"===e.state){var t;const a=await s.request("/bookings/".concat(e.event_id));l=(0,m.A)((0,m.A)({},{package:null,roles:{},durations:{},deliverables:{},addons:{}}),(null===(t=a.booking)||void 0===t?void 0:t.selection)||{})}else{var a,n,r;const t=await s.request("/draft/".concat(e.event_id));l=(0,m.A)((0,m.A)({},{package:null,roles:{},durations:{},deliverables:{},addons:{}}),(null===(a=t.draft)||void 0===a?void 0:a.selection)||{}),T(Math.max(1,Number((null===(n=t.draft)||void 0===n?void 0:n.step)||1))),B((null===(r=t.draft)||void 0===r?void 0:r.saved_at)||null)}l.package||(l.package=function(e){var t;return e.default_package?e.default_package:1!==(null===(t=e.packages)||void 0===t?void 0:t.length)||e.custom?e.custom_only?"custom":null:e.packages[0].id}(o)),F(l)}catch(i){F({package:null,roles:{},durations:{},deliverables:{},addons:{}}),404!==i.status&&l(i.message)}N("build"),window.scrollTo(0,0),setTimeout(()=>{O.current=!1},400)},[s]),Y=(0,a.useCallback)(async e=>{l("");try{const t=await s.request("/bookings/".concat(e.event_id));_(t),k(e),N("job"),window.scrollTo(0,0)}catch(t){l(t.message)}},[s]),K=(0,a.useCallback)(async()=>{O.current=!0,N("list"),k(null),_(null);try{await L()}catch(e){}window.scrollTo(0,0)},[L]),Z=(0,a.useCallback)(async()=>{if(A){try{await s.request("/draft/".concat(A.event_id),{method:"DELETE"})}catch(e){}F({package:null,roles:{},durations:{},deliverables:{},addons:{}}),B(null),K()}},[s,A,K]),$=(0,a.useCallback)(async(e,t)=>{if(!A)return;P(!0);let a=!1;try{await s.request("/bookings",{method:"POST",body:JSON.stringify({event_id:A.event_id,selection:C,signer_name:e,signer_position:t,accepted_terms:!0,accepted_authority:!0})}),a=!0,I(!1);const n=await s.request("/bookings/".concat(A.event_id));_(n),N("job"),await L(),window.scrollTo(0,0)}catch(n){a?(I(!1),N("list"),await L().catch(()=>{}),l("Your booking is confirmed. We just couldn\u2019t refresh this page \u2014 reload to see it.")):l(n.message)}finally{P(!1)}},[s,A,C,L]),Q=(0,a.useCallback)(async e=>{if(A)try{await s.downloadPdf("/documents/".concat(e,"/").concat(A.event_id))}catch(t){l(t.message)}},[s,A]);return r?(0,f.jsx)(Tp,{account:n,contact:null,children:(0,f.jsx)("div",{style:{padding:"80px 0",textAlign:"center",color:ed.textMuted},children:(0,f.jsx)(Kr.A,{size:22,style:{animation:"ka-spin .9s linear infinite"}})})}):(0,f.jsxs)(Tp,{account:n,contact:c,previewAs:p,children:[o&&(0,f.jsxs)("div",{style:{margin:"20px 0",background:ed.dangerBg,border:"1px solid #FCA5A5",borderRadius:10,padding:"14px 16px",color:ed.dangerFg,fontSize:14},children:[o,(0,f.jsx)("button",{type:"button",onClick:()=>l(""),style:{float:"right",background:"none",border:"none",color:ed.dangerFg,cursor:"pointer"},children:(0,f.jsx)(g.A,{size:15})})]}),"list"===w&&(0,f.jsx)(Bp,{account:n,events:h,summary:b,catalogue:v,onBuild:J,onJob:Y}),"build"===w&&A&&H&&U&&(0,f.jsx)($m,{account:n,STEPS:V,event:A,catalogue:H,offering:G,selection:C,setSelection:F,step:E,setStep:T,pricing:U,savedAt:z,readOnly:!!p,onBack:K,onDiscard:Z,onBook:()=>I(!0),onDownloadQuote:()=>Q("quote")}),"job"===w&&S&&(0,f.jsx)(gp,{account:n,job:S,onBack:K,onModify:()=>J(S.event),onDownload:()=>Q("confirmation")}),D&&H&&U&&(0,f.jsx)(xp,{account:n,event:A,terms:H.terms,pricing:U,contact:c,busy:R,isUpdate:"booked"===(null===A||void 0===A?void 0:A.state),onClose:()=>I(!1),onConfirm:$})]})}function Tp(e){let{account:t,contact:s,previewAs:a,children:n}=e;const r=((null===s||void 0===s?void 0:s.name)||"").split(/\s+/).filter(
1Boolean).map(e=>e[0]).slice(0,2).join("").toUpperCase();return(0,f.jsxs)("div",{style:{minHeight:"100vh",background:ed.paper,color:ed.textPrimary,fontFamily:sd},children:[a&&(0,f.jsx)("div",{style:{background:ed.amber,color:ed.carbon,padding:"9px 0"},children:(0,f.jsxs)("div",{style:{maxWidth:1180,margin:"0 auto",padding:"0 clamp(16px,4vw,40px)",display:"flex",gap:10,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9.5,fontWeight:700,letterSpacing:".14em"},children:"ADMIN PREVIEW"}),(0,f.jsxs)("span",{style:{fontSize:13,fontWeight:600},children:["Viewing as ",(null===s||void 0===s?void 0:s.name)||"this contact"," \u2014 read-only. Bookings and drafts are disabled."]})]})}),(0,f.jsxs)(d.mg,{children:[(0,f.jsxs)("title",{children:[t.name," Booking Portal | Turbo 360"]}),(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,f.jsx)("style",{children:"\n @keyframes ka-spin { to { transform: rotate(360deg); } }\n .ka-row:hover { background: ".concat(ed.paperRowHover,"; }\n .ka-primary:hover:not(:disabled) { background: ").concat(ed.redHover," !important; }\n .ka-card-btn:hover { border-color: ").concat(ed.red,"; }\n .ka-ghost-btn:hover { border-color: ").concat(ed.red,"; color: ").concat(ed.red,"; }\n /* The input is transparent, so the ring has to be drawn on its sibling. */\n .ka-check:focus-visible + span { outline: 2px solid ").concat(ed.red,"; outline-offset: 2px; }\n .ka-crew-link:hover { color: ").concat(ed.red," !important; }\n @media (max-width: 1024px) {\n .ka-build-grid { grid-template-columns: 1fr !important; }\n .ka-job-grid { grid-template-columns: 1fr !important; }\n .ka-rail { position: static !important; }\n .ka-event-row { grid-template-columns: 64px 1fr !important; }\n .ka-event-right { grid-column: 2 !important; padding-left: 0 !important; margin-top: 12px; text-align: left !important; }\n .ka-event-right .ka-actions { justify-content: flex-start !important; }\n .ka-header-contact { display: none !important; }\n }\n @media (max-width: 640px) {\n .ka-hero-h1 { font-size: 25px !important; }\n .ka-summary { grid-template-columns: 1fr 1fr !important; }\n .ka-header-name { display: none !important; }\n .ka-crewbar { flex-direction: column; align-items: flex-start !important; }\n .ka-crewbar-badges { width: 100%; }\n }\n ")}),(0,f.jsx)("div",{style:{height:3,background:rd}}),(0,f.jsx)("header",{style:{position:"sticky",top:0,zIndex:40,boxShadow:"0 1px 0 ".concat(ed.carbonBorder),background:ed.carbon,color:"#fff",height:74,display:"flex",alignItems:"center"},children:(0,f.jsxs)("div",{style:{width:"100%",maxWidth:1180,margin:"0 auto",padding:"0 clamp(16px,4vw,40px)",display:"flex",alignItems:"center",gap:18},children:[(0,f.jsx)("img",{src:"/nm/turbo-logo-white.png",alt:"Turbo 360",style:{height:26,width:"auto"}}),(0,f.jsx)("span",{style:{width:1,height:30,background:ed.carbonBorder}}),(0,f.jsx)("img",{src:t.logo,alt:t.name,style:{width:34,height:34,borderRadius:8,background:"#fff",objectFit:"contain",padding:3,boxSizing:"border-box"}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14,fontWeight:700},children:t.name}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".18em",color:ed.textFaintDark},children:"BOOKING PORTAL"})]}),(0,f.jsx)("span",{style:{flex:1}}),(0,f.jsx)("span",{className:"ka-header-contact",style:{fontFamily:ad,fontSize:10.5,letterSpacing:".08em",color:ed.textFaintDark},children:"1300 207 446 \xb7 [email protected]"}),s&&(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:9},children:[(0,f.jsx)("span",{style:{width:26,height:26,borderRadius:8,background:ed.red,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:td,fontSize:11,fontWeight:700},children:r}),(0,f.jsx)("span",{className:"ka-header-name",style:{fontSize:13,fontWeight:600},children:s.name})]})]})}),(0,f.jsx)("main",{style:{maxWidth:1180,margin:"0 auto",padding:"0 clamp(16px,4vw,40px) 140px"},children:n}),(0,f.jsx)(zp,{})]})}function zp(){return(0,f.jsx)("div",{style:{position:"fixed",left:0,right:0,bottom:0,zIndex:35,background:"rgba(20,20,23,.92)",backdropFilter:"blur(10px)",borderTop:"1px solid ".concat(ed.carbonBorder),boxShadow:"0 -10px 30px rgba(10,10,11,.25)",padding:"12px clamp(16px,4vw,40px) calc(12px + env(safe-area-inset-bottom))"},children:(0,f.jsxs)("div",{className:"ka-crewbar",style:{maxWidth:1180,margin:"0 auto",display:"flex",alignItems:"center",gap:18,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{width:38,height:38,borderRadius:10,background:ed.red,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(Ve.A,{size:20,color:"#fff",strokeWidth:2})}),(0,f.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.redLight},children:"DOWNLOAD THE TURBO CREW APP"}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14,fontWeight:700,color:"#fff",marginTop:3},children:"Crew communications in your pocket"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textMuted,marginTop:2},children:"Live call times, on-site chat and delivery updates for every event \u2014 sign in with the same email."})]}),(0,f.jsxs)("div",{className:"ka-crewbar-badges",style:{display:"flex",gap:10,alignItems:"center"},children:[(0,f.jsx)("a",{href:"https://apps.apple.com/au/app/turbo-crew/id6752018745",target:"_blank",rel:"noreferrer noopener",style:{opacity:1},children:(0,f.jsx)("img",{src:"/ka/app-store-badge.png",alt:"Download on the App Store",style:{height:38,width:"auto",display:"block"}})}),(0,f.jsx)("a",{href:"https://play.google.com/store/apps/details?id=au.net.turbo.crew",target:"_blank",rel:"noreferrer noopener",children:(0,f.jsx)("img",{src:"/ka/google-play-badge.png",alt:"Get it on Google Play",style:{height:38,width:"auto",display:"block"}})})]})]})})}function Bp(e){let{account:t,events:s,summary:n,catalogue:r,onBuild:i,onJob:o}=e;const l=(0,a.useMemo)(()=>{const e={};
1return s.forEach(t=>{const s=t.event_date?new Date(t.event_date).getFullYear():"Dates TBC";(e[s]=e[s]||[]).push(t)}),Object.entries(e).sort((e,t)=>{let[s]=e,[a]=t;return String(s).localeCompare(String(a))})},[s]),{items:c,Items:d}=t.nouns;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("section",{style:{padding:"52px 0 36px"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10.5,fontWeight:700,letterSpacing:".2em",color:ed.red},children:t.portal.kicker}),(0,f.jsx)("h1",{className:"ka-hero-h1",style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:"clamp(28px,4vw,42px)",lineHeight:1.04,letterSpacing:"-.02em",textTransform:"uppercase",margin:"16px 0 0"}),children:t.portal.headline}),(0,f.jsx)("p",{style:{maxWidth:620,fontSize:15.5,lineHeight:1.65,color:ed.textSecondary,margin:"16px 0 0"},children:t.portal.intro})]}),n&&(0,f.jsxs)("div",{className:"ka-summary",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(160px,1fr))",gap:1,background:ed.paperBorder,border:"1px solid ".concat(ed.paperBorder),borderRadius:12,overflow:"hidden",marginBottom:36},children:[(0,f.jsx)(Dp,{label:"".concat(d.toUpperCase()," AHEAD"),value:n.events_ahead}),(0,f.jsx)(Dp,{label:"BOOKED",value:n.booked,tone:ed.successFg}),(0,f.jsx)(Dp,{label:"NOT YET BOOKED",value:n.not_booked,tone:ed.warnFg}),(0,f.jsx)(Dp,{label:n.drafts>0?"DRAFTS SAVED":"fixed"===t.mode?"READY TO CONFIRM":"NEXT ".concat(t.nouns.Item.toUpperCase()),value:n.drafts>0?n.drafts:"fixed"===t.mode?n.not_booked:n.next_event?"".concat(Jm(n.next_event).month," ").concat(Jm(n.next_event).day):"\u2014"})]}),0===l.length&&(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:12,padding:"48px 28px",textAlign:"center"},children:[(0,f.jsxs)("div",{style:{fontFamily:td,fontSize:17,fontWeight:700},children:["No ",c," in your calendar yet"]}),(0,f.jsx)("div",{style:{fontSize:14,color:ed.textSecondary,marginTop:8},children:"As soon as we add one it appears here, priced and ready to confirm."})]}),l.map(e=>{let[s,a]=e;const n=a.filter(e=>"booked"===e.state).length;return(0,f.jsxs)("section",{style:{marginBottom:28},children:[(0,f.jsxs)("div",{style:{background:ed.carbon,color:"#fff",borderRadius:"10px 10px 0 0",padding:"14px 20px",display:"flex",alignItems:"baseline",gap:14,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:17}),children:s}),(0,f.jsxs)("span",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".16em",color:ed.textFaintDark},children:[a.length," ",c.toUpperCase()," \xb7 ",n," BOOKED \xb7 ",a.length-n," TO BOOK"]})]}),(0,f.jsx)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderTop:"none",borderRadius:"0 0 10px 10px",overflow:"hidden"},children:a.map((e,s)=>(0,f.jsx)(Ip,{account:t,row:e,last:s===a.length-1,onBuild:i,onJob:o},e.event_id))})]},s)}),(0,f.jsxs)("div",{style:{background:ed.carbon,color:"#fff",borderRadius:12,padding:"26px 28px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:20,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{fontFamily:td,fontSize:16,fontWeight:700},children:[t.nouns.Item," missing, or dates changed?"]}),(0,f.jsx)("div",{style:{fontSize:13.5,color:ed.textFaintDark,marginTop:4},children:"We keep this calendar current \u2014 tell us and we'll update it."})]}),(0,f.jsxs)("a",{href:"mailto:[email protected]",className:"ka-primary",style:{background:ed.red,color:"#fff",textDecoration:"none",borderRadius:9,padding:"12px 20px",fontFamily:td,fontSize:13.5,fontWeight:700,display:"inline-flex",alignItems:"center",gap:8},children:["Contact [email protected] ",(0,f.jsx)(S.A,{size:15,strokeWidth:2.4})]})]})]})}const Dp=e=>{let{label:t,value:s,tone:a}=e;return(0,f.jsxs)("div",{style:{background:"#fff",padding:"18px 20px"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:t}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:24,fontWeight:700,marginTop:7,color:a||ed.textPrimary},children:s})]})};function Ip(e){var t;let{account:s,row:a,last:n,onBuild:r,onJob:i}=e;const o=Jm(a.event_date),l=a.offers||{},c=l.names||[],d=l.cheapest_total,m=l.single,p=l.custom_only,x="booked"===a.state?id.booked:"draft"===a.state?m?{bg:"#E0E7FF",fg:"#4338CA",label:"NOT BOOKED YET \xb7 READY TO CONFIRM"}:id.draft:id.open,h="booked"===a.state?"BOOKED TOTAL":"draft"===a.state?"DRAFT":m?"STANDARD PACKAGE":p?"NO QUOTE YET":"PACKAGES FROM",u="booked"===a.state?Gm(a.booked_total):"draft"===a.state?Gm(a.draft_total):null!=d?Gm(d):(0,f.jsx)("span",{style:{color:ed.textFaint,fontSize:13},children:"Build to price"}),g="draft"===a.state?m?"Review & confirm":"Resume draft":m?"Confirm package":p?"Build package":"Choose a package";return(0,f.jsxs)("div",{className:"ka-row ka-event-row",style:{display:"grid",gridTemplateColumns:"78px 1fr 300px",gap:16,padding:"18px 20px",borderBottom:n?"none":"1px solid ".concat(ed.paperHairline),alignItems:"center"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10.5,fontWeight:700,color:ed.red,letterSpacing:".08em"},children:o.month}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:25,fontWeight:700,lineHeight:1},children:o.day})]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:16.5,fontWeight:700},children:a.name}),(0,f.jsxs)("div",{style:{fontSize:13,color:ed.textSecondary,marginTop:3},children:[Vm(a.event_date,a.date_tbc),a.venue?" \xb7 ".concat(a.venue):""]}),c.length>0&&"booked"!==a.state&&(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".1em",color:ed.textFaint,marginTop:5},children:c.join(" \xb7 ").toUpperCase()}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginTop:9},children:[(0,f.jsx)(Pp,{bg:x.bg,fg:x.fg,children:x.label}),a.countdown&&(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9.5,letterSpacing:".1em",color:ed.textFaint},children:a.countdown.toUpperCase()}),(null===(t=a.travel_fee)||void 0===t?void 0:t.amount)>0&&(0,f.jsxs)(Pp,{bg:ed.warnBg,fg:ed.warnFg,title:a.travel_fee.label,children:["+ TRAVEL ",Gm(a.travel_fee.amount)]}),"booked"===a.state&&a.crew_locked&&(0,f.jsxs)(Pp,{bg:id.locked.bg,fg:id.locked.fg,children:[(0,f.jsx)(ht.A,{size:9,style:{marginRight:4,verticalAlign:-1}}),"LOCKED"]})]})]}),(0,f.jsxs)("div",{className:"ka-event-right",style:{textAlign:"right"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".16em",color:ed.textFaint},children:h}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:16,fontWeight:700,margin:"5px 0 11px"},children:u}),(0,f.jsx)("div",{className:"ka-actions",style:{display:"flex",gap:8,justifyContent:"flex-end",flexWrap:"wrap"},children:"booked"===a.state?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Rp,{row:a}),!a.crew_locked&&(0,f.jsx)(Op,{onClick:()=>r(a),children:"Modify package"}),(0,f.jsx)(Wp,{onClick:()=>i(a),children:"View job"})]}):(0,f.jsx)(Wp,{onClick:()=>r(a),children:g})})]})]})}function Rp(e){let{row:t}=e;const s="published"===t.runsheet_state;return(0,f.jsxs)("span",{title:s?"Open the runsheet for this event":"Runsheet is published about three weeks before the event",style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid ".concat(ed.paperBorder),borderRadius:9,padding:"9px 13px",fontFamily:td,fontSize:13,fontWeight:700,color:s?ed.textPrimary:ed.textMuted,cursor:s?"pointer":"default"},onClick:()=>{s&&window.open("/corporate-runsheet/".concat(t.event_id),"_blank","noopener")},children:[(0,f.jsx)(kt.A,{size:14,strokeWidth:2.2}),"Runsheet",!s&&(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:8.5,letterSpacing:".12em",color:ed.textFaint},children:"SOON"})]})}const Pp=e=>{let{bg:t,fg:s,children:a,title:n}=e;return(0,f.jsx)("span",{title:n,style:{background:t,color:s,borderRadius:5,padding:"4px 8px",fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".14em",display:"inline-flex",alignItems:"center"},children:a})},Wp=e=>{let{onClick:t,children:s,disabled:a}=e;return(0,f.jsx)("button",{type:"button",className:"ka-primary",onClick:t,disabled:a,style:{background:ed.red,color:"#fff",border:"none",borderRadius:9,padding:"10px 16px",fontFamily:td,fontSize:13,fontWeight:700,cursor:a?"default":"pointer",opacity:a?.55:1,display:"inline-flex",alignItems:"center",gap:7},children:s})},Op=e=>{let{onClick:t,children:s}=e;return(0,f.jsx)("button",{type:"button",className:"ka-ghost-btn",onClick:t,style:{background:"#fff",color:ed.textPrimary,border:"1px solid ".concat(ed.paperBorder),borderRadius:9,padding:"9px 14px",fontFamily:td,fontSize:13,fontWeight:700,cursor:"pointer"},children:s})};var Lp=s(25819);const Mp=e=>{let{children:t,style:s,pad:a=!0}=e;return(0,f.jsx)("div",{style:(0,m.A)({background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:14,padding:a?18:0},s),children:t})},qp=e=>{let{children:t,action:s}=e;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,margin:"4px 0 12px"},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:t}),s]})},Hp=e=>{let{children:t,tone:s}=e;return(0,f.jsx)("div",{style:{background:"warn"===s?"#FFFBEB":"#FBFBFC",border:"1px solid ".concat("warn"===s?"#FDE68A":ed.adminBorder),borderRadius:12,padding:"13px 16px",fontSize:13,color:"warn"===s?"#92400E":ed.textSecondary,marginBottom:14},children:t})},Up=e=>{let{children:t}=e;return(0,f.jsx)("div",{style:{padding:"38px 18px",textAlign:"center",color:ed.textMuted,fontSize:14},children:t})},Gp=e=>{let{pad:t=50}=e;return(0,f.jsx)("div",{style:{padding:"".concat(t,"px 0"),textAlign:"center",color:ed.textMuted},children:(0,f.jsx)(Kr.A,{size:20,style:{animation:"ka-spin .9s linear infinite"}})})},Vp=e=>
1{let{label:t,hint:s,children:a}=e;return(0,f.jsxs)("label",{style:{display:"grid",gap:6},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:ed.textFaint},children:t}),a,s&&(0,f.jsx)("span",{style:{fontSize:11.5,color:ed.textMuted},children:s})]})},Jp=e=>{let{bg:t,fg:s,children:a,title:n}=e;return(0,f.jsx)("span",{title:n,style:{background:t,color:s,borderRadius:5,padding:"3px 7px",fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".12em",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",gap:4},children:a})},Yp={color:ed.red,textDecoration:"none"},Kp={width:"100%",boxSizing:"border-box",background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:9,padding:"10px 12px",fontFamily:sd,fontSize:13.5,color:ed.textPrimary,outline:"none"},Zp={background:ed.red,color:"#fff",border:"none",borderRadius:9,padding:"10px 16px",fontFamily:td,fontSize:13,fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:7},$p={background:"#fff",color:ed.textPrimary,border:"1px solid ".concat(ed.adminBorder),borderRadius:9,padding:"9px 14px",fontFamily:td,fontSize:12.5,fontWeight:700,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:7},Qp=(ed.carbon,e=>{let{title:t,subtitle:s,onClose:a,children:n,footer:r,wide:i}=e;return(0,f.jsx)("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:70,background:"rgba(10,10,11,.45)",display:"flex",justifyContent:"flex-end"},onClick:e=>{e.target===e.currentTarget&&a()},children:(0,f.jsxs)("div",{style:{background:ed.adminCanvas,width:i?620:480,maxWidth:"100%",height:"100%",display:"flex",flexDirection:"column",boxShadow:"-12px 0 40px rgba(10,10,11,.18)"},children:[(0,f.jsxs)("div",{style:{background:"#fff",borderBottom:"1px solid ".concat(ed.adminBorder),padding:"18px 20px"},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:16,fontWeight:700},children:t}),s&&(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:3},children:s})]}),(0,f.jsx)("div",{style:{flex:1,overflow:"auto",padding:20},children:n}),r&&(0,f.jsx)("div",{style:{background:"#fff",borderTop:"1px solid ".concat(ed.adminBorder),padding:"14px 20px",display:"flex",gap:9,justifyContent:"flex-end"},children:r})]})})}),Xp=e=>{let{value:t,onChange:s,placeholder:a,rows:n=1}=e;return(0,f.jsxs)("div",{style:{display:"grid",gap:8},children:[(t||[]).map((e,a)=>(0,f.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[n>1?(0,f.jsx)("textarea",{value:e,rows:n,onChange:e=>{const n=[...t];n[a]=e.target.value,s(n)},style:(0,m.A)((0,m.A)({},Kp),{},{resize:"vertical"})}):(0,f.jsx)("input",{value:e,onChange:e=>{const n=[...t];n[a]=e.target.value,s(n)},style:Kp}),(0,f.jsx)("button",{type:"button",onClick:()=>s(t.filter((e,t)=>t!==a)),title:"Remove",style:(0,m.A)((0,m.A)({},$p),{},{padding:"9px 11px",flexShrink:0}),children:"\xd7"})]},a)),(0,f.jsxs)("button",{type:"button",onClick:()=>s([...t||[],""]),style:(0,m.A)((0,m.A)({},$p),{},{justifySelf:"start"}),children:["+ ",a||"Add line"]})]})},ex="#FEF7F6",tx=e=>"".concat(e,"-").concat(Date.now().toString(36)).concat(Math.random().toString(36).slice(2,6));function sx(e){let{account:t,api:s,onSaved:n}=e;const[r,i]=(0,a.useState)(null),[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),[h,u]=(0,a.useState)(null);(0,a.useEffect)(()=>{s.request("/catalogue").then(e=>{var t;const s=function(e){return(0,m.A)((0,m.A)({},e),{},{packages:(e.packages||[]).map(e=>(0,m.A)({crew:[],items:{},extra_lines:[],offer_default:!1,is_default:!1},e)),custom_build:!!e.custom_build,roles:(e.roles||[]).map(e=>(0,m.A)({rates:{},offer_default:!0},e)),items:(e.items||[]).map(e=>(0,m.A)({offer_default:!0},e)),durations:e.durations||[],terms:(0,m.A)({proposal_notes:[]},e.terms||{}),gst_rate:null==e.gst_rate?.1:e.gst_rate})}(e.catalogue);i(s),u((null===(t=s.packages[0])||void 0===t?void 0:t.id)||null)}).catch(e=>d(e.message))},[s]);if(c&&!r)return(0,f.jsx)(Hp,{tone:"warn",children:c});if(!r)return(0,f.jsx)(Gp,{});const g=e=>i(t=>(0,m.A)((0,m.A)({},t),e)),b=Number(r.gst_rate)||0;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(Hp,{tone:"warn",children:["Price changes apply to ",(0,f.jsx)("strong",{children:"future quotes only"}),". Every confirmed booking keeps the figures it was signed at, so nothing already agreed moves."]}),c&&(0,f.jsx)(Hp,{tone:"warn",children:c}),(0,f.jsx)(nx,{cat:r,account:t}),(0,f.jsx)(ax,{n:1,title:"Crew rates & time on site",blurb:"What each role costs for each length of day. Packages are built from these, and clients price their own builds from them.",children:(0,f.jsx)(mx,{cat:r,set:g})}),(0,f.jsx)(ax,{n:2,title:"Deliverables & optional extras",blurb:"What you hand back, and what clients can add on. Both can be bundled into a package or sold separately.",children:(0,f.jsx)(px,{items:r.items,onChange:e=>g({items:e})})}
1),(0,f.jsx)(ax,{n:3,title:"Packages",blurb:"A bundle of the above at one fixed price. What the client reads is built from what you tick, so renaming a role updates every package using it.",children:(0,f.jsx)(ix,{cat:r,set:g,sel:h,setSel:u,gstRate:b,account:t})}),(0,f.jsx)(ax,{n:4,title:"Terms",blurb:"Shown to the client on the screen where they sign.",children:(0,f.jsx)(xx,{cat:r,set:g,account:t})}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",marginTop:18},children:[(0,f.jsxs)("button",{type:"button",onClick:async()=>{l(!0),d(""),x(!1);try{await s.request("/catalogue",{method:"PUT",body:JSON.stringify({packages:r.packages,custom_build:!!r.custom_build,roles:r.roles,items:r.items,durations:r.durations,gst_rate:Number(r.gst_rate),terms:r.terms})}),x(!0),setTimeout(()=>x(!1),2600),null===n||void 0===n||n()}catch(e){d(e.message)}finally{l(!1)}},disabled:o,style:Zp,children:[o&&(0,f.jsx)(Kr.A,{size:15,style:{animation:"ka-spin .9s linear infinite"}}),o?"Saving\u2026":"Save changes"]}),p&&(0,f.jsxs)("span",{style:{color:ed.successFg,fontSize:13,fontWeight:600,display:"inline-flex",alignItems:"center",gap:6},children:[(0,f.jsx)(zt.A,{size:15,strokeWidth:2.6})," Saved"]})]})]})}const ax=e=>{let{n:t,title:s,blurb:a,children:n}=e;return(0,f.jsxs)("section",{style:{marginTop:24},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:11,alignItems:"flex-start",marginBottom:12},children:[(0,f.jsx)("span",{style:{width:26,height:26,borderRadius:8,background:ed.carbon,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:ad,fontSize:12,fontWeight:700,flexShrink:0},children:t}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:16,fontWeight:700},children:s}),(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:2,maxWidth:720,lineHeight:1.5},children:a})]})]}),n]})};function nx(e){let{cat:t,account:s}=e;const a=t.durations||[],n=t.roles||[],r=n.reduce((e,t)=>e+a.filter(e=>{var s;return Number((null===(s=t.rates)||void 0===s?void 0:s[e.id])||0)>0}).length,0),i=n.length*a.length,o=(t.items||[]).filter(e=>"deliverable"===e.scope).length,l=(t.items||[]).filter(e=>"extra"===e.scope).length,c=[{label:"Crew rates",value:0===n.length?"no roles yet":"".concat(n.length," role").concat(1===n.length?"":"s"," \xb7 ").concat(r," of ").concat(i," rate").concat(1===i?"":"s"," set"),warn:0===n.length||r<i,hint:0===n.length?"Add a role below":r<i?"A blank rate means that length of day isn\u2019t offered":null},{label:"Deliverables",value:o||"none yet",warn:0===o,hint:0===o?"Nothing to bundle into a package yet":null},{label:"Extras",value:l||"none yet",warn:!1},{label:"Packages",value:t.packages.length||(t.custom_build?"none \u2014 clients build their own":"none yet"),warn:0===t.packages.length&&!t.custom_build,hint:0!==t.packages.length||t.custom_build?null:"Clients can\u2019t book anything until there\u2019s a package or Build your own"}];return(0,f.jsxs)(Mp,{style:{marginTop:4},children:[(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint,marginBottom:12},children:["WHAT\u2019S SET UP FOR ",s.name.toUpperCase()]}),(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(200px,1fr))",gap:12},children:c.map(e=>(0,f.jsxs)("div",{style:{background:e.warn?"#FFFBEB":"#FBFBFC",border:"1px solid ".concat(e.warn?"#FDE68A":ed.adminBorder),borderRadius:10,padding:"11px 13px"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:7,alignItems:"baseline"},children:[(0,f.jsx)("span",{style:{fontSize:12.5,fontWeight:600},children:e.label}),e.warn&&(0,f.jsx)("span",{style:{color:"#92400E",fontFamily:ad,fontSize:11,fontWeight:700},children:"!"})]}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:12,color:e.warn?"#92400E":ed.textSecondary,marginTop:4},children:e.value}),e.hint&&(0,f.jsx)("div",{style:{fontSize:11.5,color:ed.textMuted,marginTop:5,lineHeight:1.45},children:e.hint})]},e.label))})]})}function rx(e,t){const s=Object.fromEntries((t.roles||[]).map(e=>[e.id,e])),a=Object.fromEntries((t.items||[]).map(e=>[e.id,e]));return[...(e.crew||[]).map(e=>{const a=s[e.role];if(!a)return null;const n=Number(e.count||1);return"".concat(n>1?"".concat(n," \xd7 "):"").concat(a.label," \xb7 ").concat((e=>{var s;return(null===(s=(t.durations||[]).find(t=>
1t.id===e))||void 0===s?void 0:s.label)||e})(e.duration)," on site")}).filter(Boolean),...Object.entries(e.items||{}).map(e=>{let[t,s]=e;const n=a[t],r=Number(s||0);if(!n||r<=0)return null;const i=r>1&&n.quantity_based?"".concat(r," \xd7 "):"",o=Number(n.price||0)>0?"":" \xb7 included";return"".concat(i).concat(n.label).concat(o)}).filter(Boolean),...(e.extra_lines||[]).filter(e=>String(e).trim())]}function ix(e){var t;let{cat:s,set:a,sel:n,setSel:r,gstRate:i,account:o}=e;const l=s.packages.find(e=>e.id===n)||null,c=e=>a({packages:s.packages.map(t=>t.id===n?(0,m.A)((0,m.A)({},t),e):t)});return(0,f.jsxs)("div",{className:"kap-grid",style:{display:"grid",gridTemplateColumns:"320px minmax(0,1fr)",gap:16,alignItems:"start"},children:[(0,f.jsx)("style",{children:"@media (max-width: 1100px) {\n .kap-grid { grid-template-columns: 1fr !important; }\n .kap-menu { position: static !important; }\n .kap-crew-row { grid-template-columns: 1fr auto !important; }\n }"}),(0,f.jsxs)("div",{className:"kap-menu",style:{position:"sticky",top:84},children:[(0,f.jsxs)(Mp,{pad:!1,style:{overflow:"hidden"},children:[(0,f.jsxs)("div",{style:{padding:"14px 16px",borderBottom:"1px solid ".concat(ed.adminBorder),display:"flex",alignItems:"center",gap:10},children:[(0,f.jsxs)("div",{style:{flex:1},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:"PACKAGES"}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:3},children:[s.packages.length," on the menu"]})]}),(0,f.jsxs)("button",{type:"button",onClick:()=>{const e=tx("pkg");a({packages:[...s.packages,{id:e,label:"New package",sublabel:"",price:0,offer_default:!1,is_default:!1,crew:[],items:{},extra_lines:[]}]}),r(e)},style:(0,m.A)((0,m.A)({},Zp),{},{padding:"7px 12px",fontSize:12}),children:[(0,f.jsx)(ls.A,{size:13})," New"]})]}),0===s.packages.length&&(0,f.jsx)("div",{style:{padding:"26px 16px",fontSize:13,color:ed.textMuted,textAlign:"center"},children:"No packages yet. Add one, or leave the menu empty and let clients build from the rate card."}),s.packages.map(e=>{const t=e.id===n,s=Object.values(e.items||{}).filter(e=>Number(e)>0).length;return(0,f.jsxs)("button",{type:"button",onClick:()=>r(e.id),style:{width:"100%",textAlign:"left",cursor:"pointer",background:t?ex:"#fff",border:"none",borderLeft:"3px solid ".concat(t?ed.red:"transparent"),borderBottom:"1px solid ".concat(ed.adminBorder),padding:"13px 15px"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"baseline",justifyContent:"space-between"},children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:13.5,fontWeight:700},children:e.label}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:12,fontWeight:700,whiteSpace:"nowrap"},children:Gm(e.price)})]}),(0,f.jsxs)("div",{style:{fontSize:12,color:ed.textSecondary,marginTop:3},children:[(e.crew||[]).length," crew \xb7 ",s," deliverable",1===s?"":"s",(e.extra_lines||[]).length?" \xb7 + extras":""]}),(0,f.jsx)("div",{style:{marginTop:7},children:e.is_default?(0,f.jsx)(ux,{bg:"#3A1A1D",fg:ed.amber,children:"PRE-SELECTED"}):e.offer_default?(0,f.jsx)(ux,{bg:ed.successBg,fg:ed.successFg,children:"DEFAULT"}):(0,f.jsx)(ux,{bg:"#F2F2F5",fg:"#7A7A82",children:"OPT-IN"})})]},e.id)}),(0,f.jsxs)("label",{style:{display:"flex",gap:10,alignItems:"flex-start",padding:"13px 15px",cursor:"pointer",background:s.custom_build?ex:"#FBFBFC"},children:[(0,f.jsx)("input",{type:"checkbox",checked:!!s.custom_build,onChange:e=>a({custom_build:e.target.checked}),style:{marginTop:2}}),(0,f.jsxs)("span",{children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:13,fontWeight:700},children:"Build your own"}),(0,f.jsx)("span",{style:{display:"block",fontSize:12,color:ed.textSecondary,marginTop:2},children:"Clients can assemble crew and time from the rate card instead of taking a package."})]})]})]}),(0,f.jsxs)("div",{style:{fontSize:12,color:ed.textMuted,marginTop:9,lineHeight:1.55},children:["These are the defaults. What any single ",o.nouns.item," offers is set on its row."]})]}),l?(0,f.jsxs)("div",{style:{display:"grid",gap:14},children:[(0,f.jsxs)(hx,{n:1,title:"Name & price",children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1.4fr 1fr",gap:12},children:[(0,f.jsx)(Vp,{label:"PACKAGE NAME",children:(0,f.jsx)("input",{value:l.label,onChange:e=>c({label:e.target.value}),style:(0,m.A)((0,m.A)({},Kp),{},{fontSize:15,fontWeight:600})})}),(0,f.jsx)(Vp,{label:"PRICE PER EVENT \xb7 EX GST",children:(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",value:null!==(t=l.price)&&void 0!==t?t:0,onChange:e=>c({price:Number(e.target.value)}),style:(0,m.A)((0,m.A)({},Kp),{},{fontFamily:ad,fontWeight:700})})})]}),(0,f.jsx)(ox,{pkg:l,cat:s,gstRate:i}),(0,f.jsx)("div",{style:{marginTop:12},children:(0,f.jsx)(Vp,{label:"SUBTITLE",hint:"One line under the name in their portal",children:(0,f.jsx)("input",{value:l.sublabel||"",onChange:e=>c({sublabel:e.target.value}),style:Kp})})})]}),(0,f.jsxs)(hx,{n:2,title:"What's in it",children:[(0,f.jsx)(lx,{pkg:l,cat:s,setPkg:c}),(0,f.jsx)("div",{style:{height:18}}),(0,f.jsx)(cx,{pkg:l,cat:s,setPkg:c}),(0,f.jsx)("div",{style:{height:18}}),(0,f.jsx)(qp,{children:"ANYTHING ELSE TO PROMISE \xb7 FREE TEXT"}),(0,f.jsx)(Xp,{value:l.extra_lines||[],onChange:e=>c({extra_lines:e}),placeholder:"Add a line"})]}),(0,f.jsx)(hx,{n:3,title:"Where it's offered",children:(0,f.jsxs)("div",{className:"kap-2up",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{style:{display:"grid",gap:10},children:[(0,f.jsx)(fx,{on:!!l.offer_default,onToggle:()=>c({offer_default:!l.offer_default}),title:"Offered on new events by default",detail:"Pre-ticked when you add a ".concat(o.nouns.item,". You can still change it per event.")}),(0,f.jsx)(fx,{radio:!0,on:!!l.is_default,onToggle:()=>a({packages:s.packages.map(e=>(0,m.A)((0,m.A)({},e),{},{is_default:e.id===l.id&&!l.is_default}))}),title:"Pre-selected for the client",detail:"Opens already chosen, marked RECOMMENDED. Only one package can be."}),(0,f.jsxs)("div",{style:{display:"flex",gap:9,marginTop:4},children:[(0,f.jsxs)("button",{type:"button",style:$p,onClick:()=>{const e=(0,m.A)((0,m.A)({},JSON.parse(JSON.stringify(l))),{},{id:tx("pkg"),label:"".concat(l.label," (copy)"),is_default:!1});a({packages:[...s.packages,e]}),r(e.id)},children:[(0,f.jsx)(Cr.A,{size:13})," Duplicate"]}),(0,f.jsxs)("button",{type:"button",onClick:()=>{var e;const t=s.packages.filter(e=>e.id!==l.id);a({packages:t}),r((null===(e=t[0])||void 0===e?void 0:e.id)||null)},style:(0,m.A)((0,m.A)({},$p),{},{color:ed.dangerFg,borderColor:"#FCA5A5"}),children:[(0,f.jsx)(la.A,{size:13})," Delete package"]})]})]}),(0,f.jsx)(dx,{pkg:l,cat:s,gstRate:i})]})})]}):(0,f.jsx)("div",{style:{border:"1px dashed #C9C9D0",borderRadius:14,padding:"60px 20px",textAlign:"center",color:ed.textMuted,fontSize:14},children:"Select a package on the left, or add a new one."})]})}function ox(e){let{pkg:t,cat:s,gstRate:a}=e;const n=function(e,t){const s=Object.fromEntries((t.roles||[]).map(e=>[e.id,e])),a=Object.fromEntries((t.items||[]).map(e=>[e.id,e]));let n=0;
1return(e.crew||[]).forEach(e=>{var t,a;const r=Number((null===(t=s[e.role])||void 0===t||null===(a=t.rates)||void 0===a?void 0:a[e.duration])||0);n+=r*Number(e.count||1)}),Object.entries(e.items||{}).forEach(e=>{let[t,s]=e;const r=a[t];if(!r)return;const i=r.quantity_based?Number(s||0):Math.min(Number(s||0),1);n+=Number(r.price||0)*i}),Math.round(100*n)/100}(t,s),r=Number(t.price||0);if(!n)return(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textMuted,marginTop:7},children:[Gm(r*(1+a))," inc GST. Compose the package from the rate card below to see what it would cost billed line by line."]});const i=Math.round(100*(n-r))/100,o=n?Math.round(i/n*100):0,l=i>0?ed.successFg:i<0?ed.warnFg:ed.textMuted,c=i>0?"Rate-card value ".concat(Gm(n)," \u2014 client saves ").concat(Gm(i)," (").concat(o,"%)"):i<0?"Rate-card value ".concat(Gm(n)," \u2014 priced ").concat(Gm(-i)," above it"):"Matches the rate-card value of ".concat(Gm(n));return(0,f.jsxs)("div",{style:{fontSize:12.5,color:l,marginTop:7,fontWeight:600},children:[c," \xb7 ",Gm(r*(1+a))," inc GST"]})}function lx(e){let{pkg:t,cat:s,setPkg:a}=e;const n=s.roles||[],r=(e,s)=>a({crew:t.crew.map((t,a)=>a===e?(0,m.A)((0,m.A)({},t),s):t)});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(qp,{children:"CREW ON SITE"}),(0,f.jsxs)("div",{style:{display:"grid",gap:8},children:[(t.crew||[]).map((e,i)=>{var o;const l=n.find(t=>t.id===e.role),c=Number((null===l||void 0===l||null===(o=l.rates)||void 0===o?void 0:o[e.duration])||0);return(0,f.jsxs)("div",{className:"kap-crew-row",style:{background:"#FBFBFC",borderRadius:10,padding:12,display:"grid",gridTemplateColumns:"1fr auto",gap:10,alignItems:"center"},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600},children:(null===l||void 0===l?void 0:l.label)||e.role}),(0,f.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginTop:8},children:[(s.durations||[]).map(t=>{var s;const a=Number((null===l||void 0===l||null===(s=l.rates)||void 0===s?void 0:s[t.id])||0)>0,n=e.duration===t.id;return a?(0,f.jsx)("button",{type:"button",onClick:()=>r(i,{duration:t.id}),style:{background:n?ex:"#fff",border:"1px solid ".concat(n?ed.red:ed.adminBorder),borderRadius:8,padding:"5px 10px",fontFamily:td,fontSize:12,fontWeight:700,cursor:"pointer"},children:t.label},t.id):(0,f.jsxs)("button",{type:"button",onClick:()=>function(e){const t=document.getElementById("kap-role-".concat(e))||document.getElementById("kap-ratecard");if(!t)return;t.scrollIntoView({behavior:"smooth",block:"center"}),t.style.transition="background .3s",t.style.background="#FEF7F6",setTimeout(()=>{t.style.background=""},1800)}(null===l||void 0===l?void 0:l.id),title:"No ".concat(t.label," rate for ").concat((null===l||void 0===l?void 0:l.label)||"this role"," yet \u2014 set one in the rate card"),style:{background:"none",border:"1px dashed #C9C9D0",color:ed.textMuted,borderRadius:8,padding:"5px 10px",fontFamily:td,fontSize:12,fontWeight:700,cursor:"pointer"},children:[t.label," \xb7 set a rate"]},t.id)}),0===(s.durations||[]).length&&(0,f.jsx)("span",{style:{fontSize:12,color:ed.textMuted},children:"No durations yet \u2014 add one in the rate card below."})]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[(0,f.jsx)(yx,{value:Number(e.count||1),onChange:e=>r(i,{count:Math.max(1,e)})}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:12,color:ed.textSecondary,minWidth:70,textAlign:"right"},children:c?Gm(c*Number(e.count||1)):"\u2014"}),(0,f.jsx)("button",{type:"button",onClick:()=>a({crew:t.crew.filter((e,t)=>t!==i)}),style:(0,m.A)((0,m.A)({},$p),{},{padding:"7px 9px"}),children:"\xd7"})]})]},i)}),0===(t.crew||[]).length&&(0,f.jsx)("div",{style:{fontSize:13,color:ed.textMuted},children:"No crew lines \u2014 the package is described in free text below."})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:7,flexWrap:"wrap",marginTop:10,alignItems:"center"},children:[(0,f.jsx)("span",{style:{fontSize:12.5,color:ed.textSecondary},children:"Add:"}),n.map(e=>(0,f.jsxs)("button",{type:"button",onClick:()=>{var n,r;return a({crew:[...t.crew||[],{role:e.id,duration:(null===(n=(s.durations||[]).find(t=>{var s;return Number((null===(s=e.rates)||void 0===s?void 0:s[t.id])||0)>0}))||void 0===n?void 0:n.id)||(null===(r=(s.durations||[])[0])||void 0===r?void 0:r.id),count:1}]})},style:{background:"none",border:"1px dashed #C9C9D0",borderRadius:8,padding:"5px 10px",fontFamily:td,fontSize:12,fontWeight:700,cursor:"pointer",color:ed.textSecondary},children:["+ ",e.label]},e.id)),0===n.length&&(0,f.jsx)("span",{style:{fontSize:12.5,color:ed.textMuted}
1,children:"Add a crew role to the rate card first."})]})]})}function cx(e){let{pkg:t,cat:s,setPkg:a}=e;const n=(e,s)=>{const n=(0,m.A)({},t.items||{});s<=0?delete n[e]:n[e]=s,a({items:n})},r=(e,a,r)=>{const i=(s.items||[]).filter(t=>t.scope===e);return(0,f.jsxs)("div",{style:{marginTop:14},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:ed.textFaint,marginBottom:8},children:a}),0===i.length?(0,f.jsxs)("div",{style:{background:"#FBFBFC",border:"1px dashed #C9C9D0",borderRadius:10,padding:"12px 14px",fontSize:12.5,color:ed.textSecondary},children:["No ",a.toLowerCase()," on this account yet. ",r," ",(0,f.jsx)("button",{type:"button",onClick:()=>function(e){const t=document.getElementById("kap-items-".concat(e))||document.getElementById("kap-items");t&&(t.scrollIntoView({behavior:"smooth",block:"center"}),t.style.transition="background .3s",t.style.background="#FEF7F6",setTimeout(()=>{t.style.background=""},1800))}(e),style:{background:"none",border:"none",padding:0,cursor:"pointer",color:ed.red,fontFamily:td,fontSize:12.5,fontWeight:700},children:"Add one below \u2192"})]}):(0,f.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:i.map(e=>{const s=Number((t.items||{})[e.id]||0),a=s>0;return(0,f.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:9,background:a?ex:"#fff",border:"1px solid ".concat(a?ed.red:ed.adminBorder),borderRadius:999,padding:"6px 12px"},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>n(e.id,a?0:1),style:{background:"none",border:"none",padding:0,cursor:"pointer",display:"inline-flex",alignItems:"center",gap:7},children:[a&&(0,f.jsx)(zt.A,{size:12,strokeWidth:3,color:ed.successFg}),(0,f.jsx)("span",{style:{fontSize:12.5,fontWeight:600},children:e.label})]}),a&&e.quantity_based&&(0,f.jsx)(yx,{small:!0,value:s,onChange:t=>n(e.id,Math.max(1,t))}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:11,color:ed.textFaint},children:Number(e.price)>0?Gm(e.price):"included"})]},e.id)})})]})};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(qp,{children:"WHAT\u2019S BUNDLED INTO THE PRICE"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary},children:"Tick anything this package includes. The client sees it as a tick in the list, not as a separate charge \u2014 the package price already covers it."}),r("deliverable","DELIVERABLES","These are the things you hand back \u2014 galleries, edits, selects."),r("extra","EXTRAS","These are the add-ons clients can buy on top.")]})}function dx(e){let{pkg:t,cat:s,gstRate:a}=e;const n=rx(t,s);return(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:"#B5B5BC",marginBottom:8},children:"HOW IT LOOKS IN THEIR PORTAL"}),(0,f.jsx)("div",{style:{background:"#F4F2EE",border:"1px solid #E2DED6",borderRadius:12,padding:14},children:(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid #E2DED6",borderRadius:10,padding:15},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:t.label}),t.sublabel&&(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:3},children:t.sublabel}),(0,f.jsxs)("div",{style:{display:"grid",gap:6,marginTop:12},children:[n.map(e=>(0,f.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[(0,f.jsx)(zt.A,{size:12,strokeWidth:3,color:ed.successFg,style:{flexShrink:0,marginTop:3}}),(0,f.jsx)("span",{style:{fontSize:12.5,lineHeight:1.45},children:e})]},e)),0===n.length&&(0,f.jsx)("span",{style:{fontSize:12.5,color:ed.textMuted},children:"Nothing in it yet."})]}),(0,f.jsxs)("div",{style:{borderTop:"1px solid #F1EFE9",marginTop:13,paddingTop:11,display:"flex",alignItems:"baseline",justifyContent:"space-between"},children:[(0,f.jsxs)("span",{style:{fontFamily:ad,fontSize:9,letterSpacing:".14em",color:"#B5B5BC"},children:["EX GST \xb7 ",Gm(Number(t.price||0)*(1+a))," INC"]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:16,fontWeight:700},children:Gm(t.price)})]}),(0,f.jsx)("div",{style:{background:ed.red,color:"#fff",borderRadius:9,padding:"10px 14px",textAlign:"center",fontFamily:td,fontSize:13,fontWeight:700,marginTop:12},children:"Confirm package"})]})})]})}function mx(e){let{cat:t,set:s}=e;const n=t.durations||[],r=(e,a)=>s({roles:t.roles.map((t,s)=>s===e?(0,m.A)((0,m.A)({},t),a):t)}),[i,o]=(0,a.useState)(null);return(0,f.jsxs)(Mp,{style:{scrollMarginTop:90},children:[(0,f.jsx)("div",{id:"kap-ratecard",style:{display:"flex",gap:14,alignItems:"flex-start",justifyContent:"space-between",flexWrap:"wrap",marginBottom:14},children:(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:"RATE CARD"}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:16,fontWeight:700,marginTop:5},children:"Crew roles & time on site"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:3},children:"Packages are composed from these, and clients price their own builds from them."})]})}),(0,f.jsx)("div",{style:{overflowX:"auto"},children:(0,f.jsxs)("div",{style:{minWidth:560},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"minmax(220px,1.4fr) repeat(".concat(n.length,", minmax(120px,1fr)) 40px"),gap:8,alignItems:"end",paddingBottom:8},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:ed.textFaint},children:"ROLE"}),n.map((e,a)=>{var r;return(0,f.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:4},children:[(0,f.jsx)("input",{value:e.label,onChange:e=>s({durations:n.map((t,s)=>s===a?(0,m.A)((0,m.A)({},t),{},{label:e.target.value}):t)}),style:(0,m.A)((0,m.A)({},Kp),{},{padding:"6px 8px",fontSize:12})}),(0,f.jsx)("button",{type:"button",title:"Remove this duration",onClick:()=>{const e=n[a].id;s({durations:n.filter((e,t)=>
1t!==a),roles:t.roles.map(t=>{const s=(0,m.A)({},t.rates);return delete s[e],(0,m.A)((0,m.A)({},t),{},{rates:s})})})},style:(0,m.A)((0,m.A)({},$p),{},{padding:"6px 8px"}),children:"\xd7"})]}),(0,f.jsx)("input",{type:"number",step:"0.5",min:"0",value:null!==(r=e.days)&&void 0!==r?r:1,onChange:e=>s({durations:n.map((t,s)=>s===a?(0,m.A)((0,m.A)({},t),{},{days:Number(e.target.value)}):t)}),style:(0,m.A)((0,m.A)({},Kp),{},{padding:"5px 8px",fontSize:11.5,fontFamily:ad})})]},e.id)}),(0,f.jsx)("button",{type:"button",title:"Add a duration",onClick:()=>s({durations:[...n,{id:tx("dur"),label:"New",days:1}]}),style:(0,m.A)((0,m.A)({},$p),{},{padding:"7px 9px"}),children:(0,f.jsx)(ls.A,{size:13})})]}),t.roles.map((e,a)=>(0,f.jsxs)("div",{id:"kap-role-".concat(e.id),style:{borderTop:"1px solid ".concat(ed.adminBorder),padding:"12px 0",scrollMarginTop:90,borderRadius:8},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"minmax(220px,1.4fr) repeat(".concat(n.length,", minmax(120px,1fr)) 40px"),gap:8,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{display:"grid",gap:6},children:[(0,f.jsx)("input",{value:e.label,onChange:e=>r(a,{label:e.target.value}),style:Kp}),(0,f.jsx)("input",{value:e.blurb||"",placeholder:"One-line description",onChange:e=>r(a,{blurb:e.target.value}),style:(0,m.A)((0,m.A)({},Kp),{},{fontSize:12.5,padding:"8px 10px"})})]}),n.map(t=>{var s,n;return(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",placeholder:"not offered",value:null!==(s=null===(n=e.rates)||void 0===n?void 0:n[t.id])&&void 0!==s?s:"",onChange:s=>{const n=(0,m.A)({},e.rates||{});""===s.target.value?delete n[t.id]:n[t.id]=Number(s.target.value),r(a,{rates:n})},style:(0,m.A)((0,m.A)({},Kp),{},{fontFamily:ad})},t.id)}),(0,f.jsx)("button",{type:"button",onClick:()=>s({roles:t.roles.filter((e,t)=>t!==a)}),style:(0,m.A)((0,m.A)({},$p),{},{padding:"9px 10px"}),children:(0,f.jsx)(la.A,{size:13})})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:14,alignItems:"center",flexWrap:"wrap",marginTop:9},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>o(i===e.id?null:e.id),style:{background:"none",border:"none",padding:0,cursor:"pointer",color:ed.red,fontFamily:td,fontSize:12,fontWeight:700},children:["Edit inclusions ",i===e.id?"\u25b4":"\u25be"]}),(0,f.jsx)(gx,{on:!1!==e.offer_default,onClick:()=>r(a,{offer_default:!1===e.offer_default}),children:!1!==e.offer_default?"\u2713 Offered on new events":"Not offered by default"}),(0,f.jsx)("span",{style:{fontSize:11.5,color:ed.textMuted},children:"blank rate = that duration isn\u2019t offered for this role"})]}),i===e.id&&(0,f.jsx)("textarea",{rows:4,value:e.inclusions||"",placeholder:"One per line",onChange:e=>r(a,{inclusions:e.target.value}),style:(0,m.A)((0,m.A)({},Kp),{},{resize:"vertical",marginTop:9})})]},e.id))]})}),(0,f.jsxs)("button",{type:"button",style:(0,m.A)((0,m.A)({},$p),{},{marginTop:12}),onClick:()=>s({roles:[...t.roles,{id:tx("role"),label:"New role",blurb:"",rates:{},inclusions:"",offer_default:!0}]}),children:[(0,f.jsx)(ls.A,{size:13})," Add a crew role"]})]})}function px(e){let{items:t,onChange:s}=e;const a=(e,a)=>s(t.map(t=>t.id===e?(0,m.A)((0,m.A)({},t),a):t)),n=(e,n)=>{const r=t.filter(t=>t.scope===e);return(0,f.jsxs)("div",{id:"kap-items-".concat(e),style:{scrollMarginTop:90,borderRadius:10},children:[(0,f.jsxs)(qp,{action:(0,f.jsx)("button",{type:"button",onClick:()=>(e=>s([...t,{id:tx(e),label:"extra"===e?"New extra":"New deliverable",unit:"",price:0,quantity_based:!1,scope:e,description:"",offer_default:!0}]))(e),style:(0,m.A)((0,m.A)({},$p),{},{padding:"5px 9px",fontSize:11.5}),children:(0,f.jsx)(ls.A,{size:12})}),children:[n," \xb7 ",r.length]}),(0,f.jsxs)("div",{style:{display:"grid",gap:10},children:[r.map(n=>{var r;return(0,f.jsxs)("div",{style:{border:"1px solid ".concat(ed.adminBorder),borderRadius:12,padding:12},children:[(0,f.jsxs)("div",{className:"kap-item-row",style:{display:"grid",gridTemplateColumns:"1.4fr 1fr 110px 36px",gap:8,alignItems:"center"},children:[(0,f.jsx)("input",{value:n.label,onChange:e=>a(n.id,{label:e.target.value}),style:Kp}),(0,f.jsx)("input",{value:n.unit||"",placeholder:"per day",onChange:e=>a(n.id,{unit:e.target.value}),style:(0,m.A)((0,m.A)({},Kp),{},{fontSize:12.5})}),(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",value:null!==(r=n.price)&&void 0!==r?r:0,onChange:e=>a(n.id,{price:Number(e.target.value)}),style:(0,m.A)((0,m.A)({},Kp),{},{fontFamily:ad})}),(0,f.jsx)("button",{type:"button",onClick:()=>s(t.filter(e=>
1e.id!==n.id)),style:(0,m.A)((0,m.A)({},$p),{},{padding:"9px 8px"}),children:"\xd7"})]}),(0,f.jsx)("input",{value:n.description||"",placeholder:"Description",onChange:e=>a(n.id,{description:e.target.value}),style:(0,m.A)((0,m.A)({},Kp),{},{marginTop:8,fontSize:12.5})}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginTop:9},children:[(0,f.jsx)(gx,{on:!!n.quantity_based,onClick:()=>a(n.id,{quantity_based:!n.quantity_based}),children:n.quantity_based?"Client picks a quantity":"One per event"}),(0,f.jsx)(gx,{green:!0,on:!1!==n.offer_default,onClick:()=>a(n.id,{offer_default:!1===n.offer_default}),children:!1!==n.offer_default?"\u2713 Offered on new events":"Not offered by default"}),(0,f.jsx)("button",{type:"button",onClick:()=>a(n.id,{scope:"extra"===e?"deliverable":"extra"}),style:{background:"none",border:"none",padding:0,marginLeft:"auto",cursor:"pointer",color:ed.red,fontFamily:td,fontSize:12,fontWeight:700},children:"extra"===e?"Move to deliverables \u2192":"Move to extras \u2192"})]})]},n.id)}),0===r.length&&(0,f.jsx)("div",{style:{fontSize:13,color:ed.textMuted},children:"Nothing yet."})]})]})};return(0,f.jsx)(Mp,{children:(0,f.jsxs)("div",{className:"kap-2col",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:18},children:[(0,f.jsx)("style",{children:"@media (max-width: 1100px) {\n .kap-2col { grid-template-columns: 1fr !important; }\n .kap-item-row { grid-template-columns: 1fr 1fr !important; }\n }"}),n("deliverable","DELIVERABLES"),n("extra","OPTIONAL EXTRAS")]})})}function xx(e){var t;let{cat:s,set:a,account:n}=e;const r=(null===(t=s.terms)||void 0===t?void 0:t.proposal_notes)||[],i=e=>a({terms:(0,m.A)((0,m.A)({},s.terms||{}),{},{proposal_notes:e})}),o=Math.round(100*(Number(s.gst_rate)||0));return(0,f.jsx)(Mp,{children:(0,f.jsxs)("div",{className:"kap-2col2",style:{display:"grid",gridTemplateColumns:"1.2fr 1fr",gap:18},children:[(0,f.jsx)("style",{children:"@media (max-width: 1100px) { .kap-2col2 { grid-template-columns: 1fr !important; } }"}),(0,f.jsxs)("div",{children:[(0,f.jsx)(qp,{children:"TERMS SHOWN BEFORE THE CLIENT SIGNS"}),(0,f.jsx)("div",{style:{display:"grid",gap:8},children:r.map((e,t)=>(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"26px 1fr 36px 36px",gap:7,alignItems:"start"},children:[(0,f.jsx)("span",{style:{width:26,height:26,borderRadius:7,background:"#F2F2F5",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:ad,fontSize:11,fontWeight:700,color:ed.textSecondary},children:t+1}),(0,f.jsx)("textarea",{rows:2,value:e,onChange:e=>i(r.map((s,a)=>a===t?e.target.value:s)),style:(0,m.A)((0,m.A)({},Kp),{},{resize:"vertical",fontSize:12.5})}),(0,f.jsx)("button",{type:"button",disabled:0===t,title:"Move up",onClick:()=>{const e=[...r];[e[t-1],e[t]]=[e[t],e[t-1]],i(e)},style:(0,m.A)((0,m.A)({},$p),{},{padding:"8px 7px",opacity:0===t?.4:1}),children:"\u25b2"}),(0,f.jsx)("button",{type:"button",onClick:()=>i(r.filter((e,s)=>s!==t)),style:(0,m.A)((0,m.A)({},$p),{},{padding:"8px 7px"}),children:"\xd7"})]},t))}),(0,f.jsxs)("button",{type:"button",onClick:()=>i([...r,""]),style:(0,m.A)((0,m.A)({},$p),{},{marginTop:10}),children:[(0,f.jsx)(ls.A,{size:13})," Add a term"]}),(0,f.jsx)("div",{style:{marginTop:16,maxWidth:180},children:(0,f.jsx)(Vp,{label:"GST RATE",hint:"Shown to the client as GST ".concat(o,"%"),children:(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",max:"1",value:s.gst_rate,onChange:e=>a({gst_rate:e.target.value}),style:(0,m.A)((0,m.A)({},Kp),{},{fontFamily:ad})})})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:"#B5B5BC",marginBottom:8},children:"HOW IT LOOKS WHEN THEY SIGN"}),(0,f.jsxs)("div",{style:{background:"#F4F2EE",border:"1px solid #E2DED6",borderRadius:12,padding:16},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.red},children:"CONFIRM YOUR BOOKING"}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700,marginTop:6},children:"Before you sign"}),(0,f.jsx)("ol",{style:{margin:"12px 0 0",paddingLeft:18,display:"grid",gap:6},children:r.filter(Boolean).map((e,t)=>(0,f.jsx)("li",{style:{fontSize:12,lineHeight:1.5,color:ed.textSecondary},children:e},t))}),(0,f.jsxs)("div",{style:{display:"grid",gap:8,marginTop:14},children:[(0,f.jsx)(bx,{children:"I accept these terms"}),(0,f.jsxs)(bx,{children:["I\u2019m authorised to book on behalf of ",n.name]})]}),(0,f.jsx)("div",{style:{background:"#D9D5CC",color:"#fff",borderRadius:9,padding:"10px 14px",textAlign:"center",fontFamily:td,fontSize:13,fontWeight:700,marginTop:14},children:"Confirm & book"})]})]})]})})}const hx=e=>{let{n:t,title:s,children:a}=e;return(0,f.jsxs)(Mp,{children:[(0,f.jsxs)("div",{style:{display:"flex",gap:11,alignItems:"center",marginBottom:14},children:[(0,f.jsx)("span",{style:{width:24,height:24,borderRadius:7,background:ed.carbon,color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:ad,fontSize:11,fontWeight:700},children:t}),(0,f.jsx)("span",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:s})]}),a]})},ux=e=>{let{bg:t,fg:s,children:a}=e;return(0,f.jsx)("span",{style:{background:t,color:s,borderRadius:5,padding:"3px 7px",fontFamily:ad,fontSize:8,fontWeight:700,letterSpacing:".12em"},children:a})}
1,gx=e=>{let{on:t,green:s,onClick:a,children:n}=e;return(0,f.jsx)("button",{type:"button",onClick:a,style:{background:t?s?ed.successBg:ex:"#F2F2F5",color:t?s?ed.successFg:ed.red:"#7A7A82",border:"1px solid ".concat(t?s?"#86EFAC":ed.red:"transparent"),borderRadius:999,padding:"5px 11px",fontFamily:td,fontSize:11.5,fontWeight:700,cursor:"pointer"},children:n})},fx=e=>{let{on:t,onToggle:s,title:a,detail:n,radio:r}=e;return(0,f.jsxs)("label",{style:{display:"flex",gap:10,alignItems:"flex-start",cursor:"pointer",background:t?ex:"#fff",border:"1px solid ".concat(t?ed.red:ed.adminBorder),borderRadius:12,padding:13},children:[(0,f.jsx)("input",{type:r?"radio":"checkbox",checked:t,onChange:s,style:{marginTop:2}}),(0,f.jsxs)("span",{children:[(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600},children:a}),(0,f.jsx)("span",{style:{display:"block",fontSize:12,color:ed.textSecondary,marginTop:3,lineHeight:1.5},children:n})]})]})},bx=e=>{let{children:t}=e;return(0,f.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,f.jsx)("span",{style:{width:15,height:15,borderRadius:4,border:"1px solid #C9C9D0",background:"#fff",flexShrink:0}}),(0,f.jsx)("span",{style:{fontSize:12,color:ed.textSecondary},children:t})]})},yx=e=>{let{value:t,onChange:s,small:a}=e;const n=a?22:28;return(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:5},children:[(0,f.jsx)("button",{type:"button",onClick:()=>s(t-1),style:(0,m.A)((0,m.A)({},vx),{},{width:n,height:n}),children:(0,f.jsx)(md.A,{size:11})}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:a?11.5:13,fontWeight:700,minWidth:16,textAlign:"center"},children:t}),(0,f.jsx)("button",{type:"button",onClick:()=>s(t+1),style:(0,m.A)((0,m.A)({},vx),{},{width:n,height:n}),children:(0,f.jsx)(ls.A,{size:11})})]})},vx={borderRadius:7,border:"1px solid ".concat(ed.adminBorder),background:"#fff",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",padding:0};function jx(e){let{account:t,api:s,rows:n,onChanged:r}=e;const[i,o]=(0,a.useState)(null),[l,c]=(0,a.useState)(""),[d,p]=(0,a.useState)(null),[x,h]=(0,a.useState)(null),u=(0,a.useCallback)(()=>{s.request("/delivery-sources").then(o).catch(e=>{c(e.message),o({galleries:[],videos:[],projects_without_share:[],errors:{}})})},[s]);(0,a.useEffect)(u,[u]);const g=async(e,t)=>{p(e.event_id);try{await s.request("/events/".concat(e.event_id,"/delivery"),{method:"PUT",body:JSON.stringify((0,m.A)((0,m.A)({},e.delivery||{}),t))}),await r()}catch(a){c(a.message)}finally{p(null)}};if(!i)return(0,f.jsx)(Gp,{});const b=[...n].sort((e,t)=>String(t.event_date).localeCompare(String(e.event_date))),y=Object.entries(i.errors||{});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(Hp,{children:["Galleries come from ",(0,f.jsx)("a",{href:"https://iq.turbo.net.au",target:"_blank",rel:"noreferrer noopener",style:Yp,children:"Turbo IQ"}),", video reviews from ",(0,f.jsx)("a",{href:"https://reviews.turbo.net.au",target:"_blank",rel:"noreferrer noopener",style:Yp,children:"Turbo Reviews"}),". Connect them to an event here, then email the client both links together."]}),l&&(0,f.jsx)(Hp,{tone:"warn",children:l}),y.map(e=>{let[t,s]=e;return(0,f.jsxs)(Hp,{tone:"warn",children:["Couldn\u2019t reach ","turbo_iq"===t?"Turbo IQ":"Turbo Reviews"," just now, so its list is empty. Everything else still works. ",(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:11},children:String(s).slice(0,90)})]},t)}),(i.projects_without_share||[]).length>0&&(0,f.jsxs)(Hp,{children:[(0,f.jsxs)("strong",{children:[i.projects_without_share.length," video project",1===i.projects_without_share.length?"":"s"," with no share link yet"]})," \u2014 ",i.projects_without_share.map(e=>e.name).join(", "),"."," ","Create a share bundle in Turbo Reviews and it appears here."]}),0===b.length&&(0,f.jsxs)(Up,{children:["No ",t.nouns.items," yet."]}),(0,f.jsx)("div",{style:{display:"grid",gap:12},children:b.map(e=>{const s=e.delivery||{};return(0,f.jsxs)(Mp,{children:[(0,f.jsxs)("div",{style:{display:"flex",gap:14,justifyContent:"space-between",alignItems:"flex-start",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:e.name}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:2},children:[Vm(e.event_date,e.date_tbc),e.venue?" \xb7 ".concat(e.venue):""]})]}),(0,f.jsxs)("button",{type:"button",disabled:!s.gallery_url&&!s.reviews_project_url,onClick:()=>h(e),style:(0,m.A)((0,m.A)({},Zp),{},{opacity:s.gallery_url||s.reviews_project_url?1:.45}),title:s.gallery_url||s.reviews_project_url?"Email these links to the client":"Connect a gallery or video first",children:[(0,f.jsx)(T.A,{size:14,strokeWidth:2.2})," Email links"]})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(260px,1fr))",gap:12,marginTop:14},children:[(0,f.jsx)(wx,{icon:Jr.A,label:"PHOTO GALLERY",connectedName:s.gallery_name,connectedUrl:s.gallery_url,meta:s.gallery_count?"".concat(s.gallery_count," photos"):"",busy:d===e.event_id,options:(i.galleries||[]).map(e=>({key:e.id,label:e.name,meta:[e.count?"".concat(e.count," photos"):"",e.date||""].filter(
1Boolean).join(" \xb7 "),value:e})),onPick:t=>g(e,t?{gallery_id:t.id,gallery_name:t.name,gallery_url:t.url,gallery_count:t.count}:{gallery_id:"",gallery_name:"",gallery_url:"",gallery_count:null})}),(0,f.jsx)(wx,{icon:Ge.A,label:"VIDEO REVIEW",connectedName:s.reviews_project_name,connectedUrl:s.reviews_project_url,meta:s.reviews_item_count?"".concat(s.reviews_item_count," videos"):"",busy:d===e.event_id,disabled:"PHOTOGRAPHY"===t.serviceTag,disabledNote:"Photography-only account",options:(i.videos||[]).map(e=>({key:e.bundle_id,label:e.name,meta:[e.item_count?"".concat(e.item_count," videos"):"",null!=e.view_count?"".concat(e.view_count," views"):""].filter(Boolean).join(" \xb7 "),value:e})),onPick:t=>g(e,t?{reviews_project_id:t.project_id,reviews_project_name:t.name,reviews_project_url:t.url,reviews_bundle_id:t.bundle_id,reviews_bundle_token:t.token,reviews_item_count:t.item_count}:{reviews_project_id:"",reviews_project_name:"",reviews_project_url:"",reviews_bundle_id:"",reviews_bundle_token:"",reviews_item_count:null})})]})]},e.event_id)})}),x&&(0,f.jsx)(Nx,{account:t,api:s,row:x,onClose:()=>h(null)})]})}function wx(e){let{icon:t,label:s,connectedName:a,connectedUrl:n,meta:r,options:i,onPick:o,busy:l,disabled:c,disabledNote:d}=e;return(0,f.jsxs)("div",{style:{border:"1px solid ".concat(ed.adminBorder),borderRadius:12,padding:12,background:n?"#F7FDF9":"#FBFBFC"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,f.jsx)(t,{size:14,strokeWidth:2.2,color:n?ed.successFg:ed.textFaint}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:ed.textFaint},children:s}),n&&(0,f.jsxs)(Jp,{bg:ed.successBg,fg:ed.successFg,children:[(0,f.jsx)(zt.A,{size:9,strokeWidth:3}),"CONNECTED"]})]}),c?(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textMuted,marginTop:10},children:d}):(0,f.jsxs)(f.Fragment,{children:[n&&(0,f.jsxs)("div",{style:{marginTop:9},children:[(0,f.jsxs)("a",{href:n,target:"_blank",rel:"noreferrer noopener",style:(0,m.A)((0,m.A)({},Yp),{},{fontSize:13.5,fontWeight:600,display:"inline-flex",alignItems:"center",gap:6}),children:[a||"Open"," ",(0,f.jsx)(En.A,{size:12,strokeWidth:2.2})]}),r&&(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10,color:ed.textFaint,marginTop:3},children:r})]}),(0,f.jsxs)("select",{value:"",disabled:l,onChange:e=>{if("__clear__"===e.target.value)return o(null);const t=i.find(t=>String(t.key)===e.target.value);t&&o(t.value)},style:(0,m.A)((0,m.A)({},Kp),{},{marginTop:10,fontSize:12.5,padding:"9px 10px"}),children:[(0,f.jsx)("option",{value:"",children:n?"Change\u2026":i.length?"Connect\u2026":"Nothing available yet"}),i.map(e=>(0,f.jsxs)("option",{value:e.key,children:[e.label,e.meta?" \u2014 ".concat(e.meta):""]},e.key)),n&&(0,f.jsx)("option",{value:"__clear__",children:"\u2014 Disconnect \u2014"})]})]})]})}function Nx(e){let{account:t,api:s,row:n,onClose:r}=e;const[i,o]=(0,a.useState)([]),[l,c]=(0,a.useState)([]),[d,p]=(0,a.useState)(""),[x,h]=(0,a.useState)(!1),[u,g]=(0,a.useState)(""),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)([]);(0,a.useEffect)(()=>{s.request("/contacts").then(e=>{const t=(e.contacts||[]).filter(e=>!e.is_company&&e.email);o(t),c(t.map(e=>e.email))}).catch(()=>{}),s.request("/events/".concat(n.event_id,"/notifications")).then(e=>j(e.notifications||[])).catch(()=>{})},[s,n.event_id]);const w=n.delivery||{};return(0,f.jsxs)(Qp,{title:"Email links \u2014 ".concat(n.name),subtitle:Vm(n.event_date,n.date_tbc),onClose:r,footer:b?(0,f.jsx)("button",{type:"button",onClick:r,style:Zp,children:"Done"}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",onClick:r,style:$p,children:"Cancel"}),(0,f.jsxs)("button",{type:"button",onClick:async()=>{h(!0),g("");try{const e=await s.request("/events/".concat(n.event_id,"/send-delivery"),{method:"POST",body:JSON.stringify({to:l,message:d})});y(e)}catch(e){g(e.message)}finally{h(!1)}},disabled:x||0===l.length,style:(0,m.A)((0,m.A)({},Zp),{},{opacity:l.length?1:.5}),children:[x?(0,f.jsx)(Kr.A,{size:15,style:{animation:"ka-spin .9s linear infinite"}}):(0,f.jsx)(st.A,{size:14,strokeWidth:2.2}),x?"Sending\u2026":"Send to ".concat(l.length)]})]}),children:[u&&(0,f.jsx)(Hp,{tone:"warn",children:u}),b?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(Hp,{children:[(0,f.jsxs)("strong",{children:["Sent to ",b.sent.length," recipient",1===b.sent.length?"":"s","."]}),b.failed.length>0&&(0,f.jsxs)(f.Fragment,{children:[" ",b.failed.length," failed: ",b.failed.join(", ")
1]})]}),(0,f.jsx)("div",{style:{fontSize:13,color:ed.textSecondary},children:b.sent.join(", ")})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(qp,{children:"WHAT THEY\u2019LL RECEIVE"}),(0,f.jsxs)("div",{style:{display:"grid",gap:8,marginBottom:18},children:[w.gallery_url&&(0,f.jsx)(Ax,{icon:Jr.A,label:w.gallery_name||"Gallery",url:w.gallery_url}),w.reviews_project_url&&(0,f.jsx)(Ax,{icon:Ge.A,label:w.reviews_project_name||"Video review",url:w.reviews_project_url})]}),(0,f.jsx)(qp,{children:"RECIPIENTS"}),(0,f.jsxs)("div",{style:{display:"grid",gap:7,marginBottom:18},children:[i.map(e=>(0,f.jsxs)("label",{style:{display:"flex",gap:9,alignItems:"center",cursor:"pointer",background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:10,padding:"10px 12px"},children:[(0,f.jsx)("input",{type:"checkbox",checked:l.includes(e.email),onChange:t=>c(s=>t.target.checked?[...s,e.email]:s.filter(t=>t!==e.email))}),(0,f.jsx)("span",{style:{fontSize:13.5},children:e.name}),(0,f.jsx)("span",{style:{marginLeft:"auto",fontSize:12,color:ed.textMuted},children:e.email})]},e.id)),0===i.length&&(0,f.jsx)("div",{style:{fontSize:13,color:ed.textMuted},children:"No contacts with an email address."})]}),(0,f.jsx)(qp,{children:"A LINE FROM YOU (OPTIONAL)"}),(0,f.jsx)("textarea",{rows:3,value:d,onChange:e=>p(e.target.value),placeholder:"Great day \u2014 everything from the floor is in here.",style:(0,m.A)((0,m.A)({},Kp),{},{resize:"vertical"})}),v.length>0&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{height:20}}),(0,f.jsx)(qp,{children:"ALREADY SENT"}),(0,f.jsx)("div",{style:{display:"grid",gap:6},children:v.slice(0,5).map((e,t)=>(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:10,color:ed.textFaint},children:String(e.at).slice(0,16).replace("T"," ")})," \u2014 ",(e.to||[]).length," recipient",1===(e.to||[]).length?"":"s"," by ",e.by]},t))})]})]})]})}const Ax=e=>{let{icon:t,label:s,url:a}=e;return(0,f.jsxs)("div",{style:{display:"flex",gap:9,alignItems:"center",background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:10,padding:"10px 12px"},children:[(0,f.jsx)(t,{size:14,strokeWidth:2.2,color:ed.red}),(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600},children:s}),(0,f.jsx)("a",{href:a,target:"_blank",rel:"noreferrer noopener",style:(0,m.A)((0,m.A)({},Yp),{},{marginLeft:"auto",fontSize:11.5,fontFamily:ad}),children:"open \u2197"})]})};function kx(e){var t,s,n;let{account:r,api:i,row:o,onClose:l,onSaved:c}=e;const[d,p]=(0,a.useState)(null),[x,h]=(0,a.useState)(!1),[u,g]=(0,a.useState)(""),[b,y]=(0,a.useState)(o.max_days||1),[v,j]=(0,a.useState)(!!o.half_day_enabled),[w,N]=(0,a.useState)(o.enabled_packages),[A,k]=(0,a.useState)(o.custom_build),[S,_]=(0,a.useState)(null!==(t=null===(s=o.travel_fee)||void 0===s?void 0:s.amount)&&void 0!==t?t:""),[C,F]=(0,a.useState)((null===(n=o.travel_fee)||void 0===n?void 0:n.label)||""),[E,T]=(0,a.useState)(o.enabled_roles),[z,B]=(0,a.useState)(o.enabled_durations),[D,I]=(0,a.useState)(o.enabled_items),[R,P]=(0,a.useState)(o.price_overrides||{});(0,a.useEffect)(()=>{i.request("/catalogue").then(e=>p(e.catalogue)).catch(e=>g(e.message))},[i]);const W=(e,t,s,a)=>{const n=null===e||void 0===e?s.map(e=>e.id):e,r=n.includes(a)?n.filter(e=>e!==a):[...n,a];t(r.length===s.length?null:r)},O=(e,t)=>null===e||void 0===e||e.includes(t),L=(e,t,s,a)=>{P(n=>{const r=JSON.parse(JSON.stringify(n||{}));return"package"===e?(r.packages=r.packages||{},""===a?delete r.packages[t]:r.packages[t]=Number(a),Object.keys(r.packages).length||delete r.packages):"role"===e?(r.roles=r.roles||{},r.roles[t]=r.roles[t]||{},""===a?delete r.roles[t][s]:r.roles[t][s]=Number(a),Object.keys(r.roles[t]).length||delete r.roles[t],Object.keys(r.roles).length||delete r.roles):(r.items=r.items||{},""===a?delete r.items[t]:r.items[t]=Number(a),Object.keys(r.items).length||delete r.items),r})},M=null===A||void 0===A?!(null===d||void 0===d||!d.custom_build):!!A,q=o.crew_locked;return(0,f.jsxs)(Qp,{wide:!0,title:o.name,subtitle:"".concat(Vm(o.event_date,o.date_tbc)).concat(o.venue?" \xb7 ".concat(o.venue):""),onClose:l,footer:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",onClick:l,style:$p,children:"Cancel"}),(0,f.jsxs)("button",{type:"button",onClick:async()=>{h(!0),g("");try{await i.request("/events/".concat(o.event_id),{method:"PATCH",body:JSON.stringify({max_days:Number(b)||1,half_day_enabled:v,enabled_packages:w,custom_build:A,enabled_roles:E,enabled_durations:z,enabled_
1items:D,price_overrides:R,travel_fee:Number(S)>0?{amount:Number(S),label:C.trim()}:null})}),await c(),l()}catch(e){g(e.message),h(!1)}},disabled:x,style:Zp,children:[x&&(0,f.jsx)(Kr.A,{size:15,style:{animation:"ka-spin .9s linear infinite"}}),x?"Saving\u2026":"Save options"]})]}),children:[u&&(0,f.jsx)(Hp,{tone:"warn",children:u}),q&&(0,f.jsx)(Hp,{tone:"warn",children:"Crew is assigned, so the client can no longer change this package. Edits here won\u2019t alter the confirmed booking \u2014 unlock crew first if the booking itself needs to change."}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12,marginBottom:18},children:[(0,f.jsx)(Vp,{label:"MAX DAYS ON SITE",hint:"Caps the durations the client can pick",children:(0,f.jsx)("input",{type:"number",min:"1",value:b,onChange:e=>y(e.target.value),style:Kp})}),(0,f.jsxs)("label",{style:{display:"flex",gap:9,alignItems:"center",fontSize:13,cursor:"pointer",paddingTop:20},children:[(0,f.jsx)("input",{type:"checkbox",checked:v,onChange:e=>j(e.target.checked)}),"Allow half-day bookings"]})]}),d?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("section",{style:{marginBottom:20},children:[(0,f.jsxs)(qp,{children:["PACKAGES OFFERED FOR THIS ",r.nouns.Item.toUpperCase()," \xb7 AND THE PRICE HERE"]}),(0,f.jsxs)("div",{style:{display:"grid",gap:9},children:[(d.packages||[]).map(e=>{var t,s;const a=null===w||void 0===w?!!e.offer_default:w.includes(e.id);return(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(a?ed.red:ed.adminBorder),borderRadius:12,padding:12},children:[(0,f.jsxs)("label",{style:{display:"flex",gap:9,alignItems:"flex-start",cursor:"pointer"},children:[(0,f.jsx)("input",{type:"checkbox",checked:a,onChange:()=>{const t=null===w||void 0===w?(d.packages||[]).filter(e=>e.offer_default).map(e=>e.id):w;N(a?t.filter(t=>t!==e.id):[...t,e.id])}}),(0,f.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600},children:e.label}),e.is_default&&(0,f.jsx)("span",{style:{background:"#3A1A1D",color:ed.amber,borderRadius:5,padding:"2px 6px",fontFamily:ad,fontSize:8,fontWeight:700,letterSpacing:".12em",marginLeft:7},children:"PRE-SELECTED"}),e.sublabel&&(0,f.jsx)("span",{style:{display:"block",fontSize:12,color:ed.textSecondary,marginTop:2},children:e.sublabel})]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:12.5,fontWeight:700},children:Gm(e.price)})]}),a&&(0,f.jsx)("div",{style:{marginTop:9,maxWidth:220},children:(0,f.jsx)(Vp,{label:"PRICE FOR THIS EVENT",hint:"Blank = the standard price",children:(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",placeholder:String(e.price),value:null!==(t=null===(s=R.packages)||void 0===s?void 0:s[e.id])&&void 0!==t?t:"",onChange:t=>L("package",e.id,null,t.target.value),style:(0,m.A)((0,m.A)({},Kp),{},{fontFamily:ad,fontSize:12.5,padding:"8px 10px"})})})})]},e.id)}),(0,f.jsxs)("label",{style:{display:"flex",gap:9,alignItems:"flex-start",cursor:"pointer",background:"#fff",border:"1px solid ".concat(M?ed.red:ed.adminBorder),borderRadius:12,padding:12},children:[(0,f.jsx)("input",{type:"checkbox",checked:M,onChange:e=>k(e.target.checked)}),(0,f.jsxs)("span",{children:[(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600},children:"Build your own"}),(0,f.jsxs)("span",{style:{display:"block",fontSize:12,color:ed.textSecondary,marginTop:2},children:["Client picks crew and time on site from the rate card (",(d.roles||[]).length," role",1===(d.roles||[]).length?"":"s"," \xb7"," ",(d.durations||[]).length," duration",1===(d.durations||[]).length?"":"s",")."]})]})]}),0===(d.packages||[]).length&&!M&&(0,f.jsxs)(Hp,{tone:"warn",children:["Nothing is offered, so this ",r.nouns.item," can\u2019t be booked. Tick a package or Build your own."]})]})]}),(0,f.jsxs)("section",{style:{marginBottom:20},children:[(0,f.jsxs)(qp,{children:["TRAVEL & ON-COSTS FOR THIS ",r.nouns.Item.toUpperCase()]}),(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:12,padding:14},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"150px 1fr",gap:10},children:[(0,f.jsx)(Vp,{label:"AMOUNT EX GST",children:(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",placeholder:"0.00",value:S,onChange:e=>_(e.target.value),style:(0,m.A)((0,m.A)({},Kp),{},{fontFamily:ad})})}),(0,f.jsx)(Vp,{label:"WHAT IT COVERS",children:(0,f.jsx)("input",{value:C,placeholder:"Flights + 2 nights accommodation, Auckland",onChange:e=>F(e.target.value),style:Kp})})]}),Number(S)>0&&(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:10},children:["Client sees: ",(0,f.jsxs)("strong",{children:["Travel \u2014 ",C||"travel"]})," \u2026 ",Gm(S)]}),(0,f.jsx)("div",{style:{fontSize:11.5,color:ed.textMuted,marginTop:8,lineHeight:1.5},children:"Blank = no travel fee. This doesn\u2019t change a confirmed booking \u2014 the fee is picked up when they build or modify the package."})]})]}),M&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("section",{style:{marginBottom:20},children:[(0,f.jsx)(qp,{children:"TIME ON SITE OFFERED"}),(0,f.jsx)("div",{style:{display:"grid",gap:7},children:(d.durations||[]).map(e=>(0,f.jsxs)("label",{style:Sx,children:[(0,f.jsx)("input",{type:"checkbox",checked:O
1(z,e.id),onChange:()=>W(z,B,d.durations,e.id)}),(0,f.jsx)("span",{style:{fontSize:13.5},children:e.label}),(0,f.jsxs)("span",{style:{marginLeft:"auto",fontFamily:ad,fontSize:10,color:ed.textFaint},children:[e.days,"d"]})]},e.id))})]}),(0,f.jsxs)("section",{style:{marginBottom:20},children:[(0,f.jsxs)(qp,{children:["CREW OFFERED \xb7 AND THE RATE FOR THIS ",r.nouns.Item.toUpperCase()]}),(0,f.jsx)("div",{style:{display:"grid",gap:10},children:(d.roles||[]).map(e=>(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:12,padding:12},children:[(0,f.jsxs)("label",{style:{display:"flex",gap:9,alignItems:"center",cursor:"pointer"},children:[(0,f.jsx)("input",{type:"checkbox",checked:O(E,e.id),onChange:()=>W(E,T,d.roles,e.id)}),(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600},children:e.label})]}),O(E,e.id)&&(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(130px,1fr))",gap:8,marginTop:10},children:Object.entries(e.rates||{}).filter(e=>{let[t]=e;return O(z,t)}).map(t=>{var s,a,n,r;let[i,o]=t;return(0,f.jsxs)("label",{style:{display:"grid",gap:4},children:[(0,f.jsx)("span",{style:{fontSize:11.5,color:ed.textSecondary},children:(null===(s=(d.durations||[]).find(e=>e.id===i))||void 0===s?void 0:s.label)||i}),(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",placeholder:String(o),value:null!==(a=null===(n=R.roles)||void 0===n||null===(r=n[e.id])||void 0===r?void 0:r[i])&&void 0!==a?a:"",onChange:t=>L("role",e.id,i,t.target.value),style:(0,m.A)((0,m.A)({},Kp),{},{fontFamily:ad,fontSize:12.5,padding:"8px 10px"})})]},i)})})]},e.id))})]})]}),(0,f.jsxs)("section",{children:[(0,f.jsx)(qp,{children:"EXTRAS & DELIVERABLES OFFERED"}),(0,f.jsxs)("div",{style:{display:"grid",gap:8},children:[(d.items||[]).map(e=>{var t,s;return(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:12,padding:12},children:[(0,f.jsxs)("label",{style:{display:"flex",gap:9,alignItems:"center",cursor:"pointer"},children:[(0,f.jsx)("input",{type:"checkbox",checked:O(D,e.id),onChange:()=>W(D,I,d.items,e.id)}),(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600},children:e.label}),(0,f.jsx)("span",{style:{fontSize:11.5,color:ed.textMuted},children:e.unit}),(0,f.jsx)("span",{style:{marginLeft:"auto",fontFamily:ad,fontSize:12},children:Gm(e.price)})]}),O(D,e.id)&&(0,f.jsx)("div",{style:{marginTop:9,maxWidth:200},children:(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",placeholder:"Override (".concat(e.price,")"),value:null!==(t=null===(s=R.items)||void 0===s?void 0:s[e.id])&&void 0!==t?t:"",onChange:t=>L("item",e.id,null,t.target.value),style:(0,m.A)((0,m.A)({},Kp),{},{fontFamily:ad,fontSize:12.5,padding:"8px 10px"})})})]},e.id)}),0===(d.items||[]).length&&(0,f.jsx)("div",{style:{fontSize:13,color:ed.textMuted},children:"No extras configured on the account yet."})]})]})]}):(0,f.jsx)(Gp,{pad:20})]})}const Sx={display:"flex",gap:9,alignItems:"center",cursor:"pointer",background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:10,padding:"10px 12px"},_x=["Overview","Packages","Bookings","Quotes","Crew","Delivery","Contacts"];function Cx(e){let{accountKey:t}=e;const s=(0,a.useMemo)(()=>function(e){const t=qm[e];if(!t)throw new Error("Unknown key account: ".concat(e));const s="".concat(Hm,"/api/ka/").concat(e,"/admin"),a=()=>{try{return JSON.parse(window.localStorage.getItem("turbo360_admin_auth")||"{}").token||""}catch(e){return""}};async function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=await fetch("".concat(s).concat(e),(0,m.A)((0,m.A)({},t),{},{headers:(0,m.A)({"Content-Type":"application/json",Authorization:"Bearer ".concat(a())},t.headers||{})}));if(!n.ok){let e="Something went wrong";try{e=(await n.json()).detail||e}catch(r){}const t=new Error(e);throw t.status=n.status,t}return n.json()}return{account:t,request:n,downloadPdf:async function(e){const t=await fetch("".concat(s).concat(e),{headers:{Authorization:"Bearer ".concat(a())}});if(!t.ok){let e="That document isn't available yet";try{e=(await t.json()).detail||e}catch(l){}throw new Error(e)}const n=(t.headers.get("content-disposition")||"").match(/filename="?([^";]+)"?/i),r=await t.blob(),i=URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=n?n[1]:"Turbo 360.pdf",document.body.appendChild(o),o.click(),o.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),1e3)},impersonate:async function(s){const a=await n("/impersonate",{method:"POST",body:JSON.stringify({contact_id:s})});try{window.localStorage.setItem("ka-".concat(e,"-portal-token"),a.token)}catch(r){}return window.open(t.routes.portal,"_blank","noopener"),a},BASE:s}}(t),[t]),{account:n}=s,[r,i]=(0,a.useState)("Overview"),[o,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)(""),[p,x]=(0,a.useState)(null),[h,u]=(0,a.useState)(null),[g,b]=(0,a.useState)([]),[y,v]=(0,a.useState)(""),[j,w]=(0,a.useState)(null),[N,A]=(0,a.useState)(null),k=(0,a.useCallback)(async()=>{d("");try{const[e,t,a]=await Promise.all([s.request("/overview"),s.request("/contacts"),s.request("/catalogue").catch(()=>null)]);x(e),b(t.contacts||[]),v(t.company_id||""),u((null===a||void 0===a?void 0:a.catalogue)||null)}catch(e){d(e.message)}finally{l(!1)}},[s]);(0,a.useEffect)(()=>{k()},[k]);const S=null===p||void 0===p?void 0:p.figures,_=(null===p||void 0===p?void 0:p.events)||[],C=S?"KEY ACCOUNT \xb7 ".concat(S.events_total," ").concat(n.nouns.items.toUpperCase()," IN SYSTEM \xb7 ").concat(S.to_book," TO BOOK"):"KEY ACCOUNT";return(0,f.jsxs)(ta,{title:n.name,meta:C,children:[(0,f.jsx)("style",{children:"\n @keyframes ka-spin { to { transform: rotate(360deg); } }
1\n .kah-row:hover { background: ".concat(ed.adminRowHover,"; }\n .kah-tab:hover { color: ").concat(ed.textPrimary,"; }\n .kah-ghost:hover { border-color: ").concat(ed.red,"; color: ").concat(ed.red,"; }\n @media (max-width: 1100px) {\n .kah-metrics { grid-template-columns: 1fr 1fr !important; }\n .kah-2up { grid-template-columns: 1fr !important; }\n .kah-erow { grid-template-columns: 74px 1fr !important; }\n .kah-eright { grid-column: 2 !important; text-align: left !important; margin-top: 10px; }\n .kah-eright .kah-acts { justify-content: flex-start !important; }\n }\n ")}),c&&(0,f.jsx)("div",{style:{background:ed.dangerBg,border:"1px solid #FCA5A5",borderRadius:10,padding:"13px 16px",color:ed.dangerFg,fontSize:14,marginBottom:18},children:c}),(0,f.jsx)(Fx,{account:n,figures:S,contacts:g,api:s,events:_,companyId:y}),(0,f.jsx)("div",{style:{display:"flex",gap:22,borderBottom:"1px solid ".concat(ed.adminBorder),margin:"22px 0 20px",overflowX:"auto"},children:_x.map(e=>(0,f.jsx)("button",{type:"button",className:"kah-tab",onClick:()=>i(e),style:{background:"none",border:"none",padding:"0 0 11px",cursor:"pointer",fontFamily:sd,fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",color:r===e?ed.textPrimary:ed.textMuted,borderBottom:r===e?"2px solid ".concat(ed.red):"2px solid transparent",marginBottom:-1},children:e},e))}),o?(0,f.jsx)(Gp,{pad:60}):(0,f.jsxs)(f.Fragment,{children:["Overview"===r&&(0,f.jsx)(zx,{account:n,api:s,catalogue:h,rows:_,onChanged:k,onPatch:async(e,t)=>{w(e.event_id);try{await s.request("/events/".concat(e.event_id),{method:"PATCH",body:JSON.stringify(t)}),await k()}catch(a){d(a.message)}finally{w(null)}},busyId:j,onOptions:A,onEditPackage:()=>i("Packages")}),"Packages"===r&&(0,f.jsx)(sx,{account:n,api:s,onSaved:k}),"Bookings"===r&&(0,f.jsx)(Px,{api:s}),"Quotes"===r&&(0,f.jsx)(Wx,{api:s,account:n}),"Crew"===r&&(0,f.jsx)(Ox,{api:s,rows:_,onChanged:k}),"Delivery"===r&&(0,f.jsx)(jx,{account:n,api:s,rows:_,onChanged:k}),"Contacts"===r&&(0,f.jsx)(Lx,{contacts:g})]}),N&&(0,f.jsx)(kx,{account:n,api:s,row:N,onClose:()=>A(null),onSaved:k})]})}function Fx(e){var t,s,n;let{account:r,figures:i,contacts:o,api:l,events:c,companyId:d}=e;const p=(0,a.useMemo)(()=>{var e;const t={};(c||[]).forEach(e=>{e.contact_id&&(t[e.contact_id]=(t[e.contact_id]||0)+1)});const s=null===(e=Object.entries(t).sort((e,t)=>t[1]-e[1])[0])||void 0===e?void 0:e[0];return o.find(e=>e.id===s&&!e.is_company)||o.find(e=>!e.is_company)||o[0]},[c,o]),[x,h]=(0,a.useState)(!1);return(0,f.jsxs)("div",{style:{background:ed.carbon2,border:"1px solid ".concat(ed.carbonBorder),borderRadius:16,overflow:"hidden"},children:[(0,f.jsx)("div",{style:{height:3,background:rd}}),(0,f.jsxs)("div",{style:{padding:"22px 24px"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"flex-start",flexWrap:"wrap"},children:[(0,f.jsx)("img",{src:r.logo,alt:r.name,style:{width:52,height:52,borderRadius:12,background:"#fff",objectFit:"contain",padding:5,boxSizing:"border-box"}}),(0,f.jsxs)("div",{style:{flex:1,minWidth:220},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},nd),{},{fontWeight:800,fontSize:23,color:"#fff",textTransform:"uppercase",letterSpacing:"-.01em"}),children:r.name}),(0,f.jsxs)("div",{style:{display:"flex",gap:7,flexWrap:"wrap",marginTop:9},children:[(0,f.jsx)(Jp,{bg:"#3A1A1D",fg:"#F2A900",children:"KEY ACCOUNT"}),(0,f.jsx)(Jp,{bg:"#12281F",fg:"#4ADE80",children:"ACTIVE"}),(0,f.jsx)(Jp,{bg:"#141417",fg:"#9A9AA0",children:r.serviceTag})]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,f.jsx)(Ex,{href:d?"/admin/clients/company/".concat(d):"/admin/clients",children:"Company 360 \u2192"}),(0,f.jsx)(Ex,{href:d?"/admin/invoices?company_id=".concat(d,"&company=").concat(encodeURIComponent(r.name)):"/admin/invoices",children:"Invoices \u2192"}),(0,f.jsx)(Ex,{href:"/admin/corporate?q=".concat(encodeURIComponent(r.recordName||r.name)),children:"Runsheets \u2192"}),(0,f.jsx)("button",{type:"button",onClick:async()=>{if(p){h(!0);try{await l.impersonate(p.id)}catch(e){}finally{h(!1)}}},disabled:!p||x,style:{background:ed.carbon3,color:"#fff",border:"1px solid ".concat(ed.carbonBorder),borderRadius:9,padding:"9px 14px",fontFamily:td,fontSize:12.5,fontWeight:700,cursor:p?"pointer":"default",opacity:p?1:.5},children:x?"Opening\u2026":"Login as ".concat(((null===p||void 0===p?void 0:p.name)||"").split(" ")[0]||"contact")}),(0,f.jsxs)("a",{href:"https://".concat(r.portalHost),target:"_blank",rel:"noreferrer noopener",style:{background:ed.red,color:"#fff",textDecoration:"none",borderRadius:9,padding:"9px 14px",fontFamily:td,fontSize:12.5,fontWeight:700,display:"inline-flex",alignItems:"center",gap:7},children:["Open client portal ",(0,f.jsx)(En.A,{size:13,strokeWidth:2.4})]})]})]}),(0,f.jsx)("p",{style:{fontSize:13.5,lineHeight:1.6,color:ed.textMuted,maxWidth:660,margin:"16px 0 0"},children:r.admin.blurb})]}),(0,f.jsxs)("div",{className:"kah-metrics",style:{display:"grid",gridTemplateColumns:"repeat(4,1fr)",gap:1,background:ed.carbonBorder,borderTop:"1px solid ".concat(ed.carbonBorder)},children:[(0,f.jsx)(Tx,{label:"BOOKED TO DATE",value:Gm((null===i||void 0===i?void 0:i.booked_value)||0)}),(0,f.jsx)(Tx,{label:"".concat(r.nouns.items.toUpperCase()," IN SYSTEM"),value:null!==(t=null===i||void 0===i?void 0:i.events_total)&&void 0!==t?t:"\u2014"}),(0,f.jsx)(Tx,{label:"STILL TO BOOK",value:"".concat(null!==(s=null===i||void 0===i?void 0:i.to_book)&&void 0!==s?s:0," ").concat(r.nouns.items.toUpperCase()),tone:ed.amber}),(0,f.jsx)(Tx,{label:"QUOTES IN FLIGHT",value:null!==(n=null===i||void 0===i?void 0:i.drafts_open)&&void 0!==n?n:0})]})]})}const Ex=e=>{let{href:t,children:s}=e;return(0,f.jsx)("a",{href:t,style:{background:ed.carbon3,color:"#fff",textDecoration:"none",border:"1px solid ".concat(ed.carbonBorder),borderRadius:9,padding:"9px 14px",fontFamily:td,fontSize:12.5,fontWeight:700},children:s})},Tx=e=>{let{label:t,value:s,tone:a}=e;return(0,f.jsxs)("div",{style:{background:ed.carbon2,padding:"16px 20px"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaintDark},children:t}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:19,fontWeight:700,marginTop:7,color:a||"#fff"},children:s})]})};function zx(e){let{account:t,api:s,catalogue:a,rows:n,onChanged:r,onPatch:i,busyId:o,onOptions:l,onEditPackage:c}=e;const d=n.filter(e=>"booked"===e.state&&!e.invoiced);return(0,f.jsxs)(f.Fragment,{children:[d.length>0&&(0,f.jsxs)(Hp,{tone:"warn",children:[(0,f.jsxs)("strong",{children:[d.length," booked ",1===d.length?t.nouns.item:t.nouns.items," not yet marked invoiced"]})," \u2014 ",d.map(e=>e.name).join(", "),". Tick the receipt icon on the row once the invoice is raised in Xero."]}),(0,f.jsxs)("div",{className:"kah-2up",style:{display:"grid",gridTemplateColumns:"1.4fr 1fr",gap:14,marginBottom:20},children:[(0,f.jsx)(Bx,{account:t,catalogue:a,onEdit:c}),(0,f.jsxs)(Mp,{children:[(0,f.jsx)(qp,{children:"HOW THIS ACCOUNT BOOKS"}),(0,f.jsx)("div",{style:{display:"grid",gap:14},children:t.admin.howSteps.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",gap:11,alignItems:"flex-start"},children:[(0,f.jsx)("span",{style:{width:22,height:22,borderRadius:6,background:"#F2F2F5",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:ad,fontSize:11,fontWeight:700,flexShrink:0},children:t+1}),(0,f.jsx)("span",{style:{fontSize:13,lineHeight:1.55},children:e})]},e))})]})]}),(0,f.jsx)(Dx,{account:t,api:s,catalogue:a,onCreated:r}),(0,f.jsxs)(qp,{children:["ALL ",t.nouns.items.toUpperCase()," \xb7 IS IT BOOKED?"]}),(0,f.jsxs)("div",{style:{display:"grid",gap:10},children:[0===n.length&&(0,f.jsx)(Mp,{children:(0,f.jsxs)(Up,{children:["No ",t.nouns.items," yet \u2014 add one above and it appears in their portal immediately."]})}),n.map(e=>(0,f.jsx)(Ix,{row:e,account:t,api:s,onPatch:i,busy:o===e.event_id,onOptions:l},e.event_id))]})]})}function Bx(e){let{account:t,catalogue:s,onEdit:a}=e;const n=null===s||void 0===s?void 0:s.package,r=(null===s||void 0===s?void 0:s.roles)||[],i=(null===s||void 0===s?void 0:s.items)||[],o=null==(null===s||void 0===s?void 0:s.gst_rate)?.1:Number(s.gst_rate),l=n?(n.inclusions||[]).map(e=>({label:e,meta:"",amount:0})):[...r.flatMap(e=>Object.entries(e.rates||{}).map(t=>{var a;let[n,r]=t;return{label:e.label,meta:(null===(a=(s.durations||[]).find(e=>e.id===n))||void 0===a?void 0:a.label)||n,amount:r}})),...i.map(e=>({label:e.label,meta:e.unit||"",amount:e.price}))];return(0,f.jsxs)(Mp,{pad:!1,children:[(0,f.jsxs)("div",{style:{padding:"16px 18px",borderBottom:"1px solid ".concat(ed.adminBorder),display:"flex",gap:14,alignItems:"flex-start",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:200},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".16em",color:ed.textFaint},children:t.admin.packageKicker}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:16,fontWeight:700,marginTop:6}
1,children:n?n.label:"".concat(t.name," rate card")}),(null===n||void 0===n?void 0:n.sublabel)&&(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:2},children:n.sublabel})]}),n&&(0,f.jsxs)("div",{style:{textAlign:"right"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".16em",color:ed.textFaint},children:"PER EVENT \xb7 EX GST"}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:19,fontWeight:700,marginTop:4},children:Gm(n.price)}),(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:10,color:ed.textMuted,marginTop:2},children:[Gm(Number(n.price||0)*(1+o))," inc"]})]})]}),(0,f.jsxs)("div",{style:{padding:"4px 18px"},children:[0===l.length&&(0,f.jsx)("div",{style:{padding:"18px 0",fontSize:13,color:ed.textMuted},children:"No catalogue configured yet."}),l.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:14,padding:"9px 0",borderBottom:t===l.length-1?"none":"1px solid #F2F2F5"},children:[(0,f.jsxs)("span",{style:{fontSize:13.5},children:[e.label,e.meta?(0,f.jsxs)("span",{style:{color:ed.textMuted},children:[" \xb7 ",e.meta]}):""]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:13,fontWeight:700,whiteSpace:"nowrap",color:e.amount?ed.textPrimary:ed.textMuted},children:e.amount?Gm(e.amount):"Included"})]},"".concat(e.label,"-").concat(t)))]}),(0,f.jsxs)("div",{style:{background:"#FBFBFC",padding:"12px 18px",display:"flex",justifyContent:"space-between",gap:12,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:8.5,letterSpacing:".14em",color:ed.textFaint},children:t.admin.packageNote}),(0,f.jsx)("button",{type:"button",onClick:a,style:{background:"none",border:"none",cursor:"pointer",color:ed.red,fontFamily:td,fontSize:12.5,fontWeight:700,padding:0},children:n?"Edit package \u2192":"Edit rates \u2192"})]})]})}function Dx(e){let{account:t,api:s,catalogue:n,onCreated:r}=e;const[i,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)(!1),[d,p]=(0,a.useState)(""),x=n||{}
1,h=x.packages||[],u=x.items||[],g=()=>({event_name:"",event_date:"",venue:"",city:"",max_days:t.admin.defaultDays,date_tbc:!1,portal_visible:!0,packages:h.filter(e=>e.offer_default).map(e=>e.id),custom_build:!!x.custom_build,items:u.filter(e=>!1!==e.offer_default).map(e=>e.id),travel_amount:"",travel_label:""}),[b,y]=(0,a.useState)(g),v=(e,t)=>y(s=>(0,m.A)((0,m.A)({},s),{},{[e]:s[e].includes(t)?s[e].filter(e=>e!==t):[...s[e],t]})),j=[...h.filter(e=>b.packages.includes(e.id)).map(e=>e.label),...b.custom_build?["Build your own"]:[],b.items.length?"".concat(b.items.length," deliverables & extras"):null,Number(b.travel_amount)>0?"Travel ".concat(Gm(b.travel_amount)):null].filter(Boolean),w=e=>({value:b[e],onChange:t=>y(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t.target.value})),style:Kp});return(0,f.jsx)(Mp,{style:{marginBottom:20},children:i?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700,marginBottom:14},children:["New ",t.nouns.item]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(200px,1fr))",gap:12},children:[(0,f.jsx)(Vp,{label:"".concat(t.nouns.Item.toUpperCase()," NAME"),children:(0,f.jsx)("input",(0,m.A)((0,m.A)({},w("event_name")),{},{placeholder:t.admin.eventPlaceholder}))}),(0,f.jsx)(Vp,{label:"DATE",children:(0,f.jsx)("input",(0,m.A)({type:"date"},w("event_date")))}),(0,f.jsx)(Vp,{label:"VENUE",children:(0,f.jsx)("input",(0,m.A)((0,m.A)({},w("venue")),{},{placeholder:"ICC Sydney"}))}),(0,f.jsx)(Vp,{label:"CITY",children:(0,f.jsx)("input",(0,m.A)((0,m.A)({},w("city")),{},{placeholder:"Sydney"}))}),(0,f.jsx)(Vp,{label:"MAX DAYS",children:(0,f.jsx)("input",{type:"number",min:1,value:b.max_days,onChange:e=>y(t=>(0,m.A)((0,m.A)({},t),{},{max_days:Number(e.target.value)})),style:Kp})})]}),(0,f.jsxs)("div",{style:{borderTop:"1px solid ".concat(ed.adminBorder),margin:"18px 0 0",paddingTop:16},children:[(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:9,fontWeight:700,letterSpacing:".18em",color:ed.textFaint},children:["WHAT\u2019S AVAILABLE IN THEIR QUOTE BUILDER FOR THIS ",t.nouns.Item.toUpperCase()]}),(0,f.jsx)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:4},children:"Pre-filled from your defaults on the Packages tab \u2014 change it here or later on the row."}),(0,f.jsxs)("div",{className:"kah-2up",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14,marginTop:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:ed.textFaint,marginBottom:8},children:"PACKAGES"}),(0,f.jsxs)("div",{style:{display:"grid",gap:8},children:[h.map(e=>{const t=b.packages.includes(e.id);return(0,f.jsxs)("label",{style:{display:"flex",gap:9,alignItems:"flex-start",cursor:"pointer",background:"#fff",border:"1px solid ".concat(t?ed.red:ed.adminBorder),borderRadius:10,padding:"10px 12px"},children:[(0,f.jsx)("input",{type:"checkbox",checked:t,onChange:()=>v("packages",e.id)}),(0,f.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600},children:e.label}),e.is_default&&(0,f.jsx)("span",{style:{background:"#3A1A1D",color:ed.amber,borderRadius:5,padding:"2px 6px",fontFamily:ad,fontSize:7.5,fontWeight:700,letterSpacing:".12em",marginLeft:6},children:"PRE-SELECTED FOR CLIENT"}),e.sublabel&&(0,f.jsx)("span",{style:{display:"block",fontSize:11.5,color:ed.textSecondary,marginTop:2},children:e.sublabel})]}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:12,fontWeight:700},children:Gm(e.price)})]},e.id)}),(0,f.jsxs)("label",{style:{display:"flex",gap:9,alignItems:"flex-start",cursor:"pointer",background:"#fff",border:"1px solid ".concat(b.custom_build?ed.red:ed.adminBorder),borderRadius:10,padding:"10px 12px"},children:[(0,f.jsx)("input",{type:"checkbox",checked:b.custom_build,onChange:e=>y(t=>(0,m.A)((0,m.A)({},t),{},{custom_build:e.target.checked}))}),(0,f.jsxs)("span",{children:[(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600},children:"Build your own"}),(0,f.jsxs)("span",{style:{display:"block",fontSize:11.5,color:ed.textSecondary,marginTop:2},children:["Client picks crew roles and time on site from the rate c
1ard (",(x.roles||[]).length," roles \xb7 ",(x.durations||[]).length," durations)"]})]})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:ed.textFaint,marginBottom:8},children:"DELIVERABLES & OPTIONAL EXTRAS"}),(0,f.jsxs)("div",{style:{display:"grid",gap:5},children:[u.map(e=>(0,f.jsxs)("label",{style:{display:"flex",gap:8,alignItems:"center",cursor:"pointer",fontSize:12.5},children:[(0,f.jsx)("input",{type:"checkbox",checked:b.items.includes(e.id),onChange:()=>v("items",e.id)}),(0,f.jsx)("span",{children:e.label}),(0,f.jsx)("span",{style:{color:ed.textMuted,fontSize:11},children:e.scope}),(0,f.jsx)("span",{style:{marginLeft:"auto",fontFamily:ad,fontSize:11},children:Gm(e.price)})]},e.id)),0===u.length&&(0,f.jsx)("span",{style:{fontSize:12.5,color:ed.textMuted},children:"None configured."})]}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:ed.textFaint,margin:"16px 0 8px"},children:"TRAVEL FEE \xb7 OPTIONAL"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"110px 1fr",gap:8},children:[(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",placeholder:"0.00",value:b.travel_amount,onChange:e=>y(t=>(0,m.A)((0,m.A)({},t),{},{travel_amount:e.target.value})),style:(0,m.A)((0,m.A)({},Kp),{},{fontFamily:ad,fontSize:12.5,padding:"8px 10px"})}),(0,f.jsx)("input",{placeholder:"What it covers",value:b.travel_label,onChange:e=>y(t=>(0,m.A)((0,m.A)({},t),{},{travel_label:e.target.value})),style:(0,m.A)((0,m.A)({},Kp),{},{fontSize:12.5,padding:"8px 10px"})})]})]})]}),(0,f.jsxs)("div",{style:{background:"#FBFBFC",border:"1px solid ".concat(ed.adminBorder),borderRadius:10,padding:"10px 13px",marginTop:14},children:[(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:8.5,fontWeight:700,letterSpacing:".16em",color:ed.textFaint},children:"CLIENT WILL SEE"}),(0,f.jsx)("span",{style:{fontSize:12.5,color:ed.textPrimary,marginLeft:9},children:j.length?j.join(" \xb7 "):"Nothing yet \u2014 tick a package or Build your own"})]})]}),d&&(0,f.jsx)("div",{style:{color:ed.dangerFg,fontSize:13,marginTop:10},children:d}),(0,f.jsxs)("div",{style:{display:"flex",gap:9,marginTop:14},children:[(0,f.jsx)("button",{type:"button",onClick:async()=>{if(b.event_name.trim())if(0!==b.packages.length||b.custom_build){c(!0),p("");try{var e;const t=await s.request("/events",{method:"POST",body:JSON.stringify({event_name:b.event_name,event_date:b.event_date,venue:b.venue,city:b.city,max_days:b.max_days,date_tbc:b.date_tbc,portal_visible:b.portal_visible})}),a=null===t||void 0===t||null===(e=t.event)||void 0===e?void 0:e.id;a&&await s.request("/events/".concat(a),{method:"PATCH",body:JSON.stringify({enabled_packages:b.packages,custom_build:b.custom_build,enabled_items:b.items.length===u.length?null:b.items,travel_fee:Number(b.travel_amount)>0?{amount:Number(b.travel_amount),label:b.travel_label.trim()}:null})}),y(g()),o(!1),await r()}catch(a){p(a.message)}finally{c(!1)}}else p("Offer at least one package, or Build your own, so the client has something to book");else p("Give the ".concat(t.nouns.item," a name"))},disabled:l,style:Zp,children:l?"Adding\u2026":"Add ".concat(t.nouns.Item.toLowerCase()," & publish")}),(0,f.jsx)("button",{type:"button",onClick:()=>{o(!1),p("")},style:$p,children:"Cancel"})]})]}):(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:14,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:["Add ","event"===t.nouns.item?"an event":"a ".concat(t.nouns.item)," to ",t.name,"\u2019s calendar"]}),(0,f.jsx)("div",{style:{fontSize:13,color:ed.textSecondary,marginTop:3},children:"Publishes it to their portal and creates the Event Runsheet record in one step."})]}),(0,f.jsxs)("button",{type:"button",onClick:()=>o(!0),style:Zp,children:[(0,f.jsx)(ls.A,{size:15,strokeWidth:2.4})," New ",t.nouns.Item.toLowerCase()]})]})})}function Ix(e){let{row:t,account:s,api:a,onPatch:n,busy:r,onOptions:i}=e;const o=Jm(t.event_date),l=t.state,c="booked"===l?{bg:ed.successBg,fg:ed.successFg,label:"BOOKED"}:"draft"===l?{bg:ed.infoBg,fg:ed.infoFg,label:"QUOTED"}:{bg:ed.warnBg,fg:ed.warnFg,label:"NOT BOOKED"},d=t.delivery||{},m=t.runsheet_state;return(0,f.jsx)(Mp,{pad:!1,children:(0,f.jsxs)("div",{className:"kah-erow",style:{display:"grid",gridTemplateColumns:"74px 1fr 300px",gap:14,padding:"14px 18px",alignItems:"center"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10,fontWeight:700,color:ed.red},children:o.month}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:21,fontWeight:700,lineHeight:1},children:o.day})]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:9,alignItems:"center",flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:t.name}),(0,f.jsx)(Jp,{bg:c.bg,fg:c.fg,children:c.label}),t.archived&&(0,f.jsxs)(Jp,{bg:"#F2F2F5",fg:ed.textFaint,title:"Archived in Event Runsheets. It still shows in the portal \u2014 archiving is housekeeping for the runsheets list, not a portal switch.",children:[(0,f.jsx)(_r.A,{size:9})," ARCHIVED"]}),t.job_ref&&(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:10,
1color:ed.textFaint},children:t.job_ref})]}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:3},children:[Vm(t.event_date,t.date_tbc),t.venue?" \xb7 ".concat(t.venue):""]}),(0,f.jsxs)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",marginTop:8},children:[(0,f.jsxs)(Jp,{bg:"published"===m?ed.successBg:"draft"===m?ed.warnBg:"#F2F2F5",fg:"published"===m?ed.successFg:"draft"===m?ed.warnFg:ed.textFaint,title:"Runsheet state",children:[(0,f.jsx)(kt.A,{size:9})," ","published"===m?"RUNSHEET LIVE":"draft"===m?"RUNSHEET DRAFT":"RUNSHEET EMPTY"]}),(0,f.jsxs)(Jp,{bg:t.crew_count?t.crew_locked?ed.successBg:ed.infoBg:"#F2F2F5",fg:t.crew_count?t.crew_locked?ed.successFg:ed.infoFg:ed.textFaint,title:t.crew_locked?"Crew locked \u2014 client can no longer edit":"Crew assigned",children:[(0,f.jsx)(Xe.A,{size:9})," ",t.crew_count?"".concat(t.crew_count," CREW"):"NO CREW",t.crew_locked&&(0,f.jsx)(ht.A,{size:8})]}),"booked"===l&&(0,f.jsxs)(Jp,{bg:t.invoiced?ed.successBg:ed.dangerBg,fg:t.invoiced?ed.successFg:ed.dangerFg,title:t.invoiced?"Invoiced":"Booked but not yet invoiced",children:[(0,f.jsx)(_i.A,{size:9})," ",t.invoiced?"INVOICED":"NOT INVOICED"]}),(0,f.jsxs)(Jp,{bg:d.gallery_url?ed.successBg:"#F2F2F5",fg:d.gallery_url?ed.successFg:ed.textFaint,title:"Gallery",children:[(0,f.jsx)(Jr.A,{size:9})," ",d.gallery_url?"GALLERY":"NO GALLERY"]}),"PHOTOGRAPHY"!==s.serviceTag&&(0,f.jsxs)(Jp,{bg:d.reviews_project_url?ed.successBg:"#F2F2F5",fg:d.reviews_project_url?ed.successFg:ed.textFaint,title:"Video review",children:[(0,f.jsx)(Ge.A,{size:9})," ",d.reviews_project_url?"VIDEO":"NO VIDEO"]})]})]}),(0,f.jsxs)("div",{className:"kah-eright",style:{textAlign:"right"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:16,fontWeight:700},children:null!=t.total?Gm(t.total):(0,f.jsx)("span",{style:{color:ed.textFaint,fontSize:13},children:"\u2014"})}),(0,f.jsxs)("div",{className:"kah-acts",style:{display:"flex",gap:6,justifyContent:"flex-end",flexWrap:"wrap",marginTop:9},children:[(0,f.jsx)(Rx,{href:"/admin/corporate/edit/".concat(t.event_id),title:"Open the Event Runsheet",children:(0,f.jsx)(kt.A,{size:13})}),(0,f.jsx)(Rx,{onClick:()=>i(t),title:"What this event offers, and at what price",children:(0,f.jsx)(Lp.A,{size:13})}),"booked"===l&&(0,f.jsx)(Rx,{onClick:()=>n(t,{invoiced:!t.invoiced}),title:t.invoiced?"Mark as not invoiced":"Mark as invoiced",active:t.invoiced,children:(0,f.jsx)(_i.A,{size:13})}),(0,f.jsx)(Rx,{onClick:()=>n(t,{portal_visible:!t.portal_visible}),title:t.portal_visible?"Visible in the client portal":"Hidden from the client portal",active:t.portal_visible,busy:r,children:t.portal_visible?(0,f.jsx)(_.A,{size:14}):(0,f.jsx)(ut.A,{size:14})})]})]})]})})}const Rx=e=>{let{href:t,onClick:s,title:a,children:n,active:r,busy:i}=e;const o={background:"#fff",border:"1px solid ".concat(ed.adminBorder),borderRadius:8,padding:"7px 9px",cursor:"pointer",display:"inline-flex",alignItems:"center",color:r?ed.successFg:ed.textSecondary,textDecoration:"none"};return i?(0,f.jsx)("span",{style:o,children:(0,f.jsx)(Kr.A,{size:13,style:{animation:"ka-spin .9s linear infinite"}})}):t?(0,f.jsx)("a",{href:t,title:a,style:o,children:n}):(0,f.jsx)("button",{type:"button",onClick:s,title:a,style:o,children:n})};function Px(e){let{api:t}=e;const[s,n]=(0,a.useState)(null);return(0,a.useEffect)(()=>{t.request("/bookings").then(e=>n(e.bookings||[])).catch(()=>n([]))},[t]),s?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(Hp,{children:["Bookings the client has confirmed. Invoices live in ",(0,f.jsx)("a",{href:"/admin/invoices",style:Yp,children:"Finance \u2192 Invoices"})," \u2014 the Invoices link at the top of this page opens this account\u2019s only."]}),0===s.length&&(0,f.jsx)(Up,{children:"No bookings yet."}),s.map(e=>(0,f.jsx)(Mp,{style:{marginBottom:10},children:(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:14,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:10,color:ed.textFaint},children:e.job_ref}),(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700,marginTop:3},children:e.event_name}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:2},children:[Vm(e.event_date)," \xb7 signed by ",e.signer_name,e.signer_position?", ".concat(e.signer_position):"",e.confirmed_offline&&(0,f.jsx)(Jp,{bg:"#F2F2F5",fg:ed.textFaint,title:e.confirmation_note,children:" OFFLINE"})]})]}),(0,f.jsxs)("div",{style:{textAlign:"right"},children:[(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:16,fontWeight:700},children:Gm(e.total)}),(0,f.jsxs)("button",{type:"button",onClick:()=>t.downloadPdf("/documents/confirmation/".concat(e.event_id)),style:(0,m.A)((0,m.A)({},$p),{},{marginTop:8}),children:[(0,f.jsx)(kt.A,{size:13,strokeWidth:2.2})," PDF"]})]})]})},e.id))]}):(0,f.jsx)(Gp,{})}function Wx(e){let{api:t,account:s}=e;const[n,r]=(0,a.useState)(null);return(0,a.useEffect)(()=>{t.request("/quotes").then(r).catch(()=>r({quotes:[],counts:{}}))},[t]),n?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(Hp,{children:["From the portal at ",(0,f.jsx)("strong",{children:s.portalHost})," \u2014 ",n.counts.all," total, ",n.counts.booked," booked, ",n.counts.in_progress," in progress."]}),0===n.quotes.length&&(0,f.jsx)(Up,{children:"Nothing in flight."}),n.quotes.map(e=>(0,f.jsx)(Mp,{style:{marginBottom:10},children:(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:14,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:e.event_name}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:3},children:[Vm(e.event_date,e.date_tbc)," \xb7 ",e.contact.name||"unknown contact","draft"===e.kind?" \xb7 step ".concat(e.step):" \xb7 ".concat(e.job_ref)]})]}),(0,f.jsxs)("div",{style:{textAlign:"right"},children:[(0,f.jsx)(Jp,{bg:"booked"===e.kind?ed.successBg:ed.infoBg,fg:"booked"===e.kind?ed.successFg:ed.infoFg,children:"booked"===e.kind?"BOOKED":"IN PROGRESS"}),(0,f.jsx)("div",{style:{fontFamily:ad,fontSize:15,fontWeight:700,marginTop:6},children:e.priced?Gm(e.total):"\u2014"})]})]})},"".concat(e.kind,"-").concat(e.event_id)))]}):(0,f.jsx)(Gp,{})}function Ox(e){let{api:t,rows:s,onChanged:n}=e;const[r,i]=(0,a.useState)(null),[o,l]=(0,a.useState)(null),[c,d]=(0,a.useState)([]),[p,x]=(0,a.useState)(!1),[h,u]=(0,a.useState)("");(0,a.useEffect)(()=>{t.request("/crew").then(e=>i(e.crew||[])).catch(()=>i([]))},[t]);if(!r)return(0,f.jsx)(Gp,{});const g=s.filter(e=>"open"!==e.state||(e.crew_members||[]).length);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(Hp,{children:["Assigning crew ",(0,f.jsx)("strong",{children:"locks the client out of editing their package"}),". Lock explicitly when the coverage is final \u2014 the two are separate on purpose."]}),h&&(0,f.jsx)(Hp,{tone:"warn",children:h}),0===g.length&&(0,f.jsx)(Up,{children:"Nothing booked or drafted yet, so there\u2019s no crew to assign."}),g.map(e=>(0,f.jsxs)(Mp,{style:{marginBottom:10},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:14,alignItems:"flex-start",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:15,fontWeight:700},children:e.name}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:2},children:[Vm(e.event_date,e.date_tbc),e.venue?" \xb7 ".concat(e.venue):""]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,f.jsx)("button",{type:"button",onClick:()=>(async e=>{x(!0);try{await t.request("/events/".concat(e.event_id,"/").concat(e.crew_locked?"unlock-crew":"lock-crew"),{method:"POST"}),await n()}catch(s){u(s.message)}finally{x(!1)}})(e),disabled:p,style:$p,children:e.crew_locked?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Qd.A,{size:13})," Unlock"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ht.A,{size:13})," Lock crew"]})}),o===e.event_id?(0,f.jsx)("button",{type:"button",onClick:()=>(async e=>{x(!0),u("");try{await t.request("/events/".concat(e.event_id,"/crew"),{method:"PUT",body:JSON.stringify({crew:c})}),await n(),l(null)}catch(s){u(s.message)}finally{x(!1)}})(e),disabled:p,style:Zp,children:p?"Saving\u2026":"Save crew"}):(0,f.jsxs)("button",{type:"button",onClick:()=>(e=>{l(e.event_id),d((e.crew_members||[]).map(e=>({id:e.id,role:e.role||"crew"})))})(e),style:Zp,children:[(0,f.jsx)(Xe.A,{size:14})," ",(e.crew_members||[]).length?"Change crew":"Assign crew"]})]})]}),o===e.event_id?(0,f.jsx)("div",{style:{marginTop:14,display:"grid",gap:7},children:r.map(e=>{const t=c.find(t=>
1t.id===e.id);return(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",background:t?"#FEF7F6":"#fff",border:"1px solid ".concat(t?ed.red:ed.adminBorder),borderRadius:10,padding:"9px 12px"},children:[(0,f.jsx)("input",{type:"checkbox",checked:!!t,onChange:t=>d(s=>t.target.checked?[...s,{id:e.id,role:"photographer"}]:s.filter(t=>t.id!==e.id))}),(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600},children:e.name}),t&&(0,f.jsx)("select",{value:t.role,onChange:t=>d(s=>s.map(s=>s.id===e.id?(0,m.A)((0,m.A)({},s),{},{role:t.target.value}):s)),style:(0,m.A)((0,m.A)({},Kp),{},{marginLeft:"auto",width:190,padding:"7px 9px",fontSize:12.5}),children:["photographer","second_photographer","videographer","second_videographer","voxpop_videographer","editor","remote_editor","producer","crew"].map(e=>(0,f.jsx)("option",{value:e,children:e.replace(/_/g," ")},e))})]},e.id)})}):(0,f.jsxs)("div",{style:{display:"grid",gap:7,marginTop:12},children:[(e.crew_members||[]).map(e=>(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center"},children:[(0,f.jsx)("span",{style:{width:26,height:26,borderRadius:7,background:ed.adminCanvas,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:td,fontSize:10.5,fontWeight:700},children:(e.name||"").split(/\s+/).map(e=>e[0]).slice(0,2).join("").toUpperCase()}),(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600},children:e.name}),(0,f.jsx)("span",{style:{fontFamily:ad,fontSize:9.5,color:ed.textFaint,letterSpacing:".12em"},children:(e.role||"crew").replace(/_/g," ").toUpperCase()})]},e.id||e.name)),0===(e.crew_members||[]).length&&(0,f.jsx)("div",{style:{fontSize:13,color:ed.textMuted},children:"No crew assigned yet."})]})]},e.event_id))]})}function Lx(e){let{contacts:t}=e;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(Hp,{children:["This list ",(0,f.jsx)("strong",{children:"is"})," the portal allow-list \u2014 anyone here can request a sign-in link. Manage them in ",(0,f.jsx)("a",{href:"/admin/clients",style:Yp,children:"Clients"}),"."]}),(0,f.jsx)("div",{className:"kah-2up",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:t.map(e=>(0,f.jsx)(Mp,{children:(0,f.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[(0,f.jsx)("span",{style:{width:38,height:38,borderRadius:10,background:ed.adminCanvas,display:"flex",alignItems:"center",justifyContent:"center",fontFamily:td,fontSize:13,fontWeight:700,flexShrink:0},children:(e.name||"?").split(/\s+/).map(e=>e[0]).slice(0,2).join("").toUpperCase()}),(0,f.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,f.jsx)("div",{style:{fontFamily:td,fontSize:14.5,fontWeight:700},children:e.name||"\u2014"}),(0,f.jsxs)("div",{style:{fontSize:12.5,color:ed.textSecondary,marginTop:2,wordBreak:"break-word"},children:[e.position?"".concat(e.position," \xb7 "):"",e.email]}),(0,f.jsxs)("div",{style:{fontFamily:ad,fontSize:9,letterSpacing:".14em",color:ed.textFaint,marginTop:6},children:["LAST SIGN-IN ",e.last_sign_in?Vm(e.last_sign_in).toUpperCase():"NEVER"]})]}),(0,f.jsx)(Jp,{bg:e.is_company?"#3A1A1D":ed.successBg,fg:e.is_company?ed.amber:ed.successFg,children:e.is_company?"COMPANY":"CAN BOOK"})]})},e.id))})]})}const Mx={red:"#E42313",burgundy:"#64150D",black:"#000000",white:"#FFFFFF",ice:"#D3F4EA",turquoise:"#75D3BC",orange:"#FF8500",peach:"#FFF3E9",taupe:"#FFFBF1",hairline:"#E0DAD0",divider:"#EDE6DA",focus:"#165766"},qx="'Saira Condensed', 'Arial Narrow', sans-serif",Hx="'Nunito Sans', system-ui, -apple-system, sans-serif",Ux="\n @keyframes lb-beat { 0%,100% { transform: scale(1); } 50% { transform: scale(.88); } }\n @keyframes lb-fade { from { opacity: 0; } to { opacity: 1; } }\n",Gx=(e,t)=>({width:t,height:t,background:e,clipPath:"polygon(85.33% 50%,100% 64.67%,64.67% 100%,50% 85.33%,35.33% 100%,0% 64.67%,14.67% 50%,0% 35.33%,35.33% 0%,50% 14.67%,64.67% 0%,100% 35.33%)",flexShrink:0}),Vx={invalid:"That link isn't valid any more. Enter your email and we'll send a fresh one.",expired:"That link has expired. Enter your email and we'll send a fresh one.",used:"That link has already been used. Enter your email for a new one.",noaccess:"That account doesn't have portal access. Email [email protected] and we'll sort it.",expiredsession:"Your session ended. Sign in again to pick up where you left off."},Jx=[{n:"7",label:"Fixed-price services as per Turbo agreement"},{n:"1",label:"Approver \u2014 Toney Wilkinson signs off every job"},{n:"0",label:"Passwords to remember"}];function Yx(){const e=(0,r.Zp)(),[t]=(0,r.ok)(),s=t.get("token"),n=t.get("session"),i=t.get("show"),[o,l]=(0,a.useState)(n?"done":s?"verifying":"form"),[c,p]=(0,a.useState)(t.get("email")||""),[x,h]=(0,a.useState)(""),[u,g]=(0,a.useState)(null),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(Vx[t.get("reason")]||""),[w,N]=(0,a.useState)(!1),A=(0,a.useRef)(!1),k=(0,a.useCallback)((e,t)=>{try{sessionStorage.setItem("turbo360_client_session",JSON.stringify({token:e,client_id:null===t||void 0===t?void 0:t.id,email:null===t||void 0===t?void 0:t.email,is_admin_impersonation:!1}))}catch(s){}},[]),S=(0,a.useCallback)(()=>{e(i?"/client-portal/dashboard?show=".concat(encodeURIComponent(i)):"/client-portal/dashboard")},[e,i]);(0,a.useEffect)(()=>{n&&!A.current&&(A.current=!0,k(n,null),window.history.replaceState({},"","/lifeblood/login"),(async()=>{try{const e=await fetch("".concat(I.fn,"/api/client-portal/dashboard"),{headers:{Authorization:"Bearer ".concat(n)}});if(e.ok){const t=await e.json();g((0,m.A)((0,m.A)({},t.client),{},{is_approver:t.is_lifeblood_approver})),k(n,t.client)}}catch(e){}})())},[n,k]);const _=(0,a.useRef)(!1);(0,a.useEffect)(()=>{_.current||s||n||t.get("email")&&(_.current=!0,window.history.replaceState({},"","/lifeblood/login"))},[t,s,n]),(0,a.useEffect)(()=>{s&&!A.current&&(A.current=!0,(async()=>{try{const e=await fetch("".concat(I.fn,"/api/lifeblood/auth/verify?token=").concat(encodeURIComponent(s))),t=await e.json();if(!e.ok)throw new Error(t.detail||"That link isn't valid.");k(t.token,t.contact),g(t.contact),window.history.replaceState({},"","/lifeblood/login"),l("done")}catch(e){j(e.message),l("form")}})())},[s,k]);const C=(0,a.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];y(!0),j("");try{if(!(await fetch("".concat(I.fn,"/api/lifeblood/auth/request-link"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})})).ok)throw new Error("Something went wrong. Try again in a moment.");h(e),l("sent"),t&&(N(!0),window.setTimeout(()=>N(!1),4e3))}catch(s){j(s.message)}finally{y(!1)}},[]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"Lifeblood Portal Sign-in | Turbo 360"}),(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,f.jsx)("style",{children:"\n ".concat(Ux,"\n .lb-login { display:grid; grid-template-columns:1.05fr 1fr; min-height:100vh; }\n .lb-input:focus { outline:3px solid ").concat(Mx.focus,"33; outline-offset:0; border-color:").concat(Mx.black,"; }\n .lb-cta:hover:not(:disabled) { background:").concat(Mx.burgundy,"; }\n .lb-link:hover { color:").concat(Mx.burgundy,"; }\n @media (max-width: 900px) {\n .lb-login { grid-template-columns:1fr; }\n .lb-brand { min-height:420px; }\n }\n ")}),(0,f.jsxs)("div",{className:"lb-login",style:{fontFamily:Hx,background:Mx.white},children:[(0,f.jsxs)("div",{className:"lb-brand",style:{position:"relative",display:"flex",alignItems:"flex-end",overflow:"hidden"},children:[(0,f.jsx)("div",{style:{position:"absolute",inset:0,backgroundImage:"url(/lifeblood/lab-donor.jpg)",backgroundSize:"cover",backgroundPosition:"center 35%"}}),(0,f.jsx)("div",{style:{position:"absolute",inset:0,background:"rgba(0,0,0,.5)"}}),(0,f.jsxs)("div",{style:{position:"relative",padding:"44px 56px",color:Mx.white,width:"100%"},children:[(0,f.jsx)("div",{style:{fontFamily:qx,fontWeight:700,fontSize:14,letterSpacing:".14em",textTransform:"uppercase"},children:"Job requests \xb7 Turbo 360"}),(0,f.jsxs)("h1",{style:{fontFamily:qx,fontWeight:700,fontSize:"clamp(38px,4.6vw,58px)",lineHeight:1.02,textTransform:"uppercase",margin:"14px 0 0"},children:["Production",(0,f.jsx)("br",{}),"Portal"]}),(0,f.jsx)("p",{style:{maxWidth:460,fontSize:16,lineHeight:1.6,margin:"18px 0 0",color:"rgba(255,255,255,.92)"},children:"Raise a filming, photography, live stream or podcast request against the Turbo\xa0+\xa0Lifeblood agreement \u2014 see the price before you send it."}),(0,f.jsx)("div",{style:{display:"flex",margin:"34px 0 0",maxWidth:560},children:Jx.map((e,t)=>(0,f.jsxs)("div",{style:{flex:1,minWidth:0,paddingRight:16,marginRight:16,borderRight:t<Jx.length-1?"1px solid rgba(255,255,255,.45)":"none"},children:[(0,f.jsx)("div",{style:{fontFamily:qx,fontWeight:700,fontSize:34,lineHeight:1},children:e.n}),(0,f.jsx)("div",{style:{fontSize:12.5,lineHeight:1.4,marginTop:6,color:"rgba(255,255,255,.86)"},children:e.label})]},e.n+e.label))}),(0,f.jsx)("div",{style:{marginTop:34,fontSize:12.5,letterSpacing:".06em",color:"rgba(255,255,255,.75)"},children:"Production services by Turbo Productions"})]})]}),(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"clamp(28px,5vw,56px)"},children:(0,f.jsxs)("div",{style:{width:"100%",maxWidth:400,animation:"lb-fade .35s ease"}
1,children:[(0,f.jsx)("img",{src:"/lifeblood/lifeblood-device-tagline.png",alt:"Australian Red Cross Lifeblood",style:{width:190,height:"auto",display:"block",margin:"0 auto 34px"}}),"form"===o&&(0,f.jsx)(eh,{email:c,setEmail:p,error:v,busy:b,onSubmit:e=>{e.preventDefault();const t=c.trim();t&&t.includes("@")?(l("sending"),C(t)):j("Enter your work email address.")}}),"sending"===o&&(0,f.jsxs)(Xx,{children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gx(Mx.red,44)),{},{margin:"0 auto",animation:"lb-beat 1.2s ease-in-out infinite"})}),(0,f.jsx)($x,{children:"Sending your link"}),(0,f.jsx)(Qx,{children:"One moment."})]}),"sent"===o&&(0,f.jsx)(th,{sentTo:x,resent:w,busy:b,onResend:()=>C(x,!0),onDifferent:()=>{l("form"),p(""),j("")}}),"verifying"===o&&(0,f.jsxs)(Xx,{children:[(0,f.jsx)("div",{style:{display:"flex",gap:10,justifyContent:"center"},children:[Mx.red,Mx.orange,Mx.turquoise].map((e,t)=>(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gx(e,28)),{},{animation:"lb-beat 1.3s ease-in-out ".concat(.18*t,"s infinite")})},e))}),(0,f.jsx)($x,{children:"Verifying your link"}),(0,f.jsx)(Qx,{children:"Signing you in."})]}),"done"===o&&(0,f.jsxs)(Xx,{children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gx(Mx.turquoise,44)),{},{margin:"0 auto"})}),(0,f.jsx)(Zx,{children:"Signed in"}),(0,f.jsx)($x,{children:null!==u&&void 0!==u&&u.contact_name||null!==u&&void 0!==u&&u.name?"Welcome back, ".concat((u.contact_name||u.name).split(" ")[0]):"Welcome back"}),(0,f.jsx)(Qx,{children:null!==u&&void 0!==u&&u.is_approver?"You're signed in as the approver \u2014 job requests waiting on you are at the top of your portal.":"Your requests, invoices and deliverables are ready."}),(0,f.jsx)("button",{type:"button",className:"lb-cta",onClick:S,style:Kx,children:"Open my portal"})]})]})})]})]})}const Kx={width:"100%",marginTop:24,padding:"17px 20px",background:Mx.red,color:Mx.white,border:"none",borderRadius:0,fontFamily:Hx,fontSize:16,fontWeight:700,cursor:"pointer",transition:"background ".concat(".3s ease")},Zx=e=>{let{children:t}=e;return(0,f.jsx)("div",{style:{fontFamily:qx,fontWeight:700,fontSize:13,letterSpacing:".16em",textTransform:"uppercase",color:Mx.red,marginTop:22},children:t})},$x=e=>{let{children:t}=e;return(0,f.jsx)("h2",{style:{fontFamily:qx,fontWeight:700,fontSize:"clamp(30px,3.4vw,42px)",lineHeight:1.04,textTransform:"uppercase",color:Mx.black,margin:"10px 0 0"},children:t})},Qx=e=>{let{children:t}=e;return(0,f.jsx)("p",{style:{fontSize:16,lineHeight:1.6,color:Mx.black,margin:"14px 0 0"},children:t})},Xx=e=>{let{children:t}=e;return(0,f.jsx)("div",{style:{textAlign:"center",animation:"lb-fade .3s ease"},children:t})};function eh(e){let{email:t,setEmail:s,error:a,busy:n,onSubmit:r}=e;return(0,f.jsxs)("form",{onSubmit:r,noValidate:!0,children:[(0,f.jsx)(Zx,{children:"Login"}),(0,f.jsx)($x,{children:"Sign in"}),(0,f.jsx)(Qx,{children:"Pop in your work email and we'll send you a single-use link. No password \u2014 it signs you straight in."}),(0,f.jsxs)("label",{style:{display:"block",marginTop:26},children:[(0,f.jsx)("span",{style:{display:"block",fontSize:14,fontWeight:700,color:Mx.black,marginBottom:8},children:"Work email"}),(0,f.jsx)("input",{className:"lb-input",type:"email",autoComplete:"email",autoFocus:!0,value:t,onChange:e=>s(e.target.value),placeholder:"[email protected]",style:{width:"100%",boxSizing:"border-box",padding:"15px 16px",fontSize:16,fontFamily:Hx,color:Mx.black,background:Mx.white,border:"1px solid ".concat(Mx.black),borderRadius:0,outline:"none"}})]}),a&&(0,f.jsx)("div",{role:"alert",style:{marginTop:14,padding:"12px 14px",background:Mx.peach,border:"1px solid ".concat(Mx.orange),fontSize:14.5,lineHeight:1.5,color:Mx.burgundy},children:a}),(0,f.jsx)("button",{type:"submit",className:"lb-cta",disabled:n,style:(0,m.A)((0,m.A)({},Kx),{},{opacity:n?.6:1}),children:n?"Sending\u2026":"Email me a sign-in link"}),(0,f.jsxs)("p",{style:{fontSize:13.5,lineHeight:1.55,color:Mx.burgundy,margin:"18px 0 0"},children:["Access is limited to approved Lifeblood contacts. If your address isn't recognised, ask us to add it \u2014 ",(0,f.jsx)("a",{className:"lb-link",href:"mailto:[email protected]",style:{color:Mx.red,fontWeight:700},children:"[email protected]"}),"."]})]})}function th(e){let{sentTo:t,resent:s,busy:a,onResend:n,onDifferent:r}=e;return(0,f.jsxs)("div",{style:{animation:"lb-fade .3s ease"},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gx(Mx.turquoise,44)),{},{margin:"0 auto"})}),(0,f.jsx)("div",{style:{textAlign:"center"},children:(0,f.jsx)($x,{children:"Check your inbox"})}),(0,f.jsxs)("p",{style:{fontSize:16,lineHeight:1.6,color:Mx.black,margin:"14px 0 0",textAlign:"center"},children:["If ",(0,f.jsx)("strong",{children:t})," has portal access, a sign-in link is on its way. It works once and expires in two hours."]}),(0,f.jsxs)("div",{style:{marginTop:26,padding:"16px 18px",background:Mx.peach,border:"1px solid ".concat(Mx.hairline)},children:[(0,f.jsx)("div",{style:{fontFamily:qx,fontWeight:700,fontSize:15,letterSpacing:".08em",textTransform:"uppercase",color:Mx.black},children:"Didn't arrive?"}),(0,f.jsx)("p",{style:{fontSize:14.5,lineHeight:1.55,color:Mx.burgundy,margin:"8px 0 14px"},children:"Check your spam folder, or resend below. The newest link is always the only valid one."}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"},children:[(0,f.jsx)("button",{type:"button",onClick:n,disabled:a,style:{padding:"11px 18px",background:s?Mx.ice:Mx.white,border:"1px solid ".concat(Mx.black),borderRadius:0,fontFamily:Hx,fontSize:14.5,fontWeight:700,color:Mx.black,cursor:"pointer"},children:s?"Link resent \u2713":a?"Sending\u2026":"Resend link"}),(0,f.jsx)("button",{type:"button",onClick:r,className:"lb-link",style:{background:"none",border:"none",padding:0,fontFamily:Hx,fontSize:14.5,fontWeight:700,color:Mx.red,cursor:"pointer",textDecoration:"underline"},children:"Use a different email"})]})]})]})}const sh="'Space Mono',monospace",ah="[email protected]",nh=()=>{try{var e;return(null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token)||null}catch(t){return null}},rh=["New Job","Awaiting PO","Invoice Sent","Invoice Paid"],ih={pending_lifeblood_approval:{label:"Awaiting Toney",bg:"#FEF3C7",fg:"#92400E"},accepted_lifeblood:{label:"Accepted",bg:"#D1FAE5",fg:"#065F46"},declined_lifeblood:{label:"Declined",bg:"#FEE2E2",fg:"#991B1B"},travel_sent:{label:"Travel \u2014 sent",bg:"#DBEAFE",fg:"#1E40AF"},travel_draft:{label:"Travel \u2014 draft",bg:"#F4F4F6",fg:"#55555C"}},oh={"New Job":{bg:"#E0E7FF",fg:"#3730A3"},"Awaiting PO":{bg:"#FEF3C7",fg:"#92400E"},"Invoice Sent":{bg:"#DBEAFE",fg:"#1E40AF"},"Invoice Paid":{bg:"#D1FAE5",fg:"#065F46"},Declined:{bg:"#FEE2E2",fg:"#991B1B"}},lh=e=>({display:"inline-block",padding:"2px 10px",borderRadius:999,fontSize:11.5,fontWeight:600,whiteSpace:"nowrap",background:(null===e||void 0===e?void 0:e.bg)||"#F4F4F6",color:(null===e||void 0===e?void 0:e.fg)||"#55555C"}),ch=e=>null==e?"\u2014":new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(e),dh=e=>{if(!e)return"\u2014";const t=new Date(e);return isNaN(t)?"\u2014":t.toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"})},mh=e=>{if(!e)return"";const t=new Date(e);if(isNaN(t))return"";const s=Math.floor((Date.now()-t.getTime())/864e5);return s<=0?"today":1===s?"yesterday":"".concat(s,"d ago")},ph=e=>e.ref_code||(e.id?String(e.id).slice(0,8).toUpperCase():"\u2014"),xh=e=>{let{company:t}=e;const s=(0,r.Zp)(),{toast:n}=N(),[i,o]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,m]=(0,a.useState)(null),[p,x]=(0,a.useState)(null),[h,u]=(0,a.useState)(""),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)(!1),w=()=>({Authorization:"Bearer ".concat(nh()),"Content-Type":"application/json"}),A=(0,a.useCallback)(async()=>{try{const e=await fetch("".concat(I.fn,"/api/lifeblood/job-requests"),{headers:w()});if(e.ok){const t=await e.json();o(t.job_requests||[])}else n.error("Failed to load job requests")}catch(e){n.error("Failed to load job requests")}finally{c(!1)}},[]);(0,a.useEffect)(()=>{A()},[A]);const k=async(e,t)=>{m(e);try{const s=await fetch("".concat(I.fn,"/api/lifeblood/job-requests/").concat(e),{method:"PATCH",headers:w(),body:JSON.stringify(t)}),a=await s.json().catch(()=>({}));
1if(!s.ok)return void n.error(a.detail||"Update failed");o(t=>t.map(t=>t.id===e?a.job_request:t)),n.success("Saved")}catch(s){n.error("Update failed")}finally{m(t=>t===e?null:t)}};return(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"Job Requests"}),(0,f.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Approvals happen on Toney's portal dashboard. Status follows the linked invoice automatically (Awaiting PO \u2192 Invoice Sent \u2192 Invoice Paid); a manual status only takes effect when it's further along than the invoice-derived one."})]}),l?(0,f.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center text-gray-400",children:(0,f.jsx)(Kr.A,{className:"h-6 w-6 animate-spin mx-auto"})}):0===i.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(ws.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-500",children:"No job requests yet"})]}):(0,f.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-x-auto",children:(0,f.jsxs)("table",{className:"w-full",style:{minWidth:1140},children:[(0,f.jsx)("thead",{className:"bg-gray-50 border-b border-gray-200",children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Ref"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Submitted"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Project"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Submitter"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Total"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Approval"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Status"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"PO"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Invoice"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Reminder"})]})}),(0,f.jsx)("tbody",{className:"divide-y divide-gray-100",children:i.map(e=>{var t;return(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsx)("td",{className:"px-4 py-3 font-medium text-gray-900",style:{fontFamily:sh,fontSize:13},children:e.ref_code||(e.id?String(e.id).slice(0,8).toUpperCase():"\u2014")}),(0,f.jsx)("td",{className:"px-4 py-3 text-sm text-gray-500",children:dh(e.created_at)}),(0,f.jsxs)("td",{className:"px-4 py-3 text-sm text-gray-900",children:[e.project_title||e.service||"\u2014",e.location&&(0,f.jsx)("span",{className:"block text-xs text-gray-400",children:e.location})]}),(0,f.jsx)("td",{className:"px-4 py-3 text-sm text-gray-500",children:e.submitter_name||e.name||"\u2014"}),(0,f.jsx)("td",{className:"px-4 py-3 text-sm text-gray-900",style:{fontFamily:sh},children:ch(e.total_inc_gst)}),(0,f.jsx)("td",{className:"px-4 py-3",children:(0,f.jsx)("span",{style:lh(ih[e.status]),children:(null===(t=ih[e.status])||void 0===t?void 0:t.label)||e.status||"\u2014"})}),(0,f.jsxs)("td",{className:"px-4 py-3",children:[(0,f.jsx)("span",{style:lh(oh[e.fulfillment_status]),children:e.fulfillment_status||"\u2014"}),e.fulfillment_override&&(0,f.jsx)("span",{title:"Manual status override active",style:{marginLeft:6,fontFamily:sh,fontSize:9,color:"#BF212F",fontWeight:700},children:"MANUAL"}),("accepted_lifeblood"===e.status||"travel_expense"===e.record_type)&&(0,f.jsxs)("select",{value:e.fulfillment_override||"auto",disabled:d===e.id,onChange:t=>{const s="auto"===t.target.value?null:t.target.value;k(e.id,{fulfillment_override:s})},className:"block mt-1 text-xs border border-gray-200 rounded-md px-1.5 py-1 text-gray-600 bg-white cursor-pointer",children:[(0,f.jsx)("option",{value:"auto",children:"Auto (from invoice)"}),rh.map(e=>(0,f.jsx)("option",{value:e,children:e},e))]})]}),(0,f.jsx)("td",{className:"px-4 py-3",children:p===e.id?(0,f.jsx)("input",{autoFocus:!0,value:h,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&x(null)},onBlur:()=>(e=>{const t=h.trim();x(null),t!==(e.po_number||"")&&k(e.id,{po_number:t})})(e),placeholder:"PO number",style:{width:110,fontFamily:sh,fontSize:12,padding:"4px 6px",border:"1px solid #E4E4E9",borderRadius:6,outline:"none"}}):(0,f.jsx)("button",{onClick:()=>{x(e.id),u(e.po_number||"")},disabled:d===e.id,title:"Click to edit PO number (also stamped on the linked invoice)",style:{fontFamily:sh,fontSize:12,background:"none",border:"none",cursor:"pointer",color:e.po_number?"#0A0A0B":"#9A9AA0",textDecoration:"underline dotted",padding:0},children:d===e.id?"Saving\u2026":e.po_number||"add PO"})}),(0,f.jsx)("td",{className:"px-4 py-3",children:e.invoice_id?(0,f.jsxs)("button",{onClick:()=>s("/admin/invoices/".concat(e.invoice_id)),className:"text-blue-600 hover:text-blue-700 text-sm font-medium",style:{fontFamily:sh,fontSize:12.5},children:[e.invoice_number,e.invoice_status&&(0,f.jsx)("span",{className:"block text-xs text-gray-400 font-normal text-left",children:e.invoice_status})]}):(0,f.jsx)("span",{className:"text-sm text-gray-400",children:"\u2014"})}),(0,f.jsx)("td",{className:"px-4 py-3",children:"Awaiting PO"===e.fulfillment_status?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("button",{onClick:()=>y(e),title:"Email Toney a reminder that we're awaiting a PO",className:"text-sm font-medium flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-white whitespace-nowrap",style:{background:e.po_reminder_count>0?"#55555C":"#BF212F"},children:[(0,f.jsx)(st.A,{className:"h-3.5 w-3.5"}),e.po_reminder_count>0?"Remind again":"Send Reminder"]}),e.po_reminder_count>0&&(0,f.jsxs)("span",{className:"block text-xs text-gray-400 mt-1",children:["Reminded ",mh(e.po_reminder_last_sent_at),e.po_reminder_count>1&&" \xb7 \xd7".concat(e.po_reminder_count)]})]}):(0,f.jsx)("span",{className:"text-sm text-gray-400",children:"\u2014"})})]},e.id)})})]})}),b&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl max-w-md w-full overflow-hidden",children:[(0,f.jsxs)("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Send PO Reminder"}),(0,f.jsx)("button",{onClick:()=>y(null),className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsxs)("div",{className:"p-5 space-y-3 text-sm",children:[(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"To"}),(0,f.jsxs)("span",{className:"font-medium text-gray-900 text-right",children:["Toney Wilkinson",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-xs text-gray-500",children:"[email protected]"})]})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"CC"}),(0,f.jsxs)("span",{className:"font-medium text-gray-900 text-right",children:[ah,"travel_expense"===b.record_type&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("br",{}),"[email protected]"]})]})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"Attachment"}),(0,f.jsx)("span",{className:"font-medium text-gray-900 text-right",style:{fontFamily:sh,fontSize:12},children:(S=b,"travel_expense"===S.record_type?"Turbo360-TravelExpense-".concat(ph(S),".pdf"):"Turbo360-Proposal-".concat(ph(S),".pdf"))})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"Reference"}),(0,f.jsx)("span",{className:"font-medium text-gray-900",style:{fontFamily:sh,fontSize:12},children:ph(b)})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"Total (incl. GST)"}),(0,f.jsx)("span",{className:"font-bold text-gray-900",style:{fontFamily:sh},children:ch(b.total_inc_gst)})]}),b.po_reminder_count>0&&(0,f.jsxs)("p",{className:"text-xs pt-1",style:{color:"#B45309"},children:["Already reminded ",1===b.po_reminder_count?"once":"".concat(b.po_reminder_count," times")," ","(last ",mh(b.po_reminder_last_sent_at),")."]}),(0,f.jsxs)("p",{className:"text-xs text-gray-400 pt-1",children:["Toney will be asked to issue a Purchase Order to ",ah," quoting ",ph(b),"."]})]}),(0,f.jsxs)("div",{className:"p-4 border-t border-gray-200 flex justify-end gap-3",children:[(0,f.jsx)("button",{onClick:()=>y(null),className:"px-4 py-2 border border-gray-200 text-gray-600 rounded-xl font-medium hover:bg-gray-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>
1{if(!b)return;const{id:e}=b,t=ph(b);j(!0);try{const s=await fetch("".concat(I.fn,"/api/lifeblood/job-requests/").concat(e,"/po-reminder"),{method:"POST",headers:w()}),a=await s.json().catch(()=>({}));if(!s.ok)return n.error(a.detail||"Failed to send reminder \u2014 nothing was sent"),409===s.status&&A(),void y(null);o(t=>t.map(t=>t.id===e?a.job_request:t)),n.success("PO reminder for ".concat(t," sent to Toney")),y(null)}catch(s){n.error("Failed to send reminder \u2014 nothing was sent")}finally{j(!1)}},disabled:v,className:"px-4 py-2 text-white rounded-xl font-medium flex items-center gap-2 disabled:opacity-60",style:{background:"#BF212F"},children:[v?(0,f.jsx)(Kr.A,{className:"h-4 w-4 animate-spin"}):(0,f.jsx)(st.A,{className:"h-4 w-4"}),v?"Sending\u2026":"Send Reminder"]})]})]})})]});var S},hh="'Space Mono',monospace",uh=()=>{try{var e;return(null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token)||null}catch(t){return null}},gh=()=>({key:"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),description:"",quantity:1,unit_price:"",gst_free:!1}),fh=()=>({project_title:"",date_required:"",location:"",notes:"",items:[gh()]}),bh=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(e||0),yh=e=>{let{company:t}=e;const s=(0,r.Zp)(),{toast:n}=N(),[i,o]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,p]=(0,a.useState)(!1),[x,h]=(0,a.useState)(null),[u,b]=(0,a.useState)(fh()),[y,v]=(0,a.useState)(!1),[j,w]=(0,a.useState)(null),[A,k]=(0,a.useState)(!1),S=()=>({Authorization:"Bearer ".concat(uh()),"Content-Type":"application/json"}),_=(0,a.useCallback)(async()=>{try{const e=await fetch("".concat(I.fn,"/api/lifeblood/travel-expenses?company_id=").concat(t.id),{headers:S()});if(e.ok){const t=await e.json();o(t.travel_expenses||[])}else n.error("Failed to load travel expenses")}catch(e){n.error("Failed to load travel expenses")}finally{c(!1)}},[t.id]);(0,a.useEffect)(()=>{_()},[_]);const C=e=>(parseFloat(e.quantity)||0)*(parseFloat(e.unit_price)||0),F=u.items.reduce((e,t)=>e+C(t),0),E=.1*u.items.reduce((e,t)=>e+(t.gst_free?0:C(t)),0),T=F+E,z=u.items.some(e=>e.gst_free&&C(e)>0),B=(e,t,s)=>{b(a=>{const n=[...a.items];return n[e]=(0,m.A)((0,m.A)({},n[e]),{},{[t]:s}),(0,m.A)((0,m.A)({},a),{},{items:n})})},D=()=>{p(!1),h(null),b(fh())},R="w-full px-3 py-2 border border-gray-200 rounded-lg text-sm focus:outline-none focus:border-gray-400";return(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"Travel Expenses"}),(0,f.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:"Quoted at cost to Toney Wilkinson for a Purchase Order. Saving also creates a draft invoice."})]}),!d&&(0,f.jsxs)("button",{onClick:()=>{h(null),b(fh()),p(!0)},className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"New Travel Expense"]})]}),d&&(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,f.jsxs)("h4",{className:"font-semibold text-gray-900 flex items-center gap-2",children:[(0,f.jsx)(Za.A,{className:"h-4 w-4 text-gray-400"}),x?"Edit Travel Expense":"New Travel Expense"]}),(0,f.jsx)("button",{onClick:D,className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Project *"}),(0,f.jsx)("input",{type:"text",value:u.project_title,onChange:e=>b(t=>(0,m.A)((0,m.A)({},t),{},{project_title:e.target.value})),placeholder:"e.g. LifeBlood LIVE - Sydney",className:R})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Date Required"}),(0,f.jsx)("input",{type:"date",value:u.date_required,onChange:e=>b(t=>(0,m.A)((0,m.A)({},t),{},{date_required:e.target.value})),className:R})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Location"}),(0,f.jsx)("input",{type:"text",value:u.location,onChange:e=>b(t=>(0,m.A)((0,m.A)({},t),{},{location:e.target.value})),placeholder:"e.g. Sydney",className:R})]})]}),(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsxs)("div",{className:"grid gap-2 text-xs font-medium text-gray-500 mb-2 px-1",style:{gridTemplateColumns:"1fr 60px 110px 80px 100px 30px"},children:[(0,f.jsx)("span",{children:"Description"}),(0,f.jsx)("span",{children:"Qty"}),(0,f.jsx)("span",{children:"Unit ex GST"}),(0,f.jsx)("span",{className:"text-center",children:"GST-free"}),(0,f.jsx)("span",{className:"text-right",children:"Line total"}),(0,f.jsx)("span",{})]}),u.items.map((e,t)=>(0,f.jsxs)("div",{className:"grid gap-2 items-center mb-2",style:{gridTemplateColumns:"1fr 60px 110px 80px 100px 30px"},children:[(0,f.jsx)("input",{type:"text",value:e.description,onChange:e=>B(t,"description",e.target.value),placeholder:"e.g. Flights MEL\u2013SYD return",className:R}),(0,f.jsx)("input",{type:"number",min:"0",step:"1",value:e.quantity,onChange:e=>B(t,"quantity",e.target.value),className:R}),(0,f.jsx)("input",{type:"number",min:"0",step:"0.01",value:e.unit_price,onChange:e=>B(t,"unit_price",e.target.value),placeholder:"0.00",className:R}),(0,f.jsx)("div",{className:"flex justify-center",children:(0,f.jsx)("input",{type:"checkbox",checked:e.gst_free,onChange:e=>B(t,"gst_free",e.target.checked),title:"GST-free (e.g. international flights)",style:{accentColor:"#BF212F",width:16,height:16,cursor:"pointer"}})}),(0,f.jsx)("span",{className:"text-right text-sm font-medium",style:{fontFamily:hh},children:bh(C(e))}),(0,f.jsx)("button",{onClick:()=>(e=>{b(t=>(0,m.A)((0,m.A)({},t),{},{items:t.items.filter((t,s)=>s!==e)}))})(t),disabled:1===u.items.length,className:"text-gray-300 hover:text-red-500 disabled:opacity-30 disabled:hover:text-gray-300",children:(0,f.jsx)(g.A,{className:"h-4 w-4"})})]},e.key)),(0,f.jsxs)("button",{onClick:()=>b(e=>(0,m.A)((0,m.A)({},e),{},{items:[...e.items,gh()]})),className:"text-blue-600 hover:text-blue-700 text-sm font-medium flex items-center gap-1 mt-1",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"})," Add line item"]})]}),(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Notes (internal)"}),(0,f.jsx)("textarea",{value:u.notes,onChange:e=>b(t=>(0,m.A)((0,m.A)({},t),{},{notes:e.target.value})),rows:2,className:R})]}),(0,f.jsx)("div",{className:"flex justify-end mb-4",children:(0,f.jsxs)("div",{className:"rounded-xl px-5 py-4 text-sm",style:{background:"#0A0A0B",color:"#fff",minWidth:260},children:[(0,f.jsxs)("div",{className:"flex justify-between gap-8 py-0.5",children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Subtotal (ex GST)"}),(0,f.jsx)("span",{style:{fontFamily:hh},children:bh(F)})]}),(0,f.jsxs)("div",{className:"flex justify-between gap-8 py-0.5",children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"GST (10%)"}),(0,f.jsx)("span",{style:{fontFamily:hh},children:bh(E)})]}),(0,f.jsxs)("div",{className:"flex justify-between gap-8 pt-2 mt-1 font-bold",style:{borderTop:"1px solid #333"},children:[(0,f.jsx)("span",{children:"Total (incl. GST)"}),(0,f.jsx)("span",{style:{fontFamily:hh},children:bh(T)})]}),z&&(0,f.jsx)("div",{className:"text-xs mt-2",style:{color:"#9A9AA0",fontStyle:"italic"},children:"GST applies to domestic items only"})]})}),(0,f.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,f.jsx)("button",{onClick:D,className:"px-4 py-2 border border-gray-200 text-gray-600 rounded-xl font-medium hover:bg-gray-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>
1{if(!u.project_title.trim())return void n.error("Project is required");const e=u.items.filter(e=>e.description.trim()||parseFloat(e.unit_price)>0);if(0===e.length||e.some(e=>!e.description.trim()))n.error("Each line item needs a description");else{v(!0);try{const s={project_title:u.project_title.trim(),date_required:u.date_required||"",location:u.location||"",notes:u.notes||"",line_items:e.map(e=>({description:e.description.trim(),quantity:parseFloat(e.quantity)||0,unit_price:parseFloat(e.unit_price)||0,gst_free:!!e.gst_free}))},a=x?"".concat(I.fn,"/api/lifeblood/travel-expenses/").concat(x):"".concat(I.fn,"/api/lifeblood/travel-expenses"),r=await fetch(a,{method:x?"PUT":"POST",headers:S(),body:JSON.stringify(x?s:(0,m.A)((0,m.A)({},s),{},{company_id:t.id}))}),i=await r.json().catch(()=>({}));if(!r.ok)return void n.error(i.detail||"Failed to save travel expense");x?(n.success("Updated ".concat(i.ref_code)),i.warning&&n.warning(i.warning,6e3)):n.success("Saved ".concat(i.ref_code).concat(i.invoice_number?" \u2014 draft invoice ".concat(i.invoice_number," created"):""),5e3),D(),_()}catch(s){n.error("Failed to save travel expense")}finally{v(!1)}}},disabled:y,className:"px-4 py-2 text-white rounded-xl font-medium flex items-center gap-2 disabled:opacity-60",style:{background:"#BF212F"},children:[y&&(0,f.jsx)(Kr.A,{className:"h-4 w-4 animate-spin"}),x?"Save Changes":"Save Travel Expense"]})]})]}),l?(0,f.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center text-gray-400",children:(0,f.jsx)(Kr.A,{className:"h-6 w-6 animate-spin mx-auto"})}):0===i.length?!d&&(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(Za.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-500",children:"No travel expenses yet"})]}):(0,f.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:(0,f.jsxs)("table",{className:"w-full",children:[(0,f.jsx)("thead",{className:"bg-gray-50 border-b border-gray-200",children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Ref"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Created"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Project"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Total (incl. GST)"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Status"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Invoice"}),(0,f.jsx)("th",{className:"px-4 py-3"})]})}),(0,f.jsx)("tbody",{className:"divide-y divide-gray-100",children:i.map(e=>{return(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsx)("td",{className:"px-4 py-3 font-medium text-gray-900",style:{fontFamily:hh,fontSize:13},children:e.ref_code}),(0,f.jsx)("td",{className:"px-4 py-3 text-sm text-gray-500",children:(t=e.created_at,t?new Date(t).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"}):"-")}),(0,f.jsx)("td",{className:"px-4 py-3 text-sm text-gray-900",children:e.project_title}),(0,f.jsx)("td",{className:"px-4 py-3 text-sm text-gray-900",style:{fontFamily:hh},children:bh(e.total_inc_gst)}),(0,f.jsx)("td",{className:"px-4 py-3",children:(0,f.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium ".concat("sent"===e.status?"bg-emerald-100 text-emerald-700":"bg-gray-100 text-gray-600"),children:"sent"===e.status?"Sent".concat(e.sent_count>1?" \xd7".concat(e.sent_count):""):"Draft"})}),(0,f.jsx)("td",{className:"px-4 py-3",children:e.invoice_id?(0,f.jsx)("button",{onClick:()=>s("/admin/invoices/".concat(e.invoice_id)),className:"text-blue-600 hover:text-blue-700 text-sm font-medium",style:{fontFamily:hh,fontSize:12.5},children:e.invoice_number}):(0,f.jsx)("span",{className:"text-sm text-gray-400",children:"\u2014"})}),(0,f.jsx)("td",{className:"px-4 py-3",children:(0,f.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[(0,f.jsx)("button",{onClick:()=>(e=>{window.open("".concat(I.fn,"/api/lifeblood/travel-expenses/").concat(e.id,"/pdf"),"_blank")})(e),title:"Preview quotation PDF",className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(kt.A,{className:"h-4 w-4"})}),"draft"===e.status&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{onClick:()=>(e=>{h(e.id),b({project_title:e.project_title||"",date_required:e.date_required||"",location:e.location||"",notes:e.notes||"",items:(e.line_breakdown||[]).map(e=>{var t,s;return{key:e.id,description:e.description||"",quantity:null!==(t=e.qty)&&void 0!==t?t:1,unit_price:null!==(s=e.unit_price_ex_gst)&&void 0!==s?s:"",gst_free:!!e.gst_free}})}),p(!0)})(e),title:"Edit",className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(Tn.A,{className:"h-4 w-4"})}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Delete travel expense ".concat(e.ref_code,"? Its draft invoice ").concat(e.invoice_number||""," will also be removed.")))try{const t=await fetch("".concat(I.fn,"/api/lifeblood/travel-expenses/").concat(e.id),{method:"DELETE",headers:S()}),s=await t.json().catch(()=>({}));if(!t.ok)return void n.error(s.detail||"Failed to delete travel expense");n.success("Deleted ".concat(e.ref_code)),_()}catch(t){n.error("Failed to delete travel expense")}})(e),title:"Delete",className:"text-gray-400 hover:text-red-500",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]}),(0,f.jsxs)("button",{onClick:()=>w(e),className:"text-sm font-medium flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-white",style:{background:"sent"===e.status?"#55555C":"#BF212F"},children:[(0,f.jsx)(st.A,{className:"h-3.5 w-3.5"}),"sent"===e.status?"Resend":"Send to Toney"]})]})})]},e.id);var t})})]})}),j&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl max-w-md w-full overflow-hidden",children:[(0,f.jsxs)("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Send Travel Expense Quotation"}),(0,f.jsx)("button",{onClick:()=>w(null),className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-5 w-5"})})]}),(0,f.jsxs)("div",{className:"p-5 space-y-3 text-sm",children:[(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"To"}),(0,f.jsxs)("span",{className:"font-medium text-gray-900 text-right",children:["Toney Wilkinson",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-xs text-gray-500",children:"[email protected]"})]})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"CC"}),(0,f.jsx)("span",{className:"font-medium text-gray-900",children:"[email protected]"})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"Attachment"}),(0,f.jsxs)("span",{className:"font-medium text-gray-900",style:{fontFamily:hh,fontSize:12},children:["Turbo360-TravelExpense-",j.ref_code,".pdf"]})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"Total (incl. GST)"}),(0,f.jsx)("span",{className:"font-bold text-gray-900",style:{fontFamily:hh},children:bh(j.total_inc_gst)})]}),(0,f.jsxs)("p",{className:"text-xs text-gray-400 pt-1",children:["Toney will be asked to raise a Purchase Order quoting ",j.ref_code,"."]})]}),(0,f.jsxs)("div",{className:"p-4 border-t border-gray-200 flex justify-end gap-3",children:[(0,f.jsx)("button",{onClick:()=>w(null),className:"px-4 py-2 border border-gray-200 text-gray-600 rounded-xl font-medium hover:bg-gray-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>
1{if(j){k(!0);try{const e=await fetch("".concat(I.fn,"/api/lifeblood/travel-expenses/").concat(j.id,"/send"),{method:"POST",headers:S()}),t=await e.json().catch(()=>({}));if(!e.ok)return void n.error(t.detail||"Failed to send \u2014 the travel expense was left unchanged");n.success("Quotation ".concat(j.ref_code," sent to Toney")),w(null),_()}catch(e){n.error("Failed to send \u2014 the travel expense was left unchanged")}finally{k(!1)}}},disabled:A,className:"px-4 py-2 text-white rounded-xl font-medium flex items-center gap-2 disabled:opacity-60",style:{background:"#BF212F"},children:[A?(0,f.jsx)(Kr.A,{className:"h-4 w-4 animate-spin"}):(0,f.jsx)(st.A,{className:"h-4 w-4"}),"sent"===j.status?"Resend":"Send"]})]})]})})]})},vh={carbon:"#0A0A0B",tile:"#0F0F11",line:"#2A2A2E",paper:"#EDEDF0",card:"#FFFFFF",border:"#E4E4E9",divider:"#F2F2F5",muted:"#9A9AA0",body:"#6B6B72",ink:"#3A3A40",red:"#E42313",amber:"#F2A900",teal:"#0FA3A3",green:"#16A34A"},jh="'Hanken Grotesk', -apple-system, sans-serif",wh="'Archivo', sans-serif",Nh={fontFamily:"'Space Mono', monospace"}
1,Ah=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",maximumFractionDigits:0}).format(Number(e)||0),kh=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:2}).format(Number(e)||0),Sh="Australia/Melbourne",_h=e=>{if(!e)return null;let t=String(e).trim().replace(" ","T");/\d{2}:\d{2}/.test(t)&&!/[zZ]|[+-]\d{2}:?\d{2}$/.test(t)&&(t+="Z");const s=new Date(t);return isNaN(s)?null:s},Ch=e=>{const t=_h(e);return t?"".concat(t.toLocaleDateString("en-AU",{timeZone:Sh,day:"2-digit",month:"short"})," \xb7 ").concat(t.toLocaleTimeString("en-AU",{timeZone:Sh,hour:"numeric",minute:"2-digit",hour12:!0})).toUpperCase():"\u2014"},Fh=e=>{const t=_h(e);return t?Math.max(0,Math.floor((Date.now()-t.getTime())/864e5)):null},Eh=()=>{try{var e;return null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token}catch(t){return null}},Th=["New Job","Awaiting PO","Invoice Sent","Invoice Paid"],zh=e=>{let{children:t,style:s}=e;return(0,f.jsx)("div",{style:(0,m.A)({background:vh.card,border:"1px solid ".concat(vh.border),borderRadius:14},s),children:t})},Bh=e=>{let{children:t}=e;return(0,f.jsx)("h2",{style:{margin:0,fontFamily:wh,fontWeight:800,fontSize:19,letterSpacing:"-0.01em",color:vh.carbon},children:t})},Dh=e=>{let{children:t,color:s=vh.muted}=e;return(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:10,letterSpacing:"0.14em",color:s,textTransform:"uppercase"}),children:t})};function Ih(e){let{label:t,value:s,sub:a,accent:n}=e;return(0,f.jsxs)("div",{style:{background:vh.tile,borderRadius:12,padding:"15px 16px",minWidth:0},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:9.5,letterSpacing:"0.14em",color:vh.muted,textTransform:"uppercase"}),children:t}),(0,f.jsx)("div",{style:{fontFamily:wh,fontWeight:800,fontSize:26,color:n||"#fff",marginTop:6,letterSpacing:"-0.02em"},children:s}),a&&(0,f.jsx)("div",{style:{fontSize:11.5,color:vh.muted,marginTop:3},children:a})]})}function Rh(e){let{row:t,onRemind:s}=e;const[n,r]=(0,a.useState)("idle"),[i,o]=(0,a.useState)(null),l="urgent"===t.tone?vh.red:"warn"===t.tone?vh.amber:"#3B82F6";return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:13,padding:"13px 0",borderTop:"1px solid ".concat(vh.divider)},children:[(0,f.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:l,flexShrink:0,animation:"urgent"===t.tone?"lb-pulse 1.6s ease-in-out infinite":"none"}}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:14,fontWeight:700,color:vh.carbon},children:t.title}),(0,f.jsx)("div",{style:{fontSize:12.5,color:vh.body,marginTop:2},children:t.detail}),i&&(0,f.jsx)("div",{style:{fontSize:12,color:vh.red,marginTop:4},children:i})]}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:13,fontWeight:700,color:vh.carbon,whiteSpace:"nowrap"}),children:t.value}),t.canRemind&&(0,f.jsx)("button",{type:"button",onClick:async e=>{e.stopPropagation(),r("sending"),o(null);try{const e=await fetch("".concat(I.fn,"/api/lifeblood/job-requests/").concat(t.id,"/po-reminder"),{method:"POST",headers:{Authorization:"Bearer ".concat(Eh())}});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.detail||"Could not send the reminder")}r("sent"),s&&s()}catch(a){r("error"),o(a.message)}},disabled:"sending"===n||"sent"===n,style:{display:"flex",alignItems:"center",gap:6,whiteSpace:"nowrap",background:"sent"===n?"#ECFDF5":vh.card,color:"sent"===n?"#15803D":vh.ink,border:"1px solid ".concat("sent"===n?"#BBF7D0":vh.border),borderRadius:9,padding:"7px 12px",fontFamily:jh,fontSize:12.5,fontWeight:700,cursor:"sent"===n?"default":"pointer",transition:"all .25s cubic-bezier(.16,1,.3,1)"},children:"sending"===n?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kr.A,{size:13,className:"lb-spin"})," Sending\u2026"]}):"sent"===n?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(zt.A,{size:13})," Reminder sent"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{size:13})," Send PO reminder"]})})]})}function Ph(){var e,t,s,n,i;const[o,l]=(0,a.useState)("overview"),[c,d]=(0,a.useState)(null),[p,x]=(0,a.useState)([]),[u,g]=(0,a.useState)(!0),[b,y]=(0,a.useState)(null),v=(0,a.useCallback)(async()=>{y(null);const e={Authorization:"Bearer ".concat(Eh())};try{const[t,s]=await Promise.all([fetch("".concat(I.fn,"/api/lifeblood/account"),{headers:e}),fetch("".concat(I.fn,"/api/lifeblood/job-requests"),{headers:e})]);if(!t.ok)throw new Error("Could not load the Lifeblood account record");const a=await t.json();d(a),s.ok&&x((await s.json()).job_requests||[])}catch(t){y(t.message)}finally{g(!1)}},[]);(0,a.useEffect)(()=>{v()},[v]);const j=(0,a.useMemo)(()=>{const e=p.filter(e=>"accepted_lifeblood"===e.status||"travel"===e.kind).reduce((e,t)=>
1e+(t.total_inc_gst||0),0),t=p.filter(e=>"Awaiting PO"===e.fulfillment_status),s=p.filter(e=>"Invoice Sent"===e.fulfillment_status||"Awaiting PO"===e.fulfillment_status).reduce((e,t)=>e+(t.total_inc_gst||0),0),a=t.map(e=>Fh(e.accepted_at||e.sent_at)).filter(e=>null!==e);return{approvedYtd:e,awaitingPo:t,outstanding:s,oldest:a.length?Math.max(...a):null,pending:p.filter(e=>"pending_lifeblood_approval"===e.status),byStage:Th.map(e=>{const t=p.filter(t=>t.fulfillment_status===e);return{stage:e,count:t.length,value:t.reduce((e,t)=>e+(t.total_inc_gst||0),0)}})}},[p]),w=(0,a.useMemo)(()=>{const e=[];for(const t of j.pending)e.push({id:t.id,tone:"info",title:"".concat(t.ref_code," awaiting Toney's approval"),detail:"".concat(t.project_title||"Untitled"," \xb7 raised by ").concat(t.submitter_name||"\u2014"),value:kh(t.total_inc_gst),canRemind:!1});for(const t of j.awaitingPo){const s=Fh(t.accepted_at||t.sent_at);e.push({id:t.id,tone:null!==s&&s>=20?"urgent":"warn",title:"".concat(t.ref_code," awaiting purchase order"),detail:"".concat(t.project_title||"Untitled").concat(null!==s?" \xb7 ".concat(s," day").concat(1===s?"":"s"," since ").concat("travel"===t.kind?"sent":"approval"):""),value:kh(t.total_inc_gst),canRemind:!0})}return e.sort((e,t)=>("urgent"===e.tone?-1:0)-("urgent"===t.tone?-1:0))},[j]),N=(0,a.useMemo)(()=>p.flatMap(e=>[e.created_at&&{at:e.created_at,text:"".concat(e.ref_code," raised").concat(e.submitter_name?" by ".concat(e.submitter_name):"")},e.accepted_at&&{at:e.accepted_at,text:"".concat(e.ref_code," approved by Toney Wilkinson")},e.declined_at&&{at:e.declined_at,text:"".concat(e.ref_code," declined")},e.sent_at&&{at:e.sent_at,text:"".concat(e.ref_code," travel quotation sent")},e.po_number&&e.updated_at&&{at:e.updated_at,text:"".concat(e.ref_code," PO ").concat(e.po_number," attached")}].filter(Boolean)).sort((e,t)=>(_h(t.at)||0)-(_h(e.at)||0)).slice(0,12),[p]),A=null===c||void 0===c?void 0:c.company,k=[{id:"overview",label:"Overview"},{id:"pipeline",label:"Pipeline",count:p.length},{id:"travel",label:"Travel expenses"},{id:"rates",label:"Rate card"},{id:"people",label:"People",count:null===c||void 0===c||null===(e=c.contacts)||void 0===e?void 0:e.length}],S=u?"KEY ACCOUNT":"KEY ACCOUNT \xb7 ".concat(p.length," RECORD").concat(1===p.length?"":"S"," \xb7 ").concat(j.awaitingPo.length," AWAITING PO");return(0,f.jsx)(ta,{title:"Lifeblood",meta:S,children:(0,f.jsxs)("div",{style:{fontFamily:jh},children:[(0,f.jsx)("style",{children:"\n .lb-spin { animation: lb-adm-spin 1s linear infinite; }\n @keyframes lb-adm-spin { to { transform: rotate(360deg); } }\n @keyframes lb-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(1.35); } }\n .lb-adm-2col { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 20px; align-items: start; }\n @media (max-width: 1279px) { .lb-adm-2col { grid-template-columns: minmax(0,1fr); } }\n "}),(0,f.jsx)("div",{children:(0,f.jsxs)("div",{children:[b&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,background:"#FEF2F2",border:"1px solid #FECACA",color:"#B91C1C",borderRadius:12,padding:"13px 16px",marginBottom:20,fontSize:13.5},children:[(0,f.jsx)(h.A,{size:16})," ",b]}),(0,f.jsxs)("div",{style:{position:"relative",background:vh.carbon,borderRadius:16,overflow:"hidden",marginBottom:22},children:[(0,f.jsxs)("div",{style:{display:"flex",height:3},children:[(0,f.jsx)("span",{style:{flex:1,background:vh.red}}),(0,f.jsx)("span",{style:{flex:1,background:vh.amber}}),(0,f.jsx)("span",{style:{flex:1,background:vh.teal}})]}),(0,f.jsxs)("div",{style:{padding:"22px 26px 24px"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:16,flexWrap:"wrap"},children:[(0,f.jsx)("div",{style:{width:52,height:52,borderRadius:12,background:"#fff",display:"grid",placeItems:"center",flexShrink:0},children:(0,f.jsx)(fs.A,{size:26,color:vh.red,fill:vh.red})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:220},children:[(0,f.jsx)("h1",{style:{margin:0,fontFamily:wh,fontWeight:800,fontSize:23,textTransform:"uppercase",color:"#fff",letterSpacing:"-0.01em"},children:(null===A||void 0===A?void 0:A.company_name)||"Red Cross Lifeblood"}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:9,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:10,letterSpacing:"0.12em",background:"#3A1A1D",color:vh.amber,borderRadius:20,padding:"4px 10px"}),children:"KEY ACCOUNT"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:10,letterSpacing:"0.12em",background:"#12281F",color:"#4ADE80",borderRadius:20,padding:"4px 10px"}),children:"SCHEDULE 1 \xb7 FIXED RATES"})]}),(0,f.jsx)("p",{style:{margin:"12px 0 0",maxWidth:640,fontSize:13.5,lineHeight:1.6,color:"#B4B4BB"},children:"Lifeblood staff raise job requests in their own portal at fixed Schedule 1 rates. Every request goes to Toney Wilkinson for approval; approving raises a draft invoice and a runsheet automatically. Turbo holds the invoice until a purchase order lands."}),(0,f.jsxs)("div",{style:{display:"flex",gap:9,marginTop:15,flexWrap:"wrap"},children:[A&&(0,f.jsx)(r.N_,{to:"/admin/companies/".concat(A.id),style:Wh,children:"Company record"}),(0,f.jsxs)("a",{href:"/lifeblood/login",target:"_blank",rel:"noreferrer",style:Wh,children:["Client portal ",(0,f.jsx)(En.A,{size:12})]}),(0,f.jsx)(r.N_,{to:"/admin/invoices",style:Wh,children:"Invoices"}),(0,f.jsx)(r.N_,{to:"/admin/corporate",style:Wh,children:"Runsheets"})]})]})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(160px,1fr))",gap:12,marginTop:22},children:[(0,f.jsx)(Ih,{label:"Approved",value:Ah(j.approvedYtd),sub:"inc GST, all time"}),(0,f.jsx)(Ih,{label:"Awaiting PO",value:j.awaitingPo.length,sub:"jobs + travel",accent:j.awaitingPo.length?vh.amber:"#fff"}),(0,f.jsx)(Ih,{label:"Outstanding",value:Ah(j.outstanding),sub:"not yet paid"}),(0,f.jsx)(Ih,{label:"Oldest PO chase",value:null===j.oldest?"\u2014":"".concat(j.oldest,"d"),sub:null!==j.oldest&&j.oldest>=20?"overdue a nudge":"within tolerance",accent:null!==j.oldest&&j.oldest>=20?vh.red:"#fff"})]})]})]}),(0,f.jsx)("div",{style:{display:"flex",gap:2,borderBottom:"1px solid ".concat(vh.border),marginBottom:22,overflowX:"auto"},children:k.map(e=>{const t=o===e.id;return(0,f.jsxs)("button",{type:"button",onClick:()=>l(e.id),style:{display:"flex",alignItems:"center",gap:7,background:"none",border:"none",borderBottom:"2.5px solid ".concat(t?vh.red:"transparent"),marginBottom:-1,padding:"11px 14px",cursor:"pointer",whiteSpace:"nowrap",fontFamily:wh,fontWeight:700,fontSize:13.5,color:t?vh.carbon:vh.body,transition:"color .25s cubic-bezier(.16,1,.3,1)"},children:[e.label,e.count>0&&(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:10,background:t?vh.red:"#E2E2E8",color:t?"#fff":vh.body,borderRadius:20,padding:"2px 7px"}),children:e.count})]},e.id)})}),u&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,color:vh.body,fontSize:14},children:[(0,f.jsx)(Kr.A,{size:16,className:"lb-spin"})," Loading account\u2026"]}),!u&&"overview"===o&&(0,f.jsxs)("div",{className:"lb-adm-2col",children:[(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20,minWidth:0},children:[(0,f.jsxs)(zh,{style:{padding:"20px 22px"},children:[(0,f.jsx)(Bh,{children:"Needs you now"}),0===w.length?(0,f.jsx)("p",{style:{margin:"12px 0 0",fontSize:13.5,color:vh.body}
1,children:"Nothing waiting. No approvals pending and every approved job has its purchase order."}):(0,f.jsx)("div",{style:{marginTop:6},children:w.map(e=>(0,f.jsx)(Rh,{row:e,onRemind:v},"".concat(e.id,"-").concat(e.title)))})]}),(0,f.jsxs)(zh,{style:{padding:"20px 22px"},children:[(0,f.jsx)(Bh,{children:"Pipeline"}),(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(150px,1fr))",gap:12,marginTop:14},children:j.byStage.map(e=>(0,f.jsxs)("div",{style:{border:"1px solid ".concat(vh.border),borderRadius:12,padding:"13px 14px"},children:[(0,f.jsx)(Dh,{children:e.stage}),(0,f.jsx)("div",{style:{fontFamily:wh,fontWeight:800,fontSize:24,color:vh.carbon,marginTop:5},children:e.count}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:11.5,color:vh.body,marginTop:2}),children:Ah(e.value)})]},e.stage))}),(0,f.jsxs)("div",{style:{display:"flex",gap:9,marginTop:14,background:"#FFFBEB",border:"1px solid #FDE68A",borderRadius:10,padding:"11px 13px"},children:[(0,f.jsx)(h.A,{size:15,color:"#B45309",style:{flexShrink:0,marginTop:1}}),(0,f.jsxs)("p",{style:{margin:0,fontSize:12.5,lineHeight:1.55,color:"#78350F"},children:["Fulfillment is derived from the approval state and the linked invoice, not stored. A manual override only ever moves a row ",(0,f.jsx)("strong",{children:"forward"})," \u2014 if the invoice is further along, the invoice wins."]})]})]}),(0,f.jsxs)(zh,{style:{padding:"20px 22px"},children:[(0,f.jsx)(Bh,{children:"Account activity"}),(0,f.jsxs)("div",{style:{marginTop:8},children:[0===N.length&&(0,f.jsx)("p",{style:{margin:"6px 0 0",fontSize:13.5,color:vh.body},children:"No activity recorded yet."}),N.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",gap:14,padding:"10px 0",borderTop:0===t?"none":"1px solid ".concat(vh.divider)},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:11,color:vh.muted,whiteSpace:"nowrap",minWidth:132}),children:Ch(e.at)}),(0,f.jsx)("span",{style:{fontSize:13.5,color:vh.ink},children:e.text})]},t))]})]})]}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)("div",{style:{background:vh.carbon,borderRadius:14,padding:"20px 22px"},children:[(0,f.jsx)(Dh,{children:"Client approver"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginTop:12}
1,children:[(0,f.jsx)("span",{style:{width:42,height:42,borderRadius:"50%",background:vh.red,color:"#fff",display:"grid",placeItems:"center",fontFamily:wh,fontWeight:800,fontSize:15},children:"TW"}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:14.5,fontWeight:700,color:"#fff"},children:"Toney Wilkinson"}),(0,f.jsx)("div",{style:{fontSize:11.5,color:vh.muted,wordBreak:"break-all"},children:null===c||void 0===c?void 0:c.approver_email})]})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10,marginTop:16},children:[(0,f.jsxs)("div",{style:{background:vh.tile,borderRadius:10,padding:"11px 12px"},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:9.5,letterSpacing:"0.12em",color:vh.muted}),children:"AWAITING"}),(0,f.jsx)("div",{style:{fontFamily:wh,fontWeight:800,fontSize:21,color:j.pending.length?vh.amber:"#fff",marginTop:3},children:j.pending.length})]}),(0,f.jsxs)("div",{style:{background:vh.tile,borderRadius:10,padding:"11px 12px"},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:9.5,letterSpacing:"0.12em",color:vh.muted}),children:"CONTACTS"}),(0,f.jsx)("div",{style:{fontFamily:wh,fontWeight:800,fontSize:21,color:"#fff",marginTop:3},children:null!==(t=null===c||void 0===c||null===(s=c.contacts)||void 0===s?void 0:s.length)&&void 0!==t?t:"\u2014"})]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:14,fontSize:11.5,color:vh.muted,lineHeight:1.5},children:[(0,f.jsx)(ht.A,{size:13,style:{flexShrink:0,marginTop:1}}),(0,f.jsx)("span",{children:"The approver is set in code \u2014 changing it needs a deploy."})]})]}),(0,f.jsxs)(zh,{style:{padding:"18px 20px"},children:[(0,f.jsx)(Dh,{children:"On approval, automatically"}),(0,f.jsx)("ul",{style:{margin:"12px 0 0",padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:9},children:["A draft invoice is raised against the request","A runsheet is created with James Anderson attached","Toney is emailed the quotation PDF and PO instructions","The submitter is emailed the approval"].map(e=>(0,f.jsxs)("li",{style:{display:"flex",gap:9,fontSize:13,color:vh.ink,lineHeight:1.5},children:[(0,f.jsx)(zt.A,{size:14,color:vh.green,style:{flexShrink:0,marginTop:2}})," ",e]},e))})]}),(0,f.jsxs)(zh,{style:{padding:"18px 20px"},children:[(0,f.jsx)(Dh,{children:"Reference sequence"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:24,fontWeight:700,color:vh.carbon,marginTop:10}),children:(null===c||void 0===c?void 0:c.next_ref)||"\u2014"}),(0,f.jsx)("p",{style:{margin:"8px 0 0",fontSize:12.5,lineHeight:1.55,color:vh.body},children:"Next reference to be issued. Job requests and travel expenses share one counter, so LB numbers never collide across the two record types."})]})]})]}),!u&&"pipeline"===o&&A&&(0,f.jsx)(xh,{company:A}),!u&&"travel"===o&&A&&(0,f.jsx)(yh,{company:A}),!u&&"rates"===o&&(0,f.jsxs)("div",{style:{maxWidth:820},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:14},children:[(0,f.jsx)(Bh,{children:"Schedule 1 \u2014 fixed rates"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:10,letterSpacing:"0.12em",background:"#E2E2E8",color:vh.body,borderRadius:20,padding:"3px 10px"}),children:"READ ONLY"})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:9,background:"#FFFBEB",border:"1px solid #FDE68A",borderRadius:10,padding:"12px 14px",marginBottom:16},children:[(0,f.jsx)(h.A,{size:15,color:"#B45309",style:{flexShrink:0,marginTop:1}}),(0,f.jsx)("p",{style:{margin:0,fontSize:12.5,lineHeight:1.55,color:"#78350F"},children:"Not admin-editable. These are a Python constant on the server \u2014 changing a price is a deploy, on purpose, because the rates are contractual."})]}),(0,f.jsx)(zh,{children:(0,f.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse"},children:[(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{style:{background:"#FAFAFB"},children:[(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:10,letterSpacing:"0.1em",color:vh.muted,textAlign:"left",padding:"11px 16px"}),children:"SERVICE"}),(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:10,letterSpacing:"0.1em",color:vh.muted,textAlign:"right",padding:"11px 16px",
1width:150}),children:"EX GST"})]})}),(0,f.jsx)("tbody",{children:((null===c||void 0===c?void 0:c.services)||[]).map(e=>(0,f.jsxs)("tr",{style:{borderTop:"1px solid ".concat(vh.divider)},children:[(0,f.jsxs)("td",{style:{padding:"13px 16px"},children:[(0,f.jsx)("div",{style:{fontSize:14,fontWeight:700,color:vh.carbon},children:e.label}),(0,f.jsx)("div",{style:{fontSize:12.5,color:vh.body,marginTop:2},children:e.subtitle})]}),(0,f.jsx)("td",{style:(0,m.A)((0,m.A)({},Nh),{},{padding:"13px 16px",textAlign:"right",fontSize:14,fontWeight:700,color:vh.carbon,whiteSpace:"nowrap"}),children:kh(e.price_ex_gst)})]},e.id))})]})}),(0,f.jsxs)("div",{style:{background:vh.carbon,borderRadius:12,padding:"14px 16px",marginTop:14,display:"flex",gap:10},children:[(0,f.jsx)(ht.A,{size:15,color:vh.muted,style:{flexShrink:0,marginTop:1}}),(0,f.jsxs)("p",{style:{margin:0,fontSize:12.5,lineHeight:1.55,color:"#B4B4BB"},children:["Pricing is server-authoritative. The portal sends only ",(0,f.jsx)("span",{style:(0,m.A)({},Nh),children:"{service_id, qty}"})," and the server recomputes every total \u2014 a tampered client price is discarded, not trusted. GST is ",Math.round(100*(null!==(n=null===c||void 0===c?void 0:c.gst_rate)&&void 0!==n?n:.1)),"%."]})]})]}),!u&&"people"===o&&(0,f.jsxs)("div",{style:{maxWidth:900},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:14},children:[(0,f.jsx)(Bh,{children:"People"}),(0,f.jsxs)("span",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:10,letterSpacing:"0.12em",background:"#E2E2E8",color:vh.body,borderRadius:20,padding:"3px 10px"}),children:[(null===c||void 0===c||null===(i=c.contacts)||void 0===i?void 0:i.length)||0," CONTACTS"]})]}),(0,f.jsxs)(zh,{children:[((null===c||void 0===c?void 0:c.contacts)||[]).map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"13px 16px",borderTop:0===t?"none":"1px solid ".concat(vh.divider)},children:[(0,f.jsx)("span",{style:{width:36,height:36,borderRadius:"50%",flexShrink:0,display:"grid",placeItems:"center",background:e.is_approver?vh.red:"#E2E2E8",color:e.is_approver?"#fff":vh.body,fontFamily:wh,fontWeight:800,fontSize:13},children:(e.contact_name||e.email||"?").split(/\s+/).map(e=>e[0]).join("").slice(0,2).toUpperCase()}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:14,fontWeight:700,color:vh.carbon},children:e.contact_name||"\u2014"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:vh.body,wordBreak:"break-all"},children:e.email})]}),e.is_approver&&(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:10,letterSpacing:"0.12em",background:"#FEF2F2",color:vh.red,border:"1px solid #FECACA",borderRadius:20,padding:"3px 10px",whiteSpace:"nowrap"}),children:"APPROVER"}),(0,f.jsx)(r.N_,{to:"/admin/clients/".concat(e.id),style:(0,m.A)((0,m.A)({},Nh),{},{fontSize:11,color:vh.body,whiteSpace:"nowrap"}),children:"OPEN \u2192"})]},e.id)),0===((null===c||void 0===c?void 0:c.contacts)||[]).length&&(0,f.jsx)("div",{style:{padding:"30px 16px",textAlign:"center",fontSize:13.5,color:vh.body},children:"No contacts on this account yet."})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:9,marginTop:14,background:"#FFFBEB",border:"1px solid #FDE68A",borderRadius:10,padding:"12px 14px"},children:[(0,f.jsx)(Xe.A,{size:15,color:"#B45309",style:{flexShrink:0,marginTop:1}}),(0,f.jsxs)("p",{style:{margin:0,fontSize:12.5,lineHeight:1.55,color:"#78350F"},children:["Membership is matched by ",(0,f.jsx)("strong",{children:"company name"}),", not by a parent id \u2014 several contacts were created against naming variants over the years. Anyone whose company name contains \u201clifeblood\u201d can sign in to the portal."]})]})]})]})})]})})}const Wh={display:"inline-flex",alignItems:"center",gap:6,textDecoration:"none",background:"rgba(255,255,255,.08)",color:"#fff",border:"1px solid rgba(255,255,255,.16)",borderRadius:9,padding:"7px 13px",fontSize:12.5,fontWeight:700};var Oh=s(25040);const Lh=()=>{const e=(0,o.gf)();if(e)return e;try{const e=localStorage.getItem("turbo360_admin_auth");if(e)return JSON.parse(e).token||null}catch(t){}return null};async function Mh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=await fetch("".concat(I.fn,"/api").concat(e),(0,m.A)((0,m.A)({},t),{},{headers:(0,m.A)({"Content-Type":"application/json",Authorization:"Bearer ".concat(Lh())},t.headers||{})}));if(!s.ok){let e="Request failed (".concat(s.status,")");try{e=(await s.json()).detail||e}catch(a){}const t=new Error(e);throw t.status=s.status,t}return s.json()}const qh={carbon:"#0A0A0B",tile:"#0F0F11",card:"#FFFFFF",border:"#E4E4E9",divider:"#F2F2F5",tableHead:"#FBFBFC",hover:"#F7F7F9",muted:"#9A9AA0",body:"#6B6B72",ink:"#3A3A40",secondary:"#55555C",faint:"#B5B5BC",red:"#BF212F",redHover:"#A81B28",amber:"#F2A900",teal:"#0FA3A3",green:"#15803D"},Hh="'Hanken Grotesk', -apple-system, sans-serif",Uh="'Archivo', sans-serif",Gh={fontFamily:"'Space Mono', monospace"},Vh="14\u201330 business days",Jh=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:2}).format(Number(e)||0),Yh="Australia/Melbourne",Kh=e=>{const t=new Date("".concat(e,"T00:00:00"));return isNaN(t)?e||"\u2014":t.toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short"})},Zh=e=>{if(!e)return"";const t=new Date(e);return isNaN(t)?"":"".concat(t.toLocaleDateString("en-AU",{timeZone:Yh,day:"2-digit",month:"short"})," \xb7 ").concat(t.toLocaleTimeString("en-AU",{timeZone:Yh,hour:"numeric",minute:"2-digit",hour12:!0})).toUpperCase()},$h={paid:"green",refunded:"gray",failed:"danger",pending:"amber"},Qh={paid:"Paid",refunded:"Refunded",failed:"Failed",pending:"Pending"},Xh="1.6fr 1.5fr 150px 110px 110px 120px 96px",eu="1.3fr 1.2fr 1.4fr 150px 110px 108px 128px 74px",tu=e=>{let{children:t,style:s}=e;return(0,f.jsx)("div",{style:(0,m.A)({background:qh.card,border:"1px solid ".concat(qh.border),borderRadius:14,overflow:"hidden",marginBottom:22},s),children:t})},su=e=>{let{children:t}=e;return(0,f.jsx)("h2",{style:{margin:0,fontFamily:Uh,fontWeight:800,fontSize:19,letterSpacing:"-0.01em",color:qh.carbon},children:t})}
1,au=e=>{let{children:t,right:s}=e;return(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10,letterSpacing:"0.12em",color:qh.muted,textTransform:"uppercase",textAlign:s?"right":"left"}),children:t})};function nu(e){let{label:t,value:s,sub:a,accent:n}=e;return(0,f.jsxs)("div",{style:{background:qh.tile,borderRadius:12,padding:"15px 16px",minWidth:0},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:9.5,letterSpacing:"0.14em",color:qh.muted,textTransform:"uppercase"}),children:t}),(0,f.jsx)("div",{style:{fontFamily:Uh,fontWeight:800,fontSize:26,color:n||"#fff",marginTop:6,letterSpacing:"-0.02em"},children:s}),a&&(0,f.jsx)("div",{style:{fontSize:11.5,color:qh.muted,marginTop:3},children:a})]})}const ru={display:"inline-flex",alignItems:"center",gap:7,background:qh.red,color:"#fff",border:"none",borderRadius:9,padding:"11px 16px",fontFamily:Hh,fontSize:13.5,fontWeight:600,cursor:"pointer"},iu={display:"inline-flex",alignItems:"center",gap:7,background:"#fff",color:qh.ink,border:"1px solid ".concat(qh.border),borderRadius:9,padding:"10px 15px",fontFamily:Hh,fontSize:13,fontWeight:600,cursor:"pointer"},ou={display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",color:qh.muted,padding:6,cursor:"pointer"},lu=(0,m.A)((0,m.A)({},Gh),{},{display:"block",fontSize:10,letterSpacing:"0.12em",color:"#6A6A72",textTransform:"uppercase",marginBottom:7}),cu={width:"100%",boxSizing:"border-box",background:"#fff",border:"1px solid ".concat(qh.border),borderRadius:9,padding:"10px 12px",fontFamily:Hh,fontSize:13.5,color:qh.carbon};function du(e){let{title:t,kicker:s,onClose:a,footer:n,maxWidth:r=620,children:i,zIndex:o=80}=e;return(0,f.jsx)("div",{onClick:a,style:{position:"fixed",inset:0,background:"rgba(10,10,11,.55)",zIndex:o,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{background:"#fff",border:"1px solid ".concat(qh.border),borderRadius:16,width:"100%",maxWidth:r,maxHeight:"92vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:12,padding:"18px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{children:[s&&(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10,letterSpacing:"0.12em",color:qh.muted,textTransform:"uppercase",marginBottom:4}),children:s}),(0,f.jsx)("div",{style:{fontFamily:Uh,fontWeight:700,fontSize:18,color:qh.carbon},children:t})]}),(0,f.jsx)("button",{type:"button",onClick:a,style:(0,m.A)((0,m.A)({},ou),{},{marginTop:2}),"aria-label":"Close",children:(0,f.jsx)(g.A,{size:18})})]}),(0,f.jsx)("div",{style:{overflowY:"auto",flex:1},children:i}),n&&(0,f.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:10,padding:"16px 22px",borderTop:"1px solid #EDEDF0",background:qh.tableHead,flexWrap:"wrap"},children:n})]})})}function mu(e){var t;let{production:s,onClose:n,onSaved:r}=e;const i=Boolean(s),[o,l]=(0,a.useState)([]),[c,d]=(0,a.useState)((null===s||void 0===s?void 0:s.contact_id)||""),[p,x]=(0,a.useState)((null===s||void 0===s?void 0:s.event_name)||""),[u,g]=(0,a.useState)((null===s||void 0===s?void 0:s.description)||""),[b,y]=(0,a.useState)((null===s||void 0===s||null===(t=s.dates)||void 0===t?void 0:t.map(e=>({id:e.id,date:e.date,label:e.label||""})))||[{date:"",label:""}]),[v,j]=(0,a.useState)(s?String(s.price_ex_gst):""),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(null);(0,a.useEffect)(()=>{i||Mh("/clients").then(e=>l(e.clients||[])).catch(()=>l([]))},[i]);const S=1.1*(Number(v)||0);return(0,f.jsx)(du,{title:i?"Edit school production":"New school production",kicker:"School Productions",onClose:n,footer:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",style:iu,onClick:n,children:"Cancel"}),(0,f.jsxs)("button",{type:"button",className:"tg-btn-primary",style:(0,m.A)((0,m.A)({},ru),{},{opacity:w?.7:1}),disabled:w,onClick:async()=>{k(null),N(!0);try{const e={event_name:p,description:u,dates:b.filter(e=>e.date).map(e=>({id:e.id||null,date:e.date,label:e.label})),price_ex_gst:Number(v)||0};let t;t=i?await Mh("/school-productions/".concat(s.id),{method:"PUT",body:JSON.stringify(e)}):await Mh("/school-productions",{method:"POST",body:JSON.stringify((0,m.A)((0,m.A)({},e),{},{contact_id:c}))}),r(t.production)}catch(e){k(e.message),N(!1)}},children:[w?(0,f.jsx)(Kr.A,{size:14,className:"sp-spin"}):null,i?"Save changes":"Create production"]})]}),children:(0,f.jsxs)("div",{style:{padding:"20px 22px",display:"grid",gap:18},children:[A&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#FEF2F2",border:"1px solid #FECACA",color:"#B91C1C",borderRadius:10,padding:"11px 14px",fontSize:13},children:[(0,f.jsx)(h.A,{size:15})," ",A]}),!i&&(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:lu,children:"Client"}),(0,f.jsx)(Yo,{allClients:o,selectedContactId:c,onContactSelect:e=>d(e?e.id:""),label:""}),(0,f.jsx)("div",{style:{fontSize:12,color:qh.muted,marginTop:6},children:"Pulled from the existing client list \u2014 the production is attached to that company record."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:lu,children:"Event name"}),(0,f.jsx)("input",{style:cu,value:p,onChange:e=>x(e.target.value),placeholder:"e.g. Matilda Jr \u2014 2026 Production"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:lu,children:"Event description"}),(0,f.jsx)("textarea",{style:(0,m.A)((0,m.A)({},cu),{},{resize:"vertical"}),rows:3,value:u,onChange:e=>g(e.target.value)}),(0,f.jsx)("div",{style:{fontSize:12,color:qh.muted,marginTop:6},children:"Shown to families at the top of the public portal."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:lu,children:"Event dates"}),(0,f.jsx)("div",{style:{display:"grid",gap:9},children:b.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",gap:9,alignItems:"center"},children:[(0,f.jsx)("input",{type:"date",value:e.date,onChange:e=>y(b.map((s,a)=>a===t?(0,m.A)((0,m.A)({},s),{},{date:e.target.value}):s)),style:(0,m.A)((0,m.A)((0,m.A)({},cu),Gh),{},{fontSize:13,width:170,flexShrink:0})}),(0,f.jsx)("input",{value:e.label,placeholder:"Performance label (e.g. Evening performance)",onChange:e=>y(b.map((s,a)=>a===t?(0,m.A)((0,m.A)({},s),{},{label:e.target.value}):s)),style:cu}),(0,f.jsx)("button",{type:"button",className:"sp-iconbtn",style:ou,"aria-label":"Remove date",disabled:1===b.length,onClick:()=>y(b.filter((e,s)=>s!==t)),children:(0,f.jsx)(la.A,{size:16})})]},e.id||t))}),(0,f.jsx)("button",{type:"button",className:"sp-dashed",onClick:()=>y([...b,{date:"",label:""}]),style:{marginTop:9,width:"100%",background:"none",border:"1px dashed #C9C9D0",borderRadius:9,padding:"10px 12px",fontFamily:Hh,fontSize:13,fontWeight:600,color:qh.body,cursor:"pointer"},children:"+ Add another date"})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:lu,children:"Purchase price (ex GST)"}),(0,f.jsxs)("div",{style:{position:"relative"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",fontSize:14,fontWeight:700,color:qh.muted}),children:"$"}
1),(0,f.jsx)("input",{inputMode:"decimal",value:v,onChange:e=>j(e.target.value.replace(/[^0-9.]/g,"")),style:(0,m.A)((0,m.A)((0,m.A)({},cu),Gh),{},{fontSize:14,fontWeight:700,paddingLeft:26})})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:lu,children:"Family pays inc GST"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)((0,m.A)({},cu),Gh),{},{fontSize:14,fontWeight:700,background:qh.hover,color:qh.carbon}),children:Jh(S)})]})]}),(0,f.jsxs)("div",{style:{background:qh.carbon,borderRadius:12,padding:"16px 18px"},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:13.5,color:"#fff",wordBreak:"break-all"}),children:(null===s||void 0===s?void 0:s.portal_url)||"https://turbo.net.au/school/\u2026"}),(0,f.jsx)("p",{style:{margin:"8px 0 0",fontSize:12,lineHeight:1.55,color:"#B4B4BB"},children:i?"The public portal link \u2014 share it with the school to pass on to families.":"The public portal link is generated when you create the production, from the school name and year."})]})]})})}function pu(e){let{production:t,dateRow:s,onClose:n,onDelivered:r}=e;const[i,o]=(0,a.useState)(s.file_url||""),[l,c]=(0,a.useState)(s.runtime||""),[d,p]=(0,a.useState)(s.file_format||"MP4 (H.264) \xb7 1080p"),[x,u]=(0,a.useState)(s.file_size||""),[g,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(null),[j,w]=(0,a.useState)(null);return(0,f.jsx)(du,{title:null===j?"Mark date delivered":"Download links on their way",kicker:"".concat(t.event_name," \xb7 ").concat(Kh(s.date).toUpperCase()),onClose:n,footer:null===j?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",style:iu,onClick:n,children:"Cancel"}),(0,f.jsxs)("button",{type:"button",className:"tg-btn-primary",style:(0,m.A)((0,m.A)({},ru),{},{opacity:g?.7:1}),disabled:g||!i,onClick:async()=>{v(null),b(!0);try{const e=await Mh("/school-productions/".concat(t.id,"/dates/").concat(s.id,"/deliver"),{method:"POST",body:JSON.stringify({file_url:i,runtime:l,file_format:d,file_size:x})});w(e.queued),r()}catch(e){v(e.message),b(!1)}},children:[g?(0,f.jsx)(Kr.A,{size:14,className:"sp-spin"}):(0,f.jsx)(st.A,{size:14})," Send download links"]})]}):(0,f.jsx)("button",{type:"button",className:"tg-btn-primary",style:ru,onClick:n,children:"Done"}),children:(0,f.jsxs)("div",{style:{padding:"20px 22px",display:"grid",gap:16},children:[y&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#FEF2F2",border:"1px solid #FECACA",color:"#B91C1C",borderRadius:10,padding:"11px 14px",fontSize:13},children:[(0,f.jsx)(h.A,{size:15})," ",y]}),null!==j?(0,f.jsxs)("div",{style:{display:"flex",gap:11,alignItems:"flex-start",background:"#ECFDF5",border:"1px solid #BBF7D0",borderRadius:10,padding:"13px 15px",fontSize:13,lineHeight:1.55,color:qh.green},children:[(0,f.jsx)(zt.A,{size:16,style:{flexShrink:0,marginTop:1}}),(0,f.jsxs)("span",{children:["Sending tokenised download links to ",(0,f.jsxs)("strong",{children:[j," paid purchaser",1===j?"":"s"]})," of this date. Rows flip to LINK SENT as each email goes out \u2014 the list refreshes automatically."]})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:lu,children:"Video file URL"}),(0,f.jsx)("input",{style:(0,m.A)((0,m.A)((0,m.A)({},cu),Gh),{},{fontSize:12.5}),value:i,onChange:e=>o(e.target.value),placeholder:"https://\u2026"}),(0,f.jsx)("div",{style:{fontSize:12,color:qh.muted,marginTop:6},children:"Where the finished video lives (content delivery / S3). Every purchaser gets their own tokenised link that redirects here \u2014 the raw URL is never emailed."})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:12},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:lu,children:"Runtime"}),(0,f.jsx)("input",{style:cu,value:l,onChange:e=>c(e.target.value),placeholder:"1h 48m"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:lu,children:"Format"}),(0,f.jsx)("input",{style:cu,value:d,onChange:e=>p(e.target.value)})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:lu,children:"File size"}),(0,f.jsx)("input",{style:cu,value:x,onChange:e=>u(e.target.value),placeholder:"4.2 GB"})]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:11,alignItems:"flex-start",background:"#FFFBEB",border:"1px solid #FDE68A",borderRadius:10,padding:"13px 15px",fontSize:12.5,lineHeight:1.55,color:"#78350F"},children:[(0,f.jsx)(h.A,{size:15,color:"#B45309",style:{flexShrink:0,marginTop:1}}),(0,f.jsx)("span",{children:"This emails a download link to every paid purchaser of this performance date, and marks the date delivered."})]})]})]})})}function xu(e){let{purchase:t,dateLabel:s,onClose:n,onResent:r}=e;const[i,o]=(0,a.useState)(null),[l,c]=(0,a.useState)(null),[d,p]=(0,a.useState)(!1),[x,u]=(0,a.useState)(!1);(0,a.useEffect)(()=>{Mh("/school-productions/purchases/".concat(t.ref,"/email-preview")).then(o).catch(e=>c(e.message))},[t.ref]);const g="download-ready"===(null===i||void 0===i?void 0:i.template);return(0,f.jsx)(du,{title:g?"Resend download link":"Resend order confirmation",kicker:s?"".concat(t.ref," \xb7 ").concat(s.toUpperCase()):t.ref,onClose:n,maxWidth:700,zIndex:85,footer:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10,letterSpacing:"0.1em",color:qh.faint,marginRight:"auto"}),children:"MERGE FIELDS SHOWN UNRESOLVED IN PREVIEW"}),(0,f.jsx)("button",{type:"button",style:iu,onClick:n,children:"Cancel"}),(0,f.jsxs)("button",{type:"button",className:"tg-btn-primary",style:(0,m.A)((0,m.A)({},ru),{},{opacity:d||x?.7:1}),disabled:d||x||!i,onClick:async()=>{p(!0),c(null);try{await Mh("/school-productions/purchases/".concat(t.ref,"/resend"),{method:"POST"}),u(!0),r()}catch(e){c(e.message)}p(!1)},children:[d?(0,f.jsx)(Kr.A,{size:14,className:"sp-spin"}):x?(0,f.jsx)(zt.A,{size:14}):(0,f.jsx)(st.A,{size:14}),x?"Sent":g?"Resend download link":"Resend confirmation"]})]}),children:(0,f.jsxs)("div",{children:[l&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#FEF2F2",border:"1px solid #FECACA",color:"#B91C1C",borderRadius:10,padding:"11px 14px",fontSize:13,margin:"16px 22px 0"},children:[(0,f.jsx)(h.A,{size:15})," ",l]}),(0,f.jsx)("div",{style:{margin:"16px 22px",background:qh.tableHead,border:"1px solid #EDEDF0",borderRadius:10,padding:"12px 15px",display:"grid",gap:6},children:[["To",null===i||void 0===i?void 0:i.to],["Subject",null===i||void 0===i?void 0:i.subject],["Template",null===i||void 0===i?void 0:i.template]].map(e=>{let[t,s]=e;return(0,f.jsxs)("div",{style:{display:"flex",gap:10,fontSize:12.5},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{width:62,flexShrink:0,fontSize:10.5,letterSpacing:"0.1em",color:qh.muted,textTransform:"uppercase",paddingTop:2}),children:t}),(0,f.jsx)("span",{style:{color:qh.ink,wordBreak:"break-word"},children:s||"\u2026"})]},t)})}),(0,f.jsx)("div",{style:{background:"#EDEDF0",padding:"0 22px 18px"},children:i?(0,f.jsx)("iframe",{title:"Email preview",srcDoc:i.html,style:{width:"100%",height:620,border:"none",background:"#EDEDF0"}}
1):!l&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,color:qh.body,fontSize:13.5,padding:"26px 0"},children:[(0,f.jsx)(Kr.A,{size:15,className:"sp-spin"})," Rendering preview\u2026"]})})]})})}function hu(e){var t;let{purchase:s,production:n,onClose:r,onPreviewEmail:i,onChanged:o}=e;const[l,c]=(0,a.useState)(!1),[d,p]=(0,a.useState)(null),x=null===n||void 0===n||null===(t=n.dates)||void 0===t?void 0:t.find(e=>e.id===s.date_id),u="paid"===s.display_status,g={borderTop:"1px solid #EDEDF0",paddingTop:16,marginTop:16};return(0,f.jsx)(du,{title:"Purchase details",kicker:s.ref,onClose:r,maxWidth:560,footer:(0,f.jsxs)(f.Fragment,{children:[u&&(0,f.jsxs)("button",{type:"button",style:(0,m.A)((0,m.A)({},iu),{},{marginRight:"auto",color:"#991B1B",borderColor:"#FECACA",opacity:l?.7:1}),disabled:l,onClick:async()=>{if(window.confirm("Mark ".concat(s.ref," as refunded? Refund the payment in the Stripe dashboard first \u2014 this only records it here."))){c(!0),p(null);try{await Mh("/school-productions/purchases/".concat(s.ref,"/mark-refunded"),{method:"POST"}),o(),r()}catch(e){p(e.message),c(!1)}}},children:[l?(0,f.jsx)(Kr.A,{size:14,className:"sp-spin"}):null," Mark refunded"]}),(0,f.jsx)("button",{type:"button",style:iu,onClick:r,children:"Close"}),u&&(0,f.jsxs)("button",{type:"button",className:"tg-btn-primary",style:ru,onClick:i,children:[(0,f.jsx)(T.A,{size:14})," Preview email"]})]}),children:(0,f.jsxs)("div",{style:{padding:"20px 22px"},children:[d&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#FEF2F2",border:"1px solid #FECACA",color:"#B91C1C",borderRadius:10,padding:"11px 14px",fontSize:13,marginBottom:14},children:[(0,f.jsx)(h.A,{size:15})," ",d]}),(0,f.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,f.jsx)(Ds,{tone:$h[s.display_status]||"muted",children:Qh[s.display_status]||s.display_status}),u?(0,f.jsx)(Ds,{tone:"link_sent"===s.delivery_status?"blue":"amber",children:"link_sent"===s.delivery_status?"Link sent":"Pending"}):(0,f.jsx)(Ds,{tone:"muted",children:"N/A"})]}),(0,f.jsxs)("div",{style:g,children:[(0,f.jsx)("div",{style:{fontSize:14,fontWeight:600,color:qh.carbon},children:s.purchaser_name}),(0,f.jsx)("div",{style:{fontSize:13,color:qh.secondary,marginTop:3},children:s.email}),s.mobile&&(0,f.jsx)("div",{style:{fontSize:13,color:qh.secondary,marginTop:2},children:s.mobile})]}),(0,f.jsxs)("div",{style:g,children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10,letterSpacing:"0.12em",color:qh.muted,textTransform:"uppercase",marginBottom:5}),children:"Student"}),(0,f.jsx)("div",{style:{fontSize:13.5,color:qh.carbon,fontWeight:600},children:s.student_name}),s.student_class&&(0,f.jsx)("div",{style:{fontSize:12.5,color:qh.muted,marginTop:2},children:s.student_class})]}),(0,f.jsxs)("div",{style:g,children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10,letterSpacing:"0.12em",color:qh.muted,textTransform:"uppercase",marginBottom:5}),children:"Performance"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:13,fontWeight:700,color:qh.carbon}),children:x?Kh(x.date).toUpperCase():"\u2014"}),(null===x||void 0===x?void 0:x.label)&&(0,f.jsx)("div",{style:{fontSize:12.5,color:qh.muted,marginTop:2},children:x.label})]}),(0,f.jsxs)("div",{style:g,children:[[["Ex GST",s.amount_ex_gst],["GST (10%)",s.gst_amount]].map(e=>{let[t,a]=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5,color:qh.secondary,marginBottom:7},children:[(0,f.jsx)("span",{children:t}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{fontWeight:700,color:qh.carbon}),children:u||"refunded"===s.display_status?Jh(a):"\u2014"})]},t)}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",marginTop:10},children:[(0,f.jsx)("span",{style:{fontFamily:Uh,fontWeight:800,fontSize:14.5,color:qh.carbon},children:"Paid inc GST"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:17,fontWeight:700,color:u?qh.green:qh.muted}),children:u||"refunded"===s.display_status?Jh(s.total_amount):"\u2014"})]})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)((0,m.A)({},g),Gh),{},{fontSize:11.5,color:qh.muted,display:"grid",gap:5}),children:[(0,f.jsxs)("div",{children:["STRIPE: ",s.stripe_payment_intent_id||"\u2014"]}),(0,f.jsxs)("div",{children:["PAID AT: ",s.paid_at?Zh(s.paid_at):"\u2014"]}),(0,f.jsxs)("div",{children:["DELIVERY DUE: ",(s.delivery_due||"\u2014").toUpperCase()]})]})]})})}function uu(){var e;const t=(0,r.Zp)(),[s,n]=(0,a.useState)([]),[i,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(null),[p,x]=(0,a.useState)([]),[u,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(!0),[v,j]=(0,a.useState)(null),[w,N]=(0,a.useState)("all"),[A,k]=(0,a.useState)(""),[S,C]=(0,a.useState)("all"),[F,z]=(0,a.useState)(null),[B,D]=(0,a.useState)(null),[I,R]=(0,a.useState)(null),[P,W]=(0,a.useState)(null),[O,L]=(0,a.useState)(null),M=(0,a.useRef)([]),q=(0,a.useCallback)(e=>401===e.status&&(t("/tboadmin"),!0),[t]),H=(0,a.useCallback)(async()=>{j(null);try{const e=await Mh("/school-productions");n(e.productions||[]),l(e.metrics||null),d(t=>{var s;return t&&e.productions.some(e=>e.id===t)?t:(null===(s=e.productions[0])||void 0===s?void 0:s.id)||null})}catch(e){q(e)||j(e.message)}y(!1)},[q]),U=(0,a.useCallback)(async e=>{if(e){g(!0);try{const t=await Mh("/school-productions/".concat(e,"/purchases"));x(t.purchases||[])}catch(t){q(t)||j(t.message)}g(!1)}else x([])},[q]);(0,a.useEffect)(()=>{(0,o.cd)()?H():t("/tboadmin")},[H,t]),(0,a.useEffect)(()=>{U(c),N("all")},[c,U]),(0,a.useEffect)(()=>()=>M.current.forEach(clearTimeout),[]);const G=(0,a.useCallback)(()=>{M.current.forEach(clearTimeout),M.current=[3e3,8e3,16e3,3e4].map(e=>setTimeout(()=>{U(c),H()},e))},[U,H,c]),V=s.find(e=>e.id===c)||null,J=(0,a.useMemo)(()=>{const e=A.trim().toLowerCase();return p.filter(t=>("all"===w||t.date_id===w)&&(("all"===S||t.display_status===S)&&(!e||[t.purchaser_name,t.student_name,t.email,t.ref,t.student_class].some(t=>(t||"").toLowerCase().includes(e)))))},[p,w,S,A]),Y=(0,a.useMemo)(()=>{const e=J.filter(e=>"paid"===e.display_status);return{ex:e.reduce((e,t)=>
1e+(t.amount_ex_gst||0),0),gst:e.reduce((e,t)=>e+(t.gst_amount||0),0),inc:e.reduce((e,t)=>e+(t.total_amount||0),0)}},[J]),K=(e,t)=>{const s=e=>{var t;const s=null===V||void 0===V||null===(t=V.dates)||void 0===t?void 0:t.find(t=>t.id===e.date_id);return s?Kh(s.date):""},a=e=>"paid"===e.display_status||"refunded"===e.display_status,n=[["Reference","Purchaser","Student","Class","Email","Mobile","Performance","Amount ex GST","GST","Amount inc GST","Payment","Stripe reference","Delivery","Paid at"],...e.map(e=>[e.ref,e.purchaser_name,e.student_name,e.student_class||"",e.email,e.mobile||"",s(e),(a(e)?e.amount_ex_gst:0).toFixed(2),(a(e)?e.gst_amount:0).toFixed(2),(a(e)?e.total_amount:0).toFixed(2),Qh[e.display_status]||e.display_status,e.stripe_payment_intent_id||"","paid"===e.display_status?"link_sent"===e.delivery_status?"Link sent":"Pending":"N/A",e.paid_at||""])].map(e=>e.map(e=>'"'.concat(String(null!==e&&void 0!==e?e:"").replace(/"/g,'""'),'"')).join(",")).join("\n"),r=new Blob([n],{type:"text/csv"}),i=window.URL.createObjectURL(r),o=document.createElement("a");o.href=i,o.download=t,o.click(),window.setTimeout(()=>window.URL.revokeObjectURL(i),1e3)},Z=b||!i?"KEY ACCOUNT":"KEY ACCOUNT \xb7 ".concat(s.length," PRODUCTION").concat(1===s.length?"":"S"," \xb7 ").concat(i.copies_sold," COPIES SOLD"),$="all"!==w?null===V||void 0===V||null===(e=V.dates)||void 0===e?void 0:e.find(e=>e.id===w):null,Q=p.find(e=>e.ref===I)||null,X=p.find(e=>e.ref===P)||null;return(0,f.jsx)(ta,{title:"School Productions",meta:Z,action:{label:"Add New",icon:ls.A,onClick:()=>z("new")},children:(0,f.jsxs)("div",{style:{fontFamily:Hh},children:[(0,f.jsx)("style",{children:"\n .sp-spin { animation: sp-spin 1s linear infinite; }\n @keyframes sp-spin { to { transform: rotate(360deg); } }\n .sp-iconbtn { transition: color .2s cubic-bezier(.16,1,.3,1); }\n .sp-iconbtn:hover { color: ".concat(qh.red," !important; }\n .sp-outline { transition: all .2s cubic-bezier(.16,1,.3,1); }\n .sp-outline:hover { border-color: ").concat(qh.red," !important; color: ").concat(qh.red," !important; }\n .sp-dashed:hover { border-color: ").concat(qh.red," !important; color: ").concat(qh.red," !important; }\n .sp-scroll { overflow-x: auto; }\n @media (max-width: 560px) { .sp-metrics { grid-template-columns: 1fr !important; } }\n ")}),v&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,background:"#FEF2F2",border:"1px solid #FECACA",color:"#B91C1C",borderRadius:12,padding:"13px 16px",marginBottom:20,fontSize:13.5},children:[(0,f.jsx)(h.A,{size:16})," ",v]}),(0,f.jsxs)("div",{style:{background:qh.carbon,borderRadius:16,overflow:"hidden",marginBottom:22},children:[(0,f.jsxs)("div",{style:{display:"flex",height:3},children:[(0,f.jsx)("span",{style:{flex:2,background:qh.red}}),(0,f.jsx)("span",{style:{flex:1,background:qh.amber}}),(0,f.jsx)("span",{style:{flex:1,background:qh.teal}})]}),(0,f.jsxs)("div",{style:{padding:"22px 26px 24px"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:16,flexWrap:"wrap"},children:[(0,f.jsx)("div",{style:{width:52,height:52,borderRadius:12,background:"#fff",display:"grid",placeItems:"center",flexShrink:0},children:(0,f.jsx)(bs.A,{size:26,color:qh.red})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:220},children:[(0,f.jsx)("h1",{style:{margin:0,fontFamily:Uh,fontStretch:"125%",fontWeight:800,fontSize:23,textTransform:"uppercase",color:"#fff",letterSpacing:"-0.01em"},children:"School Productions"}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginTop:9,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10,letterSpacing:"0.12em",background:"#3A1A1D",color:qh.amber,borderRadius:20,padding:"4px 10px"}),children:"KEY ACCOUNT"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10,letterSpacing:"0.12em",background:"#12281F",color:"#4ADE80",borderRadius:20,padding:"4px 10px"}),children:"FAMILY-PAID \xb7 STRIPE"})]}),(0,f.jsxs)("p",{style:{margin:"12px 0 0",maxWidth:680,fontSize:13.5,lineHeight:1.6,color:"#B4B4BB"},children:["Schools sell copies of their production video to families. Each production gets a public purchase page; families pay by card (price + GST) and receive a tokenised download link within ",Vh," of the final performance."]}),(0,f.jsxs)("div",{style:{display:"flex",gap:9,marginTop:15,flexWrap:"wrap"}
1,children:[(null===V||void 0===V?void 0:V.company_id)&&(0,f.jsx)(r.N_,{to:"/admin/companies/".concat(V.company_id),style:gu,children:"Company record"}),V&&(0,f.jsxs)("a",{href:V.portal_url,target:"_blank",rel:"noreferrer",style:gu,children:["Public portal ",(0,f.jsx)(En.A,{size:12})]}),(0,f.jsx)(r.N_,{to:"/admin/content-delivery",style:gu,children:"Content Delivery"}),(0,f.jsx)(r.N_,{to:"/admin/corporate",style:gu,children:"Runsheets"})]})]})]}),(0,f.jsxs)("div",{className:"sp-metrics",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(160px,1fr))",gap:12,marginTop:22},children:[(0,f.jsx)(nu,{label:"Live productions",value:i?i.live_productions:"\u2014"}),(0,f.jsx)(nu,{label:"Copies sold",value:i?i.copies_sold:"\u2014"}),(0,f.jsx)(nu,{label:"Revenue inc GST",value:i?(ee=i.revenue_inc_gst,new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",maximumFractionDigits:0}).format(Number(ee)||0)):"\u2014",sub:i?"".concat(Jh(i.gst_collected)," GST collected"):null}),(0,f.jsx)(nu,{label:"Awaiting delivery",value:i?i.awaiting_delivery:"\u2014",sub:"within ".concat(Vh),accent:null!==i&&void 0!==i&&i.awaiting_delivery?qh.amber:"#fff"})]})]})]}),(0,f.jsxs)(tu,{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"17px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)(su,{children:"Productions"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10,background:"#EDEDF0",color:qh.secondary,borderRadius:20,padding:"2px 8px"}),children:s.length}),(0,f.jsxs)("button",{type:"button",className:"tg-btn-primary",style:(0,m.A)((0,m.A)({},ru),{},{marginLeft:"auto",padding:"9px 14px"}),onClick:()=>z("new"),children:[(0,f.jsx)(ls.A,{size:15})," Add New"]})]}),b?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:4})}):0===s.length?(0,f.jsx)(Os,{icon:bs.A,title:"No productions yet",message:"Create the first school production to generate its public purchase page.",actionLabel:"Add New",onAction:()=>z("new")}):(0,f.jsx)("div",{className:"sp-scroll",children:(0,f.jsxs)("div",{style:{minWidth:1040},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:Xh,gap:12,padding:"11px 22px",background:qh.tableHead,borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)(au,{children:"Client / School"}),(0,f.jsx)(au,{children:"Event"}),(0,f.jsx)(au,{children:"Event dates"}),(0,f.jsx)(au,{children:"Price ex GST"}),(0,f.jsx)(au,{children:"Purchases"}),(0,f.jsx)(au,{children:"Revenue inc GST"}),(0,f.jsx)(au,{right:!0,children:"Actions"})]}),s.map(e=>{var t;const s=e.id===c;return(0,f.jsxs)("div",{className:"tg-row",onClick:()=>d(e.id),style:{display:"grid",gridTemplateColumns:Xh,gap:12,alignItems:"center",padding:"14px 22px",borderBottom:"1px solid ".concat(qh.divider),cursor:"pointer",background:s?"#FBFAFB":"transparent",boxShadow:s?"inset 3px 0 0 ".concat(qh.red):"none"},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:qh.carbon,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.school_name}),e.school_suburb&&(0,f.jsx)("div",{style:{fontSize:11.5,color:qh.muted,marginTop:2},children:e.school_suburb})]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:qh.carbon,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.event_name}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:11,color:qh.muted,marginTop:2,display:"flex",alignItems:"center",gap:5,overflow:"hidden"}),children:[(0,f.jsx)(Oh.A,{size:11,style:{flexShrink:0}}),(0,f.jsxs)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:["turbo.net.au/school/",e.slug]})]})]}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:12,color:qh.secondary}),children:(e.dates||[]).map(e=>Kh(e.date)).join(" \xb7 ")}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:13,fontWeight:700,color:qh.carbon}),children:Jh(e.price_ex_gst)}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:13,fontWeight:700,color:qh.carbon}),children:null!==(t=e.purchases_paid)&&void 0!==t?t:0}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:13,fontWeight:700,color:qh.green}),children:Jh(e.revenue_inc_gst)}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end"},onClick:e=>e.stopPropagation(),children:[(0,f.jsx)("button",{type:"button",className:"sp-iconbtn",style:ou,title:"Copy public link",onClick:t=>((e,t)=>{t.stopPropagation();try{navigator.clipboard.writeText(e.portal_url),L(e.id),setTimeout(()=>L(null),1500)}catch(s){}})(e,t),children:O===e.id?(0,f.jsx)(zt.A,{size:16,color:qh.green}):(0,f.jsx)(Cr.A,{size:16})}),(0,f.jsx)("button",{type:"button",className:"sp-iconbtn",style:ou,title:"Edit production",onClick:()=>z(e),children:(0,f.jsx)(ml.A,{size:16})})]})]},e.id)})]})})]}),V&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(tu,{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:12,padding:"17px 22px 0",flexWrap:"wrap"},children:[(0,f.jsx)(su,{children:"Purchasers"}),(0,f.jsxs)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10.5,letterSpacing:"0.1em",color:qh.muted,textTransform:"uppercase"}),children:[V.school_name," \xb7 ",V.event_name]}),$&&"delivered"!==$.delivery_status&&(0,f.jsxs)("button",{type:"button",className:"tg-btn-primary",style:(0,m.A)((0,m.A)({},ru),{},{marginLeft:"auto",padding:"8px 13px",fontSize:12.5}),onClick:()=>D($),children:[(0,f.jsx)(st.A,{size:13})," Mark date delivered"]}),$&&"delivered"===$.delivery_status&&(0,f.jsxs)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{marginLeft:"auto",fontSize:10,letterSpacing:"0.1em",color:qh.green,textTransform:"uppercase",display:"inline-flex",alignItems:"center",gap:5}),children:[(0,f.jsx)(zt.A,{size:12})," Delivered"]})]}),(0,f.jsx)("div",{style:{display:"flex",gap:2,borderBottom:"1px solid ".concat(qh.border),overflowX:"auto",padding:"4px 22px 0"},children:[{id:"all",label:"All dates",count:p.length},...(V.dates||[]).map(e=>({id:e.id,label:Kh(e.date),count:p.filter(t=>t.date_id===e.id).length}))].map(e=>{const t=w===e.id;return(0,f.jsxs)("button",{type:"button",onClick:()=>N(e.id),style:{display:"flex",alignItems:"center",gap:7,background:"none",border:"none",borderBottom:"2.5px solid ".concat(t?qh.red:"transparent"),marginBottom:-1,padding:"11px 14px",cursor:"pointer",whiteSpace:"nowrap",fontFamily:Uh,fontWeight:700,fontSize:13.5,color:t?qh.carbon:qh.body,transition:"color .2s cubic-bezier(.16,1,.3,1)"},children:[e.label,(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10,background:t?qh.red:"#E2E2E8",color:t?"#fff":qh.body,borderRadius:20,padding:"2px 7px"}),children:e.count})]},e.id)})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"16px 22px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,background:qh.hover,border:"1px solid ".concat(qh.border),borderRadius:9,padding:"8px 12px",flex:"1 1 220px",maxWidth:340},children:[(0,f.jsx)(ds.A,{size:15,color:qh.muted,style:{flexShrink:0}}),(0,f.jsx)("input",{value:A,onChange:e=>k(e.target.value),placeholder:"Search purchaser, student, email\u2026",style:{border:"none",outline:"none",background:"transparent",fontFamily:Hh,fontSize:13,width:"100%",color:qh.carbon}})]}),(0,f.jsxs)("select",{value:S,onChange:e=>C(e.target.value),style:{background:"#fff",border:"1px solid ".concat(qh.border),borderRadius:9,padding:"8px 10px",fontFamily:Hh,fontSize:13,fontWeight:600,color:qh.ink,cursor:"pointer"},children:[(0,f.jsx)("option",{value:"all",children:"All payments"}),(0,f.jsx)("option",{value:"paid",children:"Paid"}),(0,f.jsx)("option",{value:"refunded",children:"Refunded"}),(0,f.jsx)("option",{value:"failed",children:"Failed"})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginLeft:"auto",flexWrap:"wrap"},children:[(0,f.jsxs)("button",{type:"button",className:"sp-outline",style:iu,onClick:()=>{var e;const t=null===V||void 0===V||null===(e=V.dates)||void 0===e?void 0:e.find(e=>e.id===w),s=t?t.date:"all-dates";K(J,"school-productions-".concat(null===V||void 0===V?void 0:V.slug,"-").concat(s,".csv"))},disabled:!J.length,children:[(0,f.jsx)(es.A,{size:14})," Export this date"]}),(0,f.jsxs)("button",{type:"button",className:"sp-outline",style:iu,onClick:()=>K(p,"school-productions-".concat(null===V||void 0===V?void 0:V.slug,"-all-dates.csv")),disabled:!p.length,children:[(0,f.jsx)(es.A,{size:14})," Export all dates"]})]})]}),u?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:5})}):0===J.length?(0,f.jsx)("div",{style:{padding:"10px 0"},children:(0,f.jsx)(Os,{icon:Xe.A,title:"No purchases found",message:"Purchases appear here the moment a family pays on the public portal."})}):(0,f.jsx)("div",{className:"sp-scroll",children:(0,f.jsxs)("div",{style:{minWidth:1040},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:eu,gap:12,padding:"11px 22px",background:qh.tableHead,borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)(au,{children:"Purchaser"}),(0,f.jsx)(au,{children:"Student / Class"}),(0,f.jsx)(au,{children:"Email / Mobile"}),(0,f.jsx)(au,{children:"Performance"}),(0,f.jsx)(au,{children:"Amount inc GST"}),(0,f.jsx)(au,{children:"Payment"}),(0,f.jsx)(au,{children:"Delivery"}),(0,f.jsx)(au,{right:!0,children:"Actions"})]}),J.map(e=>{var t;const s=null===(t=V.dates)||void 0===t?void 0:t.find(t=>
1t.id===e.date_id),a="paid"===e.display_status;return(0,f.jsxs)("div",{className:"tg-row",style:{display:"grid",gridTemplateColumns:eu,gap:12,alignItems:"center",padding:"13px 22px",borderBottom:"1px solid ".concat(qh.divider)},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:qh.carbon,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.purchaser_name}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:11,color:qh.muted,marginTop:2}),children:e.ref})]}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13,color:"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.student_name}),e.student_class&&(0,f.jsx)("div",{style:{fontSize:11.5,color:qh.muted,marginTop:2},children:e.student_class})]}),(0,f.jsxs)("div",{style:{minWidth:0,display:"grid",gap:3},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12,color:qh.secondary,overflow:"hidden"},children:[(0,f.jsx)(T.A,{size:13,color:qh.muted,style:{flexShrink:0}}),(0,f.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.email})]}),e.mobile&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12,color:qh.secondary},children:[(0,f.jsx)(E.A,{size:13,color:qh.muted,style:{flexShrink:0}}),e.mobile]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:12,fontWeight:700,color:qh.carbon,textTransform:"uppercase"}),children:s?Kh(s.date):"\u2014"}),e.paid_at&&(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:11,color:qh.muted,marginTop:2}),children:Zh(e.paid_at)})]}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:13,fontWeight:700,color:a?qh.carbon:qh.muted}),children:a||"refunded"===e.display_status?Jh(e.total_amount):"\u2014"}),(0,f.jsxs)("div",{children:[(0,f.jsx)(Ds,{tone:$h[e.display_status]||"muted",children:Qh[e.display_status]||e.display_status}),e.stripe_payment_intent_id&&(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:10,color:qh.faint,marginTop:4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:100}),children:e.stripe_payment_intent_id})]}),(0,f.jsx)("div",{children:a?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Ds,{tone:"link_sent"===e.delivery_status?"blue":"amber",children:"link_sent"===e.delivery_status?"Link sent":"Pending"}),(0,f.jsx)("div",{style:{fontSize:10.5,color:qh.faint,marginTop:4},children:"link_sent"===e.delivery_status?"link issued":"due 14\u201330 bus. days"})]}):(0,f.jsx)(Ds,{tone:"muted",children:"N/A"})}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end"},children:[a&&(0,f.jsx)("button",{type:"button",className:"sp-iconbtn",style:ou,title:"Preview & resend email",onClick:()=>R(e.ref),children:(0,f.jsx)(st.A,{size:16})}),(0,f.jsx)("button",{type:"button",className:"sp-iconbtn",style:ou,title:"View purchase",onClick:()=>W(e.ref),children:(0,f.jsx)(_.A,{size:16})})]})]},e.ref)})]})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:20,padding:"15px 22px",borderTop:"1px solid #EDEDF0",background:qh.tableHead,flexWrap:"wrap"},children:[(0,f.jsxs)("span",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:11.5,color:qh.secondary}),children:["SHOWING ",J.length," OF ",p.length]}),(0,f.jsx)("div",{style:{display:"flex",gap:22,marginLeft:"auto",flexWrap:"wrap"},children:[["Ex GST",Y.ex,qh.carbon],["GST",Y.gst,qh.carbon],["Inc GST",Y.inc,qh.green]].map(e=>{let[t,s,a]=e;return(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:9.5,letterSpacing:"0.14em",color:qh.muted,textTransform:"uppercase"}),children:t}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Gh),{},{fontSize:15,fontWeight:700,color:a,marginTop:2}),children:Jh(s)})]},t)})})]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:11,alignItems:"flex-start",background:"#FFFBEB",border:"1px solid #FDE68A",borderRadius:12,padding:"13px 16px",fontSize:12.5,lineHeight:1.55,color:"#78350F",marginBottom:22},children:[(0,f.jsx)(Nt.A,{size:15,color:"#B45309",style:{flexShrink:0,marginTop:2}}),(0,f.jsxs)("span",{children:["Families are promised their tokenised download link within ",(0,f.jsx)("strong",{children:Vh})," of the final performance. Select a performance date tab and mark it delivered to issue the links \u2014 that date's purchasers flip to LINK SENT as each email goes out."]})]})]}),F&&(0,f.jsx)(mu,{production:"new"===F?null:F,onClose:()=>z(null),onSaved:e=>{z(null),d((null===e||void 0===e?void 0:e.id)||c),H()}}),B&&V&&(0,f.jsx)(pu,{production:V,dateRow:B,onClose:()=>D(null),onDelivered:G}),X&&(0,f.jsx)(hu,{purchase:X,production:V,onClose:()=>W(null),onChanged:()=>{U(c),H()},onPreviewEmail:()=>{W(null),R(X.ref)}}),Q&&(0,f.jsx)(xu,{purchase:Q,dateLabel:(e=>{const t=null===V||void 0===V||null===(e=V.dates)||void 0===e?void 0:e.find(e=>e.id===Q.date_id);return t?Kh(t.date):""})(),onClose:()=>R(null),onResent:()=>U(c)})]})});var ee}const gu={display:"inline-flex",alignItems:"center",gap:6,textDecoration:"none",background:"rgba(255,255,255,.08)",color:"#fff",border:"1px solid rgba(255,255,255,.16)",borderRadius:9,padding:"7px 13px",fontSize:12.5,fontWeight:700},fu={title:"Before you buy \u2014 please read this",intro:"We film school productions as a live event. That means a few things are worth knowing up front, because they affect what you'll see and hear on the recording:",bullets:[{lead:"We can't guarantee your child appears in close-up, or for any particular length of time.",text:"We film the whole production. Who's on camera depends on where the school's production team has placed each performer."},{lead:"The sound comes from the venue's sound desk, not from us.",text:"Dropped microphones, uneven levels, and backing tracks louder than the singing are common at school productions and happen at the venue, before the audio ever reaches us. We place backup microphones as a
1safety net, but they pick up room sound too."},{lead:"Stage lighting, haze, and blocking affect what's visible.",text:"Dark scenes look dark. Haze softens the picture. Performers behind set pieces are behind set pieces."},{lead:"The recording captures the night as it happened",text:"\u2014 including any hiccups, missed cues, or technical faults on the night."}],closing:["None of this is us lowering the bar. It's the honest reality of filming a live show in a school hall or theatre, and we'd rather you know before you pay than be disappointed afterwards.","Because of the above, video purchases are not refunded for change of mind. Your rights under Australian Consumer Law still apply in full if something is actually wrong with the file \u2014 see section 6."]},bu=[{num:"1",title:"What you're buying",clauses:[{num:"1.1",text:"You're buying access to a video recording of a school production filmed by Turbo 360."},{num:"1.2",text:"Unless the checkout page says otherwise, you're buying a digital file or streaming access \u2014 not a DVD, USB, or other physical media.",boldPart:"digital file or streaming access"},{num:"1.3",text:"You're buying it for your own personal and family use. See section 8 for what that does and doesn't allow."},{num:"1.4",text:"Recordings are delivered as a high-definition video file, minimum 1080p resolution. These are large files \u2014 typically several gigabytes \u2014 so you'll need a reasonable internet connection and free space on your device.",boldPart:"high-definition video file, minimum 1080p resolution"},{num:"1.5",text:"All prices are in Australian dollars and include GST."}]},{num:"2",title:"What we can and can't promise",clauses:[{num:"2.1",text:"We film the production as a complete performance, using professional cameras from agreed positions in the venue."},{num:"2.2",text:"We don't guarantee that any individual performer appears in the recording, appears in close-up, or appears for a set amount of time. What ends up on camera is shaped by the staging, choreography, lighting, and blocking designed by the school's production team \u2014 all decisions made well before we arrive.",boldPart:"We don't guarantee that any individual performer appears in the recording, appears in close-up, or appears for a set amount of time."},{num:"2.3",text:"Performers positioned at the back of the stage, within large ensemble groups, behind scenery, or outside the lit area may appear briefly, partially, or not at all."},{num:"2.4",text:"We don't film rehearsals, backstage, the foyer, or the audience unless the school has specifically arranged it."},{num:"2.5",text:"Where a production runs over several nights, the recording may come from one nominated performance. Cast rotations between nights mean a particular performer may not appear in the recorded performance."}]},{num:"3",title:"Sound",clauses:[{num:"3.1",text:"Our focus is the visual capture of the production. Audio is taken from the venue's sound system, mixed by the venue's operator. We don't control that desk, that mix, or that equipment.",boldPart:"Audio is taken from the venue's sound system"},{num:"3.2",text:"We position backup microphones as a contingency. These are a safeguard, not a replacement for a properly mixed desk feed \u2014 they capture ambient room sound, including the audience.",boldPart:"backup microphones"},{num:"3.3",text:"Things that commonly affect audio at school productions, all of which happen at the venue and outside our control:",bullets:["radio microphones dropping out, crackling, or running flat","microphones switched on late, or not at all","levels mixed too low, too high, or inconsistently","feedback, hum, or buzz from venue equipment","backing tracks, band, or orchestra overpowering vocals","performers turning away from microphones or not projecting","audience noise, applause, coughing, and phones","air conditioning and building noise"]},{num:"3.4",text:"We apply reasonable correction in post-production where we can \u2014 balancing levels, reducing noise, switching to our backup audio. We can't recover audio that was never captured, or repair a mix that was wrong at the source.",boldPart:"We can't recover audio that was never captured, or repair a mix that was wrong at the source."},{num:"3.5",text:"Audio issues of the kind described above aren't a basis for a refund. They're a characteristic of live school production recordings, and they're disclosed here before purchase."}]},{num:"4",title:"Picture and staging",clauses:[{num:"4.1",text:"Stage lighting, blackouts, strobe, haze, and smoke are creative choices made by the school's production team. Very low light produces a noisier image; haze softens the picture and can obscure performers."},{num:"4.2",text:"Projected or screen content on stage may not reproduce accurately on camera."},{num:"4.3",text:"Standing audience members, raised phones, and people crossing in front of cameras can briefly obstruct the view."}]},{num:"5",title:"Delivery and access",clauses:[{num:"5.1",text:"Payment is required in full at checkout."},{num:"5.2",text:"Access details are sent to the email address you provide. Please check it's correct \u2014 and check your junk folder if nothing arrives within a few hours."},{num:"5.3",text:"Recordings are delivered within 14 to 30 business days of the performance \u2014 roughly three to six weeks. Editing a full production takes time, and we'd rather take it than rush the result. If we're running behind, we'll email you.",boldPart:"within 14 to 30 business days of the performance"},{num:"5.4",text:"Once delivered, your download stays available for 30 days. Please download and back up your file during that window \u2014 save it somewhere other than your phone.",boldPart:"Please download and back up your file during that window"}
1,{num:"5.5",text:"If you miss the 30-day window, get in touch. We keep the recording on our systems for 6 months from delivery, and we'll re-issue your access free of charge at any point within that period.",boldPart:"6 months from delivery"},{num:"5.6",text:"After 6 months the recording is permanently deleted and cannot be recovered. Please make sure you have your own copy well before then.",boldPart:"After 6 months the recording is permanently deleted"},{num:"5.7",text:"Having trouble downloading or playing your file? Contact us \u2014 see section 11. We'd much rather help than have you stuck."}]},{num:"6",title:"Refunds and your consumer rights",clauses:[{num:"6.1",text:"We don't refund for change of mind, or for the limitations described in sections 2, 3 and 4, which are disclosed above before you purchase. This is because the product is a digital recording delivered to you immediately.",boldPart:"We don't refund for change of mind"},{num:"6.2",text:"To be specific, we don't refund where:",bullets:["a particular performer doesn't appear, or appears only briefly","audio is affected by venue sound, microphones, or audience noise","the picture is affected by stage lighting, haze, or blocking","the performance itself contained errors or interruptions","you've changed your mind","you ordered the wrong production or wrong performance date (contact us anyway \u2014 we'll usually swap it)"]},{num:"6.3",text:"Your rights under the Australian Consumer Law are not affected by anything in these terms. If the recording is faulty, you're entitled to a remedy. That includes where:",boldPart:"Your rights under the Australian Consumer Law are not affected by anything in these terms.",bullets:["the file won't play, or is corrupted","the file is substantially incomplete","the recording is materially different from what was described when you bought it","your access link doesn't work and we can't fix it"]},{num:"6.4",text:"In those cases, contact us and we'll replace the file. Where a replacement can't resolve the problem, we'll refund you."},{num:"6.5",text:"Please report any fault within 30 days of purchase so we can investigate while the source material is still on hand.",boldPart:"30 days"}]},{num:"7",title:"Privacy and the children in the recording",clauses:[{num:"7.1",text:"All Turbo 360 crew filming at schools hold a current Working with Children Check."},{num:"7.2",text:"Consent for students to be recorded is arranged by the school, not by us. If you have concerns about your child appearing in a school recording, please raise them with the school directly."},{num:"7.3",text:"We collect only the information needed to process your order and deliver your purchase. We don't sell your details or share them with third parties for marketing."},{num:"7.4",text:"Recordings are held on our systems for 6 months from delivery and are then permanently deleted.",boldPart:"6 months from delivery"}]},{num:"8",title:"What you can and can't do with the video",clauses:[{num:"8.1",text:"Copyright in the recording stays with Turbo Productions Pty Ltd."},{num:"8.2",text:"You can keep it, watch it as often as you like, and share it privately with family \u2014 grandparents, relatives, close friends.",boldPart:"You can"},{num:"8.3",text:"You can't post it, or any clip from it, to YouTube, Facebook, Instagram, TikTok, or any other public platform. You also can't copy it for distribution, sell it, or use it commercially.",boldPart:"You can't"},{num:"8.4",text:"This isn't us being precious. Two reasons:",bullets:["Other people's children are in the video. Not every family consents to their child appearing online, and a public upload takes that choice away from them.","School productions are licensed works. Musicals in particular are recorded under licences that permit private viewing only. A public upload can expose the school to a claim from the rights holder."]},{num:"8.5",text:"If you'd like to share a moment more widely, contact us \u2014 we can often help you do it in a way that works for everyone."}]},{num:"9",title:"If something goes wrong on our end",clauses:[{num:"9.1",text:"We use professional equipment and record to backup media wherever practical. If a technical failure on our part means the recording can't be delivered, we'll refund you in full."},{num:"9.2",text:"We're not responsible for delays or failures caused by events outside our reasonable control \u2014 venue closure, natural disaster, power failure, public health direction, or a production being cancelled."}]},{num:"10",title:"General",clauses:[{num:"10.1",text:"Our total liability to you for any purchase is limited to the amount you paid for it. Nothing in these terms limits any right or remedy under the Australian Consumer Law that can't lawfully be limited."},{num:"10.2",text:"We may update these terms from time to time. The version you agreed to at the time of your purchase is the one that applies to that purchase. Changes never apply retrospectively.",boldPart:"The version you agreed to at the time of your purchase is the one that applies to that purchase."},{num:"10.3",text:"These terms are governed by the laws of Victoria, Australia."}]}],yu="Questions, problems, or a file that won't play",vu="11",ju="We'd genuinely rather hear from you than have you sit with a broken download.",wu="Turbo 360",Nu="[email protected]",Au="1300 207 446",ku="Questions about the production itself \u2014 cast, running order, dates, or whether your child was in a particular scene \u2014 are best directed to the school, as they hold that information and we don't.",Su="Turbo Productions Pty Ltd trading as Turbo 360 \u2014 ABN 18 150 556 102. Filming school productions since 1999.",_u="#BF212F",Cu="#E6505A",Fu="#F2A900",Eu="#0FA3A3",Tu="#0A0A0B",zu="#14181B",Bu="#26262B",Du="#F4F2EE",Iu="#E2DED6",Ru="#EDEBE5",Pu="#FBF9F5",Wu="#0A0A0B",Ou="#3A3A40",Lu="#55555C",Mu="#9A9AA0",qu="#B5B5BC",Hu="#6A6A72",Uu="#7A7A82",Gu="#C9C5BC",Vu="#15803D",Ju="'Hanken Grotesk', -apple-system, system-ui, sans-serif",Yu="'Archivo', sans-serif",Ku={fontFamily:"'Space Mono', monospace"},Zu="cubic-bezier(0.16, 1, 0.3, 1)",$u="14\u201330 business days",Qu=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:2}).format(Number(e)||0),Xu=e=>{const t=new Date("".concat(e,"T00:00:00"));return isNaN(t)?e:t.toLocaleDateString("en-AU",{weekday:"long",day:"numeric",month:"long",year:"numeric"})},eg=e=>{const t=new Date("".concat(e,"T00:00:00"));return isNaN(t)?e||"":t.toLocaleDateString("en-AU",{weekday:"short",day:"numeric",month:"short"}).toUpperCase()},tg=(0,m.A)((0,m.A)({},Ku),{},{fontSize:10,letterSpacing:"0.16em",color:Mu,textTransform:"uppercase"}),sg=(0,m.A)((0,m.A)({},Ku),{},{display:"block",fontSize:10,letterSpacing:"0.12em",color:Hu,textTransform:"uppercase",marginBottom:7}),ag={width:"100%",boxSizing:"border-box",background:Pu,border:"1px solid ".concat(Iu),borderRadius:10,padding:"13px 14px",fontFamily:Ju,fontSize:15,color:Wu,minHeight:48},ng={background:"#fff",border:"1px solid ".concat(Iu),borderRadius:12,padding:"26px 28px"}
1,rg={style:{base:{fontSize:"16px",color:"#1f2937",fontFamily:"'Hanken Grotesk', sans-serif","::placeholder":{color:"#6b7280"}},invalid:{color:_u}},hidePostalCode:!0};function ig(e){let{onClose:t,onAccept:s}=e;const n=(0,a.useRef)(null),r=e=>t=>{var s;t.preventDefault();const a=null===(s=n.current)||void 0===s?void 0:s.querySelector("#sp-terms-".concat(e));a&&a.scrollIntoView({behavior:"smooth",block:"start"})},i=e=>{if(!e.boldPart||!e.text.includes(e.boldPart))return e.text;const[t,s]=e.text.split(e.boldPart);return(0,f.jsxs)(f.Fragment,{children:[t,(0,f.jsx)("strong",{style:{color:Wu},children:e.boldPart}),s]})};return(0,f.jsx)("div",{onClick:t,className:"sp-terms-overlay",style:{position:"fixed",inset:0,background:"rgba(10,10,11,.62)",zIndex:95,display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"sp-terms-panel",style:{background:"#fff",borderRadius:14,maxWidth:940,width:"100%",maxHeight:"90vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,f.jsxs)("div",{style:{display:"flex",height:4,flexShrink:0},children:[(0,f.jsx)("span",{style:{flex:2,background:_u}}),(0,f.jsx)("span",{style:{flex:1,background:Fu}}),(0,f.jsx)("span",{style:{flex:1,background:Eu}})]}),(0,f.jsxs)("div",{className:"sp-terms-head",style:{background:Tu,padding:"26px 34px 24px",display:"flex",justifyContent:"space-between",gap:16,flexShrink:0},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10,letterSpacing:"0.16em",color:Cu,textTransform:"uppercase"}),children:"Terms of purchase \xb7 School production videos"}),(0,f.jsx)("h2",{style:{margin:"9px 0 0",fontFamily:Yu,fontStretch:"110%",fontWeight:800,fontSize:25,lineHeight:1.16,color:"#fff"},children:"Please read this before you buy"}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10.5,color:Mu,marginTop:9}),children:["Turbo Productions Pty Ltd \xb7 ABN ","18 150 556 102"," \xb7 Updated ","19 August 2026"]})]}),(0,f.jsx)("button",{type:"button",onClick:t,"aria-label":"Close",style:{width:40,height:40,flexShrink:0,background:"rgba(255,255,255,.08)",border:"1px solid rgba(255,255,255,.16)",borderRadius:10,color:"#fff",display:"grid",placeItems:"center",cursor:"pointer"},children:(0,f.jsx)(g.A,{size:17})})]}),(0,f.jsxs)("div",{className:"sp-terms-body",style:{display:"grid",gridTemplateColumns:"232px minmax(0,1fr)",flex:1,minHeight:0},children:[(0,f.jsxs)("nav",{className:"sp-terms-rail",style:{background:Pu,borderRight:"1px solid ".concat(Ru),padding:"22px 18px",overflowY:"auto"},children:[bu.map(e=>(0,f.jsxs)("a",{href:"#sp-terms-".concat(e.num),onClick:r(e.num),className:"sp-terms-link",style:{display:"flex",gap:8,alignItems:"baseline",padding:"8px 10px",borderRadius:8,fontSize:12.5,color:Ou,textDecoration:"none"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:11,color:qu}),children:e.num})," ",e.title]},e.num)),(0,f.jsxs)("a",{href:"#sp-terms-11",onClick:r("11"),className:"sp-terms-link",style:{display:"flex",gap:8,alignItems:"baseline",padding:"8px 10px",borderRadius:8,fontSize:12.5,color:Ou,textDecoration:"none"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:11,color:qu}),children:"11"})," Questions & contact"]})]}),(0,f.jsxs)("div",{ref:n,className:"sp-terms-content",style:{padding:"26px 34px 30px",overflowY:"auto",scrollBehavior:"smooth"},children:[(0,f.jsxs)("div",{style:{background:Pu,border:"1px solid ".concat(Iu),borderRadius:12,padding:"22px 24px"},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10,letterSpacing:"0.14em",color:_u,textTransform:"uppercase",marginBottom:10}),children:fu.title}),(0,f.jsx)("p",{style:{margin:0,fontSize:14.5,lineHeight:1.65,color:Ou},children:fu.intro}),fu.bullets.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",gap:11,marginTop:13},children:[(0,f.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:_u,flexShrink:0,marginTop:8}}),(0,f.jsxs)("p",{style:{margin:0,fontSize:14.5,lineHeight:1.65,color:Ou},children:[(0,f.jsx)("strong",{style:{color:Wu},children:e.lead})," ",e.text]})]},t)),fu.closing.map((e,t)=>(0,f.jsx)("p",{style:{margin:"13px 0 0",fontSize:14.5,lineHeight:1.65,color:Ou},children:e},t))]}),bu.map(e=>(0,f.jsxs)("section",{id:"sp-terms-".concat(e.num),style:{paddingTop:30,scrollMarginTop:12},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"baseline",marginBottom:12},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:12,fontWeight:700,color:_u}),children:e.num}),(0,f.jsx)("h3",{style:{margin:0,fontFamily:Yu,fontWeight:800,fontSize:18,color:Wu},children:e.title})]}),e.clauses.map(e=>(0,f.jsxs)("div",{style:{display:"flex",gap:0,marginBottom:11},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{width:34,flexShrink:0,fontSize:12,fontWeight:700,color:qu,paddingTop:2}),children:e.num}),(0,f.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,f.jsx)("p",{style:{margin:0,fontSize:14.5,lineHeight:1.65,color:Ou},children:i(e)}),e.bullets&&e.bullets.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",gap:10,paddingLeft:14,marginTop:7},children:[(0,f.jsx)("span",{style:{width:4,height:4,borderRadius:"50%",background:Gu,flexShrink:0,marginTop:8}}),(0,f.jsx)("span",{style:{fontSize:14,lineHeight:1.6,color:Lu},children:e})]},t))]})]},e.num))]},e.num)),(0,f.jsx)("section",{id:"sp-terms-11",style:{paddingTop:30,scrollMarginTop:12},children:(0,f.jsxs)("div",{style:{background:Tu,borderRadius:12,padding:"22px 24px"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"baseline",marginBottom:10},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:12,fontWeight:700,color:Cu}),children:vu}),(0,f.jsx)("h3",{style:{margin:0,fontFamily:Yu,fontWeight:800,fontSize:18,color:"#fff"},children:yu})]}),(0,f.jsx)("p",{style:{margin:0,fontSize:14,lineHeight:1.65,color:"#B4B4BB"},children:ju}),(0,f.jsx)("div",{style:{marginTop:14,fontSize:14.5,color:"#fff",fontWeight:600},children:wu}),(0,f.jsxs)("div",{style:{marginTop:4},children:[(0,f.jsx)("a",{href:"mailto:".concat(Nu),style:{color:"#fff",fontSize:13.5,fontWeight:600,textDecoration:"none"},children:Nu}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{color:Mu,fontSize:12.5,marginLeft:14}),children:Au})]}),(0,f.jsx)("p",{style:{margin:"14px 0 0",fontSize:13.5,lineHeight:1.6,color:"#B4B4BB"},children:ku}),(0,f.jsx)("p",{style:{margin:"16px 0 0",fontSize:12,lineHeight:1.6,color:Mu,fontStyle:"italic"},children:Su})]})})]})]}),(0,f.jsxs)("div",{className:"sp-terms-foot",style:{display:"flex",alignItems:"center",gap:12,borderTop:"1px solid ".concat(Ru),background:Pu,padding:"16px 34px",flexShrink:0,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10.5,letterSpacing:"0.08em",color:Mu,textTransform:"uppercase"}),children:"Governed by the laws of Victoria, Australia"}),(0,f.jsxs)("div",{className:"sp-terms-actions",style:{display:"flex",gap:10,marginLeft:"auto"},children:[(0,f.jsx)("button",{type:"button",onClick:t,style:{background:"#fff",border:"1px solid ".concat(Iu),borderRadius:10,padding:"12px 18px",fontFamily:Ju,fontSize:14,fontWeight:600,color:Wu,cursor:"pointer",minHeight:48},children:"Close"}),(0,f.jsxs)("button",{type:"button",onClick:s,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:8,background:_u,border:"none",borderRadius:10,padding:"12px 20px",fontFamily:Ju,fontSize:14,fontWeight:700,color:"#fff",cursor:"pointer",minHeight:48},children:[(0,f.jsx)(zt.A,{size:16})," I accept these terms"]})]})]})]})})}function og(e){let{summary:t,email:s,onDone:a}=e;const n=(t.purchaser_name||"").split(" ")[0];return(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(10,10,11,.6)",zIndex:90,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:(0,f.jsxs)("div",{style:{background:"#fff",borderRadius:14,maxWidth:560,width:"100%",maxHeight:"92vh",overflowY:"auto"},children:[(0,f.jsxs)("div",{style:{display:"flex",height:4},children:[(0,f.jsx)("span",{style:{flex:2,background:_u}}),(0,f.jsx)("span",{style:{flex:1,background:Fu}}),(0,f.jsx)("span",{style:{flex:1,background:Eu}})]}),(0,f.jsxs)("div",{style:{background:Tu,padding:"32px 30px"},children:[(0,f.jsx)("div",{style:{width:46,height:46,borderRadius:12,background:"#12281F",color:"#4ADE80",display:"grid",placeItems:"center"},children:(0,f.jsx)(zt.A,{size:24})}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10.5,letterSpacing:"0.12em",color:Mu,textTransform:"uppercase",marginTop:16}),children:["Payment received \xb7 ",t.ref]}),(0,f.jsxs)("h2",{style:{margin:"8px 0 0",fontFamily:Yu,fontStretch:"110%",fontWeight:800,fontSize:27,lineHeight:1.14,color:"#fff"},children:["Thanks ",n," \u2014 your copy is ordered."]})]}),(0,f.jsxs)("div",{style:{padding:"26px 30px 30px"},children:[[["Performance",(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:13.5,fontWeight:700,color:_u}),children:t.performance})],["Student",(0,f.jsx)("span",{style:{fontSize:14,fontWeight:600,color:Wu},children:t.student_name})],["Paid inc GST",(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:14,fontWeight:700,color:Wu}),children:Qu(t.total_amount)})]].map((e,t)=>{let[s,a]=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:14,padding:"11px 0",borderTop:0===t?"none":"1px solid ".concat(Ru)},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10,letterSpacing:"0.12em",color:Mu,textTransform:"uppercase"}),children:s}),a]},s)}),(0,f.jsxs)("div",{style:{display:"flex",gap:11,background:Pu,border:"1px solid ".concat(Iu),borderRadius:10,padding:"15px 16px",marginTop:14},children:[(0,f.jsx)(es.A,{size:15,color:_u,style:{flexShrink:0,marginTop:2}}),(0,f.jsxs)("p",{style:{margin:0,fontSize:13.5,lineHeight:1.6,color:Ou},children:["Your video is delivered as a tokenised digital download link within ",(0,f.jsx)("strong",{children:$u})," of the final performance, sent to ",(0,f.jsx)("strong",{children:s}),". A receipt is on its way now."]})]}),(0,f.jsx)("button",{type:"button",onClick:a,className:"sp-done",style:{width:"100%",marginTop:18,background:Tu,color:"#fff",border:"none",borderRadius:10,padding:15,fontFamily:Ju,fontSize:15,fontWeight:700,cursor:"pointer",minHeight:48,transition:"background .15s ".concat(Zu)},children:"Done"})]})]})})}function lg(e){let{production:t,slug:s}=e;const n=(0,Bc.t2)(),r=(0,Bc.HH)(),i=Boolean(n&&r),[o,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(""),[p,x]=(0,a.useState)(""),[u,g]=(0,a.useState)(""),[b,y]=(0,a.useState)(""),[v,j]=(0,a.useState)(1===t.dates.length?t.dates[0].id:""),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(!1),[S,_]=(0,a.useState)("just now"),[C,F]=(0,a.useState)(!1),[E,T]=(0,a.useState)(null),[z,B]=(0,a.useState)(null),D=(0,a.useRef)(null),R=t.pricing,P=/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(b.trim()),W=o.trim()&&c.trim()&&P&&v,O=Boolean(W&&w&&n&&r&&i);(0,a.useEffect)(()=>{D.current=null},[o,c,p,u,b,v]);const L=(0,a.useCallback)(async e=>{for(let a=0;a<5;a+=1){await new Promise(e=>setTimeout(e,2e3));try{const t=await fetch("".concat(I.fn,"/api/school/").concat(s,"/order/").concat(e,"/status")),a=await t.json();if("paid"===a.payment_status)return a}catch(t){}}return null},[s]),M=O?"CARD CHARGED ONCE \xb7 NO SUBSCRIPTION":W&&!w?"REVIEW & ACCEPT THE TERMS OF PURCHASE":"NAME \xb7 STUDENT \xb7 EMAIL \xb7 PERFORMANCE DATE",q=t.dates.find(e=>e.id===v),H=t.dates.map(e=>eg(e.date)).join(" \xb7 ");return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{background:Tu,position:"relative",overflow:"hidden"},children:[(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"",style:{position:"absolute",top:"-14%",right:"-6%",width:460,opacity:.07,pointerEvents:"none"}}),(0,f.jsxs)("div",{className:"sp-hero",style:{maxWidth:1120,margin:"0 auto",padding:"52px 40px 46px",position:"relative"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10.5,letterSpacing:"0.2em",color:Cu,textTransform:"uppercase"}),children:"School Production Video"}),(0,f.jsx)("span",{style:{width:4,height:4,borderRadius:"50%",background:"#48484E"}}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10.5,letterSpacing:"0.2em",color:Mu,textTransform:"uppercase"}),children:H})]}),(0,f.jsx)("h1",{className:"sp-hero-h1",style:{margin:"16px 0 0",fontFamily:Yu,fontStretch:"125%",fontWeight:900,fontSize:46,lineHeight:1.04,letterSpacing:"-0.02em",textTransform:"uppercase",color:"#fff",maxWidth:860},children:t.event_name}),(0,f.jsx)("p",{style:{margin:"18px 0 0",fontSize:16.5,lineHeight:1.65,color:"#B4B4BB",maxWidth:620},children:t.description||"Own the ".concat(t.school_name," production \u2014 filmed from every angle, edited into one keepsake your family can watch for years.")}),(0,f.jsx)("div",{style:{display:"flex",gap:9,marginTop:22,flexWrap:"wrap"},children:[[Ge.A,"Multi-camera edit"],[Ya.A,"Audio from the desk"],[es.A,"Digital download"]].map(e=>{let[t,s]=e;return(0,f.jsxs)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{display:"inline-flex",alignItems:"center",gap:7,background:zu,border:"1px solid ".concat(Bu),borderRadius:20,padding:"6px 12px",fontSize:10.5,letterSpacing:"0.08em",color:"#C4C4CB",textTransform:"uppercase"}),children:[(0,f.jsx)(t,{size:13})," ",s]},s)})})]})]}),(0,f.jsxs)("main",{className:"sp-body",style:{maxWidth:1120,margin:"0 auto",padding:"34px 40px 60px",display:"grid",gridTemplateColumns:"minmax(0,1fr) 380px",gap:28,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{display:"grid",gap:20,minWidth:0},children:[(0,f.jsxs)("section",{style:ng,children:[(0,f.jsx)("div",{style:tg,children:"Step 1 \xb7 Your details"}),(0,f.jsx)("h2",{style:{margin:"7px 0 18px",fontFamily:Yu,fontWeight:800,fontSize:22,letterSpacing:"-0.01em",color:Wu},children:"Who is this order for?"}),(0,f.jsxs)("div",{className:"sp-fields",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:sg,children:"Your name"}),(0,f.jsx)("input",{style:ag,value:o,onChange:e=>l(e.target.value),autoComplete:"name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:sg,children:"Student's name"}),(0,f.jsx)("input",{style:ag,value:c,onChange:e=>d(e.target.value)})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:sg,children:"Year level / class"}),(0,f.jsx)("input",{style:ag,value:p,onChange:e=>x(e.target.value),placeholder:"e.g. Year 4 Blue"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:sg,children:"Mobile"}),(0,f.jsx)("input",{style:ag,value:u,onChange:e=>g(e.target.value),inputMode:"tel",autoComplete:"tel"})]}),(0,f.jsxs)("div",{style:{gridColumn:"1 / -1"},children:[(0,f.jsx)("label",{style:sg,children:"Email address"}),(0,f.jsx)("input",{style:ag,value:b,onChange:e=>y(e.target.value),inputMode:"email",autoComplete:"email"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:Uu,marginTop:7},children:"Your receipt and your download link both go to this address \u2014 please double-check it."})]})]})]}),(0,f.jsxs)("section",{style:ng,children:[(0,f.jsx)("div",{style:tg,children:"Step 2 \xb7 Performance"}),(0,f.jsx)("h2",{style:{margin:"7px 0 10px",fontFamily:Yu,fontWeight:800,fontSize:22,letterSpacing:"-0.01em",color:Wu},children:"Which performance would you like?"}),(0,f.jsx)("p",{style:{margin:"0 0 16px",fontSize:14.5,lineHeight:1.6,color:Lu},children:"Each performance is filmed and edited separately \u2014 choose the one your family attended."}),(0,f.jsx)("div",{style:{display:"grid",gap:10},children:t.dates.map(e=>{const t=e.id===v;return(0,f.jsxs)("button",{type:"button",onClick:()=>j(e.id),style:{display:"flex",alignItems:"center",gap:14,textAlign:"left",width:"100%",background:t?Pu:"#fff",border:"1.5px solid ".concat(t?_u:Iu),borderRadius:10,padding:"16px 18px",minHeight:48,cursor:"pointer",boxShadow:t?"0 2px 10px rgba(191,33,47,.09)":"none",transition:"all .2s ".concat(Zu),fontFamily:Ju},children:[(0,f.jsx)("span",{style:{width:20,height:20,borderRadius:"50%",border:"2px s
1olid ".concat(t?_u:Gu),display:"grid",placeItems:"center",flexShrink:0},children:t&&(0,f.jsx)("span",{style:{width:10,height:10,borderRadius:"50%",background:_u}})}),(0,f.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("span",{style:{display:"block",fontFamily:Yu,fontWeight:700,fontSize:16.5,color:Wu},children:Xu(e.date)}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{display:"block",fontSize:11.5,color:Uu,marginTop:3}),children:e.label||"Evening performance"})]}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:14,fontWeight:700,color:Wu}),children:Qu(R.total_amount)})]},e.id)})})]}),(0,f.jsxs)("section",{style:ng,children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:tg,children:"Step 3 \xb7 Payment"}),(0,f.jsx)("h2",{style:{margin:"7px 0 0",fontFamily:Yu,fontWeight:800,fontSize:22,letterSpacing:"-0.01em",color:Wu},children:"Card details"})]}),(0,f.jsxs)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{display:"inline-flex",alignItems:"center",gap:6,background:Du,border:"1px solid ".concat(Iu),borderRadius:20,padding:"5px 11px",fontSize:10,letterSpacing:"0.1em",color:Lu,textTransform:"uppercase"}),children:[(0,f.jsx)(ht.A,{size:11})," Secured by Stripe"]})]}),(0,f.jsx)("div",{style:{marginTop:18},children:(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,background:Pu,border:"1px solid ".concat(Iu),borderRadius:10,padding:"13px 14px"},children:[(0,f.jsx)(Dc.A,{size:17,color:Mu,style:{flexShrink:0}}),(0,f.jsx)("div",{style:{flex:1,minWidth:0},children:i?(0,f.jsx)(Bc.hA,{options:rg}):(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,color:Uu,fontSize:14},children:[(0,f.jsx)(Kr.A,{size:14,className:"sp-spin"})," Loading secure payment\u2026"]})}),(0,f.jsx)("div",{style:{display:"flex",gap:4,flexShrink:0},children:["#1A1F71","#EB001B","#016FD0"].map(e=>(0,f.jsx)("span",{style:{width:26,height:17,borderRadius:3,background:e,display:"block"}},e))})]})}),(0,f.jsxs)("button",{type:"button",onClick:()=>k(!0),className:"sp-terms-gate",style:{display:"flex",alignItems:"center",gap:14,width:"100%",textAlign:"left",marginTop:16,borderRadius:10,padding:"16px 18px",minHeight:48,cursor:"pointer",fontFamily:Ju,transition:"all .2s ".concat(Zu),background:w?Pu:_u,border:"1.5px solid ".concat(w?Vu:_u),boxShadow:w?"none":"0 4px 16px rgba(191,33,47,.24)"},children:[(0,f.jsx)("span",{style:{width:30,height:30,borderRadius:8,flexShrink:0,display:"grid",placeItems:"center",background:w?"#DCFCE7":"rgba(255,255,255,.16)",color:w?Vu:"#fff"},children:w?(0,f.jsx)(zt.A,{size:15}):(0,f.jsx)(kt.A,{size:15})}),(0,f.jsxs)("span",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("span",{style:{display:"block",fontFamily:Yu,fontWeight:700,fontSize:15,color:w?Vu:"#fff"},children:w?"Terms of purchase accepted":"Review terms of purchase"}),(0,f.jsx)("span",{style:{display:"block",fontSize:13,marginTop:2,color:w?Lu:"rgba(255,255,255,.8)"},children:w?"Accepted ".concat(S," \u2014 tap to read them again."):"Required before payment. What we can and can't promise, delivery, refunds and private family use."})]}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10.5,flexShrink:0,color:w?Vu:"#fff",textTransform:"uppercase",letterSpacing:"0.06em"}),children:w?"Accepted":"Read & accept \u2192"})]}),E&&(0,f.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"flex-start",background:"#FEF2F2",border:"1px solid #FECACA",borderRadius:10,padding:"12px 14px",marginTop:14},children:[(0,f.jsx)(h.A,{size:16,color:"#B91C1C",style:{flexShrink:0,marginTop:1}}),(0,f.jsx)("span",{style:{fontSize:13.5,lineHeight:1.55,color:"#B91C1C"},children:E})]})]})]}),(0,f.jsxs)("div",{className:"sp-summary",style:{position:"sticky",top:24},children:[(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid ".concat(Iu),borderRadius:12,overflow:"hidden"},children:[(0,f.jsxs)("div",{style:{background:Tu,padding:"16px 22px",display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10.5,letterSpacing:"0.14em",color:Cu,textTransform:"uppercase"}),children:"Your order"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10.5,letterSpacing:"0.14em",color:"#fff",textTransform:"uppercase"}),children:"1 copy"})]}),(0,f.jsxs)("div",{style:{padding:22},children:[(0,f.jsx)("div",{style:{fontFamily:Yu,fontWeight:800,fontSize:17,color:Wu},children:t.event_name}),(0,f.jsx)("div",{style:{fontSize:13.5,color:Lu,marginTop:3},children:t.school_name}),(0,f.jsx)("div",{style:{marginTop:16},children:[["Performance",(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:13,fontWeight:700,color:q?_u:qu}),children:q?eg(q.date):"NOT SELECTED"})],["Student",(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600,color:c.trim()?Wu:qu},children:c.trim()||"\u2014"})],["Format",(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600,color:Wu},children:"Digital download"})]].map((e,t)=>{let[s,a]=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12,padding:"9px 0",borderTop:0===t?"none":"1px solid ".concat(Ru)},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10,letterSpacing:"0.12em",color:Mu,textTransform:"uppercase"}),children:s}),a]},s)})}),(0,f.jsx)("div",{style:{borderTop:"1px solid ".concat(Ru),marginTop:6,paddingTop:13},children:[["Video copy (ex GST)",R.amount_ex_gst],["GST (10%)",R.gst_amount]].map(e=>{let[t,s]=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5,color:Lu,marginBottom:8},children:[(0,f.jsx)("span",{children:t}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontWeight:700,color:Wu}),children:Qu(s)})]},t)})}),(0,f.jsxs)("div",{style:{borderTop:"2px solid ".concat(Wu),marginTop:6,paddingTop:13,dis
1play:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[(0,f.jsx)("span",{style:{fontFamily:Yu,fontWeight:800,fontSize:15,color:Wu},children:"Total inc GST"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:26,fontWeight:700,letterSpacing:"-0.03em",color:Wu}),children:Qu(R.total_amount)})]}),(0,f.jsx)("button",{type:"button",onClick:async()=>{if(O&&!C){F(!0),T(null);try{if(!D.current){const e=await fetch("".concat(I.fn,"/api/school/").concat(s,"/purchase"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({purchaser_name:o.trim(),student_name:c.trim(),student_class:p.trim(),email:b.trim(),mobile:u.trim(),date_id:v,terms_accepted:w})}),t=await e.json();if(!e.ok)throw new Error(t.detail||"Could not start the payment");D.current={ref:t.ref,clientSecret:t.client_secret}}const{ref:t,clientSecret:a}=D.current,i=await n.confirmCardPayment(a,{payment_method:{card:r.getElement(Bc.hA),billing_details:{name:o.trim(),email:b.trim()}}});if(i.error)return T(i.error.message),void F(!1);try{const e=await fetch("".concat(I.fn,"/api/school/").concat(s,"/confirm"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ref:t})}),a=await e.json();if(!e.ok)throw new Error(a.detail||"confirm failed");B(a)}catch(e){const s=await L(t);s?B(s):T("Your card was charged but we couldn't finish confirming the order. Don't pay again \u2014 email [email protected] quoting ".concat(t," and we'll sort it out."))}}catch(t){T(t.message)}F(!1)}},disabled:!O||C,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:9,width:"100%",marginTop:16,border:"none",borderRadius:10,padding:17,minHeight:52,fontFamily:Ju,fontSize:16,fontWeight:700,color:"#fff",background:O?_u:Gu,cursor:O&&!C?"pointer":"not-allowed",transition:"background .15s ".concat(Zu)},children:C?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kr.A,{size:16,className:"sp-spin"})," Processing\u2026"]}):O?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ht.A,{size:16})," Pay ",Qu(R.total_amount)]}):"Complete the form to pay"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10,letterSpacing:"0.1em",color:Mu,textTransform:"uppercase",textAlign:"center",marginTop:10}),children:M})]})]}),(0,f.jsxs)("div",{style:{background:Tu,borderRadius:12,padding:"20px 22px",marginTop:16},children:[(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10,letterSpacing:"0.16em",color:Mu,textTransform:"uppercase"}),children:"Need a hand?"}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,marginTop:12},children:[(0,f.jsx)(Nt.A,{size:15,color:Cu,style:{flexShrink:0,marginTop:2}}),(0,f.jsxs)("p",{style:{margin:0,fontSize:13,lineHeight:1.6,color:"#B4B4BB"},children:["Your video is delivered as a ",(0,f.jsxs)("strong",{style:{color:"#fff"},children:["tokenised digital download link within ",$u]})," of the final performance. Nothing is posted \u2014 keep an eye on your inbox."]})]}),(0,f.jsx)("p",{style:{margin:"12px 0 0",fontSize:13,lineHeight:1.6,color:"#B4B4BB"},children:"Wrong performance date, or didn't get your link? Email us and we'll sort it out."}),(0,f.jsxs)("div",{style:{marginTop:12},children:[(0,f.jsx)("a",{href:"mailto:[email protected]",style:{color:"#fff",fontSize:13.5,fontWeight:600,textDecoration:"none"},children:"[email protected]"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:12.5,color:Mu,marginTop:3}),children:"1300 207 446"})]})]})]})]}),A&&(0,f.jsx)(ig,{onClose:()=>k(!1),onAccept:()=>{N(!0),_("just now"),k(!1)}}),z&&(0,f.jsx)(og,{summary:z,email:b.trim(),onDone:()=>{B(null),l(""),d(""),x(""),g(""),y(""),j(1===t.dates.length?t.dates[0].id:""),N(!1),D.current=null,window.scrollTo(0,0)}}),(0,f.jsx)("footer",{style:{background:Tu,padding:"34px 40px 40px"},children:(0,f.jsxs)("div",{style:{maxWidth:1120,margin:"0 auto",display:"flex",justifyContent:"space-between",alignItems:"center",gap:14,flexWrap:"wrap"},children:[(0,f.jsxs)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10,letterSpacing:"0.18em",color:"#55555A",textTransform:"uppercase"}),children:["\xa9 ",(new Date).getFullYear()," Turbo Productions \xb7 Turbo 360"]}),(0,f.jsxs)("div",{style:{display:"flex",gap:20},children:[(0,f.jsx)("button",{type:"button",onClick:()=>k(!0),style:{background:"none",border:"none",padding:0,fontFamily:Ju,fontSize:13,color:Mu,cursor:"pointer"},children:"Terms of purchase"}),(0,f.jsx)("a",{href:"https://turbo.net.au/privacy",target:"_blank",rel:"noreferrer",style:{fontSize:13,color:Mu,textDecoration:"none"},children:"Privacy"})]})]})})]})}function cg(){const{slug:e}=(0,r.g)(),[t,n]=(0,a.useState)(null),[i,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null),[p,x]=(0,a.useState)(null);(0,a.useEffect)(()=>{let t=!1;return(async()=>{try{const a=await fetch("".concat(I.fn,"/api/school/").concat(e));if(404===a.status)return void(t||o(!0));const r=await a.json();if(!a.ok)throw new Error(r.detail||"Could not load this page");if(t)return;if(n(r.production),r.stripe_publishable_key){const{loadStripe:e}=await Promise.resolve().then(s.bind(s,69677));if(t)return;x(e(r.stripe_publishable_key))}}catch(a){t||c(a.message)}})(),()=>{t=!0}},[e]);const h=e=>(0,f.jsxs)("div",{style:{minHeight:"100vh",background:Du,fontFamily:Ju,color:Wu,display:"flex",flexDirection:"column"},children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:t?"".concat(t.event_name," | Turbo 360"):"School Production Video | Turbo 360"}),(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,f.jsx)("style",{children:"\n .sp-spin { animation: sp-portal-spin 1s linear infinite; }\n @keyframes sp-portal-spin { to { transform: rotate(360deg); } }\n .sp-done:hover { background: #26262B !important; }\n .sp-terms-link:hover { background: #F1EFE9; color: ".concat(_u,"; }\n @media (max-width: 900px) {\n .sp-body { grid-template-columns: minmax(0,1fr) !important; padding: 26px 20px 48px !important; }\n .sp-summary { position: static !important; }\n .sp-fields { grid-template-columns: 1fr !important; }\n .sp-hero { padding: 40px 20px 36px !important; }\n .sp-nav { padding: 0 20px !important; }\n .sp-nav-right { display: none !important; }\n .sp-footer { padding: 30px 20px 34px !important; }\n }\n @media (max-width: 900px) { .sp-hero-h1 { font-size: 30px !important; } }\n @media (max-width: 860px) {\n .sp-terms-overlay { padding: 0 !important; }\n .sp-terms-panel { border-radius: 0 !important; height: 100% !important; max-height: 100% !important; }\n .sp-terms-rail { display: none !important; }\n .sp-terms-body { grid-template-columns: minmax(0,1fr) !important; }\n .sp-terms-head { padding: 20px !important; }\n .sp-terms-content { padding: 20px !important; }\n .sp-terms-foot { padding: 14px 20px !important; }\n .sp-terms-actions { width: 100%; margin-left: 0 !important; }\n .sp-terms-actions button { flex: 1; }\n }\n ")}),(0,f.jsxs)("div",{style:{display:"flex",height:4},children:[(0,f.jsx)("span",{style:{flex:2,background:_u}}),(0,f.jsx)("span",{style:{flex:1,background:Fu}}),(0,f.jsx)("span",{style:{flex:1,background:Eu}})]}),(0,f.jsx)("div",{style:{background:Tu},children:(0,f.jsxs)("div",{className:"sp-nav",style:{maxWidth:1120,margin:"0 auto",height:72,padding:"0 40px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,f.jsx)("img",{src:"/email/turbo-logo-white.png",alt:"Turbo 360",style:{height:26,display:"block"}}),(0,f.jsxs)("div",{className:"sp-nav-right",style:{display:"flex",alignItems:"center",gap:18},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:10.5,letterSpacing:"0.14em",color:Mu,textTransform:"uppercase"}),children:"Every angle. Full speed."}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{fontSize:12.5,color:"#fff"}),children:"1300 207 446"})]})]})}),(0,f.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:e})]});return h(i||l?(0,f.jsxs)("div",{style:{maxWidth:560,margin:"0 auto",padding:"80px 24px",textAlign:"center"},children:[(0,f.jsx)("h1",{style:{fontFamily:Yu,fontStretch:"110%",fontWeight:800,fontSize:28,margin:0,color:Wu},children:i?"This page isn't available":"Something went wrong"}),(0,f.jsx)("p",{style:{fontSize:15,lineHeight:1.65,color:Lu,marginTop:14},children:i?"The production you're looking for isn't taking orders right now. Double-check the link from your school, or get in touch and we'll point you the right way.":l}),(0,f.jsxs)("p",{style:{fontSize:14.5,marginTop:18},children:[(0,f.jsx)("a",{href:"mailto:[email protected]",style:{color:_u,fontWeight:700,textDecoration:"none"},children:"[email protected]"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Ku),{},{color:Mu,marginLeft:14,fontSize:13}),children:"1300 207 446"})]})]}):t?(0,f.jsx)(Bc.S8,{stripe:p,options:{fonts:[{cssSrc:"https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600&display=swap"}]},children:(0,f.jsx)(lg,{production:t,slug:e})}):(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:10,padding:"90px 24px",color:Lu,fontSize:14.5},children:[(0,f.jsx)(Kr.A,{size:17,className:"sp-spin",color:_u})," Loading\u2026"]}))}function dg(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)(""),[n,i]=(0,a.useState)(""),[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null);return(0,f.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-gray-900 via-red-900 to-black flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl w-full max-w-md p-8",children:[(0,f.jsx)("h1",{className:"text-2xl font-bold text-gray-900 text-center mb-1",children:"AGHA Staff"}),(0,f.jsx)("p",{className:"text-center text-gray-500 text-sm mb-6",children:"View-only access to Gift Fair bookings"}),c&&(0,f.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3 text-red-700 text-sm mb-4 flex items-center",children:[(0,f.jsx)(h.A,{className:"h-4 w-4 mr-2"}),c]}),(0,f.jsxs)("form",{onSubmit:async s=>{s.preventDefault(),d(null),l(!0);try{const s=await fetch("".concat(I.fn,"/api/agha/staff-login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:n})}),a=await s.json();s.ok&&a.success?(localStorage.setItem("agha_staff_auth",JSON.stringify({token:a.token,email:a.email,expires:new Date(Date.now()+432e5).toISOString()})),e("/agha-staff")):d(a.detail||"Login failed")}catch(a){d("Connection error. Please try again.")}finally{l(!1)}},className:"space-y-4",children:[(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(T.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"email",value:t,onChange:e=>s(e.target.value),placeholder:"Email",className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg bg-white text-gray-900 placeholder-gray-400 focus:ring-2 focus:ring-red-500",required:!0})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(ht.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"password",value:n,onChange:e=>i(e.target.value),placeholder:"Password",className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg bg-white text-gray-900 placeholder-gray-400 focus:ring-2 focus:ring-red-500",required:!0})]}),(0,f.jsx)("button",{type:"submit",disabled:o,className:"w-full py-3 bg-[#BF212F] text-white rounded-lg font-semibold flex items-center justify-center disabled:opacity-50",children:o?(0,f.jsx)(Kr.A,{className:"h-5 w-5 animate-spin"}):"Sign In"})]})]})})}const mg=e=>new Date(e+"T00:00:00").toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric"});function pg(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),[o,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(""),[m,h]=(0,a.useState)(""),u=async()=>{const t=(()=>{try{const e=localStorage.getItem("agha_staff_auth");if(!e)return null;const t=JSON.parse(e);return t.expires&&new Date(t.expires)<new Date?(localStorage.removeItem("agha_staff_auth"),null):t.token}catch(e){return null}})();if(t){i(!0),l(null);try{let a="".concat(I.fn,"/api/agha/bookings?");m&&(a+="date=".concat(m,"&")),c&&(a+="search=".concat(encodeURIComponent(c),"&"));const n=await fetch(a,{headers:{Authorization:"Bearer ".concat(t)}});if(401===n.status)return localStorage.removeItem("agha_staff_auth"),void e("/agha-staff/login");const r=await n.json();r.success?s(r.bookings):l("Failed to load bookings")}catch(a){l("Failed to connect to server")}finally{i(!1)}}else e("/agha-staff/login")};(0,a.useEffect)(()=>{u()},[m]);const g=t.filter(e=>"active"===e.status);return(0,f.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,f.jsx)("div",{className:"bg-white border-b border-gray-200",children:(0,f.jsxs)("div",{className:"max-w-6xl mx-auto px-4 py-4 flex items-center justify-between",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h1",{className:"text-xl font-bold text-gray-900",children:"AGHA Gift Fair \u2014 Bookings"}),(0,f.jsx)("p",{className:"text-xs text-gray-500",children:"View only"})]}),(0,f.jsxs)("button",{onClick:()=>{localStorage.removeItem("agha_staff_auth"),e("/agha-staff/login")},className:"text-sm text-gray-600 flex items-center gap-1 hover:text-gray-900",children:[(0,f.jsx)(is.A,{className:"h-4 w-4"}),"Sign out"]})]})}),(0,f.jsxs)("div",{className:"max-w-6xl mx-auto px-4 py-6",children:[(0,f.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3 mb-5",children:[(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow p-4",children:[(0,f.jsx)("div",{className:"text-2xl font-bold text-gray-900",children:g.length}),(0,f.jsx)("div",{className:"text-xs text-gray-500",children:"Active Bookings"})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow p-4",children:[(0,f.jsx)("div",{className:"text-2xl font-bold text-gray-900",children:t.length}),(0,f.jsx)("div",{className:"text-xs text-gray-500",children:"Total Records"})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow p-4",children:[(0,f.jsx)("div",{className:"text-2xl font-bold text-gray-900",children:[...new Set(g.map(e=>e.date))].length}),(0,f.jsx)("div",{className:"text-xs text-gray-500",children:"Days With Bookings"})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow p-4 mb-4 flex flex-col sm:flex-row gap-3 sm:items-center",children:[(0,f.jsxs)("form",{onSubmit:e=>{e.preventDefault(),u()},className:"relative flex-1",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,f.jsx)("input",{value:c,onChange:e=>d(e.target.value),placeholder:"Search business, name, email, booth...",className:"w-full pl-9 pr-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-900 bg-white"})]}),(0,f.jsxs)("select",{value:m,onChange:e=>h(e.target.value),className:"px-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-900 bg-white",children:[(0,f.jsx)("option",{value:"",children:"All dates"}),[...new Set(t.map(e=>e.date))].sort().map(e=>(0,f.jsx)("option",{value:e,children:mg(e)},e))]}),(0,f.jsxs)("button",{onClick:u,className:"px-3 py-2 border border-gray-300 rounded-lg text-sm flex items-center gap-1",children:[(0,f.jsx)(As.A,{className:"h-4 w-4"}),"Refresh"]}),(0,f.jsxs)("button",{onClick:()=>{const e=[["Date","Time","Business","Name","Email","Booth","Services","Status"],...t.map(e=>[e.date,e.timeSlot,e.businessName,"".concat(e.firstName," ").concat(e.lastName),e.email,e.boothNumber,(e.services||[]).join("; "),e.status])].map(e=>e.map(e=>'"'.concat(String(null!==e&&void 0!==e?e:"").replace(/"/g,'""'),'"')).join(",")).join("\n"),s=document.createElement("a");s.href=URL.createObjectURL(new Blob([e],{type:"text/csv"})),s.download="agha-bookings-".concat((new Date).toISOString().slice(0,10),".csv"),s.click()},className:"px-3 py-2 bg-gray-800 text-white rounded-lg text-sm flex items-center gap-1",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),"CSV"]})]}),o&&(0,f.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3 text-red-700 text-sm mb-4",children:o}),n?(0,f.jsx)("div",{className:"text-center py-16",children:(0,f.jsx)(Kr.A,{className:"h-8 w-8 animate-spin text-[#BF212F] mx-auto"})}):0===t.length?(0,f.jsx)("div",{className:"text-center py-16 text-gray-500
1",children:"No bookings yet."}):(0,f.jsx)("div",{className:"bg-white rounded-xl shadow overflow-x-auto",children:(0,f.jsxs)("table",{className:"w-full text-sm text-gray-800",children:[(0,f.jsx)("thead",{className:"bg-gray-50 text-gray-600 text-left",children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{className:"px-4 py-3",children:"Date / Time"}),(0,f.jsx)("th",{className:"px-4 py-3",children:"Business"}),(0,f.jsx)("th",{className:"px-4 py-3",children:"Contact"}),(0,f.jsx)("th",{className:"px-4 py-3",children:"Booth"}),(0,f.jsx)("th",{className:"px-4 py-3",children:"Services"}),(0,f.jsx)("th",{className:"px-4 py-3",children:"Payment"}),(0,f.jsx)("th",{className:"px-4 py-3",children:"Status"})]})}),(0,f.jsx)("tbody",{className:"divide-y divide-gray-100",children:t.map(e=>(0,f.jsxs)("tr",{className:"cancelled"===e.status?"opacity-50":"",children:[(0,f.jsxs)("td",{className:"px-4 py-3 whitespace-nowrap",children:[(0,f.jsx)("div",{className:"font-medium text-gray-900",children:mg(e.date)}),(0,f.jsx)("div",{className:"text-gray-500",children:e.timeSlot})]}),(0,f.jsx)("td",{className:"px-4 py-3 font-medium text-gray-900",children:e.businessName}),(0,f.jsxs)("td",{className:"px-4 py-3",children:[(0,f.jsxs)("div",{children:[e.firstName," ",e.lastName]}),(0,f.jsx)("div",{className:"text-gray-500 text-xs",children:e.email})]}),(0,f.jsx)("td",{className:"px-4 py-3",children:e.boothNumber}),(0,f.jsx)("td",{className:"px-4 py-3 text-xs text-gray-600 max-w-[200px]",children:(e.services||[]).join(", ")}),(0,f.jsx)("td",{className:"px-4 py-3",children:(0,f.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ".concat("paid"===e.payment_status?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-700"),children:["stripe"===e.payment_method?(0,f.jsx)(Dc.A,{className:"h-3 w-3"}):(0,f.jsx)(kt.A,{className:"h-3 w-3"}),"paid"===e.payment_status?"Paid":"invoice_requested"===e.payment_status?"Invoice":e.payment_status||"\u2014"]})}),(0,f.jsx)("td",{className:"px-4 py-3",children:"active"===e.status?(0,f.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-green-700",children:[(0,f.jsx)(p.A,{className:"h-3 w-3"}),"Active"]}):(0,f.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",children:[(0,f.jsx)(x.A,{className:"h-3 w-3"}),"Cancelled"]})})]},e.id))})]})})]})]})}const xg="'Space Mono',monospace",hg={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},ug="1.8fr 130px 120px 90px 100px 80px",gg=["indigo","amber","muted","blue","teal","green","danger"],fg=function(){return gg[((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").charCodeAt(0)||0)%gg.length]},bg=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)(null),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,p]=(0,a.useState)("all");(0,a.useEffect)(()=>{const t=(0,o.cd)(e);t&&(s(t),x())},[e]);const x=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/services"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();i(e.services||[])}}catch(t){console.error("Error loading services:",t)}finally{c(!1)}},h=["all",...new Set(n.map(e=>e.category))],u="all"===d?n:n.filter(e=>e.category===d);return t?(0,f.jsxs)(ta,{title:"Services",meta:"SALES \xb7 SERVICES",action:{label:"Add Service",to:"/admin/services/create"},children:[(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:18,flexWrap:"wrap"},children:h.map(e=>{const t=d===e;return(0,f.jsx)("button",{onClick:()=>p(e),style:{fontSize:12,fontWeight:600,fontFamily:"'Hanken Grotesk',sans-serif",borderRadius:8,padding:"7px 14px",cursor:"pointer",whiteSpace:"nowrap",background:t?"#BF212F":"#fff",color:t?"#fff":"#55555C",border:"1px solid ".concat(t?"#BF212F":"#
1E4E4E9"),textTransform:"capitalize"},children:"all"===e?"All":e},e)})}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},hg),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:ug,gap:12,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:xg,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Service"}),(0,f.jsx)("span",{children:"Category"}),(0,f.jsx)("span",{children:"Price"}),(0,f.jsx)("span",{children:"Type"}),(0,f.jsx)("span",{style:{textAlign:"center"},children:"Status"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Actions"})]}),l?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:6})}):0===u.length?(0,f.jsx)(Os,{icon:as.A,title:"No services found",message:"all"!==d?"No services in this category.":"Create your first service template for proposals.",actionLabel:"Create First Service",onAction:()=>e("/admin/services/create")}):u.map(t=>{return(0,f.jsxs)("div",{className:"tg-row",style:{display:"grid",gridTemplateColumns:ug,gap:12,alignItems:"center",padding:"14px 22px",borderBottom:"1px solid #F2F2F5",background:"#fff"},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600},children:t.name}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.description})]}),(0,f.jsx)("span",{style:{justifySelf:"start"},children:(0,f.jsx)(Ds,{tone:fg(t.category),children:t.category})}),(0,f.jsxs)("span",{style:{fontFamily:xg,fontSize:13,fontWeight:700},children:[(s=t.price,new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(s)),"hourly"===t.pricing_type&&(0,f.jsx)("span",{style:{fontSize:10,color:"#9A9AA0"},children:"/hr"})]}),(0,f.jsx)("span",{style:{justifySelf:"start"},children:(0,f.jsx)(Ds,{tone:"fixed"===t.pricing_type?"green":"indigo",children:"fixed"===t.pricing_type?"Fixed":"Hourly"})}),(0,f.jsx)("span",{style:{display:"flex",justifyContent:"center"},children:(0,f.jsx)("button",{onClick:()=>(async(e,t)=>{try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token;(await fetch("".concat(I.fn,"/api/services/").concat(e),{method:"PUT",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify({enabled:!t})})).ok?x():alert("Failed to update service status")}catch(a){console.error("Error toggling service:",a),alert("An error occurred")}})(t.id,t.enabled),style:{fontFamily:xg,fontSize:10,fontWeight:700,letterSpacing:"0.02em",textTransform:"uppercase",borderRadius:6,padding:"4px 9px",cursor:"pointer",border:"none",whiteSpace:"nowrap",background:t.enabled?"#DCFCE7":"#EDEDF0",color:t.enabled?"#15803D":"#55555C"},children:t.enabled?"Enabled":"Disabled"})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8},children:[(0,f.jsx)("button",{onClick:()=>e("/admin/services/edit/".concat(t.id)),title:"Edit",style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex",padding:4},children:(0,f.jsx)(Tn.A,{size:15})}),(0,f.jsx)("button",{onClick:()=>(async(e,t)=>{if(confirm('Delete "'.concat(t,'"? This action cannot be undone.')))try{var s;const t=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token;(await fetch("".concat(I.fn,"/api/services/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}})).ok?(alert("Service deleted successfully"),x()):alert("Failed to delete service")}catch(a){console.error("Error deleting service:",a),alert("An error occurred")}})(t.id,t.name),title:"Delete",style:{background:"none",border:"none",color:"#B5B5BC",cursor:"pointer",display:"flex",padding:4},children:(0,f.jsx)(la.A,{size:15})})]})]},t.id);var s}),!l&&u.length>0&&(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 22px",borderTop:"1px solid #EDEDF0"},children:(0,f.jsxs)("span",{style:{fontFamily:xg,fontSize:11.5,color:"#9A9AA0"},children:["SHOWING ",u.length," OF ",n.length," SERVICES"]})})]})]}):null},yg={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL||"",vg={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},jg={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},wg=()=>{const e=(0,r.Zp)(),{serviceId:t}=(0,r.g)(),s=!!t,[n,i]=(0,a.useState)(null),[l,c]=(0,a.useState)(s),[d,p]=(0,a.useState)(!1),[x,h]=(0,a.useState)({name:"",description:"",category:"",pricing_type:"fixed",price:"",enabled:!0});(0,a.useEffect)(()=>{const t=(0,o.cd)(e);t&&(i(t),s&&u())},[e,t]);const u=async()=>{try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,n=await fetch("".concat(yg,"/api/services/").concat(t),{headers:{Authorization:"Bearer ".concat(a)}});if(n.ok){const e=await n.json();h({name:e.service.name,description:e.service.description,category:e.service.category,pricing_type:e.service.pricing_type,price:e.service.price.toString(),enabled:e.service.enabled})}else alert("Service not found"),e("/admin/services")}catch(a){console.error("Error loading service:",a),alert("Failed to load service"),e("/admin/services")}finally{c(!1)}},g=async a=>{if(a.preventDefault(),x.name&&x.description&&x.category&&x.price)if(isNaN(parseFloat(x.price))||parseFloat(x.price)<=0)alert("Please enter a valid price");else{p(!0);try{var n;const a=null===(n=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===n?void 0:n.token,r={
1name:x.name,description:x.description,category:x.category,pricing_type:x.pricing_type,price:parseFloat(x.price),enabled:x.enabled},i=s?"".concat(yg,"/api/services/").concat(t):"".concat(yg,"/api/services"),o=await fetch(i,{method:s?"PUT":"POST",headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"},body:JSON.stringify(r)});if(o.ok)alert("Service ".concat(s?"updated":"created"," successfully!")),e("/admin/services");else{const e=await o.json();alert(e.detail||"Failed to ".concat(s?"update":"create"," service"))}}catch(r){console.error("Error saving service:",r),alert("An error occurred")}finally{p(!1)}}else alert("Please fill in all required fields")},b={display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",opacity:d?.6:1};return n?(0,f.jsxs)(ta,{title:s?"Edit Service":"New Service",meta:"SALES \xb7 SERVICE",children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>e("/admin/services"),style:{display:"inline-flex",alignItems:"center",gap:7,fontSize:13,fontWeight:600,color:"#55555C",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{size:15})," Services"]}),(0,f.jsx)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:s?"Edit Service":"New Service"}),(0,f.jsx)("div",{style:{marginLeft:"auto"},children:(0,f.jsxs)("button",{type:"submit",form:"service-form",className:"tg-btn-primary",onClick:g,disabled:d,style:b,children:[(0,f.jsx)(ia.A,{size:15})," ",d?"Saving\u2026":"Save service"]})})]}),(0,f.jsx)("div",{style:{maxWidth:640},children:l?(0,f.jsx)(Ls,{style:{padding:22},children:(0,f.jsx)(Ws,{rows:6})}):(0,f.jsx)("form",{id:"service-form",onSubmit:g,children:(0,f.jsxs)(Ls,{style:{padding:22},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15,marginBottom:16},children:"Service details"}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:vg,children:"Name *"}),(0,f.jsx)("input",{type:"text",value:x.name,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{name:e.target.value})),placeholder:"e.g., Photography Full Day",style:jg})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:vg,children:"Description *"}),(0,f.jsx)("textarea",{value:x.description,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{description:e.target.value})),rows:4,placeholder:"Detailed description of the service\u2026",style:(0,m.A)((0,m.A)({},jg),{},{resize:"vertical",minHeight:88})}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",marginTop:6},children:"This will auto-fill in proposals when this service is selected."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:vg,children:"Category *"}),(0,f.jsxs)("select",{value:x.category,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{category:e.target.value})),style:jg,children:[(0,f.jsx)("option",{value:"",children:"Select a category"}),["Photography","Videography","Equipment","Editing","Post-Production","Staff","Other"].map(e=>(0,f.jsx)("option",{value:e,children:e},e))]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:vg,children:"Pricing type"}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:9,fontSize:13.5,color:"#0A0A0B",cursor:"pointer"},children:[(0,f.jsx)("input",{type:"radio",value:"fixed",checked:"fixed"===x.pricing_type,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{pricing_type:e.target.value})),style:{accentColor:"#BF212F"}}),(0,f.jsxs)("span",{children:["Fixed Rate ",(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"\u2014 one-time flat price"})]})]}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:9,fontSize:13.5,color:"#0A0A0B",cursor:"pointer"},children:[(0,f.jsx)("input",{type:"radio",value:"hourly",checked:"hourly"===x.pricing_type,onCh
1ange:e=>h((0,m.A)((0,m.A)({},x),{},{pricing_type:e.target.value})),style:{accentColor:"#BF212F"}}),(0,f.jsxs)("span",{children:["Per Hour Rate ",(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"\u2014 price multiplied by hours"})]})]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:vg,children:"fixed"===x.pricing_type?"Price *":"Price per Hour *"}),(0,f.jsxs)("div",{style:{position:"relative"},children:[(0,f.jsx)("span",{style:{position:"absolute",left:13,top:"50%",transform:"translateY(-50%)",color:"#9A9AA0",fontSize:13.5},children:"$"}),(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",value:x.price,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{price:e.target.value})),placeholder:"0.00",style:(0,m.A)((0,m.A)({},jg),{},{paddingLeft:26})})]}),"hourly"===x.pricing_type&&(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",marginTop:6},children:"When adding to a proposal, you'll enter the number of hours."})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,paddingTop:6,borderTop:"1px solid #EDEDF0"},children:[(0,f.jsx)("input",{type:"checkbox",id:"enabled",checked:x.enabled,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{enabled:e.target.checked})),style:{width:16,height:16,accentColor:"#BF212F",cursor:"pointer"}}),(0,f.jsx)("label",{htmlFor:"enabled",style:{fontSize:13.5,color:"#0A0A0B",cursor:"pointer"},children:"Enabled \u2014 show in proposal autocomplete"})]})]})]})})})]}):null};var Ng=s(87661);const Ag="'Space Mono',monospace",kg={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Sg={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},_g={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},Cg={"Video Production":"indigo",Photography:"amber","Live Streaming":"danger","Post Production":"teal","Website Development":"blue","App Development":"green","Virtual Tour":"muted",Equipment:"muted",Other:"gray"},Fg=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)(null),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,p]=(0,a.useState)(!1),[x,h]=(0,a.useState)(null),[u,b]=(0,a.useState)("all"),[y,v]=(0,a.useState)(null),[j,w]=(0,a.useState)({}),[N,A]=(0,a.useState)(!1),[k,S]=(0,a.useState)({category:"Video Production",name:"",description_template:"",base_price:0,min_price:0,max_price:0,pricing_model:"flat",standard_deliverables:[],common_extras:[]}),[_,C]=(0,a.useState)(""),[F,E]=(0,a.useState)(""),T=["Video Production","Photography","Live Streaming","Post Production","Website Development","App Development","Virtual Tour","Equipment","Other"];(0,a.useEffect)(()=>{const t=(0,o.cd)(e);t&&(s(t),B())},[e]);const z=()=>{var e;return null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token},B=async()=>{try{const e=await fetch("".concat(I.fn,"/api/service-catalog"),{headers:{Authorization:"Bearer ".concat(z())}});if(e.ok){const t=await e.json();i(t.items||[])}}catch(e){console.error("Error loading catalog:",e)}finally{c(!1)}},D=("all"===u?n:n.filter(e=>e.category===u)).reduce((e,t)=>(e[t.category]||(e[t.category]=[]),e[t.category].push(t),e),{}),R={flat:"Flat Rate",per_hour:"Per Hour",per_day:"Per Day"},P=function(e,t,s,a){let{showExtras:n}=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Sg,children:"Category"}),(0,f.jsx)("select",{value:e.category,onChange:s=>t((0,m.A)((0,m.A)({},e),{},{category:s.target.value})),style:(0,m.A)((0,m.A)({},_g),{},{cursor:"pointer"}),children:T.map(e=>(0,f.jsx)("option",{value:e,children:e},e))})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Sg,children:"Name"}),(0,f.jsx)("input",{type:"text",value:e.name,onChange:s=>t((0,m.A)((0,m.A)({},e),{},{name:s.target.value})),style:_g,placeholder:"e.g. Full Day Video Production"})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:Sg,children:"Description Template"}),(0,f.jsx)("textarea",{value:e.description_template||"",onChange:s=>t((0,m.A)((0,m.A)({},e),{},{description_template:s.target.value})),style:(0,m.A)((0,m.A)({},_g),{},{resize:"vertical"}),rows:3})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Sg,children:"Base Price (ex GST)"}),(0,f.jsx)("input",{type:"number",value:e.base_price,onChange:s=>t((0,m.A)((0,m.A)({},e),{},{base_price:parseFloat(s.target.value)||0})),style:_g})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:12},children:[(0,f.jsxs)("div",{style:{flex:1},children:[(0,f.jsx)("label",{style:Sg,children:"Min Price"}),(0,f.jsx)("input",{type:"number",value:e.min_price,onChange:s=>t((0,m.A)((0,m.A)({},e),{},{min_price:parseFloat(s.target.value)||0})),style:_g})]}),(0,f.jsxs)("div",{style:{flex:1},children:[(0,f.jsx)("label",{style:Sg,children:"Max Price"}),(0,f.jsx)("input",{type:"number",value:e.max_price,onChange:s=>t((0,m.A)((0,m.A)({},e),{},{max_price:parseFloat(s.target.value)||0})),style:_g})]})]}),n&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Sg,children:"Pricing Model"}),(0,f.jsxs)("select",{value:e.pricing_model,onChange:s=>t((0,m.A)((0,m.A)({},e),{},{pricing_model:s.target.value})),style:(0,m.A)((0,m.A)({},_g),{},{cursor:"pointer"}),children:[(0,f.jsx)("option",{value:"flat",children:"Flat Rate"}),(0,f.jsx)("option",{value:"per_hour",children:"Per Hour"}),(0,f.jsx)("option",{value:"per_day",children:"Per Day"})]})]}),(0,f.jsx)("div",{style:{display:"flex",alignItems:"flex-end"},children:(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:9,fontSize:13,fontWeight:600,color:"#333",cursor:"pointer",paddingBottom:11},children:[(0,f.jsx)("input",{type:"checkbox",checked:e.enabled,onChange:s=>t((0,m.A)((0,m.A)({},e),{},{enabled:s.target.checked}))}),"Enabled"]})})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:Sg,children:"Deliverables"}),(0,f.jsx)("input",{type:"text",value:s,onChange:e=>a(e.target.value),onKeyDown:n=>{"Enter"===n.key&&s.trim()&&(n.preventDefault(),t((0,m.A)((0,m.A)({},e),{},{standard_deliverables:[...e.standard_deliverables||[],s.trim()]})),a(""))},style:(0,m.A)((0,m.A)({},_g),{},{marginBottom:10}),placeholder:"Type and press Enter"}),(0,f.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:(e.standard_deliverables||[]).map((s,a)=>(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"5px 11px",background:"#EEF2FF",color:"#4338CA",borderRadius:20,fontSize:12.5,fontWeight:500},children:[s,(0,f.jsx)("button",{onClick:()=>t((0,m.A)((0,m.A)({},e),{},{standard_deliverables:e.standard_deliverables.filter((e,t)=>
1t!==a)})),style:{background:"none",border:"none",cursor:"pointer",color:"#4338CA",display:"flex",padding:0},children:(0,f.jsx)(g.A,{size:13})})]},a))})]})]})};return(0,f.jsxs)(ta,{title:"Service Catalog",meta:"SALES \xb7 CATALOG",adminInfo:t,action:{label:"Add Service",onClick:()=>A(!0)},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,marginBottom:18},children:[(0,f.jsxs)("button",{onClick:async()=>{if(window.confirm("This will analyze all existing proposals and populate/update the service catalog. Continue?")){p(!0),h(null);try{const e=await fetch("".concat(I.fn,"/api/service-catalog/mine-proposals"),{method:"POST",headers:{Authorization:"Bearer ".concat(z())}}),t=await e.json();h(t),await B()}catch(e){console.error("Error mining proposals:",e),h({success:!1,message:"Failed to mine proposals"})}finally{p(!1)}}},disabled:d,style:{display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 15px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13,cursor:d?"default":"pointer",opacity:d?.55:1},children:[(0,f.jsx)(Ng.A,{size:15}),d?"Mining\u2026":"Mine from Proposals"]}),(0,f.jsxs)("button",{onClick:()=>A(!0),style:{display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 15px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13,cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:15}),"Add Service"]})]}),x&&(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},kg),{},{marginBottom:18,padding:"14px 18px",borderColor:x.success?"#BBF7D0":"#FECACA",background:x.success?"#F0FDF4":"#FEF2F2"}),children:(0,f.jsxs)("p",{style:{margin:0,fontSize:13.5,fontWeight:500,color:x.success?"#15803D":"#991B1B"},children:[x.message,x.items_created>0&&" - Created: ".concat(x.items_created),x.items_updated>0&&", Updated: ".concat(x.items_updated),x.total_clusters>0&&" (".concat(x.total_clusters," service types found)")]})}),(0,f.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginBottom:20},children:(()=>{const e=e=>({fontSize:12,fontWeight:600,borderRadius:8,padding:"7px 13px",cursor:"pointer",background:e?"#0A0A0B":"#fff",color:e?"#fff":"#55555C",border:"1px solid ".concat(e?"#0A0A0B":"#E4E4E9")});return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("button",{onClick:()=>b("all"),style:e("all"===u),children:["All (",n.length,")"]}),T.map(t=>{const s=n.filter(e=>e.category===t).length;return 0===s?null:(0,f.jsxs)("button",{onClick:()=>b(t),style:e(u===t),children:[t," (",s,")"]},t)})]})})()}),N&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},kg),{},{marginBottom:20,padding:22}),children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:18},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:16},children:"New Service"}),(0,f.jsx)("button",{onClick:()=>A(!1),style:{background:"none",border:"none",cursor:"pointer",color:"#9A9AA0",display:"flex",padding:4},children:(0,f.jsx)(g.A,{size:18})})]}),P(k,S,_,C,{showExtras:!1}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:18},children:[(0,f.jsx)("button",{onClick:()=>A(!1),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"10px 16px",fontSize:13,fontWeight:600,color:"#55555C",cursor:"pointer"},children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{try{(await fetch("".concat(I.fn,"/api/service-catalog"),{method:"POST",headers:{Authorization:"Bearer ".concat(z()),"Content-Type":"application/json"},body:JSON.stringify(k)})).ok&&(A(!1),S({category:"Video Production",name:"",description_template:"",base_price:0,min_price:0,max_price:0,pricing_model:"flat",standard_deliverables:[],common_extras:[]}),await B())}catch(e){console.error("Error creating item:",e)}},disabled:!k.name.trim(),style:{display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 16px",fontSize:13,fontWeight:600,cursor:k.name.trim()?"pointer":"default",opacity:k.name.trim()?1:.55},children:[(0,f.jsx)(ia.A,{size:15})," Create"]})]})]}),l?(0,f.jsx)(Ws,{rows:6}):0===n.length?(0,f.jsx)(Os,{icon:Ns.A,title:"No services in catalog",message:"Mine from existing proposals or add services manually.",actionLabel:"Add Service",onAction:()=>A(!0)}):Object.entries(D).sort((e,t)=>
1{let[s]=e,[a]=t;return s.localeCompare(a)}).map(e=>{let[t,s]=e;return(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},kg),{},{overflow:"hidden",marginBottom:18}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"13px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)(Ds,{tone:Cg[t]||"gray",children:t}),(0,f.jsxs)("span",{style:{fontFamily:Ag,fontSize:11.5,color:"#9A9AA0"},children:[s.length," ",1===s.length?"SERVICE":"SERVICES"]})]}),s.map(e=>{var t,s;const n=j[e.id];return(0,f.jsxs)(a.Fragment,{children:[(0,f.jsxs)("div",{className:"tg-row",style:{display:"flex",alignItems:"center",gap:14,padding:"14px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer",background:n?"#FBFBFC":"#fff"},onClick:()=>{return t=e.id,void w(e=>(0,m.A)((0,m.A)({},e),{},{[t]:!e[t]}));var t},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0",display:"flex",transform:n?"rotate(0deg)":"rotate(-90deg)",transition:"transform .15s"},children:(0,f.jsx)(Et.A,{size:15})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600},children:e.name}),"mined"===e.source&&(0,f.jsx)(Ds,{tone:"amber",children:"Mined"}),!e.enabled&&(0,f.jsx)(Ds,{tone:"gray",children:"Disabled"})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:16,marginTop:4,fontFamily:Ag,fontSize:11.5,color:"#9A9AA0",flexWrap:"wrap"},children:[e.min_price>0&&e.max_price>0&&(0,f.jsxs)("span",{children:["Range $",Number(e.min_price).toLocaleString("en-AU"),"\u2013$",Number(e.max_price).toLocaleString("en-AU")]}),e.price_samples>0&&(0,f.jsxs)("span",{children:["Avg $",Number(e.avg_price||0).toLocaleString("en-AU")," \xb7 ",e.price_samples," samples"]}),(0,f.jsx)("span",{children:R[e.pricing_model]||"Flat Rate"})]})]}),(0,f.jsx)("div",{style:{textAlign:"right",whiteSpace:"nowrap"},children:(0,f.jsx)(zs,{amount:e.base_price,size:17,mutedSize:11})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4},onClick:e=>e.stopPropagation(),children:[(0,f.jsx)("button",{onClick:()=>v((0,m.A)({},e)),title:"Edit",style:{background:"none",border:"none",cursor:"pointer",color:"#55555C",display:"flex",padding:6},children:(0,f.jsx)(Tn.A,{size:15})}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Delete this service catalog item?"))try{await fetch("".concat(I.fn,"/api/service-catalog/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(z())}}),await B()}catch(t){console.error("Error deleting item:",t)}})(e.id),title:"Delete",style:{background:"none",border:"none",cursor:"pointer",color:"#991B1B",display:"flex",padding:6},children:(0,f.jsx)(la.A,{size:15})})]})]}),n&&(0,f.jsxs)("div",{style:{padding:"16px 22px 18px 51px",borderBottom:"1px solid #F2F2F5",background:"#FBFBFC"},children:[e.description_template&&(0,f.jsxs)("div",{style:{marginBottom:14},children:[(0,f.jsx)("div",{style:{fontFamily:Ag,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:5},children:"Description Template"}),(0,f.jsx)("p",{style:{margin:0,fontSize:13,color:"#333",lineHeight:1.5},children:e.description_template})]}),(null===(t=e.standard_deliverables)||void 0===t?void 0:t.length)>0&&(0,f.jsxs)("div",{style:{marginBottom:14},children:[(0,f.jsx)("div",{style:{fontFamily:Ag,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:6},children:"Standard Deliverables"}),(0,f.jsx)("ul",{style:{margin:0,paddingLeft:18,fontSize:13,color:"#333",lineHeight:1.6},children:e.standard_deliverables.map((e,t)=>(0,f.jsx)("li",{children:e},t))})]}),(null===(s=e.common_extras)||void 0===s?void 0:s.length)>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:Ag,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:6},children:"Common Extras"}),(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:e.common_extras.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:13,maxWidth:460},children:[(0,f.jsx)("span",{style:{color:"#333"},children:e.name}),(0,f.jsxs)("span",{style:{fontFamily:Ag,fontSize:12,color:"#55555C"}
1,children:["$",Number(e.price||0).toLocaleString("en-AU"),e.frequency>0&&" \xb7 ".concat(e.frequency,"\xd7")]})]},t))})]})]})]},e.id)})]},t)}),y&&(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(10,10,11,.55)",zIndex:60,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:(0,f.jsxs)("div",{className:"tg-scroll",style:(0,m.A)((0,m.A)({},kg),{},{maxWidth:680,width:"100%",maxHeight:"90vh",overflowY:"auto",padding:24}),children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:18},children:[(0,f.jsxs)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:16},children:["Edit: ",y.name]}),(0,f.jsx)("button",{onClick:()=>v(null),style:{background:"none",border:"none",cursor:"pointer",color:"#9A9AA0",display:"flex",padding:4},children:(0,f.jsx)(g.A,{size:18})})]}),P(y,v,F,E,{showExtras:!0}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:12,marginTop:22},children:[(0,f.jsx)("button",{onClick:()=>v(null),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"10px 16px",fontSize:13,fontWeight:600,color:"#55555C",cursor:"pointer"},children:"Cancel"}),(0,f.jsxs)("button",{onClick:()=>(async e=>{try{(await fetch("".concat(I.fn,"/api/service-catalog/").concat(e),{method:"PUT",headers:{Authorization:"Bearer ".concat(z()),"Content-Type":"application/json"},body:JSON.stringify(y)})).ok&&(v(null),await B())}catch(t){console.error("Error updating item:",t)}})(y.id),style:{display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 16px",fontSize:13,fontWeight:600,cursor:"pointer"},children:[(0,f.jsx)(ia.A,{size:15})," Save Changes"]})]})]})})]})},Eg="'Space Mono',monospace",Tg={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},zg="1.6fr 90px 1.3fr 120px 40px",Bg=["#0A0A0B","#4338CA","#0FA3A3","#BF212F","#7C3AED","#0891B2","#B45309"],Dg=function(){return Bg[((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").charCodeAt(0)||0)%Bg.length]},Ig=e=>{const t=Number(e||0);return t>=1e3?"$".concat((t/1e3).toFixed(1),"k"):"$".concat(t.toLocaleString("en-AU",{maximumFractionDigits:0}))},Rg=e=>{if(!e)return"\u2014";const t=Math.floor((Date.now()-new Date(e))/864e5);return isNaN(t)?"\u2014":t<=0?"today":t<7?"".concat(t,"d"):t<30?"".concat(Math.floor(t/7),"w"):t<365?"".concat(Math.floor(t/30),"mo"):"".concat(Math.floor(t/365),"y")},Pg=e=>({background:"#fff",border:"1px solid #E4E4E9",borderRadius:8,padding:"6px 12px",fontSize:12.5,fontWeight:600,color:e?"#C9C9CE":"#333",cursor:e?"default":"pointer"}),Wg=()=>{const e=(0,r.Zp)(),t=(0,r.zy)(),{toast:s}=N(),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(0),[d,p]=(0,a.useState)(1),[x,h]=(0,a.useState)({total_companies:0,total_contacts:0,companies_with_active_proposals:0,companies_with_unpaid_invoices:0,total_unpaid_amount:0}),[u,g]=(0,a.useState)(""),[b,y]=(0,a.useState)(""),[v,j]=(0,a.useState)("all"),[w,A]=(0,a.useState)("name_asc"),[k,S]=(0,a.useState)(!0),[C,F]=(0,a.useState)({}),[E,T]=(0,a.useState)(null);(0,a.useEffect)(()=>{const e=setTimeout(()=>y(u.trim()),350);return()=>clearTimeout(e)},[u]),(0,a.useEffect)(()=>{p(1)},[b,v,w]),(0,a.useEffect)(()=>{(async()=>{await(0,o.cd)()?B():e("/admin")})()},[e,t.state]),(0,a.useEffect)(()=>{z()},[b,v,w,d,t.state]);const z=async()=>{S(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=new URLSearchParams({page:String(d),page_size:String(25),sort:w,activity:v});b&&s.set("q",b);const a=await fetch("".concat(I.fn,"/api/clients?").concat(s),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){const e=await a.json();i(e.clients||[]),c(e.total_companies||0)}}catch(t){console.error("Error:",t),s.error("Failed to load clients")}finally{S(!1)}},B=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients/stats"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();h(e.stats||{})}}catch(t){console.error("Error loading stats:",t)}},D=n.filter(e=>e.is_company),R=n.filter(e=>!e.is_company),P=Math.max(1,Math.ceil(l/25)),W=[{label:"COMPANIES",value:x.total_companies,color:"#15803D"},{label:"CONTACTS",value:x.total_contacts,color:"#0A0A0B"},{label:"ACTIVE PROPOSALS",value:x.companies_with_active_proposals,color:"#4338CA"},{label:"UNPAID",value:Ig(x.total_unpaid_amount),color:"#991B1B"}];return(0,f.jsxs)(ta,{title:"Clients",meta:"CRM \xb7 ".concat(x.total_companies," COMPANIES"),action:{label:"Add Company",to:"/admin/clients/create"},children:[(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:14,marginBottom:20},children:W.map(e=>(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Tg),{},{padding:"16px 18px"}),children:[(0,f.jsx)("div",{style:{fontFamily:Eg,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:9},children:e.label}),(0,f.jsx)("div",{style:{fontFamily:Eg,fontWeight:700,fontSize:24,letterSpacing:"-0.02em",color:e.color},children:e.value})]},e.label))}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Tg),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 18px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:200},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{value:u,onChange:e=>g(e.target.value),placeholder:"Search companies\u2026",style:{border:"none",background:"transparent",outline:"none",fontSize:13,width:"100%"}})]}
1),(0,f.jsxs)("select",{value:v,onChange:e=>j(e.target.value),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)("option",{value:"all",children:"Activity: All"}),(0,f.jsx)("option",{value:"has_proposals",children:"Has proposals"}),(0,f.jsx)("option",{value:"has_invoices",children:"Has invoices"}),(0,f.jsx)("option",{value:"has_unpaid",children:"Has unpaid"}),(0,f.jsx)("option",{value:"no_activity",children:"No activity"})]}),(0,f.jsxs)("select",{value:w,onChange:e=>A(e.target.value),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)("option",{value:"recent",children:"Sort: Recent"}),(0,f.jsx)("option",{value:"name_asc",children:"Name A\u2013Z"}),(0,f.jsx)("option",{value:"name_desc",children:"Name Z\u2013A"}),(0,f.jsx)("option",{value:"contacts",children:"Most contacts"})]})]}),(0,f.jsxs)("div",{className:"tg-leadrow tg-booking-meta",style:{gridTemplateColumns:zg,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:Eg,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Company"}),(0,f.jsx)("span",{style:{textAlign:"center"},children:"Contacts"}),(0,f.jsx)("span",{children:"Activity"}),(0,f.jsx)("span",{children:"Updated"}),(0,f.jsx)("span",{})]}),k?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:6})}):0===D.length?(0,f.jsx)(Os,{icon:gs.A,title:"No companies found",message:u||"all"!==v?"Adjust your filters.":"Add your first company to get started.",actionLabel:"Add Company",onAction:()=>e("/admin/clients/create")}):D.map(t=>{var n;const r=(i=t.id,R.filter(e=>e.parent_company_id===i));var i;const o=null!==(n=t.contact_count)&&void 0!==n?n:r.length,l=C[t.id],c=(t.proposal_count||0)>0||(t.invoice_count||0)>0||(t.unpaid_amount||0)>0;return(0,f.jsxs)(a.Fragment,{children:[(0,f.jsxs)("div",{className:"tg-leadrow tg-row",style:{gridTemplateColumns:zg,padding:"14px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer",background:l?"#FBFBFC":"#fff"},onClick:()=>e("/admin/clients/company/".concat(t.id)),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11,minWidth:0},children:[(0,f.jsx)("span",{onClick:e=>{e.stopPropagation(),(e=>{F(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!t[e]}))})(t.id)},style:{color:"#9A9AA0",display:"flex",transform:l?"rotate(0deg)":"rotate(-90deg)",transition:"transform .15s"},children:(0,f.jsx)(Et.A,{size:14})}),(0,f.jsx)("span",{className:"tg-ui",style:{width:32,height:32,borderRadius:8,background:Dg(t.company_name),color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:11,flexShrink:0},children:Ms(t.company_name)}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.company_name}),t.abn&&(0,f.jsxs)("div",{style:{fontFamily:Eg,fontSize:11,color:"#9A9AA0"},children:["ABN ",t.abn]})]})]}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontFamily:Eg,fontSize:13,textAlign:"center"},children:o}),(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"flex",gap:6,flexWrap:"wrap"},children:[(t.proposal_count||0)>0&&(0,f.jsxs)("span",{style:{fontSize:10.5,background:"#EEF2FF",color:"#4338CA",borderRadius:5,padding:"2px 7px"},children:[t.proposal_count," prop"]}),(t.invoice_count||0)>0&&(0,f.jsxs)("span",{style:{fontSize:10.5,background:"#F2F2F5",color:"#55555C",borderRadius:5,padding:"2px 7px"},children:[t.invoice_count," inv"]}),(t.unpaid_amount||0)>0&&(0,f.jsxs)("span",{style:{fontSize:10.5,background:"#FEE2E2",color:"#991B1B",borderRadius:5,padding:"2px 7px"},children:[Ig(t.unpaid_amount)," due"]}),!c&&(0,f.jsx)("span",{style:{fontSize:11.5,color:"#B5B5BC"},children:"No activity"})]}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontFamily:Eg,fontSize:12,color:"#55555C"},children:Rg(t.updated_at)}),(0,f.jsxs)(Mr,{open:E===t.id,onToggle:()=>T(E===t.id?null:t.id),onClose:()=>T(null),children:[(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{T(null),e("/admin/clients/company/".concat(t.id))},children:[(0,f.jsx)(_.A,{size:15})," View company"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{T(null),e("/admin/clients/edit/".concat(t.id))},children:[(0,f.jsx)(Tn.A,{size:15})," Edit company"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{T(null),e("/admin/proposals/create")},children:[(0,f.jsx)(kt.A,{size:15})," New proposal"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{T(null),e("/admin/invoices/create")},children:[(0,f.jsx)(At.A,{size:15})," New invoice"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",style:{color:"#991B1B"},onClick:()=>(async(e,t)=>{if(window.confirm('Are you sure you want to delete "'.concat(t,'"? This will also delete all c
1ontacts under this company.'))){try{var a;const t=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,n=await fetch("".concat(I.fn,"/api/clients/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}});if(n.ok)s.success("Company deleted successfully"),z(),B();else{const e=await n.json();s.error(e.detail||"Failed to delete company")}}catch(n){console.error("Error deleting company:",n),s.error("Failed to delete company")}T(null)}})(t.id,t.company_name),children:[(0,f.jsx)(la.A,{size:15})," Delete"]})]})]}),l&&r.map(t=>(0,f.jsxs)("div",{className:"tg-leadrow",style:{gridTemplateColumns:zg,padding:"10px 22px 10px 58px",borderBottom:"1px solid #F2F2F5",background:"#FBFBFC",alignItems:"center"},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600},children:t.contact_name}),t.position&&(0,f.jsxs)("span",{style:{fontSize:11.5,color:"#9A9AA0"},children:[" \xb7 ",t.position]})]}),(0,f.jsx)("span",{}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontSize:12,color:"#55555C",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.email}),(0,f.jsx)("span",{}),(0,f.jsx)("span",{style:{justifySelf:"center"},children:(0,f.jsx)("button",{onClick:()=>e("/admin/clients/contact/".concat(t.id,"/edit")),title:"Edit contact",style:{background:"none",border:"none",color:"#B5B5BC",cursor:"pointer",display:"flex"},children:(0,f.jsx)(Tn.A,{size:14})})})]},t.id)),l&&0===r.length&&(0,f.jsx)("div",{style:{padding:"10px 22px 10px 58px",borderBottom:"1px solid #F2F2F5",background:"#FBFBFC",fontSize:12.5,color:"#9A9AA0"},children:"No contacts yet"})]},t.id)}),!k&&D.length>0&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 22px",borderTop:"1px solid #EDEDF0",flexWrap:"wrap",gap:10},children:[(0,f.jsxs)("span",{style:{fontFamily:Eg,fontSize:11.5,color:"#9A9AA0"},children:["SHOWING ",25*(d-1)+1,"\u2013",25*(d-1)+D.length," OF ",l," COMPANIES"]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)("button",{disabled:d<=1,onClick:()=>p(e=>e-1),style:Pg(d<=1),children:"\u2190 Prev"}),(0,f.jsxs)("span",{style:{fontFamily:Eg,fontSize:11.5,color:"#55555C"},children:["PAGE ",d," / ",P]}),(0,f.jsx)("button",{disabled:d>=P,onClick:()=>p(e=>e+1),style:Pg(d>=P),children:"Next \u2192"})]})]})]})]})},Og="'Space Mono',monospace",Lg={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},Mg={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},qg=e=>{let{title:t,children:s,right:a}=e;return(0,f.jsxs)(Ls,{style:{padding:22},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:t}),a]}),s]})},Hg=e=>{let{label:t,value:s,onChange:a,required:n,span:r,type:i="text",placeholder:o}=e;return(0,f.jsxs)("div",{style:{gridColumn:2===r?"span 2":"auto"},children:[(0,f.jsxs)("label",{style:Lg,children:[t,n&&" *"]}),(0,f.jsx)("input",{type:i,value:s,onChange:a,placeholder:o,style:Mg})]})},Ug=()=>{const e=(0,r.Zp)(),{clientId:t}=(0,r.g)(),s=!!t,n=(0,a.useRef)(null),i=(0,a.useRef)(null),[l,c]=(0,a.useState)({company_name:"",street_address:"",city:"",state:"",postal_code:"",country:"Australia",abn:"",logo_url:"",rate_sheet_url:""}),[d,p]=(0,a.useState)(null),[x,h]=(0,a.useState)([]),[u,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(null),[j,w]=(0,a.useState)({contact_name:"",position:"",email:"",phone:""}),[N,A]=(0,a.useState)({}),[k,S]=(0,a.useState)(!1),[C,F]=(0,a.useState)(!1),[E,T]=(0,a.useState)(""),[z,B]=(0,a.useState)(!1),[D,R]=(0,a.useState)(""),[P,W]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(async()=>{await(0,o.cd)()?s&&O():e("/admin")})()},[e,s]);const O=async()=>{try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(I.fn,"/api/clients/").concat(t),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const e=await a.json();if(e.parent_company_id){p(e.parent_company_id);const t=await fetch("".concat(I.fn,"/api/clients/").concat(e.parent_company_id),{headers:{Authorization:"Bearer ".concat(s)}});if(t.ok){const s=await t.json();c({company_name:s.company_name,street_address:s.street_address||"",city:s.city||"",state:s.state||"",postal_code:s.postal_code||"",country:s.country||"Australia",abn:s.abn||"",logo_url:s.logo_url||"",rate_sheet_url:s.rate_sheet_url||""}),L(e.parent_company_id)}}else p(e.id),c({company_name:e.company_name,street_address:e.street_address||"",city:e.city||"",state:e.state||"",postal_code:e.postal_code||"",country:e.country||"Australia",abn:e.abn||"",logo_url:e.logo_url||"",rate_sheet_url:e.rate_sheet_url||""}),e.is_company?L(e.id):h([{id:e.id,contact_name:e.contact_name,position:e.position||"",email:e.email,phone:e.phone}])}}catch(s){console.error("Error loading company:",s)}},L=async e=>{if(e)try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/companies/").concat(e,"/contacts"),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const e=await a.json();
1h(e.contacts||[]),(e.contacts||[]).forEach(e=>M(e.id))}}catch(s){console.error("Error loading contacts:",s)}},M=async e=>{try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/contacts/").concat(e,"/activities"),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const t=await a.json();A(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t.counts}))}}catch(s){console.error("Error loading activities:",s)}},q=async e=>{if(e)if(["image/png","image/jpeg","image/jpg","image/svg+xml"].includes(e.type))if(e.size>2097152)T("File size must be less than 2MB");else if(t){T(""),F(!0);try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,n=new FormData;n.append("logo_file",e),n.append("company_id",t);const r=await fetch("".concat(I.fn,"/api/company-logo-upload"),{method:"POST",headers:{Authorization:"Bearer ".concat(a)},body:n}),i=await r.json();i.success?c(e=>(0,m.A)((0,m.A)({},e),{},{logo_url:i.logo_url})):T(i.error||"Upload failed")}catch(a){console.error("Upload error:",a),T("Upload failed. Please try again.")}finally{F(!1)}}else T("Please save the company first, then upload logo");else T("Invalid file type. Please upload PNG, JPG, or SVG only")},H=e=>t=>c((0,m.A)((0,m.A)({},l),{},{[e]:t.target.value})),U={display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",opacity:k?.6:1};return(0,f.jsxs)(ta,{title:s?"Edit Company":"New Company",meta:"CRM \xb7 COMPANY",children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>e("/admin/clients"),style:{display:"inline-flex",alignItems:"center",gap:7,fontSize:13,fontWeight:600,color:"#55555C",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{size:15})," Clients"]}),(0,f.jsx)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:s?l.company_name||"Edit Company":"New Company"}),(0,f.jsx)("div",{style:{marginLeft:"auto"},children:(0,f.jsxs)("button",{className:"tg-btn-primary",onClick:async()=>{if(l.company_name.trim()){S(!0);try{var a;const n=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,r=d||t,i=s?"".concat(I.fn,"/api/clients/").concat(r):"".concat(I.fn,"/api/clients"),o=s?"PUT":"POST",c=(0,m.A)({company_name:l.company_name,street_address:l.street_address,city:l.city,state:l.state,postal_code:l.postal_code,country:l.country,abn:l.abn,logo_url:l.logo_url,rate_sheet_url:l.rate_sheet_url},s?{}:{contact_name:"Primary Contact",email:"[email protected]",phone:"",position:"",is_company:!0}),p=await fetch(i,{method:o,headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify(c)});if(p.ok)alert("Company saved successfully"),sessionStorage.removeItem("clients_cache"),e("/admin/clients",{replace:!0,state:{reload:Date.now()}});else{const e=await p.json().catch(()=>({}));alert("Failed to save: ".concat(e.detail||"Unknown error"))}}catch(n){console.error("Error:",n),alert("Error saving company")}finally{S(!1)}}else alert("Company name is required")},disabled:k,style:U,children:[(0,f.jsx)(ia.A,{size:15})," ",k?"Saving\u2026":"Save company"]})})]}),(0,f.jsxs)("div",{style:{maxWidth:760,display:"flex",flexDirection:"column",gap:18},children:[(0,f.jsx)(qg,{title:"Company details",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsx)(Hg,{label:"Company name",required:!0,span:2,value:l.company_name,onChange:H("company_name")}),(0,f.jsx)(Hg,{label:"ABN",value:l.abn,onChange:H("abn")})]})}),(0,f.jsx)(qg,{title:"Address",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsx)(Hg,{label:"Street address",span:2,value:l.street_address,onChange:H("street_address")}),(0,f.jsx)(Hg,{label:"City",value:l.city,onChange:H("city")}),(0,f.jsx)(Hg,{label:"State",value:l.state,onChange:H("state")}),(0,f.jsx)(Hg,{label:"Postcode",value:l.postal_code,onChange:H("postal_code")}),(0,f.jsx)(Hg,{label:"Country",value:l.country,onChange:H("country")})]})}),(0,f.jsxs)(qg,{title:"Logo",children:[s?(0,f.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"center"},children:[l.logo_url&&(0,f.jsx)("img",{src:l.logo_url,alt:"logo",style:{width:64,height:64,borderRadius:10,objectFit:"contain",border:"1px solid #E4E4E9",background:"#fff"}}),(0,f.jsxs)("div",{onClick:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.click()},onDragOver:e=>{e.preventDefault(),W(!0)},onDragLeave:()=>W(!1),onDrop:e=>{e.preventDefault(),W(!1);const t=e.dataTransfer.files[0];t&&q(t)},style:{flex:1,border:"2px dashed ".concat(P?"#BF212F":"#C9C9D0"),borderRadius:11,padding:22,textAlign:"center",color:"#9A9AA0",cursor:"pointer",background:P?"#FEF2F2":"transparent"},children:[(0,f.jsx)(_s.A,{size:20,style:{margin:"0 auto 6px"}}),(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"#55555C"},children:C?"Uploading\u2026":"Drop logo or browse"}),(0,f.jsx)("div",{style:{fontSize:11,color:"#9A9AA0",marginTop:3},children:"PNG/JPG/SVG \xb7 max 2MB"})]}),(0,f.jsx)("input",{ref:n,type:"file",accept:"image/png,image/jpeg,image/svg+xml",style:{display:"none"},onChange:e=>q(e.target.files[0])})]}):(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0"},children:"Save the company first, then upload a logo."}),E&&(0,f.jsx)("div",{style:{color:"#991B1B",fontSize:12,marginTop:8},children:E})]}),(0,f.jsxs)(qg,{title:"Rate sheet",children:[s?l.rate_sheet_url?(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,f.jsx)("span",{style:{width:38,height:38,borderRadius:9,background:"#FEE2E2",color:"#BF212F",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(kt.A,{size:18})}),(0,f.jsx)("div",{style:{flex:1,fontSize:13,fontWeight:600},children:"Rate sheet uploaded"}),(0,f.jsxs)("a",{href:l.rate_sheet_url,target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:13,fontWeight:600,color:"#333",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",textDecoration:"none"},children:[(0,f.jsx)(_.A,{size:14})," View"]}),(0,f.jsxs)("button",{onClick:async()=>
1{if(window.confirm("Are you sure you want to delete the rate sheet?"))try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a={company_name:l.company_name,street_address:l.street_address,city:l.city,state:l.state,postal_code:l.postal_code,country:l.country,abn:l.abn,logo_url:l.logo_url,rate_sheet_url:""};(await fetch("".concat(I.fn,"/api/clients/").concat(t),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify(a)})).ok?c(e=>(0,m.A)((0,m.A)({},e),{},{rate_sheet_url:""})):alert("Failed to delete rate sheet")}catch(s){console.error("Delete error:",s),alert("Failed to delete rate sheet. Please try again.")}},style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:13,fontWeight:600,color:"#991B1B",background:"#fff",border:"1px solid #FECACA",borderRadius:9,padding:"8px 12px",cursor:"pointer"},children:[(0,f.jsx)(la.A,{size:14})," Delete"]})]}):(0,f.jsxs)("div",{onClick:()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.click()},style:{border:"2px dashed #C9C9D0",borderRadius:11,padding:22,textAlign:"center",color:"#9A9AA0",cursor:"pointer"},children:[(0,f.jsx)(es.A,{size:20,style:{margin:"0 auto 6px"}}),(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"#55555C"},children:z?"Uploading\u2026":"Upload rate sheet"}),(0,f.jsx)("div",{style:{fontSize:11,color:"#9A9AA0",marginTop:3},children:"PDF/Word \xb7 max 10MB"}),(0,f.jsx)("input",{ref:i,type:"file",accept:".pdf,.doc,.docx",style:{display:"none"},onChange:async e=>{const s=e.target.files[0];if(s)if(["application/pdf","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/msword"].includes(s.type))if(s.size>10485760)R("File size must be less than 10MB");else if(t){R(""),B(!0);try{var a;const e=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,n=new FormData;n.append("rate_sheet_file",s),n.append("company_id",t);const r=await fetch("".concat(I.fn,"/api/company-rate-sheet-upload"),{method:"POST",headers:{Authorization:"Bearer ".concat(e)},body:n}),i=await r.json();i.success?c(e=>(0,m.A)((0,m.A)({},e),{},{rate_sheet_url:i.rate_sheet_url})):R(i.error||"Upload failed")}catch(n){console.error("Upload error:",n),R("Upload failed. Please try again.")}finally{B(!1),e.target.value=""}}else R("Please save the company first, then upload rate sheet");else R("Invalid file type. Please upload PDF or Word document only")}})]}):(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0"},children:"Save the company first, then upload a rate sheet."}),D&&(0,f.jsx)("div",{style:{color:"#991B1B",fontSize:12,marginTop:8},children:D})]}),s&&(0,f.jsx)(qg,{title:"Contacts",right:(0,f.jsxs)("button",{onClick:()=>{v(null),w({contact_name:"",position:"",email:"",phone:""}),b(!0)},style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:13,fontWeight:600,color:"#BF212F",background:"none",border:"none",cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:15})," Add contact"]}),children:0===x.length?(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0"},children:"No contacts yet."}):(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:x.map(e=>{const s=N[e.id]||{};return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,border:"1px solid #EDEDF0",borderRadius:11,padding:"12px 14px"},children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsxs)("div",{style:{fontSize:13.5,fontWeight:600},children:[e.contact_name,e.position&&(0,f.jsxs)("span",{style:{color:"#9A9AA0",fontWeight:400},children:[" \xb7 ",e.position]})]}),(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0"},children:[e.email,e.phone].filter(Boolean).join(" \xb7 ")})]}),(s.proposals>0||s.invoices>0)&&(0,f.jsxs)("div",{style:{display:"flex",gap:6},children:[s.proposals>0&&(0,f.jsxs)("span",{style:{fontFamily:Og,fontSize:10,background:"#EEF2FF",color:"#4338CA",borderRadius:5,padding:"2px 7px"},children:[s.proposals," prop"]}),s.invoices>0&&(0,f.jsxs)("span",{style:{fontFamily:Og,fontSize:10,background:"#F2F2F5",color:"#55555C",borderRadius:5,padding:"2px 7px"},children:[s.invoices," inv"]})]}),(0,f.jsx)("button",{onClick:()=>{return v(t=e),w({contact_name:t.contact_name,position:t.position||"",email:t.email,phone:t.phone||""}),void b(!0);var t},title:"Edit",style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex"},children:(0,f.jsx)(Tn.A,{size:15})}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Delete this contact?"))try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token;await fetch("".concat(I.fn,"/api/clients/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(a)}}),L(d||t)}catch(a){console.error("Error:",a)}})(e.id),title:"Delete",style:{background:"none",border:"none",color:"#991B1B",cursor:"pointer",display:"flex"},children:(0,f.jsx)(la.A,{size:15})})]},e.id)})})})]}),u&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(10,10,11,.5)",zIndex:70},onClick:()=>b(!1)}),(0,f.jsxs)("div",{style:{position:"fixed",top:0,right:0,height:"100vh",width:420,maxWidth:"92vw",background:"#fff",zIndex:71,boxShadow:"-20px 0 60px rgba(10,10,11,.25)",display:"flex",flexDirection:"column"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:16},children:y?"Edit Contact":"Add Contact"}),(0,f.jsx)("button",{onClick:()=>b(!1),style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex"},children:(0,f.jsx)(g.A,{size:20})})]}),(0,f.jsxs)("div",{style:{padding:22,display:"flex",flexDirection:"column",gap:14,flex:1,overflowY:"auto"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Lg,children:"Contact name *"}),(0,f.jsx)("input",{value:j.contact_name,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{contact_name:e.target.value})),style:Mg})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Lg,children:"Position"}),(0,f.jsx)("input",{value:j.position,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{position:e.target.value})),style:Mg})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Lg,children:"Email *"}),(0,f.jsx)("input",{type:"email",value:j.email,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{email:e.target.value})),style:Mg})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Lg,children:"Phone"}),(0,f.jsx)("input",{value:j.phone,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{phone:e.target.value})),style:Mg})]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:10,padding:22,borderTop:"1px solid #EDEDF0"},children:[(0,f.jsx)("button",{onClick:()=>b(!1),style:{flex:1,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px",fontWeight:600,fontSize:13,color:"#333",cursor:"pointer"},children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>
1{if(j.contact_name&&j.email)if(t)try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token;if(y){const e={contact_name:j.contact_name,position:j.position||"",email:j.email,phone:j.phone||""},a=await fetch("".concat(I.fn,"/api/clients/").concat(y.id),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify(e)});if(a.ok){v(null),w({contact_name:"",position:"",email:"",phone:""}),b(!1);const e=d||t;e&&await L(e)}else{const e=await a.json().catch(()=>({}));alert("Failed to update contact: ".concat(e.detail||e.message||"Unknown error"))}}else{const e={company_name:l.company_name,contact_name:j.contact_name,position:j.position||"",email:j.email,phone:j.phone||"",street_address:"",city:"",state:"",postal_code:"",country:"",abn:""},a=d||t,n=await fetch("".concat(I.fn,"/api/companies/").concat(a,"/contacts"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify(e)});if(n.ok)b(!1),w({contact_name:"",position:"",email:"",phone:""}),await L(a);else{const e=await n.json().catch(()=>({}));alert("Failed to add contact: ".concat(e.detail||e.message||"Unknown error"))}}}catch(s){console.error("Error:",s),alert("Error ".concat(y?"updating":"adding"," contact: ").concat(s.message))}else alert("Please save the company first before adding contacts");else alert("Contact name and email are required")},className:"tg-btn-primary",style:{flex:1,background:"#BF212F",border:"none",borderRadius:9,padding:"11px",fontWeight:600,fontSize:13,color:"#fff",cursor:"pointer"},children:y?"Save Contact":"Add Contact"})]})]})]})]})};var Gg=s(76996),Vg=s(9463);const Jg=e=>!!e&&"".concat(e.company_name||""," ").concat(e.parent_company_name||"").toLowerCase().includes("lifeblood"),Yg=["redcrossblood.org.au"];var Kg=s(41180),Zg=s(82291),$g=s(87734),Qg=s(52185),Xg=s(6026),ef=s(80379),tf=s(98708);const sf="".concat(I.fn,"/api/integrations/reviews"),af="".concat(I.fn,"/api/integrations/iq"),nf="https://reviews.turbo.net.au",rf=()=>{try{var e;return(null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token)||null}catch(t){return null}},of={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},lf=()=>{var e,t,s,n,i,l,c,d,x,h,u,b,y,v,j;const w=(0,r.Zp)(),{companyId:A}=(0,r.g)(),{toast:k}=N(),[S,F]=(0,a.useState)(null),[E,T]=(0,a.useState)([]),[z,B]=(0,a.useState)([]),[D,R]=(0,a.useState)([]),[P,W]=(0,a.useState)([]),[O,L]=(0,a.useState)(null),[M,q]=(0,a.useState)(null),[H,U]=(0,a.useState)(0),[G,V]=(0,a.useState)(1),[J,Y]=(0,a.useState)(""),[K,Z]=(0,a.useState)(!1),$=(0,a.useRef)(!1),[Q,X]=(0,a.useState)(null),[ee,te]=(0,a.useState)([]),[se,ae]=(0,a.useState)(!1),[ne,re]=(0,a.useState)(""),[ie,oe]=(0,a.useState)([]),[le,ce]=(0,a.useState)([]),[de,me]=(0,a.useState)([]),[pe,xe]=(0,a.useState)(!0),[he,ue]=(0,a.useState)("overview"),[ge,fe]=(0,a.useState)(null),[be,ye]=(0,a.useState)(""),[ve,je]=(0,a.useState)(""),[we,Ne]=(0,a.useState)(!1),[Ae,ke]=(0,a.useState)(!1),[Se,_e]=(0,a.useState)({isOpen:!1,shareLink:null,asset:null,selectedContacts:[],customEmails:[],customEmailInput:{name:"",email:""},customMessage:"",isSending:!1}),[Ce,Fe]=(0,a.useState)({isOpen:!1,asset:null,version:null,threads:[]});(0,a.useEffect)(()=>{(async()=>{await(0,o.cd)()?Ee():w("/admin")})()},[w,A]);const Ee=async()=>{xe(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s={Authorization:"Bearer ".concat(t)},[a,n,r,i,o,l,c]=await Promise.all([fetch("".concat(I.fn,"/api/clients?company_id=").concat(A),{headers:s}),fetch("".concat(I.fn,"/api/proposals?company_id=").concat(A),{headers:s}),fetch("".concat(I.fn,"/api/invoices?company_id=").concat(A,"&page_size=100"),{headers:s}),fetch("".concat(I.fn,"/api/corporate-admin/events?company_id=").concat(A),{headers:s}),fetch("".concat(I.fn,"/api/admin/todos?company_id=").concat(A),{headers:s}),fetch("".concat(I.fn,"/api/companies/").concat(A,"/notes"),{headers:s}),fetch("".concat(I.fn,"/api/consent-projects/by-company/").concat(A),{headers:s})]);if(a.ok){const e=(await a.json()).clients||[],t=e.find(e=>e.id===A&&e.is_company),s=e.filter(e=>e.parent_company_id===A);F(t),T(s)}if(n.ok){const e=await n.json(),t=Array.isArray(e)?e:e.proposals||[];B(t)}if(r.ok){const e=(await r.json()).invoices||[];e.sort((e,t)=>
1{const s=e.issue_date||e.created_date||e.created_at,a=t.issue_date||t.created_date||t.created_at,n=s?new Date(s).getTime():0;return(a?new Date(a).getTime():0)-n}),R(e)}if(i.ok){const e=await i.json(),t=Array.isArray(e)?e:e.events||[];W(t)}if(o.ok){const e=await o.json();oe(e.todos||[])}if(l.ok){const e=await l.json();ce(e.notes||[])}if(c.ok){const e=await c.json();me(e.projects||[])}}catch(t){console.error("Error loading company data:",t),k.error("Failed to load company data")}finally{xe(!1)}Te(A),De(A)},Te=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Z(!0);try{const r=new URLSearchParams({page:String(t),limit:String(2)});s&&r.set("q",s);const i=await fetch("".concat(sf,"/clients/").concat(e,"?").concat(r),{headers:{Authorization:"Bearer ".concat(rf()),"Content-Type":"application/json"}});if(i.ok){var a,n;const e=await i.json();L(e.client),q(e.pagination||null),U(null!==(a=e.totalAssets)&&void 0!==a?a:((null===(n=e.client)||void 0===n?void 0:n.projects)||[]).reduce((e,t)=>{var s;return e+((null===(s=t.assets)||void 0===s?void 0:s.length)||0)},0))}else 404===i.status&&(L({projects:[]}),q(null),U(0))}catch(r){console.error("Error loading video reviews:",r),L({projects:[]}),q(null)}finally{Z(!1)}};(0,a.useEffect)(()=>{if(!$.current)return void($.current=!0);const e=setTimeout(()=>{V(1),Te(A,1,J)},400);return()=>clearTimeout(e)},[J]);const ze=e=>{V(e),Te(A,e,J)},Be=async()=>{try{const e=await fetch("".concat(sf,"/clients"),{method:"POST",headers:{Authorization:"Bearer ".concat(rf()),"Content-Type":"application/json"},body:JSON.stringify({name:S.company_name,externalClientId:A,externalSource:"turbo360"})});if(e.ok)k.success("Company linked to Video Reviews"),await Te(A);else{const t=await e.json();k.error(t.error||"Failed to link company")}}catch(e){console.error("Error linking to video reviews:",e),k.error("Failed to link to Video Reviews")}},De=async e=>{try{const t=await fetch("".concat(af,"/clients/").concat(e),{headers:{Authorization:"Bearer ".concat(rf()),"Content-Type":"application/json"}});if(t.ok){const e=await t.json();X(e.client)}else 404===t.status&&X({galleries:[]})}catch(t){console.error("Error loading galleries:",t),X({galleries:[]})}},Ie=async()=>{try{const e=await fetch("".concat(af,"/clients"),{method:"POST",headers:{Authorization:"Bearer ".concat(rf()),"Content-Type":"application/json"},body:JSON.stringify({name:S.company_name,externalClientId:A,externalSource:"turbo360"})});if(e.ok)k.success("Company linked to Turbo IQ Galleries"),await De(A);else{const t=await e.json();k.error(t.detail||"Failed to link company")}}catch(e){console.error("Error linking to galleries:",e),k.error("Failed to link to Turbo IQ Galleries")}},Re=()=>{fe(null),ye("")},Pe=(()=>{if(!D.length)return[];const e={},t=new Date,s=new Date(t.getFullYear(),t.getMonth()-11,1);for(let a=0;a<12;a++){const t=new Date(s.getFullYear(),s.getMonth()+a,1),n="".concat(t.getFullYear(),"-").concat(String(t.getMonth()+1).padStart(2,"0"));e[n]={month:t.toLocaleDateString("en-AU",{month:"short",year:"2-digit"}),amount:0,invoiceCount:0}}return D.forEach(t=>{const a=t.issue_date||t.created_date||t.created_at;if(!a)return;const n=new Date(a);if(n<s)return;const r="".concat(n.getFullYear(),"-").concat(String(n.getMonth()+1).padStart(2,"0"));e[r]&&(e[r].amount+=parseFloat(t.total)||0,e[r].invoiceCount+=1)}),Object.values(e)})(),We=D.reduce((e,t)=>e+(parseFloat(t.total)||0),0),Oe=()=>{_e({isOpen:!1,shareLink:null,asset:null,selectedContacts:[],customEmails:[],customEmailInput:{name:"",email:""},customMessage:"",isSending:!1})},Le=()=>{const{name:e,email:t}=Se.customEmailInput;if(!t||!t.includes("@"))return void k.error("Please enter a valid email address");Se.customEmails.some(e=>e.email.toLowerCase()===t.toLowerCase())||Se.selectedContacts.some(e=>e.email.toLowerCase()===t.toLowerCase())?k.error("This email has already been added"):_e(s=>(0,m.A)((0,m.A)({},s),{},{customEmails:[...s.customEmails,{name:e.trim()||"",email:t.trim()}],customEmailInput:{name:"",email:""}}))},Me=e=>{if(!e&&0!==e)return"00:00";const t=Math.floor(e/60),s=Math.floor(e%60);return"".concat(t.toString().padStart(2,"0"),":").concat(s.toString().padStart(2,"0"))},qe=e=>{switch(null===e||void 0===e?void 0:e.toLowerCase()){case"approved":return"bg-green-100 text-green-700";
1case"pending":return"bg-yellow-100 text-yellow-700";case"changes_requested":return"bg-orange-100 text-orange-700";case"rejected":return"bg-red-100 text-red-700";case"editing_in_progress":return"bg-blue-100 text-blue-700";default:return"bg-gray-100 text-gray-700"}},He=e=>e?e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):"Unknown",Ve=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(e||0),Je=e=>e?new Date(e).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"}):"-";if(pe)return(0,f.jsx)(ta,{title:"Company",meta:"CRM \xb7 COMPANY 360",children:(0,f.jsx)(Ws,{rows:6})});if(!S)return(0,f.jsx)(ta,{title:"Company",meta:"CRM \xb7 COMPANY 360",children:(0,f.jsx)(Os,{icon:gs.A,title:"Company not found",message:"This company may have been removed or the link is incorrect.",actionLabel:"Back to Clients",onAction:()=>w("/admin/clients")})});const Ke=[{id:"overview",label:"Overview",icon:gs.A},{id:"contacts",label:"Contacts",icon:Xe.A,count:E.length},{id:"proposals",label:"Proposals",icon:kt.A,count:z.length},{id:"invoices",label:"Invoices",icon:At.A,count:D.length},...Jg(S)?[{id:"jobrequests",label:"Job Requests",icon:ws.A},{id:"travel",label:"Travel Expenses",icon:Za.A}]:[],{id:"events",label:"Events",icon:_t.A,count:P.length},{id:"todos",label:"To Do",icon:us.A,count:ie.filter(e=>!e.is_completed).length},{id:"notes",label:"Notes",icon:Gg.A,count:le.length},{id:"videos",label:"Video Reviews",icon:Ge.A,count:H},{id:"galleries",label:"Galleries",icon:Jr.A,count:(null===Q||void 0===Q||null===(e=Q.galleries)||void 0===e?void 0:e.length)||0},{id:"consent",label:"Consent Forms",icon:Ue.A,count:de.length}];return(0,f.jsxs)(ta,{title:S.company_name,meta:"CRM \xb7 COMPANY 360",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},of),{},{padding:22,marginBottom:18,display:"flex",alignItems:"center",gap:18,flexWrap:"wrap"}),children:[(0,f.jsx)("button",{onClick:()=>w("/admin/clients"),title:"Back to Clients",style:{width:40,height:40,borderRadius:10,background:"#fff",border:"1px solid #E4E4E9",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:"#55555C",flexShrink:0},children:(0,f.jsx)(Ct.A,{className:"h-5 w-5"})}),(0,f.jsx)("span",{style:{width:60,height:60,borderRadius:14,background:"#0A0A0B",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'Archivo',sans-serif",fontWeight:800,fontSize:20,flexShrink:0},children:Ms(S.company_name)}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,f.jsx)("h1",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:800,fontSize:22,margin:0,letterSpacing:"-0.01em"},children:S.company_name}),(0,f.jsx)(Ds,{tone:"green",children:"Active"})]}),(0,f.jsxs)("div",{className:"tg-mono",style:{fontSize:11.5,color:"#9A9AA0",marginTop:5},children:[S.abn?"ABN ".concat(S.abn):"No ABN on file",S.city?" \xb7 ".concat([S.street_address,S.city,S.state,S.postal_code].filter(Boolean).join(", ")):""]})]}),(0,f.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:22,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:4},children:"LIFETIME"}),(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:18,fontWeight:700},children:Ve(We)})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:4},children:"CONTACTS"}),(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:18,fontWeight:700},children:E.length})]}),(0,f.jsxs)("button",{onClick:()=>w("/admin/clients/edit/".concat(A)),className:"tg-btn-primary",style:{display:"inline-flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer"},children:[(0,f.jsx)(Tn.A,{className:"h-4 w-4"})," Edit"]})]})]}),(0,f.jsx)("div",{className:"tg-scroll",style:(0,m.A)((0,m.A)({},of),{},{padding:"0 18px",marginBottom:18,display:"flex",gap:22,overflowX:"auto"}),children:Ke.map(e=>{const t=he===e.id;return(0,f.jsxs)("button",{onClick:()=>ue(e.id),className:"tg-tab tg-mono",style:{background:"none",border:"none",cursor:"pointer",whiteSpace:"nowrap",display:"inline-flex",alignItems:"center",gap:7,padding:"16px 0",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,fontWeight:600,color:t?"#0A0A0B":"#9A9AA0",borderBottom:t?"2px solid #BF212F":"2px solid transparent"},children:[(0,f.jsx)(e.icon,{className:"h-4 w-4"}),e.label,e.count>0&&(0,f.jsx)("span",{className:"tg-mono",style:{fontSize:9.5,background:t?"#FEE2E2":"#EDEDF0",color:t?"#991B1B":"#55555C",borderRadius:10,padding:"1px 6px",marginLeft:3},children:e.count})]},e.id)})}),(0,f.jsxs)("div",{children:["overview"===he&&(0,f.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,f.jsx)("div",{className:"lg:col-span-3 grid grid-cols-2 sm:grid-cols-4 gap-4",children:[{label:"CONTACTS",value:E.length},{label:"PROPOSALS",value:z.length},{label:"INVOICES",value:D.length},{label:"VIDEOS",value:H}].map(e=>(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},of),{},{padding:16}),children:[(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:8},children:e.label}),(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:24,fontWeight:700,color:"#0A0A0B"},children:e.value})]},e.label))}),(0,f.jsxs)("div",{className:"lg:col-span-3",style:(0,m.A)((0,m.A)({},of),{},{padding:24}),children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,color:"#0A0A0B"},children:"Financial Overview"}),(0,f.jsx)("p",{className:"tg-mono",style:{fontSize:11,color:"#9A9AA0",marginTop:4},children:"Monthly invoicing \xb7 Last 12 months"})]}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsx)(zs,{amount:We,size:24}),(0,f.jsx)("p",{className:"tg-mono",style:{fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginTop:4},children:"TOTAL INVOICED"})]})]}),Pe.length>0&&Pe.some(e=>e.amount>0)?(0,f.jsx)("div",{className:"h-64",children:(0,f.jsx)(Kg.u,{width:"100%",height:"100%",children:(0,f.jsxs)(Zg.E,{data:Pe,margin:{top:10,right:10,left:10,bottom:0},children:[(0,f.jsx)($g.d,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),(0,f.jsx)(Qg.W,{dataKey:"month",tick:{fontSize:12,fill:"#6b7280"}
1,tickLine:!1,axisLine:{stroke:"#e5e7eb"}}),(0,f.jsx)(Xg.h,{tick:{fontSize:12,fill:"#6b7280"},tickLine:!1,axisLine:!1,tickFormatter:e=>e>=1e3?"$".concat((e/1e3).toFixed(0),"k"):"$".concat(e)}),(0,f.jsx)(ef.m,{formatter:e=>[Ve(e),"Invoiced"],contentStyle:{backgroundColor:"#1f2937",border:"none",borderRadius:"8px",color:"#fff",fontSize:"14px"},labelStyle:{color:"#9ca3af"},cursor:{fill:"rgba(191, 33, 47, 0.08)"}}),(0,f.jsx)(tf.yP,{dataKey:"amount",fill:"#BF212F",radius:[4,4,0,0],maxBarSize:50})]})})}):(0,f.jsx)("div",{className:"h-64 flex items-center justify-center text-gray-400",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)(At.A,{className:"h-12 w-12 mx-auto mb-2 opacity-40"}),(0,f.jsx)("p",{children:"No invoice data to display"})]})})]}),(0,f.jsxs)("div",{className:"lg:col-span-2",style:(0,m.A)((0,m.A)({},of),{},{padding:24}),children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,color:"#0A0A0B",marginBottom:16},children:"Recent Proposals"}),0===z.length?(0,f.jsx)("p",{className:"text-gray-500 text-sm",children:"No proposals yet"}):(0,f.jsx)("div",{className:"space-y-3",children:z.slice(0,5).map(e=>(0,f.jsxs)("div",{onClick:()=>w("/admin/proposals/".concat(e.id)),className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg hover:bg-gray-100 cursor-pointer transition-colors",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-900",children:e.title||e.project_name||"Untitled"}),(0,f.jsx)("p",{className:"text-sm text-gray-500",children:Je(e.created_at)})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium ".concat(qe(e.status)),children:He(e.status)}),(0,f.jsx)(rs.A,{className:"h-4 w-4 text-gray-400"})]})]},e.id))})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},of),{},{padding:24}),children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,color:"#0A0A0B",marginBottom:16},children:"Company Details"}),(0,f.jsxs)("div",{className:"space-y-4",children:[S.street_address&&(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)(C.A,{className:"h-5 w-5 text-gray-400 mt-0.5"}),(0,f.jsxs)("div",{className:"text-sm text-gray-600",children:[(0,f.jsx)("p",{children:S.street_address}),S.city&&(0,f.jsxs)("p",{children:[S.city,", ",S.state," ",S.postal_code]}),S.country&&(0,f.jsx)("p",{children:S.country})]})]}),(0,f.jsxs)("div",{className:"pt-2 border-t border-gray-100",children:[(0,f.jsx)("p",{className:"text-xs text-gray-400",children:"Created"}),(0,f.jsx)("p",{className:"text-sm text-gray-600",children:Je(S.created_at)})]})]})]})]}),"contacts"===he&&(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"Contacts"}),(0,f.jsxs)("button",{onClick:()=>w("/admin/clients/edit/".concat(A),{state:{addContact:!0}}),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"Add Contact"]})]}),0===E.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(Xe.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-500",children:"No contacts yet"})]}):(0,f.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:E.map(e=>(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 hover:shadow-md transition-shadow",children:[(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"w-12 h-12 rounded-full bg-gradient-to-br from-purple-400 to-purple-600 flex items-center justify-center",children:(0,f.jsx)(Ye.A,{className:"h-6 w-6 text-white"})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"font-semibold text-gray-900",children:e.contact_name}),e.position&&(0,f.jsx)("p",{className:"text-sm text-purple-600",children:e.position}),e.email&&(0,f.jsx)("a",{href:"mailto:".concat(e.email),className:"text-sm text-gray-500 hover:text-blue-600 block truncate",children:e.email}),e.phone&&(0,f.jsx)("a",{href:"tel:".concat(e.phone),className:"text-sm text-gray-500 hover:text-blue-600",children:e.phone})]})]}),(0,f.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,f.jsxs)("button",{onClick:()=>window.open("/client/".concat(e.id),"_blank"),className:"px-3 py-1.5 bg-blue-50 text-blue-700 rounded-lg text-xs font-medium hover:bg-blue-100 transition-colors flex items-center gap-1",title:"View client portal",children:[(0,f.jsx)(_.A,{className:"h-3 w-3"}),"Portal"]}),(0,f.jsxs)("button",{onClick:()=>w("/admin/content-delivery",{state:{prefilledClient:{client_id:e.id,client_company:S.company_name,contact_name:e.contact_name,email:e.email,phone:e.phone}}}),className:"px-3 py-1.5 bg-purple-50 text-purple-700 rounded-lg text-xs font-medium hover:bg-purple-100 transition-colors flex items-center gap-1",title:"Create content delivery",children:[(0,f.jsx)(Ge.A,{className:"h-3 w-3"}),"Delivery"]}),(0,f.jsx)("button",{onClick:()=>w("/admin/proposals/create",{state:{prefilledClient:{client_id:e.id,client_company:S.company_name,contact_name:e.contact_name,email:e.email,phone:e.phone}}}),className:"px-3 py-1.5 bg-emerald-50 text-emerald-700 rounded-lg text-xs font-medium hover:bg-emerald-100 transition-colors",children:"Proposal"}),(0,f.jsx)("button",{onClick:()=>w("/admin/clients/edit/".concat(e.id)),className:"px-3 py-1.5 bg-gray-50 text-gray-700 rounded-lg text-xs font-medium hover:bg-gray-100 transition-colors",children:"Edit"})]})]},e.id))})]}),"proposals"===he&&(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"Proposals"}),(0,f.jsxs)("button",{onClick:()=>w("/admin/proposals/create",{state:{prefilledClient:{client_id:A,client_company:S.company_name}}}),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"New Proposal"]})]}),0===z.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(kt.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-500",children:"No proposals yet"})]}):(0,f.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:(0,f.jsxs)("table",{className:"w-full",children:[(0,f.jsx)("thead",{className:"bg-gray-50 border-b border-gray-200",children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Title"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Event Date"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Amount"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Status"}),(0,f.jsx)("th",{className:"px-4 py-3"})]})}),(0,f.jsx)("tbody",{className:"divide-y divide-gray-100",children:z.map(e=>(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsx)("td",{className:"px-4 py-3 font-medium text-gray-900",children:e.title||e.project_name||"Untitled"}),(0,f.jsx)("td",{className:"px-4 py-3 text-sm text-gray-500",children:Je(e.job_date||e.created_at)}),(0,f.jsx)("td",{className:"px-4 py-3 text-sm text-gray-900",children:Ve(e.total)}),(0,f.jsx)("td",{className:"px-4 py-3",children:(0,f.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium ".concat(qe(e.status)),children:He(e.status)})}),(0,f.jsx)("td",{className:"px-4 py-3 text-right",children:(0,f.jsx)("button",{onClick:()=>w("/admin/proposals/".concat(e.id)),className:"text-blue-600 hover:text-blue-700 text-sm font-medium",children:"View"})})]},e.id))})]})})]}),"invoices"===he&&(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"Invoices"}),(0,f.jsxs)("button",{onClick:()=>w("/admin/invoices/create",{state:{prefilledClient:{client_id:A,client_company:S.company_name}}}),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"New Invoice"]})]}),0===D.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(At.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-500",children:"No invoices yet"})]}):(0,f.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-x-auto",children:(0,f.jsxs)("table",{className:"w-full",children:[(0,f.jsx)("thead",{className:"bg-gray-50 border-b border-gray-200",children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Invoice #"}),(0,f.jsx)("th",{className:"hidden md:table-cell text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Project"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Issue Date"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Amount"}),(0,f.jsx)("th",{className:"text-left px-4 py-3 text-sm font-medium text-gray-600",children:"Status"}),(0,f.jsx)("th",{className:"px-4 py-3"})]})}),(0,f.jsx)("tbody",{className:"divide-y divide-gray-100",children:D.map(e=>(0,f.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,f.jsxs)("td",{className:"px-4 py-3 font-medium text-gray-900",children:[(0,f.jsx)("div",{children:e.invoice_number||e.id}),e.project_name&&(0,f.jsx)("div",{className:"md:hidden mt-0.5 text-xs font-normal text-gray-500 truncate max-w-[9rem]",title:e.project_name,children:e.project_name})]}),(0,f.jsx)("td",{className:"hidden md:table-cell px-4 py-3 text-sm text-gray-700",children:(0,f.jsx)("div",{className:"truncate max-w-[18rem]",title:e.project_name||"",children:e.project_name||"\u2014"})}),(0,f.jsx)("td",{className:"px-4 py-3 text-sm text-gray-500",children:Je(e.issue_date||e.created_date||e.created_at)}),(0,f.jsx)("td",{className:"px-4 py-3 text-sm text-gray-900",children:Ve(e.total)}),(0,f.jsx)("td",{className:"px-4 py-3",children:(0,f.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium ".concat(qe(e.status)),children:He(e.status)})}),(0,f.jsx)("td",{className:"px-4 py-3 text-right",children:(0,f.jsx)("button",{onClick:()=>w("/admin/invoices/".concat(e.id)),className:"text-blue-600 hover:text-blue-700 text-sm font-medium",children:"View"})})]},e.id))})]})})]}),"events"===he&&(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"Event Runsheets"}),(0,f.jsxs)("button",{onClick:()=>w("/admin/corporate/create",{state:{prefilledClient:S.company_name}}),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"New Event"]})]}),0===P.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(_t.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-500",children:"No events yet"})]}):(0,f.jsx)("div",{className:"grid gap-4 sm:grid-cols-2",children:P.map(e=>(0,f.jsx)("div",{onClick:()=>w("/admin/corporate/edit/".concat(e.id)),className:"bg-white rounded-xl border border-gray-200 p-4 hover:shadow-md cursor-pointer transition-shadow",children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"w-10 h-10 rounded-lg bg-indigo-100 flex items-center justify-center",children:(0,f.jsx)(_t.A,{className:"h-5 w-5 text-indigo-600"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"font-semibold text-gray-900",children:e.event_name||"Untitled Event"}),(0,f.jsx)("p",{className:"text-sm text-gray-500",children:Je(e.event_date)})]}),(0,f.jsx)(rs.A,{className:"h-5 w-5 text-gray-400"})]})},e.id))})]}),"todos"===he&&(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"To Do Items"}),(0,f.jsxs)("button",{onClick:()=>w("/admin/todos",{state:{prefilledClient:{client_id:A,client_company:S.company_name}}}),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"New Task"]})]}),0===ie.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(us.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-500",children:"No tasks yet"})]}):(0,f.jsx)("div",{className:"space-y-3",children:ie.map(e=>{var t;return(0,f.jsx)("div",{onClick:()=>w("/admin/todos"),className:"bg-white rounded-xl border p-4 hover:shadow-md cursor-pointer transition-shadow ".concat(e.is_completed?"border-gray-100 opacity-60":"border-gray-200"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"w-10 h-10 rounded-lg flex items-center justify-center ".concat(e.is_completed?"bg-green-100":"bg-purple-100"),children:e.is_completed?(0,f.jsx)(p.A,{className:"h-5 w-5 text-green-600"}):(0,f.jsx)(us.A,{className:"h-5 w-5 text-purple-600"})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"font-semibold ".concat(e.is_completed?"text-gray-500 line-through":"text-gray-900"),children:e.project_name}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,f.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(e.status.toLowerCase().includes("progress")?"bg-blue-100 text-blue-700":e.status.toLowerCase().includes("complete")?"bg-green-100 text-green-700":e.status.toLowerCase().includes("hold")?"bg-orange-100 text-orange-700":"bg-gray-100 text-gray-700"),children:e.status}),(null===(t=e.progress_notes)||void 0===t?void 0:t.length)>0&&(0,f.jsxs)("span",{className:"text-xs text-gray-500",children:[e.progress_notes.length," note",1!==e.progress_notes.length?"s":""]})]})]}),(0,f.jsx)(rs.A,{className:"h-5 w-5 text-gray-400"})]})},e.id)})})]}),"notes"===he&&(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"Company Notes"}),!we&&(0,f.jsxs)("button",{onClick:()=>Ne(!0),className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"Add Note"]})]}),we&&(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:[(0,f.jsx)("textarea",{value:ve,onChange:e=>je(e.target.value),placeholder:"Write a note...",className:"w-full p-3 border border-gray-200 rounded-lg resize-none focus:outline-none focus:ring-2 focus:ring-blue-500",rows:4,autoF
1ocus:!0}),(0,f.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,f.jsx)("button",{onClick:()=>{Ne(!1),je("")},className:"px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg font-medium transition-colors",children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{if(ve.trim()){ke(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/companies/").concat(A,"/notes"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify({content:ve})});if(s.ok){const e=await s.json();ce(t=>[e.note,...t]),je(""),Ne(!1),k.success("Note added")}else k.error("Failed to add note")}catch(t){console.error("Error adding note:",t),k.error("Failed to add note")}finally{ke(!1)}}},disabled:!ve.trim()||Ae,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-medium transition-colors disabled:opacity-50 flex items-center gap-2",children:[Ae?(0,f.jsx)(Kr.A,{className:"h-4 w-4 animate-spin"}):(0,f.jsx)(ia.A,{className:"h-4 w-4"}),"Save Note"]})]})]}),0!==le.length||we?(0,f.jsx)("div",{className:"space-y-3",children:le.map(e=>(0,f.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:ge===e.id?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("textarea",{value:be,onChange:e=>ye(e.target.value),className:"w-full p-3 border border-gray-200 rounded-lg resize-none focus:outline-none focus:ring-2 focus:ring-blue-500",rows:4,autoFocus:!0}),(0,f.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,f.jsx)("button",{onClick:Re,className:"px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg font-medium transition-colors",children:"Cancel"}),(0,f.jsxs)("button",{onClick:()=>(async e=>{if(be.trim()){ke(!0);try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token;(await fetch("".concat(I.fn,"/api/companies/").concat(A,"/notes/").concat(e),{method:"PUT",headers:{Authorization:"Bearer ".concat(s),"Content-Type":"application/json"},body:JSON.stringify({content:be})})).ok?(ce(t=>t.map(t=>t.id===e?(0,m.A)((0,m.A)({},t),{},{content:be,updated_at:(new Date).toISOString()}):t)),fe(null),ye(""),k.success("Note updated")):k.error("Failed to update note")}catch(s){console.error("Error updating note:",s),k.error("Failed to update note")}finally{ke(!1)}}})(e.id),disabled:!be.trim()||Ae,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-lg font-medium transition-colors disabled:opacity-50 flex items-center gap-2",children:[Ae?(0,f.jsx)(Kr.A,{className:"h-4 w-4 animate-spin"}):(0,f.jsx)(ia.A,{className:"h-4 w-4"}),"Save"]})]})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,f.jsx)("p",{className:"text-gray-700 whitespace-pre-wrap flex-1",children:e.content}),(0,f.jsxs)("div",{className:"flex items-center gap-1",children:[(0,f.jsx)("button",{onClick:()=>(e=>{fe(e.id),ye(e.content)})(e),className:"p-2 text-gray-400 hover:text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",title:"Edit note",children:(0,f.jsx)(Tn.A,{className:"h-4 w-4"})}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete this note?"))try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token;(await fetch("".concat(I.fn,"/api/companies/").concat(A,"/notes/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}})).ok?(ce(t=>t.filter(t=>t.id!==e)),k.success("Note deleted")):k.error("Failed to delete note")}catch(s){console.error("Error deleting note:",s),k.error("Failed to delete note")}})(e.id),className:"p-2 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors",title:"Delete note",children:(0,f.jsx)(la.A,{className:"h-4 w-4"})})]})]}),(0,f.jsxs)("p",{className:"text-xs text-gray-400 mt-3",children:[new Date(e.created_at).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),e.updated_at&&" (edited)"]})]})},e.id))}):(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(Gg.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-500",children:"No notes yet"}),(0,f.jsx)("button",{onClick:()=>Ne(!0),className:"mt-4 text-blue-600 hover:text-blue-700 font-medium",children:"Add your first note"})]})]}),"videos"===he&&(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center gap-3 flex-wrap",children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"Video Reviews"}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[((null===O||void 0===O?void 0:O._id)||J)&&(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(ds.A,{className:"h-4 w-4 text-gray-400 absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none"}),(0,f.jsx)("input",{type:"text",value:J,onChange:e=>Y(e.target.value),placeholder:"Search projects & videos\u2026",className:"pl-9 pr-8 py-2 w-64 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:border-transparent"}),J&&(0,f.jsx)("button",{onClick:()=>Y(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-4 w-4"})})]}),K&&(0,f.jsx)(Kr.A,{className:"h-4 w-4 text-cyan-600 animate-spin"}),O&&0===(null===(t=O.projects)||void 0===t?void 0:t.length)&&!O._id&&(0,f.jsxs)("button",{onClick:Be,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(Ge.A,{className:"h-4 w-4"}),"Link to Video Reviews"]})]})]}),!O||0===(null===(s=O.projects)||void 0===s?void 0:s.length)&&!O._id?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(Ge.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Not Connected to Video Reviews"}),(0,f.jsx)("p",{className:"text-gray-500 mb-4",children:"Link this company to Turbo Reviews to manage video review projects."}),(0,f.jsxs)("button",{onClick:Be,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-xl font-medium transition-colors inline-flex items-center gap-2",children:[(0,f.jsx)(Ge.A,{className:"h-4 w-4"}),"Link to Video Reviews"]})]}):0===(null===(n=O.projects)||void 0===n?void 0:n.length)?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(Ge.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),J?(0,f.jsxs)("p",{className:"text-gray-500",children:["No projects or videos match \u201c",J,"\u201d"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"text-gray-500",children:"No video review projects yet"}),(0,f.jsxs)("a",{href:nf,target:"_blank",rel:"noopener noreferrer",className:"mt-4 inline-flex items-center gap-2 text-cyan-600 hover:text-cyan-700 font-medium",children:["Open Turbo Reviews",(0,f.jsx)(En.A,{className:"h-4 w-4"})]})]})]}):(0,f.jsxs)("div",{className:"space-y-6",children:[O.projects.map(e=>{var t,s,a;return(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"p-4 border-b border-gray-100 bg-gray-50",children:[(0,f.jsx)("h4",{className:"font-semibold text-gray-900",children:e.name}),e.description&&(0,f.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]}),(0,f.jsxs)("div",{className:"p-4",children:[0===(null===(t=e.assets)||void 0===t?void 0:t.length)?(0,f.jsx)("p",{className:"text-gray-500 text-sm",children:"No videos in this project"}):(0,f.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:null===(s=e.assets)||void 0===s?void 0:s.map(e=>{var t,s;const a=null===(t=e.versions)||void 0===t?void 0:t[0],n=null===a||void 0===a||null===(s=a.shareLinks)||void 0===s?void 0:s[0],r=(null===a||void 0===a?void 0:a.commentCount)>0;return(0,f.jsxs)("div",{className:"border border-gray-200 rounded-lg overflow-hidden hover:shadow-md transition-shadow",children:[(0,f.jsxs)("a",{href:(null===n||void 0===n?void 0:n.url)||nf,target:"_blank",rel:"noopener noreferrer",className:"block aspect-video bg-gray-900 relative group cursor-pointer",children:[e.thumbnailUrl?(0,f.jsx)("img",{src:e.thumbnailUrl,alt:e.name,className:"w-full h-full object-cover group-hover:opacity-90 transition-opacity"}):(0,f.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,f.jsx)(ji.A,{className:"h-12 w-12 text-gray-600 group-hover:text-white transition-colors"})}),(0,f.jsx)("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,f.jsx)(ji.A,{className:"h-16 w-16 text-white"})}),(0,f.jsx)("div",{className:"absolute top-2 right-2",children:(0,f.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium ".concat(qe(e.latestVersionStatus)),children:He(e.latestVersionStatus)})})]}),(0,f.jsxs)("div",{className:"p-3",children:[(0,f.jsx)("p",{className:"font-medium text-gray-900 truncate",children:e.name}),(0,f.jsxs)("div",{className:"flex items-center gap-3 mt-1 text-xs text-gray-500",children:[(0,f.jsxs)("span",{children:["Version ",e.currentVersion]}),r&&(0,f.jsxs)("button",{onClick:t=>{t.stopPropagation(),(async(e,t)=>{var s,a;if(Fe({isOpen:!0,asset:e,version:t,threads:(null===t||void 0===t?void 0:t.threads)||[],loading:!(null!==t&&void 0!==t&&null!==(s=t.threads)&&void 0!==s&&s.length)}),null===t||void 0===t||null===(a=t.threads)||void 0===a||!a.length)try{const e=await fetch("".concat(sf,"/versions/").concat(t._id,"/comments"),{headers:{Authorization:"Bearer ".concat(rf()),"Content-Type":"application/json"}}),s=e.ok&&(await e.json()).threads||[];Fe(e=>e.isOpen?(0,m.A)((0,m.A)({},e),{},{threads:s,loading:!1}):e)}catch(n){console.error("Error loading comments:",n),Fe(e=>e.isOpen?(0,m.A)((0,m.A)({},e),{},{loading:!1}):e)}})(e,a)},className:"flex items-center gap-1 text-cyan-600 hover:text-cyan-700 hover:underline cursor-pointer",children:[(0,f.jsx)(Fn.A,{className:"h-3 w-3"}),a.commentCount," ",1===a.commentCount?"comment":"comments"]}),(null===a||void 0===a?void 0:a.openThreadCount)>0&&(0,f.jsxs)("span",{className:"text-orange-600 font-medium",children:[a.openThreadCount," open"]})]}),n?(0,f.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsxs)("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-cyan-600 hover:text-cyan-700 text-sm font-medium",children:[(0,f.jsx)(En.A,{className:"h-3.5 w-3.5"}),"Open Review Link"]}),E.length>0&&(0,f.jsxs)("button",{onClick:t=>{t.stopPropagation(),((e,t)=>
1{_e({isOpen:!0,type:"video",shareLink:e,asset:t,bundle:null,project:null,selectedContacts:[],customEmails:[],customEmailInput:{name:"",email:""},customMessage:"",isSending:!1})})(n,e)},className:"flex items-center gap-1 px-2 py-1 bg-cyan-50 hover:bg-cyan-100 text-cyan-700 rounded text-xs font-medium transition-colors",title:"Send to contact",children:[(0,f.jsx)(st.A,{className:"h-3 w-3"}),"Send"]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:[(0,f.jsx)(_.A,{className:"h-3 w-3"}),(0,f.jsxs)("span",{children:[n.viewCount||0," views"]}),(0,f.jsx)("span",{children:"\u2022"}),(0,f.jsxs)("span",{children:["Expires ",Je(n.expiresAt)]})]})]}):(0,f.jsx)("p",{className:"mt-3 text-xs text-gray-400",children:"No share link available"})]})]},e._id)})}),(null===(a=e.shareBundles)||void 0===a?void 0:a.length)>0&&(0,f.jsxs)("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,f.jsx)(as.A,{className:"h-4 w-4 text-cyan-600"}),(0,f.jsx)("h5",{className:"text-sm font-semibold text-gray-700",children:"Share Bundles"})]}),(0,f.jsx)("div",{className:"space-y-2",children:e.shareBundles.map(t=>{var s,a,n,r,i,o;return(0,f.jsxs)("div",{className:"flex items-center justify-between gap-3 p-3 bg-gray-50 border border-gray-200 rounded-lg",children:[(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"font-medium text-gray-900 text-sm truncate",children:t.name}),(0,f.jsxs)("div",{className:"flex items-center gap-3 mt-1 text-xs text-gray-500",children:[(0,f.jsxs)("span",{children:[null!==(s=null!==(a=t.itemCount)&&void 0!==a?a:null===(n=t.items)||void 0===n?void 0:n.length)&&void 0!==s?s:0," video",1!==(null!==(r=null!==(i=t.itemCount)&&void 0!==i?i:null===(o=t.items)||void 0===o?void 0:o.length)&&void 0!==r?r:0)?"s":""]}),(0,f.jsxs)("span",{className:"flex items-center gap-1",children:[(0,f.jsx)(_.A,{className:"h-3 w-3"}),t.viewCount||0," views"]}),t.expiresAt&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{children:"\u2022"}),(0,f.jsxs)("span",{children:["Expires ",Je(t.expiresAt)]})]})]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,f.jsxs)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-2.5 py-1.5 text-cyan-600 hover:text-cyan-700 hover:bg-cyan-50 rounded text-xs font-medium transition-colors",children:[(0,f.jsx)(En.A,{className:"h-3.5 w-3.5"}),"Open Bundle Link"]}),(0,f.jsxs)("button",{onClick:()=>((e,t)=>{_e({isOpen:!0,type:"bundle",shareLink:null,asset:null,bundle:e,project:t,selectedContacts:[],customEmails:[],customEmailInput:{name:"",email:""},customMessage:"",isSending:!1})})(t,e),className:"flex items-center gap-1 px-2 py-1.5 bg-cyan-50 hover:bg-cyan-100 text-cyan-700 rounded text-xs font-medium transition-colors",title:"Send bundle link to contacts",children:[(0,f.jsx)(st.A,{className:"h-3 w-3"}),"Send"]})]})]},t._id)})})]})]})]},e._id)}),M&&M.totalPages>1&&(0,f.jsxs)("div",{className:"flex items-center justify-center gap-3 pt-2",children:[(0,f.jsxs)("button",{onClick:()=>ze(G-1),disabled:G<=1||K,className:"flex items-center gap-1 px-3 py-2 rounded-xl border border-gray-200 text-sm font-medium text-gray-700 hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:[(0,f.jsx)(Vg.A,{className:"h-4 w-4"}),"Newer"]}),(0,f.jsxs)("span",{className:"text-sm text-gray-500",style:{fontFamily:"'Space Mono',monospace"},children:["Page ",M.page," of ",M.totalPages," ","(",M.totalProjects," project",1!==M.totalProjects?"s":"",")"]}),(0,f.jsxs)("button",{onClick:()=>ze(G+1),disabled:G>=M.totalPages||K,className:"flex items-center gap-1 px-3 py-2 rounded-xl border border-gray-200 text-sm font-medium text-gray-700 hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:["Older",(0,f.jsx)(rs.A,{className:"h-4 w-4"})]})]}),(0,f.jsx)("div",{className:"text-center pt-4",children:(0,f.jsxs)("a",{href:nf,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-xl font-medium transition-colors",children:["Open Turbo Reviews",(0,f.jsx)(En.A,{className:"h-4 w-4"})]})})]})]}),"galleries"===he&&(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"Photo Galleries"}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[Q&&Q.id&&(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsxs)("button",{onClick:()=>{se?re(""):(async()=>{try{const e=await fetch("".concat(af,"/galleries"),{headers:{Authorization:"Bearer ".concat(rf()),"Content-Type":"application/json"}});if(e.ok){const t=await e.json();
1te(t.galleries||[])}}catch(e){console.error("Error loading all galleries:",e)}})(),ae(!se)},className:"px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"Connect Gallery"]}),se&&(0,f.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-80 bg-white rounded-xl border border-gray-200 shadow-xl z-50 max-h-96 flex flex-col",children:[(0,f.jsx)("div",{className:"p-3 border-b border-gray-100",children:(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"}),(0,f.jsx)("input",{type:"text",placeholder:"Search galleries...",value:ne,onChange:e=>re(e.target.value),className:"w-full pl-9 pr-3 py-2 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-red-500 focus:border-transparent",autoFocus:!0})]})}),0===ee.length?(0,f.jsxs)("div",{className:"p-4 text-center",children:[(0,f.jsx)(Kr.A,{className:"h-5 w-5 animate-spin text-gray-400 mx-auto mb-2"}),(0,f.jsx)("p",{className:"text-sm text-gray-500",children:"Loading galleries..."})]}):(0,f.jsxs)("div",{className:"p-2 overflow-y-auto",children:[ee.filter(e=>!(Q.galleries||[]).some(t=>t.id===e.id)).filter(e=>!ne||e.name.toLowerCase().includes(ne.toLowerCase())).map(e=>(0,f.jsxs)("button",{onClick:()=>(async e=>{try{const t=await fetch("".concat(af,"/clients/").concat(A,"/galleries"),{method:"POST",headers:{Authorization:"Bearer ".concat(rf()),"Content-Type":"application/json"},body:JSON.stringify({galleryId:e})});if(t.ok)k.success("Gallery connected"),await De(A),ae(!1);else{const e=await t.json();k.error(e.detail||"Failed to connect gallery")}}catch(t){console.error("Error connecting gallery:",t),k.error("Failed to connect gallery")}})(e.id),className:"w-full text-left p-3 hover:bg-gray-50 rounded-lg transition-colors flex items-center gap-3",children:[e.featured_photo_thumbnail?(0,f.jsx)("img",{src:e.featured_photo_thumbnail,alt:"",className:"w-10 h-10 rounded-lg object-cover"}):(0,f.jsx)("div",{className:"w-10 h-10 rounded-lg bg-gray-100 flex items-center justify-center",children:(0,f.jsx)(Ue.A,{className:"h-5 w-5 text-gray-400"})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:e.name}),(0,f.jsxs)("p",{className:"text-xs text-gray-500",children:[e.photo_count," photos",e.event_date&&" \u2022 ".concat(new Date(e.event_date).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"}))]})]})]},e.id)),0===ee.filter(e=>!(Q.galleries||[]).some(t=>t.id===e.id)).filter(e=>!ne||e.name.toLowerCase().includes(ne.toLowerCase())).length&&(0,f.jsx)("p",{className:"text-sm text-gray-500 text-center py-4",children:ne?"No matching galleries found":"All galleries are already connected"})]})]})]}),Q&&!Q.id&&(0,f.jsxs)("button",{onClick:Ie,className:"px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(Jr.A,{className:"h-4 w-4"}),"Link to Galleries"]})]})]}),se&&(0,f.jsx)("div",{className:"fixed inset-0 z-40",onClick:()=>ae(!1)}),Q&&(Q.id||Q.galleries&&0!==Q.galleries.length)?0===(null===(i=Q.galleries)||void 0===i?void 0:i.length)?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(Jr.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-500",children:"No galleries connected yet"}),(0,f.jsx)("p",{className:"text-sm text-gray-400 mt-2",children:'Use the "Connect Gallery" button above to link galleries to this client.'})]}):(0,f.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Q.galleries.map(e=>(0,f.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl overflow-hidden hover:shadow-md transition-shadow",children:[(0,f.jsxs)("a",{href:e.share_url||e.simple_share_url||"#",target:"_blank",rel:"noopener noreferrer",className:"block aspect-video bg-gray-100 relative group cursor-pointer",children:[e.featured_photo_thumbnail?(0,f.jsx)("img",{src:e.featured_photo_thumbnail,alt:e.name,className:"w-full h-full object-cover group-hover:opacity-90 transition-opacity"}):(0,f.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,f.jsx)(Ue.A,{className:"h-12 w-12 text-gray-300 group-hover:text-gray-400 transition-colors"})}),(0,f.jsx)("div",{className:"absolute inset-0 bg-black/30 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,f.jsx)(En.A,{className:"h-8 w-8 text-white"})}),e.finalized&&(0,f.jsx)("div",{className:"absolute top-2 right-2",children:(0,f.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium bg-green-100 text-green-700",children:"Finalized"})})]}),(0,f.jsxs)("div",{className:"p-3",children:[(0,f.jsx)("p",{className:"font-medium text-gray-900 truncate",children:e.name}),(0,f.jsxs)("div",{className:"flex items-center gap-3 mt-1 text-xs text-gray-500",children:[(0,f.jsxs)("span",{children:[e.photo_count," photos"]}),e.event_date&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{children:"\u2022"}),(0,f.jsx)("span",{children:new Date(e.event_date).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"})})]})]}),(0,f.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[e.share_url&&(0,f.jsxs)("a",{href:e.share_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-red-600 hover:text-red-700 text-sm font-medium",children:[(0,f.jsx)(En.A,{className:"h-3.5 w-3.5"}),"Open Gallery"]}),E.length>0&&(0,f.jsxs)("button",{onClick:t=>{t.stopPropagation(),(e=>
1{_e({isOpen:!0,type:"gallery",shareLink:null,asset:null,bundle:null,project:null,gallery:e,selectedContacts:[],customEmails:[],customEmailInput:{name:"",email:""},customMessage:"",isSending:!1})})(e)},className:"flex items-center gap-1 px-2 py-1 bg-red-50 hover:bg-red-100 text-red-700 rounded text-xs font-medium transition-colors",title:"Send gallery link to contacts",children:[(0,f.jsx)(st.A,{className:"h-3 w-3"}),"Send"]}),(0,f.jsx)("button",{onClick:()=>(async e=>{if(window.confirm("Disconnect this gallery from the client?"))try{(await fetch("".concat(af,"/clients/").concat(A,"/galleries/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(rf()),"Content-Type":"application/json"}})).ok?(k.success("Gallery disconnected"),await De(A)):k.error("Failed to disconnect gallery")}catch(t){console.error("Error disconnecting gallery:",t),k.error("Failed to disconnect gallery")}})(e.id),className:"ml-auto flex items-center gap-1 px-2 py-1 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded text-xs transition-colors",title:"Disconnect gallery",children:(0,f.jsx)(g.A,{className:"h-3 w-3"})})]})]})]},e.id))}):(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)(Jr.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"Not Connected to Turbo IQ"}),(0,f.jsx)("p",{className:"text-gray-500 mb-4",children:"Link this company to Turbo IQ to manage photo galleries."}),(0,f.jsxs)("button",{onClick:Ie,className:"px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded-xl font-medium transition-colors inline-flex items-center gap-2",children:[(0,f.jsx)(Jr.A,{className:"h-4 w-4"}),"Link to Galleries"]})]}),(null===Q||void 0===Q?void 0:Q.id)&&(0,f.jsx)("div",{className:"text-center pt-4",children:(0,f.jsxs)("a",{href:"https://iq.turbo.net.au",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-xl font-medium transition-colors",children:["Open Turbo IQ",(0,f.jsx)(En.A,{className:"h-4 w-4"})]})})]}),"consent"===he&&(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-center",children:[(0,f.jsx)("h3",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16,color:"#0A0A0B"},children:"Consent Forms"}),(0,f.jsxs)("button",{onClick:()=>w("/admin/consent/create"),className:"px-4 py-2 bg-rose-600 hover:bg-rose-700 text-white rounded-xl font-medium transition-colors flex items-center gap-2",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"New Consent Project"]})]}),0===de.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-8 text-center",children:[(0,f.jsx)(Ue.A,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("h4",{className:"text-sm font-medium text-gray-700 mb-1",children:"No consent projects"}),(0,f.jsx)("p",{className:"text-xs text-gray-500",children:"Create an image consent project for this client."})]}):(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:de.map(e=>(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 hover:border-rose-200 hover:shadow-md transition-all p-4 cursor-pointer",onClick:()=>w("/admin/consent/".concat(e.id)),children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"font-semibold text-gray-900",children:e.project_name}),(0,f.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:[e.submission_count||0," submission",1!==(e.submission_count||0)?"s":""]})]}),(0,f.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat("active"===e.status?"bg-emerald-100 text-emerald-700":"bg-gray-100 text-gray-600"),children:"active"===e.status?"Active":"Archived"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:[(0,f.jsx)(et.A,{className:"h-3 w-3"}),(0,f.jsxs)("span",{className:"truncate",children:["turbo.net.au/consent/",e.public_url_slug]})]})]},e.id))})]}),"travel"===he&&Jg(S)&&(0,f.jsx)(yh,{company:S}),"jobrequests"===he&&Jg(S)&&(0,f.jsx)(xh,{company:S})]})]}),Se.isOpen&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl max-w-lg w-full max-h-[90vh] overflow-hidden",children:[(0,f.jsxs)("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"gallery"===Se.type?"Send Gallery Link":"bundle"===Se.type?"Send Bundle Link":"Send Video Review Link"}),(0,f.jsx)("p",{className:"text-sm text-gray-500",children:"gallery"===Se.type?"".concat(null===(l=Se.gallery)||void 0===l?void 0:l.name," \u2014 ").concat((null===(c=Se.gallery)||void 0===c?void 0:c.photo_count)||0," photos"):"bundle"===Se.type?"".concat(null===(d=Se.bundle)||void 0===d?void 0:d.name," \u2014 ").concat((null===(x=Se.bundle)||void 0===x||null===(h=x.items)||void 0===h?void 0:h.length)||0," video").concat(1!==((null===(u=Se.bundle)||void 0===u||null===(b=u.items)||void 0===b?void 0:b.length)||0)?"s":""):null===(y=Se.asset)||void 0===y?void 0:y.name})]}),(0,f.jsx)("button",{onClick:Oe,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-5 w-5 text-gray-500"})})]}),(0,f.jsxs)("div",{className:"p-4 overflow-y-auto max-h-[60vh]",children:[(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Select contacts to send to:"}),(0,f.jsxs)("div",{className:"space-y-2 max-h-48 overflow-y-auto border border-gray-200 rounded-lg p-2",children:[E.filter(e=>e.email).map(e=>{const t=Se.selectedContacts.some(t=>t.id===e.id);return(0,f.jsxs)("label",{className:"flex items-center gap-3 p-3 rounded-lg cursor-pointer transition-colors ".concat(t?"bg-cyan-50 border border-cyan-200":"bg-gray-50 hover:bg-gray-100 border border-transparent"),children:[(0,f.jsx)("input",{type:"checkbox",checked:t,onChange:()=>(e=>{_e(t=>{const s=t.selectedContacts.some(t=>t.id===e.id);return(0,m.A)((0,m.A)({},t),{},{selectedContacts:s?t.selectedContacts.filter(t=>t.id!==e.id):[...t.selectedContacts,e]})})})(e),className:"sr-only"}),(0,f.jsx)("div",{className:"w-5 h-5 rounded flex items-center justify-center ".concat(t?"bg-cyan-600":"bg-white border-2 border-gray-300"),children:t&&(0,f.jsx)(zt.A,{className:"h-3 w-3 text-white"})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"font-medium text-gray-900 text-sm",children:e.contact_name}),(0,f.jsx)("p",{className:"text-xs text-gray-500 truncate",children:e.email})]})]},e.id)}),0===E.filter(e=>e.email).length&&(0,f.jsx)("p",{className:"text-sm text-gray-500 text-center py-4",children:"No contacts with email addresses"})]})]}),(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Or add a custom email:"}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsx)("input",{type:"text",value:Se.customEmailInput.name,onChange:e=>_e(t=>(0,m.A)((0,m.A)({},t),{},{customEmailInput:(0,m.A)((0,m.A)({},t.customEmailInput),{},{name:e.target.value})})),placeholder:"Name (optional)",className:"flex-1 px-3 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-cyan-500 focus:border-cyan-500 text-sm"}),(0,f.jsx)("input",{type:"email",value:Se.customEmailInput.email,onChange:e=>_e(t=>(0,m.A)((0,m.A)({},t),{},{customEmailInput:(0,m.A)((0,m.A)({},t.customEmailInput),{},{email:e.target.value})})),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),Le())},placeholder:"Email address",className:"flex-1 px-3 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-cyan-500 focus:border-cyan-500 text-sm"}),(0,f.jsx)("button",{type:"button",onClick:Le,className:"px-3 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg font-medium transition-colors text-sm",children:"Add"})]}),Se.customEmails.length>0&&(0,f.jsx)("div",{className:"mt-2 space-y-1",children:Se.customEmails.map((e,t)=>(0,f.jsxs)("div",{className:"flex items-center justify-between bg-cyan-50 border border-cyan-200 rounded-lg px-3 py-2",children:[(0,f.jsxs)("div",{className:"min-w-0 flex-1",children:[e.name&&(0,f.jsx)("span",{className:"font-medium text-sm text-gray-900 mr-2",children:e.name}),(0,f.jsx)("span",{className:"text-sm text-gray-600",children:e.email})]}),(0,f.jsx)("button",{type:"button",onClick:()=>{return t=e.email,void _e(e=>(0,m.A)((0,m.A)({},e),{},{customEmails:e.customEmails.filter(e=>e.email!==t)}));var t},className:"ml-2 p-1 hover:bg-cyan-100 rounded transition-colors",children:(0,f.jsx)(g.A,{className:"h-4 w-4 text-gray-500"})})]},t))})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Custom message (optional):"}),(0,f.jsx)("textarea",{value:Se.customMessage,onChange:e=>_e(t=>(0,m.A)((0,m.A)({},t),{},{customMessage:e.target.value})),placeholder:"Add a personal message to include in the email...",rows:3,className:"w-full px-3 py-2 border border-gray-200 rounded-lg focus:ring-2 focus:ring-cyan-500 focus:border-cyan-500 text-sm resize-none"})]})]}),(0,f.jsxs)("div",{className:"p-4 border-t border-gray-200 flex items-center justify-between",children:[(0,f.jsxs)("p",{className:"text-sm text-gray-500",children:[Se.selectedContacts.length+Se.customEmails.length," recipient",Se.selectedContacts.length+Se.customEmails.length!==1?"s":""," selected"]}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsx)("button",{onClick:Oe,className:"px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-lg font-medium transition-colors",children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>
1{if(0!==Se.selectedContacts.length+Se.customEmails.length){_e(e=>(0,m.A)((0,m.A)({},e),{},{isSending:!0}));try{const e=[...Se.selectedContacts.map(e=>({email:e.email,name:e.contact_name})),...Se.customEmails.map(e=>({email:e.email,name:e.name||""}))];let t;t="gallery"===Se.type?"".concat(af,"/galleries/").concat(Se.gallery.id,"/send"):"bundle"===Se.type?"".concat(sf,"/share-bundles/").concat(Se.bundle._id,"/send"):"".concat(sf,"/share/").concat(Se.shareLink._id,"/send");const s=await fetch(t,{method:"POST",headers:{Authorization:"Bearer ".concat(rf()),"Content-Type":"application/json"},body:JSON.stringify({recipients:e,message:Se.customMessage||void 0,senderName:"Turbo 360"})});if(s.ok){const e=await s.json();k.success(e.message||"Share link sent successfully"),Oe()}else{const e=await s.json();k.error(e.error||"Failed to send share link")}}catch(e){console.error("Error sending share link:",e),k.error("Failed to send share link")}finally{_e(e=>(0,m.A)((0,m.A)({},e),{},{isSending:!1}))}}else k.error("Please select at least one contact or add a custom email")},disabled:0===Se.selectedContacts.length&&0===Se.customEmails.length||Se.isSending,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:Se.isSending?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kr.A,{className:"h-4 w-4 animate-spin"}),"Sending..."]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-4 w-4"}),"Send Email"]})})]})]})]})}),Ce.isOpen&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4 print:bg-white print:p-0",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl max-w-2xl w-full max-h-[90vh] overflow-hidden print:max-w-none print:max-h-none print:rounded-none print:shadow-none",children:[(0,f.jsxs)("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between print:border-b-2 print:border-gray-300",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Comments & Feedback"}),(0,f.jsxs)("p",{className:"text-sm text-gray-500",children:[null===(v=Ce.asset)||void 0===v?void 0:v.name," - Version ",null===(j=Ce.version)||void 0===j?void 0:j.version]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2 print:hidden",children:[(0,f.jsx)("button",{onClick:()=>{if(!document.getElementById("comments-print-content"))return;const e=window.open("","_blank");if(!e)return void alert("Please allow popups to print comments");const{asset:t,version:s,threads:a}=Ce;e.document.write("\n <!DOCTYPE html>\n <html>\n <head>\n <title>Comments - ".concat((null===t||void 0===t?void 0:t.name)||"Video","</title>\n <style>\n * { margin: 0; padding: 0; box-sizing: border-box; }\n body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; padding: 40px; color: #333; }\n .header { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 2px solid #e5e7eb; }\n .header h1 { font-size: 24px; margin-bottom: 5px; }\n .header p { color: #6b7280; font-size: 14px; }\n .thread { margin-bottom: 20px; padding: 15px; border: 1px solid #e5e7eb; border-radius: 8px; page-break-inside: avoid; }\n .thread-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }\n .timecode { background: #e0f2fe; color: #0369a1; padding: 4px 12px; border-radius: 20px; font-family: monospace; font-size: 14px; font-weight: 500; }\n .status { padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }\n .status.open { background: #fef3c7; color: #92400e; }\n .status.resolved { background: #d1fae5; color: #065f46; }\n .comment { padding-left: 15px; border-left: 3px solid #e5e7eb; margin-bottom: 10px; }\n .comment:last-child { margin-bottom: 0; }\n .comment-author { font-weight: 600; font-size: 14px; }\n .comment-date { color: #9ca3af; font-size: 12px; margin-left: 10px; }\n .comment-content { margin-top: 5px; font-size: 14px; line-height: 1.5; }\n .footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid #e5e7eb; color: #9ca3af; font-size: 12px; }\n </style>\n </head>\n <body>\n <div class=\"header\">\n <h1>Comments & Feedback</h1>\n <p>").concat((null===t||void 0===t?void 0:t.name)||"Video"," - Version ").concat((null===s||void 0===s?void 0:s.version)||"","</p>\n </div>\n ").concat(0===a.length?"<p>No comments on this version</p>":a.sort((e,t)=>
1e.timecode-t.timecode).map(e=>{var t;return'\n <div class="thread">\n <div class="thread-header">\n <span class="timecode">'.concat(Me(e.timecode),'</span>\n <span class="status ').concat(e.status,'">').concat("resolved"===e.status?"Resolved":"Open","</span>\n </div>\n ").concat((null===(t=e.comments)||void 0===t?void 0:t.map(e=>{var t;return'\n <div class="comment">\n <span class="comment-author">'.concat((null===(t=e.author)||void 0===t?void 0:t.name)||e.authorName||"Guest",'</span>\n <span class="comment-date">').concat(e.createdAt?new Date(e.createdAt).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}):"",'</span>\n <p class="comment-content">').concat(e.content,"</p>\n </div>\n ")}).join(""))||"","\n </div>\n ")}).join(""),'\n <div class="footer">\n <p>Printed from Turbo 360 - ').concat((new Date).toLocaleDateString("en-AU",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}),"</p>\n </div>\n </body>\n </html>\n ")),e.document.close(),e.focus(),setTimeout(()=>{e.print(),e.close()},250)},className:"p-2 hover:bg-gray-100 rounded-lg transition-colors text-gray-600",title:"Print comments",children:(0,f.jsx)(Sr.A,{className:"h-5 w-5"})}),(0,f.jsx)("button",{onClick:()=>{Fe({isOpen:!1,asset:null,version:null,threads:[]})},className:"p-2 hover:bg-gray-100 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-5 w-5 text-gray-500"})})]})]}),(0,f.jsx)("div",{className:"p-4 overflow-y-auto max-h-[70vh] print:max-h-none print:overflow-visible",children:Ce.loading?(0,f.jsxs)("div",{className:"text-center py-8 text-gray-500",children:[(0,f.jsx)(Kr.A,{className:"h-8 w-8 mx-auto mb-3 animate-spin text-cyan-600"}),(0,f.jsx)("p",{children:"Loading comments\u2026"})]}):0===Ce.threads.length?(0,f.jsxs)("div",{className:"text-center py-8 text-gray-500",children:[(0,f.jsx)(Fn.A,{className:"h-12 w-12 mx-auto mb-3 opacity-30"}),(0,f.jsx)("p",{children:"No comments on this version"})]}):(0,f.jsx)("div",{className:"space-y-4",children:Ce.threads.sort((e,t)=>e.timecode-t.timecode).map((e,t)=>{var s;return(0,f.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 print:break-inside-avoid",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,f.jsx)("span",{className:"px-3 py-1 bg-cyan-100 text-cyan-700 rounded-full text-sm font-mono font-medium",children:Me(e.timecode)}),(0,f.jsx)("span",{className:"px-2 py-0.5 rounded text-xs font-medium ".concat("resolved"===e.status?"bg-green-100 text-green-700":"bg-orange-100 text-orange-700"),children:"resolved"===e.status?"Resolved":"Open"})]}),null===(s=e.comments)||void 0===s?void 0:s.map((e,t)=>{var s;return(0,f.jsxs)("div",{className:"mb-3 last:mb-0 pl-4 border-l-2 border-gray-200",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,f.jsx)("span",{className:"font-medium text-gray-900 text-sm",children:(null===(s=e.author)||void 0===s?void 0:s.name)||e.authorName||e.guestName||"Guest"}),(0,f.jsx)("span",{className:"text-xs text-gray-400",children:e.createdAt?new Date(e.createdAt).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}):""})]}),(0,f.jsx)("p",{className:"text-gray-700 text-sm whitespace-pre-wrap",children:e.content})]},e._id||t)})]},e._id||t)})})}),(0,f.jsx)("div",{className:"hidden print:block p-4 border-t border-gray-300 text-xs text-gray-500",children:(0,f.jsxs)("p",{children:["Printed from Turbo 360 - ",(new Date).toLocaleDateString("en-AU",{day:"numeric",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"})]})})]})})]})},cf="'Space Mono',monospace",df={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},mf="1.5fr 1.4fr 150px 150px 80px",pf=["#BF212F","#4338CA","#0FA3A3","#B45309","#7C3AED","#0891B2","#64748B"],xf=function(){return pf[((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").charCodeAt(0)||0)%pf.length]};const hf=function(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)([]),[o,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)(""),p=async()=>{try{const e=localStorage.getItem("turbo360_admin_auth");if(!e)return void console.error("No admin auth found");const{token:t}=JSON.parse(e),a=await fetch("".concat(I.JR,"/api/crew"),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){const e=await a.json();s(e),i(e)}}catch(e){console.error("Error fetching crew:",e)}finally{l(!1)}};return(0,a.useEffect)(()=>{p()},[]),(0,a.useEffect)(()=>{i(c?t.filter(e=>{var t,s,a;return(null===(t=e.first_name)||void 0===t?void 0:t.toLowerCase().includes(c.toLowerCase()))||(null===(s=e.last_name)||void 0===s?void 0:s.toLowerCase().includes(c.toLowerCase()))||(null===(a=e.email)||void 0===a?void 0:a.toLowerCase().includes(c.toLowerCase()))}):t)},[c,t]),(0,f.jsx)(ta,{title:"Crew",meta:"EVENTS \xb7 CREW",action:{label:"Add Crew",to:"/admin/crew/create"},children:(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},df),{},{overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 18px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:200},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{value:c,onChange:e=>d(e.target.value),placeholder:"Search crew by name or email\u2026",style:{border:"none",background:"transparent",outline:"none",fontSize:13,width:"100%"}})]})}),(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:mf,gap:12,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:cf,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Name"}),(0,f.jsx)("span",{children:"Email"}),(0,f.jsx)("span",{children:"Mobile"}),(0,f.jsx)("span",{children:"Shootzu"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Actions"})]}),o?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:6})}):0===n.length?(0,f.jsx)(Os,{icon:Xe.A,title:"No crew members found",message:c?"Try adjusting your search.":"Get started by adding your first crew member.",actionLabel:c?void 0:"Add Crew Member",onAction:()=>e("/admin/crew/create")}):n.map(t=>{const s="".concat(t.first_name||""," ").concat(t.last_name||"").trim();return(0,f.jsxs)("div",{className:"tg-row",style:{display:"grid",gridTemplateColumns:mf,gap:12,alignItems:"center",padding:"14px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer"},onClick:()=>e("/admin/crew/".concat(t.id)),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11,minWidth:0},children:[t.photo_url?(0,f.jsx)("img",{src:t.photo_url,alt:"",style:{width:34,he
1ight:34,borderRadius:9,objectFit:"cover",flexShrink:0}}):(0,f.jsx)("span",{style:{width:34,height:34,borderRadius:9,background:xf(s),color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:12,flexShrink:0},children:Ms(s)}),(0,f.jsx)("div",{style:{minWidth:0},children:(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s||"\u2014"})})]}),(0,f.jsx)("span",{style:{fontSize:13,color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:t.email}),(0,f.jsx)("span",{style:{fontFamily:cf,fontSize:12.5,color:"#55555C"},children:t.mobile_number||"\u2014"}),(0,f.jsx)("span",{style:{fontFamily:cf,fontSize:11,letterSpacing:"0.06em",whiteSpace:"nowrap",color:t.shootzu_user_id?"#15803D":"#9A9AA0"},children:t.shootzu_user_id?"LINKED":"NOT LINKED"}),(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:6},children:[(0,f.jsx)("button",{onClick:()=>e("/admin/crew/".concat(t.id)),title:"Edit",style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",padding:4,display:"flex"},children:(0,f.jsx)(Tn.A,{size:16})}),(0,f.jsx)("button",{onClick:()=>(async(e,t)=>{if(window.confirm('Delete crew member "'.concat(t,'"?')))try{const t=localStorage.getItem("turbo360_admin_auth");if(!t)return;const{token:s}=JSON.parse(t);(await fetch("".concat(I.JR,"/api/crew/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}})).ok?p():alert("Failed to delete crew member")}catch(s){console.error("Error deleting crew:",s),alert("Error deleting crew member")}})(t.id,s),title:"Delete",style:{background:"none",border:"none",color:"#B5B5BC",cursor:"pointer",padding:4,display:"flex"},children:(0,f.jsx)(la.A,{size:16})})]})]},t.id)}),!o&&n.length>0&&(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 22px",borderTop:"1px solid #EDEDF0"},children:(0,f.jsxs)("span",{style:{fontFamily:cf,fontSize:11.5,color:"#9A9AA0"},children:["SHOWING ",n.length," OF ",t.length," CREW"]})})]})})},uf=()=>{const e=(0,r.Zp)(),t=(0,I.wE)(),[s,n]=(0,a.useState)(""),[i,o]=(0,a.useState)(""),[l,c]=(0,a.useState)(!1),[d,p]=(0,a.useState)([]),[x,h]=(0,a.useState)(0),[u,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),w=(0,a.useRef)(null),N=(0,a.useRef)(null);(0,a.useEffect)(()=>{(()=>{var e;null===(e=w.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})})()},[d]);const A=function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=(0,m.A)({timestamp:(new Date).toISOString(),level:e,message:t},s);p(e=>[...e,a])},k=e=>{switch(e){case"success":return"text-green-400";case"error":return"text-red-400";case"warning":return"text-yellow-400";case"info":return"text-blue-400";case"progress":return"text-purple-400";default:return"text-gray-300"}},S=e=>{switch(e){case"success":return"\u2705";case"error":return"\u274c";case"warning":return"\u26a0\ufe0f";case"info":return"\u2139\ufe0f";case"progress":return"\ud83d\udcca";default:return"\u2022"}};return(0,f.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-gray-900 via-gray-800 to-gray-900 p-6",children:(0,f.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h1",{className:"text-3xl font-bold text-white mb-2",children:"Database Migration"}),(0,f.jsx)("p",{className:"text-gray-400",children:"Migrate your database to a new MongoDB instance"})]}),(0,f.jsx)("button",{onClick:()=>e("/tboadmin"),className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-white rounded-lg transition-colors",children:"\u2190 Back to Dashboard"})]}),(0,f.jsxs)("div",{className:"bg-gray-800 rounded-lg shadow-xl p-6 mb-6",children:[(0,f.jsx)("h2",{className:"text-xl font-semibold text-white mb-4",children:"Migration Configuration"}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Target MongoDB URL *"}),(0,f.jsx)("input",{type:"text",value:s,onChange:e=>n(e.target.value),placeholder:"mongodb+srv://username:[email protected]/",className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-blue-500",disabled:l,style:{color:"#ffffff",WebkitTextFillColor:"#ffffff"}})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-300 mb-2",children:"Target Database Name (optional)"}),(0,f.jsx)("input",{type:"text",value:i,onChange:e=>o(e.target.value),placeholder:"Leave empty to use current database name",className:"w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-blue-500",disabled:l,style:{color:"#ffffff",WebkitTextFillColor:"#ffffff"}})]}),v&&(0,f.jsxs)("div",{className:"p-4 rounded-lg ".concat(v.success?"bg-green-900/20 border border-green-500":"bg-red-900/20 border border-red-500"),children:[(0,f.jsx)("p",{className:v.success?"text-green-400":"text-red-400",children:v.message}),v.success&&v.existing_collections>0&&(0,f.jsxs)("p",{className:"text-yellow-400 text-sm mt-2",children:["\u26a0\ufe0f Warning: Target has ",v.existing_collections," collections that will be overwritten"]})]}),(0,f.jsxs)("div",{className:"flex gap-4",children:[(0,f.jsx)("button",{onClick:async()=>
1{if(s.trim()){y(!0),j(null);try{const e=await fetch("".concat(t,"/api/admin/database/test-connection"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target_mongo_url:s,target_db_name:i||null})}),a=await e.json();j(a),a.success?(A("success","\u2705 Connection successful! Database: ".concat(a.database)),a.existing_collections>0&&A("warning","\u26a0\ufe0f Target database has ".concat(a.existing_collections," existing collections (will be overwritten)"))):A("error","\u274c ".concat(a.message))}catch(e){A("error","\u274c Connection test failed: ".concat(e.message)),j({success:!1,message:e.message})}finally{y(!1)}}else A("error","Please enter a MongoDB URL")},disabled:l||b||!s,className:"flex-1 px-6 py-3 bg-blue-600 hover:bg-blue-700 disabled:bg-gray-600 disabled:cursor-not-allowed text-white rounded-lg font-medium transition-colors flex items-center justify-center gap-2",children:b?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin h-5 w-5 border-2 border-white border-t-transparent rounded-full"}),"Testing..."]}):(0,f.jsx)(f.Fragment,{children:"\ud83d\udd0d Test Connection"})}),(0,f.jsx)("button",{onClick:l?()=>{N.current&&N.current.close(),c(!1),A("warning","\u26a0\ufe0f Migration cancelled by user")}:async()=>{if(s.trim())if(v&&v.success){c(!0),g(!1),h(0),p([]);try{A("info","\ud83d\ude80 Starting database migration...");const a=await fetch("".concat(t,"/api/admin/database/migrate"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target_mongo_url:s,target_db_name:i||null})});if(!a.ok)throw new Error("HTTP error! status: ".concat(a.status));const n=a.body.getReader(),r=new TextDecoder;for(;;){const{value:t,done:s}=await n.read();if(s)break;const a=r.decode(t).split("\n");for(const n of a)if(n.startsWith("data: "))try{const e=JSON.parse(n.substring(6));p(t=>[...t,e]),void 0!==e.progress&&h(e.progress),"complete"===e.level&&(g(!0),c(!1))}catch(e){console.error("Error parsing log:",e)}}}catch(e){A("error","\u274c Migration failed: ".concat(e.message)),c(!1)}}else A("error","Please test the connection first");else A("error","Please enter a MongoDB URL")},disabled:!(null!==v&&void 0!==v&&v.success)||b,className:"flex-1 px-6 py-3 ".concat(l?"bg-red-600 hover:bg-red-700":"bg-green-600 hover:bg-green-700"," disabled:bg-gray-600 disabled:cursor-not-allowed text-white rounded-lg font-medium transition-colors flex items-center justify-center gap-2"),children:l?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin h-5 w-5 border-2 border-white border-t-transparent rounded-full"}),"Cancel Migration"]}):(0,f.jsx)(f.Fragment,{children:"\ud83d\ude80 Start Migration"})})]})]})]}),l&&(0,f.jsxs)("div",{className:"bg-gray-800 rounded-lg shadow-xl p-6 mb-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,f.jsx)("span",{className:"text-sm font-medium text-gray-300",children:"Migration Progress"}),(0,f.jsxs)("span",{className:"text-sm font-medium text-gray-300",children:[x,"%"]})]}),(0,f.jsx)("div",{className:"w-full bg-gray-700 rounded-full h-3 overflow-hidden",children:(0,f.jsx)("div",{className:"bg-gradient-to-r from-blue-500 to-green-500 h-full transition-all duration-500 ease-out",style:{width:"".concat(x,"%")}})})]}),(0,f.jsxs)("div",{className:"bg-gray-800 rounded-lg shadow-xl p-6",children:[(0,f.jsx)("h2",{className:"text-xl font-semibold text-white mb-4",children:"Migration Logs"}),(0,f.jsx)("div",{className:"bg-gray-900 rounded-lg p-4 h-96 overflow-y-auto font-mono text-sm",children:0===d.length?(0,f.jsx)("p",{className:"text-gray-500 text-center py-8",children:"No logs yet. Configure and start migration to see progress."}):(0,f.jsxs)("div",{className:"space-y-1",children:[d.map((e,t)=>(0,f.jsxs)("div",{className:"flex gap-3",children:[(0,f.jsx)("span",{className:"text-gray-500 text-xs",children:new Date(e.timestamp).toLocaleTimeString()}),(0,f.jsxs)("span",{className:k(e.level),children:[S(e.level)," ",e.message]})]},t)),(0,f.jsx)("div",{ref:w})]})}),u&&(0,f.jsx)("div",{className:"mt-4 p-4 bg-green-900/20 border border-green-500 rounded-lg",children:(0,f.jsx)("p",{className:"text-green-400 font-medium",children:"\u2705 Migration completed! Remember to update your application configuration to use the new database."})})]})]})})},gf={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},ff={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"};const bf=function(){const e=(0,r.Zp)(),{crewId:t}=(0,r.g)(),s=!!t,[n,i]=(0,a.useState)({first_name:"",last_name:"",email:"",mobile_number:""}),[o,l]=(0,a.useState)(s),[c,d]=(0,a.useState)(!1),[p,x]=(0,a.useState)("");(0,a.useEffect)(()=>{s&&h()},[t]);const h=async()=>{try{const e=localStorage.getItem("turbo360_admin_auth");if(!e)return;const{token:s}=JSON.parse(e),a=await fetch("".concat(I.JR,"/api/crew/").concat(t),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const e=await a.json();i(e)}}catch(p){console.error("Error fetching crew:",p)}finally{l(!1)}},u=e=>{const{name:t,value:s}=e.target;i(e=>(0,m.A)((0,m.A)({},e),{},{[t]:s}))};return o?(0,f.jsx)(ta,{title:"Edit Crew",meta:"EVENTS \xb7 CREW",children:(0,f.jsx)("div",{style:{maxWidth:560},children:(0,f.jsx)(Ws,{rows:6})})}
1):(0,f.jsx)(ta,{title:s?"Edit Crew":"New Crew",meta:"EVENTS \xb7 CREW",children:(0,f.jsxs)("div",{style:{maxWidth:560},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>e("/admin/crew"),style:{display:"inline-flex",alignItems:"center",gap:7,fontSize:13,fontWeight:600,color:"#55555C",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{size:15})," Crew"]}),(0,f.jsx)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:s?"Edit Crew Member":"New Crew Member"}),(0,f.jsx)("div",{style:{marginLeft:"auto"},children:(0,f.jsxs)("button",{type:"submit",form:"crew-form",disabled:c,className:"tg-btn-primary",style:{display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",opacity:c?.6:1},children:[(0,f.jsx)(ia.A,{size:15})," ",c?"Saving\u2026":s?"Save crew":"Create crew"]})})]}),p&&(0,f.jsx)("div",{style:{background:"#FEE2E2",border:"1px solid #FECACA",borderRadius:11,padding:"12px 14px",color:"#991B1B",fontSize:13,fontWeight:500,marginBottom:16},children:p}),(0,f.jsx)("form",{id:"crew-form",onSubmit:async a=>{a.preventDefault(),x(""),d(!0);try{const a=localStorage.getItem("turbo360_admin_auth");if(!a)return x("Not authenticated"),void d(!1);const{token:r}=JSON.parse(a),i=s?"".concat(I.JR,"/api/crew/").concat(t):"".concat(I.JR,"/api/crew"),o=await fetch(i,{method:s?"PUT":"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)},body:JSON.stringify(n)});if(o.ok)e("/admin/crew");else{const e=await o.json();x(e.detail||"Failed to save crew member")}}catch(p){console.error("Error saving crew:",p),x("An error occurred while saving")}finally{d(!1)}},children:(0,f.jsxs)(Ls,{style:{padding:22},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15,marginBottom:16},children:"Crew details"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:gf,children:"First name *"}),(0,f.jsx)("input",{type:"text",name:"first_name",value:n.first_name,onChange:u,required:!0,style:ff})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:gf,children:"Last name *"}),(0,f.jsx)("input",{type:"text",name:"last_name",value:n.last_name,onChange:u,required:!0,style:ff})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:gf,children:"Email * (used to log in)"}),(0,f.jsx)("input",{type:"email",name:"email",value:n.email,onChange:u,required:!0,style:ff})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:gf,children:"Mobile number"}),(0,f.jsx)("input",{type:"tel",name:"mobile_number",value:n.mobile_number,onChange:u,style:ff})]})]})]})})]})})};var yf=s(69698);const vf=function(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)(""),[n,i]=(0,a.useState)(!1),[o,l]=(0,a.useState)("");return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d.mg,{children:(0,f.jsx)("title",{children:"Crew Login - Turbo 360"})}),(0,f.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-purple-900/20 to-slate-900 flex items-center justify-center p-6",children:(0,f.jsxs)("div",{className:"w-full max-w-md",children:[(0,f.jsxs)("div",{className:"text-center mb-8",children:[(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-16 w-auto mx-auto mb-6 brightness-0 invert"}),(0,f.jsx)("h1",{className:"text-3xl font-bold text-white mb-2",children:"Crew Portal"}),(0,f.jsx)("p",{className:"text-purple-200",children:"Enter your email to access your schedule"})]}),(0,f.jsxs)("form",{onSubmit:async s=>{s.preventDefault(),l(""),i(!0);try{const s=await fetch("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL,"/api/crew/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t.trim().toLowerCase()})}),a=await s.json();s.ok&&a.success?(sessionStorage.setItem("turbo360_crew_token",a.token),sessionStorage.setItem("turbo360_crew_data",JSON.stringify(a.crew)),e("/crew/dashboard")):l(a.detail||"Login failed. Please check your email.")}catch(a){console.error("Login error:",a),l("An error occurred. Please try again.")}finally{i(!1)}},className:"bg-white/10 backdrop-blur-xl rounded-2xl p-8 border border-white/20 shadow-2xl",children:[o&&(0,f.jsx)("div",{className:"mb-6 p-4 bg-red-500/20 backdrop-blur-sm border border-red-500/30 rounded-xl text-red-200 text-sm",children:o}),(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("label",{className:"block text-white text-sm font-semibold mb-2",children:"Email Address"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(T.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,f.jsx)("input",{type:"email",value:t,onChange:e=>s(e.target.value),className:"w-full pl-10 pr-4 py-3 bg-slate-900/50 backdrop-blur-sm border border-white/20 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-purple-400 focus:border-transparent transition-all",placeholder:"[email protected]",required:!0})]}),(0,f.jsx)("p",{className:"mt-2 text-sm text-purple-200",children:"Use the email address provided by your admin"})]}),(0,f.jsx)("button",{type:"submit",disabled:n,className:"w-full bg-gradient-to-r from-purple-600 to-indigo-600 text-white py-4 rounded-xl font-bold text-lg hover:from-purple-700 hover:to-indigo-700 transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-2xl flex items-center justify-center gap-2",children:n?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white"}),"Signing in..."]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(yf.A,{className:"w-5 h-5"}),"Access My Schedule"]})})]}),(0,f.jsx)("div",{className:"mt-6 text-center",children:(0,f.jsx)("p",{className:"text-purple-200 text-sm",children:"Need help? Contact your event coordinator"})})]})})]})};const jf=function(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)(""),[o,l]=(0,a.useState)(!0),[c,m]=(0,a.useState)(!1);(0,a.useEffect)(()=>{p(),x()},[]);const p=()=>{const t=sessionStorage.getItem("turbo360_crew_token"),s=sessionStorage.getItem("turbo360_crew_data");if(t){if(s){const e=JSON.parse(s);i("".concat(e.first_name," ").concat(e.last_name))}}else e("/crew/login")},x=async()=>{try{const t=sessionStorage.getItem("turbo360_crew_token"),a=await fetch("".concat({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_BACKEND_URL,"/api/crew/dashboard/runsheets"),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){const e=await a.json();s(e.runsheets||[]),e.crew_name&&i(e.crew_name)}else 401===a.status&&e("/crew/login")}catch(t){console.error("Error fetching runsheets:",t)}finally{l(!1),m(!1)}};return o?(0,f.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-purple-900/20 to-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-4 border-purple-500/30 border-t-purple-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-400",children:"Loading your schedule..."})]})}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(d.mg,{children:(0,f.jsx)("title",{children:"My Schedule - Crew Portal - Turbo 360"})}),(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-purple-900/20 to-slate-900 pb-24",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-purple-600 to-indigo-600 text-white p-6 pb-8",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("h1",{className:"text-2xl font-bold",children:["Welcome, ",n]}),(0,f.jsx)("p",{className:"text-purple-200 text-sm",children:"Your upcoming events"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("button",{onClick:()=>{m(!0),x()}
1,disabled:c,className:"p-2 bg-white/20 rounded-full hover:bg-white/30 transition-all",children:(0,f.jsx)(As.A,{className:"w-5 h-5 ".concat(c?"animate-spin":"")})}),(0,f.jsx)("button",{onClick:()=>{window.confirm("Are you sure you want to logout?")&&(sessionStorage.removeItem("turbo360_crew_token"),sessionStorage.removeItem("turbo360_crew_data"),e("/crew/login"))},className:"p-2 bg-white/20 rounded-full hover:bg-white/30 transition-all",children:(0,f.jsx)(is.A,{className:"w-5 h-5"})})]})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,f.jsxs)("div",{className:"bg-white/10 rounded-xl p-4 backdrop-blur-sm",children:[(0,f.jsx)("div",{className:"text-3xl font-bold",children:t.length}),(0,f.jsx)("div",{className:"text-sm text-purple-200",children:"Upcoming Events"})]}),(0,f.jsxs)("div",{className:"bg-white/10 rounded-xl p-4 backdrop-blur-sm",children:[(0,f.jsx)("div",{className:"text-3xl font-bold",children:t.filter(e=>{const t=new Date(e.event_date),s=new Date;return t.toDateString()===s.toDateString()}).length}),(0,f.jsx)("div",{className:"text-sm text-purple-200",children:"Today"})]})]})]}),(0,f.jsx)("div",{className:"p-4 space-y-3 -mt-4",children:0===t.length?(0,f.jsxs)("div",{className:"bg-slate-800 rounded-xl p-8 text-center",children:[(0,f.jsx)(_t.A,{className:"w-16 h-16 text-gray-400 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-xl text-gray-300 mb-2",children:"No upcoming events"}),(0,f.jsx)("p",{className:"text-gray-500",children:"You'll see your scheduled events here"})]}):t.map(e=>(0,f.jsxs)("div",{className:"bg-slate-800 rounded-xl p-4 shadow-lg",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h3",{className:"font-semibold text-white text-lg mb-1",children:e.event_name}),e.client_company&&(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:e.client_company})]}),e.my_role&&(0,f.jsx)("span",{className:"px-3 py-1 rounded-full text-xs font-semibold bg-purple-500/20 text-purple-400 border border-purple-500/30",children:e.my_role})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[e.event_date&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(_t.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{children:new Date(e.event_date).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]}),e.event_time&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(Nt.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{children:e.event_time})]}),e.venue&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(C.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{children:e.venue})]}),e.crew_members&&e.crew_members.length>0&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(Xe.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsxs)("span",{children:[e.crew_members.length," crew members"]})]})]}),e.notes&&(0,f.jsx)("div",{className:"mt-3 pt-3 border-t border-slate-700",children:(0,f.jsxs)("div",{className:"flex items-start gap-2 text-sm text-gray-400",children:[(0,f.jsx)(kt.A,{className:"w-4 h-4 flex-shrink-0 mt-0.5"}),(0,f.jsx)("p",{className:"flex-1",children:e.notes})]})})]},e.id))})]})]})},wf="'Space Mono',monospace",Nf={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Af="100px 1.6fr 1.25fr 78px 104px 116px 110px 40px",kf=["#0A0A0B","#4338CA","#0FA3A3","#BF212F","#7C3AED","#0891B2"],Sf=function(){return kf[((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").charCodeAt(0)||0)%kf.length]},_f=()=>{const e=(0,r.Zp)(),{toast:t}=N(),[s]=(0,r.ok)(),n=s.get("company_id")||"",i=s.get("company")||"this client",[l,c]=(0,a.useState)([]),[d,x]=(0,a.useState)(!0),[h,u]=(0,a.useState)(""),[g,b]=(0,a.useState)(""),[y,j]=(0,a.useState)(()=>new URLSearchParams(window.location.search).get("company_id")?"all":"active"),[w,A]=(0,a.useState)("created_at"),[k,S]=(0,a.useState)({page:1,page_size:20,total_count:0,total_pages:1}),[C,F]=(0,a.useState)({total:0,draft:0,sent:0,paid:0,overdue:0,totalRevenue:0,outstanding:0}),[E,T]=(0,a.useState)(!1),[z,B]=(0,a.useState)(null);(0,a.useEffect)(()=>{(async()=>{await(0,o.cd)()?T(!0):e("/admin")})()},[e]),(0,a.useEffect)(()=>{const e=setTimeout(()=>b(h),300);return()=>clearTimeout(e)},[h]),(0,a.useEffect)(()=>{E&&(async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/invoices/stats"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();F(e.stats)}}catch(t){console.error("Error loading invoice stats:",t)}})()},[E]);const D=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;x(!0);try{var s;const t=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,a=new URLSearchParams({page:String(e),page_size:"20",sort_by:w,sort_dir:"due_date"===w?"asc":"desc"});y&&"all"!==y&&a.set("status",y),g&&a.set("search",g),n&&a.set("company_id",n);const r=await fetch("".concat(I.fn,"/api/invoices?").concat(a),{headers:{Authorization:"Bearer ".concat(t)}});if(r.ok){const e=await r.json();c(e.invoices||[]),S(e.pagination||{page:1,page_size:20,total_count:0,total_pages:1})}}catch(a){console.error("Error loading invoices:",a),t.error("Failed to load invoices")}finally{x(!1)}};(0,a.useEffect)(()=>{E&&D(1)},[g,y,w,E,n]);const R=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:2}).format(e||0),P=e=>{if(!e)return"\u2014";try{return new Date(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short"})}catch(t){return e}};return(0,f.jsxs)(ta,{title:"Invoices",meta:"FINANCE \xb7 INVOICES",action:{label:"New Invoice",to:"/admin/invoices/create"},children:[(0,f.jsxs)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:16,marginBottom:20},children:[(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Nf),{},{padding:18}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[(0,f.jsx)("span",{style:{fontFamily:wf,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0"},children:"TOTAL INVOICES"}),(0,f.jsx)("span",{style:{width:28,height:28,borderRadius:8,background:"#EDEDF0",color:"#55555C",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(kt.A,{size:15})})]}),(0,f.jsx)("div",{style:{fontFamily:wf,fontWeight:700,fontSize:28,letterSpacing:"-0.03em",lineHeight:1},children:C.total}),(0,f.jsx)("div",{style:{marginTop:10,fontSize:12,color:"#9A9AA0"},children:"all invoices"})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Nf),{},{padding:18,position:"relative",overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{position:"absolute",right:-18,top:-18,width:84,height:84,borderRadius:"50%",background:"rgba(34,197,94,.07)"}}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[(0,f.jsx)("span",{style:{fontFamily:wf,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0"},children:"PAID"}),(0,f.jsx)("span",{style:{width:28,height:28,borderRadius:8,background:"rgba(34,197,94,.12)",color:"#16A34A",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(p.A,{size:15})})]}),(0,f.jsx)(zs,{amount:C.totalRevenue,size:28,mutedSize:15}),(0,f.jsxs)("div",{style:{marginTop:10,fontSize:12,color:"#16A34A",fontWeight:600},children:[C.paid," invoices settled"]})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Nf),{},{padding:18}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[(0,f.jsx)("span",{style:{fontFamily:wf,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0"}
1,children:"OUTSTANDING"}),(0,f.jsx)("span",{style:{width:28,height:28,borderRadius:8,background:"rgba(242,169,0,.14)",color:"#B45309",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(Nt.A,{size:15})})]}),(0,f.jsx)(zs,{amount:C.outstanding,size:28,mutedSize:15}),(0,f.jsx)("div",{style:{marginTop:10,fontSize:12,color:"#9A9AA0"},children:"awaiting payment"})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Nf),{},{border:"1px solid #FECACA",padding:18,position:"relative",overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{position:"absolute",right:-18,top:-18,width:84,height:84,borderRadius:"50%",background:"rgba(220,38,38,.06)"}}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[(0,f.jsx)("span",{style:{fontFamily:wf,fontSize:10.5,letterSpacing:"0.16em",color:"#991B1B"},children:"OVERDUE"}),(0,f.jsx)("span",{style:{width:28,height:28,borderRadius:8,background:"#FEE2E2",color:"#991B1B",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(v.A,{size:15})})]}),(0,f.jsx)("div",{style:{fontFamily:wf,fontWeight:700,fontSize:28,letterSpacing:"-0.03em",lineHeight:1,color:"#991B1B"},children:C.overdue}),(0,f.jsx)("div",{style:{marginTop:10,fontSize:12,color:"#991B1B",fontWeight:600},children:"need attention"})]})]}),n&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Nf),{},{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",marginBottom:14,background:"#FFF7ED",borderColor:"#FED7AA",flexWrap:"wrap"}),children:[(0,f.jsx)("span",{style:{fontFamily:wf,fontSize:10,fontWeight:700,letterSpacing:".16em",color:"#9A3412"},children:"FILTERED"}),(0,f.jsxs)("span",{style:{fontSize:13,color:"#7C2D12",flex:1,minWidth:180},children:["Showing invoices for ",(0,f.jsx)("strong",{children:i})," only. The tiles above still count every client."]}),(0,f.jsx)("button",{onClick:()=>e("/admin/invoices"),style:{background:"#fff",border:"1px solid #FED7AA",borderRadius:8,padding:"6px 11px",fontSize:12.5,fontWeight:600,color:"#9A3412",cursor:"pointer"},children:"Show all invoices"})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Nf),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 18px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:200},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{value:h,onChange:e=>u(e.target.value),placeholder:"Search by #, client, project or PO\u2026",style:{border:"none",background:"transparent",outline:"none",fontSize:13,width:"100%"}})]}),(0,f.jsxs)("select",{value:y,onChange:e=>j(e.target.value),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)("option",{value:"active",children:"Status: Active"}),(0,f.jsx)("option",{value:"all",children:"All Statuses"}),["Draft","Scheduled","Sent","Paid","Overdue","Partially Paid","Cancelled"].map(e=>(0,f.jsx)("option",{value:e,children:e},e))]}),(0,f.jsxs)("select",{value:w,onChange:e=>A(e.target.value),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)("option",{value:"created_at",children:"Sort: Newest"}),(0,f.jsx)("option",{value:"due_date",children:"Due date"}),(0,f.jsx)("option",{value:"total",children:"Amount"})]}),(0,f.jsxs)("button",{onClick:()=>D(k.page),style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(As.A,{size:14})," Refresh"]}),(0,f.jsxs)("button",{onClick:()=>e("/admin/invoices/recurring"),style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(Nt.A,{size:14})," Recurring"]})]}),(0,f.jsxs)("div",{className:"tg-leadrow tg-booking-meta",style:{gridTemplateColumns:Af,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:wf,fontSize:10,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Invoice #"}),(0,f.jsx)("span",{children:"Client"}),(0,f.jsx)("span",{children:"Project"}),(0,f.jsx)("span",{children:"Sent"}),(0,f.jsx)("span",{children:"Due"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Amount"}),(0,f.jsx)("span",{children:"Status"}),(0,f.jsx)("span",{})]}),d&&0===l.length?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:8})}):0===l.length?(0,f.jsx)(Os,{icon:kt.A,title:"No invoices found",message:h||"all"!==y?"Try adjusting your filters.":"Create your first invoice.",actionLabel:"Create Invoice",onAction:()=>e("/admin/invoices/create")}):l.map(t=>{const s="Overdue"===t.status;return(0,f.jsxs)("div",{className:"tg-leadrow tg-row",style:{gridTemplateColumns:Af,padding:"14px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer"},onClick:()=>e("/admin/invoices/".concat(t.id)),children:[(0,f.jsxs)("span",{style:{fontFamily:wf,fontSize:13,fontWeight:700},children:["#",t.invoice_number]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[t.company_logo_url?(0,f.jsx)("img",{src:t.company_logo_url,alt:"",style:{width:30,height:30,borderRadius:8,objectFit:"cover",flexShrink:0}}):(0,f.jsx)("span",{className:"tg-ui",style:{width:30,height:30,borderRadius:8,background:Sf(t.client_company),color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:11,flexShrink:0},children:Ms(t.client_company)}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.client_company}),t.contact_name&&(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.contact_name})]})]}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontSize:13,color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:t.project_name||"\u2014"}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontFamily:wf,fontSize:12,color:"#55555C"},children:t.sent_at?P(t.sent_at):"\u2014"}),(0,f.jsxs)("span",{className:"tg-booking-meta",style:{fontFamily:wf,fontSize:12,color:s?"#991B1B":"#55555C",fontWeight:s?700:400},children:[P(t.due_date),"Scheduled"===t.status&&t.scheduled_send_at&&(0,f.jsxs)("div",{style:{fontSize:10,
1color:"#4338CA"},children:["sends ",new Date(t.scheduled_send_at).toLocaleString("en-AU",{timeZone:"Australia/Melbourne",day:"2-digit",month:"short"})]})]}),(0,f.jsxs)("span",{style:{fontFamily:wf,fontSize:13.5,fontWeight:700,textAlign:"right"},children:[R(t.total),t.amount_due&&t.amount_due!==t.total&&(0,f.jsxs)("div",{style:{fontSize:10.5,color:"#B45309",fontWeight:600},children:[R(t.amount_due)," due"]})]}),(0,f.jsx)("span",{children:(0,f.jsx)(Ds,{tone:Is[t.status]||"gray",children:t.status})}),(0,f.jsxs)(Mr,{open:z===t.id,onToggle:()=>B(z===t.id?null:t.id),onClose:()=>B(null),children:[(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{B(null),e("/admin/invoices/".concat(t.id))},children:[(0,f.jsx)(_.A,{size:15})," View invoice"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{B(null),e("/admin/invoices/edit/".concat(t.id))},children:[(0,f.jsx)(st.A,{size:15})," Edit"]})]})]},t.id)}),k.total_pages>1&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 22px",borderTop:"1px solid #EDEDF0",flexWrap:"wrap",gap:10},children:[(0,f.jsxs)("span",{style:{fontFamily:wf,fontSize:11.5,color:"#9A9AA0"},children:["SHOWING ",(k.page-1)*k.page_size+1,"\u2013",Math.min(k.page*k.page_size,k.total_count)," OF ",k.total_count]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("button",{disabled:k.page<=1,onClick:()=>D(k.page-1),style:{padding:"7px 13px",fontSize:13,fontWeight:600,border:"1px solid #E4E4E9",borderRadius:8,background:"#fff",cursor:"pointer",opacity:k.page<=1?.4:1},children:"Previous"}),(0,f.jsxs)("span",{style:{fontFamily:wf,fontSize:12,color:"#55555C"},children:[k.page," / ",k.total_pages]}),(0,f.jsx)("button",{disabled:k.page>=k.total_pages,onClick:()=>D(k.page+1),style:{padding:"7px 13px",fontSize:13,fontWeight:600,border:"1px solid #E4E4E9",borderRadius:8,background:"#fff",cursor:"pointer",opacity:k.page>=k.total_pages?.4:1},children:"Next"})]})]})]})]})};var Cf=s(687),Ff=s(53285),Ef=s(877),Tf=s(22770),zf=s(16992),Bf=s(56102),Df=s(17869),If=s(70095);function Rf(){var e;const t=localStorage.getItem("turbo360_admin_auth"),s=t?null===(e=JSON.parse(t))||void 0===e?void 0:e.token:null;return s?{Authorization:"Bearer ".concat(s)}:{}}function Pf(e,t){const[s,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(null),[o,l]=(0,a.useState)(!0),c=JSON.stringify(t||{}),d=(0,a.useCallback)(async()=>{l(!0),i(null);try{const t=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s=new URLSearchParams(Object.entries(t).filter(e=>{let[,t]=e;return void 0!==t&&null!==t&&""!==t})),a="".concat(I.fn,"/api/admin/reports").concat(e).concat(s.toString()?"?".concat(s):""),n=await fetch(a,{headers:Rf()});if(409===n.status){const e=new Error("Xero is not connected");throw e.code="xero_not_connected",e}if(!n.ok){const e=await n.text().catch(()=>n.statusText);throw new Error("Request failed (".concat(n.status,"): ").concat(e))}return n.json()}(e,JSON.parse(c));n(t)}catch(t){"xero_not_connected"===(null===t||void 0===t?void 0:t.code)?n(null):i(t)}finally{l(!1)}},[e,c]);return(0,a.useEffect)(()=>{d()},[d]),{data:s,error:r,loading:o,reload:d}}function Wf(e){let{title:t,subtitle:s,loading:a,error:n,onExport:r,children:i}=e;return(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:18},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:16},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("h2",{className:"tg-ui",style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:18,letterSpacing:"-0.01em",color:"#0A0A0B",margin:0},children:t}),s&&(0,f.jsx)("p",{style:{fontSize:12.5,color:"#9A9AA0",marginTop:3,marginBottom:0},children:s})]}),r&&(0,f.jsxs)("button",{type:"button",onClick:r,className:"tg-ui",style:{display:"inline-flex",alignItems:"center",gap:7,flexShrink:0,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 13px",fontSize:12.5,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(es.A,{size:14}),"Export CSV"]})]}),a&&(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"64px 0"},children:(0,f.jsx)("div",{className:"tg-spin",style:{width:36,height:36,border:"3px solid #E4E4E9",borderTopColor:"#BF212F",borderRadius:"50%"}})}
1),n&&!a&&(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid #FECACA",borderRadius:14,padding:"16px 18px",display:"flex",alignItems:"center",gap:11,color:"#991B1B",fontSize:13},children:[(0,f.jsx)(v.A,{size:18,style:{flexShrink:0}}),(0,f.jsxs)("span",{children:["Failed to load: ",n.message||String(n)]})]}),!a&&!n&&i]})}function Of(e){let{decimals:t=0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:t,maximumFractionDigits:t}).format(e||0)}function Lf(e){let{decimals:t=0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Intl.NumberFormat("en-AU",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e||0)}function Mf(e){return null===e||void 0===e?"\u2014":"".concat(Number(e).toFixed(1),"d")}function qf(e){if(!e)return"\u2014";const t=new Date(e);return isNaN(t.getTime())?"\u2014":t.toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric"})}function Hf(e){if(null===e||void 0===e)return"";const t="object"===typeof e?JSON.stringify(e):String(e);return/[",\n]/.test(t)?'"'.concat(t.replace(/"/g,'""'),'"'):t}function Uf(e,t,s){const a=t.map(e=>Hf(e.label)).join(","),n=s.map(e=>t.map(t=>Hf("function"===typeof t.value?t.value(e):e[t.value])).join(",")).join("\n"),r="".concat(a,"\n").concat(n),i=new Blob([r],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(i),l=document.createElement("a");l.href=o,l.download=e,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(o)}const Gf="'Space Mono',monospace",Vf="'Archivo',sans-serif",Jf="#1D4ED8",Yf="#F2A900",Kf="#16A34A",Zf="#991B1B",$f="#B45309",Qf="#EDEDF0",Xf="#E4E4E9",eb="#9A9AA0",tb={Paid:"#16A34A",Sent:"#1D4ED8",Overdue:"#991B1B",Draft:"#9A9AA0",Scheduled:"#4338CA",Cancelled:"#64748B","Partially Paid":"#B45309",Unknown:"#D1D5DB"},sb={background:"#fff",border:"1px solid ".concat(Xf),borderRadius:14};function ab(e){let{label:t,value:s,prior:a,deltaPct:n,format:r=e=>e,deltaSuffix:i="vs prior",span:o=2}=e;const l=null!==n&&void 0!==n&&!Number.isNaN(n),c=l&&n>0,d=l&&n<0,p=c?Kf:d?Zf:eb;return(0,f.jsxs)("div",{className:"tg-span2",style:(0,m.A)((0,m.A)({},sb),{},{gridColumn:"span ".concat(o),padding:"16px 18px"}),children:[(0,f.jsx)("div",{style:{fontFamily:Gf,fontSize:10,letterSpacing:"0.14em",color:eb,marginBottom:9,textTransform:"uppercase"},children:t}),(0,f.jsx)("div",{style:{fontFamily:Gf,fontWeight:700,fontSize:22,letterSpacing:"-0.02em",lineHeight:1,color:"#0A0A0B"},children:null===s||void 0===s?"\u2014":r(s)}),l?(0,f.jsxs)("div",{style:{marginTop:9,fontSize:11.5,color:p,fontWeight:600},children:[c?"\u25b2":d?"\u25bc":"\u2014"," ",Math.abs(n).toFixed(1),"%"," ",(0,f.jsx)("span",{style:{color:eb,fontWeight:400},children:i})]}):void 0!==a&&null!==a&&(0,f.jsxs)("div",{style:{marginTop:9,fontSize:11.5,color:eb,fontWeight:400},children:["vs prior: ",r(a)]})]})}function nb(e){let{title:t,legend:s,children:a,style:n}=e;return(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},sb),{},{overflow:"hidden"},n),children:[(0,f.jsxs)("div",{style:{padding:"16px 20px",borderBottom:"1px solid ".concat(Qf),display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:10},children:[(0,f.jsx)("span",{style:{fontFamily:Vf,fontWeight:700,fontSize:15,color:"#0A0A0B"},children:t}),s]}),(0,f.jsx)("div",{style:{padding:"18px 20px"},children:a})]})}const rb={background:"#fff",border:"1px solid ".concat(Xf),borderRadius:10,fontFamily:Vf,fontSize:12,boxShadow:"0 8px 24px rgba(0,0,0,0.08)"};var ib=s(9097);function ob(e){let{title:t,subtitle:s}=e;return(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-12 text-center",children:[(0,f.jsx)("div",{className:"inline-flex items-center justify-center w-14 h-14 rounded-full bg-amber-50 mb-4",children:(0,f.jsx)(ib.A,{className:"h-7 w-7 text-amber-600"})}),(0,f.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:t}),(0,f.jsx)("p",{className:"mt-1 text-sm text-gray-500 max-w-md mx-auto",children:s})]})}const lb=[{id:"overview",label:"Overview",icon:hs.A,component:function(e){var t,s,a,n,r,i,o,l,c,d,m,p,x,h,u,g,b;let{range:y}=e;const{data:v,loading:j,error:w}=Pf("/summary",{range:y}),{data:N,loading:A}=Pf("/revenue-trend",{range:y}),{data:k,loading:S}=Pf("/invoices-breakdown",{}),_=j||A||S,C=w,F=((null===k||void 0===k?void 0:k.by_status)||[]).filter(e=>e.count>0).map(e=>({name:e.status,value:e.count,color:tb[e.status]||"#D1D5DB"})),E=(null===k||void 0===k?void 0:k.aging)||[];return(0,f.jsxs)(Wf,{title:"Overview",subtitle:"Headline revenue + invoice position",loading:_,error:C,onExport:()=>{N&&Uf("revenue-trend.csv",[{label:"Month",value:"month"},{label:"Actual (Paid)",value:"actual"},{label:"Accrued (Invoiced)",value:"accrued"}],N.trend||[])},children:[v&&(0,f.jsxs)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:14},children:[(0,f.jsx)(ab,{label:"Revenue realised",value:null===(t=v.revenue_realised)||void 0===t?void 0:t.current,prior:null===(s=v.revenue_realised)||void 0===s?void 0:s.prior,deltaPct:null===(a=v.revenue_realised)||void 0===a?void 0:a.delta_pct,format:Of}),(0,f.jsx)(ab,{label:"Outstanding (now)",value:null===(n=v.revenue_outstanding)||void 0===n?void 0:n.current,format:Of}),(0,f.jsx)(ab,{label:"Overdue (now)",value:null===(r=v.revenue_overdue)||void 0===r?void 0:r.current,format:Of}),(0,f.jsx)(ab,{label:"GST collected",value:null===(i=v.gst_collected)||void 0===i?void 0:i.current,prior:null===(o=v.gst_collected)||void 0===o?void 0:o.prior,deltaPct:null===(l=v.gst_collected)||void 0===l?void 0:l.delta_pct,deltaSuffix:"this period",format:Of}),(0,f.jsx)(ab,{label:"Avg invoice value",value:null===(c=v.avg_invoice_value)||void 0===c?void 0:c.current,prior:null===(d=v.avg_invoice_value)||void 0===d?void 0:d.prior,deltaPct:null===(m=v.avg_invoice_value)||void 0===m?void 0:m.delta_pct,deltaSuffix:"per invoice",format:Of}),(0,f.jsx)(ab,{label:"Avg days to pay",value:null===(p=v.avg_days_to_pay)||void 0===p?void 0:p.current,prior:null===(x=v.avg_days_to_pay)||void 0===x?void 0:x.prior,deltaPct:null===(h=v.avg_days_to_pay)||void 0===h?void 0:h.delta_pct,deltaSuffix:"days",format:Mf}),(0,f.jsx)(ab,{label:"Paid invoices",value:null===(u=v.paid_invoice_count)||void 0===u?void 0:u.current,prior:null===(g=v.paid_invoice_count)||void 0===g?void 0:g.prior,deltaPct:null===(b=v.paid_invoice_count)||void 0===b?void 0:b.delta_pct,deltaSuffix:"this period",format:Lf})]}),(0,f.jsx)(nb,{title:"Revenue trend",legend:(0,f.jsxs)("div",{style:{display:"flex",gap:16},children:[(0,f.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:7,fontSize:12,color:"#55555C"},children:[(0,f.jsx)("span",{style:{width:12,height:3,borderRadius:2,background:Jf}})," Cash (actual)"]}),(0,f.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:7,fontSize:12,color:"#55555C"},children:[(0,f.jsx)("span",{style:{width:12,height:0,borderTop:"2px dashed ".concat(Yf)}})," Accrued (invoiced)"]})]}),children:(0,f.jsx)("div",{style:{height:288},children:(0,f.jsx)(Kg.u,{width:"100%",height:"100%",children:(0,f.jsxs)(Ef.Q,{data:(null===N||void 0===N?void 0:N.trend)||[],children:[(0,f.jsx)("defs",{children:(0,f.jsxs)("linearGradient",{id:"ovr_actual",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,f.jsx)("stop",{offset:"5%",
1stopColor:Jf,stopOpacity:.16}),(0,f.jsx)("stop",{offset:"95%",stopColor:Jf,stopOpacity:0})]})}),(0,f.jsx)($g.d,{strokeDasharray:"3 3",stroke:Qf}),(0,f.jsx)(Qg.W,{dataKey:"month",tick:{fontSize:11,fontFamily:Gf,fill:eb},stroke:Xf}),(0,f.jsx)(Xg.h,{tick:{fontSize:11,fontFamily:Gf,fill:eb},stroke:Xf,tickFormatter:e=>"$".concat((e/1e3).toFixed(0),"k")}),(0,f.jsx)(ef.m,{contentStyle:rb,formatter:e=>Of(e,{decimals:2})}),(0,f.jsx)(Tf.Gk,{type:"monotone",dataKey:"actual",stroke:Jf,strokeWidth:2.5,fill:"url(#ovr_actual)"}),(0,f.jsx)(Tf.Gk,{type:"monotone",dataKey:"accrued",stroke:Yf,strokeWidth:2.5,strokeDasharray:"6 5",fill:"none"})]})})})}),(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"1fr 1.4fr",gap:18},children:[(0,f.jsx)(nb,{title:"Invoice status",children:(0,f.jsx)("div",{style:{height:264},children:(0,f.jsx)(Kg.u,{width:"100%",height:"100%",children:(0,f.jsxs)(zf.r,{children:[(0,f.jsx)(Bf.Fq,{data:F,cx:"50%",cy:"45%",innerRadius:50,outerRadius:80,paddingAngle:2,dataKey:"value",children:F.map((e,t)=>(0,f.jsx)(Df.f,{fill:e.color},t))}),(0,f.jsx)(ef.m,{contentStyle:rb}),(0,f.jsx)(If.s,{verticalAlign:"bottom",height:36,formatter:e=>(0,f.jsx)("span",{style:{fontSize:12,color:"#55555C"},children:e})})]})})})}),(0,f.jsxs)(nb,{title:"Receivables aging",children:[(0,f.jsx)("div",{style:{height:240},children:(0,f.jsx)(Kg.u,{width:"100%",height:"100%",children:(0,f.jsxs)(Zg.E,{data:E,children:[(0,f.jsx)($g.d,{strokeDasharray:"3 3",stroke:Qf}),(0,f.jsx)(Qg.W,{dataKey:"bucket",tick:{fontSize:11,fontFamily:Gf,fill:eb},stroke:Xf}),(0,f.jsx)(Xg.h,{tick:{fontSize:11,fontFamily:Gf,fill:eb},stroke:Xf,tickFormatter:e=>"$".concat((e/1e3).toFixed(0),"k")}),(0,f.jsx)(ef.m,{contentStyle:rb,formatter:e=>Of(e,{decimals:2})}),(0,f.jsx)(tf.yP,{dataKey:"amount",radius:[6,6,0,0],children:E.map((e,t)=>(0,f.jsx)(Df.f,{fill:"not_due"===e.bucket?Kf:"0-30"===e.bucket?Jf:"31-60"===e.bucket?$f:"61-90"===e.bucket?"#EA580C":Zf},t))})]})})}),(0,f.jsx)("div",{style:{marginTop:14,display:"grid",gridTemplateColumns:"repeat(5,1fr)",textAlign:"center"},children:E.map(e=>(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:Gf,fontSize:11,fontWeight:700,color:"#333"},children:Of(e.amount)}),(0,f.jsxs)("div",{style:{fontFamily:Gf,fontSize:9.5,color:eb,marginTop:2},children:[e.bucket," (",e.count,")"]})]},e.bucket))})]})]})]})},usesRange:!0,needsXero:!0},{id:"projections",label:"Projections",icon:Ia.A,component:function(){return(0,f.jsx)(ob,{title:"Projections",subtitle:"Forward revenue projections from Xero invoices and recurring schedules. Coming in a follow-up release."})},usesRange:!1,needsXero:!1},{id:"pipeline",label:"Sales pipeline",icon:Cf.A,component:function(){return(0,f.jsx)(ob,{title:"Sales pipeline",subtitle:"Proposal and lead pipeline reporting. This data lives outside Xero \u2014 coming in a follow-up release."})},usesRange:!0,needsXero:!1},{id:"clients",label:"Clients",icon:Xe.A,component:function(){return(0,f.jsx)(ob,{title:"Clients",subtitle:"Top clients, repeat-business and lifetime-value reporting. Coming in a follow-up release."})},usesRange:!1,needsXero:!1},{id:"gst",label:"GST / BAS",icon:_i.A,component:function(){const{data:e,loading:t,error:s}=Pf("/gst",{quarters_back:6});return(0,f.jsxs)(Wf,{title:"GST / BAS",subtitle:"GST collected by Australian BAS quarter \u2014 cash vs accrual",loading:t,error:s,onExport:()=>{e&&Uf("gst-bas.csv",[{label:"Quarter",value:"quarter"},{label:"GST (cash)",value:e=>e.cash_basis.gst_collected},{label:"Revenue (cash)",value:e=>e.cash_basis.revenue},{label:"GST (accrual)",value:e=>e.accrual_basis.gst_collected},{label:"Revenue (accrual)",value:e=>e.accrual_basis.revenue}],e.quarters||[])},children:[e&&(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-500 mb-1",children:[(0,f.jsx)(_i.A,{className:"h-3.5 w-3.5"})," Current quarter"]}),(0,f.jsx)("div",{className:"text-xl font-bold text-gray-900",children:e.current_quarter})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-500 mb-1",children:[(0,f.jsx)(_t.A,{className:"h-3.5 w-3.5"})," Next BAS due (approx.)"]}),(0,f.jsx)("div",{className:"text-xl font-bold text-gray-900",children:qf(e.next_bas_due)}),(0,f.jsx)("div",{className:"text-[11px] text-gray-400 mt-0.5",children:"28 days after quarter close"})]})]}),(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,f.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:"Quarterly GST"}),(0,f.jsx)("div",{className:"overflow-x-auto",children:(0,f.jsxs)("table",{className:"w-full text-sm",children:[(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{className:"text-xs text-gray-500 border-b border-gray-100",children:[(0,f.jsx)("th",{className:"text-left py-2 font-medium",children:"Quarter"}),(0,f.jsx)("th",{className:"text-right py-2 font-medium",children:"GST (cash)"}),(0,f.jsx)("th",{className:"text-right py-2 font-medium",children:"Revenue (cash)"}),(0,f.jsx)("th",{className:"text-right py-2 font-medium",children:"GST (accrual)"}),(0,f.jsx)("th",{className:"text-right py-2 font-medium",children:"Revenue (accrual)"})]})}),(0,f.jsx)("tbody",{children:((null===e||void 0===e?void 0:e.quarters)||[]).map(e=>(0,f.jsxs)("tr",{className:"border-b border-gray-50",children:[(0,f.jsx)("td",{className:"py-2 text-gray-900 font-medium",children:e.quarter}),(0,f.jsx)("td",{className:"py-2 text-right font-mono text-emerald-700 font-semibold",children:Of(e.cash_basis.gst_collected,{decimals:2})}),(0,f.jsx)("td",{className:"py-2 text-right font-mono text-gray-700",children:Of(e.cash_basis.revenue)}),(0,f.jsx)("td",{className:"py-2 text-right font-mono text-blue-700",children:Of(e.accrual_basis.gst_collected,{decimals:2})}),(0,f.jsx)("td",{className:"py-2 text-right font-mono text-gray-700",children:Of(e.accrual_basis.revenue)})]},e.quarter))})]})}),(0,f.jsx)("p",{className:"mt-3 text-[11px] text-gray-400",children:"Cash basis counts GST on invoices actually paid in the quarter. Accrual basis counts GST on invoices issued in the quarter. Input credits (GST paid on expenses) are not tracked yet \u2014 this page shows GST collected only."})]})]})},usesRange:!1,needsXero:!0},{id:"operations",label:"Operations",icon:Ff.A,component:function(){return(0,f.jsx)(ob,{title:"Operations",subtitle:"Crew utilisation, job throughput and delivery SLAs. This data lives outside Xero \u2014 coming in a follow-up release."})},usesRange:!0,needsXero:!1},{id:"marketing",label:"Marketing",icon:Ss.A,component:function(){return(0,f.jsx)(ob,{title:"Marketing",subt
1itle:"Lead source attribution and campaign performance. This data lives outside Xero \u2014 coming in a follow-up release."})},usesRange:!0,needsXero:!1}],cb=[{value:"3mo",label:"Last 3 months"},{value:"6mo",label:"Last 6 months"},{value:"12mo",label:"Last 12 months"},{value:"ytd",label:"Year to date"},{value:"all",label:"All time"}];function db(){const e=(0,r.Zp)(),[t,s]=(0,r.ok)(),[n,i]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null),d=t.get("tab")||"overview",m=t.get("range")||"12mo",p=lb.find(e=>e.id===d)||lb[0];(0,a.useEffect)(()=>{if((0,o.cd)()){var t;i(!0);const e=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token;fetch("".concat(I.fn,"/api/admin/xero/status"),{headers:{Authorization:"Bearer ".concat(e)}}).then(e=>e.ok?e.json():null).then(e=>c(e||{connected:!1})).catch(()=>c({connected:!1}))}else e("/admin")},[e]);if(!n)return(0,f.jsx)(ta,{title:"Reports",meta:"REPORTS",children:(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"80px 0"},children:(0,f.jsx)("div",{className:"tg-spin",style:{width:40,height:40,border:"3px solid #E4E4E9",borderTopColor:"#BF212F",borderRadius:"50%"}})})});const x=p.component;return(0,f.jsxs)(ta,{title:"Reports",meta:"".concat(p.label.toUpperCase()," \xb7 REPORTS"),children:[(0,f.jsxs)("div",{className:"tg-scroll",style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:14,padding:"0 18px",marginBottom:18,display:"flex",alignItems:"center",gap:22,overflowX:"auto"},children:[(0,f.jsx)("div",{className:"tg-scroll",style:{display:"flex",gap:22,flex:1,overflowX:"auto"},children:lb.map(e=>{const a=e.id===p.id;return(0,f.jsxs)("button",{type:"button",onClick:()=>(e=>{const a=new URLSearchParams(t);a.set("tab",e),s(a,{replace:!0})})(e.id),className:"tg-ui",style:{display:"inline-flex",alignItems:"center",gap:7,padding:"13px 2px",fontSize:13,fontWeight:600,whiteSpace:"nowrap",border:"none",borderBottom:"2px solid ".concat(a?"#BF212F":"transparent"),background:"none",color:a?"#BF212F":"#9A9AA0",cursor:"pointer"},children:[(0,f.jsx)(e.icon,{size:15}),e.label]},e.id)})}),p.usesRange&&(0,f.jsxs)("div",{style:{position:"relative",flexShrink:0,margin:"8px 0"},children:[(0,f.jsx)("select",{value:m,onChange:e=>(e=>{const a=new URLSearchParams(t);a.set("range",e),s(a,{replace:!0})})(e.target.value),className:"tg-ui",style:{appearance:"none",WebkitAppearance:"none",background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"7px 30px 7px 11px",fontSize:12.5,fontWeight:600,color:"#333",cursor:"pointer",whiteSpace:"nowrap"},children:cb.map(e=>(0,f.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,f.jsx)(Et.A,{size:14,style:{position:"absolute",right:10,top:"50%",transform:"translateY(-50%)",color:"#9A9AA0",pointerEvents:"none"}})]})]}),p.needsXero&&l&&!l.connected&&(0,f.jsxs)("div",{style:{marginBottom:18,background:"#FEF3C7",border:"1px solid #FDE68A",borderRadius:14,padding:"16px 18px",display:"flex",alignItems:"flex-start",gap:13},children:[(0,f.jsx)("span",{style:{color:"#B45309",display:"flex",flexShrink:0,marginTop:1},children:(0,f.jsx)(v.A,{size:20})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontSize:13.5,fontWeight:700,color:"#92400E"},children:"Connect Xero to see this report"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:"#92400E",opacity:.85,marginTop:3},children:"Revenue, GST and invoice data is read live from Xero. Connect your Xero org once to power this page."})]}),(0,f.jsx)("button",{type:"button",onClick:()=>e("/admin/settings"),className:"tg-btn-primary tg-ui",style:{flexShrink:0,background:"#B45309",color:"#fff",border:"none",borderRadius:9,padding:"9px 14px",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:"Open settings"})]}),(0,f.jsx)(x,{range:m})]})}const mb="'Space Mono',monospace",pb={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},xb={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},hb=(0,m.A)((0,m.A)({},xb),{},{fontFamily:mb}),ub=e=>{let{title:t,children:s,right:a}=e;return(0,f.jsxs)(Ls,{style:{padding:22},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:t}),a]}),s]})},gb=()=>{const e=(0,r.Zp)(),t=(0,r.zy)(),{invoiceId:s}=(0,r.g)(),n=!!s,i=t.state,[l,c]=(0,a.useState)([]),[d,p]=(0,a.useState)([]),[x,h]=(0,a.useState)((null===i||void 0===i?void 0:i.contact_id)||""),[u,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),[j,w]=(0,a.useState)(""),[N,A]=(0,a.useState)(""),[k,S]=(0,a.useState)({client_id:(null===i||void 0===i?void 0:i.contact_id)||"",client_company:(null===i||void 0===i?void 0:i.client_company)||"",contact_name:(null===i||void 0===i?void 0:i.contact_name)||"",position:(null===i||void 0===i?void 0:i.position)||"",email:(null===i||void 0===i?void 0:i.email)||"",phone:(null===i||void 0===i?void 0:i.phone)||"",street_address:(null===i||void 0===i?void 0:i.street_address)||"",city:(null===i||void 0===i?void 0:i.city)||"",state:(null===i||void 0===i?void 0:i.state)||"",postal_code:(null===i||void 0===i?void 0:i.postal_code)||"",country:(null===i||void 0===i?void 0:i.country)||"",abn:(null===i||void 0===i?void 0:i.abn)||"",project_name:"",job_date:"",job_location:"",purchase_order:"",service_items:[],due_date:"",notes:"",discount_amount:0,discount_type:"fixed",discount_reason:"",w
1aive_credit_card_surcharge:!1}),[_,C]=(0,a.useState)(!1),[F,E]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(async()=>{if(await(0,o.cd)())if(T(),z(),n)B();else{const e=new Date;e.setDate(e.getDate()+30),S(t=>(0,m.A)((0,m.A)({},t),{},{due_date:e.toISOString().split("T")[0]}))}else e("/admin")})()},[e,n]);const T=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();c(e.clients||[])}}catch(t){console.error("Error loading clients:",t)}},z=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/services"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();p(e.services||[])}}catch(t){console.error("Error loading services:",t)}},B=async()=>{C(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(I.fn,"/api/invoices/").concat(s),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){const e=await a.json();h(e.client_id||""),S({client_id:e.client_id||"",client_company:e.client_company,contact_name:e.contact_name,position:e.position||"",email:e.email,phone:e.phone,street_address:e.street_address||"",city:e.city||"",state:e.state||"",postal_code:e.postal_code||"",country:e.country||"",abn:e.abn||"",project_name:e.project_name,job_date:e.job_date||"",job_location:e.job_location||"",purchase_order:e.purchase_order||"",service_items:e.service_items||[],due_date:e.due_date?new Date(e.due_date).toISOString().split("T")[0]:"",notes:e.notes||"",discount_amount:e.discount_amount||0,discount_type:e.discount_type||"fixed",discount_reason:e.discount_reason||"",waive_credit_card_surcharge:!!e.waive_credit_card_surcharge})}}catch(t){console.error("Error loading invoice:",t)}finally{C(!1)}},D=(e,t,s)=>{const a=[...k.service_items];a[e][t]=s,S((0,m.A)((0,m.A)({},k),{},{service_items:a}))},R=(l.filter(e=>{var t,s,a;if(!j)return!0;const n=j.toLowerCase();return(null===(t=e.company_name)||void 0===t?void 0:t.toLowerCase().includes(n))||(null===(s=e.contact_name)||void 0===s?void 0:s.toLowerCase().includes(n))||(null===(a=e.email)||void 0===a?void 0:a.toLowerCase().includes(n))}),d.filter(e=>{var t,s,a;if(!N)return!0;const n=N.toLowerCase();return(null===(t=e.name)||void 0===t?void 0:t.toLowerCase().includes(n))||(null===(s=e.description)||void 0===s?void 0:s.toLowerCase().includes(n))||(null===(a=e.category)||void 0===a?void 0:a.toLowerCase().includes(n))})),{subtotal:P,discountValue:W,gst:O,total:L}=(()=>{const e=k.service_items.reduce((e,t)=>e+t.quantity*t.unit_price,0);let t=0;k.discount_amount&&k.discount_amount>0&&(t="percentage"===k.discount_type?e*(k.discount_amount/100):Math.min(k.discount_amount,e));const s=e-t,a=.1*s;return{subtotal:e,discountValue:t,gst:a,total:s+a}})(),M=k.street_address||k.city||k.state||k.postal_code,q=(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>e("/admin/invoices"),style:{display:"inline-flex",alignItems:"center",gap:7,fontSize:13,fontWeight:600,color:"#55555C",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{size:15})," Invoices"]}),(0,f.jsx)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:n?"Edit Invoice":"Create Invoice"}),(0,f.jsx)("div",{style:{marginLeft:"auto"},children:(0,f.jsxs)("button",{type:"submit",form:"invoice-form",className:"tg-btn-primary",disabled:F||0===k.service_items.length,style:{display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",opacity:F||0===k.service_items.length?.6:1},children:[(0,f.jsx)(ia.A,{size:15})," ",F?"Saving\u2026":n?"Update Invoice":"Create Invoice"]})})]});return _?(0,f.jsxs)(ta,{title:"Edit Invoice",meta:"FINANCE \xb7 INVOICE",children:[q,(0,f.jsx)(Ws,{rows:8})]}):(0,f.jsxs)(ta,{title:"Edit Invoice",meta:"FINANCE \xb7 INVOICE",children:[q,(0,f.jsx)("form",{id:"invoice-form",onSubmit:async t=>{if(t.preventDefault(),x&&k.client_id)if(k.project_name&&k.due_date)if(k.service_items&&0!==k.service_items.length){E(!0);try{var a;const t=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,r=n?"".concat(I.fn,"/api/invoices/").concat(s):"".concat(I.fn,"/api/invoices"),i=await fetch(r,{method:n?"PUT":"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(k)});if(i.ok){await i.json();e("/admin/invoices")}else{const e=await i.json();alert("Failed to save invoice: ".concat(e.detail||"Unknown error"))}}catch(r){console.error("Error saving invoice:",r),alert("Error saving invoice")}finally{E(!1)}}else alert("Please add at least one service item to the invoice");else alert("Please fill in all required fields (Project Name, Due Date)");else alert("Please select a company and contact for this invoice")},children:(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"1.62fr 1fr",gap:20,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)(ub,{title:"Client Information",children:[!x&&(0,f.jsxs)("div",{style:{marginBottom:14,padding:"12px 14px",background:"#FEF3C7",border:"1px solid #FDE68A",borderRadius:10,display:"flex",alignItems:"center",gap:9,fontSize:12.5,fontWeight:600,color:"#92400E"},children:[(0,f.jsx)(In.A,{size:17}),"You must select a company and contact to create an invoice"]}),(0,f.jsx)(Yo,{allClients:l,selectedContactId:x,onContactSelect:e=>{console.log("\ud83d\udd35 Invoice handleContactSelect called with:",e);const t="string"===typeof e?e:(null===e||void 0===e?void 0:e.id)||"";if(!t)return console.log("\ud83d\udd35 Clearing contact selection"),h(""),void S(e=>(0,m.A)((0,m.A)({},e),{},{client_id:"",client_company:"",contact_name:"",position:"",email:"",ph
1one:"",street_address:"",city:"",state:"",postal_code:"",country:"",abn:""}));const s=l.find(e=>e.id===t);s&&(console.log("\ud83d\udd35 Contact found:",s),h(t),S(e=>(0,m.A)((0,m.A)({},e),{},{client_id:s.id,client_company:s.is_company?s.company_name:s.parent_company_name||s.company_name||"",contact_name:s.is_company?s.company_name:s.contact_name||"".concat(s.first_name||""," ").concat(s.last_name||"").trim(),position:s.position||"",email:s.email||"",phone:s.phone||s.mobile||"",street_address:s.street_address||"",city:s.city||"",state:s.state||"",postal_code:s.postal_code||"",country:s.country||"Australia",abn:s.abn||""})))},label:"Select Client for this Invoice",variant:"light"}),x&&(0,f.jsxs)("div",{style:{marginTop:16,padding:16,background:"#FBFBFC",border:"1px solid #EDEDF0",borderRadius:11},children:[(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"#9A9AA0",marginBottom:12},children:"Selected Contact Details"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:pb,children:"Company"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},xb),{},{background:"#fff"}),children:k.client_company||"-"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:pb,children:"Contact Name"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},xb),{},{background:"#fff"}),children:k.contact_name||"-"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:pb,children:"Email"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},xb),{},{background:"#fff"}),children:k.email||"-"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:pb,children:"Phone"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},hb),{},{background:"#fff"}),children:k.phone||"-"})]}),M&&(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:pb,children:"Billing Address"}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},xb),{},{background:"#fff"}),children:[k.street_address&&(0,f.jsxs)(f.Fragment,{children:[k.street_address,(0,f.jsx)("br",{})]}),k.city&&(0,f.jsxs)(f.Fragment,{children:[k.city,", "]}),k.state&&(0,f.jsxs)(f.Fragment,{children:[k.state," "]}),k.postal_code&&(0,f.jsxs)(f.Fragment,{children:[k.postal_code,(0,f.jsx)("br",{})]}),k.country&&(0,f.jsx)(f.Fragment,{children:k.country})]})]}),k.abn&&(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:pb,children:"ABN"}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},hb),{},{background:"#fff"}),children:k.abn})]})]}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",marginTop:12,fontStyle:"italic"},children:"To change the client, select a different company and contact above."})]})]}),(0,f.jsx)(ub,{title:"Project Information",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:pb,children:"Project Name *"}),(0,f.jsx)("input",{type:"text",value:k.project_name,onChange:e=>S((0,m.A)((0,m.A)({},k),{},{project_name:e.target.value})),required:!0,style:xb})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:pb,children:"Job Date"}),(0,f.jsx)("input",{type:"date",value:k.job_date,onChange:e=>S((0,m.A)((0,m.A)({},k),{},{job_date:e.target.value})),style:hb})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:pb,children:"Due Date *"}),(0,f.jsx)("input",{type:"date",value:k.due_date,onChange:e=>S((0,m.A)((0,m.A)({},k),{},{due_date:e.target.value})),required:!0,style:hb})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:pb,children:"Job Location"}),(0,f.jsx)("input",{type:"text",value:k.job_location,onChange:e=>S((0,m.A)((0,m.A)({},k),{},{job_location:e.target.value})),style:xb})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:pb,children:"Purchase Order Number (Optional)"}),(0,f.jsx)("input",{type:"text",value:k.purchase_order,onChange:e=>S((0,m.A)((0,m.A)({},k),{},{purchase_order:e.target.value})),style:hb,placeholder:"Enter PO number if provided by client"})]})]})}),(0,f.jsxs)(ub,{title:"Line Items",right:(0,f.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>v(!y),style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid #E4E4E9",borderRadius:8,padding:"7px 12px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(ds.A,{size:14})," From Services"]}),(0,f.jsxs)("button",{type:"button",onClick:()=>{const e={id:Date.now().toString(),name:"",description:"",quantity:1,unit_price:0,is_o
1ptional:!1};S((0,m.A)((0,m.A)({},k),{},{service_items:[...k.service_items,e]}))},style:{display:"inline-flex",alignItems:"center",gap:6,background:"#0A0A0B",border:"none",borderRadius:8,padding:"7px 12px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12,fontWeight:600,color:"#fff",cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:14})," Add Item"]})]}),children:[y&&(0,f.jsxs)("div",{style:{marginBottom:16,padding:14,background:"#FBFBFC",border:"1px solid #EDEDF0",borderRadius:11},children:[(0,f.jsx)("input",{type:"text",placeholder:"Search services by name, description, or category\u2026",value:N,onChange:e=>A(e.target.value),style:(0,m.A)((0,m.A)({},xb),{},{background:"#fff",marginBottom:12})}),(0,f.jsxs)("div",{style:{maxHeight:240,overflowY:"auto",display:"flex",flexDirection:"column",gap:8},children:[R.filter(e=>e.enabled).map(e=>(0,f.jsxs)("button",{type:"button",onClick:()=>(e=>{const t={id:Date.now().toString(),name:e.name,description:e.description,quantity:1,unit_price:e.price,is_optional:!1};S((0,m.A)((0,m.A)({},k),{},{service_items:[...k.service_items,t]})),v(!1),A("")})(e),style:{textAlign:"left",padding:12,background:"#fff",border:"1px solid #EDEDF0",borderRadius:9,cursor:"pointer"},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:"#0A0A0B"},children:e.name}),(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0"},children:e.description}),(0,f.jsxs)("div",{className:"tg-mono",style:{fontSize:12,fontWeight:700,color:"#BF212F",marginTop:4},children:["$",e.price.toFixed(2)," ","hourly"===e.pricing_type?"/hr":""]})]},e.id)),0===R.filter(e=>e.enabled).length&&(0,f.jsx)("div",{style:{textAlign:"center",padding:16,fontSize:13,color:"#9A9AA0"},children:"No services found"})]})]}),(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:"1fr 64px 110px 110px 30px",gap:10,padding:"8px 0",fontFamily:mb,fontSize:9.5,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)("span",{children:"Service Name"}),(0,f.jsx)("span",{style:{textAlign:"center"},children:"Qty"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Unit Price"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Amount"}),(0,f.jsx)("span",{})]}),0===k.service_items.length?(0,f.jsx)("div",{style:{textAlign:"center",padding:"28px 0",fontSize:13,color:"#9A9AA0"},children:"No line items yet \u2014 add from Services or a custom item."}):k.service_items.map((e,t)=>{const s=(Number(e.quantity)||0)*(Number(e.unit_price)||0);return(0,f.jsxs)("div",{style:{padding:"12px 0",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 64px 110px 110px 30px",gap:10,alignItems:"center"},children:[(0,f.jsx)("input",{type:"text",value:e.name,onChange:e=>D(t,"name",e.target.value),required:!0,placeholder:"Service name",style:(0,m.A)((0,m.A)({},xb),{},{padding:"9px 11px"})}),(0,f.jsx)("input",{type:"number",min:"1",value:e.quantity,onChange:e=>D(t,"quantity",parseFloat(e.target.value)),required:!0,style:(0,m.A)((0,m.A)({},hb),{},{padding:"9px 8px",textAlign:"center"})}),(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",value:e.unit_price,onChange:e=>D(t,"unit_price",parseFloat(e.target.value)),required:!0,style:(0,m.A)((0,m.A)({},hb),{},{padding:"9px 11px",textAlign:"right"})}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontSize:13,fontWeight:700,textAlign:"right",color:"#0A0A0B"},children:["$",s.toFixed(2)]}),(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{const t=k.service_items.filter((t,s)=>s!==e);S((0,m.A)((0,m.A)({},k),{},{service_items:t}))})(t),title:"Remove",style:{width:28,height:28,border:"none",background:"#F7F7F9",borderRadius:7,color:"#9A9AA0",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(g.A,{size:15})})]}),(0,f.jsx)("textarea",{value:e.description,onChange:e=>D(t,"description",e.target.value),placeholder:"Description (shown on the invoice)",rows:2,style:(0,m.A)((0,m.A)({},xb),{},{padding:"9px 11px",marginTop:8,width:"100%",minHeight:56,resize:"vertical",fontFamily:"'Hanken Grotesk',sans-serif",lineHeight:1.5})})]},e.id)})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:20},children:[(0,f.jsxs)(ub,{title:"Discount",children:[(0,f.jsxs)("div",{style:{marginBottom:14},children:[(0,f.jsx)("label",{style:pb,children:"Type"}
1),(0,f.jsxs)("select",{value:k.discount_type,onChange:e=>S((0,m.A)((0,m.A)({},k),{},{discount_type:e.target.value})),style:xb,children:[(0,f.jsx)("option",{value:"fixed",children:"Fixed Amount ($)"}),(0,f.jsx)("option",{value:"percentage",children:"Percentage (%)"})]})]}),(0,f.jsxs)("div",{style:{marginBottom:14},children:[(0,f.jsx)("label",{style:pb,children:"percentage"===k.discount_type?"Percentage":"Amount"}),(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",value:k.discount_amount||"",onChange:e=>S((0,m.A)((0,m.A)({},k),{},{discount_amount:parseFloat(e.target.value)||0})),style:hb,placeholder:"percentage"===k.discount_type?"0":"0.00"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:pb,children:"Reason (optional)"}),(0,f.jsx)("input",{type:"text",value:k.discount_reason||"",onChange:e=>S((0,m.A)((0,m.A)({},k),{},{discount_reason:e.target.value})),style:xb,placeholder:"e.g. Loyal customer discount"})]})]}),(0,f.jsxs)(ub,{title:"Surcharge & Notes",children:[(0,f.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",gap:10,cursor:"pointer",marginBottom:16},children:[(0,f.jsx)("input",{type:"checkbox",checked:!!k.waive_credit_card_surcharge,onChange:e=>S((0,m.A)((0,m.A)({},k),{},{waive_credit_card_surcharge:e.target.checked})),style:{marginTop:2,width:16,height:16,accentColor:"#BF212F",cursor:"pointer"}}),(0,f.jsxs)("span",{style:{fontSize:13},children:[(0,f.jsx)("span",{style:{fontWeight:600,color:"#0A0A0B"},children:"Waive 3% card surcharge"}),(0,f.jsx)("span",{style:{display:"block",fontSize:11.5,color:"#9A9AA0",marginTop:2},children:"When checked, the client pays only the invoice total when paying online \u2014 no 3% Stripe surcharge is added."})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:pb,children:"Internal notes"}),(0,f.jsx)("textarea",{value:k.notes,onChange:e=>S((0,m.A)((0,m.A)({},k),{},{notes:e.target.value})),rows:4,style:(0,m.A)((0,m.A)({},xb),{},{resize:"vertical",minHeight:80}),placeholder:"Not shown to client\u2026"})]})]})]})]}),(0,f.jsxs)("div",{style:{position:"sticky",top:84,display:"flex",flexDirection:"column",gap:16},children:[(0,f.jsxs)(Ls,{style:{overflow:"hidden"},children:[(0,f.jsx)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0"},className:"tg-ui",children:(0,f.jsx)("span",{style:{fontWeight:700,fontSize:15},children:"Summary"})}),(0,f.jsxs)("div",{style:{padding:"18px 20px",display:"flex",flexDirection:"column",gap:11},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsx)("span",{style:{color:"#55555C"},children:"Subtotal"}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontWeight:600},children:["$",P.toFixed(2)]})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsxs)("span",{style:{color:"#55555C"},children:["Discount","percentage"===k.discount_type&&W>0?" (".concat(k.discount_amount,"%)"):""]}),(0,f.jsxs)("span",{className:"tg-mono",style:{color:W>0?"#15803D":"#9A9AA0",fontWeight:W>0?600:400},children:["\u2212$",W.toFixed(2)]})]}),W>0&&k.discount_reason&&(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",textAlign:"right",marginTop:-6},children:k.discount_reason}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsx)("span",{style:{color:"#55555C"},children:"GST (10%)"}),(0,f.jsxs)("span",{className:"tg-mono",style:{fontWeight:600},children:["$",O.toFixed(2)]})]})]}),(0,f.jsxs)("div",{style:{margin:"0 16px 16px",borderRadius:12,background:"#0A0A0B",padding:18,position:"relative",overflow:"hidden"},children:[(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-20,bottom:-20,width:84,opacity:.07}}),(0,f.jsx)("div",{className:"tg-mono",style:{fontSize:10,letterSpacing:"0.1em",textTransform:"uppercase",color:"#7A7A82",marginBottom:10},children:"Total"}),(0,f.jsx)(zs,{amount:L,size:30,mutedSize:16,color:"#fff",mutedColor:"#7A7A82"})]}),(0,f.jsxs)("div",{style:{padding:"0 20px 20px"},children:[(0,f.jsxs)("button",{type:"submit",form:"invoice-form",className:"tg-btn-primary",disabled:F||0===k.service_items.length,style:{width:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:7,background:"#BF212F",border:"none",borderRadius:10,padding:13,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:14,fontWeight:600,color:"#fff",cursor:"pointer",opacity:F||0===k.service_items.length?.6:1},children:[(0,f.jsx)(ia.A,{size:16})," ",F?"Saving\u2026":n?"Update Invoice":"Create Invoice"]}),(0,f.jsx)("button",{type:"button",onClick:()=>e("/admin/invoices"),style:{width:"100%",marginTop:10,background:"#fff",border:"1px solid #E4E4E9",borderRadius:10,padding:13,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:14,fontWeight:600,color:"#333",cursor:"pointer"},children:"Cancel"})]})]}),(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:14,padding:"16px 18px",display:"flex",gap:11,alignItems:"flex-start"},children:[(0,f.jsx)(In.A,{size:17,color:"#0FA3A3",style:{flexShrink:0,marginTop:1}}),(0,f.jsx)("p",{style:{fontSize:12.5,color:"#55555C",lineHeight:1.55,margin:0},children:"Client will receive a Stripe payment link. A 3% card surcharge applies unless waived above."})]})]})]})})]})},fb="'Space Mono',monospace",bb="'Hanken Grotesk',sans-serif",yb={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},vb={fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,margin:0},jb={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},wb={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:bb,fontSize:13.5,background:"#FBFBFC",outline:"none",color:"#0A0A0B",boxSizing:"border-box"},Nb=(0,m.A)((0,m.A)({},wb),{},{fontFamily:fb}),Ab=(0,m.A)((0,m.A)({},wb),{},{background:"#F4F4F6",color:"#333"}),kb=(e,t,s)=>({display:"inline-flex",alignItems:"center",gap:7,background:e,color:t,border:s||"none",borderRadius:9,padding:"10px 14px",fontFamily:bb,fontSize:13,fontWeight:600,cursor:"pointer",whiteSpace:"nowrap"}),Sb=e=>{const t=Ts(e);return"".concat(t.whole).concat(t.cents)},_b=()=>{var e;const t=(0,r.Zp)(),s=(0,r.zy)(),n=s.state,i=null!==(e=s.state)&&void 0!==e&&e.fromProposal?s.state.proposal:null;console.log("=== INVOICE CREATE DEBUG ==="),console.log("location.state:",s.state),console.log("proposalData:",i),console.log("proposalData?.service_items:",null===i||void 0===i?void 0:i.service_items),console.log("proposalData?.accepted_service_items:",null===i||void 0===i?void 0:i.accepted_service_items);const[l,c]=(0,a.useState)([]),[d,p]=(0,a.useState)([]),[x,h]=(0,a.useState)(!1),[u,b]=(0,a.useState)(""),[y,v]=(0,a.useState)((null===n||void 0===n?void 0:n.contact_id)||(null===i||void 0===i?void 0:i.client_id)||""),[j,w]=(0,a.useState)({client_id:(null===n||void 0===n?void 0:n.contact_id)||(null===i||void 0===i?void 0:i.client_id)||"",client_company:(null===n||void 0===n?void 0:n.client_company)||(null===i||void 0===i?void 0:i.client_company)||"",contact_name:(null===n||void 0===n?void 0:n.contact_name)||(null===i||void 0===i?void 0:i.contact_name)||"",position:(null===n||void 0===n?void 0:n.position)||(null===i||void 0===i?void 0:i.position)||"",email:(null===n||void 0===n?void 0:n.email)||(null===i||void 0===i?void 0:i.email)||"",phone:(null===n||void 0===n?void 0:n.phone)||(null===i||void 0===i?void 0:i.phone)||"",street_address:(null===n||void 0===n?void 0:n.street_address)||(null===i||void 0===i?void 0:i.street_address)||"",city:(null===n||void 0===n?void 0:n.city)||(null===i||void 0===i?void 0:i.city)||"",state:(null===n||void 0===n?void 0:n.state)||(null===i||void 0===i?void 0:i.state)||"",postal_code:(null===n||void 0===n?void 0:n.postal_code)||(null===i||void 0===i?void 0:i.postal_code)||"",country:(null===n||void 0===n?void 0:n.country)||(null===i||void 0===i?void 0:i.country)||"",abn:(null===n||void 0===n?void 0:n.abn)||(null===i||void 0===i?void 0:i.abn)||"",project_name:(null===i||void 0===i?void 0:i.project_name)||"",job_date:(null===i||void 0===i?void 0:i.job_date)||"",job_location:(null===i||void 0===i?void 0:i.job_location)||"",purchase_order:"",service_items:null!==i&&void 0!==i&&i.service_items?(()=>{const e=i.accepted_service_items,t=i.accepted_extras||{},s=i.service_items,a=e&&e.length>0?e.map(e=>({index:e,item:s[e]})).filter(e=>e.item):s.map((e,t)=>({index:t,item:e})).filter(e=>!e.item.optional),n=[];
1return a.forEach(e=>{let{index:s,item:a}=e;n.push({id:String(Date.now())+Math.random().toString().slice(2),name:a.title||a.name||"Service",description:a.description||"",quantity:a.quantity||1,unit_price:a.price||a.unit_price||0});const r=a.optional_extras||[],i=t[String(s)]||[];r.forEach(e=>{i.includes(e.id)&&n.push({id:String(Date.now())+Math.random().toString().slice(2),name:" + ".concat(e.name||"Extra"),description:e.description||"",quantity:1,unit_price:e.price||0})})}),n})():[],due_date:"",notes:i?"Invoice for accepted proposal: ".concat(i.project_name):"",discount_amount:(null===i||void 0===i?void 0:i.client_discount)||0,discount_type:(null===i||void 0===i?void 0:i.client_discount_type)||"fixed",discount_reason:(null===i||void 0===i?void 0:i.client_discount_reason)||"",waive_credit_card_surcharge:!1}),[N,A]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(async()=>{if(await(0,o.cd)()){k(),S();const e=new Date;e.setDate(e.getDate()+30),w(t=>(0,m.A)((0,m.A)({},t),{},{due_date:e.toISOString().split("T")[0]})),null!==n&&void 0!==n&&n.contact_id&&_(n.contact_id),null!==i&&void 0!==i&&i.client_id&&(async e=>{try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/clients/").concat(e),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const e=await a.json(),t=e.contact_name||(e.first_name&&e.last_name?"".concat(e.first_name," ").concat(e.last_name):e.first_name||e.last_name||"");let n=e.company_name,r={street_address:e.street_address||"",city:e.city||"",state:e.state||"",postal_code:e.postal_code||"",country:e.country||"",abn:e.abn||""};if(e.parent_company_id){const t=await fetch("".concat(I.fn,"/api/clients/").concat(e.parent_company_id),{headers:{Authorization:"Bearer ".concat(s)}});if(t.ok){const e=await t.json();n=e.company_name,r={street_address:e.street_address||"",city:e.city||"",state:e.state||"",postal_code:e.postal_code||"",country:e.country||"",abn:e.abn||""}}}w(s=>(0,m.A)((0,m.A)({},s),{},{client_company:n,contact_name:t,position:e.position||s.position,email:e.email||s.email,phone:e.phone||s.phone},r))}}catch(s){console.error("Error loading client details for proposal:",s)}})(i.client_id)}else t("/admin")})()},[t]);const k=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();c(e.clients||[])}}catch(t){console.error("Error loading contacts:",t)}},S=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/services"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();p(e.services||[])}}catch(t){console.error("Error loading services:",t)}},_=async e=>{if(!e)return v(""),void w(e=>(0,m.A)((0,m.A)({},e),{},{client_id:"",client_company:"",contact_name:"",position:"",email:"",phone:"",street_address:"",city:"",state:"",postal_code:"",country:"",abn:""}));if("string"===typeof e){v(e);try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/clients/").concat(e),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const t=await a.json();let n=t.company_name,r={street_address:t.street_address||"",city:t.city||"",state:t.state||"",postal_code:t.postal_code||"",country:t.country||"",abn:t.abn||""};if(t.parent_company_id){const e=await fetch("".concat(I.fn,"/api/clients/").concat(t.parent_company_id),{headers:{Authorization:"Bearer ".concat(s)}});if(e.ok){const t=await e.json();n=t.company_name,t.street_address&&(r={street_address:t.street_address||"",city:t.city||"",state:t.state||"",postal_code:t.postal_code||"",country:t.country||"",abn:t.abn||""})}}w(s=>(0,m.A)((0,m.A)({},s),{},{client_id:e,client_company:n,contact_name:t.contact_name||(t.first_name&&t.last_name?"".concat(t.first_name," ").concat(t.last_name):t.first_name||t.last_name||""),position:t.position||"",email:t.email||"",phone:t.phone||""},r))}}catch(a){console.error("Error loading contact:",a)}}else{const t=e;v(t.id);try{let e=t.parent_company_name||t.company_name,a={street_address:t.street_address||"",city:t.city||"",state:t.state||"",postal_code:t.postal_code||"",country:t.country||"",abn:t.abn||""};if(t.parent_company_id){var s;const n=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,r=await fetch("".concat(I.fn,"/api/clients/").concat(t.parent_company_id),{headers:{Authorization:"Bearer ".concat(n)}});if(r.ok){const t=await r.json();e=t.company_name,t.street_address&&(a={street_address:t.street_address||"",city:t.city||"",state:t.state||"",postal_code:t.postal_code||"",country:t.country||"",abn:t.abn||""})}}w(s=>(0,m.A)((0,m.A)({},s),{},{client_id:t.id,client_company:e,contact_name:t.contact_name||(t.first_name&&t.last_name?"".concat(t.first_name," ").concat(t.last_name):t.first_name||t.last_name||""),position:t.position||"",email:t.email||"",phone:t.phone||""},a))}catch(a){console.error("Error loading contact:",a)}}},C=(e,t,s)=>{const a=[...j.service_items];a[e][t]=s,w((0,m.A)((0,m.A)({},j),{},{service_items:a}))},F=d.filter(e=>{var t,s,a;if(!u)return!0;const n=u.toLowerCase();return(null===(t=e.name)||void 0===t?void 0:t.toLowerCase().includes(n))||(null===(s=e.description)||void 0===s?void 0:s.toLowerCase().includes(n))||(null===(a=e.category)||void 0===a?void 0:a.toLowerCase().includes(n))}),{subtotal:E,discountValue:T,gst:z,total:B}=(()=>{const e=j.service_items.reduce((e,t)=>
1e+t.quantity*t.unit_price,0);let t=0;j.discount_amount&&j.discount_amount>0&&(t="percentage"===j.discount_type?e*(j.discount_amount/100):Math.min(j.discount_amount,e));const s=e-t,a=.1*s;return{subtotal:e,discountValue:t,gst:a,total:s+a}})(),D=N||!y||0===j.service_items.length;return(0,f.jsx)(ta,{title:"New Invoice",meta:"FINANCE \xb7 INVOICE",children:(0,f.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),y)if(j.project_name&&j.due_date)if(0!==j.service_items.length){A(!0);try{var s;const e=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,a=await fetch("".concat(I.fn,"/api/invoices"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(j)});if(a.ok){await a.json();t("/admin/invoices")}else{const e=await a.json();alert("Failed to save invoice: ".concat(e.detail||"Unknown error"))}}catch(a){console.error("Error saving invoice:",a),alert("Error saving invoice")}finally{A(!1)}}else alert("Please add at least one service item");else alert("Please fill in all required fields");else alert("Please select a company and contact")},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>t("/admin/invoices"),style:kb("#fff","#55555C","1px solid #E4E4E9"),children:[(0,f.jsx)(Ct.A,{size:15})," Invoices"]}),(0,f.jsx)("h1",{className:"tg-ui",style:{fontFamily:"'Archivo',sans-serif",fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:"New Invoice"}),i&&(0,f.jsx)("span",{className:"tg-mono",style:{fontSize:10.5,fontWeight:700,background:"#DCFCE7",color:"#15803D",borderRadius:7,padding:"4px 10px",textTransform:"uppercase",letterSpacing:"0.02em"},children:"\u2713 From Accepted Proposal"}),(0,f.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)("button",{type:"button",onClick:()=>t("/admin/invoices"),style:kb("#fff","#333","1px solid #E4E4E9"),children:"Cancel"}),(0,f.jsxs)("button",{type:"submit",disabled:D,className:"tg-btn-primary",style:(0,m.A)((0,m.A)({},kb("#BF212F","#fff")),{},{opacity:D?.5:1,cursor:D?"not-allowed":"pointer"}),children:[(0,f.jsx)(ia.A,{size:15})," ",N?"Saving\u2026":"Create Invoice"]})]})]}),i&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},yb),{},{border:"1px solid #BBF7D0",background:"#F0FDF4",padding:"13px 18px",marginBottom:20,fontSize:13,color:"#15803D"}),children:[(0,f.jsx)("strong",{children:"Pre-filled from proposal:"})," ",i.project_name,(0,f.jsxs)("span",{style:{marginLeft:8,color:"#16A34A"},children:["\u2022 Client: ",i.client_company]})]}),(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"minmax(0,1.62fr) 1fr",gap:20,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20,maxWidth:760},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yb),{},{padding:22}),children:[(0,f.jsx)("h2",{style:(0,m.A)((0,m.A)({},vb),{},{marginBottom:16}),children:"Client Information"}),(0,f.jsxs)("div",{style:{marginBottom:16},children:[(0,f.jsx)(Yo,{allClients:l,selectedContactId:y,onContactSelect:_,label:"Select Client for this Invoice",variant:"light"}),(0,f.jsx)("p",{style:{fontSize:12,color:"#9A9AA0",marginTop:10,marginBottom:0},children:"Select a company first, then choose a contact. The billing address will be automatically populated."})]}),y&&j.client_company&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14,marginBottom:18},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"Company Name"}),(0,f.jsx)("input",{type:"text",value:j.client_company,readOnly:!0,style:Ab})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"Contact Name"}),(0,f.jsx)("input",{type:"text",value:j.contact_name,readOnly:!0,style:Ab})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"Email"}),(0,f.jsx)("input",{type:"email",value:j.email,readOnly:!0,style:Ab})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"Phone"}),(0,f.jsx)("input",{type:"tel",value:j.phone,readOnly:!0,style:(0,m.A)((0,m.A)({},Ab),{},{fontFamily:fb})})]})]}),(0,f.jsxs)("div",{style:{paddingTop:16,borderTop:"1px solid #EDEDF0"},children:[(0,f.jsx)("div",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:13,marginBottom:12},children:"Billing Address"}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"Street Address"}),(0,f.jsx)("input",{type:"text",value:j.street_address,readOnly:!0,style:Ab})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"City"}),(0,f.jsx)("input",{type:"text",value:j.city,readOnly:!0,style:Ab})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"State"}),(0,f.jsx)("input",{type:"text",value:j.state,readOnly:!0,style:Ab})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"Postal Code"}),(0,f.jsx)("input",{type:"text",value:j.postal_code,readOnly:!0,style:(0,m.A)((0,m.A)({},Ab),{},{fontFamily:fb})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"Country"}),(0,f.jsx)("input",{type:"text",value:j.country,readOnly:!0,style:Ab})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"ABN / Tax ID"}),(0,f.jsx)("input",{type:"text",value:j.abn,readOnly:!0,style:(0,m.A)((0,m.A)({},Ab),{},{fontFamily:fb})})]})]})]})]}),!y&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},yb),{},{border:"1px solid #FDE68A",background:"#FFFBEB",padding:"13px 16px",fontSize:13,color:"#92400E"}),children:[(0,f.jsx)("strong",{children:"Note:"})," Please select a company and contact above to continue. All new invoices must be assigned to an existing contact."]})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yb),{},{padding:22}),children:[(0,f.jsx)("h2",{style:(0,m.A)((0,m.A)({},vb),{},{marginBottom:16}),children:"Project Information"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:jb,children:"Project Name *"}),(0,f.jsx)("input",{type:"text",value:j.project_name,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{project_name:e.target.value})),required:!0,style:wb})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"Job Date"}),(0,f.jsx)("input",{type:"date",value:j.job_date,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{job_date:e.target.value})),style:Nb})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"Due Date *"}),(0,f.jsx)("input",{type:"date",value:j.due_date,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{due_date:e.target.value})),required:!0,style:Nb})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:jb,children:"Job Location"}),(0,f.jsx)("input",{type:"text",value:j.job_location,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{job_location:e.target.value})),style:wb})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:jb,children:"Purchase Order Number (Optional)"}),(0,f.jsx)("input",{type:"text",value:j.purchase_order,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{purchase_order:e.target.value})),placeholder:"Enter PO number if provided by client",style:Nb})]})]})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yb),{},{padding:22}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16,gap:10,flexWrap:"wrap"},children:[(0,f.jsx)("h2",{style:vb,children:"Line Items"}),(0,f.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>h(!x),style:kb("#fff","#333","1px solid #E4E4E9"),children:[(0,f.jsx)(ds.A,{size:14})," From Services"]}),(0,f.jsxs)("button",{type:"button",onClick:()=>{const e={id:Date.now().toString(),name:"",description:"",quantity:1,unit_price:0,is_o
1ptional:!1};w((0,m.A)((0,m.A)({},j),{},{service_items:[...j.service_items,e]}))},style:kb("#0A0A0B","#fff"),children:[(0,f.jsx)(ls.A,{size:14})," Add Item"]})]})]}),x&&(0,f.jsxs)("div",{style:{marginBottom:16,padding:14,background:"#FBFBFC",border:"1px solid #EDEDF0",borderRadius:10},children:[(0,f.jsx)("input",{type:"text",placeholder:"Search services by name, description, or category\u2026",value:u,onChange:e=>b(e.target.value),style:(0,m.A)((0,m.A)({},wb),{},{background:"#fff",marginBottom:10})}),(0,f.jsxs)("div",{style:{maxHeight:240,overflowY:"auto"},children:[F.filter(e=>e.enabled).map(e=>(0,f.jsxs)("button",{type:"button",onClick:()=>(e=>{const t={id:Date.now().toString(),name:e.name,description:e.description,quantity:1,unit_price:e.price,is_optional:!1};w((0,m.A)((0,m.A)({},j),{},{service_items:[...j.service_items,t]})),h(!1),b("")})(e),style:{width:"100%",textAlign:"left",padding:12,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,marginBottom:8,cursor:"pointer",fontFamily:bb},children:[(0,f.jsx)("div",{style:{fontWeight:600,fontSize:13.5,color:"#0A0A0B"},children:e.name}),(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0",marginTop:2},children:e.description}),(0,f.jsxs)("div",{style:{fontFamily:fb,fontSize:12.5,fontWeight:700,color:"#BF212F",marginTop:4},children:[Sb(e.price)," ","hourly"===e.pricing_type?"/hr":""]})]},e.id)),0===F.filter(e=>e.enabled).length&&(0,f.jsx)("div",{style:{textAlign:"center",padding:16,color:"#9A9AA0",fontSize:13},children:"No services found"})]})]}),j.service_items.length>0&&(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:"1fr 60px 110px 100px 30px",gap:10,padding:"8px 0",fontFamily:fb,fontSize:9.5,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)("span",{children:"Description"}),(0,f.jsx)("span",{style:{textAlign:"center"},children:"Qty"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Unit price"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Amount"}),(0,f.jsx)("span",{})]}),j.service_items.map((e,t)=>(0,f.jsxs)("div",{style:{padding:"14px 0",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px 110px 100px 30px",gap:10,alignItems:"center"},children:[(0,f.jsx)("input",{type:"text",value:e.name,onChange:e=>C(t,"name",e.target.value),required:!0,placeholder:"Service name",style:(0,m.A)((0,m.A)({},wb),{},{fontWeight:600})}),(0,f.jsx)("input",{type:"number",min:"1",value:e.quantity,onChange:e=>C(t,"quantity",parseFloat(e.target.value)),required:!0,style:(0,m.A)((0,m.A)({},Nb),{},{textAlign:"center"})}),(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",value:e.unit_price,onChange:e=>C(t,"unit_price",parseFloat(e.target.value)),required:!0,style:(0,m.A)((0,m.A)({},Nb),{},{textAlign:"right"})}),(0,f.jsx)("span",{style:{fontFamily:fb,fontSize:13,fontWeight:700,textAlign:"right"},children:Sb((e.quantity||0)*(e.unit_price||0))}),(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{const t=j.service_items.filter((t,s)=>s!==e);w((0,m.A)((0,m.A)({},j),{},{service_items:t}))})(t),title:"Remove",style:{width:30,height:30,border:"none",background:"#F7F7F9",borderRadius:7,color:"#991B1B",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(g.A,{size:15})})]}),(0,f.jsx)("div",{style:{marginTop:8},children:(0,f.jsx)("input",{type:"text",value:e.description,onChange:e=>C(t,"description",e.target.value),placeholder:"Description (optional)",style:(0,m.A)((0,m.A)({},wb),{},{fontSize:12.5})})})]},e.id)),0===j.service_items.length&&(0,f.jsx)("div",{style:{textAlign:"center",padding:"28px 16px",color:"#9A9AA0",fontSize:13},children:"No line items yet. Add from Services or add a custom item."})]}),(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:20},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yb),{},{padding:22}),children:[(0,f.jsx)("h2",{style:(0,m.A)((0,m.A)({},vb),{},{marginBottom:16}),children:"Discount"}),(0,f.jsxs)("div",{style:{marginBottom:14},children:[(0,f.jsx)("label",{style:jb,children:"Type"}),(0,f.jsx)("div",{style:{display:"flex",border:"1px solid #E4E4E9",borderRadius:9,overflow:"hidden"},children:[["fixed","Fixed $"],["percentage","Percent %"]].map(e=>{let[t,s]=e;const a=j.discount_type===t;return(0,f.jsx)("button",{type:"button",onClick:()=>w((0,m.A)((0,m.A)({},j),{},{discount_type:t})),style:{flex:1,textAlign:"center",padding:"9px 8px",fontSize:12.5,fontWeight:600,fontFamily:bb,cursor:"pointer",border:"none",background:a?"#0A0A0B":"#fff",color:a?"#fff":"#55555C"},children:s},t)})})]}),(0,f.jsxs)("div",{style:{marginBottom:14},children:[(0,f.jsx)("label",{style:jb,children:"percentage"===j.discount_type?"Percentage":"Amount"}),(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",value:j.discount_amount||"",onChange:e=>w((0,m.A)((0,m.A)({},j),{},{discount_amount:parseFloat(e.target.value)||0})),placeholder:"percentage"===j.discount_type?"0":"0.00",style:Nb})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:jb,children:"Reason (optional)"}),(0,f.jsx)("input",{type:"text",value:j.discount_reason||"",onChange:e=>w((0,m.A)((0,m.A)({},j),{},{discount_reason:e.target.value})),placeholder:"e.g. Loyal customer discount",style:wb})]})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yb),{},{padding:22}),children:[(0,f.jsx)("h2",{style:(0,m.A)((0,m.A)({},vb),{},{marginBottom:16}),children:"Surcharge & Notes"}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"flex-start",ga
1p:10,cursor:"pointer",marginBottom:18},children:[(0,f.jsx)("input",{type:"checkbox",checked:!!j.waive_credit_card_surcharge,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{waive_credit_card_surcharge:e.target.checked})),style:{marginTop:2,width:16,height:16,accentColor:"#BF212F",flexShrink:0}}),(0,f.jsxs)("span",{style:{fontSize:13},children:[(0,f.jsx)("span",{style:{fontWeight:600,color:"#0A0A0B"},children:"Waive credit-card surcharge"}),(0,f.jsx)("span",{style:{display:"block",fontSize:11.5,color:"#9A9AA0",marginTop:2},children:"When checked, the client pays only the invoice total when paying online \u2014 no 3% Stripe surcharge is added."})]})]}),(0,f.jsx)("label",{style:jb,children:"Internal notes"}),(0,f.jsx)("textarea",{value:j.notes,onChange:e=>w((0,m.A)((0,m.A)({},j),{},{notes:e.target.value})),rows:"3",placeholder:"Internal notes (not visible to client)",style:(0,m.A)((0,m.A)({},wb),{},{minHeight:72,resize:"vertical"})})]})]})]}),(0,f.jsxs)("div",{style:{position:"sticky",top:84,display:"flex",flexDirection:"column",gap:16},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yb),{},{background:"#0A0A0B",border:"1px solid #0A0A0B",overflow:"hidden",position:"relative"}),children:[(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-24,bottom:-24,width:120,opacity:.06,pointerEvents:"none"}}),(0,f.jsx)("div",{style:{padding:"16px 22px",borderBottom:"1px solid #1F1F23",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15,color:"#fff"},children:"Summary"}),(0,f.jsxs)("div",{style:{padding:"18px 22px",display:"flex",flexDirection:"column",gap:12,position:"relative"},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Subtotal"}),(0,f.jsx)("span",{style:{fontFamily:fb,fontWeight:600,color:"#fff"},children:Sb(E)})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsxs)("span",{style:{color:"#9A9AA0"},children:["Discount","percentage"===j.discount_type&&j.discount_amount?" (".concat(j.discount_amount,"%)"):""]}),(0,f.jsx)("span",{style:{fontFamily:fb,color:T>0?"#4ADE80":"#7A7A82"},children:T>0?"-".concat(Sb(T)):Sb(0)})]}),T>0&&j.discount_reason&&(0,f.jsx)("div",{style:{fontSize:11,color:"#7A7A82",textAlign:"right",marginTop:-6},children:j.discount_reason}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontSize:13.5},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"GST (10%)"}),(0,f.jsx)("span",{style:{fontFamily:fb,fontWeight:600,color:"#fff"},children:Sb(z)})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",borderTop:"1px solid #1F1F23",paddingTop:13,marginTop:2},children:[(0,f.jsx)("span",{style:{fontWeight:700,fontSize:15,color:"#fff"},children:"Total"}),(0,f.jsx)("span",{style:{fontFamily:fb,fontWeight:700,fontSize:22,letterSpacing:"-0.02em",color:"#fff"},children:Sb(B)})]})]}),(0,f.jsxs)("div",{style:{padding:"0 22px 22px",display:"flex",flexDirection:"column",gap:10,position:"relative"},children:[(0,f.jsxs)("button",{type:"submit",disabled:D,className:"tg-btn-primary",style:{background:"#BF212F",border:"none",borderRadius:10,padding:13,fontFamily:bb,fontSize:14,fontWeight:600,color:"#fff",cursor:D?"not-allowed":"pointer",opacity:D?.5:1,display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:[(0,f.jsx)(ia.A,{size:16})," ",N?"Saving\u2026":"Create Invoice"]}),(0,f.jsx)("button",{type:"button",onClick:()=>t("/admin/invoices"),style:{background:"transparent",border:"1px solid #2A2A2F",borderRadius:10,padding:13,fontFamily:bb,fontSize:14,fontWeight:600,color:"#C4C4CB",cursor:"pointer"},children:"Cancel"})]})]}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},yb),{},{padding:"16px 18px",fontSize:12.5,color:"#55555C",lineHeight:1.55}),children:"Client will receive a Stripe payment link. A 3% card surcharge applies unless waived above."})]})]})]})})},Cb="'Space Mono',monospace",Fb={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Eb=e=>{let{children:t,color:s="#9A9AA0",style:a}=e;return(0,f.jsx)("div",{style:(0,m.A)({fontFamily:Cb,fontSize:10.5,letterSpacing:"0.16em",color:s,textTransform:"uppercase"},a),children:t})},Tb=(e,t,s)=>({display:"inline-flex",alignItems:"center",gap:7,background:e,color:t,border:s||"none",borderRadius:9,padding:"10px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",textDecoration:"none",whiteSpace:"nowrap"}),zb=()=>{const e=(0,r.Zp)(),{invoiceId:t}=(0,r.g)(),[s,n]=(0,a.useState)(null),[i,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)(!1),[x,u]=(0,a.useState)(!1),[b,y]=(0,a.useState)({use_client_email:!0,alternative_email:""}),[v,j]=(0,a.useState)({amount:"",payment_method:"direct_deposit",payment_date:(new Date).toISOString().split("T")[0],notes:"",send_receipt:!1}),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(!1),[S,_]=(0,a.useState)("send"),[C,F]=(0,a.useState)("now"),[E,z]=(0,a.useState)(""),[B,D]=(0,a.useState)(""),[R,P]=(0,a.useState)(!1),[W,O]=(0,a.useState)({}),[L,M]=(0,a.useState)({});(0,a.useEffect)(()=>{(async()=>
1{await(0,o.cd)()?q():e("/admin")})()},[e,t]);const q=async()=>{l(!0);try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,r=await fetch("".concat(I.fn,"/api/invoices/").concat(t),{headers:{Authorization:"Bearer ".concat(a)}});if(r.ok){const e=await r.json();n(e),j(t=>(0,m.A)((0,m.A)({},t),{},{amount:(e.amount_due||e.total).toFixed(2)})),e.client_id&&H(e.client_id)}else alert("Failed to load invoice"),e("/admin/invoices")}catch(a){console.error("Error loading invoice:",a),alert("Error loading invoice"),e("/admin/invoices")}finally{l(!1)}},H=async e=>{try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/clients/").concat(e),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const e=await a.json(),t=e.parent_company_id||e.id,n=await fetch("".concat(I.fn,"/api/companies/").concat(t,"/contacts"),{headers:{Authorization:"Bearer ".concat(s)}});if(n.ok){const e=await n.json();setCompanyContacts(e.contacts||[])}}}catch(s){console.error("Error loading contacts:",s)}},U=e=>{if(!e)return"";try{return new Date(e).toLocaleString("en-AU",{timeZone:"Australia/Melbourne",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})}catch(t){return e}},G=async()=>{if(confirm("Waive all late fees for this invoice?"))try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token;(await fetch("".concat(I.fn,"/api/invoices/").concat(t,"/waive-late-fees"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}})).ok?(alert("Late fees waived successfully!"),q()):alert("Failed to waive late fees")}catch(s){console.error("Error waiving late fees:",s),alert("Error waiving late fees")}},V=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(e||0),J=e=>e?new Date(e).toLocaleDateString("en-AU",{year:"numeric",month:"long",day:"numeric"}):"N/A";if(i)return(0,f.jsx)(ta,{title:"Invoice",meta:"FINANCE",children:(0,f.jsx)(Ws,{rows:8})});if(!s)return null;const Y=s.payments||[];return(0,f.jsxs)(ta,{title:"Invoice",meta:"FINANCE \xb7 INVOICE",children:[(0,f.jsx)("style",{children:"\n .send-invoice-modal-input {\n background-color: #ffffff !important;\n color: #111827 !important;\n border: 1px solid #d1d5db !important;\n }\n\n .send-invoice-modal-input:focus {\n outline: none !important;\n ring: 2px !important;\n ring-color: #3b82f6 !important;\n border-color: #3b82f6 !important;\n }\n\n .send-invoice-modal-input::placeholder {\n color: #9ca3af !important;\n }\n\n .payment-modal-input, .payment-modal-select, .payment-modal-textarea {\n background-color: #ffffff !important;\n color: #111827 !important;\n border: 1px solid #d1d5db !important;\n }\n\n .payment-modal-input:focus, .payment-modal-select:focus, .payment-modal-textarea:focus {\n outline: none !important;\n ring: 2px !important;\n ring-color: #10b981 !important;\n border-color: #10b981 !important;\n }\n\n .payment-modal-input::placeholder, .payment-modal-textarea::placeholder {\n color: #9ca3af !important;\n }\n"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>e("/admin/invoices"),style:Tb("#fff","#55555C","1px solid #E4E4E9"),children:[(0,f.jsx)(Ct.A,{size:15})," Invoices"]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,f.jsxs)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:["Invoice #",s.invoice_number]}),(0,f.jsx)(Ds,{tone:Is[s.status]||"gray",radius:7,children:s.status})]}),(0,f.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>e("/admin/invoices/edit/".concat(t)),style:Tb("#fff","#333","1px solid #E4E4E9"),children:[(0,f.jsx)(Tn.A,{size:15})," Edit"]}),"Draft"===s.status&&(0,f.jsxs)("button",{onClick:()=>u(!0),style:Tb("#0A0A0B","#fff"),children:[(0,f.jsx)(st.A,{size:15})," Send to Client"]}),"Scheduled"===s.status&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("button",{onClick:()=>
1{if(null!==s&&void 0!==s&&s.scheduled_send_at){const e=new Date(s.scheduled_send_at),t=new Intl.DateTimeFormat("en-CA",{timeZone:"Australia/Melbourne",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(e).reduce((e,t)=>(e[t.type]=t.value,e),{});z("".concat(t.year,"-").concat(t.month,"-").concat(t.day)),D("".concat(t.hour,":").concat(t.minute)),s.scheduled_send_to_email&&y({use_client_email:s.scheduled_send_to_email===s.email,alternative_email:s.scheduled_send_to_email===s.email?"":s.scheduled_send_to_email})}F("schedule"),_("send"),u(!0)},style:Tb("#fff","#4338CA","1px solid #E4E4E9"),children:[(0,f.jsx)(Nt.A,{size:15})," Reschedule"]}),(0,f.jsxs)("button",{onClick:async()=>{if(window.confirm("Cancel scheduled send? The invoice will return to Draft.")&&!R){P(!0);try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(I.fn,"/api/invoices/").concat(t,"/cancel-schedule"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}});if(a.ok)alert("Scheduled send cancelled"),q();else{const e=await a.json();alert(e.detail||"Failed to cancel schedule")}}catch(s){console.error("Error cancelling schedule:",s),alert("Error cancelling schedule")}finally{P(!1)}}},disabled:R,style:(0,m.A)((0,m.A)({},Tb("#fff","#333","1px solid #E4E4E9")),{},{opacity:R?.5:1}),children:[R?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(g.A,{size:15})," Cancel Schedule"]}),(0,f.jsxs)("button",{onClick:()=>{F("now"),_("send"),u(!0)},style:Tb("#0A0A0B","#fff"),children:[(0,f.jsx)(st.A,{size:15})," Send Now"]})]}),("Sent"===s.status||"Overdue"===s.status)&&(0,f.jsxs)("button",{onClick:()=>u(!0),style:Tb("#fff","#333","1px solid #E4E4E9"),children:[(0,f.jsx)(st.A,{size:15})," Resend"]}),"Overdue"===s.status&&(0,f.jsxs)("button",{onClick:()=>{_("reminder"),u(!0)},style:Tb("#fff","#B45309","1px solid #FED7AA"),children:[(0,f.jsx)(T.A,{size:15})," Send Reminder"]}),"Paid"!==s.status&&"Draft"!==s.status&&(0,f.jsxs)("button",{onClick:()=>d(!0),className:"tg-btn-primary",style:Tb("#BF212F","#fff"),children:[(0,f.jsx)(At.A,{size:15})," Record Payment"]}),"Overdue"===s.status&&s.late_fees>0&&!s.late_fees_waived&&(0,f.jsxs)("button",{onClick:G,style:Tb("#fff","#B45309","1px solid #FED7AA"),children:[(0,f.jsx)(h.A,{size:15})," Waive Late Fees"]}),(0,f.jsxs)("a",{href:"".concat(window.location.origin,"/invoice/").concat(t),target:"_blank",rel:"noopener noreferrer",style:Tb("#fff","#333","1px solid #E4E4E9"),children:[(0,f.jsx)(En.A,{size:15})," Public Link"]}),(0,f.jsx)("button",{onClick:async()=>{const a={Draft:"Delete this draft invoice?",Sent:"This invoice has been sent to the client. Delete anyway?",Paid:"WARNING: This invoice has been paid! Are you sure you want to delete it?",Overdue:"This invoice is overdue. Delete anyway?"}[s.status]||"Delete this invoice?";if(confirm(a))try{var n;const s=null===(n=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===n?void 0:n.token;(await fetch("".concat(I.fn,"/api/invoices/").concat(t),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}})).ok?(alert("Invoice deleted successfully!"),e("/admin/invoices")):alert("Failed to delete invoice")}catch(r){console.error("Error deleting invoice:",r),alert("Error deleting invoice")}},title:"Delete invoice",style:Tb("#fff","#991B1B","1px solid #FECACA"),children:(0,f.jsx)(la.A,{size:15})})]})]}),"Scheduled"===s.status&&s.scheduled_send_at&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Fb),{},{border:"1px solid #C7D2FE",background:"#EEF2FF",padding:"14px 18px",marginBottom:20,display:"flex",alignItems:"center",gap:12}),children:[(0,f.jsx)(Nt.A,{size:18,color:"#4338CA",style:{flexShrink:0}}),(0,f.jsxs)("div",{style:{fontSize:13,color:"#3730A3"},children:[(0,f.jsx)("span",{style:{fontWeight:700},children:"Scheduled to send"})," ","on ",(0,f.jsx)("strong",{children:U(s.scheduled_send_at)})," (Melbourne time)"," ","to ",(0,f.jsx)("strong",{children:s.scheduled_send_to_email||s.email})]})]}),(0,f.jsxs)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:16,marginBottom:20},children:[(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Fb),{},{padding:18}),children:[(0,f.jsx)(Eb,{style:{marginBottom:10},children:"Invoice Total"}),(0,f.jsx)(zs,{amount:s.total,size:26,mutedSize:15}),s.gst>0&&(0,f.jsxs)("div",{style:{marginTop:9,fontSize:11.5,color:"#9A9AA0"},children:["inc. ",V(s.gst)," GST"]})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Fb),{},{padding:18}),children:[(0,f.jsx)(Eb,{style:{marginBottom:10},children:"Paid To Date"}),(0,f.jsx)(zs,{amount:s.total_paid,size:26,mutedSize:15,color:"#16A34A"}),(0,f.jsxs)("div",{style:{marginTop:9,fontSize:11.5,color:"#9A9AA0"},children:[Y.length," payment",1===Y.length?"":"s"]})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Fb),{},{padding:18}),children:[(0,f.jsx)(Eb,{style:{marginBottom:10},children:"Late Fees"}),(0,f.jsx)(zs,{amount:s.late_fees,size:26,mutedSize:15,color:"#B45309"}),"Overdue"===s.status&&s.late_fees>0&&!s.late_fees_waived?(0,f.jsx)("div",{onClick:G,style:{marginTop:9,fontSize:11.5,color:"#B45309",cursor:"pointer",fontWeight:600},children:"Waive late fees"}):(0,f.jsx)("div",{style:{marginTop:9,fontSize:11.5,color:"#9A9AA0"},children:s.late_fees_waived?"waived":"none accrued"})]}),(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Fb),{},{background:"#0A0A0B",border:"1px solid #0A0A0B",padding:18,position:"relative",overflow:"hidden"}),children:[(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-20,bottom:-20,width:84,opacity:.07}}),(0,f.jsx)(Eb,{color:"#F87171",style:{marginBottom:10},children:"Amount Due"}),(0,f.jsx)(zs,{amount:s.amount_due,size:30,mutedSize:16,color:"#fff",mutedColor:"#7A7A82"}),(0,f.jsxs)("div",{style:{marginTop:9,fontSize:11.5,color:"#7A7A82"},children:[s.due_date?"due ".concat(J(s.due_date)):"no due date",s.late_fees>0?" \xb7 inc. late fees":""]})]})]}),(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"1.62fr 1fr",gap:20,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Fb),{},{overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"Line Items"}),(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:"1fr 64px 110px 110px",gap:12,padding:"10px 20px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:Cb,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Description"}),(0,f.jsx)("span",{style:{textAlign:"center"},children:"Qty"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Unit"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Amount"})]}),s.service_items.map((e,t)=>(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 64px 110px 110px",gap:12,padding:"14px 20px",borderBottom:"1px solid #F2F2F5",alignItems:"start"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600},children:e.name}),e.description&&(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0",marginTop:2},children:e.description})]}),(0,f.jsx)("span",{style:{fontFamily:Cb,fontSize:13,textAlign:"center"},children:e.quantity}),(0,f.jsx)("span",{style:{fontFamily:Cb,fontSize:13,textAlign:"right"},children:V(e.unit_price)}),(0,f.jsx)("span",{style:{fontFamily:Cb,fontSize:13,fontWeight:700,textAlign:"right"},children:V(e.quantity*e.unit_price)})]},t)),(0,f.jsxs)("div",{style:{padding:"16px 20px",display:"flex",flexDirection:"column",gap:8,alignItems:"flex-end"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:13},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Subtotal"}),(0,f.jsx)("span",{style:{fontFamily:Cb,width:110,textAlign:"right"},children:V(s.subtotal)})]}),s.discount_value>0&&(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:13},children:[(0,f.jsxs)("span",{style:{color:"#15803D"},children:["Discount","percentage"===s.discount_type?" (".concat(s.discount_amount,"%)"):"",s.discount_reason?" \xb7 ".concat(s.discount_reason):""]}),(0,f.jsxs)("span",{style:{fontFamily:Cb,width:110,textAlign:"right",color:"#15803D"},children:["-",V(s.discount_value)]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:13},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"GST (10%)"}),(0,f.jsx)("span",{style:{fontFamily:Cb,width:110,textAlign:"right"},children:V(s.gst)})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:15,fontWeight:700,borderTop:"1px solid #EDEDF0",paddingTop:9,marginTop:2},children:[(0,f.jsx)("span",{children:"Total"}),(0,f.jsx)("span",{style:{fontFamily:Cb,width:110,textAlign:"right"},children:V(s.total)})]})]})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:20},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Fb),{},{padding:"18px 20px"}),children:[(0,f.jsx)(Eb,{style:{marginBottom:14},children:"Bill To"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11,marginBottom:12},children:[(0,f.jsx)("span",{style:{width:38,height:38,borderRadius:9,background:"#0A0A0B",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:13,flexShrink:0},children:Ms(s.client_company)}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:14,fontWeight:700},children:s.client_company}),s.abn&&(0,f.jsxs)("div",{style:{fontSize:12,color:"#9A9AA0"},children:["ABN ",s.abn]})]})]}),(0,f.jsxs)("div",{style:{fontSize:13,color:"#333",lineHeight:1.7},children:[s.contact_name&&(0,f.jsxs)(f.Fragment,{children:[s.contact_name,(0,f.jsx)("br",{})]}),s.email&&(0,f.jsxs)(f.Fragment,{children:[s.email,(0,f.jsx)("br",{})]}),s.phone&&(0,f.jsxs)(f.Fragment,{children:[s.phone,(0,f.jsx)("br",{})]}),s.street_address&&(0,f.jsxs)(f.Fragment,{children:[s.street_address,(0,f.jsx)("br",{}),s.city&&s.state?"".concat(s.city,", ").concat(s.state," ").concat(s.postal_code):"",s.country&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("br",{}),s.country]})]})]})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Fb),{},{padding:"18px 20px"}),children:[(0,f.jsx)(Eb,{style:{marginBottom:14},children:"Project & Terms"}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:9,fontSize:13},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Project"}),(0,f.jsx)("span",{style:{fontWeight:600,textAlign:"right"},children:s.project_name||"\u2014"})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Job date"}),(0,f.jsx)("span",{style:{fontFamily:Cb,textAlign:"right"},children:s.job_date||"N/A"})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Issue date"}),(0,f.jsx)("span",{style:{fontFamily:Cb,textAlign:"right"},children:J(s.issue_date||s.created_date)})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Due date"}),(0,f.jsx)("span",{style:{fontFamily:Cb,textAlign:"right",color:"Overdue"===s.status?"#991B1B":"#0A0A0B",fontWeight:"Overdue"===s.status?700:400},children:J(s.due_date)})]}),s.purchase_order&&(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"PO number"}),(0,f.jsx)("span",{style:{fontFamily:Cb,textAlign:"right"},children:s.purchase_order})]}),s.job_location&&(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Location"}),(0,f.jsx)("span",{style:{fontWeight:600,textAlign:"right"},children:s.job_location})]})]})]})]}),s.notes&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Fb),{},{padding:"18px 20px"}),children:[(0,f.jsx)(Eb,{style:{marginBottom:10},children:"Internal Notes"}),(0,f.jsx)("p",{style:{fontSize:13,color:"#55555C",lineHeight:1.6,margin:0,whiteSpace:"pre-wrap"},children:s.notes})]})]}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Fb),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,f.jsx)("span",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"Payment History"}),(0,f.jsxs)("span",{style:{fontFamily:Cb,fontSize:10.5,background:"#EDEDF0",color:"#55555C",borderRadius:20,padding:"3px 9px",textTransform:"uppercase"},children:[Y.length," payment",1===Y.length?"":"s"]})]}),0===Y.length?(0,f.jsxs)("div",{style:{padding:"32px 20px",textAlign:"center"},children:[(0,f.jsx)("div",{style:{width:44,height:44,borderRadius:12,background:"#F7F7F9",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 12px",color:"#B5B5BC"},children:(0,f.jsx)(Dc.A,{size:22})}),(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600,marginBottom:4},children:"No payments recorded"}),(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0",marginBottom:14},children:"Record a manual payment or wait for Stripe."}),"Paid"!==s.status&&"Draft"!==s.status&&(0,f.jsx)("button",{onClick:()=>d(!0),style:{background:"#0A0A0B",color:"#fff",border:"none",borderRadius:9,padding:"9px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12.5,fontWeight:600,cursor:"pointer"},children:"Record Payment"})]}):(0,f.jsx)("div",{style:{padding:"8px 20px 16px"},children:Y.map((e,s)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10,padding:"12px 0",borderBottom:s<Y.length-1?"1px solid #F2F2F5":"none"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:11,minWidth:0},children:[(0,f.jsx)(p.A,{size:18,color:"#16A34A",style:{flexShrink:0,marginTop:2}}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:Cb,fontSize:14,fontWeight:700},children:V(e.amount)}),(0,f.jsxs)("div",{style:{fontFamily:Cb,fontSize:11,color:"#9A9AA0",marginTop:2},children:[J(e.payment_date)," \xb7 ",e.payment_method.replace("_"," ")]}),e.notes&&(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0",marginTop:3},children:e.notes})]})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0},children:[(0,f.jsx)("button",{onClick:()=>(async e=>{O(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!0}));try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,n=await fetch("".concat(I.fn,"/api/invoices/").concat(t,"/payments/").concat(e,"/send-receipt"),{method:"POST",headers:{Authorization:"Bearer ".concat(a)}});if(n.ok)alert("Receipt sent successfully!"),q();else{const e=await n.json();alert("Failed to send receipt: ".concat(e.detail||"Unknown error"))}}catch(a){console.error("Error sending receipt:",a),alert("Error sending receipt")}finally{O(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!1}))}})(e.payment_id),disabled:W[e.payment_id],title:"Send Receipt",style:{width:30,height:30,borderRadius:8,background:"#F7F7F9",border:"none",color:"#55555C",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",opacity:W[e.payment_id]?.5:1},children:W[e.payment_id]?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(T.A,{size:15})}),(0,f.jsx)("button",{onClick:()=>(async(e,s)=>{if(window.confirm("Remove payment of $".concat(s.toFixed(2),"? This will update the invoice totals."))){M(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!0}));try{var a;const s=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,n=await fetch("".concat(I.fn,"/api/invoices/").concat(t,"/paymen
1ts/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}});if(n.ok)alert("Payment removed successfully!"),q();else{const e=await n.json();alert("Failed to remove payment: ".concat(e.detail||"Unknown error"))}}catch(n){console.error("Error removing payment:",n),alert("Error removing payment")}finally{M(t=>(0,m.A)((0,m.A)({},t),{},{[e]:!1}))}}})(e.payment_id,e.amount),disabled:L[e.payment_id],title:"Remove Payment",style:{width:30,height:30,borderRadius:8,background:"#F7F7F9",border:"none",color:"#991B1B",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",opacity:L[e.payment_id]?.5:1},children:L[e.payment_id]?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(la.A,{size:15})})]})]},e.payment_id||s))})]}),s.activity_log&&s.activity_log.length>0&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Fb),{},{overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"Activity Log"}),(0,f.jsx)("div",{style:{padding:"6px 20px 16px"},children:(0,f.jsx)(Vl,{activities:s.activity_log,maxItems:20})})]})]})]}),x&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-lg shadow-xl max-w-md w-full p-6 max-h-[90vh] overflow-y-auto",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,f.jsx)("h3",{className:"text-xl font-bold text-gray-900",children:"reminder"===S?"Send Overdue Reminder":"Send Invoice"}),(0,f.jsx)("button",{onClick:()=>{u(!1),_("send"),F("now"),z(""),D("")},className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-6 w-6"})})]}),"send"===S&&(0,f.jsxs)("div",{className:"flex border border-gray-200 rounded-lg p-1 mb-4 bg-gray-50",children:[(0,f.jsx)("button",{type:"button",onClick:()=>F("now"),className:"flex-1 px-3 py-2 rounded-md text-sm font-medium ".concat("now"===C?"bg-white shadow text-gray-900":"text-gray-600 hover:text-gray-900"),children:"Send now"}),(0,f.jsxs)("button",{type:"button",onClick:()=>F("schedule"),className:"flex-1 px-3 py-2 rounded-md text-sm font-medium flex items-center justify-center gap-1 ".concat("schedule"===C?"bg-white shadow text-gray-900":"text-gray-600 hover:text-gray-900"),children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),"Schedule for later"]})]}),"send"===S&&"schedule"===C&&(0,f.jsxs)("div",{className:"mb-4 p-4 bg-indigo-50 border border-indigo-200 rounded-lg space-y-3",children:[(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:"Date"}),(0,f.jsx)("input",{type:"date",value:E,onChange:e=>z(e.target.value),className:"send-invoice-modal-input w-full px-3 py-2 rounded-lg text-sm"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-xs font-medium text-gray-700 mb-1",children:"Time"}),(0,f.jsx)("input",{type:"time",value:B,onChange:e=>D(e.target.value),className:"send-invoice-modal-input w-full px-3 py-2 rounded-lg text-sm"})]})]}),(0,f.jsx)("p",{className:"text-xs text-indigo-900",children:"Melbourne time (Australia/Melbourne). The invoice will be emailed automatically at this time."})]}),(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("p",{className:"text-gray-700",children:"reminder"===S?"Choose where to send the overdue reminder:":"Choose where to send this invoice:"}),(0,f.jsxs)("div",{className:"flex items-start space-x-3 p-4 border-2 border-gray-200 rounded-lg hover:border-blue-400 cursor-pointer",onClick:()=>y({use_client_email:!0,alternative_email:""}),children:[(0,f.jsx)("input",{type:"radio",checked:b.use_client_email,onChange:()=>y({use_client_email:!0,alternative_email:""}),className:"mt-1"}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"font-semibold text-gray-900",children:"Client Contact Email"}),(0,f.jsx)("p",{className:"text-sm text-gray-600",children:null===s||void 0===s?void 0:s.email})]})]}),(0,f.jsxs)("div",{className:"flex items-start space-x-3 p-4 border-2 border-gray-200 rounded-lg hover:border-blue-400 cursor-pointer",onClick:()=>y((0,m.A)((0,m.A)({},b),{},{use_client_email:!1})),children:[(0,f.jsx)("input",{type:"radio",checked:!b.use_client_email,onChange:()=>y((0,m.A)((0,m.A)({},b),{},{use_client_email:!1})),className:"mt-1"}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("p",{className:"font-semibold text-gray-900",children:"Alternative Email Address"}),(0,f.jsx)("p",{className:"text-sm text-gray-600 mb-2",children:"Send to a different email"}),!b.use_client_email&&(0,f.jsx)("input",{type:"email",value:b.alternative_email,onChange:e=>y((0,m.A)((0,m.A)({},b),{},{alternative_email:e.target.value})),onClick:e=>e.stopPropagation(),placeholder:"Enter email address",className:"send-invoice-modal-input w-full px-3 py-2 rounded-lg",required:!0})]})]})]}),(0,f.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-6",children:[(0,f.jsx)("button",{onClick:()=>u(!1),className:"px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50",children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>
1{if(!A)try{var e;const a=b.use_client_email?s.email:b.alternative_email;if(!a||!a.includes("@"))return void alert("Please enter a valid email address");const n="send"===S&&"schedule"===C;let r=null;if(n){if(!E||!B)return void alert("Please pick a date and time for the scheduled send");if(r=((e,t)=>{if(!e||!t)return null;const[s,a,n]=e.split("-").map(Number),[r,i]=t.split(":").map(Number),o=Date.UTC(s,a-1,n,r,i),l=new Intl.DateTimeFormat("en-US",{timeZone:"Australia/Melbourne",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),c=Object.fromEntries(l.formatToParts(new Date(o)).map(e=>[e.type,e.value])),d=Date.UTC(+c.year,+c.month-1,+c.day,+c.hour,+c.minute);return new Date(o-(d-o)).toISOString()})(E,B),!r||new Date(r).getTime()<=Date.now()+6e4)return void alert("Scheduled time must be at least 1 minute in the future (Melbourne time)")}k(!0);const i=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,o="reminder"===S?"".concat(I.fn,"/api/invoices/").concat(t,"/send-reminder"):"".concat(I.fn,"/api/invoices/").concat(t,"/send"),l={send_to_email:a};r&&(l.scheduled_send_at=r);const c=await fetch(o,{method:"POST",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(l)});if(c.ok){let e;e="reminder"===S?"Overdue reminder sent successfully to ".concat(a,"!"):n?"Invoice scheduled for ".concat(U(r)," to ").concat(a):"Invoice sent successfully to ".concat(a,"!"),alert(e),u(!1),_("send"),F("now"),z(""),D(""),q()}else{const e=await c.json();alert(e.detail||"Failed to send")}}catch(a){console.error("Error sending:",a),alert("Error sending")}finally{k(!1)}},disabled:A,className:"px-4 py-2 text-white rounded-lg flex items-center gap-2 ".concat(A?"bg-blue-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700"),children:[A&&(0,f.jsx)(Kr.A,{size:16,className:"animate-spin"}),A?"send"===S&&"schedule"===C?"Scheduling...":"Sending...":"reminder"===S?"Send Reminder":"schedule"===C?"Schedule Send":"Send Invoice"]})]})]})}),c&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-lg shadow-xl max-w-md w-full p-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,f.jsx)("h3",{className:"text-xl font-bold text-gray-900",children:"Record Payment"}),(0,f.jsx)("button",{onClick:()=>d(!1),className:"text-gray-400 hover:text-gray-600",children:(0,f.jsx)(g.A,{className:"h-6 w-6"})})]}),(0,f.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),!w){N(!0);try{var s;const e=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,a=await fetch("".concat(I.fn,"/api/invoices/").concat(t,"/manual-payment"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify((0,m.A)((0,m.A)({},v),{},{amount:parseFloat(v.amount)}))});if(a.ok)alert("Payment recorded successfully!"),d(!1),q();else{const e=await a.json();alert("Failed to record payment: ".concat(e.detail||"Unknown error"))}}catch(a){console.error("Error recording payment:",a),alert("Error recording payment")}finally{N(!1)}}},className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Amount *"}),(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",value:v.amount,onChange:e=>j((0,m.A)((0,m.A)({},v),{},{amount:e.target.value})),required:!0,className:"payment-modal-input w-full px-4 py-2 rounded-lg"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Payment Method *"}),(0,f.jsxs)("select",{value:v.payment_method,onChange:e=>j((0,m.A)((0,m.A)({},v),{},{payment_method:e.target.value})),required:!0,className:"payment-modal-select w-full px-4 py-2 rounded-lg",children:[(0,f.jsx)("option",{value:"direct_deposit",children:"Direct Deposit / Bank Transfer"}),(0,f.jsx)("option",{value:"manual",children:"Manual / Other"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Payment Date *"}),(0,f.jsx)("input",{type:"date",value:v.payment_date,onChange:e=>j((0,m.A)((0,m.A)({},v),{},{payment_date:e.target.value})),required:!0,className:"payment-modal-input w-full px-4 py-2 rounded-lg"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Notes"}),(0,f.jsx)("textarea",{value:v.notes,onChange:e=>j((0,m.A)((0,m.A)({},v),{},{notes:e.target.value})),rows:"3",className:"payment-modal-textarea w-full px-4 py-2 rounded-lg",placeholder:"Optional notes about this payment"})]}),(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)("input",{type:"checkbox",id:"send_receipt",checked:v.send_receipt,onChange:e=>j((0,m.A)((0,m.A)({},v),{},{send_receipt:e.target.checked})),className:"h-4 w-4 text-amber-600 focus:ring-amber-500 border-gray-300 rounded"}),(0,f.jsx)("label",{htmlFor:"send_receipt",className:"ml-2 text-sm text-gray-700",children:"Send payment receipt email to client"})]}),(0,f.jsxs)("div",{className:"flex items-center justify-end space-x-3 pt-4",children:[(0,f.jsx)("button",{type:"button",onClick:()=>d(!1),className:"px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50",children:"Cancel"}),(0,f.jsx)("button",{type:"submit",disabled:w,className:"px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg disabled:opacity-50 disabled:cursor-not-allowed",children:w?"Recording...":"Record Payment"})]})]})]})})]})},Bb="'Archivo',sans-serif",Db="'Hanken Grotesk',-apple-system,sans-serif",Ib="'Space Mono',monospace",Rb=e=>
1"$"+Number(e||0).toLocaleString("en-AU",{minimumFractionDigits:2,maximumFractionDigits:2}),Pb=e=>{if(!e)return"N/A";try{return new Date(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric"})}catch(t){return"N/A"}},Wb=e=>{if(!e)return"N/A";try{const t=new Date(e),s=String(t.getDate()).padStart(2,"0"),a=t.toLocaleDateString("en-AU",{month:"short"});return"".concat(s,"-").concat(a,"-").concat(t.getFullYear())}catch(t){return"N/A"}},Ob=e=>{let{kind:t}=e;return"visa"===t?(0,f.jsxs)("svg",{width:"38",height:"24",viewBox:"0 0 48 30",children:[(0,f.jsx)("rect",{width:"48",height:"30",rx:"4",fill:"#fff",stroke:"#E2DED6"}),(0,f.jsx)("text",{x:"24",y:"20",fontFamily:"Arial",fontWeight:"bold",fontStyle:"italic",fontSize:"12",fill:"#1A1F71",textAnchor:"middle",children:"VISA"})]}):"mc"===t?(0,f.jsxs)("svg",{width:"38",height:"24",viewBox:"0 0 48 30",children:[(0,f.jsx)("rect",{width:"48",height:"30",rx:"4",fill:"#fff",stroke:"#E2DED6"}),(0,f.jsx)("circle",{cx:"20",cy:"15",r:"7.5",fill:"#EB001B"}),(0,f.jsx)("circle",{cx:"28",cy:"15",r:"7.5",fill:"#F79E1B",fillOpacity:".88"})]}):(0,f.jsxs)("svg",{width:"38",height:"24",viewBox:"0 0 48 30",children:[(0,f.jsx)("rect",{width:"48",height:"30",rx:"4",fill:"#006FCF"}),(0,f.jsx)("text",{x:"24",y:"12.5",fontFamily:"Arial",fontWeight:"bold",fontSize:"5.5",fill:"#fff",textAnchor:"middle",children:"AMERICAN"}),(0,f.jsx)("text",{x:"24",y:"21",fontFamily:"Arial",fontWeight:"bold",fontSize:"5.5",fill:"#fff",textAnchor:"middle",children:"EXPRESS"})]})},Lb=e=>{let{value:t,label:s}=e;const[n,r]=(0,a.useState)(!1);return(0,f.jsx)("button",{type:"button",onClick:async e=>{e.stopPropagation();try{await navigator.clipboard.writeText(String(t)),r(!0),setTimeout(()=>r(!1),1400)}catch(s){}},title:n?"Copied":"Copy ".concat(s||"").trim(),style:{marginLeft:5,verticalAlign:"middle",display:"inline-flex",alignItems:"center",justifyContent:"center",width:20,height:20,padding:0,border:"none",background:"transparent",color:n?"#15803D":"#A7A39A",cursor:"pointer"},children:n?(0,f.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M20 6 9 17l-5-5"})}):(0,f.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),(0,f.jsx)("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})})},Mb=e=>{let{invoiceId:t,clientSecret:s,preparing:n,intentError:r,pi:i,amountDue:o,waived:l,noSurcharge:c,onPaid:d}=e;const m=(0,Bc.t2)(),p=(0,Bc.HH)(),[x,h]=(0,a.useState)(""),[u,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(""),v=i.total?i.base:o,j=i.total?i.surcharge:l||c?0:+(.03*o).toFixed(2),w=i.total||v+j,N={base:{fontFamily:"Hanken Grotesk, sans-serif",fontSize:"13.5px",color:"#141414","::placeholder":{color:"#B7B2A8"}},invalid:{color:"#BF212F"}},A=!m||!s||u||n;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{padding:"18px 24px 0"},children:[(0,f.jsxs)("div",{style:{border:"1px solid #E8E4DC",borderRadius:10,overflow:"hidden"},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"13px 16px",fontSize:12.5},children:[(0,f.jsx)("span",{style:{color:"#555350"},children:"Invoice amount"}),(0,f.jsx)("span",{style:{fontFamily:Ib},children:Rb(v)})]}),!c&&(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"13px 16px",fontSize:12.5,borderTop:"1px solid #F0EDE7",background:"#FBFAF8"},children:[(0,f.jsx)("span",{style:{color:"#555350"},children:l?"Card surcharge (waived)":"Card surcharge (3%)"}),(0,f.jsx)("span",{style:{fontFamily:Ib,color:l?"#15803D":"#555350"},children:l?"Waived":"+ ".concat(Rb(j))})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"15px 16px",borderTop:"2px solid #141414"},children:[(0,f.jsx)("span",{style:{fontFamily:Bb,fontWeight:700,fontSize:14},children:"Total to pay (AUD)"}),(0,f.jsx)("span",{style:{fontFamily:Ib,fontSize:19,fontWeight:700},children:Rb(w)})]})]}),(0,f.jsxs)("div",{style:{marginTop:16},children:[(0,f.jsx)("div",{style:{fontFamily:Ib,fontSize:9,letterSpacing:".16em",textTransform:"uppercase",color:"#8A8884",marginBottom:8},children:"Card Information"}),(0,f.jsxs)("div",{style:{border:"1px solid #DDD7CC",borderRadius:10,overflow:"hidden",background:"#fff",boxShadow:"0 1px 2px rgba(20,20,20,.04)"},children:[(0,f.jsx)("div",{style:{padding:"13px",borderBottom:"1px solid #EFEBE3"},children:(0,f.jsx)(Bc._D,{options:{style:N,showIcon:!0,placeholder:"Card number"}})}),(0,f.jsxs)("div",{style:{display:"flex"},children:[(0,f.jsx)("div",{style:{flex:1,padding:"13px",borderRight:"1px solid #EFEBE3"},children:(0,f.jsx)(Bc.qs,{options:{style:N}})}),(0,f.jsx)("div",{style:{flex:1,padding:"13px"},children:(0,f.jsx)(Bc.JG,{options:{style:N}})})]})]})]}),(0,f.jsxs)("div",{style:{marginTop:12},children:[(0,f.jsx)("div",{style:{fontFamily:Ib,fontSize:9,letterSpacing:".16em",textTransform:"uppercase",color:"#8A8884",marginBottom:8},children:"Name on Card"}),(0,f.jsx)("input",{type:"text",value:x,onChange:e=>h(e.target.value),placeholder:"Full name",style:{width:"100%",border:"1px solid #DDD7CC",borderRadius:10,padding:13,fontSize:13.5,fontFamily:Db,color:"#141414",background:"#fff",boxShadow:"0 1px 2px rgba(20,20,20,.04)",outline:"none",boxSizing:"border-box"}})]}),(b||r)&&(0,f.jsx)("div",{style:{marginTop:12,background:"#FDECEC",border:"1px solid #F3C9CC",color:"#991B1B",borderRadius:8,padding:"10px 12px",fontSize:12.5},children:b||r})]}),(0,f.jsxs)("div",{style:{padding:"18px 24px 22px"},children:[(0,f.jsx)("button",{onClick:async()=>
1{if(!m||!p||!s)return;g(!0),y("");const{error:e,paymentIntent:t}=await m.confirmCardPayment(s,{payment_method:{card:p.getElement(Bc._D),billing_details:{name:x}}});if(e)return y(e.message||"Payment could not be completed."),void g(!1);t&&"succeeded"===t.status?await d(t.id):(y("Payment did not complete. Please try again."),g(!1))},disabled:A,className:"invp-pay",style:{width:"100%",background:"#BF212F",border:"none",borderRadius:10,padding:15,fontFamily:Db,fontSize:14.5,fontWeight:700,color:"#fff",cursor:A?"default":"pointer",opacity:A?.6:1,display:"flex",alignItems:"center",justifyContent:"center",gap:8,boxShadow:"0 2px 8px rgba(191,33,47,.3)"},children:u?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{style:{width:15,height:15,borderRadius:"50%",border:"2px solid rgba(255,255,255,.4)",borderTopColor:"#fff",animation:"invp-spin .7s linear infinite"}})," Processing\u2026"]}):n?"Preparing\u2026":(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2"}),(0,f.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})," Pay ",Rb(w)]})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6,marginTop:12,fontFamily:Ib,fontSize:9.5,letterSpacing:".06em",color:"#8A8884"},children:[(0,f.jsxs)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2"}),(0,f.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),(0,f.jsx)("span",{children:"Encrypted & secured by Stripe"})]})]})]})},qb={minHeight:"100vh",background:"#EDEBE6",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:Db,color:"#141414"},Hb=e=>
1({width:42,height:42,borderRadius:"50%",border:"3px solid #E2DED6",borderTopColor:e,animation:"invp-spin .8s linear infinite",margin:"0 auto"}),Ub={display:"flex",justifyContent:"space-between",gap:12},Gb={fontFamily:Ib,fontSize:9,letterSpacing:".1em",textTransform:"uppercase",color:"#9A9AA0"},Vb={fontFamily:Ib,fontSize:12,color:"#fff"},Jb={fontFamily:Ib,fontSize:9,letterSpacing:".16em",textTransform:"uppercase",color:"#8A8884",marginBottom:9},Yb={fontSize:11.5,color:"#555350",lineHeight:1.7,marginTop:5},Kb={fontFamily:Ib,fontSize:8.5,letterSpacing:".12em",textTransform:"uppercase",color:"#555350",fontWeight:400,padding:"9px 12px"},Zb={display:"flex",justifyContent:"space-between",padding:"6px 0",fontSize:12.5},$b=()=>{const{invoiceId:e}=(0,r.g)(),[t,n]=(0,a.useState)(null),[i,o]=(0,a.useState)(!0),[l,c]=(0,a.useState)(null),[d,p]=(0,a.useState)(!1),[x,h]=(0,a.useState)(null),[u,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)({base:0,surcharge:0,total:0}),[w,N]=(0,a.useState)(null),[A,k]=(0,a.useState)(!1);(0,a.useEffect)(()=>{S()},[e]),(0,a.useEffect)(()=>{(async()=>{try{const e=await fetch("".concat(I.fn,"/api/invoices/config/stripe")),t=await e.json();if(t.publishable_key){const{loadStripe:e}=await Promise.resolve().then(s.bind(s,69677));h(e(t.publishable_key))}}catch(e){}})()},[]);const S=async()=>{o(!0),c(null);try{const t=await fetch("".concat(I.fn,"/api/invoices/").concat(e));t.ok?n(await t.json()):404===t.status?c("Invoice not found"):c("Failed to load invoice")}catch(t){c("Error loading invoice")}finally{o(!1)}},_=async()=>{g(!0),N(null),y(null),k(!0);try{const t=await fetch("".concat(I.fn,"/api/invoices/").concat(e,"/create-payment-intent"),{method:"POST",headers:{"Content-Type":"application/json"}}),s=await t.json();if(!t.ok||!s.client_secret)throw new Error(s.detail||"Could not start payment");y(s.client_secret),j({base:s.amount,surcharge:s.surcharge,total:s.total})}catch(t){N(t.message||"Could not start payment")}finally{k(!1)}},C=()=>g(!1);if(i)return(0,f.jsx)("div",{style:qb,children:(0,f.jsxs)("div",{style:{textAlign:"center"},children:[(0,f.jsx)("div",{style:Hb("#BF212F")}),(0,f.jsx)("div",{style:{marginTop:18,fontFamily:Ib,fontSize:11,letterSpacing:".18em",textTransform:"uppercase",color:"#8A8884"},children:"Loading Invoice"})]})});if(d)return(0,f.jsx)("div",{style:qb,children:(0,f.jsxs)("div",{style:{textAlign:"center",maxWidth:340,padding:24},children:[(0,f.jsx)("div",{style:Hb("#16A34A")}),(0,f.jsx)("div",{style:{marginTop:18,fontFamily:Bb,fontWeight:700,fontSize:18},children:"Verifying your payment\u2026"}),(0,f.jsx)("div",{style:{marginTop:8,fontSize:13.5,color:"#555350",lineHeight:1.55},children:"This usually takes a few seconds. Please don\u2019t close this window \u2014 we\u2019ll update your invoice as soon as it clears."})]})});if(l)return(0,f.jsx)("div",{style:qb,children:(0,f.jsxs)("div",{style:{textAlign:"center",maxWidth:360,padding:24},children:[(0,f.jsx)("div",{style:{width:56,height:56,borderRadius:14,background:"#FDECEC",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"#BF212F"},children:(0,f.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,f.jsx)("path",{d:"M12 8v4"}),(0,f.jsx)("path",{d:"M12 16h.01"})]})}),(0,f.jsx)("div",{style:{marginTop:18,fontFamily:Bb,fontWeight:800,fontSize:20},children:"Invoice Not Available"}),(0,f.jsx)("div",{style:{marginTop:10,fontSize:13.5,color:"#555350",lineHeight:1.6},children:"We couldn\u2019t load this invoice. The link may have expired or been mistyped. If you think this is an error, get in touch and we\u2019ll sort it out."}),(0,f.jsx)("a",{href:"mailto:[email protected]",style:{marginTop:14,display:"inline-block",fontFamily:Ib,fontSize:12,letterSpacing:".06em",color:"#BF212F",textDecoration:"none",borderBottom:"1px solid #E6A6AB",paddingBottom:2},children:"[email protected]"})]})});const F="Paid"===t.status,E="Overdue"===t.status,T=!F,z=t.total||0,B=null!=t.amount_due?t.amount_due:z,D=(t.payments||[]).reduce((e,t)=>
1e+(t.surcharge||0),0),R=!1===t.card_surcharge_applies;let P,W,O,L,M,q,H;F?(P="Paid in Full",W=Rb(z),O="#5FD08A",L="#5FD08A",M=t.paid_at?"Paid ".concat(Pb(t.paid_at)):"Paid in full",q="#9A9AA0",H="#16A34A"):E?(P="Amount Due",W=Rb(B),O="#FF6B6B",L="#F2A900",M="Overdue \xb7 includes late fees",q="#FF8A8A",H="#BF212F"):(P="Amount Due",W=Rb(B),O="#FFFFFF",L="#F2A900",M="Due ".concat(Pb(t.due_date)),q="#FFFFFF",H="#0A0A0B");const U=[t.contact_name,t.position].filter(Boolean).join(" \xb7 "),G=[t.street_address,t.city,t.state,t.postal_code].filter(Boolean).join(", ");return(0,f.jsxs)("div",{style:{fontFamily:Db,color:"#141414",minHeight:"100vh",background:"#EDEBE6",WebkitFontSmoothing:"antialiased"},children:[(0,f.jsx)("style",{children:"\n .invp-actbtn:hover{background:#F4F2EE !important;border-color:#C9C3B7 !important;}\n .invp-pay:hover{background:#A81B28 !important;border-color:#A81B28 !important;}\n .invp-close:hover{background:#E8E4DC !important;}\n @keyframes invp-spin{to{transform:rotate(360deg);}}\n @media (max-width:640px){\n .invp-actnum{display:none !important;}\n .invp-head{padding:26px 20px 0 !important;}\n .invp-title{font-size:20px !important;}\n .invp-banner{margin:18px 20px 0 !important;}\n .invp-strip{flex-direction:column !important;margin:18px 20px 0 !important;}\n .invp-strip>div{border-left:none !important;}\n .invp-strip>div:last-child{border-top:1px solid #1F1F23;}\n .invp-body{padding:22px 20px 30px !important;}\n .invp-parties{flex-direction:column !important;gap:18px !important;}\n .invp-parties>div:last-child{border-left:none !important;padding-left:0 !important;border-top:1px solid #E2DED6;padding-top:18px;}\n .invp-totals{width:100% !important;}\n .invp-foot{padding:16px 20px !important;}\n .invp-paycols{flex-direction:column !important;}\n }\n "}),(0,f.jsx)("header",{style:{position:"sticky",top:0,zIndex:30,background:"rgba(237,235,230,.82)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",borderBottom:"1px solid #DFDBD2"},children:(0,f.jsxs)("div",{style:{maxWidth:760,margin:"0 auto",padding:"13px 20px",display:"flex",alignItems:"center",gap:14},children:[(0,f.jsx)("img",{src:"/turbo-logo-light.png",alt:"Turbo 360",style:{height:22}}),(0,f.jsx)("div",{className:"invp-actnum",style:{fontFamily:Ib,fontSize:12,letterSpacing:".04em",color:"#555350",borderLeft:"1px solid #D4CFC5",paddingLeft:14},children:t.invoice_number}),(0,f.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:10},children:[(0,f.jsxs)("button",{onClick:()=>{window.open("".concat(I.fn,"/api/invoices/").concat(e,"/pdf"),"_blank")},className:"invp-actbtn",style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #D9D4CA",borderRadius:8,padding:"9px 14px",fontFamily:Db,fontSize:13,fontWeight:600,color:"#2B2B2B",cursor:"pointer"},children:[(0,f.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,f.jsx)("polyline",{points:"7 10 12 15 17 10"}),(0,f.jsx)("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]}),(0,f.jsx)("span",{children:"Download PDF"})]}),T&&(0,f.jsxs)("button",{onClick:_,className:"invp-pay",style:{display:"flex",alignItems:"center",gap:7,background:"#BF212F",border:"1px solid #BF212F",borderRadius:8,padding:"9px 18px",fontFamily:Db,fontSize:13,fontWeight:700,color:"#fff",cursor:"pointer",boxShadow:"0 1px 2px rgba(191,33,47,.3)"},children:[(0,f.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("rect",{width:"20",height:"14",x:"2",y:"5",rx:"2"}),(0,f.jsx)("line",{x1:"2",x2:"22",y1:"10",y2:"10"})]}),(0,f.jsx)("span",{children:"Pay Now"})]})]})]})}),(0,f.jsx)("main",{style:{maxWidth:760,margin:"0 auto",padding:"32px 20px 64px"},children:(0,f.jsxs)("div",{style:{background:"#fff",border:"1px solid #E2DED6",borderRadius:4,boxShadow:"0 18px 50px -28px rgba(20,20,20,.28)",overflow:"hidden"},children:[(0,f.jsxs)("div",{className:"invp-head",style:{padding:"44px 48px 0"},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",ga
1p:24},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("img",{src:"/turbo-logo-light.png",alt:"Turbo 360",style:{height:32,display:"block",marginBottom:13}}),(0,f.jsx)("div",{style:{fontFamily:Ib,fontSize:9.5,letterSpacing:".2em",textTransform:"uppercase",color:"#8A8884"},children:"Professional Media Production"})]}),(0,f.jsxs)("div",{style:{textAlign:"right",flexShrink:0},children:[(0,f.jsx)("div",{className:"invp-title",style:{fontFamily:"'Archivo Expanded','Archivo',sans-serif",fontSize:30,fontWeight:800,letterSpacing:"-.01em",lineHeight:1},children:"TAX INVOICE"}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:8,marginTop:13},children:[(0,f.jsx)("span",{style:{fontFamily:Ib,fontSize:13,color:"#141414",letterSpacing:".02em"},children:t.invoice_number}),t.purchase_order&&(0,f.jsxs)("span",{style:{fontFamily:Ib,fontSize:9,letterSpacing:".08em",textTransform:"uppercase",color:"#92400E",background:"#FEF3C7",borderRadius:3,padding:"3px 7px"},children:["PO ",t.purchase_order]})]})]})]}),(0,f.jsx)("div",{style:{height:3,width:54,background:"#BF212F",marginTop:24}})]}),F&&(0,f.jsxs)("div",{className:"invp-banner",style:{margin:"24px 48px 0",display:"flex",alignItems:"center",gap:10,background:"#E8F6EE",border:"1px solid #BFE6CD",borderRadius:6,padding:"11px 16px"},children:[(0,f.jsx)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"#15803D",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:(0,f.jsx)("path",{d:"M20 6 9 17l-5-5"})}),(0,f.jsx)("span",{style:{fontFamily:Bb,fontWeight:700,fontSize:13,letterSpacing:".02em",color:"#15803D"},children:"PAID IN FULL"}),(0,f.jsx)("span",{style:{marginLeft:"auto",fontFamily:Ib,fontSize:11,color:"#3F8C5C"},children:"Thank you"})]}),E&&(0,f.jsxs)("div",{className:"invp-banner",style:{margin:"24px 48px 0",display:"flex",alignItems:"center",gap:10,background:"#FDECEC",border:"1px solid #F3C9CC",borderRadius:6,padding:"11px 16px"},children:[(0,f.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"#BF212F",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),(0,f.jsx)("path",{d:"M12 9v4"}),(0,f.jsx)("path",{d:"M12 17h.01"})]}),(0,f.jsx)("span",{style:{fontFamily:Bb,fontWeight:700,fontSize:13,letterSpacing:".02em",color:"#991B1B"},children:"OVERDUE \u2014 PAYMENT REQUIRED"}),(0,f.jsxs)("span",{style:{marginLeft:"auto",fontFamily:Ib,fontSize:11,color:"#B4474F"},children:["Due ",Pb(t.due_date)]})]}),(0,f.jsxs)("div",{className:"invp-strip",style:{margin:"24px 48px 0",background:"#0A0A0B",borderRadius:10,display:"flex",overflow:"hidden",position:"relative"},children:[(0,f.jsx)("img",{src:"/turbo-mark-red.png",alt:"",style:{position:"absolute",right:"33%",bottom:-22,width:88,opacity:.16,pointerEvents:"none"}}),(0,f.jsxs)("div",{style:{flex:1.25,padding:"22px 28px",position:"relative"},children:[(0,f.jsx)("div",{style:{fontFamily:Ib,fontSize:9.5,letterSpacing:".18em",textTransform:"uppercase",color:L,marginBottom:11},children:P}),(0,f.jsx)("div",{style:{fontFamily:Ib,fontSize:33,fontWeight:700,letterSpacing:"-.02em",lineHeight:1,color:O},children:W}),(0,f.jsx)("div",{style:{marginTop:11,fontSize:12,color:"#9A9AA0"},children:M})]}),(0,f.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",gap:11,padding:"22px 26px",borderLeft:"1px solid #1F1F23"},children:[(0,f.jsxs)("div",{style:Ub,children:[(0,f.jsx)("span",{style:Gb,children:"Issued"}),(0,f.jsx)("span",{style:Vb,children:Pb(t.issue_date||t.created_date)})]}),(0,f.jsxs)("div",{style:Ub,children:[(0,f.jsx)("span",{style:Gb,children:"Due"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Vb),{},{fontWeight:700,color:q}),children:Pb(t.due_date)})]}),t.job_date&&(0,f.jsxs)("div",{style:Ub,children:[(0,f.jsx)("span",{style:Gb,children:"Job Date"}),(0,f.jsx)("span",{style:Vb,children:Wb(t.job_date)})]})]})]}),(0,f.jsxs)("div",{className:"invp-body",style:{padding:"30px 48px 42px"},children:[(0,f.jsxs)("div",{className:"invp-parties",style:{display:"flex",gap:32,marginBottom:30},children:[(0,f.jsxs)("div",{style:{flex:1},children:[(0,f.jsx)("div",{style:Jb,children:"From"}),(0,f.jsx)("div",{style:{fontSize:13,fontWeight:700},children:"Turbo Productions Pty Ltd"}),(0,f.jsxs)("div",{style:Yb,children:["ABN 18 150 556 102",(0,f.jsx)("br",{}
1),"PO Box 1233, Barwon Heads VIC 3227",(0,f.jsx)("br",{}),"1300 207 446 \xb7 [email protected]"]})]}),(0,f.jsxs)("div",{style:{flex:1,borderLeft:"1px solid #E2DED6",paddingLeft:32},children:[(0,f.jsx)("div",{style:Jb,children:"Bill To"}),(0,f.jsx)("div",{style:{fontSize:13,fontWeight:700},children:t.client_company}),(0,f.jsxs)("div",{style:Yb,children:[U&&(0,f.jsxs)(f.Fragment,{children:[U,(0,f.jsx)("br",{})]}),t.abn&&(0,f.jsxs)(f.Fragment,{children:["ABN ",t.abn,(0,f.jsx)("br",{})]}),G&&(0,f.jsxs)(f.Fragment,{children:[G,(0,f.jsx)("br",{})]}),t.email]})]})]}),(0,f.jsxs)("table",{style:{borderCollapse:"collapse",width:"100%",marginBottom:20},children:[(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{style:{background:"#F4F2EE"},children:[(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},Kb),{},{textAlign:"left",borderRadius:"4px 0 0 4px"}),children:"Description"}),(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},Kb),{},{textAlign:"center",width:46}),children:"Qty"}),(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},Kb),{},{textAlign:"right",width:96}),children:"Unit Price"}),(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},Kb),{},{textAlign:"right",width:100,borderRadius:"0 4px 4px 0"}),children:"Amount"})]})}),(0,f.jsx)("tbody",{children:(t.service_items||[]).map((e,t)=>(0,f.jsxs)("tr",{style:{borderBottom:"1px solid #EFEDE7"},children:[(0,f.jsxs)("td",{style:{padding:"13px 12px",verticalAlign:"top"},children:[(0,f.jsx)("div",{style:{fontSize:12.5,fontWeight:600},children:e.name}),e.description&&(0,f.jsx)("div",{style:{fontSize:11,color:"#8A8884",marginTop:2},children:e.description})]}),(0,f.jsx)("td",{style:{textAlign:"center",fontFamily:Ib,fontSize:12,verticalAlign:"top",paddingTop:13},children:e.quantity}),(0,f.jsx)("td",{style:{textAlign:"right",fontFamily:Ib,fontSize:12,verticalAlign:"top",paddingTop:13},children:Rb(e.unit_price)}),(0,f.jsx)("td",{style:{textAlign:"right",fontFamily:Ib,fontSize:12,fontWeight:700,verticalAlign:"top",padding:"13px 12px 0 0"},children:Rb((e.quantity||0)*(e.unit_price||0))})]},t))})]}),(0,f.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:32},children:(0,f.jsxs)("div",{className:"invp-totals",style:{width:300},children:[(0,f.jsxs)("div",{style:Zb,children:[(0,f.jsx)("span",{style:{color:"#555350"},children:"Subtotal"}),(0,f.jsx)("span",{style:{fontFamily:Ib},children:Rb(t.subtotal)})]}),t.discount_value>0&&(0,f.jsxs)("div",{style:Zb,children:[(0,f.jsxs)("span",{style:{color:"#555350"},children:["Discount ",t.discount_reason&&(0,f.jsxs)("span",{style:{color:"#8A8884"},children:["(",t.discount_reason,")"]})]}),(0,f.jsxs)("span",{style:{fontFamily:Ib,color:"#15803D"},children:["\u2212",Rb(t.discount_value)]})]}),(0,f.jsxs)("div",{style:Zb,children:[(0,f.jsx)("span",{style:{color:"#555350"},children:"GST (10%)"}),(0,f.jsx)("span",{style:{fontFamily:Ib},children:Rb(t.gst)})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"11px 0 0",marginTop:5,borderTop:"2px solid #141414",fontSize:15,fontWeight:700},children:[(0,f.jsx)("span",{style:{fontFamily:Bb},children:"Total"}),(0,f.jsx)("span",{style:{fontFamily:Ib},children:Rb(t.total)})]}),t.total_paid>0&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Zb),{},{paddingTop:8}),children:[(0,f.jsx)("span",{style:{color:"#555350"},children:"Paid"}),(0,f.jsxs)("span",{style:{fontFamily:Ib,color:"#15803D"},children:["\u2212",Rb(t.total_paid)]})]}),D>0&&(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"5px 0 0",fontSize:11},children:[(0,f.jsx)("span",{style:{color:"#8A8884"},children:"Inc. Stripe Surcharge (3%)"}),(0,f.jsx)("span",{style:{fontFamily:Ib,color:"#8A8884"},children:Rb(D)})]}),t.late_fees>0&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Zb),{},{paddingTop:8}),children:[(0,f.jsx)("span",{style:{color:"#B45309"},children:"Late Fees (15%/mo)"}),(0,f.jsx)("span",{style:{fontFamily:Ib,color:"#B45309"},children:Rb(t.late_fees)})]}),T&&(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"13px 16px",marginTop:12,background:H,borderRadius:6,color:"#fff"},children:[(0,f.jsx)("span",{style:{fontFamily:Bb,fontSize:13,fontWeight:700},children:"Amount Due"}),(0,f.jsx)("span",{style:{fontFamily:Ib,fontSize:18,fontWeight:700},children:Rb(B)})]})]})}),T&&(0,f.jsxs)("div",{style:{borderTop:"1px solid #E2DED6",paddingTop:26},children:[(0,f.jsx)("div",{style:{fontFamily:Ib,fontSize:9.5,letterSpacing:".16em",textTransform:"uppercase",color:"#141414",marginBottom:16},children:"How to Pay"}),(0,f.jsxs)("div",{style:{background:"#F4F2EE",border:"1px solid #E8E4DC",borderRadius:8,padding:"18px 20px",display:"flex",alignItems:"center",gap:20,flexWrap:"wrap",marginBottom:14},children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:220},children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:700,marginBottom:4},children:"Pay by Card \xb7 Online"}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#555350",lineHeight:1.5,marginBottom:11},children:R?"Secure card payment via Stripe.":"Secure card payment via Stripe. A 3
1% surcharge applies to card payments."}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:7},children:[(0,f.jsx)(Ob,{kind:"visa"}),(0,f.jsx)(Ob,{kind:"mc"}),(0,f.jsx)(Ob,{kind:"amex"})]})]}),(0,f.jsxs)("button",{onClick:_,className:"invp-pay",style:{display:"flex",alignItems:"center",gap:8,background:"#BF212F",border:"none",borderRadius:8,padding:"13px 24px",fontFamily:Db,fontSize:14,fontWeight:700,color:"#fff",cursor:"pointer",boxShadow:"0 2px 6px rgba(191,33,47,.28)",whiteSpace:"nowrap"},children:["Pay ",Rb(B)," ",(0,f.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M5 12h14"}),(0,f.jsx)("path",{d:"m12 5 7 7-7 7"})]})]})]}),(0,f.jsxs)("div",{className:"invp-paycols",style:{display:"flex",gap:14,flexWrap:"wrap",marginBottom:16},children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:220,border:"1px solid #E8E4DC",borderRadius:8,padding:"16px 18px"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,marginBottom:9},children:[(0,f.jsx)("span",{style:{width:30,height:30,borderRadius:8,background:"#0A0A0B",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("rect",{width:"20",height:"12",x:"2",y:"7",rx:"2"}),(0,f.jsx)("path",{d:"M22 10H2"}),(0,f.jsx)("path",{d:"m6 4 6-2 6 2"})]})}),(0,f.jsx)("span",{style:{fontFamily:Bb,fontWeight:800,fontSize:15,letterSpacing:"-.01em"},children:"Direct Deposit"})]}),(0,f.jsxs)("div",{style:{fontFamily:Ib,fontSize:11.5,color:"#555350",lineHeight:1.8},children:["Turbo Productions Pty Ltd",(0,f.jsx)("br",{}),"BSB ",(0,f.jsx)("span",{style:{fontFamily:Db,color:"#141414",fontWeight:700},children:"063169"}),(0,f.jsx)(Lb,{value:"063169",label:"BSB"})," \xb7 Acct ",(0,f.jsx)("span",{style:{fontFamily:Db,color:"#141414",fontWeight:700},children:"10452103"}),(0,f.jsx)(Lb,{value:"10452103",label:"account number"}),(0,f.jsx)("br",{}),"Reference ",(0,f.jsx)("span",{style:{color:"#BF212F",fontWeight:700},children:t.invoice_number})]})]}),(0,f.jsxs)("div",{style:{flex:1,minWidth:220,border:"1px solid #E8E4DC",borderRadius:8,padding:"16px 18px"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,marginBottom:9},children:[(0,f.jsxs)("svg",{width:"30",height:"30",viewBox:"0 0 32 32",children:[(0,f.jsx)("rect",{width:"32",height:"32",rx:"8",fill:"#1FB6A6"}),(0,f.jsx)("path",{d:"M10 9h6.5a4.5 4.5 0 0 1 0 9H14v5h-4z",fill:"#fff"})]}),(0,f.jsx)("span",{style:{fontFamily:Bb,fontWeight:800,fontSize:15,letterSpacing:"-.01em"},children:"PayID"}),(0,f.jsx)("span",{style:{marginLeft:"auto",fontFamily:Ib,fontSize:8.5,letterSpacing:".08em",color:"#15803D",background:"#E8F6EE",borderRadius:4,padding:"3px 7px"},children:"NO SURCHARGE"})]}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#555350",lineHeight:1.55,marginBottom:8},children:"Pay instantly from your banking app \u2014 no card fees."}),(0,f.jsx)("div",{style:{fontFamily:Ib,fontSize:12.5,fontWeight:700,color:"#141414",background:"#F4F2EE",borderRadius:5,padding:"8px 11px"},children:"[email protected]"})]})]}),(0,f.jsx)("div",{style:{fontSize:11,color:"#8A8884",lineHeight:1.5},children:"Late fees of 15% per month will be applied to overdue invoices."})]})]}),(0,f.jsxs)("div",{className:"invp-foot",style:{background:"#0A0A0B",padding:"20px 48px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:16,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{fontFamily:Bb,fontWeight:700,fontSize:13,color:"#fff",letterSpacing:".01em"},children:"Thank you for your business."}),(0,f.jsx)("span",{style:{fontFamily:Ib,fontSize:10.5,letterSpacing:".04em",color:"#9A9AA0"},children:"turbo.net.au \xb7 [email protected] \xb7 1300 207 446"})]})]})}),u&&(0,f.jsxs)("div",{style:{position:"fixed",inset:0,zIndex:60,display:"flex",alignItems:"center",justifyContent:"center",padding:20},children:[(0,f.jsx)("div",{onClick:C,style:{position:"absolute",inset:0,background:"rgba(10,10,11,.5)",backdropFilter:"blur(3px)",WebkitBackdropFilter:"blur(3px)"}}),(0,f.jsxs)("div",{style:{position:"relative",width:440,maxWidth:"100%",maxHeight:"92vh",overflowY:"auto",background:"#fff",borderRadius:14,boxShadow:"0 30px 70px rgba(10,10,11,.4)",overflowX:"hidden"},children:[(0,f.jsxs)("div",{style:{display:"flex",height:4},children:[(0,f.jsx)("div",{style:{flex:1,background:"#BF212F"}}),(0,f.jsx)("div",{style:{flex:1,background:"#F2A900"}}),(0,f.jsx)("div",{style:{flex:1,background:"#0FA3A3"}})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 24px 0"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontFamily:Ib,fontSize:9.5,letterSpacing:".16em",textTransform:"uppercase",color:"#8A8884",marginBottom:4},children:"Pay Invoice"}),(0,f.jsx)("div",{style:{fontFamily:Bb,fontWeight:800,fontSize:18},children:t.invoice_number})]}),(0,f.jsx)("button",{onClick:C,className:"invp-close",style:{width:32,height:32,borderRadius:8,background:"#F4F2EE",border:"none",color:"#555350",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,f.jsx)("path",{d:"M18 6 6 18"}),(0,f.jsx)("path",{d:"m6 6 12 12"})]})})]}),(0,f.jsx)(Bc.S8,{stripe:x,children:(0,f.jsx)(Mb,{invoiceId:e,clientSecret:b,preparing:A,intentError:w,pi:v,amountDue:B,waived:!!t.waive_credit_card_surcharge,noSurcharge:R&&!t.waive_credit_card_surcharge,onPaid:async t=>{g(!1),p(!0);try{await fetch("".concat(I.fn,"/api/invoices/").concat(e,"/confirm-payment"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({payment_intent_id:t})})}catch(s){}await S(),p(!1)}})})]})]})]})},Qb="'Space Mono',monospace",Xb={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},ey={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},ty={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},sy=e=>{let{title:t,children:s,right:a}=e;return(0,f.jsxs)(Ls,{style:{padding:22},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:t}),a]}),s]})},ay=()=>{const e=(0,r.Zp)(),{recurringId:t}=(0,r.g)(),s=!!t,[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)([]),[d,p]=(0,a.useState)(!1),[x,h]=(0,a.useState)({template_name:"",client_id:"",client_company:"",contact_name:"",position:"",email:"",ph
1one:"",street_address:"",city:"",state:"",postal_code:"",country:"",abn:"",project_name:"",job_location:"",purchase_order:"",service_items:[],frequency:"Monthly",day_of_month:1,month_of_year:1,notes:""}),[u,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(async()=>{await(0,o.cd)()?(j(),w(),s&&N()):e("/admin")})()},[e,s]);const j=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();c(e.clients||[])}}catch(t){console.error("Error loading contacts:",t)}},w=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/services"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();i(e.services||[])}}catch(t){console.error("Error loading services:",t)}},N=async()=>{b(!0);try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(I.fn,"/api/recurring-invoices/").concat(t),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const e=await a.json();h({template_name:e.template_name,client_id:e.client_id||"",client_company:e.client_company,contact_name:e.contact_name,position:e.position||"",email:e.email,phone:e.phone,street_address:e.street_address||"",city:e.city||"",state:e.state||"",postal_code:e.postal_code||"",country:e.country||"",abn:e.abn||"",project_name:e.project_name,job_location:e.job_location||"",purchase_order:e.purchase_order||"",service_items:e.service_items||[],frequency:e.frequency,day_of_month:e.day_of_month,month_of_year:e.month_of_year||1,notes:e.notes||""})}}catch(s){console.error("Error loading recurring invoice:",s)}finally{b(!1)}},A=(e,t,s)=>{const a=[...x.service_items];a[e][t]=s,h((0,m.A)((0,m.A)({},x),{},{service_items:a}))},{subtotal:k,gst:S,total:_}=(()=>{const e=x.service_items.reduce((e,t)=>e+t.quantity*t.unit_price,0),t=.1*e;return{subtotal:e,gst:t,total:e+t}})(),C=e=>t=>h((0,m.A)((0,m.A)({},x),{},{[e]:t.target.value})),F={display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",opacity:y||0===x.service_items.length?.6:1};return(0,f.jsxs)(ta,{title:s?"Edit Recurring Invoice":"New Recurring Invoice",meta:"FINANCE \xb7 RECURRING",children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>e("/admin/invoices"),style:{display:"inline-flex",alignItems:"center",gap:7,fontSize:13,fontWeight:600,color:"#55555C",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{size:15})," Invoices"]}),(0,f.jsx)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:s?x.template_name||"Edit Recurring Invoice":"New Recurring Invoice"}),(0,f.jsx)("div",{style:{marginLeft:"auto"},children:(0,f.jsxs)("button",{type:"submit",form:"recurring-form",className:"tg-btn-primary",disabled:y||0===x.service_items.length,style:F,children:[(0,f.jsx)(ia.A,{size:15})," ",y?"Saving\u2026":s?"Update Template":"Create Recurring Invoice"]})})]}),u?(0,f.jsx)(Ws,{rows:6}):(0,f.jsxs)("form",{id:"recurring-form",onSubmit:async a=>{a.preventDefault(),v(!0);try{var n;const a=null===(n=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===n?void 0:n.token,r=s?"".concat(I.fn,"/api/recurring-invoices/").concat(t):"".concat(I.fn,"/api/recurring-invoices"),i=await fetch(r,{method:s?"PUT":"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify(x)});if(i.ok)e("/admin/invoices");else{const e=(await i.json()).detail,t=Array.isArray(e)?e.map(e=>{var t;return"".concat(null===(t=e.loc)||void 0===t?void 0:t.join(" \u2192 "),": ").concat(e.msg)}).join("\n"):e||"Unknown error";alert("Failed to save:\n".concat(t))}}catch(r){console.error("Error saving:",r),alert("Error saving recurring invoice")}finally{v(!1)}},style:{maxWidth:880,display:"flex",flexDirection:"column",gap:18},children:[(0,f.jsx)(sy,{title:"Template Settings",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:Xb,children:"Template Name *"}),(0,f.jsx)("input",{type:"text",value:x.template_name,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{template_name:e.target.value})),required:!0,style:ey,placeholder:"e.g., Monthly Retainer - ABC Corp"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xb,children:"Frequency *"}),(0,f.jsxs)("select",{value:x.frequency,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{frequency:e.target.value})),required:!0,style:ey,children:[(0,f.jsx)("option",{value:"Monthly",children:"Monthly"}),(0,f.jsx)("option",{value:"Quarterly",children:"Every 3 Months"}),(0,f.jsx)("option",{value:"Semi-Annually",children:"Every 6 Months"}),(0,f.jsx)("option",{value:"Annually",children:"Annually"}),(0,f.jsx)("option",{value:"Biennial",children:"Every 2 Years"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xb,children:"Day of Month *"}),(0,f.jsx)("input",{type:"number",min:"1",max:"28",value:x.day_of_month,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{day_of_month:parseInt(e.target.value)})),required:!0,style:(0,m.A)((0,m.A)({},ey),{},{fontFamily:Qb})}),(0,f.jsx)("p",{style:{fontSize:11,color:"#9A9AA0",marginTop:6,marginBottom:0},children:"Day 1-28 (to avoid month-end issues)"})]}),("Annually"===x.frequency||"Biennial"===x.frequency)&&(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xb,children:"Month *"}),(0,f.jsxs)("select",{value:x.month_of_year,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{month_of_year:parseInt(e.target.value)})),required:!0,style:ey,children:[(0,f.jsx)("option",{value:"1",children:"January"}),(0,f.jsx)("option",{value:"2",children:"February"}),(0,f.jsx)("option",{value:"3",children:"March"}),(0,f.jsx)("option",{value:"4",children:"April"}),(0,f.jsx)("option",{value:"5",children:"May"}),(0,f.jsx)("option",{value:"6",children:"June"}),(0,f.jsx)("option",{value:"7",children:"July"}),(0,f.jsx)("option",{value:"8",children:"August"}),(0,f.jsx)("option",{value:"9",children:"September"}),(0,f.jsx)("option",{value:"10",children:"October"}),(0,f.jsx)("option",{value:"11",children:"November"}),(0,f.jsx)("option",{value:"12",children:"December"})]})]})]})}),(0,f.jsxs)(sy,{title:"Client Information",children:[(0,f.jsx)(Yo,{allClients:l,onContactSelect:e=>{h((0,m.A)((0,m.A)({},x),{},{client_id:e.id,client_company:e.company_name,contact_name:e.contact_name,position:e.position||"",email:e.email,phone:e.phone,street_address:e.street_address||"",city:e.city||"",state:e.state||"",postal_code:e.postal_code||"",country:e.country||"",abn:e.abn||""}))},selectedContactId:x.client_id,label:"Select Client for Recurring Invoice"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14,marginTop:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xb,children:"Company Name *"}),(0,f.jsx)("input",{type:"text",value:x.client_company,onChange:C("client_company"),required:!0,style:ey})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xb,children:"Contact Name *"}),(0,f.jsx)("input",{type:"text",value:x.contact_name,onChange:C("contact_name"),required:!0,style:ey})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xb,children:"Email *"}),(0,f.jsx)("input",{type:"email",value:x.email,onChange:C("email"),required:!0,style:ey})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Xb,children:"Phone *"}),(0,f.jsx)("input",{type:"tel",value:x.phone,onChange:C("phone"),required:!0,style:ey})]})]})]}),(0,f.jsx)(sy,{title:"Project Information",children:(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:Xb,children:"Project Name *"}),(0,f.jsx)("input",{type:"text",value:x.project_name,onChange:C("project_name"),required:!0,style:ey})]}),(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsxs)("label",{style:Xb,children:["Purchase Order ",(0,f.jsx)("span",{style:{color:"#9A9AA0",fontWeight:400},children:"(Optional)"})]}),(0,f.jsx)("input",{type:"text",value:x.purchase_order,onChange:C("purchase_order"),style:(0,m.A)((0,m.A)({},ey),{},{fontFamily:Qb})})]})]})}),(0,f.jsxs)(Ls,{style:{overflow:"hidden"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:"Line Items"}),(0,f.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>p(!d),style:{display:"inline-flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid #E4E4E9",borderRadius:8,padding:"8px 12px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(ds.A,{size:14})," From Services"]}),(0,f.jsxs)("button",{type:"button",onClick:()=>{const e={id:Date.now().toString(),name:"",description:"",quantity:1,unit_price:0,is_o
1ptional:!1};h((0,m.A)((0,m.A)({},x),{},{service_items:[...x.service_items,e]}))},style:{display:"inline-flex",alignItems:"center",gap:6,background:"#0A0A0B",border:"none",borderRadius:8,padding:"8px 12px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:12,fontWeight:600,color:"#fff",cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:14})," Add Item"]})]})]}),d&&(0,f.jsxs)("div",{style:{padding:"14px 20px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",maxHeight:280,overflowY:"auto"},children:[n.filter(e=>e.enabled).map(e=>(0,f.jsxs)("button",{type:"button",onClick:()=>(e=>{const t={id:Date.now().toString(),name:e.name,description:e.description,quantity:1,unit_price:e.price,is_optional:!1};h((0,m.A)((0,m.A)({},x),{},{service_items:[...x.service_items,t]})),p(!1)})(e),style:{display:"block",width:"100%",textAlign:"left",background:"#fff",border:"1px solid #E4E4E9",borderRadius:10,padding:12,marginBottom:8,cursor:"pointer"},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:"#0A0A0B"},children:e.name}),(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0"},children:e.description}),(0,f.jsxs)("div",{style:{fontFamily:Qb,fontSize:12,fontWeight:700,color:"#BF212F",marginTop:4},children:[Ts(e.price).whole,Ts(e.price).cents]})]},e.id)),0===n.filter(e=>e.enabled).length&&(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0",textAlign:"center",padding:8},children:"No services available."})]}),x.service_items.length>0&&(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"grid",gridTemplateColumns:"1.4fr 1.4fr 70px 110px 110px 32px",gap:10,padding:"10px 20px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:Qb,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Name"}),(0,f.jsx)("span",{children:"Description"}),(0,f.jsx)("span",{style:{textAlign:"center"},children:"Qty"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Unit"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Amount"}),(0,f.jsx)("span",{})]}),x.service_items.map((e,t)=>(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1.4fr 1.4fr 70px 110px 110px 32px",gap:10,alignItems:"center",padding:"12px 20px",borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsx)("input",{type:"text",value:e.name,onChange:e=>A(t,"name",e.target.value),style:(0,m.A)((0,m.A)({},ey),{},{padding:"8px 10px"}),placeholder:"Service name",required:!0}),(0,f.jsx)("input",{type:"text",value:e.description,onChange:e=>A(t,"description",e.target.value),style:(0,m.A)((0,m.A)({},ey),{},{padding:"8px 10px"}),placeholder:"Description"}),(0,f.jsx)("input",{type:"number",min:"1",value:e.quantity,onChange:e=>A(t,"quantity",parseFloat(e.target.value)),style:(0,m.A)((0,m.A)({},ey),{},{padding:"8px 10px",textAlign:"center",fontFamily:Qb}),required:!0}),(0,f.jsx)("input",{type:"number",step:"0.01",min:"0",value:e.unit_price,onChange:e=>A(t,"unit_price",parseFloat(e.target.value)),style:(0,m.A)((0,m.A)({},ey),{},{padding:"8px 10px",textAlign:"right",fontFamily:Qb}),required:!0}),(0,f.jsxs)("span",{style:{fontFamily:Qb,fontSize:13,fontWeight:700,textAlign:"right"},children:[Ts(e.quantity*e.unit_price).whole,Ts(e.quantity*e.unit_price).cents]}),(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{const t=x.service_items.filter((t,s)=>s!==e);h((0,m.A)((0,m.A)({},x),{},{service_items:t}))})(t),style:{width:28,height:28,border:"none",background:"#F7F7F9",borderRadius:7,color:"#9A9AA0",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(g.A,{size:15})})]},e.id)),0===x.service_items.length&&(0,f.jsx)("div",{style:{padding:"32px 20px",textAlign:"center",fontSize:13,color:"#9A9AA0"},children:"No line items yet \u2014 add from Services or create a custom item."}),(0,f.jsxs)("div",{style:{padding:"16px 20px",display:"flex",flexDirection:"column",gap:8,alignItems:"flex-end"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:13},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Subtotal"}),(0,f.jsxs)("span",{style:{fontFamily:Qb,width:120,textAlign:"right"},children:[Ts(k).whole,Ts(k).cents]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:13},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"GST (10%)"}),(0,f.jsxs)("span",{style:{fontFamily:Qb,width:120,textAlign:"right"},children:[Ts(S).whole,Ts(S).cents]})]}),(0,f.jsxs)("div",{style:{display:"flex",gap:40,fontSize:15,fontWeight:700,borderTop:"1px solid #EDEDF0",paddingTop:9,marginTop:2},children:[(0,f.jsx)("span",{children:"Total"}),(0,f.jsxs)("span",{style:{fontFamily:Qb,width:120,textAlign:"right"},children:[Ts(_).whole,Ts(_).cents]})]})]})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},ty),{},{background:"#0A0A0B",border:"1px solid #0A0A0B",padding:22,position:"relative",overflow:"hidden"}),children:[(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-20,bottom:-24,width:96,opacity:.07}}),(0,f.jsxs)("div",{style:{fontFamily:Qb,fontSize:10,letterSpacing:"0.14em",color:"#7A7A82",textTransform:"uppercase",marginBottom:10},children:["Billed ",x.frequency,"Annually"===x.frequency||"Biennial"===x.frequency?"":" \xb7 day ".concat(x.day_of_month)]}),(0,f.jsx)(zs,{amount:_,size:30,mutedSize:16,color:"#fff",mutedColor:"#7A7A82"}),(0,f.jsxs)("div",{style:{marginTop:9,fontSize:11.5,color:"#7A7A82"},children:["per invoice \xb7 inc. ",Ts(S).whole,Ts(S).cents," GST"]})]}),(0,f.jsx)(sy,{title:"Notes",children:(0,f.jsx)("textarea",{value:x.notes,onChange:e=>h((0,m.A)((0,m.A)({},x),{},{notes:e.target.value})),rows:"4",style:(0,m.A)((0,m.A)({},ey),{},{resize:"vertical",minHeight:96}),placeholder:"Internal notes (will be added to each generated invoice)"})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:10},children:[(0,f.jsx)("button",{type:"button",onClick:()=>e("/admin/invoices"),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:"Cancel"}),(0,f.jsxs)("button",{type:"submit",disabled:y||0===x.service_items.length,className:"tg-btn-primary",style:F,children:[(0,f.jsx)(ia.A,{size:15})," ",y?"Saving\u2026":s?"Update Template":"Create Recurring Invoice"]})]})]})]})};var ny=s(84007);const ry="'Space Mono',monospace",iy={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},oy="1.5fr 1.2fr 120px 150px 110px 110px 40px",ly=["#0A0A0B","#4338CA","#0FA3A3","#BF212F","#7C3AED","#0891B2","#B45309"],cy=function(){return ly[((arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").charCodeAt(0)||0)%ly.length]},dy={Monthly:"blue",Quarterly:"indigo","Semi-Annually":"teal",Annually:"amber",Biennial:"muted"},my=e=>{var t,s,n,i;let{onBack:l}=e;const c=(0,r.Zp)(),[d,p]=(0,a.useState)([]),[x,h]=(0,a.useState)([]),[u,b]=(0,a.useState)(!0),[y,v]=(0,a.useState)("all"),[j,w]=(0,a.useState)({open:!1,recurring:null}),[N,A]=(0,a.useState)(""),[k,S]=(0,a.useState)(null);(0,a.useEffect)(()=>{(async()=>{await(0,o.cd)()?_():c("/admin")})()},[c]);const _=async()=>{b(!0);try{const e=(0,o.c4)(),t=await fetch("".concat(I.fn,"/api/recurring-invoices"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json();p(e.recurring_invoices||[]),h(e.recurring_invoices||[])}}catch(e){console.error("Error loading recurring invoices:",e)}finally{b(!1)}};(0,a.useEffect)(()=>{let e=[...d];"active"===y?e=e.filter(e=>e.is_active):"inactive"===y&&(e=e.filter(e=>!e.is_active)),h(e)},[d,y]);const C=async e=>{try{const t=(0,o.c4)();(await fetch("".concat(I.fn,"/api/recurring-invoices/").concat(e,"/toggle-active"),{method:"POST",headers:{Authorization:"Bearer ".concat(t)}})).ok&&_()}catch(t){console.error("Error toggling status:",t)}},F=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(e||0),E=(e,t,s)=>{if("Monthly"===e)return"Monthly on day ".concat(t);if("Quarterly"===e)return"Quarterly on day ".concat(t);if("Semi-Annually"===e)return"Semi-annually on day ".concat(t);const a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return"Biennial"===e?"Every 2 years on ".concat(a[s-1]," ").concat(t):"Annually on ".concat(a[s-1]," ").concat(t)},T={total:d.length,active:d.filter(e=>e.is_active).length,inactive:d.filter(e=>!e.is_active).length,totalGenerated:d.reduce((e,t)=>
1e+(t.invoices_generated||0),0),monthlyRevenue:d.filter(e=>e.is_active).reduce((e,t)=>{const s={Monthly:1,Quarterly:3,"Semi-Annually":6,Annually:12,Biennial:24}[t.frequency]||1;return e+(t.total||0)/s},0)},z=[{label:"TEMPLATES",value:T.total,color:"#0A0A0B"},{label:"ACTIVE",value:T.active,color:"#15803D"},{label:"PAUSED",value:T.inactive,color:"#64748B"},{label:"GENERATED",value:T.totalGenerated,color:"#4338CA"},{label:"MONTHLY",value:F(T.monthlyRevenue),color:"#0A0A0B"}];return(0,f.jsxs)(ta,{title:"Recurring Invoices",meta:"FINANCE \xb7 RECURRING",action:{label:"New Recurring",to:"/admin/recurring-invoices/create"},children:[(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:14,marginBottom:20},children:z.map(e=>(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},iy),{},{padding:"16px 18px"}),children:[(0,f.jsx)("div",{style:{fontFamily:ry,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:9},children:e.label}),(0,f.jsx)("div",{style:{fontFamily:ry,fontWeight:700,fontSize:24,letterSpacing:"-0.02em",color:e.color},children:e.value})]},e.label))}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},iy),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 18px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:200,fontSize:12.5,color:"#9A9AA0"},children:[(0,f.jsx)(Nt.A,{size:13,style:{verticalAlign:"-2px",marginRight:6}}),"Automated generation & sending at 9 AM AEST"]}),(0,f.jsxs)("select",{value:y,onChange:e=>v(e.target.value),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)("option",{value:"all",children:"Status: All"}),(0,f.jsx)("option",{value:"active",children:"Active Only"}),(0,f.jsx)("option",{value:"inactive",children:"Paused Only"})]})]}),(0,f.jsxs)("div",{className:"tg-leadrow tg-booking-meta",style:{gridTemplateColumns:oy,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:ry,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Template"}),(0,f.jsx)("span",{children:"Client"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Amount"}),(0,f.jsx)("span",{children:"Frequency"}),(0,f.jsx)("span",{children:"Next"}),(0,f.jsx)("span",{children:"Status"}),(0,f.jsx)("span",{})]}),u?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:6})}):0===x.length?(0,f.jsx)(Os,{icon:_t.A,title:"No recurring invoices found",message:"all"!==y?"Try adjusting your filter.":"Get started by creating your first recurring invoice template.",actionLabel:"Create Recurring Invoice",onAction:()=>c("/admin/recurring-invoices/create")}):x.map(e=>{return(0,f.jsxs)("div",{className:"tg-leadrow tg-row",style:{gridTemplateColumns:oy,padding:"14px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer"},onClick:()=>c("/admin/recurring-invoices/edit/".concat(e.id)),children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.template_name}),e.project_name&&(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.project_name})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,minWidth:0},children:[(0,f.jsx)("span",{className:"tg-ui",style:{width:28,height:28,borderRadius:7,background:cy(e.client_company),color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:700,fontSize:10,flexShrink:0},children:Ms(e.client_company)}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:12.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.client_company}),e.contact_name&&(0,f.jsx)("div",{style:{fontSize:11,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.contact_name})]})]}),(0,f.jsxs)("div",{style:{textAlign:"right"},children:[(0,f.jsx)("div",{style:{fontFamily:ry,fontSize:13,fontWeight:700},children:F(e.total)}
1),(0,f.jsxs)("div",{style:{fontFamily:ry,fontSize:10,color:"#9A9AA0"},children:[e.invoices_generated||0," generated"]})]}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{justifySelf:"start"},children:(0,f.jsx)(Ds,{tone:dy[e.frequency]||"gray",style:{textTransform:"none"},children:E(e.frequency,e.day_of_month,e.month_of_year)})}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontFamily:ry,fontSize:12,color:"#55555C"},children:(t=e.next_invoice_date,t?new Date(t).toLocaleDateString("en-AU",{year:"numeric",month:"short",day:"numeric"}):"N/A")}),(0,f.jsxs)("span",{onClick:t=>{t.stopPropagation(),C(e.id)},title:e.is_active?"Click to pause":"Click to activate",style:{display:"flex",alignItems:"center",gap:7,fontSize:11.5,fontWeight:600,cursor:"pointer",color:e.is_active?"#15803D":"#9A9AA0"},children:[(0,f.jsx)("span",{style:{width:32,height:18,borderRadius:20,background:e.is_active?"#16A34A":"#D4D4DA",position:"relative",flexShrink:0,transition:"background .15s"},children:(0,f.jsx)("span",{style:{position:"absolute",top:2,[e.is_active?"right":"left"]:2,width:14,height:14,borderRadius:"50%",background:"#fff"}})}),e.is_active?"Active":"Paused"]}),(0,f.jsxs)(Mr,{open:k===e.id,onToggle:()=>S(k===e.id?null:e.id),onClose:()=>S(null),children:[(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{S(null),c("/admin/recurring-invoices/edit/".concat(e.id))},children:[(0,f.jsx)(Tn.A,{size:15})," Edit"]}),(0,f.jsx)("button",{className:"tg-kebab-item",onClick:()=>{S(null),C(e.id)},children:e.is_active?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ny.A,{size:15})," Pause"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ji.A,{size:15})," Resume"]})}),(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{S(null),(e=>{const t=e.next_invoice_date?new Date(e.next_invoice_date):new Date;A(t.toISOString().split("T")[0]),w({open:!0,recurring:e})})(e)},children:[(0,f.jsx)(_t.A,{size:15})," Reschedule"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",style:{color:"#991B1B"},onClick:()=>{S(null),(async(e,t)=>{if(confirm('Delete recurring invoice "'.concat(t,'"? This will not affect invoices already generated.')))try{const t=(0,o.c4)();(await fetch("".concat(I.fn,"/api/recurring-invoices/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}})).ok?_():alert("Failed to delete recurring invoice")}catch(s){console.error("Error deleting:",s),alert("Error deleting recurring invoice")}})(e.id,e.template_name)},children:[(0,f.jsx)(la.A,{size:15})," Delete"]})]})]},e.id);var t}),!u&&x.length>0&&(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 22px",borderTop:"1px solid #EDEDF0"},children:(0,f.jsxs)("span",{style:{fontFamily:ry,fontSize:11.5,color:"#9A9AA0"},children:["SHOWING ",x.length," OF ",d.length," TEMPLATES"]})})]}),j.open&&(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(10,10,11,.55)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,padding:16},children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},iy),{},{maxWidth:460,width:"100%",overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11},children:[(0,f.jsx)("span",{style:{width:32,height:32,borderRadius:8,background:"rgba(242,169,0,.14)",color:"#B45309",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(_t.A,{size:16})}),(0,f.jsx)("h3",{style:{margin:0,fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16},children:"Reschedule Next Invoice"})]}),(0,f.jsx)("button",{onClick:()=>w({open:!1,recurring:null}),style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex",padding:4},children:(0,f.jsx)(g.A,{size:18})})]}),(0,f.jsxs)("div",{style:{padding:22},children:[(0,f.jsxs)("p",{style:{margin:"0 0 16px",fontSize:13,color:"#55555C",lineHeight:1.5},children:["Set the date when ",(0,f.jsx)("span",{style:{fontWeight:600,color:"#0A0A0B"},children:null===(t=j.recurring)||void 0===t?void 0:t.template_name})," should resume. The next invoice will be generated on this date."]}),(0,f.jsx)("label",{style:{display:"block",fontFamily:ry,fontSize:10.5,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:8},children:"Resume Date"}),(0,f.jsx)("input",{type:"date",value:N,onChange:e=>A(e.target.value),min:(new Date).toISOString().split("T")[0],style:{width:"100%",padding:"11px 13px",border:"1px solid #E4E4E9",borderRadius:9,fontSize:13.5,color:"#0A0A0B",outline:"none",boxSizing:"border-box"}}),(0,f.jsx)("div",{style:{background:"#FFFBEB",border:"1px solid #FDE68A",borderRadius:10,padding:14,margin:"16px 0"},children:(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",ga
1p:10},children:[(0,f.jsx)(_t.A,{size:15,color:"#B45309",style:{marginTop:1,flexShrink:0}}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("p",{style:{margin:0,fontSize:12.5,fontWeight:600,color:"#92400E"},children:["Current next invoice: ",null!==(s=j.recurring)&&void 0!==s&&s.next_invoice_date?new Date(j.recurring.next_invoice_date).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric"}):"Not scheduled"]}),(0,f.jsxs)("p",{style:{margin:"4px 0 0",fontSize:11.5,color:"#B45309"},children:["After the new date, invoices will continue on the regular ",null===(n=j.recurring)||void 0===n||null===(i=n.frequency)||void 0===i?void 0:i.toLowerCase()," schedule."]})]})]})}),(0,f.jsxs)("div",{style:{display:"flex",gap:10},children:[(0,f.jsx)("button",{onClick:()=>w({open:!1,recurring:null}),style:{flex:1,padding:"11px 16px",border:"1px solid #E4E4E9",background:"#fff",color:"#333",borderRadius:9,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>{if(N&&j.recurring)try{const e=(0,o.c4)(),t=await fetch("".concat(I.fn,"/api/recurring-invoices/").concat(j.recurring.id,"/reschedule"),{method:"POST",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({next_invoice_date:N})});if(t.ok)w({open:!1,recurring:null}),A(""),_();else{const e=await t.json();alert(e.detail||"Failed to reschedule")}}catch(e){console.error("Error rescheduling:",e),alert("Error rescheduling recurring invoice")}},className:"tg-btn-primary",style:{flex:1,padding:"11px 16px",border:"none",background:"#BF212F",color:"#fff",borderRadius:9,fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Update Schedule"})]})]})]})})]})},py="'Space Mono',monospace",xy={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},hy=[["new","New"],["contacted","Contacted"],["proposal_sent","Proposal Sent"],["converted","Converted"],["closed","Closed"]],uy=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,x]=(0,a.useState)(""),[h,u]=(0,a.useState)("new"),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(null),[A,k]=(0,a.useState)([]),[S,C]=(0,a.useState)(""),[F,E]=(0,a.useState)(!1),[T,z]=(0,a.useState)(null),[B,D]=(0,a.useState)(""),[R,P]=(0,a.useState)(!1),[W,O]=(0,a.useState)("existing"),[L,M]=(0,a.useState)({company_name:"",contact_name:"",email:"",phone:"",street_address:"",city:"",state:"",postal_code:"",country:"Australia",abn:"",position:""}),[q,H]=(0,a.useState)(!1),[U,G]=(0,a.useState)(!1),[V,J]=(0,a.useState)(""),[Y,K]=(0,a.useState)({name:"",email:"",mobile:"",business_name:"",services:[],brief:"",event_date:"",location:"",contact_id:null,client_id:null,generate_proposal:!0});(0,a.useEffect)(()=>{(async()=>{await(0,o.cd)()?(Z(),$()):e("/admin")})()},[e]);const Z=async()=>{c(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(I.fn,"/api/leads"),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){const e=await a.json();s(e.leads||[]),i(e.leads||[])}}catch(t){console.error("Error loading leads:",t)}finally{c(!1)}},$=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();k(e.clients||[])}}catch(t){console.error("Error loading contacts:",t)}};(0,a.useEffect)(()=>{let e=[...t];if("all"!==h&&(e=e.filter(e=>e.status===h)),d){const t=d.toLowerCase();e=e.filter(e=>{var s,a,n,r;return(null===(s=e.name)||void 0===s?void 0:s.toLowerCase().includes(t))||(null===(a=e.email)||void 0===a?void 0:a.toLowerCase().includes(t))||(null===(n=e.business_name)||void 0===n?void 0:n.toLowerCase().includes(t))||(null===(r=e.service)||void 0===r?void 0:r.toLowerCase().includes(t))})}i(e)},[t,d,h]);const Q={total:t.length,newLeads:t.filter(e=>"new"===e.status).length,contacted:t.filter(e=>"contacted"===e.status).length,proposalSent:t.filter(e=>"proposal_sent"===e.status).length,converted:t.filter(e=>"converted"===e.status).length,closed:t.filter(e=>"closed"===e.status).length},X=e=>{if(!e)return"\u2014";const t=new Date(e);return"".concat(String(t.getDate()).padStart(2,"0")," ").concat(t.toLocaleDateString("en-AU",{month:"short"}))},ee=[{label:"TOTAL",value:Q.total,color:"#55555C"},{label:"NEW",value:Q.newLeads,color:"#A16207"}
1,{label:"CONTACTED",value:Q.contacted,color:"#1D4ED8"},{label:"PROPOSAL SENT",value:Q.proposalSent,color:"#4338CA"},{label:"CONVERTED",value:Q.converted,color:"#15803D"},{label:"CLOSED",value:Q.closed,color:"#64748B"}];return(0,f.jsxs)(ta,{title:"Leads",meta:"CRM \xb7 ".concat(Q.total," TOTAL"),action:{label:"New Lead",icon:Bn.A,onClick:()=>{J(""),K({name:"",email:"",mobile:"",business_name:"",services:[],brief:"",event_date:"",location:"",contact_id:null,client_id:null,generate_proposal:!0}),H(!0)}},children:[(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(12,1fr)",gap:14,marginBottom:20},children:ee.map(e=>(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},xy),{},{padding:"16px 18px"}),children:[(0,f.jsx)("div",{style:{fontFamily:py,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:9},children:e.label}),(0,f.jsx)("div",{style:{fontFamily:py,fontWeight:700,fontSize:26,letterSpacing:"-0.02em",lineHeight:1,color:e.color},children:e.value})]},e.label))}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},xy),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 18px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:200},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{value:d,onChange:e=>x(e.target.value),placeholder:"Search leads\u2026",style:{border:"none",background:"transparent",outline:"none",fontSize:13,width:"100%",color:"#0A0A0B"}})]}),(0,f.jsxs)("select",{value:h,onChange:e=>u(e.target.value),style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)("option",{value:"all",children:"Status: All"}),hy.map(e=>{let[t,s]=e;return(0,f.jsx)("option",{value:t,children:s},t)})]})]}),(0,f.jsxs)("div",{className:"tg-leadrow tg-booking-meta",style:{padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:py,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Contact"}),(0,f.jsx)("span",{children:"Services"}),(0,f.jsx)("span",{children:"Event date"}),(0,f.jsx)("span",{children:"Submitted"}),(0,f.jsx)("span",{children:"Status"}),(0,f.jsx)("span",{})]}),l?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:6})}):0===n.length?(0,f.jsx)(Os,{title:"No leads found",message:d||"all"!==h?"Adjust your filters or wait for new enquiries.":"New enquiries will appear here.",actionLabel:null}):n.map(t=>{const s=t.service?t.service.split(",").map(e=>e.trim()).filter(Boolean):[];return(0,f.jsxs)("div",{className:"tg-leadrow tg-row",onClick:()=>e("/admin/leads/".concat(t.id)),style:{padding:"14px 22px",borderBottom:"1px solid #F2F2F5",cursor:"pointer"},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsxs)("div",{style:{fontSize:13.5,fontWeight:600,display:"flex",alignItems:"center",gap:6},children:[(0,f.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),t.ai_status&&(0,f.jsx)("span",{title:t.ai_status,style:{fontFamily:py,fontSize:8.5,fontWeight:700,background:"linear-gradient(135deg,#7C3AED,#A78BFA)",color:"#fff",borderRadius:4,padding:"2px 5px"},children:"AI"}),String(t.source||"").startsWith("turbo-chat")&&(0,f.jsx)("span",{title:"Came in through Turbo Chat",style:{fontFamily:py,fontSize:8.5,fontWeight:700,letterSpacing:"0.08em",background:"#DBEAFE",color:"#1D4ED8",borderRadius:4,padding:"2px 5px",whiteSpace:"nowrap"},children:"FROM CHAT"})]}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[t.business_name,t.email].filter(Boolean).join(" \xb7 ")})]}),(0,f.jsxs)("div",{className:"tg-booking-meta",style:{display:"flex",gap:5,flexWrap:"wrap"},children:[s.slice(0,2).map(e=>(0,f.jsx)("span",{style:{fontSize:10.5,background:"#F2F2F5",color:"#55555C",borderRadius:5,padding:"2px 7px"},children:e},e)),s.length>2&&(0,f.jsxs)("span",{style:{fontSize:10.5,background:"#EDEDF0",color:"#9A9AA0",borderRadius:5,padding:"2px 7px"},children:["+",s.length-2]})]}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontFamily:py,fontSize:12,color:"#55555C"},children:X(t.event_date)}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontFamily:py,fontSize:11,color:"#9A9AA0"},children:(a=t.created_at,a?new Date(a).toLocaleDateString("en-AU",{year:"numeric",month:"short",day:"numeric"}):"N/A")}),(0,f.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,f.jsx)("select",{value:t.status,onChange:e=>(async(e,t)=>{try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token;(await fetch("".concat(I.fn,"/api/leads/").concat(e.id,"/status"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify({status:t})})).ok&&Z()}catch(a){console.error("Error:",a)}})(t,e.target.value),style:{fontFamily:py,fontSize:10,fontWeight:700,textTransform:"uppercase",border:"1px solid #E4E4E9",borderRadius:6,padding:"4px 6px",background:"#fff",color:(t.status,"#333"),cursor:"pointer"},children:hy.map(e=>{let[t,s]=e;return(0,f.jsx)("option",{value:t,children:s},t)})})}),(0,f.jsxs)(Mr,{open:b===t.id,onToggle:()=>y(b===t.id?null:t.id),onClose:()=>y(null),children:[(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{y(null),e("/admin/leads/".concat(t.id))},children:[(0,f.jsx)(_.A,{size:15})," View"]}),"converted"!==t.status&&"closed"!==t.status&&(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{y(null),(e=>{z(e),D(""),O("existing");const t=e.business_name&&e.business_name.trim()?e.business_name:e.name||"";M({company_name:t,contact_name:e.name||"",email:e.email||"",phone:e.mobile||"",street_address:e.address||"",city:e.city||"",state:e.state||"",postal_code:e.postal_code||"",country:"Australia",abn:"",position:""}),E(!0)})(t)},children:[(0,f.jsx)(Bn.A,{size:15})," Convert to client"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",disabled:"processing"===t.ai_status,onClick:()=>{y(null),(async e=>{if(window.confirm("Generate an AI draft proposal for this lead?"))try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/leads/").concat(e.id,"/generate-proposal"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}}),n=await a.json();n.success?(alert("AI proposal generation started. You will be notified when ready."),Z()):alert(n.detail||"Failed to start generation")}catch(s){console.error("Error generating proposal:",s)}})(t)},children:[(0,f.jsx)(Wr.A,{size:15})," ","processing"===t.ai_status?"Generating\u2026":t.draft_proposal_id?"Re-gen AI proposal":"AI proposal"]}),t.draft_proposal_id&&(0,f.jsxs)("button",{className:"tg-kebab-item",onClick:()=>{y(null),e("/admin/proposals/".concat(t.draft_proposal_id))},children:[(0,f.jsx)(kt.A,{size:15})," View AI draft"]}),(0,f.jsxs)("button",{className:"tg-kebab-item",style:{color:"#991B1B"},onClick:()=>{y(null),(async(e,t)=>{if(window.confirm('Delete lead "'.concat(t,'"? This action cannot be undone.')))try{var s;const t=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token;(await fetch("".concat(I.fn,"/api/leads/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}})).ok?(alert("Lead deleted successfully"),Z()):alert("Failed to delete lead")}catch(a){console.error("Error deleting lead:",a),alert("Error deleting lead")}})(t.id,t.name)}
1,children:[(0,f.jsx)(la.A,{size:15})," Delete"]})]})]},t.id);var a}),!l&&n.length>0&&(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 22px",borderTop:"1px solid #EDEDF0"},children:(0,f.jsxs)("span",{style:{fontFamily:py,fontSize:11.5,color:"#9A9AA0"},children:["SHOWING ",n.length," OF ",t.length]})})]}),v&&w&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:(0,f.jsxs)("div",{className:"bg-gradient-to-br from-gray-900 to-gray-800 rounded-2xl shadow-2xl w-full max-w-2xl border-2 border-gray-700 max-h-[90vh] overflow-y-auto",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between p-4 sm:p-6 border-b border-gray-700",children:[(0,f.jsxs)("div",{className:"flex-1 min-w-0 pr-4",children:[(0,f.jsxs)("h2",{className:"text-lg sm:text-2xl font-bold text-white truncate",children:[w.contact_id?"Reassign":"Assign"," Contact to Lead"]}),(0,f.jsxs)("p",{className:"text-gray-400 text-xs sm:text-sm mt-1 truncate",children:["Lead: ",(0,f.jsx)("span",{className:"font-semibold text-white",children:w.name})]})]}),(0,f.jsx)("button",{onClick:()=>{j(!1),N(null),C("")},className:"p-2 hover:bg-gray-700 rounded-lg transition-colors flex-shrink-0",children:(0,f.jsx)(g.A,{className:"h-5 w-5 sm:h-6 sm:w-6 text-gray-400"})})]}),(0,f.jsx)("div",{className:"p-4 sm:p-6",children:(0,f.jsx)(_n,{contacts:A,selectedContactId:S,onContactSelect:e=>C(e.id),label:"Select Contact",variant:"dark"})}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center justify-end gap-3 sm:gap-4 p-4 sm:p-6 border-t border-gray-700 bg-gray-900/50",children:[(0,f.jsx)("button",{onClick:()=>{j(!1),N(null),C("")},className:"w-full sm:w-auto px-6 py-2.5 border-2 border-gray-600 text-gray-300 rounded-lg hover:bg-gray-700 font-medium transition-colors order-2 sm:order-1",children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>{if(S)try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/leads/").concat(w.id,"/assign-contact"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({contact_id:S})});if(s.ok)alert("Contact assigned successfully!"),j(!1),N(null),C(""),Z();else{const e=await s.json();alert("Failed to assign contact: ".concat(e.detail||"Unknown error"))}}catch(t){console.error("Error assigning contact:",t),alert("Error assigning contact")}else alert("Please select a contact")},disabled:!S,className:"w-full sm:w-auto px-6 py-2.5 bg-gradient-to-r from-teal-600 to-teal-700 hover:from-teal-700 hover:to-teal-800 text-white rounded-lg font-bold shadow-lg transition-all transform hover:scale-105 disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none order-1 sm:order-2",children:"Assign Contact"})]})]})}),F&&T&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-gradient-to-br from-gray-900 to-black border-2 border-green-500/50 rounded-2xl shadow-2xl max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between p-4 sm:p-6 border-b border-gray-700 bg-black/50 rounded-t-2xl",children:[(0,f.jsxs)("div",{className:"flex-1 min-w-0 pr-4",children:[(0,f.jsxs)("h2",{className:"text-lg sm:text-2xl font-black text-white flex items-center gap-2 sm:gap-3",children:[(0,f.jsx)(p.A,{className:"h-6 w-6 sm:h-7 sm:w-7 text-green-400 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:"Convert Lead to Client"})]}),(0,f.jsxs)("p",{className:"text-xs sm:text-sm text-gray-400 mt-1 truncate",children:[T.business_name||T.name," - ",T.service]})]}),(0,f.jsx)("button",{onClick:()=>{E(!1),z(null),D("")},className:"p-2 hover:bg-gray-700 rounded-lg transition-colors flex-shrink-0",children:(0,f.jsx)(g.A,{className:"h-5 w-5 sm:h-6 sm:w-6 text-gray-400"})})]}),(0,f.jsxs)("div",{className:"p-4 sm:p-6",children:[(0,f.jsx)("p",{className:"text-sm sm:text-base text-gray-300 mb-4",children:"existing"===W?"Select an existing company and contact to associate with this lead:":"Create a new company and contact for this lead:"}),(0,f.jsxs)("div",{className:"flex gap-2 mb-6 bg-gray-800 p-1 rounded-lg",children:[(0,f.jsx)("button",{onClick:()=>O("existing"),className:"flex-1 px-3 sm:px-4 py-2 sm:py-2.5 rounded-md text-sm sm:text-base font-medium transition-all ".concat("existing"===W?"bg-gradient-to-r from-green-600 to-green-700 text-white shadow-lg":"text-gray-400 hover:text-white"),children:"Select Existing"}),(0,f.jsx)("button",{onClick:()=>O("new"),className:"flex-1 px-3 sm:px-4 py-2 sm:py-2.5 rounded-md text-sm sm:text-base font-medium transition-all ".concat("new"===W?"bg-gradient-to-r from-green-600 to-green-700 text-white shadow-lg":"text-gray-400 hover:text-white"),children:"Create New"})]}),"existing"===W?(0,f.jsx)(_n,{contacts:A,selectedContactId:B,onContactSelect:e=>D(e.id),label:"Select Company & Contact",variant:"dark"}):(0,f.jsxs)("div",{className:"space-y-4",children:[(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[["company_name","Company Name",!0],["contact_name","Contact Name",!0],["email","Email",!0],["phone","Phone",!1],["position","Position",!1],["abn","ABN",!1]].map(e=>{let[t,s,a]=e;return(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-bold text-gray-300 mb-2",children:[s," ",a&&(0,f.jsx)("span",{className:"text-red-400",children:"*"})]}),(0,f.jsx)("input",{type:"email"===t?"email":"text",value:L[t],onChange:e=>M((0,m.A)((0,m.A)({},L),{},{[t]:e.target.value})),className:"w-full px-4 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white focus:outline-none focus:border-green-500"})]},t)})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-300 mb-2",children:"Street Address"}),(0,f.jsx)("input",{type:"text",value:L.street_address,onChange:e=>M((0,m.A)((0,m.A)({},L),{},{street_address:e.target.value})),className:"w-full px-4 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white focus:outline-none focus:border-green-500"})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[["city","City"],["state","State"],["postal_code","Postal Code"]].map(e=>{let[t,s]=e;return(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-300 mb-2",children:s}),(0,f.jsx)("input",{type:"text",value:L[t],onChange:e=>M((0,m.A)((0,m.A)({},L),{},{[t]:e.target.value})),className:"w-full px-4 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white focus:outline-none focus:border-green-500"})]},t)})})]})]}),(0,f.jsxs)("div",{className:"flex items-center justify-end space-x-4 p-6 border-t border-gray-700 bg-gray-900/50 rounded-b-2xl",children:[(0,f.jsx)("button",{onClick:()=>{E(!1),z(null),D("")},className:"px-6 py-2 border-2 border-gray-600 text-gray-300 rounded-lg hover:bg-gray-700 font-medium transition-colors",children:"Cancel"}),(0,f.jsx)("button",{onClick:()=>async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if("existing"===W){if(!B)return void alert("Please select a contact")}else if(!L.company_name||!L.contact_name||!L.email)return void alert("Please fill in required fields: Company Name, Contact Name, and Email");P(!0);try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token;let n=B,r=null;if("new"===W){const e=await fetch("".concat(I.fn,"/api/clients"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify((0,m.A)((0,m.A)({},L),{},{is_company:!0}))});if(!e.ok)return void alert("Failed to create company");const t=await e.json(),s=t.client_id||t.id,i=await fetch("".concat(I.fn,"/api/clients"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify((0,m.A)((0,m.A)({},L),{},{is_company:!1,parent_company_id:s}))});if(!i.ok)return void alert("Failed to create contact");const o=await i.json();n=o.client_id||o.id,r=(0,m.A)((0,m.A)({},L),{},{id:n})}else r=A.find(e=>e.id===n);await fetch("".concat(I.fn,"/api/leads/").concat(T.id,"/assign-contact"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify({contact_id:n})}),(await fetch("".concat(I.fn,"/api/leads/").concat(T.id,"/convert-to-client"),{method:"POST",headers:{Authorization:"Bearer ".concat(a)}})).ok?(Z(),E(!1),t?e("/admin/proposals/new",{state:{prefilledClient:{client_id:n,client_company:r.company_name,contact_name:r.contact_name,position:r.position||"",email:r.email,phone:r.phone,street_address:r.street_address||"",city:r.city||"",state:r.state||"",postal_code:r.postal_code||"",country:r.country||"",abn:r.abn||"",project_name:"".concat(T.service," - ").concat(T.business_name||T.name),job_date:T.event_date||""}}}):alert("Lead converted to client successfully!")):alert("Failed to convert lead to client")}catch(a){console.error("Error converting lead:",a),alert("Error converting lead to client")}finally{P(!1)}}(!1),disabled:"existing"===W&&!B||"new"===W&&(!L.company_name||!L.contact_name||!L.email)||R,className:"px-6 py-2 bg-gradient-to-r from-green-600 to-green-700 hover:from-green-700 hover:to-green-800 text-white rounded-lg font-bold shadow-lg transition-all transform hover:scale-105 disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none flex items-center",children:R?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-4 h-4 border-2 border-white border-t-transparent roun
1ded-full animate-spin mr-2"}),"Converting..."]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Bn.A,{className:"h-4 w-4 mr-2"}),"new"===W?"Create & Convert":"Convert to Client"]})})]})]})}),q&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/70 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-gradient-to-br from-gray-900 to-black border-2 border-teal-500/50 rounded-2xl shadow-2xl max-w-2xl w-full max-h-[90vh] overflow-y-auto",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between p-4 sm:p-6 border-b border-gray-700 bg-black/50 rounded-t-2xl",children:[(0,f.jsxs)("div",{className:"flex-1 min-w-0 pr-4",children:[(0,f.jsxs)("h2",{className:"text-lg sm:text-2xl font-black text-white flex items-center gap-2 sm:gap-3",children:[(0,f.jsx)(Wr.A,{className:"h-6 w-6 sm:h-7 sm:w-7 text-teal-400 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:"New Lead"})]}),(0,f.jsx)("p",{className:"text-xs sm:text-sm text-gray-400 mt-1",children:"Enter a manual lead tied to a client contact \u2014 an AI proposal is generated automatically."})]}),(0,f.jsx)("button",{onClick:()=>H(!1),className:"p-2 hover:bg-gray-700 rounded-lg transition-colors flex-shrink-0",children:(0,f.jsx)(g.A,{className:"h-5 w-5 sm:h-6 sm:w-6 text-gray-400"})})]}),(0,f.jsxs)("div",{className:"p-4 sm:p-6 space-y-5",children:[(0,f.jsx)(_n,{contacts:A,selectedContactId:V,onContactSelect:e=>{J(e.id),K(t=>(0,m.A)((0,m.A)({},t),{},{name:e.contact_name||t.name,email:e.email||t.email,mobile:e.phone||t.mobile,business_name:e.company_name||e.parent_company_name||t.business_name,contact_id:e.id,client_id:e.parent_company_id||e.id}))},label:"Client & Contact",variant:"dark"}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[["name","Contact Name"],["email","Email"],["mobile","Mobile"],["business_name","Company"]].map(e=>{let[t,s]=e;return(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-300 mb-2",children:s}),(0,f.jsx)("input",{type:"email"===t?"email":"text",value:Y[t],onChange:e=>K((0,m.A)((0,m.A)({},Y),{},{[t]:e.target.value})),className:"w-full px-4 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white focus:outline-none focus:border-teal-500"})]},t)})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-300 mb-2",children:"Services"}),(0,f.jsx)("div",{className:"flex flex-wrap gap-2",children:["Video Production","Photography","Live Streaming","Website Development","App Development","Post Production","Virtual Tour"].map(e=>{const t=Y.services.includes(e);return(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{K(t=>(0,m.A)((0,m.A)({},t),{},{services:t.services.includes(e)?t.services.filter(t=>t!==e):[...t.services,e]}))})(e),className:"px-3 py-1.5 rounded-lg text-sm font-medium border transition-all ".concat(t?"bg-teal-600 border-teal-500 text-white":"bg-gray-800 border-gray-700 text-gray-300 hover:border-gray-500"),children:e},e)})})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-300 mb-2",children:"Event / Project Date"}),(0,f.jsx)("input",{type:"date",value:Y.event_date,onChange:e=>K((0,m.A)((0,m.A)({},Y),{},{event_date:e.target.value})),className:"w-full px-4 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white focus:outline-none focus:border-teal-500"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-300 mb-2",children:"Location"}),(0,f.jsx)("input",{type:"text",value:Y.location,onChange:e=>K((0,m.A)((0,m.A)({},Y),{},{location:e.target.value})),placeholder:"Melbourne, Sydney, etc.",className:"w-full px-4 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white focus:outline-none focus:border-teal-500"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-bold text-gray-300 mb-2",children:["Brief ",(0,f.jsx)("span",{className:"text-red-400",children:"*"})]}),(0,f.jsx)("textarea",{rows:4,value:Y.brief,onChange:e=>K((0,m.A)((0,m.A)({},Y),{},{brief:e.target.value})),placeholder:"Describe the project \u2014 goals, deliverables, scope. This drives the AI proposal.",className:"w-full px-4 py-2 bg-gray-800 border border-gray-700 rounded-lg text-white focus:outline-none focus:border-teal-500 resize-y"})]}),(0,f.jsxs)("label",{className:"flex items-center gap-3 text-sm text-gray-300 cursor-pointer",children:[(0,f.jsx)("input",{type:"checkbox",checked:Y.generate_proposal,onCh
1ange:e=>K((0,m.A)((0,m.A)({},Y),{},{generate_proposal:e.target.checked})),className:"w-4 h-4 accent-teal-500"}),"Generate an AI draft proposal now"]})]}),(0,f.jsxs)("div",{className:"flex items-center justify-end gap-4 p-6 border-t border-gray-700 bg-gray-900/50 rounded-b-2xl",children:[(0,f.jsx)("button",{onClick:()=>H(!1),className:"px-6 py-2 border-2 border-gray-600 text-gray-300 rounded-lg hover:bg-gray-700 font-medium transition-colors",children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>{if(V)if(Y.email)if(Y.brief.trim()){G(!0);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s={name:Y.name,email:Y.email,mobile:Y.mobile,business_name:Y.business_name,service:Y.services.join(", "),brief:Y.brief,event_date:Y.event_date,location:Y.location,contact_id:Y.contact_id,client_id:Y.client_id,generate_proposal:Y.generate_proposal},a=await fetch("".concat(I.fn,"/api/leads"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(s)});if(a.ok)H(!1),Z(),alert(Y.generate_proposal?"Lead created \u2014 AI proposal generating. You'll be notified when it's ready.":"Lead created.");else{const e=await a.json().catch(()=>({}));alert("Failed to create lead: ".concat(e.detail||"Unknown error"))}}catch(t){console.error("Error creating lead:",t),alert("Error creating lead")}finally{G(!1)}}else alert("Please enter a brief \u2014 it drives the AI proposal");else alert("That contact has no email \u2014 pick a contact with an email address");else alert("Please select a client contact")},disabled:!V||!Y.brief.trim()||U,className:"px-6 py-2 bg-gradient-to-r from-teal-600 to-teal-700 hover:from-teal-700 hover:to-teal-800 text-white rounded-lg font-bold shadow-lg transition-all transform hover:scale-105 disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none flex items-center",children:U?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin mr-2"}),"Creating..."]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Wr.A,{className:"h-4 w-4 mr-2"}),"Create Lead"]})})]})]})})]})};var gy=s(23768);const fy=e=>{gy.Ay.error(e,{duration:5e3,position:"bottom-right",style:{background:"#EF4444",color:"#ffffff",fontWeight:"500",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},iconTheme:{primary:"#ffffff",secondary:"#EF4444"}})},by="'Space Mono',monospace",yy={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},vy={new:"New Lead",contacted:"Contacted",proposal_sent:"Proposal Sent",converted:"Converted",declined:"Declined",closed:"Closed"},jy={new:"#1D4ED8",contacted:"#0E7490",proposal_sent:"#A16207",converted:"#15803D",declined:"#991B1B",closed:"#64748B"},wy=(e,t,s)=>({display:"inline-flex",alignItems:"center",gap:7,background:e,color:t,border:s||"none",borderRadius:9,padding:"10px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer"}),Ny=e=>{let{icon:t,label:s,children:a}=e;return(0,f.jsxs)("div",{style:{display:"flex",gap:11,alignItems:"flex-start"},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0",marginTop:2,display:"flex"},children:(0,f.jsx)(t,{size:17})}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:by,fontSize:10,letterSpacing:"0.14em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:3},children:s}),(0,f.jsx)("div",{style:{fontSize:14,fontWeight:600,color:"#0A0A0B",wordBreak:"break-word"},children:a})]})]})},Ay=e=>{let{lead:t}=e;const s=t.brief_structured||{},n=e=>"number"===typeof e?"$".concat(e.toLocaleString("en-AU")):"",r=s.budget||[n(s.budgetMin),n(s.budgetMax)].filter(Boolean).join(" \u2013 "),i=[["Brief",s.number||s.briefNumber?"#".concat(s.number||s.briefNumber):""],["Services",Array.isArray(s.services)?s.services.join(", "):""],["Event date",s.eventDate||""],["City / venue",s.city||""],["Attendees",s.attendees?String(s.attendees):""],["Hours",s.hours?String(s.hours):""],["Budget",r],["Notes",s.notes||""]].filter(e=>{let[,t]=e;return t});return(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yy),{},{padding:20}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14},children:[(0,f.jsxs)("div",{style:{fontFamily:by,fontSize:10.5,letterSpacing:"0.16em",color:"#1D4ED8"},children:["FROM TURBO CHAT",t.reference_number?" \xb7 Q-".concat(t.reference_number):""]}),t.conversation_id&&(0,f.jsx)("a",{href:"".concat("https://chat.turbo.net.au/dashboard","?c=").concat(encodeURIComponent(t.conversation_id)),target:"_blank",rel:"noopener noreferrer",style:{fontSize:12.5,fontWeight:600,color:"#BF212F",textDecoration:"none"},children:"Open the conversation \u2192"})]}),(0,f.jsx)("div",{style:{fontSize:12.5,color:"#55555C",marginBottom:i.length?14:0},children:"turbo-chat-agent"===t.source?"Created by an agent from a chat.":"Sent by the visitor as a quote brief in the chat."}),i.length>0&&(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"120px 1fr",rowGap:8,columnGap:14,fontSize:13.5},children:i.map(e=>{let[t,s]=e;return(0,f.jsxs)(a.Fragment,{children:[(0,f.jsx)("div",{style:{fontFamily:by,fontSize:10,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",paddingTop:2},children:t}),(0,f.jsx)("div",{style:{color:"#0A0A0B",whiteSpace:"pre-wrap"},children:s})]},t)})})]})},ky=()=>{const e=(0,r.Zp)(),{leadId:t}=(0,r.g)(),[s,n]=(0,a.useState)(null),[i,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(async()=>{await(0,o.cd)()?u():e("/admin")})()},[e,t]);const u=async()=>
1{l(!0);try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,r=await fetch("".concat(I.fn,"/api/leads/").concat(t),{headers:{Authorization:"Bearer ".concat(a)}});r.ok?n(await r.json()):(alert("Failed to load lead"),e("/admin/leads"))}catch(a){console.error("Error loading lead:",a),alert("Error loading lead"),e("/admin/leads")}finally{l(!1)}},g=e=>e?new Date(e).toLocaleDateString("en-AU",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"N/A",b=e=>e?new Date(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short"}):"\u2014";if(i)return(0,f.jsx)(ta,{title:"Lead",meta:"CRM",children:(0,f.jsx)(Ws,{rows:8})});if(!s)return null;const y=[{label:"STATUS",value:vy[s.status]||s.status,color:jy[s.status]||"#0A0A0B",sub:s.updated_at&&s.updated_at!==s.created_at?"updated ".concat(b(s.updated_at)):null},{label:"SUBMITTED",value:b(s.created_at),mono:!0,sub:"enquiry received"},{label:"EVENT DATE",value:s.event_date?b(s.event_date):"\u2014",mono:!0,sub:s.location||null}];return(0,f.jsxs)(ta,{title:"Lead",meta:"CRM \xb7 LEAD",children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>e("/admin/leads"),style:wy("#fff","#55555C","1px solid #E4E4E9"),children:[(0,f.jsx)(Ct.A,{size:15})," Leads"]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,f.jsx)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:s.name}),(0,f.jsx)(Ds,{tone:Ps[s.status]||"gray",radius:7,children:vy[s.status]||s.status}),s.ai_status&&(0,f.jsxs)("span",{style:{fontFamily:by,fontSize:8.5,fontWeight:700,background:"linear-gradient(135deg,#7C3AED,#A78BFA)",color:"#fff",borderRadius:4,padding:"3px 6px"},children:["AI ","completed"===s.ai_status?"READY":s.ai_status.toUpperCase()]})]})]}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},yy),{},{padding:16,marginBottom:20,display:"flex",gap:10,flexWrap:"wrap",alignItems:"center"}),children:[(0,f.jsxs)("button",{onClick:()=>{e("/admin/proposals/create",{state:{fromLead:!0,leadId:s.id,client_company:s.business_name||s.name,contact_name:s.name,email:s.email,phone:s.mobile,project_name:"".concat(s.service," - ").concat(s.business_name||s.name),job_date:s.event_date||""}})},className:"tg-btn-primary",style:wy("#BF212F","#fff"),children:[(0,f.jsx)(st.A,{size:15})," Send Proposal"]}),"converted"!==s.status&&(0,f.jsxs)("button",{onClick:async()=>{if(window.confirm("Convert this lead to a client record?"))try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,n=await fetch("".concat(I.fn,"/api/leads/").concat(t,"/convert-to-client"),{method:"POST",headers:{Authorization:"Bearer ".concat(a)}});if(n.ok){const t=await n.json();alert(t.already_exists?"This lead already has a client record!":"Lead converted to client successfully!"),u(),window.confirm("View the client record?")&&e("/admin/clients/edit/".concat(t.client_id))}else alert("Failed to convert lead to client")}catch(a){console.error("Error converting lead:",a),alert("Error converting lead to client")}},style:wy("#0A0A0B","#fff"),children:[(0,f.jsx)(Bn.A,{size:15})," Convert to Client"]}),(0,f.jsxs)("button",{onClick:async()=>{if(window.confirm("Generate an AI draft proposal for this lead?"))try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(I.fn,"/api/leads/").concat(t,"/generate-proposal"),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}}),n=await a.json();n.success?(alert("AI proposal generation started. You will be notified when ready."),u()):alert(n.detail||"Failed to start generation")}catch(s){console.error("Error generating proposal:",s),alert("Error starting AI proposal generation")}},disabled:"processing"===s.ai_status,style:(0,m.A)((0,m.A)({},wy("#fff","#4338CA","1px solid #E4E4E9")),{},{opacity:"processing"===s.ai_status?.5:1}),children:[(0,f.jsx)(Wr.A,{size:15})," ","processing"===s.ai_status?"Generating\u2026":s.draft_proposal_id?"Re-generate AI Proposal":"Generate AI Proposal"]}),s.draft_proposal_id&&(0,f.jsxs)("button",{onClick:()=>e("/admin/proposals/".concat(s.draft_proposal_id)),style:wy("#fff","#15803D","1px solid #E4E4E9"),children:[(0,f.jsx)(kt.A,{size:15})," View AI Draft"]}),"declined"!==s.status&&"converted"!==s.status&&(0,f.jsxs)("button",{onClick:()=>d(!0),disabled:p,style:(0,m.A)((0,m.A)({},wy("#fff","#991B1B","1px solid #FECACA")),{},{opacity:p?.5:1}),children:[(0,f.jsx)(x.A,{size:15})," ",p?"Sending\u2026":"Decline"]}),(0,f.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("select",{value:s.status,onChange:e=>(async e=>{try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token;(await fetch("".concat(I.fn,"/api/leads/").concat(t,"/status"),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify({status:e})})).ok?u():alert("Failed to update status")}catch(a){console.error("Error updating status:",a),alert("Error updating status")}})(e.target.value),style:{border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer",background:"#fff"},children:Object.entries(vy).map(e=>{let[t,s]=e;return(0,f.jsx)("option",{value:t,children:s},t)})}),(0,f.jsx)("button",{onClick:async()=>
1{if(window.confirm('Delete lead "'.concat(s.name,'"? This action cannot be undone.')))try{var a;const s=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token;(await fetch("".concat(I.fn,"/api/leads/").concat(t),{method:"DELETE",headers:{Authorization:"Bearer ".concat(s)}})).ok?(alert("Lead deleted successfully"),e("/admin/leads")):alert("Failed to delete lead")}catch(n){console.error("Error deleting lead:",n),alert("Error deleting lead")}},title:"Delete lead",style:wy("#fff","#991B1B","1px solid #FECACA"),children:(0,f.jsx)(la.A,{size:15})})]})]}),(0,f.jsxs)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:16,marginBottom:20},children:[y.map(e=>(0,f.jsxs)("div",{className:"tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},yy),{},{padding:18}),children:[(0,f.jsx)("div",{style:{fontFamily:by,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:10},children:e.label}),(0,f.jsx)("div",{style:{fontFamily:e.mono?by:"'Hanken Grotesk',sans-serif",fontSize:18,fontWeight:700,color:e.color||"#0A0A0B"},children:e.value}),e.sub&&(0,f.jsx)("div",{style:{marginTop:7,fontSize:11.5,color:"#9A9AA0"},children:e.sub})]},e.label)),(0,f.jsxs)("div",{className:"tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},yy),{},{background:"#0A0A0B",border:"1px solid #0A0A0B",padding:18,position:"relative",overflow:"hidden"}),children:[(0,f.jsx)("img",{src:"/admin-assets/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-20,bottom:-20,width:84,opacity:.08}}),(0,f.jsx)("div",{style:{fontFamily:by,fontSize:10.5,letterSpacing:"0.16em",color:"#F87171",marginBottom:10},children:"SERVICE"}),(0,f.jsx)("div",{style:{fontSize:16,fontWeight:700,color:"#fff",lineHeight:1.3},children:s.service||"\u2014"})]})]}),(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"1.62fr 1fr",gap:20,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yy),{},{padding:20}),children:[(0,f.jsx)("div",{style:{fontFamily:by,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:16},children:"ENQUIRY DETAILS"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:18},children:[(0,f.jsx)(Ny,{icon:ws.A,label:"Service Requested",children:s.service||"\u2014"}),s.event_date&&(0,f.jsx)(Ny,{icon:_t.A,label:"Event Date",children:s.event_date}),s.location&&(0,f.jsx)(Ny,{icon:C.A,label:"Location",children:s.location}),s.how_heard&&(0,f.jsx)(Ny,{icon:Wr.A,label:"How They Heard",children:s.how_heard})]}),s.brief&&(0,f.jsxs)("div",{style:{marginTop:20,paddingTop:18,borderTop:"1px solid #EDEDF0"},children:[(0,f.jsx)("div",{style:{fontFamily:by,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:10},children:"MESSAGE / BRIEF"}),(0,f.jsx)("div",{style:{background:"#FBFBFC",border:"1px solid #EDEDF0",borderRadius:10,padding:14,whiteSpace:"pre-wrap",fontSize:13.5,color:"#333",lineHeight:1.65},children:s.brief})]})]}),String(s.source||"").startsWith("turbo-chat")&&(0,f.jsx)(Ay,{lead:s})]}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yy),{},{padding:20}),children:[(0,f.jsx)("div",{style:{fontFamily:by,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:16},children:"CONTACT"}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,f.jsx)(Ny,{icon:T.A,label:"Email",children:(0,f.jsx)("a",{href:"mailto:".concat(s.email),style:{color:"#BF212F",textDecoration:"none"},children:s.email})}),s.mobile&&(0,f.jsx)(Ny,{icon:E.A,label:"Mobile",children:(0,f.jsx)("a",{href:"tel:".concat(s.mobile),style:{color:"#BF212F",textDecoration:"none"},children:s.mobile})}),s.business_name&&(0,f.jsx)(Ny,{icon:Ke.A,label:"Business",children:s.business_name})]})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yy),{},{overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0",fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"Timeline"}),(0,f.jsxs)("div",{style:{padding:"6px 20px 16px"},children:[(0,f.jsxs)("div",{style:{display:"flex",gap:12,padding:"11px 0",borderBottom:s.updated_at!==s.created_at?"1px solid #F2F2F5":"none"},children:[(0,f.jsx)("span",{style:{width:9,height:9,borderRadius:"50%",background:"#7C3AED",marginTop:4,flexShrink:0,boxShadow:"0 0 0 3px #EDE9FE"}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600},children:"Lead Submitted"}),(0,f.jsx)("div",{style:{fontFamily:by,fontSize:11,color:"#9A9AA0",marginTop:2},children:g(s.created_at)})]})]}),s.updated_at!==s.created_at&&(0,f.jsxs)("div",{style:{display:"flex",gap:12,padding:"11px 0"},children:[(0,f.jsx)("span",{style:{width:9,height:9,borderRadius:"50%",background:"#1D4ED8",marginTop:4,flexShrink:0,boxShadow:"0 0 0 3px #DBEAFE"}}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600},children:"Last Updated"}),(0,f.jsx)("div",{style:{fontFamily:by,fontSize:11,color:"#9A9AA0",marginTop:2},children:g(s.updated_at)})]})]})]})]}),s.draft_proposal_id&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},yy),{},{padding:"18px 20px",border:"1px solid #BBF7D0",background:"#F0FDF4"}),children:[(0,f.jsx)("div",{style:{fontFamily:by,fontSize:10.5,letterSpacing:"0.16em",color:"#15803D",marginBottom:10},children:"AI DRAFT READY"}),(0,f.jsxs)("button",{onClick:()=>e("/admin/proposals/".concat(s.draft_proposal_id)),style:(0,m.A)((0,m.A)({},wy("#15803D","#fff")),{},{padding:"9px 14px"}),children:[(0,f.jsx)(kt.A,{size:15})," View AI Draft Proposal"]})]})]})]}),(0,f.jsx)(j,{isOpen:c,onClose:()=>d(!1),onConfirm:async()=>
1{if(!p){h(!0);try{var e;const a=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,n=await fetch("".concat(I.fn,"/api/leads/").concat(t,"/decline"),{method:"POST",headers:{Authorization:"Bearer ".concat(a)}}),r=await n.json().catch(()=>({}));n.ok?(s="Decline email sent. Lead marked as declined.",gy.Ay.success(s,{duration:4e3,position:"bottom-right",style:{background:"#10B981",color:"#ffffff",fontWeight:"500",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},iconTheme:{primary:"#ffffff",secondary:"#10B981"}}),u()):fy(r.detail||"Failed to send decline email")}catch(a){console.error("Error declining lead:",a),fy("Error sending decline email")}finally{h(!1)}var s}},title:"Decline this lead?",message:'A regretful "fully booked" email will be sent to '.concat(s.name).concat(s.email?" (".concat(s.email,")"):"",". A copy will be CC'd to [email protected], and the lead will be marked as declined."),type:"warning",confirmText:"Send Decline Email",cancelText:"Cancel",confirmColor:"red"})]})},Sy=()=>{const[e,t]=(0,a.useState)({name:"",email:"",mobile:"",businessName:"",eventDate:"",location:"",services:[],brief:"",referralSources:[]}),[s,n]=(0,a.useState)({}),[r,i]=(0,a.useState)(!1),[o,l]=(0,a.useState)(null),c=(e,a)=>{t(t=>(0,m.A)((0,m.A)({},t),{},{[e]:a})),s[e]&&n(t=>(0,m.A)((0,m.A)({},t),{},{[e]:""}))},d="block text-sm font-semibold text-gray-900 mb-2",x="quote-input w-full rounded-lg text-base",h="absolute left-3.5 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400 pointer-events-none";return(0,f.jsxs)(ae.mP,{className:"quote-page",children:[(0,f.jsx)(R.A,(0,m.A)({},R.p.quote)),(0,f.jsx)("style",{children:"\n @import url('https://fonts.googleapis.com/css2?family=Archivo+Expanded:wght@700;800&family=Hanken+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');\n\n .quote-page {\n font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;\n color: #141414;\n }\n\n .quote-page .q-display {\n font-family: 'Archivo Expanded', 'Hanken Grotesk', sans-serif;\n letter-spacing: -0.02em;\n line-height: 1.02;\n }\n\n .quote-page .q-kicker {\n font-family: 'Space Mono', monospace;\n text-transform: uppercase;\n letter-spacing: 0.24em;\n font-size: 12px;\n font-weight: 700;\n }\n\n .quote-input, .quote-textarea {\n background-color: #ffffff;\n color: #141414;\n border: 1px solid #d1d5db;\n font-family: 'Hanken Grotesk', sans-serif;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n }\n\n .quote-input:focus, .quote-textarea:focus {\n outline: none;\n border-color: #BF212F;\n box-shadow: 0 0 0 3px rgba(191, 33, 47, 0.12);\n }\n\n .quote-input::placeholder, .quote-textarea::placeholder {\n color: #9ca3af;\n }\n\n /* Neutralise the global DatePickerStyles.css hover rule that darkens\n date inputs app-wide. Scoped + !important to win specificity here. */\n .quote-page input[type=\"date\"]:hover {\n background-color: #ffffff !important;\n border-color: #d1d5db !important;\n }\n .quote-page input[type=\"date\"]:hover:focus {\n border-color: #BF212F !important;\n }\n"}),(0,f.jsx)(D.A,{}),(0,f.jsxs)("header",{className:"relative overflow-hidden border-b border-[#222] bg-carbon px-[22px] py-10 md:px-11 md:py-14",children:[(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 18% 0%,rgba(191,33,47,.18),transparent 58%)"}}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-7xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-4",children:"Get a Quote"}),(0,f.jsx)(ae.nl,{as:"h1",className:"max-w-4xl text-[clamp(34px,5vw,60px)]",children:"Every angle. Full speed."}),(0,f.jsx)("p",{className:"mt-4 max-w-2xl text-[clamp(16px,1.4vw,19px)] leading-[1.55] text-[#C7C4BD]",children:"Tell us about the project. We reply within 24 hours with a tailored quote."})]})]}),(0,f.jsx)("main",{className:"bg-carbon text-smoke",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl px-[22px] pb-16 pt-8 md:px-11 md:pb-24 md:pt-10",children:["success"===(null===o||void 0===o?void 0:o.type)&&(0,f.jsx)(ae.gN,{className:"mb-8 rounded-2xl border border-green-500/60 bg-[#1A1A1A] p-6 shadow-sm sm:p-8",children:(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-lg bg-green-500",children:(0,f.jsx)(p.A,{className:"h-7 w-7 text-white"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"q-display mb-1 text-2xl font-bold text-smoke",children:"Request submitted"}),(0,f.jsx)("p",{className:"mb-3 text-[#C7C4BD]",children:o.message}),o.referenceId&&(0,f.jsxs)("div",{className:"mb-3 inline-flex items-baseline gap-2 rounded-lg bg-carbon-900 px-4 py-2",children:[(0,f.jsx)("span",{className:"q-kicker text-fog",children:"Ref"}),(0,f.jsx)("span",{className:"font-mono font-bold text-turbo-red",children:o.referenceId})]}),(0,f.jsx)("p",{className:"text-[#9C9A95]",children:"We'll be in touch shortly by email or phone."})]})]})}),"error"===(null===o||void 0===o?void 0:o.type)&&(0,f.jsx)(ae.gN,{className:"mb-8 rounded-2xl border border-turbo-red bg-[#1A1A1A] p-6 shadow-sm",children:(0,f.jsx)("p",{className:"font-medium text-turbo-red",children:o.message})}),(0,f.jsxs)("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-[1fr_320px]",children:[(0,f.jsx)(ae.gN,{className:"rounded-2xl border border-[#
1E2DED6] bg-white p-6 text-carbon shadow-sm sm:p-10",children:(0,f.jsxs)("form",{onSubmit:async s=>{if(s.preventDefault(),(()=>{const t={};return e.name.trim()||(t.name="Your name is required"),e.email.trim()?/\S+@\S+\.\S+/.test(e.email)||(t.email="Please enter a valid email address"):t.email="Email address is required",e.mobile.trim()||(t.mobile="Mobile number is required"),e.location.trim()||(t.location="Location is required"),e.services&&0!==e.services.length||(t.services="Please select at least one service"),e.brief.trim()||(t.brief="Please tell us what you're looking for"),e.referralSources&&0!==e.referralSources.length||(t.referralSources="Please let us know how you heard about us"),n(t),0===Object.keys(t).length})()){i(!0),l(null);try{const s={name:e.name,email:e.email,mobile:e.mobile,business_name:e.businessName,event_date:e.eventDate,location:e.location,service:e.services.join(", "),brief:e.brief,how_heard:e.referralSources.join(", ")},a=await fetch("".concat(I.fn,"/api/quotes"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!a.ok)throw new Error("Submission failed");{const s=await a.json();window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"form_submission",form_name:"get_quote"}),l({type:"success",message:"Thank you ".concat(e.name,"! Your quote request has been submitted successfully."),referenceId:s.reference_id}),t({name:"",email:"",mobile:"",businessName:"",eventDate:"",location:"",services:[],brief:"",referralSources:[]}),window.scrollTo({top:0,behavior:"smooth"})}}catch(a){console.error("Error submitting quote:",a),l({type:"error",message:"Sorry, there was an error submitting your request. Please try again or contact us directly."})}finally{i(!1)}}},className:"space-y-10",children:[(0,f.jsxs)("fieldset",{className:"space-y-6",children:[(0,f.jsx)("legend",{className:"font-mono text-[16px] font-bold uppercase tracking-[0.2em] text-[#BF212F] mb-4",children:"Your details"}),(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-5",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:d,children:"Your name *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Ye.A,{className:h}),(0,f.jsx)("input",{type:"text",value:e.name,onChange:e=>c("name",e.target.value),className:"".concat(x," pl-11 pr-4 py-3 ").concat(s.name?"border-[#BF212F]":""),placeholder:"John Smith"})]}),s.name&&(0,f.jsx)("p",{className:"mt-1.5 text-sm text-[#BF212F]",children:s.name})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:d,children:"Email address *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(T.A,{className:h}),(0,f.jsx)("input",{type:"email",value:e.email,onChange:e=>c("email",e.target.value),className:"".concat(x," pl-11 pr-4 py-3 ").concat(s.email?"border-[#BF212F]":""),placeholder:"[email protected]"})]}),s.email&&(0,f.jsx)("p",{className:"mt-1.5 text-sm text-[#BF212F]",children:s.email})]})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-5",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:d,children:"Mobile number *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(E.A,{className:h}),(0,f.jsx)("input",{type:"tel",value:e.mobile,onChange:e=>c("mobile",e.target.value),className:"".concat(x," pl-11 pr-4 py-3 ").concat(s.mobile?"border-[#BF212F]":""),placeholder:"+61 400 000 000"})]}),s.mobile&&(0,f.jsx)("p",{className:"mt-1.5 text-sm text-[#BF212F]",children:s.mobile})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:d,children:["Business name ",(0,f.jsx)("span",{className:"text-gray-400 font-normal",children:"(optional)"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Ke.A,{className:h}),(0,f.jsx)("input",{type:"text",value:e.businessName,onChange:e=>c("businessName",e.target.value),className:"".concat(x," pl-11 pr-4 py-3"),placeholder:"Your Company Pty Ltd"})]})]})]})]}),(0,f.jsxs)("fieldset",{className:"space-y-6",children:[(0,f.jsx)("legend",{className:"font-mono text-[16px] font-bold uppercase tracking-[0.2em] text-[#BF212F] mb-4",children:"Project"}),(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-5",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:d,children:["Date required ",(0,f.jsx)("span",{className:"text-gray-400 font-normal",children:"(optional)"})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(_t.A,{className:h}),(0,f.jsx)("input",{type:"date",value:e.eventDate,onChange:e=>c("eventDate",e.target.value),className:"".concat(x," pl-11 pr-4 py-3")})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:d,children:"Location *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(C.A,{className:h}),(0,f.jsx)("input",{type:"text",value:e.location,onChange:e=>c("location",e.target.value),className:"".concat(x," pl-11 pr-4 py-3 ").concat(s.location?"border-[#BF212F]":""),placeholder:"Melbourne, Sydney, Brisbane\u2026"})]}),s.location&&(0,f.jsx)("p",{className:"mt-1.5 text-sm text-[#BF212F]",children:s.location})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:d,children:["Services required * ",(0,f.jsx)("span",{className:"text-gray-400 font-normal",children:"(select all that apply)"})]}),(0,f.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2.5",children:["Video Production","Photography","Live Streaming","Website Development","App Development","Post Production (Editing)","Virtual Tour"].map(a=>{const r=e.services.includes(a);return(0,f.jsxs)("button",{type:"button",onClick:()=>(e=>{t(t=>{const s=t.services.includes(e)?t.services.filter(t=>t!==e):[...t.services,e];return(0,m.A)((0,m.A)({},t),{},{services:s})}),s.services&&n(e=>(0,m.A)((0,m.A)({},e),{},{services:""}))})(a),"aria-pressed":r,className:"flex items-center justify-center gap-1.5 px-3 py-3 rounded-lg font-semibold text-sm border transition-colors ".concat(r?"bg-[#BF212F] text-white border-[#BF212F]":"bg-white text-gray-700 border-gray-300 hover:border-[#BF212F]"),children:[r&&(0,f.jsx)(p.A,{className:"h-4 w-4 flex-shrink-0"}),(0,f.jsx)("span",{children:a})]},a)})}),s.services&&(0,f.jsx)("p",{className:"mt-1.5 text-sm text-[#BF212F]",children:s.services})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:d,children:"Tell us about your project *"}),(0,f.jsx)("textarea",{value:e.brief,onChange:e=>c("brief",e.target.value),rows:"5",className:"quote-textarea w-full rounded-lg text-base px-4 py-3 ".concat(s.brief?"border-[#BF212F]":""),placeholder:"Scope, timeline, location and anything else we should know."}),s.brief&&(0,f.jsx)("p",{className:"mt-1.5 text-sm text-[#BF212F]",children:s.brief})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:d,children:["How did you hear about Turbo? * ",(0,f.jsx)("span",{className:"text-gray-400 font-normal",children:"(select all that apply)"})]}),(0,f.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2.5",children:["Search Engine","Word of Mouth","LinkedIn","Facebook","Instagram"].map(a=>{const r=e.referralSources.includes(a);return(0,f.jsxs)("button",{type:"button",onClick:()=>(e=>{t(t=>{const s=t.referralSources.includes(e)?t.referralSources.filter(t=>t!==e):[...t.referralSources,e];return(0,m.A)((0,m.A)({},t),{},{referralSources:s})}),s.referralSources&&n(e=>(0,m.A)((0,m.A)({},e),{},{referralSources:""}))})(a),"aria-pressed":r,className:"flex items-center justify-center gap-1.5 px-3 py-3 rounded-lg font-semibold text-sm border transition-colors ".concat(r?"bg-[#BF212F] text-white border-[#BF212F]":"bg-white text-gray-700 border-gray-300 hover:border-[#BF212F]"),children:[r&&(0,f.jsx)(p.A,{className:"h-4 w-4 flex-shrink-0"}),(0,f.jsx)("span",{children:a})]},a)})}),s.referralSources&&(0,f.jsx)("p",{className:"mt-1.5 text-sm text-[#BF212F]",children:s.referralSources})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("button",{type:"submit",disabled:r,className:"inline-flex w-full items-center justify-center gap-2.5 rounded-lg bg-turbo-red px-[34px] py-[18px] font-head text-lg font-bold text-white transition-transform duration-[400ms] ease-turbo hover:-translate-y-[3px] hover:bg-redline disabled:translate-y-0 disabled:cursor-not-allowed disabled:opacity-60",children:r?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-white border-t-transparent"}),(0,f.jsx)("span",{children:"Submitting\u2026"})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{children:"Request your quote"})]})}),(0,f.jsxs)("p",{className:"mt-4 text-center text-sm text-gray-500",children:["Prefer to talk? Call"," ",(0,f.jsx)("a",{href:"tel:1300207446",className:"font-semibold text-[#BF212F] hover:text-[#8E1822]",children:"1300 207 446"})]})]})]})}),(0,f.jsxs)("aside",{className:"h-fit space-y-4 lg:sticky lg:top-24",children:[(0,f.jsxs)(ae.gN,{delay:80,className:"rounded-2xl border border-[#262626] bg-carbon-900 p-6 text-white sm:p-8",children:[(0,f.jsx)(ae.YZ,{className:"mb-5",children:"Why Turbo"}),(0,f.jsxs)("ul",{className:"space-y-5",children:[(0,f.jsxs)("li",{className:"flex items-start gap-3",children:[(0,f.jsx)(Nt.A,{className:"mt-0.5 h-5 w-5 flex-shrink-0 text-turbo-red"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold text-smoke",children:"24-hour response"}),(0,f.jsx)("p",{className:"text-sm text-[#9C9A95]",children:"A tailored quote within one business day."})]})]}),(0,f.jsxs)("li",{className:"flex items-start gap-3",children:[(0,f.jsx)(Xe.A,{className:"mt-0.5 h-5 w-5 flex-shrink-0 text-turbo-red"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold text-smoke",children:"Expert crew"}),(0,f.jsx)("p",{className:"text-sm text-[#9C9A95]",children:"Professional video, photo and live teams across Australia."})]})]}),(0,f.jsxs)("li",{className:"flex items-start gap-3",children:[(0,f.jsx)(Cs.A,{className:"mt-0.5 h-5 w-5 flex-shrink-0 text-turbo-red"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold text-smoke",children:"No obligation"}),(0,f.jsx)("p",{className:"text-sm text-[#9C9A95]",children:"Free quote, transparent pricing, no hidden fees."})]})]})]}),(0,f.jsxs)("div",{className:"mt-7 border-t border-white/10 pt-6",children:[(0,f.jsx)("p",{className:"mb-1 text-sm text-[#9C9A95]",children:"Need it sooner?"}),(0,f.jsx)("a",{href:"tel:1300207446",className:"q-display text-2xl font-bold text-white transition-colors hover:text-turbo-red",children:"1300 207 446"})]})]}),(0,f.jsx)("p",{className:"px-1 text-xs leading-relaxed text-fog",children:"Covering all Australian capitals \u2014 Sydney, Melbourne, Brisbane, Perth, Adelaide, Canberra, Hobart and Darwin."})]})]}),(0,f.jsx)("div",{className:"mt-12 border-t border-[#222] pt-6",children:(0,f.jsx)("p",{className:"q-kicker text-center text-fog",children:"Australia-wide \xb7 24-hr reply \xb7 No obligation \xb7 Transparent pricing"})}),(0,f.jsxs)("section",{className:"mx-auto mt-16 max-w-3xl",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(ae.YZ,{className:"mb-3",children:"How it works"}),(0,f.jsx)(ae.nl,{as:"h2",className:"mb-5 text-[clamp(30px,4vw,52px)]",children:"From brief to booked in three steps"}),(0,f.jsx)("p",{className:"mb-10 text-lg leading-relaxed text-[#C7C4BD]",children:"Every project starts with a conversation, not a contract. Tell us what you're planning \u2014 a conference, corporate event, product launch, headsh
1ot session or a full video production \u2014 and we'll come back within one business day with a clear, itemised quote built around your scope, dates and budget. No call centres, no pressure, and no obligation to proceed."})]}),(0,f.jsx)(ae.gN,{children:(0,f.jsxs)("ol",{className:"mb-12 space-y-6",children:[(0,f.jsxs)("li",{className:"flex items-start gap-4",children:[(0,f.jsx)("span",{className:"q-display flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-turbo-red font-bold text-white",children:"1"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-bold text-smoke",children:"Send us the details"}),(0,f.jsx)("p",{className:"leading-relaxed text-[#9C9A95]",children:"Use the form above to share your event date, location, the services you need and a short brief. The more context you give us, the more accurate your quote."})]})]}),(0,f.jsxs)("li",{className:"flex items-start gap-4",children:[(0,f.jsx)("span",{className:"q-display flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-turbo-red font-bold text-white",children:"2"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-bold text-smoke",children:"We build your quote"}),(0,f.jsx)("p",{className:"leading-relaxed text-[#9C9A95]",children:"A producer reviews your brief and matches the right crew, equipment and delivery timeline \u2014 including same-day photo and video turnaround where you need it. You'll have a transparent, fixed quote within 24 hours."})]})]}),(0,f.jsxs)("li",{className:"flex items-start gap-4",children:[(0,f.jsx)("span",{className:"q-display flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-turbo-red font-bold text-white",children:"3"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-lg font-bold text-smoke",children:"Lock in your crew"}),(0,f.jsx)("p",{className:"leading-relaxed text-[#9C9A95]",children:"Happy to go ahead? We confirm your date, brief the team and handle the logistics. From a single photographer to a multi-camera production, your booking is managed end to end."})]})]})]})}),(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(ae.YZ,{className:"mb-3",children:"Good to know"}),(0,f.jsxs)("div",{className:"space-y-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"mb-1 text-lg font-bold text-smoke",children:"What does a quote cover?"}),(0,f.jsx)("p",{className:"leading-relaxed text-[#9C9A95]",children:"Photography, video production, live streaming, post-production editing, virtual tours and web or app development \u2014 individually or bundled. Quotes are tailored to your event size, number of crew, hours of coverage and the deliverables you want."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"mb-1 text-lg font-bold text-smoke",children:"How fast can you deliver?"}),(0,f.jsx)("p",{className:"leading-relaxed text-[#9C9A95]",children:"Same-day delivery is our specialty. Edited highlight photos and social-ready video reels can be turned around during or immediately after your event, with full galleries to follow."})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"mb-1 text-lg font-bold text-smoke",children:"Where do you operate?"}),(0,f.jsx)("p",{className:"leading-relaxed text-[#9C9A95]",children:"We cover every Australian capital \u2014 Sydney, Melbourne, Brisbane, Perth, Adelaide, Canberra, Hobart and Darwin \u2014 plus regional centres and international events on request. Wherever your event is, we'll get the right team there."})]})]})]})]})]})}),(0,f.jsx)(B.A,{})]})},_y=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)(""),[n,i]=(0,a.useState)(!1),[o,l]=(0,a.useState)(null),[c,m]=(0,a.useState)("");return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"Client Portal Login | Turbo 360 Photography"}),(0,f.jsx)("meta",{name:"description",content:"Log in to your Turbo 360 client portal to access your event photos, videos, and project files."}),(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"}),(0,f.jsx)("link",{rel:"canonical",href:"https://turbo.net.au/client-login"})]}),(0,f.jsxs)("main",{className:"min-h-screen flex",children:[(0,f.jsxs)("aside",{className:"hidden lg:flex lg:w-2/5 relative",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:'url("/images/services/locations/CONFERENCE-PHOTOGRAPHY.jpg")'}}),(0,f.jsx)("div",{className:"absolute inset-0 bg-black/40"}),(0,f.jsxs)("div",{className:"relative z-10 flex flex-col justify-between p-12 text-white",children:[(0,f.jsx)("div",{children:(0,f.jsx)("img",{src:"/Logo-DarkBG.png",alt:"Turbo 360",className:"h-12 w-auto"})}),(0,f.jsxs)("div",{className:"max-w-md",children:[(0,f.jsxs)("h2",{className:"text-4xl font-bold mb-4",children:["Welcome to your",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-teal-400",children:"Client Portal"})]}),(0,f.jsx)("p",{className:"text-slate-300 text-lg leading-relaxed mb-4",children:"Access your projects, invoices, proposals, and tasks all in one place. Stay connected with your dedicated team at Turbo 360."}),(0,f.jsxs)("ul",{className:"text-slate-400 text-sm space-y-2",children:[(0,f.jsx)("li",{children:"View and download your event photos and videos"}),(0,f.jsx)("li",{children:"Track project progress and delivery timelines"}),(0,f.jsx)("li",{children:"Access invoices, proposals, and contracts"}),(0,f.jsx)("li",{children:"Communicate directly with your production team"}),(0,f.jsx)("li",{children:"Review and approve edits before final delivery"}),(0,f.jsx)("li",{children:"Download high-resolution files and gallery links"})]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-3 text-sm text-slate-400",children:[(0,f.jsx)(Oa.A,{className:"h-5 w-5 text-teal-400"}),(0,f.jsx)("span",{children:"Secure, passwordless authentication"})]})]})]}),(0,f.jsxs)("section",{className:"w-full lg:flex-1 flex flex-col bg-gradient-to-br from-slate-100 via-slate-200 to-slate-300 relative",children:[(0,f.jsx)("div",{className:"absolute inset-0 z-0 opacity-[0.35]",style:{backgroundImage:"url(\"data:image/svg+xml,%3Csvg width='10' height='10' viewB
1ox='0 0 10 10' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='5' cy='5' r='1' fill='%23000000' fill-opacity='0.4'/%3E%3C/svg%3E\")"}}),(0,f.jsx)("div",{className:"relative z-10 lg:hidden bg-gradient-to-r from-slate-900 to-slate-800 px-6 py-6",children:(0,f.jsx)("img",{src:"/Logo-DarkBG.png",alt:"Turbo 360",className:"h-10 w-auto"})}),(0,f.jsx)("div",{className:"relative z-10 flex-1 flex items-center justify-center px-6 py-12 lg:px-12",children:(0,f.jsxs)("div",{className:"w-full max-w-md",children:[(0,f.jsxs)("div",{className:"text-center mb-8",children:[(0,f.jsx)("div",{className:"inline-flex items-center justify-center w-20 h-20 bg-turbo-red rounded-2xl shadow-lg shadow-turbo-red/30 mb-6",children:(0,f.jsx)("img",{src:"/turbo-icon.png",alt:"Turbo 360",className:"w-14 h-14 object-contain"})}),(0,f.jsx)("h1",{className:"text-4xl md:text-5xl font-black text-slate-900 mb-2",children:"Client Portal"}),(0,f.jsx)("p",{className:"text-slate-500",children:"Enter your email to receive a secure login link"})]}),"success"===o?(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 p-8 text-center",children:[(0,f.jsx)("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,f.jsx)(p.A,{className:"h-8 w-8 text-green-600"})}),(0,f.jsx)("h3",{className:"text-xl font-bold text-slate-900 mb-2",children:"Check your inbox"}),(0,f.jsx)("p",{className:"text-slate-500 mb-6",children:"We've sent a magic link to your email address. Click the link to access your portal."}),(0,f.jsxs)("div",{className:"bg-slate-50 rounded-xl p-4 text-sm text-slate-600",children:[(0,f.jsx)("p",{className:"font-medium",children:"Didn't receive it?"}),(0,f.jsx)("p",{className:"mt-1",children:"Check your spam folder or wait a moment and try again."})]}),(0,f.jsx)("button",{onClick:()=>l(null),className:"mt-6 text-teal-600 hover:text-teal-700 font-semibold text-sm",children:"Send another link"})]}):(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-slate-200 p-3",children:[c&&(0,f.jsx)("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-xl",children:(0,f.jsx)("p",{className:"text-red-600 text-sm font-medium",children:c})}),(0,f.jsxs)("form",{onSubmit:async a=>{if(a.preventDefault(),m(""),t.trim())if(/\S+@\S+\.\S+/.test(t))if((e=>{const t=String(e||"").trim().toLowerCase().split("@")[1];return!!t&&Yg.some(e=>t===e||t.endsWith(".".concat(e)))})(t))e("/lifeblood/login?email=".concat(encodeURIComponent(t.trim())));else{i(!0);try{const e=await fetch("".concat(I.fn,"/api/client-portal/request-magic-link"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})}),a=await e.json();e.ok?(l("success"),s("")):m(a.message||"Failed to send magic link. Please try again.")}catch(n){m("An error occurred. Please try again later.")}finally{i(!1)}}else m("Please enter a valid email address");else m("Email address is required")},className:"space-y-4",children:[(0,f.jsx)("div",{children:(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none",children:(0,f.jsx)(T.A,{className:"h-5 w-5 text-slate-400"})}),(0,f.jsx)("input",{type:"email",value:t,onChange:e=>s(e.target.value),placeholder:"[email protected]",className:"w-full pl-12 pr-4 py-3.5 bg-slate-50 border-2 border-slate-200 rounded-xl text-slate-900 placeholder-slate-400 focus:outline-none focus:border-teal-500 focus:ring-4 focus:ring-teal-500/10 transition-all",disabled:n})]})}),(0,f.jsx)("button",{type:"submit",disabled:n,className:"w-full flex items-center justify-center gap-2 bg-teal-500 hover:bg-teal-600 text-white font-semibold py-3.5 px-6 rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed group",children:n?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),(0,f.jsx)("span",{children:"Sending link..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{children:"Send Magic Link"}),(0,f.jsx)(S.A,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]})})]})]}),(0,f.jsxs)("div",{className:"lg:hidden mt-8 p-4 bg-slate-100 rounded-xl text-sm text-slate-600 space-y-2",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-700",children:"Your Turbo 360 Client Portal"}),(0,f.jsx)("p",{children:"Access your event photos, videos, invoices, proposals, and project files. Track delivery timelines, communicate with your production team, review edits, and download high-resolution files. Our secure passwordless login sends a magic link directly to your registered email address for quick and safe access to all your content."})]})]})})]})]})]})},Cy=()=>{const e=(0,r.Zp)(),[t]=(0,r.ok)(),[s,n]=(0,a.useState)("verifying"),[i,o]=(0,a.useState)("");return(0,a.useEffect)(()=>{(async()=>{const s=t.get("token");if(!s)return n("error"),void o("Invalid access link");try{const t=await fetch("".concat(I.fn,"/api/client-portal/verify-magic-link?token=").concat(s));if(t.ok){const s=await t.json();sessionStorage.setItem("turbo360_client_session",JSON.stringify({token:s.token,client:s.client,timestamp:(new Date).toISOString()})),n("success"),o("Login successful! Redirecting to your dashboard..."),setTimeout(()=>{e("/client-portal/dashboard")},2e3)}else{const e=await t.json();n("error"),o(e.detail||"Invalid or expired link")}}catch(a){console.error("Verification error:",a),n("error"),o("Failed to verify link. Please try again.")}})()},[t,e]),(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-gray-50 to-teal-50 flex items-center justify-center px-4",children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"Verify Access - Turbo 360 Client Portal"}),(0,f.jsx)("meta",{name:"description",content:"Verify your access to the Turbo 360 client portal. Secure login verification for accessing your event photos and galleries."}),(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,f.jsxs)("div",{className:"max-w-md w-full bg-white rounded-3xl shadow-2xl p-12 text-center",children:["verifying"===s&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-b-4 border-teal-600 mx-auto mb-6"}),(0,f.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Verifying Your Acce
1ss"}),(0,f.jsx)("p",{className:"text-gray-600 mb-4",children:"Please wait while we securely verify your access link"}),(0,f.jsx)("p",{className:"text-sm text-gray-500",children:"This magic link provides secure, password-free access to your Turbo 360 client portal where you can view and download your event photos."})]}),"success"===s&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-20 h-20 bg-gradient-to-br from-green-500 to-green-600 rounded-full flex items-center justify-center mx-auto mb-6",children:(0,f.jsx)(p.A,{className:"h-12 w-12 text-white"})}),(0,f.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Access Verified Successfully!"}),(0,f.jsx)("p",{className:"text-gray-600 text-lg mb-4",children:i}),(0,f.jsx)("p",{className:"text-sm text-gray-500",children:"You'll be redirected to your client dashboard where you can browse your photo galleries, download high-resolution images, and manage your event content."})]}),"error"===s&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-20 h-20 bg-gradient-to-br from-red-500 to-red-600 rounded-full flex items-center justify-center mx-auto mb-6",children:(0,f.jsx)(x.A,{className:"h-12 w-12 text-white"})}),(0,f.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Access Link Invalid"}),(0,f.jsx)("p",{className:"text-gray-600 text-lg mb-6",children:i}),(0,f.jsx)("p",{className:"text-sm text-gray-500 mb-6",children:"Access links expire after 24 hours for security. If your link has expired or is invalid, you can request a new one from the client login page. Simply enter your email address and we'll send you a fresh access link immediately."}),(0,f.jsx)("button",{onClick:()=>e("/client-login"),className:"px-6 py-3 bg-gradient-to-r from-teal-600 to-teal-700 text-white rounded-lg font-bold hover:from-teal-700 hover:to-teal-800 transition-all",children:"Request New Access Link"})]})]})]})},Fy=()=>{const{clientId:e}=(0,r.g)(),t=(0,r.Zp)(),[s,n]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(async()=>{try{var a;const s=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token;if(!s)return n("Admin authentication required"),void setTimeout(()=>t("/admin"),2e3);const r=await fetch("".concat(I.fn,"/api/admin/impersonate-client/").concat(e),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}});if(r.ok){const e=await r.json();sessionStorage.setItem("turbo360_client_session",JSON.stringify({token:e.token,client:e.client,is_admin_impersonation:!0})),t("/client-portal/dashboard",{replace:!0})}else n("Failed to access client portal"),setTimeout(()=>window.close(),2e3)}catch(s){console.error("Error accessing client portal:",s),n("Error accessing client portal"),setTimeout(()=>window.close(),2e3)}})()},[e,t]),(0,f.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,f.jsx)("div",{className:"text-center",children:s?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:"text-red-600 font-medium",children:s}),(0,f.jsx)("p",{className:"text-gray-500 text-sm mt-2",children:"Redirecting..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kr.A,{className:"h-8 w-8 animate-spin text-blue-600 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-600",children:"Loading client portal..."})]})})})},Ey=e=>{let{clientId:t,onTasksLoaded:s}=e;const[n,r]=(0,a.useState)([]),[i,o]=(0,a.useState)(!0),[l,c]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&d()},[t]);const d=async()=>{try{const e=await fetch("".concat(I.JR,"/api/client/todos/").concat(t)),a=await e.json();a.success&&(r(a.todos),null===s||void 0===s||s(a.todos.length))}catch(e){console.error("Error fetching tasks:",e)}finally{o(!1)}},m=e=>{const t=e.toLowerCase();return t.includes("progress")||t.includes("development")?{bg:"bg-blue-50",text:"text-blue-700",border:"border-blue-200",dot:"bg-blue-500"}:t.includes("complete")||t.includes("done")?{bg:"bg-green-50",text:"text-green-700",border:"border-green-200",dot:"bg-green-500"}:t.includes("hold")||t.includes("pending")?{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-200",dot:"bg-
1amber-500"}:t.includes("review")||t.includes("awaiting")?{bg:"bg-purple-50",text:"text-purple-700",border:"border-purple-200",dot:"bg-purple-500"}:{bg:"bg-slate-50",text:"text-slate-700",border:"border-slate-200",dot:"bg-slate-500"}},p=e=>e?new Date(e).toLocaleDateString("en-AU",{timeZone:"Australia/Melbourne",day:"numeric",month:"short",year:"numeric"}):"";return i?(0,f.jsx)("div",{className:"bg-white rounded-xl border border-slate-200 p-8",children:(0,f.jsx)("div",{className:"flex items-center justify-center",children:(0,f.jsx)("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-teal-500"})})}):0===n.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 p-12 text-center",children:[(0,f.jsx)(us.A,{className:"h-12 w-12 text-slate-300 mx-auto mb-3"}),(0,f.jsx)("p",{className:"text-slate-600 font-medium",children:"No active tasks"}),(0,f.jsx)("p",{className:"text-slate-400 text-sm mt-1",children:"You're all caught up!"})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-slate-900",children:"Tasks In Progress"}),(0,f.jsx)("p",{className:"text-slate-500 text-sm",children:"Projects we're currently working on for you"})]}),(0,f.jsx)("div",{className:"space-y-3",children:n.map(e=>{const t=m(e.status);return(0,f.jsx)("div",{onClick:()=>c(e),className:"bg-white rounded-xl border border-slate-200 p-4 hover:border-slate-300 hover:shadow-sm transition-all cursor-pointer group",children:(0,f.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("h3",{className:"font-semibold text-slate-900 group-hover:text-teal-600 transition-colors",children:e.project_name}),(0,f.jsx)("div",{className:"text-sm text-slate-500 mt-1 line-clamp-2",dangerouslySetInnerHTML:{__html:or.default.sanitize(e.description)}}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-3",children:[(0,f.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold ".concat(t.bg," ").concat(t.text," border ").concat(t.border),children:[(0,f.jsx)("span",{className:"w-1.5 h-1.5 rounded-full ".concat(t.dot)}),e.status]}),e.updated_at&&(0,f.jsxs)("span",{className:"text-xs text-slate-400",children:["Updated ",p(e.updated_at)]}),e.progress_notes&&e.progress_notes.length>0&&(0,f.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-slate-400",children:[(0,f.jsx)(Fn.A,{className:"h-3 w-3"}),e.progress_notes.length," update",1!==e.progress_notes.length?"s":""]})]}),e.progress_notes&&e.progress_notes.length>0&&(()=>{const t=e.progress_notes[0];return(0,f.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-100",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,f.jsx)("span",{className:"w-2 h-2 rounded-full bg-teal-500 flex-shrink-0"}),(0,f.jsx)("span",{className:"text-xs font-semibold text-slate-500 uppercase",children:"Turbo Team"}),(0,f.jsx)("span",{className:"text-xs text-slate-400",children:new Date(t.created_at).toLocaleString("en-AU",{timeZone:"Australia/Melbourne",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})})]}),(0,f.jsx)("div",{className:"bg-slate-50 rounded-lg p-2.5 border border-slate-200",children:(0,f.jsx)("p",{className:"text-slate-600 text-sm line-clamp-2",children:t.note_text})})]})})()]}),(0,f.jsx)(rs.A,{className:"h-5 w-5 text-slate-300 group-hover:text-slate-400 flex-shrink-0 mt-1"})]})},e.id)})})]}),l&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl max-w-2xl w-full max-h-[90vh] overflow-hidden shadow-2xl",children:[(0,f.jsx)("div",{className:"bg-slate-900 text-white p-6",children:(0,f.jsxs)("div",{className:"flex items-start justify-between",children:[(0,f.jsxs)("div",{className:"flex-1 pr-4",children:[(0,f.jsx)("p",{className:"text-sm text-slate-400 font-medium uppercase tracking-wide mb-1",children:"Task Details"}),(0,f.jsx)("h2",{className:"text-xl font-bold",children:l.project_name}),(0,f.jsx)("div",{className:"mt-3",children:(()=>{const e=m(l.status);return(0,f.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold bg-white/10 text-white border border-white/20",children:[(0,f.jsx)("span",{className:"w-1.5 h-1.5 rounded-full ".concat(e.dot)}),l.status]})})()})]}),(0,f.jsx)("button",{onClick:()=>c(null),className:"p-2 hover:bg-white/10 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"w-5 h-5"})})]})}),(0,f.jsxs)("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-180px)]",children:[(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Project Description"}),(0,f.jsx)("div",{className:"bg-slate-50 rounded-xl p-4 border border-slate-200",children:(0,f.jsx)("div",{className:"text-slate-700 prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:or.default.sanitize(l.description)}})})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Current Status"}),(()=>{const e=m(l.status);return(0,f.jsx)("div",{className:"rounded-xl p-4 border ".concat(e.border," ").concat(e.bg),children:(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Nt.A,{className:"w-4 h-4 ".concat(e.text)}),(0,f.jsx)("span",{className:"font-semibold ".concat(e.text),children:l.status})]})})})()]}),l.updated_at&&(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-semibold text-slate-700 mb-2",children:"Last Updated"}),(0,f.jsx)("div",{className:"bg-slate-50 rounded-xl p-4 border border-slate-200",children:(0,f.jsx)("p",{className:"font-medium text-slate-700",children:p(l.updated_at)})})]})]}),l.progress_notes&&l.progress_notes.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-sm font-semibold text-slate-700 mb-3",children:["Project Updates (",l.progress_notes.length,")"]}),(0,f.jsx)("div",{className:"space-y-4",children:l.progress_notes.map((e,t)=>(0,f.jsxs)("div",{className:"relative pl-6",children:[t!==l.progress_notes.length-1&&(0,f.jsx)("div",{className:"absolute left-[7px] top-6 bottom-0 w-0.5 bg-slate-200"}),(0,f.jsx)("div",{className:"absolute left-0 top-1.5 w-3.5 h-3.5 rounded-full bg-teal-500 border-2 border-white shadow-sm"}),(0,f.jsxs)("div",{className:"ml-3",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-slate-500 uppercase",children:"Turbo Team"}),(0,f.jsx)("span",{className:"text-xs text-slate-400",children:new Date(e.created_at).toLocaleStr
1ing("en-AU",{timeZone:"Australia/Melbourne",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})})]}),(0,f.jsx)("div",{className:"bg-slate-50 rounded-lg p-3 border border-slate-200",children:(0,f.jsx)("p",{className:"text-slate-700 text-sm whitespace-pre-wrap break-words",children:e.note_text})})]})]},e.id))})]}),l.created_at&&(0,f.jsxs)("p",{className:"text-xs text-slate-400 text-center mt-6 pt-4 border-t border-slate-200",children:["Task created ",p(l.created_at)]})]}),(0,f.jsx)("div",{className:"p-4 border-t border-slate-200 bg-slate-50",children:(0,f.jsx)("button",{onClick:()=>c(null),className:"w-full px-6 py-3 bg-slate-900 hover:bg-slate-800 text-white rounded-xl font-semibold transition-colors",children:"Close"})})]})})]})},Ty="#E42313",zy="#FFFFFF",By={red:{band:Ty,name:zy,detail:zy},white:{band:zy,name:Ty,detail:"#000000"}},Dy=1920,Iy="Grace Williams",Ry="700 62px 'Saira Condensed', 'Arial Narrow', sans-serif",Py="700 26px 'Nunito Sans', sans-serif",Wy="400 23px 'Nunito Sans', sans-serif",Oy=23*1.2;function Ly(e){return{name:(e.name||"").trim()||Iy,role:(e.role||"").trim(),unit:(e.unit||"").trim()}}function My(e,t){const{name:s,role:a,unit:n}=Ly(e),r=By[t],i=[{kind:"name",text:s.toUpperCase(),font:Ry,lineHeight:60.76,color:r.name}];return a&&i.push({kind:"position",text:a,font:Py,lineHeight:31.2,color:r.detail}),n&&i.push({kind:"unit",text:n,font:Wy,lineHeight:Oy,color:r.detail}),i}let qy=null;function Hy(e){const t=function(){qy||(qy=document.createElement("canvas"));const e=qy.getContext("2d");if(!e)throw new Error("Canvas 2D context unavailable");return e}();let s=0;for(const a of e)a.text&&(t.font=a.font,s=Math.max(s,t.measureText(a.text).width));return s}function Uy(e){return Math.max(880,Math.ceil(120+Hy(e)+210))}function Gy(e){return[[0,0],[e-123,0],[e-95,28],[e-67,0],[e,67],[e-28,95],[e,123],[e-67,190],[e-95,162],[e-123,190],[0,190]]}async function Vy(){var e;null!==(e=document.fonts)&&void 0!==e&&e.load&&await Promise.all([document.fonts.load(Ry,Iy.toUpperCase()),document.fonts.load(Py,"Position"),document.fonts.load(Wy,"Unit")])}function Jy(e){let{fields:t,style:s,bottom:a}=e;const n=document.createElement("canvas");n.width=Dy,n.height=1080;const r=n.getContext("2d");if(!r)throw new Error("Canvas 2D context unavailable");const i=My(t,s),o=Uy(i),l=function(e){return 1080-e-190}(a);r.beginPath(),Gy(o).forEach((e,t)=>{let[s,a]=e;const n=0+s,i=l+a;0===t?r.moveTo(n,i):r.lineTo(n,i)}),r.closePath(),r.fillStyle=By[s].band,r.fill(),r.textAlign="left",r.textBaseline="alphabetic";const c=function(e,t){return t.map(t=>{var s,a;e.font=t.font;const n=e.measureText(t.text),r=null!==(s=n.fontBoundingBoxAscent)&&void 0!==s?s:n.actualBoundingBoxAscent,i=null!==(a=n.fontBoundingBoxDescent)&&void 0!==a?a:n.actualBoundingBoxDescent;return(0,m.A)((0,m.A)({},t),{},{ascent:r,content:r+i})})}(r,i),d=c.reduce((e,t)=>e+t.lineHeight,0)+8*(c.length-1);let p=l+(190-d)/2;for(const m of c){r.font=m.font,r.fillStyle=m.color;const e=p+(m.lineHeight-m.content)/2+m.ascent;r.fillText(m.text,120,e),p+=m.lineHeight+8}return n}async function Yy(e){await Vy();const t=Jy(e),s=await new Promise(e=>t.toBlob(e,"image/png"));if(!s)throw new Error("PNG encoding failed");const a=URL.createObjectURL(s),n=document.createElement("a");n.href=a,n.download=function(e,t){const s=String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");return"lower-third-".concat(s||"untitled","-").concat("red"===t?"1a-red":"1b-white",".png")}(Ly(e.fields).name,e.style),document.body.appendChild(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(a),4e3)}const Ky={name:{font:"700 62px/0.98 ".concat(qx),textTransform:"uppercase"},position:{font:"700 26px/1.2 ".concat(Hx)},unit:{font:"400 23px/1.2 ".concat(Hx)}};function Zy(e){let{label:t,value:s,onChange:n,placeholder:r}=e;const[i,o]=(0,a.useState)(!1);return(0,f.jsxs)("label",{style:{display:"block",marginBottom:16},children:[(0,f.jsx)("span",{style:{display:"block",font:"700 11px/1 ".concat(Hx),letterSpacing:".12em",textTransform:"uppercase",color:Mx.burgundy,marginBottom:7},children:t}),(0,f.jsx)("input",{value:s,placeholder:r,onChange:e=>n(e.target.value),onFocus:()=>o(!0),onBlur:()=>o(!1),style:{width:"100%",boxSizing:"border-box",borderRadius:0,padding:"11px 12px",font:"400 16px/1.3 ".concat(Hx),color:Mx.black,background:Mx.white,border:"1px solid ".concat(Mx.black),outline:i?"2px solid ".concat(Mx.focus):"2px solid transparent",outlineOffset:1,transition:"outline-color .3s ease"}})]})}function $y(){const[e,t]=(0,a.useState)({name:"Grace Williams",role:"Senior Communications Business Partner",unit:"People and Culture"}),[s,n]=(0,a.useState)("red"),[r,i]=(0,a.useState)(185),[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(null),[p,x]=(0,a.useState)(null),[h,u]=(0,a.useState)(!1),b=(0,a.useRef)(null),y=(0,a.useRef)(null),[v,j]=(0,a.useState)(1120);(0,a.useEffect)(()=>{let e=!1;const t=()=>{e||l(!0)};return Vy().then(t,t),()=>{e=!0}},[]),(0,a.useEffect)(()=>{const e=b.current;if(!e)return;const t=()=>j(e.clientWidth||1120),s=new ResizeObserver(t);return s.observe(e),t(),()=>s.disconnect()},[]),(0,a.useEffect)(()=>
1{if(p)return()=>URL.revokeObjectURL(p)},[p]);const w=(0,a.useMemo)(()=>My(e,s),[e,s]),N=(0,a.useMemo)(()=>Uy(w),[w,o]),A=e=>s=>t(t=>(0,m.A)((0,m.A)({},t),{},{[e]:s})),k=(0,a.useCallback)(e=>{e&&e.type.startsWith("image/")&&x(URL.createObjectURL(e))},[]),S=(0,a.useCallback)(()=>{d(null),Yy({fields:e,style:s,bottom:r}).catch(e=>{console.error("PNG export failed",e),d("Couldn't build the PNG. Reload the page and try again.")})},[e,s,r]),_=(e,t,a)=>{const r=s===e;return(0,f.jsxs)("button",{type:"button",onClick:()=>n(e),style:{flex:1,borderRadius:0,cursor:"pointer",textAlign:"left",padding:"11px 12px",background:r?Mx.red:Mx.white,color:r?Mx.white:Mx.black,border:"1px solid ".concat(r?Mx.red:Mx.hairline),transition:"background .3s ease, color .3s ease, border-color .3s ease"},children:[(0,f.jsx)("span",{style:{display:"block",font:"700 14px/1.2 ".concat(Hx)},children:t}),(0,f.jsx)("span",{style:{display:"block",font:"400 12px/1.3 ".concat(Hx),marginTop:2,color:r?"rgba(255,255,255,.82)":Mx.burgundy},children:a})]},e)};return(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0,340px) minmax(0,1fr)",gap:28,alignItems:"start"},className:"lb-lt-grid",children:[(0,f.jsxs)("section",{style:{background:Mx.white,border:"1px solid ".concat(Mx.hairline),padding:24},children:[(0,f.jsx)("h3",{style:{margin:"0 0 4px",font:"700 22px/1.1 ".concat(qx),textTransform:"uppercase",letterSpacing:".01em",color:Mx.black},children:"Lower third"}),(0,f.jsx)("p",{style:{margin:"0 0 20px",font:"400 13.5px/1.5 ".concat(Hx),color:Mx.burgundy},children:"Type the details, pick a style, then download a transparent PNG at 1920\xd71080."}),(0,f.jsx)(Zy,{label:"Name",value:e.name,onChange:A("name"),placeholder:"Grace Williams"}),(0,f.jsx)(Zy,{label:"Position",value:e.role,onChange:A("role"),placeholder:"Senior Communications Business Partner"}),(0,f.jsx)(Zy,{label:"Unit",value:e.unit,onChange:A("unit"),placeholder:"People and Culture"}),(0,f.jsx)("span",{style:{display:"block",font:"700 11px/1 ".concat(Hx),letterSpacing:".12em",textTransform:"uppercase",color:Mx.burgundy,marginBottom:7},children:"Style"}),(0,f.jsxs)("div",{style:{display:"flex",gap:8,marginBottom:20},children:[_("red","1a \xb7 Red","White type"),_("white","1b \xb7 White","Red name")]}),(0,f.jsxs)("span",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",font:"700 11px/1 ".concat(Hx),letterSpacing:".12em",textTransform:"uppercase",color:Mx.burgundy,marginBottom:9},children:["Bottom offset",(0,f.jsxs)("span",{style:{font:"700 13px/1 ".concat(Hx),letterSpacing:0,color:Mx.black},children:[r,"px"]})]}),(0,f.jsx)("input",{type:"range",min:110,max:520,step:5,value:r,onChange:e=>i(Number(e.target.value)),style:{width:"100%",accentColor:Mx.red,marginBottom:22}}),(0,f.jsxs)("button",{type:"button",onClick:S,onMouseEnter:e=>{e.currentTarget.style.background=Mx.burgundy},onMouseLeave:e=>{e.currentTarget.style.background=Mx.red},style:{width:"100%",borderRadius:0,border:"none",cursor:"pointer",background:Mx.red,color:Mx.white,padding:"14px 16px",font:"700 15px/1 ".concat(Hx),display:"flex",alignItems:"center",justifyContent:"center",gap:9,transition:"background .3s ease"},children:[(0,f.jsx)(es.A,{size:17})," Download PNG"]}),c&&(0,f.jsx)("p",{role:"alert",style:{margin:"12px 0 0",padding:"10px 12px",background:Mx.peach,borderLeft:"3px solid ".concat(Mx.orange),font:"400 13px/1.45 ".concat(Hx),color:Mx.black},children:c})]}),(0,f.jsxs)("section",{style:{minWidth:0},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:16,marginBottom:10,flexWrap:"wrap"},children:[(0,f.jsx)("h3",{style:{margin:0,font:"700 22px/1.1 ".concat(qx),textTransform:"uppercase",color:Mx.black},children:"Preview"}),(0,f.jsx)("p",{style:{margin:0,font:"400 13px/1.4 ".concat(Hx),color:Mx.burgundy},children:"Drop a still from your video onto the frame to check legibility in context."})]}),(0,f.jsxs)("div",{ref:b,onDrop:e=>{e.preventDefault(),u(!1),k(e.dataTransfer.files[0])},onDragOver:e=>{e.preventDefault(),u(!0)},onDragLeave:()=>u(!1),style:{position:"relative",width:"100%",aspectRatio:"16 / 9",overflow:"hidden",background:"repeating-conic-gradient(#E9E4DA 0% 25%, #FFFFFF 0% 50%) 50% / 24px 24px",border:"1px solid ".concat(h?Mx.red:Mx.hairline),transition:"border-color .3s ease"},children:[p&&(0,f.jsx)("div",{style:{position:"absolute",inset:0,backgroundImage:"url(".concat(p,")"),backgroundSize:"cover",backgroundPosition:"center"}}),!p&&(0,f.jsxs)("button",{type:"button",onClick:()=>{var e;return null===(e=y.current)||void 0===e?void 0:e.click()},style:{position:"absolute",inset:0,width:"100%",height:"100%",border:"none",background:"transparent",curs
1or:"pointer",display:"flex",alignItems:"center",justifyContent:"center",gap:9,font:"400 14px/1 ".concat(Hx),color:Mx.burgundy},children:[(0,f.jsx)(Jr.A,{size:17})," Drop a video still"]}),(0,f.jsx)("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:0,width:Dy,height:1080,transform:"scale(".concat(v/Dy,")"),transformOrigin:"top left",pointerEvents:"none"},children:(0,f.jsx)("div",{style:{position:"absolute",left:0,bottom:r,width:N,height:190,display:"flex",flexDirection:"column",justifyContent:"center",gap:8,paddingLeft:120,paddingRight:210,boxSizing:"border-box",background:By[s].band,clipPath:(C=N,"polygon(".concat(Gy(C).map(e=>{let[t,s]=e;return"".concat(t,"px ").concat(s,"px")}).join(","),")"))},children:w.map(e=>(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},Ky[e.kind]),{},{color:e.color,whiteSpace:"nowrap"}),children:e.text},e.kind))})}),p&&(0,f.jsxs)("button",{type:"button",onClick:()=>x(null),style:{position:"absolute",top:10,right:10,borderRadius:0,cursor:"pointer",background:Mx.white,border:"1px solid ".concat(Mx.black),padding:"6px 10px",font:"700 12px/1 ".concat(Hx),color:Mx.black,display:"flex",alignItems:"center",gap:6},children:[(0,f.jsx)(g.A,{size:13})," Clear still"]}),(0,f.jsx)("input",{ref:y,type:"file",accept:"image/*",tabIndex:-1,onChange:e=>{var t;return k(null===(t=e.target.files)||void 0===t?void 0:t[0])},style:{position:"absolute",width:1,height:1,opacity:0,pointerEvents:"none"}})]}),(0,f.jsx)("p",{style:{margin:"10px 0 0",font:"400 13px/1.45 ".concat(Hx),color:Mx.burgundy},children:"Band grows with the longest line; notch geometry stays true to the donation device. The dropped still is a preview aid only \u2014 it is never part of the export."})]})]});var C}const Qy=["value","onChange","invalid"],Xy=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:2}).format(Number(e)||0),ev={display:"block",font:"700 11px/1 ".concat(Hx),letterSpacing:".12em",textTransform:"uppercase",color:Mx.burgundy,marginBottom:7};function tv(e){let{value:t,onChange:s,invalid:n}=e,r=(0,ot.A)(e,Qy);const[i,o]=(0,a.useState)(!1);return(0,f.jsx)("input",(0,m.A)((0,m.A)({},r),{},{value:t,onChange:e=>s(e.target.value),onFocus:()=>o(!0),onBlur:()=>o(!1),style:{width:"100%",boxSizing:"border-box",borderRadius:0,padding:"11px 12px",font:"400 16px/1.3 ".concat(Hx),color:Mx.black,background:Mx.white,border:"1px solid ".concat(n?Mx.red:Mx.black),outline:i?"2px solid ".concat(Mx.focus):"2px solid transparent",outlineOffset:1,transition:"outline-color .3s ease, border-color .3s ease"}}))}function sv(e){let{session:t,onClose:s,onSubmitted:n}=e;const[r,i]=(0,a.useState)([]),[o,l]=(0,a.useState)({}),[c,d]=(0,a.useState)({submitter_name:(null===t||void 0===t?void 0:t.name)||"",submitter_email:(null===t||void 0===t?void 0:t.email)||"",submitter_mobile:(null===t||void 0===t?void 0:t.mobile)||"",project_title:"",date_required:"",location:"",brief:""}),[p,x]=(0,a.useState)({}),[h,u]=(0,a.useState)(!1),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)(null),w=(0,a.useRef)(null);(0,a.useEffect)(()=>{fetch("".concat(I.fn,"/api/lifeblood/pricing")).then(e=>e.json()).then(e=>i(e.services||[])).catch(()=>i([]))},[]),(0,a.useEffect)(()=>{var e;const t=e=>{"Escape"===e.key&&s()};document.addEventListener("keydown",t);const a=document.body.style.overflow;return document.body.style.overflow="hidden",null===(e=w.current)||void 0===e||e.focus(),()=>{document.removeEventListener("keydown",t),document.body.style.overflow=a}},[s]);const N=(0,a.useMemo)(()=>{const e=r.map(e=>(0,m.A)((0,m.A)({},e),{},{qty:o[e.id]||0})).filter(e=>e.qty>0).map(e=>(0,m.A)((0,m.A)({},e),{},{amount:e.price_ex_gst*e.qty})),t=e.reduce((e,t)=>e+t.amount,0),s=.1*t;return{lines:e,sub:t,gst:s,total:t+s}},[r,o]),A=(e,t)=>l(s=>(0,m.A)((0,m.A)({},s),{},{[e]:Math.max(0,Math.min(99,(s[e]||0)+t))})),k=e=>t=>d(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t})),S={position:"fixed",inset:0,zIndex:90,background:"rgba(0,0,0,.62)",display:"flex",alignItems:"flex-start",justifyContent:"center",padding:"32px 16px",overflowY:"auto",animation:"lb-fade .3s ease"},_={width:"100%",maxWidth:940,background:Mx.white,border:"1px solid ".concat(Mx.black),borderRadius:0,outline:"none"};if(null!==v)return(0,f.jsx)("div",{style:S,onMouseDown:e=>{e.target===e.currentTarget&&n(v)},children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},_),{},{maxWidth:520,padding:"48px 40px",textAlign:"center"}),children:[(0,f.jsx)("div",{style:{display:"flex",justifyContent:"center",marginBottom:22},children:(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},Gx(Mx.turquoise,76)),{},{display:"flex",alignItems:"center",justifyContent:"center"}),children:(0,f.jsx)(zt.A,{size:34,strokeWidth:3,color:Mx.white})})}),(0,f.jsx)("h2",{style:{margin:"0 0 12px",font:"700 38px/1 ".concat(qx),textTransform:"uppercase",color:Mx.black},children:"Request sent"}),(0,f.jsx)("p",{style:{margin:"0 0 22px",font:"400 15px/1.55 ".concat(Hx),color:Mx.burgundy},children:"It\u2019s with Toney Wilkinson for approval. You\u2019ll find it in Job requests as Awaiting approval \u2014 we\u2019ll email you the moment he decides."}),v&&(0,f.jsx)("div",{style:{display:"inline-block",border:"1px solid ".concat(Mx.black),padding:"12px 22px",font:"700 24px/1 ".concat(qx),letterSpacing:".04em",color:Mx.black,marginBottom:26},children:v}),(0,f.jsx)("button",{type:"button",onClick:()=>n(v),style:{display:"block",width:"100%",borderRadius:0,border:"none",cursor:"pointer",background:Mx.red,color:Mx.white,padding:"14px 16px",font:"700 15px/1 ".concat(Hx)},children:"Back to my portal"})]})});const C=c.location.trim()&&(F=c.location,!/melbourne/i.test(F||""));var F;const E=N.lines.length>0&&!h;return(0,f.jsx)("div",{style:S,onMouseDown:e=>{e.target===e.currentTarget&&s()},children:(0,f.jsxs)("form",{ref:w,tabIndex:-1,onSubmit:async e=>{if(e.preventDefault(),(()=>{const e={};return c.submitter_name.trim()||(e.submitter_name=!0),/^\S+@\S+\.\S+$/.test(c.submitter_email.trim())||(e.submitter_email=!0),c.submitter_mobile.trim()||(e.submitter_mobile=!0),c.project_title.trim()||(e.project_title=!0),c.date_required||(e.date_required=!0),c.location.trim()||(e.location=!0),x(e),0===Object.keys(e).length})()&&0!==N.lines.length){u(!0),y(null);try{const e=await fetch("".concat(I.fn,"/api/lifeblood-job-request"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(null===t||void 0===t?void 0:t.token)},body:JSON.stringify({submitter_name:c.submitter_name.trim(),submitter_email:c.submitter_email.trim(),submitter_mobile:c.submitter_mobile.trim(),project_title:c.project_title.trim(),date_required:c.date_required,location:c.location.trim(),brief:c.brief.trim(),line_items:N.lines.map(e=>({service_id:e.id,qty:e.qty}))})});if(!e.ok)throw new Error(await e.text()||"Submission failed");const s=await e.json().catch(()=>({}));j(s.ref_code||"")}catch(s){y(s.message||"Something went wrong. Please try again or call 1300 207 446.")}finally{u(!1)}}},style:_,role:"dialog","aria-modal":"true","aria-label":"New job request",children:[(0,f.jsxs)("div",{style:{background:Mx.red,color:Mx.white,padding:"22px 28px",display:"flex",alignItems:"flex-start",ga
1p:16},children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("span",{style:{font:"700 11px/1 ".concat(Hx),letterSpacing:".18em",textTransform:"uppercase",opacity:.88},children:"Lifeblood \xd7 Turbo 360"}),(0,f.jsx)("h2",{style:{margin:"8px 0 6px",font:"700 32px/1 ".concat(qx),textTransform:"uppercase"},children:"New job request"}),(0,f.jsx)("p",{style:{margin:0,font:"400 14px/1.5 ".concat(Hx),color:"rgba(255,255,255,.92)"},children:"Fixed pricing as per the Turbo agreement. Your request goes to Toney Wilkinson for approval before anything is booked."})]}),(0,f.jsx)("button",{type:"button",onClick:s,"aria-label":"Close",style:{background:"transparent",border:"none",color:Mx.white,cursor:"pointer",padding:4,borderRadius:0},children:(0,f.jsx)(g.A,{size:24})})]}),(0,f.jsxs)("div",{className:"lb-njm-grid",style:{display:"grid",gridTemplateColumns:"minmax(0,1fr) 320px",gap:0},children:[(0,f.jsxs)("div",{style:{padding:"26px 28px 32px"},children:[(0,f.jsx)("h3",{style:{margin:"0 0 14px",font:"700 18px/1 ".concat(qx),textTransform:"uppercase",color:Mx.black},children:"Your details"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(190px,1fr))",gap:14,marginBottom:26},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{style:ev,children:"Name"}),(0,f.jsx)(tv,{value:c.submitter_name,onChange:k("submitter_name"),invalid:p.submitter_name})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{style:ev,children:"Email"}),(0,f.jsx)(tv,{type:"email",value:c.submitter_email,onChange:k("submitter_email"),invalid:p.submitter_email})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{style:ev,children:"Mobile"}),(0,f.jsx)(tv,{value:c.submitter_mobile,onChange:k("submitter_mobile"),invalid:p.submitter_mobile,placeholder:"0400 000 000"})]})]}),(0,f.jsx)("h3",{style:{margin:"0 0 14px",font:"700 18px/1 ".concat(qx),textTransform:"uppercase",color:Mx.black},children:"Project"}),(0,f.jsxs)("div",{style:{marginBottom:14},children:[(0,f.jsx)("span",{style:ev,children:"Project title"}),(0,f.jsx)(tv,{value:c.project_title,onChange:k("project_title"),invalid:p.project_title,placeholder:"World Blood Donor Day"})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit,minmax(190px,1fr))",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{style:ev,children:"Date required"}),(0,f.jsx)(tv,{type:"date",value:c.date_required,onChange:k("date_required"),invalid:p.date_required})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{style:ev,children:"Location"}),(0,f.jsx)(tv,{value:c.location,onChange:k("location"),invalid:p.location,placeholder:"Melbourne CBD"})]})]}),C&&(0,f.jsxs)("div",{style:{display:"flex",marginTop:14},children:[(0,f.jsx)("span",{style:{width:4,background:Mx.orange,flexShrink:0}}),(0,f.jsx)("p",{style:{margin:0,background:Mx.peach,padding:"12px 14px",font:"400 13.5px/1.5 ".concat(Hx),color:Mx.black},children:"Outside Melbourne \u2014 travel (flights, accommodation, ground transport) is quoted separately at cost and sent to Toney for its own purchase order."})]}),(0,f.jsx)("h3",{style:{margin:"28px 0 14px",font:"700 18px/1 ".concat(qx),textTransform:"uppercase",color:Mx.black},children:"Services"}),(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:r.map(e=>{const t=o[e.id]||0;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"12px 14px",border:"1px solid ".concat(t>0?Mx.turquoise:Mx.hairline),background:t>0?Mx.ice:Mx.white,transition:"background .3s ease, border-color .3s ease"},children:[(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{font:"700 14.5px/1.25 ".concat(Hx),color:Mx.black},children:e.label}),(0,f.jsx)("div",{style:{font:"400 12.5px/1.4 ".concat(Hx),color:Mx.burgundy,marginTop:2}
1,children:e.subtitle})]}),(0,f.jsx)("div",{style:{font:"700 15px/1 ".concat(Hx),color:Mx.black,whiteSpace:"nowrap"},children:Xy(e.price_ex_gst)}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",border:"1px solid ".concat(Mx.black)},children:[(0,f.jsx)("button",{type:"button","aria-label":"Remove one ".concat(e.label),onClick:()=>A(e.id,-1),disabled:0===t,style:{width:32,height:32,display:"grid",placeItems:"center",background:Mx.white,border:"none",borderRadius:0,cursor:0===t?"default":"pointer",opacity:0===t?.3:1},children:(0,f.jsx)(md.A,{size:14})}),(0,f.jsx)("span",{style:{width:34,textAlign:"center",font:"700 14px/1 ".concat(Hx),color:Mx.black},children:t}),(0,f.jsx)("button",{type:"button","aria-label":"Add one ".concat(e.label),onClick:()=>A(e.id,1),style:{width:32,height:32,display:"grid",placeItems:"center",background:Mx.white,border:"none",borderRadius:0,cursor:"pointer"},children:(0,f.jsx)(ls.A,{size:14})})]})]},e.id)})}),(0,f.jsx)("h3",{style:{margin:"28px 0 10px",font:"700 18px/1 ".concat(qx),textTransform:"uppercase",color:Mx.black},children:"Brief"}),(0,f.jsx)("textarea",{value:c.brief,onChange:e=>k("brief")(e.target.value),rows:5,placeholder:"What are we covering, who's involved, and what does a good result look like?",style:{width:"100%",boxSizing:"border-box",borderRadius:0,padding:"11px 12px",font:"400 15px/1.5 ".concat(Hx),color:Mx.black,background:Mx.white,border:"1px solid ".concat(Mx.black),resize:"vertical"}})]}),(0,f.jsx)("aside",{style:{background:Mx.ice,borderLeft:"1px solid ".concat(Mx.hairline),padding:"26px 24px 32px"},children:(0,f.jsxs)("div",{style:{position:"sticky",top:26},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},ev),{},{color:Mx.black}),children:"Estimate"}),(0,f.jsx)("div",{style:{font:"700 44px/1 ".concat(qx),color:Mx.black,letterSpacing:"-.01em"},children:Xy(N.total)}),(0,f.jsx)("div",{style:{font:"400 12.5px/1 ".concat(Hx),color:Mx.burgundy,marginTop:6,marginBottom:18},children:"Total inc GST"}),0===N.lines.length?(0,f.jsx)("p",{style:{margin:"0 0 18px",font:"400 13.5px/1.5 ".concat(Hx),color:Mx.burgundy},children:"Pick your services and the price builds here."}):(0,f.jsx)("div",{style:{marginBottom:16},children:N.lines.map(e=>(0,f.jsxs)("div",{style:{display:"flex",gap:10,padding:"7px 0",borderBottom:"1px solid rgba(0,0,0,.09)"},children:[(0,f.jsx)("span",{style:{flex:1,font:"400 13px/1.35 ".concat(Hx),color:Mx.black},children:e.label}),(0,f.jsxs)("span",{style:{font:"400 13px/1.35 ".concat(Hx),color:Mx.burgundy},children:["\xd7",e.qty]}),(0,f.jsx)("span",{style:{font:"700 13px/1.35 ".concat(Hx),color:Mx.black,whiteSpace:"nowrap"},children:Xy(e.amount)})]},e.id))}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",font:"400 13px/1.6 ".concat(Hx),color:Mx.black},children:[(0,f.jsx)("span",{children:"Subtotal (ex GST)"}),(0,f.jsx)("span",{children:Xy(N.sub)})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",font:"400 13px/1.6 ".concat(Hx),color:Mx.black,marginBottom:18},children:[(0,f.jsx)("span",{children:"GST 10%"}),(0,f.jsx)("span",{children:Xy(N.gst)})]}),b&&(0,f.jsx)("p",{role:"alert",style:{margin:"0 0 12px",padding:"10px 12px",background:Mx.white,borderLeft:"3px solid ".concat(Mx.red),font:"400 13px/1.45 ".concat(Hx),color:Mx.black},children:b}),(0,f.jsx)("button",{type:"submit",disabled:!E,style:{width:"100%",borderRadius:0,border:"none",cursor:E?"pointer":"default",background:E?Mx.red:"#C9C2B6",color:Mx.white,padding:"14px 16px",font:"700 15px/1 ".concat(Hx),display:"flex",alignItems:"center",justifyContent:"center",gap:9,transition:"background .3s ease"},children:h?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kr.A,{size:17,className:"lb-spin"})," Sending\u2026"]}):"Send for approval"}),(0,f.jsx)("p",{style:{margin:"10px 0 0",font:"400 12.5px/1.5 ".concat(Hx),color:Mx.burgundy},children:"Goes to Toney Wilkinson. You\u2019ll be told the moment he decides."})]})})]})]})})}const av=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:2}).format(Number(e)||0),nv=e=>{const t=(e=>{if(!e)return null;if(e instanceof Date)return isNaN(e)?null:e;let t=String(e).trim().replace(" ","T");/\d{2}:\d{2}/.test(t)&&!/[zZ]|[+-]\d{2}:?\d{2}$/.test(t)&&(t+="Z");const s=new Date(t);return isNaN(s)?null:s})(e);return t?t.toLocaleDateString("en-AU",{timeZone:"Australia/Melbourne",day:"2-digit",month:"short",year:"numeric"}):e?String(e):"\u2014"},rv={pending_lifeblood_approval:{label:"Awaiting approval",fg:"#8A4B00",bg:Mx.peach,bd:Mx.orange},accepted_lifeblood:{label:"Approved",fg:"#0D4E3C",bg:Mx.ice,bd:Mx.turquoise},declined_lifeblood:{label:"Declined",fg:Mx.red,bg:"#FDECEA",bd:Mx.red}},iv=e=>rv[e]||{label:(e||"Submitted").replace(/_/g," "),fg:"#333",bg:"#F1EDE4",bd:Mx.hairline},ov={"New Job":{fg:"#0F4C63",bg:"#E4F1F5",bd:"#8CC6D8"},"Awaiting PO":{fg:"#8A4B00",bg:Mx.peach,bd:Mx.orange},"Invoice Sent":{fg:"#0F4C63",bg:"#E4F1F5",bd:"#8CC6D8"},"Invoice Paid":{fg:"#0D4E3C",bg:Mx.ice,bd:Mx.turquoise},Declined:{fg:Mx.red,bg:"#FDECEA",bd:Mx.red}},lv={Paid:{fg:"#0D4E3C",bg:Mx.ice,bd:Mx.turquoise},Sent:{fg:"#0F4C63",bg:"#E4F1F5",bd:"#8CC6D8"},Overdue:{fg:Mx.red,bg:"#FDECEA",bd:Mx.red},Draft:{fg:"#5C554A",bg:"#F1EDE4",bd:Mx.hairline}};function cv(e){let{tone:t,children:s}=e;const a=t||{fg:"#333",bg:"#F1EDE4",bd:Mx.hairline};return(0,f.jsx)("span",{style:{display:"inline-block",borderRadius:0,padding:"4px 9px",background:a.bg,color:a.fg,border:"1px solid ".concat(a.bd),font:"700 11.5px/1.25 ".concat(Hx),whiteSpace:"nowrap"},children:s})}const dv=()=>{try{return JSON.parse(sessionStorage.getItem("turbo360_client_session")||"{}")}catch(e){return{}}};function mv(e){let{r:t,open:s,onToggle:n,canApprove:r,isApprover:i,invoices:o,onAction:l,busy:c,error:d,onClearError:p}=e;const[x,h]=(0,a.useState)(null),[u,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(null),v=(0,a.useRef)(null);(0,a.useEffect)(()=>{s||(h(null),y(null))},[s]);
1const j="pending_lifeblood_approval"===t.status,w="accepted_lifeblood"===t.status,N="declined_lifeblood"===t.status,A=r&&j,k=(o||[]).find(e=>e.invoice_number&&e.invoice_number===t.invoice_number),S=A?"Your decision":w?"Approved":!i&&j?"With Toney":iv(t.status).label,_=!i&&j?"Toney Wilkinson has it. Nothing is booked and nothing is billed until he approves \u2014 we\u2019ll email you either way.":A?"Approving raises a draft invoice, books the crew and lets Turbo start planning. Declining closes the request and tells ".concat((t.submitter_name||"the submitter").split(" ")[0]," why."):N?"This request was closed. Contact Toney Wilkinson if you need it reconsidered.":"Awaiting PO"===t.fulfillment_status?"Turbo is holding the invoice until a purchase order is raised for this reference.":"Invoice Sent"===t.fulfillment_status?"The tax invoice has been sent to AP.":"Invoice Paid"===t.fulfillment_status?"Paid in full. Nothing outstanding on this job.":"Turbo has been notified and the job is in the schedule.",C={padding:"15px 14px",font:"400 14px/1.4 ".concat(Hx),color:Mx.black,verticalAlign:"middle"};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("tr",{ref:v,onClick:()=>{p(),n()},style:{cursor:"pointer",background:s?"#FFF6E3":Mx.white,borderTop:"1px solid ".concat(Mx.divider),transition:"background .3s ease"},children:[(0,f.jsx)("td",{style:(0,m.A)((0,m.A)({},C),{},{font:"700 14px/1.2 ".concat(Hx),whiteSpace:"nowrap"}),children:(0,f.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:7},children:[s?(0,f.jsx)(Et.A,{size:14,color:Mx.red}):(0,f.jsx)(rs.A,{size:14,color:Mx.red}),t.ref_code||"\u2014"]})}),(0,f.jsxs)("td",{style:C,children:[(0,f.jsx)("div",{style:{font:"700 14.5px/1.3 ".concat(Hx)},children:t.project_title||"(Untitled project)"}),(0,f.jsxs)("div",{style:{font:"400 12.5px/1.4 ".concat(Hx),color:Mx.burgundy,marginTop:2},children:[nv(t.date_required),t.location?" \xb7 ".concat(t.location):""]})]}),(0,f.jsxs)("td",{style:C,children:[(0,f.jsx)("div",{children:t.submitter_name||"\u2014"}),(0,f.jsx)("div",{style:{font:"400 12.5px/1.4 ".concat(Hx),color:Mx.burgundy,marginTop:2},children:nv(t.created_at)})]}),(0,f.jsx)("td",{style:(0,m.A)((0,m.A)({},C),{},{textAlign:"right",font:"700 16px/1.2 ".concat(qx),whiteSpace:"nowrap"}),children:av(t.total_inc_gst)}),(0,f.jsxs)("td",{style:(0,m.A)((0,m.A)({},C),{},{whiteSpace:"nowrap"}),children:[(0,f.jsx)(cv,{tone:iv(t.status),children:iv(t.status).label}),t.fulfillment_status&&!j&&!N&&(0,f.jsx)("span",{style:{display:"block",marginTop:6},children:(0,f.jsx)(cv,{tone:ov[t.fulfillment_status],children:t.fulfillment_status})})]})]}),s&&(0,f.jsx)("tr",{style:{background:"#FFF6E3"},children:(0,f.jsx)("td",{colSpan:5,style:{padding:"0 14px 22px"},children:(0,f.jsxs)("div",{className:"lb-jobdetail",style:{display:"grid",gridTemplateColumns:"minmax(0,1fr) 320px",gap:24,alignItems:"start"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{style:{display:"block",font:"700 11px/1 ".concat(Hx),letterSpacing:".14em",textTransform:"uppercase",color:Mx.burgundy,marginBottom:10},children:"Services requested"}),(0,f.jsx)("table",{style:{width:"100%",borderCollapse:"collapse"},children:(0,f.jsxs)("tbody",{children:[(t.line_breakdown||[]).map((e,t)=>(0,f.jsxs)("tr",{style:{borderBottom:"1px solid ".concat(Mx.hairline)},children:[(0,f.jsx)("td",{style:{padding:"9px 0",font:"400 14px/1.4 ".concat(Hx),color:Mx.black},children:e.label}),(0,f.jsx)("td",{style:{padding:"9px 8px",textAlign:"center",font:"400 14px/1.4 ".concat(Hx),color:Mx.burgundy,width:50},children:e.qty}),(0,f.jsx)("td",{style:{padding:"9px 0",textAlign:"right",font:"700 15px/1.4 ".concat(qx),color:Mx.black,width:110},children:av(e.line_total_ex_gst)})]},t)),0===(t.line_breakdown||[]).length&&(0,f.jsx)("tr",{children:(0,f.jsx)("td",{style:{padding:"9px 0",font:"400 14px/1.4 ".concat(Hx),color:Mx.burgundy},children:"No line items recorded."})})]})}),(0,f.jsxs)("div",{style:{marginTop:10},children:[[["Subtotal (ex GST)",t.subtotal_ex_gst],["GST 10%",t.gst]].map(e=>{let[t,s]=e;return(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",font:"400 13.5px/1.7 ".concat(Hx),color:Mx.black},children:[(0,f.jsx)("span",{children:t}),(0,f.jsx)("span",{children:av(s)})]},t)}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",borderTop:"1px solid ".concat(Mx.black),marginTop:6,paddingTop:8},children:[(0,f.jsx)("span",{style:{font:"700 14px/1.2 ".concat(Hx),color:Mx.black},children:"Total (inc GST)"}
1),(0,f.jsx)("span",{style:{font:"700 26px/1 ".concat(qx),color:Mx.red},children:av(t.total_inc_gst)})]})]}),t.location&&(F=t.location,!/melbourne/i.test(F||""))&&(0,f.jsxs)("div",{style:{display:"flex",marginTop:16},children:[(0,f.jsx)("span",{style:{width:4,background:Mx.orange,flexShrink:0}}),(0,f.jsx)("p",{style:{margin:0,background:Mx.peach,padding:"12px 14px",font:"400 13.5px/1.5 ".concat(Hx),color:Mx.black},children:"Outside Melbourne \u2014 travel (flights, accommodation, ground transport) is quoted separately at cost and sent to you for its own purchase order."})]})]}),(0,f.jsxs)("aside",{style:{background:Mx.white,border:"1px solid ".concat(Mx.hairline),padding:18},children:[(0,f.jsx)("div",{style:{font:"700 17px/1.15 ".concat(qx),textTransform:"uppercase",color:Mx.black,marginBottom:8},children:S}),(0,f.jsx)("p",{style:{margin:"0 0 16px",font:"400 13.5px/1.55 ".concat(Hx),color:Mx.burgundy},children:_}),d&&(0,f.jsx)("p",{role:"alert",style:{margin:"0 0 12px",padding:"10px 12px",background:"#FDECEA",borderLeft:"3px solid ".concat(Mx.red),font:"400 13px/1.45 ".concat(Hx),color:Mx.black},children:d}),A&&"accept"===x&&(0,f.jsxs)("div",{style:{marginBottom:12},children:[(0,f.jsx)("p",{style:{margin:"0 0 10px",padding:"11px 13px",background:"#FDECEA",borderLeft:"3px solid ".concat(Mx.red),font:"400 13px/1.5 ".concat(Hx),color:Mx.black},children:"Approving raises the invoice and books the crew. This can\u2019t be undone from the portal."}),(0,f.jsx)("button",{type:"button",disabled:c,onClick:()=>l(t.id,"accept"),style:{width:"100%",marginBottom:8,borderRadius:0,border:"none",cursor:"pointer",background:Mx.red,color:Mx.white,padding:"12px 14px",font:"700 14px/1 ".concat(Hx),display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:c?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kr.A,{size:15,className:"lb-spin"})," Approving\u2026"]}):"Yes, approve ".concat(t.ref_code||"")}),(0,f.jsx)("button",{type:"button",onClick:()=>h(null),style:{width:"100%",borderRadius:0,cursor:"pointer",background:Mx.white,color:Mx.black,border:"1px solid ".concat(Mx.black),padding:"11px 14px",font:"700 14px/1 ".concat(Hx)},children:"Not yet"})]}),A&&"decline"===x&&(0,f.jsxs)("div",{style:{marginBottom:12},children:[(0,f.jsxs)("p",{style:{margin:"0 0 10px",padding:"11px 13px",background:"#FDECEA",borderLeft:"3px solid ".concat(Mx.red),font:"400 13px/1.5 ".concat(Hx),color:Mx.black},children:["Declining closes the request and emails ",(t.submitter_name||"the submitter").split(" ")[0],"."]}),(0,f.jsx)("button",{type:"button",disabled:c,onClick:()=>l(t.id,"decline"),style:{width:"100%",marginBottom:8,borderRadius:0,border:"none",cursor:"pointer",background:Mx.red,color:Mx.white,padding:"12px 14px",font:"700 14px/1 ".concat(Hx),display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:c?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kr.A,{size:15,className:"lb-spin"})," Declining\u2026"]}):"Yes, decline ".concat(t.ref_code||"")}),(0,f.jsx)("button",{type:"button",onClick:()=>h(null),style:{width:"100%",borderRadius:0,cursor:"pointer",background:Mx.white,color:Mx.black,border:"1px solid ".concat(Mx.black),padding:"11px 14px",font:"700 14px/1 ".concat(Hx)},children:"Not yet"})]}),A&&!x&&(0,f.jsxs)("div",{style:{marginBottom:12},children:[(0,f.jsx)("button",{type:"button",onClick:()=>h("accept"),onMouseEnter:e=>{e.currentTarget.style.background=Mx.burgundy},onMouseLeave:e=>{e.currentTarget.style.background=Mx.red},style:{width:"100%",marginBottom:8,borderRadius:0,border:"none",cursor:"pointer",background:Mx.red,color:Mx.white,padding:"13px 14px",font:"700 15px/1 ".concat(Hx),transition:"background .3s ease"},children:"Approve this request"}),(0,f.jsx)("button",{type:"button",onClick:()=>h("decline"),style:{width:"100%",borderRadius:0,cursor:"pointer",background:Mx.white,color:Mx.red,border:"1px solid ".concat(Mx.red),padding:"12px 14px",font:"700 15px/1 ".concat(Hx)},children:"Decline"})]}),k&&(0,f.jsxs)("a",{href:"/invoice/".concat(k.id),target:"_blank",rel:"noreferrer",style:{display:"flex",alignItems:"center",gap:8,font:"700 13.5px/1.4 ".concat(Hx),color:Mx.red,textDecoration:"underline",marginBottom:10},children:[(0,f.jsx)(En.A,{size:14})," View invoice ",k.invoice_number]}),(0,f.jsxs)("button",{type:"button",onClick:()=>{g(!0),y(null),async function(e){const{token:t}=dv(),s=await fetch("".concat(I.fn,"/api/lifeblood/job-requests/").concat(e.id,"/pdf"),{headers:{Authorization:"Bearer ".concat(t)}});if(!s.ok)throw new Error("Could not build the PDF. Please try again.");const a=await s.blob(),n=URL.createObjectURL(a),r=document.createElement("a");r.href=n,r.download="Turbo360-Proposal-".concat(e.ref_code||e.id,".pdf"),document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(n),4e3)}
1(t).catch(e=>y(e.message)).finally(()=>g(!1))},disabled:u,style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",padding:0,cursor:"pointer",font:"700 13.5px/1.4 ".concat(Hx),color:Mx.red,textDecoration:"underline"},children:[u?(0,f.jsx)(Kr.A,{size:14,className:"lb-spin"}):(0,f.jsx)($d.A,{size:14}),u?"Building PDF\u2026":"Quotation PDF"]}),b&&(0,f.jsx)("p",{role:"alert",style:{margin:"10px 0 0",font:"400 12.5px/1.45 ".concat(Hx),color:Mx.red},children:b})]})]})})})]});var F}function pv(e){let{client:t,invoices:s=[],jobRequests:n=[],galleries:r,videoProjects:i,clientId:o,isAdminView:l,isLifebloodApprover:c=!1,onRefresh:d,onSignOut:p,onReturnToAdmin:x}=e;const h=c&&!l,u=(0,a.useMemo)(()=>(n||[]).filter(e=>"converted"!==e.status&&"closed"!==e.status).sort((e,t)=>new Date(t.created_at||0)-new Date(e.created_at||0)),[n]),g=u.filter(e=>"pending_lifeblood_approval"===e.status).length,b=u.filter(e=>"Awaiting PO"===e.fulfillment_status).length,y=(s||[]).filter(e=>"Paid"!==e.status&&"Draft"!==e.status),v=(0,a.useMemo)(()=>{const e=[];for(const i of r||[])e.push({key:"g-".concat(i.id),kind:"gallery",title:i.name||"Gallery",meta:"".concat(i.photo_count||0," photos").concat(i.event_date?" \xb7 ".concat(nv(i.event_date)):""),status:"Gallery ready",tone:lv.Paid,cta:"Open gallery",href:i.share_url||i.simple_share_url,image:i.featured_photo_thumbnail});for(const r of i||[])for(const i of r.assets||[]){var t,s,a,n;const o=null===(t=i.versions)||void 0===t||null===(s=t[0])||void 0===s||null===(a=s.shareLinks)||void 0===a||null===(n=a[0])||void 0===n?void 0:n.url,l=(i.latestVersionStatus||"").replace(/_/g," ");e.push({key:"v-".concat(i._id||i.name),kind:"video",title:i.name||"Video",meta:"".concat(r.name||"Project"," \xb7 version ").concat(i.currentVersion||1),status:l||"In progress",tone:/approved/i.test(l)?lv.Paid:/change/i.test(l)?ov["Awaiting PO"]:ov["Invoice Sent"],cta:o?"Watch and review":"Review link coming soon",href:o,image:i.thumbnailUrl})}return e},[r,i]),[j,w]=(0,a.useState)("jobs"),[N,A]=(0,a.useState)(null),[k,S]=(0,a.useState)(null),[_,C]=(0,a.useState)(null),[F,E]=(0,a.useState)(!1),T=(0,a.useRef)(null);(0,a.useEffect)(()=>{const e=new URLSearchParams(window.location.search).get("show");e&&(w("jobs"),A(e),window.history.replaceState({},"",window.location.pathname))},[]);const z=(0,a.useCallback)(async(e,t)=>{S(e),C(null);try{await async function(e,t){const{token:s}=dv(),a=await fetch("".concat(I.fn,"/api/client-portal/lifeblood-requests/").concat(e,"/").concat(t),{method:"POST",headers:{Authorization:"Bearer ".concat(s)}});if(!a.ok){const e=await a.json().catch(()=>({})),t=new Error(e.detail||"Action failed \u2014 please try again");throw t.status=a.status,t}return a.json()}(e,t),A(null),d&&await d()}catch(s){if(401===s.status&&p)return void p();C(s.message),409===s.status&&d&&await d()}finally{S(null)}},[d,p]),B=dv(),D=(B.name||(null===t||void 0===t?void 0:t.contact_name)||(null===t||void 0===t?void 0:t.company_name)||"").split(" ")[0],R=D?"Welcome back, ".concat(D):"Welcome back",P=c?[1===g?"One request is waiting on your approval.":g>1?"".concat(g," requests are waiting on your approval."):"Nothing is waiting on your approval.",1===b?"One job is waiting on a purchase order before Turbo can invoice it.":b>1?"".concat(b," jobs are waiting on a purchase order before Turbo can invoice them."):""].filter(Boolean).join(" "):g>0?"Your request is with Toney for approval. Everything else is moving.":"Everything is moving. Raise a new request whenever you need us.",W=c?"Every Lifeblood request, company-wide \u2014 you see them all as the approver.":"The requests you\u2019ve raised. Toney approves them before Turbo starts.",O=[{id:"jobs",label:"Job requests",count:u.length},...c?[{id:"invoices",label:"Invoices",count:y.length}]:[],{id:"deliverables",label:"Deliverables",count:v.length},{id:"lowerthirds",label:"Lower thirds"},{id:"tasks",label:"Tasks"}],L={padding:"11px 14px",textAlign:"left",font:"700 11px/1 ".concat(Hx),letterSpacing:".13em",textTransform:"uppercase",color:Mx.black,borderBottom:"1px solid ".concat(Mx.black),whiteSpace:"nowrap"},M=(e,t)=>(0,f.jsxs)("div",{style:{marginBottom:16},children:[(0,f.jsx)("h2",{style:{margin:0,font:"700 28px/1 ".concat(qx),textTransform:"uppercase",color:Mx.black},children:e}),t&&(0,f.jsx)("p",{style:{margin:"6px 0 0",font:"400 14px/1.5 ".concat(Hx),color:Mx.burgundy},children:t})]});return(0,f.jsxs)("div",{style:{minHeight:"100vh",background:Mx.taupe,fontFamily:Hx,color:Mx.black},children:[(0,f.jsx)("style",{children:"\n ".concat(Ux,"\n .lb-spin { animation: lb-spin 1s linear infinite; }
1\n @keyframes lb-spin { to { transform: rotate(360deg); } }\n @media (max-width: 1023px) {\n .lb-jobdetail { grid-template-columns: minmax(0,1fr) !important; }\n .lb-lt-grid { grid-template-columns: minmax(0,1fr) !important; }\n .lb-njm-grid { grid-template-columns: minmax(0,1fr) !important; }\n }\n @media (max-width: 820px) {\n .lb-hide-sm { display: none !important; }\n }\n ")}),l&&(0,f.jsxs)("div",{style:{background:Mx.black,color:Mx.white,padding:"10px 20px",display:"flex",alignItems:"center",justifyContent:"space-between",gap:14,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:{font:"700 12.5px/1.3 ".concat(Hx)},children:"Admin preview \u2014 approve and decline are hidden so nothing fires on the client\u2019s behalf."}),x&&(0,f.jsxs)("button",{type:"button",onClick:x,style:{display:"flex",alignItems:"center",gap:7,background:"transparent",color:Mx.white,border:"1px solid ".concat(Mx.white),borderRadius:0,padding:"6px 12px",font:"700 12.5px/1 ".concat(Hx),cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{size:13})," Back to admin"]})]}),(0,f.jsx)("header",{style:{background:Mx.white,borderBottom:"4px solid ".concat(Mx.red)},children:(0,f.jsxs)("div",{style:{maxWidth:1180,margin:"0 auto",padding:"16px 32px",display:"flex",alignItems:"center",gap:20},children:[(0,f.jsx)("img",{src:"/lifeblood/lifeblood-logo.svg",alt:"Australian Red Cross Lifeblood",style:{height:44,width:"auto",display:"block"}}),(0,f.jsx)("span",{className:"lb-hide-sm",style:{font:"700 11px/1 ".concat(Hx),letterSpacing:".18em",textTransform:"uppercase",color:Mx.burgundy},children:"Client portal"}),(0,f.jsx)("div",{style:{flex:1}}),(0,f.jsxs)("div",{className:"lb-hide-sm",style:{textAlign:"right",lineHeight:1.3},children:[(0,f.jsx)("div",{style:{font:"700 13.5px/1.3 ".concat(Hx),color:Mx.black},children:B.name||(null===t||void 0===t?void 0:t.contact_name)||(null===t||void 0===t?void 0:t.company_name)}),(0,f.jsx)("div",{style:{font:"400 12px/1.3 ".concat(Hx),color:Mx.burgundy},children:c?"Approver":"Lifeblood staff"})]}),(0,f.jsxs)("button",{type:"button",onClick:p,style:{display:"flex",alignItems:"center",gap:7,background:Mx.white,color:Mx.black,border:"1px solid ".concat(Mx.black),borderRadius:0,padding:"8px 13px",font:"700 13px/1 ".concat(Hx),cursor:"pointer"},children:[(0,f.jsx)(is.A,{size:14})," Sign out"]})]})}),(0,f.jsxs)("section",{style:{position:"relative",overflow:"hidden"},children:[(0,f.jsx)("div",{style:{position:"absolute",inset:0,backgroundImage:"url(/lifeblood/lab-bench.jpg)",backgroundSize:"cover",backgroundPosition:"center"}}),(0,f.jsx)("div",{style:{position:"absolute",inset:0,background:"rgba(0,0,0,.55)"}}),(0,f.jsxs)("div",{style:{position:"relative",maxWidth:1180,margin:"0 auto",padding:"52px 32px 46px"},children:[(0,f.jsx)("span",{style:{font:"700 11px/1 ".concat(Hx),letterSpacing:".2em",textTransform:"uppercase",color:"rgba(255,255,255,.85)"},children:"Lifeblood \xd7 Turbo 360"}),(0,f.jsx)("h1",{style:{margin:"12px 0 10px",font:"700 56px/1 ".concat(qx),textTransform:"uppercase",color:Mx.white,letterSpacing:"-.005em"},children:R}),(0,f.jsx)("p",{style:{margin:"0 0 24px",maxWidth:640,font:"400 16px/1.6 ".concat(Hx),color:"rgba(255,255,255,.92)"},children:P}),(0,f.jsxs)("button",{type:"button",onClick:()=>E(!0),onMouseEnter:e=>{e.currentTarget.style.background=Mx.burgundy},onMouseLeave:e=>{e.currentTarget.style.background=Mx.red},style:{display:"inline-flex",alignItems:"center",gap:9,background:Mx.red,color:Mx.white,border:"none",borderRadius:0,padding:"14px 22px",font:"700 15px/1 ".concat(Hx),cursor:"pointer",transition:"background .3s ease"},children:[(0,f.jsx)(ls.A,{size:17})," New job request"]})]})]}),h&&g>0&&(0,f.jsx)("div",{style:{background:Mx.red,color:Mx.white},children:(0,f.jsxs)("div",{style:{maxWidth:1180,margin:"0 auto",padding:"16px 32px",display:"flex",alignItems:"center",gap:14,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:Gx(Mx.white,26)}),(0,f.jsx)("span",{style:{font:"700 15px/1.3 ".concat(Hx)},children:1===g?"1 job request is waiting on your approval":"".concat(g," job requests are waiting on your approval")}),(0,f.jsx)("span",{style:{font:"400 14px/1.3 ".concat(Hx),color:"rgba(255,255,255,.88)"},children:"Nothing starts until you approve it."}),(0,f.jsx)("div",{style:{flex:1}}),(0,f.jsx)("button",{type:"button",onClick:()=>{const e=u.find(e=>"pending_lifeblood_approval"===e.status);w("jobs"),A((null===e||void 0===e?void 0:e.ref_code)||null),setTimeout(()=>{var e;return null===(e=T.current)||void 0===e?void 0:e.scrollIntoView({behavior:"smooth",block:"start"})},60)},style:{background:Mx.white,color:Mx.red,border:"none",borderRadius:0,padding:"10px 18px",font:"700 14px/1 ".concat(Hx),cursor:"pointer"},children:"Review it"})]})}),(0,f.jsx)("div",{style:{position:"sticky",top:0,zIndex:20,background:Mx.white,borderBottom:"1px solid ".concat(Mx.hairline)},children:(0,f.jsx)("div",{style:{maxWidth:1180,margin:"0 auto",padding:"0 32px",display:"flex",gap:4,overflowX:"auto"},children:O.map(e=>{const t=j===e.id;return(0,f.jsxs)("button",{type:"button",onClick:()=>w(e.id),style:{display:"flex",alignItems:"center",gap:8,background:"none",border:"none",borderBottom:"3px solid ".concat(t?Mx.red:"transparent"),borderRadius:0,padding:"15px 14px",cursor:"pointer",whiteSpace:"nowrap",font:"700 14px/1 ".concat(Hx),color:t?Mx.black:Mx.burgundy,transition:"color .3s ease, border-color .3s ease"},children:[e.label,void 0!==e.count&&e.count>0&&(0,f.jsx)("span",{style:{display:"inline-block",minWidth:20,textAlign:"center",padding:"2px 6px",background:t?Mx.red:Mx.hairline,color:t?Mx.white:Mx.black,font:"700 11px/1.3 ".concat(Hx)},children:e.count})]},e.id)})})}),(0,f.jsxs)("main",{style:{maxWidth:1180,margin:"0 auto",padding:"32px 32px 72px"},children:["jobs"===j&&(0,f.jsxs)("div",{ref:T,children:[M("Job requests",W),(0,f.jsx)("div",{style:{background:Mx.white,border:"1px solid ".concat(Mx.hairline),overflowX:"auto"},children:(0,f.jsxs)("table",{style:{width:"100%",minWidth:760,borderCollapse:"collapse"},children:[(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},L),{},{width:110}),children:"Ref"}),(0,f.jsx)("th",{style:L,children:"Project"}),(0,f.jsx)("th",{style:L,children:"Raised by"}),(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},L),{},{textAlign:"right",width:120}),children:"Total"}),(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},L),{},{width:190}),children:"Status"})]})}),(0,f.jsxs)("tbody",{children:[u.map(e=>(0,f.jsx)(mv,{r:e,open:N===e.ref_code,onToggle:()=>A(N===e.ref_code?null:e.ref_code),canApprove:h,isApprover:c,invoices:s,onAction:z,busy:k===e.id,error:N===e.ref_code?_:null,onClearError:()=>C(null)},e.id)),0===u.length&&(0,f.jsx)("tr",{children:(0,f.jsxs)("td",{colSpan:5,style:{padding:"38px 14px",textAlign:"center",font:"400 14px/1.5 ".concat(Hx),color:Mx.burgundy},children:["No job requests yet. Use ",(0,f.jsx)("strong",{children:"New job request"})," above to raise one."]})})]})]})})]}),"invoices"===j&&c&&(0,f.jsxs)("div",{children:[M("Invoices","Turbo holds an invoice as a draft until its purchase order lands."),(0,f.jsx)("div",{style:{background:Mx.white,border:"1px solid ".concat(Mx.hairline),overflowX:"auto"},children:(0,f.jsxs)("table",{style:{width:"100%",minWidth:760,borderCollapse:"collapse"},children:[(0,f.jsx)("thead",{children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},L),{},{width:120}),children:"Invoice"}),(0,f.jsx)("th",{style:L,children:"Project"}),(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},L),{},{width:130}),children:"Due"}),(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},L),{},{textAlign:"right",width:120}),children:"Amount"}),(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},L),{},{width:150}),children:"PO number"}),(0,f.jsx)("th",{style:(0,m.A)((0,m.A)({},L),{},{width:150}),children:"Status"})]})}),(0,f.jsxs)("tbody",{children:[(s||[]).map(e=>{var t;const s={padding:"15px 14px",font:"400 14px/1.4 ".concat(Hx),color:Mx.black,borderTop:"1px solid ".concat(Mx.divider)},a="Sent"===e.status||"Paid"===e.status||"Overdue"===e.status;return(0,f.jsxs)("tr",{children:[(0,f.jsx)("td",{style:(0,m.A)((0,m.A)({},s),{},{font:"700 14px/1.2 ".concat(Hx),whiteSpace:"nowrap"}),children:e.invoice_number}),(0,f.jsxs)("td",{style:s,children:[(0,f.jsx)("div",{style:{font:"700 14px/1.3 ".concat(Hx)},children:e.project_title||e.description||"\u2014"}),e.lifeblood_ref&&(0,f.jsx)("div",{style:{font:"400 12.5px/1.4 ".concat(Hx),color:Mx.burgundy,marginTop:2},children:e.lifeblood_ref})]}),(0,f.jsx)("td",{style:(0,m.A)((0,m.A)({},s),{},{whiteSpace:"nowrap"}),children:nv(e.due_date)}),(0,f.jsx)("td",{style:(0,m.A)((0,m.A)({},s),{},{textAlign:"right",font:"700 16px/1.2 ".concat(qx),whiteSpace:"nowrap"}),children:av(null!==(t=e.total)&&void 0!==t?t:e.amount_due)}),(0,f.jsx)("td",{style:(0,m.A)((0,m.A)({},s),{},{whiteSpace:"nowrap"}),children:e.po_number?(0,f.jsx)("span",{style:{font:"700 13.5px/1.3 ".concat(Hx)},children:e.po_number}):(0,f.jsx)("span",{style:{font:"400 13px/1.3 ".concat(Hx),color:Mx.red}
1,children:"Not yet raised"})}),(0,f.jsxs)("td",{style:s,children:[(0,f.jsx)(cv,{tone:lv[e.status],children:e.status}),a&&(0,f.jsx)("a",{href:"/invoice/".concat(e.id),target:"_blank",rel:"noreferrer",style:{display:"block",marginTop:6,font:"700 12.5px/1.3 ".concat(Hx),color:Mx.red,textDecoration:"underline"},children:"View invoice"})]})]},e.id)}),0===(s||[]).length&&(0,f.jsx)("tr",{children:(0,f.jsx)("td",{colSpan:6,style:{padding:"38px 14px",textAlign:"center",font:"400 14px/1.5 ".concat(Hx),color:Mx.burgundy},children:"No invoices yet."})})]})]})})]}),"deliverables"===j&&(0,f.jsxs)("div",{children:[M("Deliverables","Cuts to review and finished galleries."),0===v.length?(0,f.jsx)("div",{style:{background:Mx.white,border:"1px solid ".concat(Mx.hairline),padding:"38px 20px",textAlign:"center",font:"400 14px/1.5 ".concat(Hx),color:Mx.burgundy},children:"Nothing delivered yet. Galleries and cuts appear here as soon as they\u2019re ready."}):(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(280px,1fr))",gap:20},children:v.map(e=>(0,f.jsxs)("div",{style:{background:Mx.white,border:"1px solid ".concat(Mx.hairline)},children:[(0,f.jsx)("div",{style:{height:150,background:"#EFE9DE",position:"relative",overflow:"hidden"},children:e.image?(0,f.jsx)("img",{src:e.image,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):(0,f.jsx)("div",{style:{width:"100%",height:"100%",display:"grid",placeItems:"center"},children:"gallery"===e.kind?(0,f.jsx)(Ue.A,{size:30,color:Mx.burgundy}):(0,f.jsx)(ji.A,{size:30,color:Mx.burgundy})})}),(0,f.jsxs)("div",{style:{padding:16},children:[(0,f.jsx)(cv,{tone:e.tone,children:e.status}),(0,f.jsx)("div",{style:{margin:"10px 0 4px",font:"700 17px/1.2 ".concat(qx),textTransform:"uppercase",color:Mx.black},children:e.title}),(0,f.jsx)("div",{style:{font:"400 13px/1.45 ".concat(Hx),color:Mx.burgundy,marginBottom:12},children:e.meta}),e.href?(0,f.jsx)("a",{href:e.href,target:"_blank",rel:"noreferrer",style:{font:"700 13.5px/1.3 ".concat(Hx),color:Mx.red,textDecoration:"underline"},children:e.cta}):(0,f.jsx)("span",{style:{font:"400 13px/1.3 ".concat(Hx),color:Mx.burgundy},children:e.cta})]})]},e.key))})]}),"lowerthirds"===j&&(0,f.jsxs)("div",{children:[M("Lower thirds","Broadcast name bands, exported as transparent 1920\xd71080 PNGs."),(0,f.jsx)($y,{})]}),"tasks"===j&&(0,f.jsxs)("div",{children:[M("Tasks","What Turbo needs from you."),(0,f.jsx)(Ey,{clientId:o,onTasksLoaded:()=>{}})]})]}),(0,f.jsx)("footer",{style:{borderTop:"1px solid ".concat(Mx.hairline),background:Mx.white},children:(0,f.jsxs)("div",{style:{maxWidth:1180,margin:"0 auto",padding:"20px 32px",display:"flex",alignItems:"center",gap:14,flexWrap:"wrap"},children:[(0,f.jsx)("span",{style:Gx(Mx.red,16)}),(0,f.jsx)("span",{style:{font:"400 13px/1.4 ".concat(Hx),color:Mx.burgundy},children:"Production services by Turbo Productions \xb7 1300 207 446"})]})}),F&&(0,f.jsx)(sv,{session:{token:B.token,name:B.name||(null===t||void 0===t?void 0:t.contact_name)||"",email:B.email||(null===t||void 0===t?void 0:t.email)||"",mobile:(null===t||void 0===t?void 0:t.phone)||""},onClose:()=>E(!1),onSubmitted:async e=>{E(!1),w("jobs"),d&&await d(),e&&A(e)}})]})}const xv=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)(null),[n,i]=(0,a.useState)(!0),[o,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)("tasks"),[m,x]=(0,a.useState)(!1),[u,g]=(0,a.useState)(!1),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)(null),[w,N]=(0,a.useState)(0);(0,a.useEffect)(()=>{const t=sessionStorage.getItem("turbo360_client_session");if(!t)return void e("/client-login");const s=JSON.parse(t);l(s.is_admin_impersonation||!1),A()},[e]);const A=async()=>{try{const t=JSON.parse(sessionStorage.getItem("turbo360_client_session")),a=await fetch("".concat(I.fn,"/api/client-portal/dashboard"),{headers:{Authorization:"Bearer ".concat(t.token)}});if(a.ok){const e=await a.json();s(e);const t=e.client.parent_company_id||e.client.id;k(t),F(t)}else 401===a.status&&(sessionStorage.removeItem("turbo360_client_session"),e("/client-login"))}catch(t){console.error("Error loading dashboard:",t)}finally{i(!1)}},k=async e=>{try{const s=await fetch("".concat("https://iq.turbo.net.au/api/external","/cl
1ients/").concat(e),{headers:{"x-api-key":"tiq_7f3a9b2e1d5c8f4a6e0b3d7c9a2f5e8b1d4c7a0e3b6f9d2c5a8e1b4d7f0a3c","Content-Type":"application/json"}});if(s.ok){var t;const e=(null===(t=(await s.json()).client)||void 0===t?void 0:t.galleries)||[];y(e.filter(e=>e.share_url||e.simple_share_url))}else y([])}catch(s){console.error("Error loading galleries:",s),y([])}},F=async e=>{try{const s=await fetch("".concat("https://reviews.turbo.net.au/api/external","/clients/").concat(e),{headers:{"x-api-key":"trv_44b1b9c9d4b0e0a5d335a28d8ce53e85f59aa960f69bad1f5595ee3c35866298","Content-Type":"application/json"}});if(s.ok){var t;const e=(null===(t=(await s.json()).client)||void 0===t?void 0:t.projects)||[];j(e.filter(e=>{var t;return(null===(t=e.assets)||void 0===t?void 0:t.length)>0}))}else j([])}catch(s){console.error("Error loading video projects:",s),j([])}},E=()=>{sessionStorage.removeItem("turbo360_client_session"),e("/client-login")},T=()=>{sessionStorage.removeItem("turbo360_client_session"),e("/admin/clients")},z=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD"}).format(e||0),B=e=>{if(!e)return"N/A";const t=new Date(e),s=t.getDate().toString().padStart(2,"0"),a=t.toLocaleDateString("en-AU",{month:"short"}),n=t.getFullYear();return"".concat(s," ").concat(a," ").concat(n)},D=e=>{const t={new:{bg:"bg-blue-50",text:"text-blue-700",border:"border-blue-200",label:"New"},contacted:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-200",label:"In Progress"},proposal_sent:{bg:"bg-purple-50",text:"text-purple-700",border:"border-purple-200",label:"Proposal Sent"},pending_lifeblood_approval:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-200",label:"Awaiting Toney's approval"},accepted_lifeblood:{bg:"bg-green-50",text:"text-green-700",border:"border-green-200",label:"Approved"},declined_lifeblood:{bg:"bg-red-50",text:"text-red-700",border:"border-red-200",label:"Declined"}}[e]||{bg:"bg-slate-50",text:"text-slate-700",border:"border-slate-200",label:e};return(0,f.jsx)("span",{className:"px-2.5 py-1 rounded-full text-xs font-semibold ".concat(t.bg," ").concat(t.text," border ").concat(t.border),children:t.label})},R=e=>{const t={Sent:{bg:"bg-blue-50",text:"text-blue-700",border:"border-blue-200"},Viewed:{bg:"bg-amber-50",text:"text-amber-700",border:"border-amber-200"},Accepted:{bg:"bg-green-50",text:"text-green-700",border:"border-green-200"},Expired:{bg:"bg-red-50",text:"text-red-700",border:"border-red-200"}}[e]||{bg:"bg-slate-50",text:"text-slate-700",border:"border-slate-200"};return(0,f.jsx)("span",{className:"px-2.5 py-1 rounded-full text-xs font-semibold ".concat(t.bg," ").concat(t.text," border ").concat(t.border),children:e})},P=e=>{const t={Sent:{bg:"bg-blue-50",text:"text-blue-700",border:"border-blue-200"},Paid:{bg:"bg-green-50",text:"text-green-700",border:"border-green-200"},Overdue:{bg:"bg-red-50",text:"text-red-700",border:"border-red-200"},Draft:{bg:"bg-slate-50",text:"text-slate-700",border:"border-slate-200"}}[e]||{bg:"bg-slate-50",text:"text-slate-700",border:"border-slate-200"};return(0,f.jsx)("span",{className:"px-2.5 py-1 rounded-full text-xs font-semibold ".concat(t.bg," ").concat(t.text," border ").concat(t.border),children:e})},W=e=>{switch(null===e||void 0===e?void 0:e.toLowerCase()){case"approved":return"bg-green-50 text-green-700 border-green-200";
1case"pending":return"bg-amber-50 text-amber-700 border-amber-200";case"changes_requested":return"bg-orange-50 text-orange-700 border-orange-200";case"editing_in_progress":return"bg-blue-50 text-blue-700 border-blue-200";default:return"bg-slate-50 text-slate-700 border-slate-200"}};if(n)return(0,f.jsx)("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-teal-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-slate-600 font-medium",children:"Loading your dashboard..."})]})});if(!t)return null;const{client:O,proposals:L,invoices:M,job_requests:q,corporate_events:H}=t,U=(q||[]).filter(e=>"converted"!==e.status&&"closed"!==e.status),G=H||[];if(Jg(O))return(0,f.jsx)(pv,{client:O,proposals:L,invoices:M,jobRequests:q,corporateEvents:H,galleries:b,videoProjects:v,taskCount:w,clientId:O.parent_company_id||O.id,isAdminView:o,isLifebloodApprover:!0===t.is_lifeblood_approver,onRefresh:A,onSignOut:E,onReturnToAdmin:T,onNewJob:()=>e("/client-portal/new-job")});const V=M.filter(e=>"Paid"!==e.status&&"Draft"!==e.status),J=L.filter(e=>"Accepted"!==e.status&&"Expired"!==e.status),Y=V.reduce((e,t)=>e+(t.amount_due||t.total||0),0),K=(m?M:M.filter(e=>"Paid"!==e.status)).slice().sort((e,t)=>new Date(t.created_at||t.issue_date||0)-new Date(e.created_at||e.issue_date||0)),Z=u?L:L.filter(e=>"Accepted"!==e.status),$=[{id:"tasks",label:"Tasks",icon:p.A},{id:"invoices",label:"Invoices",icon:_i.A,count:V.length},{id:"requests",label:"Requests",icon:ws.A,count:U.length},{id:"proposals",label:"Proposals",icon:kt.A,count:J.length}];if(G.length>0&&$.push({id:"runsheets",label:"Runsheets",icon:_t.A,count:G.length}),(null===b||void 0===b?void 0:b.length)>0&&$.push({id:"photos",label:"Photos",icon:Jr.A,count:b.length}),(null===v||void 0===v?void 0:v.length)>0){const e=v.reduce((e,t)=>{var s;return e+((null===(s=t.assets)||void 0===s?void 0:s.length)||0)},0);$.push({id:"videos",label:"Videos",icon:Ge.A,count:e})}return(0,f.jsxs)("div",{className:"min-h-screen bg-slate-50",children:[o&&(0,f.jsx)("div",{className:"bg-gradient-to-r from-orange-500 to-rose-500 text-white px-4 py-3",children:(0,f.jsxs)("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)(_.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"font-semibold",children:"Admin Preview Mode"}),(0,f.jsxs)("span",{className:"text-orange-100",children:["\u2014 Viewing as ",null===O||void 0===O?void 0:O.contact_name]})]}),(0,f.jsxs)("button",{onClick:T,className:"flex items-center gap-2 px-4 py-1.5 bg-white/20 hover:bg-white/30 rounded-lg font-medium text-sm transition-colors",children:[(0,f.jsx)(Ct.A,{className:"h-4 w-4"}),"Return to Admin"]})]})}),(0,f.jsx)("header",{style:{backgroundColor:"#bf212f"},children:(0,f.jsx)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 py-4",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("img",{src:"/Logo-DarkBG.png",alt:"Turbo 360",className:"h-8 sm:h-10"}),(0,f.jsxs)("button",{onClick:E,className:"flex items-center gap-2 px-3 py-2 text-white/80 hover:text-white hover:bg-white/10 rounded-lg transition-colors text-sm font-medium",children:[(0,f.jsx)(is.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"Sign out"})]})]})})}),Vc(O)&&(0,f.jsx)("div",{className:"bg-[#0F0F11] text-white",children:(0,f.jsxs)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 py-5 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-mono text-[10px] font-bold tracking-[0.18em] text-[#BF212F]",children:"NATIONAL MEDIA \xb7 BOOKING PORTAL"}),(0,f.jsx)("p",{className:"mt-2 text-sm text-slate-300 max-w-xl",children:"Your show calendar and package bookings live in your dedicated booking portal. We'll email you a sign-in link \u2014 no password to remember."})]}),(0,f.jsxs)("a",{href:"/national-media/login".concat(null!==O&&void 0!==O&&O.email?"?email=".concat(encodeURIComponent(O.email)):""),className:"flex-shrink-0 inline-flex items-center justify-center gap-2 px-5 py-2.5 bg-[#BF212F] hover:bg-[#A81B28] text-white rounded-lg font-semibold transition-colors",children:["Open booking portal",(0,f.jsx)(S.A,{className:"h-4 w-4"})]})]})}),(0,f.jsx)("div",{className:"bg-gradient-to-r from-slate-900 via-slate-800 to-slate-900 text-white",children:(0,f.jsxs)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 py-8",children:[(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-4",children:[O.logo_url&&(0,f.jsx)("div",{className:"bg-white p-2 rounded-xl shadow-lg flex-shrink-0",children:(0,f.jsx)("img",{src:O.logo_url,alt:O.company_name,className:"h-12 w-auto max-w-[100px] object-contain",onError:e=>{e.target.style.display="none",e.target.parentElement.style.display="none"}})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold",children:O.company_name}),(0,f.jsx)("p",{className:"text-slate-300",children:O.contact_name})]})]}),(0,f.jsxs)("button",{onClick:()=>e("/client-portal/new-job"),className:"flex items-center justify-center gap-2 px-5 py-2.5 bg-teal-500 hover:bg-teal-600 text-white rounded-lg font-semibold transition-colors",children:[(0,f.jsx)(ls.A,{className:"h-5 w-5"}),"New Job Request"]})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mt-6",children:[(0,f.jsxs)("div",{className:"bg-white/10 backdrop-blur rounded-xl p-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-slate-300 text-sm mb-1",children:[(0,f.jsx)(_i.A,{className:"h-4 w-4"}),"Outstanding"]}),(0,f.jsx)("p",{className:"text-xl font-bold",children:z(Y)})]}),(0,f.jsxs)("div",{className:"bg-white/10 backdrop-blur rounded-xl p-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-slate-300 text-sm mb-1",children:[(0,f.jsx)(h.A,{className:"h-4 w-4"}),"Unpaid Invoices"]}),(0,f.jsx)("p",{className:"text-xl font-bold",children:V.length})]}),(0,f.jsxs)("div",{className:"bg-white/10 backdrop-blur rounded-xl p-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-slate-300 text-sm mb-1",children:[(0,f.jsx)(kt.A,{className:"h-4 w-4"}),"Active Proposals"]}),(0,f.jsx)("p",{className:"text-xl font-bold",children:J.length})]}),(0,f.jsxs)("div",{className:"bg-white/10 backdrop-blur rounded-xl p-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-slate-300 text-sm mb-1",children:[(0,f.jsx)(p.A,{className:"h-4 w-4"}),"Tasks In Progress"]}),(0,f.jsx)("p",{className:"text-xl font-bold",children:w})]})]})]})}),(0,f.jsx)("div",{className:"bg-white border-b border-slate-200 sticky top-0 z-20",children:(0,f.jsx)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6",children:(0,f.jsx)("nav",{className:"flex gap-1 overflow-x-auto py-2 -mb-px scrollbar-hide",children:$.map(e=>{const t=e.icon,s=c===e.id;return(0,f.jsxs)("button",{onClick:()=>d(e.id),className:"flex items-center gap-2 px-4 py-2.5 rounded-lg font-medium text-sm whitespace-nowrap transition-colors ".concat(s?"bg-teal-50 text-teal-700":"text-slate-600 hover:bg-slate-100"),children:[(0,f.jsx)(t,{className:"h-4 w-4"}),e.label,e.count>0&&(0,f.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-semibold ".concat(s?"bg-teal-100 text-teal-700":"bg-slate-200 text-slate-600"),children:e.count})]},e.id)})})})}),(0,f.jsxs)("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 py-8",children:["tasks"===c&&(0,f.jsx)(Ey,{clientId:t.client.id,onTasksLoaded:e=>N(e)}),"invoices"===c&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-slate-900",children:"Invoices"}),(0,f.jsx)("p",{className:"text-slate-500 text-sm",children:"View and pay your invoices"})]}),(0,f.jsxs)("button",{onClick:()=>x(!m),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(m?"bg-green-100 text-green-700":"bg-slate-100 text-slate-600 hover:bg-slate-200"),children:[(0,f.jsx)(p.A,{className:"h-4 w-4"}),m?"Showing All":"Show Paid"]})]}),0===K.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 p-12 text-center",children:[(0,f.jsx)(_i.A,{className:"h-12 w-12 text-slate-300 mx-auto mb-3"}),(0,f.jsx)("p",{className:"text-slate-600 font-medium",children:"No invoices to display"}),(0,f.jsx)("p",{className:"text-slate-400 text-sm mt-1",children:m?"You have no invoices yet":"All invoices have been paid"})]}):(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 overflow-hidden",children:[(0,f.jsx)("div",{className:"hidden md:block",children:(0,f.jsxs)("table",{className:"w-full",children:[(0,f.jsx)("thead",{className:"bg-slate-50 border-b border-slate-200",children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Invoice"}),(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Project"}),(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Due Date"}),(0,f.jsx)("th",{className:"px-6 py-3 text-right text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Amount"}),(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Status"}),(0,f.jsx)("th",{className:"px-6 py-3 text-right text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Actions"})]})}),(0,f.jsx)("tbody",{className:"divide-y divide-slate-100",children:K.map(e=>(0,f.jsxs)("tr",{className:"hover:bg-slate-50 transition-colors",children:[(0,f.jsx)("td",{className:"px-6 py-4 font-semibold text-slate-900",children:e.invoice_number}),(0,f.jsx)("td",{className:"px-6 py-4 text-slate-600",children:e.project_name}),(0,f.jsx)("td",{className:"px-6 py-4 text-slate-500 text-sm",children:B(e.due_date)}),(0,f.jsx)("td",{className:"px-6 py-4 text-right font-bold text-slate-900",children:z(e.amount_due||e.total)}),(0,f.jsx)("td",{className:"px-6 py-4",children:P(e.status)}),(0,f.jsx)("td",{className:"px-6 py-4",children:(0,f.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,f.jsxs)("button",{onClick:()=>window.open("/invoice/".concat(e.id),"_blank"),className:"flex items-center gap-1 px-3 py-1.5 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(_.A,{className:"h-4 w-4"}),"View"]}
1),"Paid"!==e.status&&"Draft"!==e.status&&(0,f.jsxs)("button",{onClick:()=>window.open("/invoice/".concat(e.id),"_blank"),className:"flex items-center gap-1 px-3 py-1.5 bg-teal-500 hover:bg-teal-600 text-white rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(Dc.A,{className:"h-4 w-4"}),"Pay"]})]})})]},e.id))})]})}),(0,f.jsx)("div",{className:"md:hidden divide-y divide-slate-100",children:K.map(e=>(0,f.jsxs)("div",{className:"p-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:e.invoice_number}),(0,f.jsx)("p",{className:"text-sm text-slate-500",children:e.project_name})]}),P(e.status)]}),(0,f.jsxs)("div",{className:"flex justify-between items-center mt-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-lg font-bold text-slate-900",children:z(e.amount_due||e.total)}),(0,f.jsxs)("p",{className:"text-xs text-slate-400",children:["Due ",B(e.due_date)]})]}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsx)("button",{onClick:()=>window.open("/invoice/".concat(e.id),"_blank"),className:"p-2 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg transition-colors",children:(0,f.jsx)(_.A,{className:"h-5 w-5"})}),"Paid"!==e.status&&"Draft"!==e.status&&(0,f.jsx)("button",{onClick:()=>window.open("/invoice/".concat(e.id),"_blank"),className:"p-2 bg-teal-500 hover:bg-teal-600 text-white rounded-lg transition-colors",children:(0,f.jsx)(Dc.A,{className:"h-5 w-5"})})]})]})]},e.id))})]})]}),"requests"===c&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-slate-900",children:"Job Requests"}),(0,f.jsx)("p",{className:"text-slate-500 text-sm",children:"Track your submitted requests"})]}),(0,f.jsxs)("div",{className:"flex gap-2",children:[O.rate_sheet_url&&(0,f.jsxs)("a",{href:O.rate_sheet_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-1.5 bg-slate-100 hover:bg-slate-200 text-slate-700 rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(kt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"hidden sm:inline",children:"Rate Sheet"})]}),(0,f.jsxs)("button",{onClick:()=>e("/client-portal/new-job"),className:"flex items-center gap-2 px-3 py-1.5 bg-teal-500 hover:bg-teal-600 text-white rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"New Request"]})]})]}),0===U.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 p-12 text-center",children:[(0,f.jsx)(ws.A,{className:"h-12 w-12 text-slate-300 mx-auto mb-3"}),(0,f.jsx)("p",{className:"text-slate-600 font-medium",children:"No active job requests"}),(0,f.jsx)("p",{className:"text-slate-400 text-sm mt-1",children:"Submit a new request to get started"}),(0,f.jsxs)("button",{onClick:()=>e("/client-portal/new-job"),className:"mt-4 flex items-center gap-2 px-4 py-2 bg-teal-500 hover:bg-teal-600 text-white rounded-lg text-sm font-medium transition-colors mx-auto",children:[(0,f.jsx)(ls.A,{className:"h-4 w-4"}),"New Job Request"]})]}):(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 overflow-hidden",children:[(0,f.jsx)("div",{className:"hidden md:block",children:(0,f.jsxs)("table",{className:"w-full",children:[(0,f.jsx)("thead",{className:"bg-slate-50 border-b border-slate-200",children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Service"}),(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Event Date"}),(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Location"}),(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Submitted"}),(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Status"})]})}),(0,f.jsx)("tbody",{className:"divide-y divide-slate-100",children:U.map(e=>(0,f.jsxs)("tr",{className:"hover:bg-slate-50 transition-colors",children:[(0,f.jsxs)("td",{className:"px-6 py-4",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:e.service}),e.brief&&(0,f.jsx)("p",{className:"text-sm text-slate-500 mt-1 line-clamp-1",children:e.brief})]}),(0,f.jsx)("td",{className:"px-6 py-4 text-slate-600",children:e.event_date?B(e.event_date):"\u2014"}),(0,f.jsx)("td",{className:"px-6 py-4 text-slate-600",children:e.location||"\u2014"}),(0,f.jsx)("td",{className:"px-6 py-4 text-slate-500 text-sm",children:B(e.created_at)}),(0,f.jsx)("td",{className:"px-6 py-4",children:D(e.status)})]},e.id))})]})}),(0,f.jsx)("div",{className:"md:hidden divide-y divide-slate-100",children:U.map(e=>(0,f.jsxs)("div",{className:"p-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:e.service}),D(e.status)]}),(0,f.jsxs)("div",{className:"space-y-1 text-sm text-slate-500 mt-2",children:[e.event_date&&(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),B(e.event_date)]}),e.location&&(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(C.A,{className:"h-4 w-4"}),e.location]}),(0,f.jsxs)("p",{className:"text-xs text-slate-400 mt-2",children:["Submitted ",B(e.created_at)]})]})]},e.id))})]})]}),"proposals"===c&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-slate-900",children:"Proposals"}),(0,f.jsx)("p",{className:"text-slate-500 text-sm",children:"Review and accept proposals"})]}),(0,f.jsxs)("button",{onClick:()=>g(!u),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(u?"bg-green-100 text-green-700":"bg-slate-100 text-slate-600 hover:bg-slate-200"),children:[(0,f.jsx)(p.A,{className:"h-4 w-4"}),u?"Showing All":"Show Accepted"]})]}),0===Z.length?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 p-12 text-center",children:[(0,f.jsx)(kt.A,{className:"h-12 w-12 text-slate-300 mx-auto mb-3"}),(0,f.jsx)("p",{className:"text-slate-600 font-medium",children:"No proposals to display"}),(0,f.jsx)("p",{className:"text-slate-400 text-sm mt-1",children:u?"You have no proposals yet":'Click "Show Accepted" to view archived proposals'})]}):(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 overflow-hidden",children:[(0,f.jsx)("div",{className:"hidden md:block",children:(0,f.jsxs)("table",{className:"w-full",children:[(0,f.jsx)("thead",{className:"bg-slate-50 border-b border-slate-200",children:(0,f.jsxs)("tr",{children:[(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Project"}),(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Date"}),(0,f.jsx)("th",{className:"px-6 py-3 text-right text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Amount"}),(0,f.jsx)("th",{className:"px-6 py-3 text-left text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Status"}),(0,f.jsx)("th",{className:"px-6 py-3 text-right text-xs font-semibold text-slate-500 uppercase tracking-wider",children:"Action"})]})}),(0,f.jsx)("tbody",{className:"divide-y divide-slate-100",children:Z.map(e=>(0,f.jsxs)("tr",{className:"hover:bg-slate-50 transition-colors",children:[(0,f.jsx)("td",{className:"px-6 py-4 font-semibold text-slate-900",children:e.project_name}),(0,f.jsx)("td",{className:"px-6 py-4 text-slate-500 text-sm",children:B(e.created_at)}),(0,f.jsx)("td",{className:"px-6 py-4 text-right font-bold text-slate-900",children:z(e.total)}),(0,f.jsx)("td",{className:"px-6 py-4",children:R(e.status)}),(0,f.jsx)("td",{className:"px-6 py-4 text-right",children:(0,f.jsxs)("button",{onClick:()=>window.open("/proposal/".concat(e.id),"_blank"),className:"flex items-center gap-1 px-3 py-1.5 bg-teal-500 hover:bg-teal-600 text-white rounded-lg text-sm font-medium transition-colors ml-auto",children:[(0,f.jsx)(_.A,{className:"h-4 w-4"}),"View"]}
1)})]},e.id))})]})}),(0,f.jsx)("div",{className:"md:hidden divide-y divide-slate-100",children:Z.map(e=>(0,f.jsxs)("div",{className:"p-4",children:[(0,f.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900",children:e.project_name}),R(e.status)]}),(0,f.jsxs)("div",{className:"flex justify-between items-center mt-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-lg font-bold text-slate-900",children:z(e.total)}),(0,f.jsx)("p",{className:"text-xs text-slate-400",children:B(e.created_at)})]}),(0,f.jsxs)("button",{onClick:()=>window.open("/proposal/".concat(e.id),"_blank"),className:"flex items-center gap-1 px-4 py-2 bg-teal-500 hover:bg-teal-600 text-white rounded-lg text-sm font-medium transition-colors",children:[(0,f.jsx)(_.A,{className:"h-4 w-4"}),"View"]})]})]},e.id))})]})]}),"runsheets"===c&&G.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-slate-900",children:"Event Runsheets"}),(0,f.jsx)("p",{className:"text-slate-500 text-sm",children:"View your event schedules and details"})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:G.map(e=>{var t;const s=e.event_date||e.event_days&&(null===(t=e.event_days[0])||void 0===t?void 0:t.date)||"";return(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 p-5 hover:shadow-md transition-shadow",children:[(0,f.jsx)("div",{className:"flex justify-between items-start mb-3",children:(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"font-bold text-slate-900",children:e.event_name}),s&&(0,f.jsxs)("p",{className:"text-sm text-slate-500 flex items-center gap-1 mt-1",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4"}),B(s)]}),e.venue&&(0,f.jsxs)("p",{className:"text-sm text-slate-500 flex items-center gap-1 mt-1",children:[(0,f.jsx)(C.A,{className:"h-4 w-4"}),e.venue]})]})}),(0,f.jsxs)("button",{onClick:()=>window.open("/corporate-runsheet/".concat(e.id),"_blank"),className:"w-full flex items-center justify-center gap-2 px-4 py-2 bg-teal-500 hover:bg-teal-600 text-white rounded-lg font-medium text-sm transition-colors mt-3",children:[(0,f.jsx)(_.A,{className:"h-4 w-4"}),"View Runsheet"]})]},e.id)})})]}),"photos"===c&&(null===b||void 0===b?void 0:b.length)>0&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-slate-900",children:"Photo Galleries"}),(0,f.jsx)("p",{className:"text-slate-500 text-sm",children:"Browse and download your photo galleries"})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:b.map(e=>(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 overflow-hidden hover:shadow-md transition-shadow",children:[(0,f.jsxs)("a",{href:e.share_url||e.simple_share_url,target:"_blank",rel:"noopener noreferrer",className:"block aspect-video bg-slate-100 relative group cursor-pointer",children:[e.featured_photo_thumbnail?(0,f.jsx)("img",{src:e.featured_photo_thumbnail,alt:e.name,className:"w-full h-full object-cover group-hover:opacity-90 transition-opacity"}):(0,f.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,f.jsx)(Ue.A,{className:"h-12 w-12 text-slate-300 group-hover:text-slate-400 transition-colors"})}),(0,f.jsx)("div",{className:"absolute inset-0 bg-black/30 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,f.jsx)(_.A,{className:"h-8 w-8 text-white"})})]}),(0,f.jsxs)("div",{className:"p-4",children:[(0,f.jsx)("p",{className:"font-semibold text-slate-900 truncate",children:e.name}),(0,f.jsxs)("div",{className:"flex items-center gap-3 mt-1 text-xs text-slate-500",children:[(0,f.jsxs)("span",{children:[e.photo_count," photos"]}),e.event_date&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{children:"\u2022"}),(0,f.jsx)("span",{children:B(e.event_date)})]})]}),(0,f.jsxs)("a",{href:e.share_url||e.simple_share_url,target:"_blank",rel:"noopener noreferrer",className:"mt-3 w-full flex items-center justify-center gap-2 px-4 py-2 bg-teal-500 hover:bg-teal-600 text-white rounded-lg font-medium text-sm transition-colors",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),"View Gallery"]})]})]},e.id))})]}),"videos"===c&&(null===v||void 0===v?void 0:v.length)>0&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-slate-900",children:"Video Projects"}),(0,f.jsx)("p",{className:"text-slate-500 text-sm",children:"Watch and review your video projects"})]}),(0,f.jsx)("div",{className:"space-y-6",children:v.map(e=>{var t,s;return(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 overflow-hidden",children:[(0,f.jsxs)("div",{className:"p-4 border-b border-slate-100 bg-slate-50",children:[(0,f.jsx)("h3",{className:"font-bold text-slate-900",children:e.name}),e.description&&(0,f.jsx)("p",{className:"text-sm text-slate-500 mt-1",children:e.description})]}),(0,f.jsxs)("div",{className:"p-4",children:[(0,f.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:null===(t=e.assets)||void 0===t?void 0:t.map(e=>{var t,s;const a=null===(t=e.versions)||void 0===t?void 0:t[0],n=null===a||void 0===a||null===(s=a.shareLinks)||void 0===s?void 0:s[0];return(0,f.jsxs)("div",{className:"border border-slate-200 rounded-lg overflow-hidden hover:shadow-md transition-shadow",children:[(0,f.jsxs)("a",{href:(null===n||void 0===n?void 0:n.url)||"#",target:null!==n&&void 0!==n&&n.url?"_blank":void 0,rel:"noopener noreferrer",className:"block aspect-video bg-slate-900 relative group cursor-pointer",onClick:e=>{null!==n&&void 0!==n&&n.url||e.preventDefault()},children:[e.thumbnailUrl?(0,f.jsx)("img",{src:e.thumbnailUrl,alt:e.name,className:"w-full h-full object-cover group-hover:opacity-90 transition-opacity"}):(0,f.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,f.jsx)(ji.A,{className:"h-12 w-12 text-slate-600 group-hover:text-white transition-colors"})}),(0,f.jsx)("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center",children:(0,f.jsx)(ji.A,{className:"h-16 w-16 text-white"})}),e.latestVersionStatus&&(0,f.jsx)("div",{className:"absolute top-2 right-2",children:(0,f.jsx)("span",{className:"px-2 py-1 rounded-full text-xs font-medium border ".concat(W(e.latestVersionStatus)),children:(r=e.latestVersionStatus,r?r.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()):"Unknown")})})]}),(0,f.jsxs)("div",{className:"p-3",children:[(0,f.jsx)("p",{className:"font-medium text-slate-900 truncate",children:e.name}),(0,f.jsx)("div",{className:"flex items-center gap-3 mt-1 text-xs text-slate-500",children:(0,f.jsxs)("span",{children:["Version ",e.currentVersion]})}),n?(0,f.jsxs)("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"mt-3 w-full flex items-center justify-center gap-2 px-4 py-2 bg-teal-500 hover:bg-teal-600 text-white rounded-lg font-medium text-sm transition-colors",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),"Watch & Review"]}):(0,f.jsx)("p",{className:"mt-3 text-xs text-slate-400 text-center",children:"Review link coming soon"})]})]},e._id);var r})}),(null===(s=e.shareBundles)||void 0===s?void 0:s.length)>0&&(0,f.jsxs)("div",{className:"mt-4 pt-4 border-t border-slate-100",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,f.jsx)(as.A,{className:"h-4 w-4 text-teal-600"}),(0,f.jsx)("h4",{className:"text-sm font-semibold text-slate-700",children:"Video Collections"})]}),(0,f.jsx)("div",{className:"space-y-2",children:e.shareBundles.map(e=>{var t,s;return(0,f.jsxs)("div",{className:"flex items-center justify-between gap-3 p-3 bg-slate-50 border border-slate-200 rounded-lg",children:[(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("p",{className:"font-medium text-slate-900 text-sm truncate",children:e.name}),(0,f.jsxs)("p",{className:"text-xs text-slate-500 mt-1",children:[(null===(t=e.items)||void 0===t?void 0:t.length)||0," video",1!==((null===(s=e.items)||void 0===s?void 0:s.length)||0)?"s":""]})]}),(0,f.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-3 py-1.5 bg-teal-500 hover:bg-teal-600 text-white rounded-lg text-xs font-medium transition-colors shrink-0",children:[(0,f.jsx)(En.A,{className:"h-3.5 w-3.5"}),"Watch"]})]},e._id)})})]})]})]},e._id)})})]})]})]})};var hv=s(57170),uv=s(7082);const gv=e=>new Intl.NumberFormat("en-AU",{style:"currency",currency:"AUD",minimumFractionDigits:2}).format(Number(e)||0),fv=e=>Math.round(100*(Number(e)+Number.EPSILON))/100,bv="#0A0A0B",yv="#2A2A2E",vv="#BF212F",jv="#0FA3A3",wv="#F4F2EE",Nv="#9A9AA0",Av="#E4E4E9",kv="#EDEDF0",Sv="'Hanken Grotesk', -apple-system, sans-serif",_v={fontFamily:"'Space Mono', monospace"},Cv=e=>{let{navigate:t}=e;return(0,f.jsx)("header",{style:{background:bv,borderBottom:"2px s
1olid ".concat(vv),flexShrink:0},children:(0,f.jsxs)("div",{style:{padding:"0 24px",height:60,display:"flex",alignItems:"center",gap:16},children:[(0,f.jsxs)("button",{onClick:()=>t("/client-portal/dashboard"),style:{display:"flex",alignItems:"center",gap:8,background:"transparent",border:"1px solid ".concat(yv),color:"#C4C4CB",borderRadius:9,padding:"8px 14px",fontFamily:Sv,fontSize:13,fontWeight:600,cursor:"pointer"},children:[(0,f.jsx)(Ct.A,{className:"h-4 w-4"})," Back to Dashboard"]}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},_v),{},{fontSize:10,letterSpacing:"0.22em",color:"#55555C"}),children:"NEW JOB REQUEST"}),(0,f.jsx)("img",{src:"/turbo-logo-white.png",alt:"Turbo 360",style:{height:24,width:"auto",marginLeft:"auto"}})]})})},Fv=e=>{let{client:t}=e;const s=(0,r.Zp)(),[n,i]=(0,a.useState)(null),[o,l]=(0,a.useState)(null),[c,d]=(0,a.useState)({submitter_name:"",submitter_email:"",submitter_mobile:"",project_title:"",date_required:"",location:"",brief:"",qty:{}}),[x,g]=(0,a.useState)({}),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)("");(0,a.useEffect)(()=>{d(e=>(0,m.A)((0,m.A)({},e),{},{submitter_name:(null===t||void 0===t?void 0:t.contact_name)||"",submitter_email:(null===t||void 0===t?void 0:t.email)||"",submitter_mobile:(null===t||void 0===t?void 0:t.phone)||""})),fetch("".concat(I.fn,"/api/lifeblood/pricing")).then(e=>e.json()).then(e=>i(e)).catch(e=>l(e.message||"Failed to load pricing"))},[t]);const S=(e,t)=>{d(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t})),x[e]&&g(t=>(0,m.A)((0,m.A)({},t),{},{[e]:""}))},_=(e,t)=>{const s=Math.max(0,Math.min(99,Math.floor(Number(t)||0)));d(t=>(0,m.A)((0,m.A)({},t),{},{qty:(0,m.A)((0,m.A)({},t.qty),{},{[e]:s})})),x.services&&g(e=>(0,m.A)((0,m.A)({},e),{},{services:""}))},C=(0,a.useMemo)(()=>c.location.trim().length>0&&!c.location.toLowerCase().includes("melbourne"),[c.location]),F=(0,a.useMemo)(()=>{var e;if(null===n||void 0===n||!n.services)return{lines:[],subtotal:0,gst:0,total:0};const t=[];let s=0;for(const r of n.services){const e=c.qty[r.id]||0;if(e<1)continue;const a=fv(r.price_ex_gst*e);t.push((0,m.A)((0,m.A)({},r),{},{qty:e,line_total:a})),s+=a}s=fv(s);const a=fv(s*(null!==(e=n.gst_rate)&&void 0!==e?e:.1));return{lines:t,subtotal:s,gst:a,total:fv(s+a)}},[n,c.qty]),E=(0,m.A)((0,m.A)({},_v),{},{fontSize:10.5,letterSpacing:"0.14em",color:Nv,marginBottom:14}),T={display:"block",fontSize:12,fontWeight:600,color:"#55555C",marginBottom:6},z=(0,f.jsx)("span",{style:{color:vv},children:"*"}),B=e=>x[e]&&(0,f.jsx)("p",{style:{fontSize:11.5,color:"#DC2626",margin:"5px 0 0"},children:x[e]}),D=(0,f.jsx)("style",{children:"\n .lb-input{width:100%;padding:11px 13px;background:#FAFAFB;border:1px solid #E4E4E9;border-radius:10px;font-family:'Hanken Grotesk',sans-serif;font-size:13.5px;color:#0A0A0B;transition:border-color .15s,box-shadow .15s;}\n .lb-input::placeholder{color:#9A9AA0;}\n .lb-input:focus{border-color:#0FA3A3;box-shadow:0 0 0 3px rgba(15,163,163,.12);outline:none;background:#fff;}\n .lb-step{width:32px;height:32px;border-radius:9px;border:1px solid #E4E4E9;background:#fff;color:#0A0A0B;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .12s;}\n .lb-step:hover:not(:disabled){border-color:#0FA3A3;color:#0FA3A3;}\n .lb-step:disabled{opacity:.35;cursor:not-allowed;}\n .lb-red:hover{background:#A81B28;}\n @media (max-width:760px){\n .lb-nj-page{height:auto !important;overflow:visible !important;}\n .lb-nj-grid{flex-direction:column !important;overflow:visible !important;}\n .lb-nj-form{overflow:visible !important;}\n .lb-nj-aside{width:auto !important;flex:none !important;border-left:none !important;border-top:1px solid #EDEDF0 !important;}\n }\n "});return w?(0,f.jsxs)("div",{className:"lb-nj-page",style:{minHeight:"100vh",display:"flex",flexDirection:"column",background:"#fff",fontFamily:Sv,color:bv},children:[(0,f.jsx)(Cv,{navigate:s}),(0,f.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"52px 40px",textAlign:"center",position:"relative",overflow:"hidden"},children:[(0,f.jsx)("img",{src:"/turbo-mark-red.png",alt:"",style:{position:"absolute",right:-30,top:-30,width:150,opacity:.05,pointerEvents:"none"}}),(0,f.jsx)("div",{style:{width:74,height:74,borderRadius:"50%",background:"#ECFDF5",border:"1px solid #BBF7D0",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:24},children:(0,f.jsx)(p.A,{className:"h-9 w-9",style:{color:"#16A34A"}})}),(0,f.jsx)("h3",{style:{fontFamily:"'Archivo', sans-serif",fontSize:24,fontWeight:800,margin:"0 0 12px",letterSpacing:"-0.01em"},children:"Job Request Submitted"}),(0,f.jsxs)("p",{style:{margin:"0 auto 8px",maxWidth:440,fontSize:14.5,color:"#6B6B72",lineHeight:1.6},children:["This request has been sent to ",(0,f.jsx)("strong",{style:{color:bv},children:"Toney Wilkinson"})," for approval. You'll receive a confirmation the moment the job moves to accepted \u2014 and it'll appear in your ",(0,f.jsx)("strong",{style:{color:bv},children:"Job Requests"})," tab as ",(0,f.jsx)("em",{children:"Awaiting Toney's approval"}),"."]}),A&&(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({display:"inline-flex",alignItems:"center",gap:8},_v),{},{fontSize:12,fontWeight:700,background:"#F4F4F6",border:"1px solid ".concat(Av),borderRadius:20,padding:"7px 14px",margin:"18px 0 28px"}),children:[(0,f.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:"#EF4444"}}),"REFERENCE ",A]}),(0,f.jsx)("button",{onClick:()=>
1s("/client-portal/dashboard"),className:"lb-red",style:{background:vv,color:"#fff",border:"none",borderRadius:11,padding:"13px 34px",fontFamily:"'Archivo', sans-serif",fontSize:14,fontWeight:700,cursor:"pointer"},children:"Done"})]}),D]}):(0,f.jsxs)("div",{className:"lb-nj-page",style:{height:"100vh",display:"flex",flexDirection:"column",background:"#fff",overflow:"hidden",fontFamily:Sv,color:bv},children:[(0,f.jsx)(Cv,{navigate:s}),(0,f.jsxs)("div",{style:{background:bv,padding:"24px 28px",position:"relative",overflow:"hidden",flexShrink:0},children:[(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-18,top:-22,width:110,opacity:.08,pointerEvents:"none"}}),(0,f.jsxs)("span",{style:(0,m.A)((0,m.A)({display:"inline-flex",alignItems:"center",gap:7,background:"rgba(239,68,68,.14)",color:"#FCA5A5",border:"1px solid rgba(239,68,68,.4)",borderRadius:20,padding:"4px 12px"},_v),{},{fontSize:10,letterSpacing:"0.12em",fontWeight:700,marginBottom:13}),children:[(0,f.jsx)("span",{style:{width:7,height:7,borderRadius:"50%",background:"#EF4444"}}),"RED CROSS LIFEBLOOD \xd7 TURBO 360"]}),(0,f.jsx)("h1",{style:{fontFamily:"'Archivo', sans-serif",fontSize:22,fontWeight:800,color:wv,margin:"0 0 6px",letterSpacing:"-0.01em"},children:"New Job Request"}),(0,f.jsx)("p",{style:{margin:0,fontSize:13,color:Nv,maxWidth:520,lineHeight:1.5},children:"Schedule 1 fixed pricing. Submissions are sent to Toney Wilkinson for approval before work commences."})]}),(0,f.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),(()=>{const e={};return c.submitter_name.trim()||(e.submitter_name="Required"),c.submitter_email.trim()||(e.submitter_email="Required"),c.submitter_mobile.trim()||(e.submitter_mobile="Required"),c.project_title.trim()||(e.project_title="Required"),c.date_required||(e.date_required="Required"),c.location.trim()||(e.location="Required"),c.brief.trim()||(e.brief="Please describe your project requirements"),0===F.lines.length&&(e.services="Select at least one service with a quantity of 1 or more"),g(e),0===Object.keys(e).length})()){y(!0),j(null);try{const e=JSON.parse(sessionStorage.getItem("turbo360_client_session")||"{}"),t=await fetch("".concat(I.fn,"/api/lifeblood-job-request"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e.token)},body:JSON.stringify({submitter_name:c.submitter_name.trim(),submitter_email:c.submitter_email.trim(),submitter_mobile:c.submitter_mobile.trim(),project_title:c.project_title.trim(),date_required:c.date_required,location:c.location.trim(),brief:c.brief.trim(),line_items:F.lines.map(e=>({service_id:e.id,qty:e.qty}))})});if(!t.ok){const e=await t.text();throw new Error(e||"Submission failed")}const s=await t.json().catch(()=>({}));k(s.ref_code||""),N(!0)}catch(t){j(t.message||"Something went wrong. Please try again or contact us directly.")}finally{y(!1)}}},className:"lb-nj-grid",style:{flex:1,minHeight:0,display:"flex",overflow:"hidden"},children:[(0,f.jsxs)("div",{className:"lb-nj-form",style:{flex:1,minWidth:0,overflowY:"auto",padding:"26px 28px"},children:[o&&(0,f.jsxs)("div",{style:{marginBottom:24,background:"#FEF2F2",border:"1px solid #FECACA",borderRadius:11,padding:14,display:"flex",gap:10},children:[(0,f.jsx)(h.A,{className:"h-5 w-5",style:{color:"#DC2626",flexShrink:0}}),(0,f.jsxs)("p",{style:{color:"#B91C1C",fontSize:13,margin:0},children:["Couldn't load the Lifeblood pricing schedule: ",o]})]}),(0,f.jsx)("div",{style:E,children:"YOUR DETAILS"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:13,marginBottom:28},children:[(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsx)("label",{style:T,children:"Full name"}),(0,f.jsx)("input",{className:"lb-input",type:"text",value:c.submitter_name,onChange:e=>S("submitter_name",e.target.value)}),B("submitter_name")]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:T,children:"Email"}),(0,f.jsx)("input",{className:"lb-input",type:"email",value:c.submitter_email,onChange:e=>S("submitter_email",e.target.value)}),B("submitter_email")]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:T,children:"Mobile"}),(0,f.jsx)("input",{className:"lb-input",type:"tel",value:c.submitter_mobile,onChange:e=>S("submitter_mobile",e.target.value)}),B("submitter_mobile")]})]}),(0,f.jsx)("div",{style:E,children:"PROJECT"}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:13,marginBottom:14},children:[(0,f.jsxs)("div",{style:{gridColumn:"span 2"},children:[(0,f.jsxs)("label",{style:T,children:["Title of project ",z]}),(0,f.jsx)("input",{className:"lb-input",type:"text",placeholder:"e.g. Donor Stories \u2014 Q3 Campaign",value:c.project_title,onChange:e=>S("project_title",e.target.value)}),B("project_title")]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{style:T,children:["Date required ",z]}),(0,f.jsx)("input",{className:"lb-input",type:"date",value:c.date_required,onChange:e=>S("date_required",e.target.value)}),B("date_required")]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{style:T,children:["Location ",z]}
1),(0,f.jsx)("input",{className:"lb-input",type:"text",placeholder:"Melbourne, Sydney, etc.",value:c.location,onChange:e=>S("location",e.target.value)}),B("location")]})]}),C?(0,f.jsxs)("div",{style:{display:"flex",gap:9,alignItems:"flex-start",background:"#FFFBEB",border:"1px solid #FDE68A",borderRadius:11,padding:"12px 14px",marginBottom:28},children:[(0,f.jsx)(u.A,{className:"h-4 w-4",style:{color:"#B45309",flexShrink:0,marginTop:1}}),(0,f.jsx)("span",{style:{fontSize:12,color:"#92400E",lineHeight:1.5},children:"Travel costs TBC \u2014 flights, accommodation and ground transport are invoiced at cost for jobs outside Melbourne."})]}):(0,f.jsx)("div",{style:{marginBottom:28}}),(0,f.jsxs)("div",{style:E,children:["SERVICES ",z," ",(0,f.jsx)("span",{style:{color:"#C9C9D0"},children:"\xb7 SCHEDULE 1 \xb7 EX GST"})]}),!n&&!o&&(0,f.jsx)("div",{style:{fontSize:13,color:Nv,marginBottom:28},children:"Loading pricing\u2026"}),(null===n||void 0===n?void 0:n.services)&&(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10,marginBottom:28},children:n.services.map(e=>{const t=c.qty[e.id]||0,s=t>0;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,padding:"13px 15px",borderRadius:12,border:"1px solid ".concat(s?jv:Av),background:s?"rgba(15,163,163,.05)":"#fff",transition:"all .15s"},children:[(0,f.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:700},children:e.label}),(0,f.jsx)("div",{style:{fontSize:11.5,color:Nv}
1,children:e.subtitle})]}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},_v),{},{fontSize:13,fontWeight:700,flexShrink:0,whiteSpace:"nowrap"}),children:gv(e.price_ex_gst)}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[(0,f.jsx)("button",{type:"button",className:"lb-step",onClick:()=>{return t=e.id,_(t,(c.qty[t]||0)-1);var t},disabled:0===t,"aria-label":"Decrease ".concat(e.label),children:(0,f.jsx)(md.A,{className:"h-4 w-4"})}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},_v),{},{fontSize:14,fontWeight:700,width:20,textAlign:"center"}),children:t}),(0,f.jsx)("button",{type:"button",className:"lb-step",onClick:()=>{return t=e.id,_(t,(c.qty[t]||0)+1);var t},"aria-label":"Increase ".concat(e.label),children:(0,f.jsx)(ls.A,{className:"h-4 w-4"})})]})]},e.id)})}),x.services&&(0,f.jsx)("p",{style:{fontSize:13,color:"#DC2626",margin:"0 0 28px"},children:x.services}),(0,f.jsxs)("div",{style:E,children:["PROJECT BRIEF ",z]}),(0,f.jsx)("textarea",{className:"lb-input",rows:5,placeholder:"Tell us about the project \u2014 goals, talent, deliverables, any access or timing constraints.",value:c.brief,onChange:e=>S("brief",e.target.value),style:{resize:"vertical",lineHeight:1.55}}),B("brief"),v&&(0,f.jsxs)("div",{style:{marginTop:22,background:"#FEF2F2",border:"1px solid #FECACA",borderRadius:11,padding:14,display:"flex",gap:10},children:[(0,f.jsx)(h.A,{className:"h-5 w-5",style:{color:"#DC2626",flexShrink:0}}),(0,f.jsx)("p",{style:{color:"#B91C1C",fontSize:13,margin:0},children:v})]})]}),(0,f.jsxs)("aside",{className:"lb-nj-aside",style:{width:330,flexShrink:0,overflowY:"auto",borderLeft:"1px solid ".concat(kv),background:"#FBFBFC"},children:[(0,f.jsxs)("div",{style:{background:bv,padding:"20px 22px",position:"relative",overflow:"hidden"},children:[(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"",style:{position:"absolute",right:-16,bottom:-16,width:80,opacity:.07,pointerEvents:"none"}}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},_v),{},{fontSize:10,letterSpacing:"0.16em",color:"#7A7A82",marginBottom:8}),children:"ESTIMATE"}),(0,f.jsx)("div",{style:{fontFamily:"'Archivo Expanded', sans-serif",fontWeight:900,fontSize:30,color:wv,lineHeight:1,letterSpacing:"-0.02em"},children:gv(F.total)}),(0,f.jsx)("div",{style:{fontSize:11.5,color:"#7A7A82",marginTop:6},children:"Total cost (inc GST)"})]}),(0,f.jsxs)("div",{style:{padding:"18px 22px"},children:[0===F.lines.length?(0,f.jsx)("div",{style:{textAlign:"center",padding:"24px 8px",color:Nv,fontSize:12.5,lineHeight:1.5},children:"Select services to see your total."}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:11,marginBottom:16},children:F.lines.map(e=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:12.5,fontWeight:600,lineHeight:1.3},children:e.label}),(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},_v),{},{fontSize:10.5,color:Nv}),children:[e.qty," \xd7 ",gv(e.price_ex_gst)]})]}),(0,f.jsx)("div",{style:(0,m.A)((0,m.A)({},_v),{},{fontSize:12.5,fontWeight:700,flexShrink:0}),children:gv(e.line_total)})]},e.id))}),(0,f.jsxs)("div",{style:{borderTop:"1px solid ".concat(kv),paddingTop:14,display:"flex",flexDirection:"column",gap:9},children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,f.jsx)("span",{style:{fontSize:12.5,color:"#6B6B72"},children:"Subtotal (ex GST)"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},_v),{},{fontSize:12.5,fontWeight:700}),children:gv(F.subtotal)})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,f.jsx)("span",{style:{fontSize:12.5,color:"#6B6B72"},children:"GST (10%)"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},_v),{},{fontSize:12.5,fontWeight:700}),children:gv(F.gst)})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",borderTop:"1px solid ".concat(kv),paddingTop:11,marginTop:2},children:[(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},_v),{},{fontSize:10.5,letterSpacing:"0.1em",color:Nv}),children:"TOTAL"}),(0,f.jsx)("span",{style:(0,m.A)((0,m.A)({},_v),{},{fontSize:17,fontWeight:700}),children:gv(F.total)})]})]})]}),C&&(0,f.jsx)("div",{style:{marginTop:14,fontSize:11.5,color:"#92400E",background:"#FFFBEB",border:"1px solid #FDE68A",borderRadius:10,padding:"10px 12px",lineHeight:1.5},children:"Travel costs TBC \u2014 invoiced at cost for jobs outside Melbourne."}),(0,f.jsx)("button",{type:"submit",disabled:b,className:"lb-red",style:{width:"100%",marginTop:18,display:"flex",alignItems:"center",justifyContent:"center",gap:8,background:vv,color:"#fff",border:"none",borderRadius:11,padding:13,fontFamily:"'Archivo', sans-serif",fontSize:14,fontWeight:700,cursor:b?"not-allowed":"pointer",opacity:b?.6:1},children:b?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{style:{width:18,height:18,border:"2px s
1olid rgba(255,255,255,.35)",borderTopColor:"#fff",borderRadius:"50%",animation:"spin 1s linear infinite"}})," Submitting\u2026"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ht.A,{className:"h-4 w-4"})," Submit for Approval"]})}),(0,f.jsx)("p",{style:{margin:"11px 0 0",fontSize:11,color:Nv,lineHeight:1.5,textAlign:"center"},children:"Sent to Toney Wilkinson for approval. You'll be notified when it's accepted."})]})]})]}),(0,f.jsx)("style",{children:"@keyframes spin{to{transform:rotate(360deg);}}"}),D]})},Ev=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)(null),[n,i]=(0,a.useState)({services:[],eventDate:"",location:"",brief:""}),[o,l]=(0,a.useState)({}),[c,d]=(0,a.useState)(!1),[x,h]=(0,a.useState)(null),u=[{id:"Video Production",label:"Video Production",icon:Ge.A},{id:"Photography",label:"Photography",icon:Ue.A},{id:"Live Streaming",label:"Live Streaming",icon:Ve.A},{id:"Website Development",label:"Website",icon:et.A},{id:"App Development",label:"App Development",icon:Wa.A},{id:"Post Production (Editing)",label:"Post Production",icon:hv.A},{id:"Virtual Tour",label:"Virtual Tour",icon:uv.A}];(0,a.useEffect)(()=>{const t=sessionStorage.getItem("turbo360_client_session");if(!t)return void e("/client-login");const a=JSON.parse(t);s(a.client),fetch("".concat(I.fn,"/api/client-portal/dashboard"),{headers:{Authorization:"Bearer ".concat(a.token)}}).then(e=>e.ok?e.json():null).then(e=>{null!==e&&void 0!==e&&e.client&&s(e.client)}).catch(()=>{})},[e]);return Jg(t)?(0,f.jsx)(Fv,{client:t}):(0,f.jsxs)("div",{className:"min-h-screen bg-slate-50",children:[(0,f.jsx)("header",{className:"bg-white border-b border-slate-200",children:(0,f.jsx)("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-4",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("button",{onClick:()=>e("/client-portal/dashboard"),className:"flex items-center gap-2 text-slate-600 hover:text-slate-900 font-medium text-sm",children:[(0,f.jsx)(Ct.A,{className:"h-4 w-4"}),"Back to Dashboard"]}),(0,f.jsx)("img",{src:"/Logo-DarkBG.png",alt:"Turbo 360",className:"h-8"})]})})}),(0,f.jsx)("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-8",children:"success"===x?(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 p-8 text-center",children:[(0,f.jsx)("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,f.jsx)(p.A,{className:"h-8 w-8 text-green-600"})}),(0,f.jsx)("h2",{className:"text-2xl font-bold text-slate-900 mb-2",children:"Request Submitted"}),(0,f.jsx)("p",{className:"text-slate-500 mb-6",children:"Thank you! Our team will review your request and get back to you shortly."}),(0,f.jsx)("p",{className:"text-sm text-slate-400",children:"Redirecting to dashboard..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"mb-8",children:[(0,f.jsx)("h1",{className:"text-2xl font-bold text-slate-900",children:"New Job Request"}),(0,f.jsx)("p",{className:"text-slate-500 mt-1",children:(null===t||void 0===t?void 0:t.company_name)&&"Submitting as ".concat(t.company_name)})]}),(0,f.jsxs)("form",{onSubmit:async t=>{if(t.preventDefault(),(()=>{const e={};return 0===n.services.length&&(e.services="Please select at least one service"),n.brief.trim()||(e.brief="Please describe your project requirements"),l(e),0===Object.keys(e).length})()){d(!0);try{const t=JSON.parse(sessionStorage.getItem("turbo360_client_session"));if(!(await fetch("".concat(I.fn,"/api/client-portal/job-request"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t.token)},body:JSON.stringify({service:n.services.join(", "),event_date:n.eventDate,location:n.location,brief:n.brief})})).ok)throw new Error("Submission failed");h("success"),i({services:[],eventDate:"",location:"",brief:""}),setTimeout(()=>e("/client-portal/dashboard"),3e3)}catch(s){console.error("Error:",s),h("error")}finally{d(!1)}}},className:"space-y-8",children:[(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 p-6",children:[(0,f.jsx)("label",{className:"block text-sm font-semibold text-slate-900 mb-1",children:"Services Required"}),(0,f.jsx)("p",{className:"text-sm text-slate-500 mb-4",children:"Select all that apply"}),(0,f.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3",children:u.map(e=>{const t=e.icon,s=n.services.includes(e.id);return(0,f.jsxs)("button",{type:"button",onClick:()=>{return t=e.id,i(e=>(0,m.A)((0,m.A)({},e),{},{services:e.services.includes(t)?e.services.filter(e=>e!==t):[...e.services,t]})),void(o.services&&l(e=>(0,m.A)((0,m.A)({},e),{},{services:""})));var t},className:"relative flex flex-col items-center justify-center p-4 rounded-xl border-2 transition-all ".concat(s?"border-teal-500 bg-teal-50 text-teal-700":"border-slate-200 bg-white text-slate-600 hover:border-slate-300"),children:[s&&(0,f.jsx)("div",{className:"absolute top-2 right-2",children:(0,f.jsx)(p.A,{className:"h-4 w-4 text-teal-500"})}),(0,f.jsx)(t,{className:"h-6 w-6 mb-2 ".concat(s?"text-teal-600":"text-slate-400")}),(0,f.jsx)("span",{className:"text-xs font-medium text-center",children:e.label})]},e.id)})}),o.services&&(0,f.jsx)("p",{className:"text-sm text-red-600 mt-3",children:o.services})]}),(0,f.jsx)("div",{className:"bg-white rounded-xl border border-slate-200 p-6",children:(0,f.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-semibold text-slate-900 mb-2",children:"Event/Project Date"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(_t.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-slate-400"}),(0,f.jsx)("input",{type:"date",value:n.eventDate,onChange:e=>i((0,m.A)((0,m.A)({},n),{},{eventDate:e.target.value})),className:"w-full pl-10 pr-4 py-3 bg-slate-50 border-2 border-slate-200 rounded-xl text-slate-900 focus:outline-none focus:border-teal-500 focus:ring-4 focus:ring-teal-500/10 transition-all"})]}),(0,f.jsx)("p",{className:"text-xs text-slate-400 mt-1",children:"Optional - leave blank if flexible"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-semibold text-slate-900 mb-2",children:"Location"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(C.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-slate-400"}),(0,f.jsx)("input",{type:"text",value:n.location,onChange:e=>i((0,m.A)((0,m.A)({},n),{},{location:e.target.value})),placeholder:"Melbourne, Sydney, etc.",className:"w-full pl-10 pr-4 py-3 bg-slate-50 border-2 border-slate-200 rounded-xl text-slate-900 placeholder-slate-400 focus:outline-none focus:border-teal-500 focus:ring-4 focus:ring-teal-500/10 transition-all"})]}),(0,f.jsx)("p",{className:"text-xs text-slate-400 mt-1",children:"Optional - where is the project?"})]})]})}),(0,f.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 p-6",children:[(0,f.jsx)("label",{className:"block text-sm font-semibold text-slate-900 mb-2",children:"Project Details"}),(0,f.jsx)("p",{className:"text-sm text-slate-500 mb-3",children:"Tell us about your project, goals, and any specific requirements"}),(0,f.jsx)("textarea",{value:n.brief,onChange:e=>i((0,m.A)((0,m.A)({},n),{},{brief:e.target.value})),rows:"6",placeholder:"Describe your project requirements, timeline, deliverables, and any other relevant details...",className:"w-full px-4 py-3 bg-slate-50 border-2 border-slate-200 rounded-xl text-slate-900 placeholder-slate-400 focus:outline-none focus:border-teal-500 focus:ring-4 focus:ring-teal-500/10 transition-all resize-none"}),o.brief&&(0,f.jsx)("p",{className:"text-sm text-red-600 mt-2",children:o.brief})]}),"error"===x&&(0,f.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-xl p-4",children:(0,f.jsx)("p",{className:"text-red-600 text-sm font-medium",children:"Something went wrong. Please try again or c
1ontact us directly."})}),(0,f.jsx)("button",{type:"submit",disabled:c,className:"w-full flex items-center justify-center gap-2 bg-teal-500 hover:bg-teal-600 text-white font-semibold py-4 px-6 rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:c?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),(0,f.jsx)("span",{children:"Submitting..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(st.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{children:"Submit Request"})]})})]})]})})]})},Tv=()=>{var e,t,s,n;const{shareToken:i}=(0,r.g)(),[o,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(!0),[m,x]=(0,a.useState)(""),[u,g]=(0,a.useState)(null);(0,a.useEffect)(()=>{b()},[i]);const b=async()=>{try{const e=await fetch("".concat(I.fn,"/api/wedding-share/").concat(i)),t=await e.json();e.ok&&t.success?(l(t.form_data),g(t.expires_at)):x(t.detail||"Unable to load wedding schedule")}catch(m){console.error("Load shared form error:",m),x("Network error occurred")}finally{d(!1)}},y=()=>{window.print()};return c?(0,f.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"w-16 h-16 border-4 border-rose-200 border-t-rose-600 rounded-full animate-spin mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-600",children:"Loading wedding schedule..."})]})}):m?(0,f.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-8 max-w-md w-full text-center",children:[(0,f.jsx)("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,f.jsx)(h.A,{className:"h-8 w-8 text-red-600"})}),(0,f.jsx)("h1",{className:"text-xl font-bold text-gray-900 mb-2",children:"Access Denied"}),(0,f.jsx)("p",{className:"text-gray-600 mb-4",children:m}),(0,f.jsx)("p",{className:"text-sm text-gray-500",children:"This link may have expired or is invalid. Please contact the wedding team for a new link."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-white to-rose-50",children:[(0,f.jsx)("div",{className:"fixed bottom-6 right-6 z-50 no-print",children:(0,f.jsxs)("button",{onClick:y,className:"flex items-center gap-2 bg-rose-600 hover:bg-rose-700 text-white px-5 py-3 rounded-full shadow-lg transition-all hover:shadow-xl",children:[(0,f.jsx)(Sr.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{className:"font-medium",children:"Print Run Sheet"})]})}),(0,f.jsx)("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 py-8 print:p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-xl overflow-hidden print-area print:shadow-none print:rounded-none",children:[(0,f.jsxs)("div",{className:"relative bg-gradient-to-br from-slate-700 via-slate-600 to-slate-800 text-white px-8 py-12 print:bg-slate-700",children:[(0,f.jsxs)("div",{className:"absolute inset-0 opacity-10 print:hidden",children:[(0,f.jsx)("div",{className:"absolute top-0 left-0 w-64 h-64 bg-white rounded-full -translate-x-1/2 -translate-y-1/2"}),(0,f.jsx)("div",{className:"absolute bottom-0 right-0 w-96 h-96 bg-white rounded-full translate-x-1/3 translate-y-1/3"})]}),(0,f.jsxs)("div",{className:"relative text-center",children:[(0,f.jsx)("div",{className:"mb-6",children:(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"mx-auto h-12 w-auto",onError:e=>{e.target.style.display="none"}})}),(0,f.jsx)("div",{className:"inline-block bg-white/20 backdrop-blur-sm px-5 py-1.5 rounded-full text-sm font-semibold tracking-wider mb-6 border border-white/30",children:"WEDDING RUN SHEET"}),(0,f.jsxs)("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold mb-4 tracking-tight",children:[o.first_name," ",o.last_name,(0,f.jsx)("span",{className:"block sm:inline text-white/80 mx-2 sm:mx-4",children:"&"}),(0,f.jsxs)("span",{className:"block sm:inline",children:[o.partner_first_name," ",o.partner_last_name]})]}),o.wedding_date&&(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)("div",{className:"text-xl sm:text-2xl font-light opacity-95",children:new Date(o.wedding_date).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),o.service_type&&(0,f.jsx)("div",{className:"inline-block bg-white/25 px-4 py-1 rounded-full text-sm font-medium",children:o.service_type})]}),(0,f.jsxs)("div",{className:"flex flex-wrap justify-center gap-4 sm:gap-8 mt-8 text-sm",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 bg-white/15 px-4 py-2 rounded-full",children:[(0,f.jsx)(E.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:o.mobile_number})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2 bg-white/15 px-4 py-2 rounded-full",children:[(0,f.jsx)(Xe.A,{className:"h-4 w-4"}),(0,f.jsxs)("span",{children:[o.guest_count," guests"]})]})]})]})]}),(0,f.jsxs)("div",{className:"px-6 sm:px-8 py-10",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-8",children:[(0,f.jsx)("div",{className:"p-2 bg-rose-100 rounded-xl",children:(0,f.jsx)(Nt.A,{className:"h-6 w-6 text-rose-600"})}),(0,f.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Wedding Day Timeline"})]}),(0,f.jsxs)("div",{className:"relative space-y-4",children:[(0,f.jsx)("div",{className:"absolute left-[22px] top-4 bottom-4 w-0.5 bg-gradient-to-b from-rose-300 via-pink-300 to-purple-300 print:bg-gray-300"}),(()=>{const e=[];var t,s;o.prep_start_time&&e.push({time:o.prep_start_time,type:"prep",component:(0,f.jsxs)("div",{className:"relative flex gap-4 pl-2",children:[(0,f.jsx)("div",{className:"relative z-10 flex-shrink-0 w-11 h-11 rounded-full bg-gradient-to-br from-blue-400 to-blue-600 flex items-center justify-center shadow-lg ring-4 ring-white",children:(0,f.jsx)("span",{className:"text-white text-xs font-bold",children:null===(t=o.prep_start_time)||void 0===t?void 0:t.slice(0,5)})}),(0,f.jsxs)("div",{className:"flex-1 bg-gradient-to-br from-blue-50 to-slate-50 rounded-xl p-5 shadow-sm border border-blue-100",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-blue-600 bg-blue-100 px-2.5 py-0.5 rounded-full uppercase tracking-wide",children:"Preparation"}),(0,f.jsxs)("span",{className:"text-xs text-gray-500",children:["until ",o.prep_end_time||"TBD"]})]}),(0,f.jsx)("h3",{className:"font-bold text-gray-900 text-lg mb-1",children:"Getting Ready"}),(0,f.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-600 text-sm",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-blue-500"}),(0,f.jsx)("span",{children:o.prep_address})]}),(0,f.jsx)("div",{className:"mt-4 bg-white/70 rounded-lg p-3 border border-blue-100",children:(0,f.jsxs)("div",{className:"text-sm space-y-1",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Ye.A,{className:"h-3.5 w-3.5 text-gray-400"}),(0,f.jsxs)("span",{className:"font-medium text-gray-700",children:[o.first_name," ",o.last_name]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(E.A,{className:"h-3.5 w-3.5 text-gray-400"}),(0,f.jsx)("span",{className:"text-gray-600",children:o.mobile_number||"Not provided"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(T.A,{className:"h-3.5 w-3.5 text-gray-400"}),(0,f.jsx)("span",{className:"text-gray-600",children:o.email_address||"Not provided"})]})]})}),o.prep_additional_notes&&(0,f.jsxs)("div",{className:"mt-3 bg-amber-50 border border-amber-200 rounded-lg p-3",children:[(0,f.jsx)("div",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide mb-1",children:"Special Notes"}),(0,f.jsx)("div",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:o.prep_additional_notes})]})]})]})});o.partner_prep_start_time&&o.partner_prep_address!==o.prep_address&&e.push({time:o.partner_prep_start_time,type:"partner_prep",component:(0,f.jsxs)("div",{className:"relative flex gap-4 pl-2",children:[(0,f.jsx)("div",{className:"relative z-10 flex-shrink-0 w-11 h-11 rounded-full bg-gradient-to-br from-teal-400 to-teal-600 flex items-center justify-center shadow-lg ring-4 ring-white",children:(0,f.jsx)("span",{className:"text-white text-xs font-bold",children:null===(s=o.partner_prep_start_time)||void 0===s?void 0:s.slice(0,5)})}),(0,f.jsxs)("div",{className:"flex-1 bg-gradient-to-br from-teal-50 to-slate-50 rounded-xl p-5 shadow-sm border border-teal-100",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-teal-600 bg-teal-100 px-2.5 py-0.5 rounded-full uppercase tracking-wide",children:"Partner Prep"}),(0,f.jsxs)("span",{className:"text-xs text-gray-500",children:["until ",o.partner_prep_end_time||"TBD"]})]}),(0,f.jsx)("h3",{className:"font-bold text-gray-900 text-lg mb-1",children:"Partner Getting Ready"}),(0,f.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-600 text-sm",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-teal-500"}),(0,f.jsx)("span",{children:o.partner_prep_address})]}),(0,f.jsx)("div",{className:"mt-4 bg-white/70 rounded-lg p-3 border border-teal-100",children:(0,f.jsxs)("div",{className:"text-sm space-y-1",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Ye.A,{className:"h-3.5 w-3.5 text-gray-400"}),(0,f.jsxs)("span",{className:"font-medium text-gray-700",children:[o.partner_first_name," ",o.partner_last_name]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(E.A,{className:"h-3.5 w-3.5 text-gray-400"}),(0,f.jsx)("span",{className:"text-gray-600",children:o.partner_mobile_number||"Not provided"})]})]})}),o.partner_prep_additional_notes&&(0,f.jsxs)("div",{className:"mt-3 bg-amber-50 border border-amber-200 rounded-lg p-3",children:[(0,f.jsx)("div",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide mb-1",children:"Special Notes"}),(0,f.jsx)("div",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:o.partner_prep_additional_notes})]})]})]})});return o.ceremony_start_time&&e.push({time:o.ceremony_start_time,type:"ceremony",component:(0,f.jsxs)("div",{className:"relative flex gap-4 pl-2",children:[(0,f.jsx)("div",{className:"relative z-10 flex-shrink-0 w-11 h-11 rounded-full bg-gradient-to-br from-rose-400 to-rose-600 flex items-center justify-center shadow-lg ring-4 ring-white",children:(0,f.jsx)(fs.A,{className:"h-5 w-5 text-white"})}),(0,f.jsxs)("div",{className:"flex-1 bg-gradient-to-br from-rose-50 to-pink-50 rounded-xl p-5 shadow-sm border border-rose-200 hover:shadow-md transition-shadow",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-rose-600 bg-rose-100 px-2.5 py-0.5 rounded-full uppercase tracking-wide",children:"Ceremony"}),(0,f.jsx)("span",{className:"text-xs text-gray-500",children:o.ceremony_start_time})]}),(0,f.jsx)("h3",{className:"font-bold text-gray-900 text-lg mb-1",children:"Wedding Ceremony"}),(0,f.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-600 text-sm mb-3",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-rose-500"}),(0,f.jsx)("span",{children:o.ceremony_address})]}),(0,f.jsxs)("div",{className:"flex flex-wrap gap-3 text-sm",children:[o.ceremony_location_type&&(0,f.jsxs)("div",{className:"bg-white/70 px-3 py-1.5 rounded-lg border border-rose-100",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"Type:"})," ",(0,f.jsx)("span",{className:"font-medium text-gray-700",children:o.ceremony_location_type})]}),o.celebrant_name&&(0,f.jsxs)("div",{className:"bg-white/70 px-3 py-1.5 rounded-lg border border-rose-100",children:[(0,f.jsx)("span",{className:"text-gray-500",children:"Celebrant:"})," ",(0,f.jsx)("span",{className:"font-medium text-gray-700",children:o.celebrant_name})]})]}),o.ceremony_type_special_events&&(0,f.jsxs)("div",{className:"mt-3 bg-amber-50 border border-amber-200 rounded-lg p-3",children:[(0,f.jsx)("div",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide mb-1",children:"Special Notes"}),(0,f.jsx)("div",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:o.ceremony_type_special_events})]})]})]})}),o.bridal_party_introduction_time&&e.push({time:o.bridal_party_introduction_time,type:"reception",component:(0,f.jsxs)("div",{className:"relative flex gap-4 pl-2",children:[(0,f.jsx)("div",{className:"relative z-10 flex-shrink-0 w-11 h-11 rounded-full bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center shadow-lg ring-4 ring-white",children:(0,f.jsx)(Xe.A,{className:"h-5 w-5 text-white"})}),(0,f.jsxs)("div",{className:"flex-1 bg-gradient-to-br from-amber-50 to-orange-50 rounded-xl p-5 shadow-sm border border-amber-200 hover:shadow-md transition-shadow",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-amber-600 bg-amber-100 px-2.5 py-0.5 rounded-full uppercase tracking-wide",children:"Reception"}),(0,f.jsx)("span",{className:"text-xs text-gray-500",children:o.bridal_party_introduction_time})]}),(0,f.jsx)("h3",{className:"font-bold text-gray-900 text-lg mb-1",children:"Reception & Introductions"}),(0,f.jsxs)("div",{className:"flex items-center gap-1.5 text-gray-600 text-sm",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-amber-500"}),(0,f.jsx)("span",{children:o.reception_venue_address})]}),o.reception_special_events&&(0,f.jsxs)("div",{className:"mt-3 bg-white/70 border border-amber-200 rounded-lg p-3",children:[(0,f.jsx)("div",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide mb-1",children:"Reception Events"}),(0,f.jsx)("div",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:o.reception_special_events})]})]})]})}),o.coverage_finish_time&&e.push({time:o.coverage_finish_time,type:"coverage_finish",component:(0,f.jsxs)("div",{className:"relative flex gap-4 pl-2",children:[(0,f.jsx)("div",{className:"relative z-10 flex-shrink-0 w-11 h-11 rounded-full bg-gradient-to-br from-violet-400 to-purple-600 flex items-center justify-center shadow-lg ring-4 ring-white",children:(0,f.jsx)(p.A,{className:"h-5 w-5 text-white"})}),(0,f.jsxs)("div",{className:"flex-1 bg-gradient-to-br from-violet-50 to-purple-50 rounded-xl p-5 shadow-sm border border-violet-200",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-violet-600 bg-violet-100 px-2.5 py-0.5 rounded-full uppercase tracking-wide",children:"Complete"}),(0,f.jsx)("span",{className:"text-xs text-gray-500",children:o.coverage_finish_time})]}),(0,f.jsx)("h3",{className:"font-bold text-gray-900 text-lg mb-1",children:"Coverage Complete"}),(0,f.jsx)("p",{className:"text-gray-600 text-sm",children:"This concludes the wedding day coverage"})]})]})}),e.sort((e,t)=>
1{const s=e=>{if(!e)return 0;const[t,s]=e.split(":").map(Number);return 60*t+s};return s(e.time)-s(t.time)}),e.map((e,t)=>(0,f.jsx)("div",{children:e.component},"".concat(e.type,"-").concat(t)))})()]})]}),(0,f.jsx)("div",{className:"px-6 sm:px-8 pb-10",children:(0,f.jsxs)("div",{className:"grid lg:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-br from-amber-50 to-yellow-50 rounded-xl p-6 border border-amber-200 shadow-sm",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,f.jsx)("div",{className:"p-2 bg-amber-100 rounded-xl",children:(0,f.jsx)(E.A,{className:"h-5 w-5 text-amber-600"})}),(0,f.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"Important Contacts"})]}),(0,f.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,f.jsxs)("div",{className:"bg-white/70 border border-amber-200 rounded-lg p-4",children:[(0,f.jsxs)("div",{className:"font-semibold text-gray-800 mb-3 flex items-center gap-2",children:[(0,f.jsx)(fs.A,{className:"h-4 w-4 text-rose-500"}),"Client Contacts"]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 gap-3",children:[(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"w-8 h-8 rounded-full bg-rose-100 flex items-center justify-center flex-shrink-0",children:(0,f.jsx)(Ye.A,{className:"h-4 w-4 text-rose-600"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-800",children:o.first_name}),o.mobile_number&&(0,f.jsxs)("p",{className:"text-gray-600 text-sm flex items-center gap-1",children:[(0,f.jsx)(E.A,{className:"h-3 w-3"})," ",o.mobile_number]})]})]}),(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center flex-shrink-0",children:(0,f.jsx)(Ye.A,{className:"h-4 w-4 text-blue-600"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-800",children:o.partner_first_name}),o.partner_mobile_number&&(0,f.jsxs)("p",{className:"text-gray-600 text-sm flex items-center gap-1",children:[(0,f.jsx)(E.A,{className:"h-3 w-3"})," ",o.partner_mobile_number]})]})]})]})]}),(o.photographer_name||o.videographer_name)&&(0,f.jsxs)("div",{className:"bg-white/70 border border-amber-200 rounded-lg p-4",children:[(0,f.jsxs)("div",{className:"font-semibold text-gray-800 mb-3 flex items-center gap-2",children:[(0,f.jsx)(Ue.A,{className:"h-4 w-4 text-amber-600"}),"Turbo 360 Crew"]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 gap-3",children:[o.photographer_name&&(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center flex-shrink-0",children:(0,f.jsx)(Ue.A,{className:"h-4 w-4 text-blue-600"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-800",children:"Photographer"}),(0,f.jsx)("p",{className:"text-gray-700",children:o.photographer_name}),o.photographer_contact&&(0,f.jsx)("p",{className:"text-gray-500 text-xs",children:o.photographer_contact})]})]}),o.videographer_name&&(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"w-8 h-8 rounded-full bg-rose-100 flex items-center justify-center flex-shrink-0",children:(0,f.jsx)(Ue.A,{className:"h-4 w-4 text-rose-600"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-medium text-gray-800",children:"Videographer"}),(0,f.jsx)("p",{className:"text-gray-700",children:o.videographer_name}),o.videographer_contact&&(0,f.jsx)("p",{className:"text-gray-500 text-xs",children:o.videographer_contact})]})]})]})]}),(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,f.jsxs)("div",{className:"bg-white/70 rounded-lg p-3 border border-amber-100",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide",children:"Best Man"}),(0,f.jsx)("p",{className:"text-gray-800 font-medium mt-1",children:o.best_man_name||"Not provided"}),o.best_man_contact&&(0,f.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:o.best_man_contact})]}),(0,f.jsxs)("div",{className:"bg-white/70 rounded-lg p-3 border border-amber-100",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide",children:"Maid of Honor"}
1),(0,f.jsx)("p",{className:"text-gray-800 font-medium mt-1",children:o.maid_of_honor_name||"Not provided"}),o.maid_of_honor_contact&&(0,f.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:o.maid_of_honor_contact})]})]}),(0,f.jsxs)("div",{className:"bg-white/70 rounded-lg p-3 border border-amber-100",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-amber-700 uppercase tracking-wide",children:"Guest Count"}),(0,f.jsx)("p",{className:"text-gray-800 font-medium mt-1",children:o.guest_count||"Not specified"})]}),(0,f.jsxs)("div",{className:"bg-gradient-to-br from-red-50 to-rose-50 border border-red-200 rounded-lg p-4 mt-2",children:[(0,f.jsxs)("div",{className:"font-semibold text-red-800 mb-2 flex items-center gap-2",children:[(0,f.jsx)(h.A,{className:"h-4 w-4"}),"Turbo 360 Emergency Contact"]}),(0,f.jsxs)("div",{className:"text-red-700 space-y-1 text-sm",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(E.A,{className:"h-3.5 w-3.5"})," ",(0,f.jsx)("strong",{children:"1300 207 446"})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(T.A,{className:"h-3.5 w-3.5"})," ",(0,f.jsx)("strong",{children:"[email protected]"})]})]})]})]})]}),(0,f.jsxs)("div",{className:"bg-gradient-to-br from-violet-50 to-purple-50 rounded-xl p-6 border border-violet-200 shadow-sm",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-5",children:[(0,f.jsx)("div",{className:"p-2 bg-violet-100 rounded-xl",children:(0,f.jsx)(kt.A,{className:"h-5 w-5 text-violet-600"})}),(0,f.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"Crew Information"})]}),(0,f.jsxs)("div",{className:"space-y-4 text-sm",children:[o.bridal_party_photo_locations&&(0,f.jsxs)("div",{className:"bg-white/70 rounded-lg p-4 border border-violet-100",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-violet-700 uppercase tracking-wide",children:"Photo Locations"}),(0,f.jsx)("p",{className:"mt-2 text-gray-700",children:o.bridal_party_photo_locations})]}),(o.family_photo_combinations_file||o.reception_runsheet_file)&&(0,f.jsxs)("div",{className:"bg-white/70 rounded-lg p-4 border border-violet-100",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-violet-700 uppercase tracking-wide mb-3 block",children:"Reference Documents"}),(0,f.jsxs)("div",{className:"space-y-2",children:[o.family_photo_combinations_file&&(0,f.jsxs)("div",{className:"flex items-center justify-between bg-violet-50 p-3 rounded-lg border border-violet-200",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("div",{className:"w-8 h-8 rounded-full bg-violet-200 flex items-center justify-center",children:(0,f.jsx)(Ue.A,{className:"h-4 w-4 text-violet-700"})}),(0,f.jsx)("span",{className:"font-medium text-gray-800 text-sm",children:"Family Photo List"})]}),(0,f.jsxs)("a",{href:"object"===typeof o.family_photo_combinations_file&&o.family_photo_combinations_file.download_url?o.family_photo_combinations_file.download_url:null!==(e=o.family_photo_combinations_file)&&void 0!==e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,"/")?"".concat(I.fn,"/api/wedding-files/download/").concat(o.family_photo_combinations_file.split("/").pop()):"".concat(I.fn,"/api/wedding-files/download/").concat(o.family_photo_combinations_file),target:"_blank",rel:"noopener noreferrer",download:!0,className:"bg-violet-600 hover:bg-violet-700 px-3 py-1.5 rounded-lg text-xs font-medium flex items-center gap-1.5 no-print text-white",children:[(0,f.jsx)(es.A,{className:"h-3.5 w-3.5"}),(0,f.jsx)("span",{children:"Download"})]})]}),o.reception_runsheet_file&&(0,f.jsxs)("div",{className:"flex items-center justify-between bg-violet-50 p-3 rounded-lg border border-violet-200",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("div",{className:"w-8 h-8 rounded-full bg-violet-200 flex items-center justify-center",children:(0,f.jsx)(kt.A,{className:"h-4 w-4 text-violet-700"})}),(0,f.jsx)("span",{className:"font-medium text-gray-800 text-sm",children:"Reception Runsheet"})]}),(0,f.jsxs)("a",{href:"object"===typeof o.reception_runsheet_file&&o.reception_runsheet_file.download_url?o.reception_runsheet_file.download_url:null!==(s=o.reception_runsheet_file)&&void 0!==s&&null!==(n=s.startsWith)&&void 0!==n&&n.call(s,"/")?"".concat(I.fn,"/api/wedding-files/download/").concat(o.reception_runsheet_file.split("/").pop()):"".concat(I.fn,"/api/wedding-files/download/").concat(o.reception_runsheet_file),target:"_blank",rel:"noopener noreferrer",download:!0,className:"bg-violet-600 hover:bg-violet-700 px-3 py-1.5 rounded-lg text-xs font-medium flex items-center gap-1.5 no-print text-white",children:[(0,f.jsx)(es.A,{className:"h-3.5 w-3.5"}),(0,f.jsx)("span",{children:"Download"})]})]})]})]}),(0,f.jsxs)("div",{className:"bg-white/70 rounded-lg p-3 border border-violet-100",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-violet-700 uppercase tracking-wide",children:"Crew Meal Provided"}
1),(0,f.jsx)("p",{className:"text-gray-800 font-medium mt-1",children:!0===o.crew_meal_provided?"Yes":!1===o.crew_meal_provided?"No":"Not specified"})]}),o.additional_notes&&(0,f.jsxs)("div",{className:"bg-white/70 rounded-lg p-4 border border-violet-100",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-violet-700 uppercase tracking-wide",children:"Additional Notes"}),(0,f.jsx)("p",{className:"mt-2 whitespace-pre-wrap text-gray-700",children:o.additional_notes})]})]})]})]})}),(0,f.jsxs)("div",{className:"px-6 sm:px-8 pb-10 space-y-6",children:[("Videography"===o.service_type||"Photo and Video Package"===o.service_type||!o.service_type)&&(0,f.jsxs)("div",{className:"bg-gradient-to-br from-red-50 to-rose-50 rounded-xl p-6 border border-red-200 shadow-sm",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,f.jsx)("div",{className:"p-2 bg-red-100 rounded-xl",children:(0,f.jsx)(Ue.A,{className:"h-5 w-5 text-red-600"})}),(0,f.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"Videographer Standards"})]}),(0,f.jsx)("div",{className:"space-y-2 text-sm text-gray-700",children:(0,f.jsxs)("ul",{className:"space-y-2",children:[(0,f.jsxs)("li",{className:"flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-red-500 font-bold",children:"\u2022"})," Use Standard Color Profile (no RAW or LOG footage)."]}),(0,f.jsxs)("li",{className:"flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-red-500 font-bold",children:"\u2022"})," Record continuously during formalities for syncing multiple angles in post-production."]}),(0,f.jsxs)("li",{className:"flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-red-500 font-bold",children:"\u2022"})," Ideal format: 4K at 25p or 50p, PAL. Keep frame rate consistent across all cameras."]}),(0,f.jsxs)("li",{className:"flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-red-500 font-bold",children:"\u2022"})," Ensure camera time and date are accurate."]}),(0,f.jsxs)("li",{className:"flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-red-500 font-bold",children:"\u2022"})," Use monopod, tripod, or gimbal, and IBIS lenses where possible."]}),(0,f.jsxs)("li",{className:"flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-red-500 font-bold",children:"\u2022"})," Prioritize clear audio; if needed, tape lapel mic to main microphones."]}),(0,f.jsxs)("li",{className:"flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-red-500 font-bold",children:"\u2022"})," ",(0,f.jsx)("strong",{children:"Coverage Goals:"})," Preps montage, full ceremony, photoshoot montage, full reception formalities, and general B-roll."]})]})})]}),("Photography"===o.service_type||"Photo and Video Package"===o.service_type||!o.service_type)&&(0,f.jsxs)("div",{className:"bg-gradient-to-br from-blue-50 to-indigo-50 rounded-xl p-6 border border-blue-200 shadow-sm",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,f.jsx)("div",{className:"p-2 bg-blue-100 rounded-xl",children:(0,f.jsx)(Ue.A,{className:"h-5 w-5 text-blue-600"})}),(0,f.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"Photography Standards"})]}),(0,f.jsx)("div",{className:"space-y-2 text-sm text-gray-700",children:(0,f.jsxs)("ul",{className:"space-y-2",children:[(0,f.jsxs)("li",{className:"flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-blue-500 font-bold",children:"\u2022"})," Capture all imagery in RAW format (no JPGs)."]}),(0,f.jsxs)("li",{className:"flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-blue-500 font-bold",children:"\u2022"})," Verify camera time and date settings for syncing in post-production."]}),(0,f.jsxs)("li",{className:"flex items-start gap-2",children:[(0,f.jsx)("span",{className:"text-blue-500 font-bold",children:"\u2022"})," Client provides family photo list and appoints a helper to manage group organization while the photographer focuses on photo quality."]})]})})]}),(0,f.jsxs)("div",{className:"bg-gradient-to-br from-emerald-50 to-green-50 rounded-xl p-6 border border-emerald-200 shadow-sm",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,f.jsx)("div",{className:"p-2 bg-emerald-100 rounded-xl",children:(0,f.jsx)(_s.A,{className:"h-5 w-5 text-emerald-600"})}),(0,f.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"Upload Instructions"})]}),(0,f.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,f.jsx)("p",{className:"font-semibold text-emerald-800 bg-emerald-100 px-3 py-2 rounded-lg inline-block",children:"RAW footage must be uploaded immediately after the event."}),(0,f.jsxs)("div",{className:"bg-white/70 rounded-lg p-4 border border-emerald-200",children:[(0,f.jsx)("span",{className:"text-xs font-semibold text-emerald-700 uppercase tracking-wide mb-3 block",children:"Crew Upload Software"}),(0,f.jsx)("p",{className:"text-gray-700 text-sm mb-4",children:"Download and install the Turbo Crew Upload software:"}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-arm64.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-slate-800 to-slate-900 hover:from-slate-700 hover:to-slate-800 text-white rounded-xl p-4 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold",children:"Crew Upload (Apple Silicon).dmg"}),(0,f.jsx)("p",{className:"text-xs text-slate-300",children:"For Apple Silicon Macs (M1, M2, M3, M4)"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload.dmg",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-slate-600 to-slate-700 hover:from-slate-500 hover:to-slate-600 text-white rounded-xl p-4 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold",children:"Crew Upload (Intel).dmg"}),(0,f.jsx)("p",{className:"text-xs text-slate-300",children:"For Intel Macs"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5"})]}),(0,f.jsxs)("a",{href:"https://github.com/turbo360/TurboCrewUploads/releases/latest/download/Crew-Upload-Setup.exe",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-between bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-500 hover:to-blue-600 text-white rounded-xl p-4 transition-colors",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("svg",{className:"h-8 w-8",viewBox:"0 0 24 24",fill:"currentColor",children:(0,f.jsx)("path",{d:"M3 12V6.75l6-1.32v6.48L3 12zm17-9v8.75l-10 .15V5.21L20 3zM3 13l6 .09v6.81l-6-1.15V13zm17 .25V22l-10-1.91V13.1l10 .15z"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-semibold",children:"Crew Upload Setup.exe"}),(0,f.jsx)("p",{className:"text-xs text-blue-200",children:"For Windows"})]})]}),(0,f.jsx)(es.A,{className:"h-5 w-5"})]})]}),(0,f.jsx)("div",{className:"mt-4 bg-amber-50 border border-amber-200 rounded-lg p-3",children:(0,f.jsxs)("p",{className:"text-amber-900 text-sm font-medium",children:[(0,f.jsx)("span",{className:"font-semibold",children:"Upload Password:"})," tcrew26"]})})]})]})]})]}),(0,f.jsx)("div",{className:"px-6 sm:px-8 pb-8",children:(0,f.jsxs)("div",{className:"text-center pt-8 border-t border-gray-200",children:[(0,f.jsxs)("div",{className:"mb-6 no-print",children:[(0,f.jsxs)("button",{onClick:y,className:"inline-flex items-center gap-2 bg-gradient-to-r from-rose-500 to-pink-500 hover:from-rose-600 hover:to-pink-600 text-white px-6 py-3 rounded-xl text-sm font-semibold shadow-lg hover:shadow-xl transition-all",children:[(0,f.jsx)(Sr.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:"Print Run Sheet"})]}),u&&(0,f.jsxs)("div",{className:"text-sm text-gray-500 mt-4",children:["This link expires on ",new Date(u).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),(0,f.jsxs)("p",{className:"text-sm text-gray-400",children:["Prepared by ",(0,f.jsx)("span",{className:"font-semibold text-gray-500",children:"Turbo 360"})," \u2022 Professional Wedding Services"]})]})})]})}),(0,f.jsx)("style",{children:"\n @media print {\n @page {\n size: A4;\n margin: 0.5in;\n }\n \n body * {\n visibility: hidden;\n }\n \n .print-area, .print-area * {\n visibility: visible;\n }\n \n .print-area {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n }\n \n .no-print {\n display: none !important;\n }\n \n .border-l-3 {\n border-left: 3px solid #e2e8f0;\n }\n \n .border-l-4 {\n border-left: 4px solid #f43f5e;\n }\n }\n "})]})},zv=["className"];function Bv(e){let{className:t}=e,s=(0,ot.A)(e,zv);
1return(0,f.jsx)("div",(0,m.A)({className:(0,ct.cn)("animate-pulse rounded-md bg-primary/10",t)},s))}var Dv=s(17931);const Iv=[{number:1,title:"Choose Package",icon:Ue.A},{number:2,title:"Your Details",icon:fs.A},{number:3,title:"Review & Pay",icon:Dc.A},{number:4,title:"Confirmed",icon:p.A}],Rv=e=>{var t;let{currentStep:s}=e;return(0,f.jsx)("nav",{className:"bg-white border-b border-gray-100 px-4 py-4 shadow-sm","aria-label":"Booking progress",role:"navigation",children:(0,f.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,f.jsxs)("div",{className:"md:hidden text-center",children:[(0,f.jsx)("div",{className:"flex items-center justify-center gap-2 mb-2",children:Iv.map((e,t)=>(0,f.jsxs)(a.Fragment,{children:[(0,f.jsx)("div",{role:"listitem","aria-current":s===e.number?"step":void 0,"aria-label":"Step ".concat(e.number,": ").concat(e.title).concat(s>e.number?" (completed)":s===e.number?" (current)":""),className:"w-8 h-8 rounded-full flex items-center justify-center transition-all duration-300 ".concat(s>e.number?"bg-green-600 text-white":s===e.number?"bg-[#BF212F] text-white shadow-lg":"bg-gray-200 text-gray-500"),children:s>e.number?(0,f.jsx)(zt.A,{className:"h-4 w-4"}):(0,f.jsx)(e.icon,{className:"h-4 w-4"})}),t<Iv.length-1&&(0,f.jsx)("div",{className:"w-8 h-0.5 transition-all duration-300 ".concat(s>e.number?"bg-green-600":"bg-gray-200")})]},e.number))}),(0,f.jsxs)("p",{className:"text-sm font-medium text-gray-700",children:["Step ",s," of ",Iv.length," \u2014 ",null===(t=Iv[s-1])||void 0===t?void 0:t.title]})]}),(0,f.jsx)("div",{className:"hidden md:flex items-center justify-between",role:"list","aria-label":"Booking steps",children:Iv.map((e,t)=>(0,f.jsxs)(a.Fragment,{children:[(0,f.jsxs)("div",{className:"flex flex-col items-center flex-1",role:"listitem","aria-current":s===e.number?"step":void 0,"aria-label":"Step ".concat(e.number,": ").concat(e.title).concat(s>e.number?" (completed)":s===e.number?" (current)":""),children:[(0,f.jsx)("div",{className:"w-10 h-10 rounded-full flex items-center justify-center text-base font-bold transition-all duration-300 ".concat(s>e.number?"bg-green-600 text-white shadow-md":s===e.number?"bg-[#BF212F] text-white shadow-lg scale-110":"bg-gray-200 text-gray-500"),children:s>e.number?(0,f.jsx)(zt.A,{className:"h-5 w-5"}):(0,f.jsx)(e.icon,{className:"h-5 w-5"})}),(0,f.jsx)("span",{className:"mt-2 text-sm font-medium text-center leading-tight ".concat(s>=e.number?"text-gray-800":"text-gray-600"),children:e.title})]}),t<Iv.length-1&&(0,f.jsx)("div",{className:"flex-1 h-0.5 mx-4 transition-all duration-500 ".concat(s>e.number?"bg-green-600":s===e.number?"bg-gradient-to-r from-[#BF212F] to-gray-200":"bg-gray-200")})]},e.number))})]})})};var Pv=s(73514);const Wv=["className"],Ov=["className"],Lv=["className"],Mv=Pv.bL,qv=a.forwardRef((e,t)=>{let{className:s}=e,a=(0,ot.A)(e,Wv);return(0,f.jsx)(Pv.B8,(0,m.A)({ref:t,className:(0,ct.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s)},a))});qv.displayName=Pv.B8.displayName;const Hv=a.forwardRef((e,t)=>{let{className:s}=e,a=(0,ot.A)(e,Ov);return(0,f.jsx)(Pv.l9,(0,m.A)({ref:t,className:(0,ct.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",s)},a))});Hv.displayName=Pv.l9.displayName;const Uv=a.forwardRef((e,t)=>{let{className:s}=e,a=(0,ot.A)(e,Lv);return(0,f.jsx)(Pv.UC,(0,m.A)({ref:t,className:(0,ct.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s)},a))});Uv.displayName=Pv.UC.displayName;const Gv={photography:{photography_essential:["Professional photographer","Ceremony & reception coverage","High-res edited photos","Online gallery","7-day delivery"],photography_premium:["Lead + second photographer","Ceremony, reception & prep coverage","High-res edited photos","Online gallery + USB","7-day delivery","Engagement session included"],photography_ultimate:["Lead + second photographer","Full day coverage (unlimited hours)","High-res edited photos","Premium album + USB + online gallery","7-day delivery","Engagement session + pre-wedding shoot"]},videography:{videography_essential:["Professional videographer","Ceremony & reception coverage","Highlight reel (3-5 min)","Full ceremony edit","14-day delivery"],videography_premium:["Lead + second videographer","Ceremony, reception & prep coverage","Cinematic highlight reel (5-8 min)","Full ceremony + speeches edit","14-day delivery","Drone footage (weather permitting)"],videography_ultimate:["Lead + second videographer","Full day coverage (unlimited hours)","Cinematic feature film (10-15 min)","Full ceremony + speeches + reception edit","14-day delivery","Drone footage + same-day edit"]},combined:{combined_essential:["Professional photographer + videographer","Ceremony & reception coverage","High-res edited photos + highlight reel","Online gallery","7-14 day delivery"],combined_premium:["Lead photographer + videographer team","Ceremony, reception & prep coverage","High-res photos + cinematic highlight reel","Online gallery + USB","7-14 day delivery","Drone footage (weather permitting)"],combined_ultimate:["Full photo + video team","Full day coverage (unlimited hours)","Premium album + cinematic feature film","Online gallery + USB + digital download","7-14 day delivery","Drone footage + engagement session + same-day edit"]}};const Vv=e=>
1{let{pkg:t,isSelected:s,onSelect:a}=e;const n=function(e){var t,s;const a=null===(t=e.category)||void 0===t?void 0:t.toLowerCase(),n=null===(s=e.type)||void 0===s?void 0:s.toLowerCase();return a&&n&&Gv[a]&&Gv[a][n]||[]}(t);return(0,f.jsxs)(rt.Zp,{className:"cursor-pointer transition-all duration-300 transform hover:scale-[1.02] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#BF212F] focus-visible:ring-offset-2 ".concat(s?"ring-3 ring-[#BF212F] bg-gradient-to-br from-rose-50 to-pink-50 border-rose-300 shadow-xl":t.popular?"border-rose-200 bg-white shadow-lg hover:shadow-xl ring-1 ring-rose-100":"border-gray-200 hover:border-rose-200 bg-white shadow-md hover:shadow-lg"),onClick:()=>a(t),tabIndex:0,role:"radio","aria-checked":s,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),a(t))},children:[t.popular&&(0,f.jsxs)("div",{className:"bg-[#BF212F] text-white text-xs font-bold text-center py-1.5 rounded-t-lg",children:[(0,f.jsx)(nt.A,{className:"h-3 w-3 inline mr-1"}),"MOST POPULAR"]}),(0,f.jsxs)(rt.Wu,{className:"p-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"text-xl font-bold text-gray-800 mb-1",children:t.name}),(0,f.jsx)("p",{className:"text-gray-600 text-sm",children:t.duration})]}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsxs)("div",{className:"text-2xl md:text-3xl font-bold text-[#BF212F]",children:["$",t.price]}),t.savings&&(0,f.jsx)(pt,{className:"bg-green-100 text-green-700 border-green-200 mt-1",children:t.savings})]})]}),n.length>0&&(0,f.jsx)("ul",{className:"space-y-2 mb-4",children:n.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start text-sm text-gray-700",children:[(0,f.jsx)(zt.A,{className:"h-4 w-4 text-green-600 mr-2 mt-0.5 flex-shrink-0"}),e]},t))}),(0,f.jsxs)("div",{className:"space-y-2",children:["Photography"===t.category&&(0,f.jsxs)("div",{className:"flex items-center text-gray-700",children:[(0,f.jsx)(Ue.A,{className:"h-5 w-5 mr-3 text-[#BF212F]"}),"Professional Photography"]}),"Videography"===t.category&&(0,f.jsxs)("div",{className:"flex items-center text-gray-700",children:[(0,f.jsx)(Ge.A,{className:"h-5 w-5 mr-3 text-[#BF212F]"}),"Professional Videography"]}),"Combined"===t.category&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"flex items-center text-gray-700",children:[(0,f.jsx)(Ue.A,{className:"h-5 w-5 mr-3 text-[#BF212F]"}),"Professional Photography"]}),(0,f.jsxs)("div",{className:"flex items-center text-gray-700",children:[(0,f.jsx)(Ge.A,{className:"h-5 w-5 mr-3 text-[#BF212F]"}),"Professional Videography"]})]}),(0,f.jsxs)("div",{className:"flex items-center text-gray-700",children:[(0,f.jsx)(Nt.A,{className:"h-5 w-5 mr-3 text-[#BF212F]"}),t.duration]})]}),s&&(0,f.jsx)("div",{className:"mt-6 flex items-center justify-center",children:(0,f.jsx)("div",{className:"bg-[#BF212F] rounded-full p-2 shadow-lg animate-in zoom-in duration-200",children:(0,f.jsx)(zt.A,{className:"h-5 w-5 text-white"})})})]})]})},Jv=()=>(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[1,2,3].map(e=>(0,f.jsx)(rt.Zp,{className:"border-gray-200 bg-white shadow-md",children:(0,f.jsxs)(rt.Wu,{className:"p-6 space-y-4",children:[(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Bv,{className:"h-6 w-40"}),(0,f.jsx)(Bv,{className:"h-4 w-24"})]}),(0,f.jsx)(Bv,{className:"h-10 w-20"})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsx)(Bv,{className:"h-4 w-full"}),(0,f.jsx)(Bv,{className:"h-4 w-full"}),(0,f.jsx)(Bv,{className:"h-4 w-3/4"})]})]})},e))}),Yv=()=>{const{selectedPackage:e,goNext:t,updateData:s}=(0,Dv.Bx)(),[n,r]=(0,a.useState)({photography:[],videography:[],combined:[]}),[i,o]=(0,a.useState)(e),[l,c]=(0,a.useState)("combined"),[d,m]=(0,a.useState)(!0),[p,x]=(0,a.useState)(null),u=async()=>{m(!0),x(null);try{const e=await fetch("".concat((0,I.wE)(),"/api/wedding-booking/packages"));if(!e.ok)throw new Error("Failed to load packages");const t=await e.json();if(!t.success)throw new Error("Failed to load packages");r(t.packages)}catch(e){x(e.message||"Failed to load packages. Please try again.")}finally{m(!1)}};(0,a.useEffect)(()=>{u()},[]);const g=e=>{o(e)},b=i?(i.price*Dv.KH).toFixed(2):null;return(0,f.jsxs)("div",{className:"space-y-8",role:"radiogroup","aria-label":"Wedding packages",children:[(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsxs)("div",{className:"flex items-center justify-center mb-4",children:[(0,f.jsx)(Wr.A,{className:"h-8 w-8 text-rose-500 mr-3"}),(0,f.jsx)("h2",{className:"text-3xl md:text-4xl font-bold text-gray-800",children:"Choose Your Perfect Package"})]}),(0,f.jsx)("p",{className:"text-gray-600 max-w-2xl mx-auto text-lg leading-relaxed",children:"Select the perfect package for your special day. All packages include professional equipment, experienced team, and fast delivery."})]}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-4 md:gap-8 text-sm font-medium text-gray-600",children:[(0,f.jsxs)("span",{className:"flex items-center",children:[(0,f.jsx)(nt.A,{className:"h-4 w-4 text-yellow-500 mr-1"})," 180+ Reviews"]}),(0,f.jsx)("span",{className:"hidden md:inline text-gray-300",children:"|"}),(0,f.jsxs)("span",{className:"flex items-center",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4 text-blue-500 mr-1"})," 7-Day Delivery"]}),(0,f.jsx)("span",{className:"hidden md:inline text-gray-300",children:"|"}),(0,f.jsxs)("span",{className:"flex items-center",children:[(0,f.jsx)(zt.A,{className:"h-4 w-4 text-green-600 mr-1"})," Fully Insured"]}),(0,f.jsx)("span",{className:"hidden md:inline text-gray-300",children:"|"}),(0,f.jsx)("span",{children:"Australia Wide"})]}
1),p&&!d&&(0,f.jsx)("div",{className:"max-w-md mx-auto",children:(0,f.jsx)(rt.Zp,{className:"border-red-200 bg-red-50",children:(0,f.jsxs)(rt.Wu,{className:"p-6 text-center",children:[(0,f.jsx)(h.A,{className:"h-10 w-10 text-red-500 mx-auto mb-3"}),(0,f.jsx)("p",{className:"text-red-700 font-medium mb-4",children:p}),(0,f.jsxs)(it.$,{onClick:u,variant:"outline",className:"border-red-300 text-red-700 hover:bg-red-100",children:[(0,f.jsx)(As.A,{className:"h-4 w-4 mr-2"}),"Try Again"]})]})})}),d&&(0,f.jsx)(Jv,{}),!d&&!p&&(0,f.jsxs)(Mv,{value:l,onValueChange:c,className:"space-y-6",children:[(0,f.jsx)("div",{className:"flex justify-center px-4",children:(0,f.jsxs)(qv,{className:"w-full max-w-lg bg-white rounded-2xl p-1.5 shadow-lg border border-gray-200 h-auto flex-wrap md:flex-nowrap",children:[(0,f.jsxs)(Hv,{value:"combined",className:"flex-1 rounded-xl px-4 py-3 text-sm font-semibold transition-all data-[state=active]:bg-[#BF212F] data-[state=active]:text-white data-[state=active]:shadow-lg",children:[(0,f.jsx)(fs.A,{className:"h-4 w-4 mr-2"}),"Combined",(0,f.jsx)(pt,{className:"ml-2 bg-yellow-100 text-yellow-700 text-xs hidden md:inline-flex",children:"Popular"})]}),(0,f.jsxs)(Hv,{value:"photography",className:"flex-1 rounded-xl px-4 py-3 text-sm font-semibold transition-all data-[state=active]:bg-[#BF212F] data-[state=active]:text-white data-[state=active]:shadow-lg",children:[(0,f.jsx)(Ue.A,{className:"h-4 w-4 mr-2"}),"Photo"]}),(0,f.jsxs)(Hv,{value:"videography",className:"flex-1 rounded-xl px-4 py-3 text-sm font-semibold transition-all data-[state=active]:bg-[#BF212F] data-[state=active]:text-white data-[state=active]:shadow-lg",children:[(0,f.jsx)(Ge.A,{className:"h-4 w-4 mr-2"}),"Video"]})]})}),["combined","photography","videography"].map(e=>{var t;return(0,f.jsx)(Uv,{value:e,children:(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:null===(t=n[e])||void 0===t?void 0:t.map(e=>(0,f.jsx)(Vv,{pkg:e,isSelected:(null===i||void 0===i?void 0:i.type)===e.type,onSelect:g},e.type))})},e)})]}),i&&(0,f.jsx)("div",{className:"fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 shadow-2xl p-4 z-50 animate-in slide-in-from-bottom duration-300",children:(0,f.jsxs)("div",{className:"max-w-4xl mx-auto flex items-center justify-between",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"font-bold text-gray-800",children:i.name}),(0,f.jsxs)("p",{className:"text-sm text-gray-600",children:["$",i.price," total \xb7 $",b," deposit"]})]}),(0,f.jsxs)(it.$,{onClick:()=>{i&&t({selectedPackage:i})},className:"bg-[#BF212F] hover:bg-red-700 text-white px-8 py-3 text-base rounded-xl shadow-lg font-semibold",children:["Continue",(0,f.jsx)(fs.A,{className:"ml-2 h-4 w-4"})]})]})}),i&&(0,f.jsx)("div",{className:"h-20"}),(0,f.jsxs)("div",{className:"bg-gradient-to-r from-rose-50 to-pink-50 rounded-2xl p-8 border border-rose-100",children:[(0,f.jsx)("h3",{className:"text-2xl font-bold text-gray-800 mb-6 text-center",children:"All Packages Include:"}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:["Fast Delivery (7-14 days)","Professional Equipment","Experienced Team","Fully Insured","Digital Delivery","No Watermarks","High Resolution","180+ Five-Star Reviews"].map(e=>(0,f.jsxs)("div",{className:"flex items-center text-gray-700",children:[(0,f.jsx)("div",{className:"bg-green-100 rounded-full p-2 mr-3",children:(0,f.jsx)(zt.A,{className:"h-4 w-4 text-green-700"})}),(0,f.jsx)("span",{className:"font-medium",children:e})]},e))})]})]})},Kv=(0,a.lazy)(()=>Promise.all([s.e(96),s.e(131)]).then(s.bind(s,70131))),Zv=(0,a.lazy)(()=>Promise.all([s.e(426),s.e(999)]).then(s.bind(s,38999))),$v=(0,a.lazy)(()=>s.e(801).then(s.bind(s,33801))),Qv=()=>(0,f.jsxs)("div",{className:"space-y-6 p-8",children:[(0,f.jsx)(Bv,{className:"h-10 w-64 mx-auto"}),(0,f.jsx)(Bv,{className:"h-6 w-96 mx-auto"}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,f.jsx)(Bv,{className:"h-48"}),(0,f.jsx)(Bv,{className:"h-48"})]})]}),Xv=()=>{const{currentStep:e,goBack:t,direction:s}=(0,Dv.Bx)(),n=(0,a.useRef)(null),r=(0,a.useRef)(e);(0,a.useEffect)(()=>{r.current!==e&&(window.scrollTo({top:0,behavior:"smooth"}),r.current=e)},[e]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"Book Wedding Photography | Turbo 360"}),(0,f.jsx)("meta",{name:"description",content:"Book your wedding photography and videography package with Turbo 360. Choose your package, enter your details, and secure your date online."}),(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"}),(0,f.jsx)("link",{rel:"canonical",href:"https://turbo.net.au/wedding-booking"})]}),(0,f.jsxs)("main",{className:"min-h-screen bg-gray-50",children:[(0,f.jsx)("header",{className:"bg-gradient-to-r from-rose-500 to-pink-500 px-4 py-6 shadow-lg",children:(0,f.jsx)("div",{className:"max-w-4xl mx-auto",children:(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-4",children:[e>1&&e<4&&(0,f.jsx)(it.$,{variant:"ghost",size:"sm",onClick:t,"aria-label":"Go back to previous step",className:"text-white hover:bg-white/20 rounded-full p-2",children:(0,f.jsx)(Ct.A,{className:"h-5 w-5"})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h1",{className:"text-2xl md:text-3xl font-bold text-white",children:"Wedding Booking"}),(0,f.jsx)("p",{className:"text-rose-100 text-sm md:text-base",children:"Secure your perfect day"})]})]}),(0,f.jsxs)("div",{className:"text-white/90 text-sm md:text-base font-medium",children:["Step ",e," of ",4]})]})})}),(0,f.jsx)(Rv,{currentStep:e}),(0,f.jsx)("section",{className:"flex-1 px-4 py-6 md:py-12",ref:n,children:(0,f.jsx)("div",{className:"max-w-4xl mx-auto",children:(0,f.jsx)("div",{className:"animate-in fade-in duration-300 ".concat("forward"===s?"slide-in-from-right-4":"slide-in-from-left-4"),children:(()=>{switch(e){case 1:default:return(0,f.jsx)(Yv,{});case 2:return(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)(Qv,{}),children:(0,f.jsx)(Kv,{})});case 3:return(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)(Qv,{}),children:(0,f.jsx)(Zv,{})});case 4:return(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)(Qv,{}),children:(0,f.jsx)($v,{})})}})()},e)})}),(0,f.jsx)("section",{className:"bg-white border-t border-gray-100 px-4 py-8",children:(0,f.jsxs)("div",{className:"max-w-4xl mx-auto text-sm text-gray-500 space-y-3",children:[(0,f.jsx)("h2",{className:"text-base font-semibold text-gray-700",children:"Book Your Wedding Photography Online"}),(0,f.jsx)("p",{children:"Secure your wedding photography and videography package with Turbo 360 in just a few steps. Choose from our range of professional wedding packages, enter your event details, review the terms and conditions, and complete your booking with a secure online payment. Our wedding photography packages cover ceremonies, receptions, and pre-wedding shoots across all Australian capital cities including Melbourne, Sydney, Brisbane, Perth, Adelaide, and beyond."}),(0,f.jsxs)("p",{children:["Every package includes professionally edited high-resolution photos delivered within seven business days, with video highlights delivered within fourteen business days. Combined photography and videography packages save over five hundred dollars compared to booking separately. Need to manage an existing booking? Visit the ",(0,f.jsx)("a",{href:"/wedding-booking-management",className:"text-rose-500 hover:text-rose-600 underline",children:"booking management page"})," to view your details."]})]})})]})]})},ej=()=>(0,f.jsx)(Dv.vl,{children:(0,f.jsx)(Xv,{})}),tj=()=>{var e;const[t,s]=(0,a.useState)(""),[n,r]=(0,a.useState)(null),[i,o]=(0,a.useState)(!1),[l,c]=(0,a.useState)("");(0,a.useEffect)(()=>{const e=new URLSearchParams(window.location.search).get("email");e&&(s(e),m(e))},[]);const m=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t;if(e.trim()){o(!0),c(""),r(null);try{const t=await fetch("".concat((0,I.wE)(),"/api/wedding-booking/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e.trim()})}),s=await t.json();s.success?r(s.booking):c(s.message||"No confirmed booking found for this email address.")}catch(s){c("Network error. Please check your connection and try again.")}finally{o(!1)}}else c("Please enter your email address")};return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(d.mg,{children:[(0,f.jsx)("title",{children:"Manage Wedding Booking | Turbo 360"}),(0,f.jsx)("meta",{name:"description",content:"View and manage your Turbo 360 wedding photography booking. Check your booking details, package, and payment status."}),(0,f.jsx)("meta",{name:"robots",content:"noindex, nofollow"}),(0,f.jsx)("link",{rel:"canonical",href:"https://turbo.net.au/wedding-booking-management"})]}),(0,f.jsxs)("main",{className:"min-h-screen bg-gradient-to-br from-rose-50 via-white to-pink-50",children:[(0,f.jsx)("header",{className:"bg-gradient-to-r from-rose-500 to-pink-500 px-4 py-12 shadow-lg",children:(0,f.jsxs)("div",{className:"max-w-4xl mx-auto text-center",children:[(0,f.jsxs)("div",{className:"flex items-center justify-center mb-4",children:[(0,f.jsx)(Wr.A,{className:"h-10 w-10 text-white mr-4"}),(0,f.jsx)("h1",{className:"text-4xl md:text-5xl font-bold text-white",children:"Manage Your Booking"})]}),(0,f.jsx)("p",{className:"text-xl text-rose-100 max-w-2xl mx-auto leading-relaxed",children:"Enter your email address to view and manage your wedding booking details"})]})}),(0,f.jsx)("section",{className:"px-4 py-12",children:(0,f.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,f.jsx)(rt.Zp,{className:"border-0 bg-white shadow-xl rounded-3xl mb-8 overflow-hidden",children:(0,f.jsx)(rt.Wu,{className:"p-8 md:p-12",children:(0,f.jsxs)("div",{className:"max-w-lg mx-auto",children:[(0,f.jsx)("h3",{className:"text-2xl font-bold text-gray-800 mb
1-6 text-center",children:"Find Your Booking"}),(0,f.jsx)("label",{className:"block text-sm font-semibold text-gray-700 mb-4",children:"Email Address Used for Booking"}),(0,f.jsxs)("div",{className:"flex flex-col md:flex-row gap-4",children:[(0,f.jsxs)("div",{className:"flex-1 relative",children:[(0,f.jsx)(T.A,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"email",value:t,onChange:e=>s(e.target.value),placeholder:"e.g., [email protected]",className:"w-full pl-12 pr-4 py-4 bg-white border-2 border-gray-200 rounded-xl text-gray-800 placeholder-gray-400 focus:outline-none focus:ring-4 focus:ring-rose-100 focus:border-rose-400 transition-all duration-300 text-lg",onKeyPress:e=>"Enter"===e.key&&m()})]}),(0,f.jsx)(it.$,{onClick:()=>m(),disabled:i,className:"bg-gradient-to-r from-rose-500 to-pink-500 hover:from-rose-600 hover:to-pink-600 text-white px-8 py-4 rounded-xl font-semibold transition-all duration-300 transform hover:scale-105 shadow-lg",children:i?(0,f.jsx)("div",{className:"animate-spin rounded-full h-5 w-5 border-2 border-white border-t-transparent"}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ds.A,{className:"h-5 w-5 mr-2"}),"Find Booking"]})})]}),l&&(0,f.jsx)("div",{className:"mt-4 p-4 bg-red-50 border-2 border-red-200 rounded-xl",children:(0,f.jsx)("p",{className:"text-red-600 font-medium",children:l})})]})})}),n&&(0,f.jsxs)("div",{className:"space-y-8",children:[(0,f.jsx)(rt.Zp,{className:"border-0 bg-gradient-to-r from-green-50 to-emerald-50 shadow-xl rounded-3xl overflow-hidden",children:(0,f.jsx)(rt.Wu,{className:"p-8",children:(0,f.jsxs)("div",{className:"flex items-center justify-center",children:[(0,f.jsx)("div",{className:"bg-green-100 rounded-full p-3 mr-4",children:(0,f.jsx)(p.A,{className:"h-8 w-8 text-green-600"})}),(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("h2",{className:"text-3xl font-bold text-gray-800",children:"Booking Confirmed!"}),(0,f.jsx)("p",{className:"text-green-600 font-semibold text-lg",children:"Your wedding photography and videography is secured"})]})]})})}),(0,f.jsx)(rt.Zp,{className:"border-0 bg-white shadow-xl rounded-3xl overflow-hidden",children:(0,f.jsxs)(rt.Wu,{className:"p-8 md:p-12",children:[(0,f.jsxs)("div",{className:"flex items-center mb-8",children:[(0,f.jsx)("div",{className:"bg-rose-100 rounded-full p-3 mr-4",children:(0,f.jsx)(kt.A,{className:"h-8 w-8 text-rose-600"})}),(0,f.jsx)("h3",{className:"text-3xl font-bold text-gray-800",children:"Booking Details"})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12",children:[(0,f.jsxs)("div",{className:"space-y-8",children:[(0,f.jsxs)("div",{className:"bg-gray-50 rounded-2xl p-6",children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-gray-500 mb-2",children:"Booking ID"}),(0,f.jsx)("p",{className:"text-gray-800 font-mono text-lg bg-white px-4 py-2 rounded-lg border",children:n.id})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-gray-500 mb-3",children:"Happy Couple"}),(0,f.jsxs)("div",{className:"flex items-center text-gray-800 bg-pink-50 rounded-2xl p-4",children:[(0,f.jsx)(fs.A,{className:"h-6 w-6 mr-3 text-rose-500"}),(0,f.jsxs)("span",{className:"text-xl font-semibold",children:[n.customer_name," & ",n.partner_name]})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-gray-500 mb-3",children:"Wedding Date"}),(0,f.jsxs)("div",{className:"flex items-center text-gray-800 bg-yellow-50 rounded-2xl p-4",children:[(0,f.jsx)(_t.A,{className:"h-6 w-6 mr-3 text-yellow-600"}),(0,f.jsx)("span",{className:"text-lg font-medium",children:new Date(n.wedding_date).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-gray-500 mb-3",children:"Wedding Location"}),(0,f.jsxs)("div",{className:"flex items-start text-gray-800 bg-blue-50 rounded-2xl p-4",children:[(0,f.jsx)(C.A,{className:"h-6 w-6 mr-3 text-blue-600 mt-1"}),(0,f.jsx)("span",{className:"text-lg font-medium",children:n.wedding_location})]})]})]}),(0,f.jsxs)("div",{className:"space-y-8",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-gray-500 mb-3",children:"Package"}),(0,f.jsx)("div",{className:"bg-purple-50 rounded-2xl p-4",children:(0,f.jsx)("p",{className:"text-gray-800 font-bold text-xl",children:null===(e=n.package_type)||void 0===e?void 0:e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())})})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-gray-500 mb-3",children:"Primary Contact"}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"flex items-center text-gray-800 bg-gray-50 rounded-xl p-3",children:[(0,f.jsx)(Ye.A,{className:"h-5 w-5 mr-3 text-gray-600"}),(0,f.jsx)("span",{className:"font-medium",children:n.customer_name})]}),(0,f.jsxs)("div",{className:"flex items-center text-gray-800 bg-gray-50 rounded-xl p-3",children:[(0,f.jsx)(T.A,{className:"h-5 w-5 mr-3 text-gray-600"}),(0,f.jsx)("span",{className:"font-medium",children:n.customer_email})]}),(0,f.jsx)("div",{className:"bg-gray-50 rounded-xl p-3",children:(0,f.jsx)("p",{className:"text-gray-600 font-medium",children:n.customer_mobile})})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-gray-500 mb-3",children:"Partner Contact"}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("div",{className:"flex items-center text-gray-800 bg-gray-50 rounded-xl p-3",children:[(0,f.jsx)(Ye.A,{className:"h-5 w-5 mr-3 text-gray-600"}),(0,f.jsx)("span",{className:"font-medium",children:n.partner_name})]}),(0,f.jsx)("div",{className:"bg-gray-50 rounded-xl p-3",children:(0,f.jsx)("p",{className:"text-gray-600 font-medium",children:n.partner_mobile})})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("p",{className:"text-sm font-semibold text-gray-500 mb-3",children:"Booking Status"}),(0,f.jsxs)("div",{className:"flex items-center bg-green-50 rounded-xl p-3",children:[(0,f.jsx)(p.A,{className:"h-5 w-5 mr-3 text-green-500"}),(0,f.jsx)("span",{className:"text-green-600 font-bold",children:"Confirmed"})]})]})]})]}),(0,f.jsxs)("div",{className:"mt-12 pt-8 border-t-2 border-gray-100",children:[(0,f.jsx)("h4",{className:"text-2xl font-bold text-gray-800 mb
1-6",children:"Payment Summary"}),(0,f.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-emerald-50 rounded-2xl p-6 border-2 border-green-200",children:[(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("p",{className:"text-gray-600 font-medium mb-2",children:"Total Package"}),(0,f.jsxs)("p",{className:"text-gray-800 font-bold text-2xl",children:["$",n.package_price]})]}),(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("p",{className:"text-green-600 font-medium mb-2",children:"Deposit Paid (25%)"}),(0,f.jsxs)("p",{className:"text-green-600 font-bold text-2xl",children:["$",n.deposit_amount]})]}),(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("p",{className:"text-yellow-600 font-medium mb-2",children:"Remaining Balance"}),(0,f.jsxs)("p",{className:"text-yellow-600 font-bold text-2xl",children:["$",(n.package_price-n.deposit_amount).toFixed(2)]})]})]}),(0,f.jsx)("p",{className:"text-center text-gray-500 font-medium mt-4",children:"* Remaining balance due 30 days before your wedding date"})]})]})]})}),(0,f.jsx)(rt.Zp,{className:"border-0 bg-white shadow-xl rounded-3xl overflow-hidden",children:(0,f.jsxs)(rt.Wu,{className:"p-8 md:p-12",children:[(0,f.jsxs)("div",{className:"flex items-center mb-8",children:[(0,f.jsx)("div",{className:"bg-blue-100 rounded-full p-3 mr-4",children:(0,f.jsx)(Nt.A,{className:"h-8 w-8 text-blue-600"})}),(0,f.jsx)("h3",{className:"text-3xl font-bold text-gray-800",children:"Complete Your Wedding Planning"})]}),(0,f.jsx)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 rounded-2xl p-8 mb-8 border-2 border-blue-200",children:(0,f.jsxs)("div",{className:"flex items-start",children:[(0,f.jsx)("div",{className:"bg-blue-100 rounded-full p-3 mr-6",children:(0,f.jsx)(kt.A,{className:"h-8 w-8 text-blue-600"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h4",{className:"text-2xl font-bold text-gray-800 mb-4",children:"Wedding Schedule Form"}),(0,f.jsx)("p",{className:"text-gray-700 text-lg mb-6 leading-relaxed",children:"Complete your detailed wedding timeline and preferences. This form has been pre-filled with your booking information to save you time."}),(0,f.jsxs)(it.$,{onClick:()=>{window.location.href="/weddingform"},className:"bg-gradient-to-r from-blue-500 to-indigo-500 hover:from-blue-600 hover:to-indigo-600 text-white px-8 py-4 rounded-xl font-semibold transition-all duration-300 transform hover:scale-105",children:["Complete Wedding Form",(0,f.jsx)(En.A,{className:"h-5 w-5 ml-2"})]})]})]})}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-green-50 to-emerald-50 rounded-2xl p-6 border-2 border-green-200",children:[(0,f.jsx)("h5",{className:"font-bold text-gray-800 text-xl mb-4",children:"What to Expect"}),(0,f.jsxs)("ul",{className:"text-gray-700 space-y-3",children:[(0,f.jsxs)("li",{className:"flex items-center",children:[(0,f.jsx)("span",{className:"w-2 h-2 bg-green-500 rounded-full mr-3"}),"Team contact closer to your date"]}),(0,f.jsxs)("li",{className:"flex items-center",children:[(0,f.jsx)("span",{className:"w-2 h-2 bg-green-500 rounded-full mr-3"}),"Final details confirmation"]}),(0,f.jsxs)("li",{className:"flex items-center",children:[(0,f.jsx)("span",{className:"w-2 h-2 bg-green-500 rounded-full mr-3"}),"Timeline review and adjustments"]}),(0,f.jsxs)("li",{className:"flex items-center",children:[(0,f.jsx)("span",{className:"w-2 h-2 bg-green-500 rounded-full mr-3"}),"Equipment and crew preparation"]})]})]}),(0,f.jsxs)("div",{className:"bg-gradient-to-r from-yellow-50 to-amber-50 rounded-2xl p-6 border-2 border-yellow-200",children:[(0,f.jsx)("h5",{className:"font-bold text-gray-800 text-xl mb-4",children:"Important Dates"}),(0,f.jsxs)("ul",{className:"text-gray-700 space-y-3",children:[(0,f.jsxs)("li",{className:"flex items-center",children:[(0,f.jsx)("span",{className:"w-2 h-2 bg-yellow-500 rounded-full mr-3"}),"Final payment: 30 days before wedding"]}),(0,f.jsxs)("li",{className:"flex items-center",children:[(0,f.jsx)("span",{className:"w-2 h-2 bg-yellow-500 rounded-full mr-3"}),"Timeline finalization: 2 weeks before"]}),(0,f.jsxs)("li",{className:"flex items-center",children:[(0,f.jsx)("span",{className:"w-2 h-2 bg-yellow-500 rounded-full mr-3"}),"Photos delivered: 7 days after"]}),(0,f.jsxs)("li",{className:"flex items-center",children:[(0,f.jsx)("span",{className:"w-2 h-2 bg-yellow-500 rounded-full mr-3"}),"Videos delivered: 14 days after"]})]})]})]})]})}),(0,f.jsx)(rt.Zp,{className:"border-0 bg-gradient-to-r from-rose-50 to-pink-50 shadow-xl rounded-3xl overflow-hidden",children:(0,f.jsxs)(rt.Wu,{className:"p-8 text-center",children:[(0,f.jsx)("h4",{className:"text-2xl font-bold text-gray-800 mb
1-4",children:"Questions About Your Booking?"}),(0,f.jsx)("p",{className:"text-gray-600 text-lg mb-6 max-w-2xl mx-auto",children:"Our team is here to help with any questions or changes to your booking."}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[(0,f.jsx)("a",{href:"tel:1300207446",className:"flex items-center justify-center px-8 py-4 bg-gradient-to-r from-rose-500 to-pink-500 hover:from-rose-600 hover:to-pink-600 rounded-xl text-white font-semibold transition-all duration-300 transform hover:scale-105 shadow-lg",children:"\ud83d\udcde 1300 207 446"}),(0,f.jsxs)("a",{href:"mailto:[email protected]",className:"flex items-center justify-center px-8 py-4 border-2 border-gray-300 hover:bg-gray-50 rounded-xl text-gray-700 font-semibold transition-all duration-300 transform hover:scale-105",children:[(0,f.jsx)(T.A,{className:"h-5 w-5 mr-2"}),"[email protected]"]})]})]})})]})]})}),(0,f.jsx)("section",{className:"bg-white border-t border-gray-100 px-4 py-8",children:(0,f.jsxs)("div",{className:"max-w-4xl mx-auto text-sm text-gray-500 space-y-3",children:[(0,f.jsx)("h2",{className:"text-base font-semibold text-gray-700",children:"Manage Your Wedding Photography Booking"}),(0,f.jsx)("p",{children:"View and manage your Turbo 360 wedding photography booking details using the email address you provided during checkout. Check your selected package, wedding date, payment status, and booking confirmation details all in one place. Our secure lookup ensures only the account holder can access booking information."}),(0,f.jsxs)("p",{children:["If you need to make changes to your booking, update your wedding date, or have questions about your package, please contact our wedding team directly at [email protected] or call 1300 207 446. Want to book a new package? Visit the ",(0,f.jsx)("a",{href:"/wedding-booking",className:"text-rose-500 hover:text-rose-600 underline",children:"wedding booking page"})," to get started with your photography and videography package selection."]})]})})]})]})},sj="'Space Mono',monospace",aj={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},nj={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},rj={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},ij={position:"fixed",inset:0,background:"rgba(10,10,11,.55)",display:"flex",alignItems:"center",justifyContent:"center",padding:16,zIndex:99999},oj=(0,m.A)((0,m.A)({},aj),{},{padding:24,width:"100%",boxShadow:"0 24px 60px rgba(10,10,11,.32)",maxHeight:"90vh",overflowY:"auto"}),lj={display:"flex",alignItems:"center",gap:8,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13.5,cursor:"pointer",whiteSpace:"nowrap"},cj={display:"flex",alignItems:"center",gap:8,background:"#0A0A0B",color:"#fff",border:"none",borderRadius:9,padding:"9px 15px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:12.5,cursor:"pointer",whiteSpace:"nowrap"},dj={background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"10px 16px",fontFamily:"'Hanken Grotesk',sans-serif",fontWeight:600,fontSize:13,color:"#333",cursor:"pointer"},mj=e=>({display:"flex",alignItems:"center",justifyContent:"center",width:34,height:34,borderRadius:8,background:"#F7F7F9",border:"1px solid #E4E4E9",color:e,cursor:"pointer"}),pj=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),[l,c]=(0,a.useState)(""),[d,x]=(0,a.useState)(!1),[u,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),[j,w]=(0,a.useState)(!1),[N,A]=(0,a.useState)(!1),[k,S]=(0,a.useState)(!1),[_,C]=(0,a.useState)(null),[F,E]=(0,a.useState)(null),[T,z]=(0,a.useState)([]),[B,D]=(0,a.useState)(""),[R,P]=(0,a.useState)(!1),[W,O]=(0,a.useState)(null),[L,M]=(0,a.useState)({event_name:"",event_date:"",start_time:"",download_fee_ex_gst:"",embed_code:""}),[q,H]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(0,o.cd)(e)&&U()},[e]);const U=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(I.fn,"/api/live-streams"),{headers:{Authorization:"Bearer ".concat(t)}});if(a.ok){const e=await a.json();s(e)}}catch(t){console.error("Error loading events:",t)}finally{i(!1)}},G=async e=>{try{var t;const s=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token,a=await fetch("".concat(I.fn,"/api/live-streams/").concat(e,"/purchases"),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const e=await a.json();z(e)}}
1catch(s){console.error("Error loading purchases:",s)}},V=t.filter(e=>e.event_name.toLowerCase().includes(l.toLowerCase())),J=e=>{if(!e)return"\u2014";try{return new Date(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric"})}catch(t){return e}},Y=()=>{x(!1),b(!1),M({event_name:"",event_date:"",start_time:"",download_fee_ex_gst:"",embed_code:""})};return(0,f.jsxs)(ta,{title:"Live Streams",meta:"MEDIA \xb7 STREAMS",action:{label:"Create Event",icon:ls.A,onClick:()=>x(!0)},children:[(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({display:"flex",alignItems:"center",gap:9},aj),{},{padding:"9px 13px",maxWidth:420,marginBottom:20}),children:[(0,f.jsx)(ds.A,{size:16,color:"#9A9AA0"}),(0,f.jsx)("input",{type:"text",placeholder:"Search events\u2026",value:l,onChange:e=>c(e.target.value),style:{border:"none",background:"transparent",outline:"none",fontSize:13.5,width:"100%",color:"#0A0A0B"}})]}),n?(0,f.jsx)(Ws,{rows:6}):0===V.length?(0,f.jsx)(Os,{icon:Ge.A,title:"No events found",message:l?"Try a different search term.":"Create your first live stream event.",actionLabel:"Create Event",onAction:()=>x(!0)}):(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill,minmax(320px,1fr))",gap:16},children:V.map(e=>{const t=(e=>{const t=.1*e,s=e+t;return{gst:t.toFixed(2),total:s.toFixed(2)}})(e.download_fee_ex_gst);return(0,f.jsxs)("div",{className:"tg-tile",style:(0,m.A)((0,m.A)({},aj),{},{padding:20,display:"flex",flexDirection:"column"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10,marginBottom:14},children:[(0,f.jsx)("h3",{className:"tg-ui",style:{margin:0,fontWeight:700,fontSize:16,letterSpacing:"-0.01em"},children:e.event_name}),(0,f.jsx)(Ds,{tone:e.delivered_at?"green":"amber",children:e.delivered_at?"Delivered":"Active"})]}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8,marginBottom:14},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:"#55555C"},children:[(0,f.jsx)(_t.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("span",{style:{fontFamily:sj,fontSize:12},children:J(e.event_date)})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:"#55555C"},children:[(0,f.jsx)(Nt.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("span",{style:{fontFamily:sj,fontSize:12},children:e.start_time})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[(0,f.jsxs)("span",{style:{fontFamily:sj,fontWeight:700,fontSize:15,color:"#0A0A0B"},children:["$",e.download_fee_ex_gst.toFixed(2)]}),(0,f.jsxs)("span",{style:{fontSize:12,color:"#9A9AA0"},children:["+ GST ($",t.total," total)"]})]})]}),(0,f.jsxs)("a",{href:"https://turbo.net.au/live/".concat(e.slug),target:"_blank",rel:"noopener noreferrer",className:"tg-mono",style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:11.5,color:"#BF212F",fontWeight:700,textDecoration:"none",marginBottom:16},children:["/live/",e.slug," ",(0,f.jsx)(En.A,{size:12})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:10,paddingTop:14,borderTop:"1px solid #EDEDF0",marginTop:"auto"},children:[(0,f.jsxs)("button",{onClick:()=>(e=>{E(e),G(e.id),w(!0)})(e),style:{display:"flex",alignItems:"center",gap:7,background:"none",border:"none",color:"#4338CA",fontSize:13,fontWeight:600,cursor:"pointer",padding:0,fontFamily:"'Hanken Grotesk',sans-serif"},children:[(0,f.jsx)(Xe.A,{size:15}),(0,f.jsx)("span",{children:"Purchases"})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,f.jsx)("button",{onClick:()=>(e=>{E(e),D(e.delivery_link||""),A(!0)})(e),style:mj("#15803D"),title:"Deliver Video",children:(0,f.jsx)(st.A,{size:15})}),(0,f.jsx)("button",{onClick:()=>(e=>{E(e),M({event_name:e.event_name,event_date:e.event_date,start_time:e.start_time,download_fee_ex_gst:e.download_fee_ex_gst.toString(),embed_code:e.embed_code}),b(!0)})(e),style:mj("#55555C"),title:"Edit",children:(0,f.jsx)(Tn.A,{size:15})}),(0,f.jsx)("button",{onClick:()=>{E(e),v(!0)},style:mj("#BF212F"),title:"Delete",children:(0,f.jsx)(la.A,{size:15})})]})]})]},e.id)})}),(d||u)&&(0,f.jsx)("div",{style:ij,children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},oj),{},{maxWidth:640}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:18},children:[(0,f.jsx)("h3",{className:"tg-ui",style:{margin:0,fontWeight:700,fontSize:18},children:d?"Create Event":"Edit Event"}),(0,f.jsx)("button",{onClick:Y,style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex"},children:(0,f.jsx)(g.A,{size:20})})]}),(0,f.jsxs)("form",{onSubmit:d?async e=>{e.preventDefault(),H(!0);try{var t;const e=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token;(await fetch("".concat(I.fn,"/api/live-streams"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify((0,m.A)((0,m.A)({},L),{},{download_fee_ex_gst:parseFloat(L.download_fee_ex_gst)}))}
1)).ok&&(await U(),x(!1),M({event_name:"",event_date:"",start_time:"",download_fee_ex_gst:"",embed_code:""}))}catch(s){console.error("Error creating event:",s)}finally{H(!1)}}:async e=>{e.preventDefault(),H(!0);try{var t;const e=null===(t=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===t?void 0:t.token;(await fetch("".concat(I.fn,"/api/live-streams/").concat(F.id),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify((0,m.A)((0,m.A)({},L),{},{download_fee_ex_gst:parseFloat(L.download_fee_ex_gst)}))})).ok&&(await U(),b(!1),E(null))}catch(s){console.error("Error updating event:",s)}finally{H(!1)}},style:{display:"flex",flexDirection:"column",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:nj,children:"Event Name *"}),(0,f.jsx)("input",{type:"text",required:!0,value:L.event_name,onChange:e=>M((0,m.A)((0,m.A)({},L),{},{event_name:e.target.value})),style:rj})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:nj,children:"Event Date *"}),(0,f.jsx)("input",{type:"date",required:!0,value:L.event_date,onChange:e=>M((0,m.A)((0,m.A)({},L),{},{event_date:e.target.value})),style:rj})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:nj,children:"Start Time *"}),(0,f.jsx)("input",{type:"time",required:!0,value:L.start_time,onChange:e=>M((0,m.A)((0,m.A)({},L),{},{start_time:e.target.value})),style:rj})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:nj,children:"Download Fee (ex GST) *"}),(0,f.jsxs)("div",{style:{position:"relative"},children:[(0,f.jsx)("span",{style:{position:"absolute",left:13,top:"50%",transform:"translateY(-50%)",color:"#9A9AA0",fontFamily:sj,fontSize:13},children:"$"}),(0,f.jsx)("input",{type:"number",required:!0,step:"0.01",min:"0",value:L.download_fee_ex_gst,onChange:e=>M((0,m.A)((0,m.A)({},L),{},{download_fee_ex_gst:e.target.value})),style:(0,m.A)((0,m.A)({},rj),{},{paddingLeft:26})})]}),L.download_fee_ex_gst&&(0,f.jsxs)("p",{className:"tg-mono",style:{marginTop:6,marginBottom:0,fontSize:11.5,color:"#9A9AA0"},children:["+ GST (10%): $",(.1*parseFloat(L.download_fee_ex_gst)).toFixed(2)," | Total: $",(1.1*parseFloat(L.download_fee_ex_gst)).toFixed(2)]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:nj,children:"Embed Code *"}),(0,f.jsx)("textarea",{required:!0,rows:"6",value:L.embed_code,onChange:e=>M((0,m.A)((0,m.A)({},L),{},{embed_code:e.target.value})),style:(0,m.A)((0,m.A)({},rj),{},{fontFamily:sj,fontSize:12,resize:"vertical"}),placeholder:"<div id='yololiv-widget-...'></div><script>...<\/script>"})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,paddingTop:4},children:[(0,f.jsx)("button",{type:"button",onClick:Y,style:dj,children:"Cancel"}),(0,f.jsx)("button",{type:"submit",disabled:q,style:(0,m.A)((0,m.A)({},lj),{},{opacity:q?.5:1}),children:q?"Saving\u2026":d?"Create":"Update"})]})]})]})}),y&&F&&(0,f.jsx)("div",{style:ij,children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},oj),{},{maxWidth:440}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,f.jsx)("h3",{className:"tg-ui",style:{margin:0,fontWeight:700,fontSize:18,color:"#991B1B"},children:"Delete Event"}),(0,f.jsx)("button",{onClick:()=>{v(!1),E(null)},style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex"},children:(0,f.jsx)(g.A,{size:20})})]}),(0,f.jsxs)("div",{style:{marginBottom:20},children:[(0,f.jsx)("div",{style:{background:"#FEE2E2",border:"1px solid #FECACA",borderRadius:10,padding:14,marginBottom:14},children:(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,f.jsx)(h.A,{size:18,color:"#991B1B",style:{marginTop:1,flexShrink:0}}),(0,f.jsxs)("div",{style:{fontSize:13,color:"#991B1B"},children:[(0,f.jsx)("p",{style:{margin:"0 0 4px",fontWeight:700},children:"Warning:"}),(0,f.jsx)("p",{style:{margin:0},children:"This will permanently delete the event and all associated purchases."})]})]})}),(0,f.jsxs)("p",{style:{margin:0,fontSize:13,color:"#55555C"},children:["Are you sure you want to delete ",(0,f.jsx)("strong",{children:F.event_name}),"?"]})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[(0,f.jsx)("button",{onClick:()=>{v(!1),E(null)},style:dj,children:"Cancel"}),(0,f.jsx)("button",{onClick:async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token;(await fetch("".concat(I.fn,"/api/live-streams/").concat(F.id),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}})).ok&&(await U(),v(!1),E(null))}catch(t){console.error("Error deleting event:",t)}},style:(0,m.A)((0,m.A)({},lj),{},{background:"#BF212F"}),children:"Delete"})]})]})}),j&&F&&(0,f.jsx)("div",{style:ij,children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},oj),{},{maxWidth:920,padding:0}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"20px 24px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsxs)("h3",{className:"tg-ui",style:{margin:0,fontWeight:700,fontSize:18},children:["Purchases \u2014 ",F.event_name]}),(0,f.jsx)("button",{onClick:()=>{w(!1),E(null),z([])},style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex"},children:(0,f.jsx)(g.A,{size:20})})]}),0===T.length?(0,f.jsx)("div",{style:{padding:"40px 24px"},children:(0,f.jsx)(Os,{icon:Xe.A,title:"No purchases yet",message:"Purchases for this event will appear here."})}):(0,f.jsx)("div",{style:{overflowX:"auto",padding:"4px 0 8px"},children:(0,f.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse"},children:[(0,f.jsx)("thead",{children:(0,f.jsx)("tr",{style:{background:"#FBFBFC",borderBottom:"1px solid #EDEDF0"},children:["Customer","Email","Mobile","Amount","Status","Delivered","A
1ctions"].map(e=>(0,f.jsx)("th",{className:"tg-mono",style:{padding:"11px 16px",textAlign:"left",fontSize:10,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",fontWeight:700,whiteSpace:"nowrap"},children:e},e))})}),(0,f.jsx)("tbody",{children:T.map(e=>(0,f.jsxs)("tr",{className:"tg-row",style:{borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsx)("td",{style:{padding:"13px 16px",fontSize:13.5,fontWeight:600,color:"#0A0A0B",whiteSpace:"nowrap"},children:e.customer_name}),(0,f.jsx)("td",{style:{padding:"13px 16px",fontSize:13,color:"#55555C"},children:e.customer_email}),(0,f.jsx)("td",{style:{padding:"13px 16px",fontFamily:sj,fontSize:12,color:"#55555C",whiteSpace:"nowrap"},children:e.customer_mobile}),(0,f.jsxs)("td",{style:{padding:"13px 16px",fontFamily:sj,fontSize:13,fontWeight:700,color:"#0A0A0B",whiteSpace:"nowrap"},children:["$",e.total_amount.toFixed(2)]}),(0,f.jsx)("td",{style:{padding:"13px 16px"},children:(0,f.jsx)(Ds,{tone:"succeeded"===e.payment_status?"green":"pending"===e.payment_status?"amber":"danger",children:e.payment_status})}),(0,f.jsx)("td",{style:{padding:"13px 16px"},children:e.video_delivered?(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,f.jsx)(zt.A,{size:16,color:"#15803D"}),(0,f.jsx)("span",{className:"tg-mono",style:{fontSize:11,color:"#9A9AA0"},children:e.video_delivered_at&&new Date(e.video_delivered_at).toLocaleDateString("en-AU",{day:"2-digit",month:"short"})})]}):(0,f.jsx)(g.A,{size:16,color:"#B5B5BC"})}),(0,f.jsx)("td",{style:{padding:"13px 16px"},children:"succeeded"===e.payment_status&&(0,f.jsxs)("button",{onClick:()=>{C(e),D(""),S(!0)},style:{display:"flex",alignItems:"center",gap:6,background:"none",border:"none",color:"#4338CA",fontSize:13,fontWeight:600,cursor:"pointer",padding:0,fontFamily:"'Hanken Grotesk',sans-serif"},title:"Send video to this customer",children:[(0,f.jsx)(st.A,{size:15}),(0,f.jsx)("span",{children:"Send"})]})})]},e.id))})]})})]})}),N&&F&&(0,f.jsx)("div",{style:ij,children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},oj),{},{maxWidth:440}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,f.jsx)("h3",{className:"tg-ui",style:{margin:0,fontWeight:700,fontSize:18},children:"Deliver Video to All"}),(0,f.jsx)("button",{onClick:()=>{A(!1),E(null),D(""),O(null)},style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex"},children:(0,f.jsx)(g.A,{size:20})})]}),W?(0,f.jsx)("div",{style:{background:"#DCFCE7",border:"1px solid #BBF7D0",borderRadius:10,padding:14},children:(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:8},children:[(0,f.jsx)(p.A,{size:18,color:"#15803D",style:{marginTop:1,flexShrink:0}}),(0,f.jsxs)("div",{style:{fontSize:13,color:"#15803D"},children:[(0,f.jsx)("p",{style:{margin:"0 0 8px",fontWeight:700},children:"Video Delivered Successfully!"}),(0,f.jsxs)("p",{style:{margin:0},children:["Emails sent: ",W.emails_sent]}),(0,f.jsxs)("p",{style:{margin:0},children:["SMS sent: ",W.sms_sent]})]})]})}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{marginBottom:20},children:[(0,f.jsx)("p",{style:{margin:"0 0 14px",fontSize:13,color:"#55555C"},children:"Enter the video download link. This will be sent via email and SMS to all purchasers."}),(0,f.jsx)("label",{style:nj,children:"Download Link"}),(0,f.jsx)("input",{type:"url",required:!0,value:B,onChange:e=>D(e.target.value),placeholder:"https://\u2026",style:rj})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[(0,f.jsx)("button",{onClick:()=>{A(!1),E(null),D("")},style:dj,children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{if(B.trim()){P(!0),O(null);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/live-streams/").concat(F.id,"/deliver"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({delivery_link:B})});if(s.ok){const e=await s.json();O(e.results),await U(),setTimeout(()=>{A(!1),D(""),O(null)},3e3)}}catch(t){console.error("Error delivering video:",t)}finally{P(!1)}}},disabled:R||!B.trim(),style:(0,m.A)((0,m.A)({},cj),{},{padding:"10px 16px",fontSize:13,opacity:R||!B.trim()?.5:1}),children:[(0,f.jsx)(st.A,{size:15}),(0,f.jsx)("span",{children:R?"Sending\u2026":"Send to All"})]})]})]})]})}),k&&_&&(0,f.jsx)("div",{style:ij,children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},oj),{},{maxWidth:440}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16},children:[(0,f.jsx)("h3",{className:"tg-ui",style:{margin:0,fontWeight:700,fontSize:18},children:"Send Video to Customer"}),(0,f.jsx)("button",{onClick:()=>{S(!1),C(null),D(""),O(null)},style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex"},children:(0,f.jsx)(g.A,{size:20})})]}),W?(0,f.jsx)("div",{style:{background:"#DCFCE7",border:"1px solid #BBF7D0",borderRadius:10,padding:14},children:(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",ga
1p:8},children:[(0,f.jsx)(p.A,{size:18,color:"#15803D",style:{marginTop:1,flexShrink:0}}),(0,f.jsxs)("div",{style:{fontSize:13,color:"#15803D"},children:[(0,f.jsx)("p",{style:{margin:"0 0 8px",fontWeight:700},children:"Video Sent Successfully!"}),(0,f.jsxs)("p",{style:{margin:0},children:["Email sent: ",W.emails_sent>0?"Yes":"No"]}),(0,f.jsxs)("p",{style:{margin:0},children:["SMS sent: ",W.sms_sent>0?"Yes":"No"]})]})]})}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{marginBottom:20},children:[(0,f.jsxs)("div",{style:{background:"#EEF2FF",border:"1px solid #E0E7FF",borderRadius:10,padding:12,marginBottom:14},children:[(0,f.jsx)("p",{style:{margin:"0 0 4px",fontSize:13,fontWeight:700,color:"#312E81"},children:_.customer_name}),(0,f.jsx)("p",{className:"tg-mono",style:{margin:0,fontSize:11.5,color:"#4338CA"},children:_.customer_email}),(0,f.jsx)("p",{className:"tg-mono",style:{margin:0,fontSize:11.5,color:"#4338CA"},children:_.customer_mobile})]}),(0,f.jsx)("p",{style:{margin:"0 0 14px",fontSize:13,color:"#55555C"},children:"Send the video download link to this customer via email and SMS."}),(0,f.jsx)("label",{style:nj,children:"Download Link"}),(0,f.jsx)("input",{type:"url",required:!0,value:B,onChange:e=>D(e.target.value),placeholder:"https://\u2026",style:rj})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10},children:[(0,f.jsx)("button",{onClick:()=>{S(!1),C(null),D("")},style:dj,children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{if(B.trim()){P(!0),O(null);try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/live-streams/purchase/").concat(_.id,"/deliver"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({delivery_link:B})});if(s.ok){const e=await s.json();O({emails_sent:e.email_sent?1:0,sms_sent:e.sms_sent?1:0}),await G(F.id),setTimeout(()=>{S(!1),C(null),D(""),O(null)},3e3)}}catch(t){console.error("Error delivering video to individual:",t)}finally{P(!1)}}},disabled:R||!B.trim(),style:(0,m.A)((0,m.A)({},cj),{},{padding:"10px 16px",fontSize:13,opacity:R||!B.trim()?.5:1}),children:[(0,f.jsx)(st.A,{size:15}),(0,f.jsx)("span",{children:R?"Sending\u2026":"Send Now"})]})]})]})]})})]})};var xj=s(51419),hj=s(69677);const uj=e=>{let{event:t,onSuccess:s,onCancel:n}=e;const r=(0,Bc.t2)(),i=(0,Bc.HH)(),[o,l]=(0,a.useState)({customer_name:"",customer_email:"",customer_mobile:""}),[c,d]=(0,a.useState)(!1),[p,x]=(0,a.useState)("");return(0,f.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),r&&i){d(!0),x("");try{console.log("Calling purchase API:","".concat(I.fn,"/api/live-streams/").concat(t.id,"/purchase"));const e=await fetch("".concat(I.fn,"/api/live-streams/").concat(t.id,"/purchase"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event_id:t.id,customer_name:o.customer_name,customer_email:o.customer_email,customer_mobile:o.customer_mobile})});let n;const l=e.headers.get("content-type");if(!l||!l.includes("application/json")){const t=await e.text();throw console.error("Non-JSON response:",t.substring(0,200)),new Error("Server returned an invalid response. Please try again.")}if(n=await e.json(),!e.ok)throw new Error(n.detail||"Failed to create purchase");const{error:c,paymentIntent:m}=await r.confirmCardPayment(n.client_secret,{payment_method:{card:i.getElement(Bc.hA),billing_details:{name:o.customer_name,email:o.customer_email,phone:o.customer_mobile}}});if(c)x(c.message),d(!1);else if("succeeded"===m.status){await new Promise(e=>setTimeout(e,2e3));try{const e=await fetch("".concat(I.fn,"/api/live-streams/purchase/").concat(n.purchase_id,"/status"));if(e.ok){const t=await e.json();console.log("Payment status:",t.payment_status)}}catch(a){console.warn("Could not verify payment status:",a)}s()}}catch(a){x(a.message||"Payment failed. Please try again."),d(!1)}}},className:"space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Full Name *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(Ye.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",required:!0,value:o.customer_name,onChange:e=>l((0,m.A)((0,m.A)({},o),{},{customer_name:e.target.value})),className:"w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",placeholder:"John Smith"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email Address *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(T.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"email",required:!0,value:o.customer_email,onChange:e=>l((0,m.A)((0,m.A)({},o),{},{customer_email:e.target.value})),className:"w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",placeholder:"[email protected]"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Mobile Number *"}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(E.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),(0,f.jsx)("input",{type:"tel",required:!0,value:o.customer_mobile,onChange:e=>l((0,m.A)((0,m.A)({},o),{},{customer_mobile:e.target.value})),className:"w-full pl-10 pr-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",placeholder:"0400 000 000"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Card Details *"}),(0,f.jsx)("div",{className:"border border-gray-300 rounded-lg p-3 bg-white",children:(0,f.jsx)(Bc.hA,{options:{style:{base
1:{fontSize:"16px",color:"#424770","::placeholder":{color:"#aab7c4"}},invalid:{color:"#9e2146"}}}})})]}),p&&(0,f.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3 text-sm text-red-700",children:p}),(0,f.jsx)("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4",children:(0,f.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-600",children:"Amount (ex GST):"}),(0,f.jsxs)("span",{className:"font-medium",children:["$",t.pricing.amount_ex_gst.toFixed(2)]})]}),(0,f.jsxs)("div",{className:"flex justify-between",children:[(0,f.jsx)("span",{className:"text-gray-600",children:"GST (10%):"}),(0,f.jsxs)("span",{className:"font-medium",children:["$",t.pricing.gst_amount.toFixed(2)]})]}),(0,f.jsxs)("div",{className:"flex justify-between pt-2 border-t border-gray-300",children:[(0,f.jsx)("span",{className:"font-bold text-gray-900",children:"Total:"}),(0,f.jsxs)("span",{className:"font-bold text-lg text-purple-600",children:["$",t.pricing.total_amount.toFixed(2)]})]})]})}),(0,f.jsxs)("div",{className:"flex justify-end space-x-3 pt-4",children:[(0,f.jsx)("button",{type:"button",onClick:n,disabled:c,className:"px-6 py-2 bg-gray-200 hover:bg-gray-300 disabled:opacity-50 text-gray-800 rounded-lg font-medium transition-colors",children:"Cancel"}),(0,f.jsxs)("button",{type:"submit",disabled:!r||c,className:"px-6 py-2 bg-purple-600 hover:bg-purple-700 disabled:opacity-50 text-white rounded-lg font-medium transition-colors flex items-center space-x-2",children:[(0,f.jsx)(Dc.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{children:c?"Processing...":"Complete Purchase"})]})]})]})},gj=()=>{const{slug:e}=(0,r.g)(),[t,s]=(0,a.useState)(null),[n,i]=(0,a.useState)(null),[o,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)(!1),[m,x]=(0,a.useState)(!1),[h,u]=(0,a.useState)(""),b=a.useRef(null);(0,a.useEffect)(()=>{y()},[e]),(0,a.useEffect)(()=>{if(t&&t.embed_code&&b.current){b.current.innerHTML="";const e=document.createElement("div");for(e.innerHTML=t.embed_code;e.firstChild;)b.current.appendChild(e.firstChild);b.current.querySelectorAll("script").forEach(e=>{const t=document.createElement("script");Array.from(e.attributes).forEach(e=>{t.setAttribute(e.name,e.value)}),e.src?t.src=e.src:t.textContent=e.textContent,e.parentNode.replaceChild(t,e)})}},[t]);const y=async()=>{try{const t=await fetch("".concat(I.fn,"/api/live-streams/public/").concat(e));if(!t.ok)return 404===t.status?u("Event not found"):u("Failed to load event"),void l(!1);const a=await t.json();s(a),a.stripe_publishable_key&&i((0,hj.loadStripe)(a.stripe_publishable_key))}catch(t){u("Failed to load event")}finally{l(!1)}};return o?(0,f.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-purple-50 via-white to-indigo-50 flex items-center justify-center",children:(0,f.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-purple-600"})}):h?(0,f.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-purple-50 via-white to-indigo-50 flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-8 max-w-md w-full text-center",children:[(0,f.jsx)(Ge.A,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),(0,f.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Event Not Found"}),(0,f.jsx)("p",{className:"text-gray-600",children:h})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-purple-50 via-white to-indigo-50",children:[(0,f.jsx)("div",{className:"bg-white border-b border-gray-200 shadow-sm",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:(0,f.jsx)("div",{className:"flex items-center justify-between",children:(0,f.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,f.jsx)("img",{src:"https://turbo.net.au/turbo-360-logo.png",alt:"Turbo 360",className:"h-12"}),(0,f.jsx)("div",{className:"h-8 w-px bg-gray-300"}),(0,f.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:"Live Stream"})]})})})}),(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:(0,f.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[(0,f.jsx)("div",{className:"lg:col-span-2",children:(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-xl overflow-hidden",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-purple-600 to-indigo-600 px-6 py-4",children:[(0,f.jsx)("h2",{className:"text-2xl font-bold text-white",children:t.event_name}),(0,f.jsxs)("div",{className:"flex items-center space-x-4 mt-2 text-purple-100",children:[(0,f.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,f.jsx)(_t.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"text-sm",children:new Date(t.event_date).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]}),(0,f.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,f.jsx)(Nt.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"text-sm",children:t.start_time})]})]})]}),(0,f.jsx)("div",{className:"relative bg-black aspect-video",children:(0,f.jsx)("div",{ref:b,className:"absolute inset-0 w-full h-full"})}),(0,f.jsx)("div",{className:"p-6",children:(0,f.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:(0,f.jsxs)("p",{className:"text-sm text-blue-900",children:[(0,f.jsx)("strong",{children:"\ud83d\udcf9 Note:"})," This is a live stream event. The video will be available for viewing during the scheduled time."]})})})]})}),(0,f.jsx)("div",{className:"lg:col-span-1",children:(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-xl overflow-hidden sticky top-8",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-green-600 to-emerald-600 px-6 py-8 text-center",children:[(0,f.jsx)("div",{className:"flex items-center justify-center mb-2",children:(0,f.jsx)(Ge.A,{className:"h-8 w-8 text-white"})}),(0,f.jsx)("h3",{className:"text-white text-lg font-medium mb-4",children:"Order Event Video"}),(0,f.jsxs)("div",{className:"text-white",children:[(0,f.jsxs)("div",{className:"text-3xl font-bold mb-1",children:["$",t.pricing.total_amount.toFixed(2)]}),(0,f.jsxs)("div",{className:"text-green-100 text-sm",children:["$",t.pricing.amount_ex_gst.toFixed(2)," + GST"]})]})]}),(0,f.jsxs)("div",{className:"p-6 space-y-4",children:[(0,f.jsxs)("div",{className:"bg-purple-50 border border-purple-200 rounded-lg p-4",children:[(0,f.jsx)("h4",{className:"font-semibold text-purple-900 mb-2",children:"What's Included:"}),(0,f.jsxs)("ul",{className:"space-y-2 text-sm text-purple-800",children:[(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 mr-2 mt
1-0.5 flex-shrink-0"}),(0,f.jsx)("span",{children:"Full event video download"})]}),(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 mr-2 mt-0.5 flex-shrink-0"}),(0,f.jsx)("span",{children:"High-quality video file"})]}),(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 mr-2 mt-0.5 flex-shrink-0"}),(0,f.jsx)("span",{children:"Delivered via email & SMS"})]}),(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 mr-2 mt-0.5 flex-shrink-0"}),(0,f.jsx)("span",{children:"Available within 72 hours after broadcast"})]})]})]}),(0,f.jsxs)("button",{onClick:()=>d(!0),className:"w-full bg-purple-600 hover:bg-purple-700 text-white py-4 rounded-lg font-bold text-lg transition-colors flex items-center justify-center space-x-2 shadow-lg hover:shadow-xl",children:[(0,f.jsx)(xj.A,{className:"h-5 w-5"}),(0,f.jsx)("span",{children:"Order Video Now"})]}),(0,f.jsx)("div",{className:"text-center text-xs text-gray-500",children:"Secure payment powered by Stripe"})]})]})})]})}),c&&n&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4",style:{zIndex:999999},children:(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-2xl w-full max-w-lg max-h-[90vh] overflow-y-auto",style:{zIndex:1e6},children:[(0,f.jsxs)("div",{className:"sticky top-0 bg-gradient-to-r from-purple-600 to-indigo-600 px-6 py-4 flex items-center justify-between",children:[(0,f.jsx)("h3",{className:"text-xl font-bold text-white",children:"Complete Your Order"}),(0,f.jsx)("button",{onClick:()=>d(!1),className:"text-white hover:text-gray-200 transition-colors",children:(0,f.jsx)(g.A,{className:"h-6 w-6"})})]}),(0,f.jsxs)("div",{className:"p-6",children:[(0,f.jsxs)("div",{className:"mb-6 pb-6 border-b border-gray-200",children:[(0,f.jsx)("h4",{className:"font-semibold text-gray-900 mb-2",children:t.event_name}),(0,f.jsx)("p",{className:"text-sm text-gray-600",children:new Date(t.event_date).toLocaleDateString("en-AU",{year:"numeric",month:"long",day:"numeric"})})]}),(0,f.jsx)(Bc.S8,{stripe:n,children:(0,f.jsx)(uj,{event:t,onSuccess:()=>{d(!1),x(!0)},onCancel:()=>d(!1)})})]})]})}),m&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4",style:{zIndex:999999},children:(0,f.jsx)("div",{className:"bg-white rounded-xl shadow-2xl w-full max-w-md",style:{zIndex:1e6},children:(0,f.jsxs)("div",{className:"p-8 text-center",children:[(0,f.jsx)("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:(0,f.jsx)(p.A,{className:"h-10 w-10 text-green-600"})}),(0,f.jsx)("h3",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Order Confirmed!"}),(0,f.jsx)("p",{className:"text-gray-600 mb-6",children:"Thank you for your order! You'll receive a confirmation email shortly. Your video download will be delivered via email and SMS within 72 hours following the event broadcast."}),(0,f.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6 text-sm text-blue-900 text-left",children:[(0,f.jsx)("p",{className:"font-medium mb-2",children:"What happens next:"}),(0,f.jsxs)("ul",{className:"space-y-1 list-disc list-inside",children:[(0,f.jsx)("li",{children:"Check your email for order confirmation"}),(0,f.jsx)("li",{children:"Video will be processed after the event"}),(0,f.jsx)("li",{children:"Download link sent within 72 hours"}),(0,f.jsx)("li",{children:"Check spam folder if you don't see it"})]})]}),(0,f.jsx)("button",{onClick:()=>x(!1),className:"w-full bg-purple-600 hover:bg-purple-700 text-white py-3 rounded-lg font-semibold transition-colors",children:"Close"})]})})}),(0,f.jsx)("div",{className:"bg-white border-t border-gray-200 mt-12",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6",children:(0,f.jsxs)("div",{className:"text-center text-sm text-gray-600",children:[(0,f.jsx)("p",{className:"mb-1",children:"Turbo Productions PTY LTD | ABN 18 150 556 102"}),(0,f.jsxs)("p",{children:["Email: ",(0,f.jsx)("a",{href:"mailto:[email protected]",className:"text-purple-600 hover:text-purple-700",children:"[email protected]"})]})]})})})]})};const fj=()=>{const[e,t]=(0,a.useState)(0);(0,a.useEffect)(()=>{const e=e=>{var s;return t((null===(s=e.detail)||void 0===s?void 0:s.count)||0)};return document.addEventListener("turbo-chat:unread-update",e),()=>document.removeEventListener("turbo-chat:unread-update",e)},[]);return(0,f.jsx)("div",{className:"fixed bottom-0 right-0 z-[100000] flex items-center px-4",style:{height:"40px"},children:(0,f.jsxs)("button",{onClick:()=>
1{window.TurboChat&&(window.TurboChat.toggle(),t(0))},className:"relative flex items-center gap-2 px-4 py-1.5 rounded-md bg-gray-900 hover:bg-gray-800 transition-colors duration-200 cursor-pointer",children:[(0,f.jsx)(Xa.A,{className:"w-3.5 h-3.5 text-white"}),(0,f.jsx)("span",{className:"text-xs font-bold text-white",children:"Live Chat Support"}),e>0&&(0,f.jsx)("span",{className:"absolute -top-2 -right-2 min-w-[18px] h-[18px] flex items-center justify-center rounded-full bg-red-500 text-white text-[10px] font-semibold px-1 border-2 border-white animate-bounce",children:e>9?"9+":e})]})})};var bj=s(94805),yj=s(87978),vj=s(20059);const jj="'Space Mono',monospace",wj={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Nj={background:"#141416",border:"1px solid #262629",borderRadius:14},Aj={completed:"#34D399",error:"#F87171",paused:"#F2A900",uploading:"#F2A900",pending:"#55555C"},kj={completed:"green",error:"danger",paused:"amber",uploading:"blue",pending:"gray"},Sj=()=>{var e;const[t,s]=(0,a.useState)({}),[n,r]=(0,a.useState)(!1),[i,o]=(0,a.useState)(null),[l,c]=(0,a.useState)([]),[d,x]=(0,a.useState)(!1),[u,b]=(0,a.useState)({}),[y,v]=(0,a.useState)(!1),[j,w]=(0,a.useState)(null),[N,A]=(0,a.useState)(null),[k,S]=(0,a.useState)(!1),[_,C]=(0,a.useState)(null),[F,E]=(0,a.useState)(null),[T,z]=(0,a.useState)(null),[B,D]=(0,a.useState)(null),R=(0,a.useRef)(null),P=(0,a.useRef)(null),W=(0,I.wE)(),O=e=>{if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["B","KB","MB","GB","TB"][t]},L=e=>e&&0!==e?O(e)+"/s":"-",M=e=>{if(!e)return"-";const t=new Date(e),s=new Date,a=Math.floor((s-t)/1e3);if(a<60)return"".concat(a,"s");const n=Math.floor(a/60),r=a%60;if(n<60)return"".concat(n,"m ").concat(r,"s");const i=Math.floor(n/60),o=n%60;return"".concat(i,"h ").concat(o,"m")},q=()=>{const e=W.replace("https://","wss://").replace("http://","ws://");try{R.current=new WebSocket("".concat(e,"/ws/uploads")),R.current.onopen=()=>{console.log("WebSocket connected"),r(!0),o(null)},R.current.onmessage=e=>{try{const t=JSON.parse(e.data);if("session_update"===t.type||"initial"===t.type){const e={};Array.isArray(t.sessions)?t.sessions.forEach(t=>{e[t.session_id]=t}):t.sessions&&Object.assign(e,t.sessions),s(e)}}catch(t){console.error("Failed to parse WebSocket message:",t)}},R.current.onclose=()=>{console.log("WebSocket disconnected"),r(!1),P.current=setTimeout(q,3e3)},R.current.onerror=e=>{console.error("WebSocket error:",e),o("Connection error"),r(!1)}}catch(t){console.error("Failed to connect WebSocket:",t),o("Failed to connect"),P.current=setTimeout(q,5e3)}},H=async()=>{try{const e=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}"),t=await fetch("".concat(W,"/api/crew-upload/active"),{headers:{Authorization:"Bearer ".concat((null===e||void 0===e?void 0:e.token)||"")}});if(t.ok){const e=await t.json(),a={};Array.isArray(e.sessions)&&e.sessions.forEach(e=>{a[e.session_id]=e}),s(a)}}catch(e){console.error("Failed to fetch active sessions:",e)}},U=async()=>{x(!0);try{const e=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}"),t=await fetch("".concat(W,"/api/crew-upload/history?limit=50"),{headers:{Authorization:"Bearer ".concat((null===e||void 0===e?void 0:e.token)||"")}});if(t.ok){const e=await t.json();c(e.history||[])}}catch(e){console.error("Failed to fetch upload history:",e)}finally{x(!1)}},G=e=>{if(!e)return"-";return new Date(e).toLocaleString("en-AU",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})},V=async()=>{S(!0);try{const e=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}"),t=await fetch("".concat(W,"/api/crew-upload/server-files"),{headers:{Authorization:"Bearer ".concat((null===e||void 0===e?void 0:e.token)||"")}});if(t.ok){const e=await t.json();A(e)}}catch(e){console.error("Failed to fetch server files:",e)}finally{S(!1)}},J=(0,a.useRef)(null);(0,a.useEffect)(()=>{H(),U(),V(),q();const e=setTimeout(()=>{n||J.current||(console.log("Starting polling fallback"),J.current=setInterval(()=>{H()},2e3))},5e3);return()=>{clearTimeout(e),R.current&&R.current.close(),P.current&&clearTimeout(P.current),J.current&&(clearInterval(J.current),J.current=null)}},[]);const Y=Object.entries(t),K=Y.length,Z=Y.reduce((e,t)=>
1{var s;let[,a]=t;return e+((null===(s=a.files)||void 0===s?void 0:s.length)||0)},0),$=Y.reduce((e,t)=>{var s;let[,a]=t;return e+((null===(s=a.files)||void 0===s?void 0:s.filter(e=>"uploading"===e.status).length)||0)},0),Q=null===N||void 0===N||null===(e=N.disk)||void 0===e?void 0:e.percent,X=e=>{let{label:t,value:s,color:a="#F4F2EE"}=e;return(0,f.jsxs)("div",{className:"tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Nj),{},{padding:"16px 18px"}),children:[(0,f.jsx)("div",{style:{fontFamily:jj,fontSize:10.5,letterSpacing:"0.16em",color:"#7A7A82",marginBottom:9},children:t}),(0,f.jsx)("div",{style:{fontFamily:jj,fontWeight:700,fontSize:24,letterSpacing:"-0.02em",color:a},children:s})]})};return(0,f.jsxs)(ta,{title:"Live Uploads",meta:"MEDIA \xb7 REAL-TIME",children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:16,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 13px"},children:[(0,f.jsx)("span",{style:{width:9,height:9,borderRadius:"50%",background:n?"#16A34A":"#DC2626",boxShadow:"0 0 0 3px ".concat(n?"rgba(22,163,74,.18)":"rgba(220,38,38,.18)")}}),(0,f.jsx)("span",{style:{fontFamily:jj,fontSize:11,fontWeight:700,letterSpacing:"0.08em",color:n?"#16A34A":"#DC2626"},children:n?"CONNECTED":"DISCONNECTED"}),i&&(0,f.jsxs)("span",{style:{fontSize:11.5,color:"#9A9AA0"},children:["\xb7 ",i]})]}),(0,f.jsxs)("button",{onClick:H,style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 14px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer",marginLeft:"auto"},children:[(0,f.jsx)(As.A,{size:14})," Refresh"]})]}),(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:14,marginBottom:18},children:[(0,f.jsx)(X,{label:"ACTIVE SESSIONS",value:K,color:"#34D399"}),(0,f.jsx)(X,{label:"TOTAL FILES",value:Z}),(0,f.jsx)(X,{label:"UPLOADING",value:$,color:"#F2A900"}),(0,f.jsx)(X,{label:"DISK USED",value:null!=Q?"".concat(Q,"%"):"\u2014"})]}),0===K?(0,f.jsx)(Os,{icon:_s.A,title:"No Active Uploads",message:"When crew members start uploading files, they will appear here in real-time."}):(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:16},children:Y.map(e=>{var t,s,a,n;let[r,i]=e;const o=(null===(t=i.files)||void 0===t?void 0:t.filter(e=>"completed"===e.status).length)||0,l=(null===(s=i.files)||void 0===s?void 0:s.length)||0,c=l>0?Math.round(i.files.reduce((e,t)=>e+(t.progress||0),0)/l):0,d=(null===(a=i.files)||void 0===a?void 0:a.reduce((e,t)=>e+(t.speed||0),0))||0,p="session_started"===i.status||0===l,x=null===(n=i.files)||void 0===n?void 0:n.some(e=>"error"===e.status);return(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},Nj),{},{padding:"18px 20px"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:12,marginBottom:6},children:[(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:14,fontWeight:700,color:"#F4F2EE",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i.project_name}),(0,f.jsxs)("div",{style:{fontFamily:jj,fontSize:11,color:"#7A7A82",marginTop:2},children:[i.crew_name,!p&&d>0?" \xb7 ".concat(L(d)):""]})]}),(0,f.jsxs)("span",{style:{fontFamily:jj,fontSize:11,color:"#34D399",display:"flex",alignItems:"center",gap:6,whiteSpace:"nowrap"},children:[(0,f.jsx)("span",{style:{width:7,height:7,borderRadius:"50%",background:"#34D399",boxShadow:"0 0 0 3px rgba(52,211,153,.18)"}}),p?"ACTIVE":"".concat(o,"/").concat(l)]})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[(0,f.jsxs)("span",{style:{fontFamily:jj,fontSize:10.5,color:"#7A7A82",display:"flex",alignItems:"center",gap:5},children:[(0,f.jsx)(Nt.A,{size:12})," ",M(i.started_at)]}),x&&(0,f.jsxs)("button",{onClick:()=>(async e=>{z(e),D(null);try{const t=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}"),s=await fetch("".concat(W,"/api/crew-upload/retry"),{method:"POST",headers:{Authorization:"Bearer ".concat((null===t||void 0===t?void 0:t.token)||""),"Content-Type":"application/json"},body:JSON.stringify({session_id:e})}),a=await s.json();s.ok?D({sessionId:e,type:"success",message:"Retry sent to ".concat(a.clientsNotified," client(s)")}):D({sessionId:e,type:"error",message:a.detail||a.error||"Failed to send retry"})}catch(t){D({sessionId:e,type:"error",message:"Connection error"})}finally{z(null),setTimeout(()=>D(null),4e3)}})(r),disabled:T===r,style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:6,background:"#3A1517",border:"1px solid #5A1F22",color:"#F87171",borderRadius:7,padding:"4px 10px",fontSize:11.5,fontWeight:600,cursor:"pointer",opacity:T===r?.5:1},children:[T===r?(0,f.jsx)(Kr.A,{size:13,className:"animate-spin"}):(0,f.jsx)(bj.A,{size:13}),"Retry Failed"]})]}),(null===B||void 0===B?void 0:B.sessionId)===r&&(0,f.jsx)("div",{style:{fontFamily:jj,fontSize:10.5,marginBottom:6,color:"success"===B.type?"#34D399":"#F87171"},children:B.message}),p?(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontFamily:jj,fontSize:11,color:"#9A9AA0",margin:"12px 0"},children:[(0,f.jsx)(Kr.A,{size:14,className:"animate-spin"})," Waiting for files to be added\u2026"]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",fontFamily:jj,fontSize:10.5,color:"#7A7A82",margin:"10px 0 6px"},children:[(0,f.jsx)("span",{children:"OVERALL"}),(0,f.jsxs)("span",{style:{color:"#C4C4CB"},children:[c,"% \xb7 ",L(d)]})]}),(0,f.jsx)("div",{style:{height:8,borderRadius:5,background:"#1F1F23",overflow:"hidden",marginBottom:4},children:(0,f.jsx)("span",{style:{display:"block",width:"".concat(c,"%"),height:"100%",background:"linear-gradient(90deg,#BF212F,#F2A900)",transition:"width .3s"}})})]}),(0,f.jsx)("div",{className:"tg-scroll",style:{maxHeight:320,overflowY:"auto",marginTop:6},children:i.files&&0!==i.files.length?i.files.map(e=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 0",borderBottom:"1px solid #1F1F23"},children:[(0,f.jsx)("span",{style:{fontFamily:jj,fontSize:11.5,color:"#C4C4CB",flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),(0,f.jsx)(Ds,{tone:kj[e.status]||"gray",children:e.status}),(0,f.jsx)("div",{style:{width:110,height:6,borderRadius:4,background:"#1F1F23",overflow:"hidden",flexShrink:0},children:(0,f.jsx)("span",{style:{display:"block",width:"pending"===e.status?"0%":"".concat(e.progress||0,"%"),height:"100%",background:Aj[e.status]||"#55555C",transition:"width .3s"}})}),(0,f.jsxs)("span",{style:{fontFamily:jj,fontSize:10.5,color:"#7A7A82",width:92,textAlign:"right",flexShrink:0},children:[(0,f.jsx)("div",{children:"pending"===e.status?"queued":"".concat(e.progress||0,"%")}),(0,f.jsxs)("div",{style:{fontSize:9.5,color:"#55555C"},children:[O(e.uploadedBytes||0),"/",O(e.size),"uploading"===e.status&&e.speed?" \xb7 ".concat(L(e.speed)):""]})]})]},e.id)):(0,f.jsxs)("div",{style:{textAlign:"center",padding:"24px 0",color:"#55555C"},children:[(0,f.jsx)(zi.A,{size:26,style:{margin:"0 auto 8px",display:"block",opacity:.5}}),(0,f.jsx)("div",{style:{fontFamily:jj,fontSize:11},children:"No files added yet"})]})})]},r)})}),(0,f.jsxs)("div",{style:{marginTop:24},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14},children:[(0,f.jsxs)("h2",{className:"tg-ui",style:{fontSize:16,fontWeight:700,display:"flex",alignItems:"center",gap:8,margin:0},children:[(0,f.jsx)(yj.A,{size:18,color:"#55555C"})," Upload History"]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[l.length>0&&(0,f.jsxs)("button",{onClick:()=>v(!0),style:{display:"flex",alignItems:"center",gap:6,background:"#FEF2F2",border:"1px solid #FECACA",borderRadius:8,padding:"7px 12px",fontSize:12.5,fontWeight:600,color:"#991B1B",cursor:"pointer"},children:[(0,f.jsx)(la.A,{size:14})," Clear All"]}),(0,f.jsxs)("button",{onClick:U,disabled:d,style:{display:"flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid #E4E4E9",borderRadius:8,padding:"7px 12px",fontSize:12.5,fontWeight:600,color:"#333",cursor:"pointer",opacity:d?.6:1},children:[(0,f.jsx)(As.A,{size:14,className:d?"animate-spin":""})," Refresh"]})]})]}),d&&0===l.length?(0,f.jsx)(Ws,{rows:4}):0===l.length?(0,f.jsx)(Os,{icon:yj.A,title:"No upload history yet",message:"Completed and ended sessions will be recorded here."}):(0,f.jsx)("section",{style:(0,m.A)((0,m.A)({},wj),{},{overflow:"hidden"}),children:l.map(e=>{const t=e.error_files>0?"danger":"completed"===e.end_reason?"green":"gray",s=e.error_files>0?"Errors occurred":"completed"===e.end_reason?"Completed":"disconnected"===e.end_reason?"Disconnected":"Ended",a=e.error_files>0?"#991B1B":"completed"===e.end_reason?"#16A34A":"#9A9AA0",n=e.error_files>0?"#FEE2E2":"completed"===e.end_reason?"#DCFCE7":"#EDEDF0",r=e.error_files>0?"#991B1B":"completed"===e.end_reason?"#15803D":"#55555C";return(0,f.jsxs)("div",{className:"tg-row",style:{borderBottom:"1px solid #F2F2F5"},children:[(0,f.jsxs)("button",{onClick:()=>{return t=e.id,void b(e=>(0,m.A)((0,m.A)({},e),{},{[t]:!e[t]}));var t},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"14px 22px",background:"none",border:"none",textAlign:"left",cursor:"pointer"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,f.jsx)("span",{style:{width:36,height:36,borderRadius:9,background:n,color:r,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(_s.A,{size:17})}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.project_name}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:2,fontFamily:jj,fontSize:11,color:"#9A9AA0"},children:[(0,f.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:5},children:[(0,f.jsx)(Ye.A,{size:12})," ",e.crew_name]}),(0,f.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:5},children:[(0,f.jsx)(_t.A,{size:12})," ",G(e.started_at)]})]})]})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14},children:[(0,f.jsxs)("div",{style:{textAlign:"right"},children:[(0,f.jsxs)("div",{style:{fontFamily:jj,fontSize:12.5,fontWeight:700},children:[e.completed_files,"/",e.total_files,e.error_files>0&&(0,f.jsxs)("span",{style:{color:"#991B1B",marginLeft:6},children:["(",e.error_files," failed)"]})]}),(0,f.jsx)("div",{style:{fontFamily:jj,fontSize:10.5,color:a,marginTop:2},children:s})]}),(0,f.jsx)(Ds,{tone:t,children:e.end_reason||"ended"}),(0,f.jsx)("span",{onClick:t=>{t.stopPropagation(),(async e=>{w(e);try{const t=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}");(await fetch("".concat(W,"/api/crew-upload/history/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat((null===t||void 0===t?void 0:t.token)||"")}})).ok?c(t=>t.filter(t=>t.id!==e)):console.error("Failed to delete history entry")}catch(t){console.error("Error deleting history entry:",t)}finally{w(null)}})(e.id)},style:{display:"flex",padding:5,borderRadius:7,color:"#B5B5BC",cursor:"pointer",opacity:j===e.id?.5:1},title:"Delete entry",children:j===e.id?(0,f.jsx)(Kr.A,{size:16,className:"animate-spin"}):(0,f.jsx)(la.A,{size:16})}),u[e.id]?(0,f.jsx)(Tt.A,{size:18,color:"#B5B5BC"}):(0,f.jsx)(Et.A,{size:18,color:"#B5B5BC"})]})]}),u[e.id]&&(0,f.jsx)("div",{style:{padding:"0 22px 16px"},children:(0,f.jsxs)("div",{style:{background:"#F7F7F9",border:"1px solid #EDEDF0",borderRadius:10,padding:16},children:[(0,f.jsxs)("div",{style:{fontFamily:jj,fontSize:10.5,color:"#9A9AA0",marginBottom:10},children:["SESSION ENDED \xb7 ",G(e.ended_at)]}),e.files&&e.files.length>0?(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:e.files.map((e,t)=>(0,f.jsxs)("div",{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:["completed"===e.status?(0,f.jsx)(p.A,{size:15,color:"#16A34A",style:{flexShrink:0}}):"error"===e.status?(0,f.jsx)(h.A,{size:15,color:"#DC2626",style:{flexShrink:0}}):(0,f.jsx)(zi.A,{size:15,color:"#9A9AA0",style:{flexShrink:0}}),(0,f.jsx)("span",{style:{fontSize:13,color:"error"===e.status?"#991B1B":"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name})]}),(0,f.jsx)("span",{style:{fontFamily:jj,fontSize:11,color:"#9A9AA0",flexShrink:0},children:O(e.size)})]}),"error"===e.status&&e.error&&(0,f.jsxs)("div",{style:{marginLeft:23,marginTop:4,fontSize:11.5,color:"#991B1B",background:"#FEE2E2",padding:"4px 8px",borderRadius:6},children:["Error: ",e.error]})]},t))}):(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0"},children:"No files recorded"})]})})]},e.id)})})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},wj),{},{overflow:"hidden",marginTop:24}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"16px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)(vj.A,{size:18,color:"#7C3AED"}),(0,f.jsx)("h2",{className:"tg-ui",style:{fontSize:16,fontWeight:700,margin:0},children:"Server Storage"}),(0,f.jsx)(Ds,{tone:"muted",children:"Shootzu"})]}),(0,f.jsxs)("button",{onClick:V,disabled:k,style:{display:"flex",alignItems:"center",gap:6,background:"#fff",border:"1px solid #E4E4E9",borderRadius:8,padding:"7px 12px",fontSize:12.5,fontWeight:600,color:"#333",cursor:"pointer",opacity:k?.6:1},children:[(0,f.jsx)(As.A,{size:14,className:k?"animate-spin":""})," Refresh"]})]}),(0,f.jsx)("div",{style:{padding:22},children:k&&!N?(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"24px 0",color:"#9A9AA0",fontSize:13},children:[(0,f.jsx)(Kr.A,{size:16,className:"animate-spin"})," Loading server storage\u2026"]}):N?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{marginBottom:22},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:8},children:[(0,f.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"#333"},children:"Disk Usage"}),(0,f.jsxs)("span",{style:{fontFamily:jj,fontSize:12,color:"#9A9AA0"},children:[O(N.disk.used)," / ",O(N.disk.total),(0,f.jsxs)("span",{style:{color:"#B5B5BC",marginLeft:8},children:["(",N.disk.percent,"%)"]})]})]}),(0,f.jsx)("div",{style:{height:10,borderRadius:6,background:"#EDEDF0",overflow:"hidden"},children:(0,f.jsx)("span",{style:{display:"block",height:"100%",width:"".concat(Math.min(N.disk.percent,100),"%"),transition:"width .3s",background:N.disk.percent>80?"#DC2626":N.disk.percent>60?"#F2A900":"#7C3AED"}})}),(0,f.jsxs)("div",{style:{fontFamily:jj,fontSize:10.5,color:"#9A9AA0",marginTop:6},children:[O(N.disk.available)," available"]})]}),N.projects.length>0?(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:N.projects.map(e=>(0,f.jsxs)("div",{style:{border:"1px solid #E4E4E9",borderRadius:10,overflow:"hidden"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"12px 16px",background:"#F7F7F9"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[(0,f.jsx)(Yr.A,{size:16,color:"#7C3AED",style:{flexShrink:0}}),(0,f.jsx)("span",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.name}),(0,f.jsx)("span",{style:{fontFamily:jj,fontSize:11,color:"#9A9AA0",flexShrink:0},children:O(e.size)})]}),(0,f.jsxs)("button",{onClick:()=>E({project:e.name}),disabled:_===e.name,style:{display:"flex",alignItems:"center",gap:5,background:"none",border:"none",color:"#DC2626",fontSize:12,fontWeight:600,cursor:"pointer",padding:"4px 8px",borderRadius:7},children:[_===e.name?(0,f.jsx)(Kr.A,{size:13,className:"animate-spin"}):(0,f.jsx)(la.A,{size:13}),"Delete All"]}
1)]}),e.crews.length>0&&(0,f.jsx)("div",{children:e.crews.map(t=>(0,f.jsxs)("div",{className:"tg-row",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"10px 16px",borderTop:"1px solid #F2F2F5"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[(0,f.jsx)(Ye.A,{size:13,color:"#9A9AA0",style:{flexShrink:0}}),(0,f.jsx)("span",{style:{fontSize:13,color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),(0,f.jsxs)("span",{style:{fontFamily:jj,fontSize:10.5,color:"#B5B5BC",flexShrink:0},children:[t.file_count," file",1!==t.file_count?"s":""," \xb7 ",O(t.size)]})]}),(0,f.jsxs)("button",{onClick:()=>E({project:e.name,crew:t.name}),disabled:_==="".concat(e.name,"/").concat(t.name),style:{display:"flex",alignItems:"center",gap:5,background:"none",border:"none",color:"#DC2626",fontSize:11.5,fontWeight:600,cursor:"pointer",padding:"3px 7px",borderRadius:6},children:[_==="".concat(e.name,"/").concat(t.name)?(0,f.jsx)(Kr.A,{size:12,className:"animate-spin"}):(0,f.jsx)(la.A,{size:12}),"Delete"]})]},t.name))})]},e.name))}):(0,f.jsxs)("div",{style:{textAlign:"center",padding:"24px 0"},children:[(0,f.jsx)(vj.A,{size:32,color:"#D4D4DA",style:{margin:"0 auto 8px",display:"block"}}),(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0"},children:"No uploaded files on server"}),(0,f.jsx)("div",{style:{fontFamily:jj,fontSize:10.5,color:"#B5B5BC",marginTop:4},children:"Files will appear here when crew members upload"})]})]}):(0,f.jsxs)("div",{style:{textAlign:"center",padding:"24px 0"},children:[(0,f.jsx)(h.A,{size:28,color:"#D4D4DA",style:{margin:"0 auto 8px",display:"block"}}),(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0"},children:"Could not load server storage info"}),(0,f.jsx)("button",{onClick:V,style:{marginTop:8,background:"none",border:"none",color:"#7C3AED",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Try again"})]})})]}),F&&(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(10,10,11,.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,padding:16},children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},wj),{},{maxWidth:440,width:"100%",overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)("h3",{className:"tg-ui",style:{fontSize:16,fontWeight:700,margin:0},children:"Delete Server Files"}),(0,f.jsx)("button",{onClick:()=>E(null),style:{display:"flex",padding:4,background:"none",border:"none",color:"#9A9AA0",cursor:"pointer"},children:(0,f.jsx)(g.A,{size:18})})]}),(0,f.jsxs)("div",{style:{padding:"18px 22px"},children:[(0,f.jsxs)("p",{style:{margin:0,fontSize:14,color:"#333"},children:["Delete ",(0,f.jsx)("strong",{children:F.crew?"".concat(F.crew):"all files"}),F.crew?" from ":" in ",(0,f.jsx)("strong",{children:F.project})," from the server?"]}),(0,f.jsx)("p",{style:{margin:"8px 0 0",fontSize:12.5,color:"#9A9AA0"},children:"This only removes files from the upload server, not from the NAS."})]}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,padding:"14px 22px",background:"#F7F7F9"},children:[(0,f.jsx)("button",{onClick:()=>E(null),style:{padding:"9px 16px",fontSize:13,fontWeight:600,color:"#333",background:"#fff",border:"1px solid #E4E4E9",borderRadius:8,cursor:"pointer"},children:"Cancel"}),(0,f.jsxs)("button",{onClick:()=>async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const s=t?"".concat(e,"/").concat(t):e;C(s);try{const s=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}");(await fetch("".concat(W,"/api/crew-upload/server-files"),{method:"DELETE",headers:{Authorization:"Bearer ".concat((null===s||void 0===s?void 0:s.token)||""),"Content-Type":"application/json"},body:JSON.stringify({project:e,crew:t})})).ok&&await V()}catch(a){console.error("Error deleting server files:",a)}finally{C(null),E(null)}}(F.project,F.crew),disabled:null!==_,style:{display:"flex",alignItems:"center",gap:8,padding:"9px 16px",fontSize:13,fontWeight:600,color:"#fff",background:"#DC2626",border:"none",borderRadius:8,cursor:"pointer"},children:[_?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(la.A,{size:15}),"Delete from Server"]})]})]})}),y&&(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(10,10,11,.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,padding:16},children:(0,f.jsxs)("div",{style:(0,m.A)((0,m.A)({},wj),{},{maxWidth:440,width:"100%",overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 22px",borderBottom:"1px solid #EDEDF0"},children:[(0,f.jsx)("h3",{className:"tg-ui",style:{fontSize:16,fontWeight:700,margin:0},children:"Clear All History"}),(0,f.jsx)("button",{onClick:()=>v(!1),style:{display:"flex",padding:4,background:"none",border:"none",color:"#9A9AA0",cursor:"pointer"},children:(0,f.jsx)(g.A,{size:18})})]}),(0,f.jsx)("div",{style:{padding:"18px 22px"},children:(0,f.jsx)("p",{style:{margin:0,fontSize:14,color:"#333"},children:"Are you sure you want to delete all upload history? This action cannot be undone."})}),(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:10,padding:"14px 22px",background:"#F7F7F9"},children:[(0,f.jsx)("button",{onClick:()=>v(!1),style:{padding:"9px 16px",fontSize:13,fontWeight:600,color:"#333",background:"#fff",border:"1px solid #E4E4E9",borderRadius:8,cursor:"pointer"},children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{v(!1),x(!0);try{const e=JSON.parse(localStorage.getItem("turbo360_admin_auth")||"{}");(await fetch("".concat(W,"/api/crew-upload/history"),{method:"DELETE",headers:{Authorization:"Bearer ".concat((null===e||void 0===e?void 0:e.token)||"")}})).ok?c([]):console.error("Failed to clear history")}catch(e){console.error("Error clearing history:",e)}finally{x(!1)}},style:{display:"flex",alignItems:"center",gap:8,padding:"9px 16px",fontSize:13,fontWeight:600,color:"#fff",background:"#DC2626",border:"none",borderRadius:8,cursor:"pointer"},children:[(0,f.jsx)(la.A,{size:15})," Clear All"]})]})]})})]})};var _j=s(42681),Cj=s(91614);const Fj="'Space Mono',monospace",Ej={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Tj="1.5fr 1.2fr 120px 110px 1.4fr 132px",zj=()=>{const e=(0,r.Zp)(),{toast:t}=N(),[s,n]=(0,a.useState)([]),[i,l]=(0,a.useState)([]),[c,d]=(0,a.useState)(!0),[p,x]=(0,a.useState)(""),[h,u]=(0,a.useState)("all"),[b,y]=(0,a.useState)(null),v=(0,a.useRef)(null);(0,a.useEffect)(()=>{(0,o.cd)(e)?j():e("/admin")},[e]),(0,a.useEffect)(()=>{w()},[s,p,h]);const j=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/consent-projects"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();n(e.projects||[])}}catch(s){console.error("Error loading consent projects:",s),t.error("Failed to load consent projects")}finally{d(!1)}},w=()=>{let e=[...s];if(p){const t=p.toLowerCase();e=e.filter(e=>{var s,a;return(null===(s=e.project_name)||void 0===s?void 0:s.toLowerCase().includes(t))||(null===(a=e.company_name)||void 0===a?void 0:a.toLowerCase().includes(t))})}"active"===h?e=e.filter(e=>
1"active"===e.status):"archived"===h&&(e=e.filter(e=>"archived"===e.status)),l(e)},A=(0,a.useCallback)(e=>{const s="https://turbo.net.au/consent/".concat(e);navigator.clipboard.writeText(s).then(()=>{t.success("Public URL copied to clipboard")}).catch(()=>{t.error("Failed to copy URL")})},[t]),k=e=>"https://turbo.net.au/consent/".concat(e),S=(0,a.useCallback)(()=>{if(!v.current||!b)return;const e=v.current.querySelector("svg");if(!e)return;const t=(new XMLSerializer).serializeToString(e),s=document.createElement("canvas"),a=s.getContext("2d"),n=new Image;n.onload=()=>{s.width=n.width,s.height=n.height,a.fillStyle="#ffffff",a.fillRect(0,0,s.width,s.height),a.drawImage(n,0,0);const e=s.toDataURL("image/png"),t=document.createElement("a");t.href=e,t.download="consent-qr-".concat(b.public_url_slug||b.id,".png"),document.body.appendChild(t),t.click(),document.body.removeChild(t)},n.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t)))},[b]),C={total:s.length,active:s.filter(e=>"active"===e.status).length,archived:s.filter(e=>"archived"===e.status).length,totalSubmissions:s.reduce((e,t)=>e+(t.submission_count||0),0)},F=[{label:"PROJECTS",value:C.total,color:"#0A0A0B"},{label:"ACTIVE",value:C.active,color:"#15803D"},{label:"ARCHIVED",value:C.archived,color:"#64748B"},{label:"SUBMISSIONS",value:C.totalSubmissions,color:"#4338CA"}],E=[{key:"all",label:"All",count:C.total},{key:"active",label:"Active",count:C.active},{key:"archived",label:"Archived",count:C.archived}];return(0,f.jsxs)(ta,{title:"Image Consent",meta:"SYSTEM \xb7 CONSENT",action:{label:"New Project",to:"/admin/consent/create"},children:[(0,f.jsx)("div",{className:"tg-kpi-grid",style:{display:"grid",gridTemplateColumns:"repeat(8,1fr)",gap:14,marginBottom:20},children:F.map(e=>(0,f.jsxs)("div",{className:"tg-tile tg-span2",style:(0,m.A)((0,m.A)({gridColumn:"span 2"},Ej),{},{padding:"16px 18px"}),children:[(0,f.jsx)("div",{style:{fontFamily:Fj,fontSize:10.5,letterSpacing:"0.16em",color:"#9A9AA0",marginBottom:9},children:e.label}),(0,f.jsx)("div",{style:{fontFamily:Fj,fontWeight:700,fontSize:24,letterSpacing:"-0.02em",color:e.color},children:e.value})]},e.label))}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Ej),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"16px 18px",borderBottom:"1px solid #EDEDF0",flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:9,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",flex:1,minWidth:180},children:[(0,f.jsx)(ds.A,{size:15,color:"#9A9AA0"}),(0,f.jsx)("input",{value:p,onChange:e=>x(e.target.value),placeholder:"Search projects\u2026",style:{border:"none",background:"transparent",outline:"none",fontSize:13,width:"100%"}})]}),E.map(e=>{let{key:t,label:s,count:a}=e;const n=h===t;return(0,f.jsxs)("button",{onClick:()=>u(t),style:{display:"flex",alignItems:"center",gap:7,fontSize:12,fontWeight:600,borderRadius:8,padding:"7px 12px",cursor:"pointer",background:n?"#0A0A0B":"#fff",color:n?"#fff":"#55555C",border:"1px solid ".concat(n?"#0A0A0B":"#E4E4E9")},children:[s,(0,f.jsx)("span",{style:{fontFamily:Fj,fontSize:10,fontWeight:700,color:n?"#C9C9D0":"#9A9AA0"},children:a})]},t)}),(0,f.jsxs)("button",{onClick:()=>{d(!0),j()},style:{display:"flex",alignItems:"center",gap:7,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"8px 12px",fontSize:13,fontWeight:600,color:"#333",cursor:"pointer"},children:[(0,f.jsx)(As.A,{size:14})," Refresh"]})]}),(0,f.jsxs)("div",{className:"tg-leadrow tg-booking-meta",style:{gridTemplateColumns:Tj,padding:"11px 22px",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0",fontFamily:Fj,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",textTransform:"uppercase"},children:[(0,f.jsx)("span",{children:"Project"}),(0,f.jsx)("span",{children:"Company"}),(0,f.jsx)("span",{style:{textAlign:"center"},children:"Submissions"}),(0,f.jsx)("span",{style:{textAlign:"center"},children:"Status"}),(0,f.jsx)("span",{children:"Public URL"}),(0,f.jsx)("span",{style:{textAlign:"right"},children:"Actions"})]}),c?(0,f.jsx)("div",{style:{padding:22},children:(0,f.jsx)(Ws,{rows:6})}):0===i.length?(0,f.jsx)(Os,{icon:Cs.A,title:"No consent projects yet",message:p||"all"!==h?"Try adjusting your filters.":"Get started by creating your first consent project.",actionLabel:"Create Project",onAction:()=>e("/admin/consent/create")}):i.map(s=>(0,f.jsxs)("div",{className:"tg-leadrow tg-row",style:{gridTemplateColumns:Tj,padding:"14px 22px",borderBottom:"1px solid #F2F2F5",alignItems:"center",cursor:"pointer"},onClick:()=>e("/admin/consent/".concat(s.id)),children:[(0,f.jsx)("div",{style:{minWidth:0},children:(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s.project_name})}),(0,f.jsx)("span",{className:"tg-booking-meta",style:{fontSize:13,color:"#333",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:s.company_name||"\u2014"}),(0,f.jsx)("span",{style:{justifySelf:"center"},children:(0,f.jsxs)(Ds,{tone:"indigo",children:[s.submission_count||0," subs"]})}),(0,f.jsx)("span",{style:{justifySelf:"center"},children:(0,f.jsx)(Ds,{tone:"active"===s.status?"green":"muted",children:"active"===s.status?"Active":"Archived"})}),(0,f.jsxs)("div",{className:"tg-booking-meta",onClick:e=>e.stopPropagation(),style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[(0,f.jsxs)("span",{style:{fontFamily:Fj,fontSize:11.5,color:"#9A9AA0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:k(s.public_url_slug),children:["/consent/",s.public_url_slug]}),(0,f.jsx)("button",{onClick:()=>A(s.public_url_slug),title:"Copy URL",style:{background:"none",border:"none",color:"#B5B5BC",cursor:"pointer",display:"flex",padding:2,flexShrink:0},children:(0,f.jsx)(Cr.A,{size:14})})]}),(0,f.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{display:"flex",alignItems:"center",gap:8,justifyContent:"flex-end",color:"#9A9AA0"},children:[(0,f.jsx)("button",{onClick:()=>e("/admin/consent/".concat(s.id)),title:"View",style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex",padding:2},children:(0,f.jsx)(_.A,{size:16})}),(0,f.jsx)("button",{onClick:()=>e("/admin/consent/edit/".concat(s.id)),title:"Edit",style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex",padding:2},children:(0,f.jsx)(Tn.A,{size:16})}),(0,f.jsx)("button",{onClick:()=>y(s),title:"QR Code",style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex",padding:2},children:(0,f.jsx)(_j.A,{size:16})}),(0,f.jsx)("button",{onClick:()=>(async e=>{const s="active"===e.status?"archived":"active",a="archived"===s?"archive":"restore";try{var r;const i=null===(r=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===r?void 0:r.token,o=await fetch("".concat(I.fn,"/api/consent-projects/").concat(e.id),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)},body:JSON.stringify({status:s})});if(o.ok)n(t=>t.map(t=>
1t.id===e.id?(0,m.A)((0,m.A)({},t),{},{status:s}):t)),t.success("Project ".concat(a,"d successfully"));else{const e=await o.json();t.error(e.detail||"Failed to ".concat(a," project"))}}catch(i){console.error("Error ".concat(a,"ing project:"),i),t.error("Failed to ".concat(a," project"))}})(s),title:"active"===s.status?"Archive":"Restore",style:{background:"none",border:"none",color:"#9A9AA0",cursor:"pointer",display:"flex",padding:2},children:"active"===s.status?(0,f.jsx)(_r.A,{size:16}):(0,f.jsx)(bj.A,{size:16})})]})]},s.id)),!c&&i.length>0&&(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 22px",borderTop:"1px solid #EDEDF0"},children:(0,f.jsxs)("span",{style:{fontFamily:Fj,fontSize:11.5,color:"#9A9AA0"},children:["SHOWING ",i.length," OF ",s.length," PROJECTS"]})})]}),b&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-md overflow-hidden",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-rose-600 to-rose-700 px-6 py-4 flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"text-white",children:[(0,f.jsx)("h2",{className:"text-lg font-bold",children:"QR Code"}),(0,f.jsx)("p",{className:"text-rose-200 text-sm mt-0.5",children:b.project_name})]}),(0,f.jsx)("button",{onClick:()=>y(null),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:(0,f.jsx)(g.A,{className:"h-5 w-5 text-white"})})]}),(0,f.jsxs)("div",{className:"p-8 flex flex-col items-center",children:[(0,f.jsx)("div",{ref:v,className:"bg-white p-4 rounded-xl border border-slate-200",children:(0,f.jsx)(Cj.h,{value:k(b.public_url_slug),size:256,level:"H",includeMargin:!0,bgColor:"#ffffff",fgColor:"#000000"})}),(0,f.jsx)("p",{className:"mt-4 text-sm text-slate-500 text-center break-all",children:k(b.public_url_slug)})]}),(0,f.jsxs)("div",{className:"bg-slate-50 px-6 py-4 border-t border-slate-200 flex items-center justify-between",children:[(0,f.jsxs)("button",{onClick:()=>A(b.public_url_slug),className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-slate-200 text-slate-700 rounded-lg hover:bg-slate-50 transition-colors text-sm font-medium",children:[(0,f.jsx)(Cr.A,{className:"h-4 w-4"}),"Copy URL"]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsxs)("a",{href:k(b.public_url_slug),target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-slate-200 text-slate-700 rounded-lg hover:bg-slate-50 transition-colors text-sm font-medium",children:[(0,f.jsx)(En.A,{className:"h-4 w-4"}),"Open"]}),(0,f.jsxs)("button",{onClick:S,className:"inline-flex items-center gap-2 px-4 py-2 bg-rose-600 text-white rounded-lg hover:bg-rose-700 transition-colors text-sm font-medium",children:[(0,f.jsx)(es.A,{className:"h-4 w-4"}),"Download QR"]})]})]})]})})]})},Bj={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},Dj={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},Ij=e=>{let{title:t,subtitle:s,children:a}=e;return(0,f.jsxs)(Ls,{style:{padding:22},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:t}),s&&(0,f.jsx)("div",{style:{fontSize:12.5,color:"#9A9AA0",marginTop:4,lineHeight:1.5},children:s}),(0,f.jsx)("div",{style:{marginTop:16},children:a})]})},Rj=()=>{const e=(0,r.Zp)(),{projectId:t}=(0,r.g)(),s=!!t,{toast:n}=N(),[i,l]=(0,a.useState)(s),[c,d]=(0,a.useState)(!1),[p,x]=(0,a.useState)(!1),[h,u]=(0,a.useState)(null),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)([]),[w,A]=(0,a.useState)(""),[k,S]=(0,a.useState)(!1),[_,C]=(0,a.useState)(null),[F,E]=(0,a.useState)({project_name:"",company_id:"",company_name:"",company_logo_url:"",usage_points:[""],terms_and_conditions:""});(0,a.useEffect)(()=>{(0,o.cd)()?(T(),s&&z()):e("/?admin=true")},[e,t]);const T=async()=>{try{var e;const t=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,s=await fetch("".concat(I.fn,"/api/clients"),{headers:{Authorization:"Bearer ".concat(t)}});if(s.ok){const e=await s.json();j(e.clients||[])}}catch(t){console.error("Error loading clients:",t)}},z=async()=>{try{var s;const a=null===(s=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===s?void 0:s.token,r=await fetch("".concat(I.fn,"/api/consent-projects/").concat(t),{headers:{Authorization:"Bearer ".concat(a)}});if(r.ok){const e=await r.json(),t=e.project||e;E({project_name:t.project_name||"",company_id:t.company_id||"",company_name:t.company_name||"",company_logo_url:t.company_logo_url||"",usage_points:t.usage_points&&t.usage_points.length>0?t.usage_points:[""],terms_and_conditions:t.terms_and_conditions||""}),t.company_id&&t.company_name&&C({id:t.company_id,company_name:t.company_name,logo_url:t.company_logo_url})}else n.error("Failed to load consent project"),e("/admin/consent")}catch(a){console.error("Error loading project:",a),n.error("An error occurred while loading the project"),e("/admin/consent")}finally{l(!1)}},B=v.filter(e=>!0===e.is_company).filter(e=>{var t;return null===(t=e.company_name)||void 0===t?void 0:t.toLowerCase().includes(w.toLowerCase())}),D=(e,t)=>{E(s=>(0,m.A)((0,m.A)({},s),{},{[e]:t}))},R=async()=>
1{if(!c&&(F.project_name.trim()?0!==F.usage_points.filter(e=>e.trim()).length||(n.error("Please add at least one usage point"),0):(n.error("Please enter a project name"),0))){d(!0);try{var a;const r=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,i=(0,m.A)((0,m.A)({},F),{},{usage_points:F.usage_points.filter(e=>e.trim())}),o=s?"".concat(I.fn,"/api/consent-projects/").concat(t):"".concat(I.fn,"/api/consent-projects"),l=await fetch(o,{method:s?"PUT":"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)},body:JSON.stringify(i)});if(l.ok){const a=await l.json();if(s)n.success("Consent project updated successfully"),e("/admin/consent/".concat(t));else{const e=a.project||a,t=e.id,s=e.public_url_slug;u({id:t,slug:s,public_url:"".concat(window.location.origin,"/consent/").concat(s)}),x(!0),n.success("Consent project created successfully")}}else{const e=await l.json().catch(()=>({}));n.error(e.detail||"Failed to save consent project")}}catch(r){console.error("Error saving consent project:",r),n.error("An error occurred while saving")}finally{d(!1)}}},P=()=>{null!==h&&void 0!==h&&h.public_url&&navigator.clipboard.writeText(h.public_url).then(()=>{y(!0),n.success("URL copied to clipboard"),setTimeout(()=>y(!1),2e3)}).catch(()=>{n.error("Failed to copy URL")})},W={display:"inline-flex",alignItems:"center",gap:7,background:"#BF212F",color:"#fff",border:"none",borderRadius:9,padding:"10px 18px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",opacity:c?.6:1},O={display:"inline-flex",alignItems:"center",gap:7,fontSize:13,fontWeight:600,color:"#55555C",background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 13px",cursor:"pointer"};return i?(0,f.jsx)(ta,{title:s?"Edit Consent Project":"New Consent Project",meta:"SYSTEM \xb7 CONSENT",children:(0,f.jsx)("div",{style:{maxWidth:760},children:(0,f.jsx)(Ws,{rows:6})})}):p&&h?(0,f.jsx)(ta,{title:"Consent Project Created",meta:"SYSTEM \xb7 CONSENT",children:(0,f.jsx)("div",{style:{maxWidth:760},children:(0,f.jsxs)(Ls,{style:{padding:36,textAlign:"center"},children:[(0,f.jsx)("div",{style:{width:60,height:60,borderRadius:"50%",background:"#DCFCE7",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 22px",color:"#15803D"},children:(0,f.jsx)(zt.A,{size:30})}),(0,f.jsx)("h2",{className:"tg-ui",style:{fontWeight:800,fontSize:22,letterSpacing:"-0.01em",margin:0},children:"Project Created Successfully"}),(0,f.jsxs)("p",{style:{fontSize:13.5,color:"#55555C",margin:"10px 0 28px",lineHeight:1.55},children:['Your consent project "',F.project_name,'" is ready. Share the link below with participants.']}),(0,f.jsxs)("div",{style:{background:"#FBFBFC",border:"1px solid #E4E4E9",borderRadius:11,padding:20,marginBottom:18,textAlign:"left"},children:[(0,f.jsx)("label",{style:Bj,children:"Public Consent Form URL"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,f.jsx)("div",{className:"tg-mono",style:{flex:1,background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontSize:12.5,color:"#0A0A0B",wordBreak:"break-all"},children:h.public_url}),(0,f.jsx)("button",{onClick:P,style:(0,m.A)((0,m.A)({},O),{},{flexShrink:0,padding:"10px 14px"}),children:b?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(zt.A,{size:15,color:"#15803D"}),(0,f.jsx)("span",{style:{color:"#15803D"},children:"Copied"})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Cr.A,{size:15}),(0,f.jsx)("span",{children:"Copy URL"})]})})]})]}),(0,f.jsxs)("div",{style:{background:"#FBFBFC",border:"1px solid #E4E4E9",borderRadius:11,padding:20,marginBottom:28},children:[(0,f.jsxs)("label",{style:(0,m.A)((0,m.A)({},Bj),{},{display:"flex",alignItems:"center",justifyContent:"center",gap:6}),children:[(0,f.jsx)(_j.A,{size:15})," QR Code"]}),(0,f.jsx)("div",{style:{display:"flex",justifyContent:"center",marginTop:6},children:(0,f.jsx)("img",{src:"https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=".concat(encodeURIComponent(h.public_url)),alt:"QR Code for consent form",style:{width:190,height:190,border:"1px solid #E4E4E9",borderRadius:11,background:"#fff"}})}),(0,f.jsx)("p",{style:{fontSize:12.5,color:"#9A9AA0",marginTop:12,marginBottom:0},children:"Print or display this QR code for participants to scan and submit their consent."})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:12},children:[(0,f.jsxs)("button",{onClick:()=>e("/admin/consent"),style:O,children:[(0,f.jsx)(Ct.A,{size:15})," Back to Dashboard"]}),(0,f.jsxs)("button",{onClick:()=>e("/admin/consent/".concat(h.id)),className:"tg-btn-primary",style:W,children:[(0,f.jsx)(En.A,{size:15})," View Project"]})]})]})})}
1):(0,f.jsxs)(ta,{title:s?"Edit Consent Project":"New Consent Project",meta:"SYSTEM \xb7 CONSENT",children:[(0,f.jsx)("style",{children:"\n .consent-quill-editor .ql-toolbar {\n border-color: #E4E4E9 !important;\n background-color: #FBFBFC !important;\n border-top-left-radius: 9px;\n border-top-right-radius: 9px;\n }\n .consent-quill-editor .ql-container {\n border-color: #E4E4E9 !important;\n background-color: #fff !important;\n min-height: 220px !important;\n border-bottom-left-radius: 9px;\n border-bottom-right-radius: 9px;\n font-family: 'Hanken Grotesk', sans-serif !important;\n }\n .consent-quill-editor .ql-editor {\n color: #0A0A0B !important;\n min-height: 220px !important;\n font-size: 13.5px;\n }\n .consent-quill-editor .ql-editor.ql-blank::before {\n color: #9A9AA0 !important;\n font-style: normal !important;\n }\n"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>e("/admin/consent"),type:"button",style:O,children:[(0,f.jsx)(Ct.A,{size:15})," Consent"]}),(0,f.jsx)("h1",{className:"tg-ui",style:{fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:s?"Edit Consent Project":"New Consent Project"}),(0,f.jsx)("div",{style:{marginLeft:"auto"},children:(0,f.jsxs)("button",{className:"tg-btn-primary",onClick:R,disabled:c,style:W,children:[(0,f.jsx)(ia.A,{size:15})," ",c?"Saving\u2026":s?"Update Project":"Create Project"]})})]}),(0,f.jsxs)("div",{style:{maxWidth:760,display:"flex",flexDirection:"column",gap:18},children:[(0,f.jsx)(Ij,{title:"Project Details",children:(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Bj,children:"Project name *"}),(0,f.jsx)("input",{type:"text",value:F.project_name,onChange:e=>D("project_name",e.target.value),style:Dj,placeholder:"e.g., Annual Gala 2026 - Photo Release"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:Bj,children:"Client (Company)"}),_?(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,padding:14,background:"#FEF2F2",border:"1px solid #FECACA",borderRadius:11},children:[_.logo_url?(0,f.jsx)("img",{src:_.logo_url.startsWith("http")?_.logo_url:"".concat(I.fn).concat(_.logo_url),alt:_.company_name,style:{width:40,height:40,borderRadius:9,objectFit:"contain",background:"#fff",border:"1px solid #E4E4E9"}}):(0,f.jsx)("div",{style:{width:40,height:40,borderRadius:9,background:"#FEE2E2",display:"flex",alignItems:"center",justifyContent:"center",color:"#BF212F"},children:(0,f.jsx)(gs.A,{size:20})}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:"#0A0A0B"},children:_.company_name}),(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0"},children:"Selected company"})]}),(0,f.jsx)("button",{type:"button",onClick:()=>{C(null),E(e=>(0,m.A)((0,m.A)({},e),{},{company_id:"",company_name:"",company_logo_url:""})),A("")},title:"Clear selection",style:{background:"none",border:"none",color:"#991B1B",cursor:"pointer",display:"flex",padding:4},children:(0,f.jsx)(g.A,{size:18})})]}):(0,f.jsxs)("div",{style:{position:"relative"},children:[(0,f.jsxs)("div",{style:{position:"relative"},children:[(0,f.jsx)(ds.A,{size:16,style:{position:"absolute",left:12,top:"50%",transform:"translateY(-50%)",color:"#9A9AA0"}}),(0,f.jsx)("input",{type:"text",value:w,onChange:e=>{A(e.target.value),S(!0)},onFocus:()=>S(!0),onBlur:()=>setTimeout(()=>S(!1),200),style:(0,m.A)((0,m.A)({},Dj),{},{paddingLeft:36}),placeholder:"Search for a company..."})]}),k&&w&&(0,f.jsx)("div",{style:{position:"absolute",zIndex:50,width:"100%",marginTop:4,background:"#fff",border:"1px solid #E4E4E9",borderRadius:11,boxShadow:"0 12px 32px rgba(10,10,11,.12)",maxHeight:260,overflowY:"auto"},children:B.length>0?B.map(e=>(0,f.jsxs)("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:()=>(e=>{C(e),E(t=>(0,m.A)((0,m.A)({},t),{},{company_id:e.id,company_name:e.company_name,company_logo_url:e.logo_url||""})),A(""),S(!1)})(e),style:{width:"100%",textAlign:"left",padding:"12px 14px",background:"none",border:"none",borderBottom:"1px solid #F2F2F5",display:"flex",alignItems:"center",gap:12,cursor:"pointer"},children:[e.logo_url?(0,f.jsx)("img",{src:e.logo_url.startsWith("http")?e.logo_url:"".concat(I.fn).concat(e.logo_url),alt:e.company_name,style:{width:32,height:32,borderRadius:7,objectFit:"contain",background:"#fff",border:"1px solid #E4E4E9"}}):(0,f.jsx)("div",{style:{width:32,height:32,borderRadius:7,background:"#F2F2F5",display:"flex",alignItems:"center",justifyContent:"center",color:"#9A9AA0"},children:(0,f.jsx)(gs.A,{size:16})}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"#0A0A0B"},children:e.company_name}),e.email&&(0,f.jsx)("div",{style:{fontSize:12,color:"#9A9AA0"},children:e.email})]})]},e.id)):(0,f.jsxs)("div",{style:{padding:"12px 14px",fontSize:13,color:"#9A9AA0",textAlign:"center"},children:['No companies found matching "',w,'"']})})]}),(0,f.jsx)("p",{style:{fontSize:11.5,color:"#9A9AA0",marginTop:8,marginBottom:0,lineHeight:1.5},children:"Optional. Link this project to a company in your client list. Their logo will appear on the consent form."})]})]})}),(0,f.jsx)(Ij,{title:"Usage Points",subtitle:"Define how the captured images/footage will be used. Each point will be displayed as a dot point on the consent form.",children:(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[F.usage_points.map((e,t)=>(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,f.jsx)("span",{style:{color:"#BF212F",fontWeight:700,fontSize:18,flexShrink:0},children:"\u2022"}
1),(0,f.jsx)("input",{type:"text",value:e,onChange:e=>((e,t)=>{E(s=>(0,m.A)((0,m.A)({},s),{},{usage_points:s.usage_points.map((s,a)=>a===e?t:s)}))})(t,e.target.value),style:(0,m.A)((0,m.A)({},Dj),{},{flex:1}),placeholder:"e.g., Social media channels (Instagram, Facebook, LinkedIn)"}),F.usage_points.length>1&&(0,f.jsx)("button",{type:"button",onClick:()=>(e=>{F.usage_points.length<=1||E(t=>(0,m.A)((0,m.A)({},t),{},{usage_points:t.usage_points.filter((t,s)=>s!==e)}))})(t),title:"Remove point",style:{background:"none",border:"none",color:"#991B1B",cursor:"pointer",display:"flex",padding:6,flexShrink:0},children:(0,f.jsx)(g.A,{size:18})})]},t)),(0,f.jsxs)("button",{type:"button",onClick:()=>{E(e=>(0,m.A)((0,m.A)({},e),{},{usage_points:[...e.usage_points,""]}))},style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,width:"100%",border:"2px dashed #C9C9D0",borderRadius:11,padding:"11px",background:"transparent",color:"#55555C",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer"},children:[(0,f.jsx)(ls.A,{size:17}),(0,f.jsx)("span",{children:"Add Usage Point"})]})]})}),(0,f.jsx)(Ij,{title:"Terms & Conditions",subtitle:s?"Edit the legal terms and conditions for this consent project.":"Add custom terms and conditions. If left blank, default terms will be applied when the project is saved.",children:(0,f.jsx)(zl.A,{value:F.terms_and_conditions,onChange:e=>D("terms_and_conditions",e),className:"consent-quill-editor",theme:"snow",modules:{toolbar:[[{header:[1,2,3,!1]}],["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}],["link"],["clean"]]},placeholder:"Enter the terms and conditions for image consent. If left blank, default terms will be used..."})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,f.jsxs)("button",{type:"button",onClick:()=>e("/admin/consent"),style:O,children:[(0,f.jsx)(Ct.A,{size:15})," Cancel"]}),(0,f.jsxs)("button",{className:"tg-btn-primary",onClick:R,disabled:c,style:W,children:[(0,f.jsx)(ia.A,{size:15})," ",c?"Saving\u2026":s?"Update Project":"Create Project"]})]})]})]})},Pj="'Space Mono',monospace",Wj={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},Oj=e=>{let{children:t,color:s="#9A9AA0",style:a}=e;return(0,f.jsx)("div",{style:(0,m.A)({fontFamily:Pj,fontSize:10.5,letterSpacing:"0.16em",color:s,textTransform:"uppercase"},a),children:t})},Lj=(e,t,s)=>({display:"inline-flex",alignItems:"center",gap:7,background:e,color:t,border:s||"none",borderRadius:9,padding:"10px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",textDecoration:"none",whiteSpace:"nowrap"}),Mj=e=>{let{icon:t,label:s,value:a,mono:n,breakAll:r}=e;return(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:11,padding:"11px 13px",background:"#F7F7F9",borderRadius:9},children:[(0,f.jsx)(t,{size:17,color:"#9A9AA0",style:{flexShrink:0,marginTop:1}}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{style:{fontFamily:Pj,fontSize:9.5,letterSpacing:"0.12em",color:"#9A9AA0",textTransform:"uppercase",marginBottom:2},children:s}),(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:"#0A0A0B",fontFamily:n?Pj:void 0,wordBreak:r?"break-all":void 0},children:a})]})]})},qj=()=>{const e=(0,r.Zp)(),{projectId:t}=(0,r.g)(),{toast:s,confirm:n}=N(),[i,l]=(0,a.useState)(null),[c,d]=(0,a.useState)([]),[x,h]=(0,a.useState)(!0),[u,b]=(0,a.useState)(!0),[y,v]=(0,a.useState)(null),[j,w]=(0,a.useState)(null),A=(0,a.useRef)(null);(0,a.useEffect)(()=>{(async()=>{(0,o.cd)()?(k(),S()):e("/?admin=true")})()},[e,t]);const k=async()=>{h(!0);try{var a;const n=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token,r=await fetch("".concat(I.fn,"/api/consent-projects/").concat(t),{headers:{Authorization:"Bearer ".concat(n)}});if(r.ok){const e=await r.json();l(e.project||e)}else s.error("Failed to load project"),e("/admin/consent")}catch(n){console.error("Error fetching project:",n),s.error("Error loading project")}finally{h(!1)}},S=async()=>{b(!0);try{var e;const s=null===(e=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===e?void 0:e.token,a=await fetch("".concat(I.fn,"/api/consent-projects/").concat(t,"/submissions"),{headers:{Authorization:"Bearer ".concat(s)}});if(a.ok){const e=await a.json();d(e.submissions||e||[])}else console.error("Failed to load submissions")}catch(s){console.error("Error fetching submissions:",s)}finally{b(!1)}},_=async e=>{if(await n({title:"Delete Submission?",message:"Are you sure you want to delete this consent submission? This action cannot be undone.",type:"warning",confirmText:"Delete",confirmColor:"red"})){w(e);try{var a;const n=null===(a=JSON.parse(localStorage.getItem("turbo360_admin_auth")))||void 0===a?void 0:a.token;(await fetch("".concat(I.fn,"/api/consent-projects/").concat(t,"/submissions/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(n)}})).ok?(s.success("Submission deleted"),d(t=>t.filter(t=>t.id!==e)),(null===y||void 0===y?void 0:y.id)===e&&v(null)):s.error("Failed to delete submission")}catch(r){console.error("Error deleting submission:",r),s.error("Error deleting submission")}finally{w(null)}}},C=null!==i&&void 0!==i&&i.public_url_slug?"https://turbo.net.au/consent/".concat(i.public_url_slug):"",F=e=>{if(!e)return"-";return new Date(e).toLocaleDateString("en-AU",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})};if(x)return(0,f.jsx)(ta,{title:"Consent Project",meta:"SYSTEM \xb7 CONSENT",children:(0,f.jsx)(Ws,{rows:8})});if(!i)return(0,f.jsx)(ta,{title:"Consent Project",meta:"SYSTEM \xb7 CONSENT",children:(0,f.jsx)(Os,{icon:Oa.A,title:"Project not found",message:"This consent project could not be loaded.",actionLabel:"Back to Consent",onAction:()=>e("/admin/consent")})});const z="active"===i.status;return(0,f.jsxs)(ta,{title:"Consent Project",meta:"SYSTEM \xb7 CONSENT",children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginBottom:20,flexWrap:"wrap"},children:[(0,f.jsxs)("button",{onClick:()=>e("/admin/consent"),style:Lj("#fff","#55555C","1px solid #E4E4E9"),children:[(0,f.jsx)(Ct.A,{size:15})," Consent"]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,f.jsx)("h1",{className:"tg-ui",style:{fontFamily:"'Archivo',sans-serif",fontWeight:800,fontSize:24,letterSpacing:"-0.01em",margin:0},children:i.project_name}),(0,f.jsx)(Ds,{tone:z?"green":"gray",radius:7,children:z?"Active":"Archived"})]}),(0,f.jsx)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:(0,f.jsxs)("button",{onClick:()=>e("/admin/consent/edit/".concat(t)),className:"tg-btn-primary",style:Lj("#BF212F","#fff"),children:[(0,f.jsx)(Tn.A,{size:15})," Edit Project"]})})]}),(0,f.jsxs)("div",{className:"tg-bottom-grid",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:20,alignItems:"start"},children:[(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:[(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Wj),{},{padding:"18px 20px"}),children:[(0,f.jsx)(Oj,{style:{marginBottom:14},children:"Project Info"}),i.company_name&&(0,f.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",gap:12,fontSize:13,marginBottom:14},children:[(0,f.jsx)("span",{style:{color:"#9A9AA0"},children:"Company"}),(0,f.jsx)("span",{style:{fontWeight:600,textAlign:"right"},children:i.company_name})]}),(0,f.jsx)(Oj,{style:{marginBottom:8},children:"Public Consent Link"}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8},children:[(0,f.jsx)("div",{style:{flex:1,minWidth:0,background:"#F7F7F9",border:"1px solid #E4E4E9",borderRadius:9,padding:"9px 12px",fontFamily:Pj,fontSize:12,color:"#333",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C}),(0,f.jsx)("button",{onClick:()=>{C&&navigator.clipboard.writeText(C).then(()=>{s.success("URL copied to clipboard")}
1).catch(()=>{s.error("Failed to copy URL")})},title:"Copy URL",style:(0,m.A)((0,m.A)({},Lj("#fff","#55555C","1px solid #E4E4E9")),{},{padding:"9px 11px",flexShrink:0}),children:(0,f.jsx)(Cr.A,{size:15})}),(0,f.jsx)("a",{href:C,target:"_blank",rel:"noopener noreferrer",title:"Open in new tab",style:(0,m.A)((0,m.A)({},Lj("#fff","#55555C","1px solid #E4E4E9")),{},{padding:"9px 11px",flexShrink:0}),children:(0,f.jsx)(En.A,{size:15})})]}),(0,f.jsx)("p",{style:{fontSize:12,color:"#9A9AA0",margin:"0 0 18px",lineHeight:1.6},children:"Share this link with participants or display the QR code at your event."}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:12},children:[(0,f.jsx)("div",{ref:A,style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:12,padding:12},children:(0,f.jsx)(Cj.h,{value:C,size:180,level:"H",includeMargin:!0})}),(0,f.jsxs)("button",{onClick:()=>{if(!A.current)return;const e=A.current.querySelector("svg");if(!e)return;const t=(new XMLSerializer).serializeToString(e),s=document.createElement("canvas"),a=s.getContext("2d"),n=new window.Image;n.onload=()=>{s.width=2*n.width,s.height=2*n.height,a.fillStyle="#ffffff",a.fillRect(0,0,s.width,s.height),a.drawImage(n,0,0,s.width,s.height);const e=document.createElement("a");e.download="consent-qr-".concat((null===i||void 0===i?void 0:i.public_url_slug)||"code",".png"),e.href=s.toDataURL("image/png"),e.click()},n.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(t)))},style:Lj("#fff","#333","1px solid #E4E4E9"),children:[(0,f.jsx)(es.A,{size:15})," Download QR Code"]})]})]}),i.usage_points&&i.usage_points.length>0&&(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Wj),{},{padding:"18px 20px"}),children:[(0,f.jsx)(Oj,{style:{marginBottom:14},children:"Usage Points"}),(0,f.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:10},children:i.usage_points.map((e,t)=>(0,f.jsxs)("li",{style:{display:"flex",alignItems:"flex-start",gap:10,fontSize:13.5,color:"#333",lineHeight:1.5},children:[(0,f.jsx)(p.A,{size:16,color:"#16A34A",style:{flexShrink:0,marginTop:1}}),e]},t))})]})]}),(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:20},children:(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},Wj),{},{overflow:"hidden"}),children:[(0,f.jsxs)("div",{style:{padding:"16px 20px",borderBottom:"1px solid #EDEDF0",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,f.jsx)("span",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:15},children:"Submissions"}),(0,f.jsx)("span",{style:{fontFamily:Pj,fontSize:10.5,background:"#EDEDF0",color:"#55555C",borderRadius:20,padding:"3px 9px",textTransform:"uppercase"},children:c.length})]}),u?(0,f.jsxs)("div",{style:{padding:"40px 20px",textAlign:"center"},children:[(0,f.jsx)(Kr.A,{size:28,className:"animate-spin",style:{color:"#B5B5BC",margin:"0 auto 10px"}}),(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0"},children:"Loading submissions\u2026"})]}):0===c.length?(0,f.jsxs)("div",{style:{padding:"40px 24px",textAlign:"center"},children:[(0,f.jsx)("div",{style:{width:46,height:46,borderRadius:12,background:"#F7F7F9",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 14px",color:"#B5B5BC"},children:(0,f.jsx)(Jr.A,{size:22})}),(0,f.jsx)("div",{style:{fontSize:14,fontWeight:700,marginBottom:6},children:"No submissions yet"}),(0,f.jsx)("div",{style:{fontSize:13,color:"#9A9AA0",maxWidth:320,marginInline:"auto"},children:"Submissions will appear here once participants complete the consent form."})]}):(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:14,padding:16},children:c.map(e=>(0,f.jsxs)("div",{className:"tg-tile",onClick:()=>v(e),style:(0,m.A)((0,m.A)({},Wj),{},{padding:14,cursor:"pointer",position:"relative"}),children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11,marginBottom:10},children:[e.selfie_url?(0,f.jsx)("img",{src:e.selfie_url,alt:e.name,style:{width:48,height:48,borderRadius:"50%",objectFit:"cover",border:"2px s
1olid #EDEDF0",flexShrink:0}}):(0,f.jsx)("div",{style:{width:48,height:48,borderRadius:"50%",background:"#FEE2E2",display:"flex",alignItems:"center",justifyContent:"center",border:"2px solid #EDEDF0",flexShrink:0},children:(0,f.jsx)(Ye.A,{size:20,color:"#BF212F"})}),(0,f.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:700,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),e.email&&(0,f.jsxs)("div",{style:{fontSize:11.5,color:"#9A9AA0",display:"flex",alignItems:"center",gap:4,overflow:"hidden"},children:[(0,f.jsx)(T.A,{size:11,style:{flexShrink:0}}),(0,f.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.email})]})]})]}),e.phone&&(0,f.jsxs)("div",{style:{fontSize:12,color:"#9A9AA0",display:"flex",alignItems:"center",gap:6,marginBottom:8},children:[(0,f.jsx)(E.A,{size:12,style:{flexShrink:0}}),e.phone]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:8,borderTop:"1px solid #F2F2F5"},children:[(0,f.jsxs)("div",{style:{fontFamily:Pj,fontSize:10.5,color:"#9A9AA0",display:"flex",alignItems:"center",gap:5},children:[(0,f.jsx)(_t.A,{size:11}),F(e.submitted_at||e.created_at)]}),(0,f.jsx)("button",{onClick:t=>{t.stopPropagation(),_(e.id)},disabled:j===e.id,title:"Delete submission",style:{width:28,height:28,borderRadius:8,background:"transparent",border:"none",color:"#991B1B",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",opacity:j===e.id?.5:1},children:j===e.id?(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}):(0,f.jsx)(la.A,{size:15})})]})]},e.id))})]})})]}),y&&(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(10,10,11,.55)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,padding:16},onClick:()=>v(null),children:(0,f.jsxs)("div",{className:"tg-scroll",style:(0,m.A)((0,m.A)({},Wj),{},{maxWidth:520,width:"100%",maxHeight:"90vh",overflowY:"auto",boxShadow:"0 20px 60px rgba(10,10,11,.35)"}),onClick:e=>e.stopPropagation(),children:[(0,f.jsxs)("div",{style:{position:"sticky",top:0,background:"#fff",padding:"16px 20px",borderBottom:"1px solid #EDEDF0",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:"14px 14px 0 0",zIndex:1},children:[(0,f.jsx)("span",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:16},children:"Submission Details"}),(0,f.jsx)("button",{onClick:()=>v(null),style:{width:32,height:32,borderRadius:8,background:"#F7F7F9",border:"none",color:"#55555C",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,f.jsx)(g.A,{size:16})})]}),(0,f.jsxs)("div",{style:{padding:"20px",display:"flex",flexDirection:"column",gap:18},children:[(0,f.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:y.selfie_url?(0,f.jsx)("img",{src:y.selfie_url,alt:y.name,style:{width:140,height:140,borderRadius:"50%",objectFit:"cover",border:"4px solid #FEE2E2"}}):(0,f.jsx)("div",{style:{width:140,height:140,borderRadius:"50%",background:"#FEF2F2",display:"flex",alignItems:"center",justifyContent:"center",border:"4px solid #FEE2E2"},children:(0,f.jsx)(Ye.A,{size:56,color:"#FCA5A5"})})}),(0,f.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,f.jsx)(Mj,{icon:Ye.A,label:"Name",value:y.name}),y.email&&(0,f.jsx)(Mj,{icon:T.A,label:"Email",value:y.email}),y.phone&&(0,f.jsx)(Mj,{icon:E.A,label:"Phone",value:y.phone}),(0,f.jsx)(Mj,{icon:_t.A,label:"Submitted",value:F(y.submitted_at||y.created_at)}),y.ip_address&&(0,f.jsx)(Mj,{icon:et.A,label:"IP Address",value:y.ip_address,mono:!0}),y.user_agent&&(0,f.jsx)(Mj,{icon:Da.A,label:"User Agent",value:y.user_agent,breakAll:!0})]}),y.signature_url&&(0,f.jsxs)("div",{children:[(0,f.jsx)(Oj,{style:{marginBottom:8},children:"Signature"}),(0,f.jsx)("div",{style:{background:"#fff",border:"1px solid #E4E4E9",borderRadius:9,padding:12},children:(0,f.jsx)("img",{src:y.signature_url,alt:"Signature",style:{maxHeight:96,width:"auto"}})})]}),i.usage_points&&i.usage_points.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsx)(Oj,{color:"#15803D",style:{marginBottom:10},children:"Agreed Usage Points"}),(0,f.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:8},children:i.usage_points.map((e,t)=>(0,f.jsxs)("li",{style:{display:"flex",alignItems:"flex-start",ga
1p:8,fontSize:13,color:"#55555C",lineHeight:1.5},children:[(0,f.jsx)(p.A,{size:15,color:"#16A34A",style:{flexShrink:0,marginTop:1}}),e]},t))})]})]}),(0,f.jsxs)("div",{style:{padding:"14px 20px",background:"#FBFBFC",borderTop:"1px solid #EDEDF0",display:"flex",justifyContent:"space-between",alignItems:"center",borderRadius:"0 0 14px 14px"},children:[(0,f.jsxs)("button",{onClick:()=>{v(null),_(y.id)},style:Lj("#fff","#991B1B","1px solid #FECACA"),children:[(0,f.jsx)(la.A,{size:15})," Delete"]}),(0,f.jsx)("button",{onClick:()=>v(null),style:Lj("#fff","#333","1px solid #E4E4E9"),children:"Close"})]})]})})]})};var Hj=s(17029),Uj=s.n(Hj);const Gj=()=>{const{slug:e}=(0,r.g)(),[t,s]=(0,a.useState)(null),[n,i]=(0,a.useState)(!0),[o,l]=(0,a.useState)(null),[c,d]=(0,a.useState)(""),[m,x]=(0,a.useState)(""),[u,g]=(0,a.useState)(""),[b,y]=(0,a.useState)(!1),[v,j]=(0,a.useState)(null),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(!1),[S,_]=(0,a.useState)("user"),C=(0,a.useRef)(null),F=(0,a.useRef)(null),[z,B]=(0,a.useState)(null),[D,R]=(0,a.useState)(!1),P=(0,a.useRef)(null),W=(0,a.useRef)(null),[O,L]=(0,a.useState)(!1),[M,q]=(0,a.useState)(null),[H,U]=(0,a.useState)(!1);(0,a.useEffect)(()=>{G()},[e]);const G=async()=>{i(!0),l(null);try{const t=await fetch("".concat(I.fn,"/api/consent/").concat(e));if(!t.ok)return void(404===t.status?l("not_found"):l("server_error"));const a=await t.json(),n=a.project||a;if("archived"===n.status)return void l("archived");s(n)}catch(t){console.error("Failed to load consent project:",t),l("network_error")}finally{i(!1)}},V=(0,a.useCallback)(()=>{N(!0),k(!1)},[]),J=(0,a.useCallback)(e=>{console.error("Camera error:",e),N(!1),k(!0)},[]),Y=(0,a.useCallback)(()=>{if(C.current){const e=C.current.getScreenshot();e&&j(e)}},[]),K=(0,a.useCallback)(()=>{j(null)},[]),Z=(0,a.useCallback)(e=>{var t;const s=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!s)return;const a=new FileReader;a.onload=e=>{j(e.target.result)},a.readAsDataURL(s)},[]),$=(0,a.useCallback)(e=>{if(!e)return;P.current=e;const t=e.getContext("2d");t.strokeStyle="#1f2937",t.lineWidth=2.5,t.lineCap="round",t.lineJoin="round",W.current=t;const s=e.getBoundingClientRect(),a=window.devicePixelRatio||1;e.width=s.width*a,e.height=s.height*a,t.scale(a,a),t.strokeStyle="#1f2937",t.lineWidth=2.5,t.lineCap="round",t.lineJoin="round"},[]),Q=(0,a.useCallback)(e=>{const t=P.current;if(!t)return{x:0,y:0};const s=t.getBoundingClientRect(),a=e.touches?e.touches[0].clientX:e.clientX,n=e.touches?e.touches[0].clientY:e.clientY;return{x:a-s.left,y:n-s.top}},[]),X=(0,a.useCallback)(e=>{e.preventDefault();const t=W.current;if(!t)return;R(!0);const s=Q(e);t.beginPath(),t.moveTo(s.x,s.y)},[Q]),ee=(0,a.useCallback)(e=>{if(e.preventDefault(),!D)return;const t=W.current;if(!t)return;const s=Q(e);t.lineTo(s.x,s.y),t.stroke()},[D,Q]),te=(0,a.useCallback)(e=>{if(e&&e.preventDefault(),!D)return;R(!1);const t=P.current;t&&B(t.toDataURL("image/png"))},[D]),se=(0,a.useCallback)(()=>{const e=P.current,t=W.current;if(e&&t){const s=window.devicePixelRatio||1;t.clearRect(0,0,e.width/s,e.height/s)}B(null)},[]),ae=e=>{const t=e.split(";base64,"),s=t[0].split(":")[1],a=atob(t[1]),n=a.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=a.charCodeAt(i);return new Blob([r],{type:s})},ne=c.trim()&&m.trim()&&u.trim()&&v&&z&&b,re=()=>{d(""),x(""),g(""),j(null),y(!1),U(!1),q(null),se()};if(n)return(0,f.jsx)("div",{className:"h-dvh flex items-center justify-center bg-gradient-to-br from-slate-50 to-gray-100",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)(Kr.A,{className:"h-10 w-10 animate-spin text-rose-500 mx-auto mb-4"}),(0,f.jsx)("p",{className:"text-gray-500 text-sm",children:"Loading consent form..."})]})});if(o){const e={not_found:{title:"Form Not Found",subtitle:"This consent form is no longer available or the link may be incorrect."},archived:{title:"Form Closed",subtitle:"This consent form has been archived and is no longer accepting submissions."},server_error:{title:"Something Went Wrong",subtitle:"We encountered an error loading this form. Please try again later."}
1,network_error:{title:"Connection Error",subtitle:"Unable to connect to the server. Please check your internet connection and try again."}},t=e[o]||e.server_error;return(0,f.jsx)("div",{className:"h-dvh flex items-center justify-center bg-gradient-to-br from-slate-50 to-gray-100 p-6",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-8 max-w-md w-full text-center",children:[(0,f.jsx)("div",{className:"w-16 h-16 rounded-full bg-rose-100 flex items-center justify-center mx-auto mb-5",children:(0,f.jsx)(h.A,{className:"h-8 w-8 text-rose-500"})}),(0,f.jsx)("h1",{className:"text-xl font-bold text-gray-900 mb-2",children:t.title}),(0,f.jsx)("p",{className:"text-gray-500 text-sm leading-relaxed",children:t.subtitle})]})})}if(H)return(0,f.jsx)("div",{className:"h-dvh flex items-center justify-center bg-gradient-to-br from-slate-50 to-gray-100 p-6",children:(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-8 max-w-md w-full text-center",children:[(0,f.jsx)("div",{className:"w-20 h-20 rounded-full bg-green-100 flex items-center justify-center mx-auto mb-6",children:(0,f.jsx)(p.A,{className:"h-10 w-10 text-green-500"})}),(0,f.jsx)("h1",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Thank you!"}),(0,f.jsx)("p",{className:"text-gray-500 text-sm leading-relaxed mb-8",children:"Your consent has been recorded successfully."}),(0,f.jsx)("button",{onClick:re,className:"w-full bg-rose-600 hover:bg-rose-700 text-white font-semibold py-3 rounded-lg transition-colors",children:"ADD ANOTHER"}),(0,f.jsxs)("div",{className:"mt-6 flex items-center justify-center gap-2 text-xs text-gray-400",children:[(0,f.jsx)("span",{children:"Powered by"}),(0,f.jsx)("img",{src:"/turbo-logo-new.png",alt:"Turbo 360",className:"h-4 opacity-50"})]})]})});const ie={facingMode:S,width:{ideal:720},height:{ideal:720}},oe=null!==t&&void 0!==t&&t.company_logo_url?t.company_logo_url.startsWith("http")?t.company_logo_url:"".concat(I.fn).concat(t.company_logo_url):null;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("style",{children:"\n .consent-terms-prose h1,\n .consent-terms-prose h2,\n .consent-terms-prose h3 {\n color: #1f2937;\n font-weight: 700;\n margin-top: 1rem;\n margin-bottom: 0.5rem;\n }\n .consent-terms-prose h1 { font-size: 1.125rem; }\n .consent-terms-prose h2 { font-size: 1rem; }\n .consent-terms-prose h3 { font-size: 0.9375rem; }\n .consent-terms-prose h3:first-child,\n .consent-terms-prose h2:first-child,\n .consent-terms-prose h1:first-child {\n margin-top: 0;\n }\n .consent-terms-prose p {\n color: #374151;\n font-size: 0.8125rem;\n line-height: 1.6;\n margin-bottom: 0.625rem;\n }\n .consent-terms-prose strong {\n color: #1f2937;\n font-weight: 600;\n }\n .consent-terms-prose ul, .consent-terms-prose ol {\n margin-left: 1.25rem;\n margin-bottom: 0.625rem;\n }\n .consent-terms-prose ul { list-style-type: disc; }\n .consent-terms-prose ol { list-style-type: decimal; }\n .consent-terms-prose li {\n color: #374151;\n font-size: 0.8125rem;\n margin-bottom: 0.25rem;\n line-height: 1.5;\n }\n .consent-terms-prose a {\n color: #e11d48;\n text-decoration: underline;\n }\n"}),(0,f.jsxs)("div",{className:"h-dvh flex flex-col bg-gradient-to-br from-slate-50 via-white to-gray-50 overflow-hidden",children:[(0,f.jsxs)("header",{className:"flex-shrink-0 bg-white border-b border-gray-200 px-4 py-2.5 lg:py-3",children:[(0,f.jsxs)("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[(0,f.jsx)("div",{className:"flex items-center gap-3 min-w-0",children:oe?(0,f.jsx)("img",{src:oe,alt:(null===t||void 0===t?void 0:t.project_name)||"Company Logo",className:"h-8 lg:h-10 max-w-[160px] object-contain"}):(0,f.jsx)("img",{src:"/turbo-logo-new.png",alt:"Turbo 360",className:"h-8 lg:h-10 object-contain"})}),(0,f.jsxs)("div",{className:"hidden sm:block text-center flex-1 px-4",children:[(0,f.jsx)("h1",{className:"text-base lg:text-lg font-bold text-gray-900 truncate",children:(null===t||void 0===t?void 0:t.form_title)||"Image Consent Form"}),(null===t||void 0===t?void 0:t.project_name)&&(0,f.jsx)("p",{className:"text-xs text-gray-500 truncate",children:t.project_name})]}),(0,f.jsx)("div",{className:"flex items-center gap-2 flex-shrink-0",children:oe&&(0,f.jsxs)("div",{className:"flex items-center gap-1.5 bg-gray-50 rounded-full px-2.5 py-1",children:[(0,f.jsx)("img",{src:"/turbo-logo-new.png",alt:"Turbo 360",className:"h-4 opacity-60"}),(0,f.jsx)("span",{className:"text-[10px] text-gray-400 font-medium hidden md:inline",children:"Turbo 360"})]})})]}),(0,f.jsx)("div",{className:"sm:hidden mt-1.5 text-center",children:(0,f.jsx)("h1",{className:"text-sm font-bold text-gray-900 truncate",children:(null===t||void 0===t?void 0:t.form_title)||"Image Consent Form"})})]}),(0,f.jsx)("main",{className:"flex-1 min-h-0 overflow-hidden",children:(0,f.jsxs)("div",{className:"h-full max-w-7xl mx-auto flex flex-col lg:flex-row",children:[(0,f.jsxs)("div",{className:" lg:w-[45%] flex-shrink-0 h-[35vh] sm:h-[40vh] lg:h-full p-3 lg:p-5 flex flex-col ",children:[(0,f.jsxs)("div",{className:"flex-1 min-h-0 bg-gray-900 rounded-xl overflow-hidden relative flex items-center justify-center",children:[v?(0,f.jsx)("img",{src:v,alt:"Captured selfie",className:"w-full h-full object-cover"}):A?(0,f.jsxs)("div",{className:"flex flex-col items-center justify-center p-6 text-center",children:[(0,f.jsx)("div",{className:"w-16 h-16 rounded-full bg-gray-800 flex items-center justify-center mb-4",children:(0,f.jsx)(_s.A,{className:"h-8 w-8 text-gray-400"})}),(0,f.jsx)("p",{className:"text-gray-400 text-sm mb-1",children:"Camera unavailable"}),(0,f.jsx)("p",{className:"text-gray-500 text-xs mb-4",children:"Tap below to take a photo"}),(0,f.jsx)("input",{ref:F,type:"file",accept:"image/*",capture:"user",onChange:Z,className:"hidden"}),(0,f.jsxs)("button",{type:"button",onClick:()=>{var e;return null===(e=F.current)||void 0===e?void 0:e.click()},className:"bg-rose-600 hover:bg-rose-700 text-white font-semibold px-6 py-2.5 rounded-lg transition-colors text-sm",children:[(0,f.jsx)(Ue.A,{className:"h-4 w-4 inline mr-2"}),"Take Photo"]})]}):(0,f.jsx)(Uj(),{ref:C,audio:!1,screenshotFormat:"image/jpeg",screenshotQuality:.8,videoConstraints:ie,mirrored:"user"===S,onUserMedia:V,onUserMediaError:J,className:"w-full h-full object-cover"}),!v&&!A&&!w&&(0,f.jsx)("div",{className:"absolute inset-0 bg-gray-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)(Kr.A,{className:"h-8 w-8 animate-spin text-gray-400 mx-auto mb-2"}),(0,f.jsx)("p",{className:"text-gray-500 text-xs",children:"Starting camera..."})]})})]}),(0,f.jsx)("div",{className:"flex-shrink-0 mt-2.5 lg:mt-3",children:v?(0,f.jsxs)("button",{type:"button",onClick:K,className:"w-full bg-gray-700 hover:bg-gray-600 text-white font-semibold py-2.5 lg:py-3 rounded-lg transition-colors text-sm flex items-center justify-center gap-2",children:[(0,f.jsx)(bj.A,{className:"h-4 w-4"}),"Retake Photo"]}):A?null:(0,f.jsxs)("button",{type:"button",onClick:Y,disabled:!w,className:"w-full bg-rose-600 hover:bg-rose-700 text-white font-semibold py-2.5 lg:py-3 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed text-sm flex items-center justify-center gap-2",children:[(0,f.jsx)(Ue.A,{className:"h-4 w-4"}),"Take Photo"]})})]}),(0,f.jsx)("div",{className:" lg:w-[55%] flex-1 overflow-y-auto lg:overflow-y-auto p-3 pt-1 lg:p-5 lg:pl-2 ",children:(0,f.jsxs)("form",{onSubmit:async t=>{if(t.preventDefault(),ne&&!O){L(!0),q(null);try{const t=new FormData;t.append("name",c.trim()),t.append("email",m.trim()),t.append("phone",u.trim());const s=ae(v);if(t.append("selfie",s,"selfie.jpg"),z){const e=ae(z);t.append("signature",e,"signature.png")}const a=await fetch("".concat(I.fn,"/api/consent/").concat(e,"/submit"),{method:"POST",body:t});if(!a.ok){const e=await a.json().catch(()=>null);throw new Error((null===e||void 0===e?void 0:e.detail)||"Failed to submit c
1onsent form")}U(!0)}catch(s){console.error("Submit error:",s),q(s.message||"Something went wrong. Please try again.")}finally{L(!1)}}},className:"h-full flex flex-col",children:[(0,f.jsxs)("div",{className:"flex-shrink-0 space-y-2.5 lg:space-y-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-xs font-semibold text-gray-700 mb-1",children:[(0,f.jsx)(Ye.A,{className:"h-3.5 w-3.5 inline mr-1 text-gray-400"}),"Full Name ",(0,f.jsx)("span",{className:"text-rose-500",children:"*"})]}),(0,f.jsx)("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:"Enter your full name",required:!0,className:"flex h-10 w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-xs font-semibold text-gray-700 mb-1",children:[(0,f.jsx)(T.A,{className:"h-3.5 w-3.5 inline mr-1 text-gray-400"}),"Email ",(0,f.jsx)("span",{className:"text-rose-500",children:"*"})]}),(0,f.jsx)("input",{type:"email",value:m,onChange:e=>x(e.target.value),placeholder:"Enter your email address",required:!0,className:"flex h-10 w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]}),(0,f.jsxs)("div",{children:[(0,f.jsxs)("label",{className:"block text-xs font-semibold text-gray-700 mb-1",children:[(0,f.jsx)(E.A,{className:"h-3.5 w-3.5 inline mr-1 text-gray-400"}),"Phone ",(0,f.jsx)("span",{className:"text-rose-500",children:"*"})]}),(0,f.jsx)("input",{type:"tel",value:u,onChange:e=>g(e.target.value),placeholder:"Enter your phone number",required:!0,className:"flex h-10 w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-rose-500 focus:border-transparent"})]})]}),(null===t||void 0===t?void 0:t.usage_points)&&t.usage_points.length>0&&(0,f.jsxs)("div",{className:"flex-shrink-0 mt-3 lg:mt-4",children:[(0,f.jsxs)("h2",{className:"text-xs font-semibold text-gray-700 mb-1.5 flex items-center gap-1.5",children:[(0,f.jsx)(Oa.A,{className:"h-3.5 w-3.5 text-rose-500"}),"Authorised Purposes"]}),(0,f.jsx)("div",{className:"bg-rose-50 border border-rose-100 rounded-lg p-3",children:(0,f.jsx)("ul",{className:"space-y-1.5",children:t.usage_points.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start gap-2 text-xs text-gray-700 leading-relaxed",children:[(0,f.jsx)("span",{className:"flex-shrink-0 w-1.5 h-1.5 mt-1.5 rounded-full bg-rose-400"}),(0,f.jsx)("span",{children:e})]},t))})})]}),(null===t||void 0===t?void 0:t.terms_and_conditions)&&(0,f.jsxs)("div",{className:"flex-shrink-0 mt-3 lg:mt-4 min-h-0",children:[(0,f.jsx)("h2",{className:"text-xs font-semibold text-gray-700 mb-1.5",children:"General Terms & Conditions"}),(0,f.jsx)("div",{className:"consent-terms-prose bg-gray-50 border border-gray-200 rounded-lg p-3 overflow-y-auto max-h-[120px] sm:max-h-[140px] lg:max-h-[150px]",children:(0,f.jsx)("div",{dangerouslySetInnerHTML:{__html:or.default.sanitize(t.terms_and_conditions)}})})]}),(0,f.jsxs)("div",{className:"flex-shrink-0 mt-3 lg:mt-4",children:[(0,f.jsx)("label",{className:"block text-xs font-semibold text-gray-700 mb-1.5",children:(0,f.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,f.jsx)(Oa.A,{className:"h-3.5 w-3.5 text-rose-500"}),"Signature ",(0,f.jsx)("span",{className:"text-red-500",children:"*"})]})}),(0,f.jsxs)("div",{className:"relative border-2 border-dashed border-gray-300 rounded-lg bg-white overflow-hidden",style:{touchAction:"none"},children:[(0,f.jsx)("canvas",{ref:$,className:"w-full cursor-crosshair",style:{height:"100px",display:"block"},onMouseDown:X,onMouseMove:ee,onMouseUp:te,onMouseLeave:te,onTouchStart:X,onTouchMove:ee,onTouchEnd:te}),!z&&(0,f.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,f.jsx)("p",{className:"text-xs text-gray-400",children:"Draw your signature here"})})]}),z&&(0,f.jsx)("button",{type:"button",onClick:se,className:"mt-1 text-xs text-rose-600 hover:text-rose-700 font-medium",children:"Clear Signature"})]}),(0,f.jsxs)("div",{className:"flex-shrink-0 mt-3 lg:mt-4 space-y-3",children:[(0,f.jsxs)("label",{className:"flex items-start gap-2.5 cursor-pointer group",children:[(0,f.jsx)("input",{type:"checkbox",checked:b,onChange:e=>
1y(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border-gray-300 text-rose-600 focus:ring-rose-500 cursor-pointer flex-shrink-0"}),(0,f.jsx)("span",{className:"text-xs text-gray-600 leading-relaxed group-hover:text-gray-800 transition-colors select-none",children:"I have read and agree to the Authorised Purposes and General Terms & Conditions"})]}),M&&(0,f.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-2.5 flex items-start gap-2",children:[(0,f.jsx)(h.A,{className:"h-4 w-4 text-red-500 flex-shrink-0 mt-0.5"}),(0,f.jsx)("p",{className:"text-xs text-red-700",children:M})]}),(0,f.jsx)("button",{type:"submit",disabled:!ne||O,className:"w-full bg-rose-600 hover:bg-rose-700 text-white font-semibold py-3 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:O?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(Kr.A,{className:"h-4 w-4 animate-spin"}),(0,f.jsx)("span",{className:"text-sm",children:"Submitting..."})]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(p.A,{className:"h-4 w-4"}),(0,f.jsx)("span",{className:"text-sm",children:"Submit Consent"})]})})]}),(0,f.jsx)("div",{className:"flex-shrink-0 h-4 lg:h-2"})]})})]})}),(0,f.jsx)("div",{className:"hidden lg:block flex-shrink-0 py-1.5 text-center",children:(0,f.jsx)("span",{className:"text-[10px] text-gray-400",children:"Powered by Turbo 360"})})]})]})};var Vj=s(71587),Jj=s(74912),Yj=s(33695),Kj=s(1620),Zj=s(38605),$j=s(82206),Qj=s(24653),Xj=s(79950),ew=s(66465),tw=s(91208),sw=s(92885),aw=s(65757),nw=s(47142);const rw="'Space Mono',monospace",iw={background:"#fff",border:"1px solid #E4E4E9",borderRadius:14},ow={fontSize:11.5,fontWeight:600,color:"#55555C",marginBottom:6,display:"block"},lw={width:"100%",border:"1px solid #E4E4E9",borderRadius:9,padding:"11px 13px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13.5,color:"#0A0A0B",background:"#FBFBFC",outline:"none"},cw=(e,t,s)=>({display:"inline-flex",alignItems:"center",gap:7,background:e,color:t,border:s||"none",borderRadius:9,padding:"10px 14px",fontFamily:"'Hanken Grotesk',sans-serif",fontSize:13,fontWeight:600,cursor:"pointer",textDecoration:"none",whiteSpace:"nowrap"}),dw={width:34,height:34,borderRadius:9,background:"#fff",border:"1px solid #E4E4E9",cursor:"pointer",color:"#55555C",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},mw=["#BF212F","#38BDF8","#7C3AED","#F2A900","#0FA3A3","#E11D8F"],pw=()=>{const e=(0,r.Zp)(),[t]=(0,r.ok)(),[s,n]=(0,a.useState)(!1),[i,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(!0),[p,x]=(0,a.useState)([]),[h,u]=(0,a.useState)(new Date),[b,y]=(0,a.useState)(null),[v,j]=(0,a.useState)(!1),[w,N]=(0,a.useState)(!1),[A,k]=(0,a.useState)(null),[S,_]=(0,a.useState)(!1),[F,E]=(0,a.useState)({summary:"",description:"",location:"",start_date:"",start_time:"09:00",end_date:"",end_time:"10:00",all_day:!1}),T=(0,o.c4)();(0,a.useEffect)(()=>{(0,o.cd)()?B():e("/tboadmin")},[]),(0,a.useEffect)(()=>{"true"===t.get("connected")&&B()},[t]),(0,a.useEffect)(()=>{s&&D()},[s,h]);const z={Authorization:"Bearer ".concat(T),"Content-Type":"application/json"},B=async()=>{try{const e=await fetch("".concat(I.JR,"/api/calendar/status"),{headers:z}),t=await e.json();n(t.connected),l(t.email||"")}catch(e){console.error("Error checking calendar status:",e)}finally{d(!1)}},D=(0,a.useCallback)(async()=>{const e=(0,Jj.w)(h),t=(0,Yj.p)(h),s=(0,Kj.k)(e,{weekStartsOn:1}),a=(0,Zj.$)(t,{weekStartsOn:1});try{const e=s.toISOString(),t=a.toISOString(),n=await fetch("".concat(I.JR,"/api/calendar/events?start=").concat(encodeURIComponent(e),"&end=").concat(encodeURIComponent(t)),{headers:z}),r=await n.json();x(r.events||[])}catch(n){console.error("Error fetching events:",n)}},[h,T]),R=e=>{const t=(0,$j.GP)(e,"yyyy-MM-dd");k(null),E({summary:"",description:"",location:"",start_date:t,start_time:"09:00",end_date:t,end_time:"10:00",all_day:!1}),j(!0)},P=e=>{var t,s,a,n,r;const i=(null===(t=e.start)||void 0===t?void 0:t.dateTime)||(null===(s=e.start)||void 0===s?void 0:s.date)||"",o=(null===(a=e.end)||void 0===a?void 0:a.dateTime)||(null===(n=e.end)||void 0===n?void 0:n.date)||"",l=!(null!==(r=e.start)&&void 0!==r&&r.dateTime);let c="",d="09:00",m="",p="10:00";if(l)c=i,m=o;else{const e=(0,Qj.H)(i),t=(0,Qj.H)(o);c=(0,$j.GP)(e,"yyyy-MM-dd"),d=(0,$j.GP)(e,"HH:mm"),m=(0,$j.GP)(t,"yyyy-MM-dd"),p=(0,$j.GP)(t,"HH:mm")}k(e),E({summary:e.summary||"",description:e.description||"",location:e.location||"",start_date:c,start_time:d,end_date:m,end_time:p,all_day:l}),j(!0)},W=(0,Jj.w)(h),O=(0,Yj.p)(h),L=(0,Kj.k)(W,{weekStartsOn:1}
1),M=(0,Zj.$)(O,{weekStartsOn:1}),q=(0,Xj.k)({start:L,end:M}),H=e=>p.filter(t=>{var s,a;const n=(null===(s=t.start)||void 0===s?void 0:s.dateTime)||(null===(a=t.start)||void 0===a?void 0:a.date);if(!n)return!1;const r=(0,Qj.H)(n);return(0,ew.r)(r,e)}),U=e=>{var t;if(null===(t=e.start)||void 0===t||!t.dateTime)return"All day";const s=(0,Qj.H)(e.start.dateTime);return(0,$j.GP)(s,"h:mm a")};return c?(0,f.jsx)(ta,{title:"Calendar",meta:"OVERVIEW \xb7 CALENDAR",children:(0,f.jsx)(Ws,{rows:8})}):(0,f.jsxs)(ta,{title:"Calendar",meta:"OVERVIEW \xb7 CALENDAR",children:[s&&(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:18,flexWrap:"wrap"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:11,minWidth:0},children:[(0,f.jsx)("span",{style:{width:38,height:38,borderRadius:10,background:"#0A0A0B",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,f.jsx)(xs.A,{size:19})}),(0,f.jsxs)("div",{style:{minWidth:0},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:"Google Calendar"}),i&&(0,f.jsx)("div",{style:{fontFamily:rw,fontSize:11,color:"#9A9AA0"},children:i})]})]}),(0,f.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:10},children:[(0,f.jsxs)("button",{onClick:()=>R(new Date),className:"tg-btn-primary",style:cw("#BF212F","#fff"),children:[(0,f.jsx)(ls.A,{size:15})," Add Event"]}),(0,f.jsx)("button",{onClick:async()=>{try{await fetch("".concat(I.JR,"/api/calendar/disconnect"),{method:"POST",headers:z}),n(!1),l(""),x([])}catch(e){console.error("Error disconnecting:",e)}},title:"Disconnect Google Calendar",style:cw("#fff","#991B1B","1px solid #FECACA"),children:(0,f.jsx)(Vj.A,{size:15})})]})]}),s?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:16,flexWrap:"wrap",gap:12},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)("button",{onClick:()=>u((0,tw.a)(h,1)),style:dw,children:(0,f.jsx)(Vg.A,{size:17})}),(0,f.jsx)("span",{style:{fontFamily:"'Archivo',sans-serif",fontWeight:700,fontSize:18,minWidth:150,textAlign:"center"},children:(0,$j.GP)(h,"MMMM yyyy")}),(0,f.jsx)("button",{onClick:()=>u((0,sw.P)(h,1)),style:dw,children:(0,f.jsx)(rs.A,{size:17})}),(0,f.jsx)("button",{onClick:()=>u(new Date),style:(0,m.A)((0,m.A)({},cw("#fff","#55555C","1px solid #E4E4E9")),{},{padding:"8px 14px",marginLeft:4}),children:"Today"})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14},children:[(0,f.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11.5,color:"#55555C"},children:[(0,f.jsx)("span",{style:{width:9,height:9,borderRadius:3,background:"#38BDF8"}}),"Timed"]}),(0,f.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11.5,color:"#55555C"},children:[(0,f.jsx)("span",{style:{width:9,height:9,borderRadius:3,background:"#F2A900"}}),"All-day"]})]})]}),(0,f.jsxs)("section",{style:(0,m.A)((0,m.A)({},iw),{},{overflow:"hidden"}),children:[(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7,1fr)",background:"#FBFBFC",borderBottom:"1px solid #EDEDF0"},children:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"].map(e=>(0,f.jsx)("div",{style:{padding:11,textAlign:"center",fontFamily:rw,fontSize:10,letterSpacing:"0.1em",color:"#9A9AA0",borderRight:"1px solid #EDEDF0",textTransform:"uppercase"},children:e},e))}),(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(7,1fr)"},children:q.map((e,t)=>{const s=H(e),a=(0,aw.t)(e,h),n=(0,nw.c)(e),r=b&&(0,ew.r)(e,b);return(0,f.jsxs)("div",{onClick:()=>y(e),onDoubleClick:()=>R(e),style:{minHeight:104,borderRight:"1px solid #EDEDF0",borderBottom:"1px solid #EDEDF0",padding:"8px 9px",cursor:"pointer",background:n?"#FBF0F0":a?"#fff":"#FBFBFC",boxShadow:r?"inset 0 0 0 2px #BF212F":"none",transition:"background 0.12s"},children:[(0,f.jsxs)("div",{style:{fontFamily:rw,fontSize:11,fontWeight:700,marginBottom:6,color:n?"#BF212F":a?"#9A9AA0":"#C9C9CF"},children:[(0,$j.GP)(e,"d"),n?" \xb7":""]}),s.slice(0,3).map(e=>{const t=(e=>{const t=(e.id||"").split("").reduce((e,t)=>
1(e=(e<<5)-e+t.charCodeAt(0))&e,0);return mw[Math.abs(t)%mw.length]})(e);return(0,f.jsxs)("button",{onClick:t=>{t.stopPropagation(),P(e)},style:{display:"flex",alignItems:"center",gap:5,marginBottom:3,width:"100%",textAlign:"left",fontSize:10.5,color:"#333",background:"".concat(t,"1a"),border:"none",borderRadius:4,padding:"2px 5px",cursor:"pointer",fontFamily:"'Hanken Grotesk',sans-serif"},children:[(0,f.jsx)("span",{style:{width:5,height:5,borderRadius:"50%",background:t,flexShrink:0}}),(0,f.jsxs)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,f.jsx)("span",{style:{fontFamily:rw,fontSize:9.5},children:U(e)})," ",e.summary]})]},e.id)}),s.length>3&&(0,f.jsxs)("div",{style:{fontSize:10,color:"#9A9AA0",paddingLeft:5,marginTop:1},children:["+",s.length-3," more"]})]},t)})})]}),b&&(0,f.jsxs)(Ls,{style:{marginTop:20,padding:"18px 20px"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:14},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:700,fontSize:15},children:(0,$j.GP)(b,"EEEE, MMMM d, yyyy")}),(0,f.jsxs)("button",{onClick:()=>R(b),style:(0,m.A)((0,m.A)({},cw("#fff","#BF212F","1px solid #E4E4E9")),{},{padding:"7px 12px",fontSize:12.5}),children:[(0,f.jsx)(ls.A,{size:14})," Add"]})]}),0===H(b).length?(0,f.jsx)("p",{style:{fontSize:13,color:"#9A9AA0",margin:0},children:"No events. Double-click a day to create one."}):(0,f.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:H(b).map(e=>{var t;return(0,f.jsxs)("div",{onClick:()=>P(e),style:{display:"flex",alignItems:"stretch",gap:12,padding:12,borderRadius:10,border:"1px solid #EDEDF0",cursor:"pointer",background:"#FBFBFC"},children:[(0,f.jsx)("div",{style:{width:3,borderRadius:3,background:null!==(t=e.start)&&void 0!==t&&t.dateTime?"#38BDF8":"#F2A900",flexShrink:0}}),(0,f.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,f.jsx)("div",{style:{fontSize:13.5,fontWeight:600,color:"#0A0A0B",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.summary}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,marginTop:4},children:[(0,f.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:5,fontFamily:rw,fontSize:11,color:"#9A9AA0"},children:[(0,f.jsx)(Nt.A,{size:12})," ",U(e)]}),e.location&&(0,f.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:5,fontSize:11.5,color:"#9A9AA0",minWidth:0},children:[(0,f.jsx)(C.A,{size:12,style:{flexShrink:0}}),(0,f.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.location})]})]})]})]},e.id)})})]})]}):(0,f.jsxs)(Ls,{style:{padding:"48px 28px",textAlign:"center",maxWidth:440,margin:"24px auto"},children:[(0,f.jsx)("div",{style:{width:56,height:56,borderRadius:14,background:"#F7F7F9",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 16px",color:"#0A0A0B"},children:(0,f.jsx)(xs.A,{size:26})}),(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:800,fontSize:19,marginBottom:8},children:"Connect Google Calendar"}),(0,f.jsx)("p",{style:{fontSize:13,color:"#9A9AA0",lineHeight:1.6,margin:"0 auto 22px",maxWidth:340},children:"Link your Google Calendar to view, create, and manage events directly from your dashboard."}),(0,f.jsxs)("button",{onClick:async()=>{try{const e=await fetch("".concat(I.JR,"/api/calendar/auth-url"),{headers:z}),t=await e.json();t.auth_url&&(window.location.href=t.auth_url)}catch(e){console.error("Error getting auth URL:",e)}},className:"tg-btn-primary",style:(0,m.A)((0,m.A)({},cw("#BF212F","#fff")),{},{padding:"12px 20px"}),children:[(0,f.jsx)(En.A,{size:15})," Connect Google Calendar"]})]}),v&&(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,padding:16},children:(0,f.jsxs)(Ls,{style:{maxWidth:520,width:"100%",maxHeight:"90vh",overflowY:"auto",boxShadow:"0 20px 60px rgba(0,0,0,0.3)"},children:[(0,f.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:"20px 22px 14px"},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:800,fontSize:18},children:A?"Edit Event":"New Event"}),(0,f.jsx)("div",{style:{fontSize:12.5,color:"#9A9AA0",marginTop:2},children:A?"Update the event details below.":"Fill in the details for your new event."})]}),(0,f.jsx)("button",{onClick:()=>j(!1),style:(0,m.A)((0,m.A)({},dw),{},{border:"none",background:"#F7F7F9"}),children:(0,f.jsx)(g.A,{size:16})})]}),(0,f.jsxs)("div",{style:{padding:"0 22px 4px",display:"flex",flexDirection:"column",gap:16},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:ow,children:"Title *"}),(0,f.jsx)("input",{type:"text",value:F.summary,onChange:e=>E((0,m.A)((0,m.A)({},F),{},{summary:e.target.value})),style:lw,placeholder:"Event title",autoFocus:!0})]}),(0,f.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontSize:13,color:"#333"},children:[(0,f.jsx)("input",{type:"checkbox",checked:F.all_day,onChange:e=>E((0,m.A)((0,m.A)({},F),{},{all_day:e.target.checked})),style:{accentColor:"#BF212F",width:15,height:15}}),"All day"]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:ow,children:"Start Date"}),(0,f.jsx)("input",{type:"date",value:F.start_date,onChange:e=>E((0,m.A)((0,m.A)({},F),{},{start_date:e.target.value,end_date:F.end_date||e.target.value})),style:(0,m.A)((0,m.A)({},lw),{},{fontFamily:rw})})]}),!F.all_day&&(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:ow,children:"Start Time"}),(0,f.jsx)("input",{type:"time",value:F.start_time,onChange:e=>E((0,m.A)((0,m.A)({},F),{},{start_time:e.target.value})),style:(0,m.A)((0,m.A)({},lw),{},{fontFamily:rw})})]})]}),(0,f.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:ow,children:"End Date"}),(0,f.jsx)("input",{type:"date",value:F.end_date,onChange:e=>E((0,m.A)((0,m.A)({},F),{},{end_date:e.target.value})),style:(0,m.A)((0,m.A)({},lw),{},{fontFamily:rw})})]}),!F.all_day&&(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:ow,children:"End Time"}),(0,f.jsx)("input",{type:"time",value:F.end_time,onChange:e=>E((0,m.A)((0,m.A)({},F),{},{end_time:e.target.value})),style:(0,m.A)((0,m.A)({},lw),{},{fontFamily:rw})})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:ow,children:"Location"}),(0,f.jsx)("input",{type:"text",value:F.location,onChange:e=>E((0,m.A)((0,m.A)({},F),{},{location:e.target.value})),style:lw,placeholder:"Event location (optional)"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{style:ow,children:"Description"}),(0,f.jsx)("textarea",{value:F.description,onChange:e=>E((0,m.A)((0,m.A)({},F),{},{description:e.target.value})),rows:3,style:(0,m.A)((0,m.A)({},lw),{},{resize:"none"}),placeholder:"Event description (optional)"})]})]}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 22px 20px",marginTop:4},children:[(0,f.jsx)("div",{children:A&&(0,f.jsxs)("button",{onClick:()=>N(!0),style:cw("#fff","#991B1B","1px solid #FECACA"),children:[(0,f.jsx)(la.A,{size:15})," Delete"]})}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10},children:[(0,f.jsx)("button",{onClick:()=>j(!1),style:cw("#fff","#55555C","1px solid #E4E4E9"),children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>
1{if(!F.summary.trim())return;let e,t;_(!0),F.all_day?(e=F.start_date,t=F.end_date||F.start_date):(e="".concat(F.start_date,"T").concat(F.start_time,":00"),t="".concat(F.end_date||F.start_date,"T").concat(F.end_time,":00"));const s={summary:F.summary,description:F.description,location:F.location,start_datetime:e,end_datetime:t,all_day:F.all_day};try{const e=A?"".concat(I.JR,"/api/calendar/events/").concat(A.id):"".concat(I.JR,"/api/calendar/events"),t=A?"PUT":"POST";await fetch(e,{method:t,headers:z,body:JSON.stringify(s)}),j(!1),D()}catch(a){console.error("Error saving event:",a)}finally{_(!1)}},disabled:S||!F.summary.trim(),className:"tg-btn-primary",style:(0,m.A)((0,m.A)({},cw("#BF212F","#fff")),{},{opacity:S||!F.summary.trim()?.5:1}),children:[S&&(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}),A?"Update":"Create"]})]})]})]})}),w&&(0,f.jsx)("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:60,padding:16},children:(0,f.jsxs)(Ls,{style:{maxWidth:400,width:"100%",padding:24,boxShadow:"0 20px 60px rgba(0,0,0,0.3)"},children:[(0,f.jsx)("div",{className:"tg-ui",style:{fontWeight:800,fontSize:18,marginBottom:8},children:"Delete Event"}),(0,f.jsxs)("p",{style:{fontSize:13,color:"#55555C",lineHeight:1.6,margin:"0 0 20px"},children:['Are you sure you want to delete "',null===A||void 0===A?void 0:A.summary,'"? This will also remove it from Google Calendar.']}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:10},children:[(0,f.jsx)("button",{onClick:()=>N(!1),style:cw("#fff","#55555C","1px solid #E4E4E9"),children:"Cancel"}),(0,f.jsxs)("button",{onClick:async()=>{if(A){_(!0);try{await fetch("".concat(I.JR,"/api/calendar/events/").concat(A.id),{method:"DELETE",headers:z}),N(!1),j(!1),D()}catch(e){console.error("Error deleting event:",e)}finally{_(!1)}}},disabled:S,style:(0,m.A)((0,m.A)({},cw("#991B1B","#fff")),{},{opacity:S?.5:1}),children:[S&&(0,f.jsx)(Kr.A,{size:15,className:"animate-spin"}),"Delete"]})]})]})})]})};var xw=s(6873),hw=s(95258),uw=s(97666);const gw={meta:{client:"DMA Clinical Pilates",project:"Custom Membership & Education Platform",date:"March 2026",version:"1.0",preparedBy:"James Anderson",preparedFor:"DMA Clinical Pilates"},executiveSummary:"DMA Clinical Pilates requires a purpose-built digital platform that combines course delivery, event management, and a membership portal into a single, cohesive system. The current WordPress/LearnDash setup has reached its limits in terms of flexibility, user experience, and scalability. This proposal outlines a custom-built platform designed specifically around DMA's unique course structure, certification requirements, and community engagement model \u2014 replacing fragmented plugins with a unified, professionally managed solution.",courses:[{name:"Unit A",title:"Foundation",description:"Entry-level certification covering foundational Clinical Pilates principles, anatomy, and basic exercise prescription.",prerequisites:"None",color:"blue"},{name:"Unit B",title:"Intermediate",description:"Intermediate certification building on Unit A with advanced assessment techniques, equipment-based programming, and clinical reasoning.",prerequisites:"Unit A completion",color:"amber"},{name:"Unit C",title:"Advanced",description:"Advanced certification covering specialised populations, complex case management, and mentorship-level practice.",prerequisites:"Unit B completion",color:"green"}],membershipPortal:{tiers:["Free tier \u2014 access to introductory content and community forums","Standard membership \u2014 full content library, recorded workshops, and clinician directory listing","Premium membership \u2014 all Standard features plus live Q&A sessions, priority event booking, and advanced resources"],contentLibrary:"A searchable library of video tutorials, downloadable resources, research papers, and recorded workshop sessions \u2014 organised by topic, skill level, and certification unit.",clinicianDirectory:"A public-facing directory of DMA-certified practitioners, searchable by location, specialisation, and certification level \u2014 helping patients find qualified clinicians."},keyPrinciples:["Single sign-on across courses, events, and membership areas","Progressive certification pathway (A \u2192 B \u2192 C) with enforced prerequisites","Integrated payment processing with flexible pricing options","Mobile-responsive design for on-the-go access","Automated email workflows for enrolments, reminders, and certifications","Scalable architecture to supp
1ort future growth and new course offerings"],comparisonTable:[{consideration:"Course Structure",wordpress:"Generic LMS \u2014 requires multiple plugins to approximate DMA's unit progression model",custom:"Built specifically around Units A/B/C with enforced prerequisites and certification tracking"},{consideration:"User Experience",wordpress:"Theme-dependent, often inconsistent across plugins; mobile experience varies",custom:"Consistent, branded experience across all touchpoints; mobile-first responsive design"},{consideration:"Payment Flexibility",wordpress:"WooCommerce + Subscriptions + multiple add-ons; complex to maintain",custom:"Native Stripe + PayPal integration with flexible plans, bundles, and event-specific pricing"},{consideration:"Ongoing Maintenance",wordpress:"Frequent plugin updates, compatibility issues, and security patches across 15+ plugins",custom:"Single codebase maintained by one team; updates are coordinated and tested"},{consideration:"Performance & Security",wordpress:"Plugin bloat impacts performance; each plugin is a potential security vector",custom:"Optimised codebase with modern security practices; no unnecessary dependencies"},{consideration:"Scalability",wordpress:"Limited by shared hosting and plugin architecture; struggles with concurrent users",custom:"Cloud-hosted with auto-scaling; designed for growth from day one"}],techStack:[{layer:"Frontend",technology:"Next.js (React)",purpose:"Server-rendered pages for SEO, fast navigation, and a modern user interface"},{layer:"Backend",technology:"Node.js or Laravel",purpose:"RESTful API handling business logic, authentication, and data processing"},{layer:"Database",technology:"PostgreSQL",purpose:"Reliable relational database for users, courses, events, and membership data"},{layer:"Payments",technology:"Stripe + PayPal",purpose:"Secure payment processing with support for subscriptions, one-time payments, and refunds"},{layer:"Email & CRM",technology:"ActiveCampaign",purpose:"Automated email workflows, tagging, and CRM integration for member communication"},{layer:"Hosting",technology:"Cloud (AWS/DigitalOcean)",purpose:"Scalable, reliable hosting with CDN, SSL, and automated backups"},{layer:"File Storage",technology:"Amazon S3",purpose:"Secure storage for course videos, downloadable resources, and media assets"}],features:[{icon:"GraduationCap",title:"Course & Certification Engine",items:["Unit-based course structure (A \u2192 B \u2192 C) with enforced prerequisites","Video lessons with progress tracking and completion certificates","Quizzes and assessments with pass/fail thresholds","Downloadable resources attached to each module","Automatic certificate generation upon course completion","Continuing education credit tracking"]},{icon:"Calendar",title:"Event Management",items:["Workshop and seminar listings with online registration","Capacity management with waitlists","Location-based event filtering (in-person and virtual)","Integration with calendar (iCal/Google Calendar)","Automated confirmation and reminder emails","Post-event feedback collection"]},{icon:"CreditCard",title:"Payments & Billing",items:["Stripe and PayPal integration for secure processing","Subscription billing for membership tiers","One-time payments for courses and events","Discount codes and bundle pricing","Automated invoicing and receipts","Refund management dashboard"]},{icon:"Users",title:"Membership Portal",items:["Tiered membership levels (Free, Standard, Premium)","Content library with search and filtering","Clinician directory with public profiles","Community forum or discussion area","Member dashboard with progress overview","Renewal reminders and auto-billing"]},{icon:"Settings",title:"Admin Panel",items:["User and membership management","Course content editor with drag-and-drop modules","Event creation and registration management","Payment and revenue reporting","Email campaign triggers and automation rules","Analytics dashboard (enrolments, revenue, engagement)"]},{icon:"UserCog",title:"User Accounts & Profiles",items:["Single sign-on across all platform areas","Personal dashboard with enrolled courses and upcoming events","Certification history and downloadable certificates","Profile management with professional details","Notification preferences and email settings","Secure password reset and two-factor authentication"]}],migrationItems:["User accounts and login credentials","Course enrolment and progress data","Content and media assets (videos, PDFs, images)","Payment and subscription history","URL redirects from old WordPress pages to new platform"],phases:[{number:1,name:"Foundation & Core Platform",duration:"4 weeks",color:"blue",deliverables:["Project setup, hosting, and CI/CD pipeline","User authentication and account system","Database schema and API architecture","Admin panel foundation","Design system and responsive layout framework"]},{number:2,name:"Course Engine & Content",duration:"4 weeks",color:"amber",deliverables:["Course structure (Units A/B/C) with prerequisite enforcement","Video player with progress tracking","Quiz and assessment engine","Certificate generation system","Content management for admin"]},{number:3,name:"Membership, Payments & Events",duration:"4 weeks",color:"green",deliverables:["Membership tier system with gated content","Stripe and PayPal payment integration","Subscription billing and invoicing","Event listing, registration, and capacity management","Clinician directory with public profiles"]},{number:4,name:"Migration, Testing & Launch",duration:"4 weeks",color:"purple",deliverables:["Data migration from WordPress/LearnDash","ActiveCampaign email integration","End-to-end testing and QA","Performance optimisation and security audit","Go-live support and post-launch monitoring"]}],costingTable:[{phase:"Phase 1",description:"Foundation & Core Platform",low:"$8,600",high:"$12,800"},{phase:"Phase 2",description:"Course Engine & Content",low:"$10,700",high:"$15,000"},{phase:"Phase 3",description:"Membership, Payments & Events",low:"$11,400",high:"$16,400"},{phase:"Phase 4",description:"Migration, Testing & Launch",low:"$7,
1100",high:"$10,700"}],costingTotal:{low:"$37,800",high:"$54,900"},additionalConsiderations:["Stripe/PayPal transaction fees (approximately 1.75%\u20132.9% per transaction)","Future feature development priced separately as needed","Domain and SSL certificate management included in hosting"],timelineTable:[{phase:"Phase 1: Foundation",duration:"4 weeks",target:"April 2026"},{phase:"Phase 2: Course Engine",duration:"4 weeks",target:"May 2026"},{phase:"Phase 3: Membership & Payments",duration:"4 weeks",target:"June\u2013July 2026"},{phase:"Phase 4: Migration & Launch",duration:"4 weeks",target:"July\u2013August 2026"}],supportRecommendations:{faq:"A comprehensive FAQ page built into the platform covering account management, course access, payment queries, and technical troubleshooting \u2014 reducing support volume and improving user self-service.",supportEmail:"A dedicated support email address (e.g., [email protected]) integrated with a ticketing system for tracking and resolving member enquiries efficiently."},nextSteps:[{step:1,action:"Review this proposal and provide feedback",responsibility:"DMA Clinical Pilates"},{step:2,action:"Clarification meeting to discuss scope and priorities",responsibility:"Joint"},{step:3,action:"Finalise project scope and sign-off",responsibility:"Joint"},{step:4,action:"Project kickoff and Phase 1 commencement",responsibility:"Turbo 360"},{step:5,action:"Fortnightly progress reviews throughout development",responsibility:"Joint"}]},fw={GraduationCap:bs.A,Calendar:_t.A,CreditCard:Dc.A,Users:Xe.A,Settings:ss.A,UserCog:xw.A},bw=e=>{let{id:t,number:s,icon:a,title:n,children:r}=e;return(0,f.jsxs)("div",{id:t,className:"bg-white rounded-3xl shadow-2xl overflow-hidden mb-12 scroll-mt-4",children:[(0,f.jsx)("div",{className:"bg-gradient-to-r from-red-600 to-red-700 px-6 sm:px-8 py-5 sm:py-6",children:(0,f.jsxs)("div",{className:"flex items-center",children:[(0,f.jsx)("div",{className:"bg-white/20 rounded-full w-9 h-9 sm:w-10 sm:h-10 flex items-center justify-center mr-3 sm:mr-4 flex-shrink-0",children:(0,f.jsx)("span",{className:"text-white font-bold text-base sm:text-lg",children:s})}),(0,f.jsx)(a,{className:"h-6 w-6 sm:h-8 sm:w-8 text-white mr-2 sm:mr-3 flex-shrink-0"}),(0,f.jsx)("h2",{className:"text-xl sm:text-3xl font-bold text-white",children:n})]})}),(0,f.jsx)("div",{className:"p-6 sm:p-8 lg:p-12",children:r})]})},yw=e=>{let{headers:t,rows:s,footerRow:a}=e;return(0,f.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,f.jsxs)("table",{className:"w-full border-collapse",children:[(0,f.jsx)("thead",{children:(0,f.jsx)("tr",{className:"bg-red-600 text-white",children:t.map((e,t)=>(0,f.jsx)("th",{className:"px-4 sm:px-6 py-3 text-left font-bold text-sm sm:text-base",children:e},t))})}),(0,f.jsxs)("tbody",{children:[s.map((e,t)=>(0,f.jsx)("tr",{className:"hover:bg-gray-50 border-b border-gray-200",children:e.map((e,t)=>(0,f.jsx)("td",{className:"px-4 sm:px-6 py-3 sm:py-4 text-gray-700 text-sm sm:text-base",children:e},t))},t)),a&&(0,f.jsx)("tr",{className:"bg-gray-100 font-bold",children:a.map((e,t)=>(0,f.jsx)("td",{className:"px-4 sm:px-6 py-3 sm:py-4 text-gray-900 text-sm sm:text-base",children:e},t))})]})]})})},vw=()=>{const{meta:e}=gw;return(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white",children:[(0,f.jsx)(R.A,{title:"DMA Clinical Pilates \u2014 Platform Proposal",description:"Custom Membership & Education Platform proposal for DMA Clinical Pilates",noIndex:!0}),(0,f.jsxs)("div",{className:"relative overflow-hidden bg-gradient-to-br from-gray-900 via-red-900 to-black",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-r from-red-600/20 to-transparent animate-pulse"}),(0,f.jsx)("div",{className:"absolute inset-0 opacity-10",style:{backgroundImage:"linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px)",backgroundSize:"50px 50px"}}),(0,f.jsx)("div",{className:"relative z-10 max-w-5xl mx-auto px-4 py-20 sm:py-28",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-14 sm:h-20 mb-8 mx-auto object-contain filter drop-shadow-2xl"}),(0,f.jsx)("p",{className:"text-red-300 text-sm sm:text-base font-semibold tracking-widest uppercase mb-4",children:"Proposal"}),(0,f.jsxs)("h1",{className:"text-3xl sm:text-5xl lg:text-6xl font-extrabold text-white mb-6 tracking-tight",children:["Custom Membership +",(0,f.jsx)("br",{}),"Education Platform"]}),(0,f.jsxs)("p",{className:"text-lg sm:text-xl text-gray-300 mb-10",children:["Prepared for ",(0,f.jsx)("span",{className:"text-white font-semibold",children:e.client})]}),(0,f.jsx)("div",{className:"inline-block bg-white/10 backdrop-blur-sm rounded-2xl px-6 sm:px-10 py-5 sm:py-6 text-left",children:(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-3 text-sm sm:text-base",children:[(0,f.jsx)("span",{className:"text-gray-400",children:"Client"}),(0,f.jsx)("span",{className:"text-white font-medium",children:e.preparedFor}),(0,f.jsx)("span",{className:"text-gray-400",children:"Date"}),(0,f.jsx)("span",{className:"text-white font-medium",children:e.date}),(0,f.jsx)("span",{className:"text-gray-400",children:"Version"}),(0,f.jsx)("span",{className:"text-white font-medium",children:e.version}),(0,f.jsx)("span",{className:"text-gray-400",children:"Prepared by"}),(0,f.jsx)("span",{className:"text-white font-medium",children:e.preparedBy})]})})]})}),(0,f.jsx)("div",{className:"absolute bottom-0 left-0 right-0 w-full",children:(0,f.jsx)("svg",{viewBox:"0 0 1440 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full h-12 sm:h-20",preserveAspectRatio:"none",children:(0,f.jsx)("path",{d:"M0,64L80,69.3C160,75,320,85,480,80C640,75,800,53,960,48C1120,43,1280,53,1360,58.7L1440,64L1440,120L1360,120C1280,120,1120,120,960,120C800,120,640,120,480,120C320,120,160,120,80,120L0,120Z",fill:"rgb(249, 250, 251)"})})})]}),(0,f.jsx)("div",{className:"max-w-5xl mx-auto px-4 pt-8 sm:pt-12",children:(0,f.jsx)("div",{className:"flex flex-wrap justify-center gap-2 sm:gap-3",children:[{id:"executive-summary",label:"Summary"},{id:"understanding",label:"Understanding"},{id:"why-custom",label:"Why Custom"}
1,{id:"technology",label:"Technology"},{id:"features",label:"Features"},{id:"migration",label:"Migration"},{id:"delivery",label:"Delivery"},{id:"costing",label:"Costing"},{id:"timeline",label:"Timeline"},{id:"support",label:"Support"},{id:"next-steps",label:"Next Steps"}].map(e=>(0,f.jsx)("a",{href:"#".concat(e.id),className:"px-3 sm:px-4 py-1.5 sm:py-2 bg-white text-gray-700 text-xs sm:text-sm font-medium rounded-full shadow-md border border-gray-200 hover:bg-red-600 hover:text-white hover:border-red-600 transition-colors",children:e.label},e.id))})}),(0,f.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-8 sm:py-12",children:[(0,f.jsx)(bw,{id:"executive-summary",number:1,icon:kt.A,title:"Executive Summary",children:(0,f.jsx)("p",{className:"text-gray-700 text-base sm:text-lg leading-relaxed",children:gw.executiveSummary})}),(0,f.jsxs)(bw,{id:"understanding",number:2,icon:Ns.A,title:"Our Understanding",children:[(0,f.jsx)("h3",{className:"text-xl sm:text-2xl font-bold text-gray-900 mb-6",children:"Course Structure"}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:gw.courses.map(e=>(0,f.jsxs)("div",{className:"rounded-xl border-l-4 p-5 sm:p-6 ".concat({blue:"border-blue-500 bg-blue-50",amber:"border-amber-500 bg-amber-50",green:"border-green-500 bg-green-50"}[e.color]),children:[(0,f.jsxs)("div",{className:"flex items-center mb-3",children:[(0,f.jsx)(bs.A,{className:"h-5 w-5 text-gray-600 mr-2"}),(0,f.jsxs)("h4",{className:"text-lg font-bold text-gray-900",children:[e.name,": ",e.title]})]}),(0,f.jsx)("p",{className:"text-gray-700 text-sm mb-3",children:e.description}),(0,f.jsxs)("p",{className:"text-xs font-semibold text-gray-500 uppercase",children:["Prerequisites: ",e.prerequisites]})]},e.name))}),(0,f.jsx)("h3",{className:"text-xl sm:text-2xl font-bold text-gray-900 mb-4",children:"Membership Portal"}),(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("h4",{className:"font-semibold text-gray-800 mb-2",children:"Membership Tiers"}),(0,f.jsx)("ul",{className:"space-y-2",children:gw.membershipPortal.tiers.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-5 w-5 text-green-500 mr-2 mt-0.5 flex-shrink-0"}),(0,f.jsx)("span",{className:"text-gray-700 text-sm sm:text-base",children:e})]},t))})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-10",children:[(0,f.jsxs)("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-200",children:[(0,f.jsx)("h4",{className:"font-semibold text-gray-800 mb-2",children:"Content Library"}),(0,f.jsx)("p",{className:"text-gray-700 text-sm",children:gw.membershipPortal.contentLibrary})]}),(0,f.jsxs)("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-200",children:[(0,f.jsx)("h4",{className:"font-semibold text-gray-800 mb-2",children:"Clinician Directory"}),(0,f.jsx)("p",{className:"text-gray-700 text-sm",children:gw.membershipPortal.clinicianDirectory})]})]}),(0,f.jsx)("h3",{className:"text-xl sm:text-2xl font-bold text-gray-900 mb-4",children:"Key Principles"}),(0,f.jsx)("ul",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:gw.keyPrinciples.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-5 w-5 text-green-500 mr-2 mt-0.5 flex-shrink-0"}),(0,f.jsx)("span",{className:"text-gray-700 text-sm sm:text-base",children:e})]},t))})]}),(0,f.jsxs)(bw,{id:"why-custom",number:3,icon:hw.A,title:"Why Custom Build?",children:[(0,f.jsx)("p",{className:"text-gray-700 text-base sm:text-lg leading-relaxed mb-6",children:"A custom platform eliminates the compromises inherent in assembling a WordPress plugin stack. Here is how the two approaches compare across key considerations:"}),(0,f.jsx)(yw,{headers:["Consideration","WordPress / LearnDash","Custom Platform"],rows:gw.comparisonTable.map(e=>[(0,f.jsx)("span",{className:"font-semibold text-gray-900",children:e.consideration}),(0,f.jsxs)("span",{className:"flex items-start",children:[(0,f.jsx)(x.A,{className:"h-4 w-4 text-red-400 mr-1.5 mt-0.5 flex-shrink-0"}),e.wordpress]}),(0,f.jsxs)("span",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 text-green-500 mr-1.5 mt-0.5 flex-shrink-0"}),e.custom]})])})]}
1),(0,f.jsxs)(bw,{id:"technology",number:4,icon:vj.A,title:"Recommended Technology",children:[(0,f.jsx)("p",{className:"text-gray-700 text-base sm:text-lg leading-relaxed mb-6",children:"The platform will be built on a modern, proven technology stack selected for performance, scalability, and maintainability."}),(0,f.jsx)(yw,{headers:["Layer","Technology","Purpose"],rows:gw.techStack.map(e=>[(0,f.jsx)("span",{className:"font-semibold text-gray-900",children:e.layer}),(0,f.jsx)("span",{className:"font-medium",children:e.technology}),e.purpose])})]}),(0,f.jsxs)(bw,{id:"features",number:5,icon:ss.A,title:"Platform Features",children:[(0,f.jsx)("p",{className:"text-gray-700 text-base sm:text-lg leading-relaxed mb-8",children:"The platform will include six core feature areas, each designed to work seamlessly together:"}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:gw.features.map(e=>{const t=fw[e.icon];return(0,f.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg p-6 sm:p-8 border border-gray-200 hover:shadow-xl transition-shadow",children:[(0,f.jsxs)("div",{className:"flex items-center mb-4",children:[(0,f.jsx)("div",{className:"bg-red-100 rounded-full w-11 h-11 flex items-center justify-center mr-3 flex-shrink-0",children:(0,f.jsx)(t,{className:"h-5 w-5 text-red-600"})}),(0,f.jsx)("h4",{className:"text-lg font-bold text-gray-900",children:e.title})]}),(0,f.jsx)("ul",{className:"space-y-2",children:e.items.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 text-green-500 mr-2 mt-0.5 flex-shrink-0"}),(0,f.jsx)("span",{className:"text-gray-700 text-sm",children:e})]},t))})]},e.title)})})]}),(0,f.jsxs)(bw,{id:"migration",number:6,icon:Es.A,title:"Migration Plan",children:[(0,f.jsx)("p",{className:"text-gray-700 text-base sm:text-lg leading-relaxed mb-6",children:"A structured data migration will be performed to ensure a seamless transition from the existing WordPress/LearnDash platform. The following data will be migrated:"}),(0,f.jsx)("div",{className:"bg-blue-50 rounded-xl p-6 sm:p-8 border border-blue-200",children:(0,f.jsx)("ul",{className:"space-y-3",children:gw.migrationItems.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-5 w-5 text-blue-600 mr-3 mt-0.5 flex-shrink-0"}),(0,f.jsx)("span",{className:"text-gray-800 text-sm sm:text-base font-medium",children:e})]},t))})})]}),(0,f.jsxs)(bw,{id:"delivery",number:7,icon:Nt.A,title:"Phased Delivery Plan",children:[(0,f.jsx)("p",{className:"text-gray-700 text-base sm:text-lg leading-relaxed mb-8",children:"The project will be delivered in four phases over approximately 16 weeks, with fortnightly progress reviews:"}),(0,f.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:gw.phases.map(e=>(0,f.jsxs)("div",{className:"bg-white rounded-xl shadow-lg border-l-4 ".concat({blue:"border-l-blue-500",amber:"border-l-amber-500",green:"border-l-green-500",purple:"border-l-purple-500"}[e.color]," p-6"),children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,f.jsxs)("h4",{className:"text-base sm:text-lg font-bold text-gray-900",children:["Phase ",e.number]}),(0,f.jsx)("span",{className:"text-xs font-semibold px-3 py-1 rounded-full ".concat({blue:"bg-blue-100 text-blue-700",amber:"bg-amber-100 text-amber-700",green:"bg-green-100 text-green-700",purple:"bg-purple-100 text-purple-700"}[e.color]),children:e.duration})]}),(0,f.jsx)("p",{className:"text-gray-800 font-semibold mb-3",children:e.name}),(0,f.jsx)("ul",{className:"space-y-2",children:e.deliverables.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)(p.A,{className:"h-4 w-4 text-green-500 mr-2 mt-0.5 flex-shrink-0"}),(0,f.jsx)("span",{className:"text-gray-700 text-sm",children:e})]},t))})]},e.number))})]}),(0,f.jsxs)(bw,{id:"costing",number:8,icon:Dc.A,title:"Indicative Costing",children:[(0,f.jsx)("p",{className:"text-gray-700 text-base sm:text-lg leading-relaxed mb-6",children:"The following cost ranges reflect the estimated investment for each phase. Final pricing will be confirmed after scope finalisation."}
1),(0,f.jsx)(yw,{headers:["Phase","Description","Low Estimate","High Estimate"],rows:gw.costingTable.map(e=>[(0,f.jsx)("span",{className:"font-semibold text-gray-900",children:e.phase}),e.description,e.low,e.high]),footerRow:["Total","",gw.costingTotal.low,gw.costingTotal.high]}),(0,f.jsxs)("div",{className:"mt-6 bg-yellow-50 border-l-4 border-yellow-500 rounded-r-xl p-5",children:[(0,f.jsx)("h4",{className:"font-bold text-yellow-800 mb-2",children:"Additional Considerations"}),(0,f.jsx)("ul",{className:"space-y-2",children:gw.additionalConsiderations.map((e,t)=>(0,f.jsxs)("li",{className:"flex items-start",children:[(0,f.jsx)("span",{className:"text-yellow-600 mr-2 mt-0.5 flex-shrink-0",children:"\u2022"}),(0,f.jsx)("span",{className:"text-yellow-900 text-sm",children:e})]},t))})]})]}),(0,f.jsxs)(bw,{id:"timeline",number:9,icon:_t.A,title:"Indicative Timeline",children:[(0,f.jsx)("p",{className:"text-gray-700 text-base sm:text-lg leading-relaxed mb-6",children:"Target delivery timeline, subject to project start date confirmation:"}),(0,f.jsx)(yw,{headers:["Phase","Duration","Target Dates"],rows:gw.timelineTable.map(e=>[(0,f.jsx)("span",{className:"font-semibold text-gray-900",children:e.phase}),e.duration,(0,f.jsx)("span",{className:"font-medium",children:e.target})])})]}),(0,f.jsx)(bw,{id:"support",number:10,icon:uw.A,title:"Support Recommendations",children:(0,f.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,f.jsxs)("div",{className:"bg-gray-50 rounded-xl p-6 border border-gray-200",children:[(0,f.jsxs)("div",{className:"flex items-center mb-3",children:[(0,f.jsx)("div",{className:"bg-red-100 rounded-full w-10 h-10 flex items-center justify-center mr-3",children:(0,f.jsx)(uw.A,{className:"h-5 w-5 text-red-600"})}),(0,f.jsx)("h4",{className:"text-lg font-bold text-gray-900",children:"FAQ Page"})]}),(0,f.jsx)("p",{className:"text-gray-700 text-sm",children:gw.supportRecommendations.faq})]}),(0,f.jsxs)("div",{className:"bg-gray-50 rounded-xl p-6 border border-gray-200",children:[(0,f.jsxs)("div",{className:"flex items-center mb-3",children:[(0,f.jsx)("div",{className:"bg-red-100 rounded-full w-10 h-10 flex items-center justify-center mr-3",children:(0,f.jsx)(T.A,{className:"h-5 w-5 text-red-600"})}),(0,f.jsx)("h4",{className:"text-lg font-bold text-gray-900",children:"Support Email"})]}),(0,f.jsx)("p",{className:"text-gray-700 text-sm",children:gw.supportRecommendations.supportEmail})]})]})}),(0,f.jsxs)(bw,{id:"next-steps",number:11,icon:S.A,title:"Next Steps",children:[(0,f.jsx)("p",{className:"text-gray-700 text-base sm:text-lg leading-relaxed mb-6",children:"To move forward with this project, we recommend the following steps:"}),(0,f.jsx)(yw,{headers:["Step","Action","Responsibility"],rows:gw.nextSteps.map(e=>[(0,f.jsx)("span",{className:"font-bold text-red-600",children:e.step}),e.action,(0,f.jsx)("span",{className:"font-medium",children:e.responsibility})])})]}),(0,f.jsxs)("div",{className:"bg-gradient-to-r from-gray-900 via-gray-800 to-red-900 rounded-2xl shadow-2xl p-8 sm:p-10 text-center mt-4 mb-8",children:[(0,f.jsx)("p",{className:"text-red-400 text-xs font-bold tracking-widest uppercase mb-4",children:"Confidential"}),(0,f.jsx)("img",{src:"/turbo-logo-white-new.png",alt:"Turbo 360",className:"h-10 sm:h-12 mx-auto mb-4 object-contain"}),(0,f.jsxs)("p",{className:"text-gray-300 text-sm sm:text-base mb-1",children:["Prepared by ",(0,f.jsx)("span",{className:"text-white font-semibold",children:"Turbo 360"})," for"," ",(0,f.jsx)("span",{className:"text-white font-semibold",children:e.client})]}),(0,f.jsx)("p",{className:"text-gray-400 text-sm mb-4",children:e.date}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3 sm:gap-6 text-gray-400 text-sm",children:[(0,f.jsxs)("span",{className:"flex items-center",children:[(0,f.jsx)(T.A,{className:"h-4 w-4 mr-1.5"}),"[email protected]"]}),(0,f.jsxs)("span",{className:"flex items-center",children:[(0,f.jsx)(Oa.A,{className:"h-4 w-4 mr-1.5"}),"turbo.net.au"]})]}),(0,f.jsx)("p",{className:"text-gray-500 text-xs mt-6",children:"This document is confidential and intended solely for the named recipient. It contains proprietary information belonging to Turbo 360. Unauthorised distribution or reproduction is prohibited."})]})]})]})},jw=()=>(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-b from-gray-50 to-white flex flex-col",children:[(0,f.jsx)(R.A,{title:"Page Not Found",description:"The page you're looking for doesn't exist or has been moved.",noIndex:!0}),(0,f.jsx)("div",{className:"flex-1 flex items-center justify-center px-4 py-16",children:(0,f.jsxs)("div",{className:"max-w-lg w-full text-center",children:[(0,f.jsx)(r.N_,{to:"/",children:(0,f.jsx)("img",{src:"/turbo-logo-new.png",alt:"Turbo 360",className:"h-12 sm:h-16 mx-auto mb-10 object-contain"})}),(0,f.jsxs)("div",{className:"relative mb-6",children:[(0,f.jsx)("span",{className:"text-[8rem] sm:text-[10rem] font-extrabold text-gray-100 leading-none select-none",children:"404"}),(0,f.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,f.jsx)(ds.A,{className:"h-16 w-16 sm:h-20 sm:w-20 text-red-500 opacity-80"})})]}),(0,f.jsx)("h1",{className:"text-2xl sm:text-3xl font-bold text-gray-900 mb-3",children:"Page not found"}),(0,f.jsx)("p",{className:"text-gray-500 text-base sm:text-lg mb-10 max-w-md mx-auto",children:"Sorry, the page you're looking for doesn't exist or has been moved."}),(0,f.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3",children:[(0,f.jsxs)(r.N_,{to:"/",className:"inline-flex items-center px-6 py-3 bg-red-600 text-white font-semibold rounded-full hover:bg-red-700 transition-colors shadow-lg",children:[(0,f.jsx)(yn.A,{className:"h-4 w-4 mr-2"}),"Go Home"]}),(0,f.jsxs)("button",{onClick:()=>window.history.back(),className:"inline-flex items-center px-6 py-3 bg-white text-gray-700 font-semibold rounded-full hover:bg-gray-100 transition-colors shadow-md border border-gray-200",children:[(0,f.jsx)(Ct.A,{className:"h-4 w-4 mr-2"}),"Go Back"]}),(0,f.jsxs)(r.N_,{to:"/get-quote",className:"inline-flex items-center px-6 py-3 bg-white text-gray-700 font-semibold rounded-full hover:bg-gray-100 transition-colors shadow-md border border-gray-200",children:[(0,f.jsx)(uw.A,{className:"h-4 w-4 mr-2"}),"Get a Quote"]})]})]})})]});var ww=s(93063),Nw=s(64001);const Aw={"conference-photography":{slug:"conference-photography",name:"Conference Photography & Videography",shortName:"Conference Photography",heroTitle:"Conference",heroTitleAccent:"Photographer",cityHeroLines:e=>[{text:"Conference Photographer",variant:"primary"},{text:e,variant:"accent"},{text:"\u2014 Same-Day Photos & Video",variant:"tagline"}],citySeo:{sydney:{metaTitle:"Conference Photographer Sydney | Same-Day Photos & Video | Turbo 360",metaDescription:"Conference photographer Sydney for keynotes, panels and networking. Same-day photos, multi-camera video and AI galleries at ICC Sydney and across NSW. Get a quote."},melbourne:{metaTitle:"Conference Photographer Melbourne | Same-Day Photos & Video | Turbo 360",metaDescription:"Conference photographer Melbourne for keynotes, panels and exhibitions. Same-day photos, multi-camera video and AI galleries at MCEC and across Victoria. Get a quote."}},images:{hero:"/images/services/locations/conference-auditorium-crown-melbourne.jpg",card:"/images/services/locations/conference-keynote-speaker-crown-melbourne.jpg",gallery:["/images/services/locations/conference-speaker-stage-melbourne.jpg","/images/services/locations/conference-panel-discussion-stage.jpg","/images/services/locations/conference-audience-question-mic.jpg","/images/services/locations/conference-presenter-podium-melbourne.jpg","/images/services/locations/conference-networking-break-crowd.jpg","/images/services/locations/conference-mc-podium-melbourne.jpg"]},metaTitleTemplate:"Conference Photographer {city} | Same-Day Photos & Video | Turbo 360",metaDescriptionTemplate:"Conference photographer in {city} \u2014 same-day photos, multi-camera video & AI galleries. Trusted at {venues}. Get a quote.",hubMetaTitle:"Conference Photographer Australia \u2014 By City | Turbo 360",hubMetaDescription:"Australia's #1 conference photographer. Same-day photos, multi-camera video, AI galleries & live streaming across 9 cities. 180+ reviews. Get a quote.",schemaServiceType:"Conference Photography and Videography",icon:"Camera",intro:"Professional conference photography and videography with same-day delivery. Our multi-camera setups capture every keynote, panel discussion, and networking moment while our editing team delivers polished content before your event wraps up.",features:[{title:"Same-Day Photo Delivery",description:"Edited, colour-graded images delivered to your inbox within hours \u2014 not weeks. Share highlights on social media while attendees are still buzzing.",icon:"Clock"},{title:"Multi-Camera Video Production",description:"Two to six camera setups with professional audio capture. Presentations recorded with synchronised slide integration for polished playback.",icon:"Video"},{title:"Facial Recognition Galleries",description:"AI-powered Smart Galleries match photos to registered attendees automatically. Each delegate receives a personalised gallery link within hours.",icon:"Eye"},{title:"Hourly Social Reels",description:"For every hour on-site, we deliver a fully edited vertical reel optimised for Instagram Reels, TikTok, YouTube Shorts, and LinkedIn.",icon:"Share2"},{title:"Live Photo Streaming",description:"Photos appear on screens throughout your venue in real-time. Display sponsor branding alongside live event imagery for maximum engagement.",icon:"Radio"},{title:"Presentation Recording",description:"Full keynote and breakout session recording with slide integration, professional audio, and 24-hour turnaround for post-event content libraries.",icon:"Monitor"}],keywords:["conference photographer","conference photography","conference videography","trade show photographer","same day conference photos","conference video production","multi-camera setup","facial recognition galleries","conference live streaming","event photographer","PCO photographer","conference video"],relatedServices:["exhibition-photography","corporate-event-photography"]},"exhibition-photography":{slug:"exhibition-photography",name:"Exhibition Photography & Videography",shortName:"Exhibition Photography",heroTitle:"Exhibition",heroTitleAccent:"Photography & Video",images:{hero:"/images/services/locations/exhibition-floor-networking.jpg",card:"/images/services/locations/exhibition-booth-demo-delegate.jpg",gallery:["/images/services/locations/exhibition-booth-networking-delegates.jpg","/images/services/locations/conference-registration-desk-delegates.jpg","/images/services/locations/conference-delegates-roundtable-discussion.jpg","/images/services/locations/exhibition-delegates-networking-walk.jpg","/images/services/locations/exhibition-award-ceremony.jpg","/images/services/locations/exhibition-networking-drinks.jpg"]},metaTitleTemplate:"Exhibition & Trade Show Photographer {city} | Turbo 360",metaDescriptionTemplate:"Exhibition & trade show photographer in {city}. Same-day booth, product & exhibitor photos at {venues}. 180+ 5\u2605 reviews.",hubMetaTitle:"Exhibition & Trade Show Photographer Australia | Turbo 360",hubMetaDescription:"Exhibition & trade show photographer across Australia. Same-day booth photos, product displays, exhibitor portraits & floor-walk video. Book today.",schemaServiceType:"Exhibition Photography and Videography",icon:"Target",intro:"Exhibition photography that captures the energy of your trade show floor. From stand builds and product displays to visitor engagement and exhibitor portraits \u2014 delivered same-day so exhibitors can share content while the event is still running.",features:[{title:"Exhibitor Stand Photography",description:"High-quality images of every booth, from shell scheme stands to custom builds. Delivered to exhibitors same-day for immediate social media use.",icon:"Camera"},{title:"Product & Display Capture",description:"Detailed product photography and display documentation. Perfect for post-event marketing materials and catalogues.",icon:"Eye"},{title:"Floor Walk Video Content",description:"Dynamic walk-through videos showcasing the exhibition floor, key stands, and product demonstrations. Edited into shareable social content within hours.",icon:"Video"},{title:"Exhibitor Testimonials",description:"Quick-turn video testimonials captured on the exhibition floor. Professional audio and lighting for polished results despite the busy environment.",icon:"Users"},{title:"Aerial & Wide-Angle Coverage",description:"Elevated photography showing the full scale of your exhibition floor. Drone footage where venue regulations permit.",icon:"Globe"},{title:"Real-Time Social Content",description:"Hourly social media reels and photo sets delivered throughout the event day for immediate exhibitor and organiser sharing.",icon:"Share2"}],keywords:["exhibition photographer","exhibition photography","trade show photographer","expo photographer","expo photography","exhibition videography","booth photography","stand ph
1otography","trade show video","exhibitor photography","product display photography","exhibition coverage"],relatedServices:["conference-photography","corporate-event-photography"]},"corporate-event-photography":{slug:"corporate-event-photography",name:"Corporate Event Photography & Videography",shortName:"Corporate Event Photography",heroTitle:"Corporate Event",heroTitleAccent:"Photographer",cityHeroLines:e=>[{text:"Corporate Event Photographer",variant:"primary"},{text:e,variant:"accent"},{text:"\u2014 Same-Day Photos & Video",variant:"tagline"}],images:{hero:"/images/services/locations/corporate-event-audience.jpg",card:"/images/services/locations/corporate-event-guests.jpg",gallery:["/images/services/locations/corporate-dinner-private.jpg","/images/services/locations/corporate-networking-dinner-guests.jpg","/images/services/locations/corporate-dinner-riverside-melbourne.jpg","/images/services/locations/corporate-awards-dinner-speaker.jpg","/images/services/locations/corporate-dinner-venue-melbourne.jpg","/images/services/locations/corporate-presenter-closeup.jpg"]},metaTitleTemplate:"Corporate Event Photography {city} | Turbo 360",metaDescriptionTemplate:"Corporate event photographer in {city} \u2014 same-day gala, awards, launch & team-event coverage across {region}. 180+ 5\u2605 reviews.",hubMetaTitle:"Corporate Event Photography Australia | Turbo 360",hubMetaDescription:"Corporate event photographer across Australia. Gala dinners, awards nights, product launches & team events with same-day delivery. Get a quote.",schemaServiceType:"Corporate Event Photography and Videography",icon:"Building",intro:"Corporate event photography and videography for gala dinners, product launches, awards nights, team days, and milestone celebrations. Our experienced crew understands the nuances of corporate photography \u2014 discretion, timing, and delivering content that elevates your brand.",features:[{title:"Gala Dinner & Awards Coverage",description:"Elegant photography capturing the atmosphere of your gala dinner or awards night. Low-light specialists ensuring sharp, vibrant images in any ballroom.",icon:"Award"},{title:"Product Launch Documentation",description:"Every reveal, reaction, and detail captured. Multi-angle video production with same-day highlight reels for immediate media distribution.",icon:"Zap"},{title:"Team Building & Corporate Days",description:"Candid and group photography for team events, corporate retreats, and company milestones. Natural, unposed imagery that shows your culture.",icon:"Users"},{title:"VIP & Executive Photography",description:"Discrete, professional photography for executive events, board meetings, and high-profile corporate gatherings.",icon:"Star"},{title:"Brand-Aligned Content",description:"Post-production colour grading and editing aligned to your brand guidelines. Consistent visual identity across all delivered content.",icon:"Edit3"},{title:"Same-Day Event Highlights",description:"Edited photo galleries and highlight videos delivered within hours. Share with attendees, stakeholders, and media while the event is still fresh.",icon:"Clock"}],keywords:["corporate event photographer","corporate event photography","corporate videography","gala dinner photographer","product launch photography","awards night photographer","corporate function photographer","team event photographer","business event coverage","corporate video production","corporate photographer"],relatedServices:["conference-photography","corporate-headshots"]},"corporate-headshots":{slug:"corporate-headshots",name:"Corporate Headshots & Business Portraits",shortName:"Corporate Headshots",heroTitle:"Corporate",heroTitleAccent:"Headshots & Portraits",images:{hero:"/images/services/headshots/20260120-008_Micevski_James_23-SQR.jpg",card:"/images/services/headshots/20260120-010_N
1arayanan_Krithika_05-SQR.jpg",gallery:["/images/services/headshots/20260121-001_Asvestas_Nathan_05-SQR.jpg","/images/services/headshots/20260121-003_Tria_James_02-SQR.jpg","/images/services/headshots/20260121-005_Peters_Jessica_02-SQR.jpg"]},metaTitleTemplate:"Corporate & Professional Headshots {city} | Turbo 360",metaDescriptionTemplate:"Corporate headshots in {city} \u2014 on-location team sessions (10\u2013500+ staff), same-day retouched, LinkedIn-ready. 180+ 5\u2605 reviews. Book today.",hubMetaTitle:"Corporate Headshots | Business & Company Headshot Photography | Turbo 360",hubMetaDescription:"Corporate and business headshots for company teams in every Australian capital. Same-day retouching, on-location studio, 180+ 5\u2605 reviews. Get a quote.",schemaServiceType:"Corporate Headshot Photography",icon:"User",intro:"Corporate headshots, business portraits and company headshot photography \u2014 we bring a pop-up studio to your office, photograph the whole team in about a minute each, and hand back retouched, LinkedIn-ready files the same day. Teams of 10 to 300+.",features:[{title:"On-location team sessions",description:"We set up a portable studio at your office. Professional lighting, backdrops, and equipment \u2014 teams of 10 to 300+ photographed with minimal downtime.",icon:"Building"},{title:"Executive portraits",description:"Premium sessions for C-suite and leadership teams. Multiple setups, wardrobe changes, and environmental portraits in your workspace.",icon:"Star"},{title:"LinkedIn & profile ready",description:"Modern headshots optimised for LinkedIn, company websites, and professional directories. Consistent look across your entire team.",icon:"User"},{title:"Same-day retouching",description:"Skin retouching, colour correction, and background cleanup delivered within hours. No waiting weeks for your team photos.",icon:"Clock"},{title:"Brand-consistent styling",description:"Background colours, lighting styles, and crop ratios matched to your brand guidelines \u2014 seamless with your existing visual identity.",icon:"Edit3"},{title:"Transparent cut-outs",description:"Every portrait also arrives as a transparent cut-out \u2014 any background, any format, whenever your brand changes.",icon:"Users"}],faqs:[{q:"How quickly do we get the photos?",a:"Same day \u2014 usually within hours of the last person sitting down. Retouched, colour-graded and web-ready."},{q:"How much does it cost?",a:"Priced per head with volume rates, based on session length and crew. Request a quote for an exact figure."},{q:"Where do you cover?",a:"Every Australian capital, plus New Zealand and Singapore. Crews are local and already know the venues."},{q:"How much space do you need?",a:"Three metres by three metres and a power point. A meeting room, foyer corner or pre-function space all work."}],keywords:["corporate headshots","professional headshots","business portraits","LinkedIn headshots","team photography","executive portraits","corporate portraits","office photography","staff photos","company headshots","business headshots","headshot photographer"],relatedServices:["corporate-event-photography","event-coverage"]},"event-coverage":{slug:"event-coverage",name:"Event Photography & Videography",shortName:"Event Coverage",heroTitle:"Event",heroTitleAccent:"Photographer",cityHeroLines:e=>[{text:"Event Photographer",variant:"primary"},{text:e,variant:"accent"},{text:"\u2014 Same-Day Photos & Video",variant:"tagline"}],images:{hero:"/images/services/locations/event-coverage-plenary.jpg",card:"/images/services/locations/event-coverage-group-celebration.jpg",gallery:["/images/services/locations/event-coverage-panel-speaker.jpg","/images/services/locations/event-coverage-keynote.jpg","/images/services/locations/event-networking-drinks-melbourne.jpg","/images/services/locations/event-mc-crown-melbourne.jpg"]},metaTitleTemplate:"Event Photographer {city} | Same-Day Photos & Video",metaDescriptionTemplate:"Event photographer in {city} \u2014 same-day photos & video. Festivals, galas, sporting & private events across {region}. 180+ 5\u2605 reviews.",hubMetaTitle:"Event Photography Australia | Turbo 360",hubMetaDescription:"Event photographer across Australia. Same-day photos & video for festivals, charity galas, sporting events and private functions. Get a quote.",schemaServiceType:"Event Photography and Videography",icon:"Zap",intro:"Versatile event photography and videography for any occasion. From charity galas and fundraising dinners to festivals, sporting events, and community celebrations \u2014 we adapt our approach to match the energy and tone of every event.",features:[{title:"Festival & Public Event Coverage",description:"Dynamic photography and video capturing the atmosphere, crowd energy, and key moments of public events and festivals.",icon:"Users"},{title:"Charity & Fundraising Events",description:"Sensitive, professional coverage of charity galas, fundraising dinners, and not-for-profit events. Content that helps tell your story and drive future donations.",icon:"Heart"},{title:"Sporting Event Photography",description:"High-speed photography capturing the action, emotion, and atmosphere of sporting events. Professional-grade gear for any lighting condition.",icon:"Zap"},{title:"Live Streaming Services",description:"Multi-camera live streaming to YouTube, Facebook, or your custom platform. Professional switching, graphics overlay, and recording for post-event use.",icon:"Radio"},{title:"Drone & Aerial Photography",description:"CASA-certified drone operators for aerial photography and video. Stunning perspectives of outdoor events, venues, and crowd sizes.",icon:"Globe"}
1,{title:"Rapid Content Turnaround",description:"Same-day edited photo galleries and highlight videos. Social media content packages including vertical reels delivered hourly during your event.",icon:"Clock"}],keywords:["event photographer","event photography","event videography","festival photographer","festival photography","charity event photographer","gala photographer","gala photography","fundraising event photographer","community event coverage","sporting event photographer","live event streaming","drone event photography","same day event photos","event video production","public event photographer","private function photographer"],relatedServices:["corporate-event-photography","conference-photography"]}},kw=(e,t)=>{const s=e.shortName.toLowerCase(),a=t?" in ".concat(t):"",n=t?"across ".concat(t," and the surrounding region"):"in every Australian capital city";return[{q:"How quickly do you deliver ".concat(s," photos").concat(a,"?"),a:"We deliver edited, colour-graded images the same day \u2014 usually within hours. Highlight galleries and social reels can be turned around while your event".concat(a," is still running, instead of waiting days or weeks.")},{q:"How much does ".concat(s).concat(a," cost?"),a:"Pricing depends on hours of coverage, crew size, and deliverables (photos, video, live streaming). Most ".concat(s," bookings start from a half-day rate \u2014 request a free quote for an exact figure tailored to your event").concat(a,".")},{q:"Do you cover events ".concat(t?"".concat(t," and surrounds"):"Australia-wide","?"),a:"Yes. We provide ".concat(s," ").concat(n,", plus New Zealand and Singapore. Our crews are local and already know the major venues, load-in logistics, and lighting").
1concat(a,".")},{q:"What's included with your ".concat(s," service?"),a:"Every booking includes professional photographers and videographers, same-day edited delivery, and AI facial-recognition galleries where relevant. Optional add-ons include live streaming, drone coverage, and hourly vertical social reels."}]},Sw=Object.keys(Aw),_w=e=>Aw[e],Cw=Aw;var Fw=s(63981);const Ew=()=>{const e="https://turbo.net.au",t="Same-day event photography & video across Australia \u2014 conference, corporate, exhibition & headshot photographers in every capital city. Get a quote.",s=(0,m.A)((0,m.A)({"@context":"https://schema.org","@type":"ProfessionalService",name:"Turbo 360",description:t,url:e,telephone:"+61-1300-207-446",email:"[email protected]"},(0,Fw.tp)(e)),{},{areaServed:L.EW.map(e=>({"@type":"City",name:L.Ay[e].name})),hasOfferCatalog:{"@type":"OfferCatalog",name:"Event Photography Services",itemListElement:Sw.map(e=>({"@type":"Offer",itemOffered:{"@type":"Service",name:Cw[e].name}}))}}),a={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"".concat(e,"/")},{"@type":"ListItem",position:2,name:"Services"}]};return(0,f.jsxs)(ae.mP,{className:"!pt-0",children:[(0,f.jsx)(R.A,{rawTitle:"360 Photo & Video Production Services Australia | Turbo 360",description:t,keywords:"event photography Australia, conference photography, exhibition photography, corporate headshots, event videography, same day delivery, Sydney, Melbourne, Brisbane, Perth, Adelaide, Canberra, Hobart, Darwin",canonical:"/services",ogImage:"".concat(e,"/images/services/locations/conference-auditorium-wide.jpg"),structuredData:[s,a]}),(0,f.jsx)(D.A,{}),(0,f.jsx)("div",{className:"relative z-20 bg-carbon-900/80 backdrop-blur-sm border-b border-[#222] pt-[76px]",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-[22px] md:px-11 py-3",children:(0,f.jsx)(Nw.Qp,{children:(0,f.jsxs)(Nw.AB,{className:"text-fog",children:[(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/",className:"font-mono text-xs uppercase tracking-[0.16em] text-fog hover:text-turbo-red transition-colors",children:"Home"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#444]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.tJ,{className:"font-mono text-xs uppercase tracking-[0.16em] text-smoke",children:"Services"})})]})})})}),(0,f.jsxs)("section",{className:"relative flex min-h-[78vh] flex-col justify-end overflow-hidden bg-carbon-900",children:[(0,f.jsx)("div",{className:"absolute inset-0 z-0 bg-cover bg-center",style:{backgroundImage:'url("/images/services/locations/conference-auditorium-wide.jpg")'}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0 z-[1]",style:{background:"linear-gradient(180deg,rgba(13,13,13,.55) 0%,rgba(13,13,13,.35) 38%,rgba(13,13,13,.72) 70%,#0d0d0d 100%)"}}),(0,f.jsxs)("div",{className:"relative z-[3] mx-auto w-full max-w-7xl px-[22px] pb-20 pt-28 md:px-11 md:pb-24",children:[(0,f.jsxs)("div",{className:"mb-[26px] inline-flex items-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsxs)("span",{className:"inline-flex items-center gap-2 font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:[(0,f.jsx)(C.A,{className:"h-3.5 w-3.5 text-turbo-red"}),L.EW.length," hubs \xb7 ",Sw.length," services"]})]}),(0,f.jsxs)(ae.nl,{as:"h1",className:"m-0 text-[clamp(48px,8.4vw,128px)] leading-[0.9] tracking-[-0.025em] [text-wrap:balance]",children:["Event photography",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"across Australia."})]}),(0,f.jsxs)("p",{className:"mt-[30px] max-w-3xl text-[clamp(17px,1.5vw,21px)] leading-[1.6] text-[#D9D6CF]",children:["Same-day photo + video delivery from ICC Sydney to MCEC Melbourne, the new ",(0,f.jsx)(r.N_,{to:"/venues/nyaal-banyul-geelong",className:"text-smoke underline decoration-turbo-red underline-offset-4 hover:text-turbo-red transition-colors",children:"Nyaal Banyul in Geelong"}),", and every capital in between. One booking, one crew, one delivery pipeline."]}),(0,f.jsxs)("div",{className:"mt-[38px] flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:[(0,f.jsx)(ae.$$,{to:"/get-quote",children:"Get a quote \u2192"}),(0,f.jsx)(ae.qM,{href:"#services",onClick:e=>{var t;e.preventDefault(),null===(t=document.getElementById("services"))||void 0===t||t.scrollIntoView({behavior:"smooth"})},className:"backdrop-blur-sm",children:"Services"})]})]})]}),(0,f.jsx)("section",{id:"services",className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-14",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / Services"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Photography",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"& video."})]}),(0,f.jsx)("p",{className:"mt-6 max-w-2xl text-[17px] leading-[1.6] text-[#9C9A95]",children:"Six capabilities, one crew. Mix and match \u2014 every booking ships from the same in-house delivery pipeline."})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-3",children:Sw.map((e,t)=>{var s,a;const n=Cw[e],i=String(t+1).padStart(2,"0"),o=(null===(s=n.images)||void 0===s?void 0:s.card)||"/images/services/business-service.jpg";return(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)(r.N_,{to:"/services/".concat(e),className:"group block overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] transition-colors hover:border-turbo-red",children:[(0,f.jsxs)("div",{className:"relative aspect-[4/5] overflow-hidden",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center transition-transform duration-700 ease-turbo group-hover:scale-[1.06]",style:{backgroundImage:"url('".concat(o,"')")}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 40%,rgba(13,13,13,.88))"}}
1),(0,f.jsx)("div",{className:"absolute left-4 top-4 rounded bg-turbo-red/90 px-2.5 py-[5px] font-mono text-[11px] uppercase tracking-[0.2em] text-white",children:i}),(0,f.jsxs)("div",{className:"absolute inset-x-[18px] bottom-[18px]",children:[(0,f.jsx)("h3",{className:"mb-1.5 font-head text-[21px] font-bold leading-tight text-white",children:n.shortName||n.name}),(0,f.jsx)("p",{className:"m-0 line-clamp-2 text-[13.5px] leading-[1.55] text-[#C7C4BD]",children:(null===(a=n.intro)||void 0===a?void 0:a.length)>110?n.intro.substring(0,110)+"\u2026":n.intro})]})]}),(0,f.jsxs)("div",{className:"flex items-center justify-between px-[18px] py-4",children:[(0,f.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-[0.16em] text-[#8A8884]",children:"Explore"}),(0,f.jsx)(La.A,{size:18,className:"text-smoke transition-transform duration-[400ms] ease-turbo group-hover:-translate-y-1 group-hover:translate-x-1 group-hover:text-turbo-red"})]})]})},e)})})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-14",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"02 / Coverage"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Hubs everywhere,",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"we travel further."})]}),(0,f.jsx)("p",{className:"mt-6 max-w-2xl text-[17px] leading-[1.6] text-[#9C9A95]",children:"Crews on standby in every Australian capital plus regional pickups across AU, NZ, and Asia-Pacific. The list below is where we're based \u2014 not where we work."})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[18px] sm:grid-cols-2 lg:grid-cols-3",children:L.EW.map((e,t)=>{const s=L.Ay[e];return(0,f.jsx)(ae.gN,{delay:t%3*60,children:(0,f.jsxs)(r.N_,{to:"/services/locations/".concat(e),className:"group block overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] px-6 py-5 transition-colors hover:border-turbo-red",children:[(0,f.jsxs)("div",{className:"mb-2 flex items-start justify-between gap-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"mb-1 font-mono text-[10px] uppercase tracking-[0.3em] text-turbo-red",children:s.state}),(0,f.jsx)("h3",{className:"font-head text-2xl font-bold text-white transition-colors group-hover:text-turbo-red",children:s.name})]}),(0,f.jsx)(La.A,{size:18,className:"shrink-0 text-[#8A8884] transition-transform duration-[400ms] ease-turbo group-hover:-translate-y-1 group-hover:translate-x-1 group-hover:text-turbo-red"})]}),(0,f.jsxs)("p",{className:"text-xs leading-snug text-[#9C9A95]",children:[s.venues.length," venues \xb7 ",s.annualEvents.length," annual events"]}),s.heroSubtitle&&(0,f.jsx)("p",{className:"mt-1 line-clamp-1 text-xs italic text-[#6F6D68]",children:s.heroSubtitle})]})},e)})}),(0,f.jsx)(ae.gN,{children:(0,f.jsxs)(r.N_,{to:"/get-quote",className:"group mt-8 flex items-center justify-between gap-3 rounded-[10px] border border-turbo-red/40 bg-turbo-red/10 px-6 py-5 transition-colors hover:border-turbo-red hover:bg-turbo-red/20",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"font-head text-base font-bold text-white",children:"Don't see your city? We come to you."}),(0,f.jsx)("div",{className:"mt-0.5 text-sm text-[#C7C4BD]",children:"AU regional \xb7 New Zealand \xb7 Asia-Pacific \xb7 or wherever the brief lands."})]}),(0,f.jsx)(La.A,{size:20,className:"shrink-0 text-turbo-red transition-transform duration-[400ms] ease-turbo group-hover:-translate-y-1 group-hover:translate-x-1"})]})})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsx)("div",{className:"mx-auto max-w-5xl",children:(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"03 / Why Turbo"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Same crew,",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"same day, same standard."})]}),(0,f.jsxs)("div",{className:"mt-8 space-y-5 text-lg leading-[1.7] text-[#C7C4BD]",children:[(0,f.jsx)("p",{children:"Turbo 360 provides professional event photography and videography services in Sydney, Melbourne, Geelong, Brisbane, Perth, Adelaide, Canberra, Hobart, and Darwin. Our experienced crew covers conferences, exhibitions, corporate events, headsh
1ot sessions, and general event coverage with same-day delivery as standard across all locations."}),(0,f.jsx)("p",{children:"Whether you need a photographer for a major conference at ICC Sydney, exhibition coverage at the Melbourne Convention and Exhibition Centre, or corporate headshots in your Perth office, our local teams deliver consistently high-quality results with rapid turnaround. Every booking includes professionally edited photos delivered the same day your event takes place."})]})]})})}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] px-[22px] py-32 md:px-11 md:py-48",children:[(0,f.jsx)("div",{className:"absolute inset-0 z-0 bg-cover bg-center",style:{backgroundImage:"url('/images/services/locations/event-coverage-panel-speaker.jpg')"}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0 z-[1]",style:{background:"linear-gradient(120deg,rgba(142,24,34,.40),rgba(13,13,13,.45) 55%,rgba(13,13,13,.7))"}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 top-1/4 z-[1]",style:{background:"linear-gradient(180deg,transparent,rgba(13,13,13,.65))"}}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-5xl text-center",children:[(0,f.jsx)(ae.YZ,{className:"mb-5 flex items-center justify-center",children:"04 / Ready"}),(0,f.jsxs)(ae.nl,{as:"h2",className:"mb-8 text-[clamp(42px,6.4vw,96px)] leading-[0.94] tracking-[-0.025em]",children:["Same-day,",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"anywhere in APAC."})]}),(0,f.jsx)("p",{className:"mx-auto mb-12 max-w-2xl text-[clamp(17px,1.6vw,20px)] leading-[1.6] text-[#D9D6CF]",children:"Tell us the brief \u2014 we'll have a quote back within hours and a crew on the ground when you need it."}),(0,f.jsx)(ae.$$,{to:"/get-quote",className:"px-[46px] py-5 text-lg",children:"Get a quote \u2192"})]})]}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})};var Tw=s(20081);const zw=e=>e<45?"":e<48?"md:hidden xl:block":"hidden xl:block";function Bw(e){let{faces:t=ie,eagerCount:s=0,className:a="",children:n}=e;return(0,f.jsxs)("div",{className:"relative bg-[#0A0A0B] ".concat(a),children:[(0,f.jsx)("div",{className:"grid grid-cols-6 gap-[2px] md:grid-cols-9 xl:grid-cols-[repeat(17,minmax(0,1fr))]",children:t.map((e,t)=>(0,f.jsx)("div",{className:"aspect-square overflow-hidden bg-[#1A1A1A] ".concat(zw(t)),children:(0,f.jsx)("img",{src:e.src,srcSet:e.srcSet,sizes:"(min-width:1280px) 6vw, (min-width:768px) 11vw, 17vw",width:"200",height:"200",alt:"Corporate headshot by Turbo 360",loading:t<s?"eager":"lazy",decoding:"async",className:"block h-full w-full object-cover"})},e.id))}),n]})}function Dw(e){let{headline:t,meta:s}=e;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.55) 0%,rgba(13,13,13,0) 34%,rgba(13,13,13,.86) 100%)"}}),(0,f.jsxs)("div",{className:"absolute inset-x-5 bottom-[22px] flex flex-col items-start gap-3.5 md:inset-x-9 md:bottom-10 md:flex-row md:items-end md:justify-between md:gap-10 xl:inset-x-14",children:[(0,f.jsx)("div",{className:"font-display text-[28px] font-black uppercase leading-[0.9] tracking-[-0.025em] text-white md:text-[38px] xl:text-[56px] [text-wrap:balance]",children:t}),(0,f.jsx)("div",{className:"text-left font-mono text-[11px] uppercase tracking-[0.18em] text-fog md:text-right md:text-[13px]",children:s})]})]})}const Iw={amber:"text-ignition",teal:"text-cinema",red:"text-turbo-red",smoke:"text-smoke"};function Rw(e){let{stats:t,className:s=""}=e;return(0,f.jsx)("div",{className:"grid grid-cols-2 border-y border-[#222] bg-carbon md:grid-cols-4 ".concat(s),children:t.map((e,s)=>(0,f.jsxs)("div",{className:"border-b border-[#222] px-5 py-6 md:border-b-0 md:px-10 md:py-[38px] ".concat(s<t.length-1?"md:border-r":""," ").concat(s%2===0?"border-r md:border-r":""," ").concat(s===t.length-1?"md:!border-r-0":""),children:[(0,f.jsx)("div",{className:"font-mono text-[30px] font-bold leading-none md:text-[44px] ".concat(Iw[e.tone]||Iw.smoke),children:e.value}),(0,f.jsx)("div",{className:"mt-2.5 font-mono text-[11px] uppercase tracking-[0.18em] text-ash md:text-xs",children:e.label})]},e.label))})}const Pw=["to","href","children","className","invert"],Ww="px-5 py-16 md:px-9 md:py-20 xl:px-14 xl:py-[110px]",Ow="px-5 md:px-9 xl:px-14";function Lw(e){let{children:t,className:s="",tone:a="red"}=e;const n="teal"===a?"text-cinema":"amber"===a?"text-ignition":"text-turbo-red";return(0,f.jsx)("div",{className:"font-mono text-xs uppercase tracking-[0.24em] ".concat(n," ").concat(s),children:t})}function Mw(e){let{children:t,className:s="",size:a="lg"}=e;const n="sm"===a?"xl:text-[56px]":"xl:text-[64px]";return(0,f.jsx)("h2",{className:"m-0 font-display text-[34px] font-black uppercase leading-[0.96] tracking-[-0.025em] text-smoke md:text-[48px] ".concat(n," ").concat(s),children:t})}function qw(e){let{id:t,tone:s="carbon",className:a="",children:n,bordered:r=!0}=e;const i="carbon-900"===s?"bg-carbon-900":"bg-carbon";return(0,f.jsx)("section",{id:t,className:"".concat(r?"border-b border-[#222]":""," ").concat(Ww," ").concat(i," ").concat(a),children:n})}function Hw(e){let{children:t,className:s="",pad:a="p-[30px]"}=e;return(0,f.jsx)("div",{className:"h-full border border-[#262626] bg-[#1A1A1A] transition-colors duration-300 hover:border-turbo-red ".concat(a," ").concat(s),children:t})}function Uw(e){let{to:t,href:s,children:a,className:n="",invert:i=!1}=e,o=(0,ot.A)(e,Pw);const l="inline-flex items-center justify-center gap-2.5 px-[30px] py-[17px] font-mono text-[13px] font-bold uppercase tracking-[0.16em] transition-[background-color,transform] duration-[400ms] ease-turbo hover:-translate-y-[3px] ".concat(i?"bg-white text-turbo-red hover:bg-smoke":"bg-turbo-red text-white hover:bg-redline"," ").concat(n);return t?(0,f.jsx)(r.N_,(0,m.A)((0,m.A)({to:t,className:l},o),{},{children:a})):(0,f.jsx)("a",(0,m.A)((0,m.A)({href:s,className:l},o),{},{children:a}))}function Gw(e){let{n:t,title:s,body:a,delay:n=0}=e;return(0,f.jsx)(ae.gN,{delay:n,className:"h-full",children:(0,f.jsxs)(Hw,{children:[(0,f.jsx)("div",{className:"mb-5 font-mono text-xs tracking-[0.2em] text-turbo-red",children:t}),(0,f.jsx)("h3",{className:"m-0 mb-3 font-head text-[21px] font-bold text-smoke",children:s}),(0,f.jsx)("p",{className:"m-0 text-[14.5px] leading-[1.6] text-[#9C9A95] [text-wrap:pretty]",children:a})]})})}function Vw(e){let{to:t,children:s,glyph:a="\u2192"}=e;return(0,f.jsxs)(r.N_,{to:t,className:"group flex items-center gap-3 border border-[#262626] bg-[#1A1A1A] px-[18px] py-3.5 text-[15px] text-[#C7C4BD] transition-colors hover:border-turbo-red hover:text-smoke",children:[(0,f.jsx)("span",{className:"font-mono text-turbo-red transition-transform group-hover:translate-x-1",children:a}),(0,f.jsx)("span",{children:s})]})}function Jw(e){let{children:t,ping:s=!1}=e;return(0,f.jsxs)("div",{className:"mb-[26px] flex items-center gap-3",children:[(0,f.jsx)("span",{className:"block h-2 w-2 rounded-full bg-turbo-red ".concat(s?"animate-ping-soft":"")}),(0,f.jsx)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:t})]})}const Yw="corporate-headshots",Kw="https://turbo.net.au",Zw=[{t:"08:30",body:"Studio builds in a meeting room or foyer corner \u2014 three metres square is plenty."},{t:"09:00",body:"Bookings run on a rolling schedule. About a minute per person \u2014 no one leaves their desk for long."},{t:"13:00",body:"Selects retouched on-site while the session is still running."},{t:"17:00",body:"Gallery delivered \u2014 web-ready files plus transparent cut-outs, same day."}],$w=[{value:"1 min",label:"Per person",tone:"amber"},{value:"300+",label:"Staff per day",tone:"teal"},{value:"0",label:"Days waiting",tone:"red"},{value:"180+",label:"Five-star reviews",tone:"smoke"}],Qw=()=>{const e=_w(Yw),t="/services/".concat(Yw),s={"@context":"https://schema.org","@type":"Service",name:e.name,description:e.hubMetaDescription,serviceType:e.schemaServiceType,aggregateRating:Fw._I,provider:(0,Fw.YQ)(Kw),areaServed:L.EW.map(e=>({"@type":"City",name:L.Ay[e].name,containedInPlace:{"@type":"State",name:L.Ay[e].stateFullName}})),offers:{"@type":"Offer",availability:"https://schema.org/InStock",priceRange:"$$"}},a={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"".concat(Kw,"/")},{"@type":"ListItem",position:2,name:"Services",item:"".concat(Kw,"/services")},{"@type":"ListItem",position:3,name:e.shortName}]};return(0,f.jsxs)(ae.mP,{children:[(0,f.jsx)(R.A,{rawTitle:e.hubMetaTitle,de
1scription:e.hubMetaDescription,keywords:e.keywords.join(", "),canonical:t,ogImage:"".concat(Kw).concat(e.images.hero),structuredData:[s,a]}),(0,f.jsx)(D.A,{}),(0,f.jsx)("div",{className:"relative z-20 border-b border-[#222] bg-carbon-900/80 py-3 backdrop-blur-sm ".concat(Ow),children:(0,f.jsx)(Nw.Qp,{children:(0,f.jsxs)(Nw.AB,{className:"flex-nowrap overflow-hidden whitespace-nowrap font-mono text-[11px] uppercase tracking-[0.16em] text-ash",children:[(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/",className:"text-ash transition-colors hover:text-turbo-red",children:"Home"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#444]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/services",className:"text-ash transition-colors hover:text-turbo-red",children:"Services"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#444]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.tJ,{className:"text-smoke",children:e.shortName})})]})})}),(0,f.jsxs)("section",{className:"relative grid grid-cols-1 items-end gap-0 overflow-hidden bg-carbon-900 pt-11 md:pt-14 xl:grid-cols-[minmax(0,1fr)_minmax(0,520px)] xl:gap-10 xl:pt-[74px] ".concat(Ow),children:[(0,f.jsx)("div",{className:"pointer-events-none absolute right-[-40px] top-[-60px] h-[640px] w-[640px]",style:{background:"radial-gradient(52% 52% at 50% 50%,rgba(232,233,238,.22) 0%,rgba(13,13,13,0) 72%)"}}),(0,f.jsx)("div",{className:"relative z-[2] min-w-0 pb-7 xl:pb-[78px]",children:(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(Jw,{children:"Australia-wide coverage"}),(0,f.jsxs)("h1",{className:"m-0 font-display text-[48px] font-black uppercase leading-[0.9] tracking-[-0.025em] text-smoke md:text-[66px] xl:text-[92px]",children:["Corporate Headshots"," ",(0,f.jsx)("span",{className:"block text-turbo-red",children:"\u2014 Business & Company Photography"})]}),(0,f.jsx)("p",{className:"mt-7 max-w-[600px] text-base leading-[1.62] text-[#D9D6CF] md:text-[19px] [text-wrap:pretty]",children:e.intro}),(0,f.jsx)("div",{className:"mt-9",children:(0,f.jsx)(Uw,{to:"/get-quote",children:"Get your quote \u2192"})})]})}),(0,f.jsx)("div",{className:"relative z-[2] flex h-[380px] items-end justify-start md:h-[460px] xl:h-[560px] xl:justify-center",children:(0,f.jsx)("img",{src:le,alt:"Corporate headshot by Turbo 360",width:"933",height:"1400",className:"block h-full w-auto max-w-full object-contain object-bottom"})})]}),(0,f.jsx)("div",{className:"h-[5px]",style:{background:ce}}),(0,f.jsx)(Bw,{children:(0,f.jsx)(Dw,{headline:(0,f.jsxs)(f.Fragment,{children:["51 headshots",(0,f.jsx)("br",{}),"in the ",(0,f.jsx)("span",{className:"text-turbo-red",children:"lunch hour."})]}),meta:(0,f.jsxs)(f.Fragment,{children:["One session \xb7 one look",(0,f.jsx)("br",{}),"Delivered same day"]})})}),(0,f.jsx)(Rw,{stats:$w,className:"!border-t-0"}),(0,f.jsxs)(qw,{tone:"carbon",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(Lw,{className:"mb-[18px]",children:"01 / What we offer"}),(0,f.jsx)(Mw,{className:"mb-8 md:mb-[54px]",children:"Our services"})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 xl:grid-cols-3",children:e.features.map((e,t)=>(0,f.jsx)(Gw,{n:String(t+1).padStart(2,"0"),title:e.title,body:e.description,delay:t%3*80},e.title))})]}),(0,f.jsxs)("section",{className:"grid grid-cols-1 border-b border-[#222] bg-carbon-900 xl:grid-cols-2",children:[(0,f.jsx)("div",{className:Ww,children:(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(Lw,{className:"mb-[18px]",children:"02 / How the day runs"}),(0,f.jsxs)(Mw,{size:"sm",className:"mb-8 md:mb-10",children:["In and out",(0,f.jsx)("br",{}),"before lunch",(0,f.jsx)("br",{}),"is over"]}),(0,f.jsx)("div",{className:"flex max-w-[520px] flex-col gap-[26px]",children:Zw.map(e=>(0,f.jsxs)("div",{className:"grid grid-cols-[64px_1fr] items-baseline gap-[18px]",children:[(0,f.jsx)("div",{className:"font-mono text-[13px] tracking-[0.14em] text-ignition",children:e.t}),(0,f.jsx)("div",{className:"text-base leading-[1.55] text-fog",children:e.body})]},e.t))})]})}),(0,f.jsx)("div",{className:"relative flex items-end justify-center overflow-hidden border-t border-[#222] xl:border-l xl:border-t-0",style:{background:"linear-gradient(170deg,#F0F1F4 0%,#D5D7DE 55%,#B9BCC6 100%)"},children:(0,f.jsx)("img",{src:"/images/headshots/hero-cutout-b.webp",alt:"Corporate headsh
1ot by Turbo 360 \u2014 studio portrait",width:"933",height:"1400",loading:"lazy",className:"block h-[420px] w-auto max-w-full object-contain object-bottom md:h-[520px] xl:h-[620px]"})})]}),(0,f.jsx)(Tw.A,{variant:"v2",tone:"carbon",eyebrow:"03 / Common questions",heading:"Before you book",faqs:e.faqs}),(0,f.jsxs)("section",{className:"relative overflow-hidden bg-carbon-900 py-[72px] text-center xl:py-[120px] ".concat(Ow),children:[(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 50% 0%,rgba(191,33,47,.22),transparent 60%)"}}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-[1100px]",children:[(0,f.jsxs)("h2",{className:"m-0 font-display text-[40px] font-black uppercase leading-[0.94] tracking-[-0.025em] text-smoke md:text-[56px] xl:text-[80px] [text-wrap:balance]",children:["Pick a day.",(0,f.jsx)("br",{}),"We'll bring the studio."]}),(0,f.jsx)("div",{className:"mt-[38px] flex justify-center",children:(0,f.jsx)(Uw,{to:"/get-quote",className:"!px-9 !py-[19px] !text-sm",children:"Get your quote now"})}),(0,f.jsxs)("div",{className:"mt-14 grid grid-cols-1 gap-[34px] text-left md:grid-cols-3",children:[(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("div",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-turbo-red",children:"Call now"}),(0,f.jsx)("a",{href:"tel:1300207446",className:"text-base text-smoke",children:"1300 207 446"})]}),(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("div",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-turbo-red",children:"Email"}),(0,f.jsx)("a",{href:"mailto:[email protected]",className:"text-base text-smoke",children:"[email protected]"})]}),(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("div",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-turbo-red",children:"Locations"}),(0,f.jsx)("div",{className:"text-base text-smoke",children:"All major Australian cities"})]})]})]})]}),(0,f.jsxs)("section",{className:"border-t border-[#222] bg-carbon py-12 md:py-14 ".concat(Ow),children:[(0,f.jsx)("div",{className:"mb-5 font-mono text-[11px] uppercase tracking-[0.2em] text-turbo-red",children:"Corporate headshots by city"}),(0,f.jsx)("div",{className:"flex flex-wrap gap-2.5",children:L.EW.map(e=>(0,f.jsxs)(r.N_,{to:"/services/".concat(Yw,"/").concat(e),className:"border border-[#2B2B2B] px-[18px] py-[11px] font-mono text-xs uppercase tracking-[0.12em] text-silver transition-colors hover:border-turbo-red hover:text-smoke",children:[L.Ay[e].name," \u2192"]},e))})]}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})};function Xw(e){let{lines:t,className:s}=e;const a=(t||[]).filter(e=>e&&e.text);return(0,f.jsx)("h1",{className:s,children:a.map((e,t)=>(0,f.jsxs)("span",{className:e.className,children:[t>0?" ":null,e.text]},"".concat(t,"-").concat(e.text)))})}const eN={Camera:Ue.A,Video:Ge.A,Clock:Nt.A,Users:Xe.A,Eye:_.A,Share2:at.A,Monitor:Da.A,Radio:Ve.A,Heart:fs.A,Globe:et.A,Target:tt.A,Building:Ke.A,User:Ye.A,Award:za.A,Zap:F.A,Edit3:Je.A,Star:nt.A,MapPin:C.A,CheckCircle:p.A},tN=()=>{const{serviceSlug:e}=(0,r.g)(),t=_w(e);if("corporate-headshots"===e)return(0,f.jsx)(Qw,{});if(!t)return(0,f.jsx)(r.C5,{to:"/services",replace:!0});const s="https://turbo.net.au",a="/services/".concat(e),n={"@context":"https://schema.org","@type":"Service",name:t.name,description:t.hubMetaDescription,serviceType:t.schemaServiceType,aggregateRating:Fw._I,provider:(0,Fw.YQ)(s),areaServed:L.EW.map(e=>({"@type":"City",name:L.Ay[e].name,containedInPlace:{"@type":"State",name:L.Ay[e].stateFullName}})),offers:{"@type":"Offer",availability:"https://schema.org/InStock",priceRange:"$$"}},i={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"".concat(s,"/")},{"@type":"ListItem",position:2,name:"Services",item:"".concat(s,"/services")},{"@type":"ListItem",position:3,name:t.shortName}]};return(0,f.jsxs)(ae.mP,{className:"!pt-0",children:[(0,f.jsx)(R.A,{rawTitle:t.hubMetaTitle,de
1scription:t.hubMetaDescription,keywords:t.keywords.join(", "),canonical:a,ogImage:"".concat(s).concat(t.images.hero),structuredData:[n,i]}),(0,f.jsx)(D.A,{}),(0,f.jsx)("div",{className:"relative z-20 border-b border-[#222] bg-carbon-900/80 pt-[76px] backdrop-blur-sm",children:(0,f.jsx)("div",{className:"mx-auto max-w-7xl px-[22px] py-3 md:px-11",children:(0,f.jsx)(Nw.Qp,{children:(0,f.jsxs)(Nw.AB,{className:"font-mono text-xs uppercase tracking-[0.16em] text-fog",children:[(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/",className:"text-fog transition-colors hover:text-turbo-red",children:"Home"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#444]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/services",className:"text-fog transition-colors hover:text-turbo-red",children:"Services"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#444]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.tJ,{className:"text-smoke",children:t.shortName})})]})})})}),(0,f.jsxs)("section",{className:"relative flex min-h-[68vh] items-center overflow-hidden bg-carbon-900",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:'url("'.concat(t.images.hero,'")')},children:(0,f.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.78) 0%,rgba(13,13,13,.6) 40%,rgba(13,13,13,.82) 100%)"}})}),(0,f.jsx)("div",{className:"relative z-10 mx-auto w-full max-w-7xl px-[22px] py-24 md:px-11",children:(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)("div",{className:"mb-7 flex items-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsx)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:"Australia-Wide Coverage"})]}),(0,f.jsx)(Xw,{className:"m-0 font-display text-[clamp(40px,7vw,96px)] font-extrabold uppercase leading-[0.92] tracking-[-0.02em] text-smoke",lines:[{text:t.heroTitle,className:"block"},{text:t.heroTitleAccent,className:"block text-turbo-red"}]}),(0,f.jsx)("p",{className:"mt-7 max-w-3xl text-[clamp(16px,1.5vw,20px)] leading-[1.6] text-[#D9D6CF]",children:t.intro}),(0,f.jsx)("div",{className:"mt-9",children:(0,f.jsxs)(ae.$$,{to:"/get-quote",children:["GET YOUR QUOTE",(0,f.jsx)(S.A,{className:"h-5 w-5"})]})})]})})]}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-14",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / What We Offer"}),(0,f.jsx)("h2",{className:"m-0 font-display text-[clamp(38px,5.2vw,72px)] font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke",children:"Our Services"})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-3",children:t.features.map((e,t)=>{const s=eN[e.icon]||Ue.A;return(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"group h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-7 transition-colors duration-300 hover:border-turbo-red",children:[(0,f.jsx)("div",{className:"mb-5 flex h-12 w-12 items-center justify-center rounded-xl bg-turbo-red transition-transform duration-300 group-hover:scale-110",children:(0,f.jsx)(s,{className:"h-6 w-6 text-white"})}),(0,f.jsx)("h3",{className:"mb-3 font-head text-xl font-bold text-smoke transition-colors group-hover:text-turbo-red",children:e.title}),(0,f.jsx)("p",{className:"text-[15px] leading-relaxed text-[#9C9A95]",children:e.description})]})},t)})})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsx)("div",{className:"mx-auto max-w-7xl",children:(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-3 lg:grid-cols-4",children:[t.images.gallery.map((e,s)=>(0,f.jsx)(ae.gN,{delay:s%4*60,children:(0,f.jsxs)("div",{className:"group relative overflow-hidden rounded-[10px] border border-[#262626]",children:[(0,f.jsx)("img",{src:e,alt:"".concat(t.shortName," portfolio example ").concat(s+1," - Turbo 360"),className:"h-48 w-full object-cover transition-transform duration-700 ease-turbo group-hover:scale-[1.06]",loading:"lazy"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 55%,rgba(13,13,13,.7))"}})]})},s)),(0,f.jsx)(ae.gN,{delay:t.images.gallery.length%4*60,children:(0,f.jsxs)("div",{className:"group relative overflow-hidden rounded-[10px] border border-[#262626]",children:[(0,f.jsx)("img",{src:t.images.card,alt:"".concat(t.shortName," by Turbo 360"),className:"h-48 w-full object-cover transition-transform duration-700 ease-turbo group-hover:scale-[1.06]",loading:"lazy"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 55%,rgba(13,13,13,.7))"}})]})})]})})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"02 / All Locations"}),(0,f.jsxs)("h2",{className:"m-0 font-display text-[clamp(38px,5.2vw,72px)] font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke",children:[t.shortName.toUpperCase()," ",(0,f.jsx)("span",{className:"text-turbo-red",children:"LOCATIONS"})]}),(0,f.jsxs)("p",{className:"mt-6 text-[clamp(16px,1.5vw,20px)] leading-[1.6] text-[#9C9A95]",children:["Same-day ",t.shortName.toLowerCase()," across all major Australian cities."]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-4",children:L.EW.map(s=>{var a;const n=L.Ay[s];return(0,f.jsxs)(r.N_,{to:"/services/".concat(e,"/").concat(s),className:"group block h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors duration-300 hover:border-turbo-red",children:[(0,f.jsxs)("div",{className:"mb-3 flex items-center",children:[(0,f.jsx)(C.A,{className:"mr-2 h-5 w-5 text-turbo-red"}),(0,f.jsx)("h3",{className:"font-head text-xl font-bold text-smoke transition-colors group-hover:text-turbo-red",children:n.name})]}),(0,f.jsxs)("p",{className:"mb-3 font-mono text-[11px] uppercase tracking-[0.12em] text-[#8A8884]",children:[n.state," \u2014 ",n.heroSubtitle]}),(0,f.jsxs)("p",{className:"mb-4 text-sm text-[#9C9A95]",children:[n.venues.length," major venues \u2022 ",n.precincts.length," corporate precincts"]}),(0,f.jsxs)("div",{className:"mb-3 font-mono text-[11px] uppercase tracking-[0.12em] text-[#8A8884]",children:["Top venue: ",null===(a=n.venues[0])||void 0===a?void 0:a.name]}),(0,f.jsxs)("div",{className:"flex items-center text-sm font-semibold text-turbo-red",children:[(0,f.jsx)("span",{children:"conference-photography"===e?"Conference photographer ".concat(n.name):"".concat(t.shortName," in ").concat(n.name)}),(0,f.jsx)(S.A,{className:"ml-2 h-4 w-4 transition-transform group-hover:translate-x-1"})]})]},s)})})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"03 / Explore"}),(0,f.jsxs)("h2",{className:"m-0 font-display text-[clamp(32px,4.4vw,60px)] font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke",children:["Related ",(0,f.jsx)("span",{className:"text-turbo-red",children:"Services"})]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-4",children:Sw.filter(t=>t!==e).map(e=>{const t=_w(e);return(0,f.jsxs)(r.N_,{to:"/services/".concat(e),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-4 transition-colors duration-300 hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsx)("span",{className:"text-sm text-fog transition-colors group-hover:text-smoke",children:t.name})]},e)})})]})}),(0,f.jsx)(Tw.A,{faqs:kw(t)}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] bg-carbon px-[22px] py-[120px] text-center md:px-11",children:[(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 50% 0%,rgba(191,33,47,.22),transparent 60%)"}}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-4xl",children:[(0,f.jsx)("h2",{className:"m-0 font-display text-[clamp(40px,6vw,88px)] font-extrabold leading-[0.94] tracking-[-0.02em] text-smoke",children:"READY FOR TURBO SPEED?"}),(0,f.jsxs)("p",{className:"mx-auto mt-7 max-w-2xl text-[clamp(17px,1.6vw,20px)] leading-[1.6] text-[#C7C4BD]",children:["Get same-day ",t.shortName.toLowerCase()," anywhere in Australia."]}),(0,f.jsx)("div",{className:"mt-9 mb-8 flex flex-col justify-center gap-4 sm:flex-row",children:(0,f.jsxs)(ae.$$,{to:"/get-quote",children:["GET YOUR QUOTE NOW",(0,f.jsx)(F.A,{className:"ml-2 h-6 w-6"})]})}),(0,f.jsxs)("div",{className:"mx-auto grid max-w-3xl gap-8 text-left md:grid-cols-3",children:[(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("h4",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-turbo-red",children:"CALL NOW"}),(0,f.jsx)("p",{className:"text-smoke",children:"1300 207 446"})]}),(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("h4",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-turbo-red",children:"EMAIL"}),(0,f.jsx)("p",{className:"text-smoke",children:"[email protected]"})]}),(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("h4",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-turbo-red",children:"LOCATIONS"}),(0,f.jsx)("p",{className:"text-smoke",children:"All major Australian cities"})]})]})]})]}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})};var sN=s(51875);const aN={Camera:Ue.A,Target:tt.A,Building:Ke.A,User:Ye.A,Zap:F.A,Video:Ge.A},nN=()=>{const{citySlug:e}=(0,r.g)(),t=(0,L.KM)(e);if(!t)return(0,f.jsx)(r.C5,{to:"/services",replace:!0});const s="https://turbo.net.au",a="/services/locations/".concat(e),n=t.hubMetaTitle||"Event Photographer ".concat(t.name," | Turbo 360");let i=t.hubMetaDescription||"Event photographer in ".concat(t.name," \u2014 same-day photo & video. Conferences, corporate events, headsh
1ots & galas across ").concat(t.region,". 180+ 5\u2605 reviews.");!t.hubMetaDescription&&i.length>155&&(i="Event photographer in ".concat(t.name," \u2014 same-day photo & video for conferences, corporate events, headshots & galas. 180+ 5\u2605 reviews."));const o={primary:"block text-[clamp(40px,7vw,108px)]",secondary:"block text-[clamp(40px,7vw,108px)]",accent:"block text-[clamp(28px,4.4vw,64px)] text-turbo-red",tagline:"block mt-2 text-[clamp(28px,4.4vw,64px)] text-turbo-red"},l=[{text:"Event Photography",variant:"primary"},{text:"& Videography",variant:"secondary"},{text:"in ".concat(t.name),variant:"accent"}],c=(t.hubHeroLines||l).map(e=>({text:e.text,className:e.className||o[e.variant]||o.primary})),d=(0,m.A)((0,m.A)({"@context":"https://schema.org","@type":"ProfessionalService",name:"Turbo 360 ".concat(t.name),description:i,url:"".concat(s).concat(a),telephone:"+61-1300-207-446",email:"[email protected]"},(0,Fw.tp)(s)),{},{areaServed:{"@type":"City",name:t.name,containedInPlace:{"@type":"State",name:t.stateFullName}},hasOfferCatalog:{"@type":"OfferCatalog",name:"Event Photography Services in ".concat(t.name),itemListElement:Sw.map(t=>({"@type":"Offer",itemOffered:{"@type":"Service",name:Cw[t].name,url:"".concat(s,"/services/").concat(t,"/").concat(e)}}))}}),p={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"".concat(s,"/")},{"@type":"ListItem",position:2,name:"Services",item:"".concat(s,"/services")},{"@type":"ListItem",position:3,name:"Locations",item:"".concat(s,"/services")},{"@type":"ListItem",position:4,name:t.name}]};return(0,f.jsxs)(ae.mP,{className:"!pt-0",children:[(0,f.jsx)(R.A,{rawTitle:n,description:i,keywords:"event photography ".concat(t.name,", videography ").concat(t.name,", conference photographer ").concat(t.name,", corporate photographer ").concat(t.name,", ").concat(t.name," event coverage"),canonical:a,ogImage:"".concat(s,"/images/services/locations/event-coverage-plenary.jpg"),geo:{region:"AU-".concat(t.state),placename:t.name},structuredData:[d,p]}),(0,f.jsx)(D.A,{}),(0,f.jsx)("div",{className:"relative z-20 border-b border-[#222] bg-carbon-900/70 pt-[76px] backdrop-blur-sm",children:(0,f.jsx)("div",{className:"mx-auto max-w-7xl px-[22px] py-3.5 md:px-11",children:(0,f.jsxs)("nav",{"aria-label":"Breadcrumb",className:"flex flex-wrap items-center gap-2 font-mono text-[11px] uppercase tracking-[0.16em] text-fog",children:[(0,f.jsx)(r.N_,{to:"/",className:"transition-colors hover:text-turbo-red",children:"Home"}),(0,f.jsx)("span",{className:"text-[#444]",children:"/"}),(0,f.jsx)(r.N_,{to:"/services",className:"transition-colors hover:text-turbo-red",children:"Services"}),(0,f.jsx)("span",{className:"text-[#444]",children:"/"}),(0,f.jsx)("span",{className:"text-smoke",children:t.name})]})})}),(0,f.jsxs)("section",{className:"relative flex min-h-[72vh] items-end overflow-hidden bg-carbon-900",children:[(0,f.jsx)("div",{className:"absolute inset-0 z-0 bg-cover bg-center",style:{backgroundImage:'url("/images/services/locations/event-coverage-plenary.jpg")'}}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0 z-[1]",style:{background:"linear-gradient(180deg,rgba(13,13,13,.72) 0%,rgba(13,13,13,.5) 36%,rgba(13,13,13,.78) 70%,#0d0d0d 100%)"}}),(0,f.jsx)("div",{className:"relative z-10 mx-auto w-full max-w-7xl px-[22px] pb-16 pt-28 md:px-11 md:pb-24",children:(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)("div",{className:"mb-7 flex items-center gap-3",children:[(0,f.jsx)(C.A,{className:"h-4 w-4 text-turbo-red"}),(0,f.jsxs)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:[t.name,", ",t.state," \u2014 ",t.heroSubtitle]})]}),(0,f.jsx)(Xw,{className:"m-0 font-display font-extrabold uppercase leading-[0.92] tracking-[-0.025em] text-smoke",lines:c}),(0,f.jsx)("p",{className:"mt-8 max-w-[640px] text-[clamp(16px,1.5vw,20px)] leading-[1.6] text-[#D9D6CF]",children:t.intro}),(0,f.jsx)("div",{className:"mt-9",children:(0,f.jsxs)(ae.$$,{to:"/get-quote",children:["GET YOUR QUOTE ",(0,f.jsx)(S.A,{className:"h-5 w-5"})]})})]})})]}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / Services"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Photography & video",(0,f.jsx)("br",{}),"services."]}),(0,f.jsxs)("p",{className:"mt-6 text-[17px] leading-[1.6] text-[#9C9A95]",children:["in ",t.name,", ",t.stateFullName]}),(0,f.jsxs)("p",{className:"mt-4 max-w-3xl text-[17px] leading-[1.6] text-[#C7C4BD]",children:["Need a specialist for a multi-day program? Book a"," ",(0,f.jsxs)(r.N_,{to:"/services/conference-photography/".concat(e),className:"font-semibold text-turbo-red hover:underline",children:["conference photographer ",t.name]})," ","for keynotes, panels and networking, or choose another service below."]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-3",children:Sw.map((s,a)=>{var n;const i=Cw[s],o=aN[i.icon]||Ue.A;return(0,f.jsx)(ae.gN,{delay:a%3*80,children:(0,f.jsxs)(r.N_,{to:"/services/".concat(s,"/").concat(e),className:"group block h-full overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] transition-colors duration-300 hover:border-turbo-red",children:[(null===(n=i.images)||void 0===n?void 0:n.card)&&(0,f.jsxs)("div",{className:"relative h-44 overflow-hidden",children:[(0,f.jsx)("img",{src:i.images.card,alt:"".concat(i.short
1Name," in ").concat(t.name),className:"absolute inset-0 h-full w-full object-cover transition-transform duration-700 ease-turbo group-hover:scale-[1.06]",loading:"lazy"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 40%,rgba(13,13,13,.9))"}})]}),(0,f.jsxs)("div",{className:"p-[26px]",children:[(0,f.jsx)("div",{className:"mb-5 flex h-12 w-12 items-center justify-center rounded-xl bg-turbo-red transition-transform duration-300 group-hover:scale-110",children:(0,f.jsx)(o,{className:"h-6 w-6 text-white"})}),(0,f.jsx)("h3",{className:"mb-3 font-head text-[21px] font-bold text-white transition-colors group-hover:text-turbo-red",children:i.name}),(0,f.jsxs)("p",{className:"mb-5 text-sm leading-relaxed text-[#9C9A95]",children:[i.intro.substring(0,150),"..."]}),(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-[0.16em] text-[#8A8884]",children:"Learn more"}),(0,f.jsx)(La.A,{size:18,className:"text-smoke transition-transform duration-[400ms] ease-turbo group-hover:-translate-y-1 group-hover:translate-x-1 group-hover:text-turbo-red"})]})]})]})},s)})}),"melbourne"===e&&(0,f.jsxs)("div",{className:"mt-8 flex flex-wrap gap-3",children:[(0,f.jsxs)(r.N_,{to:"/video-production-melbourne",className:"inline-flex items-center gap-2 rounded-lg border border-turbo-red/40 bg-turbo-red/10 px-4 py-3 font-head text-sm font-bold text-white hover:border-turbo-red",children:["Video production Melbourne ",(0,f.jsx)(S.A,{className:"h-4 w-4 text-turbo-red"})]}),(0,f.jsxs)(r.N_,{to:"/corporate-video-melbourne",className:"inline-flex items-center gap-2 rounded-lg border border-turbo-red/40 bg-turbo-red/10 px-4 py-3 font-head text-sm font-bold text-white hover:border-turbo-red",children:["Corporate video Melbourne ",(0,f.jsx)(S.A,{className:"h-4 w-4 text-turbo-red"})]})]})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-14 max-w-3xl",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"02 / Venues"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["Premier",(0,f.jsx)("br",{}),"venues."]}),(0,f.jsxs)("p",{className:"mt-6 text-[17px] leading-[1.6] text-[#9C9A95]",children:[t.name," venues"]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-3",children:t.venues.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsx)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors duration-300 hover:border-turbo-red",children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)(C.A,{className:"mt-1 h-5 w-5 flex-shrink-0 text-turbo-red"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"font-head text-base font-bold text-white",children:e.fullName||e.name}),(0,f.jsx)("p",{className:"mb-1.5 mt-1 font-mono text-[11px] uppercase tracking-[0.16em] text-turbo-red",children:e.suburb}),(0,f.jsxs)("p",{className:"text-sm leading-relaxed text-[#9C9A95]",children:[e.description.substring(0,100),"..."]}),e.href&&(0,f.jsxs)(r.N_,{to:e.href,className:"mt-2.5 flex items-center font-head text-sm font-semibold text-turbo-red hover:underline",children:["Photography & video at ",e.name," ",(0,f.jsx)(S.A,{className:"ml-1.5 h-4 w-4"})]})]})]})})},t))})]})}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsx)("div",{className:"mx-auto max-w-7xl",children:(0,f.jsxs)("div",{className:"grid grid-cols-1 gap-12 md:grid-cols-2 md:gap-16",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"03 / Precincts"}),(0,f.jsxs)(ae.nl,{className:"mb-9 text-[clamp(30px,4vw,52px)]",children:["Corporate",(0,f.jsx)("br",{}),"precincts."]}),(0,f.jsx)("div",{className:"space-y-5",children:t.precincts.map((e,t)=>(0,f.jsxs)("div",{className:"border-l-2 border-turbo-red pl-5",children:[(0,f.jsx)("h3",{className:"font-head text-base font-bold text-white",children:e.name}),(0,f.jsx)("p",{className:"mt-1.5 text-sm leading-relaxed text-[#9C9A95]",children:e.description})]},t))})]}),(0,f.jsxs)(ae.gN,{delay:80,children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"04 / Events"}),(0,f.jsxs)(ae.nl,{className:"mb-9 text-[clamp(30px,4vw,52px)]",children:["Annual",(0,f.jsx)("br",{}),"events."]}),(0,f.jsx)("div",{className:"space-y-5",children:t.annualEvents.map((e,t)=>(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("span",{className:"mt-1 whitespace-nowrap rounded border border-turbo-red/40 bg-turbo-red/10 px-2.5 py-1 font-mono text-[10px] uppercase tracking-[0.14em] text-turbo-red",children:e.when}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"font-head text-base font-bold text-white",children:e.name}),(0,f.jsx)("p",{className:"mt-1.5 text-sm leading-relaxed text-[#9C9A95]",children:e.description})]})]},t))})]})]})})}),(0,f.jsx)(sN.A,{citySlug:e,heading:"Recent work in ".concat(t.name)}),(0,f.jsx)("section",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-20 md:px-11 md:py-[120px]",children:(0,f.jsxs)("div",{className:"mx-auto max-w-7xl",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"05 / Coverage"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(30px,4vw,52px)]",children:["Other",(0,f.jsx)("br",{}),"locations."]})]}),(0,f.jsx)(ae.gN,{className:"flex flex-wrap gap-2.5",children:L.EW.filter(t=>t!==e).map(e=>{const t=(0,L.KM)(e);return(0,f.jsxs)(r.N_,{to:"/services/locations/".concat(e),className:"inline-flex items-center gap-1.5 rounded-full border border-[#2B2B2B] px-5 py-[11px] font-mono text-[13px] uppercase tracking-[0.08em] text-fog transition-colors hover:border-turbo-red hover:text-turbo-red",children:[(0,f.jsx)(C.A,{className:"h-3 w-3 text-turbo-red"}),t.name]},e)})})]})}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] bg-carbon px-[22px] py-[130px] text-center md:px-11",children:[(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(circle at 50% 0%,rgba(191,33,47,.22),transparent 60%)"}}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-[900px]",children:[(0,f.jsx)(ae.YZ,{className:"mb-5",children:"06 / Ready"}),(0,f.jsxs)(ae.nl,{className:"mb-7 text-[clamp(42px,6.4vw,96px)] leading-[0.94] tracking-[-0.025em]",children:["Ready for",(0,f.jsx)("br",{}),(0,f.jsx)("span",{className:"text-turbo-red",children:"turbo speed?"})]}),(0,f.jsxs)("p",{className:"mx-auto mb-10 max-w-[560px] text-[clamp(17px,1.6vw,20px)] leading-[1.6] text-[#C7C4BD]",children:["Get same-day event photography and videography in ",t.name,"."]}),(0,f.jsxs)(ae.$$,{to:"/get-quote",children:["GET YOUR QUOTE NOW ",(0,f.jsx)(F.A,{className:"h-5 w-5"})]}),(0,f.jsxs)("div",{className:"mt-10 grid grid-cols-1 gap-8 text-left sm:grid-cols-3",children:[(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("h4",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.16em] text-turbo-red",children:"CALL NOW"}),(0,f.jsx)("p",{className:"text-[#C7C4BD]",children:"1300 207 446"})]}),(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("h4",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.16em] text-turbo-red",children:"EMAIL"}),(0,f.jsx)("p",{className:"text-[#C7C4BD]",children:"[email protected]"})]}),(0,f.jsxs)("div",{className:"border-t border-[#262626] pt-5",children:[(0,f.jsx)("h4",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.16em] text-turbo-red",children:"LOCATIONS"}),(0,f.jsx)("p",{className:"text-[#C7C4BD]",children:"Australia-wide coverage"})]})]})]})]}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})},rN={executive:{n:"02",title:"Executive portraits",body:"Premium sessions for C-suite and leadership teams. Multiple setups, wardrobe changes, and environmental portraits using your building's own light and architecture."},linkedin:{n:"03",title:"LinkedIn & professional profiles",body:"Modern headshots optimised for LinkedIn, company websites, and professional directories. Consistent look across your entire team."},retouching:{n:"04",title:"Same-day retouching",body:"Skin retouching, colour correction and background cleanup handled on site while the session runs. Files land before your team leaves the building."}
1,cutouts:{n:"06",title:"Transparent cut-outs",body:"Every portrait also arrives as a transparent cut-out \u2014 any background, any format, whenever your brand changes."}},iN=(e,t)=>[{n:"01",title:"On-location team sessions",body:e},rN.executive,rN.linkedin,rN.retouching,{n:"05",title:"Conference add-on booths",body:t},rN.cutouts],oN=e=>({name:"Your own office",suburb:"CBD \xb7 Suburban",body:e}),lN=e=>"Professional corporate headshots and business portraits for teams of any size. We come to your ".concat(e," office with portable studio lighting and backdrops, photographing entire teams efficiently with minimal disruption. Retouched images delivered same-day."),cN=e=>"Get same-day corporate headshots in ".concat(e," that keep your team's momentum alive."),dN={sydney:{heroIntro:lN("Sydney"),wallLine1:"One Sydney floor.",wallMeta:"CBD tower session",stat4Value:"15 min",stat4Label:"Airport to most venues",prose1:"Almost every premium Sydney venue trades on harbour, bridge or Opera House views, and that shapes portrait work more than people expect. Bright water bounce and constant indoor-outdoor mixing mean an uncontrolled booth drifts in colour across a day \u2014 so we light for consistency first and use the view as an option, not a default.",prose2:"The upside is location. Barangaroo, Martin Place and Circular Quay floors sit minutes apart on the Metro, so a leadership session in the CBD and a delegate booth at ICC Darling Harbour can run on the same crew call. Parking is the expensive part of Sydney logistics, not the photography \u2014 we load in by trolley and let the light rail do the rest.",precincts:[{name:"Sydney CBD & Martin Place",body:"Banking, legal and professional services headquarters. Deep-plate tower floors give neutral, repeatable interiors \u2014 our most-booked headshot postcode in the country.",tags:["Finance","Legal","Professional"]},{name:"Barangaroo",body:"New-build waterfront towers with generous foyers and high ceilings. Easiest precinct in Sydney for moving 200+ staff through a booth in one day.",tags:["Banking","Tech","Consulting"]},{name:"Darling Harbour & Pyrmont",body:"ICC Sydney, The Star and the surrounding media and tech offices. Conference headshot booths here run off the delegate flow between plenaries.",tags:["Events","Media","Tech"]}],logistics:[{title:"Transport & access",body:"Sydney Airport is only 8km from the CBD (15 minutes to most venues). Light Rail connects Central to ICC Sydney and Pyrmont, and the new Metro links Barangaroo, Martin Place and North Sydney. Parking is expensive ($40\u201380/day in the CBD), so we plan load-in around building docks rather than street parking."},{title:"Peak season",body:"February\u2013May and September\u2013November are Sydney's dense corporate windows, and Vivid and the spring conference run tighten crew availability. Lock a headshot day six weeks out if it sits either side of an event."},{title:"What we need on site",body:"Three metres by three metres and a power point. Tower load-in runs through the dock with a booking and induction \u2014 send us the requirements and we'll handle the paperwork."}],venues:[{name:"International Convention Centre Sydney",suburb:"Darling Harbour",body:"200+ delegates through a booth in a day near registration, retouched and delivered with the main gallery."},{name:"The Star",suburb:"Pyrmont",body:"Ballroom corners and foyer spaces convert into a lit booth without disrupting the catering flow."},{name:"Crown Sydney",suburb:"Barangaroo",body:"Executive events with skyline glass behind \u2014 our pick when a client wants environmental portraits rather than a plain backdrop."},{name:"Carriageworks",suburb:"Eveleigh",body:"Raw brick and industrial volume for brands that don't want a corporate grey background."},oN("Most Sydney headshot days happen in a meeting room. Three by three metres, one power point, and we're shooting twenty minutes after arrival.")],faqs:[{q:"How quickly do you deliver corporate headshots in Sydney?",a:"Same day \u2014 usually within hours of the last person sitting down. Retouching happens on site while the session runs, so a CBD morning session is in your inbox by knock-off."}
1,{q:"How much do corporate headshots cost in Sydney?",a:"Priced per head with volume rates, based on session length and crew size. Most Sydney bookings start from a half-day rate \u2014 request a quote for an exact figure."},{q:"Do you cover Greater Sydney and the surrounds?",a:"Yes \u2014 the CBD, Barangaroo, North Sydney, Parramatta and the business parks, plus the Central Coast and Wollongong. Our crews are Sydney-based and know the tower docks."},{q:"Can you run a headshot booth during our conference?",a:"It's one of our most-booked Sydney add-ons. We set a lit booth on the delegate flow at ICC Sydney, The Star or a hotel foyer and photograph 50\u201380 people an hour across the breaks."}],features:iN("We set up a portable studio in your Martin Place tower, Barangaroo floor or North Sydney office. Teams of 10 to 300+ photographed with minimal downtime.","Running a program at ICC Sydney, The Star or a CBD hotel? We build a lit booth on the delegate flow and photograph 50\u201380 people an hour between sessions."),venuesIntro:"We photograph corporate headshots in your own office and at Sydney's premier event venues.",ctaLine:cN("Sydney"),otherCities:["melbourne","brisbane","canberra"]},melbourne:{heroIntro:lN("Melbourne"),wallLine1:"One Southbank office.",wallMeta:"Melbourne CBD session",stat4Value:"30 min",stat4Label:"SkyBus to Southern Cross",prose1:"Melbourne's Southbank conference precinct is uniquely walkable \u2014 MCEC, Crown, NGV, Arts Centre Melbourne and Cargo Hall sit within a few hundred metres of each other along the Yarra. For headshots that matters more than it sounds: we can photograph your leadership team in a Collins Street boardroom in the morning and set a delegate booth at MCEC the same afternoon without a second crew call.",prose2:"The city's tower stock also gives us something Sydney's harbour glass doesn't: consistent, controllable interiors. Collins Street's \"Paris End\" floors have deep plate windows and neutral finishes, so a portable studio reads the same on level 4 as it does on level 40 \u2014 which is what keeps a 300-person staff directory looking like one shoot instead of six.",precincts:[{name:"Melbourne CBD",body:"Australia's largest CBD office market. Collins Street's \"Paris End\" is the premium corporate address, home to BHP, ANZ and NAB headquarters \u2014 and our most-booked headshot postcode.",tags:["Finance","Legal","Resources"]},{name:"Southbank / South Wharf",body:"Melbourne's conference and arts precinct on the Yarra, home to MCEC, Crown, NGV and Arts Centre Melbourne \u2014 all within walking distance of each other.",tags:["Events","Arts","Hospitality"]},{name:"Docklands",body:"Waterfront commercial precinct inside the Free Tram Zone. Big floorplates and open atriums make it the easiest part of town to move 200+ people through a booth in a day.",tags:["Banking","Tech","Media"]}],logistics:[{title:"Transport & access",body:"Melbourne has the world's largest tram network with a Free Tram Zone covering the CBD and Docklands. SkyBus runs 24/7 from Tullamarine to Southern Cross in 30 minutes. MCEC, Crown, Cargo Hall and NGV are all walkable along the Yarra \u2014 so a multi-site headshot day needs one crew, not two."},{title:"Peak season",body:"March\u2013May and September\u2013November are Melbourne's dense corporate windows, and the Spring Racing and PAX Australia weeks tighten crew availability further. Headshot days either side of a conference should be locked in six weeks out."},{title:"What we need on site",body:"Three metres by three metres and a power point \u2014 a meeting room, foyer corner or pre-function space. CBD tower load-in runs through the building dock; give us your dock window and induction requirements and we'll work to them."}],venues:[{name:"Melbourne Convention & Exhibition Centre",suburb:"South Wharf",body:"The foyer's floor-to-ceiling glass gives soft daylight for a delegate booth on the break-time flow. Fifty to eighty headshots an hour is realistic here."},{name:"Crown Melbourne",suburb:"Southbank",body:"Palladium programs run long. River-facing space
1s around the complex give clean executive backdrops between sessions, with three hotels on site for early crew calls."},{name:"Marvel Stadium",suburb:"Docklands",body:"Function rooms and concourses convert easily into a lit booth, and the Free Tram Zone gets staff there from the CBD in minutes."},{name:"Cargo Hall & South Wharf",suburb:"South Wharf",body:"Heritage brick and warehouse volume \u2014 our pick when a client wants environmental portraits rather than a plain backdrop."},{name:"Flemington Racecourse",suburb:"Flemington",body:"Home of the Melbourne Cup, with skyline views and premium hospitality spaces that suit board portraits alongside event coverage."},oN("Most Melbourne headshot days happen in a meeting room. Three by three metres, one power point, and we are shooting inside twenty minutes of arrival.")],faqs:[{q:"How quickly do you deliver corporate headshots in Melbourne?",a:"Same day \u2014 usually within hours of the last person sitting down. Retouching happens on site while the session runs, so a CBD morning session is in your inbox by knock-off."},{q:"How much do corporate headshots cost in Melbourne?",a:"Priced per head with volume rates, based on session length and crew size. Most Melbourne bookings start from a half-day rate \u2014 request a quote for an exact figure."},{q:"Do you cover Melbourne and regional Victoria?",a:"Yes \u2014 the CBD, Southbank, Docklands and suburban business parks, plus Geelong and regional Victoria. Our crews are Melbourne-based and already know the tower docks and venue load-ins."},{q:"Can you run a headshot booth during our conference?",a:"That's one of our most-booked Melbourne add-ons. We set a lit booth on the delegate flow at MCEC, Crown or Cargo Hall and photograph 50\u201380 people an hour across the breaks."}],features:iN("We set up a portable studio in your Collins Street tower, Docklands floor or Southbank meeting room. Teams of 10 to 300+ photographed with minimal downtime.","Running a program at MCEC, Crown or Cargo Hall? We build a lit booth on the delegate flow and photograph 50\u201380 people an hour between sessions."),venuesIntro:"We photograph corporate headshots in your own office and at Melbourne's premier event venues.",ctaLine:cN("Melbourne"),otherCities:["sydney","brisbane","geelong"]},brisbane:{heroIntro:lN("Brisbane"),wallLine1:"One Brisbane floor.",wallMeta:"CBD & South Bank session",stat4Value:"20 min",stat4Label:"Airtrain to the CBD",prose1:"The 2032 Olympics are rebuilding Brisbane's event infrastru
1cture with $7.1 billion in new venues, and the corporate side is moving with it \u2014 Queen's Wharf opened in 2024 with two more luxury hotels landing by the end of 2026. Practically, that means a growing number of brand-new floors and foyers with excellent ambient light, and a lot of teams refreshing their staff imagery to match a new address.",prose2:"Brisbane's subtropical light is the technical difference. Hard overhead sun most of the year and warm reflected bounce off river-facing glass will shift skin tones if a booth is left to ambient \u2014 so we run controlled lighting and reserve the outdoor river frames for the leadership set, where the look is deliberate rather than accidental.",precincts:[{name:"Brisbane CBD & Queen's Wharf",body:"The traditional professional-services core, now anchored by the Star Brisbane precinct. New towers mean big lobbies and easy booth placement.",tags:["Finance","Legal","Government"]},{name:"South Bank",body:"BCEC and the cultural precinct, walkable from South Brisbane Station. Where most Brisbane conference headshot booths run.",tags:["Events","Education","Arts"]},{name:"Fortitude Valley & Newstead",body:"Tech, creative and mining-services offices in converted warehouse floorplates \u2014 better for environmental portraits than plain backdrops.",tags:["Tech","Creative","Resources"]}],logistics:[{title:"Transport & access",body:"Airtrain runs every 15 minutes from Brisbane Airport to the CBD in 20 minutes. South Brisbane Station is the direct stop for BCEC and South Bank, and the free CityHopper ferry covers inner-city river stops \u2014 useful when a headshot day spans two offices across the river."},{title:"Peak season",body:"March\u2013May and August\u2013October are the busiest corporate windows, with Ekka week and the winter conference season tightening availability. Olympic-driven construction also affects CBD dock access \u2014 worth checking early."},{title:"What we need on site",body:"Three metres by three metres and a power point. In older CBD buildings the dock is tight, so we bring compact kit and can hand-carry if the goods lift is booked out."}],venues:[{name:"Brisbane Convention & Exhibition Centre",suburb:"South Bank",body:"Four exhibition halls and generous pre-function space. A booth near registration handles 100+ delegates over the breaks."},{name:"Royal International Convention Centre",suburb:"Bowen Hills",body:"Purpose-built exhibition floors with easy load-in and free parking \u2014 the simplest Brisbane venue for a high-volume headshot day."},{name:"The Star Brisbane Event Centre",suburb:"Brisbane CBD",body:"New Queen's Wharf spaces with contemporary finishes that photograph cleanly behind an executive portrait."},{name:"Howard Smith Wharves",suburb:"Petrie Bight",body:"Story Bridge and cliff face behind \u2014 the Brisbane frame clients actually ask for by name."},oN("Most Brisbane headshot days happen in a meeting room. Three by three metres, one power point, and we're shooting twenty minutes after arrival.")],faqs:[{q:"How quickly do you deliver corporate headshots in Brisbane?",a:"Same day \u2014 usually within hours of the last person sitting down. Retouching runs on site during the session, so a morning booking is delivered the same afternoon."},{q:"How much do corporate headshots cost in Brisbane?",a:"Priced per head with volume rates, based on session length and crew size. Most Brisbane bookings start from a half-day rate \u2014 request a quote for an exact figure."},{q:"Do you cover South East Queensland?",a:"Yes \u2014 the Brisbane CBD, South Bank, Fortitude Valley and the northside and southside business parks, plus the Gold Coast and Sunshine Coast."},{q:"Can you run a headshot booth during our conference?",a:"Yes. BCEC's pre-function areas and the Royal ICC floors both take a lit booth comfortably, and we photograph 50\u201380 delegates an hour between sessions."}],features:iN("We set up a portable studio in your CBD tower, South Bank office or Fortitude Valley warehouse floor. Teams of 10 to 300+ photographed with minimal downtime.","Running a program at BCEC, the Royal ICC or The Star Brisbane? We build a lit booth on the delegate flow and photograph 50\u201380 peo
1ple an hour between sessions."),venuesIntro:"We photograph corporate headshots in your own office and at Brisbane's premier event venues.",ctaLine:cN("Brisbane"),otherCities:["sydney","melbourne","perth"]},perth:{heroIntro:lN("Perth"),wallLine1:"One Perth floor.",wallMeta:"St Georges Terrace session",stat4Value:"18 min",stat4Label:"Airport Line to the CBD",prose1:"Perth runs on GMT+8 \u2014 the same timezone as roughly 60% of the world's population \u2014 which makes it a natural host for Asia-Pacific business events and gives its corporate imagery an international audience. Resources and energy cycles drive the spend, so headshot briefs here skew heavily towards technical leadership, project teams and the investor-facing set.",prose2:"FIFO rosters are the scheduling reality no other Australian city has. Half a Perth workforce may be on site rather than in the office in any given week, so we build headshot days around swing changeovers and run a second short session for the rotation that missed the first \u2014 same lighting, same crop, so the directory still matches.",precincts:[{name:"Perth CBD & St Georges Terrace",body:"The resources and finance core. Tower floors here are our highest-volume Perth headshot bookings, often tied to annual reports.",tags:["Resources","Energy","Finance"]},{name:"West Perth",body:"Junior miners, engineering consultancies and professional services in low-rise floorplates \u2014 small teams, frequent refreshes.",tags:["Mining","Engineering","Legal"]},{name:"Burswood & Elizabeth Quay",body:"Event and hospitality precincts, with Optus Stadium and Crown Perth handling the larger conference programs.",tags:["Events","Hospitality","Sport"]}],logistics:[{title:"Transport & access",body:"Perth Airport is unusually close to the CBD (12km, 15\u201320 minutes by car) and the Airport Line reaches the city in 18 minutes. A ferry runs from Elizabeth Quay to South Perth, and a purpose-built station serves Optus Stadium \u2014 multi-site days are genuinely easy here."},{title:"Peak season & rosters",body:"March\u2013May and September\u2013November are the busiest windows, and FIFO swing changeovers dictate everything else. Tell us your roster pattern and we'll schedule the booth so the fewest people miss out."},{title:"What we need on site",body:"Three metres by three metres and a power point. West Perth buildings often have no dock \u2014 we carry compact kit up in the passenger lift where that's the case."}],venues:[{name:"Perth Convention and Exhibition Centre",suburb:"Perth CBD",body:"River-facing foyers with good ambient light and a straightforward booth position on the delegate flow."},{name:"Crown Perth",suburb:"Burswood",body:"Ballroom and conference floors with hotels on site \u2014 the easiest Perth venue for a multi-day program with a headshot booth running through it."},{name:"Optus Stadium",suburb:"Burswood",body:"Function rooms and premium spaces with the field behind \u2014 a distinctly Perth frame for leadership portraits."},{name:"Claremont Showground",suburb:"Claremont",body:"Large exhibition pavilions with easy load-in, serviced by the Fremantle Line for high-volume staff days."},oN("Most Perth headshot days happen in a meeting room. Three by three metres, one power point, and we're shooting twenty minutes after arrival.")],faqs:[{q:"How quickly do you deliver corporate headshots in Perth?",a:"Same day \u2014 retouching runs on site while the session is still going, so files land before your team leaves the building. Time-zone difference means east-coast head offices see them next morning."},{q:"How much do corporate headshots cost in Perth?",a:"Priced per head with volume rates, based on session length and crew size. Most Perth bookings start from a half-day rate \u2014 request a quote for an exact figure."},{q:"Can you photograph FIFO staff on a roster?",a:"Yes. We schedule around swing changeovers and run a matched second session for the rotation that was on site, so the whole directory stays consistent."},{q:"Do you cover site work outside Perth?",a:"Yes \u2014 Pilbara and Goldfields site visits are quoted with travel and inductions included, and we shoot to the same lighting standard as a CBD session."}],features:iN("We set up a portable studio in your St Georges Terrace tower or West Perth floor. Teams of 10 to 300+ photographed with minimal downtime, scheduled around FIFO rosters.","Running a program at PCEC, Crown Perth or Optus Stadium? We build a lit booth on the delegate flow and photograph 50\u201380 peo
1ple an hour between sessions."),venuesIntro:"We photograph corporate headshots in your own office, on site, and at Perth's premier event venues.",ctaLine:cN("Perth"),otherCities:["adelaide","melbourne","darwin"]},adelaide:{heroIntro:lN("Adelaide"),wallLine1:"One Adelaide office.",wallMeta:"Riverbank precinct session",stat4Value:"15 min",stat4Label:"Airport to the CBD",prose1:"Adelaide's secret weapon is proximity: Barossa Valley, McLaren Vale, the Adelaide Hills and Clare Valley are all within an hour, and corporate programs routinely pair a city conference with a vineyard dinner. Headshot days follow the same pattern \u2014 a CBD session in the morning, environmental portraits at the offsite venue that afternoon, one crew across both.",prose2:"The Lot Fourteen precinct has changed the client mix. With the Australian Space Agency and a wave of defence and tech firms in the same few blocks, we now shoot as many engineering and research teams as we do finance \u2014 and those briefs want workspace context in frame, not just a grey backdrop.",precincts:[{name:"Adelaide CBD & Riverbank",body:"The professional-services core alongside the Adelaide Convention Centre. Compact and walkable \u2014 a two-office headshot day is a ten-minute move.",tags:["Finance","Legal","Government"]},{name:"Lot Fourteen",body:"Innovation precinct home to the Australian Space Agency and defence and tech firms. Modern fit-outs that suit environmental portraits.",tags:["Space","Defence","Tech"]},{name:"North Adelaide & Wayville",body:"Health, education and showground-adjacent business, with large pavilion venues for high-volume staff days.",tags:["Health","Education","Events"]}],logistics:[{title:"Transport & access",body:"Adelaide Airport is only 7km from the CBD (15 minutes). Metro trams run from the city to Glenelg, the Wayville Showground is tram-serviced, and the free City Connector bus loops the CBD \u2014 the most walkable capital for a multi-site headshot day."},{title:"Peak season",body:"February\u2013March is festival season and the city fills; October\u2013November is the corporate peak. Vineyard offsites book out earliest, so pair-day bookings should be locked in well ahead."},{title:"What we need on site",body:"Three metres by three metres and a power point. Heritage CBD buildings can have tight lifts \u2014 tell us the floor and we'll bring the compact rig."}],venues:[{name:"Adelaide Convention Centre",suburb:"Adelaide CBD (Riverbank)",body:"Riverbank foyers with panoramic glass \u2014 soft directional daylight that suits a delegate booth without heavy lighting."},{name:"National Wine Centre of Australia",suburb:"Adelaide CBD",body:"Timber and glass interiors that photograph warmly, popular for executive portraits alongside a client event."},{name:"Adelaide Showground",suburb:"Wayville",body:"Large pavilions with simple load-in, ideal when several hundred staff need photographing in one day."},{name:"Barossa & McLaren Vale estates",suburb:"Regional SA",body:"Vineyard backdrops for leadership portraits when the offsite is doing double duty as an employer-brand shoot."},oN("Most Adelaide headshot days happen in a meeting room. Three by three metres, one power point, and we're shooting twenty minutes after arrival.")],faqs:[{q:"How quickly do you deliver corporate headshots in Adelaide?",a:"Same day \u2014 usually within hours of the last person sitting down, with retouching handled on site while the session runs."},{q:"How much do corporate headshots cost in Adelaide?",a:"Priced per head with volume rates, based on session length and crew size. Most Adelaide bookings start from a half-day rate \u2014 request a quote for an exact figure."},{q:"Can you shoot headshots at a wine region offsite?",a:"Yes, and it's a common Adelaide brief. We run the formal set indoors for consistency, then a vineyard environmental round for the leadership team."},{q:"Do you cover regional South Australia?",a:"Yes \u2014 the Barossa, McLaren Vale, Adelaide Hills and Clare Valley are all within an hour, and regional site visits are quoted with travel included."}],features:iN("We set up a portable studio in your CBD office, Lot Fourteen fit-out or North Adelaide suite. Teams of 10 to 300+ photographed with minimal downtime.","Running a program at the Adelaide Convention Centre or the Showgroun
1d? We build a lit booth on the delegate flow and photograph 50\u201380 people an hour between sessions."),venuesIntro:"We photograph corporate headshots in your own office, at Adelaide's event venues, and at wine-region offsites.",ctaLine:cN("Adelaide"),otherCities:["melbourne","perth","sydney"]},canberra:{heroIntro:lN("Canberra"),wallLine1:"One Canberra agency.",wallMeta:"Parliamentary Triangle session",stat4Value:"10 min",stat4Label:"Airport to the CBD",prose1:"Canberra's calendar is set by the parliamentary sitting weeks. When Parliament sits the city fills with launches, receptions and media, and executive diaries close entirely \u2014 so headshot days land best in non-sitting weeks, which is the opposite of how every other capital schedules.",prose2:"The client mix is unlike anywhere else too: departments, agencies, peak bodies and national institutions. That brings requirements most corporates don't have \u2014 security-cleared venues, approval chains on imagery, and directory standards that specify crop and background. We shoot to a documented spec and deliver files named to your asset-management convention.",precincts:[{name:"Parliamentary Triangle",body:"Departments, agencies and national institutions within walking distance of each other. Access is the planning work here, not the photography.",tags:["Government","Policy","Cultural"]},{name:"Canberra CBD & Civic",body:"Peak bodies, consultancies and professional services. Standard commercial floors, straightforward booth placement.",tags:["Consulting","Legal","Associations"]},{name:"NewActon & Barton",body:"Boutique offices, hotels and arts spaces with distinctive architecture \u2014 the pick for environmental executive portraits.",tags:["Defence","Hospitality","Arts"]}],logistics:[{title:"Transport & access",body:"Canberra Airport is only 8km from the CBD (10 minutes by car), Light Rail runs from Gungahlin through the city centre, and most Parliamentary Triangle institutions are walkable or a short drive apart \u2014 a two-agency headshot day is comfortable."},{title:"Sitting weeks",body:"Book around the parliamentary calendar. Non-sitting weeks give you full attendance and calmer venues; sitting weeks are for event coverage, not staff directories."},{title:"Security & approvals",body:"Government sites often need passes, escorted access and pre-approved kit lists. Send the requirements with the brief and we'll complete them ahead of the day."}],venues:[{name:"National Convention Centre Canberra",suburb:"Canberra CBD",body:"Central and walkable, with pre-function areas that take a lit booth on the delegate flow."},{name:"Parliament House",suburb:"Capital Hill",body:"Marble, timber and controlled access. Portraits here are planned to the minute and shot with minimal kit."},{name:"Museum of Australian Democracy",suburb:"Parkes",body:"Heritage interiors that give a distinctly Canberra frame for leadership and board portraits."},{name:"Hotel Realm & NewActon",suburb:"Barton / NewActon",body:"Contemporary rooms and foyers, convenient for association conferences with a headshot add-on."},oN("Most Canberra headshot days happen in a departmental meeting room. Three by three metres, one power point, and we work to your access window.")],faqs:[{q:"How quickly do you deliver corporate headshots in Canberra?",a:"Same day \u2014 retouched on site while the session runs, and delivered named to your directory or asset-management convention."},{q:"How much do corporate headshots cost in Canberra?",a:"Priced per head with volume rates, based on session length and crew size. Most Canberra bookings start from a half-day rate, and panel or standing-offer arrangements can be quoted."},{q:"Can you work in secure government facilities?",a:"Yes. We routinely work with pass requirements, escorted access and pre-approved equipment lists \u2014 send the requirements with the brief."},{q:"When is the best time to book?",a:"Non-sitting weeks. Attendance is far better and venues are calmer, which matters when you're photographing a whole division in one day."}],features:iN("We set up a portable studio in your department, agency or Civic office. Teams of 10 to 300+ photographed with minimal downtime, scheduled around sitting weeks.","Running a program at the National Convention Centre or a Barton hotel? We build a lit booth on the delegate flow and photograph 50\u201380 peo
1ple an hour between sessions."),venuesIntro:"We photograph corporate headshots in your own office, in secure facilities, and at Canberra's event venues.",ctaLine:cN("Canberra"),otherCities:["sydney","melbourne","brisbane"]},hobart:{heroIntro:lN("Hobart"),wallLine1:"One Hobart office.",wallMeta:"Waterfront session",stat4Value:"20 min",stat4Label:"Airport to the CBD",prose1:"Hobart's waterfront precinct is genuinely compact \u2014 Salamanca, Sullivans Cove, Constitution Dock and Battery Point sit minutes from each other, and the Harbour View rooms at the convention centre have floor-to-ceiling glass along the water. That soft, consistent southern daylight is the best natural headshot light in the country, and we build booths to use it rather than fight it.",prose2:"The market's scale changes the brief. Hobart teams are typically smaller and the whole organisation can be photographed in a single morning \u2014 so we plan one session rather than a rolling multi-day booth, and add environmental portraits at Salamanca or MONA while the crew is already on the ground.",precincts:[{name:"Hobart CBD & Sullivans Cove",body:"Professional services, government and maritime organisations in a walkable few blocks along the water.",tags:["Government","Legal","Maritime"]},{name:"Salamanca & Battery Point",body:"Heritage sandstone offices and galleries \u2014 the frame clients ask for when they want Hobart visible in a portrait.",tags:["Tourism","Arts","Hospitality"]},{name:"Sandy Bay",body:"University and research organisations plus Wrest Point, giving both academic teams and conference programs in one precinct.",tags:["Research","Education","Events"]}],logistics:[{title:"Transport & access",body:"Hobart Airport is 17km from the CBD (20 minutes by car) with no public transport from the airport \u2014 shuttle or taxi. The waterfront precinct is compact and walkable, so a two-site headshot day needs no vehicle at all."},{title:"Peak season",body:"December\u2013February is the busy window, and Dark Mofo in June brings a second peak. Crew availability tightens fastest around Wooden Boat Festival and Taste of Summer."},{title:"What we need on site",body:"Three metres by three metres and a power point. Heritage buildings mean narrow stairs in places \u2014 we bring the compact rig where that's the case."}],venues:[{name:"Hobart Convention & Exhibition Centre",suburb:"Hobart Waterfront",body:"The Harbour View rooms' waterfront glass gives soft daylight \u2014 40-plus corporate portraits an hour against that light."},{name:"Wrest Point Hotel & Convention Centre",suburb:"Sandy Bay",body:"Conference floors with accommodation on site, straightforward for a program with a booth running across the breaks."},{name:"Princes Wharf No. 1",suburb:"Salamanca",body:"Big industrial volume on the waterfront \u2014 environmental portraits with genuine Hobart character."},{name:"MONA",suburb:"Berriedale",body:"Art-infused spaces reached by ferry. Distinctive, and worth the logistics when the brief wants something other than corporate grey."},oN("Most Hobart headshot days happen in a meeting room, and a whole organisation often fits in one morning.")],faqs:[{q:"How quickly do you deliver corporate headshots in Hobart?",a:"Same day \u2014 usually within hours, with retouching handled on site while the session runs."},{q:"How much do corporate headshots cost in Hobart?",a:"Priced per head with volume rates, based on session length and crew size. Most Hobart bookings start from a half-day rate \u2014 request a quote for an exact figure."},{q:"Do you cover Launceston and regional Tasmania?",a:"Yes \u2014 Launceston, the North West and the east coast are all covered, quoted with travel included. Lighting and crop stay identical to a Hobart session."},{q:"Is the waterfront light really usable for headshots?",a:"It's some of the best in the country. The Harbour View rooms' glass gives soft, directional daylight, and we add a single light to keep morning and afternoon portraits matched."}],features:iN("We set up a portable studio in your CBD, Salamanca or Sandy Bay office. Smaller Hobart teams are often photographed in a single morning.","Running a program at the convention centre or Wrest Point? We build a lit booth on the delegate flow and photograph 40\u201380 peo
1ple an hour between sessions."),venuesIntro:"We photograph corporate headshots in your own office and at Hobart's waterfront and conference venues.",ctaLine:cN("Hobart"),otherCities:["melbourne","sydney","adelaide"]},darwin:{heroIntro:lN("Darwin"),wallLine1:"One Darwin office.",wallMeta:"Waterfront precinct session",stat4Value:"15 min",stat4Label:"Airport to the CBD",prose1:"Darwin's year splits in two, and it dictates everything. The dry season (May\u2013October) is when the events calendar runs and crews are busiest; the wet brings humidity that fogs glass and makes outdoor portraits a gamble. We shoot indoors in controlled light year-round so a February directory update looks identical to a July one.",prose2:"The defence sector shapes the client base. NT Defence Week and the annual US Marine Rotational Force deployment drive a steady stream of military and defence-industry work, alongside government and resources \u2014 briefs that often need security awareness, rank-correct uniforms in frame, and fast approval turnaround.",precincts:[{name:"Darwin CBD",body:"Government, legal and resources offices in a compact grid. Air-conditioned interiors make consistent lighting straightforward.",tags:["Government","Legal","Resources"]},{name:"Darwin Waterfront",body:"Convention centre and hotel precinct, walkable from the CBD \u2014 where most Top End conference booths run.",tags:["Events","Tourism","Hospitality"]},{name:"Winnellie & Berrimah",body:"Defence, logistics and industrial operations. Portraits here are shot on site, often in high-vis and PPE.",tags:["Defence","Logistics","Industrial"]}],logistics:[{title:"Transport & access",body:"Darwin Airport is 13km from the CBD (15 minutes by car). Public transport is limited, so most crews and delegates use taxis, ride-share or venue shuttles. The Waterfront Precinct is walkable from the CBD."},{title:"Dry season vs wet",body:"May\u2013October is peak: the events calendar is full and bookings should be made well ahead. In the wet, humidity is the technical issue \u2014 we allow gear acclimatisation time and keep sessions indoors."},{title:"What we need on site",body:"Three metres by three metres and a power point, air-conditioned if possible. For site work in PPE we bring a portable backdrop that sets up in ten minutes."}],venues:[{name:"Darwin Convention Centre",suburb:"Darwin Waterfront",body:"Purpose-built spaces with generous pre-function areas \u2014 the easiest place in Darwin to run a delegate booth."},{name:"Mindil Beach Casino Resort",suburb:"Mindil Beach",body:"Conference floors with accommodation on site, and sunset frames for the leadership set when the dry season allows."},{name:"Darwin Turf Club",suburb:"Fannie Bay",body:"Function spaces with easy load-in and parking, well suited to a high-volume staff day."},{name:"On-site & defence facilities",suburb:"Winnellie \xb7 Berrimah",body:"Compact studio setups for teams who can't leave the site, shot to the same standard as an office session."},oN("Most Darwin headshot days happen in an air-conditioned meeting room. Three by three metres, one power point.")],faqs:[{q:"How quickly do you deliver corporate headshots in Darwin?",a:"Same day \u2014 retouched on site while the session runs, so files are ready before your team leaves for the afternoon."},{q:"How much do corporate headshots cost in Darwin?",a:"Priced per head with volume rates, based on session length and crew size. Most Darwin bookings start from a half-day rate \u2014 request a quote for an exact figure."},{q:"Can you shoot in the wet season?",a:"Yes. We work indoors in controlled light year-round, so humidity doesn't affect the result and a wet-season session matches a dry-season one exactly."},{q:"Do you photograph teams on industrial or defence sites?",a:"Regularly. We bring a compact portable studio, work within induction and security requirements, and photograph in PPE where that's the brief."}],features:iN("We set up a portable studio in your CBD office, or on site at Winnellie and Berrimah facilities. Teams of 10 to 300+ photographed with minimal downtime.","Running a program at the Darwin Convention Centre or Mindil Beach? We build a lit booth on the delegate flow and photograph 50\u201380 peo
1ple an hour between sessions."),venuesIntro:"We photograph corporate headshots in your own office, on site, and at Darwin's event venues.",ctaLine:cN("Darwin"),otherCities:["brisbane","perth","adelaide"]},geelong:{heroIntro:lN("Geelong"),wallLine1:"One Geelong office.",wallMeta:"Waterfront session",stat4Value:"55 min",stat4Label:"V/Line from Southern Cross",prose1:"Geelong is moving from a manufacturing base into a health, knowledge and events economy, and the July 2026 opening of Nyaal Banyul \u2014 the city's first purpose-built convention centre \u2014 was the turning point. Organisers who once defaulted to Melbourne now have a waterfront alternative at lower venue cost, and the corporate teams following them are refreshing their imagery to match.",prose2:"For portrait work the waterfront is the differentiator. Bay light is softer and more consistent than anything in the Melbourne CBD, and Deakin's waterfront campus and the Geelong Library dome give architectural interiors that read as somewhere specific \u2014 useful for organisations whose whole brand argument is that they're not in the city.",precincts:[{name:"Geelong CBD & waterfront",body:"Government, health and professional services within walking distance of the station and the bay. Compact enough for a two-office day.",tags:["Health","Government","Professional"]},{name:"Deakin waterfront & knowledge precinct",body:"University, research and health-tech organisations in modern waterfront buildings with excellent natural light.",tags:["Research","Education","Health Tech"]},{name:"Surf Coast & Torquay",body:"Consumer brands, tourism operators and surf-industry head offices \u2014 briefs that want environmental portraits, not studio grey.",tags:["Consumer","Tourism","Surf"]}],logistics:[{title:"Transport & access",body:"Geelong is 75km southwest of Melbourne (one hour via the M1). V/Line trains run every 20 minutes from Southern Cross and take 55 minutes, and Avalon Airport is 20 minutes away. Nyaal Banyul and the waterfront venues are walkable from Geelong Station."},{title:"Peak season",body:"October\u2013March is busiest, with the Surf Coast summer and Cadel Evans race week tightening availability. Venue costs and crew availability are both easier here than Melbourne in peak weeks."},{title:"What we need on site",body:"Three metres by three metres and a power point. Parking and load-in are genuinely easy compared with the Melbourne CBD \u2014 no dock booking needed in most buildings."}],venues:[{name:"Nyaal Banyul \u2014 Geelong Convention and Event Centre",suburb:"Geelong Waterfront",body:"The city's purpose-built convention venue, opened July 2026. Waterfront glass and generous foyers make booth placement simple."},{name:"Deakin University Waterfront Campus",suburb:"Geelong",body:"Modern teaching and research spaces with strong natural light \u2014 our pick for academic and health-tech portraits."},{name:"GMHBA Stadium (Kardinia Park)",suburb:"South Geelong",body:"Function rooms and concourses with the ground behind, and easy parking for a high-volume staff day."},{name:"Geelong Library & Heritage Centre",suburb:"Geelong CBD",body:"The Dome's geometry gives an architectural frame that's unmistakably Geelong."},oN("Most Geelong headshot days happen in a meeting room, with far easier load-in than a Melbourne tower.")],faqs:[{q:"How quickly do you deliver corporate headshots in Geelong?",a:"Same day \u2014 retouched on site while the session runs, so files land before your team finishes for the day."},{q:"How much do corporate headshots cost in Geelong?",a:"Priced per head with volume rates, based on session length and crew size. Most Geelong bookings start from a half-day rate \u2014 request a quote for an exact figure."},{q:"Do you cover the Surf Coast and regional Victoria?",a:"Yes \u2014 Torquay, the Bellarine, Ballarat and the Western District, quoted with travel included. Our crews come from Melbourne and Geelong."},{q:"Can you run a headshot booth at Nyaal Banyul?",a:"Yes. The waterfront foyers take a lit booth comfortably on the delegate flow, and we photograph 50\u201380 peo
1ple an hour between sessions."}],features:iN("We set up a portable studio in your Geelong CBD, waterfront or Surf Coast office. Teams of 10 to 300+ photographed with minimal downtime and easy load-in.","Running a program at Nyaal Banyul, GMHBA Stadium or Deakin waterfront? We build a lit booth on the delegate flow and photograph 50\u201380 people an hour between sessions."),venuesIntro:"We photograph corporate headshots in your own office and at Geelong's waterfront and conference venues.",ctaLine:cN("Geelong"),otherCities:["melbourne","sydney","adelaide"]}},mN="corporate-headshots",pN="https://turbo.net.au",xN=e=>{let{city:t,service:s}=e;return(0,f.jsx)("div",{className:"relative z-20 border-b border-[#222] bg-carbon-900/60 py-3 backdrop-blur-sm ".concat(Ow),children:(0,f.jsx)(Nw.Qp,{children:(0,f.jsxs)(Nw.AB,{className:"flex-nowrap overflow-hidden whitespace-nowrap font-mono text-[12px] uppercase tracking-[0.12em] text-fog",children:[(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/",className:"text-fog transition-colors hover:text-turbo-red",children:"Home"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#3a3a3a]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/services",className:"text-fog transition-colors hover:text-turbo-red",children:"Services"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#3a3a3a]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/services/".concat(mN),className:"text-fog transition-colors hover:text-turbo-red",children:s.shortName})})}),(0,f.jsx)(Nw.tH,{className:"text-[#3a3a3a]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.tJ,{className:"text-smoke",children:t.name})})]})})})},hN=()=>{const{citySlug:e}=(0,r.g)(),t=(0,L.KM)(e),s=_w(mN),a=dN[e];if(!t||!s||!a)return(0,f.jsx)(r.C5,{to:"/services",replace:!0});const n=s.metaTitleTemplate.replace("{city}",t.metaCityName),i=a=>s.metaDescriptionTemplate.replace("{city}",t.metaCityName).replace("{venues}",(0,L.xp)(e,a)).replace("{region}",t.region);let o=i(2);o.length>155&&(o=i(1));const l="/services/".concat(mN,"/").concat(e),c={"@context":"https://schema.org","@type":"Service",name:"".concat(s.name," in ").concat(t.name),description:o,serviceType:s.schemaServiceType,aggregateRating:Fw._I,provider:(0,Fw.YQ)(pN),areaServed:{"@type":"City",name:t.name,containedInPlace:{"@type":"State",name:t.stateFullName}},offers:{"@type":"Offer",availability:"https://schema.org/InStock",priceRange:"$$",areaServed:{"@type":"City",name:t.name}}},d={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"".concat(pN,"/")},{"@type":"ListItem",position:2,name:"Services",item:"".concat(pN,"/services")},{"@type":"ListItem",position:3,name:s.shortName,item:"".concat(pN,"/services/").concat(mN)},{"@type":"ListItem",position:4,name:t.name}]},p=a.otherCities.map(L.KM).filter(Boolean),x=[{value:"1 min",label:"Per person",tone:"amber"},{value:"300+",label:"Staff per day",tone:"teal"},{value:"0",label:"Days waiting",tone:"red"},{value:a.stat4Value,label:a.stat4Label,tone:"smoke"}];return(0,f.jsxs)(ae.mP,{children:[(0,f.jsx)(R.A,{rawTitle:n,description:o,keywords:s.keywords.map(e=>"".concat(e," ").concat(t.name)).join(", "),canonical:l,ogImage:"".concat(pN).concat(s.images.hero),geo:{region:"AU-".concat(t.state),placename:t.name},structuredData:[c,d]}),(0,f.jsx)(D.A,{}),(0,f.jsx)(xN,{city:t,service:s}),(0,f.jsxs)("section",{className:"relative grid grid-cols-1 items-end gap-0 overflow-hidden bg-carbon-900 pt-11 md:pt-14 xl:h-[calc(100vh-130px)] xl:min-h-[640px] xl:grid-rows-[minmax(0,1fr)] xl:grid-cols-[minmax(0,1fr)_minmax(0,620px)] xl:gap-10 xl:pt-[74px] ".concat(Ow),children:[(0,f.jsx)("div",{className:"pointer-events-none absolute right-[-90px] top-[-40px] h-[820px] w-[820px]",style:{background:"radial-gradient(52% 52% at 50% 50%,rgba(232,233,238,.2) 0%,rgba(13,13,13,0) 72%)"}}),(0,f.jsx)("div",{className:"relative z-[2] min-w-0 pb-7 xl:pb-[74px]",children:(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)(Jw,{children:[t.name,", ",t.state]}),(0,f.jsxs)("h1",{className:"m-0 font-display text-[40px] font-black uppercase leading-[0.9] tracking-[-0.025em] text-smoke md:text-[60px] xl:text-[82px]",children:["Corporate Headsh
1ots & Portraits"," ",(0,f.jsxs)("span",{className:"block text-[26px] text-[#D9D6CF] md:text-[38px] xl:text-[50px]",children:["in ",t.name]})]}),(0,f.jsx)("p",{className:"mt-[30px] max-w-[640px] text-base leading-[1.6] text-[#D9D6CF] md:text-[19px] [text-wrap:pretty]",children:a.heroIntro}),(0,f.jsx)("div",{className:"mt-[38px]",children:(0,f.jsx)(Uw,{to:"/get-quote",children:"Get your quote \u2192"})})]})}),(0,f.jsx)("div",{className:"relative z-[2] flex h-[380px] min-h-0 items-end justify-start md:h-[520px] xl:h-full xl:justify-center",children:(0,f.jsx)("img",{src:le,alt:"Corporate headshot by Turbo 360 in ".concat(t.name),width:"933",height:"1400",className:"block h-full max-h-full w-auto max-w-full object-contain object-bottom"})})]}),(0,f.jsx)("div",{className:"h-[5px]",style:{background:ce}}),(0,f.jsx)(Bw,{children:(0,f.jsx)(Dw,{headline:(0,f.jsxs)(f.Fragment,{children:[a.wallLine1,(0,f.jsx)("br",{}),"51 headshots. ",(0,f.jsx)("span",{className:"text-turbo-red",children:"One day."})]}),meta:(0,f.jsxs)(f.Fragment,{children:[a.wallMeta,(0,f.jsx)("br",{}),"Delivered same day"]})})}),(0,f.jsx)(Rw,{stats:x,className:"!border-t-0"}),(0,f.jsxs)(qw,{tone:"carbon",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(Lw,{className:"mb-[18px]",children:"01 / What we offer"}),(0,f.jsx)(Mw,{children:"Corporate headshots services"}),(0,f.jsxs)("p",{className:"mb-[50px] mt-5 text-[17px] leading-[1.6] text-[#9C9A95]",children:["in ",t.name,", ",t.stateFullName]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 xl:grid-cols-3",children:a.features.map((e,t)=>(0,f.jsx)(Gw,(0,m.A)((0,m.A)({},e),{},{delay:t%3*80}),e.n))})]}),(0,f.jsxs)(qw,{tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)(Lw,{className:"mb-[18px]",children:"02 / Local knowledge"}),(0,f.jsxs)(Mw,{children:["Shooting headshots in ",(0,f.jsx)("span",{className:"text-turbo-red",children:t.name})]}),(0,f.jsx)("p",{className:"mb-5 mt-6 max-w-[860px] text-[17px] leading-[1.65] text-[#C7C4BD] [text-wrap:pretty]",children:a.prose1}),(0,f.jsx)("p",{className:"mb-[50px] max-w-[860px] text-[17px] leading-[1.65] text-[#9C9A95] [text-wrap:pretty]",children:a.prose2})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 gap-[46px] xl:grid-cols-2",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)("h3",{className:"m-0 mb-[22px] font-head text-[22px] font-bold text-smoke",children:"Corporate precincts we work in"}),(0,f.jsx)("div",{className:"flex flex-col gap-3.5",children:a.precincts.map(e=>(0,f.jsxs)(Hw,{pad:"p-5",children:[(0,f.jsx)("h4",{className:"m-0 mb-1.5 font-head text-base font-bold text-smoke",children:e.name}),(0,f.jsx)("p",{className:"m-0 mb-3 text-sm leading-[1.6] text-[#9C9A95]",children:e.body}),(0,f.jsx)("div",{className:"flex flex-wrap gap-[7px]",children:e.tags.map(e=>(0,f.jsx)("span",{className:"rounded-full border border-turbo-red/30 px-[9px] py-[3px] font-mono text-[10px] uppercase tracking-[0.1em] text-turbo-red",children:e},e))})]},e.name))})]}),(0,f.jsxs)(ae.gN,{delay:80,children:[(0,f.jsxs)("h3",{className:"m-0 mb-[22px] font-head text-[22px] font-bold text-smoke",children:["Logistics, the ",t.name," version"]}),(0,f.jsx)("div",{className:"flex flex-col gap-3.5",children:a.logistics.map(e=>(0,f.jsxs)(Hw,{pad:"p-[22px]",children:[(0,f.jsx)("h4",{className:"m-0 mb-2 font-head text-base font-bold text-smoke",children:e.title}),(0,f.jsx)("p",{className:"m-0 text-sm leading-[1.6] text-[#9C9A95]",children:e.body})]},e.title))})]})]})]}),(0,f.jsxs)(qw,{tone:"carbon",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)(Lw,{className:"mb-[18px]",children:["03 / ",t.name," venues"]}),(0,f.jsxs)(Mw,{children:["Where we ",(0,f.jsx)("span",{className:"text-turbo-red",children:"work"})]}),(0,f.jsx)("p",{className:"mb-12 mt-6 max-w-[820px] text-[17px] leading-[1.6] text-[#C7C4BD]",children:a.venuesIntro})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 xl:grid-cols-3",children:a.venues.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*60,className:"h-full",children:(0,f.jsxs)(Hw,{pad:"p-6",children:[(0,f.jsx)("h3",{className:"m-0 mb-1 font-head text-[17px] font-bold text-smoke",children:e.name}),(0,f.jsx)("div",{className:"mb-3 font-mono text-xs uppercase tracking-[0.1em] text-turbo-red",children:e.suburb}),(0,f.jsx)("p",{className:"m-0 text-sm leading-[1.6] text-[#9C9A95]",children:e.body})]})},e.name))})]}),(0,f.jsx)(sN.A,{citySlug:e,heading:"Recent work in ".concat(t.name)}),(0,f.jsx)(Tw.A,{variant:"v2",tone:"carbon-900",eyebrow:"04 / Common questions",heading:"".concat(t.name," headshots, answered"),faqs:a.faqs}),(0,f.jsx)("section",{className:"border-b border-[#222] bg-carbon py-16 md:py-20 xl:py-[90px] ".concat(Ow),children:(0,f.jsxs)("div",{className:"grid grid-cols-1 gap-[46px] xl:grid-cols-2",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)("h3",{className:"m-0 mb-5 font-head text-xl font-bold text-smoke",children:["Other services in ",t.name]}),(0,f.jsxs)("div",{className:"flex flex-col gap-2.5",children:[["corporate-event-photography","conference-photography"].map(s=>{const a=_w(s);return a?(0,f.jsxs)(Vw,{to:"/services/".concat(s,"/").concat(e),children:[a.name," in ",t.name]},s):null}),(0,f.jsxs)(Vw,{to:"/services/locations/".concat(e),children:["All services in ",t.name]}),(0,f.jsx)(Vw,{to:"/business",children:"Corporate photography & video production"})]})]}),(0,f.jsxs)(ae.gN,{delay:80,children:[(0,f.jsx)("h3",{className:"m-0 mb-5 font-head text-xl font-bold text-smoke",children:"Corporate headsh
1ots in other cities"}),(0,f.jsxs)("div",{className:"flex flex-col gap-2.5",children:[p.map(e=>(0,f.jsxs)(Vw,{to:"/services/".concat(mN,"/").concat(e.slug),glyph:"\u25c9",children:["Corporate Headshots in ",e.name]},e.slug)),(0,f.jsx)(Vw,{to:"/services/".concat(mN),children:"All Corporate Headshots locations"})]})]})]})}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] bg-turbo-red py-[72px] text-center xl:py-[110px] ".concat(Ow),children:[(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute right-[-70px] top-1/2 hidden w-[380px] -translate-y-1/2 -rotate-[8deg] opacity-10 md:block"}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-[900px]",children:[(0,f.jsx)("h2",{className:"m-0 font-display text-[38px] font-black uppercase leading-[0.94] tracking-[-0.025em] text-white md:text-[56px] xl:text-[80px]",children:"Ready for turbo speed?"}),(0,f.jsx)("p",{className:"mx-auto mt-6 max-w-[620px] text-[17px] leading-[1.6] text-white/90 md:text-[19px]",children:a.ctaLine}),(0,f.jsx)("div",{className:"mt-9 flex justify-center",children:(0,f.jsx)(r.N_,{to:"/get-quote",className:"inline-flex items-center gap-2 bg-white px-[34px] py-[18px] font-head text-[17px] font-bold uppercase tracking-[0.02em] text-turbo-red transition-transform duration-[400ms] ease-turbo hover:-translate-y-[3px]",children:"Get your quote now \u26a1"})}),(0,f.jsxs)("div",{className:"mt-[54px] grid grid-cols-1 gap-[34px] text-left md:grid-cols-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-white/80",children:"Call now"}),(0,f.jsx)("a",{href:"tel:1300207446",className:"font-head text-lg font-bold text-white",children:"1300 207 446"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-white/80",children:"Email"}),(0,f.jsx)("a",{href:"mailto:[email protected]",className:"font-head text-lg font-bold text-white",children:"[email protected]"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("div",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-white/80",children:"Coverage"}),(0,f.jsx)("div",{className:"font-head text-lg font-bold text-white",children:t.region})]})]})]})]}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})},uN={Camera:Ue.A,Video:Ge.A,Clock:Nt.A,Users:Xe.A,Eye:_.A,Share2:at.A,Monitor:Da.A,Radio:Ve.A,Heart:fs.A,Globe:et.A,Target:tt.A,Building:Ke.A,User:Ye.A,Award:za.A,Zap:F.A,Edit3:Je.A,Star:nt.A,MapPin:C.A,CheckCircle:p.A},gN=()=>{var e;const{citySlug:t,serviceSlug:s}=(0,r.g)(),a=(0,L.KM)(t),n=_w(s);if("corporate-headshots"===s)return(0,f.jsx)(hN,{});if(!a||!n)return(0,f.jsx)(r.C5,{to:"/services",replace:!0});const i=null===(e=n.citySeo)||void 0===e?void 0:e[t],o=(null===i||void 0===i?void 0:i.metaTitle)||n.metaTitleTemplate.replace("{city}",a.metaCityName),l=e=>n.metaDescriptionTemplate.replace("{city}",a.metaCityName).replace("{venues}",(0,L.xp)(t,e)).replace("{region}",a.region);let c=(null===i||void 0===i?void 0:i.metaDescription)||l(2);(null===i||void 0===i||!i.metaDescription)&&c.length>155&&(c=l(1));const d={primary:"block text-[clamp(40px,7vw,104px)] text-smoke",accent:"block text-[clamp(40px,7vw,104px)] text-turbo-red",location:"block mt-2 text-[clamp(28px,4.6vw,64px)] text-[#D9D6CF]",tagline:"block mt-2 text-[clamp(28px,4.6vw,64px)] text-[#D9D6CF]"},m=((e,t)=>"function"===typeof e.cityHeroLines?e.cityHeroLines(t):[{text:e.heroTitle,variant:"primary"},{text:e.heroTitleAccent,variant:"accent"},{text:"in ".concat(t),variant:"location"}])(n,a.name).map(e=>({text:e.text,className:e.className||d[e.variant]||d.primary})),p="/services/".concat(s,"/").concat(t),x="https://turbo.net.au",h={"conference-photography":{path:"/conferences",label:"Conference Photography & Video Production"},"exhibition-photography":{path:"/conferences",label:"Conference & Exhibition Services"},"corporate-event-photography":{path:"/business",label:"Corporate Photography & Video Production"},"corporate-headshots":{path:"/business",label:"Corporate Photography & Video Production"},"event-coverage":{path:"/services",label:"All Photography & Video Services"}}[s],u=a.venues.filter(e=>"corporate-headshots"===s||("conference-photography"===s?["convention","hotel","heritage"].includes(e.type):"exhibition-photography"!==s||["convention","exhibition","entertainment"].includes(e.type))),g={"@context":"https://schema.org","@type":"Service",name:"".concat(n.name," in ").concat(a.name),description:c,serviceType:n.schemaServiceType,aggregateRating:Fw._I,provider:(0,Fw.YQ)(x),areaServed:{"@type":"City",name:a.name,containedInPlace:{"@type":"State",name:a.stateFullName}},offers:{"@type":"Offer",availability:"https://schema.org/InStock",priceRange:"$$",areaServed:{"@type":"City",name:a.name}}},b={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"".concat(x,"/")},{"@type":"ListItem",position:2,name:"Services",item:"".concat(x,"/services")}
1,{"@type":"ListItem",position:3,name:n.shortName,item:"".concat(x,"/services/").concat(s)},{"@type":"ListItem",position:4,name:a.name}]};return(0,f.jsxs)(ae.mP,{children:[(0,f.jsx)(R.A,{rawTitle:o,description:c,keywords:n.keywords.map(e=>"".concat(e," ").concat(a.name)).join(", "),canonical:p,ogImage:"".concat(x).concat(n.images.hero),geo:{region:"AU-".concat(a.state),placename:a.name},structuredData:[g,b]}),(0,f.jsx)(D.A,{}),(0,f.jsx)("div",{className:"relative z-20 border-b border-[#222] bg-carbon-900/60 backdrop-blur-sm",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-[22px] md:px-11 py-3",children:(0,f.jsx)(Nw.Qp,{children:(0,f.jsxs)(Nw.AB,{className:"font-mono text-[12px] uppercase tracking-[0.12em] text-fog",children:[(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/",className:"text-fog hover:text-turbo-red transition-colors",children:"Home"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#3a3a3a]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/services",className:"text-fog hover:text-turbo-red transition-colors",children:"Services"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#3a3a3a]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/services/".concat(s),className:"text-fog hover:text-turbo-red transition-colors",children:n.shortName})})}),(0,f.jsx)(Nw.tH,{className:"text-[#3a3a3a]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.tJ,{className:"text-smoke",children:a.name})})]})})})}),(0,f.jsxs)("section",{className:"relative flex min-h-[78vh] items-end overflow-hidden bg-carbon-900",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:'url("'.concat(n.images.hero,'")')},children:(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.72) 0%,rgba(13,13,13,.5) 32%,rgba(13,13,13,.78) 70%,#0d0d0d 100%)"}})}),(0,f.jsxs)("div",{className:"relative z-10 mx-auto w-full max-w-7xl px-[22px] md:px-11 pb-16 md:pb-24 pt-28",children:[(0,f.jsxs)("div",{className:"mb-[26px] flex items-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsxs)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:[a.name,", ",a.state]})]}),(0,f.jsx)(Xw,{className:"m-0 font-display font-extrabold uppercase leading-[0.9] tracking-[-0.025em] text-smoke [text-wrap:balance]",lines:m}),(0,f.jsx)("p",{className:"mt-[30px] max-w-[640px] text-[clamp(16px,1.4vw,20px)] leading-[1.6] text-[#D9D6CF]",children:n.intro}),(0,f.jsx)("div",{className:"mt-[38px] flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:(0,f.jsxs)(ae.$$,{to:"/get-quote",children:["Get your quote ",(0,f.jsx)(S.A,{className:"h-5 w-5"})]})})]})]}),(0,f.jsxs)(ae.wn,{tone:"carbon",children:[(0,f.jsxs)(ae.gN,{className:"mb-14",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / What we offer"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:[n.shortName," services"]}),(0,f.jsxs)("p",{className:"m-0 mt-5 max-w-[640px] text-[17px] leading-[1.6] text-[#9C9A95]",children:["in ",a.name,", ",a.stateFullName]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-3",children:n.features.map((e,t)=>{const s=uN[e.icon]||Ue.A;return(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"group h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-[30px] transition-colors duration-300 hover:border-turbo-red",children:[(0,f.jsx)("div",{className:"mb-5 flex h-12 w-12 items-center justify-center rounded-lg bg-turbo-red/15 text-turbo-red transition-colors duration-300 group-hover:bg-turbo-red group-hover:text-white",children:(0,f.jsx)(s,{className:"h-6 w-6"})}),(0,f.jsx)("h3",{className:"mb-3 font-head text-xl font-bold text-smoke transition-colors group-hover:text-turbo-red",children:e.title}),(0,f.jsx)("p",{className:"m-0 text-[14.5px] leading-[1.6] text-[#9C9A95]",children:e.description})]})},t)})})]}),(0,f.jsxs)(ae.wn,{tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"02 / Our work"}),(0,f.jsx)(ae.nl,{className:"text-[clamp(34px,4.6vw,64px)]",children:"Recent portfolio"})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-3",children:n.images.gallery.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"group relative overflow-hidden rounded-[10px] border border-[#262626] transition-colors hover:border-turbo-red",children:[(0,f.jsx)("img",{src:e,alt:"".concat(n.short
1Name," in ").concat(a.name," - Turbo 360 portfolio ").concat(t+1),className:"h-64 w-full object-cover transition-transform duration-700 ease-turbo group-hover:scale-[1.06]",loading:"lazy"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 55%,rgba(13,13,13,.7))"}})]})},t))})]}),(0,f.jsxs)(ae.wn,{tone:"carbon",children:[(0,f.jsxs)(ae.gN,{className:"mb-14",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"03 / Local knowledge"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["WHY ",a.name.toUpperCase()," ",(0,f.jsx)("span",{className:"text-turbo-red",children:"EVENTS"})]}),(0,f.jsx)("p",{className:"m-0 mt-6 max-w-3xl text-[17px] leading-[1.6] text-[#C7C4BD]",children:a.localInsight})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-8 mb-12",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)("h3",{className:"mb-6 flex items-center font-head text-2xl font-bold text-smoke",children:[(0,f.jsx)(Ke.A,{className:"h-6 w-6 text-turbo-red mr-3"}),"Corporate Precincts"]}),(0,f.jsx)("div",{className:"space-y-4",children:a.precincts.slice(0,4).map((e,t)=>(0,f.jsxs)("div",{className:"rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-4",children:[(0,f.jsx)("h4",{className:"mb-1 font-head font-bold text-smoke",children:e.name}),(0,f.jsx)("p",{className:"mb-2 text-sm text-[#9C9A95]",children:e.description}),(0,f.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.industries.slice(0,3).map((e,t)=>(0,f.jsx)("span",{className:"rounded-full border border-turbo-red/30 px-2.5 py-0.5 font-mono text-[10px] uppercase tracking-[0.1em] text-turbo-red",children:e},t))})]},t))})]}),(0,f.jsxs)(ae.gN,{delay:80,children:[(0,f.jsxs)("h3",{className:"mb-6 flex items-center font-head text-2xl font-bold text-smoke",children:[(0,f.jsx)(F.A,{className:"h-6 w-6 text-turbo-red mr-3"}),"Major Annual Events"]}),(0,f.jsx)("div",{className:"space-y-4",children:a.annualEvents.slice(0,4).map((e,t)=>(0,f.jsxs)("div",{className:"rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-4",children:[(0,f.jsxs)("div",{className:"mb-1 flex items-start justify-between",children:[(0,f.jsx)("h4",{className:"font-head font-bold text-smoke",children:e.name}),(0,f.jsx)("span",{className:"ml-2 whitespace-nowrap rounded-full border border-turbo-red/30 bg-turbo-red/10 px-2.5 py-0.5 font-mono text-[10px] uppercase tracking-[0.1em] text-turbo-red",children:e.when})]}),(0,f.jsx)("p",{className:"text-sm text-[#9C9A95]",children:e.description})]},t))})]})]}),(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-6",children:[(0,f.jsx)(ae.gN,{children:(0,f.jsxs)("div",{className:"rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6",children:[(0,f.jsxs)("h3",{className:"mb-3 flex items-center font-head text-lg font-bold text-smoke",children:[(0,f.jsx)(Nt.A,{className:"h-5 w-5 text-turbo-red mr-2"}),"Peak Event Season"]}),(0,f.jsx)("p",{className:"text-sm text-[#9C9A95]",children:a.seasonalNotes.peak})]})}),(0,f.jsx)(ae.gN,{delay:80,children:(0,f.jsxs)("div",{className:"rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6",children:[(0,f.jsxs)("h3",{className:"mb-3 flex items-center font-head text-lg font-bold text-smoke",children:[(0,f.jsx)(C.A,{className:"h-5 w-5 text-turbo-red mr-2"}),"Transport & Access"]}),(0,f.jsx)("p",{className:"text-sm text-[#9C9A95]",children:a.transportNotes})]})})]})]}),(0,f.jsxs)(ae.wn,{tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{className:"mb-14",children:[(0,f.jsxs)(ae.YZ,{className:"mb-[18px]",children:["04 / ",a.name," venues"]}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["WHERE WE ",(0,f.jsx)("span",{className:"text-turbo-red",children:"WORK"})]}),(0,f.jsxs)("p",{className:"m-0 mt-6 max-w-3xl text-[17px] leading-[1.6] text-[#C7C4BD]",children:["We cover ",n.shortName.toLowerCase()," at ",a.name,"'s premier venues and event spaces."]})]}),(0,f.jsx)("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-[22px] mb-8",children:u.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*60,children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors hover:border-turbo-red",children:[(0,f.jsxs)("div",{className:"mb-3 flex items-start",children:[(0,f.jsx)(C.A,{className:"mr-2 mt
1-1 h-5 w-5 flex-shrink-0 text-turbo-red"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h3",{className:"font-head font-bold text-smoke",children:e.fullName||e.name}),(0,f.jsx)("p",{className:"font-mono text-[12px] uppercase tracking-[0.1em] text-turbo-red",children:e.suburb})]})]}),(0,f.jsx)("p",{className:"mb-2 text-sm text-[#9C9A95]",children:e.description}),e.capacity&&(0,f.jsx)("span",{className:"inline-block rounded-full border border-[#3a3a3a] px-2.5 py-0.5 font-mono text-[10px] uppercase tracking-[0.1em] text-fog",children:e.capacity}),e.href&&(0,f.jsxs)(r.N_,{to:e.href,className:"mt-3 flex items-center font-head text-sm font-semibold text-turbo-red hover:underline",children:["Photography & video at ",e.name," ",(0,f.jsx)(S.A,{className:"ml-1.5 h-4 w-4"})]})]})},t))}),a.uniqueVenues&&a.uniqueVenues.length>0&&(0,f.jsxs)("div",{className:"mt-12",children:[(0,f.jsx)(ae.gN,{children:(0,f.jsx)("h3",{className:"mb-6 text-center font-head text-2xl font-bold text-smoke",children:"Unique Event Spaces"})}),(0,f.jsx)("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-4",children:a.uniqueVenues.slice(0,6).map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*60,children:(0,f.jsxs)("div",{className:"flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-4",children:[(0,f.jsx)(nt.A,{className:"mr-3 h-5 w-5 flex-shrink-0 text-ignition"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"font-head text-sm font-semibold text-smoke",children:e.name}),(0,f.jsx)("p",{className:"font-mono text-[10px] uppercase tracking-[0.1em] text-fog",children:e.type})]})]})},t))})]})]}),(0,f.jsx)(ae.wn,{tone:"carbon",children:(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-12",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)("h3",{className:"mb-5 font-head text-xl font-bold text-smoke",children:["Other Services in ",a.name]}),(0,f.jsxs)("div",{className:"space-y-2.5",children:[n.relatedServices&&n.relatedServices.map((e,s)=>{const n=_w(e);return n?(0,f.jsxs)(r.N_,{to:"/services/".concat(e,"/").concat(t),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:[n.name," in ",a.name]})]},s):null}),(0,f.jsxs)(r.N_,{to:"/services/locations/".concat(t),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:["All services in ",a.name]})]})]})]}),(0,f.jsxs)(ae.gN,{delay:80,children:[(0,f.jsxs)("h3",{className:"mb-5 font-head text-xl font-bold text-smoke",children:[n.shortName," in Other Cities"]}),(0,f.jsxs)("div",{className:"space-y-2.5",children:[L.EW.filter(e=>e!==t).slice(0,5).map((e,t)=>{const a=(0,L.KM)(e);return a?(0,f.jsxs)(r.N_,{to:"/services/".concat(s,"/").concat(e),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(C.A,{className:"mr-3 h-4 w-4 text-turbo-red"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:[n.shortName," in ",a.name]})]},t):null}),(0,f.jsxs)(r.N_,{to:"/services/".concat(s),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:["All ",n.shortName," locations"]})]})]})]})]})}),(0,f.jsx)(sN.A,{citySlug:t,heading:"Recent ".concat(n.shortName.toLowerCase()," in ").concat(a.name)}),h&&(0,f.jsx)(ae.wn,{tone:"carbon-900",className:"text-center",children:(0,f.jsxs)(ae.gN,{className:"mx-auto max-w-5xl",children:[(0,f.jsxs)("p",{className:"mb-5 text-[#9C9A95]",children:["Looking for more information about our ",n.shortName.toLowerCase()," services?"]}
1),(0,f.jsxs)(r.N_,{to:h.path,className:"group inline-flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] px-6 py-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-5 w-5 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsx)("span",{className:"font-head font-semibold text-smoke transition-colors group-hover:text-turbo-red",children:h.label})]})]})}),(0,f.jsx)(Tw.A,{faqs:kw(n,a.name)}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] bg-turbo-red px-[22px] py-[110px] text-center md:px-11",children:[(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"","aria-hidden":!0,className:"pointer-events-none absolute right-[-70px] top-1/2 hidden w-[380px] -translate-y-1/2 -rotate-[8deg] opacity-10 md:block"}),(0,f.jsxs)(ae.gN,{className:"relative z-[2] mx-auto max-w-4xl",children:[(0,f.jsx)("h2",{className:"mb-6 font-display text-[clamp(40px,6vw,90px)] font-extrabold leading-[0.94] tracking-[-0.025em] text-white",children:"READY FOR TURBO SPEED?"}),(0,f.jsxs)("p",{className:"mx-auto mb-10 max-w-[620px] text-[clamp(17px,1.6vw,20px)] leading-[1.6] text-white/90",children:["Get same-day ",n.shortName.toLowerCase()," in ",a.name," that keeps your event momentum alive."]}),(0,f.jsx)("div",{className:"mb-10 flex flex-col justify-center gap-4 sm:flex-row",children:(0,f.jsxs)(r.N_,{to:"/get-quote",className:"inline-flex items-center justify-center gap-2 rounded-lg bg-white px-[34px] py-[18px] font-head text-lg font-bold text-turbo-red transition-transform duration-[400ms] ease-turbo hover:-translate-y-[3px]",children:["GET YOUR QUOTE NOW",(0,f.jsx)(F.A,{className:"h-6 w-6"})]})}),(0,f.jsxs)("div",{className:"grid gap-8 text-left md:grid-cols-3",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-white/80",children:"CALL NOW"}),(0,f.jsx)("p",{className:"font-head text-lg font-bold text-white",children:"1300 207 446"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-white/80",children:"EMAIL"}),(0,f.jsx)("p",{className:"font-head text-lg font-bold text-white",children:"[email protected]"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.2em] text-white/80",children:"LOCATIONS"}),(0,f.jsx)("p",{className:"font-head text-lg font-bold text-white",children:"Australia-wide coverage"})]})]})]})]}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})};var fN=s(20920),bN=s(75661);const yN={"nyaal-banyul-geelong":{slug:"nyaal-banyul-geelong",name:"Nyaal Banyul",fullName:"Nyaal Banyul Geelong Convention and Event Centre",aka:["GCEC","Geelong Convention Centre","Geelong Convention and Event Centre"],citySlug:"geelong",suburb:"Geelong Waterfront",address:{street:"80 Western Beach Road",locality:"Geelong",region:"VIC",postcode:"3220",country:"AU"},coordinates:{lat:-38.1439,lng:144.3545},opened:"July 2026",operator:"Victorian Convention and Event Trust",nameMeaning:'Nyaal Banyul is a Wadawurrung name meaning "open your eyes to the hills" \u2014 a gift of language from the Traditional Owners of Djilang (Geelong), and a fitting name for a venue that opens onto Corio Bay.',about:"Opened in July 2026, Nyaal Banyul Geelong Convention and Event Centre \u2014 the venue formerly planned as the Geelong Convention and Event Centre (GCEC) \u2014 is Victoria's newest purpose-built convention destination. The $449m waterfront centre brings a 1,000-seat theatre, around 3,700 square metres of exhibition and event space, meeting rooms, and banquet facilities to 80 Western Beach Road on the Geelong waterfront, with hotel accommodation moments away and Geelong Station a short walk up the hill.",heroImage:"/images/services/locations/corporate-event-audience.jpg",stats:[{label:"Theatre",value:"1,000 seats"},{label:"Event space",value:"3,700 m\xb2"},{label:"Opened",value:"July 2026"},{label:"Location",value:"Geelong waterfront"}],spaces:[{name:"1,000-Seat Theatre",type:"Plenary & keynotes",description:"The centrepiece plenary theatre for keynotes, conference openings, awards ceremonies, and touring productions.",howWeShoot:"One integrated crew covers the theatre for stills and motion together \u2014 coordinated positions, shared lighting awareness, and a single delivery pipeline for everything captured on stage.",serviceNotes:{"event-photography":"Stage wides from the back rail, tight speaker frames from stage-left and stage-right, and audience reaction passes down the aisles \u2014 all on silent shutters, so a full house never hears us.","video-production":"Typically a locked wide, a tight follow camera, and an audie
1nce sweep \u2014 vision-switched live or edited in post, with programme audio taken as a clean feed from the theatre desk."}},{name:"Exhibition & Event Halls",type:"Exhibitions & trade shows",description:"Around 3,700 m\xb2 of flexible, divisible event space for exhibitions, trade shows, and large-scale corporate functions.",howWeShoot:"Exhibition days run to a plan: sponsors and exhibitors are scheduled, floor peaks are anticipated, and photo and video teams split the hall so nothing gets missed.",serviceNotes:{"event-photography":"Scheduled booth-by-booth exhibitor coverage, wide establishing frames at peak traffic, sponsor signage documented for post-event reports, and candid networking moments across the floor.","video-production":"Roaming gimbal walk-throughs when the floor is busiest, exhibitor interviews on wireless lapel mics, and b-roll passes that give every sponsor their own cut-down."}},{name:"Meeting & Breakout Rooms",type:"Workshops & breakouts",description:"A suite of meeting and breakout rooms for concurrent conference sessions, workshops, and boardroom-style events.",howWeShoot:"Concurrent sessions are the test of a well-run crew \u2014 we plan room rotations against your program so parallel streams are covered without anyone noticing us work.",serviceNotes:{"event-photography":"A rotating stills schedule across concurrent sessions means every speaker, panellist, and sponsored session is photographed \u2014 without a photographer camped in any one room.","video-production":"Compact single-camera capture per room with synchronised slides, scaling to full multi-room recording when every concurrent session needs to land in your content library."}},{name:"Banquet & Gala Spaces",type:"Dinners & awards nights",description:"Banquet-configured spaces for gala dinners, awards nights, and cocktail receptions with waterfront views.",howWeShoot:"Gala nights reward preparation: we scout the room set, plan for the lighting design rather than against it, and have every award moment covered from two angles.",serviceNotes:{"event-photography":"Ambient-first low-light shooting that keeps the room design in frame, table-by-table group coverage before service, and award winners delivered to your inbox the same night.","video-production":"Cinematic room reveals before doors open, multi-camera awards coverage with clean podium audio, and a highlight cut ready before the last guests leave."}},{name:"Waterfront Foyers & Pre-Function Areas",type:"Networking & arrivals",description:"Light-filled foyer and pre-function areas overlooking Corio Bay \u2014 natural territory for arrivals, registration, and networking breaks.",howWeShoot:"The bay-facing glass is the venue\u2019s signature: both our stills and video teams build their coverage plans around that light across the day.",serviceNotes:{"event-photography":"Soft natural key light off Corio Bay for arrivals, candids, and sponsor activations \u2014 available light most Victorian venues simply can\u2019t match.","video-production":"Natural-light interview backdrops over the water, timelapse rigs on the foyer flow between sessions, and golden-hour b-roll straight off the glass."}}],logistics:"Nyaal Banyul sits at 80 Western Beach Road on the Geelong waterfront \u2014 about an hour from Melbourne via the M1, a 55-minute V/Line ride from Southern Cross to Geelong Station (a short walk away), and 20 minutes from Avalon Airport. Our crews arrive early, travel light, and coordinate with venue operations on load-in and access.",disclaimer:"Turbo 360 is an independent photography and video production supplier. We are not affiliated with, operated by, or endorsed by Nyaal Banyul Geelong Convention and Event Centre or the Victorian Convention and Event Trust.",hubMeta:{title:"Nyaal Banyul Geelong (GCEC) \u2014 Event Photography & Video | Turbo 360",description:"Event photography & video at Nyaal Banyul Geelong Convention and Event Centre (GCEC). Same-day delivery, multi-cam video, AI galleries. 180+ 5\u2605 reviews.",keywords:["Nyaal Banyul photographer","Nyaal Banyul photography","Nyaal Banyul videographer","GCEC photographer","Geelong Convention Centre photographer","Geelong Convention and Event Centre photography","Geelong Convention Centre video production","event photographer Nyaal Banyul Geelong"]},hubFaqs:[{q:"Is Nyaal Banyul the same venue as the Geelong Convention and Event Centre (GCEC)?",a:"Yes. Nyaal Banyul is the Wadawurrung name given to the venue developed as the Geelong Convention and Event Centre (GCEC). It opened in July 2026 at 80 Western Beach Road on the Geelong waterfront and is operated by the Victorian Convention and Event Trust. Whether your event brief says Nyaal Banyul, GCEC, or Geelong Convention Centre, it\u2019s the same venue \u2014 and we cover it."},{q:"Do you offer both photography and video production at Nyaal Banyul?",a:"Yes \u2014 we provide event photography and full video production at Nyaal Banyul, separately or as one crew with one booking. That includes same-day edited photos, multi-camera presentation capture, live streaming, and social media reels delivered during your event."},{q:"How quickly can you deliver photos and video from an event at Nyaal Banyul?",a:"Same day. Edited, colour-graded photos are typically delivered within hours of capture, and highlight reels can be turned around while your event is still running \u2014 so your team can post while delegates are still in the building."},{q:"Where is Nyaal Banyul and how do your crews get there?",a:"Nyaal Banyul is at 80 Western Beach Road on the Geelong waterfront, about an hour from Melbourne via the M1 and a short walk from Geelong Station. Turbo 360 is headquartered on the Bellarine Peninsula, minutes from Geelong \u2014 we\u2019re effectively the local crew for this venue."},{q:"Can you also cover our event\u2019s offsite functions around Geelong?",a:"Absolutely. Many conferences at Nyaal Banyul run offsite dinners and activations at venues like The Pier, the Geelong Boat House, GMHBA Stadium, or along the waterfront. One crew can cover your full program across Geelong."},{q:"How far in advance should we book for an event at Nyaal Banyul?",a:"As early as you can \u2014 as Geelong\u2019s first purpose-built convention centre, Nyaal Banyul\u2019s calendar is filling quickly. We recommend locking in photography and video as soon as your venue dates are confirmed. Get a free quote and we\u2019ll hold your dates."}],services:{"event-photography":{slug:"event-photography",name:"Event Photography",shortName:"Event Photography",heroTitle:"Event",heroTitleAccent:"Photography",icon:"Camera",metaTitle:"Event Photographer at Nyaal Banyul Geelong (GCEC) | Turbo 360",metaDescription:"Event photographer at Nyaal Banyul Geelong (GCEC). Same-day delivery, AI attendee galleries, live photo streaming. 180+ 5\u2605 reviews.",keywords:["Nyaal Banyul photographer","Nyaal Banyul event photography","GCEC event photographer","Geelong Convention Centre photographer","Geelong Convention and Event Centre photography","conference photographer Nyaal Banyul"],intro:"Professional event photography for conferences, exhibitions, and gala events at Nyaal Banyul Geelong Convention and Event Centre. Same-day edited delivery, AI attendee galleries, and a local crew that knows the venue\u2019s theatre, halls, and waterfront light.",cardBlurb:"Same-day edited photos, AI face-match attendee galleries, live photo streaming to venue screens, and full theatre-to-foyer coverage from a stills crew based minutes from the venue.",portfolioNote:"From conferences and exhibitions across Victoria \u2014 the same stills crews and same-day gallery pipeline, now available at",venueNarrative:"From a photographer's point of view, Nyaal Banyul is one of the best-equipped rooms in Victoria: a 1,000-seat theatre with modern stage lighting that flatters speakers, divisible halls that hold clean sightlines even at full exhibition build, and bay-facing foyers that deliver soft natural light all day. It's also our home-ground venue \u2014 Turbo 360 is based minutes away on the Bellarine \u2014 so the crew ph
1otographing your event already knows where the light falls at every hour.",logisticsNote:"Stills crews travel light: roaming camera kits, silent shutters, no cabling, no rigging. We arrive before your first delegate, and being minutes from Geelong means no travel surcharges and easy multi-day coverage.",images:{hero:"/images/services/locations/conference-auditorium-wide.jpg",gallery:["/images/services/locations/conference-speaker-podium.jpg","/images/services/locations/exhibition-floor-networking.jpg","/images/services/locations/corporate-event-guests.jpg"]},features:[{title:"Same-Day Photo Delivery",description:"Edited, colour-graded images delivered within hours \u2014 share keynote highlights from Nyaal Banyul while your delegates are still on-site.",icon:"Clock"},{title:"AI Face-Match Galleries",description:"AI-powered Smart Galleries match photos to registered attendees automatically. Every delegate at your Nyaal Banyul event receives a personalised gallery link.",icon:"Eye"},{title:"Live Photo Streaming",description:"Photos appear on screens throughout the venue in real time \u2014 perfect for the exhibition halls and foyer screens, with sponsor branding alongside.",icon:"Radio"},{title:"Theatre & Keynote Coverage",description:"Multi-angle coverage of the 1,000-seat theatre: stage wides, speaker close-ups, and audience reactions without disrupting the room.",icon:"Monitor"},{title:"Exhibition Floor Coverage",description:"Booth-by-booth exhibitor photography across the 3,700 m\xb2 halls \u2014 every sponsor gets their moment, every activation gets documented.",icon:"Building"},{title:"Hourly Social Reels",description:"For every hour on-site we can deliver a fully edited vertical reel optimised for Instagram, TikTok, YouTube Shorts, and LinkedIn.",icon:"Share2"}],faqs:[{q:"Do you know Nyaal Banyul\u2019s event spaces?",a:"Yes. We\u2019ve mapped coverage plans for the venue\u2019s 1,000-seat theatre, exhibition halls, meeting rooms, banquet spaces, and the bay-facing foyers \u2014 including angles, lighting, and where the best natural light falls. We\u2019re based minutes from Geelong, so this is our home-ground venue."},{q:"Can you deliver photos the same day at Nyaal Banyul (GCEC)?",a:"Yes \u2014 same-day delivery is our standard. Edited, colour-graded images are delivered within hours of capture, and we can run live photo streaming to venue screens during your event."},{q:"How much does event photography at Nyaal Banyul cost?",a:"Pricing depends on hours of coverage, crew size, and deliverables. Most bookings start from a half-day rate, and because we\u2019re local to Geelong there are no travel surcharges for Nyaal Banyul events. Request a free quote for an exact figure."},{q:"Can you photograph our exhibition booths and sponsors as well as the conference sessions?",a:"Yes. A typical Nyaal Banyul conference package covers keynotes and breakouts plus scheduled booth-by-booth exhibitor and sponsor coverage across the halls, networking candids, and staged sponsor-banner shots."},{q:"Do you also cover gala dinners and awards nights at the venue?",a:"Absolutely \u2014 banquet and awards coverage is a specialty. We shoot ambient-first in low light to preserve the room design, capture every award presentation, and can deliver winner photos the same night."},{q:"Is Turbo 360 affiliated with Nyaal Banyul?",a:"No \u2014 we\u2019re an independent photography and video supplier, fully insured, and we coordinate directly with venue operations on access and load-in for a seamless event day."}]},"video-production":{slug:"video-production",name:"Video Production",shortName:"Video Production",heroTitle:"Video",heroTitleAccent:"Production",icon:"Video",metaTitle:"Video Production at Nyaal Banyul Geelong (GCEC) | Turbo 360",metaDescription:"Event video production at Nyaal Banyul Geelong (GCEC): multi-camera capture, live streaming, same-day highlight reels. 180+ 5\u2605 reviews.",keywords:["Nyaal Banyul videographer","Nyaal Banyul video production","GCEC video production","Geelong Convention Centre videographer","Geelong Convention and Event Centre video","conference video production Geelong"],intro:"Full event video production at Nyaal Banyul Geelong Convention and Event Centre \u2014 multi-camera keynote capture, live streaming and hybrid delivery, and same-day highlight reels cut while your event is still running.",cardBlurb:"Multi-camera keynote capture, live streaming for hybrid audiences, and highlight reels edited on-site \u2014 broadcast-quality production without the Melbourne travel bill.",portfolioNote:"Multi-camera productions and event films from across Victoria \u2014 the same directors and edit pipeline, now available at",venueNarrative:"For a video crew, a purpose-built 2026 venue changes everything: house AV with clean audio feed access in the theatre, hall infrastru
1cture that supports multi-camera and streaming rigs, meeting rooms designed for concurrent session capture, and water-view glass that doubles as a broadcast-quality interview backdrop. We coordinate directly with the venue's technical team, and our editors can cut on-site \u2014 so content ships while your event is still live.",logisticsNote:"Video takes more coordination than stills, and we own all of it: camera positions, desk audio feeds, and streaming bandwidth are confirmed with venue operations before event day. Kit and crew are minutes away, so late program changes never derail coverage.",images:{hero:"/images/services/locations/event-coverage-plenary.jpg",gallery:["/images/services/locations/event-coverage-keynote.jpg","/images/services/locations/event-coverage-plenary.jpg","/images/services/locations/conference-panel-discussion.jpg"]},features:[{title:"Multi-Camera Production",description:"Two to six camera setups across the 1,000-seat theatre and breakout rooms, vision-switched live or edited in post.",icon:"Video"},{title:"Presentation Capture",description:"Full keynote and session recording with synchronised slide integration and a clean audio feed from the venue desk \u2014 a polished content library from every session.",icon:"Monitor"},{title:"Live Streaming & Hybrid",description:"Broadcast your Nyaal Banyul plenary to remote delegates with professional live streaming \u2014 multi-camera, lower thirds, sponsor loops, and Q&A integration.",icon:"Radio"},{title:"Same-Day Highlight Reels",description:"A cut-down highlight of day one playing at day two\u2019s opening \u2014 our editors work on-site so your content lands while it matters.",icon:"Clock"},{title:"Social Media Reels",description:"Vertical, platform-native reels delivered hourly for Instagram, TikTok, YouTube Shorts, and LinkedIn \u2014 captioned and branded.",icon:"Share2"},{title:"Sponsor & Marketing Content",description:"Dedicated sponsor shout-out videos, exhibitor interviews on the hall floor, and post-event marketing cuts that sell next year\u2019s tickets.",icon:"Target"}],faqs:[{q:"Can you live stream from Nyaal Banyul\u2019s theatre?",a:"Yes. We bring broadcast-grade streaming kits and coordinate with the venue\u2019s AV team for audio feeds and connectivity, delivering multi-camera streams with lower thirds, sponsor loops, and remote Q&A for hybrid events."},{q:"How quickly can we get a highlight video from our Nyaal Banyul event?",a:"Same day. Our editors can work on-site, so a highlight reel of day one can screen at day two\u2019s opening session \u2014 and social cuts can go out hourly during the event."},{q:"Do you record every breakout session or just the keynotes?",a:"Whatever your program needs. We scale from a single-camera plenary capture to full multi-room coverage of every concurrent session across Nyaal Banyul\u2019s meeting rooms, each with slide sync and clean audio."},{q:"How much does event video production at Nyaal Banyul (GCEC) cost?",a:"It depends on cameras, streaming, and edit deliverables. Single-camera capture starts from a half-day rate; full multi-cam hybrid productions are quoted per program. We\u2019re local to Geelong, so there are no travel surcharges \u2014 request a free quote."},{q:"Can you combine video with event photography in one booking?",a:"Yes \u2014 most clients book one integrated crew for both. One point of contact, one contract, and photo + video teams that already work together and share the same same-day delivery pipeline."},{q:"What do we need to arrange with the venue for filming?",a:"Very little \u2014 we handle it. We coordinate directly with Nyaal Banyul\u2019s operations and AV teams on access, rigging positions, audio feeds, and bandwidth for streaming, and we carry full public liability insurance."}]}}}},vN=(Object.keys(yN),e=>yN[e]),jN={"event-photography":Ue.A,"video-production":Ge.A},wN=()=>{const{venueSlug:e}=(0,r.g)(),t=vN(e);if(!t)return(0,f.jsx)(r.C5,{to:"/services",replace:!0});const s=(0,L.KM)(t.citySlug),a="https://turbo.net.au",n="/venues/".concat(t.slug),i=Object.values(t.services),o={"@type":"Place",name:t.fullName,alternateName:t.aka,address:{"@type":"PostalAddress",streetAddress:t.address.street,addressLocality:t.address.locality,addressRegion:t.address.region,postalCode:t.address.postcode,addressCountry:t.address.country},geo:{"@type":"GeoCoordinates",latitude:t.coordinates.lat,longitude:t.coordinates.lng}},l={"@context":"https://schema.org","@type":"Service",name:"Event Photography & Video Production at ".concat(t.fullName),description:t.hubMeta.description,serviceType:"Event Photography and Video Production",aggregateRating:Fw._I,provider:(0,Fw.YQ)(a),areaServed:o,offers:{"@type":"Offer",availability:"https://schema.org/InStock",priceRange:"$$"}},c={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"".concat(a,"/")},{"@type":"ListItem",position:2,name:"Services",item:"".concat(a,"/services")},{"@type":"ListItem",position:3,name:s?s.name:t.address.locality,item:"".concat(a,"/services/locations/").concat(t.citySlug)},{"@type":"ListItem",position:4,name:t.name}]};return(0,f.jsxs)(ae.mP,{children:[(0,f.jsx)(R.A,{rawTitle:t.hubMeta.title,de
1scription:t.hubMeta.description,keywords:t.hubMeta.keywords.join(", "),canonical:n,ogImage:"".concat(a).concat(t.heroImage),geo:{region:"AU-".concat(t.address.region),placename:t.address.locality},structuredData:[l,c]}),(0,f.jsx)(D.A,{}),(0,f.jsx)("div",{className:"relative z-20 border-b border-[#222] bg-carbon-900/60 backdrop-blur-sm",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-[22px] md:px-11 py-3",children:(0,f.jsx)(Nw.Qp,{children:(0,f.jsxs)(Nw.AB,{className:"font-mono text-[12px] uppercase tracking-[0.12em] text-fog",children:[(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/",className:"text-fog hover:text-turbo-red transition-colors",children:"Home"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#3a3a3a]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/services/locations/".concat(t.citySlug),className:"text-fog hover:text-turbo-red transition-colors",children:s?s.name:t.address.locality})})}),(0,f.jsx)(Nw.tH,{className:"text-[#3a3a3a]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.tJ,{className:"text-smoke",children:t.name})})]})})})}),(0,f.jsxs)("section",{className:"relative flex min-h-[78vh] items-end overflow-hidden bg-carbon-900",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:'url("'.concat(t.heroImage,'")')},children:(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.72) 0%,rgba(13,13,13,.5) 32%,rgba(13,13,13,.78) 70%,#0d0d0d 100%)"}})}),(0,f.jsxs)("div",{className:"relative z-10 mx-auto w-full max-w-7xl px-[22px] md:px-11 pb-16 md:pb-24 pt-28",children:[(0,f.jsxs)("div",{className:"mb-[26px] flex items-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsxs)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:[t.suburb,", ",t.address.region," \xb7 OPENED ",t.opened.toUpperCase()]})]}),(0,f.jsxs)("h1",{className:"m-0 font-display font-extrabold leading-[0.9] tracking-[-0.025em] text-smoke [text-wrap:balance]",children:[(0,f.jsx)("span",{className:"block text-[clamp(36px,6vw,92px)] text-smoke",children:"NYAAL BANYUL"}),(0,f.jsx)("span",{className:"block text-[clamp(24px,3.6vw,52px)] text-[#D9D6CF]",children:"GEELONG CONVENTION & EVENT CENTRE"}),(0,f.jsx)("span",{className:"block mt-2 text-[clamp(30px,4.8vw,68px)] text-turbo-red",children:"EVENT PHOTOGRAPHY & VIDEO"})]}),(0,f.jsx)("p",{className:"mt-[30px] max-w-[680px] text-[clamp(16px,1.4vw,20px)] leading-[1.6] text-[#D9D6CF]",children:"Same-day event photography and video production at Victoria's newest convention venue \u2014 also known as GCEC. A local Geelong crew that knows every space, from the 1,000-seat theatre to the waterfront foyers."}),(0,f.jsx)("div",{className:"mt-[38px] flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:(0,f.jsxs)(ae.$$,{to:"/get-quote",children:["Get your quote ",(0,f.jsx)(S.A,{className:"h-5 w-5"})]})})]})]}),(0,f.jsx)("div",{className:"border-b border-[#222] bg-carbon-900",children:(0,f.jsx)("div",{className:"mx-auto grid max-w-7xl grid-cols-2 gap-px md:grid-cols-4",children:t.stats.map((e,t)=>(0,f.jsxs)("div",{className:"px-[22px] py-7 text-center md:px-11",children:[(0,f.jsx)("div",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fog",children:e.label}),(0,f.jsx)("div",{className:"mt-1 font-head text-xl font-bold text-smoke",children:e.value})]},t))})}),(0,f.jsxs)(ae.wn,{tone:"carbon",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / The venue"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["GEELONG'S NEW ",(0,f.jsx)("span",{className:"text-turbo-red",children:"HOME OF EVENTS"})]}),(0,f.jsx)("p",{className:"m-0 mt-6 max-w-3xl text-[17px] leading-[1.6] text-[#C7C4BD]",children:t.about}),(0,f.jsxs)("p",{className:"m-0 mt-5 max-w-3xl text-[15px] leading-[1.6] text-[#9C9A95]",children:[(0,f.jsx)(fN.A,{className:"mr-2 inline h-4 w-4 text-turbo-red"}),t.nameMeaning]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-3",children:t.spaces.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"group h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-[30px] transition-colors duration-300 hover:border-turbo-red",children:[(0,f.jsx)("p",{className:"mb-2 font-mono text-[11px] uppercase tracking-[0.15em] text-turbo-red",children:e.type}),(0,f.jsx)("h3",{className:"mb-3 font-head text-xl font-bold text-smoke",children:e.name}),(0,f.jsx)("p",{className:"m-0 mb-4 text-[14.5px] leading-[1.6] text-[#9C9A95]",children:e.description}),(0,f.jsxs)("p",{className:"m-0 border-t border-[#262626] pt-4 text-[13.5px] leading-[1.6] text-[#C7C4BD]",children:[(0,f.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-[0.15em] text-fog",children:"How we shoot it \u2014 "}),e.howWeShoot]})]})},t))})]}),(0,f.jsxs)(ae.wn,{tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"02 / Our services here"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(34px,4.6vw,64px)]",children:["AVAILABLE AT ",(0,f.jsx)("span",{className:"text-turbo-red",children:t.name.toUpperCase()})]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2",children:i.map((e,s)=>{const a=jN[e.slug]||Ue.A;return(0,f.jsx)(ae.gN,{delay:80*s,children:(0,f.jsxs)(r.N_,{to:"/venues/".concat(t.slug,"/").concat(e.slug),className:"group block h-full overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] transition-colors hover:border-turbo-red",children:[(0,f.jsxs)("div",{className:"relative h-52 overflow-hidden",children:[(0,f.jsx)("img",{src:e.images.hero,alt:"".concat(e.name," available at ").concat(t.fullName," \u2014 Turbo 360"),className:"h-full w-full object-cover transition-transform duration-700 ease-turbo group-hover:scale-[1.06]",loading:"lazy"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 40%,rgba(13,13,13,.85))"}})]}),(0,f.jsxs)("div",{className:"p-[30px]",children:[(0,f.jsx)("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-turbo-red/15 text-turbo-red transition-colors duration-300 group-hover:bg-turbo-red group-hover:text-white",children:(0,f.jsx)(a,{className:"h-6 w-6"})}),(0,f.jsxs)("h3",{className:"mb-3 font-head text-2xl font-bold text-smoke transition-colors group-hover:text-turbo-red",children:[e.name," at ",t.name]}),(0,f.jsx)("p",{className:"m-0 mb-5 text-[14.5px] leading-[1.6] text-[#9C9A95]",children:e.cardBlurb||e.intro}),(0,f.jsxs)("span",{className:"inline-flex items-center font-head font-semibold text-turbo-red",children:["Explore ",e.shortName.toLowerCase()," ",(0,f.jsx)(S.A,{className:"ml-2 h-4 w-4 transition-transform group-hover:translate-x-1"})]})]})]})},e.slug)})})]}),(0,f.jsxs)(ae.wn,{tone:"carbon",children:[(0,f.jsxs)("div",{className:"grid gap-6 md:grid-cols-2",children:[(0,f.jsx)(ae.gN,{children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6",children:[(0,f.jsxs)("h3",{className:"mb-3 flex items-center font-head text-lg font-bold text-smoke",children:[(0,f.jsx)(C.A,{className:"mr-2 h-5 w-5 text-turbo-red"}),"Getting there & logistics"]}),(0,f.jsx)("p",{className:"m-0 text-sm leading-[1.7] text-[#9C9A95]",children:t.logistics})]})}),(0,f.jsx)(ae.gN,{delay:80,children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6",children:[(0,f.jsxs)("h3",{className:"mb-3 flex items-center font-head text-lg font-bold text-smoke",children:[(0,f.jsx)(Nt.A,{className:"mr-2 h-5 w-5 text-turbo-red"}),"Book early \u2014 this venue is new"]}),(0,f.jsxs)("p",{className:"m-0 text-sm leading-[1.7] text-[#9C9A95]",children:["Nyaal Banyul opened in ",t.opened," and its calendar is filling fast with conferences, exhibitions, and gala events. Lock in your photography and video crew as soon as your dates are confirmed \u2014 we're based minutes away on the Bellarine Peninsula, and we hold dates from the moment you enquire."]})]})})]}),s&&(0,f.jsxs)(ae.gN,{className:"mt-12",children:[(0,f.jsxs)("h3",{className:"mb-5 font-head text-xl font-bold text-smoke",children:["More event services in ",s.name]}),(0,f.jsxs)("div",{className:"grid gap-2.5 md:grid-cols-2",children:[(0,f.jsxs)(r.N_,{to:"/services/locations/".concat(t.citySlug),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:["All services in ",s.name]})]}),(0,f.jsxs)(r.N_,{to:"/services/conference-photography/".concat(t.citySlug),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:["Conference Photography in ",s.name]})]}),(0,f.jsxs)(r.N_,{to:"/services/exhibition-photography/".concat(t.citySlug),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:["Exhibition Photography in ",s.name]})]}),(0,f.jsxs)(r.N_,{to:"/services/corporate-event-photography/".concat(t.citySlug),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:["Corporate Event Photography in ",s.name]})]})]})]})]}),(0,f.jsx)(Tw.A,{faqs:t.hubFaqs}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] bg-turbo-red px-[22px] py-[90px] md:px-11",children:[(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"","aria-hidden":!0,
1className:"pointer-events-none absolute right-[-70px] top-1/2 hidden w-[380px] -translate-y-1/2 -rotate-[8deg] opacity-10 md:block"}),(0,f.jsxs)("div",{className:"relative z-[2] mx-auto grid max-w-6xl items-center gap-12 md:grid-cols-2",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)("h2",{className:"mb-6 font-display text-[clamp(36px,4.6vw,68px)] font-extrabold leading-[0.94] tracking-[-0.025em] text-white",children:"BOOKING AN EVENT AT NYAAL BANYUL?"}),(0,f.jsx)("p",{className:"mb-8 max-w-[520px] text-[clamp(16px,1.5vw,19px)] leading-[1.6] text-white/90",children:"Tell us about your event and we'll send a tailored photography and video quote \u2014 usually within two hours."}),(0,f.jsxs)("div",{className:"grid gap-6 text-left sm:grid-cols-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"mb-1 font-mono text-[11px] uppercase tracking-[0.2em] text-white/80",children:"CALL NOW"}),(0,f.jsx)("p",{className:"font-head text-lg font-bold text-white",children:"1300 207 446"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"mb-1 font-mono text-[11px] uppercase tracking-[0.2em] text-white/80",children:"EMAIL"}),(0,f.jsx)("p",{className:"font-head text-lg font-bold text-white",children:"[email protected]"})]})]})]}),(0,f.jsx)(ae.gN,{delay:80,children:(0,f.jsxs)("div",{className:"rounded-[14px] bg-white p-6 shadow-2xl md:p-8",children:[(0,f.jsx)("h3",{className:"mb-1 font-head text-xl font-bold text-gray-900",children:"Get Your Free Quote"}),(0,f.jsxs)("p",{className:"mb-5 text-sm text-gray-500",children:["Photography & video at ",t.name]}),(0,f.jsx)(bN.A,{eventTypes:["Conference","Exhibition / Trade Show","Gala Dinner / Awards Night","Corporate Event","Concert / Entertainment","Other"],source:"Venue page \u2014 ".concat(t.fullName),location:"".concat(t.name,", ").concat(t.address.locality)})]})})]})]}),(0,f.jsx)("div",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-6 md:px-11",children:(0,f.jsx)("p",{className:"mx-auto max-w-7xl text-center font-mono text-[11px] leading-[1.7] text-fog",children:t.disclaimer})}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})},NN={Camera:Ue.A,Video:Ge.A,Clock:Nt.A,Eye:_.A,Share2:at.A,Monitor:Da.A,Radio:Ve.A,Target:tt.A,Building:Ke.A},AN=()=>{const{venueSlug:e,serviceSlug:t}=(0,r.g)(),s=vN(e),a=((e,t)=>{var s,a;return null===(s=yN[e])||void 0===s||null===(a=s.services)||void 0===a?void 0:a[t]})(e,t);if(!s||!a)return(0,f.jsx)(r.C5,{to:"/services",replace:!0});const n=(0,L.KM)(s.citySlug),i="https://turbo.net.au",o="/venues/".concat(s.slug,"/").concat(a.slug),l=Object.values(s.services).filter(e=>e.slug!==a.slug),c={"@type":"Place",name:s.fullName,alternateName:s.aka,address:{"@type":"PostalAddress",streetAddress:s.address.street,addressLocality:s.address.locality,addressRegion:s.address.region,postalCode:s.address.postcode,addressCountry:s.address.country},geo:{"@type":"GeoCoordinates",latitude:s.coordinates.lat,longitude:s.coordinates.lng}},d={"@context":"https://schema.org","@type":"Service",name:"".concat(a.name," at ").concat(s.fullName),description:a.metaDescription,serviceType:"".concat(a.name),aggregateRating:Fw._I,provider:(0,Fw.YQ)(i),areaServed:c,offers:{"@type":"Offer",availability:"https://schema.org/InStock",priceRange:"$$"}},m={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"".concat(i,"/")},{"@type":"ListItem",position:2,name:n?n.name:s.address.locality,item:"".concat(i,"/services/locations/").concat(s.citySlug)},{"@type":"ListItem",position:3,name:s.name,item:"".concat(i,"/venues/").concat(s.slug)},{"@type":"ListItem",position:4,name:a.name}]};return(0,f.jsxs)(ae.mP,{children:[(0,f.jsx)(R.A,{rawTitle:a.metaTitle,description:a.metaDescription,keywords:a.keywords.join(", "),canonical:o,ogImage:"".concat(i).concat(a.images.hero),geo:{region:"AU-".concat(s.address.region),placename:s.address.locality},structuredData:[d,m]}),(0,f.jsx)(D.A,{}),(0,f.jsx)("div",{className:"relative z-20 border-b border-[#222] bg-carbon-900/60 backdrop-blur-sm",children:(0,f.jsx)("div",{className:"max-w-7xl mx-auto px-[22px] md:px-11 py-3",children:(0,f.jsx)(Nw.Qp,{children:(0,f.jsxs)(Nw.AB,{className:"font-mono text-[12px] uppercase tracking-[0.12em] text-fog",children:[(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/",className:"text-fog hover:text-turbo-red transition-colors",children:"Home"})})}),(0,f.jsx)(Nw.tH,{className:"text-[#3a3a3a]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.w1,{asChild:!0,children:(0,f.jsx)(r.N_,{to:"/venues/".concat(s.slug),className:"text-fog hover:text-turbo-red transition-colors",children:s.name})})}),(0,f.jsx)(Nw.tH,{className:"text-[#3a3a3a]"}),(0,f.jsx)(Nw.J5,{children:(0,f.jsx)(Nw.tJ,{className:"text-smoke",children:a.name})})]})})})}),(0,f.jsxs)("section",{className:"relative flex min-h-[78vh] items-end overflow-hidden bg-carbon-900",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-cover bg-center",style:{backgroundImage:'url("'.concat(a.images.hero,'")')},children:(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,rgba(13,13,13,.72) 0%,rgba(13,13,13,.5) 32%,rgba(13,13,13,.78) 70%,#0d0d0d 100%)"}})}),(0,f.jsxs)("div",{className:"relative z-10 mx-auto w-full max-w-7xl px-[22px] md:px-11 pb-16 md:pb-24 pt-28",children:[(0,f.jsxs)("div",{className:"mb-[26px] flex items-center gap-3",children:[(0,f.jsx)("span",{className:"h-2 w-2 animate-ping-soft rounded-full bg-turbo-red"}),(0,f.jsx)("span",{className:"font-mono text-xs uppercase tracking-[0.3em] text-smoke",children:s.fullName.toUpperCase()})]}),(0,f.jsx)(Xw,{className:"m-0 font-display font-extrabold uppercase leading-[0.9] tracking-[-0.025em] text-smoke [text-wrap:balance]",lines:[{text:a.heroTitle,className:"block text-[clamp(40px,7vw,104px)] text-smoke"},{text:a.heroTitleAccent,className:"block text-[clamp(40px,7vw,104px)] text-turbo-red"},{text:"At Nyaal Banyul, Geelong",className:"block mt-2 text-[clamp(26px,4.2vw,58px)] text-[#D9D6CF]"}]}),(0,f.jsx)("p",{className:"mt-[30px] max-w-[640px] text-[clamp(16px,1.4vw,20px)] leading-[1.6] text-[#D9D6CF]",children:a.intro}),(0,f.jsx)("div",{className:"mt-[38px] flex flex-col items-stretch gap-4 sm:flex-row sm:items-center",children:(0,f.jsxs)(ae.$$,{to:"/get-quote",children:["Get your quote ",(0,f.jsx)(S.A,{className:"h-5 w-5"})]})})]})]}),(0,f.jsxs)(ae.wn,{tone:"carbon",children:[(0,f.jsxs)(ae.gN,{className:"mb-14",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"01 / What we offer"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:[a.short
1Name," services"]}),(0,f.jsxs)("p",{className:"m-0 mt-5 max-w-[640px] text-[17px] leading-[1.6] text-[#9C9A95]",children:["at ",s.fullName," \u2014 also known as GCEC"]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-3",children:a.features.map((e,t)=>{const s=NN[e.icon]||Ue.A;return(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"group h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-[30px] transition-colors duration-300 hover:border-turbo-red",children:[(0,f.jsx)("div",{className:"mb-5 flex h-12 w-12 items-center justify-center rounded-lg bg-turbo-red/15 text-turbo-red transition-colors duration-300 group-hover:bg-turbo-red group-hover:text-white",children:(0,f.jsx)(s,{className:"h-6 w-6"})}),(0,f.jsx)("h3",{className:"mb-3 font-head text-xl font-bold text-smoke transition-colors group-hover:text-turbo-red",children:e.title}),(0,f.jsx)("p",{className:"m-0 text-[14.5px] leading-[1.6] text-[#9C9A95]",children:e.description})]})},t)})})]}),(0,f.jsxs)(ae.wn,{tone:"carbon-900",children:[(0,f.jsxs)(ae.gN,{className:"mb-12",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"02 / Our work"}),(0,f.jsx)(ae.nl,{className:"text-[clamp(34px,4.6vw,64px)]",children:"Recent portfolio"}),(0,f.jsxs)("p",{className:"m-0 mt-5 max-w-[640px] text-[15px] leading-[1.6] text-[#9C9A95]",children:[a.portfolioNote," ",s.name,"."]})]}),(0,f.jsx)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-3",children:a.images.gallery.map((e,t)=>(0,f.jsx)(ae.gN,{delay:t%3*80,children:(0,f.jsxs)("div",{className:"group relative overflow-hidden rounded-[10px] border border-[#262626] transition-colors hover:border-turbo-red",children:[(0,f.jsx)("img",{src:e,alt:"".concat(a.shortName," by Turbo 360 \u2014 available at ").concat(s.fullName,"
1(").concat(t+1,")"),className:"h-64 w-full object-cover transition-transform duration-700 ease-turbo group-hover:scale-[1.06]",loading:"lazy"}),(0,f.jsx)("div",{className:"pointer-events-none absolute inset-0",style:{background:"linear-gradient(180deg,transparent 55%,rgba(13,13,13,.7))"}})]})},t))})]}),(0,f.jsxs)(ae.wn,{tone:"carbon",children:[(0,f.jsxs)(ae.gN,{className:"mb-14",children:[(0,f.jsx)(ae.YZ,{className:"mb-[18px]",children:"03 / Venue knowledge"}),(0,f.jsxs)(ae.nl,{className:"text-[clamp(38px,5.2vw,72px)]",children:["WE KNOW ",(0,f.jsx)("span",{className:"text-turbo-red",children:s.name.toUpperCase()})]}),(0,f.jsx)("p",{className:"m-0 mt-6 max-w-3xl text-[17px] leading-[1.6] text-[#C7C4BD]",children:a.venueNarrative})]}),(0,f.jsxs)("div",{className:"grid grid-cols-1 gap-[22px] md:grid-cols-2 lg:grid-cols-3",children:[s.spaces.map((e,t)=>{var s;return(0,f.jsx)(ae.gN,{delay:t%3*60,children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6 transition-colors hover:border-turbo-red",children:[(0,f.jsx)("p",{className:"mb-1 font-mono text-[11px] uppercase tracking-[0.15em] text-turbo-red",children:e.type}),(0,f.jsx)("h3",{className:"mb-2 font-head font-bold text-smoke",children:e.name}),(0,f.jsx)("p",{className:"m-0 text-sm leading-[1.6] text-[#9C9A95]",children:(null===(s=e.serviceNotes)||void 0===s?void 0:s[a.slug])||e.howWeShoot})]})},t)}),(0,f.jsx)(ae.gN,{delay:120,children:(0,f.jsxs)("div",{className:"h-full rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-6",children:[(0,f.jsx)("p",{className:"mb-1 font-mono text-[11px] uppercase tracking-[0.15em] text-turbo-red",children:"Logistics"}),(0,f.jsxs)("h3",{className:"mb-2 flex items-center font-head font-bold text-smoke",children:[(0,f.jsx)(C.A,{className:"mr-2 h-4 w-4 text-turbo-red"})," Access & load-in"]}),(0,f.jsx)("p",{className:"m-0 text-sm leading-[1.6] text-[#9C9A95]",children:a.logisticsNote})]})})]})]}),(0,f.jsx)(ae.wn,{tone:"carbon-900",children:(0,f.jsxs)("div",{className:"grid md:grid-cols-2 gap-12",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsxs)("h3",{className:"mb-5 font-head text-xl font-bold text-smoke",children:["More at ",s.name]}),(0,f.jsxs)("div",{className:"space-y-2.5",children:[l.map(e=>(0,f.jsxs)(r.N_,{to:"/venues/".concat(s.slug,"/").concat(e.slug),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:[e.name," at ",s.name]})]},e.slug)),(0,f.jsxs)(r.N_,{to:"/venues/".concat(s.slug),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:["About ",s.fullName]})]})]})]}),n&&(0,f.jsxs)(ae.gN,{delay:80,children:[(0,f.jsxs)("h3",{className:"mb-5 font-head text-xl font-bold text-smoke",children:["Event services in ",n.name]}),(0,f.jsxs)("div",{className:"space-y-2.5",children:[["conference-photography","exhibition-photography","corporate-event-photography"].map(e=>{const t=_w(e);return t?(0,f.jsxs)(r.N_,{to:"/services/".concat(e,"/").concat(s.citySlug),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(C.A,{className:"mr-3 h-4 w-4 text-turbo-red"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:[t.shortName," in ",n.name]})]},e):null}),(0,f.jsxs)(r.N_,{to:"/services/locations/".concat(s.citySlug),className:"group flex items-center rounded-[10px] border border-[#262626] bg-[#1A1A1A] p-3.5 transition-colors hover:border-turbo-red",children:[(0,f.jsx)(S.A,{className:"mr-3 h-4 w-4 text-turbo-red transition-transform group-hover:translate-x-1"}),(0,f.jsxs)("span",{className:"text-[#C7C4BD] transition-colors group-hover:text-smoke",children:["All services in ",n.name]})]})]})]})]})}),(0,f.jsx)(Tw.A,{faqs:a.faqs}),(0,f.jsxs)("section",{className:"relative overflow-hidden border-t border-[#222] bg-turbo-red px-[22px] py-[90px] md:px-11",children:[(0,f.jsx)("img",{src:"/turbo-mark-white.png",alt:"","aria-hidden":!0,
1className:"pointer-events-none absolute right-[-70px] top-1/2 hidden w-[380px] -translate-y-1/2 -rotate-[8deg] opacity-10 md:block"}),(0,f.jsxs)("div",{className:"relative z-[2] mx-auto grid max-w-6xl items-center gap-12 md:grid-cols-2",children:[(0,f.jsxs)(ae.gN,{children:[(0,f.jsx)("h2",{className:"mb-6 font-display text-[clamp(36px,4.6vw,68px)] font-extrabold leading-[0.94] tracking-[-0.025em] text-white",children:"READY FOR TURBO SPEED?"}),(0,f.jsxs)("p",{className:"mb-8 max-w-[520px] text-[clamp(16px,1.5vw,19px)] leading-[1.6] text-white/90",children:["Same-day ",a.shortName.toLowerCase()," at ",s.name," that keeps your event momentum alive. Tell us your dates and we'll quote within two hours."]}),(0,f.jsxs)("div",{className:"grid gap-6 text-left sm:grid-cols-2",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"mb-1 font-mono text-[11px] uppercase tracking-[0.2em] text-white/80",children:"CALL NOW"}),(0,f.jsx)("p",{className:"font-head text-lg font-bold text-white",children:"1300 207 446"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h4",{className:"mb-1 font-mono text-[11px] uppercase tracking-[0.2em] text-white/80",children:"EMAIL"}),(0,f.jsx)("p",{className:"font-head text-lg font-bold text-white",children:"[email protected]"})]})]})]}),(0,f.jsx)(ae.gN,{delay:80,children:(0,f.jsxs)("div",{className:"rounded-[14px] bg-white p-6 shadow-2xl md:p-8",children:[(0,f.jsx)("h3",{className:"mb-1 font-head text-xl font-bold text-gray-900",children:"Get Your Free Quote"}),(0,f.jsxs)("p",{className:"mb-5 text-sm text-gray-500",children:[a.name," at ",s.name]}),(0,f.jsx)(bN.A,{eventTypes:["Conference","Exhibition / Trade Show","Gala Dinner / Awards Night","Corporate Event","Concert / Entertainment","Other"],source:"Venue page \u2014 ".concat(a.name," at ").concat(s.fullName),location:"".concat(s.name,", ").concat(s.address.locality)})]})})]})]}),(0,f.jsx)("div",{className:"border-t border-[#222] bg-carbon-900 px-[22px] py-6 md:px-11",children:(0,f.jsx)("p",{className:"mx-auto max-w-7xl text-center font-mono text-[11px] leading-[1.7] text-fog",children:s.disclaimer})}),(0,f.jsx)(B.A,{}),(0,f.jsx)(z.A,{})]})};const kN=function(e){let{children:t}=e;const s=(0,r.zy)(),a=(0,r.Zp)(),n=[{icon:yn.A,label:"Home",path:"/webmanagement"},{icon:ms.A,label:"Leads",path:"/webmanagement/leads"},{icon:kt.A,label:"Proposals",path:"/webmanagement/proposals"},{icon:Xe.A,label:"Clients",path:"/webmanagement/clients"},{icon:cs.A,label:"More",path:"/webmanagement/more"}];return(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsx)("div",{className:"pb-20",children:t}),(0,f.jsx)("nav",{className:"fixed bottom-0 left-0 right-0 bg-slate-800/95 backdrop-blur-lg border-t border-slate-700/50 z-50 shadow-2xl",children:(0,f.jsx)("div",{className:"flex items-center justify-around",children:n.map(e=>{const t=e.icon,n="/webmanagement"===(r=e.path)?s.pathname===r:s.pathname.startsWith(r);var r;return(0,f.jsxs)("button",{onClick:()=>a(e.path),className:"flex-1 flex flex-col items-center py-3 px-2 transition-all duration-200 ".concat(n?"text-purple-400":"text-gray-400 active:text-purple-300"),children:[(0,f.jsxs)("div",{className:"relative ".concat(n?"transform -translate-y-1":""),children:[(0,f.jsx)(t,{className:"w-6 h-6 mb-1 ".concat(n?"stroke-2":"stroke-1.5")}),n&&(0,f.jsx)("div",{className:"absolute -bottom-2 left-1/2 -translate-x-1/2 w-1 h-1 bg-purple-400 rounded-full"})]}),(0,f.jsx)("span",{className:"text-xs ".concat(n?"font-semibold":"font-normal"),children:e.label})]},e.path)})})})]})};const SN=function(e){let{notifications:t,onClose:s,onDismiss:a}=e;const n=(0,r.Zp)();if(!t||0===t.length)return null;const i=e=>{switch(e){case"new_lead":return"\ud83d\udd14";case"new_proposal":return"\ud83d\udcc4";case"proposal_accepted":return"\ud83c\udf89";case"new_invoice":return"\ud83d\udcb0";default:return"\ud83d\udcec"}},o=e=>{switch(e){case"new_lead":return"from-orange-500 to-red-500";case"new_proposal":return"from-purple-500 to-pink-500";case"proposal_accepted":return"from-green-500 to-emerald-500";case"new_invoice":return"from-blue-500 to-cyan-500";default:return"from-gray-500 to-slate-500"}};return(0,f.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:s}),(0,f.jsxs)("div",{className:"relative bg-slate-800 rounded-t-3xl sm:rounded-3xl w-full sm:max-w-md max-h-[80vh] flex flex-col shadow-2xl",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-slate-700",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-white",children:"New Notifications"}),(0,f.jsxs)("p",{className:"text-sm text-gray-400",children:[t.length," new items"]})]}),(0,f.jsx)("button",{onClick:s,className:"p-2 hover:bg-slate-700 rounded-full transition-colors",children:(0,f.jsx)(g.A,{className:"w-5 h-5 text-gray-400"})})]}),(0,f.jsx)("div",{className:"flex-1 overflow-y-auto p-4 space-y-3",children:t.map(e=>(0,f.jsx)("div",{onClick:()=>(e=>{e.link&&(n(e.link),a(e.id))})(e),className:"bg-slate-900 rounded-xl p-4 cursor-pointer active:scale-95 transition-all",children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("div",{className:"bg-gradient-to-br ".concat(o(e.type)," p-3 rounded-xl flex-shrink-0"),children:(0,f.jsx)("span",{className:"text-2xl",children:i(e.type)})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("h3",{className:"font-semibold text-white mb-1",children:e.title}),(0,f.jsx)("p",{className:"text-sm text-gray-400 mb-2",children:e.message}),(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("span",{className:"text-xs text-gray-500",children:new Date(e.timestamp).toLocaleStr
1ing("en-AU",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),e.link&&(0,f.jsx)(En.A,{className:"w-4 h-4 text-purple-400"})]})]})]})},e.id))}),(0,f.jsx)("div",{className:"p-4 border-t border-slate-700",children:(0,f.jsx)("button",{onClick:s,className:"w-full bg-gradient-to-r from-purple-600 to-indigo-600 text-white py-3 rounded-xl font-semibold hover:from-purple-700 hover:to-indigo-700 transition-all",children:"Dismiss All"})})]})]})};const _N=function(e){let{children:t}=e;(0,r.zy)();const[s,n]=(0,a.useState)([]),[i,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)((new Date).toISOString());return(0,a.useEffect)(()=>{const e=async()=>{try{const e=(0,o.gf)();if(!e)return;const t=await fetch("".concat(I.JR,"/api/mobile/notifications?since=").concat(encodeURIComponent(c)),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json();e.notifications&&e.notifications.length>0&&(n(e.notifications),l(!0),d(e.checked_at))}}catch(e){console.error("Error checking notifications:",e)}};e();const t=setInterval(e,3e4);return()=>clearInterval(t)},[c]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(kN,{children:t}),i&&(0,f.jsx)(SN,{notifications:s,onClose:()=>{l(!1),n([]),d((new Date).toISOString())},onDismiss:e=>{n(s.filter(t=>t.id!==e)),s.length<=1&&l(!1)}})]})},CN=e=>{const t=e.replace(/-/g,"+").replace(/_/g,"/"),s="=".repeat((4-t.length%4)%4),a=atob(t+s),n=new Uint8Array(a.length);for(let r=0;r<a.length;r++)n[r]=a.charCodeAt(r);return n.buffer},FN=e=>{const t=new Uint8Array(e);let s="";for(let a=0;a<t.byteLength;a++)s+=String.fromCharCode(t[a]);return btoa(s).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")};const EN=function(e){let{children:t}=e;(0,r.Zp)(),(0,r.zy)();const[s,n]=(0,a.useState)(!0),[i,l]=(0,a.useState)(!1),[c,d]=(0,a.useState)(""),[p,x]=(0,a.useState)(""),[h,u]=(0,a.useState)(""),[g,b]=(0,a.useState)(!1),[y,v]=(0,a.useState)(!1),[j,w]=(0,a.useState)(!1);(0,a.useEffect)(()=>{(async()=>{(0,o.wR)()||l(!0),n(!1)})()},[]),(0,a.useEffect)(()=>{(async()=>{if(window.PublicKeyCredential)try{const e=await PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable();w(e)}catch(e){w(!1)}})()},[]);const N=async()=>{u(""),v(!0);try{const t=await fetch("".concat(I.JR,"/api/wedding-admin/passkey/auth-options"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:c||null})});if(!t.ok){const e=await t.json();throw new Error(e.detail||"Failed to get authentication options")}const s=await t.json();s.challenge=CN(s.challenge),s.allowCredentials&&(s.allowCredentials=s.allowCredentials.map(e=>(0,m.A)((0,m.A)({},e),{},{id:CN(e.id)})));const a=await navigator.credentials.get({publicKey:s}),n={id:a.id,rawId:FN(a.rawId),type:a.type,response:{authenticatorData:FN(a.response.authenticatorData),clientDataJSON:FN(a.response.clientDataJSON),signature:FN(a.response.signature),userHandle:a.response.userHandle?FN(a.response.userHandle):null}},r=await fetch("".concat(I.JR,"/api/wedding-admin/passkey/auth-verify"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({credential:n})}),i=await r.json();var e;if(r.ok&&i.token)localStorage.setItem("turbo360_admin_auth",JSON.stringify({token:i.token,email:null===(e=i.user)||void 0===e?void 0:e.email,loginTime:(new Date).toISOString(),expires:new Date(Date.now()+6048e5).toISOString()})),(0,o.WG)(i.token),l(!1),window.location.reload();else u(i.detail||i.message||"Passkey authentication failed")}catch(h){console.error("Passkey login error:",h),"NotAllowedError"===h.name?u("Passkey authentication was cancelled or timed out"):u(h.message||"Passkey authentication failed")}finally{v(!1)}},A=async e=>{e.preventDefault(),u(""),b(!0);try{const e=await fetch("".concat(I.JR,"/api/wedding-admin/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:c,password:p})}),t=await e.json();e.ok&&t.success?((0,o.WG)(t.token),l(!1),window.location.reload()):u(t.message||"Login failed. Please check your credentials.")}catch(t){console.error("Login error:",t),u("An error occurred. Please try again.")}finally{b(!1)}};return s?(0,f.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-purple-900/20 to-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-4 border-purple-500/30 border-t-purple-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-400",children:"Checking authentication..."})]})}):i?(0,f.jsxs)("div",{className:"min-h-screen relative overflow-hidden flex items-center justify-center p-6",children:[(0,f.jsxs)("div",{className:"absolute inset-0 z-0",children:[(0,f.jsx)("img",{src:"/mobile-hero-image.jpg",alt:"Professional photography",className:"w-full h-full object-cover"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-900/95 via-indigo-900/90 to-slate-900/95"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900 via-trans
1parent to-transparent"})]}),(0,f.jsxs)("div",{className:"w-full max-w-md relative z-10",children:[(0,f.jsxs)("div",{className:"text-center mb-8",children:[(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-20 w-auto mx-auto mb-6 brightness-0 invert drop-shadow-2xl"}),(0,f.jsx)("h1",{className:"text-3xl font-bold text-white mb-2 drop-shadow-lg",children:"Mobile Admin"}),(0,f.jsx)("p",{className:"text-purple-200",children:"Sign in to continue"})]}),(0,f.jsxs)("form",{onSubmit:A,className:"bg-white/10 backdrop-blur-xl rounded-2xl p-8 border border-white/20 shadow-2xl",children:[h&&(0,f.jsx)("div",{className:"mb-4 p-4 bg-red-500/20 backdrop-blur-sm border border-red-500/30 rounded-xl text-red-200 text-sm shadow-lg",children:h}),(0,f.jsxs)("div",{className:"mb-5",children:[(0,f.jsx)("label",{className:"block text-white text-sm font-semibold mb-2",children:"Email Address"}),(0,f.jsx)("input",{type:"email",value:c,onChange:e=>d(e.target.value),className:"w-full px-4 py-3 bg-slate-900/50 backdrop-blur-sm border border-white/20 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-purple-400 focus:border-transparent transition-all shadow-lg",placeholder:"[email protected]",required:!0})]}),(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("label",{className:"block text-white text-sm font-semibold mb-2",children:"Password"}),(0,f.jsx)("input",{type:"password",value:p,onChange:e=>x(e.target.value),className:"w-full px-4 py-3 bg-slate-900/50 backdrop-blur-sm border border-white/20 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-purple-400 focus:border-transparent transition-all shadow-lg",placeholder:"Enter your password",required:!0})]}),(0,f.jsx)("button",{type:"submit",disabled:g||y,className:"w-full bg-gradient-to-r from-purple-600 to-indigo-600 text-white py-4 rounded-xl font-bold text-lg hover:from-purple-700 hover:to-indigo-700 transition-all disabled:opacity-50 disabled:cursor-not-allowed shadow-2xl hover:shadow-purple-500/50 hover:scale-[1.02] active:scale-[0.98]",children:g?(0,f.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,f.jsxs)("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[(0,f.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,f.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Signing in..."]}):"Sign In"}),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"mt-6 flex items-center gap-4",children:[(0,f.jsx)("div",{className:"flex-1 h-px bg-white/20"}),(0,f.jsx)("span",{className:"text-purple-200 text-sm",children:"or"}),(0,f.jsx)("div",{className:"flex-1 h-px bg-white/20"})]}),(0,f.jsx)("button",{type:"button",onClick:N,disabled:g||y,className:"mt-6 w-full bg-gradient-to-r from-purple-500/20 to-indigo-500/20 hover:from-purple-500/30 hover:to-indigo-500/30 border border-purple-400/30 hover:border-purple-400/50 text-white font-bold py-4 rounded-xl transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-3 backdrop-blur-sm",children:y?(0,f.jsxs)("span",{className:"flex items-center gap-2",children:[(0,f.jsxs)("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[(0,f.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,f.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Authenticating..."]}):(0,f.jsxs)("span",{className:"flex items-center gap-2",children:[(0,f.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-purple-400",children:[(0,f.jsx)("path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02.76 2 2 2 1.02 0 2-.76 2-2 0-1.02-1-2-2-2z"}),(0,f.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"})]}),"Sign in with Passkey",(0,f.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-purple-400",children:(0,f.jsx)("path",{d:"m21 2-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0 3 3L22 7l-3-3m-3.5 3.5L19 4"})})]})})]}),(0,f.jsx)("p",{className:"mt-6 text-center text-purple-200 text-sm",children:"Use your Turbo 360 admin credentials"})]})]})]}):t};const TN=function(){var e,t,s,n,i,l,c,d,m,x;const u=(0,r.Zp)(),[g,b]=(0,a.useState)(null),[y,v]=(0,a.useState)(!0),[j,w]=(0,a.useState)(!1),[N,A]=(0,a.useState)({active:0,total:0}),k=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/mobile/dashboard/stats"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json();b(e.stats)}}catch(e){console.error("Error fetching stats:",e)}finally{v(!1),w(!1)}},_=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/admin/todos"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json();if(e.success&&Array.isArray(e.todos)){const t=e.todos.filter(e=>!e.is_completed).length;A({active:t,total:e.todos.length})}}}catch(e){console.error("Error fetching todo stats:",e)}};(0,a.useEffect)(()=>{k(),_()},[]);const C=[{title:"Tasks Due",value:N.active,icon:us.A,color:"from-purple-500 via-pink-500 to-rose-500",link:"/webmanagement/todos",badge:N.total,badgeLabel:"total",subtitle:"Active Tasks"},{title:"New Leads",value:(null===g||void 0===g||null===(e=g.leads)||void 0===e?void 0:e.new)||0,icon:ms.A,color:"from-orange-500 via-red-500 to-pink-500",link:"/webmanagement/leads",badge:(null===g||void 0===g||null===(t=g.leads)||void 0===t?void 0:t.recent)||0,badgeLabel:"7 days"},{title:"Pending",value:(null===g||void 0===g||null===(s=g.proposals)||void 0===s?void 0:s.pending)||0,icon:Nt.A,color:"from-blue-500 via-indigo-500 to-purple-500",link:"/webmanagement/proposals?status=sent",subtitle:"Proposals"},{title:"Accepted",value:(null===g||void 0===g||null===(n=g.proposals)||void 0===n?void 0:n.accepted)||0,icon:p.A,color:"from-emerald-500 via-green-500 to-teal-500",link:"/webmanagement/proposals?status=accepted",subtitle:"Proposals"},{title:"Unpaid",value:(null===g||void 0===g||null===(i=g.invoices)||void 0===i?void 0:i.unpaid)||0,icon:h.A,color:"from-yellow-500 via-amber-500 to-orange-500",link:"/webmanagement/invoices",subtitle:"Invoices"}],F=[{title:"Total Revenue",value:"$".concat(((null===g||void 0===g||null===(l=g.revenue)||void 0===l?void 0:l.total)||0).toLocaleStr
1ing()),subtitle:"From accepted proposals",icon:At.A,color:"from-purple-600 to-indigo-600",trend:"+12.5%",link:"/webmanagement/proposals?status=accepted"},{title:"Active Clients",value:(null===g||void 0===g||null===(c=g.clients)||void 0===c?void 0:c.total)||0,subtitle:"In your database",icon:Xe.A,color:"from-pink-600 to-rose-600",trend:"+8",link:"/webmanagement/clients"}];return y?(0,f.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-purple-900/20 to-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-4 border-purple-500/30 border-t-purple-500 mx-auto"}),(0,f.jsx)(Wr.A,{className:"w-6 h-6 text-purple-400 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 animate-pulse"})]}),(0,f.jsx)("p",{className:"mt-4 text-gray-400 font-medium",children:"Loading dashboard..."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-purple-900/20 to-slate-900 pb-24",children:[(0,f.jsxs)("div",{className:"relative overflow-hidden",children:[(0,f.jsxs)("div",{className:"absolute inset-0 z-0",children:[(0,f.jsx)("img",{src:"/mobile-hero-image.jpg",alt:"Professional photography",className:"w-full h-full object-cover"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-900/95 via-indigo-900/90 to-slate-900/95"}),(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-slate-900 via-transparent to-transparent"})]}),(0,f.jsxs)("div",{className:"relative z-10 px-6 pt-12 pb-8",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,f.jsx)("div",{className:"flex items-center gap-3",children:(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-10 w-auto brightness-0 invert"})}),(0,f.jsx)("button",{onClick:()=>{w(!0),k(),_()},disabled:j,className:"p-2.5 bg-white/10 backdrop-blur-md rounded-full hover:bg-white/20 transition-all shadow-lg border border-white/20",children:(0,f.jsx)(As.A,{className:"w-5 h-5 text-white ".concat(j?"animate-spin":"")})})]}),(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,f.jsx)(Wr.A,{className:"w-5 h-5 text-purple-300"}),(0,f.jsx)("span",{className:"text-purple-200 text-sm font-medium",children:"Mobile Admin"})]}),(0,f.jsx)("h1",{className:"text-3xl font-bold text-white mb-2",children:"Dashboard"}),(0,f.jsx)("p",{className:"text-purple-200/80 text-sm",children:"Monitor your business at a glance"})]}),(0,f.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,f.jsxs)("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-4 border border-white/20 shadow-xl",children:[(0,f.jsx)("div",{className:"text-xs text-purple-200 mb-1",children:"Leads"}),(0,f.jsx)("div",{className:"text-2xl font-bold text-white",children:(null===g||void 0===g||null===(d=g.leads)||void 0===d?void 0:d.recent)||0}),(0,f.jsx)("div",{className:"text-xs text-purple-300 mt-1",children:"This week"})]}),(0,f.jsxs)("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-4 border border-white/20 shadow-xl",children:[(0,f.jsx)("div",{className:"text-xs text-purple-200 mb-1",children:"Proposals"}),(0,f.jsx)("div",{className:"text-2xl font-bold text-white",children:(null===g||void 0===g||null===(m=g.proposals)||void 0===m?void 0:m.recent)||0}),(0,f.jsx)("div",{className:"text-xs text-purple-300 mt-1",children:"This week"})]}),(0,f.jsxs)("div",{className:"bg-white/10 backdrop-blur-md rounded-2xl p-4 border border-white/20 shadow-xl",children:[(0,f.jsx)("div",{className:"text-xs text-purple-200 mb-1",children:"Accepted"}),(0,f.jsx)("div",{className:"text-2xl font-bold text-white",children:(null===g||void 0===g||null===(x=g.proposals)||void 0===x?void 0:x.accepted)||0}),(0,f.jsx)("div",{className:"text-xs text-purple-300 mt-1",children:"Total"})]})]})]})]}),(0,f.jsxs)("div",{className:"px-4 -mt-4 relative z-20",children:[(0,f.jsxs)("div",{className:"mb-6",children:[(0,f.jsx)("h2",{className:"text-white font-semibold text-lg mb-4 px-2",children:"Qu
1ick Actions"}),(0,f.jsx)("div",{className:"grid grid-cols-2 gap-3",children:C.map((e,t)=>{const s=e.icon;return(0,f.jsxs)("button",{onClick:()=>u(e.link),className:"relative bg-slate-800/80 backdrop-blur-sm rounded-2xl p-5 text-left overflow-hidden group hover:bg-slate-800 transition-all active:scale-95 border border-slate-700/50 shadow-xl",children:[(0,f.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br ".concat(e.color," opacity-10 group-hover:opacity-20 transition-opacity")}),(0,f.jsxs)("div",{className:"relative z-10",children:[(0,f.jsx)("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br ".concat(e.color," flex items-center justify-center mb-3 shadow-lg"),children:(0,f.jsx)(s,{className:"w-6 h-6 text-white"})}),(0,f.jsx)("div",{className:"text-3xl font-bold text-white mb-1",children:e.value}),(0,f.jsx)("div",{className:"text-sm text-gray-400 mb-2",children:e.title}),e.subtitle&&(0,f.jsx)("div",{className:"text-xs text-gray-500",children:e.subtitle}),e.badge>0&&(0,f.jsx)("div",{className:"absolute top-4 right-4",children:(0,f.jsxs)("span",{className:"px-2 py-1 rounded-full text-xs font-semibold bg-gradient-to-r ".concat(e.color," text-white shadow-lg"),children:["+",e.badge]})})]})]},t)})})]}),(0,f.jsx)("div",{className:"space-y-3 mb-6",children:F.map((e,t)=>{const s=e.icon;return(0,f.jsxs)("button",{onClick:()=>u(e.link),className:"w-full bg-gradient-to-br ".concat(e.color," rounded-2xl p-6 text-left shadow-2xl hover:shadow-3xl transition-all active:scale-95 border border-white/10"),children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("div",{className:"text-white/80 text-sm font-medium mb-2",children:e.title}),(0,f.jsx)("div",{className:"text-4xl font-bold text-white mb-2",children:e.value}),(0,f.jsx)("div",{className:"text-white/60 text-sm",children:e.subt
1itle})]}),(0,f.jsx)("div",{className:"bg-white/20 backdrop-blur-sm p-4 rounded-2xl",children:(0,f.jsx)(s,{className:"w-8 h-8 text-white"})})]}),(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)(Ia.A,{className:"w-4 h-4 text-white/80"}),(0,f.jsx)("span",{className:"text-white/80 text-sm font-medium",children:e.trend})]}),(0,f.jsx)(S.A,{className:"w-5 h-5 text-white/60"})]})]},t)})}),(0,f.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,f.jsxs)("button",{onClick:()=>u("/webmanagement/invoices"),className:"bg-slate-800/80 backdrop-blur-sm rounded-2xl p-4 text-left border border-slate-700/50 hover:bg-slate-800 transition-all active:scale-95",children:[(0,f.jsx)(At.A,{className:"w-8 h-8 text-yellow-400 mb-2"}),(0,f.jsx)("div",{className:"text-white font-semibold",children:"Invoices"}),(0,f.jsx)("div",{className:"text-gray-400 text-sm",children:"Manage billing"})]}),(0,f.jsxs)("button",{onClick:()=>u("/webmanagement/runsheets"),className:"bg-slate-800/80 backdrop-blur-sm rounded-2xl p-4 text-left border border-slate-700/50 hover:bg-slate-800 transition-all active:scale-95",children:[(0,f.jsx)(_t.A,{className:"w-8 h-8 text-blue-400 mb-2"}),(0,f.jsx)("div",{className:"text-white font-semibold",children:"Runsheets"}),(0,f.jsx)("div",{className:"text-gray-400 text-sm",children:"Event schedules"})]})]}),(0,f.jsx)("div",{className:"h-6"})]})]})};const zN=function(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,m]=(0,a.useState)(""),[p,x]=(0,a.useState)("all"),[h,u]=(0,a.useState)(!1),g=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/leads"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json(),a=Array.isArray(e)?e:e.leads||[];s(a),i(a)}else s([]),i([])}catch(e){console.error("Error fetching leads:",e),s([]),i([])}finally{c(!1),u(!1)}};(0,a.useEffect)(()=>{g()},[]),(0,a.useEffect)(()=>{let e=t;d&&(e=e.filter(e=>{var t,s,a;return(null===(t=e.name)||void 0===t?void 0:t.toLowerCase().includes(d.toLowerCase()))||(null===(s=e.email)||void 0===s?void 0:s.toLowerCase().includes(d.toLowerCase()))||(null===(a=e.company)||void 0===a?void 0:a.toLowerCase().includes(d.toLowerCase()))})),"all"!==p&&(e=e.filter(e=>(e.status||"new").toLowerCase()===p)),i(e)},[d,p,t]);const b=e=>{const t={new:"bg-orange-500/20 text-orange-400 border-orange-500/30",contacted:"bg-blue-500/20 text-blue-400 border-blue-500/30",qualified:"bg-purple-500/20 text-purple-400 border-purple-500/30",converted:"bg-green-500/20 text-green-400 border-green-500/30",lost:"bg-gray-500/20 text-gray-400 border-gray-500/30"};return t[(e||"new").toLowerCase()]||t.new};return l?(0,f.jsx)("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-b-2 border-purple-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-400",children:"Loading leads..."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-orange-600 to-red-600 text-white p-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement"),className:"p-2 hover:bg-white/20 rounded-full transition-all",children:(0,f.jsx)(Ct.A,{className:"w-5 h-5"})}),(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-8 w-auto brightness-0 invert"})]}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsx)("h1",{className:"text-xl font-bold",children:"Leads"}),(0,f.jsxs)("p",{className:"text-orange-200 text-xs",children:[n.length," total"]})]}),(0,f.jsx)("button",{onClick:()=>{u(!0),g()},disabled:h,className:"p-2 bg-white/20 rounded-full hover:bg-white/30 transition-all",children:(0,f.jsx)(As.A,{className:"w-5 h-5 ".concat(h?"animate-spin":"")})})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",placeholder:"Search leads...",value:d,onChange:e=>m(e.target.value),className:"w-full pl-10 pr-4 py-3 bg-white/10 backdrop-blur-sm border border-white/20 rounded-xl text-white placeholder-gray-300 focus:outline-none focus:ring-2 focus:ring-white/30"})]}),(0,f.jsx)("div",{className:"flex gap-2 mt-3 overflow-x-auto pb-2",children:["all","new","contacted","qualified","converted","lost"].map(e=>(0,f.jsx)("button",{onClick:()=>x(e),className:"px-4 py-2 rounded-full text-sm font-medium whitespace-nowrap transition-all ".concat(p===e?"bg-white text-orange-600":"bg-white/20 text-white hover:bg-white/30"),children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,f.jsx)("div",{className:"p-4 space-y-3",children:Array.isArray(n)&&0!==n.length?n.map(t=>(0,f.jsxs)("div",{onClick:()=>e("/webmanagement/leads/".concat(t.id)),className:"bg-slate-800 rounded-xl p-4 cursor-pointer active:scale-95 transition-all",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h3",{className:"font-semibold text-white text-lg mb-1",children:t.name||"Unknown"}),t.company&&(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:t.company})]}),(0,f.jsx)("span",{className:"px-3 py-1 rounded-full text-xs font-medium border ".concat(b(t.status)),children:(t.status||"new").toUpperCase()})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[t.email&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(T.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:t.email})]}),t.phone&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(E.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{children:t.phone})]}),t.event_date&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(_t.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{children:new Date(t.event_date).toLocaleDateString("en-AU",{year:"numeric",month:"short",day:"numeric"})})]})]}),t.created_at&&(0,f.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-700 text-xs text-gray-500",children:["Received ",new Date(t.created_at).toLocaleDateString("en-AU")]})]},t.id)):(0,f.jsxs)("div",{className:"text-center py-12",children:[(0,f.jsx)("div",{className:"text-6xl mb-4",children:"\ud83d\udced"}),(0,f.jsx)("p",{className:"text-gray-400 text-lg",children:"No leads found"}),(0,f.jsx)("p",{className:"text-gray-500 text-sm mt-2",children:"Try adjusting your filters"})]})})]})};const BN=function(){const e=(0,r.Zp)(),[t]=(0,r.ok)(),[s,n]=(0,a.useState)([]),[i,l]=(0,a.useState)([]),[c,d]=(0,a.useState)(!0),[m,p]=(0,a.useState)(""),[x,h]=(0,a.useState)(t.get("status")||"all"),[u,g]=(0,a.useState)(!1),b=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/proposals"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json(),s=Array.isArray(e)?e:e.proposals||[];n(s),l(s)}else n([]),l([])}catch(e){console.error("Error fetching proposals:",e),n([]),l([])}finally{d(!1),g(!1)}};(0,a.useEffect)(()=>{b()},[]),(0,a.useEffect)(()=>{let e=s;m&&(e=e.filter(e=>{var t,s,a;return(null===(t=e.contact_name)||void 0===t?void 0:t.toLowerCase().includes(m.toLowerCase()))||(null===(s=e.project_name)||void 0===s?void 0:s.toLowerCase().includes(m.toLowerCase()))||(null===(a=e.company_name)||void 0===a?void 0:a.toLowerCase().includes(m.toLowerCase()))})),"all"!==x&&(e=e.filter(e=>{var t;return(null===(t=e.status)||void 0===t?void 0:t.toLowerCase())===x.toLowerCase()})),l(e)},[m,x,s]);const y=e=>{const t={Draft:"bg-gray-500/20 text-gray-400 border-gray-500/30",Sent:"bg-blue-500/20 text-blue-400 border-blue-500/30",Viewed:"bg-purple-500/20 text-purple-400 border-purple-500/30",Accepted:"bg-green-500/20 text-green-400 border-green-500/30",Declined:"bg-red-500/20 text-red-400 border-red-500/30"};return t[e]||t.Draft};return c?(0,f.jsx)("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-b-2 border-purple-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-400",children:"Loading proposals..."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-purple-600 to-pink-600 text-white p-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement"),className:"p-2 hover:bg-white/20 rounded-full transition-all",children:(0,f.jsx)(Ct.A,{className:"w-5 h-5"})}),(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-8 w-auto brightness-0 invert"})]}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsx)("h1",{className:"text-xl font-bold",children:"Proposals"}),(0,f.jsxs)("p",{className:"text-purple-200 text-xs",children:[i.length," total"]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("button",{onClick:()=>{g(!0),b()},disabled:u,className:"p-2 bg-white/20 rounded-full hover:bg-white/30 transition-all",children:(0,f.jsx)(As.A,{className:"w-5 h-5 ".concat(u?"animate-spin":"")})}),(0,f.jsx)("button",{onClick:()=>e("/admin/proposals/create"),className:"p-2 bg-white/20 rounded-full hover:bg-white/30 transition-all",children:(0,f.jsx)(ls.A,{className:"w-5 h-5"})})]})]}),(0,f.jsxs)("div",{className:"relative mb-3",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",placeholder:"Search proposals...",value:m,onChange:e=>p(e.target.value),className:"w-full pl-10 pr-4 py-3 bg-white/10 backdrop-blur-sm border border-white/20 rounded-xl text-white placeholder-gray-300 focus:outline-none focus:ring-2 focus:ring-white/30"})]}),(0,f.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-2",children:["all","Draft","Sent","Viewed","Accepted","Declined"].map(e=>(0,f.jsx)("button",{onClick:()=>h(e),className:"px-4 py-2 rounded-full text-sm font-medium whitespace-nowrap transition-all ".concat(x===e?"bg-white text-purple-600":"bg-white/20 text-white hover:bg-white/30"),children:"all"===e?"All":e},e))})]}),(0,f.jsx)("div",{className:"p-4 space-y-3",children:Array.isArray(i)&&0!==i.length?i.map(t=>(0,f.jsxs)("div",{onClick:()=>e("/webmanagement/proposals/".concat(t.id)),className:"bg-slate-800 rounded-xl p-4 cursor-pointer active:scale-95 transition-all",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h3",{className:"font-semibold text-white text-lg mb-1",children:t.project_name||"Untitled Proposal"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:t.contact_name}),t.company_name&&(0,f.jsx)("p",{className:"text-gray-500 text-xs",children:t.company_name})]}),(0,f.jsx)("span",{className:"px-3 py-1 rounded-full text-xs font-medium border ".concat(y(t.status)),children:t.status||"Draft"})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-gray-400",children:[(0,f.jsx)(_t.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{children:new Date(t.job_date).toLocaleDateString("en-AU",{year:"numeric",month:"short",day:"numeric"})})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2 text-white font-semibold",children:[(0,f.jsx)(At.A,{className:"w-4 h-4 flex-shrink-0"}
1),(0,f.jsxs)("span",{children:["$",(t.total||0).toLocaleString()]})]})]}),t.proposal_number&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[(0,f.jsx)(kt.A,{className:"w-3 h-3 flex-shrink-0"}),(0,f.jsx)("span",{children:t.proposal_number})]})]}),t.created_at&&(0,f.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-700 text-xs text-gray-500",children:["Created ",new Date(t.created_at).toLocaleDateString("en-AU")]})]},t.id)):(0,f.jsxs)("div",{className:"text-center py-12",children:[(0,f.jsx)("div",{className:"text-6xl mb-4",children:"\ud83d\udcdd"}),(0,f.jsx)("p",{className:"text-gray-400 text-lg",children:"No proposals found"}),(0,f.jsx)("p",{className:"text-gray-500 text-sm mt-2",children:"Try adjusting your filters"})]})})]})};const DN=function(){const e=(0,r.Zp)(),{proposalId:t}=(0,r.g)(),[s,n]=(0,a.useState)(null),[i,l]=(0,a.useState)(!0),[c,d]=(0,a.useState)("");(0,a.useEffect)(()=>{m()},[t]);const m=async()=>{try{const e=(0,o.gf)(),s=await fetch("".concat(I.JR,"/api/proposals/").concat(t),{headers:{Authorization:"Bearer ".concat(e)}});if(s.ok){const e=await s.json();n(e)}else d("Proposal not found")}catch(c){console.error("Error fetching proposal:",c),d("Failed to load proposal")}finally{l(!1)}},h=()=>{window.open("/admin/proposals/".concat(t),"_blank")};if(i)return(0,f.jsx)("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-b-2 border-purple-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-400",children:"Loading proposal..."})]})});if(c||!s)return(0,f.jsx)("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center p-6",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)(x.A,{className:"w-16 h-16 text-red-400 mx-auto mb-4"}),(0,f.jsx)("h2",{className:"text-xl font-bold text-white mb-2",children:"Proposal Not Found"}),(0,f.jsx)("p",{className:"text-gray-400 mb-6",children:c}),(0,f.jsx)("button",{onClick:()=>e("/webmanagement/proposals"),className:"px-6 py-3 bg-purple-600 text-white rounded-xl font-semibold hover:bg-purple-700 transition-all",children:"Back to Proposals"})]})});const u=(e=>{const t={Draft:{bg:"bg-gray-500/20",text:"text-gray-400",border:"border-gray-500/30",icon:kt.A},Sent:{bg:"bg-blue-500/20",text:"text-blue-400",border:"border-blue-500/30",icon:st.A},Viewed:{bg:"bg-purple-500/20",text:"text-purple-400",border:"border-purple-500/30",icon:_.A},Accepted:{bg:"bg-green-500/20",text:"text-green-400",border:"border-green-500/30",icon:p.A},Declined:{bg:"bg-red-500/20",text:"text-red-400",border:"border-red-500/30",icon:x.A}};return t[e]||t.Draft})(s.status),g=u.icon;return(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900 pb-24",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-purple-600 to-pink-600 text-white p-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement/proposals"),className:"p-2 hover:bg-white/20 rounded-full transition-all",children:(0,f.jsx)(Ct.A,{className:"w-5 h-5"})}),(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-8 w-auto brightness-0 invert"})]}),(0,f.jsxs)("button",{onClick:h,className:"flex items-center gap-2 px-4 py-2 bg-white/20 rounded-full text-sm font-medium hover:bg-white/30 transition-all",children:[(0,f.jsx)(En.A,{className:"w-4 h-4"}),"Edit"]})]}),(0,f.jsxs)("div",{className:"mb-4",children:[(0,f.jsx)("div",{className:"text-sm text-purple-200 mb-1",children:s.proposal_number||"Draft Proposal"}),(0,f.jsx)("h1",{className:"text-2xl font-bold mb-2",children:s.project_name||"Untitled Proposal"}),(0,f.jsxs)("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border ".concat(u.bg," ").concat(u.text," ").concat(u.border),children:[(0,f.jsx)(g,{className:"w-4 h-4"}),(0,f.jsx)("span",{className:"font-semibold",children:s.status||"Draft"})]})]})]}),(0,f.jsxs)("div",{className:"p-4 space-y-4 -mt-2",children:[(0,f.jsxs)("div",{className:"bg-slate-800 rounded-xl p-4 shadow-lg",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[(0,f.jsx)(Ye.A,{className:"w-5 h-5 text-purple-400"}),"Client Information"]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-gray-300",children:[(0,f.jsx)(gs.A,{className:"w-4 h-4 text-gray-500"}),(0,f.jsx)("span",{className:"font-semibold",children:s.contact_name})]}),s.company_name&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[(0,f.jsx)(gs.A,{className:"w-4 h-4 text-gray-500"}),(0,f.jsx)("span",{children:s.company_name})]}),s.email&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[(0,f.jsx)(T.A,{className:"w-4 h-4 text-gray-500"}),(0,f.jsx)("span",{children:s.email})]}),s.phone&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[(0,f.jsx)(E.A,{className:"w-4 h-4 text-gray-500"}),(0,f.jsx)("span",{children:s.phone})]})]})]}),(0,f.jsxs)("div",{className:"bg-slate-800 rounded-xl p-4 shadow-lg",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[(0,f.jsx)(_t.A,{className:"w-5 h-5 text-purple-400"}),"Event Details"]}
1),(0,f.jsxs)("div",{className:"space-y-2",children:[s.job_date&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-gray-300",children:[(0,f.jsx)(_t.A,{className:"w-4 h-4 text-gray-500"}),(0,f.jsx)("span",{children:new Date(s.job_date).toLocaleDateString("en-AU",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]}),s.event_time&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[(0,f.jsx)(Nt.A,{className:"w-4 h-4 text-gray-500"}),(0,f.jsx)("span",{children:s.event_time})]}),s.venue&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-gray-400 text-sm",children:[(0,f.jsx)(C.A,{className:"w-4 h-4 text-gray-500"}),(0,f.jsx)("span",{children:s.venue})]})]})]}),s.line_items&&s.line_items.length>0&&(0,f.jsxs)("div",{className:"bg-slate-800 rounded-xl p-4 shadow-lg",children:[(0,f.jsxs)("h2",{className:"text-lg font-semibold text-white mb-3 flex items-center gap-2",children:[(0,f.jsx)(as.A,{className:"w-5 h-5 text-purple-400"}),"Services"]}),(0,f.jsx)("div",{className:"space-y-3",children:s.line_items.map((e,t)=>(0,f.jsx)("div",{className:"bg-slate-900 rounded-lg p-3",children:(0,f.jsxs)("div",{className:"flex items-start justify-between mb-2",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("div",{className:"font-semibold text-white whitespace-pre-wrap",children:e.description}),e.quantity&&(0,f.jsxs)("div",{className:"text-sm text-gray-400",children:["Qty: ",e.quantity]})]}),(0,f.jsx)("div",{className:"text-right",children:(0,f.jsxs)("div",{className:"font-semibold text-white",children:["$",(e.price||0).toLocaleString()]})})]})},t))})]}),(0,f.jsx)("div",{className:"bg-gradient-to-br from-purple-600 to-indigo-600 rounded-xl p-4 shadow-lg",children:(0,f.jsxs)("div",{className:"space-y-2",children:[void 0!==s.subtotal&&(0,f.jsxs)("div",{className:"flex items-center justify-between text-white",children:[(0,f.jsx)("span",{children:"Subtotal"}),(0,f.jsxs)("span",{className:"font-semibold",children:["$",(s.subtotal||0).toLocaleString()]})]}),void 0!==s.gst&&(0,f.jsxs)("div",{className:"flex items-center justify-between text-purple-200",children:[(0,f.jsx)("span",{className:"text-sm",children:"GST (10%)"}),(0,f.jsxs)("span",{className:"font-semibold",children:["$",(s.gst||0).toLocaleString()]})]}),(0,f.jsx)("div",{className:"border-t border-white/20 pt-2 mt-2",children:(0,f.jsxs)("div",{className:"flex items-center justify-between text-white",children:[(0,f.jsx)("span",{className:"text-lg font-bold",children:"Total"}),(0,f.jsxs)("span",{className:"text-2xl font-bold",children:["$",(s.total||0).toLocaleString()]})]})})]})}),s.proposal_details&&(0,f.jsxs)("div",{className:"bg-slate-800 rounded-xl p-4 shadow-lg",children:[(0,f.jsx)("h2",{className:"text-lg font-semibold text-white mb-3",children:"Additional Details"}),(0,f.jsx)("p",{className:"text-gray-300 text-sm leading-relaxed whitespace-pre-wrap",children:s.proposal_details})]}),(0,f.jsx)("div",{className:"bg-slate-800/50 rounded-xl p-4",children:(0,f.jsxs)("div",{className:"text-xs text-gray-500 space-y-1",children:[s.created_at&&(0,f.jsxs)("div",{children:["Created: ",new Date(s.created_at).toLocaleDateString("en-AU")]}),s.sent_at&&(0,f.jsxs)("div",{children:["Sent: ",new Date(s.sent_at).toLocaleDateString("en-AU")]}),s.first_viewed_at&&(0,f.jsxs)("div",{children:["First Viewed: ",new Date(s.first_viewed_at).toLocaleDateString("en-AU")]}),s.signed_at&&(0,f.jsxs)("div",{children:["Accepted: ",new Date(s.signed_at).toLocaleDateString("en-AU")]})]})}),(0,f.jsxs)("div",{className:"space-y-3",children:[(0,f.jsxs)("button",{onClick:()=>{window.open("/proposal/".concat(t),"_blank")},className:"w-full flex items-center justify-center gap-2 bg-gradient-to-r from-purple-600 to-indigo-600 text-white py-3 rounded-xl font-semibold hover:from-purple-700 hover:to-indigo-700 transition-all shadow-lg",children:[(0,f.jsx)(En.A,{className:"w-5 h-5"}),"View Client Proposal"]}),(0,f.jsxs)("button",{onClick:h,className:"w-full flex items-center justify-center gap-2 bg-slate-700 text-white py-3 rounded-xl font-semibold hover:bg-slate-600 transition-all",children:[(0,f.jsx)(En.A,{className:"w-5 h-5"}),"Open in Desktop Editor"]})]})]})]})};const IN=function(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,m]=(0,a.useState)(""),[p,x]=(0,a.useState)("all"),[h,u]=(0,a.useState)(!1),g=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/clients"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json(),a=Array.isArray(e)?e:e.clients||[];s(a),i(a)}else console.error("Failed to fetch clients:",t.status),s([]),i([])}catch(e){console.error("Error fetching clients:",e),s([]),i([])}finally{c(!1),u(!1)}};return(0,a.useEffect)(()=>{g()},[]),(0,a.useEffect)(()=>{let e=t;d&&(e=e.filter(e=>{var t,s,a;return(null===(t=e.name)||void 0===t?void 0:t.toLowerCase().includes(d.toLowerCase()))||(null===(s=e.email)||void 0===s?void 0:s.toLowerCase().includes(d.toLowerCase()))||(null===(a=e.company)||void 0===a?void 0:a.toLowerCase().includes(d.toLowerCase()))}
1)),"all"!==p&&(e=e.filter(e=>"company"===p?!0===e.is_company:"contact"!==p||(!1===e.is_company||!e.is_company))),i(e)},[d,p,t]),l?(0,f.jsx)("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-b-2 border-purple-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-400",children:"Loading clients..."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-indigo-600 to-purple-600 text-white p-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement"),className:"p-2 hover:bg-white/20 rounded-full transition-all",children:(0,f.jsx)(Ct.A,{className:"w-5 h-5"})}),(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-8 w-auto brightness-0 invert"})]}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsx)("h1",{className:"text-xl font-bold",children:"Clients"}),(0,f.jsxs)("p",{className:"text-indigo-200 text-xs",children:[n.length," total"]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("button",{onClick:()=>{u(!0),g()},disabled:h,className:"p-2 bg-white/20 rounded-full hover:bg-white/30 transition-all",children:(0,f.jsx)(As.A,{className:"w-5 h-5 ".concat(h?"animate-spin":"")})}),(0,f.jsx)("button",{onClick:()=>e("/admin/clients/add-company"),className:"p-2 bg-white/20 rounded-full hover:bg-white/30 transition-all",children:(0,f.jsx)(ls.A,{className:"w-5 h-5"})})]})]}),(0,f.jsxs)("div",{className:"relative mb-3",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",placeholder:"Search clients...",value:d,onChange:e=>m(e.target.value),className:"w-full pl-10 pr-4 py-3 bg-white/10 backdrop-blur-sm border border-white/20 rounded-xl text-white placeholder-gray-300 focus:outline-none focus:ring-2 focus:ring-white/30"})]}),(0,f.jsx)("div",{className:"flex gap-2",children:[{value:"all",label:"All"},{value:"company",label:"Companies"},{value:"contact",label:"Contacts"}].map(e=>(0,f.jsx)("button",{onClick:()=>x(e.value),className:"px-4 py-2 rounded-full text-sm font-medium whitespace-nowrap transition-all ".concat(p===e.value?"bg-white text-indigo-600":"bg-white/20 text-white hover:bg-white/30"),children:e.label},e.value))})]}),(0,f.jsx)("div",{className:"p-4 space-y-3",children:Array.isArray(n)&&0!==n.length?n.map(t=>(0,f.jsxs)("div",{onClick:()=>e("/webmanagement/clients/".concat(t.id)),className:"bg-slate-800 rounded-xl p-4 cursor-pointer active:scale-95 transition-all",children:[(0,f.jsxs)("div",{className:"flex items-start gap-3 mb-3",children:[(0,f.jsx)("div",{className:"p-3 rounded-xl flex-shrink-0 ".concat(t.is_company?"bg-gradient-to-br from-blue-500 to-cyan-500":"bg-gradient-to-br from-purple-500 to-pink-500"),children:t.is_company?(0,f.jsx)(gs.A,{className:"w-5 h-5 text-white"}):(0,f.jsx)(Xe.A,{className:"w-5 h-5 text-white"})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("h3",{className:"font-semibold text-white text-lg mb-1",children:t.name||"Unknown"}),t.position&&(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:t.position}),t.company&&t.company!==t.name&&(0,f.jsx)("p",{className:"text-gray-500 text-xs",children:t.company})]}),(0,f.jsx)("div",{className:"px-2 py-1 rounded-full text-xs font-medium ".concat(t.is_company?"bg-blue-500/20 text-blue-400":"bg-purple-500/20 text-purple-400"),children:t.is_company?"Company":"Contact"})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[t.email&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(T.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:t.email})]}),t.phone&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(E.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{children:t.phone})]})]}),t.created_at&&(0,f.jsxs)("div",{className:"mt-3 pt-3 border-t border-slate-700 text-xs text-gray-500",children:["Added ",new Date(t.created_at).toLocaleDateString("en-AU")]})]},t.id)):(0,f.jsxs)("div",{className:"text-center py-12",children:[(0,f.jsx)("div",{className:"text-6xl mb-4",children:"\ud83d\udc65"}),(0,f.jsx)("p",{className:"text-gray-400 text-lg",children:"No clients found"}),(0,f.jsx)("p",{className:"text-gray-500 text-sm mt-2",children:"Try adjusting your filters"})]})})]})};const RN=function(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,m]=(0,a.useState)(""),[x,u]=(0,a.useState)("all"),[g,b]=(0,a.useState)(!1),y=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/invoices"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json(),a=Array.isArray(e)?e:e.invoices||[];s(a),i(a)}else s([]),i([])}catch(e){console.error("Error fetching invoices:",e),s([]),i([])}finally{c(!1),b(!1)}};(0,a.useEffect)(()=>{y()},[]),(0,a.useEffect)(()=>{let e=t;d&&(e=e.filter(e=>{var t,s,a;return(null===(t=e.invoice_number)||void 0===t?void 0:t.toLowerCase().includes(d.toLowerCase()))||(null===(s=e.client_name)||void 0===s?void 0:s.toLowerCase().includes(d.toLowerCase()))||(null===(a=e.company_name)||void 0===a?void 0:a.toLowerCase().includes(d.toLowerCase()))})),"all"!==x&&(e=e.filter(e=>{var t;return(null===(t=e.status)||void 0===t?void 0:t.toLowerCase())===x.toLowerCase()})),i(e)},[d,x,t]);const v=e=>{const t={Draft:"bg-gray-500/20 text-gray-400 border-gray-500/30",Sent:"bg-blue-500/20 text-blue-400 border-blue-500/30","Partially Paid":"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",Paid:"bg-green-500/20 text-green-400 border-green-500/30",Overdue:"bg-red-500/20 text-red-400 border-red-500/30"};return t[e]||t.Draft},j=e=>{switch(e){case"Paid":return(0,f.jsx)(p.A,{className:"w-4 h-4"});case"Overdue":return(0,f.jsx)(h.A,{className:"w-4 h-4"});case"Sent":return(0,f.jsx)(Nt.A,{className:"w-4 h-4"});default:return null}};return l?(0,f.jsx)("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-b-2 border-purple-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-400",children:"Loading invoices..."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-yellow-600 to-orange-600 text-white p-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement"),className:"p-2 hover:bg-white/20 rounded-full transition-all",children:(0,f.jsx)(Ct.A,{className:"w-5 h-5"})}),(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-8 w-auto brightness-0 invert"})]}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsx)("h1",{className:"text-xl font-bold",children:"Invoices"}),(0,f.jsxs)("p",{className:"text-yellow-200 text-xs",children:[n.length," total"]})]}),(0,f.jsx)("button",{onClick:()=>{b(!0),y()},disabled:g,className:"p-2 bg-white/20 rounded-full hover:bg-white/30 transition-all",children:(0,f.jsx)(As.A,{className:"w-5 h-5 ".concat(g?"animate-spin":"")})})]}),(0,f.jsxs)("div",{className:"relative mb-3",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",placeholder:"Search invoices...",value:d,onChange:e=>m(e.target.value),className:"w-full pl-10 pr-4 py-3 bg-white/10 backdrop-blur-sm border border-white/20 rounded-xl text-white placeholder-gray-300 focus:outline-none focus:ring-2 focus:ring-white/30"})]}),(0,f.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-2",children:["all","Draft","Sent","Partially Paid","Paid","Overdue"].map(e=>(0,f.jsx)("button",{onClick:()=>u(e),className:"px-4 py-2 rounded-full text-sm font-medium whitespace-nowrap transition-all ".concat(x===e?"bg-white text-yellow-600":"bg-white/20 text-white hover:bg-white/30"),children:"all"===e?"All":e},e))})]}),(0,f.jsx)("div",{className:"p-4 space-y-3",children:Array.isArray(n)&&0!==n.length?n.map(t=>(0,f.jsxs)("div",{onClick:()=>e("/admin/invoices/".concat(t.id)),className:"bg-slate-800 rounded-xl p-4 cursor-pointer active:scale-95 transition-all",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h3",{className:"font-semibold text-white text-lg mb-1",children:t.invoice_number||"Draft Invoice"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:t.client_name}),t.company_name&&(0,f.jsx)("p",{className:"text-gray-500 text-xs",children:t.company_name})]}),(0,f.jsxs)("span",{className:"px-3 py-1 rounded-full text-xs font-medium border flex items-center gap-1 ".concat(v(t.status)),children:[j(t.status),t.status||"Draft"]})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("span",{className:"text-sm text-gray-400",children:"Total Amount"}),(0,f.jsxs)("span",{className:"text-lg font-bold text-white",children:["$",(t.total||0).toLocaleStr
1ing()]})]}),"Partially Paid"===t.status&&(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsx)("span",{className:"text-sm text-gray-400",children:"Amount Due"}),(0,f.jsxs)("span",{className:"text-md font-semibold text-yellow-400",children:["$",(t.amount_due||0).toLocaleString()]})]}),t.due_date&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(_t.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsxs)("span",{children:["Due: ",new Date(t.due_date).toLocaleDateString("en-AU")]})]})]})]},t.id)):(0,f.jsxs)("div",{className:"text-center py-12",children:[(0,f.jsx)("div",{className:"text-6xl mb-4",children:"\ud83d\udcb0"}),(0,f.jsx)("p",{className:"text-gray-400 text-lg",children:"No invoices found"})]})})]})};const PN=function(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,m]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),h=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/corporate-admin/events"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json(),a=Array.isArray(e)?e:e.events||[];s(a),i(a)}else s([]),i([])}catch(e){console.error("Error fetching events:",e),s([]),i([])}finally{c(!1),x(!1)}};return(0,a.useEffect)(()=>{h()},[]),(0,a.useEffect)(()=>{i(d?t.filter(e=>{var t,s;return(null===(t=e.event_name)||void 0===t?void 0:t.toLowerCase().includes(d.toLowerCase()))||(null===(s=e.client_company)||void 0===s?void 0:s.toLowerCase().includes(d.toLowerCase()))}):t)},[d,t]),l?(0,f.jsx)("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-b-2 border-purple-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-400",children:"Loading runsheets..."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-blue-600 to-cyan-600 text-white p-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement"),className:"p-2 hover:bg-white/20 rounded-full transition-all",children:(0,f.jsx)(Ct.A,{className:"w-5 h-5"})}),(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-8 w-auto brightness-0 invert"})]}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsx)("h1",{className:"text-xl font-bold",children:"Event Runsheets"}),(0,f.jsxs)("p",{className:"text-blue-200 text-xs",children:[n.length," events"]})]}),(0,f.jsx)("button",{onClick:()=>{x(!0),h()},disabled:p,className:"p-2 bg-white/20 rounded-full hover:bg-white/30 transition-all",children:(0,f.jsx)(As.A,{className:"w-5 h-5 ".concat(p?"animate-spin":"")})})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",placeholder:"Search events...",value:d,onChange:e=>m(e.target.value),className:"w-full pl-10 pr-4 py-3 bg-white/10 backdrop-blur-sm border border-white/20 rounded-xl text-white placeholder-gray-300 focus:outline-none focus:ring-2 focus:ring-white/30"})]})]}),(0,f.jsx)("div",{className:"p-4 space-y-3",children:Array.isArray(n)&&0!==n.length?n.map(t=>(0,f.jsxs)("div",{onClick:()=>e("/admin/corporate/event/".concat(t.id)),className:"bg-slate-800 rounded-xl p-4 cursor-pointer active:scale-95 transition-all",children:[(0,f.jsx)("h3",{className:"font-semibold text-white text-lg mb-2",children:t.event_name||"Untitled Event"}),(0,f.jsxs)("div",{className:"space-y-2",children:[t.client_company&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(Xe.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{children:t.client_company})]}),t.event_date&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(_t.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{children:new Date(t.event_date).toLocaleDateString("en-AU",{year:"numeric",month:"short",day:"numeric"})})]}),t.venue&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(C.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{className:"truncate",children:t.venue})]})]})]},t.id)):(0,f.jsxs)("div",{className:"text-center py-12",children:[(0,f.jsx)("div",{className:"text-6xl mb-4",children:"\ud83d\udcc5"}),(0,f.jsx)("p",{className:"text-gray-400 text-lg",children:"No events found"})]})})]})};const WN=function(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,m]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),h=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/content-deliveries"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json(),a=Array.isArray(e)?e:e.deliveries||[];s(a),i(a)}else s([]),i([])}catch(e){console.error("Error fetching deliveries:",e),s([]),i([])}finally{c(!1),x(!1)}};(0,a.useEffect)(()=>{h()},[]),(0,a.useEffect)(()=>{i(d?t.filter(e=>{var t,s;return(null===(t=e.client_name)||void 0===t?void 0:t.toLowerCase().includes(d.toLowerCase()))||(null===(s=e.event_name)||void 0===s?void 0:s.toLowerCase().includes(d.toLowerCase()))}):t)},[d,t]);const u=e=>{const t={pending:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30",processing:"bg-blue-500/20 text-blue-400 border-blue-500/30",delivered:"bg-green-500/20 text-green-400 border-green-500/30",failed:"bg-red-500/20 text-red-400 border-red-500/30"};return t[null===e||void 0===e?void 0:e.toLowerCase()]||t.pending};return l?(0,f.jsx)("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-b-2 border-purple-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-400",children:"Loading deliveries..."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-green-600 to-emerald-600 text-white p-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement"),className:"p-2 hover:bg-white/20 rounded-full transition-all",children:(0,f.jsx)(Ct.A,{className:"w-5 h-5"})}),(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-8 w-auto brightness-0 invert"})]}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsx)("h1",{className:"text-xl font-bold",children:"Content Delivery"}),(0,f.jsxs)("p",{className:"text-green-200 text-xs",children:[n.length," deliveries"]})]})]}),(0,f.jsxs)("div",{className:"relative mb-3",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",placeholder:"Search deliveries...",value:d,onChange:e=>m(e.target.value),className:"w-full pl-10 pr-4 py-3 bg-white/10 backdrop-blur-sm border border-white/20 rounded-xl text-white placeholder-gray-300 focus:outline-none focus:ring-2 focus:ring-white/30"})]}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsxs)("button",{onClick:()=>{x(!0),h()},disabled:p,className:"flex items-center gap-2 px-4 py-2 bg-white/20 rounded-full text-sm font-medium hover:bg-white/30 transition-all",children:[(0,f.jsx)(As.A,{className:"w-4 h-4 ".concat(p?"animate-spin":"")}),"Refresh"]}),(0,f.jsxs)("button",{onClick:()=>window.open("/admin/content-delivery","_blank"),className:"flex items-center gap-2 px-4 py-2 bg-white text-green-600 rounded-full text-sm font-medium hover:bg-white/90 transition-all",children:[(0,f.jsx)(En.A,{className:"w-4 h-4"}),"Full View"]})]})]}),(0,f.jsx)("div",{className:"p-4 space-y-3",children:Array.isArray(n)&&0!==n.length?n.map(e=>(0,f.jsxs)("div",{onClick:()=>window.open("/admin/content-delivery/".concat(e.id),"_blank"),className:"bg-slate-800 rounded-xl p-4 cursor-pointer active:scale-95 transition-all",children:[(0,f.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h3",{className:"font-semibold text-white text-lg mb-1",children:e.event_name||"Untitled Delivery"}),e.client_name&&(0,f.jsx)("p",{className:"text-gray-400 text-sm",children:e.client_name})]}),(0,f.jsx)("span",{className:"px-3 py-1 rounded-full text-xs font-medium border ".concat(u(e.status)),children:(e.status||"pending").toUpperCase()})]}),(0,f.jsxs)("div",{className:"space-y-2",children:[e.delivery_date&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(_t.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsx)("span",{children:new Date(e.delivery_date).toLocaleDateString("en-AU",{year:"numeric",month:"short",day:"numeric"})})]}),e.files_count&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[(0,f.jsx)(as.A,{className:"w-4 h-4 flex-shrink-0"}),(0,f.jsxs)("span",{children:[e.files_count," files"]})]})]})]},e.id)):(0,f.jsxs)("div",{className:"text-center py-12",children:[(0,f.jsx)("div",{className:"text-6xl mb-4",children:"\ud83d\udce6"}),(0,f.jsx)("p",{className:"text-gray-400 text-lg",children:"No deliveries found"}),(0,f.jsx)("p",{className:"text-gray-500 text-sm mt-2",children:"Content deliveries will appear here"}),(0,f.jsxs)("button",{onClick:()=>window.open("/admin/content-delivery","_blank"),className:"mt-4 inline-flex items-center gap-2 bg-gradient-to-r from-green-600 to-emerald-600 text-white px-6 py-3 rounded-xl font-semibold hover:from-green-700 hover:to-emerald-700 transition-all",children:[(0,f.jsx)(En.A,{className:"w-4 h-4"}),"Open Desktop View"]}
1)]})}),(0,f.jsx)("div",{className:"p-4",children:(0,f.jsx)("div",{className:"bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:(0,f.jsx)("p",{className:"text-gray-400 text-sm text-center",children:"\ud83d\udca1 For file uploads and detailed management, use the desktop interface"})})})]})};const ON=function(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)([]),[l,c]=(0,a.useState)(!0),[d,m]=(0,a.useState)(""),[p,x]=(0,a.useState)(!1),h=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/services"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json(),a=Array.isArray(e)?e:e.services||[];s(a),i(a)}else s([]),i([])}catch(e){console.error("Error fetching services:",e),s([]),i([])}finally{c(!1),x(!1)}};return(0,a.useEffect)(()=>{h()},[]),(0,a.useEffect)(()=>{i(d?t.filter(e=>{var t,s;return(null===(t=e.name)||void 0===t?void 0:t.toLowerCase().includes(d.toLowerCase()))||(null===(s=e.description)||void 0===s?void 0:s.toLowerCase().includes(d.toLowerCase()))}):t)},[d,t]),l?(0,f.jsx)("div",{className:"min-h-screen bg-slate-900 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-16 w-16 border-b-2 border-purple-500 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-400",children:"Loading services..."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-purple-600 to-pink-600 text-white p-6",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsxs)("div",{className:"flex items-center gap-3",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement"),className:"p-2 hover:bg-white/20 rounded-full transition-all",children:(0,f.jsx)(Ct.A,{className:"w-5 h-5"})}),(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-8 w-auto brightness-0 invert"})]}),(0,f.jsxs)("div",{className:"text-right",children:[(0,f.jsx)("h1",{className:"text-xl font-bold",children:"Services"}),(0,f.jsxs)("p",{className:"text-purple-200 text-xs",children:[n.length," total"]})]})]}),(0,f.jsxs)("div",{className:"relative mb-3",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-400"}),(0,f.jsx)("input",{type:"text",placeholder:"Search services...",value:d,onChange:e=>m(e.target.value),className:"w-full pl-10 pr-4 py-3 bg-white/10 backdrop-blur-sm border border-white/20 rounded-xl text-white placeholder-gray-300 focus:outline-none focus:ring-2 focus:ring-white/30"})]}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsxs)("button",{onClick:()=>{x(!0),h()},disabled:p,className:"flex items-center gap-2 px-4 py-2 bg-white/20 rounded-full text-sm font-medium hover:bg-white/30 transition-all",children:[(0,f.jsx)(As.A,{className:"w-4 h-4 ".concat(p?"animate-spin":"")}),"Refresh"]}),(0,f.jsxs)("button",{onClick:()=>e("/admin/services/create"),className:"flex items-center gap-2 px-4 py-2 bg-white text-purple-600 rounded-full text-sm font-medium hover:bg-white/90 transition-all",children:[(0,f.jsx)(ls.A,{className:"w-4 h-4"}),"Add Service"]})]})]}),(0,f.jsx)("div",{className:"p-4 space-y-3",children:Array.isArray(n)&&0!==n.length?n.map(t=>(0,f.jsxs)("div",{className:"bg-slate-800 rounded-xl p-4 transition-all",children:[(0,f.jsx)("div",{className:"flex items-start justify-between mb-3",children:(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h3",{className:"font-semibold text-white text-lg mb-1",children:t.name||"Untitled Service"}),t.description&&(0,f.jsx)("p",{className:"text-gray-400 text-sm mb-2",children:t.description})]})}),(0,f.jsxs)("div",{className:"flex items-center justify-between",children:[(0,f.jsxs)("div",{className:"flex items-center gap-2 text-white font-semibold",children:[(0,f.jsx)(At.A,{className:"w-4 h-4"}),(0,f.jsxs)("span",{children:["$",(t.price||0).toLocaleString()]})]}),(0,f.jsxs)("div",{className:"flex items-center gap-2",children:[(0,f.jsx)("button",{onClick:()=>e("/admin/services/".concat(t.id)),className:"p-2 bg-blue-500/20 text-blue-400 rounded-lg hover:bg-blue-500/30 transition-all",children:(0,f.jsx)(Tn.A,{className:"w-4 h-4"})}),(0,f.jsx)("button",{onClick:()=>(async(e,t)=>{if(window.confirm('Delete service "'.concat(t,'"?')))try{const t=(0,o.gf)();(await fetch("".concat(I.JR,"/api/services/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}})).ok?h():alert("Failed to delete service")}catch(s){console.error("Error deleting service:",s),alert("Error deleting service")}})(t.id,t.name),className:"p-2 bg-red-500/20 text-red-400 rounded-lg hover:bg-red-500/30 transition-all",children:(0,f.jsx)(la.A,{className:"w-4 h-4"})})]})]})]},t.id)):(0,f.jsxs)("div",{className:"text-center py-12",children:[(0,f.jsx)("div",{className:"text-6xl mb-4",children:"\ud83d\udccb"}),(0,f.jsx)("p",{className:"text-gray-400 text-lg",children:"No services found"}),(0,f.jsx)("p",{className:"text-gray-500 text-sm mt-2",children:"Create your first service"}),(0,f.jsxs)("button",{onClick:()=>e("/admin/services/create"),className:"mt-4 inline-flex items-center gap-2 bg-gradient-to-r from-purple-600 to-pink-600 text-white px-6 py-3 rounded-xl font-semibold hover:from-purple-700 hover:to-pink-700 transition-all",children:[(0,f.jsx)(ls.A,{className:"w-5 h-5"}),"Add Service"]})]})})]})};const LN=function(){const e=(0,r.Zp)(),[t,s]=(0,a.useState)(!1),[n,i]=(0,a.useState)(!1),[l,c]=(0,a.useState)(null);return(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsx)("div",{className:"bg-gradient-to-r from-indigo-600 to-purple-600 text-white p-6",children:(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement"),className:"p-2 hover:bg-white/20 rounded-full transition-all",children:(0,f.jsx)(Ct.A,{className:"w-5 h-5"})}),(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-8 w-auto brightness-0 invert"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h1",{className:"text-xl font-bold",children:"Backup & Restore"}),(0,f.jsx)("p",{className:"text-indigo-200 text-xs",children:"Data management"})]})]})}),(0,f.jsxs)("div",{className:"p-6",children:[l&&(0,f.jsx)("div",{className:"mb-6 p-4 rounded-xl border ".concat("success"===l.type?"bg-green-500/20 border-green-500/30 text-green-400":"bg-red-500/20 border-red-500/30 text-red-400"),children:l.text}),(0,f.jsx)("div",{className:"bg-blue-500/20 border border-blue-500/30 rounded-xl p-4 mb-6",children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)(h.A,{className:"w-5 h-5 text-blue-400 flex-shrink-0 mt-0.5"}),(0,f.jsxs)("div",{className:"text-sm text-blue-300",children:[(0,f.jsx)("p",{className:"font-semibold mb-1",children:"Important Information"}),(0,f.jsx)("p",{children:"Backups include all clients, proposals, invoices, services, and settings. Restoring will replace all current data."})]})]})}),(0,f.jsx)("div",{className:"bg-slate-800 rounded-xl p-6 mb-4 border border-slate-700",children:(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"bg-gradient-to-br from-green-500 to-emerald-500 p-4 rounded-xl",children:(0,f.jsx)(es.A,{className:"w-8 h-8 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-white mb-2",children:"Backup Data"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm mb-4",children:"Download a complete backup of your database as a JSON file."}),(0,f.jsx)("button",{onClick:async()=>{s(!0),c(null);try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/backup"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.blob(),s=window.URL.createObjectURL(e),a=document.createElement("a");a.href=s,a.download="turbo360_backup_".concat((new Date).toISOString().split("T")[0],".json"),document.body.appendChild(a),a.click(),a.remove(),window.URL.revokeObjectURL(s),c({type:"success",text:"Backup downloaded successfully!"})}else c({type:"error",text:"Failed to create backup"})}catch(e){console.error("Error creating backup:",e),c({type:"error",text:"Error creating backup"})}finally{s(!1)}},disabled:t,className:"w-full bg-gradient-to-r from-green-600 to-emerald-600 text-white py-3 rounded-xl font-semibold hover:from-green-700 hover:to-emerald-700 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:t?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white"}),"Creating Backup..."]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(es.A,{className:"w-5 h-5"}),"Download Backup"]})})]})]})}),(0,f.jsx)("div",{className:"bg-slate-800 rounded-xl p-6 border border-slate-700",children:(0,f.jsxs)("div",{className:"flex items-start gap-4",children:[(0,f.jsx)("div",{className:"bg-gradient-to-br from-orange-500 to-red-500 p-4 rounded-xl",children:(0,f.jsx)(_s.A,{className:"w-8 h-8 text-white"})}),(0,f.jsxs)("div",{className:"flex-1",children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-white mb-2",children:"Restore Data"}),(0,f.jsx)("p",{className:"text-gray-400 text-sm mb-4",children:"Upload a backup file to restore your database."}),(0,f.jsxs)("label",{className:"w-full bg-gradient-to-r from-orange-600 to-red-600 text-white py-3 rounded-xl font-semibold hover:from-orange-700 hover:to-red-700 transition-all cursor-pointer flex items-center justify-center gap-2",children:[n?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-white"}),"Restoring..."]}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(_s.A,{className:"w-5 h-5"}),"Choose Backup File"]}),(0,f.jsx)("input",{type:"file",accept:".json",onChange:async e=>{const t=e.target.files[0];if(t)if(window.confirm("\u26a0\ufe0f Restoring will replace all current data. Are you sure?")){i(!0),c(null);try{const e=(0,o.gf)(),s=new FormData;s.append("file",t);const a=await fetch("".concat(I.JR,"/api/restore"),{method:"POST",headers:{Authorization:"Bearer ".concat(e)},body:s});if(a.ok)c({type:"success",text:"Data restored successfully!"}),setTimeout(()=>{window.location.reload()},2e3);else{const e=await a.json();c({type:"error",text:e.message||"Failed to restore backup"})}}catch(s){console.error("Error restoring backup:",s),c({type:"error",text:"Error restoring backup"})}finally{i(!1),e.target.value=""}}else e.target.value=""},disabled:n,className:"hidden"})]})]})]})}),(0,f.jsx)("div",{className:"mt-6 bg-slate-800/50 rounded-xl p-4 border border-slate-700/50",children:(0,f.jsxs)("div",{className:"flex items-center gap-2 text-gray-400",children:[(0,f.jsx)(Es.A,{className:"w-4 h-4"}),(0,f.jsx)("span",{className:"text-sm",children:"All data is stored securely in MongoDB"})]})})]})]})};const MN=function(){const e=(0,r.Zp)(),t=[{title:"Management",items:[{icon:us.A,label:"To-Do List",description:"Manage tasks and projects",color:"from-purple-500 to-pink-500",action:()=>e("/webmanagement/todos")},{icon:At.A,label:"Invoices",description:"View and manage invoices",color:"from-yellow-500 to-orange-500",action:()=>e("/webmanagement/invoices")},{icon:_t.A,label:"Event Runsheets",description:"Corporate event management",color:"from-blue-500 to-cyan-500",action:()=>e("/webmanagement/runsheets")},{icon:as.A,label:"Content Delivery",description:"Manage content deliveries",color:"from-green-500 to-emerald-500",action:()=>e("/webmanagement/content")},{icon:kt.A,label:"Services",description:"Predefined services library",color:"from-purple-500 to-pink-500",action:()=>e("/webmanagement/services")}]},{title:"Admin Tools",items:[{icon:ss.A,label:"Settings",description:"System configuration",color:"from-gray-500 to-slate-500",action:()=>e("/admin/settings")},{icon:Es.A,label:"Backup & Restore",description:"Data management",color:"from-indigo-500 to-purple-500",action:()=>e("/webmanagement/backup")}]},{title:"Quick Access",items:[{icon:En.A,label:"Desktop Admin",description:"Open full admin panel",color:"from-teal-500 to-cyan-500",action:()=>window.open("/admin","_blank")},{icon:Cr.A,label:"Main Website",description:"View public site",color:"from-pink-500 to-rose-500",action:()=>window.open("/","_blank")}]}];return(0,f.jsxs)("div",{className:"min-h-screen bg-slate-900",children:[(0,f.jsx)("div",{className:"bg-gradient-to-r from-slate-700 to-slate-800 text-white p-6",children:(0,f.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement"),className:"p-2 hover:bg-white/20 rounded-full transition-all",children:(0,f.jsx)(Ct.A,{className:"w-5 h-5"})}),(0,f.jsx)("img",{src:"/turbo360-logo.png",alt:"Turbo 360",className:"h-8 w-auto brightness-0 invert"}),(0,f.jsxs)("div",{children:[(0,f.jsx)("h1",{className:"text-xl font-bold",children:"More"}),(0,f.jsx)("p",{className:"text-slate-300 text-xs",children:"Additional options"})]})]})}),(0,f.jsxs)("div",{className:"p-4 space-y-6",children:[t.map((e,t)=>(0,f.jsxs)("div",{children:[(0,f.jsx)("h2",{className:"text-sm font-semibold text-gray-400 uppercase tracking-wide mb-3 px-2",children:e.title}),(0,f.jsx)("div",{className:"space-y-2",children:e.items.map((e,t)=>{const s=e.icon;return(0,f.jsxs)("button",{onClick:e.action,className:"w-full bg-slate-800 rounded-xl p-4 cursor-pointer active:scale-95 transition-all flex items-center gap-4",children:[(0,f.jsx)("div",{className:"bg-gradient-to-br ".concat(e.color," p-3 rounded-xl flex-shrink-0"),children:(0,f.jsx)(s,{className:"w-5 h-5 text-white"})}),(0,f.jsxs)("div",{className:"flex-1 text-left",children:[(0,f.jsx)("div",{className:"font-semibold text-white mb-1",children:e.label}),(0,f.jsx)("div",{className:"text-sm text-gray-400",children:e.description})]})]},t)})})]},t)),(0,f.jsx)("div",{className:"pt-4",children:(0,f.jsxs)("button",{onClick:()=>{window.confirm("Are you sure you want to logout?")&&((0,o.L)(),e("/webmanagement"))},className:"w-full bg-red-600/20 border border-red-500/30 text-red-400 rounded-xl p-4 cursor-pointer active:scale-95 transition-all flex items-center gap-4 hover:bg-red-600/30",children:[(0,f.jsx)("div",{className:"bg-red-600 p-3 rounded-xl flex-shrink-0",children:(0,f.jsx)(is.A,{className:"w-5 h-5 text-white"})}),(0,f.jsxs)("div",{className:"flex-1 text-left",children:[(0,f.jsx)("div",{className:"font-semibold mb-1",children:"Logout"}),(0,f.jsx)("div",{className:"text-sm text-red-400/80",children:"Sign out of mobile admin"})]})]})}),(0,f.jsxs)("div",{className:"text-center pt-6 pb-4 text-gray-500 text-xs",children:[(0,f.jsx)("p",{children:"Turbo 360 Mobile Admin v1.0"}),(0,f.jsx)("p",{className:"mt-1",children:"Progressive Web App"})]})]})]})};var qN=s(29868);const HN=e=>{let{todo:t,onToggleComplete:s,onUpdate:n,onDelete:r,getStatusColor:i,editingId:o,setEditingId:l,clients:c}=e;const[d,p]=(0,a.useState)({project_name:t.project_name,description:t.description,status:t.status,client_id:t.client_id||"",client_company:t.client_company||"",contact_name:t.contact_name||""}),[x,h]=(0,a.useState)(!1);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"bg-white rounded-xl shadow-md p-4 border-2 transition-all ".concat(t.is_completed?"border-gray-200 opacity-60":"border-transparent"),children:(0,f.jsxs)("div",{className:"flex items-start gap-3",children:[(0,f.jsx)("button",{onClick:()=>s(t),className:"flex-shrink-0 mt-1",children:t.is_completed?(0,f.jsx)(In.A,{className:"w-6 h-6 text-green-500"}):(0,f.jsx)(qN.A,{className:"w-6 h-6 text-gray-300"})}),(0,f.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,f.jsx)("h3",{className:"font-bold mb-1 ".concat(t.is_completed?"line-through text-gray-400":"text-gray-900"),children:t.project_name}),(0,f.jsx)("div",{className:"text-sm mb-2 prose prose-sm max-w-none line-clamp-2 ".concat(t.is_completed?"line-through text-gray-400":"text-gray-600"),dangerouslySetInnerHTML:{__html:t.description}}),(0,f.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[(0,f.jsx)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-semibold border ".concat(i(t.status)),children:t.status}),(t.client_company||t.contact_name)&&(0,f.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[t.client_company&&(0,f.jsxs)("span",{className
1:"flex items-center gap-1",children:[(0,f.jsx)(gs.A,{className:"w-3 h-3"}),t.client_company]}),t.contact_name&&(0,f.jsxs)("span",{className:"flex items-center gap-1",children:[(0,f.jsx)(Ye.A,{className:"w-3 h-3"}),t.contact_name]})]}),t.completed_at&&(0,f.jsxs)("span",{className:"flex items-center gap-1 text-xs text-gray-400",children:[(0,f.jsx)(Nt.A,{className:"w-3 h-3"}),new Date(t.completed_at).toLocaleDateString("en-AU",{timeZone:"Australia/Melbourne"})]})]}),(0,f.jsxs)("div",{className:"flex gap-2",children:[(0,f.jsx)("button",{onClick:()=>h(!0),className:"text-xs px-3 py-1 text-purple-600 bg-purple-50 rounded-lg font-semibold",children:"Edit"}),(0,f.jsx)("button",{onClick:()=>r(t.id),className:"text-xs px-3 py-1 text-red-600 bg-red-50 rounded-lg font-semibold",children:"Delete"})]})]})]})}),x&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4",children:(0,f.jsxs)("div",{className:"bg-white w-full sm:max-w-lg rounded-t-3xl sm:rounded-3xl max-h-[90vh] overflow-y-auto",children:[(0,f.jsxs)("div",{className:"sticky top-0 bg-white border-b p-4 flex items-center justify-between rounded-t-3xl",children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"Edit Task"}),(0,f.jsx)("button",{onClick:()=>h(!1),className:"p-2 hover:bg-gray-100 rounded-lg",children:(0,f.jsx)(g.A,{className:"w-6 h-6"})})]}),(0,f.jsxs)("div",{className:"p-4 space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"Project Name"}),(0,f.jsx)("input",{type:"text",value:d.project_name,onChange:e=>p((0,m.A)((0,m.A)({},d),{},{project_name:e.target.value})),className:"w-full px-4 py-3 bg-gray-50 border border-gray-300 rounded-xl text-gray-900 focus:outline-none focus:ring-2 focus:ring-purple-500"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"Description"}),(0,f.jsx)("textarea",{value:d.description,onChange:e=>p((0,m.A)((0,m.A)({},d),{},{description:e.target.value})),rows:3,className:"w-full px-4 py-3 bg-gray-50 border border-gray-300 rounded-xl text-gray-900 focus:outline-none focus:ring-2 focus:ring-purple-500 resize-none"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"Status"}),(0,f.jsx)("input",{type:"text",list:"mobile-edit-status-options",value:d.status,onChange:e=>p((0,m.A)((0,m.A)({},d),{},{status:e.target.value})),className:"w-full px-4 py-3 bg-gray-50 border border-gray-300 rounded-xl text-gray-900 focus:outline-none focus:ring-2 focus:ring-purple-500",placeholder:"Enter or select status"}),(0,f.jsxs)("datalist",{id:"mobile-edit-status-options",children:[(0,f.jsx)("option",{value:"Not Started"}),(0,f.jsx)("option",{value:"In Progress"}),(0,f.jsx)("option",{value:"Completed"}),(0,f.jsx)("option",{value:"On Hold"}),(0,f.jsx)("option",{value:"Awaiting Client"}),(0,f.jsx)("option",{value:"Design Phase"}),(0,f.jsx)("option",{value:"Development"}),(0,f.jsx)("option",{value:"Review"}),(0,f.jsx)("option",{value:"Ready to Deploy"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"Assign to Client"}),(0,f.jsxs)("select",{value:d.client_id,onChange:e=>(e=>{if(!e)return void p(e=>(0,m.A)((0,m.A)({},e),{},{client_id:"",client_company:"",contact_name:""}));const t=c.find(t=>t.id===e);if(t)if(t.is_company)p(e=>(0,m.A)((0,m.A)({},e),{},{client_id:t.id,client_company:t.company_name,contact_name:""}));else{let e=t.parent_company_name||"";if(!e&&t.parent_company_id){const s=c.find(e=>e.id===t.parent_company_id);e=s?s.company_name:""}p(s=>(0,m.A)((0,m.A)({},s),{},{client_id:t.id,client_company:e,contact_name:"".concat(t.first_name||""," ").concat(t.last_name||"").trim()}))}})(e.target.value),className:"w-full px-4 py-3 bg-gray-50 border border-gray-300 rounded-xl text-gray-900 focus:outline-none focus:ring-2 focus:ring-purple-500",children:[(0,f.jsx)("option",{value:"",children:"-- No client --"}),(0,f.jsx)("optgroup",{label:"Companies",children:Array.isArray(c)&&c.filter(e=>e.is_company).map(e=>(0,f.jsxs)("option",{value:e.id,children:["\ud83c\udfe2 ",e.company_name]},e.id))}),(0,f.jsx)("optgroup",{label:"Contacts",children:Array.isArray(c)&&c.filter(e=>!e.is_company).map(e=>(0,f.jsxs)("option",{value:e.id,children:["\ud83d\udc64 ",e.first_name," ",e.last_name]},e.id))})]})]}),(0,f.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,f.jsx)("button",{onClick:()=>h(!1),className:"flex-1 px-4 py-3 bg-gray-200 text-gray-700 rounded-xl font-bold",children:"Cancel"}),(0,f.jsx)("button",{onClick:()=>{n(t.id,{project_name:d.project_name,description:d.description,status:d.status,client_id:d.client_id||null,client_company:d.client_company||null,contact_name:d.contact_name||null}),h(!1)},className:"flex-1 px-4 py-3 bg-gradient-to-r from-purple-600 to-pink-600 text-white rounded-xl font-bold",children:"Save"})]})]})]})})]})},UN=()=>{const e=(0,r.Zp)(),[t,s]=(0,a.useState)([]),[n,i]=(0,a.useState)(!0),[l,c]=(0,a.useState)(!1),[d,p]=(0,a.useState)(null),[x,h]=(0,a.useState)(""),[u,b]=(0,a.useState)(null),[y,v]=(0,a.useState)({project_name:"",description:"",status:"Not Started",client_id:"",client_company:"",contact_name:""}),[j,w]=(0,a.useState)([]);(0,a.useEffect)(()=>{N(),A()},[]);const N=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/admin/todos"),{headers:{Authorization:"Bearer ".concat(e)}}),a=await t.json();a.success&&s(a.todos)}catch(e){console.error("Error fetching todos:",e)}finally{i(!1)}},A=async()=>{try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/clients"),{headers:{Authorization:"Bearer ".concat(e)}});if(t.ok){const e=await t.json();Array.isArray(e)?w(e):e.clients&&Array.isArray(e.clients)?w(e.clients):w([])}else w([])}catch(e){console.error("Error fetching clients:",e),w([])}},k=async(e,t)=>{try{const s=(0,o.gf)(),a=await fetch("".concat(I.JR,"/api/admin/todos/").concat(e),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(s)},body:JSON.stringify(t)});(await a.json()).success&&(await N(),p(null))}catch(s){console.error("Error updating todo:",s)}},S=async e=>{if(window.confirm("Delete this to-do item?"))try{const t=(0,o.gf)(),s=await fetch("".concat(I.JR,"/api/admin/todos/").concat(e),{method:"DELETE",headers:{Authorization:"Bearer ".concat(t)}});(await s.json()).success&&await N()}catch(t){console.error("Error deleting todo:",t)}},_=async e=>{await k(e.id,{is_completed:!e.is_completed})},C=()=>{v({project_name:"",description:"",status:"Not Started",client_id:"",client_company:"",contact_name:""})},F=e=>{const t={"Not Started":"bg-gray-500/20 text-gray-700 border-gray-400","In Progress":"bg-blue-500/20 text-blue-700 border-blue-400",Completed:"bg-green-500/20 text-green-700 border-green-400","On Hold":"bg-orange-500/20 text-orange-700 border-orange-400"};return t[e]||t["Not Started"]},E=t.filter(e=>e.project_name.toLowerCase().includes(x.toLowerCase())||e.description.toLowerCase().includes(x.toLowerCase())||e.client_company&&e.client_company.toLowerCase().includes(x.toLowerCase())||e.contact_name&&e.contact_name.toLowerCase().includes(x.toLowerCase())),T=E.filter(e=>!e.is_completed),z=E.filter(e=>e.is_completed);return n?(0,f.jsx)("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:(0,f.jsxs)("div",{className:"text-center",children:[(0,f.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-purple-600 mx-auto"}),(0,f.jsx)("p",{className:"mt-4 text-gray-600",children:"Loading tasks..."})]})}):(0,f.jsxs)("div",{className:"min-h-screen bg-gray-50 pb-20",children:[(0,f.jsxs)("div",{className:"bg-gradient-to-r from-purple-600 to-pink-600 text-white p-4 sticky top-0 z-10 shadow-lg",children:[(0,f.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,f.jsx)("button",{onClick:()=>e("/webmanagement"),className:"p-2 hover:bg-white/20 rounded-lg transition-colors",children:(0,f.jsx)(Vg.A,{className:"w-6 h-6"})}),(0,f.jsx)("h1",{className:"text-2xl font-black flex-1 text-center",children:"To-Do List"}),(0,f.jsx)("button",{onClick:()=>c(!0),className:"p-2 bg-white/20 hover:bg-white/30 rounded-lg transition-colors",children:(0,f.jsx)(ls.A,{className:"w-6 h-6"})})]}),(0,f.jsxs)("div",{className:"relative",children:[(0,f.jsx)(ds.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-5 h-5 text-white/60"}),(0,f.jsx)("input",{type:"text",placeholder:"Search tasks...",value:x,onChange:e=>h(e.target.value),className:"w-full pl-10 pr-4 py-3 bg-white/20 backdrop-blur-sm border border-white/30 rounded-xl text-white placeholder-white/60 focus:outline-none focus:bg-white/30"})]})]}),l&&(0,f.jsx)("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4",children:(0,f.jsxs)("div",{className:"bg-white w-full sm:max-w-lg rounded-t-3xl sm:rounded-3xl max-h-[90vh] overflow-y-auto",children:[(0,f.jsxs)("div",{className:"sticky top-0 bg-white border-b p-4 flex items-center justify-between rounded-t-3xl",children:[(0,f.jsx)("h2",{className:"text-xl font-bold text-gray-900",children:"New Task"}),(0,f.jsx)("button",{onClick:()=>c(!1),className:"p-2 hover:bg-gray-100 rounded-lg",children:(0,f.jsx)(g.A,{className:"w-6 h-6"})})]}),(0,f.jsxs)("form",{onSubmit:async e=>{e.preventDefault();try{const e=(0,o.gf)(),t=await fetch("".concat(I.JR,"/api/admin/todos"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify(y)});(await t.json()).success&&(await N(),c(!1),C())}catch(t){console.error("Error creating todo:",t)}},className:"p-4 space-y-4",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"Project Name *"}),(0,f.jsx)("input",{type:"text",required:!0,value:y.project_name,onChange:e=>v((0,m.A)((0,m.A)({},y),{},{project_name:e.target.value})),className:"w-full px-4 py-3 bg-gray-50 border border-gray-300 rounded-xl text-gray-900 focus:outline-none focus:ring-2 focus:ring-purple-500",placeholder:"Enter project name"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"Status"}),(0,f.jsx)("input",{type:"text",list:"mobile-status-options",value:y.status,onChange:e=>v((0,m.A)((0,m.A)({},y),{},{status:e.target.value})),className:"w-full px-4 py-3 bg-gray-50 border border-gray-300 rounded-xl text-gray-900 focus:outline-none focus:ring-2 focus:ring-purple-500",placeholder:"Enter or select status"}),(0,f.jsxs)("datalist",{id:"mobile-status-options",children:[(0,f.jsx)("option",{value:"Not Started"}),(0,f.jsx)("option",{value:"In Progress"}),(0,f.jsx)("option",{value:"On Hold"}),(0,f.jsx)("option",{value:"Awaiting Client"}),(0,f.jsx)("option",{value:"Design Phase"}),(0,f.jsx)("option",{value:"Development"}),(0,f.jsx)("option",{value:"Review"}),(0,f.jsx)("option",{value:"Ready to Deploy"})]})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"Description *"}),(0,f.jsx)("textarea",{required:!0,value:y.description,onChange:e=>v((0,m.A)((0,m.A)({},y),{},{description:e.target.value})),rows:3,className:"w-full px-4 py-3 bg-gray-50 border border-gray-300 rounded-xl text-gray-900 focus:outline-none focus:ring-2 focus:ring-purple-500 resize-none",placeholder:"Describe the work"})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("label",{className:"block text-sm font-bold text-gray-700 mb-2",children:"Assign to Client (Optional)"}),(0,f.jsxs)("select",{value:y.client_id,onChange:e=>(e=>{if(!e)return void v(e=>(0,m.A)((0,m.A)({},e),{},{client_id:"",client_company:"",contact_name:""}));const t=j.find(t=>
1t.id===e);if(t)if(t.is_company)v(e=>(0,m.A)((0,m.A)({},e),{},{client_id:t.id,client_company:t.company_name,contact_name:""}));else{let e=t.parent_company_name||"";if(!e&&t.parent_company_id){const s=j.find(e=>e.id===t.parent_company_id);e=s?s.company_name:""}v(s=>(0,m.A)((0,m.A)({},s),{},{client_id:t.id,client_company:e,contact_name:"".concat(t.first_name||""," ").concat(t.last_name||"").trim()}))}})(e.target.value),className:"w-full px-4 py-3 bg-gray-50 border border-gray-300 rounded-xl text-gray-900 focus:outline-none focus:ring-2 focus:ring-purple-500",children:[(0,f.jsx)("option",{value:"",children:"-- No client --"}),(0,f.jsx)("optgroup",{label:"Companies",children:Array.isArray(j)&&j.filter(e=>e.is_company).sort((e,t)=>(e.company_name||"").localeCompare(t.company_name||"")).map(e=>(0,f.jsxs)("option",{value:e.id,children:["\ud83c\udfe2 ",e.company_name]},e.id))}),(0,f.jsx)("optgroup",{label:"Contacts",children:Array.isArray(j)&&j.filter(e=>!e.is_company).map(e=>(0,f.jsxs)("option",{value:e.id,children:["\ud83d\udc64 ",e.first_name," ",e.last_name]},e.id))})]})]}),(0,f.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,f.jsx)("button",{type:"button",onClick:()=>c(!1),className:"flex-1 px-4 py-3 bg-gray-200 text-gray-700 rounded-xl font-bold",children:"Cancel"}),(0,f.jsx)("button",{type:"submit",className:"flex-1 px-4 py-3 bg-gradient-to-r from-purple-600 to-pink-600 text-white rounded-xl font-bold",children:"Create"})]})]})]})}),(0,f.jsxs)("div",{className:"p-4 space-y-4",children:[T.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("h2",{className:"text-lg font-bold text-gray-900 mb-3",children:["Active Tasks (",T.length,")"]}),(0,f.jsx)("div",{className:"space-y-3",children:T.map(e=>(0,f.jsx)(HN,{todo:e,onToggleComplete:_,onUpdate:k,onDelete:S,getStatusColor:F,editingId:d,setEditingId:p,clients:j},e.id))})]}),z.length>0&&(0,f.jsxs)("div",{children:[(0,f.jsxs)("h2",{className:"text-lg font-bold text-gray-400 mb-3",children:["Completed (",z.length,")"]}),(0,f.jsx)("div",{className:"space-y-3",children:z.map(e=>(0,f.jsx)(HN,{todo:e,onToggleComplete:_,onUpdate:k,onDelete:S,getStatusColor:F,editingId:d,setEditingId:p,clients:j},e.id))})]}),0===t.length&&(0,f.jsxs)("div",{className:"text-center py-12",children:[(0,f.jsx)(In.A,{className:"w-20 h-20 text-gray-300 mx-auto mb-4"}),(0,f.jsx)("h3",{className:"text-xl font-bold text-gray-900 mb-2",children:"No tasks yet"}),(0,f.jsx)("p",{className:"text-gray-600 mb-6",children:"Create your first task to get started"}),(0,f.jsxs)("button",{onClick:()=>c(!0),className:"inline-flex items-center gap-2 px-6 py-3 bg-gradient-to-r from-purple-600 to-pink-600 text-white rounded-xl font-bold",children:[(0,f.jsx)(ls.A,{className:"w-5 h-5"}),"Create Task"]})]})]})]})},GN=(0,a.lazy)(()=>s.e(766).then(s.bind(s,21766))),VN=(0,a.lazy)(()=>s.e(411).then(s.bind(s,65792))),JN=(0,a.lazy)(()=>Promise.all([s.e(925),s.e(16)]).then(s.bind(s,25016))),YN=(0,a.lazy)(()=>Promise.all([s.e(925),s.e(984)]).then(s.bind(s,7984))),KN=(0,a.lazy)(()=>Promise.all([s.e(925),s.e(507)]).then(s.bind(s,28507))),ZN=(0,a.lazy)(()=>s.e(531).then(s.bind(s,91531))),$N=()=>{const e=(0,r.zy)();return"v5"===new URLSearchParams(e.search).get("editor")?(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)("div",{}),children:(0,f.jsx)(ZN,{})}):(0,f.jsx)(Qo,{},"corporate-edit")};function QN(e){let{to:t}=e;return(0,a.useEffect)(()=>{window.location.href=t},[t]),null}function XN(){return(()=>{const[e,t]=(0,a.useState)(!1),s=(0,r.Zp)(),n=(0,r.zy)();(0,a.useEffect)(()=>{const e=window.location.hostname,a="portal.turbo360.au"===e||"portal.turbo360.com.au"===e;t(a),a&&!n.pathname.startsWith("/client-portal")&&(console.log("Portal subdomain detected, redirecting to client portal..."),s("/client-portal",{replace:!0}))},[s,n])})(),null}function eA(){const e=(0,r.zy)(),t=k(),s=e.pathname.startsWith("/proposal/"),a=e.pathname.startsWith("/consent/"),n="/dumpradio"===e.pathname||"/dumpradio1"===e.pathname,i=e.pathname.startsWith("/webmanagement"),o=e.pathname.startsWith("/client-portal")||"/client-login"===e.pathname,l="/corporate-event-photographer-melbourne"===e.pathname||"/conference-photographer-melbourne"===e.pathname||"/contact/thank-you"===e.pathname,c=e.pathname.startsWith("/wedding-booking"),d="/dmamembers"===e.pathname;return s||a||n||i||o||l||c||d||t.hideRadioPlayer,null}function tA(){const e=(0,r.zy)();return e.pathname.startsWith("/national-media")||e.pathname.startsWith("/terrapinn")||e.pathname.startsWith("/wmedia")||e.pathname.startsWith("/lifeblood")||e.pathname.startsWith("/dumpradio")||e.pathname.startsWith("/school/")?null:(0,f.jsx)(fj,{})}function sA(){const{pathname:e}=(0,r.zy)();return(0,a.useEffect)(()=>{window.scrollTo(0,0)},[e]),null}const aA=function(){return(0,a.useEffect)(()=>{i.A.interceptors.response.use(e=>e,e=>{var t;return 401===(null===(t=e.response)||void 0===t?void 0:t.status)&&c(),Promise.reject(e)})},[]),(0,f.jsx)(d.vd,{children:(0,f.jsx)(A,{children:(0,f.jsx)("div",{className:"App",children:(0,f.jsxs)(r.Kd,{children:[(0,f.jsx)(sA,{}),(0,f.jsx)(XN,{}),(0,f.jsx)(gn,{children:(0,f.jsxs)(r.BV,{children:[(0,f.jsx)(r.qh,{path:"/",element:(0,f.jsx)(He,{})}),(0,f.jsx)(r.qh,{path:"/home-old",element:(0,f.jsx)(J,{})}),(0,f.jsx)(r.qh,{path:"/home-legacy",element:(0,f.jsx)(xt,{})}),(0,f.jsx)(r.qh,{path:"/about",element:(0,f.jsx)($a,{})}),(0,f.jsx)(r.qh,{path:"/privacy",element:(0,f.jsx)(Qa,{})}),(0,f.jsx)(r.qh,{path:"/get-quote",element:(0,f.jsx)(Sy,{})}),(0,f.jsx)(r.qh,{path:"/tboadmin",element:(0,f.jsx)(jt,{})}),(0,f.jsx)(r.qh,{path:"/tboadmin/database-migration",element:(0,f.jsx)(uf,{})}),(0,f.jsx)(r.qh,{path:"/wedding-admin/login",element:(0,f.jsx)(jt,{})}),(0,f.jsx)(r.qh,{path:"/client-login",element:(0,f.jsx)(_y,{})}),(0,f.jsx)(r.qh,{path:"/client/:clientId",element:(0,f.jsx)(Fy,{})}),(0,f.jsx)(r.qh,{path:"/client-portal/verify",element:(0,f.jsx)(Cy,{})}),(0,f.jsx)(r.qh,{path:"/client-portal/dashboard",element:(0,f.jsx)(xv,{})}),(0,f.jsx)(r.qh,{path:"/client-portal/new-job",element:(0,f.jsx)(Ev,{})}),(0,f.jsx)(r.qh,{path:"/conferences",element:(0,f.jsx)(Ba,{})}),(0,f.jsx)(r.qh,{path:"/weddings",element:(0,f.jsx)(QN,{to:"https://weddings.turbo.net.au"})}),(0,f.jsx)(r.qh,{path:"/business",element:(0,f.jsx)(Pa,{})}),(0,f.jsx)(r.qh,{path:"/business-content",element:(0,f.jsx)(ww.A,{to:"/business"})}),(0,f.jsx)(r.qh,{path:"/recent-gigs",element:(0,f.jsx)(vi,{})}),(0,f.jsx)(r.qh,{path:"/recent-gigs/:slug",element:(0,f.jsx)(Si,{})}),(0,f.jsx)(r.qh,{path:"/schools",element:(0,f.jsx)(Va,{})}),(0,f.jsx)(r.qh,{path:"/development",element:(0,f.jsx)(dn,{})}),(0,f.jsx)(r.qh,{path:"/corporate-event-photographer-melbourne",element:(0,f.jsx)(ww.A,{to:"/services/corporate-event-photography/melbourne"})}),(0,f.jsx)(r.qh,{path:"/conference-photographer-melbourne",element:(0,f.jsx)(ww.A,{to:"/services/conference-photography/melbourne"})}),(0,f.jsx)(r.qh,{path:"/contact/thank-you",element:(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)("div",{}),children:(0,f.jsx)(GN,{})})}),(0,f.jsx)(r.qh,{path:"/video-production-melbourne",element:(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)("div",{}),children:(0,f.jsx)(VN,{pageId:"video-production-melbourne"})})}),(0,f.jsx)(r.qh,{path:"/corporate-video-melbourne",element:(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)("div",{}),children:(0,f.jsx)(VN,{pageId:"corporate-video-melbourne"})})}),(0,f.jsx)(r.qh,{path:"/services",element:(0,f.jsx)(Ew,{})}),(0,f.jsx)(r.qh,{path:"/services/:serviceSlug",element:(0,f.jsx)(tN,{})}),(0,f.jsx)(r.qh,{path:"/services/locations/:citySlug",element:(0,f.jsx)(nN,{})}),(0,f.jsx)(r.qh,{path:"/services/:serviceSlug/:citySlug",element:(0,f.jsx)(gN,{})}),(0,f.jsx)(r.qh,{path:"/venues/:venueSlug",element:(0,f.jsx)(wN,{})}),(0,f.jsx)(r.qh,{path:"/venues/:venueSlug/:serviceSlug",element:(0,f.jsx)(AN,{})}),(0,f.jsx)(r.qh,{path:"/event-photography",element:(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)("div",{}),children:(0,f.jsx)(JN,{})})}),(0,f.jsx)(r.qh,{path:"/event-photography/:citySlug",element:(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)("div",{}),children:(0,f.jsx)(YN,{})})}),(0,f.jsx)(r.qh,{path:"/event-photography/:citySlug/:venueSlug",element:(0,f.jsx)(a.Suspense,{fallback:(0,f.jsx)("div",{}),children:(0,f.jsx)(KN,{})})}),(0,f.jsx)(r.qh,{path:"/dumpradio",element:(0,f.jsx)(mn,{})}),(0,f.jsx)(r.qh,{path:"/dumpradio1",element:(0,f.jsx)(hn,{})}),(0,f.jsx)(r.qh,{path:"/packages",element:(0,f.jsx)(St,{})}),(0,f.jsx)(r.qh,{path:"/packages/build",element:(0,f.jsx)(Xt,{})}),(0,f.jsx)(r.qh,{path:"/packages/quote/:quoteId",element:(0,f.jsx)(ts,{})}),(0,f.jsx)(r.qh,{path:"/admin/packages",element:(0,f.jsx)(ra,{})}),(0,f.jsx)(r.qh,{path:"/admin/packages/items",element:(0,f.jsx)(ga,{})}),(0,f.jsx)(r.qh,{path:"/admin/packages/rules",element:(0,f.jsx)(fa,{})}),(0,f.jsx)(r.qh,{path:"/admin/packages/quotes",element:(0,f.jsx)(Sa,{})}
1),(0,f.jsx)(r.qh,{path:"/admin/packages/settings",element:(0,f.jsx)(_a,{})}),(0,f.jsx)(r.qh,{path:"/customer/auth",element:(0,f.jsx)(Ca,{})}),(0,f.jsx)(r.qh,{path:"/customer/dashboard",element:(0,f.jsx)(Fa,{})}),(0,f.jsx)(r.qh,{path:"/customer/quote/:quoteId",element:(0,f.jsx)(Ta,{})}),(0,f.jsx)(r.qh,{path:"/weddingform",element:(0,f.jsx)(kn,{})}),(0,f.jsx)(r.qh,{path:"/admin/calendar",element:(0,f.jsx)(pw,{})}),(0,f.jsx)(r.qh,{path:"/admin",element:(0,f.jsx)(rr,{})}),(0,f.jsx)(r.qh,{path:"/admin/dashboard",element:(0,f.jsx)(rr,{})}),(0,f.jsx)(r.qh,{path:"/admin/reports",element:(0,f.jsx)(db,{})}),(0,f.jsx)(r.qh,{path:"/admin/todos",element:(0,f.jsx)(Ar,{})}),(0,f.jsx)(r.qh,{path:"/admin/weddings",element:(0,f.jsx)(Pr,{})}),(0,f.jsx)(r.qh,{path:"/admin/live-streams",element:(0,f.jsx)(pj,{})}),(0,f.jsx)(r.qh,{path:"/admin/live-uploads",element:(0,f.jsx)(Sj,{})}),(0,f.jsx)(r.qh,{path:"/admin/corporate",element:(0,f.jsx)(Gr,{})}),(0,f.jsx)(r.qh,{path:"/admin/recent-gigs",element:(0,f.jsx)(ii,{})}),(0,f.jsx)(r.qh,{path:"/admin/popups",element:(0,f.jsx)(bi,{})}),(0,f.jsx)(r.qh,{path:"/admin/corporate/create",element:(0,f.jsx)(Qo,{})}),(0,f.jsx)(r.qh,{path:"/admin/corporate/edit/:eventId",element:(0,f.jsx)($N,{})}),(0,f.jsx)(r.qh,{path:"/admin/content-delivery",element:(0,f.jsx)(kl,{})}),(0,f.jsx)(r.qh,{path:"/admin/proposals",element:(0,f.jsx)(ec,{})}),(0,f.jsx)(r.qh,{path:"/admin/proposals/create",element:(0,f.jsx)(pc,{})}),(0,f.jsx)(r.qh,{path:"/admin/proposals/edit/:proposalId",element:(0,f.jsx)(pc,{},"proposal-edit")}),(0,f.jsx)(r.qh,{path:"/admin/proposals/:proposalId",element:(0,f.jsx)(Ac,{},"proposal-view")}),(0,f.jsx)(r.qh,{path:"/admin/service-catalog",element:(0,f.jsx)(Fg,{})}),(0,f.jsx)(r.qh,{path:"/admin/services",element:(0,f.jsx)(bg,{})}),(0,f.jsx)(r.qh,{path:"/admin/services/create",element:(0,f.jsx)(wg,{})}),(0,f.jsx)(r.qh,{path:"/admin/services/edit/:serviceId",element:(0,f.jsx)(wg,{},"service-edit")}),(0,f.jsx)(r.qh,{path:"/admin/clients",element:(0,f.jsx)(Wg,{})}),(0,f.jsx)(r.qh,{path:"/admin/clients/company/:companyId",element:(0,f.jsx)(lf,{})}),(0,f.jsx)(r.qh,{path:"/admin/clients/create",element:(0,f.jsx)(Ug,{})}),(0,f.jsx)(r.qh,{path:"/admin/clients/edit/:clientId",element:(0,f.jsx)(Ug,{},"client-edit")}),(0,f.jsx)(r.qh,{path:"/admin/leads",element:(0,f.jsx)(uy,{})}),(0,f.jsx)(r.qh,{path:"/admin/leads/:leadId",element:(0,f.jsx)(ky,{},"lead-view")}),(0,f.jsx)(r.qh,{path:"/admin/invoices",element:(0,f.jsx)(_f,{})}),(0,f.jsx)(r.qh,{path:"/admin/invoices/recurring",element:(0,f.jsx)(my,{})}),(0,f.jsx)(r.qh,{path:"/admin/invoices/create",element:(0,f.jsx)(_b,{})}),(0,f.jsx)(r.qh,{path:"/admin/invoices/edit/:invoiceId",element:(0,f.jsx)(gb,{},"invoice-edit")}),(0,f.jsx)(r.qh,{path:"/admin/invoices/:invoiceId",element:(0,f.jsx)(zb,{},"invoice-view")}),(0,f.jsx)(r.qh,{path:"/admin/recurring-invoices/create",element:(0,f.jsx)(ay,{})}),(0,f.jsx)(r.qh,{path:"/admin/recurring-invoices/edit/:recurringId",element:(0,f.jsx)(ay,{},"recurring-edit")}),(0,f.jsx)(r.qh,{path:"/admin/default-terms",element:(0,f.jsx)(Sc,{})}),(0,f.jsx)(r.qh,{path:"/admin/backup-restore",element:(0,f.jsx)(Wl,{})}),(0,f.jsx)(r.qh,{path:"/admin/marketing",element:(0,f.jsx)(El,{})}),(0,f.jsx)(r.qh,{path:"/admin/consent",element:(0,f.jsx)(zj,{})}),(0,f.jsx)(r.qh,{path:"/admin/consent/create",element:(0,f.jsx)(Rj,{})}),(0,f.jsx)(r.qh,{path:"/admin/consent/edit/:projectId",element:(0,f.jsx)(Rj,{},"consent-edit")}),(0,f.jsx)(r.qh,{path:"/admin/consent/:projectId",element:(0,f.jsx)(qj,{})}),(0,f.jsx)(r.qh,{path:"/admin/settings",element:(0,f.jsx)(Bl,{})}),(0,f.jsx)(r.qh,{path:"/admin/crew",element:(0,f.jsx)(hf,{})}),(0,f.jsx)(r.qh,{path:"/admin/crew/create",element:(0,f.jsx)(bf,{})}),(0,f.jsx)(r.qh,{path:"/admin/crew/:crewId",element:(0,f.jsx)(bf,{},"crew-edit")}),(0,f.jsx)(r.qh,{path:"/crew/login",element:(0,f.jsx)(vf,{})}),(0,f.jsx)(r.qh,{path:"/crew/dashboard",element:(0,f.jsx)(jf,{})}),(0,f.jsx)(r.qh,{path:"/corporate-runsheet/:eventId",element:(0,f.jsx)(jl,{})}),(0,f.jsx)(r.qh,{path:"/consent/:slug",element:(0,f.jsx)(Gj,{})}),(0,f.jsx)(r.qh,{path:"/proposal/decline",element:(0,f.jsx)(bc,{})}),(0,f.jsx)(r.qh,{path:"/proposal/:proposalId",element:(0,f.jsx)(gc,{})}),(0,f.jsx)(r.qh,{path:"/invoice/:invoiceId",element:(0,f.jsx)($b,{})}),(0,f.jsx)(r.qh,{path:"/content-hub",element:(0,f.jsx)(_c,{})}),(0,f.jsx)(r.qh,{path:"/dmamembers",element:(0,f.jsx)(vw,{})}),(0,f.jsx)(r.qh,{path:"/ahw2026",element:(0,f.jsx)(r.C5,{to:"/ahw2026/book",replace:!0})}),(0,f.jsx)(r.qh,{path:"/ahw2026/book",element:(0,f.jsx)(Cc,{})}),(0,f.jsx)(r.qh,{path:"/admin/ahw2026",element:(0,f.jsx)(zc,{})}),(0,f.jsx)(r.qh,{path:"/agha",element:(0,f.jsx)(r.C5,{to:"/agha/book",replace:!0})}),(0,f.jsx)(r.qh,{path:"/agha/book",element:(0,f.jsx)(Gc,{})}),(0,f.jsx)(r.qh,{path:"/lifeblood/login",element:(0,f.jsx)(Yx,{})}),(0,f.jsx)(r.qh,{path:"/national-media/login",element:(0,f.jsx)(cd,{})}),(0,f.jsx)(r.qh,{path:"/national-media",element:(0,f.jsx)(ud,{})}),(0,f.jsx)(r.qh,{path:"/admin/national-media",element:(0,f.jsx)(dm,{})}),(0,f.jsx)(r.qh,{path:"/terrapinn/login",element:(0,f.jsx)(Ym,{accountKey:"terrapinn"})}),(0,f.jsx)(r.qh,{path:"/terrapinn",element:(0,f.jsx)(Ep,{accountKey:"terrapinn"})}),(0,f.jsx)(r.qh,{path:"/wmedia/login",element:(0,f.jsx)(Ym,{accountKey:"wmedia"})}),(0,f.jsx)(r.qh,{path:"/wmedia",element:(0,f.jsx)(Ep,{accountKey:"wmedia"})}),(0,f.jsx)(r.qh,{path:"/admin/terrapinn",element:(0,f.jsx)(Cx,{accountKey:"terrapinn"})}),(0,f.jsx)(r.qh,{path:"/admin/wmedia",element:(0,f.jsx)(Cx,{accountKey:"wmedia"})}),(0,f.jsx)(r.qh,{path:"/admin/lifeblood",element:(0,f.jsx)(Ph,{})}),(0,f.jsx)(r.qh,{path:"/admin/school-productions",element:(0,f.jsx)(uu,{})}),(0,f.jsx)(r.qh,{path:"/school/:slug",element:(0,f.jsx)(cg,{})}),(0,f.jsx)(r.qh,{path:"/admin/agha",element:(0,f.jsx)(Jd,{})}),(0,f.jsx)(r.qh,{path:"/agha-staff/login",element:(0,f.jsx)(dg,{})}),(0,f.jsx)(r.qh,{path:"/agha-staff",element:(0,f.jsx)(pg,{})}),(0,f.jsx)(r.qh,{path:"/wedding-admin",element:(0,f.jsx)(rr,{})}),(0,f.jsx)(r.qh,{path:"/wedding-share/:shareToken",element:(0,f.jsx)(Tv,{})}),(0,f.jsx)(r.qh,{path:"/live/:slug",element:(0,f.jsx)(gj,{})}),(0,f.jsx)(r.qh,{path:"/wedding-booking",element:(0,f.jsx)(ej,{})}),(0,f.jsx)(r.qh,{path:"/wedding-booking-management",element:(0,f.jsx)(tj,{})}),(0,f.jsx)(r.qh,{path:"/webmanagement",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{
1children:(0,f.jsx)(TN,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/todos",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(UN,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/leads",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(zN,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/leads/:leadId",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(ky,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/proposals",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(BN,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/proposals/:proposalId",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(DN,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/clients",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(IN,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/clients/:clientId",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(Ug,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/invoices",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(RN,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/runsheets",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(PN,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/content",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(WN,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/services",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(ON,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/backup",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(LN,{})})})}),(0,f.jsx)(r.qh,{path:"/webmanagement/more",element:(0,f.jsx)(EN,{children:(0,f.jsx)(_N,{children:(0,f.jsx)(MN,{})})})}),(0,f.jsx)(r.qh,{path:"*",element:(0,f.jsx)(jw,{})})]})}),(0,f.jsx)(eA,{}),(0,f.jsx)(tA,{})]})})})})},nA=document.getElementById("root");if(nA.hasChildNodes())n.hydrateRoot(nA,(0,f.jsx)(a.StrictMode,{children:(0,f.jsx)(aA,{})}));else{n.createRoot(nA).render((0,f.jsx)(a.StrictMode,{children:(0,f.jsx)(aA,{})}))}"serviceWorker"in navigator&&navigator.serviceWorker.getRegistrations().then(e=>{e.forEach(e=>{e.unregister().then(()=>{console.log("\ud83d\uddd1\ufe0f Service Worker unregistered")})})})},51875:(e,t,s)=>{s.d(t,{A:()=>p});var a=s(65043),n=s(25352),r=s(85692),i=s(63574),o=s(21732),l=s(64996),c=s(70579);let d=null,m=null;function p(e){let{citySlug:t,venueName:s,heading:p,limit:x=4}=e;const[h,u]=(0,a.useState)(null);if((0,a.useEffect)(()=>{let e=!1;return async function(){return d||(m||(m=fetch("".concat(i.fn,"/api/public/recent-gigs")).then(e=>e.json()).then(e=>(d=e.success&&e.gigs||[],d)).catch(()=>(m=null,[]))),m)}().then(a=>{e||u((0,o.Jf)(a,{citySlug:t,venueName:s}).slice(0,x))}),()=>{e=!0}},[t,s,x]),!h||0===h.length)return null;const g=p||(s?"Recent work at ".concat(s):"Recent work");return(0,c.jsxs)(l.wn,{children:[(0,c.jsxs)(l.gN,{className:"mb-10",children:[(0,c.jsx)(l.YZ,{className:"mb-[18px]",children:"Recent gigs"}),(0,c.jsx)(l.nl,{className:"text-[clamp(32px,4.4vw,58px)]",children:g})]}),(0,c.jsx)("div",{className:"grid gap-[18px] md:grid-cols-2",children:h.map((e,t)=>(0,c.jsx)(l.gN,{delay:t%2*60,children:(0,c.jsxs)(n.N_,{to:"/recent-gigs/".concat(e.slug),className:"group flex h-full overflow-hidden rounded-[10px] border border-[#262626] bg-[#1A1A1A] transition-colors hover:border-turbo-red",children:[e.hero_image?(0,c.jsx)("div",{className:"h-auto w-28 flex-shrink-0 overflow-hidden bg-[#111] sm:w-36",children:(0,c.jsx)("img",{src:e.hero_image,alt:"",className:"h-full w-full object-cover transition-transform duration-700 group-hover:scale-[1.06]"})}):null,(0,c.jsxs)("div",{className:"flex flex-1 flex-col justify-center p-5",children:[(0,c.jsx)("div",{className:"font-head text-lg font-bold text-smoke transition-colors group-hover:text-turbo-red",children:e.job_title}),e.location?(0,c.jsx)("div",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.12em] text-fog",children:e.location}):null,e.excerpt?(0,c.jsx)("p",{className:"mt-2 line-clamp-2 text-sm text-[#9C9A95]",children:e.excerpt}):null,(0,c.jsxs)("span",{className:"mt-3 inline-flex items-center gap-1 font-head text-sm font-semibold text-turbo-red",children:["Read the gig ",(0,c.jsx)(r.A,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]})]})]})},e.slug))}),(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsxs)(n.N_,{to:"/recent-gigs",className:"inline-flex items-center gap-2 font-mono text-sm font-bold uppercase tracking-widest text-turbo-red hover:text-redline",children:["All recent gigs ",(0,c.jsx)(r.A,{className:"h-4 w-4"})]})})]})}},59938:(e,t,s)=>{s.d(t,{J:()=>p});var a=s(89379),n=s(53986),r=s(65043),i=s(92367),o=s(10917),l=s(1089),c=s(70579);const d=["className"],m=(0,o.F)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),p=r.forwardRef((e,t)=>
1{let{className:s}=e,r=(0,n.A)(e,d);return(0,c.jsx)(i.b,(0,a.A)({ref:t,className:(0,l.cn)(m(),s)},r))});p.displayName=i.b.displayName},63572:(e,t,s)=>{s.d(t,{Wx:()=>n,s0:()=>m,wB:()=>r});var a=s(65043);function n(){let{threshold:e=.08,rootMargin:t="0px 0px -6% 0px"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=(0,a.useRef)(null),[n,r]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if("undefined"===typeof window)return;const a=s.current;if(!a)return;if(window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return void r(!0);if(!("IntersectionObserver"in window))return void r(!0);const n=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(r(!0),n.unobserve(e.target))})},{threshold:e,rootMargin:t});return n.observe(a),()=>n.disconnect()},[e,t]),[s,n]}function r(e){return["transition-all duration-[900ms] ease-turbo",e?"opacity-100 translate-y-0":"opacity-0 translate-y-[26px]"].join(" ")}const i=new Set;let o=0;function l(){const e=document.documentElement,t=e.clientHeight||window.innerHeight;return{y:window.scrollY,vh:t,vw:window.innerWidth,docH:Math.max(1,e.scrollHeight-t)}}function c(){o=0;const e=l();i.forEach(t=>t(e))}function d(){o||(o=requestAnimationFrame(c))}function m(e){const t=(0,a.useRef)(e);t.current=e,(0,a.useLayoutEffect)(()=>{if("undefined"===typeof window)return;const e=e=>t.current(e);return i.size||(window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",d)),i.add(e),e(l()),()=>{i.delete(e),i.size||(window.removeEventListener("scroll",d),window.removeEventListener("resize",d),o&&cancelAnimationFrame(o),o=0)}},[])}},63574:(e,t,s)=>{s.d(t,{JR:()=>r,fn:()=>n,wE:()=>a});const a=()=>{const e=window.location.hostname,t=window.location.origin;return"turbo.net.au"===e||"www.turbo.net.au"===e?"https://turbo.net.au":e.includes("emergent.host")||e.includes("emergentagent.com")||e.includes("preview.emergentagent.com")?t:"localhost"===e||"127.0.0.1"===e?"http://localhost:8001":"https://turbo.net.au"},n=a(),r=a();window.location.hostname.includes("emergent")&&(console.log("\ud83d\udd27 Backend URL:",n),console.log("\ud83c\udf10 Current Domain:",window.location.hostname));a()},63981:(e,t,s)=>{s.d(t,{YQ:()=>r,_I:()=>a,tp:()=>i});const a={"@type":"AggregateRating",ratingValue:"5",reviewCount:"180",bestRating:"5",worstRating:"1"},n=["https://www.instagram.com/turbo360au","https://www.facebook.com/turbo.au","https://www.linkedin.com/company/turbo360"],r=e=>({"@type":"ProfessionalService",name:"Turbo 360",legalName:"Turbo Productions PTY LTD",url:e,logo:"".concat(e,"/turbo-logo-new.png"),image:"".concat(e,"/og-image.jpg"),telephone:"+61-1300-207-446",email:"[email protected]",priceRange:"$$",foundingDate:"1999",address:{"@type":"PostalAddress",addressLocality:"Barwon Heads",addressRegion:"Victoria",postalCode:"3227",addressCountry:"AU"},aggregateRating:a,sameAs:n}),i=e=>({logo:"".concat(e,"/turbo-logo-new.png"),image:"".concat(e,"/og-image.jpg"),priceRange:"$$",address:{"@type":"PostalAddress",addressLocality:"Barwon Heads",addressRegion:"Victoria",postalCode:"3227",addressCountry:"AU"},aggregateRating:a,sameAs:n})},64001:(e,t,s)=>{s.d(t,{AB:()=>f,J5:()=>b,Qp:()=>g,tH:()=>j,tJ:()=>v,w1:()=>y});var a=s(53986),n=s(89379),r=s(20454),i=s(65043),o=s(16851),l=(s(5379),s(38326)),c=s(1089),d=s(70579);const m=["className"],p=["className"],x=["asChild","className"],h=["className"],u=["children","className"],g=i.forwardRef((e,t)=>{let s=Object.assign({},((0,r.A)(e),e));return(0,d.jsx)("nav",(0,n.A)({ref:t,"aria-label":"breadcrumb"},s))});g.displayName="Breadcrumb";const f=i.forwardRef((e,t)=>{let{className:s}=e,r=(0,a.A)(e,m);return(0,d.jsx)("ol",(0,n.A)({ref:t,className:(0,c.cn)("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",s)},r))});f.displayName="BreadcrumbList";const b=i.forwardRef((e,t)=>{let{className:s}=e,r=(0,a.A)(e,p);return(0,d.jsx)("li",(0,n.A)({ref:t,className:(0,c.cn)("inline-flex items-center gap-1.5",s)},r))});b.displayName="BreadcrumbItem";const y=i.forwardRef((e,t)=>{let{asChild:s,className:r}=e,i=(0,a.A)(e,x);const l=s?o.DX:"a";
1return(0,d.jsx)(l,(0,n.A)({ref:t,className:(0,c.cn)("transition-colors hover:text-foreground",r)},i))});y.displayName="BreadcrumbLink";const v=i.forwardRef((e,t)=>{let{className:s}=e,r=(0,a.A)(e,h);return(0,d.jsx)("span",(0,n.A)({ref:t,role:"link","aria-disabled":"true","aria-current":"page",className:(0,c.cn)("font-normal text-foreground",s)},r))});v.displayName="BreadcrumbPage";const j=e=>{let{children:t,className:s}=e,r=(0,a.A)(e,u);return(0,d.jsx)("li",(0,n.A)((0,n.A)({role:"presentation","aria-hidden":"true",className:(0,c.cn)("[&>svg]:w-3.5 [&>svg]:h-3.5",s)},r),{},{children:null!==t&&void 0!==t?t:(0,d.jsx)(l.A,{})}))};j.displayName="BreadcrumbSeparator"},64996:(e,t,s)=>{s.d(t,{$$:()=>f,Wx:()=>i.Wx,YZ:()=>m,gN:()=>p,mP:()=>d,nl:()=>x,qM:()=>b,wn:()=>h});var a=s(89379),n=s(53986),r=s(25352),i=s(63572),o=s(70579);const l=["to","href","children","className"],c=["to","href","children","className"];function d(e){let{children:t,className:s=""}=e;return(0,o.jsx)("div",{className:"min-h-screen bg-carbon pt-[76px] text-smoke ".concat(s),style:{fontFamily:"'Hanken Grotesk', system-ui, -apple-system, sans-serif"},children:t})}function m(e){let{children:t,className:s=""}=e;return(0,o.jsx)("div",{className:"font-mono text-xs uppercase tracking-[0.3em] text-turbo-red ".concat(s),children:t})}function p(e){let{children:t,delay:s=0,className:a="",as:n="div"}=e;const[r,l]=(0,i.Wx)();return(0,o.jsx)(n,{ref:r,"data-reveal":!0,className:"".concat((0,i.wB)(l)," ").concat(a),style:s?{transitionDelay:"".concat(s,"ms")}:void 0,children:t})}function x(e){let{children:t,as:s="h2",className:a=""}=e;return(0,o.jsx)(s,{className:"font-display font-extrabold leading-[0.96] tracking-[-0.02em] text-smoke ".concat(a),children:t})}function h(e){let{id:t,children:s,className:a="",tone:n="carbon"}=e;const r="smoke"===n?"bg-smoke text-carbon":"carbon-900"===n?"bg-carbon-900":"bg-carbon";return(0,o.jsx)("section",{id:t,className:"border-t border-[#222] px-[22px] py-20 md:px-11 md:py-[120px] ".concat(r," ").concat(a),children:(0,o.jsx)("div",{className:"mx-auto max-w-7xl",children:s})})}const u="inline-flex items-center justify-center gap-2 rounded-lg bg-turbo-red px-[34px] py-[18px] font-head text-base font-bold text-white transition-transform duration-[400ms] ease-turbo hover:-translate-y-[3px] hover:bg-redline",g="inline-flex items-center justify-center gap-2 rounded-lg border border-white/20 px-[30px] py-[18px] font-head text-base font-semibold text-smoke transition-colors hover:border-white/40";function f(e){let{to:t,href:s,children:i,className:c=""}=e,d=(0,n.A)(e,l);const m="".concat(u," ").concat(c);return t?(0,o.jsx)(r.N_,(0,a.A)((0,a.A)({to:t,className:m},d),{},{children:i})):(0,o.jsx)("a",(0,a.A)((0,a.A)({href:s,className:m},d),{},{children:i}))}function b(e){let{to:t,href:s,children:i,className:l=""}=e,d=(0,n.A)(e,c);const m="".concat(g," ").concat(l);return t?(0,o.jsx)(r.N_,(0,a.A)((0,a.A)({to:t,className:m},d),{},{children:i})):(0,o.jsx)("a",(0,a.A)((0,a.A)({href:s,className:m},d),{},{children:i}))}},65005:(e,t,s)=>{s.d(t,{S:()=>m});var a=s(89379),n=s(53986),r=s(65043),i=s(76622),o=s(36210),l=s(1089),c=s(70579);const d=["className"],m=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,d);return(0,c.jsx)(i.bL,(0,a.A)((0,a.A)({ref:t,className:(0,l.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s)},r),{},{children:(0,c.jsx)(i.C1,{className:(0,l.cn)("flex items-center justify-center text-current"),children:(0,c.jsx)(o.A,{className:"h-4 w-4"})})}))});m.displayName=i.bL.displayName},65598:(e,t,s)=>{s.d(t,{Cf:()=>y,Es:()=>j,L3:()=>w,c7:()=>v,lG:()=>g,rr:()=>N});var a=s(89379),n=s(53986),r=s(65043),i=s(5179),o=s(40614),l=s(1089),c=s(70579);const d=["className"],m=["className","children"],p=["className"],x=["className"],h=["className"],u=["className"],g=i.bL,f=(i.l9,i.ZL),b=(i.bm,r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,d);return(0,c.jsx)(i.hJ,(0,a.A)({ref:t,className:(0,l.cn)("fixed inset-0 z-[9998] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s)},r))}));b.displayName=i.hJ.displayName;const y=r.forwardRef((e,t)=>
1{let{className:s,children:r}=e,d=(0,n.A)(e,m);return(0,c.jsxs)(f,{children:[(0,c.jsx)(b,{}),(0,c.jsxs)(i.UC,(0,a.A)((0,a.A)({ref:t,className:(0,l.cn)("fixed left-[50%] top-[50%] z-[9999] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[50%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[50%] sm:rounded-lg",s)},d),{},{children:[r,(0,c.jsxs)(i.bm,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,c.jsx)(o.A,{className:"h-4 w-4"}),(0,c.jsx)("span",{className:"sr-only",children:"Close"})]})]}))]})});y.displayName=i.UC.displayName;const v=e=>{let{className:t}=e,s=(0,n.A)(e,p);return(0,c.jsx)("div",(0,a.A)({className:(0,l.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t)},s))};v.displayName="DialogHeader";const j=e=>{let{className:t}=e,s=(0,n.A)(e,x);return(0,c.jsx)("div",(0,a.A)({className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},s))};j.displayName="DialogFooter";const w=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,h);return(0,c.jsx)(i.hE,(0,a.A)({ref:t,className:(0,l.cn)("text-lg font-semibold leading-none tracking-tight",s)},r))});w.displayName=i.hE.displayName;const N=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,u);return(0,c.jsx)(i.VY,(0,a.A)({ref:t,className:(0,l.cn)("text-sm text-muted-foreground",s)},r))});N.displayName=i.VY.displayName},66990:(e,t,s)=>{s.d(t,{A:()=>a.A});var a=s(34027)},70316:(e,t,s)=>{s.d(t,{FJ:()=>n,l4:()=>a});const a={headline:"Same-Day Event Photo & Video",subtext:"Why wait weeks? We deliver in hours.",heroBackground:"/hero-background.jpg",ctaButtons:[{text:"Our Services",type:"primary"},{text:"Get A Quote",type:"secondary"}]},n={title:"Ready for Turbo Speed?",subtitle:"Get same-day delivery that keeps your audience engaged while the energy's still electric.",phone:"1300 207 446",email:"[email protected]",address:"Australia \u2022 New Zealand \u2022 Singapore",socialLinks:[{platform:"Instagram",handle:"@turbo360au",url:"https://instagram.com/turbo360au",icon:"instagram"},{platform:"LinkedIn",handle:"turbo360-australia",url:"https://www.linkedin.com/company/turbo360/",icon:"linkedin"},{platform:"Facebook",handle:"turbo.au",url:"https://www.facebook.com/turbo.au",icon:"facebook"}],urgencyMessage:"Event tomorrow? No problem. We thrive on tight deadlines.",finalCta:"Get Your Quote Now"}},75239:(e,t,s)=>{s.d(t,{G7:()=>f,L$:()=>v,h_:()=>j,oI:()=>b,uB:()=>g,xL:()=>y});var a=s(89379),n=s(53986),r=s(65043),i=s(1307),o=s(39292),l=s(1089),c=(s(65598),s(70579));const d=["className"],m=["className"],p=["className"],x=["className"],h=["className"],u=["className"],g=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,d);return(0,c.jsx)(i.uB,(0,a.A)({ref:t,className:(0,l.cn)("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",s)},r))});g.displayName=i.uB.displayName;const f=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,m);return(0,c.jsxs)("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[(0,c.jsx)(o.A,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),(0,c.jsx)(i.uB.Input,(0,a.A)({ref:t,className:(0,l.cn)("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",s)},r))]})});f.displayName=i.uB.Input.displayName;const b=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,p);return(0,c.jsx)(i.uB.List,(0,a.A)({ref:t,className:(0,l.cn)("max-h-[300px] overflow-y-auto overflow-x-hidden",s)},r))});b.displayName=i.uB.List.displayName;const y=r.forwardRef((e,t)=>
1(0,c.jsx)(i.uB.Empty,(0,a.A)({ref:t,className:"py-6 text-center text-sm"},e)));y.displayName=i.uB.Empty.displayName;const v=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,x);return(0,c.jsx)(i.uB.Group,(0,a.A)({ref:t,className:(0,l.cn)("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",s)},r))});v.displayName=i.uB.Group.displayName;r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,h);return(0,c.jsx)(i.uB.Separator,(0,a.A)({ref:t,className:(0,l.cn)("-mx-1 h-px bg-border",s)},r))}).displayName=i.uB.Separator.displayName;const j=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,u);return(0,c.jsx)(i.uB.Item,(0,a.A)({ref:t,className:(0,l.cn)("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",s)},r))});j.displayName=i.uB.Item.displayName},75661:(e,t,s)=>{s.d(t,{A:()=>m});var a=s(89379),n=s(65043),r=s(25352),i=s(77819),o=s(22024),l=s(35746),c=s(63574),d=s(70579);const m=e=>{let{eventTypes:t,source:s,location:m="Melbourne"}=e;const p=(0,r.Zp)(),[x,h]=(0,n.useState)({name:"",company:"",eventType:"",eventDate:"",email:"",phone:"",message:"",website:""}),[u,g]=(0,n.useState)({}
1),[f,b]=(0,n.useState)(!1),[y,v]=(0,n.useState)(null),j=(e,t)=>{h(s=>(0,a.A)((0,a.A)({},s),{},{[e]:t})),u[e]&&g(t=>(0,a.A)((0,a.A)({},t),{},{[e]:""}))},w=e=>"w-full px-4 py-3 rounded-lg border-2 bg-white text-gray-900 placeholder-gray-400 transition-all duration-200 focus:outline-none focus:ring-0 ".concat(u[e]?"border-red-400 focus:border-red-500":"border-gray-200 focus:border-[var(--burnt-orange)]");return(0,d.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),(()=>{const e={};return x.name.trim()||(e.name="Name is required"),x.email.trim()?/\S+@\S+\.\S+/.test(x.email)||(e.email="Please enter a valid email"):e.email="Email is required",x.phone.trim()||(e.phone="Phone number is required"),x.eventType||(e.eventType="Please select an event type"),g(e),0===Object.keys(e).length})()){b(!0),v(null);try{const e={name:x.name,email:x.email,mobile:x.phone,business_name:x.company,event_date:x.eventDate,location:m,service:x.eventType,brief:x.message||"",source:s||"Google Ads Landing Page",honeypot:x.website};(await fetch("".concat(c.fn,"/api/quotes"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok?(window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"form_submission",form_name:"get_quote"}),p("/contact/thank-you")):v("Something went wrong. Please call us on 1300 207 446.")}catch(t){v("Something went wrong. Please call us on 1300 207 446.")}finally{b(!1)}}},className:"space-y-4",noValidate:!0,children:[(0,d.jsxs)("div",{className:"absolute -left-[9999px]","aria-hidden":"true",tabIndex:-1,children:[(0,d.jsx)("label",{htmlFor:"website",children:"Website"}),(0,d.jsx)("input",{type:"text",id:"website",name:"website",value:x.website,onChange:e=>j("website",e.target.value),autoComplete:"off",tabIndex:-1})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("input",{type:"text",placeholder:"Your Name *",className:w("name"),value:x.name,onChange:e=>j("name",e.target.value)}),u.name&&(0,d.jsx)("p",{className:"mt-1 text-sm text-red-400",children:u.name})]}),(0,d.jsx)("div",{children:(0,d.jsx)("input",{type:"text",placeholder:"Company Name",className:w("company"),value:x.company,onChange:e=>j("company",e.target.value)})}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("select",{className:w("eventType"),value:x.eventType,onChange:e=>j("eventType",e.target.value),children:[(0,d.jsx)("option",{value:"",children:"Select Event Type *"}),t.map(e=>(0,d.jsx)("option",{value:e,children:e},e))]}),u.eventType&&(0,d.jsx)("p",{className:"mt-1 text-sm text-red-400",children:u.eventType})]}),(0,d.jsx)("div",{children:(0,d.jsx)("input",{type:"date",placeholder:"Event Date",className:w("eventDate"),value:x.eventDate,onChange:e=>j("eventDate",e.target.value)})}),(0,d.jsxs)("div",{children:[(0,d.jsx)("input",{type:"email",placeholder:"Email Address *",className:w("email"),value:x.email,onChange:e=>j("email",e.target.value)}),u.email&&(0,d.jsx)("p",{className:"mt-1 text-sm text-red-400",children:u.email})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("input",{type:"tel",placeholder:"Phone Number *",className:w("phone"),value:x.phone,onChange:e=>j("phone",e.target.value)}),u.phone&&(0,d.jsx)("p",{className:"mt-1 text-sm text-red-400",children:u.phone})]}),(0,d.jsx)("div",{children:(0,d.jsx)("textarea",{placeholder:"Tell us about your event (optional)",rows:3,className:w("message"),value:x.message,onChange:e=>j("message",e.target.value)})}),y&&(0,d.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-red-50 border border-red-200 rounded-lg text-red-700 text-sm",children:[(0,d.jsx)(i.A,{className:"w-4 h-4 flex-shrink-0"}),y]}),(0,d.jsx)("button",{type:"submit",disabled:f,className:"w-full py-4 rounded-lg font-bold text-lg text-white transition-all duration-200 flex items-center justify-center gap-2 disabled:opacity-60",style:{backgroundColor:"var(--burnt-orange)"},children:f?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.A,{className:"w-5 h-5 animate-spin"}),"Sending..."]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.A,{className:"w-5 h-5"}),"Get Your Free Quote"]})}),(0,d.jsx)("p",{className:"text-center text-xs text-gray-500",children:"We respond within 2 hours during business hours."})]})}},78162:(e,t,s)=>{s.d(t,{iU:()=>n,xJ:()=>a});const a=[{value:"Australia/Melbourne",label:"Melbourne (AEST/AEDT)"},{value:"Australia/Sydney",label:"Sydney (AEST/AEDT)"},{value:"Australia/Brisbane",label:"Brisbane (AEST)"},{value:"Australia/Perth",label:"Perth (AWST)"},{value:"Australia/Adelaide",label:"Adelaide (ACST/ACDT)"},{value:"Australia/Darwin",label:"Darwin (ACST)"},{value:"Australia/Hobart",label:"Hobart (AEST/AEDT)"},{value:"Pacific/Auckland",label:"Auckland (NZST/NZDT)"},{value:"Asia/Singapore",label:"Singapore (SGT)"},{value:"Asia/Tokyo",label:"Tokyo (JST)"}
1,{value:"America/New_York",label:"New York (EST/EDT)"},{value:"America/Los_Angeles",label:"Los Angeles (PST/PDT)"},{value:"Europe/London",label:"London (GMT/BST)"}],n=e=>{try{const t=new Intl.DateTimeFormat("en-AU",{timeZone:e,timeZoneName:"short"}),s=t.formatToParts(new Date).find(e=>"timeZoneName"===e.type);return s?s.value:""}catch(t){return""}}},78615:(e,t,s)=>{s.d(t,{AM:()=>d,Wv:()=>m,hl:()=>p});var a=s(89379),n=s(53986),r=s(65043),i=s(19604),o=s(1089),l=s(70579);const c=["className","align","sideOffset"],d=i.bL,m=i.l9,p=(i.Mz,r.forwardRef((e,t)=>{let{className:s,align:r="center",sideOffset:d=4}=e,m=(0,n.A)(e,c);return(0,l.jsx)(i.ZL,{children:(0,l.jsx)(i.UC,(0,a.A)({ref:t,align:r,sideOffset:d,className:(0,o.cn)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",s)},m))})}));p.displayName=i.UC.displayName},91140:(e,t,s)=>{s.d(t,{Wu:()=>f,ZB:()=>g,Zp:()=>h,aR:()=>u});var a=s(89379),n=s(53986),r=s(65043),i=s(1089),o=s(70579);const l=["className"],c=["className"],d=["className"],m=["className"],p=["className"],x=["className"],h=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,l);return(0,o.jsx)("div",(0,a.A)({ref:t,className:(0,i.cn)("rounded-xl border bg-card text-card-foreground shadow",s)},r))});h.displayName="Card";const u=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,c);return(0,o.jsx)("div",(0,a.A)({ref:t,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",s)},r))});u.displayName="CardHeader";const g=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,d);return(0,o.jsx)("div",(0,a.A)({ref:t,className:(0,i.cn)("font-semibold leading-none tracking-tight",s)},r))});g.displayName="CardTitle";r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,m);return(0,o.jsx)("div",(0,a.A)({ref:t,className:(0,i.cn)("text-sm text-muted-foreground",s)},r))}).displayName="CardDescription";const f=r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,p);return(0,o.jsx)("div",(0,a.A)({ref:t,className:(0,i.cn)("p-6 pt-0",s)},r))});f.displayName="CardContent";r.forwardRef((e,t)=>{let{className:s}=e,r=(0,n.A)(e,x);return(0,o.jsx)("div",(0,a.A)({ref:t,className:(0,i.cn)("flex items-center p-6 pt-0",s)},r))}).displayName="CardFooter"},93063:(e,t,s)=>{s.d(t,{A:()=>r});var a=s(25352),n=s(70579);function r(e){let{to:t}=e;const{search:s,hash:r}=(0,a.zy)();return(0,n.jsx)(a.C5,{to:"".concat(t).concat(s).concat(r),replace:!0})}}},t={};function s(a){var n=t[a];if(void 0!==n)return n.exports;var r=t[a]={id:a,loaded:!1,exports:{}};return e[a].call(r.exports,r,r.exports,s),r.loaded=!0,r.exports}s.m=e,s.amdO={},(()=>{var e=[];s.O=(t,a,n,r)=>{if(!a){var i=1/0;for(d=0;d<e.length;d++){a=e[d][0],n=e[d][1],r=e[d][2];for(var o=!0,l=0;l<a.length;l++)(!1&r||i>=r)&&Object.keys(s.O).every(e=>s.O[e](a[l]))?a.splice(l--,1):(o=!1,r<i&&(i=r));if(o){e.splice(d--,1);var c=n();void 0!==c&&(t=c)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[a,n,r]}})(),s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;s.t=function(a,n){if(1&n&&(a=this(a)),8&n)return a;if("object"===typeof a&&a){if(4&n&&a.__esModule)return a;
1if(16&n&&"function"===typeof a.then)return a}var r=Object.create(null);s.r(r);var i={};e=e||[null,t({}),t([]),t(t)];for(var o=2&n&&a;("object"==typeof o||"function"==typeof o)&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach(e=>i[e]=()=>a[e]);return i.default=()=>a,s.d(r,i),r}})(),s.d=(e,t)=>{for(var a in t)s.o(t,a)&&!s.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,a)=>(s.f[a](e,t),t),[])),s.u=e=>"static/js/"+e+"."+{16:"11083ddb",131:"181d526b",411:"8df9028f",507:"035d125b",531:"e4db9e9f",766:"9efc4063",801:"2f41c0d4",925:"c84832d0",984:"c81b204c",999:"366fe1c1"}[e]+".chunk.js",s.miniCssF=e=>"static/css/"+e+".edc60c60.chunk.css",s.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="frontend:";s.l=(a,n,r,i)=>{if(e[a])e[a].push(n);else{var o,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var m=c[d];if(m.getAttribute("src")==a||m.getAttribute("data-webpack")==t+r){o=m;break}}o||(l=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-webpack",t+r),o.src=a),e[a]=[n];var p=(t,s)=>{o.onerror=o.onload=null,clearTimeout(x);var n=e[a];if(delete e[a],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach(e=>e(s)),t)return t(s)},x=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),l&&document.head.appendChild(o)}}})(),s.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.p="/",(()=>{if("undefined"!==typeof document){var e=e=>new Promise((t,a)=>{var n=s.miniCssF(e),r=s.p+n;if(((e,t)=>{for(var s=document.getElementsByTagName("link"),a=0;a<s.length;a++){var n=(i=s[a]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(n===e||n===t))return i}var r=document.getElementsByTagName("style");for(a=0;a<r.length;a++){var i;if((n=(i=r[a]).getAttribute("data-href"))===e||n===t)return i}})(n,r))return t();((e,t,a,n,r)=>{var i=document.createElement("link");i.rel="stylesheet",i.type="text/css",s.nc&&(i.nonce=s.nc),i.onerror=i.onload=s=>{if(i.onerror=i.onload=null,"load"===s.type)n();else{var a=s&&s.type,o=s&&s.target&&s.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+a+": "+o+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=a,l.request=o,i.parentNode&&i.parentNode.removeChild(i),r(l)}},i.href=t,a?a.parentNode.insertBefore(i,a.nextSibling):document.head.appendChild(i)})(e,r,null,t,a)}),t={792:0};s.f.miniCss=(s,a)=>{t[s]?a.push(t[s]):0!==t[s]&&{531:1}[s]&&a.push(t[s]=e(s).then(()=>{t[s]=0},e=>{throw delete t[s],e}))}}})(),(()=>{var e={792:0};s.f.j=(t,a)=>{var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)a.push(n[2]);else{var r=new Promise((s,a)=>n=e[t]=[s,a]);a.push(n[2]=r);var i=s.p+s.u(t),o=new Error;s.l(i,a=>{if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=a&&("load"===a.type?"missing":a.type),i=a&&a.target&&a.target.src;o.message="Loading chunk "+t+" failed.\n("+r+": "+i+")",o.name="ChunkLoadError",o.type=r,o.request=i,n[1](o)}},"chunk-"+t,t)}},s.O.j=t=>0===e[t];var t=(t,a)=>{var n,r,i=a[0],o=a[1],l=a[2],c=0;if(i.some(t=>0!==e[t])){for(n in o)s.o(o,n)&&(s.m[n]=o[n]);if(l)var d=l(s)}for(t&&t(a);c<i.length;c++)r=i[c],s.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return s.O(d)},a=self.webpackChunkfrontend=self.webpackChunkfrontend||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})(),s.nc=void 0;var a=s.O(void 0,[484,426,723,988,96],()=>s(48696));a=s.O(a)})(); 2//# sourceMappingURL=main.8566b9fe.js.map
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.